@sheetxl/studio-mui 0.7.11 → 0.7.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/browser/cjs/BAcqVi4z0lEWdogG.cjs +6 -0
  2. package/browser/cjs/{Dk9NCZiAOD9zzs39.cjs → BXSBqvJbFd1zmXED.cjs} +3 -3
  3. package/browser/cjs/BXpuqWQiSePSVD7I.cjs +6 -0
  4. package/browser/cjs/BY_Yr3aQW5hLO-nN.cjs +6 -0
  5. package/browser/cjs/BankB3sWgfQSVyEv.cjs +20 -0
  6. package/browser/cjs/{MKXDODFXAmzmh_2S.cjs → BkRzKXHu8z2zghTF.cjs} +2 -2
  7. package/browser/cjs/CYeknazLzZOjQtcK.cjs +6 -0
  8. package/browser/cjs/CyLVMzcTgEZPvYOm.cjs +6 -0
  9. package/browser/cjs/DD9bJC3Knid6T5It.cjs +6 -0
  10. package/browser/cjs/{rxLo_Ld1Xi-KKL6y.cjs → SQX0Xb9ngHtVWoYW.cjs} +1 -1
  11. package/browser/cjs/_A_9JrHZzYhVIimw.cjs +7 -0
  12. package/browser/cjs/gmJVh5GO4raegeQH.cjs +6 -0
  13. package/browser/cjs/index.cjs +2 -2
  14. package/browser/esm/{CFX1xSvjQ7k3GYNy.mjs → BUX-eSzx85xb14z2.mjs} +2 -2
  15. package/browser/esm/BhK8LG6eLNtnpyM8.mjs +50 -0
  16. package/browser/esm/{DmBripa50tKiqREL.mjs → Bt5mafuXg0WhvqQl.mjs} +3 -3
  17. package/browser/esm/CM2aBn9YvLNeeDKP.mjs +26 -0
  18. package/browser/esm/{Dfg1sHqBfYLAePQR.mjs → CWzQRJNunubg1KYs.mjs} +1 -1
  19. package/browser/esm/{BUE0z3b78bw14bK3.mjs → C_L0TMqGy3dfJBxX.mjs} +860 -855
  20. package/browser/esm/{rTUe_Q7TeplDbtPZ.mjs → D3fJ2Y2akXy1Cea2.mjs} +28 -27
  21. package/browser/esm/DAM5zld1EMvhrTq7.mjs +46 -0
  22. package/browser/esm/DBreu3Q0z7uri1up.mjs +50 -0
  23. package/browser/esm/DYbBkU4jsgMfwHKv.mjs +155 -0
  24. package/browser/esm/DkCrTK-q70GM5ZtY.mjs +53 -0
  25. package/browser/esm/index.mjs +69 -68
  26. package/browser/esm/uswYw8_B9PDchitz.mjs +25 -0
  27. package/licenses/dependencies.txt +142 -142
  28. package/node/esm/{C2ndkS7Xv8G7tqsJ.mjs → B2g633xDh_bOofUD.mjs} +18 -18
  29. package/node/esm/{JtXI2INXnATXNbIy.mjs → B2kR5d7yN_btwSPu.mjs} +9 -7
  30. package/node/esm/{DLB7yLWLF3CYoYgq.mjs → B3fiHsOdyeQ-hH_X.mjs} +1 -1
  31. package/node/esm/{Bqq76CFUL47Gxzv9.mjs → BCgE2DMn9_S_eSSk.mjs} +13 -13
  32. package/node/esm/B_WXfCoiTjdjGFTw.mjs +26 -0
  33. package/node/esm/BjHur-Y2v2kC9PV8.mjs +156 -0
  34. package/node/esm/CJHoW3AcW0bzWuGz.mjs +52 -0
  35. package/node/esm/CKgRE7End3PwfjDJ.mjs +25 -0
  36. package/node/esm/{B220q5iXepGyNhkv.mjs → EtyY49hdotdAcmRj.mjs} +22 -22
  37. package/node/esm/index.mjs +119 -119
  38. package/node/esm/{ysEyad2ZFSLz_tlq.mjs → uQbXUzeyLOqo4POP.mjs} +1 -1
  39. package/package.json +17 -15
  40. package/types/index.d.ts +4 -2
  41. package/browser/cjs/6CSKwJbNaX76JrHk.cjs +0 -6
  42. package/browser/cjs/BVcL3i-jUQBoMe45.cjs +0 -6
  43. package/browser/cjs/BZgunhyCzDtzqWWh.cjs +0 -6
  44. package/browser/cjs/C8FVzCzhAJQdB_Oy.cjs +0 -6
  45. package/browser/cjs/Chm8zWC8ekU1Qug_.cjs +0 -20
  46. package/browser/cjs/DNznc2i6xg2iIKE9.cjs +0 -6
  47. package/browser/cjs/DrcPMnvJ8yZx-YWK.cjs +0 -7
  48. package/browser/cjs/WrGDj1nLC4-sMZKq.cjs +0 -6
  49. package/browser/esm/A_B51mAtU7xxxYD-.mjs +0 -25
  50. package/browser/esm/B_3dBo5bkIr0eZVH.mjs +0 -53
  51. package/browser/esm/BcIL0e_fUxF3JbFD.mjs +0 -46
  52. package/browser/esm/D_6ik-OgPF7G8sN7.mjs +0 -156
  53. package/browser/esm/DneV3-mqSBq1-Ies.mjs +0 -26
  54. package/browser/esm/IM-boc1h29ZmHdvy.mjs +0 -49
  55. package/node/esm/BTPfATo02Qq6ojW1.mjs +0 -25
  56. package/node/esm/Bgm2i4z2IS2cPd09.mjs +0 -157
  57. package/node/esm/CDgzja3zCRKU-fkg.mjs +0 -26
