@expcat/tigercat-vue 2.0.0-rc.2 → 2.0.4

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 (183) hide show
  1. package/dist/{chunk-KE6RGD4Y.mjs → chunk-26OI3TEA.mjs} +25 -55
  2. package/dist/{chunk-H26JXVJX.mjs → chunk-2T2NEZRZ.mjs} +1 -1
  3. package/dist/chunk-4HUYX5WW.mjs +239 -0
  4. package/dist/{chunk-EGIQPUEL.mjs → chunk-5C32WCQY.mjs} +8 -6
  5. package/dist/{chunk-QFG452MD.mjs → chunk-5RXYJWNA.mjs} +53 -28
  6. package/dist/{chunk-IDUEWMWN.mjs → chunk-7KCOF5US.mjs} +61 -62
  7. package/dist/{chunk-RHV6DWY6.mjs → chunk-7VHXZX7Y.mjs} +20 -28
  8. package/dist/{chunk-36TZA5BH.mjs → chunk-A5QYJSHK.mjs} +0 -3
  9. package/dist/{chunk-IZRQ7LB3.mjs → chunk-AU6IC6K7.mjs} +1 -1
  10. package/dist/{chunk-O6BN5R6J.mjs → chunk-AUMTHL6N.mjs} +1 -1
  11. package/dist/{chunk-MNSVJBNH.mjs → chunk-B4MDHE3L.mjs} +18 -4
  12. package/dist/{chunk-7JT5ZIHC.mjs → chunk-BCU7GYF6.mjs} +16 -8
  13. package/dist/{chunk-7CPMXNLK.mjs → chunk-BNYA5IUB.mjs} +26 -2
  14. package/dist/{chunk-N7LWKAYS.mjs → chunk-BZ6MVFV7.mjs} +190 -174
  15. package/dist/{chunk-TK3QU367.mjs → chunk-DI6RRAGQ.mjs} +3 -3
  16. package/dist/{chunk-4ZZYQITT.mjs → chunk-FWO7RNGI.mjs} +249 -220
  17. package/dist/{chunk-SUORTZUY.mjs → chunk-GS4SV2HK.mjs} +48 -20
  18. package/dist/{chunk-EUSODI5E.mjs → chunk-HKYRRQS7.mjs} +11 -5
  19. package/dist/{chunk-D4APFWWS.mjs → chunk-IPGPLFUZ.mjs} +18 -4
  20. package/dist/{chunk-IMFHJEUX.mjs → chunk-JALHMWKW.mjs} +20 -7
  21. package/dist/{chunk-OHPXOLNB.mjs → chunk-K3WTQBE4.mjs} +40 -15
  22. package/dist/{chunk-VMYV5EWI.mjs → chunk-KICZSLOX.mjs} +9 -8
  23. package/dist/{chunk-BNNTDSLJ.mjs → chunk-KROVW4AW.mjs} +19 -60
  24. package/dist/{chunk-AQMPCLX7.mjs → chunk-NMAJD353.mjs} +248 -253
  25. package/dist/{chunk-4BO6JNA6.mjs → chunk-OAPIT53X.mjs} +4 -4
  26. package/dist/{chunk-SYRRMZT2.mjs → chunk-OQVGB7X6.mjs} +43 -29
  27. package/dist/{chunk-DWK5GUMB.mjs → chunk-OTGGPXDT.mjs} +26 -19
  28. package/dist/{chunk-5KPO3EDM.mjs → chunk-OTHJIFDV.mjs} +28 -15
  29. package/dist/{chunk-DWPZRG7A.mjs → chunk-PGF7HLLR.mjs} +43 -39
  30. package/dist/chunk-Q7Y22OFX.mjs +330 -0
  31. package/dist/{chunk-3NQUEQJT.mjs → chunk-RID7A5V7.mjs} +54 -38
  32. package/dist/{chunk-CFH5T3V2.mjs → chunk-S5RTMAQN.mjs} +2 -2
  33. package/dist/{chunk-SJ7W5I5H.mjs → chunk-TCV6YPH5.mjs} +1 -1
  34. package/dist/{chunk-LFENEILY.mjs → chunk-WC5MKASU.mjs} +110 -99
  35. package/dist/{chunk-JZCETBUV.mjs → chunk-WUQMFKQ6.mjs} +29 -16
  36. package/dist/{chunk-GWFVBG22.mjs → chunk-XGXZF27U.mjs} +28 -15
  37. package/dist/{chunk-JVQPU4M2.mjs → chunk-ZGA66PSG.mjs} +28 -15
  38. package/dist/components/ActivityFeed.d.mts +6 -6
  39. package/dist/components/ActivityFeed.mjs +3 -3
  40. package/dist/components/Alert.d.mts +3 -3
  41. package/dist/components/Anchor.d.mts +1 -1
  42. package/dist/components/AreaChart.d.mts +3 -3
  43. package/dist/components/AreaChart.mjs +1 -1
  44. package/dist/components/AutoComplete.d.mts +5 -5
  45. package/dist/components/AutoComplete.mjs +2 -1
  46. package/dist/components/Avatar.d.mts +1 -1
  47. package/dist/components/AvatarGroup.d.mts +2 -2
  48. package/dist/components/BackTop.d.mts +3 -3
  49. package/dist/components/Badge.d.mts +4 -4
  50. package/dist/components/BarChart.d.mts +2 -2
  51. package/dist/components/BarChart.mjs +1 -1
  52. package/dist/components/Breadcrumb.d.mts +3 -3
  53. package/dist/components/Button.d.mts +3 -3
  54. package/dist/components/ButtonGroup.d.mts +1 -1
  55. package/dist/components/Calendar.d.mts +2 -2
  56. package/dist/components/Card.d.mts +2 -2
  57. package/dist/components/Carousel.d.mts +2 -2
  58. package/dist/components/Cascader.d.mts +3 -3
  59. package/dist/components/Cascader.mjs +2 -1
  60. package/dist/components/ChartCanvas.d.mts +1 -1
  61. package/dist/components/ChartGrid.d.mts +1 -1
  62. package/dist/components/ChartLegend.d.mts +1 -1
  63. package/dist/components/ChatWindow.d.mts +4 -4
  64. package/dist/components/CodeEditor.d.mts +3 -3
  65. package/dist/components/Collapse.d.mts +1 -1
  66. package/dist/components/CollapsePanel.d.mts +1 -1
  67. package/dist/components/ColorPicker.mjs +2 -1
  68. package/dist/components/ColorSwatch.d.mts +2 -2
  69. package/dist/components/CommentThread.d.mts +2 -2
  70. package/dist/components/CommentThread.mjs +1 -1
  71. package/dist/components/ConfigProvider.d.mts +1 -1
  72. package/dist/components/Container.d.mts +1 -1
  73. package/dist/components/Countdown.d.mts +2 -2
  74. package/dist/components/CronEditor.d.mts +2 -2
  75. package/dist/components/CropUpload.d.mts +1 -1
  76. package/dist/components/CropUpload.mjs +4 -4
  77. package/dist/components/DataExport.d.mts +2 -2
  78. package/dist/components/DataExport.mjs +3 -3
  79. package/dist/components/DataTableWithToolbar.d.mts +11 -11
  80. package/dist/components/DataTableWithToolbar.mjs +6 -6
  81. package/dist/components/DatePicker.d.mts +3 -3
  82. package/dist/components/DatePicker.mjs +2 -1
  83. package/dist/components/Descriptions.d.mts +2 -2
  84. package/dist/components/DonutChart.d.mts +4 -4
  85. package/dist/components/Drawer.d.mts +6 -6
  86. package/dist/components/Drawer.mjs +2 -2
  87. package/dist/components/Dropdown.d.mts +2 -2
  88. package/dist/components/Dropdown.mjs +2 -2
  89. package/dist/components/Empty.d.mts +1 -1
  90. package/dist/components/FileManager.d.mts +2 -2
  91. package/dist/components/FloatButton.d.mts +5 -5
  92. package/dist/components/Form.d.mts +2 -2
  93. package/dist/components/FormItem.mjs +2 -1
  94. package/dist/components/FormWizard.d.mts +5 -5
  95. package/dist/components/FunnelChart.d.mts +3 -3
  96. package/dist/components/Gantt.d.mts +2 -2
  97. package/dist/components/GaugeChart.d.mts +2 -2
  98. package/dist/components/HeatmapChart.d.mts +3 -3
  99. package/dist/components/Icon.d.mts +2 -2
  100. package/dist/components/Image.d.mts +2 -2
  101. package/dist/components/Image.mjs +3 -3
  102. package/dist/components/ImageAnnotation.d.mts +5 -5
  103. package/dist/components/ImageCropper.d.mts +1 -1
  104. package/dist/components/ImageCropper.mjs +1 -1
  105. package/dist/components/ImageViewer.d.mts +1 -1
  106. package/dist/components/InfiniteScroll.d.mts +3 -3
  107. package/dist/components/InfiniteScroll.mjs +1 -1
  108. package/dist/components/Input.d.mts +4 -4
  109. package/dist/components/InputGroup.d.mts +1 -1
  110. package/dist/components/InputNumber.d.mts +1 -1
  111. package/dist/components/Kanban.d.mts +1 -1
  112. package/dist/components/LineChart.d.mts +2 -2
  113. package/dist/components/LineChart.mjs +1 -1
  114. package/dist/components/Link.d.mts +1 -1
  115. package/dist/components/List.d.mts +7 -7
  116. package/dist/components/Loading.d.mts +6 -6
  117. package/dist/components/Loading.mjs +2 -2
  118. package/dist/components/MarkdownEditor.d.mts +5 -5
  119. package/dist/components/Mentions.d.mts +3 -3
  120. package/dist/components/Mentions.mjs +2 -1
  121. package/dist/components/Menu.d.mts +4 -4
  122. package/dist/components/Menu.mjs +2 -2
  123. package/dist/components/Modal.d.mts +8 -8
  124. package/dist/components/Modal.mjs +2 -2
  125. package/dist/components/NotificationCenter.d.mts +5 -5
  126. package/dist/components/NotificationCenter.mjs +3 -3
  127. package/dist/components/NumberKeyboard.d.mts +5 -5
  128. package/dist/components/OrgChart.d.mts +3 -3
  129. package/dist/components/Pagination.d.mts +5 -5
  130. package/dist/components/PieChart.d.mts +4 -4
  131. package/dist/components/Popconfirm.d.mts +4 -4
  132. package/dist/components/Popconfirm.mjs +3 -3
  133. package/dist/components/Popover.d.mts +3 -3
  134. package/dist/components/Popover.mjs +3 -3
  135. package/dist/components/Progress.d.mts +3 -3
  136. package/dist/components/QRCode.d.mts +3 -3
  137. package/dist/components/RadarChart.d.mts +3 -3
  138. package/dist/components/Rate.d.mts +2 -2
  139. package/dist/components/Result.d.mts +1 -1
  140. package/dist/components/RichTextEditor.d.mts +4 -4
  141. package/dist/components/Row.d.mts +1 -1
  142. package/dist/components/ScatterChart.d.mts +2 -2
  143. package/dist/components/ScatterChart.mjs +1 -1
  144. package/dist/components/ScrollSpy.d.mts +3 -3
  145. package/dist/components/Select.d.mts +3 -3
  146. package/dist/components/Select.mjs +2 -1
  147. package/dist/components/Signature.d.mts +5 -5
  148. package/dist/components/Skeleton.d.mts +1 -1
  149. package/dist/components/Space.d.mts +2 -2
  150. package/dist/components/Splitter.d.mts +1 -1
  151. package/dist/components/Spotlight.d.mts +5 -5
  152. package/dist/components/Spotlight.mjs +2 -2
  153. package/dist/components/Steps.d.mts +3 -3
  154. package/dist/components/SunburstChart.d.mts +2 -2
  155. package/dist/components/Table.d.mts +5 -5
  156. package/dist/components/Table.mjs +3 -2
  157. package/dist/components/Tabs.d.mts +4 -4
  158. package/dist/components/Tag.d.mts +2 -2
  159. package/dist/components/TaskBoard.d.mts +2 -2
  160. package/dist/components/Text.d.mts +3 -3
  161. package/dist/components/Textarea.d.mts +3 -3
  162. package/dist/components/TimePicker.d.mts +4 -4
  163. package/dist/components/TimePicker.mjs +2 -1
  164. package/dist/components/Timeline.d.mts +4 -4
  165. package/dist/components/Tooltip.d.mts +3 -3
  166. package/dist/components/Tooltip.mjs +3 -3
  167. package/dist/components/Tour.d.mts +2 -2
  168. package/dist/components/Tour.mjs +2 -2
  169. package/dist/components/Transfer.d.mts +3 -3
  170. package/dist/components/Tree.d.mts +4 -4
  171. package/dist/components/TreeMapChart.d.mts +2 -2
  172. package/dist/components/TreeSelect.d.mts +3 -3
  173. package/dist/components/TreeSelect.mjs +2 -1
  174. package/dist/components/Upload.d.mts +4 -4
  175. package/dist/components/Upload.mjs +1 -1
  176. package/dist/components/VirtualTable.d.mts +3 -3
  177. package/dist/components/VirtualTable.mjs +1 -1
  178. package/dist/components/Watermark.d.mts +1 -1
  179. package/dist/index.d.mts +1 -1
  180. package/dist/index.mjs +4 -2
  181. package/package.json +2 -2
  182. package/dist/chunk-BDTPFPSB.mjs +0 -163
  183. package/dist/chunk-EWUHEW6W.mjs +0 -219
