@sheetxl/studio-mui 0.4.6 → 0.4.8
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/{CdQdB8GGgwp5bzHl.cjs → B9VxvukbesYhdTdA.cjs} +2 -2
- package/browser/cjs/{QA_huZIonWzLs-uu.cjs → BA7HloSCkIjbJehh.cjs} +2 -2
- package/browser/cjs/BJN1sH87EvdxRpOd.cjs +12 -0
- package/browser/cjs/{Bcv0k3jvRwqN2MIv.cjs → BXt_O5ZSE2LpILmE.cjs} +4 -4
- package/browser/cjs/{BqTAMhy1JhZE_3nU.cjs → BZUPFYECmoclErqJ.cjs} +2 -2
- package/browser/cjs/{DtMN1mvFQK7hQ1j9.cjs → Ba7K1ZdzfgXpvg7P.cjs} +1 -1
- package/browser/cjs/C1NVH5bp1otDYHTC.cjs +12 -0
- package/browser/cjs/{Bwb_ZIYk7AHA0u3k.cjs → C1wsDeHNaWiFlCZh.cjs} +6 -6
- package/browser/cjs/{LWykIZ3qaETKREvJ.cjs → C7YVj8dlBBL_wOM9.cjs} +1 -1
- package/browser/cjs/{DPm_1cgH3Q1g4XzF.cjs → CPtvdlvWWilf8Vep.cjs} +2 -2
- package/browser/cjs/{DjEDCBlxBYuN3Enq.cjs → CTokFqp-O-Uhl0LW.cjs} +1 -1
- package/browser/cjs/{SSESHQPsy1dN102X.cjs → CeRQ0zAM1Xczv7Gm.cjs} +2 -2
- package/browser/cjs/{B1mBnghJtPodtylh.cjs → CiJS-8DphNBc_B9t.cjs} +2 -2
- package/browser/cjs/{E2cXotXW7NLh-ylB.cjs → Cuyl2HX5ovut6vef.cjs} +2 -2
- package/browser/cjs/Czcg6yLU8uVHew0l.cjs +6 -0
- package/browser/cjs/D7ntR8K8guZD6yMH.cjs +6 -0
- package/browser/cjs/{BIjFjK_aRCl0ckiG.cjs → DIKyZ-hkjeexXMzY.cjs} +1 -1
- package/browser/cjs/{DVh3lOOMM_xi0ETW.cjs → DNjiEJT8EtVysR2q.cjs} +1 -1
- package/browser/cjs/DTaaqEmMOO2QrfZF.cjs +87 -0
- package/browser/cjs/{DaK6Oc8sNlioHzKi.cjs → DkfygXp4ZgvLr3Yw.cjs} +2 -2
- package/browser/cjs/{D9DjLppWLp-iQcfI.cjs → NRKyHbS2cOhmoSox.cjs} +2 -2
- package/browser/cjs/{DKVuDNZsxiRUUBVt.cjs → dYzaARxDkWvC98N4.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{B1qn41wLyGnMiQPU.cjs → k4ZW48PahXgf2WQD.cjs} +1 -1
- package/browser/cjs/z_x7DWNrjsFa45Nh.cjs +6 -0
- package/browser/cjs/{Cwa_0l8qR0zbOqE0.cjs → znXBy3z9cM6mLfO7.cjs} +1 -1
- package/browser/esm/ABtrpK9yMoHh6oPr.mjs +864 -0
- package/browser/esm/{oV4EdTmLvRNexoGq.mjs → BG3qcQNY_GZt3VHB.mjs} +2 -2
- package/browser/esm/{9sVNDRh1Ww2_ABjB.mjs → BG8pohDV-03DRiXx.mjs} +13 -13
- package/browser/esm/{B8uQ6WrEnZeQliy7.mjs → BYftsJS-zhpjBq1k.mjs} +2 -2
- package/browser/esm/Bd0yhfN0EoE3uahv.mjs +84 -0
- package/browser/esm/{C4PpKzB897oeobRz.mjs → CAvo3HCB981DM5OF.mjs} +2 -2
- package/browser/esm/{CD2_V-nutPVuAS-C.mjs → CHNZIKe6NNdfdZOr.mjs} +1 -1
- package/browser/esm/{DBqHis2InMtzN9m3.mjs → CJxkcbtPJNL_Gloc.mjs} +16 -16
- package/browser/esm/{DowxifIAh5V6Hww_.mjs → COU2bYtN0WpsI4PY.mjs} +1 -1
- package/browser/esm/{Lm7tjCM70hRDdKQn.mjs → CWtcMBj9hNKDPN_v.mjs} +2 -2
- package/browser/esm/{D_eMbbDkTCIyPBkR.mjs → CzXTFr7g6RYXxPM1.mjs} +6 -6
- package/browser/esm/{VnAOTl45ngDazT7k.mjs → DIxDU9Lfq3hPWFPl.mjs} +2 -2
- package/browser/esm/{D2KNRJIkSezOwiMf.mjs → DJBG1-2QdNbZKe_4.mjs} +7971 -7961
- package/browser/esm/{DVKSMAIBqNe72BA_.mjs → DL8nFbYrab-MKQmF.mjs} +12 -12
- package/browser/esm/{DBxxz4VWtQhF8HiE.mjs → DWOLWdzUONLf1nae.mjs} +1 -1
- package/browser/esm/{BGDv4j9k0fKGH40f.mjs → DatUamvfhoqxlf8D.mjs} +2 -2
- package/browser/esm/{Y56oxIoigldEyDtK.mjs → DdVyaTOGGjRcamT8.mjs} +1 -1
- package/browser/esm/{DL7U0rX3cr1nkmnW.mjs → DdzcCdPQ_zZbqH2p.mjs} +2 -2
- package/browser/esm/{D75FG-POhKcbVybN.mjs → DoDQcFwr66QfXlYi.mjs} +1 -1
- package/browser/esm/{C4JsAY2gYqZ7Sd56.mjs → DwLP5jvXe3rwi5r2.mjs} +3 -3
- package/browser/esm/{D49GU0rifaflLO3n.mjs → Dz_iWDlTCAECBFSF.mjs} +7 -7
- package/browser/esm/{HBIcmxUA2eXJVoAq.mjs → GYPCajr96WY2V_je.mjs} +1 -1
- package/browser/esm/{DBsl0-1buVSmLIT3.mjs → eq540RbNc68EuIvk.mjs} +1 -1
- package/browser/esm/index.mjs +26 -25
- package/browser/esm/{DLq_1QLsg30gdYKE.mjs → lk_a0cAuz5HJsQKm.mjs} +1 -1
- package/browser/esm/{CvdO7McIlOCtqS-y.mjs → zMjWIB_wUonhfIad.mjs} +2 -2
- package/licenses/dependencies.txt +6 -6
- package/node/esm/{DhSN7TkeDTP5WvZm.mjs → 0CnPehqlnzEMqDVS.mjs} +30 -30
- package/node/esm/{Dg4Q-SaoO3kvkvYo.mjs → BFxNXzqwDw9mTzzX.mjs} +1 -1
- package/node/esm/{DSGdRHGkJfdn-vZg.mjs → BKkexYXFkC5jI1D4.mjs} +1 -1
- package/node/esm/BXF0I0KwKWFhkYfM.mjs +78 -0
- package/node/esm/{C79MhCjBRvMtRYQ8.mjs → BpwzpczDCk32RxzY.mjs} +1 -1
- package/node/esm/{wJsllV16IW6_aUTq.mjs → C74xiDKgQep36e0D.mjs} +5 -5
- package/node/esm/{DHWs5mErxhiV_ABm.mjs → CE2Wff_Jx8m74lIm.mjs} +1 -1
- package/node/esm/{BykEuFt9dp-EWJZO.mjs → CVy5rNrHziJk0Xxc.mjs} +1 -1
- package/node/esm/{B45Lgj6XrYICeuDV.mjs → ChbG8iQjvpz3jA7T.mjs} +1 -1
- package/node/esm/{DKlEncWUM6PlIVXw.mjs → Cjw96KqgMSYqwdC4.mjs} +1 -1
- package/node/esm/{DV9nbqcBflTCKGov.mjs → ClUQ790AiAE9XIkY.mjs} +1 -1
- package/node/esm/{ClNrSC5ChRfmj691.mjs → D-Wu9vRF_DAsmME4.mjs} +14 -14
- package/node/esm/{CNtUiJCciezra7NX.mjs → D0ePiwz-m6oHmiUC.mjs} +1 -1
- package/node/esm/{CYcPamATHHzrhe3e.mjs → D4GNfE_QjFh3c9sT.mjs} +1 -1
- package/node/esm/DBDh50h4q3jgV4kn.mjs +312 -0
- package/node/esm/{dgGvhB4_s7wWzRKZ.mjs → DCLyoPsjP2qTWbca.mjs} +1 -1
- package/node/esm/{CjV-qMk3flrBJ5Tx.mjs → DTp1I9pWjg3-VyHr.mjs} +2 -2
- package/node/esm/{09msifGrQdtU9V1P.mjs → DkTySui4bQaZlvaP.mjs} +1 -1
- package/node/esm/{BhaLY_aBt2JyosQ9.mjs → Dm3qRN9_dIcmeeTB.mjs} +19 -19
- package/node/esm/{BrMPoQxRSTKdwAVr.mjs → cZHe3atogTKTMgvX.mjs} +1 -1
- package/node/esm/index.mjs +231 -221
- package/node/esm/{CsgrU16opQLee5fg.mjs → q2jb3DavC5pzi-mZ.mjs} +1 -1
- package/node/esm/{BMezAVogP2CPQGXx.mjs → wxIEXtYch2hJq7Rz.mjs} +1 -1
- package/node/esm/{CSffUZePWbg2mmfY.mjs → zfM7ir63qYOCXQWg.mjs} +20 -20
- package/package.json +8 -8
- package/types/index.d.ts +118 -81
- package/browser/cjs/BR4pH9NA2LHogxsj.cjs +0 -6
- package/browser/cjs/BwBrLQaEYCz6GTg4.cjs +0 -87
- package/browser/cjs/C_aC2PbKe_AGZzJf.cjs +0 -12
- package/browser/cjs/Cc9abhZ8Cm2eNY_H.cjs +0 -12
- package/browser/cjs/Dc5FruZcYE4XCAxW.cjs +0 -6
- package/browser/cjs/WY-zkNIfIEVEQq-C.cjs +0 -6
- package/browser/esm/BXKEJUmDPV4aXepN.mjs +0 -860
- package/browser/esm/F9D7x6t41LChFxhi.mjs +0 -84
- package/node/esm/CSubjpwyZVLohant.mjs +0 -78
- package/node/esm/yDYdEwZNn_fHB_XK.mjs +0 -308
|
@@ -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.8
|
|
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.
|
|
@@ -900,14 +900,14 @@ class wt {
|
|
|
900
900
|
const vt = (t2, e2, s2) => {
|
|
901
901
|
if (t2[0].value[0] === t2[1].value[0]) return e2;
|
|
902
902
|
}, St = { colStart: 0, colEnd: 0, rowStart: 0, rowEnd: 0 }, Ct = Object.freeze(Object.defineProperty({ __proto__: null, fromBufferXLSX: async (t2, h2) => {
|
|
903
|
-
const { password: f2, onWarning: m2,
|
|
903
|
+
const { password: f2, onWarning: m2, createWorkbookOptions: T2 = {}, ...y2 } = h2 ?? {}, b2 = import("./wxIEXtYch2hJq7Rz.mjs"), x2 = import("./DTp1I9pWjg3-VyHr.mjs");
|
|
904
904
|
let w2 = null;
|
|
905
905
|
try {
|
|
906
906
|
w2 = new DOMParser();
|
|
907
907
|
} catch (t3) {
|
|
908
908
|
}
|
|
909
909
|
let v2 = null;
|
|
910
|
-
w2 || (v2 = import("./
|
|
910
|
+
w2 || (v2 = import("./CE2Wff_Jx8m74lIm.mjs").then((t3) => t3.i));
|
|
911
911
|
let S2 = null, C2 = null, k2 = null;
|
|
912
912
|
try {
|
|
913
913
|
const t3 = await Promise.all([b2, x2, v2]);
|
|
@@ -1316,7 +1316,7 @@ const vt = (t2, e2, s2) => {
|
|
|
1316
1316
|
}, A2), a3 = ht(h4, P2), c3 = await (async (t6, e2 = 8388608) => {
|
|
1317
1317
|
await (async () => {
|
|
1318
1318
|
if ("undefined" == typeof ReadableStream) if ("undefined" == typeof window) {
|
|
1319
|
-
const { ReadableStream: t7 } = await import("./
|
|
1319
|
+
const { ReadableStream: t7 } = await import("./DkTySui4bQaZlvaP.mjs");
|
|
1320
1320
|
globalThis.ReadableStream = t7;
|
|
1321
1321
|
} else console.warn("Browser does not support ReadableStream; consider loading a polyfill.");
|
|
1322
1322
|
})();
|
|
@@ -1421,7 +1421,7 @@ const vt = (t2, e2, s2) => {
|
|
|
1421
1421
|
throw t3 instanceof p && (e2 = "Unable to open XLSX. There are too many rows or columns."), new Error(e2, { cause: t3 });
|
|
1422
1422
|
}
|
|
1423
1423
|
}, toBufferXLSX: async (s2, i2) => {
|
|
1424
|
-
const o2 = await import("./
|
|
1424
|
+
const o2 = await import("./wxIEXtYch2hJq7Rz.mjs"), r2 = await s2.toJSON(true), n2 = o2.utils.book_new();
|
|
1425
1425
|
for (let i3 = 0; i3 < r2.sheets.length; i3++) {
|
|
1426
1426
|
const a2 = r2.sheets[i3], l2 = o2.utils.json_to_sheet([{}]);
|
|
1427
1427
|
o2.utils.book_append_sheet(n2, l2, a2.name);
|
|
@@ -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.8
|
|
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.8
|
|
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.8
|
|
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.8
|
|
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.8
|
|
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.8
|
|
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.
|
|
@@ -10,27 +10,27 @@ import { useMeasure as s } from "react-use";
|
|
|
10
10
|
import { DialogContent as r, Box as c } from "@mui/material";
|
|
11
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: B, ...I } = o2, [P, j] = n(false), [z, L] = n(false), E = a(null), [O, A] = i((e2) => e2 + 1, 0), [M, { width:
|
|
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
|
|
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
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:
|
|
30
|
-
Z && Z.getName().toLowerCase() === e2.toLowerCase() ||
|
|
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
31
|
}, disabled: Z?.isProtected() ?? true, onFocus: (e2) => {
|
|
32
32
|
z || e2.target?.select(), L(true);
|
|
33
|
-
} }), e(x, { formName: "range", value: k, onChangeInput: K, resolvedAddress:
|
|
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
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
36
|
Z.updateStyleOptions(e2);
|
|
@@ -52,7 +52,7 @@ const v = o((o2) => {
|
|
|
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: Z, styles:
|
|
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,
|
|
@@ -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.8
|
|
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.8
|
|
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,312 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.8
|
|
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("./DCLyoPsjP2qTWbca.mjs"), numberFormat: () => import("./BKkexYXFkC5jI1D4.mjs"), hyperlink: () => import("./ClUQ790AiAE9XIkY.mjs"), comments: () => import("./D0ePiwz-m6oHmiUC.mjs"), find: () => import("./zfM7ir63qYOCXQWg.mjs"), tableDetails: () => import("./D-Wu9vRF_DAsmME4.mjs"), tableNew: () => import("./BFxNXzqwDw9mTzzX.mjs"), namedDetails: () => import("./CVy5rNrHziJk0Xxc.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("./0CnPehqlnzEMqDVS.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 default
|
|
312
|
+
};
|
|
@@ -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.8
|
|
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,11 +1,11 @@
|
|
|
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.8
|
|
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 { e as t } from "./index.mjs";
|
|
8
|
-
import { c as e, b as s, r, t as o, a as i, p as n, d as l } from "./
|
|
8
|
+
import { c as e, b as s, r, t as o, a as i, p as n, d as l } from "./C74xiDKgQep36e0D.mjs";
|
|
9
9
|
import { IFont as a, IAutoFilter as c, Sort as u, IRange as h, AddressUtils as p, IFill as g, IStyle as d, ITextFrame as m, FormulaError as b, IBorder as f } from "@sheetxl/sdk";
|
|
10
10
|
class A {
|
|
11
11
|
constructor(t2) {
|
|
@@ -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.8
|
|
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,44 +1,44 @@
|
|
|
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.8
|
|
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 { Workbook as e, IRange as t } from "@sheetxl/sdk";
|
|
8
8
|
const n = async (e2, t2) => {
|
|
9
|
-
const { trimLeadingBlankRow: n2 = true, trimLeadingBlankColumn: r2 = true, excludeHidden: o = false, sheetKey: s = null, papaParseConfig: a = {} } = t2 || {}, l = await import("./
|
|
9
|
+
const { trimLeadingBlankRow: n2 = true, trimLeadingBlankColumn: r2 = true, excludeHidden: o = false, sheetKey: s = null, papaParseConfig: a = {} } = t2 || {}, l = await import("./BpwzpczDCk32RxzY.mjs").then((e3) => e3.p);
|
|
10
10
|
if (!e2) throw new Error("workbook must be specified");
|
|
11
11
|
let i = null;
|
|
12
12
|
if (null === s ? i = e2.getSelectedSheet() : "number" == typeof s ? i = e2.getSheets().search()[s] : "string" == typeof s && (i = e2.getSheets().getByName(s)), !i) throw new Error("invalid sheetKey specified");
|
|
13
|
-
let
|
|
14
|
-
const
|
|
15
|
-
let p = null,
|
|
16
|
-
if (!
|
|
13
|
+
let d = null;
|
|
14
|
+
const c = [];
|
|
15
|
+
let p = null, f = i.getUsedRange({ excludeHidden: o });
|
|
16
|
+
if (!f) throw new Error("Nothing to export");
|
|
17
17
|
if (!n2 || !r2) {
|
|
18
|
-
const e3 = n2 ?
|
|
19
|
-
|
|
18
|
+
const e3 = n2 ? f.getRowStart() : 0, t3 = r2 ? f.getColumnStart() : 0;
|
|
19
|
+
f = f.getOffsetTo(e3, t3);
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
f.forEach((e3, t3) => {
|
|
22
22
|
const n3 = t3.getCoords(), r3 = t3.getCell();
|
|
23
|
-
|
|
23
|
+
d !== n3.rowIndex && (p && c.push(p), p = [], d = n3.rowIndex);
|
|
24
24
|
const o2 = r3.toTextUnformatted() ?? "";
|
|
25
25
|
p.push(o2);
|
|
26
|
-
}, { includeEmpty: true, address: null }), p &&
|
|
27
|
-
const
|
|
26
|
+
}, { includeEmpty: true, address: null }), p && c.push(p);
|
|
27
|
+
const u = { ...a }, g = l.unparse(c, u);
|
|
28
28
|
return new TextEncoder().encode(g).buffer;
|
|
29
29
|
}, r = async (n2, r2) => {
|
|
30
|
-
const { papaParseConfig: o, setValuesOptions: s,
|
|
31
|
-
let
|
|
32
|
-
const
|
|
33
|
-
let
|
|
30
|
+
const { papaParseConfig: o, setValuesOptions: s, createWorkbookOptions: a } = r2 ?? {}, l = await import("./BpwzpczDCk32RxzY.mjs").then((e2) => e2.p), i = new TextDecoder().decode(n2);
|
|
31
|
+
let d = -1;
|
|
32
|
+
const c = new e(a), p = c.getSelectedSheet().getEntireRange().startIncrementalUpdates({ orientation: t.Orientation.Row }), f = r2?.onProgress;
|
|
33
|
+
let u = 0;
|
|
34
34
|
const g = { ...o, transform: (e2, t2) => {
|
|
35
35
|
o?.transform && (e2 = o.transform(e2, t2));
|
|
36
36
|
const n3 = t2;
|
|
37
|
-
0 === n3 &&
|
|
37
|
+
0 === n3 && d++;
|
|
38
38
|
let r3 = e2 ?? "";
|
|
39
|
-
return p.pushAt(
|
|
39
|
+
return p.pushAt(d, n3, r3), u++, u % 1e5 == 0 && f?.(u), e2;
|
|
40
40
|
} };
|
|
41
|
-
return l.parse(i, g).data, p.apply({ textParser: true, ...s }),
|
|
41
|
+
return l.parse(i, g).data, p.apply({ textParser: true, ...s }), c;
|
|
42
42
|
};
|
|
43
43
|
export {
|
|
44
44
|
r as fromBufferCSV,
|
|
@@ -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.8
|
|
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.
|