@sheetxl/studio-mui 0.7.12 → 0.7.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/browser/cjs/-SJdVflEYXFC2raH.cjs +6 -0
  2. package/browser/cjs/BE0n-qrL7I0lr2f8.cjs +7 -0
  3. package/browser/cjs/CAxeR5WYtM_OKUqg.cjs +6 -0
  4. package/browser/cjs/CC-q_GCvhI_uweI4.cjs +6 -0
  5. package/browser/cjs/{wyak0LMoe5SYbD51.cjs → CHc92OjHJrS2B3rB.cjs} +2 -2
  6. package/browser/cjs/CN5q08lr4Coj9gzy.cjs +6 -0
  7. package/browser/cjs/{CcsfLc43Qp-vN_dY.cjs → CYMqmv5IamB1x14k.cjs} +3 -3
  8. package/browser/cjs/CwHuP4ot4XxM1FbL.cjs +6 -0
  9. package/browser/cjs/{CMEmwUuGpnOyILAu.cjs → DjU4LQ7p0jFx8PsW.cjs} +1 -1
  10. package/browser/cjs/DqwSkMX3TSwbvSfO.cjs +20 -0
  11. package/browser/cjs/Ij3b1ONhNaWLtkRT.cjs +6 -0
  12. package/browser/cjs/NpKL7qsDwzMarfjO.cjs +6 -0
  13. package/browser/cjs/index.cjs +2 -2
  14. package/browser/esm/BLiSCviFgWhD9SmC.mjs +53 -0
  15. package/browser/esm/BNF5wwVTFO0bKhDb.mjs +50 -0
  16. package/browser/esm/BlDN4JPF9n_TeCyQ.mjs +155 -0
  17. package/browser/esm/{DK1cCQD1jHxZbFAp.mjs → BzS-7g64cdTk8pFd.mjs} +1 -1
  18. package/browser/esm/BzkODf-EDNHsbeYC.mjs +26 -0
  19. package/browser/esm/{B7ChnkonDRA2zazH.mjs → Cd127EllJy0H1x8s.mjs} +3 -3
  20. package/browser/esm/CfkKWfDbYhDDort6.mjs +46 -0
  21. package/browser/esm/{CRmCo9Jr1gvSFGVp.mjs → D8YtOXZWnL-YI48g.mjs} +2121 -2108
  22. package/browser/esm/DezB6LbrlA_MqNpH.mjs +50 -0
  23. package/browser/esm/{fsGSNDVe9urk2cLB.mjs → DlZXGLXt7KBqpCgX.mjs} +2 -2
  24. package/browser/esm/{aeHM-2IGRQaGFohd.mjs → XGwUZoREuZ029cPM.mjs} +28 -27
  25. package/browser/esm/aWQ7-rGmyvVU_nRK.mjs +25 -0
  26. package/browser/esm/index.mjs +2 -2
  27. package/licenses/dependencies.txt +142 -142
  28. package/node/esm/4D3fLVzYqPTas9nR.mjs +25 -0
  29. package/node/esm/B6-CF_32FCaDZJDm.mjs +52 -0
  30. package/node/esm/C21w0yQGlygcFqHI.mjs +156 -0
  31. package/node/esm/{H012qdl97RHln5MW.mjs → C62EF6LSsPD4LAL6.mjs} +1 -1
  32. package/node/esm/{Df6HNjgJTgShGC-O.mjs → C8TcDhw9hCrJxqfJ.mjs} +1 -1
  33. package/node/esm/{CwKoYwlrp9nnVHln.mjs → CM8Jkahi0myGVt_v.mjs} +22 -22
  34. package/node/esm/{CGaHni9C2sipjSMn.mjs → CREPL1yvIjmYpU-r.mjs} +9 -7
  35. package/node/esm/CeJ5myvgfYOUSKGq.mjs +26 -0
  36. package/node/esm/{BEFwnAOkyd0CWlex.mjs → D9PLpUGQqMmk1V9n.mjs} +13 -13
  37. package/node/esm/index.mjs +531 -523
  38. package/node/esm/{BSTIZiKBGgwjXLtp.mjs → xCdMLxN5xcpczFUI.mjs} +18 -18
  39. package/package.json +17 -15
  40. package/browser/cjs/BYfcSe1JgcohGr-C.cjs +0 -7
  41. package/browser/cjs/BZPmbh6TWeAN2tiY.cjs +0 -6
  42. package/browser/cjs/CrkutQSHB1Buy5oQ.cjs +0 -6
  43. package/browser/cjs/D2KC31HOMCGQMLvD.cjs +0 -6
  44. package/browser/cjs/DiQXaxwfHcQfkYKX.cjs +0 -6
  45. package/browser/cjs/Dmw2IW35YLNmLgvP.cjs +0 -20
  46. package/browser/cjs/bItCE_-c88dO7Izw.cjs +0 -6
  47. package/browser/cjs/fa-Q2vHsld47aqrE.cjs +0 -6
  48. package/browser/esm/BZPlU0oT2oGTQQgK.mjs +0 -46
  49. package/browser/esm/BzGH26JDt4xKZfM7.mjs +0 -49
  50. package/browser/esm/CA-_Kya2gsMrF9Ef.mjs +0 -26
  51. package/browser/esm/CGBRrUgnGzuP9FGo.mjs +0 -156
  52. package/browser/esm/csScKLYnqrrlL197.mjs +0 -25
  53. package/browser/esm/lm9H6CMj_7o_ra2l.mjs +0 -53
  54. package/node/esm/BqLlyKyVXFNiRaJv.mjs +0 -25
  55. package/node/esm/Cq6TadzONqFlX07d.mjs +0 -26
  56. package/node/esm/D71WQjM6hP5FzBql.mjs +0 -157
