laif-ds 0.1.35 → 0.1.36
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/_virtual/index.js +5 -2
- package/dist/_virtual/index3.js +2 -7
- package/dist/_virtual/index4.js +2 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/_virtual/index6.js +5 -2
- package/dist/_virtual/index7.js +5 -2
- package/dist/_virtual/index8.js +5 -0
- package/dist/_virtual/index9.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js +5 -0
- package/dist/components/ui/checkbox.js +12 -12
- package/dist/components/ui/gantt/components/Chart/Chart.js +1 -1
- package/dist/components/ui/message-input.js +1 -1
- package/dist/components/ui/tables/data-cross-table/data-cross-table.js +348 -0
- package/dist/components/ui/tables/data-cross-table/edit-controls.js +47 -0
- package/dist/components/ui/tables/data-cross-table/editable-input.js +100 -0
- package/dist/components/ui/tables/data-cross-table/truncated-text.js +19 -0
- package/dist/index.d.ts +29 -3
- package/dist/index.js +1 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +126 -122
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +10 -6
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +44 -42
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +33 -43
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +237 -120
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +17 -16
- package/dist/node_modules/@radix-ui/react-context-menu/dist/index.js +95 -94
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +20 -19
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +3 -3
- package/dist/node_modules/@radix-ui/react-hover-card/dist/index.js +14 -13
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +136 -136
- package/dist/node_modules/@radix-ui/react-menubar/dist/index.js +70 -68
- package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.js +66 -64
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +10 -9
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +16 -16
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +11 -10
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +161 -146
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +87 -84
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +269 -257
- package/dist/node_modules/@radix-ui/react-slider/dist/index.js +3 -3
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +29 -28
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +101 -86
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +23 -22
- package/dist/node_modules/@radix-ui/react-toggle/dist/index.js +17 -16
- package/dist/node_modules/@radix-ui/react-toggle-group/dist/index.js +25 -23
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +77 -76
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +43 -21
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +18 -18
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +36 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +491 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +53 -0
- package/dist/node_modules/classnames/index.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/property-information/lib/html.js +9 -9
- package/dist/node_modules/react-hook-form/dist/index.esm.js +88 -88
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.js +830 -801
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
- package/dist/node_modules/remeda/dist/chunk-AIG3BDKO.js +9 -0
- package/dist/node_modules/remeda/dist/{chunk-A3PVMI4K.js → chunk-KI5X74E2.js} +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +3 -3
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +68 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +56 -0
- package/dist/node_modules/use-sync-external-store/shim/index.js +11 -0
- package/dist/styles.css +1 -1
- package/package.json +2 -1
- package/dist/components/ui/data-cross-table.js +0 -216
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-collection/dist/index.js +0 -49
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -138
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/dist/index.js +0 -625
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-popper/dist/index.js +0 -221
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-primitive/dist/index.js +0 -37
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -184
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-collection/dist/index.js +0 -49
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-primitive/dist/index.js +0 -33
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
- package/dist/node_modules/remeda/dist/chunk-OAMXQXGR.js +0 -9
|
@@ -30,29 +30,29 @@ var Q = ["Enter", " "], mt = ["ArrowDown", "PageUp", "Home"], _e = ["ArrowUp", "
|
|
|
30
30
|
ve,
|
|
31
31
|
ge
|
|
32
32
|
]), K = ve(), Re = ge(), [Se, E] = I(L), [gt, G] = I(L), Pe = (e) => {
|
|
33
|
-
const { __scopeMenu: n, open: t = !1, children: o, dir: s, onOpenChange:
|
|
33
|
+
const { __scopeMenu: n, open: t = !1, children: o, dir: s, onOpenChange: a, modal: l = !0 } = e, p = K(n), [M, m] = r.useState(null), f = r.useRef(!1), c = ee(a), d = Qe(s);
|
|
34
34
|
return r.useEffect(() => {
|
|
35
35
|
const C = () => {
|
|
36
|
-
|
|
37
|
-
}, v = () =>
|
|
36
|
+
f.current = !0, document.addEventListener("pointerdown", v, { capture: !0, once: !0 }), document.addEventListener("pointermove", v, { capture: !0, once: !0 });
|
|
37
|
+
}, v = () => f.current = !1;
|
|
38
38
|
return document.addEventListener("keydown", C, { capture: !0 }), () => {
|
|
39
39
|
document.removeEventListener("keydown", C, { capture: !0 }), document.removeEventListener("pointerdown", v, { capture: !0 }), document.removeEventListener("pointermove", v, { capture: !0 });
|
|
40
40
|
};
|
|
41
|
-
}, []), /* @__PURE__ */ u(Ce, { ...
|
|
41
|
+
}, []), /* @__PURE__ */ u(Ce, { ...p, children: /* @__PURE__ */ u(
|
|
42
42
|
Se,
|
|
43
43
|
{
|
|
44
44
|
scope: n,
|
|
45
45
|
open: t,
|
|
46
|
-
onOpenChange:
|
|
47
|
-
content:
|
|
48
|
-
onContentChange:
|
|
46
|
+
onOpenChange: c,
|
|
47
|
+
content: M,
|
|
48
|
+
onContentChange: m,
|
|
49
49
|
children: /* @__PURE__ */ u(
|
|
50
50
|
gt,
|
|
51
51
|
{
|
|
52
52
|
scope: n,
|
|
53
|
-
onClose: r.useCallback(() =>
|
|
54
|
-
isUsingKeyboardRef:
|
|
55
|
-
dir:
|
|
53
|
+
onClose: r.useCallback(() => c(!1), [c]),
|
|
54
|
+
isUsingKeyboardRef: f,
|
|
55
|
+
dir: d,
|
|
56
56
|
modal: l,
|
|
57
57
|
children: o
|
|
58
58
|
}
|
|
@@ -71,21 +71,21 @@ te.displayName = _t;
|
|
|
71
71
|
var ne = "MenuPortal", [Rt, Ee] = I(ne, {
|
|
72
72
|
forceMount: void 0
|
|
73
73
|
}), we = (e) => {
|
|
74
|
-
const { __scopeMenu: n, forceMount: t, children: o, container: s } = e,
|
|
75
|
-
return /* @__PURE__ */ u(Rt, { scope: n, forceMount: t, children: /* @__PURE__ */ u(W, { present: t ||
|
|
74
|
+
const { __scopeMenu: n, forceMount: t, children: o, container: s } = e, a = E(ne, n);
|
|
75
|
+
return /* @__PURE__ */ u(Rt, { scope: n, forceMount: t, children: /* @__PURE__ */ u(W, { present: t || a.open, children: /* @__PURE__ */ u(at, { asChild: !0, container: s, children: o }) }) });
|
|
76
76
|
};
|
|
77
77
|
we.displayName = ne;
|
|
78
78
|
var _ = "MenuContent", [St, oe] = I(_), Ie = r.forwardRef(
|
|
79
79
|
(e, n) => {
|
|
80
|
-
const t = Ee(_, e.__scopeMenu), { forceMount: o = t.forceMount, ...s } = e,
|
|
81
|
-
return /* @__PURE__ */ u(D.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(W, { present: o ||
|
|
80
|
+
const t = Ee(_, e.__scopeMenu), { forceMount: o = t.forceMount, ...s } = e, a = E(_, e.__scopeMenu), l = G(_, e.__scopeMenu);
|
|
81
|
+
return /* @__PURE__ */ u(D.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(W, { present: o || a.open, children: /* @__PURE__ */ u(D.Slot, { scope: e.__scopeMenu, children: l.modal ? /* @__PURE__ */ u(Pt, { ...s, ref: n }) : /* @__PURE__ */ u(Et, { ...s, ref: n }) }) }) });
|
|
82
82
|
}
|
|
83
83
|
), Pt = r.forwardRef(
|
|
84
84
|
(e, n) => {
|
|
85
85
|
const t = E(_, e.__scopeMenu), o = r.useRef(null), s = N(n, o);
|
|
86
86
|
return r.useEffect(() => {
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
87
|
+
const a = o.current;
|
|
88
|
+
if (a) return dt(a);
|
|
89
89
|
}, []), /* @__PURE__ */ u(
|
|
90
90
|
re,
|
|
91
91
|
{
|
|
@@ -96,7 +96,7 @@ var _ = "MenuContent", [St, oe] = I(_), Ie = r.forwardRef(
|
|
|
96
96
|
disableOutsideScroll: !0,
|
|
97
97
|
onFocusOutside: h(
|
|
98
98
|
e.onFocusOutside,
|
|
99
|
-
(
|
|
99
|
+
(a) => a.preventDefault(),
|
|
100
100
|
{ checkForDefaultPrevented: !1 }
|
|
101
101
|
),
|
|
102
102
|
onDismiss: () => t.onOpenChange(!1)
|
|
@@ -122,18 +122,18 @@ var _ = "MenuContent", [St, oe] = I(_), Ie = r.forwardRef(
|
|
|
122
122
|
__scopeMenu: t,
|
|
123
123
|
loop: o = !1,
|
|
124
124
|
trapFocus: s,
|
|
125
|
-
onOpenAutoFocus:
|
|
125
|
+
onOpenAutoFocus: a,
|
|
126
126
|
onCloseAutoFocus: l,
|
|
127
|
-
disableOutsidePointerEvents:
|
|
128
|
-
onEntryFocus:
|
|
129
|
-
onEscapeKeyDown:
|
|
130
|
-
onPointerDownOutside:
|
|
131
|
-
onFocusOutside:
|
|
132
|
-
onInteractOutside:
|
|
127
|
+
disableOutsidePointerEvents: p,
|
|
128
|
+
onEntryFocus: M,
|
|
129
|
+
onEscapeKeyDown: m,
|
|
130
|
+
onPointerDownOutside: f,
|
|
131
|
+
onFocusOutside: c,
|
|
132
|
+
onInteractOutside: d,
|
|
133
133
|
onDismiss: C,
|
|
134
134
|
disableOutsideScroll: v,
|
|
135
135
|
...w
|
|
136
|
-
} = e, y = E(_, t), T = G(_, t), U = K(t), B = Re(t), ie = vt(t), [Xe, le] = r.useState(null), V = r.useRef(null),
|
|
136
|
+
} = e, y = E(_, t), T = G(_, t), U = K(t), B = Re(t), ie = vt(t), [Xe, le] = r.useState(null), V = r.useRef(null), je = N(n, V, y.onContentChange), Y = r.useRef(0), X = r.useRef(""), He = r.useRef(0), Z = r.useRef(null), de = r.useRef("right"), $ = r.useRef(0), We = v ? ft : r.Fragment, ze = v ? { as: wt, allowPinchZoom: !0 } : void 0, Ze = (i) => {
|
|
137
137
|
var b, me;
|
|
138
138
|
const g = X.current + i, R = ie().filter((S) => !S.disabled), P = document.activeElement, q = (b = R.find((S) => S.ref.current === P)) == null ? void 0 : b.textValue, J = R.map((S) => S.textValue), fe = Lt(J, g, q), A = (me = R.find((S) => S.textValue === fe)) == null ? void 0 : me.ref.current;
|
|
139
139
|
(function S(pe) {
|
|
@@ -169,7 +169,7 @@ var _ = "MenuContent", [St, oe] = I(_), Ie = r.forwardRef(
|
|
|
169
169
|
},
|
|
170
170
|
[x]
|
|
171
171
|
),
|
|
172
|
-
pointerGraceTimerRef:
|
|
172
|
+
pointerGraceTimerRef: He,
|
|
173
173
|
onPointerGraceIntentChange: r.useCallback((i) => {
|
|
174
174
|
Z.current = i;
|
|
175
175
|
}, []),
|
|
@@ -178,7 +178,7 @@ var _ = "MenuContent", [St, oe] = I(_), Ie = r.forwardRef(
|
|
|
178
178
|
{
|
|
179
179
|
asChild: !0,
|
|
180
180
|
trapped: s,
|
|
181
|
-
onMountAutoFocus: h(
|
|
181
|
+
onMountAutoFocus: h(a, (i) => {
|
|
182
182
|
var g;
|
|
183
183
|
i.preventDefault(), (g = V.current) == null || g.focus({ preventScroll: !0 });
|
|
184
184
|
}),
|
|
@@ -187,11 +187,11 @@ var _ = "MenuContent", [St, oe] = I(_), Ie = r.forwardRef(
|
|
|
187
187
|
et,
|
|
188
188
|
{
|
|
189
189
|
asChild: !0,
|
|
190
|
-
disableOutsidePointerEvents:
|
|
191
|
-
onEscapeKeyDown:
|
|
192
|
-
onPointerDownOutside:
|
|
193
|
-
onFocusOutside:
|
|
194
|
-
onInteractOutside:
|
|
190
|
+
disableOutsidePointerEvents: p,
|
|
191
|
+
onEscapeKeyDown: m,
|
|
192
|
+
onPointerDownOutside: f,
|
|
193
|
+
onFocusOutside: c,
|
|
194
|
+
onInteractOutside: d,
|
|
195
195
|
onDismiss: C,
|
|
196
196
|
children: /* @__PURE__ */ u(
|
|
197
197
|
it,
|
|
@@ -203,7 +203,7 @@ var _ = "MenuContent", [St, oe] = I(_), Ie = r.forwardRef(
|
|
|
203
203
|
loop: o,
|
|
204
204
|
currentTabStopId: Xe,
|
|
205
205
|
onCurrentTabStopIdChange: le,
|
|
206
|
-
onEntryFocus: h(
|
|
206
|
+
onEntryFocus: h(M, (i) => {
|
|
207
207
|
T.isUsingKeyboardRef.current || i.preventDefault();
|
|
208
208
|
}),
|
|
209
209
|
preventScrollOnEntryFocus: !0,
|
|
@@ -217,7 +217,7 @@ var _ = "MenuContent", [St, oe] = I(_), Ie = r.forwardRef(
|
|
|
217
217
|
dir: T.dir,
|
|
218
218
|
...U,
|
|
219
219
|
...w,
|
|
220
|
-
ref:
|
|
220
|
+
ref: je,
|
|
221
221
|
style: { outline: "none", ...w.style },
|
|
222
222
|
onKeyDown: h(w.onKeyDown, (i) => {
|
|
223
223
|
const R = i.target.closest("[data-radix-menu-content]") === i.currentTarget, P = i.ctrlKey || i.altKey || i.metaKey, q = i.key.length === 1;
|
|
@@ -268,60 +268,60 @@ var yt = "MenuLabel", ye = r.forwardRef(
|
|
|
268
268
|
}
|
|
269
269
|
);
|
|
270
270
|
ye.displayName = yt;
|
|
271
|
-
var
|
|
271
|
+
var j = "MenuItem", he = "menu.itemSelect", z = r.forwardRef(
|
|
272
272
|
(e, n) => {
|
|
273
|
-
const { disabled: t = !1, onSelect: o, ...s } = e,
|
|
274
|
-
const
|
|
275
|
-
if (!t &&
|
|
276
|
-
const
|
|
277
|
-
|
|
273
|
+
const { disabled: t = !1, onSelect: o, ...s } = e, a = r.useRef(null), l = G(j, e.__scopeMenu), p = oe(j, e.__scopeMenu), M = N(n, a), m = r.useRef(!1), f = () => {
|
|
274
|
+
const c = a.current;
|
|
275
|
+
if (!t && c) {
|
|
276
|
+
const d = new CustomEvent(he, { bubbles: !0, cancelable: !0 });
|
|
277
|
+
c.addEventListener(he, (C) => o == null ? void 0 : o(C), { once: !0 }), st(c, d), d.defaultPrevented ? m.current = !1 : l.onClose();
|
|
278
278
|
}
|
|
279
279
|
};
|
|
280
280
|
return /* @__PURE__ */ u(
|
|
281
281
|
xe,
|
|
282
282
|
{
|
|
283
283
|
...s,
|
|
284
|
-
ref:
|
|
284
|
+
ref: M,
|
|
285
285
|
disabled: t,
|
|
286
|
-
onClick: h(e.onClick,
|
|
287
|
-
onPointerDown: (
|
|
288
|
-
var
|
|
289
|
-
(
|
|
286
|
+
onClick: h(e.onClick, f),
|
|
287
|
+
onPointerDown: (c) => {
|
|
288
|
+
var d;
|
|
289
|
+
(d = e.onPointerDown) == null || d.call(e, c), m.current = !0;
|
|
290
290
|
},
|
|
291
|
-
onPointerUp: h(e.onPointerUp, (
|
|
292
|
-
var
|
|
293
|
-
|
|
291
|
+
onPointerUp: h(e.onPointerUp, (c) => {
|
|
292
|
+
var d;
|
|
293
|
+
m.current || (d = c.currentTarget) == null || d.click();
|
|
294
294
|
}),
|
|
295
|
-
onKeyDown: h(e.onKeyDown, (
|
|
296
|
-
const
|
|
297
|
-
t ||
|
|
295
|
+
onKeyDown: h(e.onKeyDown, (c) => {
|
|
296
|
+
const d = p.searchRef.current !== "";
|
|
297
|
+
t || d && c.key === " " || Q.includes(c.key) && (c.currentTarget.click(), c.preventDefault());
|
|
298
298
|
})
|
|
299
299
|
}
|
|
300
300
|
);
|
|
301
301
|
}
|
|
302
302
|
);
|
|
303
|
-
z.displayName =
|
|
303
|
+
z.displayName = j;
|
|
304
304
|
var xe = r.forwardRef(
|
|
305
305
|
(e, n) => {
|
|
306
|
-
const { __scopeMenu: t, disabled: o = !1, textValue: s, ...
|
|
306
|
+
const { __scopeMenu: t, disabled: o = !1, textValue: s, ...a } = e, l = oe(j, t), p = Re(t), M = r.useRef(null), m = N(n, M), [f, c] = r.useState(!1), [d, C] = r.useState("");
|
|
307
307
|
return r.useEffect(() => {
|
|
308
|
-
const v =
|
|
308
|
+
const v = M.current;
|
|
309
309
|
v && C((v.textContent ?? "").trim());
|
|
310
|
-
}, [
|
|
310
|
+
}, [a.children]), /* @__PURE__ */ u(
|
|
311
311
|
D.ItemSlot,
|
|
312
312
|
{
|
|
313
313
|
scope: t,
|
|
314
314
|
disabled: o,
|
|
315
|
-
textValue: s ??
|
|
316
|
-
children: /* @__PURE__ */ u(ut, { asChild: !0, ...
|
|
315
|
+
textValue: s ?? d,
|
|
316
|
+
children: /* @__PURE__ */ u(ut, { asChild: !0, ...p, focusable: !o, children: /* @__PURE__ */ u(
|
|
317
317
|
F.div,
|
|
318
318
|
{
|
|
319
319
|
role: "menuitem",
|
|
320
|
-
"data-highlighted":
|
|
320
|
+
"data-highlighted": f ? "" : void 0,
|
|
321
321
|
"aria-disabled": o || void 0,
|
|
322
322
|
"data-disabled": o ? "" : void 0,
|
|
323
|
-
...
|
|
324
|
-
ref:
|
|
323
|
+
...a,
|
|
324
|
+
ref: m,
|
|
325
325
|
onPointerMove: h(
|
|
326
326
|
e.onPointerMove,
|
|
327
327
|
k((v) => {
|
|
@@ -332,8 +332,8 @@ var xe = r.forwardRef(
|
|
|
332
332
|
e.onPointerLeave,
|
|
333
333
|
k((v) => l.onItemLeave(v))
|
|
334
334
|
),
|
|
335
|
-
onFocus: h(e.onFocus, () =>
|
|
336
|
-
onBlur: h(e.onBlur, () =>
|
|
335
|
+
onFocus: h(e.onFocus, () => c(!0)),
|
|
336
|
+
onBlur: h(e.onBlur, () => c(!1))
|
|
337
337
|
}
|
|
338
338
|
) })
|
|
339
339
|
}
|
|
@@ -346,13 +346,13 @@ var xe = r.forwardRef(
|
|
|
346
346
|
z,
|
|
347
347
|
{
|
|
348
348
|
role: "menuitemcheckbox",
|
|
349
|
-
"aria-checked":
|
|
349
|
+
"aria-checked": H(t) ? "mixed" : t,
|
|
350
350
|
...s,
|
|
351
351
|
ref: n,
|
|
352
352
|
"data-state": ue(t),
|
|
353
353
|
onSelect: h(
|
|
354
354
|
s.onSelect,
|
|
355
|
-
() => o == null ? void 0 : o(
|
|
355
|
+
() => o == null ? void 0 : o(H(t) ? !0 : !t),
|
|
356
356
|
{ checkForDefaultPrevented: !1 }
|
|
357
357
|
)
|
|
358
358
|
}
|
|
@@ -366,22 +366,22 @@ var Te = "MenuRadioGroup", [bt, Tt] = I(
|
|
|
366
366
|
} }
|
|
367
367
|
), Ae = r.forwardRef(
|
|
368
368
|
(e, n) => {
|
|
369
|
-
const { value: t, onValueChange: o, ...s } = e,
|
|
370
|
-
return /* @__PURE__ */ u(bt, { scope: e.__scopeMenu, value: t, onValueChange:
|
|
369
|
+
const { value: t, onValueChange: o, ...s } = e, a = ee(o);
|
|
370
|
+
return /* @__PURE__ */ u(bt, { scope: e.__scopeMenu, value: t, onValueChange: a, children: /* @__PURE__ */ u(ce, { ...s, ref: n }) });
|
|
371
371
|
}
|
|
372
372
|
);
|
|
373
373
|
Ae.displayName = Te;
|
|
374
374
|
var Oe = "MenuRadioItem", De = r.forwardRef(
|
|
375
375
|
(e, n) => {
|
|
376
|
-
const { value: t, ...o } = e, s = Tt(Oe, e.__scopeMenu),
|
|
377
|
-
return /* @__PURE__ */ u(ke, { scope: e.__scopeMenu, checked:
|
|
376
|
+
const { value: t, ...o } = e, s = Tt(Oe, e.__scopeMenu), a = t === s.value;
|
|
377
|
+
return /* @__PURE__ */ u(ke, { scope: e.__scopeMenu, checked: a, children: /* @__PURE__ */ u(
|
|
378
378
|
z,
|
|
379
379
|
{
|
|
380
380
|
role: "menuitemradio",
|
|
381
|
-
"aria-checked":
|
|
381
|
+
"aria-checked": a,
|
|
382
382
|
...o,
|
|
383
383
|
ref: n,
|
|
384
|
-
"data-state": ue(
|
|
384
|
+
"data-state": ue(a),
|
|
385
385
|
onSelect: h(
|
|
386
386
|
o.onSelect,
|
|
387
387
|
() => {
|
|
@@ -400,17 +400,17 @@ var ae = "MenuItemIndicator", [ke, At] = I(
|
|
|
400
400
|
{ checked: !1 }
|
|
401
401
|
), Ne = r.forwardRef(
|
|
402
402
|
(e, n) => {
|
|
403
|
-
const { __scopeMenu: t, forceMount: o, ...s } = e,
|
|
403
|
+
const { __scopeMenu: t, forceMount: o, ...s } = e, a = At(ae, t);
|
|
404
404
|
return /* @__PURE__ */ u(
|
|
405
405
|
W,
|
|
406
406
|
{
|
|
407
|
-
present: o ||
|
|
407
|
+
present: o || H(a.checked) || a.checked === !0,
|
|
408
408
|
children: /* @__PURE__ */ u(
|
|
409
409
|
F.span,
|
|
410
410
|
{
|
|
411
411
|
...s,
|
|
412
412
|
ref: n,
|
|
413
|
-
"data-state": ue(
|
|
413
|
+
"data-state": ue(a.checked)
|
|
414
414
|
}
|
|
415
415
|
)
|
|
416
416
|
}
|
|
@@ -441,23 +441,23 @@ var Dt = "MenuArrow", Le = r.forwardRef(
|
|
|
441
441
|
);
|
|
442
442
|
Le.displayName = Dt;
|
|
443
443
|
var se = "MenuSub", [kt, Ke] = I(se), Ge = (e) => {
|
|
444
|
-
const { __scopeMenu: n, children: t, open: o = !1, onOpenChange: s } = e,
|
|
445
|
-
return r.useEffect(() => (
|
|
444
|
+
const { __scopeMenu: n, children: t, open: o = !1, onOpenChange: s } = e, a = E(se, n), l = K(n), [p, M] = r.useState(null), [m, f] = r.useState(null), c = ee(s);
|
|
445
|
+
return r.useEffect(() => (a.open === !1 && c(!1), () => c(!1)), [a.open, c]), /* @__PURE__ */ u(Ce, { ...l, children: /* @__PURE__ */ u(
|
|
446
446
|
Se,
|
|
447
447
|
{
|
|
448
448
|
scope: n,
|
|
449
449
|
open: o,
|
|
450
|
-
onOpenChange:
|
|
451
|
-
content:
|
|
452
|
-
onContentChange:
|
|
450
|
+
onOpenChange: c,
|
|
451
|
+
content: m,
|
|
452
|
+
onContentChange: f,
|
|
453
453
|
children: /* @__PURE__ */ u(
|
|
454
454
|
kt,
|
|
455
455
|
{
|
|
456
456
|
scope: n,
|
|
457
457
|
contentId: Me(),
|
|
458
458
|
triggerId: Me(),
|
|
459
|
-
trigger:
|
|
460
|
-
onTriggerChange:
|
|
459
|
+
trigger: p,
|
|
460
|
+
onTriggerChange: M,
|
|
461
461
|
children: t
|
|
462
462
|
}
|
|
463
463
|
)
|
|
@@ -467,15 +467,15 @@ var se = "MenuSub", [kt, Ke] = I(se), Ge = (e) => {
|
|
|
467
467
|
Ge.displayName = se;
|
|
468
468
|
var O = "MenuSubTrigger", Ue = r.forwardRef(
|
|
469
469
|
(e, n) => {
|
|
470
|
-
const t = E(O, e.__scopeMenu), o = G(O, e.__scopeMenu), s = Ke(O, e.__scopeMenu),
|
|
470
|
+
const t = E(O, e.__scopeMenu), o = G(O, e.__scopeMenu), s = Ke(O, e.__scopeMenu), a = oe(O, e.__scopeMenu), l = r.useRef(null), { pointerGraceTimerRef: p, onPointerGraceIntentChange: M } = a, m = { __scopeMenu: e.__scopeMenu }, f = r.useCallback(() => {
|
|
471
471
|
l.current && window.clearTimeout(l.current), l.current = null;
|
|
472
472
|
}, []);
|
|
473
|
-
return r.useEffect(() =>
|
|
474
|
-
const
|
|
473
|
+
return r.useEffect(() => f, [f]), r.useEffect(() => {
|
|
474
|
+
const c = p.current;
|
|
475
475
|
return () => {
|
|
476
|
-
window.clearTimeout(
|
|
476
|
+
window.clearTimeout(c), M(null);
|
|
477
477
|
};
|
|
478
|
-
}, [
|
|
478
|
+
}, [p, M]), /* @__PURE__ */ u(te, { asChild: !0, ...m, children: /* @__PURE__ */ u(
|
|
479
479
|
xe,
|
|
480
480
|
{
|
|
481
481
|
id: s.triggerId,
|
|
@@ -485,51 +485,51 @@ var O = "MenuSubTrigger", Ue = r.forwardRef(
|
|
|
485
485
|
"data-state": Ye(t.open),
|
|
486
486
|
...e,
|
|
487
487
|
ref: qe(n, s.onTriggerChange),
|
|
488
|
-
onClick: (
|
|
489
|
-
var
|
|
490
|
-
(
|
|
488
|
+
onClick: (c) => {
|
|
489
|
+
var d;
|
|
490
|
+
(d = e.onClick) == null || d.call(e, c), !(e.disabled || c.defaultPrevented) && (c.currentTarget.focus(), t.open || t.onOpenChange(!0));
|
|
491
491
|
},
|
|
492
492
|
onPointerMove: h(
|
|
493
493
|
e.onPointerMove,
|
|
494
|
-
k((
|
|
495
|
-
|
|
496
|
-
t.onOpenChange(!0),
|
|
494
|
+
k((c) => {
|
|
495
|
+
a.onItemEnter(c), !c.defaultPrevented && !e.disabled && !t.open && !l.current && (a.onPointerGraceIntentChange(null), l.current = window.setTimeout(() => {
|
|
496
|
+
t.onOpenChange(!0), f();
|
|
497
497
|
}, 100));
|
|
498
498
|
})
|
|
499
499
|
),
|
|
500
500
|
onPointerLeave: h(
|
|
501
501
|
e.onPointerLeave,
|
|
502
|
-
k((
|
|
502
|
+
k((c) => {
|
|
503
503
|
var C, v;
|
|
504
|
-
|
|
505
|
-
const
|
|
506
|
-
if (
|
|
507
|
-
const w = (v = t.content) == null ? void 0 : v.dataset.side, y = w === "right", T = y ? -5 : 5, U =
|
|
508
|
-
|
|
504
|
+
f();
|
|
505
|
+
const d = (C = t.content) == null ? void 0 : C.getBoundingClientRect();
|
|
506
|
+
if (d) {
|
|
507
|
+
const w = (v = t.content) == null ? void 0 : v.dataset.side, y = w === "right", T = y ? -5 : 5, U = d[y ? "left" : "right"], B = d[y ? "right" : "left"];
|
|
508
|
+
a.onPointerGraceIntentChange({
|
|
509
509
|
area: [
|
|
510
510
|
// Apply a bleed on clientX to ensure that our exit point is
|
|
511
511
|
// consistently within polygon bounds
|
|
512
|
-
{ x:
|
|
513
|
-
{ x: U, y:
|
|
514
|
-
{ x: B, y:
|
|
515
|
-
{ x: B, y:
|
|
516
|
-
{ x: U, y:
|
|
512
|
+
{ x: c.clientX + T, y: c.clientY },
|
|
513
|
+
{ x: U, y: d.top },
|
|
514
|
+
{ x: B, y: d.top },
|
|
515
|
+
{ x: B, y: d.bottom },
|
|
516
|
+
{ x: U, y: d.bottom }
|
|
517
517
|
],
|
|
518
518
|
side: w
|
|
519
|
-
}), window.clearTimeout(
|
|
520
|
-
() =>
|
|
519
|
+
}), window.clearTimeout(p.current), p.current = window.setTimeout(
|
|
520
|
+
() => a.onPointerGraceIntentChange(null),
|
|
521
521
|
300
|
|
522
522
|
);
|
|
523
523
|
} else {
|
|
524
|
-
if (
|
|
525
|
-
|
|
524
|
+
if (a.onTriggerLeave(c), c.defaultPrevented) return;
|
|
525
|
+
a.onPointerGraceIntentChange(null);
|
|
526
526
|
}
|
|
527
527
|
})
|
|
528
528
|
),
|
|
529
|
-
onKeyDown: h(e.onKeyDown, (
|
|
529
|
+
onKeyDown: h(e.onKeyDown, (c) => {
|
|
530
530
|
var C;
|
|
531
|
-
const
|
|
532
|
-
e.disabled ||
|
|
531
|
+
const d = a.searchRef.current !== "";
|
|
532
|
+
e.disabled || d && c.key === " " || Mt[o.dir].includes(c.key) && (t.onOpenChange(!0), (C = t.content) == null || C.focus(), c.preventDefault());
|
|
533
533
|
})
|
|
534
534
|
}
|
|
535
535
|
) });
|
|
@@ -538,34 +538,34 @@ var O = "MenuSubTrigger", Ue = r.forwardRef(
|
|
|
538
538
|
Ue.displayName = O;
|
|
539
539
|
var Be = "MenuSubContent", Ve = r.forwardRef(
|
|
540
540
|
(e, n) => {
|
|
541
|
-
const t = Ee(_, e.__scopeMenu), { forceMount: o = t.forceMount, ...s } = e,
|
|
542
|
-
return /* @__PURE__ */ u(D.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(W, { present: o ||
|
|
541
|
+
const t = Ee(_, e.__scopeMenu), { forceMount: o = t.forceMount, ...s } = e, a = E(_, e.__scopeMenu), l = G(_, e.__scopeMenu), p = Ke(Be, e.__scopeMenu), M = r.useRef(null), m = N(n, M);
|
|
542
|
+
return /* @__PURE__ */ u(D.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(W, { present: o || a.open, children: /* @__PURE__ */ u(D.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ u(
|
|
543
543
|
re,
|
|
544
544
|
{
|
|
545
|
-
id:
|
|
546
|
-
"aria-labelledby":
|
|
545
|
+
id: p.contentId,
|
|
546
|
+
"aria-labelledby": p.triggerId,
|
|
547
547
|
...s,
|
|
548
|
-
ref:
|
|
548
|
+
ref: m,
|
|
549
549
|
align: "start",
|
|
550
550
|
side: l.dir === "rtl" ? "left" : "right",
|
|
551
551
|
disableOutsidePointerEvents: !1,
|
|
552
552
|
disableOutsideScroll: !1,
|
|
553
553
|
trapFocus: !1,
|
|
554
|
-
onOpenAutoFocus: (
|
|
555
|
-
var
|
|
556
|
-
l.isUsingKeyboardRef.current && ((
|
|
554
|
+
onOpenAutoFocus: (f) => {
|
|
555
|
+
var c;
|
|
556
|
+
l.isUsingKeyboardRef.current && ((c = M.current) == null || c.focus()), f.preventDefault();
|
|
557
557
|
},
|
|
558
|
-
onCloseAutoFocus: (
|
|
559
|
-
onFocusOutside: h(e.onFocusOutside, (
|
|
560
|
-
|
|
558
|
+
onCloseAutoFocus: (f) => f.preventDefault(),
|
|
559
|
+
onFocusOutside: h(e.onFocusOutside, (f) => {
|
|
560
|
+
f.target !== p.trigger && a.onOpenChange(!1);
|
|
561
561
|
}),
|
|
562
|
-
onEscapeKeyDown: h(e.onEscapeKeyDown, (
|
|
563
|
-
l.onClose(),
|
|
562
|
+
onEscapeKeyDown: h(e.onEscapeKeyDown, (f) => {
|
|
563
|
+
l.onClose(), f.preventDefault();
|
|
564
564
|
}),
|
|
565
|
-
onKeyDown: h(e.onKeyDown, (
|
|
565
|
+
onKeyDown: h(e.onKeyDown, (f) => {
|
|
566
566
|
var C;
|
|
567
|
-
const
|
|
568
|
-
|
|
567
|
+
const c = f.currentTarget.contains(f.target), d = ht[l.dir].includes(f.key);
|
|
568
|
+
c && d && (a.onOpenChange(!1), (C = p.trigger) == null || C.focus(), f.preventDefault());
|
|
569
569
|
})
|
|
570
570
|
}
|
|
571
571
|
) }) }) });
|
|
@@ -575,11 +575,11 @@ Ve.displayName = Be;
|
|
|
575
575
|
function Ye(e) {
|
|
576
576
|
return e ? "open" : "closed";
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function H(e) {
|
|
579
579
|
return e === "indeterminate";
|
|
580
580
|
}
|
|
581
581
|
function ue(e) {
|
|
582
|
-
return
|
|
582
|
+
return H(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
583
583
|
}
|
|
584
584
|
function Nt(e) {
|
|
585
585
|
const n = document.activeElement;
|
|
@@ -590,20 +590,20 @@ function Ft(e, n) {
|
|
|
590
590
|
return e.map((t, o) => e[(n + o) % e.length]);
|
|
591
591
|
}
|
|
592
592
|
function Lt(e, n, t) {
|
|
593
|
-
const s = n.length > 1 && Array.from(n).every((
|
|
594
|
-
let l = Ft(e, Math.max(
|
|
595
|
-
s.length === 1 && (l = l.filter((
|
|
596
|
-
const
|
|
597
|
-
(
|
|
593
|
+
const s = n.length > 1 && Array.from(n).every((m) => m === n[0]) ? n[0] : n, a = t ? e.indexOf(t) : -1;
|
|
594
|
+
let l = Ft(e, Math.max(a, 0));
|
|
595
|
+
s.length === 1 && (l = l.filter((m) => m !== t));
|
|
596
|
+
const M = l.find(
|
|
597
|
+
(m) => m.toLowerCase().startsWith(s.toLowerCase())
|
|
598
598
|
);
|
|
599
|
-
return
|
|
599
|
+
return M !== t ? M : void 0;
|
|
600
600
|
}
|
|
601
601
|
function Kt(e, n) {
|
|
602
602
|
const { x: t, y: o } = e;
|
|
603
603
|
let s = !1;
|
|
604
|
-
for (let
|
|
605
|
-
const
|
|
606
|
-
|
|
604
|
+
for (let a = 0, l = n.length - 1; a < n.length; l = a++) {
|
|
605
|
+
const p = n[a], M = n[l], m = p.x, f = p.y, c = M.x, d = M.y;
|
|
606
|
+
f > o != d > o && t < (c - m) * (o - f) / (d - f) + m && (s = !s);
|
|
607
607
|
}
|
|
608
608
|
return s;
|
|
609
609
|
}
|