@@ -0,0 +1,156 @@
1
+ /**
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.13
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 { CommandContext as v } from "@sheetxl/react";
14
+ import { useCallbackRef as R, KeyCodes as F, DynamicIcon as k, KeyModifiers as T } from "@sheetxl/utils-react";
15
+ import { InternalWindow as w, ExhibitOptionButton as S, ExhibitDivider as E } from "@sheetxl/utils-mui";
16
+ const K = { width: "1.5rem", height: "1.5rem" }, I = n((n2) => {
17
+ const { label: i2, value: r2, options: a2, onSelect: d2, tabIndex: u2 = 0, ...f2 } = n2, [m2, g2] = o(() => M(r2, a2));
18
+ l(() => {
19
+ g2(M(r2, a2));
20
+ }, [r2, a2]);
21
+ const C2 = R((e2) => {
22
+ g2(e2.target.value), d2?.(a2[e2.target.value]);
23
+ }, [d2, a2]), b2 = s(() => Object.keys(a2).map((t2) => e(x, { value: t2, children: t2 }, t2)), [a2]);
24
+ 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 })] });
25
+ }), D = { enter: 140, exit: 140 }, A = { Formulas: C.Content.Formulas, Values: C.Content.Values, Notes: C.Content.Notes, Comments: C.Content.Comments }, B = { ...A };
26
+ delete B.Values;
27
+ const $ = { "By Rows": true, "By Columns": false }, M = (e2, t2) => {
28
+ const n2 = Object.keys(t2);
29
+ for (let i2 = 0; i2 < n2.length; i2++) {
30
+ const o2 = n2[i2];
31
+ if (t2[o2] === e2) return o2;
32
+ }
33
+ }, P = n((n2) => {
34
+ const { initialValue: s2, context: x2, onInput: h2, title: O2, onHide: y2, autoFocus: M2, ...P2 } = n2, V = s2?.replace ?? false, z = s2?.findOptions, L = z.text ?? null, W = s2?.replaceOptions, N = s2?.replaceText ?? null, j = x2?.(), H = i(null), U = i(null), G = i(null), q = i(null), J = i(null), Q = i(null), X = (e2, t2) => {
35
+ if (!t2) return;
36
+ t2.start(e2, { center: false }), setTimeout(() => t2.stop(e2), 180);
37
+ }, [Y, Z] = o(false), [_, ee] = o(false), [te, ne] = o(V), [ie, oe] = o(false), [le, re] = o(false), [se, ae] = o({ replaceText: null, replace: V, replaceOptions: null, findOptions: { text: null, matchCase: false, matchEntireCell: false, useRegex: false, orientation: b.Orientation.Row, fields: [C.Content.Formulas] }, scope: v.FindScopeOptions.Sheet }), ce = R(async (e2, t2, n3, i2) => {
38
+ if (!j) return;
39
+ const o2 = { ...se };
40
+ o2.replaceOptions = { ...o2.replaceOptions }, o2.findOptions = { ...o2.findOptions }, o2.replaceOptions.maxCount = n3 ? void 0 : 1, o2.replace = t2, t2 && se.findOptions.fields?.[0] === C.Content.Values && (o2.findOptions.fields = [C.Content.Formulas]), o2.findOptions.reverse = !e2;
41
+ const l2 = await j({ autoFocus: i2, ...o2 });
42
+ oe(0 === l2);
43
+ }, [se, j]);
44
+ l(() => {
45
+ oe(false);
46
+ }, [se, _, te]);
47
+ const pe = R((e2, t2) => {
48
+ if (e2.keyCode === F.Enter) {
49
+ if (!se.findOptions.text) return;
50
+ let n3 = true, i2 = false;
51
+ e2.shiftKey && (n3 = false), t2 ? (e2.ctrlKey && e2.altKey && (i2 = true), X(e2, i2 ? Q.current : J.current)) : X(e2, n3 ? q.current : G.current), ce(n3, t2, i2, false);
52
+ }
53
+ }, [se]), de = i(null);
54
+ r(() => {
55
+ ae((e2) => {
56
+ const t2 = { ...e2 };
57
+ t2.findOptions.text = L && L.length > 0 ? L : e2.findOptions.text ?? "", Z(true), null !== N && (t2.replaceText = N ?? ""), z && (t2.findOptions = { ...t2.findOptions, ...z }), t2.replaceText || (t2.replaceText = ""), t2.replaceOptions && (t2.replaceOptions = { ...t2.replaceOptions }), W && (t2.replaceOptions = { ...t2.replaceOptions, ...W }), se.findOptions.fields?.[0] || (se.findOptions.fields = [C.Content.Formulas]);
58
+ const n3 = !(!V && !W && null === N);
59
+ return n3 && ne(n3), t2;
60
+ }), le || de.current?.focus();
61
+ }, [s2, V, L, N, z, W]), l(() => {
62
+ te ? (se.findOptions.fields[0], C.Content.Values) : Z(true);
63
+ }, [te]), l(() => {
64
+ if (Y && H.current && se.findOptions.text === H.current.value) return H.current === document.activeElement || H.current.contains(document.activeElement) ? (H.current?.select(), void Z(false)) : void H.current.addEventListener("focus", () => {
65
+ H.current?.select(), Z(false);
66
+ }, { once: true });
67
+ }, [Y, se]);
68
+ const [ue, { width: fe }] = a();
69
+ return e(w, { ref: de, title: O2 ?? (te ? "Find & Replace" : "Find"), initialPosition: { y: "35" }, autoFocusSel: ".input", onHide: y2, onFocus: () => re(true), onBlur: () => {
70
+ re(false), oe(false);
71
+ }, slotProps: { paper: { elevation: le ? 3 : 1 } }, ...P2, children: t(d, { dividers: true, ref: ue, sx: { display: "flex", flexDirection: "column", paddingLeft: (e2) => e2.spacing(1.5), paddingRight: (e2) => e2.spacing(1.5) }, onKeyDown: (e2) => {
72
+ if ("h" === e2.key && e2.ctrlKey) ne(true), H.current?.contains(document.activeElement) && U.current?.focus();
73
+ else if ("f" === e2.key && e2.ctrlKey) H.current?.focus();
74
+ else if ("c" === e2.key && e2.altKey) ae((e3) => {
75
+ const t2 = { ...e3 };
76
+ return t2.findOptions.matchCase = !e3.findOptions.matchCase, t2;
77
+ });
78
+ else if ("e" === e2.key && e2.altKey) ae((e3) => {
79
+ const t2 = { ...e3 };
80
+ return t2.findOptions.matchEntireCell = !e3.findOptions.matchEntireCell, t2;
81
+ });
82
+ else {
83
+ if ("r" !== e2.key || !e2.altKey) return;
84
+ ae((e3) => {
85
+ const t2 = { ...e3 };
86
+ return t2.findOptions.useRegex = !e3.findOptions.useRegex, t2;
87
+ });
88
+ }
89
+ e2.preventDefault();
90
+ }, 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(S, { selected: _, onSelectToggle: (e2) => {
91
+ ee(e2);
92
+ }, preventFocus: true, label: "Toggle Additional Options", icon: e(k, { iconKey: "FindOptions" }) }), e(S, { selected: te, onSelectToggle: (e2) => {
93
+ ne(e2);
94
+ }, preventFocus: true, label: "Toggle Replace", icon: e(k, { iconKey: "FindReplaceToggle" }), shortcut: { key: te ? "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: fe > 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(S, { style: K, selected: se.findOptions.matchCase, onBlur: () => {
95
+ }, onSelectToggle: (e2) => {
96
+ ae((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(S, { style: K, selected: se.findOptions.matchEntireCell, onSelectToggle: (e2) => {
101
+ ae((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(S, { style: K, selected: se.findOptions.useRegex, onSelectToggle: (e2) => {
106
+ ae((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: H, 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) => ie ? `${e2.palette.error.main} !important` : void 0 }, "& .MuiInputLabel-outlined": { color: (e2) => ie ? `${e2.palette.error.main} !important` : void 0 } }, value: se.findOptions.text ?? "", onChange: (e2) => {
111
+ ae((t2) => {
112
+ const n3 = { ...t2 };
113
+ return n3.findOptions.text = e2.target.value, n3;
114
+ });
115
+ }, onKeyDown: (e2) => pe(e2, false), onContextMenu: (e2) => {
116
+ e2.stopPropagation();
117
+ } }), e(S, { selected: se.findOptions.reverse, onSelectToggle: (e2) => {
118
+ ce(false, false);
119
+ }, touchRippleRef: G, label: "", shortcut: { key: "Enter", modifiers: [T.Shift] }, icon: e(k, { iconKey: se.findOptions.orientation !== b.Orientation.Column ? "ArrowBack" : "ArrowUpward" }), disabled: !se.findOptions.text }), e(S, { selected: !se.findOptions.reverse, onSelectToggle: (e2) => {
120
+ ce(true, false);
121
+ }, touchRippleRef: q, label: "Next Match", shortcut: { key: "Enter" }, icon: e(k, { iconKey: se.findOptions.orientation !== b.Orientation.Column ? "ArrowForward" : "ArrowDownward" }), disabled: !se.findOptions.text })] }), e(g, { in: te, timeout: D, onExit: () => {
122
+ H.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: U, 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: se.replaceText ?? "", onChange: (e2) => {
124
+ ae((t2) => {
125
+ const n3 = { ...t2 };
126
+ return n3.replaceText = e2.target.value, n3;
127
+ });
128
+ }, onKeyDown: (e2) => pe(e2, true), onContextMenu: (e2) => {
129
+ e2.stopPropagation();
130
+ } }), e(S, { onSelectToggle: (e2) => {
131
+ ce(true, true);
132
+ }, touchRippleRef: J, label: "Replace", shortcut: { key: "Enter" }, icon: e(k, { iconKey: "FindReplace" }), disabled: !se.findOptions.text }), e(S, { onSelectToggle: (e2) => {
133
+ ce(true, true, true);
134
+ }, touchRippleRef: Q, label: "Replace All", shortcut: { key: "Enter", modifiers: [T.Ctrl, T.Alt] }, icon: e(k, { iconKey: "FindReplaceAll" }), disabled: !se.findOptions.text })] }) })] })] }), e(g, { in: _, timeout: D, onExit: () => {
135
+ H.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: fe >= 383 ? "row" : "column", justifyContent: "space-evenly", alignItems: "center", gap: (e2) => e2.spacing(1), rowGap: (e2) => e2.spacing(2) }, tabIndex: -1, children: [e(I, { label: "Within", value: se.scope, options: v.FindScopeOptions, onSelect: (e2) => {
137
+ ae((t2) => {
138
+ const n3 = { ...t2 };
139
+ return n3.scope = e2, n3;
140
+ });
141
+ } }), e(I, { label: "Search", value: se.findOptions.orientation !== b.Orientation.Column, options: $, onSelect: (e2) => {
142
+ ae((t2) => {
143
+ const n3 = { ...t2 };
144
+ return n3.findOptions.orientation = e2 ? b.Orientation.Row : b.Orientation.Column, n3;
145
+ });
146
+ } }), e(I, { label: "Look in", value: te && se.findOptions.fields?.[0] === C.Content.Values ? C.Content.Formulas : se.findOptions.fields?.[0], options: te ? B : A, onSelect: (e2) => {
147
+ ae((t2) => {
148
+ const n3 = { ...t2 };
149
+ return n3.findOptions.fields = [e2], n3;
150
+ });
151
+ } })] })] }) })] }) });
152
+ });
153
+ export {
154
+ P as FindReplaceWindow,
155
+ P as default
156
+ };
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.13
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 t, jsxs as n } from "react/jsx-runtime";
8
+ import { memo as e, useMemo as i, useState as o, useCallback as a } from "react";
9
+ import { alpha as s, getOverlayAlpha as l } from "@mui/material/styles";
10
+ import { Box as r, FormControl as p, TextField as c, InputLabel as u, Select as d, Typography as m, MenuItem as f } from "@mui/material";
11
+ import { IRange as g } from "@sheetxl/sdk";
12
+ import { useCallbackRef as x, KeyCodes as h } from "@sheetxl/utils-react";
13
+ import { OptionsDialog as y } from "@sheetxl/utils-mui";
14
+ const C = ["Autofit", "Ok", "Cancel"], O = e((e2) => {
15
+ const { initialValue: O2, context: z, onOption: v, onValidateOption: w, onInput: P, onDone: b, options: k = C, defaultOption: T = k?.[1], cancelOption: U = "Cancel", sx: D, ...F } = e2, I = i(() => z?.().getOrientation() === g.Orientation.Column, [z]), [$, M] = o(O2), [V, j] = o(false), B = a(async (t2, n2) => true, []), L = i(() => {
16
+ if (!z().toUnits) return null;
17
+ let t2 = $?.size ?? 0, n2 = "Px";
18
+ return "Px" === $.unit ? (t2 = z().toUnits?.(t2), n2 = z().getUnitText()) : (t2 = z().toPixels?.(t2), n2 = "Px"), { size: t2, unit: n2 };
19
+ }, [$?.unit, $?.size]), N = x(async (t2) => {
20
+ const n2 = t2 === U;
21
+ n2 || P?.($, t2), v?.(t2, n2, t2 === T), b?.();
22
+ }, [$, P, b, v, U, T]), R = x(async (t2) => {
23
+ if (t2.keyCode === h.Enter) {
24
+ false !== await B?.($, null) && N(T);
25
+ }
26
+ }, [$, N]), S = x(async (t2) => {
27
+ let n2 = await Promise.resolve(w?.(t2));
28
+ try {
29
+ false !== n2 && (n2 = await Promise.resolve(B?.($, t2)) ?? true);
30
+ } catch (t3) {
31
+ }
32
+ return n2 ?? true;
33
+ }, [w]), W = x((t2) => {
34
+ const n2 = { ...$, size: Number(t2.target.value) };
35
+ M(n2), B?.(n2, null);
36
+ }, [$, w]), A = x((t2) => {
37
+ const n2 = t2.target.value, e3 = { ...$, unit: n2 };
38
+ M(e3);
39
+ }, [$]), E = i(() => {
40
+ const n2 = z().getUnitText(), e3 = (n3) => t(f, { value: n3, children: n3 }, n3), i2 = [];
41
+ return i2.push(e3("Px")), i2.push(e3(n2)), i2;
42
+ }, []);
43
+ return t(y, { title: "Resize " + (I ? "Columns" : "Rows"), options: k, onDone: b, onOption: (t2) => N(t2), onValidateOption: S, defaultOption: T, cancelOption: U, autoFocusSel: ".autoFocus", sx: { width: "380px", ...D }, ...F, children: n(r, { sx: { paddingTop: (t2) => t2.spacing(0), paddingBottom: (t2) => t2.spacing(1), display: "flex", flexDirection: "column" }, children: [n(r, { sx: { rowGap: (t2) => t2.spacing(1), display: "flex", flexDirection: "row", gap: (t2) => t2.spacing(0.5), alignItems: "end", justifyContent: "center" }, children: [t(p, { sx: { paddingTop: (t2) => t2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(c, { label: "Size", onFocus: (t2) => {
44
+ V || t2.target?.select(), j(true);
45
+ }, sx: { "& .MuiFormHelperText-root": { marginTop: (t2) => t2.spacing(0.5) } }, slotProps: { inputLabel: { shrink: true }, htmlInput: { className: "autoFocus", spellCheck: false, autoComplete: "off", type: "number", inputMode: "numeric", pattern: "[0-9]*", sx: { paddingTop: (t2) => t2.spacing(1.25), paddingBottom: (t2) => t2.spacing(0.75), backgroundImage: `linear-gradient(${s("#fff", l(5))}, ${s("#fff", l(5))})` } } }, value: $.size, onChange: W, onKeyDown: R, onContextMenu: (t2) => {
46
+ t2.stopPropagation();
47
+ } }) }), n(p, { sx: { minWidth: 85 }, size: "small", children: [t(u, { children: "Unit" }), t(d, { value: $.unit, label: "Unit", onChange: A, sx: { backgroundImage: `linear-gradient(${s("#fff", l(5))}, ${s("#fff", l(5))})` }, children: E })] })] }), L && t(r, { children: n(m, { variant: "body2", component: "div", sx: { paddingLeft: (t2) => t2.spacing(2) }, children: [L.size, " ", L.unit] }) })] }) });
48
+ });
49
+ export {
50
+ O as ResizeHeaderDialog,
51
+ O as default
52
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.13
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 n } from "react/jsx-runtime";
8
+ import { memo as t, useState as o, useCallback as a } from "react";
9
+ import { Box as i, FormControlLabel as l, Checkbox as r } from "@mui/material";
10
+ import { useCallbackRef as s } from "@sheetxl/utils-react";
11
+ import { OptionsDialog as p } from "@sheetxl/utils-mui";
12
+ import { RangeInput as c } from "./index.mjs";
13
+ const d = ["Ok", "Cancel"], m = t((t2) => {
14
+ const { onInput: m2, onOption: u, onValidateOption: g, onDone: f, options: h = d, defaultOption: x = h?.[0], cancelOption: O = "Cancel", sx: b, initialValue: C, context: v, ...D } = t2, [I, N] = o(false), [T, V] = o(() => C?.hasHeader ?? false), [j, k] = o(() => C?.ranges ?? null), w = s((e2) => {
15
+ const n2 = { ...C, hasHeader: T, ranges: j }, t3 = e2 === O;
16
+ t3 || m2?.(n2), u?.(e2, t3, e2 === x), f?.({ option: e2, tableOptions: n2 });
17
+ }, [f, u, x, O, T, j, C]), y = a(async (e2, n2) => null, []);
18
+ return e(p, { title: "Insert Table", options: h, onDone: w, onValidateOption: y, defaultOption: x, cancelOption: O, autoFocusSel: ".range-input input", sx: { width: "360px", ...b }, ...D, children: n(i, { sx: { paddingTop: (e2) => e2.spacing(1), paddingBottom: (e2) => e2.spacing(0), rowGap: (e2) => e2.spacing(1), display: "flex", flexDirection: "column" }, children: [e(c, { formName: "range", value: j, onChangeInput: (e2) => k(e2), resolvedAddress: v ? v().getNames().getRanges.bind(v().getNames()) : void 0, onFocus: (e2) => {
19
+ I || e2.target?.select(), N(true);
20
+ } }), e(l, { control: e(r, { checked: T, onChange: () => V(!T) }), label: "Table has headers", labelPlacement: "end" })] }) });
21
+ });
22
+ export {
23
+ m as TableNewDialog,
24
+ m as default
25
+ };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.11
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.13
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -7,40 +7,40 @@
7
7
  import { jsx as t, jsxs as e } from "react/jsx-runtime";
8
8
  import { memo as n, useMemo as o, useState as a, useCallback as i } from "react";
9
9
  import { alpha as l, getOverlayAlpha as s } from "@mui/material/styles";
10
- import { Box as r, FormControl as p, TextField as c } from "@mui/material";
11
- import { useCallbackRef as d } from "@sheetxl/utils-react";
10
+ import { Box as r, FormControl as p, TextField as d } from "@mui/material";
11
+ import { useCallbackRef as c } 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: b = "Cancel", sx: D, ...F } = n2, v = o(() => null !== (m2 ?? h?.()?.getHyperlink()), []), w = o(() => {
14
+ const { initialValue: m2 = null, context: f, onInput: x, onOption: h, onValidateOption: T, onDone: y, options: k = g, defaultOption: C = k?.[0], cancelOption: O = "Cancel", sx: b, ...F } = n2, v = o(() => null !== (m2 ?? f?.()?.getHyperlink()), []), w = o(() => {
15
15
  let t2 = null, e2 = null;
16
16
  m2 && ("string" == typeof m2 ? e2 = m2 : t2 = m2);
17
- const n3 = t2 ?? h?.()?.getHyperlink();
17
+ const n3 = t2 ?? f?.()?.getHyperlink();
18
18
  return { address: e2 ?? n3?.getAddress() ?? "", textToDisplay: n3?.getDisplayText() ?? "" };
19
- }, [m2, h]), [H, I] = a(w.address), [P, M] = a(() => {
20
- const t2 = h?.().toTextUnformatted() ?? f;
19
+ }, [m2, f]), [D, I] = a(w.address), [P, H] = a(() => {
20
+ const t2 = f?.().toTextUnformatted() ?? w.displayText;
21
21
  return t2 === w.address ? "" : t2;
22
- }), [$, B] = a(false), L = i((t2) => {
23
- M(t2.target.value);
24
- }, []), W = i(async (t2, e2) => null, []), z = d(async (t2) => {
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
- }, [T]), E = d(async (t2) => {
22
+ }), [M, $] = a(false), B = i((t2) => {
23
+ H(t2.target.value);
24
+ }, []), L = i(async (t2, e2) => null, []), V = c(async (t2) => {
25
+ const e2 = "" === D ? null : { address: D }, n3 = t2 === O;
26
+ n3 || x?.({ address: e2?.address ?? null, displayText: P ?? null }), h?.(t2, n3, t2 === C), y?.();
27
+ }, [D, P, f, x, y, h, C, O]), W = c((t2) => {
28
+ I(t2.target.value), L(t2.target.value, null);
29
+ }, [T]), z = c(async (t2) => {
30
30
  let e2 = await Promise.resolve(T?.(t2));
31
31
  try {
32
- false !== e2 && (e2 = await W(H, t2));
32
+ false !== e2 && (e2 = await L(D, t2));
33
33
  } catch (t3) {
34
34
  }
35
35
  return e2 ?? true;
36
36
  }, [T]);
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
- $ || t2.target?.select(), B(true);
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) => {
37
+ return t(u, { title: (v ? "Edit" : "Insert") + " Link", options: k, onDone: y, onOption: (t2) => V(t2), onValidateOption: z, defaultOption: C, cancelOption: O, autoFocusSel: ".autoFocus", sx: { width: "480px", ...b }, ...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(d, { label: "Address", placeholder: "Enter a url or cell reference.", onFocus: (t2) => {
38
+ M || t2.target?.select(), $(true);
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: D, onChange: W, 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: H?.startsWith("#") ? H.substring(1) : H, onFocus: () => {
42
- B(true);
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) => {
41
+ } }) }), t(p, { sx: { paddingTop: (t2) => t2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(d, { label: "Display Text", placeholder: D?.startsWith("#") ? D.substring(1) : D, onFocus: () => {
42
+ $(true);
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: B, onContextMenu: (t2) => {
44
44
  t2.stopPropagation();
45
45
  } }) })] }) });
46
46
  });