hys-ui 0.1.1 → 0.2.0

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 (225) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/README.md +3 -1
  3. package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
  4. package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
  5. package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
  6. package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +627 -0
  7. package/dist/components/HysAvatar/HysAvatar.vue.js +5 -35
  8. package/dist/components/HysAvatar/HysAvatar2.vue.js +221 -2
  9. package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +7 -0
  10. package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +252 -0
  11. package/dist/components/HysBadge/HysBadge.vue.js +2 -2
  12. package/dist/components/HysBadge/HysBadge2.vue.js +154 -27
  13. package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
  14. package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +74 -2
  15. package/dist/components/HysButton/HysButton.vue.js +2 -2
  16. package/dist/components/HysButton/HysButton2.vue.js +29 -28
  17. package/dist/components/HysCalendar/HysCalendar.vue.js +5 -92
  18. package/dist/components/HysCalendar/HysCalendar2.vue.js +803 -2
  19. package/dist/components/HysCard/HysCard.vue.js +2 -2
  20. package/dist/components/HysCard/HysCard2.vue.js +175 -42
  21. package/dist/components/HysCascader/HysCascader.vue.js +5 -194
  22. package/dist/components/HysCascader/HysCascader2.vue.js +760 -2
  23. package/dist/components/HysCascader/HysCascaderColumn.vue.js +7 -0
  24. package/dist/components/HysCascader/HysCascaderColumn2.vue.js +232 -0
  25. package/dist/components/HysCheckbox/HysCheckbox.vue.js +3 -3
  26. package/dist/components/HysCheckbox/HysCheckbox2.vue.js +180 -65
  27. package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
  28. package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
  29. package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
  30. package/dist/components/HysColorPicker/HysColorPicker2.vue.js +107 -106
  31. package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
  32. package/dist/components/HysDataGrid/HysDataGrid2.vue.js +399 -392
  33. package/dist/components/HysDatePicker/HysDatePicker.vue.js +268 -139
  34. package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
  35. package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +807 -0
  36. package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +7 -0
  37. package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +357 -0
  38. package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +268 -158
  39. package/dist/components/HysDivider/HysDivider.vue.js +2 -2
  40. package/dist/components/HysDivider/HysDivider2.vue.js +33 -13
  41. package/dist/components/HysFileManager/HysFileManager.vue.js +3 -3
  42. package/dist/components/HysFileManager/HysFileManager2.vue.js +43 -42
  43. package/dist/components/HysForm/HysForm.vue.js +3 -3
  44. package/dist/components/HysForm/HysForm2.vue.js +578 -92
  45. package/dist/components/HysFormItem/HysFormItem.vue.js +5 -85
  46. package/dist/components/HysFormItem/HysFormItem2.vue.js +521 -2
  47. package/dist/components/HysGantt/HysGantt.vue.js +1 -1
  48. package/dist/components/HysGantt/HysGantt2.vue.js +1369 -272
  49. package/dist/components/HysInput/HysInput.vue.js +2 -2
  50. package/dist/components/HysInput/HysInput2.vue.js +467 -120
  51. package/dist/components/HysMention/HysMention.vue.js +2 -2
  52. package/dist/components/HysMention/HysMention2.vue.js +89 -88
  53. package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
  54. package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -79
  55. package/dist/components/HysOrgTree/HysOrgTree.vue.js +29 -26
  56. package/dist/components/HysPagination/HysPagination.vue.js +1 -1
  57. package/dist/components/HysPagination/HysPagination2.vue.js +2 -0
  58. package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +2 -2
  59. package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +52 -51
  60. package/dist/components/HysRadio/HysRadio.vue.js +7 -0
  61. package/dist/components/HysRadio/HysRadio2.vue.js +180 -0
  62. package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +2 -2
  63. package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +190 -65
  64. package/dist/components/HysRating/HysRating.vue.js +1 -1
  65. package/dist/components/HysRating/HysRating2.vue.js +288 -68
  66. package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +1 -1
  67. package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +70 -69
  68. package/dist/components/HysSearch/HysSearch.vue.js +37 -36
  69. package/dist/components/HysSegmented/HysSegmented.vue.js +5 -63
  70. package/dist/components/HysSegmented/HysSegmented2.vue.js +273 -2
  71. package/dist/components/HysSelect/HysSelect.vue.js +3 -2
  72. package/dist/components/HysSelect/HysSelect2.vue.js +859 -185
  73. package/dist/components/HysSkeleton/HysSkeleton.vue.js +2 -2
  74. package/dist/components/HysSkeleton/HysSkeleton2.vue.js +126 -29
  75. package/dist/components/HysSlider/HysSlider.vue.js +2 -2
  76. package/dist/components/HysSlider/HysSlider2.vue.js +532 -59
  77. package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
  78. package/dist/components/HysSlider/SliderTooltip2.vue.js +156 -0
  79. package/dist/components/HysSteps/HysSteps.vue.js +1 -1
  80. package/dist/components/HysSteps/HysSteps2.vue.js +110 -36
  81. package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
  82. package/dist/components/HysSwitch/HysSwitch2.vue.js +232 -50
  83. package/dist/components/HysTable/HysTable.vue.js +2 -2
  84. package/dist/components/HysTable/HysTable2.vue.js +1473 -88
  85. package/dist/components/HysTable/HysTableFilterOptions.vue.js +7 -0
  86. package/dist/components/HysTable/HysTableFilterOptions2.vue.js +133 -0
  87. package/dist/components/HysTabs/HysTabs.vue.js +2 -2
  88. package/dist/components/HysTabs/HysTabs2.vue.js +262 -68
  89. package/dist/components/HysTagInput/HysTagInput.vue.js +43 -42
  90. package/dist/components/HysTextarea/HysTextarea.vue.js +138 -77
  91. package/dist/components/HysTransfer/HysTransfer.vue.js +5 -223
  92. package/dist/components/HysTransfer/HysTransfer2.vue.js +416 -2
  93. package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
  94. package/dist/components/HysTransfer/HysTransferPanel2.vue.js +454 -0
  95. package/dist/components/HysTree/HysTree.vue.js +2 -3
  96. package/dist/components/HysTree/HysTree2.vue.js +641 -302
  97. package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -136
  98. package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +558 -2
  99. package/dist/components/HysTreeSelect/HysTreeSelectPanel.vue.js +7 -0
  100. package/dist/components/HysTreeSelect/HysTreeSelectPanel2.vue.js +323 -0
  101. package/dist/components/HysUpload/HysUpload.vue.js +2 -2
  102. package/dist/components/HysUpload/HysUpload2.vue.js +77 -76
  103. package/dist/composables/autocomplete.js +50 -0
  104. package/dist/composables/avatar.js +57 -0
  105. package/dist/composables/calendar.js +96 -0
  106. package/dist/composables/cascader.js +79 -0
  107. package/dist/composables/choice.js +38 -0
  108. package/dist/composables/choiceModel.js +67 -0
  109. package/dist/composables/datePicker.js +227 -0
  110. package/dist/composables/formContext.js +92 -7
  111. package/dist/composables/formLayout.js +57 -0
  112. package/dist/composables/formValidation.js +240 -0
  113. package/dist/composables/ganttConflicts.js +143 -0
  114. package/dist/composables/numberInput.js +91 -0
  115. package/dist/composables/rating.js +16 -0
  116. package/dist/composables/selectOptions.js +54 -0
  117. package/dist/composables/table.js +150 -0
  118. package/dist/composables/textInput.js +34 -0
  119. package/dist/composables/transfer.js +63 -0
  120. package/dist/composables/tree.js +118 -0
  121. package/dist/composables/treeSelect.js +71 -0
  122. package/dist/composables/useCascader.js +438 -0
  123. package/dist/composables/useDatePicker.js +425 -0
  124. package/dist/composables/useFloating.js +97 -51
  125. package/dist/composables/useGanttDependencies.js +306 -0
  126. package/dist/composables/useGanttHistory.js +157 -0
  127. package/dist/composables/useGanttLabelResize.js +100 -0
  128. package/dist/composables/useTable.js +474 -0
  129. package/dist/composables/useTextareaSize.js +72 -0
  130. package/dist/composables/useTransfer.js +257 -0
  131. package/dist/composables/useTree.js +439 -0
  132. package/dist/composables/useTreeSelect.js +361 -0
  133. package/dist/index.js +149 -139
  134. package/dist/style.css +1 -1
  135. package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
  136. package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +201 -0
  137. package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +28 -15
  138. package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +99 -0
  139. package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
  140. package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +38 -10
  141. package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
  142. package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +119 -31
  143. package/dist/types/components/HysCard/HysCard.vue.d.ts +55 -7
  144. package/dist/types/components/HysCascader/HysCascader.vue.d.ts +129 -41
  145. package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +55 -0
  146. package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +50 -39
  147. package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
  148. package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +1 -1
  149. package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +66 -14
  150. package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +90 -0
  151. package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +93 -0
  152. package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +66 -14
  153. package/dist/types/components/HysDivider/HysDivider.vue.d.ts +8 -3
  154. package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +2 -2
  155. package/dist/types/components/HysForm/HysForm.vue.d.ts +110 -18
  156. package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +108 -2
  157. package/dist/types/components/HysGantt/HysGantt.vue.d.ts +82 -4
  158. package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
  159. package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -2
  160. package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -35
  161. package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +1 -0
  162. package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
  163. package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +2 -2
  164. package/dist/types/components/HysPopover/HysPopover.vue.d.ts +3 -3
  165. package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
  166. package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
  167. package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +34 -12
  168. package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
  169. package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +4 -4
  170. package/dist/types/components/HysSearch/HysSearch.vue.d.ts +2 -2
  171. package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +64 -32
  172. package/dist/types/components/HysSelect/HysSelect.vue.d.ts +120 -20
  173. package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
  174. package/dist/types/components/HysSlider/HysSlider.vue.d.ts +66 -9
  175. package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +22 -0
  176. package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +1 -1
  177. package/dist/types/components/HysSteps/HysSteps.vue.d.ts +64 -9
  178. package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +76 -17
  179. package/dist/types/components/HysTable/HysTable.vue.d.ts +206 -32
  180. package/dist/types/components/HysTable/HysTableFilterOptions.vue.d.ts +18 -0
  181. package/dist/types/components/HysTabs/HysTabs.vue.d.ts +76 -23
  182. package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +5 -5
  183. package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
  184. package/dist/types/components/HysToast/HysToast.vue.d.ts +3 -3
  185. package/dist/types/components/HysTour/HysTour.vue.d.ts +2 -2
  186. package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -40
  187. package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +105 -0
  188. package/dist/types/components/HysTree/HysTree.vue.d.ts +140 -73
  189. package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +102 -23
  190. package/dist/types/components/HysTreeSelect/HysTreeSelectPanel.vue.d.ts +56 -0
  191. package/dist/types/composables/autocomplete.d.ts +106 -0
  192. package/dist/types/composables/avatar.d.ts +70 -0
  193. package/dist/types/composables/calendar.d.ts +66 -0
  194. package/dist/types/composables/cascader.d.ts +192 -0
  195. package/dist/types/composables/choice.d.ts +110 -0
  196. package/dist/types/composables/choiceModel.d.ts +11 -0
  197. package/dist/types/composables/datePicker.d.ts +247 -0
  198. package/dist/types/composables/formContext.d.ts +133 -8
  199. package/dist/types/composables/formLayout.d.ts +11 -0
  200. package/dist/types/composables/formValidation.d.ts +13 -0
  201. package/dist/types/composables/gantt.d.ts +68 -0
  202. package/dist/types/composables/ganttConflicts.d.ts +30 -0
  203. package/dist/types/composables/numberInput.d.ts +45 -0
  204. package/dist/types/composables/rating.d.ts +18 -0
  205. package/dist/types/composables/segmented.d.ts +15 -0
  206. package/dist/types/composables/selectOptions.d.ts +44 -0
  207. package/dist/types/composables/slider.d.ts +21 -0
  208. package/dist/types/composables/table.d.ts +309 -0
  209. package/dist/types/composables/textInput.d.ts +76 -0
  210. package/dist/types/composables/transfer.d.ts +180 -0
  211. package/dist/types/composables/tree.d.ts +237 -0
  212. package/dist/types/composables/treeSelect.d.ts +167 -0
  213. package/dist/types/composables/useCascader.d.ts +162 -0
  214. package/dist/types/composables/useDatePicker.d.ts +79 -0
  215. package/dist/types/composables/useFloating.d.ts +8 -5
  216. package/dist/types/composables/useGanttDependencies.d.ts +83 -0
  217. package/dist/types/composables/useGanttHistory.d.ts +42 -0
  218. package/dist/types/composables/useGanttLabelResize.d.ts +23 -0
  219. package/dist/types/composables/useTable.d.ts +60 -0
  220. package/dist/types/composables/useTextareaSize.d.ts +3 -0
  221. package/dist/types/composables/useTransfer.d.ts +58 -0
  222. package/dist/types/composables/useTree.d.ts +77 -0
  223. package/dist/types/composables/useTreeSelect.d.ts +117 -0
  224. package/dist/types/index.d.ts +33 -7
  225. package/package.json +2 -1
