@sheetxl/studio-mui 0.7.6 → 0.7.7

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 (51) hide show
  1. package/LICENSE.md +1 -1
  2. package/browser/cjs/BCf8BQb2c8ANexW4.cjs +7 -0
  3. package/browser/cjs/BJ4pZo7s81ynDlzw.cjs +6 -0
  4. package/browser/cjs/{-u6vWH9DiYlO1rsa.cjs → Bf70UQlMT3b0NoOZ.cjs} +1 -1
  5. package/browser/cjs/Bpq9GrV7al7xxJ_d.cjs +6 -0
  6. package/browser/cjs/BxlQ6aLh5_jUvk9w.cjs +20 -0
  7. package/browser/cjs/{DefYX_aeMZivbpEt.cjs → CJSNNa8ySxzuEmoy.cjs} +2 -2
  8. package/browser/cjs/{Ce6JLd3qejgMgM3r.cjs → CUND2W1xMwqPOHwD.cjs} +3 -3
  9. package/browser/cjs/{7MV1n9Y0yXU0hKpM.cjs → Cg95aBJ4kuUq7jrz.cjs} +1 -1
  10. package/browser/cjs/Dcoq8P2O8-40waHl.cjs +6 -0
  11. package/browser/cjs/{B8-dSgXI2XZKFvtp.cjs → DeoOsY5TkIAydt9W.cjs} +2 -2
  12. package/browser/cjs/index.cjs +3 -3
  13. package/browser/cjs/{BdNRaXTgqRzPmg0L.cjs → j0lD5RrJ86CRlUNT.cjs} +2 -2
  14. package/browser/esm/{BnVbG5kg41edf8oz.mjs → 7tCRjNmDM5kf3BFa.mjs} +2 -2
  15. package/browser/esm/{Dg_NRblGOcetqhnC.mjs → BWxmPJd4f8qZMxaa.mjs} +4 -4
  16. package/browser/esm/{YfJJd16cfjuXpb8G.mjs → BbHGWXif6ytyfyHI.mjs} +1 -1
  17. package/browser/esm/{yQgfM4ehXrfnEoUK.mjs → BkhHyCmy1MwVFS1b.mjs} +2 -2
  18. package/browser/esm/{DVSjscO7zuDsOD4v.mjs → Bo3cXzeDcP_Q9YvX.mjs} +2 -2
  19. package/browser/esm/CRDu7VFAa8NGcoHj.mjs +49 -0
  20. package/browser/esm/{nwvZlIH9rheqctQz.mjs → Cd02kMBZDsozIA98.mjs} +12 -12
  21. package/browser/esm/CzdBzjYgP1i3pkPL.mjs +4455 -0
  22. package/browser/esm/DFppS_p4spncePDm.mjs +156 -0
  23. package/browser/esm/{miaBr4cu9WKLs8Is.mjs → db-2uDA7mYS4QpHj.mjs} +1 -1
  24. package/browser/esm/index.mjs +38 -37
  25. package/browser/esm/{CKLhWrNo1E4r3pG7.mjs → nzc1811Pk5-sKDu5.mjs} +7 -7
  26. package/licenses/dependencies.txt +75 -108
  27. package/node/assets/style.css +1 -1
  28. package/node/esm/BVKo3uc0IreLNkkN.mjs +157 -0
  29. package/node/esm/{Dln5o1FP_HWPs0Uf.mjs → BfnEq4EhLf8jJ0Gp.mjs} +1 -1
  30. package/node/esm/{CxbA2L1Ap9NSJcxm.mjs → BgR1PWucIb0Zucr4.mjs} +1 -1
  31. package/node/esm/{B9TRK2jd_Ki2RifT.mjs → BimlBylqyslj9fNg.mjs} +1 -1
  32. package/node/esm/{BTp8XtWh47Y1g1MM.mjs → BnGsbrQwjcaUFAdt.mjs} +13 -13
  33. package/node/esm/{CNCYE_ff8SnJJMPN.mjs → CQhaL28vV1X6Xt2N.mjs} +4 -4
  34. package/node/esm/{qpKmKMfv4DDofXKf.mjs → DB2ryaj4_Y8Lgyy_.mjs} +1 -1
  35. package/node/esm/{COoX8Ir66wNuWJ_m.mjs → X3qO0PKREgY9FMZU.mjs} +8 -8
  36. package/node/esm/index.mjs +1308 -1262
  37. package/node/esm/{CN79Z_qqLiF3V5r0.mjs → rOozeXREjiU8jjPd.mjs} +14 -14
  38. package/package.json +15 -16
  39. package/types/index.d.ts +17 -7
  40. package/browser/cjs/1-LY_VyMGQ9MfeNB.cjs +0 -20
  41. package/browser/cjs/BEmcHbiMOFhIa91S.cjs +0 -6
  42. package/browser/cjs/D7AH724IJJvos02e.cjs +0 -7
  43. package/browser/cjs/KOj1qev47_vzzRFV.cjs +0 -6
  44. package/browser/cjs/St8H4B5iT2fsqOb7.cjs +0 -6
  45. package/browser/cjs/TS1uQTjkemJ22p1Y.cjs +0 -6
  46. package/browser/esm/BNxVvFkY3b2mERJf.mjs +0 -64
  47. package/browser/esm/CJsYe8TqU6tqj4UH.mjs +0 -154
  48. package/browser/esm/DdLujAMc-Cefddif.mjs +0 -49
  49. package/browser/esm/beUKtp_qQMnuYcVk.mjs +0 -4452
  50. package/node/esm/BcB8nCbI5HW5jv5q.mjs +0 -65
  51. package/node/esm/C5WzmLTAphEQU3CU.mjs +0 -155
