@sheetxl/studio-mui 0.4.12 → 0.4.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 (127) hide show
  1. package/browser/cjs/-zKDSjn55SCvCwk8.cjs +6 -0
  2. package/browser/cjs/AoLA7tfyPshG_mKt.cjs +6 -0
  3. package/browser/cjs/As7uhSEgY8VJ3I6f.cjs +90 -0
  4. package/browser/cjs/B1Eaz6PFZAmrWiyY.cjs +6 -0
  5. package/browser/cjs/B8ZfZXhvW4sSKKZs.cjs +42 -0
  6. package/browser/cjs/BAfNSJo7fktzFVJd.cjs +11 -0
  7. package/browser/cjs/BH0v7IIykugrFxaT.cjs +6 -0
  8. package/browser/cjs/BUwmvmcdC0xBQ97L.cjs +145 -0
  9. package/browser/cjs/BiBEmbWoJHdOB1li.cjs +12 -0
  10. package/browser/cjs/BkVtS9FZxWYNmrbU.cjs +6 -0
  11. package/browser/cjs/Bmifo5y7ZMJolUTY.cjs +15 -0
  12. package/browser/cjs/BpLu9-spCLcAFdwd.cjs +6 -0
  13. package/browser/cjs/BqOg0z4HGrbNaL1k.cjs +6 -0
  14. package/browser/cjs/C6Fk0jGWAOED60yf.cjs +161 -0
  15. package/browser/cjs/CRvxop0QcZL23Akb.cjs +6 -0
  16. package/browser/cjs/CS5USjyVh8DwPSri.cjs +7 -0
  17. package/browser/cjs/Chz3K3Qt8M2FNJwI.cjs +12 -0
  18. package/browser/cjs/D2gy3JDrJyGAMqsl.cjs +7 -0
  19. package/browser/cjs/DD8-ZSDUkRqk7l6y.cjs +11 -0
  20. package/browser/cjs/DNL88d5PGwk92LeD.cjs +6 -0
  21. package/browser/cjs/DTHMIHonHaHeJ0o1.cjs +18 -0
  22. package/browser/cjs/DZ8WTAzF6V2Tw1tW.cjs +6 -0
  23. package/browser/cjs/W7LR70ajtjR9Lmvl.cjs +6 -0
  24. package/browser/cjs/XGmQ2kUHM2qQkG1r.cjs +16 -0
  25. package/browser/cjs/d2jsgbPdf35xArnn.cjs +6 -0
  26. package/browser/cjs/index.cjs +4 -10
  27. package/browser/esm/4fzdzYhVH9eIXv-E.mjs +2410 -0
  28. package/browser/esm/B-rZWEIXFvB2W_mP.mjs +84 -0
  29. package/browser/esm/C4ORm_Up6Zxt92F_.mjs +1672 -0
  30. package/browser/esm/C5OCdRxcYIZViFzN.mjs +13391 -0
  31. package/browser/esm/C8po4rRYJ8127Rgb.mjs +44 -0
  32. package/browser/esm/CB7vnn7AtsGma4R6.mjs +3803 -0
  33. package/browser/esm/CBQZHZlKIiEz186r.mjs +2251 -0
  34. package/browser/esm/CCwOCTrf9Bira1-Y.mjs +424 -0
  35. package/browser/esm/CHovQU_R4AuKULmT.mjs +392 -0
  36. package/browser/esm/CIH3ADFJJmUiyA8p.mjs +864 -0
  37. package/browser/esm/CQiALmsycGGLFj1o.mjs +25 -0
  38. package/browser/esm/CS6uJp7phBvUmos6.mjs +1467 -0
  39. package/browser/esm/CSKgHJSTMvOEe2RH.mjs +19981 -0
  40. package/browser/esm/CYG1vk4AMMwqsul7.mjs +1366 -0
  41. package/browser/esm/ClmlhDf-0RC5GFV3.mjs +52 -0
  42. package/browser/esm/CmAnpd_SOxQuTQRL.mjs +1703 -0
  43. package/browser/esm/DWy4L2usallW0WdU.mjs +153 -0
  44. package/browser/esm/Dc1PmtvbeqsIQHq6.mjs +48 -0
  45. package/browser/esm/DgKsUQMTThBdEQds.mjs +59 -0
  46. package/browser/esm/Dk00kGaRJxiitO5-.mjs +23 -0
  47. package/browser/esm/FdSIHwC_mNRZpcgJ.mjs +43 -0
  48. package/browser/esm/Ks946bL2vmd4m743.mjs +52 -0
  49. package/browser/esm/TlZOl3Gt-d0Nc2a8.mjs +46 -0
  50. package/browser/esm/_FvE2-K7MOW_qWVS.mjs +1352 -0
  51. package/browser/esm/index.mjs +83 -8
  52. package/browser/esm/vgS9ixFRuZrPx6vq.mjs +640 -0
  53. package/licenses/dependencies.txt +134 -134
  54. package/node/esm/{B3M2CzPvK2oKOfg5.mjs → 762kbapO408ejsVC.mjs} +2 -2
  55. package/node/esm/{CryVonGjJnmo2dE_.mjs → B0gJGF9-J3L5yBEW.mjs} +5 -5
  56. package/node/esm/{CBGAl2mih9mHDt5w.mjs → BR9YJuwMP9nTMBE-.mjs} +1 -1
  57. package/node/esm/{D1xD8cOQDGcbjIlG.mjs → BTNBRzW8ZZbJY4GL.mjs} +1 -1
  58. package/node/esm/{C2P_M1JNT_WZZN3H.mjs → Bgtg4I8EL4M776SY.mjs} +8 -8
  59. package/node/esm/{DUfB1ollhqU-JIk5.mjs → Bi5br6yrYZqhLEiY.mjs} +4 -4
  60. package/node/esm/{M3UB6IrhVERZziiJ.mjs → CCygt4zw40-jO57G.mjs} +2 -2
  61. package/node/esm/{m8fyd2BoYkTOJlc1.mjs → CTpkd2r1aBS5d0yl.mjs} +1 -1
  62. package/node/esm/{kHsChOtl8GUkzj5Q.mjs → CY1qC_sXGD6av4yO.mjs} +2 -2
  63. package/node/esm/{Dx2vq1Hdt4pqmOF-.mjs → CZoMFCKJudiTl_Tf.mjs} +2 -2
  64. package/node/esm/{kIQFLB3nmEJdn_OT.mjs → CzWLA_IQgFbENkMq.mjs} +1 -1
  65. package/node/esm/{BJY8yNMmN_yyRtIG.mjs → D1GfRQ1jyFg-wmLD.mjs} +1 -1
  66. package/node/esm/{D1C8ifsmXsypL6pp.mjs → DC2dPUCWVgxEKzaS.mjs} +13 -13
  67. package/node/esm/{Bj8uU2shfkvN4LnE.mjs → DOUP6ynjlQE-UEJs.mjs} +6 -6
  68. package/node/esm/{BIRLX0-9t62Lqats.mjs → DUqIYzvmrCd67Dpx.mjs} +2 -2
  69. package/node/esm/{CVGxETc4rIE1gNAH.mjs → DWCxF-chq5dVi363.mjs} +38 -38
  70. package/node/esm/{Bt5y5wVaVAVjwHBl.mjs → DghPySv_2Ts78czJ.mjs} +1 -1
  71. package/node/esm/{PF5CCBvapZxEzc7k.mjs → DrujinnhlNDCosqb.mjs} +1 -1
  72. package/node/esm/DsD7O5j2cXyaECkB.mjs +313 -0
  73. package/node/esm/{wdtYNTNCynMMS4_P.mjs → VHY56h6xqQcPba6u.mjs} +1 -1
  74. package/node/esm/{h1y2hBFecTqRgUa-.mjs → dlEq3vDkIERtTn7Y.mjs} +25 -25
  75. package/node/esm/index.mjs +4999 -5264
  76. package/node/esm/{CKtVB9hMCfabQMxC.mjs → yB8OTWhDomxUy_SX.mjs} +2 -2
  77. package/node/esm/{bv_GA6NGCT0sJaXy.mjs → yP0whgIwVZApluLw.mjs} +2 -2
  78. package/package.json +8 -8
  79. package/types/index.d.ts +0 -11
  80. package/browser/cjs/B7qLzxylqOaybl3H.cjs +0 -7
  81. package/browser/cjs/BNGixOiIsu8jZlvn.cjs +0 -7
  82. package/browser/cjs/BUYxt7KgFkIIIMyc.cjs +0 -7
  83. package/browser/cjs/Bk6VhhWsnCRyBu2F.cjs +0 -7
  84. package/browser/cjs/BpiMMYip132x0r1O.cjs +0 -7
  85. package/browser/cjs/ByZ_Q-J7jgF7AoWR.cjs +0 -7
  86. package/browser/cjs/BzD7LV8VmFKLAJyW.cjs +0 -7
  87. package/browser/cjs/C6_zcNM0Efa11KEE.cjs +0 -7
  88. package/browser/cjs/C8Azx_ZaQa4WvAtR.cjs +0 -7
  89. package/browser/cjs/CITvaW7L_iZfIyAN.cjs +0 -7
  90. package/browser/cjs/CNDDYOoLCrGsUMYL.cjs +0 -7
  91. package/browser/cjs/CYbeY5OVZDqHGSOm.cjs +0 -7
  92. package/browser/cjs/C_SgucbRn-v9IkNO.cjs +0 -7
  93. package/browser/cjs/CeTd2nFbE5yFzf7T.cjs +0 -7
  94. package/browser/cjs/Cfe7IbPNI8-CgoDI.cjs +0 -7
  95. package/browser/cjs/Ctyk-ajkSsTDJuvY.cjs +0 -7
  96. package/browser/cjs/DBhTQLbjAtU-A1YA.cjs +0 -7
  97. package/browser/cjs/Dc2rbOjtcmSIm8D4.cjs +0 -7
  98. package/browser/cjs/DcsvUmoS8zGG5GB8.cjs +0 -7
  99. package/browser/cjs/DqAlQQIZIyF7HMib.cjs +0 -7
  100. package/browser/cjs/DuwawlAm4aRBNTBm.cjs +0 -7
  101. package/browser/cjs/Dx9UUJj-yeubDjm4.cjs +0 -7
  102. package/browser/cjs/IC19hB4Ntvw1158j.cjs +0 -7
  103. package/browser/cjs/reQ9miE5C5qMfbRJ.cjs +0 -7
  104. package/browser/esm/B1Ey4ZP8BHUzHW7G.mjs +0 -7
  105. package/browser/esm/B8dJHVZJta8QbNKG.mjs +0 -7
  106. package/browser/esm/BThbC01mtb7qq8_A.mjs +0 -7
  107. package/browser/esm/Bnt1M91BRyMvXrc4.mjs +0 -7
  108. package/browser/esm/BqN0SYrEO0RZQtv-.mjs +0 -7
  109. package/browser/esm/CHPXsEre3jry2-jF.mjs +0 -7
  110. package/browser/esm/CMCOU0nDlymDFS9l.mjs +0 -7
  111. package/browser/esm/Cc7y1nMDr5J8jWx-.mjs +0 -7
  112. package/browser/esm/CesL-3BNbMB1f_if.mjs +0 -7
  113. package/browser/esm/CfvNSnuQLa1SPbNL.mjs +0 -7
  114. package/browser/esm/CloqVDbJmTL4oFek.mjs +0 -7
  115. package/browser/esm/Cta0yn5UIrP2UoT4.mjs +0 -7
  116. package/browser/esm/CwRyQHiDoBLx5_1g.mjs +0 -7
  117. package/browser/esm/DI-ZGstUJFwkx4H6.mjs +0 -7
  118. package/browser/esm/DQTfmweCXjuIlITn.mjs +0 -7
  119. package/browser/esm/DUIfOO25d1fqtJzn.mjs +0 -7
  120. package/browser/esm/DhOXsRr8c7bDS1jM.mjs +0 -7
  121. package/browser/esm/JPwh2m5-pXkdPVzF.mjs +0 -7
  122. package/browser/esm/UkNAvQj0NVgeMpUl.mjs +0 -7
  123. package/browser/esm/ZUfck_LDsQb9gpvU.mjs +0 -7
  124. package/browser/esm/gHhqkr52cxXkga0T.mjs +0 -7
  125. package/browser/esm/obM68UOvA5HV7Lt1.mjs +0 -7
  126. package/browser/esm/x9MyDRdLE47dI9dF.mjs +0 -7
  127. package/browser/esm/yW9jxnamUqAhVQkJ.mjs +0 -7
