@sheetxl/studio-mui 0.7.11 → 0.7.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/BAcqVi4z0lEWdogG.cjs +6 -0
- package/browser/cjs/{Dk9NCZiAOD9zzs39.cjs → BXSBqvJbFd1zmXED.cjs} +3 -3
- package/browser/cjs/BXpuqWQiSePSVD7I.cjs +6 -0
- package/browser/cjs/BY_Yr3aQW5hLO-nN.cjs +6 -0
- package/browser/cjs/BankB3sWgfQSVyEv.cjs +20 -0
- package/browser/cjs/{MKXDODFXAmzmh_2S.cjs → BkRzKXHu8z2zghTF.cjs} +2 -2
- package/browser/cjs/CYeknazLzZOjQtcK.cjs +6 -0
- package/browser/cjs/CyLVMzcTgEZPvYOm.cjs +6 -0
- package/browser/cjs/DD9bJC3Knid6T5It.cjs +6 -0
- package/browser/cjs/{rxLo_Ld1Xi-KKL6y.cjs → SQX0Xb9ngHtVWoYW.cjs} +1 -1
- package/browser/cjs/_A_9JrHZzYhVIimw.cjs +7 -0
- package/browser/cjs/gmJVh5GO4raegeQH.cjs +6 -0
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{CFX1xSvjQ7k3GYNy.mjs → BUX-eSzx85xb14z2.mjs} +2 -2
- package/browser/esm/BhK8LG6eLNtnpyM8.mjs +50 -0
- package/browser/esm/{DmBripa50tKiqREL.mjs → Bt5mafuXg0WhvqQl.mjs} +3 -3
- package/browser/esm/CM2aBn9YvLNeeDKP.mjs +26 -0
- package/browser/esm/{Dfg1sHqBfYLAePQR.mjs → CWzQRJNunubg1KYs.mjs} +1 -1
- package/browser/esm/{BUE0z3b78bw14bK3.mjs → C_L0TMqGy3dfJBxX.mjs} +860 -855
- package/browser/esm/{rTUe_Q7TeplDbtPZ.mjs → D3fJ2Y2akXy1Cea2.mjs} +28 -27
- package/browser/esm/DAM5zld1EMvhrTq7.mjs +46 -0
- package/browser/esm/DBreu3Q0z7uri1up.mjs +50 -0
- package/browser/esm/DYbBkU4jsgMfwHKv.mjs +155 -0
- package/browser/esm/DkCrTK-q70GM5ZtY.mjs +53 -0
- package/browser/esm/index.mjs +69 -68
- package/browser/esm/uswYw8_B9PDchitz.mjs +25 -0
- package/licenses/dependencies.txt +142 -142
- package/node/esm/{C2ndkS7Xv8G7tqsJ.mjs → B2g633xDh_bOofUD.mjs} +18 -18
- package/node/esm/{JtXI2INXnATXNbIy.mjs → B2kR5d7yN_btwSPu.mjs} +9 -7
- package/node/esm/{DLB7yLWLF3CYoYgq.mjs → B3fiHsOdyeQ-hH_X.mjs} +1 -1
- package/node/esm/{Bqq76CFUL47Gxzv9.mjs → BCgE2DMn9_S_eSSk.mjs} +13 -13
- package/node/esm/B_WXfCoiTjdjGFTw.mjs +26 -0
- package/node/esm/BjHur-Y2v2kC9PV8.mjs +156 -0
- package/node/esm/CJHoW3AcW0bzWuGz.mjs +52 -0
- package/node/esm/CKgRE7End3PwfjDJ.mjs +25 -0
- package/node/esm/{B220q5iXepGyNhkv.mjs → EtyY49hdotdAcmRj.mjs} +22 -22
- package/node/esm/index.mjs +119 -119
- package/node/esm/{ysEyad2ZFSLz_tlq.mjs → uQbXUzeyLOqo4POP.mjs} +1 -1
- package/package.json +17 -15
- package/types/index.d.ts +4 -2
- package/browser/cjs/6CSKwJbNaX76JrHk.cjs +0 -6
- package/browser/cjs/BVcL3i-jUQBoMe45.cjs +0 -6
- package/browser/cjs/BZgunhyCzDtzqWWh.cjs +0 -6
- package/browser/cjs/C8FVzCzhAJQdB_Oy.cjs +0 -6
- package/browser/cjs/Chm8zWC8ekU1Qug_.cjs +0 -20
- package/browser/cjs/DNznc2i6xg2iIKE9.cjs +0 -6
- package/browser/cjs/DrcPMnvJ8yZx-YWK.cjs +0 -7
- package/browser/cjs/WrGDj1nLC4-sMZKq.cjs +0 -6
- package/browser/esm/A_B51mAtU7xxxYD-.mjs +0 -25
- package/browser/esm/B_3dBo5bkIr0eZVH.mjs +0 -53
- package/browser/esm/BcIL0e_fUxF3JbFD.mjs +0 -46
- package/browser/esm/D_6ik-OgPF7G8sN7.mjs +0 -156
- package/browser/esm/DneV3-mqSBq1-Ies.mjs +0 -26
- package/browser/esm/IM-boc1h29ZmHdvy.mjs +0 -49
- package/node/esm/BTPfATo02Qq6ojW1.mjs +0 -25
- package/node/esm/Bgm2i4z2IS2cPd09.mjs +0 -157
- package/node/esm/CDgzja3zCRKU-fkg.mjs +0 -26
|
@@ -1,51 +1,52 @@
|
|
|
1
1
|
import { jsx as t, jsxs as y } from "react/jsx-runtime";
|
|
2
|
-
import { memo as W, useState as h, useCallback as
|
|
3
|
-
import { alpha as
|
|
2
|
+
import { memo as W, useState as h, useCallback as O, useEffect as G, useMemo as S } from "react";
|
|
3
|
+
import { alpha as i, getOverlayAlpha as p } from "@mui/material/styles";
|
|
4
4
|
import { Box as w, FormControl as D, InputLabel as H, Select as q, TextField as A, Typography as I, MenuItem as J } from "@mui/material";
|
|
5
5
|
import { NumberFormat as n } from "@sheetxl/sdk";
|
|
6
6
|
import { useCallbackRef as c, KeyCodes as Q } from "@sheetxl/utils-react";
|
|
7
7
|
import { OptionsDialog as U } from "@sheetxl/utils-mui";
|
|
8
8
|
/**
|
|
9
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.
|
|
9
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.13
|
|
10
10
|
*
|
|
11
11
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
12
12
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
13
13
|
*/
|
|
14
14
|
const X = ["Ok", "Cancel"], ne = W((P) => {
|
|
15
|
-
const { initialValue: $, context: x, onOption: b, onValidateOption:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const { initialValue: $, context: x, onOption: b, onValidateOption: u, onInput: C, onDone: m, options: v = X, defaultOption: l = v?.[0], cancelOption: d = "Cancel", sx: N, ...M } = P, [o, T] = h($), [V, j] = h(!1), g = O(async (e, a) => !0, []), f = c(async (e) => {
|
|
16
|
+
const a = e === d;
|
|
17
|
+
a || C?.(o, e), b?.(e, a, e === l), m?.();
|
|
18
|
+
}, [o, C, m, b, d, l]), B = c(async (e) => {
|
|
19
|
+
e.keyCode === Q.Enter && await g?.(o, null) !== !1 && f(l);
|
|
20
|
+
}, [o, f]), L = c((e) => {
|
|
20
21
|
T(e.target.value), g?.(e.target.value, null);
|
|
21
|
-
}, [
|
|
22
|
-
let
|
|
22
|
+
}, [u]), R = c(async (e) => {
|
|
23
|
+
let a = await Promise.resolve(u?.(e));
|
|
23
24
|
try {
|
|
24
|
-
|
|
25
|
+
a !== !1 && (a = await Promise.resolve(g?.(o, e)) ?? !0);
|
|
25
26
|
} catch {
|
|
26
27
|
}
|
|
27
|
-
return
|
|
28
|
-
}, [
|
|
28
|
+
return a ?? !0;
|
|
29
|
+
}, [u]), [k, F] = h(n.Styles.lookupStyle(o).formatType ?? n.Type.Custom);
|
|
29
30
|
G(() => {
|
|
30
|
-
|
|
31
|
-
}, [
|
|
31
|
+
F(n.Styles.lookupStyle(o).formatType ?? n.Type.Custom);
|
|
32
|
+
}, [o]);
|
|
32
33
|
const z = S(() => {
|
|
33
|
-
const e = n.Styles.lookupPrimary(),
|
|
34
|
-
return s.push(
|
|
35
|
-
}, []), E =
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const s = n.Styles.lookupDefault(
|
|
34
|
+
const e = n.Styles.lookupPrimary(), a = (r) => t(J, { value: r, children: r }, r), s = Object.keys(e).map((r) => a(e[r].formatType));
|
|
35
|
+
return s.push(a(n.Type.Custom)), s;
|
|
36
|
+
}, []), E = O((e) => {
|
|
37
|
+
const a = e.target.value;
|
|
38
|
+
F(a);
|
|
39
|
+
const s = n.Styles.lookupDefault(a);
|
|
39
40
|
s && T(s);
|
|
40
41
|
}, []), K = S(() => {
|
|
41
|
-
const e = x();
|
|
42
|
-
return e.createTemporaryCell({ value: e.getValue() ?? 12345, style: { numberFormat:
|
|
43
|
-
}, [k,
|
|
44
|
-
return t(U, { title: "Number Format", options: v, onDone:
|
|
42
|
+
const e = x?.();
|
|
43
|
+
return e ? e.createTemporaryCell({ value: e.getValue() ?? 12345, style: { numberFormat: o } }) : null;
|
|
44
|
+
}, [k, o, x]);
|
|
45
|
+
return t(U, { title: "Number Format", options: v, onDone: m, onOption: (e) => f(e), onValidateOption: R, defaultOption: l, cancelOption: d, autoFocusSel: ".autoFocus", sx: { width: "580px", ...N }, ...M, children: y(w, { sx: { paddingTop: (e) => e.spacing(1), paddingBottom: (e) => e.spacing(0), rowGap: (e) => e.spacing(1), display: "flex", flexDirection: "column" }, children: [y(D, { sx: { minWidth: 135 }, size: "small", children: [t(H, { children: "Category" }), t(q, { value: k, label: "Category", onChange: E, sx: { backgroundImage: `linear-gradient(${i("#fff", p(5))}, ${i("#fff", p(5))})` }, children: z })] }), t(D, { sx: { paddingTop: (e) => e.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(A, { label: "Code", onFocus: (e) => {
|
|
45
46
|
V || e.target?.select(), j(!0);
|
|
46
|
-
}, sx: { "& .MuiFormHelperText-root": { marginTop: (e) => e.spacing(0.5) } }, slotProps: { inputLabel: { shrink: !0 }, htmlInput: { className: "autoFocus", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (e) => e.spacing(1.25), paddingBottom: (e) => e.spacing(0.75), backgroundImage: `linear-gradient(${
|
|
47
|
+
}, sx: { "& .MuiFormHelperText-root": { marginTop: (e) => e.spacing(0.5) } }, slotProps: { inputLabel: { shrink: !0 }, htmlInput: { className: "autoFocus", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (e) => e.spacing(1.25), paddingBottom: (e) => e.spacing(0.75), backgroundImage: `linear-gradient(${i("#fff", p(5))}, ${i("#fff", p(5))})` } } }, value: o, onChange: L, onKeyDown: B, onContextMenu: (e) => {
|
|
47
48
|
e.stopPropagation();
|
|
48
|
-
} }) }), y(w, { children: [t(I, { variant: "caption", component: "div", sx: { paddingLeft: (e) => e.spacing(2) }, children: "Preview" }), t(I, { variant: "body2", component: "div", sx: { borderRadius: (e) => `${e.shape.borderRadius}px`, padding: (e) => e.spacing(1), border: (e) => `1px solid ${e.palette.grey[400]}` }, children: K
|
|
49
|
+
} }) }), y(w, { children: [t(I, { variant: "caption", component: "div", sx: { paddingLeft: (e) => e.spacing(2) }, children: "Preview" }), t(I, { variant: "body2", component: "div", sx: { borderRadius: (e) => `${e.shape.borderRadius}px`, padding: (e) => e.spacing(1), border: (e) => `1px solid ${e.palette.grey[400]}` }, children: K?.getNumberFormat().displayText || "(empty)" })] })] }) });
|
|
49
50
|
});
|
|
50
51
|
export {
|
|
51
52
|
ne as NumberFormatDialog,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as r, jsxs as j } from "react/jsx-runtime";
|
|
2
|
+
import { memo as E, useMemo as V, useState as p, useCallback as R } from "react";
|
|
3
|
+
import { Box as L } from "@mui/material";
|
|
4
|
+
import { useCallbackRef as d } from "@sheetxl/utils-react";
|
|
5
|
+
import { OptionsDialog as S } from "@sheetxl/utils-mui";
|
|
6
|
+
import { N as A, R as G } from "./C_L0TMqGy3dfJBxX.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.13
|
|
9
|
+
*
|
|
10
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
11
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
12
|
+
*/
|
|
13
|
+
const M = ["Ok", "Cancel"], Q = E((C) => {
|
|
14
|
+
const { initialValue: a = null, context: t, onOption: u, onValidateOption: $, onDone: m, onInput: c, options: g = M, defaultOption: f = g?.[0], cancelOption: x = "Cancel", sx: h, ...v } = C, N = V(() => t?.().getNames().findValidName("Range1"), []), y = V(() => {
|
|
15
|
+
if (!a) return !0;
|
|
16
|
+
}, []), [o, D] = p({ displayText: a?.getName() ?? N, errorText: null }), [n, w] = p({ displayValue: a?.getRanges() ?? t?.().selection() ?? null, errorText: null }), [T, O] = p(!1), F = R(async (e) => !o.errorText && !n.errorText, []), I = d((e, l, i) => {
|
|
17
|
+
if (!l) {
|
|
18
|
+
let s = null;
|
|
19
|
+
y ? s = t?.().getNames().addReference(o?.displayText, n?.displayValue, !1) : (a.getType() === "reference" && a.doBatch(() => {
|
|
20
|
+
a.setName(o?.displayText), a.setReference(n?.displayValue);
|
|
21
|
+
}, `Edit Named '${o?.displayText}'`), s = a), s && (s.select(), c(s));
|
|
22
|
+
}
|
|
23
|
+
u?.(e, l, i), m?.();
|
|
24
|
+
}, [t, o, n, m, u, f, x, c]), b = d((e) => {
|
|
25
|
+
let l = null;
|
|
26
|
+
try {
|
|
27
|
+
t?.().getNames().validateName(e);
|
|
28
|
+
} catch (i) {
|
|
29
|
+
l = i.message;
|
|
30
|
+
}
|
|
31
|
+
D({ displayText: e, errorText: l });
|
|
32
|
+
}, []), k = d((e) => {
|
|
33
|
+
a && a.getName().toLowerCase() === e.toLowerCase() || t?.().getNames().validateName(e);
|
|
34
|
+
}, [t, a]), B = R((e) => {
|
|
35
|
+
w({ displayValue: e ?? null, errorText: null });
|
|
36
|
+
}, []);
|
|
37
|
+
return r(S, { title: (y ? "Define" : "Edit") + " Range", options: g, onOption: I, onValidateOption: F, defaultOption: f, cancelOption: x, autoFocusSel: ".autoFocus", sx: { width: "460px", ...h }, ...v, children: j(L, { sx: { paddingTop: (e) => e.spacing(1), paddingBottom: (e) => e.spacing(0), rowGap: (e) => e.spacing(1), range: "flex", flexDirection: "column" }, children: [r(A, { formName: "name", defaultInput: N, value: o.displayText, onChangeInput: b, onValidate: k, onFocus: (e) => {
|
|
38
|
+
T || e.target?.select(), O(!0);
|
|
39
|
+
} }), r(G, { formName: "range", value: n.displayValue, onChangeInput: B, resolvedAddress: t ? t().getNames().getRanges.bind(t().getNames()) : void 0, onFocus: (e) => {
|
|
40
|
+
T || e.target?.select(), O(!0);
|
|
41
|
+
} })] }) });
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
Q as NamedReferenceDialog,
|
|
45
|
+
Q as default
|
|
46
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as l, jsxs as z } from "react/jsx-runtime";
|
|
2
|
+
import { memo as A, useMemo as O, useState as f, useCallback as b } from "react";
|
|
3
|
+
import { alpha as i, getOverlayAlpha as r } from "@mui/material/styles";
|
|
4
|
+
import { Box as j, FormControl as F, TextField as D } from "@mui/material";
|
|
5
|
+
import { useCallbackRef as x } from "@sheetxl/utils-react";
|
|
6
|
+
import { OptionsDialog as E } from "@sheetxl/utils-mui";
|
|
7
|
+
/**
|
|
8
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.13
|
|
9
|
+
*
|
|
10
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
11
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
12
|
+
*/
|
|
13
|
+
const S = ["Ok", "Cancel"], K = A((v) => {
|
|
14
|
+
const { initialValue: n = null, context: s, onInput: h, onOption: T, onValidateOption: p, onDone: d, options: y = S, defaultOption: c = y?.[0], cancelOption: u = "Cancel", sx: w, ...I } = v, H = O(() => (n ?? s?.()?.getHyperlink()) !== null, []), g = O(() => {
|
|
15
|
+
let e = null, a = null;
|
|
16
|
+
n && (typeof n == "string" ? a = n : e = n);
|
|
17
|
+
const o = e ?? s?.()?.getHyperlink();
|
|
18
|
+
return { address: a ?? o?.getAddress() ?? "", textToDisplay: o?.getDisplayText() ?? "" };
|
|
19
|
+
}, [n, s]), [t, M] = f(g.address), [m, P] = f(() => {
|
|
20
|
+
const e = s?.().toTextUnformatted() ?? g.displayText;
|
|
21
|
+
return e === g.address ? "" : e;
|
|
22
|
+
}), [B, k] = f(!1), $ = b((e) => {
|
|
23
|
+
P(e.target.value);
|
|
24
|
+
}, []), C = b(async (e, a) => null, []), L = x(async (e) => {
|
|
25
|
+
const a = t === "" ? null : { address: t }, o = e === u;
|
|
26
|
+
o || h?.({ address: a?.address ?? null, displayText: m ?? null }), T?.(e, o, e === c), d?.();
|
|
27
|
+
}, [t, m, s, h, d, T, c, u]), V = x((e) => {
|
|
28
|
+
M(e.target.value), C(e.target.value, null);
|
|
29
|
+
}, [p]), W = x(async (e) => {
|
|
30
|
+
let a = await Promise.resolve(p?.(e));
|
|
31
|
+
try {
|
|
32
|
+
a !== !1 && (a = await C(t, e));
|
|
33
|
+
} catch {
|
|
34
|
+
}
|
|
35
|
+
return a ?? !0;
|
|
36
|
+
}, [p]);
|
|
37
|
+
return l(E, { title: (H ? "Edit" : "Insert") + " Link", options: y, onDone: d, onOption: (e) => L(e), onValidateOption: W, defaultOption: c, cancelOption: u, autoFocusSel: ".autoFocus", sx: { width: "480px", ...w }, ...I, children: z(j, { sx: { paddingTop: (e) => e.spacing(1), paddingBottom: (e) => e.spacing(0), rowGap: (e) => e.spacing(1), display: "flex", flexDirection: "column" }, children: [l(F, { sx: { paddingTop: (e) => e.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: l(D, { label: "Address", placeholder: "Enter a url or cell reference.", onFocus: (e) => {
|
|
38
|
+
B || e.target?.select(), k(!0);
|
|
39
|
+
}, sx: { "& .MuiFormHelperText-root": { marginTop: (e) => e.spacing(0.5) } }, slotProps: { inputLabel: { shrink: !0 }, htmlInput: { className: "autoFocus", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (e) => e.spacing(1.25), paddingBottom: (e) => e.spacing(0.75), backgroundImage: `linear-gradient(${i("#fff", r(5))}, ${i("#fff", r(5))})` } } }, value: t, onChange: V, onContextMenu: (e) => {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
} }) }), l(F, { sx: { paddingTop: (e) => e.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: l(D, { label: "Display Text", placeholder: t?.startsWith("#") ? t.substring(1) : t, onFocus: () => {
|
|
42
|
+
k(!0);
|
|
43
|
+
}, sx: { "& .MuiFormHelperText-root": { marginTop: (e) => e.spacing(0.5) } }, slotProps: { inputLabel: { shrink: !0 }, htmlInput: { spellCheck: !1, autoComplete: "off", sx: { paddingTop: (e) => e.spacing(1.25), paddingBottom: (e) => e.spacing(0.75), backgroundImage: `linear-gradient(${i("#fff", r(5))}, ${i("#fff", r(5))})` } } }, value: m, onChange: $, onContextMenu: (e) => {
|
|
44
|
+
e.stopPropagation();
|
|
45
|
+
} }) })] }) });
|
|
46
|
+
});
|
|
47
|
+
export {
|
|
48
|
+
K as HyperlinkDialog,
|
|
49
|
+
K as default
|
|
50
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { jsx as i, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { memo as ae, useRef as C, useState as R, useEffect as A, useLayoutEffect as me, useMemo as ge } from "react";
|
|
3
|
+
import { alpha as w, getOverlayAlpha as T } from "@mui/material/styles";
|
|
4
|
+
import { DialogContent as xe, Box as h, TextField as ie, InputAdornment as he, Collapse as oe, MenuItem as Oe, FormControl as ye, InputLabel as Ce, Select as be } from "@mui/material";
|
|
5
|
+
import { ICell as p, IRange as k } from "@sheetxl/sdk";
|
|
6
|
+
import { CommandContext as le } from "@sheetxl/react";
|
|
7
|
+
import { useCallbackRef as j, KeyCodes as Re, DynamicIcon as m, KeyModifiers as b } from "@sheetxl/utils-react";
|
|
8
|
+
import { InternalWindow as ve, ExhibitOptionButton as g, ExhibitDivider as Fe } from "@sheetxl/utils-mui";
|
|
9
|
+
import { u as ke } from "./C_L0TMqGy3dfJBxX.mjs";
|
|
10
|
+
/**
|
|
11
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.13
|
|
12
|
+
*
|
|
13
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
14
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
15
|
+
*/
|
|
16
|
+
const V = { width: "1.5rem", height: "1.5rem" }, z = ae((E) => {
|
|
17
|
+
const { label: a, value: x, options: l, onSelect: O, tabIndex: M = 0, ...N } = E, [B, y] = R(() => re(x, l));
|
|
18
|
+
A(() => {
|
|
19
|
+
y(re(x, l));
|
|
20
|
+
}, [x, l]);
|
|
21
|
+
const v = j((c) => {
|
|
22
|
+
y(c.target.value), O?.(l[c.target.value]);
|
|
23
|
+
}, [O, l]), F = ge(() => Object.keys(l).map((c) => i(Oe, { value: c, children: c }, c)), [l]);
|
|
24
|
+
return d(ye, { sx: { minWidth: 135 }, size: "small", children: [i(Ce, { children: a }), i(be, { inputProps: { tabIndex: M }, value: B, label: a, onChange: v, sx: { backgroundImage: `linear-gradient(${w("#fff", T(5))}, ${w("#fff", T(5))})` }, ...N, children: F })] });
|
|
25
|
+
}), se = { enter: 140, exit: 140 }, ce = { Formulas: p.Content.Formulas, Values: p.Content.Values, Notes: p.Content.Notes, Comments: p.Content.Comments }, pe = { ...ce };
|
|
26
|
+
delete pe.Values;
|
|
27
|
+
const we = { "By Rows": !0, "By Columns": !1 }, re = (E, a) => {
|
|
28
|
+
const x = Object.keys(a);
|
|
29
|
+
for (let l = 0; l < x.length; l++) {
|
|
30
|
+
const O = x[l];
|
|
31
|
+
if (a[O] === E) return O;
|
|
32
|
+
}
|
|
33
|
+
}, Le = ae((E) => {
|
|
34
|
+
const { initialValue: a, context: x, onInput: l, title: O, onHide: M, autoFocus: N, ...B } = E, y = a?.replace ?? !1, v = a?.findOptions, F = v.text ?? null, c = a?.replaceOptions, K = a?.replaceText ?? null, L = x?.(), s = C(null), H = C(null), U = C(null), G = C(null), q = C(null), J = C(null), Q = (e, n) => {
|
|
35
|
+
n && (n.start(e, { center: !1 }), setTimeout(() => n.stop(e), 180));
|
|
36
|
+
}, [X, D] = R(!1), [P, de] = R(!1), [u, W] = R(y), [Y, $] = R(!1), [Z, _] = R(!1), [o, r] = R({ replaceText: null, replace: y, replaceOptions: null, findOptions: { text: null, matchCase: !1, matchEntireCell: !1, useRegex: !1, orientation: k.Orientation.Row, fields: [p.Content.Formulas] }, scope: le.FindScopeOptions.Sheet }), I = j(async (e, n, t, S) => {
|
|
37
|
+
if (!L) return;
|
|
38
|
+
const f = { ...o };
|
|
39
|
+
f.replaceOptions = { ...f.replaceOptions }, f.findOptions = { ...f.findOptions }, f.replaceOptions.maxCount = t ? void 0 : 1, f.replace = n, n && o.findOptions.fields?.[0] === p.Content.Values && (f.findOptions.fields = [p.Content.Formulas]), f.findOptions.reverse = !e;
|
|
40
|
+
const fe = await L({ autoFocus: S, ...f });
|
|
41
|
+
$(fe === 0);
|
|
42
|
+
}, [o, L]);
|
|
43
|
+
A(() => {
|
|
44
|
+
$(!1);
|
|
45
|
+
}, [o, P, u]);
|
|
46
|
+
const ee = j((e, n) => {
|
|
47
|
+
if (e.keyCode === Re.Enter) {
|
|
48
|
+
if (!o.findOptions.text) return;
|
|
49
|
+
let t = !0, S = !1;
|
|
50
|
+
e.shiftKey && (t = !1), n ? (e.ctrlKey && e.altKey && (S = !0), Q(e, S ? J.current : q.current)) : Q(e, t ? G.current : U.current), I(t, n, S, !1);
|
|
51
|
+
}
|
|
52
|
+
}, [o]), ne = C(null);
|
|
53
|
+
me(() => {
|
|
54
|
+
r((e) => {
|
|
55
|
+
const n = { ...e };
|
|
56
|
+
n.findOptions.text = F && F.length > 0 ? F : e.findOptions.text ?? "", D(!0), K !== null && (n.replaceText = K ?? ""), v && (n.findOptions = { ...n.findOptions, ...v }), n.replaceText || (n.replaceText = ""), n.replaceOptions && (n.replaceOptions = { ...n.replaceOptions }), c && (n.replaceOptions = { ...n.replaceOptions, ...c }), o.findOptions.fields?.[0] || (o.findOptions.fields = [p.Content.Formulas]);
|
|
57
|
+
const t = !(!y && !c && K === null);
|
|
58
|
+
return t && W(t), n;
|
|
59
|
+
}), Z || ne.current?.focus();
|
|
60
|
+
}, [a, y, F, K, v, c]), A(() => {
|
|
61
|
+
u ? (o.findOptions.fields[0], p.Content.Values) : D(!0);
|
|
62
|
+
}, [u]), A(() => {
|
|
63
|
+
if (X && s.current && o.findOptions.text === s.current.value) return s.current === document.activeElement || s.current.contains(document.activeElement) ? (s.current?.select(), void D(!1)) : void s.current.addEventListener("focus", () => {
|
|
64
|
+
s.current?.select(), D(!1);
|
|
65
|
+
}, { once: !0 });
|
|
66
|
+
}, [X, o]);
|
|
67
|
+
const [ue, { width: te }] = ke();
|
|
68
|
+
return i(ve, { ref: ne, title: O ?? (u ? "Find & Replace" : "Find"), initialPosition: { y: "35" }, autoFocusSel: ".input", onHide: M, onFocus: () => _(!0), onBlur: () => {
|
|
69
|
+
_(!1), $(!1);
|
|
70
|
+
}, slotProps: { paper: { elevation: Z ? 3 : 1 } }, ...B, children: d(xe, { dividers: !0, ref: ue, sx: { display: "flex", flexDirection: "column", paddingLeft: (e) => e.spacing(1.5), paddingRight: (e) => e.spacing(1.5) }, onKeyDown: (e) => {
|
|
71
|
+
if (e.key === "h" && e.ctrlKey) W(!0), s.current?.contains(document.activeElement) && H.current?.focus();
|
|
72
|
+
else if (e.key === "f" && e.ctrlKey) s.current?.focus();
|
|
73
|
+
else if (e.key === "c" && e.altKey) r((n) => {
|
|
74
|
+
const t = { ...n };
|
|
75
|
+
return t.findOptions.matchCase = !n.findOptions.matchCase, t;
|
|
76
|
+
});
|
|
77
|
+
else if (e.key === "e" && e.altKey) r((n) => {
|
|
78
|
+
const t = { ...n };
|
|
79
|
+
return t.findOptions.matchEntireCell = !n.findOptions.matchEntireCell, t;
|
|
80
|
+
});
|
|
81
|
+
else {
|
|
82
|
+
if (e.key !== "r" || !e.altKey) return;
|
|
83
|
+
r((n) => {
|
|
84
|
+
const t = { ...n };
|
|
85
|
+
return t.findOptions.useRegex = !n.findOptions.useRegex, t;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
}, children: [d(h, { sx: { display: "flex", flexDirection: "row", gap: (e) => e.spacing(1) }, children: [d(h, { sx: { display: "flex", flexDirection: "row", alignItems: "start", gap: (e) => e.spacing(0.25), paddingTop: "3px" }, children: [i(g, { selected: P, onSelectToggle: (e) => {
|
|
90
|
+
de(e);
|
|
91
|
+
}, preventFocus: !0, label: "Toggle Additional Options", icon: i(m, { iconKey: "FindOptions" }) }), i(g, { selected: u, onSelectToggle: (e) => {
|
|
92
|
+
W(e);
|
|
93
|
+
}, preventFocus: !0, label: "Toggle Replace", icon: i(m, { iconKey: "FindReplaceToggle" }), shortcut: { key: u ? "F" : "H", modifiers: [b.Ctrl] } })] }), d(h, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", boxSizing: "border-box" }, children: [d(h, { sx: { display: "flex", flexDirection: "row", alignItems: "center" }, children: [i(ie, { label: "Find", slotProps: { input: { sx: { paddingRight: (e) => e.spacing(1), minWidth: te > 460 ? "20em" : void 0, backgroundImage: `linear-gradient(${w("#fff", T(5))}, ${w("#fff", T(5))})` }, endAdornment: i(he, { position: "end", children: d(h, { sx: { display: "flex", alignItems: "center", flexDirection: "row", gap: "2px" }, children: [i(g, { style: V, selected: o.findOptions.matchCase, onBlur: () => {
|
|
94
|
+
}, onSelectToggle: (e) => {
|
|
95
|
+
r((n) => {
|
|
96
|
+
const t = { ...n };
|
|
97
|
+
return t.findOptions.matchCase = e, t;
|
|
98
|
+
});
|
|
99
|
+
}, label: "Match Case", shortcut: { key: "C", modifiers: [b.Alt] }, icon: i(m, { iconKey: "FindCaseSensitive", size: "1rem" }) }), i(g, { style: V, selected: o.findOptions.matchEntireCell, onSelectToggle: (e) => {
|
|
100
|
+
r((n) => {
|
|
101
|
+
const t = { ...n };
|
|
102
|
+
return t.findOptions.matchEntireCell = e, t;
|
|
103
|
+
});
|
|
104
|
+
}, label: "Match Entire Cell", shortcut: { key: "E", modifiers: [b.Alt] }, icon: i(m, { iconKey: "FindWholeWord", size: "1rem" }) }), i(g, { style: V, selected: o.findOptions.useRegex, onSelectToggle: (e) => {
|
|
105
|
+
r((n) => {
|
|
106
|
+
const t = { ...n };
|
|
107
|
+
return t.findOptions.useRegex = e, t;
|
|
108
|
+
});
|
|
109
|
+
}, label: "Use Regular Expression", shortcut: { key: "R", modifiers: [b.Alt] }, icon: i(m, { iconKey: "FindRegEx", size: "1rem" }) })] }) }) }, inputLabel: { shrink: !0 }, htmlInput: { draggable: !1, ref: s, className: "input", autoFocus: !0, spellCheck: !1, autoComplete: "off", sx: { paddingTop: (e) => e.spacing(1.25), paddingBottom: (e) => e.spacing(0.75) } } }, sx: { flex: "1 1 100%", marginRight: (e) => e.spacing(1), "& .MuiOutlinedInput-notchedOutline": { borderColor: (e) => Y ? `${e.palette.error.main} !important` : void 0 }, "& .MuiInputLabel-outlined": { color: (e) => Y ? `${e.palette.error.main} !important` : void 0 } }, value: o.findOptions.text ?? "", onChange: (e) => {
|
|
110
|
+
r((n) => {
|
|
111
|
+
const t = { ...n };
|
|
112
|
+
return t.findOptions.text = e.target.value, t;
|
|
113
|
+
});
|
|
114
|
+
}, onKeyDown: (e) => ee(e, !1), onContextMenu: (e) => {
|
|
115
|
+
e.stopPropagation();
|
|
116
|
+
} }), i(g, { selected: o.findOptions.reverse, onSelectToggle: (e) => {
|
|
117
|
+
I(!1, !1);
|
|
118
|
+
}, touchRippleRef: U, label: "", shortcut: { key: "Enter", modifiers: [b.Shift] }, icon: i(m, { iconKey: o.findOptions.orientation !== k.Orientation.Column ? "ArrowBack" : "ArrowUpward" }), disabled: !o.findOptions.text }), i(g, { selected: !o.findOptions.reverse, onSelectToggle: (e) => {
|
|
119
|
+
I(!0, !1);
|
|
120
|
+
}, touchRippleRef: G, label: "Next Match", shortcut: { key: "Enter" }, icon: i(m, { iconKey: o.findOptions.orientation !== k.Orientation.Column ? "ArrowForward" : "ArrowDownward" }), disabled: !o.findOptions.text })] }), i(oe, { in: u, timeout: se, onExit: () => {
|
|
121
|
+
s.current?.focus();
|
|
122
|
+
}, children: d(h, { sx: { display: "flex", flexDirection: "row", alignItems: "center", marginTop: (e) => e.spacing(2) }, children: [i(ie, { label: "Replace", slotProps: { input: { sx: { paddingRight: (e) => e.spacing(1), backgroundImage: `linear-gradient(${w("#fff", T(5))}, ${w("#fff", T(5))})` } }, inputLabel: { shrink: !0 }, htmlInput: { ref: H, className: "input", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (e) => e.spacing(1.25), paddingBottom: (e) => e.spacing(0.75) } } }, sx: { flex: "1 1 100%", marginRight: (e) => e.spacing(1) }, value: o.replaceText ?? "", onChange: (e) => {
|
|
123
|
+
r((n) => {
|
|
124
|
+
const t = { ...n };
|
|
125
|
+
return t.replaceText = e.target.value, t;
|
|
126
|
+
});
|
|
127
|
+
}, onKeyDown: (e) => ee(e, !0), onContextMenu: (e) => {
|
|
128
|
+
e.stopPropagation();
|
|
129
|
+
} }), i(g, { onSelectToggle: (e) => {
|
|
130
|
+
I(!0, !0);
|
|
131
|
+
}, touchRippleRef: q, label: "Replace", shortcut: { key: "Enter" }, icon: i(m, { iconKey: "FindReplace" }), disabled: !o.findOptions.text }), i(g, { onSelectToggle: (e) => {
|
|
132
|
+
I(!0, !0, !0);
|
|
133
|
+
}, touchRippleRef: J, label: "Replace All", shortcut: { key: "Enter", modifiers: [b.Ctrl, b.Alt] }, icon: i(m, { iconKey: "FindReplaceAll" }), disabled: !o.findOptions.text })] }) })] })] }), i(oe, { in: P, timeout: se, onExit: () => {
|
|
134
|
+
s.current?.focus();
|
|
135
|
+
}, children: d(h, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", gap: (e) => e.spacing(1.5), marginTop: (e) => e.spacing(1) }, children: [i(Fe, { orientation: "horizontal", sx: { marginBottom: (e) => e.spacing(1.5) } }), d(h, { sx: { display: "flex", flexDirection: te >= 383 ? "row" : "column", justifyContent: "space-evenly", alignItems: "center", gap: (e) => e.spacing(1), rowGap: (e) => e.spacing(2) }, tabIndex: -1, children: [i(z, { label: "Within", value: o.scope, options: le.FindScopeOptions, onSelect: (e) => {
|
|
136
|
+
r((n) => {
|
|
137
|
+
const t = { ...n };
|
|
138
|
+
return t.scope = e, t;
|
|
139
|
+
});
|
|
140
|
+
} }), i(z, { label: "Search", value: o.findOptions.orientation !== k.Orientation.Column, options: we, onSelect: (e) => {
|
|
141
|
+
r((n) => {
|
|
142
|
+
const t = { ...n };
|
|
143
|
+
return t.findOptions.orientation = e ? k.Orientation.Row : k.Orientation.Column, t;
|
|
144
|
+
});
|
|
145
|
+
} }), i(z, { label: "Look in", value: u && o.findOptions.fields?.[0] === p.Content.Values ? p.Content.Formulas : o.findOptions.fields?.[0], options: u ? pe : ce, onSelect: (e) => {
|
|
146
|
+
r((n) => {
|
|
147
|
+
const t = { ...n };
|
|
148
|
+
return t.findOptions.fields = [e], t;
|
|
149
|
+
});
|
|
150
|
+
} })] })] }) })] }) });
|
|
151
|
+
});
|
|
152
|
+
export {
|
|
153
|
+
Le as FindReplaceWindow,
|
|
154
|
+
Le as default
|
|
155
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { memo as E, useMemo as M, useState as C, useCallback as A } from "react";
|
|
3
|
+
import { alpha as O, getOverlayAlpha as y } from "@mui/material/styles";
|
|
4
|
+
import { Box as S, FormControl as $, TextField as j } from "@mui/material";
|
|
5
|
+
import { useCallbackRef as u } from "@sheetxl/utils-react";
|
|
6
|
+
import { OptionsDialog as z } from "@sheetxl/utils-mui";
|
|
7
|
+
/**
|
|
8
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.13
|
|
9
|
+
*
|
|
10
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
11
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
12
|
+
*/
|
|
13
|
+
const G = ["Ok", "Cancel"], K = E((F) => {
|
|
14
|
+
const { initialValue: k = null, onInput: d, context: w, onOption: g, onValidateOption: r, onDone: p, options: f = G, defaultOption: c = f?.[0], cancelOption: m = "Cancel", sx: T, ...b } = F, x = M(() => {
|
|
15
|
+
const t = k ?? w?.()?.getComments();
|
|
16
|
+
let n = "";
|
|
17
|
+
if (t && t.content && t.content.runs) {
|
|
18
|
+
const e = t.content.runs;
|
|
19
|
+
for (let a = 0; a < e.length; a++) {
|
|
20
|
+
const s = e[a];
|
|
21
|
+
n += s?.text;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return n;
|
|
25
|
+
}, []), [o, v] = C(x), [D, I] = C(!1), h = A(async (t, n) => null, []), B = u(async (t) => {
|
|
26
|
+
const n = o === "" ? [] : o.split(`
|
|
27
|
+
`), e = t === m;
|
|
28
|
+
if (!e) {
|
|
29
|
+
const a = n.length, s = new Array(a);
|
|
30
|
+
for (let l = 0; l < a; l++) s[l] = { text: n[l] };
|
|
31
|
+
d?.({ content: { runs: s } });
|
|
32
|
+
}
|
|
33
|
+
g?.(t, e, t === c), p?.();
|
|
34
|
+
}, [o, d, p, g, c, m]), P = u((t) => {
|
|
35
|
+
v(t.target.value), h(t.target.value, null);
|
|
36
|
+
}, [r]), V = u(async (t) => {
|
|
37
|
+
let n = await Promise.resolve(r?.(t));
|
|
38
|
+
try {
|
|
39
|
+
n !== !1 && (n = await h(o, t));
|
|
40
|
+
} catch {
|
|
41
|
+
}
|
|
42
|
+
return n ?? !0;
|
|
43
|
+
}, [r, o]);
|
|
44
|
+
return i(z, { title: (x ? "Edit" : "Insert") + " Comments", options: f, onDone: p, onOption: (t) => B(t), onValidateOption: V, defaultOption: c, cancelOption: m, autoFocusSel: ".autoFocus", sx: { width: "480px", ...T }, ...b, children: i(S, { sx: { paddingTop: (t) => t.spacing(1), paddingBottom: (t) => t.spacing(0), rowGap: (t) => t.spacing(1), display: "flex", flexDirection: "column" }, children: i($, { sx: { paddingTop: (t) => t.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: i(j, { label: "Comments", placeholder: "Enter a comment.", onFocus: (t) => {
|
|
45
|
+
D || t.target?.select(), I(!0);
|
|
46
|
+
}, sx: { "& .MuiFormHelperText-root": { marginTop: (t) => t.spacing(0.5) } }, slotProps: { inputLabel: { shrink: !0 }, htmlInput: { className: "autoFocus", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (t) => t.spacing(1.25), paddingBottom: (t) => t.spacing(0.75), backgroundImage: `linear-gradient(${O("#fff", y(5))}, ${O("#fff", y(5))})` } } }, value: o, onChange: P, onContextMenu: (t) => {
|
|
47
|
+
t.stopPropagation();
|
|
48
|
+
} }) }) }) });
|
|
49
|
+
});
|
|
50
|
+
export {
|
|
51
|
+
K as CommentsDialog,
|
|
52
|
+
K as default
|
|
53
|
+
};
|
package/browser/esm/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._sheetxl-reset_11z3j_1{display:block;margin:0;padding:0;line-height:1}._sheetxl-reset_11z3j_1 table,._sheetxl-reset_11z3j_1 thead,._sheetxl-reset_11z3j_1 tbody,._sheetxl-reset_11z3j_1 tfoot,._sheetxl-reset_11z3j_1 tr,._sheetxl-reset_11z3j_1 th,._sheetxl-reset_11z3j_1 td{display:block;width:auto;height:auto;margin:0;padding:0;border:none;border-collapse:inherit;border-spacing:0;border-color:inherit;vertical-align:inherit;text-align:left;font-weight:inherit;-webkit-border-horizontal-spacing:0;-webkit-border-vertical-spacing:0}._sheetxl-reset_11z3j_1 th,._sheetxl-reset_11z3j_1 td{display:inline}html{color:initial}._table-style-options-container_1kfn2_1{container-type:inline-size}._table-style-options_1kfn2_1{display:grid;grid-template-columns:1fr;user-select:none}@container (width > 600px){._table-style-options_1kfn2_1{grid-template-rows:repeat(3,auto);grid-auto-flow:column;grid-auto-columns:1fr;gap:2px}}._range-row_akhf4_1{display:flex;flex-direction:column;flex:1 1 100%;width:100%;align-items:center}@container (width > 600px){._range-row_akhf4_1{flex-direction:row;gap:12px;justify-content:space-between}}._action-row_akhf4_15{display:flex;align-items:start;flex-direction:column;width:100%;gap:4px}@container (width > 600px){._action-row_akhf4_15{align-items:center;flex-direction:row;justify-content:space-evenly}}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4{fill:currentColor}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .activeColor{fill:var(--sxl-color-active)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .background{fill:var(--sxl-app-color-background)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .grey{fill:var(--sxl-app-color-grey)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .highContrast{fill:var(--sxl-app-color-high)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .info{fill:var(--sxl-app-color-info)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .info.light{fill:var(--sxl-app-color-info-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .info.dark{fill:var(--sxl-app-color-info-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .secondary{fill:var(--sxl-app-color-secondary)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .secondary.light{fill:var(--sxl-app-color-secondary-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .secondary.dark{fill:var(--sxl-app-color-secondary-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .success{fill:var(--sxl-app-color-success)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .success.light{fill:var(--sxl-app-color-success-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .success.dark{fill:var(--sxl-app-color-success-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .warning{fill:var(--sxl-app-color-warning)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .warning .light{fill:var(--sxl-app-color-warning-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .warning .dark{fill:var(--sxl-app-color-warning-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .error{fill:var(--sxl-app-color-error)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .error .light{fill:var(--sxl-app-color-error-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .error .dark{fill:var(--sxl-app-color-error-dark)}._sheetxl-workbook_g5t6x_5{display:flex;position:relative;overflow:hidden;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;outline:none}._sheetxl-workbook_g5t6x_5 .splitPane .styled-resizer{background-color:var(--sxl-app-color-grey, grey)}._sheetxl-workbook_g5t6x_5 .splitPane .styled-resizer:hover,._sheetxl-workbook_g5t6x_5 .splitPane.dragging .styled-resizer{background-color:var(--sxl-app-color-primary, blue)}._card_1a398_7{width:100%}._actionRoot_1a398_11{padding:8px 8px 8px 16px;justify-content:space-between}._icons_1a398_16{margin-left:auto;display:flex;align-items:center}._expand_1a398_22{padding:8px;transform:rotate(0);color:#d32f2f;transition:all .2s ease-in-out}._expandOpen_1a398_29{transform:rotate(180deg)}._stackTraceContainer_1a398_33{padding:16px}._paper_1a398_37{background-color:#fff;padding:16px}._checkIcon_1a398_42{font-size:20px;padding-right:4px}._button_1a398_47{padding:0;text-transform:none}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
2
|
import { LicenseManager as t } from "@sheetxl/sdk";
|
|
3
3
|
import { DefaultTaskPaneRegistry as n, useModelListener as s, useRangeListener as m } from "@sheetxl/react";
|
|
4
|
-
import { E as u, Z as r, B as d, O as C, X as B, n as i, o as
|
|
4
|
+
import { E as u, Z as r, B as d, O as C, X as B, n as i, o as p, m as S, k, a0 as P, a1 as T, t as b, $ as F, Y as c, a2 as g, D as y, at as I, l as f, aa as h, s as W, ab as x, h as M, v as w, i as L, a8 as v, F as A, G as D, H as E, L as O, K as R, I as N, M as V, a9 as z, N as H, j as U, P as G, z as j, A as q, R as Z, ai as J, aj as K, a7 as Q, ak as X, q as Y, a6 as _, S as $, Q as aa, af as oa, ag as ta, ah as ea, ad as na, ae as sa, ac as ma, w as la, T as ua, f as ra, a3 as da, a4 as Ca, a5 as Ba, x as ia, U as pa, V as Sa, p as ka, y as Pa, J as Ta, ao as ba, am as Fa, av as ca, ap as ga, an as ya, W as Ia, au as fa, as as ha, S as Wa, ar as xa, al as Ma, aq as wa } from "./C_L0TMqGy3dfJBxX.mjs";
|
|
5
5
|
/**
|
|
6
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.
|
|
6
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.13
|
|
7
7
|
*
|
|
8
8
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
9
9
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -13,80 +13,81 @@ export {
|
|
|
13
13
|
r as AutoColorPosition,
|
|
14
14
|
d as BorderCommandButton,
|
|
15
15
|
C as BorderPopupButton,
|
|
16
|
-
B as
|
|
16
|
+
B as BorderStylePopupButton,
|
|
17
17
|
i as CellsDeleteCommandButton,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
p as CellsFormatCommandButton,
|
|
19
|
+
S as CellsInsertCommandButton,
|
|
20
20
|
k as ClearCommandButton,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
b as
|
|
24
|
-
F as
|
|
25
|
-
c as
|
|
21
|
+
P as ColorButton,
|
|
22
|
+
T as ColorButtonList,
|
|
23
|
+
b as ColorCommandButton,
|
|
24
|
+
F as ColorPanel,
|
|
25
|
+
c as ColorPanelType,
|
|
26
|
+
g as ColorPopupButton,
|
|
26
27
|
n as DefaultTaskPaneRegistry,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
y as DocThemeCommandButton,
|
|
29
|
+
I as EagerStudio,
|
|
30
|
+
f as FillCommandButton,
|
|
31
|
+
h as FilterColumnMenu,
|
|
32
|
+
W as FilterCommandButton,
|
|
33
|
+
x as Filters,
|
|
34
|
+
M as FindCommandButton,
|
|
35
|
+
w as FontFamilyCommandButton,
|
|
36
|
+
L as FontSizeCommandButton,
|
|
37
|
+
v as FormulaBar,
|
|
38
|
+
A as FreezeCommandButton,
|
|
39
|
+
D as HelpCommandButton,
|
|
40
|
+
E as HorizontalAlignCommandButton,
|
|
40
41
|
O as InsertFunctionCommandPopupButton,
|
|
41
42
|
R as InsertFunctionSumCommandPopupButton,
|
|
42
|
-
|
|
43
|
+
N as InsertImageCommandButton,
|
|
43
44
|
t as LicenseManager,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
45
|
+
V as MergeCommandButton,
|
|
46
|
+
z as NamedCollectionEditor,
|
|
47
|
+
H as NamedInput,
|
|
48
|
+
U as NumberFormatCommandButton,
|
|
49
|
+
G as PasteCommandButton,
|
|
50
|
+
j as PresetCellStylesCommandButton,
|
|
51
|
+
q as PresetTableStylesCommandButton,
|
|
52
|
+
Z as RangeInput,
|
|
53
|
+
J as SheetTab,
|
|
54
|
+
K as SheetTabMenu,
|
|
55
|
+
Q as SheetZoomScale,
|
|
56
|
+
X as SheetsAllMenu,
|
|
57
|
+
Y as SortFilterCommandButton,
|
|
58
|
+
_ as StatusBar,
|
|
59
|
+
$ as Studio,
|
|
60
|
+
aa as StyledStrokeIcon,
|
|
61
|
+
oa as TableDetailsPanel,
|
|
62
|
+
ta as TableDetailsTaskPane,
|
|
63
|
+
ea as TablePlugin,
|
|
64
|
+
na as TableStyleCanvasPreview,
|
|
65
|
+
sa as TableStyleOptionsPanel,
|
|
66
|
+
ma as TableStylePreview,
|
|
67
|
+
la as TextEffectsCommandButton,
|
|
68
|
+
ua as TextOverflowCommandButton,
|
|
69
|
+
ra as TextRotateCommandButton,
|
|
70
|
+
da as ThemeSelectButton,
|
|
71
|
+
Ca as ThemeSelectPanel,
|
|
72
|
+
Ba as ThemeSelectPopupButton,
|
|
73
|
+
ia as UnderlineCommandButton,
|
|
74
|
+
pa as UndoRedoCommandButton,
|
|
74
75
|
Sa as VerticalAlignCommandButton,
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
ka as ViewGridLinesCommandButton,
|
|
77
|
+
Pa as ViewHeadingsCommandButton,
|
|
77
78
|
Ta as WalkingCopyCommandButton,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
79
|
+
ba as WorkbookContextMenu,
|
|
80
|
+
Fa as WorkbookElement,
|
|
81
|
+
ca as WorkbookIO,
|
|
82
|
+
ga as WorkbookStrip,
|
|
83
|
+
ya as WorkbookTitle,
|
|
84
|
+
Ia as WorkbookViewCommandButton,
|
|
85
|
+
fa as _WorkbookIO,
|
|
86
|
+
ha as createGridStyleFromMUITheme,
|
|
87
|
+
Wa as default,
|
|
88
|
+
xa as defaultNewWorkbook,
|
|
89
|
+
Ma as setPrintExamplesOnLoad,
|
|
89
90
|
s as useModelListener,
|
|
90
91
|
m as useRangeListener,
|
|
91
|
-
|
|
92
|
+
wa as useWorkbookCommands
|
|
92
93
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as n, jsxs as T } from "react/jsx-runtime";
|
|
2
|
+
import { memo as v, useState as p, useCallback as w } from "react";
|
|
3
|
+
import { Box as I, FormControlLabel as V, Checkbox as j } from "@mui/material";
|
|
4
|
+
import { useCallbackRef as y } from "@sheetxl/utils-react";
|
|
5
|
+
import { OptionsDialog as F } from "@sheetxl/utils-mui";
|
|
6
|
+
import { R } from "./C_L0TMqGy3dfJBxX.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.13
|
|
9
|
+
*
|
|
10
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
11
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
12
|
+
*/
|
|
13
|
+
const B = ["Ok", "Cancel"], z = v((g) => {
|
|
14
|
+
const { onInput: f, onOption: c, onValidateOption: H, onDone: d, options: m = B, defaultOption: t = m?.[0], cancelOption: s = "Cancel", sx: x, initialValue: e, context: l, ...b } = g, [h, O] = p(!1), [o, C] = p(() => e?.hasHeader ?? !1), [i, k] = p(() => e?.ranges ?? null), D = y((a) => {
|
|
15
|
+
const r = { ...e, hasHeader: o, ranges: i }, u = a === s;
|
|
16
|
+
u || f?.(r), c?.(a, u, a === t), d?.({ option: a, tableOptions: r });
|
|
17
|
+
}, [d, c, t, s, o, i, e]), N = w(async (a, r) => null, []);
|
|
18
|
+
return n(F, { title: "Insert Table", options: m, onDone: D, onValidateOption: N, defaultOption: t, cancelOption: s, autoFocusSel: ".range-input input", sx: { width: "360px", ...x }, ...b, children: T(I, { sx: { paddingTop: (a) => a.spacing(1), paddingBottom: (a) => a.spacing(0), rowGap: (a) => a.spacing(1), display: "flex", flexDirection: "column" }, children: [n(R, { formName: "range", value: i, onChangeInput: (a) => k(a), resolvedAddress: l ? l().getNames().getRanges.bind(l().getNames()) : void 0, onFocus: (a) => {
|
|
19
|
+
h || a.target?.select(), O(!0);
|
|
20
|
+
} }), n(V, { control: n(j, { checked: o, onChange: () => C(!o) }), label: "Table has headers", labelPlacement: "end" })] }) });
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
z as TableNewDialog,
|
|
24
|
+
z as default
|
|
25
|
+
};
|