@sheetxl/studio-mui 0.3.10 → 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/{D8QgpxM8AQ_Yc2G7.cjs → 4qxj4RND17MVUKvQ.cjs} +1 -1
- package/browser/cjs/{ClnBCamaagtKZBpY.cjs → B6Z_r2z2hupw-Icu.cjs} +1 -1
- package/browser/cjs/{w2M1QgZrGHPEXdGl.cjs → B86bJWqdxKB1n5qL.cjs} +1 -1
- package/browser/cjs/{CDTLuiZqINPZNL3g.cjs → B9jhMVr_lzR7XDTZ.cjs} +2 -2
- package/browser/cjs/{Cu5e_qjFt8NFAcnQ.cjs → BCgY6k5hSOMO3vA0.cjs} +1 -1
- package/browser/cjs/{B84QaNAKaToAhS9f.cjs → BE3BEEtqYgzZmOSZ.cjs} +2 -2
- package/browser/cjs/{UzOp5ZlFa-Ple-U-.cjs → BWixRYBNkotmqbUE.cjs} +3 -3
- package/browser/cjs/{D0DJcRKDO1If3vPE.cjs → BXUo0RHDLaL8FXpJ.cjs} +2 -2
- package/browser/cjs/{v8XI40CW2dS8AZ4_.cjs → BZmN15VylTyNKIpo.cjs} +1 -1
- package/browser/cjs/{8rBL-txHTY8OrXaM.cjs → BbcCIOnYQGgasZcj.cjs} +2 -2
- package/browser/cjs/{B6pCx69OoPPLQ-2k.cjs → BlRalQWpLl69G8WF.cjs} +3 -3
- package/browser/cjs/{B3A3QhXwx9gFQi_R.cjs → BmXduwci_kW15_dx.cjs} +1 -1
- package/browser/cjs/{D7XI1Na9kqJmWFJ_.cjs → BqzHHZefgtQsIYXn.cjs} +4 -4
- package/browser/cjs/{BluOLGwTUaxUEzEB.cjs → C3vxY6j2P3eMDw8H.cjs} +1 -1
- package/browser/cjs/{DvncGQuC1_8ZGdni.cjs → CLkzgt532QDjkt7s.cjs} +2 -2
- package/browser/cjs/{CWUaU2cJ59CzttRg.cjs → CgzuEJm42eZyBlV2.cjs} +2 -2
- package/browser/cjs/{i6iGyYrvzDX2BvtQ.cjs → CjSELYadyhvfejBL.cjs} +1 -1
- package/browser/cjs/{JMjwP-mLJHuVUzy0.cjs → ClrfGGLdzz8DoHKc.cjs} +2 -2
- package/browser/cjs/{zaZRJF6qdN_Lzqys.cjs → DH8xGuT9Jvx7Jhde.cjs} +7 -7
- package/browser/cjs/{-Vw1Y0Tc8E58qLHV.cjs → DRdvygxxSsskSJLv.cjs} +2 -2
- package/browser/cjs/{BRs0sF7HaSEdiTtI.cjs → DXzKwAsUF8mF8koH.cjs} +2 -2
- package/browser/cjs/{J9dQIqm5NvxbsrVw.cjs → DxVUgEWHQmRmwQ8i.cjs} +2 -2
- package/browser/cjs/{B4PVOg74TFT1oYfY.cjs → Sn_BinYkItKWn4DV.cjs} +2 -2
- package/browser/cjs/{QwyiIMSiejofKmeV.cjs → fqLDdzVkhjNs5i7e.cjs} +2 -2
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{DbrB1mO5HgThwGuj.cjs → pjnz8m_gi6TjVzhg.cjs} +1 -1
- package/browser/esm/{B3bJnBH8GzReeLnn.mjs → 5siMjkfHzwxH9n6J.mjs} +8 -8
- package/browser/esm/{BmO51u7GZAI2GbUi.mjs → 7quvp89l4vL9ymd2.mjs} +2 -2
- package/browser/esm/{-cM1e9c3UEpa5_gL.mjs → BA4T9TUy78nBZ0YO.mjs} +1 -1
- package/browser/esm/{Cxcvr3lLKLl2wJc1.mjs → BG6Tixkw9X3LS58L.mjs} +1 -1
- package/browser/esm/{D3gzJo_2Y7AsLCpv.mjs → BL0KUvfhsdXLpjQL.mjs} +2 -2
- package/browser/esm/{YQp1ts4aApqfFCpN.mjs → BWsdLA6IDCWmT3bo.mjs} +1 -1
- package/browser/esm/{Dg2FsPa20O3uFQUO.mjs → B_tOuH7CovhYw7zf.mjs} +4 -4
- package/browser/esm/{CY039D-gDgZI41TV.mjs → BoBQPE89SbYRRKl_.mjs} +3 -3
- package/browser/esm/{S77h_uvTkRo0iojv.mjs → BzNAkqPI8Noutl-F.mjs} +1 -1
- package/browser/esm/{_oRXRbc4dZ4y8qYN.mjs → C0o1iIoa4s9IYAy3.mjs} +1 -1
- package/browser/esm/{CTPMFmXMr-05ptOe.mjs → CPxpz490_Xxt3hoa.mjs} +4 -4
- package/browser/esm/{Sac_bz0S7HqH0sdC.mjs → CT7ds2Q6xFT5oB2q.mjs} +2 -2
- package/browser/esm/{Dzzs0f8pvcA3vRnS.mjs → CTWcr4hNtdb2J0-L.mjs} +1 -1
- package/browser/esm/{DRBw-ZIV9GK417Hv.mjs → CnRhPHP7nM9hdXV7.mjs} +6 -6
- package/browser/esm/{DkPUjDuMV6VbrC5f.mjs → DE6RG6hgYtGVQMdq.mjs} +2 -2
- package/browser/esm/{D52r-ThxO60uFB6w.mjs → DE8EE4ecYa7lbzXR.mjs} +1 -1
- package/browser/esm/{Bxnn8OJYYsxdL4LZ.mjs → DfVW0IbWDV5RQ70P.mjs} +2 -2
- package/browser/esm/{BO5BLEcHX53-09cT.mjs → DmlmzrQiTKLEcJ6G.mjs} +2 -2
- package/browser/esm/{D0QeOyqSjvvgElpR.mjs → LFiIMXFU27WAMwTI.mjs} +2 -2
- package/browser/esm/{thinn1X9zhCHsS45.mjs → TLlpx_JdNEdoWOCt.mjs} +2 -2
- package/browser/esm/{DIJ8Ka2AxZOwYb_E.mjs → Ymcll64nQ4tzkxQG.mjs} +2 -2
- package/browser/esm/{CtnQGwcL6zd1GX9Z.mjs → b9iZet0OZIChjL5w.mjs} +2 -2
- package/browser/esm/{-U_CagAsNhkz5x_r.mjs → fK6ZnymH4JhVcxvX.mjs} +1 -1
- package/browser/esm/index.mjs +2 -2
- package/browser/esm/{CF5T9VE6N5cDPyuS.mjs → kSpx4jqia44jvQnN.mjs} +1 -1
- package/browser/esm/{FhBzV15LztkWbCiP.mjs → pRbEhccyqBIjjCNJ.mjs} +3 -3
- package/licenses/dependencies.txt +6 -6
- package/node/esm/{B3ityU6s1jisUzdB.mjs → 5Bt2PmMwih_bWydn.mjs} +1 -1
- package/node/esm/{BDIK4I3rLEp71huC.mjs → B3yV-y5PXpkGdfBK.mjs} +3 -3
- package/node/esm/{DITOq1QC8tY5-bbp.mjs → BPwU9tQeYnirfdXP.mjs} +1 -1
- package/node/esm/{Cz9BfmFc2ugq_E19.mjs → BV5RGN-2POXPUXA8.mjs} +1 -1
- package/node/esm/{BTR-ih1lMRtEgNN_.mjs → BbZRx08lgZDKMvQf.mjs} +1 -1
- package/node/esm/{T4iMVfn07ZBDmEAu.mjs → BkXFqT40KjGpqOKS.mjs} +1 -1
- package/node/esm/{Bnk3FyjH2bTeLrcm.mjs → C6_KqGliXZKesliM.mjs} +3 -3
- package/node/esm/{B1RGZA2vNUHkLdVo.mjs → CBuG0qlqkZBdJpEZ.mjs} +1 -1
- package/node/esm/{mTPFNaSqradTPAnj.mjs → CG6utV5RNszf-LBP.mjs} +1 -1
- package/node/esm/{DLYCLpv2tJKL3buP.mjs → CHfPyDHGWIm3dn_g.mjs} +1 -1
- package/node/esm/{CrwxkPzrbC-O5xcd.mjs → CKXmNvPaQ8lpv2vG.mjs} +1 -1
- package/node/esm/{LKAl9Kb3Jz3PmPDy.mjs → COpq6b2A7-HCJU-Y.mjs} +1 -1
- package/node/esm/{B5CxRStLFGXRUzZK.mjs → CnbD59Z1_QPagb2W.mjs} +1 -1
- package/node/esm/{9Sk9h10ysfHWjMCP.mjs → Cp4W18q-ThZxeIiG.mjs} +1 -1
- package/node/esm/{D5U1wSXq1yJDIHgH.mjs → Cqgp9rD9KFVOji_a.mjs} +1 -1
- package/node/esm/{B9aeXHc33sdF26Lu.mjs → Cy7MRPW2uKidMDiU.mjs} +1 -1
- package/node/esm/{BM52mZvh0-t0GKtP.mjs → D4td9HLqM7ljbwXL.mjs} +1 -1
- package/node/esm/{GJeZbGqz5JLPnry6.mjs → D8Y58cjN6VN73Y3K.mjs} +1 -1
- package/node/esm/{BMfSzqNOepUgF3lj.mjs → DUieiX_nhBNq19A6.mjs} +1 -1
- package/node/esm/{DNxV9ousNY7lSo65.mjs → TEQj40CnPFLlEvbp.mjs} +2 -2
- package/node/esm/{BENQpQZI4s6r-AWq.mjs → eZloHHKviDBLnpPa.mjs} +1 -1
- package/node/esm/{owDSIPnT7N4qwPdW.mjs → imPzIvgPpjx7biBn.mjs} +5 -5
- package/node/esm/index.mjs +8 -8
- package/node/esm/{BzCh5MFqZPg1okp5.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;
|