@sheetxl/studio-mui 0.4.20 → 0.4.22
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/2d2J6QkipnGWfI99.cjs +6 -0
- package/browser/cjs/BY09bxecVOSMwQA3.cjs +6 -0
- package/browser/cjs/BYJI3FMxQ-z5UGsU.cjs +6 -0
- package/browser/cjs/B_nvuo0kEXu5G0Gf.cjs +7 -0
- package/browser/cjs/BfnxiVEhzO5reOYH.cjs +42 -0
- package/browser/cjs/Bil3fXnJ3lk7aGF5.cjs +6 -0
- package/browser/cjs/{DItuuqkIamMzp7Im.cjs → BzbKSVugPof6dqQI.cjs} +1 -1
- package/browser/cjs/CU0utErelA1oX0n8.cjs +6 -0
- package/browser/cjs/CWp8_mrz0htdOXMM.cjs +20 -0
- package/browser/cjs/D2Cp7gwb6bRupSZY.cjs +6 -0
- package/browser/cjs/DC70SHoaPVkOUEHx.cjs +6 -0
- package/browser/cjs/DRUx3PLS_NrkJ6Yw.cjs +18 -0
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/-0XEuwqNVFTlDKEX.mjs +25 -0
- package/browser/esm/-AR3L_VjwMbtQVbL.mjs +62 -0
- package/browser/esm/BLhZj1SgWlsmeviw.mjs +4443 -0
- package/browser/esm/{BW3_mz5_8i9VLBYB.mjs → BXNl9EEQzO53Hoh5.mjs} +87 -85
- package/browser/esm/BqnVpwK0Q2fKGA2S.mjs +53 -0
- package/browser/esm/D4rFOqwrrtVMpgbc.mjs +49 -0
- package/browser/esm/DEbllEGmvtLkCug_.mjs +2156 -0
- package/browser/esm/{C60ZnLCvtztDLuoT.mjs → DXRFs7VZM4IShMju.mjs} +100 -98
- package/browser/esm/{C5xUbwpUPDeNua-i.mjs → DeGATuYv4-5bhQcD.mjs} +1 -1
- package/browser/esm/{5u-JEG1IfQBstjq0.mjs → EMqbYi0X_krk5yOL.mjs} +11 -10
- package/browser/esm/fWsCG2WBM3kCpC5p.mjs +46 -0
- package/browser/esm/index.mjs +29 -29
- package/browser/esm/{CxXpPYi4eOFhBNt2.mjs → pARZF2O230qNvxWd.mjs} +27 -26
- package/licenses/dependencies.txt +0 -271
- package/node/esm/{D6A_o47zvz5ITIJK.mjs → 0JTY0jNrXiIiOqWY.mjs} +79 -78
- package/node/esm/{Ds5dinNcyNdC8ta6.mjs → BqQ6JNhQ1K321g9U.mjs} +13 -11
- package/node/esm/{CrDbLKJh9omVo_TF.mjs → Bu58psaOsDy_zPOJ.mjs} +29 -28
- package/node/esm/BzBHqe1ThbCP-l_d.mjs +88 -0
- package/node/esm/CE_I2ijQF8MeexHD.mjs +63 -0
- package/node/esm/{Bv12-Yyv0C86Iquy.mjs → CuomeW-4DDc1ywFW.mjs} +7 -6
- package/node/esm/DRt8kMDuCJn53CIE.mjs +46 -0
- package/node/esm/{CH6p2H0CMCoz4NgJ.mjs → DgHCTCARk1Gv_msN.mjs} +23 -22
- package/node/esm/{Bn5TJPQAEMY-lGpF.mjs → Do7y7aKPA48-93AV.mjs} +4 -3
- package/node/esm/{rlqvGCJlj4a2UcSM.mjs → X11ONmg6R1Y6hfue.mjs} +11 -10
- package/node/esm/index.mjs +2381 -18514
- package/package.json +8 -8
- package/browser/cjs/-Z37a-mzY5SKXy--.cjs +0 -6
- package/browser/cjs/B384kb1_rsiCsdZG.cjs +0 -6
- package/browser/cjs/B8nWvy4zDv1CZsr_.cjs +0 -110
- package/browser/cjs/BBnMJiXp9lru0Rcq.cjs +0 -6
- package/browser/cjs/BFbHTu65n1oE-l0N.cjs +0 -6
- package/browser/cjs/BQMSHnQdWtqeakER.cjs +0 -6
- package/browser/cjs/BvjA0ybox6653eb5.cjs +0 -6
- package/browser/cjs/Cocgl4ghzWE9yVYS.cjs +0 -161
- package/browser/cjs/D21Q1NdM1zQ7uFlH.cjs +0 -6
- package/browser/cjs/D4LmaKqYiwjxp0Hs.cjs +0 -15
- package/browser/cjs/D6egUillMqBwTaEq.cjs +0 -6
- package/browser/cjs/D9lY6pd9tRxPeLKs.cjs +0 -18
- package/browser/cjs/DNqIYSqRYZkUpFxW.cjs +0 -7
- package/browser/cjs/DUImSlPsM-OipgBZ.cjs +0 -6
- package/browser/cjs/DUVLcBcwkTsuLb6q.cjs +0 -6
- package/browser/cjs/Db7IyKXFzo8IocDa.cjs +0 -145
- package/browser/cjs/DsHPj69dMFG09uD_.cjs +0 -16
- package/browser/cjs/DypblOPNMRx5Twgx.cjs +0 -12
- package/browser/cjs/QK7YNBstmN86K-xL.cjs +0 -6
- package/browser/cjs/VNWvn2kP6ZF0Snzw.cjs +0 -11
- package/browser/cjs/dc1YAArM3bSHvRcF.cjs +0 -7
- package/browser/cjs/mInXvB8P6r6q7pRY.cjs +0 -11
- package/browser/cjs/nop6N-Oi_LKy1Bpc.cjs +0 -42
- package/browser/cjs/s45oNHeIvJVeRjn5.cjs +0 -6
- package/browser/esm/1y10o01h14oGJtKG.mjs +0 -43
- package/browser/esm/BFpc8KBa-fb0nLSt.mjs +0 -46
- package/browser/esm/Bmjhrc6YMmfx_1Yi.mjs +0 -1703
- package/browser/esm/BnlJVFlQeWerd3KW.mjs +0 -3803
- package/browser/esm/BpuH_QvBidPOXgAR.mjs +0 -392
- package/browser/esm/CAiWSkkPRgUjk8CN.mjs +0 -424
- package/browser/esm/CW8taieVozHhyBOC.mjs +0 -1467
- package/browser/esm/CzyEerZmfWrW3i3U.mjs +0 -59
- package/browser/esm/D0FBHwm0Oz_wf0tR.mjs +0 -12
- package/browser/esm/DM9GPrZpbCcKOnyU.mjs +0 -1352
- package/browser/esm/DO1doKZhwYiL7vbF.mjs +0 -1672
- package/browser/esm/DS3anstzAV3EJBRw.mjs +0 -84
- package/browser/esm/DuEmdSQsXlkCWZIB.mjs +0 -1366
- package/browser/esm/FvK-pQsicRjtrKoS.mjs +0 -48
- package/browser/esm/KCTJzQeDChqf1yBO.mjs +0 -52
- package/browser/esm/P-3pIbidOtRCNsw3.mjs +0 -23
- package/browser/esm/W3EFMOPLR1aNXWvF.mjs +0 -2250
- package/browser/esm/Z_Sh-N3xHHWLCbEw.mjs +0 -23412
- package/browser/esm/mOmzoYDWAtgYndCA.mjs +0 -13391
- package/browser/esm/tnJECoiQzUzgUQZE.mjs +0 -44
- package/node/esm/54SjtcD6mOreKcCy.mjs +0 -1719
- package/node/esm/B2BlMiDOVpIp1FDQ.mjs +0 -1706
- package/node/esm/BNEvR1srnnwBgnrF.mjs +0 -1479
- package/node/esm/BZ20_F64yjZgn-_G.mjs +0 -1246
- package/node/esm/BfzRLuswtxg9uDsX.mjs +0 -78
- package/node/esm/C0ZBbkFa-24tJTnw.mjs +0 -60
- package/node/esm/CEVO60fX3MAPG0Hg.mjs +0 -1378
- package/node/esm/CdFmhVFplZFgBvTo.mjs +0 -44
- package/node/esm/Cx4mn0YEVkG-M1VL.mjs +0 -553
- package/node/esm/DDWek3aquTe_okr_.mjs +0 -392
- package/node/esm/DSLWcwr4qgHARs36.mjs +0 -13464
- package/node/esm/iXG86MN0JrtJkpqe.mjs +0 -44
- package/node/esm/m2teXjBzZLfLDFPx.mjs +0 -46
- package/node/esm/oykDy4erHC0NNHHq.mjs +0 -3776
- package/node/esm/sVOd1y3oNBREsKJ7.mjs +0 -86
|
@@ -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 "./BLhZj1SgWlsmeviw.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.22
|
|
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
|
};
|
|
@@ -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.22
|
|
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,25 +1,26 @@
|
|
|
1
1
|
import { jsx as n, jsxs as u } from "react/jsx-runtime";
|
|
2
2
|
import { useState as v } from "react";
|
|
3
|
-
import { Box as O, FormControlLabel as a, Checkbox as
|
|
4
|
-
import { Sort as
|
|
5
|
-
import {
|
|
3
|
+
import { Box as O, FormControlLabel as a, Checkbox as l } from "@mui/material";
|
|
4
|
+
import { Sort as s, IRange as r } from "@sheetxl/sdk";
|
|
5
|
+
import { useCallbackRef as b } from "@sheetxl/utils-react";
|
|
6
|
+
import { OptionsDialog as f } from "@sheetxl/utils-mui";
|
|
6
7
|
/**
|
|
7
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.
|
|
8
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.22
|
|
8
9
|
*
|
|
9
10
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
10
11
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
11
12
|
*/
|
|
12
|
-
const
|
|
13
|
-
const [o, t] = v(c ??
|
|
13
|
+
const R = ({ range: p, options: c, cell: m, onDone: d, ...C }) => {
|
|
14
|
+
const [o, t] = v(c ?? s.DefaultRangeOptions), h = b((e) => {
|
|
14
15
|
let i = null;
|
|
15
16
|
e === "Sort" && (i = { ...c, options: o }), d?.(i);
|
|
16
17
|
}, [o, d, c]);
|
|
17
|
-
return n(
|
|
18
|
+
return n(f, { title: "Sort", options: ["Sort", "Cancel"], onDone: h, ...C, children: u(O, { sx: { display: "flex", flexDirection: "column" }, children: [n(a, { control: n(l, { checked: !o.reverse, onChange: () => t((e) => ({ ...e, reverse: !e.reverse })) }), label: "Is Ascending", labelPlacement: "end" }), n(a, { control: n(l, { checked: o.hasHeader, onChange: () => t((e) => ({ ...e, hasHeader: !e.hasHeader })) }), label: "Has Header", labelPlacement: "end" }), n(a, { control: n(l, { checked: o.collatorOptions?.sensitivity === s.CaseSensitiveOptions.sensitivity, onChange: () => t((e) => ({ ...e, collatorOptions: o.collatorOptions?.sensitivity === s.CaseSensitiveOptions.sensitivity ? s.CaseInsensitiveOptions : s.CaseSensitiveOptions })) }), label: "Case Sensitive", labelPlacement: "end" }), n(a, { control: n(l, { checked: o.orientation === r.Orientation.Row, onChange: () => t((e) => {
|
|
18
19
|
const i = e.orientation === r.Orientation.Row ? r.Orientation.Column : r.Orientation.Row;
|
|
19
20
|
return { ...p.getDefaultSortCriteria(i, m).options, includeHidden: e.includeHidden, reverse: e.reverse, orientation: i };
|
|
20
|
-
}) }), label: "Row Sort", labelPlacement: "end" }), n(a, { control: n(
|
|
21
|
+
}) }), label: "Row Sort", labelPlacement: "end" }), n(a, { control: n(l, { checked: o.includeHidden, onChange: () => t((e) => ({ ...e, includeHidden: !e.includeHidden })) }), label: "Include Hidden", labelPlacement: "end" })] }) });
|
|
21
22
|
};
|
|
22
23
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
R as SortDialog,
|
|
25
|
+
R as default
|
|
25
26
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as p, jsxs as j } from "react/jsx-runtime";
|
|
2
|
+
import { memo as E, useMemo as R, useState as d, useCallback as V } from "react";
|
|
3
|
+
import { Box as L } from "@mui/material";
|
|
4
|
+
import { useCallbackRef as m } from "@sheetxl/utils-react";
|
|
5
|
+
import { OptionsDialog as S } from "@sheetxl/utils-mui";
|
|
6
|
+
import { N as A, R as G } from "./BLhZj1SgWlsmeviw.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.22
|
|
9
|
+
*
|
|
10
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
11
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
12
|
+
*/
|
|
13
|
+
const M = ["Ok", "Cancel"], P = E((C) => {
|
|
14
|
+
const { value: a = null, context: t, onOption: u, onValidateOption: U, onDone: c, onUpdate: g, options: f = M, defaultOption: x = f?.[0], cancelOption: N = "Cancel", sx: h, ...v } = C, y = R(() => t?.getNames().findValidName("Range1"), []), i = R(() => {
|
|
15
|
+
if (!a) return !0;
|
|
16
|
+
}, []), [o, D] = d({ displayText: a?.getName() ?? y, errorText: null }), [n, w] = d({ displayValue: a?.getRanges() ?? t?.selection() ?? null, errorText: null }), [T, O] = d(!1), F = V(async (e) => !o.errorText && !n.errorText, [t]), b = m((e, l, r) => {
|
|
17
|
+
if (!l) {
|
|
18
|
+
let s = null;
|
|
19
|
+
i ? s = t?.getNames().addReference(o?.displayText, n?.displayValue, !1) : (a.getType() === "reference" && a.doBatch(() => {
|
|
20
|
+
a.setName(o?.displayText), a.setReference(n?.displayValue);
|
|
21
|
+
}, `Edit Named '${o?.displayText}'`), s = a), s && (s.select(), g(s, i));
|
|
22
|
+
}
|
|
23
|
+
u?.(e, l, r), c?.();
|
|
24
|
+
}, [t, o, n, c, u, x, N, g]), k = m((e) => {
|
|
25
|
+
let l = null;
|
|
26
|
+
try {
|
|
27
|
+
t?.getNames().validateName(e);
|
|
28
|
+
} catch (r) {
|
|
29
|
+
l = r.message;
|
|
30
|
+
}
|
|
31
|
+
D({ displayText: e, errorText: l });
|
|
32
|
+
}, []), B = m((e) => {
|
|
33
|
+
a && a.getName().toLowerCase() === e.toLowerCase() || t?.getNames().validateName(e);
|
|
34
|
+
}, [t, a]), I = V((e) => {
|
|
35
|
+
w({ displayValue: e ?? null, errorText: null });
|
|
36
|
+
}, []);
|
|
37
|
+
return p(S, { title: (i ? "Define" : "Edit") + " Range", options: f, onOption: b, onValidateOption: F, defaultOption: x, cancelOption: N, autoFocusSel: ".autoFocus", sx: { width: "460px", ...h }, ...v, children: j(L, { sx: { paddingTop: (e) => e.spacing(1), paddingBottom: (e) => e.spacing(0), rowGap: (e) => e.spacing(1), range: "flex", flexDirection: "column" }, children: [p(A, { formName: "name", defaultInput: y, value: o.displayText, onChangeInput: k, onValidate: B, onFocus: (e) => {
|
|
38
|
+
T || e.target?.select(), O(!0);
|
|
39
|
+
} }), p(G, { formName: "range", value: n.displayValue, onChangeInput: I, resolvedAddress: t.getNames().getRanges.bind(t.getNames()), onFocus: (e) => {
|
|
40
|
+
T || e.target?.select(), O(!0);
|
|
41
|
+
} })] }) });
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
P as NamedReferenceDialog,
|
|
45
|
+
P as default
|
|
46
|
+
};
|
package/browser/esm/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._sheetxl-reset_ods65_1{display:block;margin:0;padding:0;line-height:normal}._sheetxl-reset_ods65_1 table,._sheetxl-reset_ods65_1 thead,._sheetxl-reset_ods65_1 tbody,._sheetxl-reset_ods65_1 tfoot,._sheetxl-reset_ods65_1 tr,._sheetxl-reset_ods65_1 th,._sheetxl-reset_ods65_1 td{display:block;width:auto;height:auto;margin:0;padding:0;border:none;border-collapse:inherit;border-spacing:0;border-color:inherit;vertical-align:inherit;text-align:left;font-weight:inherit;-webkit-border-horizontal-spacing:0;-webkit-border-vertical-spacing:0}._sheetxl-reset_ods65_1 th,._sheetxl-reset_ods65_1 td{display:inline}html{color:initial}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4{fill:currentColor}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .activeColor{fill:var(--sxl-color-active)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .background{fill:var(--sxl-app-color-background)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .grey{fill:var(--sxl-app-color-grey)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .highContrast{fill:var(--sxl-app-color-high)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .info{fill:var(--sxl-app-color-info)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .info.light{fill:var(--sxl-app-color-info-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .info.dark{fill:var(--sxl-app-color-info-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .secondary{fill:var(--sxl-app-color-secondary)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .secondary.light{fill:var(--sxl-app-color-secondary-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .secondary.dark{fill:var(--sxl-app-color-secondary-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .success{fill:var(--sxl-app-color-success)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .success.light{fill:var(--sxl-app-color-success-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .success.dark{fill:var(--sxl-app-color-success-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .warning{fill:var(--sxl-app-color-warning)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .warning .light{fill:var(--sxl-app-color-warning-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .warning .dark{fill:var(--sxl-app-color-warning-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .error{fill:var(--sxl-app-color-error)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .error .light{fill:var(--sxl-app-color-error-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .error .dark{fill:var(--sxl-app-color-error-dark)}._sheetxl-workbook_1j3lu_5{display:flex;position:relative;overflow:hidden;flex-direction:column;width:100%;height:100%;outline:none}._sheetxl-workbook_1j3lu_5 .splitPane .styled-resizer{background-color:var(--sxl-app-color-grey, grey)}._sheetxl-workbook_1j3lu_5 .splitPane .styled-resizer:hover,._sheetxl-workbook_1j3lu_5 .splitPane.dragging .styled-resizer{background-color:var(--sxl-app-color-primary, blue)}._card_1a398_7{width:100%}._actionRoot_1a398_11{padding:8px 8px 8px 16px;justify-content:space-between}._icons_1a398_16{margin-left:auto;display:flex;align-items:center}._expand_1a398_22{padding:8px;transform:rotate(0);color:#d32f2f;transition:all .2s ease-in-out}._expandOpen_1a398_29{transform:rotate(180deg)}._stackTraceContainer_1a398_33{padding:16px}._paper_1a398_37{background-color:#fff;padding:16px}._checkIcon_1a398_42{font-size:20px;padding-right:4px}._button_1a398_47{padding:0;text-transform:none}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
2
|
import { LicenseManager as t } from "@sheetxl/sdk";
|
|
3
|
-
import {
|
|
3
|
+
import { E as n, Z as s, B as m, L as r, X as u, m as l, a0 as d, s as C, $ as B, Y as i, a1 as S, D as p, A as k, aq as T, n as b, a9 as c, q as P, aa as F, j as h, t as W, k as y, a7 as g, F as I, G as M, H as w, I as f, J as x, av as v, M as E, a8 as A, N as O, l as R, P as L, y as N, z as V, Q as z, R as H, au as U, aw as D, at as G, ac as j, ad as q, a6 as Q, ae as Z, p as J, a5 as K, S as X, O as Y, ab as _, T as $, a as aa, v as oa, h as ta, i as ea, an as na, a2 as sa, a3 as ma, a4 as ra, w as ua, U as la, V as da, o as Ca, x as Ba, K as ia, aj as Sa, ah as pa, as as ka, ak as Ta, ai as ba, W as ca, ar as Pa, ao as Fa, S as ha, am as Wa, ag as ya, af as ga, ap as Ia, al as Ma } from "./BLhZj1SgWlsmeviw.mjs";
|
|
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.22
|
|
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.
|
|
@@ -19,45 +19,45 @@ export {
|
|
|
19
19
|
B as ColorPanel,
|
|
20
20
|
i as ColorPanelType,
|
|
21
21
|
S as ColorPopupButton,
|
|
22
|
-
|
|
22
|
+
p as DeleteCellsCommandButton,
|
|
23
23
|
k as DocThemeCommandButton,
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
T as EagerStudio,
|
|
25
|
+
b as FillCommandButton,
|
|
26
26
|
c as FilterColumnMenu,
|
|
27
27
|
P as FilterCommandButton,
|
|
28
28
|
F as Filters,
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
h as FindCommandButton,
|
|
30
|
+
W as FontFamilyCommandButton,
|
|
31
31
|
y as FontSizeCommandButton,
|
|
32
32
|
g as FormulaBar,
|
|
33
33
|
I as FreezeCommandButton,
|
|
34
34
|
M as HelpCommandButton,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
w as HorizontalAlignCommandButton,
|
|
36
|
+
f as InsertCellsCommandButton,
|
|
37
37
|
x as InsertImageCommandButton,
|
|
38
|
-
|
|
38
|
+
v as InsertScriptCommandButton,
|
|
39
39
|
t as LicenseManager,
|
|
40
|
-
|
|
40
|
+
E as MergeCommandButton,
|
|
41
41
|
A as NamedCollectionEditor,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
O as NamedInput,
|
|
43
|
+
R as NumberFormatCommandButton,
|
|
44
|
+
L as PasteCommandButton,
|
|
45
|
+
N as PresetCellStylesCommandButton,
|
|
46
46
|
V as PresetTableStylesCommandButton,
|
|
47
47
|
z as QuickFormulaSumCommandPopupButton,
|
|
48
48
|
H as RangeInput,
|
|
49
49
|
U as RunScriptCommandButton,
|
|
50
50
|
D as ScriptEditorToolbar,
|
|
51
51
|
G as ScriptWorkspace,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
j as SheetTab,
|
|
53
|
+
q as SheetTabMenu,
|
|
54
|
+
Q as SheetZoomScale,
|
|
55
|
+
Z as SheetsAllMenu,
|
|
56
|
+
J as SortFilterCommandButton,
|
|
57
|
+
K as StatusBar,
|
|
58
|
+
X as Studio,
|
|
59
|
+
Y as StyledStrokeIcon,
|
|
60
|
+
_ as TableStyleCanvasPreview,
|
|
61
61
|
$ as TableStyleOptionsPanel,
|
|
62
62
|
aa as TableStylePreview,
|
|
63
63
|
oa as TextEffectsCommandButton,
|
|
@@ -74,15 +74,15 @@ export {
|
|
|
74
74
|
Ba as ViewHeadingsCommandButton,
|
|
75
75
|
ia as WalkingCopyCommandButton,
|
|
76
76
|
Sa as WorkbookContextMenu,
|
|
77
|
-
|
|
77
|
+
pa as WorkbookElement,
|
|
78
78
|
ka as WorkbookIO,
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
Ta as WorkbookStrip,
|
|
80
|
+
ba as WorkbookTitle,
|
|
81
81
|
ca as WorkbookViewCommandButton,
|
|
82
82
|
Pa as _WorkbookIO,
|
|
83
83
|
Fa as createGridStyleFromMUITheme,
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
ha as default,
|
|
85
|
+
Wa as defaultNewWorkbook,
|
|
86
86
|
ya as renderWorkbookLoadingPanel,
|
|
87
87
|
ga as setPrintExamplesOnLoad,
|
|
88
88
|
Ia as useResolvedThemeMode,
|
|
@@ -1,52 +1,53 @@
|
|
|
1
1
|
import { jsx as t, jsxs as y } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import {
|
|
2
|
+
import { memo as W, useState as h, useCallback as F, useEffect as G, useMemo as S } from "react";
|
|
3
|
+
import { alpha as l, getOverlayAlpha as p } from "@mui/material/styles";
|
|
4
|
+
import { Box as w, FormControl as P, InputLabel as H, Select as q, TextField as A, Typography as D, MenuItem as J } from "@mui/material";
|
|
4
5
|
import { NumberFormat as n } from "@sheetxl/sdk";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
6
|
+
import { useCallbackRef as c, KeyCodes as Q } from "@sheetxl/utils-react";
|
|
7
|
+
import { OptionsDialog as U } from "@sheetxl/utils-mui";
|
|
7
8
|
/**
|
|
8
|
-
* @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.22
|
|
9
10
|
*
|
|
10
11
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
11
12
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
12
13
|
*/
|
|
13
|
-
const X = ["Ok", "Cancel"],
|
|
14
|
-
const { initialValue: $, context:
|
|
14
|
+
const X = ["Ok", "Cancel"], ne = W((I) => {
|
|
15
|
+
const { initialValue: $, context: x, onOption: b, onValidateOption: u, onInputOption: C, onDone: m, options: v = X, defaultOption: i = v?.[0], cancelOption: d = "Cancel", sx: N, ...M } = I, [a, T] = h($), [V, j] = h(!1), g = F(async (e, o) => !0, []), f = c(async (e) => {
|
|
15
16
|
C?.(a, e), b?.(e, e === d, e === i), m?.();
|
|
16
|
-
}, [a, C, m, b, d, i]), B =
|
|
17
|
+
}, [a, C, m, b, d, i]), B = c(async (e) => {
|
|
17
18
|
e.keyCode === Q.Enter && await g?.(a, null) !== !1 && f(i);
|
|
18
|
-
}, [a, f]), L =
|
|
19
|
-
|
|
20
|
-
}, [u]),
|
|
19
|
+
}, [a, f]), L = c((e) => {
|
|
20
|
+
T(e.target.value), g?.(e.target.value, null);
|
|
21
|
+
}, [u]), R = c(async (e) => {
|
|
21
22
|
let o = await Promise.resolve(u?.(e));
|
|
22
23
|
try {
|
|
23
24
|
o !== !1 && (o = await Promise.resolve(g?.(a, e)) ?? !0);
|
|
24
25
|
} catch {
|
|
25
26
|
}
|
|
26
27
|
return o ?? !0;
|
|
27
|
-
}, [u]), [k,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
}, [u]), [k, O] = h(n.Styles.lookupStyle(a).formatType ?? n.Type.Custom);
|
|
29
|
+
G(() => {
|
|
30
|
+
O(n.Styles.lookupStyle(a).formatType ?? n.Type.Custom);
|
|
30
31
|
}, [a]);
|
|
31
|
-
const
|
|
32
|
+
const z = S(() => {
|
|
32
33
|
const e = n.Styles.lookupPrimary(), o = (r) => t(J, { value: r, children: r }, r), s = Object.keys(e).map((r) => o(e[r].formatType));
|
|
33
34
|
return s.push(o(n.Type.Custom)), s;
|
|
34
|
-
}, []),
|
|
35
|
+
}, []), E = F((e) => {
|
|
35
36
|
const o = e.target.value;
|
|
36
|
-
|
|
37
|
+
O(o);
|
|
37
38
|
const s = n.Styles.lookupDefault(o);
|
|
38
|
-
s &&
|
|
39
|
-
}, []),
|
|
40
|
-
const e =
|
|
39
|
+
s && T(s);
|
|
40
|
+
}, []), K = S(() => {
|
|
41
|
+
const e = x();
|
|
41
42
|
return e.createTemporaryCell({ value: e.getValue() ?? 12345, style: { numberFormat: a } });
|
|
42
|
-
}, [k, a,
|
|
43
|
-
return t(U, { title: "Number Format", options:
|
|
43
|
+
}, [k, a, x]);
|
|
44
|
+
return t(U, { title: "Number Format", options: v, onDone: m, onOption: (e) => f(e), onValidateOption: R, defaultOption: i, cancelOption: d, autoFocusSel: ".autoFocus", sx: { width: "580px", ...N }, ...M, children: y(w, { sx: { paddingTop: (e) => e.spacing(1), paddingBottom: (e) => e.spacing(0), rowGap: (e) => e.spacing(1), display: "flex", flexDirection: "column" }, children: [y(P, { sx: { minWidth: 135 }, size: "small", children: [t(H, { children: "Category" }), t(q, { value: k, label: "Category", onChange: E, sx: { backgroundImage: `linear-gradient(${l("#fff", p(5))}, ${l("#fff", p(5))})` }, children: z })] }), t(P, { sx: { paddingTop: (e) => e.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(A, { label: "Code", onFocus: (e) => {
|
|
44
45
|
V || e.target?.select(), j(!0);
|
|
45
|
-
}, sx: { "& .MuiFormHelperText-root": { marginTop: (e) => e.spacing(0.5) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { className: "autoFocus", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (e) => e.spacing(1.25), paddingBottom: (e) => e.spacing(0.75), backgroundImage: `linear-gradient(${
|
|
46
|
+
}, sx: { "& .MuiFormHelperText-root": { marginTop: (e) => e.spacing(0.5) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { className: "autoFocus", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (e) => e.spacing(1.25), paddingBottom: (e) => e.spacing(0.75), backgroundImage: `linear-gradient(${l("#fff", p(5))}, ${l("#fff", p(5))})` } } }, value: a, onChange: L, onKeyDown: B, onContextMenu: (e) => {
|
|
46
47
|
e.stopPropagation();
|
|
47
|
-
} }) }), y(w, { children: [t(D, { variant: "caption", component: "div", sx: { paddingLeft: (e) => e.spacing(2) }, children: "Preview" }), t(D, { variant: "body2", component: "div", sx: { borderRadius: (e) => `${e.shape.borderRadius}px`, padding: (e) => e.spacing(1), border: (e) => `1px solid ${e.palette.grey[400]}` }, children:
|
|
48
|
+
} }) }), y(w, { children: [t(D, { variant: "caption", component: "div", sx: { paddingLeft: (e) => e.spacing(2) }, children: "Preview" }), t(D, { variant: "body2", component: "div", sx: { borderRadius: (e) => `${e.shape.borderRadius}px`, padding: (e) => e.spacing(1), border: (e) => `1px solid ${e.palette.grey[400]}` }, children: K.getNumberFormat().displayText || "(empty)" })] })] }) });
|
|
48
49
|
});
|
|
49
50
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
ne as NumberFormatDialog,
|
|
52
|
+
ne as default
|
|
52
53
|
};
|