@sheetxl/studio-mui 0.4.19 → 0.4.21

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 (98) hide show
  1. package/browser/cjs/B1KlR2XYFpYbKjYS.cjs +20 -0
  2. package/browser/cjs/{afHzhXTMVhLQJ6uC.cjs → B1RMsexbz4bNlty_.cjs} +1 -1
  3. package/browser/cjs/B32faQpVaX1tkPuc.cjs +6 -0
  4. package/browser/cjs/B3XiHrRxW1LxML7F.cjs +6 -0
  5. package/browser/cjs/BGikYpeNpjwvXUdQ.cjs +18 -0
  6. package/browser/cjs/BY5l7DteiFtb2AKy.cjs +6 -0
  7. package/browser/cjs/Bb0Hd2RE7iVWVbm8.cjs +6 -0
  8. package/browser/cjs/C3EZkRIKfQURg9hX.cjs +6 -0
  9. package/browser/cjs/C7r573AdygYrVVEJ.cjs +7 -0
  10. package/browser/cjs/DEEknE8ARp0mc7fk.cjs +6 -0
  11. package/browser/cjs/DZwzUUHda3jr5jo4.cjs +6 -0
  12. package/browser/cjs/index.cjs +2 -2
  13. package/browser/cjs/veQZSq7ekc6G1FZT.cjs +42 -0
  14. package/browser/esm/B84RbTkXZiq6XIdH.mjs +49 -0
  15. package/browser/esm/{C4lgCnqxoHUTMKx0.mjs → BLy-hRTZkVfaGrcr.mjs} +1 -1
  16. package/browser/esm/Bapmv0WdnDq3Jl_q.mjs +53 -0
  17. package/browser/esm/C0OuiugFYjsjbY8q.mjs +46 -0
  18. package/browser/esm/{6nabbOchsfGHTDbJ.mjs → CGVN-NJF8ZTm9apo.mjs} +11 -10
  19. package/browser/esm/CcLpUDzJOdfqQ8Kf.mjs +25 -0
  20. package/browser/esm/Csg-hJrzm9r4vJrm.mjs +2156 -0
  21. package/browser/esm/{DwyDpojQzn8Yb0Z3.mjs → DHf2N2UY78nZFge3.mjs} +100 -98
  22. package/browser/esm/Dlc8L0qha0mZFIkY.mjs +62 -0
  23. package/browser/esm/{Duk7LVR9m02nk_H1.mjs → Dv-0R5pQwEnowzoO.mjs} +87 -85
  24. package/browser/esm/index.mjs +29 -29
  25. package/browser/esm/mVKwmIdSj4ua1Qce.mjs +4443 -0
  26. package/browser/esm/{aeeg2i5lmw2EnSq8.mjs → sHK4zKkWLGt2hVmW.mjs} +27 -26
  27. package/licenses/dependencies.txt +71 -342
  28. package/node/esm/{C1qlFAMFUg7JxINj.mjs → 49Eux5a_I5wZ-jfq.mjs} +29 -28
  29. package/node/esm/{Svd1DLPJnYKhJsxn.mjs → B00pGeZ7sj6QOFgF.mjs} +4 -3
  30. package/node/esm/{Cqh-VwF8iLFUBQG2.mjs → BEtxwx_Ji4aFNg8V.mjs} +79 -78
  31. package/node/esm/{BOlA6nKvsuwJ8-qE.mjs → BTcBIT144Lil18l-.mjs} +13 -11
  32. package/node/esm/{SdVxzy9D4jvK5ILt.mjs → Bw_f4uhXHpg1RA6Z.mjs} +7 -6
  33. package/node/esm/CGrG-gsnGd-Pn_T2.mjs +88 -0
  34. package/node/esm/CiUfb3MQCUC2McDP.mjs +46 -0
  35. package/node/esm/D1bjybdBQ28bumrW.mjs +63 -0
  36. package/node/esm/{wuBONOGgEy1w5A3Q.mjs → Dcnd4LiYyGf2eaNl.mjs} +23 -22
  37. package/node/esm/{BbLVlH-VHXBiyGbB.mjs → DiLUM75s3D56Y6Fx.mjs} +11 -10
  38. package/node/esm/index.mjs +2378 -18426
  39. package/package.json +8 -8
  40. package/browser/cjs/9JbHyHSHGCO4uFHn.cjs +0 -7
  41. package/browser/cjs/B17ClH6YVt0_UP8s.cjs +0 -6
  42. package/browser/cjs/B9LTfguTHj9uQv3h.cjs +0 -6
  43. package/browser/cjs/BYWh4kkrXJKKl2Ju.cjs +0 -145
  44. package/browser/cjs/BYrNOLTwEhs6LHAw.cjs +0 -6
  45. package/browser/cjs/Bh8xJY_qVp_q9NdJ.cjs +0 -6
  46. package/browser/cjs/Bl5l1B_eznDfB_7v.cjs +0 -18
  47. package/browser/cjs/C1LBzI2ntslIKFn5.cjs +0 -6
  48. package/browser/cjs/CGWf__jrNH3xfu2y.cjs +0 -161
  49. package/browser/cjs/CGlk1dj000Bm5cqP.cjs +0 -7
  50. package/browser/cjs/CX_y7y31Q5qi020q.cjs +0 -6
  51. package/browser/cjs/Cby5RVhO-aNkuWsV.cjs +0 -11
  52. package/browser/cjs/D2CoaVzteKVTLz2u.cjs +0 -42
  53. package/browser/cjs/D4ge-OwnSGkzaQnk.cjs +0 -15
  54. package/browser/cjs/D54KO7Qf1gFYpUYh.cjs +0 -11
  55. package/browser/cjs/D5Hr7ebLiJgvcT0k.cjs +0 -6
  56. package/browser/cjs/D6qxm65mk30iMCfQ.cjs +0 -6
  57. package/browser/cjs/DIR6Yr7FCZPYWi4-.cjs +0 -6
  58. package/browser/cjs/DeklxocxxZiZyZ5u.cjs +0 -6
  59. package/browser/cjs/Dh2Z7N-jImJZemiw.cjs +0 -6
  60. package/browser/cjs/Dngll9GyDqkTUUmu.cjs +0 -6
  61. package/browser/cjs/KmAkK4F7kLQEM3IN.cjs +0 -12
  62. package/browser/cjs/n8wDl6JTlhLU6ZAW.cjs +0 -16
  63. package/browser/cjs/zr0HW2FkaHX7brxh.cjs +0 -110
  64. package/browser/esm/B8eNugj_qKnbe7K9.mjs +0 -59
  65. package/browser/esm/BPRkMu1MFxUWK930.mjs +0 -3803
  66. package/browser/esm/BQtrstD4gTIutZpE.mjs +0 -1467
  67. package/browser/esm/BeT_3zf80WoubGnC.mjs +0 -1352
  68. package/browser/esm/C226zpF9x3cqGDep.mjs +0 -44
  69. package/browser/esm/C52hEZh6H2W5Zw5u.mjs +0 -2250
  70. package/browser/esm/CJi45DDPGy79h3Hk.mjs +0 -1366
  71. package/browser/esm/CSAsCpXnzBKwTizz.mjs +0 -23326
  72. package/browser/esm/ChetmIXTvR3tA23A.mjs +0 -48
  73. package/browser/esm/CtAFduFwOuqSdkvi.mjs +0 -23
  74. package/browser/esm/D1mFp2w9djJ0V4vm.mjs +0 -52
  75. package/browser/esm/DA83VkmtEXnqG2ye.mjs +0 -43
  76. package/browser/esm/Dy_zBluT96wehR25.mjs +0 -46
  77. package/browser/esm/NwT_h_qyOIJUd95T.mjs +0 -392
  78. package/browser/esm/eNfgzWFw915mA1DM.mjs +0 -84
  79. package/browser/esm/i07lQ5p_zaWwjifI.mjs +0 -12
  80. package/browser/esm/mWKbTdOrhJijxGkQ.mjs +0 -13391
  81. package/browser/esm/qTwpcY21ZDbsJF8q.mjs +0 -424
  82. package/browser/esm/rOu2mn5CpwGjRPMt.mjs +0 -1672
  83. package/browser/esm/xBoO8UGcKLTEtu2_.mjs +0 -1703
  84. package/node/esm/8IRz_tiw9gL3CiTm.mjs +0 -46
  85. package/node/esm/BGuyZxOceFDiCkHS.mjs +0 -553
  86. package/node/esm/BRc35RfDs9NeSBil.mjs +0 -78
  87. package/node/esm/BWNYjBRxl8-kaqWc.mjs +0 -1706
  88. package/node/esm/Bdk5FW-41aJV-x0f.mjs +0 -392
  89. package/node/esm/C2KYv5fsjkP4dceu.mjs +0 -86
  90. package/node/esm/C7eBwbZmMMcQeZ5y.mjs +0 -1479
  91. package/node/esm/CCmhTOlFNku7bidD.mjs +0 -44
  92. package/node/esm/COWuJnOkG4AgfLpx.mjs +0 -3776
  93. package/node/esm/CcxYuxLYIW_z4w-n.mjs +0 -1378
  94. package/node/esm/DO-FR-M-Iy43f7rk.mjs +0 -60
  95. package/node/esm/DOa-YBJSa8QO8ypH.mjs +0 -1246
  96. package/node/esm/DXgMMPZD2XcdNWPg.mjs +0 -44
  97. package/node/esm/DXlF9nEg2kAr3Ykp.mjs +0 -13464
  98. package/node/esm/FcospSz9-0aW4gFs.mjs +0 -1719
