mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-05-20 21:49:14 +08:00
build: compile 1.11.6
This commit is contained in:
parent
22f39e86b9
commit
e5f462263b
1
dist/cascader/index.js
vendored
1
dist/cascader/index.js
vendored
@ -148,6 +148,7 @@ VantComponent({
|
|||||||
selected: null,
|
selected: null,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
activeTab: 0,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onClose() {
|
onClose() {
|
||||||
|
1
dist/definitions/index.d.ts
vendored
1
dist/definitions/index.d.ts
vendored
@ -4,6 +4,7 @@ interface VantComponentInstance {
|
|||||||
children: WechatMiniprogram.Component.TrivialInstance[];
|
children: WechatMiniprogram.Component.TrivialInstance[];
|
||||||
index: number;
|
index: number;
|
||||||
$emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void;
|
$emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void;
|
||||||
|
setView: (value: Record<string, any>, callback?: () => void) => void;
|
||||||
}
|
}
|
||||||
export type VantComponentOptions<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption> = {
|
export type VantComponentOptions<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption> = {
|
||||||
data?: Data;
|
data?: Data;
|
||||||
|
14
dist/field/index.js
vendored
14
dist/field/index.js
vendored
@ -31,6 +31,18 @@ VantComponent({
|
|||||||
innerValue: '',
|
innerValue: '',
|
||||||
showClear: false,
|
showClear: false,
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
value(value) {
|
||||||
|
if (value !== this.value) {
|
||||||
|
this.setData({ innerValue: value });
|
||||||
|
this.value = value;
|
||||||
|
this.setShowClear();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
clearTrigger() {
|
||||||
|
this.setShowClear();
|
||||||
|
},
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.value = this.data.value;
|
this.value = this.data.value;
|
||||||
this.setData({ innerValue: this.value });
|
this.setData({ innerValue: this.value });
|
||||||
@ -119,7 +131,7 @@ VantComponent({
|
|||||||
const trigger = clearTrigger === 'always' || (clearTrigger === 'focus' && focused);
|
const trigger = clearTrigger === 'always' || (clearTrigger === 'focus' && focused);
|
||||||
showClear = hasValue && trigger;
|
showClear = hasValue && trigger;
|
||||||
}
|
}
|
||||||
this.setData({ showClear });
|
this.setView({ showClear });
|
||||||
},
|
},
|
||||||
noop() { },
|
noop() { },
|
||||||
},
|
},
|
||||||
|
10
dist/field/props.js
vendored
10
dist/field/props.js
vendored
@ -1,13 +1,5 @@
|
|||||||
export const commonProps = {
|
export const commonProps = {
|
||||||
value: {
|
value: String,
|
||||||
type: String,
|
|
||||||
observer(value) {
|
|
||||||
if (value !== this.value) {
|
|
||||||
this.setData({ innerValue: value });
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
placeholder: String,
|
placeholder: String,
|
||||||
placeholderStyle: String,
|
placeholderStyle: String,
|
||||||
placeholderClass: String,
|
placeholderClass: String,
|
||||||
|
15
dist/mixins/basic.js
vendored
15
dist/mixins/basic.js
vendored
@ -7,5 +7,20 @@ export const basic = Behavior({
|
|||||||
this.setData(data);
|
this.setData(data);
|
||||||
return new Promise((resolve) => wx.nextTick(resolve));
|
return new Promise((resolve) => wx.nextTick(resolve));
|
||||||
},
|
},
|
||||||
|
// high performance setData
|
||||||
|
setView(data, callback) {
|
||||||
|
const target = {};
|
||||||
|
let hasChange = false;
|
||||||
|
Object.keys(data).forEach((key) => {
|
||||||
|
if (data[key] !== this.data[key]) {
|
||||||
|
target[key] = data[key];
|
||||||
|
hasChange = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (hasChange) {
|
||||||
|
return this.setData(target, callback);
|
||||||
|
}
|
||||||
|
return callback && callback();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
4
dist/uploader/index.js
vendored
4
dist/uploader/index.js
vendored
@ -1,7 +1,7 @@
|
|||||||
import { VantComponent } from '../common/component';
|
import { VantComponent } from '../common/component';
|
||||||
import { isImageFile, chooseFile, isVideoFile } from './utils';
|
|
||||||
import { imageProps, videoProps, mediaProps, messageFileProps } from './shared';
|
|
||||||
import { isBoolean, isPromise } from '../common/validator';
|
import { isBoolean, isPromise } from '../common/validator';
|
||||||
|
import { imageProps, mediaProps, messageFileProps, videoProps } from './shared';
|
||||||
|
import { chooseFile, isImageFile, isVideoFile } from './utils';
|
||||||
VantComponent({
|
VantComponent({
|
||||||
props: Object.assign(Object.assign(Object.assign(Object.assign({ disabled: Boolean, multiple: Boolean, uploadText: String, useBeforeRead: Boolean, afterRead: null, beforeRead: null, previewSize: {
|
props: Object.assign(Object.assign(Object.assign(Object.assign({ disabled: Boolean, multiple: Boolean, uploadText: String, useBeforeRead: Boolean, afterRead: null, beforeRead: null, previewSize: {
|
||||||
type: null,
|
type: null,
|
||||||
|
1
dist/uploader/index.wxml
vendored
1
dist/uploader/index.wxml
vendored
@ -29,6 +29,7 @@
|
|||||||
poster="{{ item.thumb }}"
|
poster="{{ item.thumb }}"
|
||||||
autoplay="{{ item.autoplay }}"
|
autoplay="{{ item.autoplay }}"
|
||||||
object-fit="{{videoFit}}"
|
object-fit="{{videoFit}}"
|
||||||
|
referrer-policy="{{videoReferrerPolicy}}"
|
||||||
class="van-uploader__preview-image"
|
class="van-uploader__preview-image"
|
||||||
style="{{ computed.sizeStyle({ previewSize }) }}"
|
style="{{ computed.sizeStyle({ previewSize }) }}"
|
||||||
data-index="{{ index }}"
|
data-index="{{ index }}"
|
||||||
|
4
dist/uploader/shared.d.ts
vendored
4
dist/uploader/shared.d.ts
vendored
@ -29,6 +29,10 @@ export declare const videoProps: {
|
|||||||
type: StringConstructor;
|
type: StringConstructor;
|
||||||
value: string;
|
value: string;
|
||||||
};
|
};
|
||||||
|
referrerPolicy: {
|
||||||
|
type: StringConstructor;
|
||||||
|
value: string;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
export declare const mediaProps: {
|
export declare const mediaProps: {
|
||||||
capture: {
|
capture: {
|
||||||
|
4
dist/uploader/shared.js
vendored
4
dist/uploader/shared.js
vendored
@ -31,6 +31,10 @@ export const videoProps = {
|
|||||||
type: String,
|
type: String,
|
||||||
value: 'back',
|
value: 'back',
|
||||||
},
|
},
|
||||||
|
referrerPolicy: {
|
||||||
|
type: String,
|
||||||
|
value: 'no-referrer',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
// props for media
|
// props for media
|
||||||
export const mediaProps = {
|
export const mediaProps = {
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
"condition": false
|
"condition": false
|
||||||
},
|
},
|
||||||
"compileType": "miniprogram",
|
"compileType": "miniprogram",
|
||||||
"libVersion": "2.6.5",
|
"libVersion": "2.27.3",
|
||||||
"appid": "wx1c01b35002d3ba14",
|
"appid": "wx1c01b35002d3ba14",
|
||||||
"projectname": "vant-weapp",
|
"projectname": "vant-weapp",
|
||||||
"condition": {
|
"condition": {
|
||||||
|
@ -161,6 +161,7 @@ var defaultFieldNames = {
|
|||||||
selected: null,
|
selected: null,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
activeTab: 0,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onClose: function () {
|
onClose: function () {
|
||||||
|
1
lib/definitions/index.d.ts
vendored
1
lib/definitions/index.d.ts
vendored
@ -4,6 +4,7 @@ interface VantComponentInstance {
|
|||||||
children: WechatMiniprogram.Component.TrivialInstance[];
|
children: WechatMiniprogram.Component.TrivialInstance[];
|
||||||
index: number;
|
index: number;
|
||||||
$emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void;
|
$emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void;
|
||||||
|
setView: (value: Record<string, any>, callback?: () => void) => void;
|
||||||
}
|
}
|
||||||
export type VantComponentOptions<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption> = {
|
export type VantComponentOptions<Data extends WechatMiniprogram.Component.DataOption, Props extends WechatMiniprogram.Component.PropertyOption, Methods extends WechatMiniprogram.Component.MethodOption> = {
|
||||||
data?: Data;
|
data?: Data;
|
||||||
|
@ -44,6 +44,18 @@ var props_1 = require("./props");
|
|||||||
innerValue: '',
|
innerValue: '',
|
||||||
showClear: false,
|
showClear: false,
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
value: function (value) {
|
||||||
|
if (value !== this.value) {
|
||||||
|
this.setData({ innerValue: value });
|
||||||
|
this.value = value;
|
||||||
|
this.setShowClear();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
clearTrigger: function () {
|
||||||
|
this.setShowClear();
|
||||||
|
},
|
||||||
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
this.value = this.data.value;
|
this.value = this.data.value;
|
||||||
this.setData({ innerValue: this.value });
|
this.setData({ innerValue: this.value });
|
||||||
@ -133,7 +145,7 @@ var props_1 = require("./props");
|
|||||||
var trigger = clearTrigger === 'always' || (clearTrigger === 'focus' && focused);
|
var trigger = clearTrigger === 'always' || (clearTrigger === 'focus' && focused);
|
||||||
showClear = hasValue && trigger;
|
showClear = hasValue && trigger;
|
||||||
}
|
}
|
||||||
this.setData({ showClear: showClear });
|
this.setView({ showClear: showClear });
|
||||||
},
|
},
|
||||||
noop: function () { },
|
noop: function () { },
|
||||||
},
|
},
|
||||||
|
@ -2,15 +2,7 @@
|
|||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.textareaProps = exports.inputProps = exports.commonProps = void 0;
|
exports.textareaProps = exports.inputProps = exports.commonProps = void 0;
|
||||||
exports.commonProps = {
|
exports.commonProps = {
|
||||||
value: {
|
value: String,
|
||||||
type: String,
|
|
||||||
observer: function (value) {
|
|
||||||
if (value !== this.value) {
|
|
||||||
this.setData({ innerValue: value });
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
placeholder: String,
|
placeholder: String,
|
||||||
placeholderStyle: String,
|
placeholderStyle: String,
|
||||||
placeholderClass: String,
|
placeholderClass: String,
|
||||||
|
@ -10,5 +10,21 @@ exports.basic = Behavior({
|
|||||||
this.setData(data);
|
this.setData(data);
|
||||||
return new Promise(function (resolve) { return wx.nextTick(resolve); });
|
return new Promise(function (resolve) { return wx.nextTick(resolve); });
|
||||||
},
|
},
|
||||||
|
// high performance setData
|
||||||
|
setView: function (data, callback) {
|
||||||
|
var _this = this;
|
||||||
|
var target = {};
|
||||||
|
var hasChange = false;
|
||||||
|
Object.keys(data).forEach(function (key) {
|
||||||
|
if (data[key] !== _this.data[key]) {
|
||||||
|
target[key] = data[key];
|
||||||
|
hasChange = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (hasChange) {
|
||||||
|
return this.setData(target, callback);
|
||||||
|
}
|
||||||
|
return callback && callback();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -12,9 +12,9 @@ var __assign = (this && this.__assign) || function () {
|
|||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
var component_1 = require("../common/component");
|
var component_1 = require("../common/component");
|
||||||
var utils_1 = require("./utils");
|
|
||||||
var shared_1 = require("./shared");
|
|
||||||
var validator_1 = require("../common/validator");
|
var validator_1 = require("../common/validator");
|
||||||
|
var shared_1 = require("./shared");
|
||||||
|
var utils_1 = require("./utils");
|
||||||
(0, component_1.VantComponent)({
|
(0, component_1.VantComponent)({
|
||||||
props: __assign(__assign(__assign(__assign({ disabled: Boolean, multiple: Boolean, uploadText: String, useBeforeRead: Boolean, afterRead: null, beforeRead: null, previewSize: {
|
props: __assign(__assign(__assign(__assign({ disabled: Boolean, multiple: Boolean, uploadText: String, useBeforeRead: Boolean, afterRead: null, beforeRead: null, previewSize: {
|
||||||
type: null,
|
type: null,
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
poster="{{ item.thumb }}"
|
poster="{{ item.thumb }}"
|
||||||
autoplay="{{ item.autoplay }}"
|
autoplay="{{ item.autoplay }}"
|
||||||
object-fit="{{videoFit}}"
|
object-fit="{{videoFit}}"
|
||||||
|
referrer-policy="{{videoReferrerPolicy}}"
|
||||||
class="van-uploader__preview-image"
|
class="van-uploader__preview-image"
|
||||||
style="{{ computed.sizeStyle({ previewSize }) }}"
|
style="{{ computed.sizeStyle({ previewSize }) }}"
|
||||||
data-index="{{ index }}"
|
data-index="{{ index }}"
|
||||||
|
4
lib/uploader/shared.d.ts
vendored
4
lib/uploader/shared.d.ts
vendored
@ -29,6 +29,10 @@ export declare const videoProps: {
|
|||||||
type: StringConstructor;
|
type: StringConstructor;
|
||||||
value: string;
|
value: string;
|
||||||
};
|
};
|
||||||
|
referrerPolicy: {
|
||||||
|
type: StringConstructor;
|
||||||
|
value: string;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
export declare const mediaProps: {
|
export declare const mediaProps: {
|
||||||
capture: {
|
capture: {
|
||||||
|
@ -34,6 +34,10 @@ exports.videoProps = {
|
|||||||
type: String,
|
type: String,
|
||||||
value: 'back',
|
value: 'back',
|
||||||
},
|
},
|
||||||
|
referrerPolicy: {
|
||||||
|
type: String,
|
||||||
|
value: 'no-referrer',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
// props for media
|
// props for media
|
||||||
exports.mediaProps = {
|
exports.mediaProps = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user