@sheetxl/utils-mui 0.7.12 → 0.7.13
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/DBKNbW_UZGIFdc_s.cjs +11 -0
- package/browser/cjs/DNyaE39SbtmF-UDK.cjs +6 -0
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{dux3FJhOzM39tAPH.mjs → B2ZgR_6AzHI4l5DU.mjs} +1101 -1099
- package/browser/esm/{CH38wbt8hUWwf7_q.mjs → BfOux96gs0sl6o1o.mjs} +7 -7
- package/browser/esm/index.mjs +2 -2
- package/licenses/dependencies.txt +1 -1
- package/node/esm/{DfIUXNbcl2LhgOsZ.mjs → B8AkLqu0SQMq831k.mjs} +2 -2
- package/node/esm/index.mjs +81 -79
- package/package.json +14 -10
- package/types/index.d.ts +13 -15
- package/browser/cjs/B_Kllo37ZP7tnonM.cjs +0 -6
- package/browser/cjs/CTNNprrvFpKIV4ai.cjs +0 -11
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { memo as j, forwardRef as z, useState as s } from "react";
|
|
3
|
-
import { O as E, c as R } from "./
|
|
4
|
-
import { alpha as
|
|
3
|
+
import { O as E, c as R } from "./B2ZgR_6AzHI4l5DU.mjs";
|
|
4
|
+
import { alpha as y, getOverlayAlpha as O } from "@mui/material/styles";
|
|
5
5
|
import { Box as A, FormControl as W, TextField as q } from "@mui/material";
|
|
6
6
|
import { useCallbackRef as n, KeyCodes as G } from "@sheetxl/utils-react";
|
|
7
7
|
/**
|
|
8
|
-
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.
|
|
8
|
+
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.13
|
|
9
9
|
*
|
|
10
10
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
11
11
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
12
12
|
*/
|
|
13
13
|
const J = ["Input"], aa = j(z((w, C) => {
|
|
14
|
-
const { initialValue: F = "", onOption: T, onValidateOption: r,
|
|
14
|
+
const { initialValue: F = "", onOption: T, onValidateOption: r, onInput: c, onValidateInput: p, onDone: u, inputProps: d, inputLabel: v, inputType: b, inputPlaceHolder: k, options: m = J, autoFocusSel: I = ".autoFocus", cancelOption: g, defaultOption: f = m?.[0], ...P } = w, [V, B] = s(!1), [o, D] = s(F), [S, H] = s(""), [K, L] = s(!0), e = n(async (a, t) => {
|
|
15
15
|
if (!p) return !0;
|
|
16
16
|
const l = await p?.(a, t);
|
|
17
17
|
H(l?.message ?? "");
|
|
18
|
-
const
|
|
19
|
-
return L(
|
|
18
|
+
const x = l?.valid ?? !0;
|
|
19
|
+
return L(x), x;
|
|
20
20
|
}, [p]), h = n(async (a) => {
|
|
21
21
|
c?.(o, a);
|
|
22
22
|
}, [o, c, u, T, g, f]), M = n(async (a) => {
|
|
@@ -35,7 +35,7 @@ const J = ["Input"], aa = j(z((w, C) => {
|
|
|
35
35
|
t || h(a);
|
|
36
36
|
}, onValidateOption: $, cancelOption: g, defaultOption: f, autoFocusSel: I, ref: C, ...P, children: i(A, { sx: { paddingTop: (a) => a.spacing(1), paddingBottom: (a) => a.spacing(0) }, children: i(W, { sx: { paddingTop: (a) => a.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: i(q, { onFocus: (a) => {
|
|
37
37
|
V || a.target?.select(), B(!0);
|
|
38
|
-
}, type: b, label: v, helperText: S || " ", sx: { width: "100%", "& .MuiFormHelperText-root": { marginTop: (a) => a.spacing(0.5), color: K ? void 0 : "error.main" } }, slotProps: { inputLabel: { shrink: !0 }, htmlInput: { placeholder: k, spellCheck: !1, autoComplete: "off", ...d, className: R("autoFocus", d?.className), sx: { paddingTop: (a) => a.spacing(1.25), paddingBottom: (a) => a.spacing(0.75), backgroundImage: `linear-gradient(${
|
|
38
|
+
}, type: b, label: v, helperText: S || " ", sx: { width: "100%", "& .MuiFormHelperText-root": { marginTop: (a) => a.spacing(0.5), color: K ? void 0 : "error.main" } }, slotProps: { inputLabel: { shrink: !0 }, htmlInput: { placeholder: k, spellCheck: !1, autoComplete: "off", ...d, className: R("autoFocus", d?.className), sx: { paddingTop: (a) => a.spacing(1.25), paddingBottom: (a) => a.spacing(0.75), backgroundImage: `linear-gradient(${y("#fff", O(5))}, ${y("#fff", O(5))})` } } }, value: o, onChange: N, onKeyDown: M, onContextMenu: (a) => {
|
|
39
39
|
a.stopPropagation();
|
|
40
40
|
} }) }) }) });
|
|
41
41
|
}));
|
package/browser/esm/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._traverse-ellipsis_14l1h_1{display:inline-block;position:relative}._traverse-ellipsis_14l1h_1 div{position:absolute;border-radius:50%}._traverse-ellipsis_14l1h_1 div:nth-child(1){left:0;animation:_traverse-ellipsis1_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(2){left:0;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(3){left:24px;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(4){left:48px;animation:_traverse-ellipsis3_14l1h_1 .6s infinite}@keyframes _traverse-ellipsis1_14l1h_1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes _traverse-ellipsis3_14l1h_1{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes _traverse-ellipsis2_14l1h_1{0%{transform:translate(0)}to{transform:translate(24px)}}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
2
|
-
import { C as s, z as t, y as e, B as n, D as i, F as l, A as r, n as p, J as u, $ as c, a5 as d, a7 as m, aa as h, a8 as E, K as b, H as I, x as C, a4 as g, E as S, b as B, a as x, f as P, Z as T, d as A, e as w, g as M, a6 as v, R as D, a9 as F, L as k, P as f, N as O, O as R, _ as y, a0 as L, S as W, ab as z, M as G, I as H, p as N, T as V, a2 as j, k as q, r as J, q as K, w as Q, v as U, m as X, a1 as Y, j as Z, W as _, h as $, i as aa, o as oa, s as sa, X as ta, l as ea, t as na, a3 as ia, V as la, Q as ra, Y as pa, U as ua, u as ca, G as da } from "./
|
|
2
|
+
import { C as s, z as t, y as e, B as n, D as i, F as l, A as r, n as p, J as u, $ as c, a5 as d, a7 as m, aa as h, a8 as E, K as b, H as I, x as C, a4 as g, E as S, b as B, a as x, f as P, Z as T, d as A, e as w, g as M, a6 as v, R as D, a9 as F, L as k, P as f, N as O, O as R, _ as y, a0 as L, S as W, ab as z, M as G, I as H, p as N, T as V, a2 as j, k as q, r as J, q as K, w as Q, v as U, m as X, a1 as Y, j as Z, W as _, h as $, i as aa, o as oa, s as sa, X as ta, l as ea, t as na, a3 as ia, V as la, Q as ra, Y as pa, U as ua, u as ca, G as da } from "./B2ZgR_6AzHI4l5DU.mjs";
|
|
3
3
|
/**
|
|
4
|
-
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.
|
|
4
|
+
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.13
|
|
5
5
|
*
|
|
6
6
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
7
7
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.
|
|
2
|
+
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.13
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -12,7 +12,7 @@ import { Box as p, FormControl as l, TextField as s } from "@mui/material";
|
|
|
12
12
|
import { useCallbackRef as c, KeyCodes as u } from "@sheetxl/utils-react";
|
|
13
13
|
import { OptionsDialog as m } from "./index.mjs";
|
|
14
14
|
const d = ["Input"], g = o(n((o2, n2) => {
|
|
15
|
-
const { initialValue: g2 = "", onOption: f, onValidateOption: h,
|
|
15
|
+
const { initialValue: g2 = "", onOption: f, onValidateOption: h, onInput: x, onValidateInput: y, onDone: O, inputProps: w, inputLabel: T, inputType: F, inputPlaceHolder: v, options: C = d, autoFocusSel: I = ".autoFocus", cancelOption: b, defaultOption: k = C?.[0], ...P } = o2, [V, D] = a(false), [j, B] = a(g2), [H, L] = a(""), [M, N] = a(true), S = c(async (t2, o3) => {
|
|
16
16
|
if (!y) return true;
|
|
17
17
|
const n3 = await y?.(t2, o3);
|
|
18
18
|
L(n3?.message ?? "");
|
package/node/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.
|
|
2
|
+
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.7.13
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -8,7 +8,7 @@ import { jsx as e, jsxs as t, Fragment as o } from "react/jsx-runtime";
|
|
|
8
8
|
import r, { memo as n, forwardRef as i, useMemo as a, useRef as l, useEffect as s, useState as c, useImperativeHandle as d, useCallback as p, useLayoutEffect as u, useReducer as m } from "react";
|
|
9
9
|
import h from "clsx";
|
|
10
10
|
import { alpha as f, darken as x, lighten as b } from "@mui/system";
|
|
11
|
-
import { IconButton as g, Divider as y, Box as v, Typography as k, Paper as w, Chip as C, Popper as M, Grow as S, Tooltip as P, ListItemIcon as R, MenuItem as D, Fade as E, Backdrop as T, DialogTitle as
|
|
11
|
+
import { IconButton as g, Divider as y, Box as v, Typography as k, Paper as w, Chip as C, Popper as M, Grow as S, Tooltip as P, ListItemIcon as R, MenuItem as D, Fade as E, Backdrop as T, DialogTitle as $, Button as z, DialogContent as O, DialogActions as I, Input as N, Toolbar as B } from "@mui/material";
|
|
12
12
|
import { ErrorUtils as L, CommonUtils as F } from "@sheetxl/utils";
|
|
13
13
|
import { defaultCreateScrollEdgeButton as A, ScrollbarOrientation as H, DynamicIcon as W, useCallbackRef as K, useFullscreenPortal as V, KeyCodes as q, KeyModifiers as _, ReactUtils as j, useImperativeElement as U, useCommand as Q, CommandButtonType as G, useCommands as X } from "@sheetxl/utils-react";
|
|
14
14
|
import { useTheme as Y, styled as J, createTheme as Z, useThemeProps as ee } from "@mui/material/styles";
|
|
@@ -83,7 +83,7 @@ const De = /^\s*at\s+(?:(async|new|await)\s+)?(.+?)\s+\((.+?):(\d+):(\d+)\)$/, E
|
|
|
83
83
|
} catch {
|
|
84
84
|
}
|
|
85
85
|
return e2 = (e2 = e2.replace(/^\/+/, "")).replace(/^@?fs[\\/]/, "");
|
|
86
|
-
},
|
|
86
|
+
}, $e = n(({ error: o2, maxLines: r2 = Number.MAX_SAFE_INTEGER, hideLineNumbers: n2 = false }) => {
|
|
87
87
|
const [i2, a2] = c(null);
|
|
88
88
|
if (!o2?.stack) return null;
|
|
89
89
|
const l2 = L.collectErrorChain(o2).reverse(), s2 = [];
|
|
@@ -120,17 +120,17 @@ const De = /^\s*at\s+(?:(async|new|await)\s+)?(.+?)\s+\((.+?):(\d+):(\d+)\)$/, E
|
|
|
120
120
|
a2("Logged!"), setTimeout(() => a2(null), 2e3), console.log(o2);
|
|
121
121
|
}, sx: { color: "inherit", opacity: 0.7, "&:hover": { opacity: 1 } }, title: "Log error to console", children: e(W, { iconKey: "BugReport", style: { fontSize: "0.875rem" } }) })] }), t(v, { sx: { mt: 1, backgroundColor: "rgba(0, 0, 0, 0.2)", borderRadius: 1, p: 1, maxHeight: "300px", overflow: "auto", fontFamily: "monospace", fontSize: "0.75rem", lineHeight: 1.4 }, children: [d2.map((o3, r3) => o3.isBoundary ? e(v, { sx: { py: 1, mt: r3 > 0 ? 1 : 0, mb: 0.5, borderTop: r3 > 0 ? "1px solid rgba(255, 255, 255, 0.1)" : "none" }, children: e(k, { variant: "caption", component: "div", sx: { fontSize: "0.75rem", fontWeight: "bold", color: (e2) => o3.isBoundary ? e2.palette.text.primary : e2.palette.text.secondary, display: "block" }, children: o3.line }) }, `error-${r3}`) : t(v, { sx: { display: "flex", alignItems: "flex-start", gap: 1, py: 0.25, pl: 1, "&:hover": { backgroundColor: "rgba(255, 255, 255, 0.05)" } }, children: [!n2 && e(k, { variant: "caption", component: "div", sx: { fontSize: "0.625rem", opacity: 0.5, minWidth: "20px", textAlign: "right", userSelect: "none" }, children: r3 + 1 }), t(v, { sx: { flex: 1, overflow: "hidden" }, children: [e(k, { variant: "caption", component: "div", sx: { fontSize: "0.75rem", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", color: "inherit" }, children: o3.line }), o3.location && o3.line !== o3.location && e(k, { variant: "caption", component: "div", sx: { fontSize: "0.625rem", opacity: 0.6, fontStyle: "italic" }, children: o3.location })] })] }, `stack-${r3}`)), p2 && t(k, { variant: "caption", component: "div", sx: { fontSize: "0.625rem", opacity: 0.6, fontStyle: "italic", textAlign: "center", display: "block", mt: 1 }, children: ["... and ", s2.length - r2, " more frames"] })] })] });
|
|
122
122
|
});
|
|
123
|
-
|
|
124
|
-
const
|
|
123
|
+
$e.displayName = "StackTrace";
|
|
124
|
+
const ze = (o2, n2 = false, i2 = false) => {
|
|
125
125
|
if (r.isValidElement(o2)) return o2;
|
|
126
|
-
if (o2 instanceof Error) return t(v, { sx: { display: "flex", flexDirection: "column", maxWidth: "500px", width: "100%" }, children: [e(k, { variant: "caption", component: "div", sx: { fontSize: "0.875rem", lineHeight: 1.43, mb: 1 }, children: o2.message }), o2.cause ? t(k, { variant: "caption", component: "div", sx: { fontSize: "0.875rem", lineHeight: 1.43, letterSpacing: "0.01071em", mb: 1, opacity: 0.8 }, children: ["Caused by: ", o2.cause instanceof Error ? o2.cause.message : String(o2.cause)] }) : null, !n2 && e(
|
|
126
|
+
if (o2 instanceof Error) return t(v, { sx: { display: "flex", flexDirection: "column", maxWidth: "500px", width: "100%" }, children: [e(k, { variant: "caption", component: "div", sx: { fontSize: "0.875rem", lineHeight: 1.43, mb: 1 }, children: o2.message }), o2.cause ? t(k, { variant: "caption", component: "div", sx: { fontSize: "0.875rem", lineHeight: 1.43, letterSpacing: "0.01071em", mb: 1, opacity: 0.8 }, children: ["Caused by: ", o2.cause instanceof Error ? o2.cause.message : String(o2.cause)] }) : null, !n2 && e($e, { error: o2, hideLineNumbers: true })] });
|
|
127
127
|
const a2 = "string" === o2 ? o2 : `Unknown Error: ${String(o2)}`;
|
|
128
128
|
return e(k, { variant: "caption", component: "div", sx: { fontSize: "0.875rem", lineHeight: 1.43, letterSpacing: "0.01071em" }, children: a2 });
|
|
129
|
-
},
|
|
130
|
-
const { sx: n2, icon: i2 = e(W, { iconKey: "Error", style: { fontSize: 48 } }), error: l2, hideStackTrace: s2 = false, stackTraceExpanded: c2 = false, ...d2 } = o2, p2 = a(() =>
|
|
129
|
+
}, Oe = n(i((o2, r2) => {
|
|
130
|
+
const { sx: n2, icon: i2 = e(W, { iconKey: "Error", style: { fontSize: 48 } }), error: l2, hideStackTrace: s2 = false, stackTraceExpanded: c2 = false, ...d2 } = o2, p2 = a(() => ze(l2, s2, c2), [l2, s2, c2]);
|
|
131
131
|
return a(() => e(v, { ref: r2, sx: { boxSizing: "border-box", alignItems: "center", justifyContent: "center", display: "flex", flexDirection: "row", overflow: "hidden", width: "100%", height: "100%", ...n2 }, ...d2, children: t(v, { sx: { display: "flex", flex: "1 1 100%", height: "100%", alignItems: "center", justifyContent: "center", boxSizing: "border-box", position: "relative" }, children: [e(v, { className: "backdrop", sx: { backdropFilter: "blur(4px)", borderRadius: (e2) => `${e2.shape.borderRadius}px`, zIndex: -1, position: "absolute", width: "100%", height: "100%", boxSizing: "border-box" } }), e(w, { elevation: 0, sx: { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", rowGap: "8px", alignSelf: "center", marginBottom: "5%", backgroundColor: (e2) => e2.palette.error.light, color: (e2) => e2.palette.error.contrastText, paddingLeft: (e2) => e2.spacing(2), paddingRight: (e2) => e2.spacing(2), paddingTop: (e2) => e2.spacing(2), paddingBottom: (e2) => e2.spacing(2), borderRadius: (e2) => `${e2.shape.borderRadius}px`, boxShadow: (e2) => e2.shadows[2], "& .primary": { background: (e2) => `${e2.palette.error.contrastText} !important`, border: "solid transparent" }, zIndex: 1 }, children: e(v, { sx: { display: "flex", flexDirection: "column", alignItems: "center", gap: (e2) => e2.spacing(2), width: "100%", maxWidth: "600px" }, children: t(v, { sx: { display: "flex", flexDirection: "row", alignItems: "flex-start", gap: (e2) => e2.spacing(2) }, children: [i2, p2] }) }) })] }) }), [n2]);
|
|
132
132
|
}));
|
|
133
|
-
|
|
133
|
+
Oe.displayName = "ErrorPanel";
|
|
134
134
|
const Ie = n(i((t2, o2) => {
|
|
135
135
|
const { chips: n2, sx: i2, ...a2 } = t2, l2 = r.useMemo(() => {
|
|
136
136
|
if (!n2) return null;
|
|
@@ -160,13 +160,13 @@ const Ie = n(i((t2, o2) => {
|
|
|
160
160
|
return v2 && e2.unshift(Ne, C2), e2;
|
|
161
161
|
}, [v2, u2]), [R2, D2] = c(false), E2 = r.useRef(null), T2 = K(() => {
|
|
162
162
|
f2?.(L2.current, E2.current);
|
|
163
|
-
}, [x2]),
|
|
163
|
+
}, [x2]), $2 = K(x2, [x2]), z2 = K(b2, [b2]), O2 = K(g2, [g2]), I2 = K(() => {
|
|
164
164
|
D2(false), y2?.();
|
|
165
165
|
}, [y2]), [N2, B2] = c(false), L2 = r.useRef(null), A2 = r.useRef(true), H2 = a(() => ({ onFirstUpdate: () => {
|
|
166
166
|
A2.current && (B2(true), T2?.(), A2.current = false);
|
|
167
167
|
} }), [i2, R2]);
|
|
168
168
|
s(() => {
|
|
169
|
-
i2 && N2 ?
|
|
169
|
+
i2 && N2 ? $2?.() : !i2 && R2 && O2?.(), i2 && D2(i2);
|
|
170
170
|
}, [i2, N2]);
|
|
171
171
|
const W2 = a(() => ({ getBoundingClientRect: () => h2 ? new DOMRect(h2?.left || 0, h2?.top || 0, 0, 0) : m2.getBoundingClientRect() }), [h2, m2]);
|
|
172
172
|
d(o2, () => ({ instance: () => E2.current, element: () => L2.current }), []);
|
|
@@ -174,7 +174,7 @@ const Ie = n(i((t2, o2) => {
|
|
|
174
174
|
return e(M, { ref: L2, popperRef: E2, container: q2, anchorEl: W2, open: R2, role: void 0, popperOptions: H2, transition: true, sx: _2, placement: "bottom-start", modifiers: P2, ...k2, children: ({ TransitionProps: t3, placement: o3, ...r2 }) => {
|
|
175
175
|
const { in: n3, onEnter: a2, onExited: s2, ...c2 } = t3 ?? {};
|
|
176
176
|
return e(S, { ...c2, in: i2, onEnter: () => {
|
|
177
|
-
a2?.(),
|
|
177
|
+
a2?.(), z2();
|
|
178
178
|
}, onExited: () => {
|
|
179
179
|
s2?.(), I2();
|
|
180
180
|
}, timeout: { enter: w2.transitions.duration.shorter, exit: 0 }, style: { transformOrigin: "bottom-start" === o3 ? "left top" : "center bottom" }, children: "function" == typeof l2 ? l2({ TransitionProps: t3, placement: o3, ...r2 }) : l2 || F.EmptyArray });
|
|
@@ -319,11 +319,11 @@ const pt = (e2 = null, t2, o2, r2) => {
|
|
|
319
319
|
s(() => {
|
|
320
320
|
D2 && (D2.resolve(), E2(null));
|
|
321
321
|
}, [g2, v2, D2]);
|
|
322
|
-
const
|
|
322
|
+
const $2 = p(() => {
|
|
323
323
|
let e2 = w2;
|
|
324
324
|
for (; e2.parent; ) e2 = e2.parent;
|
|
325
325
|
return P2(e2.key);
|
|
326
|
-
}, []),
|
|
326
|
+
}, []), z2 = () => {
|
|
327
327
|
if (x2) return void I2();
|
|
328
328
|
if (w2) {
|
|
329
329
|
const e3 = ct.get(w2.key);
|
|
@@ -337,10 +337,10 @@ const pt = (e2 = null, t2, o2, r2) => {
|
|
|
337
337
|
requestAnimationFrame(() => {
|
|
338
338
|
lt.set(w2.key, W2.key), b2(true);
|
|
339
339
|
});
|
|
340
|
-
}, [
|
|
340
|
+
}, [O2, I2] = r.useReducer((e2) => e2 + 1, 0), N2 = p((e2) => null === m2 ? null : m2({ closeFloat: F2, closeFloatAll: H2, ...e2 }), [m2]), B2 = null === m2, L2 = K((e2 = 120) => pt(e2, z2, /* @__PURE__ */ new Set([W2]), false)(), [z2]), F2 = K((e2 = 60) => pt(e2, T2, mt(W2), true)(), [T2]), A2 = K((e2 = 360) => pt(e2, R2, mt(((e3) => {
|
|
341
341
|
const t3 = lt.get(e3.key);
|
|
342
342
|
return t3 && ct.get(t3) || null;
|
|
343
|
-
})(W2)), true)(), [R2]), H2 = K(
|
|
343
|
+
})(W2)), true)(), [R2]), H2 = K($2, [$2]), W2 = a(() => ({ key: C2, isRoot: false, label: n2, parent: w2, onChildVisible: () => {
|
|
344
344
|
k2(true);
|
|
345
345
|
}, onChildHidden: () => {
|
|
346
346
|
k2(false);
|
|
@@ -377,7 +377,7 @@ const pt = (e2 = null, t2, o2, r2) => {
|
|
|
377
377
|
}, onMount: U2, popperProps: { onKeyDown: V2, onMouseEnter: (e2) => {
|
|
378
378
|
x2 && dt?.isClose && dt.setReferences.has(W2) && (dt.fn.clear(), dt = null, W2.closeChild());
|
|
379
379
|
}, ...u2 }, createPopupPanel: N2 }) : null);
|
|
380
|
-
}, [g2, x2, n2, B2, u2, N2,
|
|
380
|
+
}, [g2, x2, n2, B2, u2, N2, O2]);
|
|
381
381
|
const X2 = K((e2) => {
|
|
382
382
|
if (0 === lt.size) return;
|
|
383
383
|
let t3 = false;
|
|
@@ -389,8 +389,8 @@ const pt = (e2 = null, t2, o2, r2) => {
|
|
|
389
389
|
n3?.contains?.(e2.target) && (t3 = true);
|
|
390
390
|
const i3 = r2.anchorElement();
|
|
391
391
|
i3?.contains?.(e2.target) && (t3 = true);
|
|
392
|
-
}), t3 ||
|
|
393
|
-
}, [
|
|
392
|
+
}), t3 || $2();
|
|
393
|
+
}, [$2]);
|
|
394
394
|
return s(() => {
|
|
395
395
|
if (!x2 || !w2.isRoot) return;
|
|
396
396
|
const e2 = (e3) => {
|
|
@@ -410,7 +410,7 @@ const pt = (e2 = null, t2, o2, r2) => {
|
|
|
410
410
|
}
|
|
411
411
|
return t(v, { ref: r2, sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, children: ["Children here", c3, e(Dt, { parentFloat: a3, children: "Close other children" })] });
|
|
412
412
|
}, [n2]), ...s2 };
|
|
413
|
-
return e(i2 === rt.Toolbar ? Tt :
|
|
413
|
+
return e(i2 === rt.Toolbar ? Tt : zt, { ...c2 });
|
|
414
414
|
})), xt = { placement: "right-start" }, bt = n(i((e2, n2) => {
|
|
415
415
|
const { children: i2, sx: l2, parentFloat: c2, createPopupPanel: d2, popperProps: p2 = xt, label: u2, ...m2 } = e2;
|
|
416
416
|
ae(r.isValidElement(i2), "Must supply a child component to enable a context menu.");
|
|
@@ -458,22 +458,22 @@ const yt = n((t2) => {
|
|
|
458
458
|
let e2 = "function" == typeof p2 ? p2() : p2;
|
|
459
459
|
return null === e2 ? e2 : e2 || (void 0 === d2 ? Ct : Mt);
|
|
460
460
|
}, [p2, d2]);
|
|
461
|
-
let
|
|
461
|
+
let $2 = t(g, { component: "div", ref: r2, className: h({ "Mui-focusVisible": S2, "Mui-selected": d2, "Mui-disabled": y2 }, k2), onFocus: (e2) => {
|
|
462
462
|
P2(true), w2?.(e2);
|
|
463
463
|
}, onBlur: (e2) => {
|
|
464
464
|
P2(false), C2?.(e2);
|
|
465
465
|
}, size: "small", TouchRippleProps: { center: false }, sx: E2, edge: "end", ...M2, disabled: y2 || false, children: [T2, m2] });
|
|
466
466
|
if (u2) if (u2.simple && u2.label && !u2.disabled) {
|
|
467
467
|
const { label: t2, description: o3, maxWidth: r3, shortcut: n3, useModifierSymbols: i3, componentDisabled: a2, simple: l3, chips: s3, ref: c2, ...d3 } = u2;
|
|
468
|
-
|
|
469
|
-
} else
|
|
470
|
-
return
|
|
468
|
+
$2 = e(gt, { disableInteractive: true, title: t2 ?? "", ...d3, children: e(v, { sx: { display: "flex" }, children: $2 }) });
|
|
469
|
+
} else $2 = e(wt, { children: $2, ...u2 });
|
|
470
|
+
return $2;
|
|
471
471
|
})), Pt = e(W, {}), Rt = (e2) => e2.icon, Dt = n(i((o2, r2) => {
|
|
472
472
|
const { icon: n2 = Pt, renderIcon: i2 = Rt, parentFloat: l2, className: s2, onFocus: d2, selected: p2, onBlur: u2, onMouseOver: m2, onMouseOut: f2, onMouseEnter: x2, disabled: b2, children: g2, sx: y2, tooltipProps: v2, chips: k2, primary: w2, ...C2 } = o2, [M2, S2] = c(false), [P2, E2] = c(false), T2 = a(() => {
|
|
473
473
|
const t2 = i2?.({ icon: n2, disabled: b2, selected: p2 });
|
|
474
474
|
return t2 ? e(R, { className: h({ "Mui-focusVisible": M2, "Mui-hovered": P2 }), sx: { "& .MuiSvgIcon-root": { color: (e2) => w2 ? void 0 : e2.palette.text.icon ?? e2.palette.action.active }, "&.Mui-hovered:not(.Mui-disabled, [disabled])": { "& .MuiSvgIcon-root": { color: (e2) => e2.palette.text.primary } } }, children: t2 }) : null;
|
|
475
475
|
}, [i2, b2, n2, M2, P2, w2, p2]);
|
|
476
|
-
let
|
|
476
|
+
let $2 = t(D, { ref: r2, disabled: b2, onMouseOver: (e2) => {
|
|
477
477
|
m2?.(e2), e2.isDefaultPrevented() || E2(true);
|
|
478
478
|
}, onMouseOut: (e2) => {
|
|
479
479
|
f2?.(e2), e2.isDefaultPrevented() || E2(false);
|
|
@@ -484,12 +484,12 @@ const yt = n((t2) => {
|
|
|
484
484
|
}, onBlur: (e2) => {
|
|
485
485
|
u2?.(e2), S2(false);
|
|
486
486
|
}, sx: { flex: "1 1 100%", "&.Mui-disabled > .icon path": { filter: "grayscale(65%)" }, "&.Mui-selected": { color: (e2) => e2.palette.text.primary }, color: (e2) => e2.palette.text.secondary, "&.Mui-hovered:not(.Mui-disabled, [disabled])": { color: (e2) => e2.palette.text.primary }, ...y2 }, ...C2, children: [T2, g2, k2 ? e(Ie, { chips: k2 }) : null] });
|
|
487
|
-
return v2 && (
|
|
487
|
+
return v2 && ($2 = e(wt, { children: $2, placement: "right-start", ...v2 })), $2;
|
|
488
488
|
})), Et = n(i((t2, r2) => {
|
|
489
489
|
const { children: n2, sx: i2, primary: a2 = false, variant: l2 = "subtitle1", ...s2 } = t2;
|
|
490
490
|
return e(o, { children: e(k, { ref: r2, variant: l2, component: "div", sx: { userSelect: "none", fontWeight: "500", paddingLeft: "8px", paddingTop: "subtitle1" === l2 ? "2px" : void 0, paddingBottom: "subtitle1" === l2 ? "2px" : void 0, color: (e2) => a2 ? void 0 : e2.palette.text.secondary, ...i2 }, ...s2, children: n2 }) });
|
|
491
491
|
})), Tt = n(i((r2, n2) => {
|
|
492
|
-
const { dense: i2 = true, outlined: s2 = false, label: d2, selected: p2 = false, onQuickClick: u2, parentFloat: m2, createPopupPanel: x2, popupProps: b2, onPopupOpen: y2, onPopupClose: k2, quickButtonProps: w2, createQuickButton: C2, tooltip: M2 = "", createTooltip: S2, icon: P2, disabled: R2, buttonProps: D2 = F.EmptyObject, disableHover: E2, touchRippleRef: T2, primary:
|
|
492
|
+
const { dense: i2 = true, outlined: s2 = false, label: d2, selected: p2 = false, onQuickClick: u2, parentFloat: m2, createPopupPanel: x2, popupProps: b2, onPopupOpen: y2, onPopupClose: k2, quickButtonProps: w2, createQuickButton: C2, tooltip: M2 = "", createTooltip: S2, icon: P2, disabled: R2, buttonProps: D2 = F.EmptyObject, disableHover: E2, touchRippleRef: T2, primary: $2, children: z2, sx: O2, className: I2, ...N2 } = r2, B2 = Y(), L2 = a(() => {
|
|
493
493
|
const e2 = (e3, t2, o2, r3 = o2) => {
|
|
494
494
|
const n3 = "boolean" == typeof s2 ? null : s2[e3];
|
|
495
495
|
return "function" == typeof n3 ? n3(t2) : n3 || (s2 ? o2 : r3);
|
|
@@ -537,18 +537,18 @@ const yt = n((t2) => {
|
|
|
537
537
|
}
|
|
538
538
|
const { className: le2, sx: se2, ...ce2 } = D2;
|
|
539
539
|
let de2 = e(v, { onFocus: () => V2(true), onBlur: () => V2(false), onMouseOver: () => j2(true), onMouseOut: () => j2(false), ...ne2, "aria-label": "split button", ref: U2, tabIndex: R2 ? void 0 : 0, className: h(le2, "split-button-root", { "Mui-focusVisible": W2 || A2, "Mui-selected": A2 || p2, "Mui-hovered": _2, "Mui-disabled": R2 }), sx: { display: "flex", flex: "1 1 100%", alignItems: "stretch", width: "fit-content", "&:not(.Mui-disabled)": { cursor: "pointer" }, marginLeft: s2 ? "1px" : "0px", marginRight: s2 ? "1px" : "0px", borderRadius: (e2) => `${e2.shape.borderRadius}px`, "&.Mui-focusVisible": { outline: (e2) => `solid ${e2.palette.primary.main} 1px`, zIndex: 2 }, ...se2 }, ...ce2, children: ie2 });
|
|
540
|
-
return oe2 || (de2 = (S2 ?? ee2)({ title: A2 ? "" : M2, children: de2 }, A2)), t(v, { className: h(I2, "popupIconButton"), ref: n2, ...N2, sx: { zIndex: W2 || A2 ? 2 : void 0, display: "flex", alignItems: "center", ...
|
|
540
|
+
return oe2 || (de2 = (S2 ?? ee2)({ title: A2 ? "" : M2, children: de2 }, A2)), t(v, { className: h(I2, "popupIconButton"), ref: n2, ...N2, sx: { zIndex: W2 || A2 ? 2 : void 0, display: "flex", alignItems: "center", ...O2 }, children: [de2, G2.component] });
|
|
541
541
|
}));
|
|
542
542
|
Tt.displayName = "ExhibitPopupIconButton";
|
|
543
|
-
const
|
|
544
|
-
const { selected: i2 = false, label: s2, onQuickClick: d2, parentFloat: u2, createPopupPanel: m2, popupProps: f2 =
|
|
543
|
+
const $t = {}, zt = n(i((r2, n2) => {
|
|
544
|
+
const { selected: i2 = false, label: s2, onQuickClick: d2, parentFloat: u2, createPopupPanel: m2, popupProps: f2 = $t, onPopupOpen: x2, onPopupClose: b2, quickButtonProps: g2, createQuickButton: k2, tooltip: w2 = "", createTooltip: C2, icon: M2, disabled: S2, touchRippleRef: P2, primary: R2, children: E2, sx: T2, ...$2 } = r2, [z2, O2] = c(false), [I2, N2] = c(false), [B2, L2] = c(false), [F2, A2] = c(false), H2 = l(null), W2 = l(null), V2 = a(() => {
|
|
545
545
|
if (!f2) return;
|
|
546
546
|
const { popperProps: e2 } = f2;
|
|
547
547
|
return { placement: "right-start", offsets: [-4, -2], ...e2 };
|
|
548
548
|
}, [f2]), q2 = ht({ anchor: H2.current, label: s2, createPopupPanel: m2, parentFloat: u2, popperProps: V2, onClose: () => {
|
|
549
|
-
|
|
549
|
+
O2(false), b2?.();
|
|
550
550
|
}, onOpen: () => {
|
|
551
|
-
|
|
551
|
+
O2(true), x2?.();
|
|
552
552
|
} }), _2 = K((e2) => {
|
|
553
553
|
0 === e2.button && (d2?.(e2), q2.reference.close(0));
|
|
554
554
|
}, [d2]), j2 = e(We, {}), U2 = { "&.Mui-selected": { color: (e2) => e2.palette.text.primary, "& svg * ": { color: (e2) => e2.palette.text.primary } } }, Q2 = p((t2) => {
|
|
@@ -575,19 +575,19 @@ const Ot = {}, $t = n(i((r2, n2) => {
|
|
|
575
575
|
}, onMouseDown: (e2) => {
|
|
576
576
|
0 === e2.button && (e2.preventDefault(), _2(e2));
|
|
577
577
|
}, className: h("quick-left", {}, g2?.className), ...g2 });
|
|
578
|
-
J2 = t(o, { children: [r3, e(y, { sx: { ml: "0px", mr: "0px" }, orientation: "vertical", variant: "middle", flexItem: true }), e(D, { ref: W2, className: h({ "Mui-selected":
|
|
578
|
+
J2 = t(o, { children: [r3, e(y, { sx: { ml: "0px", mr: "0px" }, orientation: "vertical", variant: "middle", flexItem: true }), e(D, { ref: W2, className: h({ "Mui-selected": z2, "Mui-hovered": B2 }), sx: { borderTopLeftRadius: "0px", borderBottomLeftRadius: "0px", paddingLeft: "0px", paddingRight: "0px", marginLeft: "0px", color: (e2) => R2 ? void 0 : e2.palette.text.secondary, "&.Mui-hovered:not(.Mui-disabled, [disabled])": { color: (e2) => e2.palette.text.primary }, ...U2 }, tabIndex: -1, disabled: S2, ...Y2, children: e(v, { className: "expand-icon", sx: { flex: "none", display: "flex", border: "1px solid transparent", paddingTop: "1px", paddingBottom: "1px", color: (e2) => R2 ? void 0 : e2.palette.text.icon ?? e2.palette.action.active }, onMouseOver: (e2) => {
|
|
579
579
|
e2.preventDefault(), A2(true);
|
|
580
580
|
}, onMouseLeave: () => {
|
|
581
581
|
A2(false);
|
|
582
582
|
}, onClick: (e2) => {
|
|
583
|
-
e2.preventDefault(),
|
|
583
|
+
e2.preventDefault(), z2 ? q2.reference.close() : q2.reference.open();
|
|
584
584
|
}, children: j2 }) })] });
|
|
585
|
-
} else J2 = t(Dt, { ref: W2, tabIndex: -1, disabled: S2, icon: M2, className: h({ "Mui-selected":
|
|
586
|
-
e2.preventDefault(),
|
|
585
|
+
} else J2 = t(Dt, { ref: W2, tabIndex: -1, disabled: S2, icon: M2, className: h({ "Mui-selected": z2 || i2, "Mui-hovered": B2 }), sx: { flex: "1 1 100%", paddingRight: "0px", ...U2 }, onClick: (e2) => {
|
|
586
|
+
e2.preventDefault(), z2 ? q2.reference.close() : q2.reference.open();
|
|
587
587
|
}, ...Y2, children: [e("div", { style: { flex: "1 1 100%" }, children: s2 }), e(v, { className: "expand-icon", sx: { flex: "none", display: "flex", color: (e2) => R2 ? void 0 : e2.palette.text.icon ?? e2.palette.action.active }, children: j2 })] });
|
|
588
|
-
let Z2 = e(v, { "aria-label": "split button", ref: H2, tabIndex: S2 ? void 0 : 0, className: h({ "Mui-disabled": S2, "Mui-selected":
|
|
589
|
-
return G2 && !F2 && (g2?.tooltip || g2?.createTooltip) && (Z2 = (g2?.createTooltip ?? Q2)({ title:
|
|
590
|
-
})),
|
|
588
|
+
let Z2 = e(v, { "aria-label": "split button", ref: H2, tabIndex: S2 ? void 0 : 0, className: h({ "Mui-disabled": S2, "Mui-selected": z2, "Mui-focusVisible": I2 || z2, "Mui-hovered": B2 }), 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%)" }, ...T2 }, ...$2, children: J2 });
|
|
589
|
+
return G2 && !F2 && (g2?.tooltip || g2?.createTooltip) && (Z2 = (g2?.createTooltip ?? Q2)({ title: z2 ? "" : Z2 ?? g2?.tooltip, children: Z2 }, z2)), t(v, { ref: n2, sx: { zIndex: I2 || z2 ? 2 : void 0, display: "flex", " .tooltip-wrapper": { display: "flex", flex: "1 1 100%" } }, children: [Z2, q2.component] });
|
|
590
|
+
})), Ot = n(i((t2, o2) => {
|
|
591
591
|
const { onSelectToggle: r2, selected: n2 = false, label: i2, shortcut: a2, tabIndex: l2 = 0, preventFocus: s2 = false, ...c2 } = t2;
|
|
592
592
|
return e(wt, { label: i2, shortcut: a2, children: e(St, { ref: o2, outlined: false, tabIndex: l2, selected: n2, onMouseDown: (e2) => {
|
|
593
593
|
s2 && e2.preventDefault();
|
|
@@ -604,22 +604,24 @@ const Ot = {}, $t = n(i((r2, n2) => {
|
|
|
604
604
|
function Lt(e2) {
|
|
605
605
|
const [t2, o2] = c(() => /* @__PURE__ */ new Map()), { showModal: n2, updateModal: i2, destroyModal: a2, hideModal: l2 } = le({ disableAutoDestroy: true });
|
|
606
606
|
return (s2, c2, d2, p2) => new Promise((u2, m2) => {
|
|
607
|
-
|
|
607
|
+
let h2 = false;
|
|
608
|
+
void 0 !== d2?.disableAutoDestroy && (h2 = d2.disableAutoDestroy, delete (d2 = { ...d2 }).disableAutoDestroy);
|
|
609
|
+
const f2 = { ...e2, ...d2, ...p2, onHide: () => {
|
|
608
610
|
const e3 = t2.get(s2);
|
|
609
|
-
|
|
611
|
+
p2?.onHide?.(), o2((e4) => (e4.delete(s2), e4)), l2(e3.id);
|
|
610
612
|
}, onDone: (e3) => {
|
|
611
613
|
const r2 = t2.get(s2);
|
|
612
|
-
o2((e4) => (e4.delete(s2), e4)),
|
|
614
|
+
o2((e4) => (e4.delete(s2), e4)), p2?.onDone?.(e3), r2 && r2.id && !h2 && a2(r2.id);
|
|
613
615
|
}, onShown: (e3) => {
|
|
614
616
|
o2((t3) => {
|
|
615
617
|
const o3 = t3.get(s2);
|
|
616
618
|
return t3.set(s2, { ...o3, element: e3 }), t3;
|
|
617
619
|
}), u2(e3);
|
|
618
|
-
}, open: true },
|
|
619
|
-
if (
|
|
620
|
-
if (!c2) return void m2(
|
|
621
|
-
const
|
|
622
|
-
o2((e3) => (e3.set(s2, { id:
|
|
620
|
+
}, open: true }, x2 = t2.get(s2);
|
|
621
|
+
if (x2) return i2(x2.id, f2), u2(x2.element), void (f2.autoFocus && x2.element?.focus());
|
|
622
|
+
if (!c2) return void m2(`Invalid function for window '${s2}'`);
|
|
623
|
+
const b2 = r.lazy(c2), g2 = n2(b2, f2, { destroyOnClose: !h2 });
|
|
624
|
+
o2((e3) => (e3.set(s2, { id: g2.id, element: null }), e3));
|
|
623
625
|
});
|
|
624
626
|
}
|
|
625
627
|
const Ft = { x: 0, y: 0 }, At = n(i((t2, o2) => {
|
|
@@ -636,12 +638,12 @@ const Ft = { x: 0, y: 0 }, At = n(i((t2, o2) => {
|
|
|
636
638
|
y2({ x: r3 - C2.x, y: n3 - C2.y });
|
|
637
639
|
}, children: e(n2, { ref: re([x2, o2]), ...f2 }) });
|
|
638
640
|
})), Ht = { x: "50", y: "50" }, Wt = n(i((o2, r2) => {
|
|
639
|
-
const n2 = ee({ props: o2, name: "MuiDialog" }), i2 = Y(), a2 = { enter: 0.66 * i2.transitions.duration.enteringScreen, exit: 0.66 * i2.transitions.duration.leavingScreen }, { title: d2 = "SheetXL", key: p2 = "draggable-window", onCancel: u2, onDone: m2, onShow: x2, onShown: b2, onHide: y2, onClose: k2, open: C2, autoFocusSel: M2, children: S2, transitionDuration: P2 = a2, TransitionProps: R2, slots: D2 = F.EmptyArray, slotProps:
|
|
641
|
+
const n2 = ee({ props: o2, name: "MuiDialog" }), i2 = Y(), a2 = { enter: 0.66 * i2.transitions.duration.enteringScreen, exit: 0.66 * i2.transitions.duration.leavingScreen }, { title: d2 = "SheetXL", key: p2 = "draggable-window", onCancel: u2, onDone: m2, onShow: x2, onShown: b2, onHide: y2, onClose: k2, open: C2, autoFocusSel: M2, children: S2, transitionDuration: P2 = a2, TransitionProps: R2, slots: D2 = F.EmptyArray, slotProps: z2 = F.EmptyArray, sx: O2, className: I2, onMouseDown: N2, initialPosition: B2 = Ht, isModal: L2 = false, ...A2 } = n2;
|
|
640
642
|
let H2 = D2.transition ?? E;
|
|
641
643
|
const _2 = D2.backdrop ?? T, j2 = D2.paper ?? w;
|
|
642
|
-
let Q2 =
|
|
644
|
+
let Q2 = z2.transition;
|
|
643
645
|
R2 && (Q2 = { ...R2, ...Q2 });
|
|
644
|
-
const G2 =
|
|
646
|
+
const G2 = z2.backdrop, X2 = z2.paper, J2 = l(null), [Z2, te2] = c(null), [oe2, ne2] = c(false), [ae2, le2] = c(false), de2 = l(null), [pe2, ue2] = ie(), me2 = l(null), [he2, fe2] = ie(), xe2 = l(null);
|
|
645
647
|
s(() => {
|
|
646
648
|
Z2 && ne2(C2);
|
|
647
649
|
}, [C2, Z2]);
|
|
@@ -680,7 +682,7 @@ const Ft = { x: 0, y: 0 }, At = n(i((t2, o2) => {
|
|
|
680
682
|
}, [ae2]);
|
|
681
683
|
let Re2 = e(ce, { focusTrapOptions: { escapeDeactivates: false, allowOutsideClick: true, initialFocus: false }, ref: J2, active: ae2, children: e(H2, { in: oe2, timeout: P2, role: "presentation", ...Pe2, children: e(v, { className: "MuiDialog-container", ref: me2, tabIndex: 0, sx: { outline: "none", position: "relative" }, onKeyDown: (e2) => {
|
|
682
684
|
e2.which === q.Escape && (be2(), de2.current?.start(e2, { center: false }), setTimeout(() => de2.current?.stop(e2), 180)), e2.stopPropagation();
|
|
683
|
-
}, children: t(At, { ref: re([xe2, r2]), className: h({ "Mui-focusVisible": ge2 }, I2, "draggable"), sx: { "& *": (e2) => Xe(e2), pointerEvents: "auto", userSelect: "none", "&:hover:not([disabled]):not(.Mui-focusVisible)": { outline: (e2) => `solid ${f(e2.palette.text?.primary, 0.2)} 1px` }, "&.Mui-focusVisible": { outline: (e2) => `solid ${f(e2.palette.text?.primary, 0.2)} 1px` }, position: "absolute", maxWidth: "100%", ...
|
|
685
|
+
}, children: t(At, { ref: re([xe2, r2]), className: h({ "Mui-focusVisible": ge2 }, I2, "draggable"), sx: { "& *": (e2) => Xe(e2), pointerEvents: "auto", userSelect: "none", "&:hover:not([disabled]):not(.Mui-focusVisible)": { outline: (e2) => `solid ${f(e2.palette.text?.primary, 0.2)} 1px` }, "&.Mui-focusVisible": { outline: (e2) => `solid ${f(e2.palette.text?.primary, 0.2)} 1px` }, position: "absolute", maxWidth: "100%", ...O2 }, defaultPosition: Z2, titleSize: fe2, rootSize: ue2, PaperComponent: j2, ...A2, ...X2, children: [d2 ? e($, { className: h({ "Mui-selected": ge2 }, "draggable-title"), sx: { cursor: "move", display: "flex", color: (e2) => e2.palette.text.secondary, boxSizing: "border-box", padding: "0 0", transitionProperty: "opacity", transitionDuration: (e2) => `${e2.transitions.duration.shortest}ms`, opacity: 0.7, "&.Mui-selected": { opacity: 1, transitionDuration: (e2) => e2.transitions.duration.shortest / 2 + "ms" }, backgroundColor: (e2) => f(e2.palette.action.hover, 0.03) }, ref: he2, children: t(v, { sx: { display: "flex", flex: "1 1 10%", flexDirection: "row", alignItems: "center", marginTop: (e2) => e2.spacing(1), marginLeft: (e2) => e2.spacing(1), marginRight: (e2) => e2.spacing(1) }, children: [e(v, { sx: { flex: "1 1 100%", paddingLeft: (e2) => e2.spacing(1) }, children: d2 }), e(wt, { label: "Close", children: e(g, { "aria-label": "close", sx: { color: (e2) => e2.palette.text.icon ?? e2.palette.action.active }, touchRippleRef: de2, onPointerDown: (e2) => {
|
|
684
686
|
de2.current?.start(e2, { center: false }), e2.stopPropagation(), e2.preventDefault();
|
|
685
687
|
}, onPointerUp: be2, children: e(W, { iconKey: "Close" }) }) })] }) }) : null, S2] }) }) }) }), De2 = null;
|
|
686
688
|
L2 && (De2 = e(_2, { ...G2, open: oe2, onMouseDown: (e2) => {
|
|
@@ -701,54 +703,54 @@ const Ft = { x: 0, y: 0 }, At = n(i((t2, o2) => {
|
|
|
701
703
|
Se2?.current?.contains(e2.relatedTarget) || (Ce2(null), J2.current?.focusTrap?.pause(), ye2(false));
|
|
702
704
|
}, children: [De2, Re2] }), Ee2(), p2 + "");
|
|
703
705
|
})), Kt = ["Ok", "Cancel"], Vt = n(i((o2, r2) => {
|
|
704
|
-
const { description: n2, icon: i2, onCancel: s2, onOption: c2, onDone: d2, onValidateOption: p2, createOptionsButton: u2, options: m2 = Kt, autoFocusSel: h2 = ".defaultOption", defaultOption: x2 = m2[0], cancelOption: b2 = "Cancel",
|
|
706
|
+
const { description: n2, icon: i2, onCancel: s2, onOption: c2, onDone: d2, onValidateOption: p2, createOptionsButton: u2, options: m2 = Kt, autoFocusSel: h2 = ".defaultOption", defaultOption: x2 = m2[0], cancelOption: b2 = "Cancel", autoFocus: g2, children: y2, ...w2 } = o2, C2 = ue({ shouldUseNativeValidation: false }), { handleSubmit: M2, formState: S2 } = C2, P2 = l(null), R2 = l(null), D2 = l(null), E2 = K(async (e2) => {
|
|
705
707
|
let t2;
|
|
706
708
|
try {
|
|
707
709
|
if (t2 = await Promise.resolve(p2?.(e2)) ?? true, true !== t2) return;
|
|
708
710
|
await Promise.resolve(c2?.(e2, e2 === b2, e2 === x2)), d2?.(e2);
|
|
709
711
|
} catch (e3) {
|
|
710
712
|
}
|
|
711
|
-
}, [c2, d2, p2, b2, x2]),
|
|
713
|
+
}, [c2, d2, p2, b2, x2]), T2 = K((e2, t2) => {
|
|
712
714
|
setTimeout(() => {
|
|
713
|
-
|
|
715
|
+
E2(x2);
|
|
714
716
|
}, 180);
|
|
715
|
-
}, [
|
|
717
|
+
}, [E2]), $2 = K(() => {
|
|
716
718
|
c2?.(b2, true, false), s2?.(), d2?.(null);
|
|
717
|
-
}, [c2, b2, s2, d2]),
|
|
719
|
+
}, [c2, b2, s2, d2]), N2 = S2 && (Object.keys(S2.errors).length > 0 || S2.disabled || S2.isSubmitted), B2 = K((t2, o3) => {
|
|
718
720
|
const r3 = t2 === b2, n3 = { className: o3 ? "defaultOption" : "action", type: o3 ? "submit" : "button", style: { minWidth: "75px" }, onClick: () => {
|
|
719
|
-
r3 ?
|
|
721
|
+
r3 ? $2() : o3 || E2(t2);
|
|
720
722
|
} };
|
|
721
723
|
if (u2) return u2(t2, n3, o3);
|
|
722
|
-
const i3 = { className: o3 ? "defaultOption" : "action", variant: o3 ? "contained" : "outlined", size: "small", disabled: !r3 &&
|
|
724
|
+
const i3 = { className: o3 ? "defaultOption" : "action", variant: o3 ? "contained" : "outlined", size: "small", disabled: !r3 && N2, color: "primary", ...n3 };
|
|
723
725
|
if (o3 || r3) {
|
|
724
|
-
const e2 = o3 ?
|
|
726
|
+
const e2 = o3 ? P2 : R2;
|
|
725
727
|
i3.touchRippleRef = e2, i3.onPointerDown = (t3) => {
|
|
726
728
|
e2.current?.start(t3, { center: false }), t3.stopPropagation(), t3.preventDefault();
|
|
727
729
|
};
|
|
728
730
|
}
|
|
729
|
-
return e(
|
|
730
|
-
}, [m2, x2, b2, u2,
|
|
731
|
+
return e(z, { ...i3, children: e("div", { style: { paddingTop: "3px" }, children: t2 }) }, `action:${t2}`);
|
|
732
|
+
}, [m2, x2, b2, u2, S2]), L2 = a(() => {
|
|
731
733
|
const e2 = [];
|
|
732
734
|
for (let t2 = 0; t2 < m2.length; t2++) {
|
|
733
735
|
const o3 = m2[t2], r3 = x2 ? o3 === x2 : 0 === t2;
|
|
734
|
-
e2.push(
|
|
736
|
+
e2.push(B2(o3, r3));
|
|
735
737
|
}
|
|
736
738
|
return e2;
|
|
737
|
-
}, [m2, x2,
|
|
738
|
-
return e(Wt, { onCancel:
|
|
739
|
+
}, [m2, x2, S2]);
|
|
740
|
+
return e(Wt, { onCancel: $2, initialPosition: { y: "touch" === pe ? "15" : "35" }, onDone: d2, autoFocusSel: h2, isModal: true, ref: r2, ...w2, children: e(me, { ...C2, children: t("form", { ref: D2, onSubmit: M2(T2), children: [e(O, { dividers: true, onKeyDown: (e2) => {
|
|
739
741
|
if (e2.isDefaultPrevented()) return;
|
|
740
742
|
e2.stopPropagation();
|
|
741
743
|
let t2 = null, o3 = null;
|
|
742
744
|
const r3 = e2.which === q.Escape && b2;
|
|
743
|
-
if (r3) t2 = b2, o3 =
|
|
745
|
+
if (r3) t2 = b2, o3 = R2;
|
|
744
746
|
else {
|
|
745
|
-
if (
|
|
746
|
-
e2.which === q.Enter && (t2 = x2 ?? m2[0], o3 =
|
|
747
|
+
if (N2) return;
|
|
748
|
+
e2.which === q.Enter && (t2 = x2 ?? m2[0], o3 = P2);
|
|
747
749
|
}
|
|
748
750
|
t2 && (o3.current?.start(e2, { center: false }), setTimeout(() => {
|
|
749
|
-
o3.current?.stop(e2), r3 &&
|
|
751
|
+
o3.current?.stop(e2), r3 && E2(t2);
|
|
750
752
|
}, 180));
|
|
751
|
-
}, children: t(v, { sx: { display: "flex", flexDirection: "column", whiteSpace: "pre-wrap", rowGap: (e2) => e2.spacing(i2 || n2 ? 1.5 : 0) }, children: [t(v, { sx: { display: "flex", flexDirection: "column" }, children: [i2, e(k, { children: n2 })] }),
|
|
753
|
+
}, children: t(v, { sx: { display: "flex", flexDirection: "column", whiteSpace: "pre-wrap", rowGap: (e2) => e2.spacing(i2 || n2 ? 1.5 : 0) }, children: [t(v, { sx: { display: "flex", flexDirection: "column" }, children: [i2, e(k, { children: n2 })] }), y2] }) }), e(I, { sx: { paddingTop: (e2) => e2.spacing(1), paddingBottom: (e2) => e2.spacing(1), paddingLeft: (e2) => e2.spacing(1), paddingRight: (e2) => e2.spacing(1), backgroundColor: (e2) => f(e2.palette.action.hover, 0.03) }, children: L2 })] }) }) });
|
|
752
754
|
})), qt = Object.freeze(Object.defineProperty({ __proto__: null, OptionsDialog: Vt, default: Vt }, Symbol.toStringTag, { value: "Module" })), _t = r.lazy(() => Promise.resolve().then(() => qt)), jt = (e2) => {
|
|
753
755
|
const { showModal: t2 } = le();
|
|
754
756
|
return (o2) => new Promise((r2) => {
|
|
@@ -758,15 +760,15 @@ const Ft = { x: 0, y: 0 }, At = n(i((t2, o2) => {
|
|
|
758
760
|
o2?.onDone?.(), n2.hide();
|
|
759
761
|
} });
|
|
760
762
|
});
|
|
761
|
-
}, Ut = r.lazy(() => import("./
|
|
763
|
+
}, Ut = r.lazy(() => import("./B8AkLqu0SQMq831k.mjs")), Qt = (e2) => {
|
|
762
764
|
const { showModal: t2 } = le();
|
|
763
765
|
return (o2) => {
|
|
764
766
|
const { defaultOption: r2 = o2.options?.[0], cancelOption: n2 = "Cancel", ...i2 } = o2;
|
|
765
767
|
return new Promise((o3) => {
|
|
766
|
-
const a2 = t2(Ut, { ...e2, defaultOption: r2, cancelOption: n2, onOption(e3) {
|
|
768
|
+
const a2 = t2(Ut, { ...e2, defaultOption: r2, cancelOption: n2, ...i2, onOption(e3) {
|
|
767
769
|
i2?.onOption?.(e3, e3 === n2, e3 === r2), o3({ input: "", option: e3 });
|
|
768
|
-
},
|
|
769
|
-
i2?.
|
|
770
|
+
}, onInput(e3, t3) {
|
|
771
|
+
i2?.onInput?.(e3, t3), o3({ input: e3, option: t3 });
|
|
770
772
|
}, onDone: () => {
|
|
771
773
|
i2?.onDone?.(), a2.hide();
|
|
772
774
|
} });
|
|
@@ -863,7 +865,7 @@ const Jt = e(W, {}), Zt = n(i((o2, r2) => {
|
|
|
863
865
|
(M2 || f2) && (P2.createTooltip = ({ children: t3 }, o3) => e(wt, { label: M2, description: f2, disabled: o3, children: t3 }));
|
|
864
866
|
const R2 = K((e2) => h2?.(e2, s2), [h2, w2]), D2 = K((e2) => C2?.execute(c2, k2), [C2]);
|
|
865
867
|
return C2 ? (P2.quickButtonProps = {}, P2.quickButtonProps.createTooltip = ({ children: t3, placement: o3 }, n3) => e(Gt, { command: C2, placement: o3 ?? r2 === G.Toolbar ? "bottom-start" : "right-start", disabled: n3, children: t3 }), P2.disabled = P2.disabled ?? C2?.disabled(), i2 || (P2.onQuickClick = D2)) : n2 && (P2.onQuickClick = () => {
|
|
866
|
-
}), P2.selected = x2 ?? C2?.state(), P2.createPopupPanel = R2, r2 === G.Toolbar ? e(Tt, { ...g2, ...P2, ref: o2 }) : e(
|
|
868
|
+
}), P2.selected = x2 ?? C2?.state(), P2.createPopupPanel = R2, r2 === G.Toolbar ? e(Tt, { ...g2, ...P2, ref: o2 }) : e(zt, { ...g2, ...P2, ref: o2 });
|
|
867
869
|
}));
|
|
868
870
|
eo.displayName = "CommandPopupButton";
|
|
869
871
|
const to = e(W, { iconKey: "Check" }), oo = (o2) => {
|
|
@@ -939,16 +941,16 @@ export {
|
|
|
939
941
|
ro as CommandToolbar,
|
|
940
942
|
Gt as CommandTooltip,
|
|
941
943
|
bt as ContextMenu,
|
|
942
|
-
|
|
944
|
+
Oe as ErrorPanel,
|
|
943
945
|
ge as ExhibitDivider,
|
|
944
946
|
at as ExhibitFloatPanel,
|
|
945
947
|
St as ExhibitIconButton,
|
|
946
948
|
Et as ExhibitMenuHeader,
|
|
947
949
|
Dt as ExhibitMenuItem,
|
|
948
|
-
|
|
950
|
+
Ot as ExhibitOptionButton,
|
|
949
951
|
Le as ExhibitPopper,
|
|
950
952
|
Tt as ExhibitPopupIconButton,
|
|
951
|
-
|
|
953
|
+
zt as ExhibitPopupMenuItem,
|
|
952
954
|
wt as ExhibitTooltip,
|
|
953
955
|
Zt as InputCommandButton,
|
|
954
956
|
Wt as InternalWindow,
|
|
@@ -962,7 +964,7 @@ export {
|
|
|
962
964
|
Bt as SelectedIcon,
|
|
963
965
|
io as SimpleCommandPopupButton,
|
|
964
966
|
gt as SimpleTooltip,
|
|
965
|
-
|
|
967
|
+
$e as StackTrace,
|
|
966
968
|
Ye as ThemeMode,
|
|
967
969
|
Ke as ThemedIcon,
|
|
968
970
|
it as createDownArrow,
|
|
@@ -985,5 +987,5 @@ export {
|
|
|
985
987
|
Lt as useLazyWindow,
|
|
986
988
|
jt as useOptionsDialog,
|
|
987
989
|
Je as useResolvedThemeMode,
|
|
988
|
-
|
|
990
|
+
ze as wrapErrorAsComponent
|
|
989
991
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/utils-mui",
|
|
3
3
|
"description": "Utilities MUI - Utilities for MUI Components needed for all SheetXL components.",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.13",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@popperjs/core": "^2.11.8",
|
|
48
|
-
"@sheetxl/utils": "^0.7.
|
|
49
|
-
"@sheetxl/utils-react": "^0.7.
|
|
48
|
+
"@sheetxl/utils": "^0.7.13",
|
|
49
|
+
"@sheetxl/utils-react": "^0.7.13",
|
|
50
50
|
"clsx": "^2.1.1",
|
|
51
51
|
"detect-it": "^4.0.1",
|
|
52
52
|
"focus-trap-react": "^10.1.4",
|
|
53
53
|
"mui-modal-provider": "2.4.6",
|
|
54
54
|
"react-draggable": "^4.5.0",
|
|
55
|
-
"react-hook-form": "^7.
|
|
55
|
+
"react-hook-form": "^7.64.0",
|
|
56
56
|
"react-merge-refs": "^3.0.2",
|
|
57
57
|
"react-use": "^17.6.0",
|
|
58
58
|
"tiny-invariant": "^1.3.3"
|
|
@@ -61,11 +61,15 @@
|
|
|
61
61
|
"@emotion/cache": "^11.14.0",
|
|
62
62
|
"@emotion/react": "^11.14.0",
|
|
63
63
|
"@emotion/styled": "^11.14.0",
|
|
64
|
-
"@mui/material": "^7.
|
|
65
|
-
"@mui/styled-engine": "^7.
|
|
66
|
-
"@mui/system": "^7.
|
|
67
|
-
"@mui/utils": "^7.
|
|
68
|
-
"react": "^19.
|
|
69
|
-
"react-dom": "^19.
|
|
64
|
+
"@mui/material": "^7.0.0",
|
|
65
|
+
"@mui/styled-engine": "^7.0.0",
|
|
66
|
+
"@mui/system": "^7.0.0",
|
|
67
|
+
"@mui/utils": "^7.0.0",
|
|
68
|
+
"react": "^19.0.0",
|
|
69
|
+
"react-dom": "^19.0.0"
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@types/react": "^19.2.0",
|
|
73
|
+
"@types/react-dom": "^19.2.0"
|
|
70
74
|
}
|
|
71
75
|
}
|