@@ -1,45 +1,46 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.19
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.21
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
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
8
- import { memo as e, useMemo as o, useState as a, useCallback as i } from "react";
9
- import { alpha as s, getOverlayAlpha as l } from "@mui/material/styles/index.js";
10
- import { Box as r, FormControl as p, TextField as d } from "@mui/material";
11
- import { P as c, a as u } from "./index.mjs";
12
- const g = ["Ok", "Cancel"], m = e((e2) => {
13
- 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 } = e2, F = o(() => null !== (m2 ?? h?.()?.getHyperlink()), []), I = o(() => {
14
- let t2 = null, n2 = null;
15
- m2 && ("string" == typeof m2 ? n2 = m2 : t2 = m2);
16
- const e3 = t2 ?? h?.()?.getHyperlink();
17
- return { address: n2 ?? e3?.getAddress() ?? "", textToDisplay: e3?.getDisplayText() ?? "" };
7
+ import { jsx as t, jsxs as e } from "react/jsx-runtime";
8
+ import { memo as n, useMemo as o, useState as a, useCallback as i } from "react";
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";
12
+ import { OptionsDialog as u } from "@sheetxl/utils-mui";
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(() => {
15
+ let t2 = null, e2 = null;
16
+ m2 && ("string" == typeof m2 ? e2 = m2 : t2 = m2);
17
+ const n3 = t2 ?? h?.()?.getHyperlink();
18
+ return { address: e2 ?? n3?.getAddress() ?? "", textToDisplay: n3?.getDisplayText() ?? "" };
18
19
  }, [m2, h]), [v, w] = a(I.address), [H, M] = a(() => {
19
20
  const t2 = h?.().toTextUnformatted() ?? f;
20
21
  return t2 === I.address ? "" : t2;
21
- }), [$, j] = a(false), B = i((t2) => {
22
+ }), [$, B] = a(false), L = i((t2) => {
22
23
  M(t2.target.value);
23
- }, []), L = i(async (t2, n2) => null, []), W = c(async (t2) => {
24
- const n2 = "" === v ? null : { address: v };
25
- t2 !== P && x?.(n2, H), y?.(t2, t2 === P, t2 === O), k?.();
26
- }, [v, H, x, k, y, O, P]), z = c((t2) => {
27
- w(t2.target.value), L(t2.target.value, null);
28
- }, [T]), A = c(async (t2) => {
29
- let n2 = await Promise.resolve(T?.(t2));
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);
29
+ }, [T]), E = d(async (t2) => {
30
+ let e2 = await Promise.resolve(T?.(t2));
30
31
  try {
31
- false !== n2 && (n2 = await L(v, t2));
32
+ false !== e2 && (e2 = await W(v, t2));
32
33
  } catch (t3) {
33
34
  }
34
- return n2 ?? true;
35
+ return e2 ?? true;
35
36
  }, [T]);
36
- return t(u, { title: (F ? "Edit" : "Insert") + " Link", options: C, onDone: k, onOption: (t2) => W(t2), onValidateOption: A, defaultOption: O, cancelOption: P, autoFocusSel: ".autoFocus", sx: { width: "480px", ...b }, ...D, children: n(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) => {
37
- $ || t2.target?.select(), j(true);
38
- }, 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(${s("#fff", l(5))}, ${s("#fff", l(5))})` } } }, value: v, onChange: z, onContextMenu: (t2) => {
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) => {
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
40
  t2.stopPropagation();
40
- } }) }), t(p, { sx: { paddingTop: (t2) => t2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(d, { label: "Display Text", placeholder: v?.startsWith("#") ? v.substring(1) : v, onFocus: () => {
41
- j(true);
42
- }, 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(${s("#fff", l(5))}, ${s("#fff", l(5))})` } } }, value: H, onChange: B, onContextMenu: (t2) => {
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: () => {
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
44
  t2.stopPropagation();
44
45
  } }) })] }) });
