@sheetxl/studio-mui 0.3.3 → 0.3.5
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/4qy63Boa4nvdxyjo.cjs +6 -0
- package/browser/cjs/{D69p4DRnZE5Oa52x.cjs → AQ9Vi-Cv6JK-IezR.cjs} +1 -1
- package/browser/cjs/{YpWYrg3Eysqtr9aZ.cjs → B13OXuZsTC4RULMo.cjs} +1 -1
- package/browser/cjs/BHJSCG4oU8pmuDwm.cjs +12 -0
- package/browser/cjs/{DSNu0kgR1_X-nK_Z.cjs → Bav0cmsoPAA3a5yu.cjs} +2 -2
- package/browser/cjs/{DAyHZyXZGsDWfbyd.cjs → Bkl3DGri3E5UGuvv.cjs} +1 -1
- package/browser/cjs/{BH160EggM2K8qaSr.cjs → BlxVofqfnSMNcuv8.cjs} +1 -1
- package/browser/cjs/{BL1st_QvuF5m8AaJ.cjs → ByVL-_c8JG4yCwyg.cjs} +2 -2
- package/browser/cjs/{BlBsVySC7wICKf3b.cjs → CGHGrJD1KaYGPUWt.cjs} +2 -2
- package/browser/cjs/{Bh785l7WNSK7G3hU.cjs → CQXkduebOzsWYR7I.cjs} +1 -1
- package/browser/cjs/{C9TJkm0tBPD04idM.cjs → CauYni4UlnUOg2KD.cjs} +2 -2
- package/browser/cjs/CetwWGtSVR7MPQmq.cjs +6 -0
- package/browser/cjs/{BQyDL6TxMqPmkugH.cjs → D76n8Obon9BUBaN9.cjs} +1 -1
- package/browser/cjs/{scolQa-PxnIvyiDb.cjs → DAIK3n9uEZA5B3jo.cjs} +1 -1
- package/browser/cjs/{CPKZW7FfYlmkNYbE.cjs → DKTmOXPHU474-EAe.cjs} +2 -2
- package/browser/cjs/DQxMsOz7p1VlzGGr.cjs +11 -0
- package/browser/cjs/DSumeKv5upBoatXJ.cjs +12 -0
- package/browser/cjs/{CEx5ZMI8c4HYrxzW.cjs → Dold2uHEN8H8QsT-.cjs} +1 -1
- package/browser/cjs/{B0-aLTQ0dAlPdRnQ.cjs → K7lHFQm8oaMP4Fc7.cjs} +3 -3
- package/browser/cjs/{D8qPzQKLyGrgGg08.cjs → LLqao183uS5MMxF5.cjs} +2 -2
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/kEe9PBONC8-oT9AU.cjs +6 -0
- package/browser/cjs/{CP_eU6V1jkcP4WtQ.cjs → p8j2cCUulAy7yD2q.cjs} +2 -2
- package/browser/cjs/q9JmnJDMYsSf7UfZ.cjs +6 -0
- package/browser/cjs/wwocjd0UfaRLBBMZ.cjs +6 -0
- package/browser/cjs/zAZ0LJZMPXeu6JSh.cjs +87 -0
- package/browser/esm/{BeMVD9uqSXo5o9U7.mjs → B5O5PCrKRZ4DUAH5.mjs} +13 -13
- package/browser/esm/B89QkSJt5Nra70ba.mjs +19838 -0
- package/browser/esm/{5uqs7KjiX3pi6cd5.mjs → BRJgzXA_m_2aKWbd.mjs} +10 -10
- package/browser/esm/{C8eXD0cT7ZPGYNCl.mjs → BYUh5NiLu-E5n_2A.mjs} +21 -20
- package/browser/esm/{B9IRFHtuYz6_J4Sj.mjs → Bx8dhDDGV4fnPcL4.mjs} +8 -8
- package/browser/esm/{DpJqkBHKECEClAah.mjs → C2gkPo-K972JVp5g.mjs} +6 -6
- package/browser/esm/{BVjzMl2EkoD1ceqn.mjs → CEvGwR40Y6Ef-WDe.mjs} +7 -7
- package/browser/esm/{BLiRvSBEJD-6dWH0.mjs → Cb9SB2mI9VqoMLgo.mjs} +1 -1
- package/browser/esm/{BIQXdDApQqsa7WWH.mjs → CsT1vXKI_o6hLmzM.mjs} +1 -1
- package/browser/esm/D0WM4vskQ31-MkSX.mjs +1467 -0
- package/browser/esm/{QNCUQO7a-oixacNG.mjs → D5FRlmQmwf6Y4j_G.mjs} +1 -1
- package/browser/esm/{0qppnWkLyeMGOizg.mjs → DEorp4Rd9a565r_h.mjs} +1 -1
- package/browser/esm/{q1cTyqrb2yKNSDq5.mjs → DHvI-gSNOpEkZS0_.mjs} +170 -169
- package/browser/esm/{Dy7xNyqd4jfUcj2t.mjs → DK4TrH-nckKO9Q9L.mjs} +1 -1
- package/browser/esm/DMOlhSnOh4hHXiw0.mjs +52 -0
- package/browser/esm/{B1fKMAH-vx3TJ0ii.mjs → DQwg0nFQOuoWa9vC.mjs} +1 -1
- package/browser/esm/{BXvDIYhOIHqmZQQo.mjs → DVEcYvO4EkDBk4FX.mjs} +1 -1
- package/browser/esm/{CE3LjR3RfccnMUQt.mjs → DdsrrZg_d16qXBaF.mjs} +13 -13
- package/browser/esm/{BCiGYy5wMbcNSF3g.mjs → DhJgaHDvhGW9Q-Jd.mjs} +1 -1
- package/browser/esm/{PbEXrCdkQc02gfVZ.mjs → Dr-hrT0HVZs3fkdF.mjs} +10 -10
- package/browser/esm/{DTW06ga7BIWfkpc3.mjs → Drjhq-zlZ3HTK_ZI.mjs} +11 -10
- package/browser/esm/{CTdZQdi5BoNPu7rZ.mjs → Dw7dYD6MrvZb3WPh.mjs} +65 -65
- package/browser/esm/{DJVGX60ly4BfiFse.mjs → DzW551wAkGdUKn1f.mjs} +44 -43
- package/browser/esm/{DrzfnYtbTkZ0Vztm.mjs → XSaSkbiadpjvNPF-.mjs} +2 -2
- package/browser/esm/index.mjs +74 -73
- package/browser/esm/{B0k5xuPgYO9B-vto.mjs → q-qojAI33CqmRx77.mjs} +16 -16
- package/licenses/dependencies.txt +156 -178
- package/node/esm/{cT4-HbwV7TBlRjja.mjs → 0VUK_26rxW-1p-no.mjs} +276 -275
- package/node/esm/{BiiNcUkTIcWxOabS.mjs → B4Eo0tFRg7GybYQq.mjs} +2 -2
- package/node/esm/B6na2FpIb2N8_BII.mjs +25 -0
- package/node/esm/{tk69oRoeZHf4vk1z.mjs → BCqh-sztmdgZm9pd.mjs} +13 -13
- package/node/esm/{fENiUIb3u1Oy7Amv.mjs → BNhJrLEKwde0o2dg.mjs} +8 -8
- package/node/esm/{Cd5wE06_wa41Z6Wt.mjs → BQWO9jQkGVXLYnCK.mjs} +12 -12
- package/node/esm/{BvOnjWMz5o3z-qWe.mjs → BUDeEhnsn9-yrQlE.mjs} +1 -1
- package/node/esm/{CZlpZhqzgcRkv_bX.mjs → BXZpU4qRYF5maAg0.mjs} +9 -9
- package/node/esm/{D4ydLNNfUH8D41A7.mjs → BexDrSYf11he63De.mjs} +1 -1
- package/node/esm/{BnbhKW27rQ185mOb.mjs → BiU1UyUrEkNS9WeH.mjs} +2 -2
- package/node/esm/{Br_lQeehvACsDkzu.mjs → C53eiTE5QbclOU-x.mjs} +13 -12
- package/node/esm/{CBlVCA0uvCwlok1v.mjs → C63AwhK2bi3nQ-qh.mjs} +1 -1
- package/node/esm/{DbzTWKX0Q8SGsGA4.mjs → CJzMybL2SEMDl1Nw.mjs} +29 -29
- package/node/esm/{zQ0ozpm04cC2OG19.mjs → CKS2ltb4Bv_q8qad.mjs} +22 -22
- package/node/esm/{C0eiYtK0Lkx4fQGc.mjs → CZtyxHtVSnQOWUIw.mjs} +86 -85
- package/node/esm/{6L7TnSLCvI3zabFK.mjs → CvxTDOd3lLLowV8Z.mjs} +24 -23
- package/node/esm/DQv4OOMysHEA_ih5.mjs +553 -0
- package/node/esm/{CI3U9rEYT3a_Biw5.mjs → D_wrbdHZwcqLBmob.mjs} +1 -1
- package/node/esm/{BY1cZ8MXawge5drQ.mjs → Dca0ee8jhGRibBhk.mjs} +2 -2
- package/node/esm/{Ro_fz9s3_2DHfiE-.mjs → DpB6jqJa5heTZlo1.mjs} +1 -1
- package/node/esm/{CZA-oIez6io5vwv1.mjs → DrgN5wWkYF1hgIK3.mjs} +1 -1
- package/node/esm/DuL4Zvdz5hbTWC1z.mjs +308 -0
- package/node/esm/index.mjs +12885 -41674
- package/node/esm/{D6wjzUXEh-Q71uoB.mjs → mEXgu7-CAzFc23RE.mjs} +2 -2
- package/package.json +8 -8
- package/browser/cjs/BAGEDalcFwfUrDOV.cjs +0 -6
- package/browser/cjs/BMcvveT3JniLuWWw.cjs +0 -6
- package/browser/cjs/B_JRx-UyLNBI8Jr9.cjs +0 -6
- package/browser/cjs/BbCINWmJNJ1UoABX.cjs +0 -6
- package/browser/cjs/BdPTNgv6BQFiJXiH.cjs +0 -238
- package/browser/cjs/BgqUvcQGSrZtIsnp.cjs +0 -6
- package/browser/cjs/Bub0lBbzpOagYy-6.cjs +0 -12
- package/browser/cjs/BvV0mrFKi8cdsSFF.cjs +0 -6
- package/browser/cjs/BxCxDRRwMVIA9T0Q.cjs +0 -6
- package/browser/cjs/BxbbUhKRSHRfeoNL.cjs +0 -32
- package/browser/cjs/C3RxbodVdJ0MR0eY.cjs +0 -11
- package/browser/cjs/C4zc2Ll270E135fR.cjs +0 -6
- package/browser/cjs/CEkRIfptK2yyy4PS.cjs +0 -6
- package/browser/cjs/CGp4fzG2ZIsJmB72.cjs +0 -6
- package/browser/cjs/CT5f8xMCNbOhih6R.cjs +0 -12
- package/browser/cjs/CV6WjeLkZrGoM4SB.cjs +0 -6
- package/browser/cjs/CZA_Av5pG0M1RgJK.cjs +0 -6
- package/browser/cjs/Ca6YJnV2DBQrqx0b.cjs +0 -124
- package/browser/cjs/Ci7CqdgErq0IGcl5.cjs +0 -6
- package/browser/cjs/CmROQEOLO7s-rzZW.cjs +0 -6
- package/browser/cjs/Cnc0-T-tLmqyX7Mq.cjs +0 -6
- package/browser/cjs/Ct6nh7ILtW_PHbB3.cjs +0 -6
- package/browser/cjs/CtmTxxgCijL1ZuPa.cjs +0 -6
- package/browser/cjs/CyUaP6X--CmuILoU.cjs +0 -6
- package/browser/cjs/D598Bk4npBA6UESy.cjs +0 -6
- package/browser/cjs/D7asEaPB97YVwe1v.cjs +0 -6
- package/browser/cjs/D9lDObZe3CkEPPGI.cjs +0 -6
- package/browser/cjs/DFrTuKkfDctye00L.cjs +0 -7
- package/browser/cjs/DNquPukGj-6iRmmP.cjs +0 -13
- package/browser/cjs/DOXD9gLvRI-UN_9l.cjs +0 -6
- package/browser/cjs/DRhcrHz-whpKmHXb.cjs +0 -6
- package/browser/cjs/DdBygPkI15syG3qE.cjs +0 -1501
- package/browser/cjs/DrgfA0AIigevE5fO.cjs +0 -15
- package/browser/cjs/DyjUI4ZuHoE2UtYP.cjs +0 -6
- package/browser/cjs/Ou0ysDOtKXD_MCyi.cjs +0 -6
- package/browser/cjs/Tkr7WOf1Km7F6jc1.cjs +0 -6
- package/browser/cjs/Ui6MyVXLy4hSZZln.cjs +0 -6
- package/browser/cjs/ZSSSnynZ-cYurCZ4.cjs +0 -6
- package/browser/cjs/hDl6HNkylTvv-qT3.cjs +0 -6
- package/browser/cjs/tLWq6abRGIT6oIrd.cjs +0 -6
- package/browser/cjs/xS50A4hbimnAA3g8.cjs +0 -6
- package/browser/esm/6qF6HMFmVJEMu5ze.mjs +0 -10
- package/browser/esm/91ZejdYNSNvEQyri.mjs +0 -43655
- package/browser/esm/B6KWiZxcJDzPKz7A.mjs +0 -10
- package/browser/esm/BGfz8kkDQwuckxnU.mjs +0 -10
- package/browser/esm/BNWWT7cxdCiMaWFC.mjs +0 -10
- package/browser/esm/BSB3k2C-vxhRI9pk.mjs +0 -5582
- package/browser/esm/Baiv07hkxLIkAcoq.mjs +0 -10
- package/browser/esm/Bc6K-JiRW1SodxIq.mjs +0 -10
- package/browser/esm/BpfyDNlbLX4dOPvj.mjs +0 -24
- package/browser/esm/Bs0RJigDhPR1WzFT.mjs +0 -21
- package/browser/esm/BtP3Wpc2YRk8W2KZ.mjs +0 -12
- package/browser/esm/BwWIlZYqfL7BAjSI.mjs +0 -10
- package/browser/esm/C7YTh7Sm32Nt_Kv5.mjs +0 -10
- package/browser/esm/CE1gssQmn8QAeBEI.mjs +0 -10
- package/browser/esm/CE3vBPdWXPf3M3h2.mjs +0 -51
- package/browser/esm/CJigh9OXZ04sdTLc.mjs +0 -1466
- package/browser/esm/CLHgqHwohIYlAAUF.mjs +0 -472
- package/browser/esm/CTuGnJMMNAi4EKiy.mjs +0 -10
- package/browser/esm/CUZmKq_NPR_OCibb.mjs +0 -10
- package/browser/esm/ChIE2YGkU9_cnmDj.mjs +0 -10
- package/browser/esm/Cv8VSqfWEaftgiTH.mjs +0 -10
- package/browser/esm/CvJUNcDyz497Gxl7.mjs +0 -10
- package/browser/esm/D2OQwThnobBdsQ1x.mjs +0 -3934
- package/browser/esm/D73ljnqYKCXMdyPd.mjs +0 -1575
- package/browser/esm/DAPWMPwVGQJsblPQ.mjs +0 -10
- package/browser/esm/Dsu3RRvUfCUWRZ6q.mjs +0 -10
- package/browser/esm/DxEtUnQEyEYWuqL7.mjs +0 -820
- package/browser/esm/Dxrje6uVvr2LGdV7.mjs +0 -10
- package/browser/esm/JMr0jtu67PC8clGf.mjs +0 -10
- package/browser/esm/QhTxW6tFl-So20AH.mjs +0 -425
- package/browser/esm/_tXPsCW6hHTdj45y.mjs +0 -10
- package/browser/esm/bJWg5_Jxjizyivdn.mjs +0 -29
- package/browser/esm/cVH-KYzKaUP4C3dh.mjs +0 -10
- package/browser/esm/cp8pKSzbJqh-zBtd.mjs +0 -10
- package/browser/esm/dmuee2Is7r5Q4B3M.mjs +0 -10
- package/node/esm/0CbEJyCpbWyFHdK1.mjs +0 -4002
- package/node/esm/6qF6HMFmVJEMu5ze.mjs +0 -10
- package/node/esm/A5WewF_ecyRMfEW9.mjs +0 -80
- package/node/esm/B0rQMzpUsBE47H-k.mjs +0 -10
- package/node/esm/B3TBImEZBAbKsEAq.mjs +0 -10
- package/node/esm/B6KWiZxcJDzPKz7A.mjs +0 -10
- package/node/esm/B8tFaB-W9JcM6xhy.mjs +0 -29
- package/node/esm/BGfz8kkDQwuckxnU.mjs +0 -10
- package/node/esm/BKb0zrP-OexxgIYb.mjs +0 -24
- package/node/esm/BNWWT7cxdCiMaWFC.mjs +0 -10
- package/node/esm/BQBHsnvwWPo5kQhy.mjs +0 -10
- package/node/esm/BZTLlsc-NvE1_mTb.mjs +0 -555
- package/node/esm/Baiv07hkxLIkAcoq.mjs +0 -10
- package/node/esm/Bc6K-JiRW1SodxIq.mjs +0 -10
- package/node/esm/BiVFM0O-4h4yY7oa.mjs +0 -10
- package/node/esm/Bq-gS5qqB1Jrllm2.mjs +0 -307
- package/node/esm/Bv7SpuMBfsaGEFxP.mjs +0 -16
- package/node/esm/BwWIlZYqfL7BAjSI.mjs +0 -10
- package/node/esm/C0qF-AAqNGDMeSVO.mjs +0 -813
- package/node/esm/CE1gssQmn8QAeBEI.mjs +0 -10
- package/node/esm/CUZmKq_NPR_OCibb.mjs +0 -10
- package/node/esm/ChIE2YGkU9_cnmDj.mjs +0 -10
- package/node/esm/CvJUNcDyz497Gxl7.mjs +0 -10
- package/node/esm/DAPWMPwVGQJsblPQ.mjs +0 -10
- package/node/esm/DJtTsiROzkkD2wRx.mjs +0 -5642
- package/node/esm/DLEDFraKFWvZtfvX.mjs +0 -10
- package/node/esm/DNYPU79SNlXuHN8j.mjs +0 -10
- package/node/esm/DjhMNAleaI3hhcHG.mjs +0 -13
- package/node/esm/DtUFCYSrTGcBjdBN.mjs +0 -453
- package/node/esm/Dxrje6uVvr2LGdV7.mjs +0 -10
- package/node/esm/EebvqIVFwWH3slRt.mjs +0 -14
- package/node/esm/cVH-KYzKaUP4C3dh.mjs +0 -10
- package/node/esm/cp8pKSzbJqh-zBtd.mjs +0 -10
- package/node/esm/dmuee2Is7r5Q4B3M.mjs +0 -10
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.3.5
|
|
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 r, { forwardRef as n, useState as a, useCallback as s, memo as i, createElement as l, useMemo as c, useRef as d, useEffect as p, useLayoutEffect as m } from "react";
|
|
9
|
+
import h from "clsx";
|
|
10
|
+
import { mergeRefs as u } from "react-merge-refs";
|
|
11
|
+
import { ErrorBoundary as k } from "react-error-boundary";
|
|
12
|
+
import { useSnackbar as g, SnackbarContent as b, SnackbarProvider as f } from "notistack";
|
|
13
|
+
import { useTheme as w, ThemeProvider as x } from "@mui/material/styles/index.js";
|
|
14
|
+
import { Card as y, CardActions as C, Typography as M, IconButton as W, Collapse as v, Box as L, SvgIcon as S, CssBaseline as E } from "@mui/material";
|
|
15
|
+
import { PartialError as D, CommonUtils as F, UndoManager as T, Workbook as O } from "@sheetxl/sdk";
|
|
16
|
+
import { _ as I, P, Z as A, q as N, t as j, F as R, p as _, W as U, k as H, WorkbookIO as G, X as K, U as z, O as $, a as q, N as B, Q as V, r as X, i as Z, V as J, AppearanceCommandButton as Q, e as Y, b as ee, E as oe, j as te, c as re, d as ne, useResolvedThemeMode as ae, ThemeMode as se, u as ie, y as le, w as ce, S as de, z as pe, x as me, HelpCommandButton as he, f as ue, g as ke, B as ge, h as be, WorkbookTitle as fe, WorkbookElement as we, M as xe, l as ye } from "./index.mjs";
|
|
17
|
+
import { useMeasure as Ce } from "react-use";
|
|
18
|
+
import { ExpandMore as Me, Close as We, CancelOutlined as ve } from "@mui/icons-material";
|
|
19
|
+
const Le = { card: "_card_1a398_7", actionRoot: "_actionRoot_1a398_11", icons: "_icons_1a398_16", expand: "_expand_1a398_22", expandOpen: "_expandOpen_1a398_29", stackTraceContainer: "_stackTraceContainer_1a398_33" }, Se = n((t2, r2) => {
|
|
20
|
+
const { id: n2, message: i2, iconVariant: l2, error: c2, hideIconVariant: d2, ...p2 } = t2, { closeSnackbar: m2 } = g(), u2 = w(), [k2, f2] = a(false), x2 = s(() => {
|
|
21
|
+
f2((e2) => !e2);
|
|
22
|
+
}, []), L2 = s(() => {
|
|
23
|
+
m2(n2);
|
|
24
|
+
}, [n2, m2]), S2 = c2?.message || String(i2);
|
|
25
|
+
return e(b, { ref: r2, className: h(Le.root, "error-snackbar"), children: o(y, { className: Le.card, style: { backgroundColor: u2.palette.error.dark, border: `1px solid ${u2.palette.error.dark}` }, children: [o(C, { className: Le.actionRoot, children: [d2 ? null : l2?.error, e(M, { variant: "body2", component: "div", className: Le.typography, style: { color: u2.palette.text.primary }, children: S2 }), e("div", { style: { flex: "1 1 auto" } }), o("div", { className: Le.icons, children: [c2 ? e(W, { "aria-label": "Show more", size: "small", className: h(Le.expand, { [Le.expandOpen]: k2 }), style: { color: u2.palette.action.active }, onClick: x2, children: e(Me, {}) }) : null, e(W, { size: "small", className: Le.expand, style: { color: u2.palette.action.active }, onClick: L2, children: e(We, { fontSize: "small" }) })] })] }), c2 ? e(v, { in: k2, timeout: "auto", unmountOnExit: true, children: e("div", { className: Le.stackTraceContainer, style: { backgroundColor: u2.palette.error.light, borderTop: `1px solid ${u2.palette.error.main}` }, children: e(I, { error: c2, hideLineNumbers: true }) }) }) : null] }) });
|
|
26
|
+
});
|
|
27
|
+
Se.displayName = "ToastError";
|
|
28
|
+
const Ee = i(n((r2, n2) => {
|
|
29
|
+
const { commands: a2, commandHook: s2, scope: i2 = "workbook", disabled: c2 = false, ...d2 } = r2, p2 = P((r3) => {
|
|
30
|
+
const n3 = { variant: j.Menuitem, parentFloat: r3.floatReference, commandHook: s2, scope: i2, disabled: c2 }, d3 = o(t, { children: [e(A, { ...n3, command: a2.getCommand("newWorkbook"), icon: N(e(R, {})) }), e(_, { orientation: "horizontal" }), e(A, { ...n3, command: a2.getCommand("openWorkbook"), icon: N(e(U, {})) }), e(H, { ...n3, commands: a2, quickCommand: "saveWorkbook", icon: N(e(q, {})), createPopupPanel: (o2) => {
|
|
31
|
+
const t2 = { ...n3, parentFloat: o2.floatReference, scope: "saveWorkbook" }, r4 = [];
|
|
32
|
+
return G.getWriteFormats().forEach((o3) => {
|
|
33
|
+
if (o3.isDefault) return;
|
|
34
|
+
let n4 = null;
|
|
35
|
+
"CSV" === o3.key ? n4 = N(e(K, {})) : "Excel" === o3.key && (n4 = N(e(z, {})));
|
|
36
|
+
const s3 = a2.getCommand(`saveWorkbookAs${o3.key}`);
|
|
37
|
+
s3 ? r4.push(l(A, { ...t2, key: o3.key, command: s3, icon: n4 })) : console.warn(`Unable to resolve command: 'saveWorkbookAs${o3.key}'`);
|
|
38
|
+
}), $({ ...o2, children: r4, onClick: () => {
|
|
39
|
+
o2.closeFloatAll();
|
|
40
|
+
} });
|
|
41
|
+
} })] });
|
|
42
|
+
return $({ ...r3, children: d3, onClick: (e2) => {
|
|
43
|
+
e2.isDefaultPrevented || r3.closeFloatAll();
|
|
44
|
+
} });
|
|
45
|
+
}, [c2, a2, s2, i2]), m2 = "File";
|
|
46
|
+
return e(H, { commands: a2, disabled: c2, 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 }) });
|
|
47
|
+
}));
|
|
48
|
+
Ee.displayName = "StandaloneFileCommandButton";
|
|
49
|
+
const De = e(Z, { label: "SheetXL", description: "Visit me at sheetxl.com.", children: e(L, { sx: { width: "24px", height: "24px", marginBottom: "4px", marginLeft: "6px" }, children: e(J, { onClick: () => {
|
|
50
|
+
window?.open("https://www.sheetxl.com", "_blank");
|
|
51
|
+
}, style: { width: "24px", height: "24px", cursor: "pointer" } }) }) }), Fe = i(n((t2, r2) => {
|
|
52
|
+
const { commands: n2, workbook: a2, logo: s2 = De, mainElement: i2, showFileMenu: l2 = true, showAppearanceMenu: p2 = true, ...m2 } = t2, { reference: h2 } = V(), [k2, { width: g2 }] = Ce(), b2 = g2 < 530, f2 = l2 ? e(Ee, { commands: n2, commandHook: { beforeExecute() {
|
|
53
|
+
h2?.closeAll();
|
|
54
|
+
}, onError(e2, o2, t3) {
|
|
55
|
+
} } }) : null, w2 = p2 ? e(Q, { commands: n2, commandHook: { beforeExecute() {
|
|
56
|
+
h2?.closeAll();
|
|
57
|
+
}, onError(e2, o2, t3) {
|
|
58
|
+
} } }) : null, x2 = c(() => ({ paddingLeft: (e2) => e2.spacing(1), paddingRight: (e2) => e2.spacing(1) }), []), y2 = d(null);
|
|
59
|
+
return e(L, { ref: u([y2, k2, r2]), ...m2, children: X({ commands: n2, renderCompact: b2, workbook: a2, selectWrapper: (t3) => o(L, { 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(L, { sx: { display: "flex", flexDirection: "row", alignItems: "center", flex: "1 1 100%", gap: (e2) => e2.spacing(0.5) }, children: [s2, o(L, { sx: { display: "flex", flexDirection: "row", alignItems: "center", gap: (e2) => e2.spacing(0.25) }, children: [f2, t3] })] }), e(L, { sx: { display: "flex", flexDirection: "row", flex: "1 1 300%", overflow: "hidden", alignItems: "center", justifyContent: "center" }, children: i2 }), e(L, { sx: { display: "flex", alignItems: "center", justifyContent: "end", flex: b2 && !w2 ? "0 0 auto" : "1 1 100%" }, children: w2 })] }), selectProps: x2, toolbarsProps: { Home: { sx: {} } } }) });
|
|
60
|
+
}));
|
|
61
|
+
Fe.displayName = "StandaloneWorkbookToolbar";
|
|
62
|
+
const Te = i(n((n2, i2) => {
|
|
63
|
+
const { workbook: l2, setWorkbook: m2, refWorkbookTitle: h2, titleWorkbook: u2, setWorkbookTitle: k2, titlePlaceHolder: b2, children: f2, undoManager: w2, commands: x2, importExportDisabled: y2, themeModeOptions: C2 } = n2, M2 = g(), v2 = M2 ? M2.enqueueSnackbar : () => {
|
|
64
|
+
}, L2 = M2 ? M2.closeSnackbar : () => {
|
|
65
|
+
}, [S2, E2] = a({ isMounted: false, label: null, starting: /* @__PURE__ */ new Map(), running: /* @__PURE__ */ new Map() }), F2 = s(() => {
|
|
66
|
+
E2((e2) => ({ ...e2, isMounted: true }));
|
|
67
|
+
}, []), T2 = s(() => {
|
|
68
|
+
E2((e2) => ({ ...e2, isMounted: false }));
|
|
69
|
+
}, []), O2 = le(), I2 = ce(), A2 = de(), N2 = d(/* @__PURE__ */ new Set()), j2 = c(() => {
|
|
70
|
+
const o2 = (o3, t2) => {
|
|
71
|
+
if (t2?.onceKey) {
|
|
72
|
+
if (N2.current.has(t2.onceKey)) return;
|
|
73
|
+
const e2 = new Set(N2.current);
|
|
74
|
+
e2.add(t2.onceKey), N2.current = e2;
|
|
75
|
+
}
|
|
76
|
+
const r2 = { variant: t2?.type ?? ue.Info, anchorOrigin: { vertical: "top", horizontal: "center" }, preventDuplicate: t2?.preventDuplicate, persist: t2?.persist ?? t2?.type === ue.Error, action: (o4) => e(W, { onClick: () => L2(o4), children: e(ve, {}) }) };
|
|
77
|
+
t2?.enqueueProps && Object.assign(r2, t2.enqueueProps), o3 || console.log("message is 'null'", t2), v2(o3 ?? "Alert", r2);
|
|
78
|
+
};
|
|
79
|
+
return { showMessage: o2, showBusy: (e2, o3) => {
|
|
80
|
+
let t2 = null;
|
|
81
|
+
const r2 = new Promise((e3) => {
|
|
82
|
+
t2 = e3;
|
|
83
|
+
});
|
|
84
|
+
return E2((o4) => {
|
|
85
|
+
const n3 = new Map(o4.starting);
|
|
86
|
+
n3.set(r2, t2);
|
|
87
|
+
return { ...o4, label: e2, starting: n3 };
|
|
88
|
+
}), r2;
|
|
89
|
+
}, showWindow: (e2, o3, t2) => {
|
|
90
|
+
const r2 = { ...o3, onKeyDown: (e3) => {
|
|
91
|
+
x2?.dispatchToFocusedCommand(e3), e3.isDefaultPrevented() || e3.isPropagationStopped() || o3?.onKeyDown?.(e3);
|
|
92
|
+
} };
|
|
93
|
+
return O2(e2, { sort: () => import("./B6na2FpIb2N8_BII.mjs"), numberFormat: () => import("./C53eiTE5QbclOU-x.mjs"), hyperlink: () => import("./BiU1UyUrEkNS9WeH.mjs"), comments: () => import("./mEXgu7-CAzFc23RE.mjs"), find: () => import("./CvxTDOd3lLLowV8Z.mjs"), tableDetails: () => import("./CJzMybL2SEMDl1Nw.mjs"), tableNew: () => import("./BNhJrLEKwde0o2dg.mjs"), namedDetails: () => import("./BCqh-sztmdgZm9pd.mjs") }[e2], r2, t2);
|
|
94
|
+
}, showOptions: I2, showInputOptions: A2, showError: (e2) => {
|
|
95
|
+
let t2, r2 = ue.Error, n3 = "Unknown Error";
|
|
96
|
+
"string" == typeof e2 ? n3 = e2 : e2 instanceof Error && (t2 = e2, e2.message && (n3 = e2.message)), e2 instanceof D && (r2 = ue.Info), o2(n3, { type: r2, enqueueProps: { error: t2 } });
|
|
97
|
+
} };
|
|
98
|
+
}, []), R2 = s(() => {
|
|
99
|
+
}, []), _2 = ((e2) => {
|
|
100
|
+
const { workbook: o2, setWorkbook: t2, importExportDisabled: n3, workbookTitle: a2 = "export", setWorkbookTitle: i3, notifier: l3, requestWorkbookTitle: d2, themeModeOptions: m3, undoManager: h3, commands: u3, onExecute: k3 } = e2, g2 = P(m3?.onForceModeChange, [m3?.onForceModeChange]), b3 = P(m3?.onForceLightGridChange, [m3?.onForceLightGridChange]), f3 = P(m3?.onForceLightImagesChange, [m3?.onForceLightImagesChange]), w3 = P(async (e3 = null, o3 = null) => {
|
|
101
|
+
const t3 = [];
|
|
102
|
+
let r2, n4 = null, a3 = null;
|
|
103
|
+
if ("string" == typeof e3 ? a3 = e3 : n4 = e3, r2 = n4 ? e3 : await Y.openFileDialog(a3 ?? G.getAllReadFormatTypeAsString().join(",")), !r2) return null;
|
|
104
|
+
const s2 = { source: r2, constructorOptions: o3, onWarning: (e4) => {
|
|
105
|
+
t3.push(e4);
|
|
106
|
+
} }, i4 = await G.read(s2, l3);
|
|
107
|
+
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;
|
|
108
|
+
}, [k3, l3, o2]), x3 = P(async (e3, o3, t3) => {
|
|
109
|
+
if (!o3 && d2) {
|
|
110
|
+
const o4 = await d2("Enter Workbook name to " + (t3.isDefault ? "Save." : `Export as ${t3.description}.`));
|
|
111
|
+
return null !== o4 && G.writeFile(o4, e3, { formatType: t3.key });
|
|
112
|
+
}
|
|
113
|
+
return G.writeFile(o3, e3, { formatType: t3.key });
|
|
114
|
+
}, [l3, o2, d2]), y3 = s(() => ({ contains: (e3) => true, focus() {
|
|
115
|
+
} }), []), C3 = c(() => {
|
|
116
|
+
const e3 = [];
|
|
117
|
+
n3 || (G.getWriteFormats().forEach((t3) => {
|
|
118
|
+
const r3 = t3.isDefault, n4 = { label: r3 ? "Save Workbook" : `Save Workbook as ${t3.description}`, scopedLabels: { workbook: "Save", saveWorkbook: `as ${t3.description}` }, tags: t3.tags, description: `Save the workbook to the desktop${r3 ? "" : ` as ${t3.description}`}.` };
|
|
119
|
+
r3 && (n4.shortcut = { key: "S", modifiers: [oe.Ctrl] }, e3.push(new ee("saveWorkbookAs", y3, { label: "Save Workbook As…", scopedLabels: { workbook: "Save as…", saveWorkbook: "as…" }, shortcut: [{ key: "S", modifiers: [oe.Shift, oe.Ctrl] }, { key: "F12" }], description: "Save the workbook to the desktop with the provided name." }, () => {
|
|
120
|
+
x3(o2, null, t3).catch((e4) => {
|
|
121
|
+
l3?.showError?.(e4);
|
|
122
|
+
});
|
|
123
|
+
})));
|
|
124
|
+
const s2 = r3 ? "saveWorkbook" : `saveWorkbookAs${t3.key}`;
|
|
125
|
+
e3.push(new ee(s2, y3, n4, (e4) => {
|
|
126
|
+
x3(o2, e4 ?? a2, t3).catch((e5) => {
|
|
127
|
+
l3?.showError?.(e5);
|
|
128
|
+
});
|
|
129
|
+
}));
|
|
130
|
+
}), e3.push(new ee("openWorkbook", y3, { label: "Open Workbook…", scopedLabels: { workbook: "Open…" }, description: "Open a workbook from the desktop.", shortcut: { key: "O", modifiers: [oe.Ctrl] } }, async (e4 = null) => {
|
|
131
|
+
const r3 = { date1904: o2.isDate1904(), ...o2.options };
|
|
132
|
+
try {
|
|
133
|
+
const n4 = await w3(e4, r3);
|
|
134
|
+
if (!n4) return;
|
|
135
|
+
const a3 = n4.title, s2 = n4.workbook, c2 = s2.getSelectedSheet();
|
|
136
|
+
if ("text/csv" === n4.formatType.mimeType) {
|
|
137
|
+
const e5 = o2.findValidSheetName(a3);
|
|
138
|
+
await o2.doBatch(async () => {
|
|
139
|
+
const t3 = c2.getUsedRange();
|
|
140
|
+
if (!t3) return void l3?.showMessage("The file appears to be blank.");
|
|
141
|
+
const r4 = o2.getSheets().add({ name: e5, autoSelect: true }).getRange({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 });
|
|
142
|
+
await r4.copyFrom(t3);
|
|
143
|
+
}, `Import CSV '${a3}'`);
|
|
144
|
+
} else o2?.close(), i3?.(a3), t2(s2);
|
|
145
|
+
} catch (e5) {
|
|
146
|
+
l3?.showError?.(e5);
|
|
147
|
+
}
|
|
148
|
+
})), e3.push(new ee("openWorkbookFromUrl", y3, { label: "Open Workbook From Web", scopedLabels: { insert: "From Web", workbook: "From Web…" }, description: "Open a workbook from the web." }, async function(e4) {
|
|
149
|
+
if (!e4) {
|
|
150
|
+
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"] });
|
|
151
|
+
if ("Open" !== o3.option) return;
|
|
152
|
+
e4 = o3.input;
|
|
153
|
+
}
|
|
154
|
+
e4 && console.log("openWorkbookFromUrl", e4);
|
|
155
|
+
})));
|
|
156
|
+
let r2 = [];
|
|
157
|
+
return m3 && (r2 = [new ee("themeMode", y3, { label: "Light/Dark Mode", scopedLabels: { appearance: "Light/Dark Mode" }, description: "Toggle the application styling between light and dark mode." }), new ee("defaultThemeMode", y3, { 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 ee("forceLightGrid", y3, { label: "Force Light Grid", description: "Force the grid to always render in light 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 ee("forceLightImages", y3, { label: "Force Light Images", description: "Force the images to always render in light 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, ...r2, new te("help", y3, { label: "Show Help", description: "Provide Help.", shortcut: { key: "F1" } }, () => {
|
|
158
|
+
}), new te("showKeyboardShortcuts", y3, { label: "Keyboard Shortcuts", description: "Show keyboard shortcuts.", shortcut: { key: "/", modifiers: [oe.Ctrl] } }, () => {
|
|
159
|
+
}), new ee("gotoUrlGithub", y3, { label: "Github", description: "Download examples, explore source code, and leave a star." }, () => {
|
|
160
|
+
window?.open("https://github.com/sheetxl/sheetxl");
|
|
161
|
+
}), new ee("gotoUrlDiscord", y3, { label: "Discord", description: "Join our community on discord." }, () => {
|
|
162
|
+
window?.open("https://discord.gg/NTKdwUgK9p");
|
|
163
|
+
}), new ee("gotoUrlDocumentation", y3, { label: "Documentation", description: "Read the documentation." }, () => {
|
|
164
|
+
window?.open("https://www.sheetxl.com/docs");
|
|
165
|
+
}), new ee("gotoUrlIssue", y3, { label: "Create Issue", description: "Create an issue to identify a bug or a feature request." }, () => {
|
|
166
|
+
window?.open("https://github.com/sheetxl/sheetxl/issues");
|
|
167
|
+
})];
|
|
168
|
+
}, [o2, a2, l3, n3, m3, u3, h3]), M3 = c(() => {
|
|
169
|
+
let e3 = null;
|
|
170
|
+
return e3 = u3 ? u3.createChildGroup(y3, "standaloneWorkbook", false) : new re(y3, "standaloneWorkbook"), e3.addCommands(C3, true), e3;
|
|
171
|
+
}, [u3, C3]);
|
|
172
|
+
ne({ manager: h3, commands: M3, notifier: l3 });
|
|
173
|
+
const { themeMode: W2 } = ae();
|
|
174
|
+
p(() => {
|
|
175
|
+
if (!m3 || !M3) return;
|
|
176
|
+
const e3 = "dark" === m3.forceMode || !m3.forceMode && "dark" === W2;
|
|
177
|
+
M3.getCommand("themeMode").update({ state: m3.forceMode ?? null, label: e3 ? "Dark Mode" : "Light Mode", scopedLabels: { appearance: e3 ? "Dark Mode" : "Light Mode" } }).updateCallback(() => {
|
|
178
|
+
g2(e3 ? se.Light : se.Dark);
|
|
179
|
+
}), M3.getCommand("defaultThemeMode").update({ state: !m3.forceMode }).updateCallback(() => {
|
|
180
|
+
g2(null);
|
|
181
|
+
}), M3.getCommand("forceLightGrid").update({ state: m3.forceLightGrid }).updateCallback(() => {
|
|
182
|
+
b3(!m3.forceLightGrid);
|
|
183
|
+
}), M3.getCommand("forceLightImages").update({ state: m3.forceLightImages }).updateCallback(() => {
|
|
184
|
+
f3(!m3.forceLightImages);
|
|
185
|
+
});
|
|
186
|
+
}, [W2, m3, C3]);
|
|
187
|
+
const { showModal: v3 } = ie();
|
|
188
|
+
return p(() => {
|
|
189
|
+
const e3 = () => new Promise((e4, o3) => {
|
|
190
|
+
const t3 = r.lazy(() => import("./BQWO9jQkGVXLYnCK.mjs")), n4 = v3(t3, { title: "Shortcut Keys Reference", commands: M3, onDone: () => {
|
|
191
|
+
n4.hide();
|
|
192
|
+
}, TransitionProps: { onExited: () => {
|
|
193
|
+
e4(true);
|
|
194
|
+
} } });
|
|
195
|
+
});
|
|
196
|
+
M3.getCommand("showKeyboardShortcuts").updateCallback(() => e3()), M3.getCommand("help").updateCallback(() => e3());
|
|
197
|
+
}, [C3, M3]), M3;
|
|
198
|
+
})({ workbook: l2, setWorkbook: m2, importExportDisabled: y2, workbookTitle: u2, setWorkbookTitle: k2, commands: x2, requestWorkbookTitle: (e2) => new Promise((o2) => {
|
|
199
|
+
h2.current ? h2.current.requestWorkbookTitle((e3, t2) => {
|
|
200
|
+
o2(e3);
|
|
201
|
+
}, { selectAll: true, requestReason: e2 }) : o2(b2);
|
|
202
|
+
}), themeModeOptions: C2, undoManager: w2, notifier: j2, onExecute: R2 });
|
|
203
|
+
p(() => {
|
|
204
|
+
S2.starting.size <= 0 || !S2.isMounted || E2((e2) => {
|
|
205
|
+
const o2 = new Map(e2.running);
|
|
206
|
+
e2.starting.forEach((e3, t2) => {
|
|
207
|
+
const r2 = () => {
|
|
208
|
+
E2((e4) => {
|
|
209
|
+
const o3 = new Map(e4.running);
|
|
210
|
+
o3.delete(t2);
|
|
211
|
+
return { ...e4, running: o3 };
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
o2.set(t2, r2), e3(r2);
|
|
215
|
+
});
|
|
216
|
+
return { ...e2, starting: /* @__PURE__ */ new Map(), running: o2 };
|
|
217
|
+
});
|
|
218
|
+
}, [S2]);
|
|
219
|
+
const [U2, H2] = a(null);
|
|
220
|
+
p(() => {
|
|
221
|
+
0 !== S2.starting.size || 0 !== S2.running.size ? H2(e(pe, { icon: e(me, { sx: { transform: "scale(0.7)", marginLeft: "-6px" } }), panel: true, label: S2.label, onMount: F2, onUnmount: T2, sx: { position: "absolute", left: "0", top: "0", width: "100%", height: "100%", zIndex: "9999" } })) : H2(null);
|
|
222
|
+
}, [S2.starting, S2.running]);
|
|
223
|
+
const K2 = c(() => e(he, { commands: _2, disableHover: true, sx: { padding: "0" }, buttonProps: { sx: { maxHeight: "22px" } } }), [_2]), z2 = { notifier: j2, commands: _2 };
|
|
224
|
+
return l2 && (z2.statusBarProps = { childrenEnd: K2 }), o(t, { children: [U2, f2 ? r.cloneElement(f2, z2) : null] });
|
|
225
|
+
}));
|
|
226
|
+
Te.displayName = "SnackbarAndCommandsWrapper";
|
|
227
|
+
const Oe = i(n((t2, r2) => {
|
|
228
|
+
const { className: n2, sx: i2, style: l2, onElementLoad: g2, onError: b2, undoManager: w2, errorPanel: y2 = ke, onKeyDown: C2, workbook: M2, createWorkbookOptions: W2, onWorkbookChange: v2, logo: L2, importExportDisabled: D2 = false, themeModeOptions: I2, autoFocus: A2 = false, commands: N2, title: j2, onTitleChange: R2, titleProps: _2, ...U2 } = t2, H2 = d(null), K2 = P(v2, [v2]), z2 = P(R2 ?? _2?.onTitleChange, [R2 ?? _2?.onTitleChange]), $2 = _2?.placeHolder ?? "Untitled", q2 = I2?.forceMode, { themeMode: B2, source: V2 } = ae({ mode: q2 }), X2 = c(() => ({ ...I2, light: ge(false, F.deepMerge(I2?.theme ?? {}, I2?.light ?? {})), dark: ge(true, F.deepMerge(I2?.theme ?? {}, I2?.dark ?? {})) }), [I2]), Z2 = B2 === se.Dark, [J2, Q2] = a(null);
|
|
229
|
+
p(() => {
|
|
230
|
+
Q2(w2 ?? new T());
|
|
231
|
+
}, [w2]);
|
|
232
|
+
const [Y2, ee2] = a(null), [oe2, te2] = a(null), ne2 = be();
|
|
233
|
+
m(() => {
|
|
234
|
+
if (!M2 || 0 === Object.keys(M2).length && !F.isPromiseLike(M2)) {
|
|
235
|
+
const e2 = { theme: ne2.getDefaultTheme(), ...W2 };
|
|
236
|
+
te2(new O(e2));
|
|
237
|
+
} else te2(M2);
|
|
238
|
+
}, [M2]), m(() => {
|
|
239
|
+
if (!oe2) return;
|
|
240
|
+
if (oe2 instanceof O) return ee2({ workbook: oe2 }), void (M2 !== oe2 && K2?.(oe2));
|
|
241
|
+
(async () => {
|
|
242
|
+
try {
|
|
243
|
+
let e2, o2 = await Promise.resolve(oe2);
|
|
244
|
+
o2 && o2.source && (o2 = await G.read(o2)), o2.workbook ? (me2(o2.title), e2 = o2.workbook) : e2 = o2, K2?.(e2), ee2({ workbook: e2 });
|
|
245
|
+
} catch (e2) {
|
|
246
|
+
K2?.(null), ee2({ error: e2 });
|
|
247
|
+
}
|
|
248
|
+
})();
|
|
249
|
+
}, [oe2]);
|
|
250
|
+
const [ie2, le2] = a(null);
|
|
251
|
+
p(() => {
|
|
252
|
+
if (!J2 || !Y2) return;
|
|
253
|
+
J2.clear();
|
|
254
|
+
const e2 = Y2?.workbook?.getTransactions();
|
|
255
|
+
if (!e2) return;
|
|
256
|
+
return e2.addListener({ onCommitEnd: (o2) => {
|
|
257
|
+
o2.getDescription() ? J2.addUndoOperation({ description: o2.getDescription(), undo: () => (e2.revert(o2.getId()), ie2.source?.focus(), () => {
|
|
258
|
+
e2.restore(o2.getId()), ie2.source?.focus();
|
|
259
|
+
}) }) : console.warn("commit has no description", o2);
|
|
260
|
+
} });
|
|
261
|
+
}, [J2, Y2, ie2]);
|
|
262
|
+
const ce2 = P((e2) => {
|
|
263
|
+
e2 ? J2.setRepeatableOperation({ description: e2.label(), repeat: async () => e2.execute() }) : J2.setRepeatableOperation(null);
|
|
264
|
+
}, [J2]), [de2, me2] = a(j2 ?? _2?.title ?? "");
|
|
265
|
+
p(() => {
|
|
266
|
+
me2(j2 ?? _2?.title ?? "");
|
|
267
|
+
}, [j2 ?? _2?.title]), p(() => {
|
|
268
|
+
z2?.(de2);
|
|
269
|
+
}, [de2]);
|
|
270
|
+
const [he2, ue2] = a(null), Ce2 = c(() => {
|
|
271
|
+
const e2 = () => ({ contains: (e3) => true, focus() {
|
|
272
|
+
} });
|
|
273
|
+
return N2 ? N2.createChildGroup(e2, "application", false) : new re(e2, "application");
|
|
274
|
+
}, [N2]), Me2 = P((e2) => {
|
|
275
|
+
ue2(e2.source.getViewportElement()), le2(e2), Ce2.activate("sheet"), g2?.(e2);
|
|
276
|
+
}, [Ce2]);
|
|
277
|
+
p(() => {
|
|
278
|
+
ie2 && A2 && ie2.source?.focus("object" == typeof A2 ? A2 : void 0);
|
|
279
|
+
}, [ie2]);
|
|
280
|
+
const We2 = d(null), ve2 = s((o2) => {
|
|
281
|
+
let t3 = null;
|
|
282
|
+
return _2?.hidden || (t3 = e(fe, { ..._2, style: { maxWidth: "100%", ..._2?.style }, workbook: H2.current, ref: We2, title: de2, placeHolder: $2, onTitleChange: (e2) => {
|
|
283
|
+
me2(e2);
|
|
284
|
+
} })), e(Fe, { ...o2, logo: L2, mainElement: t3, showFileMenu: !D2, showAppearanceMenu: !!(X2?.onForceLightGridChange || X2?.onForceLightImagesChange || X2?.onForceModeChange) });
|
|
285
|
+
}, [L2, de2, _2, X2, D2, Ce2]);
|
|
286
|
+
p(() => {
|
|
287
|
+
const e2 = (e3) => e3.preventDefault();
|
|
288
|
+
return H2.current?.addEventListener("wheel", e2, { passive: false }), () => {
|
|
289
|
+
H2.current?.removeEventListener("wheel", e2);
|
|
290
|
+
};
|
|
291
|
+
}, []);
|
|
292
|
+
const Le2 = c(() => e(pe, { transparentBackground: true, sx: i2, style: l2 }), [i2, l2]), Ee2 = s(({ error: o2 }) => (b2?.(o2), e(y2, { sx: i2, style: l2, error: o2 ?? "Unable to display empty workbook." })), [i2, l2, b2]), De2 = c(() => ({ ...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]), Oe2 = u([H2, r2]), Ie = c(() => {
|
|
293
|
+
if (!Y2) return Le2;
|
|
294
|
+
if (Y2.error || !Y2.workbook) return Ee2({ error: Y2.error });
|
|
295
|
+
let o2 = null, t3 = null, r3 = false;
|
|
296
|
+
return X2 && (o2 = Z2 ? X2.dark : X2.light, t3 = Z2 && !X2.forceLightGrid ? X2.dark : X2.light, r3 = X2.forceLightImages), e(we, { sx: De2, style: l2, tabIndex: 0, autoFocus: true, workbook: Y2.workbook, ref: Oe2, renderToolbar: ve2, onElementLoad: Me2, onRepeatCommandChange: ce2, onKeyDown: (e2) => {
|
|
297
|
+
C2?.(e2);
|
|
298
|
+
}, gridTheme: t3, headersTheme: o2, forceLightImages: r3, className: h(n2, "sheetxl-workbook"), onContextMenu: (e2) => e2.preventDefault(), ...U2 }, "WorkbookElement");
|
|
299
|
+
}, [Y2, de2, J2, Le2, X2, U2, ve2, De2]);
|
|
300
|
+
let Pe = e(k, { fallbackRender: Ee2, children: e(f, { maxSnack: 3, domRoot: he2, anchorOrigin: { vertical: "bottom", horizontal: "right" }, autoHideDuration: 3500, onClose: (e2, o2, t3) => {
|
|
301
|
+
H2.current?.focus();
|
|
302
|
+
}, Components: { error: Se }, iconVariant: { success: e(S, { 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(ye, { style: { marginRight: "8px" } }) }, children: e(xe, { children: e(Te, { workbook: Y2?.workbook, setWorkbook: te2, importExportDisabled: D2, titlePlaceHolder: $2, titleWorkbook: de2, setWorkbookTitle: me2, refWorkbookTitle: We2, commands: Ce2, undoManager: J2, themeModeOptions: X2, children: Ie }) }) }) });
|
|
303
|
+
return X2 && (Pe = o(x, { theme: Z2 ? X2.dark : X2.light, children: [X2.cssBaseline ? e(E, {}) : null, Pe] })), Pe;
|
|
304
|
+
}));
|
|
305
|
+
Oe.displayName = "EagerStandaloneWorkbook";
|
|
306
|
+
export {
|
|
307
|
+
Oe as default
|
|
308
|
+
};
|