@sheetxl/studio-mui 0.7.5 → 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.
Files changed (51) hide show
  1. package/LICENSE.md +1 -1
  2. package/browser/cjs/BCf8BQb2c8ANexW4.cjs +7 -0
  3. package/browser/cjs/BJ4pZo7s81ynDlzw.cjs +6 -0
  4. package/browser/cjs/{CuHwOikK2J1MLsHN.cjs → Bf70UQlMT3b0NoOZ.cjs} +1 -1
  5. package/browser/cjs/Bpq9GrV7al7xxJ_d.cjs +6 -0
  6. package/browser/cjs/BxlQ6aLh5_jUvk9w.cjs +20 -0
  7. package/browser/cjs/{B4uj1Smd-98Hab_l.cjs → CJSNNa8ySxzuEmoy.cjs} +2 -2
  8. package/browser/cjs/{D4c72fkCJiL-S_-a.cjs → CUND2W1xMwqPOHwD.cjs} +7 -7
  9. package/browser/cjs/{CJQkIVFa7S1AZcBP.cjs → Cg95aBJ4kuUq7jrz.cjs} +1 -1
  10. package/browser/cjs/Dcoq8P2O8-40waHl.cjs +6 -0
  11. package/browser/cjs/{JURSrTjvLJ8bc4Yl.cjs → DeoOsY5TkIAydt9W.cjs} +2 -2
  12. package/browser/cjs/index.cjs +3 -3
  13. package/browser/cjs/{D6pUyWwmIliDWT8B.cjs → j0lD5RrJ86CRlUNT.cjs} +2 -2
  14. package/browser/esm/{B7CJX7fKvv1vBk8-.mjs → 7tCRjNmDM5kf3BFa.mjs} +2 -2
  15. package/browser/esm/{hWToTYtpa0PFzhRm.mjs → BWxmPJd4f8qZMxaa.mjs} +17 -18
  16. package/browser/esm/{COI8Eg7HQcdPFGcZ.mjs → BbHGWXif6ytyfyHI.mjs} +1 -1
  17. package/browser/esm/{CajWEWsYWzynjFKw.mjs → BkhHyCmy1MwVFS1b.mjs} +2 -2
  18. package/browser/esm/{BbfPde9B9b4p64_L.mjs → Bo3cXzeDcP_Q9YvX.mjs} +2 -2
  19. package/browser/esm/CRDu7VFAa8NGcoHj.mjs +49 -0
  20. package/browser/esm/{C48fXszXYqcJMQni.mjs → Cd02kMBZDsozIA98.mjs} +12 -12
  21. package/browser/esm/CzdBzjYgP1i3pkPL.mjs +4455 -0
  22. package/browser/esm/DFppS_p4spncePDm.mjs +156 -0
  23. package/browser/esm/{KULqIIHcvNriSu7F.mjs → db-2uDA7mYS4QpHj.mjs} +1 -1
  24. package/browser/esm/index.mjs +70 -72
  25. package/browser/esm/{gpytxNaiTkBoZ6aj.mjs → nzc1811Pk5-sKDu5.mjs} +7 -7
  26. package/licenses/dependencies.txt +189 -222
  27. package/node/assets/style.css +1 -1
  28. package/node/esm/BVKo3uc0IreLNkkN.mjs +157 -0
  29. package/node/esm/{CuIak_iZn0ApypmT.mjs → BfnEq4EhLf8jJ0Gp.mjs} +1 -1
  30. package/node/esm/{BHFc6-pxJ_X3esj1.mjs → BgR1PWucIb0Zucr4.mjs} +1 -1
  31. package/node/esm/{DEnAvzkXoQEvscd-.mjs → BimlBylqyslj9fNg.mjs} +1 -1
  32. package/node/esm/{DExsoaMD7hWNhceb.mjs → BnGsbrQwjcaUFAdt.mjs} +13 -13
  33. package/node/esm/{DKhoTrOwIfMtft9r.mjs → CQhaL28vV1X6Xt2N.mjs} +43 -44
  34. package/node/esm/{NYFZEGBg9dFXwfFf.mjs → DB2ryaj4_Y8Lgyy_.mjs} +1 -1
  35. package/node/esm/{DQIYBoarjlonhEEn.mjs → X3qO0PKREgY9FMZU.mjs} +8 -8
  36. package/node/esm/index.mjs +1575 -1576
  37. package/node/esm/{DH3yxwtQR5c61iv3.mjs → rOozeXREjiU8jjPd.mjs} +14 -14
  38. package/package.json +15 -17
  39. package/types/index.d.ts +25 -93
  40. package/browser/cjs/BnpPHKTC6_96pDcW.cjs +0 -6
  41. package/browser/cjs/CHyGxDKCce-XV53l.cjs +0 -7
  42. package/browser/cjs/F4v-BOmzUXzCO3uz.cjs +0 -6
  43. package/browser/cjs/QQ4l7f6lYZb7S6td.cjs +0 -20
  44. package/browser/cjs/Td2md8ruASYOp_Rr.cjs +0 -6
  45. package/browser/cjs/jHU6TwhWd2lZX-VA.cjs +0 -6
  46. package/browser/esm/BhP57_jo4NnvHBgF.mjs +0 -64
  47. package/browser/esm/CGVa4zFRRZyFzDvh.mjs +0 -4489
  48. package/browser/esm/CkXFR3hHwNp6jfJV.mjs +0 -49
  49. package/browser/esm/CwAqw5gJ2yzuXbLx.mjs +0 -155
  50. package/node/esm/8qD_FXFKXbOqF2_X.mjs +0 -156
  51. package/node/esm/DQKU8gdXpx4S0S0D.mjs +0 -65
