@sheetxl/utils-mui 0.7.20 → 0.7.21
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/browser/cjs/{CBMcqj89EmkYK4QZ.cjs → Ai0ovAjYzGfMAB7q.cjs} +2 -2
- package/browser/cjs/{Ds-zDMzIo58PsNJN.cjs → L-4HMtCOn7QHkDi2.cjs} +5 -5
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{DKlg3IQeFd2TyIin.mjs → BqMhjTIvQt09x92t.mjs} +280 -280
- package/browser/esm/{ZqVDSTfuXZ_0OkpP.mjs → CMpdAXnJ5EbLrOu2.mjs} +7 -7
- package/browser/esm/index.mjs +21 -21
- package/node/esm/index.mjs +284 -284
- package/node/esm/{CPdz45mNqmqcdw72.mjs → ojE1YgJ2zWQ8Q_AP.mjs} +6 -6
- package/package.json +3 -3
- package/types/index.d.ts +26 -27
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import q, { memo as ie, forwardRef as de, version as To, useLayoutEffect as Cr, useEffect as
|
|
1
|
+
import q, { memo as ie, forwardRef as de, version as To, useLayoutEffect as Cr, useEffect as Se, useState as re, useMemo as Z, useRef as ge, useImperativeHandle as Po, useCallback as _e, createContext as Ro, Suspense as No, Fragment as Fo, useContext as _o, useReducer as Ao } from "react";
|
|
2
2
|
import { jsx as k, jsxs as J, Fragment as Je } from "react/jsx-runtime";
|
|
3
3
|
import { alpha as me, darken as Io, lighten as Vo } from "@mui/system";
|
|
4
4
|
import { IconButton as Ze, Divider as Er, Box as K, Typography as Me, Paper as Et, Chip as Lo, Popper as Bo, Grow as jo, Tooltip as $o, ListItemIcon as zo, MenuItem as Mr, Fade as Wo, Backdrop as Ho, DialogTitle as Uo, Button as Yo, DialogContent as Go, DialogActions as Ko, Input as Xo, Toolbar as qo } from "@mui/material";
|
|
@@ -8,7 +8,7 @@ import { useTheme as dn, styled as ei, createTheme as On, useThemeProps as ti }
|
|
|
8
8
|
import { deepmerge as Pr } from "@mui/utils";
|
|
9
9
|
import Rr, { createPortal as ni } from "react-dom";
|
|
10
10
|
/**
|
|
11
|
-
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.
|
|
11
|
+
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.21
|
|
12
12
|
*
|
|
13
13
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
14
14
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -81,7 +81,7 @@ function Ir(e) {
|
|
|
81
81
|
} });
|
|
82
82
|
}), n;
|
|
83
83
|
}
|
|
84
|
-
var Vr = _r ? Cr :
|
|
84
|
+
var Vr = _r ? Cr : Se, Cn = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
|
|
85
85
|
const En = _r && window.ResizeObserver !== void 0 ? function() {
|
|
86
86
|
var e = re(null), r = e[0], n = e[1], t = re(Cn), s = t[0], a = t[1], o = Z(function() {
|
|
87
87
|
return new window.ResizeObserver(function(l) {
|
|
@@ -135,7 +135,7 @@ const En = _r && window.ResizeObserver !== void 0 ? function() {
|
|
|
135
135
|
return () => {
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
}, [b.current]),
|
|
138
|
+
}, [b.current]), Se(() => () => {
|
|
139
139
|
h.current && (b.current?.classList.remove("animating"), h.current = !1, f.current = !1, a?.());
|
|
140
140
|
}, []), v;
|
|
141
141
|
}));
|
|
@@ -384,7 +384,7 @@ function yi(e, r) {
|
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
return V;
|
|
387
|
-
})({ reference: O, element: E, placement: a }),
|
|
387
|
+
})({ reference: O, element: E, placement: a }), S = nn(Object.assign({}, E, P)), D = b === ht ? S : O, _ = { top: L.top - D.top + u.top, bottom: D.bottom - L.bottom + u.bottom, left: L.left - D.left + u.left, right: D.right - L.right + u.right }, M = e.modifiersData.offset;
|
|
388
388
|
if (b === ht && M) {
|
|
389
389
|
var F = M[a];
|
|
390
390
|
Object.keys(_).forEach(function(A) {
|
|
@@ -409,13 +409,13 @@ const bi = { name: "maxSize", enabled: !0, phase: "main", requiresIfExists: ["of
|
|
|
409
409
|
return v && G.unshift(bi, y), G;
|
|
410
410
|
}, [v, o]), [w, E] = re(!1), T = q.useRef(null), L = ae(() => {
|
|
411
411
|
c?.(F.current, T.current);
|
|
412
|
-
}, [d]), O = ae(d, [d]), P = ae(x, [x]),
|
|
412
|
+
}, [d]), O = ae(d, [d]), P = ae(x, [x]), S = ae(m, [m]), D = ae(() => {
|
|
413
413
|
E(!1), b?.();
|
|
414
414
|
}, [b]), [_, M] = re(!1), F = q.useRef(null), A = q.useRef(!0), V = Z(() => ({ onFirstUpdate: () => {
|
|
415
415
|
A.current && (M(!0), L?.(), A.current = !1);
|
|
416
416
|
} }), [t, w]);
|
|
417
|
-
|
|
418
|
-
t && _ ? O?.() : !t && w &&
|
|
417
|
+
Se(() => {
|
|
418
|
+
t && _ ? O?.() : !t && w && S?.(), t && E(t);
|
|
419
419
|
}, [t, _]);
|
|
420
420
|
const B = Z(() => ({ getBoundingClientRect: () => i ? new DOMRect(i?.left || 0, i?.top || 0, 0, 0) : l.getBoundingClientRect() }), [i, l]);
|
|
421
421
|
Po(r, () => ({ instance: () => T.current, element: () => F.current }), []);
|
|
@@ -425,7 +425,7 @@ const bi = { name: "maxSize", enabled: !0, phase: "main", requiresIfExists: ["of
|
|
|
425
425
|
return k(jo, { ...ce, in: t, onEnter: () => {
|
|
426
426
|
te?.(), P();
|
|
427
427
|
}, onExited: () => {
|
|
428
|
-
le?.(),
|
|
428
|
+
le?.(), D();
|
|
429
429
|
}, timeout: { enter: f.transitions.duration.shorter, exit: 0 }, style: { transformOrigin: Q === "bottom-start" ? "left top" : "center bottom" }, children: typeof s == "function" ? s({ TransitionProps: G, placement: Q, ...oe }) : s || Te.EmptyArray });
|
|
430
430
|
} });
|
|
431
431
|
}));
|
|
@@ -438,10 +438,10 @@ const ds = (e) => {
|
|
|
438
438
|
const n = r.palette.mode === "dark" ? r.palette.text.primary : r.palette.divider;
|
|
439
439
|
return `drop-shadow(0px 0px ${e}px ${n})`;
|
|
440
440
|
}, Kr = (e) => k(ye, { ...e, iconKey: "ArrowDownOutline" }), xi = (e) => k(ye, { ...e, iconKey: "ArrowRightOutline" }), fs = ei(ie(de((e, r) => {
|
|
441
|
-
const { sx: n, size: t = "
|
|
442
|
-
let i = "
|
|
443
|
-
return t === "
|
|
444
|
-
})))(({ theme: e }) => ({ fill: "currentColor", "& .activeColor": { fill: e.palette.primary.main }, "& .styled.high_contrast": { fill: e.palette.primary.main }, "& .styled.background": { fill: e.palette.background.paper }, "& .styled.current_color": { fill: "currentColor" }, "& .styled.secondary": { fill: e.palette.secondary.main }, "& .styled.secondary_dark": { fill: e.palette.secondary.dark }, "& .styled.secondary_light": { fill: e.palette.secondary.light }, "& .styled.info": { fill: e.palette.info.main }, "& .styled.info.stroked": { stroke: e.palette.info.main }, "& .styled.info_dark": { fill: e.palette.info.dark }, "& .styled.info_light": { fill: e.palette.info.light }, "& .styled.warning": { fill: e.palette.warning.main }, "& .styled.warning.stroked": { stroke: e.palette.warning.main }, "& .styled.warning_dark": { fill: e.palette.warning.dark }, "& .styled.warning_light": { fill: e.palette.warning.light }, "& .styled.error.info": { fill: e.palette.error.main }, "& .styled.error.stroked": { stroke: e.palette.error.main }, "& .styled.error_dark": { fill: e.palette.error.dark }, "& .styled.error_light": { fill: e.palette.error.light }, "& .styled.success": { fill: e.palette.success.main }, "& .styled.success_dark": { fill: e.palette.success.dark }, "& .styled.success_light": { fill: e.palette.success.light }, "& .styled.grey": { fill: e.palette.text.icon ?? e.palette.action.active } })), wi = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, ki = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,
|
|
441
|
+
const { sx: n, size: t = "medium", activeColor: s, children: a, className: o, ...l } = e;
|
|
442
|
+
let i = "var(--icon-size)";
|
|
443
|
+
return t === "small" ? i = "calc(var(--icon-size-sm) * .875)" : t === "large" && (i = "calc(var(--icon-size-lg) * 1.5)"), k(K, { ref: r, className: Oe("icon", o), sx: { width: "var(--icon-size)", height: "var(--icon-size)", "--icon-size-adj": i, ...n }, ...l, children: a });
|
|
444
|
+
})))(({ theme: e }) => ({ fontSize: "var(--icon-size-adj)", minWidth: "var(--icon-size-adj)", minHeight: "var(--icon-size-adj)", fill: "currentColor", "& .activeColor": { fill: e.palette.primary.main }, "& .styled.high_contrast": { fill: e.palette.primary.main }, "& .styled.background": { fill: e.palette.background.paper }, "& .styled.current_color": { fill: "currentColor" }, "& .styled.secondary": { fill: e.palette.secondary.main }, "& .styled.secondary_dark": { fill: e.palette.secondary.dark }, "& .styled.secondary_light": { fill: e.palette.secondary.light }, "& .styled.info": { fill: e.palette.info.main }, "& .styled.info.stroked": { stroke: e.palette.info.main }, "& .styled.info_dark": { fill: e.palette.info.dark }, "& .styled.info_light": { fill: e.palette.info.light }, "& .styled.warning": { fill: e.palette.warning.main }, "& .styled.warning.stroked": { stroke: e.palette.warning.main }, "& .styled.warning_dark": { fill: e.palette.warning.dark }, "& .styled.warning_light": { fill: e.palette.warning.light }, "& .styled.error.info": { fill: e.palette.error.main }, "& .styled.error.stroked": { stroke: e.palette.error.main }, "& .styled.error_dark": { fill: e.palette.error.dark }, "& .styled.error_light": { fill: e.palette.error.light }, "& .styled.success": { fill: e.palette.success.main }, "& .styled.success_dark": { fill: e.palette.success.dark }, "& .styled.success_light": { fill: e.palette.success.light }, "& .styled.grey": { fill: e.palette.text.icon ?? e.palette.action.active } })), wi = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, ki = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i, Si = function(e, r = null) {
|
|
445
445
|
if (!e) return e;
|
|
446
446
|
e = e.replace(wi, function(t, s, a, o) {
|
|
447
447
|
return s + s + a + a + o + o;
|
|
@@ -451,7 +451,7 @@ const ds = (e) => {
|
|
|
451
451
|
}, _n = function(e, r = 0.2, n = "light") {
|
|
452
452
|
if (!e) return e;
|
|
453
453
|
let t = n !== "dark";
|
|
454
|
-
return r < 0 && (t = !t, r *= -1), e =
|
|
454
|
+
return r < 0 && (t = !t, r *= -1), e = Si(e), t ? Io(e, Math.max(0, Math.min(1, 1 * r))) : Vo(e, Math.max(0, Math.min(1, 1.5 * r)));
|
|
455
455
|
}, hs = function(e) {
|
|
456
456
|
let r = 0;
|
|
457
457
|
return r = e < 1 ? 5.11916 * e ** 2 : 4.5 * Math.log(e + 1) + 2, (r / 100).toFixed(2);
|
|
@@ -465,11 +465,11 @@ const ds = (e) => {
|
|
|
465
465
|
} } } } } }, a = s;
|
|
466
466
|
return r && (a = Pr(s, r)), On(a);
|
|
467
467
|
};
|
|
468
|
-
function
|
|
468
|
+
function Di(e, r) {
|
|
469
469
|
return r = Pr({ track: _n(e.palette.background.paper, 0.05, e?.palette.mode), thumb: _n(e.palette.background.paper, 0.3, e?.palette.mode), active: e.palette.primary.main, corner: e.palette.background.paper, outline: !1 }, r || {}), { "--scrollbar-track-color": me(r.track, 0.2), "--scrollbar-thumb-color": r.thumb, "--scrollbar-button-color": r.button || r.thumb, "--scrollbar-active-color": r.active, "--scrollbar-corner-color": r.corner || r.thumb, "--scrollbar-border-color": r.track, "--scrollbar-width": "13px", "--scrollbar-height": "13px", "--scrollbar-border-radius": "9999px", "--scrollbar-border-width": "2px", "--scrollbar-min-thumb-size": "24px" };
|
|
470
470
|
}
|
|
471
471
|
function Xr(e, r) {
|
|
472
|
-
const n =
|
|
472
|
+
const n = Di(e, r), t = { ...n, "& .scrollbar, & .vsb-track, & .vsb-thumb": { ...n }, "&::-webkit-scrollbar, & *::-webkit-scrollbar": { backgroundColor: "var(--scrollbar-track-color)", width: "var(--scrollbar-width)", height: "var(--scrollbar-height)" }, "&::-webkit-scrollbar-button": { display: "none" }, "& .scrollbar-button": { fill: "var(--scrollbar-thumb-color)", backgroundColor: "transparent", transition: "fill opacity 260ms ease", width: "var(--scrollbar-width)", height: "var(--scrollbar-height)" }, "& .scrollbar-button:hover:not([disabled])": { fill: "var(--scrollbar-active-color)" }, "& .scrollbar-button:disabled": { opacity: 0.8 }, "&::-webkit-scrollbar-track, & *::-webkit-scrollbar-track": {}, "&::-webkit-scrollbar-track-piece, & *::-webkit-scrollbar-track-piece": {}, "&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb": { borderRadius: "var(--scrollbar-border-radius)", backgroundColor: "var(--scrollbar-thumb-color)", minHeight: "var(--scrollbar-min-thumb-size)", minWidth: "var(--scrollbar-min-thumb-size)", border: "var(--scrollbar-border-width) solid var(--scrollbar-border-color)" }, "&::-webkit-scrollbar-thumb:focus, & *::-webkit-scrollbar-thumb:focus": { backgroundColor: "var(--scrollbar-active-color)", border: r?.outline ? r.outline : void 0 }, "&::-webkit-scrollbar-thumb:active, & *::-webkit-scrollbar-thumb:active": { backgroundColor: "var(--scrollbar-active-color)", border: r?.outline ? r.outline : void 0 }, "&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover": { backgroundColor: "var(--scrollbar-active-color)", border: r?.outline ? r.outline : void 0 }, "&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner": { backgroundColor: "var(--scrollbar-corner-color)" } };
|
|
473
473
|
return Te.getOS() === Te.OSType.Firefox && (t["* .pseudo-scrollbar"] = { scrollbarColor: "var(--scrollbar-thumb-color) transparent" }, t["* .pseudo-scrollbar:hover:not([disabled])"] = { scrollbarColor: "var(--scrollbar-active-color) transparent" }), t;
|
|
474
474
|
}
|
|
475
475
|
const gs = { Light: "light", Dark: "dark" };
|
|
@@ -482,7 +482,7 @@ function ys(e) {
|
|
|
482
482
|
}
|
|
483
483
|
return { themeMode: In(), source: "media" };
|
|
484
484
|
});
|
|
485
|
-
return
|
|
485
|
+
return Se(() => {
|
|
486
486
|
const s = () => {
|
|
487
487
|
if (r) return void (r === n.themeMode && n.source === "prop" || t((c) => ({ ...c, themeMode: r, source: "prop" })));
|
|
488
488
|
const i = An();
|
|
@@ -514,13 +514,13 @@ const bs = { Popup: "popup", Anchor: "anchor" }, vs = { ByPopup: "popupDone", Ca
|
|
|
514
514
|
let t;
|
|
515
515
|
return n && (t = (t ? t + " " : "") + "rotate(180deg)"), k(Kr, { style: { marginLeft: e ? void 0 : r ? "-0.25rem" : "-3px", marginRight: e ? void 0 : r ? "-0.25rem" : "-6px", transform: t }, color: "inherit" });
|
|
516
516
|
}, qr = ie(de((e, r) => {
|
|
517
|
-
const { open: n, anchorEl: t, anchorPosition: s, label: a, floatReference: o, createPopupPanel: l = hn,
|
|
518
|
-
L(
|
|
519
|
-
}, [c]),
|
|
520
|
-
const
|
|
517
|
+
const { open: n, anchorEl: t, anchorPosition: s, label: a, floatReference: o, createPopupPanel: l = hn, propsPopper: i, onMount: c, onClosing: d, onClose: x, onOpening: m, onOpen: b, children: v, sx: h, ...f } = e, y = ae(d, [d]), u = ae(x, [x]), w = ae(m, [m]), E = ae(b, [b]), [T, L] = re(), O = ge(null), P = ae((D, _) => {
|
|
518
|
+
L(D), c?.(O.current, _);
|
|
519
|
+
}, [c]), S = Z(() => {
|
|
520
|
+
const D = { popupContainer: T, floatReference: o, children: v, ...f }, _ = l(D);
|
|
521
521
|
return k(Et, { elevation: 8, ref: O, sx: { display: "flex", overflow: "auto", outline: "none", "&.MuiPaper-root": (M) => Xr(M) }, tabIndex: 0, children: _ });
|
|
522
522
|
}, [l, v, T, o]);
|
|
523
|
-
return k(Gr, { ref: r, anchorEl: t, anchorPosition: s, label: a, open: n, onMount: P, onOpening: w, onOpen: E, onClosing: y, onClose: u, ...i, children:
|
|
523
|
+
return k(Gr, { ref: r, anchorEl: t, anchorPosition: s, label: a, open: n, onMount: P, onOpening: w, onOpen: E, onClosing: y, onClose: u, ...i, children: S });
|
|
524
524
|
}));
|
|
525
525
|
qr.displayName = "ExhibitFloatPanel";
|
|
526
526
|
const Ge = /* @__PURE__ */ new Map();
|
|
@@ -538,10 +538,10 @@ const Xt = (e = null, r, n, t) => (ze && (ze.fn.clear(), ze = null), e === 0 ? r
|
|
|
538
538
|
const r = /* @__PURE__ */ new Set();
|
|
539
539
|
return Qr(r, e), r;
|
|
540
540
|
}, zt = (e) => {
|
|
541
|
-
const { anchor: r, label: n = null, parentFloat: t = null, onOpen: s, onClose: a,
|
|
541
|
+
const { anchor: r, label: n = null, parentFloat: t = null, onOpen: s, onClose: a, propsPopper: o, createPopupPanel: l = hn } = e ?? {}, i = ae(s, [s]), c = ae(a, [a]), [d, x] = re(null), [m, b] = re(!1), [v, h] = re(!1), f = Z(() => t === null ? (Kt === null && (Kt = { key: { label: "root" }, isRoot: !0, parent: null, open: () => null, close: (g) => null, closeChild: (g) => null, onChildVisible: () => {
|
|
542
542
|
}, onChildHidden: () => {
|
|
543
543
|
}, closeAll: () => B(0), floatElement: () => null, anchorElement: () => null }), Kt) : t, []), y = Z(() => ({ label: n }), []), u = q.useRef(null), w = q.useRef(r);
|
|
544
|
-
|
|
544
|
+
Se(() => {
|
|
545
545
|
w.current = r;
|
|
546
546
|
}, [r]);
|
|
547
547
|
const E = (g) => {
|
|
@@ -555,33 +555,33 @@ const Xt = (e = null, r, n, t) => (ze && (ze.fn.clear(), ze = null), e === 0 ? r
|
|
|
555
555
|
});
|
|
556
556
|
return T(), Ge.delete(f.key), x(!1), g;
|
|
557
557
|
};
|
|
558
|
-
|
|
558
|
+
Se(() => {
|
|
559
559
|
L && (L.resolve(), O(null));
|
|
560
560
|
}, [m, v, L]);
|
|
561
|
-
const
|
|
561
|
+
const S = _e(() => {
|
|
562
562
|
let g = f;
|
|
563
563
|
for (; g.parent; ) g = g.parent;
|
|
564
564
|
return E(g.key);
|
|
565
|
-
}, []),
|
|
565
|
+
}, []), D = () => {
|
|
566
566
|
if (d) return void M();
|
|
567
567
|
f && Ke.get(f.key)?.open(0);
|
|
568
568
|
const g = Ge.get(f.key);
|
|
569
569
|
g && g !== y && Ke.get(g)?.close(0), requestAnimationFrame(() => {
|
|
570
570
|
Ge.set(f.key, G.key), x(!0);
|
|
571
571
|
});
|
|
572
|
-
}, [_, M] = q.useReducer((g) => g + 1, 0), F = _e((g) => l === null ? null : l({ closeFloat: B, closeFloatAll: ee, ...g }), [l]), A = l === null, V = ae((g = 120) => Xt(g,
|
|
572
|
+
}, [_, M] = q.useReducer((g) => g + 1, 0), F = _e((g) => l === null ? null : l({ closeFloat: B, closeFloatAll: ee, ...g }), [l]), A = l === null, V = ae((g = 120) => Xt(g, D, /* @__PURE__ */ new Set([G]), !1)(), [D]), B = ae((g = 60) => Xt(g, P, Ln(G), !0)(), [P]), z = ae((g = 360) => Xt(g, T, Ln(((C) => {
|
|
573
573
|
const N = Ge.get(C.key);
|
|
574
574
|
return N && Ke.get(N) || null;
|
|
575
|
-
})(G)), !0)(), [T]), ee = ae(
|
|
575
|
+
})(G)), !0)(), [T]), ee = ae(S, [S]), G = Z(() => ({ key: y, isRoot: !1, label: n, parent: f, onChildVisible: () => {
|
|
576
576
|
h(!0);
|
|
577
577
|
}, onChildHidden: () => {
|
|
578
578
|
h(!1);
|
|
579
579
|
}, open: V, close: B, closeChild: z, closeAll: ee, floatElement: () => u.current, anchorElement: () => w.current }), []);
|
|
580
|
-
|
|
580
|
+
Se(() => {
|
|
581
581
|
Ke.set(y, G);
|
|
582
|
-
}, [G]),
|
|
582
|
+
}, [G]), Se(() => () => {
|
|
583
583
|
Ke.delete(y), B(0);
|
|
584
|
-
}, []),
|
|
584
|
+
}, []), Se(() => {
|
|
585
585
|
d && !A && (b(!0), f.onChildVisible());
|
|
586
586
|
}, [d, A]);
|
|
587
587
|
const Q = _e((g) => {
|
|
@@ -600,12 +600,12 @@ const Xt = (e = null, r, n, t) => (ze && (ze.fn.clear(), ze = null), e === 0 ? r
|
|
|
600
600
|
C === document.activeElement && g.focus();
|
|
601
601
|
});
|
|
602
602
|
}, []), [le, ce] = re();
|
|
603
|
-
|
|
603
|
+
Se(() => {
|
|
604
604
|
A && (d ? i?.() : d === !1 && c?.()), ce(m ? k(qr, { floatReference: G, open: d, label: n, anchorEl: r, onOpening: () => {
|
|
605
605
|
i?.(), f.onChildVisible();
|
|
606
606
|
}, onClosing: se, onClose: () => {
|
|
607
607
|
b(!1), f.onChildHidden();
|
|
608
|
-
}, onMount: te,
|
|
608
|
+
}, onMount: te, propsPopper: { onKeyDown: Q, onMouseEnter: (g) => {
|
|
609
609
|
d && ze?.isClose && ze.setReferences.has(G) && (ze.fn.clear(), ze = null, G.closeChild());
|
|
610
610
|
}, ...o }, createPopupPanel: F }) : null);
|
|
611
611
|
}, [m, d, n, A, o, F, _]);
|
|
@@ -616,9 +616,9 @@ const Xt = (e = null, r, n, t) => (ze && (ze.fn.clear(), ze = null), e === 0 ? r
|
|
|
616
616
|
const I = Ke.get(N);
|
|
617
617
|
if (C || !I) return;
|
|
618
618
|
I.floatElement()?.contains?.(g.target) && (C = !0), I.anchorElement()?.contains?.(g.target) && (C = !0);
|
|
619
|
-
}), C ||
|
|
620
|
-
}, [
|
|
621
|
-
return
|
|
619
|
+
}), C || S();
|
|
620
|
+
}, [S]);
|
|
621
|
+
return Se(() => {
|
|
622
622
|
if (!d || !f.isRoot) return;
|
|
623
623
|
const g = (C) => {
|
|
624
624
|
p(C);
|
|
@@ -639,14 +639,14 @@ const Xt = (e = null, r, n, t) => (ze && (ze.fn.clear(), ze = null), e === 0 ? r
|
|
|
639
639
|
}, [n]), ...o };
|
|
640
640
|
return k(t === Oi.Toolbar ? mn : Zr, { ...l });
|
|
641
641
|
})), Ei = { placement: "right-start" }, xs = ie(de((e, r) => {
|
|
642
|
-
const { children: n, sx: t, parentFloat: s, createPopupPanel: a,
|
|
642
|
+
const { children: n, sx: t, parentFloat: s, createPopupPanel: a, propsPopper: o = Ei, label: l, ...i } = e;
|
|
643
643
|
(function(f) {
|
|
644
644
|
if (!f) throw new Error("Invariant failed");
|
|
645
645
|
})(q.isValidElement(n));
|
|
646
646
|
const c = n, d = Z(() => ({ ...c?.props, ...i, onContextMenu: (f) => {
|
|
647
647
|
c?.props?.onContextMenu?.(f), f.isDefaultPrevented() || (i?.onContextMenu?.(f), f.isDefaultPrevented() || (b(f), f.preventDefault()));
|
|
648
|
-
} }), [i, c?.props]), x = ae(a, [a]), [m, b] = q.useState(null), { reference: v, component: h } = zt({ label: l ?? "contextMenu",
|
|
649
|
-
return
|
|
648
|
+
} }), [i, c?.props]), x = ae(a, [a]), [m, b] = q.useState(null), { reference: v, component: h } = zt({ label: l ?? "contextMenu", propsPopper: o, parentFloat: s, anchor: { getBoundingClientRect: () => new DOMRect(m?.clientX || 0, m?.clientY || 0) }, onClose: () => b(null), createPopupPanel: x });
|
|
649
|
+
return Se(() => {
|
|
650
650
|
m ? v.open(0) : v.close(0);
|
|
651
651
|
}, [m]), J(Je, { children: [q.cloneElement(n, d), h] });
|
|
652
652
|
})), dt = de((e, r) => {
|
|
@@ -673,13 +673,13 @@ const mt = ie((e) => {
|
|
|
673
673
|
let v = null;
|
|
674
674
|
s && (v = Jr(s, i));
|
|
675
675
|
const [h, f] = re(null);
|
|
676
|
-
return
|
|
676
|
+
return Se(() => {
|
|
677
677
|
Promise.resolve(t).then((y) => {
|
|
678
678
|
f(y);
|
|
679
679
|
});
|
|
680
680
|
}, [t]), k(dt, { slotProps: { popper: { sx: { "& .MuiTooltip-tooltip": { marginTop: "0px !important" }, ...m }, modifiers: [{ name: "offset", options: { offset: [0, 14] } }] } }, className: "tooltip-wrapper", tabIndex: -1, title: !n && h ? J(K, { sx: { maxWidth: `${l}px` }, ref: r, children: [J(K, { sx: { display: "flex", flexDirection: "row", marginBottom: o ? "4px" : "0px" }, children: [k(Me, { variant: "subtitle1", component: "div", flex: "1 1 100%", children: h }), a ? k(Br, { chips: a }) : null, v ? k(K, { sx: { marginLeft: "8px" } }, "leadingSpace") : k(Je, {}), v] }), o ? k(Me, { variant: "caption", sx: { whiteSpace: "pre-line", lineHeight: "1.4" }, children: o }) : k(Je, {})] }) : "", enterDelay: 260, enterNextDelay: 130, leaveDelay: 230, disableInteractive: !0, ...b, children: k("div", { style: { display: "flex", alignItems: "stretch", justifyContent: "stretch" }, children: c }) });
|
|
681
681
|
})), Ti = k(ye, {}), Pi = k(ye, { iconKey: "Check" }), Wt = ie(de((e, r) => {
|
|
682
|
-
const { dense: n = !0, outlined: t = !1, disableHover: s = !1, parentFloat: a, selected: o, icon: l,
|
|
682
|
+
const { dense: n = !0, outlined: t = !1, disableHover: s = !1, parentFloat: a, selected: o, icon: l, propsTooltip: i, children: c, primary: d, sx: x, disabled: m, className: b, onFocus: v, onBlur: h, ...f } = e, [y, u] = re(!1), w = { marginRight: "0px", padding: n ? "2px" : "7px", borderRadius: (P) => `${P.shape.borderRadius}px`, color: (P) => d ? void 0 : P.palette.text.icon ?? P.palette.action.active, border: (P) => `solid ${t ? P.palette.divider : "transparent"} 1px`, "& .MuiTouchRipple-child": { borderRadius: (P) => `${P.shape.borderRadius}px !important` }, "&.Mui-selected": { backgroundColor: (P) => me(P.palette.text.primary, P.palette.action.selectedOpacity), border: (P) => `solid ${t ? P.palette.text?.primary : P.palette.divider} 1px` }, "&.Mui-disabled": { border: (P) => `solid ${t ? P.palette.divider : "transparent"} 1px` }, "&.Mui-disabled > .icon path": { filter: "grayscale(65%)", opacity: ".8" }, "&.Mui-focusVisible": { outline: "solid transparent 1px", border: "1px solid transparent" }, ...x }, E = { "&:hover:not(.Mui-disabled, [disabled])": { color: (P) => P.palette.text.primary, border: (P) => `solid ${t ? P.palette.text?.primary : P.palette.divider} 1px`, "&.Mui-selected": { backgroundColor: (P) => me(P.palette.text.primary, P.palette.action.selectedOpacity + P.palette.action.hoverOpacity) }, "> .outline-hover": { outline: (P) => `solid ${t ? P.palette.text?.primary : P.palette.divider} 1px` }, backgroundColor: null }, "&.Mui-focusVisible": { outline: (P) => `solid ${P.palette.primary.main} 1px`, border: (P) => `1px solid ${P.palette?.primary?.main}`, zIndex: 1 } };
|
|
683
683
|
let T = w;
|
|
684
684
|
s || (T = Te.mergeContentful(w, E));
|
|
685
685
|
const L = Z(() => {
|
|
@@ -692,38 +692,38 @@ const mt = ie((e) => {
|
|
|
692
692
|
u(!1), h?.(P);
|
|
693
693
|
}, size: "small", TouchRippleProps: { center: !1 }, sx: T, edge: "end", ...f, disabled: m || !1, children: [L, c] });
|
|
694
694
|
if (i) if (i.simple && i.label && !i.disabled) {
|
|
695
|
-
const { label: P, description:
|
|
695
|
+
const { label: P, description: S, maxWidth: D, shortcut: _, useModifierSymbols: M, componentDisabled: F, simple: A, chips: V, ref: B, ...z } = i;
|
|
696
696
|
O = k(dt, { disableInteractive: !0, title: P ?? "", ...z, children: k(K, { sx: { display: "flex" }, children: O }) });
|
|
697
697
|
} else O = k(pt, { children: O, ...i });
|
|
698
698
|
return O;
|
|
699
699
|
})), Ri = k(ye, {}), Ni = (e) => e.icon, Ot = ie(de((e, r) => {
|
|
700
|
-
const { icon: n = Ri, renderIcon: t = Ni, parentFloat: s, className: a, onFocus: o, selected: l, onBlur: i, onMouseOver: c, onMouseOut: d, onMouseEnter: x, disabled: m, children: b, sx: v,
|
|
701
|
-
const
|
|
702
|
-
return
|
|
700
|
+
const { icon: n = Ri, renderIcon: t = Ni, parentFloat: s, className: a, onFocus: o, selected: l, onBlur: i, onMouseOver: c, onMouseOut: d, onMouseEnter: x, disabled: m, children: b, sx: v, propsTooltip: h, chips: f, primary: y, ...u } = e, [w, E] = re(!1), [T, L] = re(!1), O = Z(() => {
|
|
701
|
+
const S = t?.({ icon: n, disabled: m, selected: l });
|
|
702
|
+
return S ? k(zo, { className: Oe({ "Mui-focusVisible": w, "Mui-hovered": T }), sx: { "& .MuiSvgIcon-root": { color: (D) => y ? void 0 : D.palette.text.icon ?? D.palette.action.active }, "&.Mui-hovered:not(.Mui-disabled, [disabled])": { "& .MuiSvgIcon-root": { color: (D) => D.palette.text.primary } } }, children: S }) : null;
|
|
703
703
|
}, [t, m, n, w, T, y, l]);
|
|
704
|
-
let P = J(Mr, { ref: r, disabled: m, onMouseOver: (
|
|
705
|
-
c?.(
|
|
706
|
-
}, onMouseOut: (
|
|
707
|
-
d?.(
|
|
708
|
-
}, onMouseEnter: (
|
|
709
|
-
x?.(
|
|
710
|
-
}, TouchRippleProps: { center: !1 }, className: Oe({ "Mui-focusVisible": w, "Mui-hovered": T }, a), onFocus: (
|
|
711
|
-
o?.(
|
|
712
|
-
}, onBlur: (
|
|
713
|
-
i?.(
|
|
714
|
-
}, sx: { flex: "1 1 100%", "&.Mui-disabled > .icon path": { filter: "grayscale(65%)" }, "&.Mui-selected": { color: (
|
|
704
|
+
let P = J(Mr, { ref: r, disabled: m, onMouseOver: (S) => {
|
|
705
|
+
c?.(S), S.isDefaultPrevented() || L(!0);
|
|
706
|
+
}, onMouseOut: (S) => {
|
|
707
|
+
d?.(S), S.isDefaultPrevented() || L(!1);
|
|
708
|
+
}, onMouseEnter: (S) => {
|
|
709
|
+
x?.(S), S.isDefaultPrevented() || s?.closeChild();
|
|
710
|
+
}, TouchRippleProps: { center: !1 }, className: Oe({ "Mui-focusVisible": w, "Mui-hovered": T }, a), onFocus: (S) => {
|
|
711
|
+
o?.(S), E(!0);
|
|
712
|
+
}, onBlur: (S) => {
|
|
713
|
+
i?.(S), E(!1);
|
|
714
|
+
}, sx: { flex: "1 1 100%", "&.Mui-disabled > .icon path": { filter: "grayscale(65%)" }, "&.Mui-selected": { color: (S) => S.palette.text.primary }, color: (S) => S.palette.text.secondary, "&.Mui-hovered:not(.Mui-disabled, [disabled])": { color: (S) => S.palette.text.primary }, ...v }, ...u, children: [O, b, f ? k(Br, { chips: f }) : null] });
|
|
715
715
|
return h && (P = k(pt, { children: P, placement: "right-start", ...h })), P;
|
|
716
716
|
})), ws = ie(de((e, r) => {
|
|
717
717
|
const { children: n, sx: t, primary: s = !1, variant: a = "subtitle1", ...o } = e;
|
|
718
718
|
return k(Je, { children: k(Me, { ref: r, variant: a, component: "div", sx: { userSelect: "none", fontWeight: "500", paddingLeft: "8px", paddingTop: a === "subtitle1" ? "2px" : void 0, paddingBottom: a === "subtitle1" ? "2px" : void 0, color: (l) => s ? void 0 : l.palette.text.secondary, ...t }, ...o, children: n }) });
|
|
719
719
|
})), mn = ie(de((e, r) => {
|
|
720
|
-
const { dense: n = !0, outlined: t = !1, label: s, selected: a = !1, onQuickClick: o, parentFloat: l, createPopupPanel: i,
|
|
720
|
+
const { dense: n = !0, outlined: t = !1, label: s, selected: a = !1, onQuickClick: o, parentFloat: l, createPopupPanel: i, propsPopup: c, onPopupOpen: d, onPopupClose: x, propsQuickButton: m, renderQuickButton: b, tooltip: v = "", createTooltip: h, icon: f, disabled: y, propsButton: u = Te.EmptyObject, disableHover: w, touchRippleRef: E, primary: T, children: L, sx: O, className: P, ...S } = e, D = dn(), _ = Z(() => {
|
|
721
721
|
const X = (ne, ue, he, Le = he) => {
|
|
722
722
|
const Ce = typeof t == "boolean" ? null : t[ne];
|
|
723
723
|
return typeof Ce == "function" ? Ce(ue) : Ce || (t ? he : Le);
|
|
724
724
|
};
|
|
725
|
-
return { outline: { color: (ne) => X("color", ne, ne.palette.divider, "transparent"), hoverColor: (ne) => X("hoverColor", ne, ne.palette.text?.primary, ne.palette.divider), focusColor: (ne) => X("focusColor", ne, ne.palette?.primary?.main) }, active:
|
|
726
|
-
}, [t,
|
|
725
|
+
return { outline: { color: (ne) => X("color", ne, ne.palette.divider, "transparent"), hoverColor: (ne) => X("hoverColor", ne, ne.palette.text?.primary, ne.palette.divider), focusColor: (ne) => X("focusColor", ne, ne.palette?.primary?.main) }, active: D.palette.mode === "dark" ? D.palette.text.secondary : D.palette.text.primary, text: D.palette.text.icon ?? D.palette.action.active };
|
|
726
|
+
}, [t, D]), [M, F] = re(!1), [A, V] = re(!1), [B, z] = re(!1), ee = ge(null), G = ge(null), Q = zt({ anchor: ee.current, label: s, createPopupPanel: i, parentFloat: l, propsPopper: c?.propsPopper, onClose: () => {
|
|
727
727
|
F(!1), x?.();
|
|
728
728
|
}, onOpen: () => {
|
|
729
729
|
F(!0), d?.();
|
|
@@ -765,15 +765,15 @@ const mt = ie((e) => {
|
|
|
765
765
|
}
|
|
766
766
|
const { className: R, sx: j, ...H } = u;
|
|
767
767
|
let U = k(K, { onFocus: () => V(!0), onBlur: () => V(!1), onMouseOver: () => z(!0), onMouseOut: () => z(!1), ...C, "aria-label": "split button", ref: ee, tabIndex: y ? void 0 : 0, className: Oe(R, "split-button-root", { "Mui-focusVisible": A || M, "Mui-selected": M || a, "Mui-hovered": B, "Mui-disabled": y }), sx: { display: "flex", flex: "1 1 100%", alignItems: "stretch", width: "fit-content", "&:not(.Mui-disabled)": { cursor: "pointer" }, marginLeft: t ? "1px" : "0px", marginRight: t ? "1px" : "0px", borderRadius: (X) => `${X.shape.borderRadius}px`, "&.Mui-focusVisible": { outline: (X) => `solid ${X.palette.primary.main} 1px`, zIndex: 2 }, ...j }, ...H, children: N });
|
|
768
|
-
return p || (U = (h ?? le)({ title: M ? "" : v, children: U }, M)), J(K, { className: Oe(P, "popupIconButton"), ref: r, ...
|
|
768
|
+
return p || (U = (h ?? le)({ title: M ? "" : v, children: U }, M)), J(K, { className: Oe(P, "popupIconButton"), ref: r, ...S, sx: { zIndex: A || M ? 2 : void 0, display: "flex", alignItems: "center", ...O }, children: [U, Q.component] });
|
|
769
769
|
}));
|
|
770
770
|
mn.displayName = "ExhibitPopupIconButton";
|
|
771
771
|
const Fi = {}, Zr = ie(de((e, r) => {
|
|
772
|
-
const { selected: n = !1, label: t, onQuickClick: s, parentFloat: a, createPopupPanel: o,
|
|
772
|
+
const { selected: n = !1, label: t, onQuickClick: s, parentFloat: a, createPopupPanel: o, propsPopup: l = Fi, onPopupOpen: i, onPopupClose: c, propsQuickButton: d, renderQuickButton: x, tooltip: m = "", createTooltip: b, icon: v, disabled: h, touchRippleRef: f, primary: y, children: u, sx: w, ...E } = e, [T, L] = re(!1), [O, P] = re(!1), [S, D] = re(!1), [_, M] = re(!1), F = ge(null), A = ge(null), V = Z(() => {
|
|
773
773
|
if (!l) return;
|
|
774
|
-
const {
|
|
774
|
+
const { propsPopper: p } = l;
|
|
775
775
|
return { placement: "right-start", offsets: [-4, -2], ...p };
|
|
776
|
-
}, [l]), B = zt({ anchor: F.current, label: t, createPopupPanel: o, parentFloat: a,
|
|
776
|
+
}, [l]), B = zt({ anchor: F.current, label: t, createPopupPanel: o, parentFloat: a, propsPopper: V, onClose: () => {
|
|
777
777
|
L(!1), c?.();
|
|
778
778
|
}, onOpen: () => {
|
|
779
779
|
L(!0), i?.();
|
|
@@ -784,13 +784,13 @@ const Fi = {}, Zr = ie(de((e, r) => {
|
|
|
784
784
|
return k(dt, { ref: C, ...N, disableInteractive: !0, children: g });
|
|
785
785
|
}, []), oe = s || x, se = (p) => {
|
|
786
786
|
const { tooltip: g, createTooltip: C, ...N } = p;
|
|
787
|
-
return k(Ot, { icon: v, className: Oe({ "Mui-hovered":
|
|
787
|
+
return k(Ot, { icon: v, className: Oe({ "Mui-hovered": S }), sx: { flex: "1 1 100%", ...G }, ...N, children: t });
|
|
788
788
|
}, te = { onFocus: () => {
|
|
789
789
|
P(!0);
|
|
790
790
|
}, onBlur: () => P(!1), onMouseOver: () => {
|
|
791
|
-
|
|
791
|
+
D(!0);
|
|
792
792
|
}, onMouseLeave: () => {
|
|
793
|
-
|
|
793
|
+
D(!1);
|
|
794
794
|
}, onMouseEnter: () => {
|
|
795
795
|
B.reference.open();
|
|
796
796
|
}, onMouseDown: (p) => {
|
|
@@ -803,17 +803,17 @@ const Fi = {}, Zr = ie(de((e, r) => {
|
|
|
803
803
|
}, onMouseDown: (g) => {
|
|
804
804
|
g.button === 0 && (g.preventDefault(), z(g));
|
|
805
805
|
}, className: Oe("quick-left", {}, d?.className), ...d });
|
|
806
|
-
le = J(Je, { children: [p, k(Er, { sx: { ml: "0px", mr: "0px" }, orientation: "vertical", variant: "middle", flexItem: !0 }), k(Mr, { ref: A, className: Oe({ "Mui-selected": T, "Mui-hovered":
|
|
806
|
+
le = J(Je, { children: [p, k(Er, { sx: { ml: "0px", mr: "0px" }, orientation: "vertical", variant: "middle", flexItem: !0 }), k(Mr, { ref: A, className: Oe({ "Mui-selected": T, "Mui-hovered": S }), sx: { borderTopLeftRadius: "0px", borderBottomLeftRadius: "0px", paddingLeft: "0px", paddingRight: "0px", marginLeft: "0px", color: (g) => y ? void 0 : g.palette.text.secondary, "&.Mui-hovered:not(.Mui-disabled, [disabled])": { color: (g) => g.palette.text.primary }, ...G }, tabIndex: -1, disabled: h, ...te, children: k(K, { className: "expand-icon", sx: { flex: "none", display: "flex", border: "1px solid transparent", paddingTop: "1px", paddingBottom: "1px", color: (g) => y ? void 0 : g.palette.text.icon ?? g.palette.action.active }, onMouseOver: (g) => {
|
|
807
807
|
g.preventDefault(), M(!0);
|
|
808
808
|
}, onMouseLeave: () => {
|
|
809
809
|
M(!1);
|
|
810
810
|
}, onClick: (g) => {
|
|
811
811
|
g.preventDefault(), T ? B.reference.close() : B.reference.open();
|
|
812
812
|
}, children: ee }) })] });
|
|
813
|
-
} else le = J(Ot, { ref: A, tabIndex: -1, disabled: h, icon: v, className: Oe({ "Mui-selected": T || n, "Mui-hovered":
|
|
813
|
+
} else le = J(Ot, { ref: A, tabIndex: -1, disabled: h, icon: v, className: Oe({ "Mui-selected": T || n, "Mui-hovered": S }), sx: { flex: "1 1 100%", paddingRight: "0px", ...G }, onClick: (p) => {
|
|
814
814
|
p.preventDefault(), T ? B.reference.close() : B.reference.open();
|
|
815
815
|
}, ...te, children: [k("div", { style: { flex: "1 1 100%" }, children: t }), k(K, { className: "expand-icon", sx: { flex: "none", display: "flex", color: (p) => y ? void 0 : p.palette.text.icon ?? p.palette.action.active }, children: ee })] });
|
|
816
|
-
let ce = k(K, { "aria-label": "split button", ref: F, tabIndex: h ? void 0 : 0, className: Oe({ "Mui-disabled": h, "Mui-selected": T, "Mui-focusVisible": O || T, "Mui-hovered":
|
|
816
|
+
let ce = k(K, { "aria-label": "split button", ref: F, tabIndex: h ? void 0 : 0, className: Oe({ "Mui-disabled": h, "Mui-selected": T, "Mui-focusVisible": O || T, "Mui-hovered": S }), sx: { display: "flex", flex: "1 1 100%", alignItems: "center", width: "fit-content", "& .quick-left": { borderTopRightRadius: "0px", borderBottomRightRadius: "0px", marginRight: "-1px" }, "&.Mui-disabled > .icon path": { filter: "grayscale(65%)" }, ...w }, ...E, children: le });
|
|
817
817
|
return oe && !_ && (d?.tooltip || d?.createTooltip) && (ce = (d?.createTooltip ?? Q)({ title: T ? "" : ce ?? d?.tooltip, children: ce }, T)), J(K, { ref: r, sx: { zIndex: O || T ? 2 : void 0, display: "flex", " .tooltip-wrapper": { display: "flex", flex: "1 1 100%" } }, children: [ce, B.component] });
|
|
818
818
|
})), ks = ie(de((e, r) => {
|
|
819
819
|
const { onSelectToggle: n, selected: t = !1, label: s, shortcut: a, tabIndex: o = 0, preventFocus: l = !1, ...i } = e;
|
|
@@ -823,11 +823,11 @@ const Fi = {}, Zr = ie(de((e, r) => {
|
|
|
823
823
|
n?.(!t);
|
|
824
824
|
}, ...i }) });
|
|
825
825
|
})), _i = k(ye, {}), Ai = k(ye, { iconKey: "Check" }), Ii = ie(de((e, r) => {
|
|
826
|
-
const { children: n, selected: t = !0, outlined: s = !0, sx: a, ...o } = e
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
826
|
+
const { children: n, selected: t = !0, outlined: s = !0, sx: a, ...o } = e, l = Z(() => ({ display: "flex", border: (c) => t ? `solid ${s ? c.palette.divider : "transparent"} 1px` : "solid transparent 1px", borderRadius: (c) => `${c.shape.borderRadius}px`, backgroundColor: (c) => {
|
|
827
|
+
if (t) return me(c.palette.text.icon ?? c.palette.action.active, c.palette.action.selectedOpacity);
|
|
828
|
+
}, ...a }), [a]);
|
|
829
|
+
let i = n;
|
|
830
|
+
return i === null && (i = _i), i || (i = Ai), k(K, { ref: r, sx: l, ...o, children: i });
|
|
831
831
|
}));
|
|
832
832
|
function Ee() {
|
|
833
833
|
return Ee = Object.assign ? Object.assign.bind() : function(e) {
|
|
@@ -892,7 +892,7 @@ var qt = "[ERROR]: Modal ID is missing", no = function(e) {
|
|
|
892
892
|
for (var r = [], n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", t = 0; t < e; t++) r[t] = n.charAt(Math.floor(62 * Math.random()));
|
|
893
893
|
return r.join("");
|
|
894
894
|
}, ji = ["open"];
|
|
895
|
-
function
|
|
895
|
+
function Ss(e) {
|
|
896
896
|
var r = e.children, n = e.legacy, t = n !== void 0 && n, s = e.suspense, a = s === void 0 || s, o = e.fallback, l = o === void 0 ? null : o, i = q.useReducer(Bi, Li), c = i[0], d = i[1], x = q.useCallback(function(y, u) {
|
|
897
897
|
var w = eo(u, ji);
|
|
898
898
|
y ? d({ type: Ie.UPDATE, payload: { id: y, props: w } }) : console.error(qt);
|
|
@@ -914,8 +914,8 @@ function Ds(e) {
|
|
|
914
914
|
}, [d, m, b, x]), f = a ? No : Fo;
|
|
915
915
|
return q.createElement(to.Provider, { value: { state: c, updateModal: x, hideModal: m, destroyModal: b, showModal: h, destroyModalsByRootId: v } }, r, q.createElement(f, Object.assign({}, a && { fallback: l }), Object.keys(c).map(function(y) {
|
|
916
916
|
var u = c[y], w = u.component, E = u.props, T = u.options, L = function() {
|
|
917
|
-
var P,
|
|
918
|
-
E != null && E.onExited && E.onExited.apply(E, arguments), E != null && (P = E.TransitionProps) != null && P.onExited && (
|
|
917
|
+
var P, S;
|
|
918
|
+
E != null && E.onExited && E.onExited.apply(E, arguments), E != null && (P = E.TransitionProps) != null && P.onExited && (S = E.TransitionProps).onExited.apply(S, arguments), b(y);
|
|
919
919
|
}, O = {};
|
|
920
920
|
return O = t ? { onExited: L } : { TransitionProps: Ee({}, E?.TransitionProps, { onExited: L }) }, q.createElement(w, Object.assign({}, E, { key: y, onClose: function() {
|
|
921
921
|
T && T.hideOnClose && m(y), T && T.destroyOnClose && T.hideOnClose && b(y), E && E.onClose && E.onClose.apply(E, arguments);
|
|
@@ -923,7 +923,7 @@ function Ds(e) {
|
|
|
923
923
|
})));
|
|
924
924
|
}
|
|
925
925
|
var ro = { enforceProvider: !1 };
|
|
926
|
-
function
|
|
926
|
+
function Ds(e) {
|
|
927
927
|
Object.assign(ro, e);
|
|
928
928
|
}
|
|
929
929
|
function $i() {
|
|
@@ -937,7 +937,7 @@ function gn(e) {
|
|
|
937
937
|
if ($i().enforceProvider && l === void 0) throw new Error("useModalContext must be used within a ModalProvider");
|
|
938
938
|
return l || Vi;
|
|
939
939
|
})(), t = n.showModal, s = n.destroyModalsByRootId, a = eo(n, zi), o = ge(no(6));
|
|
940
|
-
return
|
|
940
|
+
return Se(function() {
|
|
941
941
|
return function() {
|
|
942
942
|
!r && s && s(o.current);
|
|
943
943
|
};
|
|
@@ -1221,113 +1221,113 @@ var ea = function(e, r) {
|
|
|
1221
1221
|
return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
|
|
1222
1222
|
}, oa = [];
|
|
1223
1223
|
const ia = Object.freeze(Object.defineProperty({ __proto__: null, createFocusTrap: function(e, r) {
|
|
1224
|
-
var n, t = r?.document || document, s = r?.trapStack || oa, a = Kn({ returnFocusOnDeactivate: !0, escapeDeactivates: !0, delayInitialFocus: !0, isKeyForward: na, isKeyBackward: ra }, r), o = { containers: [], containerGroups: [], tabbableGroups: [], nodeFocusedBeforeActivation: null, mostRecentlyFocusedNode: null, active: !1, paused: !1, manuallyPaused: !1, delayInitialFocusTimer: void 0, recentNavEvent: void 0 }, l = function(
|
|
1225
|
-
return
|
|
1226
|
-
}, i = function(
|
|
1227
|
-
var _ = typeof
|
|
1224
|
+
var n, t = r?.document || document, s = r?.trapStack || oa, a = Kn({ returnFocusOnDeactivate: !0, escapeDeactivates: !0, delayInitialFocus: !0, isKeyForward: na, isKeyBackward: ra }, r), o = { containers: [], containerGroups: [], tabbableGroups: [], nodeFocusedBeforeActivation: null, mostRecentlyFocusedNode: null, active: !1, paused: !1, manuallyPaused: !1, delayInitialFocusTimer: void 0, recentNavEvent: void 0 }, l = function(S, D, _) {
|
|
1225
|
+
return S && S[D] !== void 0 ? S[D] : a[_ || D];
|
|
1226
|
+
}, i = function(S, D) {
|
|
1227
|
+
var _ = typeof D?.composedPath == "function" ? D.composedPath() : void 0;
|
|
1228
1228
|
return o.containerGroups.findIndex(function(M) {
|
|
1229
1229
|
var F = M.container, A = M.tabbableNodes;
|
|
1230
|
-
return F.contains(
|
|
1231
|
-
return V ===
|
|
1230
|
+
return F.contains(S) || _?.includes(F) || A.find(function(V) {
|
|
1231
|
+
return V === S;
|
|
1232
1232
|
});
|
|
1233
1233
|
});
|
|
1234
|
-
}, c = function(
|
|
1235
|
-
var
|
|
1234
|
+
}, c = function(S) {
|
|
1235
|
+
var D = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ = D.hasFallback, M = _ !== void 0 && _, F = D.params, A = F === void 0 ? [] : F, V = a[S];
|
|
1236
1236
|
if (typeof V == "function" && (V = V.apply(void 0, Zi(A))), V === !0 && (V = void 0), !V) {
|
|
1237
1237
|
if (V === void 0 || V === !1) return V;
|
|
1238
|
-
throw new Error("`".concat(
|
|
1238
|
+
throw new Error("`".concat(S, "` was specified but was not a node, or did not return a node"));
|
|
1239
1239
|
}
|
|
1240
1240
|
var B = V;
|
|
1241
1241
|
if (typeof V == "string") {
|
|
1242
1242
|
try {
|
|
1243
1243
|
B = t.querySelector(V);
|
|
1244
1244
|
} catch (z) {
|
|
1245
|
-
throw new Error("`".concat(
|
|
1245
|
+
throw new Error("`".concat(S, '` appears to be an invalid selector; error="').concat(z.message, '"'));
|
|
1246
1246
|
}
|
|
1247
|
-
if (!B && !M) throw new Error("`".concat(
|
|
1247
|
+
if (!B && !M) throw new Error("`".concat(S, "` as selector refers to no known node"));
|
|
1248
1248
|
}
|
|
1249
1249
|
return B;
|
|
1250
1250
|
}, d = function() {
|
|
1251
|
-
var
|
|
1252
|
-
if (
|
|
1253
|
-
if (
|
|
1251
|
+
var S = c("initialFocus", { hasFallback: !0 });
|
|
1252
|
+
if (S === !1) return !1;
|
|
1253
|
+
if (S === void 0 || S && !_t(S, a.tabbableOptions)) if (i(t.activeElement) >= 0) S = t.activeElement;
|
|
1254
1254
|
else {
|
|
1255
|
-
var
|
|
1256
|
-
|
|
1255
|
+
var D = o.tabbableGroups[0];
|
|
1256
|
+
S = D && D.firstTabbableNode || c("fallbackFocus");
|
|
1257
1257
|
}
|
|
1258
|
-
else
|
|
1259
|
-
if (!
|
|
1260
|
-
return
|
|
1258
|
+
else S === null && (S = c("fallbackFocus"));
|
|
1259
|
+
if (!S) throw new Error("Your focus-trap needs to have at least one focusable element");
|
|
1260
|
+
return S;
|
|
1261
1261
|
}, x = function() {
|
|
1262
|
-
if (o.containerGroups = o.containers.map(function(
|
|
1263
|
-
var
|
|
1262
|
+
if (o.containerGroups = o.containers.map(function(S) {
|
|
1263
|
+
var D = uo(S, a.tabbableOptions), _ = po(S, a.tabbableOptions), M = D.length > 0 ? D[0] : void 0, F = D.length > 0 ? D[D.length - 1] : void 0, A = _.find(function(z) {
|
|
1264
1264
|
return et(z);
|
|
1265
1265
|
}), V = _.slice().reverse().find(function(z) {
|
|
1266
1266
|
return et(z);
|
|
1267
|
-
}), B = !!
|
|
1267
|
+
}), B = !!D.find(function(z) {
|
|
1268
1268
|
return Xe(z) > 0;
|
|
1269
1269
|
});
|
|
1270
|
-
return { container:
|
|
1271
|
-
var ee = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1], G =
|
|
1270
|
+
return { container: S, tabbableNodes: D, focusableNodes: _, posTabIndexesFound: B, firstTabbableNode: M, lastTabbableNode: F, firstDomTabbableNode: A, lastDomTabbableNode: V, nextTabbableNode: function(z) {
|
|
1271
|
+
var ee = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1], G = D.indexOf(z);
|
|
1272
1272
|
return G < 0 ? ee ? _.slice(_.indexOf(z) + 1).find(function(Q) {
|
|
1273
1273
|
return et(Q);
|
|
1274
1274
|
}) : _.slice(0, _.indexOf(z)).reverse().find(function(Q) {
|
|
1275
1275
|
return et(Q);
|
|
1276
|
-
}) :
|
|
1276
|
+
}) : D[G + (ee ? 1 : -1)];
|
|
1277
1277
|
} };
|
|
1278
|
-
}), o.tabbableGroups = o.containerGroups.filter(function(
|
|
1279
|
-
return
|
|
1278
|
+
}), o.tabbableGroups = o.containerGroups.filter(function(S) {
|
|
1279
|
+
return S.tabbableNodes.length > 0;
|
|
1280
1280
|
}), o.tabbableGroups.length <= 0 && !c("fallbackFocus")) throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
|
|
1281
|
-
if (o.containerGroups.find(function(
|
|
1282
|
-
return
|
|
1281
|
+
if (o.containerGroups.find(function(S) {
|
|
1282
|
+
return S.posTabIndexesFound;
|
|
1283
1283
|
}) && o.containerGroups.length > 1) throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
|
|
1284
|
-
}, m = function(
|
|
1285
|
-
var
|
|
1286
|
-
if (
|
|
1287
|
-
}, b = function(
|
|
1288
|
-
|
|
1289
|
-
return
|
|
1290
|
-
})(
|
|
1291
|
-
}, v = function(
|
|
1292
|
-
var
|
|
1293
|
-
return
|
|
1294
|
-
}, h = function(
|
|
1295
|
-
var
|
|
1296
|
-
|
|
1284
|
+
}, m = function(S) {
|
|
1285
|
+
var D = S.activeElement;
|
|
1286
|
+
if (D) return D.shadowRoot && D.shadowRoot.activeElement !== null ? m(D.shadowRoot) : D;
|
|
1287
|
+
}, b = function(S) {
|
|
1288
|
+
S !== !1 && S !== m(document) && (S && S.focus ? (S.focus({ preventScroll: !!a.preventScroll }), o.mostRecentlyFocusedNode = S, (function(D) {
|
|
1289
|
+
return D.tagName && D.tagName.toLowerCase() === "input" && typeof D.select == "function";
|
|
1290
|
+
})(S) && S.select()) : b(d()));
|
|
1291
|
+
}, v = function(S) {
|
|
1292
|
+
var D = c("setReturnFocus", { params: [S] });
|
|
1293
|
+
return D || D !== !1 && S;
|
|
1294
|
+
}, h = function(S) {
|
|
1295
|
+
var D = S.target, _ = S.event, M = S.isBackward, F = M !== void 0 && M;
|
|
1296
|
+
D = D || Tt(_), x();
|
|
1297
1297
|
var A = null;
|
|
1298
1298
|
if (o.tabbableGroups.length > 0) {
|
|
1299
|
-
var V = i(
|
|
1299
|
+
var V = i(D, _), B = V >= 0 ? o.containerGroups[V] : void 0;
|
|
1300
1300
|
if (V < 0) A = F ? o.tabbableGroups[o.tabbableGroups.length - 1].lastTabbableNode : o.tabbableGroups[0].firstTabbableNode;
|
|
1301
1301
|
else if (F) {
|
|
1302
1302
|
var z = o.tabbableGroups.findIndex(function(te) {
|
|
1303
1303
|
var le = te.firstTabbableNode;
|
|
1304
|
-
return
|
|
1304
|
+
return D === le;
|
|
1305
1305
|
});
|
|
1306
|
-
if (z < 0 && (B.container ===
|
|
1306
|
+
if (z < 0 && (B.container === D || _t(D, a.tabbableOptions) && !et(D, a.tabbableOptions) && !B.nextTabbableNode(D, !1)) && (z = V), z >= 0) {
|
|
1307
1307
|
var ee = z === 0 ? o.tabbableGroups.length - 1 : z - 1, G = o.tabbableGroups[ee];
|
|
1308
|
-
A = Xe(
|
|
1309
|
-
} else kt(_) || (A = B.nextTabbableNode(
|
|
1308
|
+
A = Xe(D) >= 0 ? G.lastTabbableNode : G.lastDomTabbableNode;
|
|
1309
|
+
} else kt(_) || (A = B.nextTabbableNode(D, !1));
|
|
1310
1310
|
} else {
|
|
1311
1311
|
var Q = o.tabbableGroups.findIndex(function(te) {
|
|
1312
1312
|
var le = te.lastTabbableNode;
|
|
1313
|
-
return
|
|
1313
|
+
return D === le;
|
|
1314
1314
|
});
|
|
1315
|
-
if (Q < 0 && (B.container ===
|
|
1315
|
+
if (Q < 0 && (B.container === D || _t(D, a.tabbableOptions) && !et(D, a.tabbableOptions) && !B.nextTabbableNode(D)) && (Q = V), Q >= 0) {
|
|
1316
1316
|
var oe = Q === o.tabbableGroups.length - 1 ? 0 : Q + 1, se = o.tabbableGroups[oe];
|
|
1317
|
-
A = Xe(
|
|
1318
|
-
} else kt(_) || (A = B.nextTabbableNode(
|
|
1317
|
+
A = Xe(D) >= 0 ? se.firstTabbableNode : se.firstDomTabbableNode;
|
|
1318
|
+
} else kt(_) || (A = B.nextTabbableNode(D));
|
|
1319
1319
|
}
|
|
1320
1320
|
} else A = c("fallbackFocus");
|
|
1321
1321
|
return A;
|
|
1322
|
-
}, f = function(
|
|
1323
|
-
var
|
|
1324
|
-
i(
|
|
1325
|
-
}, y = function(
|
|
1326
|
-
var
|
|
1327
|
-
if (_ ||
|
|
1322
|
+
}, f = function(S) {
|
|
1323
|
+
var D = Tt(S);
|
|
1324
|
+
i(D, S) >= 0 || (gt(a.clickOutsideDeactivates, S) ? n.deactivate({ returnFocus: a.returnFocusOnDeactivate }) : gt(a.allowOutsideClick, S) || S.preventDefault());
|
|
1325
|
+
}, y = function(S) {
|
|
1326
|
+
var D = Tt(S), _ = i(D, S) >= 0;
|
|
1327
|
+
if (_ || D instanceof Document) _ && (o.mostRecentlyFocusedNode = D);
|
|
1328
1328
|
else {
|
|
1329
1329
|
var M;
|
|
1330
|
-
|
|
1330
|
+
S.stopImmediatePropagation();
|
|
1331
1331
|
var F = !0;
|
|
1332
1332
|
if (o.mostRecentlyFocusedNode) if (Xe(o.mostRecentlyFocusedNode) > 0) {
|
|
1333
1333
|
var A = i(o.mostRecentlyFocusedNode), V = o.containerGroups[A].tabbableNodes;
|
|
@@ -1346,53 +1346,53 @@ const ia = Object.freeze(Object.defineProperty({ __proto__: null, createFocusTra
|
|
|
1346
1346
|
F && (M = h({ target: o.mostRecentlyFocusedNode, isBackward: a.isKeyBackward(o.recentNavEvent) })), b(M || o.mostRecentlyFocusedNode || d());
|
|
1347
1347
|
}
|
|
1348
1348
|
o.recentNavEvent = void 0;
|
|
1349
|
-
}, u = function(
|
|
1350
|
-
(a.isKeyForward(
|
|
1349
|
+
}, u = function(S) {
|
|
1350
|
+
(a.isKeyForward(S) || a.isKeyBackward(S)) && (function(D) {
|
|
1351
1351
|
var _ = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
|
|
1352
|
-
o.recentNavEvent =
|
|
1353
|
-
var M = h({ event:
|
|
1354
|
-
M && (kt(
|
|
1355
|
-
})(
|
|
1356
|
-
}, w = function(
|
|
1357
|
-
var
|
|
1358
|
-
((
|
|
1359
|
-
}, E = function(
|
|
1360
|
-
var
|
|
1361
|
-
i(
|
|
1352
|
+
o.recentNavEvent = D;
|
|
1353
|
+
var M = h({ event: D, isBackward: _ });
|
|
1354
|
+
M && (kt(D) && D.preventDefault(), b(M));
|
|
1355
|
+
})(S, a.isKeyBackward(S));
|
|
1356
|
+
}, w = function(S) {
|
|
1357
|
+
var D;
|
|
1358
|
+
((D = S) == null ? void 0 : D.key) !== "Escape" && D?.key !== "Esc" && D?.keyCode !== 27 || gt(a.escapeDeactivates, S) === !1 || (S.preventDefault(), n.deactivate());
|
|
1359
|
+
}, E = function(S) {
|
|
1360
|
+
var D = Tt(S);
|
|
1361
|
+
i(D, S) >= 0 || gt(a.clickOutsideDeactivates, S) || gt(a.allowOutsideClick, S) || (S.preventDefault(), S.stopImmediatePropagation());
|
|
1362
1362
|
}, T = function() {
|
|
1363
1363
|
if (o.active) return ea(s, n), o.delayInitialFocusTimer = a.delayInitialFocus ? Xn(function() {
|
|
1364
1364
|
b(d());
|
|
1365
1365
|
}) : b(d()), t.addEventListener("focusin", y, !0), t.addEventListener("mousedown", f, { capture: !0, passive: !1 }), t.addEventListener("touchstart", f, { capture: !0, passive: !1 }), t.addEventListener("click", E, { capture: !0, passive: !1 }), t.addEventListener("keydown", u, { capture: !0, passive: !1 }), t.addEventListener("keydown", w), n;
|
|
1366
1366
|
}, L = function() {
|
|
1367
1367
|
if (o.active) return t.removeEventListener("focusin", y, !0), t.removeEventListener("mousedown", f, !0), t.removeEventListener("touchstart", f, !0), t.removeEventListener("click", E, !0), t.removeEventListener("keydown", u, !0), t.removeEventListener("keydown", w), n;
|
|
1368
|
-
}, O = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(function(
|
|
1369
|
-
|
|
1370
|
-
return Array.from(
|
|
1368
|
+
}, O = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(function(S) {
|
|
1369
|
+
S.some(function(D) {
|
|
1370
|
+
return Array.from(D.removedNodes).some(function(_) {
|
|
1371
1371
|
return _ === o.mostRecentlyFocusedNode;
|
|
1372
1372
|
});
|
|
1373
1373
|
}) && b(d());
|
|
1374
1374
|
}) : void 0, P = function() {
|
|
1375
|
-
O && (O.disconnect(), o.active && !o.paused && o.containers.map(function(
|
|
1376
|
-
O.observe(
|
|
1375
|
+
O && (O.disconnect(), o.active && !o.paused && o.containers.map(function(S) {
|
|
1376
|
+
O.observe(S, { subtree: !0, childList: !0 });
|
|
1377
1377
|
}));
|
|
1378
1378
|
};
|
|
1379
1379
|
return n = { get active() {
|
|
1380
1380
|
return o.active;
|
|
1381
1381
|
}, get paused() {
|
|
1382
1382
|
return o.paused;
|
|
1383
|
-
}, activate: function(
|
|
1383
|
+
}, activate: function(S) {
|
|
1384
1384
|
if (o.active) return this;
|
|
1385
|
-
var
|
|
1386
|
-
M || x(), o.active = !0, o.paused = !1, o.nodeFocusedBeforeActivation = m(t),
|
|
1385
|
+
var D = l(S, "onActivate"), _ = l(S, "onPostActivate"), M = l(S, "checkCanFocusTrap");
|
|
1386
|
+
M || x(), o.active = !0, o.paused = !1, o.nodeFocusedBeforeActivation = m(t), D?.();
|
|
1387
1387
|
var F = function() {
|
|
1388
1388
|
M && x(), T(), P(), _?.();
|
|
1389
1389
|
};
|
|
1390
1390
|
return M ? (M(o.containers.concat()).then(F, F), this) : (F(), this);
|
|
1391
|
-
}, deactivate: function(
|
|
1391
|
+
}, deactivate: function(S) {
|
|
1392
1392
|
if (!o.active) return this;
|
|
1393
|
-
var
|
|
1393
|
+
var D = Kn({ onDeactivate: a.onDeactivate, onPostDeactivate: a.onPostDeactivate, checkCanReturnFocus: a.checkCanReturnFocus }, S);
|
|
1394
1394
|
clearTimeout(o.delayInitialFocusTimer), o.delayInitialFocusTimer = void 0, L(), o.active = !1, o.paused = !1, P(), ta(s, n);
|
|
1395
|
-
var _ = l(
|
|
1395
|
+
var _ = l(D, "onDeactivate"), M = l(D, "onPostDeactivate"), F = l(D, "checkCanReturnFocus"), A = l(D, "returnFocus", "returnFocusOnDeactivate");
|
|
1396
1396
|
_?.();
|
|
1397
1397
|
var V = function() {
|
|
1398
1398
|
Xn(function() {
|
|
@@ -1400,24 +1400,24 @@ const ia = Object.freeze(Object.defineProperty({ __proto__: null, createFocusTra
|
|
|
1400
1400
|
});
|
|
1401
1401
|
};
|
|
1402
1402
|
return A && F ? (F(v(o.nodeFocusedBeforeActivation)).then(V, V), this) : (V(), this);
|
|
1403
|
-
}, pause: function(
|
|
1404
|
-
return o.active ? (o.manuallyPaused = !0, this._setPausedState(!0,
|
|
1405
|
-
}, unpause: function(
|
|
1406
|
-
return o.active ? (o.manuallyPaused = !1, s[s.length - 1] !== this ? this : this._setPausedState(!1,
|
|
1407
|
-
}, updateContainerElements: function(
|
|
1408
|
-
var
|
|
1409
|
-
return o.containers =
|
|
1403
|
+
}, pause: function(S) {
|
|
1404
|
+
return o.active ? (o.manuallyPaused = !0, this._setPausedState(!0, S)) : this;
|
|
1405
|
+
}, unpause: function(S) {
|
|
1406
|
+
return o.active ? (o.manuallyPaused = !1, s[s.length - 1] !== this ? this : this._setPausedState(!1, S)) : this;
|
|
1407
|
+
}, updateContainerElements: function(S) {
|
|
1408
|
+
var D = [].concat(S).filter(Boolean);
|
|
1409
|
+
return o.containers = D.map(function(_) {
|
|
1410
1410
|
return typeof _ == "string" ? t.querySelector(_) : _;
|
|
1411
1411
|
}), o.active && x(), P(), this;
|
|
1412
1412
|
} }, Object.defineProperties(n, { _isManuallyPaused: { value: function() {
|
|
1413
1413
|
return o.manuallyPaused;
|
|
1414
|
-
} }, _setPausedState: { value: function(
|
|
1415
|
-
if (o.paused ===
|
|
1416
|
-
if (o.paused =
|
|
1417
|
-
var _ = l(
|
|
1414
|
+
} }, _setPausedState: { value: function(S, D) {
|
|
1415
|
+
if (o.paused === S) return this;
|
|
1416
|
+
if (o.paused = S, S) {
|
|
1417
|
+
var _ = l(D, "onPause"), M = l(D, "onPostPause");
|
|
1418
1418
|
_?.(), L(), P(), M?.();
|
|
1419
1419
|
} else {
|
|
1420
|
-
var F = l(
|
|
1420
|
+
var F = l(D, "onUnpause"), A = l(D, "onPostUnpause");
|
|
1421
1421
|
F?.(), x(), T(), P(), A?.();
|
|
1422
1422
|
}
|
|
1423
1423
|
return this;
|
|
@@ -1501,9 +1501,9 @@ var qn, Qn, la = (function() {
|
|
|
1501
1501
|
if (T === void 0 || T === !1) return T;
|
|
1502
1502
|
throw new Error("`".concat(w, "` was specified but was not a node, or did not return a node"));
|
|
1503
1503
|
}
|
|
1504
|
-
var
|
|
1505
|
-
if (typeof T == "string" && !(
|
|
1506
|
-
return
|
|
1504
|
+
var S, D = T;
|
|
1505
|
+
if (typeof T == "string" && !(D = (S = this.getDocument()) === null || S === void 0 ? void 0 : S.querySelector(T))) throw new Error("`".concat(w, "` as selector refers to no known node"));
|
|
1506
|
+
return D;
|
|
1507
1507
|
}), f.handleDeactivate = f.handleDeactivate.bind(f), f.handlePostDeactivate = f.handlePostDeactivate.bind(f), f.handleClickOutsideDeactivates = f.handleClickOutsideDeactivates.bind(f), f.internalOptions = { returnFocusOnDeactivate: !1, checkCanReturnFocus: null, onDeactivate: f.handleDeactivate, onPostDeactivate: f.handlePostDeactivate, clickOutsideDeactivates: f.handleClickOutsideDeactivates }, f.originalOptions = { returnFocusOnDeactivate: !0, onDeactivate: null, onPostDeactivate: null, checkCanReturnFocus: null, clickOutsideDeactivates: !1 };
|
|
1508
1508
|
var y = h.focusTrapOptions;
|
|
1509
1509
|
for (var u in y) Object.prototype.hasOwnProperty.call(y, u) && (u !== "returnFocusOnDeactivate" && u !== "onDeactivate" && u !== "onPostDeactivate" && u !== "checkCanReturnFocus" && u !== "clickOutsideDeactivates" ? f.internalOptions[u] = y[u] : f.originalOptions[u] = y[u]);
|
|
@@ -1963,12 +1963,12 @@ function da() {
|
|
|
1963
1963
|
return this.props?.nodeRef?.current ?? t.default.findDOMNode(this);
|
|
1964
1964
|
}
|
|
1965
1965
|
render() {
|
|
1966
|
-
const { axis: h, bounds: f, children: y, defaultPosition: u, defaultClassName: w, defaultClassNameDragging: E, defaultClassNameDragged: T, position: L, positionOffset: O, scale: P, ...
|
|
1967
|
-
let
|
|
1966
|
+
const { axis: h, bounds: f, children: y, defaultPosition: u, defaultClassName: w, defaultClassNameDragging: E, defaultClassNameDragged: T, position: L, positionOffset: O, scale: P, ...S } = this.props;
|
|
1967
|
+
let D = {}, _ = null;
|
|
1968
1968
|
const M = !L || this.state.dragging, F = L || u, A = { x: (0, o.canDragX)(this) && M ? this.state.x : F.x, y: (0, o.canDragY)(this) && M ? this.state.y : F.y };
|
|
1969
|
-
this.state.isElementSVG ? _ = (0, a.createSVGTransform)(A, O) :
|
|
1969
|
+
this.state.isElementSVG ? _ = (0, a.createSVGTransform)(A, O) : D = (0, a.createCSSTransform)(A, O);
|
|
1970
1970
|
const V = (0, s.clsx)(y.props.className || "", w, { [E]: this.state.dragging, [T]: this.state.dragged });
|
|
1971
|
-
return r.createElement(i.default, x({},
|
|
1971
|
+
return r.createElement(i.default, x({}, S, { onStart: this.onDragStart, onDrag: this.onDrag, onStop: this.onDragStop }), r.cloneElement(r.Children.only(y), { className: V, style: { ...y.props.style, ...D }, transform: _ }));
|
|
1972
1972
|
}
|
|
1973
1973
|
}
|
|
1974
1974
|
e.default = b, m(b, "displayName", "Draggable"), m(b, "propTypes", { ...i.default.propTypes, axis: n.default.oneOf(["both", "x", "y", "none"]), bounds: n.default.oneOfType([n.default.shape({ left: n.default.number, right: n.default.number, top: n.default.number, bottom: n.default.number }), n.default.string, n.default.oneOf([!1])]), defaultClassName: n.default.string, defaultClassNameDragging: n.default.string, defaultClassNameDragged: n.default.string, defaultPosition: n.default.shape({ x: n.default.number, y: n.default.number }), positionOffset: n.default.shape({ x: n.default.oneOfType([n.default.number, n.default.string]), y: n.default.oneOfType([n.default.number, n.default.string]) }), position: n.default.shape({ x: n.default.number, y: n.default.number }), className: l.dontSetMe, style: l.dontSetMe, transform: l.dontSetMe }), m(b, "defaultProps", { ...i.default.defaultProps, axis: "both", bounds: !1, defaultClassName: "react-draggable", defaultClassNameDragging: "react-draggable-dragging", defaultClassNameDragged: "react-draggable-dragged", defaultPosition: { x: 0, y: 0 }, scale: 1 });
|
|
@@ -1984,7 +1984,7 @@ const fa = Ar(pa), lr = { x: 0, y: 0 }, ha = ie(de((e, r) => {
|
|
|
1984
1984
|
const { defaultPosition: n = lr, PaperComponent: t = Et, onDragStop: s, rootSel: a = ".MuiModal-root", handleSel: o = ".draggable-title", titleSize: l, rootSize: i, ...c } = e, d = ge(null), x = Z(() => l && i ? { left: 0, top: 0, right: i.width - l.width, bottom: i.height - l.height } : null, [l, i]), [m, b] = re(null), [v, h] = re(null), [f, y] = re(null);
|
|
1985
1985
|
return Cr(() => {
|
|
1986
1986
|
!m && n && b(n ?? lr);
|
|
1987
|
-
}, [n]),
|
|
1987
|
+
}, [n]), Se(() => {
|
|
1988
1988
|
x && m && h({ x: Math.max(0, Math.min(m.x, x.right)), y: Math.max(0, Math.min(m.y, x.bottom)) });
|
|
1989
1989
|
}, [m, x]), k(fa, { nodeRef: d, handle: o, cancel: '[class*="MuiDialogContent-root"]', position: v, bounds: x ?? ".MuiModal-root", onStop: s, onStart: (u, w) => {
|
|
1990
1990
|
const E = u;
|
|
@@ -1994,19 +1994,19 @@ const fa = Ar(pa), lr = { x: 0, y: 0 }, ha = ie(de((e, r) => {
|
|
|
1994
1994
|
b({ x: T - f.x, y: L - f.y });
|
|
1995
1995
|
}, children: k(t, { ref: At([d, r]), ...c }) });
|
|
1996
1996
|
})), ma = { x: "50", y: "50" }, ga = ie(de((e, r) => {
|
|
1997
|
-
const n = ti({ props: e, name: "MuiDialog" }), t = dn(), s = { enter: 0.66 * t.transitions.duration.enteringScreen, exit: 0.66 * t.transitions.duration.leavingScreen }, { title: a = "SheetXL", key: o = "draggable-window", onCancel: l, onDone: i, onShow: c, onShown: d, onHide: x, onClose: m, open: b, autoFocusSel: v, children: h, transitionDuration: f = s, TransitionProps: y, slots: u = Te.EmptyArray, slotProps: w = Te.EmptyArray, sx: E, className: T, onMouseDown: L, initialPosition: O = ma, isModal: P = !1, ...
|
|
1998
|
-
let
|
|
1997
|
+
const n = ti({ props: e, name: "MuiDialog" }), t = dn(), s = { enter: 0.66 * t.transitions.duration.enteringScreen, exit: 0.66 * t.transitions.duration.leavingScreen }, { title: a = "SheetXL", key: o = "draggable-window", onCancel: l, onDone: i, onShow: c, onShown: d, onHide: x, onClose: m, open: b, autoFocusSel: v, children: h, transitionDuration: f = s, TransitionProps: y, slots: u = Te.EmptyArray, slotProps: w = Te.EmptyArray, sx: E, className: T, onMouseDown: L, initialPosition: O = ma, isModal: P = !1, ...S } = n;
|
|
1998
|
+
let D = u.transition ?? Wo;
|
|
1999
1999
|
const _ = u.backdrop ?? Ho, M = u.paper ?? Et;
|
|
2000
2000
|
let F = w.transition;
|
|
2001
2001
|
y && (F = { ...y, ...F });
|
|
2002
2002
|
const A = w.backdrop, V = w.paper, B = ge(null), [z, ee] = re(null), [G, Q] = re(!1), [oe, se] = re(!1), te = ge(null), [le, ce] = En(), p = ge(null), [g, C] = En(), N = ge(null);
|
|
2003
|
-
|
|
2003
|
+
Se(() => {
|
|
2004
2004
|
z && Q(b);
|
|
2005
2005
|
}, [b, z]);
|
|
2006
2006
|
const I = ae(() => {
|
|
2007
2007
|
l?.(), Q(!1);
|
|
2008
2008
|
}, [l]);
|
|
2009
|
-
|
|
2009
|
+
Se(() => {
|
|
2010
2010
|
if (ce.width === 0 && ce.height === 0 || z) return;
|
|
2011
2011
|
const $ = N.current?.getBoundingClientRect(), ke = ce.height - $.height, ft = ce.width - $.width;
|
|
2012
2012
|
let He = 0.5 * ft, Yt = 0.5 * ke;
|
|
@@ -2033,12 +2033,12 @@ const fa = Ar(pa), lr = { x: 0, y: 0 }, ha = ie(de((e, r) => {
|
|
|
2033
2033
|
}, onEntering: ($, ke) => {
|
|
2034
2034
|
se(!0), d?.(he.current);
|
|
2035
2035
|
} };
|
|
2036
|
-
|
|
2036
|
+
Se(() => {
|
|
2037
2037
|
oe && ue();
|
|
2038
2038
|
}, [oe]);
|
|
2039
|
-
let Ce = k(ca, { focusTrapOptions: { escapeDeactivates: !1, allowOutsideClick: !0, initialFocus: !1 }, ref: B, active: oe, children: k(
|
|
2039
|
+
let Ce = k(ca, { focusTrapOptions: { escapeDeactivates: !1, allowOutsideClick: !0, initialFocus: !1 }, ref: B, active: oe, children: k(D, { in: G, timeout: f, role: "presentation", ...Le, children: k(K, { className: "MuiDialog-container", ref: p, tabIndex: 0, sx: { outline: "none", position: "relative" }, onKeyDown: ($) => {
|
|
2040
2040
|
$.which === Pe.Escape && (I(), te.current?.start($, { center: !1 }), setTimeout(() => te.current?.stop($), 180)), $.stopPropagation();
|
|
2041
|
-
}, children: J(ha, { ref: At([N, r]), className: Oe({ "Mui-focusVisible": R }, T, "draggable"), sx: { "& *": ($) => Xr($), pointerEvents: "auto", userSelect: "none", "&:hover:not([disabled]):not(.Mui-focusVisible)": { outline: ($) => `solid ${me($.palette.text?.primary, 0.2)} 1px` }, "&.Mui-focusVisible": { outline: ($) => `solid ${me($.palette.text?.primary, 0.2)} 1px` }, position: "absolute", maxWidth: "100%", ...E }, defaultPosition: z, titleSize: C, rootSize: ce, PaperComponent: M, ...
|
|
2041
|
+
}, children: J(ha, { ref: At([N, r]), className: Oe({ "Mui-focusVisible": R }, T, "draggable"), sx: { "& *": ($) => Xr($), pointerEvents: "auto", userSelect: "none", "&:hover:not([disabled]):not(.Mui-focusVisible)": { outline: ($) => `solid ${me($.palette.text?.primary, 0.2)} 1px` }, "&.Mui-focusVisible": { outline: ($) => `solid ${me($.palette.text?.primary, 0.2)} 1px` }, position: "absolute", maxWidth: "100%", ...E }, defaultPosition: z, titleSize: C, rootSize: ce, PaperComponent: M, ...S, ...V, children: [a ? k(Uo, { className: Oe({ "Mui-selected": R }, "draggable-title"), sx: { cursor: "move", display: "flex", color: ($) => $.palette.text.secondary, boxSizing: "border-box", padding: "0 0", transitionProperty: "opacity", transitionDuration: ($) => `${$.transitions.duration.shortest}ms`, opacity: 0.7, "&.Mui-selected": { opacity: 1, transitionDuration: ($) => $.transitions.duration.shortest / 2 + "ms" }, backgroundColor: ($) => me($.palette.action.hover, 0.03) }, ref: g, children: J(K, { sx: { display: "flex", flex: "1 1 10%", flexDirection: "row", alignItems: "center", marginTop: ($) => $.spacing(1), marginLeft: ($) => $.spacing(1), marginRight: ($) => $.spacing(1) }, children: [k(K, { sx: { flex: "1 1 100%", paddingLeft: ($) => $.spacing(1) }, children: a }), k(pt, { label: "Close", children: k(Ze, { "aria-label": "close", sx: { color: ($) => $.palette.text.icon ?? $.palette.action.active }, touchRippleRef: te, onPointerDown: ($) => {
|
|
2042
2042
|
te.current?.start($, { center: !1 }), $.stopPropagation(), $.preventDefault();
|
|
2043
2043
|
}, onPointerUp: I, children: k(ye, { iconKey: "Close" }) }) })] }) }) : null, h] }) }) }) }), Y = null;
|
|
2044
2044
|
P && (Y = k(_, { ...A, open: G, onMouseDown: ($) => {
|
|
@@ -2066,10 +2066,10 @@ var Ve = typeof window < "u" ? window : { screen: {}, navigator: {} }, ut = (Ve.
|
|
|
2066
2066
|
} }, cr = function() {
|
|
2067
2067
|
};
|
|
2068
2068
|
Ve.addEventListener && Ve.addEventListener("p", cr, ya), Ve.removeEventListener && Ve.removeEventListener("p", cr, !1);
|
|
2069
|
-
var vn = "ontouchstart" in Ve, ba = vn || "TouchEvent" in Ve && ut("(any-pointer: coarse)").matches, ur = (Ve.navigator.maxTouchPoints || 0) > 0 || ba, mo = Ve.navigator.userAgent || "", va = ut("(pointer: coarse)").matches && /iPad|Macintosh/.test(mo) && Math.min(Ve.screen.width || 0, Ve.screen.height || 0) >= 768, go = (ut("(pointer: coarse)").matches || !ut("(pointer: fine)").matches && vn) && !/Windows.*Firefox/.test(mo), xa = ut("(any-pointer: fine)").matches || ut("(any-hover: hover)").matches || va || !vn, dr = !ur || !xa && go ? ur ? "touchOnly" : "mouseOnly" : "hybrid", wa = dr === "mouseOnly" ? "mouse" : dr === "touchOnly" || go ? "touch" : "mouse",
|
|
2069
|
+
var vn = "ontouchstart" in Ve, ba = vn || "TouchEvent" in Ve && ut("(any-pointer: coarse)").matches, ur = (Ve.navigator.maxTouchPoints || 0) > 0 || ba, mo = Ve.navigator.userAgent || "", va = ut("(pointer: coarse)").matches && /iPad|Macintosh/.test(mo) && Math.min(Ve.screen.width || 0, Ve.screen.height || 0) >= 768, go = (ut("(pointer: coarse)").matches || !ut("(pointer: fine)").matches && vn) && !/Windows.*Firefox/.test(mo), xa = ut("(any-pointer: fine)").matches || ut("(any-hover: hover)").matches || va || !vn, dr = !ur || !xa && go ? ur ? "touchOnly" : "mouseOnly" : "hybrid", wa = dr === "mouseOnly" ? "mouse" : dr === "touchOnly" || go ? "touch" : "mouse", St = (e) => e.type === "checkbox", tt = (e) => e instanceof Date, Re = (e) => e == null;
|
|
2070
2070
|
const yo = (e) => typeof e == "object";
|
|
2071
2071
|
var we = (e) => !Re(e) && !Array.isArray(e) && yo(e) && !tt(e), xn = typeof window < "u" && window.HTMLElement !== void 0 && typeof document < "u";
|
|
2072
|
-
function
|
|
2072
|
+
function De(e) {
|
|
2073
2073
|
let r;
|
|
2074
2074
|
const n = Array.isArray(e), t = typeof FileList < "u" && e instanceof FileList;
|
|
2075
2075
|
if (e instanceof Date) r = new Date(e);
|
|
@@ -2078,7 +2078,7 @@ function Se(e) {
|
|
|
2078
2078
|
if (r = n ? [] : Object.create(Object.getPrototypeOf(e)), n || ((s) => {
|
|
2079
2079
|
const a = s.constructor && s.constructor.prototype;
|
|
2080
2080
|
return we(a) && a.hasOwnProperty("isPrototypeOf");
|
|
2081
|
-
})(e)) for (const s in e) e.hasOwnProperty(s) && (r[s] =
|
|
2081
|
+
})(e)) for (const s in e) e.hasOwnProperty(s) && (r[s] = De(e[s]));
|
|
2082
2082
|
else r = e;
|
|
2083
2083
|
}
|
|
2084
2084
|
return r;
|
|
@@ -2101,7 +2101,7 @@ var Ut = (e) => /^\w*$/.test(e), xe = (e) => e === void 0, on = (e) => Array.isA
|
|
|
2101
2101
|
e[l] = i, e = e[l];
|
|
2102
2102
|
}
|
|
2103
2103
|
};
|
|
2104
|
-
const ka = "blur",
|
|
2104
|
+
const ka = "blur", Sa = "focusout", Da = "onBlur", bo = "onChange", vo = "onSubmit", Oa = "onTouched", Ct = "all", Ca = "max", Ea = "min", Ma = "maxLength", Ta = "minLength", pr = "pattern", fr = "required", Pa = "validate", xo = q.createContext(null);
|
|
2105
2105
|
xo.displayName = "HookFormContext";
|
|
2106
2106
|
const Ra = (e) => {
|
|
2107
2107
|
const { children: r, ...n } = e;
|
|
@@ -2152,7 +2152,7 @@ var Ne = (e) => we(e) && !Object.keys(e).length, kn = (e) => e.type === "file",
|
|
|
2152
2152
|
if (!xn) return !1;
|
|
2153
2153
|
const r = e ? e.ownerDocument : 0;
|
|
2154
2154
|
return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
|
|
2155
|
-
}, ko = (e) => e.type === "select-multiple",
|
|
2155
|
+
}, ko = (e) => e.type === "select-multiple", Sn = (e) => e.type === "radio", Jt = (e) => Bt(e) && e.isConnected;
|
|
2156
2156
|
function ve(e, r) {
|
|
2157
2157
|
const n = Array.isArray(r) ? r : Ut(r) ? [r] : wn(r), t = n.length === 1 ? e : (function(o, l) {
|
|
2158
2158
|
const i = l.slice(0, -1).length;
|
|
@@ -2165,23 +2165,23 @@ function ve(e, r) {
|
|
|
2165
2165
|
return !0;
|
|
2166
2166
|
})(t)) && ve(e, n.slice(0, -1)), e;
|
|
2167
2167
|
}
|
|
2168
|
-
function
|
|
2168
|
+
function So(e) {
|
|
2169
2169
|
return Array.isArray(e) || we(e) && !((r) => {
|
|
2170
2170
|
for (const n in r) if (Be(r[n])) return !0;
|
|
2171
2171
|
return !1;
|
|
2172
2172
|
})(e);
|
|
2173
2173
|
}
|
|
2174
2174
|
function sn(e, r = {}) {
|
|
2175
|
-
for (const n in e)
|
|
2175
|
+
for (const n in e) So(e[n]) ? (r[n] = Array.isArray(e[n]) ? [] : {}, sn(e[n], r[n])) : Re(e[n]) || (r[n] = !0);
|
|
2176
2176
|
return r;
|
|
2177
2177
|
}
|
|
2178
2178
|
function it(e, r, n) {
|
|
2179
2179
|
n || (n = sn(r));
|
|
2180
|
-
for (const t in e)
|
|
2180
|
+
for (const t in e) So(e[t]) ? xe(r) || an(n[t]) ? n[t] = sn(e[t], Array.isArray(e[t]) ? [] : {}) : it(e[t], Re(r) ? {} : r[t], n[t]) : n[t] = !qe(e[t], r[t]);
|
|
2181
2181
|
return n;
|
|
2182
2182
|
}
|
|
2183
2183
|
const mr = { value: !1, isValid: !1 }, gr = { value: !0, isValid: !0 };
|
|
2184
|
-
var
|
|
2184
|
+
var Do = (e) => {
|
|
2185
2185
|
if (Array.isArray(e)) {
|
|
2186
2186
|
if (e.length > 1) {
|
|
2187
2187
|
const r = e.filter((n) => n && n.checked && !n.disabled).map((n) => n.value);
|
|
@@ -2195,20 +2195,20 @@ const yr = { isValid: !1, value: null };
|
|
|
2195
2195
|
var Co = (e) => Array.isArray(e) ? e.reduce((r, n) => n && n.checked && !n.disabled ? { isValid: !0, value: n.value } : r, yr) : yr;
|
|
2196
2196
|
function br(e) {
|
|
2197
2197
|
const r = e.ref;
|
|
2198
|
-
return kn(r) ? r.files :
|
|
2198
|
+
return kn(r) ? r.files : Sn(r) ? Co(e.refs).value : ko(r) ? [...r.selectedOptions].map(({ value: n }) => n) : St(r) ? Do(e.refs).value : Oo(xe(r.value) ? e.ref.value : r.value, e);
|
|
2199
2199
|
}
|
|
2200
|
-
var jt = (e) => e instanceof RegExp, vt = (e) => xe(e) ? e : jt(e) ? e.source : we(e) ? jt(e.value) ? e.value.source : e.value : e, vr = (e) => ({ isOnSubmit: !e || e === vo, isOnBlur: e ===
|
|
2200
|
+
var jt = (e) => e instanceof RegExp, vt = (e) => xe(e) ? e : jt(e) ? e.source : we(e) ? jt(e.value) ? e.value.source : e.value : e, vr = (e) => ({ isOnSubmit: !e || e === vo, isOnBlur: e === Da, isOnChange: e === bo, isOnAll: e === Ct, isOnTouch: e === Oa });
|
|
2201
2201
|
const xr = "AsyncFunction";
|
|
2202
2202
|
var _a = (e) => !!e && !!e.validate && !!(Be(e.validate) && e.validate.constructor.name === xr || we(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === xr)), wr = (e, r, n) => !n && (r.watchAll || r.watch.has(e) || [...r.watch].some((t) => e.startsWith(t) && /^\.\w+/.test(e.slice(t.length))));
|
|
2203
|
-
const
|
|
2203
|
+
const Dt = (e, r, n, t) => {
|
|
2204
2204
|
for (const s of n || Object.keys(e)) {
|
|
2205
2205
|
const a = W(e, s);
|
|
2206
2206
|
if (a) {
|
|
2207
2207
|
const { _f: o, ...l } = a;
|
|
2208
2208
|
if (o) {
|
|
2209
2209
|
if (o.refs && o.refs[0] && r(o.refs[0], s) && !t || o.ref && r(o.ref, o.name) && !t) return !0;
|
|
2210
|
-
if (
|
|
2211
|
-
} else if (we(l) &&
|
|
2210
|
+
if (Dt(l, r)) break;
|
|
2211
|
+
} else if (we(l) && Dt(l, r)) break;
|
|
2212
2212
|
}
|
|
2213
2213
|
}
|
|
2214
2214
|
};
|
|
@@ -2229,23 +2229,23 @@ var Aa = (e, r, n) => {
|
|
|
2229
2229
|
const t = xt(W(e, n));
|
|
2230
2230
|
return fe(t, "root", r[n]), fe(e, n, t), e;
|
|
2231
2231
|
};
|
|
2232
|
-
function
|
|
2232
|
+
function Sr(e, r, n = "validate") {
|
|
2233
2233
|
if (Fe(e) || Array.isArray(e) && e.every(Fe) || $e(e) && !e) return { type: n, message: Fe(e) ? e : "", ref: r };
|
|
2234
2234
|
}
|
|
2235
|
-
var ot = (e) => we(e) && !jt(e) ? e : { value: e, message: "" },
|
|
2235
|
+
var ot = (e) => we(e) && !jt(e) ? e : { value: e, message: "" }, Dr = async (e, r, n, t, s, a) => {
|
|
2236
2236
|
const { ref: o, refs: l, required: i, maxLength: c, minLength: d, min: x, max: m, pattern: b, validate: v, name: h, valueAsNumber: f, mount: y } = e._f, u = W(n, h);
|
|
2237
2237
|
if (!y || r.has(h)) return {};
|
|
2238
2238
|
const w = l ? l[0] : o, E = (M) => {
|
|
2239
2239
|
s && w.reportValidity && (w.setCustomValidity($e(M) ? "" : M || ""), w.reportValidity());
|
|
2240
|
-
}, T = {}, L =
|
|
2240
|
+
}, T = {}, L = Sn(o), O = St(o), P = L || O, S = (f || kn(o)) && xe(o.value) && xe(u) || Bt(o) && o.value === "" || u === "" || Array.isArray(u) && !u.length, D = Fa.bind(null, h, t, T), _ = (M, F, A, V = Ma, B = Ta) => {
|
|
2241
2241
|
const z = M ? F : A;
|
|
2242
|
-
T[h] = { type: M ? V : B, message: z, ref: o, ...
|
|
2242
|
+
T[h] = { type: M ? V : B, message: z, ref: o, ...D(M ? V : B, z) };
|
|
2243
2243
|
};
|
|
2244
|
-
if (a ? !Array.isArray(u) || !u.length : i && (!P && (
|
|
2244
|
+
if (a ? !Array.isArray(u) || !u.length : i && (!P && (S || Re(u)) || $e(u) && !u || O && !Do(l).isValid || L && !Co(l).isValid)) {
|
|
2245
2245
|
const { value: M, message: F } = Fe(i) ? { value: !!i, message: i } : ot(i);
|
|
2246
|
-
if (M && (T[h] = { type: fr, message: F, ref: w, ...
|
|
2246
|
+
if (M && (T[h] = { type: fr, message: F, ref: w, ...D(fr, F) }, !t)) return E(F), T;
|
|
2247
2247
|
}
|
|
2248
|
-
if (!(
|
|
2248
|
+
if (!(S || Re(x) && Re(m))) {
|
|
2249
2249
|
let M, F;
|
|
2250
2250
|
const A = ot(m), V = ot(x);
|
|
2251
2251
|
if (Re(u) || isNaN(u)) {
|
|
@@ -2257,24 +2257,24 @@ var ot = (e) => we(e) && !jt(e) ? e : { value: e, message: "" }, Sr = async (e,
|
|
|
2257
2257
|
}
|
|
2258
2258
|
if ((M || F) && (_(!!M, A.message, V.message, Ca, Ea), !t)) return E(T[h].message), T;
|
|
2259
2259
|
}
|
|
2260
|
-
if ((c || d) && !
|
|
2260
|
+
if ((c || d) && !S && (Fe(u) || a && Array.isArray(u))) {
|
|
2261
2261
|
const M = ot(c), F = ot(d), A = !Re(M.value) && u.length > +M.value, V = !Re(F.value) && u.length < +F.value;
|
|
2262
2262
|
if ((A || V) && (_(A, M.message, F.message), !t)) return E(T[h].message), T;
|
|
2263
2263
|
}
|
|
2264
|
-
if (b && !
|
|
2264
|
+
if (b && !S && Fe(u)) {
|
|
2265
2265
|
const { value: M, message: F } = ot(b);
|
|
2266
|
-
if (jt(M) && !u.match(M) && (T[h] = { type: pr, message: F, ref: o, ...
|
|
2266
|
+
if (jt(M) && !u.match(M) && (T[h] = { type: pr, message: F, ref: o, ...D(pr, F) }, !t)) return E(F), T;
|
|
2267
2267
|
}
|
|
2268
2268
|
if (v) {
|
|
2269
2269
|
if (Be(v)) {
|
|
2270
|
-
const M =
|
|
2271
|
-
if (M && (T[h] = { ...M, ...
|
|
2270
|
+
const M = Sr(await v(u, n), w);
|
|
2271
|
+
if (M && (T[h] = { ...M, ...D(Pa, M.message) }, !t)) return E(M.message), T;
|
|
2272
2272
|
} else if (we(v)) {
|
|
2273
2273
|
let M = {};
|
|
2274
2274
|
for (const F in v) {
|
|
2275
2275
|
if (!Ne(M) && !t) break;
|
|
2276
|
-
const A =
|
|
2277
|
-
A && (M = { ...A, ...
|
|
2276
|
+
const A = Sr(await v[F](u, n), w, F);
|
|
2277
|
+
A && (M = { ...A, ...D(F, A.message) }, E(A.message), t && (T[h] = M));
|
|
2278
2278
|
}
|
|
2279
2279
|
if (!Ne(M) && (T[h] = { ref: w, ...M }, !t)) return T;
|
|
2280
2280
|
}
|
|
@@ -2283,7 +2283,7 @@ var ot = (e) => we(e) && !jt(e) ? e : { value: e, message: "" }, Sr = async (e,
|
|
|
2283
2283
|
};
|
|
2284
2284
|
const Ia = { mode: vo, reValidateMode: bo, shouldFocusError: !0 };
|
|
2285
2285
|
function Va(e = {}) {
|
|
2286
|
-
let r, n = { ...Ia, ...e }, t = { submitCount: 0, isDirty: !1, isReady: !1, isLoading: Be(n.defaultValues), isValidating: !1, isSubmitted: !1, isSubmitting: !1, isSubmitSuccessful: !1, isValid: !1, touchedFields: {}, dirtyFields: {}, validatingFields: {}, errors: n.errors || {}, disabled: n.disabled || !1 }, s = {}, a = (we(n.defaultValues) || we(n.values)) &&
|
|
2286
|
+
let r, n = { ...Ia, ...e }, t = { submitCount: 0, isDirty: !1, isReady: !1, isLoading: Be(n.defaultValues), isValidating: !1, isSubmitted: !1, isSubmitting: !1, isSubmitSuccessful: !1, isValid: !1, touchedFields: {}, dirtyFields: {}, validatingFields: {}, errors: n.errors || {}, disabled: n.disabled || !1 }, s = {}, a = (we(n.defaultValues) || we(n.values)) && De(n.defaultValues || n.values) || {}, o = n.shouldUnregister ? {} : De(a), l = { action: !1, mount: !1, watch: !1 }, i = { mount: /* @__PURE__ */ new Set(), disabled: /* @__PURE__ */ new Set(), unMount: /* @__PURE__ */ new Set(), array: /* @__PURE__ */ new Set(), watch: /* @__PURE__ */ new Set() }, c = 0;
|
|
2287
2287
|
const d = { isDirty: !1, dirtyFields: !1, validatingFields: !1, touchedFields: !1, isValidating: !1, isValid: !1, errors: !1 };
|
|
2288
2288
|
let x = { ...d };
|
|
2289
2289
|
const m = { array: hr(), state: hr() }, b = n.criteriaMode === Ct, v = async (p) => {
|
|
@@ -2347,7 +2347,7 @@ function Va(e = {}) {
|
|
|
2347
2347
|
if (R) {
|
|
2348
2348
|
const H = i.array.has(R.name), U = I._f && _a(I._f);
|
|
2349
2349
|
U && d.validatingFields && h([R.name], !0);
|
|
2350
|
-
const X = await
|
|
2350
|
+
const X = await Dr(I, i.disabled, o, b, n.shouldUseNativeValidation && !g, H);
|
|
2351
2351
|
if (U && d.validatingFields && h([R.name]), X[R.name] && (C.valid = !1, g)) break;
|
|
2352
2352
|
!g && (W(X, R.name) ? H ? Aa(t.errors, X, R.name) : fe(t.errors, R.name, X[R.name]) : ve(t.errors, R.name));
|
|
2353
2353
|
}
|
|
@@ -2360,9 +2360,9 @@ function Va(e = {}) {
|
|
|
2360
2360
|
let I = g;
|
|
2361
2361
|
if (N) {
|
|
2362
2362
|
const R = N._f;
|
|
2363
|
-
R && (!R.disabled && fe(o, p, Oo(g, R)), I = Bt(R.ref) && Re(g) ? "" : g, ko(R.ref) ? [...R.ref.options].forEach((j) => j.selected = I.includes(j.value)) : R.refs ?
|
|
2363
|
+
R && (!R.disabled && fe(o, p, Oo(g, R)), I = Bt(R.ref) && Re(g) ? "" : g, ko(R.ref) ? [...R.ref.options].forEach((j) => j.selected = I.includes(j.value)) : R.refs ? St(R.ref) ? R.refs.forEach((j) => {
|
|
2364
2364
|
j.defaultChecked && j.disabled || (Array.isArray(I) ? j.checked = !!I.find((H) => H === j.value) : j.checked = I === j.value || !!I);
|
|
2365
|
-
}) : R.refs.forEach((j) => j.checked = j.value === I) : kn(R.ref) ? R.ref.value = "" : (R.ref.value = I, R.ref.type || m.state.next({ name: p, values:
|
|
2365
|
+
}) : R.refs.forEach((j) => j.checked = j.value === I) : kn(R.ref) ? R.ref.value = "" : (R.ref.value = I, R.ref.type || m.state.next({ name: p, values: De(o) })));
|
|
2366
2366
|
}
|
|
2367
2367
|
(C.shouldDirty || C.shouldTouch) && y(p, I, C.shouldTouch, C.shouldDirty, !0), C.shouldValidate && M(p);
|
|
2368
2368
|
}, P = (p, g, C) => {
|
|
@@ -2371,10 +2371,10 @@ function Va(e = {}) {
|
|
|
2371
2371
|
const I = g[N], R = p + "." + N, j = W(s, R);
|
|
2372
2372
|
(i.array.has(p) || we(I) || j && !j._f) && !tt(I) ? P(R, I, C) : O(R, I, C);
|
|
2373
2373
|
}
|
|
2374
|
-
},
|
|
2375
|
-
const N = W(s, p), I = i.array.has(p), R =
|
|
2376
|
-
fe(o, p, R), I ? (m.array.next({ name: p, values:
|
|
2377
|
-
},
|
|
2374
|
+
}, S = (p, g, C = {}) => {
|
|
2375
|
+
const N = W(s, p), I = i.array.has(p), R = De(g);
|
|
2376
|
+
fe(o, p, R), I ? (m.array.next({ name: p, values: De(o) }), (d.isDirty || d.dirtyFields || x.isDirty || x.dirtyFields) && C.shouldDirty && m.state.next({ name: p, dirtyFields: it(a, o), isDirty: T(p, R) })) : !N || N._f || Re(R) ? O(p, R, C) : P(p, R, C), wr(p, i) && m.state.next({ ...t, name: p }), m.state.next({ name: l.mount ? p : void 0, values: De(o) });
|
|
2377
|
+
}, D = async (p) => {
|
|
2378
2378
|
l.mount = !0;
|
|
2379
2379
|
const g = p.target;
|
|
2380
2380
|
let C = g.name, N = !0;
|
|
@@ -2383,17 +2383,17 @@ function Va(e = {}) {
|
|
|
2383
2383
|
}, j = vr(n.mode), H = vr(n.reValidateMode);
|
|
2384
2384
|
if (I) {
|
|
2385
2385
|
let U, X;
|
|
2386
|
-
const ne = g.type ? br(I._f) : ((pe) => we(pe) && pe.target ?
|
|
2386
|
+
const ne = g.type ? br(I._f) : ((pe) => we(pe) && pe.target ? St(pe.target) ? pe.target.checked : pe.target.value : pe)(p), ue = p.type === ka || p.type === Sa, he = !((pe) => pe.mount && (pe.required || pe.min || pe.max || pe.maxLength || pe.minLength || pe.pattern || pe.validate))(I._f) && !n.resolver && !W(t.errors, C) && !I._f.deps || ((pe, $, ke, ft, He) => !He.isOnAll && (!ke && He.isOnTouch ? !($ || pe) : (ke ? ft.isOnBlur : He.isOnBlur) ? !pe : !(ke ? ft.isOnChange : He.isOnChange) || pe))(ue, W(t.touchedFields, C), t.isSubmitted, H, j), Le = wr(C, i, ue);
|
|
2387
2387
|
fe(o, C, ne), ue ? g && g.readOnly || (I._f.onBlur && I._f.onBlur(p), r && r(0)) : I._f.onChange && I._f.onChange(p);
|
|
2388
2388
|
const Ce = y(C, ne, ue), Y = !Ne(Ce) || Le;
|
|
2389
|
-
if (!ue && m.state.next({ name: C, type: p.type, values:
|
|
2389
|
+
if (!ue && m.state.next({ name: C, type: p.type, values: De(o) }), he) return (d.isValid || x.isValid) && (n.mode === "onBlur" ? ue && v() : ue || v()), Y && m.state.next({ name: C, ...Le ? {} : Ce });
|
|
2390
2390
|
if (!ue && Le && m.state.next({ ...t }), n.resolver) {
|
|
2391
2391
|
const { errors: pe } = await w([C]);
|
|
2392
2392
|
if (R(ne), N) {
|
|
2393
2393
|
const $ = kr(t.errors, s, C), ke = kr(pe, s, $.name || C);
|
|
2394
2394
|
U = ke.error, C = ke.name, X = Ne(pe);
|
|
2395
2395
|
}
|
|
2396
|
-
} else h([C], !0), U = (await
|
|
2396
|
+
} else h([C], !0), U = (await Dr(I, i.disabled, o, b, n.shouldUseNativeValidation))[C], h([C]), R(ne), N && (U ? X = !1 : (d.isValid || x.isValid) && (X = await E(s, !0)));
|
|
2397
2397
|
N && (I._f.deps && (!Array.isArray(I._f.deps) || I._f.deps.length > 0) && M(I._f.deps), u(C, X, U, Ce));
|
|
2398
2398
|
}
|
|
2399
2399
|
}, _ = (p, g) => {
|
|
@@ -2416,7 +2416,7 @@ function Va(e = {}) {
|
|
|
2416
2416
|
const j = W(s, R);
|
|
2417
2417
|
return await E(j && j._f ? { [R]: j } : j);
|
|
2418
2418
|
}))).every(Boolean), (N || t.isValid) && v()) : N = C = await E(s);
|
|
2419
|
-
return m.state.next({ ...!Fe(p) || (d.isValid || x.isValid) && C !== t.isValid ? {} : { name: p }, ...n.resolver || !p ? { isValid: C } : {}, errors: t.errors }), g.shouldFocus && !N &&
|
|
2419
|
+
return m.state.next({ ...!Fe(p) || (d.isValid || x.isValid) && C !== t.isValid ? {} : { name: p }, ...n.resolver || !p ? { isValid: C } : {}, errors: t.errors }), g.shouldFocus && !N && Dt(s, _, p ? I : i.mount), N;
|
|
2420
2420
|
}, F = (p, g) => {
|
|
2421
2421
|
let C = { ...l.mount ? o : a };
|
|
2422
2422
|
return g && (C = wo(g.dirtyFields ? t.dirtyFields : t.touchedFields, C)), xe(p) ? C : Fe(p) ? W(C, p) : p.map((N) => W(C, N));
|
|
@@ -2432,27 +2432,27 @@ function Va(e = {}) {
|
|
|
2432
2432
|
})(g, p.formState || d, le, p.reRenderRoot) || p.callback({ values: { ...o }, ...t, ...g, defaultValues: a });
|
|
2433
2433
|
} }).unsubscribe, z = (p, g = {}) => {
|
|
2434
2434
|
for (const C of p ? xt(p) : i.mount) i.mount.delete(C), i.array.delete(C), g.keepValue || (ve(s, C), ve(o, C)), !g.keepError && ve(t.errors, C), !g.keepDirty && ve(t.dirtyFields, C), !g.keepTouched && ve(t.touchedFields, C), !g.keepIsValidating && ve(t.validatingFields, C), !n.shouldUnregister && !g.keepDefaultValue && ve(a, C);
|
|
2435
|
-
m.state.next({ values:
|
|
2435
|
+
m.state.next({ values: De(o) }), m.state.next({ ...t, ...g.keepDirty ? { isDirty: T() } : {} }), !g.keepIsValid && v();
|
|
2436
2436
|
}, ee = ({ disabled: p, name: g }) => {
|
|
2437
2437
|
($e(p) && l.mount || p || i.disabled.has(g)) && (p ? i.disabled.add(g) : i.disabled.delete(g));
|
|
2438
2438
|
}, G = (p, g = {}) => {
|
|
2439
2439
|
let C = W(s, p);
|
|
2440
2440
|
const N = $e(g.disabled) || $e(n.disabled);
|
|
2441
|
-
return fe(s, p, { ...C || {}, _f: { ...C && C._f ? C._f : { ref: { name: p } }, name: p, mount: !0, ...g } }), i.mount.add(p), C ? ee({ disabled: $e(g.disabled) ? g.disabled : n.disabled, name: p }) : f(p, !0, g.value), { ...N ? { disabled: g.disabled || n.disabled } : {}, ...n.progressive ? { required: !!g.required, min: vt(g.min), max: vt(g.max), minLength: vt(g.minLength), maxLength: vt(g.maxLength), pattern: vt(g.pattern) } : {}, name: p, onChange:
|
|
2441
|
+
return fe(s, p, { ...C || {}, _f: { ...C && C._f ? C._f : { ref: { name: p } }, name: p, mount: !0, ...g } }), i.mount.add(p), C ? ee({ disabled: $e(g.disabled) ? g.disabled : n.disabled, name: p }) : f(p, !0, g.value), { ...N ? { disabled: g.disabled || n.disabled } : {}, ...n.progressive ? { required: !!g.required, min: vt(g.min), max: vt(g.max), minLength: vt(g.minLength), maxLength: vt(g.maxLength), pattern: vt(g.pattern) } : {}, name: p, onChange: D, onBlur: D, ref: (I) => {
|
|
2442
2442
|
if (I) {
|
|
2443
2443
|
G(p, g), C = W(s, p);
|
|
2444
|
-
const R = xe(I.value) && I.querySelectorAll && I.querySelectorAll("input,select,textarea")[0] || I, j = ((U) =>
|
|
2444
|
+
const R = xe(I.value) && I.querySelectorAll && I.querySelectorAll("input,select,textarea")[0] || I, j = ((U) => Sn(U) || St(U))(R), H = C._f.refs || [];
|
|
2445
2445
|
if (j ? H.find((U) => U === R) : R === C._f.ref) return;
|
|
2446
2446
|
fe(s, p, { _f: { ...C._f, ...j ? { refs: [...H.filter(Jt), R, ...Array.isArray(W(a, p)) ? [{}] : []], ref: { type: R.type, name: p } } : { ref: R } } }), f(p, !1, void 0, R);
|
|
2447
2447
|
} else C = W(s, p, {}), C._f && (C._f.mount = !1), (n.shouldUnregister || g.shouldUnregister) && (!((R, j) => R.has(((H) => H.substring(0, H.search(/\.\d+(\.|$)/)) || H)(j)))(i.array, p) || !l.action) && i.unMount.add(p);
|
|
2448
2448
|
} };
|
|
2449
|
-
}, Q = () => n.shouldFocusError &&
|
|
2449
|
+
}, Q = () => n.shouldFocusError && Dt(s, _, i.mount), oe = (p, g) => async (C) => {
|
|
2450
2450
|
let N;
|
|
2451
2451
|
C && (C.preventDefault && C.preventDefault(), C.persist && C.persist());
|
|
2452
|
-
let I =
|
|
2452
|
+
let I = De(o);
|
|
2453
2453
|
if (m.state.next({ isSubmitting: !0 }), n.resolver) {
|
|
2454
2454
|
const { errors: R, values: j } = await w();
|
|
2455
|
-
t.errors = R, I =
|
|
2455
|
+
t.errors = R, I = De(j);
|
|
2456
2456
|
} else await E(s);
|
|
2457
2457
|
if (i.disabled.size) for (const R of i.disabled) ve(I, R);
|
|
2458
2458
|
if (ve(t.errors, "root"), Ne(t.errors)) {
|
|
@@ -2465,11 +2465,11 @@ function Va(e = {}) {
|
|
|
2465
2465
|
} else g && await g({ ...t.errors }, C), Q(), setTimeout(Q);
|
|
2466
2466
|
if (m.state.next({ isSubmitted: !0, isSubmitting: !1, isSubmitSuccessful: Ne(t.errors) && !N, submitCount: t.submitCount + 1, errors: t.errors }), N) throw N;
|
|
2467
2467
|
}, se = (p, g = {}) => {
|
|
2468
|
-
const C = p ?
|
|
2468
|
+
const C = p ? De(p) : a, N = De(C), I = Ne(p), R = I ? a : N;
|
|
2469
2469
|
if (g.keepDefaultValues || (a = C), !g.keepValues) {
|
|
2470
2470
|
if (g.keepDirtyValues) {
|
|
2471
2471
|
const j = /* @__PURE__ */ new Set([...i.mount, ...Object.keys(it(a, o))]);
|
|
2472
|
-
for (const H of Array.from(j)) W(t.dirtyFields, H) ? fe(R, H, W(o, H)) :
|
|
2472
|
+
for (const H of Array.from(j)) W(t.dirtyFields, H) ? fe(R, H, W(o, H)) : S(H, W(R, H));
|
|
2473
2473
|
} else {
|
|
2474
2474
|
if (xn && xe(p)) for (const j of i.mount) {
|
|
2475
2475
|
const H = W(s, j);
|
|
@@ -2484,10 +2484,10 @@ function Va(e = {}) {
|
|
|
2484
2484
|
}
|
|
2485
2485
|
}
|
|
2486
2486
|
}
|
|
2487
|
-
if (g.keepFieldsRef) for (const j of i.mount)
|
|
2487
|
+
if (g.keepFieldsRef) for (const j of i.mount) S(j, W(R, j));
|
|
2488
2488
|
else s = {};
|
|
2489
2489
|
}
|
|
2490
|
-
o = n.shouldUnregister ? g.keepDefaultValues ?
|
|
2490
|
+
o = n.shouldUnregister ? g.keepDefaultValues ? De(a) : {} : De(R), m.array.next({ values: { ...R } }), m.state.next({ values: { ...R } });
|
|
2491
2491
|
}
|
|
2492
2492
|
i = { mount: g.keepDirtyValues ? i.mount : /* @__PURE__ */ new Set(), unMount: /* @__PURE__ */ new Set(), array: /* @__PURE__ */ new Set(), disabled: /* @__PURE__ */ new Set(), watch: /* @__PURE__ */ new Set(), watchAll: !1, focus: "" }, l.mount = !d.isValid || !!g.keepIsValid || !!g.keepDirtyValues, l.watch = !!n.shouldUnregister, m.state.next({ submitCount: g.keepSubmitCount ? t.submitCount : 0, isDirty: !I && (g.keepDirty ? t.isDirty : !(!g.keepDefaultValues || qe(p, a))), isSubmitted: !!g.keepIsSubmitted && t.isSubmitted, dirtyFields: I ? {} : g.keepDirtyValues ? g.keepDefaultValues && o ? it(a, o) : t.dirtyFields : g.keepDefaultValues && p ? it(a, p) : g.keepDirty ? t.dirtyFields : {}, touchedFields: g.keepTouched ? t.touchedFields : {}, errors: g.keepErrors ? t.errors : {}, isSubmitSuccessful: !!g.keepIsSubmitSuccessful && t.isSubmitSuccessful, isSubmitting: !1, defaultValues: a });
|
|
2493
2493
|
}, te = (p, g) => se(Be(p) ? p(o) : p, g), le = (p) => {
|
|
@@ -2521,7 +2521,7 @@ function Va(e = {}) {
|
|
|
2521
2521
|
}
|
|
2522
2522
|
i.unMount = /* @__PURE__ */ new Set();
|
|
2523
2523
|
}, _disableForm: (p) => {
|
|
2524
|
-
$e(p) && (m.state.next({ disabled: p }),
|
|
2524
|
+
$e(p) && (m.state.next({ disabled: p }), Dt(s, (g, C) => {
|
|
2525
2525
|
const N = W(s, C);
|
|
2526
2526
|
N && (g.disabled = N._f.disabled || p, Array.isArray(N._f.refs) && N._f.refs.forEach((I) => {
|
|
2527
2527
|
I.disabled = N._f.disabled || p;
|
|
@@ -2547,8 +2547,8 @@ function Va(e = {}) {
|
|
|
2547
2547
|
return n;
|
|
2548
2548
|
}, set _options(p) {
|
|
2549
2549
|
n = { ...n, ...p };
|
|
2550
|
-
} }, subscribe: (p) => (l.mount = !0, x = { ...x, ...p.formState }, B({ ...p, formState: x })), trigger: M, register: G, handleSubmit: oe, watch: (p, g) => Be(p) ? m.state.subscribe({ next: (C) => "values" in C && p(L(void 0, g), C) }) : L(p, g, !0), setValue:
|
|
2551
|
-
W(s, p) && (xe(g.defaultValue) ?
|
|
2550
|
+
} }, subscribe: (p) => (l.mount = !0, x = { ...x, ...p.formState }, B({ ...p, formState: x })), trigger: M, register: G, handleSubmit: oe, watch: (p, g) => Be(p) ? m.state.subscribe({ next: (C) => "values" in C && p(L(void 0, g), C) }) : L(p, g, !0), setValue: S, getValues: F, reset: te, resetField: (p, g = {}) => {
|
|
2551
|
+
W(s, p) && (xe(g.defaultValue) ? S(p, De(W(a, p))) : (S(p, g.defaultValue), fe(a, p, De(g.defaultValue))), g.keepTouched || ve(t.touchedFields, p), g.keepDirty || (ve(t.dirtyFields, p), t.isDirty = g.defaultValue ? T(p, De(W(a, p))) : T()), g.keepError || (ve(t.errors, p), d.isValid && v()), m.state.next({ ...t }));
|
|
2552
2552
|
}, clearErrors: (p) => {
|
|
2553
2553
|
p && xt(p).forEach((g) => ve(t.errors, g)), m.state.next({ errors: p ? t.errors : {} });
|
|
2554
2554
|
}, unregister: z, setError: V, setFocus: (p, g = {}) => {
|
|
@@ -2609,12 +2609,12 @@ const Ba = ["Ok", "Cancel"], Or = ie(de((e, r) => {
|
|
|
2609
2609
|
}, 180);
|
|
2610
2610
|
}, [L]), P = ae(() => {
|
|
2611
2611
|
a?.(m, !0, !1), s?.(), o?.(null);
|
|
2612
|
-
}, [a, m, s, o]),
|
|
2612
|
+
}, [a, m, s, o]), S = u && (Object.keys(u.errors).length > 0 || u.disabled || u.isSubmitted), D = ae((M, F) => {
|
|
2613
2613
|
const A = M === m, V = { className: F ? "defaultOption" : "action", type: F ? "submit" : "button", style: { minWidth: "75px" }, onClick: () => {
|
|
2614
2614
|
A ? P() : F || L(M);
|
|
2615
2615
|
} };
|
|
2616
2616
|
if (i) return i(M, V, F);
|
|
2617
|
-
const B = { className: F ? "defaultOption" : "action", variant: F ? "contained" : "outlined", size: "small", disabled: !A &&
|
|
2617
|
+
const B = { className: F ? "defaultOption" : "action", variant: F ? "contained" : "outlined", size: "small", disabled: !A && S, color: "primary", ...V };
|
|
2618
2618
|
if (F || A) {
|
|
2619
2619
|
const z = F ? w : E;
|
|
2620
2620
|
B.touchRippleRef = z, B.onPointerDown = (ee) => {
|
|
@@ -2626,7 +2626,7 @@ const Ba = ["Ok", "Cancel"], Or = ie(de((e, r) => {
|
|
|
2626
2626
|
const M = [];
|
|
2627
2627
|
for (let F = 0; F < c.length; F++) {
|
|
2628
2628
|
const A = c[F], V = x ? A === x : F === 0;
|
|
2629
|
-
M.push(
|
|
2629
|
+
M.push(D(A, V));
|
|
2630
2630
|
}
|
|
2631
2631
|
return M;
|
|
2632
2632
|
}, [c, x, u]);
|
|
@@ -2637,7 +2637,7 @@ const Ba = ["Ok", "Cancel"], Or = ie(de((e, r) => {
|
|
|
2637
2637
|
const V = M.which === Pe.Escape && m;
|
|
2638
2638
|
if (V) F = m, A = E;
|
|
2639
2639
|
else {
|
|
2640
|
-
if (
|
|
2640
|
+
if (S) return;
|
|
2641
2641
|
M.which === Pe.Enter && (F = x ?? c[0], A = w);
|
|
2642
2642
|
}
|
|
2643
2643
|
F && (A.current?.start(M, { center: !1 }), setTimeout(() => {
|
|
@@ -2653,7 +2653,7 @@ const Ba = ["Ok", "Cancel"], Or = ie(de((e, r) => {
|
|
|
2653
2653
|
n?.onDone?.(), s.hide();
|
|
2654
2654
|
} });
|
|
2655
2655
|
});
|
|
2656
|
-
}, za = q.lazy(() => import("./
|
|
2656
|
+
}, za = q.lazy(() => import("./CMpdAXnJ5EbLrOu2.mjs")), Es = (e) => {
|
|
2657
2657
|
const { showModal: r } = gn();
|
|
2658
2658
|
return (n) => {
|
|
2659
2659
|
const { defaultOption: t = n.options?.[0], cancelOption: s = "Cancel", ...a } = n;
|
|
@@ -2667,15 +2667,15 @@ const Ba = ["Ok", "Cancel"], Or = ie(de((e, r) => {
|
|
|
2667
2667
|
} });
|
|
2668
2668
|
});
|
|
2669
2669
|
};
|
|
2670
|
-
},
|
|
2670
|
+
}, Dn = ie(de((e, r) => {
|
|
2671
2671
|
const { command: n, disabled: t = !1, shortcut: s, children: a, ...o } = e;
|
|
2672
2672
|
return cn(n), k(pt, { ref: r, label: t !== void 0 ? n?.label() : "", shortcut: s !== void 0 ? s : Array.isArray(n?.shortcut()) ? n?.shortcut()[0] : n?.shortcut(), description: n?.description(), disabled: t, chips: n?.tags(), componentDisabled: n?.disabled(), ...o, children: k("div", { style: { display: "flex", flex: "1 1 0%" }, children: a }) });
|
|
2673
2673
|
})), Wa = k(ye, {}), Eo = ie(de((e, r) => {
|
|
2674
|
-
const { command: n, commandHook: t, scope: s, context: a, icon: o, label: l, disabled: i = !1, variant: c = Ae.Toolbar, shortcut: d, commandState: x,
|
|
2675
|
-
const P = { onExecute(
|
|
2676
|
-
t?.onExecute?.(
|
|
2677
|
-
}, onError(
|
|
2678
|
-
t?.onError(
|
|
2674
|
+
const { command: n, commandHook: t, scope: s, context: a, icon: o, label: l, disabled: i = !1, variant: c = Ae.Toolbar, shortcut: d, commandState: x, propsTooltip: m, ...b } = e, v = ge(null), h = ge(!1), f = Z(() => {
|
|
2675
|
+
const P = { onExecute(S, D) {
|
|
2676
|
+
t?.onExecute?.(S, D), h.current || (v.current?.start({ center: !1 }), setTimeout(() => v.current?.stop({}), 180)), h.current = !1;
|
|
2677
|
+
}, onError(S, D, _) {
|
|
2678
|
+
t?.onError(S, D, _);
|
|
2679
2679
|
} };
|
|
2680
2680
|
return t?.beforeExecute && (P.beforeExecute = t.beforeExecute), P;
|
|
2681
2681
|
}, [t]), y = cn(n, f), u = _e((P) => {
|
|
@@ -2690,22 +2690,22 @@ const Ba = ["Ok", "Cancel"], Or = ie(de((e, r) => {
|
|
|
2690
2690
|
return P ? (typeof P == "string" && (P = k(ye, { iconKey: P })), P) : c === Ae.Toolbar || n?.state() ? void 0 : Wa;
|
|
2691
2691
|
}, [y, o]), L = Z(() => ({ tabIndex: 0, ref: r, selected: n?.state(), icon: c === Ae.Toolbar ? T : k(Ii, { selected: n?.state() ?? !1, children: T }), touchRippleRef: v, disabled: i || !n || n.disabled(), onMouseDown: u, onMouseUp: w, onKeyDown: E }), [y, t, i, T]);
|
|
2692
2692
|
let O;
|
|
2693
|
-
return O = c === Ae.Menuitem ? k(Ot, { ...b, chips: n?.tags(), ...L, children: l ?? n?.label(s, a) }) : k(Wt, { ...b, ...L }), (l || n?.label()) && ((n.disabled() || i) && (O = k("div", { children: O })), O = k(
|
|
2693
|
+
return O = c === Ae.Menuitem ? k(Ot, { ...b, chips: n?.tags(), ...L, children: l ?? n?.label(s, a) }) : k(Wt, { ...b, ...L }), (l || n?.label()) && ((n.disabled() || i) && (O = k("div", { children: O })), O = k(Dn, { command: n, placement: c === Ae.Toolbar ? "bottom-start" : "right-start", shortcut: d, ...m, children: O })), O;
|
|
2694
2694
|
}));
|
|
2695
2695
|
Eo.displayName = "CommandButton";
|
|
2696
2696
|
const Ha = k(ye, {}), Ms = ie(de((e, r) => {
|
|
2697
2697
|
const { command: n, scope: t, icon: s = Ha, label: a, variant: o = Ae.Toolbar, disabled: l = !1, commandHook: i, ...c } = e, d = ge(null), x = ge(!1), m = Z(() => {
|
|
2698
|
-
const O = { onExecute(P,
|
|
2699
|
-
i?.onExecute?.(P,
|
|
2700
|
-
}, onError(P,
|
|
2701
|
-
i?.onError(P,
|
|
2698
|
+
const O = { onExecute(P, S) {
|
|
2699
|
+
i?.onExecute?.(P, S), x.current || (d.current?.start({ center: !1 }), setTimeout(() => d.current?.stop({}), 180)), x.current = !1;
|
|
2700
|
+
}, onError(P, S, D) {
|
|
2701
|
+
i?.onError(P, S, D);
|
|
2702
2702
|
} };
|
|
2703
2703
|
return i?.beforeExecute && (O.beforeExecute = i.beforeExecute), O;
|
|
2704
2704
|
}, [i]), b = cn(n, m), v = () => n?.state()?.toString() || "0", [h, f] = re(v), y = ae(() => {
|
|
2705
2705
|
const O = parseFloat(h);
|
|
2706
2706
|
isNaN(O) ? f(v()) : parseFloat(v()) !== O && n.execute(O, i);
|
|
2707
2707
|
}, [v, n, h, i]);
|
|
2708
|
-
|
|
2708
|
+
Se(() => {
|
|
2709
2709
|
f(v());
|
|
2710
2710
|
}, [n?.state()]);
|
|
2711
2711
|
const u = Z(() => {
|
|
@@ -2739,24 +2739,24 @@ const Ha = k(ye, {}), Ms = ie(de((e, r) => {
|
|
|
2739
2739
|
O.keyCode !== Pe.Enter && O.keyCode !== Pe.Space || n?.execute(!n?.state?.(), m);
|
|
2740
2740
|
} };
|
|
2741
2741
|
let L;
|
|
2742
|
-
return L = o === Ae.Menuitem ? J(Ot, { ...c, chips: n?.tags(), ...T, children: [w, E] }) : k(Wt, { ...c, ...T }), n?.label() && ((n.disabled() || l) && (L = k("div", { children: L })), L = k(
|
|
2742
|
+
return L = o === Ae.Menuitem ? J(Ot, { ...c, chips: n?.tags(), ...T, children: [w, E] }) : k(Wt, { ...c, ...T }), n?.label() && ((n.disabled() || l) && (L = k("div", { children: L })), L = k(Dn, { command: n, placement: o === Ae.Toolbar ? "bottom-start" : "right-start", children: L })), L;
|
|
2743
2743
|
})), Mo = ie(de((e, r) => {
|
|
2744
2744
|
const { variant: n = Ae.Toolbar, quickCommand: t, onQuickClick: s, commands: a, commandState: o, commandHook: l, disabled: i, label: c, icon: d, createPopupPanel: x, tooltip: m, selected: b, scope: v, ...h } = e, f = ge(null), y = ge(!1), u = Z(() => {
|
|
2745
|
-
const
|
|
2745
|
+
const D = { onExecute(_, M) {
|
|
2746
2746
|
l?.onExecute?.(_, M), y.current || (f.current?.start({ center: !1 }), setTimeout(() => f.current?.stop({}), 180)), y.current = !1;
|
|
2747
2747
|
}, onError(_, M, F) {
|
|
2748
2748
|
l?.onError(_, M, F);
|
|
2749
2749
|
} };
|
|
2750
|
-
return l?.beforeExecute && (
|
|
2750
|
+
return l?.beforeExecute && (D.beforeExecute = l.beforeExecute), D;
|
|
2751
2751
|
}, [l]), w = un(a, [t], null, [t]), E = w[0], { label: T, icon: L } = Z(() => {
|
|
2752
|
-
let
|
|
2753
|
-
c && (
|
|
2752
|
+
let D = null;
|
|
2753
|
+
c && (D = typeof c == "function" ? c(E) : c), D || (D = E?.label?.(v));
|
|
2754
2754
|
let _ = d;
|
|
2755
|
-
return _ || (_ = E?.icon?.()), typeof _ == "string" ? _ = k(ye, { iconKey: _ }) : typeof _ == "function" && (_ = _(E)), { label:
|
|
2755
|
+
return _ || (_ = E?.icon?.()), typeof _ == "string" ? _ = k(ye, { iconKey: _ }) : typeof _ == "function" && (_ = _(E)), { label: D, icon: _ };
|
|
2756
2756
|
}, [w, c, d]), O = { disabled: i, scope: v, touchRippleRef: f, onQuickClick: s, tooltip: m, label: T, icon: L };
|
|
2757
|
-
(T || m) && (O.createTooltip = ({ children:
|
|
2758
|
-
const P = ae((
|
|
2759
|
-
return E ? (O.
|
|
2757
|
+
(T || m) && (O.createTooltip = ({ children: D }, _) => k(pt, { label: T, description: m, disabled: _, children: D }));
|
|
2758
|
+
const P = ae((D) => x?.(D, a), [x, w]), S = ae((D) => E?.execute(o, u), [E]);
|
|
2759
|
+
return E ? (O.propsQuickButton = {}, O.propsQuickButton.createTooltip = ({ children: D, placement: _ }, M) => k(Dn, { command: E, placement: _ ?? n === Ae.Toolbar ? "bottom-start" : "right-start", disabled: M, children: D }), O.disabled = O.disabled ?? E?.disabled(), s || (O.onQuickClick = S)) : t && (O.onQuickClick = () => {
|
|
2760
2760
|
}), O.selected = b ?? E?.state(), O.createPopupPanel = P, n === Ae.Toolbar ? k(mn, { ...h, ...O, ref: r }) : k(Zr, { ...h, ...O, ref: r });
|
|
2761
2761
|
}));
|
|
2762
2762
|
Mo.displayName = "CommandPopupButton";
|
|
@@ -2764,17 +2764,17 @@ const Ua = k(ye, { iconKey: "Check" }), Ts = (e) => {
|
|
|
2764
2764
|
const { command: r, label: n, scope: t, icon: s = Ua, sx: a, ...o } = e;
|
|
2765
2765
|
return J(K, { sx: { display: "flex", flexDirection: "row", textTransform: "none", alignItems: "center", fontSize: (l) => l.typography.subtitle2.fontSize, ...a }, ...o, children: [s, k(Me, { component: "div", sx: { whiteSpace: "nowrap", lineHeight: "1", paddingLeft: (l) => l.spacing(0.25), paddingRight: (l) => l.spacing(0.25), fontSize: "inherit" }, children: r?.label(t) || n })] });
|
|
2766
2766
|
}, Ya = ie(de((e, r) => {
|
|
2767
|
-
const { sx: n, commands: t,
|
|
2767
|
+
const { sx: n, commands: t, propsCommandButton: s, parentFloat: a, renderToolbarPalette: o, children: l, ...i } = e, c = Tr(r, () => ({}), []), [d, x] = re(null), { reference: m } = zt({ label: "toolbar", anchor: c.current, parentFloat: a, createPopupPanel: null }), b = _e(() => {
|
|
2768
2768
|
const O = d;
|
|
2769
2769
|
O && requestAnimationFrame(() => {
|
|
2770
2770
|
c.current?.contains(document.activeElement) && O.focus();
|
|
2771
2771
|
});
|
|
2772
2772
|
}, []), v = Z(() => ({ dense: !0, outlined: !1 }), []), h = Z(() => {
|
|
2773
2773
|
const { commandHook: O, ...P } = s || {};
|
|
2774
|
-
return { commandHook: { beforeExecute: (
|
|
2775
|
-
O?.onExecute?.(
|
|
2776
|
-
}, onError(
|
|
2777
|
-
O?.onError?.(
|
|
2774
|
+
return { commandHook: { beforeExecute: (S, D) => O?.beforeExecute?.(S, D) !== !1 && m.closeAll(), onExecute(S, D) {
|
|
2775
|
+
O?.onExecute?.(S, D), b();
|
|
2776
|
+
}, onError(S, D, _) {
|
|
2777
|
+
O?.onError?.(S, D, _);
|
|
2778
2778
|
} }, ...P };
|
|
2779
2779
|
}, [m, s]), f = Z(() => ({ ...v, ...h }), [v, h]), [y, u] = Ao((O) => O + 1, 0);
|
|
2780
2780
|
un(t, [], { onChange: () => {
|
|
@@ -2785,7 +2785,7 @@ const Ua = k(ye, { iconKey: "Check" }), Ts = (e) => {
|
|
|
2785
2785
|
v.dense || (E += 2), v.outlined && E++;
|
|
2786
2786
|
let T = 2;
|
|
2787
2787
|
v.dense || (T = 4);
|
|
2788
|
-
const L = Z(() => o({ commands: t,
|
|
2788
|
+
const L = Z(() => o({ commands: t, propsCommandButton: f, propsCommandPopup: { commands: t, ...w, ...s } }), [y, f, w, o]);
|
|
2789
2789
|
return k(qo, { variant: "dense", sx: { minHeight: "unset", height: "unset", paddingTop: `${T}px`, paddingBottom: `${T}px`, paddingLeft: "6px !important", paddingRight: "6px !important", flex: "1 1 0%", alignItems: "center", userSelect: "none", flexGrow: 1, display: "flex", overflow: "hidden", ...n }, ref: c, onFocus: (O) => {
|
|
2790
2790
|
O.relatedTarget && !d && x(O.relatedTarget);
|
|
2791
2791
|
}, onBlur: (O) => {
|
|
@@ -2836,7 +2836,7 @@ export {
|
|
|
2836
2836
|
Br as J,
|
|
2837
2837
|
xs as K,
|
|
2838
2838
|
dt as L,
|
|
2839
|
-
|
|
2839
|
+
Ss as M,
|
|
2840
2840
|
Ci as N,
|
|
2841
2841
|
Or as O,
|
|
2842
2842
|
Os as P,
|
|
@@ -2846,7 +2846,7 @@ export {
|
|
|
2846
2846
|
fs as T,
|
|
2847
2847
|
Es as U,
|
|
2848
2848
|
$i as V,
|
|
2849
|
-
|
|
2849
|
+
Ds as W,
|
|
2850
2850
|
gn as X,
|
|
2851
2851
|
Gr as Y,
|
|
2852
2852
|
bs as Z,
|
|
@@ -2859,7 +2859,7 @@ export {
|
|
|
2859
2859
|
Eo as a4,
|
|
2860
2860
|
Ms as a5,
|
|
2861
2861
|
Mo as a6,
|
|
2862
|
-
|
|
2862
|
+
Dn as a7,
|
|
2863
2863
|
Ts as a8,
|
|
2864
2864
|
Ya as a9,
|
|
2865
2865
|
Ps as aa,
|
|
@@ -2869,8 +2869,8 @@ export {
|
|
|
2869
2869
|
Zr as e,
|
|
2870
2870
|
ks as f,
|
|
2871
2871
|
pt as g,
|
|
2872
|
-
|
|
2873
|
-
|
|
2872
|
+
Di as h,
|
|
2873
|
+
Si as i,
|
|
2874
2874
|
_n as j,
|
|
2875
2875
|
ms as k,
|
|
2876
2876
|
ds as l,
|
|
@@ -2878,8 +2878,8 @@ export {
|
|
|
2878
2878
|
xi as n,
|
|
2879
2879
|
hs as o,
|
|
2880
2880
|
gs as p,
|
|
2881
|
-
|
|
2882
|
-
|
|
2881
|
+
Fr as q,
|
|
2882
|
+
rs as r,
|
|
2883
2883
|
Xr as s,
|
|
2884
2884
|
Jr as t,
|
|
2885
2885
|
ys as u,
|