@sheetxl/studio-mui 0.4.12 → 0.4.14
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/-zKDSjn55SCvCwk8.cjs +6 -0
- package/browser/cjs/AoLA7tfyPshG_mKt.cjs +6 -0
- package/browser/cjs/As7uhSEgY8VJ3I6f.cjs +90 -0
- package/browser/cjs/B1Eaz6PFZAmrWiyY.cjs +6 -0
- package/browser/cjs/B8ZfZXhvW4sSKKZs.cjs +42 -0
- package/browser/cjs/BAfNSJo7fktzFVJd.cjs +11 -0
- package/browser/cjs/BH0v7IIykugrFxaT.cjs +6 -0
- package/browser/cjs/BUwmvmcdC0xBQ97L.cjs +145 -0
- package/browser/cjs/BiBEmbWoJHdOB1li.cjs +12 -0
- package/browser/cjs/BkVtS9FZxWYNmrbU.cjs +6 -0
- package/browser/cjs/Bmifo5y7ZMJolUTY.cjs +15 -0
- package/browser/cjs/BpLu9-spCLcAFdwd.cjs +6 -0
- package/browser/cjs/BqOg0z4HGrbNaL1k.cjs +6 -0
- package/browser/cjs/C6Fk0jGWAOED60yf.cjs +161 -0
- package/browser/cjs/CRvxop0QcZL23Akb.cjs +6 -0
- package/browser/cjs/CS5USjyVh8DwPSri.cjs +7 -0
- package/browser/cjs/Chz3K3Qt8M2FNJwI.cjs +12 -0
- package/browser/cjs/D2gy3JDrJyGAMqsl.cjs +7 -0
- package/browser/cjs/DD8-ZSDUkRqk7l6y.cjs +11 -0
- package/browser/cjs/DNL88d5PGwk92LeD.cjs +6 -0
- package/browser/cjs/DTHMIHonHaHeJ0o1.cjs +18 -0
- package/browser/cjs/DZ8WTAzF6V2Tw1tW.cjs +6 -0
- package/browser/cjs/W7LR70ajtjR9Lmvl.cjs +6 -0
- package/browser/cjs/XGmQ2kUHM2qQkG1r.cjs +16 -0
- package/browser/cjs/d2jsgbPdf35xArnn.cjs +6 -0
- package/browser/cjs/index.cjs +4 -10
- package/browser/esm/4fzdzYhVH9eIXv-E.mjs +2410 -0
- package/browser/esm/B-rZWEIXFvB2W_mP.mjs +84 -0
- package/browser/esm/C4ORm_Up6Zxt92F_.mjs +1672 -0
- package/browser/esm/C5OCdRxcYIZViFzN.mjs +13391 -0
- package/browser/esm/C8po4rRYJ8127Rgb.mjs +44 -0
- package/browser/esm/CB7vnn7AtsGma4R6.mjs +3803 -0
- package/browser/esm/CBQZHZlKIiEz186r.mjs +2251 -0
- package/browser/esm/CCwOCTrf9Bira1-Y.mjs +424 -0
- package/browser/esm/CHovQU_R4AuKULmT.mjs +392 -0
- package/browser/esm/CIH3ADFJJmUiyA8p.mjs +864 -0
- package/browser/esm/CQiALmsycGGLFj1o.mjs +25 -0
- package/browser/esm/CS6uJp7phBvUmos6.mjs +1467 -0
- package/browser/esm/CSKgHJSTMvOEe2RH.mjs +19981 -0
- package/browser/esm/CYG1vk4AMMwqsul7.mjs +1366 -0
- package/browser/esm/ClmlhDf-0RC5GFV3.mjs +52 -0
- package/browser/esm/CmAnpd_SOxQuTQRL.mjs +1703 -0
- package/browser/esm/DWy4L2usallW0WdU.mjs +153 -0
- package/browser/esm/Dc1PmtvbeqsIQHq6.mjs +48 -0
- package/browser/esm/DgKsUQMTThBdEQds.mjs +59 -0
- package/browser/esm/Dk00kGaRJxiitO5-.mjs +23 -0
- package/browser/esm/FdSIHwC_mNRZpcgJ.mjs +43 -0
- package/browser/esm/Ks946bL2vmd4m743.mjs +52 -0
- package/browser/esm/TlZOl3Gt-d0Nc2a8.mjs +46 -0
- package/browser/esm/_FvE2-K7MOW_qWVS.mjs +1352 -0
- package/browser/esm/index.mjs +83 -8
- package/browser/esm/vgS9ixFRuZrPx6vq.mjs +640 -0
- package/licenses/dependencies.txt +134 -134
- package/node/esm/{B3M2CzPvK2oKOfg5.mjs → 762kbapO408ejsVC.mjs} +2 -2
- package/node/esm/{CryVonGjJnmo2dE_.mjs → B0gJGF9-J3L5yBEW.mjs} +5 -5
- package/node/esm/{CBGAl2mih9mHDt5w.mjs → BR9YJuwMP9nTMBE-.mjs} +1 -1
- package/node/esm/{D1xD8cOQDGcbjIlG.mjs → BTNBRzW8ZZbJY4GL.mjs} +1 -1
- package/node/esm/{C2P_M1JNT_WZZN3H.mjs → Bgtg4I8EL4M776SY.mjs} +8 -8
- package/node/esm/{DUfB1ollhqU-JIk5.mjs → Bi5br6yrYZqhLEiY.mjs} +4 -4
- package/node/esm/{M3UB6IrhVERZziiJ.mjs → CCygt4zw40-jO57G.mjs} +2 -2
- package/node/esm/{m8fyd2BoYkTOJlc1.mjs → CTpkd2r1aBS5d0yl.mjs} +1 -1
- package/node/esm/{kHsChOtl8GUkzj5Q.mjs → CY1qC_sXGD6av4yO.mjs} +2 -2
- package/node/esm/{Dx2vq1Hdt4pqmOF-.mjs → CZoMFCKJudiTl_Tf.mjs} +2 -2
- package/node/esm/{kIQFLB3nmEJdn_OT.mjs → CzWLA_IQgFbENkMq.mjs} +1 -1
- package/node/esm/{BJY8yNMmN_yyRtIG.mjs → D1GfRQ1jyFg-wmLD.mjs} +1 -1
- package/node/esm/{D1C8ifsmXsypL6pp.mjs → DC2dPUCWVgxEKzaS.mjs} +13 -13
- package/node/esm/{Bj8uU2shfkvN4LnE.mjs → DOUP6ynjlQE-UEJs.mjs} +6 -6
- package/node/esm/{BIRLX0-9t62Lqats.mjs → DUqIYzvmrCd67Dpx.mjs} +2 -2
- package/node/esm/{CVGxETc4rIE1gNAH.mjs → DWCxF-chq5dVi363.mjs} +38 -38
- package/node/esm/{Bt5y5wVaVAVjwHBl.mjs → DghPySv_2Ts78czJ.mjs} +1 -1
- package/node/esm/{PF5CCBvapZxEzc7k.mjs → DrujinnhlNDCosqb.mjs} +1 -1
- package/node/esm/DsD7O5j2cXyaECkB.mjs +313 -0
- package/node/esm/{wdtYNTNCynMMS4_P.mjs → VHY56h6xqQcPba6u.mjs} +1 -1
- package/node/esm/{h1y2hBFecTqRgUa-.mjs → dlEq3vDkIERtTn7Y.mjs} +25 -25
- package/node/esm/index.mjs +4999 -5264
- package/node/esm/{CKtVB9hMCfabQMxC.mjs → yB8OTWhDomxUy_SX.mjs} +2 -2
- package/node/esm/{bv_GA6NGCT0sJaXy.mjs → yP0whgIwVZApluLw.mjs} +2 -2
- package/package.json +8 -8
- package/types/index.d.ts +0 -11
- package/browser/cjs/B7qLzxylqOaybl3H.cjs +0 -7
- package/browser/cjs/BNGixOiIsu8jZlvn.cjs +0 -7
- package/browser/cjs/BUYxt7KgFkIIIMyc.cjs +0 -7
- package/browser/cjs/Bk6VhhWsnCRyBu2F.cjs +0 -7
- package/browser/cjs/BpiMMYip132x0r1O.cjs +0 -7
- package/browser/cjs/ByZ_Q-J7jgF7AoWR.cjs +0 -7
- package/browser/cjs/BzD7LV8VmFKLAJyW.cjs +0 -7
- package/browser/cjs/C6_zcNM0Efa11KEE.cjs +0 -7
- package/browser/cjs/C8Azx_ZaQa4WvAtR.cjs +0 -7
- package/browser/cjs/CITvaW7L_iZfIyAN.cjs +0 -7
- package/browser/cjs/CNDDYOoLCrGsUMYL.cjs +0 -7
- package/browser/cjs/CYbeY5OVZDqHGSOm.cjs +0 -7
- package/browser/cjs/C_SgucbRn-v9IkNO.cjs +0 -7
- package/browser/cjs/CeTd2nFbE5yFzf7T.cjs +0 -7
- package/browser/cjs/Cfe7IbPNI8-CgoDI.cjs +0 -7
- package/browser/cjs/Ctyk-ajkSsTDJuvY.cjs +0 -7
- package/browser/cjs/DBhTQLbjAtU-A1YA.cjs +0 -7
- package/browser/cjs/Dc2rbOjtcmSIm8D4.cjs +0 -7
- package/browser/cjs/DcsvUmoS8zGG5GB8.cjs +0 -7
- package/browser/cjs/DqAlQQIZIyF7HMib.cjs +0 -7
- package/browser/cjs/DuwawlAm4aRBNTBm.cjs +0 -7
- package/browser/cjs/Dx9UUJj-yeubDjm4.cjs +0 -7
- package/browser/cjs/IC19hB4Ntvw1158j.cjs +0 -7
- package/browser/cjs/reQ9miE5C5qMfbRJ.cjs +0 -7
- package/browser/esm/B1Ey4ZP8BHUzHW7G.mjs +0 -7
- package/browser/esm/B8dJHVZJta8QbNKG.mjs +0 -7
- package/browser/esm/BThbC01mtb7qq8_A.mjs +0 -7
- package/browser/esm/Bnt1M91BRyMvXrc4.mjs +0 -7
- package/browser/esm/BqN0SYrEO0RZQtv-.mjs +0 -7
- package/browser/esm/CHPXsEre3jry2-jF.mjs +0 -7
- package/browser/esm/CMCOU0nDlymDFS9l.mjs +0 -7
- package/browser/esm/Cc7y1nMDr5J8jWx-.mjs +0 -7
- package/browser/esm/CesL-3BNbMB1f_if.mjs +0 -7
- package/browser/esm/CfvNSnuQLa1SPbNL.mjs +0 -7
- package/browser/esm/CloqVDbJmTL4oFek.mjs +0 -7
- package/browser/esm/Cta0yn5UIrP2UoT4.mjs +0 -7
- package/browser/esm/CwRyQHiDoBLx5_1g.mjs +0 -7
- package/browser/esm/DI-ZGstUJFwkx4H6.mjs +0 -7
- package/browser/esm/DQTfmweCXjuIlITn.mjs +0 -7
- package/browser/esm/DUIfOO25d1fqtJzn.mjs +0 -7
- package/browser/esm/DhOXsRr8c7bDS1jM.mjs +0 -7
- package/browser/esm/JPwh2m5-pXkdPVzF.mjs +0 -7
- package/browser/esm/UkNAvQj0NVgeMpUl.mjs +0 -7
- package/browser/esm/ZUfck_LDsQb9gpvU.mjs +0 -7
- package/browser/esm/gHhqkr52cxXkga0T.mjs +0 -7
- package/browser/esm/obM68UOvA5HV7Lt1.mjs +0 -7
- package/browser/esm/x9MyDRdLE47dI9dF.mjs +0 -7
- package/browser/esm/yW9jxnamUqAhVQkJ.mjs +0 -7
|
@@ -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.14
|
|
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.
|
|
@@ -11,35 +11,35 @@ import { alpha as c, getOverlayAlpha as p } from "@mui/material/styles/index.js"
|
|
|
11
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 C } from "@mui/material";
|
|
12
12
|
import { ArrowBack as y, ArrowUpward as b, ArrowForward as T, ArrowDownward as v } from "@mui/icons-material";
|
|
13
13
|
import { ICell as k, IRange as R } from "@sheetxl/sdk";
|
|
14
|
-
import { P as E,
|
|
14
|
+
import { P as E, z as S, A as I, B as F, a as w, D, c as P, G as K, H as A, I as $, J as B, O as M, Q as j, d as L } from "./index.mjs";
|
|
15
15
|
const V = t((t2) => {
|
|
16
|
-
const { label: i2, value: r2, options: a2, onSelect: d2, tabIndex: u2 = 0, ...f2 } = t2, [m2, g2] = o(() =>
|
|
16
|
+
const { label: i2, value: r2, options: a2, onSelect: d2, tabIndex: u2 = 0, ...f2 } = t2, [m2, g2] = o(() => J(r2, a2));
|
|
17
17
|
l(() => {
|
|
18
|
-
g2(
|
|
18
|
+
g2(J(r2, a2));
|
|
19
19
|
}, [r2, a2]);
|
|
20
20
|
const y2 = E((e2) => {
|
|
21
21
|
g2(e2.target.value), d2?.(a2[e2.target.value]);
|
|
22
22
|
}, [d2, a2]), b2 = s(() => Object.keys(a2).map((n2) => e(x, { value: n2, children: n2 }, n2)), [a2]);
|
|
23
23
|
return n(h, { sx: { minWidth: 135 }, size: "small", children: [e(O, { children: i2 }), e(C, { inputProps: { tabIndex: u2 }, value: m2, label: i2, onChange: y2, sx: { backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, ...f2, children: b2 })] });
|
|
24
|
-
}),
|
|
25
|
-
delete
|
|
26
|
-
const G = { "By Rows": true, "By Columns": false },
|
|
24
|
+
}), H = { Workbook: "workbook", Sheet: "sheet" }, N = { enter: 140, exit: 140 }, W = { Formulas: k.Content.Formulas, Values: k.Content.Values, Notes: k.Content.Notes, Comments: k.Content.Comments }, z = { ...W };
|
|
25
|
+
delete z.Values;
|
|
26
|
+
const G = { "By Rows": true, "By Columns": false }, J = (e2, n2) => {
|
|
27
27
|
const t2 = Object.keys(n2);
|
|
28
28
|
for (let i2 = 0; i2 < t2.length; i2++) {
|
|
29
29
|
const o2 = t2[i2];
|
|
30
30
|
if (n2[o2] === e2) return o2;
|
|
31
31
|
}
|
|
32
|
-
},
|
|
33
|
-
const { replace: s2 = false, findText: x2, replaceText: h2, findOptions: O2, replaceOptions: C2, title:
|
|
32
|
+
}, Q = t((t2) => {
|
|
33
|
+
const { replace: s2 = false, findText: x2, replaceText: h2, findOptions: O2, replaceOptions: C2, title: J2, onHide: Q2, onFindOrReplace: U, ...X } = t2, q = i(null), Y = i(null), Z = i(null), _ = i(null), ee = i(null), ne = i(null), te = (e2, n2) => {
|
|
34
34
|
if (!n2) return;
|
|
35
35
|
n2.start(e2, { center: false }), setTimeout(() => n2.stop(e2), 180);
|
|
36
|
-
}, [ie, oe] = o(false), [le, re] = o(false), [se, ae] = o(s2), [ce, pe] = o(false), [de, ue] = o(false), [fe, me] = o({ findText: null, replaceText: null, replace: s2, replaceOptions: {}, findOptions: { matchCase: false, matchEntireCell: false, useRegex: false, orientation: R.Orientation.Row, fields: [k.Content.Formulas] }, scope:
|
|
37
|
-
if (!
|
|
36
|
+
}, [ie, oe] = o(false), [le, re] = o(false), [se, ae] = o(s2), [ce, pe] = o(false), [de, ue] = o(false), [fe, me] = o({ findText: null, replaceText: null, replace: s2, replaceOptions: {}, findOptions: { matchCase: false, matchEntireCell: false, useRegex: false, orientation: R.Orientation.Row, fields: [k.Content.Formulas] }, scope: H.Sheet }), ge = E(async (e2, n2, t3, i2) => {
|
|
37
|
+
if (!U) return;
|
|
38
38
|
const o2 = { ...fe };
|
|
39
39
|
o2.replaceOptions = { ...o2.replaceOptions }, o2.findOptions = { ...o2.findOptions }, o2.replaceOptions.maxCount = t3 ? void 0 : 1, o2.replace = n2, n2 && fe.findOptions.fields?.[0] === k.Content.Values && (o2.findOptions.fields = [k.Content.Formulas]), o2.findOptions.reverse = !e2;
|
|
40
|
-
const l2 = await
|
|
40
|
+
const l2 = await U({ autoFocus: i2, ...o2 });
|
|
41
41
|
pe(0 === l2);
|
|
42
|
-
}, [fe,
|
|
42
|
+
}, [fe, U]);
|
|
43
43
|
l(() => {
|
|
44
44
|
pe(false);
|
|
45
45
|
}, [fe, le, se]);
|
|
@@ -60,16 +60,16 @@ const G = { "By Rows": true, "By Columns": false }, U = (e2, n2) => {
|
|
|
60
60
|
}, [x2, h2, O2, C2]), l(() => {
|
|
61
61
|
se ? (fe.findOptions.fields[0], k.Content.Values) : oe(true);
|
|
62
62
|
}, [se]), l(() => {
|
|
63
|
-
if (ie &&
|
|
64
|
-
|
|
63
|
+
if (ie && q.current && fe.findText === q.current.value) return q.current === document.activeElement || q.current.contains(document.activeElement) ? (q.current?.select(), void oe(false)) : void q.current.addEventListener("focus", () => {
|
|
64
|
+
q.current?.select(), oe(false);
|
|
65
65
|
}, { once: true });
|
|
66
66
|
}, [ie, fe]);
|
|
67
67
|
const [Oe, { width: Ce }] = a();
|
|
68
|
-
return e(
|
|
68
|
+
return e(I, { ref: he, title: J2 ?? (se ? "Find & Replace" : "Find"), initialPosition: { y: "35" }, autoFocusSel: ".input", onHide: Q2, onFocus: () => ue(true), onBlur: () => {
|
|
69
69
|
ue(false), pe(false);
|
|
70
|
-
}, PaperProps: { elevation: de ? 3 : 1 }, ...
|
|
71
|
-
if ("h" === e2.key && e2.ctrlKey) ae(true),
|
|
72
|
-
else if ("f" === e2.key && e2.ctrlKey)
|
|
70
|
+
}, PaperProps: { elevation: de ? 3 : 1 }, ...X, children: n(d, { dividers: true, ref: Oe, 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) ae(true), q.current?.contains(document.activeElement) && Y.current?.focus();
|
|
72
|
+
else if ("f" === e2.key && e2.ctrlKey) q.current?.focus();
|
|
73
73
|
else if ("c" === e2.key && e2.altKey) me((e3) => {
|
|
74
74
|
const n2 = { ...e3 };
|
|
75
75
|
return n2.findOptions.matchCase = !e3.findOptions.matchCase, n2;
|
|
@@ -86,38 +86,38 @@ const G = { "By Rows": true, "By Columns": false }, U = (e2, n2) => {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
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(
|
|
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(F, { selected: le, onSelectToggle: (e2) => {
|
|
90
90
|
re(e2);
|
|
91
|
-
}, preventFocus: true, label: "Toggle Additional Options", icon: w(e(D, {})) }), e(
|
|
91
|
+
}, preventFocus: true, label: "Toggle Additional Options", icon: w(e(D, {})) }), e(F, { selected: se, onSelectToggle: (e2) => {
|
|
92
92
|
ae(e2);
|
|
93
|
-
}, preventFocus: true, label: "Toggle Replace", icon: w(e(K, {})), shortcut: { key: se ? "F" : "H", modifiers: [P.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: Ce > 460 ? "20em" : void 0, backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, inputProps: { draggable: false, ref:
|
|
93
|
+
}, preventFocus: true, label: "Toggle Replace", icon: w(e(K, {})), shortcut: { key: se ? "F" : "H", modifiers: [P.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: Ce > 460 ? "20em" : void 0, backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, inputProps: { draggable: false, ref: q, className: "input", autoFocus: true, spellCheck: false, autoComplete: "off", sx: { paddingTop: (e2) => e2.spacing(1.25), paddingBottom: (e2) => e2.spacing(0.75) } }, endAdornment: e(m, { sx: { transform: "scale(0.75) translateX(16px)" }, position: "end", children: n(u, { sx: { display: "flex", alignItems: "center", flexDirection: "row", gap: "1px" }, children: [e(F, { selected: fe.findOptions.matchCase, onSelectToggle: (e2) => {
|
|
94
94
|
me((n2) => {
|
|
95
95
|
const t3 = { ...n2 };
|
|
96
96
|
return t3.findOptions.matchCase = e2, t3;
|
|
97
97
|
});
|
|
98
|
-
}, label: "Match Case", shortcut: { key: "C", modifiers: [P.Alt] }, icon: w(e(
|
|
98
|
+
}, label: "Match Case", shortcut: { key: "C", modifiers: [P.Alt] }, icon: w(e(A, {})) }), e(F, { selected: fe.findOptions.matchEntireCell, onSelectToggle: (e2) => {
|
|
99
99
|
me((n2) => {
|
|
100
100
|
const t3 = { ...n2 };
|
|
101
101
|
return t3.findOptions.matchEntireCell = e2, t3;
|
|
102
102
|
});
|
|
103
|
-
}, label: "Match Entire Cell", shortcut: { key: "E", modifiers: [P.Alt] }, icon: w(e(
|
|
103
|
+
}, label: "Match Entire Cell", shortcut: { key: "E", modifiers: [P.Alt] }, icon: w(e($, {})) }), e(F, { selected: fe.findOptions.useRegex, onSelectToggle: (e2) => {
|
|
104
104
|
me((n2) => {
|
|
105
105
|
const t3 = { ...n2 };
|
|
106
106
|
return t3.findOptions.useRegex = e2, t3;
|
|
107
107
|
});
|
|
108
|
-
}, label: "Use Regular Expression", shortcut: { key: "R", modifiers: [P.Alt] }, icon: w(e(
|
|
108
|
+
}, label: "Use Regular Expression", shortcut: { key: "R", modifiers: [P.Alt] }, icon: w(e(B, {})) })] }) }) }, sx: { flex: "1 1 100%", marginRight: (e2) => e2.spacing(1), "& .MuiOutlinedInput-notchedOutline": { borderColor: (e2) => ce ? `${e2.palette.error.main} !important` : void 0 }, "& .MuiInputLabel-outlined": { color: (e2) => ce ? `${e2.palette.error.main} !important` : void 0 } }, value: fe.findText ?? "", onChange: (e2) => {
|
|
109
109
|
me((n2) => {
|
|
110
110
|
const t3 = { ...n2 };
|
|
111
111
|
return t3.findText = e2.target.value, t3;
|
|
112
112
|
});
|
|
113
113
|
}, onKeyDown: (e2) => xe(e2, false), onContextMenu: (e2) => {
|
|
114
114
|
e2.stopPropagation();
|
|
115
|
-
} }), e(
|
|
115
|
+
} }), e(F, { selected: fe.findOptions.reverse, onSelectToggle: (e2) => {
|
|
116
116
|
ge(false, false);
|
|
117
|
-
}, touchRippleRef: Z, label: "", shortcut: { key: "Enter", modifiers: [P.Shift] }, icon: w(fe.findOptions.orientation !== R.Orientation.Column ? e(y, {}) : e(b, {})), disabled: !fe.findText }), e(
|
|
117
|
+
}, touchRippleRef: Z, label: "", shortcut: { key: "Enter", modifiers: [P.Shift] }, icon: w(fe.findOptions.orientation !== R.Orientation.Column ? e(y, {}) : e(b, {})), disabled: !fe.findText }), e(F, { selected: !fe.findOptions.reverse, onSelectToggle: (e2) => {
|
|
118
118
|
ge(true, false);
|
|
119
|
-
}, touchRippleRef: _, label: "Next Match", shortcut: { key: "Enter" }, icon: w(fe.findOptions.orientation !== R.Orientation.Column ? e(T, {}) : e(v, {})), disabled: !fe.findText })] }), e(g, { in: se, timeout:
|
|
120
|
-
|
|
119
|
+
}, touchRippleRef: _, label: "Next Match", shortcut: { key: "Enter" }, icon: w(fe.findOptions.orientation !== R.Orientation.Column ? e(T, {}) : e(v, {})), disabled: !fe.findText })] }), e(g, { in: se, timeout: N, onExit: () => {
|
|
120
|
+
q.current?.focus();
|
|
121
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: Y, 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: fe.replaceText ?? "", onChange: (e2) => {
|
|
122
122
|
me((n2) => {
|
|
123
123
|
const t3 = { ...n2 };
|
|
@@ -125,13 +125,13 @@ const G = { "By Rows": true, "By Columns": false }, U = (e2, n2) => {
|
|
|
125
125
|
});
|
|
126
126
|
}, onKeyDown: (e2) => xe(e2, true), onContextMenu: (e2) => {
|
|
127
127
|
e2.stopPropagation();
|
|
128
|
-
} }), e(
|
|
128
|
+
} }), e(F, { onSelectToggle: (e2) => {
|
|
129
129
|
ge(true, true);
|
|
130
|
-
}, touchRippleRef: ee, label: "Replace", shortcut: { key: "Enter" }, icon: w(e(
|
|
130
|
+
}, touchRippleRef: ee, label: "Replace", shortcut: { key: "Enter" }, icon: w(e(M, {})), disabled: !fe.findText }), e(F, { onSelectToggle: (e2) => {
|
|
131
131
|
ge(true, true, true);
|
|
132
|
-
}, touchRippleRef: ne, label: "Replace All", shortcut: { key: "Enter", modifiers: [P.Ctrl, P.Alt] }, icon: w(e(
|
|
133
|
-
|
|
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(L, { orientation: "horizontal", sx: { marginBottom: (e2) => e2.spacing(1.5) } }), n(u, { sx: { display: "flex", flexDirection: Ce >= 413 ? "row" : "column", justifyContent: "space-evenly", alignItems: "center", rowGap: (e2) => e2.spacing(2) }, tabIndex: -1, children: [e(V, { label: "Within", value: fe.scope, options:
|
|
132
|
+
}, touchRippleRef: ne, label: "Replace All", shortcut: { key: "Enter", modifiers: [P.Ctrl, P.Alt] }, icon: w(e(j, {})), disabled: !fe.findText })] }) })] })] }), e(g, { in: le, timeout: N, onExit: () => {
|
|
133
|
+
q.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(L, { orientation: "horizontal", sx: { marginBottom: (e2) => e2.spacing(1.5) } }), n(u, { sx: { display: "flex", flexDirection: Ce >= 413 ? "row" : "column", justifyContent: "space-evenly", alignItems: "center", rowGap: (e2) => e2.spacing(2) }, tabIndex: -1, children: [e(V, { label: "Within", value: fe.scope, options: H, onSelect: (e2) => {
|
|
135
135
|
me((n2) => {
|
|
136
136
|
const t3 = { ...n2 };
|
|
137
137
|
return t3.scope = e2, t3;
|
|
@@ -141,7 +141,7 @@ const G = { "By Rows": true, "By Columns": false }, U = (e2, n2) => {
|
|
|
141
141
|
const t3 = { ...n2 };
|
|
142
142
|
return t3.findOptions.orientation = e2 ? R.Orientation.Row : R.Orientation.Column, t3;
|
|
143
143
|
});
|
|
144
|
-
} }), e(V, { label: "Look in", value: se && fe.findOptions.fields?.[0] === k.Content.Values ? k.Content.Formulas : fe.findOptions.fields?.[0], options: se ?
|
|
144
|
+
} }), e(V, { label: "Look in", value: se && fe.findOptions.fields?.[0] === k.Content.Values ? k.Content.Formulas : fe.findOptions.fields?.[0], options: se ? z : W, onSelect: (e2) => {
|
|
145
145
|
me((n2) => {
|
|
146
146
|
const t3 = { ...n2 };
|
|
147
147
|
return t3.findOptions.fields = [e2], t3;
|
|
@@ -149,7 +149,7 @@ const G = { "By Rows": true, "By Columns": false }, U = (e2, n2) => {
|
|
|
149
149
|
} })] })] }) })] }) });
|
|
150
150
|
});
|
|
151
151
|
export {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
Q as FindReplaceWindow,
|
|
153
|
+
H as ScopeOptions,
|
|
154
|
+
Q as default
|
|
155
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.14
|
|
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.4.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.14
|
|
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.
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.14
|
|
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 o, Fragment as t } from "react/jsx-runtime";
|
|
8
|
+
import n, { forwardRef as r, useState as a, useCallback as s, isValidElement as i, memo as l, createElement as c, useMemo as d, useRef as p, useEffect as m, useLayoutEffect as k } from "react";
|
|
9
|
+
import u from "clsx";
|
|
10
|
+
import { mergeRefs as h } from "react-merge-refs";
|
|
11
|
+
import { ErrorBoundary as b } from "react-error-boundary";
|
|
12
|
+
import { useSnackbar as g, SnackbarContent as w, SnackbarProvider as f } from "notistack";
|
|
13
|
+
import { useTheme as y, ThemeProvider as x } from "@mui/material/styles/index.js";
|
|
14
|
+
import { Card as C, CardActions as D, Typography as W, IconButton as E, Collapse as v, Box as S, SvgIcon as M, CssBaseline as T } from "@mui/material";
|
|
15
|
+
import { PartialError as L, CommonUtils as O, UndoManager as F, Workbook as I } from "@sheetxl/sdk";
|
|
16
|
+
import { _ as P, P as A, E as j, a as N, t as R, j as _, d as U, F as H, T as K, WorkbookIO as $, U as G, b as z, N as q, W as V, k as B, K as X, r as J, l as Y, V as Z, AppearanceCommandButton as Q, e as ee, Y as oe, c as te, X as ne, f as re, g as ae, useResolvedThemeMode as se, ThemeMode as ie, u as le, h as ce, i as de, L as pe, m as me, y as ke, HelpCommandButton as ue, o as he, n as be, $ as ge, p as we, WorkbookTitle as fe, WorkbookElement as ye, M as xe, s as Ce } from "./index.mjs";
|
|
17
|
+
import { useMeasure as De } from "react-use";
|
|
18
|
+
import { ExpandMore as We, Close as Ee, CancelOutlined as ve } from "@mui/icons-material";
|
|
19
|
+
const Se = { card: "_card_1a398_7", actionRoot: "_actionRoot_1a398_11", icons: "_icons_1a398_16", expand: "_expand_1a398_22", expandOpen: "_expandOpen_1a398_29", stackTraceContainer: "_stackTraceContainer_1a398_33" }, Me = r((t2, n2) => {
|
|
20
|
+
const { id: r2, message: l2, iconVariant: c2, error: d2, hideIconVariant: p2, ...m2 } = t2, { closeSnackbar: k2 } = g(), h2 = y(), [b2, f2] = a(false), x2 = s(() => {
|
|
21
|
+
f2((e2) => !e2);
|
|
22
|
+
}, []), S2 = s(() => {
|
|
23
|
+
k2(r2);
|
|
24
|
+
}, [r2, k2]);
|
|
25
|
+
let M2 = d2?.message;
|
|
26
|
+
return !M2 && i(l2) && (M2 = l2), M2 || "string" != typeof l2 || (M2 = l2), M2 || (M2 = `Unknown Error: ${l2}`), e(w, { ref: n2, className: u(Se.root, "error-snackbar"), children: o(C, { className: Se.card, style: { backgroundColor: h2.palette.error.dark, border: `1px solid ${h2.palette.error.dark}` }, children: [o(D, { className: Se.actionRoot, children: [p2 ? null : c2?.error, e(W, { variant: "body2", component: "div", className: Se.typography, style: { color: h2.palette.text.primary }, children: M2 }), e("div", { style: { flex: "1 1 auto" } }), o("div", { className: Se.icons, children: [d2 ? e(E, { "aria-label": "Show more", size: "small", className: u(Se.expand, { [Se.expandOpen]: b2 }), style: { color: h2.palette.action.active }, onClick: x2, children: e(We, {}) }) : null, e(E, { size: "small", className: Se.expand, style: { color: h2.palette.action.active }, onClick: S2, children: e(Ee, { fontSize: "small" }) })] })] }), d2 ? e(v, { in: b2, timeout: "auto", unmountOnExit: true, children: e("div", { className: Se.stackTraceContainer, style: { backgroundColor: h2.palette.error.light, borderTop: `1px solid ${h2.palette.error.main}` }, children: e(P, { error: d2, hideLineNumbers: true }) }) }) : null] }) });
|
|
27
|
+
});
|
|
28
|
+
Me.displayName = "ToastError";
|
|
29
|
+
const Te = l(r((n2, r2) => {
|
|
30
|
+
const { commands: a2, commandHook: s2, scope: i2 = "workbook", disabled: l2 = false, ...d2 } = n2, p2 = A((n3) => {
|
|
31
|
+
const r3 = { variant: R.Menuitem, parentFloat: n3.floatReference, commandHook: s2, scope: i2, disabled: l2 }, d3 = o(t, { children: [e(j, { ...r3, command: a2.getCommand("newWorkbook"), icon: N(e(_, {})) }), e(U, { orientation: "horizontal" }), e(j, { ...r3, command: a2.getCommand("openWorkbook"), icon: N(e(H, {})) }), e(K, { ...r3, commands: a2, quickCommand: "saveWorkbook", icon: N(e(V, {})), createPopupPanel: (o2) => {
|
|
32
|
+
const t2 = { ...r3, parentFloat: o2.floatReference, scope: "saveWorkbook" }, n4 = [];
|
|
33
|
+
return $.getWriteFormats().forEach((o3) => {
|
|
34
|
+
if (o3.isDefault) return;
|
|
35
|
+
let r4 = null;
|
|
36
|
+
"CSV" === o3.key ? r4 = N(e(G, {})) : "Excel" === o3.key && (r4 = N(e(z, {})));
|
|
37
|
+
const s3 = a2.getCommand(`saveWorkbookAs${o3.key}`);
|
|
38
|
+
s3 ? n4.push(c(j, { ...t2, key: o3.key, command: s3, icon: r4 })) : console.warn(`Unable to resolve command: 'saveWorkbookAs${o3.key}'`);
|
|
39
|
+
}), q({ ...o2, children: n4, onClick: () => {
|
|
40
|
+
o2.closeFloatAll();
|
|
41
|
+
} });
|
|
42
|
+
} })] });
|
|
43
|
+
return q({ ...n3, children: d3, onClick: (e2) => {
|
|
44
|
+
e2.isDefaultPrevented || n3.closeFloatAll();
|
|
45
|
+
} });
|
|
46
|
+
}, [l2, a2, s2, i2]), m2 = "File";
|
|
47
|
+
return e(K, { commands: a2, disabled: l2, commandHook: s2, scope: i2, label: m2, tooltip: "Options for saving and loading the workbook.", sx: { paddingBottom: "0px", "& button": { paddingTop: "0px", paddingBottom: "0px", height: (e2) => `calc(1.25rem + ${e2.spacing(2)}px)` } }, ...d2, createPopupPanel: p2, icon: e(B, { className: "label", icon: null, label: m2 }) });
|
|
48
|
+
}));
|
|
49
|
+
Te.displayName = "StandaloneFileCommandButton";
|
|
50
|
+
const Le = e(Y, { label: "SheetXL", description: "Visit me at sheetxl.com.", children: e(S, { sx: { width: "24px", height: "24px", marginBottom: "4px", marginLeft: "6px" }, children: e(Z, { onClick: () => {
|
|
51
|
+
window?.open("https://www.sheetxl.com", "_blank");
|
|
52
|
+
}, style: { width: "24px", height: "24px", cursor: "pointer" } }) }) }), Oe = l(r((t2, n2) => {
|
|
53
|
+
const { commands: r2, workbook: a2, logo: s2 = Le, mainElement: i2, showFileMenu: l2 = true, showAppearanceMenu: c2 = true, ...m2 } = t2, { reference: k2 } = X(), [u2, { width: b2 }] = De(), g2 = b2 < 530, w2 = l2 ? e(Te, { commands: r2, commandHook: { beforeExecute() {
|
|
54
|
+
k2?.closeAll();
|
|
55
|
+
}, onError(e2, o2, t3) {
|
|
56
|
+
} } }) : null, f2 = c2 ? e(Q, { commands: r2, commandHook: { beforeExecute() {
|
|
57
|
+
k2?.closeAll();
|
|
58
|
+
}, onError(e2, o2, t3) {
|
|
59
|
+
} } }) : null, y2 = d(() => ({ paddingLeft: (e2) => e2.spacing(1), paddingRight: (e2) => e2.spacing(1) }), []), x2 = p(null);
|
|
60
|
+
return e(S, { ref: h([x2, u2, n2]), ...m2, children: J({ commands: r2, renderCompact: g2, workbook: a2, selectWrapper: (t3) => o(S, { sx: { display: "flex", flex: "1", flexDirection: "row", alignItems: "stretch", gap: (e2) => e2.spacing(1), paddingLeft: (e2) => e2.spacing(1), paddingRight: (e2) => e2.spacing(1) }, children: [o(S, { sx: { display: "flex", flexDirection: "row", alignItems: "center", flex: "1 1 100%", gap: (e2) => e2.spacing(0.5) }, children: [s2, o(S, { sx: { display: "flex", flexDirection: "row", alignItems: "center", gap: (e2) => e2.spacing(0.25) }, children: [w2, t3] })] }), e(S, { sx: { display: "flex", flexDirection: "row", flex: "1 1 300%", overflow: "hidden", alignItems: "center", justifyContent: "center" }, children: i2 }), e(S, { sx: { display: "flex", alignItems: "center", justifyContent: "end", flex: g2 && !f2 ? "0 0 auto" : "1 1 100%" }, children: f2 })] }), selectProps: y2, toolbarsProps: { Home: { sx: {} } } }) });
|
|
61
|
+
}));
|
|
62
|
+
Oe.displayName = "StudioToolbar";
|
|
63
|
+
const Fe = l(r((r2, i2) => {
|
|
64
|
+
const { workbook: l2, setWorkbook: c2, refWorkbookTitle: k2, titleWorkbook: u2, setWorkbookTitle: h2, titlePlaceHolder: b2, children: w2, undoManager: f2, commands: y2, importExportDisabled: x2, themeOptions: C2 } = r2, D2 = g(), W2 = D2 ? D2.enqueueSnackbar : () => {
|
|
65
|
+
}, v2 = D2 ? D2.closeSnackbar : () => {
|
|
66
|
+
}, [S2, M2] = a({ isMounted: false, label: null, starting: /* @__PURE__ */ new Map(), running: /* @__PURE__ */ new Map() }), T2 = s(() => {
|
|
67
|
+
M2((e2) => ({ ...e2, isMounted: true }));
|
|
68
|
+
}, []), O2 = s(() => {
|
|
69
|
+
M2((e2) => ({ ...e2, isMounted: false }));
|
|
70
|
+
}, []), F2 = ce(), I2 = de(), P2 = pe(), j2 = p(/* @__PURE__ */ new Set()), N2 = d(() => {
|
|
71
|
+
const o2 = (o3, t2) => {
|
|
72
|
+
if (t2?.onceKey) {
|
|
73
|
+
if (j2.current.has(t2.onceKey)) return;
|
|
74
|
+
const e2 = new Set(j2.current);
|
|
75
|
+
e2.add(t2.onceKey), j2.current = e2;
|
|
76
|
+
}
|
|
77
|
+
const n2 = { variant: t2?.type ?? he.Info, anchorOrigin: { vertical: "top", horizontal: "center" }, preventDuplicate: t2?.preventDuplicate, persist: t2?.persist ?? t2?.type === he.Error, action: (o4) => e(E, { onClick: () => v2(o4), children: e(ve, {}) }) };
|
|
78
|
+
t2?.enqueueProps && Object.assign(n2, t2.enqueueProps), o3 || console.log("message is 'null'", t2), W2(o3 ?? "Alert", n2);
|
|
79
|
+
};
|
|
80
|
+
return { showMessage: o2, showBusy: (e2, o3) => {
|
|
81
|
+
let t2 = null;
|
|
82
|
+
const n2 = new Promise((e3) => {
|
|
83
|
+
t2 = e3;
|
|
84
|
+
});
|
|
85
|
+
return M2((o4) => {
|
|
86
|
+
const r3 = new Map(o4.starting);
|
|
87
|
+
r3.set(n2, t2);
|
|
88
|
+
return { ...o4, label: e2, starting: r3 };
|
|
89
|
+
}), n2;
|
|
90
|
+
}, showWindow: (e2, o3, t2) => {
|
|
91
|
+
const n2 = { ...o3, onKeyDown: (e3) => {
|
|
92
|
+
y2?.dispatchToFocusedCommand(e3), e3.isDefaultPrevented() || e3.isPropagationStopped() || o3?.onKeyDown?.(e3);
|
|
93
|
+
} };
|
|
94
|
+
return F2(e2, { sort: () => import("./CCygt4zw40-jO57G.mjs"), numberFormat: () => import("./Bi5br6yrYZqhLEiY.mjs"), hyperlink: () => import("./yP0whgIwVZApluLw.mjs"), comments: () => import("./DUqIYzvmrCd67Dpx.mjs"), find: () => import("./DWCxF-chq5dVi363.mjs"), tableDetails: () => import("./dlEq3vDkIERtTn7Y.mjs"), tableNew: () => import("./DOUP6ynjlQE-UEJs.mjs"), namedDetails: () => import("./CZoMFCKJudiTl_Tf.mjs") }[e2], n2, t2);
|
|
95
|
+
}, showOptions: I2, showInputOptions: P2, showError: (e2) => {
|
|
96
|
+
let t2, n2 = he.Error, r3 = "Unknown Error";
|
|
97
|
+
"string" == typeof e2 ? r3 = e2 : e2 instanceof Error && (t2 = e2, e2.message && (r3 = e2.message)), e2 instanceof L && (n2 = he.Info), o2(r3, { type: n2, enqueueProps: { error: t2 } });
|
|
98
|
+
} };
|
|
99
|
+
}, []), R2 = s(() => {
|
|
100
|
+
}, []), _2 = ((e2) => {
|
|
101
|
+
const { workbook: o2, setWorkbook: t2, importExportDisabled: r3, workbookTitle: a2 = "export", setWorkbookTitle: i3, notifier: l3, requestWorkbookTitle: c3, themeOptions: p2, undoManager: k3, commands: u3, onExecute: h3 } = e2, b3 = A(p2?.onModeChange, [p2?.onModeChange]), g2 = A(p2?.onEnabledDarkGridChange, [p2?.onEnabledDarkGridChange]), w3 = A(p2?.onEnabledDarkImagesChange, [p2?.onEnabledDarkImagesChange]), f3 = A(async (e3 = null, o3 = null) => {
|
|
102
|
+
const t3 = [];
|
|
103
|
+
let n2, r4 = null, a3 = null;
|
|
104
|
+
if ("string" == typeof e3 ? a3 = e3 : r4 = e3, n2 = r4 ? e3 : await ee.openFileDialog(a3 ?? $.getAllReadFormatTypeAsString().join(",")), !n2) return null;
|
|
105
|
+
const s2 = { source: n2, createWorkbookOptions: o3, onWarning: (e4) => {
|
|
106
|
+
t3.push(e4);
|
|
107
|
+
} }, i4 = await $.read(s2, l3);
|
|
108
|
+
return t3.length > 0 && (l3?.showMessage?.("Some elements were not able to be imported. See console for details."), console.warn("Import warnings:\n" + t3.join("\n"))), i4;
|
|
109
|
+
}, [h3, l3, o2]), y3 = A(async (e3, o3, t3) => {
|
|
110
|
+
if (!o3 && c3) {
|
|
111
|
+
const o4 = await c3("Enter Workbook name to " + (t3.isDefault ? "Save." : `Export as ${t3.description}.`));
|
|
112
|
+
return null !== o4 && $.writeFile(o4, e3, { formatType: t3.key });
|
|
113
|
+
}
|
|
114
|
+
return $.writeFile(o3, e3, { formatType: t3.key });
|
|
115
|
+
}, [l3, o2, c3]), x3 = s(() => ({ contains: (e3) => true, focus() {
|
|
116
|
+
} }), []), C3 = d(() => {
|
|
117
|
+
const e3 = [];
|
|
118
|
+
r3 || ($.getWriteFormats().forEach((t3) => {
|
|
119
|
+
const n3 = t3.isDefault, r4 = { label: n3 ? "Save Workbook" : `Save Workbook as ${t3.description}`, scopedLabels: { workbook: "Save", saveWorkbook: `as ${t3.description}` }, tags: t3.tags, description: `Save the workbook to the desktop${n3 ? "" : ` as ${t3.description}`}.` };
|
|
120
|
+
n3 && (r4.shortcut = { key: "S", modifiers: [te.Ctrl] }, e3.push(new oe("saveWorkbookAs", x3, { label: "Save Workbook As…", scopedLabels: { workbook: "Save as…", saveWorkbook: "as…" }, shortcut: [{ key: "S", modifiers: [te.Shift, te.Ctrl] }, { key: "F12" }], description: "Save the workbook to the desktop with the provided name." }, () => {
|
|
121
|
+
y3(o2, null, t3).catch((e4) => {
|
|
122
|
+
l3?.showError?.(e4);
|
|
123
|
+
});
|
|
124
|
+
})));
|
|
125
|
+
const s2 = n3 ? "saveWorkbook" : `saveWorkbookAs${t3.key}`;
|
|
126
|
+
e3.push(new oe(s2, x3, r4, (e4) => {
|
|
127
|
+
y3(o2, e4 ?? a2, t3).catch((e5) => {
|
|
128
|
+
l3?.showError?.(e5);
|
|
129
|
+
});
|
|
130
|
+
}));
|
|
131
|
+
}), e3.push(new oe("openWorkbook", x3, { label: "Open Workbook…", scopedLabels: { workbook: "Open…" }, description: "Open a workbook from the desktop.", shortcut: { key: "O", modifiers: [te.Ctrl] } }, async (e4 = null) => {
|
|
132
|
+
const n3 = { date1904: o2.isDate1904(), ...o2.options };
|
|
133
|
+
try {
|
|
134
|
+
const r4 = await f3(e4, n3);
|
|
135
|
+
if (!r4) return;
|
|
136
|
+
const a3 = r4.title, s2 = r4.workbook, c4 = s2.getSelectedSheet();
|
|
137
|
+
if ("text/csv" === r4.formatType.mimeType) {
|
|
138
|
+
const e5 = o2.findValidSheetName(a3);
|
|
139
|
+
await o2.doBatch(async () => {
|
|
140
|
+
const t3 = c4.getUsedRange();
|
|
141
|
+
if (!t3) return void l3?.showMessage("The file appears to be blank.");
|
|
142
|
+
const n4 = o2.getSheets().add({ name: e5, autoSelect: true }).getRange({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 });
|
|
143
|
+
await n4.copyFrom(t3);
|
|
144
|
+
}, `Import CSV '${a3}'`);
|
|
145
|
+
} else o2?.close(), i3?.(a3), t2(s2);
|
|
146
|
+
} catch (e5) {
|
|
147
|
+
l3?.showError?.(e5);
|
|
148
|
+
}
|
|
149
|
+
})), e3.push(new oe("openWorkbookFromUrl", x3, { label: "Open Workbook From Web", scopedLabels: { insert: "From Web", workbook: "From Web…" }, description: "Open a workbook from the web." }, async function(e4) {
|
|
150
|
+
if (!e4) {
|
|
151
|
+
const o3 = await l3?.showInputOptions?.({ title: "Open Workbook from the Web", description: "Enter the web address for the workbook to open.", inputLabel: "Address", initialValue: "https://www.sheetxl.com/examples/features-checklist.xlsx", inputProps: { style: { minWidth: "440px" } }, options: ["Open"] });
|
|
152
|
+
if ("Open" !== o3.option) return;
|
|
153
|
+
e4 = o3.input;
|
|
154
|
+
}
|
|
155
|
+
e4 && console.log("openWorkbookFromUrl", e4);
|
|
156
|
+
})));
|
|
157
|
+
let n2 = [];
|
|
158
|
+
return p2 && (n2 = [new oe("themeMode", x3, { label: "Light/Dark Mode", scopedLabels: { appearance: "Light/Dark Mode" }, description: "Toggle the application styling between light and dark mode." }), new oe("defaultThemeMode", x3, { label: "Use System Light/Dark Mode", scopedLabels: { appearance: "Use System Default" }, description: "Use the system settings to determine styling for light and dark mode." }), new oe("enableDarkGrid", x3, { label: "Enable Dark Grid", description: "Allow the grid to render in dark mode if dark mode is being used. This is ensures that the grid will render the colors as specified in another tools (for example Excel)." }), new oe("enableDarkImages", x3, { label: "Enable Dark Images", description: "Allow the images to render in dark mode if dark mode is being used. This is ensures that the images will render the colors as specified in another tools (for example Excel). This only has any effect if the grid is in dark mode." })]), [...e3, ...n2, new ne("help", x3, { label: "Show Help", description: "Provide Help.", shortcut: { key: "F1" } }, () => {
|
|
159
|
+
}), new ne("showKeyboardShortcuts", x3, { label: "Keyboard Shortcuts", description: "Show keyboard shortcuts.", shortcut: { key: "/", modifiers: [te.Ctrl] } }, () => {
|
|
160
|
+
}), new oe("gotoUrlGithub", x3, { label: "Github", description: "Download examples, explore source code, and leave a star." }, () => {
|
|
161
|
+
window?.open("https://github.com/sheetxl/sheetxl");
|
|
162
|
+
}), new oe("gotoUrlDiscord", x3, { label: "Discord", description: "Join our community on discord." }, () => {
|
|
163
|
+
window?.open("https://discord.gg/NTKdwUgK9p");
|
|
164
|
+
}), new oe("gotoUrlDocumentation", x3, { label: "Documentation", description: "Read the documentation." }, () => {
|
|
165
|
+
window?.open("https://www.sheetxl.com/docs");
|
|
166
|
+
}), new oe("gotoUrlIssue", x3, { label: "Create Issue", description: "Create an issue to identify a bug or a feature request." }, () => {
|
|
167
|
+
window?.open("https://github.com/sheetxl/sheetxl/issues");
|
|
168
|
+
})];
|
|
169
|
+
}, [o2, a2, l3, r3, p2, u3, k3]), D3 = d(() => {
|
|
170
|
+
let e3 = null;
|
|
171
|
+
return e3 = u3 ? u3.createChildGroup(x3, "standaloneWorkbook", false) : new re(x3, "standaloneWorkbook"), e3.addCommands(C3, true), e3;
|
|
172
|
+
}, [u3, C3]);
|
|
173
|
+
ae({ manager: k3, commands: D3, notifier: l3 });
|
|
174
|
+
const { themeMode: W3 } = se();
|
|
175
|
+
m(() => {
|
|
176
|
+
if (!p2 || !D3) return;
|
|
177
|
+
const e3 = "dark" === p2.mode || !p2.mode && "dark" === W3;
|
|
178
|
+
D3.getCommand("themeMode").update({ state: p2.mode ?? null, label: e3 ? "Dark Mode" : "Light Mode", scopedLabels: { appearance: e3 ? "Dark Mode" : "Light Mode" } }).updateCallback(() => {
|
|
179
|
+
b3(e3 ? ie.Light : ie.Dark);
|
|
180
|
+
}), D3.getCommand("defaultThemeMode").update({ state: !p2.mode }).updateCallback(() => {
|
|
181
|
+
b3(null);
|
|
182
|
+
}), D3.getCommand("enableDarkGrid").update({ state: p2.enableDarkGrid }).updateCallback(() => {
|
|
183
|
+
g2(!p2.enableDarkGrid);
|
|
184
|
+
}), D3.getCommand("enableDarkImages").update({ state: p2.enableDarkImages }).updateCallback(() => {
|
|
185
|
+
w3(!p2.enableDarkImages);
|
|
186
|
+
});
|
|
187
|
+
}, [W3, p2, C3]);
|
|
188
|
+
const { showModal: E2 } = le();
|
|
189
|
+
return m(() => {
|
|
190
|
+
const e3 = () => new Promise((e4, o3) => {
|
|
191
|
+
const t3 = n.lazy(() => import("./yB8OTWhDomxUy_SX.mjs")), r4 = E2(t3, { title: "Shortcut Keys Reference", commands: D3, onDone: () => {
|
|
192
|
+
r4.hide();
|
|
193
|
+
}, TransitionProps: { onExited: () => {
|
|
194
|
+
e4(true);
|
|
195
|
+
} } });
|
|
196
|
+
});
|
|
197
|
+
D3.getCommand("showKeyboardShortcuts").updateCallback(() => e3()), D3.getCommand("help").updateCallback(() => e3());
|
|
198
|
+
}, [C3, D3]), D3;
|
|
199
|
+
})({ workbook: l2, setWorkbook: c2, importExportDisabled: x2, workbookTitle: u2, setWorkbookTitle: h2, commands: y2, requestWorkbookTitle: (e2) => new Promise((o2) => {
|
|
200
|
+
k2.current ? k2.current.requestWorkbookTitle((e3, t2) => {
|
|
201
|
+
o2(e3);
|
|
202
|
+
}, { selectAll: true, requestReason: e2 }) : o2(b2);
|
|
203
|
+
}), themeOptions: C2, undoManager: f2, notifier: N2, onExecute: R2 });
|
|
204
|
+
m(() => {
|
|
205
|
+
S2.starting.size <= 0 || !S2.isMounted || M2((e2) => {
|
|
206
|
+
const o2 = new Map(e2.running);
|
|
207
|
+
e2.starting.forEach((e3, t2) => {
|
|
208
|
+
const n2 = () => {
|
|
209
|
+
M2((e4) => {
|
|
210
|
+
const o3 = new Map(e4.running);
|
|
211
|
+
o3.delete(t2);
|
|
212
|
+
return { ...e4, running: o3 };
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
o2.set(t2, n2), e3(n2);
|
|
216
|
+
});
|
|
217
|
+
return { ...e2, starting: /* @__PURE__ */ new Map(), running: o2 };
|
|
218
|
+
});
|
|
219
|
+
}, [S2]);
|
|
220
|
+
const [U2, H2] = a(null);
|
|
221
|
+
m(() => {
|
|
222
|
+
0 !== S2.starting.size || 0 !== S2.running.size ? H2(e(me, { icon: e(ke, { sx: { transform: "scale(0.7)", marginLeft: "-6px" } }), panel: true, label: S2.label, onMount: T2, onUnmount: O2, sx: { position: "absolute", left: "0", top: "0", width: "100%", height: "100%", zIndex: "9999" } })) : H2(null);
|
|
223
|
+
}, [S2.starting, S2.running]);
|
|
224
|
+
const K2 = d(() => e(ue, { commands: _2, disableHover: true, sx: { padding: "0" }, buttonProps: { sx: { maxHeight: "22px" } } }), [_2]), G2 = { notifier: N2, commands: _2 };
|
|
225
|
+
return l2 && (G2.statusBarProps = { childrenEnd: K2 }), o(t, { children: [U2, w2 ? n.cloneElement(w2, G2) : null] });
|
|
226
|
+
}));
|
|
227
|
+
Fe.displayName = "SnackbarAndCommandsWrapper";
|
|
228
|
+
const Ie = l(r((t2, n2) => {
|
|
229
|
+
const { className: r2, sx: i2, style: l2, onElementLoad: c2, onError: g2, undoManager: w2, errorPanel: y2 = be, onKeyDown: C2, workbook: D2, createWorkbookOptions: W2, onWorkbookChange: E2, logo: v2, importExportDisabled: L2 = false, themeOptions: P2, autoFocus: j2 = false, commands: N2, title: R2, onTitleChange: _2, titleProps: U2, renderLoadingPanel: H2, ...K2 } = t2, G2 = p(null), z2 = A(E2, [E2]), q2 = A(_2 ?? U2?.onTitleChange, [_2 ?? U2?.onTitleChange]), V2 = U2?.placeHolder ?? "Untitled", B2 = P2?.mode, { themeMode: X2, source: J2 } = se({ mode: B2 }), Y2 = d(() => ({ ...P2, light: ge(false, O.deepMerge(P2?.theme ?? {}, P2?.light ?? {})), dark: ge(true, O.deepMerge(P2?.theme ?? {}, P2?.dark ?? {})) }), [P2]), Z2 = X2 === ie.Dark, [Q2, ee2] = a(null);
|
|
230
|
+
m(() => {
|
|
231
|
+
ee2(w2 ?? new F());
|
|
232
|
+
}, [w2]);
|
|
233
|
+
const [oe2, te2] = a(null), [ne2, ae2] = a(null), le2 = we();
|
|
234
|
+
k(() => {
|
|
235
|
+
if (!D2 || 0 === Object.keys(D2).length && !O.isPromiseLike(D2)) {
|
|
236
|
+
const e2 = { theme: le2.getDefaultTheme(), ...W2 };
|
|
237
|
+
ae2(new I(e2));
|
|
238
|
+
} else ae2(D2);
|
|
239
|
+
}, [D2]), k(() => {
|
|
240
|
+
if (!ne2) return;
|
|
241
|
+
if (ne2 instanceof I) return te2({ workbook: ne2 }), void (D2 !== ne2 && z2?.(ne2));
|
|
242
|
+
(async () => {
|
|
243
|
+
try {
|
|
244
|
+
let e2, o2 = await Promise.resolve(ne2);
|
|
245
|
+
o2 && o2.source && (o2 = await $.read(o2)), o2.workbook ? (ue2(o2.title), e2 = o2.workbook) : e2 = o2, z2?.(e2), te2({ workbook: e2 });
|
|
246
|
+
} catch (e2) {
|
|
247
|
+
z2?.(null), te2({ error: e2 });
|
|
248
|
+
}
|
|
249
|
+
})();
|
|
250
|
+
}, [ne2]);
|
|
251
|
+
const [ce2, de2] = a(null);
|
|
252
|
+
m(() => {
|
|
253
|
+
if (!Q2 || !oe2) return;
|
|
254
|
+
Q2.clear();
|
|
255
|
+
const e2 = oe2?.workbook?.getTransactions();
|
|
256
|
+
if (!e2) return;
|
|
257
|
+
return e2.addListener({ onCommitEnd: (o2) => {
|
|
258
|
+
o2.getDescription() ? Q2.addUndoOperation({ description: o2.getDescription(), undo: () => (e2.revert(o2.getId()), ce2.source?.focus(), () => {
|
|
259
|
+
e2.restore(o2.getId()), ce2.source?.focus();
|
|
260
|
+
}) }) : console.warn("commit has no description", o2);
|
|
261
|
+
} });
|
|
262
|
+
}, [Q2, oe2, ce2]);
|
|
263
|
+
const pe2 = A((e2) => {
|
|
264
|
+
e2 ? Q2.setRepeatableOperation({ description: e2.label(), repeat: async () => e2.execute() }) : Q2.setRepeatableOperation(null);
|
|
265
|
+
}, [Q2]), [ke2, ue2] = a(R2 ?? U2?.title ?? "");
|
|
266
|
+
m(() => {
|
|
267
|
+
ue2(R2 ?? U2?.title ?? "");
|
|
268
|
+
}, [R2 ?? U2?.title]), m(() => {
|
|
269
|
+
q2?.(ke2);
|
|
270
|
+
}, [ke2]);
|
|
271
|
+
const [he2, De2] = a(null), We2 = d(() => {
|
|
272
|
+
const e2 = () => ({ contains: (e3) => true, focus() {
|
|
273
|
+
} });
|
|
274
|
+
return N2 ? N2.createChildGroup(e2, "application", false) : new re(e2, "application");
|
|
275
|
+
}, [N2]), Ee2 = A((e2) => {
|
|
276
|
+
De2(e2.source.getViewportElement()), de2(e2), We2.activate("sheet"), c2?.(e2);
|
|
277
|
+
}, [We2]);
|
|
278
|
+
m(() => {
|
|
279
|
+
ce2 && j2 && ce2.source?.focus("object" == typeof j2 ? j2 : void 0);
|
|
280
|
+
}, [ce2]);
|
|
281
|
+
const ve2 = p(null), Se2 = s((o2) => {
|
|
282
|
+
let t3 = null;
|
|
283
|
+
return U2?.hidden || (t3 = e(fe, { ...U2, style: { maxWidth: "100%", ...U2?.style }, workbook: G2.current, ref: ve2, title: ke2, placeHolder: V2, onTitleChange: (e2) => {
|
|
284
|
+
ue2(e2);
|
|
285
|
+
} })), e(Oe, { ...o2, logo: v2, mainElement: t3, showFileMenu: !L2, showAppearanceMenu: !!(Y2?.onEnabledDarkGridChange || Y2?.onEnabledDarkImagesChange || Y2?.onModeChange) });
|
|
286
|
+
}, [v2, ke2, U2, Y2, L2, We2]);
|
|
287
|
+
m(() => {
|
|
288
|
+
const e2 = (e3) => e3.preventDefault();
|
|
289
|
+
return G2.current?.addEventListener("wheel", e2, { passive: false }), () => {
|
|
290
|
+
G2.current?.removeEventListener("wheel", e2);
|
|
291
|
+
};
|
|
292
|
+
}, []);
|
|
293
|
+
const Te2 = d(() => {
|
|
294
|
+
const o2 = { transparentBackground: true };
|
|
295
|
+
return e(S, { sx: i2, style: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0, display: "flex", alignItems: "center", justifyContent: "center", ...l2 }, children: H2?.(o2) ?? e(me, { ...o2 }) });
|
|
296
|
+
}, [i2, l2, H2]), Le2 = s(({ error: o2 }) => (g2?.(o2), e(y2, { sx: i2, style: l2, error: o2 ?? "Unable to display empty workbook." })), [i2, l2, g2]), Ie2 = d(() => ({ ...i2, "& .SnackbarContainer-root": { position: "absolute !important" }, "& .notistack-Snackbar": { minWidth: "unset" }, "& .notistack-MuiContent *": { fontFamily: (e2) => e2.typography.fontFamily }, "& #notistack-snackbar": { maxWidth: "560px", whiteSpace: "pre-wrap" }, "*": { userSelect: "none" } }), [i2]), Pe = h([G2, n2]), Ae = d(() => {
|
|
297
|
+
if (!oe2) return Te2;
|
|
298
|
+
if (oe2.error || !oe2.workbook) return Le2({ error: oe2.error });
|
|
299
|
+
let o2 = null, t3 = null, n3 = false;
|
|
300
|
+
return Y2 && (o2 = Z2 ? Y2.dark : Y2.light, t3 = Z2 && Y2.enableDarkGrid ? Y2.dark : Y2.light, n3 = Y2.enableDarkImages), e(ye, { sx: Ie2, style: l2, tabIndex: 0, autoFocus: true, workbook: oe2.workbook, ref: Pe, renderToolbar: Se2, onElementLoad: Ee2, onRepeatCommandChange: pe2, onKeyDown: (e2) => {
|
|
301
|
+
C2?.(e2);
|
|
302
|
+
}, renderLoadingPanel: H2, gridTheme: t3, headersTheme: o2, enableDarkImages: n3, className: u(r2, "sheetxl-workbook"), onContextMenu: (e2) => e2.preventDefault(), ...K2 }, "WorkbookElement");
|
|
303
|
+
}, [oe2, ke2, Q2, Te2, H2, Y2, K2, Se2, Ie2]);
|
|
304
|
+
let je = e(b, { fallbackRender: Le2, children: e(f, { maxSnack: 3, domRoot: he2, anchorOrigin: { vertical: "bottom", horizontal: "right" }, autoHideDuration: 3500, onClose: (e2, o2, t3) => {
|
|
305
|
+
G2.current?.focus();
|
|
306
|
+
}, Components: { error: Me }, iconVariant: { success: e(M, { style: { marginRight: "8px" }, children: e("path", { d: "M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z" }) }), error: e(Ce, { style: { marginRight: "8px" } }) }, children: e(xe, { children: e(Fe, { workbook: oe2?.workbook, setWorkbook: ae2, importExportDisabled: L2, titlePlaceHolder: V2, titleWorkbook: ke2, setWorkbookTitle: ue2, refWorkbookTitle: ve2, commands: We2, undoManager: Q2, themeOptions: Y2, children: Ae }) }) }) });
|
|
307
|
+
return Y2 && (je = o(x, { theme: Z2 ? Y2.dark : Y2.light, children: [Y2.cssBaseline ? e(T, {}) : null, je] })), je;
|
|
308
|
+
}));
|
|
309
|
+
Ie.displayName = "EagerStudio";
|
|
310
|
+
export {
|
|
311
|
+
Ie as EagerStudio,
|
|
312
|
+
Ie as default
|
|
313
|
+
};
|
|
@@ -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.14
|
|
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.4.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.14
|
|
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.
|
|
@@ -8,51 +8,51 @@ import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
|
8
8
|
import { memo as o, useState as n, useRef as a, useReducer as i, useMemo as l } from "react";
|
|
9
9
|
import { useMeasure as s } from "react-use";
|
|
10
10
|
import { DialogContent as r, Box as c } from "@mui/material";
|
|
11
|
-
import {
|
|
11
|
+
import { R as d, S as g, Z as m, P as p, A as h, NamedInput as u, RangeInput as x, d as f, TableStyleOptionsPanel as y, TableStylePreview as b, E as w, a as S, t as C, a0 as N } from "./index.mjs";
|
|
12
12
|
const v = o((o2) => {
|
|
13
|
-
const { title: v2, onHide: R, autoFocusSel: T = ".range-input input", context: F, notifier: D = d, command: H, commands:
|
|
13
|
+
const { title: v2, onHide: R, autoFocusSel: T = ".range-input input", context: F, notifier: D = d, command: H, commands: B, ...I } = o2, [P, j] = n(false), [z, L] = n(false), E = a(null), [O, A] = i((e2) => e2 + 1, 0), [M, { width: V }] = s();
|
|
14
14
|
g(H);
|
|
15
|
-
const
|
|
16
|
-
m(
|
|
17
|
-
q(
|
|
15
|
+
const W = F ?? H.context(), Z = W.table(), [k, q] = n(() => Z ? W.getNames().getRanges(Z.getRange()) : null), G = l(() => Z?.getName() ?? "", [Z]);
|
|
16
|
+
m(W.table(), { onAnchorCoordsChange(e2) {
|
|
17
|
+
q(W.getNames().getRanges(e2.getRange()));
|
|
18
18
|
}, onProtectedChange(e2) {
|
|
19
19
|
A();
|
|
20
20
|
} });
|
|
21
21
|
const J = p((e2) => {
|
|
22
|
-
|
|
23
|
-
}, [
|
|
24
|
-
|
|
25
|
-
}, [
|
|
22
|
+
W?.table().setName(e2);
|
|
23
|
+
}, [W]), K = p((e2) => {
|
|
24
|
+
W?.table().resize(e2.at(0));
|
|
25
|
+
}, [W]);
|
|
26
26
|
let Q = null;
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
}, PaperProps: { elevation:
|
|
30
|
-
|
|
31
|
-
}, disabled:
|
|
27
|
+
return W.table() || (Q = e("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: e("div", { children: "No table selected" }) })), e(h, { ref: E, title: v2 ?? "Table Details", initialPosition: { y: "35" }, autoFocusSel: T, onHide: R, onFocus: () => j(true), onBlur: (e2) => {
|
|
28
|
+
E?.current?.contains(e2.relatedTarget) || j(false);
|
|
29
|
+
}, PaperProps: { elevation: P ? 3 : 1 }, ...I, children: t(r, { dividers: true, ref: M, sx: { display: "flex", flexDirection: "column", position: "relative", paddingLeft: (e2) => e2.spacing(1.5), paddingRight: (e2) => e2.spacing(1.5) }, children: [t(c, { sx: { display: "flex", flexDirection: "column", transition: "opacity 60ms", opacity: W.table() ? 1 : 0 }, children: [e(c, { sx: { display: "flex", flexDirection: "row", gap: (e2) => e2.spacing(1) }, children: e(c, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", boxSizing: "border-box", paddingLeft: (e2) => e2.spacing(2), paddingRight: (e2) => e2.spacing(2) }, children: t(c, { sx: { display: "flex", flexDirection: "column", alignItems: "center" }, children: [e(u, { formName: "name", defaultInput: G, value: Z?.getName() ?? "No table", onChangeInput: J, onValidate: (e2) => {
|
|
30
|
+
Z && Z.getName().toLowerCase() === e2.toLowerCase() || W?.getNames().validateName(e2);
|
|
31
|
+
}, disabled: Z?.isProtected() ?? true, onFocus: (e2) => {
|
|
32
32
|
z || e2.target?.select(), L(true);
|
|
33
|
-
} }), e(x, { formName: "range", value:
|
|
33
|
+
} }), e(x, { formName: "range", value: k, onChangeInput: K, resolvedAddress: W.getNames().getRanges.bind(W.getNames()), disabled: Z?.isProtected() ?? true, onFocus: (e2) => {
|
|
34
34
|
z || e2.target?.select(), L(true);
|
|
35
|
-
} })] }) }) }), t(c, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", gap: (e2) => e2.spacing(0.5), marginTop: (e2) => e2.spacing(1) }, children: [e(f, { orientation: "horizontal", sx: { marginTop: (e2) => e2.spacing(1.5), marginBottom: (e2) => e2.spacing(0.75) } }), e(y, { disabled:
|
|
36
|
-
|
|
37
|
-
}, showHeaderRow:
|
|
35
|
+
} })] }) }) }), t(c, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", gap: (e2) => e2.spacing(0.5), marginTop: (e2) => e2.spacing(1) }, children: [e(f, { orientation: "horizontal", sx: { marginTop: (e2) => e2.spacing(1.5), marginBottom: (e2) => e2.spacing(0.75) } }), e(y, { disabled: Z?.isProtected(), styleOptions: Z?.getStyleOptions() ?? null, onStyleOptionsChange: (e2) => {
|
|
36
|
+
Z.updateStyleOptions(e2);
|
|
37
|
+
}, showHeaderRow: Z?.getShowHeaders(), onShowHeaderRowChange: (e2) => {
|
|
38
38
|
try {
|
|
39
|
-
|
|
39
|
+
Z.setShowHeaders(e2);
|
|
40
40
|
} catch (e3) {
|
|
41
41
|
D.showError(e3);
|
|
42
42
|
}
|
|
43
|
-
}, showTotalRow:
|
|
43
|
+
}, showTotalRow: Z?.getShowTotals(), onShowTotalRowChange: (e2) => {
|
|
44
44
|
try {
|
|
45
|
-
|
|
45
|
+
Z.setShowTotals(e2);
|
|
46
46
|
} catch (e3) {
|
|
47
47
|
D.showError(e3);
|
|
48
48
|
}
|
|
49
|
-
}, showFilterButton:
|
|
49
|
+
}, showFilterButton: Z?.getFilter() ? Z.getShowFilterButton() : null, onShowFilterButtonChange: (e2) => {
|
|
50
50
|
try {
|
|
51
|
-
|
|
51
|
+
Z.setShowFilterButton(e2);
|
|
52
52
|
} catch (e3) {
|
|
53
53
|
D.showError(e3);
|
|
54
54
|
}
|
|
55
|
-
} }), e(c, { sx: { display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", marginTop: (e2) => e2.spacing(2), marginBottom: (e2) => e2.spacing(1) }, children: e(b, { table:
|
|
55
|
+
} }), e(c, { sx: { display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", marginTop: (e2) => e2.spacing(2), marginBottom: (e2) => e2.spacing(1) }, children: e(b, { table: Z, styles: W.styles(), bodyStyle: W.bodyStyle(), cellHeight: 30, isLive: true }) }), e(f, { orientation: "horizontal" }), t(c, { sx: { display: "flex", flexDirection: "column", justifyContent: "center" }, children: [e(w, { variant: C.Menuitem, command: B.getCommand("convertTableToRange"), commandState: Z, icon: S(e(N, {})) }), e(w, { variant: C.Menuitem, commandState: Z, command: B.getCommand("deleteTable"), icon: S(e(N, {})) })] })] })] }), Q] }) });
|
|
56
56
|
});
|
|
57
57
|
export {
|
|
58
58
|
v as TableDetailsWindow,
|