weapp版本升级到1.11.7
"version": "1.11.7"
This commit is contained in:
+2
-1
@@ -5,7 +5,8 @@ String.prototype.splice = function(start = 0, deleteCount = 0, addStr = '') {
|
|||||||
}
|
}
|
||||||
module.exports = {
|
module.exports = {
|
||||||
versionHigherThan(version = '') {
|
versionHigherThan(version = '') {
|
||||||
var v1 = wx.getSystemInfoSync().SDKVersion.split('.');
|
//旧版 var v1 = wx.getSystemInfoSync().SDKVersion.split('.');
|
||||||
|
var v1 = wx.getAppBaseInfo().SDKVersion.split('.');
|
||||||
var v2 = version.split('.');
|
var v2 = version.split('.');
|
||||||
const len = Math.max(v1.length, v2.length);
|
const len = Math.max(v1.length, v2.length);
|
||||||
while (v1.length < len) {
|
while (v1.length < len) {
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ var defaultFieldNames = {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: true,
|
value: true,
|
||||||
},
|
},
|
||||||
|
ellipsis: {
|
||||||
|
type: Boolean,
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
showHeader: {
|
showHeader: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: true,
|
value: true,
|
||||||
@@ -161,6 +165,7 @@ var defaultFieldNames = {
|
|||||||
selected: null,
|
selected: null,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
activeTab: 0,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onClose: function () {
|
onClose: function () {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
color="{{ activeColor }}"
|
color="{{ activeColor }}"
|
||||||
border="{{ false }}"
|
border="{{ false }}"
|
||||||
swipeable="{{ swipeable }}"
|
swipeable="{{ swipeable }}"
|
||||||
|
ellipsis="{{ ellipsis }}"
|
||||||
bind:click="onClickTab"
|
bind:click="onClickTab"
|
||||||
>
|
>
|
||||||
<van-tab
|
<van-tab
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ var animate_1 = require("./animate");
|
|||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
expanded: false,
|
expanded: false,
|
||||||
|
parentBorder: true,
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.updateExpanded();
|
this.updateExpanded();
|
||||||
@@ -36,7 +37,7 @@ var animate_1 = require("./animate");
|
|||||||
if (!this.parent) {
|
if (!this.parent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var _a = this.parent.data, value = _a.value, accordion = _a.accordion;
|
var _a = this.parent.data, value = _a.value, accordion = _a.accordion, border = _a.border;
|
||||||
var _b = this.parent.children, children = _b === void 0 ? [] : _b;
|
var _b = this.parent.children, children = _b === void 0 ? [] : _b;
|
||||||
var name = this.data.name;
|
var name = this.data.name;
|
||||||
var index = children.indexOf(this);
|
var index = children.indexOf(this);
|
||||||
@@ -47,7 +48,7 @@ var animate_1 = require("./animate");
|
|||||||
if (expanded !== this.data.expanded) {
|
if (expanded !== this.data.expanded) {
|
||||||
(0, animate_1.setContentAnimate)(this, expanded, this.mounted);
|
(0, animate_1.setContentAnimate)(this, expanded, this.mounted);
|
||||||
}
|
}
|
||||||
this.setData({ index: index, expanded: expanded });
|
this.setData({ index: index, expanded: expanded, parentBorder: border });
|
||||||
},
|
},
|
||||||
onClick: function () {
|
onClick: function () {
|
||||||
if (this.data.disabled) {
|
if (this.data.disabled) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||||
|
|
||||||
<view class="van-collapse-item custom-class {{ index !== 0 ? 'van-hairline--top' : '' }}">
|
<view class="van-collapse-item custom-class {{ index !== 0 && parentBorder ? 'van-hairline--top' : '' }}">
|
||||||
<van-cell
|
<van-cell
|
||||||
size="{{ size }}"
|
size="{{ size }}"
|
||||||
title="{{ title }}"
|
title="{{ title }}"
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ exports.canIUseGetUserProfile = exports.canIUseCanvas2d = exports.canIUseNextTic
|
|||||||
var systemInfo;
|
var systemInfo;
|
||||||
function getSystemInfoSync() {
|
function getSystemInfoSync() {
|
||||||
if (systemInfo == null) {
|
if (systemInfo == null) {
|
||||||
systemInfo = wx.getSystemInfoSync();
|
//旧版 systemInfo = wx.getSystemInfoSync();
|
||||||
|
systemInfo = wx.getAppBaseInfo();
|
||||||
|
|
||||||
}
|
}
|
||||||
return systemInfo;
|
return systemInfo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -90,15 +90,16 @@ var utils_1 = require("../common/utils");
|
|||||||
this.close('overlay');
|
this.close('overlay');
|
||||||
},
|
},
|
||||||
close: function (action) {
|
close: function (action) {
|
||||||
var _this = this;
|
|
||||||
this.setData({ show: false });
|
this.setData({ show: false });
|
||||||
wx.nextTick(function () {
|
this.closeAction = action;
|
||||||
_this.$emit('close', action);
|
},
|
||||||
var callback = _this.data.callback;
|
onAfterLeave: function () {
|
||||||
if (callback) {
|
var action = this.closeAction;
|
||||||
callback(action, _this);
|
this.$emit('close', action);
|
||||||
}
|
var callback = this.data.callback;
|
||||||
});
|
if (callback) {
|
||||||
|
callback(action, this);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
stopLoading: function () {
|
stopLoading: function () {
|
||||||
this.setData({
|
this.setData({
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||||
root-portal="{{ rootPortal }}"
|
root-portal="{{ rootPortal }}"
|
||||||
bind:close="onClickOverlay"
|
bind:close="onClickOverlay"
|
||||||
|
bind:after-leave="onAfterLeave"
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
wx:if="{{ title || useTitleSlot }}"
|
wx:if="{{ title || useTitleSlot }}"
|
||||||
|
|||||||
@@ -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 });
|
||||||
@@ -109,6 +121,9 @@ var props_1 = require("./props");
|
|||||||
onKeyboardHeightChange: function (event) {
|
onKeyboardHeightChange: function (event) {
|
||||||
this.$emit('keyboardheightchange', event.detail);
|
this.$emit('keyboardheightchange', event.detail);
|
||||||
},
|
},
|
||||||
|
onBindNicknameReview: function (event) {
|
||||||
|
this.$emit('nicknamereview', event.detail);
|
||||||
|
},
|
||||||
emitChange: function (detail) {
|
emitChange: function (detail) {
|
||||||
var extraEventParams = this.data.extraEventParams;
|
var extraEventParams = this.data.extraEventParams;
|
||||||
this.setData({ value: detail.value });
|
this.setData({ value: detail.value });
|
||||||
@@ -130,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 () { },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,4 +27,5 @@
|
|||||||
bindfocus="onFocus"
|
bindfocus="onFocus"
|
||||||
bindconfirm="onConfirm"
|
bindconfirm="onConfirm"
|
||||||
bindkeyboardheightchange="onKeyboardHeightChange"
|
bindkeyboardheightchange="onKeyboardHeightChange"
|
||||||
|
bindnicknamereview="onBindNicknameReview"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
@import '../common/index.wxss';.van-image{display:inline-block;position:relative}.van-image--round{border-radius:50%;overflow:hidden}.van-image--round .van-image__img{border-radius:inherit}.van-image__error,.van-image__img,.van-image__loading{display:block;height:100%;width:100%}.van-image__error,.van-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.van-image__loading-icon{color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.van-image__error-icon{color:var(--image-error-icon-color,#dcdee0);font-size:var(--image-error-icon-size,32px)!important}
|
@import '../common/index.wxss';.van-image{display:inline-block;position:relative;vertical-align:top}.van-image--round{border-radius:50%;overflow:hidden}.van-image--round .van-image__img{border-radius:inherit}.van-image__error,.van-image__img,.van-image__loading{display:block;height:100%;width:100%}.van-image__error,.van-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.van-image__loading-icon{color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.van-image__error-icon{color:var(--image-error-icon-color,#dcdee0);font-size:var(--image-error-icon-size,32px)!important}
|
||||||
@@ -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();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ function transition(showDefaultValue) {
|
|||||||
duration: {
|
duration: {
|
||||||
type: null,
|
type: null,
|
||||||
value: 300,
|
value: 300,
|
||||||
observer: 'observeDuration',
|
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -46,76 +45,85 @@ function transition(showDefaultValue) {
|
|||||||
if (value === old) {
|
if (value === old) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
value ? this.enter() : this.leave();
|
value ? this.enureEnter() : this.enureLeave();
|
||||||
},
|
},
|
||||||
enter: function () {
|
enureEnter: function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
if (this.enterFinishedPromise)
|
if (this.enterPromise)
|
||||||
return;
|
return;
|
||||||
this.enterFinishedPromise = new Promise(function (resolve) {
|
this.enterPromise = new Promise(function (resolve) { return _this.enter(resolve); });
|
||||||
var _a = _this.data, duration = _a.duration, name = _a.name;
|
},
|
||||||
var classNames = getClassNames(name);
|
enureLeave: function () {
|
||||||
var currentDuration = (0, validator_1.isObj)(duration) ? duration.enter : duration;
|
var _this = this;
|
||||||
if (_this.status === 'enter') {
|
var enterPromise = this.enterPromise;
|
||||||
|
if (!enterPromise)
|
||||||
|
return;
|
||||||
|
enterPromise
|
||||||
|
.then(function () { return new Promise(function (resolve) { return _this.leave(resolve); }); })
|
||||||
|
.then(function () {
|
||||||
|
_this.enterPromise = null;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
enter: function (resolve) {
|
||||||
|
var _this = this;
|
||||||
|
var _a = this.data, duration = _a.duration, name = _a.name;
|
||||||
|
var classNames = getClassNames(name);
|
||||||
|
var currentDuration = (0, validator_1.isObj)(duration) ? duration.enter : duration;
|
||||||
|
if (this.status === 'enter') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.status = 'enter';
|
||||||
|
this.$emit('before-enter');
|
||||||
|
(0, utils_1.requestAnimationFrame)(function () {
|
||||||
|
if (_this.status !== 'enter') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_this.status = 'enter';
|
_this.$emit('enter');
|
||||||
_this.$emit('before-enter');
|
_this.setData({
|
||||||
|
inited: true,
|
||||||
|
display: true,
|
||||||
|
classes: classNames.enter,
|
||||||
|
currentDuration: currentDuration,
|
||||||
|
});
|
||||||
(0, utils_1.requestAnimationFrame)(function () {
|
(0, utils_1.requestAnimationFrame)(function () {
|
||||||
if (_this.status !== 'enter') {
|
if (_this.status !== 'enter') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_this.$emit('enter');
|
_this.transitionEnded = false;
|
||||||
_this.setData({
|
_this.setData({ classes: classNames['enter-to'] });
|
||||||
inited: true,
|
resolve();
|
||||||
display: true,
|
|
||||||
classes: classNames.enter,
|
|
||||||
currentDuration: currentDuration,
|
|
||||||
});
|
|
||||||
(0, utils_1.requestAnimationFrame)(function () {
|
|
||||||
if (_this.status !== 'enter') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_this.transitionEnded = false;
|
|
||||||
_this.setData({ classes: classNames['enter-to'] });
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
leave: function () {
|
leave: function (resolve) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
if (!this.enterFinishedPromise)
|
if (!this.data.display) {
|
||||||
return;
|
return;
|
||||||
this.enterFinishedPromise.then(function () {
|
}
|
||||||
if (!_this.data.display) {
|
var _a = this.data, duration = _a.duration, name = _a.name;
|
||||||
|
var classNames = getClassNames(name);
|
||||||
|
var currentDuration = (0, validator_1.isObj)(duration) ? duration.leave : duration;
|
||||||
|
this.status = 'leave';
|
||||||
|
this.$emit('before-leave');
|
||||||
|
(0, utils_1.requestAnimationFrame)(function () {
|
||||||
|
if (_this.status !== 'leave') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var _a = _this.data, duration = _a.duration, name = _a.name;
|
_this.$emit('leave');
|
||||||
var classNames = getClassNames(name);
|
_this.setData({
|
||||||
var currentDuration = (0, validator_1.isObj)(duration) ? duration.leave : duration;
|
classes: classNames.leave,
|
||||||
_this.status = 'leave';
|
currentDuration: currentDuration,
|
||||||
_this.$emit('before-leave');
|
});
|
||||||
(0, utils_1.requestAnimationFrame)(function () {
|
(0, utils_1.requestAnimationFrame)(function () {
|
||||||
if (_this.status !== 'leave') {
|
if (_this.status !== 'leave') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_this.$emit('leave');
|
_this.transitionEnded = false;
|
||||||
_this.setData({
|
setTimeout(function () {
|
||||||
classes: classNames.leave,
|
_this.onTransitionEnd();
|
||||||
currentDuration: currentDuration,
|
resolve();
|
||||||
});
|
}, currentDuration);
|
||||||
(0, utils_1.requestAnimationFrame)(function () {
|
_this.setData({ classes: classNames['leave-to'] });
|
||||||
if (_this.status !== 'leave') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_this.transitionEnded = false;
|
|
||||||
setTimeout(function () {
|
|
||||||
_this.onTransitionEnd();
|
|
||||||
_this.enterFinishedPromise = null;
|
|
||||||
}, currentDuration);
|
|
||||||
_this.setData({ classes: classNames['leave-to'] });
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ var utils_1 = require("../common/utils");
|
|||||||
(0, utils_1.getRect)(_this, '.van-notice-bar__wrap'),
|
(0, utils_1.getRect)(_this, '.van-notice-bar__wrap'),
|
||||||
]).then(function (rects) {
|
]).then(function (rects) {
|
||||||
var contentRect = rects[0], wrapRect = rects[1];
|
var contentRect = rects[0], wrapRect = rects[1];
|
||||||
var _a = _this.data, speed = _a.speed, scrollable = _a.scrollable, delay = _a.delay;
|
var scrollable = _this.data.scrollable;
|
||||||
if (contentRect == null ||
|
if (contentRect == null ||
|
||||||
wrapRect == null ||
|
wrapRect == null ||
|
||||||
!contentRect.width ||
|
!contentRect.width ||
|
||||||
@@ -73,20 +73,26 @@ var utils_1 = require("../common/utils");
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (scrollable || wrapRect.width < contentRect.width) {
|
if (scrollable || wrapRect.width < contentRect.width) {
|
||||||
var duration = ((wrapRect.width + contentRect.width) / speed) * 1000;
|
_this.initAnimation(wrapRect.width, contentRect.width);
|
||||||
_this.wrapWidth = wrapRect.width;
|
|
||||||
_this.contentWidth = contentRect.width;
|
|
||||||
_this.duration = duration;
|
|
||||||
_this.animation = wx.createAnimation({
|
|
||||||
duration: duration,
|
|
||||||
timingFunction: 'linear',
|
|
||||||
delay: delay,
|
|
||||||
});
|
|
||||||
_this.scroll(true);
|
_this.scroll(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
initAnimation: function (warpWidth, contentWidth) {
|
||||||
|
var _a = this.data, speed = _a.speed, delay = _a.delay;
|
||||||
|
this.wrapWidth = warpWidth;
|
||||||
|
this.contentWidth = contentWidth;
|
||||||
|
// begin 0
|
||||||
|
this.contentDuration = (contentWidth / speed) * 1000;
|
||||||
|
// begin -wrapWidth
|
||||||
|
this.duration = ((warpWidth + contentWidth) / speed) * 1000;
|
||||||
|
this.animation = wx.createAnimation({
|
||||||
|
duration: this.contentDuration,
|
||||||
|
timingFunction: 'linear',
|
||||||
|
delay: delay,
|
||||||
|
});
|
||||||
|
},
|
||||||
scroll: function (isInit) {
|
scroll: function (isInit) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
if (isInit === void 0) { isInit = false; }
|
if (isInit === void 0) { isInit = false; }
|
||||||
@@ -98,17 +104,18 @@ var utils_1 = require("../common/utils");
|
|||||||
.step()
|
.step()
|
||||||
.export(),
|
.export(),
|
||||||
});
|
});
|
||||||
|
var duration = isInit ? this.contentDuration : this.duration;
|
||||||
(0, utils_1.requestAnimationFrame)(function () {
|
(0, utils_1.requestAnimationFrame)(function () {
|
||||||
_this.setData({
|
_this.setData({
|
||||||
animationData: _this.animation
|
animationData: _this.animation
|
||||||
.translateX(-_this.contentWidth)
|
.translateX(-_this.contentWidth)
|
||||||
.step()
|
.step({ duration: duration })
|
||||||
.export(),
|
.export(),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.timer = setTimeout(function () {
|
this.timer = setTimeout(function () {
|
||||||
_this.scroll();
|
_this.scroll();
|
||||||
}, this.duration + this.data.delay);
|
}, duration + this.data.delay);
|
||||||
},
|
},
|
||||||
onClickIcon: function (event) {
|
onClickIcon: function (event) {
|
||||||
if (this.data.mode === 'closeable') {
|
if (this.data.mode === 'closeable') {
|
||||||
|
|||||||
@@ -85,18 +85,18 @@ function equal(value1, value2) {
|
|||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
this.setData({
|
this.setData({
|
||||||
currentValue: this.format(this.data.value),
|
currentValue: this.format(this.data.value).newValue,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
observeValue: function () {
|
observeValue: function () {
|
||||||
var value = this.data.value;
|
var value = this.data.value;
|
||||||
this.setData({ currentValue: this.format(value) });
|
this.setData({ currentValue: this.format(value).newValue });
|
||||||
},
|
},
|
||||||
check: function () {
|
check: function () {
|
||||||
var val = this.format(this.data.currentValue);
|
var newValue = this.format(this.data.currentValue).newValue;
|
||||||
if (!equal(val, this.data.currentValue)) {
|
if (!equal(newValue, this.data.currentValue)) {
|
||||||
this.setData({ currentValue: val });
|
this.setData({ currentValue: newValue });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isDisabled: function (type) {
|
isDisabled: function (type) {
|
||||||
@@ -110,10 +110,10 @@ function equal(value1, value2) {
|
|||||||
this.$emit('focus', event.detail);
|
this.$emit('focus', event.detail);
|
||||||
},
|
},
|
||||||
onBlur: function (event) {
|
onBlur: function (event) {
|
||||||
var value = this.format(event.detail.value);
|
var data = this.format(event.detail.value);
|
||||||
this.setData({ currentValue: value });
|
this.setData({ currentValue: data.newValue });
|
||||||
this.emitChange(value);
|
this.emitChange(data);
|
||||||
this.$emit('blur', __assign(__assign({}, event.detail), { value: value }));
|
this.$emit('blur', __assign(__assign({}, event.detail), { value: +data.newValue }));
|
||||||
},
|
},
|
||||||
// filter illegal characters
|
// filter illegal characters
|
||||||
filter: function (value) {
|
filter: function (value) {
|
||||||
@@ -123,17 +123,16 @@ function equal(value1, value2) {
|
|||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
// limit value range
|
|
||||||
format: function (value) {
|
format: function (value) {
|
||||||
value = this.filter(value);
|
// filter illegal characters and format integer
|
||||||
|
var safeValue = this.filter(value);
|
||||||
// format range
|
// format range
|
||||||
value = value === '' ? 0 : +value;
|
var rangeValue = Math.max(Math.min(this.data.max, +safeValue), this.data.min);
|
||||||
value = Math.max(Math.min(this.data.max, value), this.data.min);
|
|
||||||
// format decimal
|
// format decimal
|
||||||
if ((0, validator_1.isDef)(this.data.decimalLength)) {
|
var newValue = (0, validator_1.isDef)(this.data.decimalLength)
|
||||||
value = value.toFixed(this.data.decimalLength);
|
? rangeValue.toFixed(this.data.decimalLength)
|
||||||
}
|
: String(rangeValue);
|
||||||
return value;
|
return { value: value, newValue: newValue };
|
||||||
},
|
},
|
||||||
onInput: function (event) {
|
onInput: function (event) {
|
||||||
var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a;
|
var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a;
|
||||||
@@ -141,19 +140,16 @@ function equal(value1, value2) {
|
|||||||
if (value === '') {
|
if (value === '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var formatted = this.filter(value);
|
var formatted = this.format(value);
|
||||||
// limit max decimal length
|
|
||||||
if ((0, validator_1.isDef)(this.data.decimalLength) && formatted.indexOf('.') !== -1) {
|
|
||||||
var pair = formatted.split('.');
|
|
||||||
formatted = "".concat(pair[0], ".").concat(pair[1].slice(0, this.data.decimalLength));
|
|
||||||
}
|
|
||||||
this.emitChange(formatted);
|
this.emitChange(formatted);
|
||||||
},
|
},
|
||||||
emitChange: function (value) {
|
emitChange: function (data) {
|
||||||
|
var value = data.value, newValue = data.newValue;
|
||||||
if (!this.data.asyncChange) {
|
if (!this.data.asyncChange) {
|
||||||
this.setData({ currentValue: value });
|
// fix when input 11. parsed to 11, unable to enter decimal
|
||||||
|
this.setData({ currentValue: +value === +newValue ? value : newValue });
|
||||||
}
|
}
|
||||||
this.$emit('change', value);
|
this.$emit('change', +newValue);
|
||||||
},
|
},
|
||||||
onChange: function () {
|
onChange: function () {
|
||||||
var type = this.type;
|
var type = this.type;
|
||||||
@@ -162,7 +158,7 @@ function equal(value1, value2) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var diff = type === 'minus' ? -this.data.step : +this.data.step;
|
var diff = type === 'minus' ? -this.data.step : +this.data.step;
|
||||||
var value = this.format(add(+this.data.currentValue, diff));
|
var value = this.format(String(add(+this.data.currentValue, diff)));
|
||||||
this.emitChange(value);
|
this.emitChange(value);
|
||||||
this.$emit(type);
|
this.$emit(type);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
@import '../common/index.wxss';.van-steps{background-color:var(--steps-background-color,#fff);overflow:hidden}.van-steps--horizontal{padding:10px}.van-steps--horizontal .van-step__wrapper{display:flex;overflow:hidden;position:relative}.van-steps--vertical{padding-left:10px}.van-steps--vertical .van-step__wrapper{padding:0 0 0 20px}.van-step{color:var(--step-text-color,#969799);flex:1;font-size:var(--step-font-size,14px);position:relative}.van-step--finish{color:var(--step-finish-text-color,#323233)}.van-step__circle{background-color:var(--step-circle-color,#969799);border-radius:50%;height:var(--step-circle-size,5px);width:var(--step-circle-size,5px)}.van-step--horizontal{padding-bottom:14px}.van-step--horizontal:first-child .van-step__title{transform:none}.van-step--horizontal:first-child .van-step__circle-container{padding:0 8px 0 0;transform:translate3d(0,50%,0)}.van-step--horizontal:last-child{position:absolute;right:0;width:auto}.van-step--horizontal:last-child .van-step__title{text-align:right;transform:none}.van-step--horizontal:last-child .van-step__circle-container{padding:0 0 0 8px;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal .van-step__circle-container{background-color:#fff;bottom:6px;padding:0 var(--padding-xs,8px);position:absolute;transform:translate3d(-50%,50%,0);z-index:1}.van-step--horizontal .van-step__title{display:inline-block;font-size:var(--step-horizontal-title-font-size,12px);transform:translate3d(-50%,0,0)}.van-step--horizontal .van-step__line{background-color:var(--step-line-color,#ebedf0);bottom:6px;height:1px;left:0;position:absolute;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal.van-step--process{color:var(--step-process-text-color,#323233)}.van-step--horizontal.van-step--process .van-step__icon{display:block;font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical{line-height:18px;padding:10px 10px 10px 0}.van-step--vertical:after{border-bottom-width:1px}.van-step--vertical:last-child:after{border-bottom-width:none}.van-step--vertical:first-child:before{background-color:#fff;content:"";height:20px;left:-15px;position:absolute;top:0;width:1px;z-index:1}.van-step--vertical .van-step__circle,.van-step--vertical .van-step__icon,.van-step--vertical .van-step__line{left:-14px;position:absolute;top:19px;transform:translate3d(-50%,-50%,0);z-index:2}.van-step--vertical .van-step__icon{background-color:var(--steps-background-color,#fff);font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical .van-step__line{background-color:var(--step-line-color,#ebedf0);height:100%;transform:translate3d(-50%,0,0);width:1px;z-index:1}
|
@import '../common/index.wxss';.van-steps{background-color:var(--steps-background-color,#fff);overflow:hidden}.van-steps--horizontal{padding:10px}.van-steps--horizontal .van-step__wrapper{display:flex;overflow:hidden;position:relative}.van-steps--vertical{padding-left:10px}.van-steps--vertical .van-step__wrapper{padding:0 0 0 20px}.van-step{color:var(--step-text-color,#969799);flex:1;font-size:var(--step-font-size,14px);position:relative}.van-step--finish{color:var(--step-finish-text-color,#323233)}.van-step__circle{background-color:var(--step-circle-color,#969799);border-radius:50%;height:var(--step-circle-size,5px);width:var(--step-circle-size,5px)}.van-step--horizontal{padding-bottom:14px}.van-step--horizontal:first-child .van-step__title{transform:none}.van-step--horizontal:first-child .van-step__circle-container{padding:0 8px 0 0;transform:translate3d(0,50%,0)}.van-step--horizontal:last-child{bottom:0;position:absolute;right:0;top:0;width:auto}.van-step--horizontal:last-child .van-step__title{text-align:right;transform:none}.van-step--horizontal:last-child .van-step__circle-container{padding:0 0 0 8px;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal .van-step__circle-container{background-color:#fff;bottom:6px;padding:0 var(--padding-xs,8px);position:absolute;transform:translate3d(-50%,50%,0);z-index:1}.van-step--horizontal .van-step__title{display:inline-block;font-size:var(--step-horizontal-title-font-size,12px);transform:translate3d(-50%,0,0)}.van-step--horizontal .van-step__line{background-color:var(--step-line-color,#ebedf0);bottom:6px;height:1px;left:0;position:absolute;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal.van-step--process{color:var(--step-process-text-color,#323233)}.van-step--horizontal.van-step--process .van-step__icon{display:block;font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical{line-height:18px;padding:10px 10px 10px 0}.van-step--vertical:after{border-bottom-width:1px}.van-step--vertical:last-child:after{border-bottom-width:none}.van-step--vertical:first-child:before{background-color:#fff;content:"";height:20px;left:-15px;position:absolute;top:0;width:1px;z-index:1}.van-step--vertical .van-step__circle,.van-step--vertical .van-step__icon,.van-step--vertical .van-step__line{left:-14px;position:absolute;top:19px;transform:translate3d(-50%,-50%,0);z-index:2}.van-step--vertical .van-step__icon{background-color:var(--steps-background-color,#fff);font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical .van-step__line{background-color:var(--step-line-color,#ebedf0);height:100%;transform:translate3d(-50%,0,0);width:1px;z-index:1}
|
||||||
@@ -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,
|
||||||
@@ -168,6 +168,8 @@ var validator_1 = require("../common/validator");
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
onPreviewFile: function (event) {
|
onPreviewFile: function (event) {
|
||||||
|
if (!this.data.previewFile)
|
||||||
|
return;
|
||||||
var index = event.currentTarget.dataset.index;
|
var index = event.currentTarget.dataset.index;
|
||||||
wx.openDocument({
|
wx.openDocument({
|
||||||
filePath: this.data.lists[index].url,
|
filePath: this.data.lists[index].url,
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
poster="{{ item.thumb }}"
|
poster="{{ item.thumb }}"
|
||||||
autoplay="{{ item.autoplay }}"
|
autoplay="{{ item.autoplay }}"
|
||||||
object-fit="{{videoFit}}"
|
object-fit="{{videoFit}}"
|
||||||
|
referrer-policy="{{ referrerPolicy }}"
|
||||||
class="van-uploader__preview-image"
|
class="van-uploader__preview-image"
|
||||||
style="{{ computed.sizeStyle({ previewSize }) }}"
|
style="{{ computed.sizeStyle({ previewSize }) }}"
|
||||||
data-index="{{ index }}"
|
data-index="{{ index }}"
|
||||||
|
|||||||
@@ -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: {
|
||||||
@@ -50,4 +54,8 @@ export declare const mediaProps: {
|
|||||||
};
|
};
|
||||||
export declare const messageFileProps: {
|
export declare const messageFileProps: {
|
||||||
extension: null;
|
extension: null;
|
||||||
|
previewFile: {
|
||||||
|
type: BooleanConstructor;
|
||||||
|
value: boolean;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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 = {
|
||||||
@@ -57,4 +61,8 @@ exports.mediaProps = {
|
|||||||
// props for file
|
// props for file
|
||||||
exports.messageFileProps = {
|
exports.messageFileProps = {
|
||||||
extension: null,
|
extension: null,
|
||||||
|
previewFile: {
|
||||||
|
type: Boolean,
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
+5
-4
@@ -1,12 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "yelaymaths",
|
"name": "YelayMaths",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"node_modules/@vant/weapp": {
|
"node_modules/@vant/weapp": {
|
||||||
"version": "1.11.4",
|
"version": "1.11.7",
|
||||||
"resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.11.4.tgz",
|
"resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.11.7.tgz",
|
||||||
"integrity": "sha512-egOsWO4hVMP1SQSqQ46jy8UD3WysvlnUecRzPM21Y3ovkOFZ6wlaO7oHQmTXRpwr+V41Qri1qEbtNjhVxFqdyw=="
|
"integrity": "sha512-Rwn9BBnb4kHSV4XmvBicwtd42J+amEUfnFDcXJsGNPNX4a9c/DoT6YLsm4X1wB2+sQbdiQsbFBLAvGRBxCkD8g==",
|
||||||
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-5
@@ -11,9 +11,9 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
🔥 <a href="https://vant-contrib.gitee.io/vant-weapp">文档网站(国内)</a>
|
🔥 <a href="https://vant.pro/vant-weapp/">文档网站(国内)</a>
|
||||||
|
|
||||||
🌈 <a href="https://youzan.github.io/vant-weapp">文档网站(GitHub)</a>
|
🔥 <a href="https://vant-ui.github.io/vant-weapp/">文档网站(GitHub)</a>
|
||||||
|
|
||||||
🚀 <a href="https://github.com/vant-ui/vant" target="_blank">Vue 版</a>
|
🚀 <a href="https://github.com/vant-ui/vant" target="_blank">Vue 版</a>
|
||||||
</p>
|
</p>
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
Vant 是一个**轻量、可靠的移动端组件库**,于 2017 年开源。
|
Vant 是一个**轻量、可靠的移动端组件库**,于 2017 年开源。
|
||||||
|
|
||||||
目前 Vant 官方提供了 [Vue 2 版本](https://vant-contrib.gitee.io/vant/v2)、[Vue 3 版本](https://vant-contrib.gitee.io/vant)和[微信小程序版本](http://vant-contrib.gitee.io/vant-weapp),并由社区团队维护 [React 版本](https://github.com/3lang3/react-vant)和[支付宝小程序版本](https://github.com/ant-move/Vant-Aliapp)。
|
目前 Vant 官方提供了 [Vue 2 版本](https://vant-ui.github.io/vant/v2/)、[Vue 3 版本](https://vant-ui.github.io/vant/)和[微信小程序版本](http://vant-ui.github.io/vant-weapp/),并由社区团队维护 [React 版本](https://github.com/3lang3/react-vant)和[支付宝小程序版本](https://github.com/ant-move/Vant-Aliapp)。
|
||||||
|
|
||||||
## 预览
|
## 预览
|
||||||
|
|
||||||
@@ -99,9 +99,11 @@ Vant Weapp 最低支持到小程序基础库 2.6.5 版本。
|
|||||||
|
|
||||||
## 链接
|
## 链接
|
||||||
|
|
||||||
|
- [文档网站(GitHub)](https://vant-ui.github.io/vant-weapp/)
|
||||||
|
- [文档网站(国内)](https://vant.pro/vant-weapp/)
|
||||||
- [意见反馈](https://github.com/youzan/vant-weapp/issues)
|
- [意见反馈](https://github.com/youzan/vant-weapp/issues)
|
||||||
- [设计资源](https://vant-contrib.gitee.io/vant/#/zh-CN/design)
|
- [设计资源](https://vant-ui.github.io/vant/#/zh-CN/design)
|
||||||
- [更新日志](https://vant-contrib.gitee.io/vant-weapp/#/changelog)
|
- [更新日志](https://vant-ui.github.io/vant-weapp/#/changelog)
|
||||||
- [官方示例](https://github.com/vant-ui/vant-demo)
|
- [官方示例](https://github.com/vant-ui/vant-demo)
|
||||||
|
|
||||||
## 核心团队
|
## 核心团队
|
||||||
|
|||||||
+5
@@ -36,6 +36,10 @@ VantComponent({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: true,
|
value: true,
|
||||||
},
|
},
|
||||||
|
ellipsis: {
|
||||||
|
type: Boolean,
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
showHeader: {
|
showHeader: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: true,
|
value: true,
|
||||||
@@ -148,6 +152,7 @@ VantComponent({
|
|||||||
selected: null,
|
selected: null,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
activeTab: 0,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onClose() {
|
onClose() {
|
||||||
|
|||||||
+1
@@ -19,6 +19,7 @@
|
|||||||
color="{{ activeColor }}"
|
color="{{ activeColor }}"
|
||||||
border="{{ false }}"
|
border="{{ false }}"
|
||||||
swipeable="{{ swipeable }}"
|
swipeable="{{ swipeable }}"
|
||||||
|
ellipsis="{{ ellipsis }}"
|
||||||
bind:click="onClickTab"
|
bind:click="onClickTab"
|
||||||
>
|
>
|
||||||
<van-tab
|
<van-tab
|
||||||
|
|||||||
+3
-2
@@ -24,6 +24,7 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
expanded: false,
|
expanded: false,
|
||||||
|
parentBorder: true,
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.updateExpanded();
|
this.updateExpanded();
|
||||||
@@ -34,7 +35,7 @@ VantComponent({
|
|||||||
if (!this.parent) {
|
if (!this.parent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { value, accordion } = this.parent.data;
|
const { value, accordion, border } = this.parent.data;
|
||||||
const { children = [] } = this.parent;
|
const { children = [] } = this.parent;
|
||||||
const { name } = this.data;
|
const { name } = this.data;
|
||||||
const index = children.indexOf(this);
|
const index = children.indexOf(this);
|
||||||
@@ -45,7 +46,7 @@ VantComponent({
|
|||||||
if (expanded !== this.data.expanded) {
|
if (expanded !== this.data.expanded) {
|
||||||
setContentAnimate(this, expanded, this.mounted);
|
setContentAnimate(this, expanded, this.mounted);
|
||||||
}
|
}
|
||||||
this.setData({ index, expanded });
|
this.setData({ index, expanded, parentBorder: border });
|
||||||
},
|
},
|
||||||
onClick() {
|
onClick() {
|
||||||
if (this.data.disabled) {
|
if (this.data.disabled) {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||||
|
|
||||||
<view class="van-collapse-item custom-class {{ index !== 0 ? 'van-hairline--top' : '' }}">
|
<view class="van-collapse-item custom-class {{ index !== 0 && parentBorder ? 'van-hairline--top' : '' }}">
|
||||||
<van-cell
|
<van-cell
|
||||||
size="{{ size }}"
|
size="{{ size }}"
|
||||||
title="{{ title }}"
|
title="{{ title }}"
|
||||||
|
|||||||
+1
@@ -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;
|
||||||
|
|||||||
+9
-7
@@ -89,13 +89,15 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
close(action) {
|
close(action) {
|
||||||
this.setData({ show: false });
|
this.setData({ show: false });
|
||||||
wx.nextTick(() => {
|
this.closeAction = action;
|
||||||
this.$emit('close', action);
|
},
|
||||||
const { callback } = this.data;
|
onAfterLeave() {
|
||||||
if (callback) {
|
const { closeAction: action } = this;
|
||||||
callback(action, this);
|
this.$emit('close', action);
|
||||||
}
|
const { callback } = this.data;
|
||||||
});
|
if (callback) {
|
||||||
|
callback(action, this);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
stopLoading() {
|
stopLoading() {
|
||||||
this.setData({
|
this.setData({
|
||||||
|
|||||||
+1
@@ -11,6 +11,7 @@
|
|||||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||||
root-portal="{{ rootPortal }}"
|
root-portal="{{ rootPortal }}"
|
||||||
bind:close="onClickOverlay"
|
bind:close="onClickOverlay"
|
||||||
|
bind:after-leave="onAfterLeave"
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
wx:if="{{ title || useTitleSlot }}"
|
wx:if="{{ title || useTitleSlot }}"
|
||||||
|
|||||||
+16
-1
@@ -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 });
|
||||||
@@ -95,6 +107,9 @@ VantComponent({
|
|||||||
onKeyboardHeightChange(event) {
|
onKeyboardHeightChange(event) {
|
||||||
this.$emit('keyboardheightchange', event.detail);
|
this.$emit('keyboardheightchange', event.detail);
|
||||||
},
|
},
|
||||||
|
onBindNicknameReview(event) {
|
||||||
|
this.$emit('nicknamereview', event.detail);
|
||||||
|
},
|
||||||
emitChange(detail) {
|
emitChange(detail) {
|
||||||
const { extraEventParams } = this.data;
|
const { extraEventParams } = this.data;
|
||||||
this.setData({ value: detail.value });
|
this.setData({ value: detail.value });
|
||||||
@@ -116,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() { },
|
||||||
},
|
},
|
||||||
|
|||||||
+1
@@ -27,4 +27,5 @@
|
|||||||
bindfocus="onFocus"
|
bindfocus="onFocus"
|
||||||
bindconfirm="onConfirm"
|
bindconfirm="onConfirm"
|
||||||
bindkeyboardheightchange="onKeyboardHeightChange"
|
bindkeyboardheightchange="onKeyboardHeightChange"
|
||||||
|
bindnicknamereview="onBindNicknameReview"
|
||||||
/>
|
/>
|
||||||
|
|||||||
+1
-9
@@ -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,
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
@import '../common/index.wxss';.van-image{display:inline-block;position:relative}.van-image--round{border-radius:50%;overflow:hidden}.van-image--round .van-image__img{border-radius:inherit}.van-image__error,.van-image__img,.van-image__loading{display:block;height:100%;width:100%}.van-image__error,.van-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.van-image__loading-icon{color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.van-image__error-icon{color:var(--image-error-icon-color,#dcdee0);font-size:var(--image-error-icon-size,32px)!important}
|
@import '../common/index.wxss';.van-image{display:inline-block;position:relative;vertical-align:top}.van-image--round{border-radius:50%;overflow:hidden}.van-image--round .van-image__img{border-radius:inherit}.van-image__error,.van-image__img,.van-image__loading{display:block;height:100%;width:100%}.van-image__error,.van-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.van-image__loading-icon{color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.van-image__error-icon{color:var(--image-error-icon-color,#dcdee0);font-size:var(--image-error-icon-size,32px)!important}
|
||||||
+15
@@ -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();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
+57
-51
@@ -21,7 +21,6 @@ export function transition(showDefaultValue) {
|
|||||||
duration: {
|
duration: {
|
||||||
type: null,
|
type: null,
|
||||||
value: 300,
|
value: 300,
|
||||||
observer: 'observeDuration',
|
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -43,74 +42,81 @@ export function transition(showDefaultValue) {
|
|||||||
if (value === old) {
|
if (value === old) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
value ? this.enter() : this.leave();
|
value ? this.enureEnter() : this.enureLeave();
|
||||||
},
|
},
|
||||||
enter() {
|
enureEnter() {
|
||||||
if (this.enterFinishedPromise)
|
if (this.enterPromise)
|
||||||
return;
|
return;
|
||||||
this.enterFinishedPromise = new Promise((resolve) => {
|
this.enterPromise = new Promise((resolve) => this.enter(resolve));
|
||||||
const { duration, name } = this.data;
|
},
|
||||||
const classNames = getClassNames(name);
|
enureLeave() {
|
||||||
const currentDuration = isObj(duration) ? duration.enter : duration;
|
const { enterPromise } = this;
|
||||||
if (this.status === 'enter') {
|
if (!enterPromise)
|
||||||
|
return;
|
||||||
|
enterPromise
|
||||||
|
.then(() => new Promise((resolve) => this.leave(resolve)))
|
||||||
|
.then(() => {
|
||||||
|
this.enterPromise = null;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
enter(resolve) {
|
||||||
|
const { duration, name } = this.data;
|
||||||
|
const classNames = getClassNames(name);
|
||||||
|
const currentDuration = isObj(duration) ? duration.enter : duration;
|
||||||
|
if (this.status === 'enter') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.status = 'enter';
|
||||||
|
this.$emit('before-enter');
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
if (this.status !== 'enter') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.status = 'enter';
|
this.$emit('enter');
|
||||||
this.$emit('before-enter');
|
this.setData({
|
||||||
|
inited: true,
|
||||||
|
display: true,
|
||||||
|
classes: classNames.enter,
|
||||||
|
currentDuration,
|
||||||
|
});
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
if (this.status !== 'enter') {
|
if (this.status !== 'enter') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$emit('enter');
|
this.transitionEnded = false;
|
||||||
this.setData({
|
this.setData({ classes: classNames['enter-to'] });
|
||||||
inited: true,
|
resolve();
|
||||||
display: true,
|
|
||||||
classes: classNames.enter,
|
|
||||||
currentDuration,
|
|
||||||
});
|
|
||||||
requestAnimationFrame(() => {
|
|
||||||
if (this.status !== 'enter') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.transitionEnded = false;
|
|
||||||
this.setData({ classes: classNames['enter-to'] });
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
leave() {
|
leave(resolve) {
|
||||||
if (!this.enterFinishedPromise)
|
if (!this.data.display) {
|
||||||
return;
|
return;
|
||||||
this.enterFinishedPromise.then(() => {
|
}
|
||||||
if (!this.data.display) {
|
const { duration, name } = this.data;
|
||||||
|
const classNames = getClassNames(name);
|
||||||
|
const currentDuration = isObj(duration) ? duration.leave : duration;
|
||||||
|
this.status = 'leave';
|
||||||
|
this.$emit('before-leave');
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
if (this.status !== 'leave') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { duration, name } = this.data;
|
this.$emit('leave');
|
||||||
const classNames = getClassNames(name);
|
this.setData({
|
||||||
const currentDuration = isObj(duration) ? duration.leave : duration;
|
classes: classNames.leave,
|
||||||
this.status = 'leave';
|
currentDuration,
|
||||||
this.$emit('before-leave');
|
});
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
if (this.status !== 'leave') {
|
if (this.status !== 'leave') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$emit('leave');
|
this.transitionEnded = false;
|
||||||
this.setData({
|
setTimeout(() => {
|
||||||
classes: classNames.leave,
|
this.onTransitionEnd();
|
||||||
currentDuration,
|
resolve();
|
||||||
});
|
}, currentDuration);
|
||||||
requestAnimationFrame(() => {
|
this.setData({ classes: classNames['leave-to'] });
|
||||||
if (this.status !== 'leave') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.transitionEnded = false;
|
|
||||||
setTimeout(() => {
|
|
||||||
this.onTransitionEnd();
|
|
||||||
this.enterFinishedPromise = null;
|
|
||||||
}, currentDuration);
|
|
||||||
this.setData({ classes: classNames['leave-to'] });
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
+19
-12
@@ -61,7 +61,7 @@ VantComponent({
|
|||||||
getRect(this, '.van-notice-bar__wrap'),
|
getRect(this, '.van-notice-bar__wrap'),
|
||||||
]).then((rects) => {
|
]).then((rects) => {
|
||||||
const [contentRect, wrapRect] = rects;
|
const [contentRect, wrapRect] = rects;
|
||||||
const { speed, scrollable, delay } = this.data;
|
const { scrollable } = this.data;
|
||||||
if (contentRect == null ||
|
if (contentRect == null ||
|
||||||
wrapRect == null ||
|
wrapRect == null ||
|
||||||
!contentRect.width ||
|
!contentRect.width ||
|
||||||
@@ -70,20 +70,26 @@ VantComponent({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (scrollable || wrapRect.width < contentRect.width) {
|
if (scrollable || wrapRect.width < contentRect.width) {
|
||||||
const duration = ((wrapRect.width + contentRect.width) / speed) * 1000;
|
this.initAnimation(wrapRect.width, contentRect.width);
|
||||||
this.wrapWidth = wrapRect.width;
|
|
||||||
this.contentWidth = contentRect.width;
|
|
||||||
this.duration = duration;
|
|
||||||
this.animation = wx.createAnimation({
|
|
||||||
duration,
|
|
||||||
timingFunction: 'linear',
|
|
||||||
delay,
|
|
||||||
});
|
|
||||||
this.scroll(true);
|
this.scroll(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
initAnimation(warpWidth, contentWidth) {
|
||||||
|
const { speed, delay } = this.data;
|
||||||
|
this.wrapWidth = warpWidth;
|
||||||
|
this.contentWidth = contentWidth;
|
||||||
|
// begin 0
|
||||||
|
this.contentDuration = (contentWidth / speed) * 1000;
|
||||||
|
// begin -wrapWidth
|
||||||
|
this.duration = ((warpWidth + contentWidth) / speed) * 1000;
|
||||||
|
this.animation = wx.createAnimation({
|
||||||
|
duration: this.contentDuration,
|
||||||
|
timingFunction: 'linear',
|
||||||
|
delay,
|
||||||
|
});
|
||||||
|
},
|
||||||
scroll(isInit = false) {
|
scroll(isInit = false) {
|
||||||
this.timer && clearTimeout(this.timer);
|
this.timer && clearTimeout(this.timer);
|
||||||
this.timer = null;
|
this.timer = null;
|
||||||
@@ -93,17 +99,18 @@ VantComponent({
|
|||||||
.step()
|
.step()
|
||||||
.export(),
|
.export(),
|
||||||
});
|
});
|
||||||
|
const duration = isInit ? this.contentDuration : this.duration;
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
this.setData({
|
this.setData({
|
||||||
animationData: this.animation
|
animationData: this.animation
|
||||||
.translateX(-this.contentWidth)
|
.translateX(-this.contentWidth)
|
||||||
.step()
|
.step({ duration })
|
||||||
.export(),
|
.export(),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.timer = setTimeout(() => {
|
this.timer = setTimeout(() => {
|
||||||
this.scroll();
|
this.scroll();
|
||||||
}, this.duration + this.data.delay);
|
}, duration + this.data.delay);
|
||||||
},
|
},
|
||||||
onClickIcon(event) {
|
onClickIcon(event) {
|
||||||
if (this.data.mode === 'closeable') {
|
if (this.data.mode === 'closeable') {
|
||||||
|
|||||||
+23
-27
@@ -72,18 +72,18 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.setData({
|
this.setData({
|
||||||
currentValue: this.format(this.data.value),
|
currentValue: this.format(this.data.value).newValue,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
observeValue() {
|
observeValue() {
|
||||||
const { value } = this.data;
|
const { value } = this.data;
|
||||||
this.setData({ currentValue: this.format(value) });
|
this.setData({ currentValue: this.format(value).newValue });
|
||||||
},
|
},
|
||||||
check() {
|
check() {
|
||||||
const val = this.format(this.data.currentValue);
|
const { newValue } = this.format(this.data.currentValue);
|
||||||
if (!equal(val, this.data.currentValue)) {
|
if (!equal(newValue, this.data.currentValue)) {
|
||||||
this.setData({ currentValue: val });
|
this.setData({ currentValue: newValue });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isDisabled(type) {
|
isDisabled(type) {
|
||||||
@@ -97,10 +97,10 @@ VantComponent({
|
|||||||
this.$emit('focus', event.detail);
|
this.$emit('focus', event.detail);
|
||||||
},
|
},
|
||||||
onBlur(event) {
|
onBlur(event) {
|
||||||
const value = this.format(event.detail.value);
|
const data = this.format(event.detail.value);
|
||||||
this.setData({ currentValue: value });
|
this.setData({ currentValue: data.newValue });
|
||||||
this.emitChange(value);
|
this.emitChange(data);
|
||||||
this.$emit('blur', Object.assign(Object.assign({}, event.detail), { value }));
|
this.$emit('blur', Object.assign(Object.assign({}, event.detail), { value: +data.newValue }));
|
||||||
},
|
},
|
||||||
// filter illegal characters
|
// filter illegal characters
|
||||||
filter(value) {
|
filter(value) {
|
||||||
@@ -110,17 +110,16 @@ VantComponent({
|
|||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
// limit value range
|
|
||||||
format(value) {
|
format(value) {
|
||||||
value = this.filter(value);
|
// filter illegal characters and format integer
|
||||||
|
const safeValue = this.filter(value);
|
||||||
// format range
|
// format range
|
||||||
value = value === '' ? 0 : +value;
|
const rangeValue = Math.max(Math.min(this.data.max, +safeValue), this.data.min);
|
||||||
value = Math.max(Math.min(this.data.max, value), this.data.min);
|
|
||||||
// format decimal
|
// format decimal
|
||||||
if (isDef(this.data.decimalLength)) {
|
const newValue = isDef(this.data.decimalLength)
|
||||||
value = value.toFixed(this.data.decimalLength);
|
? rangeValue.toFixed(this.data.decimalLength)
|
||||||
}
|
: String(rangeValue);
|
||||||
return value;
|
return { value, newValue };
|
||||||
},
|
},
|
||||||
onInput(event) {
|
onInput(event) {
|
||||||
const { value = '' } = event.detail || {};
|
const { value = '' } = event.detail || {};
|
||||||
@@ -128,19 +127,16 @@ VantComponent({
|
|||||||
if (value === '') {
|
if (value === '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let formatted = this.filter(value);
|
const formatted = this.format(value);
|
||||||
// limit max decimal length
|
|
||||||
if (isDef(this.data.decimalLength) && formatted.indexOf('.') !== -1) {
|
|
||||||
const pair = formatted.split('.');
|
|
||||||
formatted = `${pair[0]}.${pair[1].slice(0, this.data.decimalLength)}`;
|
|
||||||
}
|
|
||||||
this.emitChange(formatted);
|
this.emitChange(formatted);
|
||||||
},
|
},
|
||||||
emitChange(value) {
|
emitChange(data) {
|
||||||
|
const { value, newValue } = data;
|
||||||
if (!this.data.asyncChange) {
|
if (!this.data.asyncChange) {
|
||||||
this.setData({ currentValue: value });
|
// fix when input 11. parsed to 11, unable to enter decimal
|
||||||
|
this.setData({ currentValue: +value === +newValue ? value : newValue });
|
||||||
}
|
}
|
||||||
this.$emit('change', value);
|
this.$emit('change', +newValue);
|
||||||
},
|
},
|
||||||
onChange() {
|
onChange() {
|
||||||
const { type } = this;
|
const { type } = this;
|
||||||
@@ -149,7 +145,7 @@ VantComponent({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const diff = type === 'minus' ? -this.data.step : +this.data.step;
|
const diff = type === 'minus' ? -this.data.step : +this.data.step;
|
||||||
const value = this.format(add(+this.data.currentValue, diff));
|
const value = this.format(String(add(+this.data.currentValue, diff)));
|
||||||
this.emitChange(value);
|
this.emitChange(value);
|
||||||
this.$emit(type);
|
this.$emit(type);
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
@import '../common/index.wxss';.van-steps{background-color:var(--steps-background-color,#fff);overflow:hidden}.van-steps--horizontal{padding:10px}.van-steps--horizontal .van-step__wrapper{display:flex;overflow:hidden;position:relative}.van-steps--vertical{padding-left:10px}.van-steps--vertical .van-step__wrapper{padding:0 0 0 20px}.van-step{color:var(--step-text-color,#969799);flex:1;font-size:var(--step-font-size,14px);position:relative}.van-step--finish{color:var(--step-finish-text-color,#323233)}.van-step__circle{background-color:var(--step-circle-color,#969799);border-radius:50%;height:var(--step-circle-size,5px);width:var(--step-circle-size,5px)}.van-step--horizontal{padding-bottom:14px}.van-step--horizontal:first-child .van-step__title{transform:none}.van-step--horizontal:first-child .van-step__circle-container{padding:0 8px 0 0;transform:translate3d(0,50%,0)}.van-step--horizontal:last-child{position:absolute;right:0;width:auto}.van-step--horizontal:last-child .van-step__title{text-align:right;transform:none}.van-step--horizontal:last-child .van-step__circle-container{padding:0 0 0 8px;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal .van-step__circle-container{background-color:#fff;bottom:6px;padding:0 var(--padding-xs,8px);position:absolute;transform:translate3d(-50%,50%,0);z-index:1}.van-step--horizontal .van-step__title{display:inline-block;font-size:var(--step-horizontal-title-font-size,12px);transform:translate3d(-50%,0,0)}.van-step--horizontal .van-step__line{background-color:var(--step-line-color,#ebedf0);bottom:6px;height:1px;left:0;position:absolute;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal.van-step--process{color:var(--step-process-text-color,#323233)}.van-step--horizontal.van-step--process .van-step__icon{display:block;font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical{line-height:18px;padding:10px 10px 10px 0}.van-step--vertical:after{border-bottom-width:1px}.van-step--vertical:last-child:after{border-bottom-width:none}.van-step--vertical:first-child:before{background-color:#fff;content:"";height:20px;left:-15px;position:absolute;top:0;width:1px;z-index:1}.van-step--vertical .van-step__circle,.van-step--vertical .van-step__icon,.van-step--vertical .van-step__line{left:-14px;position:absolute;top:19px;transform:translate3d(-50%,-50%,0);z-index:2}.van-step--vertical .van-step__icon{background-color:var(--steps-background-color,#fff);font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical .van-step__line{background-color:var(--step-line-color,#ebedf0);height:100%;transform:translate3d(-50%,0,0);width:1px;z-index:1}
|
@import '../common/index.wxss';.van-steps{background-color:var(--steps-background-color,#fff);overflow:hidden}.van-steps--horizontal{padding:10px}.van-steps--horizontal .van-step__wrapper{display:flex;overflow:hidden;position:relative}.van-steps--vertical{padding-left:10px}.van-steps--vertical .van-step__wrapper{padding:0 0 0 20px}.van-step{color:var(--step-text-color,#969799);flex:1;font-size:var(--step-font-size,14px);position:relative}.van-step--finish{color:var(--step-finish-text-color,#323233)}.van-step__circle{background-color:var(--step-circle-color,#969799);border-radius:50%;height:var(--step-circle-size,5px);width:var(--step-circle-size,5px)}.van-step--horizontal{padding-bottom:14px}.van-step--horizontal:first-child .van-step__title{transform:none}.van-step--horizontal:first-child .van-step__circle-container{padding:0 8px 0 0;transform:translate3d(0,50%,0)}.van-step--horizontal:last-child{bottom:0;position:absolute;right:0;top:0;width:auto}.van-step--horizontal:last-child .van-step__title{text-align:right;transform:none}.van-step--horizontal:last-child .van-step__circle-container{padding:0 0 0 8px;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal .van-step__circle-container{background-color:#fff;bottom:6px;padding:0 var(--padding-xs,8px);position:absolute;transform:translate3d(-50%,50%,0);z-index:1}.van-step--horizontal .van-step__title{display:inline-block;font-size:var(--step-horizontal-title-font-size,12px);transform:translate3d(-50%,0,0)}.van-step--horizontal .van-step__line{background-color:var(--step-line-color,#ebedf0);bottom:6px;height:1px;left:0;position:absolute;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal.van-step--process{color:var(--step-process-text-color,#323233)}.van-step--horizontal.van-step--process .van-step__icon{display:block;font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical{line-height:18px;padding:10px 10px 10px 0}.van-step--vertical:after{border-bottom-width:1px}.van-step--vertical:last-child:after{border-bottom-width:none}.van-step--vertical:first-child:before{background-color:#fff;content:"";height:20px;left:-15px;position:absolute;top:0;width:1px;z-index:1}.van-step--vertical .van-step__circle,.van-step--vertical .van-step__icon,.van-step--vertical .van-step__line{left:-14px;position:absolute;top:19px;transform:translate3d(-50%,-50%,0);z-index:2}.van-step--vertical .van-step__icon{background-color:var(--steps-background-color,#fff);font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical .van-step__line{background-color:var(--step-line-color,#ebedf0);height:100%;transform:translate3d(-50%,0,0);width:1px;z-index:1}
|
||||||
+4
-2
@@ -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,
|
||||||
@@ -153,6 +153,8 @@ VantComponent({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
onPreviewFile(event) {
|
onPreviewFile(event) {
|
||||||
|
if (!this.data.previewFile)
|
||||||
|
return;
|
||||||
const { index } = event.currentTarget.dataset;
|
const { index } = event.currentTarget.dataset;
|
||||||
wx.openDocument({
|
wx.openDocument({
|
||||||
filePath: this.data.lists[index].url,
|
filePath: this.data.lists[index].url,
|
||||||
|
|||||||
+1
@@ -29,6 +29,7 @@
|
|||||||
poster="{{ item.thumb }}"
|
poster="{{ item.thumb }}"
|
||||||
autoplay="{{ item.autoplay }}"
|
autoplay="{{ item.autoplay }}"
|
||||||
object-fit="{{videoFit}}"
|
object-fit="{{videoFit}}"
|
||||||
|
referrer-policy="{{ referrerPolicy }}"
|
||||||
class="van-uploader__preview-image"
|
class="van-uploader__preview-image"
|
||||||
style="{{ computed.sizeStyle({ previewSize }) }}"
|
style="{{ computed.sizeStyle({ previewSize }) }}"
|
||||||
data-index="{{ index }}"
|
data-index="{{ index }}"
|
||||||
|
|||||||
+8
@@ -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: {
|
||||||
@@ -50,4 +54,8 @@ export declare const mediaProps: {
|
|||||||
};
|
};
|
||||||
export declare const messageFileProps: {
|
export declare const messageFileProps: {
|
||||||
extension: null;
|
extension: null;
|
||||||
|
previewFile: {
|
||||||
|
type: BooleanConstructor;
|
||||||
|
value: boolean;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
+8
@@ -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 = {
|
||||||
@@ -54,4 +58,8 @@ export const mediaProps = {
|
|||||||
// props for file
|
// props for file
|
||||||
export const messageFileProps = {
|
export const messageFileProps = {
|
||||||
extension: null,
|
extension: null,
|
||||||
|
previewFile: {
|
||||||
|
type: Boolean,
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
+5
@@ -47,6 +47,10 @@ var defaultFieldNames = {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: true,
|
value: true,
|
||||||
},
|
},
|
||||||
|
ellipsis: {
|
||||||
|
type: Boolean,
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
showHeader: {
|
showHeader: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: true,
|
value: true,
|
||||||
@@ -161,6 +165,7 @@ var defaultFieldNames = {
|
|||||||
selected: null,
|
selected: null,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
activeTab: 0,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onClose: function () {
|
onClose: function () {
|
||||||
|
|||||||
+1
@@ -19,6 +19,7 @@
|
|||||||
color="{{ activeColor }}"
|
color="{{ activeColor }}"
|
||||||
border="{{ false }}"
|
border="{{ false }}"
|
||||||
swipeable="{{ swipeable }}"
|
swipeable="{{ swipeable }}"
|
||||||
|
ellipsis="{{ ellipsis }}"
|
||||||
bind:click="onClickTab"
|
bind:click="onClickTab"
|
||||||
>
|
>
|
||||||
<van-tab
|
<van-tab
|
||||||
|
|||||||
+3
-2
@@ -26,6 +26,7 @@ var animate_1 = require("./animate");
|
|||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
expanded: false,
|
expanded: false,
|
||||||
|
parentBorder: true,
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.updateExpanded();
|
this.updateExpanded();
|
||||||
@@ -36,7 +37,7 @@ var animate_1 = require("./animate");
|
|||||||
if (!this.parent) {
|
if (!this.parent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var _a = this.parent.data, value = _a.value, accordion = _a.accordion;
|
var _a = this.parent.data, value = _a.value, accordion = _a.accordion, border = _a.border;
|
||||||
var _b = this.parent.children, children = _b === void 0 ? [] : _b;
|
var _b = this.parent.children, children = _b === void 0 ? [] : _b;
|
||||||
var name = this.data.name;
|
var name = this.data.name;
|
||||||
var index = children.indexOf(this);
|
var index = children.indexOf(this);
|
||||||
@@ -47,7 +48,7 @@ var animate_1 = require("./animate");
|
|||||||
if (expanded !== this.data.expanded) {
|
if (expanded !== this.data.expanded) {
|
||||||
(0, animate_1.setContentAnimate)(this, expanded, this.mounted);
|
(0, animate_1.setContentAnimate)(this, expanded, this.mounted);
|
||||||
}
|
}
|
||||||
this.setData({ index: index, expanded: expanded });
|
this.setData({ index: index, expanded: expanded, parentBorder: border });
|
||||||
},
|
},
|
||||||
onClick: function () {
|
onClick: function () {
|
||||||
if (this.data.disabled) {
|
if (this.data.disabled) {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||||
|
|
||||||
<view class="van-collapse-item custom-class {{ index !== 0 ? 'van-hairline--top' : '' }}">
|
<view class="van-collapse-item custom-class {{ index !== 0 && parentBorder ? 'van-hairline--top' : '' }}">
|
||||||
<van-cell
|
<van-cell
|
||||||
size="{{ size }}"
|
size="{{ size }}"
|
||||||
title="{{ title }}"
|
title="{{ title }}"
|
||||||
|
|||||||
+1
@@ -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;
|
||||||
|
|||||||
+9
-8
@@ -90,15 +90,16 @@ var utils_1 = require("../common/utils");
|
|||||||
this.close('overlay');
|
this.close('overlay');
|
||||||
},
|
},
|
||||||
close: function (action) {
|
close: function (action) {
|
||||||
var _this = this;
|
|
||||||
this.setData({ show: false });
|
this.setData({ show: false });
|
||||||
wx.nextTick(function () {
|
this.closeAction = action;
|
||||||
_this.$emit('close', action);
|
},
|
||||||
var callback = _this.data.callback;
|
onAfterLeave: function () {
|
||||||
if (callback) {
|
var action = this.closeAction;
|
||||||
callback(action, _this);
|
this.$emit('close', action);
|
||||||
}
|
var callback = this.data.callback;
|
||||||
});
|
if (callback) {
|
||||||
|
callback(action, this);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
stopLoading: function () {
|
stopLoading: function () {
|
||||||
this.setData({
|
this.setData({
|
||||||
|
|||||||
+1
@@ -11,6 +11,7 @@
|
|||||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||||
root-portal="{{ rootPortal }}"
|
root-portal="{{ rootPortal }}"
|
||||||
bind:close="onClickOverlay"
|
bind:close="onClickOverlay"
|
||||||
|
bind:after-leave="onAfterLeave"
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
wx:if="{{ title || useTitleSlot }}"
|
wx:if="{{ title || useTitleSlot }}"
|
||||||
|
|||||||
+16
-1
@@ -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 });
|
||||||
@@ -109,6 +121,9 @@ var props_1 = require("./props");
|
|||||||
onKeyboardHeightChange: function (event) {
|
onKeyboardHeightChange: function (event) {
|
||||||
this.$emit('keyboardheightchange', event.detail);
|
this.$emit('keyboardheightchange', event.detail);
|
||||||
},
|
},
|
||||||
|
onBindNicknameReview: function (event) {
|
||||||
|
this.$emit('nicknamereview', event.detail);
|
||||||
|
},
|
||||||
emitChange: function (detail) {
|
emitChange: function (detail) {
|
||||||
var extraEventParams = this.data.extraEventParams;
|
var extraEventParams = this.data.extraEventParams;
|
||||||
this.setData({ value: detail.value });
|
this.setData({ value: detail.value });
|
||||||
@@ -130,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 () { },
|
||||||
},
|
},
|
||||||
|
|||||||
+1
@@ -27,4 +27,5 @@
|
|||||||
bindfocus="onFocus"
|
bindfocus="onFocus"
|
||||||
bindconfirm="onConfirm"
|
bindconfirm="onConfirm"
|
||||||
bindkeyboardheightchange="onKeyboardHeightChange"
|
bindkeyboardheightchange="onKeyboardHeightChange"
|
||||||
|
bindnicknamereview="onBindNicknameReview"
|
||||||
/>
|
/>
|
||||||
|
|||||||
+1
-9
@@ -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,
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
@import '../common/index.wxss';.van-image{display:inline-block;position:relative}.van-image--round{border-radius:50%;overflow:hidden}.van-image--round .van-image__img{border-radius:inherit}.van-image__error,.van-image__img,.van-image__loading{display:block;height:100%;width:100%}.van-image__error,.van-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.van-image__loading-icon{color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.van-image__error-icon{color:var(--image-error-icon-color,#dcdee0);font-size:var(--image-error-icon-size,32px)!important}
|
@import '../common/index.wxss';.van-image{display:inline-block;position:relative;vertical-align:top}.van-image--round{border-radius:50%;overflow:hidden}.van-image--round .van-image__img{border-radius:inherit}.van-image__error,.van-image__img,.van-image__loading{display:block;height:100%;width:100%}.van-image__error,.van-image__loading{align-items:center;background-color:var(--image-placeholder-background-color,#f7f8fa);color:var(--image-placeholder-text-color,#969799);display:flex;flex-direction:column;font-size:var(--image-placeholder-font-size,14px);justify-content:center;left:0;position:absolute;top:0}.van-image__loading-icon{color:var(--image-loading-icon-color,#dcdee0);font-size:var(--image-loading-icon-size,32px)!important}.van-image__error-icon{color:var(--image-error-icon-color,#dcdee0);font-size:var(--image-error-icon-size,32px)!important}
|
||||||
+16
@@ -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();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
+59
-51
@@ -24,7 +24,6 @@ function transition(showDefaultValue) {
|
|||||||
duration: {
|
duration: {
|
||||||
type: null,
|
type: null,
|
||||||
value: 300,
|
value: 300,
|
||||||
observer: 'observeDuration',
|
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -46,76 +45,85 @@ function transition(showDefaultValue) {
|
|||||||
if (value === old) {
|
if (value === old) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
value ? this.enter() : this.leave();
|
value ? this.enureEnter() : this.enureLeave();
|
||||||
},
|
},
|
||||||
enter: function () {
|
enureEnter: function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
if (this.enterFinishedPromise)
|
if (this.enterPromise)
|
||||||
return;
|
return;
|
||||||
this.enterFinishedPromise = new Promise(function (resolve) {
|
this.enterPromise = new Promise(function (resolve) { return _this.enter(resolve); });
|
||||||
var _a = _this.data, duration = _a.duration, name = _a.name;
|
},
|
||||||
var classNames = getClassNames(name);
|
enureLeave: function () {
|
||||||
var currentDuration = (0, validator_1.isObj)(duration) ? duration.enter : duration;
|
var _this = this;
|
||||||
if (_this.status === 'enter') {
|
var enterPromise = this.enterPromise;
|
||||||
|
if (!enterPromise)
|
||||||
|
return;
|
||||||
|
enterPromise
|
||||||
|
.then(function () { return new Promise(function (resolve) { return _this.leave(resolve); }); })
|
||||||
|
.then(function () {
|
||||||
|
_this.enterPromise = null;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
enter: function (resolve) {
|
||||||
|
var _this = this;
|
||||||
|
var _a = this.data, duration = _a.duration, name = _a.name;
|
||||||
|
var classNames = getClassNames(name);
|
||||||
|
var currentDuration = (0, validator_1.isObj)(duration) ? duration.enter : duration;
|
||||||
|
if (this.status === 'enter') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.status = 'enter';
|
||||||
|
this.$emit('before-enter');
|
||||||
|
(0, utils_1.requestAnimationFrame)(function () {
|
||||||
|
if (_this.status !== 'enter') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_this.status = 'enter';
|
_this.$emit('enter');
|
||||||
_this.$emit('before-enter');
|
_this.setData({
|
||||||
|
inited: true,
|
||||||
|
display: true,
|
||||||
|
classes: classNames.enter,
|
||||||
|
currentDuration: currentDuration,
|
||||||
|
});
|
||||||
(0, utils_1.requestAnimationFrame)(function () {
|
(0, utils_1.requestAnimationFrame)(function () {
|
||||||
if (_this.status !== 'enter') {
|
if (_this.status !== 'enter') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_this.$emit('enter');
|
_this.transitionEnded = false;
|
||||||
_this.setData({
|
_this.setData({ classes: classNames['enter-to'] });
|
||||||
inited: true,
|
resolve();
|
||||||
display: true,
|
|
||||||
classes: classNames.enter,
|
|
||||||
currentDuration: currentDuration,
|
|
||||||
});
|
|
||||||
(0, utils_1.requestAnimationFrame)(function () {
|
|
||||||
if (_this.status !== 'enter') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_this.transitionEnded = false;
|
|
||||||
_this.setData({ classes: classNames['enter-to'] });
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
leave: function () {
|
leave: function (resolve) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
if (!this.enterFinishedPromise)
|
if (!this.data.display) {
|
||||||
return;
|
return;
|
||||||
this.enterFinishedPromise.then(function () {
|
}
|
||||||
if (!_this.data.display) {
|
var _a = this.data, duration = _a.duration, name = _a.name;
|
||||||
|
var classNames = getClassNames(name);
|
||||||
|
var currentDuration = (0, validator_1.isObj)(duration) ? duration.leave : duration;
|
||||||
|
this.status = 'leave';
|
||||||
|
this.$emit('before-leave');
|
||||||
|
(0, utils_1.requestAnimationFrame)(function () {
|
||||||
|
if (_this.status !== 'leave') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var _a = _this.data, duration = _a.duration, name = _a.name;
|
_this.$emit('leave');
|
||||||
var classNames = getClassNames(name);
|
_this.setData({
|
||||||
var currentDuration = (0, validator_1.isObj)(duration) ? duration.leave : duration;
|
classes: classNames.leave,
|
||||||
_this.status = 'leave';
|
currentDuration: currentDuration,
|
||||||
_this.$emit('before-leave');
|
});
|
||||||
(0, utils_1.requestAnimationFrame)(function () {
|
(0, utils_1.requestAnimationFrame)(function () {
|
||||||
if (_this.status !== 'leave') {
|
if (_this.status !== 'leave') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_this.$emit('leave');
|
_this.transitionEnded = false;
|
||||||
_this.setData({
|
setTimeout(function () {
|
||||||
classes: classNames.leave,
|
_this.onTransitionEnd();
|
||||||
currentDuration: currentDuration,
|
resolve();
|
||||||
});
|
}, currentDuration);
|
||||||
(0, utils_1.requestAnimationFrame)(function () {
|
_this.setData({ classes: classNames['leave-to'] });
|
||||||
if (_this.status !== 'leave') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_this.transitionEnded = false;
|
|
||||||
setTimeout(function () {
|
|
||||||
_this.onTransitionEnd();
|
|
||||||
_this.enterFinishedPromise = null;
|
|
||||||
}, currentDuration);
|
|
||||||
_this.setData({ classes: classNames['leave-to'] });
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
+19
-12
@@ -64,7 +64,7 @@ var utils_1 = require("../common/utils");
|
|||||||
(0, utils_1.getRect)(_this, '.van-notice-bar__wrap'),
|
(0, utils_1.getRect)(_this, '.van-notice-bar__wrap'),
|
||||||
]).then(function (rects) {
|
]).then(function (rects) {
|
||||||
var contentRect = rects[0], wrapRect = rects[1];
|
var contentRect = rects[0], wrapRect = rects[1];
|
||||||
var _a = _this.data, speed = _a.speed, scrollable = _a.scrollable, delay = _a.delay;
|
var scrollable = _this.data.scrollable;
|
||||||
if (contentRect == null ||
|
if (contentRect == null ||
|
||||||
wrapRect == null ||
|
wrapRect == null ||
|
||||||
!contentRect.width ||
|
!contentRect.width ||
|
||||||
@@ -73,20 +73,26 @@ var utils_1 = require("../common/utils");
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (scrollable || wrapRect.width < contentRect.width) {
|
if (scrollable || wrapRect.width < contentRect.width) {
|
||||||
var duration = ((wrapRect.width + contentRect.width) / speed) * 1000;
|
_this.initAnimation(wrapRect.width, contentRect.width);
|
||||||
_this.wrapWidth = wrapRect.width;
|
|
||||||
_this.contentWidth = contentRect.width;
|
|
||||||
_this.duration = duration;
|
|
||||||
_this.animation = wx.createAnimation({
|
|
||||||
duration: duration,
|
|
||||||
timingFunction: 'linear',
|
|
||||||
delay: delay,
|
|
||||||
});
|
|
||||||
_this.scroll(true);
|
_this.scroll(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
initAnimation: function (warpWidth, contentWidth) {
|
||||||
|
var _a = this.data, speed = _a.speed, delay = _a.delay;
|
||||||
|
this.wrapWidth = warpWidth;
|
||||||
|
this.contentWidth = contentWidth;
|
||||||
|
// begin 0
|
||||||
|
this.contentDuration = (contentWidth / speed) * 1000;
|
||||||
|
// begin -wrapWidth
|
||||||
|
this.duration = ((warpWidth + contentWidth) / speed) * 1000;
|
||||||
|
this.animation = wx.createAnimation({
|
||||||
|
duration: this.contentDuration,
|
||||||
|
timingFunction: 'linear',
|
||||||
|
delay: delay,
|
||||||
|
});
|
||||||
|
},
|
||||||
scroll: function (isInit) {
|
scroll: function (isInit) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
if (isInit === void 0) { isInit = false; }
|
if (isInit === void 0) { isInit = false; }
|
||||||
@@ -98,17 +104,18 @@ var utils_1 = require("../common/utils");
|
|||||||
.step()
|
.step()
|
||||||
.export(),
|
.export(),
|
||||||
});
|
});
|
||||||
|
var duration = isInit ? this.contentDuration : this.duration;
|
||||||
(0, utils_1.requestAnimationFrame)(function () {
|
(0, utils_1.requestAnimationFrame)(function () {
|
||||||
_this.setData({
|
_this.setData({
|
||||||
animationData: _this.animation
|
animationData: _this.animation
|
||||||
.translateX(-_this.contentWidth)
|
.translateX(-_this.contentWidth)
|
||||||
.step()
|
.step({ duration: duration })
|
||||||
.export(),
|
.export(),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.timer = setTimeout(function () {
|
this.timer = setTimeout(function () {
|
||||||
_this.scroll();
|
_this.scroll();
|
||||||
}, this.duration + this.data.delay);
|
}, duration + this.data.delay);
|
||||||
},
|
},
|
||||||
onClickIcon: function (event) {
|
onClickIcon: function (event) {
|
||||||
if (this.data.mode === 'closeable') {
|
if (this.data.mode === 'closeable') {
|
||||||
|
|||||||
+23
-27
@@ -85,18 +85,18 @@ function equal(value1, value2) {
|
|||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
this.setData({
|
this.setData({
|
||||||
currentValue: this.format(this.data.value),
|
currentValue: this.format(this.data.value).newValue,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
observeValue: function () {
|
observeValue: function () {
|
||||||
var value = this.data.value;
|
var value = this.data.value;
|
||||||
this.setData({ currentValue: this.format(value) });
|
this.setData({ currentValue: this.format(value).newValue });
|
||||||
},
|
},
|
||||||
check: function () {
|
check: function () {
|
||||||
var val = this.format(this.data.currentValue);
|
var newValue = this.format(this.data.currentValue).newValue;
|
||||||
if (!equal(val, this.data.currentValue)) {
|
if (!equal(newValue, this.data.currentValue)) {
|
||||||
this.setData({ currentValue: val });
|
this.setData({ currentValue: newValue });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isDisabled: function (type) {
|
isDisabled: function (type) {
|
||||||
@@ -110,10 +110,10 @@ function equal(value1, value2) {
|
|||||||
this.$emit('focus', event.detail);
|
this.$emit('focus', event.detail);
|
||||||
},
|
},
|
||||||
onBlur: function (event) {
|
onBlur: function (event) {
|
||||||
var value = this.format(event.detail.value);
|
var data = this.format(event.detail.value);
|
||||||
this.setData({ currentValue: value });
|
this.setData({ currentValue: data.newValue });
|
||||||
this.emitChange(value);
|
this.emitChange(data);
|
||||||
this.$emit('blur', __assign(__assign({}, event.detail), { value: value }));
|
this.$emit('blur', __assign(__assign({}, event.detail), { value: +data.newValue }));
|
||||||
},
|
},
|
||||||
// filter illegal characters
|
// filter illegal characters
|
||||||
filter: function (value) {
|
filter: function (value) {
|
||||||
@@ -123,17 +123,16 @@ function equal(value1, value2) {
|
|||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
// limit value range
|
|
||||||
format: function (value) {
|
format: function (value) {
|
||||||
value = this.filter(value);
|
// filter illegal characters and format integer
|
||||||
|
var safeValue = this.filter(value);
|
||||||
// format range
|
// format range
|
||||||
value = value === '' ? 0 : +value;
|
var rangeValue = Math.max(Math.min(this.data.max, +safeValue), this.data.min);
|
||||||
value = Math.max(Math.min(this.data.max, value), this.data.min);
|
|
||||||
// format decimal
|
// format decimal
|
||||||
if ((0, validator_1.isDef)(this.data.decimalLength)) {
|
var newValue = (0, validator_1.isDef)(this.data.decimalLength)
|
||||||
value = value.toFixed(this.data.decimalLength);
|
? rangeValue.toFixed(this.data.decimalLength)
|
||||||
}
|
: String(rangeValue);
|
||||||
return value;
|
return { value: value, newValue: newValue };
|
||||||
},
|
},
|
||||||
onInput: function (event) {
|
onInput: function (event) {
|
||||||
var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a;
|
var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a;
|
||||||
@@ -141,19 +140,16 @@ function equal(value1, value2) {
|
|||||||
if (value === '') {
|
if (value === '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var formatted = this.filter(value);
|
var formatted = this.format(value);
|
||||||
// limit max decimal length
|
|
||||||
if ((0, validator_1.isDef)(this.data.decimalLength) && formatted.indexOf('.') !== -1) {
|
|
||||||
var pair = formatted.split('.');
|
|
||||||
formatted = "".concat(pair[0], ".").concat(pair[1].slice(0, this.data.decimalLength));
|
|
||||||
}
|
|
||||||
this.emitChange(formatted);
|
this.emitChange(formatted);
|
||||||
},
|
},
|
||||||
emitChange: function (value) {
|
emitChange: function (data) {
|
||||||
|
var value = data.value, newValue = data.newValue;
|
||||||
if (!this.data.asyncChange) {
|
if (!this.data.asyncChange) {
|
||||||
this.setData({ currentValue: value });
|
// fix when input 11. parsed to 11, unable to enter decimal
|
||||||
|
this.setData({ currentValue: +value === +newValue ? value : newValue });
|
||||||
}
|
}
|
||||||
this.$emit('change', value);
|
this.$emit('change', +newValue);
|
||||||
},
|
},
|
||||||
onChange: function () {
|
onChange: function () {
|
||||||
var type = this.type;
|
var type = this.type;
|
||||||
@@ -162,7 +158,7 @@ function equal(value1, value2) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var diff = type === 'minus' ? -this.data.step : +this.data.step;
|
var diff = type === 'minus' ? -this.data.step : +this.data.step;
|
||||||
var value = this.format(add(+this.data.currentValue, diff));
|
var value = this.format(String(add(+this.data.currentValue, diff)));
|
||||||
this.emitChange(value);
|
this.emitChange(value);
|
||||||
this.$emit(type);
|
this.$emit(type);
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
@import '../common/index.wxss';.van-steps{background-color:var(--steps-background-color,#fff);overflow:hidden}.van-steps--horizontal{padding:10px}.van-steps--horizontal .van-step__wrapper{display:flex;overflow:hidden;position:relative}.van-steps--vertical{padding-left:10px}.van-steps--vertical .van-step__wrapper{padding:0 0 0 20px}.van-step{color:var(--step-text-color,#969799);flex:1;font-size:var(--step-font-size,14px);position:relative}.van-step--finish{color:var(--step-finish-text-color,#323233)}.van-step__circle{background-color:var(--step-circle-color,#969799);border-radius:50%;height:var(--step-circle-size,5px);width:var(--step-circle-size,5px)}.van-step--horizontal{padding-bottom:14px}.van-step--horizontal:first-child .van-step__title{transform:none}.van-step--horizontal:first-child .van-step__circle-container{padding:0 8px 0 0;transform:translate3d(0,50%,0)}.van-step--horizontal:last-child{position:absolute;right:0;width:auto}.van-step--horizontal:last-child .van-step__title{text-align:right;transform:none}.van-step--horizontal:last-child .van-step__circle-container{padding:0 0 0 8px;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal .van-step__circle-container{background-color:#fff;bottom:6px;padding:0 var(--padding-xs,8px);position:absolute;transform:translate3d(-50%,50%,0);z-index:1}.van-step--horizontal .van-step__title{display:inline-block;font-size:var(--step-horizontal-title-font-size,12px);transform:translate3d(-50%,0,0)}.van-step--horizontal .van-step__line{background-color:var(--step-line-color,#ebedf0);bottom:6px;height:1px;left:0;position:absolute;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal.van-step--process{color:var(--step-process-text-color,#323233)}.van-step--horizontal.van-step--process .van-step__icon{display:block;font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical{line-height:18px;padding:10px 10px 10px 0}.van-step--vertical:after{border-bottom-width:1px}.van-step--vertical:last-child:after{border-bottom-width:none}.van-step--vertical:first-child:before{background-color:#fff;content:"";height:20px;left:-15px;position:absolute;top:0;width:1px;z-index:1}.van-step--vertical .van-step__circle,.van-step--vertical .van-step__icon,.van-step--vertical .van-step__line{left:-14px;position:absolute;top:19px;transform:translate3d(-50%,-50%,0);z-index:2}.van-step--vertical .van-step__icon{background-color:var(--steps-background-color,#fff);font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical .van-step__line{background-color:var(--step-line-color,#ebedf0);height:100%;transform:translate3d(-50%,0,0);width:1px;z-index:1}
|
@import '../common/index.wxss';.van-steps{background-color:var(--steps-background-color,#fff);overflow:hidden}.van-steps--horizontal{padding:10px}.van-steps--horizontal .van-step__wrapper{display:flex;overflow:hidden;position:relative}.van-steps--vertical{padding-left:10px}.van-steps--vertical .van-step__wrapper{padding:0 0 0 20px}.van-step{color:var(--step-text-color,#969799);flex:1;font-size:var(--step-font-size,14px);position:relative}.van-step--finish{color:var(--step-finish-text-color,#323233)}.van-step__circle{background-color:var(--step-circle-color,#969799);border-radius:50%;height:var(--step-circle-size,5px);width:var(--step-circle-size,5px)}.van-step--horizontal{padding-bottom:14px}.van-step--horizontal:first-child .van-step__title{transform:none}.van-step--horizontal:first-child .van-step__circle-container{padding:0 8px 0 0;transform:translate3d(0,50%,0)}.van-step--horizontal:last-child{bottom:0;position:absolute;right:0;top:0;width:auto}.van-step--horizontal:last-child .van-step__title{text-align:right;transform:none}.van-step--horizontal:last-child .van-step__circle-container{padding:0 0 0 8px;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal .van-step__circle-container{background-color:#fff;bottom:6px;padding:0 var(--padding-xs,8px);position:absolute;transform:translate3d(-50%,50%,0);z-index:1}.van-step--horizontal .van-step__title{display:inline-block;font-size:var(--step-horizontal-title-font-size,12px);transform:translate3d(-50%,0,0)}.van-step--horizontal .van-step__line{background-color:var(--step-line-color,#ebedf0);bottom:6px;height:1px;left:0;position:absolute;right:0;transform:translate3d(0,50%,0)}.van-step--horizontal.van-step--process{color:var(--step-process-text-color,#323233)}.van-step--horizontal.van-step--process .van-step__icon{display:block;font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical{line-height:18px;padding:10px 10px 10px 0}.van-step--vertical:after{border-bottom-width:1px}.van-step--vertical:last-child:after{border-bottom-width:none}.van-step--vertical:first-child:before{background-color:#fff;content:"";height:20px;left:-15px;position:absolute;top:0;width:1px;z-index:1}.van-step--vertical .van-step__circle,.van-step--vertical .van-step__icon,.van-step--vertical .van-step__line{left:-14px;position:absolute;top:19px;transform:translate3d(-50%,-50%,0);z-index:2}.van-step--vertical .van-step__icon{background-color:var(--steps-background-color,#fff);font-size:var(--step-icon-size,12px);line-height:1}.van-step--vertical .van-step__line{background-color:var(--step-line-color,#ebedf0);height:100%;transform:translate3d(-50%,0,0);width:1px;z-index:1}
|
||||||
+4
-2
@@ -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,
|
||||||
@@ -168,6 +168,8 @@ var validator_1 = require("../common/validator");
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
onPreviewFile: function (event) {
|
onPreviewFile: function (event) {
|
||||||
|
if (!this.data.previewFile)
|
||||||
|
return;
|
||||||
var index = event.currentTarget.dataset.index;
|
var index = event.currentTarget.dataset.index;
|
||||||
wx.openDocument({
|
wx.openDocument({
|
||||||
filePath: this.data.lists[index].url,
|
filePath: this.data.lists[index].url,
|
||||||
|
|||||||
+1
@@ -29,6 +29,7 @@
|
|||||||
poster="{{ item.thumb }}"
|
poster="{{ item.thumb }}"
|
||||||
autoplay="{{ item.autoplay }}"
|
autoplay="{{ item.autoplay }}"
|
||||||
object-fit="{{videoFit}}"
|
object-fit="{{videoFit}}"
|
||||||
|
referrer-policy="{{ referrerPolicy }}"
|
||||||
class="van-uploader__preview-image"
|
class="van-uploader__preview-image"
|
||||||
style="{{ computed.sizeStyle({ previewSize }) }}"
|
style="{{ computed.sizeStyle({ previewSize }) }}"
|
||||||
data-index="{{ index }}"
|
data-index="{{ index }}"
|
||||||
|
|||||||
+8
@@ -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: {
|
||||||
@@ -50,4 +54,8 @@ export declare const mediaProps: {
|
|||||||
};
|
};
|
||||||
export declare const messageFileProps: {
|
export declare const messageFileProps: {
|
||||||
extension: null;
|
extension: null;
|
||||||
|
previewFile: {
|
||||||
|
type: BooleanConstructor;
|
||||||
|
value: boolean;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
+8
@@ -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 = {
|
||||||
@@ -57,4 +61,8 @@ exports.mediaProps = {
|
|||||||
// props for file
|
// props for file
|
||||||
exports.messageFileProps = {
|
exports.messageFileProps = {
|
||||||
extension: null,
|
extension: null,
|
||||||
|
previewFile: {
|
||||||
|
type: Boolean,
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
+8
-4
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vant/weapp",
|
"name": "@vant/weapp",
|
||||||
"version": "1.11.4",
|
"version": "1.11.7",
|
||||||
"author": "vant-ui",
|
"author": "vant-ui",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"miniprogram": "lib",
|
"miniprogram": "lib",
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
"release": "sh build/release.sh",
|
"release": "sh build/release.sh",
|
||||||
"release:site": "vant-cli build-site && gh-pages -d site-dist --add",
|
"release:site": "vant-cli build-site && gh-pages -d site-dist --add",
|
||||||
"build:lib": "yarn && npx gulp -f build/compiler.js --series buildEs buildLib",
|
"build:lib": "yarn && npx gulp -f build/compiler.js --series buildEs buildLib",
|
||||||
"build:changelog": "vant-cli changelog",
|
|
||||||
"upload:weapp": "node build/upload.js",
|
"upload:weapp": "node build/upload.js",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"test:watch": "jest --watch"
|
"test:watch": "jest --watch"
|
||||||
@@ -44,8 +43,9 @@
|
|||||||
"@babel/plugin-transform-modules-commonjs": "^7.16.0",
|
"@babel/plugin-transform-modules-commonjs": "^7.16.0",
|
||||||
"@babel/preset-typescript": "^7.16.0",
|
"@babel/preset-typescript": "^7.16.0",
|
||||||
"@types/jest": "^27.0.2",
|
"@types/jest": "^27.0.2",
|
||||||
"@vant/cli": "^4.0.0",
|
"@vant/cli": "^7.0.3",
|
||||||
"@vant/icons": "^3.0.1",
|
"@vant/icons": "^3.0.1",
|
||||||
|
"@vant/stylelint-config": "^1.4.2",
|
||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
"gulp-insert": "^0.5.0",
|
"gulp-insert": "^0.5.0",
|
||||||
"gulp-less": "^5.0.0",
|
"gulp-less": "^5.0.0",
|
||||||
@@ -58,6 +58,7 @@
|
|||||||
"miniprogram-api-typings": "^3.1.6",
|
"miniprogram-api-typings": "^3.1.6",
|
||||||
"miniprogram-ci": "^1.6.1",
|
"miniprogram-ci": "^1.6.1",
|
||||||
"miniprogram-simulate": "^1.4.2",
|
"miniprogram-simulate": "^1.4.2",
|
||||||
|
"stylelint": "13.13.1",
|
||||||
"ts-jest": "^27.0.7",
|
"ts-jest": "^27.0.7",
|
||||||
"tscpaths": "^0.0.9",
|
"tscpaths": "^0.0.9",
|
||||||
"typescript": "^4.4.4",
|
"typescript": "^4.4.4",
|
||||||
@@ -67,5 +68,8 @@
|
|||||||
"Chrome >= 53",
|
"Chrome >= 53",
|
||||||
"ChromeAndroid >= 53",
|
"ChromeAndroid >= 53",
|
||||||
"iOS >= 9"
|
"iOS >= 9"
|
||||||
]
|
],
|
||||||
|
"resolutions": {
|
||||||
|
"source-map": "0.7.4"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+6
-5
@@ -1,17 +1,18 @@
|
|||||||
{
|
{
|
||||||
"name": "yelaymaths",
|
"name": "YelayMaths",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vant/weapp": "^1.11.4"
|
"@vant/weapp": "^1.11.7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vant/weapp": {
|
"node_modules/@vant/weapp": {
|
||||||
"version": "1.11.4",
|
"version": "1.11.7",
|
||||||
"resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.11.4.tgz",
|
"resolved": "https://registry.npmjs.org/@vant/weapp/-/weapp-1.11.7.tgz",
|
||||||
"integrity": "sha512-egOsWO4hVMP1SQSqQ46jy8UD3WysvlnUecRzPM21Y3ovkOFZ6wlaO7oHQmTXRpwr+V41Qri1qEbtNjhVxFqdyw=="
|
"integrity": "sha512-Rwn9BBnb4kHSV4XmvBicwtd42J+amEUfnFDcXJsGNPNX4a9c/DoT6YLsm4X1wB2+sQbdiQsbFBLAvGRBxCkD8g==",
|
||||||
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vant/weapp": "^1.11.4"
|
"@vant/weapp": "^1.11.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user