@cj-tech-master/excelts 9.4.2 → 9.5.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/dist/browser/index.browser.d.ts +8 -5
- package/dist/browser/index.browser.js +19 -1
- package/dist/browser/index.d.ts +4 -2
- package/dist/browser/index.js +9 -1
- package/dist/browser/modules/excel/chart/cache-populator.d.ts +49 -0
- package/dist/browser/modules/excel/chart/cache-populator.js +1171 -0
- package/dist/browser/modules/excel/chart/chart-api.d.ts +92 -0
- package/dist/browser/modules/excel/chart/chart-api.js +364 -0
- package/dist/browser/modules/excel/chart/chart-builder.d.ts +48 -0
- package/dist/browser/modules/excel/chart/chart-builder.js +2432 -0
- package/dist/browser/modules/excel/chart/chart-ex-builder.d.ts +36 -0
- package/dist/browser/modules/excel/chart/chart-ex-builder.js +903 -0
- package/dist/browser/modules/excel/chart/chart-ex-parser.d.ts +8 -0
- package/dist/browser/modules/excel/chart/chart-ex-parser.js +1205 -0
- package/dist/browser/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
- package/dist/browser/modules/excel/chart/chart-ex-renderer.js +5352 -0
- package/dist/browser/modules/excel/chart/chart-ex-types.d.ts +531 -0
- package/dist/browser/modules/excel/chart/chart-ex-types.js +11 -0
- package/dist/browser/modules/excel/chart/chart-images.d.ts +78 -0
- package/dist/browser/modules/excel/chart/chart-images.js +363 -0
- package/dist/browser/modules/excel/chart/chart-presets.d.ts +392 -0
- package/dist/browser/modules/excel/chart/chart-presets.js +179 -0
- package/dist/browser/modules/excel/chart/chart-renderer.d.ts +550 -0
- package/dist/browser/modules/excel/chart/chart-renderer.js +6440 -0
- package/dist/browser/modules/excel/chart/chart-sidecar.d.ts +21 -0
- package/dist/browser/modules/excel/chart/chart-sidecar.js +427 -0
- package/dist/browser/modules/excel/chart/chart-utils.d.ts +306 -0
- package/dist/browser/modules/excel/chart/chart-utils.js +821 -0
- package/dist/browser/modules/excel/chart/chart.d.ts +504 -0
- package/dist/browser/modules/excel/chart/chart.js +1320 -0
- package/dist/browser/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
- package/dist/browser/modules/excel/chart/glyph-rasterizer.js +658 -0
- package/dist/browser/modules/excel/chart/index.d.ts +54 -0
- package/dist/browser/modules/excel/chart/index.js +46 -0
- package/dist/browser/modules/excel/chart/install.d.ts +44 -0
- package/dist/browser/modules/excel/chart/install.js +91 -0
- package/dist/browser/modules/excel/chart/shape-properties.d.ts +156 -0
- package/dist/browser/modules/excel/chart/shape-properties.js +1557 -0
- package/dist/browser/modules/excel/chart/stroke-font.d.ts +36 -0
- package/dist/browser/modules/excel/chart/stroke-font.js +1556 -0
- package/dist/browser/modules/excel/chart/topojson.d.ts +98 -0
- package/dist/browser/modules/excel/chart/topojson.js +236 -0
- package/dist/browser/modules/excel/chart/types.d.ts +2559 -0
- package/dist/browser/modules/excel/chart/types.js +8 -0
- package/dist/browser/modules/excel/chart-host-registry.d.ts +157 -0
- package/dist/browser/modules/excel/chart-host-registry.js +90 -0
- package/dist/browser/modules/excel/chartsheet.d.ts +102 -0
- package/dist/browser/modules/excel/chartsheet.js +196 -0
- package/dist/browser/modules/excel/defined-names.d.ts +35 -0
- package/dist/browser/modules/excel/defined-names.js +44 -4
- package/dist/browser/modules/excel/errors.d.ts +6 -0
- package/dist/browser/modules/excel/errors.js +9 -0
- package/dist/browser/modules/excel/form-control.d.ts +6 -0
- package/dist/browser/modules/excel/form-control.js +17 -0
- package/dist/browser/modules/excel/image.js +12 -2
- package/dist/browser/modules/excel/pivot-chart.d.ts +7 -0
- package/dist/browser/modules/excel/pivot-chart.js +53 -0
- package/dist/browser/modules/excel/pivot-table.d.ts +55 -0
- package/dist/browser/modules/excel/pivot-table.js +35 -0
- package/dist/browser/modules/excel/range.js +5 -1
- package/dist/browser/modules/excel/sparkline/index.d.ts +7 -0
- package/dist/browser/modules/excel/sparkline/index.js +7 -0
- package/dist/browser/modules/excel/sparkline/sparkline.d.ts +206 -0
- package/dist/browser/modules/excel/sparkline/sparkline.js +750 -0
- package/dist/browser/modules/excel/stream/worksheet-writer.js +3 -2
- package/dist/browser/modules/excel/table.js +42 -6
- package/dist/browser/modules/excel/types.d.ts +72 -0
- package/dist/browser/modules/excel/utils/address.d.ts +18 -0
- package/dist/browser/modules/excel/utils/address.js +28 -0
- package/dist/browser/modules/excel/utils/drawing-utils.js +11 -6
- package/dist/browser/modules/excel/utils/guid.d.ts +15 -0
- package/dist/browser/modules/excel/utils/guid.js +35 -0
- package/dist/browser/modules/excel/utils/ooxml-paths.d.ts +74 -0
- package/dist/browser/modules/excel/utils/ooxml-paths.js +206 -9
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-table.js +177 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/context.js +191 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/index.js +102 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/reporter.js +61 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/types.js +12 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
- package/dist/browser/modules/excel/workbook.browser.d.ts +248 -30
- package/dist/browser/modules/excel/workbook.browser.js +966 -31
- package/dist/browser/modules/excel/workbook.d.ts +43 -0
- package/dist/browser/modules/excel/workbook.js +48 -0
- package/dist/browser/modules/excel/worksheet.d.ts +157 -3
- package/dist/browser/modules/excel/worksheet.js +394 -35
- package/dist/browser/modules/excel/xlsx/rel-type.d.ts +40 -0
- package/dist/browser/modules/excel/xlsx/rel-type.js +41 -1
- package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
- package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
- package/dist/browser/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
- package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
- package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
- package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
- package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
- package/dist/browser/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
- package/dist/browser/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
- package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
- package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
- package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
- package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
- package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
- package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
- package/dist/browser/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
- package/dist/browser/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
- package/dist/browser/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
- package/dist/browser/modules/excel/xlsx/xform/xsd-values.js +101 -0
- package/dist/browser/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
- package/dist/browser/modules/excel/xlsx/xlsx.browser.js +4422 -78
- package/dist/browser/modules/pdf/builder/document-builder.d.ts +74 -0
- package/dist/browser/modules/pdf/builder/document-builder.js +507 -2
- package/dist/browser/modules/pdf/builder/pdf-editor.js +48 -3
- package/dist/browser/modules/pdf/excel-bridge.d.ts +69 -0
- package/dist/browser/modules/pdf/excel-bridge.js +683 -12
- package/dist/browser/modules/pdf/font/font-manager.d.ts +25 -0
- package/dist/browser/modules/pdf/font/font-manager.js +39 -0
- package/dist/browser/modules/pdf/index.d.ts +5 -2
- package/dist/browser/modules/pdf/index.js +3 -1
- package/dist/browser/modules/pdf/render/chart-surface.d.ts +33 -0
- package/dist/browser/modules/pdf/render/chart-surface.js +200 -0
- package/dist/browser/modules/pdf/render/layout-engine.d.ts +22 -1
- package/dist/browser/modules/pdf/render/layout-engine.js +436 -56
- package/dist/browser/modules/pdf/render/page-renderer.js +169 -28
- package/dist/browser/modules/pdf/render/pdf-exporter.js +117 -7
- package/dist/browser/modules/pdf/types.d.ts +227 -23
- package/dist/browser/modules/pdf/types.js +4 -0
- package/dist/browser/modules/pdf/word-bridge.d.ts +47 -0
- package/dist/browser/modules/pdf/word-bridge.js +304 -0
- package/dist/browser/modules/word/constants.d.ts +179 -0
- package/dist/browser/modules/word/constants.js +231 -0
- package/dist/browser/modules/word/content-types.d.ts +27 -0
- package/dist/browser/modules/word/content-types.js +53 -0
- package/dist/browser/modules/word/digital-signatures.d.ts +87 -0
- package/dist/browser/modules/word/digital-signatures.js +134 -0
- package/dist/browser/modules/word/document.d.ts +728 -0
- package/dist/browser/modules/word/document.js +1795 -0
- package/dist/browser/modules/word/docx-packager.d.ts +14 -0
- package/dist/browser/modules/word/docx-packager.js +822 -0
- package/dist/browser/modules/word/docx-reader.d.ts +11 -0
- package/dist/browser/modules/word/docx-reader.js +4929 -0
- package/dist/browser/modules/word/encryption.d.ts +102 -0
- package/dist/browser/modules/word/encryption.js +274 -0
- package/dist/browser/modules/word/errors.d.ts +49 -0
- package/dist/browser/modules/word/errors.js +68 -0
- package/dist/browser/modules/word/font-obfuscation.d.ts +31 -0
- package/dist/browser/modules/word/font-obfuscation.js +83 -0
- package/dist/browser/modules/word/html-renderer.d.ts +38 -0
- package/dist/browser/modules/word/html-renderer.js +782 -0
- package/dist/browser/modules/word/index.base.d.ts +19 -0
- package/dist/browser/modules/word/index.base.js +51 -0
- package/dist/browser/modules/word/index.browser.d.ts +4 -0
- package/dist/browser/modules/word/index.browser.js +4 -0
- package/dist/browser/modules/word/index.d.ts +4 -0
- package/dist/browser/modules/word/index.js +4 -0
- package/dist/browser/modules/word/internal-utils.d.ts +23 -0
- package/dist/browser/modules/word/internal-utils.js +54 -0
- package/dist/browser/modules/word/relationships.d.ts +31 -0
- package/dist/browser/modules/word/relationships.js +56 -0
- package/dist/browser/modules/word/types.d.ts +2325 -0
- package/dist/browser/modules/word/types.js +10 -0
- package/dist/browser/modules/word/units.d.ts +49 -0
- package/dist/browser/modules/word/units.js +111 -0
- package/dist/browser/modules/word/writers/chart-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/chart-writer.js +385 -0
- package/dist/browser/modules/word/writers/checkbox-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/checkbox-writer.js +42 -0
- package/dist/browser/modules/word/writers/comment-writer.d.ts +15 -0
- package/dist/browser/modules/word/writers/comment-writer.js +70 -0
- package/dist/browser/modules/word/writers/document-writer.d.ts +16 -0
- package/dist/browser/modules/word/writers/document-writer.js +461 -0
- package/dist/browser/modules/word/writers/footnote-writer.d.ts +11 -0
- package/dist/browser/modules/word/writers/footnote-writer.js +72 -0
- package/dist/browser/modules/word/writers/header-footer-writer.d.ts +13 -0
- package/dist/browser/modules/word/writers/header-footer-writer.js +129 -0
- package/dist/browser/modules/word/writers/image-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/image-writer.js +185 -0
- package/dist/browser/modules/word/writers/math-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/math-writer.js +428 -0
- package/dist/browser/modules/word/writers/numbering-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/numbering-writer.js +125 -0
- package/dist/browser/modules/word/writers/paragraph-writer.d.ts +13 -0
- package/dist/browser/modules/word/writers/paragraph-writer.js +516 -0
- package/dist/browser/modules/word/writers/parts-writer.d.ts +26 -0
- package/dist/browser/modules/word/writers/parts-writer.js +660 -0
- package/dist/browser/modules/word/writers/run-writer.d.ts +15 -0
- package/dist/browser/modules/word/writers/run-writer.js +649 -0
- package/dist/browser/modules/word/writers/section-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/section-writer.js +238 -0
- package/dist/browser/modules/word/writers/styles-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/styles-writer.js +242 -0
- package/dist/browser/modules/word/writers/table-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/table-writer.js +503 -0
- package/dist/browser/modules/word/writers/textbox-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/textbox-writer.js +53 -0
- package/dist/browser/modules/word/writers/toc-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/toc-writer.js +79 -0
- package/dist/browser/modules/xml/encode.d.ts +56 -7
- package/dist/browser/modules/xml/encode.js +157 -11
- package/dist/cjs/index.js +13 -2
- package/dist/cjs/modules/excel/chart/cache-populator.js +1178 -0
- package/dist/cjs/modules/excel/chart/chart-api.js +371 -0
- package/dist/cjs/modules/excel/chart/chart-builder.js +2440 -0
- package/dist/cjs/modules/excel/chart/chart-ex-builder.js +907 -0
- package/dist/cjs/modules/excel/chart/chart-ex-parser.js +1208 -0
- package/dist/cjs/modules/excel/chart/chart-ex-renderer.js +5364 -0
- package/dist/cjs/modules/excel/chart/chart-ex-types.js +12 -0
- package/dist/cjs/modules/excel/chart/chart-images.js +366 -0
- package/dist/cjs/modules/excel/chart/chart-presets.js +184 -0
- package/dist/cjs/modules/excel/chart/chart-renderer.js +6450 -0
- package/dist/cjs/modules/excel/chart/chart-sidecar.js +433 -0
- package/dist/cjs/modules/excel/chart/chart-utils.js +845 -0
- package/dist/cjs/modules/excel/chart/chart.js +1324 -0
- package/dist/cjs/modules/excel/chart/glyph-rasterizer.js +664 -0
- package/dist/cjs/modules/excel/chart/index.js +101 -0
- package/dist/cjs/modules/excel/chart/install.js +95 -0
- package/dist/cjs/modules/excel/chart/shape-properties.js +1577 -0
- package/dist/cjs/modules/excel/chart/stroke-font.js +1559 -0
- package/dist/cjs/modules/excel/chart/topojson.js +239 -0
- package/dist/cjs/modules/excel/chart/types.js +9 -0
- package/dist/cjs/modules/excel/chart-host-registry.js +96 -0
- package/dist/cjs/modules/excel/chartsheet.js +199 -0
- package/dist/cjs/modules/excel/defined-names.js +44 -4
- package/dist/cjs/modules/excel/errors.js +11 -1
- package/dist/cjs/modules/excel/form-control.js +17 -0
- package/dist/cjs/modules/excel/image.js +12 -2
- package/dist/cjs/modules/excel/pivot-chart.js +56 -0
- package/dist/cjs/modules/excel/pivot-table.js +35 -0
- package/dist/cjs/modules/excel/range.js +5 -1
- package/dist/cjs/modules/excel/sparkline/index.js +23 -0
- package/dist/cjs/modules/excel/sparkline/sparkline.js +756 -0
- package/dist/cjs/modules/excel/stream/worksheet-writer.js +3 -2
- package/dist/cjs/modules/excel/table.js +42 -6
- package/dist/cjs/modules/excel/utils/address.js +29 -0
- package/dist/cjs/modules/excel/utils/drawing-utils.js +11 -6
- package/dist/cjs/modules/excel/utils/guid.js +38 -0
- package/dist/cjs/modules/excel/utils/ooxml-paths.js +246 -9
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +103 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart.js +2128 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-chartsheet.js +29 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-content-types.js +184 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-drawing.js +270 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-pivot.js +107 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-relationships.js +188 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-structure.js +60 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-styles.js +92 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-table.js +180 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-workbook.js +166 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-worksheet.js +572 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/context.js +196 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/index.js +105 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/path-utils.js +168 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/reporter.js +66 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/types.js +13 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/xml-utils.js +110 -0
- package/dist/cjs/modules/excel/workbook.browser.js +973 -38
- package/dist/cjs/modules/excel/workbook.js +48 -0
- package/dist/cjs/modules/excel/worksheet.js +393 -34
- package/dist/cjs/modules/excel/xlsx/rel-type.js +41 -1
- package/dist/cjs/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
- package/dist/cjs/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
- package/dist/cjs/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
- package/dist/cjs/modules/excel/xlsx/xform/chart/chart-space-xform.js +6003 -0
- package/dist/cjs/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +219 -0
- package/dist/cjs/modules/excel/xlsx/xform/core/content-types-xform.js +149 -10
- package/dist/cjs/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
- package/dist/cjs/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
- package/dist/cjs/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
- package/dist/cjs/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +228 -0
- package/dist/cjs/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
- package/dist/cjs/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
- package/dist/cjs/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
- package/dist/cjs/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +444 -0
- package/dist/cjs/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
- package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +195 -19
- package/dist/cjs/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
- package/dist/cjs/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
- package/dist/cjs/modules/excel/xlsx/xform/xsd-values.js +106 -0
- package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +4420 -76
- package/dist/cjs/modules/pdf/builder/document-builder.js +506 -1
- package/dist/cjs/modules/pdf/builder/pdf-editor.js +48 -3
- package/dist/cjs/modules/pdf/excel-bridge.js +684 -12
- package/dist/cjs/modules/pdf/font/font-manager.js +39 -0
- package/dist/cjs/modules/pdf/index.js +5 -1
- package/dist/cjs/modules/pdf/render/chart-surface.js +203 -0
- package/dist/cjs/modules/pdf/render/layout-engine.js +437 -56
- package/dist/cjs/modules/pdf/render/page-renderer.js +169 -28
- package/dist/cjs/modules/pdf/render/pdf-exporter.js +115 -5
- package/dist/cjs/modules/pdf/types.js +5 -0
- package/dist/cjs/modules/pdf/word-bridge.js +307 -0
- package/dist/cjs/modules/word/constants.js +234 -0
- package/dist/cjs/modules/word/content-types.js +57 -0
- package/dist/cjs/modules/word/digital-signatures.js +140 -0
- package/dist/cjs/modules/word/document.js +1909 -0
- package/dist/cjs/modules/word/docx-packager.js +825 -0
- package/dist/cjs/modules/word/docx-reader.js +4932 -0
- package/dist/cjs/modules/word/encryption.js +282 -0
- package/dist/cjs/modules/word/errors.js +88 -0
- package/dist/cjs/modules/word/font-obfuscation.js +88 -0
- package/dist/cjs/modules/word/html-renderer.js +785 -0
- package/dist/cjs/modules/word/index.base.js +199 -0
- package/dist/cjs/modules/word/index.browser.js +20 -0
- package/dist/cjs/modules/word/index.js +20 -0
- package/dist/cjs/modules/word/internal-utils.js +59 -0
- package/dist/cjs/modules/word/relationships.js +60 -0
- package/dist/cjs/modules/word/types.js +11 -0
- package/dist/cjs/modules/word/units.js +135 -0
- package/dist/cjs/modules/word/writers/chart-writer.js +388 -0
- package/dist/cjs/modules/word/writers/checkbox-writer.js +45 -0
- package/dist/cjs/modules/word/writers/comment-writer.js +74 -0
- package/dist/cjs/modules/word/writers/document-writer.js +465 -0
- package/dist/cjs/modules/word/writers/footnote-writer.js +76 -0
- package/dist/cjs/modules/word/writers/header-footer-writer.js +134 -0
- package/dist/cjs/modules/word/writers/image-writer.js +188 -0
- package/dist/cjs/modules/word/writers/math-writer.js +431 -0
- package/dist/cjs/modules/word/writers/numbering-writer.js +128 -0
- package/dist/cjs/modules/word/writers/paragraph-writer.js +521 -0
- package/dist/cjs/modules/word/writers/parts-writer.js +671 -0
- package/dist/cjs/modules/word/writers/run-writer.js +655 -0
- package/dist/cjs/modules/word/writers/section-writer.js +241 -0
- package/dist/cjs/modules/word/writers/styles-writer.js +245 -0
- package/dist/cjs/modules/word/writers/table-writer.js +506 -0
- package/dist/cjs/modules/word/writers/textbox-writer.js +56 -0
- package/dist/cjs/modules/word/writers/toc-writer.js +82 -0
- package/dist/cjs/modules/xml/encode.js +158 -11
- package/dist/esm/index.browser.js +20 -2
- package/dist/esm/index.js +9 -1
- package/dist/esm/modules/excel/chart/cache-populator.js +1171 -0
- package/dist/esm/modules/excel/chart/chart-api.js +364 -0
- package/dist/esm/modules/excel/chart/chart-builder.js +2432 -0
- package/dist/esm/modules/excel/chart/chart-ex-builder.js +903 -0
- package/dist/esm/modules/excel/chart/chart-ex-parser.js +1205 -0
- package/dist/esm/modules/excel/chart/chart-ex-renderer.js +5352 -0
- package/dist/esm/modules/excel/chart/chart-ex-types.js +11 -0
- package/dist/esm/modules/excel/chart/chart-images.js +363 -0
- package/dist/esm/modules/excel/chart/chart-presets.js +179 -0
- package/dist/esm/modules/excel/chart/chart-renderer.js +6440 -0
- package/dist/esm/modules/excel/chart/chart-sidecar.js +427 -0
- package/dist/esm/modules/excel/chart/chart-utils.js +821 -0
- package/dist/esm/modules/excel/chart/chart.js +1320 -0
- package/dist/esm/modules/excel/chart/glyph-rasterizer.js +658 -0
- package/dist/esm/modules/excel/chart/index.js +46 -0
- package/dist/esm/modules/excel/chart/install.js +91 -0
- package/dist/esm/modules/excel/chart/shape-properties.js +1557 -0
- package/dist/esm/modules/excel/chart/stroke-font.js +1556 -0
- package/dist/esm/modules/excel/chart/topojson.js +236 -0
- package/dist/esm/modules/excel/chart/types.js +8 -0
- package/dist/esm/modules/excel/chart-host-registry.js +90 -0
- package/dist/esm/modules/excel/chartsheet.js +196 -0
- package/dist/esm/modules/excel/defined-names.js +44 -4
- package/dist/esm/modules/excel/errors.js +9 -0
- package/dist/esm/modules/excel/form-control.js +17 -0
- package/dist/esm/modules/excel/image.js +12 -2
- package/dist/esm/modules/excel/pivot-chart.js +53 -0
- package/dist/esm/modules/excel/pivot-table.js +35 -0
- package/dist/esm/modules/excel/range.js +5 -1
- package/dist/esm/modules/excel/sparkline/index.js +7 -0
- package/dist/esm/modules/excel/sparkline/sparkline.js +750 -0
- package/dist/esm/modules/excel/stream/worksheet-writer.js +3 -2
- package/dist/esm/modules/excel/table.js +42 -6
- package/dist/esm/modules/excel/utils/address.js +28 -0
- package/dist/esm/modules/excel/utils/drawing-utils.js +11 -6
- package/dist/esm/modules/excel/utils/guid.js +35 -0
- package/dist/esm/modules/excel/utils/ooxml-paths.js +206 -9
- package/dist/esm/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-table.js +177 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/context.js +191 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/index.js +102 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/reporter.js +61 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/types.js +12 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
- package/dist/esm/modules/excel/workbook.browser.js +969 -34
- package/dist/esm/modules/excel/workbook.js +48 -0
- package/dist/esm/modules/excel/worksheet.js +394 -35
- package/dist/esm/modules/excel/xlsx/rel-type.js +41 -1
- package/dist/esm/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
- package/dist/esm/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
- package/dist/esm/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
- package/dist/esm/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
- package/dist/esm/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
- package/dist/esm/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
- package/dist/esm/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
- package/dist/esm/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
- package/dist/esm/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
- package/dist/esm/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
- package/dist/esm/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
- package/dist/esm/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
- package/dist/esm/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
- package/dist/esm/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
- package/dist/esm/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
- package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
- package/dist/esm/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
- package/dist/esm/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
- package/dist/esm/modules/excel/xlsx/xform/xsd-values.js +101 -0
- package/dist/esm/modules/excel/xlsx/xlsx.browser.js +4422 -78
- package/dist/esm/modules/pdf/builder/document-builder.js +507 -2
- package/dist/esm/modules/pdf/builder/pdf-editor.js +48 -3
- package/dist/esm/modules/pdf/excel-bridge.js +683 -12
- package/dist/esm/modules/pdf/font/font-manager.js +39 -0
- package/dist/esm/modules/pdf/index.js +3 -1
- package/dist/esm/modules/pdf/render/chart-surface.js +200 -0
- package/dist/esm/modules/pdf/render/layout-engine.js +436 -56
- package/dist/esm/modules/pdf/render/page-renderer.js +169 -28
- package/dist/esm/modules/pdf/render/pdf-exporter.js +117 -7
- package/dist/esm/modules/pdf/types.js +4 -0
- package/dist/esm/modules/pdf/word-bridge.js +304 -0
- package/dist/esm/modules/word/constants.js +231 -0
- package/dist/esm/modules/word/content-types.js +53 -0
- package/dist/esm/modules/word/digital-signatures.js +134 -0
- package/dist/esm/modules/word/document.js +1795 -0
- package/dist/esm/modules/word/docx-packager.js +822 -0
- package/dist/esm/modules/word/docx-reader.js +4929 -0
- package/dist/esm/modules/word/encryption.js +274 -0
- package/dist/esm/modules/word/errors.js +68 -0
- package/dist/esm/modules/word/font-obfuscation.js +83 -0
- package/dist/esm/modules/word/html-renderer.js +782 -0
- package/dist/esm/modules/word/index.base.js +51 -0
- package/dist/esm/modules/word/index.browser.js +4 -0
- package/dist/esm/modules/word/index.js +4 -0
- package/dist/esm/modules/word/internal-utils.js +54 -0
- package/dist/esm/modules/word/relationships.js +56 -0
- package/dist/esm/modules/word/types.js +10 -0
- package/dist/esm/modules/word/units.js +111 -0
- package/dist/esm/modules/word/writers/chart-writer.js +385 -0
- package/dist/esm/modules/word/writers/checkbox-writer.js +42 -0
- package/dist/esm/modules/word/writers/comment-writer.js +70 -0
- package/dist/esm/modules/word/writers/document-writer.js +461 -0
- package/dist/esm/modules/word/writers/footnote-writer.js +72 -0
- package/dist/esm/modules/word/writers/header-footer-writer.js +129 -0
- package/dist/esm/modules/word/writers/image-writer.js +185 -0
- package/dist/esm/modules/word/writers/math-writer.js +428 -0
- package/dist/esm/modules/word/writers/numbering-writer.js +125 -0
- package/dist/esm/modules/word/writers/paragraph-writer.js +516 -0
- package/dist/esm/modules/word/writers/parts-writer.js +660 -0
- package/dist/esm/modules/word/writers/run-writer.js +649 -0
- package/dist/esm/modules/word/writers/section-writer.js +238 -0
- package/dist/esm/modules/word/writers/styles-writer.js +242 -0
- package/dist/esm/modules/word/writers/table-writer.js +503 -0
- package/dist/esm/modules/word/writers/textbox-writer.js +53 -0
- package/dist/esm/modules/word/writers/toc-writer.js +79 -0
- package/dist/esm/modules/xml/encode.js +157 -11
- package/dist/iife/excelts.iife.js +11789 -687
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +52 -44
- package/dist/types/index.browser.d.ts +8 -5
- package/dist/types/index.d.ts +4 -2
- package/dist/types/modules/excel/chart/cache-populator.d.ts +49 -0
- package/dist/types/modules/excel/chart/chart-api.d.ts +92 -0
- package/dist/types/modules/excel/chart/chart-builder.d.ts +48 -0
- package/dist/types/modules/excel/chart/chart-ex-builder.d.ts +36 -0
- package/dist/types/modules/excel/chart/chart-ex-parser.d.ts +8 -0
- package/dist/types/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
- package/dist/types/modules/excel/chart/chart-ex-types.d.ts +531 -0
- package/dist/types/modules/excel/chart/chart-images.d.ts +78 -0
- package/dist/types/modules/excel/chart/chart-presets.d.ts +392 -0
- package/dist/types/modules/excel/chart/chart-renderer.d.ts +550 -0
- package/dist/types/modules/excel/chart/chart-sidecar.d.ts +21 -0
- package/dist/types/modules/excel/chart/chart-utils.d.ts +306 -0
- package/dist/types/modules/excel/chart/chart.d.ts +504 -0
- package/dist/types/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
- package/dist/types/modules/excel/chart/index.d.ts +54 -0
- package/dist/types/modules/excel/chart/install.d.ts +44 -0
- package/dist/types/modules/excel/chart/shape-properties.d.ts +156 -0
- package/dist/types/modules/excel/chart/stroke-font.d.ts +36 -0
- package/dist/types/modules/excel/chart/topojson.d.ts +98 -0
- package/dist/types/modules/excel/chart/types.d.ts +2559 -0
- package/dist/types/modules/excel/chart-host-registry.d.ts +157 -0
- package/dist/types/modules/excel/chartsheet.d.ts +102 -0
- package/dist/types/modules/excel/defined-names.d.ts +35 -0
- package/dist/types/modules/excel/errors.d.ts +6 -0
- package/dist/types/modules/excel/form-control.d.ts +6 -0
- package/dist/types/modules/excel/pivot-chart.d.ts +7 -0
- package/dist/types/modules/excel/pivot-table.d.ts +55 -0
- package/dist/types/modules/excel/sparkline/index.d.ts +7 -0
- package/dist/types/modules/excel/sparkline/sparkline.d.ts +206 -0
- package/dist/types/modules/excel/types.d.ts +72 -0
- package/dist/types/modules/excel/utils/address.d.ts +18 -0
- package/dist/types/modules/excel/utils/guid.d.ts +15 -0
- package/dist/types/modules/excel/utils/ooxml-paths.d.ts +74 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
- package/dist/types/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
- package/dist/types/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
- package/dist/types/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
- package/dist/types/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
- package/dist/types/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
- package/dist/types/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
- package/dist/types/modules/excel/workbook.browser.d.ts +248 -30
- package/dist/types/modules/excel/workbook.d.ts +43 -0
- package/dist/types/modules/excel/worksheet.d.ts +157 -3
- package/dist/types/modules/excel/xlsx/rel-type.d.ts +40 -0
- package/dist/types/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
- package/dist/types/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
- package/dist/types/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
- package/dist/types/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
- package/dist/types/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
- package/dist/types/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
- package/dist/types/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
- package/dist/types/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
- package/dist/types/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
- package/dist/types/modules/pdf/builder/document-builder.d.ts +74 -0
- package/dist/types/modules/pdf/excel-bridge.d.ts +69 -0
- package/dist/types/modules/pdf/font/font-manager.d.ts +25 -0
- package/dist/types/modules/pdf/index.d.ts +5 -2
- package/dist/types/modules/pdf/render/chart-surface.d.ts +33 -0
- package/dist/types/modules/pdf/render/layout-engine.d.ts +22 -1
- package/dist/types/modules/pdf/types.d.ts +227 -23
- package/dist/types/modules/pdf/word-bridge.d.ts +47 -0
- package/dist/types/modules/word/constants.d.ts +179 -0
- package/dist/types/modules/word/content-types.d.ts +27 -0
- package/dist/types/modules/word/digital-signatures.d.ts +87 -0
- package/dist/types/modules/word/document.d.ts +728 -0
- package/dist/types/modules/word/docx-packager.d.ts +14 -0
- package/dist/types/modules/word/docx-reader.d.ts +11 -0
- package/dist/types/modules/word/encryption.d.ts +102 -0
- package/dist/types/modules/word/errors.d.ts +49 -0
- package/dist/types/modules/word/font-obfuscation.d.ts +31 -0
- package/dist/types/modules/word/html-renderer.d.ts +38 -0
- package/dist/types/modules/word/index.base.d.ts +19 -0
- package/dist/types/modules/word/index.browser.d.ts +4 -0
- package/dist/types/modules/word/index.d.ts +4 -0
- package/dist/types/modules/word/internal-utils.d.ts +23 -0
- package/dist/types/modules/word/relationships.d.ts +31 -0
- package/dist/types/modules/word/types.d.ts +2325 -0
- package/dist/types/modules/word/units.d.ts +49 -0
- package/dist/types/modules/word/writers/chart-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/checkbox-writer.d.ts +9 -0
- package/dist/types/modules/word/writers/comment-writer.d.ts +15 -0
- package/dist/types/modules/word/writers/document-writer.d.ts +16 -0
- package/dist/types/modules/word/writers/footnote-writer.d.ts +11 -0
- package/dist/types/modules/word/writers/header-footer-writer.d.ts +13 -0
- package/dist/types/modules/word/writers/image-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/math-writer.d.ts +9 -0
- package/dist/types/modules/word/writers/numbering-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/paragraph-writer.d.ts +13 -0
- package/dist/types/modules/word/writers/parts-writer.d.ts +26 -0
- package/dist/types/modules/word/writers/run-writer.d.ts +15 -0
- package/dist/types/modules/word/writers/section-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/styles-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/table-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/textbox-writer.d.ts +9 -0
- package/dist/types/modules/word/writers/toc-writer.d.ts +9 -0
- package/dist/types/modules/xml/encode.d.ts +56 -7
- package/package.json +29 -11
- package/dist/browser/modules/excel/utils/ooxml-validator.d.ts +0 -48
- package/dist/browser/modules/excel/utils/ooxml-validator.js +0 -493
- package/dist/browser/modules/excel/utils/passthrough-manager.d.ts +0 -77
- package/dist/browser/modules/excel/utils/passthrough-manager.js +0 -129
- package/dist/cjs/modules/excel/utils/ooxml-validator.js +0 -499
- package/dist/cjs/modules/excel/utils/passthrough-manager.js +0 -133
- package/dist/esm/modules/excel/utils/ooxml-validator.js +0 -493
- package/dist/esm/modules/excel/utils/passthrough-manager.js +0 -129
- package/dist/types/modules/excel/utils/ooxml-validator.d.ts +0 -48
- package/dist/types/modules/excel/utils/passthrough-manager.d.ts +0 -77
|
@@ -16,13 +16,22 @@ const format_1 = require("../csv/format/index.js");
|
|
|
16
16
|
const parse_1 = require("../csv/parse/index.js");
|
|
17
17
|
const stream_1 = require("../csv/stream/index.js");
|
|
18
18
|
const number_1 = require("../csv/utils/number.js");
|
|
19
|
+
// Chart runtime accessed through the host-registry slot; see
|
|
20
|
+
// `chart-host-registry.ts` and `chart/install.ts`. Keeps chart code
|
|
21
|
+
// out of consumer bundles when they don't import
|
|
22
|
+
// `@cj-tech-master/excelts/chart`.
|
|
23
|
+
const chart_host_registry_1 = require("./chart-host-registry.js");
|
|
24
|
+
const chartsheet_1 = require("./chartsheet.js");
|
|
19
25
|
const defined_names_1 = require("./defined-names.js");
|
|
20
26
|
const errors_1 = require("./errors.js");
|
|
21
|
-
const
|
|
22
|
-
const
|
|
27
|
+
const pivot_chart_1 = require("./pivot-chart.js");
|
|
28
|
+
const workbook_reader_browser_1 = require("./stream/workbook-reader.browser.js");
|
|
29
|
+
const workbook_writer_browser_1 = require("./stream/workbook-writer.browser.js");
|
|
30
|
+
const guid_1 = require("./utils/guid.js");
|
|
23
31
|
const workbook_protection_1 = require("./utils/workbook-protection.js");
|
|
24
32
|
const worksheet_1 = require("./worksheet.js");
|
|
25
|
-
const
|
|
33
|
+
const rel_type_1 = require("./xlsx/rel-type.js");
|
|
34
|
+
const xlsx_browser_1 = require("./xlsx/xlsx.browser.js");
|
|
26
35
|
const host_registry_1 = require("../formula/host-registry.js");
|
|
27
36
|
const index_1 = require("../markdown/format/index.js");
|
|
28
37
|
const index_2 = require("../markdown/parse/index.js");
|
|
@@ -268,6 +277,22 @@ function buildFormatterOptions(options) {
|
|
|
268
277
|
writeHeaders: options?.writeHeaders
|
|
269
278
|
};
|
|
270
279
|
}
|
|
280
|
+
function isComboChartOptions(chart) {
|
|
281
|
+
return !!chart && typeof chart === "object" && "groups" in chart;
|
|
282
|
+
}
|
|
283
|
+
function isChartExOptions(chart) {
|
|
284
|
+
return !!chart && typeof chart === "object" && "type" in chart && isChartExType(chart.type);
|
|
285
|
+
}
|
|
286
|
+
function isChartExType(type) {
|
|
287
|
+
return (type === "sunburst" ||
|
|
288
|
+
type === "treemap" ||
|
|
289
|
+
type === "waterfall" ||
|
|
290
|
+
type === "funnel" ||
|
|
291
|
+
type === "histogram" ||
|
|
292
|
+
type === "pareto" ||
|
|
293
|
+
type === "boxWhisker" ||
|
|
294
|
+
type === "regionMap");
|
|
295
|
+
}
|
|
271
296
|
// =============================================================================
|
|
272
297
|
// Workbook Class
|
|
273
298
|
// =============================================================================
|
|
@@ -303,8 +328,21 @@ class Workbook {
|
|
|
303
328
|
this.media = [];
|
|
304
329
|
this.pivotTables = [];
|
|
305
330
|
this.externalLinks = [];
|
|
306
|
-
this.
|
|
307
|
-
this.
|
|
331
|
+
this._chartEntries = {};
|
|
332
|
+
this._chartRels = {};
|
|
333
|
+
this._chartStyles = {};
|
|
334
|
+
this._chartColors = {};
|
|
335
|
+
this._chartExStyles = {};
|
|
336
|
+
this._chartExColors = {};
|
|
337
|
+
this._chartExEntries = {};
|
|
338
|
+
this._chartExRels = {};
|
|
339
|
+
this._chartExStructuredEntries = {};
|
|
340
|
+
this._chartsheets = [];
|
|
341
|
+
this._persons = [];
|
|
342
|
+
this._slicerParts = {};
|
|
343
|
+
this._slicerCacheParts = {};
|
|
344
|
+
this._timelineParts = {};
|
|
345
|
+
this._timelineCacheParts = {};
|
|
308
346
|
this._writerExternalLinkCache = new Map();
|
|
309
347
|
this._definedNames = new defined_names_1.DefinedNames(options?.formulaSyntaxProbe);
|
|
310
348
|
}
|
|
@@ -349,11 +387,97 @@ class Workbook {
|
|
|
349
387
|
// Deep copy via model: the getter serializes ALL worksheet properties and the
|
|
350
388
|
// setter deserializes them, so future properties are automatically included.
|
|
351
389
|
const sourceModel = source.model;
|
|
390
|
+
// Remap chart numbers so the source's `chartNumber` / `chartExNumber`
|
|
391
|
+
// references point at entries we actually copy into the target
|
|
392
|
+
// workbook. Build the map here so the rewritten `charts` array and
|
|
393
|
+
// the copied entries use consistent ids.
|
|
394
|
+
const chartMap = new Map();
|
|
395
|
+
const chartExMap = new Map();
|
|
396
|
+
const sourceWorkbook = source.workbook;
|
|
397
|
+
const differentWorkbook = sourceWorkbook !== this;
|
|
398
|
+
const sourceCharts = sourceModel.charts ?? [];
|
|
399
|
+
// `nextChartNumber()` / `nextChartExNumber()` compute `max(existing) + 1`
|
|
400
|
+
// from the entry maps — they do NOT reserve a slot. Calling them in
|
|
401
|
+
// a tight loop without an intervening `addChartEntry` therefore
|
|
402
|
+
// returns the SAME number N times, and the second loop below then
|
|
403
|
+
// overwrites `_chartEntries[dstNum]` repeatedly — only the last
|
|
404
|
+
// cloned entry survives, the others are silently lost. Track the
|
|
405
|
+
// allocator locally so each source chart gets a unique target slot.
|
|
406
|
+
let nextChartAlloc = this.nextChartNumber();
|
|
407
|
+
let nextChartExAlloc = this.nextChartExNumber();
|
|
408
|
+
for (const anchor of sourceCharts) {
|
|
409
|
+
if (anchor.chartNumber && anchor.chartNumber > 0 && !chartMap.has(anchor.chartNumber)) {
|
|
410
|
+
chartMap.set(anchor.chartNumber, nextChartAlloc++);
|
|
411
|
+
}
|
|
412
|
+
if (anchor.chartExNumber &&
|
|
413
|
+
anchor.chartExNumber > 0 &&
|
|
414
|
+
!chartExMap.has(anchor.chartExNumber)) {
|
|
415
|
+
chartExMap.set(anchor.chartExNumber, nextChartExAlloc++);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
const remappedCharts = sourceCharts.map(anchor => ({
|
|
419
|
+
...anchor,
|
|
420
|
+
chartNumber: anchor.chartNumber
|
|
421
|
+
? (chartMap.get(anchor.chartNumber) ?? anchor.chartNumber)
|
|
422
|
+
: anchor.chartNumber,
|
|
423
|
+
chartExNumber: anchor.chartExNumber
|
|
424
|
+
? (chartExMap.get(anchor.chartExNumber) ?? anchor.chartExNumber)
|
|
425
|
+
: anchor.chartExNumber
|
|
426
|
+
}));
|
|
352
427
|
newWs.model = {
|
|
353
428
|
...sourceModel,
|
|
354
429
|
id: newWs.id,
|
|
355
|
-
name: newWs.name
|
|
430
|
+
name: newWs.name,
|
|
431
|
+
charts: remappedCharts
|
|
356
432
|
};
|
|
433
|
+
// Copy the actual chart parts + sidecars into the target workbook
|
|
434
|
+
// so the remapped `charts` array references live entries. Without
|
|
435
|
+
// this, `importSheet` left the target with chart anchors but no
|
|
436
|
+
// backing chart XML, producing a broken package on save. We copy
|
|
437
|
+
// both the structured model (via `getChartEntry` / `addChartEntry`
|
|
438
|
+
// — the public API) and all sidecars (`copyChartSidecars` /
|
|
439
|
+
// `copyChartExSidecars`).
|
|
440
|
+
if (chartMap.size > 0 || chartExMap.size > 0) {
|
|
441
|
+
for (const [srcNum, dstNum] of chartMap) {
|
|
442
|
+
const entry = sourceWorkbook.getChartEntry(srcNum);
|
|
443
|
+
if (!entry) {
|
|
444
|
+
continue;
|
|
445
|
+
}
|
|
446
|
+
// Deep-clone the entry with every metadata field preserved —
|
|
447
|
+
// rawData / userShapesXml (byte slices), modelSnapshot and the
|
|
448
|
+
// dirty / preferRawPatch / requireRawPatch writer hints, plus
|
|
449
|
+
// per-entry `rels`. Previously only `model`, `rawData`, and
|
|
450
|
+
// `userShapesXml` were copied, so the cross-workbook import
|
|
451
|
+
// path produced charts where the raw-patch fast path couldn't
|
|
452
|
+
// run and the change-detection snapshot didn't reflect the
|
|
453
|
+
// source entry's load-time state.
|
|
454
|
+
this.addChartEntry(cloneChartEntry(entry, dstNum));
|
|
455
|
+
if (differentWorkbook) {
|
|
456
|
+
sourceWorkbook.copyChartSidecars(srcNum, dstNum, this);
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
this.copyChartSidecars(srcNum, dstNum);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
for (const [srcNum, dstNum] of chartExMap) {
|
|
463
|
+
const exEntry = sourceWorkbook.getChartExStructuredEntry?.(srcNum);
|
|
464
|
+
if (exEntry) {
|
|
465
|
+
this.addChartExStructuredEntry(cloneChartExEntry(exEntry, dstNum));
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
const rawBytes = sourceWorkbook._chartExEntries?.[srcNum];
|
|
469
|
+
if (rawBytes) {
|
|
470
|
+
this._chartExEntries[dstNum] = rawBytes.slice();
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
if (differentWorkbook) {
|
|
474
|
+
sourceWorkbook.copyChartExSidecars(srcNum, dstNum, this);
|
|
475
|
+
}
|
|
476
|
+
else {
|
|
477
|
+
this.copyChartExSidecars(srcNum, dstNum);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
357
481
|
return newWs;
|
|
358
482
|
}
|
|
359
483
|
// ===========================================================================
|
|
@@ -385,7 +509,7 @@ class Workbook {
|
|
|
385
509
|
*/
|
|
386
510
|
get xlsx() {
|
|
387
511
|
if (!this._xlsx) {
|
|
388
|
-
this._xlsx = new
|
|
512
|
+
this._xlsx = new xlsx_browser_1.XLSX(this);
|
|
389
513
|
}
|
|
390
514
|
return this._xlsx;
|
|
391
515
|
}
|
|
@@ -888,17 +1012,14 @@ class Workbook {
|
|
|
888
1012
|
* Create a streaming workbook writer for large files.
|
|
889
1013
|
* This is more memory-efficient than using Workbook for large datasets.
|
|
890
1014
|
*
|
|
891
|
-
*
|
|
892
|
-
*
|
|
893
|
-
*
|
|
894
|
-
*
|
|
1015
|
+
* File-path output (`{ filename }`) is a Node.js-only feature and is
|
|
1016
|
+
* exposed by the Node `Workbook` subclass, which overrides this
|
|
1017
|
+
* factory to return the Node `WorkbookWriter`. This browser base
|
|
1018
|
+
* only accepts `{ stream }`.
|
|
895
1019
|
*
|
|
896
1020
|
* @example
|
|
897
1021
|
* ```ts
|
|
898
|
-
* // Node.js with
|
|
899
|
-
* const writer = Workbook.createStreamWriter({ filename: "large-file.xlsx" });
|
|
900
|
-
*
|
|
901
|
-
* // Browser or Node.js with stream
|
|
1022
|
+
* // Browser (or Node.js with an explicit stream)
|
|
902
1023
|
* const writer = Workbook.createStreamWriter({ stream: writableStream });
|
|
903
1024
|
*
|
|
904
1025
|
* const sheet = writer.addWorksheet("Sheet1");
|
|
@@ -909,22 +1030,21 @@ class Workbook {
|
|
|
909
1030
|
* ```
|
|
910
1031
|
*/
|
|
911
1032
|
static createStreamWriter(options) {
|
|
912
|
-
return new
|
|
1033
|
+
return new workbook_writer_browser_1.WorkbookWriter(options);
|
|
913
1034
|
}
|
|
914
1035
|
/**
|
|
915
1036
|
* Create a streaming workbook reader for large files.
|
|
916
1037
|
* This is more memory-efficient than using Workbook.xlsx.readFile for large datasets.
|
|
917
1038
|
*
|
|
918
|
-
*
|
|
919
|
-
*
|
|
920
|
-
*
|
|
1039
|
+
* File-path input (`string`) is a Node.js-only feature and is exposed
|
|
1040
|
+
* by the Node `Workbook` subclass, which overrides this factory to
|
|
1041
|
+
* return the Node `WorkbookReader`. This browser base accepts the
|
|
1042
|
+
* cross-platform `CommonInput` type
|
|
1043
|
+
* (`Uint8Array | ArrayBuffer | Readable | ReadableStream`).
|
|
921
1044
|
*
|
|
922
1045
|
* @example
|
|
923
1046
|
* ```ts
|
|
924
|
-
* // Node.js with
|
|
925
|
-
* const reader = Workbook.createStreamReader("large-file.xlsx");
|
|
926
|
-
*
|
|
927
|
-
* // Browser or Node.js with stream
|
|
1047
|
+
* // Browser or Node.js with stream / buffer
|
|
928
1048
|
* const reader = Workbook.createStreamReader(readableStream);
|
|
929
1049
|
*
|
|
930
1050
|
* for await (const event of reader) {
|
|
@@ -938,31 +1058,65 @@ class Workbook {
|
|
|
938
1058
|
* ```
|
|
939
1059
|
*/
|
|
940
1060
|
static createStreamReader(input, options) {
|
|
941
|
-
return new
|
|
1061
|
+
return new workbook_reader_browser_1.WorkbookReader(input, options);
|
|
942
1062
|
}
|
|
943
1063
|
// ===========================================================================
|
|
944
1064
|
// Worksheet Management
|
|
945
1065
|
// ===========================================================================
|
|
946
1066
|
get nextId() {
|
|
947
|
-
//
|
|
1067
|
+
// Worksheets and chartsheets share a single `sheetId` namespace in
|
|
1068
|
+
// `workbook.xml`'s `<sheets>` element (OOXML requires each
|
|
1069
|
+
// `sheetId` to be globally unique across both families). Allocating
|
|
1070
|
+
// from `_worksheets` alone used to hand out an id already claimed
|
|
1071
|
+
// by a chartsheet whenever the author interleaved their calls —
|
|
1072
|
+
// e.g. `addWorksheet(×16)` → ids 1-16; `addChartsheet(×2)` → ids
|
|
1073
|
+
// 17-18 (via `_nextSheetId()`); then `addWorksheet("X")` walked
|
|
1074
|
+
// `_worksheets` slots 1..16, found them full, and returned
|
|
1075
|
+
// `_worksheets.length = 17`, colliding with the first chartsheet.
|
|
1076
|
+
// Excel rejects the resulting workbook as corrupt. Collect
|
|
1077
|
+
// chartsheet ids up front so the search honours the shared pool.
|
|
1078
|
+
const chartsheetIds = new Set();
|
|
1079
|
+
for (const cs of this._chartsheets) {
|
|
1080
|
+
if (cs && typeof cs.id === "number" && Number.isFinite(cs.id)) {
|
|
1081
|
+
chartsheetIds.add(cs.id);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
// Prefer reusing vacated `_worksheets` slots (left as holes by
|
|
1085
|
+
// `removeWorksheetEx`) so ids stay stable across delete+add cycles.
|
|
948
1086
|
for (let i = 1; i < this._worksheets.length; i++) {
|
|
949
|
-
if (!this._worksheets[i]) {
|
|
1087
|
+
if (!this._worksheets[i] && !chartsheetIds.has(i)) {
|
|
950
1088
|
return i;
|
|
951
1089
|
}
|
|
952
1090
|
}
|
|
953
|
-
|
|
1091
|
+
// No reusable hole — hand out the next id beyond the current
|
|
1092
|
+
// tail, skipping any slots already taken by chartsheets.
|
|
1093
|
+
let candidate = this._worksheets.length || 1;
|
|
1094
|
+
while (chartsheetIds.has(candidate)) {
|
|
1095
|
+
candidate++;
|
|
1096
|
+
}
|
|
1097
|
+
return candidate;
|
|
954
1098
|
}
|
|
955
1099
|
/**
|
|
956
1100
|
* Add a new worksheet and return a reference to it
|
|
957
1101
|
*/
|
|
958
1102
|
addWorksheet(name, options) {
|
|
959
1103
|
const id = this.nextId;
|
|
960
|
-
|
|
1104
|
+
// Allocate `orderNo` from the unified worksheet+chartsheet counter.
|
|
1105
|
+
// Looking only at `_worksheets` here (the previous implementation)
|
|
1106
|
+
// silently collides when a chartsheet has been added in between:
|
|
1107
|
+
// e.g. `addWorksheet("A")` → orderNo 0; `addChartsheet(…)` → 1
|
|
1108
|
+
// (via `_nextSheetOrderNo()`); `addWorksheet("B")` → 1 again
|
|
1109
|
+
// (because `max(worksheets.orderNo) + 1 = 0 + 1 = 1`), so A and
|
|
1110
|
+
// B share an ordinal with the chartsheet. The writer's stable
|
|
1111
|
+
// sort then interleaves them non-deterministically, scrambling
|
|
1112
|
+
// the user's tab order (`[A, CS, B]` could come out as
|
|
1113
|
+
// `[A, B, CS]` or `[A, CS, B]` across runs).
|
|
1114
|
+
const orderNo = this._nextSheetOrderNo();
|
|
961
1115
|
const worksheetOptions = {
|
|
962
1116
|
...options,
|
|
963
1117
|
id,
|
|
964
1118
|
name,
|
|
965
|
-
orderNo
|
|
1119
|
+
orderNo,
|
|
966
1120
|
workbook: this
|
|
967
1121
|
};
|
|
968
1122
|
const worksheet = new worksheet_1.Worksheet(worksheetOptions);
|
|
@@ -970,6 +1124,15 @@ class Workbook {
|
|
|
970
1124
|
return worksheet;
|
|
971
1125
|
}
|
|
972
1126
|
removeWorksheetEx(worksheet) {
|
|
1127
|
+
// Release any workbook-wide table names this sheet held so the names can
|
|
1128
|
+
// be reused by future tables on other sheets without spurious "name
|
|
1129
|
+
// already exists" errors.
|
|
1130
|
+
const tables = worksheet.tables;
|
|
1131
|
+
if (tables) {
|
|
1132
|
+
for (const tableName of Object.keys(tables)) {
|
|
1133
|
+
this._tableNames.delete(tableName.toLowerCase());
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
973
1136
|
this._worksheets[worksheet.id] = undefined;
|
|
974
1137
|
}
|
|
975
1138
|
removeWorksheet(id) {
|
|
@@ -1003,6 +1166,269 @@ class Workbook {
|
|
|
1003
1166
|
.sort((a, b) => a.orderNo - b.orderNo)
|
|
1004
1167
|
.filter(Boolean);
|
|
1005
1168
|
}
|
|
1169
|
+
/**
|
|
1170
|
+
* Add a chartsheet containing a single chart and return the created chartsheet.
|
|
1171
|
+
*/
|
|
1172
|
+
addChartsheet(name, options) {
|
|
1173
|
+
const sheetName = this._validateChartsheetName(name ?? `Chart${this._chartsheets.length + 1}`);
|
|
1174
|
+
const sheetNo = this._nextChartsheetNo();
|
|
1175
|
+
const id = this._nextSheetId();
|
|
1176
|
+
// Assign a unified `orderNo` across worksheets and chartsheets so
|
|
1177
|
+
// the writer can preserve the author's interleaved tab layout.
|
|
1178
|
+
// Without this, workbook-xform `prepare()` sorted by `sheetNo`
|
|
1179
|
+
// (file-path number, independent per family) and reordered
|
|
1180
|
+
// `[ws1, cs1, ws2]` into `[ws1, ws2, cs1]`.
|
|
1181
|
+
const orderNo = this._nextSheetOrderNo();
|
|
1182
|
+
const chartsheet = {
|
|
1183
|
+
sheetNo,
|
|
1184
|
+
id,
|
|
1185
|
+
name: sheetName,
|
|
1186
|
+
orderNo,
|
|
1187
|
+
state: options.state ?? "visible",
|
|
1188
|
+
tabSelected: options.tabSelected,
|
|
1189
|
+
zoomScale: options.zoomScale,
|
|
1190
|
+
workbookViewId: options.workbookViewId,
|
|
1191
|
+
zoomToFit: options.zoomToFit,
|
|
1192
|
+
pageMargins: options.pageMargins,
|
|
1193
|
+
pageSetup: options.pageSetup,
|
|
1194
|
+
drawing: { rId: "rId1" }
|
|
1195
|
+
};
|
|
1196
|
+
if (isChartExOptions(options.chart)) {
|
|
1197
|
+
const chartSupport = (0, chart_host_registry_1.getChartSupport)();
|
|
1198
|
+
const chartExNumber = this.nextChartExNumber();
|
|
1199
|
+
const model = chartSupport.buildChartExModel(options.chart);
|
|
1200
|
+
try {
|
|
1201
|
+
chartSupport.fillChartExCaches(model, this);
|
|
1202
|
+
}
|
|
1203
|
+
catch {
|
|
1204
|
+
// Cache population is best-effort; never let it break chart creation.
|
|
1205
|
+
}
|
|
1206
|
+
this.addChartExStructuredEntry({ chartExNumber, model });
|
|
1207
|
+
chartsheet.chartExNumber = chartExNumber;
|
|
1208
|
+
}
|
|
1209
|
+
else {
|
|
1210
|
+
const chartSupport = (0, chart_host_registry_1.getChartSupport)();
|
|
1211
|
+
const chartNumber = this.nextChartNumber();
|
|
1212
|
+
const chartModel = isComboChartOptions(options.chart)
|
|
1213
|
+
? chartSupport.buildComboChartModel(options.chart)
|
|
1214
|
+
: chartSupport.buildChartModel(options.chart);
|
|
1215
|
+
try {
|
|
1216
|
+
chartSupport.fillChartCaches(chartModel, this);
|
|
1217
|
+
}
|
|
1218
|
+
catch {
|
|
1219
|
+
// Cache population is best-effort; never let it break chart creation.
|
|
1220
|
+
}
|
|
1221
|
+
const entry = { chartNumber, model: chartModel };
|
|
1222
|
+
// Resolve programmatic `series.spPr.fill.blip._pendingImage`
|
|
1223
|
+
// payloads into workbook media entries and chart rels. The
|
|
1224
|
+
// worksheet-embedded `addChart` path does this immediately
|
|
1225
|
+
// after `fillChartCaches`; chartsheets ran the same builder
|
|
1226
|
+
// output but skipped the image-resolution step entirely, so a
|
|
1227
|
+
// picture-fill series authored via `addChartsheet` was
|
|
1228
|
+
// registered with its `_pendingImage` stuck on the model and
|
|
1229
|
+
// never reached `media/imageN.{ext}` — Excel rendered the
|
|
1230
|
+
// series as a transparent fill. Safe to call before
|
|
1231
|
+
// `addChartEntry` so the stored entry carries its resolved
|
|
1232
|
+
// `entry.rels` from the start.
|
|
1233
|
+
try {
|
|
1234
|
+
chartSupport.resolvePendingChartImages(entry, this, chartNumber);
|
|
1235
|
+
}
|
|
1236
|
+
catch {
|
|
1237
|
+
// Image resolution is best-effort; a broken image payload
|
|
1238
|
+
// should never take down chart creation — the series keeps
|
|
1239
|
+
// its `pictureOptions`, just without the blipFill.
|
|
1240
|
+
}
|
|
1241
|
+
this.addChartEntry(entry);
|
|
1242
|
+
this._applyChartsheetSidecars(chartNumber, options.chart);
|
|
1243
|
+
chartsheet.chartNumber = chartNumber;
|
|
1244
|
+
}
|
|
1245
|
+
this._chartsheets.push(chartsheet);
|
|
1246
|
+
return new chartsheet_1.Chartsheet(chartsheet, this);
|
|
1247
|
+
}
|
|
1248
|
+
/**
|
|
1249
|
+
* Add a chartsheet containing a classic pivot chart linked to an existing pivot table.
|
|
1250
|
+
*/
|
|
1251
|
+
addPivotChartsheet(name, pivotTable, options) {
|
|
1252
|
+
return this.addChartsheet(name, {
|
|
1253
|
+
...options,
|
|
1254
|
+
chart: (0, pivot_chart_1.withPivotChartSource)(pivotTable, options.chart)
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
/** Return chartsheets in workbook order. */
|
|
1258
|
+
get chartsheets() {
|
|
1259
|
+
return this._chartsheets.map(model => new chartsheet_1.Chartsheet(model, this));
|
|
1260
|
+
}
|
|
1261
|
+
getChartsheet(nameOrIndex) {
|
|
1262
|
+
const model = this._getChartsheetModel(nameOrIndex);
|
|
1263
|
+
return model ? new chartsheet_1.Chartsheet(model, this) : undefined;
|
|
1264
|
+
}
|
|
1265
|
+
removeChartsheet(nameOrIndex) {
|
|
1266
|
+
const index = typeof nameOrIndex === "number"
|
|
1267
|
+
? nameOrIndex
|
|
1268
|
+
: this._chartsheets.findIndex(sheet => sheet.name.toLowerCase() === nameOrIndex.toLowerCase());
|
|
1269
|
+
if (index < 0 || index >= this._chartsheets.length) {
|
|
1270
|
+
return false;
|
|
1271
|
+
}
|
|
1272
|
+
const [removed] = this._chartsheets.splice(index, 1);
|
|
1273
|
+
if (removed.chartNumber) {
|
|
1274
|
+
this.removeChartEntry?.(removed.chartNumber);
|
|
1275
|
+
}
|
|
1276
|
+
if (removed.chartExNumber) {
|
|
1277
|
+
this.removeChartExStructuredEntry?.(removed.chartExNumber);
|
|
1278
|
+
}
|
|
1279
|
+
return true;
|
|
1280
|
+
}
|
|
1281
|
+
_getChartsheetModel(nameOrIndex) {
|
|
1282
|
+
return typeof nameOrIndex === "number"
|
|
1283
|
+
? this._chartsheets[nameOrIndex]
|
|
1284
|
+
: this._chartsheets.find(sheet => sheet.name.toLowerCase() === nameOrIndex.toLowerCase());
|
|
1285
|
+
}
|
|
1286
|
+
renameChartsheet(nameOrIndex, name) {
|
|
1287
|
+
const model = this._getChartsheetModel(nameOrIndex);
|
|
1288
|
+
if (!model) {
|
|
1289
|
+
return false;
|
|
1290
|
+
}
|
|
1291
|
+
const currentName = model.name;
|
|
1292
|
+
if (currentName === name) {
|
|
1293
|
+
return true;
|
|
1294
|
+
}
|
|
1295
|
+
model.name = "__excelts_pending_chartsheet_rename__";
|
|
1296
|
+
try {
|
|
1297
|
+
model.name = this._validateChartsheetName(name);
|
|
1298
|
+
return true;
|
|
1299
|
+
}
|
|
1300
|
+
catch (error) {
|
|
1301
|
+
model.name = currentName;
|
|
1302
|
+
throw error;
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
copyChartsheet(nameOrIndex, name) {
|
|
1306
|
+
const source = this._getChartsheetModel(nameOrIndex);
|
|
1307
|
+
if (!source) {
|
|
1308
|
+
return undefined;
|
|
1309
|
+
}
|
|
1310
|
+
const cloneName = this._validateChartsheetName(name ?? `${source.name} Copy`);
|
|
1311
|
+
const clone = {
|
|
1312
|
+
...deepClone(source),
|
|
1313
|
+
id: this._nextSheetId(),
|
|
1314
|
+
sheetNo: this._nextChartsheetNo(),
|
|
1315
|
+
// New tab position — the clone goes to the tail of the tab
|
|
1316
|
+
// bar, matching Excel's "Duplicate" behaviour. Drop the
|
|
1317
|
+
// deep-cloned `orderNo` from the source.
|
|
1318
|
+
orderNo: this._nextSheetOrderNo(),
|
|
1319
|
+
name: cloneName,
|
|
1320
|
+
drawingName: undefined,
|
|
1321
|
+
relationships: source.relationships ? deepClone(source.relationships) : undefined
|
|
1322
|
+
};
|
|
1323
|
+
if (source.chartNumber) {
|
|
1324
|
+
const entry = this.getChartEntry(source.chartNumber);
|
|
1325
|
+
if (entry) {
|
|
1326
|
+
const chartNumber = this.nextChartNumber();
|
|
1327
|
+
// Clone the entry with ALL metadata: rawData, modelSnapshot,
|
|
1328
|
+
// dirty, preferRawPatch, requireRawPatch, rels (per-entry),
|
|
1329
|
+
// userShapesXml. A freshly-created entry carrying only `model`
|
|
1330
|
+
// would lose Excel-authored user-shape overlays, the raw-patch
|
|
1331
|
+
// fast path, and any per-entry rels that aren't in
|
|
1332
|
+
// `_chartRels`. Keeping them in lockstep means a clone of a
|
|
1333
|
+
// just-loaded chart matches the source byte-for-byte.
|
|
1334
|
+
this.addChartEntry(cloneChartEntry(entry, chartNumber));
|
|
1335
|
+
this.copyChartSidecars(source.chartNumber, chartNumber);
|
|
1336
|
+
clone.chartNumber = chartNumber;
|
|
1337
|
+
clone.chartExNumber = undefined;
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
else if (source.chartExNumber) {
|
|
1341
|
+
const entry = this.getChartExStructuredEntry(source.chartExNumber);
|
|
1342
|
+
const chartExNumber = this.nextChartExNumber();
|
|
1343
|
+
if (entry) {
|
|
1344
|
+
// Same rationale as the classic branch — carry dirty /
|
|
1345
|
+
// preferRawPatch / requireRawPatch / rawData / modelSnapshot
|
|
1346
|
+
// across the clone so the raw-patch path keeps working on
|
|
1347
|
+
// the duplicate.
|
|
1348
|
+
this.addChartExStructuredEntry(cloneChartExEntry(entry, chartExNumber));
|
|
1349
|
+
}
|
|
1350
|
+
else if (this._chartExEntries[source.chartExNumber]) {
|
|
1351
|
+
this._chartExEntries[chartExNumber] = this._chartExEntries[source.chartExNumber].slice();
|
|
1352
|
+
}
|
|
1353
|
+
// Copy the chartEx sidecars (authored rels) so the cloned
|
|
1354
|
+
// chartsheet's XML references stay valid. Previously a chartEx
|
|
1355
|
+
// with `cx14:` / media rels on the source lost every relationship
|
|
1356
|
+
// on the clone.
|
|
1357
|
+
this.copyChartExSidecars(source.chartExNumber, chartExNumber);
|
|
1358
|
+
clone.chartExNumber = chartExNumber;
|
|
1359
|
+
clone.chartNumber = undefined;
|
|
1360
|
+
}
|
|
1361
|
+
this._chartsheets.push(clone);
|
|
1362
|
+
return new chartsheet_1.Chartsheet(clone, this);
|
|
1363
|
+
}
|
|
1364
|
+
replaceChartsheetChart(nameOrIndex, chart) {
|
|
1365
|
+
const wrapper = this.getChartsheet(nameOrIndex);
|
|
1366
|
+
if (!wrapper) {
|
|
1367
|
+
return false;
|
|
1368
|
+
}
|
|
1369
|
+
const model = wrapper.model;
|
|
1370
|
+
const chartSupport = (0, chart_host_registry_1.getChartSupport)();
|
|
1371
|
+
// Build the replacement first so a malformed options object throws
|
|
1372
|
+
// *before* we remove the existing chart entry. Without this, a
|
|
1373
|
+
// failed `buildChartExModel` / `buildChartModel` would leave the
|
|
1374
|
+
// chartsheet empty (old chart nuked, new chart never registered).
|
|
1375
|
+
let newChartExModel;
|
|
1376
|
+
let newChartModel;
|
|
1377
|
+
if (isChartExOptions(chart)) {
|
|
1378
|
+
newChartExModel = chartSupport.buildChartExModel(chart);
|
|
1379
|
+
}
|
|
1380
|
+
else if (isComboChartOptions(chart)) {
|
|
1381
|
+
newChartModel = chartSupport.buildComboChartModel(chart);
|
|
1382
|
+
}
|
|
1383
|
+
else {
|
|
1384
|
+
newChartModel = chartSupport.buildChartModel(chart);
|
|
1385
|
+
}
|
|
1386
|
+
// Remove existing entries only after the new model builds cleanly.
|
|
1387
|
+
if (model.chartNumber) {
|
|
1388
|
+
this.removeChartEntry?.(model.chartNumber);
|
|
1389
|
+
model.chartNumber = undefined;
|
|
1390
|
+
}
|
|
1391
|
+
if (model.chartExNumber) {
|
|
1392
|
+
this.removeChartExStructuredEntry?.(model.chartExNumber);
|
|
1393
|
+
model.chartExNumber = undefined;
|
|
1394
|
+
}
|
|
1395
|
+
if (newChartExModel) {
|
|
1396
|
+
const chartExNumber = this.nextChartExNumber();
|
|
1397
|
+
try {
|
|
1398
|
+
chartSupport.fillChartExCaches(newChartExModel, this);
|
|
1399
|
+
}
|
|
1400
|
+
catch {
|
|
1401
|
+
// Cache population is best-effort; never let it break chart replacement.
|
|
1402
|
+
}
|
|
1403
|
+
this.addChartExStructuredEntry({ chartExNumber, model: newChartExModel });
|
|
1404
|
+
model.chartExNumber = chartExNumber;
|
|
1405
|
+
}
|
|
1406
|
+
else if (newChartModel) {
|
|
1407
|
+
const chartNumber = this.nextChartNumber();
|
|
1408
|
+
try {
|
|
1409
|
+
chartSupport.fillChartCaches(newChartModel, this);
|
|
1410
|
+
}
|
|
1411
|
+
catch {
|
|
1412
|
+
// Cache population is best-effort; never let it break chart replacement.
|
|
1413
|
+
}
|
|
1414
|
+
const entry = { chartNumber, model: newChartModel };
|
|
1415
|
+
// Resolve programmatic `series.spPr.fill.blip._pendingImage`
|
|
1416
|
+
// payloads — matches the classic `addChart` and `addChartsheet`
|
|
1417
|
+
// paths. Previously replacement via `replaceChartsheetChart`
|
|
1418
|
+
// silently dropped picture-fill payloads on the floor.
|
|
1419
|
+
try {
|
|
1420
|
+
chartSupport.resolvePendingChartImages(entry, this, chartNumber);
|
|
1421
|
+
}
|
|
1422
|
+
catch {
|
|
1423
|
+
// Image resolution is best-effort; a broken image payload
|
|
1424
|
+
// should never take down chart replacement.
|
|
1425
|
+
}
|
|
1426
|
+
this.addChartEntry(entry);
|
|
1427
|
+
this._applyChartsheetSidecars(chartNumber, chart);
|
|
1428
|
+
model.chartNumber = chartNumber;
|
|
1429
|
+
}
|
|
1430
|
+
return true;
|
|
1431
|
+
}
|
|
1006
1432
|
/**
|
|
1007
1433
|
* Iterate over all sheets.
|
|
1008
1434
|
*
|
|
@@ -1019,6 +1445,47 @@ class Workbook {
|
|
|
1019
1445
|
get definedNames() {
|
|
1020
1446
|
return this._definedNames;
|
|
1021
1447
|
}
|
|
1448
|
+
/**
|
|
1449
|
+
* Workbook-level directory of people referenced by threaded comments.
|
|
1450
|
+
* Mutating the returned array adds/removes entries in the persistent
|
|
1451
|
+
* state; writers emit `xl/persons/person.xml` only when this list is
|
|
1452
|
+
* non-empty.
|
|
1453
|
+
*
|
|
1454
|
+
* Most callers don't need to touch this directly — creating a
|
|
1455
|
+
* {@link ThreadedComment} through `cell.note` handles registration
|
|
1456
|
+
* automatically.
|
|
1457
|
+
*/
|
|
1458
|
+
get persons() {
|
|
1459
|
+
return this._persons;
|
|
1460
|
+
}
|
|
1461
|
+
/**
|
|
1462
|
+
* Register a person in the workbook persons list and return its id.
|
|
1463
|
+
*
|
|
1464
|
+
* When an entry with the same {@link displayName} + {@link userId}
|
|
1465
|
+
* already exists, its existing id is returned so duplicate
|
|
1466
|
+
* commenters collapse onto a single entry. New entries receive a
|
|
1467
|
+
* synthesised `{GUID}` id.
|
|
1468
|
+
*
|
|
1469
|
+
* @param displayName — shown in the comment bubble author line
|
|
1470
|
+
* @param userId — optional identity-provider user id (email / SID)
|
|
1471
|
+
* @param providerId — optional provider identifier ("AD", …)
|
|
1472
|
+
*/
|
|
1473
|
+
registerPerson(displayName, userId, providerId) {
|
|
1474
|
+
const existing = this._persons.find(p => p.displayName === displayName && p.userId === userId);
|
|
1475
|
+
if (existing) {
|
|
1476
|
+
return existing.id;
|
|
1477
|
+
}
|
|
1478
|
+
const id = `{${(0, guid_1.synthGuid)()}}`;
|
|
1479
|
+
const entry = { id, displayName };
|
|
1480
|
+
if (userId !== undefined) {
|
|
1481
|
+
entry.userId = userId;
|
|
1482
|
+
}
|
|
1483
|
+
if (providerId !== undefined) {
|
|
1484
|
+
entry.providerId = providerId;
|
|
1485
|
+
}
|
|
1486
|
+
this._persons.push(entry);
|
|
1487
|
+
return id;
|
|
1488
|
+
}
|
|
1022
1489
|
// ===========================================================================
|
|
1023
1490
|
// Formula Calculation
|
|
1024
1491
|
// ===========================================================================
|
|
@@ -1134,6 +1601,371 @@ class Workbook {
|
|
|
1134
1601
|
return this.media[Number(id)];
|
|
1135
1602
|
}
|
|
1136
1603
|
// ===========================================================================
|
|
1604
|
+
// Charts
|
|
1605
|
+
// ===========================================================================
|
|
1606
|
+
/**
|
|
1607
|
+
* Return the next available 1-based chart number.
|
|
1608
|
+
*/
|
|
1609
|
+
nextChartNumber() {
|
|
1610
|
+
const existing = Object.keys(this._chartEntries).map(Number);
|
|
1611
|
+
return existing.length > 0 ? Math.max(...existing) + 1 : 1;
|
|
1612
|
+
}
|
|
1613
|
+
/**
|
|
1614
|
+
* Store a chart entry in the workbook (keyed by chartNumber).
|
|
1615
|
+
*/
|
|
1616
|
+
addChartEntry(entry) {
|
|
1617
|
+
this._chartEntries[entry.chartNumber] = entry;
|
|
1618
|
+
}
|
|
1619
|
+
setChartStyle(chartNumber, data) {
|
|
1620
|
+
this._chartStyles[chartNumber] = data;
|
|
1621
|
+
}
|
|
1622
|
+
setChartColors(chartNumber, data) {
|
|
1623
|
+
this._chartColors[chartNumber] = data;
|
|
1624
|
+
}
|
|
1625
|
+
copyChartSidecars(sourceChartNumber, targetChartNumber, targetWorkbook = this) {
|
|
1626
|
+
const style = this._chartStyles[sourceChartNumber];
|
|
1627
|
+
if (style) {
|
|
1628
|
+
targetWorkbook.setChartStyle(targetChartNumber, style.slice());
|
|
1629
|
+
}
|
|
1630
|
+
const colors = this._chartColors[sourceChartNumber];
|
|
1631
|
+
if (colors) {
|
|
1632
|
+
targetWorkbook.setChartColors(targetChartNumber, colors.slice());
|
|
1633
|
+
}
|
|
1634
|
+
// Copy the full chart rels bag (`_chartRels`), not just the
|
|
1635
|
+
// style/colors pair. A classic chart can carry rels to embedded
|
|
1636
|
+
// images (pictureFill), external data links, and `<c:userShapes>`
|
|
1637
|
+
// drawing parts — without copying those the clone ends up with
|
|
1638
|
+
// dangling rIds. Deep-copy each rel so a later mutation on the
|
|
1639
|
+
// source doesn't leak into the clone.
|
|
1640
|
+
//
|
|
1641
|
+
// Rewrite style/colors Targets to the destination chart number —
|
|
1642
|
+
// verbatim copy would leave the rel pointing at the source's
|
|
1643
|
+
// `style{src}.xml`, while the writer emits `style{dst}.xml` and
|
|
1644
|
+
// produces a chart whose .rels references a non-existent file.
|
|
1645
|
+
//
|
|
1646
|
+
// For image rels on a cross-workbook copy (`targetWorkbook !==
|
|
1647
|
+
// this`), re-register each referenced image in the destination
|
|
1648
|
+
// workbook and rewrite the Target to point at the new media
|
|
1649
|
+
// file. Without this, a pictureFill that round-tripped through
|
|
1650
|
+
// `importSheet` pointed at the source workbook's media array —
|
|
1651
|
+
// which the destination package doesn't ship, so Excel shows a
|
|
1652
|
+
// broken image icon.
|
|
1653
|
+
const srcRels = this._chartRels[sourceChartNumber];
|
|
1654
|
+
if (Array.isArray(srcRels) && srcRels.length > 0) {
|
|
1655
|
+
const crossWorkbook = targetWorkbook !== this;
|
|
1656
|
+
targetWorkbook._chartRels[targetChartNumber] = srcRels.map(rel => {
|
|
1657
|
+
if (typeof rel !== "object" || rel === null) {
|
|
1658
|
+
return rel;
|
|
1659
|
+
}
|
|
1660
|
+
const cloned = { ...rel };
|
|
1661
|
+
const target = typeof cloned.Target === "string" ? cloned.Target : undefined;
|
|
1662
|
+
if (target) {
|
|
1663
|
+
if (/^style\d+\.xml$/.test(target)) {
|
|
1664
|
+
cloned.Target = `style${targetChartNumber}.xml`;
|
|
1665
|
+
}
|
|
1666
|
+
else if (/^colors\d+\.xml$/.test(target)) {
|
|
1667
|
+
cloned.Target = `colors${targetChartNumber}.xml`;
|
|
1668
|
+
}
|
|
1669
|
+
else if (crossWorkbook && cloned.Type === rel_type_1.RelType.Image) {
|
|
1670
|
+
const rewritten = this._rewriteCrossWorkbookImageTarget(target, targetWorkbook);
|
|
1671
|
+
if (rewritten !== undefined) {
|
|
1672
|
+
cloned.Target = rewritten;
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
return cloned;
|
|
1677
|
+
});
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
/**
|
|
1681
|
+
* Copy the media referenced by `target` (e.g. `../media/image3.png`)
|
|
1682
|
+
* from this workbook's media collection into `targetWorkbook`, then
|
|
1683
|
+
* return the rewritten Target pointing at the destination workbook's
|
|
1684
|
+
* copy. Returns `undefined` when the source media can't be
|
|
1685
|
+
* resolved — callers leave the original target in place and let
|
|
1686
|
+
* the writer emit a broken rel (same degradation as before the
|
|
1687
|
+
* cross-workbook rewrite landed).
|
|
1688
|
+
*
|
|
1689
|
+
* The on-disk naming convention is determined by the destination
|
|
1690
|
+
* workbook's `addImage`, so we take the `id` the new image gets and
|
|
1691
|
+
* compute `../media/image{id+1}.{ext}` (the same formula used in
|
|
1692
|
+
* `chart-images.ts:resolvePendingChartImages`). Centralising the
|
|
1693
|
+
* mapping here keeps the cross-workbook copy robust against future
|
|
1694
|
+
* media-naming changes on either workbook.
|
|
1695
|
+
*/
|
|
1696
|
+
_rewriteCrossWorkbookImageTarget(target, targetWorkbook) {
|
|
1697
|
+
const match = /\/media\/image(\d+)\.([a-zA-Z0-9]+)$/.exec(target);
|
|
1698
|
+
if (!match) {
|
|
1699
|
+
return undefined;
|
|
1700
|
+
}
|
|
1701
|
+
const sourceMediaIndex = parseInt(match[1], 10) - 1;
|
|
1702
|
+
if (!Number.isFinite(sourceMediaIndex) || sourceMediaIndex < 0) {
|
|
1703
|
+
return undefined;
|
|
1704
|
+
}
|
|
1705
|
+
const medium = this.getImage?.(sourceMediaIndex);
|
|
1706
|
+
if (!medium) {
|
|
1707
|
+
return undefined;
|
|
1708
|
+
}
|
|
1709
|
+
const ext = medium.extension;
|
|
1710
|
+
if (ext !== "png" && ext !== "jpeg" && ext !== "gif") {
|
|
1711
|
+
return undefined;
|
|
1712
|
+
}
|
|
1713
|
+
const payload = {
|
|
1714
|
+
extension: ext
|
|
1715
|
+
};
|
|
1716
|
+
// `instanceof Uint8Array` is realm-sensitive: buffers that crossed
|
|
1717
|
+
// a Worker / iframe / `structuredClone` boundary carry a different
|
|
1718
|
+
// `Uint8Array` prototype and fail the operator even though they
|
|
1719
|
+
// are byte-granular typed arrays. Duck-type via `ArrayBuffer.isView`
|
|
1720
|
+
// + `BYTES_PER_ELEMENT === 1` so cross-workbook copies from a
|
|
1721
|
+
// worker-loaded Workbook preserve the image bytes; otherwise the
|
|
1722
|
+
// copy path silently falls through to `return undefined`, dropping
|
|
1723
|
+
// every image from the chart. Matches `chart-images.ts`'s handling
|
|
1724
|
+
// of the same realm-crossing issue.
|
|
1725
|
+
const buf = medium.buffer;
|
|
1726
|
+
if (buf &&
|
|
1727
|
+
ArrayBuffer.isView(buf) &&
|
|
1728
|
+
buf.BYTES_PER_ELEMENT === 1) {
|
|
1729
|
+
payload.buffer =
|
|
1730
|
+
buf instanceof Uint8Array
|
|
1731
|
+
? buf.slice()
|
|
1732
|
+
: new Uint8Array(buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength));
|
|
1733
|
+
}
|
|
1734
|
+
else if (typeof medium.base64 === "string") {
|
|
1735
|
+
payload.base64 = medium.base64;
|
|
1736
|
+
}
|
|
1737
|
+
else {
|
|
1738
|
+
return undefined;
|
|
1739
|
+
}
|
|
1740
|
+
const newId = targetWorkbook.addImage(payload);
|
|
1741
|
+
return `../media/image${newId + 1}.${ext}`;
|
|
1742
|
+
}
|
|
1743
|
+
/**
|
|
1744
|
+
* Copy the ChartEx-specific sidecar state from one `chartExNumber` slot
|
|
1745
|
+
* to another. Classic charts have `copyChartSidecars` for chart-style /
|
|
1746
|
+
* chart-colors; ChartEx charts carry their own `_chartExRels`
|
|
1747
|
+
* (relationship entries for extension packages, embedded images, etc.)
|
|
1748
|
+
* that the classic helper does not touch. Without this, cloning a
|
|
1749
|
+
* ChartEx via {@link Chart.copyTo} / {@link Chartsheet.clone} silently
|
|
1750
|
+
* dropped every relationship the source had — authored `cx14:`
|
|
1751
|
+
* extensions, embedded custom geometry, or linked media ended up
|
|
1752
|
+
* pointing at an undefined rel id on the clone.
|
|
1753
|
+
*/
|
|
1754
|
+
copyChartExSidecars(sourceChartExNumber, targetChartExNumber, targetWorkbook = this) {
|
|
1755
|
+
const rels = this._chartExRels[sourceChartExNumber];
|
|
1756
|
+
if (rels && rels.length > 0) {
|
|
1757
|
+
// Rewrite `Target` for rels that point at numbered sidecars
|
|
1758
|
+
// (styleEx / colorsEx / userShapes). Those files get different
|
|
1759
|
+
// on-disk numbers on the clone — copying the rel verbatim
|
|
1760
|
+
// leaves it pointing at the source's sidecar, so saving the
|
|
1761
|
+
// package produces a chartEx whose .rels references
|
|
1762
|
+
// `styleEx{src}.xml` while the writer emits `styleEx{dst}.xml`.
|
|
1763
|
+
// Strip the number from the source Target and re-stamp it with
|
|
1764
|
+
// the target's number.
|
|
1765
|
+
//
|
|
1766
|
+
// For image rels on a cross-workbook copy (`targetWorkbook !==
|
|
1767
|
+
// this`), re-register each referenced image in the destination
|
|
1768
|
+
// workbook and rewrite the Target — same logic as classic chart
|
|
1769
|
+
// sidecars. Without this, a ChartEx with embedded images (e.g.
|
|
1770
|
+
// pictureFill or custom geometry) would reference media that
|
|
1771
|
+
// doesn't exist in the destination package.
|
|
1772
|
+
const crossWorkbook = targetWorkbook !== this;
|
|
1773
|
+
targetWorkbook._chartExRels[targetChartExNumber] = rels.map(r => {
|
|
1774
|
+
if (typeof r !== "object" || r === null) {
|
|
1775
|
+
return r;
|
|
1776
|
+
}
|
|
1777
|
+
const cloned = { ...r };
|
|
1778
|
+
const target = typeof cloned.Target === "string" ? cloned.Target : undefined;
|
|
1779
|
+
if (target) {
|
|
1780
|
+
const styleExMatch = /^styleEx\d+\.xml$/.exec(target);
|
|
1781
|
+
if (styleExMatch) {
|
|
1782
|
+
cloned.Target = `styleEx${targetChartExNumber}.xml`;
|
|
1783
|
+
}
|
|
1784
|
+
else if (/^colorsEx\d+\.xml$/.exec(target)) {
|
|
1785
|
+
cloned.Target = `colorsEx${targetChartExNumber}.xml`;
|
|
1786
|
+
}
|
|
1787
|
+
else if (crossWorkbook && cloned.Type === rel_type_1.RelType.Image) {
|
|
1788
|
+
const rewritten = this._rewriteCrossWorkbookImageTarget(target, targetWorkbook);
|
|
1789
|
+
if (rewritten !== undefined) {
|
|
1790
|
+
cloned.Target = rewritten;
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
return cloned;
|
|
1795
|
+
});
|
|
1796
|
+
}
|
|
1797
|
+
// ChartEx style / colors sidecars (matching `_chartStyles` /
|
|
1798
|
+
// `_chartColors` for classic charts). Previously only `_chartExRels`
|
|
1799
|
+
// was copied — a cloned chartEx lost its authored chartExStyle and
|
|
1800
|
+
// chartExColors bytes, so the saved package re-derived them from
|
|
1801
|
+
// defaults and the clone looked different from the source.
|
|
1802
|
+
const exStyle = this._chartExStyles[sourceChartExNumber];
|
|
1803
|
+
if (exStyle) {
|
|
1804
|
+
targetWorkbook._chartExStyles[targetChartExNumber] = exStyle.slice();
|
|
1805
|
+
}
|
|
1806
|
+
const exColors = this._chartExColors[sourceChartExNumber];
|
|
1807
|
+
if (exColors) {
|
|
1808
|
+
targetWorkbook._chartExColors[targetChartExNumber] = exColors.slice();
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
_applyChartsheetSidecars(chartNumber, chartOptions) {
|
|
1812
|
+
if (isChartExOptions(chartOptions)) {
|
|
1813
|
+
return;
|
|
1814
|
+
}
|
|
1815
|
+
if (!chartOptions.chartStyle && !chartOptions.chartColors) {
|
|
1816
|
+
return;
|
|
1817
|
+
}
|
|
1818
|
+
const chartSupport = (0, chart_host_registry_1.getChartSupport)();
|
|
1819
|
+
if (chartOptions.chartStyle) {
|
|
1820
|
+
this.setChartStyle(chartNumber, new TextEncoder().encode(chartSupport.buildChartStyle(chartOptions.chartStyle)));
|
|
1821
|
+
}
|
|
1822
|
+
if (chartOptions.chartColors) {
|
|
1823
|
+
this.setChartColors(chartNumber, new TextEncoder().encode(chartSupport.buildChartColors(chartOptions.chartColors)));
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
/**
|
|
1827
|
+
* Retrieve a chart entry by its 1-based chart number.
|
|
1828
|
+
*/
|
|
1829
|
+
getChartEntry(chartNumber) {
|
|
1830
|
+
return this._chartEntries[chartNumber];
|
|
1831
|
+
}
|
|
1832
|
+
/**
|
|
1833
|
+
* Remove a chart entry from the workbook.
|
|
1834
|
+
* Safe to call even if the chart number doesn't exist.
|
|
1835
|
+
*/
|
|
1836
|
+
removeChartEntry(chartNumber) {
|
|
1837
|
+
delete this._chartEntries[chartNumber];
|
|
1838
|
+
delete this._chartRels[chartNumber];
|
|
1839
|
+
delete this._chartStyles[chartNumber];
|
|
1840
|
+
delete this._chartColors[chartNumber];
|
|
1841
|
+
}
|
|
1842
|
+
// ===========================================================================
|
|
1843
|
+
// ChartEx (Office 2016+) structured entries
|
|
1844
|
+
// ===========================================================================
|
|
1845
|
+
/** Return the next available 1-based chartEx number. */
|
|
1846
|
+
nextChartExNumber() {
|
|
1847
|
+
const rawKeys = Object.keys(this._chartExEntries ?? {}).map(Number);
|
|
1848
|
+
const structKeys = Object.keys(this._chartExStructuredEntries ?? {}).map(Number);
|
|
1849
|
+
const combined = [...rawKeys, ...structKeys];
|
|
1850
|
+
return combined.length > 0 ? Math.max(...combined) + 1 : 1;
|
|
1851
|
+
}
|
|
1852
|
+
/**
|
|
1853
|
+
* Store a structured chartEx entry.
|
|
1854
|
+
* Loaded entries may also keep raw bytes for clean passthrough.
|
|
1855
|
+
*/
|
|
1856
|
+
addChartExStructuredEntry(entry) {
|
|
1857
|
+
if (!this._chartExStructuredEntries) {
|
|
1858
|
+
this._chartExStructuredEntries = {};
|
|
1859
|
+
}
|
|
1860
|
+
this._chartExStructuredEntries[entry.chartExNumber] = entry;
|
|
1861
|
+
}
|
|
1862
|
+
/** Get a structured chartEx entry by number. */
|
|
1863
|
+
getChartExStructuredEntry(chartExNumber) {
|
|
1864
|
+
return this._chartExStructuredEntries?.[chartExNumber];
|
|
1865
|
+
}
|
|
1866
|
+
_nextChartsheetNo() {
|
|
1867
|
+
const existing = this._chartsheets.map(cs => cs.sheetNo).filter(Number.isFinite);
|
|
1868
|
+
return existing.length > 0 ? Math.max(...existing) + 1 : 1;
|
|
1869
|
+
}
|
|
1870
|
+
/**
|
|
1871
|
+
* Next value for the unified `orderNo` (tab-bar position) counter
|
|
1872
|
+
* shared between worksheets and chartsheets. Used by the writer's
|
|
1873
|
+
* `prepare()` to emit `<sheets>` in the author's insertion order,
|
|
1874
|
+
* preserving interleaved `[ws, cs, ws]` layouts that the old
|
|
1875
|
+
* sheetNo-based sort used to reshuffle.
|
|
1876
|
+
*/
|
|
1877
|
+
_nextSheetOrderNo() {
|
|
1878
|
+
let max = -1;
|
|
1879
|
+
for (const ws of this._worksheets) {
|
|
1880
|
+
if (ws && typeof ws.orderNo === "number" && ws.orderNo > max) {
|
|
1881
|
+
max = ws.orderNo;
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
for (const cs of this._chartsheets) {
|
|
1885
|
+
if (typeof cs.orderNo === "number" && cs.orderNo > max) {
|
|
1886
|
+
max = cs.orderNo;
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
return max + 1;
|
|
1890
|
+
}
|
|
1891
|
+
_nextSheetId() {
|
|
1892
|
+
const worksheetIds = this.worksheets.map(ws => ws.id);
|
|
1893
|
+
const chartsheetIds = this._chartsheets.map(cs => cs.id).filter(Number.isFinite);
|
|
1894
|
+
const ids = [...worksheetIds, ...chartsheetIds];
|
|
1895
|
+
return ids.length > 0 ? Math.max(...ids) + 1 : 1;
|
|
1896
|
+
}
|
|
1897
|
+
/**
|
|
1898
|
+
* Validate a sheet name (worksheet OR chartsheet) against Excel's
|
|
1899
|
+
* single unified namespace. Returns the (possibly truncated) name on
|
|
1900
|
+
* success; throws {@link WorksheetNameError} on invalid input.
|
|
1901
|
+
*
|
|
1902
|
+
* Unifying the check at the workbook level fixes three related
|
|
1903
|
+
* regressions that used to exist in the per-family validators:
|
|
1904
|
+
* 1. `Worksheet.name` setter only cross-checked against other
|
|
1905
|
+
* worksheets, so `addChartsheet("S")` followed by
|
|
1906
|
+
* `addWorksheet("S")` silently produced a duplicate tab name.
|
|
1907
|
+
* 2. The chartsheet regex was missing the backslash, so
|
|
1908
|
+
* `addChartsheet("A\\B")` sneaked through — Excel rejects it.
|
|
1909
|
+
* 3. `Chartsheet.name = …` bypassed validation entirely, letting
|
|
1910
|
+
* users mutate the model into a corrupt state.
|
|
1911
|
+
*
|
|
1912
|
+
* @param name - Proposed sheet name. `undefined` / empty / over-31
|
|
1913
|
+
* chars / containing any of `* ? : \\ / [ ]` / leading or trailing
|
|
1914
|
+
* single-quote is rejected. Names ≤31 chars are passed through;
|
|
1915
|
+
* longer ones are truncated (non-production builds emit a warning).
|
|
1916
|
+
* @param existing - The sheet being renamed (if any) — it is
|
|
1917
|
+
* excluded from the duplicate check so `sheet.name = sheet.name`
|
|
1918
|
+
* is a no-op rather than a self-collision.
|
|
1919
|
+
*/
|
|
1920
|
+
validateSheetName(name, existing) {
|
|
1921
|
+
if (typeof name !== "string") {
|
|
1922
|
+
throw new errors_1.WorksheetNameError("The name has to be a string.");
|
|
1923
|
+
}
|
|
1924
|
+
if (name === "") {
|
|
1925
|
+
throw new errors_1.WorksheetNameError("The name can't be empty.");
|
|
1926
|
+
}
|
|
1927
|
+
if (name === "History") {
|
|
1928
|
+
throw new errors_1.WorksheetNameError('The name "History" is protected. Please use a different name.');
|
|
1929
|
+
}
|
|
1930
|
+
// Illegal characters per Excel's own naming rules: asterisk (*),
|
|
1931
|
+
// question mark (?), colon (:), forward slash (/), backslash (\),
|
|
1932
|
+
// left bracket ([), right bracket (]). The chartsheet regex used
|
|
1933
|
+
// to omit `\\`; unified here so both families enforce the same
|
|
1934
|
+
// char set.
|
|
1935
|
+
if (/[*?:/\\[\]]/.test(name)) {
|
|
1936
|
+
throw new errors_1.WorksheetNameError(`Sheet name ${name} cannot include any of the following characters: * ? : \\ / [ ]`);
|
|
1937
|
+
}
|
|
1938
|
+
if (/(^')|('$)/.test(name)) {
|
|
1939
|
+
throw new errors_1.WorksheetNameError(`The first or last character of sheet name cannot be a single quotation mark: ${name}`);
|
|
1940
|
+
}
|
|
1941
|
+
if (name.length > 31) {
|
|
1942
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1943
|
+
console.warn(`Sheet name ${name} exceeds 31 chars. This will be truncated`);
|
|
1944
|
+
}
|
|
1945
|
+
name = name.substring(0, 31);
|
|
1946
|
+
}
|
|
1947
|
+
const nameLower = name.toLowerCase();
|
|
1948
|
+
const duplicateWorksheet = this.worksheets.find(ws => ws && ws !== existing && ws.name.toLowerCase() === nameLower);
|
|
1949
|
+
const duplicateChartsheet = this._chartsheets.find(cs => cs && cs !== existing && cs.name.toLowerCase() === nameLower);
|
|
1950
|
+
if (duplicateWorksheet || duplicateChartsheet) {
|
|
1951
|
+
throw new errors_1.WorksheetNameError(`Sheet name already exists: ${name}`);
|
|
1952
|
+
}
|
|
1953
|
+
return name;
|
|
1954
|
+
}
|
|
1955
|
+
_validateChartsheetName(name) {
|
|
1956
|
+
return this.validateSheetName(name);
|
|
1957
|
+
}
|
|
1958
|
+
/** Remove a structured chartEx entry. */
|
|
1959
|
+
removeChartExStructuredEntry(chartExNumber) {
|
|
1960
|
+
if (this._chartExStructuredEntries) {
|
|
1961
|
+
delete this._chartExStructuredEntries[chartExNumber];
|
|
1962
|
+
}
|
|
1963
|
+
delete this._chartExEntries[chartExNumber];
|
|
1964
|
+
delete this._chartExRels[chartExNumber];
|
|
1965
|
+
delete this._chartExStyles[chartExNumber];
|
|
1966
|
+
delete this._chartExColors[chartExNumber];
|
|
1967
|
+
}
|
|
1968
|
+
// ===========================================================================
|
|
1137
1969
|
// External Workbook Links
|
|
1138
1970
|
// ===========================================================================
|
|
1139
1971
|
/**
|
|
@@ -1287,6 +2119,12 @@ class Workbook {
|
|
|
1287
2119
|
worksheets: this.worksheets.map(worksheet => worksheet.model),
|
|
1288
2120
|
sheets: this.worksheets.map(ws => ws.model).filter(Boolean),
|
|
1289
2121
|
definedNames: this._definedNames.model,
|
|
2122
|
+
// Live `DefinedNames` instance — required by the write-time
|
|
2123
|
+
// chartEx transform `prepareChartExSidecars`, which registers
|
|
2124
|
+
// hidden `_xlchart.vN.M` names on the fly and needs an object
|
|
2125
|
+
// that can mutate in place. The serialised `definedNames`
|
|
2126
|
+
// array above is re-materialised after the transform runs.
|
|
2127
|
+
definedNamesInstance: this._definedNames,
|
|
1290
2128
|
views: this.views,
|
|
1291
2129
|
company: this.company,
|
|
1292
2130
|
manager: this.manager,
|
|
@@ -1302,10 +2140,23 @@ class Workbook {
|
|
|
1302
2140
|
media: this.media,
|
|
1303
2141
|
pivotTables: this.pivotTables,
|
|
1304
2142
|
calcProperties: this.calcProperties,
|
|
1305
|
-
passthrough: this._passthrough,
|
|
1306
|
-
rawDrawings: this._rawDrawings,
|
|
1307
2143
|
defaultFont: this._defaultFont,
|
|
1308
|
-
externalLinks: this.externalLinks
|
|
2144
|
+
externalLinks: this.externalLinks,
|
|
2145
|
+
chartEntries: this._chartEntries,
|
|
2146
|
+
chartRels: this._chartRels,
|
|
2147
|
+
chartStyles: this._chartStyles,
|
|
2148
|
+
chartColors: this._chartColors,
|
|
2149
|
+
chartExStyles: this._chartExStyles,
|
|
2150
|
+
chartExColors: this._chartExColors,
|
|
2151
|
+
chartExEntries: this._chartExEntries,
|
|
2152
|
+
chartExRels: this._chartExRels,
|
|
2153
|
+
chartExStructuredEntries: this._chartExStructuredEntries,
|
|
2154
|
+
chartsheets: this._chartsheets,
|
|
2155
|
+
persons: this._persons,
|
|
2156
|
+
slicerParts: this._slicerParts,
|
|
2157
|
+
slicerCacheParts: this._slicerCacheParts,
|
|
2158
|
+
timelineParts: this._timelineParts,
|
|
2159
|
+
timelineCacheParts: this._timelineCacheParts
|
|
1309
2160
|
};
|
|
1310
2161
|
}
|
|
1311
2162
|
set model(value) {
|
|
@@ -1348,12 +2199,44 @@ class Workbook {
|
|
|
1348
2199
|
// Handle pivot tables - either newly created or loaded from file
|
|
1349
2200
|
// Loaded pivot tables come from loadedPivotTables after reconciliation
|
|
1350
2201
|
this.pivotTables = value.pivotTables || value.loadedPivotTables || [];
|
|
1351
|
-
// Preserve passthrough files (charts, etc.) for round-trip preservation
|
|
1352
|
-
this._passthrough = value.passthrough || {};
|
|
1353
|
-
// Preserve raw drawing data for drawings with chart references
|
|
1354
|
-
this._rawDrawings = value.rawDrawings || {};
|
|
1355
2202
|
// Preserve default font for round-trip fidelity
|
|
1356
2203
|
this._defaultFont = value.defaultFont;
|
|
2204
|
+
// Restore chart entries
|
|
2205
|
+
this._chartEntries = value.chartEntries || {};
|
|
2206
|
+
this._chartRels = value.chartRels || {};
|
|
2207
|
+
this._chartStyles = value.chartStyles || {};
|
|
2208
|
+
this._chartColors = value.chartColors || {};
|
|
2209
|
+
this._chartExStyles = value.chartExStyles || {};
|
|
2210
|
+
this._chartExColors = value.chartExColors || {};
|
|
2211
|
+
this._chartExEntries = value.chartExEntries || {};
|
|
2212
|
+
this._chartExRels = value.chartExRels || {};
|
|
2213
|
+
this._chartExStructuredEntries = value.chartExStructuredEntries || {};
|
|
2214
|
+
// Restore chartsheets. Populate each chartsheet's `orderNo` from
|
|
2215
|
+
// the position in `value.sheets` (workbook.xml tab order) so the
|
|
2216
|
+
// writer's `prepare()` can sort interleaved worksheets +
|
|
2217
|
+
// chartsheets back into the author's layout. Matches the
|
|
2218
|
+
// equivalent loop above for worksheets.
|
|
2219
|
+
this._chartsheets = value.chartsheets || [];
|
|
2220
|
+
if (value.sheets) {
|
|
2221
|
+
for (const cs of this._chartsheets) {
|
|
2222
|
+
const idx = value.sheets.findIndex((s) => s.id === cs.id);
|
|
2223
|
+
if (idx !== -1) {
|
|
2224
|
+
cs.orderNo = idx;
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
// Restore threaded-comment person directory. Always assign a new
|
|
2229
|
+
// list so callers editing the previous value don't mutate the
|
|
2230
|
+
// newly-loaded workbook by accident.
|
|
2231
|
+
this._persons = value.persons ? [...value.persons] : [];
|
|
2232
|
+
// Restore raw-passthrough slicer/timeline parts so dashboards
|
|
2233
|
+
// survive round-trip. The maps are stored by reference — loaders
|
|
2234
|
+
// and writers treat them as read-only; mutating them between
|
|
2235
|
+
// load and save is not supported.
|
|
2236
|
+
this._slicerParts = value.slicerParts ?? {};
|
|
2237
|
+
this._slicerCacheParts = value.slicerCacheParts ?? {};
|
|
2238
|
+
this._timelineParts = value.timelineParts ?? {};
|
|
2239
|
+
this._timelineCacheParts = value.timelineCacheParts ?? {};
|
|
1357
2240
|
// Preserve external workbook references (empty array if none)
|
|
1358
2241
|
this.externalLinks = value.externalLinks ? [...value.externalLinks] : [];
|
|
1359
2242
|
// Reset the writer-scoped auto-discovery cache — loading a fresh
|
|
@@ -1371,11 +2254,63 @@ exports.Workbook = Workbook;
|
|
|
1371
2254
|
* // Node.js: new Workbook.Writer({ filename: "large.xlsx" })
|
|
1372
2255
|
* // Browser: new Workbook.Writer({ stream: writableStream })
|
|
1373
2256
|
*/
|
|
1374
|
-
Workbook.Writer =
|
|
2257
|
+
Workbook.Writer = workbook_writer_browser_1.WorkbookWriter;
|
|
1375
2258
|
/**
|
|
1376
2259
|
* Streaming workbook reader class for large files.
|
|
1377
2260
|
* @example
|
|
1378
2261
|
* // Node.js: new Workbook.Reader("large.xlsx")
|
|
1379
2262
|
* // Browser: new Workbook.Reader(readableStream)
|
|
1380
2263
|
*/
|
|
1381
|
-
Workbook.Reader =
|
|
2264
|
+
Workbook.Reader = workbook_reader_browser_1.WorkbookReader;
|
|
2265
|
+
function deepClone(value) {
|
|
2266
|
+
if (typeof structuredClone === "function") {
|
|
2267
|
+
return structuredClone(value);
|
|
2268
|
+
}
|
|
2269
|
+
return JSON.parse(JSON.stringify(value));
|
|
2270
|
+
}
|
|
2271
|
+
/**
|
|
2272
|
+
* Deep-copy a {@link ChartEntry}, preserving every field that affects
|
|
2273
|
+
* write-time behaviour — rawData (for the raw-patch fast path),
|
|
2274
|
+
* modelSnapshot (change detection), dirty / preferRawPatch /
|
|
2275
|
+
* requireRawPatch (writer hints), style / colors (ancillary parts),
|
|
2276
|
+
* rels (per-entry relationship bag), and userShapesXml (annotation
|
|
2277
|
+
* overlay). The caller supplies the new `chartNumber`; everything
|
|
2278
|
+
* else is a structural clone so later mutations on one entry don't
|
|
2279
|
+
* leak into the other.
|
|
2280
|
+
*
|
|
2281
|
+
* `rawData` and `userShapesXml` are `Uint8Array`s — `.slice()` is
|
|
2282
|
+
* used instead of `structuredClone` to keep the fast path cheap.
|
|
2283
|
+
*/
|
|
2284
|
+
function cloneChartEntry(entry, chartNumber) {
|
|
2285
|
+
return {
|
|
2286
|
+
chartNumber,
|
|
2287
|
+
model: deepClone(entry.model),
|
|
2288
|
+
...(entry.rawData ? { rawData: entry.rawData.slice() } : {}),
|
|
2289
|
+
...(entry.modelSnapshot !== undefined ? { modelSnapshot: entry.modelSnapshot } : {}),
|
|
2290
|
+
...(entry.dirty !== undefined ? { dirty: entry.dirty } : {}),
|
|
2291
|
+
...(entry.preferRawPatch !== undefined ? { preferRawPatch: entry.preferRawPatch } : {}),
|
|
2292
|
+
...(entry.requireRawPatch !== undefined ? { requireRawPatch: entry.requireRawPatch } : {}),
|
|
2293
|
+
...(entry.style ? { style: deepClone(entry.style) } : {}),
|
|
2294
|
+
...(entry.colors ? { colors: deepClone(entry.colors) } : {}),
|
|
2295
|
+
...(entry.rels ? { rels: entry.rels.map(r => ({ ...r })) } : {}),
|
|
2296
|
+
...(entry.userShapesXml ? { userShapesXml: entry.userShapesXml.slice() } : {})
|
|
2297
|
+
};
|
|
2298
|
+
}
|
|
2299
|
+
/**
|
|
2300
|
+
* Deep-copy a {@link ChartExEntry}, preserving the same write-time
|
|
2301
|
+
* fields as {@link cloneChartEntry} but for the ChartEx family
|
|
2302
|
+
* (structured model + rawData + dirty / preferRawPatch /
|
|
2303
|
+
* requireRawPatch + rels).
|
|
2304
|
+
*/
|
|
2305
|
+
function cloneChartExEntry(entry, chartExNumber) {
|
|
2306
|
+
return {
|
|
2307
|
+
chartExNumber,
|
|
2308
|
+
model: deepClone(entry.model),
|
|
2309
|
+
...(entry.rawData ? { rawData: entry.rawData.slice() } : {}),
|
|
2310
|
+
...(entry.modelSnapshot !== undefined ? { modelSnapshot: entry.modelSnapshot } : {}),
|
|
2311
|
+
...(entry.dirty !== undefined ? { dirty: entry.dirty } : {}),
|
|
2312
|
+
...(entry.preferRawPatch !== undefined ? { preferRawPatch: entry.preferRawPatch } : {}),
|
|
2313
|
+
...(entry.requireRawPatch !== undefined ? { requireRawPatch: entry.requireRawPatch } : {}),
|
|
2314
|
+
...(entry.rels ? { rels: entry.rels.map(r => ({ ...r })) } : {})
|
|
2315
|
+
};
|
|
2316
|
+
}
|