@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,6 +0,0 @@
|
|
|
1
|
-
"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.11
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),t=require("react"),r=require("@mui/material"),k=require("@sheetxl/utils-react"),D=require("@sheetxl/utils-mui"),T=require("./Chm8zWC8ekU1Qug_.cjs"),y=["Ok","Cancel"],b=t.memo(x=>{const{tableOptions:a,context:c,onOption:u,onValidateOption:N,onDone:p,options:d=y,defaultOption:l=d?.[0],cancelOption:s="Cancel",sx:O,...h}=x,[m,f]=t.useState(!1),[o,C]=t.useState(()=>a?.hasHeader??!1),[i,j]=t.useState(()=>a?.ranges??null),q=k.useCallbackRef(e=>{const g={...a,hasHeader:o,ranges:i};u?.(e,e===s,e===l),p?.({option:e,tableOptions:g})},[p,u,l,s,o,i,a]),S=t.useCallback(async(e,g)=>null,[]);return n.jsx(D.OptionsDialog,{title:"Insert Table",options:d,onDone:q,onValidateOption:S,defaultOption:l,cancelOption:s,autoFocusSel:".range-input input",sx:{width:"360px",...O},...h,children:n.jsxs(r.Box,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),display:"flex",flexDirection:"column"},children:[n.jsx(T.RangeInput,{formName:"range",value:i,onChangeInput:e=>j(e),resolvedAddress:c.getNames().getRanges.bind(c.getNames()),onFocus:e=>{m||e.target?.select(),f(!0)}}),n.jsx(r.FormControlLabel,{control:n.jsx(r.Checkbox,{checked:o,onChange:()=>C(!o)}),label:"Table has headers",labelPlacement:"end"})]})})});exports.TableNewDialog=b,exports.default=b;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.11
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("react"),c=require("@mui/material/styles"),d=require("@mui/material"),g=require("@sheetxl/utils-react"),P=require("@sheetxl/utils-mui"),B=["Ok","Cancel"],b=l.memo(y=>{const{initialComments:k=null,onUpdateComments:f,context:v,onOption:x,onValidateOption:p,onDone:u,options:h=B,defaultOption:m=h?.[0],cancelOption:s="Cancel",sx:F,...T}=y,C=l.useMemo(()=>{const t=k??v?.()?.getComments();let e="";if(t&&t.content&&t.content.runs){const o=t.content.runs;for(let i=0;i<o.length;i++){const a=o[i];e+=a?.text}}return e},[]),[n,q]=l.useState(C),[j,w]=l.useState(!1),O=l.useCallback(async(t,e)=>null,[]),D=g.useCallbackRef(async t=>{const e=n===""?[]:n.split(`
|
|
7
|
-
`);if(t!==s){const o=[];for(let a=0;a<e.length;a++)o.push({text:e[a]});f?.({content:{runs:o}})}x?.(t,t===s,t===m),u?.()},[n,f,u,x,m,s]),S=g.useCallbackRef(t=>{q(t.target.value),O(t.target.value,null)},[p]),M=g.useCallbackRef(async t=>{let e=await Promise.resolve(p?.(t));try{e!==!1&&(e=await O(n,t))}catch{}return e??!0},[p,n]);return r.jsx(P.OptionsDialog,{title:(C?"Edit":"Insert")+" Comments",options:h,onDone:u,onOption:t=>D(t),onValidateOption:M,defaultOption:m,cancelOption:s,autoFocusSel:".autoFocus",sx:{width:"480px",...F},...T,children:r.jsx(d.Box,{sx:{paddingTop:t=>t.spacing(1),paddingBottom:t=>t.spacing(0),rowGap:t=>t.spacing(1),display:"flex",flexDirection:"column"},children:r.jsx(d.FormControl,{sx:{paddingTop:t=>t.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:r.jsx(d.TextField,{label:"Comments",placeholder:"Enter a comment.",onFocus:t=>{j||t.target?.select(),w(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:t=>t.spacing(.5)}},slotProps:{inputLabel:{shrink:!0},htmlInput:{className:"autoFocus",spellCheck:!1,autoComplete:"off",sx:{paddingTop:t=>t.spacing(1.25),paddingBottom:t=>t.spacing(.75),backgroundImage:`linear-gradient(${c.alpha("#fff",c.getOverlayAlpha(5))}, ${c.alpha("#fff",c.getOverlayAlpha(5))})`}}},value:n,onChange:S,onContextMenu:t=>{t.stopPropagation()}})})})})});exports.CommentsDialog=b,exports.default=b;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.11
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("react"),n=require("@mui/material/styles"),s=require("@mui/material"),h=require("@sheetxl/utils-react"),I=require("@sheetxl/utils-mui"),B=["Ok","Cancel"],O=l.memo(b=>{const{initialHyperlink:o=null,initialDisplay:v=null,onUpdateHyperlink:f,context:r,onOption:m,onValidateOption:u,onDone:c,options:y=B,defaultOption:d=y?.[0],cancelOption:p="Cancel",sx:F,...D}=b,j=l.useMemo(()=>(o??r?.()?.getHyperlink())!==null,[]),k=l.useMemo(()=>{let e=null,a=null;o&&(typeof o=="string"?a=o:e=o);const x=e??r?.()?.getHyperlink();return{address:a??x?.getAddress()??"",textToDisplay:x?.getDisplayText()??""}},[o,r]),[t,H]=l.useState(k.address),[g,M]=l.useState(()=>{const e=r?.().toTextUnformatted()??v;return e===k.address?"":e}),[q,C]=l.useState(!1),w=l.useCallback(e=>{M(e.target.value)},[]),T=l.useCallback(async(e,a)=>null,[]),A=h.useCallbackRef(async e=>{e!==p&&f?.(t===""?null:{address:t},g),m?.(e,e===p,e===d),c?.()},[t,g,f,c,m,d,p]),P=h.useCallbackRef(e=>{H(e.target.value),T(e.target.value,null)},[u]),S=h.useCallbackRef(async e=>{let a=await Promise.resolve(u?.(e));try{a!==!1&&(a=await T(t,e))}catch{}return a??!0},[u]);return i.jsx(I.OptionsDialog,{title:(j?"Edit":"Insert")+" Link",options:y,onDone:c,onOption:e=>A(e),onValidateOption:S,defaultOption:d,cancelOption:p,autoFocusSel:".autoFocus",sx:{width:"480px",...F},...D,children:i.jsxs(s.Box,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),display:"flex",flexDirection:"column"},children:[i.jsx(s.FormControl,{sx:{paddingTop:e=>e.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:i.jsx(s.TextField,{label:"Address",placeholder:"Enter a url or cell reference.",onFocus:e=>{q||e.target?.select(),C(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5)}},slotProps:{inputLabel:{shrink:!0},htmlInput:{className:"autoFocus",spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75),backgroundImage:`linear-gradient(${n.alpha("#fff",n.getOverlayAlpha(5))}, ${n.alpha("#fff",n.getOverlayAlpha(5))})`}}},value:t,onChange:P,onContextMenu:e=>{e.stopPropagation()}})}),i.jsx(s.FormControl,{sx:{paddingTop:e=>e.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:i.jsx(s.TextField,{label:"Display Text",placeholder:t?.startsWith("#")?t.substring(1):t,onFocus:()=>{C(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5)}},slotProps:{inputLabel:{shrink:!0},htmlInput:{spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75),backgroundImage:`linear-gradient(${n.alpha("#fff",n.getOverlayAlpha(5))}, ${n.alpha("#fff",n.getOverlayAlpha(5))})`}}},value:g,onChange:w,onContextMenu:e=>{e.stopPropagation()}})})]})})});exports.HyperlinkDialog=O,exports.default=O;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as n, jsxs as D } from "react/jsx-runtime";
|
|
2
|
-
import { memo as N, useState as i, useCallback as T } from "react";
|
|
3
|
-
import { Box as w, FormControlLabel as F, Checkbox as j } from "@mui/material";
|
|
4
|
-
import { useCallbackRef as v } from "@sheetxl/utils-react";
|
|
5
|
-
import { OptionsDialog as y } from "@sheetxl/utils-mui";
|
|
6
|
-
import { R } from "./BUE0z3b78bw14bK3.mjs";
|
|
7
|
-
/**
|
|
8
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.11
|
|
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"], P = N((g) => {
|
|
14
|
-
const { tableOptions: e, context: r, onOption: p, onValidateOption: H, onDone: c, options: d = B, defaultOption: t = d?.[0], cancelOption: s = "Cancel", sx: u, ...f } = g, [b, x] = i(!1), [o, h] = i(() => e?.hasHeader ?? !1), [l, O] = i(() => e?.ranges ?? null), C = v((a) => {
|
|
15
|
-
const m = { ...e, hasHeader: o, ranges: l };
|
|
16
|
-
p?.(a, a === s, a === t), c?.({ option: a, tableOptions: m });
|
|
17
|
-
}, [c, p, t, s, o, l, e]), k = T(async (a, m) => null, []);
|
|
18
|
-
return n(y, { title: "Insert Table", options: d, onDone: C, onValidateOption: k, defaultOption: t, cancelOption: s, autoFocusSel: ".range-input input", sx: { width: "360px", ...u }, ...f, children: D(w, { 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: l, onChangeInput: (a) => O(a), resolvedAddress: r.getNames().getRanges.bind(r.getNames()), onFocus: (a) => {
|
|
19
|
-
b || a.target?.select(), x(!0);
|
|
20
|
-
} }), n(F, { control: n(j, { checked: o, onChange: () => h(!o) }), label: "Table has headers", labelPlacement: "end" })] }) });
|
|
21
|
-
});
|
|
22
|
-
export {
|
|
23
|
-
P as TableNewDialog,
|
|
24
|
-
P as default
|
|
25
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { memo as P, useMemo as E, useState as h, useCallback as S } from "react";
|
|
3
|
-
import { alpha as C, getOverlayAlpha as O } from "@mui/material/styles";
|
|
4
|
-
import { Box as V, FormControl as $, TextField as j } from "@mui/material";
|
|
5
|
-
import { useCallbackRef as m } 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.11
|
|
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 A = ["Ok", "Cancel"], W = P((F) => {
|
|
14
|
-
const { initialComments: k = null, onUpdateComments: u, context: y, onOption: d, onValidateOption: p, onDone: r, options: g = A, defaultOption: c = g?.[0], cancelOption: s = "Cancel", sx: T, ...b } = F, f = E(() => {
|
|
15
|
-
const t = k ?? y?.()?.getComments();
|
|
16
|
-
let o = "";
|
|
17
|
-
if (t && t.content && t.content.runs) {
|
|
18
|
-
const e = t.content.runs;
|
|
19
|
-
for (let i = 0; i < e.length; i++) {
|
|
20
|
-
const a = e[i];
|
|
21
|
-
o += a?.text;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return o;
|
|
25
|
-
}, []), [n, v] = h(f), [w, D] = h(!1), x = S(async (t, o) => null, []), B = m(async (t) => {
|
|
26
|
-
const o = n === "" ? [] : n.split(`
|
|
27
|
-
`);
|
|
28
|
-
if (t !== s) {
|
|
29
|
-
const e = [];
|
|
30
|
-
for (let a = 0; a < o.length; a++) e.push({ text: o[a] });
|
|
31
|
-
u?.({ content: { runs: e } });
|
|
32
|
-
}
|
|
33
|
-
d?.(t, t === s, t === c), r?.();
|
|
34
|
-
}, [n, u, r, d, c, s]), I = m((t) => {
|
|
35
|
-
v(t.target.value), x(t.target.value, null);
|
|
36
|
-
}, [p]), M = m(async (t) => {
|
|
37
|
-
let o = await Promise.resolve(p?.(t));
|
|
38
|
-
try {
|
|
39
|
-
o !== !1 && (o = await x(n, t));
|
|
40
|
-
} catch {
|
|
41
|
-
}
|
|
42
|
-
return o ?? !0;
|
|
43
|
-
}, [p, n]);
|
|
44
|
-
return l(z, { title: (f ? "Edit" : "Insert") + " Comments", options: g, onDone: r, onOption: (t) => B(t), onValidateOption: M, defaultOption: c, cancelOption: s, autoFocusSel: ".autoFocus", sx: { width: "480px", ...T }, ...b, children: l(V, { sx: { paddingTop: (t) => t.spacing(1), paddingBottom: (t) => t.spacing(0), rowGap: (t) => t.spacing(1), display: "flex", flexDirection: "column" }, children: l($, { sx: { paddingTop: (t) => t.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: l(j, { label: "Comments", placeholder: "Enter a comment.", onFocus: (t) => {
|
|
45
|
-
w || t.target?.select(), D(!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(${C("#fff", O(5))}, ${C("#fff", O(5))})` } } }, value: n, onChange: I, onContextMenu: (t) => {
|
|
47
|
-
t.stopPropagation();
|
|
48
|
-
} }) }) }) });
|
|
49
|
-
});
|
|
50
|
-
export {
|
|
51
|
-
W as CommentsDialog,
|
|
52
|
-
W as default
|
|
53
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsx as p, jsxs as j } from "react/jsx-runtime";
|
|
2
|
-
import { memo as E, useMemo as R, useState as d, useCallback as V } from "react";
|
|
3
|
-
import { Box as L } from "@mui/material";
|
|
4
|
-
import { useCallbackRef as m } from "@sheetxl/utils-react";
|
|
5
|
-
import { OptionsDialog as S } from "@sheetxl/utils-mui";
|
|
6
|
-
import { N as A, R as G } from "./BUE0z3b78bw14bK3.mjs";
|
|
7
|
-
/**
|
|
8
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.11
|
|
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"], P = E((C) => {
|
|
14
|
-
const { value: a = null, context: t, onOption: u, onValidateOption: U, onDone: c, onUpdate: g, options: f = M, defaultOption: x = f?.[0], cancelOption: N = "Cancel", sx: h, ...v } = C, y = R(() => t?.getNames().findValidName("Range1"), []), i = R(() => {
|
|
15
|
-
if (!a) return !0;
|
|
16
|
-
}, []), [o, D] = d({ displayText: a?.getName() ?? y, errorText: null }), [n, w] = d({ displayValue: a?.getRanges() ?? t?.selection() ?? null, errorText: null }), [T, O] = d(!1), F = V(async (e) => !o.errorText && !n.errorText, [t]), b = m((e, l, r) => {
|
|
17
|
-
if (!l) {
|
|
18
|
-
let s = null;
|
|
19
|
-
i ? 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(), g(s, i));
|
|
22
|
-
}
|
|
23
|
-
u?.(e, l, r), c?.();
|
|
24
|
-
}, [t, o, n, c, u, x, N, g]), k = m((e) => {
|
|
25
|
-
let l = null;
|
|
26
|
-
try {
|
|
27
|
-
t?.getNames().validateName(e);
|
|
28
|
-
} catch (r) {
|
|
29
|
-
l = r.message;
|
|
30
|
-
}
|
|
31
|
-
D({ displayText: e, errorText: l });
|
|
32
|
-
}, []), B = m((e) => {
|
|
33
|
-
a && a.getName().toLowerCase() === e.toLowerCase() || t?.getNames().validateName(e);
|
|
34
|
-
}, [t, a]), I = V((e) => {
|
|
35
|
-
w({ displayValue: e ?? null, errorText: null });
|
|
36
|
-
}, []);
|
|
37
|
-
return p(S, { title: (i ? "Define" : "Edit") + " Range", options: f, onOption: b, onValidateOption: F, defaultOption: x, cancelOption: N, 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: [p(A, { formName: "name", defaultInput: y, value: o.displayText, onChangeInput: k, onValidate: B, onFocus: (e) => {
|
|
38
|
-
T || e.target?.select(), O(!0);
|
|
39
|
-
} }), p(G, { formName: "range", value: n.displayValue, onChangeInput: I, resolvedAddress: t.getNames().getRanges.bind(t.getNames()), onFocus: (e) => {
|
|
40
|
-
T || e.target?.select(), O(!0);
|
|
41
|
-
} })] }) });
|
|
42
|
-
});
|
|
43
|
-
export {
|
|
44
|
-
P as NamedReferenceDialog,
|
|
45
|
-
P as default
|
|
46
|
-
};
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { jsx as i, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import { memo as oe, useRef as y, useState as b, useEffect as K, useLayoutEffect as pe, useMemo as de } from "react";
|
|
3
|
-
import { alpha as F, getOverlayAlpha as w } from "@mui/material/styles";
|
|
4
|
-
import { DialogContent as ue, Box as O, TextField as _, InputAdornment as fe, Collapse as ee, MenuItem as ge, FormControl as me, InputLabel as xe, Select as he } from "@mui/material";
|
|
5
|
-
import { ICell as c, IRange as k } from "@sheetxl/sdk";
|
|
6
|
-
import { useCallbackRef as z, KeyCodes as Oe, DynamicIcon as m, KeyModifiers as C } from "@sheetxl/utils-react";
|
|
7
|
-
import { InternalWindow as ye, ExhibitOptionButton as x, ExhibitDivider as Ce } from "@sheetxl/utils-mui";
|
|
8
|
-
import { u as be } from "./BUE0z3b78bw14bK3.mjs";
|
|
9
|
-
/**
|
|
10
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.11
|
|
11
|
-
*
|
|
12
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
13
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
14
|
-
*/
|
|
15
|
-
const P = { width: "1.5rem", height: "1.5rem" }, $ = oe((T) => {
|
|
16
|
-
const { label: h, value: a, options: l, onSelect: d, tabIndex: v = 0, ...D } = T, [A, R] = b(() => ie(a, l));
|
|
17
|
-
K(() => {
|
|
18
|
-
R(ie(a, l));
|
|
19
|
-
}, [a, l]);
|
|
20
|
-
const M = z((u) => {
|
|
21
|
-
R(u.target.value), d?.(l[u.target.value]);
|
|
22
|
-
}, [d, l]), s = de(() => Object.keys(l).map((u) => i(ge, { value: u, children: u }, u)), [l]);
|
|
23
|
-
return p(me, { sx: { minWidth: 135 }, size: "small", children: [i(xe, { children: h }), i(he, { inputProps: { tabIndex: v }, value: A, label: h, onChange: M, sx: { backgroundImage: `linear-gradient(${F("#fff", w(5))}, ${F("#fff", w(5))})` }, ...D, children: s })] });
|
|
24
|
-
}), ne = { Workbook: "workbook", Sheet: "sheet" }, te = { enter: 140, exit: 140 }, le = { Formulas: c.Content.Formulas, Values: c.Content.Values, Notes: c.Content.Notes, Comments: c.Content.Comments }, se = { ...le };
|
|
25
|
-
delete se.Values;
|
|
26
|
-
const ve = { "By Rows": !0, "By Columns": !1 }, ie = (T, h) => {
|
|
27
|
-
const a = Object.keys(h);
|
|
28
|
-
for (let l = 0; l < a.length; l++) {
|
|
29
|
-
const d = a[l];
|
|
30
|
-
if (h[d] === T) return d;
|
|
31
|
-
}
|
|
32
|
-
}, Ke = oe((T) => {
|
|
33
|
-
const { replace: h = !1, findText: a, replaceText: l, findOptions: d, replaceOptions: v, title: D, onHide: A, onFindOrReplace: R, ...M } = T, s = y(null), u = y(null), V = y(null), j = y(null), N = y(null), H = y(null), U = (e, n) => {
|
|
34
|
-
n && (n.start(e, { center: !1 }), setTimeout(() => n.stop(e), 180));
|
|
35
|
-
}, [G, I] = b(!1), [B, re] = b(!1), [f, W] = b(h), [q, L] = b(!1), [J, Q] = b(!1), [o, r] = b({ replaceText: null, replace: h, replaceOptions: {}, findOptions: { text: null, matchCase: !1, matchEntireCell: !1, useRegex: !1, orientation: k.Orientation.Row, fields: [c.Content.Formulas] }, scope: ne.Sheet }), E = z(async (e, n, t, S) => {
|
|
36
|
-
if (!R) return;
|
|
37
|
-
const g = { ...o };
|
|
38
|
-
g.replaceOptions = { ...g.replaceOptions }, g.findOptions = { ...g.findOptions }, g.replaceOptions.maxCount = t ? void 0 : 1, g.replace = n, n && o.findOptions.fields?.[0] === c.Content.Values && (g.findOptions.fields = [c.Content.Formulas]), g.findOptions.reverse = !e;
|
|
39
|
-
const ce = await R({ autoFocus: S, ...g });
|
|
40
|
-
L(ce === 0);
|
|
41
|
-
}, [o, R]);
|
|
42
|
-
K(() => {
|
|
43
|
-
L(!1);
|
|
44
|
-
}, [o, B, f]);
|
|
45
|
-
const X = z((e, n) => {
|
|
46
|
-
if (e.keyCode === Oe.Enter) {
|
|
47
|
-
if (!o.findOptions.text) return;
|
|
48
|
-
let t = !0, S = !1;
|
|
49
|
-
e.shiftKey && (t = !1), n ? (e.ctrlKey && e.altKey && (S = !0), U(e, S ? H.current : N.current)) : U(e, t ? j.current : V.current), E(t, n, S, !1);
|
|
50
|
-
}
|
|
51
|
-
}, [o]), Y = y(null);
|
|
52
|
-
pe(() => {
|
|
53
|
-
r((e) => {
|
|
54
|
-
const n = { ...e };
|
|
55
|
-
n.findOptions.text = a && a.length > 0 ? a : e.findOptions.text ?? "", I(!0), l !== void 0 && (n.replaceText = l), d && (n.findOptions = { ...n.findOptions, ...d }), n.replaceText || (n.replaceText = ""), n.replaceOptions && (n.replaceOptions = { ...n.replaceOptions }), v && (n.replaceOptions = { ...n.replaceOptions, ...v }), o.findOptions.fields?.[0] || (o.findOptions.fields = [c.Content.Formulas]);
|
|
56
|
-
const t = !(!v && l === void 0);
|
|
57
|
-
return t && W(t), n;
|
|
58
|
-
}), J || Y.current?.focus();
|
|
59
|
-
}, [a, l, d, v]), K(() => {
|
|
60
|
-
f ? (o.findOptions.fields[0], c.Content.Values) : I(!0);
|
|
61
|
-
}, [f]), K(() => {
|
|
62
|
-
if (G && s.current && o.findOptions.text === s.current.value) return s.current === document.activeElement || s.current.contains(document.activeElement) ? (s.current?.select(), void I(!1)) : void s.current.addEventListener("focus", () => {
|
|
63
|
-
s.current?.select(), I(!1);
|
|
64
|
-
}, { once: !0 });
|
|
65
|
-
}, [G, o]);
|
|
66
|
-
const [ae, { width: Z }] = be();
|
|
67
|
-
return i(ye, { ref: Y, title: D ?? (f ? "Find & Replace" : "Find"), initialPosition: { y: "35" }, autoFocusSel: ".input", onHide: A, onFocus: () => Q(!0), onBlur: () => {
|
|
68
|
-
Q(!1), L(!1);
|
|
69
|
-
}, slotProps: { paper: { elevation: J ? 3 : 1 } }, ...M, children: p(ue, { dividers: !0, ref: ae, sx: { display: "flex", flexDirection: "column", paddingLeft: (e) => e.spacing(1.5), paddingRight: (e) => e.spacing(1.5) }, onKeyDown: (e) => {
|
|
70
|
-
if (e.key === "h" && e.ctrlKey) W(!0), s.current?.contains(document.activeElement) && u.current?.focus();
|
|
71
|
-
else if (e.key === "f" && e.ctrlKey) s.current?.focus();
|
|
72
|
-
else if (e.key === "c" && e.altKey) r((n) => {
|
|
73
|
-
const t = { ...n };
|
|
74
|
-
return t.findOptions.matchCase = !n.findOptions.matchCase, t;
|
|
75
|
-
});
|
|
76
|
-
else if (e.key === "e" && e.altKey) r((n) => {
|
|
77
|
-
const t = { ...n };
|
|
78
|
-
return t.findOptions.matchEntireCell = !n.findOptions.matchEntireCell, t;
|
|
79
|
-
});
|
|
80
|
-
else {
|
|
81
|
-
if (e.key !== "r" || !e.altKey) return;
|
|
82
|
-
r((n) => {
|
|
83
|
-
const t = { ...n };
|
|
84
|
-
return t.findOptions.useRegex = !n.findOptions.useRegex, t;
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
e.preventDefault();
|
|
88
|
-
}, children: [p(O, { sx: { display: "flex", flexDirection: "row", gap: (e) => e.spacing(1) }, children: [p(O, { sx: { display: "flex", flexDirection: "row", alignItems: "start", gap: (e) => e.spacing(0.25), paddingTop: "3px" }, children: [i(x, { selected: B, onSelectToggle: (e) => {
|
|
89
|
-
re(e);
|
|
90
|
-
}, preventFocus: !0, label: "Toggle Additional Options", icon: i(m, { iconKey: "FindOptions" }) }), i(x, { selected: f, onSelectToggle: (e) => {
|
|
91
|
-
W(e);
|
|
92
|
-
}, preventFocus: !0, label: "Toggle Replace", icon: i(m, { iconKey: "FindReplaceToggle" }), shortcut: { key: f ? "F" : "H", modifiers: [C.Ctrl] } })] }), p(O, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", boxSizing: "border-box" }, children: [p(O, { sx: { display: "flex", flexDirection: "row", alignItems: "center" }, children: [i(_, { label: "Find", slotProps: { input: { sx: { paddingRight: (e) => e.spacing(1), minWidth: Z > 460 ? "20em" : void 0, backgroundImage: `linear-gradient(${F("#fff", w(5))}, ${F("#fff", w(5))})` }, endAdornment: i(fe, { position: "end", children: p(O, { sx: { display: "flex", alignItems: "center", flexDirection: "row", gap: "2px" }, children: [i(x, { style: P, selected: o.findOptions.matchCase, onBlur: () => {
|
|
93
|
-
console.log("blur");
|
|
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: [C.Alt] }, icon: i(m, { iconKey: "FindCaseSensitive", size: "1rem" }) }), i(x, { style: P, 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: [C.Alt] }, icon: i(m, { iconKey: "FindWholeWord", size: "1rem" }) }), i(x, { style: P, 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: [C.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) => q ? `${e.palette.error.main} !important` : void 0 }, "& .MuiInputLabel-outlined": { color: (e) => q ? `${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) => X(e, !1), onContextMenu: (e) => {
|
|
115
|
-
e.stopPropagation();
|
|
116
|
-
} }), i(x, { selected: o.findOptions.reverse, onSelectToggle: (e) => {
|
|
117
|
-
E(!1, !1);
|
|
118
|
-
}, touchRippleRef: V, label: "", shortcut: { key: "Enter", modifiers: [C.Shift] }, icon: i(m, { iconKey: o.findOptions.orientation !== k.Orientation.Column ? "ArrowBack" : "ArrowUpward" }), disabled: !o.findOptions.text }), i(x, { selected: !o.findOptions.reverse, onSelectToggle: (e) => {
|
|
119
|
-
E(!0, !1);
|
|
120
|
-
}, touchRippleRef: j, label: "Next Match", shortcut: { key: "Enter" }, icon: i(m, { iconKey: o.findOptions.orientation !== k.Orientation.Column ? "ArrowForward" : "ArrowDownward" }), disabled: !o.findOptions.text })] }), i(ee, { in: f, timeout: te, onExit: () => {
|
|
121
|
-
s.current?.focus();
|
|
122
|
-
}, children: p(O, { sx: { display: "flex", flexDirection: "row", alignItems: "center", marginTop: (e) => e.spacing(2) }, children: [i(_, { label: "Replace", slotProps: { input: { sx: { paddingRight: (e) => e.spacing(1), backgroundImage: `linear-gradient(${F("#fff", w(5))}, ${F("#fff", w(5))})` } }, inputLabel: { shrink: !0 }, htmlInput: { ref: u, 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) => X(e, !0), onContextMenu: (e) => {
|
|
128
|
-
e.stopPropagation();
|
|
129
|
-
} }), i(x, { onSelectToggle: (e) => {
|
|
130
|
-
E(!0, !0);
|
|
131
|
-
}, touchRippleRef: N, label: "Replace", shortcut: { key: "Enter" }, icon: i(m, { iconKey: "FindReplace" }), disabled: !o.findOptions.text }), i(x, { onSelectToggle: (e) => {
|
|
132
|
-
E(!0, !0, !0);
|
|
133
|
-
}, touchRippleRef: H, label: "Replace All", shortcut: { key: "Enter", modifiers: [C.Ctrl, C.Alt] }, icon: i(m, { iconKey: "FindReplaceAll" }), disabled: !o.findOptions.text })] }) })] })] }), i(ee, { in: B, timeout: te, onExit: () => {
|
|
134
|
-
s.current?.focus();
|
|
135
|
-
}, children: p(O, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", gap: (e) => e.spacing(1.5), marginTop: (e) => e.spacing(1) }, children: [i(Ce, { orientation: "horizontal", sx: { marginBottom: (e) => e.spacing(1.5) } }), p(O, { sx: { display: "flex", flexDirection: Z >= 383 ? "row" : "column", justifyContent: "space-evenly", alignItems: "center", gap: (e) => e.spacing(1), rowGap: (e) => e.spacing(2) }, tabIndex: -1, children: [i($, { label: "Within", value: o.scope, options: ne, onSelect: (e) => {
|
|
136
|
-
r((n) => {
|
|
137
|
-
const t = { ...n };
|
|
138
|
-
return t.scope = e, t;
|
|
139
|
-
});
|
|
140
|
-
} }), i($, { label: "Search", value: o.findOptions.orientation !== k.Orientation.Column, options: ve, 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($, { label: "Look in", value: f && o.findOptions.fields?.[0] === c.Content.Values ? c.Content.Formulas : o.findOptions.fields?.[0], options: f ? se : le, onSelect: (e) => {
|
|
146
|
-
r((n) => {
|
|
147
|
-
const t = { ...n };
|
|
148
|
-
return t.findOptions.fields = [e], t;
|
|
149
|
-
});
|
|
150
|
-
} })] })] }) })] }) });
|
|
151
|
-
});
|
|
152
|
-
export {
|
|
153
|
-
Ke as FindReplaceWindow,
|
|
154
|
-
ne as ScopeOptions,
|
|
155
|
-
Ke as default
|
|
156
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as n, jsxs as u } from "react/jsx-runtime";
|
|
2
|
-
import { useState as v } from "react";
|
|
3
|
-
import { Box as O, FormControlLabel as a, Checkbox as l } from "@mui/material";
|
|
4
|
-
import { Sort as s, IRange as r } from "@sheetxl/sdk";
|
|
5
|
-
import { useCallbackRef as b } from "@sheetxl/utils-react";
|
|
6
|
-
import { OptionsDialog as f } from "@sheetxl/utils-mui";
|
|
7
|
-
/**
|
|
8
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.11
|
|
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 R = ({ range: p, options: c, cell: m, onDone: d, ...C }) => {
|
|
14
|
-
const [o, t] = v(c ?? s.DefaultRangeOptions), h = b((e) => {
|
|
15
|
-
let i = null;
|
|
16
|
-
e === "Sort" && (i = { ...c, options: o }), d?.(i);
|
|
17
|
-
}, [o, d, c]);
|
|
18
|
-
return n(f, { title: "Sort", options: ["Sort", "Cancel"], onDone: h, ...C, children: u(O, { sx: { display: "flex", flexDirection: "column" }, children: [n(a, { control: n(l, { checked: !o.reverse, onChange: () => t((e) => ({ ...e, reverse: !e.reverse })) }), label: "Is Ascending", labelPlacement: "end" }), n(a, { control: n(l, { checked: o.hasHeader, onChange: () => t((e) => ({ ...e, hasHeader: !e.hasHeader })) }), label: "Has Header", labelPlacement: "end" }), n(a, { control: n(l, { checked: o.collatorOptions?.sensitivity === s.CaseSensitiveOptions.sensitivity, onChange: () => t((e) => ({ ...e, collatorOptions: o.collatorOptions?.sensitivity === s.CaseSensitiveOptions.sensitivity ? s.CaseInsensitiveOptions : s.CaseSensitiveOptions })) }), label: "Case Sensitive", labelPlacement: "end" }), n(a, { control: n(l, { checked: o.orientation === r.Orientation.Row, onChange: () => t((e) => {
|
|
19
|
-
const i = e.orientation === r.Orientation.Row ? r.Orientation.Column : r.Orientation.Row;
|
|
20
|
-
return { ...p.getDefaultSortCriteria(i, m).options, includeHidden: e.includeHidden, reverse: e.reverse, orientation: i };
|
|
21
|
-
}) }), label: "Row Sort", labelPlacement: "end" }), n(a, { control: n(l, { checked: o.includeHidden, onChange: () => t((e) => ({ ...e, includeHidden: !e.includeHidden })) }), label: "Include Hidden", labelPlacement: "end" })] }) });
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
R as SortDialog,
|
|
25
|
-
R as default
|
|
26
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { jsx as o, jsxs as E } from "react/jsx-runtime";
|
|
2
|
-
import { memo as j, useMemo as O, useState as m, useCallback as b } from "react";
|
|
3
|
-
import { alpha as i, getOverlayAlpha as r } from "@mui/material/styles";
|
|
4
|
-
import { Box as S, FormControl as D, TextField as F } from "@mui/material";
|
|
5
|
-
import { useCallbackRef as f } from "@sheetxl/utils-react";
|
|
6
|
-
import { OptionsDialog as U } from "@sheetxl/utils-mui";
|
|
7
|
-
/**
|
|
8
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.11
|
|
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 V = ["Ok", "Cancel"], Q = j((v) => {
|
|
14
|
-
const { initialHyperlink: n = null, initialDisplay: H = null, onUpdateHyperlink: x, context: s, onOption: h, onValidateOption: p, onDone: d, options: y = V, defaultOption: c = y?.[0], cancelOption: l = "Cancel", sx: w, ...I } = v, M = O(() => (n ?? s?.()?.getHyperlink()) !== null, []), k = O(() => {
|
|
15
|
-
let e = null, t = null;
|
|
16
|
-
n && (typeof n == "string" ? t = n : e = n);
|
|
17
|
-
const g = e ?? s?.()?.getHyperlink();
|
|
18
|
-
return { address: t ?? g?.getAddress() ?? "", textToDisplay: g?.getDisplayText() ?? "" };
|
|
19
|
-
}, [n, s]), [a, P] = m(k.address), [u, B] = m(() => {
|
|
20
|
-
const e = s?.().toTextUnformatted() ?? H;
|
|
21
|
-
return e === k.address ? "" : e;
|
|
22
|
-
}), [$, T] = m(!1), A = b((e) => {
|
|
23
|
-
B(e.target.value);
|
|
24
|
-
}, []), C = b(async (e, t) => null, []), L = f(async (e) => {
|
|
25
|
-
e !== l && x?.(a === "" ? null : { address: a }, u), h?.(e, e === l, e === c), d?.();
|
|
26
|
-
}, [a, u, x, d, h, c, l]), W = f((e) => {
|
|
27
|
-
P(e.target.value), C(e.target.value, null);
|
|
28
|
-
}, [p]), z = f(async (e) => {
|
|
29
|
-
let t = await Promise.resolve(p?.(e));
|
|
30
|
-
try {
|
|
31
|
-
t !== !1 && (t = await C(a, e));
|
|
32
|
-
} catch {
|
|
33
|
-
}
|
|
34
|
-
return t ?? !0;
|
|
35
|
-
}, [p]);
|
|
36
|
-
return o(U, { title: (M ? "Edit" : "Insert") + " Link", options: y, onDone: d, onOption: (e) => L(e), onValidateOption: z, defaultOption: c, cancelOption: l, autoFocusSel: ".autoFocus", sx: { width: "480px", ...w }, ...I, children: E(S, { sx: { paddingTop: (e) => e.spacing(1), paddingBottom: (e) => e.spacing(0), rowGap: (e) => e.spacing(1), display: "flex", flexDirection: "column" }, children: [o(D, { sx: { paddingTop: (e) => e.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: o(F, { label: "Address", placeholder: "Enter a url or cell reference.", onFocus: (e) => {
|
|
37
|
-
$ || e.target?.select(), T(!0);
|
|
38
|
-
}, 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: a, onChange: W, onContextMenu: (e) => {
|
|
39
|
-
e.stopPropagation();
|
|
40
|
-
} }) }), o(D, { sx: { paddingTop: (e) => e.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: o(F, { label: "Display Text", placeholder: a?.startsWith("#") ? a.substring(1) : a, onFocus: () => {
|
|
41
|
-
T(!0);
|
|
42
|
-
}, 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: u, onChange: A, onContextMenu: (e) => {
|
|
43
|
-
e.stopPropagation();
|
|
44
|
-
} }) })] }) });
|
|
45
|
-
});
|
|
46
|
-
export {
|
|
47
|
-
Q as HyperlinkDialog,
|
|
48
|
-
Q as default
|
|
49
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.11
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
8
|
-
import { memo as t, useState as o, useCallback as a } from "react";
|
|
9
|
-
import { Box as i, FormControlLabel as l, Checkbox as s } from "@mui/material";
|
|
10
|
-
import { useCallbackRef as r } from "@sheetxl/utils-react";
|
|
11
|
-
import { OptionsDialog as p } from "@sheetxl/utils-mui";
|
|
12
|
-
import { RangeInput as c } from "./index.mjs";
|
|
13
|
-
const m = ["Ok", "Cancel"], d = t((t2) => {
|
|
14
|
-
const { tableOptions: d2, context: u, onOption: g, onValidateOption: f, onDone: h, options: x = m, defaultOption: O = x?.[0], cancelOption: b = "Cancel", sx: C, ...D } = t2, [N, T] = o(false), [j, k] = o(() => d2?.hasHeader ?? false), [v, w] = o(() => d2?.ranges ?? null), y = r((e2) => {
|
|
15
|
-
const n2 = { ...d2, hasHeader: j, ranges: v };
|
|
16
|
-
g?.(e2, e2 === b, e2 === O), h?.({ option: e2, tableOptions: n2 });
|
|
17
|
-
}, [h, g, O, b, j, v, d2]), F = a(async (e2, n2) => null, []);
|
|
18
|
-
return e(p, { title: "Insert Table", options: x, onDone: y, onValidateOption: F, defaultOption: O, cancelOption: b, autoFocusSel: ".range-input input", sx: { width: "360px", ...C }, ...D, children: n(i, { sx: { paddingTop: (e2) => e2.spacing(1), paddingBottom: (e2) => e2.spacing(0), rowGap: (e2) => e2.spacing(1), display: "flex", flexDirection: "column" }, children: [e(c, { formName: "range", value: v, onChangeInput: (e2) => w(e2), resolvedAddress: u.getNames().getRanges.bind(u.getNames()), onFocus: (e2) => {
|
|
19
|
-
N || e2.target?.select(), T(true);
|
|
20
|
-
} }), e(l, { control: e(s, { checked: j, onChange: () => k(!j) }), label: "Table has headers", labelPlacement: "end" })] }) });
|
|
21
|
-
});
|
|
22
|
-
export {
|
|
23
|
-
d as TableNewDialog,
|
|
24
|
-
d as default
|
|
25
|
-
};
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.11
|
|
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 t } from "react/jsx-runtime";
|
|
8
|
-
import { memo as n, useRef as i, useState as o, useEffect as l, useLayoutEffect as r, useMemo as s } from "react";
|
|
9
|
-
import { useMeasure as a } from "react-use";
|
|
10
|
-
import { alpha as c, getOverlayAlpha as p } from "@mui/material/styles";
|
|
11
|
-
import { DialogContent as d, Box as u, TextField as f, InputAdornment as m, Collapse as g, MenuItem as x, FormControl as h, InputLabel as O, Select as y } from "@mui/material";
|
|
12
|
-
import { ICell as C, IRange as b } from "@sheetxl/sdk";
|
|
13
|
-
import { useCallbackRef as v, KeyCodes as R, DynamicIcon as k, KeyModifiers as T } from "@sheetxl/utils-react";
|
|
14
|
-
import { InternalWindow as w, ExhibitOptionButton as F, ExhibitDivider as E } from "@sheetxl/utils-mui";
|
|
15
|
-
const K = { width: "1.5rem", height: "1.5rem" }, S = n((n2) => {
|
|
16
|
-
const { label: i2, value: r2, options: a2, onSelect: d2, tabIndex: u2 = 0, ...f2 } = n2, [m2, g2] = o(() => M(r2, a2));
|
|
17
|
-
l(() => {
|
|
18
|
-
g2(M(r2, a2));
|
|
19
|
-
}, [r2, a2]);
|
|
20
|
-
const C2 = v((e2) => {
|
|
21
|
-
g2(e2.target.value), d2?.(a2[e2.target.value]);
|
|
22
|
-
}, [d2, a2]), b2 = s(() => Object.keys(a2).map((t2) => e(x, { value: t2, children: t2 }, t2)), [a2]);
|
|
23
|
-
return t(h, { sx: { minWidth: 135 }, size: "small", children: [e(O, { children: i2 }), e(y, { inputProps: { tabIndex: u2 }, value: m2, label: i2, onChange: C2, sx: { backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, ...f2, children: b2 })] });
|
|
24
|
-
}), I = { Workbook: "workbook", Sheet: "sheet" }, D = { enter: 140, exit: 140 }, A = { Formulas: C.Content.Formulas, Values: C.Content.Values, Notes: C.Content.Notes, Comments: C.Content.Comments }, B = { ...A };
|
|
25
|
-
delete B.Values;
|
|
26
|
-
const $ = { "By Rows": true, "By Columns": false }, M = (e2, t2) => {
|
|
27
|
-
const n2 = Object.keys(t2);
|
|
28
|
-
for (let i2 = 0; i2 < n2.length; i2++) {
|
|
29
|
-
const o2 = n2[i2];
|
|
30
|
-
if (t2[o2] === e2) return o2;
|
|
31
|
-
}
|
|
32
|
-
}, P = n((n2) => {
|
|
33
|
-
const { replace: s2 = false, findText: x2, replaceText: h2, findOptions: O2, replaceOptions: y2, title: M2, onHide: P2, onFindOrReplace: W, ...z } = n2, L = i(null), V = i(null), N = i(null), j = i(null), H = i(null), U = i(null), G = (e2, t2) => {
|
|
34
|
-
if (!t2) return;
|
|
35
|
-
t2.start(e2, { center: false }), setTimeout(() => t2.stop(e2), 180);
|
|
36
|
-
}, [q, J] = o(false), [Q, X] = o(false), [Y, Z] = o(s2), [_, ee] = o(false), [te, ne] = o(false), [ie, oe] = o({ replaceText: null, replace: s2, replaceOptions: {}, findOptions: { text: null, matchCase: false, matchEntireCell: false, useRegex: false, orientation: b.Orientation.Row, fields: [C.Content.Formulas] }, scope: I.Sheet }), le = v(async (e2, t2, n3, i2) => {
|
|
37
|
-
if (!W) return;
|
|
38
|
-
const o2 = { ...ie };
|
|
39
|
-
o2.replaceOptions = { ...o2.replaceOptions }, o2.findOptions = { ...o2.findOptions }, o2.replaceOptions.maxCount = n3 ? void 0 : 1, o2.replace = t2, t2 && ie.findOptions.fields?.[0] === C.Content.Values && (o2.findOptions.fields = [C.Content.Formulas]), o2.findOptions.reverse = !e2;
|
|
40
|
-
const l2 = await W({ autoFocus: i2, ...o2 });
|
|
41
|
-
ee(0 === l2);
|
|
42
|
-
}, [ie, W]);
|
|
43
|
-
l(() => {
|
|
44
|
-
ee(false);
|
|
45
|
-
}, [ie, Q, Y]);
|
|
46
|
-
const re = v((e2, t2) => {
|
|
47
|
-
if (e2.keyCode === R.Enter) {
|
|
48
|
-
if (!ie.findOptions.text) return;
|
|
49
|
-
let n3 = true, i2 = false;
|
|
50
|
-
e2.shiftKey && (n3 = false), t2 ? (e2.ctrlKey && e2.altKey && (i2 = true), G(e2, i2 ? U.current : H.current)) : G(e2, n3 ? j.current : N.current), le(n3, t2, i2, false);
|
|
51
|
-
}
|
|
52
|
-
}, [ie]), se = i(null);
|
|
53
|
-
r(() => {
|
|
54
|
-
oe((e2) => {
|
|
55
|
-
const t2 = { ...e2 };
|
|
56
|
-
t2.findOptions.text = x2 && x2.length > 0 ? x2 : e2.findOptions.text ?? "", J(true), void 0 !== h2 && (t2.replaceText = h2), O2 && (t2.findOptions = { ...t2.findOptions, ...O2 }), t2.replaceText || (t2.replaceText = ""), t2.replaceOptions && (t2.replaceOptions = { ...t2.replaceOptions }), y2 && (t2.replaceOptions = { ...t2.replaceOptions, ...y2 }), ie.findOptions.fields?.[0] || (ie.findOptions.fields = [C.Content.Formulas]);
|
|
57
|
-
const n3 = !(!y2 && void 0 === h2);
|
|
58
|
-
return n3 && Z(n3), t2;
|
|
59
|
-
}), te || se.current?.focus();
|
|
60
|
-
}, [x2, h2, O2, y2]), l(() => {
|
|
61
|
-
Y ? (ie.findOptions.fields[0], C.Content.Values) : J(true);
|
|
62
|
-
}, [Y]), l(() => {
|
|
63
|
-
if (q && L.current && ie.findOptions.text === L.current.value) return L.current === document.activeElement || L.current.contains(document.activeElement) ? (L.current?.select(), void J(false)) : void L.current.addEventListener("focus", () => {
|
|
64
|
-
L.current?.select(), J(false);
|
|
65
|
-
}, { once: true });
|
|
66
|
-
}, [q, ie]);
|
|
67
|
-
const [ae, { width: ce }] = a();
|
|
68
|
-
return e(w, { ref: se, title: M2 ?? (Y ? "Find & Replace" : "Find"), initialPosition: { y: "35" }, autoFocusSel: ".input", onHide: P2, onFocus: () => ne(true), onBlur: () => {
|
|
69
|
-
ne(false), ee(false);
|
|
70
|
-
}, slotProps: { paper: { elevation: te ? 3 : 1 } }, ...z, children: t(d, { dividers: true, ref: ae, sx: { display: "flex", flexDirection: "column", paddingLeft: (e2) => e2.spacing(1.5), paddingRight: (e2) => e2.spacing(1.5) }, onKeyDown: (e2) => {
|
|
71
|
-
if ("h" === e2.key && e2.ctrlKey) Z(true), L.current?.contains(document.activeElement) && V.current?.focus();
|
|
72
|
-
else if ("f" === e2.key && e2.ctrlKey) L.current?.focus();
|
|
73
|
-
else if ("c" === e2.key && e2.altKey) oe((e3) => {
|
|
74
|
-
const t2 = { ...e3 };
|
|
75
|
-
return t2.findOptions.matchCase = !e3.findOptions.matchCase, t2;
|
|
76
|
-
});
|
|
77
|
-
else if ("e" === e2.key && e2.altKey) oe((e3) => {
|
|
78
|
-
const t2 = { ...e3 };
|
|
79
|
-
return t2.findOptions.matchEntireCell = !e3.findOptions.matchEntireCell, t2;
|
|
80
|
-
});
|
|
81
|
-
else {
|
|
82
|
-
if ("r" !== e2.key || !e2.altKey) return;
|
|
83
|
-
oe((e3) => {
|
|
84
|
-
const t2 = { ...e3 };
|
|
85
|
-
return t2.findOptions.useRegex = !e3.findOptions.useRegex, t2;
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
e2.preventDefault();
|
|
89
|
-
}, children: [t(u, { sx: { display: "flex", flexDirection: "row", gap: (e2) => e2.spacing(1) }, children: [t(u, { sx: { display: "flex", flexDirection: "row", alignItems: "start", gap: (e2) => e2.spacing(0.25), paddingTop: "3px" }, children: [e(F, { selected: Q, onSelectToggle: (e2) => {
|
|
90
|
-
X(e2);
|
|
91
|
-
}, preventFocus: true, label: "Toggle Additional Options", icon: e(k, { iconKey: "FindOptions" }) }), e(F, { selected: Y, onSelectToggle: (e2) => {
|
|
92
|
-
Z(e2);
|
|
93
|
-
}, preventFocus: true, label: "Toggle Replace", icon: e(k, { iconKey: "FindReplaceToggle" }), shortcut: { key: Y ? "F" : "H", modifiers: [T.Ctrl] } })] }), t(u, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", boxSizing: "border-box" }, children: [t(u, { sx: { display: "flex", flexDirection: "row", alignItems: "center" }, children: [e(f, { label: "Find", slotProps: { input: { sx: { paddingRight: (e2) => e2.spacing(1), minWidth: ce > 460 ? "20em" : void 0, backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` }, endAdornment: e(m, { position: "end", children: t(u, { sx: { display: "flex", alignItems: "center", flexDirection: "row", gap: "2px" }, children: [e(F, { style: K, selected: ie.findOptions.matchCase, onBlur: () => {
|
|
94
|
-
console.log("blur");
|
|
95
|
-
}, onSelectToggle: (e2) => {
|
|
96
|
-
oe((t2) => {
|
|
97
|
-
const n3 = { ...t2 };
|
|
98
|
-
return n3.findOptions.matchCase = e2, n3;
|
|
99
|
-
});
|
|
100
|
-
}, label: "Match Case", shortcut: { key: "C", modifiers: [T.Alt] }, icon: e(k, { iconKey: "FindCaseSensitive", size: "1rem" }) }), e(F, { style: K, selected: ie.findOptions.matchEntireCell, onSelectToggle: (e2) => {
|
|
101
|
-
oe((t2) => {
|
|
102
|
-
const n3 = { ...t2 };
|
|
103
|
-
return n3.findOptions.matchEntireCell = e2, n3;
|
|
104
|
-
});
|
|
105
|
-
}, label: "Match Entire Cell", shortcut: { key: "E", modifiers: [T.Alt] }, icon: e(k, { iconKey: "FindWholeWord", size: "1rem" }) }), e(F, { style: K, selected: ie.findOptions.useRegex, onSelectToggle: (e2) => {
|
|
106
|
-
oe((t2) => {
|
|
107
|
-
const n3 = { ...t2 };
|
|
108
|
-
return n3.findOptions.useRegex = e2, n3;
|
|
109
|
-
});
|
|
110
|
-
}, label: "Use Regular Expression", shortcut: { key: "R", modifiers: [T.Alt] }, icon: e(k, { iconKey: "FindRegEx", size: "1rem" }) })] }) }) }, inputLabel: { shrink: true }, htmlInput: { draggable: false, ref: L, className: "input", autoFocus: true, spellCheck: false, autoComplete: "off", sx: { paddingTop: (e2) => e2.spacing(1.25), paddingBottom: (e2) => e2.spacing(0.75) } } }, sx: { flex: "1 1 100%", marginRight: (e2) => e2.spacing(1), "& .MuiOutlinedInput-notchedOutline": { borderColor: (e2) => _ ? `${e2.palette.error.main} !important` : void 0 }, "& .MuiInputLabel-outlined": { color: (e2) => _ ? `${e2.palette.error.main} !important` : void 0 } }, value: ie.findOptions.text ?? "", onChange: (e2) => {
|
|
111
|
-
oe((t2) => {
|
|
112
|
-
const n3 = { ...t2 };
|
|
113
|
-
return n3.findOptions.text = e2.target.value, n3;
|
|
114
|
-
});
|
|
115
|
-
}, onKeyDown: (e2) => re(e2, false), onContextMenu: (e2) => {
|
|
116
|
-
e2.stopPropagation();
|
|
117
|
-
} }), e(F, { selected: ie.findOptions.reverse, onSelectToggle: (e2) => {
|
|
118
|
-
le(false, false);
|
|
119
|
-
}, touchRippleRef: N, label: "", shortcut: { key: "Enter", modifiers: [T.Shift] }, icon: e(k, { iconKey: ie.findOptions.orientation !== b.Orientation.Column ? "ArrowBack" : "ArrowUpward" }), disabled: !ie.findOptions.text }), e(F, { selected: !ie.findOptions.reverse, onSelectToggle: (e2) => {
|
|
120
|
-
le(true, false);
|
|
121
|
-
}, touchRippleRef: j, label: "Next Match", shortcut: { key: "Enter" }, icon: e(k, { iconKey: ie.findOptions.orientation !== b.Orientation.Column ? "ArrowForward" : "ArrowDownward" }), disabled: !ie.findOptions.text })] }), e(g, { in: Y, timeout: D, onExit: () => {
|
|
122
|
-
L.current?.focus();
|
|
123
|
-
}, children: t(u, { sx: { display: "flex", flexDirection: "row", alignItems: "center", marginTop: (e2) => e2.spacing(2) }, children: [e(f, { label: "Replace", slotProps: { input: { sx: { paddingRight: (e2) => e2.spacing(1), backgroundImage: `linear-gradient(${c("#fff", p(5))}, ${c("#fff", p(5))})` } }, inputLabel: { shrink: true }, htmlInput: { ref: V, className: "input", spellCheck: false, autoComplete: "off", sx: { paddingTop: (e2) => e2.spacing(1.25), paddingBottom: (e2) => e2.spacing(0.75) } } }, sx: { flex: "1 1 100%", marginRight: (e2) => e2.spacing(1) }, value: ie.replaceText ?? "", onChange: (e2) => {
|
|
124
|
-
oe((t2) => {
|
|
125
|
-
const n3 = { ...t2 };
|
|
126
|
-
return n3.replaceText = e2.target.value, n3;
|
|
127
|
-
});
|
|
128
|
-
}, onKeyDown: (e2) => re(e2, true), onContextMenu: (e2) => {
|
|
129
|
-
e2.stopPropagation();
|
|
130
|
-
} }), e(F, { onSelectToggle: (e2) => {
|
|
131
|
-
le(true, true);
|
|
132
|
-
}, touchRippleRef: H, label: "Replace", shortcut: { key: "Enter" }, icon: e(k, { iconKey: "FindReplace" }), disabled: !ie.findOptions.text }), e(F, { onSelectToggle: (e2) => {
|
|
133
|
-
le(true, true, true);
|
|
134
|
-
}, touchRippleRef: U, label: "Replace All", shortcut: { key: "Enter", modifiers: [T.Ctrl, T.Alt] }, icon: e(k, { iconKey: "FindReplaceAll" }), disabled: !ie.findOptions.text })] }) })] })] }), e(g, { in: Q, timeout: D, onExit: () => {
|
|
135
|
-
L.current?.focus();
|
|
136
|
-
}, children: t(u, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", gap: (e2) => e2.spacing(1.5), marginTop: (e2) => e2.spacing(1) }, children: [e(E, { orientation: "horizontal", sx: { marginBottom: (e2) => e2.spacing(1.5) } }), t(u, { sx: { display: "flex", flexDirection: ce >= 383 ? "row" : "column", justifyContent: "space-evenly", alignItems: "center", gap: (e2) => e2.spacing(1), rowGap: (e2) => e2.spacing(2) }, tabIndex: -1, children: [e(S, { label: "Within", value: ie.scope, options: I, onSelect: (e2) => {
|
|
137
|
-
oe((t2) => {
|
|
138
|
-
const n3 = { ...t2 };
|
|
139
|
-
return n3.scope = e2, n3;
|
|
140
|
-
});
|
|
141
|
-
} }), e(S, { label: "Search", value: ie.findOptions.orientation !== b.Orientation.Column, options: $, onSelect: (e2) => {
|
|
142
|
-
oe((t2) => {
|
|
143
|
-
const n3 = { ...t2 };
|
|
144
|
-
return n3.findOptions.orientation = e2 ? b.Orientation.Row : b.Orientation.Column, n3;
|
|
145
|
-
});
|
|
146
|
-
} }), e(S, { label: "Look in", value: Y && ie.findOptions.fields?.[0] === C.Content.Values ? C.Content.Formulas : ie.findOptions.fields?.[0], options: Y ? B : A, onSelect: (e2) => {
|
|
147
|
-
oe((t2) => {
|
|
148
|
-
const n3 = { ...t2 };
|
|
149
|
-
return n3.findOptions.fields = [e2], n3;
|
|
150
|
-
});
|
|
151
|
-
} })] })] }) })] }) });
|
|
152
|
-
});
|
|
153
|
-
export {
|
|
154
|
-
P as FindReplaceWindow,
|
|
155
|
-
I as ScopeOptions,
|
|
156
|
-
P as default
|
|
157
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.11
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
8
|
-
import { useState as t } from "react";
|
|
9
|
-
import { Box as i, FormControlLabel as o, Checkbox as l } from "@mui/material";
|
|
10
|
-
import { Sort as r, IRange as a } from "@sheetxl/sdk";
|
|
11
|
-
import { useCallbackRef as s } from "@sheetxl/utils-react";
|
|
12
|
-
import { OptionsDialog as c } from "@sheetxl/utils-mui";
|
|
13
|
-
const d = ({ range: d2, options: m, cell: p, onDone: u, ...h }) => {
|
|
14
|
-
const [v, C] = t(m ?? r.DefaultRangeOptions), O = s((e2) => {
|
|
15
|
-
let n2 = null;
|
|
16
|
-
"Sort" === e2 && (n2 = { ...m, options: v }), u?.(n2);
|
|
17
|
-
}, [v, u, m]);
|
|
18
|
-
return e(c, { title: "Sort", options: ["Sort", "Cancel"], onDone: O, ...h, children: n(i, { sx: { display: "flex", flexDirection: "column" }, children: [e(o, { control: e(l, { checked: !v.reverse, onChange: () => C((e2) => ({ ...e2, reverse: !e2.reverse })) }), label: "Is Ascending", labelPlacement: "end" }), e(o, { control: e(l, { checked: v.hasHeader, onChange: () => C((e2) => ({ ...e2, hasHeader: !e2.hasHeader })) }), label: "Has Header", labelPlacement: "end" }), e(o, { control: e(l, { checked: v.collatorOptions?.sensitivity === r.CaseSensitiveOptions.sensitivity, onChange: () => C((e2) => ({ ...e2, collatorOptions: v.collatorOptions?.sensitivity === r.CaseSensitiveOptions.sensitivity ? r.CaseInsensitiveOptions : r.CaseSensitiveOptions })) }), label: "Case Sensitive", labelPlacement: "end" }), e(o, { control: e(l, { checked: v.orientation === a.Orientation.Row, onChange: () => C((e2) => {
|
|
19
|
-
const n2 = e2.orientation === a.Orientation.Row ? a.Orientation.Column : a.Orientation.Row;
|
|
20
|
-
return { ...d2.getDefaultSortCriteria(n2, p).options, includeHidden: e2.includeHidden, reverse: e2.reverse, orientation: n2 };
|
|
21
|
-
}) }), label: "Row Sort", labelPlacement: "end" }), e(o, { control: e(l, { checked: v.includeHidden, onChange: () => C((e2) => ({ ...e2, includeHidden: !e2.includeHidden })) }), label: "Include Hidden", labelPlacement: "end" })] }) });
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
d as SortDialog,
|
|
25
|
-
d as default
|
|
26
|
-
};
|