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