@sheetxl/utils-mui 0.7.6 → 0.7.7
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/LICENSE.md +1 -1
- package/browser/cjs/BNb-Rjv_hTbf4b08.cjs +6 -0
- package/browser/cjs/D7XpxCZ0Jme0u9m-.cjs +11 -0
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/BGR5EX2vtMVIqOsr.mjs +44 -0
- package/browser/esm/CxMcluR07iUCkdXf.mjs +2884 -0
- package/browser/esm/index.mjs +2 -2
- package/licenses/dependencies.txt +1 -1
- package/node/esm/{BAmiGxXEmtXqUpVj.mjs → BcnYyLUP64Snrc0X.mjs} +8 -8
- package/node/esm/index.mjs +67 -60
- package/package.json +8 -8
- package/types/index.d.ts +26 -15
- package/browser/cjs/BYGsvpSTIDkazPUe.cjs +0 -11
- package/browser/cjs/BcDVTPwhjtaDt5bp.cjs +0 -6
- package/browser/esm/BKsvb2y93wXmAwiC.mjs +0 -2865
- package/browser/esm/BTZ_PiSM7GBlYmi5.mjs +0 -44
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 { B as t, y as s, x as e, z as n, C as i, D as l, A as r, m as p, I as u, _ as c, a4 as d, a6 as m, a9 as h, a7 as E, J as I, G as C, w as b, a3 as g, E as B, b as S, a as x, f as P, Y as T, d as A, e as w, g as M, a5 as v, Q as D, a8 as F, L as k, M as f, N as O, O as R, Z as y, $ as L, S as W, aa as z, K as G, H, n as N, T as j, a1 as q, j as J, q as K, p as Q, v as U, r as V, l as X, a0 as Y, i as Z, V as _, h as $, o as aa, s as oa, W as ta, k as sa, t as ea, a2 as na, U as ia, P as la, X as ra, R as pa, u as ua, F as ca } from "./
|
|
2
|
+
import { B as t, y as s, x as e, z as n, C as i, D as l, A as r, m as p, I as u, _ as c, a4 as d, a6 as m, a9 as h, a7 as E, J as I, G as C, w as b, a3 as g, E as B, b as S, a as x, f as P, Y as T, d as A, e as w, g as M, a5 as v, Q as D, a8 as F, L as k, M as f, N as O, O as R, Z as y, $ as L, S as W, aa as z, K as G, H, n as N, T as j, a1 as q, j as J, q as K, p as Q, v as U, r as V, l as X, a0 as Y, i as Z, V as _, h as $, o as aa, s as oa, W as ta, k as sa, t as ea, a2 as na, U as ia, P as la, X as ra, R as pa, u as ua, F as ca } from "./CxMcluR07iUCkdXf.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.7
|
|
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.7
|
|
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.
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
import { jsx as t } from "react/jsx-runtime";
|
|
8
8
|
import { memo as o, forwardRef as n, useState as a } from "react";
|
|
9
9
|
import e from "clsx";
|
|
10
|
-
import { alpha as i, getOverlayAlpha as
|
|
11
|
-
import { Box as
|
|
10
|
+
import { alpha as i, getOverlayAlpha as r } from "@mui/material/styles";
|
|
11
|
+
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, onInputOption: x, onValidateInputOption: y, onDone: O, inputProps: w, inputLabel: T, inputType: F, inputPlaceHolder:
|
|
15
|
+
const { initialValue: g2 = "", onOption: f, onValidateOption: h, onInputOption: x, onValidateInputOption: 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 ?? "");
|
|
@@ -20,7 +20,7 @@ const d = ["Input"], g = o(n((o2, n2) => {
|
|
|
20
20
|
return N(a2), a2;
|
|
21
21
|
}, [y]), $ = c(async (t2) => {
|
|
22
22
|
x?.(j, t2);
|
|
23
|
-
}, [j, x, O, f,
|
|
23
|
+
}, [j, x, O, f, b, k]), z = c(async (t2) => {
|
|
24
24
|
t2.keyCode === u.Enter && await S?.(j, null);
|
|
25
25
|
}, [j, $]), E = c((t2) => {
|
|
26
26
|
B(t2.target.value), S?.(t2.target.value, null);
|
|
@@ -32,11 +32,11 @@ const d = ["Input"], g = o(n((o2, n2) => {
|
|
|
32
32
|
}
|
|
33
33
|
return o3 ?? true;
|
|
34
34
|
}, [j, h]);
|
|
35
|
-
return t(m, { options:
|
|
35
|
+
return t(m, { options: C, onDone: O, onOption: (t2, o3) => {
|
|
36
36
|
o3 || $(t2);
|
|
37
|
-
}, onValidateOption: K, cancelOption:
|
|
37
|
+
}, onValidateOption: K, cancelOption: b, defaultOption: k, autoFocusSel: I, ref: n2, ...P, children: t(p, { sx: { paddingTop: (t2) => t2.spacing(1), paddingBottom: (t2) => t2.spacing(0) }, children: t(l, { sx: { paddingTop: (t2) => t2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(s, { onFocus: (t2) => {
|
|
38
38
|
V || t2.target?.select(), D(true);
|
|
39
|
-
}, type: F, label: T, helperText: H || " ", sx: { width: "100%", "& .MuiFormHelperText-root": { marginTop: (t2) => t2.spacing(0.5), color: M ? void 0 : "error.main" } },
|
|
39
|
+
}, type: F, label: T, helperText: H || " ", sx: { width: "100%", "& .MuiFormHelperText-root": { marginTop: (t2) => t2.spacing(0.5), color: M ? void 0 : "error.main" } }, slotProps: { inputLabel: { shrink: true }, htmlInput: { placeholder: v, spellCheck: false, autoComplete: "off", ...w, className: e("autoFocus", w?.className), sx: { paddingTop: (t2) => t2.spacing(1.25), paddingBottom: (t2) => t2.spacing(0.75), backgroundImage: `linear-gradient(${i("#fff", r(5))}, ${i("#fff", r(5))})` } } }, value: j, onChange: E, onKeyDown: z, onContextMenu: (t2) => {
|
|
40
40
|
t2.stopPropagation();
|
|
41
41
|
} }) }) }) });
|
|
42
42
|
}));
|
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.7
|
|
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.
|
|
@@ -33,7 +33,7 @@ const me = (e2) => {
|
|
|
33
33
|
return e(xt, { title: t2.disabled ? n2 : r2, enterDelay: 800, enterNextDelay: 1600, children: t2.disabled ? e("div", { style: { display: "flex" }, children: l2 }) : l2 });
|
|
34
34
|
}, fe = (t2) => he(t2, A.Horizontal ? e(H, { iconKey: "ArrowLeft", size: "small" }) : e(H, { iconKey: "ArrowUpward", size: "small" }), "Scroll " + (t2.orientation === A.Horizontal ? "Left" : "Up"), `Scroll ${t2.orientation === A.Horizontal ? "left" : "up"}, 'Ctrl+Click' to scroll to the beginning`), xe = (t2) => he(t2, A.Horizontal ? e(H, { iconKey: "ArrowRight", size: "small" }) : e(H, { iconKey: "ArrowDownward", size: "small" }), "Scroll " + (t2.orientation === A.Horizontal ? "Right" : "Down"), `Scroll ${t2.orientation === A.Horizontal ? "right" : "down"}, 'Ctrl+Click' to scroll to the end`), ge = r(i((t2, o2) => {
|
|
35
35
|
const { orientation: n2 = "vertical", sx: r2, ...i2 } = t2, a2 = "vertical" === n2;
|
|
36
|
-
return e(y, { ref: o2, sx: { marginLeft: a2 ? "
|
|
36
|
+
return e(y, { ref: o2, sx: { marginLeft: a2 ? "2px" : void 0, marginRight: a2 ? "2px" : void 0, backgroundColor: "transparent !important", minHeight: a2 ? "1em" : void 0, minWidth: a2 ? void 0 : "1em", borderColor: (e2) => e2.palette.divider, ...r2 }, orientation: n2, variant: "middle", flexItem: true, ...i2 });
|
|
37
37
|
})), be = "_traverse-ellipsis_14l1h_1", ye = r((o2) => {
|
|
38
38
|
const { sx: n2, speed: r2 = 2, size: i2 = 70, ...a2 } = o2;
|
|
39
39
|
return e(v, { sx: { width: `${i2}px`, height: `${i2}px`, zIndex: 1, "& .primary": { stroke: (e2) => e2.palette.grey[600], fill: "none" }, ...n2 }, ...a2, children: t("svg", { x: "0px", y: "0px", viewBox: "0 0 100 100", children: [e("circle", { className: "primary", strokeWidth: "4", cx: "50", cy: "50", r: "48" }), e("line", { className: "primary", strokeLinecap: "round", strokeWidth: "4", x1: "50", y1: "50", x2: "85", y2: "50.5", children: e("animateTransform", { attributeName: "transform", dur: `${r2}s`, type: "rotate", from: "0 50 50", to: "360 50 50", repeatCount: "indefinite" }) }), e("line", { className: "primary", strokeLinecap: "round", strokeWidth: "4", x1: "50", y1: "50", x2: "49.5", y2: "74", children: e("animateTransform", { attributeName: "transform", dur: 7.5 * r2 + "s", type: "rotate", from: "0 50 50", to: "360 50 50", repeatCount: "indefinite" }) })] }) });
|
|
@@ -141,11 +141,11 @@ const ze = r(i((t2, o2) => {
|
|
|
141
141
|
if (!r2) return null;
|
|
142
142
|
let t3 = null;
|
|
143
143
|
t3 = Array.isArray(r2) ? r2 : [r2];
|
|
144
|
-
const o3 = [];
|
|
145
|
-
for (let r3 = 0; r3 <
|
|
146
|
-
const
|
|
144
|
+
const o3 = [], i3 = t3.length;
|
|
145
|
+
for (let r3 = 0; r3 < i3; r3++) {
|
|
146
|
+
const i4 = t3[r3];
|
|
147
147
|
let a3 = null;
|
|
148
|
-
"string" == typeof
|
|
148
|
+
"string" == typeof i4 ? a3 = e(C, { label: i4, color: "primary", size: "small", sx: { scale: "0.8" } }, "chip-" + r3) : n.cloneElement(i4, { key: "chip-" + r3 }), o3.push(a3);
|
|
149
149
|
}
|
|
150
150
|
return o3;
|
|
151
151
|
}, [r2]);
|
|
@@ -164,25 +164,25 @@ const ze = r(i((t2, o2) => {
|
|
|
164
164
|
const e2 = [{ name: "offset", options: { offset: u2 } }, { name: "flip", enabled: true, options: { rootBoundary: "document" } }];
|
|
165
165
|
return v2 && e2.unshift(Ie, C2), e2;
|
|
166
166
|
}, [v2, u2]), [R2, D2] = c(false), E2 = n.useRef(null), T2 = W(() => {
|
|
167
|
-
f2?.(
|
|
167
|
+
f2?.(F2.current, E2.current);
|
|
168
168
|
}, [x2]), $2 = W(x2, [x2]), O2 = W(g2, [g2]), z2 = W(b2, [b2]), I2 = W(() => {
|
|
169
169
|
D2(false), y2?.();
|
|
170
|
-
}, [y2]), [N2, B2] = c(false),
|
|
171
|
-
|
|
170
|
+
}, [y2]), [N2, B2] = c(false), F2 = n.useRef(null), A2 = n.useRef(true), H2 = a(() => ({ onFirstUpdate: () => {
|
|
171
|
+
A2.current && (B2(true), T2?.(), A2.current = false);
|
|
172
172
|
} }), [i2, R2]);
|
|
173
173
|
s(() => {
|
|
174
174
|
i2 && N2 ? $2?.() : !i2 && R2 && z2?.(), i2 && D2(i2);
|
|
175
175
|
}, [i2, N2]);
|
|
176
|
-
const
|
|
177
|
-
d(o2, () => ({ instance: () => E2.current, element: () =>
|
|
178
|
-
const { getPortalContainer:
|
|
179
|
-
return e(M, { ref:
|
|
176
|
+
const V2 = a(() => ({ getBoundingClientRect: () => h2 ? new DOMRect(h2?.left || 0, h2?.top || 0, 0, 0) : m2.getBoundingClientRect() }), [h2, m2]);
|
|
177
|
+
d(o2, () => ({ instance: () => E2.current, element: () => F2.current }), []);
|
|
178
|
+
const { getPortalContainer: q2 } = K(), _2 = a(() => ({ zIndex: i2 ? "1300" : "1299", display: "flex", pointerEvents: R2 && i2 ? void 0 : "none", maxWidth: "100%", maxHeight: "100%", ...r2 }), [r2, i2, R2]);
|
|
179
|
+
return e(M, { ref: F2, popperRef: E2, container: q2, anchorEl: V2, open: R2, role: void 0, popperOptions: H2, transition: true, sx: _2, placement: "bottom-start", modifiers: P2, ...k2, children: ({ TransitionProps: t3, placement: o3, ...n2 }) => {
|
|
180
180
|
const { in: r3, onEnter: a2, onExited: s2, ...c2 } = t3 ?? {};
|
|
181
181
|
return e(S, { ...c2, in: i2, onEnter: () => {
|
|
182
182
|
a2?.(), O2();
|
|
183
183
|
}, onExited: () => {
|
|
184
184
|
s2?.(), I2();
|
|
185
|
-
}, 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, ...n2 }) : l2 ||
|
|
185
|
+
}, 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, ...n2 }) : l2 || L.EmptyArray });
|
|
186
186
|
} });
|
|
187
187
|
}));
|
|
188
188
|
Be.displayName = "ExhibitPopper";
|
|
@@ -639,65 +639,70 @@ const Bt = { x: 0, y: 0 }, Lt = r(i((t2, o2) => {
|
|
|
639
639
|
y2({ x: n3 - C2.x, y: r3 - C2.y });
|
|
640
640
|
}, children: e(r2, { ref: oe([x2, o2]), ...f2 }) });
|
|
641
641
|
})), Ft = { x: "50", y: "50" }, At = r(i((o2, n2) => {
|
|
642
|
-
const r2 = Z({ props: o2, name: "MuiDialog" }), i2 = X(), 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: g2, onHide: y2,
|
|
642
|
+
const r2 = Z({ props: o2, name: "MuiDialog" }), i2 = X(), 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: g2, onHide: y2, onClose: k2, open: C2, autoFocusSel: M2, children: S2, transitionDuration: P2 = a2, TransitionProps: R2, slots: D2 = L.EmptyArray, slotProps: O2 = L.EmptyArray, sx: z2, className: I2, onMouseDown: N2, initialPosition: B2 = Ft, isModal: F2 = false, ...A2 } = r2;
|
|
643
|
+
let q2 = D2.transition ?? E;
|
|
644
|
+
const _2 = D2.backdrop ?? T, U2 = D2.paper ?? w;
|
|
645
|
+
let Q2 = O2.transition;
|
|
646
|
+
R2 && (Q2 = { ...R2, ...Q2 });
|
|
647
|
+
const G2 = O2.backdrop, Y2 = O2.paper, J2 = l(null), [ee2, te2] = c(null), [ne2, ie2] = c(false), [ae2, ce2] = c(false), de2 = l(null), [pe2, ue2] = re(), me2 = l(null), [he2, fe2] = re(), xe2 = l(null);
|
|
643
648
|
s(() => {
|
|
644
|
-
|
|
645
|
-
}, [
|
|
646
|
-
const
|
|
647
|
-
u2?.(),
|
|
649
|
+
ee2 && ie2(C2);
|
|
650
|
+
}, [C2, ee2]);
|
|
651
|
+
const ge2 = W(() => {
|
|
652
|
+
u2?.(), ie2(false);
|
|
648
653
|
}, [u2]);
|
|
649
654
|
s(() => {
|
|
650
|
-
if (0 ===
|
|
651
|
-
const e2 =
|
|
655
|
+
if (0 === ue2.width && 0 === ue2.height || ee2) return;
|
|
656
|
+
const e2 = xe2.current?.getBoundingClientRect(), t2 = ue2.height - e2.height, o3 = ue2.width - e2.width;
|
|
652
657
|
let n3 = 0.5 * o3, r3 = 0.5 * t2;
|
|
653
|
-
"number" == typeof
|
|
654
|
-
}, [
|
|
655
|
-
const [
|
|
656
|
-
if (
|
|
657
|
-
if (
|
|
658
|
-
const t2 =
|
|
658
|
+
"number" == typeof B2?.x ? n3 = B2.x : "string" == typeof B2?.x && (n3 = o3 * (parseFloat(B2.x) / 100)), "number" == typeof B2?.y ? r3 = B2.y : "string" == typeof B2?.y && (r3 = t2 * (parseFloat(B2.y) / 100)), te2({ x: n3, y: r3 });
|
|
659
|
+
}, [ue2, fe2]);
|
|
660
|
+
const [be2, ye2] = c(false), [ve2, ke2] = c(null), [we2, Ce2] = c(null), Me2 = W((e2) => {
|
|
661
|
+
if (ve2) return ve2.focus(e2), true;
|
|
662
|
+
if (M2) {
|
|
663
|
+
const t2 = me2.current?.querySelectorAll?.(M2);
|
|
659
664
|
if (t2 && t2.length > 0) return t2[0]?.focus?.(e2), true;
|
|
660
665
|
}
|
|
661
|
-
return
|
|
662
|
-
}, [
|
|
663
|
-
|
|
664
|
-
} }), []),
|
|
665
|
-
m2?.(null),
|
|
666
|
+
return me2.current?.focus?.(e2), false;
|
|
667
|
+
}, [ve2, M2]), Se2 = j(n2, () => ({ focus: (e2) => {
|
|
668
|
+
Me2(e2);
|
|
669
|
+
} }), []), Pe2 = { ...Q2, onExited: (e2) => {
|
|
670
|
+
m2?.(null), Q2?.onExited?.(e2);
|
|
666
671
|
}, onExit: (e2) => {
|
|
667
|
-
const t2 =
|
|
672
|
+
const t2 = we2;
|
|
668
673
|
t2 && requestAnimationFrame(() => {
|
|
669
|
-
|
|
670
|
-
}), y2?.(),
|
|
674
|
+
Se2.current?.contains(document.activeElement) && t2.focus();
|
|
675
|
+
}), y2?.(), ce2(false), Q2?.onExit?.(e2);
|
|
671
676
|
}, onEntered: (e2, t2) => {
|
|
672
|
-
x2?.(),
|
|
677
|
+
x2?.(), Q2?.onEntered?.(e2, t2);
|
|
673
678
|
}, onEntering: (e2, t2) => {
|
|
674
|
-
|
|
679
|
+
ce2(true), g2?.(Se2.current);
|
|
675
680
|
} };
|
|
676
681
|
s(() => {
|
|
677
|
-
|
|
678
|
-
}, [
|
|
679
|
-
let
|
|
680
|
-
e2.which === V.Escape && (
|
|
681
|
-
}, children: t(Lt, { ref: oe([
|
|
682
|
-
|
|
683
|
-
}, onPointerUp:
|
|
684
|
-
|
|
685
|
-
|
|
682
|
+
ae2 && Me2();
|
|
683
|
+
}, [ae2]);
|
|
684
|
+
let Re2 = e(se, { focusTrapOptions: { escapeDeactivates: false, allowOutsideClick: true, initialFocus: false }, ref: J2, active: ae2, children: e(q2, { in: ne2, timeout: P2, role: "presentation", ...Pe2, children: e(v, { className: "MuiDialog-container", ref: me2, tabIndex: 0, sx: { outline: "none", position: "relative" }, onKeyDown: (e2) => {
|
|
685
|
+
e2.which === V.Escape && (ge2(), de2.current?.start(e2, { center: false }), setTimeout(() => de2.current?.stop(e2), 180)), e2.stopPropagation();
|
|
686
|
+
}, children: t(Lt, { ref: oe([xe2, n2]), className: h({ "Mui-focusVisible": be2 }, I2, "draggable"), sx: { "& *": (e2) => Qe(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%", ...z2 }, defaultPosition: ee2, titleSize: fe2, rootSize: ue2, PaperComponent: U2, ...A2, ...Y2, children: [d2 ? e($, { className: h({ "Mui-selected": be2 }, "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(vt, { label: "Close", children: e(b, { "aria-label": "close", sx: { color: (e2) => e2.palette.text.icon ?? e2.palette.action.active }, touchRippleRef: de2, onPointerDown: (e2) => {
|
|
687
|
+
de2.current?.start(e2, { center: false }), e2.stopPropagation(), e2.preventDefault();
|
|
688
|
+
}, onPointerUp: ge2, children: e(H, { iconKey: "Close" }) }) })] }) }) : null, S2] }) }) }) }), De2 = null;
|
|
689
|
+
F2 && (De2 = e(_2, { ...G2, open: ne2, onMouseDown: (e2) => {
|
|
690
|
+
ge2(), G2?.onMouseDown?.(e2);
|
|
686
691
|
}, onClick: (e2) => {
|
|
687
|
-
|
|
688
|
-
}, sx: { pointerEvents: "auto", ...
|
|
689
|
-
const { getPortalContainer:
|
|
690
|
-
return le(t(v, { className: "MuiModal-root", sx: { position: "fixed", zIndex: "1300", right: "0", bottom: "0", top: "0", left: "0", outline: "0", display: "block", pointerEvents: "none" }, ref: oe([
|
|
691
|
-
|
|
692
|
+
k2?.(e2, "backdropClick"), G2?.onClick?.(e2);
|
|
693
|
+
}, sx: { pointerEvents: "auto", ...G2?.sx } }));
|
|
694
|
+
const { getPortalContainer: Ee2 } = K();
|
|
695
|
+
return le(t(v, { className: "MuiModal-root", sx: { position: "fixed", zIndex: "1300", right: "0", bottom: "0", top: "0", left: "0", outline: "0", display: "block", pointerEvents: "none" }, ref: oe([Se2, pe2]), onPointerDown: (e2) => {
|
|
696
|
+
be2 && (e2.target === me2.current || e2.target.tabIndex < 0) && me2.current?.contains(document.activeElement);
|
|
692
697
|
}, onContextMenu: (e2) => {
|
|
693
698
|
e2.isPropagationStopped() || e2.preventDefault();
|
|
694
699
|
}, onFocus: (e2) => {
|
|
695
|
-
!
|
|
696
|
-
|
|
697
|
-
}, 100),
|
|
700
|
+
!be2 && (e2.target === me2.current || e2.target.tabIndex < 0) && setTimeout(() => {
|
|
701
|
+
Me2();
|
|
702
|
+
}, 100), J2.current?.focusTrap?.unpause(), ye2(true), me2.current?.contains(e2.target) && e2.target !== me2.current && ke2(e2.target), e2.relatedTarget && !we2 && Ce2(e2.relatedTarget);
|
|
698
703
|
}, onBlur: (e2) => {
|
|
699
|
-
|
|
700
|
-
}, children: [
|
|
704
|
+
Se2?.current?.contains(e2.relatedTarget) || (Ce2(null), J2.current?.focusTrap?.pause(), ye2(false));
|
|
705
|
+
}, children: [De2, Re2] }), Ee2(), p2 + "");
|
|
701
706
|
})), Ht = ["Ok", "Cancel"], Wt = r(i((o2, n2) => {
|
|
702
707
|
const { description: r2, icon: i2, onCancel: s2, onOption: c2, onDone: d2, onValidateOption: p2, createOptionsButton: u2, options: m2 = Ht, autoFocusSel: h2 = ".defaultOption", defaultOption: x2 = m2[0], cancelOption: g2 = "Cancel", children: b2, ...y2 } = o2, w2 = pe({ shouldUseNativeValidation: false }), { handleSubmit: C2, formState: M2 } = w2, S2 = l(null), P2 = l(null), R2 = l(null), D2 = W(async (e2) => {
|
|
703
708
|
let t2;
|
|
@@ -733,7 +738,7 @@ const Bt = { x: 0, y: 0 }, Lt = r(i((t2, o2) => {
|
|
|
733
738
|
}
|
|
734
739
|
return e2;
|
|
735
740
|
}, [m2, x2, M2]);
|
|
736
|
-
return e(At, { onCancel: T2, initialPosition: { y: "touch" === de ? "15" : "35" }, onDone: d2, autoFocusSel: h2, isModal: true, ref: n2,
|
|
741
|
+
return e(At, { onCancel: T2, initialPosition: { y: "touch" === de ? "15" : "35" }, onDone: d2, autoFocusSel: h2, isModal: true, ref: n2, ...y2, children: e(ue, { ...w2, children: t("form", { ref: R2, onSubmit: C2(E2), children: [e(z, { dividers: true, onKeyDown: (e2) => {
|
|
737
742
|
if (e2.isDefaultPrevented()) return;
|
|
738
743
|
e2.stopPropagation();
|
|
739
744
|
let t2 = null, o3 = null;
|
|
@@ -756,12 +761,12 @@ const Bt = { x: 0, y: 0 }, Lt = r(i((t2, o2) => {
|
|
|
756
761
|
o2?.onDone?.(), r2.hide();
|
|
757
762
|
} });
|
|
758
763
|
});
|
|
759
|
-
}, _t = n.lazy(() => import("./
|
|
764
|
+
}, _t = n.lazy(() => import("./BcnYyLUP64Snrc0X.mjs")), jt = (e2) => {
|
|
760
765
|
const { showModal: t2 } = ae();
|
|
761
766
|
return (o2) => {
|
|
762
767
|
const { defaultOption: n2 = o2.options?.[0], cancelOption: r2 = "Cancel", ...i2 } = o2;
|
|
763
768
|
return new Promise((o3) => {
|
|
764
|
-
const a2 = t2(_t, { ...e2, defaultOption: n2, cancelOption: r2,
|
|
769
|
+
const a2 = t2(_t, { ...e2, defaultOption: n2, cancelOption: r2, onOption(e3) {
|
|
765
770
|
i2?.onOption?.(e3, e3 === r2, e3 === n2), o3({ input: "", option: e3 });
|
|
766
771
|
}, onInputOption(e3, t3) {
|
|
767
772
|
i2?.onInputOption?.(e3, t3), o3({ input: e3, option: t3 });
|
|
@@ -794,7 +799,9 @@ const Bt = { x: 0, y: 0 }, Lt = r(i((t2, o2) => {
|
|
|
794
799
|
}, [k2, c2]), P2 = a(() => ({ tabIndex: 0, ref: o2, selected: n2?.state(), icon: m2 === Q.Toolbar ? S2 : e(It, { selected: n2?.state() ?? false, children: S2 }), touchRippleRef: b2, disabled: u2 || !n2 || n2.disabled(), onMouseDown: w2, onMouseUp: C2, onKeyDown: M2 }), [k2, r2, u2, S2]);
|
|
795
800
|
let R2;
|
|
796
801
|
return R2 = m2 === Q.Menuitem ? e(Pt, { ...g2, chips: n2?.tags(), ...P2, children: d2 ?? n2?.label(i2, s2) }) : e(Ct, { ...g2, ...P2 }), d2 || n2?.label() ? ((n2.disabled() || u2) && (R2 = e("div", { children: R2 })), R2 = e(Ut, { command: n2, placement: m2 === Q.Toolbar ? "bottom-start" : "right-start", shortcut: h2, ...x2, children: R2 }), R2) : R2;
|
|
797
|
-
}))
|
|
802
|
+
}));
|
|
803
|
+
Gt.displayName = "CommandButton";
|
|
804
|
+
const Xt = e(H, {}), Yt = r(i((o2, n2) => {
|
|
798
805
|
const { command: r2, scope: i2, icon: d2 = Xt, label: p2, variant: u2 = Q.Toolbar, disabled: m2 = false, commandHook: h2, ...f2 } = o2, x2 = l(null), g2 = l(false), y2 = a(() => {
|
|
799
806
|
const e2 = { onExecute(e3, t2) {
|
|
800
807
|
h2?.onExecute?.(e3, t2), g2.current || (x2.current?.start({ center: false }), setTimeout(() => x2.current?.stop({}), 180)), g2.current = false;
|
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.7",
|
|
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.7",
|
|
49
|
+
"@sheetxl/utils-react": "^0.7.7",
|
|
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.63.0",
|
|
56
56
|
"react-merge-refs": "^3.0.2",
|
|
57
57
|
"react-use": "^17.6.0",
|
|
58
58
|
"tiny-invariant": "^1.3.3"
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"@emotion/cache": "^11.14.0",
|
|
62
62
|
"@emotion/react": "^11.14.0",
|
|
63
63
|
"@emotion/styled": "^11.14.0",
|
|
64
|
-
"@mui/material": "^
|
|
65
|
-
"@mui/styled-engine": "^
|
|
66
|
-
"@mui/system": "^
|
|
67
|
-
"@mui/utils": "^
|
|
64
|
+
"@mui/material": "^7.3.2",
|
|
65
|
+
"@mui/styled-engine": "^7.3.2",
|
|
66
|
+
"@mui/system": "^7.3.2",
|
|
67
|
+
"@mui/utils": "^7.3.2",
|
|
68
68
|
"react": "^19.1.0",
|
|
69
69
|
"react-dom": "^19.1.0"
|
|
70
70
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Backdrop } from '@mui/material';
|
|
1
2
|
import { BoxProps } from '@mui/material';
|
|
2
3
|
import { CommandButtonOptions } from '@sheetxl/utils-react';
|
|
3
4
|
import { CommandButtonProps } from '@sheetxl/utils-react';
|
|
@@ -10,6 +11,7 @@ import { ComponentsPropsList } from '@mui/material/styles';
|
|
|
10
11
|
import { ComponentsVariants } from '@mui/material/styles';
|
|
11
12
|
import { default as default_2 } from 'react';
|
|
12
13
|
import { DialogProps } from '@mui/material';
|
|
14
|
+
import { DialogSlots } from '@mui/material';
|
|
13
15
|
import { DividerProps } from '@mui/material';
|
|
14
16
|
import { DraggableEventHandler } from 'react-draggable';
|
|
15
17
|
import { DynamicIconProps } from '@sheetxl/utils-react';
|
|
@@ -252,9 +254,7 @@ export declare const elevateColor: (color: string, coefficient?: number, mode?:
|
|
|
252
254
|
* Simple panel to show error.
|
|
253
255
|
* Todo - allow for action flag
|
|
254
256
|
*/
|
|
255
|
-
export declare const ErrorPanel: default_2.
|
|
256
|
-
ref?: any;
|
|
257
|
-
}>;
|
|
257
|
+
export declare const ErrorPanel: default_2.NamedExoticComponent<Omit<ErrorPanelProps, "ref"> & default_2.RefAttributes<any>>;
|
|
258
258
|
|
|
259
259
|
export declare interface ErrorPanelProps extends BoxProps {
|
|
260
260
|
icon?: default_2.ReactNode;
|
|
@@ -302,9 +302,7 @@ export declare interface ExhibitComponentsVariants extends ComponentsVariants {
|
|
|
302
302
|
}>;
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
export declare const ExhibitDivider: default_2.
|
|
306
|
-
ref?: any;
|
|
307
|
-
}>;
|
|
305
|
+
export declare const ExhibitDivider: default_2.NamedExoticComponent<Omit<ExhibitDividerProps, "ref"> & default_2.RefAttributes<HTMLHRElement>>;
|
|
308
306
|
|
|
309
307
|
export declare interface ExhibitDividerProps extends DividerProps {
|
|
310
308
|
}
|
|
@@ -327,9 +325,6 @@ export declare interface ExhibitFloatPanelProps extends BoxProps {
|
|
|
327
325
|
anchorEl?: any;
|
|
328
326
|
anchorPosition?: ExhibitPopperPosition;
|
|
329
327
|
label: string;
|
|
330
|
-
/**
|
|
331
|
-
* Popper render function or node.
|
|
332
|
-
*/
|
|
333
328
|
createPopupPanel?: (props: ExhibitPopupPanelProps) => default_2.ReactElement<any>;
|
|
334
329
|
popperProps?: Partial<ExhibitPopperProps>;
|
|
335
330
|
onClosing?: () => void;
|
|
@@ -644,7 +639,7 @@ export declare interface InputCommandButtonProps<STATE = any, CONTEXT = any> ext
|
|
|
644
639
|
label?: default_2.ReactNode | string | (() => default_2.ReactNode | string);
|
|
645
640
|
}
|
|
646
641
|
|
|
647
|
-
export declare interface InputDialogProps extends InputOptionsNotifierOptions, OptionsDialogProps {
|
|
642
|
+
export declare interface InputDialogProps extends Omit<InputOptionsNotifierOptions, 'style'>, OptionsDialogProps {
|
|
648
643
|
}
|
|
649
644
|
|
|
650
645
|
export declare const InternalWindow: default_2.NamedExoticComponent<Omit<InternalWindowProps, "ref"> & default_2.RefAttributes<IInternalWindowElement>>;
|
|
@@ -682,8 +677,24 @@ export declare interface InternalWindowProps extends Omit<DialogProps, 'open'> {
|
|
|
682
677
|
* A default position for the window. The default is center at %50, %50.
|
|
683
678
|
*/
|
|
684
679
|
initialPosition?: RelativePoint;
|
|
685
|
-
|
|
686
|
-
|
|
680
|
+
/**
|
|
681
|
+
* The components used for each slot inside.
|
|
682
|
+
* @default {}
|
|
683
|
+
*/
|
|
684
|
+
slots?: DialogSlots & {
|
|
685
|
+
transition?: default_2.ComponentType<TransitionProps>;
|
|
686
|
+
paper?: default_2.ComponentType<PaperProps>;
|
|
687
|
+
};
|
|
688
|
+
/**
|
|
689
|
+
* The extra props for the slot components.
|
|
690
|
+
* You can override the existing props or add new ones.
|
|
691
|
+
* @default {}
|
|
692
|
+
*/
|
|
693
|
+
slotProps?: {
|
|
694
|
+
backdrop?: default_2.ComponentProps<typeof Backdrop>;
|
|
695
|
+
paper?: PaperProps;
|
|
696
|
+
transition?: TransitionProps;
|
|
697
|
+
};
|
|
687
698
|
}
|
|
688
699
|
|
|
689
700
|
export declare const LabelIcon: (props: LabelIconProps) => JSX.Element;
|
|
@@ -729,9 +740,9 @@ export declare interface NestingPopupButtonProps extends ExhibitPopupButtonProps
|
|
|
729
740
|
variant?: PopupButtonType;
|
|
730
741
|
}
|
|
731
742
|
|
|
732
|
-
export declare const OptionsDialog: default_2.NamedExoticComponent<Omit<OptionsDialogProps, "ref"> & default_2.RefAttributes<
|
|
743
|
+
export declare const OptionsDialog: default_2.NamedExoticComponent<Omit<OptionsDialogProps, "ref"> & default_2.RefAttributes<HTMLDivElement>>;
|
|
733
744
|
|
|
734
|
-
export declare interface OptionsDialogProps extends OptionsNotifierOptions, InternalWindowProps {
|
|
745
|
+
export declare interface OptionsDialogProps extends Omit<OptionsNotifierOptions, 'style'>, InternalWindowProps {
|
|
735
746
|
}
|
|
736
747
|
|
|
737
748
|
export declare interface OutlineBorder {
|
|
@@ -870,7 +881,7 @@ export declare interface SimpleCommandPopupButtonProps extends CommandPopupButto
|
|
|
870
881
|
* to wrap MUI Tooltip and set the Popper container to support
|
|
871
882
|
* fullscreen/portal scenarios. Behaves exactly like Tooltip.
|
|
872
883
|
*/
|
|
873
|
-
export declare const SimpleTooltip: default_2.ForwardRefExoticComponent<Omit<TooltipProps, "ref"> & default_2.RefAttributes<
|
|
884
|
+
export declare const SimpleTooltip: default_2.ForwardRefExoticComponent<Omit<TooltipProps, "ref"> & default_2.RefAttributes<HTMLElement>>;
|
|
874
885
|
|
|
875
886
|
export declare interface SmartInputFieldProps {
|
|
876
887
|
automatic?: any;
|