vant 4.9.7 → 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/lib/vant.cjs.js CHANGED
@@ -4283,7 +4283,7 @@ var stdin_default$1v = vue.defineComponent({
4283
4283
  if (props2.type === "number" || props2.type === "digit") {
4284
4284
  const isNumber = props2.type === "number";
4285
4285
  value = formatNumber(value, isNumber, isNumber);
4286
- if (trigger === "onBlur" && value !== "") {
4286
+ if (trigger === "onBlur" && value !== "" && (props2.min !== void 0 || props2.max !== void 0)) {
4287
4287
  const adjustedValue = clamp(+value, (_a = props2.min) != null ? _a : -Infinity, (_b = props2.max) != null ? _b : Infinity);
4288
4288
  value = adjustedValue.toString();
4289
4289
  }
@@ -6497,6 +6497,9 @@ var stdin_default$1g = vue.defineComponent({
6497
6497
  }, [slots["bottom-info"] ? slots["bottom-info"](props2.item) : bottomInfo]);
6498
6498
  }
6499
6499
  };
6500
+ const renderText = () => {
6501
+ return slots.text ? slots.text(props2.item) : props2.item.text;
6502
+ };
6500
6503
  const renderContent = () => {
6501
6504
  const {
6502
6505
  item,
@@ -6504,10 +6507,9 @@ var stdin_default$1g = vue.defineComponent({
6504
6507
  rowHeight
6505
6508
  } = props2;
6506
6509
  const {
6507
- type,
6508
- text
6510
+ type
6509
6511
  } = item;
6510
- const Nodes = [renderTopInfo(), text, renderBottomInfo()];
6512
+ const Nodes = [renderTopInfo(), renderText(), renderBottomInfo()];
6511
6513
  if (type === "selected") {
6512
6514
  return vue.createVNode("div", {
6513
6515
  "class": bem$13("selected-day"),
@@ -6724,7 +6726,7 @@ var stdin_default$1f = vue.defineComponent({
6724
6726
  "rowHeight": rowHeight.value,
6725
6727
  "onClick": (item2) => emit("click", item2),
6726
6728
  "onClickDisabledDate": (item2) => emit("clickDisabledDate", item2)
6727
- }, pick(slots, ["top-info", "bottom-info"]));
6729
+ }, pick(slots, ["top-info", "bottom-info", "text"]));
6728
6730
  const renderDays = () => vue.createVNode("div", {
6729
6731
  "ref": daysRef,
6730
6732
  "role": "grid",
@@ -7198,7 +7200,7 @@ var stdin_default$1d = vue.defineComponent({
7198
7200
  }, pick(props2, ["type", "color", "showMark", "formatter", "rowHeight", "showSubtitle", "allowSameDay"]), {
7199
7201
  "onClick": onClickDay,
7200
7202
  "onClickDisabledDate": (item) => emit("clickDisabledDate", item)
7201
- }), pick(slots, ["top-info", "bottom-info", "month-title"]));
7203
+ }), pick(slots, ["top-info", "bottom-info", "month-title", "text"]));
7202
7204
  };
7203
7205
  const renderFooterButton = () => {
7204
7206
  if (slots.footer) {
@@ -9386,11 +9388,7 @@ var stdin_default$X = vue.defineComponent({
9386
9388
  const currentValues = vue.ref(props2.modelValue);
9387
9389
  const updatedByExternalSources = vue.ref(false);
9388
9390
  const pickerRef = vue.ref();
9389
- const genYearOptions = () => {
9390
- const minYear = props2.minDate.getFullYear();
9391
- const maxYear = props2.maxDate.getFullYear();
9392
- return genOptions(minYear, maxYear, "year", props2.formatter, props2.filter);
9393
- };
9391
+ const computedValues = vue.computed(() => updatedByExternalSources.value ? props2.modelValue : currentValues.value);
9394
9392
  const isMinYear = (year) => year === props2.minDate.getFullYear();
9395
9393
  const isMaxYear = (year) => year === props2.maxDate.getFullYear();
9396
9394
  const isMinMonth = (month) => month === props2.minDate.getMonth() + 1;
@@ -9401,7 +9399,7 @@ var stdin_default$X = vue.defineComponent({
9401
9399
  columnsType
9402
9400
  } = props2;
9403
9401
  const index = columnsType.indexOf(type);
9404
- const value = updatedByExternalSources.value ? props2.modelValue[index] : currentValues.value[index];
9402
+ const value = computedValues.value[index];
9405
9403
  if (value) {
9406
9404
  return +value;
9407
9405
  }
@@ -9414,18 +9412,23 @@ var stdin_default$X = vue.defineComponent({
9414
9412
  return minDate.getDate();
9415
9413
  }
9416
9414
  };
9415
+ const genYearOptions = () => {
9416
+ const minYear = props2.minDate.getFullYear();
9417
+ const maxYear = props2.maxDate.getFullYear();
9418
+ return genOptions(minYear, maxYear, "year", props2.formatter, props2.filter, computedValues.value);
9419
+ };
9417
9420
  const genMonthOptions = () => {
9418
9421
  const year = getValue2("year");
9419
9422
  const minMonth = isMinYear(year) ? props2.minDate.getMonth() + 1 : 1;
9420
9423
  const maxMonth = isMaxYear(year) ? props2.maxDate.getMonth() + 1 : 12;
9421
- return genOptions(minMonth, maxMonth, "month", props2.formatter, props2.filter);
9424
+ return genOptions(minMonth, maxMonth, "month", props2.formatter, props2.filter, computedValues.value);
9422
9425
  };
9423
9426
  const genDayOptions = () => {
9424
9427
  const year = getValue2("year");
9425
9428
  const month = getValue2("month");
9426
9429
  const minDate = isMinYear(year) && isMinMonth(month) ? props2.minDate.getDate() : 1;
9427
9430
  const maxDate = isMaxYear(year) && isMaxMonth(month) ? props2.maxDate.getDate() : getMonthEndDay(year, month);
9428
- return genOptions(minDate, maxDate, "day", props2.formatter, props2.filter);
9431
+ return genOptions(minDate, maxDate, "day", props2.formatter, props2.filter, computedValues.value);
9429
9432
  };
9430
9433
  const confirm = () => {
9431
9434
  var _a;
@@ -15420,8 +15423,7 @@ const timePickerProps = extend({}, sharedProps, {
15420
15423
  columnsType: {
15421
15424
  type: Array,
15422
15425
  default: () => ["hour", "minute"]
15423
- },
15424
- filter: Function
15426
+ }
15425
15427
  });
15426
15428
  var stdin_default$8 = vue.defineComponent({
15427
15429
  name: name$3,
@@ -17055,7 +17057,7 @@ const Lazyload = {
17055
17057
  });
17056
17058
  }
17057
17059
  };
17058
- const version = "4.9.7";
17060
+ const version = "4.9.8";
17059
17061
  function install(app) {
17060
17062
  const components = [
17061
17063
  ActionBar,
package/lib/vant.es.js CHANGED
@@ -4281,7 +4281,7 @@ var stdin_default$1v = defineComponent({
4281
4281
  if (props2.type === "number" || props2.type === "digit") {
4282
4282
  const isNumber = props2.type === "number";
4283
4283
  value = formatNumber(value, isNumber, isNumber);
4284
- if (trigger === "onBlur" && value !== "") {
4284
+ if (trigger === "onBlur" && value !== "" && (props2.min !== void 0 || props2.max !== void 0)) {
4285
4285
  const adjustedValue = clamp(+value, (_a = props2.min) != null ? _a : -Infinity, (_b = props2.max) != null ? _b : Infinity);
4286
4286
  value = adjustedValue.toString();
4287
4287
  }
@@ -6495,6 +6495,9 @@ var stdin_default$1g = defineComponent({
6495
6495
  }, [slots["bottom-info"] ? slots["bottom-info"](props2.item) : bottomInfo]);
6496
6496
  }
6497
6497
  };
6498
+ const renderText = () => {
6499
+ return slots.text ? slots.text(props2.item) : props2.item.text;
6500
+ };
6498
6501
  const renderContent = () => {
6499
6502
  const {
6500
6503
  item,
@@ -6502,10 +6505,9 @@ var stdin_default$1g = defineComponent({
6502
6505
  rowHeight
6503
6506
  } = props2;
6504
6507
  const {
6505
- type,
6506
- text
6508
+ type
6507
6509
  } = item;
6508
- const Nodes = [renderTopInfo(), text, renderBottomInfo()];
6510
+ const Nodes = [renderTopInfo(), renderText(), renderBottomInfo()];
6509
6511
  if (type === "selected") {
6510
6512
  return createVNode("div", {
6511
6513
  "class": bem$13("selected-day"),
@@ -6722,7 +6724,7 @@ var stdin_default$1f = defineComponent({
6722
6724
  "rowHeight": rowHeight.value,
6723
6725
  "onClick": (item2) => emit("click", item2),
6724
6726
  "onClickDisabledDate": (item2) => emit("clickDisabledDate", item2)
6725
- }, pick(slots, ["top-info", "bottom-info"]));
6727
+ }, pick(slots, ["top-info", "bottom-info", "text"]));
6726
6728
  const renderDays = () => createVNode("div", {
6727
6729
  "ref": daysRef,
6728
6730
  "role": "grid",
@@ -7196,7 +7198,7 @@ var stdin_default$1d = defineComponent({
7196
7198
  }, pick(props2, ["type", "color", "showMark", "formatter", "rowHeight", "showSubtitle", "allowSameDay"]), {
7197
7199
  "onClick": onClickDay,
7198
7200
  "onClickDisabledDate": (item) => emit("clickDisabledDate", item)
7199
- }), pick(slots, ["top-info", "bottom-info", "month-title"]));
7201
+ }), pick(slots, ["top-info", "bottom-info", "month-title", "text"]));
7200
7202
  };
7201
7203
  const renderFooterButton = () => {
7202
7204
  if (slots.footer) {
@@ -9384,11 +9386,7 @@ var stdin_default$X = defineComponent({
9384
9386
  const currentValues = ref(props2.modelValue);
9385
9387
  const updatedByExternalSources = ref(false);
9386
9388
  const pickerRef = ref();
9387
- const genYearOptions = () => {
9388
- const minYear = props2.minDate.getFullYear();
9389
- const maxYear = props2.maxDate.getFullYear();
9390
- return genOptions(minYear, maxYear, "year", props2.formatter, props2.filter);
9391
- };
9389
+ const computedValues = computed(() => updatedByExternalSources.value ? props2.modelValue : currentValues.value);
9392
9390
  const isMinYear = (year) => year === props2.minDate.getFullYear();
9393
9391
  const isMaxYear = (year) => year === props2.maxDate.getFullYear();
9394
9392
  const isMinMonth = (month) => month === props2.minDate.getMonth() + 1;
@@ -9399,7 +9397,7 @@ var stdin_default$X = defineComponent({
9399
9397
  columnsType
9400
9398
  } = props2;
9401
9399
  const index = columnsType.indexOf(type);
9402
- const value = updatedByExternalSources.value ? props2.modelValue[index] : currentValues.value[index];
9400
+ const value = computedValues.value[index];
9403
9401
  if (value) {
9404
9402
  return +value;
9405
9403
  }
@@ -9412,18 +9410,23 @@ var stdin_default$X = defineComponent({
9412
9410
  return minDate.getDate();
9413
9411
  }
9414
9412
  };
9413
+ const genYearOptions = () => {
9414
+ const minYear = props2.minDate.getFullYear();
9415
+ const maxYear = props2.maxDate.getFullYear();
9416
+ return genOptions(minYear, maxYear, "year", props2.formatter, props2.filter, computedValues.value);
9417
+ };
9415
9418
  const genMonthOptions = () => {
9416
9419
  const year = getValue2("year");
9417
9420
  const minMonth = isMinYear(year) ? props2.minDate.getMonth() + 1 : 1;
9418
9421
  const maxMonth = isMaxYear(year) ? props2.maxDate.getMonth() + 1 : 12;
9419
- return genOptions(minMonth, maxMonth, "month", props2.formatter, props2.filter);
9422
+ return genOptions(minMonth, maxMonth, "month", props2.formatter, props2.filter, computedValues.value);
9420
9423
  };
9421
9424
  const genDayOptions = () => {
9422
9425
  const year = getValue2("year");
9423
9426
  const month = getValue2("month");
9424
9427
  const minDate = isMinYear(year) && isMinMonth(month) ? props2.minDate.getDate() : 1;
9425
9428
  const maxDate = isMaxYear(year) && isMaxMonth(month) ? props2.maxDate.getDate() : getMonthEndDay(year, month);
9426
- return genOptions(minDate, maxDate, "day", props2.formatter, props2.filter);
9429
+ return genOptions(minDate, maxDate, "day", props2.formatter, props2.filter, computedValues.value);
9427
9430
  };
9428
9431
  const confirm = () => {
9429
9432
  var _a;
@@ -15418,8 +15421,7 @@ const timePickerProps = extend({}, sharedProps, {
15418
15421
  columnsType: {
15419
15422
  type: Array,
15420
15423
  default: () => ["hour", "minute"]
15421
- },
15422
- filter: Function
15424
+ }
15423
15425
  });
15424
15426
  var stdin_default$8 = defineComponent({
15425
15427
  name: name$3,
@@ -17053,7 +17055,7 @@ const Lazyload = {
17053
17055
  });
17054
17056
  }
17055
17057
  };
17056
- const version = "4.9.7";
17058
+ const version = "4.9.8";
17057
17059
  function install(app) {
17058
17060
  const components = [
17059
17061
  ActionBar,
package/lib/vant.js CHANGED
@@ -2376,7 +2376,7 @@
2376
2376
  return propRef;
2377
2377
  };
2378
2378
  /**
2379
- * @vue/shared v3.5.5
2379
+ * @vue/shared v3.5.11
2380
2380
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
2381
2381
  * @license MIT
2382
2382
  **/
@@ -4745,7 +4745,7 @@
4745
4745
  if (props2.type === "number" || props2.type === "digit") {
4746
4746
  const isNumber = props2.type === "number";
4747
4747
  value = formatNumber(value, isNumber, isNumber);
4748
- if (trigger === "onBlur" && value !== "") {
4748
+ if (trigger === "onBlur" && value !== "" && (props2.min !== void 0 || props2.max !== void 0)) {
4749
4749
  const adjustedValue = clamp(+value, (_a = props2.min) != null ? _a : -Infinity, (_b = props2.max) != null ? _b : Infinity);
4750
4750
  value = adjustedValue.toString();
4751
4751
  }
@@ -6956,6 +6956,9 @@
6956
6956
  }, [slots["bottom-info"] ? slots["bottom-info"](props2.item) : bottomInfo]);
6957
6957
  }
6958
6958
  };
6959
+ const renderText = () => {
6960
+ return slots.text ? slots.text(props2.item) : props2.item.text;
6961
+ };
6959
6962
  const renderContent = () => {
6960
6963
  const {
6961
6964
  item,
@@ -6963,10 +6966,9 @@
6963
6966
  rowHeight
6964
6967
  } = props2;
6965
6968
  const {
6966
- type,
6967
- text
6969
+ type
6968
6970
  } = item;
6969
- const Nodes = [renderTopInfo(), text, renderBottomInfo()];
6971
+ const Nodes = [renderTopInfo(), renderText(), renderBottomInfo()];
6970
6972
  if (type === "selected") {
6971
6973
  return vue.createVNode("div", {
6972
6974
  "class": bem$13("selected-day"),
@@ -7183,7 +7185,7 @@
7183
7185
  "rowHeight": rowHeight.value,
7184
7186
  "onClick": (item2) => emit("click", item2),
7185
7187
  "onClickDisabledDate": (item2) => emit("clickDisabledDate", item2)
7186
- }, pick(slots, ["top-info", "bottom-info"]));
7188
+ }, pick(slots, ["top-info", "bottom-info", "text"]));
7187
7189
  const renderDays = () => vue.createVNode("div", {
7188
7190
  "ref": daysRef,
7189
7191
  "role": "grid",
@@ -7657,7 +7659,7 @@
7657
7659
  }, pick(props2, ["type", "color", "showMark", "formatter", "rowHeight", "showSubtitle", "allowSameDay"]), {
7658
7660
  "onClick": onClickDay,
7659
7661
  "onClickDisabledDate": (item) => emit("clickDisabledDate", item)
7660
- }), pick(slots, ["top-info", "bottom-info", "month-title"]));
7662
+ }), pick(slots, ["top-info", "bottom-info", "month-title", "text"]));
7661
7663
  };
7662
7664
  const renderFooterButton = () => {
7663
7665
  if (slots.footer) {
@@ -9828,11 +9830,7 @@
9828
9830
  const currentValues = vue.ref(props2.modelValue);
9829
9831
  const updatedByExternalSources = vue.ref(false);
9830
9832
  const pickerRef = vue.ref();
9831
- const genYearOptions = () => {
9832
- const minYear = props2.minDate.getFullYear();
9833
- const maxYear = props2.maxDate.getFullYear();
9834
- return genOptions(minYear, maxYear, "year", props2.formatter, props2.filter);
9835
- };
9833
+ const computedValues = vue.computed(() => updatedByExternalSources.value ? props2.modelValue : currentValues.value);
9836
9834
  const isMinYear = (year) => year === props2.minDate.getFullYear();
9837
9835
  const isMaxYear = (year) => year === props2.maxDate.getFullYear();
9838
9836
  const isMinMonth = (month) => month === props2.minDate.getMonth() + 1;
@@ -9843,7 +9841,7 @@
9843
9841
  columnsType
9844
9842
  } = props2;
9845
9843
  const index = columnsType.indexOf(type);
9846
- const value = updatedByExternalSources.value ? props2.modelValue[index] : currentValues.value[index];
9844
+ const value = computedValues.value[index];
9847
9845
  if (value) {
9848
9846
  return +value;
9849
9847
  }
@@ -9856,18 +9854,23 @@
9856
9854
  return minDate.getDate();
9857
9855
  }
9858
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
+ };
9859
9862
  const genMonthOptions = () => {
9860
9863
  const year = getValue2("year");
9861
9864
  const minMonth = isMinYear(year) ? props2.minDate.getMonth() + 1 : 1;
9862
9865
  const maxMonth = isMaxYear(year) ? props2.maxDate.getMonth() + 1 : 12;
9863
- return genOptions(minMonth, maxMonth, "month", props2.formatter, props2.filter);
9866
+ return genOptions(minMonth, maxMonth, "month", props2.formatter, props2.filter, computedValues.value);
9864
9867
  };
9865
9868
  const genDayOptions = () => {
9866
9869
  const year = getValue2("year");
9867
9870
  const month = getValue2("month");
9868
9871
  const minDate = isMinYear(year) && isMinMonth(month) ? props2.minDate.getDate() : 1;
9869
9872
  const maxDate = isMaxYear(year) && isMaxMonth(month) ? props2.maxDate.getDate() : getMonthEndDay(year, month);
9870
- return genOptions(minDate, maxDate, "day", props2.formatter, props2.filter);
9873
+ return genOptions(minDate, maxDate, "day", props2.formatter, props2.filter, computedValues.value);
9871
9874
  };
9872
9875
  const confirm = () => {
9873
9876
  var _a;
@@ -16653,8 +16656,7 @@
16653
16656
  columnsType: {
16654
16657
  type: Array,
16655
16658
  default: () => ["hour", "minute"]
16656
- },
16657
- filter: Function
16659
+ }
16658
16660
  });
16659
16661
  var stdin_default$8 = vue.defineComponent({
16660
16662
  name: name$3,
@@ -18268,7 +18270,7 @@
18268
18270
  });
18269
18271
  }
18270
18272
  };
18271
- const version = "4.9.7";
18273
+ const version = "4.9.8";
18272
18274
  function install(app) {
18273
18275
  const components = [
18274
18276
  ActionBar,