From aca683dafcb5ba6ee9e8d777c7d78bcfc94cdafa Mon Sep 17 00:00:00 2001 From: SheetJS Date: Tue, 21 Nov 2023 02:51:15 -0500 Subject: [PATCH] fix --- docz/docusaurus.config.js | 2 ++ docz/static/dta/dta.min.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docz/docusaurus.config.js b/docz/docusaurus.config.js index 1deaac8..6054b81 100644 --- a/docz/docusaurus.config.js +++ b/docz/docusaurus.config.js @@ -238,6 +238,8 @@ const config = { { from: '/docs/installation/extendscript', to: '/docs/getting-started/installation/extendscript/' }, { from: '/docs/installation/deno', to: '/docs/getting-started/installation/deno/' }, { from: '/docs/installation/bun', to: '/docs/getting-started/installation/bun/' }, + /* misc */ + { from: '/demos/datagrid', to: '/docs/demos/grid/' }, ] }] ] diff --git a/docz/static/dta/dta.min.js b/docz/static/dta/dta.min.js index e7ffc1c..4330839 100644 --- a/docz/static/dta/dta.min.js +++ b/docz/static/dta/dta.min.js @@ -1,2 +1,2 @@ -var DTA=(()=>{var O=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var J=Object.prototype.hasOwnProperty;var j=r=>O(r,"__esModule",{value:!0});var q=(r,t)=>{for(var s in t)O(r,s,{get:t[s],enumerable:!0})},z=(r,t,s,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of K(t))!J.call(r,c)&&(s||c!=="default")&&O(r,c,{get:()=>t[c],enumerable:!(e=I(t,c))||e.enumerable});return r};var H=(r=>(t,s)=>r&&r.get(t)||(s=z(j({}),t,1),r&&r.set(t,s),s))(typeof WeakMap!="undefined"?new WeakMap:0);var re={};q(re,{parse:()=>te,set_utils:()=>Q});var x;function Q(r){x=r}function W(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function i(r,t){return r.str.slice(r.ptr,r.ptr+t.length)!=t?!1:(r.ptr+=t.length,!0)}function X(r,t){let s=r.str.indexOf(t,r.ptr);if(s==-1)throw new Error(`Expected ${t} after offset ${r.ptr}`);r.ptr=s+t.length}function u(r,t){let s=r.str.indexOf(t,r.ptr);if(s==-1)throw new Error(`Expected ${t} after offset ${r.ptr}`);let e=r.raw.slice(r.ptr,s),c={ptr:0,raw:e,str:r.str.slice(r.ptr,s),dv:W(e)};return r.ptr=s+t.length,c}function L(r,t){r.ptr+=8;let s=r.dv.getFloat64(r.ptr-8,t);return s>8988e304?null:s}function R(r,t){r.ptr+=4;let s=r.dv.getFloat32(r.ptr-4,t);return s>1701e35?null:s}function _(r,t){return r.ptr+=4,r.dv.getUint32(r.ptr-4,t)}function V(r,t){r.ptr+=4;let s=r.dv.getInt32(r.ptr-4,t);return s>2147483620?null:s}function P(r,t){return r.ptr+=2,r.dv.getUint16(r.ptr-2,t)}function C(r,t){r.ptr+=2;let s=r.dv.getInt16(r.ptr-2,t);return s>32740?null:s}function $(r){return r.raw[r.ptr++]}function G(r){let t=r.raw[r.ptr++];return t=t<128?t:t-256,t>100?null:t}var Y=["117","118","119","120","121"];function Z(r){let t="Not a DTA file",s=new TextDecoder("latin1").decode(r),e={ptr:0,raw:r,str:s,dv:W(r)},c=118,n=!0,g=0,U=0,D=0,S=0,M="",A="",T=[],f=[],w=[];if(!i(e,""))throw t;{if(!i(e,"
"))throw t;{if(!i(e,""))throw t;let o=u(e,"");if(Y.indexOf(o.str)==-1)throw`Unsupported DTA ${o.str} file`;c=+o.str}{if(!i(e,""))throw t;let o=u(e,"");switch(o.str){case"MSF":n=!1;break;case"LSF":n=!0;break;default:throw`Unsupported byteorder ${o.str}`}}{if(!i(e,""))throw t;let o=u(e,"");g=P(o,n)}{if(!i(e,""))throw t;let o=u(e,"");if(c==117)U=D=_(o,n);else{let a=_(o,n),l=_(o,n);U=n?(D=a)+(S=l)*Math.pow(2,32):(D=l)+(S=a)*Math.pow(2,32)}U>1e6&&console.error("More than 1 million observations -- extra rows will be dropped")}{if(!i(e,""),a=c>=118?2:1,l=a==1?$(o):P(o,n);if(l+a!=o.str.length)throw`Expected string length ${l} but actual length was ${o.str.length-a}`;l>0&&(M=new TextDecoder().decode(o.raw.slice(a)))}{if(!i(e,""))throw t;let o=u(e,""),a=$(o);if(a+1!=o.str.length)throw`Expected string length ${a} but actual length was ${o.str.length-1}`;a>0&&(A=o.str.slice(1))}if(!i(e,"
"))throw t}{if(!i(e,""))throw t;X(e,"")}let d=0;{if(!i(e,""))throw t;let o=u(e,"");if(o.raw.length!=2*g)throw`Expected variable_types length ${g*2}, found ${o.raw.length}`;for(;o.ptr=1&&a<=2045)d+=a;else switch(a){case 32768:d+=8;break;case 65525:d+=0;break;case 65526:d+=8;break;case 65527:d+=4;break;case 65528:d+=4;break;case 65529:d+=2;break;case 65530:d+=1;break;default:throw`Unsupported field type ${a}`}}}{if(!i(e,""))throw t;let o=u(e,""),a=c>=118?129:33;if(o.raw.length!=a*g)throw`Expected variable_types length ${g*a}, found ${o.raw.length}`;for(;o.ptr"))throw t;let o=u(e,"");if(o.raw.length!=(2*g+2)*(c==119||c==121?2:1))throw`Expected sortlist length ${g*2+2}, found ${o.raw.length}`}{if(!i(e,""))throw t;let o=u(e,""),a=c>=118?57:49;if(o.raw.length!=a*g)throw`Expected formats length ${g*a}, found ${o.raw.length}`;for(;o.ptr"))throw t;let o=c>=118?129:33,a=u(e,"")}{if(!i(e,""))throw t;let o=c>=118?321:81,a=u(e,"")}{if(!i(e,""))throw t;for(;e.str.slice(e.ptr,e.ptr+4)=="";){e.ptr+=4;let o=_(e,n);if(e.ptr+=o,!i(e,""))throw t}if(!i(e,""))throw t}let p=x.aoa_to_sheet([f],{dense:!0});var k=[];{if(!i(e,""))throw t;for(let o=0;o=1&&b<=2045){let h=new TextDecoder().decode(e.raw.slice(e.ptr,e.ptr+b));h=h.replace(/\x00[\s\S]*/,""),a[l]=h,e.ptr+=b}else switch(b){case 65525:e.ptr+=0;break;case 65526:a[l]=L(e,n);break;case 65527:a[l]=R(e,n);break;case 65528:a[l]=V(e,n);break;case 65529:a[l]=C(e,n);break;case 65530:a[l]=G(e);break;case 32768:a[l]="##SheetJStrL##",k.push([o+1,l,e.raw.slice(e.ptr,e.ptr+8)]),e.ptr+=8;break;default:throw`Unsupported field type ${b} for ${f[l]}`}}x.sheet_add_aoa(p,[a],{origin:-1,sheetStubs:!0})}if(!i(e,""))throw t}{if(!i(e,""))throw t;let o=[];for(;e.raw[e.ptr]==71;){if(!i(e,"GSO"))throw t;let a=_(e,n),l=0;if(c==117)l=_(e,n);else{let v=_(e,n),m=_(e,n);l=n?v+m*Math.pow(2,32):m+v*Math.pow(2,32),l>1e6&&console.error("More than 1 million observations -- data will be dropped")}let b=$(e),h=_(e,n);o[l]||(o[l]=[]);let y="";b==129?(y=new TextDecoder("latin1").decode(e.raw.slice(e.ptr,e.ptr+h)),e.ptr+=h):(y=new TextDecoder("latin1").decode(e.raw.slice(e.ptr,e.ptr+h)).replace(/\x00$/,""),e.ptr+=h),o[l][a]=y}if(!i(e,""))throw t;k.forEach(([a,l,b])=>{let h=W(b),y=0,v=0;switch(c){case 117:y=h.getUint32(0,n),v=h.getUint32(4,n);break;case 118:case 120:{y=h.getUint16(0,n);let m=h.getUint16(2,n),E=h.getUint32(4,n);v=n?m+E*65536:E+m*2**32}break;case 119:case 121:{let m=h.getUint16(0,n),E=b[2];y=n?m+(E<<16):E+(m<<8);let N=b[3],B=h.getUint32(4,n);v=n?N+B*256:B+N*2**32}}p["!data"][a][l].v=o[v][y]})}{if(!i(e,""))throw t;let o=u(e,"")}if(!i(e,"
"))throw t;let F=x.book_new();return x.book_append_sheet(F,p,"Sheet1"),F}function ee(r){let t=r[0];switch(t){case 102:case 103:case 104:case 105:case 108:case 110:case 111:case 112:case 113:case 114:case 115:break;default:throw new Error("Not a DTA file")}let s={ptr:1,raw:r,str:"",dv:W(r)},e=!0,c=0,n=0,g="",U="",D=[],S=[],M=[];{let f=$(s);switch(f){case 1:e=!1;break;case 2:e=!0;break;default:throw`DTA ${t} Unexpected byteorder ${f}`}let w=$(s);if(w!=1)throw`DTA ${t} Unexpected filetype ${w}`;s.ptr++,c=P(s,e),n=_(s,e),s.ptr+=t>=108?81:t>=103?32:30,t>=105&&(s.ptr+=18)}{let f=0;for(f=0;f=110?33:9;for(f=0;f=114?49:t>=105?12:7;for(f=0;f=110?33:9)*c}if(s.ptr+=(t>=106?81:32)*c,t>=105)for(;s.ptr=111?_:P)(s,e);if(f==0&&w==0)break;s.ptr+=w}let A=x.aoa_to_sheet([S],{dense:!0});for(let f=0;f=111&&p>=1&&p<=244){let k=new TextDecoder().decode(s.raw.slice(s.ptr,s.ptr+p));k=k.replace(/\x00[\s\S]*/,""),w[d]=k,s.ptr+=p}else if(t<=110&&p>=128){let k=new TextDecoder().decode(s.raw.slice(s.ptr,s.ptr+p-127));k=k.replace(/\x00[\s\S]*/,""),w[d]=k,s.ptr+=p-127}else switch(p){case 251:case 98:w[d]=G(s);break;case 252:case 105:w[d]=C(s,e);break;case 253:case 108:w[d]=V(s,e);break;case 254:case 102:w[d]=R(s,e);break;case 255:case 100:w[d]=L(s,e);break;default:throw`Unsupported field type ${p} for ${S[d]}`}}x.sheet_add_aoa(A,[w],{origin:-1,sheetStubs:!0})}let T=x.book_new();return x.book_append_sheet(T,A,"Sheet1"),T}function te(r){if(r[0]>=102&&r[0]<=115)return ee(r);if(r[0]===60)return Z(r);throw new Error("Not a DTA file")}return H(re);})(); +var DTA=(()=>{var N=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var z=r=>N(r,"__esModule",{value:!0});var H=(r,t)=>{for(var e in t)N(r,e,{get:t[e],enumerable:!0})},Q=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Y(t))!q.call(r,o)&&(e||o!=="default")&&N(r,o,{get:()=>t[o],enumerable:!(s=J(t,o))||s.enumerable});return r};var X=(r=>(t,e)=>r&&r.get(t)||(e=Q(z({}),t,1),r&&r.set(t,e),e))(typeof WeakMap!="undefined"?new WeakMap:0);var se={};H(se,{parse:()=>ae,set_utils:()=>Z});var $;function Z(r){$=r}function U(r){return new TextDecoder().decode(r)}function P(r){return new TextDecoder("latin1").decode(r)}function L(r,t,e){if(r<0){let b=L(-r,t,e);return b.w="-"+b.w,b}let s={t:"n",v:r};switch(e){case 251:case 98:case 65530:t="%8.0g";break;case 252:case 105:case 65529:t="%8.0g";break;case 253:case 108:case 65528:t="%12.0g";break;case 254:case 102:case 65527:t="%9.0g";break;case 255:case 100:case 65526:t="%10.0g";break;default:throw e}try{let b=+(t.match(/%(\d+)/)||[])[1]||8,v=0;r<1&&++v,r<.1&&++v,r<.01&&++v,r<.001&&++v;let D=r.toExponential(),E=D.indexOf("e")==-1?0:+D.slice(D.indexOf("e")+1),g=b-2-E;g<0&&(g=0);var o=t.match(/%\d+\.(\d+)/);o&&+o[1]&&(g=+o[1]),s.w=(Math.round(r*10**g)/10**g).toFixed(g).replace(/^([-]?)0\./,"$1."),s.w=s.w.slice(0,b+v),s.w.indexOf(".")>-1&&(s.w=s.w.replace(/0+$/,"")),s.w=s.w.replace(/\.$/,""),s.w==""&&(s.w="0")}catch{}return s}function B(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function n(r,t){return U(r.raw.slice(r.ptr,r.ptr+t.length))!=t?!1:(r.ptr+=t.length,!0)}function V(r,t){r.ptr+=8;let e=r.dv.getFloat64(r.ptr-8,t);return e>8988e304?null:e}function G(r,t){r.ptr+=4;let e=r.dv.getFloat32(r.ptr-4,t);return e>1701e35?null:e}function h(r,t){return r.ptr+=4,r.dv.getUint32(r.ptr-4,t)}function I(r,t){r.ptr+=4;let e=r.dv.getInt32(r.ptr-4,t);return e>2147483620?null:e}function F(r,t){return r.ptr+=2,r.dv.getUint16(r.ptr-2,t)}function j(r,t){r.ptr+=2;let e=r.dv.getInt16(r.ptr-2,t);return e>32740?null:e}function T(r){return r.raw[r.ptr++]}function K(r){let t=r.raw[r.ptr++];return t=t<128?t:t-256,t>100?null:t}var ee=["117","118","119","120","121"],te=[102,103,104,105,108,110,111,112,113,114,115];function re(r){let t="Not a DTA file",e={ptr:0,raw:r,dv:B(r)},s=118,o=!0,b=0,v=0,D=0,E=0,g="",C="",M=[],O=[],W=[];if(!n(e,""))throw t;{if(!n(e,"
"))throw t;{if(!n(e,""))throw t;let a=P(e.raw.slice(e.ptr,e.ptr+3));if(e.ptr+=3,!n(e,""))throw t;if(ee.indexOf(a)==-1)throw`Unsupported DTA ${a} file`;s=+a}{if(!n(e,""))throw t;let a=P(e.raw.slice(e.ptr,e.ptr+3));if(e.ptr+=3,!n(e,""))throw t;switch(a){case"MSF":o=!1;break;case"LSF":o=!0;break;default:throw`Unsupported byteorder ${a}`}}if(!n(e,"")||(b=s===119||s>=121?h(e,o):F(e,o),!n(e,"")))throw t;{if(!n(e,""))throw t;if(s==117)v=D=h(e,o);else{let a=h(e,o),l=h(e,o);v=o?(D=a)+(E=l)*Math.pow(2,32):(D=l)+(E=a)*Math.pow(2,32)}if(v>1e6&&console.error("More than 1 million observations -- extra rows will be dropped"),!n(e,""))throw t}{if(!n(e,""))throw t}{if(!n(e,""))throw t;let a=T(e);if(C=P(e.raw.slice(e.ptr,e.ptr+a)),e.ptr+=a,!n(e,""))throw t}if(!n(e,"
"))throw t}if(!n(e,"")||(e.ptr+=8*14,!n(e,"")))throw t;let f=0;{if(!n(e,""))throw t;for(var w=0;w=1&&a<=2045)f+=a;else switch(a){case 32768:f+=8;break;case 65525:f+=0;break;case 65526:f+=8;break;case 65527:f+=4;break;case 65528:f+=4;break;case 65529:f+=2;break;case 65530:f+=1;break;default:throw`Unsupported field type ${a}`}}if(!n(e,""))throw t}{if(!n(e,""))throw t;let a=s>=118?129:33;for(let l=0;l"))throw t}if(!n(e,"")||(e.ptr+=(2*b+2)*(s==119||s==121?2:1),!n(e,"")))throw t;{if(!n(e,""))throw t;let a=s>=118?57:49;for(let l=0;l"))throw t}let p=[];{if(!n(e,""))throw t;let a=s>=118?129:33;for(let l=0;l"))throw t}{if(!n(e,""))throw t;let a=s>=118?321:81;if(e.ptr+=a*b,!n(e,""))throw t}{if(!n(e,""))throw t;for(;n(e,"");){let a=h(e,o);if(e.ptr+=a,!n(e,""))throw t}if(!n(e,""))throw t}let u=$.aoa_to_sheet([O],{dense:!0});var _=[];{if(!n(e,""))throw t;for(let a=0;a=1&&d<=2045){let c=U(e.raw.slice(e.ptr,e.ptr+d));c=c.replace(/\x00[\s\S]*/,""),l[i]=c,e.ptr+=d}else switch(d){case 65525:e.ptr+=0;break;case 65530:l[i]=K(e);break;case 65529:l[i]=j(e,o);break;case 65528:l[i]=I(e,o);break;case 65527:l[i]=G(e,o);break;case 65526:l[i]=V(e,o);break;case 32768:l[i]="##SheetJStrL##",_.push([a+1,i,e.raw.slice(e.ptr,e.ptr+8)]),e.ptr+=8;break;default:throw`Unsupported field type ${d} for ${O[i]}`}typeof l[i]=="number"&&W[i]&&(l[i]=L(l[i],W[i],d))}$.sheet_add_aoa(u,[l],{origin:-1,sheetStubs:!0})}if(!n(e,""))throw t}{if(!n(e,""))throw t;let a=[];for(;e.raw[e.ptr]==71;){if(!n(e,"GSO"))throw t;let l=h(e,o),i=0;if(s==117)i=h(e,o);else{let k=h(e,o),y=h(e,o);i=o?k+y*Math.pow(2,32):y+k*Math.pow(2,32),i>1e6&&console.error("More than 1 million observations -- data will be dropped")}let d=T(e),c=h(e,o);a[i]||(a[i]=[]);let x="";d==129?(x=new TextDecoder(s>=118?"utf8":"latin1").decode(e.raw.slice(e.ptr,e.ptr+c)),e.ptr+=c):(x=new TextDecoder(s>=118?"utf8":"latin1").decode(e.raw.slice(e.ptr,e.ptr+c)).replace(/\x00$/,""),e.ptr+=c),a[i][l]=x}if(!n(e,""))throw t;_.forEach(([l,i,d])=>{let c=B(d),x=0,k=0;switch(s){case 117:x=c.getUint32(0,o),k=c.getUint32(4,o);break;case 118:case 120:{x=c.getUint16(0,o);let y=c.getUint16(2,o),A=c.getUint32(4,o);k=o?y+A*65536:A+y*2**32}break;case 119:case 121:{let y=c.getUint16(0,o),A=d[2];x=o?y+(A<<16):A+(y<<8);let R=d[3],m=c.getUint32(4,o);k=o?R+m*256:m+R*2**32}}u["!data"][l][i].v=a[k][x]})}{let a=s>=118?129:33;if(!n(e,""))throw t;for(;n(e,"");){let l=h(e,o),i=P(e.raw.slice(e.ptr,e.ptr+a)).replace(/\x00.*$/,"");e.ptr+=a,e.ptr+=3;let d=[];{let x=h(e,o),k=h(e,o),y=[],A=[];for(let m=0;m"))throw t}if(!n(e,""))throw t}if(!n(e,"
"))throw t;let S=$.book_new();return $.book_append_sheet(S,u,"Sheet1"),S}function oe(r){let t=r[0];if(te.indexOf(t)==-1)throw new Error("Not a DTA file");let e={ptr:1,raw:r,dv:B(r)},s=!0,o=0,b=0,v="",D="",E=[],g=[],C=[];{let f=T(e);switch(f){case 1:s=!1;break;case 2:s=!0;break;default:throw`DTA ${t} Unexpected byteorder ${f}`}let w=T(e);if(w!=1)throw`DTA ${t} Unexpected filetype ${w}`;e.ptr++,o=F(e,s),b=h(e,s),e.ptr+=t>=108?81:t>=103?32:30,t>=105&&(e.ptr+=18)}let M=[];{let f=0;for(f=0;f=110?33:9;for(f=0;f=114?49:t>=105?12:7;for(f=0;f=110?33:9;for(let _=0;_=106?81:32)*o,t>=105)for(;e.ptr=110?h:F)(e,s);if(f==0&&w==0)break;e.ptr+=w}let O=$.aoa_to_sheet([g],{dense:!0});for(let f=0;f=113)&&u>=1&&u<=244){let _=U(e.raw.slice(e.ptr,e.ptr+u));_=_.replace(/\x00[\s\S]*/,""),w[p]=_,e.ptr+=u}else if((t==112||t<=110)&&u>=128){let _=U(e.raw.slice(e.ptr,e.ptr+u-127));_=_.replace(/\x00[\s\S]*/,""),w[p]=_,e.ptr+=u-127}else switch(u){case 251:case 98:w[p]=K(e);break;case 252:case 105:w[p]=j(e,s);break;case 253:case 108:w[p]=I(e,s);break;case 254:case 102:w[p]=G(e,s);break;case 255:case 100:w[p]=V(e,s);break;default:throw`Unsupported field type ${u} for ${g[p]}`}typeof w[p]=="number"&&C[p]&&(w[p]=L(w[p],C[p],u))}$.sheet_add_aoa(O,[w],{origin:-1,sheetStubs:!0})}if(t>=115)for(;e.ptr=102&&r[0]<=115)return oe(r);if(r[0]===60)return re(r);throw new Error("Not a DTA file")}return X(se);})(); //# sourceMappingURL=dta.min.js.map