45
46
  });
@@ -1,17 +1,18 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.19
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.21
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
8
  import { PureComponent as n, Component as i, memo as r, useState as o, useCallback as s, useLayoutEffect as a } from "react";
9
- import { useTheme as l } from "@mui/material/styles/index.js";
9
+ import { useTheme as l } from "@mui/material/styles";
10
10
  import { Box as h } from "@mui/material";
11
11
  import p from "tinycolor2";
12
12
  import { Alpha as d, Hue as c } from "react-color/es/components/common/index.js";
13
13
  import g from "react-color/es/components/sketch/SketchFields.js";
14
- import { q as u, C as b } from "./index.mjs";
14
+ import { ReactUtils as u } from "@sheetxl/utils-react";
15
+ import { C as b } from "./index.mjs";
15
16
  class m extends (n || i) {
16
17
  constructor(e2) {
17
18
  super(e2), this.handleChange = (e3) => {
@@ -1,61 +1,62 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.19
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.21
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
- import { jsx as e, jsxs as n } from "react/jsx-runtime";
8
- import { memo as t, useRef as i, useState as o, useEffect as l, useLayoutEffect as r, useMemo as s } from "react";
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
9
  import { useMeasure as a } from "react-use";
10
- import { alpha as c, getOverlayAlpha as p } from "@mui/material/styles/index.js";
10
+ import { alpha as c, getOverlayAlpha as p } from "@mui/material/styles";
11
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 C } from "@mui/material";
12
12
  import { ArrowBack as y, ArrowUpward as b, ArrowForward as T, ArrowDownward as v } from "@mui/icons-material";
13
13
  import { ICell as k, IRange as R } from "@sheetxl/sdk";
14
- import { P as E, T as S, z as F, f as I, b as w, r as D, E as P, o as K, l as $, i as A, s as M, c as j, d as B, e as L } from "./index.mjs";
15
- const V = t((t2) => {
16
- const { label: i2, value: r2, options: a2, onSelect: d2, tabIndex: u2 = 0, ...f2 } = t2, [m2, g2] = o(() => U(r2, a2));
14
+ import { useCallbackRef as E, KeyCodes as S, KeyModifiers as F } from "@sheetxl/utils-react";
15
+ import { InternalWindow as I, ExhibitOptionButton as w, themeIcon as D, FindOptionsIcon as P, FindReplaceToggleIcon as K, FindCaseSensitiveIcon as $, FindWholeWordIcon as A, FindRegExIcon as M, FindReplaceIcon as B, FindReplaceAllIcon as L, ExhibitDivider as V } from "@sheetxl/utils-mui";
16
+ const N = n((n2) => {
17
+ const { label: i2, value: r2, options: a2, onSelect: d2, tabIndex: u2 = 0, ...f2 } = n2, [m2, g2] = o(() => U(r2, a2));
17
18
  l(() => {
18
19
  g2(U(r2, a2));
19
20
  }, [r2, a2]);
20
21
  const y2 = E((e2) => {
21
22
  g2(e2.target.value), d2?.(a2[e2.target.value]);
22
- }, [d2, a2]), b2 = s(() => Object.keys(a2).map((n2) => e(x, { value: n2, children: n2 }, n2)), [a2]);
23
- return n(h, { sx: { minWidth: 135 }, size: "small", children: [e(O, { children: i2 }), e(C, { inputProps: { tabIndex: u2 }, value: m2, label: i2, onChange: y2, sx: { backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, ...f2, children: b2 })] });
24
- }), N = { Workbook: "workbook", Sheet: "sheet" }, W = { enter: 140, exit: 140 }, z = { Formulas: k.Content.Formulas, Values: k.Content.Values, Notes: k.Content.Notes, Comments: k.Content.Comments }, H = { ...z };
25
- delete H.Values;
26
- const G = { "By Rows": true, "By Columns": false }, U = (e2, n2) => {
27
- const t2 = Object.keys(n2);
28
- for (let i2 = 0; i2 < t2.length; i2++) {
29
- const o2 = t2[i2];
30
- if (n2[o2] === e2) return o2;
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(C, { inputProps: { tabIndex: u2 }, value: m2, label: i2, onChange: y2, sx: { backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, ...f2, children: b2 })] });
25
+ }), W = { Workbook: "workbook", Sheet: "sheet" }, j = { enter: 140, exit: 140 }, H = { Formulas: k.Content.Formulas, Values: k.Content.Values, Notes: k.Content.Notes, Comments: k.Content.Comments }, z = { ...H };
26
+ delete z.Values;
27
+ const G = { "By Rows": true, "By Columns": false }, U = (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;
31
32
  }
32
- }, X = t((t2) => {
33
- const { replace: s2 = false, findText: x2, replaceText: h2, findOptions: O2, replaceOptions: C2, title: U2, onHide: X2, onFindOrReplace: q, ...J } = t2, Q = i(null), Y = i(null), Z = i(null), _ = i(null), ee = i(null), ne = i(null), te = (e2, n2) => {
34
- if (!n2) return;
35
- n2.start(e2, { center: false }), setTimeout(() => n2.stop(e2), 180);
36
- }, [ie, oe] = o(false), [le, re] = o(false), [se, ae] = o(s2), [ce, pe] = o(false), [de, ue] = o(false), [fe, me] = o({ findText: null, replaceText: null, replace: s2, replaceOptions: {}, findOptions: { matchCase: false, matchEntireCell: false, useRegex: false, orientation: R.Orientation.Row, fields: [k.Content.Formulas] }, scope: N.Sheet }), ge = E(async (e2, n2, t3, i2) => {
33
+ }, X = n((n2) => {
34
+ const { replace: s2 = false, findText: x2, replaceText: h2, findOptions: O2, replaceOptions: C2, title: U2, onHide: X2, onFindOrReplace: q, ...J } = n2, Q = i(null), Y = i(null), Z = i(null), _ = i(null), ee = i(null), te = i(null), ne = (e2, t2) => {
35
+ if (!t2) return;
36
+ t2.start(e2, { center: false }), setTimeout(() => t2.stop(e2), 180);
37
+ }, [ie, oe] = o(false), [le, re] = o(false), [se, ae] = o(s2), [ce, pe] = o(false), [de, ue] = o(false), [fe, me] = o({ findText: null, replaceText: null, replace: s2, replaceOptions: {}, findOptions: { matchCase: false, matchEntireCell: false, useRegex: false, orientation: R.Orientation.Row, fields: [k.Content.Formulas] }, scope: W.Sheet }), ge = E(async (e2, t2, n3, i2) => {
37
38
  if (!q) return;
38
39
  const o2 = { ...fe };
39
- o2.replaceOptions = { ...o2.replaceOptions }, o2.findOptions = { ...o2.findOptions }, o2.replaceOptions.maxCount = t3 ? void 0 : 1, o2.replace = n2, n2 && fe.findOptions.fields?.[0] === k.Content.Values && (o2.findOptions.fields = [k.Content.Formulas]), o2.findOptions.reverse = !e2;
40
+ o2.replaceOptions = { ...o2.replaceOptions }, o2.findOptions = { ...o2.findOptions }, o2.replaceOptions.maxCount = n3 ? void 0 : 1, o2.replace = t2, t2 && fe.findOptions.fields?.[0] === k.Content.Values && (o2.findOptions.fields = [k.Content.Formulas]), o2.findOptions.reverse = !e2;
40
41
  const l2 = await q({ autoFocus: i2, ...o2 });
41
42
  pe(0 === l2);
42
43
  }, [fe, q]);
43
44
  l(() => {
44
45
  pe(false);
45
46
  }, [fe, le, se]);
46
- const xe = E((e2, n2) => {
47
+ const xe = E((e2, t2) => {
47
48
  if (e2.keyCode === S.Enter) {
48
49
  if (!fe.findText) return;
49
- let t3 = true, i2 = false;
50
- e2.shiftKey && (t3 = false), n2 ? (e2.ctrlKey && e2.altKey && (i2 = true), te(e2, i2 ? ne.current : ee.current)) : te(e2, t3 ? _.current : Z.current), ge(t3, n2, i2, false);
50
+ let n3 = true, i2 = false;
51
+ e2.shiftKey && (n3 = false), t2 ? (e2.ctrlKey && e2.altKey && (i2 = true), ne(e2, i2 ? te.current : ee.current)) : ne(e2, n3 ? _.current : Z.current), ge(n3, t2, i2, false);
51
52
  }
52
53
  }, [fe]), he = i(null);
53
54
  r(() => {
54
55
  me((e2) => {
55
- const n2 = { ...e2 };
56
- n2.findText = x2 && x2.length > 0 ? x2 : e2.findText ?? "", oe(true), void 0 !== h2 && (n2.replaceText = h2), O2 && (n2.findOptions = { ...n2.findOptions, ...O2 }), n2.replaceText || (n2.replaceText = ""), n2.replaceOptions && (n2.replaceOptions = { ...n2.replaceOptions }), C2 && (n2.replaceOptions = { ...n2.replaceOptions, ...C2 }), fe.findOptions.fields?.[0] || (fe.findOptions.fields = [k.Content.Formulas]);
57
- const t3 = !(!C2 && void 0 === h2);
58
- return t3 && ae(t3), n2;
56
+ const t2 = { ...e2 };
57
+ t2.findText = x2 && x2.length > 0 ? x2 : e2.findText ?? "", oe(true), void 0 !== h2 && (t2.replaceText = h2), O2 && (t2.findOptions = { ...t2.findOptions, ...O2 }), t2.replaceText || (t2.replaceText = ""), t2.replaceOptions && (t2.replaceOptions = { ...t2.replaceOptions }), C2 && (t2.replaceOptions = { ...t2.replaceOptions, ...C2 }), fe.findOptions.fields?.[0] || (fe.findOptions.fields = [k.Content.Formulas]);
58
+ const n3 = !(!C2 && void 0 === h2);
59
+ return n3 && ae(n3), t2;
59
60
  }), de || he.current?.focus();
60
61
  }, [x2, h2, O2, C2]), l(() => {
61
62
  se ? (fe.findOptions.fields[0], k.Content.Values) : oe(true);
@@ -65,91 +66,91 @@ const G = { "By Rows": true, "By Columns": false }, U = (e2, n2) => {
65
66
  }, { once: true });
66
67
  }, [ie, fe]);
67
68
  const [Oe, { width: Ce }] = a();
68
- return e(F, { ref: he, title: U2 ?? (se ? "Find & Replace" : "Find"), initialPosition: { y: "35" }, autoFocusSel: ".input", onHide: X2, onFocus: () => ue(true), onBlur: () => {
69
+ return e(I, { ref: he, title: U2 ?? (se ? "Find & Replace" : "Find"), initialPosition: { y: "35" }, autoFocusSel: ".input", onHide: X2, onFocus: () => ue(true), onBlur: () => {
69
70
  ue(false), pe(false);
70
- }, PaperProps: { elevation: de ? 3 : 1 }, ...J, children: n(d, { dividers: true, ref: Oe, sx: { display: "flex", flexDirection: "column", paddingLeft: (e2) => e2.spacing(1.5), paddingRight: (e2) => e2.spacing(1.5) }, onKeyDown: (e2) => {
71
+ }, PaperProps: { elevation: de ? 3 : 1 }, ...J, children: t(d, { dividers: true, ref: Oe, sx: { display: "flex", flexDirection: "column", paddingLeft: (e2) => e2.spacing(1.5), paddingRight: (e2) => e2.spacing(1.5) }, onKeyDown: (e2) => {
71
72
  if ("h" === e2.key && e2.ctrlKey) ae(true), Q.current?.contains(document.activeElement) && Y.current?.focus();
72
73
  else if ("f" === e2.key && e2.ctrlKey) Q.current?.focus();
73
74
  else if ("c" === e2.key && e2.altKey) me((e3) => {
74
- const n2 = { ...e3 };
75
- return n2.findOptions.matchCase = !e3.findOptions.matchCase, n2;
75
+ const t2 = { ...e3 };
76
+ return t2.findOptions.matchCase = !e3.findOptions.matchCase, t2;
76
77
  });
77
78
  else if ("e" === e2.key && e2.altKey) me((e3) => {
78
- const n2 = { ...e3 };
79
- return n2.findOptions.matchEntireCell = !e3.findOptions.matchEntireCell, n2;
79
+ const t2 = { ...e3 };
80
+ return t2.findOptions.matchEntireCell = !e3.findOptions.matchEntireCell, t2;
80
81
  });
81
82
  else {
82
83
  if ("r" !== e2.key || !e2.altKey) return;
83
84
  me((e3) => {
84
- const n2 = { ...e3 };
85
- return n2.findOptions.useRegex = !e3.findOptions.useRegex, n2;
85
+ const t2 = { ...e3 };
86
+ return t2.findOptions.useRegex = !e3.findOptions.useRegex, t2;
86
87
  });
87
88
  }
88
89
  e2.preventDefault();
89
- }, children: [n(u, { sx: { display: "flex", flexDirection: "row", gap: (e2) => e2.spacing(1) }, children: [n(u, { sx: { display: "flex", flexDirection: "row", alignItems: "start", gap: (e2) => e2.spacing(0.25), paddingTop: "3px" }, children: [e(I, { selected: le, onSelectToggle: (e2) => {
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(w, { selected: le, onSelectToggle: (e2) => {
90
91
  re(e2);
91
- }, preventFocus: true, label: "Toggle Additional Options", icon: w(e(D, {})) }), e(I, { selected: se, onSelectToggle: (e2) => {
92
+ }, preventFocus: true, label: "Toggle Additional Options", icon: D(e(P, {})) }), e(w, { selected: se, onSelectToggle: (e2) => {
92
93
  ae(e2);
93
- }, preventFocus: true, label: "Toggle Replace", icon: w(e(K, {})), shortcut: { key: se ? "F" : "H", modifiers: [P.Ctrl] } })] }), n(u, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", boxSizing: "border-box" }, children: [n(u, { sx: { display: "flex", flexDirection: "row", alignItems: "center" }, children: [e(f, { label: "Find", InputLabelProps: { shrink: true }, InputProps: { sx: { paddingRight: (e2) => e2.spacing(1), minWidth: Ce > 460 ? "20em" : void 0, backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, inputProps: { draggable: false, ref: Q, className: "input", autoFocus: true, spellCheck: false, autoComplete: "off", sx: { paddingTop: (e2) => e2.spacing(1.25), paddingBottom: (e2) => e2.spacing(0.75) } }, endAdornment: e(m, { sx: { transform: "scale(0.75) translateX(16px)" }, position: "end", children: n(u, { sx: { display: "flex", alignItems: "center", flexDirection: "row", gap: "1px" }, children: [e(I, { selected: fe.findOptions.matchCase, onSelectToggle: (e2) => {
94
- me((n2) => {
95
- const t3 = { ...n2 };
96
- return t3.findOptions.matchCase = e2, t3;
94
+ }, preventFocus: true, label: "Toggle Replace", icon: D(e(K, {})), shortcut: { key: se ? "F" : "H", modifiers: [F.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", InputLabelProps: { shrink: true }, InputProps: { sx: { paddingRight: (e2) => e2.spacing(1), minWidth: Ce > 460 ? "20em" : void 0, backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, inputProps: { draggable: false, ref: Q, className: "input", autoFocus: true, spellCheck: false, autoComplete: "off", sx: { paddingTop: (e2) => e2.spacing(1.25), paddingBottom: (e2) => e2.spacing(0.75) } }, endAdornment: e(m, { sx: { transform: "scale(0.75) translateX(16px)" }, position: "end", children: t(u, { sx: { display: "flex", alignItems: "center", flexDirection: "row", gap: "1px" }, children: [e(w, { selected: fe.findOptions.matchCase, onSelectToggle: (e2) => {
95
+ me((t2) => {
96
+ const n3 = { ...t2 };
97
+ return n3.findOptions.matchCase = e2, n3;
97
98
  });
98
- }, label: "Match Case", shortcut: { key: "C", modifiers: [P.Alt] }, icon: w(e($, {})) }), e(I, { selected: fe.findOptions.matchEntireCell, onSelectToggle: (e2) => {
99
- me((n2) => {
100
- const t3 = { ...n2 };
101
- return t3.findOptions.matchEntireCell = e2, t3;
99
+ }, label: "Match Case", shortcut: { key: "C", modifiers: [F.Alt] }, icon: D(e($, {})) }), e(w, { selected: fe.findOptions.matchEntireCell, onSelectToggle: (e2) => {
100
+ me((t2) => {
101
+ const n3 = { ...t2 };
102
+ return n3.findOptions.matchEntireCell = e2, n3;
102
103
  });
103
- }, label: "Match Entire Cell", shortcut: { key: "E", modifiers: [P.Alt] }, icon: w(e(A, {})) }), e(I, { selected: fe.findOptions.useRegex, onSelectToggle: (e2) => {
104
- me((n2) => {
105
- const t3 = { ...n2 };
106
- return t3.findOptions.useRegex = e2, t3;
104
+ }, label: "Match Entire Cell", shortcut: { key: "E", modifiers: [F.Alt] }, icon: D(e(A, {})) }), e(w, { selected: fe.findOptions.useRegex, onSelectToggle: (e2) => {
105
+ me((t2) => {
106
+ const n3 = { ...t2 };
107
+ return n3.findOptions.useRegex = e2, n3;
107
108
  });
108
- }, label: "Use Regular Expression", shortcut: { key: "R", modifiers: [P.Alt] }, icon: w(e(M, {})) })] }) }) }, sx: { flex: "1 1 100%", marginRight: (e2) => e2.spacing(1), "& .MuiOutlinedInput-notchedOutline": { borderColor: (e2) => ce ? `${e2.palette.error.main} !important` : void 0 }, "& .MuiInputLabel-outlined": { color: (e2) => ce ? `${e2.palette.error.main} !important` : void 0 } }, value: fe.findText ?? "", onChange: (e2) => {
109
- me((n2) => {
110
- const t3 = { ...n2 };
111
- return t3.findText = e2.target.value, t3;
109
+ }, label: "Use Regular Expression", shortcut: { key: "R", modifiers: [F.Alt] }, icon: D(e(M, {})) })] }) }) }, sx: { flex: "1 1 100%", marginRight: (e2) => e2.spacing(1), "& .MuiOutlinedInput-notchedOutline": { borderColor: (e2) => ce ? `${e2.palette.error.main} !important` : void 0 }, "& .MuiInputLabel-outlined": { color: (e2) => ce ? `${e2.palette.error.main} !important` : void 0 } }, value: fe.findText ?? "", onChange: (e2) => {
110
+ me((t2) => {
111
+ const n3 = { ...t2 };
112
+ return n3.findText = e2.target.value, n3;
112
113
  });
113
114
  }, onKeyDown: (e2) => xe(e2, false), onContextMenu: (e2) => {
114
115
  e2.stopPropagation();
115
- } }), e(I, { selected: fe.findOptions.reverse, onSelectToggle: (e2) => {
116
+ } }), e(w, { selected: fe.findOptions.reverse, onSelectToggle: (e2) => {
116
117
  ge(false, false);
117
- }, touchRippleRef: Z, label: "", shortcut: { key: "Enter", modifiers: [P.Shift] }, icon: w(fe.findOptions.orientation !== R.Orientation.Column ? e(y, {}) : e(b, {})), disabled: !fe.findText }), e(I, { selected: !fe.findOptions.reverse, onSelectToggle: (e2) => {
118
+ }, touchRippleRef: Z, label: "", shortcut: { key: "Enter", modifiers: [F.Shift] }, icon: D(fe.findOptions.orientation !== R.Orientation.Column ? e(y, {}) : e(b, {})), disabled: !fe.findText }), e(w, { selected: !fe.findOptions.reverse, onSelectToggle: (e2) => {
118
119
  ge(true, false);
119
- }, touchRippleRef: _, label: "Next Match", shortcut: { key: "Enter" }, icon: w(fe.findOptions.orientation !== R.Orientation.Column ? e(T, {}) : e(v, {})), disabled: !fe.findText })] }), e(g, { in: se, timeout: W, onExit: () => {
120
+ }, touchRippleRef: _, label: "Next Match", shortcut: { key: "Enter" }, icon: D(fe.findOptions.orientation !== R.Orientation.Column ? e(T, {}) : e(v, {})), disabled: !fe.findText })] }), e(g, { in: se, timeout: j, onExit: () => {
120
121
  Q.current?.focus();
121
- }, children: n(u, { sx: { display: "flex", flexDirection: "row", alignItems: "center", marginTop: (e2) => e2.spacing(2) }, children: [e(f, { label: "Replace", InputLabelProps: { shrink: true }, InputProps: { sx: { paddingRight: (e2) => e2.spacing(1), backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, inputProps: { ref: Y, 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: fe.replaceText ?? "", onChange: (e2) => {
122
- me((n2) => {
123
- const t3 = { ...n2 };
124
- return t3.replaceText = e2.target.value, t3;
122
+ }, children: t(u, { sx: { display: "flex", flexDirection: "row", alignItems: "center", marginTop: (e2) => e2.spacing(2) }, children: [e(f, { label: "Replace", InputLabelProps: { shrink: true }, InputProps: { sx: { paddingRight: (e2) => e2.spacing(1), backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, inputProps: { ref: Y, 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: fe.replaceText ?? "", onChange: (e2) => {
123
+ me((t2) => {
124
+ const n3 = { ...t2 };
125
+ return n3.replaceText = e2.target.value, n3;
125
126
  });
126
127
  }, onKeyDown: (e2) => xe(e2, true), onContextMenu: (e2) => {
127
128
  e2.stopPropagation();
128
- } }), e(I, { onSelectToggle: (e2) => {
129
+ } }), e(w, { onSelectToggle: (e2) => {
129
130
  ge(true, true);
130
- }, touchRippleRef: ee, label: "Replace", shortcut: { key: "Enter" }, icon: w(e(j, {})), disabled: !fe.findText }), e(I, { onSelectToggle: (e2) => {
131
+ }, touchRippleRef: ee, label: "Replace", shortcut: { key: "Enter" }, icon: D(e(B, {})), disabled: !fe.findText }), e(w, { onSelectToggle: (e2) => {
131
132
  ge(true, true, true);
132
- }, touchRippleRef: ne, label: "Replace All", shortcut: { key: "Enter", modifiers: [P.Ctrl, P.Alt] }, icon: w(e(B, {})), disabled: !fe.findText })] }) })] })] }), e(g, { in: le, timeout: W, onExit: () => {
133
+ }, touchRippleRef: te, label: "Replace All", shortcut: { key: "Enter", modifiers: [F.Ctrl, F.Alt] }, icon: D(e(L, {})), disabled: !fe.findText })] }) })] })] }), e(g, { in: le, timeout: j, onExit: () => {
133
134
  Q.current?.focus();
134
- }, children: n(u, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", gap: (e2) => e2.spacing(0.5), marginTop: (e2) => e2.spacing(1) }, children: [e(L, { orientation: "horizontal", sx: { marginBottom: (e2) => e2.spacing(1.5) } }), n(u, { sx: { display: "flex", flexDirection: Ce >= 413 ? "row" : "column", justifyContent: "space-evenly", alignItems: "center", rowGap: (e2) => e2.spacing(2) }, tabIndex: -1, children: [e(V, { label: "Within", value: fe.scope, options: N, onSelect: (e2) => {
135
- me((n2) => {
136
- const t3 = { ...n2 };
137
- return t3.scope = e2, t3;
135
+ }, children: t(u, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", gap: (e2) => e2.spacing(0.5), marginTop: (e2) => e2.spacing(1) }, children: [e(V, { orientation: "horizontal", sx: { marginBottom: (e2) => e2.spacing(1.5) } }), t(u, { sx: { display: "flex", flexDirection: Ce >= 413 ? "row" : "column", justifyContent: "space-evenly", alignItems: "center", rowGap: (e2) => e2.spacing(2) }, tabIndex: -1, children: [e(N, { label: "Within", value: fe.scope, options: W, onSelect: (e2) => {
136
+ me((t2) => {
137
+ const n3 = { ...t2 };
138
+ return n3.scope = e2, n3;
138
139
  });
139
- } }), e(V, { label: "Search", value: fe.findOptions.orientation !== R.Orientation.Column, options: G, onSelect: (e2) => {
140
- me((n2) => {
141
- const t3 = { ...n2 };
142
- return t3.findOptions.orientation = e2 ? R.Orientation.Row : R.Orientation.Column, t3;
140
+ } }), e(N, { label: "Search", value: fe.findOptions.orientation !== R.Orientation.Column, options: G, onSelect: (e2) => {
141
+ me((t2) => {
142
+ const n3 = { ...t2 };
143
+ return n3.findOptions.orientation = e2 ? R.Orientation.Row : R.Orientation.Column, n3;
143
144
  });
144
- } }), e(V, { label: "Look in", value: se && fe.findOptions.fields?.[0] === k.Content.Values ? k.Content.Formulas : fe.findOptions.fields?.[0], options: se ? H : z, onSelect: (e2) => {
145
- me((n2) => {
146
- const t3 = { ...n2 };
147
- return t3.findOptions.fields = [e2], t3;
145
+ } }), e(N, { label: "Look in", value: se && fe.findOptions.fields?.[0] === k.Content.Values ? k.Content.Formulas : fe.findOptions.fields?.[0], options: se ? z : H, onSelect: (e2) => {
146
+ me((t2) => {
147
+ const n3 = { ...t2 };
148
+ return n3.findOptions.fields = [e2], n3;
148
149
  });
149
150
  } })] })] }) })] }) });
