vant 4.9.19 → 4.9.21
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/es/action-sheet/ActionSheet.d.ts +3 -0
- package/es/action-sheet/index.d.ts +2 -0
- package/es/barrage/Barrage.mjs +1 -1
- package/es/checkbox/Checker.mjs +1 -1
- package/es/composables/use-tab-status.d.ts +3 -0
- package/es/composables/use-tab-status.mjs +16 -1
- package/es/dialog/Dialog.d.ts +3 -0
- package/es/dialog/index.d.ts +2 -0
- package/es/dropdown-item/DropdownItem.mjs +3 -0
- package/es/dropdown-menu/DropdownMenu.mjs +3 -1
- package/es/dropdown-menu/types.d.ts +2 -0
- package/es/floating-bubble/FloatingBubble.d.ts +3 -22
- package/es/floating-bubble/FloatingBubble.mjs +3 -9
- package/es/floating-bubble/index.d.ts +2 -15
- package/es/image/Image.d.ts +3 -0
- package/es/image/Image.mjs +3 -1
- package/es/image/index.d.ts +2 -0
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/list/List.mjs +2 -2
- package/es/notify/Notify.d.ts +3 -0
- package/es/notify/index.d.ts +2 -0
- package/es/picker/Picker.mjs +6 -2
- package/es/popup/Popup.d.ts +3 -0
- package/es/popup/Popup.mjs +10 -9
- package/es/popup/index.d.ts +2 -0
- package/es/popup/shared.d.ts +2 -0
- package/es/popup/shared.mjs +2 -0
- package/es/progress/Progress.mjs +6 -3
- package/es/share-sheet/ShareSheet.d.ts +3 -0
- package/es/share-sheet/index.d.ts +2 -0
- package/es/tab/Tab.mjs +3 -3
- package/es/tab/index.d.ts +1 -0
- package/es/tab/index.mjs +4 -1
- package/es/watermark/Watermark.mjs +5 -2
- package/lib/action-sheet/ActionSheet.d.ts +3 -0
- package/lib/action-sheet/index.d.ts +2 -0
- package/lib/barrage/Barrage.js +1 -1
- package/lib/checkbox/Checker.js +1 -1
- package/lib/composables/use-tab-status.d.ts +3 -0
- package/lib/composables/use-tab-status.js +15 -0
- package/lib/dialog/Dialog.d.ts +3 -0
- package/lib/dialog/index.d.ts +2 -0
- package/lib/dropdown-item/DropdownItem.js +3 -0
- package/lib/dropdown-menu/DropdownMenu.js +3 -1
- package/lib/dropdown-menu/types.d.ts +2 -0
- package/lib/floating-bubble/FloatingBubble.d.ts +3 -22
- package/lib/floating-bubble/FloatingBubble.js +3 -9
- package/lib/floating-bubble/index.d.ts +2 -15
- package/lib/image/Image.d.ts +3 -0
- package/lib/image/Image.js +3 -1
- package/lib/image/index.d.ts +2 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/list/List.js +1 -1
- package/lib/notify/Notify.d.ts +3 -0
- package/lib/notify/index.d.ts +2 -0
- package/lib/picker/Picker.js +6 -2
- package/lib/popup/Popup.d.ts +3 -0
- package/lib/popup/Popup.js +10 -9
- package/lib/popup/index.d.ts +2 -0
- package/lib/popup/shared.d.ts +2 -0
- package/lib/popup/shared.js +2 -0
- package/lib/progress/Progress.js +6 -3
- package/lib/share-sheet/ShareSheet.d.ts +3 -0
- package/lib/share-sheet/index.d.ts +2 -0
- package/lib/tab/Tab.js +1 -1
- package/lib/tab/index.d.ts +1 -0
- package/lib/tab/index.js +4 -1
- package/lib/vant.cjs.js +59 -31
- package/lib/vant.es.js +59 -31
- package/lib/vant.js +1326 -1315
- package/lib/vant.min.js +3 -3
- package/lib/watermark/Watermark.js +4 -1
- package/lib/web-types.json +1 -1
- package/package.json +14 -14
package/lib/progress/Progress.js
CHANGED
@@ -44,6 +44,7 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
44
44
|
props: progressProps,
|
45
45
|
setup(props) {
|
46
46
|
const background = (0, import_vue.computed)(() => props.inactive ? void 0 : props.color);
|
47
|
+
const format = (rate) => Math.min(Math.max(+rate, 0), 100);
|
47
48
|
const renderPivot = () => {
|
48
49
|
const {
|
49
50
|
textColor,
|
@@ -51,12 +52,13 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
51
52
|
pivotColor,
|
52
53
|
percentage
|
53
54
|
} = props;
|
55
|
+
const safePercentage = format(percentage);
|
54
56
|
const text = pivotText != null ? pivotText : `${percentage}%`;
|
55
57
|
if (props.showPivot && text) {
|
56
58
|
const style = {
|
57
59
|
color: textColor,
|
58
|
-
left: `${
|
59
|
-
transform: `translate(-${
|
60
|
+
left: `${safePercentage}%`,
|
61
|
+
transform: `translate(-${safePercentage}%,-50%)`,
|
60
62
|
background: pivotColor || background.value
|
61
63
|
};
|
62
64
|
return (0, import_vue.createVNode)("span", {
|
@@ -73,12 +75,13 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
73
75
|
percentage,
|
74
76
|
strokeWidth
|
75
77
|
} = props;
|
78
|
+
const safePercentage = format(percentage);
|
76
79
|
const rootStyle = {
|
77
80
|
background: trackColor,
|
78
81
|
height: (0, import_utils.addUnit)(strokeWidth)
|
79
82
|
};
|
80
83
|
const portionStyle = {
|
81
|
-
width: `${
|
84
|
+
width: `${safePercentage}%`,
|
82
85
|
background: background.value
|
83
86
|
};
|
84
87
|
return (0, import_vue.createVNode)("div", {
|
@@ -24,6 +24,7 @@ export declare const shareSheetProps: {
|
|
24
24
|
default: true;
|
25
25
|
};
|
26
26
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
27
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
27
28
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
28
29
|
overlayClass: import("vue").PropType<unknown>;
|
29
30
|
transitionAppear: BooleanConstructor;
|
@@ -71,6 +72,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
71
72
|
default: true;
|
72
73
|
};
|
73
74
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
75
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
74
76
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
75
77
|
overlayClass: import("vue").PropType<unknown>;
|
76
78
|
transitionAppear: BooleanConstructor;
|
@@ -116,6 +118,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
116
118
|
default: true;
|
117
119
|
};
|
118
120
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
121
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
119
122
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
120
123
|
overlayClass: import("vue").PropType<unknown>;
|
121
124
|
transitionAppear: BooleanConstructor;
|
@@ -16,6 +16,7 @@ export declare const ShareSheet: import("../utils").WithInstall<import("vue").De
|
|
16
16
|
default: true;
|
17
17
|
};
|
18
18
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
19
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
19
20
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
20
21
|
overlayClass: import("vue").PropType<unknown>;
|
21
22
|
transitionAppear: BooleanConstructor;
|
@@ -61,6 +62,7 @@ export declare const ShareSheet: import("../utils").WithInstall<import("vue").De
|
|
61
62
|
default: true;
|
62
63
|
};
|
63
64
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
65
|
+
overlayProps: import("vue").PropType<Partial<import("..").OverlayProps>>;
|
64
66
|
overlayStyle: import("vue").PropType<import("vue").CSSProperties>;
|
65
67
|
overlayClass: import("vue").PropType<unknown>;
|
66
68
|
transitionAppear: BooleanConstructor;
|
package/lib/tab/Tab.js
CHANGED
@@ -120,7 +120,7 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
120
120
|
parent.setLine();
|
121
121
|
parent.scrollIntoView();
|
122
122
|
});
|
123
|
-
(0,
|
123
|
+
(0, import_use_tab_status.useProvideTabStatus)(active);
|
124
124
|
(0, import_use_expose.useExpose)({
|
125
125
|
id,
|
126
126
|
renderTitle
|
package/lib/tab/index.d.ts
CHANGED
@@ -38,6 +38,7 @@ export declare const Tab: import("../utils").WithInstall<import("vue").DefineCom
|
|
38
38
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
39
39
|
export default Tab;
|
40
40
|
export { tabProps } from './Tab';
|
41
|
+
export { useTabStatus, useAllTabStatus } from '../composables/use-tab-status';
|
41
42
|
export type { TabProps } from './Tab';
|
42
43
|
declare module 'vue' {
|
43
44
|
interface GlobalComponents {
|
package/lib/tab/index.js
CHANGED
@@ -29,11 +29,14 @@ var stdin_exports = {};
|
|
29
29
|
__export(stdin_exports, {
|
30
30
|
Tab: () => Tab,
|
31
31
|
default: () => stdin_default,
|
32
|
-
tabProps: () => import_Tab2.tabProps
|
32
|
+
tabProps: () => import_Tab2.tabProps,
|
33
|
+
useAllTabStatus: () => import_use_tab_status.useAllTabStatus,
|
34
|
+
useTabStatus: () => import_use_tab_status.useTabStatus
|
33
35
|
});
|
34
36
|
module.exports = __toCommonJS(stdin_exports);
|
35
37
|
var import_utils = require("../utils");
|
36
38
|
var import_Tab = __toESM(require("./Tab"));
|
37
39
|
var import_Tab2 = require("./Tab");
|
40
|
+
var import_use_tab_status = require("../composables/use-tab-status");
|
38
41
|
const Tab = (0, import_utils.withInstall)(import_Tab.default);
|
39
42
|
var stdin_default = Tab;
|
package/lib/vant.cjs.js
CHANGED
@@ -1128,6 +1128,8 @@ const popupSharedProps = {
|
|
1128
1128
|
lazyRender: truthProp,
|
1129
1129
|
// callback function before close
|
1130
1130
|
beforeClose: Function,
|
1131
|
+
// overlay props
|
1132
|
+
overlayProps: Object,
|
1131
1133
|
// overlay custom style
|
1132
1134
|
overlayStyle: Object,
|
1133
1135
|
// overlay custom class name
|
@@ -1397,15 +1399,16 @@ var stdin_default$1K = vue.defineComponent({
|
|
1397
1399
|
};
|
1398
1400
|
const renderOverlay = () => {
|
1399
1401
|
if (props2.overlay) {
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1407
|
-
|
1408
|
-
},
|
1402
|
+
const overlayProps2 = extend({
|
1403
|
+
show: props2.show,
|
1404
|
+
class: props2.overlayClass,
|
1405
|
+
zIndex: zIndex.value,
|
1406
|
+
duration: props2.duration,
|
1407
|
+
customStyle: props2.overlayStyle,
|
1408
|
+
role: props2.closeOnClickOverlay ? "button" : void 0,
|
1409
|
+
tabindex: props2.closeOnClickOverlay ? 0 : void 0
|
1410
|
+
}, props2.overlayProps);
|
1411
|
+
return vue.createVNode(Overlay, vue.mergeProps(overlayProps2, useScopeId(), {
|
1409
1412
|
"onClick": onClickOverlay
|
1410
1413
|
}), {
|
1411
1414
|
default: slots["overlay-content"]
|
@@ -2983,7 +2986,19 @@ var stdin_default$1D = vue.defineComponent({
|
|
2983
2986
|
}
|
2984
2987
|
});
|
2985
2988
|
const TAB_STATUS_KEY = Symbol();
|
2989
|
+
const ALL_TAB_STATUS_KEY = Symbol();
|
2986
2990
|
const useTabStatus = () => vue.inject(TAB_STATUS_KEY, null);
|
2991
|
+
const useAllTabStatus = () => vue.inject(ALL_TAB_STATUS_KEY, null);
|
2992
|
+
const useProvideTabStatus = (status) => {
|
2993
|
+
const allTabStatus = useAllTabStatus();
|
2994
|
+
vue.provide(TAB_STATUS_KEY, status);
|
2995
|
+
vue.provide(
|
2996
|
+
ALL_TAB_STATUS_KEY,
|
2997
|
+
vue.computed(() => {
|
2998
|
+
return (allTabStatus == null || allTabStatus.value) && status.value;
|
2999
|
+
})
|
3000
|
+
);
|
3001
|
+
};
|
2987
3002
|
const [name$1s, bem$1o] = createNamespace("tab");
|
2988
3003
|
const TabTitle = vue.defineComponent({
|
2989
3004
|
name: name$1s,
|
@@ -3230,7 +3245,7 @@ var stdin_default$1B = vue.defineComponent({
|
|
3230
3245
|
parent.setLine();
|
3231
3246
|
parent.scrollIntoView();
|
3232
3247
|
});
|
3233
|
-
|
3248
|
+
useProvideTabStatus(active);
|
3234
3249
|
useExpose({
|
3235
3250
|
id,
|
3236
3251
|
renderTitle
|
@@ -3509,13 +3524,14 @@ var stdin_default$1z = vue.defineComponent({
|
|
3509
3524
|
}), pick(slots, pickerToolbarSlots));
|
3510
3525
|
}
|
3511
3526
|
};
|
3512
|
-
|
3527
|
+
const resetSelectedValues = (columns) => {
|
3513
3528
|
columns.forEach((options, index) => {
|
3514
3529
|
if (options.length && !isOptionExist(options, selectedValues.value[index], fields.value)) {
|
3515
3530
|
setValue(index, getFirstEnabledOption(options)[fields.value.value]);
|
3516
3531
|
}
|
3517
3532
|
});
|
3518
|
-
}
|
3533
|
+
};
|
3534
|
+
vue.watch(currentColumns, (columns) => resetSelectedValues(columns), {
|
3519
3535
|
immediate: true
|
3520
3536
|
});
|
3521
3537
|
let lastEmittedModelValue;
|
@@ -3524,6 +3540,9 @@ var stdin_default$1z = vue.defineComponent({
|
|
3524
3540
|
selectedValues.value = newValues.slice(0);
|
3525
3541
|
lastEmittedModelValue = newValues.slice(0);
|
3526
3542
|
}
|
3543
|
+
if (props2.modelValue.length === 0) {
|
3544
|
+
resetSelectedValues(currentColumns.value);
|
3545
|
+
}
|
3527
3546
|
}, {
|
3528
3547
|
deep: true
|
3529
3548
|
});
|
@@ -5550,7 +5569,7 @@ var stdin_default$1n = vue.defineComponent({
|
|
5550
5569
|
const direction = vue.computed(() => getParentProp("direction"));
|
5551
5570
|
const iconStyle = vue.computed(() => {
|
5552
5571
|
const checkedColor = props2.checkedColor || getParentProp("checkedColor");
|
5553
|
-
if (checkedColor && props2.checked && !disabled.value) {
|
5572
|
+
if (checkedColor && (props2.checked || props2.indeterminate) && !disabled.value) {
|
5554
5573
|
return {
|
5555
5574
|
borderColor: checkedColor,
|
5556
5575
|
backgroundColor: checkedColor
|
@@ -6295,7 +6314,7 @@ var stdin_default$1h = vue.defineComponent({
|
|
6295
6314
|
deep: true
|
6296
6315
|
});
|
6297
6316
|
const rootStyle = vue.ref({});
|
6298
|
-
vue.onMounted(() => __async(
|
6317
|
+
vue.onMounted(() => __async(null, null, function* () {
|
6299
6318
|
var _a;
|
6300
6319
|
rootStyle.value["--move-distance"] = `-${(_a = barrageWrapper.value) == null ? void 0 : _a.offsetWidth}px`;
|
6301
6320
|
yield vue.nextTick();
|
@@ -7323,7 +7342,8 @@ const imageProps = {
|
|
7323
7342
|
showLoading: truthProp,
|
7324
7343
|
loadingIcon: makeStringProp("photo"),
|
7325
7344
|
crossorigin: String,
|
7326
|
-
referrerpolicy: String
|
7345
|
+
referrerpolicy: String,
|
7346
|
+
decoding: String
|
7327
7347
|
};
|
7328
7348
|
var stdin_default$1c = vue.defineComponent({
|
7329
7349
|
name: name$13,
|
@@ -7403,6 +7423,7 @@ var stdin_default$1c = vue.defineComponent({
|
|
7403
7423
|
const attrs = {
|
7404
7424
|
alt: props2.alt,
|
7405
7425
|
class: bem$12("img"),
|
7426
|
+
decoding: props2.decoding,
|
7406
7427
|
style: {
|
7407
7428
|
objectFit: props2.fit,
|
7408
7429
|
objectPosition: props2.position
|
@@ -9927,12 +9948,14 @@ var stdin_default$U = vue.defineComponent({
|
|
9927
9948
|
}, [item.renderTitle()])])]);
|
9928
9949
|
};
|
9929
9950
|
useExpose({
|
9930
|
-
close
|
9951
|
+
close,
|
9952
|
+
opened
|
9931
9953
|
});
|
9932
9954
|
linkChildren({
|
9933
9955
|
id,
|
9934
9956
|
props: props2,
|
9935
9957
|
offset,
|
9958
|
+
opened,
|
9936
9959
|
updateOffset
|
9937
9960
|
});
|
9938
9961
|
use.useClickAway(root, onClickAway);
|
@@ -10108,6 +10131,9 @@ var stdin_default$T = vue.defineComponent({
|
|
10108
10131
|
"role": "menu",
|
10109
10132
|
"class": bem$K("content"),
|
10110
10133
|
"overlay": overlay,
|
10134
|
+
"overlayProps": {
|
10135
|
+
duration: state.transition && !parent.opened.value ? duration : 0
|
10136
|
+
},
|
10111
10137
|
"position": direction === "down" ? "top" : "bottom",
|
10112
10138
|
"duration": state.transition ? duration : 0,
|
10113
10139
|
"lazyRender": props2.lazyRender,
|
@@ -10155,13 +10181,7 @@ const floatingBubbleProps = {
|
|
10155
10181
|
icon: String,
|
10156
10182
|
axis: makeStringProp("y"),
|
10157
10183
|
magnetic: String,
|
10158
|
-
offset:
|
10159
|
-
type: Object,
|
10160
|
-
default: () => ({
|
10161
|
-
x: -1,
|
10162
|
-
y: -1
|
10163
|
-
})
|
10164
|
-
},
|
10184
|
+
offset: Object,
|
10165
10185
|
teleport: {
|
10166
10186
|
type: [String, Object],
|
10167
10187
|
default: "body"
|
@@ -10215,8 +10235,8 @@ var stdin_default$S = vue.defineComponent({
|
|
10215
10235
|
offset
|
10216
10236
|
} = props2;
|
10217
10237
|
state.value = {
|
10218
|
-
x: offset
|
10219
|
-
y: offset
|
10238
|
+
x: offset ? offset.x : windowWidth.value - width - gapX.value,
|
10239
|
+
y: offset ? offset.y : windowHeight.value - height - gapY.value,
|
10220
10240
|
width,
|
10221
10241
|
height
|
10222
10242
|
};
|
@@ -11640,7 +11660,7 @@ var stdin_default$J = vue.defineComponent({
|
|
11640
11660
|
const loading = vue.ref(props2.loading);
|
11641
11661
|
const root = vue.ref();
|
11642
11662
|
const placeholder = vue.ref();
|
11643
|
-
const tabStatus =
|
11663
|
+
const tabStatus = useAllTabStatus();
|
11644
11664
|
const scrollParent = use.useScrollParent(root);
|
11645
11665
|
const scroller = vue.computed(() => props2.scroller || scrollParent.value);
|
11646
11666
|
const check = () => {
|
@@ -12840,6 +12860,7 @@ var stdin_default$A = vue.defineComponent({
|
|
12840
12860
|
props: progressProps,
|
12841
12861
|
setup(props2) {
|
12842
12862
|
const background = vue.computed(() => props2.inactive ? void 0 : props2.color);
|
12863
|
+
const format2 = (rate) => Math.min(Math.max(+rate, 0), 100);
|
12843
12864
|
const renderPivot = () => {
|
12844
12865
|
const {
|
12845
12866
|
textColor,
|
@@ -12847,12 +12868,13 @@ var stdin_default$A = vue.defineComponent({
|
|
12847
12868
|
pivotColor,
|
12848
12869
|
percentage
|
12849
12870
|
} = props2;
|
12871
|
+
const safePercentage = format2(percentage);
|
12850
12872
|
const text = pivotText != null ? pivotText : `${percentage}%`;
|
12851
12873
|
if (props2.showPivot && text) {
|
12852
12874
|
const style = {
|
12853
12875
|
color: textColor,
|
12854
|
-
left: `${
|
12855
|
-
transform: `translate(-${
|
12876
|
+
left: `${safePercentage}%`,
|
12877
|
+
transform: `translate(-${safePercentage}%,-50%)`,
|
12856
12878
|
background: pivotColor || background.value
|
12857
12879
|
};
|
12858
12880
|
return vue.createVNode("span", {
|
@@ -12869,12 +12891,13 @@ var stdin_default$A = vue.defineComponent({
|
|
12869
12891
|
percentage,
|
12870
12892
|
strokeWidth
|
12871
12893
|
} = props2;
|
12894
|
+
const safePercentage = format2(percentage);
|
12872
12895
|
const rootStyle = {
|
12873
12896
|
background: trackColor,
|
12874
12897
|
height: addUnit(strokeWidth)
|
12875
12898
|
};
|
12876
12899
|
const portionStyle = {
|
12877
|
-
width: `${
|
12900
|
+
width: `${safePercentage}%`,
|
12878
12901
|
background: background.value
|
12879
12902
|
};
|
12880
12903
|
return vue.createVNode("div", {
|
@@ -16201,7 +16224,10 @@ var stdin_default$4 = vue.defineComponent({
|
|
16201
16224
|
makeImageToBase64(props2.image);
|
16202
16225
|
}
|
16203
16226
|
});
|
16204
|
-
vue.watch(() => [
|
16227
|
+
vue.watch(() => [props2.content, props2.textColor, props2.height, props2.width, props2.rotate, props2.gapX, props2.gapY], generateWatermarkUrl);
|
16228
|
+
vue.watch(imageBase64, () => {
|
16229
|
+
vue.nextTick(generateWatermarkUrl);
|
16230
|
+
});
|
16205
16231
|
vue.onMounted(generateWatermarkUrl);
|
16206
16232
|
vue.onUnmounted(revokeWatermarkUrl);
|
16207
16233
|
return () => {
|
@@ -17084,7 +17110,7 @@ const Lazyload = {
|
|
17084
17110
|
});
|
17085
17111
|
}
|
17086
17112
|
};
|
17087
|
-
const version = "4.9.
|
17113
|
+
const version = "4.9.21";
|
17088
17114
|
function install(app) {
|
17089
17115
|
const components = [
|
17090
17116
|
ActionBar,
|
@@ -17419,6 +17445,8 @@ exports.timePickerProps = timePickerProps;
|
|
17419
17445
|
exports.toastProps = toastProps;
|
17420
17446
|
exports.treeSelectProps = treeSelectProps;
|
17421
17447
|
exports.uploaderProps = uploaderProps;
|
17448
|
+
exports.useAllTabStatus = useAllTabStatus;
|
17422
17449
|
exports.useCurrentLang = useCurrentLang;
|
17450
|
+
exports.useTabStatus = useTabStatus;
|
17423
17451
|
exports.version = version;
|
17424
17452
|
exports.watermarkProps = watermarkProps;
|
package/lib/vant.es.js
CHANGED
@@ -1126,6 +1126,8 @@ const popupSharedProps = {
|
|
1126
1126
|
lazyRender: truthProp,
|
1127
1127
|
// callback function before close
|
1128
1128
|
beforeClose: Function,
|
1129
|
+
// overlay props
|
1130
|
+
overlayProps: Object,
|
1129
1131
|
// overlay custom style
|
1130
1132
|
overlayStyle: Object,
|
1131
1133
|
// overlay custom class name
|
@@ -1395,15 +1397,16 @@ var stdin_default$1K = defineComponent({
|
|
1395
1397
|
};
|
1396
1398
|
const renderOverlay = () => {
|
1397
1399
|
if (props2.overlay) {
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
},
|
1400
|
+
const overlayProps2 = extend({
|
1401
|
+
show: props2.show,
|
1402
|
+
class: props2.overlayClass,
|
1403
|
+
zIndex: zIndex.value,
|
1404
|
+
duration: props2.duration,
|
1405
|
+
customStyle: props2.overlayStyle,
|
1406
|
+
role: props2.closeOnClickOverlay ? "button" : void 0,
|
1407
|
+
tabindex: props2.closeOnClickOverlay ? 0 : void 0
|
1408
|
+
}, props2.overlayProps);
|
1409
|
+
return createVNode(Overlay, mergeProps(overlayProps2, useScopeId(), {
|
1407
1410
|
"onClick": onClickOverlay
|
1408
1411
|
}), {
|
1409
1412
|
default: slots["overlay-content"]
|
@@ -2981,7 +2984,19 @@ var stdin_default$1D = defineComponent({
|
|
2981
2984
|
}
|
2982
2985
|
});
|
2983
2986
|
const TAB_STATUS_KEY = Symbol();
|
2987
|
+
const ALL_TAB_STATUS_KEY = Symbol();
|
2984
2988
|
const useTabStatus = () => inject(TAB_STATUS_KEY, null);
|
2989
|
+
const useAllTabStatus = () => inject(ALL_TAB_STATUS_KEY, null);
|
2990
|
+
const useProvideTabStatus = (status) => {
|
2991
|
+
const allTabStatus = useAllTabStatus();
|
2992
|
+
provide(TAB_STATUS_KEY, status);
|
2993
|
+
provide(
|
2994
|
+
ALL_TAB_STATUS_KEY,
|
2995
|
+
computed(() => {
|
2996
|
+
return (allTabStatus == null || allTabStatus.value) && status.value;
|
2997
|
+
})
|
2998
|
+
);
|
2999
|
+
};
|
2985
3000
|
const [name$1s, bem$1o] = createNamespace("tab");
|
2986
3001
|
const TabTitle = defineComponent({
|
2987
3002
|
name: name$1s,
|
@@ -3228,7 +3243,7 @@ var stdin_default$1B = defineComponent({
|
|
3228
3243
|
parent.setLine();
|
3229
3244
|
parent.scrollIntoView();
|
3230
3245
|
});
|
3231
|
-
|
3246
|
+
useProvideTabStatus(active);
|
3232
3247
|
useExpose({
|
3233
3248
|
id,
|
3234
3249
|
renderTitle
|
@@ -3507,13 +3522,14 @@ var stdin_default$1z = defineComponent({
|
|
3507
3522
|
}), pick(slots, pickerToolbarSlots));
|
3508
3523
|
}
|
3509
3524
|
};
|
3510
|
-
|
3525
|
+
const resetSelectedValues = (columns) => {
|
3511
3526
|
columns.forEach((options, index) => {
|
3512
3527
|
if (options.length && !isOptionExist(options, selectedValues.value[index], fields.value)) {
|
3513
3528
|
setValue(index, getFirstEnabledOption(options)[fields.value.value]);
|
3514
3529
|
}
|
3515
3530
|
});
|
3516
|
-
}
|
3531
|
+
};
|
3532
|
+
watch(currentColumns, (columns) => resetSelectedValues(columns), {
|
3517
3533
|
immediate: true
|
3518
3534
|
});
|
3519
3535
|
let lastEmittedModelValue;
|
@@ -3522,6 +3538,9 @@ var stdin_default$1z = defineComponent({
|
|
3522
3538
|
selectedValues.value = newValues.slice(0);
|
3523
3539
|
lastEmittedModelValue = newValues.slice(0);
|
3524
3540
|
}
|
3541
|
+
if (props2.modelValue.length === 0) {
|
3542
|
+
resetSelectedValues(currentColumns.value);
|
3543
|
+
}
|
3525
3544
|
}, {
|
3526
3545
|
deep: true
|
3527
3546
|
});
|
@@ -5548,7 +5567,7 @@ var stdin_default$1n = defineComponent({
|
|
5548
5567
|
const direction = computed(() => getParentProp("direction"));
|
5549
5568
|
const iconStyle = computed(() => {
|
5550
5569
|
const checkedColor = props2.checkedColor || getParentProp("checkedColor");
|
5551
|
-
if (checkedColor && props2.checked && !disabled.value) {
|
5570
|
+
if (checkedColor && (props2.checked || props2.indeterminate) && !disabled.value) {
|
5552
5571
|
return {
|
5553
5572
|
borderColor: checkedColor,
|
5554
5573
|
backgroundColor: checkedColor
|
@@ -6293,7 +6312,7 @@ var stdin_default$1h = defineComponent({
|
|
6293
6312
|
deep: true
|
6294
6313
|
});
|
6295
6314
|
const rootStyle = ref({});
|
6296
|
-
onMounted(() => __async(
|
6315
|
+
onMounted(() => __async(null, null, function* () {
|
6297
6316
|
var _a;
|
6298
6317
|
rootStyle.value["--move-distance"] = `-${(_a = barrageWrapper.value) == null ? void 0 : _a.offsetWidth}px`;
|
6299
6318
|
yield nextTick();
|
@@ -7321,7 +7340,8 @@ const imageProps = {
|
|
7321
7340
|
showLoading: truthProp,
|
7322
7341
|
loadingIcon: makeStringProp("photo"),
|
7323
7342
|
crossorigin: String,
|
7324
|
-
referrerpolicy: String
|
7343
|
+
referrerpolicy: String,
|
7344
|
+
decoding: String
|
7325
7345
|
};
|
7326
7346
|
var stdin_default$1c = defineComponent({
|
7327
7347
|
name: name$13,
|
@@ -7401,6 +7421,7 @@ var stdin_default$1c = defineComponent({
|
|
7401
7421
|
const attrs = {
|
7402
7422
|
alt: props2.alt,
|
7403
7423
|
class: bem$12("img"),
|
7424
|
+
decoding: props2.decoding,
|
7404
7425
|
style: {
|
7405
7426
|
objectFit: props2.fit,
|
7406
7427
|
objectPosition: props2.position
|
@@ -9925,12 +9946,14 @@ var stdin_default$U = defineComponent({
|
|
9925
9946
|
}, [item.renderTitle()])])]);
|
9926
9947
|
};
|
9927
9948
|
useExpose({
|
9928
|
-
close
|
9949
|
+
close,
|
9950
|
+
opened
|
9929
9951
|
});
|
9930
9952
|
linkChildren({
|
9931
9953
|
id,
|
9932
9954
|
props: props2,
|
9933
9955
|
offset,
|
9956
|
+
opened,
|
9934
9957
|
updateOffset
|
9935
9958
|
});
|
9936
9959
|
useClickAway(root, onClickAway);
|
@@ -10106,6 +10129,9 @@ var stdin_default$T = defineComponent({
|
|
10106
10129
|
"role": "menu",
|
10107
10130
|
"class": bem$K("content"),
|
10108
10131
|
"overlay": overlay,
|
10132
|
+
"overlayProps": {
|
10133
|
+
duration: state.transition && !parent.opened.value ? duration : 0
|
10134
|
+
},
|
10109
10135
|
"position": direction === "down" ? "top" : "bottom",
|
10110
10136
|
"duration": state.transition ? duration : 0,
|
10111
10137
|
"lazyRender": props2.lazyRender,
|
@@ -10153,13 +10179,7 @@ const floatingBubbleProps = {
|
|
10153
10179
|
icon: String,
|
10154
10180
|
axis: makeStringProp("y"),
|
10155
10181
|
magnetic: String,
|
10156
|
-
offset:
|
10157
|
-
type: Object,
|
10158
|
-
default: () => ({
|
10159
|
-
x: -1,
|
10160
|
-
y: -1
|
10161
|
-
})
|
10162
|
-
},
|
10182
|
+
offset: Object,
|
10163
10183
|
teleport: {
|
10164
10184
|
type: [String, Object],
|
10165
10185
|
default: "body"
|
@@ -10213,8 +10233,8 @@ var stdin_default$S = defineComponent({
|
|
10213
10233
|
offset
|
10214
10234
|
} = props2;
|
10215
10235
|
state.value = {
|
10216
|
-
x: offset
|
10217
|
-
y: offset
|
10236
|
+
x: offset ? offset.x : windowWidth.value - width - gapX.value,
|
10237
|
+
y: offset ? offset.y : windowHeight.value - height - gapY.value,
|
10218
10238
|
width,
|
10219
10239
|
height
|
10220
10240
|
};
|
@@ -11638,7 +11658,7 @@ var stdin_default$J = defineComponent({
|
|
11638
11658
|
const loading = ref(props2.loading);
|
11639
11659
|
const root = ref();
|
11640
11660
|
const placeholder = ref();
|
11641
|
-
const tabStatus =
|
11661
|
+
const tabStatus = useAllTabStatus();
|
11642
11662
|
const scrollParent = useScrollParent(root);
|
11643
11663
|
const scroller = computed(() => props2.scroller || scrollParent.value);
|
11644
11664
|
const check = () => {
|
@@ -12838,6 +12858,7 @@ var stdin_default$A = defineComponent({
|
|
12838
12858
|
props: progressProps,
|
12839
12859
|
setup(props2) {
|
12840
12860
|
const background = computed(() => props2.inactive ? void 0 : props2.color);
|
12861
|
+
const format2 = (rate) => Math.min(Math.max(+rate, 0), 100);
|
12841
12862
|
const renderPivot = () => {
|
12842
12863
|
const {
|
12843
12864
|
textColor,
|
@@ -12845,12 +12866,13 @@ var stdin_default$A = defineComponent({
|
|
12845
12866
|
pivotColor,
|
12846
12867
|
percentage
|
12847
12868
|
} = props2;
|
12869
|
+
const safePercentage = format2(percentage);
|
12848
12870
|
const text = pivotText != null ? pivotText : `${percentage}%`;
|
12849
12871
|
if (props2.showPivot && text) {
|
12850
12872
|
const style = {
|
12851
12873
|
color: textColor,
|
12852
|
-
left: `${
|
12853
|
-
transform: `translate(-${
|
12874
|
+
left: `${safePercentage}%`,
|
12875
|
+
transform: `translate(-${safePercentage}%,-50%)`,
|
12854
12876
|
background: pivotColor || background.value
|
12855
12877
|
};
|
12856
12878
|
return createVNode("span", {
|
@@ -12867,12 +12889,13 @@ var stdin_default$A = defineComponent({
|
|
12867
12889
|
percentage,
|
12868
12890
|
strokeWidth
|
12869
12891
|
} = props2;
|
12892
|
+
const safePercentage = format2(percentage);
|
12870
12893
|
const rootStyle = {
|
12871
12894
|
background: trackColor,
|
12872
12895
|
height: addUnit(strokeWidth)
|
12873
12896
|
};
|
12874
12897
|
const portionStyle = {
|
12875
|
-
width: `${
|
12898
|
+
width: `${safePercentage}%`,
|
12876
12899
|
background: background.value
|
12877
12900
|
};
|
12878
12901
|
return createVNode("div", {
|
@@ -16199,7 +16222,10 @@ var stdin_default$4 = defineComponent({
|
|
16199
16222
|
makeImageToBase64(props2.image);
|
16200
16223
|
}
|
16201
16224
|
});
|
16202
|
-
watch(() => [
|
16225
|
+
watch(() => [props2.content, props2.textColor, props2.height, props2.width, props2.rotate, props2.gapX, props2.gapY], generateWatermarkUrl);
|
16226
|
+
watch(imageBase64, () => {
|
16227
|
+
nextTick(generateWatermarkUrl);
|
16228
|
+
});
|
16203
16229
|
onMounted(generateWatermarkUrl);
|
16204
16230
|
onUnmounted(revokeWatermarkUrl);
|
16205
16231
|
return () => {
|
@@ -17082,7 +17108,7 @@ const Lazyload = {
|
|
17082
17108
|
});
|
17083
17109
|
}
|
17084
17110
|
};
|
17085
|
-
const version = "4.9.
|
17111
|
+
const version = "4.9.21";
|
17086
17112
|
function install(app) {
|
17087
17113
|
const components = [
|
17088
17114
|
ActionBar,
|
@@ -17418,7 +17444,9 @@ export {
|
|
17418
17444
|
toastProps,
|
17419
17445
|
treeSelectProps,
|
17420
17446
|
uploaderProps,
|
17447
|
+
useAllTabStatus,
|
17421
17448
|
useCurrentLang,
|
17449
|
+
useTabStatus,
|
17422
17450
|
version,
|
17423
17451
|
watermarkProps
|
17424
17452
|
};
|