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.
Files changed (68) hide show
  1. package/README.md +11 -8
  2. package/es/address-list/AddressList.d.ts +13 -13
  3. package/es/address-list/AddressList.mjs +20 -4
  4. package/es/address-list/AddressListItem.d.ts +3 -0
  5. package/es/address-list/AddressListItem.mjs +19 -7
  6. package/es/address-list/index.d.ts +2 -2
  7. package/es/address-list/style/index.mjs +1 -0
  8. package/es/area/utils.mjs +3 -3
  9. package/es/calendar/Calendar.d.ts +16 -10
  10. package/es/calendar/Calendar.mjs +83 -53
  11. package/es/calendar/CalendarHeader.d.ts +16 -1
  12. package/es/calendar/CalendarHeader.mjs +71 -7
  13. package/es/calendar/CalendarMonth.d.ts +6 -24
  14. package/es/calendar/CalendarMonth.mjs +6 -4
  15. package/es/calendar/index.css +1 -1
  16. package/es/calendar/index.d.ts +11 -7
  17. package/es/calendar/types.d.ts +4 -0
  18. package/es/calendar/utils.d.ts +6 -0
  19. package/es/calendar/utils.mjs +20 -0
  20. package/es/floating-panel/FloatingPanel.mjs +11 -5
  21. package/es/highlight/Highlight.mjs +7 -0
  22. package/es/image-preview/ImagePreviewItem.mjs +2 -0
  23. package/es/index-bar/IndexBar.mjs +10 -2
  24. package/es/index.d.ts +1 -1
  25. package/es/index.mjs +1 -1
  26. package/es/picker-group/PickerGroup.d.ts +13 -0
  27. package/es/picker-group/PickerGroup.mjs +5 -4
  28. package/es/picker-group/index.d.ts +9 -0
  29. package/es/stepper/Stepper.mjs +1 -0
  30. package/es/tabs/index.css +1 -1
  31. package/es/utils/basic.d.ts +1 -1
  32. package/lib/address-list/AddressList.d.ts +13 -13
  33. package/lib/address-list/AddressList.js +19 -3
  34. package/lib/address-list/AddressListItem.d.ts +3 -0
  35. package/lib/address-list/AddressListItem.js +19 -7
  36. package/lib/address-list/index.d.ts +2 -2
  37. package/lib/address-list/style/index.js +1 -0
  38. package/lib/area/utils.js +3 -3
  39. package/lib/calendar/Calendar.d.ts +16 -10
  40. package/lib/calendar/Calendar.js +82 -52
  41. package/lib/calendar/CalendarHeader.d.ts +16 -1
  42. package/lib/calendar/CalendarHeader.js +68 -4
  43. package/lib/calendar/CalendarMonth.d.ts +6 -24
  44. package/lib/calendar/CalendarMonth.js +6 -4
  45. package/lib/calendar/index.css +1 -1
  46. package/lib/calendar/index.d.ts +11 -7
  47. package/lib/calendar/types.d.ts +4 -0
  48. package/lib/calendar/utils.d.ts +6 -0
  49. package/lib/calendar/utils.js +20 -0
  50. package/lib/floating-panel/FloatingPanel.js +11 -5
  51. package/lib/highlight/Highlight.js +7 -0
  52. package/lib/image-preview/ImagePreviewItem.js +2 -0
  53. package/lib/index-bar/IndexBar.js +10 -2
  54. package/lib/index.css +1 -1
  55. package/lib/index.d.ts +1 -1
  56. package/lib/index.js +1 -1
  57. package/lib/picker-group/PickerGroup.d.ts +13 -0
  58. package/lib/picker-group/PickerGroup.js +4 -3
  59. package/lib/picker-group/index.d.ts +9 -0
  60. package/lib/stepper/Stepper.js +1 -0
  61. package/lib/tabs/index.css +1 -1
  62. package/lib/utils/basic.d.ts +1 -1
  63. package/lib/vant.cjs.js +516 -356
  64. package/lib/vant.es.js +516 -356
  65. package/lib/vant.js +518 -358
  66. package/lib/vant.min.js +3 -3
  67. package/lib/web-types.json +1 -1
  68. package/package.json +17 -17
package/lib/vant.es.js CHANGED
@@ -3270,7 +3270,8 @@ const PICKER_GROUP_KEY = Symbol(name$1p);
3270
3270
  const pickerGroupProps = extend({
3271
3271
  tabs: makeArrayProp(),
3272
3272
  activeTab: makeNumericProp(0),
3273
- nextStepText: String
3273
+ nextStepText: String,
3274
+ showToolbar: truthProp
3274
3275
  }, pickerToolbarProps);
