@sheetxl/studio-mui 0.7.5 → 0.7.6
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/{CuHwOikK2J1MLsHN.cjs → -u6vWH9DiYlO1rsa.cjs} +1 -1
- package/browser/cjs/1-LY_VyMGQ9MfeNB.cjs +20 -0
- package/browser/cjs/{CJQkIVFa7S1AZcBP.cjs → 7MV1n9Y0yXU0hKpM.cjs} +1 -1
- package/browser/cjs/{JURSrTjvLJ8bc4Yl.cjs → B8-dSgXI2XZKFvtp.cjs} +2 -2
- package/browser/cjs/BEmcHbiMOFhIa91S.cjs +6 -0
- package/browser/cjs/{D6pUyWwmIliDWT8B.cjs → BdNRaXTgqRzPmg0L.cjs} +2 -2
- package/browser/cjs/{D4c72fkCJiL-S_-a.cjs → Ce6JLd3qejgMgM3r.cjs} +7 -7
- package/browser/cjs/{CHyGxDKCce-XV53l.cjs → D7AH724IJJvos02e.cjs} +1 -1
- package/browser/cjs/{B4uj1Smd-98Hab_l.cjs → DefYX_aeMZivbpEt.cjs} +2 -2
- package/browser/cjs/{Td2md8ruASYOp_Rr.cjs → KOj1qev47_vzzRFV.cjs} +1 -1
- package/browser/cjs/{jHU6TwhWd2lZX-VA.cjs → St8H4B5iT2fsqOb7.cjs} +1 -1
- package/browser/cjs/TS1uQTjkemJ22p1Y.cjs +6 -0
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/BNxVvFkY3b2mERJf.mjs +64 -0
- package/browser/esm/{B7CJX7fKvv1vBk8-.mjs → BnVbG5kg41edf8oz.mjs} +2 -2
- package/browser/esm/{CwAqw5gJ2yzuXbLx.mjs → CJsYe8TqU6tqj4UH.mjs} +55 -56
- package/browser/esm/{gpytxNaiTkBoZ6aj.mjs → CKLhWrNo1E4r3pG7.mjs} +1 -1
- package/browser/esm/{BbfPde9B9b4p64_L.mjs → DVSjscO7zuDsOD4v.mjs} +2 -2
- package/browser/esm/{CkXFR3hHwNp6jfJV.mjs → DdLujAMc-Cefddif.mjs} +1 -1
- package/browser/esm/{hWToTYtpa0PFzhRm.mjs → Dg_NRblGOcetqhnC.mjs} +17 -18
- package/browser/esm/{COI8Eg7HQcdPFGcZ.mjs → YfJJd16cfjuXpb8G.mjs} +1 -1
- package/browser/esm/beUKtp_qQMnuYcVk.mjs +4452 -0
- package/browser/esm/index.mjs +68 -71
- package/browser/esm/{KULqIIHcvNriSu7F.mjs → miaBr4cu9WKLs8Is.mjs} +1 -1
- package/browser/esm/{C48fXszXYqcJMQni.mjs → nwvZlIH9rheqctQz.mjs} +1 -1
- package/browser/esm/{CajWEWsYWzynjFKw.mjs → yQgfM4ehXrfnEoUK.mjs} +2 -2
- package/licenses/dependencies.txt +139 -139
- package/node/esm/{DEnAvzkXoQEvscd-.mjs → B9TRK2jd_Ki2RifT.mjs} +1 -1
- package/node/esm/{DExsoaMD7hWNhceb.mjs → BTp8XtWh47Y1g1MM.mjs} +1 -1
- package/node/esm/BcB8nCbI5HW5jv5q.mjs +65 -0
- package/node/esm/C5WzmLTAphEQU3CU.mjs +155 -0
- package/node/esm/{DH3yxwtQR5c61iv3.mjs → CN79Z_qqLiF3V5r0.mjs} +1 -1
- package/node/esm/{DKhoTrOwIfMtft9r.mjs → CNCYE_ff8SnJJMPN.mjs} +41 -42
- package/node/esm/{DQIYBoarjlonhEEn.mjs → COoX8Ir66wNuWJ_m.mjs} +1 -1
- package/node/esm/{BHFc6-pxJ_X3esj1.mjs → CxbA2L1Ap9NSJcxm.mjs} +1 -1
- package/node/esm/{CuIak_iZn0ApypmT.mjs → Dln5o1FP_HWPs0Uf.mjs} +1 -1
- package/node/esm/index.mjs +1404 -1451
- package/node/esm/{NYFZEGBg9dFXwfFf.mjs → qpKmKMfv4DDofXKf.mjs} +1 -1
- package/package.json +8 -9
- package/types/index.d.ts +14 -92
- package/browser/cjs/BnpPHKTC6_96pDcW.cjs +0 -6
- package/browser/cjs/F4v-BOmzUXzCO3uz.cjs +0 -6
- package/browser/cjs/QQ4l7f6lYZb7S6td.cjs +0 -20
- package/browser/esm/BhP57_jo4NnvHBgF.mjs +0 -64
- package/browser/esm/CGVa4zFRRZyFzDvh.mjs +0 -4489
- package/node/esm/8qD_FXFKXbOqF2_X.mjs +0 -156
- package/node/esm/DQKU8gdXpx4S0S0D.mjs +0 -65
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.6
|
|
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 n } from "react/jsx-runtime";
|
|
8
|
+
import { memo as t, 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 g, Collapse as m, 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 T, KeyCodes as v, DynamicIcon as R, KeyModifiers as k } from "@sheetxl/utils-react";
|
|
14
|
+
import { InternalWindow as F, ExhibitOptionButton as w, ExhibitDivider as E } from "@sheetxl/utils-mui";
|
|
15
|
+
const K = t((t2) => {
|
|
16
|
+
const { label: i2, value: r2, options: a2, onSelect: d2, tabIndex: u2 = 0, ...f2 } = t2, [g2, m2] = o(() => $(r2, a2));
|
|
17
|
+
l(() => {
|
|
18
|
+
m2($(r2, a2));
|
|
19
|
+
}, [r2, a2]);
|
|
20
|
+
const C2 = T((e2) => {
|
|
21
|
+
m2(e2.target.value), d2?.(a2[e2.target.value]);
|
|
22
|
+
}, [d2, a2]), b2 = s(() => Object.keys(a2).map((n2) => e(x, { value: n2, children: n2 }, n2)), [a2]);
|
|
23
|
+
return n(h, { sx: { minWidth: 135 }, size: "small", children: [e(O, { children: i2 }), e(y, { inputProps: { tabIndex: u2 }, value: g2, label: i2, onChange: C2, sx: { backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, ...f2, children: b2 })] });
|
|
24
|
+
}), S = { Workbook: "workbook", Sheet: "sheet" }, I = { enter: 140, exit: 140 }, D = { Formulas: C.Content.Formulas, Values: C.Content.Values, Notes: C.Content.Notes, Comments: C.Content.Comments }, A = { ...D };
|
|
25
|
+
delete A.Values;
|
|
26
|
+
const P = { "By Rows": true, "By Columns": false }, $ = (e2, n2) => {
|
|
27
|
+
const t2 = Object.keys(n2);
|
|
28
|
+
for (let i2 = 0; i2 < t2.length; i2++) {
|
|
29
|
+
const o2 = t2[i2];
|
|
30
|
+
if (n2[o2] === e2) return o2;
|
|
31
|
+
}
|
|
32
|
+
}, B = t((t2) => {
|
|
33
|
+
const { replace: s2 = false, findText: x2, replaceText: h2, findOptions: O2, replaceOptions: y2, title: $2, onHide: B2, onFindOrReplace: M, ...W } = t2, L = i(null), V = i(null), N = i(null), j = i(null), H = i(null), z = i(null), U = (e2, n2) => {
|
|
34
|
+
if (!n2) return;
|
|
35
|
+
n2.start(e2, { center: false }), setTimeout(() => n2.stop(e2), 180);
|
|
36
|
+
}, [G, X] = o(false), [q, J] = o(false), [Q, Y] = o(s2), [Z, _] = o(false), [ee, ne] = o(false), [te, ie] = o({ findText: null, replaceText: null, replace: s2, replaceOptions: {}, findOptions: { matchCase: false, matchEntireCell: false, useRegex: false, orientation: b.Orientation.Row, fields: [C.Content.Formulas] }, scope: S.Sheet }), oe = T(async (e2, n2, t3, i2) => {
|
|
37
|
+
if (!M) return;
|
|
38
|
+
const o2 = { ...te };
|
|
39
|
+
o2.replaceOptions = { ...o2.replaceOptions }, o2.findOptions = { ...o2.findOptions }, o2.replaceOptions.maxCount = t3 ? void 0 : 1, o2.replace = n2, n2 && te.findOptions.fields?.[0] === C.Content.Values && (o2.findOptions.fields = [C.Content.Formulas]), o2.findOptions.reverse = !e2;
|
|
40
|
+
const l2 = await M({ autoFocus: i2, ...o2 });
|
|
41
|
+
_(0 === l2);
|
|
42
|
+
}, [te, M]);
|
|
43
|
+
l(() => {
|
|
44
|
+
_(false);
|
|
45
|
+
}, [te, q, Q]);
|
|
46
|
+
const le = T((e2, n2) => {
|
|
47
|
+
if (e2.keyCode === v.Enter) {
|
|
48
|
+
if (!te.findText) return;
|
|
49
|
+
let t3 = true, i2 = false;
|
|
50
|
+
e2.shiftKey && (t3 = false), n2 ? (e2.ctrlKey && e2.altKey && (i2 = true), U(e2, i2 ? z.current : H.current)) : U(e2, t3 ? j.current : N.current), oe(t3, n2, i2, false);
|
|
51
|
+
}
|
|
52
|
+
}, [te]), re = i(null);
|
|
53
|
+
r(() => {
|
|
54
|
+
ie((e2) => {
|
|
55
|
+
const n2 = { ...e2 };
|
|
56
|
+
n2.findText = x2 && x2.length > 0 ? x2 : e2.findText ?? "", X(true), void 0 !== h2 && (n2.replaceText = h2), O2 && (n2.findOptions = { ...n2.findOptions, ...O2 }), n2.replaceText || (n2.replaceText = ""), n2.replaceOptions && (n2.replaceOptions = { ...n2.replaceOptions }), y2 && (n2.replaceOptions = { ...n2.replaceOptions, ...y2 }), te.findOptions.fields?.[0] || (te.findOptions.fields = [C.Content.Formulas]);
|
|
57
|
+
const t3 = !(!y2 && void 0 === h2);
|
|
58
|
+
return t3 && Y(t3), n2;
|
|
59
|
+
}), ee || re.current?.focus();
|
|
60
|
+
}, [x2, h2, O2, y2]), l(() => {
|
|
61
|
+
Q ? (te.findOptions.fields[0], C.Content.Values) : X(true);
|
|
62
|
+
}, [Q]), l(() => {
|
|
63
|
+
if (G && L.current && te.findText === L.current.value) return L.current === document.activeElement || L.current.contains(document.activeElement) ? (L.current?.select(), void X(false)) : void L.current.addEventListener("focus", () => {
|
|
64
|
+
L.current?.select(), X(false);
|
|
65
|
+
}, { once: true });
|
|
66
|
+
}, [G, te]);
|
|
67
|
+
const [se, { width: ae }] = a();
|
|
68
|
+
return e(F, { ref: re, title: $2 ?? (Q ? "Find & Replace" : "Find"), initialPosition: { y: "35" }, autoFocusSel: ".input", onHide: B2, onFocus: () => ne(true), onBlur: () => {
|
|
69
|
+
ne(false), _(false);
|
|
70
|
+
}, PaperProps: { elevation: ee ? 3 : 1 }, ...W, children: n(d, { dividers: true, ref: se, 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) Y(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) ie((e3) => {
|
|
74
|
+
const n2 = { ...e3 };
|
|
75
|
+
return n2.findOptions.matchCase = !e3.findOptions.matchCase, n2;
|
|
76
|
+
});
|
|
77
|
+
else if ("e" === e2.key && e2.altKey) ie((e3) => {
|
|
78
|
+
const n2 = { ...e3 };
|
|
79
|
+
return n2.findOptions.matchEntireCell = !e3.findOptions.matchEntireCell, n2;
|
|
80
|
+
});
|
|
81
|
+
else {
|
|
82
|
+
if ("r" !== e2.key || !e2.altKey) return;
|
|
83
|
+
ie((e3) => {
|
|
84
|
+
const n2 = { ...e3 };
|
|
85
|
+
return n2.findOptions.useRegex = !e3.findOptions.useRegex, n2;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
e2.preventDefault();
|
|
89
|
+
}, children: [n(u, { sx: { display: "flex", flexDirection: "row", gap: (e2) => e2.spacing(1) }, children: [n(u, { sx: { display: "flex", flexDirection: "row", alignItems: "start", gap: (e2) => e2.spacing(0.25), paddingTop: "3px" }, children: [e(w, { selected: q, onSelectToggle: (e2) => {
|
|
90
|
+
J(e2);
|
|
91
|
+
}, preventFocus: true, label: "Toggle Additional Options", icon: e(R, { iconKey: "FindOptions" }) }), e(w, { selected: Q, onSelectToggle: (e2) => {
|
|
92
|
+
Y(e2);
|
|
93
|
+
}, preventFocus: true, label: "Toggle Replace", icon: e(R, { iconKey: "FindReplaceToggle" }), shortcut: { key: Q ? "F" : "H", modifiers: [k.Ctrl] } })] }), n(u, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", boxSizing: "border-box" }, children: [n(u, { sx: { display: "flex", flexDirection: "row", alignItems: "center" }, children: [e(f, { label: "Find", InputLabelProps: { shrink: true }, InputProps: { sx: { paddingRight: (e2) => e2.spacing(1), minWidth: ae > 460 ? "20em" : void 0, backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, inputProps: { 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) } }, endAdornment: e(g, { sx: { transform: "scale(0.75) translateX(16px)" }, position: "end", children: n(u, { sx: { display: "flex", alignItems: "center", flexDirection: "row", gap: "1px" }, children: [e(w, { selected: te.findOptions.matchCase, onSelectToggle: (e2) => {
|
|
94
|
+
ie((n2) => {
|
|
95
|
+
const t3 = { ...n2 };
|
|
96
|
+
return t3.findOptions.matchCase = e2, t3;
|
|
97
|
+
});
|
|
98
|
+
}, label: "Match Case", shortcut: { key: "C", modifiers: [k.Alt] }, icon: e(R, { iconKey: "FindCaseSensitive" }) }), e(w, { selected: te.findOptions.matchEntireCell, onSelectToggle: (e2) => {
|
|
99
|
+
ie((n2) => {
|
|
100
|
+
const t3 = { ...n2 };
|
|
101
|
+
return t3.findOptions.matchEntireCell = e2, t3;
|
|
102
|
+
});
|
|
103
|
+
}, label: "Match Entire Cell", shortcut: { key: "E", modifiers: [k.Alt] }, icon: e(R, { iconKey: "FindWholeWord" }) }), e(w, { selected: te.findOptions.useRegex, onSelectToggle: (e2) => {
|
|
104
|
+
ie((n2) => {
|
|
105
|
+
const t3 = { ...n2 };
|
|
106
|
+
return t3.findOptions.useRegex = e2, t3;
|
|
107
|
+
});
|
|
108
|
+
}, label: "Use Regular Expression", shortcut: { key: "R", modifiers: [k.Alt] }, icon: e(R, { iconKey: "FindRegEx" }) })] }) }) }, sx: { flex: "1 1 100%", marginRight: (e2) => e2.spacing(1), "& .MuiOutlinedInput-notchedOutline": { borderColor: (e2) => Z ? `${e2.palette.error.main} !important` : void 0 }, "& .MuiInputLabel-outlined": { color: (e2) => Z ? `${e2.palette.error.main} !important` : void 0 } }, value: te.findText ?? "", onChange: (e2) => {
|
|
109
|
+
ie((n2) => {
|
|
110
|
+
const t3 = { ...n2 };
|
|
111
|
+
return t3.findText = e2.target.value, t3;
|
|
112
|
+
});
|
|
113
|
+
}, onKeyDown: (e2) => le(e2, false), onContextMenu: (e2) => {
|
|
114
|
+
e2.stopPropagation();
|
|
115
|
+
} }), e(w, { selected: te.findOptions.reverse, onSelectToggle: (e2) => {
|
|
116
|
+
oe(false, false);
|
|
117
|
+
}, touchRippleRef: N, label: "", shortcut: { key: "Enter", modifiers: [k.Shift] }, icon: e(R, { iconKey: te.findOptions.orientation !== b.Orientation.Column ? "ArrowBack" : "ArrowUpward" }), disabled: !te.findText }), e(w, { selected: !te.findOptions.reverse, onSelectToggle: (e2) => {
|
|
118
|
+
oe(true, false);
|
|
119
|
+
}, touchRippleRef: j, label: "Next Match", shortcut: { key: "Enter" }, icon: e(R, { iconKey: te.findOptions.orientation !== b.Orientation.Column ? "ArrowForward" : "ArrowDownward" }), disabled: !te.findText })] }), e(m, { in: Q, timeout: I, onExit: () => {
|
|
120
|
+
L.current?.focus();
|
|
121
|
+
}, children: n(u, { sx: { display: "flex", flexDirection: "row", alignItems: "center", marginTop: (e2) => e2.spacing(2) }, children: [e(f, { label: "Replace", InputLabelProps: { shrink: true }, InputProps: { sx: { paddingRight: (e2) => e2.spacing(1), backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, inputProps: { 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: te.replaceText ?? "", onChange: (e2) => {
|
|
122
|
+
ie((n2) => {
|
|
123
|
+
const t3 = { ...n2 };
|
|
124
|
+
return t3.replaceText = e2.target.value, t3;
|
|
125
|
+
});
|
|
126
|
+
}, onKeyDown: (e2) => le(e2, true), onContextMenu: (e2) => {
|
|
127
|
+
e2.stopPropagation();
|
|
128
|
+
} }), e(w, { onSelectToggle: (e2) => {
|
|
129
|
+
oe(true, true);
|
|
130
|
+
}, touchRippleRef: H, label: "Replace", shortcut: { key: "Enter" }, icon: e(R, { iconKey: "FindReplace" }), disabled: !te.findText }), e(w, { onSelectToggle: (e2) => {
|
|
131
|
+
oe(true, true, true);
|
|
132
|
+
}, touchRippleRef: z, label: "Replace All", shortcut: { key: "Enter", modifiers: [k.Ctrl, k.Alt] }, icon: e(R, { iconKey: "FindReplaceAll" }), disabled: !te.findText })] }) })] })] }), e(m, { in: q, timeout: I, onExit: () => {
|
|
133
|
+
L.current?.focus();
|
|
134
|
+
}, children: n(u, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", gap: (e2) => e2.spacing(0.5), marginTop: (e2) => e2.spacing(1) }, children: [e(E, { orientation: "horizontal", sx: { marginBottom: (e2) => e2.spacing(1.5) } }), n(u, { sx: { display: "flex", flexDirection: ae >= 413 ? "row" : "column", justifyContent: "space-evenly", alignItems: "center", rowGap: (e2) => e2.spacing(2) }, tabIndex: -1, children: [e(K, { label: "Within", value: te.scope, options: S, onSelect: (e2) => {
|
|
135
|
+
ie((n2) => {
|
|
136
|
+
const t3 = { ...n2 };
|
|
137
|
+
return t3.scope = e2, t3;
|
|
138
|
+
});
|
|
139
|
+
} }), e(K, { label: "Search", value: te.findOptions.orientation !== b.Orientation.Column, options: P, onSelect: (e2) => {
|
|
140
|
+
ie((n2) => {
|
|
141
|
+
const t3 = { ...n2 };
|
|
142
|
+
return t3.findOptions.orientation = e2 ? b.Orientation.Row : b.Orientation.Column, t3;
|
|
143
|
+
});
|
|
144
|
+
} }), e(K, { label: "Look in", value: Q && te.findOptions.fields?.[0] === C.Content.Values ? C.Content.Formulas : te.findOptions.fields?.[0], options: Q ? A : D, onSelect: (e2) => {
|
|
145
|
+
ie((n2) => {
|
|
146
|
+
const t3 = { ...n2 };
|
|
147
|
+
return t3.findOptions.fields = [e2], t3;
|
|
148
|
+
});
|
|
149
|
+
} })] })] }) })] }) });
|
|
150
|
+
});
|
|
151
|
+
export {
|
|
152
|
+
B as FindReplaceWindow,
|
|
153
|
+
S as ScopeOptions,
|
|
154
|
+
B as default
|
|
155
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.6
|
|
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,87 +1,86 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.6
|
|
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.
|
|
6
6
|
*/
|
|
7
7
|
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
8
|
-
import { Box as i, TextField as n, InputAdornment as
|
|
9
|
-
import { KeyCodes as h } from "@sheetxl/utils-react";
|
|
10
|
-
import { toShortcutElements as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { alpha as
|
|
14
|
-
import { Close as C } from "@mui/icons-material";
|
|
8
|
+
import { Box as i, TextField as n, InputAdornment as o, IconButton as r, FormControlLabel as l, Checkbox as a, Typography as d, TableCell as s, DialogContent as c } from "@mui/material";
|
|
9
|
+
import { KeyCodes as h, DynamicIcon as p } from "@sheetxl/utils-react";
|
|
10
|
+
import { toShortcutElements as m, InternalWindow as u } from "@sheetxl/utils-mui";
|
|
11
|
+
import g, { useState as f, useMemo as x, useEffect as b } from "react";
|
|
12
|
+
import w from "clsx";
|
|
13
|
+
import { alpha as y, getOverlayAlpha as C, styled as R } from "@mui/material/styles";
|
|
15
14
|
import { AutoSizer as k, Table as v, Column as $ } from "react-virtualized";
|
|
16
15
|
import { CommonUtils as D } from "@sheetxl/utils";
|
|
17
|
-
const
|
|
18
|
-
class N extends
|
|
16
|
+
const K = "ReactVirtualizedDemo-flexContainer", I = "ReactVirtualizedDemo-tableRow", z = "ReactVirtualizedDemo-tableRowHover", H = "ReactVirtualizedDemo-tableCell", S = "ReactVirtualizedDemo-noClick";
|
|
17
|
+
class N extends g.PureComponent {
|
|
19
18
|
constructor() {
|
|
20
19
|
super(...arguments), this.getRowClassName = ({ index: e2 }) => {
|
|
21
20
|
const { onRowClick: t2 } = this.props;
|
|
22
|
-
return
|
|
23
|
-
}, this.cellRenderer = ({ cellData: e2, dataKey: i2, columnIndex: n2, width:
|
|
24
|
-
const { columns:
|
|
25
|
-
let d2 = e2, c2 = { height: l2, paddingRight: "2px", paddingTop: "0px", paddingBottom: "0px", minWidth: `${
|
|
26
|
-
return "shortcut" === i2 ? d2 =
|
|
21
|
+
return w(I, K, { [z]: -1 !== e2 && null != t2 });
|
|
22
|
+
}, this.cellRenderer = ({ cellData: e2, dataKey: i2, columnIndex: n2, width: o2 }) => {
|
|
23
|
+
const { columns: r2, rowHeight: l2, onRowClick: a2 } = this.props;
|
|
24
|
+
let d2 = e2, c2 = { height: l2, paddingRight: "2px", paddingTop: "0px", paddingBottom: "0px", minWidth: `${o2}px`, maxWidth: `${o2}px` };
|
|
25
|
+
return "shortcut" === i2 ? d2 = m(e2) : "description" === i2 && (c2 = { ...c2, fontSize: ".75rem", display: "block", paddingTop: "4px", whiteSpace: "pre-line" }), t(s, { component: "div", className: w(H, K, { [S]: null == a2 }), variant: "body", style: c2, align: null != n2 && r2[n2].numeric ? "right" : "left", children: d2 });
|
|
27
26
|
}, this.headerRenderer = ({ label: e2, columnIndex: i2, width: n2 }) => {
|
|
28
|
-
const { headerHeight:
|
|
29
|
-
return t(s, { component: "div", className:
|
|
27
|
+
const { headerHeight: o2, columns: r2 } = this.props, l2 = r2[i2];
|
|
28
|
+
return t(s, { component: "div", className: w(H, K, S), variant: "head", sx: { width: n2, height: o2, backgroundColor: (e3) => e3.palette.grey[300] }, align: l2.numeric ? "right" : "left", children: t("span", { children: l2.label }) });
|
|
30
29
|
};
|
|
31
30
|
}
|
|
32
31
|
static {
|
|
33
32
|
this.defaultProps = { headerHeight: 40, rowHeight: 48 };
|
|
34
33
|
}
|
|
35
34
|
render() {
|
|
36
|
-
const { columns: e2, rowHeight: i2, headerHeight: n2, ...
|
|
37
|
-
return t(k, { children: ({ height:
|
|
35
|
+
const { columns: e2, rowHeight: i2, headerHeight: n2, ...o2 } = this.props;
|
|
36
|
+
return t(k, { children: ({ height: r2, width: l2 }) => t(v, { height: r2, width: l2, rowHeight: i2, gridStyle: { direction: "inherit" }, headerHeight: n2, ...o2, rowClassName: this.getRowClassName, children: e2.map(({ dataKey: e3, width: i3, widthLess: n3, ...o3 }, r3) => {
|
|
38
37
|
const a2 = n3 ? l2 - n3 : i3;
|
|
39
|
-
return t($, { style: { flex: `1 1 ${a2}px` }, headerRenderer: (e4) => this.headerRenderer({ ...e4, width: a2, columnIndex:
|
|
38
|
+
return t($, { style: { flex: `1 1 ${a2}px` }, headerRenderer: (e4) => this.headerRenderer({ ...e4, width: a2, columnIndex: r3 }), className: K, cellDataGetter: ({ rowData: e4, columnData: t2, dataKey: i4 }) => e4[i4], cellRenderer: (e4) => this.cellRenderer({ ...e4, width: a2, columnIndex: r3 }), dataKey: e3, width: a2, ...o3 }, e3);
|
|
40
39
|
}) }) });
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
|
-
const T = R(N)(({ theme: e2 }) => ({ "& .ReactVirtualized__Table__headerRow": { ..."rtl" === e2.direction && { paddingLeft: "0 !important" }, ..."rtl" !== e2.direction && { paddingRight: void 0 } }, "& .ReactVirtualized__Table__Grid": { outline: "none" }, [`& .${
|
|
42
|
+
const T = R(N)(({ theme: e2 }) => ({ "& .ReactVirtualized__Table__headerRow": { ..."rtl" === e2.direction && { paddingLeft: "0 !important" }, ..."rtl" !== e2.direction && { paddingRight: void 0 } }, "& .ReactVirtualized__Table__Grid": { outline: "none" }, [`& .${K}`]: { display: "flex", alignItems: "center", boxSizing: "border-box" }, [`& .${I}`]: { cursor: "pointer" }, [`& .${z}`]: { "&:hover:not([disabled])": { backgroundColor: e2.palette.grey[200] } }, [`& .${H}`]: { flex: 1 }, [`& .${S}`]: { cursor: "initial" } }));
|
|
44
43
|
function _(s2) {
|
|
45
|
-
const { commands: c2, ...
|
|
44
|
+
const { commands: c2, ...m2 } = s2, [u2, g2] = f(false), [w2, R2] = f(""), k2 = x(() => {
|
|
46
45
|
let e2 = c2.getAllCommands();
|
|
47
|
-
|
|
46
|
+
u2 || (e2 = e2.filter((e3) => e3.command.shortcut())), e2.sort((e3, t3) => e3.command.label().localeCompare(t3.command.label()));
|
|
48
47
|
const t2 = [], i2 = (e3) => e3.replace(/\n\n/g, "\n");
|
|
49
48
|
for (let n2 = 0; n2 < e2.length; n2++) {
|
|
50
|
-
const
|
|
51
|
-
if (Array.isArray(
|
|
52
|
-
const e3 =
|
|
53
|
-
for (let n3 = 0; n3 < e3.length; n3++) t2.push({ label:
|
|
54
|
-
} else t2.push({ label:
|
|
49
|
+
const o2 = e2[n2].command, r2 = o2.shortcut();
|
|
50
|
+
if (Array.isArray(r2)) {
|
|
51
|
+
const e3 = r2;
|
|
52
|
+
for (let n3 = 0; n3 < e3.length; n3++) t2.push({ label: o2.label(), description: i2(o2.description()), shortcut: e3[n3] });
|
|
53
|
+
} else t2.push({ label: o2.label(), description: i2(o2.description()), shortcut: o2.shortcut() });
|
|
55
54
|
}
|
|
56
55
|
return t2;
|
|
57
|
-
}, [
|
|
58
|
-
|
|
56
|
+
}, [u2, c2]), [v2, $2] = f(null);
|
|
57
|
+
b(() => {
|
|
59
58
|
import("fuse.js").then((e2) => {
|
|
60
59
|
$2(new e2.default(k2, { threshold: 0, ignoreLocation: true, keys: ["label", "description"] }));
|
|
61
60
|
});
|
|
62
61
|
}, [k2]);
|
|
63
|
-
const [
|
|
64
|
-
|
|
62
|
+
const [K2, I2] = f(k2), z2 = w2.length > 0 && 0 === K2.length;
|
|
63
|
+
b(() => {
|
|
65
64
|
v2 && D.debounce(() => {
|
|
66
|
-
if (0 ===
|
|
67
|
-
const e2 = v2.search(
|
|
65
|
+
if (0 === w2.trim().length) return void I2(k2);
|
|
66
|
+
const e2 = v2.search(w2.trim()), t2 = new Array(e2.length);
|
|
68
67
|
for (let i2 = 0; i2 < e2.length; i2++) t2[i2] = e2[i2].item;
|
|
69
|
-
|
|
68
|
+
I2(t2);
|
|
70
69
|
}, 90)();
|
|
71
|
-
}, [v2,
|
|
72
|
-
return e(i, { style: { height: 440, width: "100%", display: "flex", flexDirection: "column" }, ...
|
|
70
|
+
}, [v2, w2]);
|
|
71
|
+
return e(i, { style: { height: 440, width: "100%", display: "flex", flexDirection: "column" }, ...m2, children: [e(i, { sx: { display: "flex", alignItems: "center", justifyContent: "end", marginBottom: (e2) => e2.spacing(2), color: (e2) => e2.palette.text.secondary }, children: [t(n, { InputProps: { sx: { backgroundImage: `linear-gradient(${y("#fff", C(5))}, ${y("#fff", C(5))})` }, inputProps: { className: "input", autoFocus: true, spellCheck: false, placeholder: "Type to search key bindings", autoComplete: "off", sx: { paddingTop: (e2) => e2.spacing(1), paddingBottom: (e2) => e2.spacing(1) } }, endAdornment: t(o, { sx: { opacity: w2.length > 0 ? 1 : 0, display: w2.length > 0 ? "flex" : "none" }, position: "end", children: t(r, { "aria-label": "clear search", onClick: () => R2(""), edge: "end", children: t(p, { iconKey: "Close" }) }) }) }, sx: { flex: "1 1 40%", marginRight: (e2) => e2.spacing(1), "& .MuiOutlinedInput-notchedOutline": { borderColor: (e2) => z2 ? `${e2.palette.error.main} !important` : void 0 }, "& .MuiInputLabel-outlined": { color: (e2) => z2 ? `${e2.palette.error.main} !important` : void 0 } }, value: w2, onChange: (e2) => {
|
|
73
72
|
R2(e2.target.value);
|
|
74
73
|
}, onKeyDown: (e2) => {
|
|
75
|
-
e2.which === h.Escape &&
|
|
74
|
+
e2.which === h.Escape && w2.length > 0 && (R2(""), e2.stopPropagation(), e2.preventDefault());
|
|
76
75
|
}, onContextMenu: (e2) => {
|
|
77
76
|
e2.stopPropagation();
|
|
78
|
-
} }), t(l, { sx: { flex: "1 1 60%" }, control: t(a, { checked:
|
|
77
|
+
} }), t(l, { sx: { flex: "1 1 60%" }, control: t(a, { checked: u2, onChange: () => g2(!u2) }), label: "Show commands without key bindings", labelPlacement: "start" })] }), t(i, { sx: { flex: "1 1 100%", borderRadius: (e2) => `${e2.shape.borderRadius}px`, border: (e2) => `solid ${e2.palette.divider} 1px`, paddingRight: "1px", overflow: "hidden", "* .MuiTableCell-head": { background: (e2) => e2.palette.background.paper, backgroundImage: `linear-gradient(${y("#fff", C(5))}, ${y("#fff", C(5))})` } }, children: t(T, { rowCount: K2.length, rowGetter: (e2) => K2[e2.index], columns: [{ width: 180, label: "Command", dataKey: "label" }, { width: 260, label: "Key Binding", dataKey: "shortcut" }, { width: 240, label: "Description", dataKey: "description", widthLess: 440 }] }) }), t(i, { sx: { display: "flex", flexShrink: "0", paddingLeft: (e2) => e2.spacing(1), paddingTop: (e2) => e2.spacing(1), paddingRight: (e2) => e2.spacing(1), userSelect: "none", justifyContent: "flex-end" }, children: t(d, { noWrap: true, component: "div", sx: { color: (e2) => z2 ? e2.palette.error.main : e2.palette.text.secondary }, children: `${0 === K2.length ? "No" : K2.length} shortcut key${1 === K2.length ? "" : "s"}${w2.length > 0 ? " found" : ""}` }) })] });
|
|
79
78
|
}
|
|
80
79
|
const P = (e2) => {
|
|
81
|
-
const { title: i2 = "Shortcut Keys", commands: n2, sx:
|
|
82
|
-
return t(
|
|
80
|
+
const { title: i2 = "Shortcut Keys", commands: n2, sx: o2, ...r2 } = e2;
|
|
81
|
+
return t(u, { isModal: true, onKeyDown: (e3) => {
|
|
83
82
|
e3.keyCode === h.F1 && e3.preventDefault();
|
|
84
|
-
}, sx: { width: "780px", ...
|
|
83
|
+
}, sx: { width: "780px", ...o2 }, title: i2, autoFocusSel: ".input", ...r2, children: t(c, { dividers: true, children: t(_, { commands: n2, sx: { marginBottom: "8px" } }) }) });
|
|
85
84
|
};
|
|
86
85
|
export {
|
|
87
86
|
P as default
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.6
|
|
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,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.6
|
|
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,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.6
|
|
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.
|