@sheetxl/studio-mui 0.3.11 → 0.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/{BGlrkWl1P4ccrl_R.cjs → 4qxj4RND17MVUKvQ.cjs} +1 -1
- package/browser/cjs/{BBRnQ83YNqSTFH5T.cjs → B6Z_r2z2hupw-Icu.cjs} +1 -1
- package/browser/cjs/{BbHkfYtBH70Kwm8S.cjs → B86bJWqdxKB1n5qL.cjs} +1 -1
- package/browser/cjs/{D-r_enCOt--R5bmO.cjs → B9jhMVr_lzR7XDTZ.cjs} +2 -2
- package/browser/cjs/{-GIxb4hzsEL94BR8.cjs → BCgY6k5hSOMO3vA0.cjs} +1 -1
- package/browser/cjs/{BZAwjSVADIKG3zaf.cjs → BE3BEEtqYgzZmOSZ.cjs} +2 -2
- package/browser/cjs/{BvweZctvde1rwEcd.cjs → BWixRYBNkotmqbUE.cjs} +3 -3
- package/browser/cjs/{B8-81cfhsjyd4Wnk.cjs → BXUo0RHDLaL8FXpJ.cjs} +2 -2
- package/browser/cjs/{DZfJEQr-dLOGxQ07.cjs → BZmN15VylTyNKIpo.cjs} +1 -1
- package/browser/cjs/{BaDmO0a1yC_bJKk_.cjs → BbcCIOnYQGgasZcj.cjs} +2 -2
- package/browser/cjs/{C2uZUEV4AThXPmV8.cjs → BlRalQWpLl69G8WF.cjs} +3 -3
- package/browser/cjs/{B65yyxymSb3W4RFr.cjs → BmXduwci_kW15_dx.cjs} +1 -1
- package/browser/cjs/{CHQG60zb-aKjMDWm.cjs → BqzHHZefgtQsIYXn.cjs} +4 -4
- package/browser/cjs/{DYaVPaEiiQMvjiRK.cjs → C3vxY6j2P3eMDw8H.cjs} +1 -1
- package/browser/cjs/{dNUXJiVbgA4G7Qu1.cjs → CLkzgt532QDjkt7s.cjs} +2 -2
- package/browser/cjs/{3QmwGIkpqZY01y5z.cjs → CgzuEJm42eZyBlV2.cjs} +2 -2
- package/browser/cjs/{BjlW3apET5BZGhb2.cjs → CjSELYadyhvfejBL.cjs} +1 -1
- package/browser/cjs/{a-BnSESSb0haIeTD.cjs → ClrfGGLdzz8DoHKc.cjs} +2 -2
- package/browser/cjs/{CQbwK5f5Hdev770k.cjs → DH8xGuT9Jvx7Jhde.cjs} +7 -7
- package/browser/cjs/{YVZ3XY4qpBTWOiDa.cjs → DRdvygxxSsskSJLv.cjs} +2 -2
- package/browser/cjs/{DtF5BB8kLkld0Crp.cjs → DXzKwAsUF8mF8koH.cjs} +2 -2
- package/browser/cjs/{BGIRpBbU-5LOhl1s.cjs → DxVUgEWHQmRmwQ8i.cjs} +2 -2
- package/browser/cjs/{DS-wvfftEkKpy9rW.cjs → Sn_BinYkItKWn4DV.cjs} +2 -2
- package/browser/cjs/{DPYNtB_LA97H3UlK.cjs → fqLDdzVkhjNs5i7e.cjs} +2 -2
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{DAANSw5X4tJUdW6x.cjs → pjnz8m_gi6TjVzhg.cjs} +1 -1
- package/browser/esm/{CMavuIJL9_c_fgOm.mjs → 5siMjkfHzwxH9n6J.mjs} +8 -8
- package/browser/esm/{CBoiMwlk262Wsu0d.mjs → 7quvp89l4vL9ymd2.mjs} +2 -2
- package/browser/esm/{VvS6Pf-HzKCbRUSh.mjs → BA4T9TUy78nBZ0YO.mjs} +1 -1
- package/browser/esm/{n5_cTSZSe7VUY8NO.mjs → BG6Tixkw9X3LS58L.mjs} +1 -1
- package/browser/esm/{CKdh5acs-62lzYPS.mjs → BL0KUvfhsdXLpjQL.mjs} +2 -2
- package/browser/esm/{BdsfN9qjGoTIUBGn.mjs → BWsdLA6IDCWmT3bo.mjs} +1 -1
- package/browser/esm/{Ctwmet14g_QIduI_.mjs → B_tOuH7CovhYw7zf.mjs} +4 -4
- package/browser/esm/{3hEREQXRaxQra4uL.mjs → BoBQPE89SbYRRKl_.mjs} +3 -3
- package/browser/esm/{26WvyULzO7C3IMn1.mjs → BzNAkqPI8Noutl-F.mjs} +1 -1
- package/browser/esm/{CQsIIM2pEONkSJmi.mjs → C0o1iIoa4s9IYAy3.mjs} +1 -1
- package/browser/esm/{D4IoqKyAt-sDPEKy.mjs → CPxpz490_Xxt3hoa.mjs} +4 -4
- package/browser/esm/{BrfV9s-Fh2-7U4dp.mjs → CT7ds2Q6xFT5oB2q.mjs} +2 -2
- package/browser/esm/{CI9EsibU3-_7Hph5.mjs → CTWcr4hNtdb2J0-L.mjs} +1 -1
- package/browser/esm/{Dxn0wb29c9Zo3oVq.mjs → CnRhPHP7nM9hdXV7.mjs} +6 -6
- package/browser/esm/{Cka6ReDTKyiCyncn.mjs → DE6RG6hgYtGVQMdq.mjs} +2 -2
- package/browser/esm/{CNb5Z9DrhBfMJcxO.mjs → DE8EE4ecYa7lbzXR.mjs} +1 -1
- package/browser/esm/{co9-JfhNg8f778tN.mjs → DfVW0IbWDV5RQ70P.mjs} +2 -2
- package/browser/esm/{BCzJ5eB4WN-pJ7RF.mjs → DmlmzrQiTKLEcJ6G.mjs} +2 -2
- package/browser/esm/{BEC3NLTGHAGPw9X7.mjs → LFiIMXFU27WAMwTI.mjs} +2 -2
- package/browser/esm/{DV3DiW3NkDYnFfe8.mjs → TLlpx_JdNEdoWOCt.mjs} +2 -2
- package/browser/esm/{K8eHB9dTnTZgOQF7.mjs → Ymcll64nQ4tzkxQG.mjs} +2 -2
- package/browser/esm/{0RO8otEcuTtEJtbk.mjs → b9iZet0OZIChjL5w.mjs} +2 -2
- package/browser/esm/{CTuaoX7-cYqcDdVL.mjs → fK6ZnymH4JhVcxvX.mjs} +1 -1
- package/browser/esm/index.mjs +2 -2
- package/browser/esm/{CHGpNwb4fWpga1Uz.mjs → kSpx4jqia44jvQnN.mjs} +1 -1
- package/browser/esm/{CK4gmytnXH4u3Io2.mjs → pRbEhccyqBIjjCNJ.mjs} +3 -3
- package/licenses/dependencies.txt +6 -6
- package/node/esm/{DIvBS2T-1pzQZJzv.mjs → 5Bt2PmMwih_bWydn.mjs} +1 -1
- package/node/esm/{CLMwpLi1Q7FhMee9.mjs → B3yV-y5PXpkGdfBK.mjs} +3 -3
- package/node/esm/{D77PPlsA15V0LSxL.mjs → BPwU9tQeYnirfdXP.mjs} +1 -1
- package/node/esm/{DoAA0oei1tEgfwFS.mjs → BV5RGN-2POXPUXA8.mjs} +1 -1
- package/node/esm/{BiiigAtZXUiUNR7Z.mjs → BbZRx08lgZDKMvQf.mjs} +1 -1
- package/node/esm/{DISXaEQi9-1Gveze.mjs → BkXFqT40KjGpqOKS.mjs} +1 -1
- package/node/esm/{CYQam2pYs4QJ-BfB.mjs → C6_KqGliXZKesliM.mjs} +3 -3
- package/node/esm/{2wFciAg-U1uB2Pqa.mjs → CBuG0qlqkZBdJpEZ.mjs} +1 -1
- package/node/esm/{BgpnTPCtchxLdCI-.mjs → CG6utV5RNszf-LBP.mjs} +1 -1
- package/node/esm/{bRD_69heV2YQs9sf.mjs → CHfPyDHGWIm3dn_g.mjs} +1 -1
- package/node/esm/{BSK2F1DdODvlRJ3y.mjs → CKXmNvPaQ8lpv2vG.mjs} +1 -1
- package/node/esm/{C5g5-ZFDQoiFDDg1.mjs → COpq6b2A7-HCJU-Y.mjs} +1 -1
- package/node/esm/{4n00rwHOjl9OsChl.mjs → CnbD59Z1_QPagb2W.mjs} +1 -1
- package/node/esm/{D6s1M4D_BDHgS4Oj.mjs → Cp4W18q-ThZxeIiG.mjs} +1 -1
- package/node/esm/{Ck9KzV-5vAqLyuZW.mjs → Cqgp9rD9KFVOji_a.mjs} +1 -1
- package/node/esm/{Bz3ymEU7F5Pzhkmk.mjs → Cy7MRPW2uKidMDiU.mjs} +1 -1
- package/node/esm/{Dw3NvHAq0-2xPTzZ.mjs → D4td9HLqM7ljbwXL.mjs} +1 -1
- package/node/esm/{Bdhnvaoc9i4pMSKN.mjs → D8Y58cjN6VN73Y3K.mjs} +1 -1
- package/node/esm/{DKdoF7fHGXqKHGBY.mjs → DUieiX_nhBNq19A6.mjs} +1 -1
- package/node/esm/{j3ZBc-ty8i1TquHD.mjs → TEQj40CnPFLlEvbp.mjs} +2 -2
- package/node/esm/{DYNNLClEEJg124tA.mjs → eZloHHKviDBLnpPa.mjs} +1 -1
- package/node/esm/{fCIMINzepGmL-ZBO.mjs → imPzIvgPpjx7biBn.mjs} +5 -5
- package/node/esm/index.mjs +8 -8
- package/node/esm/{DnvCK9Q0EhgA7ffy.mjs → nSB4uhdWGE870Ccd.mjs} +1 -1
- package/package.json +8 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.3.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.3.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("react"),r=require("@mui/material"),v=require("@mui/icons-material"),a=require("@sheetxl/sdk"),t=require("./
|
|
6
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("react"),r=require("@mui/material"),v=require("@mui/icons-material"),a=require("@sheetxl/sdk"),t=require("./DH8xGuT9Jvx7Jhde.cjs"),y=require("@mui/system"),A=s.memo(j=>{const{label:h,value:d,options:c,onSelect:f,tabIndex:O=0,...I}=j,[S,C]=s.useState(()=>U(d,c));s.useEffect(()=>{C(U(d,c))},[d,c]);const k=t.T(x=>{C(x.target.value),f?.(c[x.target.value])},[f,c]),p=s.useMemo(()=>Object.keys(c).map(x=>i.jsx(r.MenuItem,{value:x,children:x},x)),[c]);return i.jsxs(r.FormControl,{sx:{minWidth:135},size:"small",children:[i.jsx(r.InputLabel,{children:h}),i.jsx(r.Select,{inputProps:{tabIndex:O},value:S,label:h,onChange:k,sx:{backgroundImage:`linear-gradient(${y.alpha("#fff",t.getOverlayAlpha(5))}, ${y.alpha("#fff",t.getOverlayAlpha(5))})`},...I,children:p})]})}),B={Workbook:"workbook",Sheet:"sheet"},z={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},J={...X};delete J.Values;const ee={"By Rows":!0,"By Columns":!1},U=(j,h)=>{const d=Object.keys(h);for(let c=0;c<d.length;c++){const f=d[c];if(h[f]===j)return f}},G=s.memo(j=>{const{replace:h=!1,findText:d,replaceText:c,findOptions:f,replaceOptions:O,title:I,onHide:S,onFindOrReplace:C,...k}=j,p=s.useRef(null),x=s.useRef(null),D=s.useRef(null),P=s.useRef(null),K=s.useRef(null),M=s.useRef(null),$=(e,n)=>{n&&(n.start(e,{center:!1}),setTimeout(()=>n.stop(e),180))},[L,b]=s.useState(!1),[w,Q]=s.useState(!1),[g,E]=s.useState(h),[W,F]=s.useState(!1),[Z,q]=s.useState(!1),[l,u]=s.useState({findText:null,replaceText:null,replace:h,replaceOptions:{},findOptions:{matchCase:!1,matchEntireCell:!1,useRegex:!1,orientation:a.IRange.Orientation.Row,fields:[a.ICell.Content.Formulas]},scope:B.Sheet}),R=t.T(async(e,n,o,T)=>{if(!C)return;const m={...l};m.replaceOptions={...m.replaceOptions},m.findOptions={...m.findOptions},m.replaceOptions.maxCount=o?void 0:1,m.replace=n,n&&l.findOptions.fields?.[0]===a.ICell.Content.Values&&(m.findOptions.fields=[a.ICell.Content.Formulas]),m.findOptions.reverse=!e;const _=await C({autoFocus:T,...m});F(_===0)},[l,C]);s.useEffect(()=>{F(!1)},[l,w,g]);const V=t.T((e,n)=>{if(e.keyCode===t.eo.Enter){if(!l.findText)return;let o=!0,T=!1;e.shiftKey&&(o=!1),n?(e.ctrlKey&&e.altKey&&(T=!0),$(e,T?M.current:K.current)):$(e,o?P.current:D.current),R(o,n,T,!1)}},[l]),N=s.useRef(null);s.useLayoutEffect(()=>{u(e=>{const n={...e};n.findText=d&&d.length>0?d:e.findText??"",b(!0),c!==void 0&&(n.replaceText=c),f&&(n.findOptions={...n.findOptions,...f}),n.replaceText||(n.replaceText=""),n.replaceOptions&&(n.replaceOptions={...n.replaceOptions}),O&&(n.replaceOptions={...n.replaceOptions,...O}),l.findOptions.fields?.[0]||(l.findOptions.fields=[a.ICell.Content.Formulas]);const o=!(!O&&c===void 0);return o&&E(o),n}),Z||N.current?.focus()},[d,c,f,O]),s.useEffect(()=>{g?(l.findOptions.fields[0],a.ICell.Content.Values):b(!0)},[g]),s.useEffect(()=>{if(L&&p.current&&l.findText===p.current.value)return p.current===document.activeElement||p.current.contains(document.activeElement)?(p.current?.select(),void b(!1)):void p.current.addEventListener("focus",()=>{p.current?.select(),b(!1)},{once:!0})},[L,l]);const[Y,{width:H}]=t.useMeasure();return i.jsx(t.Bn,{title:I??(g?"Find & Replace":"Find"),initialPosition:{y:"35"},autoFocusSel:".input",refWindow:N,onHide:S,onFocus:()=>q(!0),onBlur:()=>{q(!1),F(!1)},PaperProps:{elevation:Z?3:1},...k,children:i.jsxs(r.DialogContent,{dividers:!0,ref:Y,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)E(!0),p.current?.contains(document.activeElement)&&x.current?.focus();else if(e.key==="f"&&e.ctrlKey)p.current?.focus();else if(e.key==="c"&&e.altKey)u(n=>{const o={...n};return o.findOptions.matchCase=!n.findOptions.matchCase,o});else if(e.key==="e"&&e.altKey)u(n=>{const o={...n};return o.findOptions.matchEntireCell=!n.findOptions.matchEntireCell,o});else{if(e.key!=="r"||!e.altKey)return;u(n=>{const o={...n};return o.findOptions.useRegex=!n.findOptions.useRegex,o})}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(t.ol,{selected:w,onSelectToggle:e=>{Q(e)},preventFocus:!0,label:"Toggle Additional Options",icon:t.x5(i.jsx(t.Fi,{}))}),i.jsx(t.ol,{selected:g,onSelectToggle:e=>{E(e)},preventFocus:!0,label:"Toggle Replace",icon:t.x5(i.jsx(t.Ii,{})),shortcut:{key:g?"F":"H",modifiers:[t.Z.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:H>460?"20em":void 0,backgroundImage:`linear-gradient(${y.alpha("#fff",t.getOverlayAlpha(5))}, ${y.alpha("#fff",t.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(t.ol,{selected:l.findOptions.matchCase,onSelectToggle:e=>{u(n=>{const o={...n};return o.findOptions.matchCase=e,o})},label:"Match Case",shortcut:{key:"C",modifiers:[t.Z.Alt]},icon:t.x5(i.jsx(t.$i,{}))}),i.jsx(t.ol,{selected:l.findOptions.matchEntireCell,onSelectToggle:e=>{u(n=>{const o={...n};return o.findOptions.matchEntireCell=e,o})},label:"Match Entire Cell",shortcut:{key:"E",modifiers:[t.Z.Alt]},icon:t.x5(i.jsx(t.ji,{}))}),i.jsx(t.ol,{selected:l.findOptions.useRegex,onSelectToggle:e=>{u(n=>{const o={...n};return o.findOptions.useRegex=e,o})},label:"Use Regular Expression",shortcut:{key:"R",modifiers:[t.Z.Alt]},icon:t.x5(i.jsx(t.Ui,{}))})]})})},sx:{flex:"1 1 100%",marginRight:e=>e.spacing(1),"& .MuiOutlinedInput-notchedOutline":{borderColor:e=>W?`${e.palette.error.main} !important`:void 0},"& .MuiInputLabel-outlined":{color:e=>W?`${e.palette.error.main} !important`:void 0}},value:l.findText??"",onChange:e=>{u(n=>{const o={...n};return o.findText=e.target.value,o})},onKeyDown:e=>V(e,!1),onContextMenu:e=>{e.stopPropagation()}}),i.jsx(t.ol,{selected:l.findOptions.reverse,onSelectToggle:e=>{R(!1,!1)},touchRippleRef:D,label:"",shortcut:{key:"Enter",modifiers:[t.Z.Shift]},icon:t.x5(l.findOptions.orientation!==a.IRange.Orientation.Column?i.jsx(v.ArrowBack,{}):i.jsx(v.ArrowUpward,{})),disabled:!l.findText}),i.jsx(t.ol,{selected:!l.findOptions.reverse,onSelectToggle:e=>{R(!0,!1)},touchRippleRef:P,label:"Next Match",shortcut:{key:"Enter"},icon:t.x5(l.findOptions.orientation!==a.IRange.Orientation.Column?i.jsx(v.ArrowForward,{}):i.jsx(v.ArrowDownward,{})),disabled:!l.findText})]}),i.jsx(r.Collapse,{in:g,timeout:z,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(${y.alpha("#fff",t.getOverlayAlpha(5))}, ${y.alpha("#fff",t.getOverlayAlpha(5))})`},inputProps:{ref:x,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:l.replaceText??"",onChange:e=>{u(n=>{const o={...n};return o.replaceText=e.target.value,o})},onKeyDown:e=>V(e,!0),onContextMenu:e=>{e.stopPropagation()}}),i.jsx(t.ol,{onSelectToggle:e=>{R(!0,!0)},touchRippleRef:K,label:"Replace",shortcut:{key:"Enter"},icon:t.x5(i.jsx(t.Bi,{})),disabled:!l.findText}),i.jsx(t.ol,{onSelectToggle:e=>{R(!0,!0,!0)},touchRippleRef:M,label:"Replace All",shortcut:{key:"Enter",modifiers:[t.Z.Ctrl,t.Z.Alt]},icon:t.x5(i.jsx(t.Wi,{})),disabled:!l.findText})]})})]})]}),i.jsx(r.Collapse,{in:w,timeout:z,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(t.Zt,{orientation:"horizontal",sx:{marginBottom:e=>e.spacing(1.5)}}),i.jsxs(r.Box,{sx:{display:"flex",flexDirection:H>=413?"row":"column",justifyContent:"space-evenly",alignItems:"center",rowGap:e=>e.spacing(2)},tabIndex:-1,children:[i.jsx(A,{label:"Within",value:l.scope,options:B,onSelect:e=>{u(n=>{const o={...n};return o.scope=e,o})}}),i.jsx(A,{label:"Search",value:l.findOptions.orientation!==a.IRange.Orientation.Column,options:ee,onSelect:e=>{u(n=>{const o={...n};return o.findOptions.orientation=e?a.IRange.Orientation.Row:a.IRange.Orientation.Column,o})}}),i.jsx(A,{label:"Look in",value:g&&l.findOptions.fields?.[0]===a.ICell.Content.Values?a.ICell.Content.Formulas:l.findOptions.fields?.[0],options:g?J:X,onSelect:e=>{u(n=>{const o={...n};return o.findOptions.fields=[e],o})}})]})]})})]})})});exports.FindReplaceWindow=G,exports.ScopeOptions=B,exports.default=G;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.3.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.3.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.3.
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.3.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("react"),s=require("@mui/material"),o=require("./
|
|
6
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("react"),s=require("@mui/material"),o=require("./DH8xGuT9Jvx7Jhde.cjs"),u=require("@mui/system"),q=["Ok","Cancel"],O=n.memo(b=>{const{initialHyperlink:l=null,initialDisplay:v=null,onUpdateHyperlink:m,context:r,onOption:f,onValidateOption:d,onDone:c,options:y=q,defaultOption:g=y?.[0],cancelOption:p="Cancel",sx:F,...P}=b,D=n.useMemo(()=>(l??r?.()?.getHyperlink())!==null,[]),T=n.useMemo(()=>{let e=null,a=null;l&&(typeof l=="string"?a=l:e=l);const h=e??r?.()?.getHyperlink();return{address:a??h?.getAddress()??"",textToDisplay:h?.getDisplayText()??""}},[l,r]),[t,j]=n.useState(T.address),[x,H]=n.useState(()=>{const e=r?.().toTextUnformatted()??v;return e===T.address?"":e}),[I,k]=n.useState(!1),M=n.useCallback(e=>{H(e.target.value)},[]),C=n.useCallback(async(e,a)=>null,[]),w=o.T(async e=>{e!==p&&m?.(t===""?null:{address:t},x),f?.(e,e===p,e===g),c?.()},[t,x,m,c,f,g,p]),A=o.T(e=>{j(e.target.value),C(e.target.value,null)},[d]),S=o.T(async e=>{let a=await Promise.resolve(d?.(e));try{a!==!1&&(a=await C(t,e))}catch{}return a??!0},[d]);return i.jsx(o.D8,{title:(D?"Edit":"Insert")+" Link",options:y,onDone:c,onOption:e=>w(e),onValidateOption:S,defaultOption:g,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(),k(!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(${u.alpha("#fff",o.getOverlayAlpha(5))}, ${u.alpha("#fff",o.getOverlayAlpha(5))})`}}},value:t,onChange:A,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:()=>{k(!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(${u.alpha("#fff",o.getOverlayAlpha(5))}, ${u.alpha("#fff",o.getOverlayAlpha(5))})`}}},value:x,onChange:M,onContextMenu:e=>{e.stopPropagation()}})})]})})});exports.HyperlinkDialog=O,exports.default=O;
|