@wirecore/wirelayer-react 0.7.0 → 0.9.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.
- package/dist/ContextMenu-GCeoPu8T.js +1523 -0
- package/dist/{Input-C8T3WLd5.js → Input-CtYSQznO.js} +41 -40
- package/dist/PasswordInput-CxZXGV2m.js +449 -0
- package/dist/Select-CGyqfOm3.js +256 -0
- package/dist/components/Alert/Alert.d.ts +3 -1
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +3 -1
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Card/Card.d.ts +3 -1
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +9 -5
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Code/Code.d.ts +11 -0
- package/dist/components/Code/Code.d.ts.map +1 -0
- package/dist/components/Combobox/Combobox.d.ts +10 -1
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +14 -4
- package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +12 -3
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +7 -2
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Menu/Menu.d.ts +27 -3
- package/dist/components/Menu/Menu.d.ts.map +1 -1
- package/dist/components/NativeSelect/NativeSelect.d.ts +14 -8
- package/dist/components/NativeSelect/NativeSelect.d.ts.map +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +12 -4
- package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts +7 -2
- package/dist/components/PasswordInput/PasswordInput.d.ts.map +1 -1
- package/dist/components/Progress/Progress.d.ts +15 -1
- package/dist/components/Progress/Progress.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +16 -7
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroupItem.d.ts +3 -2
- package/dist/components/RadioGroup/RadioGroupItem.d.ts.map +1 -1
- package/dist/components/RadioGroup/context.d.ts +3 -0
- package/dist/components/RadioGroup/context.d.ts.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +14 -5
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +20 -5
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.d.ts +3 -1
- package/dist/components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +11 -2
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +7 -2
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Wizard/Wizard.d.ts +11 -3
- package/dist/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/data-table.js +3 -3
- package/dist/form.js +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/media.d.ts +7 -0
- package/dist/hooks/media.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2111 -2026
- package/dist/pdf.js +2 -2
- package/dist/sources/Code.css +2 -0
- package/llms-full.txt +106 -28
- package/llms.txt +6 -4
- package/package.json +3 -3
- package/dist/ContextMenu-BD72S5n6.js +0 -1452
- package/dist/PasswordInput-SjO66gZB.js +0 -422
- package/dist/Select-7rfeNmJb.js +0 -242
|
@@ -0,0 +1,1523 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as e, i as t, n } from "./RecipesProvider-0idafuGm.js";
|
|
3
|
+
import { r, t as i } from "./InputStatus-hVzkU_4q.js";
|
|
4
|
+
import { t as a } from "./Input-CtYSQznO.js";
|
|
5
|
+
import { t as o } from "./Select-CGyqfOm3.js";
|
|
6
|
+
import { t as s } from "./label-for-DYgV5EwH.js";
|
|
7
|
+
import { a as c, c as l, n as u, o as d } from "./Highlight-43-H9459.js";
|
|
8
|
+
import { SUBMENU_GUTTER as f, allListOptionsState as p, anchorBox as m, closeMenuOnPageEvents as h, controlIds as g, createContextMenuSource as _, createLongPress as v, datePicker as y, defaultNumberFormat as b, filterMenuEntries as x, fromWallIso as S, highlightFirstMenuItem as C, indexListOptions as w, insertIntoTextControl as T, isoWeekday as E, linkTarget as D, localeWeekInfo as O, menu as k, menuSearchKey as A, multiSelect as ee, numberInput as j, numberInputKey as M, pageForSize as N, pagination as P, parseLocaleNumber as F, parsePastedDate as te, parsePastedRange as ne, pluralText as re, rowWeekNumber as I, setTextControlValue as ie, skeleton as L, textarea as ae, textareaParts as oe, timeSlots as se, timeZoneLabel as ce, timeZoneLongLabel as le, toNumberInputValue as ue, toOverlayAnchor as de, toWallIso as fe, todayIso as R, toggleAllListOptions as pe, zonedToInstant as me } from "@wirecore/wirelayer-recipes";
|
|
9
|
+
import { CalendarDays as z, Check as he, ChevronDown as ge, ChevronLeft as B, ChevronRight as V, ChevronUp as H, ChevronsLeft as _e, ChevronsRight as ve, Circle as ye, LoaderCircle as be, Minus as xe, Plus as Se, X as Ce } from "lucide-react";
|
|
10
|
+
import { Fragment as U, createContext as we, createElement as Te, useContext as Ee, useEffect as W, useId as De, useImperativeHandle as Oe, useLayoutEffect as ke, useMemo as Ae, useRef as G, useState as K } from "react";
|
|
11
|
+
import { useFilter as q } from "@ark-ui/react/locale";
|
|
12
|
+
import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
|
|
13
|
+
import { Menu as Z } from "@ark-ui/react/menu";
|
|
14
|
+
import { Portal as je } from "@ark-ui/react/portal";
|
|
15
|
+
import { Field as Me, useFieldContext as Ne } from "@ark-ui/react/field";
|
|
16
|
+
import { Pagination as Pe } from "@ark-ui/react/pagination";
|
|
17
|
+
import { createListCollection as Fe } from "@ark-ui/react/collection";
|
|
18
|
+
import { Select as Q } from "@ark-ui/react/select";
|
|
19
|
+
import { DatePicker as $, useDatePickerContext as Ie } from "@ark-ui/react/date-picker";
|
|
20
|
+
import { DateInput as Le } from "@ark-ui/react/date-input";
|
|
21
|
+
import { CalendarDateTime as Re, DateFormatter as ze, Time as Be, parseDate as Ve, parseDateTime as He, toCalendarDateTime as Ue } from "@internationalized/date";
|
|
22
|
+
import { NumberInput as We } from "@ark-ui/react/number-input";
|
|
23
|
+
//#region src/overlay.ts
|
|
24
|
+
var Ge = (e) => e && "current" in e ? e.current : e ?? null, Ke = typeof document > "u" ? W : ke;
|
|
25
|
+
function qe(e) {
|
|
26
|
+
let [t, n] = K(e.defaultOpen ?? !1), [r, i] = K(null), a = e.open ?? t, o = r ?? Ge(e.anchor), s = G(null), c = G(!1);
|
|
27
|
+
c.current = !!o;
|
|
28
|
+
let l = G(a);
|
|
29
|
+
Ke(() => {
|
|
30
|
+
if (l.current !== a) {
|
|
31
|
+
if (l.current = a, a) s.current = document.activeElement;
|
|
32
|
+
else if (e.restoreFocus) {
|
|
33
|
+
let e = s.current, t = () => {
|
|
34
|
+
if (l.current) return;
|
|
35
|
+
let t = document.activeElement;
|
|
36
|
+
(!t || t === document.body || !t.isConnected || t.closest("[data-scope=menu]")) && e?.focus();
|
|
37
|
+
};
|
|
38
|
+
requestAnimationFrame(() => {
|
|
39
|
+
t(), setTimeout(t, 50);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}, [a]);
|
|
44
|
+
let u = (t) => {
|
|
45
|
+
n(t), e.onOpenChange?.(t);
|
|
46
|
+
}, d = (e) => {
|
|
47
|
+
e && i(null), u(e);
|
|
48
|
+
}, f = {
|
|
49
|
+
open(e) {
|
|
50
|
+
i(de(e)), u(!0);
|
|
51
|
+
},
|
|
52
|
+
close: () => u(!1),
|
|
53
|
+
toggle(e) {
|
|
54
|
+
a ? f.close() : f.open(e);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
return Oe(e.ref, () => f), {
|
|
58
|
+
isOpen: a,
|
|
59
|
+
anchor: o,
|
|
60
|
+
anchorPoint: o && !("getBoundingClientRect" in o) ? o : void 0,
|
|
61
|
+
onOpenChange: d,
|
|
62
|
+
handle: f,
|
|
63
|
+
positioning: (e) => o ? "getBoundingClientRect" in o ? {
|
|
64
|
+
...e,
|
|
65
|
+
getAnchorElement: () => o
|
|
66
|
+
} : {
|
|
67
|
+
...e,
|
|
68
|
+
getAnchorRect: () => m(o)
|
|
69
|
+
} : e,
|
|
70
|
+
finalFocusEl: () => c.current ? s.current : null
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/components/Menu/Menu.tsx
|
|
75
|
+
var Je = we(null);
|
|
76
|
+
function Ye(e) {
|
|
77
|
+
let [t, n] = K({
|
|
78
|
+
items: e.items,
|
|
79
|
+
checked: {},
|
|
80
|
+
radio: {}
|
|
81
|
+
}), r = t.items === e.items ? t : {
|
|
82
|
+
items: e.items,
|
|
83
|
+
checked: {},
|
|
84
|
+
radio: {}
|
|
85
|
+
};
|
|
86
|
+
return r !== t && n(r), {
|
|
87
|
+
checked: (e) => r.checked[e.value] ?? e.checked ?? !1,
|
|
88
|
+
setChecked: (t, i) => {
|
|
89
|
+
n({
|
|
90
|
+
...r,
|
|
91
|
+
checked: {
|
|
92
|
+
...r.checked,
|
|
93
|
+
[t.value]: i
|
|
94
|
+
}
|
|
95
|
+
}), e.onCheckedChange?.(t.value, i);
|
|
96
|
+
},
|
|
97
|
+
radio: (e) => r.radio[e.name] ?? e.value,
|
|
98
|
+
setRadio: (t, i) => {
|
|
99
|
+
n({
|
|
100
|
+
...r,
|
|
101
|
+
radio: {
|
|
102
|
+
...r.radio,
|
|
103
|
+
[t.name]: i
|
|
104
|
+
}
|
|
105
|
+
}), e.onValueChange?.(t.name, i);
|
|
106
|
+
},
|
|
107
|
+
linkAs: e.linkAs ?? "a",
|
|
108
|
+
renderItem: e.renderItem
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function Xe({ children: e, ...t }) {
|
|
112
|
+
return /* @__PURE__ */ Y(Je.Provider, {
|
|
113
|
+
value: Ye(t),
|
|
114
|
+
children: e
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function Ze(e, t, n, { closeOnScroll: r = !1, closeOnResize: i = !1, closeOnBlur: a = !1, highlightFirst: o = !1 }) {
|
|
118
|
+
let s = G(t);
|
|
119
|
+
W(() => {
|
|
120
|
+
s.current = t;
|
|
121
|
+
}), W(() => {
|
|
122
|
+
if (e && (r || i || a)) return h(() => s.current(), {
|
|
123
|
+
scroll: r,
|
|
124
|
+
resize: i,
|
|
125
|
+
blur: a
|
|
126
|
+
});
|
|
127
|
+
}, [
|
|
128
|
+
e,
|
|
129
|
+
r,
|
|
130
|
+
i,
|
|
131
|
+
a
|
|
132
|
+
]);
|
|
133
|
+
let [c, l] = K(null), [u, d] = K(e);
|
|
134
|
+
return u !== e && (d(e), l(null)), W(() => {
|
|
135
|
+
if (!e || !o) return;
|
|
136
|
+
let t = requestAnimationFrame(() => {
|
|
137
|
+
n.current && C(n.current, { setHighlightedValue: (e) => l((t) => t ?? e) });
|
|
138
|
+
});
|
|
139
|
+
return () => cancelAnimationFrame(t);
|
|
140
|
+
}, [
|
|
141
|
+
e,
|
|
142
|
+
o,
|
|
143
|
+
n
|
|
144
|
+
]), o ? {
|
|
145
|
+
highlightedValue: c,
|
|
146
|
+
onHighlightChange: (e) => l(e.highlightedValue)
|
|
147
|
+
} : {};
|
|
148
|
+
}
|
|
149
|
+
function Qe({ classes: t, items: r, onSelect: i, onCheckedChange: a, onValueChange: o, linkAs: s, renderItem: c, open: l, defaultOpen: u, onOpenChange: d, anchor: f, searchable: p, searchLabel: m, placement: h = "bottom-start", arrow: g, closeOnScroll: _, closeOnResize: v, closeOnBlur: y, highlightFirst: b, ref: S, children: w }) {
|
|
150
|
+
let T = n("menu", k, t)(), E = e(), D = qe({
|
|
151
|
+
open: l,
|
|
152
|
+
defaultOpen: u,
|
|
153
|
+
anchor: f,
|
|
154
|
+
onOpenChange: d,
|
|
155
|
+
ref: S,
|
|
156
|
+
restoreFocus: !0
|
|
157
|
+
}), [O, ee] = K(""), [j, M] = K(), N = q({
|
|
158
|
+
sensitivity: "base",
|
|
159
|
+
usage: "sort"
|
|
160
|
+
}), P = p && O ? x(r, (e) => N.contains(e, O)) : r, F = G(null), [te, ne] = K(D.isOpen);
|
|
161
|
+
te !== D.isOpen && (ne(D.isOpen), ee(""), M(void 0)), W(() => {
|
|
162
|
+
if (!D.isOpen || !p) return;
|
|
163
|
+
let e = requestAnimationFrame(() => {
|
|
164
|
+
e = requestAnimationFrame(() => F.current?.focus());
|
|
165
|
+
});
|
|
166
|
+
return () => cancelAnimationFrame(e);
|
|
167
|
+
}, [D.isOpen, p]);
|
|
168
|
+
let re = m ?? E.menu.search, I = G(null), ie = Ze(D.isOpen, D.handle.close, I, {
|
|
169
|
+
closeOnScroll: _,
|
|
170
|
+
closeOnResize: v,
|
|
171
|
+
closeOnBlur: y,
|
|
172
|
+
highlightFirst: b
|
|
173
|
+
});
|
|
174
|
+
return /* @__PURE__ */ Y(Xe, {
|
|
175
|
+
items: r,
|
|
176
|
+
linkAs: s,
|
|
177
|
+
renderItem: c,
|
|
178
|
+
onCheckedChange: a,
|
|
179
|
+
onValueChange: o,
|
|
180
|
+
children: /* @__PURE__ */ X(Z.Root, {
|
|
181
|
+
open: D.isOpen,
|
|
182
|
+
onOpenChange: (e) => D.onOpenChange(e.open),
|
|
183
|
+
positioning: D.positioning({
|
|
184
|
+
placement: h,
|
|
185
|
+
gutter: g ? 10 : 8
|
|
186
|
+
}),
|
|
187
|
+
anchorPoint: D.anchorPoint,
|
|
188
|
+
...ie,
|
|
189
|
+
lazyMount: !0,
|
|
190
|
+
unmountOnExit: !0,
|
|
191
|
+
onSelect: (e) => i?.(e.value),
|
|
192
|
+
children: [w && /* @__PURE__ */ Y(Z.Trigger, {
|
|
193
|
+
asChild: !0,
|
|
194
|
+
children: w
|
|
195
|
+
}), /* @__PURE__ */ Y(je, { children: /* @__PURE__ */ Y(Z.Positioner, { children: /* @__PURE__ */ X(Z.Content, {
|
|
196
|
+
ref: I,
|
|
197
|
+
className: T.content(),
|
|
198
|
+
children: [
|
|
199
|
+
g && /* @__PURE__ */ Y(Z.Arrow, {
|
|
200
|
+
className: T.arrow(),
|
|
201
|
+
children: /* @__PURE__ */ Y(Z.ArrowTip, { className: T.arrowTip() })
|
|
202
|
+
}),
|
|
203
|
+
p && /* @__PURE__ */ Y(Z.Context, { children: (e) => /* @__PURE__ */ Y("div", {
|
|
204
|
+
role: "group",
|
|
205
|
+
"aria-label": re,
|
|
206
|
+
className: T.search(),
|
|
207
|
+
children: /* @__PURE__ */ Y("input", {
|
|
208
|
+
ref: F,
|
|
209
|
+
type: "text",
|
|
210
|
+
autoComplete: "off",
|
|
211
|
+
className: T.searchInput(),
|
|
212
|
+
placeholder: re,
|
|
213
|
+
"aria-label": re,
|
|
214
|
+
"aria-activedescendant": j,
|
|
215
|
+
onChange: (t) => {
|
|
216
|
+
let n = t.currentTarget;
|
|
217
|
+
ee(n.value), requestAnimationFrame(() => M(C(n, e)));
|
|
218
|
+
},
|
|
219
|
+
onKeyDown: (t) => {
|
|
220
|
+
let n = A(t.nativeEvent, e);
|
|
221
|
+
n && M(n);
|
|
222
|
+
}
|
|
223
|
+
})
|
|
224
|
+
}) }),
|
|
225
|
+
/* @__PURE__ */ Y(et, {
|
|
226
|
+
entries: P,
|
|
227
|
+
onSelect: i
|
|
228
|
+
}),
|
|
229
|
+
p && !P.length && /* @__PURE__ */ Y("div", {
|
|
230
|
+
role: "group",
|
|
231
|
+
className: T.empty(),
|
|
232
|
+
children: /* @__PURE__ */ Y("span", {
|
|
233
|
+
role: "status",
|
|
234
|
+
children: E.common.noResults
|
|
235
|
+
})
|
|
236
|
+
})
|
|
237
|
+
]
|
|
238
|
+
}) }) })]
|
|
239
|
+
})
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
function $e({ item: e, shortcut: t }) {
|
|
243
|
+
let r = Ee(Je), i = n("menu", k)();
|
|
244
|
+
if (r?.renderItem) return r.renderItem(e);
|
|
245
|
+
let a = e.icon;
|
|
246
|
+
return /* @__PURE__ */ X(J, { children: [
|
|
247
|
+
a && /* @__PURE__ */ Y(a, {
|
|
248
|
+
className: i.icon(),
|
|
249
|
+
"aria-hidden": "true"
|
|
250
|
+
}),
|
|
251
|
+
/* @__PURE__ */ Y("span", {
|
|
252
|
+
className: i.label(),
|
|
253
|
+
children: e.label
|
|
254
|
+
}),
|
|
255
|
+
t && /* @__PURE__ */ Y("span", {
|
|
256
|
+
className: i.shortcut(),
|
|
257
|
+
"aria-hidden": "true",
|
|
258
|
+
children: t
|
|
259
|
+
})
|
|
260
|
+
] });
|
|
261
|
+
}
|
|
262
|
+
function et({ entries: e, onSelect: t }) {
|
|
263
|
+
let r = n("menu", k), i = r(), a = Ee(Je);
|
|
264
|
+
return e.map((e, n) => {
|
|
265
|
+
if ("type" in e) return e.type === "separator" ? /* @__PURE__ */ Y(Z.Separator, { className: i.separator() }, `separator-${n}`) : e.type === "checkbox" ? /* @__PURE__ */ X(Z.CheckboxItem, {
|
|
266
|
+
value: e.value,
|
|
267
|
+
checked: a?.checked(e) ?? !!e.checked,
|
|
268
|
+
onCheckedChange: (t) => a?.setChecked(e, t),
|
|
269
|
+
disabled: e.disabled,
|
|
270
|
+
closeOnSelect: e.closeOnSelect ?? !1,
|
|
271
|
+
className: i.item(),
|
|
272
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
273
|
+
className: i.indicator(),
|
|
274
|
+
children: /* @__PURE__ */ Y(Z.ItemIndicator, { children: /* @__PURE__ */ Y(he, {
|
|
275
|
+
className: i.indicatorIcon(),
|
|
276
|
+
"aria-hidden": "true"
|
|
277
|
+
}) })
|
|
278
|
+
}), /* @__PURE__ */ Y($e, { item: e })]
|
|
279
|
+
}, e.value) : e.type === "radio" ? /* @__PURE__ */ X(Z.RadioItemGroup, {
|
|
280
|
+
value: a?.radio(e),
|
|
281
|
+
onValueChange: (t) => a?.setRadio(e, t.value),
|
|
282
|
+
children: [e.label && /* @__PURE__ */ Y(Z.ItemGroupLabel, {
|
|
283
|
+
className: i.groupLabel(),
|
|
284
|
+
children: e.label
|
|
285
|
+
}), e.items.map((e) => /* @__PURE__ */ X(Z.RadioItem, {
|
|
286
|
+
value: e.value,
|
|
287
|
+
disabled: e.disabled,
|
|
288
|
+
closeOnSelect: e.closeOnSelect ?? !1,
|
|
289
|
+
className: i.item(),
|
|
290
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
291
|
+
className: i.indicator(),
|
|
292
|
+
children: /* @__PURE__ */ Y(Z.ItemIndicator, { children: /* @__PURE__ */ Y(ye, {
|
|
293
|
+
className: i.indicatorDot(),
|
|
294
|
+
"aria-hidden": "true"
|
|
295
|
+
}) })
|
|
296
|
+
}), /* @__PURE__ */ Y($e, { item: e })]
|
|
297
|
+
}, e.value))]
|
|
298
|
+
}, `radio-${e.name}`) : /* @__PURE__ */ X(Z.ItemGroup, { children: [/* @__PURE__ */ Y(Z.ItemGroupLabel, {
|
|
299
|
+
className: i.groupLabel(),
|
|
300
|
+
children: e.label
|
|
301
|
+
}), /* @__PURE__ */ Y(et, {
|
|
302
|
+
entries: e.items,
|
|
303
|
+
onSelect: t
|
|
304
|
+
})] }, `group-${n}`);
|
|
305
|
+
let o = e.icon;
|
|
306
|
+
if (e.children) return /* @__PURE__ */ X(Z.Root, {
|
|
307
|
+
positioning: {
|
|
308
|
+
placement: "right-start",
|
|
309
|
+
offset: { mainAxis: f }
|
|
310
|
+
},
|
|
311
|
+
onSelect: (e) => t?.(e.value),
|
|
312
|
+
children: [/* @__PURE__ */ X(Z.TriggerItem, {
|
|
313
|
+
className: i.item(),
|
|
314
|
+
children: [
|
|
315
|
+
o && /* @__PURE__ */ Y(o, {
|
|
316
|
+
className: i.icon(),
|
|
317
|
+
"aria-hidden": "true"
|
|
318
|
+
}),
|
|
319
|
+
/* @__PURE__ */ Y("span", {
|
|
320
|
+
className: i.label(),
|
|
321
|
+
children: e.label
|
|
322
|
+
}),
|
|
323
|
+
/* @__PURE__ */ Y(V, {
|
|
324
|
+
className: i.submenuIcon(),
|
|
325
|
+
"aria-hidden": "true"
|
|
326
|
+
})
|
|
327
|
+
]
|
|
328
|
+
}), /* @__PURE__ */ Y(je, { children: /* @__PURE__ */ Y(Z.Positioner, { children: /* @__PURE__ */ Y(Z.Content, {
|
|
329
|
+
className: i.content(),
|
|
330
|
+
children: /* @__PURE__ */ Y(et, {
|
|
331
|
+
entries: e.children,
|
|
332
|
+
onSelect: t
|
|
333
|
+
})
|
|
334
|
+
}) }) })]
|
|
335
|
+
}, e.value);
|
|
336
|
+
if (e.href || e.to) {
|
|
337
|
+
let t = a?.linkAs ?? "a";
|
|
338
|
+
return /* @__PURE__ */ Y(Z.Item, {
|
|
339
|
+
value: e.value,
|
|
340
|
+
disabled: e.disabled,
|
|
341
|
+
closeOnSelect: e.closeOnSelect,
|
|
342
|
+
asChild: !0,
|
|
343
|
+
children: /* @__PURE__ */ Y(t, {
|
|
344
|
+
...D(e.href, e.to),
|
|
345
|
+
className: r({ danger: e.danger }).item(),
|
|
346
|
+
children: /* @__PURE__ */ Y($e, {
|
|
347
|
+
item: e,
|
|
348
|
+
shortcut: e.shortcut
|
|
349
|
+
})
|
|
350
|
+
})
|
|
351
|
+
}, e.value);
|
|
352
|
+
}
|
|
353
|
+
return /* @__PURE__ */ Y(U, { children: /* @__PURE__ */ Y(Z.Item, {
|
|
354
|
+
value: e.value,
|
|
355
|
+
disabled: e.disabled,
|
|
356
|
+
closeOnSelect: e.closeOnSelect,
|
|
357
|
+
className: r({ danger: e.danger }).item(),
|
|
358
|
+
children: /* @__PURE__ */ Y($e, {
|
|
359
|
+
item: e,
|
|
360
|
+
shortcut: e.shortcut
|
|
361
|
+
})
|
|
362
|
+
}) }, e.value);
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
//#endregion
|
|
366
|
+
//#region src/components/Textarea/Textarea.tsx
|
|
367
|
+
function tt({ classes: t, size: a, invalid: o = !1, success: s = !1, disabled: c = !1, autoResize: l = !1, minRows: u, maxRows: d, showCount: f = !1, loading: p = !1, clearable: m = !1, clearLabel: h, mono: g = !1, className: _, style: v, onInput: y, onChange: b, ref: x, ...S }) {
|
|
368
|
+
let C = n("textarea", ae, t), w = n("textareaParts", oe, t), T = e(), E = Ne(), D = r(), O = o || !!E?.invalid, k = !O && (s || D.success), A = c || !!E?.disabled, ee = !!S.readOnly || !!E?.readOnly, j = G(null);
|
|
369
|
+
Oe(x, () => j.current, []);
|
|
370
|
+
let M = S.maxLength && S.maxLength > 0 ? S.maxLength : void 0, N = f && M !== void 0, P = p || m || k, F = N || p || m, [te, ne] = K(() => String(S.defaultValue ?? "").length), re = S.value === void 0 ? te : String(S.value ?? "").length, I = () => {
|
|
371
|
+
let e = j.current;
|
|
372
|
+
if (!l || !e) return;
|
|
373
|
+
e.style.height = "auto";
|
|
374
|
+
let t = e.offsetHeight - e.clientHeight, n = e.scrollHeight + t;
|
|
375
|
+
if (u || d) {
|
|
376
|
+
let r = getComputedStyle(e), i = parseFloat(r.lineHeight) || parseFloat(r.fontSize) * 1.5, a = parseFloat(r.paddingTop) + parseFloat(r.paddingBottom) + t, o = d ? d * i + a : Infinity;
|
|
377
|
+
e.style.overflowY = n > o ? "auto" : "", n = Math.min(Math.max(n, u ? u * i + a : 0), o);
|
|
378
|
+
}
|
|
379
|
+
e.style.height = `${n}px`;
|
|
380
|
+
};
|
|
381
|
+
ke(I);
|
|
382
|
+
let L = De(), [se, ce] = K(""), le = G(void 0);
|
|
383
|
+
W(() => () => clearTimeout(le.current), []);
|
|
384
|
+
let ue = (e) => {
|
|
385
|
+
N && (clearTimeout(le.current), le.current = setTimeout(() => ce(T.textarea.remaining(M - e, M)), 1e3));
|
|
386
|
+
}, de = () => {
|
|
387
|
+
let e = j.current;
|
|
388
|
+
e && (ie(e), e.focus());
|
|
389
|
+
}, fe = /* @__PURE__ */ Y(Me.Textarea, {
|
|
390
|
+
...S,
|
|
391
|
+
ref: j,
|
|
392
|
+
rows: S.rows ?? u,
|
|
393
|
+
className: C({
|
|
394
|
+
size: a,
|
|
395
|
+
invalid: O,
|
|
396
|
+
success: k,
|
|
397
|
+
disabled: A,
|
|
398
|
+
autoResize: l,
|
|
399
|
+
hasTrailing: F ? P : void 0,
|
|
400
|
+
mono: g,
|
|
401
|
+
class: F ? void 0 : _
|
|
402
|
+
}),
|
|
403
|
+
style: F ? void 0 : v,
|
|
404
|
+
disabled: A || void 0,
|
|
405
|
+
"aria-invalid": O || void 0,
|
|
406
|
+
...F ? {
|
|
407
|
+
"aria-describedby": [
|
|
408
|
+
E?.ariaDescribedby,
|
|
409
|
+
N && L,
|
|
410
|
+
S["aria-describedby"]
|
|
411
|
+
].filter(Boolean).join(" ") || void 0,
|
|
412
|
+
"aria-busy": p || void 0
|
|
413
|
+
} : {},
|
|
414
|
+
onInput: (e) => {
|
|
415
|
+
I(), y?.(e);
|
|
416
|
+
},
|
|
417
|
+
onChange: (e) => {
|
|
418
|
+
ne(e.currentTarget.value.length), ue(e.currentTarget.value.length), b?.(e);
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
if (!F) return fe;
|
|
422
|
+
let R = w();
|
|
423
|
+
return /* @__PURE__ */ X("div", {
|
|
424
|
+
className: R.base({ class: _ }),
|
|
425
|
+
style: v,
|
|
426
|
+
children: [
|
|
427
|
+
fe,
|
|
428
|
+
P && /* @__PURE__ */ Y("div", {
|
|
429
|
+
className: R.trailing(),
|
|
430
|
+
children: /* @__PURE__ */ Y(i, {
|
|
431
|
+
loading: p,
|
|
432
|
+
clear: m && re > 0 && !A && !ee,
|
|
433
|
+
clearLabel: h ?? T.field.clear,
|
|
434
|
+
onClear: de,
|
|
435
|
+
success: k,
|
|
436
|
+
classes: {
|
|
437
|
+
spinner: R.spinner(),
|
|
438
|
+
clear: R.clear(),
|
|
439
|
+
clearIcon: R.clearIcon(),
|
|
440
|
+
statusIcon: R.statusIcon()
|
|
441
|
+
}
|
|
442
|
+
})
|
|
443
|
+
}),
|
|
444
|
+
N && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("span", {
|
|
445
|
+
id: L,
|
|
446
|
+
className: R.counter(),
|
|
447
|
+
"aria-hidden": "true",
|
|
448
|
+
children: T.textarea.counter(re, M)
|
|
449
|
+
}), /* @__PURE__ */ Y("span", {
|
|
450
|
+
className: R.status(),
|
|
451
|
+
role: "status",
|
|
452
|
+
children: se
|
|
453
|
+
})] })
|
|
454
|
+
]
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
//#endregion
|
|
458
|
+
//#region src/components/Pagination/Pagination.tsx
|
|
459
|
+
function nt({ classes: t, count: r, pageSize: i = 10, onPageSizeChange: s, page: c, defaultPage: l, onPageChange: u, siblingCount: d = 1, boundaryCount: f, showSummary: p = !0, summary: m, pageSizes: h, jumper: g, variant: _ = "full", withEdges: v, hideSinglePage: y, getPageHref: b, translations: x, className: S, ...C }) {
|
|
460
|
+
let w = n("pagination", P, t)({ responsive: _ === "auto" }), T = e(), [E, D] = K(i), [O, k] = K(i);
|
|
461
|
+
O !== i && (k(i), D(i));
|
|
462
|
+
let A = (e) => ({
|
|
463
|
+
start: Math.min((e - 1) * E + 1, r),
|
|
464
|
+
end: Math.min(e * E, r),
|
|
465
|
+
count: r
|
|
466
|
+
});
|
|
467
|
+
if (y && r <= E) return null;
|
|
468
|
+
let ee = b ? "a" : "button", j = (e, t, n = !1) => Te(ee, {
|
|
469
|
+
className: e,
|
|
470
|
+
...b && n ? {
|
|
471
|
+
role: "link",
|
|
472
|
+
"aria-disabled": "true"
|
|
473
|
+
} : {}
|
|
474
|
+
}, t), M = (e, t) => {
|
|
475
|
+
if (!t || t === E) return;
|
|
476
|
+
let n = N(e.page, E, t);
|
|
477
|
+
D(t), s?.(t), requestAnimationFrame(() => e.setPage(n));
|
|
478
|
+
}, F = (e, t) => {
|
|
479
|
+
if (e.key !== "Enter") return;
|
|
480
|
+
let n = e.currentTarget, r = Number.parseInt(n.value, 10);
|
|
481
|
+
Number.isNaN(r) || (e.preventDefault(), t.setPage(Math.min(Math.max(r, 1), t.totalPages)), n.value = "");
|
|
482
|
+
};
|
|
483
|
+
return /* @__PURE__ */ Y(Pe.Root, {
|
|
484
|
+
...C,
|
|
485
|
+
className: w.base({ class: S }),
|
|
486
|
+
count: r,
|
|
487
|
+
pageSize: E,
|
|
488
|
+
page: c,
|
|
489
|
+
defaultPage: l,
|
|
490
|
+
onPageChange: (e) => u?.(e.page),
|
|
491
|
+
siblingCount: d,
|
|
492
|
+
boundaryCount: f,
|
|
493
|
+
type: b ? "link" : "button",
|
|
494
|
+
getPageUrl: b ? (e) => b(e.page) : void 0,
|
|
495
|
+
translations: {
|
|
496
|
+
...T.pagination,
|
|
497
|
+
...x
|
|
498
|
+
},
|
|
499
|
+
children: /* @__PURE__ */ Y(Pe.Context, { children: (e) => /* @__PURE__ */ X(J, { children: [
|
|
500
|
+
p && /* @__PURE__ */ Y("span", {
|
|
501
|
+
className: w.summary(),
|
|
502
|
+
"aria-live": "polite",
|
|
503
|
+
children: (m ?? T.pagination.summary)(A(e.page))
|
|
504
|
+
}),
|
|
505
|
+
!!h?.length && /* @__PURE__ */ X("div", {
|
|
506
|
+
className: w.pageSize(),
|
|
507
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
508
|
+
"aria-hidden": "true",
|
|
509
|
+
children: T.pagination.pageSize
|
|
510
|
+
}), /* @__PURE__ */ Y(o, {
|
|
511
|
+
className: w.pageSizeSelect(),
|
|
512
|
+
size: "sm",
|
|
513
|
+
items: h.map((e) => ({
|
|
514
|
+
value: e,
|
|
515
|
+
label: String(e)
|
|
516
|
+
})),
|
|
517
|
+
value: E,
|
|
518
|
+
"aria-label": T.pagination.pageSize,
|
|
519
|
+
onValueChange: (t) => M(e, t)
|
|
520
|
+
})]
|
|
521
|
+
}),
|
|
522
|
+
/* @__PURE__ */ X("div", {
|
|
523
|
+
className: w.list(),
|
|
524
|
+
children: [
|
|
525
|
+
v && /* @__PURE__ */ Y(Pe.FirstTrigger, {
|
|
526
|
+
asChild: !0,
|
|
527
|
+
children: j(w.trigger(), /* @__PURE__ */ Y(_e, {
|
|
528
|
+
className: w.triggerIcon(),
|
|
529
|
+
"aria-hidden": "true"
|
|
530
|
+
}), e.page === 1)
|
|
531
|
+
}),
|
|
532
|
+
/* @__PURE__ */ Y(Pe.PrevTrigger, {
|
|
533
|
+
asChild: !0,
|
|
534
|
+
children: j(w.trigger(), /* @__PURE__ */ Y(B, {
|
|
535
|
+
className: w.triggerIcon(),
|
|
536
|
+
"aria-hidden": "true"
|
|
537
|
+
}), e.page === 1)
|
|
538
|
+
}),
|
|
539
|
+
_ !== "full" && /* @__PURE__ */ Y("span", {
|
|
540
|
+
className: w.compact(),
|
|
541
|
+
children: T.pagination.compact(e.page, e.totalPages)
|
|
542
|
+
}),
|
|
543
|
+
_ !== "compact" && e.pages.map((e, t) => e.type === "page" ? /* @__PURE__ */ Y(Pe.Item, {
|
|
544
|
+
...e,
|
|
545
|
+
asChild: !0,
|
|
546
|
+
children: j(w.item(), e.value)
|
|
547
|
+
}, t) : /* @__PURE__ */ Y(Pe.Ellipsis, {
|
|
548
|
+
index: t,
|
|
549
|
+
className: w.ellipsis(),
|
|
550
|
+
"aria-hidden": "true",
|
|
551
|
+
children: "…"
|
|
552
|
+
}, t)),
|
|
553
|
+
/* @__PURE__ */ Y(Pe.NextTrigger, {
|
|
554
|
+
asChild: !0,
|
|
555
|
+
children: j(w.trigger(), /* @__PURE__ */ Y(V, {
|
|
556
|
+
className: w.triggerIcon(),
|
|
557
|
+
"aria-hidden": "true"
|
|
558
|
+
}), e.page === e.totalPages)
|
|
559
|
+
}),
|
|
560
|
+
v && /* @__PURE__ */ Y(Pe.LastTrigger, {
|
|
561
|
+
asChild: !0,
|
|
562
|
+
children: j(w.trigger(), /* @__PURE__ */ Y(ve, {
|
|
563
|
+
className: w.triggerIcon(),
|
|
564
|
+
"aria-hidden": "true"
|
|
565
|
+
}), e.page === e.totalPages)
|
|
566
|
+
})
|
|
567
|
+
]
|
|
568
|
+
}),
|
|
569
|
+
g && /* @__PURE__ */ X("div", {
|
|
570
|
+
className: w.jumper(),
|
|
571
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
572
|
+
"aria-hidden": "true",
|
|
573
|
+
children: T.pagination.jumper
|
|
574
|
+
}), /* @__PURE__ */ Y(a, {
|
|
575
|
+
className: w.jumperInput(),
|
|
576
|
+
size: "sm",
|
|
577
|
+
inputMode: "numeric",
|
|
578
|
+
autoComplete: "off",
|
|
579
|
+
"aria-label": T.pagination.jumper,
|
|
580
|
+
onKeyDown: (t) => F(t, e)
|
|
581
|
+
})]
|
|
582
|
+
})
|
|
583
|
+
] }) })
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
//#endregion
|
|
587
|
+
//#region src/components/Skeleton/Skeleton.tsx
|
|
588
|
+
function rt({ classes: e, shape: t, width: r, height: i, className: a, style: o, ...s }) {
|
|
589
|
+
let c = n("skeleton", L, e);
|
|
590
|
+
return /* @__PURE__ */ Y("span", {
|
|
591
|
+
"aria-hidden": "true",
|
|
592
|
+
...s,
|
|
593
|
+
className: c({
|
|
594
|
+
shape: t,
|
|
595
|
+
class: a
|
|
596
|
+
}),
|
|
597
|
+
style: {
|
|
598
|
+
width: r,
|
|
599
|
+
height: i,
|
|
600
|
+
...o
|
|
601
|
+
}
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
//#endregion
|
|
605
|
+
//#region src/components/DatePicker/dates.ts
|
|
606
|
+
var it = (e, t) => e ? e.toString().slice(0, t ? 16 : 10) : null;
|
|
607
|
+
function at(e, t, n) {
|
|
608
|
+
return t ? e.includes("T") ? He(e.slice(0, 16)) : He(`${e}T${n === "max" ? "23:59" : "00:00"}`) : Ve(e.slice(0, 10));
|
|
609
|
+
}
|
|
610
|
+
function ot(e, t, n, r) {
|
|
611
|
+
let i = typeof e == "string" && !e.includes("T"), a = fe(e, t && !i, n);
|
|
612
|
+
return a ? at(a, t, r) : void 0;
|
|
613
|
+
}
|
|
614
|
+
var st = (e, t, n, r) => S(it(e, t), {
|
|
615
|
+
valueType: n,
|
|
616
|
+
timeZone: r,
|
|
617
|
+
withTime: t
|
|
618
|
+
}), ct = (e, t, n) => fe(e, t, n);
|
|
619
|
+
function lt(e, t) {
|
|
620
|
+
if (!e && !t?.length) return;
|
|
621
|
+
let n = new Set(t?.map((e) => fe(e, !1)));
|
|
622
|
+
return (t) => {
|
|
623
|
+
let r = it(t, !1);
|
|
624
|
+
return n.has(r) || !!e?.(r);
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
function ut(e, t) {
|
|
628
|
+
if ("hour" in e) return e;
|
|
629
|
+
let n = t && "hour" in t ? new Be(t.hour, t.minute) : new Be();
|
|
630
|
+
return Ue(e, n);
|
|
631
|
+
}
|
|
632
|
+
var dt = {
|
|
633
|
+
year: 2e3,
|
|
634
|
+
month: 1,
|
|
635
|
+
day: 1
|
|
636
|
+
};
|
|
637
|
+
function ft(e) {
|
|
638
|
+
let [t = 0, n = 0, r = 0] = e.split(":").map(Number);
|
|
639
|
+
return new Re(dt.year, dt.month, dt.day, t, n, r);
|
|
640
|
+
}
|
|
641
|
+
var pt = (e) => String(e).padStart(2, "0"), mt = (e, t = !1) => e && "hour" in e ? `${pt(e.hour)}:${pt(e.minute)}${t ? `:${pt(e.second)}` : ""}` : null, ht = (e, t, n, r = !1) => se(e, t, n, r);
|
|
642
|
+
//#endregion
|
|
643
|
+
//#region src/components/DatePicker/DatePickerBase.tsx
|
|
644
|
+
function gt({ mode: t, dates: r, onChange: i, withTime: a, min: o, max: s, isDateUnavailable: c, locale: l, disabled: u, readOnly: d, invalid: f, required: p, name: m, label: h, ownId: g, placeholder: _, className: v, style: b, period: x, classes: S, presets: C, size: w, hideClear: T, firstDayOfWeek: E, timeZone: D, showTimeZone: k, responsive: A, ...ee }) {
|
|
645
|
+
let j = n("datePicker", y, S)({ size: w }), M = e(), N = De(), P = Ne(), F = {
|
|
646
|
+
disabled: u ?? P?.disabled,
|
|
647
|
+
readOnly: d ?? P?.readOnly,
|
|
648
|
+
invalid: f ?? P?.invalid,
|
|
649
|
+
required: p ?? P?.required
|
|
650
|
+
}, I = t === "range", ie = t === "multiple", L = I ? [0, 1] : [0], ae = [M.dateRange.start, M.dateRange.end], oe = P || g ? {
|
|
651
|
+
...P ? { label: (e) => I ? `${P.ids.label} ${N}r${e}` : P.ids.label } : {},
|
|
652
|
+
...g ? { segmentGroup: (e) => e === 0 ? g : void 0 } : {}
|
|
653
|
+
} : void 0, se = (e) => P ? void 0 : I ? [h, ae[e]].filter(Boolean).join(", ") : h, ue = I ? {
|
|
654
|
+
...M.datePicker,
|
|
655
|
+
clearTrigger: M.dateRange.clearTrigger
|
|
656
|
+
} : M.datePicker, de = x ? new ze(l, x === "month" ? {
|
|
657
|
+
month: "2-digit",
|
|
658
|
+
year: "numeric"
|
|
659
|
+
} : { year: "numeric" }) : void 0, fe = E ?? O(l).firstDay, R;
|
|
660
|
+
if (k && D) {
|
|
661
|
+
let e = r[0], t = e ? me(e.toString().slice(0, 16), D) : /* @__PURE__ */ new Date();
|
|
662
|
+
R = {
|
|
663
|
+
short: ce(D, l, t),
|
|
664
|
+
long: M.calendar.timeZone(le(D, l, t))
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
let pe = [P?.ariaDescribedby, R ? `${N}tz` : void 0].filter(Boolean).join(" ") || void 0, he = (e) => L.every((t) => e.getSegments({ index: t }).every((e) => e.type === "literal" || e.isPlaceholder)), ge = (e) => !!_ && he(e) && !e.focused, B = (e) => _ && he(e) ? [pe, `${N}ph`].filter(Boolean).join(" ") : pe, V = (e) => i(a ? e.map((e, t) => ut(e, r[t])) : e), H = (e, t) => {
|
|
668
|
+
if (x) return !1;
|
|
669
|
+
if (I) {
|
|
670
|
+
let t = ne(e, l, a);
|
|
671
|
+
if (t) return i([at(t.start, a), at(t.end, a)]), !0;
|
|
672
|
+
}
|
|
673
|
+
let n = te(e, l, a);
|
|
674
|
+
if (!n) return !1;
|
|
675
|
+
let o = [...r];
|
|
676
|
+
return o[t] = at(n, a), i(o.filter(Boolean)), !0;
|
|
677
|
+
}, _e = r.length ? r.length > 3 ? re(M.calendar.datesSelected, r.length, l) : r.map((e) => new ze(l, {
|
|
678
|
+
day: "2-digit",
|
|
679
|
+
month: "2-digit",
|
|
680
|
+
year: "numeric",
|
|
681
|
+
timeZone: "UTC"
|
|
682
|
+
}).format(e.toDate("UTC"))).join(", ") : _ ?? M.calendar.noDates;
|
|
683
|
+
return /* @__PURE__ */ X($.Root, {
|
|
684
|
+
className: j.base({ class: v }),
|
|
685
|
+
style: b,
|
|
686
|
+
value: r,
|
|
687
|
+
onValueChange: (e) => V(e.value),
|
|
688
|
+
selectionMode: t,
|
|
689
|
+
min: o,
|
|
690
|
+
max: s,
|
|
691
|
+
isDateUnavailable: c,
|
|
692
|
+
locale: l,
|
|
693
|
+
startOfWeek: fe,
|
|
694
|
+
minView: x,
|
|
695
|
+
defaultView: x,
|
|
696
|
+
numOfMonths: ee.numberOfMonths,
|
|
697
|
+
timeZone: D,
|
|
698
|
+
...F,
|
|
699
|
+
positioning: {
|
|
700
|
+
placement: "bottom-start",
|
|
701
|
+
gutter: 4
|
|
702
|
+
},
|
|
703
|
+
translations: ue,
|
|
704
|
+
lazyMount: !0,
|
|
705
|
+
unmountOnExit: !0,
|
|
706
|
+
children: [/* @__PURE__ */ X($.Control, {
|
|
707
|
+
className: j.control(),
|
|
708
|
+
children: [
|
|
709
|
+
ie ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("span", {
|
|
710
|
+
id: `${N}v`,
|
|
711
|
+
className: j.multiValue(),
|
|
712
|
+
"data-placeholder": r.length ? void 0 : "",
|
|
713
|
+
children: _e
|
|
714
|
+
}), m && r.map((e, t) => /* @__PURE__ */ Y("input", {
|
|
715
|
+
type: "hidden",
|
|
716
|
+
name: `${m}[${t}]`,
|
|
717
|
+
value: e.toString()
|
|
718
|
+
}, e.toString()))] }) : /* @__PURE__ */ X(Le.Root, {
|
|
719
|
+
className: j.dateInput(),
|
|
720
|
+
ids: oe,
|
|
721
|
+
value: r,
|
|
722
|
+
onValueChange: (e) => i(e.value),
|
|
723
|
+
selectionMode: I ? "range" : "single",
|
|
724
|
+
granularity: a ? "minute" : "day",
|
|
725
|
+
formatter: de,
|
|
726
|
+
min: o,
|
|
727
|
+
max: s,
|
|
728
|
+
isDateUnavailable: c,
|
|
729
|
+
locale: l,
|
|
730
|
+
shouldForceLeadingZeros: !0,
|
|
731
|
+
name: m,
|
|
732
|
+
...F,
|
|
733
|
+
translations: M.dateInput,
|
|
734
|
+
children: [/* @__PURE__ */ Y(Le.Context, { children: (e) => /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(Le.Control, {
|
|
735
|
+
className: j.dateControl(),
|
|
736
|
+
"data-placeholder-shown": ge(e) || void 0,
|
|
737
|
+
children: L.map((t) => /* @__PURE__ */ X(U, { children: [
|
|
738
|
+
t === 1 && /* @__PURE__ */ Y("span", {
|
|
739
|
+
className: j.rangeSeparator(),
|
|
740
|
+
"aria-hidden": "true",
|
|
741
|
+
children: "–"
|
|
742
|
+
}),
|
|
743
|
+
I && P && /* @__PURE__ */ Y("span", {
|
|
744
|
+
id: `${N}r${t}`,
|
|
745
|
+
className: j.rangeLabel(),
|
|
746
|
+
children: ae[t]
|
|
747
|
+
}),
|
|
748
|
+
/* @__PURE__ */ Y(_t, {
|
|
749
|
+
index: t,
|
|
750
|
+
label: se(t),
|
|
751
|
+
describedby: B(e),
|
|
752
|
+
paste: x ? void 0 : H,
|
|
753
|
+
size: w
|
|
754
|
+
})
|
|
755
|
+
] }, t))
|
|
756
|
+
}), _ && he(e) && /* @__PURE__ */ Y("span", {
|
|
757
|
+
id: `${N}ph`,
|
|
758
|
+
className: j.placeholder(),
|
|
759
|
+
"data-hidden": ge(e) ? void 0 : "",
|
|
760
|
+
onClick: () => e.focus(),
|
|
761
|
+
children: _
|
|
762
|
+
})] }) }), L.map((e) => /* @__PURE__ */ Y(Le.HiddenInput, { index: e }, e))]
|
|
763
|
+
}),
|
|
764
|
+
R && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("span", {
|
|
765
|
+
className: j.timeZone(),
|
|
766
|
+
"aria-hidden": "true",
|
|
767
|
+
children: R.short
|
|
768
|
+
}), /* @__PURE__ */ Y("span", {
|
|
769
|
+
id: `${N}tz`,
|
|
770
|
+
hidden: !0,
|
|
771
|
+
children: R.long
|
|
772
|
+
})] }),
|
|
773
|
+
!T && /* @__PURE__ */ Y($.ClearTrigger, {
|
|
774
|
+
className: j.clear(),
|
|
775
|
+
children: /* @__PURE__ */ Y(Ce, {
|
|
776
|
+
className: j.clearIcon(),
|
|
777
|
+
"aria-hidden": "true"
|
|
778
|
+
})
|
|
779
|
+
}),
|
|
780
|
+
/* @__PURE__ */ Y($.Trigger, {
|
|
781
|
+
className: j.trigger(),
|
|
782
|
+
...ie ? { "aria-describedby": `${N}v` } : {},
|
|
783
|
+
children: /* @__PURE__ */ Y(z, {
|
|
784
|
+
className: j.triggerIcon(),
|
|
785
|
+
"aria-hidden": "true"
|
|
786
|
+
})
|
|
787
|
+
})
|
|
788
|
+
]
|
|
789
|
+
}), /* @__PURE__ */ Y(yt, {
|
|
790
|
+
presets: C,
|
|
791
|
+
responsive: A,
|
|
792
|
+
timeZone: D,
|
|
793
|
+
...ee
|
|
794
|
+
})]
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
function _t({ index: t, label: r, describedby: i, paste: a, size: o }) {
|
|
798
|
+
let s = n("datePicker", y)({ size: o }), c = e();
|
|
799
|
+
return /* @__PURE__ */ Y(Le.SegmentGroup, {
|
|
800
|
+
index: t,
|
|
801
|
+
className: s.segments(),
|
|
802
|
+
"aria-label": r,
|
|
803
|
+
"aria-describedby": i,
|
|
804
|
+
...a ? { onPasteCapture: (e) => {
|
|
805
|
+
a?.(e.clipboardData.getData("text/plain"), t) && (e.preventDefault(), e.stopPropagation());
|
|
806
|
+
} } : {},
|
|
807
|
+
children: /* @__PURE__ */ Y(Le.Context, { children: (e) => e.getSegments({ index: t }).map((e, t) => /* @__PURE__ */ Y(Le.Segment, {
|
|
808
|
+
segment: e,
|
|
809
|
+
className: s.segment(),
|
|
810
|
+
"aria-label": c.dateSegments[e.type]
|
|
811
|
+
}, t)) })
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
function vt(e) {
|
|
815
|
+
let [t, n] = K(!1);
|
|
816
|
+
return W(() => {
|
|
817
|
+
if (!e || typeof window.matchMedia != "function") return;
|
|
818
|
+
let t = window.matchMedia("(max-width: 639.98px)"), r = () => n(t.matches);
|
|
819
|
+
return r(), t.addEventListener("change", r), () => t.removeEventListener("change", r);
|
|
820
|
+
}, [e]), t;
|
|
821
|
+
}
|
|
822
|
+
function yt({ presets: e, responsive: t, ...r }) {
|
|
823
|
+
let i = n("datePicker", y), a = i(), o = vt(t), s = (r.numberOfMonths ?? 1) > 1;
|
|
824
|
+
return o ? /* @__PURE__ */ X(je, { children: [/* @__PURE__ */ Y($.Context, { children: (e) => e.open ? /* @__PURE__ */ Y("div", {
|
|
825
|
+
className: a.backdrop(),
|
|
826
|
+
"aria-hidden": "true"
|
|
827
|
+
}) : null }), /* @__PURE__ */ Y("div", {
|
|
828
|
+
className: a.sheet(),
|
|
829
|
+
children: /* @__PURE__ */ Y($.Content, {
|
|
830
|
+
className: i({
|
|
831
|
+
multiMonth: s,
|
|
832
|
+
bottomSheet: !0
|
|
833
|
+
}).content(),
|
|
834
|
+
children: /* @__PURE__ */ Y(xt, {
|
|
835
|
+
presets: e,
|
|
836
|
+
...r
|
|
837
|
+
})
|
|
838
|
+
})
|
|
839
|
+
})] }) : /* @__PURE__ */ Y(je, { children: /* @__PURE__ */ Y($.Positioner, { children: /* @__PURE__ */ Y($.Content, {
|
|
840
|
+
className: s ? i({ multiMonth: s }).content() : a.content(),
|
|
841
|
+
children: /* @__PURE__ */ Y(xt, {
|
|
842
|
+
presets: e,
|
|
843
|
+
...r
|
|
844
|
+
})
|
|
845
|
+
}) }) });
|
|
846
|
+
}
|
|
847
|
+
var bt = (e, t) => typeof e == "string" ? t.rangePresets[e] ?? e : e.label;
|
|
848
|
+
function xt({ presets: t, showWeekNumbers: r, numberOfMonths: i, showButtonBar: a, plainToday: o, hideOutsideDays: s, weekendDays: c, allowDeselect: l, timeZone: u, renderDay: d }) {
|
|
849
|
+
let f = n("datePicker", y)(), p = e(), m = Math.max(1, Math.floor(i ?? 1)), h = {
|
|
850
|
+
showWeekNumbers: r,
|
|
851
|
+
plainToday: o,
|
|
852
|
+
hideOutsideDays: s || m > 1,
|
|
853
|
+
weekendDays: c,
|
|
854
|
+
allowDeselect: l,
|
|
855
|
+
renderDay: d
|
|
856
|
+
}, g = (e) => Array.from({ length: m }, (t, n) => {
|
|
857
|
+
let r = e.getOffset({ months: n }), i = e.visibleRange.start.add({ months: n });
|
|
858
|
+
return {
|
|
859
|
+
title: r.visibleRangeText.start,
|
|
860
|
+
weeks: r.weeks,
|
|
861
|
+
visibleRange: {
|
|
862
|
+
start: i,
|
|
863
|
+
end: i.add({ months: 1 }).subtract({ days: 1 })
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
}), _ = (e) => {
|
|
867
|
+
if (e.selectionMode === "single") return e.selectToday();
|
|
868
|
+
let [t = 0, n = 1, r = 1] = R(u).split("-").map(Number);
|
|
869
|
+
e.setFocusedValue(e.focusedValue.set({
|
|
870
|
+
year: t,
|
|
871
|
+
month: n,
|
|
872
|
+
day: r
|
|
873
|
+
}));
|
|
874
|
+
};
|
|
875
|
+
return /* @__PURE__ */ X(J, { children: [
|
|
876
|
+
/* @__PURE__ */ Y($.View, {
|
|
877
|
+
view: "day",
|
|
878
|
+
children: /* @__PURE__ */ Y($.Context, { children: (e) => /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(Et, {}), m > 1 ? /* @__PURE__ */ Y("div", {
|
|
879
|
+
className: f.months(),
|
|
880
|
+
children: g(e).map((e) => /* @__PURE__ */ X("div", {
|
|
881
|
+
className: f.month(),
|
|
882
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
883
|
+
className: f.monthTitle(),
|
|
884
|
+
children: e.title
|
|
885
|
+
}), /* @__PURE__ */ Y(Ct, {
|
|
886
|
+
weeks: e.weeks,
|
|
887
|
+
visibleRange: e.visibleRange,
|
|
888
|
+
...h
|
|
889
|
+
})]
|
|
890
|
+
}, e.title))
|
|
891
|
+
}) : /* @__PURE__ */ Y(Ct, {
|
|
892
|
+
weeks: e.weeks,
|
|
893
|
+
...h
|
|
894
|
+
})] }) })
|
|
895
|
+
}),
|
|
896
|
+
/* @__PURE__ */ Y($.View, {
|
|
897
|
+
view: "month",
|
|
898
|
+
children: /* @__PURE__ */ Y($.Context, { children: (e) => /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(Et, {}), /* @__PURE__ */ Y($.Table, {
|
|
899
|
+
className: f.table(),
|
|
900
|
+
children: /* @__PURE__ */ Y($.TableBody, { children: e.getMonthsGrid({
|
|
901
|
+
columns: 4,
|
|
902
|
+
format: "short"
|
|
903
|
+
}).map((e) => /* @__PURE__ */ Y($.TableRow, { children: e.map((e) => /* @__PURE__ */ Y($.TableCell, {
|
|
904
|
+
value: e.value,
|
|
905
|
+
className: f.cell(),
|
|
906
|
+
children: /* @__PURE__ */ Y($.TableCellTrigger, {
|
|
907
|
+
className: f.period(),
|
|
908
|
+
children: e.label
|
|
909
|
+
})
|
|
910
|
+
}, e.value)) }, e[0]?.value)) })
|
|
911
|
+
})] }) })
|
|
912
|
+
}),
|
|
913
|
+
/* @__PURE__ */ Y($.View, {
|
|
914
|
+
view: "year",
|
|
915
|
+
children: /* @__PURE__ */ Y($.Context, { children: (e) => /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(Et, {}), /* @__PURE__ */ Y($.Table, {
|
|
916
|
+
className: f.table(),
|
|
917
|
+
children: /* @__PURE__ */ Y($.TableBody, { children: e.getYearsGrid({ columns: 4 }).map((e) => /* @__PURE__ */ Y($.TableRow, { children: e.map((e) => /* @__PURE__ */ Y($.TableCell, {
|
|
918
|
+
value: e.value,
|
|
919
|
+
className: f.cell(),
|
|
920
|
+
children: /* @__PURE__ */ Y($.TableCellTrigger, {
|
|
921
|
+
className: f.period(),
|
|
922
|
+
children: e.label
|
|
923
|
+
})
|
|
924
|
+
}, e.value)) }, e[0]?.value)) })
|
|
925
|
+
})] }) })
|
|
926
|
+
}),
|
|
927
|
+
t?.length ? /* @__PURE__ */ Y("div", {
|
|
928
|
+
className: f.presets(),
|
|
929
|
+
children: t.map((e) => /* @__PURE__ */ Y($.PresetTrigger, {
|
|
930
|
+
value: typeof e == "string" ? e : e.value,
|
|
931
|
+
className: f.preset(),
|
|
932
|
+
"aria-label": bt(e, p),
|
|
933
|
+
children: bt(e, p)
|
|
934
|
+
}, bt(e, p)))
|
|
935
|
+
}) : null,
|
|
936
|
+
a && /* @__PURE__ */ Y($.Context, { children: (e) => /* @__PURE__ */ X("div", {
|
|
937
|
+
className: f.buttonBar(),
|
|
938
|
+
children: [/* @__PURE__ */ Y("button", {
|
|
939
|
+
type: "button",
|
|
940
|
+
className: f.buttonBarButton(),
|
|
941
|
+
onClick: () => _(e),
|
|
942
|
+
children: p.calendar.today
|
|
943
|
+
}), /* @__PURE__ */ Y("button", {
|
|
944
|
+
type: "button",
|
|
945
|
+
className: f.buttonBarButton(),
|
|
946
|
+
disabled: !e.value.length,
|
|
947
|
+
onClick: () => e.clearValue({ focus: !1 }),
|
|
948
|
+
children: p.calendar.clear
|
|
949
|
+
})]
|
|
950
|
+
}) })
|
|
951
|
+
] });
|
|
952
|
+
}
|
|
953
|
+
var St = (e) => e.toString().slice(0, 10);
|
|
954
|
+
function Ct({ weeks: t, visibleRange: r, showWeekNumbers: i, plainToday: a, hideOutsideDays: o, weekendDays: s, allowDeselect: c, renderDay: l }) {
|
|
955
|
+
let u = n("datePicker", y)({
|
|
956
|
+
plainToday: a,
|
|
957
|
+
hideOutsideDays: o
|
|
958
|
+
}), d = e(), f = Ie(), p = (e) => I(e.map(St)), m = (e) => !!r && (e.month !== r.start.month || e.year !== r.start.year), h = (e) => {
|
|
959
|
+
let t = f.getDayTableCellState({
|
|
960
|
+
value: e,
|
|
961
|
+
visibleRange: r
|
|
962
|
+
});
|
|
963
|
+
return {
|
|
964
|
+
day: e.day,
|
|
965
|
+
today: t.today,
|
|
966
|
+
selected: t.selected,
|
|
967
|
+
outside: t.outsideRange,
|
|
968
|
+
unavailable: t.unavailable || !!t.disabled,
|
|
969
|
+
weekend: s ? s.includes(E(St(e))) : t.weekend
|
|
970
|
+
};
|
|
971
|
+
}, g = (e, t) => {
|
|
972
|
+
"key" in e && e.key !== "Enter" && e.key !== " " || f.selectionMode === "single" && f.getDayTableCellState({
|
|
973
|
+
value: t,
|
|
974
|
+
visibleRange: r
|
|
975
|
+
}).selected && (e.preventDefault(), f.clearValue({ focus: !1 }));
|
|
976
|
+
}, _ = (e) => ({
|
|
977
|
+
...s?.includes(E(St(e))) ? { "data-weekend": "" } : {},
|
|
978
|
+
...c ? {
|
|
979
|
+
onClickCapture: (t) => g(t, e),
|
|
980
|
+
onKeyDownCapture: (t) => g(t, e)
|
|
981
|
+
} : {}
|
|
982
|
+
});
|
|
983
|
+
return /* @__PURE__ */ X($.Table, {
|
|
984
|
+
className: u.table(),
|
|
985
|
+
children: [/* @__PURE__ */ Y($.TableHead, { children: /* @__PURE__ */ X($.TableRow, { children: [i && /* @__PURE__ */ Y("th", {
|
|
986
|
+
scope: "col",
|
|
987
|
+
className: u.weekNumberHeader(),
|
|
988
|
+
children: /* @__PURE__ */ Y("abbr", {
|
|
989
|
+
title: d.datePicker.weekColumnHeader,
|
|
990
|
+
children: d.datePicker.weekColumnShort
|
|
991
|
+
})
|
|
992
|
+
}), f.weekDays.map((e) => /* @__PURE__ */ Y($.TableHeader, {
|
|
993
|
+
className: u.columnHeader(),
|
|
994
|
+
children: /* @__PURE__ */ Y("abbr", {
|
|
995
|
+
title: e.long,
|
|
996
|
+
children: e.short
|
|
997
|
+
})
|
|
998
|
+
}, e.long))] }) }), /* @__PURE__ */ Y($.TableBody, { children: t.map((e) => /* @__PURE__ */ X($.TableRow, { children: [i && /* @__PURE__ */ Y("th", {
|
|
999
|
+
scope: "row",
|
|
1000
|
+
className: u.weekNumber(),
|
|
1001
|
+
"aria-label": d.datePicker.weekNumberCell(p(e)),
|
|
1002
|
+
children: p(e)
|
|
1003
|
+
}), e.map((e) => m(e) ? /* @__PURE__ */ Y("td", { className: u.cell() }, e.toString()) : /* @__PURE__ */ Y($.TableCell, {
|
|
1004
|
+
value: e,
|
|
1005
|
+
visibleRange: r,
|
|
1006
|
+
className: u.cell(),
|
|
1007
|
+
..._(e),
|
|
1008
|
+
children: /* @__PURE__ */ Y($.TableCellTrigger, {
|
|
1009
|
+
className: u.day(),
|
|
1010
|
+
children: l ? /* @__PURE__ */ Y("span", {
|
|
1011
|
+
className: u.dayContent(),
|
|
1012
|
+
children: l(St(e), h(e))
|
|
1013
|
+
}) : e.day
|
|
1014
|
+
})
|
|
1015
|
+
}, e.toString()))] }, e[0]?.toString())) })]
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
var wt = {
|
|
1019
|
+
day: "month",
|
|
1020
|
+
month: "year",
|
|
1021
|
+
year: void 0
|
|
1022
|
+
}, Tt = (e, t, n) => `${e}, ${n.datePicker.viewTrigger(t, wt[t])}`;
|
|
1023
|
+
function Et() {
|
|
1024
|
+
let t = n("datePicker", y)(), r = e();
|
|
1025
|
+
return /* @__PURE__ */ X($.ViewControl, {
|
|
1026
|
+
className: t.header(),
|
|
1027
|
+
children: [
|
|
1028
|
+
/* @__PURE__ */ Y($.PrevTrigger, {
|
|
1029
|
+
className: t.nav(),
|
|
1030
|
+
children: /* @__PURE__ */ Y(B, {
|
|
1031
|
+
className: t.navIcon(),
|
|
1032
|
+
"aria-hidden": "true"
|
|
1033
|
+
})
|
|
1034
|
+
}),
|
|
1035
|
+
/* @__PURE__ */ Y($.Context, { children: (e) => /* @__PURE__ */ Y($.ViewTrigger, {
|
|
1036
|
+
className: t.viewTrigger(),
|
|
1037
|
+
"aria-label": Tt(e.numOfMonths > 1 && e.view === "day" ? e.visibleRangeText.formatted : e.visibleRangeText.start, e.view, r),
|
|
1038
|
+
children: /* @__PURE__ */ Y($.RangeText, {})
|
|
1039
|
+
}) }),
|
|
1040
|
+
/* @__PURE__ */ Y($.NextTrigger, {
|
|
1041
|
+
className: t.nav(),
|
|
1042
|
+
children: /* @__PURE__ */ Y(V, {
|
|
1043
|
+
className: t.navIcon(),
|
|
1044
|
+
"aria-hidden": "true"
|
|
1045
|
+
})
|
|
1046
|
+
})
|
|
1047
|
+
]
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
//#endregion
|
|
1051
|
+
//#region src/components/DatePicker/DatePicker.tsx
|
|
1052
|
+
function Dt({ value: e, defaultValue: n, onValueChange: r, selectionMode: i = "single", valueType: a = "string", withTime: o = !1, min: c, max: l, isDateUnavailable: u, excludeDates: d, locale: f, "aria-label": p, id: m, clearable: h = !0, highlightToday: g = !0, ..._ }) {
|
|
1053
|
+
s("DatePicker", m);
|
|
1054
|
+
let v = t(), y = f ?? v.locale, [b, x] = K(n ?? null), S = e === void 0 ? b : e, C = Array.isArray(S) ? S : S ? [S] : [], w = _.timeZone, T = (e) => e.map((e) => ct(e, o, w)).join(), E = (e) => {
|
|
1055
|
+
let t = e.map((e) => st(e, o, a, w));
|
|
1056
|
+
if (T(t) === T(C)) return;
|
|
1057
|
+
let n = i === "multiple" ? t : t[0] ?? null;
|
|
1058
|
+
x(n), r?.(n);
|
|
1059
|
+
};
|
|
1060
|
+
return /* @__PURE__ */ Y(gt, {
|
|
1061
|
+
..._,
|
|
1062
|
+
mode: i,
|
|
1063
|
+
dates: C.map((e) => ot(e, o, w)).filter((e) => !!e),
|
|
1064
|
+
onChange: E,
|
|
1065
|
+
withTime: o,
|
|
1066
|
+
min: ot(c, o, w, "min"),
|
|
1067
|
+
max: ot(l, o, w, "max"),
|
|
1068
|
+
isDateUnavailable: lt(u, d),
|
|
1069
|
+
locale: y,
|
|
1070
|
+
label: p,
|
|
1071
|
+
ownId: m,
|
|
1072
|
+
hideClear: !h,
|
|
1073
|
+
plainToday: !g
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
//#endregion
|
|
1077
|
+
//#region src/components/MultiSelect/MultiSelect.tsx
|
|
1078
|
+
function Ot({ classes: t, items: r, value: i, defaultValue: a, onValueChange: o, placeholder: s, summary: f, maxShown: m = 2, disabled: h, invalid: _, required: v, name: y, itemValue: b, itemLabel: x, itemDisabled: S, itemGroup: C, itemKeywords: T, valueKey: E, display: D = "text", checkboxes: O = !0, selectAll: k, max: A, clearable: j, loading: M, loadingText: N, size: P, filter: F, manualFilter: te, onFilterChange: ne, emptyText: re, hasMore: I, onLoadMore: ie, dataSource: L, minSearchLength: ae, pageSize: oe, renderItem: se, renderValue: ce, id: le, className: ue, style: de, onKeyDown: fe, ...R }) {
|
|
1079
|
+
let me = n("multiSelect", ee, t), z = D === "chips", B = me({
|
|
1080
|
+
size: P,
|
|
1081
|
+
clearable: j && !z
|
|
1082
|
+
}), V = Ne(), H = e(), _e = H.select, ve = {
|
|
1083
|
+
itemValue: b,
|
|
1084
|
+
itemLabel: x,
|
|
1085
|
+
itemDisabled: S,
|
|
1086
|
+
itemGroup: C,
|
|
1087
|
+
itemKeywords: T,
|
|
1088
|
+
valueKey: E
|
|
1089
|
+
}, [ye, Se] = K(""), U = l({
|
|
1090
|
+
items: r,
|
|
1091
|
+
source: L,
|
|
1092
|
+
accessors: ve,
|
|
1093
|
+
pageSize: oe,
|
|
1094
|
+
minSearchLength: ae
|
|
1095
|
+
}), { options: we, visible: Te, groups: Ee, ordered: Oe, firstFor: ke } = c(U.items, ve, F && !te && !L ? ye : ""), G = Ae(() => [...we, ...U.resolvedOptions], [we, U.resolvedOptions]), { selected: q, keys: Z, commit: Me } = d({
|
|
1096
|
+
multiple: !0,
|
|
1097
|
+
value: i,
|
|
1098
|
+
defaultValue: a,
|
|
1099
|
+
accessors: ve,
|
|
1100
|
+
items: G,
|
|
1101
|
+
onChange: o,
|
|
1102
|
+
check: {
|
|
1103
|
+
component: "MultiSelect",
|
|
1104
|
+
ready: !L && !M && r.length > 0
|
|
1105
|
+
}
|
|
1106
|
+
}), Pe = Z.join("\0");
|
|
1107
|
+
W(() => {
|
|
1108
|
+
U.resolve(Z, G);
|
|
1109
|
+
}, [Pe, L]);
|
|
1110
|
+
let $ = M || U.loading, Ie = A !== void 0 && q.length >= A, Le = Z.join("\n"), Re = Ae(() => {
|
|
1111
|
+
let e = new Set(Le.split("\n"));
|
|
1112
|
+
return Fe({
|
|
1113
|
+
items: Oe,
|
|
1114
|
+
itemToString: (e) => e.label,
|
|
1115
|
+
itemToValue: (e) => e.key,
|
|
1116
|
+
isItemDisabled: (t) => t.disabled || Ie && !e.has(t.key)
|
|
1117
|
+
});
|
|
1118
|
+
}, [
|
|
1119
|
+
Oe,
|
|
1120
|
+
Ie,
|
|
1121
|
+
Le
|
|
1122
|
+
]), ze = F || k, Be = De(), Ve = Te.filter((e) => !e.disabled), He = p(q, Ve), [Ue, We] = K("");
|
|
1123
|
+
function Ge(e) {
|
|
1124
|
+
let t = A !== void 0 && e.length >= A && q.length < A;
|
|
1125
|
+
Me(e), t && We(_e.maxReached(A));
|
|
1126
|
+
}
|
|
1127
|
+
function Ke(e) {
|
|
1128
|
+
Me(q.filter((t) => t.key !== e.key)), We(_e.removed(e.label));
|
|
1129
|
+
}
|
|
1130
|
+
function qe(e) {
|
|
1131
|
+
fe?.(e);
|
|
1132
|
+
let t = q.at(-1);
|
|
1133
|
+
t && (z && e.key === "Backspace" ? (e.preventDefault(), Ke(t)) : j && (e.key === "Delete" || e.key === "Backspace") && (e.preventDefault(), Me([])));
|
|
1134
|
+
}
|
|
1135
|
+
function Je(e, t) {
|
|
1136
|
+
Se(t), ne?.(t), L && U.search(t);
|
|
1137
|
+
let n = te || L ? void 0 : ke(t);
|
|
1138
|
+
n && requestAnimationFrame(() => e.setHighlightValue(n.key));
|
|
1139
|
+
}
|
|
1140
|
+
let Ye = {
|
|
1141
|
+
item: B.item(),
|
|
1142
|
+
itemText: B.itemText(),
|
|
1143
|
+
icon: B.icon(),
|
|
1144
|
+
itemIndicator: B.itemIndicator(),
|
|
1145
|
+
itemBody: B.itemBody(),
|
|
1146
|
+
itemDescription: B.itemDescription(),
|
|
1147
|
+
group: B.group(),
|
|
1148
|
+
groupLabel: B.groupLabel(),
|
|
1149
|
+
loading: B.loading(),
|
|
1150
|
+
loadingIcon: B.loadingIcon(),
|
|
1151
|
+
sentinel: B.sentinel(),
|
|
1152
|
+
empty: B.empty(),
|
|
1153
|
+
check: B.check(),
|
|
1154
|
+
checkIcon: B.checkIcon()
|
|
1155
|
+
}, Xe = /* @__PURE__ */ Y(u, {
|
|
1156
|
+
parts: Q,
|
|
1157
|
+
groups: Ee,
|
|
1158
|
+
classes: Ye,
|
|
1159
|
+
checkbox: O,
|
|
1160
|
+
loading: $,
|
|
1161
|
+
loadingText: N ?? H.common.loading,
|
|
1162
|
+
hasMore: I || U.hasMore,
|
|
1163
|
+
onLoadMore: () => L ? U.loadMore() : ie?.(),
|
|
1164
|
+
emptyText: re ?? U.emptyText ?? (ye ? H.common.noResults : H.common.empty),
|
|
1165
|
+
renderItem: se
|
|
1166
|
+
}), Ze = q.length ? q.length > m ? (f ?? H.common.selectedCount)(q.length) : q.map((e) => e.label).join(", ") : s ?? H.common.placeholder;
|
|
1167
|
+
return /* @__PURE__ */ X(Q.Root, {
|
|
1168
|
+
className: B.base({ class: ue }),
|
|
1169
|
+
style: de,
|
|
1170
|
+
collection: Re,
|
|
1171
|
+
multiple: !0,
|
|
1172
|
+
closeOnSelect: !1,
|
|
1173
|
+
value: Z,
|
|
1174
|
+
onValueChange: (e) => {
|
|
1175
|
+
let t = w(G, e.items, q);
|
|
1176
|
+
Ge(e.value.map((e) => t.get(e)).filter((e) => e !== void 0));
|
|
1177
|
+
},
|
|
1178
|
+
onOpenChange: (e) => {
|
|
1179
|
+
e.open && U.open(), !e.open && ye && (Se(""), ne?.(""), L && U.search(""));
|
|
1180
|
+
},
|
|
1181
|
+
disabled: h,
|
|
1182
|
+
invalid: _,
|
|
1183
|
+
required: v,
|
|
1184
|
+
name: y,
|
|
1185
|
+
positioning: {
|
|
1186
|
+
sameWidth: !0,
|
|
1187
|
+
gutter: 4
|
|
1188
|
+
},
|
|
1189
|
+
composite: !ze,
|
|
1190
|
+
...g(le, "trigger", {
|
|
1191
|
+
label: V?.ids.label,
|
|
1192
|
+
hiddenSelect: V?.ids.control
|
|
1193
|
+
}),
|
|
1194
|
+
lazyMount: !0,
|
|
1195
|
+
unmountOnExit: !0,
|
|
1196
|
+
children: [
|
|
1197
|
+
/* @__PURE__ */ Y(Q.Context, { children: (e) => /* @__PURE__ */ X(Q.Control, {
|
|
1198
|
+
...z || j ? { className: z ? B.chipsControl() : B.control() } : {},
|
|
1199
|
+
children: [
|
|
1200
|
+
z && q.map((t) => /* @__PURE__ */ X("span", {
|
|
1201
|
+
className: B.chip(),
|
|
1202
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
1203
|
+
className: B.chipText(),
|
|
1204
|
+
children: t.label
|
|
1205
|
+
}), !e.disabled && /* @__PURE__ */ Y("button", {
|
|
1206
|
+
type: "button",
|
|
1207
|
+
tabIndex: -1,
|
|
1208
|
+
className: B.chipRemove(),
|
|
1209
|
+
"aria-label": _e.removeItem(t.label),
|
|
1210
|
+
onClick: () => Ke(t),
|
|
1211
|
+
children: /* @__PURE__ */ Y(Ce, {
|
|
1212
|
+
className: B.chipRemoveIcon(),
|
|
1213
|
+
"aria-hidden": "true"
|
|
1214
|
+
})
|
|
1215
|
+
})]
|
|
1216
|
+
}, t.key)),
|
|
1217
|
+
/* @__PURE__ */ X(Q.Trigger, {
|
|
1218
|
+
...R,
|
|
1219
|
+
className: z ? B.chipsTrigger() : B.trigger(),
|
|
1220
|
+
"aria-busy": M || void 0,
|
|
1221
|
+
onKeyDown: qe,
|
|
1222
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
1223
|
+
className: B.value(),
|
|
1224
|
+
"data-placeholder-shown": !q.length || void 0,
|
|
1225
|
+
children: z ? q.length ? /* @__PURE__ */ Y("span", {
|
|
1226
|
+
className: B.hiddenValue(),
|
|
1227
|
+
children: q.map((e) => e.label).join(", ")
|
|
1228
|
+
}) : s ?? H.common.placeholder : ce && q.length ? ce(q.map((e) => e.item)) : Ze
|
|
1229
|
+
}), /* @__PURE__ */ Y(Q.Indicator, {
|
|
1230
|
+
className: B.indicator(),
|
|
1231
|
+
children: M ? /* @__PURE__ */ Y(be, {
|
|
1232
|
+
className: B.spinner(),
|
|
1233
|
+
"aria-hidden": "true"
|
|
1234
|
+
}) : /* @__PURE__ */ Y(ge, {
|
|
1235
|
+
className: B.indicatorIcon(),
|
|
1236
|
+
"aria-hidden": "true"
|
|
1237
|
+
})
|
|
1238
|
+
})]
|
|
1239
|
+
}),
|
|
1240
|
+
j && q.length > 0 && !e.disabled && /* @__PURE__ */ Y("button", {
|
|
1241
|
+
type: "button",
|
|
1242
|
+
tabIndex: -1,
|
|
1243
|
+
className: z ? B.chipsClear() : B.clear(),
|
|
1244
|
+
"aria-label": _e.clear,
|
|
1245
|
+
onClick: () => {
|
|
1246
|
+
Me([]), e.focus();
|
|
1247
|
+
},
|
|
1248
|
+
children: /* @__PURE__ */ Y(Ce, {
|
|
1249
|
+
className: B.clearIcon(),
|
|
1250
|
+
"aria-hidden": "true"
|
|
1251
|
+
})
|
|
1252
|
+
})
|
|
1253
|
+
]
|
|
1254
|
+
}) }),
|
|
1255
|
+
(z || A !== void 0 || L) && /* @__PURE__ */ Y("span", {
|
|
1256
|
+
role: "status",
|
|
1257
|
+
className: B.status(),
|
|
1258
|
+
children: Ue || U.announcement
|
|
1259
|
+
}),
|
|
1260
|
+
/* @__PURE__ */ Y(je, { children: /* @__PURE__ */ Y(Q.Positioner, { children: /* @__PURE__ */ Y(Q.Content, {
|
|
1261
|
+
className: B.content(),
|
|
1262
|
+
"aria-busy": $ || void 0,
|
|
1263
|
+
"aria-label": ze ? R["aria-label"] : void 0,
|
|
1264
|
+
children: ze ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X("div", {
|
|
1265
|
+
className: B.header(),
|
|
1266
|
+
children: [F && /* @__PURE__ */ Y(Q.Context, { children: (e) => /* @__PURE__ */ Y("input", {
|
|
1267
|
+
type: "text",
|
|
1268
|
+
role: "combobox",
|
|
1269
|
+
autoComplete: "off",
|
|
1270
|
+
"aria-autocomplete": "list",
|
|
1271
|
+
"aria-expanded": "true",
|
|
1272
|
+
"data-autofocus": "",
|
|
1273
|
+
"aria-controls": Be,
|
|
1274
|
+
"aria-activedescendant": e.highlightedItem ? e.getItemProps({ item: e.highlightedItem }).id : void 0,
|
|
1275
|
+
"aria-label": _e.filter,
|
|
1276
|
+
placeholder: H.combobox.search,
|
|
1277
|
+
value: ye,
|
|
1278
|
+
className: B.search(),
|
|
1279
|
+
onChange: (t) => Je(e, t.target.value),
|
|
1280
|
+
onKeyDown: (e) => {
|
|
1281
|
+
[
|
|
1282
|
+
" ",
|
|
1283
|
+
"Home",
|
|
1284
|
+
"End"
|
|
1285
|
+
].includes(e.key) && e.stopPropagation();
|
|
1286
|
+
}
|
|
1287
|
+
}) }), k && Ve.length > 0 && /* @__PURE__ */ X("button", {
|
|
1288
|
+
type: "button",
|
|
1289
|
+
role: "checkbox",
|
|
1290
|
+
"aria-checked": He,
|
|
1291
|
+
className: B.selectAll(),
|
|
1292
|
+
onClick: () => Ge(pe(q, Te, A)),
|
|
1293
|
+
onKeyDown: (e) => {
|
|
1294
|
+
(e.key === " " || e.key === "Enter") && e.stopPropagation();
|
|
1295
|
+
},
|
|
1296
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
1297
|
+
className: B.check(),
|
|
1298
|
+
"data-state": He === "mixed" ? "indeterminate" : He ? "checked" : "unchecked",
|
|
1299
|
+
"aria-hidden": "true",
|
|
1300
|
+
children: He === "mixed" ? /* @__PURE__ */ Y(xe, { className: B.checkIcon() }) : He && /* @__PURE__ */ Y(he, { className: B.checkIcon() })
|
|
1301
|
+
}), _e.selectAll]
|
|
1302
|
+
})]
|
|
1303
|
+
}), /* @__PURE__ */ Y(Q.List, {
|
|
1304
|
+
id: Be,
|
|
1305
|
+
className: B.list(),
|
|
1306
|
+
"data-autofocus": F ? void 0 : "",
|
|
1307
|
+
children: Xe
|
|
1308
|
+
})] }) : Xe
|
|
1309
|
+
}) }) }),
|
|
1310
|
+
/* @__PURE__ */ Y(Q.HiddenSelect, {})
|
|
1311
|
+
]
|
|
1312
|
+
});
|
|
1313
|
+
}
|
|
1314
|
+
//#endregion
|
|
1315
|
+
//#region src/components/NumberInput/NumberInput.tsx
|
|
1316
|
+
function kt({ classes: a, value: o, defaultValue: s, onValueChange: c, min: l, max: u, step: d, formatOptions: f = b, locale: p, size: m, invalid: h, success: _, disabled: v, readOnly: y, required: x, name: S, stepper: C = !0, stepperLayout: w = "inline", prefix: E, suffix: D, allowNegative: O = !0, allowDecimal: k = !0, decimals: A, clampBehavior: ee = "blur", emptyFallback: N, selectOnFocus: P = !1, loading: te = !1, clearable: ne = !1, clearLabel: re, id: I, className: L, style: ae, onKeyDown: oe, onPaste: se, onFocus: ce, ...le }) {
|
|
1317
|
+
let de = n("numberInput", j, a), fe = t(), R = p ?? fe.locale, pe = e(), me = Ne(), z = r(), he = !(h || me?.invalid) && (!!_ || z.success), B = de({
|
|
1318
|
+
size: m,
|
|
1319
|
+
stacked: w === "stacked",
|
|
1320
|
+
success: he
|
|
1321
|
+
}), V = A === void 0 ? k ? f : {
|
|
1322
|
+
...f,
|
|
1323
|
+
maximumFractionDigits: 0
|
|
1324
|
+
} : {
|
|
1325
|
+
...f,
|
|
1326
|
+
minimumFractionDigits: A,
|
|
1327
|
+
maximumFractionDigits: A
|
|
1328
|
+
}, _e = O ? l : Math.max(l ?? 0, 0), [ve, ye] = K(null), be = G(s ?? null), Ce = o === void 0 ? N ? ve?.text : void 0 : ve && (ve.number === o || N && ve.number === null) ? ve.text : ue(o, R, V), U = Ce ?? ve?.text ?? ue(s, R, V) ?? "", we = De(), Te = De(), Ee = E || D ? [
|
|
1329
|
+
me?.ariaDescribedby,
|
|
1330
|
+
E && we,
|
|
1331
|
+
D && Te,
|
|
1332
|
+
le["aria-describedby"]
|
|
1333
|
+
].filter(Boolean).join(" ") : void 0, W = G(null), Oe = () => {
|
|
1334
|
+
let e = W.current?.querySelector("input");
|
|
1335
|
+
e && (ie(e), e.focus());
|
|
1336
|
+
}, ke = !!v || !!y || !!me?.disabled || !!me?.readOnly;
|
|
1337
|
+
return /* @__PURE__ */ Y(We.Root, {
|
|
1338
|
+
className: B.base({ class: L }),
|
|
1339
|
+
style: ae,
|
|
1340
|
+
value: Ce,
|
|
1341
|
+
defaultValue: ue(s, R, V),
|
|
1342
|
+
...g(I, "input", {
|
|
1343
|
+
label: me?.ids.label,
|
|
1344
|
+
input: me?.ids.control
|
|
1345
|
+
}),
|
|
1346
|
+
onValueChange: (e) => {
|
|
1347
|
+
let t = Number.isNaN(e.valueAsNumber) ? null : e.valueAsNumber;
|
|
1348
|
+
ye({
|
|
1349
|
+
text: e.value,
|
|
1350
|
+
number: t
|
|
1351
|
+
}), !(t === null && N) && (t !== null && (be.current = t), c?.(t));
|
|
1352
|
+
},
|
|
1353
|
+
onValueCommit: (e) => {
|
|
1354
|
+
if (!N || !Number.isNaN(e.valueAsNumber)) return;
|
|
1355
|
+
let t = o ?? be.current, n = N === "previous" && t !== null ? t : _e ?? 0;
|
|
1356
|
+
ye({
|
|
1357
|
+
text: ue(n, R, V) ?? "",
|
|
1358
|
+
number: n
|
|
1359
|
+
}), c?.(n);
|
|
1360
|
+
},
|
|
1361
|
+
min: _e,
|
|
1362
|
+
max: u,
|
|
1363
|
+
step: d,
|
|
1364
|
+
formatOptions: V,
|
|
1365
|
+
locale: R,
|
|
1366
|
+
invalid: h,
|
|
1367
|
+
disabled: v,
|
|
1368
|
+
readOnly: y,
|
|
1369
|
+
required: x,
|
|
1370
|
+
name: S,
|
|
1371
|
+
clampValueOnBlur: ee !== "none",
|
|
1372
|
+
allowOverflow: ee !== "strict",
|
|
1373
|
+
translations: pe.numberInput,
|
|
1374
|
+
children: /* @__PURE__ */ X(We.Control, {
|
|
1375
|
+
ref: W,
|
|
1376
|
+
className: B.control(),
|
|
1377
|
+
children: [
|
|
1378
|
+
E && /* @__PURE__ */ Y("span", {
|
|
1379
|
+
id: we,
|
|
1380
|
+
className: B.prefix(),
|
|
1381
|
+
children: E
|
|
1382
|
+
}),
|
|
1383
|
+
/* @__PURE__ */ Y(We.Input, {
|
|
1384
|
+
...le,
|
|
1385
|
+
...Ee ? { "aria-describedby": Ee } : {},
|
|
1386
|
+
className: B.input(),
|
|
1387
|
+
"aria-busy": te || void 0,
|
|
1388
|
+
onKeyDown: (e) => {
|
|
1389
|
+
if (oe?.(e), e.defaultPrevented || e.ctrlKey || e.metaKey || e.altKey) return;
|
|
1390
|
+
let t = e.currentTarget, n = t.selectionStart ?? t.value.length, r = t.value.slice(0, n) + t.value.slice(t.selectionEnd ?? n), i = M(e.key, r, R, {
|
|
1391
|
+
allowDecimal: k && A !== 0,
|
|
1392
|
+
allowNegative: O
|
|
1393
|
+
});
|
|
1394
|
+
i && (e.preventDefault(), i !== "block" && T(t, i.insert));
|
|
1395
|
+
},
|
|
1396
|
+
onPaste: (e) => {
|
|
1397
|
+
se?.(e);
|
|
1398
|
+
let t = e.currentTarget, n = (t.selectionStart ?? 0) === 0 && (t.selectionEnd ?? 0) === t.value.length, r = F(e.clipboardData.getData("text"), R);
|
|
1399
|
+
!e.defaultPrevented && n && r !== null && (e.preventDefault(), ie(t, ue(r, R, V)));
|
|
1400
|
+
},
|
|
1401
|
+
onFocus: (e) => {
|
|
1402
|
+
ce?.(e);
|
|
1403
|
+
let t = e.currentTarget;
|
|
1404
|
+
P && requestAnimationFrame(() => t.select());
|
|
1405
|
+
}
|
|
1406
|
+
}),
|
|
1407
|
+
(te || ne || he) && /* @__PURE__ */ Y(i, {
|
|
1408
|
+
loading: te,
|
|
1409
|
+
clear: ne && !!U && !ke,
|
|
1410
|
+
clearLabel: re ?? pe.field.clear,
|
|
1411
|
+
onClear: Oe,
|
|
1412
|
+
success: he,
|
|
1413
|
+
classes: {
|
|
1414
|
+
spinner: B.spinner(),
|
|
1415
|
+
clear: B.clear(),
|
|
1416
|
+
clearIcon: B.clearIcon(),
|
|
1417
|
+
statusIcon: B.statusIcon()
|
|
1418
|
+
}
|
|
1419
|
+
}),
|
|
1420
|
+
D && /* @__PURE__ */ Y("span", {
|
|
1421
|
+
id: Te,
|
|
1422
|
+
className: B.suffix(),
|
|
1423
|
+
children: D
|
|
1424
|
+
}),
|
|
1425
|
+
C && w === "stacked" ? /* @__PURE__ */ X("div", {
|
|
1426
|
+
className: B.stepper(),
|
|
1427
|
+
children: [/* @__PURE__ */ Y(We.IncrementTrigger, {
|
|
1428
|
+
className: B.button(),
|
|
1429
|
+
children: /* @__PURE__ */ Y(H, {
|
|
1430
|
+
className: B.buttonIcon(),
|
|
1431
|
+
"aria-hidden": "true"
|
|
1432
|
+
})
|
|
1433
|
+
}), /* @__PURE__ */ Y(We.DecrementTrigger, {
|
|
1434
|
+
className: B.button(),
|
|
1435
|
+
children: /* @__PURE__ */ Y(ge, {
|
|
1436
|
+
className: B.buttonIcon(),
|
|
1437
|
+
"aria-hidden": "true"
|
|
1438
|
+
})
|
|
1439
|
+
})]
|
|
1440
|
+
}) : C && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(We.DecrementTrigger, {
|
|
1441
|
+
className: B.button(),
|
|
1442
|
+
children: /* @__PURE__ */ Y(xe, {
|
|
1443
|
+
className: B.buttonIcon(),
|
|
1444
|
+
"aria-hidden": "true"
|
|
1445
|
+
})
|
|
1446
|
+
}), /* @__PURE__ */ Y(We.IncrementTrigger, {
|
|
1447
|
+
className: B.button(),
|
|
1448
|
+
children: /* @__PURE__ */ Y(Se, {
|
|
1449
|
+
className: B.buttonIcon(),
|
|
1450
|
+
"aria-hidden": "true"
|
|
1451
|
+
})
|
|
1452
|
+
})] })
|
|
1453
|
+
]
|
|
1454
|
+
})
|
|
1455
|
+
});
|
|
1456
|
+
}
|
|
1457
|
+
//#endregion
|
|
1458
|
+
//#region src/components/ContextMenu/ContextMenu.tsx
|
|
1459
|
+
function At({ classes: e, items: t, label: r, onSelect: i, onCheckedChange: a, onValueChange: o, linkAs: s, renderItem: c, open: l, onOpenChange: u, onBeforeOpen: d, closeOnScroll: f, closeOnResize: p, closeOnBlur: m, highlightFirst: h, ref: g, children: y }) {
|
|
1460
|
+
let b = n("menu", k, e)(), x = qe({
|
|
1461
|
+
open: l,
|
|
1462
|
+
anchor: void 0,
|
|
1463
|
+
onOpenChange: u,
|
|
1464
|
+
ref: g,
|
|
1465
|
+
restoreFocus: !0
|
|
1466
|
+
}), S = G(null), C = Ze(x.isOpen, x.handle.close, S, {
|
|
1467
|
+
closeOnScroll: f,
|
|
1468
|
+
closeOnResize: p,
|
|
1469
|
+
closeOnBlur: m,
|
|
1470
|
+
highlightFirst: h
|
|
1471
|
+
}), w = G(null), [T] = K(_);
|
|
1472
|
+
return W(() => {
|
|
1473
|
+
let e = w;
|
|
1474
|
+
return () => e.current?.cancel();
|
|
1475
|
+
}, []), /* @__PURE__ */ Y(Xe, {
|
|
1476
|
+
items: t,
|
|
1477
|
+
linkAs: s,
|
|
1478
|
+
renderItem: c,
|
|
1479
|
+
onCheckedChange: a,
|
|
1480
|
+
onValueChange: o,
|
|
1481
|
+
children: /* @__PURE__ */ X(Z.Root, {
|
|
1482
|
+
open: x.isOpen,
|
|
1483
|
+
onOpenChange: (e) => x.onOpenChange(e.open),
|
|
1484
|
+
positioning: x.positioning({}),
|
|
1485
|
+
anchorPoint: x.anchorPoint,
|
|
1486
|
+
...C,
|
|
1487
|
+
lazyMount: !0,
|
|
1488
|
+
unmountOnExit: !0,
|
|
1489
|
+
onSelect: (e) => i?.(e.value),
|
|
1490
|
+
children: [/* @__PURE__ */ Y(Z.ContextTrigger, {
|
|
1491
|
+
asChild: !0,
|
|
1492
|
+
onPointerDown: (e) => {
|
|
1493
|
+
let t = e.target;
|
|
1494
|
+
T.pointerdown(), w.current?.cancel(), w.current = v((e) => {
|
|
1495
|
+
d?.(t, {
|
|
1496
|
+
source: "pointer",
|
|
1497
|
+
focused: null
|
|
1498
|
+
}), x.handle.open(e);
|
|
1499
|
+
}), w.current.down(e);
|
|
1500
|
+
},
|
|
1501
|
+
onKeyDown: (e) => T.keydown(e),
|
|
1502
|
+
onContextMenu: (e) => d?.(e.target, T.contextmenu()),
|
|
1503
|
+
onPointerMove: (e) => w.current?.move(e),
|
|
1504
|
+
onPointerUp: () => w.current?.cancel(),
|
|
1505
|
+
onPointerCancel: () => w.current?.cancel(),
|
|
1506
|
+
children: y
|
|
1507
|
+
}), /* @__PURE__ */ Y(je, { children: /* @__PURE__ */ Y(Z.Positioner, { children: /* @__PURE__ */ Y(Z.Content, {
|
|
1508
|
+
ref: S,
|
|
1509
|
+
className: b.content(),
|
|
1510
|
+
...r ? {
|
|
1511
|
+
"aria-label": r,
|
|
1512
|
+
"aria-labelledby": void 0
|
|
1513
|
+
} : {},
|
|
1514
|
+
children: /* @__PURE__ */ Y(et, {
|
|
1515
|
+
entries: t,
|
|
1516
|
+
onSelect: i
|
|
1517
|
+
})
|
|
1518
|
+
}) }) })]
|
|
1519
|
+
})
|
|
1520
|
+
});
|
|
1521
|
+
}
|
|
1522
|
+
//#endregion
|
|
1523
|
+
export { qe as S, nt as _, xt as a, et as b, ot as c, ht as d, st as f, rt as g, ct as h, Dt as i, at as l, lt as m, kt as n, gt as o, mt as p, Ot as r, _t as s, At as t, ft as u, tt as v, Xe as x, Qe as y };
|