@sheetxl/utils-mui 0.4.6 → 0.4.8
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/{BVNHjdSohnpdKwtL.cjs → BYL_FbBGg_H8h0Xv.cjs} +2 -2
- package/browser/cjs/DISwCrEsJLyrK0uw.cjs +30 -0
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{BcsnYPx5IpndbBD5.mjs → C9qncImnpzkp3xO9.mjs} +813 -815
- package/browser/esm/{D8jucrIoUtNPJNkK.mjs → Z7mM_q_lxnH2UXqh.mjs} +2 -2
- package/browser/esm/index.mjs +2 -2
- package/licenses/dependencies.txt +2 -2
- package/node/esm/{B-PHH99uLC_JM_58.mjs → D8V9MFaKT3NbfJng.mjs} +1 -1
- package/node/esm/index.mjs +47 -49
- package/package.json +3 -3
- package/types/index.d.ts +8 -19
- package/browser/cjs/1XQwNg77YwT_tREs.cjs +0 -30
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { memo as z, forwardRef as E, useState as p } from "react";
|
|
3
|
-
import { T as n, e as K, O as R, c as W, g as O } from "./
|
|
3
|
+
import { T as n, e as K, O as R, c as W, g as O } from "./C9qncImnpzkp3xO9.mjs";
|
|
4
4
|
import { Box as q, FormControl as A, TextField as G } from "@mui/material";
|
|
5
5
|
import { alpha as y } from "@mui/system";
|
|
6
6
|
/**
|
|
7
|
-
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.4.
|
|
7
|
+
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.4.8
|
|
8
8
|
*
|
|
9
9
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
10
10
|
* License: The license can be found at https://www.sheetxl.com/license.
|
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 e, y as n, A as s, z as c, D as t, F as r, B as I, P as l, be as i, bm as b, bg as u, bf as d, bj as m, bn as p, bi as C, bl as S, bk as T, bh as D, cA as w, bU as F, bS as x, bT as g, bV as h, Q as R, bR as A, J as B, _ as z, Z as E, $ as P, bQ as M, cM as k, cm as v, a3 as H, a0 as f, a1 as y, a2 as V, bX as O, bW as L, ag as N, cS as U, cU as W, cX as G, cV as K, K as j, ao as q, am as J, an as Q, ak as X, al as Y, bF as _, bE as Z, cd as $, c9 as aa, ce as oa, cf as ea, c8 as na, cc as sa, ca, cb as ta, c6 as ra, cg as Ia, ch as la, ck as ia, c5 as ba, c4 as ua, c7 as da, ci as ma, cj as pa, c2 as Ca, c3 as Sa, cl as Ta, c1 as Da, H as wa, x as Fa, cR as xa, E as ga, b as ha, a as Ra, h as Aa, cK as Ba, d as za, f as Ea, i as Pa, by as Ma, bx as ka, bw as va, bu as Ha, bv as fa, aA as ya, ae as Va, af as Oa, ad as La, bK as Na, bH as Ua, bJ as Wa, bO as Ga, bN as Ka, bM as ja, bI as qa, bL as Ja, aO as Qa, aN as Xa, aP as Ya, cB as _a, ac as Za, ab as $a, a9 as ao, aa as oo, bq as eo, br as no, cs as so, cu as co, ct as to, bG as ro, bP as Io, bC as lo, ax as io, az as bo, ai as uo, aj as mo, cT as po, aB as Co, aD as So, aC as To, aG as Do, aF as wo, aH as Fo, aE as xo, aI as go, cE as ho, cW as Ro, L as Ao, a5 as Bo, a4 as zo, a6 as Eo, a8 as Po, a7 as Mo, cC as ko, N as vo, bp as Ho, O as fo, as as yo, at as Vo, aq as Oo, av as Lo, au as No, ar as Uo, ah as Wo, cL as Go, cN as Ko, bo as jo, cr as qo, aJ as Jo, aL as Qo, aK as Xo, aM as Yo, bY as _o, bZ as Zo, cz as $o, cy as ae, cw as oe, cv as ee, cx as ne, co as se, cp as ce, S as te, aw as re, ay as Ie, cY as le, M as ie, aS as be, aR as ue, aQ as de, aV as me, aT as pe, aU as Ce, I as Se, bz as Te, bA as De, b_ as we, b$ as Fe, c0 as xe, cn as ge, Y as he, V as Re, R as Ae, W as Be, U as ze, X as Ee, b3 as Pe, b7 as Me, b6 as ke, b8 as ve, b4 as He, b5 as fe, ba as ye, b9 as Ve, aX as Oe, aW as Le, aY as Ne, a_ as Ue, aZ as We, b2 as Ge, b1 as Ke, b0 as je, a$ as qe, bd as Je, bc as Qe, bb as Xe, bs as Ye, bt as _e, q as Ze, bD as $e, cq as an, bB as on, ap as en, cP as nn, l as sn, u as cn, r as tn, w as rn, v as In, n as ln, cO as bn, k as un, cH as dn, j as mn, o as pn, s as Cn, cI as Sn, m as Tn, p as Dn, t as wn, cQ as Fn, cG as xn, cD as gn, cJ as hn, cF as Rn, G as An } from "./
|
|
2
|
+
import { C as e, y as n, A as s, z as c, D as t, F as r, B as I, P as l, be as i, bm as b, bg as u, bf as d, bj as m, bn as p, bi as C, bl as S, bk as T, bh as D, cA as w, bU as F, bS as x, bT as g, bV as h, Q as R, bR as A, J as B, _ as z, Z as E, $ as P, bQ as M, cM as k, cm as v, a3 as H, a0 as f, a1 as y, a2 as V, bX as O, bW as L, ag as N, cS as U, cU as W, cX as G, cV as K, K as j, ao as q, am as J, an as Q, ak as X, al as Y, bF as _, bE as Z, cd as $, c9 as aa, ce as oa, cf as ea, c8 as na, cc as sa, ca, cb as ta, c6 as ra, cg as Ia, ch as la, ck as ia, c5 as ba, c4 as ua, c7 as da, ci as ma, cj as pa, c2 as Ca, c3 as Sa, cl as Ta, c1 as Da, H as wa, x as Fa, cR as xa, E as ga, b as ha, a as Ra, h as Aa, cK as Ba, d as za, f as Ea, i as Pa, by as Ma, bx as ka, bw as va, bu as Ha, bv as fa, aA as ya, ae as Va, af as Oa, ad as La, bK as Na, bH as Ua, bJ as Wa, bO as Ga, bN as Ka, bM as ja, bI as qa, bL as Ja, aO as Qa, aN as Xa, aP as Ya, cB as _a, ac as Za, ab as $a, a9 as ao, aa as oo, bq as eo, br as no, cs as so, cu as co, ct as to, bG as ro, bP as Io, bC as lo, ax as io, az as bo, ai as uo, aj as mo, cT as po, aB as Co, aD as So, aC as To, aG as Do, aF as wo, aH as Fo, aE as xo, aI as go, cE as ho, cW as Ro, L as Ao, a5 as Bo, a4 as zo, a6 as Eo, a8 as Po, a7 as Mo, cC as ko, N as vo, bp as Ho, O as fo, as as yo, at as Vo, aq as Oo, av as Lo, au as No, ar as Uo, ah as Wo, cL as Go, cN as Ko, bo as jo, cr as qo, aJ as Jo, aL as Qo, aK as Xo, aM as Yo, bY as _o, bZ as Zo, cz as $o, cy as ae, cw as oe, cv as ee, cx as ne, co as se, cp as ce, S as te, aw as re, ay as Ie, cY as le, M as ie, aS as be, aR as ue, aQ as de, aV as me, aT as pe, aU as Ce, I as Se, bz as Te, bA as De, b_ as we, b$ as Fe, c0 as xe, cn as ge, Y as he, V as Re, R as Ae, W as Be, U as ze, X as Ee, b3 as Pe, b7 as Me, b6 as ke, b8 as ve, b4 as He, b5 as fe, ba as ye, b9 as Ve, aX as Oe, aW as Le, aY as Ne, a_ as Ue, aZ as We, b2 as Ge, b1 as Ke, b0 as je, a$ as qe, bd as Je, bc as Qe, bb as Xe, bs as Ye, bt as _e, q as Ze, bD as $e, cq as an, bB as on, ap as en, cP as nn, l as sn, u as cn, r as tn, w as rn, v as In, n as ln, cO as bn, k as un, cH as dn, j as mn, o as pn, s as Cn, cI as Sn, m as Tn, p as Dn, t as wn, cQ as Fn, cG as xn, cD as gn, cJ as hn, cF as Rn, G as An } from "./C9qncImnpzkp3xO9.mjs";
|
|
3
3
|
/**
|
|
4
|
-
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.4.
|
|
4
|
+
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.4.8
|
|
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.
|
|
@@ -21,7 +21,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
23
|
Name: @sheetxl/utils
|
|
24
|
-
Version: 0.4.
|
|
24
|
+
Version: 0.4.8
|
|
25
25
|
License: SEE LICENSE IN <LICENSE>
|
|
26
26
|
Private: false
|
|
27
27
|
Description: Utils - Utilities used by most SheetXL components.
|
|
@@ -216,7 +216,7 @@ SOFTWARE.
|
|
|
216
216
|
---
|
|
217
217
|
|
|
218
218
|
Name: @sheetxl/utils-react
|
|
219
|
-
Version: 0.4.
|
|
219
|
+
Version: 0.4.8
|
|
220
220
|
License: SEE LICENSE IN <LICENSE>
|
|
221
221
|
Private: false
|
|
222
222
|
Description: Utils React - Utilities for React capabilities needed for all SheetXL components.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.4.
|
|
2
|
+
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.4.8
|
|
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.
|
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.4.
|
|
2
|
+
* @license @sheetxl/utils-mui - Utilities MUI - Utilities for MUI Components needed for all SheetXL components. - v0.4.8
|
|
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.
|
|
@@ -1807,12 +1807,12 @@ const Xi = (e5 = null, t2, n2, o2) => {
|
|
|
1807
1807
|
}, Qi = r(l((n2, o2) => {
|
|
1808
1808
|
const { nestedChildren: r2, variant: l2, disabled: i2 = false, createPopupPanel: c2, ...a2 } = n2, s2 = Vn((n3) => {
|
|
1809
1809
|
if (!r2 || 0 === r2.length) return null;
|
|
1810
|
-
const { popupContainer: l3, floatReference: i3,
|
|
1810
|
+
const { popupContainer: l3, floatReference: i3, ref: c3, ...a3 } = n3, s3 = [];
|
|
1811
1811
|
for (let t2 = 0; t2 < r2.length; t2++) {
|
|
1812
1812
|
const n4 = r2[t2];
|
|
1813
|
-
n4 &&
|
|
1813
|
+
n4 && s3.push(e(Qi, { parentFloat: i3, ...a3, ...n4 }, t2));
|
|
1814
1814
|
}
|
|
1815
|
-
return t(b, { ref: o2, sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, children: ["Children here",
|
|
1815
|
+
return t(b, { ref: o2, sx: { display: "flex", flexDirection: "column", paddingTop: "4px", paddingBottom: "4px" }, children: ["Children here", s3, e(hc, { parentFloat: i3, children: "Close other children" })] });
|
|
1816
1816
|
}, [r2]), h2 = { disabled: i2, createPopupPanel: s2, ...a2 };
|
|
1817
1817
|
return e(l2 === ki.Toolbar ? pc : mc, { ...h2 });
|
|
1818
1818
|
})), Ji = { placement: "right-start" }, ec = r(l((e5, r2) => {
|
|
@@ -2036,14 +2036,14 @@ const yc = { x: 0, y: 0 }, xc = r(l((t2, n2) => {
|
|
|
2036
2036
|
const n3 = e5, o3 = n3.clientX ?? n3.touches?.[0]?.clientX, r3 = n3.clientY ?? n3.touches?.[0]?.clientY;
|
|
2037
2037
|
x2({ x: o3 - H2.x, y: r3 - H2.y });
|
|
2038
2038
|
}, children: e(r2, { ref: j([v2, n2]), ...f2 }) });
|
|
2039
|
-
})), bc = { x: "50", y: "50" }, zc = r((n2) => {
|
|
2040
|
-
const
|
|
2039
|
+
})), bc = { x: "50", y: "50" }, zc = r(l((n2, o2) => {
|
|
2040
|
+
const r2 = G({ props: n2, name: "MuiDialog" }), l2 = X(), i2 = { enter: 0.66 * l2.transitions.duration.enteringScreen, exit: 0.66 * l2.transitions.duration.leavingScreen }, { title: s2 = "SheetXL", key: h2 = "draggable-window", onCancel: d2, onDone: p2, onShow: m2, onShown: g2, onHide: y2, open: x2, autoFocusSel: H2, children: M2, TransitionComponent: V2 = Z, TransitionProps: C2, transitionDuration: w2 = i2, BackdropComponent: L2 = T, BackdropProps: S2, PaperComponent: E2 = _, PaperProps: N2, onBackdropClick: O2, sx: A2, className: D2, onMouseDown: P2, initialPosition: R2 = bc, isModal: $2 = false, ...B2 } = r2, F2 = c(null), [W2, U2] = u(null), [Y2, K2] = u(false), [Q2, J2] = u(false), ee2 = c(null), [te2, ne2] = I(), re2 = c(null), [le2, ie2] = I(), ce2 = c(null);
|
|
2041
2041
|
a(() => {
|
|
2042
2042
|
W2 && K2(x2);
|
|
2043
2043
|
}, [x2, W2]);
|
|
2044
2044
|
const se2 = Vn(() => {
|
|
2045
|
-
|
|
2046
|
-
}, [
|
|
2045
|
+
d2?.(), K2(false);
|
|
2046
|
+
}, [d2]);
|
|
2047
2047
|
a(() => {
|
|
2048
2048
|
if (0 === ne2.width && 0 === ne2.height || W2) return;
|
|
2049
2049
|
const e5 = ce2.current?.getBoundingClientRect(), t2 = ne2.height - e5.height, n3 = ne2.width - e5.width;
|
|
@@ -2057,26 +2057,26 @@ const yc = { x: 0, y: 0 }, xc = r(l((t2, n2) => {
|
|
|
2057
2057
|
if (t2 && t2.length > 0) return t2[0]?.focus?.(e5), true;
|
|
2058
2058
|
}
|
|
2059
2059
|
return re2.current?.focus?.(e5), false;
|
|
2060
|
-
}, [pe2, H2]), ge2 = jn(
|
|
2060
|
+
}, [pe2, H2]), ge2 = jn(o2, () => ({ focus: (e5) => {
|
|
2061
2061
|
ve2(e5);
|
|
2062
2062
|
} }), []), ye2 = { ...C2, onExited: (e5) => {
|
|
2063
|
-
|
|
2063
|
+
p2?.(null), C2?.onExited?.(e5);
|
|
2064
2064
|
}, onExit: (e5) => {
|
|
2065
2065
|
const t2 = me2;
|
|
2066
2066
|
t2 && requestAnimationFrame(() => {
|
|
2067
2067
|
ge2.current?.contains(document.activeElement) && t2.focus();
|
|
2068
|
-
}),
|
|
2068
|
+
}), y2?.(), J2(false), C2?.onExit?.(e5);
|
|
2069
2069
|
}, onEntered: (e5, t2) => {
|
|
2070
|
-
|
|
2070
|
+
m2?.(), C2?.onEntered?.(e5, t2);
|
|
2071
2071
|
}, onEntering: (e5, t2) => {
|
|
2072
|
-
J2(true),
|
|
2072
|
+
J2(true), g2?.(ge2.current);
|
|
2073
2073
|
} };
|
|
2074
2074
|
a(() => {
|
|
2075
2075
|
Q2 && ve2();
|
|
2076
2076
|
}, [Q2]);
|
|
2077
2077
|
const xe2 = e(ae, { focusTrapOptions: { escapeDeactivates: false, allowOutsideClick: true, initialFocus: false }, ref: F2, active: Q2, children: e(V2, { in: Y2, timeout: w2, role: "presentation", ...ye2, children: e(b, { className: "MuiDialog-container", ref: re2, tabIndex: 0, sx: { outline: "none", position: "relative" }, onKeyDown: (e5) => {
|
|
2078
2078
|
e5.which === Mn.Escape && (se2(), ee2.current?.start(e5, { center: false }), setTimeout(() => ee2.current?.stop(e5), 180)), e5.stopPropagation();
|
|
2079
|
-
}, children: t(xc, { className: f({ "Mui-focusVisible": he2 }, D2), sx: { "& *": (e5) => Bi(e5), pointerEvents: "auto", userSelect: "none", "&:hover:not([disabled]):not(.Mui-focusVisible)": { outline: (e5) => `solid ${v(e5.palette.text?.primary, 0.2)} 1px` }, "&.Mui-focusVisible": { outline: (e5) => `solid ${v(e5.palette.text?.primary, 0.2)} 1px` }, position: "absolute", maxWidth: "100%", ...A2 }, defaultPosition: W2,
|
|
2079
|
+
}, children: t(xc, { ref: j([ce2, o2]), className: f({ "Mui-focusVisible": he2 }, D2), sx: { "& *": (e5) => Bi(e5), pointerEvents: "auto", userSelect: "none", "&:hover:not([disabled]):not(.Mui-focusVisible)": { outline: (e5) => `solid ${v(e5.palette.text?.primary, 0.2)} 1px` }, "&.Mui-focusVisible": { outline: (e5) => `solid ${v(e5.palette.text?.primary, 0.2)} 1px` }, position: "absolute", maxWidth: "100%", ...A2 }, defaultPosition: W2, titleSize: ie2, rootSize: ne2, PaperComponent: E2, ...B2, ...N2, children: [s2 ? e(k, { className: f({ "Mui-selected": he2 }, "draggable-title"), sx: { cursor: "move", display: "flex", color: (e5) => e5.palette.text.secondary, boxSizing: "border-box", padding: "0 0", transitionProperty: "opacity", transitionDuration: (e5) => `${e5.transitions.duration.shortest}ms`, opacity: 0.7, "&.Mui-selected": { opacity: 1, transitionDuration: (e5) => e5.transitions.duration.shortest / 2 + "ms" }, backgroundColor: (e5) => v(e5.palette.action.hover, 0.03) }, ref: le2, children: t(b, { sx: { display: "flex", flex: "1 1 10%", flexDirection: "row", alignItems: "center", marginTop: (e5) => e5.spacing(1), marginLeft: (e5) => e5.spacing(1), marginRight: (e5) => e5.spacing(1) }, children: [e(b, { sx: { flex: "1 1 100%", paddingLeft: (e5) => e5.spacing(1) }, children: s2 }), e(lc, { label: "Close", children: e(z, { "aria-label": "close", sx: { color: (e5) => e5.palette.text.icon ?? e5.palette.action.active }, touchRippleRef: ee2, onPointerDown: (e5) => {
|
|
2080
2080
|
ee2.current?.start(e5, { center: false }), e5.stopPropagation(), e5.preventDefault();
|
|
2081
2081
|
}, onPointerUp: se2, children: e(oe, {}) }) })] }) }) : null, M2] }) }) }) });
|
|
2082
2082
|
let be2 = null;
|
|
@@ -2096,57 +2096,57 @@ const yc = { x: 0, y: 0 }, xc = r(l((t2, n2) => {
|
|
|
2096
2096
|
}, 100), F2.current?.focusTrap?.unpause(), de2(true), re2.current?.contains(e5.target) && e5.target !== re2.current && ue2(e5.target), e5.relatedTarget && !me2 && fe2(e5.relatedTarget);
|
|
2097
2097
|
}, onBlur: (e5) => {
|
|
2098
2098
|
ge2?.current?.contains(e5.relatedTarget) || (fe2(null), F2.current?.focusTrap?.pause(), de2(false));
|
|
2099
|
-
}, children: [be2, xe2] }), ze2(),
|
|
2100
|
-
}), Hc = ["Ok", "Cancel"], Mc = (n2) => {
|
|
2101
|
-
const { description:
|
|
2099
|
+
}, children: [be2, xe2] }), ze2(), h2 + "");
|
|
2100
|
+
})), Hc = ["Ok", "Cancel"], Mc = r(l((n2, o2) => {
|
|
2101
|
+
const { description: r2, icon: l2, onCancel: i2, onOption: a2, onDone: s2, onValidateOption: h2, createOptionsButton: d2, options: u2 = Hc, autoFocusSel: m2 = ".defaultOption", defaultOption: f2 = u2[0], cancelOption: g2 = "Cancel", children: y2, ...x2 } = n2, z2 = he({ shouldUseNativeValidation: false }), { handleSubmit: H2, formState: M2 } = z2, _2 = c(null), V2 = c(null), C2 = c(null), w2 = Vn(async (e5) => {
|
|
2102
2102
|
let t2;
|
|
2103
2103
|
try {
|
|
2104
|
-
if (t2 = await Promise.resolve(
|
|
2105
|
-
await Promise.resolve(
|
|
2104
|
+
if (t2 = await Promise.resolve(h2?.(e5)) ?? true, true !== t2) return;
|
|
2105
|
+
await Promise.resolve(a2?.(e5, e5 === g2, e5 === f2)), s2?.(e5);
|
|
2106
2106
|
} catch (e6) {
|
|
2107
2107
|
}
|
|
2108
|
-
}, [
|
|
2108
|
+
}, [a2, s2, h2, g2, f2]), L2 = Vn((e5, t2) => {
|
|
2109
2109
|
setTimeout(() => {
|
|
2110
|
-
|
|
2110
|
+
w2(f2);
|
|
2111
2111
|
}, 180);
|
|
2112
|
-
}, [
|
|
2113
|
-
|
|
2114
|
-
}, [
|
|
2115
|
-
const o3 = t2 ===
|
|
2116
|
-
o3 ?
|
|
2112
|
+
}, [w2]), S2 = Vn(() => {
|
|
2113
|
+
a2?.(g2, true, false), i2?.(), s2?.(null);
|
|
2114
|
+
}, [a2, g2, i2, s2]), E2 = M2 && (Object.keys(M2.errors).length > 0 || M2.disabled || M2.isSubmitted), Z2 = Vn((t2, n3) => {
|
|
2115
|
+
const o3 = t2 === g2, r3 = { className: n3 ? "defaultOption" : "action", type: n3 ? "submit" : "button", style: { minWidth: "75px" }, onClick: () => {
|
|
2116
|
+
o3 ? S2() : n3 || w2(t2);
|
|
2117
2117
|
} };
|
|
2118
|
-
if (
|
|
2119
|
-
const l3 = { className: n3 ? "defaultOption" : "action", variant: n3 ? "contained" : "outlined", size: "small", disabled: !o3 &&
|
|
2118
|
+
if (d2) return d2(t2, r3, n3);
|
|
2119
|
+
const l3 = { className: n3 ? "defaultOption" : "action", variant: n3 ? "contained" : "outlined", size: "small", disabled: !o3 && E2, color: "primary", ...r3 };
|
|
2120
2120
|
if (n3 || o3) {
|
|
2121
|
-
const e5 = n3 ?
|
|
2121
|
+
const e5 = n3 ? _2 : V2;
|
|
2122
2122
|
l3.touchRippleRef = e5, l3.onPointerDown = (t3) => {
|
|
2123
2123
|
e5.current?.start(t3, { center: false }), t3.stopPropagation(), t3.preventDefault();
|
|
2124
2124
|
};
|
|
2125
2125
|
}
|
|
2126
2126
|
return e(A, { ...l3, children: e("div", { style: { paddingTop: "3px" }, children: t2 }) }, `action:${t2}`);
|
|
2127
|
-
}, [
|
|
2127
|
+
}, [u2, f2, g2, d2, M2]), T2 = p(() => {
|
|
2128
2128
|
const e5 = [];
|
|
2129
|
-
for (let t2 = 0; t2 <
|
|
2130
|
-
const n3 =
|
|
2131
|
-
e5.push(
|
|
2129
|
+
for (let t2 = 0; t2 < u2.length; t2++) {
|
|
2130
|
+
const n3 = u2[t2], o3 = f2 ? n3 === f2 : 0 === t2;
|
|
2131
|
+
e5.push(Z2(n3, o3));
|
|
2132
2132
|
}
|
|
2133
2133
|
return e5;
|
|
2134
|
-
}, [
|
|
2135
|
-
return e(zc, { onCancel:
|
|
2134
|
+
}, [u2, f2, M2]);
|
|
2135
|
+
return e(zc, { onCancel: S2, initialPosition: { y: "touch" === B ? "15" : "35" }, onDone: s2, autoFocusSel: m2, isModal: true, ref: o2, PaperProps: {}, ...x2, children: e(de, { ...z2, children: t("form", { ref: C2, onSubmit: H2(L2), children: [e(N, { dividers: true, onKeyDown: (e5) => {
|
|
2136
2136
|
if (e5.isDefaultPrevented()) return;
|
|
2137
2137
|
e5.stopPropagation();
|
|
2138
2138
|
let t2 = null, n3 = null;
|
|
2139
|
-
const o3 = e5.which === Mn.Escape &&
|
|
2140
|
-
if (o3) t2 =
|
|
2139
|
+
const o3 = e5.which === Mn.Escape && g2;
|
|
2140
|
+
if (o3) t2 = g2, n3 = V2;
|
|
2141
2141
|
else {
|
|
2142
|
-
if (
|
|
2143
|
-
e5.which === Mn.Enter && (t2 =
|
|
2142
|
+
if (E2) return;
|
|
2143
|
+
e5.which === Mn.Enter && (t2 = f2 ?? u2[0], n3 = _2);
|
|
2144
2144
|
}
|
|
2145
2145
|
t2 && (n3.current?.start(e5, { center: false }), setTimeout(() => {
|
|
2146
|
-
n3.current?.stop(e5), o3 &&
|
|
2146
|
+
n3.current?.stop(e5), o3 && w2(t2);
|
|
2147
2147
|
}, 180));
|
|
2148
|
-
}, children: t(b, { sx: { display: "flex", flexDirection: "column", whiteSpace: "pre-wrap", rowGap: (e5) => e5.spacing(
|
|
2149
|
-
}, _c = Object.freeze(Object.defineProperty({ __proto__: null, OptionsDialog: Mc, default: Mc }, Symbol.toStringTag, { value: "Module" })), Vc = o.lazy(() => Promise.resolve().then(() => _c)), Cc = () => {
|
|
2148
|
+
}, children: t(b, { sx: { display: "flex", flexDirection: "column", whiteSpace: "pre-wrap", rowGap: (e5) => e5.spacing(l2 || r2 ? 1.5 : 0) }, children: [t(b, { sx: { display: "flex", flexDirection: "column" }, children: [l2, r2] }), y2] }) }), e(O, { sx: { paddingTop: (e5) => e5.spacing(1), paddingBottom: (e5) => e5.spacing(1), paddingLeft: (e5) => e5.spacing(1), paddingRight: (e5) => e5.spacing(1), backgroundColor: (e5) => v(e5.palette.action.hover, 0.03) }, children: T2 })] }) }) });
|
|
2149
|
+
})), _c = Object.freeze(Object.defineProperty({ __proto__: null, OptionsDialog: Mc, default: Mc }, Symbol.toStringTag, { value: "Module" })), Vc = o.lazy(() => Promise.resolve().then(() => _c)), Cc = () => {
|
|
2150
2150
|
const { showModal: e5 } = ce();
|
|
2151
2151
|
return (t2) => new Promise((n2) => {
|
|
2152
2152
|
const o2 = e5(Vc, { ...t2, onOption(e6) {
|
|
@@ -2155,7 +2155,7 @@ const yc = { x: 0, y: 0 }, xc = r(l((t2, n2) => {
|
|
|
2155
2155
|
t2?.onDone?.(), o2.hide();
|
|
2156
2156
|
} });
|
|
2157
2157
|
});
|
|
2158
|
-
}, wc = o.lazy(() => import("./
|
|
2158
|
+
}, wc = o.lazy(() => import("./D8V9MFaKT3NbfJng.mjs")), Lc = () => {
|
|
2159
2159
|
const { showModal: e5 } = ce();
|
|
2160
2160
|
return (t2) => {
|
|
2161
2161
|
const { defaultOption: n2 = t2.options?.[0], cancelOption: o2 = "Cancel", ...r2 } = t2;
|
|
@@ -2173,7 +2173,7 @@ const yc = { x: 0, y: 0 }, xc = r(l((t2, n2) => {
|
|
|
2173
2173
|
const { command: o2, disabled: r2 = false, shortcut: l2, children: i2, ...c2 } = t2;
|
|
2174
2174
|
return yo(o2), e(lc, { ref: n2, label: void 0 !== r2 ? o2?.label() : "", shortcut: void 0 !== l2 ? l2 : Array.isArray(o2?.shortcut()) ? o2?.shortcut()[0] : o2?.shortcut(), description: o2?.description(), disabled: r2, chips: o2?.tags(), componentDisabled: o2?.disabled(), ...c2, children: e("div", { style: { display: "flex", flex: "1 1 0%" }, children: i2 }) });
|
|
2175
2175
|
})), Ec = r(l((t2, n2) => {
|
|
2176
|
-
const { command: o2, commandHook: r2, scope: l2, context: a2, icon: s2,
|
|
2176
|
+
const { command: o2, commandHook: r2, scope: l2, context: a2, icon: s2, label: h2, disabled: d2 = false, variant: u2 = zo.Toolbar, shortcut: m2, commandState: f2, tooltipProps: v2, ...g2 } = t2, y2 = c(null), x2 = c(false), b2 = p(() => {
|
|
2177
2177
|
const e5 = { onExecute(e6, t3) {
|
|
2178
2178
|
r2?.onExecute?.(e6, t3), x2.current || (y2.current?.start({ center: false }), setTimeout(() => y2.current?.stop({}), 180)), x2.current = false;
|
|
2179
2179
|
}, onError(e6, t3, n3) {
|
|
@@ -2296,9 +2296,7 @@ const Oc = (t2) => {
|
|
|
2296
2296
|
const { key: n2, ...o2 } = t2;
|
|
2297
2297
|
return e(Ec, { ...o2 }, n2);
|
|
2298
2298
|
}, Ac = r(l((t2, n2) => {
|
|
2299
|
-
const { popupCommandKeys: o2, renderCommandButton: r2, scope: l2, commands: c2, icon: a2, quickCommand: s2, popupScope: h2 = s2, commandState: d2, commandHook: p2, disabled: u2 = false, ...m2 } = t2
|
|
2300
|
-
bo(c2, [s2, ...o2]);
|
|
2301
|
-
const f2 = i((t3, n3) => {
|
|
2299
|
+
const { popupCommandKeys: o2, renderCommandButton: r2 = Oc, scope: l2, commands: c2, icon: a2, quickCommand: s2, popupScope: h2 = s2, commandState: d2, commandHook: p2, disabled: u2 = false, ...m2 } = t2, f2 = bo(c2, o2 ? [s2, ...o2] : [s2]), v2 = i((t3, n3) => {
|
|
2302
2300
|
const l3 = { variant: zo.Menuitem, commandHook: p2, commandState: d2, icon: a2, scope: h2, disabled: u2 }, i2 = [];
|
|
2303
2301
|
for (let t4 = 0; t4 < o2?.length; t4++) {
|
|
2304
2302
|
const c3 = o2[t4];
|
|
@@ -2306,12 +2304,12 @@ const Oc = (t2) => {
|
|
|
2306
2304
|
i2.push(e(di, { orientation: "horizontal" }, `element-${i2.length}`));
|
|
2307
2305
|
continue;
|
|
2308
2306
|
}
|
|
2309
|
-
const a3 = n3.getCommand(c3), s3 = { key: `${c3}-${i2.length}`, command: a3, ...l3 }, h3 = r2
|
|
2307
|
+
const a3 = n3.getCommand(c3), s3 = { key: `${c3}-${i2.length}`, command: a3, ...l3 }, h3 = r2(s3);
|
|
2310
2308
|
h3 && i2.push(h3);
|
|
2311
2309
|
}
|
|
2312
2310
|
return Ni({ ...t3, children: i2 });
|
|
2313
2311
|
}, [u2, p2, d2, h2, o2, a2, r2]);
|
|
2314
|
-
return e(Tc, { ref: n2, commands: c2, disabled: u2, commandHook: p2, commandState: d2, scope: l2, quickCommand: s2, icon: a2, createPopupPanel: f2, ...m2 });
|
|
2312
|
+
return o2 ? e(Tc, { ref: n2, commands: c2, disabled: u2, commandHook: p2, commandState: d2, scope: l2, quickCommand: s2, icon: a2, createPopupPanel: v2, ...m2 }) : r2({ ref: n2, disabled: u2, commandHook: p2, commandState: d2, scope: l2, command: f2[0], icon: a2, ...m2 });
|
|
2315
2313
|
}));
|
|
2316
2314
|
export {
|
|
2317
2315
|
vi as AnimatedBouncingEllipsisIcon,
|
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.4.
|
|
4
|
+
"version": "0.4.8",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@popperjs/core": "^2.11.8",
|
|
32
|
-
"@sheetxl/utils": "^0.4.
|
|
33
|
-
"@sheetxl/utils-react": "^0.4.
|
|
32
|
+
"@sheetxl/utils": "^0.4.8",
|
|
33
|
+
"@sheetxl/utils-react": "^0.4.8",
|
|
34
34
|
"clsx": "^2.1.1",
|
|
35
35
|
"detect-it": "^4.0.1",
|
|
36
36
|
"focus-trap-react": "^10.1.4",
|
package/types/index.d.ts
CHANGED
|
@@ -152,7 +152,7 @@ export declare const CommaIcon: (props: SvgIconProps) => JSX.Element;
|
|
|
152
152
|
|
|
153
153
|
export declare const CommandButton: default_2.FC<CommandButtonProps & CommandButtonRefAttribute>;
|
|
154
154
|
|
|
155
|
-
export declare interface CommandButtonOptions<STATE = any, CONTEXT = any> extends Omit<default_2.HTMLAttributes<HTMLElement>, "color"> {
|
|
155
|
+
export declare interface CommandButtonOptions<STATE = any, CONTEXT = any> extends Omit<default_2.HTMLAttributes<HTMLElement>, "color" | "label"> {
|
|
156
156
|
/**
|
|
157
157
|
* Allow for listeners against a specific buttons execute rather then the command.
|
|
158
158
|
* Useful when knowing the specific button that executed a command is required.
|
|
@@ -164,14 +164,15 @@ export declare interface CommandButtonOptions<STATE = any, CONTEXT = any> extend
|
|
|
164
164
|
*/
|
|
165
165
|
scope?: string;
|
|
166
166
|
icon?: default_2.ReactNode | ((command: ICommand) => default_2.ReactNode);
|
|
167
|
+
label?: default_2.ReactNode | ((command: ICommand) => default_2.ReactNode);
|
|
167
168
|
/**
|
|
168
169
|
* The shortcut to display.
|
|
170
|
+
*
|
|
169
171
|
* @remarks
|
|
170
172
|
* This is display only and doesn't actually track the shortcut.
|
|
171
173
|
* Override the display for the shortcut on the command (if available).
|
|
172
174
|
*/
|
|
173
175
|
shortcut?: IKeyStroke | IKeyStroke[];
|
|
174
|
-
labelOverride?: string | default_2.ReactNode;
|
|
175
176
|
selected?: boolean;
|
|
176
177
|
disabled?: boolean;
|
|
177
178
|
disableHover?: boolean;
|
|
@@ -904,7 +905,7 @@ export declare const InsertRowIcon: (props: SvgIconProps) => JSX.Element;
|
|
|
904
905
|
|
|
905
906
|
export declare const InsertTableIcon: (props: SvgIconProps) => JSX.Element;
|
|
906
907
|
|
|
907
|
-
export declare const InternalWindow: default_2.
|
|
908
|
+
export declare const InternalWindow: default_2.NamedExoticComponent<Omit<InternalWindowProps, "ref"> & default_2.RefAttributes<IInternalWindowElement>>;
|
|
908
909
|
|
|
909
910
|
export declare interface InternalWindowAttributes {
|
|
910
911
|
focus: (options?: FocusOptions) => void;
|
|
@@ -928,12 +929,6 @@ export declare interface InternalWindowProps extends Omit<DialogProps, 'open'> {
|
|
|
928
929
|
onShow?: () => void;
|
|
929
930
|
onShown?: (internalWindow: IInternalWindowElement) => void;
|
|
930
931
|
onHide?: () => void;
|
|
931
|
-
/**
|
|
932
|
-
* We couldn't use the forwardRef? Revisit this.
|
|
933
|
-
* It seemed to be due to the createPortal returns a ReactPortal not an HTMLElement
|
|
934
|
-
*
|
|
935
|
-
*/
|
|
936
|
-
refWindow?: default_2.Ref<IInternalWindowElement>;
|
|
937
932
|
/**
|
|
938
933
|
* If true show a backdrop.
|
|
939
934
|
* @remarks
|
|
@@ -991,9 +986,7 @@ export declare const MergeVerticalIcon: (props: SvgIconProps) => JSX.Element;
|
|
|
991
986
|
|
|
992
987
|
export { ModalProvider }
|
|
993
988
|
|
|
994
|
-
export declare const NestingPopupButton: default_2.
|
|
995
|
-
ref?: any;
|
|
996
|
-
}>;
|
|
989
|
+
export declare const NestingPopupButton: default_2.NamedExoticComponent<Omit<NestingPopupButtonProps, "ref"> & default_2.RefAttributes<HTMLElement>>;
|
|
997
990
|
|
|
998
991
|
export declare interface NestingPopupButtonProps extends ExhibitPopupButtonProps {
|
|
999
992
|
nestedChildren?: NestingPopupButtonProps[];
|
|
@@ -1006,9 +999,7 @@ export declare interface NestingPopupButtonProps extends ExhibitPopupButtonProps
|
|
|
1006
999
|
|
|
1007
1000
|
export declare const NewPresetStylesIcon: (props: SvgIconProps) => JSX.Element;
|
|
1008
1001
|
|
|
1009
|
-
export declare const OptionsDialog: default_2.
|
|
1010
|
-
ref?: any;
|
|
1011
|
-
}>;
|
|
1002
|
+
export declare const OptionsDialog: default_2.NamedExoticComponent<Omit<OptionsDialogProps, "ref"> & default_2.RefAttributes<HTMLElement>>;
|
|
1012
1003
|
|
|
1013
1004
|
export declare interface OptionsDialogProps extends OptionsNotificationOptions, InternalWindowProps {
|
|
1014
1005
|
}
|
|
@@ -1176,9 +1167,7 @@ export declare const ShowRowIcon: (props: SvgIconProps) => JSX.Element;
|
|
|
1176
1167
|
/**
|
|
1177
1168
|
* Simple Popup that takes a list of commands for a popup
|
|
1178
1169
|
*/
|
|
1179
|
-
export declare const SimpleCommandPopupButton: default_2.
|
|
1180
|
-
ref?: any;
|
|
1181
|
-
}>;
|
|
1170
|
+
export declare const SimpleCommandPopupButton: default_2.NamedExoticComponent<Omit<SimpleCommandPopupButtonProps, "ref"> & default_2.RefAttributes<HTMLElement>>;
|
|
1182
1171
|
|
|
1183
1172
|
export declare interface SimpleCommandPopupButtonProps extends CommandPopupButtonProps {
|
|
1184
1173
|
/**
|
|
@@ -1191,7 +1180,7 @@ export declare interface SimpleCommandPopupButtonProps extends CommandPopupButto
|
|
|
1191
1180
|
* @defaultValue The 'quickCommandKey'.
|
|
1192
1181
|
*/
|
|
1193
1182
|
popupScope?: string;
|
|
1194
|
-
renderCommandButton?: (props: CommandButtonProps) => default_2.ReactNode;
|
|
1183
|
+
renderCommandButton?: (props: CommandButtonProps & default_2.Attributes) => default_2.ReactNode;
|
|
1195
1184
|
}
|
|
1196
1185
|
|
|
1197
1186
|
/**
|