@nxgt/material 3.48.0 → 3.50.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/CHANGELOG.md +32 -0
- package/README.md +3 -3
- package/dist/{async-slice-DlvKCKAa.js → async-slice-3loEtzUY.js} +2 -2
- package/dist/{button-yaltbQmC.js → button-BRUaHD8z.js} +81 -112
- package/dist/charts.js +144 -144
- package/dist/{chip-BqWbbr1b.js → chip-DneTrtNj.js} +56 -56
- package/dist/{code-editor-C9qBNoYb.js → code-editor-R_nPN_-d.js} +308 -308
- package/dist/code-editor.js +47 -47
- package/dist/{code-language-items-DAHtfQ7W.js → code-language-items-BKEUhQlF.js} +2 -2
- package/dist/components/components.css +1 -0
- package/dist/components/ui/actions/action-card/action-card-indicator.css +48 -0
- package/dist/components/ui/actions/action-card/action-card-modes.css +4 -1
- package/dist/components/ui/actions/action-card/action-card-tile.css +141 -0
- package/dist/components/ui/actions/action-card/action-card.css +33 -3
- package/dist/{components-Ox6FHmpx.js → components-D6xFLcoE.js} +17646 -17567
- package/dist/components.js +26 -27
- package/dist/{dialog-CCCcnTIx.js → dialog-S7dLsYRZ.js} +16 -16
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-Df8785nt.js → dropdown-menu-XLlxfDgq.js} +271 -272
- package/dist/editor.js +1028 -1028
- package/dist/{empty-state-DcF4TBzi.js → empty-state-Dsf6R-Zo.js} +37 -37
- package/dist/{escape-owner-C4W_sOAU.js → escape-owner-B9eCwjLw.js} +1 -1
- package/dist/{field-blur-CJHzVSh9.js → field-blur-5uRDFHvB.js} +1 -1
- package/dist/{field-blur-context-Cft9s7Hg.js → field-blur-context-Cwt4TuBq.js} +1 -1
- package/dist/hooks.js +4 -4
- package/dist/{hover-card-C0fw2kLK.js → hover-card-PHUgRSjJ.js} +24 -24
- package/dist/{i18n-provider-C0fB0sEL.js → i18n-provider-DPM_ALQ4.js} +1 -1
- package/dist/i18n.js +5 -5
- package/dist/{icon-badge-aJ22mKGh.js → icon-badge-Dh6-FNOF.js} +3 -3
- package/dist/{icon-button-CN9r5TNE.js → icon-button-DSC2-IAG.js} +118 -86
- package/dist/lib/components/ui/actions/action-card/action-card-semantics.d.ts +25 -2
- package/dist/lib/components/ui/actions/action-card/action-card.d.ts +18 -2
- package/dist/lib/components/ui/actions/action-card/partials/action-card-icon.d.ts +6 -0
- package/dist/lib/components/ui/actions/action-card/partials/action-card-meta.d.ts +15 -0
- package/dist/lib/components/ui/actions/action-card/partials/action-card-status.d.ts +6 -0
- package/dist/lib/components/ui/actions/action-card/partials/action-card-text.d.ts +20 -0
- package/dist/lib/components/ui/actions/action-card/partials/action-card-title-button.d.ts +14 -0
- package/dist/lib/components/ui/actions/action-card/partials/action-card-trail.d.ts +6 -0
- package/dist/lib/components/ui/actions/action-card/use-action-card-names.d.ts +22 -0
- package/dist/lib/components/ui/actions/action-card/use-reveal.d.ts +23 -0
- package/dist/lib/components/ui/actions/button/button.variants.d.ts +1 -1
- package/dist/lib/components/ui/actions/icon-button/icon-button-busy.d.ts +22 -0
- package/dist/lib/components/ui/actions/icon-button/icon-button-shape.d.ts +2 -0
- package/dist/lib/components/ui/actions/icon-button/icon-button.d.ts +7 -0
- package/dist/lib/components/ui/actions/icon-button/icon-button.variants.d.ts +1 -1
- package/dist/lib/components/ui/collections/filter/bar/partials/filter-quick-toggle.d.ts +3 -2
- package/dist/lib/components/ui/collections/filter/sections/filter-sections-classes.d.ts +7 -1
- package/dist/lib/components/ui/collections/page-footer/page-footer.d.ts +6 -1
- package/dist/lib/components/ui/collections/row-menu/row-menu-trigger.d.ts +5 -2
- package/dist/lib/components/ui/collections/row-menu/row-menu.d.ts +1 -1
- package/dist/lib/components/ui/collections/server-table/index.d.ts +1 -1
- package/dist/lib/components/ui/collections/server-table/partials/server-table-empty-chips.d.ts +5 -3
- package/dist/lib/components/ui/collections/server-table/types-paging.d.ts +17 -0
- package/dist/lib/components/ui/collections/server-table/types.d.ts +3 -10
- package/dist/lib/components/ui/dates/duration-field/partials/use-duration-box.d.ts +1 -1
- package/dist/lib/components/ui/display/badge/badge.d.ts +1 -1
- package/dist/lib/components/ui/display/day-separator/day-separator.d.ts +1 -1
- package/dist/lib/components/ui/feedback/step-up-dialog/partials/step-up-body.d.ts +5 -3
- package/dist/lib/components/ui/feedback/step-up-dialog/partials/step-up-request-error.d.ts +15 -0
- package/dist/lib/components/ui/feedback/step-up-dialog/step-up-dialog.d.ts +6 -3
- package/dist/lib/components/ui/feedback/step-up-dialog/types.d.ts +12 -1
- package/dist/lib/components/ui/feedback/step-up-dialog/use-retry-focus.d.ts +27 -0
- package/dist/lib/components/ui/feedback/step-up-dialog/use-retry.d.ts +11 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/slider/split-slider-props.d.ts +20 -20
- package/dist/lib/components/ui/fields/slider/use-slider-control.d.ts +20 -20
- package/dist/lib/components/ui/fields/verification-code/use-settled-focus.d.ts +10 -0
- package/dist/lib/components/ui/layout/app-shell/route-transition.d.ts +1 -1
- package/dist/lib/components/ui/media/carousel/use-carousel-engine.d.ts +1 -1
- package/dist/lib/components/ui/media/media-player/engine/use-queue-actions.d.ts +1 -1
- package/dist/lib/components/ui/media/pdf-reader/pdf-reader.slice.d.ts +1 -1
- package/dist/lib/components/ui/selection/choice-group/use-choice-group-field.d.ts +34 -34
- package/dist/lib/components/ui/widgets/chat/chat-message.variants.d.ts +2 -2
- package/dist/lib/components/ui/widgets/event-calendar/use-event-calendar.d.ts +1 -1
- package/dist/lib/i18n/resources/en/en.d.ts +1 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +2 -1
- package/dist/lib/i18n/resources/fr/fr.d.ts +1 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +2 -1
- package/dist/lib/i18n/resources/resources.d.ts +2 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +43 -44
- package/dist/map.js +79 -79
- package/dist/material.css +1 -1
- package/dist/nxgt-theme-ivgNca3z.js +37 -0
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +2 -2
- package/dist/{public-zVb_Nq_D.js → public-vxiijIJF.js} +82 -82
- package/dist/{rich-code-block-DMWZZJma.js → rich-code-block-BwvCXPqq.js} +52 -52
- package/dist/{sortable-provider-DstbgMVf.js → sortable-provider-D2pAFWQB.js} +218 -218
- package/dist/{tooltip-CkttDIab.js → spinner-BpVwI1ps.js} +503 -278
- package/dist/{stored-language-IaL1Ftn_.js → stored-language-Beyj2ult.js} +4 -2
- package/dist/theme-picker.js +45 -45
- package/dist/{theme-store-CSl51uNH.js → theme-store-BdPp43cV.js} +13 -13
- package/dist/{theme-toggle-CGW2_K54.js → theme-toggle-BTYRPkP4.js} +16 -16
- package/dist/themes.js +17 -17
- package/dist/{toggle-group-BMJNcFAC.js → toggle-group-BkH23Jk4.js} +11 -11
- package/dist/{toolbar-items-CsLGJMEJ.js → toolbar-items-CIMo4F9q.js} +421 -421
- package/dist/{translate-material-v9u-e7Kd.js → translate-material-DEUlaL_1.js} +2 -2
- package/dist/{translator-Dk4_qE6U.js → translator-CBgIb3zP.js} +1 -1
- package/dist/{use-chat-composer-Brcb5f7r.js → use-chat-composer-D8UAsX0f.js} +6228 -5999
- package/dist/{button-tones-BwuVvAmd.js → use-click-lock-BZYtTmVt.js} +37 -7
- package/dist/{use-heading-spy-DjKixjLm.js → use-heading-spy-C5LXtA8Z.js} +1 -1
- package/dist/{use-material-translation-DOkTaWK_.js → use-material-translation-DWWeeg-B.js} +2 -2
- package/dist/{use-theme-DMcyJ52N.js → use-theme-BCLireTd.js} +1 -1
- package/docs/components/buttons-and-actions.md +64 -5
- package/docs/components/data-table-filter-and-lists.md +30 -10
- package/docs/components/feedback-and-status.md +22 -3
- package/docs/components/form-fields.md +7 -0
- package/docs/guides/cards-and-tiles.md +60 -0
- package/docs/guides/server-lists-url.md +3 -2
- package/docs/roadmap.md +11 -0
- package/lib/components/components.css +1 -0
- package/lib/components/ui/actions/action-card/action-card-indicator.css +48 -0
- package/lib/components/ui/actions/action-card/action-card-modes.css +4 -1
- package/lib/components/ui/actions/action-card/action-card-tile.css +141 -0
- package/lib/components/ui/actions/action-card/action-card.css +33 -3
- package/package.json +1 -1
- package/dist/nxgt-theme-ZS945iMP.js +0 -37
- package/dist/spinner-C4CgDEYm.js +0 -229
|
@@ -1,121 +1,121 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { t as xe } from "./
|
|
10
|
-
import { t as Se } from "./
|
|
11
|
-
import { o as Ce } from "./escape-owner-
|
|
12
|
-
import { ChevronLeft as we, ChevronRightIcon as Te, MoreVertical as Ee } from "lucide-react";
|
|
2
|
+
import { t } from "./warn-once-C_e47JM8.js";
|
|
3
|
+
import { o as n, r, t as i } from "./dist-DVRQkaTK.js";
|
|
4
|
+
import { a, c as o, i as s, l as c, r as l, s as u } from "./dist-lmHmz_bu.js";
|
|
5
|
+
import { C as d, S as f, d as p, f as m, m as h, p as g, r as _, u as v } from "./spinner-BpVwI1ps.js";
|
|
6
|
+
import { i as y, n as b, r as x, t as S } from "./dist-C4wtXCjf.js";
|
|
7
|
+
import { a as C, c as w, l as T, o as E, r as ee, s as te, t as ne } from "./in-dialog-Vwkyp-M5.js";
|
|
8
|
+
import { A as re, M as ie, N as ae, b as oe, d as se, f as ce, i as le, j as ue, l as de, n as fe, o as pe, r as me, t as he, u as ge, y as _e } from "./dropdown-menu-XLlxfDgq.js";
|
|
9
|
+
import { a as ve, n as ye, r as be, t as xe } from "./dist-B7RjY7SL.js";
|
|
10
|
+
import { t as Se } from "./use-material-translation-DWWeeg-B.js";
|
|
11
|
+
import { o as Ce } from "./escape-owner-B9eCwjLw.js";
|
|
13
12
|
import * as D from "react";
|
|
14
|
-
import { createContext as O, useCallback as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { keepListEscape as
|
|
13
|
+
import { createContext as O, useCallback as we, useContext as k, useEffect as A, useId as Te, useLayoutEffect as j, useMemo as M, useReducer as Ee, useRef as N, useState as P } from "react";
|
|
14
|
+
import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
15
|
+
import { keepListEscape as De } from "@nxgt/material-core/escape-forward";
|
|
16
|
+
import { ChevronLeft as Oe, ChevronRightIcon as ke, MoreVertical as Ae } from "lucide-react";
|
|
17
17
|
//#region ../../node_modules/@radix-ui/react-popover/dist/index.mjs
|
|
18
|
-
var
|
|
18
|
+
var je = Object.defineProperty, R = (e, t) => je(e, "name", {
|
|
19
19
|
value: t,
|
|
20
20
|
configurable: !0
|
|
21
|
-
}),
|
|
22
|
-
let { __scopePopover: t, children: n, open: r, defaultOpen:
|
|
21
|
+
}), z = "Popover", [Me, Ne] = o(z, [h]), B = h(), [Pe, V] = Me(z), Fe = /* @__PURE__ */ R((e) => {
|
|
22
|
+
let { __scopePopover: t, children: n, open: r, defaultOpen: i, onOpenChange: o, modal: s = !1 } = e, c = B(t), u = D.useRef(null), [d, f] = D.useState(!1), [p, m] = a({
|
|
23
23
|
prop: r,
|
|
24
|
-
defaultProp:
|
|
24
|
+
defaultProp: i ?? !1,
|
|
25
25
|
onChange: o,
|
|
26
|
-
caller:
|
|
26
|
+
caller: z
|
|
27
27
|
});
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
...
|
|
30
|
-
children: /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ I(g, {
|
|
29
|
+
...c,
|
|
30
|
+
children: /* @__PURE__ */ I(Pe, {
|
|
31
31
|
scope: t,
|
|
32
|
-
contentId:
|
|
32
|
+
contentId: l(),
|
|
33
33
|
triggerRef: u,
|
|
34
|
-
open:
|
|
35
|
-
onOpenChange:
|
|
36
|
-
onOpenToggle: D.useCallback(() =>
|
|
34
|
+
open: p,
|
|
35
|
+
onOpenChange: m,
|
|
36
|
+
onOpenToggle: D.useCallback(() => m((e) => !e), [m]),
|
|
37
37
|
hasCustomAnchor: d,
|
|
38
|
-
onCustomAnchorAdd: D.useCallback(() =>
|
|
39
|
-
onCustomAnchorRemove: D.useCallback(() =>
|
|
38
|
+
onCustomAnchorAdd: D.useCallback(() => f(!0), []),
|
|
39
|
+
onCustomAnchorRemove: D.useCallback(() => f(!1), []),
|
|
40
40
|
modal: s,
|
|
41
41
|
children: n
|
|
42
42
|
})
|
|
43
43
|
});
|
|
44
|
-
}, "Popover"),
|
|
45
|
-
let { __scopePopover: n, ...r } = e, i =
|
|
46
|
-
return D.useEffect(() => (o(), () => s()), [o, s]), /* @__PURE__ */
|
|
44
|
+
}, "Popover"), Ie = "PopoverAnchor", Le = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ R(function(e, t) {
|
|
45
|
+
let { __scopePopover: n, ...r } = e, i = V(Ie, n), a = B(n), { onCustomAnchorAdd: o, onCustomAnchorRemove: s } = i;
|
|
46
|
+
return D.useEffect(() => (o(), () => s()), [o, s]), /* @__PURE__ */ I(v, {
|
|
47
47
|
...a,
|
|
48
48
|
...r,
|
|
49
49
|
ref: t
|
|
50
50
|
});
|
|
51
|
-
}, "PopoverAnchor")),
|
|
52
|
-
let { __scopePopover: r, ...i } = e, a =
|
|
51
|
+
}, "PopoverAnchor")), Re = "PopoverTrigger", ze = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ R(function(e, t) {
|
|
52
|
+
let { __scopePopover: r, ...i } = e, a = V(Re, r), o = B(r), s = n(t, a.triggerRef), l = /* @__PURE__ */ I(c.button, {
|
|
53
53
|
type: "button",
|
|
54
54
|
"aria-haspopup": "dialog",
|
|
55
55
|
"aria-expanded": a.open,
|
|
56
56
|
"aria-controls": a.open ? a.contentId : void 0,
|
|
57
|
-
"data-state":
|
|
57
|
+
"data-state": U(a.open),
|
|
58
58
|
...i,
|
|
59
|
-
ref:
|
|
60
|
-
onClick:
|
|
59
|
+
ref: s,
|
|
60
|
+
onClick: u(e.onClick, a.onOpenToggle)
|
|
61
61
|
});
|
|
62
|
-
return a.hasCustomAnchor ?
|
|
62
|
+
return a.hasCustomAnchor ? l : /* @__PURE__ */ I(v, {
|
|
63
63
|
asChild: !0,
|
|
64
64
|
...o,
|
|
65
|
-
children:
|
|
65
|
+
children: l
|
|
66
66
|
});
|
|
67
|
-
}, "PopoverTrigger")),
|
|
68
|
-
let { __scopePopover: t, forceMount: n, children: r, container: i } = e, a =
|
|
69
|
-
return /* @__PURE__ */
|
|
67
|
+
}, "PopoverTrigger")), Be = "PopoverPortal", [Ve, He] = Me(Be, { forceMount: void 0 }), Ue = /* @__PURE__ */ R((e) => {
|
|
68
|
+
let { __scopePopover: t, forceMount: n, children: r, container: i } = e, a = V(Be, t);
|
|
69
|
+
return /* @__PURE__ */ I(Ve, {
|
|
70
70
|
scope: t,
|
|
71
71
|
forceMount: n,
|
|
72
|
-
children: /* @__PURE__ */
|
|
72
|
+
children: /* @__PURE__ */ I(s, {
|
|
73
73
|
present: n || a.open,
|
|
74
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ I(f, {
|
|
75
75
|
asChild: !0,
|
|
76
76
|
container: i,
|
|
77
77
|
children: r
|
|
78
78
|
})
|
|
79
79
|
})
|
|
80
80
|
});
|
|
81
|
-
}, "PopoverPortal"),
|
|
82
|
-
let n =
|
|
83
|
-
return /* @__PURE__ */
|
|
81
|
+
}, "PopoverPortal"), H = "PopoverContent", We = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ R(function(e, t) {
|
|
82
|
+
let n = He(H, e.__scopePopover), { forceMount: r = n.forceMount, ...i } = e, a = V(H, e.__scopePopover);
|
|
83
|
+
return /* @__PURE__ */ I(s, {
|
|
84
84
|
present: r || a.open,
|
|
85
|
-
children: a.modal ? /* @__PURE__ */
|
|
85
|
+
children: a.modal ? /* @__PURE__ */ I(Ke, {
|
|
86
86
|
...i,
|
|
87
87
|
ref: t
|
|
88
|
-
}) : /* @__PURE__ */
|
|
88
|
+
}) : /* @__PURE__ */ I(qe, {
|
|
89
89
|
...i,
|
|
90
90
|
ref: t
|
|
91
91
|
})
|
|
92
92
|
});
|
|
93
|
-
}, "PopoverContent")),
|
|
94
|
-
let r =
|
|
93
|
+
}, "PopoverContent")), Ge = r("PopoverContent.RemoveScroll"), Ke = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ R(function(e, t) {
|
|
94
|
+
let r = V(H, e.__scopePopover), i = D.useRef(null), a = n(t, i), o = D.useRef(!1);
|
|
95
95
|
return D.useEffect(() => {
|
|
96
96
|
let e = i.current;
|
|
97
|
-
if (e) return
|
|
98
|
-
}, []), /* @__PURE__ */
|
|
99
|
-
as:
|
|
97
|
+
if (e) return E(e);
|
|
98
|
+
}, []), /* @__PURE__ */ I(te, {
|
|
99
|
+
as: Ge,
|
|
100
100
|
allowPinchZoom: !0,
|
|
101
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ I(Je, {
|
|
102
102
|
...e,
|
|
103
103
|
ref: a,
|
|
104
104
|
trapFocus: r.open,
|
|
105
105
|
disableOutsidePointerEvents: !0,
|
|
106
|
-
onCloseAutoFocus:
|
|
106
|
+
onCloseAutoFocus: u(e.onCloseAutoFocus, (e) => {
|
|
107
107
|
e.preventDefault(), o.current || r.triggerRef.current?.focus();
|
|
108
108
|
}),
|
|
109
|
-
onPointerDownOutside:
|
|
109
|
+
onPointerDownOutside: u(e.onPointerDownOutside, (e) => {
|
|
110
110
|
let t = e.detail.originalEvent, n = t.button === 0 && t.ctrlKey === !0, r = t.button === 2 || n;
|
|
111
111
|
o.current = r;
|
|
112
112
|
}, { checkForDefaultPrevented: !1 }),
|
|
113
|
-
onFocusOutside:
|
|
113
|
+
onFocusOutside: u(e.onFocusOutside, (e) => e.preventDefault(), { checkForDefaultPrevented: !1 })
|
|
114
114
|
})
|
|
115
115
|
});
|
|
116
|
-
}, "PopoverContentModal")),
|
|
117
|
-
let n =
|
|
118
|
-
return /* @__PURE__ */
|
|
116
|
+
}, "PopoverContentModal")), qe = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ R(function(e, t) {
|
|
117
|
+
let n = V(H, e.__scopePopover), r = D.useRef(!1), i = D.useRef(!1);
|
|
118
|
+
return /* @__PURE__ */ I(Je, {
|
|
119
119
|
...e,
|
|
120
120
|
ref: t,
|
|
121
121
|
trapFocus: !1,
|
|
@@ -129,32 +129,32 @@ var Me = Object.defineProperty, L = (e, t) => Me(e, "name", {
|
|
|
129
129
|
n.triggerRef.current?.contains(a) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && i.current && t.preventDefault();
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
|
-
}, "PopoverContentNonModal")),
|
|
133
|
-
let { __scopePopover: n, trapFocus: r, onOpenAutoFocus: i, onCloseAutoFocus: a, disableOutsidePointerEvents: o, onEscapeKeyDown: s, onPointerDownOutside: c, onFocusOutside: l, onInteractOutside: u, ...
|
|
134
|
-
return
|
|
132
|
+
}, "PopoverContentNonModal")), Je = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ R(function(e, t) {
|
|
133
|
+
let { __scopePopover: n, trapFocus: r, onOpenAutoFocus: i, onCloseAutoFocus: a, disableOutsidePointerEvents: o, onEscapeKeyDown: s, onPointerDownOutside: c, onFocusOutside: l, onInteractOutside: u, ...f } = e, p = V(H, n), h = B(n);
|
|
134
|
+
return w(), /* @__PURE__ */ I(T, {
|
|
135
135
|
asChild: !0,
|
|
136
136
|
loop: !0,
|
|
137
137
|
trapped: r,
|
|
138
138
|
onMountAutoFocus: i,
|
|
139
139
|
onUnmountAutoFocus: a,
|
|
140
|
-
children: /* @__PURE__ */
|
|
140
|
+
children: /* @__PURE__ */ I(d, {
|
|
141
141
|
asChild: !0,
|
|
142
142
|
disableOutsidePointerEvents: o,
|
|
143
143
|
onInteractOutside: u,
|
|
144
144
|
onEscapeKeyDown: s,
|
|
145
145
|
onPointerDownOutside: c,
|
|
146
146
|
onFocusOutside: l,
|
|
147
|
-
onDismiss: () =>
|
|
147
|
+
onDismiss: () => p.onOpenChange(!1),
|
|
148
148
|
deferPointerDownOutside: !0,
|
|
149
|
-
children: /* @__PURE__ */
|
|
150
|
-
"data-state":
|
|
149
|
+
children: /* @__PURE__ */ I(m, {
|
|
150
|
+
"data-state": U(p.open),
|
|
151
151
|
role: "dialog",
|
|
152
|
-
id:
|
|
153
|
-
...
|
|
154
|
-
...
|
|
152
|
+
id: p.contentId,
|
|
153
|
+
...h,
|
|
154
|
+
...f,
|
|
155
155
|
ref: t,
|
|
156
156
|
style: {
|
|
157
|
-
...
|
|
157
|
+
...f.style,
|
|
158
158
|
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
159
159
|
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
|
160
160
|
"--radix-popover-content-available-height": "var(--radix-popper-available-height)",
|
|
@@ -164,34 +164,34 @@ var Me = Object.defineProperty, L = (e, t) => Me(e, "name", {
|
|
|
164
164
|
})
|
|
165
165
|
})
|
|
166
166
|
});
|
|
167
|
-
}, "PopoverContentImpl")),
|
|
167
|
+
}, "PopoverContentImpl")), Ye = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ R(function(e, t) {
|
|
168
168
|
let { __scopePopover: n, ...r } = e;
|
|
169
|
-
return /* @__PURE__ */
|
|
170
|
-
...
|
|
169
|
+
return /* @__PURE__ */ I(p, {
|
|
170
|
+
...B(n),
|
|
171
171
|
...r,
|
|
172
172
|
ref: t
|
|
173
173
|
});
|
|
174
174
|
}, "PopoverArrow"));
|
|
175
|
-
function
|
|
175
|
+
function U(e) {
|
|
176
176
|
return e ? "open" : "closed";
|
|
177
177
|
}
|
|
178
|
-
|
|
179
|
-
var
|
|
178
|
+
R(U, "getState");
|
|
179
|
+
var Xe = Fe, Ze = Le, Qe = ze, $e = Ue, et = We, tt = Ye, nt = Object.defineProperty, W = (e, t) => nt(e, "name", {
|
|
180
180
|
value: t,
|
|
181
181
|
configurable: !0
|
|
182
|
-
}),
|
|
183
|
-
let { __scopeToolbar: n, orientation: r = "horizontal", dir: i, loop: a = !0, ...o } = e,
|
|
184
|
-
return /* @__PURE__ */
|
|
182
|
+
}), rt = "Toolbar", [it, at] = o(rt, [x, be]), ot = x(), st = be(), [ct, lt] = it(rt), ut = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
183
|
+
let { __scopeToolbar: n, orientation: r = "horizontal", dir: i, loop: a = !0, ...o } = e, s = ot(n), l = y(i);
|
|
184
|
+
return /* @__PURE__ */ I(ct, {
|
|
185
185
|
scope: n,
|
|
186
186
|
orientation: r,
|
|
187
187
|
dir: l,
|
|
188
|
-
children: /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */ I(b, {
|
|
189
189
|
asChild: !0,
|
|
190
|
-
...
|
|
190
|
+
...s,
|
|
191
191
|
orientation: r,
|
|
192
192
|
dir: l,
|
|
193
193
|
loop: a,
|
|
194
|
-
children: /* @__PURE__ */
|
|
194
|
+
children: /* @__PURE__ */ I(c.div, {
|
|
195
195
|
role: "toolbar",
|
|
196
196
|
"aria-orientation": r,
|
|
197
197
|
dir: l,
|
|
@@ -200,28 +200,28 @@ var $e = Le, et = ze, tt = Ve, nt = Ge, rt = Ke, it = Ze, at = Object.defineProp
|
|
|
200
200
|
})
|
|
201
201
|
})
|
|
202
202
|
});
|
|
203
|
-
}, "Toolbar")),
|
|
203
|
+
}, "Toolbar")), dt = "ToolbarSeparator", ft = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
204
204
|
let { __scopeToolbar: n, ...r } = e;
|
|
205
|
-
return /* @__PURE__ */
|
|
206
|
-
orientation:
|
|
205
|
+
return /* @__PURE__ */ I(ve, {
|
|
206
|
+
orientation: lt(dt, n).orientation === "horizontal" ? "vertical" : "horizontal",
|
|
207
207
|
...r,
|
|
208
208
|
ref: t
|
|
209
209
|
});
|
|
210
|
-
}, "ToolbarSeparator")),
|
|
210
|
+
}, "ToolbarSeparator")), pt = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
211
211
|
let { __scopeToolbar: n, ...r } = e;
|
|
212
|
-
return /* @__PURE__ */
|
|
212
|
+
return /* @__PURE__ */ I(S, {
|
|
213
213
|
asChild: !0,
|
|
214
|
-
...
|
|
214
|
+
...ot(n),
|
|
215
215
|
focusable: !e.disabled,
|
|
216
|
-
children: /* @__PURE__ */
|
|
216
|
+
children: /* @__PURE__ */ I(c.button, {
|
|
217
217
|
type: "button",
|
|
218
218
|
...r,
|
|
219
219
|
ref: t
|
|
220
220
|
})
|
|
221
221
|
});
|
|
222
|
-
}, "ToolbarButton")),
|
|
223
|
-
let { __scopeToolbar: n, ...r } = e, i =
|
|
224
|
-
return /* @__PURE__ */
|
|
222
|
+
}, "ToolbarButton")), mt = "ToolbarToggleGroup", ht = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
223
|
+
let { __scopeToolbar: n, ...r } = e, i = lt(mt, n), a = st(n);
|
|
224
|
+
return /* @__PURE__ */ I(xe, {
|
|
225
225
|
"data-orientation": i.orientation,
|
|
226
226
|
dir: i.dir,
|
|
227
227
|
...a,
|
|
@@ -229,22 +229,22 @@ var $e = Le, et = ze, tt = Ve, nt = Ge, rt = Ke, it = Ze, at = Object.defineProp
|
|
|
229
229
|
ref: t,
|
|
230
230
|
rovingFocus: !1
|
|
231
231
|
});
|
|
232
|
-
}, "ToolbarToggleGroup")),
|
|
233
|
-
let { __scopeToolbar: n, ...r } = e, i =
|
|
234
|
-
return /* @__PURE__ */
|
|
232
|
+
}, "ToolbarToggleGroup")), gt = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
233
|
+
let { __scopeToolbar: n, ...r } = e, i = st(n);
|
|
234
|
+
return /* @__PURE__ */ I(pt, {
|
|
235
235
|
asChild: !0,
|
|
236
236
|
__scopeToolbar: e.__scopeToolbar,
|
|
237
|
-
children: /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ I(ye, {
|
|
238
238
|
...i,
|
|
239
239
|
...r,
|
|
240
240
|
ref: t
|
|
241
241
|
})
|
|
242
242
|
});
|
|
243
|
-
}, "ToolbarToggleItem")),
|
|
243
|
+
}, "ToolbarToggleItem")), _t = ut, vt = ft, G = pt, yt = ht, bt = gt;
|
|
244
244
|
//#endregion
|
|
245
245
|
//#region lib/hooks/use-page-direction.ts
|
|
246
|
-
function
|
|
247
|
-
let [t, n] =
|
|
246
|
+
function xt(e) {
|
|
247
|
+
let [t, n] = P("ltr");
|
|
248
248
|
return j(() => {
|
|
249
249
|
let t = e.current;
|
|
250
250
|
if (!t) return;
|
|
@@ -254,25 +254,25 @@ function wt(e) {
|
|
|
254
254
|
}
|
|
255
255
|
//#endregion
|
|
256
256
|
//#region lib/components/ui/overlays/dropdown-menu/dropdown-menu-sub.tsx
|
|
257
|
-
function
|
|
258
|
-
return /* @__PURE__ */
|
|
257
|
+
function St({ ...e }) {
|
|
258
|
+
return /* @__PURE__ */ I(re, {
|
|
259
259
|
"data-slot": "dropdown-menu-sub",
|
|
260
260
|
...e
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
|
-
function
|
|
264
|
-
return /* @__PURE__ */
|
|
263
|
+
function Ct({ className: t, inset: n, children: r, ...i }) {
|
|
264
|
+
return /* @__PURE__ */ L(ie, {
|
|
265
265
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
266
266
|
"data-inset": n,
|
|
267
|
-
className: e(
|
|
267
|
+
className: e(_e, oe, "data-[state=open]:bg-primary/8 flex cursor-default items-center rounded-(--nxgt-item-radius) px-2 py-1.5 text-sm outline-none select-none data-[inset]:ps-8", t),
|
|
268
268
|
...i,
|
|
269
|
-
children: [r, /* @__PURE__ */
|
|
269
|
+
children: [r, /* @__PURE__ */ I(ke, { className: "ms-auto size-4" })]
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
return /* @__PURE__ */
|
|
272
|
+
function wt({ className: t, ...n }) {
|
|
273
|
+
return /* @__PURE__ */ I(ne, {
|
|
274
274
|
value: !1,
|
|
275
|
-
children: /* @__PURE__ */
|
|
275
|
+
children: /* @__PURE__ */ I(ue, {
|
|
276
276
|
"data-slot": "dropdown-menu-sub-content",
|
|
277
277
|
className: e("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 grid gap-0.5 min-w-[12rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded border p-3 shadow-lg", t),
|
|
278
278
|
...n
|
|
@@ -281,7 +281,7 @@ function Dt({ className: t, ...n }) {
|
|
|
281
281
|
}
|
|
282
282
|
//#endregion
|
|
283
283
|
//#region lib/components/ui/actions/toolbar/toolbar-context.ts
|
|
284
|
-
var
|
|
284
|
+
var K = O({
|
|
285
285
|
inside: !1,
|
|
286
286
|
spilled: /* @__PURE__ */ new Set(),
|
|
287
287
|
entries: /* @__PURE__ */ new Map(),
|
|
@@ -290,9 +290,9 @@ var U = O({
|
|
|
290
290
|
overflowing: !1,
|
|
291
291
|
moreAnchor: { current: null },
|
|
292
292
|
focusLost: { current: null }
|
|
293
|
-
}),
|
|
294
|
-
function
|
|
295
|
-
let n =
|
|
293
|
+
}), q = O(null), Tt = O(null);
|
|
294
|
+
function J(e, t) {
|
|
295
|
+
let n = Te(), { inside: r, spilled: i, entries: a } = k(K), o = k(q);
|
|
296
296
|
j(() => {
|
|
297
297
|
r && a.set(n, e);
|
|
298
298
|
}), j(() => () => void a.delete(n), [a, n]);
|
|
@@ -310,36 +310,36 @@ function W(e, t) {
|
|
|
310
310
|
} : {}
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
|
-
function
|
|
314
|
-
let { spilled: e, overflowing: t } = k(
|
|
313
|
+
function Et() {
|
|
314
|
+
let { spilled: e, overflowing: t } = k(K);
|
|
315
315
|
return {
|
|
316
316
|
spilled: e,
|
|
317
317
|
overflowing: t
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
|
-
function
|
|
321
|
-
return k(
|
|
320
|
+
function Dt() {
|
|
321
|
+
return k(K).moreAnchor;
|
|
322
322
|
}
|
|
323
323
|
//#endregion
|
|
324
324
|
//#region lib/components/ui/actions/toolbar/toolbar-axis.ts
|
|
325
|
-
var
|
|
326
|
-
function
|
|
325
|
+
var Y = (e) => Number.parseFloat(e) || 0;
|
|
326
|
+
function X(e, t) {
|
|
327
327
|
let n = getComputedStyle(e);
|
|
328
|
-
return t === "x" ? e.offsetWidth +
|
|
328
|
+
return t === "x" ? e.offsetWidth + Y(n.marginLeft) + Y(n.marginRight) : e.offsetHeight + Y(n.marginTop) + Y(n.marginBottom);
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
return
|
|
330
|
+
function Ot(e, t) {
|
|
331
|
+
return Y(t === "x" ? e.columnGap : e.rowGap);
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
return t === "x" ?
|
|
333
|
+
function kt(e, t) {
|
|
334
|
+
return t === "x" ? Y(e.paddingLeft) + Y(e.paddingRight) + Y(e.borderLeftWidth) + Y(e.borderRightWidth) : Y(e.paddingTop) + Y(e.paddingBottom) + Y(e.borderTopWidth) + Y(e.borderBottomWidth);
|
|
335
335
|
}
|
|
336
336
|
//#endregion
|
|
337
337
|
//#region lib/components/ui/actions/toolbar/toolbar-block-room.ts
|
|
338
|
-
function
|
|
339
|
-
let { height: t, cap: n } =
|
|
338
|
+
function At(e) {
|
|
339
|
+
let { height: t, cap: n } = jt(e), r = [t, n].filter((e) => e > 0);
|
|
340
340
|
return r.length ? Math.min(...r) : 0;
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function jt(e) {
|
|
343
343
|
let t = (t) => {
|
|
344
344
|
let n = document.createElement("div");
|
|
345
345
|
n.setAttribute("aria-hidden", "true"), n.style.setProperty("position", "relative"), n.style.setProperty("visibility", "hidden"), n.style.setProperty("width", "0"), n.style.setProperty("flex", "none");
|
|
@@ -356,64 +356,64 @@ function Pt(e) {
|
|
|
356
356
|
cap: i < 1e5 ? i : 0
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function Mt(e, t) {
|
|
360
360
|
let n = getComputedStyle(t);
|
|
361
361
|
if (!n.display.includes("flex") || !n.flexDirection.startsWith("column") || n.flexWrap !== "nowrap") return 0;
|
|
362
362
|
let r = 0;
|
|
363
363
|
for (let i of Array.from(t.children)) {
|
|
364
364
|
if (i === e || !(i instanceof HTMLElement)) continue;
|
|
365
365
|
let t = getComputedStyle(i);
|
|
366
|
-
["absolute", "fixed"].includes(t.position) || t.display !== "none" && (r +=
|
|
366
|
+
["absolute", "fixed"].includes(t.position) || t.display !== "none" && (r += X(i, "y") + Y(n.rowGap));
|
|
367
367
|
}
|
|
368
368
|
return r;
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function Nt(e) {
|
|
371
371
|
for (let t = e.parentElement; t; t = t.parentElement) if (/(auto|scroll)/.test(getComputedStyle(t).overflowY) && t.scrollHeight > t.clientHeight) return t;
|
|
372
372
|
return null;
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function Pt(e) {
|
|
375
375
|
for (let t = e; t; t = t.parentElement) {
|
|
376
376
|
let n = getComputedStyle(t);
|
|
377
377
|
if (n.position !== "sticky" || n.top === "auto") continue;
|
|
378
378
|
let r = e.getBoundingClientRect().top - t.getBoundingClientRect().top;
|
|
379
|
-
return
|
|
379
|
+
return Y(n.top) + Math.max(0, r);
|
|
380
380
|
}
|
|
381
381
|
return -1;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
384
|
-
let t =
|
|
383
|
+
function Ft(e) {
|
|
384
|
+
let t = Pt(e);
|
|
385
385
|
if (t < 0) return Infinity;
|
|
386
|
-
let n =
|
|
386
|
+
let n = Nt(e);
|
|
387
387
|
return (n ? n.clientHeight : window.innerHeight) - t - 16;
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
let t = getComputedStyle(e), n =
|
|
389
|
+
function It(e) {
|
|
390
|
+
let t = getComputedStyle(e), n = kt(t, "y"), r = e.parentElement, i = jt(e), a = r ? At(r) - Mt(e, r) : 0, o = t.boxSizing === "border-box" ? n : 0, s = [
|
|
391
391
|
a > 0 ? a - n : 0,
|
|
392
392
|
i.height,
|
|
393
393
|
i.cap > 0 ? i.cap - o : 0
|
|
394
394
|
].filter((e) => e > 0);
|
|
395
|
-
return Math.min(...s,
|
|
395
|
+
return Math.min(...s, Ft(e) - n);
|
|
396
396
|
}
|
|
397
397
|
//#endregion
|
|
398
398
|
//#region lib/components/ui/actions/toolbar/toolbar-morph-probe.ts
|
|
399
|
-
var
|
|
400
|
-
function
|
|
399
|
+
var Lt = ":is(.nxgt-toolbar-item, [data-toolbar-item][data-toolbar-fit]):not([data-toolbar-shape=\"round\"])", Rt = ":is([aria-pressed=\"true\"], [aria-checked=\"true\"], [data-state=\"on\"])", zt = ":is([aria-pressed], [aria-checked], [data-state=\"on\"], [data-state=\"off\"])";
|
|
400
|
+
function Bt(e, t) {
|
|
401
401
|
let n = Number.parseFloat(e);
|
|
402
402
|
return Number.isFinite(n) ? e.trim().endsWith("rem") || e.trim().endsWith("em") ? n * t : n : 0;
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
return
|
|
404
|
+
function Vt(e) {
|
|
405
|
+
return Y(e.getPropertyValue("--tb-morph"));
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function Ht(e, t, n, r, i) {
|
|
408
408
|
let a = {
|
|
409
409
|
widening: 0,
|
|
410
410
|
toggles: 0,
|
|
411
411
|
single: !1
|
|
412
412
|
};
|
|
413
413
|
if (r <= 0) return a;
|
|
414
|
-
let o =
|
|
414
|
+
let o = Bt(n.getPropertyValue("--tb-item"), i), s = [...e.matches(Lt) ? [e] : [], ...Array.from(e.querySelectorAll(Lt))].filter((e) => e.matches(zt) && !e.hidden), c = 0;
|
|
415
415
|
for (let e of s) {
|
|
416
|
-
if (!e.matches(".nxgt-toolbar-item") && !e.matches(
|
|
416
|
+
if (!e.matches(".nxgt-toolbar-item") && !e.matches(Rt)) continue;
|
|
417
417
|
let n = t === "x" ? e.offsetWidth : e.offsetHeight;
|
|
418
418
|
c += Math.max(0, Math.min(r * 2, n - o));
|
|
419
419
|
}
|
|
@@ -423,38 +423,38 @@ function Wt(e, t, n, r, i) {
|
|
|
423
423
|
single: e.dataset.toolbarChoice === "single"
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
|
-
var
|
|
426
|
+
var Ut = () => Y(getComputedStyle(document.documentElement).fontSize) || 16;
|
|
427
427
|
//#endregion
|
|
428
428
|
//#region lib/components/ui/actions/toolbar/toolbar-morph-room.ts
|
|
429
|
-
function
|
|
429
|
+
function Wt(e, t) {
|
|
430
430
|
return t <= 0 ? 0 : t * (e.single ? Math.min(1, e.toggles) : e.toggles);
|
|
431
431
|
}
|
|
432
|
-
function
|
|
433
|
-
return n <= 0 ? e : e - t.widening +
|
|
432
|
+
function Gt(e, t, n) {
|
|
433
|
+
return n <= 0 ? e : e - t.widening + Wt(t, n);
|
|
434
434
|
}
|
|
435
435
|
//#endregion
|
|
436
436
|
//#region lib/components/ui/actions/toolbar/toolbar-spill.ts
|
|
437
|
-
var
|
|
438
|
-
function
|
|
439
|
-
if (
|
|
437
|
+
var Kt = (e, t, n) => e.reduce((e, r) => t.has(r.id) ? e : e + r.width + n, 0);
|
|
438
|
+
function qt(e, t, n, r) {
|
|
439
|
+
if (Kt(e, /* @__PURE__ */ new Set(), n) - (e.length ? n : 0) <= t) return /* @__PURE__ */ new Set();
|
|
440
440
|
let i = e.map((e, t) => ({
|
|
441
441
|
slot: e,
|
|
442
442
|
i: t
|
|
443
443
|
})).filter(({ slot: e }) => !e.separator && !e.pinned).sort((e, t) => e.slot.priority - t.slot.priority || t.i - e.i), a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
444
|
-
for (let { slot: s } of i) if (a.add(s.id), o =
|
|
444
|
+
for (let { slot: s } of i) if (a.add(s.id), o = Jt(e, a), (e.some((e) => !e.separator && !e.unlisted && o.has(e.id)) ? r + Kt(e, o, n) : Kt(e, o, n) - n) <= t) return o;
|
|
445
445
|
return o;
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function Jt(e, t) {
|
|
448
448
|
let n = new Set(t), r = !1, i = !1;
|
|
449
449
|
return e.forEach((a, o) => {
|
|
450
450
|
if (!a.separator) {
|
|
451
451
|
i = !0, r ||= !t.has(a.id);
|
|
452
452
|
return;
|
|
453
453
|
}
|
|
454
|
-
(i && !r || !
|
|
454
|
+
(i && !r || !Yt(e, o, t)) && n.add(a.id);
|
|
455
455
|
}), n;
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function Yt(e, t, n) {
|
|
458
458
|
let r = !1;
|
|
459
459
|
for (let i = t + 1; i < e.length; i++) {
|
|
460
460
|
let t = e[i];
|
|
@@ -465,58 +465,58 @@ function Xt(e, t, n) {
|
|
|
465
465
|
}
|
|
466
466
|
//#endregion
|
|
467
467
|
//#region lib/components/ui/actions/toolbar/toolbar-measure.ts
|
|
468
|
-
var
|
|
468
|
+
var Xt = ":scope > [data-toolbar-id]", Zt = ":scope > [data-toolbar-more]", Qt = "\0more", $t = {
|
|
469
469
|
spilled: /* @__PURE__ */ new Set(),
|
|
470
470
|
overflowing: !1
|
|
471
471
|
};
|
|
472
|
-
function
|
|
473
|
-
if (!
|
|
474
|
-
let
|
|
475
|
-
for (let e of
|
|
476
|
-
let
|
|
477
|
-
for (let e of
|
|
478
|
-
let
|
|
479
|
-
|
|
480
|
-
let
|
|
481
|
-
let
|
|
472
|
+
function en(e, n, { enabled: r, axis: i = "x", room: a, entries: o = Xt, more: s = Zt }) {
|
|
473
|
+
if (!r) return $t;
|
|
474
|
+
let c = Array.from(e.querySelectorAll(o)), l = (e) => e.dataset.toolbarId || e.id, u = (e) => l(e) || `#${c.indexOf(e)}`;
|
|
475
|
+
for (let e of c) l(e) || t("an overflow entry has no data-toolbar-id (nor id) and never folds.", "Toolbar");
|
|
476
|
+
let d = getComputedStyle(e), f = Vt(d), p = f > 0 ? Ut() : 16;
|
|
477
|
+
for (let e of c) e.hidden || n.set(u(e), Gt(X(e, i), Ht(e, i, d, f, p), f));
|
|
478
|
+
let m = typeof s == "string" ? e.querySelector(s) : s.current;
|
|
479
|
+
m && !m.hidden && n.set(Qt, X(m, i));
|
|
480
|
+
let h = c.map((e) => {
|
|
481
|
+
let t = u(e);
|
|
482
482
|
return {
|
|
483
|
-
id:
|
|
484
|
-
width:
|
|
483
|
+
id: t,
|
|
484
|
+
width: n.get(t) ?? 0,
|
|
485
485
|
priority: Number(e.dataset.toolbarPriority) || 0,
|
|
486
|
-
pinned: e.dataset.toolbarPriority === "pinned" || !
|
|
486
|
+
pinned: e.dataset.toolbarPriority === "pinned" || !l(e),
|
|
487
487
|
separator: e.dataset.slot === "toolbar-separator",
|
|
488
|
-
unlisted:
|
|
488
|
+
unlisted: tn(e)
|
|
489
489
|
};
|
|
490
|
-
}),
|
|
490
|
+
}), g = Math.min(...h.filter((e) => !e.separator && e.width).map((e) => e.width)), _ = n.get(Qt) ?? (Number.isFinite(g) ? g : 40), v = Ot(d, i), y = qt(h, nn(e, d, i, a), v, _);
|
|
491
491
|
return {
|
|
492
|
-
spilled:
|
|
493
|
-
overflowing:
|
|
492
|
+
spilled: y,
|
|
493
|
+
overflowing: c.some((e) => !tn(e) && y.has(u(e)))
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
|
-
function
|
|
496
|
+
function tn(e) {
|
|
497
497
|
if (e.dataset.slot === "toolbar-separator" || e.hasAttribute("data-toolbar-unlisted")) return !0;
|
|
498
498
|
let t = Array.from(e.querySelectorAll("[data-toolbar-id]")).filter((e) => e.dataset.slot !== "toolbar-group" && e.dataset.slot !== "toolbar-toggle-group");
|
|
499
499
|
return t.length > 0 && t.every((e) => e.hasAttribute("data-toolbar-unlisted") || e.dataset.slot === "toolbar-separator");
|
|
500
500
|
}
|
|
501
|
-
function
|
|
502
|
-
return r === void 0 ? n === "x" ?
|
|
501
|
+
function nn(e, t, n, r) {
|
|
502
|
+
return r === void 0 ? n === "x" ? rn(e, t) : It(e) : (typeof r == "function" ? r(e) : r) - kt(t, n);
|
|
503
503
|
}
|
|
504
|
-
function
|
|
505
|
-
let n =
|
|
504
|
+
function rn(e, t) {
|
|
505
|
+
let n = kt(t, "x");
|
|
506
506
|
if (e.dataset.variant !== "floating" || !e.parentElement) return e.offsetWidth - n;
|
|
507
|
-
let r =
|
|
508
|
-
return t.maxWidth.endsWith("px") && (r = Math.min(r,
|
|
507
|
+
let r = an(e, e.parentElement);
|
|
508
|
+
return t.maxWidth.endsWith("px") && (r = Math.min(r, Y(t.maxWidth))), r - n;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
let n = getComputedStyle(t), r = t.clientWidth -
|
|
510
|
+
function an(e, t) {
|
|
511
|
+
let n = getComputedStyle(t), r = t.clientWidth - Y(n.paddingLeft) - Y(n.paddingRight);
|
|
512
512
|
if (!(n.display.includes("flex") && n.flexDirection.startsWith("row") && n.flexWrap === "nowrap")) return r;
|
|
513
513
|
let i = Array.from(t.children).filter((t) => t !== e && t instanceof HTMLElement && !["absolute", "fixed"].includes(getComputedStyle(t).position) && getComputedStyle(t).display !== "none");
|
|
514
|
-
for (let e of i) r -=
|
|
514
|
+
for (let e of i) r -= X(e, "x") + Y(n.columnGap);
|
|
515
515
|
return r;
|
|
516
516
|
}
|
|
517
517
|
//#endregion
|
|
518
518
|
//#region lib/components/ui/actions/toolbar/toolbar-more-tracking.ts
|
|
519
|
-
function
|
|
519
|
+
function Z(e, t) {
|
|
520
520
|
let n = e.current;
|
|
521
521
|
if (!n || !(t instanceof Element)) return !1;
|
|
522
522
|
let r = t.closest("[role=\"menu\"]");
|
|
@@ -527,11 +527,11 @@ function X(e, t) {
|
|
|
527
527
|
}
|
|
528
528
|
return !1;
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function on(e, t, n) {
|
|
531
531
|
let r = null, i = !1, a = (e) => {
|
|
532
532
|
let a = e.target;
|
|
533
533
|
if (a instanceof HTMLElement) {
|
|
534
|
-
if (
|
|
534
|
+
if (Z(n, a)) {
|
|
535
535
|
r && (i = !0);
|
|
536
536
|
return;
|
|
537
537
|
}
|
|
@@ -543,23 +543,23 @@ function sn(e, t, n) {
|
|
|
543
543
|
stop: () => e.removeEventListener("focusin", a)
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
|
-
function
|
|
546
|
+
function sn(e, t, n) {
|
|
547
547
|
let r = "menu.itemSelect", i = (e) => {
|
|
548
|
-
|
|
548
|
+
Z(t, e.target) && n.before();
|
|
549
549
|
}, a = (e) => {
|
|
550
|
-
|
|
550
|
+
Z(t, e.target) && n.after(e.defaultPrevented);
|
|
551
551
|
}, o = (e) => {
|
|
552
|
-
n.closing() &&
|
|
552
|
+
n.closing() && Z(t, e.target) && e.preventDefault();
|
|
553
553
|
};
|
|
554
554
|
return e.addEventListener(r, i, !0), e.addEventListener(r, a), e.addEventListener("pointerout", o, !0), e.addEventListener("pointermove", o, !0), () => {
|
|
555
555
|
e.removeEventListener(r, i, !0), e.removeEventListener(r, a), e.removeEventListener("pointerout", o, !0), e.removeEventListener("pointermove", o, !0);
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
|
-
var
|
|
558
|
+
var cn = O({
|
|
559
559
|
onPointerLeave: () => {},
|
|
560
560
|
onPointerMove: () => {}
|
|
561
|
-
}),
|
|
562
|
-
function
|
|
561
|
+
}), Q = () => k(cn);
|
|
562
|
+
function ln(e) {
|
|
563
563
|
let t = (t) => {
|
|
564
564
|
e() && t.preventDefault();
|
|
565
565
|
};
|
|
@@ -568,8 +568,8 @@ function un(e) {
|
|
|
568
568
|
onPointerMove: t
|
|
569
569
|
};
|
|
570
570
|
}
|
|
571
|
-
function
|
|
572
|
-
let t =
|
|
571
|
+
function un(e) {
|
|
572
|
+
let t = N(!1), n = N(null), r = N(null), i = N(ln(() => t.current)).current, a = () => {
|
|
573
573
|
n.current?.stop(), n.current = null;
|
|
574
574
|
}, o = () => {
|
|
575
575
|
a(), r.current?.(), r.current = null;
|
|
@@ -578,7 +578,7 @@ function dn(e) {
|
|
|
578
578
|
n.current?.stop(), r.current?.();
|
|
579
579
|
}, []);
|
|
580
580
|
let s = (t) => {
|
|
581
|
-
n.current ||=
|
|
581
|
+
n.current ||= on(t?.ownerDocument ?? document, t, e);
|
|
582
582
|
};
|
|
583
583
|
return {
|
|
584
584
|
guard: i,
|
|
@@ -586,7 +586,7 @@ function dn(e) {
|
|
|
586
586
|
t.current = !0, s(e);
|
|
587
587
|
},
|
|
588
588
|
reset(n) {
|
|
589
|
-
t.current = !1, o(), r.current =
|
|
589
|
+
t.current = !1, o(), r.current = sn(n?.ownerDocument ?? document, e, {
|
|
590
590
|
closing: () => t.current,
|
|
591
591
|
before: () => s(n),
|
|
592
592
|
after(e) {
|
|
@@ -605,23 +605,23 @@ function dn(e) {
|
|
|
605
605
|
}
|
|
606
606
|
//#endregion
|
|
607
607
|
//#region lib/components/ui/actions/toolbar/toolbar-more-drill.tsx
|
|
608
|
-
var
|
|
609
|
-
function
|
|
608
|
+
var dn = O(null), fn = 8;
|
|
609
|
+
function pn(e) {
|
|
610
610
|
let t = e.closest("[role=\"menu\"]"), n = e.ownerDocument.defaultView;
|
|
611
611
|
if (!t || !n) return !0;
|
|
612
612
|
let r = Number.parseFloat(n.getComputedStyle(e.ownerDocument.documentElement).fontSize) || 16, i = t.getBoundingClientRect();
|
|
613
|
-
return Math.max(i.left, n.innerWidth - i.right) >= Math.max(12 * r, i.width) +
|
|
613
|
+
return Math.max(i.left, n.innerWidth - i.right) >= Math.max(12 * r, i.width) + fn;
|
|
614
614
|
}
|
|
615
|
-
var
|
|
616
|
-
function
|
|
617
|
-
let [t, n] =
|
|
615
|
+
var mn = (e) => e.querySelector("[role^=\"menuitem\"]:not([data-more-back]):not([data-disabled]):not([aria-disabled=\"true\"])");
|
|
616
|
+
function hn(e) {
|
|
617
|
+
let [t, n] = P([]), r = t[t.length - 1] ?? null, i = N(null), a = N(null), o = N(-Infinity), s = () => {
|
|
618
618
|
a.current = r?.id ?? null, n(t.slice(0, -1));
|
|
619
619
|
};
|
|
620
620
|
A(() => {
|
|
621
621
|
let e = i.current;
|
|
622
622
|
if (!e) return;
|
|
623
623
|
let t = a.current;
|
|
624
|
-
a.current = null, (t ? e.querySelector(`[data-more-row="${CSS.escape(t)}"]`) : r ?
|
|
624
|
+
a.current = null, (t ? e.querySelector(`[data-more-row="${CSS.escape(t)}"]`) : r ? mn(e) ?? e.querySelector("[data-more-back]") : null)?.focus({ preventScroll: !0 });
|
|
625
625
|
}, [r]);
|
|
626
626
|
let c = e === "rtl" ? "ArrowRight" : "ArrowLeft";
|
|
627
627
|
return {
|
|
@@ -646,50 +646,50 @@ function gn(e) {
|
|
|
646
646
|
}
|
|
647
647
|
};
|
|
648
648
|
}
|
|
649
|
-
function
|
|
650
|
-
let { t: n } =
|
|
651
|
-
return /* @__PURE__ */
|
|
652
|
-
/* @__PURE__ */
|
|
649
|
+
function gn({ drill: e, leave: t }) {
|
|
650
|
+
let { t: n } = Se(), r = n("material.toolbar.back", "Back");
|
|
651
|
+
return /* @__PURE__ */ L(F, { children: [
|
|
652
|
+
/* @__PURE__ */ L(ge, {
|
|
653
653
|
"data-more-back": "",
|
|
654
|
-
...
|
|
654
|
+
...Q(),
|
|
655
655
|
"aria-label": `${r} ${e.label}`,
|
|
656
656
|
onSelect: (e) => {
|
|
657
657
|
e.preventDefault(), t();
|
|
658
658
|
},
|
|
659
659
|
children: [
|
|
660
|
-
/* @__PURE__ */
|
|
660
|
+
/* @__PURE__ */ I(Oe, {
|
|
661
661
|
"aria-hidden": !0,
|
|
662
662
|
className: "rtl:rotate-180"
|
|
663
663
|
}),
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ I("span", { children: r }),
|
|
665
|
+
/* @__PURE__ */ I("span", {
|
|
666
666
|
className: "text-muted-foreground truncate",
|
|
667
667
|
children: e.label
|
|
668
668
|
})
|
|
669
669
|
]
|
|
670
670
|
}),
|
|
671
|
-
/* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ I(pe, {}),
|
|
672
672
|
e.content
|
|
673
673
|
] });
|
|
674
674
|
}
|
|
675
675
|
//#endregion
|
|
676
676
|
//#region lib/components/ui/actions/toolbar/toolbar-more-sub.tsx
|
|
677
|
-
var
|
|
678
|
-
function
|
|
679
|
-
let s = k(
|
|
677
|
+
var _n = 1e3;
|
|
678
|
+
function vn({ id: e, lead: t, label: n, value: r, inset: i, disabled: a, children: o }) {
|
|
679
|
+
let s = k(dn), c = Q(), l = (e) => !!s && !a && !pn(e.currentTarget), u = (t) => {
|
|
680
680
|
l(t) && (t.preventDefault(), s?.enter({
|
|
681
681
|
id: e,
|
|
682
682
|
label: n,
|
|
683
683
|
content: o
|
|
684
684
|
}));
|
|
685
685
|
}, d = s?.dir === "rtl" ? "ArrowLeft" : "ArrowRight";
|
|
686
|
-
return /* @__PURE__ */
|
|
686
|
+
return /* @__PURE__ */ L(St, { children: [/* @__PURE__ */ L(Ct, {
|
|
687
687
|
"data-more-row": e,
|
|
688
688
|
inset: i,
|
|
689
689
|
disabled: a,
|
|
690
690
|
onClick: u,
|
|
691
691
|
onKeyDown: (e) => {
|
|
692
|
-
e.key === " " && performance.now() - (s?.typedAt() ?? 0) <
|
|
692
|
+
e.key === " " && performance.now() - (s?.typedAt() ?? 0) < _n || [
|
|
693
693
|
"Enter",
|
|
694
694
|
" ",
|
|
695
695
|
d
|
|
@@ -702,56 +702,56 @@ function yn({ id: e, lead: t, label: n, value: r, inset: i, disabled: a, childre
|
|
|
702
702
|
let t = e.currentTarget;
|
|
703
703
|
e.pointerType === "mouse" && t.ownerDocument.activeElement !== t && t.focus({ preventScroll: !0 });
|
|
704
704
|
},
|
|
705
|
-
children: [t, /* @__PURE__ */
|
|
705
|
+
children: [t, /* @__PURE__ */ L("span", {
|
|
706
706
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
707
|
-
children: [/* @__PURE__ */
|
|
707
|
+
children: [/* @__PURE__ */ I("span", {
|
|
708
708
|
className: "truncate",
|
|
709
709
|
children: n
|
|
710
|
-
}), r ? /* @__PURE__ */
|
|
710
|
+
}), r ? /* @__PURE__ */ I("span", {
|
|
711
711
|
className: "text-muted-foreground ms-auto truncate text-xs",
|
|
712
712
|
children: r
|
|
713
713
|
}) : null]
|
|
714
714
|
})]
|
|
715
|
-
}), /* @__PURE__ */
|
|
715
|
+
}), /* @__PURE__ */ I(wt, { children: o })] });
|
|
716
716
|
}
|
|
717
717
|
//#endregion
|
|
718
718
|
//#region lib/components/ui/actions/toolbar/toolbar-more-item.tsx
|
|
719
|
-
var
|
|
719
|
+
var yn = (e) => e.getAttribute("aria-pressed") === "true" || e.getAttribute("aria-checked") === "true" || e.dataset.state === "on", $ = (e) => e.disabled || e.getAttribute("aria-disabled") === "true", bn = (e) => ({
|
|
720
720
|
icons: e.some((e) => e.icon),
|
|
721
721
|
inset: e.some((e) => e.render.kind === "checkbox")
|
|
722
722
|
});
|
|
723
|
-
function
|
|
724
|
-
return t.icons ? /* @__PURE__ */
|
|
723
|
+
function xn({ icon: e, layout: t }) {
|
|
724
|
+
return t.icons ? /* @__PURE__ */ I("span", {
|
|
725
725
|
"aria-hidden": !0,
|
|
726
726
|
className: "flex size-4 shrink-0 text-muted-foreground",
|
|
727
727
|
children: e
|
|
728
728
|
}) : null;
|
|
729
729
|
}
|
|
730
|
-
function
|
|
731
|
-
let { item: r, label: i, icon: a, render: o } = e, s = /* @__PURE__ */
|
|
730
|
+
function Sn({ row: e, layout: t, select: n }) {
|
|
731
|
+
let { item: r, label: i, icon: a, render: o } = e, s = /* @__PURE__ */ I(xn, {
|
|
732
732
|
icon: a,
|
|
733
733
|
layout: t
|
|
734
|
-
}), c = () => n(e), l =
|
|
735
|
-
if (o.kind === "checkbox") return /* @__PURE__ */
|
|
736
|
-
checked: o.checked ??
|
|
737
|
-
disabled:
|
|
734
|
+
}), c = () => n(e), l = Q();
|
|
735
|
+
if (o.kind === "checkbox") return /* @__PURE__ */ L(de, {
|
|
736
|
+
checked: o.checked ?? yn(r),
|
|
737
|
+
disabled: $(r),
|
|
738
738
|
onSelect: c,
|
|
739
739
|
...l,
|
|
740
740
|
children: [s, i]
|
|
741
741
|
});
|
|
742
|
-
if (o.kind === "submenu") return /* @__PURE__ */
|
|
742
|
+
if (o.kind === "submenu") return /* @__PURE__ */ I(vn, {
|
|
743
743
|
id: e.id,
|
|
744
744
|
lead: s,
|
|
745
745
|
label: i,
|
|
746
746
|
value: o.value,
|
|
747
747
|
inset: t.inset || void 0,
|
|
748
|
-
disabled:
|
|
748
|
+
disabled: $(r),
|
|
749
749
|
children: o.content
|
|
750
750
|
});
|
|
751
751
|
let u = o.kind === "popover" || o.kind === "dialog";
|
|
752
|
-
return /* @__PURE__ */
|
|
752
|
+
return /* @__PURE__ */ L(ge, {
|
|
753
753
|
inset: t.inset || void 0,
|
|
754
|
-
disabled:
|
|
754
|
+
disabled: $(r),
|
|
755
755
|
"aria-haspopup": u ? "dialog" : void 0,
|
|
756
756
|
onSelect: c,
|
|
757
757
|
...l,
|
|
@@ -760,44 +760,44 @@ function Cn({ row: e, layout: t, select: n }) {
|
|
|
760
760
|
}
|
|
761
761
|
//#endregion
|
|
762
762
|
//#region lib/components/ui/actions/toolbar/toolbar-more-group.tsx
|
|
763
|
-
function
|
|
764
|
-
let i = (e) => e.toggle && !e.more, a = e.rows.find((e) => i(e) &&
|
|
765
|
-
return /* @__PURE__ */
|
|
763
|
+
function Cn({ row: e, name: t, title: n, select: r }) {
|
|
764
|
+
let i = (e) => e.toggle && !e.more, a = e.rows.find((e) => i(e) && yn(e.item)), o = bn(e.rows), s = Q();
|
|
765
|
+
return /* @__PURE__ */ L(se, {
|
|
766
766
|
...t,
|
|
767
767
|
value: a?.id ?? "",
|
|
768
|
-
children: [n, e.rows.map((e) => i(e) ? /* @__PURE__ */
|
|
768
|
+
children: [n, e.rows.map((e) => i(e) ? /* @__PURE__ */ L(ce, {
|
|
769
769
|
value: e.id,
|
|
770
|
-
disabled:
|
|
770
|
+
disabled: $(e.item),
|
|
771
771
|
...s,
|
|
772
772
|
onSelect: () => {
|
|
773
|
-
(e.onSelect || !
|
|
773
|
+
(e.onSelect || !yn(e.item)) && r(e);
|
|
774
774
|
},
|
|
775
|
-
children: [/* @__PURE__ */
|
|
775
|
+
children: [/* @__PURE__ */ I(xn, {
|
|
776
776
|
icon: e.icon,
|
|
777
777
|
layout: o
|
|
778
778
|
}), e.label]
|
|
779
|
-
}, e.id) : /* @__PURE__ */
|
|
779
|
+
}, e.id) : /* @__PURE__ */ I(Sn, {
|
|
780
780
|
row: e,
|
|
781
781
|
layout: o,
|
|
782
782
|
select: r
|
|
783
783
|
}, e.id))]
|
|
784
784
|
});
|
|
785
785
|
}
|
|
786
|
-
function
|
|
787
|
-
let r = `${e.id}-name`, i = n ? { "aria-labelledby": r } : { "aria-label": e.label }, a = n ? /* @__PURE__ */
|
|
786
|
+
function wn({ row: e, select: t, titled: n }) {
|
|
787
|
+
let r = `${e.id}-name`, i = n ? { "aria-labelledby": r } : { "aria-label": e.label }, a = n ? /* @__PURE__ */ I(le, {
|
|
788
788
|
id: r,
|
|
789
789
|
children: e.label
|
|
790
790
|
}) : null;
|
|
791
|
-
if (e.choice === "single") return /* @__PURE__ */
|
|
791
|
+
if (e.choice === "single") return /* @__PURE__ */ I(Cn, {
|
|
792
792
|
row: e,
|
|
793
793
|
name: i,
|
|
794
794
|
title: a,
|
|
795
795
|
select: t
|
|
796
796
|
});
|
|
797
|
-
let o =
|
|
798
|
-
return /* @__PURE__ */
|
|
797
|
+
let o = bn(e.rows);
|
|
798
|
+
return /* @__PURE__ */ L(me, {
|
|
799
799
|
...i,
|
|
800
|
-
children: [a, e.rows.map((e) => /* @__PURE__ */
|
|
800
|
+
children: [a, e.rows.map((e) => /* @__PURE__ */ I(Sn, {
|
|
801
801
|
row: e,
|
|
802
802
|
layout: o,
|
|
803
803
|
select: t
|
|
@@ -806,21 +806,21 @@ function Tn({ row: e, select: t, titled: n }) {
|
|
|
806
806
|
}
|
|
807
807
|
//#endregion
|
|
808
808
|
//#region lib/components/ui/actions/toolbar/toolbar-more-items.tsx
|
|
809
|
-
function
|
|
810
|
-
let n =
|
|
811
|
-
return e.map((e) => e.kind === "separator" ? /* @__PURE__ */
|
|
809
|
+
function Tn({ rows: e, select: t }) {
|
|
810
|
+
let n = bn(e.filter((e) => e.kind === "item"));
|
|
811
|
+
return e.map((e) => e.kind === "separator" ? /* @__PURE__ */ I(pe, {}, e.id) : e.kind === "item" ? /* @__PURE__ */ I(Sn, {
|
|
812
812
|
row: e,
|
|
813
813
|
layout: n,
|
|
814
814
|
select: t
|
|
815
|
-
}, e.id) : e.moreAs === "submenu" ? /* @__PURE__ */
|
|
815
|
+
}, e.id) : e.moreAs === "submenu" ? /* @__PURE__ */ I(vn, {
|
|
816
816
|
id: e.id,
|
|
817
817
|
label: e.label,
|
|
818
|
-
children: /* @__PURE__ */
|
|
818
|
+
children: /* @__PURE__ */ I(wn, {
|
|
819
819
|
row: e,
|
|
820
820
|
select: t,
|
|
821
821
|
titled: !1
|
|
822
822
|
})
|
|
823
|
-
}, e.id) : /* @__PURE__ */
|
|
823
|
+
}, e.id) : /* @__PURE__ */ I(wn, {
|
|
824
824
|
row: e,
|
|
825
825
|
select: t,
|
|
826
826
|
titled: e.rows.length > 1
|
|
@@ -828,38 +828,38 @@ function En({ rows: e, select: t }) {
|
|
|
828
828
|
}
|
|
829
829
|
//#endregion
|
|
830
830
|
//#region lib/components/ui/actions/toolbar/toolbar-return-focus.ts
|
|
831
|
-
var
|
|
832
|
-
function
|
|
833
|
-
e.settling && a ===
|
|
831
|
+
var En = "[role=\"dialog\"],[role=\"alertdialog\"],[data-radix-popper-content-wrapper]", Dn = "[role=\"menu\"]", On = 90, kn = (e, t) => e.opened && t.getAttribute("aria-expanded") === "false" || !!(e.layer && !e.layer.isConnected);
|
|
832
|
+
function An(e, t, n, r, i, a = On) {
|
|
833
|
+
e.settling && a === On || (e.settling = !0, requestAnimationFrame(() => {
|
|
834
834
|
if (r.aborted || !t.isConnected) return i();
|
|
835
|
-
if (!
|
|
835
|
+
if (!kn(e, t)) {
|
|
836
836
|
e.settling = !1;
|
|
837
837
|
return;
|
|
838
838
|
}
|
|
839
839
|
let o = document.activeElement;
|
|
840
840
|
if (o?.closest("[role=\"dialog\"],[role=\"alertdialog\"],[data-radix-popper-content-wrapper]")) {
|
|
841
|
-
if (a > 0) return
|
|
841
|
+
if (a > 0) return An(e, t, n, r, i, a - 1);
|
|
842
842
|
e.settling = !1;
|
|
843
843
|
return;
|
|
844
844
|
}
|
|
845
845
|
(!o || o === document.body) && (n.isConnected && !n.hidden ? n : t).focus({ preventScroll: !0 }), i();
|
|
846
846
|
}));
|
|
847
847
|
}
|
|
848
|
-
function
|
|
848
|
+
function jn(e, t, n, r, i) {
|
|
849
849
|
document.addEventListener("focusin", ({ target: n }) => {
|
|
850
|
-
if (!(n instanceof HTMLElement) || n === t || n.closest(
|
|
851
|
-
let i = n.closest(
|
|
850
|
+
if (!(n instanceof HTMLElement) || n === t || n.closest(Dn)) return;
|
|
851
|
+
let i = n.closest(En);
|
|
852
852
|
i ? e.layer = i : n !== document.body && r();
|
|
853
853
|
}, { signal: n }), document.addEventListener("focusout", ({ relatedTarget: e }) => {
|
|
854
854
|
!e && document.hasFocus() && i();
|
|
855
855
|
}, { signal: n }), document.addEventListener("pointerdown", ({ target: e }) => {
|
|
856
|
-
(e instanceof Element ? e : null)?.closest(`[role="dialog"],[role="alertdialog"],[data-radix-popper-content-wrapper],${
|
|
856
|
+
(e instanceof Element ? e : null)?.closest(`[role="dialog"],[role="alertdialog"],[data-radix-popper-content-wrapper],${Dn}`) || r();
|
|
857
857
|
}, {
|
|
858
858
|
capture: !0,
|
|
859
859
|
signal: n
|
|
860
860
|
});
|
|
861
861
|
}
|
|
862
|
-
function
|
|
862
|
+
function Mn(e, t) {
|
|
863
863
|
let n = new AbortController(), { signal: r } = n, i = {
|
|
864
864
|
layer: null,
|
|
865
865
|
opened: e.getAttribute("aria-expanded") === "true",
|
|
@@ -869,7 +869,7 @@ function Nn(e, t) {
|
|
|
869
869
|
}), o = () => {
|
|
870
870
|
n.abort(), a.disconnect();
|
|
871
871
|
}, s = () => {
|
|
872
|
-
|
|
872
|
+
kn(i, e) && An(i, e, t, r, o);
|
|
873
873
|
};
|
|
874
874
|
return a.observe(e, {
|
|
875
875
|
attributes: !0,
|
|
@@ -877,29 +877,29 @@ function Nn(e, t) {
|
|
|
877
877
|
}), a.observe(document.body, {
|
|
878
878
|
childList: !0,
|
|
879
879
|
subtree: !0
|
|
880
|
-
}),
|
|
880
|
+
}), jn(i, t, r, o, s), o;
|
|
881
881
|
}
|
|
882
882
|
//#endregion
|
|
883
883
|
//#region lib/components/ui/actions/toolbar/toolbar-more-launch.ts
|
|
884
|
-
var
|
|
885
|
-
function
|
|
884
|
+
var Nn = "a[href],button:not([disabled]),input:not([disabled]):not([type=\"hidden\"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])", Pn = (e) => e.onSelect ? e.onSelect() : e.item.click();
|
|
885
|
+
function Fn(e, t) {
|
|
886
886
|
let n = (e instanceof Node ? e : t)?.ownerDocument, r = n?.activeElement;
|
|
887
887
|
return !n || !r || r === n.body ? !1 : !(e instanceof Node && e.contains(r)) && !t?.contains(r);
|
|
888
888
|
}
|
|
889
|
-
function
|
|
889
|
+
function In(e, t = 20) {
|
|
890
890
|
let n = e.getAttribute("aria-controls"), r = n ? document.getElementById(n) : null;
|
|
891
891
|
if (!r) {
|
|
892
|
-
t > 0 && requestAnimationFrame(() =>
|
|
892
|
+
t > 0 && requestAnimationFrame(() => In(e, t - 1));
|
|
893
893
|
return;
|
|
894
894
|
}
|
|
895
|
-
(r.querySelector(
|
|
895
|
+
(r.querySelector(Nn) ?? r).focus({ preventScroll: !0 });
|
|
896
896
|
}
|
|
897
|
-
function
|
|
898
|
-
let n =
|
|
897
|
+
function Ln(e, t) {
|
|
898
|
+
let n = N(null), r = N(null), i = un(t);
|
|
899
899
|
A(() => () => r.current?.(), []);
|
|
900
900
|
let a = (t) => {
|
|
901
901
|
let n = e.current, i = "returnFocus" in t.render && t.render.returnFocus === !1;
|
|
902
|
-
!n || i || (r.current?.(), r.current =
|
|
902
|
+
!n || i || (r.current?.(), r.current = Mn(t.item, n));
|
|
903
903
|
};
|
|
904
904
|
return {
|
|
905
905
|
guard: i.guard,
|
|
@@ -909,13 +909,13 @@ function Rn(e, t) {
|
|
|
909
909
|
n.current = t;
|
|
910
910
|
return;
|
|
911
911
|
}
|
|
912
|
-
|
|
912
|
+
Pn(t), t.render.kind === "dialog" && a(t);
|
|
913
913
|
},
|
|
914
914
|
onCloseAutoFocus(t) {
|
|
915
915
|
document.activeElement?.closest("[role=\"dialog\"],[role=\"alertdialog\"],[data-radix-popper-content-wrapper]") && t.preventDefault();
|
|
916
916
|
let r = n.current;
|
|
917
917
|
if (!r) {
|
|
918
|
-
if (
|
|
918
|
+
if (Fn(t.target, e.current)) {
|
|
919
919
|
i.end(), t.preventDefault();
|
|
920
920
|
return;
|
|
921
921
|
}
|
|
@@ -923,40 +923,40 @@ function Rn(e, t) {
|
|
|
923
923
|
return;
|
|
924
924
|
}
|
|
925
925
|
i.end(), n.current = null, t.preventDefault(), requestAnimationFrame(() => {
|
|
926
|
-
|
|
926
|
+
Pn(r), a(r), In(r.item);
|
|
927
927
|
});
|
|
928
928
|
}
|
|
929
929
|
};
|
|
930
930
|
}
|
|
931
931
|
//#endregion
|
|
932
932
|
//#region lib/components/ui/actions/toolbar/toolbar-more-render.ts
|
|
933
|
-
function
|
|
933
|
+
function Rn(e) {
|
|
934
934
|
return e.more ? e.more : e.toggle ? { kind: "checkbox" } : { kind: "item" };
|
|
935
935
|
}
|
|
936
936
|
//#endregion
|
|
937
937
|
//#region lib/components/ui/actions/toolbar/toolbar-more-rows.ts
|
|
938
|
-
var
|
|
939
|
-
function
|
|
940
|
-
let
|
|
941
|
-
return
|
|
942
|
-
...
|
|
938
|
+
var zn = "[data-toolbar-id]";
|
|
939
|
+
function Bn(e, n, r) {
|
|
940
|
+
let i = Rn(r);
|
|
941
|
+
return i.kind === "none" ? null : (!r.more && !r.onSelect && n.getAttribute("aria-haspopup") === "menu" && t(`"${r.label}" opens a menu and is folded into More without \`more\`: pass more={{ kind: 'submenu', content }} (or an onSelect).`, "Toolbar"), {
|
|
942
|
+
...r,
|
|
943
943
|
id: e,
|
|
944
|
-
item:
|
|
944
|
+
item: n,
|
|
945
945
|
kind: "item",
|
|
946
|
-
render:
|
|
946
|
+
render: i
|
|
947
947
|
});
|
|
948
948
|
}
|
|
949
|
-
function
|
|
949
|
+
function Vn(e, t) {
|
|
950
950
|
let n = [];
|
|
951
|
-
for (let r of e.querySelectorAll(
|
|
951
|
+
for (let r of e.querySelectorAll(zn)) {
|
|
952
952
|
let e = r.dataset.toolbarId ?? "", i = t.get(e);
|
|
953
953
|
if (!i || i.separator || i.group) continue;
|
|
954
|
-
let a =
|
|
954
|
+
let a = Bn(e, r, i);
|
|
955
955
|
a && n.push(a);
|
|
956
956
|
}
|
|
957
957
|
return n;
|
|
958
958
|
}
|
|
959
|
-
function
|
|
959
|
+
function Hn(e, t) {
|
|
960
960
|
if (!e) return [];
|
|
961
961
|
let n = [], r = (e) => {
|
|
962
962
|
let t = n[n.length - 1];
|
|
@@ -965,11 +965,11 @@ function Un(e, t) {
|
|
|
965
965
|
kind: "separator"
|
|
966
966
|
});
|
|
967
967
|
};
|
|
968
|
-
for (let i of e.querySelectorAll(`:scope > ${
|
|
968
|
+
for (let i of e.querySelectorAll(`:scope > ${zn}[hidden]`)) {
|
|
969
969
|
let e = i.dataset.toolbarId ?? "", a = t.get(e);
|
|
970
970
|
if (a) if (a.separator) r(e);
|
|
971
971
|
else if (a.group) {
|
|
972
|
-
let o =
|
|
972
|
+
let o = Vn(i, t);
|
|
973
973
|
if (!o.length) continue;
|
|
974
974
|
r(`${e}-before`), o.length === 1 && a.choice !== "single" ? n.push(o[0]) : n.push({
|
|
975
975
|
id: e,
|
|
@@ -980,7 +980,7 @@ function Un(e, t) {
|
|
|
980
980
|
rows: o
|
|
981
981
|
}), r(`${e}-after`);
|
|
982
982
|
} else {
|
|
983
|
-
let t =
|
|
983
|
+
let t = Bn(e, i, a);
|
|
984
984
|
t && n.push(t);
|
|
985
985
|
}
|
|
986
986
|
}
|
|
@@ -988,16 +988,16 @@ function Un(e, t) {
|
|
|
988
988
|
}
|
|
989
989
|
//#endregion
|
|
990
990
|
//#region lib/components/ui/actions/toolbar/toolbar-more.tsx
|
|
991
|
-
function
|
|
992
|
-
let { t: o } =
|
|
993
|
-
return /* @__PURE__ */
|
|
991
|
+
function Un({ root: e, hidden: t, label: n, dir: r, side: i, align: a = "end" }) {
|
|
992
|
+
let { t: o } = Se(), { entries: s, dir: c, orientation: l } = k(K), u = r ?? c, d = i ?? (l === "vertical" ? u === "rtl" ? "left" : "right" : void 0), f = hn(u), p = N(null), m = Ln(p, f.contentProps.ref), [h, g] = P([]), _ = () => e?.current ?? p.current?.closest("[role=\"toolbar\"]") ?? null;
|
|
993
|
+
return /* @__PURE__ */ L(he, {
|
|
994
994
|
dir: u,
|
|
995
995
|
onOpenChange: (e) => {
|
|
996
|
-
e && (f.reset(), m.reset(), g(
|
|
996
|
+
e && (f.reset(), m.reset(), g(Hn(_(), s)));
|
|
997
997
|
},
|
|
998
|
-
children: [/* @__PURE__ */
|
|
998
|
+
children: [/* @__PURE__ */ I(ae, {
|
|
999
999
|
asChild: !0,
|
|
1000
|
-
children: /* @__PURE__ */
|
|
1000
|
+
children: /* @__PURE__ */ I(G, {
|
|
1001
1001
|
ref: p,
|
|
1002
1002
|
type: "button",
|
|
1003
1003
|
"data-slot": "toolbar-more",
|
|
@@ -1005,22 +1005,22 @@ function Wn({ root: e, hidden: t, label: n, dir: r, side: i, align: a = "end" })
|
|
|
1005
1005
|
hidden: t || void 0,
|
|
1006
1006
|
"aria-label": n ?? o("material.toolbar.more", "More"),
|
|
1007
1007
|
className: "nxgt-toolbar-item",
|
|
1008
|
-
children: /* @__PURE__ */
|
|
1008
|
+
children: /* @__PURE__ */ I(Ae, {})
|
|
1009
1009
|
})
|
|
1010
|
-
}), /* @__PURE__ */
|
|
1010
|
+
}), /* @__PURE__ */ I(fe, {
|
|
1011
1011
|
side: d,
|
|
1012
1012
|
align: a,
|
|
1013
1013
|
className: "min-w-48",
|
|
1014
1014
|
onCloseAutoFocus: m.onCloseAutoFocus,
|
|
1015
1015
|
...f.contentProps,
|
|
1016
|
-
children: /* @__PURE__ */
|
|
1016
|
+
children: /* @__PURE__ */ I(cn, {
|
|
1017
1017
|
value: m.guard,
|
|
1018
|
-
children: /* @__PURE__ */
|
|
1018
|
+
children: /* @__PURE__ */ I(dn, {
|
|
1019
1019
|
value: f.api,
|
|
1020
|
-
children: f.drill ? /* @__PURE__ */
|
|
1020
|
+
children: f.drill ? /* @__PURE__ */ I(gn, {
|
|
1021
1021
|
drill: f.drill,
|
|
1022
1022
|
leave: f.leave
|
|
1023
|
-
}) : /* @__PURE__ */
|
|
1023
|
+
}) : /* @__PURE__ */ I(Tn, {
|
|
1024
1024
|
rows: h,
|
|
1025
1025
|
select: m.select
|
|
1026
1026
|
})
|
|
@@ -1031,20 +1031,20 @@ function Wn({ root: e, hidden: t, label: n, dir: r, side: i, align: a = "end" })
|
|
|
1031
1031
|
}
|
|
1032
1032
|
//#endregion
|
|
1033
1033
|
//#region lib/components/ui/actions/toolbar/use-toolbar-fit.ts
|
|
1034
|
-
function
|
|
1035
|
-
let [a, o] =
|
|
1034
|
+
function Wn(e, t, n = "x", r, i) {
|
|
1035
|
+
let [a, o] = P($t), s = N(/* @__PURE__ */ new Map()), c = N(a);
|
|
1036
1036
|
c.current = a;
|
|
1037
|
-
let l =
|
|
1037
|
+
let l = N(() => {}), u = N(null);
|
|
1038
1038
|
l.current = () => {
|
|
1039
1039
|
let a = e.current;
|
|
1040
1040
|
if (!a) return;
|
|
1041
|
-
let l =
|
|
1041
|
+
let l = en(a, s.current, {
|
|
1042
1042
|
enabled: t,
|
|
1043
1043
|
axis: n,
|
|
1044
1044
|
room: r,
|
|
1045
1045
|
...i
|
|
1046
1046
|
});
|
|
1047
|
-
u.current?.takeRecords(),
|
|
1047
|
+
u.current?.takeRecords(), Gn(l, c.current) || o(l);
|
|
1048
1048
|
}, j(() => l.current()), j(() => {
|
|
1049
1049
|
let r = e.current;
|
|
1050
1050
|
if (!r || !t || typeof ResizeObserver > "u") return;
|
|
@@ -1052,11 +1052,11 @@ function Gn(e, t, n = "x", r, i) {
|
|
|
1052
1052
|
u.current = i;
|
|
1053
1053
|
let a = () => l.current(), o = new ResizeObserver(a);
|
|
1054
1054
|
o.observe(r), r.parentElement && o.observe(r.parentElement);
|
|
1055
|
-
let s = n === "y" ?
|
|
1055
|
+
let s = n === "y" ? Nt(r) : null;
|
|
1056
1056
|
s && o.observe(s);
|
|
1057
1057
|
let c = () => {
|
|
1058
1058
|
if (n === "y") {
|
|
1059
|
-
let e =
|
|
1059
|
+
let e = Nt(r);
|
|
1060
1060
|
e !== s && (s && o.unobserve(s), e && o.observe(e), s = e);
|
|
1061
1061
|
}
|
|
1062
1062
|
a();
|
|
@@ -1073,20 +1073,20 @@ function Gn(e, t, n = "x", r, i) {
|
|
|
1073
1073
|
t,
|
|
1074
1074
|
n
|
|
1075
1075
|
]);
|
|
1076
|
-
let d =
|
|
1076
|
+
let d = we(() => l.current(), []);
|
|
1077
1077
|
return {
|
|
1078
1078
|
...a,
|
|
1079
1079
|
remeasure: d
|
|
1080
1080
|
};
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1082
|
+
function Gn(e, t) {
|
|
1083
1083
|
if (e.overflowing !== t.overflowing || e.spilled.size !== t.spilled.size) return !1;
|
|
1084
1084
|
for (let n of e.spilled) if (!t.spilled.has(n)) return !1;
|
|
1085
1085
|
return !0;
|
|
1086
1086
|
}
|
|
1087
1087
|
//#endregion
|
|
1088
1088
|
//#region lib/components/ui/actions/toolbar/use-toolbar-focus.ts
|
|
1089
|
-
function
|
|
1089
|
+
function Kn(e) {
|
|
1090
1090
|
let t = e.parentElement;
|
|
1091
1091
|
if (t?.dataset.slot !== "toolbar-pair") return null;
|
|
1092
1092
|
for (let n of Array.from(t.children)) {
|
|
@@ -1097,8 +1097,8 @@ function qn(e) {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
return null;
|
|
1099
1099
|
}
|
|
1100
|
-
function
|
|
1101
|
-
let t =
|
|
1100
|
+
function qn(e) {
|
|
1101
|
+
let t = N(null);
|
|
1102
1102
|
return A(() => {
|
|
1103
1103
|
let n = e.current;
|
|
1104
1104
|
if (!n) return;
|
|
@@ -1116,8 +1116,8 @@ function Jn(e) {
|
|
|
1116
1116
|
return r && (e === r || n) ? r : null;
|
|
1117
1117
|
};
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1120
|
-
let r =
|
|
1119
|
+
function Jn(e, t, n) {
|
|
1120
|
+
let r = qn(e), i = N(null);
|
|
1121
1121
|
j(() => {
|
|
1122
1122
|
let t = e.current, n = r()?.closest("[hidden]");
|
|
1123
1123
|
!t || !n || n === t || !t.contains(n) || t.querySelector(":scope > [data-toolbar-more]")?.focus();
|
|
@@ -1125,7 +1125,7 @@ function Yn(e, t, n) {
|
|
|
1125
1125
|
let t = e.current;
|
|
1126
1126
|
if (!t) return;
|
|
1127
1127
|
if (n) {
|
|
1128
|
-
let e = r(), n = e &&
|
|
1128
|
+
let e = r(), n = e && Kn(t);
|
|
1129
1129
|
if (!e || !n) return;
|
|
1130
1130
|
i.current = {
|
|
1131
1131
|
item: e,
|
|
@@ -1137,8 +1137,8 @@ function Yn(e, t, n) {
|
|
|
1137
1137
|
i.current = null, a && document.activeElement === a.fab && a.item.isConnected && a.item.focus({ preventScroll: !0 });
|
|
1138
1138
|
}, [e, n]);
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1141
|
-
let [, n] =
|
|
1140
|
+
function Yn(e, t) {
|
|
1141
|
+
let [, n] = Ee((e) => e + 1, 0), r = e.current, i = !!t && r !== null && typeof document < "u" && r.contains(document.activeElement) && !Kn(r);
|
|
1142
1142
|
return A(() => {
|
|
1143
1143
|
let t = e.current;
|
|
1144
1144
|
if (!i || !t) return;
|
|
@@ -1148,12 +1148,12 @@ function Xn(e, t) {
|
|
|
1148
1148
|
return t.addEventListener("focusout", r), () => t.removeEventListener("focusout", r);
|
|
1149
1149
|
}, [e, i]), !!t && !i;
|
|
1150
1150
|
}
|
|
1151
|
-
function
|
|
1151
|
+
function Xn(e) {
|
|
1152
1152
|
if (e.scale > 1.01) return 0;
|
|
1153
1153
|
let t = e.layoutHeight - (e.height + e.offsetTop);
|
|
1154
1154
|
return t >= 120 ? Math.round(t) : 0;
|
|
1155
1155
|
}
|
|
1156
|
-
var
|
|
1156
|
+
var Zn = "--nxgt-toolbar-lift", Qn = [
|
|
1157
1157
|
"[role=\"dialog\"]",
|
|
1158
1158
|
"[role=\"alertdialog\"]",
|
|
1159
1159
|
...[
|
|
@@ -1162,26 +1162,26 @@ var Qn = "--nxgt-toolbar-lift", $n = [
|
|
|
1162
1162
|
"sheet",
|
|
1163
1163
|
"drawer"
|
|
1164
1164
|
].map((e) => `[data-slot="${e}-content"]`)
|
|
1165
|
-
].join(","),
|
|
1166
|
-
function
|
|
1165
|
+
].join(","), $n = "data-nxgt-keyboard-lift";
|
|
1166
|
+
function er(e, t) {
|
|
1167
1167
|
for (let n = e; n && n.tagName !== "BODY"; n = n.parentElement) if (t.getComputedStyle(n).position === "fixed") return n;
|
|
1168
1168
|
return null;
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1170
|
+
function tr(e, t = typeof window > "u" ? void 0 : window) {
|
|
1171
1171
|
let n = t?.visualViewport;
|
|
1172
1172
|
if (!t || !n) return () => {};
|
|
1173
1173
|
let r = null, i = 0, a = 0, o = (e) => {
|
|
1174
|
-
e.style.removeProperty(
|
|
1174
|
+
e.style.removeProperty(Zn), e.removeAttribute($n);
|
|
1175
1175
|
}, s = (e, t) => {
|
|
1176
|
-
r && r !== e && (o(r), i = 0), r = e, !(!e || t === i) && (i = t, t ? (e.style.setProperty(
|
|
1176
|
+
r && r !== e && (o(r), i = 0), r = e, !(!e || t === i) && (i = t, t ? (e.style.setProperty(Zn, `${t}px`), e.setAttribute($n, "")) : o(e));
|
|
1177
1177
|
}, c = () => {
|
|
1178
1178
|
a = 0;
|
|
1179
|
-
let o = t.matchMedia("(pointer: coarse), (max-width: 40rem)").matches ?
|
|
1179
|
+
let o = t.matchMedia("(pointer: coarse), (max-width: 40rem)").matches ? er(e, t) : null, c = o?.getBoundingClientRect(), l = o && c && !o.matches(Qn) && c.height <= t.innerHeight / 2 && c.bottom + (o === r ? i : 0) > t.innerHeight / 2;
|
|
1180
1180
|
if (!o || !l) {
|
|
1181
1181
|
s(r, 0);
|
|
1182
1182
|
return;
|
|
1183
1183
|
}
|
|
1184
|
-
s(o,
|
|
1184
|
+
s(o, Xn({
|
|
1185
1185
|
layoutHeight: t.innerHeight,
|
|
1186
1186
|
height: n.height,
|
|
1187
1187
|
offsetTop: n.offsetTop,
|
|
@@ -1194,49 +1194,49 @@ function nr(e, t = typeof window > "u" ? void 0 : window) {
|
|
|
1194
1194
|
n.removeEventListener("resize", l), n.removeEventListener("scroll", l), a && t.cancelAnimationFrame(a), s(r, 0);
|
|
1195
1195
|
};
|
|
1196
1196
|
}
|
|
1197
|
-
function
|
|
1197
|
+
function nr(e, t) {
|
|
1198
1198
|
A(() => {
|
|
1199
1199
|
let n = e.current;
|
|
1200
|
-
if (!(!t || !n)) return
|
|
1200
|
+
if (!(!t || !n)) return tr(n);
|
|
1201
1201
|
}, [e, t]);
|
|
1202
1202
|
}
|
|
1203
1203
|
//#endregion
|
|
1204
1204
|
//#region lib/components/ui/actions/toolbar/toolbar.tsx
|
|
1205
|
-
function
|
|
1205
|
+
function rr(e) {
|
|
1206
1206
|
return {
|
|
1207
1207
|
get current() {
|
|
1208
|
-
let t = e.current?.querySelector(
|
|
1208
|
+
let t = e.current?.querySelector(Zt);
|
|
1209
1209
|
return t && !t.hidden ? t : e.current;
|
|
1210
1210
|
},
|
|
1211
1211
|
set current(e) {}
|
|
1212
1212
|
};
|
|
1213
1213
|
}
|
|
1214
|
-
function
|
|
1215
|
-
let v =
|
|
1216
|
-
|
|
1217
|
-
let [
|
|
1214
|
+
function ir({ label: t, children: r, variant: i = "floating", density: a = "comfortable", keyboardLift: o = !0, tone: s = "neutral", selectedLook: c = "quiet", orientation: l = "horizontal", overflow: u, overflowRoom: d, moreLabel: f, hidden: p, dir: m, className: h, ref: g, ..._ }) {
|
|
1215
|
+
let v = N(null), y = n(v, g), b = xt(v), x = m ?? b, S = Yn(v, p), C = !!u, { spilled: w, overflowing: T } = Wn(v, C, l === "vertical" ? "y" : "x", d);
|
|
1216
|
+
Jn(v, w, S), nr(v, i === "floating" && o);
|
|
1217
|
+
let [E] = P(() => /* @__PURE__ */ new Map()), [ee] = P(() => rr(v)), [te] = P(() => ({ current: null })), ne = M(() => ({
|
|
1218
1218
|
inside: !0,
|
|
1219
1219
|
spilled: w,
|
|
1220
|
-
entries:
|
|
1220
|
+
entries: E,
|
|
1221
1221
|
dir: x,
|
|
1222
1222
|
orientation: l,
|
|
1223
1223
|
overflowing: T,
|
|
1224
|
-
moreAnchor:
|
|
1225
|
-
focusLost:
|
|
1224
|
+
moreAnchor: ee,
|
|
1225
|
+
focusLost: te
|
|
1226
1226
|
}), [
|
|
1227
1227
|
w,
|
|
1228
|
-
|
|
1228
|
+
E,
|
|
1229
1229
|
x,
|
|
1230
1230
|
l,
|
|
1231
1231
|
T,
|
|
1232
|
-
|
|
1233
|
-
|
|
1232
|
+
ee,
|
|
1233
|
+
te
|
|
1234
1234
|
]);
|
|
1235
|
-
return /* @__PURE__ */
|
|
1235
|
+
return /* @__PURE__ */ I(_t, {
|
|
1236
1236
|
"data-slot": "toolbar",
|
|
1237
1237
|
..._,
|
|
1238
1238
|
ref: y,
|
|
1239
|
-
"aria-label":
|
|
1239
|
+
"aria-label": t,
|
|
1240
1240
|
orientation: l,
|
|
1241
1241
|
dir: x,
|
|
1242
1242
|
"data-variant": i,
|
|
@@ -1247,9 +1247,9 @@ function ar({ label: n, children: r, variant: i = "floating", density: a = "comf
|
|
|
1247
1247
|
"data-hidden": S ? "" : void 0,
|
|
1248
1248
|
inert: S || void 0,
|
|
1249
1249
|
className: e("nxgt-toolbar", h),
|
|
1250
|
-
children: /* @__PURE__ */
|
|
1250
|
+
children: /* @__PURE__ */ L(K, {
|
|
1251
1251
|
value: ne,
|
|
1252
|
-
children: [r, C ? /* @__PURE__ */
|
|
1252
|
+
children: [r, C ? /* @__PURE__ */ I(Un, {
|
|
1253
1253
|
root: v,
|
|
1254
1254
|
dir: x,
|
|
1255
1255
|
label: f,
|
|
@@ -1260,21 +1260,21 @@ function ar({ label: n, children: r, variant: i = "floating", density: a = "comf
|
|
|
1260
1260
|
}
|
|
1261
1261
|
//#endregion
|
|
1262
1262
|
//#region lib/components/ui/actions/toolbar/toolbar-group.tsx
|
|
1263
|
-
function
|
|
1264
|
-
let { spilled: c, inside: l, props: u } =
|
|
1263
|
+
function ar({ label: t, children: n, priority: r, moreAs: i, choice: a, className: o, ...s }) {
|
|
1264
|
+
let { spilled: c, inside: l, props: u } = J({
|
|
1265
1265
|
label: t,
|
|
1266
1266
|
group: !0,
|
|
1267
1267
|
choice: a,
|
|
1268
1268
|
moreAs: i
|
|
1269
|
-
}, r), d =
|
|
1270
|
-
return /* @__PURE__ */
|
|
1269
|
+
}, r), d = M(() => ({ spilled: c }), [c]);
|
|
1270
|
+
return /* @__PURE__ */ I("div", {
|
|
1271
1271
|
"data-slot": "toolbar-group",
|
|
1272
1272
|
...s,
|
|
1273
1273
|
...u,
|
|
1274
1274
|
role: "group",
|
|
1275
1275
|
"aria-label": t,
|
|
1276
1276
|
className: e(l && "nxgt-toolbar-group", o),
|
|
1277
|
-
children: /* @__PURE__ */
|
|
1277
|
+
children: /* @__PURE__ */ I(q, {
|
|
1278
1278
|
value: d,
|
|
1279
1279
|
children: n
|
|
1280
1280
|
})
|
|
@@ -1282,7 +1282,7 @@ function or({ label: t, children: n, priority: r, moreAs: i, choice: a, classNam
|
|
|
1282
1282
|
}
|
|
1283
1283
|
//#endregion
|
|
1284
1284
|
//#region lib/components/ui/actions/toolbar/keep-text-keys.ts
|
|
1285
|
-
var
|
|
1285
|
+
var or = /* @__PURE__ */ new Set([
|
|
1286
1286
|
"button",
|
|
1287
1287
|
"checkbox",
|
|
1288
1288
|
"color",
|
|
@@ -1292,7 +1292,7 @@ var sr = /* @__PURE__ */ new Set([
|
|
|
1292
1292
|
"reset",
|
|
1293
1293
|
"submit"
|
|
1294
1294
|
]);
|
|
1295
|
-
function
|
|
1295
|
+
function sr(e) {
|
|
1296
1296
|
let t, n;
|
|
1297
1297
|
try {
|
|
1298
1298
|
t = e.selectionStart, n = e.selectionEnd;
|
|
@@ -1304,19 +1304,19 @@ function cr(e) {
|
|
|
1304
1304
|
atEnd: t === e.value.length
|
|
1305
1305
|
};
|
|
1306
1306
|
}
|
|
1307
|
-
function
|
|
1307
|
+
function cr(e) {
|
|
1308
1308
|
let t = e.target;
|
|
1309
1309
|
if (t.isContentEditable || e.nativeEvent.isComposing) return !0;
|
|
1310
1310
|
let n = e.key === "ArrowUp" || e.key === "ArrowDown";
|
|
1311
1311
|
if (t instanceof HTMLSelectElement) return n;
|
|
1312
|
-
let r = t instanceof HTMLInputElement && !
|
|
1312
|
+
let r = t instanceof HTMLInputElement && !or.has(t.type) || t instanceof HTMLTextAreaElement ? t : null;
|
|
1313
1313
|
if (!r) return !1;
|
|
1314
|
-
let i =
|
|
1314
|
+
let i = sr(r);
|
|
1315
1315
|
if (!i || n) return !0;
|
|
1316
1316
|
let a = getComputedStyle(t).direction === "rtl", o = a ? "ArrowRight" : "ArrowLeft", s = a ? "ArrowLeft" : "ArrowRight";
|
|
1317
1317
|
return e.key === o || e.key === "Home" ? !i.atStart : e.key === s || e.key === "End" ? !i.atEnd : !1;
|
|
1318
1318
|
}
|
|
1319
|
-
var
|
|
1319
|
+
var lr = /* @__PURE__ */ new Set([
|
|
1320
1320
|
"ArrowLeft",
|
|
1321
1321
|
"ArrowRight",
|
|
1322
1322
|
"ArrowUp",
|
|
@@ -1324,8 +1324,8 @@ var ur = /* @__PURE__ */ new Set([
|
|
|
1324
1324
|
"Home",
|
|
1325
1325
|
"End"
|
|
1326
1326
|
]);
|
|
1327
|
-
function
|
|
1328
|
-
if (!
|
|
1327
|
+
function ur(e) {
|
|
1328
|
+
if (!lr.has(e.key) || !cr(e)) return;
|
|
1329
1329
|
let t = !0;
|
|
1330
1330
|
Object.defineProperty(e, "defaultPrevented", {
|
|
1331
1331
|
configurable: !0,
|
|
@@ -1334,37 +1334,37 @@ function dr(e) {
|
|
|
1334
1334
|
}
|
|
1335
1335
|
//#endregion
|
|
1336
1336
|
//#region lib/components/ui/overlays/popover/in-popover.ts
|
|
1337
|
-
var
|
|
1338
|
-
function
|
|
1339
|
-
return k(
|
|
1337
|
+
var dr = O(!1);
|
|
1338
|
+
function fr() {
|
|
1339
|
+
return k(dr);
|
|
1340
1340
|
}
|
|
1341
1341
|
//#endregion
|
|
1342
1342
|
//#region lib/components/ui/overlays/popover/popover.tsx
|
|
1343
|
-
function
|
|
1344
|
-
return /* @__PURE__ */
|
|
1343
|
+
function pr({ ...e }) {
|
|
1344
|
+
return /* @__PURE__ */ I(ee, {
|
|
1345
1345
|
value: e.modal ?? !1,
|
|
1346
|
-
children: /* @__PURE__ */
|
|
1346
|
+
children: /* @__PURE__ */ I(dr, {
|
|
1347
1347
|
value: !0,
|
|
1348
|
-
children: /* @__PURE__ */
|
|
1348
|
+
children: /* @__PURE__ */ I(Xe, {
|
|
1349
1349
|
"data-slot": "popover",
|
|
1350
1350
|
...e
|
|
1351
1351
|
})
|
|
1352
1352
|
})
|
|
1353
1353
|
});
|
|
1354
1354
|
}
|
|
1355
|
-
function
|
|
1356
|
-
return /* @__PURE__ */
|
|
1355
|
+
function mr({ ...e }) {
|
|
1356
|
+
return /* @__PURE__ */ I(Qe, {
|
|
1357
1357
|
"data-slot": "popover-trigger",
|
|
1358
1358
|
...e
|
|
1359
1359
|
});
|
|
1360
1360
|
}
|
|
1361
|
-
function
|
|
1362
|
-
return /* @__PURE__ */
|
|
1361
|
+
function hr({ className: t, children: n, align: r = "center", sideOffset: i = 6, collisionPadding: a = 8, variant: o = "elevated", arrow: s = !1, ref: c, ...l }) {
|
|
1362
|
+
return /* @__PURE__ */ I(Ce, { children: /* @__PURE__ */ I(ne, {
|
|
1363
1363
|
value: !1,
|
|
1364
|
-
children: /* @__PURE__ */
|
|
1364
|
+
children: /* @__PURE__ */ I(dr, {
|
|
1365
1365
|
value: !1,
|
|
1366
|
-
children: /* @__PURE__ */
|
|
1367
|
-
ref:
|
|
1366
|
+
children: /* @__PURE__ */ I($e, { children: /* @__PURE__ */ I(et, {
|
|
1367
|
+
ref: C(!1, c),
|
|
1368
1368
|
"data-slot": "popover-content",
|
|
1369
1369
|
"data-variant": o,
|
|
1370
1370
|
"data-arrow": s || void 0,
|
|
@@ -1375,9 +1375,9 @@ function gr({ className: t, children: n, align: r = "center", sideOffset: i = 6,
|
|
|
1375
1375
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
1376
1376
|
...l,
|
|
1377
1377
|
onEscapeKeyDown: (e) => {
|
|
1378
|
-
|
|
1378
|
+
De(e), l.onEscapeKeyDown?.(e);
|
|
1379
1379
|
},
|
|
1380
|
-
children: s ? /* @__PURE__ */
|
|
1380
|
+
children: s ? /* @__PURE__ */ L(F, { children: [n, /* @__PURE__ */ I(tt, {
|
|
1381
1381
|
className: "nxgt-popover-arrow",
|
|
1382
1382
|
width: 16,
|
|
1383
1383
|
height: 8
|
|
@@ -1386,16 +1386,16 @@ function gr({ className: t, children: n, align: r = "center", sideOffset: i = 6,
|
|
|
1386
1386
|
})
|
|
1387
1387
|
}) });
|
|
1388
1388
|
}
|
|
1389
|
-
function
|
|
1390
|
-
return /* @__PURE__ */
|
|
1389
|
+
function gr({ ...e }) {
|
|
1390
|
+
return /* @__PURE__ */ I(Ze, {
|
|
1391
1391
|
"data-slot": "popover-anchor",
|
|
1392
1392
|
...e
|
|
1393
1393
|
});
|
|
1394
1394
|
}
|
|
1395
1395
|
//#endregion
|
|
1396
1396
|
//#region lib/components/ui/actions/toolbar/toolbar-fold-anchor.tsx
|
|
1397
|
-
function
|
|
1398
|
-
let { moreAnchor: n } = k(
|
|
1397
|
+
function _r({ own: e, folded: t }) {
|
|
1398
|
+
let { moreAnchor: n } = k(K), r = fr(), i = M(() => ({
|
|
1399
1399
|
get current() {
|
|
1400
1400
|
return t ? n.current : e.current;
|
|
1401
1401
|
},
|
|
@@ -1405,13 +1405,13 @@ function vr({ own: e, folded: t }) {
|
|
|
1405
1405
|
e,
|
|
1406
1406
|
n
|
|
1407
1407
|
]);
|
|
1408
|
-
return r ? /* @__PURE__ */
|
|
1408
|
+
return r ? /* @__PURE__ */ I(gr, { virtualRef: i }) : null;
|
|
1409
1409
|
}
|
|
1410
1410
|
//#endregion
|
|
1411
1411
|
//#region lib/components/ui/actions/toolbar/toolbar-keep-focus.ts
|
|
1412
|
-
function
|
|
1413
|
-
let { inside: n, focusLost: r } = k(
|
|
1414
|
-
return
|
|
1412
|
+
function vr(e, t) {
|
|
1413
|
+
let { inside: n, focusLost: r } = k(K), i = N(null);
|
|
1414
|
+
return we((a) => {
|
|
1415
1415
|
if (!e || !n) {
|
|
1416
1416
|
i.current = a;
|
|
1417
1417
|
return;
|
|
@@ -1440,50 +1440,50 @@ function yr(e, t) {
|
|
|
1440
1440
|
}
|
|
1441
1441
|
//#endregion
|
|
1442
1442
|
//#region lib/components/ui/actions/toolbar/toolbar-item-slot.tsx
|
|
1443
|
-
function
|
|
1444
|
-
let { inside: m, spilled: h, props: g } =
|
|
1445
|
-
label:
|
|
1446
|
-
icon:
|
|
1443
|
+
function yr({ children: e, label: t, icon: r, toggle: a, priority: o, onSelect: s, more: c, onKeyDown: l, fit: d, shape: f = "pill", ...p }) {
|
|
1444
|
+
let { inside: m, spilled: h, props: g } = J({
|
|
1445
|
+
label: t,
|
|
1446
|
+
icon: r,
|
|
1447
1447
|
toggle: a,
|
|
1448
1448
|
onSelect: s,
|
|
1449
1449
|
more: c
|
|
1450
|
-
}, o), _ =
|
|
1451
|
-
return m ? /* @__PURE__ */
|
|
1450
|
+
}, o), _ = N(null), v = vr(c?.kind === "popover", t), y = n(_, p.ref, v);
|
|
1451
|
+
return m ? /* @__PURE__ */ L(F, { children: [c?.kind === "popover" ? /* @__PURE__ */ I(_r, {
|
|
1452
1452
|
own: _,
|
|
1453
1453
|
folded: h
|
|
1454
|
-
}) : null, /* @__PURE__ */
|
|
1454
|
+
}) : null, /* @__PURE__ */ I(G, {
|
|
1455
1455
|
asChild: !0,
|
|
1456
1456
|
...p,
|
|
1457
1457
|
ref: y,
|
|
1458
|
-
...
|
|
1459
|
-
onKeyDown: l
|
|
1458
|
+
...br(e),
|
|
1459
|
+
onKeyDown: u(l, ur),
|
|
1460
1460
|
...g,
|
|
1461
1461
|
"data-toolbar-item": "",
|
|
1462
1462
|
"data-toolbar-shape": f,
|
|
1463
|
-
"data-toolbar-fit": d ?? !
|
|
1463
|
+
"data-toolbar-fit": d ?? !xr(e) ? "" : void 0,
|
|
1464
1464
|
children: e
|
|
1465
|
-
})] }) : /* @__PURE__ */
|
|
1465
|
+
})] }) : /* @__PURE__ */ I(i, {
|
|
1466
1466
|
...p,
|
|
1467
|
-
onKeyDown:
|
|
1467
|
+
onKeyDown: l,
|
|
1468
1468
|
children: e
|
|
1469
1469
|
});
|
|
1470
1470
|
}
|
|
1471
|
-
function
|
|
1471
|
+
function br(e) {
|
|
1472
1472
|
let t = e.props;
|
|
1473
|
-
return e.type === "input" ? { type: t.type ?? "text" } :
|
|
1473
|
+
return e.type === "input" ? { type: t.type ?? "text" } : xr(e) ? { type: void 0 } : {};
|
|
1474
1474
|
}
|
|
1475
|
-
var
|
|
1475
|
+
var xr = (e) => e.type === "input" || e.type === "textarea" || e.type === "select";
|
|
1476
1476
|
//#endregion
|
|
1477
1477
|
//#region lib/components/ui/actions/toolbar/toolbar-item.tsx
|
|
1478
|
-
function
|
|
1479
|
-
let { spilled: p, props: m } =
|
|
1478
|
+
function Sr({ icon: t, label: r, tooltip: i = !0, toggle: a, priority: o, more: s, shape: c = "pill", className: l, type: u = "button", toggleValue: d, ...f }) {
|
|
1479
|
+
let { spilled: p, props: m } = J({
|
|
1480
1480
|
label: r,
|
|
1481
|
-
icon:
|
|
1481
|
+
icon: t,
|
|
1482
1482
|
toggle: a,
|
|
1483
1483
|
more: s
|
|
1484
|
-
}, o), [
|
|
1485
|
-
p &&
|
|
1486
|
-
let y =
|
|
1484
|
+
}, o), [h, g] = P(!1), v = k(Tt);
|
|
1485
|
+
p && h && g(!1);
|
|
1486
|
+
let y = N(null), b = vr(s?.kind === "popover", r), x = n(y, f.ref, b), S = {
|
|
1487
1487
|
type: u,
|
|
1488
1488
|
...f,
|
|
1489
1489
|
...m,
|
|
@@ -1492,31 +1492,31 @@ function $({ icon: n, label: r, tooltip: i = !0, toggle: a, priority: o, more: s
|
|
|
1492
1492
|
"data-toolbar-shape": c,
|
|
1493
1493
|
"aria-label": r,
|
|
1494
1494
|
className: e("nxgt-toolbar-item", l),
|
|
1495
|
-
children:
|
|
1496
|
-
}, C = d === void 0 ? /* @__PURE__ */
|
|
1495
|
+
children: t
|
|
1496
|
+
}, C = d === void 0 ? /* @__PURE__ */ I(G, { ...S }) : /* @__PURE__ */ I(bt, {
|
|
1497
1497
|
...S,
|
|
1498
1498
|
value: d
|
|
1499
|
-
}), w = s?.kind === "popover" ? /* @__PURE__ */
|
|
1499
|
+
}), w = s?.kind === "popover" ? /* @__PURE__ */ I(_r, {
|
|
1500
1500
|
own: y,
|
|
1501
1501
|
folded: p
|
|
1502
1502
|
}) : null;
|
|
1503
|
-
return i ? /* @__PURE__ */
|
|
1503
|
+
return i ? /* @__PURE__ */ L(F, { children: [w, /* @__PURE__ */ I(_, {
|
|
1504
1504
|
content: r,
|
|
1505
|
-
open:
|
|
1505
|
+
open: h && !p,
|
|
1506
1506
|
onOpenChange: (e) => {
|
|
1507
|
-
e && v?.current ||
|
|
1507
|
+
e && v?.current || g(e);
|
|
1508
1508
|
},
|
|
1509
1509
|
children: C
|
|
1510
|
-
})] }) : /* @__PURE__ */
|
|
1510
|
+
})] }) : /* @__PURE__ */ L(F, { children: [w, C] });
|
|
1511
1511
|
}
|
|
1512
1512
|
//#endregion
|
|
1513
1513
|
//#region lib/components/ui/actions/toolbar/toolbar-items.tsx
|
|
1514
1514
|
function Cr(e) {
|
|
1515
|
-
return /* @__PURE__ */
|
|
1515
|
+
return /* @__PURE__ */ I(Sr, { ...e });
|
|
1516
1516
|
}
|
|
1517
1517
|
function wr({ pressed: e, defaultPressed: t = !1, onPressedChange: n, onClick: r, ...i }) {
|
|
1518
|
-
let [a, o] =
|
|
1519
|
-
return /* @__PURE__ */
|
|
1518
|
+
let [a, o] = P(t), s = e ?? a;
|
|
1519
|
+
return /* @__PURE__ */ I(Sr, {
|
|
1520
1520
|
...i,
|
|
1521
1521
|
toggle: !0,
|
|
1522
1522
|
"aria-pressed": s,
|
|
@@ -1526,15 +1526,15 @@ function wr({ pressed: e, defaultPressed: t = !1, onPressedChange: n, onClick: r
|
|
|
1526
1526
|
});
|
|
1527
1527
|
}
|
|
1528
1528
|
function Tr({ className: t }) {
|
|
1529
|
-
let { props: n } =
|
|
1529
|
+
let { props: n } = J({
|
|
1530
1530
|
label: "",
|
|
1531
1531
|
separator: !0
|
|
1532
1532
|
});
|
|
1533
|
-
return /* @__PURE__ */
|
|
1533
|
+
return /* @__PURE__ */ I(vt, {
|
|
1534
1534
|
...n,
|
|
1535
1535
|
"data-slot": "toolbar-separator",
|
|
1536
1536
|
className: e("nxgt-toolbar-separator", t)
|
|
1537
1537
|
});
|
|
1538
1538
|
}
|
|
1539
1539
|
//#endregion
|
|
1540
|
-
export {
|
|
1540
|
+
export { G as C, xt as S, Ze as T, Dt as _, yr as a, wt as b, hr as c, ir as d, Wn as f, J as g, Tt as h, Sr as i, mr as l, q as m, Tr as n, pr as o, Un as p, wr as r, gr as s, Cr as t, ar as u, Et as v, yt as w, Ct as x, St as y };
|