mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-05 19:41:45 +08:00
build: compile 1.10.10
This commit is contained in:
parent
33e1725b0a
commit
e4952f28e4
2
dist/dialog/index.wxml
vendored
2
dist/dialog/index.wxml
vendored
@ -69,7 +69,7 @@
|
||||
</van-goods-action-button>
|
||||
</van-goods-action>
|
||||
|
||||
<view wx:else class="van-hairline--top van-dialog__footer">
|
||||
<view wx:elif="{{ showCancelButton || showConfirmButton }}" class="van-hairline--top van-dialog__footer">
|
||||
<van-button
|
||||
wx:if="{{ showCancelButton }}"
|
||||
size="large"
|
||||
|
2
dist/dropdown-menu/index.wxss
vendored
2
dist/dropdown-menu/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-dropdown-menu{background-color:var(--dropdown-menu-background-color,#fff);box-shadow:var(--dropdown-menu-box-shadow,0 2px 12px hsla(210,1%,40%,.12));display:flex;height:var(--dropdown-menu-height,50px);-webkit-user-select:none;user-select:none}.van-dropdown-menu__item{align-items:center;display:flex;flex:1;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{box-sizing:border-box;color:var(--dropdown-menu-title-text-color,#323233);font-size:var(--dropdown-menu-title-font-size,15px);line-height:var(--dropdown-menu-title-line-height,18px);max-width:100%;padding:var(--dropdown-menu-title-padding,0 8px);position:relative}.van-dropdown-menu__title:after{border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;content:"";margin-top:-5px;opacity:.8;position:absolute;right:-4px;top:50%;transform:rotate(-45deg)}.van-dropdown-menu__title--active{color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}
|
||||
@import '../common/index.wxss';.van-dropdown-menu{background-color:var(--dropdown-menu-background-color,#fff);box-shadow:var(--dropdown-menu-box-shadow,0 2px 12px hsla(210,1%,40%,.12));display:flex;height:var(--dropdown-menu-height,50px);-webkit-user-select:none;user-select:none}.van-dropdown-menu__item{align-items:center;display:flex;flex:1;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{box-sizing:border-box;color:var(--dropdown-menu-title-text-color,#323233);font-size:var(--dropdown-menu-title-font-size,15px);line-height:var(--dropdown-menu-title-line-height,18px);max-width:100%;padding:var(--dropdown-menu-title-padding,0 24px 0 8px);position:relative}.van-dropdown-menu__title:after{border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;content:"";margin-top:-5px;opacity:.8;position:absolute;right:11px;top:50%;transform:rotate(-45deg)}.van-dropdown-menu__title--active{color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}
|
2
dist/search/index.wxml
vendored
2
dist/search/index.wxml
vendored
@ -48,6 +48,6 @@
|
||||
hover-stay-time="70"
|
||||
>
|
||||
<slot wx:if="{{ useActionSlot }}" name="action" />
|
||||
<view wx:else bind:tap="onCancel" class="cancel-class">{{ actionText }}</view>
|
||||
<view wx:else bind:tap="onCancel" class="van-search__action-button cancel-class">{{ actionText }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
2
dist/search/index.wxss
vendored
2
dist/search/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-search{align-items:center;box-sizing:border-box;display:flex;padding:var(--search-padding,10px 12px)}.van-search__content{background-color:var(--search-background-color,#f7f8fa);border-radius:2px;display:flex;flex:1;padding-left:var(--padding-sm,12px)}.van-search__content--round{border-radius:999px}.van-search__label{color:var(--search-label-color,#323233);font-size:var(--search-label-font-size,14px);line-height:var(--search-input-height,34px);padding:var(--search-label-padding,0 5px)}.van-search__field{flex:1}.van-search__field__left-icon{color:var(--search-left-icon-color,#969799)}.van-search--withaction{padding-right:0}.van-search__action{color:var(--search-action-text-color,#323233);font-size:var(--search-action-font-size,14px);line-height:var(--search-input-height,34px);padding:var(--search-action-padding,0 8px)}.van-search__action--hover{background-color:#f2f3f5}
|
||||
@import '../common/index.wxss';.van-search{align-items:center;box-sizing:border-box;display:flex;padding:var(--search-padding,10px 12px)}.van-search__content{background-color:var(--search-background-color,#f7f8fa);border-radius:2px;display:flex;flex:1;padding-left:var(--padding-sm,12px)}.van-search__content--round{border-radius:999px}.van-search__label{color:var(--search-label-color,#323233);font-size:var(--search-label-font-size,14px);line-height:var(--search-input-height,34px);padding:var(--search-label-padding,0 5px)}.van-search__field{flex:1}.van-search__field__left-icon{color:var(--search-left-icon-color,#969799)}.van-search--withaction{padding-right:0}.van-search__action{color:var(--search-action-text-color,#323233);font-size:var(--search-action-font-size,14px);line-height:var(--search-input-height,34px)}.van-search__action--hover{background-color:#f2f3f5}.van-search__action-button{padding:var(--search-action-padding,0 8px)}
|
41
dist/tabs/index.js
vendored
41
dist/tabs/index.js
vendored
@ -79,6 +79,10 @@ VantComponent({
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
useBeforeChange: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
data: {
|
||||
tabs: [],
|
||||
@ -112,28 +116,25 @@ VantComponent({
|
||||
},
|
||||
trigger(eventName, child) {
|
||||
const { currentIndex } = this.data;
|
||||
const currentChild = child || this.children[currentIndex];
|
||||
if (!isDef(currentChild)) {
|
||||
const data = this.getChildData(currentIndex, child);
|
||||
if (!isDef(data)) {
|
||||
return;
|
||||
}
|
||||
this.$emit(eventName, {
|
||||
index: currentChild.index,
|
||||
name: currentChild.getComputedName(),
|
||||
title: currentChild.data.title,
|
||||
});
|
||||
this.$emit(eventName, data);
|
||||
},
|
||||
onTap(event) {
|
||||
const { index } = event.currentTarget.dataset;
|
||||
const child = this.children[index];
|
||||
if (child.data.disabled) {
|
||||
this.trigger('disabled', child);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
this.onBeforeChange(index).then(() => {
|
||||
this.setCurrentIndex(index);
|
||||
nextTick(() => {
|
||||
this.trigger('click');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// correct the index of active tab
|
||||
setCurrentIndexByName(name) {
|
||||
@ -255,7 +256,7 @@ VantComponent({
|
||||
if (direction === 'horizontal' && offsetX >= minSwipeDistance) {
|
||||
const index = this.getAvaiableTab(deltaX);
|
||||
if (index !== -1) {
|
||||
this.setCurrentIndex(index);
|
||||
this.onBeforeChange(index).then(() => this.setCurrentIndex(index));
|
||||
}
|
||||
}
|
||||
this.swiping = false;
|
||||
@ -274,5 +275,25 @@ VantComponent({
|
||||
}
|
||||
return -1;
|
||||
},
|
||||
onBeforeChange(index) {
|
||||
const { useBeforeChange } = this.data;
|
||||
if (!useBeforeChange) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
this.$emit('before-change', Object.assign(Object.assign({}, this.getChildData(index)), { callback: (status) => (status ? resolve() : reject()) }));
|
||||
});
|
||||
},
|
||||
getChildData(index, child) {
|
||||
const currentChild = child || this.children[index];
|
||||
if (!isDef(currentChild)) {
|
||||
return;
|
||||
}
|
||||
return {
|
||||
index: currentChild.index,
|
||||
name: currentChild.getComputedName(),
|
||||
title: currentChild.data.title,
|
||||
};
|
||||
},
|
||||
},
|
||||
});
|
||||
|
17
dist/uploader/index.js
vendored
17
dist/uploader/index.js
vendored
@ -129,11 +129,20 @@ VantComponent({
|
||||
return;
|
||||
const { index } = event.currentTarget.dataset;
|
||||
const { lists } = this.data;
|
||||
const sources = [];
|
||||
const current = lists.reduce((sum, cur, curIndex) => {
|
||||
if (!isVideoFile(cur)) {
|
||||
return sum;
|
||||
}
|
||||
sources.push(Object.assign(Object.assign({}, cur), { type: 'video' }));
|
||||
if (curIndex < index) {
|
||||
sum++;
|
||||
}
|
||||
return sum;
|
||||
}, 0);
|
||||
wx.previewMedia({
|
||||
sources: lists
|
||||
.filter((item) => isVideoFile(item))
|
||||
.map((item) => (Object.assign(Object.assign({}, item), { type: 'video' }))),
|
||||
current: index,
|
||||
sources,
|
||||
current,
|
||||
fail() {
|
||||
wx.showToast({ title: '预览视频失败', icon: 'none' });
|
||||
},
|
||||
|
@ -69,7 +69,7 @@
|
||||
</van-goods-action-button>
|
||||
</van-goods-action>
|
||||
|
||||
<view wx:else class="van-hairline--top van-dialog__footer">
|
||||
<view wx:elif="{{ showCancelButton || showConfirmButton }}" class="van-hairline--top van-dialog__footer">
|
||||
<van-button
|
||||
wx:if="{{ showCancelButton }}"
|
||||
size="large"
|
||||
|
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-dropdown-menu{background-color:var(--dropdown-menu-background-color,#fff);box-shadow:var(--dropdown-menu-box-shadow,0 2px 12px hsla(210,1%,40%,.12));display:flex;height:var(--dropdown-menu-height,50px);-webkit-user-select:none;user-select:none}.van-dropdown-menu__item{align-items:center;display:flex;flex:1;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{box-sizing:border-box;color:var(--dropdown-menu-title-text-color,#323233);font-size:var(--dropdown-menu-title-font-size,15px);line-height:var(--dropdown-menu-title-line-height,18px);max-width:100%;padding:var(--dropdown-menu-title-padding,0 8px);position:relative}.van-dropdown-menu__title:after{border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;content:"";margin-top:-5px;opacity:.8;position:absolute;right:-4px;top:50%;transform:rotate(-45deg)}.van-dropdown-menu__title--active{color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}
|
||||
@import '../common/index.wxss';.van-dropdown-menu{background-color:var(--dropdown-menu-background-color,#fff);box-shadow:var(--dropdown-menu-box-shadow,0 2px 12px hsla(210,1%,40%,.12));display:flex;height:var(--dropdown-menu-height,50px);-webkit-user-select:none;user-select:none}.van-dropdown-menu__item{align-items:center;display:flex;flex:1;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{box-sizing:border-box;color:var(--dropdown-menu-title-text-color,#323233);font-size:var(--dropdown-menu-title-font-size,15px);line-height:var(--dropdown-menu-title-line-height,18px);max-width:100%;padding:var(--dropdown-menu-title-padding,0 24px 0 8px);position:relative}.van-dropdown-menu__title:after{border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;content:"";margin-top:-5px;opacity:.8;position:absolute;right:11px;top:50%;transform:rotate(-45deg)}.van-dropdown-menu__title--active{color:var(--dropdown-menu-title-active-text-color,#ee0a24)}.van-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}
|
@ -48,6 +48,6 @@
|
||||
hover-stay-time="70"
|
||||
>
|
||||
<slot wx:if="{{ useActionSlot }}" name="action" />
|
||||
<view wx:else bind:tap="onCancel" class="cancel-class">{{ actionText }}</view>
|
||||
<view wx:else bind:tap="onCancel" class="van-search__action-button cancel-class">{{ actionText }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-search{align-items:center;box-sizing:border-box;display:flex;padding:var(--search-padding,10px 12px)}.van-search__content{background-color:var(--search-background-color,#f7f8fa);border-radius:2px;display:flex;flex:1;padding-left:var(--padding-sm,12px)}.van-search__content--round{border-radius:999px}.van-search__label{color:var(--search-label-color,#323233);font-size:var(--search-label-font-size,14px);line-height:var(--search-input-height,34px);padding:var(--search-label-padding,0 5px)}.van-search__field{flex:1}.van-search__field__left-icon{color:var(--search-left-icon-color,#969799)}.van-search--withaction{padding-right:0}.van-search__action{color:var(--search-action-text-color,#323233);font-size:var(--search-action-font-size,14px);line-height:var(--search-input-height,34px);padding:var(--search-action-padding,0 8px)}.van-search__action--hover{background-color:#f2f3f5}
|
||||
@import '../common/index.wxss';.van-search{align-items:center;box-sizing:border-box;display:flex;padding:var(--search-padding,10px 12px)}.van-search__content{background-color:var(--search-background-color,#f7f8fa);border-radius:2px;display:flex;flex:1;padding-left:var(--padding-sm,12px)}.van-search__content--round{border-radius:999px}.van-search__label{color:var(--search-label-color,#323233);font-size:var(--search-label-font-size,14px);line-height:var(--search-input-height,34px);padding:var(--search-label-padding,0 5px)}.van-search__field{flex:1}.van-search__field__left-icon{color:var(--search-left-icon-color,#969799)}.van-search--withaction{padding-right:0}.van-search__action{color:var(--search-action-text-color,#323233);font-size:var(--search-action-font-size,14px);line-height:var(--search-input-height,34px)}.van-search__action--hover{background-color:#f2f3f5}.van-search__action-button{padding:var(--search-action-padding,0 8px)}
|
@ -1,4 +1,15 @@
|
||||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var component_1 = require("../common/component");
|
||||
var touch_1 = require("../mixins/touch");
|
||||
@ -84,6 +95,10 @@ var relation_1 = require("../common/relation");
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
useBeforeChange: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
},
|
||||
data: {
|
||||
tabs: [],
|
||||
@ -118,15 +133,11 @@ var relation_1 = require("../common/relation");
|
||||
},
|
||||
trigger: function (eventName, child) {
|
||||
var currentIndex = this.data.currentIndex;
|
||||
var currentChild = child || this.children[currentIndex];
|
||||
if (!(0, validator_1.isDef)(currentChild)) {
|
||||
var data = this.getChildData(currentIndex, child);
|
||||
if (!(0, validator_1.isDef)(data)) {
|
||||
return;
|
||||
}
|
||||
this.$emit(eventName, {
|
||||
index: currentChild.index,
|
||||
name: currentChild.getComputedName(),
|
||||
title: currentChild.data.title,
|
||||
});
|
||||
this.$emit(eventName, data);
|
||||
},
|
||||
onTap: function (event) {
|
||||
var _this = this;
|
||||
@ -134,13 +145,14 @@ var relation_1 = require("../common/relation");
|
||||
var child = this.children[index];
|
||||
if (child.data.disabled) {
|
||||
this.trigger('disabled', child);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
this.setCurrentIndex(index);
|
||||
this.onBeforeChange(index).then(function () {
|
||||
_this.setCurrentIndex(index);
|
||||
(0, utils_1.nextTick)(function () {
|
||||
_this.trigger('click');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// correct the index of active tab
|
||||
setCurrentIndexByName: function (name) {
|
||||
@ -260,14 +272,15 @@ var relation_1 = require("../common/relation");
|
||||
},
|
||||
// watch swipe touch end
|
||||
onTouchEnd: function () {
|
||||
var _this = this;
|
||||
if (!this.data.swipeable || !this.swiping)
|
||||
return;
|
||||
var _a = this, direction = _a.direction, deltaX = _a.deltaX, offsetX = _a.offsetX;
|
||||
var minSwipeDistance = 50;
|
||||
if (direction === 'horizontal' && offsetX >= minSwipeDistance) {
|
||||
var index = this.getAvaiableTab(deltaX);
|
||||
if (index !== -1) {
|
||||
this.setCurrentIndex(index);
|
||||
var index_1 = this.getAvaiableTab(deltaX);
|
||||
if (index_1 !== -1) {
|
||||
this.onBeforeChange(index_1).then(function () { return _this.setCurrentIndex(index_1); });
|
||||
}
|
||||
}
|
||||
this.swiping = false;
|
||||
@ -286,5 +299,26 @@ var relation_1 = require("../common/relation");
|
||||
}
|
||||
return -1;
|
||||
},
|
||||
onBeforeChange: function (index) {
|
||||
var _this = this;
|
||||
var useBeforeChange = this.data.useBeforeChange;
|
||||
if (!useBeforeChange) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return new Promise(function (resolve, reject) {
|
||||
_this.$emit('before-change', __assign(__assign({}, _this.getChildData(index)), { callback: function (status) { return (status ? resolve() : reject()); } }));
|
||||
});
|
||||
},
|
||||
getChildData: function (index, child) {
|
||||
var currentChild = child || this.children[index];
|
||||
if (!(0, validator_1.isDef)(currentChild)) {
|
||||
return;
|
||||
}
|
||||
return {
|
||||
index: currentChild.index,
|
||||
name: currentChild.getComputedName(),
|
||||
title: currentChild.data.title,
|
||||
};
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@ -144,11 +144,20 @@ var validator_1 = require("../common/validator");
|
||||
return;
|
||||
var index = event.currentTarget.dataset.index;
|
||||
var lists = this.data.lists;
|
||||
var sources = [];
|
||||
var current = lists.reduce(function (sum, cur, curIndex) {
|
||||
if (!(0, utils_1.isVideoFile)(cur)) {
|
||||
return sum;
|
||||
}
|
||||
sources.push(__assign(__assign({}, cur), { type: 'video' }));
|
||||
if (curIndex < index) {
|
||||
sum++;
|
||||
}
|
||||
return sum;
|
||||
}, 0);
|
||||
wx.previewMedia({
|
||||
sources: lists
|
||||
.filter(function (item) { return (0, utils_1.isVideoFile)(item); })
|
||||
.map(function (item) { return (__assign(__assign({}, item), { type: 'video' })); }),
|
||||
current: index,
|
||||
sources: sources,
|
||||
current: current,
|
||||
fail: function () {
|
||||
wx.showToast({ title: '预览视频失败', icon: 'none' });
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user