diff --git a/dist/calendar/calendar.wxml b/dist/calendar/calendar.wxml index 808f739e..2ba6f303 100644 --- a/dist/calendar/calendar.wxml +++ b/dist/calendar/calendar.wxml @@ -54,12 +54,12 @@ type="danger" color="{{ color }}" custom-class="van-calendar__confirm" - disabled="{{ computed.getButtonDisabled(type, currentDate) }}" + disabled="{{ computed.getButtonDisabled(type, currentDate, minRange) }}" nativeType="text" bind:click="onConfirm" > {{ - computed.getButtonDisabled(type, currentDate) + computed.getButtonDisabled(type, currentDate, minRange) ? confirmDisabledText : confirmText }} diff --git a/dist/calendar/index.js b/dist/calendar/index.js index 3b41265c..0c529eff 100644 --- a/dist/calendar/index.js +++ b/dist/calendar/index.js @@ -103,6 +103,10 @@ VantComponent({ type: null, value: null, }, + minRange: { + type: Number, + value: 1, + }, firstDayOfWeek: { type: Number, value: 0, diff --git a/dist/calendar/index.wxs b/dist/calendar/index.wxs index 2c04be10..0a56646e 100644 --- a/dist/calendar/index.wxs +++ b/dist/calendar/index.wxs @@ -15,7 +15,7 @@ function getMonths(minDate, maxDate) { return months; } -function getButtonDisabled(type, currentDate) { +function getButtonDisabled(type, currentDate, minRange) { if (currentDate == null) { return true; } @@ -25,7 +25,7 @@ function getButtonDisabled(type, currentDate) { } if (type === 'multiple') { - return !currentDate.length; + return currentDate.length < minRange; } return !currentDate; diff --git a/dist/cascader/index.js b/dist/cascader/index.js index a7eeec17..486928a1 100644 --- a/dist/cascader/index.js +++ b/dist/cascader/index.js @@ -157,6 +157,9 @@ VantComponent({ onClickTab(e) { const { index: tabIndex, title } = e.detail; this.$emit('click-tab', { title, tabIndex }); + this.setData({ + activeTab: tabIndex, + }); }, // 选中 onSelect(e) { diff --git a/dist/circle/canvas.d.ts b/dist/circle/canvas.d.ts index 15268c9f..8a0b71e8 100644 --- a/dist/circle/canvas.d.ts +++ b/dist/circle/canvas.d.ts @@ -1,4 +1,4 @@ /// -declare type CanvasContext = WechatMiniprogram.CanvasContext; +type CanvasContext = WechatMiniprogram.CanvasContext; export declare function adaptor(ctx: CanvasContext & Record): CanvasContext; export {}; diff --git a/dist/common/relation.d.ts b/dist/common/relation.d.ts index 4b5af008..10193fa1 100644 --- a/dist/common/relation.d.ts +++ b/dist/common/relation.d.ts @@ -1,5 +1,5 @@ /// -declare type TrivialInstance = WechatMiniprogram.Component.TrivialInstance; +type TrivialInstance = WechatMiniprogram.Component.TrivialInstance; export declare function useParent(name: string, onEffect?: (this: TrivialInstance) => void): { relations: { [x: string]: WechatMiniprogram.Component.RelationOption; diff --git a/dist/count-down/utils.d.ts b/dist/count-down/utils.d.ts index e4a58ddf..876a6c14 100644 --- a/dist/count-down/utils.d.ts +++ b/dist/count-down/utils.d.ts @@ -1,4 +1,4 @@ -export declare type TimeData = { +export type TimeData = { days: number; hours: number; minutes: number; diff --git a/dist/definitions/index.d.ts b/dist/definitions/index.d.ts index c4c98f9c..d0554f62 100644 --- a/dist/definitions/index.d.ts +++ b/dist/definitions/index.d.ts @@ -5,7 +5,7 @@ interface VantComponentInstance { index: number; $emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void; } -export declare type VantComponentOptions = { +export type VantComponentOptions = { data?: Data; field?: boolean; classes?: string[]; diff --git a/dist/dialog/dialog.d.ts b/dist/dialog/dialog.d.ts index 17708107..db2da5ff 100644 --- a/dist/dialog/dialog.d.ts +++ b/dist/dialog/dialog.d.ts @@ -1,7 +1,7 @@ /// /// -export declare type Action = 'confirm' | 'cancel' | 'overlay'; -declare type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance; +export type Action = 'confirm' | 'cancel' | 'overlay'; +type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance; interface DialogOptions { lang?: string; show?: boolean; diff --git a/dist/mixins/page-scroll.d.ts b/dist/mixins/page-scroll.d.ts index 9fab3e2a..46254479 100644 --- a/dist/mixins/page-scroll.d.ts +++ b/dist/mixins/page-scroll.d.ts @@ -1,6 +1,6 @@ /// /// -declare type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption; -declare type Scroller = (this: WechatMiniprogram.Component.TrivialInstance, event?: IPageScrollOption) => void; +type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption; +type Scroller = (this: WechatMiniprogram.Component.TrivialInstance, event?: IPageScrollOption) => void; export declare function pageScrollMixin(scroller: Scroller): string; export {}; diff --git a/dist/popup/index.js b/dist/popup/index.js index 9c5ef868..29b51b15 100644 --- a/dist/popup/index.js +++ b/dist/popup/index.js @@ -53,6 +53,10 @@ VantComponent({ type: Boolean, value: false, }, + safeAreaTabBar: { + type: Boolean, + value: false, + }, lockScroll: { type: Boolean, value: true, diff --git a/dist/popup/index.wxml b/dist/popup/index.wxml index ea7d696b..fad03082 100644 --- a/dist/popup/index.wxml +++ b/dist/popup/index.wxml @@ -12,7 +12,7 @@ /> diff --git a/dist/popup/index.wxss b/dist/popup/index.wxss index a840541a..260adbc0 100644 --- a/dist/popup/index.wxss +++ b/dist/popup/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-popup{-webkit-overflow-scrolling:touch;animation:ease both;background-color:var(--popup-background-color,#fff);box-sizing:border-box;max-height:100%;overflow-y:auto;position:fixed;transition-timing-function:ease}.van-popup--center{left:50%;top:50%;transform:translate3d(-50%,-50%,0)}.van-popup--center.van-popup--round{border-radius:var(--popup-round-border-radius,16px)}.van-popup--top{left:0;top:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--right{right:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0}.van-popup--left{left:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0}.van-popup--bottom.van-popup--safe{padding-bottom:env(safe-area-inset-bottom)}.van-popup--safeTop{padding-top:env(safe-area-inset-top)}.van-popup__close-icon{color:var(--popup-close-icon-color,#969799);font-size:var(--popup-close-icon-size,18px);position:absolute;z-index:var(--popup-close-icon-z-index,1)}.van-popup__close-icon--top-left{left:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--top-right{right:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-left{bottom:var(--popup-close-icon-margin,16px);left:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-right{bottom:var(--popup-close-icon-margin,16px);right:var(--popup-close-icon-margin,16px)}.van-popup__close-icon:active{opacity:.6}.van-scale-enter-active,.van-scale-leave-active{transition-property:opacity,transform}.van-scale-enter,.van-scale-leave-to{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-fade-enter-active,.van-fade-leave-active{transition-property:opacity}.van-fade-enter,.van-fade-leave-to{opacity:0}.van-center-enter-active,.van-center-leave-active{transition-property:opacity}.van-center-enter,.van-center-leave-to{opacity:0}.van-bottom-enter-active,.van-bottom-leave-active,.van-left-enter-active,.van-left-leave-active,.van-right-enter-active,.van-right-leave-active,.van-top-enter-active,.van-top-leave-active{transition-property:transform}.van-bottom-enter,.van-bottom-leave-to{transform:translate3d(0,100%,0)}.van-top-enter,.van-top-leave-to{transform:translate3d(0,-100%,0)}.van-left-enter,.van-left-leave-to{transform:translate3d(-100%,-50%,0)}.van-right-enter,.van-right-leave-to{transform:translate3d(100%,-50%,0)} \ No newline at end of file +@import '../common/index.wxss';.van-popup{-webkit-overflow-scrolling:touch;animation:ease both;background-color:var(--popup-background-color,#fff);box-sizing:border-box;max-height:100%;overflow-y:auto;position:fixed;transition-timing-function:ease}.van-popup--center{left:50%;top:50%;transform:translate3d(-50%,-50%,0)}.van-popup--center.van-popup--round{border-radius:var(--popup-round-border-radius,16px)}.van-popup--top{left:0;top:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--right{right:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0}.van-popup--left{left:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0}.van-popup--bottom.van-popup--safe{padding-bottom:env(safe-area-inset-bottom)}.van-popup--bottom.van-popup--safeTabBar{bottom:var(--tabbar-height,50px)}.van-popup--safeTop{padding-top:env(safe-area-inset-top)}.van-popup__close-icon{color:var(--popup-close-icon-color,#969799);font-size:var(--popup-close-icon-size,18px);position:absolute;z-index:var(--popup-close-icon-z-index,1)}.van-popup__close-icon--top-left{left:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--top-right{right:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-left{bottom:var(--popup-close-icon-margin,16px);left:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-right{bottom:var(--popup-close-icon-margin,16px);right:var(--popup-close-icon-margin,16px)}.van-popup__close-icon:active{opacity:.6}.van-scale-enter-active,.van-scale-leave-active{transition-property:opacity,transform}.van-scale-enter,.van-scale-leave-to{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-fade-enter-active,.van-fade-leave-active{transition-property:opacity}.van-fade-enter,.van-fade-leave-to{opacity:0}.van-center-enter-active,.van-center-leave-active{transition-property:opacity}.van-center-enter,.van-center-leave-to{opacity:0}.van-bottom-enter-active,.van-bottom-leave-active,.van-left-enter-active,.van-left-leave-active,.van-right-enter-active,.van-right-leave-active,.van-top-enter-active,.van-top-leave-active{transition-property:transform}.van-bottom-enter,.van-bottom-leave-to{transform:translate3d(0,100%,0)}.van-top-enter,.van-top-leave-to{transform:translate3d(0,-100%,0)}.van-left-enter,.van-left-leave-to{transform:translate3d(-100%,-50%,0)}.van-right-enter,.van-right-leave-to{transform:translate3d(100%,-50%,0)} \ No newline at end of file diff --git a/dist/stepper/index.js b/dist/stepper/index.js index 5af81a93..ff19615a 100644 --- a/dist/stepper/index.js +++ b/dist/stepper/index.js @@ -99,6 +99,7 @@ VantComponent({ onBlur(event) { const value = this.format(event.detail.value); this.setData({ currentValue: value }); + this.emitChange(value); this.$emit('blur', Object.assign(Object.assign({}, event.detail), { value })); }, // filter illegal characters diff --git a/dist/stepper/index.wxml b/dist/stepper/index.wxml index 6a58fd24..6dd44bcf 100644 --- a/dist/stepper/index.wxml +++ b/dist/stepper/index.wxml @@ -16,7 +16,6 @@ /// -declare type ToastMessage = string | number; -declare type ToastContext = WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance; +type ToastMessage = string | number; +type ToastContext = WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance; interface ToastOptions { show?: boolean; type?: string; diff --git a/dist/uploader/index.js b/dist/uploader/index.js index 84cf5e96..007bc38a 100644 --- a/dist/uploader/index.js +++ b/dist/uploader/index.js @@ -1,6 +1,6 @@ import { VantComponent } from '../common/component'; import { isImageFile, chooseFile, isVideoFile } from './utils'; -import { chooseImageProps, chooseVideoProps, chooseMediaProps, chooseMessageFileProps, } from './shared'; +import { imageProps, videoProps, mediaProps, messageFileProps } from './shared'; import { isBoolean, isPromise } from '../common/validator'; VantComponent({ props: Object.assign(Object.assign(Object.assign(Object.assign({ disabled: Boolean, multiple: Boolean, uploadText: String, useBeforeRead: Boolean, afterRead: null, beforeRead: null, previewSize: { @@ -40,7 +40,7 @@ VantComponent({ }, uploadIcon: { type: String, value: 'photograph', - } }, chooseImageProps), chooseVideoProps), chooseMediaProps), chooseMessageFileProps), + } }, imageProps), videoProps), mediaProps), messageFileProps), data: { lists: [], isInCount: true, @@ -114,11 +114,12 @@ VantComponent({ if (!this.data.previewFullImage) return; const { index } = event.currentTarget.dataset; - const { lists } = this.data; + const { lists, showmenu } = this.data; const item = lists[index]; wx.previewImage({ urls: lists.filter((item) => isImageFile(item)).map((item) => item.url), current: item.url, + showmenu, fail() { wx.showToast({ title: '预览图片失败', icon: 'none' }); }, diff --git a/dist/uploader/shared.d.ts b/dist/uploader/shared.d.ts index 50913eb2..e0a0d7e3 100644 --- a/dist/uploader/shared.d.ts +++ b/dist/uploader/shared.d.ts @@ -1,4 +1,4 @@ -export declare const chooseImageProps: { +export declare const imageProps: { sizeType: { type: ArrayConstructor; value: string[]; @@ -7,8 +7,12 @@ export declare const chooseImageProps: { type: ArrayConstructor; value: string[]; }; + showmenu: { + type: BooleanConstructor; + value: boolean; + }; }; -export declare const chooseVideoProps: { +export declare const videoProps: { capture: { type: ArrayConstructor; value: string[]; @@ -26,7 +30,7 @@ export declare const chooseVideoProps: { value: string; }; }; -export declare const chooseMediaProps: { +export declare const mediaProps: { capture: { type: ArrayConstructor; value: string[]; @@ -44,6 +48,6 @@ export declare const chooseMediaProps: { value: string; }; }; -export declare const chooseMessageFileProps: { +export declare const messageFileProps: { extension: null; }; diff --git a/dist/uploader/shared.js b/dist/uploader/shared.js index 7866a6d1..3ac6f8a3 100644 --- a/dist/uploader/shared.js +++ b/dist/uploader/shared.js @@ -1,5 +1,5 @@ -// props for choose image -export const chooseImageProps = { +// props for image +export const imageProps = { sizeType: { type: Array, value: ['original', 'compressed'], @@ -8,9 +8,13 @@ export const chooseImageProps = { type: Array, value: ['album', 'camera'], }, + showmenu: { + type: Boolean, + value: true, + }, }; -// props for choose video -export const chooseVideoProps = { +// props for video +export const videoProps = { capture: { type: Array, value: ['album', 'camera'], @@ -28,8 +32,8 @@ export const chooseVideoProps = { value: 'back', }, }; -// props for choose media -export const chooseMediaProps = { +// props for media +export const mediaProps = { capture: { type: Array, value: ['album', 'camera'], @@ -47,7 +51,7 @@ export const chooseMediaProps = { value: 'back', }, }; -// props for choose file -export const chooseMessageFileProps = { +// props for file +export const messageFileProps = { extension: null, }; diff --git a/lib/calendar/calendar.wxml b/lib/calendar/calendar.wxml index 808f739e..2ba6f303 100644 --- a/lib/calendar/calendar.wxml +++ b/lib/calendar/calendar.wxml @@ -54,12 +54,12 @@ type="danger" color="{{ color }}" custom-class="van-calendar__confirm" - disabled="{{ computed.getButtonDisabled(type, currentDate) }}" + disabled="{{ computed.getButtonDisabled(type, currentDate, minRange) }}" nativeType="text" bind:click="onConfirm" > {{ - computed.getButtonDisabled(type, currentDate) + computed.getButtonDisabled(type, currentDate, minRange) ? confirmDisabledText : confirmText }} diff --git a/lib/calendar/index.js b/lib/calendar/index.js index 3baa5f0b..b5926774 100644 --- a/lib/calendar/index.js +++ b/lib/calendar/index.js @@ -119,6 +119,10 @@ var getTime = function (date) { type: null, value: null, }, + minRange: { + type: Number, + value: 1, + }, firstDayOfWeek: { type: Number, value: 0, diff --git a/lib/calendar/index.wxs b/lib/calendar/index.wxs index 2c04be10..0a56646e 100644 --- a/lib/calendar/index.wxs +++ b/lib/calendar/index.wxs @@ -15,7 +15,7 @@ function getMonths(minDate, maxDate) { return months; } -function getButtonDisabled(type, currentDate) { +function getButtonDisabled(type, currentDate, minRange) { if (currentDate == null) { return true; } @@ -25,7 +25,7 @@ function getButtonDisabled(type, currentDate) { } if (type === 'multiple') { - return !currentDate.length; + return currentDate.length < minRange; } return !currentDate; diff --git a/lib/cascader/index.js b/lib/cascader/index.js index a3662ba1..1eedfe95 100644 --- a/lib/cascader/index.js +++ b/lib/cascader/index.js @@ -171,6 +171,9 @@ var defaultFieldNames = { onClickTab: function (e) { var _a = e.detail, tabIndex = _a.index, title = _a.title; this.$emit('click-tab', { title: title, tabIndex: tabIndex }); + this.setData({ + activeTab: tabIndex, + }); }, // 选中 onSelect: function (e) { diff --git a/lib/circle/canvas.d.ts b/lib/circle/canvas.d.ts index 15268c9f..8a0b71e8 100644 --- a/lib/circle/canvas.d.ts +++ b/lib/circle/canvas.d.ts @@ -1,4 +1,4 @@ /// -declare type CanvasContext = WechatMiniprogram.CanvasContext; +type CanvasContext = WechatMiniprogram.CanvasContext; export declare function adaptor(ctx: CanvasContext & Record): CanvasContext; export {}; diff --git a/lib/common/relation.d.ts b/lib/common/relation.d.ts index 4b5af008..10193fa1 100644 --- a/lib/common/relation.d.ts +++ b/lib/common/relation.d.ts @@ -1,5 +1,5 @@ /// -declare type TrivialInstance = WechatMiniprogram.Component.TrivialInstance; +type TrivialInstance = WechatMiniprogram.Component.TrivialInstance; export declare function useParent(name: string, onEffect?: (this: TrivialInstance) => void): { relations: { [x: string]: WechatMiniprogram.Component.RelationOption; diff --git a/lib/count-down/utils.d.ts b/lib/count-down/utils.d.ts index e4a58ddf..876a6c14 100644 --- a/lib/count-down/utils.d.ts +++ b/lib/count-down/utils.d.ts @@ -1,4 +1,4 @@ -export declare type TimeData = { +export type TimeData = { days: number; hours: number; minutes: number; diff --git a/lib/definitions/index.d.ts b/lib/definitions/index.d.ts index c4c98f9c..d0554f62 100644 --- a/lib/definitions/index.d.ts +++ b/lib/definitions/index.d.ts @@ -5,7 +5,7 @@ interface VantComponentInstance { index: number; $emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void; } -export declare type VantComponentOptions = { +export type VantComponentOptions = { data?: Data; field?: boolean; classes?: string[]; diff --git a/lib/dialog/dialog.d.ts b/lib/dialog/dialog.d.ts index 17708107..db2da5ff 100644 --- a/lib/dialog/dialog.d.ts +++ b/lib/dialog/dialog.d.ts @@ -1,7 +1,7 @@ /// /// -export declare type Action = 'confirm' | 'cancel' | 'overlay'; -declare type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance; +export type Action = 'confirm' | 'cancel' | 'overlay'; +type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance; interface DialogOptions { lang?: string; show?: boolean; diff --git a/lib/mixins/page-scroll.d.ts b/lib/mixins/page-scroll.d.ts index 9fab3e2a..46254479 100644 --- a/lib/mixins/page-scroll.d.ts +++ b/lib/mixins/page-scroll.d.ts @@ -1,6 +1,6 @@ /// /// -declare type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption; -declare type Scroller = (this: WechatMiniprogram.Component.TrivialInstance, event?: IPageScrollOption) => void; +type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption; +type Scroller = (this: WechatMiniprogram.Component.TrivialInstance, event?: IPageScrollOption) => void; export declare function pageScrollMixin(scroller: Scroller): string; export {}; diff --git a/lib/popup/index.js b/lib/popup/index.js index 56367a45..9cbbad8e 100644 --- a/lib/popup/index.js +++ b/lib/popup/index.js @@ -55,6 +55,10 @@ var transition_1 = require("../mixins/transition"); type: Boolean, value: false, }, + safeAreaTabBar: { + type: Boolean, + value: false, + }, lockScroll: { type: Boolean, value: true, diff --git a/lib/popup/index.wxml b/lib/popup/index.wxml index ea7d696b..fad03082 100644 --- a/lib/popup/index.wxml +++ b/lib/popup/index.wxml @@ -12,7 +12,7 @@ /> diff --git a/lib/popup/index.wxss b/lib/popup/index.wxss index a840541a..260adbc0 100644 --- a/lib/popup/index.wxss +++ b/lib/popup/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-popup{-webkit-overflow-scrolling:touch;animation:ease both;background-color:var(--popup-background-color,#fff);box-sizing:border-box;max-height:100%;overflow-y:auto;position:fixed;transition-timing-function:ease}.van-popup--center{left:50%;top:50%;transform:translate3d(-50%,-50%,0)}.van-popup--center.van-popup--round{border-radius:var(--popup-round-border-radius,16px)}.van-popup--top{left:0;top:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--right{right:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0}.van-popup--left{left:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0}.van-popup--bottom.van-popup--safe{padding-bottom:env(safe-area-inset-bottom)}.van-popup--safeTop{padding-top:env(safe-area-inset-top)}.van-popup__close-icon{color:var(--popup-close-icon-color,#969799);font-size:var(--popup-close-icon-size,18px);position:absolute;z-index:var(--popup-close-icon-z-index,1)}.van-popup__close-icon--top-left{left:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--top-right{right:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-left{bottom:var(--popup-close-icon-margin,16px);left:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-right{bottom:var(--popup-close-icon-margin,16px);right:var(--popup-close-icon-margin,16px)}.van-popup__close-icon:active{opacity:.6}.van-scale-enter-active,.van-scale-leave-active{transition-property:opacity,transform}.van-scale-enter,.van-scale-leave-to{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-fade-enter-active,.van-fade-leave-active{transition-property:opacity}.van-fade-enter,.van-fade-leave-to{opacity:0}.van-center-enter-active,.van-center-leave-active{transition-property:opacity}.van-center-enter,.van-center-leave-to{opacity:0}.van-bottom-enter-active,.van-bottom-leave-active,.van-left-enter-active,.van-left-leave-active,.van-right-enter-active,.van-right-leave-active,.van-top-enter-active,.van-top-leave-active{transition-property:transform}.van-bottom-enter,.van-bottom-leave-to{transform:translate3d(0,100%,0)}.van-top-enter,.van-top-leave-to{transform:translate3d(0,-100%,0)}.van-left-enter,.van-left-leave-to{transform:translate3d(-100%,-50%,0)}.van-right-enter,.van-right-leave-to{transform:translate3d(100%,-50%,0)} \ No newline at end of file +@import '../common/index.wxss';.van-popup{-webkit-overflow-scrolling:touch;animation:ease both;background-color:var(--popup-background-color,#fff);box-sizing:border-box;max-height:100%;overflow-y:auto;position:fixed;transition-timing-function:ease}.van-popup--center{left:50%;top:50%;transform:translate3d(-50%,-50%,0)}.van-popup--center.van-popup--round{border-radius:var(--popup-round-border-radius,16px)}.van-popup--top{left:0;top:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--right{right:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0}.van-popup--left{left:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0}.van-popup--bottom.van-popup--safe{padding-bottom:env(safe-area-inset-bottom)}.van-popup--bottom.van-popup--safeTabBar{bottom:var(--tabbar-height,50px)}.van-popup--safeTop{padding-top:env(safe-area-inset-top)}.van-popup__close-icon{color:var(--popup-close-icon-color,#969799);font-size:var(--popup-close-icon-size,18px);position:absolute;z-index:var(--popup-close-icon-z-index,1)}.van-popup__close-icon--top-left{left:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--top-right{right:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-left{bottom:var(--popup-close-icon-margin,16px);left:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-right{bottom:var(--popup-close-icon-margin,16px);right:var(--popup-close-icon-margin,16px)}.van-popup__close-icon:active{opacity:.6}.van-scale-enter-active,.van-scale-leave-active{transition-property:opacity,transform}.van-scale-enter,.van-scale-leave-to{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-fade-enter-active,.van-fade-leave-active{transition-property:opacity}.van-fade-enter,.van-fade-leave-to{opacity:0}.van-center-enter-active,.van-center-leave-active{transition-property:opacity}.van-center-enter,.van-center-leave-to{opacity:0}.van-bottom-enter-active,.van-bottom-leave-active,.van-left-enter-active,.van-left-leave-active,.van-right-enter-active,.van-right-leave-active,.van-top-enter-active,.van-top-leave-active{transition-property:transform}.van-bottom-enter,.van-bottom-leave-to{transform:translate3d(0,100%,0)}.van-top-enter,.van-top-leave-to{transform:translate3d(0,-100%,0)}.van-left-enter,.van-left-leave-to{transform:translate3d(-100%,-50%,0)}.van-right-enter,.van-right-leave-to{transform:translate3d(100%,-50%,0)} \ No newline at end of file diff --git a/lib/stepper/index.js b/lib/stepper/index.js index d9694e22..6a84552c 100644 --- a/lib/stepper/index.js +++ b/lib/stepper/index.js @@ -112,6 +112,7 @@ function equal(value1, value2) { onBlur: function (event) { var value = this.format(event.detail.value); this.setData({ currentValue: value }); + this.emitChange(value); this.$emit('blur', __assign(__assign({}, event.detail), { value: value })); }, // filter illegal characters diff --git a/lib/stepper/index.wxml b/lib/stepper/index.wxml index 6a58fd24..6dd44bcf 100644 --- a/lib/stepper/index.wxml +++ b/lib/stepper/index.wxml @@ -16,7 +16,6 @@ /// -declare type ToastMessage = string | number; -declare type ToastContext = WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance; +type ToastMessage = string | number; +type ToastContext = WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance; interface ToastOptions { show?: boolean; type?: string; diff --git a/lib/uploader/index.js b/lib/uploader/index.js index 7eff33c3..69b40617 100644 --- a/lib/uploader/index.js +++ b/lib/uploader/index.js @@ -53,7 +53,7 @@ var validator_1 = require("../common/validator"); }, uploadIcon: { type: String, value: 'photograph', - } }, shared_1.chooseImageProps), shared_1.chooseVideoProps), shared_1.chooseMediaProps), shared_1.chooseMessageFileProps), + } }, shared_1.imageProps), shared_1.videoProps), shared_1.mediaProps), shared_1.messageFileProps), data: { lists: [], isInCount: true, @@ -129,11 +129,12 @@ var validator_1 = require("../common/validator"); if (!this.data.previewFullImage) return; var index = event.currentTarget.dataset.index; - var lists = this.data.lists; + var _a = this.data, lists = _a.lists, showmenu = _a.showmenu; var item = lists[index]; wx.previewImage({ urls: lists.filter(function (item) { return (0, utils_1.isImageFile)(item); }).map(function (item) { return item.url; }), current: item.url, + showmenu: showmenu, fail: function () { wx.showToast({ title: '预览图片失败', icon: 'none' }); }, diff --git a/lib/uploader/shared.d.ts b/lib/uploader/shared.d.ts index 50913eb2..e0a0d7e3 100644 --- a/lib/uploader/shared.d.ts +++ b/lib/uploader/shared.d.ts @@ -1,4 +1,4 @@ -export declare const chooseImageProps: { +export declare const imageProps: { sizeType: { type: ArrayConstructor; value: string[]; @@ -7,8 +7,12 @@ export declare const chooseImageProps: { type: ArrayConstructor; value: string[]; }; + showmenu: { + type: BooleanConstructor; + value: boolean; + }; }; -export declare const chooseVideoProps: { +export declare const videoProps: { capture: { type: ArrayConstructor; value: string[]; @@ -26,7 +30,7 @@ export declare const chooseVideoProps: { value: string; }; }; -export declare const chooseMediaProps: { +export declare const mediaProps: { capture: { type: ArrayConstructor; value: string[]; @@ -44,6 +48,6 @@ export declare const chooseMediaProps: { value: string; }; }; -export declare const chooseMessageFileProps: { +export declare const messageFileProps: { extension: null; }; diff --git a/lib/uploader/shared.js b/lib/uploader/shared.js index 5986ebea..4e077271 100644 --- a/lib/uploader/shared.js +++ b/lib/uploader/shared.js @@ -1,8 +1,8 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.chooseMessageFileProps = exports.chooseMediaProps = exports.chooseVideoProps = exports.chooseImageProps = void 0; -// props for choose image -exports.chooseImageProps = { +exports.messageFileProps = exports.mediaProps = exports.videoProps = exports.imageProps = void 0; +// props for image +exports.imageProps = { sizeType: { type: Array, value: ['original', 'compressed'], @@ -11,9 +11,13 @@ exports.chooseImageProps = { type: Array, value: ['album', 'camera'], }, + showmenu: { + type: Boolean, + value: true, + }, }; -// props for choose video -exports.chooseVideoProps = { +// props for video +exports.videoProps = { capture: { type: Array, value: ['album', 'camera'], @@ -31,8 +35,8 @@ exports.chooseVideoProps = { value: 'back', }, }; -// props for choose media -exports.chooseMediaProps = { +// props for media +exports.mediaProps = { capture: { type: Array, value: ['album', 'camera'], @@ -50,7 +54,7 @@ exports.chooseMediaProps = { value: 'back', }, }; -// props for choose file -exports.chooseMessageFileProps = { +// props for file +exports.messageFileProps = { extension: null, };