vant 4.8.11 → 4.9.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 +11 -8
- package/es/address-list/AddressList.d.ts +13 -13
- package/es/address-list/AddressList.mjs +20 -4
- package/es/address-list/AddressListItem.d.ts +3 -0
- package/es/address-list/AddressListItem.mjs +19 -7
- package/es/address-list/index.d.ts +2 -2
- package/es/address-list/style/index.mjs +1 -0
- package/es/area/utils.mjs +3 -3
- package/es/calendar/Calendar.d.ts +16 -10
- package/es/calendar/Calendar.mjs +83 -53
- package/es/calendar/CalendarHeader.d.ts +16 -1
- package/es/calendar/CalendarHeader.mjs +71 -7
- package/es/calendar/CalendarMonth.d.ts +6 -24
- package/es/calendar/CalendarMonth.mjs +6 -4
- package/es/calendar/index.css +1 -1
- package/es/calendar/index.d.ts +11 -7
- package/es/calendar/types.d.ts +4 -0
- package/es/calendar/utils.d.ts +6 -0
- package/es/calendar/utils.mjs +20 -0
- package/es/floating-panel/FloatingPanel.mjs +11 -5
- package/es/highlight/Highlight.mjs +7 -0
- package/es/image-preview/ImagePreviewItem.mjs +2 -0
- package/es/index-bar/IndexBar.mjs +10 -2
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/picker-group/PickerGroup.d.ts +13 -0
- package/es/picker-group/PickerGroup.mjs +5 -4
- package/es/picker-group/index.d.ts +9 -0
- package/es/stepper/Stepper.mjs +1 -0
- package/es/tabs/index.css +1 -1
- package/es/utils/basic.d.ts +1 -1
- package/lib/address-list/AddressList.d.ts +13 -13
- package/lib/address-list/AddressList.js +19 -3
- package/lib/address-list/AddressListItem.d.ts +3 -0
- package/lib/address-list/AddressListItem.js +19 -7
- package/lib/address-list/index.d.ts +2 -2
- package/lib/address-list/style/index.js +1 -0
- package/lib/area/utils.js +3 -3
- package/lib/calendar/Calendar.d.ts +16 -10
- package/lib/calendar/Calendar.js +82 -52
- package/lib/calendar/CalendarHeader.d.ts +16 -1
- package/lib/calendar/CalendarHeader.js +68 -4
- package/lib/calendar/CalendarMonth.d.ts +6 -24
- package/lib/calendar/CalendarMonth.js +6 -4
- package/lib/calendar/index.css +1 -1
- package/lib/calendar/index.d.ts +11 -7
- package/lib/calendar/types.d.ts +4 -0
- package/lib/calendar/utils.d.ts +6 -0
- package/lib/calendar/utils.js +20 -0
- package/lib/floating-panel/FloatingPanel.js +11 -5
- package/lib/highlight/Highlight.js +7 -0
- package/lib/image-preview/ImagePreviewItem.js +2 -0
- package/lib/index-bar/IndexBar.js +10 -2
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/picker-group/PickerGroup.d.ts +13 -0
- package/lib/picker-group/PickerGroup.js +4 -3
- package/lib/picker-group/index.d.ts +9 -0
- package/lib/stepper/Stepper.js +1 -0
- package/lib/tabs/index.css +1 -1
- package/lib/utils/basic.d.ts +1 -1
- package/lib/vant.cjs.js +516 -356
- package/lib/vant.es.js +516 -356
- package/lib/vant.js +518 -358
- package/lib/vant.min.js +3 -3
- package/lib/web-types.json +1 -1
- package/package.json +17 -17
package/lib/vant.js
CHANGED
@@ -2369,7 +2369,7 @@
|
|
2369
2369
|
return propRef;
|
2370
2370
|
};
|
2371
2371
|
/**
|
2372
|
-
* @vue/shared v3.4.
|
2372
|
+
* @vue/shared v3.4.27
|
2373
2373
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
2374
2374
|
* @license MIT
|
2375
2375
|
**/
|
@@ -2424,8 +2424,8 @@
|
|
2424
2424
|
}
|
2425
2425
|
for (const key in styles) {
|
2426
2426
|
const value = styles[key];
|
2427
|
-
const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
|
2428
2427
|
if (isString(value) || typeof value === "number") {
|
2428
|
+
const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
|
2429
2429
|
ret += `${normalizedKey}:${value};`;
|
2430
2430
|
}
|
2431
2431
|
}
|
@@ -3734,7 +3734,8 @@
|
|
3734
3734
|
const pickerGroupProps = extend({
|
3735
3735
|
tabs: makeArrayProp(),
|
3736
3736
|
activeTab: makeNumericProp(0),
|
3737
|
-
nextStepText: String
|
3737
|
+
nextStepText: String,
|
3738
|
+
showToolbar: truthProp
|
3738
3739
|
}, pickerToolbarProps);
|
3739
3740
|
var stdin_default$1A = vue.defineComponent({
|
3740
3741
|
name: name$1p,
|
@@ -3773,13 +3774,13 @@
|
|
3773
3774
|
const confirmButtonText = showNextButton() ? props2.nextStepText : props2.confirmButtonText;
|
3774
3775
|
return vue.createVNode("div", {
|
3775
3776
|
"class": bem$1l()
|
3776
|
-
}, [vue.createVNode(stdin_default$1H, {
|
3777
|
+
}, [props2.showToolbar ? vue.createVNode(stdin_default$1H, {
|
3777
3778
|
"title": props2.title,
|
3778
3779
|
"cancelButtonText": props2.cancelButtonText,
|
3779
3780
|
"confirmButtonText": confirmButtonText,
|
3780
3781
|
"onConfirm": onConfirm,
|
3781
3782
|
"onCancel": onCancel
|
3782
|
-
}, pick(slots, pickerToolbarSlots)), vue.createVNode(Tabs, {
|
3783
|
+
}, pick(slots, pickerToolbarSlots)) : null, vue.createVNode(Tabs, {
|
3783
3784
|
"active": activeTab.value,
|
3784
3785
|
"onUpdate:active": ($event) => activeTab.value = $event,
|
3785
3786
|
"class": bem$1l("tabs"),
|
@@ -4032,9 +4033,9 @@
|
|
4032
4033
|
const showCounty = +columnsNum > 2;
|
4033
4034
|
const getProvinceChildren = () => {
|
4034
4035
|
if (showCity) {
|
4035
|
-
return placeholder.length ? [
|
4036
|
+
return placeholder.length > 1 ? [
|
4036
4037
|
makeOption(
|
4037
|
-
placeholder[
|
4038
|
+
placeholder[1],
|
4038
4039
|
AREA_EMPTY_CODE,
|
4039
4040
|
showCounty ? [] : void 0
|
4040
4041
|
)
|
@@ -4052,7 +4053,7 @@
|
|
4052
4053
|
if (showCity) {
|
4053
4054
|
const getCityChildren = () => {
|
4054
4055
|
if (showCounty) {
|
4055
|
-
return placeholder.length ? [makeOption(placeholder[
|
4056
|
+
return placeholder.length > 2 ? [makeOption(placeholder[2])] : [];
|
4056
4057
|
}
|
4057
4058
|
};
|
4058
4059
|
Object.keys(city).forEach((code) => {
|
@@ -5790,7 +5791,71 @@
|
|
5790
5791
|
}
|
5791
5792
|
});
|
5792
5793
|
const RadioGroup = withInstall(stdin_default$1q);
|
5793
|
-
const [name$1f, bem$1b] = createNamespace("
|
5794
|
+
const [name$1f, bem$1b] = createNamespace("checkbox-group");
|
5795
|
+
const checkboxGroupProps = {
|
5796
|
+
max: numericProp,
|
5797
|
+
shape: makeStringProp("round"),
|
5798
|
+
disabled: Boolean,
|
5799
|
+
iconSize: numericProp,
|
5800
|
+
direction: String,
|
5801
|
+
modelValue: makeArrayProp(),
|
5802
|
+
checkedColor: String
|
5803
|
+
};
|
5804
|
+
const CHECKBOX_GROUP_KEY = Symbol(name$1f);
|
5805
|
+
var stdin_default$1p = vue.defineComponent({
|
5806
|
+
name: name$1f,
|
5807
|
+
props: checkboxGroupProps,
|
5808
|
+
emits: ["change", "update:modelValue"],
|
5809
|
+
setup(props2, {
|
5810
|
+
emit,
|
5811
|
+
slots
|
5812
|
+
}) {
|
5813
|
+
const {
|
5814
|
+
children,
|
5815
|
+
linkChildren
|
5816
|
+
} = useChildren(CHECKBOX_GROUP_KEY);
|
5817
|
+
const updateValue = (value) => emit("update:modelValue", value);
|
5818
|
+
const toggleAll = (options = {}) => {
|
5819
|
+
if (typeof options === "boolean") {
|
5820
|
+
options = {
|
5821
|
+
checked: options
|
5822
|
+
};
|
5823
|
+
}
|
5824
|
+
const {
|
5825
|
+
checked,
|
5826
|
+
skipDisabled
|
5827
|
+
} = options;
|
5828
|
+
const checkedChildren = children.filter((item) => {
|
5829
|
+
if (!item.props.bindGroup) {
|
5830
|
+
return false;
|
5831
|
+
}
|
5832
|
+
if (item.props.disabled && skipDisabled) {
|
5833
|
+
return item.checked.value;
|
5834
|
+
}
|
5835
|
+
return checked != null ? checked : !item.checked.value;
|
5836
|
+
});
|
5837
|
+
const names = checkedChildren.map((item) => item.name);
|
5838
|
+
updateValue(names);
|
5839
|
+
};
|
5840
|
+
vue.watch(() => props2.modelValue, (value) => emit("change", value));
|
5841
|
+
useExpose({
|
5842
|
+
toggleAll
|
5843
|
+
});
|
5844
|
+
useCustomFieldValue(() => props2.modelValue);
|
5845
|
+
linkChildren({
|
5846
|
+
props: props2,
|
5847
|
+
updateValue
|
5848
|
+
});
|
5849
|
+
return () => {
|
5850
|
+
var _a;
|
5851
|
+
return vue.createVNode("div", {
|
5852
|
+
"class": bem$1b([props2.direction])
|
5853
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
5854
|
+
};
|
5855
|
+
}
|
5856
|
+
});
|
5857
|
+
const CheckboxGroup = withInstall(stdin_default$1p);
|
5858
|
+
const [name$1e, bem$1a] = createNamespace("tag");
|
5794
5859
|
const tagProps = {
|
5795
5860
|
size: String,
|
5796
5861
|
mark: Boolean,
|
@@ -5802,8 +5867,8 @@
|
|
5802
5867
|
textColor: String,
|
5803
5868
|
closeable: Boolean
|
5804
5869
|
};
|
5805
|
-
var stdin_default$
|
5806
|
-
name: name$
|
5870
|
+
var stdin_default$1o = vue.defineComponent({
|
5871
|
+
name: name$1e,
|
5807
5872
|
props: tagProps,
|
5808
5873
|
emits: ["close"],
|
5809
5874
|
setup(props2, {
|
@@ -5846,12 +5911,12 @@
|
|
5846
5911
|
}
|
5847
5912
|
const CloseIcon = closeable && vue.createVNode(Icon, {
|
5848
5913
|
"name": "cross",
|
5849
|
-
"class": [bem$
|
5914
|
+
"class": [bem$1a("close"), HAPTICS_FEEDBACK],
|
5850
5915
|
"onClick": onClose
|
5851
5916
|
}, null);
|
5852
5917
|
return vue.createVNode("span", {
|
5853
5918
|
"style": getStyle(),
|
5854
|
-
"class": bem$
|
5919
|
+
"class": bem$1a([classes, type])
|
5855
5920
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots), CloseIcon]);
|
5856
5921
|
};
|
5857
5922
|
return () => vue.createVNode(vue.Transition, {
|
@@ -5861,7 +5926,7 @@
|
|
5861
5926
|
});
|
5862
5927
|
}
|
5863
5928
|
});
|
5864
|
-
const Tag = withInstall(stdin_default$
|
5929
|
+
const Tag = withInstall(stdin_default$1o);
|
5865
5930
|
const checkerProps = {
|
5866
5931
|
name: unknownProp,
|
5867
5932
|
disabled: Boolean,
|
@@ -5871,7 +5936,7 @@
|
|
5871
5936
|
labelPosition: String,
|
5872
5937
|
labelDisabled: Boolean
|
5873
5938
|
};
|
5874
|
-
var stdin_default$
|
5939
|
+
var stdin_default$1n = vue.defineComponent({
|
5875
5940
|
props: extend({}, checkerProps, {
|
5876
5941
|
bem: makeRequiredProp(Function),
|
5877
5942
|
role: String,
|
@@ -6000,9 +6065,9 @@
|
|
6000
6065
|
const radioProps = extend({}, checkerProps, {
|
6001
6066
|
shape: String
|
6002
6067
|
});
|
6003
|
-
const [name$
|
6004
|
-
var stdin_default$
|
6005
|
-
name: name$
|
6068
|
+
const [name$1d, bem$19] = createNamespace("radio");
|
6069
|
+
var stdin_default$1m = vue.defineComponent({
|
6070
|
+
name: name$1d,
|
6006
6071
|
props: radioProps,
|
6007
6072
|
emits: ["update:modelValue"],
|
6008
6073
|
setup(props2, {
|
@@ -6023,8 +6088,8 @@
|
|
6023
6088
|
emit("update:modelValue", props2.name);
|
6024
6089
|
}
|
6025
6090
|
};
|
6026
|
-
return () => vue.createVNode(stdin_default$
|
6027
|
-
"bem": bem$
|
6091
|
+
return () => vue.createVNode(stdin_default$1n, vue.mergeProps({
|
6092
|
+
"bem": bem$19,
|
6028
6093
|
"role": "radio",
|
6029
6094
|
"parent": parent,
|
6030
6095
|
"checked": checked(),
|
@@ -6032,14 +6097,97 @@
|
|
6032
6097
|
}, props2), pick(slots, ["default", "icon"]));
|
6033
6098
|
}
|
6034
6099
|
});
|
6035
|
-
const Radio = withInstall(stdin_default$
|
6036
|
-
const [name$
|
6037
|
-
|
6038
|
-
|
6100
|
+
const Radio = withInstall(stdin_default$1m);
|
6101
|
+
const [name$1c, bem$18] = createNamespace("checkbox");
|
6102
|
+
const checkboxProps = extend({}, checkerProps, {
|
6103
|
+
shape: String,
|
6104
|
+
bindGroup: truthProp,
|
6105
|
+
indeterminate: {
|
6106
|
+
type: Boolean,
|
6107
|
+
default: null
|
6108
|
+
}
|
6109
|
+
});
|
6110
|
+
var stdin_default$1l = vue.defineComponent({
|
6111
|
+
name: name$1c,
|
6112
|
+
props: checkboxProps,
|
6113
|
+
emits: ["change", "update:modelValue"],
|
6114
|
+
setup(props2, {
|
6115
|
+
emit,
|
6116
|
+
slots
|
6117
|
+
}) {
|
6118
|
+
const {
|
6119
|
+
parent
|
6120
|
+
} = useParent(CHECKBOX_GROUP_KEY);
|
6121
|
+
const setParentValue = (checked2) => {
|
6122
|
+
const {
|
6123
|
+
name: name2
|
6124
|
+
} = props2;
|
6125
|
+
const {
|
6126
|
+
max,
|
6127
|
+
modelValue
|
6128
|
+
} = parent.props;
|
6129
|
+
const value = modelValue.slice();
|
6130
|
+
if (checked2) {
|
6131
|
+
const overlimit = max && value.length >= +max;
|
6132
|
+
if (!overlimit && !value.includes(name2)) {
|
6133
|
+
value.push(name2);
|
6134
|
+
if (props2.bindGroup) {
|
6135
|
+
parent.updateValue(value);
|
6136
|
+
}
|
6137
|
+
}
|
6138
|
+
} else {
|
6139
|
+
const index = value.indexOf(name2);
|
6140
|
+
if (index !== -1) {
|
6141
|
+
value.splice(index, 1);
|
6142
|
+
if (props2.bindGroup) {
|
6143
|
+
parent.updateValue(value);
|
6144
|
+
}
|
6145
|
+
}
|
6146
|
+
}
|
6147
|
+
};
|
6148
|
+
const checked = vue.computed(() => {
|
6149
|
+
if (parent && props2.bindGroup) {
|
6150
|
+
return parent.props.modelValue.indexOf(props2.name) !== -1;
|
6151
|
+
}
|
6152
|
+
return !!props2.modelValue;
|
6153
|
+
});
|
6154
|
+
const toggle = (newValue = !checked.value) => {
|
6155
|
+
if (parent && props2.bindGroup) {
|
6156
|
+
setParentValue(newValue);
|
6157
|
+
} else {
|
6158
|
+
emit("update:modelValue", newValue);
|
6159
|
+
}
|
6160
|
+
if (props2.indeterminate !== null)
|
6161
|
+
emit("change", newValue);
|
6162
|
+
};
|
6163
|
+
vue.watch(() => props2.modelValue, (value) => {
|
6164
|
+
if (props2.indeterminate === null)
|
6165
|
+
emit("change", value);
|
6166
|
+
});
|
6167
|
+
useExpose({
|
6168
|
+
toggle,
|
6169
|
+
props: props2,
|
6170
|
+
checked
|
6171
|
+
});
|
6172
|
+
useCustomFieldValue(() => props2.modelValue);
|
6173
|
+
return () => vue.createVNode(stdin_default$1n, vue.mergeProps({
|
6174
|
+
"bem": bem$18,
|
6175
|
+
"role": "checkbox",
|
6176
|
+
"parent": parent,
|
6177
|
+
"checked": checked.value,
|
6178
|
+
"onToggle": toggle
|
6179
|
+
}, props2), pick(slots, ["default", "icon"]));
|
6180
|
+
}
|
6181
|
+
});
|
6182
|
+
const Checkbox = withInstall(stdin_default$1l);
|
6183
|
+
const [name$1b, bem$17] = createNamespace("address-item");
|
6184
|
+
var stdin_default$1k = vue.defineComponent({
|
6185
|
+
name: name$1b,
|
6039
6186
|
props: {
|
6040
6187
|
address: makeRequiredProp(Object),
|
6041
6188
|
disabled: Boolean,
|
6042
6189
|
switchable: Boolean,
|
6190
|
+
singleChoice: Boolean,
|
6043
6191
|
defaultTagText: String,
|
6044
6192
|
rightIcon: makeStringProp("edit")
|
6045
6193
|
},
|
@@ -6056,7 +6204,7 @@
|
|
6056
6204
|
};
|
6057
6205
|
const renderRightIcon = () => vue.createVNode(Icon, {
|
6058
6206
|
"name": props2.rightIcon,
|
6059
|
-
"class": bem$
|
6207
|
+
"class": bem$17("edit"),
|
6060
6208
|
"onClick": (event) => {
|
6061
6209
|
event.stopPropagation();
|
6062
6210
|
emit("edit");
|
@@ -6071,7 +6219,7 @@
|
|
6071
6219
|
return vue.createVNode(Tag, {
|
6072
6220
|
"type": "primary",
|
6073
6221
|
"round": true,
|
6074
|
-
"class": bem$
|
6222
|
+
"class": bem$17("tag")
|
6075
6223
|
}, {
|
6076
6224
|
default: () => [props2.defaultTagText]
|
6077
6225
|
});
|
@@ -6081,20 +6229,30 @@
|
|
6081
6229
|
const {
|
6082
6230
|
address,
|
6083
6231
|
disabled,
|
6084
|
-
switchable
|
6232
|
+
switchable,
|
6233
|
+
singleChoice
|
6085
6234
|
} = props2;
|
6086
6235
|
const Info = [vue.createVNode("div", {
|
6087
|
-
"class": bem$
|
6236
|
+
"class": bem$17("name")
|
6088
6237
|
}, [`${address.name} ${address.tel}`, renderTag()]), vue.createVNode("div", {
|
6089
|
-
"class": bem$
|
6238
|
+
"class": bem$17("address")
|
6090
6239
|
}, [address.address])];
|
6091
6240
|
if (switchable && !disabled) {
|
6092
|
-
|
6093
|
-
|
6094
|
-
|
6095
|
-
|
6096
|
-
|
6097
|
-
|
6241
|
+
if (singleChoice) {
|
6242
|
+
return vue.createVNode(Radio, {
|
6243
|
+
"name": address.id,
|
6244
|
+
"iconSize": 18
|
6245
|
+
}, {
|
6246
|
+
default: () => [Info]
|
6247
|
+
});
|
6248
|
+
} else {
|
6249
|
+
return vue.createVNode(Checkbox, {
|
6250
|
+
"name": address.id,
|
6251
|
+
"iconSize": 18
|
6252
|
+
}, {
|
6253
|
+
default: () => [Info]
|
6254
|
+
});
|
6255
|
+
}
|
6098
6256
|
}
|
6099
6257
|
return Info;
|
6100
6258
|
};
|
@@ -6104,13 +6262,13 @@
|
|
6104
6262
|
disabled
|
6105
6263
|
} = props2;
|
6106
6264
|
return vue.createVNode("div", {
|
6107
|
-
"class": bem$
|
6265
|
+
"class": bem$17({
|
6108
6266
|
disabled
|
6109
6267
|
}),
|
6110
6268
|
"onClick": onClick
|
6111
6269
|
}, [vue.createVNode(Cell, {
|
6112
6270
|
"border": false,
|
6113
|
-
"titleClass": bem$
|
6271
|
+
"titleClass": bem$17("title")
|
6114
6272
|
}, {
|
6115
6273
|
title: renderContent,
|
6116
6274
|
"right-icon": renderRightIcon
|
@@ -6120,10 +6278,10 @@
|
|
6120
6278
|
};
|
6121
6279
|
}
|
6122
6280
|
});
|
6123
|
-
const [name$
|
6281
|
+
const [name$1a, bem$16, t$h] = createNamespace("address-list");
|
6124
6282
|
const addressListProps = {
|
6125
6283
|
list: makeArrayProp(),
|
6126
|
-
modelValue: numericProp,
|
6284
|
+
modelValue: [...numericProp, Array],
|
6127
6285
|
switchable: truthProp,
|
6128
6286
|
disabledText: String,
|
6129
6287
|
disabledList: makeArrayProp(),
|
@@ -6132,14 +6290,15 @@
|
|
6132
6290
|
defaultTagText: String,
|
6133
6291
|
rightIcon: makeStringProp("edit")
|
6134
6292
|
};
|
6135
|
-
var stdin_default$
|
6136
|
-
name: name$
|
6293
|
+
var stdin_default$1j = vue.defineComponent({
|
6294
|
+
name: name$1a,
|
6137
6295
|
props: addressListProps,
|
6138
6296
|
emits: ["add", "edit", "select", "clickItem", "editDisabled", "selectDisabled", "update:modelValue"],
|
6139
6297
|
setup(props2, {
|
6140
6298
|
slots,
|
6141
6299
|
emit
|
6142
6300
|
}) {
|
6301
|
+
const singleChoice = vue.computed(() => !Array.isArray(props2.modelValue));
|
6143
6302
|
const renderItem = (item, index, disabled) => {
|
6144
6303
|
const onEdit = () => emit(disabled ? "editDisabled" : "edit", item, index);
|
6145
6304
|
const onClick = (event) => emit("clickItem", item, index, {
|
@@ -6148,14 +6307,24 @@
|
|
6148
6307
|
const onSelect = () => {
|
6149
6308
|
emit(disabled ? "selectDisabled" : "select", item, index);
|
6150
6309
|
if (!disabled) {
|
6151
|
-
|
6310
|
+
if (singleChoice.value) {
|
6311
|
+
emit("update:modelValue", item.id);
|
6312
|
+
} else {
|
6313
|
+
const value = props2.modelValue;
|
6314
|
+
if (value.includes(item.id)) {
|
6315
|
+
emit("update:modelValue", value.filter((id) => id !== item.id));
|
6316
|
+
} else {
|
6317
|
+
emit("update:modelValue", [...value, item.id]);
|
6318
|
+
}
|
6319
|
+
}
|
6152
6320
|
}
|
6153
6321
|
};
|
6154
|
-
return vue.createVNode(stdin_default$
|
6322
|
+
return vue.createVNode(stdin_default$1k, {
|
6155
6323
|
"key": item.id,
|
6156
6324
|
"address": item,
|
6157
6325
|
"disabled": disabled,
|
6158
6326
|
"switchable": props2.switchable,
|
6327
|
+
"singleChoice": singleChoice.value,
|
6159
6328
|
"defaultTagText": props2.defaultTagText,
|
6160
6329
|
"rightIcon": props2.rightIcon,
|
6161
6330
|
"onEdit": onEdit,
|
@@ -6172,13 +6341,13 @@
|
|
6172
6341
|
}
|
6173
6342
|
};
|
6174
6343
|
const renderBottom = () => props2.showAddButton ? vue.createVNode("div", {
|
6175
|
-
"class": [bem$
|
6344
|
+
"class": [bem$16("bottom"), "van-safe-area-bottom"]
|
6176
6345
|
}, [vue.createVNode(Button, {
|
6177
6346
|
"round": true,
|
6178
6347
|
"block": true,
|
6179
6348
|
"type": "primary",
|
6180
6349
|
"text": props2.addButtonText || t$h("add"),
|
6181
|
-
"class": bem$
|
6350
|
+
"class": bem$16("add"),
|
6182
6351
|
"onClick": () => emit("add")
|
6183
6352
|
}, null)]) : void 0;
|
6184
6353
|
return () => {
|
@@ -6186,11 +6355,15 @@
|
|
6186
6355
|
const List2 = renderList(props2.list);
|
6187
6356
|
const DisabledList = renderList(props2.disabledList, true);
|
6188
6357
|
const DisabledText = props2.disabledText && vue.createVNode("div", {
|
6189
|
-
"class": bem$
|
6358
|
+
"class": bem$16("disabled-text")
|
6190
6359
|
}, [props2.disabledText]);
|
6191
6360
|
return vue.createVNode("div", {
|
6192
|
-
"class": bem$
|
6193
|
-
}, [(_a = slots.top) == null ? void 0 : _a.call(slots), vue.createVNode(
|
6361
|
+
"class": bem$16()
|
6362
|
+
}, [(_a = slots.top) == null ? void 0 : _a.call(slots), !singleChoice.value && Array.isArray(props2.modelValue) ? vue.createVNode(CheckboxGroup, {
|
6363
|
+
"modelValue": props2.modelValue
|
6364
|
+
}, {
|
6365
|
+
default: () => [List2]
|
6366
|
+
}) : vue.createVNode(RadioGroup, {
|
6194
6367
|
"modelValue": props2.modelValue
|
6195
6368
|
}, {
|
6196
6369
|
default: () => [List2]
|
@@ -6198,7 +6371,7 @@
|
|
6198
6371
|
};
|
6199
6372
|
}
|
6200
6373
|
});
|
6201
|
-
const AddressList = withInstall(stdin_default$
|
6374
|
+
const AddressList = withInstall(stdin_default$1j);
|
6202
6375
|
const hasIntersectionObserver = inBrowser && "IntersectionObserver" in window && "IntersectionObserverEntry" in window && "intersectionRatio" in window.IntersectionObserverEntry.prototype;
|
6203
6376
|
const modeType = {
|
6204
6377
|
event: "event",
|
@@ -6351,7 +6524,7 @@
|
|
6351
6524
|
this.caches.shift();
|
6352
6525
|
}
|
6353
6526
|
}
|
6354
|
-
const [name$
|
6527
|
+
const [name$19, bem$15] = createNamespace("back-top");
|
6355
6528
|
const backTopProps = {
|
6356
6529
|
right: numericProp,
|
6357
6530
|
bottom: numericProp,
|
@@ -6364,8 +6537,8 @@
|
|
6364
6537
|
default: "body"
|
6365
6538
|
}
|
6366
6539
|
};
|
6367
|
-
var stdin_default$
|
6368
|
-
name: name$
|
6540
|
+
var stdin_default$1i = vue.defineComponent({
|
6541
|
+
name: name$19,
|
6369
6542
|
inheritAttrs: false,
|
6370
6543
|
props: backTopProps,
|
6371
6544
|
emits: ["click"],
|
@@ -6434,19 +6607,19 @@
|
|
6434
6607
|
return () => {
|
6435
6608
|
const Content = vue.createVNode("div", vue.mergeProps({
|
6436
6609
|
"ref": !props2.teleport ? root : void 0,
|
6437
|
-
"class": bem$
|
6610
|
+
"class": bem$15({
|
6438
6611
|
active: show.value
|
6439
6612
|
}),
|
6440
6613
|
"style": style.value,
|
6441
6614
|
"onClick": onClick
|
6442
6615
|
}, attrs), [slots.default ? slots.default() : vue.createVNode(Icon, {
|
6443
6616
|
"name": "back-top",
|
6444
|
-
"class": bem$
|
6617
|
+
"class": bem$15("icon")
|
6445
6618
|
}, null)]);
|
6446
6619
|
if (props2.teleport) {
|
6447
6620
|
return [vue.createVNode("div", {
|
6448
6621
|
"ref": root,
|
6449
|
-
"class": bem$
|
6622
|
+
"class": bem$15("placeholder")
|
6450
6623
|
}, null), vue.createVNode(vue.Teleport, {
|
6451
6624
|
"to": props2.teleport
|
6452
6625
|
}, {
|
@@ -6457,7 +6630,7 @@
|
|
6457
6630
|
};
|
6458
6631
|
}
|
6459
6632
|
});
|
6460
|
-
const BackTop = withInstall(stdin_default$
|
6633
|
+
const BackTop = withInstall(stdin_default$1i);
|
6461
6634
|
var __async = (__this, __arguments, generator) => {
|
6462
6635
|
return new Promise((resolve, reject) => {
|
6463
6636
|
var fulfilled = (value) => {
|
@@ -6486,9 +6659,9 @@
|
|
6486
6659
|
delay: makeNumberProp(300),
|
6487
6660
|
modelValue: makeArrayProp()
|
6488
6661
|
};
|
6489
|
-
const [name$
|
6490
|
-
var stdin_default$
|
6491
|
-
name: name$
|
6662
|
+
const [name$18, bem$14] = createNamespace("barrage");
|
6663
|
+
var stdin_default$1h = vue.defineComponent({
|
6664
|
+
name: name$18,
|
6492
6665
|
props: barrageProps,
|
6493
6666
|
emits: ["update:modelValue"],
|
6494
6667
|
setup(props2, {
|
@@ -6496,7 +6669,7 @@
|
|
6496
6669
|
slots
|
6497
6670
|
}) {
|
6498
6671
|
const barrageWrapper = vue.ref();
|
6499
|
-
const className = bem$
|
6672
|
+
const className = bem$14("item");
|
6500
6673
|
const total = vue.ref(0);
|
6501
6674
|
const barrageItems = [];
|
6502
6675
|
const createBarrageItem = (text, delay = props2.delay) => {
|
@@ -6577,15 +6750,15 @@
|
|
6577
6750
|
return () => {
|
6578
6751
|
var _a;
|
6579
6752
|
return vue.createVNode("div", {
|
6580
|
-
"class": bem$
|
6753
|
+
"class": bem$14(),
|
6581
6754
|
"ref": barrageWrapper,
|
6582
6755
|
"style": rootStyle.value
|
6583
6756
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
6584
6757
|
};
|
6585
6758
|
}
|
6586
6759
|
});
|
6587
|
-
const Barrage = withInstall(stdin_default$
|
6588
|
-
const [name$
|
6760
|
+
const Barrage = withInstall(stdin_default$1h);
|
6761
|
+
const [name$17, bem$13, t$g] = createNamespace("calendar");
|
6589
6762
|
const formatMonthTitle = (date) => t$g("monthTitle", date.getFullYear(), date.getMonth() + 1);
|
6590
6763
|
function compareMonth(date1, date2) {
|
6591
6764
|
const year1 = date1.getFullYear();
|
@@ -6613,8 +6786,22 @@
|
|
6613
6786
|
cloned.setDate(cloned.getDate() + offset2);
|
6614
6787
|
return cloned;
|
6615
6788
|
}
|
6789
|
+
function getMonthByOffset(date, offset2) {
|
6790
|
+
const cloned = cloneDate(date);
|
6791
|
+
cloned.setMonth(cloned.getMonth() + offset2);
|
6792
|
+
return cloned;
|
6793
|
+
}
|
6794
|
+
function getYearByOffset(date, offset2) {
|
6795
|
+
const cloned = cloneDate(date);
|
6796
|
+
cloned.setFullYear(cloned.getFullYear() + offset2);
|
6797
|
+
return cloned;
|
6798
|
+
}
|
6616
6799
|
const getPrevDay = (date) => getDayByOffset(date, -1);
|
6617
6800
|
const getNextDay = (date) => getDayByOffset(date, 1);
|
6801
|
+
const getPrevMonth = (date) => getMonthByOffset(date, -1);
|
6802
|
+
const getNextMonth = (date) => getMonthByOffset(date, 1);
|
6803
|
+
const getPrevYear = (date) => getYearByOffset(date, -1);
|
6804
|
+
const getNextYear = (date) => getYearByOffset(date, 1);
|
6618
6805
|
const getToday = () => {
|
6619
6806
|
const today = /* @__PURE__ */ new Date();
|
6620
6807
|
today.setHours(0, 0, 0, 0);
|
@@ -6665,9 +6852,9 @@
|
|
6665
6852
|
}
|
6666
6853
|
return value;
|
6667
6854
|
});
|
6668
|
-
const [name$
|
6669
|
-
var stdin_default$
|
6670
|
-
name: name$
|
6855
|
+
const [name$16] = createNamespace("calendar-day");
|
6856
|
+
var stdin_default$1g = vue.defineComponent({
|
6857
|
+
name: name$16,
|
6671
6858
|
props: {
|
6672
6859
|
item: makeRequiredProp(Object),
|
6673
6860
|
color: String,
|
@@ -6731,7 +6918,7 @@
|
|
6731
6918
|
} = props2.item;
|
6732
6919
|
if (topInfo || slots["top-info"]) {
|
6733
6920
|
return vue.createVNode("div", {
|
6734
|
-
"class": bem$
|
6921
|
+
"class": bem$13("top-info")
|
6735
6922
|
}, [slots["top-info"] ? slots["top-info"](props2.item) : topInfo]);
|
6736
6923
|
}
|
6737
6924
|
};
|
@@ -6741,7 +6928,7 @@
|
|
6741
6928
|
} = props2.item;
|
6742
6929
|
if (bottomInfo || slots["bottom-info"]) {
|
6743
6930
|
return vue.createVNode("div", {
|
6744
|
-
"class": bem$
|
6931
|
+
"class": bem$13("bottom-info")
|
6745
6932
|
}, [slots["bottom-info"] ? slots["bottom-info"](props2.item) : bottomInfo]);
|
6746
6933
|
}
|
6747
6934
|
};
|
@@ -6758,7 +6945,7 @@
|
|
6758
6945
|
const Nodes = [renderTopInfo(), text, renderBottomInfo()];
|
6759
6946
|
if (type === "selected") {
|
6760
6947
|
return vue.createVNode("div", {
|
6761
|
-
"class": bem$
|
6948
|
+
"class": bem$13("selected-day"),
|
6762
6949
|
"style": {
|
6763
6950
|
width: rowHeight,
|
6764
6951
|
height: rowHeight,
|
@@ -6775,27 +6962,27 @@
|
|
6775
6962
|
} = props2.item;
|
6776
6963
|
if (type === "placeholder") {
|
6777
6964
|
return vue.createVNode("div", {
|
6778
|
-
"class": bem$
|
6965
|
+
"class": bem$13("day"),
|
6779
6966
|
"style": style.value
|
6780
6967
|
}, null);
|
6781
6968
|
}
|
6782
6969
|
return vue.createVNode("div", {
|
6783
6970
|
"role": "gridcell",
|
6784
6971
|
"style": style.value,
|
6785
|
-
"class": [bem$
|
6972
|
+
"class": [bem$13("day", type), className],
|
6786
6973
|
"tabindex": type === "disabled" ? void 0 : -1,
|
6787
6974
|
"onClick": onClick
|
6788
6975
|
}, [renderContent()]);
|
6789
6976
|
};
|
6790
6977
|
}
|
6791
6978
|
});
|
6792
|
-
const [name$
|
6979
|
+
const [name$15] = createNamespace("calendar-month");
|
6793
6980
|
const calendarMonthProps = {
|
6794
6981
|
date: makeRequiredProp(Date),
|
6795
6982
|
type: String,
|
6796
6983
|
color: String,
|
6797
|
-
minDate:
|
6798
|
-
maxDate:
|
6984
|
+
minDate: Date,
|
6985
|
+
maxDate: Date,
|
6799
6986
|
showMark: Boolean,
|
6800
6987
|
rowHeight: numericProp,
|
6801
6988
|
formatter: Function,
|
@@ -6806,8 +6993,8 @@
|
|
6806
6993
|
showMonthTitle: Boolean,
|
6807
6994
|
firstDayOfWeek: Number
|
6808
6995
|
};
|
6809
|
-
var stdin_default$
|
6810
|
-
name: name$
|
6996
|
+
var stdin_default$1f = vue.defineComponent({
|
6997
|
+
name: name$15,
|
6811
6998
|
props: calendarMonthProps,
|
6812
6999
|
emits: ["click", "clickDisabledDate"],
|
6813
7000
|
setup(props2, {
|
@@ -6821,7 +7008,9 @@
|
|
6821
7008
|
const title = vue.computed(() => formatMonthTitle(props2.date));
|
6822
7009
|
const rowHeight = vue.computed(() => addUnit(props2.rowHeight));
|
6823
7010
|
const offset2 = vue.computed(() => {
|
6824
|
-
const
|
7011
|
+
const date = props2.date.getDate();
|
7012
|
+
const day = props2.date.getDay();
|
7013
|
+
const realDay = (day - date % 7 + 8) % 7;
|
6825
7014
|
if (props2.firstDayOfWeek) {
|
6826
7015
|
return (realDay + 7 - props2.firstDayOfWeek) % 7;
|
6827
7016
|
}
|
@@ -6881,7 +7070,7 @@
|
|
6881
7070
|
maxDate,
|
6882
7071
|
currentDate
|
6883
7072
|
} = props2;
|
6884
|
-
if (compareDay(day, minDate) < 0 || compareDay(day, maxDate) > 0) {
|
7073
|
+
if (minDate && compareDay(day, minDate) < 0 || maxDate && compareDay(day, maxDate) > 0) {
|
6885
7074
|
return "disabled";
|
6886
7075
|
}
|
6887
7076
|
if (currentDate === null) {
|
@@ -6912,7 +7101,7 @@
|
|
6912
7101
|
const renderTitle = () => {
|
6913
7102
|
if (props2.showMonthTitle) {
|
6914
7103
|
return vue.createVNode("div", {
|
6915
|
-
"class": bem$
|
7104
|
+
"class": bem$13("month-title")
|
6916
7105
|
}, [slots["month-title"] ? slots["month-title"]({
|
6917
7106
|
date: props2.date,
|
6918
7107
|
text: title.value
|
@@ -6922,7 +7111,7 @@
|
|
6922
7111
|
const renderMark = () => {
|
6923
7112
|
if (props2.showMark && shouldRender.value) {
|
6924
7113
|
return vue.createVNode("div", {
|
6925
|
-
"class": bem$
|
7114
|
+
"class": bem$13("month-mark")
|
6926
7115
|
}, [props2.date.getMonth() + 1]);
|
6927
7116
|
}
|
6928
7117
|
};
|
@@ -6962,7 +7151,7 @@
|
|
6962
7151
|
setScrollTop(body, daysRect.top + rowOffset + body.scrollTop - useRect(body).top);
|
6963
7152
|
}
|
6964
7153
|
};
|
6965
|
-
const renderDay = (item, index) => vue.createVNode(stdin_default$
|
7154
|
+
const renderDay = (item, index) => vue.createVNode(stdin_default$1g, {
|
6966
7155
|
"item": item,
|
6967
7156
|
"index": index,
|
6968
7157
|
"color": props2.color,
|
@@ -6974,7 +7163,7 @@
|
|
6974
7163
|
const renderDays = () => vue.createVNode("div", {
|
6975
7164
|
"ref": daysRef,
|
6976
7165
|
"role": "grid",
|
6977
|
-
"class": bem$
|
7166
|
+
"class": bem$13("days")
|
6978
7167
|
}, [renderMark(), (shouldRender.value ? days : placeholders).value.map(renderDay)]);
|
6979
7168
|
useExpose({
|
6980
7169
|
getTitle,
|
@@ -6984,47 +7173,110 @@
|
|
6984
7173
|
disabledDays
|
6985
7174
|
});
|
6986
7175
|
return () => vue.createVNode("div", {
|
6987
|
-
"class": bem$
|
7176
|
+
"class": bem$13("month"),
|
6988
7177
|
"ref": monthRef
|
6989
7178
|
}, [renderTitle(), renderDays()]);
|
6990
7179
|
}
|
6991
7180
|
});
|
6992
|
-
const [name$
|
6993
|
-
var stdin_default$
|
6994
|
-
name: name$
|
7181
|
+
const [name$14] = createNamespace("calendar-header");
|
7182
|
+
var stdin_default$1e = vue.defineComponent({
|
7183
|
+
name: name$14,
|
6995
7184
|
props: {
|
6996
7185
|
date: Date,
|
7186
|
+
minDate: Date,
|
7187
|
+
maxDate: Date,
|
6997
7188
|
title: String,
|
6998
7189
|
subtitle: String,
|
6999
7190
|
showTitle: Boolean,
|
7000
7191
|
showSubtitle: Boolean,
|
7001
|
-
firstDayOfWeek: Number
|
7192
|
+
firstDayOfWeek: Number,
|
7193
|
+
switchMode: makeStringProp("none")
|
7002
7194
|
},
|
7003
|
-
emits: ["clickSubtitle"],
|
7195
|
+
emits: ["clickSubtitle", "panelChange"],
|
7004
7196
|
setup(props2, {
|
7005
7197
|
slots,
|
7006
7198
|
emit
|
7007
7199
|
}) {
|
7200
|
+
const prevMonthDisabled = vue.computed(() => {
|
7201
|
+
const prevMonth = getPrevMonth(props2.date);
|
7202
|
+
return props2.minDate && prevMonth < props2.minDate;
|
7203
|
+
});
|
7204
|
+
const prevYearDisabled = vue.computed(() => {
|
7205
|
+
const prevYear = getPrevYear(props2.date);
|
7206
|
+
return props2.minDate && prevYear < props2.minDate;
|
7207
|
+
});
|
7208
|
+
const nextMonthDisabled = vue.computed(() => {
|
7209
|
+
const nextMonth = getNextMonth(props2.date);
|
7210
|
+
return props2.maxDate && nextMonth > props2.maxDate;
|
7211
|
+
});
|
7212
|
+
const nextYearDisabled = vue.computed(() => {
|
7213
|
+
const nextYear = getNextYear(props2.date);
|
7214
|
+
return props2.maxDate && nextYear > props2.maxDate;
|
7215
|
+
});
|
7008
7216
|
const renderTitle = () => {
|
7009
7217
|
if (props2.showTitle) {
|
7010
7218
|
const text = props2.title || t$g("title");
|
7011
7219
|
const title = slots.title ? slots.title() : text;
|
7012
7220
|
return vue.createVNode("div", {
|
7013
|
-
"class": bem$
|
7221
|
+
"class": bem$13("header-title")
|
7014
7222
|
}, [title]);
|
7015
7223
|
}
|
7016
7224
|
};
|
7017
7225
|
const onClickSubtitle = (event) => emit("clickSubtitle", event);
|
7226
|
+
const onPanelChange = (date) => emit("panelChange", date);
|
7227
|
+
const renderAction = (isNext) => {
|
7228
|
+
const showYearAction = props2.switchMode === "year-month";
|
7229
|
+
const monthSlot = slots[isNext ? "next-month" : "prev-month"];
|
7230
|
+
const yearSlot = slots[isNext ? "next-year" : "prev-year"];
|
7231
|
+
const monthDisabled = isNext ? nextMonthDisabled.value : prevMonthDisabled.value;
|
7232
|
+
const yearDisabled = isNext ? nextYearDisabled.value : prevYearDisabled.value;
|
7233
|
+
const monthIconName = isNext ? "arrow" : "arrow-left";
|
7234
|
+
const yearIconName = isNext ? "arrow-double-right" : "arrow-double-left";
|
7235
|
+
const onMonthChange = () => onPanelChange((isNext ? getNextMonth : getPrevMonth)(props2.date));
|
7236
|
+
const onYearChange = () => onPanelChange((isNext ? getNextYear : getPrevYear)(props2.date));
|
7237
|
+
const MonthAction = vue.createVNode("view", {
|
7238
|
+
"class": bem$13("header-action", {
|
7239
|
+
disabled: monthDisabled
|
7240
|
+
}),
|
7241
|
+
"onClick": monthDisabled ? void 0 : onMonthChange
|
7242
|
+
}, [monthSlot ? monthSlot({
|
7243
|
+
disabled: monthDisabled
|
7244
|
+
}) : vue.createVNode(Icon, {
|
7245
|
+
"class": {
|
7246
|
+
[HAPTICS_FEEDBACK]: !monthDisabled
|
7247
|
+
},
|
7248
|
+
"name": monthIconName
|
7249
|
+
}, null)]);
|
7250
|
+
const YearAction = showYearAction && vue.createVNode("view", {
|
7251
|
+
"class": bem$13("header-action", {
|
7252
|
+
disabled: yearDisabled
|
7253
|
+
}),
|
7254
|
+
"onClick": yearDisabled ? void 0 : onYearChange
|
7255
|
+
}, [yearSlot ? yearSlot({
|
7256
|
+
disabled: yearDisabled
|
7257
|
+
}) : vue.createVNode(Icon, {
|
7258
|
+
"class": {
|
7259
|
+
[HAPTICS_FEEDBACK]: !yearDisabled
|
7260
|
+
},
|
7261
|
+
"name": yearIconName
|
7262
|
+
}, null)]);
|
7263
|
+
return isNext ? [MonthAction, YearAction] : [YearAction, MonthAction];
|
7264
|
+
};
|
7018
7265
|
const renderSubtitle = () => {
|
7019
7266
|
if (props2.showSubtitle) {
|
7020
7267
|
const title = slots.subtitle ? slots.subtitle({
|
7021
7268
|
date: props2.date,
|
7022
7269
|
text: props2.subtitle
|
7023
7270
|
}) : props2.subtitle;
|
7271
|
+
const canSwitch = props2.switchMode !== "none";
|
7024
7272
|
return vue.createVNode("div", {
|
7025
|
-
"class": bem$
|
7273
|
+
"class": bem$13("header-subtitle", {
|
7274
|
+
"with-swicth": canSwitch
|
7275
|
+
}),
|
7026
7276
|
"onClick": onClickSubtitle
|
7027
|
-
}, [
|
7277
|
+
}, [canSwitch ? [renderAction(), vue.createVNode("div", {
|
7278
|
+
"class": bem$13("header-subtitle-text")
|
7279
|
+
}, [title]), renderAction(true)] : title]);
|
7028
7280
|
}
|
7029
7281
|
};
|
7030
7282
|
const renderWeekDays = () => {
|
@@ -7034,19 +7286,20 @@
|
|
7034
7286
|
const weekdays = t$g("weekdays");
|
7035
7287
|
const renderWeekDays2 = [...weekdays.slice(firstDayOfWeek, 7), ...weekdays.slice(0, firstDayOfWeek)];
|
7036
7288
|
return vue.createVNode("div", {
|
7037
|
-
"class": bem$
|
7289
|
+
"class": bem$13("weekdays")
|
7038
7290
|
}, [renderWeekDays2.map((text) => vue.createVNode("span", {
|
7039
|
-
"class": bem$
|
7291
|
+
"class": bem$13("weekday")
|
7040
7292
|
}, [text]))]);
|
7041
7293
|
};
|
7042
7294
|
return () => vue.createVNode("div", {
|
7043
|
-
"class": bem$
|
7295
|
+
"class": bem$13("header")
|
7044
7296
|
}, [renderTitle(), renderSubtitle(), renderWeekDays()]);
|
7045
7297
|
}
|
7046
7298
|
});
|
7047
7299
|
const calendarProps = {
|
7048
7300
|
show: Boolean,
|
7049
7301
|
type: makeStringProp("single"),
|
7302
|
+
switchMode: makeStringProp("none"),
|
7050
7303
|
title: String,
|
7051
7304
|
color: String,
|
7052
7305
|
round: truthProp,
|
@@ -7074,16 +7327,11 @@
|
|
7074
7327
|
safeAreaInsetBottom: truthProp,
|
7075
7328
|
minDate: {
|
7076
7329
|
type: Date,
|
7077
|
-
validator: isDate
|
7078
|
-
default: getToday
|
7330
|
+
validator: isDate
|
7079
7331
|
},
|
7080
7332
|
maxDate: {
|
7081
7333
|
type: Date,
|
7082
|
-
validator: isDate
|
7083
|
-
default: () => {
|
7084
|
-
const now = getToday();
|
7085
|
-
return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate());
|
7086
|
-
}
|
7334
|
+
validator: isDate
|
7087
7335
|
},
|
7088
7336
|
firstDayOfWeek: {
|
7089
7337
|
type: numericProp,
|
@@ -7091,28 +7339,39 @@
|
|
7091
7339
|
validator: (val) => val >= 0 && val <= 6
|
7092
7340
|
}
|
7093
7341
|
};
|
7094
|
-
var stdin_default$
|
7095
|
-
name: name$
|
7342
|
+
var stdin_default$1d = vue.defineComponent({
|
7343
|
+
name: name$17,
|
7096
7344
|
props: calendarProps,
|
7097
|
-
emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle", "clickDisabledDate"],
|
7345
|
+
emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle", "clickDisabledDate", "panelChange"],
|
7098
7346
|
setup(props2, {
|
7099
7347
|
emit,
|
7100
7348
|
slots
|
7101
7349
|
}) {
|
7102
|
-
const
|
7103
|
-
|
7104
|
-
|
7350
|
+
const canSwitch = vue.computed(() => props2.switchMode !== "none");
|
7351
|
+
const minDate = vue.computed(() => {
|
7352
|
+
if (!props2.minDate && !canSwitch.value) {
|
7353
|
+
return getToday();
|
7354
|
+
}
|
7355
|
+
return props2.minDate;
|
7356
|
+
});
|
7357
|
+
const maxDate = vue.computed(() => {
|
7358
|
+
if (!props2.maxDate && !canSwitch.value) {
|
7359
|
+
return getMonthByOffset(getToday(), 6);
|
7360
|
+
}
|
7361
|
+
return props2.maxDate;
|
7362
|
+
});
|
7363
|
+
const limitDateRange = (date, min = minDate.value, max = maxDate.value) => {
|
7364
|
+
if (min && compareDay(date, min) === -1) {
|
7365
|
+
return min;
|
7105
7366
|
}
|
7106
|
-
if (compareDay(date,
|
7107
|
-
return
|
7367
|
+
if (max && compareDay(date, max) === 1) {
|
7368
|
+
return max;
|
7108
7369
|
}
|
7109
7370
|
return date;
|
7110
7371
|
};
|
7111
7372
|
const getInitialDate = (defaultDate = props2.defaultDate) => {
|
7112
7373
|
const {
|
7113
7374
|
type,
|
7114
|
-
minDate,
|
7115
|
-
maxDate,
|
7116
7375
|
allowSameDay
|
7117
7376
|
} = props2;
|
7118
7377
|
if (defaultDate === null) {
|
@@ -7123,8 +7382,10 @@
|
|
7123
7382
|
if (!Array.isArray(defaultDate)) {
|
7124
7383
|
defaultDate = [];
|
7125
7384
|
}
|
7126
|
-
const
|
7127
|
-
const
|
7385
|
+
const min = minDate.value;
|
7386
|
+
const max = maxDate.value;
|
7387
|
+
const start2 = limitDateRange(defaultDate[0] || now, min, max ? allowSameDay ? max : getPrevDay(max) : void 0);
|
7388
|
+
const end2 = limitDateRange(defaultDate[1] || (allowSameDay ? now : getNextDay(now)), min ? allowSameDay ? min : getNextDay(min) : void 0);
|
7128
7389
|
return [start2, end2];
|
7129
7390
|
}
|
7130
7391
|
if (type === "multiple") {
|
@@ -7138,23 +7399,28 @@
|
|
7138
7399
|
}
|
7139
7400
|
return limitDateRange(defaultDate);
|
7140
7401
|
};
|
7402
|
+
const getInitialPanelDate = () => {
|
7403
|
+
const date = Array.isArray(currentDate.value) ? currentDate.value[0] : currentDate.value;
|
7404
|
+
return date ? date : limitDateRange(getToday());
|
7405
|
+
};
|
7141
7406
|
let bodyHeight;
|
7142
7407
|
const bodyRef = vue.ref();
|
7143
|
-
const subtitle = vue.ref({
|
7144
|
-
textFn: () => "",
|
7145
|
-
date: void 0
|
7146
|
-
});
|
7147
7408
|
const currentDate = vue.ref(getInitialDate());
|
7409
|
+
const currentPanelDate = vue.ref(getInitialPanelDate());
|
7410
|
+
const currentMonthRef = vue.ref();
|
7148
7411
|
const [monthRefs, setMonthRefs] = useRefs();
|
7149
7412
|
const dayOffset = vue.computed(() => props2.firstDayOfWeek ? +props2.firstDayOfWeek % 7 : 0);
|
7150
7413
|
const months = vue.computed(() => {
|
7151
7414
|
const months2 = [];
|
7152
|
-
|
7415
|
+
if (!minDate.value || !maxDate.value) {
|
7416
|
+
return months2;
|
7417
|
+
}
|
7418
|
+
const cursor = new Date(minDate.value);
|
7153
7419
|
cursor.setDate(1);
|
7154
7420
|
do {
|
7155
7421
|
months2.push(new Date(cursor));
|
7156
7422
|
cursor.setMonth(cursor.getMonth() + 1);
|
7157
|
-
} while (compareMonth(cursor,
|
7423
|
+
} while (compareMonth(cursor, maxDate.value) !== 1);
|
7158
7424
|
return months2;
|
7159
7425
|
});
|
7160
7426
|
const buttonDisabled = vue.computed(() => {
|
@@ -7204,25 +7470,26 @@
|
|
7204
7470
|
monthRefs.value[index].setVisible(visible);
|
7205
7471
|
});
|
7206
7472
|
if (currentMonth) {
|
7207
|
-
|
7208
|
-
textFn: currentMonth.getTitle,
|
7209
|
-
date: currentMonth.date
|
7210
|
-
};
|
7473
|
+
currentMonthRef.value = currentMonth;
|
7211
7474
|
}
|
7212
7475
|
};
|
7213
7476
|
const scrollToDate = (targetDate) => {
|
7214
|
-
|
7215
|
-
|
7216
|
-
|
7217
|
-
|
7218
|
-
|
7477
|
+
if (canSwitch.value) {
|
7478
|
+
currentPanelDate.value = targetDate;
|
7479
|
+
} else {
|
7480
|
+
raf(() => {
|
7481
|
+
months.value.some((month, index) => {
|
7482
|
+
if (compareMonth(month, targetDate) === 0) {
|
7483
|
+
if (bodyRef.value) {
|
7484
|
+
monthRefs.value[index].scrollToDate(bodyRef.value, targetDate);
|
7485
|
+
}
|
7486
|
+
return true;
|
7219
7487
|
}
|
7220
|
-
return
|
7221
|
-
}
|
7222
|
-
|
7488
|
+
return false;
|
7489
|
+
});
|
7490
|
+
onScroll();
|
7223
7491
|
});
|
7224
|
-
|
7225
|
-
});
|
7492
|
+
}
|
7226
7493
|
};
|
7227
7494
|
const scrollToCurrentDate = () => {
|
7228
7495
|
if (props2.poppable && !props2.show) {
|
@@ -7233,7 +7500,7 @@
|
|
7233
7500
|
if (isDate(targetDate)) {
|
7234
7501
|
scrollToDate(targetDate);
|
7235
7502
|
}
|
7236
|
-
} else {
|
7503
|
+
} else if (!canSwitch.value) {
|
7237
7504
|
raf(onScroll);
|
7238
7505
|
}
|
7239
7506
|
};
|
@@ -7241,9 +7508,11 @@
|
|
7241
7508
|
if (props2.poppable && !props2.show) {
|
7242
7509
|
return;
|
7243
7510
|
}
|
7244
|
-
|
7245
|
-
|
7246
|
-
|
7511
|
+
if (!canSwitch.value) {
|
7512
|
+
raf(() => {
|
7513
|
+
bodyHeight = Math.floor(useRect(bodyRef).height);
|
7514
|
+
});
|
7515
|
+
}
|
7247
7516
|
scrollToCurrentDate();
|
7248
7517
|
};
|
7249
7518
|
const reset = (date = getInitialDate()) => {
|
@@ -7265,6 +7534,12 @@
|
|
7265
7534
|
}
|
7266
7535
|
return true;
|
7267
7536
|
};
|
7537
|
+
const onPanelChange = (date) => {
|
7538
|
+
currentPanelDate.value = date;
|
7539
|
+
emit("panelChange", {
|
7540
|
+
date
|
7541
|
+
});
|
7542
|
+
};
|
7268
7543
|
const onConfirm = () => {
|
7269
7544
|
var _a;
|
7270
7545
|
return emit("confirm", (_a = currentDate.value) != null ? _a : cloneDates(currentDate.value));
|
@@ -7355,13 +7630,16 @@
|
|
7355
7630
|
const updateShow = (value) => emit("update:show", value);
|
7356
7631
|
const renderMonth = (date, index) => {
|
7357
7632
|
const showMonthTitle = index !== 0 || !props2.showSubtitle;
|
7358
|
-
return vue.createVNode(stdin_default$
|
7359
|
-
"ref": setMonthRefs(index),
|
7633
|
+
return vue.createVNode(stdin_default$1f, vue.mergeProps({
|
7634
|
+
"ref": canSwitch.value ? currentMonthRef : setMonthRefs(index),
|
7360
7635
|
"date": date,
|
7361
7636
|
"currentDate": currentDate.value,
|
7362
7637
|
"showMonthTitle": showMonthTitle,
|
7363
|
-
"firstDayOfWeek": dayOffset.value
|
7364
|
-
|
7638
|
+
"firstDayOfWeek": dayOffset.value,
|
7639
|
+
"lazyRender": canSwitch.value ? false : props2.lazyRender,
|
7640
|
+
"maxDate": maxDate.value,
|
7641
|
+
"minDate": minDate.value
|
7642
|
+
}, pick(props2, ["type", "color", "showMark", "formatter", "rowHeight", "showSubtitle", "allowSameDay"]), {
|
7365
7643
|
"onClick": onClickDay,
|
7366
7644
|
"onClickDisabledDate": (item) => emit("clickDisabledDate", item)
|
7367
7645
|
}), pick(slots, ["top-info", "bottom-info", "month-title"]));
|
@@ -7379,7 +7657,7 @@
|
|
7379
7657
|
"block": true,
|
7380
7658
|
"type": "primary",
|
7381
7659
|
"color": props2.color,
|
7382
|
-
"class": bem$
|
7660
|
+
"class": bem$13("confirm"),
|
7383
7661
|
"disabled": disabled,
|
7384
7662
|
"nativeType": "button",
|
7385
7663
|
"onClick": onConfirm
|
@@ -7391,30 +7669,34 @@
|
|
7391
7669
|
}
|
7392
7670
|
};
|
7393
7671
|
const renderFooter = () => vue.createVNode("div", {
|
7394
|
-
"class": [bem$
|
7672
|
+
"class": [bem$13("footer"), {
|
7395
7673
|
"van-safe-area-bottom": props2.safeAreaInsetBottom
|
7396
7674
|
}]
|
7397
7675
|
}, [renderFooterButton()]);
|
7398
7676
|
const renderCalendar = () => {
|
7399
|
-
|
7677
|
+
var _a, _b;
|
7400
7678
|
return vue.createVNode("div", {
|
7401
|
-
"class": bem$
|
7402
|
-
}, [vue.createVNode(stdin_default$
|
7403
|
-
"date":
|
7679
|
+
"class": bem$13()
|
7680
|
+
}, [vue.createVNode(stdin_default$1e, {
|
7681
|
+
"date": (_a = currentMonthRef.value) == null ? void 0 : _a.date,
|
7682
|
+
"maxDate": maxDate.value,
|
7683
|
+
"minDate": minDate.value,
|
7404
7684
|
"title": props2.title,
|
7405
|
-
"subtitle":
|
7685
|
+
"subtitle": (_b = currentMonthRef.value) == null ? void 0 : _b.getTitle(),
|
7406
7686
|
"showTitle": props2.showTitle,
|
7407
7687
|
"showSubtitle": props2.showSubtitle,
|
7688
|
+
"switchMode": props2.switchMode,
|
7408
7689
|
"firstDayOfWeek": dayOffset.value,
|
7409
|
-
"onClickSubtitle": (event) => emit("clickSubtitle", event)
|
7410
|
-
|
7690
|
+
"onClickSubtitle": (event) => emit("clickSubtitle", event),
|
7691
|
+
"onPanelChange": onPanelChange
|
7692
|
+
}, pick(slots, ["title", "subtitle", "prev-month", "prev-year", "next-month", "next-year"])), vue.createVNode("div", {
|
7411
7693
|
"ref": bodyRef,
|
7412
|
-
"class": bem$
|
7413
|
-
"onScroll": onScroll
|
7414
|
-
}, [months.value.map(renderMonth)]), renderFooter()]);
|
7694
|
+
"class": bem$13("body"),
|
7695
|
+
"onScroll": canSwitch.value ? void 0 : onScroll
|
7696
|
+
}, [canSwitch.value ? renderMonth(currentPanelDate.value, 0) : months.value.map(renderMonth)]), renderFooter()]);
|
7415
7697
|
};
|
7416
7698
|
vue.watch(() => props2.show, init);
|
7417
|
-
vue.watch(() => [props2.type, props2.minDate, props2.maxDate], () => reset(getInitialDate(currentDate.value)));
|
7699
|
+
vue.watch(() => [props2.type, props2.minDate, props2.maxDate, props2.switchMode], () => reset(getInitialDate(currentDate.value)));
|
7418
7700
|
vue.watch(() => props2.defaultDate, (value = null) => {
|
7419
7701
|
currentDate.value = value;
|
7420
7702
|
scrollToCurrentDate();
|
@@ -7429,7 +7711,7 @@
|
|
7429
7711
|
if (props2.poppable) {
|
7430
7712
|
return vue.createVNode(Popup, {
|
7431
7713
|
"show": props2.show,
|
7432
|
-
"class": bem$
|
7714
|
+
"class": bem$13("popup"),
|
7433
7715
|
"round": props2.round,
|
7434
7716
|
"position": props2.position,
|
7435
7717
|
"closeable": props2.showTitle || props2.showSubtitle,
|
@@ -7446,8 +7728,8 @@
|
|
7446
7728
|
};
|
7447
7729
|
}
|
7448
7730
|
});
|
7449
|
-
const Calendar = withInstall(stdin_default$
|
7450
|
-
const [name$
|
7731
|
+
const Calendar = withInstall(stdin_default$1d);
|
7732
|
+
const [name$13, bem$12] = createNamespace("image");
|
7451
7733
|
const imageProps = {
|
7452
7734
|
src: String,
|
7453
7735
|
alt: String,
|
@@ -7468,8 +7750,8 @@
|
|
7468
7750
|
crossorigin: String,
|
7469
7751
|
referrerpolicy: String
|
7470
7752
|
};
|
7471
|
-
var stdin_default$
|
7472
|
-
name: name$
|
7753
|
+
var stdin_default$1c = vue.defineComponent({
|
7754
|
+
name: name$13,
|
7473
7755
|
props: imageProps,
|
7474
7756
|
emits: ["load", "error"],
|
7475
7757
|
setup(props2, {
|
@@ -7530,13 +7812,13 @@
|
|
7530
7812
|
const renderPlaceholder = () => {
|
7531
7813
|
if (loading.value && props2.showLoading) {
|
7532
7814
|
return vue.createVNode("div", {
|
7533
|
-
"class": bem$
|
7534
|
-
}, [renderIcon(props2.loadingIcon, bem$
|
7815
|
+
"class": bem$12("loading")
|
7816
|
+
}, [renderIcon(props2.loadingIcon, bem$12("loading-icon"), slots.loading)]);
|
7535
7817
|
}
|
7536
7818
|
if (error.value && props2.showError) {
|
7537
7819
|
return vue.createVNode("div", {
|
7538
|
-
"class": bem$
|
7539
|
-
}, [renderIcon(props2.errorIcon, bem$
|
7820
|
+
"class": bem$12("error")
|
7821
|
+
}, [renderIcon(props2.errorIcon, bem$12("error-icon"), slots.error)]);
|
7540
7822
|
}
|
7541
7823
|
};
|
7542
7824
|
const renderImage = () => {
|
@@ -7545,7 +7827,7 @@
|
|
7545
7827
|
}
|
7546
7828
|
const attrs = {
|
7547
7829
|
alt: props2.alt,
|
7548
|
-
class: bem$
|
7830
|
+
class: bem$12("img"),
|
7549
7831
|
style: {
|
7550
7832
|
objectFit: props2.fit,
|
7551
7833
|
objectPosition: props2.position
|
@@ -7605,7 +7887,7 @@
|
|
7605
7887
|
return () => {
|
7606
7888
|
var _a;
|
7607
7889
|
return vue.createVNode("div", {
|
7608
|
-
"class": bem$
|
7890
|
+
"class": bem$12({
|
7609
7891
|
round: props2.round,
|
7610
7892
|
block: props2.block
|
7611
7893
|
}),
|
@@ -7614,8 +7896,8 @@
|
|
7614
7896
|
};
|
7615
7897
|
}
|
7616
7898
|
});
|
7617
|
-
const Image$1 = withInstall(stdin_default$
|
7618
|
-
const [name$
|
7899
|
+
const Image$1 = withInstall(stdin_default$1c);
|
7900
|
+
const [name$12, bem$11] = createNamespace("card");
|
7619
7901
|
const cardProps = {
|
7620
7902
|
tag: String,
|
7621
7903
|
num: numericProp,
|
@@ -7629,8 +7911,8 @@
|
|
7629
7911
|
thumbLink: String,
|
7630
7912
|
originPrice: numericProp
|
7631
7913
|
};
|
7632
|
-
var stdin_default$
|
7633
|
-
name: name$
|
7914
|
+
var stdin_default$1b = vue.defineComponent({
|
7915
|
+
name: name$12,
|
7634
7916
|
props: cardProps,
|
7635
7917
|
emits: ["clickThumb"],
|
7636
7918
|
setup(props2, {
|
@@ -7643,14 +7925,14 @@
|
|
7643
7925
|
}
|
7644
7926
|
if (props2.title) {
|
7645
7927
|
return vue.createVNode("div", {
|
7646
|
-
"class": [bem$
|
7928
|
+
"class": [bem$11("title"), "van-multi-ellipsis--l2"]
|
7647
7929
|
}, [props2.title]);
|
7648
7930
|
}
|
7649
7931
|
};
|
7650
7932
|
const renderThumbTag = () => {
|
7651
7933
|
if (slots.tag || props2.tag) {
|
7652
7934
|
return vue.createVNode("div", {
|
7653
|
-
"class": bem$
|
7935
|
+
"class": bem$11("tag")
|
7654
7936
|
}, [slots.tag ? slots.tag() : vue.createVNode(Tag, {
|
7655
7937
|
"mark": true,
|
7656
7938
|
"type": "primary"
|
@@ -7675,7 +7957,7 @@
|
|
7675
7957
|
if (slots.thumb || props2.thumb) {
|
7676
7958
|
return vue.createVNode("a", {
|
7677
7959
|
"href": props2.thumbLink,
|
7678
|
-
"class": bem$
|
7960
|
+
"class": bem$11("thumb"),
|
7679
7961
|
"onClick": (event) => emit("clickThumb", event)
|
7680
7962
|
}, [renderThumbImage(), renderThumbTag()]);
|
7681
7963
|
}
|
@@ -7686,18 +7968,18 @@
|
|
7686
7968
|
}
|
7687
7969
|
if (props2.desc) {
|
7688
7970
|
return vue.createVNode("div", {
|
7689
|
-
"class": [bem$
|
7971
|
+
"class": [bem$11("desc"), "van-ellipsis"]
|
7690
7972
|
}, [props2.desc]);
|
7691
7973
|
}
|
7692
7974
|
};
|
7693
7975
|
const renderPriceText = () => {
|
7694
7976
|
const priceArr = props2.price.toString().split(".");
|
7695
7977
|
return vue.createVNode("div", null, [vue.createVNode("span", {
|
7696
|
-
"class": bem$
|
7978
|
+
"class": bem$11("price-currency")
|
7697
7979
|
}, [props2.currency]), vue.createVNode("span", {
|
7698
|
-
"class": bem$
|
7980
|
+
"class": bem$11("price-integer")
|
7699
7981
|
}, [priceArr[0]]), vue.createTextVNode("."), vue.createVNode("span", {
|
7700
|
-
"class": bem$
|
7982
|
+
"class": bem$11("price-decimal")
|
7701
7983
|
}, [priceArr[1]])]);
|
7702
7984
|
};
|
7703
7985
|
return () => {
|
@@ -7707,34 +7989,34 @@
|
|
7707
7989
|
const showOriginPrice = slots["origin-price"] || isDef(props2.originPrice);
|
7708
7990
|
const showBottom = showNum || showPrice || showOriginPrice || slots.bottom;
|
7709
7991
|
const Price = showPrice && vue.createVNode("div", {
|
7710
|
-
"class": bem$
|
7992
|
+
"class": bem$11("price")
|
7711
7993
|
}, [slots.price ? slots.price() : renderPriceText()]);
|
7712
7994
|
const OriginPrice = showOriginPrice && vue.createVNode("div", {
|
7713
|
-
"class": bem$
|
7995
|
+
"class": bem$11("origin-price")
|
7714
7996
|
}, [slots["origin-price"] ? slots["origin-price"]() : `${props2.currency} ${props2.originPrice}`]);
|
7715
7997
|
const Num = showNum && vue.createVNode("div", {
|
7716
|
-
"class": bem$
|
7998
|
+
"class": bem$11("num")
|
7717
7999
|
}, [slots.num ? slots.num() : `x${props2.num}`]);
|
7718
8000
|
const Footer = slots.footer && vue.createVNode("div", {
|
7719
|
-
"class": bem$
|
8001
|
+
"class": bem$11("footer")
|
7720
8002
|
}, [slots.footer()]);
|
7721
8003
|
const Bottom = showBottom && vue.createVNode("div", {
|
7722
|
-
"class": bem$
|
8004
|
+
"class": bem$11("bottom")
|
7723
8005
|
}, [(_a = slots["price-top"]) == null ? void 0 : _a.call(slots), Price, OriginPrice, Num, (_b = slots.bottom) == null ? void 0 : _b.call(slots)]);
|
7724
8006
|
return vue.createVNode("div", {
|
7725
|
-
"class": bem$
|
8007
|
+
"class": bem$11()
|
7726
8008
|
}, [vue.createVNode("div", {
|
7727
|
-
"class": bem$
|
8009
|
+
"class": bem$11("header")
|
7728
8010
|
}, [renderThumb(), vue.createVNode("div", {
|
7729
|
-
"class": bem$
|
8011
|
+
"class": bem$11("content", {
|
7730
8012
|
centered: props2.centered
|
7731
8013
|
})
|
7732
8014
|
}, [vue.createVNode("div", null, [renderTitle(), renderDesc(), (_c = slots.tags) == null ? void 0 : _c.call(slots)]), Bottom])]), Footer]);
|
7733
8015
|
};
|
7734
8016
|
}
|
7735
8017
|
});
|
7736
|
-
const Card = withInstall(stdin_default$
|
7737
|
-
const [name$
|
8018
|
+
const Card = withInstall(stdin_default$1b);
|
8019
|
+
const [name$11, bem$10, t$f] = createNamespace("cascader");
|
7738
8020
|
const cascaderProps = {
|
7739
8021
|
title: String,
|
7740
8022
|
options: makeArrayProp(),
|
@@ -7747,8 +8029,8 @@
|
|
7747
8029
|
placeholder: String,
|
7748
8030
|
activeColor: String
|
7749
8031
|
};
|
7750
|
-
var stdin_default$
|
7751
|
-
name: name$
|
8032
|
+
var stdin_default$1a = vue.defineComponent({
|
8033
|
+
name: name$11,
|
7752
8034
|
props: cascaderProps,
|
7753
8035
|
emits: ["close", "change", "finish", "clickTab", "update:modelValue"],
|
7754
8036
|
setup(props2, {
|
@@ -7857,12 +8139,12 @@
|
|
7857
8139
|
title
|
7858
8140
|
}) => emit("clickTab", name2, title);
|
7859
8141
|
const renderHeader = () => props2.showHeader ? vue.createVNode("div", {
|
7860
|
-
"class": bem$
|
8142
|
+
"class": bem$10("header")
|
7861
8143
|
}, [vue.createVNode("h2", {
|
7862
|
-
"class": bem$
|
8144
|
+
"class": bem$10("title")
|
7863
8145
|
}, [slots.title ? slots.title() : props2.title]), props2.closeable ? vue.createVNode(Icon, {
|
7864
8146
|
"name": props2.closeIcon,
|
7865
|
-
"class": [bem$
|
8147
|
+
"class": [bem$10("close-icon"), HAPTICS_FEEDBACK],
|
7866
8148
|
"onClick": onClose
|
7867
8149
|
}, null) : null]) : null;
|
7868
8150
|
const renderOption = (option, selectedOption, tabIndex) => {
|
@@ -7878,7 +8160,7 @@
|
|
7878
8160
|
return vue.createVNode("li", {
|
7879
8161
|
"ref": selected ? setSelectedElementRefs(tabIndex) : void 0,
|
7880
8162
|
"role": "menuitemradio",
|
7881
|
-
"class": [bem$
|
8163
|
+
"class": [bem$10("option", {
|
7882
8164
|
selected,
|
7883
8165
|
disabled
|
7884
8166
|
}), option.className],
|
@@ -7891,12 +8173,12 @@
|
|
7891
8173
|
"onClick": () => onSelect(option, tabIndex)
|
7892
8174
|
}, [Text, selected ? vue.createVNode(Icon, {
|
7893
8175
|
"name": "success",
|
7894
|
-
"class": bem$
|
8176
|
+
"class": bem$10("selected-icon")
|
7895
8177
|
}, null) : null]);
|
7896
8178
|
};
|
7897
8179
|
const renderOptions = (options, selectedOption, tabIndex) => vue.createVNode("ul", {
|
7898
8180
|
"role": "menu",
|
7899
|
-
"class": bem$
|
8181
|
+
"class": bem$10("options")
|
7900
8182
|
}, [options.map((option) => renderOption(option, selectedOption, tabIndex))]);
|
7901
8183
|
const renderTab = (tab, tabIndex) => {
|
7902
8184
|
const {
|
@@ -7907,7 +8189,7 @@
|
|
7907
8189
|
const title = selected ? selected[textKey] : placeholder;
|
7908
8190
|
return vue.createVNode(Tab, {
|
7909
8191
|
"title": title,
|
7910
|
-
"titleClass": bem$
|
8192
|
+
"titleClass": bem$10("tab", {
|
7911
8193
|
unselected: !selected
|
7912
8194
|
})
|
7913
8195
|
}, {
|
@@ -7926,7 +8208,7 @@
|
|
7926
8208
|
"onUpdate:active": ($event) => activeTab.value = $event,
|
7927
8209
|
"shrink": true,
|
7928
8210
|
"animated": true,
|
7929
|
-
"class": bem$
|
8211
|
+
"class": bem$10("tabs"),
|
7930
8212
|
"color": props2.activeColor,
|
7931
8213
|
"swipeable": props2.swipeable,
|
7932
8214
|
"onClickTab": onClickTab
|
@@ -7961,19 +8243,19 @@
|
|
7961
8243
|
updateTabs();
|
7962
8244
|
});
|
7963
8245
|
return () => vue.createVNode("div", {
|
7964
|
-
"class": bem$
|
8246
|
+
"class": bem$10()
|
7965
8247
|
}, [renderHeader(), renderTabs()]);
|
7966
8248
|
}
|
7967
8249
|
});
|
7968
|
-
const Cascader = withInstall(stdin_default$
|
7969
|
-
const [name$
|
8250
|
+
const Cascader = withInstall(stdin_default$1a);
|
8251
|
+
const [name$10, bem$$] = createNamespace("cell-group");
|
7970
8252
|
const cellGroupProps = {
|
7971
8253
|
title: String,
|
7972
8254
|
inset: Boolean,
|
7973
8255
|
border: truthProp
|
7974
8256
|
};
|
7975
|
-
var stdin_default$
|
7976
|
-
name: name$
|
8257
|
+
var stdin_default$19 = vue.defineComponent({
|
8258
|
+
name: name$10,
|
7977
8259
|
inheritAttrs: false,
|
7978
8260
|
props: cellGroupProps,
|
7979
8261
|
setup(props2, {
|
@@ -7983,7 +8265,7 @@
|
|
7983
8265
|
const renderGroup = () => {
|
7984
8266
|
var _a;
|
7985
8267
|
return vue.createVNode("div", vue.mergeProps({
|
7986
|
-
"class": [bem
|
8268
|
+
"class": [bem$$({
|
7987
8269
|
inset: props2.inset
|
7988
8270
|
}), {
|
7989
8271
|
[BORDER_TOP_BOTTOM]: props2.border && !props2.inset
|
@@ -7991,7 +8273,7 @@
|
|
7991
8273
|
}, attrs, useScopeId()), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
7992
8274
|
};
|
7993
8275
|
const renderTitle = () => vue.createVNode("div", {
|
7994
|
-
"class": bem
|
8276
|
+
"class": bem$$("title", {
|
7995
8277
|
inset: props2.inset
|
7996
8278
|
})
|
7997
8279
|
}, [slots.title ? slots.title() : props2.title]);
|
@@ -8003,153 +8285,7 @@
|
|
8003
8285
|
};
|
8004
8286
|
}
|
8005
8287
|
});
|
8006
|
-
const CellGroup = withInstall(stdin_default$
|
8007
|
-
const [name$11, bem$10] = createNamespace("checkbox-group");
|
8008
|
-
const checkboxGroupProps = {
|
8009
|
-
max: numericProp,
|
8010
|
-
shape: makeStringProp("round"),
|
8011
|
-
disabled: Boolean,
|
8012
|
-
iconSize: numericProp,
|
8013
|
-
direction: String,
|
8014
|
-
modelValue: makeArrayProp(),
|
8015
|
-
checkedColor: String
|
8016
|
-
};
|
8017
|
-
const CHECKBOX_GROUP_KEY = Symbol(name$11);
|
8018
|
-
var stdin_default$1a = vue.defineComponent({
|
8019
|
-
name: name$11,
|
8020
|
-
props: checkboxGroupProps,
|
8021
|
-
emits: ["change", "update:modelValue"],
|
8022
|
-
setup(props2, {
|
8023
|
-
emit,
|
8024
|
-
slots
|
8025
|
-
}) {
|
8026
|
-
const {
|
8027
|
-
children,
|
8028
|
-
linkChildren
|
8029
|
-
} = useChildren(CHECKBOX_GROUP_KEY);
|
8030
|
-
const updateValue = (value) => emit("update:modelValue", value);
|
8031
|
-
const toggleAll = (options = {}) => {
|
8032
|
-
if (typeof options === "boolean") {
|
8033
|
-
options = {
|
8034
|
-
checked: options
|
8035
|
-
};
|
8036
|
-
}
|
8037
|
-
const {
|
8038
|
-
checked,
|
8039
|
-
skipDisabled
|
8040
|
-
} = options;
|
8041
|
-
const checkedChildren = children.filter((item) => {
|
8042
|
-
if (!item.props.bindGroup) {
|
8043
|
-
return false;
|
8044
|
-
}
|
8045
|
-
if (item.props.disabled && skipDisabled) {
|
8046
|
-
return item.checked.value;
|
8047
|
-
}
|
8048
|
-
return checked != null ? checked : !item.checked.value;
|
8049
|
-
});
|
8050
|
-
const names = checkedChildren.map((item) => item.name);
|
8051
|
-
updateValue(names);
|
8052
|
-
};
|
8053
|
-
vue.watch(() => props2.modelValue, (value) => emit("change", value));
|
8054
|
-
useExpose({
|
8055
|
-
toggleAll
|
8056
|
-
});
|
8057
|
-
useCustomFieldValue(() => props2.modelValue);
|
8058
|
-
linkChildren({
|
8059
|
-
props: props2,
|
8060
|
-
updateValue
|
8061
|
-
});
|
8062
|
-
return () => {
|
8063
|
-
var _a;
|
8064
|
-
return vue.createVNode("div", {
|
8065
|
-
"class": bem$10([props2.direction])
|
8066
|
-
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
8067
|
-
};
|
8068
|
-
}
|
8069
|
-
});
|
8070
|
-
const [name$10, bem$$] = createNamespace("checkbox");
|
8071
|
-
const checkboxProps = extend({}, checkerProps, {
|
8072
|
-
shape: String,
|
8073
|
-
bindGroup: truthProp,
|
8074
|
-
indeterminate: {
|
8075
|
-
type: Boolean,
|
8076
|
-
default: null
|
8077
|
-
}
|
8078
|
-
});
|
8079
|
-
var stdin_default$19 = vue.defineComponent({
|
8080
|
-
name: name$10,
|
8081
|
-
props: checkboxProps,
|
8082
|
-
emits: ["change", "update:modelValue"],
|
8083
|
-
setup(props2, {
|
8084
|
-
emit,
|
8085
|
-
slots
|
8086
|
-
}) {
|
8087
|
-
const {
|
8088
|
-
parent
|
8089
|
-
} = useParent(CHECKBOX_GROUP_KEY);
|
8090
|
-
const setParentValue = (checked2) => {
|
8091
|
-
const {
|
8092
|
-
name: name2
|
8093
|
-
} = props2;
|
8094
|
-
const {
|
8095
|
-
max,
|
8096
|
-
modelValue
|
8097
|
-
} = parent.props;
|
8098
|
-
const value = modelValue.slice();
|
8099
|
-
if (checked2) {
|
8100
|
-
const overlimit = max && value.length >= +max;
|
8101
|
-
if (!overlimit && !value.includes(name2)) {
|
8102
|
-
value.push(name2);
|
8103
|
-
if (props2.bindGroup) {
|
8104
|
-
parent.updateValue(value);
|
8105
|
-
}
|
8106
|
-
}
|
8107
|
-
} else {
|
8108
|
-
const index = value.indexOf(name2);
|
8109
|
-
if (index !== -1) {
|
8110
|
-
value.splice(index, 1);
|
8111
|
-
if (props2.bindGroup) {
|
8112
|
-
parent.updateValue(value);
|
8113
|
-
}
|
8114
|
-
}
|
8115
|
-
}
|
8116
|
-
};
|
8117
|
-
const checked = vue.computed(() => {
|
8118
|
-
if (parent && props2.bindGroup) {
|
8119
|
-
return parent.props.modelValue.indexOf(props2.name) !== -1;
|
8120
|
-
}
|
8121
|
-
return !!props2.modelValue;
|
8122
|
-
});
|
8123
|
-
const toggle = (newValue = !checked.value) => {
|
8124
|
-
if (parent && props2.bindGroup) {
|
8125
|
-
setParentValue(newValue);
|
8126
|
-
} else {
|
8127
|
-
emit("update:modelValue", newValue);
|
8128
|
-
}
|
8129
|
-
if (props2.indeterminate !== null)
|
8130
|
-
emit("change", newValue);
|
8131
|
-
};
|
8132
|
-
vue.watch(() => props2.modelValue, (value) => {
|
8133
|
-
if (props2.indeterminate === null)
|
8134
|
-
emit("change", value);
|
8135
|
-
});
|
8136
|
-
useExpose({
|
8137
|
-
toggle,
|
8138
|
-
props: props2,
|
8139
|
-
checked
|
8140
|
-
});
|
8141
|
-
useCustomFieldValue(() => props2.modelValue);
|
8142
|
-
return () => vue.createVNode(stdin_default$1o, vue.mergeProps({
|
8143
|
-
"bem": bem$$,
|
8144
|
-
"role": "checkbox",
|
8145
|
-
"parent": parent,
|
8146
|
-
"checked": checked.value,
|
8147
|
-
"onToggle": toggle
|
8148
|
-
}, props2), pick(slots, ["default", "icon"]));
|
8149
|
-
}
|
8150
|
-
});
|
8151
|
-
const Checkbox = withInstall(stdin_default$19);
|
8152
|
-
const CheckboxGroup = withInstall(stdin_default$1a);
|
8288
|
+
const CellGroup = withInstall(stdin_default$19);
|
8153
8289
|
const [name$$, bem$_] = createNamespace("circle");
|
8154
8290
|
let uid = 0;
|
8155
8291
|
const format = (rate) => Math.min(Math.max(+rate, 0), 100);
|
@@ -10656,6 +10792,16 @@
|
|
10656
10792
|
useEventListener("touchmove", onTouchmove, {
|
10657
10793
|
target: rootRef
|
10658
10794
|
});
|
10795
|
+
const renderHeader = () => {
|
10796
|
+
if (slots.header) {
|
10797
|
+
return slots.header();
|
10798
|
+
}
|
10799
|
+
return vue.createVNode("div", {
|
10800
|
+
"class": bem$I("header")
|
10801
|
+
}, [vue.createVNode("div", {
|
10802
|
+
"class": bem$I("header-bar")
|
10803
|
+
}, null)]);
|
10804
|
+
};
|
10659
10805
|
return () => {
|
10660
10806
|
var _a;
|
10661
10807
|
return vue.createVNode("div", {
|
@@ -10667,11 +10813,7 @@
|
|
10667
10813
|
"onTouchstartPassive": onTouchstart,
|
10668
10814
|
"onTouchend": onTouchend,
|
10669
10815
|
"onTouchcancel": onTouchend
|
10670
|
-
}, [vue.createVNode("div", {
|
10671
|
-
"class": bem$I("header")
|
10672
|
-
}, [vue.createVNode("div", {
|
10673
|
-
"class": bem$I("header-bar")
|
10674
|
-
}, null)]), vue.createVNode("div", {
|
10816
|
+
}, [renderHeader(), vue.createVNode("div", {
|
10675
10817
|
"class": bem$I("content"),
|
10676
10818
|
"ref": contentRef
|
10677
10819
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]);
|
@@ -10915,6 +11057,13 @@
|
|
10915
11057
|
return chunks2;
|
10916
11058
|
}, []);
|
10917
11059
|
const lastChunk = chunks[chunks.length - 1];
|
11060
|
+
if (!lastChunk) {
|
11061
|
+
chunks.push({
|
11062
|
+
start: 0,
|
11063
|
+
end: sourceString.length,
|
11064
|
+
highlight: false
|
11065
|
+
});
|
11066
|
+
}
|
10918
11067
|
if (lastChunk && lastChunk.end < sourceString.length) {
|
10919
11068
|
chunks.push({
|
10920
11069
|
start: lastChunk.end,
|
@@ -11150,6 +11299,8 @@
|
|
11150
11299
|
const checkClose = (event) => {
|
11151
11300
|
var _a;
|
11152
11301
|
const swipeItemEl = (_a = swipeItem.value) == null ? void 0 : _a.$el;
|
11302
|
+
if (!swipeItemEl)
|
11303
|
+
return;
|
11153
11304
|
const imageEl = swipeItemEl.firstElementChild;
|
11154
11305
|
const isClickOverlay = event.target === swipeItemEl;
|
11155
11306
|
const isClickImage = imageEl == null ? void 0 : imageEl.contains(event.target);
|
@@ -11619,7 +11770,11 @@
|
|
11619
11770
|
const match = getMatchAnchor(selectActiveIndex);
|
11620
11771
|
if (match) {
|
11621
11772
|
const rect = match.getRect(scrollParent.value, scrollParentRect);
|
11622
|
-
|
11773
|
+
if (props2.sticky && props2.stickyOffsetTop) {
|
11774
|
+
active = getActiveAnchor(rect.top - props2.stickyOffsetTop, rects);
|
11775
|
+
} else {
|
11776
|
+
active = getActiveAnchor(rect.top, rects);
|
11777
|
+
}
|
11623
11778
|
}
|
11624
11779
|
} else {
|
11625
11780
|
active = getActiveAnchor(scrollTop, rects);
|
@@ -11692,7 +11847,11 @@
|
|
11692
11847
|
return;
|
11693
11848
|
}
|
11694
11849
|
if (props2.sticky && props2.stickyOffsetTop) {
|
11695
|
-
|
11850
|
+
if (getRootScrollTop() === offsetHeight - scrollParentRect.height) {
|
11851
|
+
setRootScrollTop(getRootScrollTop());
|
11852
|
+
} else {
|
11853
|
+
setRootScrollTop(getRootScrollTop() - props2.stickyOffsetTop);
|
11854
|
+
}
|
11696
11855
|
}
|
11697
11856
|
emit("select", match.index);
|
11698
11857
|
}
|
@@ -15810,6 +15969,7 @@
|
|
15810
15969
|
"readonly": props2.disableInput,
|
15811
15970
|
"inputmode": props2.integer ? "numeric" : "decimal",
|
15812
15971
|
"placeholder": props2.placeholder,
|
15972
|
+
"autocomplete": "off",
|
15813
15973
|
"aria-valuemax": props2.max,
|
15814
15974
|
"aria-valuemin": props2.min,
|
15815
15975
|
"aria-valuenow": current2.value,
|
@@ -18087,7 +18247,7 @@
|
|
18087
18247
|
});
|
18088
18248
|
}
|
18089
18249
|
};
|
18090
|
-
const version = "4.
|
18250
|
+
const version = "4.9.1";
|
18091
18251
|
function install(app) {
|
18092
18252
|
const components = [
|
18093
18253
|
ActionBar,
|