@sheetxl/studio-mui 0.4.10 → 0.4.11
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/B29yIlf_FSHx9q3M.cjs +7 -0
- package/browser/cjs/B783moVfFT70yQuK.cjs +7 -0
- package/browser/cjs/BCtVyhxIZSUPH_Z4.cjs +7 -0
- package/browser/cjs/BE6O6K7i1mHBC3et.cjs +7 -0
- package/browser/cjs/BQ-G2ABc3FYN-D50.cjs +7 -0
- package/browser/cjs/BabvaPi1dUIPt5AG.cjs +7 -0
- package/browser/cjs/BbvcxaJzfy7H6xfa.cjs +7 -0
- package/browser/cjs/Bhh0dqxUzzOzHWMc.cjs +7 -0
- package/browser/cjs/CH50hiw_7LBSC6dR.cjs +7 -0
- package/browser/cjs/Cfb0T6htsh82UPK-.cjs +7 -0
- package/browser/cjs/CisYglNTHGrj9oMH.cjs +7 -0
- package/browser/cjs/Clbakb5VUTDTlofM.cjs +7 -0
- package/browser/cjs/D7xmeRe-f7IifEKc.cjs +7 -0
- package/browser/cjs/DCV-6w2JGk_faE3x.cjs +7 -0
- package/browser/cjs/DY2PuDSgw0TrB5-_.cjs +7 -0
- package/browser/cjs/Df5v6knUJ4dqHmmo.cjs +7 -0
- package/browser/cjs/DyzVC_iq7ceqC2fj.cjs +7 -0
- package/browser/cjs/QB_8kWYEsfOH_HwK.cjs +7 -0
- package/browser/cjs/aOmlMJRAkQEF59EX.cjs +7 -0
- package/browser/cjs/index.cjs +10 -4
- package/browser/cjs/li-J7BWV6WUzY5aq.cjs +7 -0
- package/browser/cjs/u0WmWLGlCwhnhL9i.cjs +7 -0
- package/browser/cjs/uoBAuXnlUz8scSA1.cjs +7 -0
- package/browser/cjs/xp2ZII-PuLk9tHK3.cjs +7 -0
- package/browser/cjs/xq-CJbsvm7BQO8lK.cjs +7 -0
- package/browser/esm/12Ttun7hzbiInyVr.mjs +7 -0
- package/browser/esm/7jSMnphGrNRPUa_S.mjs +7 -0
- package/browser/esm/AnCmK-idMDJ2vI8H.mjs +7 -0
- package/browser/esm/B-Ut_yUCD9THCz0T.mjs +7 -0
- package/browser/esm/BTD5k7gtFcqDwslB.mjs +7 -0
- package/browser/esm/BVRUNnRvnt7aVCDD.mjs +7 -0
- package/browser/esm/BauTkiamxm0HDt6M.mjs +7 -0
- package/browser/esm/BcIp2mxLBfjUBE0q.mjs +7 -0
- package/browser/esm/Bi_0z0hyhFuz5Ta3.mjs +7 -0
- package/browser/esm/BkDEdK7zOlsoUKCZ.mjs +7 -0
- package/browser/esm/BpGexBYtmHbTIJz2.mjs +7 -0
- package/browser/esm/CJawFB555VEY-Vge.mjs +7 -0
- package/browser/esm/CWogLlWYHiL4W6CH.mjs +7 -0
- package/browser/esm/Cr46Bo9bGoz0LbWq.mjs +7 -0
- package/browser/esm/Csk8rXNpaXmf5g7O.mjs +7 -0
- package/browser/esm/Cu-5HDPN8B0qE77-.mjs +7 -0
- package/browser/esm/CzgR8PxJ_89IC4Mr.mjs +7 -0
- package/browser/esm/DMUXpRbV3ahdB1lN.mjs +7 -0
- package/browser/esm/DiIX5KzrWnbDWjGE.mjs +7 -0
- package/browser/esm/Djo2IS-ivmVSrO3v.mjs +7 -0
- package/browser/esm/Hy95ExHvIFgzxQb-.mjs +7 -0
- package/browser/esm/Z1_72ZY8rW2Mc3g_.mjs +7 -0
- package/browser/esm/_ZR9nT54xwy-C6ow.mjs +7 -0
- package/browser/esm/csxyptiqbJZO0pQA.mjs +7 -0
- package/browser/esm/index.mjs +8 -83
- package/licenses/dependencies.txt +145 -145
- package/node/esm/{D9XxEDOFeim_xxQE.mjs → 8THCZRGNmI2nPqMR.mjs} +2 -2
- package/node/esm/{DAGXTtxswgRevXcg.mjs → BDm0y2dv7wLZhYj1.mjs} +1 -1
- package/node/esm/{bMROCCq764fn-xgi.mjs → BPylexVHXa-t0sqJ.mjs} +6 -6
- package/node/esm/{BCPBJsft-CxWAdC2.mjs → BQYQg7lfqFbWaf8x.mjs} +2 -2
- package/node/esm/{BvRJoxdFTieQ7fmr.mjs → BSUbQzac78SXiAJe.mjs} +1 -1
- package/node/esm/{CvPEjDQ6QhtpTabY.mjs → BeNXnrWMr5S34Oxb.mjs} +1 -1
- package/node/esm/{tOKSFYpLW-UAq6Gt.mjs → C6jxZQrvMLctjLZM.mjs} +4 -4
- package/node/esm/{usxl4NgDVOQ7LrDb.mjs → CCZepFZNn1pIXrnd.mjs} +1 -1
- package/node/esm/{FBYT_1wWMsovwFUH.mjs → CXSwyUs6BuNGCic0.mjs} +13 -13
- package/node/esm/{CcretMZPKGn3lnR4.mjs → CaV6SH-PMyHlXUhx.mjs} +1 -1
- package/node/esm/{wsJBzsqfI7PB1hMT.mjs → D481dAOp77EZbV5s.mjs} +2 -2
- package/node/esm/{DhG888jHVhaxSY8F.mjs → DHj9iDuBImdwscIb.mjs} +25 -25
- package/node/esm/{BGArlD6RNgEObMgD.mjs → DIGsHHDexzj0uG_T.mjs} +5 -5
- package/node/esm/{DxbGK6Zl1UgjOa4-.mjs → DLiw-2C_tqGgJIQ6.mjs} +2 -2
- package/node/esm/{sAnM1xQCuHDSOmip.mjs → DNJVdt9TbBsUE8Jm.mjs} +1 -1
- package/node/esm/{BBg45DshIWHYXywC.mjs → DaCmut490aSCGvX8.mjs} +1 -1
- package/node/esm/{BmkBQUrL_kkRhzTh.mjs → Dd2OFQJQyYp6bAeP.mjs} +1 -1
- package/node/esm/{Clurk3ikkAHRiukp.mjs → DkpAjhQeaZn_Ipxg.mjs} +2 -2
- package/node/esm/{p6vc6u8VPkFyCsYx.mjs → DyMCnCG9LzH5Mgw0.mjs} +2 -2
- package/node/esm/{Dc--wbPxmu3D8pbK.mjs → RV-AvxVzzFKWjYFM.mjs} +38 -38
- package/node/esm/{BPqOHRFTv--y9umX.mjs → Ui3_6RhrEZQDOXwg.mjs} +8 -8
- package/node/esm/index.mjs +5265 -4998
- package/node/esm/{M1FpuPZr9_2AafMV.mjs → qI75rORek8T0-Kpf.mjs} +2 -2
- package/package.json +8 -8
- package/types/index.d.ts +11 -0
- package/browser/cjs/BKTBvSy7O4Xw2cgz.cjs +0 -12
- package/browser/cjs/BpePzZJYiqMlY5Tv.cjs +0 -6
- package/browser/cjs/C1kdA0ggDPxfA1rZ.cjs +0 -7
- package/browser/cjs/C3Ou4UjGdLm76uIO.cjs +0 -6
- package/browser/cjs/CFxDNxEIdtHFQI9Y.cjs +0 -7
- package/browser/cjs/CYBKL0vexMAhOhAv.cjs +0 -15
- package/browser/cjs/CdVTdaOLyLtwVswE.cjs +0 -6
- package/browser/cjs/ClsxZKYLxWzS4vf3.cjs +0 -12
- package/browser/cjs/Co1amcDxMGmeSblk.cjs +0 -161
- package/browser/cjs/CoKAO1N3hI6MCu8D.cjs +0 -6
- package/browser/cjs/CtsmtdeQOqFBoICs.cjs +0 -6
- package/browser/cjs/CuB7GbiZyoeSvc0Z.cjs +0 -6
- package/browser/cjs/D-N-VqvFR1gHQx1f.cjs +0 -11
- package/browser/cjs/DDFf-jFPulia8BBq.cjs +0 -11
- package/browser/cjs/Db8DWa6iDZSqedMi.cjs +0 -90
- package/browser/cjs/DeGIeKT9CooiCmKo.cjs +0 -6
- package/browser/cjs/LWz4eqzOyIvcl3ew.cjs +0 -6
- package/browser/cjs/bzV_pbhf0GMpQZ5j.cjs +0 -16
- package/browser/cjs/fCiaIJ9GEGrJHKcW.cjs +0 -18
- package/browser/cjs/g_d3i2WIzavP1fkJ.cjs +0 -6
- package/browser/cjs/jtJTqrtVCIIZdMGs.cjs +0 -6
- package/browser/cjs/lKYJYMC7FrPq5kHP.cjs +0 -42
- package/browser/cjs/niDPoiECJADuYx3e.cjs +0 -145
- package/browser/cjs/olo9IZBG5nwaup_7.cjs +0 -6
- package/browser/cjs/zKQuLycAjgd_X11q.cjs +0 -6
- package/browser/esm/3hWSR1m3EU7D5hi-.mjs +0 -1352
- package/browser/esm/536uCif-OpzkPpDe.mjs +0 -84
- package/browser/esm/BAKeXjQwj8pB6HZf.mjs +0 -3803
- package/browser/esm/BCEAVoasUKP7howp.mjs +0 -25
- package/browser/esm/BKPv5CXZmlt0Bt9q.mjs +0 -52
- package/browser/esm/BpaKIplfXogRA7Dy.mjs +0 -424
- package/browser/esm/C7S8lmNi8dvBvaaL.mjs +0 -13391
- package/browser/esm/C8g1cXW8UUjZ5aXU.mjs +0 -43
- package/browser/esm/CDg8_cQCaixUeVW5.mjs +0 -59
- package/browser/esm/COdRj-kRolpDnJJt.mjs +0 -153
- package/browser/esm/C_SmA3bhMniSBiJM.mjs +0 -2251
- package/browser/esm/CfhFPyNuH7O_8Ma5.mjs +0 -46
- package/browser/esm/Cq7Bvqjn_f2hb4Yu.mjs +0 -1703
- package/browser/esm/Cu4sFU_zvi2DcKL0.mjs +0 -864
- package/browser/esm/DRlIFEu_74fHh0Nd.mjs +0 -44
- package/browser/esm/DW_hf-cH6FfKvA2U.mjs +0 -1366
- package/browser/esm/D_9FRFbybIoGcpk5.mjs +0 -640
- package/browser/esm/DssrQc6563EzuV2p.mjs +0 -1467
- package/browser/esm/TCkOSlTdkEa2IszR.mjs +0 -392
- package/browser/esm/XunxgPz4pxTyfYZa.mjs +0 -19979
- package/browser/esm/YJTooL6WwG9eY3LG.mjs +0 -48
- package/browser/esm/ej-oxHSoVFxjTvis.mjs +0 -2410
- package/browser/esm/fbwdS1S_4A9RYV7u.mjs +0 -1672
- package/browser/esm/tZtCH_zqvCEW6mXy.mjs +0 -23
- package/browser/esm/tbB-JzXGTPYVXdKc.mjs +0 -52
- 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
|
-
};
|