@varlet/ui 2.9.5 → 2.9.6

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/varlet.cjs.js CHANGED
@@ -1882,13 +1882,13 @@ function ActionSheet(options) {
1882
1882
  reactiveActionSheetOptions.show = true;
1883
1883
  });
1884
1884
  }
1885
- function setDefaultOptions$2(options) {
1885
+ ActionSheet.setDefaultOptions = function(options) {
1886
1886
  defaultOptions$3 = options;
1887
- }
1888
- function resetDefaultOptions$2() {
1887
+ };
1888
+ ActionSheet.resetDefaultOptions = function() {
1889
1889
  defaultOptions$3 = {};
1890
- }
1891
- function close$1() {
1890
+ };
1891
+ ActionSheet.close = function() {
1892
1892
  if (singletonOptions$3 != null) {
1893
1893
  var prevSingletonOptions = singletonOptions$3;
1894
1894
  singletonOptions$3 = null;
@@ -1896,7 +1896,7 @@ function close$1() {
1896
1896
  prevSingletonOptions.show = false;
1897
1897
  });
1898
1898
  }
1899
- }
1899
+ };
1900
1900
  ActionSheet.Component = VarActionSheet;
1901
1901
  VarActionSheet.install = function(app) {
1902
1902
  app.component(VarActionSheet.name, VarActionSheet);
@@ -1904,11 +1904,6 @@ VarActionSheet.install = function(app) {
1904
1904
  ActionSheet.install = function(app) {
1905
1905
  app.component(VarActionSheet.name, VarActionSheet);
1906
1906
  };
1907
- Object.assign(ActionSheet, {
1908
- setDefaultOptions: setDefaultOptions$2,
1909
- resetDefaultOptions: resetDefaultOptions$2,
1910
- close: close$1
1911
- });
1912
1907
  var _ActionSheetComponent = VarActionSheet;
1913
1908
  function positionValidator$3(position) {
1914
1909
  var validPositions = ["left", "center", "right"];
@@ -4507,7 +4502,7 @@ var __sfc__$11 = vue.defineComponent({
4507
4502
  floated.value = false;
4508
4503
  }, props2.floatingDuration);
4509
4504
  };
4510
- var close2 = () => {
4505
+ var close = () => {
4511
4506
  call(props2["onUpdate:floating"], false);
4512
4507
  };
4513
4508
  var handleClick = (e) => {
@@ -4541,7 +4536,7 @@ var __sfc__$11 = vue.defineComponent({
4541
4536
  opacity,
4542
4537
  zIndex,
4543
4538
  isRow,
4544
- close: close2,
4539
+ close,
4545
4540
  showFloatingButtons,
4546
4541
  floated,
4547
4542
  formatElevation,
@@ -9756,7 +9751,7 @@ function __render__$Q(_ctx, _cache) {
9756
9751
  ripple: false,
9757
9752
  elevation: _ctx.componentProps.buttonElevation
9758
9753
  }, _extends$d({}, _ctx.buttonProps(month.index)), {
9759
- onClick: (event) => _ctx.chooseMonth(month, event)
9754
+ onClick: _cache[0] || (_cache[0] = (event) => chooseMonth(month, event))
9760
9755
  }),
9761
9756
  {
9762
9757
  default: vue.withCtx(() => [vue.createTextVNode(
@@ -9768,7 +9763,7 @@ function __render__$Q(_ctx, _cache) {
9768
9763
  /* DYNAMIC */
9769
9764
  },
9770
9765
  1040,
9771
- ["elevation", "onClick"]
9766
+ ["elevation"]
9772
9767
  )]);
9773
9768
  }),
9774
9769
  128
@@ -9879,7 +9874,7 @@ var __sfc__$R = vue.defineComponent({
9879
9874
  var buttonProps = (key) => {
9880
9875
  var {
9881
9876
  choose: {
9882
- chooseMonth: chooseMonth2
9877
+ chooseMonth: chooseMonth3
9883
9878
  },
9884
9879
  preview: {
9885
9880
  previewYear
@@ -9895,7 +9890,7 @@ var __sfc__$R = vue.defineComponent({
9895
9890
  var monthExist = () => {
9896
9891
  if (range || multiple)
9897
9892
  return shouldChoose(val);
9898
- return (chooseMonth2 == null ? void 0 : chooseMonth2.index) === key && isSameYear.value;
9893
+ return (chooseMonth3 == null ? void 0 : chooseMonth3.index) === key && isSameYear.value;
9899
9894
  };
9900
9895
  var computeDisabled = () => {
9901
9896
  if (!inRange(key))
@@ -9910,7 +9905,7 @@ var __sfc__$R = vue.defineComponent({
9910
9905
  return true;
9911
9906
  if (range || multiple)
9912
9907
  return !shouldChoose(val);
9913
- return !isSameYear.value || (chooseMonth2 == null ? void 0 : chooseMonth2.index) !== key;
9908
+ return !isSameYear.value || (chooseMonth3 == null ? void 0 : chooseMonth3.index) !== key;
9914
9909
  };
9915
9910
  var computeOutline = () => {
9916
9911
  if (!(isCurrentYear.value && currentMonth === key && props2.componentProps.showCurrent))
@@ -9920,7 +9915,7 @@ var __sfc__$R = vue.defineComponent({
9920
9915
  if (range || multiple)
9921
9916
  return !shouldChoose(val);
9922
9917
  if (isSameYear.value)
9923
- return (chooseMonth2 == null ? void 0 : chooseMonth2.index) !== currentMonth;
9918
+ return (chooseMonth3 == null ? void 0 : chooseMonth3.index) !== currentMonth;
9924
9919
  return true;
9925
9920
  };
9926
9921
  var textColorOrCover = () => {
@@ -9939,10 +9934,11 @@ var __sfc__$R = vue.defineComponent({
9939
9934
  color: !computeText() ? color : "",
9940
9935
  textColor: isCover ? "" : textColorOrCover(),
9941
9936
  [nDate$1() + "-color-cover"]: isCover,
9942
- class: classes$I(n$Q("button"), [disabled, n$Q("button--disabled")])
9937
+ class: classes$I(n$Q("button"), [disabled, n$Q("button--disabled")]),
9938
+ disabled
9943
9939
  };
9944
9940
  };
9945
- var chooseMonth = (month, event) => {
9941
+ var chooseMonth2 = (month, event) => {
9946
9942
  var buttonEl = event.currentTarget;
9947
9943
  if (buttonEl.classList.contains(n$Q("button--disabled")))
9948
9944
  return;
@@ -9982,7 +9978,7 @@ var __sfc__$R = vue.defineComponent({
9982
9978
  forwardRef,
9983
9979
  buttonProps,
9984
9980
  getMonthAbbr,
9985
- chooseMonth,
9981
+ chooseMonth: chooseMonth2,
9986
9982
  checkDate
9987
9983
  };
9988
9984
  }
@@ -10196,7 +10192,7 @@ function __render__$O(_ctx, _cache) {
10196
10192
  ripple: false,
10197
10193
  elevation: _ctx.componentProps.buttonElevation
10198
10194
  }, _extends$c({}, _ctx.buttonProps(day)), {
10199
- onClick: (event) => _ctx.chooseDay(day, event)
10195
+ onClick: _cache[0] || (_cache[0] = (event) => chooseDay(day, event))
10200
10196
  }),
10201
10197
  {
10202
10198
  default: vue.withCtx(() => [vue.createTextVNode(
@@ -10208,7 +10204,7 @@ function __render__$O(_ctx, _cache) {
10208
10204
  /* DYNAMIC */
10209
10205
  },
10210
10206
  1040,
10211
- ["elevation", "onClick"]
10207
+ ["elevation"]
10212
10208
  )]);
10213
10209
  }),
10214
10210
  128
@@ -10365,12 +10361,13 @@ var __sfc__$P = vue.defineComponent({
10365
10361
  text: true,
10366
10362
  outline: false,
10367
10363
  textColor: "",
10368
- class: n$O("button")
10364
+ class: n$O("button"),
10365
+ disabled: true
10369
10366
  };
10370
10367
  }
10371
10368
  var {
10372
10369
  choose: {
10373
- chooseDay: chooseDay2
10370
+ chooseDay: chooseDay3
10374
10371
  },
10375
10372
  preview: {
10376
10373
  previewYear,
@@ -10387,7 +10384,7 @@ var __sfc__$P = vue.defineComponent({
10387
10384
  var dayExist = () => {
10388
10385
  if (range || multiple)
10389
10386
  return shouldChoose(val);
10390
- return toNumber(chooseDay2) === day && isSame.value;
10387
+ return toNumber(chooseDay3) === day && isSame.value;
10391
10388
  };
10392
10389
  var computeDisabled = () => {
10393
10390
  if (!inRange(day))
@@ -10402,7 +10399,7 @@ var __sfc__$P = vue.defineComponent({
10402
10399
  return true;
10403
10400
  if (range || multiple)
10404
10401
  return !shouldChoose(val);
10405
- return !isSame.value || toNumber(chooseDay2) !== day;
10402
+ return !isSame.value || toNumber(chooseDay3) !== day;
10406
10403
  };
10407
10404
  var computeOutline = () => {
10408
10405
  if (!(isCurrent.value && toNumber(currentDay) === day && props2.componentProps.showCurrent))
@@ -10412,7 +10409,7 @@ var __sfc__$P = vue.defineComponent({
10412
10409
  if (range || multiple)
10413
10410
  return !shouldChoose(val);
10414
10411
  if (isSame.value)
10415
- return chooseDay2 !== currentDay;
10412
+ return chooseDay3 !== currentDay;
10416
10413
  return true;
10417
10414
  };
10418
10415
  var textColorOrCover = () => {
@@ -10430,7 +10427,8 @@ var __sfc__$P = vue.defineComponent({
10430
10427
  outline: computeOutline(),
10431
10428
  textColor: isCover ? "" : textColorOrCover(),
10432
10429
  [nDate() + "-color-cover"]: isCover,
10433
- class: classes$G(n$O("button"), n$O("button--usable"), [disabled, n$O("button--disabled")])
10430
+ class: classes$G(n$O("button"), n$O("button--usable"), [disabled, n$O("button--disabled")]),
10431
+ disabled
10434
10432
  };
10435
10433
  };
10436
10434
  var checkDate = (checkType) => {
@@ -10438,7 +10436,7 @@ var __sfc__$P = vue.defineComponent({
10438
10436
  panelKey.value += checkType === "prev" ? -1 : 1;
10439
10437
  emit("check-preview", "month", checkType);
10440
10438
  };
10441
- var chooseDay = (day, event) => {
10439
+ var chooseDay2 = (day, event) => {
10442
10440
  var buttonEl = event.currentTarget;
10443
10441
  if (buttonEl.classList.contains(n$O("button--disabled")))
10444
10442
  return;
@@ -10468,7 +10466,7 @@ var __sfc__$P = vue.defineComponent({
10468
10466
  filterDay,
10469
10467
  getDayAbbr,
10470
10468
  checkDate,
10471
- chooseDay,
10469
+ chooseDay: chooseDay2,
10472
10470
  buttonProps
10473
10471
  };
10474
10472
  }
@@ -10680,9 +10678,9 @@ var __sfc__$O = vue.defineComponent({
10680
10678
  var isYearPanel = vue.ref(false);
10681
10679
  var isMonthPanel = vue.ref(false);
10682
10680
  var rangeDone = vue.ref(true);
10683
- var chooseMonth = vue.ref();
10681
+ var chooseMonth2 = vue.ref();
10684
10682
  var chooseYear = vue.ref();
10685
- var chooseDay = vue.ref();
10683
+ var chooseDay2 = vue.ref();
10686
10684
  var previewMonth = vue.ref(monthDes);
10687
10685
  var previewYear = vue.ref(currentYear);
10688
10686
  var reverse = vue.ref(false);
@@ -10705,9 +10703,9 @@ var __sfc__$O = vue.defineComponent({
10705
10703
  buttonElevation: props2.buttonElevation
10706
10704
  });
10707
10705
  var getChoose = vue.computed(() => ({
10708
- chooseMonth: chooseMonth.value,
10706
+ chooseMonth: chooseMonth2.value,
10709
10707
  chooseYear: chooseYear.value,
10710
- chooseDay: chooseDay.value,
10708
+ chooseDay: chooseDay2.value,
10711
10709
  chooseMonths: chooseMonths.value,
10712
10710
  chooseDays: chooseDays.value,
10713
10711
  chooseRangeMonth: chooseRangeMonth.value,
@@ -10726,9 +10724,9 @@ var __sfc__$O = vue.defineComponent({
10726
10724
  return chooseRangeMonth.value.length ? chooseRangeMonth.value[0] + " ~ " + chooseRangeMonth.value[1] : "";
10727
10725
  }
10728
10726
  var monthName = "";
10729
- if (chooseMonth.value) {
10727
+ if (chooseMonth2.value) {
10730
10728
  var _pack$value$datePicke, _pack$value$datePicke2;
10731
- monthName = (_pack$value$datePicke = (_pack$value$datePicke2 = pack.value.datePickerMonthDict) == null ? void 0 : _pack$value$datePicke2[chooseMonth.value.index].name) != null ? _pack$value$datePicke : "";
10729
+ monthName = (_pack$value$datePicke = (_pack$value$datePicke2 = pack.value.datePickerMonthDict) == null ? void 0 : _pack$value$datePicke2[chooseMonth2.value.index].name) != null ? _pack$value$datePicke : "";
10732
10730
  }
10733
10731
  return multiple ? "" + chooseMonths.value.length + pack.value.datePickerSelected : monthName;
10734
10732
  });
@@ -10744,16 +10742,16 @@ var __sfc__$O = vue.defineComponent({
10744
10742
  }
10745
10743
  if (multiple)
10746
10744
  return "" + chooseDays.value.length + pack.value.datePickerSelected;
10747
- if (!chooseYear.value || !chooseMonth.value || !chooseDay.value)
10745
+ if (!chooseYear.value || !chooseMonth2.value || !chooseDay2.value)
10748
10746
  return "";
10749
- var weekIndex = dayjs(chooseYear.value + "-" + chooseMonth.value.index + "-" + chooseDay.value).day();
10747
+ var weekIndex = dayjs(chooseYear.value + "-" + chooseMonth2.value.index + "-" + chooseDay2.value).day();
10750
10748
  var week = WEEK_HEADER.find((value) => value.index === "" + weekIndex);
10751
10749
  var weekName = (_pack$value$datePicke3 = (_pack$value$datePicke4 = pack.value.datePickerWeekDict) == null ? void 0 : _pack$value$datePicke4[week.index].name) != null ? _pack$value$datePicke3 : "";
10752
- var monthName = (_pack$value$datePicke5 = (_pack$value$datePicke6 = pack.value.datePickerMonthDict) == null ? void 0 : _pack$value$datePicke6[chooseMonth.value.index].name) != null ? _pack$value$datePicke5 : "";
10753
- var showDay = padStart$1(chooseDay.value, 2, "0");
10750
+ var monthName = (_pack$value$datePicke5 = (_pack$value$datePicke6 = pack.value.datePickerMonthDict) == null ? void 0 : _pack$value$datePicke6[chooseMonth2.value.index].name) != null ? _pack$value$datePicke5 : "";
10751
+ var showDay = padStart$1(chooseDay2.value, 2, "0");
10754
10752
  if (pack.value.lang === "zh-CN")
10755
- return chooseMonth.value.index + "-" + showDay + " " + weekName.slice(0, 3);
10756
- return weekName.slice(0, 3) + ", " + monthName.slice(0, 3) + " " + chooseDay.value;
10753
+ return chooseMonth2.value.index + "-" + showDay + " " + weekName.slice(0, 3);
10754
+ return weekName.slice(0, 3) + ", " + monthName.slice(0, 3) + " " + chooseDay2.value;
10757
10755
  });
10758
10756
  var getPanelType = vue.computed(() => {
10759
10757
  if (isYearPanel.value)
@@ -10769,12 +10767,12 @@ var __sfc__$O = vue.defineComponent({
10769
10767
  });
10770
10768
  var slotProps = vue.computed(() => {
10771
10769
  var _chooseMonth$value, _chooseYear$value, _chooseMonth$value$in, _chooseMonth$value2;
10772
- var weekIndex = dayjs(chooseYear.value + "-" + ((_chooseMonth$value = chooseMonth.value) == null ? void 0 : _chooseMonth$value.index) + "-" + chooseDay.value).day();
10773
- var date = chooseDay.value ? padStart$1(chooseDay.value, 2, "0") : "";
10770
+ var weekIndex = dayjs(chooseYear.value + "-" + ((_chooseMonth$value = chooseMonth2.value) == null ? void 0 : _chooseMonth$value.index) + "-" + chooseDay2.value).day();
10771
+ var date = chooseDay2.value ? padStart$1(chooseDay2.value, 2, "0") : "";
10774
10772
  return {
10775
10773
  week: "" + weekIndex,
10776
10774
  year: (_chooseYear$value = chooseYear.value) != null ? _chooseYear$value : "",
10777
- month: (_chooseMonth$value$in = (_chooseMonth$value2 = chooseMonth.value) == null ? void 0 : _chooseMonth$value2.index) != null ? _chooseMonth$value$in : "",
10775
+ month: (_chooseMonth$value$in = (_chooseMonth$value2 = chooseMonth2.value) == null ? void 0 : _chooseMonth$value2.index) != null ? _chooseMonth$value$in : "",
10778
10776
  date
10779
10777
  };
10780
10778
  });
@@ -10782,7 +10780,7 @@ var __sfc__$O = vue.defineComponent({
10782
10780
  var isSameYear = vue.computed(() => chooseYear.value === previewYear.value);
10783
10781
  var isSameMonth = vue.computed(() => {
10784
10782
  var _chooseMonth$value3;
10785
- return ((_chooseMonth$value3 = chooseMonth.value) == null ? void 0 : _chooseMonth$value3.index) === previewMonth.value.index;
10783
+ return ((_chooseMonth$value3 = chooseMonth2.value) == null ? void 0 : _chooseMonth$value3.index) === previewMonth.value.index;
10786
10784
  });
10787
10785
  var clickEl = (type) => {
10788
10786
  if (type === "year")
@@ -10852,13 +10850,13 @@ var __sfc__$O = vue.defineComponent({
10852
10850
  call(props2.onChange, formatDates);
10853
10851
  };
10854
10852
  var getReverse = (dateType, date) => {
10855
- if (!chooseYear.value || !chooseMonth.value)
10853
+ if (!chooseYear.value || !chooseMonth2.value)
10856
10854
  return false;
10857
10855
  if (!isSameYear.value)
10858
10856
  return chooseYear.value > previewYear.value;
10859
10857
  if (dateType === "month")
10860
- return date.index < chooseMonth.value.index;
10861
- return isSameMonth.value ? date < toNumber(chooseDay.value) : chooseMonth.value.index > previewMonth.value.index;
10858
+ return date.index < chooseMonth2.value.index;
10859
+ return isSameMonth.value ? date < toNumber(chooseDay2.value) : chooseMonth2.value.index > previewMonth.value.index;
10862
10860
  };
10863
10861
  var getChooseDay = (day) => {
10864
10862
  var {
@@ -10978,9 +10976,9 @@ var __sfc__$O = vue.defineComponent({
10978
10976
  return;
10979
10977
  var [yearValue, monthValue, dayValue] = formatDate.split("-");
10980
10978
  var monthDes2 = MONTH_LIST.find((month) => month.index === monthValue);
10981
- chooseMonth.value = monthDes2;
10979
+ chooseMonth2.value = monthDes2;
10982
10980
  chooseYear.value = yearValue;
10983
- chooseDay.value = dayValue;
10981
+ chooseDay2.value = dayValue;
10984
10982
  previewMonth.value = monthDes2;
10985
10983
  previewYear.value = yearValue;
10986
10984
  };
@@ -11016,9 +11014,9 @@ var __sfc__$O = vue.defineComponent({
11016
11014
  dayPanelEl,
11017
11015
  reverse,
11018
11016
  currentDate,
11019
- chooseMonth,
11017
+ chooseMonth: chooseMonth2,
11020
11018
  chooseYear,
11021
- chooseDay,
11019
+ chooseDay: chooseDay2,
11022
11020
  previewYear,
11023
11021
  isYearPanel,
11024
11022
  isMonthPanel,
@@ -11297,7 +11295,7 @@ var __sfc__$N = vue.defineComponent({
11297
11295
  return;
11298
11296
  }
11299
11297
  if (onBeforeClose != null) {
11300
- onBeforeClose("close", done);
11298
+ call(onBeforeClose, "close", done);
11301
11299
  return;
11302
11300
  }
11303
11301
  call(props2["onUpdate:show"], false);
@@ -11309,7 +11307,7 @@ var __sfc__$N = vue.defineComponent({
11309
11307
  } = props2;
11310
11308
  call(onConfirm);
11311
11309
  if (onBeforeClose != null) {
11312
- onBeforeClose("confirm", done);
11310
+ call(onBeforeClose, "confirm", done);
11313
11311
  return;
11314
11312
  }
11315
11313
  call(props2["onUpdate:show"], false);
@@ -11321,7 +11319,7 @@ var __sfc__$N = vue.defineComponent({
11321
11319
  } = props2;
11322
11320
  call(onCancel);
11323
11321
  if (onBeforeClose != null) {
11324
- onBeforeClose("cancel", done);
11322
+ call(onBeforeClose, "cancel", done);
11325
11323
  return;
11326
11324
  }
11327
11325
  call(props2["onUpdate:show"], false);
@@ -11424,13 +11422,13 @@ function Dialog(options) {
11424
11422
  reactiveDialogOptions.show = true;
11425
11423
  });
11426
11424
  }
11427
- function setDefaultOptions$1(options) {
11425
+ Dialog.setDefaultOptions = function(options) {
11428
11426
  defaultOptions$2 = options;
11429
- }
11430
- function resetDefaultOptions$1() {
11427
+ };
11428
+ Dialog.resetDefaultOptions = function() {
11431
11429
  defaultOptions$2 = {};
11432
- }
11433
- function close() {
11430
+ };
11431
+ Dialog.close = function() {
11434
11432
  if (singletonOptions$2 != null) {
11435
11433
  var prevSingletonOptions = singletonOptions$2;
11436
11434
  singletonOptions$2 = null;
@@ -11438,12 +11436,7 @@ function close() {
11438
11436
  prevSingletonOptions.show = false;
11439
11437
  });
11440
11438
  }
11441
- }
11442
- Object.assign(Dialog, {
11443
- setDefaultOptions: setDefaultOptions$1,
11444
- resetDefaultOptions: resetDefaultOptions$1,
11445
- close
11446
- });
11439
+ };
11447
11440
  VarDialog.install = function(app) {
11448
11441
  app.component(VarDialog.name, VarDialog);
11449
11442
  };
@@ -12934,7 +12927,7 @@ function usePopover(options) {
12934
12927
  if (enterPopover) {
12935
12928
  return;
12936
12929
  }
12937
- close2();
12930
+ close();
12938
12931
  });
12939
12932
  return function handleHostMouseleave2() {
12940
12933
  return _ref.apply(this, arguments);
@@ -12956,7 +12949,7 @@ function usePopover(options) {
12956
12949
  if (enterHost) {
12957
12950
  return;
12958
12951
  }
12959
- close2();
12952
+ close();
12960
12953
  });
12961
12954
  return function handlePopoverMouseleave2() {
12962
12955
  return _ref2.apply(this, arguments);
@@ -13095,7 +13088,7 @@ function usePopover(options) {
13095
13088
  show.value = true;
13096
13089
  call(options["onUpdate:show"], true);
13097
13090
  };
13098
- var close2 = () => {
13091
+ var close = () => {
13099
13092
  show.value = false;
13100
13093
  call(options["onUpdate:show"], false);
13101
13094
  };
@@ -13103,7 +13096,7 @@ function usePopover(options) {
13103
13096
  vue.watch(() => options.offsetX, resize);
13104
13097
  vue.watch(() => options.offsetY, resize);
13105
13098
  vue.watch(() => options.placement, resize);
13106
- vue.watch(() => options.disabled, close2);
13099
+ vue.watch(() => options.disabled, close);
13107
13100
  vue.onMounted(() => {
13108
13101
  var _host$value;
13109
13102
  var reference2 = options.reference ? (_host$value = host.value) == null ? void 0 : _host$value.querySelector(options.reference) : host.value;
@@ -13126,7 +13119,7 @@ function usePopover(options) {
13126
13119
  handlePopoverMouseleave,
13127
13120
  resize,
13128
13121
  open,
13129
- close: close2
13122
+ close
13130
13123
  };
13131
13124
  }
13132
13125
  function triggerValidator$2(trigger) {
@@ -13295,7 +13288,7 @@ var __sfc__$L = vue.defineComponent({
13295
13288
  // expose
13296
13289
  open,
13297
13290
  // expose
13298
- close: close2,
13291
+ close,
13299
13292
  // expose
13300
13293
  resize
13301
13294
  } = usePopover(props2);
@@ -13316,7 +13309,7 @@ var __sfc__$L = vue.defineComponent({
13316
13309
  handlePopoverMouseleave,
13317
13310
  resize,
13318
13311
  open,
13319
- close: close2
13312
+ close
13320
13313
  };
13321
13314
  }
13322
13315
  });
@@ -14810,7 +14803,7 @@ var __sfc__$F = vue.defineComponent({
14810
14803
  };
14811
14804
  var handleTouchend = (event) => {
14812
14805
  checker = window.setTimeout(() => {
14813
- isTapTouch(event.target) && close2();
14806
+ isTapTouch(event.target) && close();
14814
14807
  startTouch = null;
14815
14808
  }, EVENT_DELAY);
14816
14809
  };
@@ -14900,7 +14893,7 @@ var __sfc__$F = vue.defineComponent({
14900
14893
  }
14901
14894
  prevTouch = currentTouch;
14902
14895
  };
14903
- var close2 = () => {
14896
+ var close = () => {
14904
14897
  if (scale.value > 1) {
14905
14898
  zoomOut();
14906
14899
  setTimeout(() => call(props2["onUpdate:show"], false), ANIMATION_DURATION);
@@ -14927,7 +14920,7 @@ var __sfc__$F = vue.defineComponent({
14927
14920
  handleTouchstart,
14928
14921
  handleTouchmove,
14929
14922
  handleTouchend,
14930
- close: close2
14923
+ close
14931
14924
  };
14932
14925
  }
14933
14926
  });
@@ -16786,7 +16779,7 @@ var __sfc__$y = vue.defineComponent({
16786
16779
  // expose
16787
16780
  open,
16788
16781
  // expose
16789
- close: close2,
16782
+ close,
16790
16783
  // expose
16791
16784
  resize
16792
16785
  } = usePopover(props2);
@@ -16808,7 +16801,7 @@ var __sfc__$y = vue.defineComponent({
16808
16801
  handlePopoverClose,
16809
16802
  resize,
16810
16803
  open,
16811
- close: close2
16804
+ close
16812
16805
  };
16813
16806
  }
16814
16807
  });
@@ -17138,12 +17131,12 @@ function __render__$v(_ctx, _cache) {
17138
17131
  [vue.createVNode(
17139
17132
  _component_var_input,
17140
17133
  {
17141
- modelValue: _ctx.simpleValue,
17142
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.simpleValue = $event),
17134
+ modelValue: _ctx.simpleCurrentValue,
17135
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.simpleCurrentValue = $event),
17143
17136
  disabled: _ctx.disabled,
17144
17137
  "var-pagination-cover": "",
17145
- onBlur: _cache[2] || (_cache[2] = ($event) => _ctx.setPage("simple", _ctx.simpleValue, $event)),
17146
- onKeydown: _cache[3] || (_cache[3] = vue.withKeys(($event) => _ctx.setPage("simple", _ctx.simpleValue, $event), ["enter"]))
17138
+ onBlur: _cache[2] || (_cache[2] = ($event) => _ctx.setPage("simple", _ctx.simpleCurrentValue, $event)),
17139
+ onKeydown: _cache[3] || (_cache[3] = vue.withKeys(($event) => _ctx.setPage("simple", _ctx.simpleCurrentValue, $event), ["enter"]))
17147
17140
  },
17148
17141
  null,
17149
17142
  8,
@@ -17294,12 +17287,12 @@ function __render__$v(_ctx, _cache) {
17294
17287
  ), vue.createVNode(
17295
17288
  _component_var_input,
17296
17289
  {
17297
- modelValue: _ctx.inputValue,
17298
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => _ctx.inputValue = $event),
17290
+ modelValue: _ctx.quickJumperValue,
17291
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => _ctx.quickJumperValue = $event),
17299
17292
  disabled: _ctx.disabled,
17300
17293
  "var-pagination-cover": "",
17301
- onBlur: _cache[8] || (_cache[8] = ($event) => _ctx.setPage("quick", _ctx.inputValue, $event)),
17302
- onKeydown: _cache[9] || (_cache[9] = vue.withKeys(($event) => _ctx.setPage("quick", _ctx.inputValue, $event), ["enter"]))
17294
+ onBlur: _cache[8] || (_cache[8] = ($event) => _ctx.setPage("quick", _ctx.quickJumperValue, $event)),
17295
+ onKeydown: _cache[9] || (_cache[9] = vue.withKeys(($event) => _ctx.setPage("quick", _ctx.quickJumperValue, $event), ["enter"]))
17303
17296
  },
17304
17297
  null,
17305
17298
  8,
@@ -17335,8 +17328,8 @@ var __sfc__$w = vue.defineComponent({
17335
17328
  props: props$p,
17336
17329
  setup(props2) {
17337
17330
  var menuVisible = vue.ref(false);
17338
- var inputValue = vue.ref("");
17339
- var simpleValue = vue.ref("1");
17331
+ var quickJumperValue = vue.ref("");
17332
+ var simpleCurrentValue = vue.ref("1");
17340
17333
  var isHideEllipsisHead = vue.ref(false);
17341
17334
  var isHideEllipsisTail = vue.ref(false);
17342
17335
  var current = vue.ref(toNumber(props2.current) || 1);
@@ -17365,50 +17358,55 @@ var __sfc__$w = vue.defineComponent({
17365
17358
  return index === 1 ? "head" : "tail";
17366
17359
  };
17367
17360
  var clickItem = (item, index) => {
17368
- if (item === current.value || props2.disabled)
17361
+ if (item === current.value || props2.disabled) {
17369
17362
  return;
17370
- if (isNumber(item))
17363
+ }
17364
+ if (item === "...") {
17365
+ current.value = index === 1 ? Math.max(current.value - props2.maxPagerCount, 1) : Math.min(current.value + props2.maxPagerCount, pageCount.value);
17366
+ return;
17367
+ }
17368
+ if (item === "prev") {
17369
+ current.value = ensureCurrentBoundary(current.value - 1);
17370
+ return;
17371
+ }
17372
+ if (item === "next") {
17373
+ current.value = ensureCurrentBoundary(current.value + 1);
17374
+ return;
17375
+ }
17376
+ if (isNumber(item)) {
17371
17377
  current.value = item;
17372
- else if (item === "prev")
17373
- current.value > 1 && (current.value -= 1);
17374
- else if (item === "next")
17375
- current.value < pageCount.value && (current.value += 1);
17376
- else if (item === "...") {
17377
- if (index === 1) {
17378
- current.value = Math.max(current.value - props2.maxPagerCount, 1);
17379
- } else {
17380
- current.value = Math.min(current.value + props2.maxPagerCount, pageCount.value);
17381
- }
17382
17378
  }
17383
17379
  };
17384
17380
  var showMenu = () => {
17385
- if (props2.disabled)
17381
+ if (props2.disabled) {
17386
17382
  return;
17383
+ }
17387
17384
  menuVisible.value = true;
17388
17385
  };
17389
17386
  var clickSize = (option2) => {
17390
17387
  size.value = option2;
17391
17388
  menuVisible.value = false;
17389
+ var targetCurrent = ensureCurrentBoundary(current.value);
17390
+ simpleCurrentValue.value = String(targetCurrent);
17391
+ current.value = targetCurrent;
17392
17392
  };
17393
- var isValidatePage = (value) => {
17394
- var pattern = /^[1-9][0-9]*$/;
17395
- return pattern.test(value);
17393
+ var ensureCurrentBoundary = (targetCurrent) => {
17394
+ if (targetCurrent > pageCount.value) {
17395
+ return pageCount.value;
17396
+ }
17397
+ if (targetCurrent < 1) {
17398
+ return 1;
17399
+ }
17400
+ return targetCurrent;
17396
17401
  };
17397
- var setPage = (type, value, event) => {
17402
+ var setPage = (type, page, event) => {
17398
17403
  event.target.blur();
17399
- if (isValidatePage(value)) {
17400
- var valueNum = toNumber(value);
17401
- if (valueNum > pageCount.value) {
17402
- valueNum = pageCount.value;
17403
- simpleValue.value = "" + valueNum;
17404
- }
17405
- if (valueNum !== current.value)
17406
- current.value = valueNum;
17404
+ var targetCurrent = ensureCurrentBoundary(toNumber(page));
17405
+ simpleCurrentValue.value = String(targetCurrent);
17406
+ current.value = targetCurrent;
17407
+ if (type === "quick") {
17408
+ quickJumperValue.value = "";
17407
17409
  }
17408
- if (type === "quick")
17409
- inputValue.value = "";
17410
- if (type === "simple" && !isValidatePage(value))
17411
- simpleValue.value = "" + current.value;
17412
17410
  };
17413
17411
  vue.watch([() => props2.current, () => props2.size], (_ref) => {
17414
17412
  var [newCurrent, newSize] = _ref;
@@ -17426,7 +17424,7 @@ var __sfc__$w = vue.defineComponent({
17426
17424
  } = props2;
17427
17425
  var oldCount = Math.ceil(toNumber(total) / toNumber(oldSize));
17428
17426
  var rEllipseSign = newCount - (maxPagerCount - activePosition.value) - 1;
17429
- simpleValue.value = "" + newCurrent;
17427
+ simpleCurrentValue.value = "" + newCurrent;
17430
17428
  if (newCount - 2 > maxPagerCount) {
17431
17429
  if (oldCurrent === void 0 || newCount !== oldCount) {
17432
17430
  for (var i = 2; i < maxPagerCount + 2; i++) {
@@ -17464,7 +17462,7 @@ var __sfc__$w = vue.defineComponent({
17464
17462
  }
17465
17463
  }
17466
17464
  pageList.value = list2;
17467
- if (oldCurrent !== void 0 && newCount > 0) {
17465
+ if (oldCurrent != null && newCount > 0) {
17468
17466
  call(onChange, newCurrent, newSize);
17469
17467
  }
17470
17468
  call(props2["onUpdate:current"], newCurrent);
@@ -17481,8 +17479,8 @@ var __sfc__$w = vue.defineComponent({
17481
17479
  size,
17482
17480
  pageCount,
17483
17481
  pageList,
17484
- inputValue,
17485
- simpleValue,
17482
+ quickJumperValue,
17483
+ simpleCurrentValue,
17486
17484
  totalText,
17487
17485
  getMode,
17488
17486
  isHideEllipsis,
@@ -18173,7 +18171,7 @@ Picker.Component = VarPicker;
18173
18171
  Picker.install = function(app) {
18174
18172
  app.component(VarPicker.name, VarPicker);
18175
18173
  };
18176
- Picker.close = () => {
18174
+ Picker.close = function() {
18177
18175
  if (singletonOptions != null) {
18178
18176
  var prevSingletonOptions = singletonOptions;
18179
18177
  singletonOptions = null;
@@ -18530,7 +18528,7 @@ function __render__$r(_ctx, _cache) {
18530
18528
  {
18531
18529
  name: _ctx.iconName,
18532
18530
  transition: _ctx.ICON_TRANSITION,
18533
- class: vue.normalizeClass(_ctx.classes(_ctx.n("icon"), [_ctx.refreshStatus === "loading" && _ctx.iconHasChanged, _ctx.n("animation")])),
18531
+ class: vue.normalizeClass(_ctx.classes(_ctx.n("icon"), [_ctx.refreshStatus === "loading", _ctx.n("animation")])),
18534
18532
  "var-pull-refresh-cover": ""
18535
18533
  },
18536
18534
  null,
@@ -18561,10 +18559,22 @@ var __sfc__$s = vue.defineComponent({
18561
18559
  var isEnd = vue.ref(false);
18562
18560
  var scroller;
18563
18561
  var eventTargetScroller;
18564
- var changing;
18565
18562
  var startY = 0;
18566
18563
  var deltaY = 0;
18567
- var iconHasChanged = vue.ref(true);
18564
+ var startIconTransition = /* @__PURE__ */ function() {
18565
+ var _ref = _asyncToGenerator$3(function* (name) {
18566
+ if (iconName.value === name) {
18567
+ return;
18568
+ }
18569
+ iconName.value = name;
18570
+ return new Promise((resolve) => {
18571
+ window.setTimeout(resolve, ICON_TRANSITION);
18572
+ });
18573
+ });
18574
+ return function startIconTransition2(_x) {
18575
+ return _ref.apply(this, arguments);
18576
+ };
18577
+ }();
18568
18578
  var isTouchable = vue.computed(() => refreshStatus.value !== "loading" && refreshStatus.value !== "success" && !props2.disabled);
18569
18579
  var controlStyle = vue.computed(() => ({
18570
18580
  transform: "translate3d(0px, " + (isString(distance.value) ? distance.value : distance.value + "px") + ", 0px) translate(-50%, 0)",
@@ -18574,14 +18584,6 @@ var __sfc__$s = vue.defineComponent({
18574
18584
  }));
18575
18585
  var maxDistance = vue.computed(() => Math.abs(2 * controlPosition.value));
18576
18586
  var isSuccess = vue.computed(() => refreshStatus.value === "success");
18577
- var changeIcon = () => {
18578
- return new Promise((resolve) => {
18579
- window.setTimeout(() => {
18580
- iconHasChanged.value = true;
18581
- resolve();
18582
- }, ICON_TRANSITION);
18583
- });
18584
- };
18585
18587
  var lockEvent = (action) => {
18586
18588
  var el = "classList" in scroller ? scroller : document.body;
18587
18589
  el.classList[action](n$o() + "--lock");
@@ -18623,21 +18625,16 @@ var __sfc__$s = vue.defineComponent({
18623
18625
  }
18624
18626
  var moveDistance = (event.touches[0].clientY - startPosition.value) / 2 + controlPosition.value;
18625
18627
  distance.value = moveDistance >= maxDistance.value ? maxDistance.value : moveDistance;
18626
- if (distance.value >= maxDistance.value * 0.2) {
18627
- iconHasChanged.value = false;
18628
- iconName.value = "refresh";
18629
- changing = changeIcon();
18630
- } else {
18631
- iconName.value = "arrow-down";
18632
- }
18628
+ startIconTransition(distance.value >= maxDistance.value * 0.2 ? "refresh" : "arrow-down");
18633
18629
  };
18634
18630
  var touchEnd = /* @__PURE__ */ function() {
18635
- var _ref = _asyncToGenerator$3(function* () {
18636
- if (!isTouchable.value)
18631
+ var _ref2 = _asyncToGenerator$3(function* () {
18632
+ if (!isTouchable.value) {
18637
18633
  return;
18634
+ }
18638
18635
  isEnd.value = true;
18639
18636
  if (distance.value >= maxDistance.value * 0.2) {
18640
- yield changing;
18637
+ yield startIconTransition("refresh");
18641
18638
  refreshStatus.value = "loading";
18642
18639
  distance.value = maxDistance.value * 0.3;
18643
18640
  call(props2["onUpdate:modelValue"], true);
@@ -18657,7 +18654,7 @@ var __sfc__$s = vue.defineComponent({
18657
18654
  eventTargetScroller = null;
18658
18655
  });
18659
18656
  return function touchEnd2() {
18660
- return _ref.apply(this, arguments);
18657
+ return _ref2.apply(this, arguments);
18661
18658
  };
18662
18659
  }();
18663
18660
  var setScroller = () => {
@@ -18686,7 +18683,6 @@ var __sfc__$s = vue.defineComponent({
18686
18683
  return {
18687
18684
  n: n$o,
18688
18685
  classes: classes$j,
18689
- iconHasChanged,
18690
18686
  ICON_TRANSITION,
18691
18687
  refreshStatus,
18692
18688
  freshNode,
@@ -25071,9 +25067,9 @@ const skeleton = "";
25071
25067
  const SkeletonSfc = "";
25072
25068
  const slider = "";
25073
25069
  const SliderSfc = "";
25074
- const SnackbarSfc = "";
25075
25070
  const snackbar = "";
25076
25071
  const coreSfc = "";
25072
+ const SnackbarSfc = "";
25077
25073
  const space = "";
25078
25074
  const step = "";
25079
25075
  const StepSfc = "";
@@ -25098,7 +25094,7 @@ const TimePickerSfc = "";
25098
25094
  const TooltipSfc = "";
25099
25095
  const uploader = "";
25100
25096
  const UploaderSfc = "";
25101
- const version = "2.9.5";
25097
+ const version = "2.9.6";
25102
25098
  function install(app) {
25103
25099
  ActionSheet.install && app.use(ActionSheet);
25104
25100
  AppBar.install && app.use(AppBar);