@wirecore/wirelayer-vue 0.5.0 → 0.7.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 (160) hide show
  1. package/dist/{Button-DZ_ZGl7X.js → Button-BpMOPs8b.js} +7 -8
  2. package/dist/{Checkbox-D9f77jtl.js → Checkbox-D175nhKK.js} +26 -22
  3. package/dist/ContextMenu-BEOEyUa6.js +2235 -0
  4. package/dist/{Field-BdIPugFP.js → Field-B1EsNF84.js} +20 -17
  5. package/dist/{Highlight-DvGcm2QR.js → Highlight-uwptdaUw.js} +35 -32
  6. package/dist/{Input-C59NJK4m.js → Input-Cn5q0yVE.js} +50 -36
  7. package/dist/{InputStatus-CUyF9-GR.js → InputStatus-D7kBGlew.js} +4 -1
  8. package/dist/{Select-BlEjQWBP.js → Select-Bd2Vpr7G.js} +175 -164
  9. package/dist/Slider-Cpv7Vj3B.js +143 -0
  10. package/dist/{Tree-B39xwNbU.js → Tree-fd9LXqgZ.js} +184 -181
  11. package/dist/chart/Chart.vue.d.ts +10 -4
  12. package/dist/chart/Chart.vue.d.ts.map +1 -1
  13. package/dist/chart/index.d.ts +2 -0
  14. package/dist/chart/index.d.ts.map +1 -1
  15. package/dist/chart.js +30 -24
  16. package/dist/code.js +1 -1
  17. package/dist/components/AngleSlider/AngleSlider.vue.d.ts +2 -0
  18. package/dist/components/AngleSlider/AngleSlider.vue.d.ts.map +1 -1
  19. package/dist/components/Autocomplete/Autocomplete.vue.d.ts +2 -0
  20. package/dist/components/Autocomplete/Autocomplete.vue.d.ts.map +1 -1
  21. package/dist/components/Badge/Badge.vue.d.ts +2 -0
  22. package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
  23. package/dist/components/Button/Button.vue.d.ts +5 -0
  24. package/dist/components/Button/Button.vue.d.ts.map +1 -1
  25. package/dist/components/Carousel/Carousel.vue.d.ts +2 -0
  26. package/dist/components/Carousel/Carousel.vue.d.ts.map +1 -1
  27. package/dist/components/CascadeSelect/CascadeSelect.vue.d.ts +2 -0
  28. package/dist/components/CascadeSelect/CascadeSelect.vue.d.ts.map +1 -1
  29. package/dist/components/Checkbox/Checkbox.vue.d.ts +2 -0
  30. package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
  31. package/dist/components/ChipGroup/ChipGroup.vue.d.ts +1 -1
  32. package/dist/components/ChipGroup/ChipGroup.vue.d.ts.map +1 -1
  33. package/dist/components/ColorInput/ColorInput.vue.d.ts.map +1 -1
  34. package/dist/components/ColorPicker/ColorPicker.vue.d.ts +2 -0
  35. package/dist/components/ColorPicker/ColorPicker.vue.d.ts.map +1 -1
  36. package/dist/components/Combobox/Combobox.vue.d.ts +8 -1
  37. package/dist/components/Combobox/Combobox.vue.d.ts.map +1 -1
  38. package/dist/components/Confirm/ConfirmDialog.vue.d.ts +5 -0
  39. package/dist/components/Confirm/ConfirmDialog.vue.d.ts.map +1 -1
  40. package/dist/components/Confirm/confirm.d.ts +7 -0
  41. package/dist/components/Confirm/confirm.d.ts.map +1 -1
  42. package/dist/components/DatePicker/DatePicker.vue.d.ts +4 -0
  43. package/dist/components/DatePicker/DatePicker.vue.d.ts.map +1 -1
  44. package/dist/components/DatePicker/DatePickerBase.vue.d.ts +4 -0
  45. package/dist/components/DatePicker/DatePickerBase.vue.d.ts.map +1 -1
  46. package/dist/components/DateRangePicker/DateRangePicker.vue.d.ts +4 -0
  47. package/dist/components/DateRangePicker/DateRangePicker.vue.d.ts.map +1 -1
  48. package/dist/components/Dialog/DialogContent.vue.d.ts +12 -6
  49. package/dist/components/Dialog/DialogContent.vue.d.ts.map +1 -1
  50. package/dist/components/Drawer/DrawerContent.vue.d.ts +7 -5
  51. package/dist/components/Drawer/DrawerContent.vue.d.ts.map +1 -1
  52. package/dist/components/DurationInput/DurationInput.vue.d.ts +2 -0
  53. package/dist/components/DurationInput/DurationInput.vue.d.ts.map +1 -1
  54. package/dist/components/EmptyState/EmptyState.vue.d.ts +5 -5
  55. package/dist/components/EmptyState/EmptyState.vue.d.ts.map +1 -1
  56. package/dist/components/Field/Field.vue.d.ts +12 -2
  57. package/dist/components/Field/Field.vue.d.ts.map +1 -1
  58. package/dist/components/Field/context.d.ts +3 -1
  59. package/dist/components/Field/context.d.ts.map +1 -1
  60. package/dist/components/FileUpload/FileUpload.vue.d.ts +11 -0
  61. package/dist/components/FileUpload/FileUpload.vue.d.ts.map +1 -1
  62. package/dist/components/IconButton/IconButton.vue.d.ts +4 -0
  63. package/dist/components/IconButton/IconButton.vue.d.ts.map +1 -1
  64. package/dist/components/Knob/Knob.vue.d.ts +2 -0
  65. package/dist/components/Knob/Knob.vue.d.ts.map +1 -1
  66. package/dist/components/Listbox/Listbox.vue.d.ts +2 -0
  67. package/dist/components/Listbox/Listbox.vue.d.ts.map +1 -1
  68. package/dist/components/LocaleProvider/LocaleProvider.vue.d.ts +1 -0
  69. package/dist/components/LocaleProvider/LocaleProvider.vue.d.ts.map +1 -1
  70. package/dist/components/MonthPicker/MonthPicker.vue.d.ts +4 -0
  71. package/dist/components/MonthPicker/MonthPicker.vue.d.ts.map +1 -1
  72. package/dist/components/MultiSelect/MultiSelect.vue.d.ts +8 -1
  73. package/dist/components/MultiSelect/MultiSelect.vue.d.ts.map +1 -1
  74. package/dist/components/NumberInput/NumberInput.vue.d.ts +2 -0
  75. package/dist/components/NumberInput/NumberInput.vue.d.ts.map +1 -1
  76. package/dist/components/PasswordInput/PasswordInput.vue.d.ts +2 -0
  77. package/dist/components/PasswordInput/PasswordInput.vue.d.ts.map +1 -1
  78. package/dist/components/PinInput/PinInput.vue.d.ts +2 -0
  79. package/dist/components/PinInput/PinInput.vue.d.ts.map +1 -1
  80. package/dist/components/RadioGroup/RadioGroup.vue.d.ts +1 -1
  81. package/dist/components/RadioGroup/RadioGroup.vue.d.ts.map +1 -1
  82. package/dist/components/Rating/Rating.vue.d.ts +2 -0
  83. package/dist/components/Rating/Rating.vue.d.ts.map +1 -1
  84. package/dist/components/SegmentedControl/SegmentedControl.vue.d.ts +2 -2
  85. package/dist/components/SegmentedControl/SegmentedControl.vue.d.ts.map +1 -1
  86. package/dist/components/Select/Select.vue.d.ts +8 -1
  87. package/dist/components/Select/Select.vue.d.ts.map +1 -1
  88. package/dist/components/Select/types.d.ts +2 -0
  89. package/dist/components/Select/types.d.ts.map +1 -1
  90. package/dist/components/SelectionCard/CheckboxCard.vue.d.ts +2 -0
  91. package/dist/components/SelectionCard/CheckboxCard.vue.d.ts.map +1 -1
  92. package/dist/components/Slider/Slider.vue.d.ts +2 -0
  93. package/dist/components/Slider/Slider.vue.d.ts.map +1 -1
  94. package/dist/components/Switch/Switch.vue.d.ts +2 -0
  95. package/dist/components/Switch/Switch.vue.d.ts.map +1 -1
  96. package/dist/components/TagsInput/TagsInput.vue.d.ts +2 -0
  97. package/dist/components/TagsInput/TagsInput.vue.d.ts.map +1 -1
  98. package/dist/components/TimePicker/TimePicker.vue.d.ts +2 -0
  99. package/dist/components/TimePicker/TimePicker.vue.d.ts.map +1 -1
  100. package/dist/components/TimeRangePicker/TimeRangePicker.vue.d.ts +2 -0
  101. package/dist/components/TimeRangePicker/TimeRangePicker.vue.d.ts.map +1 -1
  102. package/dist/components/Toast/Toaster.vue.d.ts +12 -2
  103. package/dist/components/Toast/Toaster.vue.d.ts.map +1 -1
  104. package/dist/components/ToggleButton/ToggleButton.vue.d.ts +9 -2
  105. package/dist/components/ToggleButton/ToggleButton.vue.d.ts.map +1 -1
  106. package/dist/components/Tooltip/Tooltip.vue.d.ts +3 -0
  107. package/dist/components/Tooltip/Tooltip.vue.d.ts.map +1 -1
  108. package/dist/components/TreeSelect/TreeSelect.vue.d.ts +2 -0
  109. package/dist/components/TreeSelect/TreeSelect.vue.d.ts.map +1 -1
  110. package/dist/components/YearPicker/YearPicker.vue.d.ts +4 -0
  111. package/dist/components/YearPicker/YearPicker.vue.d.ts.map +1 -1
  112. package/dist/data-table/DataTable.vue.d.ts +36 -2
  113. package/dist/data-table/DataTable.vue.d.ts.map +1 -1
  114. package/dist/data-table/FilterMenu.vue.d.ts +10 -0
  115. package/dist/data-table/FilterMenu.vue.d.ts.map +1 -1
  116. package/dist/data-table/ValueInput.vue.d.ts +19 -1
  117. package/dist/data-table/ValueInput.vue.d.ts.map +1 -1
  118. package/dist/data-table/index.d.ts +1 -1
  119. package/dist/data-table/index.d.ts.map +1 -1
  120. package/dist/data-table/types.d.ts +23 -1
  121. package/dist/data-table/types.d.ts.map +1 -1
  122. package/dist/data-table.js +1475 -1341
  123. package/dist/editor.js +2 -2
  124. package/dist/form/FormField.vue.d.ts +13 -5
  125. package/dist/form/FormField.vue.d.ts.map +1 -1
  126. package/dist/form.js +128 -109
  127. package/dist/index.d.ts +1 -1
  128. package/dist/index.d.ts.map +1 -1
  129. package/dist/index.js +6470 -6251
  130. package/dist/label-for-eQvYjsM5.js +8 -0
  131. package/dist/pdf.js +4 -4
  132. package/dist/sources/ActionBar.css +1 -0
  133. package/dist/sources/AppShell.css +1 -0
  134. package/dist/sources/ChatPrompt.css +1 -0
  135. package/dist/sources/Gallery.css +1 -0
  136. package/dist/sources/IconButton.css +1 -0
  137. package/dist/sources/Image.css +1 -0
  138. package/dist/sources/ImageCropper.css +1 -0
  139. package/dist/sources/InlineEdit.css +1 -0
  140. package/dist/sources/Marquee.css +1 -0
  141. package/dist/sources/MegaMenu.css +1 -0
  142. package/dist/sources/Menubar.css +1 -0
  143. package/dist/sources/OrderList.css +1 -0
  144. package/dist/sources/PickList.css +1 -0
  145. package/dist/sources/ScrollTop.css +1 -0
  146. package/dist/{useTree-Dt7NO7cp.js → useTree-UhG1TMeM.js} +2 -2
  147. package/dist/utils/label-for.d.ts +3 -0
  148. package/dist/utils/label-for.d.ts.map +1 -0
  149. package/dist/utils/list.d.ts +5 -0
  150. package/dist/utils/list.d.ts.map +1 -1
  151. package/dist/virtual/VirtualSelect.vue.d.ts +2 -0
  152. package/dist/virtual/VirtualSelect.vue.d.ts.map +1 -1
  153. package/dist/virtual.js +207 -197
  154. package/fonts.css +2 -0
  155. package/llms-full.txt +699 -373
  156. package/llms.txt +4 -1
  157. package/package.json +7 -3
  158. package/theme.css +14 -0
  159. package/dist/ContextMenu-R23YbbaS.js +0 -2188
  160. package/dist/Slider-CyoZc5A8.js +0 -135