@@ -1,7 +0,0 @@
1
- /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.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 a}from"react/jsx-runtime";import{memo as t,useMemo as n,useState as l,useCallback as o}from"react";import{Box as r}from"@mui/material";import{B as i,p as s,N as d,R as p}from"./Cc7y1nMDr5J8jWx-.mjs";const u=["Ok","Cancel"],c=t(t=>{const{value:c=null,context:m,onOption:g,onValidateOption:x,onDone:f,onUpdate:N,options:y=u,defaultOption:T=y?.[0],cancelOption:O="Cancel",sx:V,...h}=t,R=n(()=>m?.getNames().findValidName("Range1"),[]),v=n(()=>{if(!c)return!0},[]),[C,w]=l({displayText:c?.getName()??R,errorText:null}),[F,D]=l({displayValue:c?.getRanges()??m?.selection()??null,errorText:null}),[I,j]=l(!1),B=o(async e=>!C.errorText&&!F.errorText,[m]),E=i((e,a,t)=>{if(!a){let e=null;v?e=m?.getNames().addReference(C?.displayText,F?.displayValue,!1):("reference"===c.getType()&&c.doBatch(()=>{c.setName(C?.displayText),c.setReference(F?.displayValue)},`Edit Named '${C?.displayText}'`),e=c),e&&(e.select(),N(e,v))}g?.(e,a,t),f?.()},[m,C,F,f,g,T,O,N]),L=i(e=>{let a=null;try{m?.getNames().validateName(e)}catch(e){a=e.message}w({displayText:e,errorText:a})},[]),b=i(e=>{c&&c.getName().toLowerCase()===e.toLowerCase()||m?.getNames().validateName(e)},[m,c]),k=o(e=>{D({displayValue:e??null,errorText:null})},[]);return e(s,{title:(v?"Define":"Edit")+" Range",options:y,onOption:E,onValidateOption:B,defaultOption:T,cancelOption:O,autoFocusSel:".autoFocus",sx:{width:"460px",...V},...h,children:a(r,{sx:{paddingTop:e=>e.spacing(1),paddingBottom:e=>e.spacing(0),rowGap:e=>e.spacing(1),range:"flex",flexDirection:"column"},children:[e(d,{formName:"name",defaultInput:R,value:C.displayText,onChangeInput:L,onValidate:b,onFocus:e=>{I||e.target?.select(),j(!0)}}),e(p,{formName:"range",value:F.displayValue,onChangeInput:k,resolvedAddress:m.getNames().getRanges.bind(m.getNames()),onFocus:e=>{I||e.target?.select(),j(!0)}})]})})});export{c as NamedReferenceDialog,c as default};
@@ -1,7 +0,0 @@
1
- /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.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{Workbook as e}from"@sheetxl/sdk";const r=async(e,r)=>{const n=await e.toJSON(),t=r?.whiteSpace??0;let o;r?.beforeWrite?.(e,n),o=0===t?JSON.stringify(n):function(e,r=2){const n=[];function t(e){const t=r*e;return void 0===n[t]&&(n[t]=" ".repeat(t)),n[t]}return function e(r,n,o,f){if(null==r||"object"!=typeof r)return JSON.stringify(r);const i=t(n),a=t(n+1);if(Array.isArray(r)){const t=r.length;if(0===t)return"[]";if(0!==o)return JSON.stringify(r);let f="[\n";for(let i=0;i<t;i++)f+=a+e(r[i],n+1,o+1,!0),i<t-1&&(f+=",\n");return f+="\n"+i+"]",f}const s=Object.keys(r),u=s.length;if(0===u)return"{}";if(!(o<2))return JSON.stringify(r);let c="{\n";f||(o=0);for(let t=0;t<u;t++){const f=s[t];c+=a+JSON.stringify(f)+": "+e(r[f],n+1,o,!1),t<u-1&&(c+=",\n")}return c+="\n"+i+"}",c}(e,0,0,!1)}(n,t);let f=(new TextEncoder).encode(o).buffer;const i=r?.compress??!0;return i&&(f=await async function(e,r="gzip"){let n;"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer?(n=new ArrayBuffer(e.byteLength),new Uint8Array(n).set(new Uint8Array(e))):n=e;const t=new ReadableStream({start(e){e.enqueue(n),e.close()}}),o=new CompressionStream(r),f=t.pipeThrough(o);return(await new Response(f).blob()).arrayBuffer()}(f,"string"==typeof i?i:void 0)),f},n=async(r,n)=>{let t=r;(function(e){if(e.byteLength<4)return!1;const r=new Uint8Array(e),n={gzip:[31,139],zip:[80,75,3,4],bz2:[66,90,104],br:[206,178,207,129]},t=Object.keys(n);for(let e=0;e<t.length;e++){const o=t[e],f=n[o];let i=!0;for(let e=0;e<f.length;e++)if(r[e]!==f[e]){i=!1;break}if(i)return o}return!1})(t)&&(t=await async function(e,r="gzip"){let n;"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer?(n=new ArrayBuffer(e.byteLength),new Uint8Array(n).set(new Uint8Array(e))):n=e;const t=new Blob([n]).stream(),o=new DecompressionStream(r),f=t.pipeThrough(o);return(await new Response(f).blob()).arrayBuffer()}(t));let o=(new TextDecoder).decode(t);const f=JSON.parse(o),i={...n?.createWorkbookOptions??{},json:f};return new e(i)};export{n as fromBufferJSON,r as toBufferJSON};
@@ -1,7 +0,0 @@
1
- /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.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
- function t(t){return Array.isArray?Array.isArray(t):"[object Array]"===c(t)}function e(t){return"string"==typeof t}function n(t){return"number"==typeof t}function s(t){return!0===t||!1===t||function(t){return i(t)&&null!==t}(t)&&"[object Boolean]"==c(t)}function i(t){return"object"==typeof t}function r(t){return null!=t}function u(t){return!t.trim().length}function c(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const o=Object.prototype.hasOwnProperty;class h{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(t=>{let n=a(t);this._keys.push(n),this._keyMap[n.id]=n,e+=n.weight}),this._keys.forEach(t=>{t.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function a(n){let s=null,i=null,r=null,u=1,c=null;if(e(n)||t(n))r=n,s=l(n),i=d(n);else{if(!o.call(n,"name"))throw new Error((t=>`Missing ${t} property in key`)("name"));const t=n.name;if(r=t,o.call(n,"weight")&&(u=n.weight,u<=0))throw new Error((t=>`Property 'weight' in key '${t}' must be a positive integer`)(t));s=l(t),i=d(t),c=n.getFn}return{path:s,id:i,weight:u,src:r,getFn:c}}function l(e){return t(e)?e:e.split(".")}function d(e){return t(e)?e.join("."):e}var g={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(i,u){let c=[],o=!1;const h=(i,u,a)=>{if(r(i))if(u[a]){const l=i[u[a]];if(!r(l))return;if(a===u.length-1&&(e(l)||n(l)||s(l)))c.push(function(t){return null==t?"":function(t){if("string"==typeof t)return t;let e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(t)}(l));else if(t(l)){o=!0;for(let t=0,e=l.length;t<e;t+=1)h(l[t],u,a+1)}else u.length&&h(l,u,a+1)}else c.push(i)};return h(i,e(u)?u.split("."):u,0),o?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const f=/[^ ]+/g;class A{constructor({getFn:t=g.getFn,fieldNormWeight:e=g.fieldNormWeight}={}){this.norm=function(t=1,e=3){const n=new Map,s=Math.pow(10,e);return{get(e){const i=e.match(f).length;if(n.has(i))return n.get(i);const r=1/Math.pow(i,.5*t),u=parseFloat(Math.round(r*s)/s);return n.set(i,u),u},clear(){n.clear()}}}(e,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((t,e)=>{this._keysMap[t.id]=e})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,e(this.docs[0])?this.docs.forEach((t,e)=>{this._addString(t,e)}):this.docs.forEach((t,e)=>{this._addObject(t,e)}),this.norm.clear())}add(t){const n=this.size();e(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let e=t,n=this.size();e<n;e+=1)this.records[e].i-=1}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!r(t)||u(t))return;let n={v:t,i:e,n:this.norm.get(t)};this.records.push(n)}_addObject(n,s){let i={i:s,$:{}};this.keys.forEach((s,c)=>{let o=s.getFn?s.getFn(n):this.getFn(n,s.path);if(r(o))if(t(o)){let n=[];const s=[{nestedArrIndex:-1,value:o}];for(;s.length;){const{nestedArrIndex:i,value:c}=s.pop();if(r(c))if(e(c)&&!u(c)){let t={v:c,i:i,n:this.norm.get(c)};n.push(t)}else t(c)&&c.forEach((t,e)=>{s.push({nestedArrIndex:e,value:t})})}i.$[c]=n}else if(e(o)&&!u(o)){let t={v:o,n:this.norm.get(o)};i.$[c]=t}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function p(t,e,{getFn:n=g.getFn,fieldNormWeight:s=g.fieldNormWeight}={}){const i=new A({getFn:n,fieldNormWeight:s});return i.setKeys(t.map(a)),i.setSources(e),i.create(),i}function C(t,{errors:e=0,currentLocation:n=0,expectedLocation:s=0,distance:i=g.distance,ignoreLocation:r=g.ignoreLocation}={}){const u=e/t.length;if(r)return u;const c=Math.abs(s-n);return i?u+c/i:c?1:u}const m=32;function F(t,e,n,{location:s=g.location,distance:i=g.distance,threshold:r=g.threshold,findAllMatches:u=g.findAllMatches,minMatchCharLength:c=g.minMatchCharLength,includeMatches:o=g.includeMatches,ignoreLocation:h=g.ignoreLocation}={}){if(e.length>m)throw new Error(`Pattern length exceeds max of ${m}.`);const a=e.length,l=t.length,d=Math.max(0,Math.min(s,l));let f=r,A=d;const p=c>1||o,F=p?Array(l):[];let M;for(;(M=t.indexOf(e,A))>-1;){let t=C(e,{currentLocation:M,expectedLocation:d,distance:i,ignoreLocation:h});if(f=Math.min(t,f),A=M+a,p){let t=0;for(;t<a;)F[M+t]=1,t+=1}}A=-1;let E=[],D=1,y=a+l;const B=1<<a-1;for(let s=0;s<a;s+=1){let r=0,c=y;for(;r<c;){C(e,{errors:s,currentLocation:d+c,expectedLocation:d,distance:i,ignoreLocation:h})<=f?r=c:y=c,c=Math.floor((y-r)/2+r)}y=c;let o=Math.max(1,d-c+1),g=u?l:Math.min(d+c,l)+a,m=Array(g+2);m[g+1]=(1<<s)-1;for(let r=g;r>=o;r-=1){let u=r-1,c=n[t.charAt(u)];if(p&&(F[u]=+!!c),m[r]=(m[r+1]<<1|1)&c,s&&(m[r]|=(E[r+1]|E[r])<<1|1|E[r+1]),m[r]&B&&(D=C(e,{errors:s,currentLocation:u,expectedLocation:d,distance:i,ignoreLocation:h}),D<=f)){if(f=D,A=u,A<=d)break;o=Math.max(1,2*d-A)}}if(C(e,{errors:s+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:h})>f)break;E=m}const x={isMatch:A>=0,score:Math.max(.001,D)};if(p){const t=function(t=[],e=g.minMatchCharLength){let n=[],s=-1,i=-1,r=0;for(let u=t.length;r<u;r+=1){let u=t[r];u&&-1===s?s=r:u||-1===s||(i=r-1,i-s+1>=e&&n.push([s,i]),s=-1)}return t[r-1]&&r-s>=e&&n.push([s,r-1]),n}(F,c);t.length?o&&(x.indices=t):x.isMatch=!1}return x}function M(t){let e={};for(let n=0,s=t.length;n<s;n+=1){const i=t.charAt(n);e[i]=(e[i]||0)|1<<s-n-1}return e}const E=String.prototype.normalize?t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):t=>t;class D{constructor(t,{location:e=g.location,threshold:n=g.threshold,distance:s=g.distance,includeMatches:i=g.includeMatches,findAllMatches:r=g.findAllMatches,minMatchCharLength:u=g.minMatchCharLength,isCaseSensitive:c=g.isCaseSensitive,ignoreDiacritics:o=g.ignoreDiacritics,ignoreLocation:h=g.ignoreLocation}={}){if(this.options={location:e,threshold:n,distance:s,includeMatches:i,findAllMatches:r,minMatchCharLength:u,isCaseSensitive:c,ignoreDiacritics:o,ignoreLocation:h},t=c?t:t.toLowerCase(),t=o?E(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const a=(t,e)=>{this.chunks.push({pattern:t,alphabet:M(t),startIndex:e})},l=this.pattern.length;if(l>m){let t=0;const e=l%m,n=l-e;for(;t<n;)a(this.pattern.substr(t,m),t),t+=m;if(e){const t=l-m;a(this.pattern.substr(t),t)}}else a(this.pattern,0)}searchIn(t){const{isCaseSensitive:e,ignoreDiacritics:n,includeMatches:s}=this.options;if(t=e?t:t.toLowerCase(),t=n?E(t):t,this.pattern===t){let e={isMatch:!0,score:0};return s&&(e.indices=[[0,t.length-1]]),e}const{location:i,distance:r,threshold:u,findAllMatches:c,minMatchCharLength:o,ignoreLocation:h}=this.options;let a=[],l=0,d=!1;this.chunks.forEach(({pattern:e,alphabet:n,startIndex:g})=>{const{isMatch:f,score:A,indices:p}=F(t,e,n,{location:i+g,distance:r,threshold:u,findAllMatches:c,minMatchCharLength:o,includeMatches:s,ignoreLocation:h});f&&(d=!0),l+=A,f&&p&&(a=[...a,...p])});let g={isMatch:d,score:d?l/this.chunks.length:1};return d&&s&&(g.indices=a),g}}class y{constructor(t){this.pattern=t}static isMultiMatch(t){return B(t,this.multiRegex)}static isSingleMatch(t){return B(t,this.singleRegex)}search(){}}function B(t,e){const n=t.match(e);return n?n[1]:null}class x extends y{constructor(t,{location:e=g.location,threshold:n=g.threshold,distance:s=g.distance,includeMatches:i=g.includeMatches,findAllMatches:r=g.findAllMatches,minMatchCharLength:u=g.minMatchCharLength,isCaseSensitive:c=g.isCaseSensitive,ignoreDiacritics:o=g.ignoreDiacritics,ignoreLocation:h=g.ignoreLocation}={}){super(t),this._bitapSearch=new D(t,{location:e,threshold:n,distance:s,includeMatches:i,findAllMatches:r,minMatchCharLength:u,isCaseSensitive:c,ignoreDiacritics:o,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class L extends y{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e,n=0;const s=[],i=this.pattern.length;for(;(e=t.indexOf(this.pattern,n))>-1;)n=e+i,s.push([e,n-1]);const r=!!s.length;return{isMatch:r,score:r?0:1,indices:s}}}const k=[class extends y{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},L,class extends y{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},class extends y{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends y{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends y{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},class extends y{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const e=-1===t.indexOf(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},x],_=k.length,v=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;const S=new Set([x.type,L.type]);class I{constructor(t,{isCaseSensitive:e=g.isCaseSensitive,ignoreDiacritics:n=g.ignoreDiacritics,includeMatches:s=g.includeMatches,minMatchCharLength:i=g.minMatchCharLength,ignoreLocation:r=g.ignoreLocation,findAllMatches:u=g.findAllMatches,location:c=g.location,threshold:o=g.threshold,distance:h=g.distance}={}){this.query=null,this.options={isCaseSensitive:e,ignoreDiacritics:n,includeMatches:s,minMatchCharLength:i,findAllMatches:u,ignoreLocation:r,location:c,threshold:o,distance:h},t=e?t:t.toLowerCase(),t=n?E(t):t,this.pattern=t,this.query=function(t,e={}){return t.split("|").map(t=>{let n=t.trim().split(v).filter(t=>t&&!!t.trim()),s=[];for(let t=0,i=n.length;t<i;t+=1){const i=n[t];let r=!1,u=-1;for(;!r&&++u<_;){const t=k[u];let n=t.isMultiMatch(i);n&&(s.push(new t(n,e)),r=!0)}if(!r)for(u=-1;++u<_;){const t=k[u];let n=t.isSingleMatch(i);if(n){s.push(new t(n,e));break}}}return s})}(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:s,ignoreDiacritics:i}=this.options;t=s?t:t.toLowerCase(),t=i?E(t):t;let r=0,u=[],c=0;for(let s=0,i=e.length;s<i;s+=1){const i=e[s];u.length=0,r=0;for(let e=0,s=i.length;e<s;e+=1){const s=i[e],{isMatch:o,indices:h,score:a}=s.search(t);if(!o){c=0,r=0,u.length=0;break}if(r+=1,c+=a,n){const t=s.constructor.type;S.has(t)?u=[...u,...h]:u.push(h)}}if(r){let t={isMatch:!0,score:c/r};return n&&(t.indices=u),t}}return{isMatch:!1,score:1}}}const w=[];function $(t,e){for(let n=0,s=w.length;n<s;n+=1){let s=w[n];if(s.condition(t,e))return new s(t,e)}return new D(t,e)}const b="$and",N="$or",R="$path",O="$val",j=t=>!(!t[b]&&!t[N]),W=t=>({[b]:Object.keys(t).map(e=>({[e]:t[e]}))});function z(n,s,{auto:r=!0}={}){const u=n=>{let c=Object.keys(n);const o=(t=>!!t[R])(n);if(!o&&c.length>1&&!j(n))return u(W(n));if((e=>!t(e)&&i(e)&&!j(e))(n)){const t=o?n[R]:c[0],i=o?n[O]:n[t];if(!e(i))throw new Error((t=>`Invalid value for key ${t}`)(t));const u={keyId:d(t),pattern:i};return r&&(u.searcher=$(i,s)),u}let h={children:[],operator:c[0]};return c.forEach(e=>{const s=n[e];t(s)&&s.forEach(t=>{h.children.push(u(t))})}),h};return j(n)||(n=W(n)),u(n)}function K(t,e){const n=t.matches;e.matches=[],r(n)&&n.forEach(t=>{if(!r(t.indices)||!t.indices.length)return;const{indices:n,value:s}=t;let i={indices:n,value:s};t.key&&(i.key=t.key.src),t.idx>-1&&(i.refIndex=t.idx),e.matches.push(i)})}function P(t,e){e.score=t.score}class q{constructor(t,e={},n){this.options={...g,...e},this.options.useExtendedSearch,this._keyStore=new h(this.options.keys),this.setCollection(t,n)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof A))throw new Error("Incorrect 'index' type");this._myIndex=e||p(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){r(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const e=[];for(let n=0,s=this._docs.length;n<s;n+=1){const i=this._docs[n];t(i,n)&&(this.removeAt(n),n-=1,s-=1,e.push(i))}return e}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:s=-1}={}){const{includeMatches:i,includeScore:r,shouldSort:u,sortFn:c,ignoreFieldNorm:o}=this.options;let h=e(t)?e(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return function(t,{ignoreFieldNorm:e=g.ignoreFieldNorm}){t.forEach(t=>{let n=1;t.matches.forEach(({key:t,norm:s,score:i})=>{const r=t?t.weight:null;n*=Math.pow(0===i&&r?Number.EPSILON:i,(r||1)*(e?1:s))}),t.score=n})}(h,{ignoreFieldNorm:o}),u&&h.sort(c),n(s)&&s>-1&&(h=h.slice(0,s)),function(t,e,{includeMatches:n=g.includeMatches,includeScore:s=g.includeScore}={}){const i=[];return n&&i.push(K),s&&i.push(P),t.map(t=>{const{idx:n}=t,s={item:e[n],refIndex:n};return i.length&&i.forEach(e=>{e(t,s)}),s})}(h,this._docs,{includeMatches:i,includeScore:r})}_searchStringList(t){const e=$(t,this.options),{records:n}=this._myIndex,s=[];return n.forEach(({v:t,i:n,n:i})=>{if(!r(t))return;const{isMatch:u,score:c,indices:o}=e.searchIn(t);u&&s.push({item:t,idx:n,matches:[{score:c,value:t,norm:i,indices:o}]})}),s}_searchLogical(t){const e=z(t,this.options),n=(t,e,s)=>{if(!t.children){const{keyId:n,searcher:i}=t,r=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(e,n),searcher:i});return r&&r.length?[{idx:s,item:e,matches:r}]:[]}const i=[];for(let r=0,u=t.children.length;r<u;r+=1){const u=t.children[r],c=n(u,e,s);if(c.length)i.push(...c);else if(t.operator===b)return[]}return i},s=this._myIndex.records,i={},u=[];return s.forEach(({$:t,i:s})=>{if(r(t)){let r=n(e,t,s);r.length&&(i[s]||(i[s]={idx:s,item:t,matches:[]},u.push(i[s])),r.forEach(({matches:t})=>{i[s].matches.push(...t)}))}}),u}_searchObjectList(t){const e=$(t,this.options),{keys:n,records:s}=this._myIndex,i=[];return s.forEach(({$:t,i:s})=>{if(!r(t))return;let u=[];n.forEach((n,s)=>{u.push(...this._findMatches({key:n,value:t[s],searcher:e}))}),u.length&&i.push({idx:s,item:t,matches:u})}),i}_findMatches({key:e,value:n,searcher:s}){if(!r(n))return[];let i=[];if(t(n))n.forEach(({v:t,i:n,n:u})=>{if(!r(t))return;const{isMatch:c,score:o,indices:h}=s.searchIn(t);c&&i.push({score:o,key:e,value:t,idx:n,norm:u,indices:h})});else{const{v:t,n:r}=n,{isMatch:u,score:c,indices:o}=s.searchIn(t);u&&i.push({score:c,key:e,value:t,norm:r,indices:o})}return i}}q.version="7.1.0",q.createIndex=p,q.parseIndex=function(t,{getFn:e=g.getFn,fieldNormWeight:n=g.fieldNormWeight}={}){const{keys:s,records:i}=t,r=new A({getFn:e,fieldNormWeight:n});return r.setKeys(s),r.setIndexRecords(i),r},q.config=g,q.parseQuery=z,function(...t){w.push(...t)}(I);export{q as default};
@@ -1,7 +0,0 @@
1
- /**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.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";import{useState as t}from"react";import{Box as o,FormControlLabel as i,Checkbox as l}from"@mui/material";import{Sort as r,IRange as a}from"@sheetxl/sdk";import{B as s,p as c}from"./Cc7y1nMDr5J8jWx-.mjs";const d=({range:d,options:m,cell:p,onDone:h,...u})=>{const[v,C]=t(m??r.DefaultRangeOptions),O=s(e=>{let n=null;"Sort"===e&&(n={...m,options:v}),h?.(n)},[v,h,m]);return e(c,{title:"Sort",options:["Sort","Cancel"],onDone:O,...u,children:n(o,{sx:{display:"flex",flexDirection:"column"},children:[e(i,{control:e(l,{checked:!v.reverse,onChange:()=>C(e=>({...e,reverse:!e.reverse}))}),label:"Is Ascending",labelPlacement:"end"}),e(i,{control:e(l,{checked:v.hasHeader,onChange:()=>C(e=>({...e,hasHeader:!e.hasHeader}))}),label:"Has Header",labelPlacement:"end"}),e(i,{control:e(l,{checked:v.collatorOptions?.sensitivity===r.CaseSensitiveOptions.sensitivity,onChange:()=>C(e=>({...e,collatorOptions:v.collatorOptions?.sensitivity===r.CaseSensitiveOptions.sensitivity?r.CaseInsensitiveOptions:r.CaseSensitiveOptions}))}),label:"Case Sensitive",labelPlacement:"end"}),e(i,{control:e(l,{checked:v.orientation===a.Orientation.Row,onChange:()=>C(e=>{const n=e.orientation===a.Orientation.Row?a.Orientation.Column:a.Orientation.Row;return{...d.getDefaultSortCriteria(n,p).options,includeHidden:e.includeHidden,reverse:e.reverse,orientation:n}})}),label:"Row Sort",labelPlacement:"end"}),e(i,{control:e(l,{checked:v.includeHidden,onChange:()=>C(e=>({...e,includeHidden:!e.includeHidden}))}),label:"Include Hidden",labelPlacement:"end"})]})})};export{d as SortDialog,d as default};