@wirecore/wirelayer-vue 0.6.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 (120) hide show
  1. package/dist/{Checkbox-D9f77jtl.js → Checkbox-D175nhKK.js} +26 -22
  2. package/dist/ContextMenu-BEOEyUa6.js +2235 -0
  3. package/dist/{Highlight-Cg8DvCfq.js → Highlight-uwptdaUw.js} +35 -32
  4. package/dist/{Input-BhnYMKjE.js → Input-Cn5q0yVE.js} +48 -35
  5. package/dist/{Select-DAuYpE1c.js → Select-Bd2Vpr7G.js} +173 -164
  6. package/dist/Slider-Cpv7Vj3B.js +143 -0
  7. package/dist/{Tree-DWxqSrO6.js → Tree-fd9LXqgZ.js} +183 -180
  8. package/dist/chart.js +1 -1
  9. package/dist/components/AngleSlider/AngleSlider.vue.d.ts +2 -0
  10. package/dist/components/AngleSlider/AngleSlider.vue.d.ts.map +1 -1
  11. package/dist/components/Autocomplete/Autocomplete.vue.d.ts +2 -0
  12. package/dist/components/Autocomplete/Autocomplete.vue.d.ts.map +1 -1
  13. package/dist/components/Carousel/Carousel.vue.d.ts +2 -0
  14. package/dist/components/Carousel/Carousel.vue.d.ts.map +1 -1
  15. package/dist/components/CascadeSelect/CascadeSelect.vue.d.ts +2 -0
  16. package/dist/components/CascadeSelect/CascadeSelect.vue.d.ts.map +1 -1
  17. package/dist/components/Checkbox/Checkbox.vue.d.ts +2 -0
  18. package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
  19. package/dist/components/ColorInput/ColorInput.vue.d.ts.map +1 -1
  20. package/dist/components/ColorPicker/ColorPicker.vue.d.ts +2 -0
  21. package/dist/components/ColorPicker/ColorPicker.vue.d.ts.map +1 -1
  22. package/dist/components/Combobox/Combobox.vue.d.ts +2 -0
  23. package/dist/components/Combobox/Combobox.vue.d.ts.map +1 -1
  24. package/dist/components/Confirm/ConfirmDialog.vue.d.ts +5 -0
  25. package/dist/components/Confirm/ConfirmDialog.vue.d.ts.map +1 -1
  26. package/dist/components/Confirm/confirm.d.ts +7 -0
  27. package/dist/components/Confirm/confirm.d.ts.map +1 -1
  28. package/dist/components/DatePicker/DatePicker.vue.d.ts +2 -0
  29. package/dist/components/DatePicker/DatePicker.vue.d.ts.map +1 -1
  30. package/dist/components/DatePicker/DatePickerBase.vue.d.ts +2 -0
  31. package/dist/components/DatePicker/DatePickerBase.vue.d.ts.map +1 -1
  32. package/dist/components/DateRangePicker/DateRangePicker.vue.d.ts +2 -0
  33. package/dist/components/DateRangePicker/DateRangePicker.vue.d.ts.map +1 -1
  34. package/dist/components/Dialog/DialogContent.vue.d.ts +2 -0
  35. package/dist/components/Dialog/DialogContent.vue.d.ts.map +1 -1
  36. package/dist/components/Drawer/DrawerContent.vue.d.ts +2 -0
  37. package/dist/components/Drawer/DrawerContent.vue.d.ts.map +1 -1
  38. package/dist/components/DurationInput/DurationInput.vue.d.ts +2 -0
  39. package/dist/components/DurationInput/DurationInput.vue.d.ts.map +1 -1
  40. package/dist/components/IconButton/IconButton.vue.d.ts +2 -0
  41. package/dist/components/IconButton/IconButton.vue.d.ts.map +1 -1
  42. package/dist/components/Knob/Knob.vue.d.ts +2 -0
  43. package/dist/components/Knob/Knob.vue.d.ts.map +1 -1
  44. package/dist/components/Listbox/Listbox.vue.d.ts +2 -0
  45. package/dist/components/Listbox/Listbox.vue.d.ts.map +1 -1
  46. package/dist/components/MonthPicker/MonthPicker.vue.d.ts +2 -0
  47. package/dist/components/MonthPicker/MonthPicker.vue.d.ts.map +1 -1
  48. package/dist/components/MultiSelect/MultiSelect.vue.d.ts +2 -0
  49. package/dist/components/MultiSelect/MultiSelect.vue.d.ts.map +1 -1
  50. package/dist/components/NumberInput/NumberInput.vue.d.ts +2 -0
  51. package/dist/components/NumberInput/NumberInput.vue.d.ts.map +1 -1
  52. package/dist/components/PasswordInput/PasswordInput.vue.d.ts +2 -0
  53. package/dist/components/PasswordInput/PasswordInput.vue.d.ts.map +1 -1
  54. package/dist/components/PinInput/PinInput.vue.d.ts +2 -0
  55. package/dist/components/PinInput/PinInput.vue.d.ts.map +1 -1
  56. package/dist/components/RadioGroup/RadioGroup.vue.d.ts.map +1 -1
  57. package/dist/components/Rating/Rating.vue.d.ts +2 -0
  58. package/dist/components/Rating/Rating.vue.d.ts.map +1 -1
  59. package/dist/components/SegmentedControl/SegmentedControl.vue.d.ts.map +1 -1
  60. package/dist/components/Select/Select.vue.d.ts +2 -0
  61. package/dist/components/Select/Select.vue.d.ts.map +1 -1
  62. package/dist/components/SelectionCard/CheckboxCard.vue.d.ts +2 -0
  63. package/dist/components/SelectionCard/CheckboxCard.vue.d.ts.map +1 -1
  64. package/dist/components/Slider/Slider.vue.d.ts +2 -0
  65. package/dist/components/Slider/Slider.vue.d.ts.map +1 -1
  66. package/dist/components/Switch/Switch.vue.d.ts +2 -0
  67. package/dist/components/Switch/Switch.vue.d.ts.map +1 -1
  68. package/dist/components/TagsInput/TagsInput.vue.d.ts +2 -0
  69. package/dist/components/TagsInput/TagsInput.vue.d.ts.map +1 -1
  70. package/dist/components/TimePicker/TimePicker.vue.d.ts +2 -0
  71. package/dist/components/TimePicker/TimePicker.vue.d.ts.map +1 -1
  72. package/dist/components/TimeRangePicker/TimeRangePicker.vue.d.ts +2 -0
  73. package/dist/components/TimeRangePicker/TimeRangePicker.vue.d.ts.map +1 -1
  74. package/dist/components/Tooltip/Tooltip.vue.d.ts +3 -0
  75. package/dist/components/Tooltip/Tooltip.vue.d.ts.map +1 -1
  76. package/dist/components/TreeSelect/TreeSelect.vue.d.ts +2 -0
  77. package/dist/components/TreeSelect/TreeSelect.vue.d.ts.map +1 -1
  78. package/dist/components/YearPicker/YearPicker.vue.d.ts +2 -0
  79. package/dist/components/YearPicker/YearPicker.vue.d.ts.map +1 -1
  80. package/dist/data-table/DataTable.vue.d.ts +9 -1
  81. package/dist/data-table/DataTable.vue.d.ts.map +1 -1
  82. package/dist/data-table.js +1007 -994
  83. package/dist/editor.js +1 -1
  84. package/dist/form/FormField.vue.d.ts +3 -0
  85. package/dist/form/FormField.vue.d.ts.map +1 -1
  86. package/dist/form.js +7 -4
  87. package/dist/index.d.ts +1 -1
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.js +5674 -5521
  90. package/dist/label-for-eQvYjsM5.js +8 -0
  91. package/dist/pdf.js +2 -2
  92. package/dist/sources/ActionBar.css +1 -0
  93. package/dist/sources/AppShell.css +1 -0
  94. package/dist/sources/ChatPrompt.css +1 -0
  95. package/dist/sources/Gallery.css +1 -0
  96. package/dist/sources/IconButton.css +1 -0
  97. package/dist/sources/Image.css +1 -0
  98. package/dist/sources/ImageCropper.css +1 -0
  99. package/dist/sources/InlineEdit.css +1 -0
  100. package/dist/sources/Marquee.css +1 -0
  101. package/dist/sources/MegaMenu.css +1 -0
  102. package/dist/sources/Menubar.css +1 -0
  103. package/dist/sources/OrderList.css +1 -0
  104. package/dist/sources/PickList.css +1 -0
  105. package/dist/sources/ScrollTop.css +1 -0
  106. package/dist/{useTree-H8XsFHMk.js → useTree-UhG1TMeM.js} +1 -1
  107. package/dist/utils/label-for.d.ts +3 -0
  108. package/dist/utils/label-for.d.ts.map +1 -0
  109. package/dist/utils/list.d.ts +5 -0
  110. package/dist/utils/list.d.ts.map +1 -1
  111. package/dist/virtual/VirtualSelect.vue.d.ts +2 -0
  112. package/dist/virtual/VirtualSelect.vue.d.ts.map +1 -1
  113. package/dist/virtual.js +207 -197
  114. package/fonts.css +2 -0
  115. package/llms-full.txt +188 -3
  116. package/llms.txt +4 -1
  117. package/package.json +7 -3
  118. package/theme.css +14 -0
  119. package/dist/ContextMenu-C5JKyNlX.js +0 -2209
  120. package/dist/Slider-CyoZc5A8.js +0 -135