@@ -1,2188 +0,0 @@
1
- import { a as e, i as t, n } from "./recipes-BlM9aKyt.js";
2
- import { t as r } from "./attrs-KNjeRUCf.js";
3
- import { r as i, t as a } from "./InputStatus-CUyF9-GR.js";
4
- import { t as o } from "./Input-C59NJK4m.js";
5
- import { n as s, t as c } from "./Select-BlEjQWBP.js";
6
- import { a as l, n as u, r as d } from "./Highlight-DvGcm2QR.js";
7
- import { Fragment as f, Teleport as p, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createSlots as y, createTextVNode as b, createVNode as x, defineComponent as S, guardReactiveProps as C, inject as w, mergeModels as T, mergeProps as E, nextTick as D, normalizeClass as O, normalizeProps as k, normalizeStyle as ee, onBeforeUnmount as A, onMounted as j, openBlock as M, provide as N, reactive as P, ref as F, renderList as I, renderSlot as L, resolveComponent as R, resolveDynamicComponent as z, shallowRef as B, toDisplayString as V, unref as H, useAttrs as te, useId as ne, useModel as re, useTemplateRef as ie, vModelText as U, watch as W, withCtx as G, withDirectives as ae, withKeys as K } from "vue";
8
- import { CalendarDays as q, Check as oe, ChevronDown as se, ChevronLeft as ce, ChevronRight as J, ChevronUp as le, ChevronsLeft as ue, ChevronsRight as de, Circle as fe, LoaderCircle as pe, Minus as me, Plus as he, X as ge } from "@lucide/vue";
9
- import { SUBMENU_GUTTER as _e, allListOptionsState as ve, anchorBox as ye, createLongPress as be, datePicker as Y, defaultNumberFormat as xe, filterMenuEntries as Se, fromWallIso as Ce, highlightFirstMenuItem as we, insertIntoTextControl as Te, isoWeekday as Ee, linkTarget as De, localeWeekInfo as Oe, menu as ke, menuSearchKey as Ae, multiSelect as je, numberInput as Me, numberInputKey as Ne, pageForSize as Pe, pagination as Fe, parseLocaleNumber as Ie, parsePastedDate as Le, parsePastedRange as Re, pluralText as ze, rowWeekNumber as Be, setTextControlValue as Ve, skeleton as He, textarea as Ue, textareaParts as We, timeSlots as Ge, timeZoneLabel as Ke, timeZoneLongLabel as qe, toNumberInputValue as Je, toOverlayAnchor as Ye, toWallIso as Xe, todayIso as Ze, toggleAllListOptions as Qe, zonedToInstant as $e } from "@wirecore/wirelayer-recipes";
10
- import { Menu as X } from "@ark-ui/vue/menu";
11
- import { useFilter as et } from "@ark-ui/vue/locale";
12
- import { Field as tt, useFieldContext as nt } from "@ark-ui/vue/field";
13
- import { Pagination as Z, usePagination as rt } from "@ark-ui/vue/pagination";
14
- import { createListCollection as it } from "@ark-ui/vue/collection";
15
- import { Select as Q } from "@ark-ui/vue/select";
16
- import { DateInput as at } from "@ark-ui/vue/date-input";
17
- import { DatePicker as $, useDatePickerContext as ot } from "@ark-ui/vue/date-picker";
18
- import { CalendarDateTime as st, DateFormatter as ct, Time as lt, parseDate as ut, parseDateTime as dt, toCalendarDateTime as ft } from "@internationalized/date";
19
- import { NumberInput as pt, useNumberInput as mt } from "@ark-ui/vue/number-input";
20
- //#region src/components/Menu/state.ts
21
- var ht = Symbol("wirecore-menu-state");
22
- function gt(e) {
23
- let t = P({
24
- checked: {},
25
- radio: {}
26
- });
27
- W(e.items, () => {
28
- t.checked = {}, t.radio = {};
29
- });
30
- let n = {
31
- checked: (e) => t.checked[e.value] ?? e.checked ?? !1,
32
- setChecked: (n, r) => {
33
- t.checked[n.value] = r, e.onCheckedChange(n.value, r);
34
- },
35
- radio: (e) => t.radio[e.name] ?? e.value,
36
- setRadio: (n, r) => {
37
- t.radio[n.name] = r, e.onValueChange(n.name, r);
38
- },
39
- linkAs: () => e.linkAs() ?? "a"
40
- };
41
- return N(ht, n), n;
42
- }
43
- var _t = () => w(ht, null), vt = /* @__PURE__ */ S({
44
- name: "MenuEntries",
45
- __name: "MenuEntries",
46
- props: { entries: {} },
47
- emits: ["select"],
48
- setup(e, { emit: t }) {
49
- let r = n("menu", ke), i = t, a = r(), o = {
50
- placement: "right-start",
51
- offset: { mainAxis: _e }
52
- }, s = _t(), c = (e, t) => !("type" in e) || e.type === "checkbox" ? e.value : e.type === "radio" ? `radio-${e.name}` : `${e.type}-${t}`;
53
- return (t, n) => {
54
- let l = R("MenuEntries", !0);
55
- return M(!0), _(f, null, I(e.entries, (e, u) => (M(), _(f, { key: c(e, u) }, ["type" in e && e.type === "separator" ? (M(), h(H(X).Separator, {
56
- key: 0,
57
- class: O(H(a).separator())
58
- }, null, 8, ["class"])) : "type" in e && e.type === "group" ? (M(), h(H(X).ItemGroup, { key: 1 }, {
59
- default: G(() => [x(H(X).ItemGroupLabel, { class: O(H(a).groupLabel()) }, {
60
- default: G(() => [b(V(e.label), 1)]),
61
- _: 2
62
- }, 1032, ["class"]), x(l, {
63
- entries: e.items,
64
- onSelect: n[0] ||= (e) => i("select", e)
65
- }, y({ _: 2 }, [t.$slots.item ? {
66
- name: "item",
67
- fn: G((e) => [L(t.$slots, "item", E({ ref_for: !0 }, e))]),
68
- key: "0"
69
- } : void 0]), 1032, ["entries"])]),
70
- _: 2
71
- }, 1024)) : "type" in e && e.type === "radio" ? (M(), h(H(X).RadioItemGroup, {
72
- key: 2,
73
- "model-value": H(s)?.radio(e),
74
- "onUpdate:modelValue": (t) => H(s)?.setRadio(e, t)
75
- }, {
76
- default: G(() => [e.label ? (M(), h(H(X).ItemGroupLabel, {
77
- key: 0,
78
- class: O(H(a).groupLabel())
79
- }, {
80
- default: G(() => [b(V(e.label), 1)]),
81
- _: 2
82
- }, 1032, ["class"])) : g("", !0), (M(!0), _(f, null, I(e.items, (e) => (M(), h(H(X).RadioItem, {
83
- key: e.value,
84
- value: e.value,
85
- disabled: e.disabled,
86
- "close-on-select": e.closeOnSelect ?? !1,
87
- class: O(H(a).item())
88
- }, {
89
- default: G(() => [v("span", { class: O(H(a).indicator()) }, [x(H(X).ItemIndicator, null, {
90
- default: G(() => [x(H(fe), {
91
- class: O(H(a).indicatorDot()),
92
- "aria-hidden": "true"
93
- }, null, 8, ["class"])]),
94
- _: 1
95
- })], 2), L(t.$slots, "item", { item: e }, () => [e.icon ? (M(), h(z(e.icon), {
96
- key: 0,
97
- class: O(H(a).icon()),
98
- "aria-hidden": "true"
99
- }, null, 8, ["class"])) : g("", !0), v("span", { class: O(H(a).label()) }, V(e.label), 3)])]),
100
- _: 2
101
- }, 1032, [
102
- "value",
103
- "disabled",
104
- "close-on-select",
105
- "class"
106
- ]))), 128))]),
107
- _: 2
108
- }, 1032, ["model-value", "onUpdate:modelValue"])) : "type" in e && e.type === "checkbox" ? (M(), h(H(X).CheckboxItem, {
109
- key: 3,
110
- value: e.value,
111
- checked: H(s)?.checked(e) ?? !!e.checked,
112
- disabled: e.disabled,
113
- "close-on-select": e.closeOnSelect ?? !1,
114
- class: O(H(a).item()),
115
- "onUpdate:checked": (t) => H(s)?.setChecked(e, t)
116
- }, {
117
- default: G(() => [v("span", { class: O(H(a).indicator()) }, [x(H(X).ItemIndicator, null, {
118
- default: G(() => [x(H(oe), {
119
- class: O(H(a).indicatorIcon()),
120
- "aria-hidden": "true"
121
- }, null, 8, ["class"])]),
122
- _: 1
123
- })], 2), L(t.$slots, "item", { item: e }, () => [e.icon ? (M(), h(z(e.icon), {
124
- key: 0,
125
- class: O(H(a).icon()),
126
- "aria-hidden": "true"
127
- }, null, 8, ["class"])) : g("", !0), v("span", { class: O(H(a).label()) }, V(e.label), 3)])]),
128
- _: 2
129
- }, 1032, [
130
- "value",
131
- "checked",
132
- "disabled",
133
- "close-on-select",
134
- "class",
135
- "onUpdate:checked"
136
- ])) : !("type" in e) && e.children ? (M(), h(H(X).Root, {
137
- key: 4,
138
- positioning: o,
139
- onSelect: n[2] ||= (e) => i("select", e.value)
140
- }, {
141
- default: G(() => [x(H(X).TriggerItem, { class: O(H(a).item()) }, {
142
- default: G(() => [
143
- e.icon ? (M(), h(z(e.icon), {
144
- key: 0,
145
- class: O(H(a).icon()),
146
- "aria-hidden": "true"
147
- }, null, 8, ["class"])) : g("", !0),
148
- v("span", { class: O(H(a).label()) }, V(e.label), 3),
149
- x(H(J), {
150
- class: O(H(a).submenuIcon()),
151
- "aria-hidden": "true"
152
- }, null, 8, ["class"])
153
- ]),
154
- _: 2
155
- }, 1032, ["class"]), (M(), h(p, { to: "body" }, [x(H(X).Positioner, null, {
156
- default: G(() => [x(H(X).Content, { class: O(H(a).content()) }, {
157
- default: G(() => [x(l, {
158
- entries: e.children,
159
- onSelect: n[1] ||= (e) => i("select", e)
160
- }, y({ _: 2 }, [t.$slots.item ? {
161
- name: "item",
162
- fn: G((e) => [L(t.$slots, "item", E({ ref_for: !0 }, e))]),
163
- key: "0"
164
- } : void 0]), 1032, ["entries"])]),
165
- _: 2
166
- }, 1032, ["class"])]),
167
- _: 2
168
- }, 1024)]))]),
169
- _: 2
170
- }, 1024)) : !("type" in e) && (e.href || e.to) ? (M(), h(H(X).Item, {
171
- key: 5,
172
- value: e.value,
173
- disabled: e.disabled,
174
- "close-on-select": e.closeOnSelect,
175
- "as-child": ""
176
- }, {
177
- default: G(() => [(M(), h(z(H(s)?.linkAs() ?? "a"), E({ ref_for: !0 }, H(De)(e.href, e.to), { class: H(r)({ danger: e.danger }).item() }), {
178
- default: G(() => [L(t.$slots, "item", { item: e }, () => [
179
- e.icon ? (M(), h(z(e.icon), {
180
- key: 0,
181
- class: O(H(a).icon()),
182
- "aria-hidden": "true"
183
- }, null, 8, ["class"])) : g("", !0),
184
- v("span", { class: O(H(a).label()) }, V(e.label), 3),
185
- e.shortcut ? (M(), _("span", {
186
- key: 1,
187
- class: O(H(a).shortcut()),
188
- "aria-hidden": "true"
189
- }, V(e.shortcut), 3)) : g("", !0)
190
- ])]),
191
- _: 2
192
- }, 1040, ["class"]))]),
193
- _: 2
194
- }, 1032, [
195
- "value",
196
- "disabled",
197
- "close-on-select"
198
- ])) : "type" in e ? g("", !0) : (M(), h(H(X).Item, {
199
- key: 6,
200
- value: e.value,
201
- disabled: e.disabled,
202
- "close-on-select": e.closeOnSelect,
203
- class: O(H(r)({ danger: e.danger }).item())
204
- }, {
205
- default: G(() => [L(t.$slots, "item", { item: e }, () => [
206
- e.icon ? (M(), h(z(e.icon), {
207
- key: 0,
208
- class: O(H(a).icon()),
209
- "aria-hidden": "true"
210
- }, null, 8, ["class"])) : g("", !0),
211
- v("span", { class: O(H(a).label()) }, V(e.label), 3),
212
- e.shortcut ? (M(), _("span", {
213
- key: 1,
214
- class: O(H(a).shortcut()),
215
- "aria-hidden": "true"
216
- }, V(e.shortcut), 3)) : g("", !0)
217
- ])]),
218
- _: 2
219
- }, 1032, [
220
- "value",
221
- "disabled",
222
- "close-on-select",
223
- "class"
224
- ]))], 64))), 128);
225
- };
226
- }
227
- });
228
- //#endregion
229
- //#region src/overlay.ts
230
- function yt(e) {
231
- let t = F(e.defaultOpen?.() ?? !1), n = B(null), r = null, i = m(() => e.open() ?? t.value), a = m(() => n.value ?? e.anchor() ?? null);
232
- W(i, (t) => {
233
- if (typeof document < "u") {
234
- if (t) r = document.activeElement;
235
- else if (e.restoreFocus) {
236
- let e = r, t = () => {
237
- if (i.value) return;
238
- let t = document.activeElement;
239
- (!t || t === document.body || !t.isConnected || t.closest("[data-scope=menu]")) && e?.focus();
240
- };
241
- requestAnimationFrame(() => {
242
- t(), setTimeout(t, 50);
243
- });
244
- }
245
- }
246
- });
247
- let o = (n) => {
248
- t.value = n, e.onOpenChange(n);
249
- }, s = (e) => {
250
- e && (n.value = null), o(e);
251
- }, c = {
252
- open(e) {
253
- n.value = Ye(e), o(!0);
254
- },
255
- close: () => o(!1),
256
- toggle(e) {
257
- i.value ? c.close() : c.open(e);
258
- }
259
- };
260
- return {
261
- isOpen: i,
262
- anchor: a,
263
- anchorPoint: m(() => a.value && !("getBoundingClientRect" in a.value) ? a.value : void 0),
264
- onOpenChange: s,
265
- handle: c,
266
- positioning: (e) => {
267
- let t = a.value;
268
- return t ? "getBoundingClientRect" in t ? {
269
- ...e,
270
- getAnchorElement: () => t
271
- } : {
272
- ...e,
273
- getAnchorRect: () => ye(t)
274
- } : e;
275
- },
276
- finalFocusEl: () => a.value ? r : null
277
- };
278
- }
279
- //#endregion
280
- //#region src/components/Menu/Menu.vue?vue&type=script&setup=true&lang.ts
281
- var bt = ["aria-label"], xt = [
282
- "placeholder",
283
- "aria-label",
284
- "aria-activedescendant",
285
- "onKeydown",
286
- "onInput"
287
- ], St = { role: "status" }, Ct = /* @__PURE__ */ S({
288
- __name: "Menu",
289
- props: {
290
- items: {},
291
- open: {
292
- type: Boolean,
293
- default: void 0
294
- },
295
- defaultOpen: {
296
- type: Boolean,
297
- default: void 0
298
- },
299
- anchor: { default: void 0 },
300
- searchable: { type: Boolean },
301
- searchLabel: {},
302
- placement: { default: "bottom-start" },
303
- arrow: { type: Boolean },
304
- linkAs: {},
305
- classes: {}
306
- },
307
- emits: [
308
- "select",
309
- "checked-change",
310
- "value-change",
311
- "update:open"
312
- ],
313
- setup(t, { expose: r, emit: i }) {
314
- let a = t, o = n("menu", ke, () => a.classes), s = i, c = o(), l = e();
315
- gt({
316
- items: () => a.items,
317
- linkAs: () => a.linkAs,
318
- onCheckedChange: (e, t) => s("checked-change", e, t),
319
- onValueChange: (e, t) => s("value-change", e, t)
320
- });
321
- let u = yt({
322
- open: () => a.open,
323
- defaultOpen: () => a.defaultOpen,
324
- anchor: () => a.anchor,
325
- onOpenChange: (e) => s("update:open", e),
326
- restoreFocus: !0
327
- });
328
- r(u.handle);
329
- let d = F(""), f = F(), b = et({
330
- sensitivity: "base",
331
- usage: "sort"
332
- }), S = m(() => a.searchable && d.value ? Se(a.items, (e) => b.value.contains(e, d.value)) : a.items), w = F(null);
333
- async function T(e, t) {
334
- let n = e.target;
335
- await D(), f.value = we(n, t);
336
- }
337
- W(u.isOpen, async (e) => {
338
- d.value = "", f.value = void 0, e && a.searchable && (await D(), requestAnimationFrame(() => requestAnimationFrame(() => w.value?.focus())));
339
- });
340
- let E = m(() => u.positioning({
341
- placement: a.placement,
342
- gutter: a.arrow ? 10 : 8
343
- }));
344
- return (e, n) => (M(), h(H(X).Root, {
345
- open: H(u).isOpen.value,
346
- positioning: E.value,
347
- "anchor-point": H(u).anchorPoint.value,
348
- "lazy-mount": "",
349
- "unmount-on-exit": "",
350
- "onUpdate:open": n[2] ||= (e) => H(u).onOpenChange(e),
351
- onSelect: n[3] ||= (e) => s("select", e.value)
352
- }, {
353
- default: G(() => [e.$slots.default ? (M(), h(H(X).Trigger, {
354
- key: 0,
355
- "as-child": ""
356
- }, {
357
- default: G(() => [L(e.$slots, "default")]),
358
- _: 3
359
- })) : g("", !0), (M(), h(p, { to: "body" }, [x(H(X).Positioner, null, {
360
- default: G(() => [x(H(X).Content, { class: O(H(c).content()) }, {
361
- default: G(() => [
362
- t.arrow ? (M(), h(H(X).Arrow, {
363
- key: 0,
364
- class: O(H(c).arrow())
365
- }, {
366
- default: G(() => [x(H(X).ArrowTip, { class: O(H(c).arrowTip()) }, null, 8, ["class"])]),
367
- _: 1
368
- }, 8, ["class"])) : g("", !0),
369
- t.searchable ? (M(), h(H(X).Context, { key: 1 }, {
370
- default: G((e) => [v("div", {
371
- role: "group",
372
- "aria-label": t.searchLabel ?? H(l).menu.search,
373
- class: O(H(c).search())
374
- }, [ae(v("input", {
375
- ref_key: "search",
376
- ref: w,
377
- "onUpdate:modelValue": n[0] ||= (e) => d.value = e,
378
- type: "text",
379
- autocomplete: "off",
380
- class: O(H(c).searchInput()),
381
- placeholder: t.searchLabel ?? H(l).menu.search,
382
- "aria-label": t.searchLabel ?? H(l).menu.search,
383
- "aria-activedescendant": f.value,
384
- onKeydown: (t) => f.value = H(Ae)(t, e) ?? f.value,
385
- onInput: (t) => T(t, e)
386
- }, null, 42, xt), [[U, d.value]])], 10, bt)]),
387
- _: 1
388
- })) : g("", !0),
389
- x(vt, {
390
- entries: S.value,
391
- onSelect: n[1] ||= (e) => s("select", e)
392
- }, y({ _: 2 }, [e.$slots.item ? {
393
- name: "item",
394
- fn: G((t) => [L(e.$slots, "item", k(C(t)))]),
395
- key: "0"
396
- } : void 0]), 1032, ["entries"]),
397
- t.searchable && !S.value.length ? (M(), _("div", {
398
- key: 2,
399
- role: "group",
400
- class: O(H(c).empty())
401
- }, [v("span", St, V(H(l).common.noResults), 1)], 2)) : g("", !0)
402
- ]),
403
- _: 3
404
- }, 8, ["class"])]),
405
- _: 3
406
- })]))]),
407
- _: 3
408
- }, 8, [
409
- "open",
410
- "positioning",
411
- "anchor-point"
412
- ]));
413
- }
414
- }), wt = ["id"], Tt = /* @__PURE__ */ S({
415
- inheritAttrs: !1,
416
- __name: "Textarea",
417
- props: /*@__PURE__*/ T({
418
- defaultValue: {},
419
- size: {},
420
- invalid: { type: Boolean },
421
- success: { type: Boolean },
422
- disabled: { type: Boolean },
423
- autoResize: { type: Boolean },
424
- minRows: {},
425
- maxRows: {},
426
- showCount: { type: Boolean },
427
- loading: { type: Boolean },
428
- clearable: { type: Boolean },
429
- clearLabel: {},
430
- classes: {}
431
- }, {
432
- modelValue: {},
433
- modelModifiers: {}
434
- }),
435
- emits: ["update:modelValue"],
436
- setup(t) {
437
- let r = t, o = n("textarea", Ue, () => r.classes), s = n("textareaParts", We, () => r.classes), c = e(), l = re(t, "modelValue"), u = te(), d = nt(), p = i(), y = m(() => r.invalid || !!d?.value.invalid), b = m(() => !y.value && (r.success || p.value.success)), S = m(() => r.disabled || !!d?.value.disabled), C = m(() => u.readonly !== void 0 && u.readonly !== !1), w = m(() => {
438
- let e = Number(u.maxlength ?? u.maxLength);
439
- return Number.isFinite(e) && e > 0 ? e : void 0;
440
- }), T = m(() => r.showCount && w.value !== void 0), k = m(() => r.loading || r.clearable || b.value), N = m(() => T.value || r.loading || r.clearable), P = m(() => s()), I = F(r.defaultValue ?? ""), L = m(() => (l.value ?? I.value).length), R = m({
441
- get: () => l.value ?? I.value,
442
- set: (e) => {
443
- I.value = e, l.value = e;
444
- }
445
- }), z = ie("element");
446
- function B() {
447
- let e = z.value?.$el;
448
- if (!r.autoResize || !e) return;
449
- e.style.height = "auto";
450
- let t = e.offsetHeight - e.clientHeight, n = e.scrollHeight + t;
451
- if (r.minRows || r.maxRows) {
452
- let i = getComputedStyle(e), a = parseFloat(i.lineHeight) || parseFloat(i.fontSize) * 1.5, o = parseFloat(i.paddingTop) + parseFloat(i.paddingBottom) + t, s = r.maxRows ? r.maxRows * a + o : Infinity;
453
- e.style.overflowY = n > s ? "auto" : "", n = Math.min(Math.max(n, r.minRows ? r.minRows * a + o : 0), s);
454
- }
455
- e.style.height = `${n}px`;
456
- }
457
- j(B), W(l, () => D(B));
458
- let U = ne(), G = F(""), ae;
459
- function K(e) {
460
- I.value = e.target.value, B(), T.value && (clearTimeout(ae), ae = setTimeout(() => {
461
- G.value = c.textarea.remaining(w.value - L.value, w.value);
462
- }, 1e3));
463
- }
464
- A(() => clearTimeout(ae));
465
- let q = m(() => [
466
- d?.value.ariaDescribedby,
467
- T.value && U,
468
- u["aria-describedby"]
469
- ].filter(Boolean).join(" ") || void 0);
470
- function oe() {
471
- let e = z.value?.$el;
472
- e && (Ve(e), e.focus());
473
- }
474
- return (e, n) => N.value ? (M(), _("div", {
475
- key: 1,
476
- class: O(P.value.base({ class: O(H(u).class) })),
477
- style: ee(H(u).style)
478
- }, [
479
- x(H(tt).Textarea, E({
480
- ref_key: "element",
481
- ref: z,
482
- modelValue: R.value,
483
- "onUpdate:modelValue": n[1] ||= (e) => R.value = e
484
- }, {
485
- ...H(u),
486
- class: void 0,
487
- style: void 0
488
- }, {
489
- class: H(o)({
490
- size: t.size,
491
- invalid: y.value,
492
- success: b.value,
493
- disabled: S.value,
494
- autoResize: t.autoResize,
495
- hasTrailing: k.value
496
- }),
497
- rows: H(u).rows ?? t.minRows,
498
- disabled: S.value || void 0,
499
- "aria-invalid": y.value || void 0,
500
- "aria-describedby": q.value,
501
- "aria-busy": t.loading || void 0,
502
- onInput: K
503
- }), null, 16, [
504
- "modelValue",
505
- "class",
506
- "rows",
507
- "disabled",
508
- "aria-invalid",
509
- "aria-describedby",
510
- "aria-busy"
511
- ]),
512
- k.value ? (M(), _("div", {
513
- key: 0,
514
- class: O(P.value.trailing())
515
- }, [x(a, {
516
- loading: t.loading,
517
- clear: t.clearable && L.value > 0 && !S.value && !C.value,
518
- "clear-label": t.clearLabel ?? H(c).field.clear,
519
- success: b.value,
520
- classes: {
521
- spinner: P.value.spinner(),
522
- clear: P.value.clear(),
523
- clearIcon: P.value.clearIcon(),
524
- statusIcon: P.value.statusIcon()
525
- },
526
- onClear: oe
527
- }, null, 8, [
528
- "loading",
529
- "clear",
530
- "clear-label",
531
- "success",
532
- "classes"
533
- ])], 2)) : g("", !0),
534
- T.value ? (M(), _(f, { key: 1 }, [v("span", {
535
- id: H(U),
536
- class: O(P.value.counter()),
537
- "aria-hidden": "true"
538
- }, V(H(c).textarea.counter(L.value, w.value)), 11, wt), v("span", {
539
- class: O(P.value.status()),
540
- role: "status"
541
- }, V(G.value), 3)], 64)) : g("", !0)
542
- ], 6)) : (M(), h(H(tt).Textarea, E({
543
- key: 0,
544
- ref_key: "element",
545
- ref: z,
546
- modelValue: R.value,
547
- "onUpdate:modelValue": n[0] ||= (e) => R.value = e
548
- }, {
549
- ...H(u),
550
- class: H(o)({
551
- size: t.size,
552
- invalid: y.value,
553
- success: b.value,
554
- disabled: S.value,
555
- autoResize: t.autoResize,
556
- class: O(H(u).class)
557
- })
558
- }, {
559
- rows: H(u).rows ?? t.minRows,
560
- disabled: S.value || void 0,
561
- "aria-invalid": y.value || void 0,
562
- onInput: K
563
- }), null, 16, [
564
- "modelValue",
565
- "rows",
566
- "disabled",
567
- "aria-invalid"
568
- ]));
569
- }
570
- }), Et = { "aria-hidden": "true" }, Dt = { "aria-hidden": "true" }, Ot = /* @__PURE__ */ S({
571
- inheritAttrs: !1,
572
- __name: "Pagination",
573
- props: {
574
- count: {},
575
- pageSize: { default: 10 },
576
- page: { default: void 0 },
577
- defaultPage: { default: void 0 },
578
- siblingCount: { default: 1 },
579
- boundaryCount: {},
580
- showSummary: {
581
- type: Boolean,
582
- default: !0
583
- },
584
- summary: {},
585
- pageSizes: {},
586
- jumper: { type: Boolean },
587
- variant: { default: "full" },
588
- withEdges: { type: Boolean },
589
- hideSinglePage: { type: Boolean },
590
- getPageHref: {},
591
- translations: {},
592
- classes: {}
593
- },
594
- emits: ["update:page", "update:pageSize"],
595
- setup(t, { emit: r }) {
596
- let i = t, a = n("pagination", Fe, () => i.classes), s = r, l = te(), u = m(() => a({ responsive: i.variant === "auto" })), d = e(), p = m(() => ({
597
- ...d.pagination,
598
- ...i.translations
599
- })), y = F(i.pageSize);
600
- W(() => i.pageSize, (e) => y.value = e);
601
- let S = (e) => ({
602
- start: Math.min((e - 1) * y.value + 1, i.count),
603
- end: Math.min(e * y.value, i.count),
604
- count: i.count
605
- }), C = m(() => i.hideSinglePage && i.count <= y.value), w = m(() => i.getPageHref ? "a" : "button"), T = (e) => i.getPageHref && e ? {
606
- role: "link",
607
- "aria-disabled": "true"
608
- } : {}, k = m(() => (i.pageSizes ?? []).map((e) => ({
609
- value: e,
610
- label: String(e)
611
- }))), ee = rt(m(() => ({
612
- count: i.count,
613
- pageSize: y.value,
614
- page: i.page,
615
- defaultPage: i.defaultPage,
616
- siblingCount: i.siblingCount,
617
- boundaryCount: i.boundaryCount,
618
- type: i.getPageHref ? "link" : "button",
619
- getPageUrl: i.getPageHref ? ({ page: e }) => i.getPageHref(e) : void 0,
620
- translations: p.value,
621
- onPageChange: ({ page: e }) => s("update:page", e)
622
- })));
623
- async function A(e, t) {
624
- if (!t || t === y.value) return;
625
- let n = Pe(e.page, y.value, t);
626
- y.value = t, s("update:pageSize", t), await D(), e.setPage(n);
627
- }
628
- function j(e, t) {
629
- let n = e.target, r = Number.parseInt(n.value, 10);
630
- Number.isNaN(r) || (e.preventDefault(), t.setPage(Math.min(Math.max(r, 1), t.totalPages)), n.value = "");
631
- }
632
- return (e, n) => C.value ? g("", !0) : (M(), h(H(Z).RootProvider, E({ key: 0 }, {
633
- ...H(l),
634
- class: u.value.base({ class: O(H(l).class) })
635
- }, { value: H(ee) }), {
636
- default: G(() => [x(H(Z).Context, null, {
637
- default: G((e) => [
638
- t.showSummary ? (M(), _("span", {
639
- key: 0,
640
- class: O(u.value.summary()),
641
- "aria-live": "polite"
642
- }, V((t.summary ?? H(d).pagination.summary)(S(e.page))), 3)) : g("", !0),
643
- t.pageSizes?.length ? (M(), _("div", {
644
- key: 1,
645
- class: O(u.value.pageSize())
646
- }, [v("span", Et, V(H(d).pagination.pageSize), 1), x(c, {
647
- class: O(u.value.pageSizeSelect()),
648
- size: "sm",
649
- items: k.value,
650
- "model-value": y.value,
651
- "aria-label": H(d).pagination.pageSize,
652
- "onUpdate:modelValue": (t) => A(e, t)
653
- }, null, 8, [
654
- "class",
655
- "items",
656
- "model-value",
657
- "aria-label",
658
- "onUpdate:modelValue"
659
- ])], 2)) : g("", !0),
660
- v("div", { class: O(u.value.list()) }, [
661
- t.withEdges ? (M(), h(H(Z).FirstTrigger, {
662
- key: 0,
663
- "as-child": ""
664
- }, {
665
- default: G(() => [(M(), h(z(w.value), E({ class: u.value.trigger() }, T(e.page === 1)), {
666
- default: G(() => [x(H(ue), {
667
- class: O(u.value.triggerIcon()),
668
- "aria-hidden": "true"
669
- }, null, 8, ["class"])]),
670
- _: 1
671
- }, 16, ["class"]))]),
672
- _: 2
673
- }, 1024)) : g("", !0),
674
- x(H(Z).PrevTrigger, { "as-child": "" }, {
675
- default: G(() => [(M(), h(z(w.value), E({ class: u.value.trigger() }, T(e.page === 1)), {
676
- default: G(() => [x(H(ce), {
677
- class: O(u.value.triggerIcon()),
678
- "aria-hidden": "true"
679
- }, null, 8, ["class"])]),
680
- _: 1
681
- }, 16, ["class"]))]),
682
- _: 2
683
- }, 1024),
684
- t.variant === "full" ? g("", !0) : (M(), _("span", {
685
- key: 1,
686
- class: O(u.value.compact())
687
- }, V(H(d).pagination.compact(e.page, e.totalPages)), 3)),
688
- t.variant === "compact" ? g("", !0) : (M(!0), _(f, { key: 2 }, I(e.pages, (e, t) => (M(), _(f, { key: t }, [e.type === "page" ? (M(), h(H(Z).Item, E({
689
- key: 0,
690
- ref_for: !0
691
- }, e, { "as-child": "" }), {
692
- default: G(() => [(M(), h(z(w.value), { class: O(u.value.item()) }, {
693
- default: G(() => [b(V(e.value), 1)]),
694
- _: 2
695
- }, 1032, ["class"]))]),
696
- _: 2
697
- }, 1040)) : (M(), h(H(Z).Ellipsis, {
698
- key: 1,
699
- index: t,
700
- class: O(u.value.ellipsis()),
701
- "aria-hidden": "true"
702
- }, {
703
- default: G(() => [...n[0] ||= [b(" … ", -1)]]),
704
- _: 1
705
- }, 8, ["index", "class"]))], 64))), 128)),
706
- x(H(Z).NextTrigger, { "as-child": "" }, {
707
- default: G(() => [(M(), h(z(w.value), E({ class: u.value.trigger() }, T(e.page === e.totalPages)), {
708
- default: G(() => [x(H(J), {
709
- class: O(u.value.triggerIcon()),
710
- "aria-hidden": "true"
711
- }, null, 8, ["class"])]),
712
- _: 1
713
- }, 16, ["class"]))]),
714
- _: 2
715
- }, 1024),
716
- t.withEdges ? (M(), h(H(Z).LastTrigger, {
717
- key: 3,
718
- "as-child": ""
719
- }, {
720
- default: G(() => [(M(), h(z(w.value), E({ class: u.value.trigger() }, T(e.page === e.totalPages)), {
721
- default: G(() => [x(H(de), {
722
- class: O(u.value.triggerIcon()),
723
- "aria-hidden": "true"
724
- }, null, 8, ["class"])]),
725
- _: 1
726
- }, 16, ["class"]))]),
727
- _: 2
728
- }, 1024)) : g("", !0)
729
- ], 2),
730
- t.jumper ? (M(), _("div", {
731
- key: 2,
732
- class: O(u.value.jumper())
733
- }, [v("span", Dt, V(H(d).pagination.jumper), 1), x(o, {
734
- class: O(u.value.jumperInput()),
735
- size: "sm",
736
- inputmode: "numeric",
737
- autocomplete: "off",
738
- "aria-label": H(d).pagination.jumper,
739
- onKeydown: K((t) => j(t, e), ["enter"])
740
- }, null, 8, [
741
- "class",
742
- "aria-label",
743
- "onKeydown"
744
- ])], 2)) : g("", !0)
745
- ]),
746
- _: 1
747
- })]),
748
- _: 1
749
- }, 16, ["value"]));
750
- }
751
- }), kt = /* @__PURE__ */ S({
752
- inheritAttrs: !1,
753
- __name: "Skeleton",
754
- props: {
755
- shape: {},
756
- width: {},
757
- height: {},
758
- classes: {}
759
- },
760
- setup(e) {
761
- let t = e, r = n("skeleton", He, () => t.classes), i = te(), a = (e) => typeof e == "number" ? `${e}px` : e, o = m(() => [{
762
- width: a(t.width),
763
- height: a(t.height)
764
- }, ee(i.style)]);
765
- return (t, n) => (M(), _("span", E({ "aria-hidden": "true" }, {
766
- ...H(i),
767
- class: H(r)({
768
- shape: e.shape,
769
- class: O(H(i).class)
770
- }),
771
- style: o.value
772
- }), null, 16));
773
- }
774
- }), At = ["title"], jt = ["title"], Mt = ["aria-label"], Nt = /* @__PURE__ */ S({
775
- __name: "DatePickerDayTable",
776
- props: {
777
- weeks: {},
778
- visibleRange: {},
779
- showWeekNumbers: { type: Boolean },
780
- plainToday: { type: Boolean },
781
- hideOutsideDays: { type: Boolean },
782
- weekendDays: {},
783
- allowDeselect: { type: Boolean }
784
- },
785
- setup(t) {
786
- let r = e(), i = t, a = n("datePicker", Y), o = m(() => a({
787
- plainToday: i.plainToday,
788
- hideOutsideDays: i.hideOutsideDays
789
- })), s = ot(), c = (e) => e.toString().slice(0, 10), l = (e) => !!i.visibleRange && (e.month !== i.visibleRange.start.month || e.year !== i.visibleRange.start.year), u = (e) => Be(e.map(c));
790
- function d(e) {
791
- let t = s.value.getDayTableCellState({
792
- value: e,
793
- visibleRange: i.visibleRange
794
- });
795
- return {
796
- day: e.day,
797
- today: t.today,
798
- selected: t.selected,
799
- outside: t.outsideRange,
800
- unavailable: t.unavailable || !!t.disabled,
801
- weekend: i.weekendDays ? i.weekendDays.includes(Ee(c(e))) : t.weekend
802
- };
803
- }
804
- let p = (e) => s.value.selectionMode === "single" && s.value.getDayTableCellState({
805
- value: e,
806
- visibleRange: i.visibleRange
807
- }).selected;
808
- function y(e, t) {
809
- e instanceof KeyboardEvent && e.key !== "Enter" && e.key !== " " || p(t) && (e.preventDefault(), s.value.clearValue({ focus: !1 }));
810
- }
811
- function S(e) {
812
- let t = {};
813
- return i.weekendDays?.includes(Ee(c(e))) && (t["data-weekend"] = ""), i.allowDeselect && (t.onClickCapture = (t) => y(t, e), t.onKeydownCapture = (t) => y(t, e)), t;
814
- }
815
- return (e, n) => (M(), h(H($).Table, { class: O(o.value.table()) }, {
816
- default: G(() => [x(H($).TableHead, null, {
817
- default: G(() => [x(H($).TableRow, null, {
818
- default: G(() => [t.showWeekNumbers ? (M(), _("th", {
819
- key: 0,
820
- scope: "col",
821
- class: O(o.value.weekNumberHeader())
822
- }, [v("abbr", { title: H(r).datePicker.weekColumnHeader }, V(H(r).datePicker.weekColumnShort), 9, At)], 2)) : g("", !0), (M(!0), _(f, null, I(H(s).weekDays, (e) => (M(), h(H($).TableHeader, {
823
- key: e.long,
824
- class: O(o.value.columnHeader())
825
- }, {
826
- default: G(() => [v("abbr", { title: e.long }, V(e.short), 9, jt)]),
827
- _: 2
828
- }, 1032, ["class"]))), 128))]),
829
- _: 1
830
- })]),
831
- _: 1
832
- }), x(H($).TableBody, null, {
833
- default: G(() => [(M(!0), _(f, null, I(t.weeks, (n) => (M(), h(H($).TableRow, { key: n[0]?.toString() }, {
834
- default: G(() => [t.showWeekNumbers ? (M(), _("th", {
835
- key: 0,
836
- scope: "row",
837
- class: O(o.value.weekNumber()),
838
- "aria-label": H(r).datePicker.weekNumberCell(u(n))
839
- }, V(u(n)), 11, Mt)) : g("", !0), (M(!0), _(f, null, I(n, (n) => (M(), _(f, { key: n.toString() }, [l(n) ? (M(), _("td", {
840
- key: 0,
841
- class: O(o.value.cell())
842
- }, null, 2)) : (M(), h(H($).TableCell, E({
843
- key: 1,
844
- value: n,
845
- "visible-range": t.visibleRange,
846
- class: o.value.cell()
847
- }, { ref_for: !0 }, S(n)), {
848
- default: G(() => [x(H($).TableCellTrigger, { class: O(o.value.day()) }, {
849
- default: G(() => [e.$slots.day ? (M(), _("span", {
850
- key: 0,
851
- class: O(o.value.dayContent())
852
- }, [L(e.$slots, "day", E({ date: c(n) }, { ref_for: !0 }, d(n)))], 2)) : (M(), _(f, { key: 1 }, [b(V(n.day), 1)], 64))]),
853
- _: 2
854
- }, 1032, ["class"])]),
855
- _: 2
856
- }, 1040, [
857
- "value",
858
- "visible-range",
859
- "class"
860
- ]))], 64))), 128))]),
861
- _: 2
862
- }, 1024))), 128))]),
863
- _: 3
864
- })]),
865
- _: 3
866
- }, 8, ["class"]));
867
- }
868
- }), Pt = /* @__PURE__ */ S({
869
- __name: "DatePickerHeader",
870
- setup(t) {
871
- let r = n("datePicker", Y), i = e(), a = r(), o = {
872
- day: "month",
873
- month: "year",
874
- year: void 0
875
- }, s = (e, t) => `${e}, ${i.datePicker.viewTrigger(t, o[t])}`;
876
- return (e, t) => (M(), h(H($).ViewControl, { class: O(H(a).header()) }, {
877
- default: G(() => [
878
- x(H($).PrevTrigger, { class: O(H(a).nav()) }, {
879
- default: G(() => [x(H(ce), {
880
- class: O(H(a).navIcon()),
881
- "aria-hidden": "true"
882
- }, null, 8, ["class"])]),
883
- _: 1
884
- }, 8, ["class"]),
885
- x(H($).Context, null, {
886
- default: G((e) => [x(H($).ViewTrigger, {
887
- class: O(H(a).viewTrigger()),
888
- "aria-label": s(e.numOfMonths > 1 && e.view === "day" ? e.visibleRangeText.formatted : e.visibleRangeText.start, e.view)
889
- }, {
890
- default: G(() => [x(H($).RangeText)]),
891
- _: 1
892
- }, 8, ["class", "aria-label"])]),
893
- _: 1
894
- }),
895
- x(H($).NextTrigger, { class: O(H(a).nav()) }, {
896
- default: G(() => [x(H(J), {
897
- class: O(H(a).navIcon()),
898
- "aria-hidden": "true"
899
- }, null, 8, ["class"])]),
900
- _: 1
901
- }, 8, ["class"])
902
- ]),
903
- _: 1
904
- }, 8, ["class"]));
905
- }
906
- }), Ft = ["onClick"], It = ["disabled", "onClick"], Lt = /* @__PURE__ */ S({
907
- __name: "DatePickerViews",
908
- props: {
909
- presets: {},
910
- showWeekNumbers: { type: Boolean },
911
- numberOfMonths: {},
912
- showButtonBar: { type: Boolean },
913
- plainToday: { type: Boolean },
914
- hideOutsideDays: { type: Boolean },
915
- weekendDays: {},
916
- allowDeselect: { type: Boolean },
917
- timeZone: {}
918
- },
919
- setup(t) {
920
- let r = e(), i = t, a = n("datePicker", Y)(), o = (e) => typeof e == "string" ? r.rangePresets[e] ?? e : e.label, s = m(() => Math.max(1, Math.floor(i.numberOfMonths ?? 1))), c = m(() => ({
921
- showWeekNumbers: i.showWeekNumbers,
922
- plainToday: i.plainToday,
923
- hideOutsideDays: i.hideOutsideDays || s.value > 1,
924
- weekendDays: i.weekendDays,
925
- allowDeselect: i.allowDeselect
926
- }));
927
- function l(e) {
928
- return Array.from({ length: s.value }, (t, n) => {
929
- let r = e.getOffset({ months: n }), i = e.visibleRange.start.add({ months: n });
930
- return {
931
- title: r.visibleRangeText.start,
932
- weeks: r.weeks,
933
- visibleRange: {
934
- start: i,
935
- end: i.add({ months: 1 }).subtract({ days: 1 })
936
- }
937
- };
938
- });
939
- }
940
- function u(e) {
941
- if (e.selectionMode === "single") return e.selectToday();
942
- let [t = 0, n = 1, r = 1] = Ze(i.timeZone).split("-").map(Number);
943
- e.setFocusedValue(e.focusedValue.set({
944
- year: t,
945
- month: n,
946
- day: r
947
- }));
948
- }
949
- return (e, n) => (M(), _(f, null, [
950
- x(H($).View, { view: "day" }, {
951
- default: G(() => [x(H($).Context, null, {
952
- default: G((t) => [x(Pt), s.value > 1 ? (M(), _("div", {
953
- key: 0,
954
- class: O(H(a).months())
955
- }, [(M(!0), _(f, null, I(l(t), (t) => (M(), _("div", {
956
- key: t.title,
957
- class: O(H(a).month())
958
- }, [v("div", { class: O(H(a).monthTitle()) }, V(t.title), 3), x(Nt, E({
959
- weeks: t.weeks,
960
- "visible-range": t.visibleRange
961
- }, { ref_for: !0 }, c.value), y({ _: 2 }, [e.$slots.day ? {
962
- name: "day",
963
- fn: G((t) => [L(e.$slots, "day", E({ ref_for: !0 }, t))]),
964
- key: "0"
965
- } : void 0]), 1040, ["weeks", "visible-range"])], 2))), 128))], 2)) : (M(), h(Nt, E({
966
- key: 1,
967
- weeks: t.weeks
968
- }, c.value), y({ _: 2 }, [e.$slots.day ? {
969
- name: "day",
970
- fn: G((t) => [L(e.$slots, "day", k(C(t)))]),
971
- key: "0"
972
- } : void 0]), 1040, ["weeks"]))]),
973
- _: 3
974
- })]),
975
- _: 3
976
- }),
977
- x(H($).View, { view: "month" }, {
978
- default: G(() => [x(H($).Context, null, {
979
- default: G((e) => [x(Pt), x(H($).Table, { class: O(H(a).table()) }, {
980
- default: G(() => [x(H($).TableBody, null, {
981
- default: G(() => [(M(!0), _(f, null, I(e.getMonthsGrid({
982
- columns: 4,
983
- format: "short"
984
- }), (e) => (M(), h(H($).TableRow, { key: e[0]?.value }, {
985
- default: G(() => [(M(!0), _(f, null, I(e, (e) => (M(), h(H($).TableCell, {
986
- key: e.value,
987
- value: e.value,
988
- class: O(H(a).cell())
989
- }, {
990
- default: G(() => [x(H($).TableCellTrigger, { class: O(H(a).period()) }, {
991
- default: G(() => [b(V(e.label), 1)]),
992
- _: 2
993
- }, 1032, ["class"])]),
994
- _: 2
995
- }, 1032, ["value", "class"]))), 128))]),
996
- _: 2
997
- }, 1024))), 128))]),
998
- _: 2
999
- }, 1024)]),
1000
- _: 2
1001
- }, 1032, ["class"])]),
1002
- _: 1
1003
- })]),
1004
- _: 1
1005
- }),
1006
- x(H($).View, { view: "year" }, {
1007
- default: G(() => [x(H($).Context, null, {
1008
- default: G((e) => [x(Pt), x(H($).Table, { class: O(H(a).table()) }, {
1009
- default: G(() => [x(H($).TableBody, null, {
1010
- default: G(() => [(M(!0), _(f, null, I(e.getYearsGrid({ columns: 4 }), (e) => (M(), h(H($).TableRow, { key: e[0]?.value }, {
1011
- default: G(() => [(M(!0), _(f, null, I(e, (e) => (M(), h(H($).TableCell, {
1012
- key: e.value,
1013
- value: e.value,
1014
- class: O(H(a).cell())
1015
- }, {
1016
- default: G(() => [x(H($).TableCellTrigger, { class: O(H(a).period()) }, {
1017
- default: G(() => [b(V(e.label), 1)]),
1018
- _: 2
1019
- }, 1032, ["class"])]),
1020
- _: 2
1021
- }, 1032, ["value", "class"]))), 128))]),
1022
- _: 2
1023
- }, 1024))), 128))]),
1024
- _: 2
1025
- }, 1024)]),
1026
- _: 2
1027
- }, 1032, ["class"])]),
1028
- _: 1
1029
- })]),
1030
- _: 1
1031
- }),
1032
- t.presets?.length ? (M(), _("div", {
1033
- key: 0,
1034
- class: O(H(a).presets())
1035
- }, [(M(!0), _(f, null, I(t.presets, (e) => (M(), h(H($).PresetTrigger, {
1036
- key: o(e),
1037
- value: typeof e == "string" ? e : e.value,
1038
- class: O(H(a).preset()),
1039
- "aria-label": o(e)
1040
- }, {
1041
- default: G(() => [b(V(o(e)), 1)]),
1042
- _: 2
1043
- }, 1032, [
1044
- "value",
1045
- "class",
1046
- "aria-label"
1047
- ]))), 128))], 2)) : g("", !0),
1048
- t.showButtonBar ? (M(), h(H($).Context, { key: 1 }, {
1049
- default: G((e) => [v("div", { class: O(H(a).buttonBar()) }, [v("button", {
1050
- type: "button",
1051
- class: O(H(a).buttonBarButton()),
1052
- onClick: (t) => u(e)
1053
- }, V(H(r).calendar.today), 11, Ft), v("button", {
1054
- type: "button",
1055
- class: O(H(a).buttonBarButton()),
1056
- disabled: !e.value.length,
1057
- onClick: (t) => e.clearValue({ focus: !1 })
1058
- }, V(H(r).calendar.clear), 11, It)], 2)]),
1059
- _: 1
1060
- })) : g("", !0)
1061
- ], 64));
1062
- }
1063
- }), Rt = /* @__PURE__ */ S({
1064
- __name: "DatePickerCalendar",
1065
- props: {
1066
- presets: {},
1067
- responsive: { type: Boolean },
1068
- showWeekNumbers: { type: Boolean },
1069
- numberOfMonths: {},
1070
- showButtonBar: { type: Boolean },
1071
- plainToday: { type: Boolean },
1072
- hideOutsideDays: { type: Boolean },
1073
- weekendDays: {},
1074
- allowDeselect: { type: Boolean },
1075
- timeZone: {}
1076
- },
1077
- setup(e) {
1078
- let t = e, r = n("datePicker", Y), i = r(), a = m(() => ({
1079
- presets: t.presets,
1080
- showWeekNumbers: t.showWeekNumbers,
1081
- numberOfMonths: t.numberOfMonths,
1082
- showButtonBar: t.showButtonBar,
1083
- plainToday: t.plainToday,
1084
- hideOutsideDays: t.hideOutsideDays,
1085
- weekendDays: t.weekendDays,
1086
- allowDeselect: t.allowDeselect,
1087
- timeZone: t.timeZone
1088
- })), o = m(() => (t.numberOfMonths ?? 1) > 1), s = F(!1), c, l = () => s.value = !!c?.matches;
1089
- return j(() => {
1090
- t.responsive && typeof window.matchMedia == "function" && (c = window.matchMedia("(max-width: 639.98px)"), l(), c.addEventListener("change", l));
1091
- }), A(() => c?.removeEventListener("change", l)), (e, t) => (M(), h(p, { to: "body" }, [s.value ? (M(), _(f, { key: 0 }, [x(H($).Context, null, {
1092
- default: G((e) => [e.open ? (M(), _("div", {
1093
- key: 0,
1094
- class: O(H(i).backdrop()),
1095
- "aria-hidden": "true"
1096
- }, null, 2)) : g("", !0)]),
1097
- _: 1
1098
- }), v("div", { class: O(H(i).sheet()) }, [x(H($).Content, { class: O(H(r)({
1099
- multiMonth: o.value,
1100
- bottomSheet: !0
1101
- }).content()) }, {
1102
- default: G(() => [x(Lt, k(C(a.value)), y({ _: 2 }, [e.$slots.day ? {
1103
- name: "day",
1104
- fn: G((t) => [L(e.$slots, "day", k(C(t)))]),
1105
- key: "0"
1106
- } : void 0]), 1040)]),
1107
- _: 3
1108
- }, 8, ["class"])], 2)], 64)) : (M(), h(H($).Positioner, { key: 1 }, {
1109
- default: G(() => [x(H($).Content, { class: O(o.value ? H(r)({ multiMonth: o.value }).content() : H(i).content()) }, {
1110
- default: G(() => [x(Lt, k(C(a.value)), y({ _: 2 }, [e.$slots.day ? {
1111
- name: "day",
1112
- fn: G((t) => [L(e.$slots, "day", k(C(t)))]),
1113
- key: "0"
1114
- } : void 0]), 1040)]),
1115
- _: 3
1116
- }, 8, ["class"])]),
1117
- _: 3
1118
- }))]));
1119
- }
1120
- }), zt = /* @__PURE__ */ S({
1121
- __name: "DateSegments",
1122
- props: {
1123
- index: {},
1124
- label: {},
1125
- describedby: {},
1126
- paste: { type: Function },
1127
- size: {}
1128
- },
1129
- setup(t) {
1130
- let r = e(), i = t;
1131
- function a(e) {
1132
- let t = e.clipboardData?.getData("text/plain") ?? "";
1133
- i.paste?.(t, i.index) && (e.preventDefault(), e.stopPropagation());
1134
- }
1135
- let o = n("datePicker", Y), s = m(() => o({ size: i.size }));
1136
- return (e, n) => (M(), h(H(at).SegmentGroup, E({
1137
- index: t.index,
1138
- class: s.value.segments(),
1139
- "aria-label": t.label,
1140
- "aria-describedby": t.describedby
1141
- }, t.paste ? { onPasteCapture: a } : {}), {
1142
- default: G(() => [x(H(at).Context, null, {
1143
- default: G((e) => [(M(!0), _(f, null, I(e.getSegments({ index: t.index }), (e, t) => (M(), h(H(at).Segment, {
1144
- key: t,
1145
- segment: e,
1146
- class: O(s.value.segment()),
1147
- "aria-label": H(r).dateSegments[e.type]
1148
- }, null, 8, [
1149
- "segment",
1150
- "class",
1151
- "aria-label"
1152
- ]))), 128))]),
1153
- _: 1
1154
- })]),
1155
- _: 1
1156
- }, 16, [
1157
- "index",
1158
- "class",
1159
- "aria-label",
1160
- "aria-describedby"
1161
- ]));
1162
- }
1163
- }), Bt = (e, t) => e ? e.toString().slice(0, t ? 16 : 10) : null;
1164
- function Vt(e, t, n) {
1165
- return t ? e.includes("T") ? dt(e.slice(0, 16)) : dt(`${e}T${n === "max" ? "23:59" : "00:00"}`) : ut(e.slice(0, 10));
1166
- }
1167
- function Ht(e, t, n, r) {
1168
- let i = typeof e == "string" && !e.includes("T"), a = Xe(e, t && !i, n);
1169
- return a ? Vt(a, t, r) : void 0;
1170
- }
1171
- var Ut = (e, t, n, r) => Ce(Bt(e, t), {
1172
- valueType: n,
1173
- timeZone: r,
1174
- withTime: t
1175
- }), Wt = (e, t, n) => Xe(e, t, n);
1176
- function Gt(e, t) {
1177
- if (!e && !t?.length) return;
1178
- let n = new Set(t?.map((e) => Xe(e, !1)));
1179
- return (t) => {
1180
- let r = Bt(t, !1);
1181
- return n.has(r) || !!e?.(r);
1182
- };
1183
- }
1184
- function Kt(e, t) {
1185
- if ("hour" in e) return e;
1186
- let n = t && "hour" in t ? new lt(t.hour, t.minute) : new lt();
1187
- return ft(e, n);
1188
- }
1189
- var qt = {
1190
- year: 2e3,
1191
- month: 1,
1192
- day: 1
1193
- };
1194
- function Jt(e) {
1195
- let [t = 0, n = 0, r = 0] = e.split(":").map(Number);
1196
- return new st(qt.year, qt.month, qt.day, t, n, r);
1197
- }
1198
- var Yt = (e) => String(e).padStart(2, "0"), Xt = (e, t = !1) => e && "hour" in e ? `${Yt(e.hour)}:${Yt(e.minute)}${t ? `:${Yt(e.second)}` : ""}` : null, Zt = (e, t, n, r = !1) => Ge(e, t, n, r), Qt = ["id", "data-placeholder"], $t = ["name", "value"], en = ["id"], tn = ["id"], nn = /* @__PURE__ */ S({
1199
- __name: "DatePickerBase",
1200
- props: {
1201
- mode: {},
1202
- dates: {},
1203
- withTime: { type: Boolean },
1204
- min: {},
1205
- max: {},
1206
- isDateUnavailable: { type: Function },
1207
- locale: {},
1208
- disabled: { type: Boolean },
1209
- readOnly: { type: Boolean },
1210
- invalid: { type: Boolean },
1211
- required: { type: Boolean },
1212
- name: {},
1213
- label: {},
1214
- className: {},
1215
- period: {},
1216
- classes: {},
1217
- presets: {},
1218
- size: {},
1219
- hideClear: { type: Boolean },
1220
- firstDayOfWeek: {},
1221
- timeZone: {},
1222
- showTimeZone: { type: Boolean },
1223
- responsive: { type: Boolean },
1224
- showWeekNumbers: { type: Boolean },
1225
- numberOfMonths: {},
1226
- showButtonBar: { type: Boolean },
1227
- plainToday: { type: Boolean },
1228
- hideOutsideDays: { type: Boolean },
1229
- weekendDays: {},
1230
- allowDeselect: { type: Boolean }
1231
- },
1232
- emits: ["change"],
1233
- setup(t, { emit: r }) {
1234
- let i = e(), a = t, o = n("datePicker", Y, () => a.classes), s = r, c = m(() => o({ size: a.size })), l = ne(), u = nt(), d = m(() => ({
1235
- disabled: a.disabled ?? u?.value.disabled,
1236
- readOnly: a.readOnly ?? u?.value.readOnly,
1237
- invalid: a.invalid ?? u?.value.invalid,
1238
- required: a.required ?? u?.value.required
1239
- })), p = a.mode === "range", b = a.mode === "multiple", S = p ? "range" : "single", w = p ? [0, 1] : [0], T = [i.dateRange.start, i.dateRange.end], D = m(() => u?.value ? { label: (e) => p ? `${u.value.ids.label} ${l}r${e}` : u.value.ids.label } : void 0), ee = (e) => u?.value ? void 0 : p ? [a.label, T[e]].filter(Boolean).join(", ") : a.label, A = p ? {
1240
- ...i.datePicker,
1241
- clearTrigger: i.dateRange.clearTrigger
1242
- } : i.datePicker, j = m(() => a.period ? new ct(a.locale, a.period === "month" ? {
1243
- month: "2-digit",
1244
- year: "numeric"
1245
- } : { year: "numeric" }) : void 0), N = m(() => a.firstDayOfWeek ?? Oe(a.locale).firstDay), P = m(() => {
1246
- if (!a.showTimeZone || !a.timeZone) return;
1247
- let e = a.dates[0], t = e ? $e(e.toString().slice(0, 16), a.timeZone) : /* @__PURE__ */ new Date();
1248
- return {
1249
- short: Ke(a.timeZone, a.locale, t),
1250
- long: i.calendar.timeZone(qe(a.timeZone, a.locale, t))
1251
- };
1252
- }), F = m(() => [u?.value.ariaDescribedby, P.value ? `${l}tz` : void 0].filter(Boolean).join(" ") || void 0), R = m(() => {
1253
- if (!a.dates.length) return i.calendar.noDates;
1254
- if (a.dates.length > 3) return ze(i.calendar.datesSelected, a.dates.length, a.locale);
1255
- let e = new ct(a.locale, {
1256
- day: "2-digit",
1257
- month: "2-digit",
1258
- year: "numeric",
1259
- timeZone: "UTC"
1260
- });
1261
- return a.dates.map((t) => e.format(t.toDate("UTC"))).join(", ");
1262
- }), z = m(() => ({
1263
- presets: a.presets,
1264
- showWeekNumbers: a.showWeekNumbers,
1265
- numberOfMonths: a.numberOfMonths,
1266
- showButtonBar: a.showButtonBar,
1267
- plainToday: a.plainToday,
1268
- hideOutsideDays: a.hideOutsideDays,
1269
- weekendDays: a.weekendDays,
1270
- allowDeselect: a.allowDeselect,
1271
- timeZone: a.timeZone,
1272
- responsive: a.responsive
1273
- }));
1274
- function B(e) {
1275
- s("change", a.withTime ? e.map((e, t) => Kt(e, a.dates[t])) : e);
1276
- }
1277
- function te(e, t) {
1278
- if (a.period) return !1;
1279
- if (p) {
1280
- let t = Re(e, a.locale, a.withTime);
1281
- if (t) return s("change", [Vt(t.start, a.withTime), Vt(t.end, a.withTime)]), !0;
1282
- }
1283
- let n = Le(e, a.locale, a.withTime);
1284
- if (!n) return !1;
1285
- let r = [...a.dates];
1286
- return r[t] = Vt(n, a.withTime), s("change", r.filter(Boolean)), !0;
1287
- }
1288
- let re = {
1289
- placement: "bottom-start",
1290
- gutter: 4
1291
- };
1292
- return (e, n) => (M(), h(H($).Root, E({
1293
- class: c.value.base({ class: t.className }),
1294
- "model-value": t.dates,
1295
- "selection-mode": t.mode,
1296
- min: t.min,
1297
- max: t.max,
1298
- "is-date-unavailable": t.isDateUnavailable,
1299
- locale: t.locale,
1300
- "start-of-week": N.value,
1301
- "min-view": t.period,
1302
- "default-view": t.period,
1303
- "num-of-months": t.numberOfMonths,
1304
- "time-zone": t.timeZone
1305
- }, d.value, {
1306
- positioning: re,
1307
- translations: H(A),
1308
- "lazy-mount": "",
1309
- "unmount-on-exit": "",
1310
- onValueChange: n[1] ||= (e) => B(e.value)
1311
- }), {
1312
- default: G(() => [x(H($).Control, { class: O(c.value.control()) }, {
1313
- default: G(() => [
1314
- b ? (M(), _(f, { key: 0 }, [v("span", {
1315
- id: `${H(l)}v`,
1316
- class: O(c.value.multiValue()),
1317
- "data-placeholder": t.dates.length ? void 0 : ""
1318
- }, V(R.value), 11, Qt), t.name ? (M(!0), _(f, { key: 0 }, I(t.dates, (e, n) => (M(), _("input", {
1319
- key: e.toString(),
1320
- type: "hidden",
1321
- name: `${t.name}[${n}]`,
1322
- value: e.toString()
1323
- }, null, 8, $t))), 128)) : g("", !0)], 64)) : (M(), h(H(at).Root, E({
1324
- key: 1,
1325
- class: c.value.dateInput(),
1326
- ids: D.value,
1327
- "model-value": t.dates,
1328
- "selection-mode": H(S),
1329
- granularity: t.withTime ? "minute" : "day",
1330
- formatter: j.value,
1331
- min: t.min,
1332
- max: t.max,
1333
- "is-date-unavailable": t.isDateUnavailable,
1334
- locale: t.locale,
1335
- "should-force-leading-zeros": "",
1336
- name: t.name
1337
- }, d.value, {
1338
- translations: H(i).dateInput,
1339
- onValueChange: n[0] ||= (e) => s("change", e.value)
1340
- }), {
1341
- default: G(() => [x(H(at).Control, { class: O(c.value.dateControl()) }, {
1342
- default: G(() => [(M(!0), _(f, null, I(H(w), (e) => (M(), _(f, { key: e }, [
1343
- e === 1 ? (M(), _("span", {
1344
- key: 0,
1345
- class: O(c.value.rangeSeparator()),
1346
- "aria-hidden": "true"
1347
- }, "–", 2)) : g("", !0),
1348
- p && H(u) ? (M(), _("span", {
1349
- key: 1,
1350
- id: `${H(l)}r${e}`,
1351
- class: O(c.value.rangeLabel())
1352
- }, V(T[e]), 11, en)) : g("", !0),
1353
- x(zt, {
1354
- index: e,
1355
- label: ee(e),
1356
- describedby: F.value,
1357
- paste: t.period ? void 0 : te,
1358
- size: t.size
1359
- }, null, 8, [
1360
- "index",
1361
- "label",
1362
- "describedby",
1363
- "paste",
1364
- "size"
1365
- ])
1366
- ], 64))), 128))]),
1367
- _: 1
1368
- }, 8, ["class"]), (M(!0), _(f, null, I(H(w), (e) => (M(), h(H(at).HiddenInput, {
1369
- key: e,
1370
- index: e
1371
- }, null, 8, ["index"]))), 128))]),
1372
- _: 1
1373
- }, 16, [
1374
- "class",
1375
- "ids",
1376
- "model-value",
1377
- "selection-mode",
1378
- "granularity",
1379
- "formatter",
1380
- "min",
1381
- "max",
1382
- "is-date-unavailable",
1383
- "locale",
1384
- "name",
1385
- "translations"
1386
- ])),
1387
- P.value ? (M(), _(f, { key: 2 }, [v("span", {
1388
- class: O(c.value.timeZone()),
1389
- "aria-hidden": "true"
1390
- }, V(P.value.short), 3), v("span", {
1391
- id: `${H(l)}tz`,
1392
- hidden: ""
1393
- }, V(P.value.long), 9, tn)], 64)) : g("", !0),
1394
- t.hideClear ? g("", !0) : (M(), h(H($).ClearTrigger, {
1395
- key: 3,
1396
- class: O(c.value.clear())
1397
- }, {
1398
- default: G(() => [x(H(ge), {
1399
- class: O(c.value.clearIcon()),
1400
- "aria-hidden": "true"
1401
- }, null, 8, ["class"])]),
1402
- _: 1
1403
- }, 8, ["class"])),
1404
- x(H($).Trigger, E({ class: c.value.trigger() }, b ? { "aria-describedby": `${H(l)}v` } : {}), {
1405
- default: G(() => [x(H(q), {
1406
- class: O(c.value.triggerIcon()),
1407
- "aria-hidden": "true"
1408
- }, null, 8, ["class"])]),
1409
- _: 1
1410
- }, 16, ["class"])
1411
- ]),
1412
- _: 1
1413
- }, 8, ["class"]), x(Rt, k(C(z.value)), y({ _: 2 }, [e.$slots.day ? {
1414
- name: "day",
1415
- fn: G((t) => [L(e.$slots, "day", k(C(t)))]),
1416
- key: "0"
1417
- } : void 0]), 1040)]),
1418
- _: 3
1419
- }, 16, [
1420
- "class",
1421
- "model-value",
1422
- "selection-mode",
1423
- "min",
1424
- "max",
1425
- "is-date-unavailable",
1426
- "locale",
1427
- "start-of-week",
1428
- "min-view",
1429
- "default-view",
1430
- "num-of-months",
1431
- "time-zone",
1432
- "translations"
1433
- ]));
1434
- }
1435
- }), rn = /* @__PURE__ */ S({
1436
- inheritAttrs: !1,
1437
- __name: "DatePicker",
1438
- props: {
1439
- modelValue: { default: void 0 },
1440
- defaultValue: { default: void 0 },
1441
- selectionMode: { default: "single" },
1442
- valueType: { default: "string" },
1443
- withTime: {
1444
- type: Boolean,
1445
- default: !1
1446
- },
1447
- min: {},
1448
- max: {},
1449
- isDateUnavailable: {},
1450
- excludeDates: {},
1451
- locale: {},
1452
- disabled: {
1453
- type: Boolean,
1454
- default: void 0
1455
- },
1456
- readOnly: {
1457
- type: Boolean,
1458
- default: void 0
1459
- },
1460
- invalid: {
1461
- type: Boolean,
1462
- default: void 0
1463
- },
1464
- required: {
1465
- type: Boolean,
1466
- default: void 0
1467
- },
1468
- name: {},
1469
- size: {},
1470
- clearable: {
1471
- type: Boolean,
1472
- default: !0
1473
- },
1474
- showButtonBar: { type: Boolean },
1475
- showWeekNumbers: { type: Boolean },
1476
- numberOfMonths: {},
1477
- highlightToday: {
1478
- type: Boolean,
1479
- default: !0
1480
- },
1481
- hideOutsideDays: { type: Boolean },
1482
- firstDayOfWeek: {},
1483
- weekendDays: {},
1484
- allowDeselect: { type: Boolean },
1485
- timeZone: {},
1486
- showTimeZone: { type: Boolean },
1487
- responsive: { type: Boolean },
1488
- classes: {}
1489
- },
1490
- emits: ["update:modelValue"],
1491
- setup(e, { emit: n }) {
1492
- let i = t(), a = e, o = m(() => a.locale ?? i.value.locale), s = n, c = te(), l = m(() => r(c)), u = m(() => l.value.rest["aria-label"]), d = F(a.defaultValue ?? null), f = m(() => a.modelValue === void 0 ? d.value : a.modelValue), p = m(() => Array.isArray(f.value) ? f.value : f.value ? [f.value] : []), g = m(() => p.value.map((e) => Ht(e, a.withTime, a.timeZone)).filter((e) => !!e)), _ = (e) => e.map((e) => Wt(e, a.withTime, a.timeZone)).join();
1493
- function v(e) {
1494
- let t = e.map((e) => Ut(e, a.withTime, a.valueType, a.timeZone));
1495
- if (_(t) === _(p.value)) return;
1496
- let n = a.selectionMode === "multiple" ? t : t[0] ?? null;
1497
- d.value = n, s("update:modelValue", n);
1498
- }
1499
- let b = m(() => ({
1500
- min: Ht(a.min, a.withTime, a.timeZone, "min"),
1501
- max: Ht(a.max, a.withTime, a.timeZone, "max")
1502
- })), x = m(() => Gt(a.isDateUnavailable, a.excludeDates));
1503
- return (t, n) => (M(), h(nn, E({
1504
- mode: e.selectionMode,
1505
- dates: g.value,
1506
- "with-time": e.withTime
1507
- }, b.value, {
1508
- "is-date-unavailable": x.value,
1509
- locale: o.value,
1510
- disabled: e.disabled,
1511
- "read-only": e.readOnly,
1512
- invalid: e.invalid,
1513
- required: e.required,
1514
- name: e.name,
1515
- label: u.value,
1516
- classes: e.classes,
1517
- "class-name": l.value.className,
1518
- style: l.value.style,
1519
- size: e.size,
1520
- "hide-clear": !e.clearable,
1521
- "show-button-bar": e.showButtonBar,
1522
- "show-week-numbers": e.showWeekNumbers,
1523
- "number-of-months": e.numberOfMonths,
1524
- "plain-today": !e.highlightToday,
1525
- "hide-outside-days": e.hideOutsideDays,
1526
- "first-day-of-week": e.firstDayOfWeek,
1527
- "weekend-days": e.weekendDays,
1528
- "allow-deselect": e.allowDeselect,
1529
- "time-zone": e.timeZone,
1530
- "show-time-zone": e.showTimeZone,
1531
- responsive: e.responsive,
1532
- onChange: v
1533
- }), y({ _: 2 }, [t.$slots.day ? {
1534
- name: "day",
1535
- fn: G((e) => [L(t.$slots, "day", k(C(e)))]),
1536
- key: "0"
1537
- } : void 0]), 1040, /* @__PURE__ */ "mode.dates.with-time.is-date-unavailable.locale.disabled.read-only.invalid.required.name.label.classes.class-name.style.size.hide-clear.show-button-bar.show-week-numbers.number-of-months.plain-today.hide-outside-days.first-day-of-week.weekend-days.allow-deselect.time-zone.show-time-zone.responsive".split(".")));
1538
- }
1539
- }), an = ["aria-label", "onClick"], on = ["data-placeholder-shown"], sn = ["data-placeholder-shown"], cn = ["aria-label", "onClick"], ln = [
1540
- "aria-controls",
1541
- "aria-activedescendant",
1542
- "aria-label",
1543
- "placeholder",
1544
- "value",
1545
- "onInput"
1546
- ], un = ["aria-checked"], dn = ["data-state"], fn = /* @__PURE__ */ S({
1547
- inheritAttrs: !1,
1548
- __name: "MultiSelect",
1549
- props: {
1550
- items: {},
1551
- modelValue: { default: void 0 },
1552
- defaultValue: { default: void 0 },
1553
- placeholder: {},
1554
- summary: {},
1555
- maxShown: { default: 2 },
1556
- disabled: {
1557
- type: Boolean,
1558
- default: void 0
1559
- },
1560
- invalid: {
1561
- type: Boolean,
1562
- default: void 0
1563
- },
1564
- required: {
1565
- type: Boolean,
1566
- default: void 0
1567
- },
1568
- name: {},
1569
- itemValue: {},
1570
- itemLabel: {},
1571
- itemDisabled: {},
1572
- itemGroup: {},
1573
- valueKey: {},
1574
- display: { default: "text" },
1575
- checkboxes: {
1576
- type: Boolean,
1577
- default: !0
1578
- },
1579
- selectAll: { type: Boolean },
1580
- max: {},
1581
- clearable: { type: Boolean },
1582
- loading: { type: Boolean },
1583
- loadingText: {},
1584
- size: {},
1585
- filter: { type: Boolean },
1586
- manualFilter: { type: Boolean },
1587
- emptyText: {},
1588
- hasMore: { type: Boolean },
1589
- dataSource: {},
1590
- minSearchLength: {},
1591
- pageSize: {},
1592
- classes: {}
1593
- },
1594
- emits: [
1595
- "update:modelValue",
1596
- "filterChange",
1597
- "loadMore"
1598
- ],
1599
- setup(t, { emit: i }) {
1600
- let a = e(), o = t, c = n("multiSelect", je, () => o.classes), S = i, w = te(), T = m(() => r(w)), A = m(() => o.display === "chips"), N = m(() => c({
1601
- size: o.size,
1602
- clearable: o.clearable && !A.value
1603
- })), P = a.select, R = m(() => ({
1604
- itemValue: o.itemValue,
1605
- itemLabel: o.itemLabel,
1606
- itemDisabled: o.itemDisabled,
1607
- itemGroup: o.itemGroup,
1608
- valueKey: o.valueKey
1609
- })), z = F(""), B = l({
1610
- items: () => o.items,
1611
- source: () => o.dataSource,
1612
- accessors: () => R.value,
1613
- pageSize: () => o.pageSize,
1614
- minSearchLength: () => o.minSearchLength
1615
- }), { options: re, visible: ie, groups: U, ordered: ae } = u(() => B.items.value, () => R.value, () => o.filter && !o.manualFilter && !o.dataSource ? z.value : ""), K = m(() => [...re.value, ...B.resolvedOptions.value]), { selected: q, keys: ce, commit: J, commitKeys: le } = d({
1616
- multiple: !0,
1617
- model: () => o.modelValue,
1618
- defaultValue: o.defaultValue,
1619
- accessors: () => R.value,
1620
- items: K,
1621
- emit: (e) => S("update:modelValue", e)
1622
- });
1623
- j(() => B.resolve(ce.value, K.value)), W(ce, (e) => B.resolve(e, K.value));
1624
- let ue = m(() => o.loading || B.loading.value), de = m(() => o.hasMore || B.hasMore.value);
1625
- function fe() {
1626
- o.dataSource ? B.loadMore() : S("loadMore");
1627
- }
1628
- let he = m(() => o.max !== void 0 && q.value.length >= o.max), _e = m(() => {
1629
- let e = new Set(ce.value);
1630
- return it({
1631
- items: ae.value,
1632
- itemToString: (e) => e.label,
1633
- itemToValue: (e) => e.key,
1634
- isItemDisabled: (t) => t.disabled || he.value && !e.has(t.key)
1635
- });
1636
- }), ye = m(() => o.filter || o.selectAll), be = ne(), Y = m(() => o.emptyText ?? B.emptyText.value ?? (z.value ? a.common.noResults : a.common.empty)), xe = m(() => ({
1637
- item: N.value.item(),
1638
- itemText: N.value.itemText(),
1639
- icon: N.value.icon(),
1640
- itemIndicator: N.value.itemIndicator(),
1641
- itemBody: N.value.itemBody(),
1642
- itemDescription: N.value.itemDescription(),
1643
- group: N.value.group(),
1644
- groupLabel: N.value.groupLabel(),
1645
- loading: N.value.loading(),
1646
- loadingIcon: N.value.loadingIcon(),
1647
- sentinel: N.value.sentinel(),
1648
- empty: N.value.empty(),
1649
- check: N.value.check(),
1650
- checkIcon: N.value.checkIcon()
1651
- })), Se = m(() => q.value.length ? q.value.length > o.maxShown ? (o.summary ?? a.common.selectedCount)(q.value.length) : q.value.map((e) => e.label).join(", ") : o.placeholder ?? a.common.placeholder), Ce = m(() => ie.value.filter((e) => !e.disabled)), we = m(() => ve(q.value, Ce.value)), Te = F("");
1652
- function Ee(e) {
1653
- let t = o.max !== void 0 && e.length >= o.max && q.value.length < o.max;
1654
- J(e), t && (Te.value = P.maxReached(o.max));
1655
- }
1656
- function De(e, t) {
1657
- let n = o.max !== void 0 && e.length >= o.max && q.value.length < o.max;
1658
- le(e, t), n && (Te.value = P.maxReached(o.max));
1659
- }
1660
- function Oe(e) {
1661
- J(q.value.filter((t) => t.key !== e.key)), Te.value = P.removed(e.label);
1662
- }
1663
- function ke(e) {
1664
- let t = q.value.at(-1);
1665
- t && (A.value && e.key === "Backspace" ? (e.preventDefault(), Oe(t)) : o.clearable && (e.key === "Delete" || e.key === "Backspace") && (e.preventDefault(), J([])));
1666
- }
1667
- function Ae(e) {
1668
- J([]), e.focus();
1669
- }
1670
- function Me(e, t) {
1671
- z.value = t.target.value, S("filterChange", z.value), o.dataSource && B.search(z.value), !(o.manualFilter || o.dataSource) && D(() => {
1672
- let t = ae.value.find((e) => !e.disabled);
1673
- t && e.setHighlightValue(t.key);
1674
- });
1675
- }
1676
- function Ne(e) {
1677
- (e.key === " " || e.key === "Home" || e.key === "End") && e.stopPropagation();
1678
- }
1679
- function Pe(e) {
1680
- (e.key === " " || e.key === "Enter") && e.stopPropagation();
1681
- }
1682
- function Fe(e) {
1683
- e && B.open(), !e && z.value && (z.value = "", S("filterChange", ""), o.dataSource && B.search(""));
1684
- }
1685
- let Ie = (e) => e.highlightedItem ? e.getItemProps({ item: e.highlightedItem }).id : void 0, Le = {
1686
- sameWidth: !0,
1687
- gutter: 4
1688
- };
1689
- return (e, n) => (M(), h(H(Q).Root, {
1690
- class: O(N.value.base({ class: T.value.className })),
1691
- style: ee(T.value.style),
1692
- collection: _e.value,
1693
- multiple: "",
1694
- "close-on-select": !1,
1695
- "model-value": H(ce),
1696
- disabled: t.disabled,
1697
- invalid: t.invalid,
1698
- required: t.required,
1699
- name: t.name,
1700
- positioning: Le,
1701
- composite: !ye.value,
1702
- "lazy-mount": "",
1703
- "unmount-on-exit": "",
1704
- onValueChange: n[1] ||= (e) => De(e.value, e.items),
1705
- onOpenChange: n[2] ||= (e) => Fe(e.open)
1706
- }, {
1707
- default: G(() => [
1708
- x(H(Q).Context, null, {
1709
- default: G((n) => [x(H(Q).Control, k(C(A.value || t.clearable ? { class: A.value ? N.value.chipsControl() : N.value.control() } : {})), {
1710
- default: G(() => [
1711
- A.value ? (M(!0), _(f, { key: 0 }, I(H(q), (e) => (M(), _("span", {
1712
- key: e.key,
1713
- class: O(N.value.chip())
1714
- }, [v("span", { class: O(N.value.chipText()) }, V(e.label), 3), n.disabled ? g("", !0) : (M(), _("button", {
1715
- key: 0,
1716
- type: "button",
1717
- tabindex: "-1",
1718
- class: O(N.value.chipRemove()),
1719
- "aria-label": H(P).removeItem(e.label),
1720
- onClick: (t) => Oe(e)
1721
- }, [x(H(ge), {
1722
- class: O(N.value.chipRemoveIcon()),
1723
- "aria-hidden": "true"
1724
- }, null, 8, ["class"])], 10, an))], 2))), 128)) : g("", !0),
1725
- x(H(Q).Trigger, E(T.value.rest, {
1726
- class: A.value ? N.value.chipsTrigger() : N.value.trigger(),
1727
- "aria-busy": t.loading || void 0,
1728
- onKeydown: ke
1729
- }), {
1730
- default: G(() => [A.value ? (M(), _("span", {
1731
- key: 0,
1732
- class: O(N.value.value()),
1733
- "data-placeholder-shown": !H(q).length || void 0
1734
- }, [H(q).length ? (M(), _("span", {
1735
- key: 0,
1736
- class: O(N.value.hiddenValue())
1737
- }, V(H(q).map((e) => e.label).join(", ")), 3)) : (M(), _(f, { key: 1 }, [b(V(t.placeholder ?? H(a).common.placeholder), 1)], 64))], 10, on)) : (M(), _("span", {
1738
- key: 1,
1739
- class: O(N.value.value()),
1740
- "data-placeholder-shown": !H(q).length || void 0
1741
- }, [e.$slots.value && H(q).length ? L(e.$slots, "value", { items: H(q).map((e) => e.item) }, void 0, void 0, 0) : (M(), _(f, { key: 1 }, [b(V(Se.value), 1)], 64))], 10, sn)), x(H(Q).Indicator, { class: O(N.value.indicator()) }, {
1742
- default: G(() => [t.loading ? (M(), h(H(pe), {
1743
- key: 0,
1744
- class: O(N.value.spinner()),
1745
- "aria-hidden": "true"
1746
- }, null, 8, ["class"])) : (M(), h(H(se), {
1747
- key: 1,
1748
- class: O(N.value.indicatorIcon()),
1749
- "aria-hidden": "true"
1750
- }, null, 8, ["class"]))]),
1751
- _: 1
1752
- }, 8, ["class"])]),
1753
- _: 3
1754
- }, 16, ["class", "aria-busy"]),
1755
- t.clearable && H(q).length && !n.disabled ? (M(), _("button", {
1756
- key: 1,
1757
- type: "button",
1758
- tabindex: "-1",
1759
- class: O(A.value ? N.value.chipsClear() : N.value.clear()),
1760
- "aria-label": H(P).clear,
1761
- onClick: (e) => Ae(n)
1762
- }, [x(H(ge), {
1763
- class: O(N.value.clearIcon()),
1764
- "aria-hidden": "true"
1765
- }, null, 8, ["class"])], 10, cn)) : g("", !0)
1766
- ]),
1767
- _: 2
1768
- }, 1040)]),
1769
- _: 3
1770
- }),
1771
- A.value || t.max !== void 0 || t.dataSource ? (M(), _("span", {
1772
- key: 0,
1773
- role: "status",
1774
- class: O(N.value.status())
1775
- }, V(Te.value || H(B).announcement.value), 3)) : g("", !0),
1776
- (M(), h(p, { to: "body" }, [x(H(Q).Positioner, null, {
1777
- default: G(() => [x(H(Q).Content, {
1778
- class: O(N.value.content()),
1779
- "aria-busy": ue.value || void 0,
1780
- "aria-label": ye.value ? T.value.rest["aria-label"] : void 0
1781
- }, {
1782
- default: G(() => [ye.value ? (M(), _(f, { key: 0 }, [v("div", { class: O(N.value.header()) }, [x(H(Q).Context, null, {
1783
- default: G((e) => [t.filter ? (M(), _("input", {
1784
- key: 0,
1785
- type: "text",
1786
- role: "combobox",
1787
- autocomplete: "off",
1788
- "aria-autocomplete": "list",
1789
- "aria-expanded": "true",
1790
- "data-autofocus": "",
1791
- "aria-controls": H(be),
1792
- "aria-activedescendant": Ie(e),
1793
- "aria-label": H(P).filter,
1794
- placeholder: H(a).combobox.search,
1795
- value: z.value,
1796
- class: O(N.value.search()),
1797
- onInput: (t) => Me(e, t),
1798
- onKeydown: Ne
1799
- }, null, 42, ln)) : g("", !0)]),
1800
- _: 1
1801
- }), t.selectAll && Ce.value.length ? (M(), _("button", {
1802
- key: 0,
1803
- type: "button",
1804
- role: "checkbox",
1805
- "aria-checked": we.value,
1806
- class: O(N.value.selectAll()),
1807
- onClick: n[0] ||= (e) => Ee(H(Qe)(H(q), H(ie), t.max)),
1808
- onKeydown: Pe
1809
- }, [v("span", {
1810
- class: O(N.value.check()),
1811
- "data-state": we.value === "mixed" ? "indeterminate" : we.value ? "checked" : "unchecked",
1812
- "aria-hidden": "true"
1813
- }, [we.value === "mixed" ? (M(), h(H(me), {
1814
- key: 0,
1815
- class: O(N.value.checkIcon())
1816
- }, null, 8, ["class"])) : we.value ? (M(), h(H(oe), {
1817
- key: 1,
1818
- class: O(N.value.checkIcon())
1819
- }, null, 8, ["class"])) : g("", !0)], 10, dn), b(" " + V(H(P).selectAll), 1)], 42, un)) : g("", !0)], 2), x(H(Q).List, {
1820
- id: H(be),
1821
- class: O(N.value.list()),
1822
- "data-autofocus": t.filter ? void 0 : ""
1823
- }, {
1824
- default: G(() => [x(s, {
1825
- parts: H(Q),
1826
- groups: H(U),
1827
- classes: xe.value,
1828
- checkbox: t.checkboxes,
1829
- loading: ue.value,
1830
- "loading-text": t.loadingText ?? H(a).common.loading,
1831
- "has-more": de.value,
1832
- "empty-text": Y.value,
1833
- onLoadMore: fe
1834
- }, y({ _: 2 }, [e.$slots.item ? {
1835
- name: "item",
1836
- fn: G((t) => [L(e.$slots, "item", k(C(t)))]),
1837
- key: "0"
1838
- } : void 0]), 1032, [
1839
- "parts",
1840
- "groups",
1841
- "classes",
1842
- "checkbox",
1843
- "loading",
1844
- "loading-text",
1845
- "has-more",
1846
- "empty-text"
1847
- ])]),
1848
- _: 3
1849
- }, 8, [
1850
- "id",
1851
- "class",
1852
- "data-autofocus"
1853
- ])], 64)) : (M(), h(s, {
1854
- key: 1,
1855
- parts: H(Q),
1856
- groups: H(U),
1857
- classes: xe.value,
1858
- checkbox: t.checkboxes,
1859
- loading: ue.value,
1860
- "loading-text": t.loadingText ?? H(a).common.loading,
1861
- "has-more": de.value,
1862
- "empty-text": Y.value,
1863
- onLoadMore: fe
1864
- }, y({ _: 2 }, [e.$slots.item ? {
1865
- name: "item",
1866
- fn: G((t) => [L(e.$slots, "item", k(C(t)))]),
1867
- key: "0"
1868
- } : void 0]), 1032, [
1869
- "parts",
1870
- "groups",
1871
- "classes",
1872
- "checkbox",
1873
- "loading",
1874
- "loading-text",
1875
- "has-more",
1876
- "empty-text"
1877
- ]))]),
1878
- _: 3
1879
- }, 8, [
1880
- "class",
1881
- "aria-busy",
1882
- "aria-label"
1883
- ])]),
1884
- _: 3
1885
- })])),
1886
- x(H(Q).HiddenSelect)
1887
- ]),
1888
- _: 3
1889
- }, 8, [
1890
- "class",
1891
- "style",
1892
- "collection",
1893
- "model-value",
1894
- "disabled",
1895
- "invalid",
1896
- "required",
1897
- "name",
1898
- "composite"
1899
- ]));
1900
- }
1901
- }), pn = ["id"], mn = ["id"], hn = /* @__PURE__ */ S({
1902
- inheritAttrs: !1,
1903
- __name: "NumberInput",
1904
- props: {
1905
- modelValue: { default: void 0 },
1906
- defaultValue: { default: void 0 },
1907
- min: {},
1908
- max: {},
1909
- step: {},
1910
- formatOptions: { default: () => xe },
1911
- locale: {},
1912
- size: {},
1913
- invalid: {
1914
- type: Boolean,
1915
- default: void 0
1916
- },
1917
- success: {
1918
- type: Boolean,
1919
- default: void 0
1920
- },
1921
- disabled: {
1922
- type: Boolean,
1923
- default: void 0
1924
- },
1925
- readOnly: {
1926
- type: Boolean,
1927
- default: void 0
1928
- },
1929
- required: {
1930
- type: Boolean,
1931
- default: void 0
1932
- },
1933
- name: {},
1934
- stepper: {
1935
- type: Boolean,
1936
- default: !0
1937
- },
1938
- stepperLayout: { default: "inline" },
1939
- prefix: {},
1940
- suffix: {},
1941
- allowNegative: {
1942
- type: Boolean,
1943
- default: !0
1944
- },
1945
- allowDecimal: {
1946
- type: Boolean,
1947
- default: !0
1948
- },
1949
- decimals: {},
1950
- clampBehavior: { default: "blur" },
1951
- selectOnFocus: { type: Boolean },
1952
- loading: { type: Boolean },
1953
- clearable: { type: Boolean },
1954
- clearLabel: {},
1955
- classes: {}
1956
- },
1957
- emits: ["update:modelValue"],
1958
- setup(o, { emit: s }) {
1959
- let c = t(), l = e(), u = o, d = n("numberInput", Me, () => u.classes), p = m(() => u.locale ?? c.value.locale), v = s, y = te(), b = m(() => r(y)), S = nt(), C = i(), w = m(() => !!u.invalid || !!S?.value.invalid), T = m(() => !w.value && (!!u.success || C.value.success)), D = m(() => d({
1960
- size: u.size,
1961
- stacked: u.stepperLayout === "stacked",
1962
- success: T.value
1963
- })), k = m(() => u.decimals === void 0 ? u.allowDecimal ? u.formatOptions : {
1964
- ...u.formatOptions,
1965
- maximumFractionDigits: 0
1966
- } : {
1967
- ...u.formatOptions,
1968
- minimumFractionDigits: u.decimals,
1969
- maximumFractionDigits: u.decimals
1970
- }), A = m(() => u.allowNegative ? u.min : Math.max(u.min ?? 0, 0)), j, N = Je(u.modelValue ?? u.defaultValue, p.value, k.value), P = F(N ?? ""), I = mt(m(() => ({
1971
- defaultValue: N,
1972
- min: A.value,
1973
- max: u.max,
1974
- step: u.step,
1975
- formatOptions: k.value,
1976
- locale: p.value,
1977
- invalid: u.invalid,
1978
- disabled: u.disabled,
1979
- readOnly: u.readOnly,
1980
- required: u.required,
1981
- name: u.name,
1982
- clampValueOnBlur: u.clampBehavior !== "none",
1983
- allowOverflow: u.clampBehavior !== "strict",
1984
- translations: l.numberInput,
1985
- onValueChange: (e) => {
1986
- P.value = e.value, j = Number.isNaN(e.valueAsNumber) ? null : e.valueAsNumber, v("update:modelValue", j);
1987
- }
1988
- })));
1989
- W(() => u.modelValue, (e) => {
1990
- e !== void 0 && e !== j && (e === null ? I.value.clearValue() : I.value.setValue(e));
1991
- });
1992
- function L(e) {
1993
- if (e.ctrlKey || e.metaKey || e.altKey) return;
1994
- let t = e.currentTarget, n = t.selectionStart ?? t.value.length, r = t.value.slice(0, n) + t.value.slice(t.selectionEnd ?? n), i = Ne(e.key, r, p.value, {
1995
- allowDecimal: u.allowDecimal && u.decimals !== 0,
1996
- allowNegative: u.allowNegative
1997
- });
1998
- i && (e.preventDefault(), i !== "block" && Te(t, i.insert));
1999
- }
2000
- function R(e) {
2001
- let t = e.currentTarget, n = (t.selectionStart ?? 0) === 0 && (t.selectionEnd ?? 0) === t.value.length, r = Ie(e.clipboardData?.getData("text") ?? "", p.value);
2002
- n && r !== null && (e.preventDefault(), Ve(t, Je(r, p.value, k.value)));
2003
- }
2004
- function z(e) {
2005
- if (!u.selectOnFocus) return;
2006
- let t = e.currentTarget;
2007
- requestAnimationFrame(() => t.select());
2008
- }
2009
- let B = ne(), re = ne(), U = m(() => u.prefix || u.suffix ? [
2010
- S?.value.ariaDescribedby,
2011
- u.prefix && B,
2012
- u.suffix && re,
2013
- b.value.rest["aria-describedby"]
2014
- ].filter(Boolean).join(" ") : void 0), ae = m(() => !!u.disabled || !!u.readOnly || !!S?.value.disabled || !!S?.value.readOnly), K = ie("control");
2015
- function q() {
2016
- let e = K.value?.$el.querySelector("input");
2017
- e && (Ve(e), e.focus());
2018
- }
2019
- return (e, t) => (M(), h(H(pt).RootProvider, {
2020
- value: H(I),
2021
- class: O(D.value.base({ class: b.value.className })),
2022
- style: ee(b.value.style)
2023
- }, {
2024
- default: G(() => [x(H(pt).Control, {
2025
- ref_key: "control",
2026
- ref: K,
2027
- class: O(D.value.control())
2028
- }, {
2029
- default: G(() => [
2030
- o.prefix ? (M(), _("span", {
2031
- key: 0,
2032
- id: H(B),
2033
- class: O(D.value.prefix())
2034
- }, V(o.prefix), 11, pn)) : g("", !0),
2035
- x(H(pt).Input, E({
2036
- ...b.value.rest,
2037
- ...U.value ? { "aria-describedby": U.value } : {}
2038
- }, {
2039
- value: P.value,
2040
- class: D.value.input(),
2041
- "aria-busy": o.loading || void 0,
2042
- onKeydown: L,
2043
- onPaste: R,
2044
- onFocus: z
2045
- }), null, 16, [
2046
- "value",
2047
- "class",
2048
- "aria-busy"
2049
- ]),
2050
- o.loading || o.clearable || T.value ? (M(), h(a, {
2051
- key: 1,
2052
- loading: o.loading,
2053
- clear: o.clearable && !!P.value && !ae.value,
2054
- "clear-label": o.clearLabel ?? H(l).field.clear,
2055
- success: T.value,
2056
- classes: {
2057
- spinner: D.value.spinner(),
2058
- clear: D.value.clear(),
2059
- clearIcon: D.value.clearIcon(),
2060
- statusIcon: D.value.statusIcon()
2061
- },
2062
- onClear: q
2063
- }, null, 8, [
2064
- "loading",
2065
- "clear",
2066
- "clear-label",
2067
- "success",
2068
- "classes"
2069
- ])) : g("", !0),
2070
- o.suffix ? (M(), _("span", {
2071
- key: 2,
2072
- id: H(re),
2073
- class: O(D.value.suffix())
2074
- }, V(o.suffix), 11, mn)) : g("", !0),
2075
- o.stepper && o.stepperLayout === "stacked" ? (M(), _("div", {
2076
- key: 3,
2077
- class: O(D.value.stepper())
2078
- }, [x(H(pt).IncrementTrigger, { class: O(D.value.button()) }, {
2079
- default: G(() => [x(H(le), {
2080
- class: O(D.value.buttonIcon()),
2081
- "aria-hidden": "true"
2082
- }, null, 8, ["class"])]),
2083
- _: 1
2084
- }, 8, ["class"]), x(H(pt).DecrementTrigger, { class: O(D.value.button()) }, {
2085
- default: G(() => [x(H(se), {
2086
- class: O(D.value.buttonIcon()),
2087
- "aria-hidden": "true"
2088
- }, null, 8, ["class"])]),
2089
- _: 1
2090
- }, 8, ["class"])], 2)) : o.stepper ? (M(), _(f, { key: 4 }, [x(H(pt).DecrementTrigger, { class: O(D.value.button()) }, {
2091
- default: G(() => [x(H(me), {
2092
- class: O(D.value.buttonIcon()),
2093
- "aria-hidden": "true"
2094
- }, null, 8, ["class"])]),
2095
- _: 1
2096
- }, 8, ["class"]), x(H(pt).IncrementTrigger, { class: O(D.value.button()) }, {
2097
- default: G(() => [x(H(he), {
2098
- class: O(D.value.buttonIcon()),
2099
- "aria-hidden": "true"
2100
- }, null, 8, ["class"])]),
2101
- _: 1
2102
- }, 8, ["class"])], 64)) : g("", !0)
2103
- ]),
2104
- _: 1
2105
- }, 8, ["class"])]),
2106
- _: 1
2107
- }, 8, [
2108
- "value",
2109
- "class",
2110
- "style"
2111
- ]));
2112
- }
2113
- }), gn = /* @__PURE__ */ S({
2114
- __name: "ContextMenu",
2115
- props: {
2116
- items: {},
2117
- label: {},
2118
- linkAs: {},
2119
- classes: {}
2120
- },
2121
- emits: [
2122
- "select",
2123
- "checked-change",
2124
- "value-change"
2125
- ],
2126
- setup(e, { expose: t, emit: r }) {
2127
- let i = e, a = n("menu", ke, () => i.classes), o = r, s = a();
2128
- gt({
2129
- items: () => i.items,
2130
- linkAs: () => i.linkAs,
2131
- onCheckedChange: (e, t) => o("checked-change", e, t),
2132
- onValueChange: (e, t) => o("value-change", e, t)
2133
- });
2134
- let c = yt({
2135
- open: () => void 0,
2136
- anchor: () => void 0,
2137
- onOpenChange: () => {},
2138
- restoreFocus: !0
2139
- });
2140
- t(c.handle);
2141
- let l = be((e) => c.handle.open(e));
2142
- A(l.cancel);
2143
- let u = m(() => c.positioning({}));
2144
- return (t, n) => (M(), h(H(X).Root, {
2145
- open: H(c).isOpen.value,
2146
- positioning: u.value,
2147
- "anchor-point": H(c).anchorPoint.value,
2148
- "lazy-mount": "",
2149
- "unmount-on-exit": "",
2150
- "onUpdate:open": n[5] ||= (e) => H(c).onOpenChange(e),
2151
- onSelect: n[6] ||= (e) => o("select", e.value)
2152
- }, {
2153
- default: G(() => [x(H(X).ContextTrigger, {
2154
- "as-child": "",
2155
- onPointerdown: n[0] ||= (e) => H(l).down(e),
2156
- onPointermove: n[1] ||= (e) => H(l).move(e),
2157
- onPointerup: n[2] ||= (e) => H(l).cancel(),
2158
- onPointercancel: n[3] ||= (e) => H(l).cancel()
2159
- }, {
2160
- default: G(() => [L(t.$slots, "default")]),
2161
- _: 3
2162
- }), (M(), h(p, { to: "body" }, [x(H(X).Positioner, null, {
2163
- default: G(() => [x(H(X).Content, E({ class: H(s).content() }, e.label ? {
2164
- "aria-label": e.label,
2165
- "aria-labelledby": void 0
2166
- } : {}), {
2167
- default: G(() => [x(vt, {
2168
- entries: e.items,
2169
- onSelect: n[4] ||= (e) => o("select", e)
2170
- }, y({ _: 2 }, [t.$slots.item ? {
2171
- name: "item",
2172
- fn: G((e) => [L(t.$slots, "item", k(C(e)))]),
2173
- key: "0"
2174
- } : void 0]), 1032, ["entries"])]),
2175
- _: 3
2176
- }, 16, ["class"])]),
2177
- _: 3
2178
- })]))]),
2179
- _: 3
2180
- }, 8, [
2181
- "open",
2182
- "positioning",
2183
- "anchor-point"
2184
- ]));
2185
- }
2186
- });
2187
- //#endregion
2188
- export { gt as S, Ot as _, nn as a, yt as b, Jt as c, Xt as d, Gt as f, kt as g, Lt as h, rn as i, Zt as l, zt as m, hn as n, Ht as o, Wt as p, fn as r, Vt as s, gn as t, Ut as u, Tt as v, vt as x, Ct as y };