@sheetxl/studio-mui 0.4.14 → 0.4.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/{-zKDSjn55SCvCwk8.cjs → BNHQPLsVdLmkPgyG.cjs} +1 -1
- package/browser/cjs/{d2jsgbPdf35xArnn.cjs → BUU_z9x81l1Qnv1t.cjs} +2 -2
- package/browser/cjs/{C6Fk0jGWAOED60yf.cjs → BX8hkPMsPd9PSv0Z.cjs} +1 -1
- package/browser/cjs/{B1Eaz6PFZAmrWiyY.cjs → BknKSPzyXctJohHb.cjs} +2 -2
- package/browser/cjs/{CRvxop0QcZL23Akb.cjs → Blfxp7Ec3Yjx3gNU.cjs} +2 -2
- package/browser/cjs/{W7LR70ajtjR9Lmvl.cjs → BqFEcpPZjpwULlZk.cjs} +2 -2
- package/browser/cjs/{Bmifo5y7ZMJolUTY.cjs → C-pPuqiWtgMU4NgZ.cjs} +1 -1
- package/browser/cjs/{CS5USjyVh8DwPSri.cjs → C9eqE9OnPkiI-5Zd.cjs} +1 -1
- package/browser/cjs/{BpLu9-spCLcAFdwd.cjs → CB6DGRkCA3BLDEFr.cjs} +2 -2
- package/browser/cjs/{AoLA7tfyPshG_mKt.cjs → CO4rZgb0ObTZh6NO.cjs} +2 -2
- package/browser/cjs/CU900NraHPDHMGJt.cjs +18 -0
- package/browser/cjs/{BkVtS9FZxWYNmrbU.cjs → Cpo-h2pMpScosT7r.cjs} +1 -1
- package/browser/cjs/{DD8-ZSDUkRqk7l6y.cjs → Cq2L49XjSKiIAsND.cjs} +1 -1
- package/browser/cjs/{BiBEmbWoJHdOB1li.cjs → D9X3UXVH6b_NJFeo.cjs} +1 -1
- package/browser/cjs/{DNL88d5PGwk92LeD.cjs → DZJO-_8PnMFRZMpg.cjs} +2 -2
- package/browser/cjs/{DZ8WTAzF6V2Tw1tW.cjs → DmCCEKhedSOg163M.cjs} +2 -2
- package/browser/cjs/DpZ5HlIMG95q2uIe.cjs +96 -0
- package/browser/cjs/{B8ZfZXhvW4sSKKZs.cjs → DwLcsRl4-LumKl6l.cjs} +2 -2
- package/browser/cjs/{BAfNSJo7fktzFVJd.cjs → Dy2vYVhrEqTHdzfD.cjs} +3 -3
- package/browser/cjs/{BqOg0z4HGrbNaL1k.cjs → Gj8MlEhOCg_o7idM.cjs} +2 -2
- package/browser/cjs/{BH0v7IIykugrFxaT.cjs → IllnWqWVClWDW1ot.cjs} +2 -2
- package/browser/cjs/{BUwmvmcdC0xBQ97L.cjs → J3xq71qTV9LqCUzu.cjs} +1 -1
- package/browser/cjs/{XGmQ2kUHM2qQkG1r.cjs → X9sJMKafafBPpNpK.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{D2gy3JDrJyGAMqsl.cjs → klnhoS0cqBpCC5fo.cjs} +2 -2
- package/browser/esm/{CBQZHZlKIiEz186r.mjs → BQNKKCtIvfOMph3T.mjs} +89 -90
- package/browser/esm/{C4ORm_Up6Zxt92F_.mjs → BiQfhG8JMHeWuT63.mjs} +1 -1
- package/browser/esm/{C5OCdRxcYIZViFzN.mjs → Btyp6us1Vzz3ZfHk.mjs} +1 -1
- package/browser/esm/{CHovQU_R4AuKULmT.mjs → Bvr3QlWdnOSnskWL.mjs} +1 -1
- package/browser/esm/{Ks946bL2vmd4m743.mjs → CYpvNksOw1PyhLpA.mjs} +6 -6
- package/browser/esm/{CQiALmsycGGLFj1o.mjs → CcZUaOkODU7h0onP.mjs} +5 -5
- package/browser/esm/{B-rZWEIXFvB2W_mP.mjs → CnXUhdLB8blNUvSr.mjs} +1 -1
- package/browser/esm/{ClmlhDf-0RC5GFV3.mjs → CwjVlrJJqEGZX6q2.mjs} +6 -6
- package/browser/esm/{CSKgHJSTMvOEe2RH.mjs → D0v3VaJtA3LjHpWR.mjs} +11803 -10968
- package/browser/esm/{CS6uJp7phBvUmos6.mjs → D4DvAg7aaaWl0TPV.mjs} +6 -6
- package/browser/esm/{CYG1vk4AMMwqsul7.mjs → DAZNeiMI9sOM-xd8.mjs} +1 -1
- package/browser/esm/DGUm6rEOgO8WrVtT.mjs +23 -0
- package/browser/esm/{C8po4rRYJ8127Rgb.mjs → DGoy2q9hDB7kive6.mjs} +10 -10
- package/browser/esm/{CmAnpd_SOxQuTQRL.mjs → DSCE3cCea5d5Ip-N.mjs} +3 -3
- package/browser/esm/{DgKsUQMTThBdEQds.mjs → DrTLuc1VQWQfDAej.mjs} +12 -12
- package/browser/esm/{_FvE2-K7MOW_qWVS.mjs → DuzycndVID_eag8V.mjs} +1 -1
- package/browser/esm/FZoe4QJ2ecSD1pjB.mjs +43 -0
- package/browser/esm/{CB7vnn7AtsGma4R6.mjs → HI5oLhcn8kfiky1k.mjs} +1 -1
- package/browser/esm/{TlZOl3Gt-d0Nc2a8.mjs → T2YlNqs-LGJBm08C.mjs} +3 -3
- package/browser/esm/{vgS9ixFRuZrPx6vq.mjs → UCJVaz3qX1u53mgI.mjs} +1 -1
- package/browser/esm/{Dc1PmtvbeqsIQHq6.mjs → UWejV3W_nMwWqnxY.mjs} +20 -20
- package/browser/esm/{DWy4L2usallW0WdU.mjs → VpP_qw0lmgCaHdHR.mjs} +69 -69
- package/browser/esm/{4fzdzYhVH9eIXv-E.mjs → YS19x3zzRUKQqXu_.mjs} +2 -2
- package/browser/esm/index.mjs +66 -65
- package/browser/esm/{CCwOCTrf9Bira1-Y.mjs → jqoS02EUPE2WEY1t.mjs} +1 -1
- package/licenses/dependencies.txt +134 -134
- package/node/esm/{DC2dPUCWVgxEKzaS.mjs → 3htalFC0z5xbRnmH.mjs} +13 -13
- package/node/esm/{DOUP6ynjlQE-UEJs.mjs → B-pzKiKMkbB9Es-9.mjs} +6 -6
- package/node/esm/{Bgtg4I8EL4M776SY.mjs → BFxzGj5sPFwrklFi.mjs} +8 -8
- package/node/esm/{BTNBRzW8ZZbJY4GL.mjs → BGYSS0lvjSMTtreq.mjs} +1 -1
- package/node/esm/{762kbapO408ejsVC.mjs → BGZpuIQG7RsGY_HH.mjs} +2 -2
- package/node/esm/{yP0whgIwVZApluLw.mjs → BTnlaEz7yZqa7QHP.mjs} +2 -2
- package/node/esm/{yB8OTWhDomxUy_SX.mjs → BfUEFSGuAZXw2fvO.mjs} +2 -2
- package/node/esm/{DUqIYzvmrCd67Dpx.mjs → BiJ5CZBAxg4-QDHh.mjs} +2 -2
- package/node/esm/{BR9YJuwMP9nTMBE-.mjs → Bnkt1wiWaLEq8xla.mjs} +1 -1
- package/node/esm/{DrujinnhlNDCosqb.mjs → BwbOSLs2gcxOaV0i.mjs} +1 -1
- package/node/esm/{CzWLA_IQgFbENkMq.mjs → CAWLE2N0nA-FjUkH.mjs} +1 -1
- package/node/esm/{CTpkd2r1aBS5d0yl.mjs → CSnI8PJEgxEQEj1B.mjs} +1 -1
- package/node/esm/{DWCxF-chq5dVi363.mjs → CvYpf-Km1Rvg15q4.mjs} +38 -38
- package/node/esm/{Bi5br6yrYZqhLEiY.mjs → CxhzSvAqksnasp3g.mjs} +4 -4
- package/node/esm/{CZoMFCKJudiTl_Tf.mjs → DCrdGvQ_vOB2o-ca.mjs} +2 -2
- package/node/esm/{D1GfRQ1jyFg-wmLD.mjs → DhGXQOOW9FBpgCqI.mjs} +1 -1
- package/node/esm/{DghPySv_2Ts78czJ.mjs → DkhnVkboeZsdMJxH.mjs} +1 -1
- package/node/esm/{VHY56h6xqQcPba6u.mjs → DnMRqYWKDGXlNm42.mjs} +1 -1
- package/node/esm/{dlEq3vDkIERtTn7Y.mjs → DsS5U5rJ5tNVEGXs.mjs} +25 -25
- package/node/esm/{CCygt4zw40-jO57G.mjs → DuyHq4Fs-_RQkwF_.mjs} +2 -2
- package/node/esm/{CY1qC_sXGD6av4yO.mjs → FzVegyt0upYkLobF.mjs} +2 -2
- package/node/esm/{B0gJGF9-J3L5yBEW.mjs → imk332niB0MxWuGl.mjs} +5 -5
- package/node/esm/index.mjs +5264 -4999
- package/package.json +8 -8
- package/types/index.d.ts +11 -0
- package/browser/cjs/As7uhSEgY8VJ3I6f.cjs +0 -90
- package/browser/cjs/Chz3K3Qt8M2FNJwI.cjs +0 -12
- package/browser/cjs/DTHMIHonHaHeJ0o1.cjs +0 -18
- package/browser/esm/CIH3ADFJJmUiyA8p.mjs +0 -864
- package/browser/esm/Dk00kGaRJxiitO5-.mjs +0 -23
- package/browser/esm/FdSIHwC_mNRZpcgJ.mjs +0 -43
- package/node/esm/DsD7O5j2cXyaECkB.mjs +0 -313
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NumberFormat as Ht, ScalarType as Ft, ResourceCollection as vs, Tuple as Ss, IAutoFilter as Zt, AddressUtils as at, CommonUtils as es, Theme as Cs, JSONStableStringify as ks, Workbook as As, IColor as Es, CoordUtils as De, IRange as Ds, OutOfBoundsError as Ps, FormulaError as Os } from "@sheetxl/sdk";
|
|
2
|
-
import { Y as cs } from "./
|
|
2
|
+
import { Y as cs } from "./D0v3VaJtA3LjHpWR.mjs";
|
|
3
3
|
/**
|
|
4
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.
|
|
4
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.15
|
|
5
5
|
*
|
|
6
6
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
7
7
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -897,14 +897,14 @@ class Bt {
|
|
|
897
897
|
const Ks = (i, t, s) => {
|
|
898
898
|
if (i[0].value[0] === i[1].value[0]) return t;
|
|
899
899
|
}, ls = { colStart: 0, colEnd: 0, rowStart: 0, rowEnd: 0 }, ri = Object.freeze(Object.defineProperty({ __proto__: null, fromBufferXLSX: async (i, t) => {
|
|
900
|
-
const { password: s, onWarning: o, createWorkbookOptions: n = {}, ...a } = t ?? {}, c = import("./
|
|
900
|
+
const { password: s, onWarning: o, createWorkbookOptions: n = {}, ...a } = t ?? {}, c = import("./Btyp6us1Vzz3ZfHk.mjs"), m = import("./DSCE3cCea5d5Ip-N.mjs");
|
|
901
901
|
let v = null;
|
|
902
902
|
try {
|
|
903
903
|
v = new DOMParser();
|
|
904
904
|
} catch {
|
|
905
905
|
}
|
|
906
906
|
let b = null;
|
|
907
|
-
v || (b = import("./
|
|
907
|
+
v || (b = import("./DuzycndVID_eag8V.mjs").then((u) => u.i));
|
|
908
908
|
let x = null, E = null, y = null;
|
|
909
909
|
try {
|
|
910
910
|
const u = await Promise.all([c, m, b]);
|
|
@@ -1311,7 +1311,7 @@ const Ks = (i, t, s) => {
|
|
|
1311
1311
|
}, W), _t = ns(R, ce), xt = await (async (V, U = 8388608) => {
|
|
1312
1312
|
await (async () => {
|
|
1313
1313
|
if (typeof ReadableStream > "u") if (typeof window > "u") {
|
|
1314
|
-
const { ReadableStream: Z } = await import("./
|
|
1314
|
+
const { ReadableStream: Z } = await import("./BiQfhG8JMHeWuT63.mjs");
|
|
1315
1315
|
globalThis.ReadableStream = Z;
|
|
1316
1316
|
} else console.warn("Browser does not support ReadableStream; consider loading a polyfill.");
|
|
1317
1317
|
})();
|
|
@@ -1409,7 +1409,7 @@ const Ks = (i, t, s) => {
|
|
|
1409
1409
|
throw u instanceof Ps && (D = "Unable to open XLSX. There are too many rows or columns."), new Error(D, { cause: u });
|
|
1410
1410
|
}
|
|
1411
1411
|
}, toBufferXLSX: async (i, t) => {
|
|
1412
|
-
const s = await import("./
|
|
1412
|
+
const s = await import("./Btyp6us1Vzz3ZfHk.mjs"), o = await i.toJSON(!0), n = s.utils.book_new();
|
|
1413
1413
|
for (let a = 0; a < o.sheets.length; a++) {
|
|
1414
1414
|
const c = o.sheets[a], m = s.utils.json_to_sheet([{}]);
|
|
1415
1415
|
s.utils.book_append_sheet(n, m, c.name);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.15
|
|
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.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as o, jsxs as T } from "react/jsx-runtime";
|
|
2
|
+
import { memo as k, useState as i, useCallback as N } from "react";
|
|
3
|
+
import { Box as w, FormControlLabel as F, Checkbox as j } from "@mui/material";
|
|
4
|
+
import { T as v, D as y, o as B } from "./D0v3VaJtA3LjHpWR.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.15
|
|
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 H = ["Ok", "Cancel"], L = k((g) => {
|
|
12
|
+
const { tableOptions: a, context: r, onOption: p, onValidateOption: I, onDone: c, options: d = H, defaultOption: t = d?.[0], cancelOption: s = "Cancel", sx: u, ...x } = g, [b, h] = i(!1), [n, f] = i(() => a?.hasHeader ?? !1), [l, O] = i(() => a?.ranges ?? null), C = v((e) => {
|
|
13
|
+
const m = { ...a, hasHeader: n, ranges: l };
|
|
14
|
+
p?.(e, e === s, e === t), c?.({ option: e, tableOptions: m });
|
|
15
|
+
}, [c, p, t, s, n, l, a]), D = N(async (e, m) => null, []);
|
|
16
|
+
return o(y, { title: "Insert Table", options: d, onDone: C, onValidateOption: D, defaultOption: t, cancelOption: s, autoFocusSel: ".range-input input", sx: { width: "360px", ...u }, ...x, children: T(w, { sx: { paddingTop: (e) => e.spacing(1), paddingBottom: (e) => e.spacing(0), rowGap: (e) => e.spacing(1), display: "flex", flexDirection: "column" }, children: [o(B, { formName: "range", value: l, onChangeInput: (e) => O(e), resolvedAddress: r.getNames().getRanges.bind(r.getNames()), onFocus: (e) => {
|
|
17
|
+
b || e.target?.select(), h(!0);
|
|
18
|
+
} }), o(F, { control: o(j, { checked: n, onChange: () => f(!n) }), label: "Table has headers", labelPlacement: "end" })] }) });
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
L as TableNewDialog,
|
|
22
|
+
L as default
|
|
23
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as d, jsxs as k } from "react/jsx-runtime";
|
|
2
2
|
import { memo as E, useMemo as V, useState as p, useCallback as h } from "react";
|
|
3
3
|
import { Box as L } from "@mui/material";
|
|
4
|
-
import { T as u,
|
|
4
|
+
import { T as u, D as S, N as A, o as G } from "./D0v3VaJtA3LjHpWR.mjs";
|
|
5
5
|
/**
|
|
6
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.
|
|
6
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.15
|
|
7
7
|
*
|
|
8
8
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
9
9
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -11,7 +11,7 @@ import { T as u, a1 as S, ai as A, aj as G } from "./CSKgHJSTMvOEe2RH.mjs";
|
|
|
11
11
|
const M = ["Ok", "Cancel"], J = E((C) => {
|
|
12
12
|
const { value: a = null, context: t, onOption: c, onValidateOption: U, onDone: m, onUpdate: g, options: x = M, defaultOption: f = x?.[0], cancelOption: N = "Cancel", sx: R, ...v } = C, T = V(() => t?.getNames().findValidName("Range1"), []), i = V(() => {
|
|
13
13
|
if (!a) return !0;
|
|
14
|
-
}, []), [n,
|
|
14
|
+
}, []), [n, D] = p({ displayText: a?.getName() ?? T, errorText: null }), [o, w] = p({ displayValue: a?.getRanges() ?? t?.selection() ?? null, errorText: null }), [y, O] = p(!1), F = h(async (e) => !n.errorText && !o.errorText, [t]), B = u((e, l, r) => {
|
|
15
15
|
if (!l) {
|
|
16
16
|
let s = null;
|
|
17
17
|
i ? s = t?.getNames().addReference(n?.displayText, o?.displayValue, !1) : (a.getType() === "reference" && a.doBatch(() => {
|
|
@@ -19,22 +19,22 @@ const M = ["Ok", "Cancel"], J = E((C) => {
|
|
|
19
19
|
}, `Edit Named '${n?.displayText}'`), s = a), s && (s.select(), g(s, i));
|
|
20
20
|
}
|
|
21
21
|
c?.(e, l, r), m?.();
|
|
22
|
-
}, [t, n, o, m, c, f, N, g]),
|
|
22
|
+
}, [t, n, o, m, c, f, N, g]), I = u((e) => {
|
|
23
23
|
let l = null;
|
|
24
24
|
try {
|
|
25
25
|
t?.getNames().validateName(e);
|
|
26
26
|
} catch (r) {
|
|
27
27
|
l = r.message;
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
}, []),
|
|
29
|
+
D({ displayText: e, errorText: l });
|
|
30
|
+
}, []), b = u((e) => {
|
|
31
31
|
a && a.getName().toLowerCase() === e.toLowerCase() || t?.getNames().validateName(e);
|
|
32
|
-
}, [t, a]),
|
|
33
|
-
|
|
32
|
+
}, [t, a]), j = h((e) => {
|
|
33
|
+
w({ displayValue: e ?? null, errorText: null });
|
|
34
34
|
}, []);
|
|
35
|
-
return d(S, { title: (i ? "Define" : "Edit") + " Range", options: x, onOption:
|
|
35
|
+
return d(S, { title: (i ? "Define" : "Edit") + " Range", options: x, onOption: B, onValidateOption: F, defaultOption: f, cancelOption: N, autoFocusSel: ".autoFocus", sx: { width: "460px", ...R }, ...v, children: k(L, { sx: { paddingTop: (e) => e.spacing(1), paddingBottom: (e) => e.spacing(0), rowGap: (e) => e.spacing(1), range: "flex", flexDirection: "column" }, children: [d(A, { formName: "name", defaultInput: T, value: n.displayText, onChangeInput: I, onValidate: b, onFocus: (e) => {
|
|
36
36
|
y || e.target?.select(), O(!0);
|
|
37
|
-
} }), d(G, { formName: "range", value: o.displayValue, onChangeInput:
|
|
37
|
+
} }), d(G, { formName: "range", value: o.displayValue, onChangeInput: j, resolvedAddress: t.getNames().getRanges.bind(t.getNames()), onFocus: (e) => {
|
|
38
38
|
y || e.target?.select(), O(!0);
|
|
39
39
|
} })] }) });
|
|
40
40
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Y } from "./
|
|
2
|
-
import { c as x, b as f, r as I, t as Z, a as A, p as D, d as tt } from "./
|
|
1
|
+
import { Y } from "./D0v3VaJtA3LjHpWR.mjs";
|
|
2
|
+
import { c as x, b as f, r as I, t as Z, a as A, p as D, d as tt } from "./D4DvAg7aaaWl0TPV.mjs";
|
|
3
3
|
import { IFont as k, IAutoFilter as T, Sort as G, IRange as et, AddressUtils as W, IFill as C, IStyle as rt, ITextFrame as P, FormulaError as st, IBorder as V } from "@sheetxl/sdk";
|
|
4
4
|
/**
|
|
5
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.
|
|
5
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.15
|
|
6
6
|
*
|
|
7
7
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
8
8
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { memo as O, useState as r, useRef as E, useReducer as M, useMemo as A } from "react";
|
|
3
3
|
import { DialogContent as W, Box as n } from "@mui/material";
|
|
4
|
-
import {
|
|
4
|
+
import { l as q, b as V, m as k, n as G, T as x, j as J, N as K, o as Q, P as f, p as U, q as X, v as y, w as b, y as w, L as S } from "./D0v3VaJtA3LjHpWR.mjs";
|
|
5
5
|
/**
|
|
6
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.
|
|
6
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.15
|
|
7
7
|
*
|
|
8
8
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
9
9
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
10
10
|
*/
|
|
11
11
|
const ae = O((C) => {
|
|
12
|
-
const { title:
|
|
13
|
-
|
|
14
|
-
const o = T ?? c.context(), t = o.table(), [
|
|
12
|
+
const { title: v, onHide: N, autoFocusSel: R = ".range-input input", context: T, notifier: l = q, command: c, commands: d, ...D } = C, [F, g] = r(!1), [m, p] = r(!1), h = E(null), [Y, B] = M((e) => e + 1, 0), [H, { width: Z }] = V();
|
|
13
|
+
k(c);
|
|
14
|
+
const o = T ?? c.context(), t = o.table(), [P, j] = r(() => t ? o.getNames().getRanges(t.getRange()) : null), I = A(() => t?.getName() ?? "", [t]);
|
|
15
15
|
G(o.table(), { onAnchorCoordsChange(e) {
|
|
16
|
-
|
|
16
|
+
j(o.getNames().getRanges(e.getRange()));
|
|
17
17
|
}, onProtectedChange(e) {
|
|
18
|
-
|
|
18
|
+
B();
|
|
19
19
|
} });
|
|
20
|
-
const
|
|
20
|
+
const L = x((e) => {
|
|
21
21
|
o?.table().setName(e);
|
|
22
|
-
}, [o]),
|
|
22
|
+
}, [o]), z = x((e) => {
|
|
23
23
|
o?.table().resize(e.at(0));
|
|
24
24
|
}, [o]);
|
|
25
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:
|
|
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: v ?? "Table Details", initialPosition: { y: "35" }, autoFocusSel: R, onHide: N, onFocus: () => g(!0), onBlur: (e) => {
|
|
27
27
|
h?.current?.contains(e.relatedTarget) || g(!1);
|
|
28
|
-
}, PaperProps: { elevation: F ? 3 : 1 }, ...D, children: s(W, { dividers: !0, ref:
|
|
28
|
+
}, PaperProps: { elevation: F ? 3 : 1 }, ...D, children: s(W, { dividers: !0, ref: H, 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: L, onValidate: (e) => {
|
|
29
29
|
t && t.getName().toLowerCase() === e.toLowerCase() || o?.getNames().validateName(e);
|
|
30
30
|
}, disabled: t?.isProtected() ?? !0, onFocus: (e) => {
|
|
31
31
|
m || e.target?.select(), p(!0);
|
|
32
|
-
} }), a(Q, { formName: "range", value:
|
|
32
|
+
} }), a(Q, { formName: "range", value: P, onChangeInput: z, resolvedAddress: o.getNames().getRanges.bind(o.getNames()), disabled: t?.isProtected() ?? !0, onFocus: (e) => {
|
|
33
33
|
m || e.target?.select(), p(!0);
|
|
34
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
35
|
t.updateStyleOptions(e);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.15
|
|
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.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { memo as z, forwardRef as A, useState as s } from "react";
|
|
3
|
+
import { s as t, Z as E, D as R, A as K, R as O } from "./D0v3VaJtA3LjHpWR.mjs";
|
|
4
|
+
import { Box as W, FormControl as Z, TextField as q } 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.15
|
|
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(A((w, F) => {
|
|
13
|
+
const { initialValue: T = "", onOption: C, onValidateOption: r, onInputOption: l, onValidateInputOption: p, onDone: u, inputProps: c, inputLabel: I, inputType: P, inputPlaceHolder: v, options: d = G, autoFocusSel: b = ".autoFocus", cancelOption: m, defaultOption: g = d?.[0], ...k } = w, [D, V] = s(!1), [a, B] = s(T), [S, H] = s(""), [L, M] = s(!0), e = t(async (o, n) => {
|
|
14
|
+
if (!p) return !0;
|
|
15
|
+
const h = await p?.(o, n);
|
|
16
|
+
H(h?.message ?? "");
|
|
17
|
+
const x = h?.valid ?? !0;
|
|
18
|
+
return M(x), x;
|
|
19
|
+
}, [p]), f = t(async (o) => {
|
|
20
|
+
l?.(a, o);
|
|
21
|
+
}, [a, l, u, C, m, g]), N = t(async (o) => {
|
|
22
|
+
o.keyCode === E.Enter && await e?.(a, null);
|
|
23
|
+
}, [a, f]), $ = t((o) => {
|
|
24
|
+
B(o.target.value), e?.(o.target.value, null);
|
|
25
|
+
}, [r]), j = t(async (o) => {
|
|
26
|
+
let n = await e(a, o);
|
|
27
|
+
try {
|
|
28
|
+
n !== !1 && (n = await e(a, o));
|
|
29
|
+
} catch {
|
|
30
|
+
}
|
|
31
|
+
return n ?? !0;
|
|
32
|
+
}, [a, r]);
|
|
33
|
+
return i(R, { options: d, onDone: u, onOption: (o, n) => {
|
|
34
|
+
n || f(o);
|
|
35
|
+
}, onValidateOption: j, cancelOption: m, defaultOption: g, autoFocusSel: b, ref: F, ...k, children: i(W, { sx: { paddingTop: (o) => o.spacing(1), paddingBottom: (o) => o.spacing(0) }, children: i(Z, { sx: { paddingTop: (o) => o.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: i(q, { onFocus: (o) => {
|
|
36
|
+
D || o.target?.select(), V(!0);
|
|
37
|
+
}, type: P, label: I, helperText: S || " ", sx: { width: "100%", "& .MuiFormHelperText-root": { marginTop: (o) => o.spacing(0.5), color: L ? void 0 : "error.main" } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { placeholder: v, spellCheck: !1, autoComplete: "off", ...c, className: K("autoFocus", c?.className), sx: { paddingTop: (o) => o.spacing(1.25), paddingBottom: (o) => o.spacing(0.75), backgroundImage: `linear-gradient(${y("#fff", O(5))}, ${y("#fff", O(5))})` } } }, value: a, onChange: $, onKeyDown: N, onContextMenu: (o) => {
|
|
38
|
+
o.stopPropagation();
|
|
39
|
+
} }) }) }) });
|
|
40
|
+
}));
|
|
41
|
+
export {
|
|
42
|
+
_ as default
|
|
43
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Oe from "react";
|
|
2
2
|
import { createElement as Er, forwardRef as la, useRef as fa, useImperativeHandle as pa, useEffect as da } from "react";
|
|
3
3
|
/**
|
|
4
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.
|
|
4
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.15
|
|
5
5
|
*
|
|
6
6
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
7
7
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Workbook as y, IRange as k } from "@sheetxl/sdk";
|
|
2
2
|
/**
|
|
3
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.
|
|
3
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.15
|
|
4
4
|
*
|
|
5
5
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
6
6
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
7
7
|
*/
|
|
8
8
|
const E = async (a, p) => {
|
|
9
|
-
const { trimLeadingBlankRow: i = !0, trimLeadingBlankColumn: f = !0, excludeHidden: h = !1, sheetKey: r = null, papaParseConfig: m = {} } = p || {}, u = await import("./
|
|
9
|
+
const { trimLeadingBlankRow: i = !0, trimLeadingBlankColumn: f = !0, excludeHidden: h = !1, sheetKey: r = null, papaParseConfig: m = {} } = p || {}, u = await import("./jqoS02EUPE2WEY1t.mjs").then((s) => s.p);
|
|
10
10
|
if (!a) throw new Error("workbook must be specified");
|
|
11
11
|
let t = null;
|
|
12
12
|
if (r === null ? t = a.getSelectedSheet() : typeof r == "number" ? t = a.getSheets().search()[r] : typeof r == "string" && (t = a.getSheets().getByName(r)), !t) throw new Error("invalid sheetKey specified");
|
|
@@ -27,7 +27,7 @@ const E = async (a, p) => {
|
|
|
27
27
|
const o = { ...m }, g = u.unparse(d, o);
|
|
28
28
|
return new TextEncoder().encode(g).buffer;
|
|
29
29
|
}, b = async (a, p) => {
|
|
30
|
-
const { papaParseConfig: i, setValuesOptions: f, createWorkbookOptions: h } = p ?? {}, r = await import("./
|
|
30
|
+
const { papaParseConfig: i, setValuesOptions: f, createWorkbookOptions: h } = p ?? {}, r = await import("./jqoS02EUPE2WEY1t.mjs").then((o) => o.p), m = new TextDecoder().decode(a);
|
|
31
31
|
let u = -1;
|
|
32
32
|
const t = new y(h), c = t.getSelectedSheet().getEntireRange().startIncrementalUpdates({ orientation: k.Orientation.Row }), d = p?.onProgress;
|
|
33
33
|
let e = 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.15
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { jsx as o, jsxs as A } from "react/jsx-runtime";
|
|
2
|
-
import { memo as E, useMemo as
|
|
3
|
-
import { Box as S, FormControl as
|
|
4
|
-
import { T as f,
|
|
2
|
+
import { memo as E, useMemo as D, useState as m, useCallback as F } from "react";
|
|
3
|
+
import { Box as S, FormControl as O, TextField as P } from "@mui/material";
|
|
4
|
+
import { T as f, D as U, a as l } from "./D0v3VaJtA3LjHpWR.mjs";
|
|
5
5
|
import { alpha as p } from "@mui/system";
|
|
6
6
|
/**
|
|
7
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.
|
|
7
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.15
|
|
8
8
|
*
|
|
9
9
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
10
10
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
11
11
|
*/
|
|
12
|
-
const V = ["Ok", "Cancel"], Q = E((
|
|
13
|
-
const { initialHyperlink: t = null, initialDisplay: H = null, onUpdateHyperlink: x, context: s, onOption: h, onValidateOption: r, onDone: d, options: y = V, defaultOption: c = y?.[0], cancelOption: i = "Cancel", sx: I, ...v } =
|
|
14
|
-
let n = null,
|
|
15
|
-
t && (typeof t == "string" ?
|
|
12
|
+
const V = ["Ok", "Cancel"], Q = E((b) => {
|
|
13
|
+
const { initialHyperlink: t = null, initialDisplay: H = null, onUpdateHyperlink: x, context: s, onOption: h, onValidateOption: r, onDone: d, options: y = V, defaultOption: c = y?.[0], cancelOption: i = "Cancel", sx: I, ...v } = b, w = D(() => (t ?? s?.()?.getHyperlink()) !== null, []), T = D(() => {
|
|
14
|
+
let n = null, a = null;
|
|
15
|
+
t && (typeof t == "string" ? a = t : n = t);
|
|
16
16
|
const g = n ?? s?.()?.getHyperlink();
|
|
17
|
-
return { address:
|
|
18
|
-
}, [t, s]), [
|
|
17
|
+
return { address: a ?? g?.getAddress() ?? "", textToDisplay: g?.getDisplayText() ?? "" };
|
|
18
|
+
}, [t, s]), [e, M] = m(T.address), [u, B] = m(() => {
|
|
19
19
|
const n = s?.().toTextUnformatted() ?? H;
|
|
20
20
|
return n === T.address ? "" : n;
|
|
21
|
-
}), [$, k] = m(!1), L =
|
|
21
|
+
}), [$, k] = m(!1), L = F((n) => {
|
|
22
22
|
B(n.target.value);
|
|
23
|
-
}, []), C =
|
|
24
|
-
n !== i && x?.(
|
|
25
|
-
}, [
|
|
23
|
+
}, []), C = F(async (n, a) => null, []), W = f(async (n) => {
|
|
24
|
+
n !== i && x?.(e === "" ? null : { address: e }, u), h?.(n, n === i, n === c), d?.();
|
|
25
|
+
}, [e, u, x, d, h, c, i]), j = f((n) => {
|
|
26
26
|
M(n.target.value), C(n.target.value, null);
|
|
27
27
|
}, [r]), z = f(async (n) => {
|
|
28
|
-
let
|
|
28
|
+
let a = await Promise.resolve(r?.(n));
|
|
29
29
|
try {
|
|
30
|
-
|
|
30
|
+
a !== !1 && (a = await C(e, n));
|
|
31
31
|
} catch {
|
|
32
32
|
}
|
|
33
|
-
return
|
|
33
|
+
return a ?? !0;
|
|
34
34
|
}, [r]);
|
|
35
|
-
return o(U, { title: (w ? "Edit" : "Insert") + " Link", options: y, onDone: d, onOption: (n) => W(n), onValidateOption: z, defaultOption: c, cancelOption: i, autoFocusSel: ".autoFocus", sx: { width: "480px", ...I }, ...v, children: A(S, { sx: { paddingTop: (n) => n.spacing(1), paddingBottom: (n) => n.spacing(0), rowGap: (n) => n.spacing(1), display: "flex", flexDirection: "column" }, children: [o(
|
|
35
|
+
return o(U, { title: (w ? "Edit" : "Insert") + " Link", options: y, onDone: d, onOption: (n) => W(n), onValidateOption: z, defaultOption: c, cancelOption: i, autoFocusSel: ".autoFocus", sx: { width: "480px", ...I }, ...v, children: A(S, { sx: { paddingTop: (n) => n.spacing(1), paddingBottom: (n) => n.spacing(0), rowGap: (n) => n.spacing(1), display: "flex", flexDirection: "column" }, children: [o(O, { sx: { paddingTop: (n) => n.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: o(P, { label: "Address", placeholder: "Enter a url or cell reference.", onFocus: (n) => {
|
|
36
36
|
$ || n.target?.select(), k(!0);
|
|
37
|
-
}, sx: { "& .MuiFormHelperText-root": { marginTop: (n) => n.spacing(0.5) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { className: "autoFocus", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (n) => n.spacing(1.25), paddingBottom: (n) => n.spacing(0.75), backgroundImage: `linear-gradient(${p("#fff", l(5))}, ${p("#fff", l(5))})` } } }, value:
|
|
37
|
+
}, sx: { "& .MuiFormHelperText-root": { marginTop: (n) => n.spacing(0.5) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { className: "autoFocus", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (n) => n.spacing(1.25), paddingBottom: (n) => n.spacing(0.75), backgroundImage: `linear-gradient(${p("#fff", l(5))}, ${p("#fff", l(5))})` } } }, value: e, onChange: j, onContextMenu: (n) => {
|
|
38
38
|
n.stopPropagation();
|
|
39
|
-
} }) }), o(
|
|
39
|
+
} }) }), o(O, { sx: { paddingTop: (n) => n.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: o(P, { label: "Display Text", placeholder: e?.startsWith("#") ? e.substring(1) : e, onFocus: () => {
|
|
40
40
|
k(!0);
|
|
41
41
|
}, sx: { "& .MuiFormHelperText-root": { marginTop: (n) => n.spacing(0.5) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { spellCheck: !1, autoComplete: "off", sx: { paddingTop: (n) => n.spacing(1.25), paddingBottom: (n) => n.spacing(0.75), backgroundImage: `linear-gradient(${p("#fff", l(5))}, ${p("#fff", l(5))})` } } }, value: u, onChange: L, onContextMenu: (n) => {
|
|
42
42
|
n.stopPropagation();
|
|
@@ -1,153 +1,153 @@
|
|
|
1
1
|
import { jsx as i, jsxs as p } from "react/jsx-runtime";
|
|
2
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
|
|
3
|
+
import { DialogContent as de, Box as O, TextField as Z, InputAdornment as ue, Collapse as _, MenuItem as fe, FormControl as ge, InputLabel as me, Select as xe } from "@mui/material";
|
|
4
4
|
import { ArrowBack as he, ArrowUpward as Oe, ArrowForward as Ce, ArrowDownward as ye } from "@mui/icons-material";
|
|
5
5
|
import { ICell as c, IRange as R } from "@sheetxl/sdk";
|
|
6
|
-
import { T as
|
|
6
|
+
import { T as W, e as be, b as Te, j as ve, d as m, w as x, I as Re, f as y, h as ke, F as we, $ as Fe, W as Ie, a as k, k as Se, B as Ee, P as De } from "./D0v3VaJtA3LjHpWR.mjs";
|
|
7
7
|
import { alpha as w } from "@mui/system";
|
|
8
8
|
/**
|
|
9
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.
|
|
9
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.15
|
|
10
10
|
*
|
|
11
11
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
12
12
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
13
13
|
*/
|
|
14
|
-
const
|
|
15
|
-
const { label: h, value:
|
|
14
|
+
const L = ie((F) => {
|
|
15
|
+
const { label: h, value: a, options: s, onSelect: d, tabIndex: T = 0, ...P } = F, [A, v] = b(() => ne(a, s));
|
|
16
16
|
D(() => {
|
|
17
|
-
v(ne(
|
|
18
|
-
}, [
|
|
19
|
-
const K =
|
|
17
|
+
v(ne(a, s));
|
|
18
|
+
}, [a, s]);
|
|
19
|
+
const K = W((u) => {
|
|
20
20
|
v(u.target.value), d?.(s[u.target.value]);
|
|
21
21
|
}, [d, s]), l = pe(() => Object.keys(s).map((u) => i(fe, { value: u, children: u }, u)), [s]);
|
|
22
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
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
24
|
delete se.Values;
|
|
25
|
-
const Pe = { "By Rows": !0, "By Columns": !1 }, ne = (
|
|
26
|
-
const
|
|
27
|
-
for (let s = 0; s <
|
|
28
|
-
const d =
|
|
29
|
-
if (h[d] ===
|
|
25
|
+
const Pe = { "By Rows": !0, "By Columns": !1 }, ne = (F, h) => {
|
|
26
|
+
const a = Object.keys(h);
|
|
27
|
+
for (let s = 0; s < a.length; s++) {
|
|
28
|
+
const d = a[s];
|
|
29
|
+
if (h[d] === F) return d;
|
|
30
30
|
}
|
|
31
|
-
},
|
|
32
|
-
const { replace: h = !1, findText:
|
|
31
|
+
}, je = ie((F) => {
|
|
32
|
+
const { replace: h = !1, findText: a, replaceText: s, findOptions: d, replaceOptions: T, title: P, onHide: A, onFindOrReplace: v, ...K } = F, l = C(null), u = C(null), j = C(null), V = C(null), N = C(null), H = C(null), z = (e, t) => {
|
|
33
33
|
t && (t.start(e, { center: !1 }), setTimeout(() => t.stop(e), 180));
|
|
34
|
-
}, [U,
|
|
34
|
+
}, [U, E] = b(!1), [B, le] = b(!1), [f, M] = b(h), [X, $] = b(!1), [G, q] = b(!1), [o, r] = 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 }), I = W(async (e, t, n, S) => {
|
|
35
35
|
if (!v) return;
|
|
36
36
|
const g = { ...o };
|
|
37
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
|
|
39
|
-
|
|
38
|
+
const ae = await v({ autoFocus: S, ...g });
|
|
39
|
+
$(ae === 0);
|
|
40
40
|
}, [o, v]);
|
|
41
41
|
D(() => {
|
|
42
|
-
|
|
43
|
-
}, [o,
|
|
44
|
-
const
|
|
42
|
+
$(!1);
|
|
43
|
+
}, [o, B, f]);
|
|
44
|
+
const J = W((e, t) => {
|
|
45
45
|
if (e.keyCode === be.Enter) {
|
|
46
46
|
if (!o.findText) return;
|
|
47
|
-
let n = !0,
|
|
48
|
-
e.shiftKey && (n = !1), t ? (e.ctrlKey && e.altKey && (
|
|
47
|
+
let n = !0, S = !1;
|
|
48
|
+
e.shiftKey && (n = !1), t ? (e.ctrlKey && e.altKey && (S = !0), z(e, S ? H.current : N.current)) : z(e, n ? V.current : j.current), I(n, t, S, !1);
|
|
49
49
|
}
|
|
50
|
-
}, [o]),
|
|
50
|
+
}, [o]), Q = C(null);
|
|
51
51
|
ce(() => {
|
|
52
|
-
|
|
52
|
+
r((e) => {
|
|
53
53
|
const t = { ...e };
|
|
54
|
-
t.findText =
|
|
54
|
+
t.findText = a && a.length > 0 ? a : e.findText ?? "", E(!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
55
|
const n = !(!T && s === void 0);
|
|
56
|
-
return n &&
|
|
57
|
-
}), G ||
|
|
58
|
-
}, [
|
|
59
|
-
f ? (o.findOptions.fields[0], c.Content.Values) :
|
|
56
|
+
return n && M(n), t;
|
|
57
|
+
}), G || Q.current?.focus();
|
|
58
|
+
}, [a, s, d, T]), D(() => {
|
|
59
|
+
f ? (o.findOptions.fields[0], c.Content.Values) : E(!0);
|
|
60
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
|
|
62
|
-
l.current?.select(),
|
|
61
|
+
if (U && l.current && o.findText === l.current.value) return l.current === document.activeElement || l.current.contains(document.activeElement) ? (l.current?.select(), void E(!1)) : void l.current.addEventListener("focus", () => {
|
|
62
|
+
l.current?.select(), E(!1);
|
|
63
63
|
}, { once: !0 });
|
|
64
64
|
}, [U, o]);
|
|
65
|
-
const [
|
|
66
|
-
return i(ve, { ref:
|
|
67
|
-
|
|
68
|
-
}, PaperProps: { elevation: G ? 3 : 1 }, ...K, children: p(de, { dividers: !0, ref:
|
|
69
|
-
if (e.key === "h" && e.ctrlKey)
|
|
65
|
+
const [re, { width: Y }] = Te();
|
|
66
|
+
return i(ve, { ref: Q, title: P ?? (f ? "Find & Replace" : "Find"), initialPosition: { y: "35" }, autoFocusSel: ".input", onHide: A, onFocus: () => q(!0), onBlur: () => {
|
|
67
|
+
q(!1), $(!1);
|
|
68
|
+
}, PaperProps: { elevation: G ? 3 : 1 }, ...K, children: p(de, { dividers: !0, ref: re, 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) M(!0), l.current?.contains(document.activeElement) && u.current?.focus();
|
|
70
70
|
else if (e.key === "f" && e.ctrlKey) l.current?.focus();
|
|
71
|
-
else if (e.key === "c" && e.altKey)
|
|
71
|
+
else if (e.key === "c" && e.altKey) r((t) => {
|
|
72
72
|
const n = { ...t };
|
|
73
73
|
return n.findOptions.matchCase = !t.findOptions.matchCase, n;
|
|
74
74
|
});
|
|
75
|
-
else if (e.key === "e" && e.altKey)
|
|
75
|
+
else if (e.key === "e" && e.altKey) r((t) => {
|
|
76
76
|
const n = { ...t };
|
|
77
77
|
return n.findOptions.matchEntireCell = !t.findOptions.matchEntireCell, n;
|
|
78
78
|
});
|
|
79
79
|
else {
|
|
80
80
|
if (e.key !== "r" || !e.altKey) return;
|
|
81
|
-
|
|
81
|
+
r((t) => {
|
|
82
82
|
const n = { ...t };
|
|
83
83
|
return n.findOptions.useRegex = !t.findOptions.useRegex, n;
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
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:
|
|
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: B, onSelectToggle: (e) => {
|
|
88
88
|
le(e);
|
|
89
89
|
}, preventFocus: !0, label: "Toggle Additional Options", icon: x(i(Re, {})) }), i(m, { selected: f, onSelectToggle: (e) => {
|
|
90
|
-
|
|
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(
|
|
92
|
-
|
|
90
|
+
M(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(Z, { label: "Find", InputLabelProps: { shrink: !0 }, InputProps: { sx: { paddingRight: (e) => e.spacing(1), minWidth: Y > 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
|
+
r((t) => {
|
|
93
93
|
const n = { ...t };
|
|
94
94
|
return n.findOptions.matchCase = e, n;
|
|
95
95
|
});
|
|
96
96
|
}, label: "Match Case", shortcut: { key: "C", modifiers: [y.Alt] }, icon: x(i(we, {})) }), i(m, { selected: o.findOptions.matchEntireCell, onSelectToggle: (e) => {
|
|
97
|
-
|
|
97
|
+
r((t) => {
|
|
98
98
|
const n = { ...t };
|
|
99
99
|
return n.findOptions.matchEntireCell = e, n;
|
|
100
100
|
});
|
|
101
|
-
}, label: "Match Entire Cell", shortcut: { key: "E", modifiers: [y.Alt] }, icon: x(i(
|
|
102
|
-
|
|
101
|
+
}, label: "Match Entire Cell", shortcut: { key: "E", modifiers: [y.Alt] }, icon: x(i(Fe, {})) }), i(m, { selected: o.findOptions.useRegex, onSelectToggle: (e) => {
|
|
102
|
+
r((t) => {
|
|
103
103
|
const n = { ...t };
|
|
104
104
|
return n.findOptions.useRegex = e, n;
|
|
105
105
|
});
|
|
106
|
-
}, label: "Use Regular Expression", shortcut: { key: "R", modifiers: [y.Alt] }, icon: x(i(
|
|
107
|
-
|
|
106
|
+
}, label: "Use Regular Expression", shortcut: { key: "R", modifiers: [y.Alt] }, icon: x(i(Ie, {})) })] }) }) }, 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
|
+
r((t) => {
|
|
108
108
|
const n = { ...t };
|
|
109
109
|
return n.findText = e.target.value, n;
|
|
110
110
|
});
|
|
111
|
-
}, onKeyDown: (e) =>
|
|
111
|
+
}, onKeyDown: (e) => J(e, !1), onContextMenu: (e) => {
|
|
112
112
|
e.stopPropagation();
|
|
113
113
|
} }), i(m, { selected: o.findOptions.reverse, onSelectToggle: (e) => {
|
|
114
|
-
|
|
115
|
-
}, touchRippleRef:
|
|
116
|
-
|
|
117
|
-
}, touchRippleRef:
|
|
114
|
+
I(!1, !1);
|
|
115
|
+
}, touchRippleRef: j, 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
|
+
I(!0, !1);
|
|
117
|
+
}, touchRippleRef: V, 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
118
|
l.current?.focus();
|
|
119
|
-
}, children: p(O, { sx: { display: "flex", flexDirection: "row", alignItems: "center", marginTop: (e) => e.spacing(2) }, children: [i(
|
|
120
|
-
|
|
119
|
+
}, children: p(O, { sx: { display: "flex", flexDirection: "row", alignItems: "center", marginTop: (e) => e.spacing(2) }, children: [i(Z, { 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
|
+
r((t) => {
|
|
121
121
|
const n = { ...t };
|
|
122
122
|
return n.replaceText = e.target.value, n;
|
|
123
123
|
});
|
|
124
|
-
}, onKeyDown: (e) =>
|
|
124
|
+
}, onKeyDown: (e) => J(e, !0), onContextMenu: (e) => {
|
|
125
125
|
e.stopPropagation();
|
|
126
126
|
} }), i(m, { onSelectToggle: (e) => {
|
|
127
|
-
|
|
128
|
-
}, touchRippleRef: N, label: "Replace", shortcut: { key: "Enter" }, icon: x(i(
|
|
129
|
-
|
|
130
|
-
}, touchRippleRef: H, label: "Replace All", shortcut: { key: "Enter", modifiers: [y.Ctrl, y.Alt] }, icon: x(i(
|
|
127
|
+
I(!0, !0);
|
|
128
|
+
}, touchRippleRef: N, label: "Replace", shortcut: { key: "Enter" }, icon: x(i(Se, {})), disabled: !o.findText }), i(m, { onSelectToggle: (e) => {
|
|
129
|
+
I(!0, !0, !0);
|
|
130
|
+
}, touchRippleRef: H, label: "Replace All", shortcut: { key: "Enter", modifiers: [y.Ctrl, y.Alt] }, icon: x(i(Ee, {})), disabled: !o.findText })] }) })] })] }), i(_, { in: B, timeout: te, onExit: () => {
|
|
131
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:
|
|
133
|
-
|
|
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: Y >= 413 ? "row" : "column", justifyContent: "space-evenly", alignItems: "center", rowGap: (e) => e.spacing(2) }, tabIndex: -1, children: [i(L, { label: "Within", value: o.scope, options: ee, onSelect: (e) => {
|
|
133
|
+
r((t) => {
|
|
134
134
|
const n = { ...t };
|
|
135
135
|
return n.scope = e, n;
|
|
136
136
|
});
|
|
137
|
-
} }), i(
|
|
138
|
-
|
|
137
|
+
} }), i(L, { label: "Search", value: o.findOptions.orientation !== R.Orientation.Column, options: Pe, onSelect: (e) => {
|
|
138
|
+
r((t) => {
|
|
139
139
|
const n = { ...t };
|
|
140
140
|
return n.findOptions.orientation = e ? R.Orientation.Row : R.Orientation.Column, n;
|
|
141
141
|
});
|
|
142
|
-
} }), i(
|
|
143
|
-
|
|
142
|
+
} }), i(L, { 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
|
+
r((t) => {
|
|
144
144
|
const n = { ...t };
|
|
145
145
|
return n.findOptions.fields = [e], n;
|
|
146
146
|
});
|
|
147
147
|
} })] })] }) })] }) });
|
|
148
148
|
});
|
|
149
149
|
export {
|
|
150
|
-
|
|
150
|
+
je as FindReplaceWindow,
|
|
151
151
|
ee as ScopeOptions,
|
|
152
|
-
|
|
152
|
+
je as default
|
|
153
153
|
};
|