3275
3276
  var stdin_default$1A = defineComponent({
3276
3277
  name: name$1p,
@@ -3309,13 +3310,13 @@ var stdin_default$1A = defineComponent({
3309
3310
  const confirmButtonText = showNextButton() ? props2.nextStepText : props2.confirmButtonText;
3310
3311
  return createVNode("div", {
3311
3312
  "class": bem$1l()
3312
- }, [createVNode(stdin_default$1H, {
3313
+ }, [props2.showToolbar ? createVNode(stdin_default$1H, {
3313
3314
  "title": props2.title,
3314
3315
  "cancelButtonText": props2.cancelButtonText,
3315
3316
  "confirmButtonText": confirmButtonText,
3316
3317
  "onConfirm": onConfirm,
3317
3318
  "onCancel": onCancel
3318
- }, pick(slots, pickerToolbarSlots)), createVNode(Tabs, {
3319
+ }, pick(slots, pickerToolbarSlots)) : null, createVNode(Tabs, {
3319
3320
  "active": activeTab.value,
3320
3321
  "onUpdate:active": ($event) => activeTab.value = $event,
3321
3322
  "class": bem$1l("tabs"),
@@ -3568,9 +3569,9 @@ function formatDataForCascade({
3568
3569
  const showCounty = +columnsNum > 2;
3569
3570
  const getProvinceChildren = () => {
3570
3571
  if (showCity) {
3571
- return placeholder.length ? [
3572
+ return placeholder.length > 1 ? [
3572
3573
  makeOption(
3573
- placeholder[0],
3574
+ placeholder[1],
3574
3575
  AREA_EMPTY_CODE,
3575
3576
  showCounty ? [] : void 0
3576
3577
  )
@@ -3588,7 +3589,7 @@ function formatDataForCascade({
3588
3589
  if (showCity) {
3589
3590
  const getCityChildren = () => {
3590
3591
  if (showCounty) {
3591
- return placeholder.length ? [makeOption(placeholder[1])] : [];
3592
+ return placeholder.length > 2 ? [makeOption(placeholder[2])] : [];
3592
3593
  }
3593
3594
  };
3594
3595
  Object.keys(city).forEach((code) => {
@@ -5326,7 +5327,71 @@ var stdin_default$1q = defineComponent({
5326
5327
  }
5327
5328
  });
5328
5329
  const RadioGroup = withInstall(stdin_default$1q);
5329
- const [name$1f, bem$1b] = createNamespace("tag");
5330
+ const [name$1f, bem$1b] = createNamespace("checkbox-group");
5331
+ const checkboxGroupProps = {
5332
+ max: numericProp,
5333
+ shape: makeStringProp("round"),
5334
+ disabled: Boolean,
5335
+ iconSize: numericProp,
5336
+ direction: String,
5337
+ modelValue: makeArrayProp(),
5338
+ checkedColor: String
5339
+ };
5340
+ const CHECKBOX_GROUP_KEY = Symbol(name$1f);
5341
+ var stdin_default$1p = defineComponent({
5342
+ name: name$1f,
5343
+ props: checkboxGroupProps,
5344
+ emits: ["change", "update:modelValue"],
5345
+ setup(props2, {
5346
+ emit,
5347
+ slots
5348
+ }) {
5349
+ const {
5350
+ children,
5351
+ linkChildren
5352
+ } = useChildren(CHECKBOX_GROUP_KEY);
5353
+ const updateValue = (value) => emit("update:modelValue", value);
5354
+ const toggleAll = (options = {}) => {
5355
+ if (typeof options === "boolean") {
5356
+ options = {
5357
+ checked: options
5358
+ };
5359
+ }
5360
+ const {
5361
+ checked,
5362
+ skipDisabled
5363
+ } = options;
5364
+ const checkedChildren = children.filter((item) => {
5365
+ if (!item.props.bindGroup) {
5366
+ return false;
5367
+ }
5368
+ if (item.props.disabled && skipDisabled) {
5369
+ return item.checked.value;
5370
+ }
5371
+ return checked != null ? checked : !item.checked.value;
5372
+ });
5373
+ const names = checkedChildren.map((item) => item.name);
5374
+ updateValue(names);
5375
+ };
5376
+ watch(() => props2.modelValue, (value) => emit("change", value));
5377
+ useExpose({
5378
+ toggleAll
5379
+ });
5380
+ useCustomFieldValue(() => props2.modelValue);
5381
+ linkChildren({
5382
+ props: props2,
5383
+ updateValue
5384
+ });
5385
+ return () => {
5386
+ var _a;
5387
+ return createVNode("div", {
5388
+ "class": bem$1b([props2.direction])
5389
+ }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
5390
+ };
5391
+ }
5392
+ });
5393
+ const CheckboxGroup = withInstall(stdin_default$1p);
5394
+ const [name$1e, bem$1a] = createNamespace("tag");
5330
5395
  const tagProps = {
5331
5396
  size: String,
5332
5397
  mark: Boolean,
@@ -5338,8 +5403,8 @@ const tagProps = {
5338
5403
  textColor: String,
5339
5404
  closeable: Boolean
5340
5405
  };
5341
- var stdin_default$1p = defineComponent({
5342
- name: name$1f,
5406
+ var stdin_default$1o = defineComponent({
5407
+ name: name$1e,
5343
5408
  props: tagProps,
5344
5409
  emits: ["close"],
5345
5410
  setup(props2, {
@@ -5382,12 +5447,12 @@ var stdin_default$1p = defineComponent({
5382
5447
  }
5383
5448
  const CloseIcon = closeable && createVNode(Icon, {
5384
5449
  "name": "cross",
5385
- "class": [bem$1b("close"), HAPTICS_FEEDBACK],
5450
+ "class": [bem$1a("close"), HAPTICS_FEEDBACK],
5386
5451
  "onClick": onClose
5387
5452
  }, null);
5388
5453
  return createVNode("span", {
5389
5454
  "style": getStyle(),
5390
- "class": bem$1b([classes, type])
5455
+ "class": bem$1a([classes, type])
5391
5456
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots), CloseIcon]);
5392
5457
  };
5393
5458
  return () => createVNode(Transition, {
@@ -5397,7 +5462,7 @@ var stdin_default$1p = defineComponent({
5397
5462
  });
5398
5463
  }
5399
5464
  });
5400
- const Tag = withInstall(stdin_default$1p);
5465
+ const Tag = withInstall(stdin_default$1o);
5401
5466
  const checkerProps = {
5402
5467
  name: unknownProp,
5403
5468
  disabled: Boolean,
@@ -5407,7 +5472,7 @@ const checkerProps = {
5407
5472
  labelPosition: String,
5408
5473
  labelDisabled: Boolean
5409
5474
  };
5410
- var stdin_default$1o = defineComponent({
5475
+ var stdin_default$1n = defineComponent({
5411
5476
  props: extend({}, checkerProps, {
5412
5477
  bem: makeRequiredProp(Function),
5413
5478
  role: String,
@@ -5536,9 +5601,9 @@ var stdin_default$1o = defineComponent({
5536
5601
  const radioProps = extend({}, checkerProps, {
5537
5602
  shape: String
5538
5603
  });
5539
- const [name$1e, bem$1a] = createNamespace("radio");
5540
- var stdin_default$1n = defineComponent({
5541
- name: name$1e,
5604
+ const [name$1d, bem$19] = createNamespace("radio");
5605
+ var stdin_default$1m = defineComponent({
5606
+ name: name$1d,
5542
5607
  props: radioProps,
5543
5608
  emits: ["update:modelValue"],
5544
5609
  setup(props2, {
@@ -5559,8 +5624,8 @@ var stdin_default$1n = defineComponent({
5559
5624
  emit("update:modelValue", props2.name);
5560
5625
  }
5561
5626
  };
5562
- return () => createVNode(stdin_default$1o, mergeProps({
5563
- "bem": bem$1a,
5627
+ return () => createVNode(stdin_default$1n, mergeProps({
5628
+ "bem": bem$19,
5564
5629
  "role": "radio",
5565
5630
  "parent": parent,
5566
5631
  "checked": checked(),
@@ -5568,14 +5633,97 @@ var stdin_default$1n = defineComponent({
5568
5633
  }, props2), pick(slots, ["default", "icon"]));
5569
5634
  }
5570
5635
  });
5571
- const Radio = withInstall(stdin_default$1n);
5572
- const [name$1d, bem$19] = createNamespace("address-item");
5573
- var stdin_default$1m = defineComponent({
5574
- name: name$1d,
5636
+ const Radio = withInstall(stdin_default$1m);
5637
+ const [name$1c, bem$18] = createNamespace("checkbox");
5638
+ const checkboxProps = extend({}, checkerProps, {
5639
+ shape: String,
5640
+ bindGroup: truthProp,
5641
+ indeterminate: {
5642
+ type: Boolean,
5643
+ default: null
5644
+ }
5645
+ });
5646
+ var stdin_default$1l = defineComponent({
5647
+ name: name$1c,
5648
+ props: checkboxProps,
5649
+ emits: ["change", "update:modelValue"],
5650
+ setup(props2, {
5651
+ emit,
5652
+ slots
5653
+ }) {
5654
+ const {
5655
+ parent
5656
+ } = useParent(CHECKBOX_GROUP_KEY);
5657
+ const setParentValue = (checked2) => {
5658
+ const {
5659
+ name: name2
5660
+ } = props2;
5661
+ const {
5662
+ max,
5663
+ modelValue
5664
+ } = parent.props;
5665
+ const value = modelValue.slice();
5666
+ if (checked2) {
5667
+ const overlimit = max && value.length >= +max;
5668
+ if (!overlimit && !value.includes(name2)) {
5669
+ value.push(name2);
5670
+ if (props2.bindGroup) {
5671
+ parent.updateValue(value);
5672
+ }
5673
+ }
5674
+ } else {
5675
+ const index = value.indexOf(name2);
5676
+ if (index !== -1) {
5677
+ value.splice(index, 1);
5678
+ if (props2.bindGroup) {
5679
+ parent.updateValue(value);
5680
+ }
5681
+ }
5682
+ }
5683
+ };
5684
+ const checked = computed(() => {
5685
+ if (parent && props2.bindGroup) {
5686
+ return parent.props.modelValue.indexOf(props2.name) !== -1;
5687
+ }
5688
+ return !!props2.modelValue;
5689
+ });
5690
+ const toggle = (newValue = !checked.value) => {
5691
+ if (parent && props2.bindGroup) {
5692
+ setParentValue(newValue);
5693
+ } else {
5694
+ emit("update:modelValue", newValue);
5695
+ }
5696
+ if (props2.indeterminate !== null)
5697
+ emit("change", newValue);
5698
+ };
5699
+ watch(() => props2.modelValue, (value) => {
5700
+ if (props2.indeterminate === null)
5701
+ emit("change", value);
5702
+ });
5703
+ useExpose({
5704
+ toggle,
5705
+ props: props2,
5706
+ checked
5707
+ });
5708
+ useCustomFieldValue(() => props2.modelValue);
5709
+ return () => createVNode(stdin_default$1n, mergeProps({
5710
+ "bem": bem$18,
5711
+ "role": "checkbox",
5712
+ "parent": parent,
5713
+ "checked": checked.value,
5714
+ "onToggle": toggle
5715
+ }, props2), pick(slots, ["default", "icon"]));
5716
+ }
5717
+ });
5718
+ const Checkbox = withInstall(stdin_default$1l);
5719
+ const [name$1b, bem$17] = createNamespace("address-item");
5720
+ var stdin_default$1k = defineComponent({
5721
+ name: name$1b,
5575
5722
  props: {
5576
5723
  address: makeRequiredProp(Object),
5577
5724
  disabled: Boolean,
5578
5725
  switchable: Boolean,
5726
+ singleChoice: Boolean,
5579
5727
  defaultTagText: String,
5580
5728
  rightIcon: makeStringProp("edit")
5581
5729
  },
@@ -5592,7 +5740,7 @@ var stdin_default$1m = defineComponent({
5592
5740
  };
5593
5741
  const renderRightIcon = () => createVNode(Icon, {
5594
5742
  "name": props2.rightIcon,
5595
- "class": bem$19("edit"),
5743
+ "class": bem$17("edit"),
5596
5744
  "onClick": (event) => {
5597
5745
  event.stopPropagation();
5598
5746
  emit("edit");
@@ -5607,7 +5755,7 @@ var stdin_default$1m = defineComponent({
5607
5755
  return createVNode(Tag, {
5608
5756
  "type": "primary",
5609
5757
  "round": true,
5610
- "class": bem$19("tag")
5758
+ "class": bem$17("tag")
5611
5759
  }, {
5612
5760
  default: () => [props2.defaultTagText]
5613
5761
  });
@@ -5617,20 +5765,30 @@ var stdin_default$1m = defineComponent({
5617
5765
  const {
5618
5766
  address,
5619
5767
  disabled,
5620
- switchable
5768
+ switchable,
5769
+ singleChoice
5621
5770
  } = props2;
5622
5771
  const Info = [createVNode("div", {
5623
- "class": bem$19("name")
5772
+ "class": bem$17("name")
5624
5773
  }, [`${address.name} ${address.tel}`, renderTag()]), createVNode("div", {
5625
- "class": bem$19("address")
5774
+ "class": bem$17("address")
5626
5775
  }, [address.address])];
5627
5776
  if (switchable && !disabled) {
5628
- return createVNode(Radio, {
5629
- "name": address.id,
5630
- "iconSize": 18
5631
- }, {
5632
- default: () => [Info]
5633
- });
5777
+ if (singleChoice) {
5778
+ return createVNode(Radio, {
5779
+ "name": address.id,
5780
+ "iconSize": 18
5781
+ }, {
5782
+ default: () => [Info]
5783
+ });
5784
+ } else {
5785
+ return createVNode(Checkbox, {
5786
+ "name": address.id,
5787
+ "iconSize": 18
5788
+ }, {
5789
+ default: () => [Info]
5790
+ });
5791
+ }
5634
5792
  }
5635
5793
  return Info;
5636
5794
  };
@@ -5640,13 +5798,13 @@ var stdin_default$1m = defineComponent({
5640
5798
  disabled
5641
5799
  } = props2;
5642
5800
  return createVNode("div", {
5643
- "class": bem$19({
5801
+ "class": bem$17({
5644
5802
  disabled
5645
5803
  }),
5646
5804
  "onClick": onClick
5647
5805
  }, [createVNode(Cell, {
5648
5806
  "border": false,
5649
- "titleClass": bem$19("title")
5807
+ "titleClass": bem$17("title")
5650
5808
  }, {
5651
5809
  title: renderContent,
5652
5810
  "right-icon": renderRightIcon
@@ -5656,10 +5814,10 @@ var stdin_default$1m = defineComponent({
5656
5814
  };
5657
5815
  }
5658
5816
  });
5659
- const [name$1c, bem$18, t$h] = createNamespace("address-list");
5817
+ const [name$1a, bem$16, t$h] = createNamespace("address-list");
5660
5818
  const addressListProps = {
5661
5819
  list: makeArrayProp(),
5662
- modelValue: numericProp,
5820
+ modelValue: [...numericProp, Array],
5663
5821
  switchable: truthProp,
5664
5822
  disabledText: String,
5665
5823
  disabledList: makeArrayProp(),
@@ -5668,14 +5826,15 @@ const addressListProps = {
5668
5826
  defaultTagText: String,
5669
5827
  rightIcon: makeStringProp("edit")
5670
5828
  };
5671
- var stdin_default$1l = defineComponent({
5672
- name: name$1c,
5829
+ var stdin_default$1j = defineComponent({
5830
+ name: name$1a,
5673
5831
  props: addressListProps,
5674
5832
  emits: ["add", "edit", "select", "clickItem", "editDisabled", "selectDisabled", "update:modelValue"],
5675
5833
  setup(props2, {
5676
5834
  slots,
5677
5835
  emit
5678
5836
  }) {
5837
+ const singleChoice = computed(() => !Array.isArray(props2.modelValue));
5679
5838
  const renderItem = (item, index, disabled) => {
5680
5839
  const onEdit = () => emit(disabled ? "editDisabled" : "edit", item, index);
5681
5840
  const onClick = (event) => emit("clickItem", item, index, {
@@ -5684,14 +5843,24 @@ var stdin_default$1l = defineComponent({
5684
5843
  const onSelect = () => {
5685
5844
  emit(disabled ? "selectDisabled" : "select", item, index);
5686
5845
  if (!disabled) {
5687
- emit("update:modelValue", item.id);
5846
+ if (singleChoice.value) {
5847
+ emit("update:modelValue", item.id);
5848
+ } else {
5849
+ const value = props2.modelValue;
5850
+ if (value.includes(item.id)) {
5851
+ emit("update:modelValue", value.filter((id) => id !== item.id));
5852
+ } else {
5853
+ emit("update:modelValue", [...value, item.id]);
5854
+ }
5855
+ }
5688
5856
  }
5689
5857
  };
5690
- return createVNode(stdin_default$1m, {
5858
+ return createVNode(stdin_default$1k, {
5691
5859
  "key": item.id,
5692
5860
  "address": item,
5693
5861
  "disabled": disabled,
5694
5862
  "switchable": props2.switchable,
5863
+ "singleChoice": singleChoice.value,
5695
5864
  "defaultTagText": props2.defaultTagText,
5696
5865
  "rightIcon": props2.rightIcon,
5697
5866
  "onEdit": onEdit,
@@ -5708,13 +5877,13 @@ var stdin_default$1l = defineComponent({
5708
5877
  }
5709
5878
  };
5710
5879
  const renderBottom = () => props2.showAddButton ? createVNode("div", {
5711
- "class": [bem$18("bottom"), "van-safe-area-bottom"]
5880
+ "class": [bem$16("bottom"), "van-safe-area-bottom"]
5712
5881
  }, [createVNode(Button, {
5713
5882
  "round": true,
5714
5883
  "block": true,
5715
5884
  "type": "primary",
5716
5885
  "text": props2.addButtonText || t$h("add"),
5717
- "class": bem$18("add"),
5886
+ "class": bem$16("add"),
5718
5887
  "onClick": () => emit("add")
5719
5888
  }, null)]) : void 0;
5720
5889
  return () => {
@@ -5722,11 +5891,15 @@ var stdin_default$1l = defineComponent({
5722
5891
  const List2 = renderList(props2.list);
5723
5892
  const DisabledList = renderList(props2.disabledList, true);
5724
5893
  const DisabledText = props2.disabledText && createVNode("div", {
5725
- "class": bem$18("disabled-text")
5894
+ "class": bem$16("disabled-text")
5726
5895
  }, [props2.disabledText]);
5727
5896
  return createVNode("div", {
5728
- "class": bem$18()
5729
- }, [(_a = slots.top) == null ? void 0 : _a.call(slots), createVNode(RadioGroup, {
5897
+ "class": bem$16()
5898
+ }, [(_a = slots.top) == null ? void 0 : _a.call(slots), !singleChoice.value && Array.isArray(props2.modelValue) ? createVNode(CheckboxGroup, {
5899
+ "modelValue": props2.modelValue
5900
+ }, {
5901
+ default: () => [List2]
5902
+ }) : createVNode(RadioGroup, {
5730
5903
  "modelValue": props2.modelValue
5731
5904
  }, {
5732
5905
  default: () => [List2]
@@ -5734,7 +5907,7 @@ var stdin_default$1l = defineComponent({
5734
5907
  };
5735
5908
  }
5736
5909
  });
5737
- const AddressList = withInstall(stdin_default$1l);
5910
+ const AddressList = withInstall(stdin_default$1j);
5738
5911
  const hasIntersectionObserver = inBrowser$1 && "IntersectionObserver" in window && "IntersectionObserverEntry" in window && "intersectionRatio" in window.IntersectionObserverEntry.prototype;
5739
5912
  const modeType = {
5740
5913
  event: "event",
@@ -5887,7 +6060,7 @@ class ImageCache {
5887
6060
  this.caches.shift();
5888
6061
  }
5889
6062
  }
5890
- const [name$1b, bem$17] = createNamespace("back-top");
6063
+ const [name$19, bem$15] = createNamespace("back-top");
5891
6064
  const backTopProps = {
5892
6065
  right: numericProp,
5893
6066
  bottom: numericProp,
@@ -5900,8 +6073,8 @@ const backTopProps = {
5900
6073
  default: "body"
5901
6074
  }
5902
6075
  };
5903
- var stdin_default$1k = defineComponent({
5904
- name: name$1b,
6076
+ var stdin_default$1i = defineComponent({
6077
+ name: name$19,
5905
6078
  inheritAttrs: false,
5906
6079
  props: backTopProps,
5907
6080
  emits: ["click"],
@@ -5973,19 +6146,19 @@ var stdin_default$1k = defineComponent({
5973
6146
  return () => {
5974
6147
  const Content = createVNode("div", mergeProps({
5975
6148
  "ref": !props2.teleport ? root : void 0,
5976
- "class": bem$17({
6149
+ "class": bem$15({
5977
6150
  active: show.value
5978
6151
  }),
5979
6152
  "style": style.value,
5980
6153
  "onClick": onClick
5981
6154
  }, attrs), [slots.default ? slots.default() : createVNode(Icon, {
5982
6155
  "name": "back-top",
5983
- "class": bem$17("icon")
6156
+ "class": bem$15("icon")
5984
6157
  }, null)]);
5985
6158
  if (props2.teleport) {
5986
6159
  return [createVNode("div", {
5987
6160
  "ref": root,
5988
- "class": bem$17("placeholder")
6161
+ "class": bem$15("placeholder")
5989
6162
  }, null), createVNode(Teleport, {
5990
6163
  "to": props2.teleport
5991
6164
  }, {
@@ -5996,7 +6169,7 @@ var stdin_default$1k = defineComponent({
5996
6169
  };
5997
6170
  }
5998
6171
  });
5999
- const BackTop = withInstall(stdin_default$1k);
6172
+ const BackTop = withInstall(stdin_default$1i);
6000
6173
  var __async = (__this, __arguments, generator) => {
6001
6174
  return new Promise((resolve, reject) => {
6002
6175
  var fulfilled = (value) => {
@@ -6025,9 +6198,9 @@ const barrageProps = {
6025
6198
  delay: makeNumberProp(300),
6026
6199
  modelValue: makeArrayProp()
6027
6200
  };
6028
- const [name$1a, bem$16] = createNamespace("barrage");
6029
- var stdin_default$1j = defineComponent({
6030
- name: name$1a,
6201
+ const [name$18, bem$14] = createNamespace("barrage");
6202
+ var stdin_default$1h = defineComponent({
6203
+ name: name$18,
6031
6204
  props: barrageProps,
6032
6205
  emits: ["update:modelValue"],
6033
6206
  setup(props2, {
@@ -6035,7 +6208,7 @@ var stdin_default$1j = defineComponent({
6035
6208
  slots
6036
6209
  }) {
6037
6210
  const barrageWrapper = ref();
6038
- const className = bem$16("item");
6211
+ const className = bem$14("item");
6039
6212
  const total = ref(0);
6040
6213
  const barrageItems = [];
6041
6214
  const createBarrageItem = (text, delay = props2.delay) => {
@@ -6116,15 +6289,15 @@ var stdin_default$1j = defineComponent({
6116
6289
  return () => {
6117
6290
  var _a;
6118
6291
  return createVNode("div", {
6119
- "class": bem$16(),
6292
+ "class": bem$14(),
6120
6293
  "ref": barrageWrapper,
6121
6294
  "style": rootStyle.value
6122
6295
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
6123
6296
  };
6124
6297
  }
6125
6298
  });
6126
- const Barrage = withInstall(stdin_default$1j);
6127
- const [name$19, bem$15, t$g] = createNamespace("calendar");
6299
+ const Barrage = withInstall(stdin_default$1h);
6300
+ const [name$17, bem$13, t$g] = createNamespace("calendar");
6128
6301
  const formatMonthTitle = (date) => t$g("monthTitle", date.getFullYear(), date.getMonth() + 1);
6129
6302
  function compareMonth(date1, date2) {
6130
6303
  const year1 = date1.getFullYear();
@@ -6152,8 +6325,22 @@ function getDayByOffset(date, offset) {
6152
6325
  cloned.setDate(cloned.getDate() + offset);
6153
6326
  return cloned;
6154
6327
  }
6328
+ function getMonthByOffset(date, offset) {
6329
+ const cloned = cloneDate(date);
6330
+ cloned.setMonth(cloned.getMonth() + offset);
6331
+ return cloned;
6332
+ }
6333
+ function getYearByOffset(date, offset) {
6334
+ const cloned = cloneDate(date);
6335
+ cloned.setFullYear(cloned.getFullYear() + offset);
6336
+ return cloned;
6337
+ }
6155
6338
  const getPrevDay = (date) => getDayByOffset(date, -1);
6156
6339
  const getNextDay = (date) => getDayByOffset(date, 1);
6340
+ const getPrevMonth = (date) => getMonthByOffset(date, -1);
6341
+ const getNextMonth = (date) => getMonthByOffset(date, 1);
6342
+ const getPrevYear = (date) => getYearByOffset(date, -1);
6343
+ const getNextYear = (date) => getYearByOffset(date, 1);
6157
6344
  const getToday = () => {
6158
6345
  const today = /* @__PURE__ */ new Date();
6159
6346
  today.setHours(0, 0, 0, 0);
@@ -6204,9 +6391,9 @@ const formatValueRange = (values, columns) => values.map((value, index) => {
6204
6391
  }
6205
6392
  return value;
6206
6393
  });
6207
- const [name$18] = createNamespace("calendar-day");
6208
- var stdin_default$1i = defineComponent({
6209
- name: name$18,
6394
+ const [name$16] = createNamespace("calendar-day");
6395
+ var stdin_default$1g = defineComponent({
6396
+ name: name$16,
6210
6397
  props: {
6211
6398
  item: makeRequiredProp(Object),
6212
6399
  color: String,
@@ -6270,7 +6457,7 @@ var stdin_default$1i = defineComponent({
6270
6457
  } = props2.item;
6271
6458
  if (topInfo || slots["top-info"]) {
6272
6459
  return createVNode("div", {
6273
- "class": bem$15("top-info")
6460
+ "class": bem$13("top-info")
6274
6461
  }, [slots["top-info"] ? slots["top-info"](props2.item) : topInfo]);
6275
6462
  }
6276
6463
  };
@@ -6280,7 +6467,7 @@ var stdin_default$1i = defineComponent({
6280
6467
  } = props2.item;
6281
6468
  if (bottomInfo || slots["bottom-info"]) {
6282
6469
  return createVNode("div", {
6283
- "class": bem$15("bottom-info")
6470
+ "class": bem$13("bottom-info")
6284
6471
  }, [slots["bottom-info"] ? slots["bottom-info"](props2.item) : bottomInfo]);
6285
6472
  }
6286
6473
  };
@@ -6297,7 +6484,7 @@ var stdin_default$1i = defineComponent({
6297
6484
  const Nodes = [renderTopInfo(), text, renderBottomInfo()];
6298
6485
  if (type === "selected") {
6299
6486
  return createVNode("div", {
6300
- "class": bem$15("selected-day"),
6487
+ "class": bem$13("selected-day"),
6301
6488
  "style": {
6302
6489
  width: rowHeight,
6303
6490
  height: rowHeight,
@@ -6314,27 +6501,27 @@ var stdin_default$1i = defineComponent({
6314
6501
  } = props2.item;
6315
6502
  if (type === "placeholder") {
6316
6503
  return createVNode("div", {
6317
- "class": bem$15("day"),
6504
+ "class": bem$13("day"),
6318
6505
  "style": style.value
6319
6506
  }, null);
6320
6507
  }
6321
6508
  return createVNode("div", {
6322
6509
  "role": "gridcell",
6323
6510
  "style": style.value,
6324
- "class": [bem$15("day", type), className],
6511
+ "class": [bem$13("day", type), className],
6325
6512
  "tabindex": type === "disabled" ? void 0 : -1,
6326
6513
  "onClick": onClick
6327
6514
  }, [renderContent()]);
6328
6515
  };
6329
6516
  }
6330
6517
  });
6331
- const [name$17] = createNamespace("calendar-month");
6518
+ const [name$15] = createNamespace("calendar-month");
6332
6519
  const calendarMonthProps = {
6333
6520
  date: makeRequiredProp(Date),
6334
6521
  type: String,
6335
6522
  color: String,
6336
- minDate: makeRequiredProp(Date),
6337
- maxDate: makeRequiredProp(Date),
6523
+ minDate: Date,
6524
+ maxDate: Date,
6338
6525
  showMark: Boolean,
6339
6526
  rowHeight: numericProp,
6340
6527
  formatter: Function,
@@ -6345,8 +6532,8 @@ const calendarMonthProps = {
6345
6532
  showMonthTitle: Boolean,
6346
6533
  firstDayOfWeek: Number
6347
6534
  };
6348
- var stdin_default$1h = defineComponent({
6349
- name: name$17,
6535
+ var stdin_default$1f = defineComponent({
6536
+ name: name$15,
6350
6537
  props: calendarMonthProps,
6351
6538
  emits: ["click", "clickDisabledDate"],
6352
6539
  setup(props2, {
@@ -6360,7 +6547,9 @@ var stdin_default$1h = defineComponent({
6360
6547
  const title = computed(() => formatMonthTitle(props2.date));
6361
6548
  const rowHeight = computed(() => addUnit(props2.rowHeight));
6362
6549
  const offset = computed(() => {
6363
- const realDay = props2.date.getDay();
6550
+ const date = props2.date.getDate();
6551
+ const day = props2.date.getDay();
6552
+ const realDay = (day - date % 7 + 8) % 7;
6364
6553
  if (props2.firstDayOfWeek) {
6365
6554
  return (realDay + 7 - props2.firstDayOfWeek) % 7;
6366
6555
  }
@@ -6420,7 +6609,7 @@ var stdin_default$1h = defineComponent({
6420
6609
  maxDate,
6421
6610
  currentDate
6422
6611
  } = props2;
6423
- if (compareDay(day, minDate) < 0 || compareDay(day, maxDate) > 0) {
6612
+ if (minDate && compareDay(day, minDate) < 0 || maxDate && compareDay(day, maxDate) > 0) {
6424
6613
  return "disabled";
6425
6614
  }
6426
6615
  if (currentDate === null) {
@@ -6451,7 +6640,7 @@ var stdin_default$1h = defineComponent({
6451
6640
  const renderTitle = () => {
6452
6641
  if (props2.showMonthTitle) {
6453
6642
  return createVNode("div", {
6454
- "class": bem$15("month-title")
6643
+ "class": bem$13("month-title")
6455
6644
  }, [slots["month-title"] ? slots["month-title"]({
6456
6645
  date: props2.date,
6457
6646
  text: title.value
@@ -6461,7 +6650,7 @@ var stdin_default$1h = defineComponent({
6461
6650
  const renderMark = () => {
6462
6651
  if (props2.showMark && shouldRender.value) {
6463
6652
  return createVNode("div", {
6464
- "class": bem$15("month-mark")
6653
+ "class": bem$13("month-mark")
6465
6654
  }, [props2.date.getMonth() + 1]);
6466
6655
  }
6467
6656
  };
@@ -6501,7 +6690,7 @@ var stdin_default$1h = defineComponent({
6501
6690
  setScrollTop(body, daysRect.top + rowOffset + body.scrollTop - useRect(body).top);
6502
6691
  }
6503
6692
  };
6504
- const renderDay = (item, index) => createVNode(stdin_default$1i, {
6693
+ const renderDay = (item, index) => createVNode(stdin_default$1g, {
6505
6694
  "item": item,
6506
6695
  "index": index,
6507
6696
  "color": props2.color,
@@ -6513,7 +6702,7 @@ var stdin_default$1h = defineComponent({
6513
6702
  const renderDays = () => createVNode("div", {
6514
6703
  "ref": daysRef,
6515
6704
  "role": "grid",
6516
- "class": bem$15("days")
6705
+ "class": bem$13("days")
6517
6706
  }, [renderMark(), (shouldRender.value ? days : placeholders).value.map(renderDay)]);
6518
6707
  useExpose({
6519
6708
  getTitle,
@@ -6523,47 +6712,110 @@ var stdin_default$1h = defineComponent({
6523
6712
  disabledDays
6524
6713
  });
6525
6714
  return () => createVNode("div", {
6526
- "class": bem$15("month"),
6715
+ "class": bem$13("month"),
6527
6716
  "ref": monthRef
6528
6717
  }, [renderTitle(), renderDays()]);
6529
6718
  }
6530
6719
  });
6531
- const [name$16] = createNamespace("calendar-header");
6532
- var stdin_default$1g = defineComponent({
6533
- name: name$16,
6720
+ const [name$14] = createNamespace("calendar-header");
6721
+ var stdin_default$1e = defineComponent({
6722
+ name: name$14,
6534
6723
  props: {
6535
6724
  date: Date,
6725
+ minDate: Date,
6726
+ maxDate: Date,
6536
6727
  title: String,
6537
6728
  subtitle: String,
6538
6729
  showTitle: Boolean,
6539
6730
  showSubtitle: Boolean,
6540
- firstDayOfWeek: Number
6731
+ firstDayOfWeek: Number,
6732
+ switchMode: makeStringProp("none")
6541
6733
  },
6542
- emits: ["clickSubtitle"],
6734
+ emits: ["clickSubtitle", "panelChange"],
6543
6735
  setup(props2, {
6544
6736
  slots,
6545
6737
  emit
6546
6738
  }) {
6739
+ const prevMonthDisabled = computed(() => {
6740
+ const prevMonth = getPrevMonth(props2.date);
6741
+ return props2.minDate && prevMonth < props2.minDate;
6742
+ });
6743
+ const prevYearDisabled = computed(() => {
6744
+ const prevYear = getPrevYear(props2.date);
6745
+ return props2.minDate && prevYear < props2.minDate;
6746
+ });
6747
+ const nextMonthDisabled = computed(() => {
6748
+ const nextMonth = getNextMonth(props2.date);
6749
+ return props2.maxDate && nextMonth > props2.maxDate;
6750
+ });
6751
+ const nextYearDisabled = computed(() => {
6752
+ const nextYear = getNextYear(props2.date);
6753
+ return props2.maxDate && nextYear > props2.maxDate;
6754
+ });
6547
6755
  const renderTitle = () => {
6548
6756
  if (props2.showTitle) {
6549
6757
  const text = props2.title || t$g("title");
6550
6758
  const title = slots.title ? slots.title() : text;
6551
6759
  return createVNode("div", {
6552
- "class": bem$15("header-title")
6760
+ "class": bem$13("header-title")
6553
6761
  }, [title]);
6554
6762
  }
6555
6763
  };
6556
6764
  const onClickSubtitle = (event) => emit("clickSubtitle", event);
6765
+ const onPanelChange = (date) => emit("panelChange", date);
6766
+ const renderAction = (isNext) => {
6767
+ const showYearAction = props2.switchMode === "year-month";
6768
+ const monthSlot = slots[isNext ? "next-month" : "prev-month"];
6769
+ const yearSlot = slots[isNext ? "next-year" : "prev-year"];
6770
+ const monthDisabled = isNext ? nextMonthDisabled.value : prevMonthDisabled.value;
6771
+ const yearDisabled = isNext ? nextYearDisabled.value : prevYearDisabled.value;
6772
+ const monthIconName = isNext ? "arrow" : "arrow-left";
6773
+ const yearIconName = isNext ? "arrow-double-right" : "arrow-double-left";
6774
+ const onMonthChange = () => onPanelChange((isNext ? getNextMonth : getPrevMonth)(props2.date));
6775
+ const onYearChange = () => onPanelChange((isNext ? getNextYear : getPrevYear)(props2.date));
6776
+ const MonthAction = createVNode("view", {
6777
+ "class": bem$13("header-action", {
6778
+ disabled: monthDisabled
6779
+ }),
6780
+ "onClick": monthDisabled ? void 0 : onMonthChange
6781
+ }, [monthSlot ? monthSlot({
6782
+ disabled: monthDisabled
6783
+ }) : createVNode(Icon, {
6784
+ "class": {
6785
+ [HAPTICS_FEEDBACK]: !monthDisabled
6786
+ },
6787
+ "name": monthIconName
6788
+ }, null)]);
6789
+ const YearAction = showYearAction && createVNode("view", {
6790
+ "class": bem$13("header-action", {
6791
+ disabled: yearDisabled
6792
+ }),
6793
+ "onClick": yearDisabled ? void 0 : onYearChange
6794
+ }, [yearSlot ? yearSlot({
6795
+ disabled: yearDisabled
6796
+ }) : createVNode(Icon, {
6797
+ "class": {
6798
+ [HAPTICS_FEEDBACK]: !yearDisabled
6799
+ },
6800
+ "name": yearIconName
6801
+ }, null)]);
6802
+ return isNext ? [MonthAction, YearAction] : [YearAction, MonthAction];
6803
+ };
6557
6804
  const renderSubtitle = () => {
6558
6805
  if (props2.showSubtitle) {
6559
6806
  const title = slots.subtitle ? slots.subtitle({
6560
6807
  date: props2.date,
6561
6808
  text: props2.subtitle
6562
6809
  }) : props2.subtitle;
6810
+ const canSwitch = props2.switchMode !== "none";
6563
6811
  return createVNode("div", {
6564
- "class": bem$15("header-subtitle"),
6812
+ "class": bem$13("header-subtitle", {
6813
+ "with-swicth": canSwitch
6814
+ }),
6565
6815
  "onClick": onClickSubtitle
6566
- }, [title]);
6816
+ }, [canSwitch ? [renderAction(), createVNode("div", {
6817
+ "class": bem$13("header-subtitle-text")
6818
+ }, [title]), renderAction(true)] : title]);
6567
6819
  }
6568
6820
  };
6569
6821
  const renderWeekDays = () => {
@@ -6573,19 +6825,20 @@ var stdin_default$1g = defineComponent({
6573
6825
  const weekdays = t$g("weekdays");
6574
6826
  const renderWeekDays2 = [...weekdays.slice(firstDayOfWeek, 7), ...weekdays.slice(0, firstDayOfWeek)];
6575
6827
  return createVNode("div", {
6576
- "class": bem$15("weekdays")
6828
+ "class": bem$13("weekdays")
6577
6829
  }, [renderWeekDays2.map((text) => createVNode("span", {
6578
- "class": bem$15("weekday")
6830
+ "class": bem$13("weekday")
6579
6831
  }, [text]))]);
6580
6832
  };
6581
6833
  return () => createVNode("div", {
6582
- "class": bem$15("header")
6834
+ "class": bem$13("header")
6583
6835
  }, [renderTitle(), renderSubtitle(), renderWeekDays()]);
6584
6836
  }
6585
6837
  });
6586
6838
  const calendarProps = {
6587
6839
  show: Boolean,
6588
6840
  type: makeStringProp("single"),
6841
+ switchMode: makeStringProp("none"),
6589
6842
  title: String,
6590
6843
  color: String,
6591
6844
  round: truthProp,
@@ -6613,16 +6866,11 @@ const calendarProps = {
6613
6866
  safeAreaInsetBottom: truthProp,
6614
6867
  minDate: {
6615
6868
  type: Date,
6616
- validator: isDate,
6617
- default: getToday
6869
+ validator: isDate
6618
6870
  },
6619
6871
  maxDate: {
6620
6872
  type: Date,
6621
- validator: isDate,
6622
- default: () => {
6623
- const now = getToday();
6624
- return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate());
6625
- }
6873
+ validator: isDate
6626
6874
  },
6627
6875
  firstDayOfWeek: {
6628
6876
  type: numericProp,
@@ -6630,28 +6878,39 @@ const calendarProps = {
6630
6878
  validator: (val) => val >= 0 && val <= 6
6631
6879
  }
6632
6880
  };
6633
- var stdin_default$1f = defineComponent({
6634
- name: name$19,
6881
+ var stdin_default$1d = defineComponent({
6882
+ name: name$17,
6635
6883
  props: calendarProps,
6636
- emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle", "clickDisabledDate"],
6884
+ emits: ["select", "confirm", "unselect", "monthShow", "overRange", "update:show", "clickSubtitle", "clickDisabledDate", "panelChange"],
6637
6885
  setup(props2, {
6638
6886
  emit,
6639
6887
  slots
6640
6888
  }) {
6641
- const limitDateRange = (date, minDate = props2.minDate, maxDate = props2.maxDate) => {
6642
- if (compareDay(date, minDate) === -1) {
6643
- return minDate;
6889
+ const canSwitch = computed(() => props2.switchMode !== "none");
6890
+ const minDate = computed(() => {
6891
+ if (!props2.minDate && !canSwitch.value) {
6892
+ return getToday();
6893
+ }
6894
+ return props2.minDate;
6895
+ });
6896
+ const maxDate = computed(() => {
6897
+ if (!props2.maxDate && !canSwitch.value) {
6898
+ return getMonthByOffset(getToday(), 6);
6899
+ }
6900
+ return props2.maxDate;
6901
+ });
6902
+ const limitDateRange = (date, min = minDate.value, max = maxDate.value) => {
6903
+ if (min && compareDay(date, min) === -1) {
6904
+ return min;
6644
6905
  }
6645
- if (compareDay(date, maxDate) === 1) {
6646
- return maxDate;
6906
+ if (max && compareDay(date, max) === 1) {
6907
+ return max;
6647
6908
  }
6648
6909
  return date;
6649
6910
  };
6650
6911
  const getInitialDate = (defaultDate = props2.defaultDate) => {
6651
6912
  const {
6652
6913
  type,
6653
- minDate,
6654
- maxDate,
6655
6914
  allowSameDay
6656
6915
  } = props2;
6657
6916
  if (defaultDate === null) {
@@ -6662,8 +6921,10 @@ var stdin_default$1f = defineComponent({
6662
6921
  if (!Array.isArray(defaultDate)) {
6663
6922
  defaultDate = [];
6664
6923
  }
6665
- const start = limitDateRange(defaultDate[0] || now, minDate, allowSameDay ? maxDate : getPrevDay(maxDate));
6666
- const end = limitDateRange(defaultDate[1] || now, allowSameDay ? minDate : getNextDay(minDate));
6924
+ const min = minDate.value;
6925
+ const max = maxDate.value;
6926
+ const start = limitDateRange(defaultDate[0] || now, min, max ? allowSameDay ? max : getPrevDay(max) : void 0);
6927
+ const end = limitDateRange(defaultDate[1] || (allowSameDay ? now : getNextDay(now)), min ? allowSameDay ? min : getNextDay(min) : void 0);
6667
6928
  return [start, end];
6668
6929
  }
6669
6930
  if (type === "multiple") {
@@ -6677,23 +6938,28 @@ var stdin_default$1f = defineComponent({
6677
6938
  }
6678
6939
  return limitDateRange(defaultDate);
6679
6940
  };
6941
+ const getInitialPanelDate = () => {
6942
+ const date = Array.isArray(currentDate.value) ? currentDate.value[0] : currentDate.value;
6943
+ return date ? date : limitDateRange(getToday());
6944
+ };
6680
6945
  let bodyHeight;
6681
6946
  const bodyRef = ref();
6682
- const subtitle = ref({
6683
- textFn: () => "",
6684
- date: void 0
6685
- });
6686
6947
  const currentDate = ref(getInitialDate());
6948
+ const currentPanelDate = ref(getInitialPanelDate());
6949
+ const currentMonthRef = ref();
6687
6950
  const [monthRefs, setMonthRefs] = useRefs();
6688
6951
  const dayOffset = computed(() => props2.firstDayOfWeek ? +props2.firstDayOfWeek % 7 : 0);
6689
6952
  const months = computed(() => {
6690
6953
  const months2 = [];
6691
- const cursor = new Date(props2.minDate);
6954
+ if (!minDate.value || !maxDate.value) {
6955
+ return months2;
6956
+ }
6957
+ const cursor = new Date(minDate.value);
6692
6958
  cursor.setDate(1);
6693
6959
  do {
6694
6960
  months2.push(new Date(cursor));
6695
6961
  cursor.setMonth(cursor.getMonth() + 1);
6696
- } while (compareMonth(cursor, props2.maxDate) !== 1);
6962
+ } while (compareMonth(cursor, maxDate.value) !== 1);
6697
6963
  return months2;
6698
6964
  });
6699
6965
  const buttonDisabled = computed(() => {
@@ -6743,25 +7009,26 @@ var stdin_default$1f = defineComponent({
6743
7009
  monthRefs.value[index].setVisible(visible);
6744
7010
  });
6745
7011
  if (currentMonth) {
6746
- subtitle.value = {
6747
- textFn: currentMonth.getTitle,
6748
- date: currentMonth.date
6749
- };
7012
+ currentMonthRef.value = currentMonth;
6750
7013
  }
6751
7014
  };
6752
7015
  const scrollToDate = (targetDate) => {
6753
- raf(() => {
6754
- months.value.some((month, index) => {
6755
- if (compareMonth(month, targetDate) === 0) {
6756
- if (bodyRef.value) {
6757
- monthRefs.value[index].scrollToDate(bodyRef.value, targetDate);
7016
+ if (canSwitch.value) {
7017
+ currentPanelDate.value = targetDate;
7018
+ } else {
7019
+ raf(() => {
7020
+ months.value.some((month, index) => {
7021
+ if (compareMonth(month, targetDate) === 0) {
7022
+ if (bodyRef.value) {
7023
+ monthRefs.value[index].scrollToDate(bodyRef.value, targetDate);
7024
+ }
7025
+ return true;
6758
7026
  }
6759
- return true;
6760
- }
6761
- return false;
7027
+ return false;
7028
+ });
7029
+ onScroll();
6762
7030
  });
6763
- onScroll();
6764
- });
7031
+ }
6765
7032
  };
6766
7033
  const scrollToCurrentDate = () => {
6767
7034
  if (props2.poppable && !props2.show) {
@@ -6772,7 +7039,7 @@ var stdin_default$1f = defineComponent({
6772
7039
  if (isDate(targetDate)) {
6773
7040
  scrollToDate(targetDate);
6774
7041
  }
6775
- } else {
7042
+ } else if (!canSwitch.value) {
6776
7043
  raf(onScroll);
6777
7044
  }
6778
7045
  };
@@ -6780,9 +7047,11 @@ var stdin_default$1f = defineComponent({
6780
7047
  if (props2.poppable && !props2.show) {
6781
7048
  return;
6782
7049
  }
6783
- raf(() => {
6784
- bodyHeight = Math.floor(useRect(bodyRef).height);
6785
- });
7050
+ if (!canSwitch.value) {
7051
+ raf(() => {
7052
+ bodyHeight = Math.floor(useRect(bodyRef).height);
7053
+ });
7054
+ }
6786
7055
  scrollToCurrentDate();
6787
7056
  };
6788
7057
  const reset = (date = getInitialDate()) => {
@@ -6804,6 +7073,12 @@ var stdin_default$1f = defineComponent({
6804
7073
  }
6805
7074
  return true;
6806
7075
  };
7076
+ const onPanelChange = (date) => {
7077
+ currentPanelDate.value = date;
7078
+ emit("panelChange", {
7079
+ date
7080
+ });
7081
+ };
6807
7082
  const onConfirm = () => {
6808
7083
  var _a;
6809
7084
  return emit("confirm", (_a = currentDate.value) != null ? _a : cloneDates(currentDate.value));
@@ -6894,13 +7169,16 @@ var stdin_default$1f = defineComponent({
6894
7169
  const updateShow = (value) => emit("update:show", value);
6895
7170
  const renderMonth = (date, index) => {
6896
7171
  const showMonthTitle = index !== 0 || !props2.showSubtitle;
6897
- return createVNode(stdin_default$1h, mergeProps({
6898
- "ref": setMonthRefs(index),
7172
+ return createVNode(stdin_default$1f, mergeProps({
7173
+ "ref": canSwitch.value ? currentMonthRef : setMonthRefs(index),
6899
7174
  "date": date,
6900
7175
  "currentDate": currentDate.value,
6901
7176
  "showMonthTitle": showMonthTitle,
6902
- "firstDayOfWeek": dayOffset.value
6903
- }, pick(props2, ["type", "color", "minDate", "maxDate", "showMark", "formatter", "rowHeight", "lazyRender", "showSubtitle", "allowSameDay"]), {
7177
+ "firstDayOfWeek": dayOffset.value,
7178
+ "lazyRender": canSwitch.value ? false : props2.lazyRender,
7179
+ "maxDate": maxDate.value,
7180
+ "minDate": minDate.value
7181
+ }, pick(props2, ["type", "color", "showMark", "formatter", "rowHeight", "showSubtitle", "allowSameDay"]), {
6904
7182
  "onClick": onClickDay,
6905
7183
  "onClickDisabledDate": (item) => emit("clickDisabledDate", item)
6906
7184
  }), pick(slots, ["top-info", "bottom-info", "month-title"]));
@@ -6918,7 +7196,7 @@ var stdin_default$1f = defineComponent({
6918
7196
  "block": true,
6919
7197
  "type": "primary",
6920
7198
  "color": props2.color,
6921
- "class": bem$15("confirm"),
7199
+ "class": bem$13("confirm"),
6922
7200
  "disabled": disabled,
6923
7201
  "nativeType": "button",
6924
7202
  "onClick": onConfirm
@@ -6930,30 +7208,34 @@ var stdin_default$1f = defineComponent({
6930
7208
  }
6931
7209
  };
6932
7210
  const renderFooter = () => createVNode("div", {
6933
- "class": [bem$15("footer"), {
7211
+ "class": [bem$13("footer"), {
6934
7212
  "van-safe-area-bottom": props2.safeAreaInsetBottom
6935
7213
  }]
6936
7214
  }, [renderFooterButton()]);
6937
7215
  const renderCalendar = () => {
6938
- const subTitle = subtitle.value.textFn();
7216
+ var _a, _b;
6939
7217
  return createVNode("div", {
6940
- "class": bem$15()
6941
- }, [createVNode(stdin_default$1g, {
6942
- "date": subtitle.value.date,
7218
+ "class": bem$13()
7219
+ }, [createVNode(stdin_default$1e, {
7220
+ "date": (_a = currentMonthRef.value) == null ? void 0 : _a.date,
7221
+ "maxDate": maxDate.value,
7222
+ "minDate": minDate.value,
6943
7223
  "title": props2.title,
6944
- "subtitle": subTitle,
7224
+ "subtitle": (_b = currentMonthRef.value) == null ? void 0 : _b.getTitle(),
6945
7225
  "showTitle": props2.showTitle,
6946
7226
  "showSubtitle": props2.showSubtitle,
7227
+ "switchMode": props2.switchMode,
6947
7228
  "firstDayOfWeek": dayOffset.value,
6948
- "onClickSubtitle": (event) => emit("clickSubtitle", event)
6949
- }, pick(slots, ["title", "subtitle"])), createVNode("div", {
7229
+ "onClickSubtitle": (event) => emit("clickSubtitle", event),
7230
+ "onPanelChange": onPanelChange
7231
+ }, pick(slots, ["title", "subtitle", "prev-month", "prev-year", "next-month", "next-year"])), createVNode("div", {
6950
7232
  "ref": bodyRef,
6951
- "class": bem$15("body"),
6952
- "onScroll": onScroll
6953
- }, [months.value.map(renderMonth)]), renderFooter()]);
7233
+ "class": bem$13("body"),
7234
+ "onScroll": canSwitch.value ? void 0 : onScroll
7235
+ }, [canSwitch.value ? renderMonth(currentPanelDate.value, 0) : months.value.map(renderMonth)]), renderFooter()]);
6954
7236
  };
6955
7237
  watch(() => props2.show, init);
6956
- watch(() => [props2.type, props2.minDate, props2.maxDate], () => reset(getInitialDate(currentDate.value)));
7238
+ watch(() => [props2.type, props2.minDate, props2.maxDate, props2.switchMode], () => reset(getInitialDate(currentDate.value)));
6957
7239
  watch(() => props2.defaultDate, (value = null) => {
6958
7240
  currentDate.value = value;
6959
7241
  scrollToCurrentDate();
@@ -6968,7 +7250,7 @@ var stdin_default$1f = defineComponent({
6968
7250
  if (props2.poppable) {
6969
7251
  return createVNode(Popup, {
6970
7252
  "show": props2.show,
6971
- "class": bem$15("popup"),
7253
+ "class": bem$13("popup"),
6972
7254
  "round": props2.round,
6973
7255
  "position": props2.position,
6974
7256
  "closeable": props2.showTitle || props2.showSubtitle,
@@ -6985,8 +7267,8 @@ var stdin_default$1f = defineComponent({
6985
7267
  };
6986
7268
  }
6987
7269
  });
6988
- const Calendar = withInstall(stdin_default$1f);
6989
- const [name$15, bem$14] = createNamespace("image");
7270
+ const Calendar = withInstall(stdin_default$1d);
7271
+ const [name$13, bem$12] = createNamespace("image");
6990
7272
  const imageProps = {
6991
7273
  src: String,
6992
7274
  alt: String,
@@ -7007,8 +7289,8 @@ const imageProps = {
7007
7289
  crossorigin: String,
7008
7290
  referrerpolicy: String
7009
7291
  };
7010
- var stdin_default$1e = defineComponent({
7011
- name: name$15,
7292
+ var stdin_default$1c = defineComponent({
7293
+ name: name$13,
7012
7294
  props: imageProps,
7013
7295
  emits: ["load", "error"],
7014
7296
  setup(props2, {
@@ -7069,13 +7351,13 @@ var stdin_default$1e = defineComponent({
7069
7351
  const renderPlaceholder = () => {
7070
7352
  if (loading.value && props2.showLoading) {
7071
7353
  return createVNode("div", {
7072
- "class": bem$14("loading")
7073
- }, [renderIcon(props2.loadingIcon, bem$14("loading-icon"), slots.loading)]);
7354
+ "class": bem$12("loading")
7355
+ }, [renderIcon(props2.loadingIcon, bem$12("loading-icon"), slots.loading)]);
7074
7356
  }
7075
7357
  if (error.value && props2.showError) {
7076
7358
  return createVNode("div", {
7077
- "class": bem$14("error")
7078
- }, [renderIcon(props2.errorIcon, bem$14("error-icon"), slots.error)]);
7359
+ "class": bem$12("error")
7360
+ }, [renderIcon(props2.errorIcon, bem$12("error-icon"), slots.error)]);
7079
7361
  }
7080
7362
  };
7081
7363
  const renderImage = () => {
@@ -7084,7 +7366,7 @@ var stdin_default$1e = defineComponent({
7084
7366
  }
7085
7367
  const attrs = {
7086
7368
  alt: props2.alt,
7087
- class: bem$14("img"),
7369
+ class: bem$12("img"),
7088
7370
  style: {
7089
7371
  objectFit: props2.fit,
7090
7372
  objectPosition: props2.position
@@ -7144,7 +7426,7 @@ var stdin_default$1e = defineComponent({
7144
7426
  return () => {
7145
7427
  var _a;
7146
7428
  return createVNode("div", {
7147
- "class": bem$14({
7429
+ "class": bem$12({
7148
7430
  round: props2.round,
7149
7431
  block: props2.block
7150
7432
  }),
@@ -7153,8 +7435,8 @@ var stdin_default$1e = defineComponent({
7153
7435
  };
7154
7436
  }
7155
7437
  });
7156
- const Image$1 = withInstall(stdin_default$1e);
7157
- const [name$14, bem$13] = createNamespace("card");
7438
+ const Image$1 = withInstall(stdin_default$1c);
7439
+ const [name$12, bem$11] = createNamespace("card");
7158
7440
  const cardProps = {
7159
7441
  tag: String,
7160
7442
  num: numericProp,
@@ -7168,8 +7450,8 @@ const cardProps = {
7168
7450
  thumbLink: String,
7169
7451
  originPrice: numericProp
7170
7452
  };
7171
- var stdin_default$1d = defineComponent({
7172
- name: name$14,
7453
+ var stdin_default$1b = defineComponent({
7454
+ name: name$12,
7173
7455
  props: cardProps,
7174
7456
  emits: ["clickThumb"],
7175
7457
  setup(props2, {
@@ -7182,14 +7464,14 @@ var stdin_default$1d = defineComponent({
7182
7464
  }
7183
7465
  if (props2.title) {
7184
7466
  return createVNode("div", {
7185
- "class": [bem$13("title"), "van-multi-ellipsis--l2"]
7467
+ "class": [bem$11("title"), "van-multi-ellipsis--l2"]
7186
7468
  }, [props2.title]);
7187
7469
  }
7188
7470
  };
7189
7471
  const renderThumbTag = () => {
7190
7472
  if (slots.tag || props2.tag) {
7191
7473
  return createVNode("div", {
7192
- "class": bem$13("tag")
7474
+ "class": bem$11("tag")
7193
7475
  }, [slots.tag ? slots.tag() : createVNode(Tag, {
7194
7476
  "mark": true,
7195
7477
  "type": "primary"
@@ -7214,7 +7496,7 @@ var stdin_default$1d = defineComponent({
7214
7496
  if (slots.thumb || props2.thumb) {
7215
7497
  return createVNode("a", {
7216
7498
  "href": props2.thumbLink,
7217
- "class": bem$13("thumb"),
7499
+ "class": bem$11("thumb"),
7218
7500
  "onClick": (event) => emit("clickThumb", event)
7219
7501
  }, [renderThumbImage(), renderThumbTag()]);
7220
7502
  }
@@ -7225,18 +7507,18 @@ var stdin_default$1d = defineComponent({
7225
7507
  }
7226
7508
  if (props2.desc) {
7227
7509
  return createVNode("div", {
7228
- "class": [bem$13("desc"), "van-ellipsis"]
7510
+ "class": [bem$11("desc"), "van-ellipsis"]
7229
7511
  }, [props2.desc]);
7230
7512
  }
7231
7513
  };
7232
7514
  const renderPriceText = () => {
7233
7515
  const priceArr = props2.price.toString().split(".");
7234
7516
  return createVNode("div", null, [createVNode("span", {
7235
- "class": bem$13("price-currency")
7517
+ "class": bem$11("price-currency")
7236
7518
  }, [props2.currency]), createVNode("span", {
7237
- "class": bem$13("price-integer")
7519
+ "class": bem$11("price-integer")
7238
7520
  }, [priceArr[0]]), createTextVNode("."), createVNode("span", {
7239
- "class": bem$13("price-decimal")
7521
+ "class": bem$11("price-decimal")
7240
7522
  }, [priceArr[1]])]);
7241
7523
  };
7242
7524
  return () => {
@@ -7246,34 +7528,34 @@ var stdin_default$1d = defineComponent({
7246
7528
  const showOriginPrice = slots["origin-price"] || isDef(props2.originPrice);
7247
7529
  const showBottom = showNum || showPrice || showOriginPrice || slots.bottom;
7248
7530
  const Price = showPrice && createVNode("div", {
7249
- "class": bem$13("price")
7531
+ "class": bem$11("price")
7250
7532
  }, [slots.price ? slots.price() : renderPriceText()]);
7251
7533
  const OriginPrice = showOriginPrice && createVNode("div", {
7252
- "class": bem$13("origin-price")
7534
+ "class": bem$11("origin-price")
7253
7535
  }, [slots["origin-price"] ? slots["origin-price"]() : `${props2.currency} ${props2.originPrice}`]);
7254
7536
  const Num = showNum && createVNode("div", {
7255
- "class": bem$13("num")
7537
+ "class": bem$11("num")
7256
7538
  }, [slots.num ? slots.num() : `x${props2.num}`]);
7257
7539
  const Footer = slots.footer && createVNode("div", {
7258
- "class": bem$13("footer")
7540
+ "class": bem$11("footer")
7259
7541
  }, [slots.footer()]);
7260
7542
  const Bottom = showBottom && createVNode("div", {
7261
- "class": bem$13("bottom")
7543
+ "class": bem$11("bottom")
7262
7544
  }, [(_a = slots["price-top"]) == null ? void 0 : _a.call(slots), Price, OriginPrice, Num, (_b = slots.bottom) == null ? void 0 : _b.call(slots)]);
7263
7545
  return createVNode("div", {
7264
- "class": bem$13()
7546
+ "class": bem$11()
7265
7547
  }, [createVNode("div", {
7266
- "class": bem$13("header")
7548
+ "class": bem$11("header")
7267
7549
  }, [renderThumb(), createVNode("div", {
7268
- "class": bem$13("content", {
7550
+ "class": bem$11("content", {
7269
7551
  centered: props2.centered
7270
7552
  })
7271
7553
  }, [createVNode("div", null, [renderTitle(), renderDesc(), (_c = slots.tags) == null ? void 0 : _c.call(slots)]), Bottom])]), Footer]);
7272
7554
  };
7273
7555
  }
7274
7556
  });
7275
- const Card = withInstall(stdin_default$1d);
7276
- const [name$13, bem$12, t$f] = createNamespace("cascader");
7557
+ const Card = withInstall(stdin_default$1b);
7558
+ const [name$11, bem$10, t$f] = createNamespace("cascader");
7277
7559
  const cascaderProps = {
7278
7560
  title: String,
7279
7561
  options: makeArrayProp(),
@@ -7286,8 +7568,8 @@ const cascaderProps = {
7286
7568
  placeholder: String,
7287
7569
  activeColor: String
7288
7570
  };
7289
- var stdin_default$1c = defineComponent({
7290
- name: name$13,
7571
+ var stdin_default$1a = defineComponent({
7572
+ name: name$11,
7291
7573
  props: cascaderProps,
7292
7574
  emits: ["close", "change", "finish", "clickTab", "update:modelValue"],
7293
7575
  setup(props2, {
@@ -7396,12 +7678,12 @@ var stdin_default$1c = defineComponent({
7396
7678
  title
7397
7679
  }) => emit("clickTab", name2, title);
7398
7680
  const renderHeader = () => props2.showHeader ? createVNode("div", {
7399
- "class": bem$12("header")
7681
+ "class": bem$10("header")
7400
7682
  }, [createVNode("h2", {
7401
- "class": bem$12("title")
7683
+ "class": bem$10("title")
7402
7684
  }, [slots.title ? slots.title() : props2.title]), props2.closeable ? createVNode(Icon, {
7403
7685
  "name": props2.closeIcon,
7404
- "class": [bem$12("close-icon"), HAPTICS_FEEDBACK],
7686
+ "class": [bem$10("close-icon"), HAPTICS_FEEDBACK],
7405
7687
  "onClick": onClose
7406
7688
  }, null) : null]) : null;
7407
7689
  const renderOption = (option, selectedOption, tabIndex) => {
@@ -7417,7 +7699,7 @@ var stdin_default$1c = defineComponent({
7417
7699
  return createVNode("li", {
7418
7700
  "ref": selected ? setSelectedElementRefs(tabIndex) : void 0,
7419
7701
  "role": "menuitemradio",
7420
- "class": [bem$12("option", {
7702
+ "class": [bem$10("option", {
7421
7703
  selected,
7422
7704
  disabled
7423
7705
  }), option.className],
@@ -7430,12 +7712,12 @@ var stdin_default$1c = defineComponent({
7430
7712
  "onClick": () => onSelect(option, tabIndex)
7431
7713
  }, [Text2, selected ? createVNode(Icon, {
7432
7714
  "name": "success",
7433
- "class": bem$12("selected-icon")
7715
+ "class": bem$10("selected-icon")
7434
7716
  }, null) : null]);
7435
7717
  };
7436
7718
  const renderOptions = (options, selectedOption, tabIndex) => createVNode("ul", {
7437
7719
  "role": "menu",
7438
- "class": bem$12("options")
7720
+ "class": bem$10("options")
7439
7721
  }, [options.map((option) => renderOption(option, selectedOption, tabIndex))]);
7440
7722
  const renderTab = (tab, tabIndex) => {
7441
7723
  const {
@@ -7446,7 +7728,7 @@ var stdin_default$1c = defineComponent({
7446
7728
  const title = selected ? selected[textKey] : placeholder;
7447
7729
  return createVNode(Tab, {
7448
7730
  "title": title,
7449
- "titleClass": bem$12("tab", {
7731
+ "titleClass": bem$10("tab", {
7450
7732
  unselected: !selected
7451
7733
  })
7452
7734
  }, {
@@ -7465,7 +7747,7 @@ var stdin_default$1c = defineComponent({
7465
7747
  "onUpdate:active": ($event) => activeTab.value = $event,
7466
7748
  "shrink": true,
7467
7749
  "animated": true,
7468
- "class": bem$12("tabs"),
7750
+ "class": bem$10("tabs"),
7469
7751
  "color": props2.activeColor,
7470
7752
  "swipeable": props2.swipeable,
7471
7753
  "onClickTab": onClickTab
@@ -7500,19 +7782,19 @@ var stdin_default$1c = defineComponent({
7500
7782
  updateTabs();
7501
7783
  });
7502
7784
  return () => createVNode("div", {
7503
- "class": bem$12()
7785
+ "class": bem$10()
7504
7786
  }, [renderHeader(), renderTabs()]);
7505
7787
  }
7506
7788
  });
7507
- const Cascader = withInstall(stdin_default$1c);
7508
- const [name$12, bem$11] = createNamespace("cell-group");
7789
+ const Cascader = withInstall(stdin_default$1a);
7790
+ const [name$10, bem$$] = createNamespace("cell-group");
7509
7791
  const cellGroupProps = {
7510
7792
  title: String,
7511
7793
  inset: Boolean,
7512
7794
  border: truthProp
7513
7795
  };
7514
- var stdin_default$1b = defineComponent({
7515
- name: name$12,
7796
+ var stdin_default$19 = defineComponent({
7797
+ name: name$10,
7516
7798
  inheritAttrs: false,
7517
7799
  props: cellGroupProps,
7518
7800
  setup(props2, {
@@ -7522,7 +7804,7 @@ var stdin_default$1b = defineComponent({
7522
7804
  const renderGroup = () => {
7523
7805
  var _a;
7524
7806
  return createVNode("div", mergeProps({
7525
- "class": [bem$11({
7807
+ "class": [bem$$({
7526
7808
  inset: props2.inset
7527
7809
  }), {
7528
7810
  [BORDER_TOP_BOTTOM]: props2.border && !props2.inset
@@ -7530,7 +7812,7 @@ var stdin_default$1b = defineComponent({
7530
7812
  }, attrs, useScopeId()), [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
7531
7813
  };
7532
7814
  const renderTitle = () => createVNode("div", {
7533
- "class": bem$11("title", {
7815
+ "class": bem$$("title", {
7534
7816
  inset: props2.inset
7535
7817
  })
7536
7818
  }, [slots.title ? slots.title() : props2.title]);
@@ -7542,153 +7824,7 @@ var stdin_default$1b = defineComponent({
7542
7824
  };
7543
7825
  }
7544
7826
  });
7545
- const CellGroup = withInstall(stdin_default$1b);
7546
- const [name$11, bem$10] = createNamespace("checkbox-group");
7547
- const checkboxGroupProps = {
7548
- max: numericProp,
7549
- shape: makeStringProp("round"),
7550
- disabled: Boolean,
7551
- iconSize: numericProp,
7552
- direction: String,
7553
- modelValue: makeArrayProp(),
7554
- checkedColor: String
7555
- };
7556
- const CHECKBOX_GROUP_KEY = Symbol(name$11);
7557
- var stdin_default$1a = defineComponent({
7558
- name: name$11,
7559
- props: checkboxGroupProps,
7560
- emits: ["change", "update:modelValue"],
7561
- setup(props2, {
7562
- emit,
7563
- slots
7564
- }) {
7565
- const {
7566
- children,
7567
- linkChildren
7568
- } = useChildren(CHECKBOX_GROUP_KEY);
7569
- const updateValue = (value) => emit("update:modelValue", value);
7570
- const toggleAll = (options = {}) => {
7571
- if (typeof options === "boolean") {
7572
- options = {
7573
- checked: options
7574
- };
7575
- }
7576
- const {
7577
- checked,
7578
- skipDisabled
7579
- } = options;
7580
- const checkedChildren = children.filter((item) => {
7581
- if (!item.props.bindGroup) {
7582
- return false;
7583
- }
7584
- if (item.props.disabled && skipDisabled) {
7585
- return item.checked.value;
7586
- }
7587
- return checked != null ? checked : !item.checked.value;
7588
- });
7589
- const names = checkedChildren.map((item) => item.name);
7590
- updateValue(names);
7591
- };
7592
- watch(() => props2.modelValue, (value) => emit("change", value));
7593
- useExpose({
7594
- toggleAll
7595
- });
7596
- useCustomFieldValue(() => props2.modelValue);
7597
- linkChildren({
7598
- props: props2,
7599
- updateValue
7600
- });
7601
- return () => {
7602
- var _a;
7603
- return createVNode("div", {
7604
- "class": bem$10([props2.direction])
7605
- }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
7606
- };
7607
- }
7608
- });
7609
- const [name$10, bem$$] = createNamespace("checkbox");
7610
- const checkboxProps = extend({}, checkerProps, {
7611
- shape: String,
7612
- bindGroup: truthProp,
7613
- indeterminate: {
7614
- type: Boolean,
7615
- default: null
7616
- }
7617
- });
7618
- var stdin_default$19 = defineComponent({
7619
- name: name$10,
7620
- props: checkboxProps,
7621
- emits: ["change", "update:modelValue"],
7622
- setup(props2, {
7623
- emit,
7624
- slots
7625
- }) {
7626
- const {
7627
- parent
7628
- } = useParent(CHECKBOX_GROUP_KEY);
7629
- const setParentValue = (checked2) => {
7630
- const {
7631
- name: name2
7632
- } = props2;
7633
- const {
7634
- max,
7635
- modelValue
7636
- } = parent.props;
7637
- const value = modelValue.slice();
7638
- if (checked2) {
7639
- const overlimit = max && value.length >= +max;
7640
- if (!overlimit && !value.includes(name2)) {
7641
- value.push(name2);
7642
- if (props2.bindGroup) {
7643
- parent.updateValue(value);
7644
- }
7645
- }
7646
- } else {
7647
- const index = value.indexOf(name2);
7648
- if (index !== -1) {
7649
- value.splice(index, 1);
7650
- if (props2.bindGroup) {
7651
- parent.updateValue(value);
7652
- }
7653
- }
7654
- }
7655
- };
7656
- const checked = computed(() => {
7657
- if (parent && props2.bindGroup) {
7658
- return parent.props.modelValue.indexOf(props2.name) !== -1;
7659
- }
7660
- return !!props2.modelValue;
7661
- });
7662
- const toggle = (newValue = !checked.value) => {
7663
- if (parent && props2.bindGroup) {
7664
- setParentValue(newValue);
7665
- } else {
7666
- emit("update:modelValue", newValue);
7667
- }
7668
- if (props2.indeterminate !== null)
7669
- emit("change", newValue);
7670
- };
7671
- watch(() => props2.modelValue, (value) => {
7672
- if (props2.indeterminate === null)
7673
- emit("change", value);
7674
- });
7675
- useExpose({
7676
- toggle,
7677
- props: props2,
7678
- checked
7679
- });
7680
- useCustomFieldValue(() => props2.modelValue);
7681
- return () => createVNode(stdin_default$1o, mergeProps({
7682
- "bem": bem$$,
7683
- "role": "checkbox",
7684
- "parent": parent,
7685
- "checked": checked.value,
7686
- "onToggle": toggle
7687
- }, props2), pick(slots, ["default", "icon"]));
7688
- }
7689
- });
7690
- const Checkbox = withInstall(stdin_default$19);
7691
- const CheckboxGroup = withInstall(stdin_default$1a);
7827
+ const CellGroup = withInstall(stdin_default$19);
7692
7828
  const [name$$, bem$_] = createNamespace("circle");
7693
7829
  let uid = 0;
7694
7830
  const format = (rate) => Math.min(Math.max(+rate, 0), 100);
@@ -10218,6 +10354,16 @@ var stdin_default$R = defineComponent({
10218
10354
  useEventListener("touchmove", onTouchmove, {
10219
10355
  target: rootRef
10220
10356
  });
10357
+ const renderHeader = () => {
10358
+ if (slots.header) {
10359
+ return slots.header();
10360
+ }
10361
+ return createVNode("div", {
10362
+ "class": bem$I("header")
10363
+ }, [createVNode("div", {
10364
+ "class": bem$I("header-bar")
10365
+ }, null)]);
10366
+ };
10221
10367
  return () => {
10222
10368
  var _a;
10223
10369
  return createVNode("div", {
@@ -10229,11 +10375,7 @@ var stdin_default$R = defineComponent({
10229
10375
  "onTouchstartPassive": onTouchstart,
10230
10376
  "onTouchend": onTouchend,
10231
10377
  "onTouchcancel": onTouchend
10232
- }, [createVNode("div", {
10233
- "class": bem$I("header")
10234
- }, [createVNode("div", {
10235
- "class": bem$I("header-bar")
10236
- }, null)]), createVNode("div", {
10378
+ }, [renderHeader(), createVNode("div", {
10237
10379
  "class": bem$I("content"),
10238
10380
  "ref": contentRef
10239
10381
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]);
@@ -10480,6 +10622,13 @@ var stdin_default$O = defineComponent({
10480
10622
  return chunks2;
10481
10623
  }, []);
10482
10624
  const lastChunk = chunks[chunks.length - 1];
10625
+ if (!lastChunk) {
10626
+ chunks.push({
10627
+ start: 0,
10628
+ end: sourceString.length,
10629
+ highlight: false
10630
+ });
10631
+ }
10483
10632
  if (lastChunk && lastChunk.end < sourceString.length) {
10484
10633
  chunks.push({
10485
10634
  start: lastChunk.end,
@@ -10715,6 +10864,8 @@ var stdin_default$N = defineComponent({
10715
10864
  const checkClose = (event) => {
10716
10865
  var _a;
10717
10866
  const swipeItemEl = (_a = swipeItem.value) == null ? void 0 : _a.$el;
10867
+ if (!swipeItemEl)
10868
+ return;
10718
10869
  const imageEl = swipeItemEl.firstElementChild;
10719
10870
  const isClickOverlay = event.target === swipeItemEl;
10720
10871
  const isClickImage = imageEl == null ? void 0 : imageEl.contains(event.target);
@@ -11184,7 +11335,11 @@ var stdin_default$L = defineComponent({
11184
11335
  const match = getMatchAnchor(selectActiveIndex);
11185
11336
  if (match) {
11186
11337
  const rect = match.getRect(scrollParent.value, scrollParentRect);
11187
- active = getActiveAnchor(rect.top, rects);
11338
+ if (props2.sticky && props2.stickyOffsetTop) {
11339
+ active = getActiveAnchor(rect.top - props2.stickyOffsetTop, rects);
11340
+ } else {
11341
+ active = getActiveAnchor(rect.top, rects);
11342
+ }
11188
11343
  }
11189
11344
  } else {
11190
11345
  active = getActiveAnchor(scrollTop, rects);
@@ -11257,7 +11412,11 @@ var stdin_default$L = defineComponent({
11257
11412
  return;
11258
11413
  }
11259
11414
  if (props2.sticky && props2.stickyOffsetTop) {
11260
- setRootScrollTop(getRootScrollTop() - props2.stickyOffsetTop);
11415
+ if (getRootScrollTop() === offsetHeight - scrollParentRect.height) {
11416
+ setRootScrollTop(getRootScrollTop());
11417
+ } else {
11418
+ setRootScrollTop(getRootScrollTop() - props2.stickyOffsetTop);
11419
+ }
11261
11420
  }
11262
11421
  emit("select", match.index);
11263
11422
  }
@@ -14572,6 +14731,7 @@ var stdin_default$e = defineComponent({
14572
14731
  "readonly": props2.disableInput,
14573
14732
  "inputmode": props2.integer ? "numeric" : "decimal",
14574
14733
  "placeholder": props2.placeholder,
14734
+ "autocomplete": "off",
14575
14735
  "aria-valuemax": props2.max,
14576
14736
  "aria-valuemin": props2.min,
14577
14737
  "aria-valuenow": current2.value,
@@ -16872,7 +17032,7 @@ const Lazyload = {
16872
17032
  });
16873
17033
  }
16874
17034
  };
16875
- const version = "4.8.11";
17035
+ const version = "4.9.1";
16876
17036
  function install(app) {
16877
17037
  const components = [
16878
17038
  ActionBar,