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