@@ -1,17 +1,17 @@
1
1
  /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.12
2
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.14
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
7
  import { jsx as t } from "react/jsx-runtime";
8
8
  import { memo as n, useMemo as o, useState as e, useCallback as a } from "react";
9
- import { alpha as i, getOverlayAlpha as s } from "@mui/material/styles";
10
- import { Box as l, FormControl as r, TextField as c } from "@mui/material";
9
+ import { alpha as i, getOverlayAlpha as l } from "@mui/material/styles";
10
+ import { Box as s, FormControl as r, TextField as c } from "@mui/material";
11
11
  import { useCallbackRef as p } from "@sheetxl/utils-react";
12
12
  import { OptionsDialog as m } from "@sheetxl/utils-mui";
13
13
  const u = ["Ok", "Cancel"], d = n((n2) => {
14
- const { initialComments: d2 = null, onUpdateComments: g, context: f, onOption: x, onValidateOption: h, onDone: C, options: O = u, defaultOption: y = O?.[0], cancelOption: w = "Cancel", sx: F, ...T } = n2, k = o(() => {
14
+ const { initialValue: d2 = null, onInput: g, context: f, onOption: x, onValidateOption: h, onDone: C, options: O = u, defaultOption: y = O?.[0], cancelOption: w = "Cancel", sx: F, ...T } = n2, k = o(() => {
15
15
  const t2 = d2 ?? f?.()?.getComments();
16
16
  let n3 = "";
17
17
  if (t2 && t2.content && t2.content.runs) {
@@ -22,18 +22,18 @@ const u = ["Ok", "Cancel"], d = n((n2) => {
22
22
  }
23
23
  }
24
24
  return n3;
25
- }, []), [v, b] = e(k), [D, I] = e(false), P = a(async (t2, n3) => null, []), B = p(async (t2) => {
26
- const n3 = "" === v ? [] : v.split("\n");
27
- if (t2 !== w) {
28
- const t3 = [];
29
- for (let o3 = 0; o3 < n3.length; o3++) t3.push({ text: n3[o3] });
30
- const o2 = { content: { runs: t3 } };
31
- g?.(o2);
25
+ }, []), [v, I] = e(k), [b, D] = e(false), P = a(async (t2, n3) => null, []), V = p(async (t2) => {
26
+ const n3 = "" === v ? [] : v.split("\n"), o2 = t2 === w;
27
+ if (!o2) {
28
+ const t3 = n3.length, o3 = new Array(t3);
29
+ for (let e3 = 0; e3 < t3; e3++) o3[e3] = { text: n3[e3] };
30
+ const e2 = { content: { runs: o3 } };
31
+ g?.(e2);
32
32
  }
33
- x?.(t2, t2 === w, t2 === y), C?.();
34
- }, [v, g, C, x, y, w]), E = p((t2) => {
35
- b(t2.target.value), P(t2.target.value, null);
36
- }, [h]), M = p(async (t2) => {
33
+ x?.(t2, o2, t2 === y), C?.();
34
+ }, [v, g, C, x, y, w]), B = p((t2) => {
35
+ I(t2.target.value), P(t2.target.value, null);
36
+ }, [h]), E = p(async (t2) => {
37
37
  let n3 = await Promise.resolve(h?.(t2));
38
38
  try {
39
39
  false !== n3 && (n3 = await P(v, t2));
@@ -41,9 +41,9 @@ const u = ["Ok", "Cancel"], d = n((n2) => {
41
41
  }
42
42
  return n3 ?? true;
43
43
  }, [h, v]);
44
- return t(m, { title: (k ? "Edit" : "Insert") + " Comments", options: O, onDone: C, onOption: (t2) => B(t2), onValidateOption: M, defaultOption: y, cancelOption: w, autoFocusSel: ".autoFocus", sx: { width: "480px", ...F }, ...T, children: t(l, { sx: { paddingTop: (t2) => t2.spacing(1), paddingBottom: (t2) => t2.spacing(0), rowGap: (t2) => t2.spacing(1), display: "flex", flexDirection: "column" }, children: t(r, { sx: { paddingTop: (t2) => t2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(c, { label: "Comments", placeholder: "Enter a comment.", onFocus: (t2) => {
45
- D || t2.target?.select(), I(true);
46
- }, sx: { "& .MuiFormHelperText-root": { marginTop: (t2) => t2.spacing(0.5) } }, slotProps: { inputLabel: { shrink: true }, htmlInput: { className: "autoFocus", spellCheck: false, autoComplete: "off", sx: { paddingTop: (t2) => t2.spacing(1.25), paddingBottom: (t2) => t2.spacing(0.75), backgroundImage: `linear-gradient(${i("#fff", s(5))}, ${i("#fff", s(5))})` } } }, value: v, onChange: E, onContextMenu: (t2) => {
44
+ return t(m, { title: (k ? "Edit" : "Insert") + " Comments", options: O, onDone: C, onOption: (t2) => V(t2), onValidateOption: E, defaultOption: y, cancelOption: w, autoFocusSel: ".autoFocus", sx: { width: "480px", ...F }, ...T, children: t(s, { sx: { paddingTop: (t2) => t2.spacing(1), paddingBottom: (t2) => t2.spacing(0), rowGap: (t2) => t2.spacing(1), display: "flex", flexDirection: "column" }, children: t(r, { sx: { paddingTop: (t2) => t2.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: t(c, { label: "Comments", placeholder: "Enter a comment.", onFocus: (t2) => {
45
+ b || t2.target?.select(), D(true);
46
+ }, sx: { "& .MuiFormHelperText-root": { marginTop: (t2) => t2.spacing(0.5) } }, slotProps: { inputLabel: { shrink: true }, htmlInput: { className: "autoFocus", spellCheck: false, autoComplete: "off", sx: { paddingTop: (t2) => t2.spacing(1.25), paddingBottom: (t2) => t2.spacing(0.75), backgroundImage: `linear-gradient(${i("#fff", l(5))}, ${i("#fff", l(5))})` } } }, value: v, onChange: B, onContextMenu: (t2) => {
47
47
  t2.stopPropagation();
48
48
  } }) }) }) });
49
49
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/studio-mui",
3
3
  "description": "Studio - Spreadsheet UI built with SheetXL SDK using React & MUI.",
4
- "version": "0.7.12",
4
+ "version": "0.7.14",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "type": "module",
7
7
  "exports": {
@@ -48,20 +48,20 @@
48
48
  "charting"
49
49
  ],
50
50
  "dependencies": {
51
- "@sheetxl/grid-react": "^0.7.12",
52
- "@sheetxl/io": "^0.7.12",
53
- "@sheetxl/react": "^0.7.12",
54
- "@sheetxl/sdk": "^0.7.12",
55
- "@sheetxl/utils": "^0.7.12",
56
- "@sheetxl/utils-mui": "^0.7.12",
57
- "@sheetxl/utils-react": "^0.7.12",
51
+ "@sheetxl/grid-react": "^0.7.14",
52
+ "@sheetxl/io": "^0.7.14",
53
+ "@sheetxl/react": "^0.7.14",
54
+ "@sheetxl/sdk": "^0.7.14",
55
+ "@sheetxl/utils": "^0.7.14",
56
+ "@sheetxl/utils-mui": "^0.7.14",
57
+ "@sheetxl/utils-react": "^0.7.14",
58
58
  "clsx": "^2.1.1",
59
59
  "csstype": "^3.1.3",
60
60
  "file-saver": "^2.0.5",
61
61
  "fuse.js": "^7.0.0",
62
62
  "notistack": "^3.0.1",
63
63
  "react-color": "^2.19.3",
64
- "react-hook-form": "^7.63.0",
64
+ "react-hook-form": "^7.64.0",
65
65
  "react-merge-refs": "^3.0.2",
66
66
  "react-resizable": "^3.0.5",
67
67
  "react-transition-group": "^4.4.5",
@@ -74,15 +74,17 @@
74
74
  "@emotion/cache": "^11.14.0",
75
75
  "@emotion/react": "^11.14.0",
76
76
  "@emotion/styled": "^11.14.0",
77
- "@mui/material": "^7.3.2",
78
- "@mui/styled-engine": "^7.3.2",
79
- "@mui/system": "^7.3.2",
80
- "@mui/utils": "^7.3.2",
81
- "react": "^19.1.0",
82
- "react-dom": "^19.1.0"
77
+ "@mui/material": "^7.0.0",
78
+ "@mui/styled-engine": "^7.0.0",
79
+ "@mui/system": "^7.0.0",
80
+ "@mui/utils": "^7.0.0",
81
+ "react": "^19.0.0",
82
+ "react-dom": "^19.0.0"
83
83
  },
84
84
  "devDependencies": {
85
85
  "@types/file-saver": "^2.0.5",
86
+ "@types/react": "^19.2.0",
87
+ "@types/react-dom": "^19.2.0",
86
88
  "@types/react-resizable": "^3.0.8",
87
89
  "@types/react-transition-group": "^4.4.6",
88
90
  "@types/react-virtualized": "^9.22.3"
@@ -1,7 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.12
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.12
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 t=require("react/jsx-runtime"),r=require("react"),n=require("@mui/material/styles"),l=require("@mui/material"),s=require("@sheetxl/sdk"),u=require("@sheetxl/utils-react"),A=require("@sheetxl/utils-mui"),B=["Ok","Cancel"],O=r.memo(T=>{const{initialValue:j,context:f,onOption:h,onValidateOption:m,onInputOption:b,onDone:d,options:C=B,defaultOption:c=C?.[0],cancelOption:g="Cancel",sx:S,...N}=T,[a,v]=r.useState(j),[w,q]=r.useState(!1),y=r.useCallback(async(e,o)=>!0,[]),x=u.useCallbackRef(async e=>{b?.(a,e),h?.(e,e===g,e===c),d?.()},[a,b,d,h,g,c]),D=u.useCallbackRef(async e=>{e.keyCode===u.KeyCodes.Enter&&await y?.(a,null)!==!1&&x(c)},[a,x]),P=u.useCallbackRef(e=>{v(e.target.value),y?.(e.target.value,null)},[m]),I=u.useCallbackRef(async e=>{let o=await Promise.resolve(m?.(e));try{o!==!1&&(o=await Promise.resolve(y?.(a,e))??!0)}catch{}return o??!0},[m]),[F,k]=r.useState(s.NumberFormat.Styles.lookupStyle(a).formatType??s.NumberFormat.Type.Custom);r.useEffect(()=>{k(s.NumberFormat.Styles.lookupStyle(a).formatType??s.NumberFormat.Type.Custom)},[a]);const M=r.useMemo(()=>{const e=s.NumberFormat.Styles.lookupPrimary(),o=p=>t.jsx(l.MenuItem,{value:p,children:p},p),i=Object.keys(e).map(p=>o(e[p].formatType));return i.push(o(s.NumberFormat.Type.Custom)),i},[]),R=r.useCallback(e=>{const o=e.target.value;k(o);const i=s.NumberFormat.Styles.lookupDefault(o);i&&v(i)},[]),$=r.useMemo(()=>{const e=f();return e.createTemporaryCell({value:e.getValue()??12345,style:{numberFormat:a}})},[F,a,f]);return t.jsx(A.OptionsDialog,{title:"Number Format",options:C,onDone:d,onOption:e=>x(e),onValidateOption:I,defaultOption:c,cancelOption:g,autoFocusSel:".autoFocus",sx:{width:"580px",...S},...N,children:t.jsxs(l.Box,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),display:"flex",flexDirection:"column"},children:[t.jsxs(l.FormControl,{sx:{minWidth:135},size:"small",children:[t.jsx(l.InputLabel,{children:"Category"}),t.jsx(l.Select,{value:F,label:"Category",onChange:R,sx:{backgroundImage:`linear-gradient(${n.alpha("#fff",n.getOverlayAlpha(5))}, ${n.alpha("#fff",n.getOverlayAlpha(5))})`},children:M})]}),t.jsx(l.FormControl,{sx:{paddingTop:e=>e.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:t.jsx(l.TextField,{label:"Code",onFocus:e=>{w||e.target?.select(),q(!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:a,onChange:P,onKeyDown:D,onContextMenu:e=>{e.stopPropagation()}})}),t.jsxs(l.Box,{children:[t.jsx(l.Typography,{variant:"caption",component:"div",sx:{paddingLeft:e=>e.spacing(2)},children:"Preview"}),t.jsx(l.Typography,{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:$.getNumberFormat().displayText||"(empty)"})]})]})})});exports.NumberFormatDialog=O,exports.default=O;
@@ -1,6 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.12
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"),w=require("@mui/material"),c=require("@sheetxl/utils-react"),F=require("@sheetxl/utils-mui"),O=require("./Dmw2IW35YLNmLgvP.cjs"),B=["Ok","Cancel"],R=l.memo(V=>{const{value:a=null,context:t,onOption:p,onValidateOption:M,onDone:g,onUpdate:m,options:x=B,defaultOption:f=x?.[0],cancelOption:N="Cancel",sx:b,...h}=V,y=l.useMemo(()=>t?.getNames().findValidName("Range1"),[]),u=l.useMemo(()=>{if(!a)return!0},[]),[n,v]=l.useState({displayText:a?.getName()??y,errorText:null}),[o,k]=l.useState({displayValue:a?.getRanges()??t?.selection()??null,errorText:null}),[T,C]=l.useState(!1),q=l.useCallback(async e=>!n.errorText&&!o.errorText,[t]),S=c.useCallbackRef((e,s,d)=>{if(!s){let i=null;u?i=t?.getNames().addReference(n?.displayText,o?.displayValue,!1):(a.getType()==="reference"&&a.doBatch(()=>{a.setName(n?.displayText),a.setReference(o?.displayValue)},`Edit Named '${n?.displayText}'`),i=a),i&&(i.select(),m(i,u))}p?.(e,s,d),g?.()},[t,n,o,g,p,f,N,m]),j=c.useCallbackRef(e=>{let s=null;try{t?.getNames().validateName(e)}catch(d){s=d.message}v({displayText:e,errorText:s})},[]),D=c.useCallbackRef(e=>{a&&a.getName().toLowerCase()===e.toLowerCase()||t?.getNames().validateName(e)},[t,a]),I=l.useCallback(e=>{k({displayValue:e??null,errorText:null})},[]);return r.jsx(F.OptionsDialog,{title:(u?"Define":"Edit")+" Range",options:x,onOption:S,onValidateOption:q,defaultOption:f,cancelOption:N,autoFocusSel:".autoFocus",sx:{width:"460px",...b},...h,children:r.jsxs(w.Box,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),range:"flex",flexDirection:"column"},children:[r.jsx(O.NamedInput,{formName:"name",defaultInput:y,value:n.displayText,onChangeInput:j,onValidate:D,onFocus:e=>{T||e.target?.select(),C(!0)}}),r.jsx(O.RangeInput,{formName:"range",value:o.displayValue,onChangeInput:I,resolvedAddress:t.getNames().getRanges.bind(t.getNames()),onFocus:e=>{T||e.target?.select(),C(!0)}})]})})});exports.NamedReferenceDialog=R,exports.default=R;
@@ -1,6 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.12
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("./Dmw2IW35YLNmLgvP.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,6 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.12
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"),x=require("react"),o=require("@mui/material"),t=require("@sheetxl/sdk"),h=require("@sheetxl/utils-react"),S=require("@sheetxl/utils-mui"),c=({range:d,options:a,cell:u,onDone:s,...C})=>{const[i,l]=x.useState(a??t.Sort.DefaultRangeOptions),b=h.useCallbackRef(e=>{let r=null;e==="Sort"&&(r={...a,options:i}),s?.(r)},[i,s,a]);return n.jsx(S.OptionsDialog,{title:"Sort",options:["Sort","Cancel"],onDone:b,...C,children:n.jsxs(o.Box,{sx:{display:"flex",flexDirection:"column"},children:[n.jsx(o.FormControlLabel,{control:n.jsx(o.Checkbox,{checked:!i.reverse,onChange:()=>l(e=>({...e,reverse:!e.reverse}))}),label:"Is Ascending",labelPlacement:"end"}),n.jsx(o.FormControlLabel,{control:n.jsx(o.Checkbox,{checked:i.hasHeader,onChange:()=>l(e=>({...e,hasHeader:!e.hasHeader}))}),label:"Has Header",labelPlacement:"end"}),n.jsx(o.FormControlLabel,{control:n.jsx(o.Checkbox,{checked:i.collatorOptions?.sensitivity===t.Sort.CaseSensitiveOptions.sensitivity,onChange:()=>l(e=>({...e,collatorOptions:i.collatorOptions?.sensitivity===t.Sort.CaseSensitiveOptions.sensitivity?t.Sort.CaseInsensitiveOptions:t.Sort.CaseSensitiveOptions}))}),label:"Case Sensitive",labelPlacement:"end"}),n.jsx(o.FormControlLabel,{control:n.jsx(o.Checkbox,{checked:i.orientation===t.IRange.Orientation.Row,onChange:()=>l(e=>{const r=e.orientation===t.IRange.Orientation.Row?t.IRange.Orientation.Column:t.IRange.Orientation.Row;return{...d.getDefaultSortCriteria(r,u).options,includeHidden:e.includeHidden,reverse:e.reverse,orientation:r}})}),label:"Row Sort",labelPlacement:"end"}),n.jsx(o.FormControlLabel,{control:n.jsx(o.Checkbox,{checked:i.includeHidden,onChange:()=>l(e=>({...e,includeHidden:!e.includeHidden}))}),label:"Include Hidden",labelPlacement:"end"})]})})};exports.SortDialog=c,exports.default=c;