vant 4.6.8 → 4.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/es/address-edit/AddressEdit.d.ts +2 -1
- package/es/address-edit/AddressEdit.mjs +9 -3
- package/es/address-edit/index.d.ts +2 -1
- package/es/calendar/Calendar.d.ts +2 -1
- package/es/calendar/Calendar.mjs +3 -2
- package/es/calendar/CalendarDay.d.ts +2 -1
- package/es/calendar/CalendarDay.mjs +3 -1
- package/es/calendar/CalendarMonth.d.ts +2 -1
- package/es/calendar/CalendarMonth.mjs +3 -2
- package/es/calendar/index.d.ts +2 -1
- package/es/cell-group/CellGroup.mjs +2 -1
- package/es/composables/use-scope-id.d.ts +3 -0
- package/es/composables/use-scope-id.mjs +9 -0
- package/es/dialog/function-call.d.ts +18 -3
- package/es/dialog/function-call.mjs +1 -1
- package/es/floating-panel/FloatingPanel.mjs +3 -3
- package/es/floating-panel/index.css +1 -1
- package/es/icon/index.css +1 -1
- package/es/image-preview/function-call.d.ts +3 -0
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/notify/function-call.d.ts +12 -0
- package/es/popover/Popover.mjs +2 -1
- package/es/popup/Popup.mjs +7 -5
- package/es/signature/Signature.mjs +10 -6
- package/es/swipe/Swipe.mjs +1 -1
- package/es/swipe/index.css +1 -1
- package/es/swipe-cell/SwipeCell.mjs +10 -1
- package/es/toast/function-call.d.ts +26 -0
- package/es/uploader/index.css +1 -1
- package/es/utils/interceptor.d.ts +2 -1
- package/es/utils/interceptor.mjs +3 -2
- package/lib/address-edit/AddressEdit.d.ts +2 -1
- package/lib/address-edit/AddressEdit.js +9 -3
- package/lib/address-edit/index.d.ts +2 -1
- package/lib/calendar/Calendar.d.ts +2 -1
- package/lib/calendar/Calendar.js +3 -2
- package/lib/calendar/CalendarDay.d.ts +2 -1
- package/lib/calendar/CalendarDay.js +3 -1
- package/lib/calendar/CalendarMonth.d.ts +2 -1
- package/lib/calendar/CalendarMonth.js +3 -2
- package/lib/calendar/index.d.ts +2 -1
- package/lib/cell-group/CellGroup.js +2 -1
- package/lib/composables/use-scope-id.d.ts +3 -0
- package/lib/composables/use-scope-id.js +28 -0
- package/lib/dialog/function-call.d.ts +18 -3
- package/lib/dialog/function-call.js +1 -1
- package/lib/floating-panel/FloatingPanel.js +3 -3
- package/lib/floating-panel/index.css +1 -1
- package/lib/icon/index.css +1 -1
- package/lib/image-preview/function-call.d.ts +3 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/notify/function-call.d.ts +12 -0
- package/lib/popover/Popover.js +2 -1
- package/lib/popup/Popup.js +6 -4
- package/lib/signature/Signature.js +10 -6
- package/lib/swipe/Swipe.js +1 -1
- package/lib/swipe/index.css +1 -1
- package/lib/swipe-cell/SwipeCell.js +10 -1
- package/lib/toast/function-call.d.ts +26 -0
- package/lib/uploader/index.css +1 -1
- package/lib/utils/interceptor.d.ts +2 -1
- package/lib/utils/interceptor.js +3 -2
- package/lib/vant.cjs.js +59 -29
- package/lib/vant.es.js +59 -29
- package/lib/vant.js +59 -29
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +4 -4
package/es/popover/Popover.mjs
CHANGED
@@ -3,6 +3,7 @@ import { ref, watch, nextTick, onMounted, watchEffect, onBeforeUnmount, defineCo
|
|
3
3
|
import { createPopper, offsetModifier } from "@vant/popperjs";
|
4
4
|
import { pick, extend, inBrowser, truthProp, numericProp, unknownProp, BORDER_RIGHT, BORDER_BOTTOM, makeArrayProp, makeStringProp, createNamespace } from "../utils/index.mjs";
|
5
5
|
import { useClickAway } from "@vant/use";
|
6
|
+
import { useScopeId } from "../composables/use-scope-id.mjs";
|
6
7
|
import { useSyncPropRef } from "../composables/use-sync-prop-ref.mjs";
|
7
8
|
import { Icon } from "../icon/index.mjs";
|
8
9
|
import { Popup } from "../popup/index.mjs";
|
@@ -180,7 +181,7 @@ var stdin_default = defineComponent({
|
|
180
181
|
"transition": "van-popover-zoom",
|
181
182
|
"lockScroll": false,
|
182
183
|
"onUpdate:show": updateShow
|
183
|
-
}, attrs, pick(props, popupProps)), {
|
184
|
+
}, attrs, useScopeId(), pick(props, popupProps)), {
|
184
185
|
default: () => [props.showArrow && _createVNode("div", {
|
185
186
|
"class": bem("arrow")
|
186
187
|
}, null), _createVNode("div", {
|
package/es/popup/Popup.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Fragment as _Fragment, withDirectives as _withDirectives,
|
1
|
+
import { Fragment as _Fragment, withDirectives as _withDirectives, vShow as _vShow, createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
2
2
|
import { ref, watch, provide, Teleport, nextTick, computed, onMounted, Transition, onActivated, onDeactivated, defineComponent } from "vue";
|
3
3
|
import { popupSharedProps } from "./shared.mjs";
|
4
4
|
import { isDef, extend, makeStringProp, callInterceptor, createNamespace, HAPTICS_FEEDBACK } from "../utils/index.mjs";
|
@@ -8,6 +8,7 @@ import { useLockScroll } from "../composables/use-lock-scroll.mjs";
|
|
8
8
|
import { useLazyRender } from "../composables/use-lazy-render.mjs";
|
9
9
|
import { POPUP_TOGGLE_KEY } from "../composables/on-popup-reopen.mjs";
|
10
10
|
import { useGlobalZIndex } from "../composables/use-global-z-index.mjs";
|
11
|
+
import { useScopeId } from "../composables/use-scope-id.mjs";
|
11
12
|
import { Icon } from "../icon/index.mjs";
|
12
13
|
import { Overlay } from "../overlay/index.mjs";
|
13
14
|
const popupProps = extend({}, popupSharedProps, {
|
@@ -74,16 +75,17 @@ var stdin_default = defineComponent({
|
|
74
75
|
};
|
75
76
|
const renderOverlay = () => {
|
76
77
|
if (props.overlay) {
|
77
|
-
return _createVNode(Overlay, {
|
78
|
+
return _createVNode(Overlay, _mergeProps({
|
78
79
|
"show": props.show,
|
79
80
|
"class": props.overlayClass,
|
80
81
|
"zIndex": zIndex.value,
|
81
82
|
"duration": props.duration,
|
82
83
|
"customStyle": props.overlayStyle,
|
83
84
|
"role": props.closeOnClickOverlay ? "button" : void 0,
|
84
|
-
"tabindex": props.closeOnClickOverlay ? 0 : void 0
|
85
|
+
"tabindex": props.closeOnClickOverlay ? 0 : void 0
|
86
|
+
}, useScopeId(), {
|
85
87
|
"onClick": onClickOverlay
|
86
|
-
}, {
|
88
|
+
}), {
|
87
89
|
default: slots["overlay-content"]
|
88
90
|
});
|
89
91
|
}
|
@@ -135,7 +137,7 @@ var stdin_default = defineComponent({
|
|
135
137
|
"van-safe-area-bottom": safeAreaInsetBottom
|
136
138
|
}],
|
137
139
|
"onKeydown": onKeydown
|
138
|
-
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[_vShow, props.show]]);
|
140
|
+
}, attrs, useScopeId()), [(_a = slots.default) == null ? void 0 : _a.call(slots), renderCloseIcon()]), [[_vShow, props.show]]);
|
139
141
|
});
|
140
142
|
const renderTransition = () => {
|
141
143
|
const {
|
@@ -68,12 +68,16 @@ var stdin_default = defineComponent({
|
|
68
68
|
const empty = document.createElement("canvas");
|
69
69
|
empty.width = canvas.width;
|
70
70
|
empty.height = canvas.height;
|
71
|
+
if (props.backgroundColor) {
|
72
|
+
const emptyCtx = empty.getContext("2d");
|
73
|
+
setCanvasBgColor(emptyCtx);
|
74
|
+
}
|
71
75
|
return canvas.toDataURL() === empty.toDataURL();
|
72
76
|
};
|
73
|
-
const setCanvasBgColor = () => {
|
74
|
-
if (
|
75
|
-
|
76
|
-
|
77
|
+
const setCanvasBgColor = (ctx) => {
|
78
|
+
if (ctx && props.backgroundColor) {
|
79
|
+
ctx.fillStyle = props.backgroundColor;
|
80
|
+
ctx.fillRect(0, 0, state.width, state.height);
|
77
81
|
}
|
78
82
|
};
|
79
83
|
const submit = () => {
|
@@ -96,7 +100,7 @@ var stdin_default = defineComponent({
|
|
96
100
|
if (state.ctx) {
|
97
101
|
state.ctx.clearRect(0, 0, state.width, state.height);
|
98
102
|
state.ctx.closePath();
|
99
|
-
setCanvasBgColor();
|
103
|
+
setCanvasBgColor(state.ctx);
|
100
104
|
}
|
101
105
|
emit("clear");
|
102
106
|
};
|
@@ -107,7 +111,7 @@ var stdin_default = defineComponent({
|
|
107
111
|
state.width = (((_b = wrapRef.value) == null ? void 0 : _b.offsetWidth) || 0) * state.ratio;
|
108
112
|
state.height = (((_c = wrapRef.value) == null ? void 0 : _c.offsetHeight) || 0) * state.ratio;
|
109
113
|
nextTick(() => {
|
110
|
-
setCanvasBgColor();
|
114
|
+
setCanvasBgColor(state.ctx);
|
111
115
|
});
|
112
116
|
}
|
113
117
|
});
|
package/es/swipe/Swipe.mjs
CHANGED
@@ -65,7 +65,7 @@ var stdin_default = defineComponent({
|
|
65
65
|
const trackStyle = computed(() => {
|
66
66
|
const style = {
|
67
67
|
transitionDuration: `${state.swiping ? 0 : props.duration}ms`,
|
68
|
-
transform: `translate${props.vertical ? "Y" : "X"}(${state.offset}px)`
|
68
|
+
transform: `translate${props.vertical ? "Y" : "X"}(${+state.offset.toFixed(2)}px)`
|
69
69
|
};
|
70
70
|
if (size.value) {
|
71
71
|
const mainAxis = props.vertical ? "height" : "width";
|
package/es/swipe/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:root{--van-swipe-indicator-size: 6px;--van-swipe-indicator-margin: var(--van-padding-sm);--van-swipe-indicator-active-opacity: 1;--van-swipe-indicator-inactive-opacity: .3;--van-swipe-indicator-active-background: var(--van-primary-color);--van-swipe-indicator-inactive-background: var(--van-border-color)}.van-swipe{position:relative;overflow:hidden;transform:translateZ(0);cursor:-webkit-grab;cursor:grab;-webkit-user-select:none;user-select:none}.van-swipe__track{display:flex;height:100
|
1
|
+
:root{--van-swipe-indicator-size: 6px;--van-swipe-indicator-margin: var(--van-padding-sm);--van-swipe-indicator-active-opacity: 1;--van-swipe-indicator-inactive-opacity: .3;--van-swipe-indicator-active-background: var(--van-primary-color);--van-swipe-indicator-inactive-background: var(--van-border-color)}.van-swipe{position:relative;overflow:hidden;transform:translateZ(0);cursor:-webkit-grab;cursor:grab;-webkit-user-select:none;user-select:none}.van-swipe__track{display:flex;height:100%;transition-property:transform}.van-swipe__track--vertical{flex-direction:column}.van-swipe__indicators{position:absolute;bottom:var(--van-swipe-indicator-margin);left:50%;display:flex;transform:translate(-50%)}.van-swipe__indicators--vertical{top:50%;bottom:auto;left:var(--van-swipe-indicator-margin);flex-direction:column;transform:translateY(-50%)}.van-swipe__indicators--vertical .van-swipe__indicator:not(:last-child){margin-bottom:var(--van-swipe-indicator-size)}.van-swipe__indicator{width:var(--van-swipe-indicator-size);height:var(--van-swipe-indicator-size);background-color:var(--van-swipe-indicator-inactive-background);border-radius:100%;opacity:var(--van-swipe-indicator-inactive-opacity);transition:opacity var(--van-duration-fast),background-color var(--van-duration-fast)}.van-swipe__indicator:not(:last-child){margin-right:var(--van-swipe-indicator-size)}.van-swipe__indicator--active{background-color:var(--van-swipe-indicator-active-background);opacity:var(--van-swipe-indicator-active-opacity)}
|
@@ -24,6 +24,7 @@ var stdin_default = defineComponent({
|
|
24
24
|
let opened;
|
25
25
|
let lockClick;
|
26
26
|
let startOffset;
|
27
|
+
let isInBeforeClosing;
|
27
28
|
const root = ref();
|
28
29
|
const leftRef = ref();
|
29
30
|
const rightRef = ref();
|
@@ -100,14 +101,22 @@ var stdin_default = defineComponent({
|
|
100
101
|
}
|
101
102
|
};
|
102
103
|
const onClick = (position = "outside") => {
|
104
|
+
if (isInBeforeClosing)
|
105
|
+
return;
|
103
106
|
emit("click", position);
|
104
107
|
if (opened && !lockClick) {
|
108
|
+
isInBeforeClosing = true;
|
105
109
|
callInterceptor(props.beforeClose, {
|
106
110
|
args: [{
|
107
111
|
name: props.name,
|
108
112
|
position
|
109
113
|
}],
|
110
|
-
done: () =>
|
114
|
+
done: () => {
|
115
|
+
isInBeforeClosing = false;
|
116
|
+
close(position);
|
117
|
+
},
|
118
|
+
canceled: () => isInBeforeClosing = false,
|
119
|
+
error: () => isInBeforeClosing = false
|
111
120
|
});
|
112
121
|
}
|
113
122
|
};
|
@@ -1,10 +1,36 @@
|
|
1
1
|
import type { ToastType, ToastOptions, ToastWrapperInstance } from './types';
|
2
|
+
/**
|
3
|
+
* Display a text toast
|
4
|
+
*/
|
2
5
|
export declare function showToast(options?: string | ToastOptions): ToastWrapperInstance;
|
6
|
+
/**
|
7
|
+
* Display a loading toast
|
8
|
+
*/
|
3
9
|
export declare const showLoadingToast: (options: string | ToastOptions) => ToastWrapperInstance;
|
10
|
+
/**
|
11
|
+
* Display a success toast
|
12
|
+
*/
|
4
13
|
export declare const showSuccessToast: (options: string | ToastOptions) => ToastWrapperInstance;
|
14
|
+
/**
|
15
|
+
* Display a fail toast
|
16
|
+
*/
|
5
17
|
export declare const showFailToast: (options: string | ToastOptions) => ToastWrapperInstance;
|
18
|
+
/**
|
19
|
+
* Close the currently displayed toast
|
20
|
+
*/
|
6
21
|
export declare const closeToast: (all?: boolean) => void;
|
22
|
+
/**
|
23
|
+
* Modify the default configuration that affects all `showToast` calls.
|
24
|
+
* Specify the `type` parameter to modify the default configuration of a specific type of toast
|
25
|
+
*/
|
7
26
|
export declare function setToastDefaultOptions(options: ToastOptions): void;
|
8
27
|
export declare function setToastDefaultOptions(type: ToastType, options: ToastOptions): void;
|
28
|
+
/**
|
29
|
+
* Reset the default configuration that affects all `showToast` calls.
|
30
|
+
* Specify the `type` parameter to reset the default configuration of a specific type of toast
|
31
|
+
*/
|
9
32
|
export declare const resetToastDefaultOptions: (type?: ToastType) => void;
|
33
|
+
/**
|
34
|
+
* Allow multiple toasts to be displayed as the same time
|
35
|
+
*/
|
10
36
|
export declare const allowMultipleToast: (value?: boolean) => void;
|
package/es/uploader/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:root{--van-uploader-size: 80px;--van-uploader-icon-size: 24px;--van-uploader-icon-color: var(--van-gray-4);--van-uploader-text-color: var(--van-text-color-2);--van-uploader-text-font-size: var(--van-font-size-sm);--van-uploader-upload-background: var(--van-gray-1);--van-uploader-upload-active-color: var(--van-active-color);--van-uploader-delete-color: var(--van-white);--van-uploader-delete-icon-size: 14px;--van-uploader-delete-background: rgba(0, 0, 0, .7);--van-uploader-file-background: var(--van-background);--van-uploader-file-icon-size: 20px;--van-uploader-file-icon-color: var(--van-gray-7);--van-uploader-file-name-padding: 0 var(--van-padding-base);--van-uploader-file-name-margin-top: var(--van-padding-xs);--van-uploader-file-name-font-size: var(--van-font-size-sm);--van-uploader-file-name-text-color: var(--van-gray-7);--van-uploader-mask-text-color: var(--van-white);--van-uploader-mask-background: rgba(50, 50, 51, .88);--van-uploader-mask-icon-size: 22px;--van-uploader-mask-message-font-size: var(--van-font-size-sm);--van-uploader-mask-message-line-height: var(--van-line-height-xs);--van-uploader-loading-icon-size: 22px;--van-uploader-loading-icon-color: var(--van-white);--van-uploader-disabled-opacity: var(--van-disabled-opacity)}.van-uploader{position:relative;display:inline-block}.van-uploader__wrapper{display:flex;flex-wrap:wrap}.van-uploader__wrapper--disabled{opacity:var(--van-uploader-disabled-opacity)}.van-uploader__input{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;cursor:pointer;opacity:0}.van-uploader__input-wrapper{position:relative}.van-uploader__input:disabled{cursor:not-allowed}.van-uploader__upload{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;width:var(--van-uploader-size);height:var(--van-uploader-size);margin:0 var(--van-padding-xs) var(--van-padding-xs) 0;background:var(--van-uploader-upload-background)}.van-uploader__upload:active{background-color:var(--van-uploader-upload-active-color)}.van-uploader__upload--readonly:active{background-color:var(--van-uploader-upload-background)}.van-uploader__upload-icon{color:var(--van-uploader-icon-color);font-size:var(--van-uploader-icon-size)}.van-uploader__upload-text{margin-top:var(--van-padding-xs);color:var(--van-uploader-text-color);font-size:var(--van-uploader-text-font-size)}.van-uploader__preview{position:relative;margin:0 var(--van-padding-xs) var(--van-padding-xs) 0;cursor:pointer}.van-uploader__preview-image{display:block;width:var(--van-uploader-size);height:var(--van-uploader-size);overflow:hidden}.van-uploader__preview-delete{position:absolute;top:0;right:0}.van-uploader__preview-delete--shadow{width:var(--van-uploader-delete-icon-size);height:var(--van-uploader-delete-icon-size);background:var(--van-uploader-delete-background);border-radius:0 0 0 12px}.van-uploader__preview-delete-icon{position:absolute;top:0;right:0;color:var(--van-uploader-delete-color);font-size:var(--van-uploader-delete-icon-size);transform:scale(.7) translate(10%,-10%)}.van-uploader__preview-cover{position:absolute;top:0;right:0;bottom:0;left:0}.van-uploader__mask{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--van-uploader-mask-text-color);background:var(--van-uploader-mask-background)}.van-uploader__mask-icon{font-size:var(--van-uploader-mask-icon-size)}.van-uploader__mask-message{margin-top:6px;padding:0 var(--van-padding-base);font-size:var(--van-uploader-mask-message-font-size);line-height:var(--van-uploader-mask-message-line-height)}.van-uploader__loading{width:var(--van-uploader-loading-icon-size);height:var(--van-uploader-loading-icon-size);color:var(--van-uploader-loading-icon-color)}.van-uploader__file{display:flex;flex-direction:column;align-items:center;justify-content:center;width:var(--van-uploader-size);height:var(--van-uploader-size);background:var(--van-uploader-file-background)}.van-uploader__file-icon{color:var(--van-uploader-file-icon-color);font-size:var(--van-uploader-file-icon-size)}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:var(--van-uploader-file-name-margin-top);padding:var(--van-uploader-file-name-padding);color:var(--van-uploader-file-name-text-color);font-size:var(--van-uploader-file-name-font-size);text-align:center}
|
1
|
+
:root{--van-uploader-size: 80px;--van-uploader-icon-size: 24px;--van-uploader-icon-color: var(--van-gray-4);--van-uploader-text-color: var(--van-text-color-2);--van-uploader-text-font-size: var(--van-font-size-sm);--van-uploader-upload-background: var(--van-gray-1);--van-uploader-upload-active-color: var(--van-active-color);--van-uploader-delete-color: var(--van-white);--van-uploader-delete-icon-size: 14px;--van-uploader-delete-background: rgba(0, 0, 0, .7);--van-uploader-file-background: var(--van-background);--van-uploader-file-icon-size: 20px;--van-uploader-file-icon-color: var(--van-gray-7);--van-uploader-file-name-padding: 0 var(--van-padding-base);--van-uploader-file-name-margin-top: var(--van-padding-xs);--van-uploader-file-name-font-size: var(--van-font-size-sm);--van-uploader-file-name-text-color: var(--van-gray-7);--van-uploader-mask-text-color: var(--van-white);--van-uploader-mask-background: rgba(50, 50, 51, .88);--van-uploader-mask-icon-size: 22px;--van-uploader-mask-message-font-size: var(--van-font-size-sm);--van-uploader-mask-message-line-height: var(--van-line-height-xs);--van-uploader-loading-icon-size: 22px;--van-uploader-loading-icon-color: var(--van-white);--van-uploader-disabled-opacity: var(--van-disabled-opacity);--van-uploader-border-radius: 0px}.van-uploader{position:relative;display:inline-block}.van-uploader__wrapper{display:flex;flex-wrap:wrap}.van-uploader__wrapper--disabled{opacity:var(--van-uploader-disabled-opacity)}.van-uploader__input{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;cursor:pointer;opacity:0}.van-uploader__input-wrapper{position:relative}.van-uploader__input:disabled{cursor:not-allowed}.van-uploader__upload{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;width:var(--van-uploader-size);height:var(--van-uploader-size);margin:0 var(--van-padding-xs) var(--van-padding-xs) 0;background:var(--van-uploader-upload-background);border-radius:var(--van-uploader-border-radius)}.van-uploader__upload:active{background-color:var(--van-uploader-upload-active-color)}.van-uploader__upload--readonly:active{background-color:var(--van-uploader-upload-background)}.van-uploader__upload-icon{color:var(--van-uploader-icon-color);font-size:var(--van-uploader-icon-size)}.van-uploader__upload-text{margin-top:var(--van-padding-xs);color:var(--van-uploader-text-color);font-size:var(--van-uploader-text-font-size)}.van-uploader__preview{position:relative;margin:0 var(--van-padding-xs) var(--van-padding-xs) 0;cursor:pointer}.van-uploader__preview-image{display:block;width:var(--van-uploader-size);height:var(--van-uploader-size);overflow:hidden;border-radius:var(--van-uploader-border-radius)}.van-uploader__preview-delete{position:absolute;top:0;right:0}.van-uploader__preview-delete--shadow{width:var(--van-uploader-delete-icon-size);height:var(--van-uploader-delete-icon-size);background:var(--van-uploader-delete-background);border-radius:0 0 0 12px}.van-uploader__preview-delete-icon{position:absolute;top:0;right:0;color:var(--van-uploader-delete-color);font-size:var(--van-uploader-delete-icon-size);transform:scale(.7) translate(10%,-10%)}.van-uploader__preview-cover{position:absolute;top:0;right:0;bottom:0;left:0}.van-uploader__mask{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--van-uploader-mask-text-color);background:var(--van-uploader-mask-background);border-radius:var(--van-uploader-border-radius)}.van-uploader__mask-icon{font-size:var(--van-uploader-mask-icon-size)}.van-uploader__mask-message{margin-top:6px;padding:0 var(--van-padding-base);font-size:var(--van-uploader-mask-message-font-size);line-height:var(--van-uploader-mask-message-line-height)}.van-uploader__loading{width:var(--van-uploader-loading-icon-size);height:var(--van-uploader-loading-icon-size);color:var(--van-uploader-loading-icon-color)}.van-uploader__file{display:flex;flex-direction:column;align-items:center;justify-content:center;width:var(--van-uploader-size);height:var(--van-uploader-size);background:var(--van-uploader-file-background)}.van-uploader__file-icon{color:var(--van-uploader-file-icon-color);font-size:var(--van-uploader-file-icon-size)}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:var(--van-uploader-file-name-margin-top);padding:var(--van-uploader-file-name-padding);color:var(--van-uploader-file-name-text-color);font-size:var(--van-uploader-file-name-font-size);text-align:center}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
export type Interceptor = (...args: any[]) => Promise<boolean> | boolean | undefined | void;
|
2
|
-
export declare function callInterceptor(interceptor: Interceptor | undefined, { args, done, canceled, }: {
|
2
|
+
export declare function callInterceptor(interceptor: Interceptor | undefined, { args, done, canceled, error, }: {
|
3
3
|
args?: unknown[];
|
4
4
|
done: () => void;
|
5
5
|
canceled?: () => void;
|
6
|
+
error?: () => void;
|
6
7
|
}): void;
|
package/es/utils/interceptor.mjs
CHANGED
@@ -2,7 +2,8 @@ import { noop, isPromise } from "./basic.mjs";
|
|
2
2
|
function callInterceptor(interceptor, {
|
3
3
|
args = [],
|
4
4
|
done,
|
5
|
-
canceled
|
5
|
+
canceled,
|
6
|
+
error
|
6
7
|
}) {
|
7
8
|
if (interceptor) {
|
8
9
|
const returnVal = interceptor.apply(null, args);
|
@@ -13,7 +14,7 @@ function callInterceptor(interceptor, {
|
|
13
14
|
} else if (canceled) {
|
14
15
|
canceled();
|
15
16
|
}
|
16
|
-
}).catch(noop);
|
17
|
+
}).catch(error || noop);
|
17
18
|
} else if (returnVal) {
|
18
19
|
done();
|
19
20
|
} else if (canceled) {
|
@@ -88,7 +88,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
88
88
|
type: PropType<(val: string) => boolean>;
|
89
89
|
default: typeof isMobile;
|
90
90
|
};
|
91
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "selectSearch" | "save" | "delete" | "clickArea" | "changeArea" | "changeDetail" | "changeDefault")[], "focus" | "selectSearch" | "save" | "delete" | "clickArea" | "changeArea" | "changeDetail" | "changeDefault", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
91
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "change" | "selectSearch" | "save" | "delete" | "clickArea" | "changeArea" | "changeDetail" | "changeDefault")[], "focus" | "change" | "selectSearch" | "save" | "delete" | "clickArea" | "changeArea" | "changeDetail" | "changeDefault", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
92
92
|
areaList: PropType<AreaList>;
|
93
93
|
isSaving: BooleanConstructor;
|
94
94
|
isDeleting: BooleanConstructor;
|
@@ -132,6 +132,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
132
132
|
};
|
133
133
|
}>> & {
|
134
134
|
onFocus?: ((...args: any[]) => any) | undefined;
|
135
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
135
136
|
onSelectSearch?: ((...args: any[]) => any) | undefined;
|
136
137
|
onSave?: ((...args: any[]) => any) | undefined;
|
137
138
|
onDelete?: ((...args: any[]) => any) | undefined;
|
@@ -88,7 +88,7 @@ const addressEditProps = {
|
|
88
88
|
var stdin_default = (0, import_vue2.defineComponent)({
|
89
89
|
name,
|
90
90
|
props: addressEditProps,
|
91
|
-
emits: ["save", "focus", "delete", "clickArea", "changeArea", "changeDetail", "selectSearch", "changeDefault"],
|
91
|
+
emits: ["save", "focus", "change", "delete", "clickArea", "changeArea", "changeDetail", "selectSearch", "changeDefault"],
|
92
92
|
setup(props, {
|
93
93
|
emit,
|
94
94
|
slots
|
@@ -122,6 +122,12 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
122
122
|
detailFocused.value = key === "addressDetail";
|
123
123
|
emit("focus", key);
|
124
124
|
};
|
125
|
+
const onChange = (key, value) => {
|
126
|
+
emit("change", {
|
127
|
+
key,
|
128
|
+
value
|
129
|
+
});
|
130
|
+
};
|
125
131
|
const rules = (0, import_vue2.computed)(() => {
|
126
132
|
const {
|
127
133
|
validator,
|
@@ -233,7 +239,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
233
239
|
"class": bem("fields")
|
234
240
|
}, [(0, import_vue.createVNode)(import_field.Field, {
|
235
241
|
"modelValue": data.name,
|
236
|
-
"onUpdate:modelValue": ($event) => data.name = $event,
|
242
|
+
"onUpdate:modelValue": [($event) => data.name = $event, (val) => onChange("name", val)],
|
237
243
|
"clearable": true,
|
238
244
|
"label": t("name"),
|
239
245
|
"rules": rules.value.name,
|
@@ -241,7 +247,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
241
247
|
"onFocus": () => onFocus("name")
|
242
248
|
}, null), (0, import_vue.createVNode)(import_field.Field, {
|
243
249
|
"modelValue": data.tel,
|
244
|
-
"onUpdate:modelValue": ($event) => data.tel = $event,
|
250
|
+
"onUpdate:modelValue": [($event) => data.tel = $event, (val) => onChange("tel", val)],
|
245
251
|
"clearable": true,
|
246
252
|
"type": "tel",
|
247
253
|
"label": t("tel"),
|
@@ -41,7 +41,7 @@ export declare const AddressEdit: import("../utils").WithInstall<import("vue").D
|
|
41
41
|
type: import("vue").PropType<(val: string) => boolean>;
|
42
42
|
default: typeof import("../utils").isMobile;
|
43
43
|
};
|
44
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "selectSearch" | "save" | "delete" | "clickArea" | "changeArea" | "changeDetail" | "changeDefault")[], "focus" | "selectSearch" | "save" | "delete" | "clickArea" | "changeArea" | "changeDetail" | "changeDefault", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
44
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "change" | "selectSearch" | "save" | "delete" | "clickArea" | "changeArea" | "changeDetail" | "changeDefault")[], "focus" | "change" | "selectSearch" | "save" | "delete" | "clickArea" | "changeArea" | "changeDetail" | "changeDefault", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
45
45
|
areaList: import("vue").PropType<import("..").AreaList>;
|
46
46
|
isSaving: BooleanConstructor;
|
47
47
|
isDeleting: BooleanConstructor;
|
@@ -85,6 +85,7 @@ export declare const AddressEdit: import("../utils").WithInstall<import("vue").D
|
|
85
85
|
};
|
86
86
|
}>> & {
|
87
87
|
onFocus?: ((...args: any[]) => any) | undefined;
|
88
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
88
89
|
onSelectSearch?: ((...args: any[]) => any) | undefined;
|
89
90
|
onSave?: ((...args: any[]) => any) | undefined;
|
90
91
|
onDelete?: ((...args: any[]) => any) | undefined;
|
@@ -173,7 +173,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
173
173
|
default: number;
|
174
174
|
validator: (val: number) => boolean;
|
175
175
|
};
|
176
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:show" | "confirm" | "clickSubtitle" | "unselect" | "monthShow" | "overRange")[], "select" | "update:show" | "confirm" | "clickSubtitle" | "unselect" | "monthShow" | "overRange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
176
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:show" | "confirm" | "clickDisabledDate" | "clickSubtitle" | "unselect" | "monthShow" | "overRange")[], "select" | "update:show" | "confirm" | "clickDisabledDate" | "clickSubtitle" | "unselect" | "monthShow" | "overRange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
177
177
|
show: BooleanConstructor;
|
178
178
|
type: {
|
179
179
|
type: PropType<CalendarType>;
|
@@ -262,6 +262,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
262
262
|
onSelect?: ((...args: any[]) => any) | undefined;
|
263
263
|
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
264
264
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
265
|
+
onClickDisabledDate?: ((...args: any[]) => any) | undefined;
|
265
266
|
onClickSubtitle?: ((...args: any[]) => any) | undefined;
|
266
267
|
onUnselect?: ((...args: any[]) => any) | undefined;
|
267
268
|
onMonthShow?: ((...args: any[]) => any) | undefined;
|
package/lib/calendar/Calendar.js
CHANGED
@@ -93,7 +93,7 @@ const calendarProps = {
|
|
93
93
|
var stdin_default = (0, import_vue2.defineComponent)({
|
94
94
|
name: import_utils2.name,
|
95
95
|
props: calendarProps,
|
96
|
-
emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle"],
|
96
|
+
emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle", "clickDisabledDate"],
|
97
97
|
setup(props, {
|
98
98
|
emit,
|
99
99
|
slots
|
@@ -361,7 +361,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
361
361
|
"showMonthTitle": showMonthTitle,
|
362
362
|
"firstDayOfWeek": dayOffset.value
|
363
363
|
}, (0, import_utils.pick)(props, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
|
364
|
-
"onClick": onClickDay
|
364
|
+
"onClick": onClickDay,
|
365
|
+
"onClickDisabledDate": (item) => emit("clickDisabledDate", item)
|
365
366
|
}), (0, import_utils.pick)(slots, ["top-info", "bottom-info", "month-title"]));
|
366
367
|
};
|
367
368
|
const renderFooterButton = () => {
|
@@ -12,7 +12,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
12
12
|
default: number;
|
13
13
|
};
|
14
14
|
rowHeight: StringConstructor;
|
15
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
15
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "clickDisabledDate")[], "click" | "clickDisabledDate", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
16
16
|
item: {
|
17
17
|
type: PropType<CalendarDayItem>;
|
18
18
|
required: true;
|
@@ -26,6 +26,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
26
26
|
rowHeight: StringConstructor;
|
27
27
|
}>> & {
|
28
28
|
onClick?: ((...args: any[]) => any) | undefined;
|
29
|
+
onClickDisabledDate?: ((...args: any[]) => any) | undefined;
|
29
30
|
}, {
|
30
31
|
offset: number;
|
31
32
|
}, {}>;
|
@@ -34,7 +34,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
34
34
|
offset: (0, import_utils.makeNumberProp)(0),
|
35
35
|
rowHeight: String
|
36
36
|
},
|
37
|
-
emits: ["click"],
|
37
|
+
emits: ["click", "clickDisabledDate"],
|
38
38
|
setup(props, {
|
39
39
|
emit,
|
40
40
|
slots
|
@@ -80,6 +80,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
80
80
|
const onClick = () => {
|
81
81
|
if (props.item.type !== "disabled") {
|
82
82
|
emit("click", props.item);
|
83
|
+
} else {
|
84
|
+
emit("clickDisabledDate", props.item);
|
83
85
|
}
|
84
86
|
};
|
85
87
|
const renderTopInfo = () => {
|
@@ -50,7 +50,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
50
50
|
showSubtitle: BooleanConstructor;
|
51
51
|
showMonthTitle: BooleanConstructor;
|
52
52
|
firstDayOfWeek: NumberConstructor;
|
53
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
53
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "clickDisabledDate")[], "click" | "clickDisabledDate", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
54
54
|
date: {
|
55
55
|
type: DateConstructor;
|
56
56
|
required: true;
|
@@ -76,6 +76,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
76
76
|
firstDayOfWeek: NumberConstructor;
|
77
77
|
}>> & {
|
78
78
|
onClick?: ((...args: any[]) => any) | undefined;
|
79
|
+
onClickDisabledDate?: ((...args: any[]) => any) | undefined;
|
79
80
|
}, {
|
80
81
|
lazyRender: boolean;
|
81
82
|
showMark: boolean;
|
@@ -59,7 +59,7 @@ const calendarMonthProps = {
|
|
59
59
|
var stdin_default = (0, import_vue2.defineComponent)({
|
60
60
|
name,
|
61
61
|
props: calendarMonthProps,
|
62
|
-
emits: ["click"],
|
62
|
+
emits: ["click", "clickDisabledDate"],
|
63
63
|
setup(props, {
|
64
64
|
emit,
|
65
65
|
slots
|
@@ -218,7 +218,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
218
218
|
"color": props.color,
|
219
219
|
"offset": offset.value,
|
220
220
|
"rowHeight": rowHeight.value,
|
221
|
-
"onClick": (item2) => emit("click", item2)
|
221
|
+
"onClick": (item2) => emit("click", item2),
|
222
|
+
"onClickDisabledDate": (item2) => emit("clickDisabledDate", item2)
|
222
223
|
}, (0, import_utils.pick)(slots, ["top-info", "bottom-info"]));
|
223
224
|
const renderDays = () => (0, import_vue.createVNode)("div", {
|
224
225
|
"ref": daysRef,
|
package/lib/calendar/index.d.ts
CHANGED
@@ -83,7 +83,7 @@ export declare const Calendar: import("../utils").WithInstall<import("vue").Defi
|
|
83
83
|
default: number;
|
84
84
|
validator: (val: number) => boolean;
|
85
85
|
};
|
86
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:show" | "confirm" | "clickSubtitle" | "unselect" | "monthShow" | "overRange")[], "select" | "update:show" | "confirm" | "clickSubtitle" | "unselect" | "monthShow" | "overRange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
86
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "update:show" | "confirm" | "clickDisabledDate" | "clickSubtitle" | "unselect" | "monthShow" | "overRange")[], "select" | "update:show" | "confirm" | "clickDisabledDate" | "clickSubtitle" | "unselect" | "monthShow" | "overRange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
87
87
|
show: BooleanConstructor;
|
88
88
|
type: {
|
89
89
|
type: import("vue").PropType<import("./types").CalendarType>;
|
@@ -172,6 +172,7 @@ export declare const Calendar: import("../utils").WithInstall<import("vue").Defi
|
|
172
172
|
onSelect?: ((...args: any[]) => any) | undefined;
|
173
173
|
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
174
174
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
175
|
+
onClickDisabledDate?: ((...args: any[]) => any) | undefined;
|
175
176
|
onClickSubtitle?: ((...args: any[]) => any) | undefined;
|
176
177
|
onUnselect?: ((...args: any[]) => any) | undefined;
|
177
178
|
onMonthShow?: ((...args: any[]) => any) | undefined;
|
@@ -24,6 +24,7 @@ module.exports = __toCommonJS(stdin_exports);
|
|
24
24
|
var import_vue = require("vue");
|
25
25
|
var import_vue2 = require("vue");
|
26
26
|
var import_utils = require("../utils");
|
27
|
+
var import_use_scope_id = require("../composables/use-scope-id");
|
27
28
|
const [name, bem] = (0, import_utils.createNamespace)("cell-group");
|
28
29
|
const cellGroupProps = {
|
29
30
|
title: String,
|
@@ -46,7 +47,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
46
47
|
}), {
|
47
48
|
[import_utils.BORDER_TOP_BOTTOM]: props.border && !props.inset
|
48
49
|
}]
|
49
|
-
}, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
50
|
+
}, attrs, (0, import_use_scope_id.useScopeId)()), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
50
51
|
};
|
51
52
|
const renderTitle = () => (0, import_vue.createVNode)("div", {
|
52
53
|
"class": bem("title", {
|
@@ -0,0 +1,28 @@
|
|
1
|
+
var __defProp = Object.defineProperty;
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
+
var __export = (target, all) => {
|
6
|
+
for (var name in all)
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
8
|
+
};
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
11
|
+
for (let key of __getOwnPropNames(from))
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
14
|
+
}
|
15
|
+
return to;
|
16
|
+
};
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
18
|
+
var stdin_exports = {};
|
19
|
+
__export(stdin_exports, {
|
20
|
+
useScopeId: () => useScopeId
|
21
|
+
});
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
23
|
+
var import_vue = require("vue");
|
24
|
+
const useScopeId = () => {
|
25
|
+
var _a;
|
26
|
+
const { scopeId } = ((_a = (0, import_vue.getCurrentInstance)()) == null ? void 0 : _a.vnode) || {};
|
27
|
+
return scopeId ? { [scopeId]: "" } : null;
|
28
|
+
};
|
@@ -1,6 +1,21 @@
|
|
1
|
-
import type { DialogOptions } from './types';
|
2
|
-
|
1
|
+
import type { DialogAction, DialogOptions } from './types';
|
2
|
+
/**
|
3
|
+
* Display a message prompt dialog with a default confirm button
|
4
|
+
*/
|
5
|
+
export declare function showDialog(options: DialogOptions): Promise<DialogAction | undefined>;
|
6
|
+
/**
|
7
|
+
* Modify the default configuration that affects all `showDialog` calls
|
8
|
+
*/
|
3
9
|
export declare const setDialogDefaultOptions: (options: DialogOptions) => void;
|
10
|
+
/**
|
11
|
+
* Reset the default configuration that affects all `showDialog` calls
|
12
|
+
*/
|
4
13
|
export declare const resetDialogDefaultOptions: () => void;
|
5
|
-
|
14
|
+
/**
|
15
|
+
* Display a message confirmation dialog with default confirm and cancel buttons
|
16
|
+
*/
|
17
|
+
export declare const showConfirmDialog: (options: DialogOptions) => Promise<DialogAction | undefined>;
|
18
|
+
/**
|
19
|
+
* Close the currently displayed dialog
|
20
|
+
*/
|
6
21
|
export declare const closeDialog: () => void;
|
@@ -31,7 +31,7 @@ var import_use_sync_prop_ref = require("../composables/use-sync-prop-ref");
|
|
31
31
|
const floatingPanelProps = {
|
32
32
|
height: (0, import_utils.makeNumericProp)(0),
|
33
33
|
anchors: (0, import_utils.makeArrayProp)(),
|
34
|
-
duration: (0, import_utils.makeNumericProp)(0.
|
34
|
+
duration: (0, import_utils.makeNumericProp)(0.3),
|
35
35
|
contentDraggable: import_utils.truthProp,
|
36
36
|
lockScroll: Boolean,
|
37
37
|
safeAreaInsetBottom: import_utils.truthProp
|
@@ -61,7 +61,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
61
61
|
const rootStyle = (0, import_vue2.computed)(() => ({
|
62
62
|
height: (0, import_utils.addUnit)(boundary.value.max),
|
63
63
|
transform: `translateY(calc(100% + ${(0, import_utils.addUnit)(-height.value)}))`,
|
64
|
-
transition: !dragging.value ? `transform ${props.duration}s` : "none"
|
64
|
+
transition: !dragging.value ? `transform ${props.duration}s cubic-bezier(0.18, 0.89, 0.32, 1.28)` : "none"
|
65
65
|
}));
|
66
66
|
const ease = (moveY) => {
|
67
67
|
const absDistance = Math.abs(moveY);
|
@@ -121,7 +121,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
121
121
|
}, {
|
122
122
|
immediate: true
|
123
123
|
});
|
124
|
-
(0, import_use_lock_scroll.useLockScroll)(rootRef, () => props.lockScroll);
|
124
|
+
(0, import_use_lock_scroll.useLockScroll)(rootRef, () => props.lockScroll || dragging.value);
|
125
125
|
(0, import_use.useEventListener)("touchmove", onTouchmove, {
|
126
126
|
target: rootRef
|
127
127
|
});
|
@@ -1 +1 @@
|
|
1
|
-
:root{--van-floating-panel-border-radius: 16px;--van-floating-panel-header-height: 30px;--van-floating-panel-z-index: 999;--van-floating-panel-background: var(--van-background-2);--van-floating-panel-bar-width: 20px;--van-floating-panel-bar-height: 3px;--van-floating-panel-bar-color: var(--van-gray-5)}.van-floating-panel{position:fixed;left:0;bottom:0;width:100vw;z-index:var(--van-floating-panel-z-index);display:flex;flex-direction:column;touch-action:none;border-top-left-radius:var(--van-floating-panel-border-radius);border-top-right-radius:var(--van-floating-panel-border-radius);background:var(--van-floating-panel-background)}.van-floating-panel:after{content:"";display:block;position:absolute;bottom:-100vh;height:100vh;width:100vw;background-color:inherit}.van-floating-panel__header{height:var(--van-floating-panel-header-height);display:flex;justify-content:center;align-items:center;cursor:-webkit-grab;cursor:grab;-webkit-user-select:none;user-select:none}.van-floating-panel__header-bar{height:var(--van-floating-panel-bar-height);width:var(--van-floating-panel-bar-width);border-radius:var(--van-radius-md);background:var(--van-floating-panel-bar-color)}.van-floating-panel__content{flex:1;overflow-y:auto;background-color:var(--van-floating-panel-background)}
|
1
|
+
:root{--van-floating-panel-border-radius: 16px;--van-floating-panel-header-height: 30px;--van-floating-panel-z-index: 999;--van-floating-panel-background: var(--van-background-2);--van-floating-panel-bar-width: 20px;--van-floating-panel-bar-height: 3px;--van-floating-panel-bar-color: var(--van-gray-5)}.van-floating-panel{position:fixed;left:0;bottom:0;width:100vw;z-index:var(--van-floating-panel-z-index);display:flex;flex-direction:column;touch-action:none;border-top-left-radius:var(--van-floating-panel-border-radius);border-top-right-radius:var(--van-floating-panel-border-radius);background:var(--van-floating-panel-background);will-change:transform}.van-floating-panel:after{content:"";display:block;position:absolute;bottom:-100vh;height:100vh;width:100vw;background-color:inherit}.van-floating-panel__header{height:var(--van-floating-panel-header-height);display:flex;justify-content:center;align-items:center;cursor:-webkit-grab;cursor:grab;-webkit-user-select:none;user-select:none}.van-floating-panel__header-bar{height:var(--van-floating-panel-bar-height);width:var(--van-floating-panel-bar-width);border-radius:var(--van-radius-md);background:var(--van-floating-panel-bar-color)}.van-floating-panel__content{flex:1;overflow-y:auto;background-color:var(--van-floating-panel-background)}
|