@justybase/spreadsheet-tasks 3.0.0 → 3.1.0
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/CHANGELOG.md +26 -0
- package/README.md +11 -0
- package/browser/browser-spreadsheet.js +35 -20
- package/browser/justybase-spreadsheet.min.js +11 -11
- package/dist/cjs/index.d.ts +28 -3
- package/dist/cjs/index.js +89 -40
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +87 -40
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [3.1.0] - 2026-10-24
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- XLSX output omits the `r` attribute on cells that directly follow the previous
|
|
15
|
+
cell (`<c><v>1</v></c>`). A cell keeps `r` after a gap, at the start of a row that
|
|
16
|
+
does not begin in column A, and in the header row only when needed. Excel and the
|
|
17
|
+
readers in this package resolve the position from the order of cells.
|
|
18
|
+
- XLSX and XLSB writers accept `{ compressionLevel }` (integer 0–9, default 6). The
|
|
19
|
+
archiver default was level 1, which compresses less.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- Raw CRLF and lone CR in XML text (shared strings, inline strings, `str` cells) are
|
|
24
|
+
normalized to LF on read, as XML 1.0 requires. ` ` still reads as CR.
|
|
25
|
+
- `escapeXmlText` writes CR as ` `, so a CR written by the library survives a
|
|
26
|
+
round trip instead of being normalized away. The XLSX writer now does the same in
|
|
27
|
+
shared strings, where a raw CR was previously written and read back as LF by Excel.
|
|
28
|
+
- Text containing `_xHHHH_` is escaped as `_x005F_xHHHH_` when written, and
|
|
29
|
+
`_xHHHH_` written by Excel (for example `_x000D_`) is decoded on read (ECMA-376
|
|
30
|
+
ST_Xstring). Attribute values are not affected.
|
|
31
|
+
- `XlsxUpdater` infers the column of a cell without `r` when it reads existing styles,
|
|
32
|
+
so style inheritance works for files produced by this library and by xlspy.
|
|
33
|
+
|
|
34
|
+
## [3.0.0] - 2026-10-23
|
|
35
|
+
|
|
10
36
|
### Breaking
|
|
11
37
|
|
|
12
38
|
- `XlsxReader` / `XlsbReader` now return an empty row (`[]`, `getValue()` → `null`)
|
package/README.md
CHANGED
|
@@ -179,6 +179,17 @@ await writer.finalize();
|
|
|
179
179
|
- Generate data on-the-fly from databases, APIs, or other sources
|
|
180
180
|
- Same performance as batch mode
|
|
181
181
|
|
|
182
|
+
### Compression Level
|
|
183
|
+
|
|
184
|
+
XLSX and XLSB writers compress the package with zlib. The default is level 6; pass a
|
|
185
|
+
level from 0 (store) to 9 (smallest, slowest) to trade size for speed:
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
const writer = new XlsxWriter('fast.xlsx', { compressionLevel: 1 });
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Out-of-range values throw a `RangeError`.
|
|
192
|
+
|
|
182
193
|
### Reading Excel Files
|
|
183
194
|
|
|
184
195
|
```typescript
|
|
@@ -399,6 +399,9 @@ function assertRowCount(totalRows) {
|
|
|
399
399
|
);
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
|
+
function cellRefAttr(col, prevCol, colRef, rowNum) {
|
|
403
|
+
return col === prevCol + 1 ? "" : ` r="${colRef}${rowNum}"`;
|
|
404
|
+
}
|
|
402
405
|
|
|
403
406
|
// src/browser/BrowserXlsxWriter.ts
|
|
404
407
|
var BrowserXlsxWriter = class {
|
|
@@ -438,16 +441,17 @@ var BrowserXlsxWriter = class {
|
|
|
438
441
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
439
442
|
}
|
|
440
443
|
_esc(s) {
|
|
444
|
+
s = s.replace(/_x([0-9A-Fa-f]{4})_/g, "_x005F_x$1_");
|
|
441
445
|
let need = false;
|
|
442
446
|
for (let i = 0; i < s.length; i++) {
|
|
443
447
|
const c = s.charCodeAt(i);
|
|
444
|
-
if (c === 38 || c === 60 || c === 62 || c === 34 || c === 39 || c >= 0 && c <= 8 || c === 11 || c === 12 || c >= 14 && c <= 31) {
|
|
448
|
+
if (c === 38 || c === 60 || c === 62 || c === 34 || c === 39 || c === 13 || c >= 0 && c <= 8 || c === 11 || c === 12 || c >= 14 && c <= 31) {
|
|
445
449
|
need = true;
|
|
446
450
|
break;
|
|
447
451
|
}
|
|
448
452
|
}
|
|
449
453
|
if (!need) return s;
|
|
450
|
-
const escaped = s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
454
|
+
const escaped = s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\r/g, " ");
|
|
451
455
|
let out = "";
|
|
452
456
|
for (let i = 0; i < escaped.length; i++) {
|
|
453
457
|
const c = escaped.charCodeAt(i);
|
|
@@ -464,7 +468,8 @@ var BrowserXlsxWriter = class {
|
|
|
464
468
|
this._sc++;
|
|
465
469
|
this._sl.push({ name: sn, path: `xl/worksheets/sheet${this._sc}.xml`, hidden, fn: `sheet${this._sc}.xml`, id: this._sc, rId: `rId${this._sc}`, fhr: null });
|
|
466
470
|
}
|
|
467
|
-
|
|
471
|
+
/** `ref` is the cell's `r` attribute from `cellRefAttr`, or '' when omitted. */
|
|
472
|
+
_wsc(bb, val, ref, so) {
|
|
468
473
|
assertCellTextLength(val);
|
|
469
474
|
let idx = this._sstM.get(val);
|
|
470
475
|
if (idx === void 0) {
|
|
@@ -474,9 +479,9 @@ var BrowserXlsxWriter = class {
|
|
|
474
479
|
}
|
|
475
480
|
this._sstCnt++;
|
|
476
481
|
const sa = so !== void 0 ? ` s="${so}"` : "";
|
|
477
|
-
bb.writeString(`<c
|
|
482
|
+
bb.writeString(`<c${ref} t="s"${sa}><v>${idx}</v></c>`);
|
|
478
483
|
}
|
|
479
|
-
_wscStyle(bb, val,
|
|
484
|
+
_wscStyle(bb, val, ref, styleId) {
|
|
480
485
|
assertCellTextLength(val);
|
|
481
486
|
let idx = this._sstM.get(val);
|
|
482
487
|
if (idx === void 0) {
|
|
@@ -485,7 +490,7 @@ var BrowserXlsxWriter = class {
|
|
|
485
490
|
this._sstM.set(val, idx);
|
|
486
491
|
}
|
|
487
492
|
this._sstCnt++;
|
|
488
|
-
bb.writeString(`<c
|
|
493
|
+
bb.writeString(`<c${ref} t="s" s="${styleId}"><v>${idx}</v></c>`);
|
|
489
494
|
}
|
|
490
495
|
_oa(d) {
|
|
491
496
|
return timeToOaDate(d.getTime(), this._oaE);
|
|
@@ -499,23 +504,31 @@ var BrowserXlsxWriter = class {
|
|
|
499
504
|
this._fmtXf.set(fs, xf);
|
|
500
505
|
return xf;
|
|
501
506
|
}
|
|
502
|
-
|
|
503
|
-
|
|
507
|
+
/**
|
|
508
|
+
* Write one cell of row `rn` at column `c` (letter `cr`). Returns the column
|
|
509
|
+
* of the last cell written, which the caller passes as `prevCol` for the next
|
|
510
|
+
* cell; a null cell writes nothing and leaves `prevCol` unchanged.
|
|
511
|
+
*/
|
|
512
|
+
_wcv(bb, raw, c, cr, rn, prevCol) {
|
|
513
|
+
if (raw === null || raw === void 0) return prevCol;
|
|
504
514
|
const fs = getFormat(raw);
|
|
505
515
|
const v = unwrapCell(raw);
|
|
506
516
|
const xf = fs !== null ? this._regFmt(fs) : -1;
|
|
507
517
|
const sa = xf >= 0 ? ` s="${xf}"` : "";
|
|
508
|
-
if (v === null || v === void 0) return;
|
|
518
|
+
if (v === null || v === void 0) return prevCol;
|
|
519
|
+
const ref = cellRefAttr(c, prevCol, cr, rn);
|
|
520
|
+
const so = xf >= 0 ? xf : void 0;
|
|
509
521
|
if (typeof v === "number") {
|
|
510
|
-
if (Number.isFinite(v)) bb.writeString(`<c
|
|
511
|
-
else this._wsc(bb, v.toString(),
|
|
512
|
-
} else if (typeof v === "bigint") this._wsc(bb, v.toString(),
|
|
513
|
-
else if (typeof v === "boolean") bb.writeString(`<c
|
|
522
|
+
if (Number.isFinite(v)) bb.writeString(`<c${ref}${sa}><v>${v}</v></c>`);
|
|
523
|
+
else this._wsc(bb, v.toString(), ref, so);
|
|
524
|
+
} else if (typeof v === "bigint") this._wsc(bb, v.toString(), ref, so);
|
|
525
|
+
else if (typeof v === "boolean") bb.writeString(`<c${ref} t="b"${sa}><v>${v ? 1 : 0}</v></c>`);
|
|
514
526
|
else if (v instanceof Date) {
|
|
515
527
|
const o = this._oa(v);
|
|
516
|
-
if (Number.isFinite(o)) bb.writeString(`<c
|
|
517
|
-
else this._wsc(bb, v.toString(),
|
|
518
|
-
} else this._wsc(bb, v.toString(),
|
|
528
|
+
if (Number.isFinite(o)) bb.writeString(`<c${ref} s="${xf >= 0 ? xf : 1}"><v>${o}</v></c>`);
|
|
529
|
+
else this._wsc(bb, v.toString(), ref, so);
|
|
530
|
+
} else this._wsc(bb, v.toString(), ref, so);
|
|
531
|
+
return c;
|
|
519
532
|
}
|
|
520
533
|
_sheetHead(bb, cc, isFirst, hasAF) {
|
|
521
534
|
bb.writeString('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');
|
|
@@ -562,7 +575,7 @@ var BrowserXlsxWriter = class {
|
|
|
562
575
|
if (headers) {
|
|
563
576
|
this._csrn++;
|
|
564
577
|
csb.writeString(`<row r="${this._csrn}">`);
|
|
565
|
-
for (let c = 0; c < headers.length; c++) this._wscStyle(csb, headers[c],
|
|
578
|
+
for (let c = 0; c < headers.length; c++) this._wscStyle(csb, headers[c], "", hs);
|
|
566
579
|
csb.writeString("</row>");
|
|
567
580
|
}
|
|
568
581
|
}
|
|
@@ -573,7 +586,8 @@ var BrowserXlsxWriter = class {
|
|
|
573
586
|
this._csrn++;
|
|
574
587
|
assertRowCount(this._csrn);
|
|
575
588
|
csb.writeString(`<row r="${this._csrn}">`);
|
|
576
|
-
|
|
589
|
+
let prev = -1;
|
|
590
|
+
for (let c = 0; c < row.length; c++) prev = this._wcv(csb, row[c], c, this._csCL[c], this._csrn, prev);
|
|
577
591
|
csb.writeString("</row>");
|
|
578
592
|
}
|
|
579
593
|
endSheet() {
|
|
@@ -630,13 +644,14 @@ var BrowserXlsxWriter = class {
|
|
|
630
644
|
if (headers) {
|
|
631
645
|
rn++;
|
|
632
646
|
bb.writeString(`<row r="${rn}">`);
|
|
633
|
-
for (let c = 0; c < headers.length; c++) this._wscStyle(bb, headers[c],
|
|
647
|
+
for (let c = 0; c < headers.length; c++) this._wscStyle(bb, headers[c], "", hs);
|
|
634
648
|
bb.writeString("</row>");
|
|
635
649
|
}
|
|
636
650
|
for (let r = 0; r < rows.length; r++) {
|
|
637
651
|
rn++;
|
|
638
652
|
bb.writeString(`<row r="${rn}">`);
|
|
639
|
-
|
|
653
|
+
let prev = -1;
|
|
654
|
+
for (let c = 0; c < rows[r].length; c++) prev = this._wcv(bb, rows[r][c], c, cl[c], rn, prev);
|
|
640
655
|
bb.writeString("</row>");
|
|
641
656
|
}
|
|
642
657
|
bb.writeString("</sheetData>");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var JustybaseSpreadsheet=(()=>{var N=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var Y=Object.prototype.hasOwnProperty;var j=(h,t)=>{for(var e in t)N(h,e,{get:t[e],enumerable:!0})},G=(h,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let x of q(t))!Y.call(h,x)&&x!==e&&N(h,x,{get:()=>t[x],enumerable:!(r=Z(t,x))||r.enumerable});return h};var K=h=>G(N({},"__esModule",{value:!0}),h);var n0={};j(n0,{BrowserBigBuffer:()=>g,BrowserXlsbWriter:()=>E,BrowserXlsxWriter:()=>U,BrowserZip:()=>B,F:()=>O,downloadXlsb:()=>x0,downloadXlsbMultiSheet:()=>i0,downloadXlsx:()=>e0,downloadXlsxMultiSheet:()=>r0});var g=class{constructor(t=65536){this.chunkSize=t,this.chunks=[],this.currentBuffer=new Uint8Array(t),this.dataView=new DataView(this.currentBuffer.buffer),this.cursor=0,this._textEncoder=new TextEncoder}ensureCapacity(t){this.cursor+t>this.chunkSize&&this._flush()}_flush(){this.cursor>0&&(this.chunks.push(this.currentBuffer.slice(0,this.cursor)),this.currentBuffer=new Uint8Array(this.chunkSize),this.dataView=new DataView(this.currentBuffer.buffer),this.cursor=0)}write(t){let e=t.length,r=0;for(;e>0;){let x=this.chunkSize-this.cursor;x===0&&(this._flush(),x=this.chunkSize);let i=Math.min(e,x);this.currentBuffer.set(t.subarray(r,r+i),this.cursor),this.cursor+=i,r+=i,e-=i}}writeByte(t){this.ensureCapacity(1),this.currentBuffer[this.cursor]=t,this.cursor++}writeUnsafeByte(t){this.currentBuffer[this.cursor++]=t}writeInt32LE(t){this.ensureCapacity(4),this.dataView.setInt32(this.cursor,t,!0),this.cursor+=4}writeUnsafeInt32LE(t){this.dataView.setInt32(this.cursor,t,!0),this.cursor+=4}writeDoubleLE(t){this.ensureCapacity(8),this.dataView.setFloat64(this.cursor,t,!0),this.cursor+=8}writeUnsafeDoubleLE(t){this.dataView.setFloat64(this.cursor,t,!0),this.cursor+=8}writeString(t){let e=this._textEncoder.encode(t),r=e.length;if(this.cursor+r<=this.chunkSize){this.currentBuffer.set(e,this.cursor),this.cursor+=r;return}this._flush(),r>this.chunkSize?this.chunks.push(e):(this.currentBuffer.set(e,this.cursor),this.cursor+=r)}writeUtf16LE(t){let e=t.length*2;if(this.cursor+e<=this.chunkSize){for(let r=0;r<t.length;r++){let x=t.charCodeAt(r);this.currentBuffer[this.cursor++]=x&255,this.currentBuffer[this.cursor++]=x>>8&255}return}if(this._flush(),e>this.chunkSize){let r=new Uint8Array(e);for(let x=0;x<t.length;x++){let i=t.charCodeAt(x);r[x*2]=i&255,r[x*2+1]=i>>8&255}this.chunks.push(r)}else for(let r=0;r<t.length;r++){let x=t.charCodeAt(r);this.currentBuffer[this.cursor++]=x&255,this.currentBuffer[this.cursor++]=x>>8&255}}getChunks(){return this.cursor>0&&(this.chunks.push(this.currentBuffer.slice(0,this.cursor)),this.currentBuffer=new Uint8Array(this.chunkSize),this.dataView=new DataView(this.currentBuffer.buffer),this.cursor=0),this.chunks}toUint8Array(){let t=this.getChunks(),e=0;for(let i of t)e+=i.length;let r=new Uint8Array(e),x=0;for(let i of t)r.set(i,x),x+=i.length;return r}reset(){this.chunks=[],this.cursor=0}};var B=class h{constructor(){this.files=[];this.files=[]}static{this._crc32Table=null}addFile(t,e){let r;if(typeof e=="string")r=new TextEncoder().encode(e);else if(Array.isArray(e)){let x=0;for(let o of e)x+=o.length;r=new Uint8Array(x);let i=0;for(let o of e)r.set(o,i),i+=o.length}else r=e;this.files.push({name:t,data:r})}toBlob(){let t=[],e=[],r=0;for(let l of this.files){let u=new TextEncoder().encode(l.name),d=this._crc32(l.data),a=new Uint8Array(30+u.length),s=new DataView(a.buffer);s.setUint32(0,67324752,!0),s.setUint16(4,20,!0),s.setUint16(6,0,!0),s.setUint16(8,0,!0),s.setUint16(10,0,!0),s.setUint16(12,0,!0),s.setUint32(14,d,!0),s.setUint32(18,l.data.length,!0),s.setUint32(22,l.data.length,!0),s.setUint16(26,u.length,!0),s.setUint16(28,0,!0),a.set(u,30),t.push(a),t.push(l.data);let f=new Uint8Array(46+u.length),m=new DataView(f.buffer);m.setUint32(0,33639248,!0),m.setUint16(4,20,!0),m.setUint16(6,20,!0),m.setUint16(8,0,!0),m.setUint16(10,0,!0),m.setUint16(12,0,!0),m.setUint16(14,0,!0),m.setUint32(16,d,!0),m.setUint32(20,l.data.length,!0),m.setUint32(24,l.data.length,!0),m.setUint16(28,u.length,!0),m.setUint16(30,0,!0),m.setUint16(32,0,!0),m.setUint16(34,0,!0),m.setUint16(36,0,!0),m.setUint32(38,0,!0),m.setUint32(42,r,!0),f.set(u,46),e.push(f),r+=a.length+l.data.length}let x=r,i=0;for(let l of e)t.push(l),i+=l.length;let o=new Uint8Array(22),n=new DataView(o.buffer);return n.setUint32(0,101010256,!0),n.setUint16(4,0,!0),n.setUint16(6,0,!0),n.setUint16(8,this.files.length,!0),n.setUint16(10,this.files.length,!0),n.setUint32(12,i,!0),n.setUint32(16,x,!0),n.setUint16(20,0,!0),t.push(o),new Blob(t,{type:"application/octet-stream"})}_crc32(t){if(!h._crc32Table){h._crc32Table=new Uint32Array(256);for(let x=0;x<256;x++){let i=x;for(let o=0;o<8;o++)i=i&1?3988292384^i>>>1:i>>>1;h._crc32Table[x]=i}}let e=h._crc32Table,r=4294967295;for(let x=0;x<t.length;x++)r=e[(r^t[x])&255]^r>>>8;return(r^4294967295)>>>0}};var O={THOUSANDS_SEP:"#,##0",CURRENCY_PLN:'#,##0.00 "z\u0142"',CURRENCY_EUR:"#,##0.00 \u20AC",PERCENTAGE:"0%",SCIENTIFIC:"0.00E+00",TWO_DECIMALS:"#,##0.00",TEXT:"@",LEADING_ZEROS:"000000000",DATE_SHORT:"dd.mm.yyyy",DATE_LONG:"d mmmm yyyy",DATE_DAY_MONTH_YEAR:"dd-mm-yyyy",DATE_ISO:"yyyy-mm-dd",DATE_MONTH_YEAR:"mmmm yyyy",DATE_WEEKDAY:"dddd, d mmmm yyyy",DATE_DAY_MONTH:"d mmmm",DATE_YEAR_ONLY:"yyyy",DATETIME_SHORT:"dd.mm.yyyy hh:mm",DATETIME_LONG:"d mmmm yyyy hh:mm:ss",TIME_HH_MM:"hh:mm",TIME_HH_MM_SS:"hh:mm:ss",TIME_12H:"h:mm AM/PM",DATETIME_24H:"dd.mm.yyyy hh:mm:ss",DATETIME_ISO:'yyyy-mm-dd"T"hh:mm:ss',TIME_MS:"hh:mm:ss.000"};function C(h){return h!=null&&typeof h=="object"&&"format"in h&&typeof h.format=="string"}function R(h){return C(h)?h.value:h}function L(h){return C(h)?h.format:null}function H(h){let t=h+1,e="";for(;t>0;){let r=(t-1)%26;e=String.fromCharCode(65+r)+e,t=Math.floor((t-1)/26)}return e}var J=Date.UTC(1899,11,30),Q=Date.UTC(1900,2,1);function k(h,t){let e=(h-t)/864e5;return t===J&&h<Q&&(e-=1),e}var W=1048576,X=16384,P=32767;function y(h){if(h.length>P)throw new Error(`Excel cell text exceeds ${P} UTF-16 code units (got ${h.length}).`)}function b(h){if(!Number.isInteger(h)||h<1||h>X)throw new Error(`Excel column count must be 1..${X} (got ${h}).`)}function S(h,t,e){if(t>e)throw new Error(`Excel ${h} length ${t} exceeds columnCount ${e}.`)}function v(h){if(h>W)throw new Error(`Excel row count exceeds ${W} (got ${h}).`)}var U=class{constructor(){this._zip=new B,this._sc=0,this._sl=[],this._sstA=[],this._sstM=new Map,this._sstCnt=0,this._cw=[],this._afOn=!1,this._oaE=Date.UTC(1899,11,30),this._csb=null,this._csrn=0,this._csSC=0,this._csEC=0,this._csAF=!1,this._isS=!1,this._csCL=[],this._fmtReg=new Map,this._fmtXf=new Map,this._nextNfmt=165,this._nextXf=6}_cl(t){return H(t)}_san(t){if(!t||typeof t!="string")return`Sheet${this._sc+1}`;let e=t.replace(/[\\/*?[\]:]/g,"_");return e.length>31&&(e=e.substring(0,31)),e.trim()||(e=`Sheet${this._sc+1}`),e}_ex(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}_esc(t){let e=!1;for(let i=0;i<t.length;i++){let o=t.charCodeAt(i);if(o===38||o===60||o===62||o===34||o===39||o>=0&&o<=8||o===11||o===12||o>=14&&o<=31){e=!0;break}}if(!e)return t;let r=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),x="";for(let i=0;i<r.length;i++){let o=r.charCodeAt(i);o<=8||o===11||o===12||o>=14&&o<=31||(x+=r[i])}return x}_fmn(t){return/[\s\-+=()!@#$%^&]/.test(t)||/^[0-9]/.test(t)?`'${t.replace(/'/g,"''")}'`:t}addSheet(t,e=!1){let r=this._san(t);this._sc++,this._sl.push({name:r,path:`xl/worksheets/sheet${this._sc}.xml`,hidden:e,fn:`sheet${this._sc}.xml`,id:this._sc,rId:`rId${this._sc}`,fhr:null})}_wsc(t,e,r,x,i){y(e);let o=this._sstM.get(e);o===void 0&&(o=this._sstA.length,this._sstA.push(e),this._sstM.set(e,o)),this._sstCnt++;let n=i!==void 0?` s="${i}"`:"";t.writeString(`<c r="${r}${x}" t="s"${n}><v>${o}</v></c>`)}_wscStyle(t,e,r,x,i){y(e);let o=this._sstM.get(e);o===void 0&&(o=this._sstA.length,this._sstA.push(e),this._sstM.set(e,o)),this._sstCnt++,t.writeString(`<c r="${r}${x}" t="s" s="${i}"><v>${o}</v></c>`)}_oa(t){return k(t.getTime(),this._oaE)}_regFmt(t){let e=this._fmtXf.get(t);if(e!==void 0)return e;let r=this._nextNfmt++;this._fmtReg.set(t,r);let x=this._nextXf++;return this._fmtXf.set(t,x),x}_wcv(t,e,r,x){if(e==null)return;let i=L(e),o=R(e),n=i!==null?this._regFmt(i):-1,l=n>=0?` s="${n}"`:"";if(o!=null)if(typeof o=="number")Number.isFinite(o)?t.writeString(`<c r="${r}${x}"${l}><v>${o}</v></c>`):this._wsc(t,o.toString(),r,x,n>=0?n:void 0);else if(typeof o=="bigint")this._wsc(t,o.toString(),r,x,n>=0?n:void 0);else if(typeof o=="boolean")t.writeString(`<c r="${r}${x}" t="b"${l}><v>${o?1:0}</v></c>`);else if(o instanceof Date){let u=this._oa(o);Number.isFinite(u)?t.writeString(`<c r="${r}${x}" s="${n>=0?n:1}"><v>${u}</v></c>`):this._wsc(t,o.toString(),r,x,n>=0?n:void 0)}else this._wsc(t,o.toString(),r,x,n>=0?n:void 0)}_sheetHead(t,e,r,x){t.writeString('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'),t.writeString('<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">'),t.writeString('<dimension ref="A1"/>'),x?t.writeString(`<sheetViews><sheetView ${r?'tabSelected="1" ':""}workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/><selection pane="bottomLeft"/></sheetView></sheetViews><sheetFormatPr defaultRowHeight="15"/>`):t.writeString(`<sheetViews><sheetView ${r?'tabSelected="1" ':""}workbookViewId="0"/></sheetViews><sheetFormatPr defaultRowHeight="15"/>`),t.writeString("<cols>");for(let i=0;i<e;i++){let o=this._cw[i]>0?this._cw[i]:10;t.writeString(`<col min="${i+1}" max="${i+1}" width="${o}" bestFit="1" customWidth="1"/>`)}t.writeString("</cols><sheetData>")}startSheet(t,e,r,x={}){if(this._isS)throw new Error("Already streaming");if(b(e),r!==void 0){S("header",r.length,e);for(let a of r)y(a)}let{hidden:i=!1,doAutofilter:o=!0,headerStyle:n="bold"}=x,l=3;n==="fill"?l=4:n==="bold+fill"&&(l=5),this.addSheet(t,i),this._isS=!0;let u=new g;this._csb=u,this._csrn=0,this._csSC=0,this._csEC=e,this._csAF=o&&r!==void 0,this._cw=new Array(e).fill(-1);let d=new Array(e);for(let a=0;a<e;a++)d[a]=this._cl(a);if(this._csCL=d,r)for(let a=0;a<e;a++){let s=1.3*(r[a]?r[a].length:0)+3;s>80&&(s=80),this._cw[a]<s&&(this._cw[a]=s)}if(this._sheetHead(u,e,this._sc===1,this._csAF),r){this._csrn++,u.writeString(`<row r="${this._csrn}">`);for(let a=0;a<r.length;a++)this._wscStyle(u,r[a],d[a],this._csrn,l);u.writeString("</row>")}}writeRow(t){if(!this._isS||this._csb===null)throw new Error("Not streaming");if(t.length!==this._csEC)throw new Error(`Row length mismatch. Expected ${this._csEC} columns, got ${t.length}`);let e=this._csb;this._csrn++,v(this._csrn),e.writeString(`<row r="${this._csrn}">`);for(let r=0;r<t.length;r++)this._wcv(e,t[r],this._csCL[r],this._csrn);e.writeString("</row>")}endSheet(){if(!this._isS||this._csb===null)throw new Error("Not streaming");let t=this._csb;if(t.writeString("</sheetData>"),this._csAF&&this._csEC>0){this._afOn=!0;let e=`A1:${this._csCL[this._csEC-1]}${this._csrn}`;t.writeString(`<autoFilter ref="${e}"/>`);let r=this._sl[this._sc-1];r.fhr=`${this._fmn(r.name)}!$A$1:$${this._csCL[this._csEC-1]}$${this._csrn}`}t.writeString("</worksheet>"),this._zip.addFile(this._sl[this._sc-1].path,t.toUint8Array()),this._isS=!1,this._csb=null}writeSheet(t,e=null,r={}){let x=r.doAutofilter!==!1,i=r.headerStyle||"bold",o=3;i==="fill"?o=4:i==="bold+fill"&&(o=5);let n=new g,l=t.length>0?t[0].length:e?e.length:0;l>0&&b(l);let u=t.length+(e?1:0);if(v(u),e){S("header",e.length,l);for(let s of e)y(s)}for(let s=0;s<t.length;s++)S("row",t[s].length,l);this._cw=new Array(l).fill(-1);let d=new Array(l);for(let s=0;s<l;s++)d[s]=this._cl(s);if(e)for(let s=0;s<l;s++){let f=1.3*(e[s]?e[s].length:0)+3;f>80&&(f=80),this._cw[s]<f&&(this._cw[s]=f)}for(let s=0;s<Math.min(t.length,100);s++)for(let f=0;f<t[s].length;f++){let m=t[s][f];if(m==null)continue;let p=C(m)?m.value:m;if(p==null)continue;let F=1.3*(p instanceof Date?10:p.toString().length)+3;F>80&&(F=80),this._cw[f]<F&&(this._cw[f]=F)}this._sheetHead(n,l,this._sc===1,x&&!!e);let a=0;if(e){a++,n.writeString(`<row r="${a}">`);for(let s=0;s<e.length;s++)this._wscStyle(n,e[s],d[s],a,o);n.writeString("</row>")}for(let s=0;s<t.length;s++){a++,n.writeString(`<row r="${a}">`);for(let f=0;f<t[s].length;f++)this._wcv(n,t[s][f],d[f],a);n.writeString("</row>")}if(n.writeString("</sheetData>"),x&&e&&l>0){this._afOn=!0;let s=`A1:${d[l-1]}${u}`;n.writeString(`<autoFilter ref="${s}"/>`);let f=this._sl[this._sc-1];f.fhr=`${this._fmn(f.name)}!$A$1:$${d[l-1]}$${u}`}n.writeString("</worksheet>"),this._zip.addFile(this._sl[this._sc-1].path,n.toUint8Array())}finalize(){return this._writeSst(),this._writeStyles(),this._writeWb(),this._writeCt(),this._writeRels(),this._zip.toBlob()}_writeSst(){let t=new g;t.writeString('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'),t.writeString(`<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="${this._sstCnt}" uniqueCount="${this._sstA.length}">`);for(let e of this._sstA){let r=this._esc(e);r.length>0&&(r[0]===" "||r[r.length-1]===" "||/[\t\n\r]/.test(r))?t.writeString(`<si><t xml:space="preserve">${r}</t></si>`):t.writeString(`<si><t>${r}</t></si>`)}t.writeString("</sst>"),this._zip.addFile("xl/sharedStrings.xml",t.toUint8Array())}_writeStyles(){let t='<numFmt numFmtId="164" formatCode="yyyy\\-mm\\-dd\\ hh:mm:ss"/>',e=1,r=['<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>','<xf numFmtId="14" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/>','<xf numFmtId="164" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/>','<xf numFmtId="0" fontId="1" fillId="0" borderId="0" xfId="0" applyFont="1"/>','<xf numFmtId="0" fontId="0" fillId="1" borderId="0" xfId="0" applyFill="1"/>','<xf numFmtId="0" fontId="1" fillId="1" borderId="0" xfId="0" applyFont="1" applyFill="1"/>'];for(let[i,o]of this._fmtReg){let n=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");t+=`<numFmt numFmtId="${o}" formatCode="${n}"/>`,e++}let x=[...this._fmtXf.entries()].sort((i,o)=>i[1]-o[1]);for(let[i]of x){let o=this._fmtReg.get(i);r.push(`<xf numFmtId="${o}" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/>`)}this._zip.addFile("xl/styles.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
1
|
+
"use strict";var JustybaseSpreadsheet=(()=>{var N=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var G=(h,t)=>{for(var e in t)N(h,e,{get:t[e],enumerable:!0})},K=(h,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let x of Y(t))!j.call(h,x)&&x!==e&&N(h,x,{get:()=>t[x],enumerable:!(r=q(t,x))||r.enumerable});return h};var J=h=>K(N({},"__esModule",{value:!0}),h);var s0={};G(s0,{BrowserBigBuffer:()=>g,BrowserXlsbWriter:()=>U,BrowserXlsxWriter:()=>E,BrowserZip:()=>B,F:()=>z,downloadXlsb:()=>i0,downloadXlsbMultiSheet:()=>n0,downloadXlsx:()=>r0,downloadXlsxMultiSheet:()=>x0});var g=class{constructor(t=65536){this.chunkSize=t,this.chunks=[],this.currentBuffer=new Uint8Array(t),this.dataView=new DataView(this.currentBuffer.buffer),this.cursor=0,this._textEncoder=new TextEncoder}ensureCapacity(t){this.cursor+t>this.chunkSize&&this._flush()}_flush(){this.cursor>0&&(this.chunks.push(this.currentBuffer.slice(0,this.cursor)),this.currentBuffer=new Uint8Array(this.chunkSize),this.dataView=new DataView(this.currentBuffer.buffer),this.cursor=0)}write(t){let e=t.length,r=0;for(;e>0;){let x=this.chunkSize-this.cursor;x===0&&(this._flush(),x=this.chunkSize);let i=Math.min(e,x);this.currentBuffer.set(t.subarray(r,r+i),this.cursor),this.cursor+=i,r+=i,e-=i}}writeByte(t){this.ensureCapacity(1),this.currentBuffer[this.cursor]=t,this.cursor++}writeUnsafeByte(t){this.currentBuffer[this.cursor++]=t}writeInt32LE(t){this.ensureCapacity(4),this.dataView.setInt32(this.cursor,t,!0),this.cursor+=4}writeUnsafeInt32LE(t){this.dataView.setInt32(this.cursor,t,!0),this.cursor+=4}writeDoubleLE(t){this.ensureCapacity(8),this.dataView.setFloat64(this.cursor,t,!0),this.cursor+=8}writeUnsafeDoubleLE(t){this.dataView.setFloat64(this.cursor,t,!0),this.cursor+=8}writeString(t){let e=this._textEncoder.encode(t),r=e.length;if(this.cursor+r<=this.chunkSize){this.currentBuffer.set(e,this.cursor),this.cursor+=r;return}this._flush(),r>this.chunkSize?this.chunks.push(e):(this.currentBuffer.set(e,this.cursor),this.cursor+=r)}writeUtf16LE(t){let e=t.length*2;if(this.cursor+e<=this.chunkSize){for(let r=0;r<t.length;r++){let x=t.charCodeAt(r);this.currentBuffer[this.cursor++]=x&255,this.currentBuffer[this.cursor++]=x>>8&255}return}if(this._flush(),e>this.chunkSize){let r=new Uint8Array(e);for(let x=0;x<t.length;x++){let i=t.charCodeAt(x);r[x*2]=i&255,r[x*2+1]=i>>8&255}this.chunks.push(r)}else for(let r=0;r<t.length;r++){let x=t.charCodeAt(r);this.currentBuffer[this.cursor++]=x&255,this.currentBuffer[this.cursor++]=x>>8&255}}getChunks(){return this.cursor>0&&(this.chunks.push(this.currentBuffer.slice(0,this.cursor)),this.currentBuffer=new Uint8Array(this.chunkSize),this.dataView=new DataView(this.currentBuffer.buffer),this.cursor=0),this.chunks}toUint8Array(){let t=this.getChunks(),e=0;for(let i of t)e+=i.length;let r=new Uint8Array(e),x=0;for(let i of t)r.set(i,x),x+=i.length;return r}reset(){this.chunks=[],this.cursor=0}};var B=class h{constructor(){this.files=[];this.files=[]}static{this._crc32Table=null}addFile(t,e){let r;if(typeof e=="string")r=new TextEncoder().encode(e);else if(Array.isArray(e)){let x=0;for(let l of e)x+=l.length;r=new Uint8Array(x);let i=0;for(let l of e)r.set(l,i),i+=l.length}else r=e;this.files.push({name:t,data:r})}toBlob(){let t=[],e=[],r=0;for(let s of this.files){let u=new TextEncoder().encode(s.name),d=this._crc32(s.data),a=new Uint8Array(30+u.length),n=new DataView(a.buffer);n.setUint32(0,67324752,!0),n.setUint16(4,20,!0),n.setUint16(6,0,!0),n.setUint16(8,0,!0),n.setUint16(10,0,!0),n.setUint16(12,0,!0),n.setUint32(14,d,!0),n.setUint32(18,s.data.length,!0),n.setUint32(22,s.data.length,!0),n.setUint16(26,u.length,!0),n.setUint16(28,0,!0),a.set(u,30),t.push(a),t.push(s.data);let f=new Uint8Array(46+u.length),c=new DataView(f.buffer);c.setUint32(0,33639248,!0),c.setUint16(4,20,!0),c.setUint16(6,20,!0),c.setUint16(8,0,!0),c.setUint16(10,0,!0),c.setUint16(12,0,!0),c.setUint16(14,0,!0),c.setUint32(16,d,!0),c.setUint32(20,s.data.length,!0),c.setUint32(24,s.data.length,!0),c.setUint16(28,u.length,!0),c.setUint16(30,0,!0),c.setUint16(32,0,!0),c.setUint16(34,0,!0),c.setUint16(36,0,!0),c.setUint32(38,0,!0),c.setUint32(42,r,!0),f.set(u,46),e.push(f),r+=a.length+s.data.length}let x=r,i=0;for(let s of e)t.push(s),i+=s.length;let l=new Uint8Array(22),o=new DataView(l.buffer);return o.setUint32(0,101010256,!0),o.setUint16(4,0,!0),o.setUint16(6,0,!0),o.setUint16(8,this.files.length,!0),o.setUint16(10,this.files.length,!0),o.setUint32(12,i,!0),o.setUint32(16,x,!0),o.setUint16(20,0,!0),t.push(l),new Blob(t,{type:"application/octet-stream"})}_crc32(t){if(!h._crc32Table){h._crc32Table=new Uint32Array(256);for(let x=0;x<256;x++){let i=x;for(let l=0;l<8;l++)i=i&1?3988292384^i>>>1:i>>>1;h._crc32Table[x]=i}}let e=h._crc32Table,r=4294967295;for(let x=0;x<t.length;x++)r=e[(r^t[x])&255]^r>>>8;return(r^4294967295)>>>0}};var z={THOUSANDS_SEP:"#,##0",CURRENCY_PLN:'#,##0.00 "z\u0142"',CURRENCY_EUR:"#,##0.00 \u20AC",PERCENTAGE:"0%",SCIENTIFIC:"0.00E+00",TWO_DECIMALS:"#,##0.00",TEXT:"@",LEADING_ZEROS:"000000000",DATE_SHORT:"dd.mm.yyyy",DATE_LONG:"d mmmm yyyy",DATE_DAY_MONTH_YEAR:"dd-mm-yyyy",DATE_ISO:"yyyy-mm-dd",DATE_MONTH_YEAR:"mmmm yyyy",DATE_WEEKDAY:"dddd, d mmmm yyyy",DATE_DAY_MONTH:"d mmmm",DATE_YEAR_ONLY:"yyyy",DATETIME_SHORT:"dd.mm.yyyy hh:mm",DATETIME_LONG:"d mmmm yyyy hh:mm:ss",TIME_HH_MM:"hh:mm",TIME_HH_MM_SS:"hh:mm:ss",TIME_12H:"h:mm AM/PM",DATETIME_24H:"dd.mm.yyyy hh:mm:ss",DATETIME_ISO:'yyyy-mm-dd"T"hh:mm:ss',TIME_MS:"hh:mm:ss.000"};function C(h){return h!=null&&typeof h=="object"&&"format"in h&&typeof h.format=="string"}function R(h){return C(h)?h.value:h}function L(h){return C(h)?h.format:null}function H(h){let t=h+1,e="";for(;t>0;){let r=(t-1)%26;e=String.fromCharCode(65+r)+e,t=Math.floor((t-1)/26)}return e}var Q=Date.UTC(1899,11,30),t0=Date.UTC(1900,2,1);function k(h,t){let e=(h-t)/864e5;return t===Q&&h<t0&&(e-=1),e}var X=1048576,W=16384,P=32767;function y(h){if(h.length>P)throw new Error(`Excel cell text exceeds ${P} UTF-16 code units (got ${h.length}).`)}function I(h){if(!Number.isInteger(h)||h<1||h>W)throw new Error(`Excel column count must be 1..${W} (got ${h}).`)}function S(h,t,e){if(t>e)throw new Error(`Excel ${h} length ${t} exceeds columnCount ${e}.`)}function v(h){if(h>X)throw new Error(`Excel row count exceeds ${X} (got ${h}).`)}function Z(h,t,e,r){return h===t+1?"":` r="${e}${r}"`}var E=class{constructor(){this._zip=new B,this._sc=0,this._sl=[],this._sstA=[],this._sstM=new Map,this._sstCnt=0,this._cw=[],this._afOn=!1,this._oaE=Date.UTC(1899,11,30),this._csb=null,this._csrn=0,this._csSC=0,this._csEC=0,this._csAF=!1,this._isS=!1,this._csCL=[],this._fmtReg=new Map,this._fmtXf=new Map,this._nextNfmt=165,this._nextXf=6}_cl(t){return H(t)}_san(t){if(!t||typeof t!="string")return`Sheet${this._sc+1}`;let e=t.replace(/[\\/*?[\]:]/g,"_");return e.length>31&&(e=e.substring(0,31)),e.trim()||(e=`Sheet${this._sc+1}`),e}_ex(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}_esc(t){t=t.replace(/_x([0-9A-Fa-f]{4})_/g,"_x005F_x$1_");let e=!1;for(let i=0;i<t.length;i++){let l=t.charCodeAt(i);if(l===38||l===60||l===62||l===34||l===39||l===13||l>=0&&l<=8||l===11||l===12||l>=14&&l<=31){e=!0;break}}if(!e)return t;let r=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\r/g," "),x="";for(let i=0;i<r.length;i++){let l=r.charCodeAt(i);l<=8||l===11||l===12||l>=14&&l<=31||(x+=r[i])}return x}_fmn(t){return/[\s\-+=()!@#$%^&]/.test(t)||/^[0-9]/.test(t)?`'${t.replace(/'/g,"''")}'`:t}addSheet(t,e=!1){let r=this._san(t);this._sc++,this._sl.push({name:r,path:`xl/worksheets/sheet${this._sc}.xml`,hidden:e,fn:`sheet${this._sc}.xml`,id:this._sc,rId:`rId${this._sc}`,fhr:null})}_wsc(t,e,r,x){y(e);let i=this._sstM.get(e);i===void 0&&(i=this._sstA.length,this._sstA.push(e),this._sstM.set(e,i)),this._sstCnt++;let l=x!==void 0?` s="${x}"`:"";t.writeString(`<c${r} t="s"${l}><v>${i}</v></c>`)}_wscStyle(t,e,r,x){y(e);let i=this._sstM.get(e);i===void 0&&(i=this._sstA.length,this._sstA.push(e),this._sstM.set(e,i)),this._sstCnt++,t.writeString(`<c${r} t="s" s="${x}"><v>${i}</v></c>`)}_oa(t){return k(t.getTime(),this._oaE)}_regFmt(t){let e=this._fmtXf.get(t);if(e!==void 0)return e;let r=this._nextNfmt++;this._fmtReg.set(t,r);let x=this._nextXf++;return this._fmtXf.set(t,x),x}_wcv(t,e,r,x,i,l){if(e==null)return l;let o=L(e),s=R(e),u=o!==null?this._regFmt(o):-1,d=u>=0?` s="${u}"`:"";if(s==null)return l;let a=Z(r,l,x,i),n=u>=0?u:void 0;if(typeof s=="number")Number.isFinite(s)?t.writeString(`<c${a}${d}><v>${s}</v></c>`):this._wsc(t,s.toString(),a,n);else if(typeof s=="bigint")this._wsc(t,s.toString(),a,n);else if(typeof s=="boolean")t.writeString(`<c${a} t="b"${d}><v>${s?1:0}</v></c>`);else if(s instanceof Date){let f=this._oa(s);Number.isFinite(f)?t.writeString(`<c${a} s="${u>=0?u:1}"><v>${f}</v></c>`):this._wsc(t,s.toString(),a,n)}else this._wsc(t,s.toString(),a,n);return r}_sheetHead(t,e,r,x){t.writeString('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'),t.writeString('<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">'),t.writeString('<dimension ref="A1"/>'),x?t.writeString(`<sheetViews><sheetView ${r?'tabSelected="1" ':""}workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/><selection pane="bottomLeft"/></sheetView></sheetViews><sheetFormatPr defaultRowHeight="15"/>`):t.writeString(`<sheetViews><sheetView ${r?'tabSelected="1" ':""}workbookViewId="0"/></sheetViews><sheetFormatPr defaultRowHeight="15"/>`),t.writeString("<cols>");for(let i=0;i<e;i++){let l=this._cw[i]>0?this._cw[i]:10;t.writeString(`<col min="${i+1}" max="${i+1}" width="${l}" bestFit="1" customWidth="1"/>`)}t.writeString("</cols><sheetData>")}startSheet(t,e,r,x={}){if(this._isS)throw new Error("Already streaming");if(I(e),r!==void 0){S("header",r.length,e);for(let a of r)y(a)}let{hidden:i=!1,doAutofilter:l=!0,headerStyle:o="bold"}=x,s=3;o==="fill"?s=4:o==="bold+fill"&&(s=5),this.addSheet(t,i),this._isS=!0;let u=new g;this._csb=u,this._csrn=0,this._csSC=0,this._csEC=e,this._csAF=l&&r!==void 0,this._cw=new Array(e).fill(-1);let d=new Array(e);for(let a=0;a<e;a++)d[a]=this._cl(a);if(this._csCL=d,r)for(let a=0;a<e;a++){let n=1.3*(r[a]?r[a].length:0)+3;n>80&&(n=80),this._cw[a]<n&&(this._cw[a]=n)}if(this._sheetHead(u,e,this._sc===1,this._csAF),r){this._csrn++,u.writeString(`<row r="${this._csrn}">`);for(let a=0;a<r.length;a++)this._wscStyle(u,r[a],"",s);u.writeString("</row>")}}writeRow(t){if(!this._isS||this._csb===null)throw new Error("Not streaming");if(t.length!==this._csEC)throw new Error(`Row length mismatch. Expected ${this._csEC} columns, got ${t.length}`);let e=this._csb;this._csrn++,v(this._csrn),e.writeString(`<row r="${this._csrn}">`);let r=-1;for(let x=0;x<t.length;x++)r=this._wcv(e,t[x],x,this._csCL[x],this._csrn,r);e.writeString("</row>")}endSheet(){if(!this._isS||this._csb===null)throw new Error("Not streaming");let t=this._csb;if(t.writeString("</sheetData>"),this._csAF&&this._csEC>0){this._afOn=!0;let e=`A1:${this._csCL[this._csEC-1]}${this._csrn}`;t.writeString(`<autoFilter ref="${e}"/>`);let r=this._sl[this._sc-1];r.fhr=`${this._fmn(r.name)}!$A$1:$${this._csCL[this._csEC-1]}$${this._csrn}`}t.writeString("</worksheet>"),this._zip.addFile(this._sl[this._sc-1].path,t.toUint8Array()),this._isS=!1,this._csb=null}writeSheet(t,e=null,r={}){let x=r.doAutofilter!==!1,i=r.headerStyle||"bold",l=3;i==="fill"?l=4:i==="bold+fill"&&(l=5);let o=new g,s=t.length>0?t[0].length:e?e.length:0;s>0&&I(s);let u=t.length+(e?1:0);if(v(u),e){S("header",e.length,s);for(let n of e)y(n)}for(let n=0;n<t.length;n++)S("row",t[n].length,s);this._cw=new Array(s).fill(-1);let d=new Array(s);for(let n=0;n<s;n++)d[n]=this._cl(n);if(e)for(let n=0;n<s;n++){let f=1.3*(e[n]?e[n].length:0)+3;f>80&&(f=80),this._cw[n]<f&&(this._cw[n]=f)}for(let n=0;n<Math.min(t.length,100);n++)for(let f=0;f<t[n].length;f++){let c=t[n][f];if(c==null)continue;let p=C(c)?c.value:c;if(p==null)continue;let F=1.3*(p instanceof Date?10:p.toString().length)+3;F>80&&(F=80),this._cw[f]<F&&(this._cw[f]=F)}this._sheetHead(o,s,this._sc===1,x&&!!e);let a=0;if(e){a++,o.writeString(`<row r="${a}">`);for(let n=0;n<e.length;n++)this._wscStyle(o,e[n],"",l);o.writeString("</row>")}for(let n=0;n<t.length;n++){a++,o.writeString(`<row r="${a}">`);let f=-1;for(let c=0;c<t[n].length;c++)f=this._wcv(o,t[n][c],c,d[c],a,f);o.writeString("</row>")}if(o.writeString("</sheetData>"),x&&e&&s>0){this._afOn=!0;let n=`A1:${d[s-1]}${u}`;o.writeString(`<autoFilter ref="${n}"/>`);let f=this._sl[this._sc-1];f.fhr=`${this._fmn(f.name)}!$A$1:$${d[s-1]}$${u}`}o.writeString("</worksheet>"),this._zip.addFile(this._sl[this._sc-1].path,o.toUint8Array())}finalize(){return this._writeSst(),this._writeStyles(),this._writeWb(),this._writeCt(),this._writeRels(),this._zip.toBlob()}_writeSst(){let t=new g;t.writeString('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'),t.writeString(`<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="${this._sstCnt}" uniqueCount="${this._sstA.length}">`);for(let e of this._sstA){let r=this._esc(e);r.length>0&&(r[0]===" "||r[r.length-1]===" "||/[\t\n\r]/.test(r))?t.writeString(`<si><t xml:space="preserve">${r}</t></si>`):t.writeString(`<si><t>${r}</t></si>`)}t.writeString("</sst>"),this._zip.addFile("xl/sharedStrings.xml",t.toUint8Array())}_writeStyles(){let t='<numFmt numFmtId="164" formatCode="yyyy\\-mm\\-dd\\ hh:mm:ss"/>',e=1,r=['<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>','<xf numFmtId="14" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/>','<xf numFmtId="164" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/>','<xf numFmtId="0" fontId="1" fillId="0" borderId="0" xfId="0" applyFont="1"/>','<xf numFmtId="0" fontId="0" fillId="1" borderId="0" xfId="0" applyFill="1"/>','<xf numFmtId="0" fontId="1" fillId="1" borderId="0" xfId="0" applyFont="1" applyFill="1"/>'];for(let[i,l]of this._fmtReg){let o=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");t+=`<numFmt numFmtId="${l}" formatCode="${o}"/>`,e++}let x=[...this._fmtXf.entries()].sort((i,l)=>i[1]-l[1]);for(let[i]of x){let l=this._fmtReg.get(i);r.push(`<xf numFmtId="${l}" fontId="0" fillId="0" borderId="0" xfId="0" applyNumberFormat="1"/>`)}this._zip.addFile("xl/styles.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
2
|
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
|
|
3
3
|
<numFmts count="${e}">${t}</numFmts>
|
|
4
4
|
<fonts count="2">
|
|
@@ -14,23 +14,23 @@ ${r.join(`
|
|
|
14
14
|
</cellXfs>
|
|
15
15
|
<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>
|
|
16
16
|
<dxfs count="0"/><tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleLight16"/>
|
|
17
|
-
</styleSheet>`)}_writeWb(){let t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="xl" lastEdited="4" lowestEdited="4" rupBuild="4505"/><workbookPr defaultThemeVersion="124226"/><bookViews><workbookView xWindow="240" yWindow="15" windowWidth="16095" windowHeight="9660"/></bookViews><sheets>';for(let e of this._sl)t+=`<sheet name="${this._ex(e.name)}" sheetId="${e.id}"${e.hidden?' state="hidden"':""} r:id="${e.rId}"/>`;if(t+="</sheets>",this._afOn){t+="<definedNames>";for(let e of this._sl)e.fhr&&(t+=`<definedName name="_xlnm._FilterDatabase" localSheetId="${e.id-1}" hidden="1">${this._esc(e.fhr)}</definedName>`);t+="</definedNames>"}t+='<calcPr calcId="124519" fullCalcOnLoad="1"/></workbook>',this._zip.addFile("xl/workbook.xml",t)}_writeCt(){let t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>';for(let e of this._sl)t+=`<Override PartName="/${e.path}" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`;t+="</Types>",this._zip.addFile("[Content_Types].xml",t)}_writeRels(){this._zip.addFile("_rels/.rels",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>');let t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">';for(let r of this._sl)t+=`<Relationship Id="${r.rId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/${r.fn}"/>`;let e=this._sl.length+1;t+=`<Relationship Id="rId${e++}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>`,t+=`<Relationship Id="rId${e++}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/>`,t+="</Relationships>",this._zip.addFile("xl/_rels/workbook.xml.rels",t)}};var t0=/[\\/*?[\]:]/g,E=class{constructor(){this._zip=new B,this._sheetCount=0,this._sheetList=[],this._sstDic=new Map,this._sstCntUnique=0,this._sstCntAll=0,this._colWidths=[],this._autofilterIsOn=!1,this._oaEpoch=Date.UTC(1899,11,30),this._isStreaming=!1,this._currentSheetBuffer=null,this._currentSheetRowNum=0,this._currentSheetStartCol=0,this._currentSheetEndCol=0,this._currentSheetDoAutofilter=!1,this._fmtMap=new Map,this._nextNid=167,this._nextXf=4,this._sheet1Bytes=new Uint8Array([129,1,0,147,1,23,203,4,2,0,64,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,148,1,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,1,0,137,1,30,220,3,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,152,1,36,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,1,0,134,1,0,37,6,1,0,2,14,0,128,149,8,2,5,0,38,0,229,3,12,255,255,255,255,8,0,44,1,0,0,0,0,145,1,0,37,6,1,0,2,14,0,128,128,8,2,5,0,38,0,0,25,0,0,0,0,0,0,0,0,44,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,7,12,0,0,0,0,0,0,0,0,0,0,0,0,146,1,0,151,4,66,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,221,3,2,16,0,220,3,48,102,102,102,102,102,102,230,63,102,102,102,102,102,102,230,63,0,0,0,0,0,0,232,63,0,0,0,0,0,0,232,63,51,51,51,51,51,51,211,63,51,51,51,51,51,51,211,63,37,6,1,0,0,16,0,128,128,24,16,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,38,0,130,1,0]),this._workbookBinStart=new Uint8Array([131,1,0,128,1,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,120,0,108,0,1,0,0,0,55,0,1,0,0,0,54,0,5,0,0,0,50,0,52,0,51,0,50,0,54,0,153,1,12,32,0,1,0,0,0,0,0,0,0,0,0,37,6,1,0,3,15,0,128,151,16,52,24,0,0,0,67,0,58,0,92,0,115,0,113,0,108,0,115,0,92,0,84,0,101,0,115,0,116,0,121,0,90,0,97,0,112,0,105,0,115,0,117,0,88,0,108,0,115,0,98,0,92,0,38,0,37,6,1,0,0,16,0,128,129,24,130,1,0,0,0,0,0,0,0,0,47,0,0,0,49,0,51,0,95,0,110,0,99,0,114,0,58,0,49,0,95,0,123,0,49,0,54,0,53,0,48,0,56,0,68,0,54,0,57,0,45,0,67,0,70,0,56,0,55,0,45,0,52,0,55,0,54,0,57,0,45,0,56,0,52,0,53,0,54,0,45,0,68,0,52,0,65,0,52,0,48,0,49,0,49,0,51,0,49,0,53,0,54,0,55,0,125,0,47,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,0,135,1,0,37,6,1,0,2,16,0,128,128,24,16,0,0,0,0,13,0,0,0,255,255,255,255,0,0,0,0,38,0,158,1,29,0,0,0,0,158,22,0,0,180,105,0,0,232,38,0,0,88,2,0,0,0,0,0,0,0,0,0,0,120,136,1,0,143,1,0]),this._workbookBinMiddle=new Uint8Array([144,1,0]),this._workbookBinEnd=new Uint8Array([157,1,26,53,234,2,0,1,0,0,0,100,0,0,0,252,169,241,210,77,98,80,63,1,0,0,0,106,0,155,1,1,0,35,4,3,15,0,0,171,16,1,1,36,0,132,1,0]),this._stylesBin=new Uint8Array([150,2,0,231,4,4,2,0,0,0,44,44,164,0,19,0,0,0,121,0,121,0,121,0,121,0,92,0,45,0,109,0,109,0,92,0,45,0,100,0,100,0,92,0,32,0,104,0,104,0,58,0,109,0,109,0,44,30,166,0,12,0,0,0,121,0,121,0,121,0,121,0,92,0,45,0,109,0,109,0,92,0,45,0,100,0,100,0,232,4,0,227,4,4,2,0,0,0,43,39,220,0,0,0,144,1,0,0,0,2,0,0,7,1,0,0,0,0,0,255,2,7,0,0,0,67,0,97,0,108,0,105,0,98,0,114,0,105,0,43,39,220,0,1,0,188,2,0,0,0,2,238,0,7,1,0,0,0,0,0,255,2,7,0,0,0,67,0,97,0,108,0,105,0,98,0,114,0,105,0,37,6,1,0,2,14,0,128,129,8,0,38,0,228,4,0,219,4,4,2,0,0,0,45,68,0,0,0,0,3,64,0,0,0,0,0,255,3,65,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,68,17,0,0,0,3,64,0,0,0,0,0,255,3,65,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,220,4,0,229,4,4,1,0,0,0,46,51,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,230,4,0,242,4,4,1,0,0,0,47,16,255,255,0,0,0,0,0,0,0,0,0,0,16,16,0,0,243,4,0,233,4,4,6,0,0,0,47,16,0,0,0,0,0,0,0,0,0,0,0,0,16,16,0,0,47,16,0,0,164,0,0,0,0,0,0,0,0,0,16,16,1,0,47,16,0,0,166,0,0,0,0,0,0,0,0,0,16,16,1,0,47,16,0,0,0,0,1,0,0,0,0,0,0,0,16,16,1,0,47,16,0,0,0,0,0,0,1,0,0,0,0,0,16,16,1,0,47,16,0,0,0,0,1,0,1,0,0,0,0,0,16,16,1,0,234,4,0,235,4,4,1,0,0,0,37,6,1,0,2,17,0,128,128,24,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,0,48,28,0,0,0,0,1,0,0,0,8,0,0,0,78,0,111,0,114,0,109,0,97,0,108,0,110,0,121,0,236,4,0,249,3,4,0,0,0,0,250,3,0,252,3,80,0,0,0,0,17,0,0,0,84,0,97,0,98,0,108,0,101,0,83,0,116,0,121,0,108,0,101,0,77,0,101,0,100,0,105,0,117,0,109,0,50,0,17,0,0,0,80,0,105,0,118,0,111,0,116,0,83,0,116,0,121,0,108,0,101,0,76,0,105,0,103,0,104,0,116,0,49,0,54,0,253,3,0,35,4,2,14,0,0,235,8,0,246,8,42,0,0,0,0,17,0,0,0,83,0,108,0,105,0,99,0,101,0,114,0,83,0,116,0,121,0,108,0,101,0,76,0,105,0,103,0,104,0,116,0,49,0,247,8,0,236,8,0,36,0,35,4,3,15,0,0,176,16,0,178,16,50,0,0,0,0,21,0,0,0,84,0,105,0,109,0,101,0,83,0,108,0,105,0,99,0,101,0,114,0,83,0,116,0,121,0,108,0,101,0,76,0,105,0,103,0,104,0,116,0,49,0,179,16,0,177,16,0,36,0,151,2,0]),this._binaryIndexBin=new Uint8Array([42,24,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,149,2,0]),this._rRkIntegerLowerLimit=-1<<29,this._rRkIntegerUpperLimit=(1<<29)-1,this._autoFilterStartBytes=new Uint8Array([161,1,16]),this._autoFilterEndBytes=new Uint8Array([162,1,0]),this._stickHeaderA1bytes=new Uint8Array([151,1,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,1,0,0,0,0,0,0,0,2,0,0,0,3]),this._magicFilterExcel2016Fix0=new Uint8Array([225,2,0,229,2,0,234,2]),this._magicFilterExcel2016Fix1=new Uint8Array([39,70,33,0,0,0,0,255,0,0,0,15,0,0,0,95,0,70,0,105,0,108,0,116,0,101,0,114,0,68,0,97,0,116,0,97,0,98,0,97,0,115,0,101,0,15,0,0,0,59,255,0]),this._magicFilterExcel2016Fix2=new Uint8Array([0,0,0,0,255,255,255,255])}_sanitizeSheetName(t){if(!t||typeof t!="string")return`Sheet${this._sheetCount+1}`;let e=t.replace(t0,"_");return e.length>31&&(e=e.substring(0,31)),e.trim().length===0&&(e=`Sheet${this._sheetCount+1}`),e}_registerFormat(t){let e=this._fmtMap.get(t);if(e!==void 0)return e.xf;let r=this._nextNid++,x=this._nextXf++;return this._fmtMap.set(t,{nid:r,xf:x}),x}_buildStylesBin(){if(this._fmtMap.size===0)return this._stylesBin;let t=this._stylesBin,e=-1;for(let c=3;c<t.length-3;c++)if(t[c]===232&&t[c+1]===4&&t[c+2]===0){e=c;break}let r=-1;for(let c=e+3;c<t.length-2;c++)if(t[c]===233&&t[c+1]===4){r=c;break}let x=-1;for(let c=r;c<t.length-3;c++)if(t[c]===234&&t[c+1]===4&&t[c+2]===0){x=c;break}let i=-1;for(let c=e+3;c<t.length-2;c++)if(t[c]===227&&t[c+1]===4){i=c;break}let o=2+this._fmtMap.size,n=4+this._fmtMap.size,l=[];function u(c){let w=[];for(;c>=128;)w.push(c&127|128),c>>>=7;return w.push(c&127),w}function d(c,w){return new Uint8Array([...u(c),...u(w.length),...w])}function a(c,w){let D=w.length,$=6+D*2,_=new Uint8Array(2+$);_[0]=44,_[1]=$;let I=new DataView(_.buffer);I.setUint16(2,c,!0),I.setUint32(4,D,!0);for(let T=0;T<D;T++){let z=w.charCodeAt(T);_[8+T*2]=z&255,_[8+T*2+1]=z>>8&255}return _}function s(c,w,D,$=0){let _=new Uint8Array(18),I=new DataView(_.buffer);return _[0]=47,_[1]=16,I.setUint16(2,c,!0),I.setUint16(4,w,!0),_[6]=$,_[14]=16,_[15]=16,I.setUint16(16,D,!0),_}l.push(t.subarray(0,3));let f=new Uint8Array(4);new DataView(f.buffer).setUint16(0,o,!0),l.push(d(615,f)),l.push(a(164,"yyyy\\-mm\\-dd\\ hh:mm:ss")),l.push(a(166,"yyyy\\-mm\\-dd"));for(let[c,w]of this._fmtMap)l.push(a(w.nid,c));l.push(d(616,new Uint8Array(0))),l.push(t.subarray(i,r));let m=new Uint8Array(4);new DataView(m.buffer).setUint16(0,n,!0),l.push(d(617,m)),l.push(s(0,0,0)),l.push(s(0,164,1)),l.push(s(0,166,1)),l.push(s(1,0,0,1));let p=[...this._fmtMap.entries()].sort((c,w)=>c[1].xf-w[1].xf);for(let[,c]of p)l.push(s(0,c.nid,1));l.push(d(618,new Uint8Array(0))),l.push(t.subarray(x+3));let F=0;for(let c of l)F+=c.length;let A=new Uint8Array(F),M=0;for(let c of l)A.set(c,M),M+=c.length;return A}addSheet(t,e=!1){let r=this._sanitizeSheetName(t);this._sheetCount++,this._sheetList.push({name:r,pathInArchive:`xl/worksheets/sheet${this._sheetCount}.bin`,hidden:e,nameInArchive:`sheet${this._sheetCount}.bin`,sheetId:this._sheetCount,filterHeaderRange:null})}startSheet(t,e,r,x={}){if(this._isStreaming)throw new Error("Already streaming");if(b(e),r!==void 0){S("header",r.length,e);for(let u of r)y(u)}let{hidden:i=!1,doAutofilter:o=!0,headerStyle:n="bold"}=x,l=3;if(n==="fill"?l=4:n==="bold+fill"&&(l=5),this.addSheet(t,i),this._isStreaming=!0,this._currentSheetBuffer=new g,this._currentSheetRowNum=0,this._currentSheetStartCol=0,this._currentSheetEndCol=e,this._currentSheetDoAutofilter=o&&r!==void 0,this._colWidths=new Array(e).fill(-1),r)for(let u=0;u<e;u++){let a=1.3*(r[u]?r[u].length:0)+3;a>80&&(a=80),this._colWidths[u]<a&&(this._colWidths[u]=a)}if(this._writeSheetHeader(this._currentSheetBuffer,this._currentSheetStartCol,this._currentSheetEndCol,this._currentSheetDoAutofilter),r){this.createRowHeader(this._currentSheetBuffer,this._currentSheetRowNum,this._currentSheetStartCol,this._currentSheetEndCol);for(let u=0;u<r.length;u++)this.writeString(this._currentSheetBuffer,r[u],u,l);this._currentSheetRowNum++}}writeRow(t){let e=this._currentSheetBuffer;if(!this._isStreaming||e===null)throw new Error("Not streaming");if(t.length!==this._currentSheetEndCol-this._currentSheetStartCol)throw new Error(`Row length mismatch. Expected ${this._currentSheetEndCol-this._currentSheetStartCol} columns, got ${t.length}`);v(this._currentSheetRowNum+1),this.createRowHeader(e,this._currentSheetRowNum,this._currentSheetStartCol,this._currentSheetEndCol);for(let r=0;r<t.length;r++)this._writeCell(e,t[r],r);this._currentSheetRowNum++}endSheet(){let t=this._currentSheetBuffer;if(!this._isStreaming||t===null)throw new Error("Not streaming");if(t.write(this._sheet1Bytes.subarray(218,290)),this._currentSheetDoAutofilter){this._autofilterIsOn=!0,t.write(this._autoFilterStartBytes);let e=new Uint8Array(8),r=new DataView(e.buffer);r.setInt32(0,0,!0),r.setInt32(4,this._currentSheetRowNum-1,!0),t.write(e);let x=new Uint8Array(8),i=new DataView(x.buffer);i.setInt32(0,this._currentSheetStartCol,!0),i.setInt32(4,this._currentSheetEndCol-1,!0),t.write(x),t.write(this._autoFilterEndBytes),this._sheetList[this._sheetCount-1].filterData={startRow:0,endRow:this._currentSheetRowNum-1,startColumn:this._currentSheetStartCol,endColumn:this._currentSheetEndCol-1}}t.write(this._sheet1Bytes.subarray(290)),this._zip.addFile(this._sheetList[this._sheetCount-1].pathInArchive,t.toUint8Array()),this._isStreaming=!1,this._currentSheetBuffer=null}writeSheet(t,e=null,r={}){let x=r.doAutofilter!==!1,i=r.headerStyle||"bold",o=3;i==="fill"?o=4:i==="bold+fill"&&(o=5);let n=new g,l=t.length>0?t[0].length:e?e.length:0;l>0&&b(l);let u=t.length+(e?1:0);if(v(u),e){S("header",e.length,l);for(let s of e)y(s)}for(let s=0;s<t.length;s++)S("row",t[s].length,l);if(this._colWidths=new Array(l).fill(-1),e)for(let s=0;s<l;s++){let m=1.3*(e[s]?e[s].length:0)+3;m>80&&(m=80),this._colWidths[s]<m&&(this._colWidths[s]=m)}for(let s=0;s<Math.min(t.length,100);s++)for(let f=0;f<t[s].length;f++){let m=t[s][f];if(m==null)continue;let p=C(m)?m.value:m;if(p==null)continue;let A=1.3*(p instanceof Date?10:p.toString().length)+3;A>80&&(A=80),this._colWidths[f]<A&&(this._colWidths[f]=A)}let d=x&&!!e;this._writeSheetHeader(n,0,l,d);let a=0;if(e){this.createRowHeader(n,a,0,l);for(let s=0;s<e.length;s++)this.writeString(n,e[s],s,o);a++}for(let s=0;s<t.length;s++){this.createRowHeader(n,a,0,l);for(let f=0;f<t[s].length;f++)this._writeCell(n,t[s][f],f);a++}if(n.write(this._sheet1Bytes.subarray(218,290)),d){this._autofilterIsOn=!0,n.write(this._autoFilterStartBytes);let s=new Uint8Array(8),f=new DataView(s.buffer);f.setInt32(0,0,!0),f.setInt32(4,a-1,!0),n.write(s);let m=new Uint8Array(8),p=new DataView(m.buffer);p.setInt32(0,0,!0),p.setInt32(4,l-1,!0),n.write(m),n.write(this._autoFilterEndBytes),this._sheetList[this._sheetCount-1].filterData={startRow:0,endRow:a,startColumn:0,endColumn:l-1}}n.write(this._sheet1Bytes.subarray(290)),this._zip.addFile(this._sheetList[this._sheetCount-1].pathInArchive,n.toUint8Array())}_writeSheetHeader(t,e,r,x){let i=new Uint8Array(this._sheet1Bytes),o=new DataView(i.buffer);o.setInt32(40,e,!0),o.setInt32(44,r,!0),this._sheetCount!==1&&(i[54]=156),t.write(i.subarray(0,84)),x&&t.write(this._stickHeaderA1bytes),t.write(i.subarray(84,159)),t.writeByte(134),t.writeByte(3);for(let n=e;n<r;n++){t.writeByte(0),t.writeByte(60),t.writeByte(18),t.writeInt32LE(n),t.writeInt32LE(n);let l=this._colWidths[n]>0?this._colWidths[n]:10;t.writeInt32LE(Math.round(l*256)),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(2)}t.writeByte(0),t.writeByte(135),t.writeByte(3),t.writeByte(0),t.write(i.subarray(159,175)),t.write(new Uint8Array([38,0]))}_writeCell(t,e,r){if(e==null)return;let x=L(e),i=R(e),o=x!==null?this._registerFormat(x):0;if(typeof i=="number")Number.isInteger(i)&&i>=this._rRkIntegerLowerLimit&&i<=this._rRkIntegerUpperLimit?this.writeRkNumberInteger(t,i,r,o):this.writeDouble(t,i,r,o);else if(typeof i=="bigint")this.writeString(t,i.toString(),r);else if(typeof i=="boolean")this.writeBool(t,i,r);else if(i instanceof Date){let n=k(i.getTime(),this._oaEpoch);this.writeDouble(t,n,r,x!==null?o:1)}else i!=null&&this.writeString(t,i.toString(),r,0,x!==null?o:void 0)}createRowHeader(t,e,r,x){t.ensureCapacity(27),t.writeUnsafeByte(0),t.writeUnsafeByte(25),t.writeUnsafeInt32LE(e),t.writeUnsafeInt32LE(0),t.writeUnsafeByte(44),t.writeUnsafeByte(1),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(1),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeInt32LE(r),t.writeUnsafeInt32LE(x)}writeRkNumberInteger(t,e,r,x=0){t.ensureCapacity(14),t.writeUnsafeByte(2),t.writeUnsafeByte(12),t.writeUnsafeInt32LE(r),t.writeUnsafeByte(x),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeInt32LE(e<<2|2)}writeDouble(t,e,r,x=0){t.ensureCapacity(18),t.writeUnsafeByte(5),t.writeUnsafeByte(16),t.writeUnsafeInt32LE(r),t.writeUnsafeByte(x),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeDoubleLE(e)}writeBool(t,e,r){t.ensureCapacity(13),t.writeUnsafeByte(4),t.writeUnsafeByte(9),t.writeUnsafeInt32LE(r),t.writeUnsafeInt32LE(0),t.writeUnsafeByte(e?1:0)}writeDateTime(t,e,r){this.writeDouble(t,k(e.getTime(),this._oaEpoch),r,1)}writeString(t,e,r,x=0,i){y(e);let o=this._sstDic.get(e);o===void 0&&(o=this._sstCntUnique++,this._sstDic.set(e,o)),this._sstCntAll++;let n=i!==void 0?i:x;t.ensureCapacity(17),t.writeUnsafeByte(7),t.writeUnsafeByte(12),t.writeUnsafeInt32LE(r),t.writeUnsafeByte(n),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeInt32LE(o)}_saveSst(){let t=new g;t.writeByte(159),t.writeByte(1),t.writeByte(8),t.writeInt32LE(this._sstCntAll),t.writeInt32LE(this._sstCntUnique);for(let[e]of this._sstDic){let r=e.length;t.writeByte(19);let x=5+2*r;if(x>=128){t.writeByte(128+x%128);let i=x>>7;i>=256?t.writeByte(128+i%128):t.writeByte(i),t.writeByte(x>>14),x>>14>0&&t.writeByte(0)}else t.writeByte(x&255),t.writeByte(x>>8&255);t.writeInt32LE(r),t.writeUtf16LE(e)}t.writeByte(160),t.writeByte(1),t.writeByte(0),this._zip.addFile("xl/sharedStrings.bin",t.toUint8Array())}_writeFilterDefinedName(t,e,r){let x=e.filterData,i=new Uint8Array(this._magicFilterExcel2016Fix1);i[7]=e.sheetId-1,i[i.length-2]=r,t.push(i);let o=new Uint8Array(8),n=new DataView(o.buffer);n.setInt32(0,x.startRow,!0),n.setInt32(4,x.endRow,!0),t.push(o);let l=new Uint8Array(4),u=new DataView(l.buffer);u.setInt16(0,x.startColumn,!0),u.setInt16(2,x.endColumn,!0),t.push(l),t.push(this._magicFilterExcel2016Fix2)}finalize(){this._saveSst(),this._zip.addFile("xl/styles.bin",this._buildStylesBin());let t=[this._workbookBinStart];for(let n of this._sheetList){let l=`rId${n.sheetId}`,u=n.name,d=16+u.length*2+l.length*2,a=new Uint8Array(3+d),s=new DataView(a.buffer);a[0]=156,a[1]=1,a[2]=d;let f=3;s.setInt32(f,n.hidden?1:0,!0),f+=4,s.setInt32(f,n.sheetId,!0),f+=4,s.setInt32(f,l.length,!0),f+=4;for(let m=0;m<l.length;m++){let p=l.charCodeAt(m);a[f++]=p&255,a[f++]=p>>8&255}s.setInt32(f,u.length,!0),f+=4;for(let m=0;m<u.length;m++){let p=u.charCodeAt(m);a[f++]=p&255,a[f++]=p>>8&255}t.push(a)}if(t.push(this._workbookBinMiddle),this._autofilterIsOn){let n=this._sheetList.filter(l=>l.filterData!==void 0);if(n.length>0){t.push(this._magicFilterExcel2016Fix0);let l=n.length,u=l<=20?16+(l-1)*12:128+(l-21)*12;t.push(l<=10?new Uint8Array([u,l,0,0,0]):new Uint8Array([u,Math.floor((l-1)/10),l,0,0,0]));for(let d=0;d<n.length;d++){let a=n[d].sheetId-1,s=new Uint8Array(12);s[4]=a,s[8]=a,t.push(s)}t.push(new Uint8Array([226,2,0]));for(let d=0;d<n.length;d++)this._writeFilterDefinedName(t,n[d],d)}}t.push(this._workbookBinEnd);let e=0;for(let n of t)e+=n.length;let r=new Uint8Array(e),x=0;for(let n of t)r.set(n,x),x+=n.length;this._zip.addFile("xl/workbook.bin",r);for(let n of this._sheetList)this._zip.addFile(`xl/worksheets/binaryIndex${n.sheetId}.bin`,this._binaryIndexBin);let i=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
17
|
+
</styleSheet>`)}_writeWb(){let t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="xl" lastEdited="4" lowestEdited="4" rupBuild="4505"/><workbookPr defaultThemeVersion="124226"/><bookViews><workbookView xWindow="240" yWindow="15" windowWidth="16095" windowHeight="9660"/></bookViews><sheets>';for(let e of this._sl)t+=`<sheet name="${this._ex(e.name)}" sheetId="${e.id}"${e.hidden?' state="hidden"':""} r:id="${e.rId}"/>`;if(t+="</sheets>",this._afOn){t+="<definedNames>";for(let e of this._sl)e.fhr&&(t+=`<definedName name="_xlnm._FilterDatabase" localSheetId="${e.id-1}" hidden="1">${this._esc(e.fhr)}</definedName>`);t+="</definedNames>"}t+='<calcPr calcId="124519" fullCalcOnLoad="1"/></workbook>',this._zip.addFile("xl/workbook.xml",t)}_writeCt(){let t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>';for(let e of this._sl)t+=`<Override PartName="/${e.path}" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`;t+="</Types>",this._zip.addFile("[Content_Types].xml",t)}_writeRels(){this._zip.addFile("_rels/.rels",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>');let t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">';for(let r of this._sl)t+=`<Relationship Id="${r.rId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/${r.fn}"/>`;let e=this._sl.length+1;t+=`<Relationship Id="rId${e++}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>`,t+=`<Relationship Id="rId${e++}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/>`,t+="</Relationships>",this._zip.addFile("xl/_rels/workbook.xml.rels",t)}};var e0=/[\\/*?[\]:]/g,U=class{constructor(){this._zip=new B,this._sheetCount=0,this._sheetList=[],this._sstDic=new Map,this._sstCntUnique=0,this._sstCntAll=0,this._colWidths=[],this._autofilterIsOn=!1,this._oaEpoch=Date.UTC(1899,11,30),this._isStreaming=!1,this._currentSheetBuffer=null,this._currentSheetRowNum=0,this._currentSheetStartCol=0,this._currentSheetEndCol=0,this._currentSheetDoAutofilter=!1,this._fmtMap=new Map,this._nextNid=167,this._nextXf=4,this._sheet1Bytes=new Uint8Array([129,1,0,147,1,23,203,4,2,0,64,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,148,1,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,1,0,137,1,30,220,3,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,152,1,36,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,1,0,134,1,0,37,6,1,0,2,14,0,128,149,8,2,5,0,38,0,229,3,12,255,255,255,255,8,0,44,1,0,0,0,0,145,1,0,37,6,1,0,2,14,0,128,128,8,2,5,0,38,0,0,25,0,0,0,0,0,0,0,0,44,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,7,12,0,0,0,0,0,0,0,0,0,0,0,0,146,1,0,151,4,66,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,221,3,2,16,0,220,3,48,102,102,102,102,102,102,230,63,102,102,102,102,102,102,230,63,0,0,0,0,0,0,232,63,0,0,0,0,0,0,232,63,51,51,51,51,51,51,211,63,51,51,51,51,51,51,211,63,37,6,1,0,0,16,0,128,128,24,16,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,38,0,130,1,0]),this._workbookBinStart=new Uint8Array([131,1,0,128,1,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,120,0,108,0,1,0,0,0,55,0,1,0,0,0,54,0,5,0,0,0,50,0,52,0,51,0,50,0,54,0,153,1,12,32,0,1,0,0,0,0,0,0,0,0,0,37,6,1,0,3,15,0,128,151,16,52,24,0,0,0,67,0,58,0,92,0,115,0,113,0,108,0,115,0,92,0,84,0,101,0,115,0,116,0,121,0,90,0,97,0,112,0,105,0,115,0,117,0,88,0,108,0,115,0,98,0,92,0,38,0,37,6,1,0,0,16,0,128,129,24,130,1,0,0,0,0,0,0,0,0,47,0,0,0,49,0,51,0,95,0,110,0,99,0,114,0,58,0,49,0,95,0,123,0,49,0,54,0,53,0,48,0,56,0,68,0,54,0,57,0,45,0,67,0,70,0,56,0,55,0,45,0,52,0,55,0,54,0,57,0,45,0,56,0,52,0,53,0,54,0,45,0,68,0,52,0,65,0,52,0,48,0,49,0,49,0,51,0,49,0,53,0,54,0,55,0,125,0,47,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,0,135,1,0,37,6,1,0,2,16,0,128,128,24,16,0,0,0,0,13,0,0,0,255,255,255,255,0,0,0,0,38,0,158,1,29,0,0,0,0,158,22,0,0,180,105,0,0,232,38,0,0,88,2,0,0,0,0,0,0,0,0,0,0,120,136,1,0,143,1,0]),this._workbookBinMiddle=new Uint8Array([144,1,0]),this._workbookBinEnd=new Uint8Array([157,1,26,53,234,2,0,1,0,0,0,100,0,0,0,252,169,241,210,77,98,80,63,1,0,0,0,106,0,155,1,1,0,35,4,3,15,0,0,171,16,1,1,36,0,132,1,0]),this._stylesBin=new Uint8Array([150,2,0,231,4,4,2,0,0,0,44,44,164,0,19,0,0,0,121,0,121,0,121,0,121,0,92,0,45,0,109,0,109,0,92,0,45,0,100,0,100,0,92,0,32,0,104,0,104,0,58,0,109,0,109,0,44,30,166,0,12,0,0,0,121,0,121,0,121,0,121,0,92,0,45,0,109,0,109,0,92,0,45,0,100,0,100,0,232,4,0,227,4,4,2,0,0,0,43,39,220,0,0,0,144,1,0,0,0,2,0,0,7,1,0,0,0,0,0,255,2,7,0,0,0,67,0,97,0,108,0,105,0,98,0,114,0,105,0,43,39,220,0,1,0,188,2,0,0,0,2,238,0,7,1,0,0,0,0,0,255,2,7,0,0,0,67,0,97,0,108,0,105,0,98,0,114,0,105,0,37,6,1,0,2,14,0,128,129,8,0,38,0,228,4,0,219,4,4,2,0,0,0,45,68,0,0,0,0,3,64,0,0,0,0,0,255,3,65,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,68,17,0,0,0,3,64,0,0,0,0,0,255,3,65,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,220,4,0,229,4,4,1,0,0,0,46,51,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,230,4,0,242,4,4,1,0,0,0,47,16,255,255,0,0,0,0,0,0,0,0,0,0,16,16,0,0,243,4,0,233,4,4,6,0,0,0,47,16,0,0,0,0,0,0,0,0,0,0,0,0,16,16,0,0,47,16,0,0,164,0,0,0,0,0,0,0,0,0,16,16,1,0,47,16,0,0,166,0,0,0,0,0,0,0,0,0,16,16,1,0,47,16,0,0,0,0,1,0,0,0,0,0,0,0,16,16,1,0,47,16,0,0,0,0,0,0,1,0,0,0,0,0,16,16,1,0,47,16,0,0,0,0,1,0,1,0,0,0,0,0,16,16,1,0,234,4,0,235,4,4,1,0,0,0,37,6,1,0,2,17,0,128,128,24,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,0,48,28,0,0,0,0,1,0,0,0,8,0,0,0,78,0,111,0,114,0,109,0,97,0,108,0,110,0,121,0,236,4,0,249,3,4,0,0,0,0,250,3,0,252,3,80,0,0,0,0,17,0,0,0,84,0,97,0,98,0,108,0,101,0,83,0,116,0,121,0,108,0,101,0,77,0,101,0,100,0,105,0,117,0,109,0,50,0,17,0,0,0,80,0,105,0,118,0,111,0,116,0,83,0,116,0,121,0,108,0,101,0,76,0,105,0,103,0,104,0,116,0,49,0,54,0,253,3,0,35,4,2,14,0,0,235,8,0,246,8,42,0,0,0,0,17,0,0,0,83,0,108,0,105,0,99,0,101,0,114,0,83,0,116,0,121,0,108,0,101,0,76,0,105,0,103,0,104,0,116,0,49,0,247,8,0,236,8,0,36,0,35,4,3,15,0,0,176,16,0,178,16,50,0,0,0,0,21,0,0,0,84,0,105,0,109,0,101,0,83,0,108,0,105,0,99,0,101,0,114,0,83,0,116,0,121,0,108,0,101,0,76,0,105,0,103,0,104,0,116,0,49,0,179,16,0,177,16,0,36,0,151,2,0]),this._binaryIndexBin=new Uint8Array([42,24,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,149,2,0]),this._rRkIntegerLowerLimit=-1<<29,this._rRkIntegerUpperLimit=(1<<29)-1,this._autoFilterStartBytes=new Uint8Array([161,1,16]),this._autoFilterEndBytes=new Uint8Array([162,1,0]),this._stickHeaderA1bytes=new Uint8Array([151,1,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,63,1,0,0,0,0,0,0,0,2,0,0,0,3]),this._magicFilterExcel2016Fix0=new Uint8Array([225,2,0,229,2,0,234,2]),this._magicFilterExcel2016Fix1=new Uint8Array([39,70,33,0,0,0,0,255,0,0,0,15,0,0,0,95,0,70,0,105,0,108,0,116,0,101,0,114,0,68,0,97,0,116,0,97,0,98,0,97,0,115,0,101,0,15,0,0,0,59,255,0]),this._magicFilterExcel2016Fix2=new Uint8Array([0,0,0,0,255,255,255,255])}_sanitizeSheetName(t){if(!t||typeof t!="string")return`Sheet${this._sheetCount+1}`;let e=t.replace(e0,"_");return e.length>31&&(e=e.substring(0,31)),e.trim().length===0&&(e=`Sheet${this._sheetCount+1}`),e}_registerFormat(t){let e=this._fmtMap.get(t);if(e!==void 0)return e.xf;let r=this._nextNid++,x=this._nextXf++;return this._fmtMap.set(t,{nid:r,xf:x}),x}_buildStylesBin(){if(this._fmtMap.size===0)return this._stylesBin;let t=this._stylesBin,e=-1;for(let m=3;m<t.length-3;m++)if(t[m]===232&&t[m+1]===4&&t[m+2]===0){e=m;break}let r=-1;for(let m=e+3;m<t.length-2;m++)if(t[m]===233&&t[m+1]===4){r=m;break}let x=-1;for(let m=r;m<t.length-3;m++)if(t[m]===234&&t[m+1]===4&&t[m+2]===0){x=m;break}let i=-1;for(let m=e+3;m<t.length-2;m++)if(t[m]===227&&t[m+1]===4){i=m;break}let l=2+this._fmtMap.size,o=4+this._fmtMap.size,s=[];function u(m){let w=[];for(;m>=128;)w.push(m&127|128),m>>>=7;return w.push(m&127),w}function d(m,w){return new Uint8Array([...u(m),...u(w.length),...w])}function a(m,w){let D=w.length,$=6+D*2,_=new Uint8Array(2+$);_[0]=44,_[1]=$;let b=new DataView(_.buffer);b.setUint16(2,m,!0),b.setUint32(4,D,!0);for(let T=0;T<D;T++){let O=w.charCodeAt(T);_[8+T*2]=O&255,_[8+T*2+1]=O>>8&255}return _}function n(m,w,D,$=0){let _=new Uint8Array(18),b=new DataView(_.buffer);return _[0]=47,_[1]=16,b.setUint16(2,m,!0),b.setUint16(4,w,!0),_[6]=$,_[14]=16,_[15]=16,b.setUint16(16,D,!0),_}s.push(t.subarray(0,3));let f=new Uint8Array(4);new DataView(f.buffer).setUint16(0,l,!0),s.push(d(615,f)),s.push(a(164,"yyyy\\-mm\\-dd\\ hh:mm:ss")),s.push(a(166,"yyyy\\-mm\\-dd"));for(let[m,w]of this._fmtMap)s.push(a(w.nid,m));s.push(d(616,new Uint8Array(0))),s.push(t.subarray(i,r));let c=new Uint8Array(4);new DataView(c.buffer).setUint16(0,o,!0),s.push(d(617,c)),s.push(n(0,0,0)),s.push(n(0,164,1)),s.push(n(0,166,1)),s.push(n(1,0,0,1));let p=[...this._fmtMap.entries()].sort((m,w)=>m[1].xf-w[1].xf);for(let[,m]of p)s.push(n(0,m.nid,1));s.push(d(618,new Uint8Array(0))),s.push(t.subarray(x+3));let F=0;for(let m of s)F+=m.length;let A=new Uint8Array(F),M=0;for(let m of s)A.set(m,M),M+=m.length;return A}addSheet(t,e=!1){let r=this._sanitizeSheetName(t);this._sheetCount++,this._sheetList.push({name:r,pathInArchive:`xl/worksheets/sheet${this._sheetCount}.bin`,hidden:e,nameInArchive:`sheet${this._sheetCount}.bin`,sheetId:this._sheetCount,filterHeaderRange:null})}startSheet(t,e,r,x={}){if(this._isStreaming)throw new Error("Already streaming");if(I(e),r!==void 0){S("header",r.length,e);for(let u of r)y(u)}let{hidden:i=!1,doAutofilter:l=!0,headerStyle:o="bold"}=x,s=3;if(o==="fill"?s=4:o==="bold+fill"&&(s=5),this.addSheet(t,i),this._isStreaming=!0,this._currentSheetBuffer=new g,this._currentSheetRowNum=0,this._currentSheetStartCol=0,this._currentSheetEndCol=e,this._currentSheetDoAutofilter=l&&r!==void 0,this._colWidths=new Array(e).fill(-1),r)for(let u=0;u<e;u++){let a=1.3*(r[u]?r[u].length:0)+3;a>80&&(a=80),this._colWidths[u]<a&&(this._colWidths[u]=a)}if(this._writeSheetHeader(this._currentSheetBuffer,this._currentSheetStartCol,this._currentSheetEndCol,this._currentSheetDoAutofilter),r){this.createRowHeader(this._currentSheetBuffer,this._currentSheetRowNum,this._currentSheetStartCol,this._currentSheetEndCol);for(let u=0;u<r.length;u++)this.writeString(this._currentSheetBuffer,r[u],u,s);this._currentSheetRowNum++}}writeRow(t){let e=this._currentSheetBuffer;if(!this._isStreaming||e===null)throw new Error("Not streaming");if(t.length!==this._currentSheetEndCol-this._currentSheetStartCol)throw new Error(`Row length mismatch. Expected ${this._currentSheetEndCol-this._currentSheetStartCol} columns, got ${t.length}`);v(this._currentSheetRowNum+1),this.createRowHeader(e,this._currentSheetRowNum,this._currentSheetStartCol,this._currentSheetEndCol);for(let r=0;r<t.length;r++)this._writeCell(e,t[r],r);this._currentSheetRowNum++}endSheet(){let t=this._currentSheetBuffer;if(!this._isStreaming||t===null)throw new Error("Not streaming");if(t.write(this._sheet1Bytes.subarray(218,290)),this._currentSheetDoAutofilter){this._autofilterIsOn=!0,t.write(this._autoFilterStartBytes);let e=new Uint8Array(8),r=new DataView(e.buffer);r.setInt32(0,0,!0),r.setInt32(4,this._currentSheetRowNum-1,!0),t.write(e);let x=new Uint8Array(8),i=new DataView(x.buffer);i.setInt32(0,this._currentSheetStartCol,!0),i.setInt32(4,this._currentSheetEndCol-1,!0),t.write(x),t.write(this._autoFilterEndBytes),this._sheetList[this._sheetCount-1].filterData={startRow:0,endRow:this._currentSheetRowNum-1,startColumn:this._currentSheetStartCol,endColumn:this._currentSheetEndCol-1}}t.write(this._sheet1Bytes.subarray(290)),this._zip.addFile(this._sheetList[this._sheetCount-1].pathInArchive,t.toUint8Array()),this._isStreaming=!1,this._currentSheetBuffer=null}writeSheet(t,e=null,r={}){let x=r.doAutofilter!==!1,i=r.headerStyle||"bold",l=3;i==="fill"?l=4:i==="bold+fill"&&(l=5);let o=new g,s=t.length>0?t[0].length:e?e.length:0;s>0&&I(s);let u=t.length+(e?1:0);if(v(u),e){S("header",e.length,s);for(let n of e)y(n)}for(let n=0;n<t.length;n++)S("row",t[n].length,s);if(this._colWidths=new Array(s).fill(-1),e)for(let n=0;n<s;n++){let c=1.3*(e[n]?e[n].length:0)+3;c>80&&(c=80),this._colWidths[n]<c&&(this._colWidths[n]=c)}for(let n=0;n<Math.min(t.length,100);n++)for(let f=0;f<t[n].length;f++){let c=t[n][f];if(c==null)continue;let p=C(c)?c.value:c;if(p==null)continue;let A=1.3*(p instanceof Date?10:p.toString().length)+3;A>80&&(A=80),this._colWidths[f]<A&&(this._colWidths[f]=A)}let d=x&&!!e;this._writeSheetHeader(o,0,s,d);let a=0;if(e){this.createRowHeader(o,a,0,s);for(let n=0;n<e.length;n++)this.writeString(o,e[n],n,l);a++}for(let n=0;n<t.length;n++){this.createRowHeader(o,a,0,s);for(let f=0;f<t[n].length;f++)this._writeCell(o,t[n][f],f);a++}if(o.write(this._sheet1Bytes.subarray(218,290)),d){this._autofilterIsOn=!0,o.write(this._autoFilterStartBytes);let n=new Uint8Array(8),f=new DataView(n.buffer);f.setInt32(0,0,!0),f.setInt32(4,a-1,!0),o.write(n);let c=new Uint8Array(8),p=new DataView(c.buffer);p.setInt32(0,0,!0),p.setInt32(4,s-1,!0),o.write(c),o.write(this._autoFilterEndBytes),this._sheetList[this._sheetCount-1].filterData={startRow:0,endRow:a,startColumn:0,endColumn:s-1}}o.write(this._sheet1Bytes.subarray(290)),this._zip.addFile(this._sheetList[this._sheetCount-1].pathInArchive,o.toUint8Array())}_writeSheetHeader(t,e,r,x){let i=new Uint8Array(this._sheet1Bytes),l=new DataView(i.buffer);l.setInt32(40,e,!0),l.setInt32(44,r,!0),this._sheetCount!==1&&(i[54]=156),t.write(i.subarray(0,84)),x&&t.write(this._stickHeaderA1bytes),t.write(i.subarray(84,159)),t.writeByte(134),t.writeByte(3);for(let o=e;o<r;o++){t.writeByte(0),t.writeByte(60),t.writeByte(18),t.writeInt32LE(o),t.writeInt32LE(o);let s=this._colWidths[o]>0?this._colWidths[o]:10;t.writeInt32LE(Math.round(s*256)),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(2)}t.writeByte(0),t.writeByte(135),t.writeByte(3),t.writeByte(0),t.write(i.subarray(159,175)),t.write(new Uint8Array([38,0]))}_writeCell(t,e,r){if(e==null)return;let x=L(e),i=R(e),l=x!==null?this._registerFormat(x):0;if(typeof i=="number")Number.isInteger(i)&&i>=this._rRkIntegerLowerLimit&&i<=this._rRkIntegerUpperLimit?this.writeRkNumberInteger(t,i,r,l):this.writeDouble(t,i,r,l);else if(typeof i=="bigint")this.writeString(t,i.toString(),r);else if(typeof i=="boolean")this.writeBool(t,i,r);else if(i instanceof Date){let o=k(i.getTime(),this._oaEpoch);this.writeDouble(t,o,r,x!==null?l:1)}else i!=null&&this.writeString(t,i.toString(),r,0,x!==null?l:void 0)}createRowHeader(t,e,r,x){t.ensureCapacity(27),t.writeUnsafeByte(0),t.writeUnsafeByte(25),t.writeUnsafeInt32LE(e),t.writeUnsafeInt32LE(0),t.writeUnsafeByte(44),t.writeUnsafeByte(1),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(1),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeInt32LE(r),t.writeUnsafeInt32LE(x)}writeRkNumberInteger(t,e,r,x=0){t.ensureCapacity(14),t.writeUnsafeByte(2),t.writeUnsafeByte(12),t.writeUnsafeInt32LE(r),t.writeUnsafeByte(x),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeInt32LE(e<<2|2)}writeDouble(t,e,r,x=0){t.ensureCapacity(18),t.writeUnsafeByte(5),t.writeUnsafeByte(16),t.writeUnsafeInt32LE(r),t.writeUnsafeByte(x),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeDoubleLE(e)}writeBool(t,e,r){t.ensureCapacity(13),t.writeUnsafeByte(4),t.writeUnsafeByte(9),t.writeUnsafeInt32LE(r),t.writeUnsafeInt32LE(0),t.writeUnsafeByte(e?1:0)}writeDateTime(t,e,r){this.writeDouble(t,k(e.getTime(),this._oaEpoch),r,1)}writeString(t,e,r,x=0,i){y(e);let l=this._sstDic.get(e);l===void 0&&(l=this._sstCntUnique++,this._sstDic.set(e,l)),this._sstCntAll++;let o=i!==void 0?i:x;t.ensureCapacity(17),t.writeUnsafeByte(7),t.writeUnsafeByte(12),t.writeUnsafeInt32LE(r),t.writeUnsafeByte(o),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeByte(0),t.writeUnsafeInt32LE(l)}_saveSst(){let t=new g;t.writeByte(159),t.writeByte(1),t.writeByte(8),t.writeInt32LE(this._sstCntAll),t.writeInt32LE(this._sstCntUnique);for(let[e]of this._sstDic){let r=e.length;t.writeByte(19);let x=5+2*r;if(x>=128){t.writeByte(128+x%128);let i=x>>7;i>=256?t.writeByte(128+i%128):t.writeByte(i),t.writeByte(x>>14),x>>14>0&&t.writeByte(0)}else t.writeByte(x&255),t.writeByte(x>>8&255);t.writeInt32LE(r),t.writeUtf16LE(e)}t.writeByte(160),t.writeByte(1),t.writeByte(0),this._zip.addFile("xl/sharedStrings.bin",t.toUint8Array())}_writeFilterDefinedName(t,e,r){let x=e.filterData,i=new Uint8Array(this._magicFilterExcel2016Fix1);i[7]=e.sheetId-1,i[i.length-2]=r,t.push(i);let l=new Uint8Array(8),o=new DataView(l.buffer);o.setInt32(0,x.startRow,!0),o.setInt32(4,x.endRow,!0),t.push(l);let s=new Uint8Array(4),u=new DataView(s.buffer);u.setInt16(0,x.startColumn,!0),u.setInt16(2,x.endColumn,!0),t.push(s),t.push(this._magicFilterExcel2016Fix2)}finalize(){this._saveSst(),this._zip.addFile("xl/styles.bin",this._buildStylesBin());let t=[this._workbookBinStart];for(let o of this._sheetList){let s=`rId${o.sheetId}`,u=o.name,d=16+u.length*2+s.length*2,a=new Uint8Array(3+d),n=new DataView(a.buffer);a[0]=156,a[1]=1,a[2]=d;let f=3;n.setInt32(f,o.hidden?1:0,!0),f+=4,n.setInt32(f,o.sheetId,!0),f+=4,n.setInt32(f,s.length,!0),f+=4;for(let c=0;c<s.length;c++){let p=s.charCodeAt(c);a[f++]=p&255,a[f++]=p>>8&255}n.setInt32(f,u.length,!0),f+=4;for(let c=0;c<u.length;c++){let p=u.charCodeAt(c);a[f++]=p&255,a[f++]=p>>8&255}t.push(a)}if(t.push(this._workbookBinMiddle),this._autofilterIsOn){let o=this._sheetList.filter(s=>s.filterData!==void 0);if(o.length>0){t.push(this._magicFilterExcel2016Fix0);let s=o.length,u=s<=20?16+(s-1)*12:128+(s-21)*12;t.push(s<=10?new Uint8Array([u,s,0,0,0]):new Uint8Array([u,Math.floor((s-1)/10),s,0,0,0]));for(let d=0;d<o.length;d++){let a=o[d].sheetId-1,n=new Uint8Array(12);n[4]=a,n[8]=a,t.push(n)}t.push(new Uint8Array([226,2,0]));for(let d=0;d<o.length;d++)this._writeFilterDefinedName(t,o[d],d)}}t.push(this._workbookBinEnd);let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),x=0;for(let o of t)r.set(o,x),x+=o.length;this._zip.addFile("xl/workbook.bin",r);for(let o of this._sheetList)this._zip.addFile(`xl/worksheets/binaryIndex${o.sheetId}.bin`,this._binaryIndexBin);let i=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
18
18
|
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
|
19
19
|
<Default Extension="bin" ContentType="application/vnd.ms-excel.sheet.binary.macroEnabled.main"/>
|
|
20
20
|
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
|
|
21
|
-
<Default Extension="xml" ContentType="application/xml"/>`;for(let
|
|
22
|
-
<Override PartName="/xl/worksheets/binaryIndex${
|
|
21
|
+
<Default Extension="xml" ContentType="application/xml"/>`;for(let o of this._sheetList)i+=`<Override PartName="/${o.pathInArchive}" ContentType="application/vnd.ms-excel.worksheet"/>
|
|
22
|
+
<Override PartName="/xl/worksheets/binaryIndex${o.sheetId}.bin" ContentType="application/vnd.ms-excel.binIndexWs"/>
|
|
23
23
|
`;i+=`<Override PartName="/xl/styles.bin" ContentType="application/vnd.ms-excel.styles"/>
|
|
24
24
|
<Override PartName="/xl/sharedStrings.bin" ContentType="application/vnd.ms-excel.sharedStrings"/>
|
|
25
|
-
</Types>`,this._zip.addFile("[Content_Types].xml",i);let
|
|
25
|
+
</Types>`,this._zip.addFile("[Content_Types].xml",i);let l=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
26
26
|
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
27
|
-
`;for(let
|
|
28
|
-
`;
|
|
27
|
+
`;for(let o of this._sheetList)l+=`<Relationship Id="rId${o.sheetId}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/${o.nameInArchive}"/>
|
|
28
|
+
`;l+=`<Relationship Id="rId${this._sheetList.length+2}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.bin"/>
|
|
29
29
|
<Relationship Id="rId${this._sheetList.length+3}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.bin"/>
|
|
30
|
-
</Relationships>`,this._zip.addFile("xl/_rels/workbook.bin.rels",
|
|
30
|
+
</Relationships>`,this._zip.addFile("xl/_rels/workbook.bin.rels",l),this._zip.addFile("_rels/.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
31
31
|
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
32
32
|
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.bin"/>
|
|
33
|
-
</Relationships>`);for(let
|
|
33
|
+
</Relationships>`);for(let o of this._sheetList)this._zip.addFile(`xl/worksheets/_rels/${o.nameInArchive}.rels`,`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
34
34
|
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
35
|
-
<Relationship Id="rId1" Type="http://schemas.microsoft.com/office/2006/relationships/xlBinaryIndex" Target="binaryIndex${
|
|
36
|
-
</Relationships>`);return this._zip.toBlob()}};function V(h,t){let e=URL.createObjectURL(h),r=document.createElement("a");r.href=e,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),setTimeout(()=>URL.revokeObjectURL(e),5e3)}function
|
|
35
|
+
<Relationship Id="rId1" Type="http://schemas.microsoft.com/office/2006/relationships/xlBinaryIndex" Target="binaryIndex${o.sheetId}.bin"/>
|
|
36
|
+
</Relationships>`);return this._zip.toBlob()}};function V(h,t){let e=URL.createObjectURL(h),r=document.createElement("a");r.href=e,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),setTimeout(()=>URL.revokeObjectURL(e),5e3)}function r0(h,t,e,r="Sheet1"){let x=new E;x.addSheet(r),x.writeSheet(t,e,{doAutofilter:!0}),V(x.finalize(),h)}function x0(h,t){let e=new E;for(let r of t)e.addSheet(r.name),e.writeSheet(r.rows,r.headers,{doAutofilter:!0});V(e.finalize(),h)}function i0(h,t,e,r="Sheet1"){let x=new U;x.addSheet(r),x.writeSheet(t,e,{doAutofilter:!0}),V(x.finalize(),h)}function n0(h,t){let e=new U;for(let r of t)e.addSheet(r.name),e.writeSheet(r.rows,r.headers,{doAutofilter:!0});V(e.finalize(),h)}return J(s0);})();
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -254,7 +254,13 @@ declare class XlsbWriter {
|
|
|
254
254
|
/**
|
|
255
255
|
* @param filePath Destination `.xlsb` path on disk.
|
|
256
256
|
*/
|
|
257
|
-
|
|
257
|
+
/**
|
|
258
|
+
* @param filePath Destination `.xlsb` path on disk.
|
|
259
|
+
* @param options.compressionLevel Deflate level 0-9 (default 6).
|
|
260
|
+
*/
|
|
261
|
+
constructor(filePath: string, options?: {
|
|
262
|
+
compressionLevel?: number;
|
|
263
|
+
});
|
|
258
264
|
/** @deprecated Internal; kept for unit-test access. Prefer sanitizeSheetName(). */
|
|
259
265
|
private _sanitizeSheetName;
|
|
260
266
|
private _registerFormat;
|
|
@@ -340,7 +346,13 @@ declare class XlsxWriter {
|
|
|
340
346
|
/**
|
|
341
347
|
* @param filePath Destination `.xlsx` path on disk.
|
|
342
348
|
*/
|
|
343
|
-
|
|
349
|
+
/**
|
|
350
|
+
* @param filePath Destination `.xlsx` path on disk.
|
|
351
|
+
* @param options.compressionLevel Deflate level 0-9 (default 6).
|
|
352
|
+
*/
|
|
353
|
+
constructor(filePath: string, options?: {
|
|
354
|
+
compressionLevel?: number;
|
|
355
|
+
});
|
|
344
356
|
private _getColumnLetter;
|
|
345
357
|
/** @deprecated Internal; kept for unit-test access. Prefer sanitizeSheetName(). */
|
|
346
358
|
private _sanitizeSheetName;
|
|
@@ -368,6 +380,7 @@ declare class XlsxWriter {
|
|
|
368
380
|
* Write an entire sheet in one call (batch mode).
|
|
369
381
|
*/
|
|
370
382
|
writeSheet(rows: CellValue[][], headers?: string[] | null, doAutofilter?: boolean): void;
|
|
383
|
+
/** `ref` is the cell's `r` attribute from `cellRefAttr`, or '' when omitted. */
|
|
371
384
|
private _writeStringCell;
|
|
372
385
|
private _registerFormat;
|
|
373
386
|
private _toOADate;
|
|
@@ -705,6 +718,18 @@ declare class StreamingSheetState {
|
|
|
705
718
|
declare function escapeXmlText(str: string): string;
|
|
706
719
|
/** Unescape the five predefined XML entities (single-pass, order-independent). */
|
|
707
720
|
declare function unescapeXml(str: string): string;
|
|
721
|
+
/**
|
|
722
|
+
* Escape text of a shared string or inline string. Beyond XML escaping, a literal
|
|
723
|
+
* `_xHHHH_` must be written as `_x005F_xHHHH_` because Excel decodes that pattern
|
|
724
|
+
* in these elements (ECMA-376 ST_Xstring). Attribute values use `escapeXmlText`.
|
|
725
|
+
*/
|
|
726
|
+
declare function escapeXlsxText(str: string): string;
|
|
727
|
+
/**
|
|
728
|
+
* Unescape element text content. Raw CR LF and lone CR are normalized to LF first
|
|
729
|
+
* (XML 1.0 §2.11); character references such as ` ` are kept as CR. Then the
|
|
730
|
+
* ST_Xstring escape `_xHHHH_` that Excel writes for control characters is decoded.
|
|
731
|
+
*/
|
|
732
|
+
declare function unescapeXmlText(str: string): string;
|
|
708
733
|
/** Parse XML tag attributes into a map, independent of order/prefix/quote style. */
|
|
709
734
|
declare function parseTagAttributes(tag: string): Record<string, string>;
|
|
710
735
|
/** Resolve a workbook rel Target to a zip entry path (xlspy _resolve_path logic). */
|
|
@@ -726,4 +751,4 @@ declare function trimTrailingEmptyRows<T>(rows: T[][]): T[][];
|
|
|
726
751
|
*/
|
|
727
752
|
declare function parseSharedStringsXml(xml: string): string[];
|
|
728
753
|
|
|
729
|
-
export { BiffReaderWriter, BigBuffer, type CellValue, type ExcelConversionOptions, ExcelReaderAbstract, F, type FormattedCell, INVALID_SHEET_NAME_CHARS, MAX_CELL_CHARS, MAX_COLS, MAX_ROWS, type PrimitiveCellValue, ReaderFactory, type ReplaceSheetDataOptions$1 as ReplaceSheetDataOptions, type RowSource$1 as RowSource, StreamingSheetState, XlsbReader, type ReplaceSheetDataOptions as XlsbReplaceSheetDataOptions, XlsbUpdater, XlsbWriter, XlsxUpdater as XlsmUpdater, XlsxReader, XlsxUpdater, XlsxWriter, applyHeaderWidths, assertCellTextLength, assertColumnCount, assertRowCount, assertRowFitsColumns, columnIndexToLetter, columnLetterToIndex, convertXlsbToXlsx, convertXlsxToXlsb, defaultColWidth, escapeXmlText, getFormat, initColWidths, isFormattedCell, parseSharedStringsXml, parseTagAttributes, resolveRelTarget, sanitizeSheetName, trimTrailingEmptyRows, unescapeXml, unwrapCell, updateColWidthsFromRows };
|
|
754
|
+
export { BiffReaderWriter, BigBuffer, type CellValue, type ExcelConversionOptions, ExcelReaderAbstract, F, type FormattedCell, INVALID_SHEET_NAME_CHARS, MAX_CELL_CHARS, MAX_COLS, MAX_ROWS, type PrimitiveCellValue, ReaderFactory, type ReplaceSheetDataOptions$1 as ReplaceSheetDataOptions, type RowSource$1 as RowSource, StreamingSheetState, XlsbReader, type ReplaceSheetDataOptions as XlsbReplaceSheetDataOptions, XlsbUpdater, XlsbWriter, XlsxUpdater as XlsmUpdater, XlsxReader, XlsxUpdater, XlsxWriter, applyHeaderWidths, assertCellTextLength, assertColumnCount, assertRowCount, assertRowFitsColumns, columnIndexToLetter, columnLetterToIndex, convertXlsbToXlsx, convertXlsxToXlsb, defaultColWidth, escapeXlsxText, escapeXmlText, getFormat, initColWidths, isFormattedCell, parseSharedStringsXml, parseTagAttributes, resolveRelTarget, sanitizeSheetName, trimTrailingEmptyRows, unescapeXml, unescapeXmlText, unwrapCell, updateColWidthsFromRows };
|