@sheetxl/studio-mui 0.4.10 → 0.4.12

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 (127) hide show
  1. package/browser/cjs/B7qLzxylqOaybl3H.cjs +7 -0
  2. package/browser/cjs/BNGixOiIsu8jZlvn.cjs +7 -0
  3. package/browser/cjs/BUYxt7KgFkIIIMyc.cjs +7 -0
  4. package/browser/cjs/Bk6VhhWsnCRyBu2F.cjs +7 -0
  5. package/browser/cjs/BpiMMYip132x0r1O.cjs +7 -0
  6. package/browser/cjs/ByZ_Q-J7jgF7AoWR.cjs +7 -0
  7. package/browser/cjs/BzD7LV8VmFKLAJyW.cjs +7 -0
  8. package/browser/cjs/C6_zcNM0Efa11KEE.cjs +7 -0
  9. package/browser/cjs/C8Azx_ZaQa4WvAtR.cjs +7 -0
  10. package/browser/cjs/CITvaW7L_iZfIyAN.cjs +7 -0
  11. package/browser/cjs/CNDDYOoLCrGsUMYL.cjs +7 -0
  12. package/browser/cjs/CYbeY5OVZDqHGSOm.cjs +7 -0
  13. package/browser/cjs/C_SgucbRn-v9IkNO.cjs +7 -0
  14. package/browser/cjs/CeTd2nFbE5yFzf7T.cjs +7 -0
  15. package/browser/cjs/Cfe7IbPNI8-CgoDI.cjs +7 -0
  16. package/browser/cjs/Ctyk-ajkSsTDJuvY.cjs +7 -0
  17. package/browser/cjs/DBhTQLbjAtU-A1YA.cjs +7 -0
  18. package/browser/cjs/Dc2rbOjtcmSIm8D4.cjs +7 -0
  19. package/browser/cjs/DcsvUmoS8zGG5GB8.cjs +7 -0
  20. package/browser/cjs/DqAlQQIZIyF7HMib.cjs +7 -0
  21. package/browser/cjs/DuwawlAm4aRBNTBm.cjs +7 -0
  22. package/browser/cjs/Dx9UUJj-yeubDjm4.cjs +7 -0
  23. package/browser/cjs/IC19hB4Ntvw1158j.cjs +7 -0
  24. package/browser/cjs/index.cjs +10 -4
  25. package/browser/cjs/reQ9miE5C5qMfbRJ.cjs +7 -0
  26. package/browser/esm/B1Ey4ZP8BHUzHW7G.mjs +7 -0
  27. package/browser/esm/B8dJHVZJta8QbNKG.mjs +7 -0
  28. package/browser/esm/BThbC01mtb7qq8_A.mjs +7 -0
  29. package/browser/esm/Bnt1M91BRyMvXrc4.mjs +7 -0
  30. package/browser/esm/BqN0SYrEO0RZQtv-.mjs +7 -0
  31. package/browser/esm/CHPXsEre3jry2-jF.mjs +7 -0
  32. package/browser/esm/CMCOU0nDlymDFS9l.mjs +7 -0
  33. package/browser/esm/Cc7y1nMDr5J8jWx-.mjs +7 -0
  34. package/browser/esm/CesL-3BNbMB1f_if.mjs +7 -0
  35. package/browser/esm/CfvNSnuQLa1SPbNL.mjs +7 -0
  36. package/browser/esm/CloqVDbJmTL4oFek.mjs +7 -0
  37. package/browser/esm/Cta0yn5UIrP2UoT4.mjs +7 -0
  38. package/browser/esm/CwRyQHiDoBLx5_1g.mjs +7 -0
  39. package/browser/esm/DI-ZGstUJFwkx4H6.mjs +7 -0
  40. package/browser/esm/DQTfmweCXjuIlITn.mjs +7 -0
  41. package/browser/esm/DUIfOO25d1fqtJzn.mjs +7 -0
  42. package/browser/esm/DhOXsRr8c7bDS1jM.mjs +7 -0
  43. package/browser/esm/JPwh2m5-pXkdPVzF.mjs +7 -0
  44. package/browser/esm/UkNAvQj0NVgeMpUl.mjs +7 -0
  45. package/browser/esm/ZUfck_LDsQb9gpvU.mjs +7 -0
  46. package/browser/esm/gHhqkr52cxXkga0T.mjs +7 -0
  47. package/browser/esm/index.mjs +8 -83
  48. package/browser/esm/obM68UOvA5HV7Lt1.mjs +7 -0
  49. package/browser/esm/x9MyDRdLE47dI9dF.mjs +7 -0
  50. package/browser/esm/yW9jxnamUqAhVQkJ.mjs +7 -0
  51. package/licenses/dependencies.txt +145 -145
  52. package/node/esm/{DxbGK6Zl1UgjOa4-.mjs → B3M2CzPvK2oKOfg5.mjs} +2 -2
  53. package/node/esm/{D9XxEDOFeim_xxQE.mjs → BIRLX0-9t62Lqats.mjs} +2 -2
  54. package/node/esm/{BmkBQUrL_kkRhzTh.mjs → BJY8yNMmN_yyRtIG.mjs} +1 -1
  55. package/node/esm/{bMROCCq764fn-xgi.mjs → Bj8uU2shfkvN4LnE.mjs} +6 -6
  56. package/node/esm/{sAnM1xQCuHDSOmip.mjs → Bt5y5wVaVAVjwHBl.mjs} +1 -1
  57. package/node/esm/{BPqOHRFTv--y9umX.mjs → C2P_M1JNT_WZZN3H.mjs} +8 -8
  58. package/node/esm/{CcretMZPKGn3lnR4.mjs → CBGAl2mih9mHDt5w.mjs} +1 -1
  59. package/node/esm/{Clurk3ikkAHRiukp.mjs → CKtVB9hMCfabQMxC.mjs} +2 -2
  60. package/node/esm/{Dc--wbPxmu3D8pbK.mjs → CVGxETc4rIE1gNAH.mjs} +38 -38
  61. package/node/esm/{BGArlD6RNgEObMgD.mjs → CryVonGjJnmo2dE_.mjs} +5 -5
  62. package/node/esm/{FBYT_1wWMsovwFUH.mjs → D1C8ifsmXsypL6pp.mjs} +13 -13
  63. package/node/esm/{DAGXTtxswgRevXcg.mjs → D1xD8cOQDGcbjIlG.mjs} +1 -1
  64. package/node/esm/{tOKSFYpLW-UAq6Gt.mjs → DUfB1ollhqU-JIk5.mjs} +4 -4
  65. package/node/esm/{M1FpuPZr9_2AafMV.mjs → Dx2vq1Hdt4pqmOF-.mjs} +2 -2
  66. package/node/esm/{wsJBzsqfI7PB1hMT.mjs → M3UB6IrhVERZziiJ.mjs} +2 -2
  67. package/node/esm/{BvRJoxdFTieQ7fmr.mjs → PF5CCBvapZxEzc7k.mjs} +1 -1
  68. package/node/esm/{p6vc6u8VPkFyCsYx.mjs → bv_GA6NGCT0sJaXy.mjs} +2 -2
  69. package/node/esm/{DhG888jHVhaxSY8F.mjs → h1y2hBFecTqRgUa-.mjs} +25 -25
  70. package/node/esm/index.mjs +5265 -4998
  71. package/node/esm/{BCPBJsft-CxWAdC2.mjs → kHsChOtl8GUkzj5Q.mjs} +2 -2
  72. package/node/esm/{CvPEjDQ6QhtpTabY.mjs → kIQFLB3nmEJdn_OT.mjs} +1 -1
  73. package/node/esm/{BBg45DshIWHYXywC.mjs → m8fyd2BoYkTOJlc1.mjs} +1 -1
  74. package/node/esm/{usxl4NgDVOQ7LrDb.mjs → wdtYNTNCynMMS4_P.mjs} +1 -1
  75. package/package.json +8 -8
  76. package/types/index.d.ts +11 -0
  77. package/browser/cjs/BKTBvSy7O4Xw2cgz.cjs +0 -12
  78. package/browser/cjs/BpePzZJYiqMlY5Tv.cjs +0 -6
  79. package/browser/cjs/C1kdA0ggDPxfA1rZ.cjs +0 -7
  80. package/browser/cjs/C3Ou4UjGdLm76uIO.cjs +0 -6
  81. package/browser/cjs/CFxDNxEIdtHFQI9Y.cjs +0 -7
  82. package/browser/cjs/CYBKL0vexMAhOhAv.cjs +0 -15
  83. package/browser/cjs/CdVTdaOLyLtwVswE.cjs +0 -6
  84. package/browser/cjs/ClsxZKYLxWzS4vf3.cjs +0 -12
  85. package/browser/cjs/Co1amcDxMGmeSblk.cjs +0 -161
  86. package/browser/cjs/CoKAO1N3hI6MCu8D.cjs +0 -6
  87. package/browser/cjs/CtsmtdeQOqFBoICs.cjs +0 -6
  88. package/browser/cjs/CuB7GbiZyoeSvc0Z.cjs +0 -6
  89. package/browser/cjs/D-N-VqvFR1gHQx1f.cjs +0 -11
  90. package/browser/cjs/DDFf-jFPulia8BBq.cjs +0 -11
  91. package/browser/cjs/Db8DWa6iDZSqedMi.cjs +0 -90
  92. package/browser/cjs/DeGIeKT9CooiCmKo.cjs +0 -6
  93. package/browser/cjs/LWz4eqzOyIvcl3ew.cjs +0 -6
  94. package/browser/cjs/bzV_pbhf0GMpQZ5j.cjs +0 -16
  95. package/browser/cjs/fCiaIJ9GEGrJHKcW.cjs +0 -18
  96. package/browser/cjs/g_d3i2WIzavP1fkJ.cjs +0 -6
  97. package/browser/cjs/jtJTqrtVCIIZdMGs.cjs +0 -6
  98. package/browser/cjs/lKYJYMC7FrPq5kHP.cjs +0 -42
  99. package/browser/cjs/niDPoiECJADuYx3e.cjs +0 -145
  100. package/browser/cjs/olo9IZBG5nwaup_7.cjs +0 -6
  101. package/browser/cjs/zKQuLycAjgd_X11q.cjs +0 -6
  102. package/browser/esm/3hWSR1m3EU7D5hi-.mjs +0 -1352
  103. package/browser/esm/536uCif-OpzkPpDe.mjs +0 -84
  104. package/browser/esm/BAKeXjQwj8pB6HZf.mjs +0 -3803
  105. package/browser/esm/BCEAVoasUKP7howp.mjs +0 -25
  106. package/browser/esm/BKPv5CXZmlt0Bt9q.mjs +0 -52
  107. package/browser/esm/BpaKIplfXogRA7Dy.mjs +0 -424
  108. package/browser/esm/C7S8lmNi8dvBvaaL.mjs +0 -13391
  109. package/browser/esm/C8g1cXW8UUjZ5aXU.mjs +0 -43
  110. package/browser/esm/CDg8_cQCaixUeVW5.mjs +0 -59
  111. package/browser/esm/COdRj-kRolpDnJJt.mjs +0 -153
  112. package/browser/esm/C_SmA3bhMniSBiJM.mjs +0 -2251
  113. package/browser/esm/CfhFPyNuH7O_8Ma5.mjs +0 -46
  114. package/browser/esm/Cq7Bvqjn_f2hb4Yu.mjs +0 -1703
  115. package/browser/esm/Cu4sFU_zvi2DcKL0.mjs +0 -864
  116. package/browser/esm/DRlIFEu_74fHh0Nd.mjs +0 -44
  117. package/browser/esm/DW_hf-cH6FfKvA2U.mjs +0 -1366
  118. package/browser/esm/D_9FRFbybIoGcpk5.mjs +0 -640
  119. package/browser/esm/DssrQc6563EzuV2p.mjs +0 -1467
  120. package/browser/esm/TCkOSlTdkEa2IszR.mjs +0 -392
  121. package/browser/esm/XunxgPz4pxTyfYZa.mjs +0 -19979
  122. package/browser/esm/YJTooL6WwG9eY3LG.mjs +0 -48
  123. package/browser/esm/ej-oxHSoVFxjTvis.mjs +0 -2410
  124. package/browser/esm/fbwdS1S_4A9RYV7u.mjs +0 -1672
  125. package/browser/esm/tZtCH_zqvCEW6mXy.mjs +0 -23
  126. package/browser/esm/tbB-JzXGTPYVXdKc.mjs +0 -52
  127. package/node/esm/BmYPa_c9Yu9hUbtH.mjs +0 -312
