@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,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 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,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 i=require("react/jsx-runtime"),l=require("react"),d=require("@mui/material/styles"),r=require("@mui/material"),a=require("@sheetxl/sdk"),s=require("@sheetxl/utils-react"),x=require("@sheetxl/utils-mui"),ne=require("./Dmw2IW35YLNmLgvP.cjs"),w={width:"1.5rem",height:"1.5rem"},B=l.memo(R=>{const{label:y,value:f,options:c,onSelect:g,tabIndex:C=0,...E}=R,[k,b]=l.useState(()=>J(f,c));l.useEffect(()=>{b(J(f,c))},[f,c]);const S=s.useCallbackRef(m=>{b(m.target.value),g?.(c[m.target.value])},[g,c]),p=l.useMemo(()=>Object.keys(c).map(m=>i.jsx(r.MenuItem,{value:m,children:m},m)),[c]);return i.jsxs(r.FormControl,{sx:{minWidth:135},size:"small",children:[i.jsx(r.InputLabel,{children:y}),i.jsx(r.Select,{inputProps:{tabIndex:C},value:k,label:y,onChange:S,sx:{backgroundImage:`linear-gradient(${d.alpha("#fff",d.getOverlayAlpha(5))}, ${d.alpha("#fff",d.getOverlayAlpha(5))})`},...E,children:p})]})}),D={Workbook:"workbook",Sheet:"sheet"},G={enter:140,exit:140},X={Formulas:a.ICell.Content.Formulas,Values:a.ICell.Content.Values,Notes:a.ICell.Content.Notes,Comments:a.ICell.Content.Comments},Y={...X};delete Y.Values;const te={"By Rows":!0,"By Columns":!1},J=(R,y)=>{const f=Object.keys(y);for(let c=0;c<f.length;c++){const g=f[c];if(y[g]===R)return g}},Q=l.memo(R=>{const{replace:y=!1,findText:f,replaceText:c,findOptions:g,replaceOptions:C,title:E,onHide:k,onFindOrReplace:b,...S}=R,p=l.useRef(null),m=l.useRef(null),A=l.useRef(null),M=l.useRef(null),W=l.useRef(null),q=l.useRef(null),L=(e,n)=>{n&&(n.start(e,{center:!1}),setTimeout(()=>n.stop(e),180))},[P,v]=l.useState(!1),[F,Z]=l.useState(!1),[h,T]=l.useState(y),[$,K]=l.useState(!1),[z,V]=l.useState(!1),[o,u]=l.useState({replaceText:null,replace:y,replaceOptions:{},findOptions:{text:null,matchCase:!1,matchEntireCell:!1,useRegex:!1,orientation:a.IRange.Orientation.Row,fields:[a.ICell.Content.Formulas]},scope:D.Sheet}),j=s.useCallbackRef(async(e,n,t,I)=>{if(!b)return;const O={...o};O.replaceOptions={...O.replaceOptions},O.findOptions={...O.findOptions},O.replaceOptions.maxCount=t?void 0:1,O.replace=n,n&&o.findOptions.fields?.[0]===a.ICell.Content.Values&&(O.findOptions.fields=[a.ICell.Content.Formulas]),O.findOptions.reverse=!e;const ee=await b({autoFocus:I,...O});K(ee===0)},[o,b]);l.useEffect(()=>{K(!1)},[o,F,h]);const N=s.useCallbackRef((e,n)=>{if(e.keyCode===s.KeyCodes.Enter){if(!o.findOptions.text)return;let t=!0,I=!1;e.shiftKey&&(t=!1),n?(e.ctrlKey&&e.altKey&&(I=!0),L(e,I?q.current:W.current)):L(e,t?M.current:A.current),j(t,n,I,!1)}},[o]),H=l.useRef(null);l.useLayoutEffect(()=>{u(e=>{const n={...e};n.findOptions.text=f&&f.length>0?f:e.findOptions.text??"",v(!0),c!==void 0&&(n.replaceText=c),g&&(n.findOptions={...n.findOptions,...g}),n.replaceText||(n.replaceText=""),n.replaceOptions&&(n.replaceOptions={...n.replaceOptions}),C&&(n.replaceOptions={...n.replaceOptions,...C}),o.findOptions.fields?.[0]||(o.findOptions.fields=[a.ICell.Content.Formulas]);const t=!(!C&&c===void 0);return t&&T(t),n}),z||H.current?.focus()},[f,c,g,C]),l.useEffect(()=>{h?(o.findOptions.fields[0],a.ICell.Content.Values):v(!0)},[h]),l.useEffect(()=>{if(P&&p.current&&o.findOptions.text===p.current.value)return p.current===document.activeElement||p.current.contains(document.activeElement)?(p.current?.select(),void v(!1)):void p.current.addEventListener("focus",()=>{p.current?.select(),v(!1)},{once:!0})},[P,o]);const[_,{width:U}]=ne.useMeasure();return i.jsx(x.InternalWindow,{ref:H,title:E??(h?"Find & Replace":"Find"),initialPosition:{y:"35"},autoFocusSel:".input",onHide:k,onFocus:()=>V(!0),onBlur:()=>{V(!1),K(!1)},slotProps:{paper:{elevation:z?3:1}},...S,children:i.jsxs(r.DialogContent,{dividers:!0,ref:_,sx:{display:"flex",flexDirection:"column",paddingLeft:e=>e.spacing(1.5),paddingRight:e=>e.spacing(1.5)},onKeyDown:e=>{if(e.key==="h"&&e.ctrlKey)T(!0),p.current?.contains(document.activeElement)&&m.current?.focus();else if(e.key==="f"&&e.ctrlKey)p.current?.focus();else if(e.key==="c"&&e.altKey)u(n=>{const t={...n};return t.findOptions.matchCase=!n.findOptions.matchCase,t});else if(e.key==="e"&&e.altKey)u(n=>{const t={...n};return t.findOptions.matchEntireCell=!n.findOptions.matchEntireCell,t});else{if(e.key!=="r"||!e.altKey)return;u(n=>{const t={...n};return t.findOptions.useRegex=!n.findOptions.useRegex,t})}e.preventDefault()},children:[i.jsxs(r.Box,{sx:{display:"flex",flexDirection:"row",gap:e=>e.spacing(1)},children:[i.jsxs(r.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"start",gap:e=>e.spacing(.25),paddingTop:"3px"},children:[i.jsx(x.ExhibitOptionButton,{selected:F,onSelectToggle:e=>{Z(e)},preventFocus:!0,label:"Toggle Additional Options",icon:i.jsx(s.DynamicIcon,{iconKey:"FindOptions"})}),i.jsx(x.ExhibitOptionButton,{selected:h,onSelectToggle:e=>{T(e)},preventFocus:!0,label:"Toggle Replace",icon:i.jsx(s.DynamicIcon,{iconKey:"FindReplaceToggle"}),shortcut:{key:h?"F":"H",modifiers:[s.KeyModifiers.Ctrl]}})]}),i.jsxs(r.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",boxSizing:"border-box"},children:[i.jsxs(r.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[i.jsx(r.TextField,{label:"Find",slotProps:{input:{sx:{paddingRight:e=>e.spacing(1),minWidth:U>460?"20em":void 0,backgroundImage:`linear-gradient(${d.alpha("#fff",d.getOverlayAlpha(5))}, ${d.alpha("#fff",d.getOverlayAlpha(5))})`},endAdornment:i.jsx(r.InputAdornment,{position:"end",children:i.jsxs(r.Box,{sx:{display:"flex",alignItems:"center",flexDirection:"row",gap:"2px"},children:[i.jsx(x.ExhibitOptionButton,{style:w,selected:o.findOptions.matchCase,onBlur:()=>{console.log("blur")},onSelectToggle:e=>{u(n=>{const t={...n};return t.findOptions.matchCase=e,t})},label:"Match Case",shortcut:{key:"C",modifiers:[s.KeyModifiers.Alt]},icon:i.jsx(s.DynamicIcon,{iconKey:"FindCaseSensitive",size:"1rem"})}),i.jsx(x.ExhibitOptionButton,{style:w,selected:o.findOptions.matchEntireCell,onSelectToggle:e=>{u(n=>{const t={...n};return t.findOptions.matchEntireCell=e,t})},label:"Match Entire Cell",shortcut:{key:"E",modifiers:[s.KeyModifiers.Alt]},icon:i.jsx(s.DynamicIcon,{iconKey:"FindWholeWord",size:"1rem"})}),i.jsx(x.ExhibitOptionButton,{style:w,selected:o.findOptions.useRegex,onSelectToggle:e=>{u(n=>{const t={...n};return t.findOptions.useRegex=e,t})},label:"Use Regular Expression",shortcut:{key:"R",modifiers:[s.KeyModifiers.Alt]},icon:i.jsx(s.DynamicIcon,{iconKey:"FindRegEx",size:"1rem"})})]})})},inputLabel:{shrink:!0},htmlInput:{draggable:!1,ref:p,className:"input",autoFocus:!0,spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75)}}},sx:{flex:"1 1 100%",marginRight:e=>e.spacing(1),"& .MuiOutlinedInput-notchedOutline":{borderColor:e=>$?`${e.palette.error.main} !important`:void 0},"& .MuiInputLabel-outlined":{color:e=>$?`${e.palette.error.main} !important`:void 0}},value:o.findOptions.text??"",onChange:e=>{u(n=>{const t={...n};return t.findOptions.text=e.target.value,t})},onKeyDown:e=>N(e,!1),onContextMenu:e=>{e.stopPropagation()}}),i.jsx(x.ExhibitOptionButton,{selected:o.findOptions.reverse,onSelectToggle:e=>{j(!1,!1)},touchRippleRef:A,label:"",shortcut:{key:"Enter",modifiers:[s.KeyModifiers.Shift]},icon:i.jsx(s.DynamicIcon,{iconKey:o.findOptions.orientation!==a.IRange.Orientation.Column?"ArrowBack":"ArrowUpward"}),disabled:!o.findOptions.text}),i.jsx(x.ExhibitOptionButton,{selected:!o.findOptions.reverse,onSelectToggle:e=>{j(!0,!1)},touchRippleRef:M,label:"Next Match",shortcut:{key:"Enter"},icon:i.jsx(s.DynamicIcon,{iconKey:o.findOptions.orientation!==a.IRange.Orientation.Column?"ArrowForward":"ArrowDownward"}),disabled:!o.findOptions.text})]}),i.jsx(r.Collapse,{in:h,timeout:G,onExit:()=>{p.current?.focus()},children:i.jsxs(r.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",marginTop:e=>e.spacing(2)},children:[i.jsx(r.TextField,{label:"Replace",slotProps:{input:{sx:{paddingRight:e=>e.spacing(1),backgroundImage:`linear-gradient(${d.alpha("#fff",d.getOverlayAlpha(5))}, ${d.alpha("#fff",d.getOverlayAlpha(5))})`}},inputLabel:{shrink:!0},htmlInput:{ref:m,className:"input",spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75)}}},sx:{flex:"1 1 100%",marginRight:e=>e.spacing(1)},value:o.replaceText??"",onChange:e=>{u(n=>{const t={...n};return t.replaceText=e.target.value,t})},onKeyDown:e=>N(e,!0),onContextMenu:e=>{e.stopPropagation()}}),i.jsx(x.ExhibitOptionButton,{onSelectToggle:e=>{j(!0,!0)},touchRippleRef:W,label:"Replace",shortcut:{key:"Enter"},icon:i.jsx(s.DynamicIcon,{iconKey:"FindReplace"}),disabled:!o.findOptions.text}),i.jsx(x.ExhibitOptionButton,{onSelectToggle:e=>{j(!0,!0,!0)},touchRippleRef:q,label:"Replace All",shortcut:{key:"Enter",modifiers:[s.KeyModifiers.Ctrl,s.KeyModifiers.Alt]},icon:i.jsx(s.DynamicIcon,{iconKey:"FindReplaceAll"}),disabled:!o.findOptions.text})]})})]})]}),i.jsx(r.Collapse,{in:F,timeout:G,onExit:()=>{p.current?.focus()},children:i.jsxs(r.Box,{sx:{minHeight:"10px",flex:"1 1 100%",display:"flex",flexDirection:"column",gap:e=>e.spacing(1.5),marginTop:e=>e.spacing(1)},children:[i.jsx(x.ExhibitDivider,{orientation:"horizontal",sx:{marginBottom:e=>e.spacing(1.5)}}),i.jsxs(r.Box,{sx:{display:"flex",flexDirection:U>=383?"row":"column",justifyContent:"space-evenly",alignItems:"center",gap:e=>e.spacing(1),rowGap:e=>e.spacing(2)},tabIndex:-1,children:[i.jsx(B,{label:"Within",value:o.scope,options:D,onSelect:e=>{u(n=>{const t={...n};return t.scope=e,t})}}),i.jsx(B,{label:"Search",value:o.findOptions.orientation!==a.IRange.Orientation.Column,options:te,onSelect:e=>{u(n=>{const t={...n};return t.findOptions.orientation=e?a.IRange.Orientation.Row:a.IRange.Orientation.Column,t})}}),i.jsx(B,{label:"Look in",value:h&&o.findOptions.fields?.[0]===a.ICell.Content.Values?a.ICell.Content.Formulas:o.findOptions.fields?.[0],options:h?Y:X,onSelect:e=>{u(n=>{const t={...n};return t.findOptions.fields=[e],t})}})]})]})})]})})});exports.FindReplaceWindow=Q,exports.ScopeOptions=D,exports.default=Q;
@@ -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 "./CRmCo9Jr1gvSFGVp.mjs";
7
- /**
8
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.12
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,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.12
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,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.12
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,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 "./CRmCo9Jr1gvSFGVp.mjs";
9
- /**
10
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.12
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,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 "./CRmCo9Jr1gvSFGVp.mjs";
7
- /**
8
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.12
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.12
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,25 +0,0 @@
1
- /**
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
- */
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,26 +0,0 @@
1
- /**
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
- */
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
- };