@@ -1,2209 +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-D7kBGlew.js";
4
- import { t as o } from "./Input-BhnYMKjE.js";
5
- import { n as s, t as c } from "./Select-DAuYpE1c.js";
6
- import { a as l, n as u, r as d } from "./Highlight-Cg8DvCfq.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 K, withKeys as q } from "vue";
8
- import { CalendarDays as J, Check as ae, ChevronDown as oe, ChevronLeft as se, ChevronRight as ce, 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(ae), {
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(ce), {
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
- }, [K(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(""), K;
459
- function q(e) {
460
- I.value = e.target.value, B(), T.value && (clearTimeout(K), K = setTimeout(() => {
461
- G.value = c.textarea.remaining(w.value - L.value, w.value);
462
- }, 1e3));
463
- }
464
- A(() => clearTimeout(K));
465
- let J = m(() => [
466
- d?.value.ariaDescribedby,
467
- T.value && U,
468
- u["aria-describedby"]
469
- ].filter(Boolean).join(" ") || void 0);
470
- function ae() {
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": J.value,
501
- "aria-busy": t.loading || void 0,
502
- onInput: q
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: ae
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: q
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(se), {
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(ce), {
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: q((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(se), {
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(ce), {
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 = [
1199
- "id",
1200
- "data-hidden",
1201
- "onClick"
1202
- ], nn = ["id"], rn = /* @__PURE__ */ S({
1203
- __name: "DatePickerBase",
1204
- props: {
1205
- mode: {},
1206
- dates: {},
1207
- withTime: { type: Boolean },
1208
- min: {},
1209
- max: {},
1210
- isDateUnavailable: { type: Function },
1211
- locale: {},
1212
- disabled: { type: Boolean },
1213
- readOnly: { type: Boolean },
1214
- invalid: { type: Boolean },
1215
- required: { type: Boolean },
1216
- name: {},
1217
- label: {},
1218
- placeholder: {},
1219
- className: {},
1220
- period: {},
1221
- classes: {},
1222
- presets: {},
1223
- size: {},
1224
- hideClear: { type: Boolean },
1225
- firstDayOfWeek: {},
1226
- timeZone: {},
1227
- showTimeZone: { type: Boolean },
1228
- responsive: { type: Boolean },
1229
- showWeekNumbers: { type: Boolean },
1230
- numberOfMonths: {},
1231
- showButtonBar: { type: Boolean },
1232
- plainToday: { type: Boolean },
1233
- hideOutsideDays: { type: Boolean },
1234
- weekendDays: {},
1235
- allowDeselect: { type: Boolean }
1236
- },
1237
- emits: ["change"],
1238
- setup(t, { emit: r }) {
1239
- 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(() => ({
1240
- disabled: a.disabled ?? u?.value.disabled,
1241
- readOnly: a.readOnly ?? u?.value.readOnly,
1242
- invalid: a.invalid ?? u?.value.invalid,
1243
- required: a.required ?? u?.value.required
1244
- })), 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 ? {
1245
- ...i.datePicker,
1246
- clearTrigger: i.dateRange.clearTrigger
1247
- } : i.datePicker, j = m(() => a.period ? new ct(a.locale, a.period === "month" ? {
1248
- month: "2-digit",
1249
- year: "numeric"
1250
- } : { year: "numeric" }) : void 0), N = m(() => a.firstDayOfWeek ?? Oe(a.locale).firstDay), P = m(() => {
1251
- if (!a.showTimeZone || !a.timeZone) return;
1252
- let e = a.dates[0], t = e ? $e(e.toString().slice(0, 16), a.timeZone) : /* @__PURE__ */ new Date();
1253
- return {
1254
- short: Ke(a.timeZone, a.locale, t),
1255
- long: i.calendar.timeZone(qe(a.timeZone, a.locale, t))
1256
- };
1257
- }), F = m(() => [u?.value.ariaDescribedby, P.value ? `${l}tz` : void 0].filter(Boolean).join(" ") || void 0), R = (e) => w.every((t) => e.getSegments({ index: t }).every((e) => e.type === "literal" || e.isPlaceholder)), z = (e) => !!a.placeholder && R(e) && !e.focused, B = (e) => a.placeholder && R(e) ? [F.value, `${l}ph`].filter(Boolean).join(" ") : F.value, te = m(() => {
1258
- if (!a.dates.length) return a.placeholder ?? i.calendar.noDates;
1259
- if (a.dates.length > 3) return ze(i.calendar.datesSelected, a.dates.length, a.locale);
1260
- let e = new ct(a.locale, {
1261
- day: "2-digit",
1262
- month: "2-digit",
1263
- year: "numeric",
1264
- timeZone: "UTC"
1265
- });
1266
- return a.dates.map((t) => e.format(t.toDate("UTC"))).join(", ");
1267
- }), re = m(() => ({
1268
- presets: a.presets,
1269
- showWeekNumbers: a.showWeekNumbers,
1270
- numberOfMonths: a.numberOfMonths,
1271
- showButtonBar: a.showButtonBar,
1272
- plainToday: a.plainToday,
1273
- hideOutsideDays: a.hideOutsideDays,
1274
- weekendDays: a.weekendDays,
1275
- allowDeselect: a.allowDeselect,
1276
- timeZone: a.timeZone,
1277
- responsive: a.responsive
1278
- }));
1279
- function ie(e) {
1280
- s("change", a.withTime ? e.map((e, t) => Kt(e, a.dates[t])) : e);
1281
- }
1282
- function U(e, t) {
1283
- if (a.period) return !1;
1284
- if (p) {
1285
- let t = Re(e, a.locale, a.withTime);
1286
- if (t) return s("change", [Vt(t.start, a.withTime), Vt(t.end, a.withTime)]), !0;
1287
- }
1288
- let n = Le(e, a.locale, a.withTime);
1289
- if (!n) return !1;
1290
- let r = [...a.dates];
1291
- return r[t] = Vt(n, a.withTime), s("change", r.filter(Boolean)), !0;
1292
- }
1293
- let W = {
1294
- placement: "bottom-start",
1295
- gutter: 4
1296
- };
1297
- return (e, n) => (M(), h(H($).Root, E({
1298
- class: c.value.base({ class: t.className }),
1299
- "model-value": t.dates,
1300
- "selection-mode": t.mode,
1301
- min: t.min,
1302
- max: t.max,
1303
- "is-date-unavailable": t.isDateUnavailable,
1304
- locale: t.locale,
1305
- "start-of-week": N.value,
1306
- "min-view": t.period,
1307
- "default-view": t.period,
1308
- "num-of-months": t.numberOfMonths,
1309
- "time-zone": t.timeZone
1310
- }, d.value, {
1311
- positioning: W,
1312
- translations: H(A),
1313
- "lazy-mount": "",
1314
- "unmount-on-exit": "",
1315
- onValueChange: n[1] ||= (e) => ie(e.value)
1316
- }), {
1317
- default: G(() => [x(H($).Control, { class: O(c.value.control()) }, {
1318
- default: G(() => [
1319
- b ? (M(), _(f, { key: 0 }, [v("span", {
1320
- id: `${H(l)}v`,
1321
- class: O(c.value.multiValue()),
1322
- "data-placeholder": t.dates.length ? void 0 : ""
1323
- }, V(te.value), 11, Qt), t.name ? (M(!0), _(f, { key: 0 }, I(t.dates, (e, n) => (M(), _("input", {
1324
- key: e.toString(),
1325
- type: "hidden",
1326
- name: `${t.name}[${n}]`,
1327
- value: e.toString()
1328
- }, null, 8, $t))), 128)) : g("", !0)], 64)) : (M(), h(H(at).Root, E({
1329
- key: 1,
1330
- class: c.value.dateInput(),
1331
- ids: D.value,
1332
- "model-value": t.dates,
1333
- "selection-mode": H(S),
1334
- granularity: t.withTime ? "minute" : "day",
1335
- formatter: j.value,
1336
- min: t.min,
1337
- max: t.max,
1338
- "is-date-unavailable": t.isDateUnavailable,
1339
- locale: t.locale,
1340
- "should-force-leading-zeros": "",
1341
- name: t.name
1342
- }, d.value, {
1343
- translations: H(i).dateInput,
1344
- onValueChange: n[0] ||= (e) => s("change", e.value)
1345
- }), {
1346
- default: G(() => [x(H(at).Context, null, {
1347
- default: G((e) => [x(H(at).Control, {
1348
- class: O(c.value.dateControl()),
1349
- "data-placeholder-shown": z(e) || void 0
1350
- }, {
1351
- default: G(() => [(M(!0), _(f, null, I(H(w), (n) => (M(), _(f, { key: n }, [
1352
- n === 1 ? (M(), _("span", {
1353
- key: 0,
1354
- class: O(c.value.rangeSeparator()),
1355
- "aria-hidden": "true"
1356
- }, "–", 2)) : g("", !0),
1357
- p && H(u) ? (M(), _("span", {
1358
- key: 1,
1359
- id: `${H(l)}r${n}`,
1360
- class: O(c.value.rangeLabel())
1361
- }, V(T[n]), 11, en)) : g("", !0),
1362
- x(zt, {
1363
- index: n,
1364
- label: ee(n),
1365
- describedby: B(e),
1366
- paste: t.period ? void 0 : U,
1367
- size: t.size
1368
- }, null, 8, [
1369
- "index",
1370
- "label",
1371
- "describedby",
1372
- "paste",
1373
- "size"
1374
- ])
1375
- ], 64))), 128))]),
1376
- _: 2
1377
- }, 1032, ["class", "data-placeholder-shown"]), t.placeholder && R(e) ? (M(), _("span", {
1378
- key: 0,
1379
- id: `${H(l)}ph`,
1380
- class: O(c.value.placeholder()),
1381
- "data-hidden": z(e) ? void 0 : "",
1382
- onClick: (t) => e.focus()
1383
- }, V(t.placeholder), 11, tn)) : g("", !0)]),
1384
- _: 1
1385
- }), (M(!0), _(f, null, I(H(w), (e) => (M(), h(H(at).HiddenInput, {
1386
- key: e,
1387
- index: e
1388
- }, null, 8, ["index"]))), 128))]),
1389
- _: 1
1390
- }, 16, [
1391
- "class",
1392
- "ids",
1393
- "model-value",
1394
- "selection-mode",
1395
- "granularity",
1396
- "formatter",
1397
- "min",
1398
- "max",
1399
- "is-date-unavailable",
1400
- "locale",
1401
- "name",
1402
- "translations"
1403
- ])),
1404
- P.value ? (M(), _(f, { key: 2 }, [v("span", {
1405
- class: O(c.value.timeZone()),
1406
- "aria-hidden": "true"
1407
- }, V(P.value.short), 3), v("span", {
1408
- id: `${H(l)}tz`,
1409
- hidden: ""
1410
- }, V(P.value.long), 9, nn)], 64)) : g("", !0),
1411
- t.hideClear ? g("", !0) : (M(), h(H($).ClearTrigger, {
1412
- key: 3,
1413
- class: O(c.value.clear())
1414
- }, {
1415
- default: G(() => [x(H(ge), {
1416
- class: O(c.value.clearIcon()),
1417
- "aria-hidden": "true"
1418
- }, null, 8, ["class"])]),
1419
- _: 1
1420
- }, 8, ["class"])),
1421
- x(H($).Trigger, E({ class: c.value.trigger() }, b ? { "aria-describedby": `${H(l)}v` } : {}), {
1422
- default: G(() => [x(H(J), {
1423
- class: O(c.value.triggerIcon()),
1424
- "aria-hidden": "true"
1425
- }, null, 8, ["class"])]),
1426
- _: 1
1427
- }, 16, ["class"])
1428
- ]),
1429
- _: 1
1430
- }, 8, ["class"]), x(Rt, k(C(re.value)), y({ _: 2 }, [e.$slots.day ? {
1431
- name: "day",
1432
- fn: G((t) => [L(e.$slots, "day", k(C(t)))]),
1433
- key: "0"
1434
- } : void 0]), 1040)]),
1435
- _: 3
1436
- }, 16, [
1437
- "class",
1438
- "model-value",
1439
- "selection-mode",
1440
- "min",
1441
- "max",
1442
- "is-date-unavailable",
1443
- "locale",
1444
- "start-of-week",
1445
- "min-view",
1446
- "default-view",
1447
- "num-of-months",
1448
- "time-zone",
1449
- "translations"
1450
- ]));
1451
- }
1452
- }), an = /* @__PURE__ */ S({
1453
- inheritAttrs: !1,
1454
- __name: "DatePicker",
1455
- props: {
1456
- modelValue: { default: void 0 },
1457
- defaultValue: { default: void 0 },
1458
- selectionMode: { default: "single" },
1459
- valueType: { default: "string" },
1460
- withTime: {
1461
- type: Boolean,
1462
- default: !1
1463
- },
1464
- min: {},
1465
- max: {},
1466
- isDateUnavailable: {},
1467
- excludeDates: {},
1468
- locale: {},
1469
- disabled: {
1470
- type: Boolean,
1471
- default: void 0
1472
- },
1473
- readOnly: {
1474
- type: Boolean,
1475
- default: void 0
1476
- },
1477
- invalid: {
1478
- type: Boolean,
1479
- default: void 0
1480
- },
1481
- required: {
1482
- type: Boolean,
1483
- default: void 0
1484
- },
1485
- name: {},
1486
- placeholder: {},
1487
- size: {},
1488
- clearable: {
1489
- type: Boolean,
1490
- default: !0
1491
- },
1492
- showButtonBar: { type: Boolean },
1493
- showWeekNumbers: { type: Boolean },
1494
- numberOfMonths: {},
1495
- highlightToday: {
1496
- type: Boolean,
1497
- default: !0
1498
- },
1499
- hideOutsideDays: { type: Boolean },
1500
- firstDayOfWeek: {},
1501
- weekendDays: {},
1502
- allowDeselect: { type: Boolean },
1503
- timeZone: {},
1504
- showTimeZone: { type: Boolean },
1505
- responsive: { type: Boolean },
1506
- classes: {}
1507
- },
1508
- emits: ["update:modelValue"],
1509
- setup(e, { emit: n }) {
1510
- 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();
1511
- function v(e) {
1512
- let t = e.map((e) => Ut(e, a.withTime, a.valueType, a.timeZone));
1513
- if (_(t) === _(p.value)) return;
1514
- let n = a.selectionMode === "multiple" ? t : t[0] ?? null;
1515
- d.value = n, s("update:modelValue", n);
1516
- }
1517
- let b = m(() => ({
1518
- min: Ht(a.min, a.withTime, a.timeZone, "min"),
1519
- max: Ht(a.max, a.withTime, a.timeZone, "max")
1520
- })), x = m(() => Gt(a.isDateUnavailable, a.excludeDates));
1521
- return (t, n) => (M(), h(rn, E({
1522
- mode: e.selectionMode,
1523
- dates: g.value,
1524
- "with-time": e.withTime
1525
- }, b.value, {
1526
- "is-date-unavailable": x.value,
1527
- locale: o.value,
1528
- disabled: e.disabled,
1529
- "read-only": e.readOnly,
1530
- invalid: e.invalid,
1531
- required: e.required,
1532
- name: e.name,
1533
- label: u.value,
1534
- placeholder: e.placeholder,
1535
- classes: e.classes,
1536
- "class-name": l.value.className,
1537
- style: l.value.style,
1538
- size: e.size,
1539
- "hide-clear": !e.clearable,
1540
- "show-button-bar": e.showButtonBar,
1541
- "show-week-numbers": e.showWeekNumbers,
1542
- "number-of-months": e.numberOfMonths,
1543
- "plain-today": !e.highlightToday,
1544
- "hide-outside-days": e.hideOutsideDays,
1545
- "first-day-of-week": e.firstDayOfWeek,
1546
- "weekend-days": e.weekendDays,
1547
- "allow-deselect": e.allowDeselect,
1548
- "time-zone": e.timeZone,
1549
- "show-time-zone": e.showTimeZone,
1550
- responsive: e.responsive,
1551
- onChange: v
1552
- }), y({ _: 2 }, [t.$slots.day ? {
1553
- name: "day",
1554
- fn: G((e) => [L(t.$slots, "day", k(C(e)))]),
1555
- key: "0"
1556
- } : void 0]), 1040, /* @__PURE__ */ "mode.dates.with-time.is-date-unavailable.locale.disabled.read-only.invalid.required.name.label.placeholder.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(".")));
1557
- }
1558
- }), on = ["aria-label", "onClick"], sn = ["data-placeholder-shown"], cn = ["data-placeholder-shown"], ln = ["aria-label", "onClick"], un = [
1559
- "aria-controls",
1560
- "aria-activedescendant",
1561
- "aria-label",
1562
- "placeholder",
1563
- "value",
1564
- "onInput"
1565
- ], dn = ["aria-checked"], fn = ["data-state"], pn = /* @__PURE__ */ S({
1566
- inheritAttrs: !1,
1567
- __name: "MultiSelect",
1568
- props: {
1569
- items: {},
1570
- modelValue: { default: void 0 },
1571
- defaultValue: { default: void 0 },
1572
- placeholder: {},
1573
- summary: {},
1574
- maxShown: { default: 2 },
1575
- disabled: {
1576
- type: Boolean,
1577
- default: void 0
1578
- },
1579
- invalid: {
1580
- type: Boolean,
1581
- default: void 0
1582
- },
1583
- required: {
1584
- type: Boolean,
1585
- default: void 0
1586
- },
1587
- name: {},
1588
- itemValue: {},
1589
- itemLabel: {},
1590
- itemDisabled: {},
1591
- itemGroup: {},
1592
- itemKeywords: {},
1593
- valueKey: {},
1594
- display: { default: "text" },
1595
- checkboxes: {
1596
- type: Boolean,
1597
- default: !0
1598
- },
1599
- selectAll: { type: Boolean },
1600
- max: {},
1601
- clearable: { type: Boolean },
1602
- loading: { type: Boolean },
1603
- loadingText: {},
1604
- size: {},
1605
- filter: { type: Boolean },
1606
- manualFilter: { type: Boolean },
1607
- emptyText: {},
1608
- hasMore: { type: Boolean },
1609
- dataSource: {},
1610
- minSearchLength: {},
1611
- pageSize: {},
1612
- classes: {}
1613
- },
1614
- emits: [
1615
- "update:modelValue",
1616
- "filterChange",
1617
- "loadMore"
1618
- ],
1619
- setup(t, { emit: i }) {
1620
- 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({
1621
- size: o.size,
1622
- clearable: o.clearable && !A.value
1623
- })), P = a.select, R = m(() => ({
1624
- itemValue: o.itemValue,
1625
- itemLabel: o.itemLabel,
1626
- itemDisabled: o.itemDisabled,
1627
- itemGroup: o.itemGroup,
1628
- itemKeywords: o.itemKeywords,
1629
- valueKey: o.valueKey
1630
- })), z = F(""), B = l({
1631
- items: () => o.items,
1632
- source: () => o.dataSource,
1633
- accessors: () => R.value,
1634
- pageSize: () => o.pageSize,
1635
- minSearchLength: () => o.minSearchLength
1636
- }), { options: re, visible: ie, groups: U, ordered: K } = u(() => B.items.value, () => R.value, () => o.filter && !o.manualFilter && !o.dataSource ? z.value : ""), q = m(() => [...re.value, ...B.resolvedOptions.value]), { selected: J, keys: se, commit: ce, commitKeys: le } = d({
1637
- multiple: !0,
1638
- model: () => o.modelValue,
1639
- defaultValue: o.defaultValue,
1640
- accessors: () => R.value,
1641
- items: q,
1642
- emit: (e) => S("update:modelValue", e)
1643
- });
1644
- j(() => B.resolve(se.value, q.value)), W(se, (e) => B.resolve(e, q.value));
1645
- let ue = m(() => o.loading || B.loading.value), de = m(() => o.hasMore || B.hasMore.value);
1646
- function fe() {
1647
- o.dataSource ? B.loadMore() : S("loadMore");
1648
- }
1649
- let he = m(() => o.max !== void 0 && J.value.length >= o.max), _e = m(() => {
1650
- let e = new Set(se.value);
1651
- return it({
1652
- items: K.value,
1653
- itemToString: (e) => e.label,
1654
- itemToValue: (e) => e.key,
1655
- isItemDisabled: (t) => t.disabled || he.value && !e.has(t.key)
1656
- });
1657
- }), 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(() => ({
1658
- item: N.value.item(),
1659
- itemText: N.value.itemText(),
1660
- icon: N.value.icon(),
1661
- itemIndicator: N.value.itemIndicator(),
1662
- itemBody: N.value.itemBody(),
1663
- itemDescription: N.value.itemDescription(),
1664
- group: N.value.group(),
1665
- groupLabel: N.value.groupLabel(),
1666
- loading: N.value.loading(),
1667
- loadingIcon: N.value.loadingIcon(),
1668
- sentinel: N.value.sentinel(),
1669
- empty: N.value.empty(),
1670
- check: N.value.check(),
1671
- checkIcon: N.value.checkIcon()
1672
- })), Se = m(() => J.value.length ? J.value.length > o.maxShown ? (o.summary ?? a.common.selectedCount)(J.value.length) : J.value.map((e) => e.label).join(", ") : o.placeholder ?? a.common.placeholder), Ce = m(() => ie.value.filter((e) => !e.disabled)), we = m(() => ve(J.value, Ce.value)), Te = F("");
1673
- function Ee(e) {
1674
- let t = o.max !== void 0 && e.length >= o.max && J.value.length < o.max;
1675
- ce(e), t && (Te.value = P.maxReached(o.max));
1676
- }
1677
- function De(e, t) {
1678
- let n = o.max !== void 0 && e.length >= o.max && J.value.length < o.max;
1679
- le(e, t), n && (Te.value = P.maxReached(o.max));
1680
- }
1681
- function Oe(e) {
1682
- ce(J.value.filter((t) => t.key !== e.key)), Te.value = P.removed(e.label);
1683
- }
1684
- function ke(e) {
1685
- let t = J.value.at(-1);
1686
- t && (A.value && e.key === "Backspace" ? (e.preventDefault(), Oe(t)) : o.clearable && (e.key === "Delete" || e.key === "Backspace") && (e.preventDefault(), ce([])));
1687
- }
1688
- function Ae(e) {
1689
- ce([]), e.focus();
1690
- }
1691
- function Me(e, t) {
1692
- z.value = t.target.value, S("filterChange", z.value), o.dataSource && B.search(z.value), !(o.manualFilter || o.dataSource) && D(() => {
1693
- let t = K.value.find((e) => !e.disabled);
1694
- t && e.setHighlightValue(t.key);
1695
- });
1696
- }
1697
- function Ne(e) {
1698
- (e.key === " " || e.key === "Home" || e.key === "End") && e.stopPropagation();
1699
- }
1700
- function Pe(e) {
1701
- (e.key === " " || e.key === "Enter") && e.stopPropagation();
1702
- }
1703
- function Fe(e) {
1704
- e && B.open(), !e && z.value && (z.value = "", S("filterChange", ""), o.dataSource && B.search(""));
1705
- }
1706
- let Ie = (e) => e.highlightedItem ? e.getItemProps({ item: e.highlightedItem }).id : void 0, Le = {
1707
- sameWidth: !0,
1708
- gutter: 4
1709
- };
1710
- return (e, n) => (M(), h(H(Q).Root, {
1711
- class: O(N.value.base({ class: T.value.className })),
1712
- style: ee(T.value.style),
1713
- collection: _e.value,
1714
- multiple: "",
1715
- "close-on-select": !1,
1716
- "model-value": H(se),
1717
- disabled: t.disabled,
1718
- invalid: t.invalid,
1719
- required: t.required,
1720
- name: t.name,
1721
- positioning: Le,
1722
- composite: !ye.value,
1723
- "lazy-mount": "",
1724
- "unmount-on-exit": "",
1725
- onValueChange: n[1] ||= (e) => De(e.value, e.items),
1726
- onOpenChange: n[2] ||= (e) => Fe(e.open)
1727
- }, {
1728
- default: G(() => [
1729
- x(H(Q).Context, null, {
1730
- default: G((n) => [x(H(Q).Control, k(C(A.value || t.clearable ? { class: A.value ? N.value.chipsControl() : N.value.control() } : {})), {
1731
- default: G(() => [
1732
- A.value ? (M(!0), _(f, { key: 0 }, I(H(J), (e) => (M(), _("span", {
1733
- key: e.key,
1734
- class: O(N.value.chip())
1735
- }, [v("span", { class: O(N.value.chipText()) }, V(e.label), 3), n.disabled ? g("", !0) : (M(), _("button", {
1736
- key: 0,
1737
- type: "button",
1738
- tabindex: "-1",
1739
- class: O(N.value.chipRemove()),
1740
- "aria-label": H(P).removeItem(e.label),
1741
- onClick: (t) => Oe(e)
1742
- }, [x(H(ge), {
1743
- class: O(N.value.chipRemoveIcon()),
1744
- "aria-hidden": "true"
1745
- }, null, 8, ["class"])], 10, on))], 2))), 128)) : g("", !0),
1746
- x(H(Q).Trigger, E(T.value.rest, {
1747
- class: A.value ? N.value.chipsTrigger() : N.value.trigger(),
1748
- "aria-busy": t.loading || void 0,
1749
- onKeydown: ke
1750
- }), {
1751
- default: G(() => [A.value ? (M(), _("span", {
1752
- key: 0,
1753
- class: O(N.value.value()),
1754
- "data-placeholder-shown": !H(J).length || void 0
1755
- }, [H(J).length ? (M(), _("span", {
1756
- key: 0,
1757
- class: O(N.value.hiddenValue())
1758
- }, V(H(J).map((e) => e.label).join(", ")), 3)) : (M(), _(f, { key: 1 }, [b(V(t.placeholder ?? H(a).common.placeholder), 1)], 64))], 10, sn)) : (M(), _("span", {
1759
- key: 1,
1760
- class: O(N.value.value()),
1761
- "data-placeholder-shown": !H(J).length || void 0
1762
- }, [e.$slots.value && H(J).length ? L(e.$slots, "value", { items: H(J).map((e) => e.item) }, void 0, void 0, 0) : (M(), _(f, { key: 1 }, [b(V(Se.value), 1)], 64))], 10, cn)), x(H(Q).Indicator, { class: O(N.value.indicator()) }, {
1763
- default: G(() => [t.loading ? (M(), h(H(pe), {
1764
- key: 0,
1765
- class: O(N.value.spinner()),
1766
- "aria-hidden": "true"
1767
- }, null, 8, ["class"])) : (M(), h(H(oe), {
1768
- key: 1,
1769
- class: O(N.value.indicatorIcon()),
1770
- "aria-hidden": "true"
1771
- }, null, 8, ["class"]))]),
1772
- _: 1
1773
- }, 8, ["class"])]),
1774
- _: 3
1775
- }, 16, ["class", "aria-busy"]),
1776
- t.clearable && H(J).length && !n.disabled ? (M(), _("button", {
1777
- key: 1,
1778
- type: "button",
1779
- tabindex: "-1",
1780
- class: O(A.value ? N.value.chipsClear() : N.value.clear()),
1781
- "aria-label": H(P).clear,
1782
- onClick: (e) => Ae(n)
1783
- }, [x(H(ge), {
1784
- class: O(N.value.clearIcon()),
1785
- "aria-hidden": "true"
1786
- }, null, 8, ["class"])], 10, ln)) : g("", !0)
1787
- ]),
1788
- _: 2
1789
- }, 1040)]),
1790
- _: 3
1791
- }),
1792
- A.value || t.max !== void 0 || t.dataSource ? (M(), _("span", {
1793
- key: 0,
1794
- role: "status",
1795
- class: O(N.value.status())
1796
- }, V(Te.value || H(B).announcement.value), 3)) : g("", !0),
1797
- (M(), h(p, { to: "body" }, [x(H(Q).Positioner, null, {
1798
- default: G(() => [x(H(Q).Content, {
1799
- class: O(N.value.content()),
1800
- "aria-busy": ue.value || void 0,
1801
- "aria-label": ye.value ? T.value.rest["aria-label"] : void 0
1802
- }, {
1803
- default: G(() => [ye.value ? (M(), _(f, { key: 0 }, [v("div", { class: O(N.value.header()) }, [x(H(Q).Context, null, {
1804
- default: G((e) => [t.filter ? (M(), _("input", {
1805
- key: 0,
1806
- type: "text",
1807
- role: "combobox",
1808
- autocomplete: "off",
1809
- "aria-autocomplete": "list",
1810
- "aria-expanded": "true",
1811
- "data-autofocus": "",
1812
- "aria-controls": H(be),
1813
- "aria-activedescendant": Ie(e),
1814
- "aria-label": H(P).filter,
1815
- placeholder: H(a).combobox.search,
1816
- value: z.value,
1817
- class: O(N.value.search()),
1818
- onInput: (t) => Me(e, t),
1819
- onKeydown: Ne
1820
- }, null, 42, un)) : g("", !0)]),
1821
- _: 1
1822
- }), t.selectAll && Ce.value.length ? (M(), _("button", {
1823
- key: 0,
1824
- type: "button",
1825
- role: "checkbox",
1826
- "aria-checked": we.value,
1827
- class: O(N.value.selectAll()),
1828
- onClick: n[0] ||= (e) => Ee(H(Qe)(H(J), H(ie), t.max)),
1829
- onKeydown: Pe
1830
- }, [v("span", {
1831
- class: O(N.value.check()),
1832
- "data-state": we.value === "mixed" ? "indeterminate" : we.value ? "checked" : "unchecked",
1833
- "aria-hidden": "true"
1834
- }, [we.value === "mixed" ? (M(), h(H(me), {
1835
- key: 0,
1836
- class: O(N.value.checkIcon())
1837
- }, null, 8, ["class"])) : we.value ? (M(), h(H(ae), {
1838
- key: 1,
1839
- class: O(N.value.checkIcon())
1840
- }, null, 8, ["class"])) : g("", !0)], 10, fn), b(" " + V(H(P).selectAll), 1)], 42, dn)) : g("", !0)], 2), x(H(Q).List, {
1841
- id: H(be),
1842
- class: O(N.value.list()),
1843
- "data-autofocus": t.filter ? void 0 : ""
1844
- }, {
1845
- default: G(() => [x(s, {
1846
- parts: H(Q),
1847
- groups: H(U),
1848
- classes: xe.value,
1849
- checkbox: t.checkboxes,
1850
- loading: ue.value,
1851
- "loading-text": t.loadingText ?? H(a).common.loading,
1852
- "has-more": de.value,
1853
- "empty-text": Y.value,
1854
- onLoadMore: fe
1855
- }, y({ _: 2 }, [e.$slots.item ? {
1856
- name: "item",
1857
- fn: G((t) => [L(e.$slots, "item", k(C(t)))]),
1858
- key: "0"
1859
- } : void 0]), 1032, [
1860
- "parts",
1861
- "groups",
1862
- "classes",
1863
- "checkbox",
1864
- "loading",
1865
- "loading-text",
1866
- "has-more",
1867
- "empty-text"
1868
- ])]),
1869
- _: 3
1870
- }, 8, [
1871
- "id",
1872
- "class",
1873
- "data-autofocus"
1874
- ])], 64)) : (M(), h(s, {
1875
- key: 1,
1876
- parts: H(Q),
1877
- groups: H(U),
1878
- classes: xe.value,
1879
- checkbox: t.checkboxes,
1880
- loading: ue.value,
1881
- "loading-text": t.loadingText ?? H(a).common.loading,
1882
- "has-more": de.value,
1883
- "empty-text": Y.value,
1884
- onLoadMore: fe
1885
- }, y({ _: 2 }, [e.$slots.item ? {
1886
- name: "item",
1887
- fn: G((t) => [L(e.$slots, "item", k(C(t)))]),
1888
- key: "0"
1889
- } : void 0]), 1032, [
1890
- "parts",
1891
- "groups",
1892
- "classes",
1893
- "checkbox",
1894
- "loading",
1895
- "loading-text",
1896
- "has-more",
1897
- "empty-text"
1898
- ]))]),
1899
- _: 3
1900
- }, 8, [
1901
- "class",
1902
- "aria-busy",
1903
- "aria-label"
1904
- ])]),
1905
- _: 3
1906
- })])),
1907
- x(H(Q).HiddenSelect)
1908
- ]),
1909
- _: 3
1910
- }, 8, [
1911
- "class",
1912
- "style",
1913
- "collection",
1914
- "model-value",
1915
- "disabled",
1916
- "invalid",
1917
- "required",
1918
- "name",
1919
- "composite"
1920
- ]));
1921
- }
1922
- }), mn = ["id"], hn = ["id"], gn = /* @__PURE__ */ S({
1923
- inheritAttrs: !1,
1924
- __name: "NumberInput",
1925
- props: {
1926
- modelValue: { default: void 0 },
1927
- defaultValue: { default: void 0 },
1928
- min: {},
1929
- max: {},
1930
- step: {},
1931
- formatOptions: { default: () => xe },
1932
- locale: {},
1933
- size: {},
1934
- invalid: {
1935
- type: Boolean,
1936
- default: void 0
1937
- },
1938
- success: {
1939
- type: Boolean,
1940
- default: void 0
1941
- },
1942
- disabled: {
1943
- type: Boolean,
1944
- default: void 0
1945
- },
1946
- readOnly: {
1947
- type: Boolean,
1948
- default: void 0
1949
- },
1950
- required: {
1951
- type: Boolean,
1952
- default: void 0
1953
- },
1954
- name: {},
1955
- stepper: {
1956
- type: Boolean,
1957
- default: !0
1958
- },
1959
- stepperLayout: { default: "inline" },
1960
- prefix: {},
1961
- suffix: {},
1962
- allowNegative: {
1963
- type: Boolean,
1964
- default: !0
1965
- },
1966
- allowDecimal: {
1967
- type: Boolean,
1968
- default: !0
1969
- },
1970
- decimals: {},
1971
- clampBehavior: { default: "blur" },
1972
- selectOnFocus: { type: Boolean },
1973
- loading: { type: Boolean },
1974
- clearable: { type: Boolean },
1975
- clearLabel: {},
1976
- classes: {}
1977
- },
1978
- emits: ["update:modelValue"],
1979
- setup(o, { emit: s }) {
1980
- 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({
1981
- size: u.size,
1982
- stacked: u.stepperLayout === "stacked",
1983
- success: T.value
1984
- })), k = m(() => u.decimals === void 0 ? u.allowDecimal ? u.formatOptions : {
1985
- ...u.formatOptions,
1986
- maximumFractionDigits: 0
1987
- } : {
1988
- ...u.formatOptions,
1989
- minimumFractionDigits: u.decimals,
1990
- maximumFractionDigits: u.decimals
1991
- }), 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(() => ({
1992
- defaultValue: N,
1993
- min: A.value,
1994
- max: u.max,
1995
- step: u.step,
1996
- formatOptions: k.value,
1997
- locale: p.value,
1998
- invalid: u.invalid,
1999
- disabled: u.disabled,
2000
- readOnly: u.readOnly,
2001
- required: u.required,
2002
- name: u.name,
2003
- clampValueOnBlur: u.clampBehavior !== "none",
2004
- allowOverflow: u.clampBehavior !== "strict",
2005
- translations: l.numberInput,
2006
- onValueChange: (e) => {
2007
- P.value = e.value, j = Number.isNaN(e.valueAsNumber) ? null : e.valueAsNumber, v("update:modelValue", j);
2008
- }
2009
- })));
2010
- W(() => u.modelValue, (e) => {
2011
- e !== void 0 && e !== j && (e === null ? I.value.clearValue() : I.value.setValue(e));
2012
- });
2013
- function L(e) {
2014
- if (e.ctrlKey || e.metaKey || e.altKey) return;
2015
- 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, {
2016
- allowDecimal: u.allowDecimal && u.decimals !== 0,
2017
- allowNegative: u.allowNegative
2018
- });
2019
- i && (e.preventDefault(), i !== "block" && Te(t, i.insert));
2020
- }
2021
- function R(e) {
2022
- let t = e.currentTarget, n = (t.selectionStart ?? 0) === 0 && (t.selectionEnd ?? 0) === t.value.length, r = Ie(e.clipboardData?.getData("text") ?? "", p.value);
2023
- n && r !== null && (e.preventDefault(), Ve(t, Je(r, p.value, k.value)));
2024
- }
2025
- function z(e) {
2026
- if (!u.selectOnFocus) return;
2027
- let t = e.currentTarget;
2028
- requestAnimationFrame(() => t.select());
2029
- }
2030
- let B = ne(), re = ne(), U = m(() => u.prefix || u.suffix ? [
2031
- S?.value.ariaDescribedby,
2032
- u.prefix && B,
2033
- u.suffix && re,
2034
- b.value.rest["aria-describedby"]
2035
- ].filter(Boolean).join(" ") : void 0), K = m(() => !!u.disabled || !!u.readOnly || !!S?.value.disabled || !!S?.value.readOnly), q = ie("control");
2036
- function J() {
2037
- let e = q.value?.$el.querySelector("input");
2038
- e && (Ve(e), e.focus());
2039
- }
2040
- return (e, t) => (M(), h(H(pt).RootProvider, {
2041
- value: H(I),
2042
- class: O(D.value.base({ class: b.value.className })),
2043
- style: ee(b.value.style)
2044
- }, {
2045
- default: G(() => [x(H(pt).Control, {
2046
- ref_key: "control",
2047
- ref: q,
2048
- class: O(D.value.control())
2049
- }, {
2050
- default: G(() => [
2051
- o.prefix ? (M(), _("span", {
2052
- key: 0,
2053
- id: H(B),
2054
- class: O(D.value.prefix())
2055
- }, V(o.prefix), 11, mn)) : g("", !0),
2056
- x(H(pt).Input, E({
2057
- ...b.value.rest,
2058
- ...U.value ? { "aria-describedby": U.value } : {}
2059
- }, {
2060
- value: P.value,
2061
- class: D.value.input(),
2062
- "aria-busy": o.loading || void 0,
2063
- onKeydown: L,
2064
- onPaste: R,
2065
- onFocus: z
2066
- }), null, 16, [
2067
- "value",
2068
- "class",
2069
- "aria-busy"
2070
- ]),
2071
- o.loading || o.clearable || T.value ? (M(), h(a, {
2072
- key: 1,
2073
- loading: o.loading,
2074
- clear: o.clearable && !!P.value && !K.value,
2075
- "clear-label": o.clearLabel ?? H(l).field.clear,
2076
- success: T.value,
2077
- classes: {
2078
- spinner: D.value.spinner(),
2079
- clear: D.value.clear(),
2080
- clearIcon: D.value.clearIcon(),
2081
- statusIcon: D.value.statusIcon()
2082
- },
2083
- onClear: J
2084
- }, null, 8, [
2085
- "loading",
2086
- "clear",
2087
- "clear-label",
2088
- "success",
2089
- "classes"
2090
- ])) : g("", !0),
2091
- o.suffix ? (M(), _("span", {
2092
- key: 2,
2093
- id: H(re),
2094
- class: O(D.value.suffix())
2095
- }, V(o.suffix), 11, hn)) : g("", !0),
2096
- o.stepper && o.stepperLayout === "stacked" ? (M(), _("div", {
2097
- key: 3,
2098
- class: O(D.value.stepper())
2099
- }, [x(H(pt).IncrementTrigger, { class: O(D.value.button()) }, {
2100
- default: G(() => [x(H(le), {
2101
- class: O(D.value.buttonIcon()),
2102
- "aria-hidden": "true"
2103
- }, null, 8, ["class"])]),
2104
- _: 1
2105
- }, 8, ["class"]), x(H(pt).DecrementTrigger, { class: O(D.value.button()) }, {
2106
- default: G(() => [x(H(oe), {
2107
- class: O(D.value.buttonIcon()),
2108
- "aria-hidden": "true"
2109
- }, null, 8, ["class"])]),
2110
- _: 1
2111
- }, 8, ["class"])], 2)) : o.stepper ? (M(), _(f, { key: 4 }, [x(H(pt).DecrementTrigger, { class: O(D.value.button()) }, {
2112
- default: G(() => [x(H(me), {
2113
- class: O(D.value.buttonIcon()),
2114
- "aria-hidden": "true"
2115
- }, null, 8, ["class"])]),
2116
- _: 1
2117
- }, 8, ["class"]), x(H(pt).IncrementTrigger, { class: O(D.value.button()) }, {
2118
- default: G(() => [x(H(he), {
2119
- class: O(D.value.buttonIcon()),
2120
- "aria-hidden": "true"
2121
- }, null, 8, ["class"])]),
2122
- _: 1
2123
- }, 8, ["class"])], 64)) : g("", !0)
2124
- ]),
2125
- _: 1
2126
- }, 8, ["class"])]),
2127
- _: 1
2128
- }, 8, [
2129
- "value",
2130
- "class",
2131
- "style"
2132
- ]));
2133
- }
2134
- }), _n = /* @__PURE__ */ S({
2135
- __name: "ContextMenu",
2136
- props: {
2137
- items: {},
2138
- label: {},
2139
- linkAs: {},
2140
- classes: {}
2141
- },
2142
- emits: [
2143
- "select",
2144
- "checked-change",
2145
- "value-change"
2146
- ],
2147
- setup(e, { expose: t, emit: r }) {
2148
- let i = e, a = n("menu", ke, () => i.classes), o = r, s = a();
2149
- gt({
2150
- items: () => i.items,
2151
- linkAs: () => i.linkAs,
2152
- onCheckedChange: (e, t) => o("checked-change", e, t),
2153
- onValueChange: (e, t) => o("value-change", e, t)
2154
- });
2155
- let c = yt({
2156
- open: () => void 0,
2157
- anchor: () => void 0,
2158
- onOpenChange: () => {},
2159
- restoreFocus: !0
2160
- });
2161
- t(c.handle);
2162
- let l = be((e) => c.handle.open(e));
2163
- A(l.cancel);
2164
- let u = m(() => c.positioning({}));
2165
- return (t, n) => (M(), h(H(X).Root, {
2166
- open: H(c).isOpen.value,
2167
- positioning: u.value,
2168
- "anchor-point": H(c).anchorPoint.value,
2169
- "lazy-mount": "",
2170
- "unmount-on-exit": "",
2171
- "onUpdate:open": n[5] ||= (e) => H(c).onOpenChange(e),
2172
- onSelect: n[6] ||= (e) => o("select", e.value)
2173
- }, {
2174
- default: G(() => [x(H(X).ContextTrigger, {
2175
- "as-child": "",
2176
- onPointerdown: n[0] ||= (e) => H(l).down(e),
2177
- onPointermove: n[1] ||= (e) => H(l).move(e),
2178
- onPointerup: n[2] ||= (e) => H(l).cancel(),
2179
- onPointercancel: n[3] ||= (e) => H(l).cancel()
2180
- }, {
2181
- default: G(() => [L(t.$slots, "default")]),
2182
- _: 3
2183
- }), (M(), h(p, { to: "body" }, [x(H(X).Positioner, null, {
2184
- default: G(() => [x(H(X).Content, E({ class: H(s).content() }, e.label ? {
2185
- "aria-label": e.label,
2186
- "aria-labelledby": void 0
2187
- } : {}), {
2188
- default: G(() => [x(vt, {
2189
- entries: e.items,
2190
- onSelect: n[4] ||= (e) => o("select", e)
2191
- }, y({ _: 2 }, [t.$slots.item ? {
2192
- name: "item",
2193
- fn: G((e) => [L(t.$slots, "item", k(C(e)))]),
2194
- key: "0"
2195
- } : void 0]), 1032, ["entries"])]),
2196
- _: 3
2197
- }, 16, ["class"])]),
2198
- _: 3
2199
- })]))]),
2200
- _: 3
2201
- }, 8, [
2202
- "open",
2203
- "positioning",
2204
- "anchor-point"
2205
- ]));
2206
- }
2207
- });
2208
- //#endregion
2209
- export { gt as S, Ot as _, rn as a, yt as b, Jt as c, Xt as d, Gt as f, kt as g, Lt as h, an as i, Zt as l, zt as m, gn as n, Ht as o, Wt as p, pn as r, Vt as s, _n as t, Ut as u, Tt as v, vt as x, Ct as y };