@@ -1,43 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { memo as z, forwardRef as E, useState as p } from "react";
3
- import { _ as t, a0 as K, a1 as R, a2 as W, a3 as O } from "./XunxgPz4pxTyfYZa.mjs";
4
- import { Box as _, FormControl as q, TextField as A } from "@mui/material";
5
- import { alpha as y } from "@mui/system";
6
- /**
7
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.10
8
- *
9
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
10
- * License: The license can be found at https://www.sheetxl.com/license.
11
- */
12
- const G = ["Input"], Z = z(E((w, F) => {
13
- const { initialValue: T = "", onOption: C, onValidateOption: r, onInputOption: l, onValidateInputOption: s, onDone: u, inputProps: c, inputLabel: I, inputType: P, inputPlaceHolder: v, options: d = G, autoFocusSel: b = ".autoFocus", cancelOption: m, defaultOption: g = d?.[0], ...k } = w, [V, B] = p(!1), [o, D] = p(T), [S, H] = p(""), [L, M] = p(!0), e = t(async (a, n) => {
14
- if (!s) return !0;
15
- const h = await s?.(a, n);
16
- H(h?.message ?? "");
17
- const x = h?.valid ?? !0;
18
- return M(x), x;
19
- }, [s]), f = t(async (a) => {
20
- l?.(o, a);
21
- }, [o, l, u, C, m, g]), N = t(async (a) => {
22
- a.keyCode === K.Enter && await e?.(o, null);
23
- }, [o, f]), $ = t((a) => {
24
- D(a.target.value), e?.(a.target.value, null);
25
- }, [r]), j = t(async (a) => {
26
- let n = await e(o, a);
27
- try {
28
- n !== !1 && (n = await e(o, a));
29
- } catch {
30
- }
31
- return n ?? !0;
32
- }, [o, r]);
33
- return i(R, { options: d, onDone: u, onOption: (a, n) => {
34
- n || f(a);
35
- }, onValidateOption: j, cancelOption: m, defaultOption: g, autoFocusSel: b, ref: F, ...k, children: i(_, { sx: { paddingTop: (a) => a.spacing(1), paddingBottom: (a) => a.spacing(0) }, children: i(q, { sx: { paddingTop: (a) => a.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: i(A, { onFocus: (a) => {
36
- V || a.target?.select(), B(!0);
37
- }, type: P, label: I, helperText: S || " ", sx: { width: "100%", "& .MuiFormHelperText-root": { marginTop: (a) => a.spacing(0.5), color: L ? void 0 : "error.main" } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { placeholder: v, spellCheck: !1, autoComplete: "off", ...c, className: W("autoFocus", c?.className), sx: { paddingTop: (a) => a.spacing(1.25), paddingBottom: (a) => a.spacing(0.75), backgroundImage: `linear-gradient(${y("#fff", O(5))}, ${y("#fff", O(5))})` } } }, value: o, onChange: $, onKeyDown: N, onContextMenu: (a) => {
38
- a.stopPropagation();
39
- } }) }) }) });
40
- }));
41
- export {
42
- Z as default
43
- };
@@ -1,59 +0,0 @@
1
- import { jsx as a, jsxs as s } from "react/jsx-runtime";
2
- import { memo as O, useState as r, useRef as E, useReducer as M, useMemo as A } from "react";
3
- import { DialogContent as W, Box as n } from "@mui/material";
4
- import { af as k, j as V, ag as q, ah as G, T as x, a6 as J, ai as K, aj as Q, P as f, ak as U, al as X, v as y, w as b, y as w, am as S } from "./XunxgPz4pxTyfYZa.mjs";
5
- /**
6
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.10
7
- *
8
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
9
- * License: The license can be found at https://www.sheetxl.com/license.
10
- */
11
- const ae = O((C) => {
12
- const { title: N, onHide: v, autoFocusSel: R = ".range-input input", context: T, notifier: l = k, command: c, commands: d, ...D } = C, [F, g] = r(!1), [m, p] = r(!1), h = E(null), [Y, j] = M((e) => e + 1, 0), [B, { width: Z }] = V();
13
- q(c);
14
- const o = T ?? c.context(), t = o.table(), [H, P] = r(() => t ? o.getNames().getRanges(t.getRange()) : null), I = A(() => t?.getName() ?? "", [t]);
15
- G(o.table(), { onAnchorCoordsChange(e) {
16
- P(o.getNames().getRanges(e.getRange()));
17
- }, onProtectedChange(e) {
18
- j();
19
- } });
20
- const z = x((e) => {
21
- o?.table().setName(e);
22
- }, [o]), L = x((e) => {
23
- o?.table().resize(e.at(0));
24
- }, [o]);
25
- let u = null;
26
- return o.table() || (u = a("div", { style: { position: "absolute", top: "0", left: "0", width: "100%", height: "100%", opacity: 1, display: "flex", alignItems: "center", justifyItems: "center", justifyContent: "center", boxSizing: "border-box" }, children: a("div", { children: "No table selected" }) })), a(J, { ref: h, title: N ?? "Table Details", initialPosition: { y: "35" }, autoFocusSel: R, onHide: v, onFocus: () => g(!0), onBlur: (e) => {
27
- h?.current?.contains(e.relatedTarget) || g(!1);
28
- }, PaperProps: { elevation: F ? 3 : 1 }, ...D, children: s(W, { dividers: !0, ref: B, sx: { display: "flex", flexDirection: "column", position: "relative", paddingLeft: (e) => e.spacing(1.5), paddingRight: (e) => e.spacing(1.5) }, children: [s(n, { sx: { display: "flex", flexDirection: "column", transition: "opacity 60ms", opacity: o.table() ? 1 : 0 }, children: [a(n, { sx: { display: "flex", flexDirection: "row", gap: (e) => e.spacing(1) }, children: a(n, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", boxSizing: "border-box", paddingLeft: (e) => e.spacing(2), paddingRight: (e) => e.spacing(2) }, children: s(n, { sx: { display: "flex", flexDirection: "column", alignItems: "center" }, children: [a(K, { formName: "name", defaultInput: I, value: t?.getName() ?? "No table", onChangeInput: z, onValidate: (e) => {
29
- t && t.getName().toLowerCase() === e.toLowerCase() || o?.getNames().validateName(e);
30
- }, disabled: t?.isProtected() ?? !0, onFocus: (e) => {
31
- m || e.target?.select(), p(!0);
32
- } }), a(Q, { formName: "range", value: H, onChangeInput: L, resolvedAddress: o.getNames().getRanges.bind(o.getNames()), disabled: t?.isProtected() ?? !0, onFocus: (e) => {
33
- m || e.target?.select(), p(!0);
34
- } })] }) }) }), s(n, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", gap: (e) => e.spacing(0.5), marginTop: (e) => e.spacing(1) }, children: [a(f, { orientation: "horizontal", sx: { marginTop: (e) => e.spacing(1.5), marginBottom: (e) => e.spacing(0.75) } }), a(U, { disabled: t?.isProtected(), styleOptions: t?.getStyleOptions() ?? null, onStyleOptionsChange: (e) => {
35
- t.updateStyleOptions(e);
36
- }, showHeaderRow: t?.getShowHeaders(), onShowHeaderRowChange: (e) => {
37
- try {
38
- t.setShowHeaders(e);
39
- } catch (i) {
40
- l.showError(i);
41
- }
42
- }, showTotalRow: t?.getShowTotals(), onShowTotalRowChange: (e) => {
43
- try {
44
- t.setShowTotals(e);
45
- } catch (i) {
46
- l.showError(i);
47
- }
48
- }, showFilterButton: t?.getFilter() ? t.getShowFilterButton() : null, onShowFilterButtonChange: (e) => {
49
- try {
50
- t.setShowFilterButton(e);
51
- } catch (i) {
52
- l.showError(i);
53
- }
54
- } }), a(n, { sx: { display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", marginTop: (e) => e.spacing(2), marginBottom: (e) => e.spacing(1) }, children: a(X, { table: t, styles: o.styles(), bodyStyle: o.bodyStyle(), cellHeight: 30, isLive: !0 }) }), a(f, { orientation: "horizontal" }), s(n, { sx: { display: "flex", flexDirection: "column", justifyContent: "center" }, children: [a(y, { variant: w.Menuitem, command: d.getCommand("convertTableToRange"), commandState: t, icon: b(a(S, {})) }), a(y, { variant: w.Menuitem, commandState: t, command: d.getCommand("deleteTable"), icon: b(a(S, {})) })] })] })] }), u] }) });
55
- });
56
- export {
57
- ae as TableDetailsWindow,
58
- ae as default
59
- };
@@ -1,153 +0,0 @@
1
- import { jsx as i, jsxs as p } from "react/jsx-runtime";
2
- import { memo as ie, useRef as C, useState as b, useEffect as D, useLayoutEffect as ce, useMemo as pe } from "react";
3
- import { DialogContent as de, Box as O, TextField as Y, InputAdornment as ue, Collapse as _, MenuItem as fe, FormControl as ge, InputLabel as me, Select as xe } from "@mui/material";
4
- import { ArrowBack as he, ArrowUpward as Oe, ArrowForward as Ce, ArrowDownward as ye } from "@mui/icons-material";
5
- import { ICell as c, IRange as R } from "@sheetxl/sdk";
6
- import { T as j, a4 as be, j as Te, a6 as ve, a7 as m, w as x, a8 as Re, Z as y, a9 as ke, aa as we, ab as Ie, ac as Se, a5 as k, ad as Ee, ae as Fe, P as De } from "./XunxgPz4pxTyfYZa.mjs";
7
- import { alpha as w } from "@mui/system";
8
- /**
9
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.10
10
- *
11
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
12
- * License: The license can be found at https://www.sheetxl.com/license.
13
- */
14
- const $ = ie((I) => {
15
- const { label: h, value: r, options: s, onSelect: d, tabIndex: T = 0, ...P } = I, [A, v] = b(() => ne(r, s));
16
- D(() => {
17
- v(ne(r, s));
18
- }, [r, s]);
19
- const K = j((u) => {
20
- v(u.target.value), d?.(s[u.target.value]);
21
- }, [d, s]), l = pe(() => Object.keys(s).map((u) => i(fe, { value: u, children: u }, u)), [s]);
22
- return p(ge, { sx: { minWidth: 135 }, size: "small", children: [i(me, { children: h }), i(xe, { inputProps: { tabIndex: T }, value: A, label: h, onChange: K, sx: { backgroundImage: `linear-gradient(${w("#fff", k(5))}, ${w("#fff", k(5))})` }, ...P, children: l })] });
23
- }), ee = { Workbook: "workbook", Sheet: "sheet" }, te = { enter: 140, exit: 140 }, oe = { Formulas: c.Content.Formulas, Values: c.Content.Values, Notes: c.Content.Notes, Comments: c.Content.Comments }, se = { ...oe };
24
- delete se.Values;
25
- const Pe = { "By Rows": !0, "By Columns": !1 }, ne = (I, h) => {
26
- const r = Object.keys(h);
27
- for (let s = 0; s < r.length; s++) {
28
- const d = r[s];
29
- if (h[d] === I) return d;
30
- }
31
- }, Ve = ie((I) => {
32
- const { replace: h = !1, findText: r, replaceText: s, findOptions: d, replaceOptions: T, title: P, onHide: A, onFindOrReplace: v, ...K } = I, l = C(null), u = C(null), V = C(null), W = C(null), N = C(null), H = C(null), z = (e, t) => {
33
- t && (t.start(e, { center: !1 }), setTimeout(() => t.stop(e), 180));
34
- }, [U, F] = b(!1), [M, le] = b(!1), [f, B] = b(h), [X, L] = b(!1), [G, Z] = b(!1), [o, a] = b({ findText: null, replaceText: null, replace: h, replaceOptions: {}, findOptions: { matchCase: !1, matchEntireCell: !1, useRegex: !1, orientation: R.Orientation.Row, fields: [c.Content.Formulas] }, scope: ee.Sheet }), S = j(async (e, t, n, E) => {
35
- if (!v) return;
36
- const g = { ...o };
37
- g.replaceOptions = { ...g.replaceOptions }, g.findOptions = { ...g.findOptions }, g.replaceOptions.maxCount = n ? void 0 : 1, g.replace = t, t && o.findOptions.fields?.[0] === c.Content.Values && (g.findOptions.fields = [c.Content.Formulas]), g.findOptions.reverse = !e;
38
- const re = await v({ autoFocus: E, ...g });
39
- L(re === 0);
40
- }, [o, v]);
41
- D(() => {
42
- L(!1);
43
- }, [o, M, f]);
44
- const q = j((e, t) => {
45
- if (e.keyCode === be.Enter) {
46
- if (!o.findText) return;
47
- let n = !0, E = !1;
48
- e.shiftKey && (n = !1), t ? (e.ctrlKey && e.altKey && (E = !0), z(e, E ? H.current : N.current)) : z(e, n ? W.current : V.current), S(n, t, E, !1);
49
- }
50
- }, [o]), J = C(null);
51
- ce(() => {
52
- a((e) => {
53
- const t = { ...e };
54
- t.findText = r && r.length > 0 ? r : e.findText ?? "", F(!0), s !== void 0 && (t.replaceText = s), d && (t.findOptions = { ...t.findOptions, ...d }), t.replaceText || (t.replaceText = ""), t.replaceOptions && (t.replaceOptions = { ...t.replaceOptions }), T && (t.replaceOptions = { ...t.replaceOptions, ...T }), o.findOptions.fields?.[0] || (o.findOptions.fields = [c.Content.Formulas]);
55
- const n = !(!T && s === void 0);
56
- return n && B(n), t;
57
- }), G || J.current?.focus();
58
- }, [r, s, d, T]), D(() => {
59
- f ? (o.findOptions.fields[0], c.Content.Values) : F(!0);
60
- }, [f]), D(() => {
61
- if (U && l.current && o.findText === l.current.value) return l.current === document.activeElement || l.current.contains(document.activeElement) ? (l.current?.select(), void F(!1)) : void l.current.addEventListener("focus", () => {
62
- l.current?.select(), F(!1);
63
- }, { once: !0 });
64
- }, [U, o]);
65
- const [ae, { width: Q }] = Te();
66
- return i(ve, { ref: J, title: P ?? (f ? "Find & Replace" : "Find"), initialPosition: { y: "35" }, autoFocusSel: ".input", onHide: A, onFocus: () => Z(!0), onBlur: () => {
67
- Z(!1), L(!1);
68
- }, PaperProps: { elevation: G ? 3 : 1 }, ...K, children: p(de, { dividers: !0, ref: ae, sx: { display: "flex", flexDirection: "column", paddingLeft: (e) => e.spacing(1.5), paddingRight: (e) => e.spacing(1.5) }, onKeyDown: (e) => {
69
- if (e.key === "h" && e.ctrlKey) B(!0), l.current?.contains(document.activeElement) && u.current?.focus();
70
- else if (e.key === "f" && e.ctrlKey) l.current?.focus();
71
- else if (e.key === "c" && e.altKey) a((t) => {
72
- const n = { ...t };
73
- return n.findOptions.matchCase = !t.findOptions.matchCase, n;
74
- });
75
- else if (e.key === "e" && e.altKey) a((t) => {
76
- const n = { ...t };
77
- return n.findOptions.matchEntireCell = !t.findOptions.matchEntireCell, n;
78
- });
79
- else {
80
- if (e.key !== "r" || !e.altKey) return;
81
- a((t) => {
82
- const n = { ...t };
83
- return n.findOptions.useRegex = !t.findOptions.useRegex, n;
84
- });
85
- }
86
- e.preventDefault();
87
- }, children: [p(O, { sx: { display: "flex", flexDirection: "row", gap: (e) => e.spacing(1) }, children: [p(O, { sx: { display: "flex", flexDirection: "row", alignItems: "start", gap: (e) => e.spacing(0.25), paddingTop: "3px" }, children: [i(m, { selected: M, onSelectToggle: (e) => {
88
- le(e);
89
- }, preventFocus: !0, label: "Toggle Additional Options", icon: x(i(Re, {})) }), i(m, { selected: f, onSelectToggle: (e) => {
90
- B(e);
91
- }, preventFocus: !0, label: "Toggle Replace", icon: x(i(ke, {})), shortcut: { key: f ? "F" : "H", modifiers: [y.Ctrl] } })] }), p(O, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", boxSizing: "border-box" }, children: [p(O, { sx: { display: "flex", flexDirection: "row", alignItems: "center" }, children: [i(Y, { label: "Find", InputLabelProps: { shrink: !0 }, InputProps: { sx: { paddingRight: (e) => e.spacing(1), minWidth: Q > 460 ? "20em" : void 0, backgroundImage: `linear-gradient(${w("#fff", k(5))}, ${w("#fff", k(5))})` }, inputProps: { draggable: !1, ref: l, className: "input", autoFocus: !0, spellCheck: !1, autoComplete: "off", sx: { paddingTop: (e) => e.spacing(1.25), paddingBottom: (e) => e.spacing(0.75) } }, endAdornment: i(ue, { sx: { transform: "scale(0.75) translateX(16px)" }, position: "end", children: p(O, { sx: { display: "flex", alignItems: "center", flexDirection: "row", gap: "1px" }, children: [i(m, { selected: o.findOptions.matchCase, onSelectToggle: (e) => {
92
- a((t) => {
93
- const n = { ...t };
94
- return n.findOptions.matchCase = e, n;
95
- });
96
- }, label: "Match Case", shortcut: { key: "C", modifiers: [y.Alt] }, icon: x(i(we, {})) }), i(m, { selected: o.findOptions.matchEntireCell, onSelectToggle: (e) => {
97
- a((t) => {
98
- const n = { ...t };
99
- return n.findOptions.matchEntireCell = e, n;
100
- });
101
- }, label: "Match Entire Cell", shortcut: { key: "E", modifiers: [y.Alt] }, icon: x(i(Ie, {})) }), i(m, { selected: o.findOptions.useRegex, onSelectToggle: (e) => {
102
- a((t) => {
103
- const n = { ...t };
104
- return n.findOptions.useRegex = e, n;
105
- });
106
- }, label: "Use Regular Expression", shortcut: { key: "R", modifiers: [y.Alt] }, icon: x(i(Se, {})) })] }) }) }, sx: { flex: "1 1 100%", marginRight: (e) => e.spacing(1), "& .MuiOutlinedInput-notchedOutline": { borderColor: (e) => X ? `${e.palette.error.main} !important` : void 0 }, "& .MuiInputLabel-outlined": { color: (e) => X ? `${e.palette.error.main} !important` : void 0 } }, value: o.findText ?? "", onChange: (e) => {
107
- a((t) => {
108
- const n = { ...t };
109
- return n.findText = e.target.value, n;
110
- });
111
- }, onKeyDown: (e) => q(e, !1), onContextMenu: (e) => {
112
- e.stopPropagation();
113
- } }), i(m, { selected: o.findOptions.reverse, onSelectToggle: (e) => {
114
- S(!1, !1);
115
- }, touchRippleRef: V, label: "", shortcut: { key: "Enter", modifiers: [y.Shift] }, icon: x(o.findOptions.orientation !== R.Orientation.Column ? i(he, {}) : i(Oe, {})), disabled: !o.findText }), i(m, { selected: !o.findOptions.reverse, onSelectToggle: (e) => {
116
- S(!0, !1);
117
- }, touchRippleRef: W, label: "Next Match", shortcut: { key: "Enter" }, icon: x(o.findOptions.orientation !== R.Orientation.Column ? i(Ce, {}) : i(ye, {})), disabled: !o.findText })] }), i(_, { in: f, timeout: te, onExit: () => {
118
- l.current?.focus();
119
- }, children: p(O, { sx: { display: "flex", flexDirection: "row", alignItems: "center", marginTop: (e) => e.spacing(2) }, children: [i(Y, { label: "Replace", InputLabelProps: { shrink: !0 }, InputProps: { sx: { paddingRight: (e) => e.spacing(1), backgroundImage: `linear-gradient(${w("#fff", k(5))}, ${w("#fff", k(5))})` }, inputProps: { ref: u, className: "input", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (e) => e.spacing(1.25), paddingBottom: (e) => e.spacing(0.75) } } }, sx: { flex: "1 1 100%", marginRight: (e) => e.spacing(1) }, value: o.replaceText ?? "", onChange: (e) => {
120
- a((t) => {
121
- const n = { ...t };
122
- return n.replaceText = e.target.value, n;
123
- });
124
- }, onKeyDown: (e) => q(e, !0), onContextMenu: (e) => {
125
- e.stopPropagation();
126
- } }), i(m, { onSelectToggle: (e) => {
127
- S(!0, !0);
128
- }, touchRippleRef: N, label: "Replace", shortcut: { key: "Enter" }, icon: x(i(Ee, {})), disabled: !o.findText }), i(m, { onSelectToggle: (e) => {
129
- S(!0, !0, !0);
130
- }, touchRippleRef: H, label: "Replace All", shortcut: { key: "Enter", modifiers: [y.Ctrl, y.Alt] }, icon: x(i(Fe, {})), disabled: !o.findText })] }) })] })] }), i(_, { in: M, timeout: te, onExit: () => {
131
- l.current?.focus();
132
- }, children: p(O, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", gap: (e) => e.spacing(0.5), marginTop: (e) => e.spacing(1) }, children: [i(De, { orientation: "horizontal", sx: { marginBottom: (e) => e.spacing(1.5) } }), p(O, { sx: { display: "flex", flexDirection: Q >= 413 ? "row" : "column", justifyContent: "space-evenly", alignItems: "center", rowGap: (e) => e.spacing(2) }, tabIndex: -1, children: [i($, { label: "Within", value: o.scope, options: ee, onSelect: (e) => {
133
- a((t) => {
134
- const n = { ...t };
135
- return n.scope = e, n;
136
- });
137
- } }), i($, { label: "Search", value: o.findOptions.orientation !== R.Orientation.Column, options: Pe, onSelect: (e) => {
138
- a((t) => {
139
- const n = { ...t };
140
- return n.findOptions.orientation = e ? R.Orientation.Row : R.Orientation.Column, n;
141
- });
142
- } }), i($, { label: "Look in", value: f && o.findOptions.fields?.[0] === c.Content.Values ? c.Content.Formulas : o.findOptions.fields?.[0], options: f ? se : oe, onSelect: (e) => {
143
- a((t) => {
144
- const n = { ...t };
145
- return n.findOptions.fields = [e], n;
146
- });
147
- } })] })] }) })] }) });
148
- });
149
- export {
150
- Ve as FindReplaceWindow,
151
- ee as ScopeOptions,
152
- Ve as default
153
- };