vant 4.9.6 → 4.9.8
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/calendar/Calendar.mjs +1 -1
- package/es/calendar/CalendarDay.mjs +5 -3
- package/es/calendar/CalendarMonth.mjs +1 -1
- package/es/date-picker/DatePicker.d.ts +3 -3
- package/es/date-picker/DatePicker.mjs +9 -8
- package/es/date-picker/index.d.ts +2 -2
- package/es/date-picker/utils.d.ts +2 -4
- package/es/date-picker/utils.mjs +1 -6
- package/es/dropdown-item/DropdownItem.mjs +1 -0
- package/es/dropdown-menu/DropdownMenu.mjs +1 -0
- package/es/empty/Empty.mjs +39 -18
- package/es/field/Field.mjs +3 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/search/Search.mjs +2 -1
- package/es/tab/Tab.mjs +4 -2
- package/es/tab/TabTitle.mjs +2 -1
- package/es/time-picker/TimePicker.d.ts +3 -7
- package/es/time-picker/TimePicker.mjs +1 -2
- package/es/time-picker/index.d.ts +2 -4
- package/lib/calendar/Calendar.js +1 -1
- package/lib/calendar/CalendarDay.js +5 -3
- package/lib/calendar/CalendarMonth.js +1 -1
- package/lib/date-picker/DatePicker.d.ts +3 -3
- package/lib/date-picker/DatePicker.js +9 -8
- package/lib/date-picker/index.d.ts +2 -2
- package/lib/date-picker/utils.d.ts +2 -4
- package/lib/dropdown-item/DropdownItem.js +1 -0
- package/lib/dropdown-menu/DropdownMenu.js +1 -0
- package/lib/empty/Empty.js +39 -18
- package/lib/field/Field.js +3 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/search/Search.js +2 -1
- package/lib/tab/Tab.js +4 -2
- package/lib/tab/TabTitle.js +2 -1
- package/lib/time-picker/TimePicker.d.ts +3 -7
- package/lib/time-picker/TimePicker.js +1 -2
- package/lib/time-picker/index.d.ts +2 -4
- package/lib/vant.cjs.js +70 -39
- package/lib/vant.es.js +70 -39
- package/lib/vant.js +71 -40
- package/lib/vant.min.js +3 -3
- package/lib/web-types.json +1 -1
- package/package.json +14 -14
package/lib/vant.js
CHANGED
@@ -2376,7 +2376,7 @@
|
|
2376
2376
|
return propRef;
|
2377
2377
|
};
|
2378
2378
|
/**
|
2379
|
-
* @vue/shared v3.5.
|
2379
|
+
* @vue/shared v3.5.11
|
2380
2380
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
2381
2381
|
* @license MIT
|
2382
2382
|
**/
|
@@ -3524,7 +3524,8 @@
|
|
3524
3524
|
"tabindex": props2.disabled ? void 0 : props2.isActive ? 0 : -1,
|
3525
3525
|
"aria-selected": props2.isActive,
|
3526
3526
|
"aria-disabled": props2.disabled || void 0,
|
3527
|
-
"aria-controls": props2.controls
|
3527
|
+
"aria-controls": props2.controls,
|
3528
|
+
"data-allow-mismatch": "attribute"
|
3528
3529
|
}, [renderText()]);
|
3529
3530
|
}
|
3530
3531
|
});
|
@@ -3711,7 +3712,8 @@
|
|
3711
3712
|
}),
|
3712
3713
|
"tabindex": active.value ? 0 : -1,
|
3713
3714
|
"aria-hidden": !active.value,
|
3714
|
-
"aria-labelledby": label
|
3715
|
+
"aria-labelledby": label,
|
3716
|
+
"data-allow-mismatch": "attribute"
|
3715
3717
|
}, {
|
3716
3718
|
default: () => {
|
3717
3719
|
var _a2;
|
@@ -3728,7 +3730,8 @@
|
|
3728
3730
|
"role": "tabpanel",
|
3729
3731
|
"class": bem$1m("panel"),
|
3730
3732
|
"tabindex": show ? 0 : -1,
|
3731
|
-
"aria-labelledby": label
|
3733
|
+
"aria-labelledby": label,
|
3734
|
+
"data-allow-mismatch": "attribute"
|
3732
3735
|
}, [Content]), [[vue.vShow, show]]);
|
3733
3736
|
};
|
3734
3737
|
}
|
@@ -4742,7 +4745,7 @@
|
|
4742
4745
|
if (props2.type === "number" || props2.type === "digit") {
|
4743
4746
|
const isNumber = props2.type === "number";
|
4744
4747
|
value = formatNumber(value, isNumber, isNumber);
|
4745
|
-
if (trigger === "onBlur" && value !== "") {
|
4748
|
+
if (trigger === "onBlur" && value !== "" && (props2.min !== void 0 || props2.max !== void 0)) {
|
4746
4749
|
const adjustedValue = clamp(+value, (_a = props2.min) != null ? _a : -Infinity, (_b = props2.max) != null ? _b : Infinity);
|
4747
4750
|
value = adjustedValue.toString();
|
4748
4751
|
}
|
@@ -4897,6 +4900,7 @@
|
|
4897
4900
|
enterkeyhint: props2.enterkeyhint,
|
4898
4901
|
spellcheck: props2.spellcheck,
|
4899
4902
|
"aria-labelledby": props2.label ? `${id}-label` : void 0,
|
4903
|
+
"data-allow-mismatch": "attribute",
|
4900
4904
|
onBlur,
|
4901
4905
|
onFocus,
|
4902
4906
|
onInput,
|
@@ -4971,6 +4975,7 @@
|
|
4971
4975
|
return vue.createVNode("label", {
|
4972
4976
|
"id": `${id}-label`,
|
4973
4977
|
"for": slots.input ? void 0 : getInputId(),
|
4978
|
+
"data-allow-mismatch": "attribute",
|
4974
4979
|
"onClick": (event) => {
|
4975
4980
|
preventDefault(event);
|
4976
4981
|
focus();
|
@@ -6951,6 +6956,9 @@
|
|
6951
6956
|
}, [slots["bottom-info"] ? slots["bottom-info"](props2.item) : bottomInfo]);
|
6952
6957
|
}
|
6953
6958
|
};
|
6959
|
+
const renderText = () => {
|
6960
|
+
return slots.text ? slots.text(props2.item) : props2.item.text;
|
6961
|
+
};
|
6954
6962
|
const renderContent = () => {
|
6955
6963
|
const {
|
6956
6964
|
item,
|
@@ -6958,10 +6966,9 @@
|
|
6958
6966
|
rowHeight
|
6959
6967
|
} = props2;
|
6960
6968
|
const {
|
6961
|
-
type
|
6962
|
-
text
|
6969
|
+
type
|
6963
6970
|
} = item;
|
6964
|
-
const Nodes = [renderTopInfo(),
|
6971
|
+
const Nodes = [renderTopInfo(), renderText(), renderBottomInfo()];
|
6965
6972
|
if (type === "selected") {
|
6966
6973
|
return vue.createVNode("div", {
|
6967
6974
|
"class": bem$13("selected-day"),
|
@@ -7178,7 +7185,7 @@
|
|
7178
7185
|
"rowHeight": rowHeight.value,
|
7179
7186
|
"onClick": (item2) => emit("click", item2),
|
7180
7187
|
"onClickDisabledDate": (item2) => emit("clickDisabledDate", item2)
|
7181
|
-
}, pick(slots, ["top-info", "bottom-info"]));
|
7188
|
+
}, pick(slots, ["top-info", "bottom-info", "text"]));
|
7182
7189
|
const renderDays = () => vue.createVNode("div", {
|
7183
7190
|
"ref": daysRef,
|
7184
7191
|
"role": "grid",
|
@@ -7652,7 +7659,7 @@
|
|
7652
7659
|
}, pick(props2, ["type", "color", "showMark", "formatter", "rowHeight", "showSubtitle", "allowSameDay"]), {
|
7653
7660
|
"onClick": onClickDay,
|
7654
7661
|
"onClickDisabledDate": (item) => emit("clickDisabledDate", item)
|
7655
|
-
}), pick(slots, ["top-info", "bottom-info", "month-title"]));
|
7662
|
+
}), pick(slots, ["top-info", "bottom-info", "month-title", "text"]));
|
7656
7663
|
};
|
7657
7664
|
const renderFooterButton = () => {
|
7658
7665
|
if (slots.footer) {
|
@@ -9317,22 +9324,26 @@
|
|
9317
9324
|
"fx": "50%",
|
9318
9325
|
"fy": "54%",
|
9319
9326
|
"r": "297%",
|
9320
|
-
"gradientTransform": "matrix(-.16 0 0 -.33 .58 .72)"
|
9327
|
+
"gradientTransform": "matrix(-.16 0 0 -.33 .58 .72)",
|
9328
|
+
"data-allow-mismatch": "attribute"
|
9321
9329
|
}, [renderStop("#EBEDF0", 0), renderStop("#F2F3F5", 100, 0.3)])]), vue.createVNode("ellipse", {
|
9322
9330
|
"fill": getUrlById(id),
|
9323
9331
|
"opacity": ".8",
|
9324
9332
|
"cx": "80",
|
9325
9333
|
"cy": "140",
|
9326
9334
|
"rx": "46",
|
9327
|
-
"ry": "8"
|
9335
|
+
"ry": "8",
|
9336
|
+
"data-allow-mismatch": "attribute"
|
9328
9337
|
}, null)];
|
9329
9338
|
const renderBuilding = () => [vue.createVNode("defs", null, [vue.createVNode("linearGradient", {
|
9330
9339
|
"id": getId("a"),
|
9331
9340
|
"x1": "64%",
|
9332
9341
|
"y1": "100%",
|
9333
|
-
"x2": "64%"
|
9342
|
+
"x2": "64%",
|
9343
|
+
"data-allow-mismatch": "attribute"
|
9334
9344
|
}, [renderStop("#FFF", 0, 0.5), renderStop("#F2F3F5", 100)])]), vue.createVNode("g", {
|
9335
|
-
"opacity": ".8"
|
9345
|
+
"opacity": ".8",
|
9346
|
+
"data-allow-mismatch": "children"
|
9336
9347
|
}, [vue.createVNode("path", {
|
9337
9348
|
"d": "M36 131V53H16v20H2v58h34z",
|
9338
9349
|
"fill": getUrlById("a")
|
@@ -9345,9 +9356,11 @@
|
|
9345
9356
|
"x1": "64%",
|
9346
9357
|
"y1": "97%",
|
9347
9358
|
"x2": "64%",
|
9348
|
-
"y2": "0%"
|
9359
|
+
"y2": "0%",
|
9360
|
+
"data-allow-mismatch": "attribute"
|
9349
9361
|
}, [renderStop("#F2F3F5", 0, 0.3), renderStop("#F2F3F5", 100)])]), vue.createVNode("g", {
|
9350
|
-
"opacity": ".8"
|
9362
|
+
"opacity": ".8",
|
9363
|
+
"data-allow-mismatch": "children"
|
9351
9364
|
}, [vue.createVNode("path", {
|
9352
9365
|
"d": "M87 6c3 0 7 3 8 6a8 8 0 1 1-1 16H80a7 7 0 0 1-8-6c0-4 3-7 6-7 0-5 4-9 9-9Z",
|
9353
9366
|
"fill": getUrlById("b")
|
@@ -9357,7 +9370,9 @@
|
|
9357
9370
|
}, null)])];
|
9358
9371
|
const renderNetwork = () => vue.createVNode("svg", {
|
9359
9372
|
"viewBox": "0 0 160 160"
|
9360
|
-
}, [vue.createVNode("defs",
|
9373
|
+
}, [vue.createVNode("defs", {
|
9374
|
+
"data-allow-mismatch": "children"
|
9375
|
+
}, [vue.createVNode("linearGradient", {
|
9361
9376
|
"id": getId(1),
|
9362
9377
|
"x1": "64%",
|
9363
9378
|
"y1": "100%",
|
@@ -9384,14 +9399,17 @@
|
|
9384
9399
|
"fill": "none"
|
9385
9400
|
}, [renderBuilding(), vue.createVNode("path", {
|
9386
9401
|
"fill": getUrlById(4),
|
9387
|
-
"d": "M0 139h160v21H0z"
|
9402
|
+
"d": "M0 139h160v21H0z",
|
9403
|
+
"data-allow-mismatch": "attribute"
|
9388
9404
|
}, null), vue.createVNode("path", {
|
9389
9405
|
"d": "M80 54a7 7 0 0 1 3 13v27l-2 2h-2a2 2 0 0 1-2-2V67a7 7 0 0 1 3-13z",
|
9390
|
-
"fill": getUrlById(2)
|
9406
|
+
"fill": getUrlById(2),
|
9407
|
+
"data-allow-mismatch": "attribute"
|
9391
9408
|
}, null), vue.createVNode("g", {
|
9392
9409
|
"opacity": ".6",
|
9393
9410
|
"stroke-linecap": "round",
|
9394
|
-
"stroke-width": "7"
|
9411
|
+
"stroke-width": "7",
|
9412
|
+
"data-allow-mismatch": "children"
|
9395
9413
|
}, [vue.createVNode("path", {
|
9396
9414
|
"d": "M64 47a19 19 0 0 0-5 13c0 5 2 10 5 13",
|
9397
9415
|
"stroke": getUrlById(3)
|
@@ -9428,7 +9446,9 @@
|
|
9428
9446
|
}, null)])])]);
|
9429
9447
|
const renderMaterial = () => vue.createVNode("svg", {
|
9430
9448
|
"viewBox": "0 0 160 160"
|
9431
|
-
}, [vue.createVNode("defs",
|
9449
|
+
}, [vue.createVNode("defs", {
|
9450
|
+
"data-allow-mismatch": "children"
|
9451
|
+
}, [vue.createVNode("linearGradient", {
|
9432
9452
|
"x1": "50%",
|
9433
9453
|
"x2": "50%",
|
9434
9454
|
"y2": "100%",
|
@@ -9461,7 +9481,8 @@
|
|
9461
9481
|
"fill": getUrlById(5),
|
9462
9482
|
"width": "64",
|
9463
9483
|
"height": "66",
|
9464
|
-
"rx": "2"
|
9484
|
+
"rx": "2",
|
9485
|
+
"data-allow-mismatch": "attribute"
|
9465
9486
|
}, null), vue.createVNode("rect", {
|
9466
9487
|
"fill": "#FFF",
|
9467
9488
|
"x": "6",
|
@@ -9471,7 +9492,8 @@
|
|
9471
9492
|
"rx": "1"
|
9472
9493
|
}, null), vue.createVNode("g", {
|
9473
9494
|
"transform": "translate(15 17)",
|
9474
|
-
"fill": getUrlById(6)
|
9495
|
+
"fill": getUrlById(6),
|
9496
|
+
"data-allow-mismatch": "attribute"
|
9475
9497
|
}, [vue.createVNode("rect", {
|
9476
9498
|
"width": "34",
|
9477
9499
|
"height": "6",
|
@@ -9488,7 +9510,8 @@
|
|
9488
9510
|
"y": "61",
|
9489
9511
|
"width": "88",
|
9490
9512
|
"height": "28",
|
9491
|
-
"rx": "1"
|
9513
|
+
"rx": "1",
|
9514
|
+
"data-allow-mismatch": "attribute"
|
9492
9515
|
}, null), vue.createVNode("rect", {
|
9493
9516
|
"fill": "#F7F8FA",
|
9494
9517
|
"x": "29",
|
@@ -9503,14 +9526,18 @@
|
|
9503
9526
|
"x1": "50%",
|
9504
9527
|
"x2": "50%",
|
9505
9528
|
"y2": "100%",
|
9506
|
-
"id": getId(8)
|
9529
|
+
"id": getId(8),
|
9530
|
+
"data-allow-mismatch": "attribute"
|
9507
9531
|
}, [renderStops("#EAEDF1", "#DCDEE0")])]), renderBuilding(), renderCloud(), renderShadow("c"), vue.createVNode("path", {
|
9508
9532
|
"d": "m59 60 21 21 21-21h3l9 9v3L92 93l21 21v3l-9 9h-3l-21-21-21 21h-3l-9-9v-3l21-21-21-21v-3l9-9h3Z",
|
9509
|
-
"fill": getUrlById(8)
|
9533
|
+
"fill": getUrlById(8),
|
9534
|
+
"data-allow-mismatch": "attribute"
|
9510
9535
|
}, null)]);
|
9511
9536
|
const renderSearch = () => vue.createVNode("svg", {
|
9512
9537
|
"viewBox": "0 0 160 160"
|
9513
|
-
}, [vue.createVNode("defs",
|
9538
|
+
}, [vue.createVNode("defs", {
|
9539
|
+
"data-allow-mismatch": "children"
|
9540
|
+
}, [vue.createVNode("linearGradient", {
|
9514
9541
|
"x1": "50%",
|
9515
9542
|
"y1": "100%",
|
9516
9543
|
"x2": "50%",
|
@@ -9532,7 +9559,8 @@
|
|
9532
9559
|
"id": getId(12)
|
9533
9560
|
}, [renderStops("#FFF", "#F7F8FA")])]), renderBuilding(), renderCloud(), renderShadow("d"), vue.createVNode("g", {
|
9534
9561
|
"transform": "rotate(-45 113 -4)",
|
9535
|
-
"fill": "none"
|
9562
|
+
"fill": "none",
|
9563
|
+
"data-allow-mismatch": "children"
|
9536
9564
|
}, [vue.createVNode("rect", {
|
9537
9565
|
"fill": getUrlById(9),
|
9538
9566
|
"x": "24",
|
@@ -9802,11 +9830,7 @@
|
|
9802
9830
|
const currentValues = vue.ref(props2.modelValue);
|
9803
9831
|
const updatedByExternalSources = vue.ref(false);
|
9804
9832
|
const pickerRef = vue.ref();
|
9805
|
-
const
|
9806
|
-
const minYear = props2.minDate.getFullYear();
|
9807
|
-
const maxYear = props2.maxDate.getFullYear();
|
9808
|
-
return genOptions(minYear, maxYear, "year", props2.formatter, props2.filter);
|
9809
|
-
};
|
9833
|
+
const computedValues = vue.computed(() => updatedByExternalSources.value ? props2.modelValue : currentValues.value);
|
9810
9834
|
const isMinYear = (year) => year === props2.minDate.getFullYear();
|
9811
9835
|
const isMaxYear = (year) => year === props2.maxDate.getFullYear();
|
9812
9836
|
const isMinMonth = (month) => month === props2.minDate.getMonth() + 1;
|
@@ -9817,7 +9841,7 @@
|
|
9817
9841
|
columnsType
|
9818
9842
|
} = props2;
|
9819
9843
|
const index = columnsType.indexOf(type);
|
9820
|
-
const value =
|
9844
|
+
const value = computedValues.value[index];
|
9821
9845
|
if (value) {
|
9822
9846
|
return +value;
|
9823
9847
|
}
|
@@ -9830,18 +9854,23 @@
|
|
9830
9854
|
return minDate.getDate();
|
9831
9855
|
}
|
9832
9856
|
};
|
9857
|
+
const genYearOptions = () => {
|
9858
|
+
const minYear = props2.minDate.getFullYear();
|
9859
|
+
const maxYear = props2.maxDate.getFullYear();
|
9860
|
+
return genOptions(minYear, maxYear, "year", props2.formatter, props2.filter, computedValues.value);
|
9861
|
+
};
|
9833
9862
|
const genMonthOptions = () => {
|
9834
9863
|
const year = getValue2("year");
|
9835
9864
|
const minMonth = isMinYear(year) ? props2.minDate.getMonth() + 1 : 1;
|
9836
9865
|
const maxMonth = isMaxYear(year) ? props2.maxDate.getMonth() + 1 : 12;
|
9837
|
-
return genOptions(minMonth, maxMonth, "month", props2.formatter, props2.filter);
|
9866
|
+
return genOptions(minMonth, maxMonth, "month", props2.formatter, props2.filter, computedValues.value);
|
9838
9867
|
};
|
9839
9868
|
const genDayOptions = () => {
|
9840
9869
|
const year = getValue2("year");
|
9841
9870
|
const month = getValue2("month");
|
9842
9871
|
const minDate = isMinYear(year) && isMinMonth(month) ? props2.minDate.getDate() : 1;
|
9843
9872
|
const maxDate = isMaxYear(year) && isMaxMonth(month) ? props2.maxDate.getDate() : getMonthEndDay(year, month);
|
9844
|
-
return genOptions(minDate, maxDate, "day", props2.formatter, props2.filter);
|
9873
|
+
return genOptions(minDate, maxDate, "day", props2.formatter, props2.filter, computedValues.value);
|
9845
9874
|
};
|
9846
9875
|
const confirm = () => {
|
9847
9876
|
var _a;
|
@@ -10288,6 +10317,7 @@
|
|
10288
10317
|
"id": `${id}-${index}`,
|
10289
10318
|
"role": "button",
|
10290
10319
|
"tabindex": disabled ? void 0 : 0,
|
10320
|
+
"data-allow-mismatch": "attribute",
|
10291
10321
|
"class": [bem$L("item", {
|
10292
10322
|
disabled,
|
10293
10323
|
grow: scrollable.value
|
@@ -10497,6 +10527,7 @@
|
|
10497
10527
|
position: "absolute"
|
10498
10528
|
},
|
10499
10529
|
"aria-labelledby": `${parent.id}-${index.value}`,
|
10530
|
+
"data-allow-mismatch": "attribute",
|
10500
10531
|
"closeOnClickOverlay": closeOnClickOverlay,
|
10501
10532
|
"onOpen": onOpen,
|
10502
10533
|
"onClose": onClose,
|
@@ -14638,7 +14669,8 @@
|
|
14638
14669
|
if (slots.label || props2.label) {
|
14639
14670
|
return vue.createVNode("label", {
|
14640
14671
|
"class": bem$m("label"),
|
14641
|
-
"for": getInputId()
|
14672
|
+
"for": getInputId(),
|
14673
|
+
"data-allow-mismatch": "attribute"
|
14642
14674
|
}, [slots.label ? slots.label() : props2.label]);
|
14643
14675
|
}
|
14644
14676
|
};
|
@@ -16624,8 +16656,7 @@
|
|
16624
16656
|
columnsType: {
|
16625
16657
|
type: Array,
|
16626
16658
|
default: () => ["hour", "minute"]
|
16627
|
-
}
|
16628
|
-
filter: Function
|
16659
|
+
}
|
16629
16660
|
});
|
16630
16661
|
var stdin_default$8 = vue.defineComponent({
|
16631
16662
|
name: name$3,
|
@@ -18239,7 +18270,7 @@
|
|
18239
18270
|
});
|
18240
18271
|
}
|
18241
18272
|
};
|
18242
|
-
const version = "4.9.
|
18273
|
+
const version = "4.9.8";
|
18243
18274
|
function install(app) {
|
18244
18275
|
const components = [
|
18245
18276
|
ActionBar,
|