vant 4.6.5 → 4.6.7
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 +1 -1
- package/es/action-sheet/ActionSheet.d.ts +1 -1
- package/es/action-sheet/index.d.ts +1 -1
- package/es/address-edit/AddressEditDetail.d.ts +1 -1
- package/es/address-list/AddressList.d.ts +1 -1
- package/es/address-list/index.d.ts +1 -1
- package/es/button/Button.d.ts +2 -2
- package/es/button/index.d.ts +2 -2
- package/es/calendar/Calendar.d.ts +1 -1
- package/es/calendar/index.d.ts +1 -1
- package/es/cell/Cell.d.ts +1 -1
- package/es/cell/index.d.ts +1 -1
- package/es/cell-group/CellGroup.d.ts +1 -1
- package/es/cell-group/index.d.ts +1 -1
- package/es/checkbox/Checkbox.d.ts +13 -0
- package/es/checkbox/Checkbox.mjs +11 -2
- package/es/checkbox/Checker.d.ts +9 -0
- package/es/checkbox/Checker.mjs +10 -4
- package/es/checkbox/index.css +1 -1
- package/es/checkbox/index.d.ts +9 -0
- package/es/collapse-item/CollapseItem.d.ts +1 -1
- package/es/collapse-item/index.d.ts +1 -1
- package/es/config-provider/ConfigProvider.d.ts +14 -0
- package/es/config-provider/ConfigProvider.mjs +30 -1
- package/es/config-provider/index.d.ts +10 -1
- package/es/contact-list/ContactList.d.ts +1 -1
- package/es/contact-list/index.d.ts +1 -1
- package/es/divider/Divider.d.ts +1 -1
- package/es/divider/index.d.ts +1 -1
- package/es/dropdown-item/DropdownItem.mjs +1 -1
- package/es/dropdown-item/types.d.ts +2 -1
- package/es/field/Field.d.ts +1 -1
- package/es/field/index.d.ts +1 -1
- package/es/floating-bubble/FloatingBubble.mjs +5 -1
- package/es/grid/Grid.d.ts +1 -1
- package/es/grid/index.d.ts +1 -1
- package/es/image/Image.d.ts +1 -1
- package/es/image/index.d.ts +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/number-keyboard/NumberKeyboard.d.ts +2 -2
- package/es/number-keyboard/index.d.ts +2 -2
- package/es/popup/Popup.d.ts +1 -1
- package/es/popup/index.d.ts +1 -1
- package/es/share-sheet/ShareSheet.d.ts +1 -1
- package/es/share-sheet/index.d.ts +1 -1
- package/es/signature/Signature.d.ts +1 -1
- package/es/signature/index.d.ts +1 -1
- package/es/skeleton/Skeleton.d.ts +1 -1
- package/es/skeleton/index.d.ts +1 -1
- package/es/slider/Slider.d.ts +1 -1
- package/es/slider/index.d.ts +1 -1
- package/es/space/Space.d.ts +4 -4
- package/es/space/index.d.ts +3 -3
- package/es/stepper/Stepper.d.ts +2 -2
- package/es/stepper/index.d.ts +2 -2
- package/es/tabs/Tabs.d.ts +1 -1
- package/es/tabs/index.d.ts +1 -1
- package/es/tag/Tag.d.ts +1 -1
- package/es/tag/index.d.ts +1 -1
- package/es/uploader/Uploader.d.ts +1 -1
- package/es/uploader/index.d.ts +1 -1
- package/es/vue-tsx-shim.d.ts +1 -0
- package/lib/action-sheet/ActionSheet.d.ts +1 -1
- package/lib/action-sheet/index.d.ts +1 -1
- package/lib/address-edit/AddressEditDetail.d.ts +1 -1
- package/lib/address-list/AddressList.d.ts +1 -1
- package/lib/address-list/index.d.ts +1 -1
- package/lib/button/Button.d.ts +2 -2
- package/lib/button/index.d.ts +2 -2
- package/lib/calendar/Calendar.d.ts +1 -1
- package/lib/calendar/index.d.ts +1 -1
- package/lib/cell/Cell.d.ts +1 -1
- package/lib/cell/index.d.ts +1 -1
- package/lib/cell-group/CellGroup.d.ts +1 -1
- package/lib/cell-group/index.d.ts +1 -1
- package/lib/checkbox/Checkbox.d.ts +13 -0
- package/lib/checkbox/Checkbox.js +11 -2
- package/lib/checkbox/Checker.d.ts +9 -0
- package/lib/checkbox/Checker.js +10 -4
- package/lib/checkbox/index.css +1 -1
- package/lib/checkbox/index.d.ts +9 -0
- package/lib/collapse-item/CollapseItem.d.ts +1 -1
- package/lib/collapse-item/index.d.ts +1 -1
- package/lib/config-provider/ConfigProvider.d.ts +14 -0
- package/lib/config-provider/ConfigProvider.js +30 -1
- package/lib/config-provider/index.d.ts +10 -1
- package/lib/contact-list/ContactList.d.ts +1 -1
- package/lib/contact-list/index.d.ts +1 -1
- package/lib/divider/Divider.d.ts +1 -1
- package/lib/divider/index.d.ts +1 -1
- package/lib/dropdown-item/DropdownItem.js +1 -1
- package/lib/dropdown-item/types.d.ts +2 -1
- package/lib/field/Field.d.ts +1 -1
- package/lib/field/index.d.ts +1 -1
- package/lib/floating-bubble/FloatingBubble.js +5 -1
- package/lib/grid/Grid.d.ts +1 -1
- package/lib/grid/index.d.ts +1 -1
- package/lib/image/Image.d.ts +1 -1
- package/lib/image/index.d.ts +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/number-keyboard/NumberKeyboard.d.ts +2 -2
- package/lib/number-keyboard/index.d.ts +2 -2
- package/lib/popup/Popup.d.ts +1 -1
- package/lib/popup/index.d.ts +1 -1
- package/lib/share-sheet/ShareSheet.d.ts +1 -1
- package/lib/share-sheet/index.d.ts +1 -1
- package/lib/signature/Signature.d.ts +1 -1
- package/lib/signature/index.d.ts +1 -1
- package/lib/skeleton/Skeleton.d.ts +1 -1
- package/lib/skeleton/index.d.ts +1 -1
- package/lib/slider/Slider.d.ts +1 -1
- package/lib/slider/index.d.ts +1 -1
- package/lib/space/Space.d.ts +4 -4
- package/lib/space/index.d.ts +3 -3
- package/lib/stepper/Stepper.d.ts +2 -2
- package/lib/stepper/index.d.ts +2 -2
- package/lib/tabs/Tabs.d.ts +1 -1
- package/lib/tabs/index.d.ts +1 -1
- package/lib/tag/Tag.d.ts +1 -1
- package/lib/tag/index.d.ts +1 -1
- package/lib/uploader/Uploader.d.ts +1 -1
- package/lib/uploader/index.d.ts +1 -1
- package/lib/vant.cjs.js +58 -10
- package/lib/vant.es.js +58 -10
- package/lib/vant.js +58 -10
- package/lib/vant.min.js +1 -1
- package/lib/vue-tsx-shim.d.ts +1 -0
- package/lib/web-types.json +1 -1
- package/package.json +17 -9
package/lib/vant.es.js
CHANGED
@@ -627,6 +627,7 @@ const configProviderProps = {
|
|
627
627
|
themeVars: Object,
|
628
628
|
themeVarsDark: Object,
|
629
629
|
themeVarsLight: Object,
|
630
|
+
themeVarsScope: makeStringProp("local"),
|
630
631
|
iconPrefix: String
|
631
632
|
};
|
632
633
|
function mapThemeVarsToCSSVars(themeVars) {
|
@@ -636,6 +637,18 @@ function mapThemeVarsToCSSVars(themeVars) {
|
|
636
637
|
});
|
637
638
|
return cssVars;
|
638
639
|
}
|
640
|
+
function syncThemeVarsOnRoot(newStyle = {}, oldStyle = {}) {
|
641
|
+
Object.keys(newStyle).forEach((key) => {
|
642
|
+
if (newStyle[key] !== oldStyle[key]) {
|
643
|
+
document.documentElement.style.setProperty(key, newStyle[key]);
|
644
|
+
}
|
645
|
+
});
|
646
|
+
Object.keys(oldStyle).forEach((key) => {
|
647
|
+
if (!newStyle[key]) {
|
648
|
+
document.documentElement.style.removeProperty(key);
|
649
|
+
}
|
650
|
+
});
|
651
|
+
}
|
639
652
|
var stdin_default$1R = defineComponent({
|
640
653
|
name: name$1H,
|
641
654
|
props: configProviderProps,
|
@@ -661,6 +674,22 @@ var stdin_default$1R = defineComponent({
|
|
661
674
|
onActivated(addTheme);
|
662
675
|
onDeactivated(removeTheme);
|
663
676
|
onBeforeUnmount(removeTheme);
|
677
|
+
watch(style, (newStyle, oldStyle) => {
|
678
|
+
if (props2.themeVarsScope === "global") {
|
679
|
+
syncThemeVarsOnRoot(newStyle, oldStyle);
|
680
|
+
}
|
681
|
+
});
|
682
|
+
watch(() => props2.themeVarsScope, (newScope, oldScope) => {
|
683
|
+
if (oldScope === "global") {
|
684
|
+
syncThemeVarsOnRoot({}, style.value);
|
685
|
+
}
|
686
|
+
if (newScope === "global") {
|
687
|
+
syncThemeVarsOnRoot(style.value, {});
|
688
|
+
}
|
689
|
+
});
|
690
|
+
if (props2.themeVarsScope === "global") {
|
691
|
+
syncThemeVarsOnRoot(style.value, {});
|
692
|
+
}
|
664
693
|
}
|
665
694
|
provide(CONFIG_PROVIDER_KEY, props2);
|
666
695
|
watchEffect(() => {
|
@@ -670,7 +699,7 @@ var stdin_default$1R = defineComponent({
|
|
670
699
|
});
|
671
700
|
return () => createVNode(props2.tag, {
|
672
701
|
"class": bem$1C(),
|
673
|
-
"style": style.value
|
702
|
+
"style": props2.themeVarsScope === "local" ? style.value : void 0
|
674
703
|
}, {
|
675
704
|
default: () => {
|
676
705
|
var _a;
|
@@ -5313,7 +5342,11 @@ var stdin_default$1n = defineComponent({
|
|
5313
5342
|
shape: String,
|
5314
5343
|
parent: Object,
|
5315
5344
|
checked: Boolean,
|
5316
|
-
bindGroup: truthProp
|
5345
|
+
bindGroup: truthProp,
|
5346
|
+
indeterminate: {
|
5347
|
+
type: Boolean,
|
5348
|
+
default: null
|
5349
|
+
}
|
5317
5350
|
}),
|
5318
5351
|
emits: ["click", "toggle"],
|
5319
5352
|
setup(props2, {
|
@@ -5367,14 +5400,16 @@ var stdin_default$1n = defineComponent({
|
|
5367
5400
|
var _a, _b;
|
5368
5401
|
const {
|
5369
5402
|
bem: bem2,
|
5370
|
-
checked
|
5403
|
+
checked,
|
5404
|
+
indeterminate
|
5371
5405
|
} = props2;
|
5372
5406
|
const iconSize = props2.iconSize || getParentProp("iconSize");
|
5373
5407
|
return createVNode("div", {
|
5374
5408
|
"ref": iconRef,
|
5375
5409
|
"class": bem2("icon", [shape.value, {
|
5376
5410
|
disabled: disabled.value,
|
5377
|
-
checked
|
5411
|
+
checked,
|
5412
|
+
indeterminate
|
5378
5413
|
}]),
|
5379
5414
|
"style": shape.value !== "dot" ? {
|
5380
5415
|
fontSize: addUnit(iconSize)
|
@@ -5387,7 +5422,7 @@ var stdin_default$1n = defineComponent({
|
|
5387
5422
|
checked,
|
5388
5423
|
disabled: disabled.value
|
5389
5424
|
}) : shape.value !== "dot" ? createVNode(Icon, {
|
5390
|
-
"name": "success",
|
5425
|
+
"name": indeterminate ? "minus" : "success",
|
5391
5426
|
"style": iconStyle.value
|
5392
5427
|
}, null) : createVNode("div", {
|
5393
5428
|
"class": bem2("icon--dot__icon"),
|
@@ -7483,7 +7518,11 @@ var stdin_default$19 = defineComponent({
|
|
7483
7518
|
const [name$$, bem$_] = createNamespace("checkbox");
|
7484
7519
|
const checkboxProps = extend({}, checkerProps, {
|
7485
7520
|
shape: String,
|
7486
|
-
bindGroup: truthProp
|
7521
|
+
bindGroup: truthProp,
|
7522
|
+
indeterminate: {
|
7523
|
+
type: Boolean,
|
7524
|
+
default: null
|
7525
|
+
}
|
7487
7526
|
});
|
7488
7527
|
var stdin_default$18 = defineComponent({
|
7489
7528
|
name: name$$,
|
@@ -7535,8 +7574,13 @@ var stdin_default$18 = defineComponent({
|
|
7535
7574
|
} else {
|
7536
7575
|
emit("update:modelValue", newValue);
|
7537
7576
|
}
|
7577
|
+
if (props2.indeterminate !== null)
|
7578
|
+
emit("change", newValue);
|
7538
7579
|
};
|
7539
|
-
watch(() => props2.modelValue, (value) =>
|
7580
|
+
watch(() => props2.modelValue, (value) => {
|
7581
|
+
if (props2.indeterminate === null)
|
7582
|
+
emit("change", value);
|
7583
|
+
});
|
7540
7584
|
useExpose({
|
7541
7585
|
toggle,
|
7542
7586
|
props: props2,
|
@@ -9637,7 +9681,7 @@ var stdin_default$S = defineComponent({
|
|
9637
9681
|
};
|
9638
9682
|
return createVNode(Cell, {
|
9639
9683
|
"role": "menuitem",
|
9640
|
-
"key": option.value,
|
9684
|
+
"key": String(option.value),
|
9641
9685
|
"icon": option.icon,
|
9642
9686
|
"title": option.text,
|
9643
9687
|
"class": bem$J("option", {
|
@@ -9772,6 +9816,8 @@ var stdin_default$R = defineComponent({
|
|
9772
9816
|
return style;
|
9773
9817
|
});
|
9774
9818
|
const updateState = () => {
|
9819
|
+
if (!show.value)
|
9820
|
+
return;
|
9775
9821
|
const {
|
9776
9822
|
width,
|
9777
9823
|
height
|
@@ -9847,6 +9893,8 @@ var stdin_default$R = defineComponent({
|
|
9847
9893
|
const onClick = (e) => {
|
9848
9894
|
if (touch.isTap.value)
|
9849
9895
|
emit("click", e);
|
9896
|
+
else
|
9897
|
+
e.stopPropagation();
|
9850
9898
|
};
|
9851
9899
|
onMounted(() => {
|
9852
9900
|
updateState();
|
@@ -9871,7 +9919,7 @@ var stdin_default$R = defineComponent({
|
|
9871
9919
|
"onTouchstartPassive": onTouchStart,
|
9872
9920
|
"onTouchend": onTouchEnd,
|
9873
9921
|
"onTouchcancel": onTouchEnd,
|
9874
|
-
"
|
9922
|
+
"onClickCapture": onClick,
|
9875
9923
|
"style": rootStyle.value
|
9876
9924
|
}, attrs), [slots.default ? slots.default() : createVNode(stdin_default$1P, {
|
9877
9925
|
"name": props2.icon,
|
@@ -16407,7 +16455,7 @@ const Lazyload = {
|
|
16407
16455
|
});
|
16408
16456
|
}
|
16409
16457
|
};
|
16410
|
-
const version = "4.6.
|
16458
|
+
const version = "4.6.7";
|
16411
16459
|
function install(app) {
|
16412
16460
|
const components = [
|
16413
16461
|
ActionBar,
|
package/lib/vant.js
CHANGED
@@ -1017,6 +1017,7 @@
|
|
1017
1017
|
themeVars: Object,
|
1018
1018
|
themeVarsDark: Object,
|
1019
1019
|
themeVarsLight: Object,
|
1020
|
+
themeVarsScope: makeStringProp("local"),
|
1020
1021
|
iconPrefix: String
|
1021
1022
|
};
|
1022
1023
|
function mapThemeVarsToCSSVars(themeVars) {
|
@@ -1026,6 +1027,18 @@
|
|
1026
1027
|
});
|
1027
1028
|
return cssVars;
|
1028
1029
|
}
|
1030
|
+
function syncThemeVarsOnRoot(newStyle = {}, oldStyle = {}) {
|
1031
|
+
Object.keys(newStyle).forEach((key) => {
|
1032
|
+
if (newStyle[key] !== oldStyle[key]) {
|
1033
|
+
document.documentElement.style.setProperty(key, newStyle[key]);
|
1034
|
+
}
|
1035
|
+
});
|
1036
|
+
Object.keys(oldStyle).forEach((key) => {
|
1037
|
+
if (!newStyle[key]) {
|
1038
|
+
document.documentElement.style.removeProperty(key);
|
1039
|
+
}
|
1040
|
+
});
|
1041
|
+
}
|
1029
1042
|
var stdin_default$1R = vue.defineComponent({
|
1030
1043
|
name: name$1H,
|
1031
1044
|
props: configProviderProps,
|
@@ -1051,6 +1064,22 @@
|
|
1051
1064
|
vue.onActivated(addTheme);
|
1052
1065
|
vue.onDeactivated(removeTheme);
|
1053
1066
|
vue.onBeforeUnmount(removeTheme);
|
1067
|
+
vue.watch(style, (newStyle, oldStyle) => {
|
1068
|
+
if (props2.themeVarsScope === "global") {
|
1069
|
+
syncThemeVarsOnRoot(newStyle, oldStyle);
|
1070
|
+
}
|
1071
|
+
});
|
1072
|
+
vue.watch(() => props2.themeVarsScope, (newScope, oldScope) => {
|
1073
|
+
if (oldScope === "global") {
|
1074
|
+
syncThemeVarsOnRoot({}, style.value);
|
1075
|
+
}
|
1076
|
+
if (newScope === "global") {
|
1077
|
+
syncThemeVarsOnRoot(style.value, {});
|
1078
|
+
}
|
1079
|
+
});
|
1080
|
+
if (props2.themeVarsScope === "global") {
|
1081
|
+
syncThemeVarsOnRoot(style.value, {});
|
1082
|
+
}
|
1054
1083
|
}
|
1055
1084
|
vue.provide(CONFIG_PROVIDER_KEY, props2);
|
1056
1085
|
vue.watchEffect(() => {
|
@@ -1060,7 +1089,7 @@
|
|
1060
1089
|
});
|
1061
1090
|
return () => vue.createVNode(props2.tag, {
|
1062
1091
|
"class": bem$1C(),
|
1063
|
-
"style": style.value
|
1092
|
+
"style": props2.themeVarsScope === "local" ? style.value : void 0
|
1064
1093
|
}, {
|
1065
1094
|
default: () => {
|
1066
1095
|
var _a;
|
@@ -5774,7 +5803,11 @@
|
|
5774
5803
|
shape: String,
|
5775
5804
|
parent: Object,
|
5776
5805
|
checked: Boolean,
|
5777
|
-
bindGroup: truthProp
|
5806
|
+
bindGroup: truthProp,
|
5807
|
+
indeterminate: {
|
5808
|
+
type: Boolean,
|
5809
|
+
default: null
|
5810
|
+
}
|
5778
5811
|
}),
|
5779
5812
|
emits: ["click", "toggle"],
|
5780
5813
|
setup(props2, {
|
@@ -5828,14 +5861,16 @@
|
|
5828
5861
|
var _a, _b;
|
5829
5862
|
const {
|
5830
5863
|
bem: bem2,
|
5831
|
-
checked
|
5864
|
+
checked,
|
5865
|
+
indeterminate
|
5832
5866
|
} = props2;
|
5833
5867
|
const iconSize = props2.iconSize || getParentProp("iconSize");
|
5834
5868
|
return vue.createVNode("div", {
|
5835
5869
|
"ref": iconRef,
|
5836
5870
|
"class": bem2("icon", [shape.value, {
|
5837
5871
|
disabled: disabled.value,
|
5838
|
-
checked
|
5872
|
+
checked,
|
5873
|
+
indeterminate
|
5839
5874
|
}]),
|
5840
5875
|
"style": shape.value !== "dot" ? {
|
5841
5876
|
fontSize: addUnit(iconSize)
|
@@ -5848,7 +5883,7 @@
|
|
5848
5883
|
checked,
|
5849
5884
|
disabled: disabled.value
|
5850
5885
|
}) : shape.value !== "dot" ? vue.createVNode(Icon, {
|
5851
|
-
"name": "success",
|
5886
|
+
"name": indeterminate ? "minus" : "success",
|
5852
5887
|
"style": iconStyle.value
|
5853
5888
|
}, null) : vue.createVNode("div", {
|
5854
5889
|
"class": bem2("icon--dot__icon"),
|
@@ -7941,7 +7976,11 @@
|
|
7941
7976
|
const [name$$, bem$_] = createNamespace("checkbox");
|
7942
7977
|
const checkboxProps = extend({}, checkerProps, {
|
7943
7978
|
shape: String,
|
7944
|
-
bindGroup: truthProp
|
7979
|
+
bindGroup: truthProp,
|
7980
|
+
indeterminate: {
|
7981
|
+
type: Boolean,
|
7982
|
+
default: null
|
7983
|
+
}
|
7945
7984
|
});
|
7946
7985
|
var stdin_default$18 = vue.defineComponent({
|
7947
7986
|
name: name$$,
|
@@ -7993,8 +8032,13 @@
|
|
7993
8032
|
} else {
|
7994
8033
|
emit("update:modelValue", newValue);
|
7995
8034
|
}
|
8035
|
+
if (props2.indeterminate !== null)
|
8036
|
+
emit("change", newValue);
|
7996
8037
|
};
|
7997
|
-
vue.watch(() => props2.modelValue, (value) =>
|
8038
|
+
vue.watch(() => props2.modelValue, (value) => {
|
8039
|
+
if (props2.indeterminate === null)
|
8040
|
+
emit("change", value);
|
8041
|
+
});
|
7998
8042
|
useExpose({
|
7999
8043
|
toggle,
|
8000
8044
|
props: props2,
|
@@ -10072,7 +10116,7 @@
|
|
10072
10116
|
};
|
10073
10117
|
return vue.createVNode(Cell, {
|
10074
10118
|
"role": "menuitem",
|
10075
|
-
"key": option.value,
|
10119
|
+
"key": String(option.value),
|
10076
10120
|
"icon": option.icon,
|
10077
10121
|
"title": option.text,
|
10078
10122
|
"class": bem$J("option", {
|
@@ -10207,6 +10251,8 @@
|
|
10207
10251
|
return style;
|
10208
10252
|
});
|
10209
10253
|
const updateState = () => {
|
10254
|
+
if (!show.value)
|
10255
|
+
return;
|
10210
10256
|
const {
|
10211
10257
|
width: width2,
|
10212
10258
|
height: height2
|
@@ -10282,6 +10328,8 @@
|
|
10282
10328
|
const onClick = (e) => {
|
10283
10329
|
if (touch.isTap.value)
|
10284
10330
|
emit("click", e);
|
10331
|
+
else
|
10332
|
+
e.stopPropagation();
|
10285
10333
|
};
|
10286
10334
|
vue.onMounted(() => {
|
10287
10335
|
updateState();
|
@@ -10306,7 +10354,7 @@
|
|
10306
10354
|
"onTouchstartPassive": onTouchStart,
|
10307
10355
|
"onTouchend": onTouchEnd,
|
10308
10356
|
"onTouchcancel": onTouchEnd,
|
10309
|
-
"
|
10357
|
+
"onClickCapture": onClick,
|
10310
10358
|
"style": rootStyle.value
|
10311
10359
|
}, attrs), [slots.default ? slots.default() : vue.createVNode(stdin_default$1P, {
|
10312
10360
|
"name": props2.icon,
|
@@ -17619,7 +17667,7 @@
|
|
17619
17667
|
});
|
17620
17668
|
}
|
17621
17669
|
};
|
17622
|
-
const version = "4.6.
|
17670
|
+
const version = "4.6.7";
|
17623
17671
|
function install(app) {
|
17624
17672
|
const components = [
|
17625
17673
|
ActionBar,
|