@slotted/react 0.1.0-beta.26 → 0.1.0-beta.28
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/{action-bar-DckD0Sug.js → action-bar-CAtXzym2.js} +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/{cascader-47GYpojH.js → cascader-DUiUVxBt.js} +190 -190
- package/dist/cascader.js +1 -1
- package/dist/{checkbox-Dw9R1CGR.js → checkbox-D67PWyL0.js} +3 -3
- package/dist/{checkbox-group-DDlz-UF4.js → checkbox-group-DZZbowG-.js} +2 -2
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{color-picker-BbyW5ALf.js → color-picker-DP8MjvXk.js} +3 -3
- package/dist/color-picker.js +1 -1
- package/dist/{column-manager-Bz0bb4mq.js → column-manager-C3iL_I5T.js} +3 -3
- package/dist/column-manager.js +1 -1
- package/dist/{combobox-BA2nvbnA.js → combobox-BIi7grOR.js} +87 -87
- package/dist/combobox.js +1 -1
- package/dist/{command-palette-DEKWsUFR.js → command-palette-BxbhO044.js} +11 -11
- package/dist/command-palette.js +1 -1
- package/dist/{context-menu-CfEEqDKr.js → context-menu-BJyDD17g.js} +1 -1
- package/dist/context-menu.js +1 -1
- package/dist/{currency-field-CTzBMH8g.js → currency-field-CAO2ZolW.js} +1 -1
- package/dist/currency-field.js +1 -1
- package/dist/{dashboard-grid-WinSY-q3.js → dashboard-grid-De6al1Mj.js} +1 -1
- package/dist/dashboard-grid.js +1 -1
- package/dist/{data-grid-BWWvixwB.js → data-grid-BKOFLdSD.js} +46 -46
- package/dist/data-grid.js +1 -1
- package/dist/{data-list-iw9K_oiz.js → data-list-BDYbrO3V.js} +6 -6
- package/dist/data-list.js +1 -1
- package/dist/{date-field-B2WG_m4C.js → date-field-BEdt1xDF.js} +1 -1
- package/dist/date-field.js +1 -1
- package/dist/{date-picker-B2wqU3Mw.js → date-picker-DJMET62H.js} +2 -2
- package/dist/date-picker.js +1 -1
- package/dist/{date-range-picker-BhQwOKkE.js → date-range-picker-CinTpTme.js} +2 -2
- package/dist/date-range-picker.js +1 -1
- package/dist/{datetime-field-CvKPkvaE.js → datetime-field-2tsqzWVH.js} +1 -1
- package/dist/datetime-field.js +1 -1
- package/dist/{datetime-picker-C-PwlBW5.js → datetime-picker-COew4Y_B.js} +2 -2
- package/dist/datetime-picker.js +1 -1
- package/dist/{datetime-range-picker-0xs12Cf1.js → datetime-range-picker-DTT_CvkE.js} +2 -2
- package/dist/datetime-range-picker.js +1 -1
- package/dist/docs/chart.json +2 -0
- package/dist/docs/chart.md +1 -1
- package/dist/docs/combobox.json +1 -0
- package/dist/docs/combobox.md +1 -1
- package/dist/docs/dialog.json +23 -4
- package/dist/docs/dialog.md +2 -60
- package/dist/docs/dialog.props.md +68 -0
- package/dist/docs/drawer.json +2 -0
- package/dist/docs/drawer.md +1 -1
- package/dist/docs/field-group.json +8 -0
- package/dist/docs/field-group.md +1 -0
- package/dist/docs/guidelines/forms.md +1 -1
- package/dist/docs/menu.json +1 -0
- package/dist/docs/menu.md +1 -1
- package/dist/docs/multi-select.json +1 -0
- package/dist/docs/multi-select.md +1 -1
- package/dist/docs/select.json +1 -0
- package/dist/docs/select.md +1 -1
- package/dist/docs/skills/theme-app/SKILL.md +4 -1
- package/dist/{entity-picker-WkBLvR2T.js → entity-picker-DfoAxqaa.js} +26 -26
- package/dist/entity-picker.js +1 -1
- package/dist/{event-calendar-BaPllnNk.js → event-calendar-CFw9KKAm.js} +3 -3
- package/dist/event-calendar.js +1 -1
- package/dist/{field-CSSHwGq_.js → field-BjF0c0U9.js} +2 -2
- package/dist/{field-group-DeBTueJW.js → field-group-Ctwd3EUR.js} +38 -37
- package/dist/field-group.js +1 -1
- package/dist/field.js +1 -1
- package/dist/{filter-bar-DRQEl4-J.js → filter-bar-BJGqeIKl.js} +9 -9
- package/dist/filter-bar.js +1 -1
- package/dist/{import-export-center-C1t2tkzg.js → import-export-center-yxNcKfQX.js} +1 -1
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +53 -53
- package/dist/{listbox-B9cBuitS.js → listbox-Df177k5C.js} +11 -11
- package/dist/listbox.js +1 -1
- package/dist/{markdown-DX-mBYVT.js → markdown-D2EB46zY.js} +1 -1
- package/dist/markdown.js +1 -1
- package/dist/{menu-parts-7F8syoFE.js → menu-parts-DNQDoJnd.js} +203 -204
- package/dist/menu.js +1 -1
- package/dist/{menubar-DzVGFn_I.js → menubar-CY8oxV0V.js} +1 -1
- package/dist/menubar.js +1 -1
- package/dist/{multi-select-DnOAXeuF.js → multi-select-DSSDlWVZ.js} +69 -69
- package/dist/multi-select.js +1 -1
- package/dist/{number-field-C20-8yda.js → number-field-DzOcs9uG.js} +1 -1
- package/dist/number-field.js +1 -1
- package/dist/{otp-input-YI-Emc5k.js → otp-input-ult9fNdj.js} +1 -1
- package/dist/otp-input.js +1 -1
- package/dist/{prompt-composer-DsnPcKa4.js → prompt-composer-D9oaFXDU.js} +1 -1
- package/dist/prompt-composer.js +1 -1
- package/dist/{radio-group-DA8_LbEz.js → radio-group-Dct1Kkuf.js} +2 -2
- package/dist/radio-group.js +1 -1
- package/dist/{rating-DSSqi85N.js → rating-Cjrwmxyw.js} +1 -1
- package/dist/rating.js +1 -1
- package/dist/{saved-views-CsVRZTwK.js → saved-views-BKOHI-Od.js} +3 -3
- package/dist/saved-views.js +1 -1
- package/dist/{segmented-control-Dae5wU9X.js → segmented-control-BINpaKhI.js} +2 -2
- package/dist/segmented-control.js +1 -1
- package/dist/{select-De77allF.js → select-jdqT8lFi.js} +264 -264
- package/dist/select.js +1 -1
- package/dist/{slider-DNRphJot.js → slider-DuJGh0pf.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/{split-button-DA1wcDJB.js → split-button-CgfY606Z.js} +1 -1
- package/dist/split-button.js +1 -1
- package/dist/styles/action-bar.css +1 -1
- package/dist/styles/action-sheet.css +1 -1
- package/dist/styles/card.css +1 -1
- package/dist/styles/cascader.css +2 -2
- package/dist/styles/chart.css +1 -1
- package/dist/styles/checkbox-group.css +3 -3
- package/dist/styles/checkbox.css +3 -3
- package/dist/styles/color-picker.css +4 -4
- package/dist/styles/column-manager.css +6 -6
- package/dist/styles/combobox.css +3 -3
- package/dist/styles/command-palette.css +1 -1
- package/dist/styles/context-menu.css +1 -1
- package/dist/styles/currency-field.css +2 -2
- package/dist/styles/dashboard-grid.css +2 -2
- package/dist/styles/data-grid.css +7 -7
- package/dist/styles/data-list.css +4 -4
- package/dist/styles/date-field.css +2 -2
- package/dist/styles/date-picker.css +2 -2
- package/dist/styles/date-range-picker.css +2 -2
- package/dist/styles/datetime-field.css +2 -2
- package/dist/styles/datetime-picker.css +2 -2
- package/dist/styles/datetime-range-picker.css +2 -2
- package/dist/styles/dialog.css +1 -1
- package/dist/styles/drawer.css +1 -1
- package/dist/styles/entity-picker.css +3 -3
- package/dist/styles/event-calendar.css +6 -6
- package/dist/styles/field-group.css +3 -3
- package/dist/styles/field.css +2 -2
- package/dist/styles/filter-bar.css +8 -8
- package/dist/styles/hover-card.css +1 -1
- package/dist/styles/import-export-center.css +5 -5
- package/dist/styles/index.css +12 -12
- package/dist/styles/listbox.css +2 -2
- package/dist/styles/markdown.css +3 -3
- package/dist/styles/menu.css +1 -1
- package/dist/styles/menubar.css +1 -1
- package/dist/styles/multi-select.css +3 -3
- package/dist/styles/notification-center.css +1 -1
- package/dist/styles/number-field.css +2 -2
- package/dist/styles/otp-input.css +2 -2
- package/dist/styles/popover.css +1 -1
- package/dist/styles/prompt-composer.css +2 -2
- package/dist/styles/radio-group.css +3 -3
- package/dist/styles/rating.css +2 -2
- package/dist/styles/saved-views.css +4 -4
- package/dist/styles/segmented-control.css +3 -3
- package/dist/styles/select.css +3 -3
- package/dist/styles/side-navigation.css +1 -1
- package/dist/styles/slider.css +2 -2
- package/dist/styles/split-button.css +1 -1
- package/dist/styles/switch.css +2 -2
- package/dist/styles/table.css +5 -5
- package/dist/styles/tags-input.css +2 -2
- package/dist/styles/text-field.css +2 -2
- package/dist/styles/textarea.css +2 -2
- package/dist/styles/time-field.css +2 -2
- package/dist/styles/time-picker.css +2 -2
- package/dist/styles/time-range-picker.css +2 -2
- package/dist/styles/toggle-group.css +2 -2
- package/dist/styles/toolbar.css +1 -1
- package/dist/styles/tooltip.css +1 -1
- package/dist/styles/top-navigation.css +1 -1
- package/dist/styles/transfer.css +3 -3
- package/dist/styles/upload.css +3 -3
- package/dist/styles/wizard.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/{switch-gR_OvGG8.js → switch-Tr3blHWc.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/{table-C3cjkzps.js → table-b7Wt5A88.js} +217 -217
- package/dist/table.js +1 -1
- package/dist/{tags-input-DEhtpizX.js → tags-input-_cYR2JSK.js} +10 -10
- package/dist/tags-input.js +1 -1
- package/dist/{text-field-RGXN7zNu.js → text-field-DEm3MEe2.js} +1 -1
- package/dist/text-field.js +1 -1
- package/dist/{textarea-AhpUmnMk.js → textarea-BRRn55L2.js} +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{time-field-xkxX8JF6.js → time-field-C9dFaZOx.js} +1 -1
- package/dist/time-field.js +1 -1
- package/dist/{time-picker-Da_UhP9X.js → time-picker-VJegeX4j.js} +2 -2
- package/dist/time-picker.js +1 -1
- package/dist/{time-range-picker-CfVzD53N.js → time-range-picker-DFOxymH_.js} +2 -2
- package/dist/time-range-picker.js +1 -1
- package/dist/{toggle-group-DoxPLYJ3.js → toggle-group-DiKxYOwh.js} +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/{toolbar-CtSZ88HI.js → toolbar-CSiDqC8L.js} +1 -1
- package/dist/toolbar.js +1 -1
- package/dist/{transfer-BMRyopEw.js → transfer-BrYBBjaG.js} +9 -9
- package/dist/transfer.js +1 -1
- package/dist/{tree-DBirM2v9.js → tree-D-y-0TrL.js} +14 -14
- package/dist/tree.js +1 -1
- package/dist/types/field/field-parts.d.ts.map +1 -1
- package/dist/types/field-group/field-group-parts.d.ts.map +1 -1
- package/dist/types/field-group/field-group.d.ts +1 -1
- package/dist/types/field-group/field-group.d.ts.map +1 -1
- package/dist/types/field-group/field-group.types.d.ts +9 -0
- package/dist/types/field-group/field-group.types.d.ts.map +1 -1
- package/dist/types/field-group/index.d.ts +1 -1
- package/dist/types/field-group/index.d.ts.map +1 -1
- package/dist/types/menu/menu-parts.d.ts.map +1 -1
- package/dist/{upload-BqVBpYaZ.js → upload-BmRZHySQ.js} +1 -1
- package/dist/upload.js +1 -1
- package/package.json +6 -6
|
@@ -10,14 +10,15 @@ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
|
10
10
|
import { createPresence as w } from "@slotted/core/presence";
|
|
11
11
|
import { keysMessages as T } from "@slotted/core/i18n";
|
|
12
12
|
import { createPortalRoot as E, setPortalContainer as D } from "@slotted/core/portal";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
13
|
+
import { revealWithin as O } from "@slotted/core/collection";
|
|
14
|
+
import { createDismissableLayer as k } from "@slotted/core/dismissable-layer";
|
|
15
|
+
import { createPointerIntent as A } from "@slotted/core/pointer-intent";
|
|
16
|
+
import { createPositioner as j, submenuOffsets as M } from "@slotted/core/positioner";
|
|
17
|
+
import { createTypeahead as ee, isPrintable as N } from "@slotted/core/typeahead";
|
|
18
|
+
import { createPortal as te } from "react-dom";
|
|
19
|
+
import { canonicalKey as ne, parseShortcut as re, resolveShortcut as P } from "@slotted/core/keys";
|
|
19
20
|
//#region src/menu/menu-defaults.tsx
|
|
20
|
-
var
|
|
21
|
+
var F = {
|
|
21
22
|
align: "start",
|
|
22
23
|
alignOffset: 0,
|
|
23
24
|
closeOnEscape: !0,
|
|
@@ -41,12 +42,12 @@ var N = {
|
|
|
41
42
|
typeahead: !0,
|
|
42
43
|
typeaheadTimeout: 500,
|
|
43
44
|
width: "content"
|
|
44
|
-
},
|
|
45
|
-
function
|
|
46
|
-
return m(
|
|
45
|
+
}, I = d(F);
|
|
46
|
+
function L() {
|
|
47
|
+
return m(I);
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
-
let r =
|
|
49
|
+
function R({ children: e, container: t, ...n }) {
|
|
50
|
+
let r = L(), i = y(null);
|
|
50
51
|
h(() => {
|
|
51
52
|
if (t !== void 0) return i.current = t, D(t), () => D(null);
|
|
52
53
|
}, [t]);
|
|
@@ -75,53 +76,53 @@ function I({ children: e, container: t, ...n }) {
|
|
|
75
76
|
typeaheadTimeout: n.typeaheadTimeout ?? r.typeaheadTimeout,
|
|
76
77
|
width: n.width ?? r.width
|
|
77
78
|
};
|
|
78
|
-
return /* @__PURE__ */ S(
|
|
79
|
+
return /* @__PURE__ */ S(I.Provider, {
|
|
79
80
|
value: a,
|
|
80
81
|
children: e
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
84
|
//#endregion
|
|
84
85
|
//#region src/menu/menu.tsx
|
|
85
|
-
var
|
|
86
|
-
function
|
|
87
|
-
return m(
|
|
86
|
+
var ie = d(void 0), z = d(null), B = d(null), ae = z.Provider, oe = B.Provider;
|
|
87
|
+
function V() {
|
|
88
|
+
return m(z);
|
|
88
89
|
}
|
|
89
90
|
function se() {
|
|
90
|
-
return m(
|
|
91
|
+
return m(B);
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
-
let e = m(
|
|
93
|
+
function H() {
|
|
94
|
+
let e = m(ie);
|
|
94
95
|
if (e === void 0) throw Error("MenuTrigger, MenuContent and every item have to be inside a Menu.");
|
|
95
96
|
return e;
|
|
96
97
|
}
|
|
97
98
|
function ce(e, t) {
|
|
98
99
|
return e === void 0 ? null : typeof e == "string" ? t?.querySelector(e) ?? null : e instanceof Element ? e : e.current ?? null;
|
|
99
100
|
}
|
|
100
|
-
function le({ align: e, alignOffset: t, anchor: n, children: r, closeOnEscape: i, closeOnOutsidePress: a, closeOnSelect: o, collisionPadding: s, defaultOpen: c, disabled: u, finalFocus: d, flip: f, hideWhenDetached: m, loop: h, mount: v, onOpenChange: x, open: C, openOnHover: w, portal: T, ref: E, shift: D, side: O, sideOffset: k, size:
|
|
101
|
-
let
|
|
101
|
+
function le({ align: e, alignOffset: t, anchor: n, children: r, closeOnEscape: i, closeOnOutsidePress: a, closeOnSelect: o, collisionPadding: s, defaultOpen: c, disabled: u, finalFocus: d, flip: f, hideWhenDetached: m, loop: h, mount: v, onOpenChange: x, open: C, openOnHover: w, portal: T, ref: E, shift: D, side: O, sideOffset: k, size: A, strategy: j, submenuCloseDelay: M, submenuOpenDelay: ee, typeahead: N, typeaheadTimeout: te, value: ne, width: re }) {
|
|
102
|
+
let P = L(), F = V(), I = se(), R = F === null && I !== null, z = g(), B = ne ?? z, ae = `${z}menu`, oe = `${z}trigger`, [H, le] = b(c ?? !1), [U, W] = b(null), [G, K] = b(null), q = u ?? P.disabled, J = (R ? I?.value === B : C ?? H) && !q, Y = y(J);
|
|
102
103
|
J && (Y.current = !0);
|
|
103
104
|
let X = y("first"), Z = y({
|
|
104
105
|
contentNode: G,
|
|
105
106
|
current: J,
|
|
106
107
|
finalFocus: d,
|
|
107
|
-
identity:
|
|
108
|
+
identity: B,
|
|
108
109
|
menubar: I,
|
|
109
|
-
onBar:
|
|
110
|
+
onBar: R,
|
|
110
111
|
onOpenChange: x,
|
|
111
112
|
open: C,
|
|
112
|
-
parent:
|
|
113
|
+
parent: F,
|
|
113
114
|
triggerNode: U
|
|
114
115
|
});
|
|
115
116
|
Z.current = {
|
|
116
117
|
contentNode: G,
|
|
117
118
|
current: J,
|
|
118
119
|
finalFocus: d,
|
|
119
|
-
identity:
|
|
120
|
+
identity: B,
|
|
120
121
|
menubar: I,
|
|
121
|
-
onBar:
|
|
122
|
+
onBar: R,
|
|
122
123
|
onOpenChange: x,
|
|
123
124
|
open: C,
|
|
124
|
-
parent:
|
|
125
|
+
parent: F,
|
|
125
126
|
triggerNode: U
|
|
126
127
|
};
|
|
127
128
|
let Q = p((e, t, n) => {
|
|
@@ -134,97 +135,97 @@ function le({ align: e, alignOffset: t, anchor: n, children: r, closeOnEscape: i
|
|
|
134
135
|
i = e.cancelled, r.onOpenChange?.(e.value, e);
|
|
135
136
|
}
|
|
136
137
|
}).request(e, t, n);
|
|
137
|
-
i || (r.onBar && r.menubar !== null ? e ? r.menubar.open(r.identity, t, n) : r.menubar.close(t, n) : a &&
|
|
138
|
+
i || (r.onBar && r.menubar !== null ? e ? r.menubar.open(r.identity, t, n) : r.menubar.close(t, n) : a && le(e), !e && t !== "outsidePress" && t !== "programmatic" && (ce(r.finalFocus, r.contentNode) ?? r.triggerNode)?.focus({ preventScroll: !0 }));
|
|
138
139
|
}, []);
|
|
139
140
|
_(E, () => ({
|
|
140
141
|
close: () => Q(!1, "programmatic"),
|
|
141
142
|
open: () => Q(!0, "programmatic"),
|
|
142
143
|
focus: () => Z.current.triggerNode?.focus({ preventScroll: !0 })
|
|
143
144
|
}), [Q]);
|
|
144
|
-
let
|
|
145
|
-
align: e ?? (
|
|
146
|
-
alignOffset: t ??
|
|
145
|
+
let $ = F === null ? R && I?.orientation === "vertical" ? "inline-end" : void 0 : "inline-end", ue = {
|
|
146
|
+
align: e ?? (F === null ? P.align : "start"),
|
|
147
|
+
alignOffset: t ?? P.alignOffset,
|
|
147
148
|
anchor: n ?? null,
|
|
148
|
-
closeOnEscape: i ??
|
|
149
|
-
closeOnOutsidePress: a ??
|
|
150
|
-
closeOnSelect: o ??
|
|
151
|
-
collisionPadding: s ??
|
|
152
|
-
contentId:
|
|
149
|
+
closeOnEscape: i ?? P.closeOnEscape,
|
|
150
|
+
closeOnOutsidePress: a ?? P.closeOnOutsidePress,
|
|
151
|
+
closeOnSelect: o ?? P.closeOnSelect,
|
|
152
|
+
collisionPadding: s ?? P.collisionPadding,
|
|
153
|
+
contentId: ae,
|
|
153
154
|
contentNode: G,
|
|
154
|
-
disabled: q ||
|
|
155
|
+
disabled: q || R && (I?.disabled ?? !1),
|
|
155
156
|
entry: X,
|
|
156
|
-
flip: f ??
|
|
157
|
-
hideWhenDetached: m ??
|
|
158
|
-
identity:
|
|
159
|
-
loop: h ??
|
|
157
|
+
flip: f ?? P.flip,
|
|
158
|
+
hideWhenDetached: m ?? P.hideWhenDetached,
|
|
159
|
+
identity: B,
|
|
160
|
+
loop: h ?? P.loop,
|
|
160
161
|
menubar: I,
|
|
161
|
-
mount: v ??
|
|
162
|
+
mount: v ?? P.mount,
|
|
162
163
|
open: J,
|
|
163
|
-
openOnHover: w ??
|
|
164
|
-
parent:
|
|
165
|
-
portal: T ??
|
|
164
|
+
openOnHover: w ?? P.openOnHover,
|
|
165
|
+
parent: F,
|
|
166
|
+
portal: T ?? P.portal,
|
|
166
167
|
seen: Y.current,
|
|
167
168
|
setContentNode: K,
|
|
168
169
|
setTriggerNode: W,
|
|
169
|
-
shift: D ??
|
|
170
|
-
side: O ??
|
|
171
|
-
sideOffset: k ??
|
|
172
|
-
onBar:
|
|
173
|
-
size:
|
|
174
|
-
strategy:
|
|
175
|
-
submenuCloseDelay:
|
|
176
|
-
submenuOpenDelay:
|
|
170
|
+
shift: D ?? P.shift,
|
|
171
|
+
side: O ?? $ ?? P.side,
|
|
172
|
+
sideOffset: k ?? P.sideOffset,
|
|
173
|
+
onBar: R,
|
|
174
|
+
size: A ?? (R ? I?.size : void 0) ?? P.size,
|
|
175
|
+
strategy: j ?? P.strategy,
|
|
176
|
+
submenuCloseDelay: M ?? P.submenuCloseDelay,
|
|
177
|
+
submenuOpenDelay: ee ?? P.submenuOpenDelay,
|
|
177
178
|
toggle: Q,
|
|
178
|
-
triggerId:
|
|
179
|
+
triggerId: oe,
|
|
179
180
|
triggerNode: U,
|
|
180
|
-
typeahead:
|
|
181
|
-
typeaheadTimeout:
|
|
182
|
-
width:
|
|
181
|
+
typeahead: N ?? P.typeahead,
|
|
182
|
+
typeaheadTimeout: te ?? P.typeaheadTimeout,
|
|
183
|
+
width: F === null ? re ?? P.width : "content"
|
|
183
184
|
};
|
|
184
|
-
return /* @__PURE__ */ S(
|
|
185
|
-
value:
|
|
185
|
+
return /* @__PURE__ */ S(ie.Provider, {
|
|
186
|
+
value: ue,
|
|
186
187
|
children: r
|
|
187
188
|
});
|
|
188
189
|
}
|
|
189
190
|
//#endregion
|
|
190
191
|
//#region src/menu/menu-items.tsx
|
|
191
|
-
function
|
|
192
|
+
function U(e, t) {
|
|
192
193
|
return (n) => {
|
|
193
194
|
e?.(n), n.defaultPrevented || t(n);
|
|
194
195
|
};
|
|
195
196
|
}
|
|
196
|
-
var
|
|
197
|
+
var W = {
|
|
197
198
|
alt: "Alt",
|
|
198
199
|
ctrl: "Control",
|
|
199
200
|
meta: "Meta",
|
|
200
201
|
shift: "Shift"
|
|
201
202
|
};
|
|
202
|
-
function
|
|
203
|
+
function G(e, t) {
|
|
203
204
|
let n = re(e);
|
|
204
205
|
if (n.length === 1) return n[0]?.map((e) => {
|
|
205
206
|
let n = ne(e);
|
|
206
207
|
if (n === "mod") return t === "mac" ? "Meta" : "Control";
|
|
207
|
-
if (n !== void 0 && n in
|
|
208
|
+
if (n !== void 0 && n in W) return W[n];
|
|
208
209
|
let r = n ?? e;
|
|
209
210
|
return r.length === 1 ? r.toUpperCase() : `${r[0]?.toUpperCase()}${r.slice(1)}`;
|
|
210
211
|
}).join("+");
|
|
211
212
|
}
|
|
212
|
-
function
|
|
213
|
-
let r =
|
|
213
|
+
function K(e, t, n) {
|
|
214
|
+
let r = P(e, {
|
|
214
215
|
platform: t,
|
|
215
216
|
t: n
|
|
216
217
|
});
|
|
217
218
|
return r.steps.map((e) => e.map((e) => e.legend).join(r.separator)).join(` ${r.thenLabel} `);
|
|
218
219
|
}
|
|
219
|
-
function
|
|
220
|
+
function q({ children: e, ...t }) {
|
|
220
221
|
return /* @__PURE__ */ S("span", {
|
|
221
222
|
...o(t, "part", "icon"),
|
|
222
223
|
children: e
|
|
223
224
|
});
|
|
224
225
|
}
|
|
225
|
-
var
|
|
226
|
-
function
|
|
227
|
-
let n = m(
|
|
226
|
+
var J = d(null);
|
|
227
|
+
function Y({ children: e, ...t }) {
|
|
228
|
+
let n = m(J), r = {
|
|
228
229
|
...n === null ? {} : { id: `${n}label` },
|
|
229
230
|
...t
|
|
230
231
|
};
|
|
@@ -233,8 +234,8 @@ function J({ children: e, ...t }) {
|
|
|
233
234
|
children: e
|
|
234
235
|
});
|
|
235
236
|
}
|
|
236
|
-
function
|
|
237
|
-
let n = m(
|
|
237
|
+
function X({ children: e, ...t }) {
|
|
238
|
+
let n = m(J), r = {
|
|
238
239
|
...n === null ? {} : { id: `${n}description` },
|
|
239
240
|
...t
|
|
240
241
|
};
|
|
@@ -243,22 +244,22 @@ function Y({ children: e, ...t }) {
|
|
|
243
244
|
children: e
|
|
244
245
|
});
|
|
245
246
|
}
|
|
246
|
-
function
|
|
247
|
+
function Z({ children: e, ...t }) {
|
|
247
248
|
return /* @__PURE__ */ S("span", {
|
|
248
249
|
...o(t, "part", "meta"),
|
|
249
250
|
children: e
|
|
250
251
|
});
|
|
251
252
|
}
|
|
252
|
-
function
|
|
253
|
+
function Q({ children: t, keys: n, ...i }) {
|
|
253
254
|
let a = r(void 0), s = e(T);
|
|
254
255
|
return /* @__PURE__ */ S("span", {
|
|
255
256
|
...i,
|
|
256
257
|
...o(n === void 0 ? {} : { "aria-hidden": !0 }, "part", "shortcut"),
|
|
257
|
-
children: n === void 0 ? t :
|
|
258
|
+
children: n === void 0 ? t : K(n, a, s)
|
|
258
259
|
});
|
|
259
260
|
}
|
|
260
|
-
function
|
|
261
|
-
let T =
|
|
261
|
+
function $({ checked: e, children: t, closeOnSelect: n, closesByDefault: a, commit: o, description: s, disabled: c, icon: l, indicator: d, meta: p, onSelect: m, ref: h, render: _, role: v = "menuitem", shortcut: y, textValue: b, tone: x, ...w }) {
|
|
262
|
+
let T = H(), E = V(), D = r(void 0), O = g(), k = u.toArray(t).flatMap((e) => f(e) ? [e.type] : []), A = k.includes(Y), j = s !== void 0 || k.includes(X), M = w["aria-label"] !== void 0 || w["aria-labelledby"] !== void 0, ee = (e, t) => {
|
|
262
263
|
if (c === !0) return;
|
|
263
264
|
o?.(e, t);
|
|
264
265
|
let r = !1;
|
|
@@ -272,9 +273,9 @@ function Q({ checked: e, children: t, closeOnSelect: n, closesByDefault: a, comm
|
|
|
272
273
|
r = !0;
|
|
273
274
|
}
|
|
274
275
|
}), !r && (n ?? a ?? T.closeOnSelect) && E?.closeAll("select", t);
|
|
275
|
-
},
|
|
276
|
-
|
|
277
|
-
},
|
|
276
|
+
}, N = (e) => {
|
|
277
|
+
ee(e.detail === 0 ? "keyboard" : "pointer", e.nativeEvent);
|
|
278
|
+
}, te = (e) => {
|
|
278
279
|
if (e.key === " " && v !== "menuitem") {
|
|
279
280
|
if (e.preventDefault(), c === !0) return;
|
|
280
281
|
o?.("keyboard", e.nativeEvent), m?.({
|
|
@@ -284,57 +285,57 @@ function Q({ checked: e, children: t, closeOnSelect: n, closesByDefault: a, comm
|
|
|
284
285
|
preventDefault: () => void 0
|
|
285
286
|
});
|
|
286
287
|
}
|
|
287
|
-
},
|
|
288
|
+
}, ne = (e) => {
|
|
288
289
|
let t = e.currentTarget;
|
|
289
290
|
t.ownerDocument.activeElement !== t && t.focus({ preventScroll: !0 });
|
|
290
|
-
},
|
|
291
|
+
}, re = (e) => {
|
|
291
292
|
let t = e.currentTarget;
|
|
292
293
|
t.ownerDocument.activeElement === t && E?.openItem !== t && E?.node?.focus({ preventScroll: !0 });
|
|
293
|
-
},
|
|
294
|
+
}, P = i({
|
|
294
295
|
...w,
|
|
295
|
-
children: /* @__PURE__ */ C(
|
|
296
|
+
children: /* @__PURE__ */ C(J.Provider, {
|
|
296
297
|
value: O,
|
|
297
298
|
children: [
|
|
298
299
|
d,
|
|
299
|
-
l === void 0 ? null : /* @__PURE__ */ S(
|
|
300
|
-
|
|
301
|
-
s === void 0 ? null : /* @__PURE__ */ S(
|
|
302
|
-
p === void 0 ? null : /* @__PURE__ */ S(
|
|
303
|
-
y === void 0 ? null : /* @__PURE__ */ S(
|
|
300
|
+
l === void 0 ? null : /* @__PURE__ */ S(q, { children: l }),
|
|
301
|
+
A ? t : /* @__PURE__ */ S(Y, { children: t }),
|
|
302
|
+
s === void 0 ? null : /* @__PURE__ */ S(X, { children: s }),
|
|
303
|
+
p === void 0 ? null : /* @__PURE__ */ S(Z, { children: p }),
|
|
304
|
+
y === void 0 ? null : /* @__PURE__ */ S(Q, { keys: y })
|
|
304
305
|
]
|
|
305
306
|
}),
|
|
306
307
|
...e === void 0 ? {} : { "aria-checked": e },
|
|
307
|
-
...
|
|
308
|
-
...
|
|
308
|
+
...j ? { "aria-describedby": `${O}description` } : {},
|
|
309
|
+
...j && !M ? { "aria-labelledby": `${O}label` } : {},
|
|
309
310
|
...e ? { "data-checked": "" } : {},
|
|
310
311
|
...c === !0 ? {
|
|
311
312
|
"aria-disabled": !0,
|
|
312
313
|
"data-disabled": ""
|
|
313
314
|
} : {},
|
|
314
|
-
...y === void 0 ? {} : { "aria-keyshortcuts":
|
|
315
|
+
...y === void 0 ? {} : { "aria-keyshortcuts": G(y, D) },
|
|
315
316
|
...b === void 0 ? {} : { "data-text-value": b },
|
|
316
317
|
...x === void 0 ? {} : { "data-tone": x },
|
|
317
318
|
"data-part": "item",
|
|
318
|
-
onClick:
|
|
319
|
-
onKeyDown:
|
|
320
|
-
onPointerLeave:
|
|
321
|
-
onPointerMove:
|
|
319
|
+
onClick: U(w.onClick, N),
|
|
320
|
+
onKeyDown: U(w.onKeyDown, te),
|
|
321
|
+
onPointerLeave: U(w.onPointerLeave, re),
|
|
322
|
+
onPointerMove: U(w.onPointerMove, ne),
|
|
322
323
|
role: v,
|
|
323
324
|
tabIndex: -1
|
|
324
|
-
}),
|
|
325
|
+
}), F = (e) => {
|
|
325
326
|
typeof h == "function" ? h(e) : h != null && (h.current = e);
|
|
326
327
|
};
|
|
327
328
|
return _ === void 0 ? /* @__PURE__ */ S("button", {
|
|
328
329
|
type: "button",
|
|
329
|
-
...
|
|
330
|
+
...P,
|
|
330
331
|
ref: h
|
|
331
332
|
}) : _({
|
|
332
|
-
...
|
|
333
|
-
ref:
|
|
333
|
+
...P,
|
|
334
|
+
ref: F
|
|
334
335
|
});
|
|
335
336
|
}
|
|
336
337
|
function ue(e) {
|
|
337
|
-
return /* @__PURE__ */ S(
|
|
338
|
+
return /* @__PURE__ */ S($, { ...e });
|
|
338
339
|
}
|
|
339
340
|
function de({ checked: e, defaultChecked: t, onCheckedChange: n, ...r }) {
|
|
340
341
|
let [i, a] = b(t ?? !1), o = e ?? i, s = (t, r) => {
|
|
@@ -344,7 +345,7 @@ function de({ checked: e, defaultChecked: t, onCheckedChange: n, ...r }) {
|
|
|
344
345
|
onRequest: (e) => n?.(e.value, e)
|
|
345
346
|
}).request(!o, t, r) && a(!o);
|
|
346
347
|
};
|
|
347
|
-
return /* @__PURE__ */ S(
|
|
348
|
+
return /* @__PURE__ */ S($, {
|
|
348
349
|
...r,
|
|
349
350
|
checked: o,
|
|
350
351
|
closesByDefault: !1,
|
|
@@ -388,7 +389,7 @@ function me({ children: e, defaultValue: t, onValueChange: n, value: r, ...i })
|
|
|
388
389
|
function he({ value: e, ...t }) {
|
|
389
390
|
let n = m(pe);
|
|
390
391
|
if (n === null) throw Error("MenuRadioItem has to be inside a MenuRadioGroup.");
|
|
391
|
-
return /* @__PURE__ */ S(
|
|
392
|
+
return /* @__PURE__ */ S($, {
|
|
392
393
|
...t,
|
|
393
394
|
checked: n.value === e,
|
|
394
395
|
closesByDefault: !1,
|
|
@@ -416,7 +417,7 @@ function _e({ children: e, ...t }) {
|
|
|
416
417
|
});
|
|
417
418
|
}
|
|
418
419
|
function ve({ children: e, id: t, ...n }) {
|
|
419
|
-
let r =
|
|
420
|
+
let r = V(), i = `${g()}header`, a = t ?? i, s = r?.setHeaderId;
|
|
420
421
|
return h(() => (s?.(a), () => s?.(null)), [a, s]), /* @__PURE__ */ S("div", {
|
|
421
422
|
...o(n, "part", "header"),
|
|
422
423
|
id: a,
|
|
@@ -438,39 +439,37 @@ function be({ children: e, ...t }) {
|
|
|
438
439
|
}
|
|
439
440
|
//#endregion
|
|
440
441
|
//#region src/menu/menu-parts.tsx
|
|
441
|
-
function
|
|
442
|
+
function xe(e, t) {
|
|
442
443
|
return (n) => {
|
|
443
444
|
e?.(n), n.defaultPrevented || t(n);
|
|
444
445
|
};
|
|
445
446
|
}
|
|
446
|
-
function
|
|
447
|
+
function Se(e, ...t) {
|
|
447
448
|
for (let n of t) typeof n == "function" ? n(e) : n != null && (n.current = e);
|
|
448
449
|
}
|
|
449
|
-
var
|
|
450
|
-
function
|
|
450
|
+
var Ce = "[data-part='item']", we = (e) => e === null ? [] : [...e.querySelectorAll(Ce)], Te = (e) => e.dataset.textValue ?? e.querySelector("[data-part='label']")?.textContent?.trim() ?? e.textContent?.trim() ?? "", Ee = (e) => e.dataset.disabled === void 0;
|
|
451
|
+
function De(e) {
|
|
451
452
|
e.focus({ preventScroll: !0 });
|
|
452
453
|
let t = e.closest("[data-part='content']");
|
|
453
|
-
|
|
454
|
-
let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
455
|
-
r.top < n.top ? t.scrollTop -= n.top - r.top : r.bottom > n.bottom && (t.scrollTop += r.bottom - n.bottom);
|
|
456
|
-
}
|
|
457
|
-
function De(e, t) {
|
|
458
|
-
let n = Ce(e), r = n[t < 0 ? n.length + t : t];
|
|
459
|
-
r !== void 0 && Ee(r);
|
|
454
|
+
t !== null && O(e, t);
|
|
460
455
|
}
|
|
461
456
|
function Oe(e, t) {
|
|
462
|
-
let n =
|
|
463
|
-
|
|
457
|
+
let n = we(e), r = n[t < 0 ? n.length + t : t];
|
|
458
|
+
r !== void 0 && De(r);
|
|
459
|
+
}
|
|
460
|
+
function ke(e, t) {
|
|
461
|
+
let n = we(e), r = t === "first" ? n : [...n].reverse(), i = r.find(Ee) ?? r[0];
|
|
462
|
+
i !== void 0 && De(i);
|
|
464
463
|
}
|
|
465
|
-
var
|
|
466
|
-
function
|
|
464
|
+
var Ae = (e) => e !== null && getComputedStyle(e).direction === "rtl" ? "rtl" : "ltr";
|
|
465
|
+
function je(e, t) {
|
|
467
466
|
if (e === null) return;
|
|
468
467
|
let n = c(e.ownerDocument.body), r = n.indexOf(e);
|
|
469
468
|
if (r === -1) return void e.focus({ preventScroll: !0 });
|
|
470
469
|
(n[r + t] ?? e).focus({ preventScroll: !0 });
|
|
471
470
|
}
|
|
472
|
-
function
|
|
473
|
-
let l =
|
|
471
|
+
function Me({ children: e, icon: r, meta: i, ref: o, render: s, ...c }) {
|
|
472
|
+
let l = H(), u = l.parent, d = l.onBar, f = l.menubar, [m, g] = b(null), _ = y(void 0), v = y(null), w = y({
|
|
474
473
|
menu: l,
|
|
475
474
|
node: m
|
|
476
475
|
});
|
|
@@ -497,7 +496,7 @@ function je({ children: e, icon: r, meta: i, ref: o, render: s, ...c }) {
|
|
|
497
496
|
l.disabled || l.open && u !== null || (l.entry.current = "first", l.toggle(!l.open, "pointer", e.nativeEvent));
|
|
498
497
|
}, O = (e) => {
|
|
499
498
|
if (l.disabled) return;
|
|
500
|
-
let t =
|
|
499
|
+
let t = Ae(m) === "rtl" ? "ArrowLeft" : "ArrowRight", n = f?.orientation === "vertical", r = u === null && (!d || !n) && e.key === "ArrowDown", i = u === null && (!d || !n) && e.key === "ArrowUp", a = e.key === t && (u !== null || d && n);
|
|
501
500
|
if (r || a) {
|
|
502
501
|
e.preventDefault(), e.stopPropagation(), E("keyboard", "first", e.nativeEvent);
|
|
503
502
|
return;
|
|
@@ -507,7 +506,7 @@ function je({ children: e, icon: r, meta: i, ref: o, render: s, ...c }) {
|
|
|
507
506
|
return;
|
|
508
507
|
}
|
|
509
508
|
u !== null && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), E("keyboard", "first", e.nativeEvent));
|
|
510
|
-
},
|
|
509
|
+
}, k = (e) => {
|
|
511
510
|
if (!l.disabled) {
|
|
512
511
|
if (T(), u !== null) {
|
|
513
512
|
if (u.setOpenItem(m), !l.openOnHover || l.open) return;
|
|
@@ -516,10 +515,10 @@ function je({ children: e, icon: r, meta: i, ref: o, render: s, ...c }) {
|
|
|
516
515
|
}
|
|
517
516
|
d && f !== null && f.value !== void 0 && f.value !== l.contentId && (m?.focus({ preventScroll: !0 }), E("pointer", "first", e.nativeEvent));
|
|
518
517
|
}
|
|
519
|
-
},
|
|
518
|
+
}, j = (e) => {
|
|
520
519
|
if (_.current !== void 0 && (clearTimeout(_.current), _.current = void 0), u === null || !l.open) return;
|
|
521
520
|
let t = l.contentNode;
|
|
522
|
-
t !== null && (v.current?.destroy(), v.current =
|
|
521
|
+
t !== null && (v.current?.destroy(), v.current = A({
|
|
523
522
|
target: () => t.getBoundingClientRect(),
|
|
524
523
|
origin: () => m?.getBoundingClientRect() ?? null,
|
|
525
524
|
timeout: l.submenuCloseDelay,
|
|
@@ -528,20 +527,20 @@ function je({ children: e, icon: r, meta: i, ref: o, render: s, ...c }) {
|
|
|
528
527
|
n.node?.matches(":hover") || t.matches(":hover") || n.menu.toggle(!1, "pointer", e.nativeEvent);
|
|
529
528
|
}
|
|
530
529
|
}));
|
|
531
|
-
},
|
|
532
|
-
g(e),
|
|
533
|
-
}, [o]),
|
|
534
|
-
r === void 0 ? null : /* @__PURE__ */ S(
|
|
535
|
-
/* @__PURE__ */ S(
|
|
536
|
-
i === void 0 ? null : /* @__PURE__ */ S(
|
|
530
|
+
}, M = p((e) => {
|
|
531
|
+
g(e), Se(e, o);
|
|
532
|
+
}, [o]), ee = u === null ? e : /* @__PURE__ */ C(x, { children: [
|
|
533
|
+
r === void 0 ? null : /* @__PURE__ */ S(q, { children: r }),
|
|
534
|
+
/* @__PURE__ */ S(Y, { children: e }),
|
|
535
|
+
i === void 0 ? null : /* @__PURE__ */ S(Z, { children: i }),
|
|
537
536
|
/* @__PURE__ */ S(n, {
|
|
538
537
|
directional: !0,
|
|
539
538
|
children: /* @__PURE__ */ S(t, { name: "chevron-right" })
|
|
540
539
|
})
|
|
541
|
-
] }),
|
|
540
|
+
] }), N = {
|
|
542
541
|
type: "button",
|
|
543
542
|
...c,
|
|
544
|
-
children:
|
|
543
|
+
children: ee,
|
|
545
544
|
"aria-controls": l.open ? l.contentId : void 0,
|
|
546
545
|
"aria-expanded": l.open,
|
|
547
546
|
"aria-haspopup": "menu",
|
|
@@ -561,43 +560,43 @@ function je({ children: e, icon: r, meta: i, ref: o, render: s, ...c }) {
|
|
|
561
560
|
...a("part", "item"),
|
|
562
561
|
tabIndex: -1
|
|
563
562
|
},
|
|
564
|
-
onClick:
|
|
565
|
-
onKeyDown:
|
|
566
|
-
onPointerEnter:
|
|
567
|
-
onPointerLeave:
|
|
563
|
+
onClick: xe(c.onClick, D),
|
|
564
|
+
onKeyDown: xe(c.onKeyDown, O),
|
|
565
|
+
onPointerEnter: xe(c.onPointerEnter, k),
|
|
566
|
+
onPointerLeave: xe(c.onPointerLeave, j)
|
|
568
567
|
};
|
|
569
568
|
return s === void 0 ? /* @__PURE__ */ S("button", {
|
|
570
|
-
...
|
|
571
|
-
ref:
|
|
569
|
+
...N,
|
|
570
|
+
ref: M
|
|
572
571
|
}) : s({
|
|
573
|
-
...
|
|
574
|
-
ref:
|
|
572
|
+
...N,
|
|
573
|
+
ref: M
|
|
575
574
|
});
|
|
576
575
|
}
|
|
577
|
-
function
|
|
578
|
-
let c =
|
|
576
|
+
function Ne({ children: e, loading: t, ref: n, render: r, ...a }) {
|
|
577
|
+
let c = H(), l = c.parent, [u, d] = b(null), [f, m] = b(null), [g, _] = b(null), [x, C] = b("unmounted"), [T, D] = b(!1), [O, A] = b(null), [ne, re] = b(null), P = y(null), F = y(null), I = y({
|
|
579
578
|
menu: c,
|
|
580
579
|
surfaceNode: f
|
|
581
580
|
});
|
|
582
|
-
|
|
581
|
+
I.current = {
|
|
583
582
|
menu: c,
|
|
584
583
|
surfaceNode: f
|
|
585
584
|
}, h(() => {
|
|
586
585
|
let e = w({
|
|
587
|
-
present:
|
|
586
|
+
present: I.current.menu.open,
|
|
588
587
|
onStatusChange: C
|
|
589
588
|
});
|
|
590
|
-
return
|
|
591
|
-
e.destroy(),
|
|
589
|
+
return P.current = e, C(e.status), () => {
|
|
590
|
+
e.destroy(), P.current = null;
|
|
592
591
|
};
|
|
593
592
|
}, []), h(() => {
|
|
594
|
-
|
|
593
|
+
P.current?.sync(c.open);
|
|
595
594
|
}, [c.open]), h(() => {
|
|
596
|
-
|
|
595
|
+
P.current?.setNode(u);
|
|
597
596
|
}, [u]), h(() => {
|
|
598
597
|
c.setContentNode(f);
|
|
599
598
|
}, [c, f]);
|
|
600
|
-
let
|
|
599
|
+
let L = c.mount === "eager" || c.mount === "lazy" && c.seen || c.open || x !== "unmounted";
|
|
601
600
|
h(() => {
|
|
602
601
|
let e = c.triggerNode;
|
|
603
602
|
if (e === null || T) return;
|
|
@@ -606,9 +605,9 @@ function Me({ children: e, loading: t, ref: n, render: r, ...a }) {
|
|
|
606
605
|
e.removeEventListener("focusin", t), e.removeEventListener("pointerdown", t);
|
|
607
606
|
};
|
|
608
607
|
}, [c.triggerNode, T]);
|
|
609
|
-
let
|
|
608
|
+
let R = L || T;
|
|
610
609
|
v(() => {
|
|
611
|
-
if (!
|
|
610
|
+
if (!R) {
|
|
612
611
|
_(null);
|
|
613
612
|
return;
|
|
614
613
|
}
|
|
@@ -618,61 +617,61 @@ function Me({ children: e, loading: t, ref: n, render: r, ...a }) {
|
|
|
618
617
|
});
|
|
619
618
|
return _(e.container), () => e.release();
|
|
620
619
|
}, [
|
|
621
|
-
|
|
620
|
+
R,
|
|
622
621
|
c.portal,
|
|
623
622
|
c.triggerNode
|
|
624
623
|
]);
|
|
625
|
-
let { align:
|
|
624
|
+
let { align: ie, alignOffset: z, collisionPadding: B, flip: oe, hideWhenDetached: V, shift: se, side: ce, sideOffset: le, strategy: U } = c, W = c.anchor ?? c.triggerNode, G = y(null), K = y(0), q = p((e, t) => {
|
|
626
625
|
e.update().then(() => {
|
|
627
|
-
if (G.current !== e || !
|
|
626
|
+
if (G.current !== e || !I.current.menu.open) return;
|
|
628
627
|
let n = t.hasAttribute("data-open");
|
|
629
628
|
t.setAttribute("data-open", "");
|
|
630
629
|
let r = t.ownerDocument.defaultView;
|
|
631
630
|
n || r === null || K.current !== 0 || (K.current = r.requestAnimationFrame(() => {
|
|
632
631
|
K.current = 0;
|
|
633
|
-
let { menu: e, surfaceNode: t } =
|
|
632
|
+
let { menu: e, surfaceNode: t } = I.current;
|
|
634
633
|
if (!e.open || t === null) return;
|
|
635
634
|
let n = e.onBar ? e.menubar : null, r = n === null ? e.entry.current : n.entry.current;
|
|
636
|
-
e.entry.current = "first", n !== null && (n.entry.current = "first"), r !== "trigger" &&
|
|
635
|
+
e.entry.current = "first", n !== null && (n.entry.current = "first"), r !== "trigger" && ke(t, r);
|
|
637
636
|
}));
|
|
638
637
|
});
|
|
639
638
|
}, []);
|
|
640
639
|
v(() => {
|
|
641
640
|
if (u === null || W === null) return;
|
|
642
|
-
let e = c.parent !== null && f !== null && c.triggerNode !== null ?
|
|
641
|
+
let e = c.parent !== null && f !== null && c.triggerNode !== null ? M({
|
|
643
642
|
parentSurface: c.parent.node,
|
|
644
643
|
item: c.triggerNode,
|
|
645
644
|
surface: f
|
|
646
645
|
}) : {
|
|
647
646
|
sideOffset: 0,
|
|
648
647
|
alignOffset: 0
|
|
649
|
-
}, t =
|
|
650
|
-
align:
|
|
651
|
-
alignOffset:
|
|
652
|
-
boundaryPadding:
|
|
653
|
-
flip:
|
|
654
|
-
hideWhenDetached:
|
|
655
|
-
shift:
|
|
656
|
-
side:
|
|
657
|
-
sideOffset:
|
|
648
|
+
}, t = j(W, u, {
|
|
649
|
+
align: ie,
|
|
650
|
+
alignOffset: z + e.alignOffset,
|
|
651
|
+
boundaryPadding: B,
|
|
652
|
+
flip: oe,
|
|
653
|
+
hideWhenDetached: V,
|
|
654
|
+
shift: se,
|
|
655
|
+
side: ce,
|
|
656
|
+
sideOffset: le + e.sideOffset,
|
|
658
657
|
strategy: U
|
|
659
658
|
});
|
|
660
|
-
return G.current = t,
|
|
659
|
+
return G.current = t, I.current.menu.open && q(t, u), () => {
|
|
661
660
|
t.destroy(), G.current = null, u.removeAttribute("data-open");
|
|
662
661
|
};
|
|
663
662
|
}, [
|
|
664
|
-
|
|
665
|
-
|
|
663
|
+
ie,
|
|
664
|
+
z,
|
|
666
665
|
W,
|
|
667
|
-
oe,
|
|
668
666
|
B,
|
|
669
|
-
|
|
667
|
+
oe,
|
|
668
|
+
V,
|
|
670
669
|
u,
|
|
671
670
|
c.parent,
|
|
672
671
|
c.triggerNode,
|
|
672
|
+
se,
|
|
673
673
|
ce,
|
|
674
674
|
le,
|
|
675
|
-
H,
|
|
676
675
|
U,
|
|
677
676
|
f,
|
|
678
677
|
q
|
|
@@ -691,7 +690,7 @@ function Me({ children: e, loading: t, ref: n, render: r, ...a }) {
|
|
|
691
690
|
q
|
|
692
691
|
]), h(() => {
|
|
693
692
|
if (u === null || !c.open) return;
|
|
694
|
-
let e = [c.triggerNode, l?.node ?? null].filter((e) => e !== null), t =
|
|
693
|
+
let e = [c.triggerNode, l?.node ?? null].filter((e) => e !== null), t = k(u, {
|
|
695
694
|
branches: e,
|
|
696
695
|
escape: c.closeOnEscape,
|
|
697
696
|
focusOutside: !1,
|
|
@@ -700,7 +699,7 @@ function Me({ children: e, loading: t, ref: n, render: r, ...a }) {
|
|
|
700
699
|
scrollLock: !1,
|
|
701
700
|
onDismiss: (e) => {
|
|
702
701
|
let t = e.reason === "escape" ? "escape" : "outsidePress";
|
|
703
|
-
|
|
702
|
+
I.current.menu.toggle(!1, t, e.source), t === "outsidePress" && l?.closeAll("outsidePress", e.source);
|
|
704
703
|
}
|
|
705
704
|
});
|
|
706
705
|
return () => t.destroy();
|
|
@@ -714,40 +713,40 @@ function Me({ children: e, loading: t, ref: n, render: r, ...a }) {
|
|
|
714
713
|
]), h(() => {
|
|
715
714
|
if (f === null) return;
|
|
716
715
|
let e = s(f, {
|
|
717
|
-
focus:
|
|
716
|
+
focus: De,
|
|
718
717
|
includeAriaDisabled: !0,
|
|
719
|
-
itemSelector:
|
|
720
|
-
loop: () =>
|
|
718
|
+
itemSelector: Ce,
|
|
719
|
+
loop: () => I.current.menu.loop,
|
|
721
720
|
orientation: () => "vertical"
|
|
722
721
|
});
|
|
723
722
|
return () => e.destroy();
|
|
724
723
|
}, [f]), h(() => {
|
|
725
724
|
if (!c.typeahead) return;
|
|
726
|
-
let e =
|
|
727
|
-
return
|
|
728
|
-
e.destroy(),
|
|
725
|
+
let e = ee({ timeout: c.typeaheadTimeout });
|
|
726
|
+
return F.current = e, () => {
|
|
727
|
+
e.destroy(), F.current = null;
|
|
729
728
|
};
|
|
730
729
|
}, [c.typeahead, c.typeaheadTimeout]), h(() => {
|
|
731
|
-
c.open || (
|
|
730
|
+
c.open || (A(null), F.current?.reset());
|
|
732
731
|
}, [c.open]);
|
|
733
732
|
let J = p((e, t) => {
|
|
734
|
-
|
|
733
|
+
I.current.menu.toggle(!1, e, t), l?.closeAll(e, t);
|
|
735
734
|
}, [l]), Y = {
|
|
736
735
|
close: (e, t) => c.toggle(!1, e, t),
|
|
737
736
|
closeAll: J,
|
|
738
737
|
depth: (l?.depth ?? -1) + 1,
|
|
739
|
-
focusItem: (e) =>
|
|
738
|
+
focusItem: (e) => Oe(f, e),
|
|
740
739
|
node: f,
|
|
741
|
-
openItem:
|
|
740
|
+
openItem: O,
|
|
742
741
|
rootTrigger: l?.rootTrigger ?? c.triggerNode,
|
|
743
|
-
setHeaderId:
|
|
744
|
-
setOpenItem:
|
|
745
|
-
}, X = [a["aria-describedby"],
|
|
746
|
-
let t =
|
|
742
|
+
setHeaderId: re,
|
|
743
|
+
setOpenItem: A
|
|
744
|
+
}, X = [a["aria-describedby"], ne].filter(Boolean).join(" ") || void 0, Z = (e) => {
|
|
745
|
+
let t = Ae(f), n = t === "rtl" ? "ArrowRight" : "ArrowLeft", r = t === "rtl" ? "ArrowLeft" : "ArrowRight", i = c.menubar;
|
|
747
746
|
if (e.key === "Tab") {
|
|
748
747
|
e.preventDefault();
|
|
749
748
|
let t = Y.rootTrigger;
|
|
750
|
-
J("dismiss", e.nativeEvent), i?.close("dismiss", e.nativeEvent),
|
|
749
|
+
J("dismiss", e.nativeEvent), i?.close("dismiss", e.nativeEvent), je(t, e.shiftKey ? -1 : 1);
|
|
751
750
|
return;
|
|
752
751
|
}
|
|
753
752
|
if (e.key === n) {
|
|
@@ -770,23 +769,23 @@ function Me({ children: e, loading: t, ref: n, render: r, ...a }) {
|
|
|
770
769
|
});
|
|
771
770
|
return;
|
|
772
771
|
}
|
|
773
|
-
if (!c.typeahead ||
|
|
772
|
+
if (!c.typeahead || F.current === null || e.ctrlKey || e.metaKey || e.altKey || !N(e.key, F.current.query.length > 0)) return;
|
|
774
773
|
e.preventDefault();
|
|
775
|
-
let a =
|
|
776
|
-
s !== -1 &&
|
|
774
|
+
let a = we(f), o = a.findIndex((t) => t === e.target), s = F.current.match(e.key, a.map(Te), o);
|
|
775
|
+
s !== -1 && Oe(f, s);
|
|
777
776
|
}, Q = p((e) => {
|
|
778
|
-
d(e),
|
|
777
|
+
d(e), Se(e, n);
|
|
779
778
|
}, [n]);
|
|
780
|
-
if (!
|
|
781
|
-
let
|
|
782
|
-
"data-align":
|
|
779
|
+
if (!L) return null;
|
|
780
|
+
let $ = i({
|
|
781
|
+
"data-align": ie,
|
|
783
782
|
...c.open ? {} : { inert: !0 },
|
|
784
783
|
"data-part": "root",
|
|
785
784
|
"data-size": c.size,
|
|
786
785
|
"data-ui": "menu",
|
|
787
786
|
"data-width": c.width
|
|
788
|
-
}),
|
|
789
|
-
|
|
787
|
+
}), ue = /* @__PURE__ */ S("div", {
|
|
788
|
+
...$,
|
|
790
789
|
ref: Q,
|
|
791
790
|
children: /* @__PURE__ */ S("div", {
|
|
792
791
|
...o(a, "part", "content"),
|
|
@@ -795,21 +794,21 @@ function Me({ children: e, loading: t, ref: n, render: r, ...a }) {
|
|
|
795
794
|
"aria-labelledby": a["aria-label"] === void 0 ? c.triggerId : void 0,
|
|
796
795
|
"data-loading": t === !0 ? "" : void 0,
|
|
797
796
|
id: c.contentId,
|
|
798
|
-
onKeyDown:
|
|
797
|
+
onKeyDown: xe(a.onKeyDown, Z),
|
|
799
798
|
ref: m,
|
|
800
799
|
role: "menu",
|
|
801
800
|
tabIndex: -1,
|
|
802
|
-
children: /* @__PURE__ */ S(
|
|
801
|
+
children: /* @__PURE__ */ S(ae, {
|
|
803
802
|
value: Y,
|
|
804
803
|
children: e
|
|
805
804
|
})
|
|
806
805
|
})
|
|
807
|
-
}),
|
|
808
|
-
|
|
806
|
+
}), de = r === void 0 ? ue : r({
|
|
807
|
+
...$,
|
|
809
808
|
children: e,
|
|
810
809
|
ref: Q
|
|
811
810
|
});
|
|
812
|
-
return g === null ?
|
|
811
|
+
return g === null ? de : te(de, g);
|
|
813
812
|
}
|
|
814
813
|
//#endregion
|
|
815
|
-
export {
|
|
814
|
+
export { F as C, se as S, L as T, le as _, ge as a, H as b, ue as c, Y as d, Z as f, ye as g, he as h, be as i, X as l, me as m, Me as n, _e as o, Q as p, de as r, ve as s, Ne as t, q as u, ae as v, R as w, V as x, oe as y };
|