@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { colCache } from "../../../utils/col-cache.js";
|
|
2
2
|
import { buildDrawingAnchorsAndRels, resolveMediaTarget } from "../../../utils/drawing-utils.js";
|
|
3
|
-
import { commentsRelTargetFromWorksheet, ctrlPropRelTargetFromWorksheet, drawingRelTargetFromWorksheet, pivotTableRelTargetFromWorksheet, resolveRelTarget, tableRelTargetFromWorksheet, vmlDrawingRelTargetFromWorksheet, vmlDrawingHFRelTargetFromWorksheet } from "../../../utils/ooxml-paths.js";
|
|
3
|
+
import { chartRelTargetFromDrawing, chartExRelTargetFromDrawing, commentsRelTargetFromWorksheet, ctrlPropRelTargetFromWorksheet, drawingRelTargetFromWorksheet, pivotTableRelTargetFromWorksheet, resolveRelTarget, tableRelTargetFromWorksheet, vmlDrawingRelTargetFromWorksheet, vmlDrawingHFRelTargetFromWorksheet } from "../../../utils/ooxml-paths.js";
|
|
4
4
|
import { RelType } from "../../rel-type.js";
|
|
5
5
|
import { BaseXform } from "../base-xform.js";
|
|
6
6
|
import { ListXform } from "../list-xform.js";
|
|
@@ -201,29 +201,77 @@ class WorkSheetXform extends BaseXform {
|
|
|
201
201
|
vmlDrawing: `vmlDrawing${fileIndex}`
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
|
+
// Office 365 threaded comments — a separate rel pointing at the
|
|
205
|
+
// per-sheet `xl/threadedComments/threadedComment{N}.xml` part.
|
|
206
|
+
// Excel requires the rel to exist even when the sheet already has
|
|
207
|
+
// a classic comments rel (the two are independent — legacy VML
|
|
208
|
+
// carries the fallback text, threaded comments carry the modern
|
|
209
|
+
// conversation tree).
|
|
210
|
+
if (model.threadedComments && model.threadedComments.length > 0) {
|
|
211
|
+
rels.push({
|
|
212
|
+
Id: nextRid(rels),
|
|
213
|
+
Type: RelType.ThreadedComments,
|
|
214
|
+
Target: `../threadedComments/threadedComment${fileIndex}.xml`
|
|
215
|
+
});
|
|
216
|
+
}
|
|
204
217
|
// Handle pre-loaded drawing (from file read) that may contain charts or other non-image content.
|
|
205
|
-
//
|
|
206
|
-
//
|
|
207
|
-
// duplicate image anchors because the same images exist in both model.drawing.anchors
|
|
208
|
-
// (preserved for round-trip) and model.media (the canonical image list).
|
|
209
|
-
// For chart drawings, rels are preserved because the raw XML passthrough references
|
|
210
|
-
// original rIds; anchors are still cleared since they are unused for chart drawings.
|
|
218
|
+
// Chart anchors (with chartNumber from reconcile) are preserved and get fresh rels.
|
|
219
|
+
// Non-chart anchors are discarded — images are rebuilt from model.media below.
|
|
211
220
|
if (model.drawing && model.drawing.anchors) {
|
|
212
221
|
const drawing = model.drawing;
|
|
213
222
|
drawing.rId = nextRid(rels);
|
|
214
223
|
if (!drawing.name) {
|
|
215
224
|
drawing.name = `drawing${++options.drawingsCount}`;
|
|
216
225
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
//
|
|
226
|
+
// Separate chart anchors from non-chart anchors
|
|
227
|
+
const chartAnchors = drawing.anchors.filter((a) => a.chartNumber || a.chartExNumber);
|
|
228
|
+
// Reset anchors — chart anchors will be re-added, image anchors rebuilt below
|
|
220
229
|
drawing.anchors = [];
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
230
|
+
drawing.rels = [];
|
|
231
|
+
// Re-add chart anchors and build their rels
|
|
232
|
+
for (const anchor of chartAnchors) {
|
|
233
|
+
const chartRId = nextRid(drawing.rels);
|
|
234
|
+
if (anchor.chartExNumber) {
|
|
235
|
+
// Office 2016+ cx chart
|
|
236
|
+
drawing.rels.push({
|
|
237
|
+
Id: chartRId,
|
|
238
|
+
Type: RelType.ChartEx,
|
|
239
|
+
Target: chartExRelTargetFromDrawing(anchor.chartExNumber)
|
|
240
|
+
});
|
|
241
|
+
anchor.graphicFrame = {
|
|
242
|
+
...anchor.graphicFrame,
|
|
243
|
+
rId: chartRId,
|
|
244
|
+
isChartEx: true,
|
|
245
|
+
index: anchor.graphicFrame?.index,
|
|
246
|
+
name: anchor.graphicFrame?.name ?? `Chart ${anchor.chartExNumber}`
|
|
247
|
+
};
|
|
248
|
+
// ChartEx MUST be serialised inside `<mc:AlternateContent>`
|
|
249
|
+
// — see TwoCellAnchorXform.render for the full rationale.
|
|
250
|
+
// Tag the anchor here so re-saves of files we authored
|
|
251
|
+
// ourselves (which load without the wrapper in the current
|
|
252
|
+
// codebase) still emit the correct structure on the next
|
|
253
|
+
// write. Files that came in already wrapped keep whatever
|
|
254
|
+
// requires value the parser captured.
|
|
255
|
+
if (!anchor.alternateContent) {
|
|
256
|
+
anchor.alternateContent = { requires: "cx1" };
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
// Traditional c: chart
|
|
261
|
+
drawing.rels.push({
|
|
262
|
+
Id: chartRId,
|
|
263
|
+
Type: RelType.Chart,
|
|
264
|
+
Target: chartRelTargetFromDrawing(anchor.chartNumber)
|
|
265
|
+
});
|
|
266
|
+
anchor.graphicFrame = {
|
|
267
|
+
...anchor.graphicFrame,
|
|
268
|
+
rId: chartRId,
|
|
269
|
+
index: anchor.graphicFrame?.index,
|
|
270
|
+
name: anchor.graphicFrame?.name ?? `Chart ${anchor.chartNumber}`
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
drawing.anchors.push(anchor);
|
|
224
274
|
}
|
|
225
|
-
// Chart drawings keep their original rels intact since the raw drawing XML
|
|
226
|
-
// references those rIds directly.
|
|
227
275
|
options.drawings.push(drawing);
|
|
228
276
|
rels.push({
|
|
229
277
|
Id: drawing.rId,
|
|
@@ -231,6 +279,115 @@ class WorkSheetXform extends BaseXform {
|
|
|
231
279
|
Target: drawingRelTargetFromWorksheet(drawing.name)
|
|
232
280
|
});
|
|
233
281
|
}
|
|
282
|
+
// Handle programmatic charts (from worksheet.addChart API) that are NOT already
|
|
283
|
+
// in the drawing. Charts loaded from XLSX are already in drawing.anchors with
|
|
284
|
+
// chartNumber — only add truly new charts.
|
|
285
|
+
if (model.charts && model.charts.length > 0) {
|
|
286
|
+
// Collect chartNumbers already present in the drawing
|
|
287
|
+
const existingChartNumbers = new Set();
|
|
288
|
+
const existingChartExNumbers = new Set();
|
|
289
|
+
if (model.drawing?.anchors) {
|
|
290
|
+
for (const a of model.drawing.anchors) {
|
|
291
|
+
if (a.chartNumber) {
|
|
292
|
+
existingChartNumbers.add(a.chartNumber);
|
|
293
|
+
}
|
|
294
|
+
if (a.chartExNumber) {
|
|
295
|
+
existingChartExNumbers.add(a.chartExNumber);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
const newCharts = model.charts.filter((c) => {
|
|
300
|
+
if (c.chartNumber && !existingChartNumbers.has(c.chartNumber)) {
|
|
301
|
+
return true;
|
|
302
|
+
}
|
|
303
|
+
if (c.chartExNumber && !existingChartExNumbers.has(c.chartExNumber)) {
|
|
304
|
+
return true;
|
|
305
|
+
}
|
|
306
|
+
return false;
|
|
307
|
+
});
|
|
308
|
+
if (newCharts.length > 0) {
|
|
309
|
+
// Ensure a drawing exists
|
|
310
|
+
if (!model.drawing) {
|
|
311
|
+
model.drawing = {
|
|
312
|
+
anchors: [],
|
|
313
|
+
rels: [],
|
|
314
|
+
rId: nextRid(rels),
|
|
315
|
+
name: `drawing${++options.drawingsCount}`
|
|
316
|
+
};
|
|
317
|
+
options.drawings.push(model.drawing);
|
|
318
|
+
rels.push({
|
|
319
|
+
Id: model.drawing.rId,
|
|
320
|
+
Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
|
|
321
|
+
Target: drawingRelTargetFromWorksheet(model.drawing.name)
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
const drawing = model.drawing;
|
|
325
|
+
for (const chartAnchor of newCharts) {
|
|
326
|
+
// Chart `ChartAnchorModel.range` stores absolute position
|
|
327
|
+
// (`pos.x/y`) and extent (`ext.cx/cy`) in EMU — the native
|
|
328
|
+
// OOXML unit. The drawing xform pipeline (PosXform,
|
|
329
|
+
// ExtXform) expects pixels at 96 dpi (the image convention
|
|
330
|
+
// — `ext.width/height`) and multiplies by `EMU_PER_PIXEL_AT_96_DPI`
|
|
331
|
+
// on render. Normalise at this boundary: convert the EMU
|
|
332
|
+
// values to pixels so downstream xforms re-convert to EMU
|
|
333
|
+
// without doubling.
|
|
334
|
+
//
|
|
335
|
+
// Without this conversion an absolute-anchored chart wrote
|
|
336
|
+
// `<xdr:pos x="8709660000" y="8709660000"/>` for a 914400
|
|
337
|
+
// EMU position (a 9525× overshoot) and
|
|
338
|
+
// `<xdr:ext cx="NaN" cy="NaN"/>` because `ext` carried
|
|
339
|
+
// `{ cx, cy }` keys but ExtXform looked for `{ width,
|
|
340
|
+
// height }`.
|
|
341
|
+
const emuToPixel = 9525; // EMU_PER_PIXEL_AT_96_DPI
|
|
342
|
+
const normalizedRange = { ...chartAnchor.range };
|
|
343
|
+
if (chartAnchor.range.pos) {
|
|
344
|
+
normalizedRange.pos = {
|
|
345
|
+
x: chartAnchor.range.pos.x / emuToPixel,
|
|
346
|
+
y: chartAnchor.range.pos.y / emuToPixel
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
if (chartAnchor.range.ext && chartAnchor.range.ext.cx !== undefined) {
|
|
350
|
+
normalizedRange.ext = {
|
|
351
|
+
width: chartAnchor.range.ext.cx / emuToPixel,
|
|
352
|
+
height: chartAnchor.range.ext.cy / emuToPixel
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
const chartRId = nextRid(drawing.rels);
|
|
356
|
+
if (chartAnchor.chartExNumber) {
|
|
357
|
+
drawing.rels.push({
|
|
358
|
+
Id: chartRId,
|
|
359
|
+
Type: RelType.ChartEx,
|
|
360
|
+
Target: chartExRelTargetFromDrawing(chartAnchor.chartExNumber)
|
|
361
|
+
});
|
|
362
|
+
drawing.anchors.push({
|
|
363
|
+
range: normalizedRange,
|
|
364
|
+
chartExNumber: chartAnchor.chartExNumber,
|
|
365
|
+
alternateContent: { requires: "cx1" },
|
|
366
|
+
graphicFrame: {
|
|
367
|
+
rId: chartRId,
|
|
368
|
+
isChartEx: true,
|
|
369
|
+
name: `Chart ${chartAnchor.chartExNumber}`
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
drawing.rels.push({
|
|
375
|
+
Id: chartRId,
|
|
376
|
+
Type: RelType.Chart,
|
|
377
|
+
Target: chartRelTargetFromDrawing(chartAnchor.chartNumber)
|
|
378
|
+
});
|
|
379
|
+
drawing.anchors.push({
|
|
380
|
+
range: normalizedRange,
|
|
381
|
+
chartNumber: chartAnchor.chartNumber,
|
|
382
|
+
graphicFrame: {
|
|
383
|
+
rId: chartRId,
|
|
384
|
+
name: `Chart ${chartAnchor.chartNumber}`
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
234
391
|
// Process background and image media entries
|
|
235
392
|
const backgroundMedia = [];
|
|
236
393
|
const imageMedia = [];
|
|
@@ -540,11 +697,26 @@ class WorkSheetXform extends BaseXform {
|
|
|
540
697
|
this.map.headerFooter.render(xmlStream, model.headerFooter);
|
|
541
698
|
this.map.rowBreaks.render(xmlStream, model.rowBreaks);
|
|
542
699
|
this.map.colBreaks.render(xmlStream, model.colBreaks);
|
|
700
|
+
// `ignoredErrors` must precede `drawing` per ECMA-376 §18.3.1.99
|
|
701
|
+
// CT_Worksheet (… colBreaks, customProperties, cellWatches,
|
|
702
|
+
// ignoredErrors, smartTags, drawing, legacyDrawing, …). Emitting
|
|
703
|
+
// it after `controls` produced out-of-order XML that strict
|
|
704
|
+
// validators reject and some Excel builds repair on open
|
|
705
|
+
// (dropping the ignoredErrors block entirely). Previously the
|
|
706
|
+
// comment on this call claimed the opposite order — it was
|
|
707
|
+
// factually wrong.
|
|
708
|
+
this.map.ignoredErrors.render(xmlStream, model.ignoredErrors);
|
|
543
709
|
this.map.drawing.render(xmlStream, model.drawing); // Note: must be after rowBreaks/colBreaks
|
|
544
|
-
|
|
710
|
+
// ECMA-376 §18.3.1.99 CT_Worksheet child sequence is:
|
|
711
|
+
// … drawing → legacyDrawing → legacyDrawingHF → drawingHF → picture → oleObjects → controls →
|
|
712
|
+
// webPublishItems → tableParts → extLst
|
|
713
|
+
// `legacyDrawing` and `legacyDrawingHF` therefore MUST be emitted
|
|
714
|
+
// before the background `<picture>` element. The previous order here
|
|
715
|
+
// had picture before legacyDrawing, which validates against strict
|
|
716
|
+
// OOXML checkers as out-of-order and was the root cause of several
|
|
717
|
+
// "Excel needs to repair" reports.
|
|
545
718
|
if (model.rels) {
|
|
546
719
|
// Add a <legacyDrawing /> node for each VML drawing relationship (comments and/or form controls).
|
|
547
|
-
// NOTE: Excel is picky about worksheet child element order; legacyDrawing must come before controls.
|
|
548
720
|
model.rels.forEach(rel => {
|
|
549
721
|
if (rel.Type === RelType.VmlDrawing) {
|
|
550
722
|
// Skip VML rels that are for header images (they use legacyDrawingHF instead)
|
|
@@ -559,6 +731,9 @@ class WorkSheetXform extends BaseXform {
|
|
|
559
731
|
if (model.headerImage) {
|
|
560
732
|
xmlStream.leafNode("legacyDrawingHF", { "r:id": model.headerImage.vmlRelId });
|
|
561
733
|
}
|
|
734
|
+
// Background image: must be emitted AFTER drawing/legacyDrawing per
|
|
735
|
+
// the CT_Worksheet sequence noted above.
|
|
736
|
+
this.map.picture.render(xmlStream, model.background);
|
|
562
737
|
// Controls section for legacy form controls (checkboxes, etc.)
|
|
563
738
|
// Excel expects <controls> entries that reference ctrlProp relationships.
|
|
564
739
|
if (model.formControls && model.formControls.length > 0) {
|
|
@@ -610,9 +785,10 @@ class WorkSheetXform extends BaseXform {
|
|
|
610
785
|
xmlStream.leafNode("mc:Fallback");
|
|
611
786
|
xmlStream.closeNode();
|
|
612
787
|
}
|
|
613
|
-
// ignoredErrors
|
|
614
|
-
|
|
615
|
-
//
|
|
788
|
+
// `ignoredErrors` is rendered earlier (before `drawing`) per
|
|
789
|
+
// ECMA-376 §18.3.1.99 schema order — see the block above
|
|
790
|
+
// `this.map.drawing.render(...)`. Only `tableParts` and `extLst`
|
|
791
|
+
// remain in this tail section.
|
|
616
792
|
this.map.tableParts.render(xmlStream, model.tables);
|
|
617
793
|
// extLst should be the last element in the worksheet.
|
|
618
794
|
this.map.extLst.render(xmlStream, model);
|
|
@@ -21,8 +21,23 @@ class AutoFilterXform extends BaseXform {
|
|
|
21
21
|
xmlStream.openNode(this.tag, {
|
|
22
22
|
ref: model.autoFilterRef
|
|
23
23
|
});
|
|
24
|
+
// Only emit `<filterColumn>` for columns that carry actual filter
|
|
25
|
+
// state. Real Excel only emits the child when a filter is applied
|
|
26
|
+
// (`customFilters` / `filters` / `dynamicFilter`) or when the
|
|
27
|
+
// author explicitly set the filter-button visibility (either
|
|
28
|
+
// `filterButton: true` or `filterButton: false`). Columns that
|
|
29
|
+
// never touched `filterButton` (i.e. `undefined`) default to
|
|
30
|
+
// Excel's "show button" behaviour and should emit nothing —
|
|
31
|
+
// emitting an empty `<filterColumn hiddenButton="1"/>` for
|
|
32
|
+
// every such column makes Excel reject the table with
|
|
33
|
+
// "Removed Records: Table from /xl/tables/tableN.xml".
|
|
24
34
|
model.columns.forEach((column) => {
|
|
25
|
-
|
|
35
|
+
if (column?.customFilters !== undefined ||
|
|
36
|
+
column?.filters !== undefined ||
|
|
37
|
+
column?.dynamicFilter !== undefined ||
|
|
38
|
+
column?.filterButton !== undefined) {
|
|
39
|
+
this.map.filterColumn.render(xmlStream, column);
|
|
40
|
+
}
|
|
26
41
|
});
|
|
27
42
|
xmlStream.closeNode();
|
|
28
43
|
}
|
|
@@ -23,12 +23,27 @@ class TableColumnXform extends BaseXform {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
render(xmlStream, model) {
|
|
26
|
-
|
|
26
|
+
// `<totalsRowFormula>` is only valid when `totalsRowFunction="custom"`
|
|
27
|
+
// (or absent entirely, treated as custom). For the built-in
|
|
28
|
+
// functions — `sum` / `average` / `count` / `countNums` / `max` /
|
|
29
|
+
// `min` / `stdDev` / `var` — Excel GENERATES the SUBTOTAL formula
|
|
30
|
+
// itself at open time. Emitting a redundant
|
|
31
|
+
// `<totalsRowFormula>SUBTOTAL(101,Table[Col])</totalsRowFormula>`
|
|
32
|
+
// alongside `totalsRowFunction="average"` makes Excel report
|
|
33
|
+
// "Removed Records: Table from /xl/tables/tableN.xml" because the
|
|
34
|
+
// schema allows the child only with a custom function. The
|
|
35
|
+
// library's own `Table` class eagerly populates
|
|
36
|
+
// `column.totalsRowFormula = getFormula(column)` for every
|
|
37
|
+
// non-label column so rows render correctly in-memory; we gate
|
|
38
|
+
// the *emission* here instead of mutating that in-memory cache.
|
|
39
|
+
const isCustomFn = model.totalsRowFunction === undefined || model.totalsRowFunction === "custom";
|
|
40
|
+
const emitTotalsFormula = !!model.totalsRowFormula && isCustomFn;
|
|
41
|
+
if (model.calculatedColumnFormula || emitTotalsFormula) {
|
|
27
42
|
xmlStream.openNode(this.tag, this._renderAttributes(model));
|
|
28
43
|
if (model.calculatedColumnFormula) {
|
|
29
44
|
xmlStream.leafNode("calculatedColumnFormula", undefined, model.calculatedColumnFormula);
|
|
30
45
|
}
|
|
31
|
-
if (
|
|
46
|
+
if (emitTotalsFormula) {
|
|
32
47
|
xmlStream.leafNode("totalsRowFormula", undefined, model.totalsRowFormula);
|
|
33
48
|
}
|
|
34
49
|
xmlStream.closeNode();
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared parsers for OOXML / XSD-typed attribute values.
|
|
3
|
+
*
|
|
4
|
+
* These helpers are the single source of truth for attribute parsing
|
|
5
|
+
* across every xform. Multiple xforms used to carry private copies
|
|
6
|
+
* that drifted on edge cases:
|
|
7
|
+
* - chartsheet-xform read `tabSelected="true"` as `false` because it
|
|
8
|
+
* only accepted `"1"` (spec permits `"true"` per `xsd:boolean`);
|
|
9
|
+
* - some older code accepted `NaN` from `parseFloat` and serialised
|
|
10
|
+
* it back as the literal `"NaN"` attribute — an XML Schema
|
|
11
|
+
* violation that Excel's strict reader rejects.
|
|
12
|
+
*
|
|
13
|
+
* All parsers return `undefined` for missing / unparseable input so
|
|
14
|
+
* callers distinguish "absent" from "present but invalid" and can
|
|
15
|
+
* pipe through `?? default` to apply the spec's default value at the
|
|
16
|
+
* call site (element-specific, so the parser shouldn't bake one in).
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Parse an OOXML boolean attribute (`xsd:boolean`).
|
|
20
|
+
*
|
|
21
|
+
* Accepts the four canonical forms — `"1"`, `"0"`, `"true"`, `"false"` —
|
|
22
|
+
* per the XSD 1.1 spec. Leading / trailing whitespace is stripped
|
|
23
|
+
* first because XML 1.0 §3.3.3 attribute-value normalisation isn't
|
|
24
|
+
* guaranteed by every parser, and third-party writers legitimately
|
|
25
|
+
* emit `" 1 "` / `"0\n"` / etc. Without the trim, those values would
|
|
26
|
+
* silently downgrade to the schema default (typically `false`),
|
|
27
|
+
* losing state on round-trip.
|
|
28
|
+
*
|
|
29
|
+
* Returns `undefined` for any other value so call sites can
|
|
30
|
+
* distinguish "attribute absent / unrecognised" from "explicit false"
|
|
31
|
+
* and apply the element's schema default via `?? true` / `?? false`.
|
|
32
|
+
*/
|
|
33
|
+
export function parseXsdBoolean(value) {
|
|
34
|
+
if (value === undefined) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
const trimmed = value.trim();
|
|
38
|
+
if (trimmed === "1" || trimmed === "true") {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
if (trimmed === "0" || trimmed === "false") {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parse an OOXML integer attribute (`xsd:int`, bounded at ±2^31-1 per
|
|
48
|
+
* ECMA-376 / W3C XSD).
|
|
49
|
+
*
|
|
50
|
+
* Rejects trailing garbage — `parseInt("100%", 10)` silently returns
|
|
51
|
+
* `100`, which round-trips back to the wire as a valid-looking
|
|
52
|
+
* attribute even though the source was corrupt. Gate on a strict
|
|
53
|
+
* regex so only the lexical space defined by XSD is accepted; the
|
|
54
|
+
* surrounding trim handles the same third-party-writer whitespace
|
|
55
|
+
* cases {@link parseXsdBoolean} does.
|
|
56
|
+
*
|
|
57
|
+
* Returns `undefined` for missing / empty / non-numeric input rather
|
|
58
|
+
* than producing `NaN` (which would propagate through the model and
|
|
59
|
+
* surface as `"NaN"` in the round-trip XML — rejected by strict
|
|
60
|
+
* readers). Values outside `xsd:int` range are also rejected; callers
|
|
61
|
+
* that genuinely need 64-bit integers should use a `BigInt` path.
|
|
62
|
+
*/
|
|
63
|
+
export function parseXsdInt(value) {
|
|
64
|
+
if (value === undefined) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
const trimmed = value.trim();
|
|
68
|
+
if (trimmed === "" || !/^[+-]?\d+$/.test(trimmed)) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
const n = parseInt(trimmed, 10);
|
|
72
|
+
if (!Number.isFinite(n)) {
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
if (n > 2147483647 || n < -2147483648) {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
return n;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Parse an OOXML floating-point attribute (`xsd:double` / `xsd:float`).
|
|
82
|
+
* See {@link parseXsdInt} for the rationale — returns `undefined`
|
|
83
|
+
* instead of `NaN` / `Infinity` so the value never escapes back into
|
|
84
|
+
* the wire as a schema-invalid attribute.
|
|
85
|
+
*
|
|
86
|
+
* Strict lexical-space regex matches `xsd:double` production:
|
|
87
|
+
* optional sign, integer / decimal, optional exponent. Rejects
|
|
88
|
+
* trailing garbage for the same reason as {@link parseXsdInt}
|
|
89
|
+
* (corrupt-source preservation is worse than loud rejection).
|
|
90
|
+
*/
|
|
91
|
+
export function parseXsdFloat(value) {
|
|
92
|
+
if (value === undefined) {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
const trimmed = value.trim();
|
|
96
|
+
if (trimmed === "" || !/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(trimmed)) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
const n = parseFloat(trimmed);
|
|
100
|
+
return Number.isFinite(n) ? n : undefined;
|
|
101
|
+
}
|