@cj-tech-master/excelts 4.2.1-canary.20260111102127.f808a37 → 4.2.1-canary.20260112134913.a3cecdd
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/dist/browser/modules/archive/io/archive-sink.d.ts +0 -1
- package/dist/browser/modules/archive/io/archive-sink.js +6 -38
- package/dist/browser/modules/archive/io/archive-source.d.ts +0 -2
- package/dist/browser/modules/archive/io/archive-source.js +1 -8
- package/dist/browser/modules/excel/utils/ooxml-validator.d.ts +48 -0
- package/dist/browser/modules/excel/utils/ooxml-validator.js +469 -0
- package/dist/browser/modules/excel/worksheet.js +5 -2
- package/dist/browser/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.d.ts +1 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.js +13 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/sp-xform.d.ts +18 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/sp-xform.js +112 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +6 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +30 -2
- package/dist/browser/modules/excel/xlsx/xform/drawing/vml-drawing-xform.js +11 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/page-setup-xform.d.ts +1 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/page-setup-xform.js +16 -2
- package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +110 -12
- package/dist/browser/modules/stream/base-transform.d.ts +3 -0
- package/dist/browser/modules/stream/base-transform.js +34 -20
- package/dist/browser/modules/stream/buffered-stream.d.ts +2 -12
- package/dist/browser/modules/stream/chunked-builder.js +4 -4
- package/dist/browser/modules/stream/index.browser.d.ts +13 -19
- package/dist/browser/modules/stream/index.browser.js +10 -22
- package/dist/browser/modules/stream/index.d.ts +18 -41
- package/dist/browser/modules/stream/index.js +15 -44
- package/dist/browser/modules/stream/internal/event-utils.d.ts +17 -0
- package/dist/browser/modules/stream/internal/event-utils.js +40 -0
- package/dist/browser/modules/stream/internal/type-guards.d.ts +9 -0
- package/dist/browser/modules/stream/internal/type-guards.js +24 -0
- package/dist/browser/modules/stream/pull-stream.d.ts +5 -6
- package/dist/browser/modules/stream/pull-stream.js +107 -43
- package/dist/browser/modules/stream/shared.d.ts +1 -1
- package/dist/browser/modules/stream/shared.js +7 -4
- package/dist/browser/modules/stream/streams.browser.d.ts +4 -14
- package/dist/browser/modules/stream/streams.browser.js +129 -164
- package/dist/browser/modules/stream/streams.d.ts +4 -20
- package/dist/browser/modules/stream/streams.js +6 -37
- package/dist/browser/modules/stream/utils.js +5 -38
- package/dist/cjs/modules/archive/io/archive-sink.js +7 -40
- package/dist/cjs/modules/archive/io/archive-source.js +3 -12
- package/dist/cjs/modules/excel/utils/ooxml-validator.js +475 -0
- package/dist/cjs/modules/excel/worksheet.js +5 -2
- package/dist/cjs/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.js +13 -1
- package/dist/cjs/modules/excel/xlsx/xform/drawing/sp-xform.js +115 -0
- package/dist/cjs/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +30 -2
- package/dist/cjs/modules/excel/xlsx/xform/drawing/vml-drawing-xform.js +11 -0
- package/dist/cjs/modules/excel/xlsx/xform/sheet/page-setup-xform.js +16 -2
- package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +110 -12
- package/dist/cjs/modules/stream/base-transform.js +34 -20
- package/dist/cjs/modules/stream/chunked-builder.js +4 -4
- package/dist/cjs/modules/stream/index.browser.js +10 -17
- package/dist/cjs/modules/stream/index.js +15 -39
- package/dist/cjs/modules/stream/internal/event-utils.js +43 -0
- package/dist/cjs/modules/stream/internal/type-guards.js +30 -0
- package/dist/cjs/modules/stream/pull-stream.js +107 -43
- package/dist/cjs/modules/stream/shared.js +7 -4
- package/dist/cjs/modules/stream/streams.browser.js +135 -175
- package/dist/cjs/modules/stream/streams.js +16 -49
- package/dist/cjs/modules/stream/utils.js +3 -36
- package/dist/esm/modules/archive/io/archive-sink.js +6 -38
- package/dist/esm/modules/archive/io/archive-source.js +1 -8
- package/dist/esm/modules/excel/utils/ooxml-validator.js +469 -0
- package/dist/esm/modules/excel/worksheet.js +5 -2
- package/dist/esm/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.js +13 -1
- package/dist/esm/modules/excel/xlsx/xform/drawing/sp-xform.js +112 -0
- package/dist/esm/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +30 -2
- package/dist/esm/modules/excel/xlsx/xform/drawing/vml-drawing-xform.js +11 -0
- package/dist/esm/modules/excel/xlsx/xform/sheet/page-setup-xform.js +16 -2
- package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +110 -12
- package/dist/esm/modules/stream/base-transform.js +34 -20
- package/dist/esm/modules/stream/chunked-builder.js +4 -4
- package/dist/esm/modules/stream/index.browser.js +10 -22
- package/dist/esm/modules/stream/index.js +15 -44
- package/dist/esm/modules/stream/internal/event-utils.js +40 -0
- package/dist/esm/modules/stream/internal/type-guards.js +24 -0
- package/dist/esm/modules/stream/pull-stream.js +107 -43
- package/dist/esm/modules/stream/shared.js +7 -4
- package/dist/esm/modules/stream/streams.browser.js +129 -164
- package/dist/esm/modules/stream/streams.js +6 -37
- package/dist/esm/modules/stream/utils.js +5 -38
- package/dist/iife/excelts.iife.js +325 -60
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +25 -25
- package/dist/types/modules/archive/io/archive-sink.d.ts +0 -1
- package/dist/types/modules/archive/io/archive-source.d.ts +0 -2
- package/dist/types/modules/excel/utils/ooxml-validator.d.ts +48 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.d.ts +1 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/sp-xform.d.ts +18 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +6 -1
- package/dist/types/modules/excel/xlsx/xform/sheet/page-setup-xform.d.ts +1 -0
- package/dist/types/modules/stream/base-transform.d.ts +3 -0
- package/dist/types/modules/stream/buffered-stream.d.ts +2 -12
- package/dist/types/modules/stream/index.browser.d.ts +13 -19
- package/dist/types/modules/stream/index.d.ts +18 -41
- package/dist/types/modules/stream/internal/event-utils.d.ts +17 -0
- package/dist/types/modules/stream/internal/type-guards.d.ts +9 -0
- package/dist/types/modules/stream/pull-stream.d.ts +5 -6
- package/dist/types/modules/stream/shared.d.ts +1 -1
- package/dist/types/modules/stream/streams.browser.d.ts +4 -14
- package/dist/types/modules/stream/streams.d.ts +4 -20
- package/package.json +10 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @cj-tech-master/excelts v4.2.1-canary.
|
|
2
|
+
* @cj-tech-master/excelts v4.2.1-canary.20260112134913.a3cecdd
|
|
3
3
|
* TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.
|
|
4
4
|
* (c) 2026 cjnoname
|
|
5
5
|
* Released under the MIT License
|
|
@@ -3303,12 +3303,15 @@ var ExcelTS = (function(exports) {
|
|
|
3303
3303
|
/**
|
|
3304
3304
|
* Concatenate multiple Uint8Arrays efficiently
|
|
3305
3305
|
*/
|
|
3306
|
-
function concatUint8Arrays$2(arrays) {
|
|
3306
|
+
function concatUint8Arrays$2(arrays, totalLength) {
|
|
3307
3307
|
const len = arrays.length;
|
|
3308
3308
|
if (len === 0) return new Uint8Array(0);
|
|
3309
3309
|
if (len === 1) return arrays[0];
|
|
3310
|
-
|
|
3311
|
-
|
|
3310
|
+
if (totalLength === void 0) {
|
|
3311
|
+
let sum = 0;
|
|
3312
|
+
for (let i = 0; i < len; i++) sum += arrays[i].length;
|
|
3313
|
+
totalLength = sum;
|
|
3314
|
+
}
|
|
3312
3315
|
const result = new Uint8Array(totalLength);
|
|
3313
3316
|
let offset = 0;
|
|
3314
3317
|
for (let i = 0; i < len; i++) {
|
|
@@ -3319,6 +3322,26 @@ var ExcelTS = (function(exports) {
|
|
|
3319
3322
|
return result;
|
|
3320
3323
|
}
|
|
3321
3324
|
|
|
3325
|
+
//#endregion
|
|
3326
|
+
//#region src/modules/stream/internal/type-guards.ts
|
|
3327
|
+
/**
|
|
3328
|
+
* Lightweight runtime type guards shared across modules.
|
|
3329
|
+
*
|
|
3330
|
+
* Keep this file dependency-free to maximize deduping in bundled builds.
|
|
3331
|
+
*/
|
|
3332
|
+
function isReadableStream(value) {
|
|
3333
|
+
return !!value && typeof value === "object" && typeof value.getReader === "function";
|
|
3334
|
+
}
|
|
3335
|
+
function isWritableStream(value) {
|
|
3336
|
+
return !!value && typeof value === "object" && typeof value.getWriter === "function";
|
|
3337
|
+
}
|
|
3338
|
+
function isAsyncIterable(value) {
|
|
3339
|
+
return !!value && (typeof value === "object" || typeof value === "function") && typeof value[Symbol.asyncIterator] === "function";
|
|
3340
|
+
}
|
|
3341
|
+
function isTransformStream(value) {
|
|
3342
|
+
return !!value && typeof value === "object" && !!value.readable && !!value.writable && isReadableStream(value.readable) && isWritableStream(value.writable);
|
|
3343
|
+
}
|
|
3344
|
+
|
|
3322
3345
|
//#endregion
|
|
3323
3346
|
//#region src/modules/stream/streams.browser.ts
|
|
3324
3347
|
const removeEmitterListener = (emitter, event, listener) => {
|
|
@@ -5128,9 +5151,6 @@ var ExcelTS = (function(exports) {
|
|
|
5128
5151
|
});
|
|
5129
5152
|
}
|
|
5130
5153
|
};
|
|
5131
|
-
const isReadableStream$1 = (value) => !!value && typeof value === "object" && typeof value.getReader === "function";
|
|
5132
|
-
const isWritableStream$1 = (value) => !!value && typeof value === "object" && typeof value.getWriter === "function";
|
|
5133
|
-
const isTransformStream = (value) => !!value && typeof value === "object" && !!value.readable && !!value.writable && isReadableStream$1(value.readable) && isWritableStream$1(value.writable);
|
|
5134
5154
|
const isPipelineOptions = (value) => {
|
|
5135
5155
|
if (!value || typeof value !== "object") return false;
|
|
5136
5156
|
if (typeof value.pipe === "function" || typeof value.write === "function" || typeof value.end === "function" || typeof value.getReader === "function" || typeof value.getWriter === "function") return false;
|
|
@@ -5139,8 +5159,8 @@ var ExcelTS = (function(exports) {
|
|
|
5139
5159
|
const toBrowserPipelineStream = (stream) => {
|
|
5140
5160
|
if (stream instanceof Readable || stream instanceof Writable || stream instanceof Transform || stream instanceof Duplex) return stream;
|
|
5141
5161
|
if (isTransformStream(stream)) return Transform.fromWeb(stream);
|
|
5142
|
-
if (isReadableStream
|
|
5143
|
-
if (isWritableStream
|
|
5162
|
+
if (isReadableStream(stream)) return Readable.fromWeb(stream);
|
|
5163
|
+
if (isWritableStream(stream)) return Writable.fromWeb(stream);
|
|
5144
5164
|
return stream;
|
|
5145
5165
|
};
|
|
5146
5166
|
/**
|
|
@@ -5568,8 +5588,8 @@ var ExcelTS = (function(exports) {
|
|
|
5568
5588
|
footer: .3
|
|
5569
5589
|
},
|
|
5570
5590
|
orientation: "portrait",
|
|
5571
|
-
horizontalDpi:
|
|
5572
|
-
verticalDpi:
|
|
5591
|
+
horizontalDpi: void 0,
|
|
5592
|
+
verticalDpi: void 0,
|
|
5573
5593
|
fitToPage: !!(options.pageSetup && (options.pageSetup.fitToWidth || options.pageSetup.fitToHeight) && !options.pageSetup.scale),
|
|
5574
5594
|
pageOrder: "downThenOver",
|
|
5575
5595
|
blackAndWhite: false,
|
|
@@ -12295,13 +12315,19 @@ var ExcelTS = (function(exports) {
|
|
|
12295
12315
|
get tag() {
|
|
12296
12316
|
return "pageSetup";
|
|
12297
12317
|
}
|
|
12318
|
+
_dpiToXml(value) {
|
|
12319
|
+
if (value === void 0) return;
|
|
12320
|
+
if (!Number.isFinite(value)) return;
|
|
12321
|
+
if (value === 4294967295) return;
|
|
12322
|
+
return value;
|
|
12323
|
+
}
|
|
12298
12324
|
render(xmlStream, model) {
|
|
12299
12325
|
if (model) {
|
|
12300
12326
|
const attributes = {
|
|
12301
12327
|
paperSize: model.paperSize,
|
|
12302
12328
|
orientation: model.orientation,
|
|
12303
|
-
horizontalDpi: model.horizontalDpi,
|
|
12304
|
-
verticalDpi: model.verticalDpi,
|
|
12329
|
+
horizontalDpi: this._dpiToXml(model.horizontalDpi),
|
|
12330
|
+
verticalDpi: this._dpiToXml(model.verticalDpi),
|
|
12305
12331
|
pageOrder: pageOrderToXml(model.pageOrder),
|
|
12306
12332
|
blackAndWhite: booleanToXml$1(model.blackAndWhite),
|
|
12307
12333
|
draft: booleanToXml$1(model.draft),
|
|
@@ -13797,6 +13823,9 @@ var ExcelTS = (function(exports) {
|
|
|
13797
13823
|
options.merges = new Merges();
|
|
13798
13824
|
model.hyperlinks = options.hyperlinks = [];
|
|
13799
13825
|
model.comments = options.comments = [];
|
|
13826
|
+
if (model.formControls && model.formControls.length > 0) {
|
|
13827
|
+
if (!model.views || model.views.length === 0) model.views = [{ workbookViewId: 0 }];
|
|
13828
|
+
}
|
|
13800
13829
|
options.formulae = {};
|
|
13801
13830
|
options.siFormulae = 0;
|
|
13802
13831
|
this.map.cols.prepare(model.cols, options);
|
|
@@ -13921,11 +13950,32 @@ var ExcelTS = (function(exports) {
|
|
|
13921
13950
|
});
|
|
13922
13951
|
});
|
|
13923
13952
|
if (model.formControls && model.formControls.length > 0) {
|
|
13953
|
+
let { drawing } = model;
|
|
13954
|
+
if (!drawing) {
|
|
13955
|
+
drawing = model.drawing = {
|
|
13956
|
+
rId: nextRid(rels),
|
|
13957
|
+
name: `drawing${++options.drawingsCount}`,
|
|
13958
|
+
anchors: [],
|
|
13959
|
+
rels: []
|
|
13960
|
+
};
|
|
13961
|
+
options.drawings.push(drawing);
|
|
13962
|
+
rels.push({
|
|
13963
|
+
Id: drawing.rId,
|
|
13964
|
+
Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
|
|
13965
|
+
Target: drawingRelTargetFromWorksheet(drawing.name)
|
|
13966
|
+
});
|
|
13967
|
+
}
|
|
13924
13968
|
if (model.comments.length === 0) rels.push({
|
|
13925
13969
|
Id: nextRid(rels),
|
|
13926
13970
|
Type: RelType.VmlDrawing,
|
|
13927
13971
|
Target: vmlDrawingRelTargetFromWorksheet(model.id)
|
|
13928
13972
|
});
|
|
13973
|
+
const toNativePos = (p) => ({
|
|
13974
|
+
nativeCol: p.col,
|
|
13975
|
+
nativeColOff: p.colOff,
|
|
13976
|
+
nativeRow: p.row,
|
|
13977
|
+
nativeRowOff: p.rowOff
|
|
13978
|
+
});
|
|
13929
13979
|
for (const control of model.formControls) {
|
|
13930
13980
|
const globalCtrlPropId = options.formControlRefs.length + 1;
|
|
13931
13981
|
control.ctrlPropId = globalCtrlPropId;
|
|
@@ -13937,13 +13987,35 @@ var ExcelTS = (function(exports) {
|
|
|
13937
13987
|
Target: ctrlPropRelTargetFromWorksheet(globalCtrlPropId)
|
|
13938
13988
|
});
|
|
13939
13989
|
options.formControlRefs.push(globalCtrlPropId);
|
|
13990
|
+
const defaultName = `Check Box ${Math.max(1, control.shapeId - 1024)}`;
|
|
13991
|
+
drawing.anchors.push({
|
|
13992
|
+
range: {
|
|
13993
|
+
editAs: "absolute",
|
|
13994
|
+
tl: toNativePos(control.tl),
|
|
13995
|
+
br: toNativePos(control.br)
|
|
13996
|
+
},
|
|
13997
|
+
alternateContent: { requires: "a14" },
|
|
13998
|
+
shape: {
|
|
13999
|
+
cNvPrId: control.shapeId,
|
|
14000
|
+
name: control.name || defaultName,
|
|
14001
|
+
hidden: true,
|
|
14002
|
+
spid: `_x0000_s${control.shapeId}`,
|
|
14003
|
+
text: control.text
|
|
14004
|
+
}
|
|
14005
|
+
});
|
|
13940
14006
|
}
|
|
13941
14007
|
}
|
|
13942
14008
|
this.map.extLst.prepare(model, options);
|
|
13943
14009
|
}
|
|
13944
14010
|
render(xmlStream, model) {
|
|
13945
14011
|
xmlStream.openXml(XmlStream.StdDocAttributes);
|
|
13946
|
-
|
|
14012
|
+
const worksheetAttrs = { ...WorkSheetXform.WORKSHEET_ATTRIBUTES };
|
|
14013
|
+
if (model.formControls && model.formControls.length > 0) {
|
|
14014
|
+
worksheetAttrs["xmlns:x14"] = "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main";
|
|
14015
|
+
worksheetAttrs["xmlns:xdr"] = "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing";
|
|
14016
|
+
worksheetAttrs["mc:Ignorable"] = `${worksheetAttrs["mc:Ignorable"]} x14`;
|
|
14017
|
+
}
|
|
14018
|
+
xmlStream.openNode("worksheet", worksheetAttrs);
|
|
13947
14019
|
const sheetFormatPropertiesModel = model.properties ? {
|
|
13948
14020
|
defaultRowHeight: model.properties.defaultRowHeight,
|
|
13949
14021
|
dyDescent: model.properties.dyDescent,
|
|
@@ -13984,18 +14056,57 @@ var ExcelTS = (function(exports) {
|
|
|
13984
14056
|
this.map.colBreaks.render(xmlStream, model.colBreaks);
|
|
13985
14057
|
this.map.drawing.render(xmlStream, model.drawing);
|
|
13986
14058
|
this.map.picture.render(xmlStream, model.background);
|
|
13987
|
-
|
|
14059
|
+
if (model.rels) model.rels.forEach((rel) => {
|
|
14060
|
+
if (rel.Type === RelType.VmlDrawing) xmlStream.leafNode("legacyDrawing", { "r:id": rel.Id });
|
|
14061
|
+
});
|
|
13988
14062
|
if (model.formControls && model.formControls.length > 0) {
|
|
14063
|
+
xmlStream.openNode("mc:AlternateContent");
|
|
14064
|
+
xmlStream.openNode("mc:Choice", { Requires: "x14" });
|
|
13989
14065
|
xmlStream.openNode("controls");
|
|
13990
|
-
for (const control of model.formControls)
|
|
13991
|
-
|
|
13992
|
-
|
|
13993
|
-
|
|
14066
|
+
for (const control of model.formControls) {
|
|
14067
|
+
if (!control.ctrlPropRelId) continue;
|
|
14068
|
+
const defaultName = `Check Box ${Math.max(1, control.shapeId - 1024)}`;
|
|
14069
|
+
xmlStream.openNode("mc:AlternateContent");
|
|
14070
|
+
xmlStream.openNode("mc:Choice", { Requires: "x14" });
|
|
14071
|
+
xmlStream.openNode("control", {
|
|
14072
|
+
shapeId: control.shapeId,
|
|
14073
|
+
"r:id": control.ctrlPropRelId,
|
|
14074
|
+
name: control.name || defaultName
|
|
14075
|
+
});
|
|
14076
|
+
xmlStream.openNode("controlPr", {
|
|
14077
|
+
locked: 0,
|
|
14078
|
+
defaultSize: 0,
|
|
14079
|
+
print: control.print ? 1 : 0,
|
|
14080
|
+
autoFill: 0,
|
|
14081
|
+
autoLine: 0,
|
|
14082
|
+
autoPict: 0
|
|
14083
|
+
});
|
|
14084
|
+
xmlStream.openNode("anchor");
|
|
14085
|
+
xmlStream.openNode("from");
|
|
14086
|
+
xmlStream.leafNode("xdr:col", void 0, control.tl.col);
|
|
14087
|
+
xmlStream.leafNode("xdr:colOff", void 0, control.tl.colOff);
|
|
14088
|
+
xmlStream.leafNode("xdr:row", void 0, control.tl.row);
|
|
14089
|
+
xmlStream.leafNode("xdr:rowOff", void 0, control.tl.rowOff);
|
|
14090
|
+
xmlStream.closeNode();
|
|
14091
|
+
xmlStream.openNode("to");
|
|
14092
|
+
xmlStream.leafNode("xdr:col", void 0, control.br.col);
|
|
14093
|
+
xmlStream.leafNode("xdr:colOff", void 0, control.br.colOff);
|
|
14094
|
+
xmlStream.leafNode("xdr:row", void 0, control.br.row);
|
|
14095
|
+
xmlStream.leafNode("xdr:rowOff", void 0, control.br.rowOff);
|
|
14096
|
+
xmlStream.closeNode();
|
|
14097
|
+
xmlStream.closeNode();
|
|
14098
|
+
xmlStream.closeNode();
|
|
14099
|
+
xmlStream.closeNode();
|
|
14100
|
+
xmlStream.closeNode();
|
|
14101
|
+
xmlStream.leafNode("mc:Fallback");
|
|
14102
|
+
xmlStream.closeNode();
|
|
14103
|
+
}
|
|
14104
|
+
xmlStream.closeNode();
|
|
14105
|
+
xmlStream.closeNode();
|
|
14106
|
+
xmlStream.leafNode("mc:Fallback");
|
|
13994
14107
|
xmlStream.closeNode();
|
|
13995
14108
|
}
|
|
13996
|
-
|
|
13997
|
-
if (rel.Type === RelType.VmlDrawing) xmlStream.leafNode("legacyDrawing", { "r:id": rel.Id });
|
|
13998
|
-
});
|
|
14109
|
+
this.map.tableParts.render(xmlStream, model.tables);
|
|
13999
14110
|
this.map.extLst.render(xmlStream, model);
|
|
14000
14111
|
xmlStream.closeNode();
|
|
14001
14112
|
}
|
|
@@ -14640,6 +14751,134 @@ var ExcelTS = (function(exports) {
|
|
|
14640
14751
|
}
|
|
14641
14752
|
};
|
|
14642
14753
|
|
|
14754
|
+
//#endregion
|
|
14755
|
+
//#region src/modules/excel/xlsx/xform/drawing/sp-xform.ts
|
|
14756
|
+
var SpXform = class extends BaseXform {
|
|
14757
|
+
get tag() {
|
|
14758
|
+
return "xdr:sp";
|
|
14759
|
+
}
|
|
14760
|
+
render(xmlStream, model) {
|
|
14761
|
+
if (!model) return;
|
|
14762
|
+
xmlStream.openNode(this.tag, {
|
|
14763
|
+
macro: "",
|
|
14764
|
+
textlink: ""
|
|
14765
|
+
});
|
|
14766
|
+
xmlStream.openNode("xdr:nvSpPr");
|
|
14767
|
+
xmlStream.openNode("xdr:cNvPr", {
|
|
14768
|
+
id: model.cNvPrId,
|
|
14769
|
+
name: model.name,
|
|
14770
|
+
hidden: model.hidden ? "1" : void 0
|
|
14771
|
+
});
|
|
14772
|
+
xmlStream.openNode("a:extLst");
|
|
14773
|
+
xmlStream.openNode("a:ext", { uri: "{63B3BB69-23CF-44E3-9099-C40C66FF867C}" });
|
|
14774
|
+
xmlStream.leafNode("a14:compatExt", {
|
|
14775
|
+
spid: model.spid,
|
|
14776
|
+
"xmlns:a14": "http://schemas.microsoft.com/office/drawing/2010/main"
|
|
14777
|
+
}, void 0);
|
|
14778
|
+
xmlStream.closeNode();
|
|
14779
|
+
xmlStream.closeNode();
|
|
14780
|
+
xmlStream.closeNode();
|
|
14781
|
+
xmlStream.leafNode("xdr:cNvSpPr");
|
|
14782
|
+
xmlStream.closeNode();
|
|
14783
|
+
xmlStream.openNode("xdr:spPr", { bwMode: "auto" });
|
|
14784
|
+
xmlStream.openNode("a:xfrm");
|
|
14785
|
+
xmlStream.leafNode("a:off", {
|
|
14786
|
+
x: 0,
|
|
14787
|
+
y: 0
|
|
14788
|
+
});
|
|
14789
|
+
xmlStream.leafNode("a:ext", {
|
|
14790
|
+
cx: 0,
|
|
14791
|
+
cy: 0
|
|
14792
|
+
});
|
|
14793
|
+
xmlStream.closeNode();
|
|
14794
|
+
xmlStream.openNode("a:prstGeom", { prst: "rect" });
|
|
14795
|
+
xmlStream.leafNode("a:avLst");
|
|
14796
|
+
xmlStream.closeNode();
|
|
14797
|
+
xmlStream.leafNode("a:noFill");
|
|
14798
|
+
xmlStream.openNode("a:ln");
|
|
14799
|
+
xmlStream.leafNode("a:noFill");
|
|
14800
|
+
xmlStream.closeNode();
|
|
14801
|
+
xmlStream.openNode("a:extLst");
|
|
14802
|
+
xmlStream.openNode("a:ext", { uri: "{909E8E84-426E-40DD-AFC4-6F175D3DCCD1}" });
|
|
14803
|
+
xmlStream.openNode("a14:hiddenFill", { "xmlns:a14": "http://schemas.microsoft.com/office/drawing/2010/main" });
|
|
14804
|
+
xmlStream.openNode("a:solidFill");
|
|
14805
|
+
xmlStream.leafNode("a:srgbClr", { val: "F0F0F0" });
|
|
14806
|
+
xmlStream.closeNode();
|
|
14807
|
+
xmlStream.closeNode();
|
|
14808
|
+
xmlStream.closeNode();
|
|
14809
|
+
xmlStream.openNode("a:ext", { uri: "{91240B29-F687-4F45-9708-019B960494DF}" });
|
|
14810
|
+
xmlStream.openNode("a14:hiddenLine", {
|
|
14811
|
+
w: 9525,
|
|
14812
|
+
"xmlns:a14": "http://schemas.microsoft.com/office/drawing/2010/main"
|
|
14813
|
+
});
|
|
14814
|
+
xmlStream.openNode("a:solidFill");
|
|
14815
|
+
xmlStream.leafNode("a:srgbClr", { val: "000000" });
|
|
14816
|
+
xmlStream.closeNode();
|
|
14817
|
+
xmlStream.leafNode("a:miter", { lim: 8e5 });
|
|
14818
|
+
xmlStream.leafNode("a:headEnd");
|
|
14819
|
+
xmlStream.leafNode("a:tailEnd");
|
|
14820
|
+
xmlStream.closeNode();
|
|
14821
|
+
xmlStream.closeNode();
|
|
14822
|
+
xmlStream.closeNode();
|
|
14823
|
+
xmlStream.closeNode();
|
|
14824
|
+
xmlStream.openNode("xdr:txBody");
|
|
14825
|
+
xmlStream.leafNode("a:bodyPr", {
|
|
14826
|
+
vertOverflow: "clip",
|
|
14827
|
+
wrap: "square",
|
|
14828
|
+
lIns: 18288,
|
|
14829
|
+
tIns: 18288,
|
|
14830
|
+
rIns: 0,
|
|
14831
|
+
bIns: 18288,
|
|
14832
|
+
anchor: "ctr",
|
|
14833
|
+
upright: 1
|
|
14834
|
+
});
|
|
14835
|
+
xmlStream.leafNode("a:lstStyle");
|
|
14836
|
+
xmlStream.openNode("a:p");
|
|
14837
|
+
xmlStream.openNode("a:pPr", {
|
|
14838
|
+
algn: "l",
|
|
14839
|
+
rtl: 0
|
|
14840
|
+
});
|
|
14841
|
+
xmlStream.leafNode("a:defRPr", { sz: 1e3 });
|
|
14842
|
+
xmlStream.closeNode();
|
|
14843
|
+
xmlStream.openNode("a:r");
|
|
14844
|
+
xmlStream.openNode("a:rPr", {
|
|
14845
|
+
lang: "en-US",
|
|
14846
|
+
sz: 800,
|
|
14847
|
+
b: 0,
|
|
14848
|
+
i: 0,
|
|
14849
|
+
u: "none",
|
|
14850
|
+
strike: "noStrike",
|
|
14851
|
+
baseline: 0
|
|
14852
|
+
});
|
|
14853
|
+
xmlStream.openNode("a:solidFill");
|
|
14854
|
+
xmlStream.leafNode("a:srgbClr", { val: "000000" });
|
|
14855
|
+
xmlStream.closeNode();
|
|
14856
|
+
xmlStream.leafNode("a:latin", {
|
|
14857
|
+
typeface: "Tahoma",
|
|
14858
|
+
pitchFamily: 2,
|
|
14859
|
+
charset: 0
|
|
14860
|
+
});
|
|
14861
|
+
xmlStream.leafNode("a:ea", {
|
|
14862
|
+
typeface: "Tahoma",
|
|
14863
|
+
pitchFamily: 2,
|
|
14864
|
+
charset: 0
|
|
14865
|
+
});
|
|
14866
|
+
xmlStream.leafNode("a:cs", {
|
|
14867
|
+
typeface: "Tahoma",
|
|
14868
|
+
pitchFamily: 2,
|
|
14869
|
+
charset: 0
|
|
14870
|
+
});
|
|
14871
|
+
xmlStream.closeNode();
|
|
14872
|
+
xmlStream.openNode("a:t");
|
|
14873
|
+
xmlStream.writeText(model.text ?? "");
|
|
14874
|
+
xmlStream.closeNode();
|
|
14875
|
+
xmlStream.closeNode();
|
|
14876
|
+
xmlStream.closeNode();
|
|
14877
|
+
xmlStream.closeNode();
|
|
14878
|
+
xmlStream.closeNode();
|
|
14879
|
+
}
|
|
14880
|
+
};
|
|
14881
|
+
|
|
14643
14882
|
//#endregion
|
|
14644
14883
|
//#region src/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.ts
|
|
14645
14884
|
var TwoCellAnchorXform = class extends BaseCellAnchorXform {
|
|
@@ -14649,6 +14888,7 @@ var ExcelTS = (function(exports) {
|
|
|
14649
14888
|
"xdr:from": new CellPositionXform({ tag: "xdr:from" }),
|
|
14650
14889
|
"xdr:to": new CellPositionXform({ tag: "xdr:to" }),
|
|
14651
14890
|
"xdr:pic": new PicXform(),
|
|
14891
|
+
"xdr:sp": new SpXform(),
|
|
14652
14892
|
"xdr:clientData": new StaticXform({ tag: "xdr:clientData" })
|
|
14653
14893
|
};
|
|
14654
14894
|
}
|
|
@@ -14656,15 +14896,29 @@ var ExcelTS = (function(exports) {
|
|
|
14656
14896
|
return "xdr:twoCellAnchor";
|
|
14657
14897
|
}
|
|
14658
14898
|
prepare(model, options) {
|
|
14659
|
-
this.map["xdr:pic"].prepare(model.picture, options);
|
|
14899
|
+
if (model.picture) this.map["xdr:pic"].prepare(model.picture, options);
|
|
14660
14900
|
}
|
|
14661
14901
|
render(xmlStream, model) {
|
|
14902
|
+
const wrapAlternateContent = !!model.alternateContent;
|
|
14903
|
+
if (wrapAlternateContent) {
|
|
14904
|
+
xmlStream.openNode("mc:AlternateContent", { "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006" });
|
|
14905
|
+
xmlStream.openNode("mc:Choice", {
|
|
14906
|
+
Requires: model.alternateContent?.requires,
|
|
14907
|
+
...model.alternateContent?.requires === "a14" ? { "xmlns:a14": "http://schemas.microsoft.com/office/drawing/2010/main" } : {}
|
|
14908
|
+
});
|
|
14909
|
+
}
|
|
14662
14910
|
xmlStream.openNode(this.tag, { editAs: model.range.editAs || "oneCell" });
|
|
14663
14911
|
this.map["xdr:from"].render(xmlStream, model.range.tl);
|
|
14664
14912
|
this.map["xdr:to"].render(xmlStream, model.range.br);
|
|
14665
|
-
this.map["xdr:pic"].render(xmlStream, model.picture);
|
|
14913
|
+
if (model.picture) this.map["xdr:pic"].render(xmlStream, model.picture);
|
|
14914
|
+
else if (model.shape) this.map["xdr:sp"].render(xmlStream, model.shape);
|
|
14666
14915
|
this.map["xdr:clientData"].render(xmlStream, {});
|
|
14667
14916
|
xmlStream.closeNode();
|
|
14917
|
+
if (wrapAlternateContent) {
|
|
14918
|
+
xmlStream.closeNode();
|
|
14919
|
+
xmlStream.leafNode("mc:Fallback");
|
|
14920
|
+
xmlStream.closeNode();
|
|
14921
|
+
}
|
|
14668
14922
|
}
|
|
14669
14923
|
parseClose(name) {
|
|
14670
14924
|
if (this.parser) {
|
|
@@ -16756,16 +17010,23 @@ var ExcelTS = (function(exports) {
|
|
|
16756
17010
|
xmlStream.closeNode();
|
|
16757
17011
|
}
|
|
16758
17012
|
xmlStream.openNode("x:ClientData", { ObjectType: "Checkbox" });
|
|
17013
|
+
xmlStream.leafNode("x:MoveWithCells");
|
|
17014
|
+
xmlStream.leafNode("x:SizeWithCells");
|
|
16759
17015
|
xmlStream.openNode("x:Anchor");
|
|
16760
17016
|
xmlStream.writeText(FormCheckbox.getVmlAnchor(control));
|
|
16761
17017
|
xmlStream.closeNode();
|
|
17018
|
+
xmlStream.leafNode("x:Locked", void 0, "False");
|
|
17019
|
+
xmlStream.leafNode("x:LockText", void 0, "True");
|
|
16762
17020
|
xmlStream.leafNode("x:PrintObject", void 0, control.print ? "True" : "False");
|
|
16763
17021
|
xmlStream.leafNode("x:AutoFill", void 0, "False");
|
|
16764
17022
|
xmlStream.leafNode("x:AutoLine", void 0, "False");
|
|
17023
|
+
xmlStream.leafNode("x:TextHAlign", void 0, "Left");
|
|
16765
17024
|
xmlStream.leafNode("x:TextVAlign", void 0, "Center");
|
|
16766
17025
|
if (control.link) xmlStream.leafNode("x:FmlaLink", void 0, control.link);
|
|
16767
17026
|
if (control.noThreeD) xmlStream.leafNode("x:NoThreeD");
|
|
16768
17027
|
xmlStream.leafNode("x:Checked", void 0, String(FormCheckbox.getVmlCheckedValue(control)));
|
|
17028
|
+
xmlStream.leafNode("x:Row", void 0, String(control.tl.row));
|
|
17029
|
+
xmlStream.leafNode("x:Column", void 0, String(control.tl.col));
|
|
16769
17030
|
xmlStream.closeNode();
|
|
16770
17031
|
xmlStream.closeNode();
|
|
16771
17032
|
}
|
|
@@ -16823,6 +17084,14 @@ var ExcelTS = (function(exports) {
|
|
|
16823
17084
|
* that stores its properties like objectType, checked state, and linked cell.
|
|
16824
17085
|
*/
|
|
16825
17086
|
var CtrlPropXform = class extends BaseXform {
|
|
17087
|
+
_checkedToXmlValue(checked) {
|
|
17088
|
+
switch (checked) {
|
|
17089
|
+
case "Checked": return "1";
|
|
17090
|
+
case "Mixed": return "2";
|
|
17091
|
+
case "Unchecked":
|
|
17092
|
+
default: return "0";
|
|
17093
|
+
}
|
|
17094
|
+
}
|
|
16826
17095
|
get tag() {
|
|
16827
17096
|
return "formControlPr";
|
|
16828
17097
|
}
|
|
@@ -16831,7 +17100,7 @@ var ExcelTS = (function(exports) {
|
|
|
16831
17100
|
const attrs = {
|
|
16832
17101
|
xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main",
|
|
16833
17102
|
objectType: "CheckBox",
|
|
16834
|
-
checked: renderModel.checked,
|
|
17103
|
+
checked: this._checkedToXmlValue(renderModel.checked),
|
|
16835
17104
|
lockText: "1"
|
|
16836
17105
|
};
|
|
16837
17106
|
if (renderModel.link) attrs.fmlaLink = renderModel.link;
|
|
@@ -18359,10 +18628,10 @@ var ExcelTS = (function(exports) {
|
|
|
18359
18628
|
}
|
|
18360
18629
|
/** Peek a little-endian uint32 at `offset` without consuming bytes. Returns null if not enough bytes. */
|
|
18361
18630
|
peekUint32LE(offset) {
|
|
18362
|
-
const off = offset | 0;
|
|
18363
|
-
if (off < 0 || off + 4 > this._length) return null;
|
|
18631
|
+
const off$1 = offset | 0;
|
|
18632
|
+
if (off$1 < 0 || off$1 + 4 > this._length) return null;
|
|
18364
18633
|
const chunks = this._chunks;
|
|
18365
|
-
let remaining = off;
|
|
18634
|
+
let remaining = off$1;
|
|
18366
18635
|
for (let i = 0; i < chunks.length; i++) {
|
|
18367
18636
|
const c = chunks[i];
|
|
18368
18637
|
const start = i === 0 ? this._headOffset : 0;
|
|
@@ -18403,9 +18672,9 @@ var ExcelTS = (function(exports) {
|
|
|
18403
18672
|
}
|
|
18404
18673
|
/** Peek a single byte at `offset` without consuming bytes. */
|
|
18405
18674
|
peekByte(offset) {
|
|
18406
|
-
const off = offset | 0;
|
|
18407
|
-
if (off < 0 || off >= this._length) throw new RangeError("ByteQueue: peek beyond available data");
|
|
18408
|
-
let remaining = off;
|
|
18675
|
+
const off$1 = offset | 0;
|
|
18676
|
+
if (off$1 < 0 || off$1 >= this._length) throw new RangeError("ByteQueue: peek beyond available data");
|
|
18677
|
+
let remaining = off$1;
|
|
18409
18678
|
for (let i = 0; i < this._chunks.length; i++) {
|
|
18410
18679
|
const c = this._chunks[i];
|
|
18411
18680
|
const start = i === 0 ? this._headOffset : 0;
|
|
@@ -21110,10 +21379,10 @@ var ExcelTS = (function(exports) {
|
|
|
21110
21379
|
}
|
|
21111
21380
|
};
|
|
21112
21381
|
function tzOffset(d) {
|
|
21113
|
-
const off = -d.getTimezoneOffset();
|
|
21114
|
-
const sign = off >= 0 ? "+" : "-";
|
|
21115
|
-
const h = Math.abs(off) / 60 | 0;
|
|
21116
|
-
const m = Math.abs(off) % 60;
|
|
21382
|
+
const off$1 = -d.getTimezoneOffset();
|
|
21383
|
+
const sign = off$1 >= 0 ? "+" : "-";
|
|
21384
|
+
const h = Math.abs(off$1) / 60 | 0;
|
|
21385
|
+
const m = Math.abs(off$1) % 60;
|
|
21117
21386
|
return `${sign}${PAD2[h]}:${PAD2[m]}`;
|
|
21118
21387
|
}
|
|
21119
21388
|
/**
|
|
@@ -26630,11 +26899,15 @@ onmessage = async (ev) => {
|
|
|
26630
26899
|
}
|
|
26631
26900
|
|
|
26632
26901
|
//#endregion
|
|
26633
|
-
//#region src/modules/
|
|
26634
|
-
function
|
|
26635
|
-
|
|
26902
|
+
//#region src/modules/stream/internal/event-utils.ts
|
|
26903
|
+
function off(emitter, event, listener) {
|
|
26904
|
+
if (typeof emitter.off === "function") emitter.off(event, listener);
|
|
26905
|
+
else if (typeof emitter.removeListener === "function") emitter.removeListener(event, listener);
|
|
26636
26906
|
}
|
|
26637
|
-
|
|
26907
|
+
/**
|
|
26908
|
+
* Resolve when an emitter fires `event`, reject on `error`.
|
|
26909
|
+
*/
|
|
26910
|
+
function onceEvent(emitter, event) {
|
|
26638
26911
|
return new Promise((resolve, reject) => {
|
|
26639
26912
|
const onError = (err) => {
|
|
26640
26913
|
cleanup();
|
|
@@ -26645,15 +26918,21 @@ onmessage = async (ev) => {
|
|
|
26645
26918
|
resolve();
|
|
26646
26919
|
};
|
|
26647
26920
|
const cleanup = () => {
|
|
26648
|
-
|
|
26649
|
-
|
|
26650
|
-
emitter.removeListener?.("error", onError);
|
|
26651
|
-
emitter.removeListener?.(event, onDone);
|
|
26921
|
+
off(emitter, "error", onError);
|
|
26922
|
+
off(emitter, event, onDone);
|
|
26652
26923
|
};
|
|
26924
|
+
if (typeof emitter.once === "function") {
|
|
26925
|
+
emitter.once("error", onError);
|
|
26926
|
+
emitter.once(event, onDone);
|
|
26927
|
+
return;
|
|
26928
|
+
}
|
|
26653
26929
|
emitter.on?.("error", onError);
|
|
26654
26930
|
emitter.on?.(event, onDone);
|
|
26655
26931
|
});
|
|
26656
26932
|
}
|
|
26933
|
+
|
|
26934
|
+
//#endregion
|
|
26935
|
+
//#region src/modules/archive/io/archive-sink.ts
|
|
26657
26936
|
async function pipeIterableToSink(iterable, sink) {
|
|
26658
26937
|
if (isWritableStream(sink)) {
|
|
26659
26938
|
const writer = sink.getWriter();
|
|
@@ -26667,9 +26946,9 @@ onmessage = async (ev) => {
|
|
|
26667
26946
|
}
|
|
26668
26947
|
return;
|
|
26669
26948
|
}
|
|
26670
|
-
for await (const chunk of iterable) if (sink.write(chunk) === false && typeof sink.once === "function") await
|
|
26949
|
+
for await (const chunk of iterable) if (sink.write(chunk) === false && typeof sink.once === "function") await onceEvent(sink, "drain");
|
|
26671
26950
|
if (typeof sink.end === "function") sink.end();
|
|
26672
|
-
if (typeof sink.once === "function") await Promise.race([
|
|
26951
|
+
if (typeof sink.once === "function") await Promise.race([onceEvent(sink, "finish"), onceEvent(sink, "close")]);
|
|
26673
26952
|
}
|
|
26674
26953
|
async function collect(iterable) {
|
|
26675
26954
|
const chunks = [];
|
|
@@ -26678,25 +26957,11 @@ onmessage = async (ev) => {
|
|
|
26678
26957
|
chunks.push(chunk);
|
|
26679
26958
|
total += chunk.length;
|
|
26680
26959
|
}
|
|
26681
|
-
|
|
26682
|
-
if (chunks.length === 1) return chunks[0];
|
|
26683
|
-
const out = new Uint8Array(total);
|
|
26684
|
-
let offset = 0;
|
|
26685
|
-
for (const chunk of chunks) {
|
|
26686
|
-
out.set(chunk, offset);
|
|
26687
|
-
offset += chunk.length;
|
|
26688
|
-
}
|
|
26689
|
-
return out;
|
|
26960
|
+
return concatUint8Arrays$2(chunks, total);
|
|
26690
26961
|
}
|
|
26691
26962
|
|
|
26692
26963
|
//#endregion
|
|
26693
26964
|
//#region src/modules/archive/io/archive-source.ts
|
|
26694
|
-
function isReadableStream(value) {
|
|
26695
|
-
return !!value && typeof value === "object" && typeof value.getReader === "function";
|
|
26696
|
-
}
|
|
26697
|
-
function isAsyncIterable(value) {
|
|
26698
|
-
return !!value && (typeof value === "object" || typeof value === "function") && typeof value[Symbol.asyncIterator] === "function";
|
|
26699
|
-
}
|
|
26700
26965
|
function normalizeChunk(value) {
|
|
26701
26966
|
if (!value) return null;
|
|
26702
26967
|
if (value instanceof Uint8Array) return value.length ? value : null;
|