150
151
  });
151
152
  export {
152
153
  X as FindReplaceWindow,
153
- N as ScopeOptions,
154
+ W as ScopeOptions,
154
155
  X as default
155
156
  };
@@ -1,23 +1,25 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.19
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.21
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 { jsx as e, jsxs as n } from "react/jsx-runtime";
8
- import { memo as t, useState as a, useCallback as o } from "react";
8
+ import { memo as t, useState as o, useCallback as a } from "react";
9
9
  import { Box as i, FormControlLabel as l, Checkbox as s } from "@mui/material";
10
- import { P as r, a as p, RangeInput as c } from "./index.mjs";
11
- const d = ["Ok", "Cancel"], m = t((t2) => {
12
- const { tableOptions: m2, context: g, onOption: u, onValidateOption: f, onDone: h, options: x = d, defaultOption: O = x?.[0], cancelOption: b = "Cancel", sx: C, ...D } = t2, [N, T] = a(false), [j, k] = a(() => m2?.hasHeader ?? false), [v, w] = a(() => m2?.ranges ?? null), y = r((e2) => {
13
- const n2 = { ...m2, hasHeader: j, ranges: v };
14
- u?.(e2, e2 === b, e2 === O), h?.({ option: e2, tableOptions: n2 });
15
- }, [h, u, O, b, j, v, m2]), F = o(async (e2, n2) => null, []);
16
- return e(p, { title: "Insert Table", options: x, onDone: y, onValidateOption: F, defaultOption: O, cancelOption: b, autoFocusSel: ".range-input input", sx: { width: "360px", ...C }, ...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: v, onChangeInput: (e2) => w(e2), resolvedAddress: g.getNames().getRanges.bind(g.getNames()), onFocus: (e2) => {
10
+ import { useCallbackRef as r } from "@sheetxl/utils-react";
11
+ import { OptionsDialog as p } from "@sheetxl/utils-mui";
12
+ import { RangeInput as c } from "./index.mjs";
13
+ const m = ["Ok", "Cancel"], d = t((t2) => {
14
+ const { tableOptions: d2, context: u, onOption: g, onValidateOption: f, onDone: h, options: x = m, defaultOption: O = x?.[0], cancelOption: b = "Cancel", sx: C, ...D } = t2, [N, T] = o(false), [j, k] = o(() => d2?.hasHeader ?? false), [v, w] = o(() => d2?.ranges ?? null), y = r((e2) => {
15
+ const n2 = { ...d2, hasHeader: j, ranges: v };
16
+ g?.(e2, e2 === b, e2 === O), h?.({ option: e2, tableOptions: n2 });
17
+ }, [h, g, O, b, j, v, d2]), F = a(async (e2, n2) => null, []);
18
+ return e(p, { title: "Insert Table", options: x, onDone: y, onValidateOption: F, defaultOption: O, cancelOption: b, autoFocusSel: ".range-input input", sx: { width: "360px", ...C }, ...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: v, onChangeInput: (e2) => w(e2), resolvedAddress: u.getNames().getRanges.bind(u.getNames()), onFocus: (e2) => {
17
19
  N || e2.target?.select(), T(true);
18
20
  } }), e(l, { control: e(s, { checked: j, onChange: () => k(!j) }), label: "Table has headers", labelPlacement: "end" })] }) });
19
21
  });