@@ -1,6 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.6
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"),ee=require("./1-LY_VyMGQ9MfeNB.cjs"),w=l.memo(R=>{const{label:O,value:f,options:c,onSelect:g,tabIndex:C=0,...T}=R,[E,b]=l.useState(()=>G(f,c));l.useEffect(()=>{b(G(f,c))},[f,c]);const k=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:O}),i.jsx(r.Select,{inputProps:{tabIndex:C},value:E,label:O,onChange:k,sx:{backgroundImage:`linear-gradient(${d.alpha("#fff",d.getOverlayAlpha(5))}, ${d.alpha("#fff",d.getOverlayAlpha(5))})`},...T,children:p})]})}),D={Workbook:"workbook",Sheet:"sheet"},U={enter:140,exit:140},J={Formulas:a.ICell.Content.Formulas,Values:a.ICell.Content.Values,Notes:a.ICell.Content.Notes,Comments:a.ICell.Content.Comments},Q={...J};delete Q.Values;const ne={"By Rows":!0,"By Columns":!1},G=(R,O)=>{const f=Object.keys(O);for(let c=0;c<f.length;c++){const g=f[c];if(O[g]===R)return g}},X=l.memo(R=>{const{replace:O=!1,findText:f,replaceText:c,findOptions:g,replaceOptions:C,title:T,onHide:E,onFindOrReplace:b,...k}=R,p=l.useRef(null),m=l.useRef(null),B=l.useRef(null),A=l.useRef(null),M=l.useRef(null),P=l.useRef(null),W=(e,n)=>{n&&(n.start(e,{center:!1}),setTimeout(()=>n.stop(e),180))},[q,v]=l.useState(!1),[S,Y]=l.useState(!1),[h,F]=l.useState(O),[L,K]=l.useState(!1),[$,V]=l.useState(!1),[o,u]=l.useState({findText:null,replaceText:null,replace:O,replaceOptions:{},findOptions:{matchCase:!1,matchEntireCell:!1,useRegex:!1,orientation:a.IRange.Orientation.Row,fields:[a.ICell.Content.Formulas]},scope:D.Sheet}),I=s.useCallbackRef(async(e,n,t,j)=>{if(!b)return;const y={...o};y.replaceOptions={...y.replaceOptions},y.findOptions={...y.findOptions},y.replaceOptions.maxCount=t?void 0:1,y.replace=n,n&&o.findOptions.fields?.[0]===a.ICell.Content.Values&&(y.findOptions.fields=[a.ICell.Content.Formulas]),y.findOptions.reverse=!e;const _=await b({autoFocus:j,...y});K(_===0)},[o,b]);l.useEffect(()=>{K(!1)},[o,S,h]);const N=s.useCallbackRef((e,n)=>{if(e.keyCode===s.KeyCodes.Enter){if(!o.findText)return;let t=!0,j=!1;e.shiftKey&&(t=!1),n?(e.ctrlKey&&e.altKey&&(j=!0),W(e,j?P.current:M.current)):W(e,t?A.current:B.current),I(t,n,j,!1)}},[o]),H=l.useRef(null);l.useLayoutEffect(()=>{u(e=>{const n={...e};n.findText=f&&f.length>0?f:e.findText??"",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&&F(t),n}),$||H.current?.focus()},[f,c,g,C]),l.useEffect(()=>{h?(o.findOptions.fields[0],a.ICell.Content.Values):v(!0)},[h]),l.useEffect(()=>{if(q&&p.current&&o.findText===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})},[q,o]);const[Z,{width:z}]=ee.useMeasure();return i.jsx(x.InternalWindow,{ref:H,title:T??(h?"Find & Replace":"Find"),initialPosition:{y:"35"},autoFocusSel:".input",onHide:E,onFocus:()=>V(!0),onBlur:()=>{V(!1),K(!1)},PaperProps:{elevation:$?3:1},...k,children:i.jsxs(r.DialogContent,{dividers:!0,ref:Z,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)F(!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:S,onSelectToggle:e=>{Y(e)},preventFocus:!0,label:"Toggle Additional Options",icon:i.jsx(s.DynamicIcon,{iconKey:"FindOptions"})}),i.jsx(x.ExhibitOptionButton,{selected:h,onSelectToggle:e=>{F(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",InputLabelProps:{shrink:!0},InputProps:{sx:{paddingRight:e=>e.spacing(1),minWidth:z>460?"20em":void 0,backgroundImage:`linear-gradient(${d.alpha("#fff",d.getOverlayAlpha(5))}, ${d.alpha("#fff",d.getOverlayAlpha(5))})`},inputProps:{draggable:!1,ref:p,className:"input",autoFocus:!0,spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75)}},endAdornment:i.jsx(r.InputAdornment,{sx:{transform:"scale(0.75) translateX(16px)"},position:"end",children:i.jsxs(r.Box,{sx:{display:"flex",alignItems:"center",flexDirection:"row",gap:"1px"},children:[i.jsx(x.ExhibitOptionButton,{selected:o.findOptions.matchCase,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"})}),i.jsx(x.ExhibitOptionButton,{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"})}),i.jsx(x.ExhibitOptionButton,{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"})})]})})},sx:{flex:"1 1 100%",marginRight:e=>e.spacing(1),"& .MuiOutlinedInput-notchedOutline":{borderColor:e=>L?`${e.palette.error.main} !important`:void 0},"& .MuiInputLabel-outlined":{color:e=>L?`${e.palette.error.main} !important`:void 0}},value:o.findText??"",onChange:e=>{u(n=>{const t={...n};return t.findText=e.target.value,t})},onKeyDown:e=>N(e,!1),onContextMenu:e=>{e.stopPropagation()}}),i.jsx(x.ExhibitOptionButton,{selected:o.findOptions.reverse,onSelectToggle:e=>{I(!1,!1)},touchRippleRef:B,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.findText}),i.jsx(x.ExhibitOptionButton,{selected:!o.findOptions.reverse,onSelectToggle:e=>{I(!0,!1)},touchRippleRef:A,label:"Next Match",shortcut:{key:"Enter"},icon:i.jsx(s.DynamicIcon,{iconKey:o.findOptions.orientation!==a.IRange.Orientation.Column?"ArrowForward":"ArrowDownward"}),disabled:!o.findText})]}),i.jsx(r.Collapse,{in:h,timeout:U,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",InputLabelProps:{shrink:!0},InputProps:{sx:{paddingRight:e=>e.spacing(1),backgroundImage:`linear-gradient(${d.alpha("#fff",d.getOverlayAlpha(5))}, ${d.alpha("#fff",d.getOverlayAlpha(5))})`},inputProps:{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=>{I(!0,!0)},touchRippleRef:M,label:"Replace",shortcut:{key:"Enter"},icon:i.jsx(s.DynamicIcon,{iconKey:"FindReplace"}),disabled:!o.findText}),i.jsx(x.ExhibitOptionButton,{onSelectToggle:e=>{I(!0,!0,!0)},touchRippleRef:P,label:"Replace All",shortcut:{key:"Enter",modifiers:[s.KeyModifiers.Ctrl,s.KeyModifiers.Alt]},icon:i.jsx(s.DynamicIcon,{iconKey:"FindReplaceAll"}),disabled:!o.findText})]})})]})]}),i.jsx(r.Collapse,{in:S,timeout:U,onExit:()=>{p.current?.focus()},children:i.jsxs(r.Box,{sx:{minHeight:"10px",flex:"1 1 100%",display:"flex",flexDirection:"column",gap:e=>e.spacing(.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:z>=413?"row":"column",justifyContent:"space-evenly",alignItems:"center",rowGap:e=>e.spacing(2)},tabIndex:-1,children:[i.jsx(w,{label:"Within",value:o.scope,options:D,onSelect:e=>{u(n=>{const t={...n};return t.scope=e,t})}}),i.jsx(w,{label:"Search",value:o.findOptions.orientation!==a.IRange.Orientation.Column,options:ne,onSelect:e=>{u(n=>{const t={...n};return t.findOptions.orientation=e?a.IRange.Orientation.Row:a.IRange.Orientation.Column,t})}}),i.jsx(w,{label:"Look in",value:h&&o.findOptions.fields?.[0]===a.ICell.Content.Values?a.ICell.Content.Formulas:o.findOptions.fields?.[0],options:h?Q:J,onSelect:e=>{u(n=>{const t={...n};return t.findOptions.fields=[e],t})}})]})]})})]})})});exports.FindReplaceWindow=X,exports.ScopeOptions=D,exports.default=X;
@@ -1,7 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.6
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"),g=require("@mui/material"),m=require("@sheetxl/utils-react"),I=require("@sheetxl/utils-mui"),M=["Ok","Cancel"],b=l.memo(y=>{const{initialComments:k=null,onUpdateComments:f,context:v,onOption:x,onValidateOption:p,onDone:u,options:h=M,defaultOption:d=h?.[0],cancelOption:s="Cancel",sx:F,...T}=y,C=l.useMemo(()=>{const e=k??v?.()?.getComments();let t="";if(e&&e.content&&e.content.runs){const o=e.content.runs;for(let i=0;i<o.length;i++){const a=o[i];t+=a?.text}}return t},[]),[n,q]=l.useState(C),[j,P]=l.useState(!1),O=l.useCallback(async(e,t)=>null,[]),w=m.useCallbackRef(async e=>{const t=n===""?[]:n.split(`
7
- `);if(e!==s){const o=[];for(let a=0;a<t.length;a++)o.push({text:t[a]});f?.({content:{runs:o}})}x?.(e,e===s,e===d),u?.()},[n,f,u,x,d,s]),D=m.useCallbackRef(e=>{q(e.target.value),O(e.target.value,null)},[p]),S=m.useCallbackRef(async e=>{let t=await Promise.resolve(p?.(e));try{t!==!1&&(t=await O(n,e))}catch{}return t??!0},[p,n]);return r.jsx(I.OptionsDialog,{title:(C?"Edit":"Insert")+" Comments",options:h,onDone:u,onOption:e=>w(e),onValidateOption:S,defaultOption:d,cancelOption:s,autoFocusSel:".autoFocus",sx:{width:"480px",...F},...T,children:r.jsx(g.Box,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),display:"flex",flexDirection:"column"},children:r.jsx(g.FormControl,{sx:{paddingTop:e=>e.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:r.jsx(g.TextField,{label:"Comments",placeholder:"Enter a comment.",onFocus:e=>{j||e.target?.select(),P(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75),backgroundImage:`linear-gradient(${c.alpha("#fff",c.getOverlayAlpha(5))}, ${c.alpha("#fff",c.getOverlayAlpha(5))})`}}},value:n,onChange:D,onContextMenu:e=>{e.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.6
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"),n=require("react"),l=require("@mui/material/styles"),r=require("@mui/material"),s=require("@sheetxl/sdk"),u=require("@sheetxl/utils-react"),A=require("@sheetxl/utils-mui"),B=["Ok","Cancel"],O=n.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]=n.useState(j),[P,w]=n.useState(!1),y=n.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]),q=u.useCallbackRef(async e=>{e.keyCode===u.KeyCodes.Enter&&await y?.(a,null)!==!1&&x(c)},[a,x]),D=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]=n.useState(s.NumberFormat.Styles.lookupStyle(a).formatType??s.NumberFormat.Type.Custom);n.useEffect(()=>{k(s.NumberFormat.Styles.lookupStyle(a).formatType??s.NumberFormat.Type.Custom)},[a]);const M=n.useMemo(()=>{const e=s.NumberFormat.Styles.lookupPrimary(),o=p=>t.jsx(r.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=n.useCallback(e=>{const o=e.target.value;k(o);const i=s.NumberFormat.Styles.lookupDefault(o);i&&v(i)},[]),$=n.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(r.Box,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),display:"flex",flexDirection:"column"},children:[t.jsxs(r.FormControl,{sx:{minWidth:135},size:"small",children:[t.jsx(r.InputLabel,{children:"Category"}),t.jsx(r.Select,{value:F,label:"Category",onChange:R,sx:{backgroundImage:`linear-gradient(${l.alpha("#fff",l.getOverlayAlpha(5))}, ${l.alpha("#fff",l.getOverlayAlpha(5))})`},children:M})]}),t.jsx(r.FormControl,{sx:{paddingTop:e=>e.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:t.jsx(r.TextField,{label:"Code",onFocus:e=>{P||e.target?.select(),w(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75),backgroundImage:`linear-gradient(${l.alpha("#fff",l.getOverlayAlpha(5))}, ${l.alpha("#fff",l.getOverlayAlpha(5))})`}}},value:a,onChange:D,onKeyDown:q,onContextMenu:e=>{e.stopPropagation()}})}),t.jsxs(r.Box,{children:[t.jsx(r.Typography,{variant:"caption",component:"div",sx:{paddingLeft:e=>e.spacing(2)},children:"Preview"}),t.jsx(r.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.6
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"),n=require("react"),l=require("@mui/material/styles"),s=require("@mui/material"),f=require("@sheetxl/utils-react"),S=require("@sheetxl/utils-mui"),B=["Ok","Cancel"],O=n.memo(b=>{const{initialHyperlink:o=null,initialDisplay:v=null,onUpdateHyperlink:h,context:r,onOption:m,onValidateOption:u,onDone:c,options:y=B,defaultOption:d=y?.[0],cancelOption:p="Cancel",sx:F,...P}=b,D=n.useMemo(()=>(o??r?.()?.getHyperlink())!==null,[]),k=n.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,j]=n.useState(k.address),[g,H]=n.useState(()=>{const e=r?.().toTextUnformatted()??v;return e===k.address?"":e}),[I,C]=n.useState(!1),M=n.useCallback(e=>{H(e.target.value)},[]),T=n.useCallback(async(e,a)=>null,[]),q=f.useCallbackRef(async e=>{e!==p&&h?.(t===""?null:{address:t},g),m?.(e,e===p,e===d),c?.()},[t,g,h,c,m,d,p]),w=f.useCallbackRef(e=>{j(e.target.value),T(e.target.value,null)},[u]),A=f.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(S.OptionsDialog,{title:(D?"Edit":"Insert")+" Link",options:y,onDone:c,onOption:e=>q(e),onValidateOption:A,defaultOption:d,cancelOption:p,autoFocusSel:".autoFocus",sx:{width:"480px",...F},...P,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=>{I||e.target?.select(),C(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:e=>e.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75),backgroundImage:`linear-gradient(${l.alpha("#fff",l.getOverlayAlpha(5))}, ${l.alpha("#fff",l.getOverlayAlpha(5))})`}}},value:t,onChange:w,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)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75),backgroundImage:`linear-gradient(${l.alpha("#fff",l.getOverlayAlpha(5))}, ${l.alpha("#fff",l.getOverlayAlpha(5))})`}}},value:g,onChange:M,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.6
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"),a=require("react"),i=require("@mui/material"),s=require("@sheetxl/utils-react"),r=require("@sheetxl/utils-mui"),H=require("@sheetxl/react"),d=require("./1-LY_VyMGQ9MfeNB.cjs"),f=a.memo(b=>{const{title:w,onHide:S,autoFocusSel:j=".range-input input",context:C,command:g,commands:u,...B}=b,[T,m]=a.useState(!1),[x,p]=a.useState(!1),h=a.useRef(null),[q,v]=a.useReducer(e=>e+1,0),[R,{width:L}]=d.useMeasure();s.useCommand(g);const o=C??g.context(),t=o.table(),[N,D]=a.useState(()=>t?o.getNames().getRanges(t.getRange()):null),F=a.useMemo(()=>t?.getName()??"",[t]);H.useModelListener(o.table(),{onAnchorCoordsChange(e){D(o.getNames().getRanges(e.getRange()))},onProtectedChange(e){v()}});const I=s.useCallbackRef(e=>{o?.table().setName(e)},[o]),P=s.useCallbackRef(e=>{o?.table().resize(e.at(0))},[o]);let y=null;o.table()||(y=n.jsx("div",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:1,display:"flex",alignItems:"center",justifyItems:"center",justifyContent:"center",boxSizing:"border-box"},children:n.jsx("div",{children:"No table selected"})}));const c=s.useNotifier();return n.jsx(r.InternalWindow,{ref:h,title:w??"Table Details",initialPosition:{y:"35"},autoFocusSel:j,onHide:S,onFocus:()=>m(!0),onBlur:e=>{h?.current?.contains(e.relatedTarget)||m(!1)},PaperProps:{elevation:T?3:1},...B,children:n.jsxs(i.DialogContent,{dividers:!0,ref:R,sx:{display:"flex",flexDirection:"column",position:"relative",paddingLeft:e=>e.spacing(1.5),paddingRight:e=>e.spacing(1.5)},children:[n.jsxs(i.Box,{sx:{display:"flex",flexDirection:"column",transition:"opacity 60ms",opacity:o.table()?1:0},children:[n.jsx(i.Box,{sx:{display:"flex",flexDirection:"row",gap:e=>e.spacing(1)},children:n.jsx(i.Box,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",boxSizing:"border-box",paddingLeft:e=>e.spacing(2),paddingRight:e=>e.spacing(2)},children:n.jsxs(i.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[n.jsx(d.NamedInput,{formName:"name",defaultInput:F,value:t?.getName()??"No table",onChangeInput:I,onValidate:e=>{t&&t.getName().toLowerCase()===e.toLowerCase()||o?.getNames().validateName(e)},disabled:t?.isProtected()??!0,onFocus:e=>{x||e.target?.select(),p(!0)}}),n.jsx(d.RangeInput,{formName:"range",value:N,onChangeInput:P,resolvedAddress:o.getNames().getRanges.bind(o.getNames()),disabled:t?.isProtected()??!0,onFocus:e=>{x||e.target?.select(),p(!0)}})]})})}),n.jsxs(i.Box,{sx:{minHeight:"10px",flex:"1 1 100%",display:"flex",flexDirection:"column",gap:e=>e.spacing(.5),marginTop:e=>e.spacing(1)},children:[n.jsx(r.ExhibitDivider,{orientation:"horizontal",sx:{marginTop:e=>e.spacing(1.5),marginBottom:e=>e.spacing(.75)}}),n.jsx(d.TableStyleOptionsPanel,{disabled:t?.isProtected(),styleOptions:t?.getStyleOptions()??null,onStyleOptionsChange:e=>{t.updateStyleOptions(e)},showHeaderRow:t?.getShowHeaders(),onShowHeaderRowChange:e=>{try{t.setShowHeaders(e)}catch(l){c.showError(l)}},showTotalRow:t?.getShowTotals(),onShowTotalRowChange:e=>{try{t.setShowTotals(e)}catch(l){c.showError(l)}},showFilterButton:t?.getFilter()?t.getShowFilterButton():null,onShowFilterButtonChange:e=>{try{t.setShowFilterButton(e)}catch(l){c.showError(l)}}}),n.jsx(i.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",marginTop:e=>e.spacing(2),marginBottom:e=>e.spacing(1)},children:n.jsx(d.TableStylePreview,{table:t,styles:o.styles(),bodyStyle:o.bodyStyle(),cellHeight:30,isLive:!0})}),n.jsx(r.ExhibitDivider,{orientation:"horizontal"}),n.jsxs(i.Box,{sx:{display:"flex",flexDirection:"column",justifyContent:"center"},children:[n.jsx(r.CommandButton,{variant:s.CommandButtonType.Menuitem,command:u.getCommand("convertTableToRange"),commandState:t}),n.jsx(r.CommandButton,{variant:s.CommandButtonType.Menuitem,commandState:t,command:u.getCommand("deleteTable")})]})]})]}),y]})})});exports.TableDetailsWindow=f,exports.default=f;
@@ -1,64 +0,0 @@
1
- import { jsx as a, jsxs as s } from "react/jsx-runtime";
2
- import { memo as L, useState as r, useRef as z, useReducer as E, useMemo as M } from "react";
3
- import { DialogContent as O, Box as n } from "@mui/material";
4
- import { useCommand as W, useCallbackRef as f, useNotifier as A, CommandButtonType as x } from "@sheetxl/utils-react";
5
- import { InternalWindow as k, ExhibitDivider as y, CommandButton as b } from "@sheetxl/utils-mui";
6
- import { useModelListener as V } from "@sheetxl/react";
7
- import { u as q, N as G, R as J, T as K, a as Q } from "./beUKtp_qQMnuYcVk.mjs";
8
- /**
9
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.6
10
- *
11
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
12
- * License: The license can be found at https://www.sheetxl.com/license.
13
- */
14
- const ae = L((w) => {
15
- const { title: C, onHide: S, autoFocusSel: N = ".range-input input", context: R, command: c, commands: d, ...T } = w, [v, m] = r(!1), [g, p] = r(!1), u = z(null), [U, D] = E((e) => e + 1, 0), [B, { width: X }] = q();
16
- W(c);
17
- const o = R ?? c.context(), t = o.table(), [F, H] = r(() => t ? o.getNames().getRanges(t.getRange()) : null), I = M(() => t?.getName() ?? "", [t]);
18
- V(o.table(), { onAnchorCoordsChange(e) {
19
- H(o.getNames().getRanges(e.getRange()));
20
- }, onProtectedChange(e) {
21
- D();
22
- } });
23
- const P = f((e) => {
24
- o?.table().setName(e);
25
- }, [o]), j = f((e) => {
26
- o?.table().resize(e.at(0));
27
- }, [o]);
28
- let h = null;
29
- o.table() || (h = a("div", { style: { position: "absolute", top: "0", left: "0", width: "100%", height: "100%", opacity: 1, display: "flex", alignItems: "center", justifyItems: "center", justifyContent: "center", boxSizing: "border-box" }, children: a("div", { children: "No table selected" }) }));
30
- const l = A();
31
- return a(k, { ref: u, title: C ?? "Table Details", initialPosition: { y: "35" }, autoFocusSel: N, onHide: S, onFocus: () => m(!0), onBlur: (e) => {
32
- u?.current?.contains(e.relatedTarget) || m(!1);
33
- }, PaperProps: { elevation: v ? 3 : 1 }, ...T, children: s(O, { dividers: !0, ref: B, sx: { display: "flex", flexDirection: "column", position: "relative", paddingLeft: (e) => e.spacing(1.5), paddingRight: (e) => e.spacing(1.5) }, children: [s(n, { sx: { display: "flex", flexDirection: "column", transition: "opacity 60ms", opacity: o.table() ? 1 : 0 }, children: [a(n, { sx: { display: "flex", flexDirection: "row", gap: (e) => e.spacing(1) }, children: a(n, { sx: { display: "flex", flexDirection: "column", maxWidth: "100%", boxSizing: "border-box", paddingLeft: (e) => e.spacing(2), paddingRight: (e) => e.spacing(2) }, children: s(n, { sx: { display: "flex", flexDirection: "column", alignItems: "center" }, children: [a(G, { formName: "name", defaultInput: I, value: t?.getName() ?? "No table", onChangeInput: P, onValidate: (e) => {
34
- t && t.getName().toLowerCase() === e.toLowerCase() || o?.getNames().validateName(e);
35
- }, disabled: t?.isProtected() ?? !0, onFocus: (e) => {
36
- g || e.target?.select(), p(!0);
37
- } }), a(J, { formName: "range", value: F, onChangeInput: j, resolvedAddress: o.getNames().getRanges.bind(o.getNames()), disabled: t?.isProtected() ?? !0, onFocus: (e) => {
38
- g || e.target?.select(), p(!0);
39
- } })] }) }) }), s(n, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", gap: (e) => e.spacing(0.5), marginTop: (e) => e.spacing(1) }, children: [a(y, { orientation: "horizontal", sx: { marginTop: (e) => e.spacing(1.5), marginBottom: (e) => e.spacing(0.75) } }), a(K, { disabled: t?.isProtected(), styleOptions: t?.getStyleOptions() ?? null, onStyleOptionsChange: (e) => {
40
- t.updateStyleOptions(e);
41
- }, showHeaderRow: t?.getShowHeaders(), onShowHeaderRowChange: (e) => {
42
- try {
43
- t.setShowHeaders(e);
44
- } catch (i) {
45
- l.showError(i);
46
- }
47
- }, showTotalRow: t?.getShowTotals(), onShowTotalRowChange: (e) => {
48
- try {
49
- t.setShowTotals(e);
50
- } catch (i) {
51
- l.showError(i);
52
- }
53
- }, showFilterButton: t?.getFilter() ? t.getShowFilterButton() : null, onShowFilterButtonChange: (e) => {
54
- try {
55
- t.setShowFilterButton(e);
56
- } catch (i) {
57
- l.showError(i);
58
- }
59
- } }), a(n, { sx: { display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", marginTop: (e) => e.spacing(2), marginBottom: (e) => e.spacing(1) }, children: a(Q, { table: t, styles: o.styles(), bodyStyle: o.bodyStyle(), cellHeight: 30, isLive: !0 }) }), a(y, { orientation: "horizontal" }), s(n, { sx: { display: "flex", flexDirection: "column", justifyContent: "center" }, children: [a(b, { variant: x.Menuitem, command: d.getCommand("convertTableToRange"), commandState: t }), a(b, { variant: x.Menuitem, commandState: t, command: d.getCommand("deleteTable") })] })] })] }), h] }) });
60
- });
61
- export {
62
- ae as TableDetailsWindow,
63
- ae as default
64
- };
@@ -1,154 +0,0 @@
1
- import { jsx as i, jsxs as p } from "react/jsx-runtime";
2
- import { memo as ie, useRef as y, useState as b, useEffect as K, useLayoutEffect as ce, useMemo as pe } from "react";
3
- import { alpha as k, getOverlayAlpha as F } from "@mui/material/styles";
4
- import { DialogContent as de, Box as O, TextField as Z, InputAdornment as ue, Collapse as _, MenuItem as fe, FormControl as ge, InputLabel as me, Select as xe } from "@mui/material";
5
- import { ICell as c, IRange as R } from "@sheetxl/sdk";
6
- import { useCallbackRef as L, KeyCodes as he, DynamicIcon as m, KeyModifiers as C } from "@sheetxl/utils-react";
7
- import { InternalWindow as Oe, ExhibitOptionButton as x, ExhibitDivider as ye } from "@sheetxl/utils-mui";
8
- import { u as Ce } from "./beUKtp_qQMnuYcVk.mjs";
9
- /**
10
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.6
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 $ = ie((w) => {
16
- const { label: h, value: a, options: l, onSelect: d, tabIndex: T = 0, ...D } = w, [A, v] = b(() => te(a, l));
17
- K(() => {
18
- v(te(a, l));
19
- }, [a, l]);
20
- const P = L((u) => {
21
- v(u.target.value), d?.(l[u.target.value]);
22
- }, [d, l]), s = pe(() => Object.keys(l).map((u) => i(fe, { value: u, children: u }, u)), [l]);
23
- return p(ge, { sx: { minWidth: 135 }, size: "small", children: [i(me, { children: h }), i(xe, { inputProps: { tabIndex: T }, value: A, label: h, onChange: P, sx: { backgroundImage: `linear-gradient(${k("#fff", F(5))}, ${k("#fff", F(5))})` }, ...D, children: s })] });
24
- }), ee = { Workbook: "workbook", Sheet: "sheet" }, ne = { enter: 140, exit: 140 }, oe = { Formulas: c.Content.Formulas, Values: c.Content.Values, Notes: c.Content.Notes, Comments: c.Content.Comments }, le = { ...oe };
25
- delete le.Values;
26
- const be = { "By Rows": !0, "By Columns": !1 }, te = (w, 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] === w) return d;
31
- }
32
- }, Se = ie((w) => {
33
- const { replace: h = !1, findText: a, replaceText: l, findOptions: d, replaceOptions: T, title: D, onHide: A, onFindOrReplace: v, ...P } = w, s = y(null), u = y(null), V = y(null), j = y(null), N = y(null), H = y(null), z = (e, n) => {
34
- n && (n.start(e, { center: !1 }), setTimeout(() => n.stop(e), 180));
35
- }, [U, S] = b(!1), [B, se] = b(!1), [f, M] = b(h), [G, W] = b(!1), [X, q] = b(!1), [o, r] = b({ findText: null, replaceText: null, replace: h, replaceOptions: {}, findOptions: { matchCase: !1, matchEntireCell: !1, useRegex: !1, orientation: R.Orientation.Row, fields: [c.Content.Formulas] }, scope: ee.Sheet }), E = L(async (e, n, t, I) => {
36
- if (!v) 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 ae = await v({ autoFocus: I, ...g });
40
- W(ae === 0);
41
- }, [o, v]);
42
- K(() => {
43
- W(!1);
44
- }, [o, B, f]);
45
- const J = L((e, n) => {
46
- if (e.keyCode === he.Enter) {
47
- if (!o.findText) return;
48
- let t = !0, I = !1;
49
- e.shiftKey && (t = !1), n ? (e.ctrlKey && e.altKey && (I = !0), z(e, I ? H.current : N.current)) : z(e, t ? j.current : V.current), E(t, n, I, !1);
50
- }
51
- }, [o]), Q = y(null);
52
- ce(() => {
53
- r((e) => {
54
- const n = { ...e };
55
- n.findText = a && a.length > 0 ? a : e.findText ?? "", S(!0), l !== void 0 && (n.replaceText = l), d && (n.findOptions = { ...n.findOptions, ...d }), n.replaceText || (n.replaceText = ""), n.replaceOptions && (n.replaceOptions = { ...n.replaceOptions }), T && (n.replaceOptions = { ...n.replaceOptions, ...T }), o.findOptions.fields?.[0] || (o.findOptions.fields = [c.Content.Formulas]);
56
- const t = !(!T && l === void 0);
57
- return t && M(t), n;
58
- }), X || Q.current?.focus();
59
- }, [a, l, d, T]), K(() => {
60
- f ? (o.findOptions.fields[0], c.Content.Values) : S(!0);
61
- }, [f]), K(() => {
62
- if (U && s.current && o.findText === s.current.value) return s.current === document.activeElement || s.current.contains(document.activeElement) ? (s.current?.select(), void S(!1)) : void s.current.addEventListener("focus", () => {
63
- s.current?.select(), S(!1);
64
- }, { once: !0 });
65
- }, [U, o]);
66
- const [re, { width: Y }] = Ce();
67
- return i(Oe, { ref: Q, title: D ?? (f ? "Find & Replace" : "Find"), initialPosition: { y: "35" }, autoFocusSel: ".input", onHide: A, onFocus: () => q(!0), onBlur: () => {
68
- q(!1), W(!1);
69
- }, PaperProps: { elevation: X ? 3 : 1 }, ...P, children: p(de, { dividers: !0, ref: re, 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) M(!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
- se(e);
90
- }, preventFocus: !0, label: "Toggle Additional Options", icon: i(m, { iconKey: "FindOptions" }) }), i(x, { selected: f, onSelectToggle: (e) => {
91
- M(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(Z, { label: "Find", InputLabelProps: { shrink: !0 }, InputProps: { sx: { paddingRight: (e) => e.spacing(1), minWidth: Y > 460 ? "20em" : void 0, backgroundImage: `linear-gradient(${k("#fff", F(5))}, ${k("#fff", F(5))})` }, inputProps: { 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) } }, endAdornment: i(ue, { sx: { transform: "scale(0.75) translateX(16px)" }, position: "end", children: p(O, { sx: { display: "flex", alignItems: "center", flexDirection: "row", gap: "1px" }, children: [i(x, { selected: o.findOptions.matchCase, onSelectToggle: (e) => {
93
- r((n) => {
94
- const t = { ...n };
95
- return t.findOptions.matchCase = e, t;
96
- });
97
- }, label: "Match Case", shortcut: { key: "C", modifiers: [C.Alt] }, icon: i(m, { iconKey: "FindCaseSensitive" }) }), i(x, { selected: o.findOptions.matchEntireCell, onSelectToggle: (e) => {
98
- r((n) => {
99
- const t = { ...n };
100
- return t.findOptions.matchEntireCell = e, t;
101
- });
102
- }, label: "Match Entire Cell", shortcut: { key: "E", modifiers: [C.Alt] }, icon: i(m, { iconKey: "FindWholeWord" }) }), i(x, { selected: o.findOptions.useRegex, onSelectToggle: (e) => {
103
- r((n) => {
104
- const t = { ...n };
105
- return t.findOptions.useRegex = e, t;
106
- });
107
- }, label: "Use Regular Expression", shortcut: { key: "R", modifiers: [C.Alt] }, icon: i(m, { iconKey: "FindRegEx" }) })] }) }) }, sx: { flex: "1 1 100%", marginRight: (e) => e.spacing(1), "& .MuiOutlinedInput-notchedOutline": { borderColor: (e) => G ? `${e.palette.error.main} !important` : void 0 }, "& .MuiInputLabel-outlined": { color: (e) => G ? `${e.palette.error.main} !important` : void 0 } }, value: o.findText ?? "", onChange: (e) => {
108
- r((n) => {
109
- const t = { ...n };
110
- return t.findText = e.target.value, t;
111
- });
112
- }, onKeyDown: (e) => J(e, !1), onContextMenu: (e) => {
113
- e.stopPropagation();
114
- } }), i(x, { selected: o.findOptions.reverse, onSelectToggle: (e) => {
115
- E(!1, !1);
116
- }, touchRippleRef: V, label: "", shortcut: { key: "Enter", modifiers: [C.Shift] }, icon: i(m, { iconKey: o.findOptions.orientation !== R.Orientation.Column ? "ArrowBack" : "ArrowUpward" }), disabled: !o.findText }), i(x, { selected: !o.findOptions.reverse, onSelectToggle: (e) => {
117
- E(!0, !1);
118
- }, touchRippleRef: j, label: "Next Match", shortcut: { key: "Enter" }, icon: i(m, { iconKey: o.findOptions.orientation !== R.Orientation.Column ? "ArrowForward" : "ArrowDownward" }), disabled: !o.findText })] }), i(_, { in: f, timeout: ne, onExit: () => {
119
- s.current?.focus();
120
- }, children: p(O, { sx: { display: "flex", flexDirection: "row", alignItems: "center", marginTop: (e) => e.spacing(2) }, children: [i(Z, { label: "Replace", InputLabelProps: { shrink: !0 }, InputProps: { sx: { paddingRight: (e) => e.spacing(1), backgroundImage: `linear-gradient(${k("#fff", F(5))}, ${k("#fff", F(5))})` }, inputProps: { 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) => {
121
- r((n) => {
122
- const t = { ...n };
123
- return t.replaceText = e.target.value, t;
124
- });
125
- }, onKeyDown: (e) => J(e, !0), onContextMenu: (e) => {
126
- e.stopPropagation();
127
- } }), i(x, { onSelectToggle: (e) => {
128
- E(!0, !0);
129
- }, touchRippleRef: N, label: "Replace", shortcut: { key: "Enter" }, icon: i(m, { iconKey: "FindReplace" }), disabled: !o.findText }), i(x, { onSelectToggle: (e) => {
130
- E(!0, !0, !0);
131
- }, touchRippleRef: H, label: "Replace All", shortcut: { key: "Enter", modifiers: [C.Ctrl, C.Alt] }, icon: i(m, { iconKey: "FindReplaceAll" }), disabled: !o.findText })] }) })] })] }), i(_, { in: B, timeout: ne, onExit: () => {
132
- s.current?.focus();
133
- }, children: p(O, { sx: { minHeight: "10px", flex: "1 1 100%", display: "flex", flexDirection: "column", gap: (e) => e.spacing(0.5), marginTop: (e) => e.spacing(1) }, children: [i(ye, { orientation: "horizontal", sx: { marginBottom: (e) => e.spacing(1.5) } }), p(O, { sx: { display: "flex", flexDirection: Y >= 413 ? "row" : "column", justifyContent: "space-evenly", alignItems: "center", rowGap: (e) => e.spacing(2) }, tabIndex: -1, children: [i($, { label: "Within", value: o.scope, options: ee, onSelect: (e) => {
134
- r((n) => {
135
- const t = { ...n };
136
- return t.scope = e, t;
137
- });
138
- } }), i($, { label: "Search", value: o.findOptions.orientation !== R.Orientation.Column, options: be, onSelect: (e) => {
139
- r((n) => {
140
- const t = { ...n };
141
- return t.findOptions.orientation = e ? R.Orientation.Row : R.Orientation.Column, t;
142
- });
143
- } }), i($, { label: "Look in", value: f && o.findOptions.fields?.[0] === c.Content.Values ? c.Content.Formulas : o.findOptions.fields?.[0], options: f ? le : oe, onSelect: (e) => {
144
- r((n) => {
145
- const t = { ...n };
146
- return t.findOptions.fields = [e], t;
147
- });
148
- } })] })] }) })] }) });
149
- });
150
- export {
151
- Se as FindReplaceWindow,
152
- ee as ScopeOptions,
153
- Se as default
154
- };
@@ -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 l, getOverlayAlpha as p } 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.6
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((P) => {
14
- const { initialHyperlink: t = null, initialDisplay: v = null, onUpdateHyperlink: x, context: s, onOption: h, onValidateOption: r, onDone: d, options: y = V, defaultOption: c = y?.[0], cancelOption: i = "Cancel", sx: H, ...I } = P, w = O(() => (t ?? s?.()?.getHyperlink()) !== null, []), k = O(() => {
15
- let e = null, n = null;
16
- t && (typeof t == "string" ? n = t : e = t);
17
- const g = e ?? s?.()?.getHyperlink();
18
- return { address: n ?? g?.getAddress() ?? "", textToDisplay: g?.getDisplayText() ?? "" };
19
- }, [t, s]), [a, M] = m(k.address), [u, B] = m(() => {
20
- const e = s?.().toTextUnformatted() ?? v;
21
- return e === k.address ? "" : e;
22
- }), [$, T] = m(!1), A = b((e) => {
23
- B(e.target.value);
24
- }, []), C = b(async (e, n) => null, []), L = f(async (e) => {
25
- e !== i && x?.(a === "" ? null : { address: a }, u), h?.(e, e === i, e === c), d?.();
26
- }, [a, u, x, d, h, c, i]), W = f((e) => {
27
- M(e.target.value), C(e.target.value, null);
28
- }, [r]), z = f(async (e) => {
29
- let n = await Promise.resolve(r?.(e));
30
- try {
31
- n !== !1 && (n = await C(a, e));
32
- } catch {
33
- }
34
- return n ?? !0;
35
- }, [r]);
36
- return o(U, { title: (w ? "Edit" : "Insert") + " Link", options: y, onDone: d, onOption: (e) => L(e), onValidateOption: z, defaultOption: c, cancelOption: i, autoFocusSel: ".autoFocus", sx: { width: "480px", ...H }, ...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) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { className: "autoFocus", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (e) => e.spacing(1.25), paddingBottom: (e) => e.spacing(0.75), backgroundImage: `linear-gradient(${l("#fff", p(5))}, ${l("#fff", p(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) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { spellCheck: !1, autoComplete: "off", sx: { paddingTop: (e) => e.spacing(1.25), paddingBottom: (e) => e.spacing(0.75), backgroundImage: `linear-gradient(${l("#fff", p(5))}, ${l("#fff", p(5))})` } } }, value: u, onChange: A, onContextMenu: (e) => {
43
- e.stopPropagation();
44
- } }) })] }) });
45
- });
46
- export {
47
- Q as HyperlinkDialog,
48
- Q as default
49
- };