@@ -0,0 +1,157 @@
1
+ /**
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.7
3
+ *
4
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
+ * License: The license can be found at https://www.sheetxl.com/license.
6
+ */
7
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
8
+ import { memo as n, useRef as i, useState as o, useEffect as l, useLayoutEffect as r, useMemo as s } from "react";
9
+ import { useMeasure as a } from "react-use";
10
+ import { alpha as c, getOverlayAlpha as p } from "@mui/material/styles";
11
+ import { DialogContent as d, Box as u, TextField as f, InputAdornment as m, Collapse as g, MenuItem as x, FormControl as h, InputLabel as O, Select as y } from "@mui/material";
12
+ import { ICell as C, IRange as b } from "@sheetxl/sdk";
13
+ import { useCallbackRef as v, KeyCodes as R, DynamicIcon as k, KeyModifiers as T } from "@sheetxl/utils-react";
14
+ import { InternalWindow as w, ExhibitOptionButton as F, ExhibitDivider as E } from "@sheetxl/utils-mui";
15
+ const K = { width: "1.5rem", height: "1.5rem" }, S = n((n2) => {
16
+ const { label: i2, value: r2, options: a2, onSelect: d2, tabIndex: u2 = 0, ...f2 } = n2, [m2, g2] = o(() => M(r2, a2));
17
+ l(() => {
18
+ g2(M(r2, a2));
19
+ }, [r2, a2]);
20
+ const C2 = v((e2) => {
21
+ g2(e2.target.value), d2?.(a2[e2.target.value]);
22
+ }, [d2, a2]), b2 = s(() => Object.keys(a2).map((t2) => e(x, { value: t2, children: t2 }, t2)), [a2]);
23
+ return t(h, { sx: { minWidth: 135 }, size: "small", children: [e(O, { children: i2 }), e(y, { inputProps: { tabIndex: u2 }, value: m2, label: i2, onChange: C2, sx: { backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, ...f2, children: b2 })] });
24
+ }), I = { Workbook: "workbook", Sheet: "sheet" }, D = { enter: 140, exit: 140 }, A = { Formulas: C.Content.Formulas, Values: C.Content.Values, Notes: C.Content.Notes, Comments: C.Content.Comments }, B = { ...A };
25
+ delete B.Values;
26
+ const $ = { "By Rows": true, "By Columns": false }, M = (e2, t2) => {
27
+ const n2 = Object.keys(t2);
28
+ for (let i2 = 0; i2 < n2.length; i2++) {
29
+ const o2 = n2[i2];
30
+ if (t2[o2] === e2) return o2;
31
+ }
32
+ }, P = n((n2) => {
33
+ const { replace: s2 = false, findText: x2, replaceText: h2, findOptions: O2, replaceOptions: y2, title: M2, onHide: P2, onFindOrReplace: W, ...z } = n2, L = i(null), V = i(null), N = i(null), j = i(null), H = i(null), U = i(null), G = (e2, t2) => {
34
+ if (!t2) return;
35
+ t2.start(e2, { center: false }), setTimeout(() => t2.stop(e2), 180);
36
+ }, [q, J] = o(false), [Q, X] = o(false), [Y, Z] = o(s2), [_, ee] = o(false), [te, ne] = o(false), [ie, oe] = o({ replaceText: null, replace: s2, replaceOptions: {}, findOptions: { text: null, matchCase: false, matchEntireCell: false, useRegex: false, orientation: b.Orientation.Row, fields: [C.Content.Formulas] }, scope: I.Sheet }), le = v(async (e2, t2, n3, i2) => {
37
+ if (!W) return;
38
+ const o2 = { ...ie };
39
+ o2.replaceOptions = { ...o2.replaceOptions }, o2.findOptions = { ...o2.findOptions }, o2.replaceOptions.maxCount = n3 ? void 0 : 1, o2.replace = t2, t2 && ie.findOptions.fields?.[0] === C.Content.Values && (o2.findOptions.fields = [C.Content.Formulas]), o2.findOptions.reverse = !e2;
40
+ const l2 = await W({ autoFocus: i2, ...o2 });
41
+ ee(0 === l2);
42
+ }, [ie, W]);
43
+ l(() => {
44
+ ee(false);
45
+ }, [ie, Q, Y]);
46
+ const re = v((e2, t2) => {
47
+ if (e2.keyCode === R.Enter) {
48
+ if (!ie.findOptions.text) return;
49
+ let n3 = true, i2 = false;
50
+ e2.shiftKey && (n3 = false), t2 ? (e2.ctrlKey && e2.altKey && (i2 = true), G(e2, i2 ? U.current : H.current)) : G(e2, n3 ? j.current : N.current), le(n3, t2, i2, false);
51
+ }
52
+ }, [ie]), se = i(null);
53
+ r(() => {
54
+ oe((e2) => {
55
+ const t2 = { ...e2 };
56
+ t2.findOptions.text = x2 && x2.length > 0 ? x2 : e2.findOptions.text ?? "", J(true), void 0 !== h2 && (t2.replaceText = h2), O2 && (t2.findOptions = { ...t2.findOptions, ...O2 }), t2.replaceText || (t2.replaceText = ""), t2.replaceOptions && (t2.replaceOptions = { ...t2.replaceOptions }), y2 && (t2.replaceOptions = { ...t2.replaceOptions, ...y2 }), ie.findOptions.fields?.[0] || (ie.findOptions.fields = [C.Content.Formulas]);
57
+ const n3 = !(!y2 && void 0 === h2);
58
+ return n3 && Z(n3), t2;
59
+ }), te || se.current?.focus();
60
+ }, [x2, h2, O2, y2]), l(() => {
61
+ Y ? (ie.findOptions.fields[0], C.Content.Values) : J(true);
62
+ }, [Y]), l(() => {
63
+ if (q && L.current && ie.findOptions.text === L.current.value) return L.current === document.activeElement || L.current.contains(document.activeElement) ? (L.current?.select(), void J(false)) : void L.current.addEventListener("focus", () => {
64
+ L.current?.select(), J(false);
65
+ }, { once: true });
66
+ }, [q, ie]);
67
+ const [ae, { width: ce }] = a();
68
+ return e(w, { ref: se, title: M2 ?? (Y ? "Find & Replace" : "Find"), initialPosition: { y: "35" }, autoFocusSel: ".input", onHide: P2, onFocus: () => ne(true), onBlur: () => {
69
+ ne(false), ee(false);
70
+ }, slotProps: { paper: { elevation: te ? 3 : 1 } }, ...z, children: t(d, { dividers: true, ref: ae, sx: { display: "flex", flexDirection: "column", paddingLeft: (e2) => e2.spacing(1.5), paddingRight: (e2) => e2.spacing(1.5) }, onKeyDown: (e2) => {
71
+ if ("h" === e2.key && e2.ctrlKey) Z(true), L.current?.contains(document.activeElement) && V.current?.focus();
72
+ else if ("f" === e2.key && e2.ctrlKey) L.current?.focus();
73
+ else if ("c" === e2.key && e2.altKey) oe((e3) => {
74
+ const t2 = { ...e3 };
75
+ return t2.findOptions.matchCase = !e3.findOptions.matchCase, t2;
76
+ });
77
+ else if ("e" === e2.key && e2.altKey) oe((e3) => {
78
+ const t2 = { ...e3 };
79
+ return t2.findOptions.matchEntireCell = !e3.findOptions.matchEntireCell, t2;
80
+ });
81
+ else {
82
+ if ("r" !== e2.key || !e2.altKey) return;
83
+ oe((e3) => {
84
+ const t2 = { ...e3 };
85
+ return t2.findOptions.useRegex = !e3.findOptions.useRegex, t2;
86
+ });
87
+ }
88
+ e2.preventDefault();
89
+ }, children: [t(u, { sx: { display: "flex", flexDirection: "row", gap: (e2) => e2.spacing(1) }, children: [t(u, { sx: { display: "flex", flexDirection: "row", alignItems: "start", gap: (e2) => e2.spacing(0.25), paddingTop: "3px" }, children: [e(F, { selected: Q, onSelectToggle: (e2) => {
90
+ X(e2);
91
+ }, preventFocus: true, label: "Toggle Additional Options", icon: e(k, { iconKey: "FindOptions" }) }), e(F, { selected: Y, onSelectToggle: (e2) => {
92
+ Z(e2);
93
+ }, preventFocus: true, label: "Toggle Replace", icon: e(k, { iconKey: "FindReplaceToggle" }), shortcut: { key: Y ? "F" : "H", modifiers: [T.Ctrl] } })] }), t(u, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", boxSizing: "border-box" }, children: [t(u, { sx: { display: "flex", flexDirection: "row", alignItems: "center" }, children: [e(f, { label: "Find", slotProps: { input: { sx: { paddingRight: (e2) => e2.spacing(1), minWidth: ce > 460 ? "20em" : void 0, backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, endAdornment: e(m, { position: "end", children: t(u, { sx: { display: "flex", alignItems: "center", flexDirection: "row", gap: "2px" }, children: [e(F, { style: K, selected: ie.findOptions.matchCase, onBlur: () => {
94
+ console.log("blur");
95
+ }, onSelectToggle: (e2) => {
96
+ oe((t2) => {
97
+ const n3 = { ...t2 };
98
+ return n3.findOptions.matchCase = e2, n3;
99
+ });
100
+ }, label: "Match Case", shortcut: { key: "C", modifiers: [T.Alt] }, icon: e(k, { iconKey: "FindCaseSensitive", size: "1rem" }) }), e(F, { style: K, selected: ie.findOptions.matchEntireCell, onSelectToggle: (e2) => {
101
+ oe((t2) => {
102
+ const n3 = { ...t2 };
103
+ return n3.findOptions.matchEntireCell = e2, n3;
104
+ });
105
+ }, label: "Match Entire Cell", shortcut: { key: "E", modifiers: [T.Alt] }, icon: e(k, { iconKey: "FindWholeWord", size: "1rem" }) }), e(F, { style: K, selected: ie.findOptions.useRegex, onSelectToggle: (e2) => {
106
+ oe((t2) => {
107
+ const n3 = { ...t2 };
108
+ return n3.findOptions.useRegex = e2, n3;
109
+ });
110
+ }, label: "Use Regular Expression", shortcut: { key: "R", modifiers: [T.Alt] }, icon: e(k, { iconKey: "FindRegEx", size: "1rem" }) })] }) }) }, inputLabel: { shrink: true }, htmlInput: { draggable: false, ref: L, className: "input", autoFocus: true, spellCheck: false, autoComplete: "off", sx: { paddingTop: (e2) => e2.spacing(1.25), paddingBottom: (e2) => e2.spacing(0.75) } } }, sx: { flex: "1 1 100%", marginRight: (e2) => e2.spacing(1), "& .MuiOutlinedInput-notchedOutline": { borderColor: (e2) => _ ? `${e2.palette.error.main} !important` : void 0 }, "& .MuiInputLabel-outlined": { color: (e2) => _ ? `${e2.palette.error.main} !important` : void 0 } }, value: ie.findOptions.text ?? "", onChange: (e2) => {
111
+ oe((t2) => {
112
+ const n3 = { ...t2 };
113
+ return n3.findOptions.text = e2.target.value, n3;
114
+ });
115
+ }, onKeyDown: (e2) => re(e2, false), onContextMenu: (e2) => {
116
+ e2.stopPropagation();
117
+ } }), e(F, { selected: ie.findOptions.reverse, onSelectToggle: (e2) => {
118
+ le(false, false);
119
+ }, touchRippleRef: N, label: "", shortcut: { key: "Enter", modifiers: [T.Shift] }, icon: e(k, { iconKey: ie.findOptions.orientation !== b.Orientation.Column ? "ArrowBack" : "ArrowUpward" }), disabled: !ie.findOptions.text }), e(F, { selected: !ie.findOptions.reverse, onSelectToggle: (e2) => {
120
+ le(true, false);
121
+ }, touchRippleRef: j, label: "Next Match", shortcut: { key: "Enter" }, icon: e(k, { iconKey: ie.findOptions.orientation !== b.Orientation.Column ? "ArrowForward" : "ArrowDownward" }), disabled: !ie.findOptions.text })] }), e(g, { in: Y, timeout: D, onExit: () => {
122
+ L.current?.focus();
123
+ }, children: t(u, { sx: { display: "flex", flexDirection: "row", alignItems: "center", marginTop: (e2) => e2.spacing(2) }, children: [e(f, { label: "Replace", slotProps: { input: { sx: { paddingRight: (e2) => e2.spacing(1), backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` } }, inputLabel: { shrink: true }, htmlInput: { ref: V, className: "input", spellCheck: false, autoComplete: "off", sx: { paddingTop: (e2) => e2.spacing(1.25), paddingBottom: (e2) => e2.spacing(0.75) } } }, sx: { flex: "1 1 100%", marginRight: (e2) => e2.spacing(1) }, value: ie.replaceText ?? "", onChange: (e2) => {
124
+ oe((t2) => {
125
+ const n3 = { ...t2 };
126
+ return n3.replaceText = e2.target.value, n3;
127
+ });
128
+ }, onKeyDown: (e2) => re(e2, true), onContextMenu: (e2) => {
129
+ e2.stopPropagation();
130
+ } }), e(F, { onSelectToggle: (e2) => {
131
+ le(true, true);
132
+ }, touchRippleRef: H, label: "Replace", shortcut: { key: "Enter" }, icon: e(k, { iconKey: "FindReplace" }), disabled: !ie.findOptions.text }), e(F, { onSelectToggle: (e2) => {
133
+ le(true, true, true);
134
+ }, touchRippleRef: U, label: "Replace All", shortcut: { key: "Enter", modifiers: [T.Ctrl, T.Alt] }, icon: e(k, { iconKey: "FindReplaceAll" }), disabled: !ie.findOptions.text })] }) })] })] }), e(g, { in: Q, timeout: D, onExit: () => {
135
+ L.current?.focus();
136
+ }, children: t(u, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", gap: (e2) => e2.spacing(1.5), marginTop: (e2) => e2.spacing(1) }, children: [e(E, { orientation: "horizontal", sx: { marginBottom: (e2) => e2.spacing(1.5) } }), t(u, { sx: { display: "flex", flexDirection: ce >= 383 ? "row" : "column", justifyContent: "space-evenly", alignItems: "center", gap: (e2) => e2.spacing(1), rowGap: (e2) => e2.spacing(2) }, tabIndex: -1, children: [e(S, { label: "Within", value: ie.scope, options: I, onSelect: (e2) => {
137
+ oe((t2) => {
138
+ const n3 = { ...t2 };
139
+ return n3.scope = e2, n3;
140
+ });
141
+ } }), e(S, { label: "Search", value: ie.findOptions.orientation !== b.Orientation.Column, options: $, onSelect: (e2) => {
142
+ oe((t2) => {
143
+ const n3 = { ...t2 };
144
+ return n3.findOptions.orientation = e2 ? b.Orientation.Row : b.Orientation.Column, n3;
145
+ });
146
+ } }), e(S, { label: "Look in", value: Y && ie.findOptions.fields?.[0] === C.Content.Values ? C.Content.Formulas : ie.findOptions.fields?.[0], options: Y ? B : A, onSelect: (e2) => {
147
+ oe((t2) => {
148
+ const n3 = { ...t2 };
149
+ return n3.findOptions.fields = [e2], n3;
150
+ });
151
+ } })] })] }) })] }) });
152
+ });
153
+ export {
154
+ P as FindReplaceWindow,
155
+ I as ScopeOptions,
156
+ P as default
157
+ };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.5
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.5
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.5
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.5
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - 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.
@@ -11,36 +11,36 @@ import { Box as r, FormControl as p, TextField as c } from "@mui/material";
11
11
  import { useCallbackRef as d } from "@sheetxl/utils-react";
12
12
  import { OptionsDialog as u } from "@sheetxl/utils-mui";
13
13
  const g = ["Ok", "Cancel"], m = n((n2) => {
14
- const { initialHyperlink: m2 = null, initialDisplay: f = null, onUpdateHyperlink: x, context: h, onOption: y, onValidateOption: T, onDone: k, options: C = g, defaultOption: O = C?.[0], cancelOption: P = "Cancel", sx: b, ...D } = n2, F = o(() => null !== (m2 ?? h?.()?.getHyperlink()), []), I = o(() => {
14
+ const { initialHyperlink: m2 = null, initialDisplay: f = null, onUpdateHyperlink: x, context: h, onOption: y, onValidateOption: T, onDone: k, options: C = g, defaultOption: O = C?.[0], cancelOption: b = "Cancel", sx: D, ...F } = n2, v = o(() => null !== (m2 ?? h?.()?.getHyperlink()), []), w = o(() => {
15
15
  let t2 = null, e2 = null;
16
16
  m2 && ("string" == typeof m2 ? e2 = m2 : t2 = m2);
17
17
  const n3 = t2 ?? h?.()?.getHyperlink();
18
18
  return { address: e2 ?? n3?.getAddress() ?? "", textToDisplay: n3?.getDisplayText() ?? "" };
19
- }, [m2, h]), [v, w] = a(I.address), [H, M] = a(() => {
19
+ }, [m2, h]), [H, I] = a(w.address), [P, M] = a(() => {
20
20
  const t2 = h?.().toTextUnformatted() ?? f;
21
- return t2 === I.address ? "" : t2;
21
+ return t2 === w.address ? "" : t2;
22
22
  }), [$, B] = a(false), L = i((t2) => {
23
23
  M(t2.target.value);
24
24
  }, []), W = i(async (t2, e2) => null, []), z = d(async (t2) => {
25
- const e2 = "" === v ? null : { address: v };
26
- t2 !== P && x?.(e2, H), y?.(t2, t2 === P, t2 === O), k?.();
27
- }, [v, H, x, k, y, O, P]), A = d((t2) => {
28
- w(t2.target.value), W(t2.target.value, null);
25
+ const e2 = "" === H ? null : { address: H };
26
+ t2 !== b && x?.(e2, P), y?.(t2, t2 === b, t2 === O), k?.();
27
+ }, [H, P, x, k, y, O, b]), A = d((t2) => {
28
+ I(t2.target.value), W(t2.target.value, null);
29
29
  }, [T]), E = d(async (t2) => {
30
30
  let e2 = await Promise.resolve(T?.(t2));
31
31
  try {
32
- false !== e2 && (e2 = await W(v, t2));
32
+ false !== e2 && (e2 = await W(H, t2));
33
33
  } catch (t3) {
34
34
  }
35
35
  return e2 ?? true;
36
36
  }, [T]);
37
- return t(u, { title: (F ? "Edit" : "Insert") + " Link", options: C, onDone: k, onOption: (t2) => z(t2), onValidateOption: E, defaultOption: O, cancelOption: P, autoFocusSel: ".autoFocus", sx: { width: "480px", ...b }, ...D, children: e(r, { sx: { paddingTop: (t2) => t2.spacing(1), paddingBottom: (t2) => t2.spacing(0), rowGap: (t2) => t2.spacing(1), display: "flex", flexDirection: "column" }, children: [t(p, { sx: { paddingTop: (t2) => t2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(c, { label: "Address", placeholder: "Enter a url or cell reference.", onFocus: (t2) => {
37
+ return t(u, { title: (v ? "Edit" : "Insert") + " Link", options: C, onDone: k, onOption: (t2) => z(t2), onValidateOption: E, defaultOption: O, cancelOption: b, autoFocusSel: ".autoFocus", sx: { width: "480px", ...D }, ...F, children: e(r, { sx: { paddingTop: (t2) => t2.spacing(1), paddingBottom: (t2) => t2.spacing(0), rowGap: (t2) => t2.spacing(1), display: "flex", flexDirection: "column" }, children: [t(p, { sx: { paddingTop: (t2) => t2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(c, { label: "Address", placeholder: "Enter a url or cell reference.", onFocus: (t2) => {
38
38
  $ || t2.target?.select(), B(true);
39
- }, sx: { "& .MuiFormHelperText-root": { marginTop: (t2) => t2.spacing(0.5) } }, InputLabelProps: { shrink: true }, InputProps: { inputProps: { className: "autoFocus", spellCheck: false, autoComplete: "off", sx: { paddingTop: (t2) => t2.spacing(1.25), paddingBottom: (t2) => t2.spacing(0.75), backgroundImage: `linear-gradient(${l("#fff", s(5))}, ${l("#fff", s(5))})` } } }, value: v, onChange: A, onContextMenu: (t2) => {
39
+ }, sx: { "& .MuiFormHelperText-root": { marginTop: (t2) => t2.spacing(0.5) } }, slotProps: { inputLabel: { shrink: true }, htmlInput: { className: "autoFocus", spellCheck: false, autoComplete: "off", sx: { paddingTop: (t2) => t2.spacing(1.25), paddingBottom: (t2) => t2.spacing(0.75), backgroundImage: `linear-gradient(${l("#fff", s(5))}, ${l("#fff", s(5))})` } } }, value: H, onChange: A, onContextMenu: (t2) => {
40
40
  t2.stopPropagation();
41
- } }) }), t(p, { sx: { paddingTop: (t2) => t2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(c, { label: "Display Text", placeholder: v?.startsWith("#") ? v.substring(1) : v, onFocus: () => {
41
+ } }) }), t(p, { sx: { paddingTop: (t2) => t2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(c, { label: "Display Text", placeholder: H?.startsWith("#") ? H.substring(1) : H, onFocus: () => {
42
42
  B(true);
43
- }, sx: { "& .MuiFormHelperText-root": { marginTop: (t2) => t2.spacing(0.5) } }, InputLabelProps: { shrink: true }, InputProps: { inputProps: { spellCheck: false, autoComplete: "off", sx: { paddingTop: (t2) => t2.spacing(1.25), paddingBottom: (t2) => t2.spacing(0.75), backgroundImage: `linear-gradient(${l("#fff", s(5))}, ${l("#fff", s(5))})` } } }, value: H, onChange: L, onContextMenu: (t2) => {
43
+ }, sx: { "& .MuiFormHelperText-root": { marginTop: (t2) => t2.spacing(0.5) } }, slotProps: { inputLabel: { shrink: true }, htmlInput: { spellCheck: false, autoComplete: "off", sx: { paddingTop: (t2) => t2.spacing(1.25), paddingBottom: (t2) => t2.spacing(0.75), backgroundImage: `linear-gradient(${l("#fff", s(5))}, ${l("#fff", s(5))})` } } }, value: P, onChange: L, onContextMenu: (t2) => {
44
44
  t2.stopPropagation();
45
45
  } }) })] }) });
46
46
  });
@@ -1,88 +1,87 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.5
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - 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.
6
6
  */
7
7
  import { jsxs as e, jsx as t } from "react/jsx-runtime";
8
- import { Box as i, TextField as n, InputAdornment as r, IconButton as o, FormControlLabel as l, Checkbox as a, Typography as d, TableCell as s, DialogContent as c } from "@mui/material";
9
- import { KeyCodes as h } from "@sheetxl/utils-react";
10
- import { toShortcutElements as p, InternalWindow as m } from "@sheetxl/utils-mui";
11
- import u, { useState as g, useMemo as f, useEffect as x } from "react";
12
- import b from "clsx";
13
- import { alpha as w, getOverlayAlpha as y, styled as R } from "@mui/material/styles";
14
- import { Close as C } from "@mui/icons-material";
8
+ import { Box as i, TextField as n, InputAdornment as o, IconButton as r, FormControlLabel as l, Checkbox as a, Typography as d, TableCell as s, DialogContent as c } from "@mui/material";
9
+ import { KeyCodes as h, DynamicIcon as p } from "@sheetxl/utils-react";
10
+ import { toShortcutElements as m, InternalWindow as u } from "@sheetxl/utils-mui";
11
+ import g, { useState as f, useMemo as x, useEffect as b } from "react";
12
+ import w from "clsx";
13
+ import { alpha as y, getOverlayAlpha as C, styled as R } from "@mui/material/styles";
15
14
  import { AutoSizer as k, Table as v, Column as $ } from "react-virtualized";
16
15
  import { CommonUtils as D } from "@sheetxl/utils";
17
- const I = "ReactVirtualizedDemo-flexContainer", K = "ReactVirtualizedDemo-tableRow", z = "ReactVirtualizedDemo-tableRowHover", H = "ReactVirtualizedDemo-tableCell", S = "ReactVirtualizedDemo-noClick";
18
- class N extends u.PureComponent {
16
+ const K = "ReactVirtualizedDemo-flexContainer", I = "ReactVirtualizedDemo-tableRow", z = "ReactVirtualizedDemo-tableRowHover", H = "ReactVirtualizedDemo-tableCell", S = "ReactVirtualizedDemo-noClick";
17
+ class N extends g.PureComponent {
19
18
  constructor() {
20
19
  super(...arguments), this.getRowClassName = ({ index: e2 }) => {
21
20
  const { onRowClick: t2 } = this.props;
22
- return b(K, I, { [z]: -1 !== e2 && null != t2 });
23
- }, this.cellRenderer = ({ cellData: e2, dataKey: i2, columnIndex: n2, width: r2 }) => {
24
- const { columns: o2, rowHeight: l2, onRowClick: a2 } = this.props;
25
- let d2 = e2, c2 = { height: l2, paddingRight: "2px", paddingTop: "0px", paddingBottom: "0px", minWidth: `${r2}px`, maxWidth: `${r2}px` };
26
- return "shortcut" === i2 ? d2 = p(e2) : "description" === i2 && (c2 = { ...c2, fontSize: ".75rem", display: "block", paddingTop: "4px", whiteSpace: "pre-line" }), t(s, { component: "div", className: b(H, I, { [S]: null == a2 }), variant: "body", style: c2, align: null != n2 && o2[n2].numeric ? "right" : "left", children: d2 });
21
+ return w(I, K, { [z]: -1 !== e2 && null != t2 });
22
+ }, this.cellRenderer = ({ cellData: e2, dataKey: i2, columnIndex: n2, width: o2 }) => {
23
+ const { columns: r2, rowHeight: l2, onRowClick: a2 } = this.props;
24
+ let d2 = e2, c2 = { height: l2, paddingRight: "2px", paddingTop: "0px", paddingBottom: "0px", minWidth: `${o2}px`, maxWidth: `${o2}px` };
25
+ return "shortcut" === i2 ? d2 = m(e2) : "description" === i2 && (c2 = { ...c2, fontSize: ".75rem", display: "block", paddingTop: "4px", whiteSpace: "pre-line" }), t(s, { component: "div", className: w(H, K, { [S]: null == a2 }), variant: "body", style: c2, align: null != n2 && r2[n2].numeric ? "right" : "left", children: d2 });
27
26
  }, this.headerRenderer = ({ label: e2, columnIndex: i2, width: n2 }) => {
28
- const { headerHeight: r2, columns: o2 } = this.props, l2 = o2[i2];
29
- return t(s, { component: "div", className: b(H, I, S), variant: "head", sx: { width: n2, height: r2, backgroundColor: (e3) => e3.palette.grey[300] }, align: l2.numeric ? "right" : "left", children: t("span", { children: l2.label }) });
27
+ const { headerHeight: o2, columns: r2 } = this.props, l2 = r2[i2];
28
+ return t(s, { component: "div", className: w(H, K, S), variant: "head", sx: { width: n2, height: o2, backgroundColor: (e3) => e3.palette.grey[300] }, align: l2.numeric ? "right" : "left", children: t("span", { children: l2.label }) });
30
29
  };
31
30
  }
32
31
  static {
33
32
  this.defaultProps = { headerHeight: 40, rowHeight: 48 };
34
33
  }
35
34
  render() {
36
- const { columns: e2, rowHeight: i2, headerHeight: n2, ...r2 } = this.props;
37
- return t(k, { children: ({ height: o2, width: l2 }) => t(v, { height: o2, width: l2, rowHeight: i2, gridStyle: { direction: "inherit" }, headerHeight: n2, ...r2, rowClassName: this.getRowClassName, children: e2.map(({ dataKey: e3, width: i3, widthLess: n3, ...r3 }, o3) => {
35
+ const { columns: e2, rowHeight: i2, headerHeight: n2, ...o2 } = this.props;
36
+ return t(k, { children: ({ height: r2, width: l2 }) => t(v, { height: r2, width: l2, rowHeight: i2, gridStyle: { direction: "inherit" }, headerHeight: n2, ...o2, rowClassName: this.getRowClassName, children: e2.map(({ dataKey: e3, width: i3, widthLess: n3, ...o3 }, r3) => {
38
37
  const a2 = n3 ? l2 - n3 : i3;
39
- return t($, { style: { flex: `1 1 ${a2}px` }, headerRenderer: (e4) => this.headerRenderer({ ...e4, width: a2, columnIndex: o3 }), className: I, cellDataGetter: ({ rowData: e4, columnData: t2, dataKey: i4 }) => e4[i4], cellRenderer: (e4) => this.cellRenderer({ ...e4, width: a2, columnIndex: o3 }), dataKey: e3, width: a2, ...r3 }, e3);
38
+ return t($, { style: { flex: `1 1 ${a2}px` }, headerRenderer: (e4) => this.headerRenderer({ ...e4, width: a2, columnIndex: r3 }), className: K, cellDataGetter: ({ rowData: e4, columnData: t2, dataKey: i4 }) => e4[i4], cellRenderer: (e4) => this.cellRenderer({ ...e4, width: a2, columnIndex: r3 }), dataKey: e3, width: a2, ...o3 }, e3);
40
39
  }) }) });
41
40
  }
42
41
  }
43
- const T = R(N)(({ theme: e2 }) => ({ "& .ReactVirtualized__Table__headerRow": { ..."rtl" === e2.direction && { paddingLeft: "0 !important" }, ..."rtl" !== e2.direction && { paddingRight: void 0 } }, "& .ReactVirtualized__Table__Grid": { outline: "none" }, [`& .${I}`]: { display: "flex", alignItems: "center", boxSizing: "border-box" }, [`& .${K}`]: { cursor: "pointer" }, [`& .${z}`]: { "&:hover:not([disabled])": { backgroundColor: e2.palette.grey[200] } }, [`& .${H}`]: { flex: 1 }, [`& .${S}`]: { cursor: "initial" } }));
42
+ const T = R(N)(({ theme: e2 }) => ({ "& .ReactVirtualized__Table__headerRow": { ..."rtl" === e2.direction && { paddingLeft: "0 !important" }, ..."rtl" !== e2.direction && { paddingRight: void 0 } }, "& .ReactVirtualized__Table__Grid": { outline: "none" }, [`& .${K}`]: { display: "flex", alignItems: "center", boxSizing: "border-box" }, [`& .${I}`]: { cursor: "pointer" }, [`& .${z}`]: { "&:hover:not([disabled])": { backgroundColor: e2.palette.grey[200] } }, [`& .${H}`]: { flex: 1 }, [`& .${S}`]: { cursor: "initial" } }));
44
43
  function _(s2) {
45
- const { commands: c2, ...p2 } = s2, [m2, u2] = g(false), [b2, R2] = g(""), k2 = f(() => {
44
+ const { commands: c2, ...m2 } = s2, [u2, g2] = f(false), [w2, R2] = f(""), k2 = x(() => {
46
45
  let e2 = c2.getAllCommands();
47
- m2 || (e2 = e2.filter((e3) => e3.command.shortcut())), e2.sort((e3, t3) => e3.command.label().localeCompare(t3.command.label()));
46
+ u2 || (e2 = e2.filter((e3) => e3.command.shortcut())), e2.sort((e3, t3) => e3.command.label().localeCompare(t3.command.label()));
48
47
  const t2 = [], i2 = (e3) => e3.replace(/\n\n/g, "\n");
49
48
  for (let n2 = 0; n2 < e2.length; n2++) {
50
- const r2 = e2[n2].command, o2 = r2.shortcut();
51
- if (Array.isArray(o2)) {
52
- const e3 = o2;
53
- for (let n3 = 0; n3 < e3.length; n3++) t2.push({ label: r2.label(), description: i2(r2.description()), shortcut: e3[n3] });
54
- } else t2.push({ label: r2.label(), description: i2(r2.description()), shortcut: r2.shortcut() });
49
+ const o2 = e2[n2].command, r2 = o2.shortcut();
50
+ if (Array.isArray(r2)) {
51
+ const e3 = r2;
52
+ for (let n3 = 0; n3 < e3.length; n3++) t2.push({ label: o2.label(), description: i2(o2.description()), shortcut: e3[n3] });
53
+ } else t2.push({ label: o2.label(), description: i2(o2.description()), shortcut: o2.shortcut() });
55
54
  }
56
55
  return t2;
57
- }, [m2, c2]), [v2, $2] = g(null);
58
- x(() => {
56
+ }, [u2, c2]), [v2, $2] = f(null);
57
+ b(() => {
59
58
  import("fuse.js").then((e2) => {
60
59
  $2(new e2.default(k2, { threshold: 0, ignoreLocation: true, keys: ["label", "description"] }));
61
60
  });
62
61
  }, [k2]);
63
- const [I2, K2] = g(k2), z2 = b2.length > 0 && 0 === I2.length;
64
- x(() => {
62
+ const [K2, I2] = f(k2), z2 = w2.length > 0 && 0 === K2.length;
63
+ b(() => {
65
64
  v2 && D.debounce(() => {
66
- if (0 === b2.trim().length) return void K2(k2);
67
- const e2 = v2.search(b2.trim()), t2 = new Array(e2.length);
65
+ if (0 === w2.trim().length) return void I2(k2);
66
+ const e2 = v2.search(w2.trim()), t2 = new Array(e2.length);
68
67
  for (let i2 = 0; i2 < e2.length; i2++) t2[i2] = e2[i2].item;
69
- K2(t2);
68
+ I2(t2);
70
69
  }, 90)();
71
- }, [v2, b2]);
72
- return e(i, { style: { height: 440, width: "100%", display: "flex", flexDirection: "column" }, ...p2, children: [e(i, { sx: { display: "flex", alignItems: "center", justifyContent: "end", marginBottom: (e2) => e2.spacing(2), color: (e2) => e2.palette.text.secondary }, children: [t(n, { InputProps: { sx: { backgroundImage: `linear-gradient(${w("#fff", y(5))}, ${w("#fff", y(5))})` }, inputProps: { className: "input", autoFocus: true, spellCheck: false, placeholder: "Type to search key bindings", autoComplete: "off", sx: { paddingTop: (e2) => e2.spacing(1), paddingBottom: (e2) => e2.spacing(1) } }, endAdornment: t(r, { sx: { opacity: b2.length > 0 ? 1 : 0, display: b2.length > 0 ? "flex" : "none" }, position: "end", children: t(o, { "aria-label": "clear search", onClick: () => R2(""), edge: "end", children: t(C, {}) }) }) }, sx: { flex: "1 1 40%", marginRight: (e2) => e2.spacing(1), "& .MuiOutlinedInput-notchedOutline": { borderColor: (e2) => z2 ? `${e2.palette.error.main} !important` : void 0 }, "& .MuiInputLabel-outlined": { color: (e2) => z2 ? `${e2.palette.error.main} !important` : void 0 } }, value: b2, onChange: (e2) => {
70
+ }, [v2, w2]);
71
+ return e(i, { style: { height: 440, width: "100%", display: "flex", flexDirection: "column" }, ...m2, children: [e(i, { sx: { display: "flex", alignItems: "center", justifyContent: "end", marginBottom: (e2) => e2.spacing(2), color: (e2) => e2.palette.text.secondary }, children: [t(n, { slotProps: { input: { sx: { backgroundImage: `linear-gradient(${y("#fff", C(5))}, ${y("#fff", C(5))})` }, endAdornment: t(o, { sx: { opacity: w2.length > 0 ? 1 : 0, display: w2.length > 0 ? "flex" : "none" }, position: "end", children: t(r, { "aria-label": "clear search", onClick: () => R2(""), edge: "end", children: t(p, { iconKey: "Close" }) }) }) }, htmlInput: { className: "input", autoFocus: true, spellCheck: false, placeholder: "Type to search key bindings", autoComplete: "off", sx: { paddingTop: (e2) => e2.spacing(1), paddingBottom: (e2) => e2.spacing(1) } } }, sx: { flex: "1 1 40%", marginRight: (e2) => e2.spacing(1), "& .MuiOutlinedInput-notchedOutline": { borderColor: (e2) => z2 ? `${e2.palette.error.main} !important` : void 0 }, "& .MuiInputLabel-outlined": { color: (e2) => z2 ? `${e2.palette.error.main} !important` : void 0 } }, value: w2, onChange: (e2) => {
73
72
  R2(e2.target.value);
74
73
  }, onKeyDown: (e2) => {
75
- e2.which === h.Escape && b2.length > 0 && (R2(""), e2.stopPropagation(), e2.preventDefault());
74
+ e2.which === h.Escape && w2.length > 0 && (R2(""), e2.stopPropagation(), e2.preventDefault());
76
75
  }, onContextMenu: (e2) => {
77
76
  e2.stopPropagation();
78
- } }), t(l, { sx: { flex: "1 1 60%" }, control: t(a, { checked: m2, onChange: () => u2(!m2) }), label: "Show commands without key bindings", labelPlacement: "start" })] }), t(i, { sx: { flex: "1 1 100%", borderRadius: (e2) => `${e2.shape.borderRadius}px`, border: (e2) => `solid ${e2.palette.divider} 1px`, paddingRight: "1px", overflow: "hidden", "* .MuiTableCell-head": { background: (e2) => e2.palette.background.paper, backgroundImage: `linear-gradient(${w("#fff", y(5))}, ${w("#fff", y(5))})` } }, children: t(T, { rowCount: I2.length, rowGetter: (e2) => I2[e2.index], columns: [{ width: 180, label: "Command", dataKey: "label" }, { width: 260, label: "Key Binding", dataKey: "shortcut" }, { width: 240, label: "Description", dataKey: "description", widthLess: 440 }] }) }), t(i, { sx: { display: "flex", flexShrink: "0", paddingLeft: (e2) => e2.spacing(1), paddingTop: (e2) => e2.spacing(1), paddingRight: (e2) => e2.spacing(1), userSelect: "none", justifyContent: "flex-end" }, children: t(d, { noWrap: true, component: "div", sx: { color: (e2) => z2 ? e2.palette.error.main : e2.palette.text.secondary }, children: `${0 === I2.length ? "No" : I2.length} shortcut key${1 === I2.length ? "" : "s"}${b2.length > 0 ? " found" : ""}` }) })] });
77
+ } }), t(l, { sx: { flex: "1 1 60%" }, control: t(a, { checked: u2, onChange: () => g2(!u2) }), label: "Show commands without key bindings", labelPlacement: "start" })] }), t(i, { sx: { flex: "1 1 100%", borderRadius: (e2) => `${e2.shape.borderRadius}px`, border: (e2) => `solid ${e2.palette.divider} 1px`, paddingRight: "1px", overflow: "hidden", "* .MuiTableCell-head": { background: (e2) => e2.palette.background.paper, backgroundImage: `linear-gradient(${y("#fff", C(5))}, ${y("#fff", C(5))})` } }, children: t(T, { rowCount: K2.length, rowGetter: (e2) => K2[e2.index], columns: [{ width: 180, label: "Command", dataKey: "label" }, { width: 260, label: "Key Binding", dataKey: "shortcut" }, { width: 240, label: "Description", dataKey: "description", widthLess: 440 }] }) }), t(i, { sx: { display: "flex", flexShrink: "0", paddingLeft: (e2) => e2.spacing(1), paddingTop: (e2) => e2.spacing(1), paddingRight: (e2) => e2.spacing(1), userSelect: "none", justifyContent: "flex-end" }, children: t(d, { noWrap: true, component: "div", sx: { color: (e2) => z2 ? e2.palette.error.main : e2.palette.text.secondary }, children: `${0 === K2.length ? "No" : K2.length} shortcut key${1 === K2.length ? "" : "s"}${w2.length > 0 ? " found" : ""}` }) })] });
79
78
  }
80
- const P = (e2) => {
81
- const { title: i2 = "Shortcut Keys", commands: n2, sx: r2, ...o2 } = e2;
82
- return t(m, { isModal: true, onKeyDown: (e3) => {
79
+ const V = (e2) => {
80
+ const { title: i2 = "Shortcut Keys", commands: n2, sx: o2, ...r2 } = e2;
81
+ return t(u, { isModal: true, onKeyDown: (e3) => {
83
82
  e3.keyCode === h.F1 && e3.preventDefault();
84
- }, sx: { width: "780px", ...r2 }, title: i2, autoFocusSel: ".input", ...o2, children: t(c, { dividers: true, children: t(_, { commands: n2, sx: { marginBottom: "8px" } }) }) });
83
+ }, sx: { width: "780px", ...o2 }, title: i2, autoFocusSel: ".input", ...r2, children: t(c, { dividers: true, children: t(_, { commands: n2, sx: { marginBottom: "8px" } }) }) });
85
84
  };
86
85
  export {
87
- P as default
86
+ V as default
88
87
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.5
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.5
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - 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,16 +7,16 @@
7
7
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
8
8
  import { memo as o, useState as a, useCallback as n, useEffect as i, useMemo as r } from "react";
9
9
  import { alpha as l, getOverlayAlpha as s } from "@mui/material/styles";
10
- import { Box as p, FormControl as c, InputLabel as u, Select as m, TextField as d, Typography as g, MenuItem as f } from "@mui/material";
10
+ import { Box as p, FormControl as c, InputLabel as m, Select as u, TextField as d, Typography as g, MenuItem as f } from "@mui/material";
11
11
  import { NumberFormat as y } from "@sheetxl/sdk";
12
12
  import { useCallbackRef as h, KeyCodes as x } from "@sheetxl/utils-react";
13
13
  import { OptionsDialog as C } from "@sheetxl/utils-mui";
14
14
  const v = ["Ok", "Cancel"], b = o((o2) => {
15
- const { initialValue: b2, context: T, onOption: k, onValidateOption: O, onInputOption: w, onDone: F, options: P = v, defaultOption: S = P?.[0], cancelOption: $ = "Cancel", sx: D, ...I } = o2, [V, N] = a(b2), [j, z] = a(false), B = n(async (e2, t2) => true, []), L = h(async (e2) => {
16
- w?.(V, e2), k?.(e2, e2 === $, e2 === S), F?.();
17
- }, [V, w, F, k, $, S]), M = h(async (e2) => {
15
+ const { initialValue: b2, context: T, onOption: k, onValidateOption: O, onInputOption: w, onDone: F, options: S = v, defaultOption: P = S?.[0], cancelOption: $ = "Cancel", sx: D, ...I } = o2, [V, N] = a(b2), [j, z] = a(false), B = n(async (e2, t2) => true, []), L = h(async (e2) => {
16
+ w?.(V, e2), k?.(e2, e2 === $, e2 === P), F?.();
17
+ }, [V, w, F, k, $, P]), M = h(async (e2) => {
18
18
  if (e2.keyCode === x.Enter) {
19
- false !== await B?.(V, null) && L(S);
19
+ false !== await B?.(V, null) && L(P);
20
20
  }
21
21
  }, [V, L]), R = h((e2) => {
22
22
  N(e2.target.value), B?.(e2.target.value, null);
@@ -43,9 +43,9 @@ const v = ["Ok", "Cancel"], b = o((o2) => {
43
43
  const e2 = T();
44
44
  return e2.createTemporaryCell({ value: e2.getValue() ?? 12345, style: { numberFormat: V } });
45
45
  }, [E, V, T]);
46
- return e(C, { title: "Number Format", options: P, onDone: F, onOption: (e2) => L(e2), onValidateOption: W, defaultOption: S, cancelOption: $, autoFocusSel: ".autoFocus", sx: { width: "580px", ...D }, ...I, children: t(p, { sx: { paddingTop: (e2) => e2.spacing(1), paddingBottom: (e2) => e2.spacing(0), rowGap: (e2) => e2.spacing(1), display: "flex", flexDirection: "column" }, children: [t(c, { sx: { minWidth: 135 }, size: "small", children: [e(u, { children: "Category" }), e(m, { value: E, label: "Category", onChange: K, sx: { backgroundImage: `linear-gradient(${l("#fff", s(5))}, ${l("#fff", s(5))})` }, children: H })] }), e(c, { sx: { paddingTop: (e2) => e2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: e(d, { label: "Code", onFocus: (e2) => {
46
+ return e(C, { title: "Number Format", options: S, onDone: F, onOption: (e2) => L(e2), onValidateOption: W, defaultOption: P, cancelOption: $, autoFocusSel: ".autoFocus", sx: { width: "580px", ...D }, ...I, children: t(p, { sx: { paddingTop: (e2) => e2.spacing(1), paddingBottom: (e2) => e2.spacing(0), rowGap: (e2) => e2.spacing(1), display: "flex", flexDirection: "column" }, children: [t(c, { sx: { minWidth: 135 }, size: "small", children: [e(m, { children: "Category" }), e(u, { value: E, label: "Category", onChange: K, sx: { backgroundImage: `linear-gradient(${l("#fff", s(5))}, ${l("#fff", s(5))})` }, children: H })] }), e(c, { sx: { paddingTop: (e2) => e2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: e(d, { label: "Code", onFocus: (e2) => {
47
47
  j || e2.target?.select(), z(true);
48
- }, sx: { "& .MuiFormHelperText-root": { marginTop: (e2) => e2.spacing(0.5) } }, InputLabelProps: { shrink: true }, InputProps: { inputProps: { className: "autoFocus", spellCheck: false, autoComplete: "off", sx: { paddingTop: (e2) => e2.spacing(1.25), paddingBottom: (e2) => e2.spacing(0.75), backgroundImage: `linear-gradient(${l("#fff", s(5))}, ${l("#fff", s(5))})` } } }, value: V, onChange: R, onKeyDown: M, onContextMenu: (e2) => {
48
+ }, sx: { "& .MuiFormHelperText-root": { marginTop: (e2) => e2.spacing(0.5) } }, slotProps: { inputLabel: { shrink: true }, htmlInput: { className: "autoFocus", spellCheck: false, autoComplete: "off", sx: { paddingTop: (e2) => e2.spacing(1.25), paddingBottom: (e2) => e2.spacing(0.75), backgroundImage: `linear-gradient(${l("#fff", s(5))}, ${l("#fff", s(5))})` } } }, value: V, onChange: R, onKeyDown: M, onContextMenu: (e2) => {
49
49
  e2.stopPropagation();
50
50
  } }) }), t(p, { children: [e(g, { variant: "caption", component: "div", sx: { paddingLeft: (e2) => e2.spacing(2) }, children: "Preview" }), e(g, { variant: "body2", component: "div", sx: { borderRadius: (e2) => `${e2.shape.borderRadius}px`, padding: (e2) => e2.spacing(1), border: (e2) => `1px solid ${e2.palette.grey[400]}` }, children: q.getNumberFormat().displayText || "(empty)" })] })] }) });
51
51
  });