20
22
  export {
21
- m as TableNewDialog,
22
- m as default
23
+ d as TableNewDialog,
24
+ d as default
23
25
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.19
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.21
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -8,13 +8,14 @@ import { jsx as e, jsxs as n } from "react/jsx-runtime";
8
8
  import { useState as t } from "react";
9
9
  import { Box as i, FormControlLabel as o, Checkbox as l } from "@mui/material";
10
10
  import { Sort as r, IRange as a } from "@sheetxl/sdk";
11
- import { P as s, a as c } from "./index.mjs";
12
- const d = ({ range: d2, options: m, cell: p, onDone: h, ...u }) => {
11
+ import { useCallbackRef as s } from "@sheetxl/utils-react";
12
+ import { OptionsDialog as c } from "@sheetxl/utils-mui";
13
+ const d = ({ range: d2, options: m, cell: p, onDone: u, ...h }) => {
13
14
  const [v, C] = t(m ?? r.DefaultRangeOptions), O = s((e2) => {
14
15
  let n2 = null;
15
- "Sort" === e2 && (n2 = { ...m, options: v }), h?.(n2);
16
- }, [v, h, m]);
17
- return e(c, { title: "Sort", options: ["Sort", "Cancel"], onDone: O, ...u, children: n(i, { sx: { display: "flex", flexDirection: "column" }, children: [e(o, { control: e(l, { checked: !v.reverse, onChange: () => C((e2) => ({ ...e2, reverse: !e2.reverse })) }), label: "Is Ascending", labelPlacement: "end" }), e(o, { control: e(l, { checked: v.hasHeader, onChange: () => C((e2) => ({ ...e2, hasHeader: !e2.hasHeader })) }), label: "Has Header", labelPlacement: "end" }), e(o, { control: e(l, { checked: v.collatorOptions?.sensitivity === r.CaseSensitiveOptions.sensitivity, onChange: () => C((e2) => ({ ...e2, collatorOptions: v.collatorOptions?.sensitivity === r.CaseSensitiveOptions.sensitivity ? r.CaseInsensitiveOptions : r.CaseSensitiveOptions })) }), label: "Case Sensitive", labelPlacement: "end" }), e(o, { control: e(l, { checked: v.orientation === a.Orientation.Row, onChange: () => C((e2) => {
16
+ "Sort" === e2 && (n2 = { ...m, options: v }), u?.(n2);
17
+ }, [v, u, m]);
18
+ return e(c, { title: "Sort", options: ["Sort", "Cancel"], onDone: O, ...h, children: n(i, { sx: { display: "flex", flexDirection: "column" }, children: [e(o, { control: e(l, { checked: !v.reverse, onChange: () => C((e2) => ({ ...e2, reverse: !e2.reverse })) }), label: "Is Ascending", labelPlacement: "end" }), e(o, { control: e(l, { checked: v.hasHeader, onChange: () => C((e2) => ({ ...e2, hasHeader: !e2.hasHeader })) }), label: "Has Header", labelPlacement: "end" }), e(o, { control: e(l, { checked: v.collatorOptions?.sensitivity === r.CaseSensitiveOptions.sensitivity, onChange: () => C((e2) => ({ ...e2, collatorOptions: v.collatorOptions?.sensitivity === r.CaseSensitiveOptions.sensitivity ? r.CaseInsensitiveOptions : r.CaseSensitiveOptions })) }), label: "Case Sensitive", labelPlacement: "end" }), e(o, { control: e(l, { checked: v.orientation === a.Orientation.Row, onChange: () => C((e2) => {
18
19
  const n2 = e2.orientation === a.Orientation.Row ? a.Orientation.Column : a.Orientation.Row;
19
20
  return { ...d2.getDefaultSortCriteria(n2, p).options, includeHidden: e2.includeHidden, reverse: e2.reverse, orientation: n2 };
20
21
  }) }), label: "Row Sort", labelPlacement: "end" }), e(o, { control: e(l, { checked: v.includeHidden, onChange: () => C((e2) => ({ ...e2, includeHidden: !e2.includeHidden })) }), label: "Include Hidden", labelPlacement: "end" })] }) });
@@ -0,0 +1,88 @@
1
+ /**
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.21
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 { 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";
15
+ import { AutoSizer as k, Table as v, Column as $ } from "react-virtualized";
16
+ 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 {
19
+ constructor() {
20
+ super(...arguments), this.getRowClassName = ({ index: e2 }) => {
21
+ 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 });
27
+ }, 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 }) });
30
+ };
31
+ }
32
+ static {
33
+ this.defaultProps = { headerHeight: 40, rowHeight: 48 };
34
+ }
35
+ 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) => {
38
+ 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);
40
+ }) }) });
41
+ }
42
+ }
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" } }));
44
+ function _(s2) {
45
+ const { commands: c2, ...p2 } = s2, [m2, u2] = g(false), [b2, R2] = g(""), k2 = f(() => {
46
+ let e2 = c2.getAllCommands();
47
+ m2 || (e2 = e2.filter((e3) => e3.command.shortcut())), e2.sort((e3, t3) => e3.command.label().localeCompare(t3.command.label()));
48
+ const t2 = [], i2 = (e3) => e3.replace(/\n\n/g, "\n");
49
+ 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() });
55
+ }
56
+ return t2;
57
+ }, [m2, c2]), [v2, $2] = g(null);
58
+ x(() => {
59
+ import("fuse.js").then((e2) => {
60
+ $2(new e2.default(k2, { threshold: 0, ignoreLocation: true, keys: ["label", "description"] }));
61
+ });
62
+ }, [k2]);
63
+ const [I2, K2] = g(k2), z2 = b2.length > 0 && 0 === I2.length;
64
+ x(() => {
65
+ 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);
68
+ for (let i2 = 0; i2 < e2.length; i2++) t2[i2] = e2[i2].item;
69
+ K2(t2);
70
+ }, 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) => {
73
+ R2(e2.target.value);
74
+ }, onKeyDown: (e2) => {
75
+ e2.which === h.Escape && b2.length > 0 && (R2(""), e2.stopPropagation(), e2.preventDefault());
76
+ }, onContextMenu: (e2) => {
77
+ 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" : ""}` }) })] });
79
+ }
80
+ const P = (e2) => {
81
+ const { title: i2 = "Shortcut Keys", commands: n2, sx: r2, ...o2 } = e2;
82
+ return t(m, { isModal: true, onKeyDown: (e3) => {
83
+ 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" } }) }) });
85
+ };
86
+ export {
87
+ P as default
88
+ };
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.21
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 a, useMemo as n, useState as l, useCallback as o } from "react";
9
+ import { Box as i } from "@mui/material";
10
+ import { useCallbackRef as r } from "@sheetxl/utils-react";
11
+ import { OptionsDialog as s } from "@sheetxl/utils-mui";
12
+ import { NamedInput as d, RangeInput as p } from "./index.mjs";
13
+ const m = ["Ok", "Cancel"], u = a((a2) => {
14
+ const { value: u2 = null, context: c, onOption: g, onValidateOption: x, onDone: f, onUpdate: N, options: y = m, defaultOption: T = y?.[0], cancelOption: h = "Cancel", sx: O, ...V } = a2, v = n(() => c?.getNames().findValidName("Range1"), []), C = n(() => {
15
+ if (!u2) return true;
16
+ }, []), [R, w] = l({ displayText: u2?.getName() ?? v, errorText: null }), [F, D] = l({ displayValue: u2?.getRanges() ?? c?.selection() ?? null, errorText: null }), [I, j] = l(false), B = o(async (e2) => !R.errorText && !F.errorText, [c]), E = r((e2, t2, a3) => {
17
+ if (!t2) {
18
+ let e3 = null;
19
+ C ? e3 = c?.getNames().addReference(R?.displayText, F?.displayValue, false) : ("reference" === u2.getType() && u2.doBatch(() => {
20
+ u2.setName(R?.displayText), u2.setReference(F?.displayValue);
21
+ }, `Edit Named '${R?.displayText}'`), e3 = u2), e3 && (e3.select(), N(e3, C));
22
+ }
23
+ g?.(e2, t2, a3), f?.();
24
+ }, [c, R, F, f, g, T, h, N]), L = r((e2) => {
25
+ let t2 = null;
26
+ try {
27
+ c?.getNames().validateName(e2);
28
+ } catch (e3) {
29
+ t2 = e3.message;
30
+ }
31
+ w({ displayText: e2, errorText: t2 });
32
+ }, []), b = r((e2) => {
33
+ u2 && u2.getName().toLowerCase() === e2.toLowerCase() || c?.getNames().validateName(e2);
34
+ }, [c, u2]), k = o((e2) => {
35
+ D({ displayValue: e2 ?? null, errorText: null });
36
+ }, []);
37
+ return e(s, { title: (C ? "Define" : "Edit") + " Range", options: y, onOption: E, onValidateOption: B, defaultOption: T, cancelOption: h, autoFocusSel: ".autoFocus", sx: { width: "460px", ...O }, ...V, children: t(i, { sx: { paddingTop: (e2) => e2.spacing(1), paddingBottom: (e2) => e2.spacing(0), rowGap: (e2) => e2.spacing(1), range: "flex", flexDirection: "column" }, children: [e(d, { formName: "name", defaultInput: v, value: R.displayText, onChangeInput: L, onValidate: b, onFocus: (e2) => {
38
+ I || e2.target?.select(), j(true);
39
+ } }), e(p, { formName: "range", value: F.displayValue, onChangeInput: k, resolvedAddress: c.getNames().getRanges.bind(c.getNames()), onFocus: (e2) => {
40
+ I || e2.target?.select(), j(true);
41
+ } })] }) });
42
+ });
43
+ export {
44
+ u as NamedReferenceDialog,
45
+ u as default
46
+ };