@sheetxl/studio-mui 0.7.12 → 0.7.13
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/BAcqVi4z0lEWdogG.cjs +6 -0
- package/browser/cjs/{CcsfLc43Qp-vN_dY.cjs → BXSBqvJbFd1zmXED.cjs} +3 -3
- package/browser/cjs/BXpuqWQiSePSVD7I.cjs +6 -0
- package/browser/cjs/BY_Yr3aQW5hLO-nN.cjs +6 -0
- package/browser/cjs/BankB3sWgfQSVyEv.cjs +20 -0
- package/browser/cjs/{wyak0LMoe5SYbD51.cjs → BkRzKXHu8z2zghTF.cjs} +2 -2
- package/browser/cjs/CYeknazLzZOjQtcK.cjs +6 -0
- package/browser/cjs/CyLVMzcTgEZPvYOm.cjs +6 -0
- package/browser/cjs/DD9bJC3Knid6T5It.cjs +6 -0
- package/browser/cjs/{CMEmwUuGpnOyILAu.cjs → SQX0Xb9ngHtVWoYW.cjs} +1 -1
- package/browser/cjs/_A_9JrHZzYhVIimw.cjs +7 -0
- package/browser/cjs/gmJVh5GO4raegeQH.cjs +6 -0
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{fsGSNDVe9urk2cLB.mjs → BUX-eSzx85xb14z2.mjs} +2 -2
- package/browser/esm/BhK8LG6eLNtnpyM8.mjs +50 -0
- package/browser/esm/{B7ChnkonDRA2zazH.mjs → Bt5mafuXg0WhvqQl.mjs} +3 -3
- package/browser/esm/CM2aBn9YvLNeeDKP.mjs +26 -0
- package/browser/esm/{DK1cCQD1jHxZbFAp.mjs → CWzQRJNunubg1KYs.mjs} +1 -1
- package/browser/esm/{CRmCo9Jr1gvSFGVp.mjs → C_L0TMqGy3dfJBxX.mjs} +833 -829
- package/browser/esm/{aeHM-2IGRQaGFohd.mjs → D3fJ2Y2akXy1Cea2.mjs} +28 -27
- package/browser/esm/DAM5zld1EMvhrTq7.mjs +46 -0
- package/browser/esm/DBreu3Q0z7uri1up.mjs +50 -0
- package/browser/esm/DYbBkU4jsgMfwHKv.mjs +155 -0
- package/browser/esm/DkCrTK-q70GM5ZtY.mjs +53 -0
- package/browser/esm/index.mjs +2 -2
- package/browser/esm/uswYw8_B9PDchitz.mjs +25 -0
- package/licenses/dependencies.txt +142 -142
- package/node/esm/{BSTIZiKBGgwjXLtp.mjs → B2g633xDh_bOofUD.mjs} +18 -18
- package/node/esm/{CGaHni9C2sipjSMn.mjs → B2kR5d7yN_btwSPu.mjs} +9 -7
- package/node/esm/{H012qdl97RHln5MW.mjs → B3fiHsOdyeQ-hH_X.mjs} +1 -1
- package/node/esm/{BEFwnAOkyd0CWlex.mjs → BCgE2DMn9_S_eSSk.mjs} +13 -13
- package/node/esm/B_WXfCoiTjdjGFTw.mjs +26 -0
- package/node/esm/BjHur-Y2v2kC9PV8.mjs +156 -0
- package/node/esm/CJHoW3AcW0bzWuGz.mjs +52 -0
- package/node/esm/CKgRE7End3PwfjDJ.mjs +25 -0
- package/node/esm/{CwKoYwlrp9nnVHln.mjs → EtyY49hdotdAcmRj.mjs} +22 -22
- package/node/esm/index.mjs +115 -116
- package/node/esm/{Df6HNjgJTgShGC-O.mjs → uQbXUzeyLOqo4POP.mjs} +1 -1
- package/package.json +17 -15
- package/browser/cjs/BYfcSe1JgcohGr-C.cjs +0 -7
- package/browser/cjs/BZPmbh6TWeAN2tiY.cjs +0 -6
- package/browser/cjs/CrkutQSHB1Buy5oQ.cjs +0 -6
- package/browser/cjs/D2KC31HOMCGQMLvD.cjs +0 -6
- package/browser/cjs/DiQXaxwfHcQfkYKX.cjs +0 -6
- package/browser/cjs/Dmw2IW35YLNmLgvP.cjs +0 -20
- package/browser/cjs/bItCE_-c88dO7Izw.cjs +0 -6
- package/browser/cjs/fa-Q2vHsld47aqrE.cjs +0 -6
- package/browser/esm/BZPlU0oT2oGTQQgK.mjs +0 -46
- package/browser/esm/BzGH26JDt4xKZfM7.mjs +0 -49
- package/browser/esm/CA-_Kya2gsMrF9Ef.mjs +0 -26
- package/browser/esm/CGBRrUgnGzuP9FGo.mjs +0 -156
- package/browser/esm/csScKLYnqrrlL197.mjs +0 -25
- package/browser/esm/lm9H6CMj_7o_ra2l.mjs +0 -53
- package/node/esm/BqLlyKyVXFNiRaJv.mjs +0 -25
- package/node/esm/Cq6TadzONqFlX07d.mjs +0 -26
- package/node/esm/D71WQjM6hP5FzBql.mjs +0 -157
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.12
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
8
|
-
import { memo as n, useRef as i, useState as o, useEffect as l, useLayoutEffect as r, useMemo as s } from "react";
|
|
9
|
-
import { useMeasure as a } from "react-use";
|
|
10
|
-
import { alpha as c, getOverlayAlpha as p } from "@mui/material/styles";
|
|
11
|
-
import { DialogContent as d, Box as u, TextField as f, InputAdornment as m, Collapse as g, MenuItem as x, FormControl as h, InputLabel as O, Select as y } from "@mui/material";
|
|
12
|
-
import { ICell as C, IRange as b } from "@sheetxl/sdk";
|
|
13
|
-
import { useCallbackRef as v, KeyCodes as R, DynamicIcon as k, KeyModifiers as T } from "@sheetxl/utils-react";
|
|
14
|
-
import { InternalWindow as w, ExhibitOptionButton as F, ExhibitDivider as E } from "@sheetxl/utils-mui";
|
|
15
|
-
const K = { width: "1.5rem", height: "1.5rem" }, S = n((n2) => {
|
|
16
|
-
const { label: i2, value: r2, options: a2, onSelect: d2, tabIndex: u2 = 0, ...f2 } = n2, [m2, g2] = o(() => M(r2, a2));
|
|
17
|
-
l(() => {
|
|
18
|
-
g2(M(r2, a2));
|
|
19
|
-
}, [r2, a2]);
|
|
20
|
-
const C2 = v((e2) => {
|
|
21
|
-
g2(e2.target.value), d2?.(a2[e2.target.value]);
|
|
22
|
-
}, [d2, a2]), b2 = s(() => Object.keys(a2).map((t2) => e(x, { value: t2, children: t2 }, t2)), [a2]);
|
|
23
|
-
return t(h, { sx: { minWidth: 135 }, size: "small", children: [e(O, { children: i2 }), e(y, { inputProps: { tabIndex: u2 }, value: m2, label: i2, onChange: C2, sx: { backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, ...f2, children: b2 })] });
|
|
24
|
-
}), I = { Workbook: "workbook", Sheet: "sheet" }, D = { enter: 140, exit: 140 }, A = { Formulas: C.Content.Formulas, Values: C.Content.Values, Notes: C.Content.Notes, Comments: C.Content.Comments }, B = { ...A };
|
|
25
|
-
delete B.Values;
|
|
26
|
-
const $ = { "By Rows": true, "By Columns": false }, M = (e2, t2) => {
|
|
27
|
-
const n2 = Object.keys(t2);
|
|
28
|
-
for (let i2 = 0; i2 < n2.length; i2++) {
|
|
29
|
-
const o2 = n2[i2];
|
|
30
|
-
if (t2[o2] === e2) return o2;
|
|
31
|
-
}
|
|
32
|
-
}, P = n((n2) => {
|
|
33
|
-
const { replace: s2 = false, findText: x2, replaceText: h2, findOptions: O2, replaceOptions: y2, title: M2, onHide: P2, onFindOrReplace: W, ...z } = n2, L = i(null), V = i(null), N = i(null), j = i(null), H = i(null), U = i(null), G = (e2, t2) => {
|
|
34
|
-
if (!t2) return;
|
|
35
|
-
t2.start(e2, { center: false }), setTimeout(() => t2.stop(e2), 180);
|
|
36
|
-
}, [q, J] = o(false), [Q, X] = o(false), [Y, Z] = o(s2), [_, ee] = o(false), [te, ne] = o(false), [ie, oe] = o({ replaceText: null, replace: s2, replaceOptions: {}, findOptions: { text: null, matchCase: false, matchEntireCell: false, useRegex: false, orientation: b.Orientation.Row, fields: [C.Content.Formulas] }, scope: I.Sheet }), le = v(async (e2, t2, n3, i2) => {
|
|
37
|
-
if (!W) return;
|
|
38
|
-
const o2 = { ...ie };
|
|
39
|
-
o2.replaceOptions = { ...o2.replaceOptions }, o2.findOptions = { ...o2.findOptions }, o2.replaceOptions.maxCount = n3 ? void 0 : 1, o2.replace = t2, t2 && ie.findOptions.fields?.[0] === C.Content.Values && (o2.findOptions.fields = [C.Content.Formulas]), o2.findOptions.reverse = !e2;
|
|
40
|
-
const l2 = await W({ autoFocus: i2, ...o2 });
|
|
41
|
-
ee(0 === l2);
|
|
42
|
-
}, [ie, W]);
|
|
43
|
-
l(() => {
|
|
44
|
-
ee(false);
|
|
45
|
-
}, [ie, Q, Y]);
|
|
46
|
-
const re = v((e2, t2) => {
|
|
47
|
-
if (e2.keyCode === R.Enter) {
|
|
48
|
-
if (!ie.findOptions.text) return;
|
|
49
|
-
let n3 = true, i2 = false;
|
|
50
|
-
e2.shiftKey && (n3 = false), t2 ? (e2.ctrlKey && e2.altKey && (i2 = true), G(e2, i2 ? U.current : H.current)) : G(e2, n3 ? j.current : N.current), le(n3, t2, i2, false);
|
|
51
|
-
}
|
|
52
|
-
}, [ie]), se = i(null);
|
|
53
|
-
r(() => {
|
|
54
|
-
oe((e2) => {
|
|
55
|
-
const t2 = { ...e2 };
|
|
56
|
-
t2.findOptions.text = x2 && x2.length > 0 ? x2 : e2.findOptions.text ?? "", J(true), void 0 !== h2 && (t2.replaceText = h2), O2 && (t2.findOptions = { ...t2.findOptions, ...O2 }), t2.replaceText || (t2.replaceText = ""), t2.replaceOptions && (t2.replaceOptions = { ...t2.replaceOptions }), y2 && (t2.replaceOptions = { ...t2.replaceOptions, ...y2 }), ie.findOptions.fields?.[0] || (ie.findOptions.fields = [C.Content.Formulas]);
|
|
57
|
-
const n3 = !(!y2 && void 0 === h2);
|
|
58
|
-
return n3 && Z(n3), t2;
|
|
59
|
-
}), te || se.current?.focus();
|
|
60
|
-
}, [x2, h2, O2, y2]), l(() => {
|
|
61
|
-
Y ? (ie.findOptions.fields[0], C.Content.Values) : J(true);
|
|
62
|
-
}, [Y]), l(() => {
|
|
63
|
-
if (q && L.current && ie.findOptions.text === L.current.value) return L.current === document.activeElement || L.current.contains(document.activeElement) ? (L.current?.select(), void J(false)) : void L.current.addEventListener("focus", () => {
|
|
64
|
-
L.current?.select(), J(false);
|
|
65
|
-
}, { once: true });
|
|
66
|
-
}, [q, ie]);
|
|
67
|
-
const [ae, { width: ce }] = a();
|
|
68
|
-
return e(w, { ref: se, title: M2 ?? (Y ? "Find & Replace" : "Find"), initialPosition: { y: "35" }, autoFocusSel: ".input", onHide: P2, onFocus: () => ne(true), onBlur: () => {
|
|
69
|
-
ne(false), ee(false);
|
|
70
|
-
}, slotProps: { paper: { elevation: te ? 3 : 1 } }, ...z, children: t(d, { dividers: true, ref: ae, sx: { display: "flex", flexDirection: "column", paddingLeft: (e2) => e2.spacing(1.5), paddingRight: (e2) => e2.spacing(1.5) }, onKeyDown: (e2) => {
|
|
71
|
-
if ("h" === e2.key && e2.ctrlKey) Z(true), L.current?.contains(document.activeElement) && V.current?.focus();
|
|
72
|
-
else if ("f" === e2.key && e2.ctrlKey) L.current?.focus();
|
|
73
|
-
else if ("c" === e2.key && e2.altKey) oe((e3) => {
|
|
74
|
-
const t2 = { ...e3 };
|
|
75
|
-
return t2.findOptions.matchCase = !e3.findOptions.matchCase, t2;
|
|
76
|
-
});
|
|
77
|
-
else if ("e" === e2.key && e2.altKey) oe((e3) => {
|
|
78
|
-
const t2 = { ...e3 };
|
|
79
|
-
return t2.findOptions.matchEntireCell = !e3.findOptions.matchEntireCell, t2;
|
|
80
|
-
});
|
|
81
|
-
else {
|
|
82
|
-
if ("r" !== e2.key || !e2.altKey) return;
|
|
83
|
-
oe((e3) => {
|
|
84
|
-
const t2 = { ...e3 };
|
|
85
|
-
return t2.findOptions.useRegex = !e3.findOptions.useRegex, t2;
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
e2.preventDefault();
|
|
89
|
-
}, children: [t(u, { sx: { display: "flex", flexDirection: "row", gap: (e2) => e2.spacing(1) }, children: [t(u, { sx: { display: "flex", flexDirection: "row", alignItems: "start", gap: (e2) => e2.spacing(0.25), paddingTop: "3px" }, children: [e(F, { selected: Q, onSelectToggle: (e2) => {
|
|
90
|
-
X(e2);
|
|
91
|
-
}, preventFocus: true, label: "Toggle Additional Options", icon: e(k, { iconKey: "FindOptions" }) }), e(F, { selected: Y, onSelectToggle: (e2) => {
|
|
92
|
-
Z(e2);
|
|
93
|
-
}, preventFocus: true, label: "Toggle Replace", icon: e(k, { iconKey: "FindReplaceToggle" }), shortcut: { key: Y ? "F" : "H", modifiers: [T.Ctrl] } })] }), t(u, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", boxSizing: "border-box" }, children: [t(u, { sx: { display: "flex", flexDirection: "row", alignItems: "center" }, children: [e(f, { label: "Find", slotProps: { input: { sx: { paddingRight: (e2) => e2.spacing(1), minWidth: ce > 460 ? "20em" : void 0, backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, endAdornment: e(m, { position: "end", children: t(u, { sx: { display: "flex", alignItems: "center", flexDirection: "row", gap: "2px" }, children: [e(F, { style: K, selected: ie.findOptions.matchCase, onBlur: () => {
|
|
94
|
-
console.log("blur");
|
|
95
|
-
}, onSelectToggle: (e2) => {
|
|
96
|
-
oe((t2) => {
|
|
97
|
-
const n3 = { ...t2 };
|
|
98
|
-
return n3.findOptions.matchCase = e2, n3;
|
|
99
|
-
});
|
|
100
|
-
}, label: "Match Case", shortcut: { key: "C", modifiers: [T.Alt] }, icon: e(k, { iconKey: "FindCaseSensitive", size: "1rem" }) }), e(F, { style: K, selected: ie.findOptions.matchEntireCell, onSelectToggle: (e2) => {
|
|
101
|
-
oe((t2) => {
|
|
102
|
-
const n3 = { ...t2 };
|
|
103
|
-
return n3.findOptions.matchEntireCell = e2, n3;
|
|
104
|
-
});
|
|
105
|
-
}, label: "Match Entire Cell", shortcut: { key: "E", modifiers: [T.Alt] }, icon: e(k, { iconKey: "FindWholeWord", size: "1rem" }) }), e(F, { style: K, selected: ie.findOptions.useRegex, onSelectToggle: (e2) => {
|
|
106
|
-
oe((t2) => {
|
|
107
|
-
const n3 = { ...t2 };
|
|
108
|
-
return n3.findOptions.useRegex = e2, n3;
|
|
109
|
-
});
|
|
110
|
-
}, label: "Use Regular Expression", shortcut: { key: "R", modifiers: [T.Alt] }, icon: e(k, { iconKey: "FindRegEx", size: "1rem" }) })] }) }) }, inputLabel: { shrink: true }, htmlInput: { draggable: false, ref: L, className: "input", autoFocus: true, spellCheck: false, autoComplete: "off", sx: { paddingTop: (e2) => e2.spacing(1.25), paddingBottom: (e2) => e2.spacing(0.75) } } }, sx: { flex: "1 1 100%", marginRight: (e2) => e2.spacing(1), "& .MuiOutlinedInput-notchedOutline": { borderColor: (e2) => _ ? `${e2.palette.error.main} !important` : void 0 }, "& .MuiInputLabel-outlined": { color: (e2) => _ ? `${e2.palette.error.main} !important` : void 0 } }, value: ie.findOptions.text ?? "", onChange: (e2) => {
|
|
111
|
-
oe((t2) => {
|
|
112
|
-
const n3 = { ...t2 };
|
|
113
|
-
return n3.findOptions.text = e2.target.value, n3;
|
|
114
|
-
});
|
|
115
|
-
}, onKeyDown: (e2) => re(e2, false), onContextMenu: (e2) => {
|
|
116
|
-
e2.stopPropagation();
|
|
117
|
-
} }), e(F, { selected: ie.findOptions.reverse, onSelectToggle: (e2) => {
|
|
118
|
-
le(false, false);
|
|
119
|
-
}, touchRippleRef: N, label: "", shortcut: { key: "Enter", modifiers: [T.Shift] }, icon: e(k, { iconKey: ie.findOptions.orientation !== b.Orientation.Column ? "ArrowBack" : "ArrowUpward" }), disabled: !ie.findOptions.text }), e(F, { selected: !ie.findOptions.reverse, onSelectToggle: (e2) => {
|
|
120
|
-
le(true, false);
|
|
121
|
-
}, touchRippleRef: j, label: "Next Match", shortcut: { key: "Enter" }, icon: e(k, { iconKey: ie.findOptions.orientation !== b.Orientation.Column ? "ArrowForward" : "ArrowDownward" }), disabled: !ie.findOptions.text })] }), e(g, { in: Y, timeout: D, onExit: () => {
|
|
122
|
-
L.current?.focus();
|
|
123
|
-
}, children: t(u, { sx: { display: "flex", flexDirection: "row", alignItems: "center", marginTop: (e2) => e2.spacing(2) }, children: [e(f, { label: "Replace", slotProps: { input: { sx: { paddingRight: (e2) => e2.spacing(1), backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` } }, inputLabel: { shrink: true }, htmlInput: { ref: V, className: "input", spellCheck: false, autoComplete: "off", sx: { paddingTop: (e2) => e2.spacing(1.25), paddingBottom: (e2) => e2.spacing(0.75) } } }, sx: { flex: "1 1 100%", marginRight: (e2) => e2.spacing(1) }, value: ie.replaceText ?? "", onChange: (e2) => {
|
|
124
|
-
oe((t2) => {
|
|
125
|
-
const n3 = { ...t2 };
|
|
126
|
-
return n3.replaceText = e2.target.value, n3;
|
|
127
|
-
});
|
|
128
|
-
}, onKeyDown: (e2) => re(e2, true), onContextMenu: (e2) => {
|
|
129
|
-
e2.stopPropagation();
|
|
130
|
-
} }), e(F, { onSelectToggle: (e2) => {
|
|
131
|
-
le(true, true);
|
|
132
|
-
}, touchRippleRef: H, label: "Replace", shortcut: { key: "Enter" }, icon: e(k, { iconKey: "FindReplace" }), disabled: !ie.findOptions.text }), e(F, { onSelectToggle: (e2) => {
|
|
133
|
-
le(true, true, true);
|
|
134
|
-
}, touchRippleRef: U, label: "Replace All", shortcut: { key: "Enter", modifiers: [T.Ctrl, T.Alt] }, icon: e(k, { iconKey: "FindReplaceAll" }), disabled: !ie.findOptions.text })] }) })] })] }), e(g, { in: Q, timeout: D, onExit: () => {
|
|
135
|
-
L.current?.focus();
|
|
136
|
-
}, children: t(u, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", gap: (e2) => e2.spacing(1.5), marginTop: (e2) => e2.spacing(1) }, children: [e(E, { orientation: "horizontal", sx: { marginBottom: (e2) => e2.spacing(1.5) } }), t(u, { sx: { display: "flex", flexDirection: ce >= 383 ? "row" : "column", justifyContent: "space-evenly", alignItems: "center", gap: (e2) => e2.spacing(1), rowGap: (e2) => e2.spacing(2) }, tabIndex: -1, children: [e(S, { label: "Within", value: ie.scope, options: I, onSelect: (e2) => {
|
|
137
|
-
oe((t2) => {
|
|
138
|
-
const n3 = { ...t2 };
|
|
139
|
-
return n3.scope = e2, n3;
|
|
140
|
-
});
|
|
141
|
-
} }), e(S, { label: "Search", value: ie.findOptions.orientation !== b.Orientation.Column, options: $, onSelect: (e2) => {
|
|
142
|
-
oe((t2) => {
|
|
143
|
-
const n3 = { ...t2 };
|
|
144
|
-
return n3.findOptions.orientation = e2 ? b.Orientation.Row : b.Orientation.Column, n3;
|
|
145
|
-
});
|
|
146
|
-
} }), e(S, { label: "Look in", value: Y && ie.findOptions.fields?.[0] === C.Content.Values ? C.Content.Formulas : ie.findOptions.fields?.[0], options: Y ? B : A, onSelect: (e2) => {
|
|
147
|
-
oe((t2) => {
|
|
148
|
-
const n3 = { ...t2 };
|
|
149
|
-
return n3.findOptions.fields = [e2], n3;
|
|
150
|
-
});
|
|
151
|
-
} })] })] }) })] }) });
|
|
152
|
-
});
|
|
153
|
-
export {
|
|
154
|
-
P as FindReplaceWindow,
|
|
155
|
-
I as ScopeOptions,
|
|
156
|
-
P as default
|
|
157
|
-
};
|