@sheetxl/studio-mui 0.4.19 → 0.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/B1KlR2XYFpYbKjYS.cjs +20 -0
- package/browser/cjs/{afHzhXTMVhLQJ6uC.cjs → B1RMsexbz4bNlty_.cjs} +1 -1
- package/browser/cjs/B32faQpVaX1tkPuc.cjs +6 -0
- package/browser/cjs/B3XiHrRxW1LxML7F.cjs +6 -0
- package/browser/cjs/BGikYpeNpjwvXUdQ.cjs +18 -0
- package/browser/cjs/BY5l7DteiFtb2AKy.cjs +6 -0
- package/browser/cjs/Bb0Hd2RE7iVWVbm8.cjs +6 -0
- package/browser/cjs/C3EZkRIKfQURg9hX.cjs +6 -0
- package/browser/cjs/C7r573AdygYrVVEJ.cjs +7 -0
- package/browser/cjs/DEEknE8ARp0mc7fk.cjs +6 -0
- package/browser/cjs/DZwzUUHda3jr5jo4.cjs +6 -0
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/veQZSq7ekc6G1FZT.cjs +42 -0
- package/browser/esm/B84RbTkXZiq6XIdH.mjs +49 -0
- package/browser/esm/{C4lgCnqxoHUTMKx0.mjs → BLy-hRTZkVfaGrcr.mjs} +1 -1
- package/browser/esm/Bapmv0WdnDq3Jl_q.mjs +53 -0
- package/browser/esm/C0OuiugFYjsjbY8q.mjs +46 -0
- package/browser/esm/{6nabbOchsfGHTDbJ.mjs → CGVN-NJF8ZTm9apo.mjs} +11 -10
- package/browser/esm/CcLpUDzJOdfqQ8Kf.mjs +25 -0
- package/browser/esm/Csg-hJrzm9r4vJrm.mjs +2156 -0
- package/browser/esm/{DwyDpojQzn8Yb0Z3.mjs → DHf2N2UY78nZFge3.mjs} +100 -98
- package/browser/esm/Dlc8L0qha0mZFIkY.mjs +62 -0
- package/browser/esm/{Duk7LVR9m02nk_H1.mjs → Dv-0R5pQwEnowzoO.mjs} +87 -85
- package/browser/esm/index.mjs +29 -29
- package/browser/esm/mVKwmIdSj4ua1Qce.mjs +4443 -0
- package/browser/esm/{aeeg2i5lmw2EnSq8.mjs → sHK4zKkWLGt2hVmW.mjs} +27 -26
- package/licenses/dependencies.txt +71 -342
- package/node/esm/{C1qlFAMFUg7JxINj.mjs → 49Eux5a_I5wZ-jfq.mjs} +29 -28
- package/node/esm/{Svd1DLPJnYKhJsxn.mjs → B00pGeZ7sj6QOFgF.mjs} +4 -3
- package/node/esm/{Cqh-VwF8iLFUBQG2.mjs → BEtxwx_Ji4aFNg8V.mjs} +79 -78
- package/node/esm/{BOlA6nKvsuwJ8-qE.mjs → BTcBIT144Lil18l-.mjs} +13 -11
- package/node/esm/{SdVxzy9D4jvK5ILt.mjs → Bw_f4uhXHpg1RA6Z.mjs} +7 -6
- package/node/esm/CGrG-gsnGd-Pn_T2.mjs +88 -0
- package/node/esm/CiUfb3MQCUC2McDP.mjs +46 -0
- package/node/esm/D1bjybdBQ28bumrW.mjs +63 -0
- package/node/esm/{wuBONOGgEy1w5A3Q.mjs → Dcnd4LiYyGf2eaNl.mjs} +23 -22
- package/node/esm/{BbLVlH-VHXBiyGbB.mjs → DiLUM75s3D56Y6Fx.mjs} +11 -10
- package/node/esm/index.mjs +2378 -18426
- package/package.json +8 -8
- package/browser/cjs/9JbHyHSHGCO4uFHn.cjs +0 -7
- package/browser/cjs/B17ClH6YVt0_UP8s.cjs +0 -6
- package/browser/cjs/B9LTfguTHj9uQv3h.cjs +0 -6
- package/browser/cjs/BYWh4kkrXJKKl2Ju.cjs +0 -145
- package/browser/cjs/BYrNOLTwEhs6LHAw.cjs +0 -6
- package/browser/cjs/Bh8xJY_qVp_q9NdJ.cjs +0 -6
- package/browser/cjs/Bl5l1B_eznDfB_7v.cjs +0 -18
- package/browser/cjs/C1LBzI2ntslIKFn5.cjs +0 -6
- package/browser/cjs/CGWf__jrNH3xfu2y.cjs +0 -161
- package/browser/cjs/CGlk1dj000Bm5cqP.cjs +0 -7
- package/browser/cjs/CX_y7y31Q5qi020q.cjs +0 -6
- package/browser/cjs/Cby5RVhO-aNkuWsV.cjs +0 -11
- package/browser/cjs/D2CoaVzteKVTLz2u.cjs +0 -42
- package/browser/cjs/D4ge-OwnSGkzaQnk.cjs +0 -15
- package/browser/cjs/D54KO7Qf1gFYpUYh.cjs +0 -11
- package/browser/cjs/D5Hr7ebLiJgvcT0k.cjs +0 -6
- package/browser/cjs/D6qxm65mk30iMCfQ.cjs +0 -6
- package/browser/cjs/DIR6Yr7FCZPYWi4-.cjs +0 -6
- package/browser/cjs/DeklxocxxZiZyZ5u.cjs +0 -6
- package/browser/cjs/Dh2Z7N-jImJZemiw.cjs +0 -6
- package/browser/cjs/Dngll9GyDqkTUUmu.cjs +0 -6
- package/browser/cjs/KmAkK4F7kLQEM3IN.cjs +0 -12
- package/browser/cjs/n8wDl6JTlhLU6ZAW.cjs +0 -16
- package/browser/cjs/zr0HW2FkaHX7brxh.cjs +0 -110
- package/browser/esm/B8eNugj_qKnbe7K9.mjs +0 -59
- package/browser/esm/BPRkMu1MFxUWK930.mjs +0 -3803
- package/browser/esm/BQtrstD4gTIutZpE.mjs +0 -1467
- package/browser/esm/BeT_3zf80WoubGnC.mjs +0 -1352
- package/browser/esm/C226zpF9x3cqGDep.mjs +0 -44
- package/browser/esm/C52hEZh6H2W5Zw5u.mjs +0 -2250
- package/browser/esm/CJi45DDPGy79h3Hk.mjs +0 -1366
- package/browser/esm/CSAsCpXnzBKwTizz.mjs +0 -23326
- package/browser/esm/ChetmIXTvR3tA23A.mjs +0 -48
- package/browser/esm/CtAFduFwOuqSdkvi.mjs +0 -23
- package/browser/esm/D1mFp2w9djJ0V4vm.mjs +0 -52
- package/browser/esm/DA83VkmtEXnqG2ye.mjs +0 -43
- package/browser/esm/Dy_zBluT96wehR25.mjs +0 -46
- package/browser/esm/NwT_h_qyOIJUd95T.mjs +0 -392
- package/browser/esm/eNfgzWFw915mA1DM.mjs +0 -84
- package/browser/esm/i07lQ5p_zaWwjifI.mjs +0 -12
- package/browser/esm/mWKbTdOrhJijxGkQ.mjs +0 -13391
- package/browser/esm/qTwpcY21ZDbsJF8q.mjs +0 -424
- package/browser/esm/rOu2mn5CpwGjRPMt.mjs +0 -1672
- package/browser/esm/xBoO8UGcKLTEtu2_.mjs +0 -1703
- package/node/esm/8IRz_tiw9gL3CiTm.mjs +0 -46
- package/node/esm/BGuyZxOceFDiCkHS.mjs +0 -553
- package/node/esm/BRc35RfDs9NeSBil.mjs +0 -78
- package/node/esm/BWNYjBRxl8-kaqWc.mjs +0 -1706
- package/node/esm/Bdk5FW-41aJV-x0f.mjs +0 -392
- package/node/esm/C2KYv5fsjkP4dceu.mjs +0 -86
- package/node/esm/C7eBwbZmMMcQeZ5y.mjs +0 -1479
- package/node/esm/CCmhTOlFNku7bidD.mjs +0 -44
- package/node/esm/COWuJnOkG4AgfLpx.mjs +0 -3776
- package/node/esm/CcxYuxLYIW_z4w-n.mjs +0 -1378
- package/node/esm/DO-FR-M-Iy43f7rk.mjs +0 -60
- package/node/esm/DOa-YBJSa8QO8ypH.mjs +0 -1246
- package/node/esm/DXgMMPZD2XcdNWPg.mjs +0 -44
- package/node/esm/DXlF9nEg2kAr3Ykp.mjs +0 -13464
- package/node/esm/FcospSz9-0aW4gFs.mjs +0 -1719
|
@@ -1,153 +1,155 @@
|
|
|
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 { alpha as I, getOverlayAlpha as k } from "@mui/material/styles";
|
|
3
4
|
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
5
|
import { ArrowBack as he, ArrowUpward as Oe, ArrowForward as Ce, ArrowDownward as ye } from "@mui/icons-material";
|
|
5
6
|
import { ICell as c, IRange as R } from "@sheetxl/sdk";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
7
|
+
import { useCallbackRef as $, KeyCodes as be, KeyModifiers as y } from "@sheetxl/utils-react";
|
|
8
|
+
import { InternalWindow as Te, ExhibitOptionButton as m, themeIcon as x, FindOptionsIcon as ve, FindReplaceToggleIcon as Re, FindCaseSensitiveIcon as Ie, FindWholeWordIcon as ke, FindRegExIcon as Fe, FindReplaceIcon as we, FindReplaceAllIcon as Ee, ExhibitDivider as Se } from "@sheetxl/utils-mui";
|
|
9
|
+
import { u as De } from "./mVKwmIdSj4ua1Qce.mjs";
|
|
8
10
|
/**
|
|
9
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.
|
|
11
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.21
|
|
10
12
|
*
|
|
11
13
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
12
14
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
13
15
|
*/
|
|
14
16
|
const L = ie((F) => {
|
|
15
|
-
const { label: h, value: a, options:
|
|
17
|
+
const { label: h, value: a, options: l, onSelect: d, tabIndex: T = 0, ...A } = F, [K, v] = b(() => te(a, l));
|
|
16
18
|
D(() => {
|
|
17
|
-
v(
|
|
18
|
-
}, [a,
|
|
19
|
-
const
|
|
20
|
-
v(u.target.value), d?.(
|
|
21
|
-
}, [d,
|
|
22
|
-
return p(ge, { sx: { minWidth: 135 }, size: "small", children: [i(me, { children: h }), i(xe, { inputProps: { tabIndex: T }, value:
|
|
23
|
-
}), ee = { Workbook: "workbook", Sheet: "sheet" },
|
|
24
|
-
delete
|
|
25
|
-
const
|
|
19
|
+
v(te(a, l));
|
|
20
|
+
}, [a, l]);
|
|
21
|
+
const P = $((u) => {
|
|
22
|
+
v(u.target.value), d?.(l[u.target.value]);
|
|
23
|
+
}, [d, l]), s = pe(() => Object.keys(l).map((u) => i(fe, { value: u, children: u }, u)), [l]);
|
|
24
|
+
return p(ge, { sx: { minWidth: 135 }, size: "small", children: [i(me, { children: h }), i(xe, { inputProps: { tabIndex: T }, value: K, label: h, onChange: P, sx: { backgroundImage: `linear-gradient(${I("#fff", k(5))}, ${I("#fff", k(5))})` }, ...A, children: s })] });
|
|
25
|
+
}), ee = { Workbook: "workbook", Sheet: "sheet" }, ne = { enter: 140, exit: 140 }, oe = { Formulas: c.Content.Formulas, Values: c.Content.Values, Notes: c.Content.Notes, Comments: c.Content.Comments }, le = { ...oe };
|
|
26
|
+
delete le.Values;
|
|
27
|
+
const Ae = { "By Rows": !0, "By Columns": !1 }, te = (F, h) => {
|
|
26
28
|
const a = Object.keys(h);
|
|
27
|
-
for (let
|
|
28
|
-
const d = a[
|
|
29
|
+
for (let l = 0; l < a.length; l++) {
|
|
30
|
+
const d = a[l];
|
|
29
31
|
if (h[d] === F) return d;
|
|
30
32
|
}
|
|
31
|
-
},
|
|
32
|
-
const { replace: h = !1, findText: a, replaceText:
|
|
33
|
-
|
|
34
|
-
}, [U,
|
|
33
|
+
}, Ne = ie((F) => {
|
|
34
|
+
const { replace: h = !1, findText: a, replaceText: l, findOptions: d, replaceOptions: T, title: A, onHide: K, onFindOrReplace: v, ...P } = F, s = C(null), u = C(null), V = C(null), j = C(null), N = C(null), H = C(null), z = (e, n) => {
|
|
35
|
+
n && (n.start(e, { center: !1 }), setTimeout(() => n.stop(e), 180));
|
|
36
|
+
}, [U, S] = b(!1), [M, se] = b(!1), [f, B] = b(h), [X, W] = 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 }), w = $(async (e, n, t, E) => {
|
|
35
37
|
if (!v) return;
|
|
36
38
|
const g = { ...o };
|
|
37
|
-
g.replaceOptions = { ...g.replaceOptions }, g.findOptions = { ...g.findOptions }, g.replaceOptions.maxCount =
|
|
38
|
-
const ae = await v({ autoFocus:
|
|
39
|
-
|
|
39
|
+
g.replaceOptions = { ...g.replaceOptions }, g.findOptions = { ...g.findOptions }, g.replaceOptions.maxCount = t ? void 0 : 1, g.replace = n, n && o.findOptions.fields?.[0] === c.Content.Values && (g.findOptions.fields = [c.Content.Formulas]), g.findOptions.reverse = !e;
|
|
40
|
+
const ae = await v({ autoFocus: E, ...g });
|
|
41
|
+
W(ae === 0);
|
|
40
42
|
}, [o, v]);
|
|
41
43
|
D(() => {
|
|
42
|
-
|
|
43
|
-
}, [o,
|
|
44
|
-
const J =
|
|
44
|
+
W(!1);
|
|
45
|
+
}, [o, M, f]);
|
|
46
|
+
const J = $((e, n) => {
|
|
45
47
|
if (e.keyCode === be.Enter) {
|
|
46
48
|
if (!o.findText) return;
|
|
47
|
-
let
|
|
48
|
-
e.shiftKey && (
|
|
49
|
+
let t = !0, E = !1;
|
|
50
|
+
e.shiftKey && (t = !1), n ? (e.ctrlKey && e.altKey && (E = !0), z(e, E ? H.current : N.current)) : z(e, t ? j.current : V.current), w(t, n, E, !1);
|
|
49
51
|
}
|
|
50
52
|
}, [o]), Q = C(null);
|
|
51
53
|
ce(() => {
|
|
52
54
|
r((e) => {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
return
|
|
55
|
+
const n = { ...e };
|
|
56
|
+
n.findText = a && a.length > 0 ? a : e.findText ?? "", S(!0), l !== void 0 && (n.replaceText = l), d && (n.findOptions = { ...n.findOptions, ...d }), n.replaceText || (n.replaceText = ""), n.replaceOptions && (n.replaceOptions = { ...n.replaceOptions }), T && (n.replaceOptions = { ...n.replaceOptions, ...T }), o.findOptions.fields?.[0] || (o.findOptions.fields = [c.Content.Formulas]);
|
|
57
|
+
const t = !(!T && l === void 0);
|
|
58
|
+
return t && B(t), n;
|
|
57
59
|
}), G || Q.current?.focus();
|
|
58
|
-
}, [a,
|
|
59
|
-
f ? (o.findOptions.fields[0], c.Content.Values) :
|
|
60
|
+
}, [a, l, d, T]), D(() => {
|
|
61
|
+
f ? (o.findOptions.fields[0], c.Content.Values) : S(!0);
|
|
60
62
|
}, [f]), D(() => {
|
|
61
|
-
if (U &&
|
|
62
|
-
|
|
63
|
+
if (U && s.current && o.findText === s.current.value) return s.current === document.activeElement || s.current.contains(document.activeElement) ? (s.current?.select(), void S(!1)) : void s.current.addEventListener("focus", () => {
|
|
64
|
+
s.current?.select(), S(!1);
|
|
63
65
|
}, { once: !0 });
|
|
64
66
|
}, [U, o]);
|
|
65
|
-
const [re, { width: Y }] =
|
|
66
|
-
return i(
|
|
67
|
-
q(!1),
|
|
68
|
-
}, PaperProps: { elevation: G ? 3 : 1 }, ...
|
|
69
|
-
if (e.key === "h" && e.ctrlKey)
|
|
70
|
-
else if (e.key === "f" && e.ctrlKey)
|
|
71
|
-
else if (e.key === "c" && e.altKey) r((
|
|
72
|
-
const
|
|
73
|
-
return
|
|
67
|
+
const [re, { width: Y }] = De();
|
|
68
|
+
return i(Te, { ref: Q, title: A ?? (f ? "Find & Replace" : "Find"), initialPosition: { y: "35" }, autoFocusSel: ".input", onHide: K, onFocus: () => q(!0), onBlur: () => {
|
|
69
|
+
q(!1), W(!1);
|
|
70
|
+
}, PaperProps: { elevation: G ? 3 : 1 }, ...P, 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) => {
|
|
71
|
+
if (e.key === "h" && e.ctrlKey) B(!0), s.current?.contains(document.activeElement) && u.current?.focus();
|
|
72
|
+
else if (e.key === "f" && e.ctrlKey) s.current?.focus();
|
|
73
|
+
else if (e.key === "c" && e.altKey) r((n) => {
|
|
74
|
+
const t = { ...n };
|
|
75
|
+
return t.findOptions.matchCase = !n.findOptions.matchCase, t;
|
|
74
76
|
});
|
|
75
|
-
else if (e.key === "e" && e.altKey) r((
|
|
76
|
-
const
|
|
77
|
-
return
|
|
77
|
+
else if (e.key === "e" && e.altKey) r((n) => {
|
|
78
|
+
const t = { ...n };
|
|
79
|
+
return t.findOptions.matchEntireCell = !n.findOptions.matchEntireCell, t;
|
|
78
80
|
});
|
|
79
81
|
else {
|
|
80
82
|
if (e.key !== "r" || !e.altKey) return;
|
|
81
|
-
r((
|
|
82
|
-
const
|
|
83
|
-
return
|
|
83
|
+
r((n) => {
|
|
84
|
+
const t = { ...n };
|
|
85
|
+
return t.findOptions.useRegex = !n.findOptions.useRegex, t;
|
|
84
86
|
});
|
|
85
87
|
}
|
|
86
88
|
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:
|
|
88
|
-
|
|
89
|
-
}, preventFocus: !0, label: "Toggle Additional Options", icon: x(i(
|
|
90
|
-
|
|
91
|
-
}, preventFocus: !0, label: "Toggle Replace", icon: x(i(
|
|
92
|
-
r((
|
|
93
|
-
const
|
|
94
|
-
return
|
|
89
|
+
}, 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) => {
|
|
90
|
+
se(e);
|
|
91
|
+
}, preventFocus: !0, label: "Toggle Additional Options", icon: x(i(ve, {})) }), i(m, { selected: f, onSelectToggle: (e) => {
|
|
92
|
+
B(e);
|
|
93
|
+
}, preventFocus: !0, label: "Toggle Replace", icon: x(i(Re, {})), 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(${I("#fff", k(5))}, ${I("#fff", k(5))})` }, inputProps: { draggable: !1, ref: s, 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) => {
|
|
94
|
+
r((n) => {
|
|
95
|
+
const t = { ...n };
|
|
96
|
+
return t.findOptions.matchCase = e, t;
|
|
95
97
|
});
|
|
96
|
-
}, label: "Match Case", shortcut: { key: "C", modifiers: [y.Alt] }, icon: x(i(
|
|
97
|
-
r((
|
|
98
|
-
const
|
|
99
|
-
return
|
|
98
|
+
}, label: "Match Case", shortcut: { key: "C", modifiers: [y.Alt] }, icon: x(i(Ie, {})) }), i(m, { selected: o.findOptions.matchEntireCell, onSelectToggle: (e) => {
|
|
99
|
+
r((n) => {
|
|
100
|
+
const t = { ...n };
|
|
101
|
+
return t.findOptions.matchEntireCell = e, t;
|
|
100
102
|
});
|
|
101
|
-
}, label: "Match Entire Cell", shortcut: { key: "E", modifiers: [y.Alt] }, icon: x(i(
|
|
102
|
-
r((
|
|
103
|
-
const
|
|
104
|
-
return
|
|
103
|
+
}, label: "Match Entire Cell", shortcut: { key: "E", modifiers: [y.Alt] }, icon: x(i(ke, {})) }), i(m, { selected: o.findOptions.useRegex, onSelectToggle: (e) => {
|
|
104
|
+
r((n) => {
|
|
105
|
+
const t = { ...n };
|
|
106
|
+
return t.findOptions.useRegex = e, t;
|
|
105
107
|
});
|
|
106
|
-
}, label: "Use Regular Expression", shortcut: { key: "R", modifiers: [y.Alt] }, icon: x(i(
|
|
107
|
-
r((
|
|
108
|
-
const
|
|
109
|
-
return
|
|
108
|
+
}, label: "Use Regular Expression", shortcut: { key: "R", modifiers: [y.Alt] }, icon: x(i(Fe, {})) })] }) }) }, 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) => {
|
|
109
|
+
r((n) => {
|
|
110
|
+
const t = { ...n };
|
|
111
|
+
return t.findText = e.target.value, t;
|
|
110
112
|
});
|
|
111
113
|
}, onKeyDown: (e) => J(e, !1), onContextMenu: (e) => {
|
|
112
114
|
e.stopPropagation();
|
|
113
115
|
} }), i(m, { selected: o.findOptions.reverse, onSelectToggle: (e) => {
|
|
114
|
-
|
|
115
|
-
}, touchRippleRef:
|
|
116
|
-
|
|
117
|
-
}, touchRippleRef:
|
|
118
|
-
|
|
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(${
|
|
120
|
-
r((
|
|
121
|
-
const
|
|
122
|
-
return
|
|
116
|
+
w(!1, !1);
|
|
117
|
+
}, 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) => {
|
|
118
|
+
w(!0, !1);
|
|
119
|
+
}, touchRippleRef: j, 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: ne, onExit: () => {
|
|
120
|
+
s.current?.focus();
|
|
121
|
+
}, 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(${I("#fff", k(5))}, ${I("#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) => {
|
|
122
|
+
r((n) => {
|
|
123
|
+
const t = { ...n };
|
|
124
|
+
return t.replaceText = e.target.value, t;
|
|
123
125
|
});
|
|
124
126
|
}, onKeyDown: (e) => J(e, !0), onContextMenu: (e) => {
|
|
125
127
|
e.stopPropagation();
|
|
126
128
|
} }), 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(Ee, {})), disabled: !o.findText })] }) })] })] }), i(_, { in:
|
|
131
|
-
|
|
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(
|
|
133
|
-
r((
|
|
134
|
-
const
|
|
135
|
-
return
|
|
129
|
+
w(!0, !0);
|
|
130
|
+
}, touchRippleRef: N, label: "Replace", shortcut: { key: "Enter" }, icon: x(i(we, {})), disabled: !o.findText }), i(m, { onSelectToggle: (e) => {
|
|
131
|
+
w(!0, !0, !0);
|
|
132
|
+
}, touchRippleRef: H, label: "Replace All", shortcut: { key: "Enter", modifiers: [y.Ctrl, y.Alt] }, icon: x(i(Ee, {})), disabled: !o.findText })] }) })] })] }), i(_, { in: M, timeout: ne, onExit: () => {
|
|
133
|
+
s.current?.focus();
|
|
134
|
+
}, 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(Se, { 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) => {
|
|
135
|
+
r((n) => {
|
|
136
|
+
const t = { ...n };
|
|
137
|
+
return t.scope = e, t;
|
|
136
138
|
});
|
|
137
|
-
} }), i(L, { label: "Search", value: o.findOptions.orientation !== R.Orientation.Column, options:
|
|
138
|
-
r((
|
|
139
|
-
const
|
|
140
|
-
return
|
|
139
|
+
} }), i(L, { label: "Search", value: o.findOptions.orientation !== R.Orientation.Column, options: Ae, onSelect: (e) => {
|
|
140
|
+
r((n) => {
|
|
141
|
+
const t = { ...n };
|
|
142
|
+
return t.findOptions.orientation = e ? R.Orientation.Row : R.Orientation.Column, t;
|
|
141
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 ?
|
|
143
|
-
r((
|
|
144
|
-
const
|
|
145
|
-
return
|
|
144
|
+
} }), i(L, { label: "Look in", value: f && o.findOptions.fields?.[0] === c.Content.Values ? c.Content.Formulas : o.findOptions.fields?.[0], options: f ? le : oe, onSelect: (e) => {
|
|
145
|
+
r((n) => {
|
|
146
|
+
const t = { ...n };
|
|
147
|
+
return t.findOptions.fields = [e], t;
|
|
146
148
|
});
|
|
147
149
|
} })] })] }) })] }) });
|
|
148
150
|
});
|
|
149
151
|
export {
|
|
150
|
-
|
|
152
|
+
Ne as FindReplaceWindow,
|
|
151
153
|
ee as ScopeOptions,
|
|
152
|
-
|
|
154
|
+
Ne as default
|
|
153
155
|
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { memo as E, useState as r, useRef as M, useReducer as O, useMemo as W } from "react";
|
|
3
|
+
import { DialogContent as A, Box as n } from "@mui/material";
|
|
4
|
+
import { DefaultNotifier as k, useCommand as V, useCallbackRef as f, CommandButtonType as x } from "@sheetxl/utils-react";
|
|
5
|
+
import { InternalWindow as q, ExhibitDivider as y, CommandButton as b, themeIcon as w, InsertTableIcon as C } from "@sheetxl/utils-mui";
|
|
6
|
+
import { useModelListener as G } from "@sheetxl/react";
|
|
7
|
+
import { u as J, N as K, R as Q, T as U, a as X } from "./mVKwmIdSj4ua1Qce.mjs";
|
|
8
|
+
/**
|
|
9
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.21
|
|
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 = E((S) => {
|
|
15
|
+
const { title: N, onHide: R, autoFocusSel: T = ".range-input input", context: v, notifier: l = k, command: c, commands: d, ...D } = S, [I, m] = r(!1), [g, p] = r(!1), u = M(null), [Y, B] = O((e) => e + 1, 0), [F, { width: Z }] = J();
|
|
16
|
+
V(c);
|
|
17
|
+
const a = v ?? c.context(), t = a.table(), [H, P] = r(() => t ? a.getNames().getRanges(t.getRange()) : null), j = W(() => t?.getName() ?? "", [t]);
|
|
18
|
+
G(a.table(), { onAnchorCoordsChange(e) {
|
|
19
|
+
P(a.getNames().getRanges(e.getRange()));
|
|
20
|
+
}, onProtectedChange(e) {
|
|
21
|
+
B();
|
|
22
|
+
} });
|
|
23
|
+
const L = f((e) => {
|
|
24
|
+
a?.table().setName(e);
|
|
25
|
+
}, [a]), z = f((e) => {
|
|
26
|
+
a?.table().resize(e.at(0));
|
|
27
|
+
}, [a]);
|
|
28
|
+
let h = null;
|
|
29
|
+
return a.table() || (h = o("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: o("div", { children: "No table selected" }) })), o(q, { ref: u, title: N ?? "Table Details", initialPosition: { y: "35" }, autoFocusSel: T, onHide: R, onFocus: () => m(!0), onBlur: (e) => {
|
|
30
|
+
u?.current?.contains(e.relatedTarget) || m(!1);
|
|
31
|
+
}, PaperProps: { elevation: I ? 3 : 1 }, ...D, children: s(A, { dividers: !0, ref: F, 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: a.table() ? 1 : 0 }, children: [o(n, { sx: { display: "flex", flexDirection: "row", gap: (e) => e.spacing(1) }, children: o(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: [o(K, { formName: "name", defaultInput: j, value: t?.getName() ?? "No table", onChangeInput: L, onValidate: (e) => {
|
|
32
|
+
t && t.getName().toLowerCase() === e.toLowerCase() || a?.getNames().validateName(e);
|
|
33
|
+
}, disabled: t?.isProtected() ?? !0, onFocus: (e) => {
|
|
34
|
+
g || e.target?.select(), p(!0);
|
|
35
|
+
} }), o(Q, { formName: "range", value: H, onChangeInput: z, resolvedAddress: a.getNames().getRanges.bind(a.getNames()), disabled: t?.isProtected() ?? !0, onFocus: (e) => {
|
|
36
|
+
g || e.target?.select(), p(!0);
|
|
37
|
+
} })] }) }) }), 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: [o(y, { orientation: "horizontal", sx: { marginTop: (e) => e.spacing(1.5), marginBottom: (e) => e.spacing(0.75) } }), o(U, { disabled: t?.isProtected(), styleOptions: t?.getStyleOptions() ?? null, onStyleOptionsChange: (e) => {
|
|
38
|
+
t.updateStyleOptions(e);
|
|
39
|
+
}, showHeaderRow: t?.getShowHeaders(), onShowHeaderRowChange: (e) => {
|
|
40
|
+
try {
|
|
41
|
+
t.setShowHeaders(e);
|
|
42
|
+
} catch (i) {
|
|
43
|
+
l.showError(i);
|
|
44
|
+
}
|
|
45
|
+
}, showTotalRow: t?.getShowTotals(), onShowTotalRowChange: (e) => {
|
|
46
|
+
try {
|
|
47
|
+
t.setShowTotals(e);
|
|
48
|
+
} catch (i) {
|
|
49
|
+
l.showError(i);
|
|
50
|
+
}
|
|
51
|
+
}, showFilterButton: t?.getFilter() ? t.getShowFilterButton() : null, onShowFilterButtonChange: (e) => {
|
|
52
|
+
try {
|
|
53
|
+
t.setShowFilterButton(e);
|
|
54
|
+
} catch (i) {
|
|
55
|
+
l.showError(i);
|
|
56
|
+
}
|
|
57
|
+
} }), o(n, { sx: { display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", marginTop: (e) => e.spacing(2), marginBottom: (e) => e.spacing(1) }, children: o(X, { table: t, styles: a.styles(), bodyStyle: a.bodyStyle(), cellHeight: 30, isLive: !0 }) }), o(y, { orientation: "horizontal" }), s(n, { sx: { display: "flex", flexDirection: "column", justifyContent: "center" }, children: [o(b, { variant: x.Menuitem, command: d.getCommand("convertTableToRange"), commandState: t, icon: w(o(C, {})) }), o(b, { variant: x.Menuitem, commandState: t, command: d.getCommand("deleteTable"), icon: w(o(C, {})) })] })] })] }), h] }) });
|
|
58
|
+
});
|
|
59
|
+
export {
|
|
60
|
+
ie as TableDetailsWindow,
|
|
61
|
+
ie as default
|
|
62
|
+
};
|