mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-08-06 13:29:45 +08:00
build: compile 1.10.8
This commit is contained in:
parent
c6bff2718a
commit
345027906d
3
dist/dialog/dialog.d.ts
vendored
3
dist/dialog/dialog.d.ts
vendored
@ -14,6 +14,9 @@ interface DialogOptions {
|
||||
overlay?: boolean;
|
||||
selector?: string;
|
||||
ariaLabel?: string;
|
||||
/**
|
||||
* @deprecated use custom-class instead
|
||||
*/
|
||||
className?: string;
|
||||
customStyle?: string;
|
||||
transition?: string;
|
||||
|
2
dist/dialog/index.wxml
vendored
2
dist/dialog/index.wxml
vendored
@ -5,7 +5,7 @@
|
||||
z-index="{{ zIndex }}"
|
||||
overlay="{{ overlay }}"
|
||||
transition="{{ transition }}"
|
||||
custom-class="van-dialog van-dialog--{{ theme }} {{ className }}"
|
||||
custom-class="van-dialog van-dialog--{{ theme }}{{ className }} custom-class"
|
||||
custom-style="width: {{ utils.addUnit(width) }};{{ customStyle }}"
|
||||
overlay-style="{{ overlayStyle }}"
|
||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||
|
20
dist/slider/index.js
vendored
20
dist/slider/index.js
vendored
@ -1,7 +1,12 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
import { touch } from '../mixins/touch';
|
||||
import { canIUseModel } from '../common/version';
|
||||
import { getRect, addUnit } from '../common/utils';
|
||||
import { getRect, addUnit, nextTick } from '../common/utils';
|
||||
const DRAG_STATUS = {
|
||||
START: 'start',
|
||||
MOVING: 'moving',
|
||||
END: 'end',
|
||||
};
|
||||
VantComponent({
|
||||
mixins: [touch],
|
||||
props: {
|
||||
@ -54,16 +59,16 @@ VantComponent({
|
||||
else {
|
||||
this.startValue = this.format(this.newValue);
|
||||
}
|
||||
this.dragStatus = 'start';
|
||||
this.dragStatus = DRAG_STATUS.START;
|
||||
},
|
||||
onTouchMove(event) {
|
||||
if (this.data.disabled)
|
||||
return;
|
||||
if (this.dragStatus === 'start') {
|
||||
if (this.dragStatus === DRAG_STATUS.START) {
|
||||
this.$emit('drag-start');
|
||||
}
|
||||
this.touchMove(event);
|
||||
this.dragStatus = 'draging';
|
||||
this.dragStatus = DRAG_STATUS.MOVING;
|
||||
getRect(this, '.van-slider').then((rect) => {
|
||||
const { vertical } = this.data;
|
||||
const delta = vertical ? this.deltaY : this.deltaX;
|
||||
@ -82,9 +87,12 @@ VantComponent({
|
||||
onTouchEnd() {
|
||||
if (this.data.disabled)
|
||||
return;
|
||||
if (this.dragStatus === 'draging') {
|
||||
if (this.dragStatus === DRAG_STATUS.MOVING) {
|
||||
this.dragStatus = DRAG_STATUS.END;
|
||||
nextTick(() => {
|
||||
this.updateValue(this.newValue, true);
|
||||
this.$emit('drag-end');
|
||||
});
|
||||
}
|
||||
},
|
||||
onClick(event) {
|
||||
@ -166,7 +174,7 @@ VantComponent({
|
||||
getOffsetWidth(current, min) {
|
||||
const scope = this.getScope();
|
||||
// 避免最小值小于最小step时出现负数情况
|
||||
return `${Math.max((current - min) * 100 / scope, 0)}%`;
|
||||
return `${Math.max(((current - min) * 100) / scope, 0)}%`;
|
||||
},
|
||||
// 计算选中条的长度百分比
|
||||
calcMainAxis() {
|
||||
|
1
dist/stepper/index.js
vendored
1
dist/stepper/index.js
vendored
@ -96,7 +96,6 @@ VantComponent({
|
||||
},
|
||||
onBlur(event) {
|
||||
const value = this.format(event.detail.value);
|
||||
this.emitChange(value);
|
||||
this.$emit('blur', Object.assign(Object.assign({}, event.detail), { value }));
|
||||
},
|
||||
// filter illegal characters
|
||||
|
8
dist/tabs/index.js
vendored
8
dist/tabs/index.js
vendored
@ -83,6 +83,7 @@ VantComponent({
|
||||
skipTransition: true,
|
||||
scrollWithAnimation: false,
|
||||
lineOffsetLeft: 0,
|
||||
inited: false,
|
||||
},
|
||||
mounted() {
|
||||
requestAnimationFrame(() => {
|
||||
@ -191,12 +192,13 @@ VantComponent({
|
||||
.reduce((prev, curr) => prev + curr.width, 0);
|
||||
lineOffsetLeft +=
|
||||
(rect.width - lineRect.width) / 2 + (ellipsis ? 0 : 8);
|
||||
this.setData({ lineOffsetLeft });
|
||||
this.setData({ lineOffsetLeft, inited: true });
|
||||
this.swiping = true;
|
||||
if (skipTransition) {
|
||||
nextTick(() => {
|
||||
// waiting transition end
|
||||
setTimeout(() => {
|
||||
this.setData({ skipTransition: false });
|
||||
});
|
||||
}, this.data.duration);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
2
dist/tabs/index.wxml
vendored
2
dist/tabs/index.wxml
vendored
@ -20,7 +20,7 @@
|
||||
style="{{ color ? 'border-color: ' + color : '' }}"
|
||||
>
|
||||
<view class="{{ utils.bem('tabs__nav', [type, { complete: !ellipsis }]) }} nav-class" style="{{ computed.navStyle(color, type) }}">
|
||||
<view wx:if="{{ type === 'line' }}" class="van-tabs__line" style="{{ computed.lineStyle({ color, lineOffsetLeft, lineHeight, skipTransition, duration, lineWidth }) }}" />
|
||||
<view wx:if="{{ type === 'line' }}" class="van-tabs__line" style="{{ computed.lineStyle({ color, lineOffsetLeft, lineHeight, skipTransition, duration, lineWidth, inited }) }}" />
|
||||
<view
|
||||
wx:for="{{ tabs }}"
|
||||
wx:key="index"
|
||||
|
1
dist/tabs/index.wxs
vendored
1
dist/tabs/index.wxs
vendored
@ -60,6 +60,7 @@ function trackStyle(data) {
|
||||
function lineStyle(data) {
|
||||
return style({
|
||||
width: utils.addUnit(data.lineWidth),
|
||||
opacity: data.inited ? 1 : 0,
|
||||
transform: 'translateX(' + data.lineOffsetLeft + 'px)',
|
||||
'-webkit-transform': 'translateX(' + data.lineOffsetLeft + 'px)',
|
||||
'background-color': data.color,
|
||||
|
2
dist/tabs/index.wxss
vendored
2
dist/tabs/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-tabs{-webkit-tap-highlight-color:transparent;position:relative}.van-tabs__wrap{display:flex;overflow:hidden}.van-tabs__wrap--scrollable .van-tab{flex:0 0 22%}.van-tabs__wrap--scrollable .van-tab--complete{flex:1 0 auto!important;padding:0 12px}.van-tabs__wrap--scrollable .van-tabs__nav--complete{padding-left:8px;padding-right:8px}.van-tabs__scroll{background-color:var(--tabs-nav-background-color,#fff)}.van-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.van-tabs__scroll--card{border:1px solid var(--tabs-default-color,#ee0a24);border-radius:2px;box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.van-tabs__scroll::-webkit-scrollbar{display:none}.van-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.van-tabs__nav--card{box-sizing:border-box;height:var(--tabs-card-height,30px)}.van-tabs__nav--card .van-tab{border-right:1px solid var(--tabs-default-color,#ee0a24);color:var(--tabs-default-color,#ee0a24);line-height:calc(var(--tabs-card-height, 30px) - 2px)}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{background-color:var(--tabs-default-color,#ee0a24);color:#fff}.van-tabs__nav--card .van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tabs__line{background-color:var(--tabs-bottom-bar-color,#ee0a24);border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;position:absolute;z-index:1}.van-tabs__track{height:100%;position:relative;width:100%}.van-tabs__track--animated{display:flex;transition-property:left}.van-tabs__content{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:var(--tabs-line-height,44px)}.van-tabs--card .van-tabs__wrap{height:var(--tabs-card-height,30px)}.van-tab{box-sizing:border-box;color:var(--tab-text-color,#646566);cursor:pointer;flex:1;font-size:var(--tab-font-size,14px);line-height:var(--tabs-line-height,44px);min-width:0;padding:0 5px;position:relative;text-align:center}.van-tab--active{color:var(--tab-active-text-color,#323233);font-weight:var(--font-weight-bold,500)}.van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tab__title__info{display:inline-block;position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
||||
@import '../common/index.wxss';.van-tabs{-webkit-tap-highlight-color:transparent;position:relative}.van-tabs__wrap{display:flex;overflow:hidden}.van-tabs__wrap--scrollable .van-tab{flex:0 0 22%}.van-tabs__wrap--scrollable .van-tab--complete{flex:1 0 auto!important;padding:0 12px}.van-tabs__wrap--scrollable .van-tabs__nav--complete{padding-left:8px;padding-right:8px}.van-tabs__scroll{background-color:var(--tabs-nav-background-color,#fff)}.van-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.van-tabs__scroll--card{border:1px solid var(--tabs-default-color,#ee0a24);border-radius:2px;box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.van-tabs__scroll::-webkit-scrollbar{display:none}.van-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.van-tabs__nav--card{box-sizing:border-box;height:var(--tabs-card-height,30px)}.van-tabs__nav--card .van-tab{border-right:1px solid var(--tabs-default-color,#ee0a24);color:var(--tabs-default-color,#ee0a24);line-height:calc(var(--tabs-card-height, 30px) - 2px)}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{background-color:var(--tabs-default-color,#ee0a24);color:#fff}.van-tabs__nav--card .van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tabs__line{background-color:var(--tabs-bottom-bar-color,#ee0a24);border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.van-tabs__track{height:100%;position:relative;width:100%}.van-tabs__track--animated{display:flex;transition-property:left}.van-tabs__content{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:var(--tabs-line-height,44px)}.van-tabs--card .van-tabs__wrap{height:var(--tabs-card-height,30px)}.van-tab{box-sizing:border-box;color:var(--tab-text-color,#646566);cursor:pointer;flex:1;font-size:var(--tab-font-size,14px);line-height:var(--tabs-line-height,44px);min-width:0;padding:0 5px;position:relative;text-align:center}.van-tab--active{color:var(--tab-active-text-color,#323233);font-weight:var(--font-weight-bold,500)}.van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tab__title__info{display:inline-block;position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
6
dist/uploader/index.js
vendored
6
dist/uploader/index.js
vendored
@ -1,9 +1,9 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
import { isImageFile, chooseFile, isVideoFile } from './utils';
|
||||
import { chooseImageProps, chooseVideoProps } from './shared';
|
||||
import { chooseImageProps, chooseVideoProps, chooseMediaProps } from './shared';
|
||||
import { isBoolean, isPromise } from '../common/validator';
|
||||
VantComponent({
|
||||
props: Object.assign(Object.assign({ disabled: Boolean, multiple: Boolean, uploadText: String, useBeforeRead: Boolean, afterRead: null, beforeRead: null, previewSize: {
|
||||
props: Object.assign(Object.assign(Object.assign({ disabled: Boolean, multiple: Boolean, uploadText: String, useBeforeRead: Boolean, afterRead: null, beforeRead: null, previewSize: {
|
||||
type: null,
|
||||
value: 80,
|
||||
}, name: {
|
||||
@ -40,7 +40,7 @@ VantComponent({
|
||||
}, uploadIcon: {
|
||||
type: String,
|
||||
value: 'photograph',
|
||||
} }, chooseImageProps), chooseVideoProps),
|
||||
} }, chooseImageProps), chooseVideoProps), chooseMediaProps),
|
||||
data: {
|
||||
lists: [],
|
||||
isInCount: true,
|
||||
|
18
dist/uploader/shared.d.ts
vendored
18
dist/uploader/shared.d.ts
vendored
@ -26,3 +26,21 @@ export declare const chooseVideoProps: {
|
||||
value: string;
|
||||
};
|
||||
};
|
||||
export declare const chooseMediaProps: {
|
||||
capture: {
|
||||
type: ArrayConstructor;
|
||||
value: string[];
|
||||
};
|
||||
mediaType: {
|
||||
type: ArrayConstructor;
|
||||
value: string[];
|
||||
};
|
||||
maxDuration: {
|
||||
type: NumberConstructor;
|
||||
value: number;
|
||||
};
|
||||
camera: {
|
||||
type: StringConstructor;
|
||||
value: string;
|
||||
};
|
||||
};
|
||||
|
19
dist/uploader/shared.js
vendored
19
dist/uploader/shared.js
vendored
@ -28,3 +28,22 @@ export const chooseVideoProps = {
|
||||
value: 'back',
|
||||
},
|
||||
};
|
||||
// props for choose media
|
||||
export const chooseMediaProps = {
|
||||
capture: {
|
||||
type: Array,
|
||||
value: ['album', 'camera'],
|
||||
},
|
||||
mediaType: {
|
||||
type: Array,
|
||||
value: ['image', 'video'],
|
||||
},
|
||||
maxDuration: {
|
||||
type: Number,
|
||||
value: 60,
|
||||
},
|
||||
camera: {
|
||||
type: String,
|
||||
value: 'back',
|
||||
},
|
||||
};
|
||||
|
3
dist/uploader/utils.d.ts
vendored
3
dist/uploader/utils.d.ts
vendored
@ -10,7 +10,7 @@ export interface File {
|
||||
}
|
||||
export declare function isImageFile(item: File): boolean;
|
||||
export declare function isVideoFile(item: File): boolean;
|
||||
export declare function chooseFile({ accept, multiple, capture, compressed, maxDuration, sizeType, camera, maxCount, }: {
|
||||
export declare function chooseFile({ accept, multiple, capture, compressed, maxDuration, sizeType, camera, maxCount, mediaType, }: {
|
||||
accept: any;
|
||||
multiple: any;
|
||||
capture: any;
|
||||
@ -19,4 +19,5 @@ export declare function chooseFile({ accept, multiple, capture, compressed, maxD
|
||||
sizeType: any;
|
||||
camera: any;
|
||||
maxCount: any;
|
||||
mediaType: any;
|
||||
}): Promise<File | File[]>;
|
||||
|
3
dist/uploader/utils.js
vendored
3
dist/uploader/utils.js
vendored
@ -38,7 +38,7 @@ function formatMedia(res) {
|
||||
function formatFile(res) {
|
||||
return res.tempFiles.map((item) => (Object.assign(Object.assign({}, pickExclude(item, ['path'])), { url: item.path })));
|
||||
}
|
||||
export function chooseFile({ accept, multiple, capture, compressed, maxDuration, sizeType, camera, maxCount, }) {
|
||||
export function chooseFile({ accept, multiple, capture, compressed, maxDuration, sizeType, camera, maxCount, mediaType, }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
switch (accept) {
|
||||
case 'image':
|
||||
@ -53,6 +53,7 @@ export function chooseFile({ accept, multiple, capture, compressed, maxDuration,
|
||||
case 'media':
|
||||
wx.chooseMedia({
|
||||
count: multiple ? Math.min(maxCount, 9) : 1,
|
||||
mediaType,
|
||||
sourceType: capture,
|
||||
maxDuration,
|
||||
sizeType,
|
||||
|
3
lib/dialog/dialog.d.ts
vendored
3
lib/dialog/dialog.d.ts
vendored
@ -14,6 +14,9 @@ interface DialogOptions {
|
||||
overlay?: boolean;
|
||||
selector?: string;
|
||||
ariaLabel?: string;
|
||||
/**
|
||||
* @deprecated use custom-class instead
|
||||
*/
|
||||
className?: string;
|
||||
customStyle?: string;
|
||||
transition?: string;
|
||||
|
@ -5,7 +5,7 @@
|
||||
z-index="{{ zIndex }}"
|
||||
overlay="{{ overlay }}"
|
||||
transition="{{ transition }}"
|
||||
custom-class="van-dialog van-dialog--{{ theme }} {{ className }}"
|
||||
custom-class="van-dialog van-dialog--{{ theme }}{{ className }} custom-class"
|
||||
custom-style="width: {{ utils.addUnit(width) }};{{ customStyle }}"
|
||||
overlay-style="{{ overlayStyle }}"
|
||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||
|
@ -4,6 +4,11 @@ var component_1 = require("../common/component");
|
||||
var touch_1 = require("../mixins/touch");
|
||||
var version_1 = require("../common/version");
|
||||
var utils_1 = require("../common/utils");
|
||||
var DRAG_STATUS = {
|
||||
START: 'start',
|
||||
MOVING: 'moving',
|
||||
END: 'end',
|
||||
};
|
||||
(0, component_1.VantComponent)({
|
||||
mixins: [touch_1.touch],
|
||||
props: {
|
||||
@ -57,17 +62,17 @@ var utils_1 = require("../common/utils");
|
||||
else {
|
||||
this.startValue = this.format(this.newValue);
|
||||
}
|
||||
this.dragStatus = 'start';
|
||||
this.dragStatus = DRAG_STATUS.START;
|
||||
},
|
||||
onTouchMove: function (event) {
|
||||
var _this = this;
|
||||
if (this.data.disabled)
|
||||
return;
|
||||
if (this.dragStatus === 'start') {
|
||||
if (this.dragStatus === DRAG_STATUS.START) {
|
||||
this.$emit('drag-start');
|
||||
}
|
||||
this.touchMove(event);
|
||||
this.dragStatus = 'draging';
|
||||
this.dragStatus = DRAG_STATUS.MOVING;
|
||||
(0, utils_1.getRect)(this, '.van-slider').then(function (rect) {
|
||||
var vertical = _this.data.vertical;
|
||||
var delta = vertical ? _this.deltaY : _this.deltaX;
|
||||
@ -84,11 +89,15 @@ var utils_1 = require("../common/utils");
|
||||
});
|
||||
},
|
||||
onTouchEnd: function () {
|
||||
var _this = this;
|
||||
if (this.data.disabled)
|
||||
return;
|
||||
if (this.dragStatus === 'draging') {
|
||||
this.updateValue(this.newValue, true);
|
||||
this.$emit('drag-end');
|
||||
if (this.dragStatus === DRAG_STATUS.MOVING) {
|
||||
this.dragStatus = DRAG_STATUS.END;
|
||||
(0, utils_1.nextTick)(function () {
|
||||
_this.updateValue(_this.newValue, true);
|
||||
_this.$emit('drag-end');
|
||||
});
|
||||
}
|
||||
},
|
||||
onClick: function (event) {
|
||||
@ -164,7 +173,7 @@ var utils_1 = require("../common/utils");
|
||||
getOffsetWidth: function (current, min) {
|
||||
var scope = this.getScope();
|
||||
// 避免最小值小于最小step时出现负数情况
|
||||
return "".concat(Math.max((current - min) * 100 / scope, 0), "%");
|
||||
return "".concat(Math.max(((current - min) * 100) / scope, 0), "%");
|
||||
},
|
||||
// 计算选中条的长度百分比
|
||||
calcMainAxis: function () {
|
||||
|
@ -109,7 +109,6 @@ function equal(value1, value2) {
|
||||
},
|
||||
onBlur: function (event) {
|
||||
var value = this.format(event.detail.value);
|
||||
this.emitChange(value);
|
||||
this.$emit('blur', __assign(__assign({}, event.detail), { value: value }));
|
||||
},
|
||||
// filter illegal characters
|
||||
|
@ -88,6 +88,7 @@ var relation_1 = require("../common/relation");
|
||||
skipTransition: true,
|
||||
scrollWithAnimation: false,
|
||||
lineOffsetLeft: 0,
|
||||
inited: false,
|
||||
},
|
||||
mounted: function () {
|
||||
var _this = this;
|
||||
@ -201,12 +202,13 @@ var relation_1 = require("../common/relation");
|
||||
.reduce(function (prev, curr) { return prev + curr.width; }, 0);
|
||||
lineOffsetLeft +=
|
||||
(rect.width - lineRect.width) / 2 + (ellipsis ? 0 : 8);
|
||||
_this.setData({ lineOffsetLeft: lineOffsetLeft });
|
||||
_this.setData({ lineOffsetLeft: lineOffsetLeft, inited: true });
|
||||
_this.swiping = true;
|
||||
if (skipTransition) {
|
||||
(0, utils_1.nextTick)(function () {
|
||||
// waiting transition end
|
||||
setTimeout(function () {
|
||||
_this.setData({ skipTransition: false });
|
||||
});
|
||||
}, _this.data.duration);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -20,7 +20,7 @@
|
||||
style="{{ color ? 'border-color: ' + color : '' }}"
|
||||
>
|
||||
<view class="{{ utils.bem('tabs__nav', [type, { complete: !ellipsis }]) }} nav-class" style="{{ computed.navStyle(color, type) }}">
|
||||
<view wx:if="{{ type === 'line' }}" class="van-tabs__line" style="{{ computed.lineStyle({ color, lineOffsetLeft, lineHeight, skipTransition, duration, lineWidth }) }}" />
|
||||
<view wx:if="{{ type === 'line' }}" class="van-tabs__line" style="{{ computed.lineStyle({ color, lineOffsetLeft, lineHeight, skipTransition, duration, lineWidth, inited }) }}" />
|
||||
<view
|
||||
wx:for="{{ tabs }}"
|
||||
wx:key="index"
|
||||
|
@ -60,6 +60,7 @@ function trackStyle(data) {
|
||||
function lineStyle(data) {
|
||||
return style({
|
||||
width: utils.addUnit(data.lineWidth),
|
||||
opacity: data.inited ? 1 : 0,
|
||||
transform: 'translateX(' + data.lineOffsetLeft + 'px)',
|
||||
'-webkit-transform': 'translateX(' + data.lineOffsetLeft + 'px)',
|
||||
'background-color': data.color,
|
||||
|
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-tabs{-webkit-tap-highlight-color:transparent;position:relative}.van-tabs__wrap{display:flex;overflow:hidden}.van-tabs__wrap--scrollable .van-tab{flex:0 0 22%}.van-tabs__wrap--scrollable .van-tab--complete{flex:1 0 auto!important;padding:0 12px}.van-tabs__wrap--scrollable .van-tabs__nav--complete{padding-left:8px;padding-right:8px}.van-tabs__scroll{background-color:var(--tabs-nav-background-color,#fff)}.van-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.van-tabs__scroll--card{border:1px solid var(--tabs-default-color,#ee0a24);border-radius:2px;box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.van-tabs__scroll::-webkit-scrollbar{display:none}.van-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.van-tabs__nav--card{box-sizing:border-box;height:var(--tabs-card-height,30px)}.van-tabs__nav--card .van-tab{border-right:1px solid var(--tabs-default-color,#ee0a24);color:var(--tabs-default-color,#ee0a24);line-height:calc(var(--tabs-card-height, 30px) - 2px)}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{background-color:var(--tabs-default-color,#ee0a24);color:#fff}.van-tabs__nav--card .van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tabs__line{background-color:var(--tabs-bottom-bar-color,#ee0a24);border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;position:absolute;z-index:1}.van-tabs__track{height:100%;position:relative;width:100%}.van-tabs__track--animated{display:flex;transition-property:left}.van-tabs__content{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:var(--tabs-line-height,44px)}.van-tabs--card .van-tabs__wrap{height:var(--tabs-card-height,30px)}.van-tab{box-sizing:border-box;color:var(--tab-text-color,#646566);cursor:pointer;flex:1;font-size:var(--tab-font-size,14px);line-height:var(--tabs-line-height,44px);min-width:0;padding:0 5px;position:relative;text-align:center}.van-tab--active{color:var(--tab-active-text-color,#323233);font-weight:var(--font-weight-bold,500)}.van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tab__title__info{display:inline-block;position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
||||
@import '../common/index.wxss';.van-tabs{-webkit-tap-highlight-color:transparent;position:relative}.van-tabs__wrap{display:flex;overflow:hidden}.van-tabs__wrap--scrollable .van-tab{flex:0 0 22%}.van-tabs__wrap--scrollable .van-tab--complete{flex:1 0 auto!important;padding:0 12px}.van-tabs__wrap--scrollable .van-tabs__nav--complete{padding-left:8px;padding-right:8px}.van-tabs__scroll{background-color:var(--tabs-nav-background-color,#fff)}.van-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.van-tabs__scroll--card{border:1px solid var(--tabs-default-color,#ee0a24);border-radius:2px;box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.van-tabs__scroll::-webkit-scrollbar{display:none}.van-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.van-tabs__nav--card{box-sizing:border-box;height:var(--tabs-card-height,30px)}.van-tabs__nav--card .van-tab{border-right:1px solid var(--tabs-default-color,#ee0a24);color:var(--tabs-default-color,#ee0a24);line-height:calc(var(--tabs-card-height, 30px) - 2px)}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{background-color:var(--tabs-default-color,#ee0a24);color:#fff}.van-tabs__nav--card .van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tabs__line{background-color:var(--tabs-bottom-bar-color,#ee0a24);border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.van-tabs__track{height:100%;position:relative;width:100%}.van-tabs__track--animated{display:flex;transition-property:left}.van-tabs__content{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:var(--tabs-line-height,44px)}.van-tabs--card .van-tabs__wrap{height:var(--tabs-card-height,30px)}.van-tab{box-sizing:border-box;color:var(--tab-text-color,#646566);cursor:pointer;flex:1;font-size:var(--tab-font-size,14px);line-height:var(--tabs-line-height,44px);min-width:0;padding:0 5px;position:relative;text-align:center}.van-tab--active{color:var(--tab-active-text-color,#323233);font-weight:var(--font-weight-bold,500)}.van-tab--disabled{color:var(--tab-disabled-text-color,#c8c9cc)}.van-tab__title__info{display:inline-block;position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
@ -16,7 +16,7 @@ var utils_1 = require("./utils");
|
||||
var shared_1 = require("./shared");
|
||||
var validator_1 = require("../common/validator");
|
||||
(0, component_1.VantComponent)({
|
||||
props: __assign(__assign({ disabled: Boolean, multiple: Boolean, uploadText: String, useBeforeRead: Boolean, afterRead: null, beforeRead: null, previewSize: {
|
||||
props: __assign(__assign(__assign({ disabled: Boolean, multiple: Boolean, uploadText: String, useBeforeRead: Boolean, afterRead: null, beforeRead: null, previewSize: {
|
||||
type: null,
|
||||
value: 80,
|
||||
}, name: {
|
||||
@ -53,7 +53,7 @@ var validator_1 = require("../common/validator");
|
||||
}, uploadIcon: {
|
||||
type: String,
|
||||
value: 'photograph',
|
||||
} }, shared_1.chooseImageProps), shared_1.chooseVideoProps),
|
||||
} }, shared_1.chooseImageProps), shared_1.chooseVideoProps), shared_1.chooseMediaProps),
|
||||
data: {
|
||||
lists: [],
|
||||
isInCount: true,
|
||||
|
18
lib/uploader/shared.d.ts
vendored
18
lib/uploader/shared.d.ts
vendored
@ -26,3 +26,21 @@ export declare const chooseVideoProps: {
|
||||
value: string;
|
||||
};
|
||||
};
|
||||
export declare const chooseMediaProps: {
|
||||
capture: {
|
||||
type: ArrayConstructor;
|
||||
value: string[];
|
||||
};
|
||||
mediaType: {
|
||||
type: ArrayConstructor;
|
||||
value: string[];
|
||||
};
|
||||
maxDuration: {
|
||||
type: NumberConstructor;
|
||||
value: number;
|
||||
};
|
||||
camera: {
|
||||
type: StringConstructor;
|
||||
value: string;
|
||||
};
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.chooseVideoProps = exports.chooseImageProps = void 0;
|
||||
exports.chooseMediaProps = exports.chooseVideoProps = exports.chooseImageProps = void 0;
|
||||
// props for choose image
|
||||
exports.chooseImageProps = {
|
||||
sizeType: {
|
||||
@ -31,3 +31,22 @@ exports.chooseVideoProps = {
|
||||
value: 'back',
|
||||
},
|
||||
};
|
||||
// props for choose media
|
||||
exports.chooseMediaProps = {
|
||||
capture: {
|
||||
type: Array,
|
||||
value: ['album', 'camera'],
|
||||
},
|
||||
mediaType: {
|
||||
type: Array,
|
||||
value: ['image', 'video'],
|
||||
},
|
||||
maxDuration: {
|
||||
type: Number,
|
||||
value: 60,
|
||||
},
|
||||
camera: {
|
||||
type: String,
|
||||
value: 'back',
|
||||
},
|
||||
};
|
||||
|
3
lib/uploader/utils.d.ts
vendored
3
lib/uploader/utils.d.ts
vendored
@ -10,7 +10,7 @@ export interface File {
|
||||
}
|
||||
export declare function isImageFile(item: File): boolean;
|
||||
export declare function isVideoFile(item: File): boolean;
|
||||
export declare function chooseFile({ accept, multiple, capture, compressed, maxDuration, sizeType, camera, maxCount, }: {
|
||||
export declare function chooseFile({ accept, multiple, capture, compressed, maxDuration, sizeType, camera, maxCount, mediaType, }: {
|
||||
accept: any;
|
||||
multiple: any;
|
||||
capture: any;
|
||||
@ -19,4 +19,5 @@ export declare function chooseFile({ accept, multiple, capture, compressed, maxD
|
||||
sizeType: any;
|
||||
camera: any;
|
||||
maxCount: any;
|
||||
mediaType: any;
|
||||
}): Promise<File | File[]>;
|
||||
|
@ -55,7 +55,7 @@ function formatFile(res) {
|
||||
return res.tempFiles.map(function (item) { return (__assign(__assign({}, (0, utils_1.pickExclude)(item, ['path'])), { url: item.path })); });
|
||||
}
|
||||
function chooseFile(_a) {
|
||||
var accept = _a.accept, multiple = _a.multiple, capture = _a.capture, compressed = _a.compressed, maxDuration = _a.maxDuration, sizeType = _a.sizeType, camera = _a.camera, maxCount = _a.maxCount;
|
||||
var accept = _a.accept, multiple = _a.multiple, capture = _a.capture, compressed = _a.compressed, maxDuration = _a.maxDuration, sizeType = _a.sizeType, camera = _a.camera, maxCount = _a.maxCount, mediaType = _a.mediaType;
|
||||
return new Promise(function (resolve, reject) {
|
||||
switch (accept) {
|
||||
case 'image':
|
||||
@ -70,6 +70,7 @@ function chooseFile(_a) {
|
||||
case 'media':
|
||||
wx.chooseMedia({
|
||||
count: multiple ? Math.min(maxCount, 9) : 1,
|
||||
mediaType: mediaType,
|
||||
sourceType: capture,
|
||||
maxDuration: maxDuration,
|
||||
sizeType: sizeType,
|
||||
|
Loading…
x
Reference in New Issue
Block a user