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