@@ -1,4 +1,805 @@
1
- import f from "./HysCalendar.vue.js";
1
+ import { defineComponent as ua, ref as B, useId as ia, computed as u, watch as ae, onDeactivated as da, openBlock as r, createElementBlock as i, mergeProps as Le, unref as g, renderSlot as T, createElementVNode as C, toDisplayString as p, Fragment as W, createVNode as S, createBlock as Y, createCommentVNode as b, withCtx as K, createTextVNode as le, normalizeStyle as pe, Transition as ca, normalizeClass as ie, renderList as P, withModifiers as de, Teleport as va, nextTick as ge } from "vue";
2
+ import { ChevronsLeft as ya, ChevronLeft as ma, ChevronRight as ha, ChevronsRight as fa, LoaderCircle as ba, X as ka } from "lucide-vue-next";
3
+ import q from "../HysButton/HysButton.vue.js";
4
+ import Ee from "../HysSelect/HysSelect.vue.js";
5
+ import pa from "../HysSegmented/HysSegmented.vue.js";
6
+ import { useHysRootAttrs as ga } from "../../config.js";
7
+ import { useMotion as wa } from "../../motion/useMotion.js";
8
+ import { useFloating as Ca } from "../../composables/useFloating.js";
9
+ import { calendarDay as _e, civilDay as f, calendarParts as k, calendarWeeks as Da, calendarISO as U, calendarEvents as xa, calendarWeek as Ma, calendarDate as we, calendarFormat as $a, calendarShift as R } from "../../composables/calendar.js";
10
+ const Ta = ["aria-busy", "aria-label"], Sa = {
11
+ key: 0,
12
+ class: "hys-ui-calendar-header"
13
+ }, Va = {
14
+ class: "hys-ui-calendar-title",
15
+ "aria-live": "polite"
16
+ }, za = {
17
+ key: 0,
18
+ class: "hys-ui-calendar-controls"
19
+ }, Aa = { class: "hys-ui-calendar-navigation" }, Na = {
20
+ key: 0,
21
+ class: "hys-ui-calendar-loading",
22
+ role: "status"
23
+ }, Ba = ["data-calendar-panel"], Fa = ["aria-label", "aria-readonly"], Wa = {
24
+ key: 0,
25
+ role: "columnheader"
26
+ }, Ra = {
27
+ key: 0,
28
+ role: "rowheader",
29
+ class: "hys-ui-calendar-week-number"
30
+ }, La = ["data-date", "aria-selected", "aria-current", "aria-disabled", "aria-label", "tabindex", "onFocus", "onKeydown", "onClick"], Ea = { class: "hys-ui-calendar-day-heading" }, _a = ["disabled", "aria-pressed", "aria-readonly", "onClick"], Ha = {
31
+ key: 0,
32
+ class: "hys-ui-calendar-events"
33
+ }, Ka = ["tabindex", "disabled", "title", "onClick"], Pa = { key: 0 }, Ua = ["tabindex", "disabled", "aria-expanded", "onClick"], Oa = ["aria-label", "aria-readonly"], Ia = ["data-month", "aria-selected", "aria-disabled", "tabindex", "onFocus", "onKeydown", "onClick"], ja = ["disabled", "aria-pressed", "onClick"], Ya = {
34
+ key: 0,
35
+ class: "hys-ui-calendar-month-count"
36
+ }, qa = {
37
+ key: 1,
38
+ class: "hys-ui-calendar-footer"
39
+ }, Xa = ["id", "aria-label"], Za = { class: "hys-ui-calendar-popup-events" }, Ga = ["disabled", "onClick"], Ja = { key: 0 }, Qa = { key: 0 }, il = /* @__PURE__ */ ua({
40
+ __name: "HysCalendar",
41
+ props: {
42
+ modelValue: {},
43
+ defaultValue: {},
44
+ valueType: {},
45
+ valueFormat: { default: "YYYY-MM-DD" },
46
+ mode: {},
47
+ defaultMode: { default: "month" },
48
+ fullscreen: { type: Boolean, default: !0 },
49
+ transition: { default: "slide" },
50
+ transitionDuration: { default: 180 },
51
+ controllerType: { default: "button" },
52
+ formatter: {},
53
+ showModeSwitch: { type: Boolean, default: !0 },
54
+ showHeader: { type: Boolean, default: !0 },
55
+ showToday: { type: Boolean, default: !0 },
56
+ firstDayOfWeek: { default: 1 },
57
+ locale: { default: "zh-CN" },
58
+ range: {},
59
+ validRange: {},
60
+ disabled: { type: Boolean },
61
+ readonly: { type: Boolean },
62
+ disabledDate: {},
63
+ showAdjacentDays: { type: Boolean, default: !0 },
64
+ fixedWeeks: { type: Boolean, default: !1 },
65
+ showWeekNumbers: { type: Boolean, default: !1 },
66
+ keyboard: { type: Boolean, default: !0 },
67
+ loading: { type: Boolean },
68
+ events: {},
69
+ maxEvents: { default: 3 },
70
+ ariaLabel: {}
71
+ },
72
+ emits: ["update:modelValue", "update:mode", "change", "select", "panelChange", "event", "more"],
73
+ setup(m, { expose: He, emit: Ke }) {
74
+ const o = m, F = Ke, Ce = ga(), te = B(), Pe = ia(), O = _e(/* @__PURE__ */ new Date()), X = f(1, 0, 1), Z = f(9999, 11, 31), V = (e) => _e(e, o.valueFormat), x = (e) => {
75
+ const [a, l, t] = e.split("-").map(Number);
76
+ return f(a, l - 1, t);
77
+ }, ce = V(o.modelValue ?? o.defaultValue) ?? O, De = B(ce), D = B(ce), N = B(ce), xe = B(o.defaultMode), z = u(
78
+ () => o.modelValue === void 0 ? De.value : V(o.modelValue)
79
+ ), c = u(
80
+ () => o.range ? "month" : o.mode ?? xe.value
81
+ ), d = u(() => k(D.value)), ne = u(
82
+ () => Number.isInteger(o.firstDayOfWeek) ? (o.firstDayOfWeek % 7 + 7) % 7 : 1
83
+ ), v = u(() => o.disabled || o.loading), I = u(() => o.locale.toLowerCase().startsWith("zh")), y = u(
84
+ () => I.value ? {
85
+ today: "今天",
86
+ month: "月",
87
+ year: "年",
88
+ previous: "上一",
89
+ next: "下一",
90
+ more: "更多日程",
91
+ close: "关闭",
92
+ loading: "加载中",
93
+ week: "周",
94
+ label: "日历"
95
+ } : {
96
+ today: "Today",
97
+ month: "Month",
98
+ year: "Year",
99
+ previous: "Previous ",
100
+ next: "Next ",
101
+ more: "More events",
102
+ close: "Close",
103
+ loading: "Loading",
104
+ week: "Wk",
105
+ label: "Calendar"
106
+ }
107
+ );
108
+ function oe(e) {
109
+ try {
110
+ return new Intl.DateTimeFormat(o.locale, {
111
+ ...e,
112
+ timeZone: "UTC"
113
+ });
114
+ } catch {
115
+ return new Intl.DateTimeFormat("zh-CN", { ...e, timeZone: "UTC" });
116
+ }
117
+ }
118
+ const Me = u(() => oe({ month: "long" })), Ue = u(
119
+ () => oe({ year: "numeric", month: "long", day: "numeric", weekday: "long" })
120
+ ), Oe = u(() => {
121
+ const e = oe({ weekday: "short" });
122
+ return Array.from(
123
+ { length: 7 },
124
+ (a, l) => e.format(
125
+ new Date((f(2024, 0, 7) + (ne.value + l) % 7) * 864e5)
126
+ )
127
+ );
128
+ });
129
+ function A(e) {
130
+ return o.valueType === "date" || o.valueType === void 0 && (o.modelValue instanceof Date || o.defaultValue instanceof Date) ? we(e) : $a(e, o.valueFormat);
131
+ }
132
+ const re = u(() => {
133
+ if (!o.validRange) return [X, Z];
134
+ const e = V(o.validRange[0]), a = V(o.validRange[1]);
135
+ return e !== void 0 && a !== void 0 && e <= a ? [e, a] : [1, 0];
136
+ }), w = u(() => {
137
+ if (!o.range) return;
138
+ const e = V(o.range[0]), a = V(o.range[1]);
139
+ if (e === void 0 || a === void 0 || e > a) return;
140
+ const l = k(e), t = k(a);
141
+ if (!((t.year - l.year) * 12 + t.month - l.month > 1))
142
+ return [e, a];
143
+ }), $ = u(() => {
144
+ const e = d.value;
145
+ if (c.value === "year")
146
+ return [f(e.year, 0, 1), f(e.year, 11, 31)];
147
+ const [a, l] = w.value ?? [
148
+ f(e.year, e.month, 1),
149
+ f(e.year, e.month + 1, 0)
150
+ ], [t, n] = Da(a, l, ne.value);
151
+ return [t, o.fixedWeeks && !w.value ? t + 41 : n];
152
+ }), ve = u(() => [
153
+ U($.value[0]),
154
+ U($.value[1])
155
+ ]), { effectiveMotion: Ie } = wa(), $e = B("next"), Te = u(
156
+ () => d.value.year * 12 + (c.value === "year" ? 0 : d.value.month)
157
+ ), ye = u(
158
+ () => w.value ? "range:" + ve.value.join(":") : c.value + ":" + Te.value
159
+ );
160
+ ae(
161
+ Te,
162
+ (e, a) => $e.value = e >= a ? "next" : "prev",
163
+ { flush: "sync" }
164
+ );
165
+ const Se = u(
166
+ () => Math.max(
167
+ 0,
168
+ Math.min(
169
+ 800,
170
+ Number.isFinite(o.transitionDuration) ? o.transitionDuration : 180
171
+ )
172
+ )
173
+ ), je = u(
174
+ () => o.transition !== "none" && Se.value > 0 && Ie.value !== "off"
175
+ ), Ye = u(
176
+ () => "hys-ui-calendar-" + o.transition + (["slide", "slide-up"].includes(o.transition) ? "-" + $e.value : "")
177
+ );
178
+ function qe(e) {
179
+ e.setAttribute("aria-hidden", "true"), e.inert = !0;
180
+ }
181
+ const Ve = u(
182
+ () => xa(o.events ?? [], ...$.value)
183
+ );
184
+ function L(e) {
185
+ var t;
186
+ const [a, l] = re.value;
187
+ return e < X || e > Z || e < a || e > l || !!((t = o.disabledDate) != null && t.call(o, U(e))) || !!w.value && (e < w.value[0] || e > w.value[1]);
188
+ }
189
+ function ze(e) {
190
+ const a = k(e), l = a.year * 12 + a.month, t = d.value.year * 12 + d.value.month;
191
+ return {
192
+ day: U(e),
193
+ date: we(e),
194
+ type: l < t ? "prev-month" : l > t ? "next-month" : "current-month",
195
+ isSelected: z.value === e,
196
+ isToday: O === e,
197
+ disabled: !!v.value || L(e),
198
+ events: Ve.value.dates.get(e) ?? []
199
+ };
200
+ }
201
+ const me = u(
202
+ () => Array.from(
203
+ { length: $.value[1] - $.value[0] + 1 },
204
+ (e, a) => ze($.value[0] + a)
205
+ )
206
+ ), Xe = u(
207
+ () => Array.from({ length: me.value.length / 7 }, (e, a) => ({
208
+ number: Ma($.value[0] + a * 7),
209
+ days: me.value.slice(a * 7, a * 7 + 7)
210
+ }))
211
+ );
212
+ function Ze(e) {
213
+ const a = f(d.value.year, e, 1), l = f(d.value.year, e + 1, 0);
214
+ for (let t = a; t <= l; t++) if (!L(t)) return !1;
215
+ return !0;
216
+ }
217
+ const G = u(
218
+ () => Array.from({ length: 12 }, (e, a) => {
219
+ const l = f(d.value.year, a, 1), t = z.value === void 0 ? void 0 : k(z.value);
220
+ return {
221
+ month: a + 1,
222
+ date: we(l),
223
+ day: U(l),
224
+ isSelected: (t == null ? void 0 : t.year) === d.value.year && t.month === a,
225
+ isToday: k(O).year === d.value.year && k(O).month === a,
226
+ disabled: !!v.value || Ze(a),
227
+ events: Ve.value.months.get(d.value.year * 12 + a) ?? []
228
+ };
229
+ })
230
+ ), se = u(
231
+ () => w.value ? `${U(w.value[0])} — ${U(w.value[1])}` : c.value === "year" ? `${d.value.year}${I.value ? "年" : ""}` : I.value ? `${d.value.year}年${d.value.month + 1}月` : oe({ year: "numeric", month: "long" }).format(
232
+ new Date(D.value * 864e5)
233
+ )
234
+ ), Ge = u(() => {
235
+ const e = d.value.year, a = Math.max(1, e - 100), l = Math.min(9999, e + 100);
236
+ return Array.from({ length: l - a + 1 }, (t, n) => {
237
+ var s;
238
+ return {
239
+ label: ((s = o.formatter) == null ? void 0 : s.call(o, a + n, "year")) ?? `${a + n}${I.value ? "年" : ""}`,
240
+ value: a + n
241
+ };
242
+ });
243
+ }), Je = u(
244
+ () => Array.from({ length: 12 }, (e, a) => {
245
+ var l;
246
+ return {
247
+ label: ((l = o.formatter) == null ? void 0 : l.call(o, a + 1, "month")) ?? Me.value.format(new Date(f(2024, a, 1) * 864e5)),
248
+ value: a
249
+ };
250
+ })
251
+ ), he = u(() => {
252
+ var a, l, t, n;
253
+ const e = me.value.filter(
254
+ (s) => !s.disabled && (o.showAdjacentDays || s.type === "current-month" || w.value)
255
+ );
256
+ return ((a = e.find((s) => V(s.day) === N.value)) == null ? void 0 : a.day) ?? ((l = e.find((s) => s.isSelected)) == null ? void 0 : l.day) ?? ((t = e.find((s) => s.type === "current-month")) == null ? void 0 : t.day) ?? ((n = e[0]) == null ? void 0 : n.day);
257
+ }), Qe = u(() => {
258
+ var a, l, t;
259
+ const e = k(N.value).month + 1;
260
+ return ((a = G.value.find((n) => n.month === e && !n.disabled)) == null ? void 0 : a.month) ?? ((l = G.value.find((n) => n.isSelected && !n.disabled)) == null ? void 0 : l.month) ?? ((t = G.value.find((n) => !n.disabled)) == null ? void 0 : t.month);
261
+ }), ue = u(
262
+ () => Math.min(
263
+ 100,
264
+ Math.max(
265
+ 0,
266
+ Math.floor(Number.isFinite(o.maxEvents) ? o.maxEvents : 3)
267
+ )
268
+ )
269
+ ), Ae = B(), fe = B(), M = B(), { open: Ne, style: ea, show: aa, close: la } = Ca(Ae, fe, {
270
+ placement: "bottom-start",
271
+ width: () => 320,
272
+ closeOnTab: !0
273
+ });
274
+ function E() {
275
+ la(), M.value = void 0;
276
+ }
277
+ ae([() => o.modelValue, () => o.valueFormat], () => {
278
+ const e = V(o.modelValue);
279
+ e !== void 0 && (D.value = e, N.value = e), E();
280
+ }), ae(
281
+ [
282
+ () => o.mode,
283
+ () => o.range,
284
+ () => o.validRange,
285
+ v,
286
+ () => o.readonly
287
+ ],
288
+ E
289
+ ), ae(
290
+ () => o.events,
291
+ () => {
292
+ M.value && (M.value = ze(x(M.value.day)));
293
+ },
294
+ { deep: !0 }
295
+ ), da(E);
296
+ function _(e, a = c.value) {
297
+ const l = k(e), t = f(l.year, a === "year" ? 0 : l.month, 1), n = f(l.year, a === "year" ? 12 : l.month + 1, 0), [s, h] = re.value;
298
+ return e >= X && e <= Z && n >= s && t <= h;
299
+ }
300
+ ae(
301
+ [re, () => o.modelValue],
302
+ () => {
303
+ const [e, a] = re.value;
304
+ e <= a && !_(D.value) && (D.value = Math.max(e, Math.min(a, D.value)), N.value = D.value, E());
305
+ },
306
+ { immediate: !0 }
307
+ );
308
+ function j(e) {
309
+ if (v.value || w.value || !_(e)) return !1;
310
+ const a = k(D.value), l = k(e);
311
+ return D.value = e, N.value = e, E(), (a.year !== l.year || a.month !== l.month) && F("panelChange", A(e), c.value), !0;
312
+ }
313
+ function Be(e) {
314
+ const a = V(e);
315
+ return a === void 0 ? !1 : j(a);
316
+ }
317
+ function J(e) {
318
+ return e === "today" ? O : R(
319
+ D.value,
320
+ e === "prev-month" ? -1 : e === "next-month" ? 1 : e === "prev-year" ? -12 : 12
321
+ );
322
+ }
323
+ function H(e) {
324
+ return j(J(e));
325
+ }
326
+ function be(e) {
327
+ return v.value || w.value || !["month", "year"].includes(e) ? !1 : (e === c.value || (o.mode === void 0 && (xe.value = e), F("update:mode", e), F("panelChange", A(D.value), e), E()), !0);
328
+ }
329
+ async function Q(e, a = "date") {
330
+ if (v.value || o.readonly || L(e)) return !1;
331
+ const l = A(e), t = z.value;
332
+ return o.modelValue === void 0 && (De.value = e), F("update:modelValue", l), F("select", A(e), { source: a }), t !== e && F("change", A(e)), o.range || j(e), N.value = e, await ge(), z.value === e;
333
+ }
334
+ function ta(e) {
335
+ const a = V(e);
336
+ return a === void 0 ? Promise.resolve(!1) : Q(a, "customize");
337
+ }
338
+ function ke(e) {
339
+ if (v.value || e.disabled) return;
340
+ const a = x(e.day), l = f(d.value.year, e.month, 0), t = z.value ?? a, n = k(t);
341
+ let s = Math.max(
342
+ a,
343
+ Math.min(
344
+ l,
345
+ R(
346
+ t,
347
+ (d.value.year - n.year) * 12 + e.month - 1 - n.month
348
+ )
349
+ )
350
+ );
351
+ if (L(s))
352
+ for (s = a; s <= l && L(s); ) s++;
353
+ Q(s, "month");
354
+ }
355
+ function Fe(e, a) {
356
+ !v.value && !e.disabled && F("event", e.id, e, a);
357
+ }
358
+ async function na(e, a) {
359
+ var l, t;
360
+ v.value || (Ae.value = a.currentTarget, M.value = e, F("more", e.day, e.events), aa(), await ge(), (t = (l = fe.value) == null ? void 0 : l.querySelector("button")) == null || t.focus());
361
+ }
362
+ function oa(e, a) {
363
+ a.target.closest(
364
+ 'button,a,input,select,textarea,[contenteditable="true"],[role="button"]'
365
+ ) || Q(e);
366
+ }
367
+ async function We() {
368
+ var e, a, l;
369
+ await ge(), (l = (a = Array.from(
370
+ ((e = te.value) == null ? void 0 : e.querySelectorAll(".hys-ui-calendar-page")) ?? []
371
+ ).find((t) => t.dataset.calendarPanel === ye.value)) == null ? void 0 : a.querySelector('[role="gridcell"][tabindex="0"]')) == null || l.focus();
372
+ }
373
+ async function Re(e, a, l = !1) {
374
+ if (!o.keyboard || v.value || e.altKey || e.ctrlKey || e.metaKey || e.target !== e.currentTarget && !e.target.classList.contains("hys-ui-calendar-day"))
375
+ return;
376
+ let t;
377
+ const n = getComputedStyle(te.value).direction === "rtl" ? -1 : 1;
378
+ if (e.key === "Enter" || e.key === " ") {
379
+ e.preventDefault(), l ? ke(G.value[k(a).month]) : await Q(a, "keyboard");
380
+ return;
381
+ }
382
+ if (e.key === "ArrowLeft" && (t = l ? R(a, -n) : a - n), e.key === "ArrowRight" && (t = l ? R(a, n) : a + n), e.key === "ArrowUp" && (t = l ? R(a, -3) : a - 7), e.key === "ArrowDown" && (t = l ? R(a, 3) : a + 7), e.key === "Home" && (t = l ? f(d.value.year, 0, 1) : a - (k(a).weekday - ne.value + 7) % 7), e.key === "End" && (t = l ? f(d.value.year, 11, 1) : a + (ne.value + 6 - k(a).weekday + 7) % 7), (e.key === "PageUp" || e.key === "PageDown") && (t = R(
383
+ a,
384
+ (e.key === "PageUp" ? -1 : 1) * (e.shiftKey || l ? 12 : 1)
385
+ )), t === void 0 || (e.preventDefault(), t < X || t > Z || o.range && (t < $.value[0] || t > $.value[1])))
386
+ return;
387
+ const s = e.key === "Home" ? 1 : e.key === "End" ? -1 : t >= a ? 1 : -1;
388
+ for (let h = 0; h < (l ? 12 : 366); h++) {
389
+ const ee = k(t);
390
+ if (l ? !Array.from(
391
+ { length: k(f(ee.year, ee.month + 1, 0)).day },
392
+ (ra, sa) => t - ee.day + 1 + sa
393
+ ).every(L) : !L(t))
394
+ break;
395
+ if (t = l ? R(t, s) : t + s, t < X || t > Z || o.range && (t < $.value[0] || t > $.value[1]) || h === (l ? 11 : 365)) return;
396
+ }
397
+ !o.range && !j(t) || (N.value = t, await We());
398
+ }
399
+ return He({
400
+ element: te,
401
+ selectedDay: u(
402
+ () => z.value === void 0 ? void 0 : A(z.value)
403
+ ),
404
+ panelValue: u(() => A(D.value)),
405
+ currentMode: c,
406
+ visibleRange: ve,
407
+ pickDay: ta,
408
+ selectDate: H,
409
+ showMonth: Be,
410
+ setMode: be,
411
+ focus: We
412
+ }), (e, a) => (r(), i("section", Le({
413
+ ref_key: "element",
414
+ ref: te
415
+ }, g(Ce), {
416
+ class: ["hys-ui-calendar", {
417
+ "hys-ui-calendar--card": !m.fullscreen,
418
+ "hys-ui-calendar--disabled": m.disabled
419
+ }],
420
+ "aria-busy": m.loading || void 0,
421
+ "aria-label": m.ariaLabel || y.value.label
422
+ }), [
423
+ m.showHeader ? (r(), i("header", Sa, [
424
+ T(e.$slots, "header", {
425
+ date: se.value,
426
+ value: A(D.value),
427
+ mode: c.value,
428
+ selectDate: H,
429
+ showMonth: Be,
430
+ setMode: be
431
+ }, () => [
432
+ C("strong", Va, p(se.value), 1),
433
+ w.value ? b("", !0) : (r(), i("div", za, [
434
+ m.controllerType === "select" ? (r(), i(W, { key: 0 }, [
435
+ S(Ee, {
436
+ "model-value": d.value.year,
437
+ options: Ge.value,
438
+ filterable: "",
439
+ size: "sm",
440
+ disabled: v.value,
441
+ "aria-label": y.value.year,
442
+ class: "hys-ui-calendar-year-select",
443
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => j(g(f)(Number(l), d.value.month, 1)))
444
+ }, null, 8, ["model-value", "options", "disabled", "aria-label"]),
445
+ c.value === "month" ? (r(), Y(Ee, {
446
+ key: 0,
447
+ "model-value": d.value.month,
448
+ options: Je.value,
449
+ size: "sm",
450
+ disabled: v.value,
451
+ "aria-label": y.value.month,
452
+ class: "hys-ui-calendar-month-select",
453
+ "onUpdate:modelValue": a[1] || (a[1] = (l) => j(g(f)(d.value.year, Number(l), 1)))
454
+ }, null, 8, ["model-value", "options", "disabled", "aria-label"])) : b("", !0)
455
+ ], 64)) : b("", !0),
456
+ C("div", Aa, [
457
+ m.controllerType === "button" && c.value === "month" ? (r(), Y(q, {
458
+ key: 0,
459
+ size: "sm",
460
+ variant: "ghost",
461
+ disabled: v.value || !_(J("prev-year")),
462
+ "aria-label": y.value.previous + y.value.year,
463
+ onClick: a[2] || (a[2] = (l) => H("prev-year"))
464
+ }, {
465
+ default: K(() => [
466
+ S(g(ya), { size: 16 })
467
+ ]),
468
+ _: 1
469
+ }, 8, ["disabled", "aria-label"])) : b("", !0),
470
+ S(q, {
471
+ size: "sm",
472
+ variant: "ghost",
473
+ disabled: v.value || !_(
474
+ J(
475
+ c.value === "year" ? "prev-year" : "prev-month"
476
+ )
477
+ ),
478
+ "aria-label": y.value.previous + (c.value === "year" ? y.value.year : y.value.month),
479
+ onClick: a[3] || (a[3] = (l) => H(c.value === "year" ? "prev-year" : "prev-month"))
480
+ }, {
481
+ default: K(() => [
482
+ S(g(ma), { size: 16 })
483
+ ]),
484
+ _: 1
485
+ }, 8, ["disabled", "aria-label"]),
486
+ m.showToday ? (r(), Y(q, {
487
+ key: 1,
488
+ size: "sm",
489
+ variant: "secondary",
490
+ disabled: v.value || !_(g(O)),
491
+ onClick: a[4] || (a[4] = (l) => H("today"))
492
+ }, {
493
+ default: K(() => [
494
+ le(p(y.value.today), 1)
495
+ ]),
496
+ _: 1
497
+ }, 8, ["disabled"])) : b("", !0),
498
+ S(q, {
499
+ size: "sm",
500
+ variant: "ghost",
501
+ disabled: v.value || !_(
502
+ J(
503
+ c.value === "year" ? "next-year" : "next-month"
504
+ )
505
+ ),
506
+ "aria-label": y.value.next + (c.value === "year" ? y.value.year : y.value.month),
507
+ onClick: a[5] || (a[5] = (l) => H(c.value === "year" ? "next-year" : "next-month"))
508
+ }, {
509
+ default: K(() => [
510
+ S(g(ha), { size: 16 })
511
+ ]),
512
+ _: 1
513
+ }, 8, ["disabled", "aria-label"]),
514
+ m.controllerType === "button" && c.value === "month" ? (r(), Y(q, {
515
+ key: 2,
516
+ size: "sm",
517
+ variant: "ghost",
518
+ disabled: v.value || !_(J("next-year")),
519
+ "aria-label": y.value.next + y.value.year,
520
+ onClick: a[6] || (a[6] = (l) => H("next-year"))
521
+ }, {
522
+ default: K(() => [
523
+ S(g(fa), { size: 16 })
524
+ ]),
525
+ _: 1
526
+ }, 8, ["disabled", "aria-label"])) : b("", !0)
527
+ ]),
528
+ m.showModeSwitch ? (r(), Y(pa, {
529
+ key: 1,
530
+ "model-value": c.value,
531
+ options: [
532
+ { label: y.value.month, value: "month" },
533
+ { label: y.value.year, value: "year" }
534
+ ],
535
+ size: "sm",
536
+ disabled: v.value,
537
+ "aria-label": I.value ? "日历视图" : "Calendar view",
538
+ "onUpdate:modelValue": a[7] || (a[7] = (l) => be(l))
539
+ }, null, 8, ["model-value", "options", "disabled", "aria-label"])) : b("", !0)
540
+ ]))
541
+ ], !0)
542
+ ])) : b("", !0),
543
+ C("div", {
544
+ class: "hys-ui-calendar-body",
545
+ style: pe({ "--hys-ui-calendar-duration": Se.value + "ms" })
546
+ }, [
547
+ m.loading ? (r(), i("div", Na, [
548
+ T(e.$slots, "loading", {}, () => [
549
+ S(g(ba), {
550
+ size: 22,
551
+ class: "hys-ui-calendar-spinner"
552
+ }),
553
+ le(p(y.value.loading), 1)
554
+ ], !0)
555
+ ])) : b("", !0),
556
+ S(ca, {
557
+ name: Ye.value,
558
+ css: je.value,
559
+ onBeforeLeave: qe
560
+ }, {
561
+ default: K(() => [
562
+ (r(), i("div", {
563
+ key: ye.value,
564
+ class: "hys-ui-calendar-page",
565
+ "data-calendar-panel": ye.value
566
+ }, [
567
+ c.value === "month" ? (r(), i("div", {
568
+ key: 0,
569
+ role: "grid",
570
+ "aria-label": se.value,
571
+ "aria-readonly": m.readonly || void 0,
572
+ class: "hys-ui-calendar-grid"
573
+ }, [
574
+ C("div", {
575
+ role: "row",
576
+ class: ie(["hys-ui-calendar-weekdays", { "hys-ui-calendar--weeks": m.showWeekNumbers }])
577
+ }, [
578
+ m.showWeekNumbers ? (r(), i("span", Wa, p(y.value.week), 1)) : b("", !0),
579
+ (r(!0), i(W, null, P(Oe.value, (l) => (r(), i("span", {
580
+ key: l,
581
+ role: "columnheader"
582
+ }, p(l), 1))), 128))
583
+ ], 2),
584
+ (r(!0), i(W, null, P(Xe.value, (l, t) => (r(), i("div", {
585
+ key: t,
586
+ role: "row",
587
+ class: ie(["hys-ui-calendar-week", { "hys-ui-calendar--weeks": m.showWeekNumbers }])
588
+ }, [
589
+ m.showWeekNumbers ? (r(), i("span", Ra, p(l.number), 1)) : b("", !0),
590
+ (r(!0), i(W, null, P(l.days, (n) => (r(), i("div", {
591
+ key: n.day,
592
+ role: "gridcell",
593
+ "data-date": n.day,
594
+ "aria-selected": n.isSelected,
595
+ "aria-current": n.isToday ? "date" : void 0,
596
+ "aria-disabled": n.disabled || void 0,
597
+ "aria-label": Ue.value.format(new Date(x(n.day) * 864e5)),
598
+ tabindex: n.day === he.value ? 0 : -1,
599
+ class: ie(["hys-ui-calendar-cell", {
600
+ "hys-ui-calendar-cell--outside": n.type !== "current-month" && !w.value,
601
+ "hys-ui-calendar-cell--selected": n.isSelected,
602
+ "hys-ui-calendar-cell--today": n.isToday,
603
+ "hys-ui-calendar-cell--disabled": n.disabled,
604
+ "hys-ui-calendar-cell--hidden": !m.showAdjacentDays && n.type !== "current-month" && !w.value
605
+ }]),
606
+ onFocus: (s) => N.value = x(n.day),
607
+ onKeydown: (s) => Re(s, x(n.day)),
608
+ onClick: (s) => oa(x(n.day), s)
609
+ }, [
610
+ T(e.$slots, "date-full-cell", {
611
+ date: n.date,
612
+ data: n
613
+ }, () => {
614
+ var s;
615
+ return [
616
+ C("div", Ea, [
617
+ C("button", {
618
+ type: "button",
619
+ tabindex: "-1",
620
+ disabled: n.disabled,
621
+ "aria-pressed": n.isSelected,
622
+ "aria-readonly": m.readonly || void 0,
623
+ class: "hys-ui-calendar-day",
624
+ onClick: de((h) => Q(x(n.day)), ["stop"])
625
+ }, [
626
+ T(e.$slots, "date", {
627
+ date: n.day,
628
+ day: g(k)(x(n.day)).day
629
+ }, () => [
630
+ le(p(w.value ? n.day.slice(5).replace("-", "/") : g(k)(x(n.day)).day), 1)
631
+ ], !0)
632
+ ], 8, _a)
633
+ ]),
634
+ T(e.$slots, "date-cell", {
635
+ date: n.date,
636
+ data: n
637
+ }, void 0, !0),
638
+ n.events.length ? (r(), i("div", Ha, [
639
+ (r(!0), i(W, null, P(n.events.slice(0, ue.value), (h, ee) => (r(), i("button", {
640
+ key: h.id + ":" + ee,
641
+ type: "button",
642
+ tabindex: n.day === he.value ? 0 : -1,
643
+ class: "hys-ui-calendar-event",
644
+ disabled: v.value || h.disabled,
645
+ title: [h.time, h.title, h.description].filter(Boolean).join(" · "),
646
+ onClick: de((ra) => Fe(h, n.day), ["stop"])
647
+ }, [
648
+ T(e.$slots, "event", {
649
+ event: h,
650
+ date: n.day
651
+ }, () => [
652
+ C("span", {
653
+ class: "hys-ui-calendar-dot",
654
+ style: pe({ background: h.color })
655
+ }, null, 4),
656
+ h.time ? (r(), i("time", Pa, p(h.time), 1)) : b("", !0),
657
+ C("span", null, p(h.title), 1)
658
+ ], !0)
659
+ ], 8, Ka))), 128)),
660
+ n.events.length > ue.value ? (r(), i("button", {
661
+ key: 0,
662
+ type: "button",
663
+ tabindex: n.day === he.value ? 0 : -1,
664
+ disabled: v.value,
665
+ class: "hys-ui-calendar-more",
666
+ "aria-expanded": g(Ne) && ((s = M.value) == null ? void 0 : s.day) === n.day,
667
+ onClick: de((h) => na(n, h), ["stop"])
668
+ }, [
669
+ T(e.$slots, "more", {
670
+ date: n.day,
671
+ count: n.events.length - ue.value
672
+ }, () => [
673
+ le("+" + p(n.events.length - ue.value) + " " + p(y.value.more), 1)
674
+ ], !0)
675
+ ], 8, Ua)) : b("", !0)
676
+ ])) : b("", !0)
677
+ ];
678
+ }, !0)
679
+ ], 42, La))), 128))
680
+ ], 2))), 128))
681
+ ], 8, Fa)) : (r(), i("div", {
682
+ key: 1,
683
+ role: "grid",
684
+ "aria-label": se.value,
685
+ "aria-readonly": m.readonly || void 0,
686
+ class: "hys-ui-calendar-year-grid"
687
+ }, [
688
+ (r(), i(W, null, P(4, (l) => C("div", {
689
+ key: l,
690
+ role: "row",
691
+ class: "hys-ui-calendar-month-row"
692
+ }, [
693
+ (r(!0), i(W, null, P(G.value.slice((l - 1) * 3, l * 3), (t) => (r(), i("div", {
694
+ key: t.month,
695
+ role: "gridcell",
696
+ "data-month": t.month,
697
+ "aria-selected": t.isSelected,
698
+ "aria-disabled": t.disabled || void 0,
699
+ tabindex: t.month === Qe.value ? 0 : -1,
700
+ class: ie(["hys-ui-calendar-cell hys-ui-calendar-month", {
701
+ "hys-ui-calendar-cell--selected": t.isSelected,
702
+ "hys-ui-calendar-cell--today": t.isToday,
703
+ "hys-ui-calendar-cell--disabled": t.disabled
704
+ }]),
705
+ onFocus: (n) => N.value = x(t.day),
706
+ onKeydown: (n) => Re(n, x(t.day), !0),
707
+ onClick: (n) => !n.target.closest(
708
+ "button,a,input,[contenteditable]"
709
+ ) && ke(t)
710
+ }, [
711
+ T(e.$slots, "month-full-cell", {
712
+ date: t.date,
713
+ data: t
714
+ }, () => [
715
+ C("button", {
716
+ type: "button",
717
+ tabindex: "-1",
718
+ disabled: t.disabled,
719
+ class: "hys-ui-calendar-day",
720
+ "aria-pressed": t.isSelected,
721
+ onClick: de((n) => ke(t), ["stop"])
722
+ }, p(Me.value.format(
723
+ new Date(x(t.day) * 864e5)
724
+ )), 9, ja),
725
+ T(e.$slots, "month-cell", {
726
+ date: t.date,
727
+ data: t
728
+ }, () => [
729
+ t.events.length ? (r(), i("span", Ya, p(t.events.length) + " " + p(I.value ? "项日程" : "events"), 1)) : b("", !0)
730
+ ], !0)
731
+ ], !0)
732
+ ], 42, Ia))), 128))
733
+ ])), 64))
734
+ ], 8, Oa))
735
+ ], 8, Ba))
736
+ ]),
737
+ _: 3
738
+ }, 8, ["name", "css"])
739
+ ], 4),
740
+ e.$slots.footer ? (r(), i("footer", qa, [
741
+ T(e.$slots, "footer", {
742
+ selected: z.value === void 0 ? void 0 : A(z.value),
743
+ value: A(D.value),
744
+ mode: c.value,
745
+ visibleRange: ve.value
746
+ }, void 0, !0)
747
+ ])) : b("", !0),
748
+ (r(), Y(va, { to: "body" }, [
749
+ g(Ne) && M.value ? (r(), i("div", Le({
750
+ key: 0,
751
+ id: g(Pe) + "-events",
752
+ ref_key: "popup",
753
+ ref: fe
754
+ }, g(Ce), {
755
+ role: "dialog",
756
+ "aria-label": M.value.day + " " + y.value.more,
757
+ class: "hys-ui-calendar-popup hys-ui-floating-surface",
758
+ style: g(ea)
759
+ }), [
760
+ C("header", null, [
761
+ C("strong", null, p(M.value.day), 1),
762
+ S(q, {
763
+ variant: "ghost",
764
+ size: "sm",
765
+ "aria-label": y.value.close,
766
+ onClick: E
767
+ }, {
768
+ default: K(() => [
769
+ S(g(ka), { size: 15 })
770
+ ]),
771
+ _: 1
772
+ }, 8, ["aria-label"])
773
+ ]),
774
+ C("div", Za, [
775
+ (r(!0), i(W, null, P(M.value.events, (l, t) => (r(), i("button", {
776
+ key: l.id + ":" + t,
777
+ type: "button",
778
+ class: "hys-ui-calendar-event",
779
+ disabled: v.value || l.disabled,
780
+ onClick: (n) => Fe(l, M.value.day)
781
+ }, [
782
+ T(e.$slots, "event", {
783
+ event: l,
784
+ date: M.value.day
785
+ }, () => [
786
+ C("span", {
787
+ class: "hys-ui-calendar-dot",
788
+ style: pe({ background: l.color })
789
+ }, null, 4),
790
+ l.time ? (r(), i("time", Ja, p(l.time), 1)) : b("", !0),
791
+ C("span", null, [
792
+ le(p(l.title), 1),
793
+ l.description ? (r(), i("small", Qa, p(l.description), 1)) : b("", !0)
794
+ ])
795
+ ], !0)
796
+ ], 8, Ga))), 128))
797
+ ])
798
+ ], 16, Xa)) : b("", !0)
799
+ ]))
800
+ ], 16, Ta));
801
+ }
802
+ });
2
803
  export {
3
- f as default
804
+ il as default
4
805
  };