@@ -1,12 +1,16 @@
1
1
  import {
2
2
  createFilledIcon
3
3
  } from "./chunk-2TNZ4JNT.mjs";
4
+ import {
5
+ renderVueOverlayTeleport,
6
+ useVueAnchoredOverlay
7
+ } from "./chunk-Q7Y22OFX.mjs";
4
8
  import {
5
9
  useTigerConfig
6
10
  } from "./chunk-UOJOJBEU.mjs";
7
11
 
8
12
  // src/components/DatePicker.ts
9
- import { defineComponent, computed, ref, nextTick, h, watch, onBeforeUnmount } from "vue";
13
+ import { defineComponent, computed, ref, nextTick, h, watch } from "vue";
10
14
  import {
11
15
  classNames,
12
16
  coerceClassValue,
@@ -238,6 +242,18 @@ var DatePicker = defineComponent({
238
242
  const mobileCalendarRef = ref(null);
239
243
  const inputWrapperRef = ref(null);
240
244
  const inputRef = ref(null);
245
+ const panelRef = ref(null);
246
+ const overlay = useVueAnchoredOverlay({
247
+ enabled: isOpen,
248
+ referenceRef: inputWrapperRef,
249
+ floatingRef: panelRef,
250
+ placement: "bottom-start",
251
+ offset: 4,
252
+ layout: "bottom-sheet-sm",
253
+ dismissOnOutside: true,
254
+ dismissOnEscape: true,
255
+ onDismiss: closeCalendar
256
+ });
241
257
  const activeDateIso = ref(null);
242
258
  const activeRangePart = ref("start");
243
259
  const pendingFocusIso = ref(null);
@@ -522,17 +538,11 @@ var DatePicker = defineComponent({
522
538
  if (!date) return false;
523
539
  return date.getMonth() === viewingMonth.value;
524
540
  }
525
- function handleClickOutside(event) {
526
- if (inputWrapperRef.value && !calendarRef.value?.contains(event.target) && !mobileCalendarRef.value?.contains(event.target) && !inputWrapperRef.value.contains(event.target)) {
527
- closeCalendar();
528
- }
529
- }
530
541
  function handleInputClick() {
531
542
  toggleCalendar();
532
543
  }
533
544
  watch(isOpen, (newValue) => {
534
545
  if (newValue) {
535
- document.addEventListener("click", handleClickOutside);
536
546
  const preferred = pendingFocusIso.value ?? getPreferredFocusIso();
537
547
  pendingFocusIso.value = null;
538
548
  nextTick().then(() => {
@@ -541,15 +551,11 @@ var DatePicker = defineComponent({
541
551
  if (fallback) focusDateButtonByIso(fallback);
542
552
  });
543
553
  } else {
544
- document.removeEventListener("click", handleClickOutside);
545
554
  nextTick().then(() => {
546
555
  restoreFocus();
547
556
  });
548
557
  }
549
558
  });
550
- onBeforeUnmount(() => {
551
- document.removeEventListener("click", handleClickOutside);
552
- });
553
559
  const rootClass = computed(
554
560
  () => classNames(datePickerBaseClasses, props.className, coerceClassValue(attrs.class))
555
561
  );
@@ -623,232 +629,255 @@ var DatePicker = defineComponent({
623
629
  ]
624
630
  ),
625
631
  // Calendar dropdown
626
- isOpen.value && h(
627
- "div",
628
- {
629
- ref: mobileCalendarRef,
630
- class: datePickerMobileWheelClasses,
631
- role: "group",
632
- "aria-label": labels.value.calendar
633
- },
634
- [
635
- isRangeMode.value ? h("div", { class: "mb-3 flex items-center gap-2" }, [
636
- h(
637
- "button",
638
- {
639
- type: "button",
640
- class: datePickerFooterButtonClasses,
641
- "aria-selected": activeRangePart.value === "start",
642
- onClick: () => activeRangePart.value = "start"
643
- },
644
- "Start"
645
- ),
646
- h(
647
- "button",
648
- {
649
- type: "button",
650
- class: datePickerFooterButtonClasses,
651
- "aria-selected": activeRangePart.value === "end",
652
- onClick: () => activeRangePart.value = "end"
653
- },
654
- "End"
655
- )
656
- ]) : null,
657
- h("div", { class: datePickerMobileWheelGridClasses }, [
658
- h(
659
- "select",
660
- {
661
- class: datePickerMobileWheelSelectClasses,
662
- value: mobileDate.value.getFullYear(),
663
- "aria-label": labels.value.year,
664
- onChange: (event) => updateMobileDate("year", Number(event.target.value))
665
- },
666
- mobileYears.value.map((year) => h("option", { value: year }, year))
667
- ),
668
- h(
669
- "select",
670
- {
671
- class: datePickerMobileWheelSelectClasses,
672
- value: mobileDate.value.getMonth(),
673
- "aria-label": labels.value.month,
674
- onChange: (event) => updateMobileDate("month", Number(event.target.value))
675
- },
676
- Array.from(
677
- { length: 12 },
678
- (_, month) => h("option", { value: month }, month + 1)
679
- )
680
- ),
681
- h(
682
- "select",
683
- {
684
- class: datePickerMobileWheelSelectClasses,
685
- value: mobileDate.value.getDate(),
686
- "aria-label": labels.value.day,
687
- onChange: (event) => updateMobileDate("day", Number(event.target.value))
688
- },
689
- mobileDays.value.map((day) => h("option", { value: day }, day))
690
- )
691
- ]),
692
- h("div", { class: "mt-4 flex justify-end gap-2" }, [
693
- h(
694
- "button",
695
- {
696
- type: "button",
697
- class: datePickerFooterButtonClasses,
698
- "aria-label": `Mobile ${labels.value.ok}`,
699
- onClick: closeCalendar
700
- },
701
- labels.value.ok
702
- )
703
- ])
704
- ]
705
- ),
706
- isOpen.value && h(
707
- "div",
708
- {
709
- ref: calendarRef,
710
- class: datePickerCalendarClasses,
711
- role: "dialog",
712
- "aria-modal": "true",
713
- "aria-label": labels.value.calendar,
714
- onKeydown: handleCalendarKeyDown
715
- },
716
- [
717
- // Calendar header
718
- h("div", { class: datePickerCalendarHeaderClasses }, [
632
+ isOpen.value && renderVueOverlayTeleport(
633
+ h(
634
+ "div",
635
+ {
636
+ ref: panelRef,
637
+ class: overlay.floatingClasses.value,
638
+ style: overlay.floatingStyles.value,
639
+ "data-positioned": overlay.positioned.value
640
+ },
641
+ [
719
642
  h(
720
- "button",
643
+ "div",
721
644
  {
722
- type: "button",
723
- class: datePickerNavButtonClasses,
724
- onClick: previousMonth,
725
- "aria-label": labels.value.previousMonth
645
+ ref: mobileCalendarRef,
646
+ class: datePickerMobileWheelClasses,
647
+ role: "group",
648
+ "aria-label": labels.value.calendar
726
649
  },
727
- previousMonthIcon.value
728
- ),
729
- h(
730
- "div",
731
- { class: datePickerMonthYearClasses },
732
- formatMonthYear(viewingYear.value, viewingMonth.value, localeCode.value)
650
+ [
651
+ isRangeMode.value ? h("div", { class: "mb-3 flex items-center gap-2" }, [
652
+ h(
653
+ "button",
654
+ {
655
+ type: "button",
656
+ class: datePickerFooterButtonClasses,
657
+ "aria-selected": activeRangePart.value === "start",
658
+ onClick: () => activeRangePart.value = "start"
659
+ },
660
+ "Start"
661
+ ),
662
+ h(
663
+ "button",
664
+ {
665
+ type: "button",
666
+ class: datePickerFooterButtonClasses,
667
+ "aria-selected": activeRangePart.value === "end",
668
+ onClick: () => activeRangePart.value = "end"
669
+ },
670
+ "End"
671
+ )
672
+ ]) : null,
673
+ h("div", { class: datePickerMobileWheelGridClasses }, [
674
+ h(
675
+ "select",
676
+ {
677
+ class: datePickerMobileWheelSelectClasses,
678
+ value: mobileDate.value.getFullYear(),
679
+ "aria-label": labels.value.year,
680
+ onChange: (event) => updateMobileDate(
681
+ "year",
682
+ Number(event.target.value)
683
+ )
684
+ },
685
+ mobileYears.value.map((year) => h("option", { value: year }, year))
686
+ ),
687
+ h(
688
+ "select",
689
+ {
690
+ class: datePickerMobileWheelSelectClasses,
691
+ value: mobileDate.value.getMonth(),
692
+ "aria-label": labels.value.month,
693
+ onChange: (event) => updateMobileDate(
694
+ "month",
695
+ Number(event.target.value)
696
+ )
697
+ },
698
+ Array.from(
699
+ { length: 12 },
700
+ (_, month) => h("option", { value: month }, month + 1)
701
+ )
702
+ ),
703
+ h(
704
+ "select",
705
+ {
706
+ class: datePickerMobileWheelSelectClasses,
707
+ value: mobileDate.value.getDate(),
708
+ "aria-label": labels.value.day,
709
+ onChange: (event) => updateMobileDate(
710
+ "day",
711
+ Number(event.target.value)
712
+ )
713
+ },
714
+ mobileDays.value.map((day) => h("option", { value: day }, day))
715
+ )
716
+ ]),
717
+ h("div", { class: "mt-4 flex justify-end gap-2" }, [
718
+ h(
719
+ "button",
720
+ {
721
+ type: "button",
722
+ class: datePickerFooterButtonClasses,
723
+ "aria-label": `Mobile ${labels.value.ok}`,
724
+ onClick: closeCalendar
725
+ },
726
+ labels.value.ok
727
+ )
728
+ ])
729
+ ]
733
730
  ),
734
731
  h(
735
- "button",
736
- {
737
- type: "button",
738
- class: datePickerNavButtonClasses,
739
- onClick: nextMonth,
740
- "aria-label": labels.value.nextMonth
741
- },
742
- nextMonthIcon.value
743
- )
744
- ]),
745
- // Day names header
746
- h("div", { class: datePickerCalendarGridClasses, role: "row" }, [
747
- ...dayNames.value.map(
748
- (day) => h(
749
- "div",
750
- {
751
- class: datePickerDayNameClasses,
752
- key: day,
753
- role: "columnheader"
754
- },
755
- day
756
- )
757
- )
758
- ]),
759
- // Calendar grid
760
- (() => {
761
- return h(
762
732
  "div",
763
733
  {
764
- class: datePickerCalendarGridClasses,
765
- role: "grid",
766
- "aria-rowcount": 6,
767
- "aria-colcount": 7
734
+ ref: calendarRef,
735
+ class: datePickerCalendarClasses,
736
+ role: "dialog",
737
+ "aria-modal": "true",
738
+ "aria-label": labels.value.calendar,
739
+ onKeydown: handleCalendarKeyDown
768
740
  },
769
741
  [
770
- ...calendarDays.value.map((date, index) => {
771
- if (!date) return null;
772
- const cell = getDatePickerCalendarCellState({
773
- date,
774
- selectedDate: selectedDate.value,
775
- selectedRange: selectedRange.value,
776
- isRangeMode: isRangeMode.value,
777
- isCurrentMonth,
778
- isDateDisabled
779
- });
780
- return h(
742
+ // Calendar header
743
+ h("div", { class: datePickerCalendarHeaderClasses }, [
744
+ h(
745
+ "button",
746
+ {
747
+ type: "button",
748
+ class: datePickerNavButtonClasses,
749
+ onClick: previousMonth,
750
+ "aria-label": labels.value.previousMonth
751
+ },
752
+ previousMonthIcon.value
753
+ ),
754
+ h(
755
+ "div",
756
+ { class: datePickerMonthYearClasses },
757
+ formatMonthYear(viewingYear.value, viewingMonth.value, localeCode.value)
758
+ ),
759
+ h(
781
760
  "button",
782
761
  {
783
- key: index,
784
762
  type: "button",
785
- class: getDatePickerDayCellClasses(
786
- cell.isCurrentMonthDay,
787
- cell.isSelected,
788
- cell.isTodayDay,
789
- cell.isDisabled,
790
- cell.isInRange,
791
- cell.isRangeStart,
792
- cell.isRangeEnd
793
- ),
794
- disabled: cell.isDisabled,
795
- onClick: () => selectDate(date),
796
- role: "gridcell",
797
- "data-date": cell.iso,
798
- onFocus: () => {
799
- activeDateIso.value = cell.iso;
763
+ class: datePickerNavButtonClasses,
764
+ onClick: nextMonth,
765
+ "aria-label": labels.value.nextMonth
766
+ },
767
+ nextMonthIcon.value
768
+ )
769
+ ]),
770
+ // Day names header
771
+ h("div", { class: datePickerCalendarGridClasses, role: "row" }, [
772
+ ...dayNames.value.map(
773
+ (day) => h(
774
+ "div",
775
+ {
776
+ class: datePickerDayNameClasses,
777
+ key: day,
778
+ role: "columnheader"
800
779
  },
801
- tabindex: activeDateIso.value === cell.iso && !cell.isDisabled ? 0 : -1,
802
- "aria-label": cell.iso,
803
- "aria-selected": cell.isSelected,
804
- "aria-current": cell.isTodayDay ? "date" : void 0
780
+ day
781
+ )
782
+ )
783
+ ]),
784
+ // Calendar grid
785
+ (() => {
786
+ return h(
787
+ "div",
788
+ {
789
+ class: datePickerCalendarGridClasses,
790
+ role: "grid",
791
+ "aria-rowcount": 6,
792
+ "aria-colcount": 7
805
793
  },
806
- date.getDate()
794
+ [
795
+ ...calendarDays.value.map((date, index) => {
796
+ if (!date) return null;
797
+ const cell = getDatePickerCalendarCellState({
798
+ date,
799
+ selectedDate: selectedDate.value,
800
+ selectedRange: selectedRange.value,
801
+ isRangeMode: isRangeMode.value,
802
+ isCurrentMonth,
803
+ isDateDisabled
804
+ });
805
+ return h(
806
+ "button",
807
+ {
808
+ key: index,
809
+ type: "button",
810
+ class: getDatePickerDayCellClasses(
811
+ cell.isCurrentMonthDay,
812
+ cell.isSelected,
813
+ cell.isTodayDay,
814
+ cell.isDisabled,
815
+ cell.isInRange,
816
+ cell.isRangeStart,
817
+ cell.isRangeEnd
818
+ ),
819
+ disabled: cell.isDisabled,
820
+ onClick: () => selectDate(date),
821
+ role: "gridcell",
822
+ "data-date": cell.iso,
823
+ onFocus: () => {
824
+ activeDateIso.value = cell.iso;
825
+ },
826
+ tabindex: activeDateIso.value === cell.iso && !cell.isDisabled ? 0 : -1,
827
+ "aria-label": cell.iso,
828
+ "aria-selected": cell.isSelected,
829
+ "aria-current": cell.isTodayDay ? "date" : void 0
830
+ },
831
+ date.getDate()
832
+ );
833
+ })
834
+ ]
807
835
  );
808
- })
836
+ })(),
837
+ // Shortcuts panel
838
+ props.shortcuts?.length ? h(
839
+ "div",
840
+ {
841
+ class: "flex flex-wrap gap-1 px-3 py-2 border-t border-[var(--tiger-border,#e5e7eb)]"
842
+ },
843
+ props.shortcuts.map(
844
+ (sc) => h(
845
+ "button",
846
+ {
847
+ type: "button",
848
+ class: datePickerFooterButtonClasses,
849
+ onClick: () => handleShortcut(sc)
850
+ },
851
+ sc.label
852
+ )
853
+ )
854
+ ) : null,
855
+ // Footer (range mode only)
856
+ isRangeMode.value ? h("div", { class: datePickerFooterClasses }, [
857
+ h(
858
+ "button",
859
+ {
860
+ type: "button",
861
+ class: datePickerFooterButtonClasses,
862
+ onClick: setToday
863
+ },
864
+ labels.value.today
865
+ ),
866
+ h(
867
+ "button",
868
+ {
869
+ type: "button",
870
+ class: datePickerFooterButtonClasses,
871
+ onClick: closeCalendar
872
+ },
873
+ labels.value.ok
874
+ )
875
+ ]) : null
809
876
  ]
810
- );
811
- })(),
812
- // Shortcuts panel
813
- props.shortcuts?.length ? h(
814
- "div",
815
- {
816
- class: "flex flex-wrap gap-1 px-3 py-2 border-t border-[var(--tiger-border,#e5e7eb)]"
817
- },
818
- props.shortcuts.map(
819
- (sc) => h(
820
- "button",
821
- {
822
- type: "button",
823
- class: datePickerFooterButtonClasses,
824
- onClick: () => handleShortcut(sc)
825
- },
826
- sc.label
827
- )
828
- )
829
- ) : null,
830
- // Footer (range mode only)
831
- isRangeMode.value ? h("div", { class: datePickerFooterClasses }, [
832
- h(
833
- "button",
834
- {
835
- type: "button",
836
- class: datePickerFooterButtonClasses,
837
- onClick: setToday
838
- },
839
- labels.value.today
840
- ),
841
- h(
842
- "button",
843
- {
844
- type: "button",
845
- class: datePickerFooterButtonClasses,
846
- onClick: closeCalendar
847
- },
848
- labels.value.ok
849
877
  )
850
- ]) : null
851
- ]
878
+ ]
879
+ ),
880
+ overlay.target.value
852
881
  )
853
882
  ]
854
883
  );