@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
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relationships check.
|
|
3
|
+
*
|
|
4
|
+
* For every `.rels` file in the package we verify:
|
|
5
|
+
* - The root element is `<Relationships>` and children are `<Relationship>`.
|
|
6
|
+
* - Each rel has `Id`, `Type`, and `Target` attributes.
|
|
7
|
+
* - Relationship `Id` values are unique within the same rels file.
|
|
8
|
+
* - Non-external targets resolve to files that exist inside the package.
|
|
9
|
+
* - Resolved targets stay inside the package root (no `..` escape).
|
|
10
|
+
* - For well-known rel types, the resolved target matches the expected
|
|
11
|
+
* part-name pattern (e.g. a `Type=...relationships/chart` rel must
|
|
12
|
+
* point at `xl/charts/chartN.xml`).
|
|
13
|
+
* - Every non-root rels file has a corresponding source part in the zip.
|
|
14
|
+
* - The package root rels include an officeDocument rel to `xl/workbook.xml`.
|
|
15
|
+
*/
|
|
16
|
+
import { getRelsSourceDir, isSafeResolvedPath, posixBasename, resolveRelTarget, sourcePartForRels } from "./path-utils.js";
|
|
17
|
+
const REL_TYPE_TARGET_RULES = [
|
|
18
|
+
{
|
|
19
|
+
type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
|
|
20
|
+
pattern: /^xl\/workbook\.xml$/,
|
|
21
|
+
label: "workbook"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",
|
|
25
|
+
pattern: /^xl\/worksheets\/sheet\d+\.xml$/,
|
|
26
|
+
label: "worksheet"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",
|
|
30
|
+
pattern: /^xl\/chartsheets\/sheet\d+\.xml$/,
|
|
31
|
+
label: "chartsheet"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",
|
|
35
|
+
pattern: /^xl\/charts\/chart\d+\.xml$/,
|
|
36
|
+
label: "chart"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: "http://schemas.microsoft.com/office/2014/relationships/chartEx",
|
|
40
|
+
pattern: /^xl\/charts\/chartEx\d+\.xml$/,
|
|
41
|
+
label: "chartEx"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: "http://schemas.microsoft.com/office/2011/relationships/chartStyle",
|
|
45
|
+
pattern: /^xl\/charts\/style(?:Ex)?\d+\.xml$/,
|
|
46
|
+
label: "chart style"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: "http://schemas.microsoft.com/office/2011/relationships/chartColorStyle",
|
|
50
|
+
pattern: /^xl\/charts\/colors(?:Ex)?\d+\.xml$/,
|
|
51
|
+
label: "chart colors"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
|
|
55
|
+
pattern: /^xl\/drawings\/drawing\d+\.xml$/,
|
|
56
|
+
label: "drawing"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",
|
|
60
|
+
pattern: /^xl\/styles\.xml$/,
|
|
61
|
+
label: "styles"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",
|
|
65
|
+
pattern: /^xl\/sharedStrings\.xml$/,
|
|
66
|
+
label: "shared strings"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",
|
|
70
|
+
pattern: /^xl\/theme\/[^/]+\.xml$/,
|
|
71
|
+
label: "theme"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable",
|
|
75
|
+
pattern: /^xl\/pivotTables\/pivotTable\d+\.xml$/,
|
|
76
|
+
label: "pivot table"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition",
|
|
80
|
+
pattern: /^xl\/pivotCache\/pivotCacheDefinition\d+\.xml$/,
|
|
81
|
+
label: "pivot cache definition"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords",
|
|
85
|
+
pattern: /^xl\/pivotCache\/pivotCacheRecords\d+\.xml$/,
|
|
86
|
+
label: "pivot cache records"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",
|
|
90
|
+
pattern: /^xl\/tables\/table\d+\.xml$/,
|
|
91
|
+
label: "table"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",
|
|
95
|
+
pattern: /^xl\/externalLinks\/externalLink\d+\.xml$/,
|
|
96
|
+
label: "external link"
|
|
97
|
+
}
|
|
98
|
+
];
|
|
99
|
+
const REL_TYPE_TARGET_BY_TYPE = new Map(REL_TYPE_TARGET_RULES.map(r => [r.type, r]));
|
|
100
|
+
// -----------------------------------------------------------------------------
|
|
101
|
+
// Checker
|
|
102
|
+
// -----------------------------------------------------------------------------
|
|
103
|
+
export function checkRootRelationships(ctx) {
|
|
104
|
+
if (!ctx.has("_rels/.rels")) {
|
|
105
|
+
return; // missing-part already reported.
|
|
106
|
+
}
|
|
107
|
+
const rels = ctx.readRels("_rels/.rels").rels;
|
|
108
|
+
const hasOfficeDocument = rels.some(r => r.type.includes("/relationships/officeDocument") && r.target === "xl/workbook.xml");
|
|
109
|
+
if (!hasOfficeDocument) {
|
|
110
|
+
ctx.reporter.error("root-rels-missing-officeDocument", "Missing officeDocument relationship to xl/workbook.xml", "_rels/.rels");
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
export function checkRelationships(ctx) {
|
|
114
|
+
for (const [path, entry] of ctx.files()) {
|
|
115
|
+
if (ctx.reporter.capped) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (entry.type === "directory" || !path.endsWith(".rels")) {
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
checkSingleRelsFile(ctx, path);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function checkSingleRelsFile(ctx, relsPath) {
|
|
125
|
+
const data = ctx.readRels(relsPath);
|
|
126
|
+
// Missing attributes.
|
|
127
|
+
for (const m of data.malformedEntries) {
|
|
128
|
+
if (ctx.reporter.capped) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (m.missingId) {
|
|
132
|
+
ctx.reporter.error("rels-missing-id-attr", `Relationship missing Id attribute`, relsPath);
|
|
133
|
+
}
|
|
134
|
+
if (m.missingType) {
|
|
135
|
+
ctx.reporter.error("rels-missing-type-attr", `Relationship ${m.id ?? "<no-id>"} missing Type attribute`, relsPath);
|
|
136
|
+
}
|
|
137
|
+
if (m.missingTarget) {
|
|
138
|
+
ctx.reporter.error("rels-missing-target", `Relationship ${m.id ?? "<no-id>"} missing Target attribute`, relsPath);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// Duplicate IDs — scan raw array (parsed keeps first).
|
|
142
|
+
const seen = new Set();
|
|
143
|
+
for (const rel of data.rels) {
|
|
144
|
+
if (ctx.reporter.capped) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (seen.has(rel.id)) {
|
|
148
|
+
ctx.reporter.error("rels-duplicate-id", `Duplicate relationship Id: ${rel.id}`, relsPath);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
seen.add(rel.id);
|
|
152
|
+
}
|
|
153
|
+
if (rel.targetMode === "External") {
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
if (rel.target === "") {
|
|
157
|
+
ctx.reporter.error("rels-empty-target", `Relationship ${rel.id} (${rel.type}) has empty Target`, relsPath);
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
const resolved = resolveRelTarget(relsPath, rel.target);
|
|
161
|
+
if (!isSafeResolvedPath(resolved)) {
|
|
162
|
+
ctx.reporter.error("rels-invalid-target-path", `Rel ${rel.id} (${rel.type}) target escapes package root: ${rel.target} -> ${resolved}`, relsPath);
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
if (!ctx.has(resolved)) {
|
|
166
|
+
ctx.reporter.error("rels-missing-target", `Rel ${rel.id} (${rel.type}) target missing: ${rel.target} -> ${resolved}`, relsPath);
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
// Rel type -> target pattern.
|
|
170
|
+
const rule = REL_TYPE_TARGET_BY_TYPE.get(rel.type);
|
|
171
|
+
if (rule && !rule.pattern.test(resolved)) {
|
|
172
|
+
ctx.reporter.error("rels-type-target-mismatch", `Rel ${rel.id} (${rule.label}) points at unexpected target: ${resolved}`, relsPath);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
// Source part must exist.
|
|
176
|
+
if (relsPath !== "_rels/.rels") {
|
|
177
|
+
const srcDir = getRelsSourceDir(relsPath);
|
|
178
|
+
const srcName = posixBasename(relsPath).replace(/\.rels$/, "");
|
|
179
|
+
const sourcePath = sourcePartForRels(relsPath) ?? (srcDir ? `${srcDir}/${srcName}` : srcName);
|
|
180
|
+
if (!ctx.has(sourcePath)) {
|
|
181
|
+
ctx.reporter.error("rels-source-missing", `Relationships part has no corresponding source part: ${sourcePath}`, relsPath);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package structure check.
|
|
3
|
+
*
|
|
4
|
+
* Verifies the package contains the four OPC-mandatory parts (every xlsx
|
|
5
|
+
* must have these to be considered an Open Packaging Convention file) and
|
|
6
|
+
* that every XML-like part is syntactically well-formed.
|
|
7
|
+
*
|
|
8
|
+
* XML well-formedness is the broadest reachable check — it catches
|
|
9
|
+
* unclosed tags, bad escapes, and invalid entities that would cause Excel
|
|
10
|
+
* to repair-or-reject the whole package. We parse via DOM (which
|
|
11
|
+
* internally delegates to SAX) so that subsequent DOM-based checkers hit
|
|
12
|
+
* the same cached result.
|
|
13
|
+
*/
|
|
14
|
+
import { isXmlLike } from "./path-utils.js";
|
|
15
|
+
const REQUIRED_PARTS = [
|
|
16
|
+
"[Content_Types].xml",
|
|
17
|
+
"_rels/.rels",
|
|
18
|
+
"xl/workbook.xml",
|
|
19
|
+
"xl/_rels/workbook.xml.rels"
|
|
20
|
+
];
|
|
21
|
+
export function checkStructure(ctx) {
|
|
22
|
+
for (const p of REQUIRED_PARTS) {
|
|
23
|
+
if (!ctx.has(p)) {
|
|
24
|
+
ctx.reporter.error("missing-part", `Missing required part: ${p}`, p);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Walk every XML-like entry and parse it to surface malformed-XML
|
|
30
|
+
* problems. Leverages the context cache so DOM-based checkers that run
|
|
31
|
+
* afterwards do not re-parse.
|
|
32
|
+
*/
|
|
33
|
+
export function checkXmlWellFormed(ctx) {
|
|
34
|
+
for (const [path, entry] of ctx.files()) {
|
|
35
|
+
if (ctx.reporter.capped) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (entry.type === "directory" || !isXmlLike(path)) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
// Relationships malformed errors are reported by readRels; content
|
|
42
|
+
// types malformed errors are reported by readContentTypes. Prefer
|
|
43
|
+
// those specific kinds.
|
|
44
|
+
if (path.endsWith(".rels")) {
|
|
45
|
+
ctx.readRels(path);
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (path === "[Content_Types].xml") {
|
|
49
|
+
ctx.readContentTypes();
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
ctx.readDom(path, err => {
|
|
53
|
+
ctx.reporter.error("xml-malformed", `Malformed XML: ${err.message}`, path);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Styles table integrity.
|
|
3
|
+
*
|
|
4
|
+
* Every xf in `cellXfs` references indices into `numFmts`, `fonts`,
|
|
5
|
+
* `fills`, `borders`. Out-of-bounds references produce style corruption
|
|
6
|
+
* on load (Excel falls back to the default style silently, so this is a
|
|
7
|
+
* warning-severity check — it's a strong signal of a broken writer but
|
|
8
|
+
* not a hard "Excel cannot open" issue).
|
|
9
|
+
*
|
|
10
|
+
* `numFmts` uses numeric IDs, including ~100 built-in IDs < 164 that are
|
|
11
|
+
* never declared. We only flag ids >= 164 that have no matching numFmt
|
|
12
|
+
* entry.
|
|
13
|
+
*/
|
|
14
|
+
import { attrByLocalName, findChildLocal, findChildrenLocal } from "./xml-utils.js";
|
|
15
|
+
const STYLES_PATH = "xl/styles.xml";
|
|
16
|
+
/** IDs < 164 are built-in. Custom numFmts must declare IDs >= 164. */
|
|
17
|
+
const CUSTOM_NUMFMT_FIRST_ID = 164;
|
|
18
|
+
export function checkStyles(ctx) {
|
|
19
|
+
if (!ctx.has(STYLES_PATH)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const dom = ctx.readDom(STYLES_PATH);
|
|
23
|
+
if (!dom) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const root = dom.root;
|
|
27
|
+
// Collect declared indices.
|
|
28
|
+
const numFmtIds = new Set();
|
|
29
|
+
const numFmtsEl = findChildLocal(root, "numFmts");
|
|
30
|
+
if (numFmtsEl) {
|
|
31
|
+
for (const nf of findChildrenLocal(numFmtsEl, "numFmt")) {
|
|
32
|
+
const idAttr = attrByLocalName(nf, "numFmtId");
|
|
33
|
+
const id = idAttr !== undefined ? parseInt(idAttr, 10) : NaN;
|
|
34
|
+
if (Number.isFinite(id)) {
|
|
35
|
+
numFmtIds.add(id);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const fontCount = countChildren(root, "fonts", "font");
|
|
40
|
+
const fillCount = countChildren(root, "fills", "fill");
|
|
41
|
+
const borderCount = countChildren(root, "borders", "border");
|
|
42
|
+
const cellXfs = findChildLocal(root, "cellXfs");
|
|
43
|
+
if (!cellXfs) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
let xfIdx = -1;
|
|
47
|
+
for (const xf of findChildrenLocal(cellXfs, "xf")) {
|
|
48
|
+
xfIdx++;
|
|
49
|
+
if (ctx.reporter.capped) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const numFmtId = intAttr(xf, "numFmtId");
|
|
53
|
+
if (numFmtId !== undefined && numFmtId >= CUSTOM_NUMFMT_FIRST_ID && !numFmtIds.has(numFmtId)) {
|
|
54
|
+
ctx.reporter.warning("styles-numFmt-missing-for-xf", `cellXfs[${xfIdx}] references numFmtId=${numFmtId} which is not declared in <numFmts>`, STYLES_PATH);
|
|
55
|
+
}
|
|
56
|
+
const fontId = intAttr(xf, "fontId");
|
|
57
|
+
if (fontId !== undefined && (fontId < 0 || fontId >= fontCount)) {
|
|
58
|
+
ctx.reporter.warning("styles-font-index-oob", `cellXfs[${xfIdx}] fontId=${fontId} is outside [0, ${fontCount})`, STYLES_PATH);
|
|
59
|
+
}
|
|
60
|
+
const fillId = intAttr(xf, "fillId");
|
|
61
|
+
if (fillId !== undefined && (fillId < 0 || fillId >= fillCount)) {
|
|
62
|
+
ctx.reporter.warning("styles-fill-index-oob", `cellXfs[${xfIdx}] fillId=${fillId} is outside [0, ${fillCount})`, STYLES_PATH);
|
|
63
|
+
}
|
|
64
|
+
const borderId = intAttr(xf, "borderId");
|
|
65
|
+
if (borderId !== undefined && (borderId < 0 || borderId >= borderCount)) {
|
|
66
|
+
ctx.reporter.warning("styles-border-index-oob", `cellXfs[${xfIdx}] borderId=${borderId} is outside [0, ${borderCount})`, STYLES_PATH);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function countChildren(root, containerName, childName) {
|
|
71
|
+
const container = findChildLocal(root, containerName);
|
|
72
|
+
if (!container) {
|
|
73
|
+
return 0;
|
|
74
|
+
}
|
|
75
|
+
const countAttr = attrByLocalName(container, "count");
|
|
76
|
+
const n = countAttr !== undefined ? parseInt(countAttr, 10) : NaN;
|
|
77
|
+
if (Number.isFinite(n) && n >= 0) {
|
|
78
|
+
return n;
|
|
79
|
+
}
|
|
80
|
+
return findChildrenLocal(container, childName).length;
|
|
81
|
+
}
|
|
82
|
+
function intAttr(el, localName) {
|
|
83
|
+
const raw = attrByLocalName(el, localName);
|
|
84
|
+
if (raw === undefined) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
const n = parseInt(raw, 10);
|
|
88
|
+
return Number.isFinite(n) ? n : undefined;
|
|
89
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table part check.
|
|
3
|
+
*
|
|
4
|
+
* Three real-world "Removed Records: Table from /xl/tables/tableN.xml"
|
|
5
|
+
* patterns that cause Excel to drop the entire table on open:
|
|
6
|
+
*
|
|
7
|
+
* 1. **Redundant per-column `<filterColumn>`.** The writer used to
|
|
8
|
+
* emit a bare `<filterColumn colId="N" hiddenButton="1"/>` for
|
|
9
|
+
* every column in the table. The schema accepts it, but Excel's
|
|
10
|
+
* loader interprets a fully-hidden autoFilter on a live table as
|
|
11
|
+
* inconsistent and drops the table to recover.
|
|
12
|
+
*
|
|
13
|
+
* 2. **`<totalsRowFormula>` paired with a built-in
|
|
14
|
+
* `totalsRowFunction`.** The schema allows the child only when
|
|
15
|
+
* the function is `"custom"` (or absent). For any of `sum`,
|
|
16
|
+
* `average`, `count`, `countNums`, `max`, `min`, `stdDev`,
|
|
17
|
+
* `var` Excel generates the SUBTOTAL formula itself and rejects
|
|
18
|
+
* the table if we pre-emit one.
|
|
19
|
+
*
|
|
20
|
+
* 3. **autoFilter range covering the totals row.** When
|
|
21
|
+
* `totalsRowCount="1"` is set on the `<table>`, the autoFilter
|
|
22
|
+
* range must stop one row above the totals row. Filtering the
|
|
23
|
+
* totals row itself is semantically invalid and Excel rejects
|
|
24
|
+
* the table.
|
|
25
|
+
*
|
|
26
|
+
* These are some of the most common "Excel cannot open" symptoms in
|
|
27
|
+
* production xlsx from other tooling too — catching them up front is a
|
|
28
|
+
* high-value check.
|
|
29
|
+
*/
|
|
30
|
+
import { attrByLocalName, findChildLocal, findChildrenLocal } from "./xml-utils.js";
|
|
31
|
+
const TABLE_PATH_RE = /^xl\/tables\/table\d+\.xml$/;
|
|
32
|
+
/** Built-in totals-row functions that Excel synthesises its own formula for. */
|
|
33
|
+
const BUILTIN_TOTALS_FUNCTIONS = new Set([
|
|
34
|
+
"sum",
|
|
35
|
+
"average",
|
|
36
|
+
"count",
|
|
37
|
+
"countNums",
|
|
38
|
+
"max",
|
|
39
|
+
"min",
|
|
40
|
+
"stdDev",
|
|
41
|
+
"var"
|
|
42
|
+
]);
|
|
43
|
+
export function checkTables(ctx) {
|
|
44
|
+
for (const [path, entry] of ctx.files()) {
|
|
45
|
+
if (ctx.reporter.capped) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (entry.type === "directory" || !TABLE_PATH_RE.test(path)) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
checkSingleTable(ctx, path);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function checkSingleTable(ctx, path) {
|
|
55
|
+
const dom = ctx.readDom(path);
|
|
56
|
+
if (!dom) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const root = dom.root;
|
|
60
|
+
checkRedundantFilterColumns(ctx, path, root);
|
|
61
|
+
checkTotalsRowFormula(ctx, path, root);
|
|
62
|
+
checkAutoFilterRange(ctx, path, root);
|
|
63
|
+
}
|
|
64
|
+
// -----------------------------------------------------------------------------
|
|
65
|
+
// 1. Redundant per-column <filterColumn>
|
|
66
|
+
// -----------------------------------------------------------------------------
|
|
67
|
+
function checkRedundantFilterColumns(ctx, path, root) {
|
|
68
|
+
const autoFilter = findChildLocal(root, "autoFilter");
|
|
69
|
+
if (!autoFilter) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const tableColumnsEl = findChildLocal(root, "tableColumns");
|
|
73
|
+
if (!tableColumnsEl) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const tableColumnCount = findChildrenLocal(tableColumnsEl, "tableColumn").length;
|
|
77
|
+
if (tableColumnCount === 0) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const filterColumns = findChildrenLocal(autoFilter, "filterColumn");
|
|
81
|
+
if (filterColumns.length !== tableColumnCount) {
|
|
82
|
+
return; // only the "one per column" writer bug pattern is flagged
|
|
83
|
+
}
|
|
84
|
+
// All filterColumn entries must be bare `hiddenButton="1"` with no
|
|
85
|
+
// filter-state children. Authored filterColumns that legitimately
|
|
86
|
+
// hide the button for a single column will have fewer entries (not
|
|
87
|
+
// one per column) so the guard above already lets them through.
|
|
88
|
+
const allEmpty = filterColumns.every(fc => {
|
|
89
|
+
const hidden = attrByLocalName(fc, "hiddenButton");
|
|
90
|
+
const hasChildren = fc.children.some(c => c.type === "element");
|
|
91
|
+
return hidden === "1" && !hasChildren;
|
|
92
|
+
});
|
|
93
|
+
if (allEmpty) {
|
|
94
|
+
ctx.reporter.error("table-filterColumn-redundant-per-column", `${path}: every column has a bare <filterColumn hiddenButton="1"/> ` +
|
|
95
|
+
`(total ${filterColumns.length}). Excel drops tables with a ` +
|
|
96
|
+
`fully-hidden autoFilter on load. Only emit <filterColumn> for ` +
|
|
97
|
+
`columns that have active filter state or an explicit ` +
|
|
98
|
+
`filterButton=false.`, path);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// -----------------------------------------------------------------------------
|
|
102
|
+
// 2. totalsRowFormula paired with built-in totalsRowFunction
|
|
103
|
+
// -----------------------------------------------------------------------------
|
|
104
|
+
function checkTotalsRowFormula(ctx, path, root) {
|
|
105
|
+
const tableColumnsEl = findChildLocal(root, "tableColumns");
|
|
106
|
+
if (!tableColumnsEl) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
for (const col of findChildrenLocal(tableColumnsEl, "tableColumn")) {
|
|
110
|
+
if (ctx.reporter.capped) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const totalsFn = attrByLocalName(col, "totalsRowFunction");
|
|
114
|
+
if (!totalsFn || !BUILTIN_TOTALS_FUNCTIONS.has(totalsFn)) {
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
const formulaEl = findChildLocal(col, "totalsRowFormula");
|
|
118
|
+
if (formulaEl) {
|
|
119
|
+
const name = attrByLocalName(col, "name") ?? attrByLocalName(col, "id") ?? "?";
|
|
120
|
+
ctx.reporter.error("table-totalsRowFormula-with-builtin-function", `${path}: tableColumn "${name}" has totalsRowFunction="${totalsFn}" ` +
|
|
121
|
+
`alongside a <totalsRowFormula>. The schema accepts the formula ` +
|
|
122
|
+
`child only when totalsRowFunction is "custom" or absent.`, path);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// -----------------------------------------------------------------------------
|
|
127
|
+
// 3. autoFilter range covering the totals row
|
|
128
|
+
// -----------------------------------------------------------------------------
|
|
129
|
+
/**
|
|
130
|
+
* Parse an A1-style range ref into `{ top, bottom }` (1-based, inclusive)
|
|
131
|
+
* for the row dimension only. Returns `undefined` when the ref is not a
|
|
132
|
+
* legal rectangle.
|
|
133
|
+
*/
|
|
134
|
+
function parseRangeRowRange(ref) {
|
|
135
|
+
// Match "A1:C10" or "A1:A1" (degenerate).
|
|
136
|
+
const m = /^[A-Za-z]+(\d+)(?::[A-Za-z]+(\d+))?$/.exec(ref);
|
|
137
|
+
if (!m) {
|
|
138
|
+
return undefined;
|
|
139
|
+
}
|
|
140
|
+
const a = parseInt(m[1], 10);
|
|
141
|
+
const b = m[2] !== undefined ? parseInt(m[2], 10) : a;
|
|
142
|
+
if (!Number.isFinite(a) || !Number.isFinite(b)) {
|
|
143
|
+
return undefined;
|
|
144
|
+
}
|
|
145
|
+
return { top: Math.min(a, b), bottom: Math.max(a, b) };
|
|
146
|
+
}
|
|
147
|
+
function checkAutoFilterRange(ctx, path, root) {
|
|
148
|
+
const tableRef = attrByLocalName(root, "ref");
|
|
149
|
+
const totalsRowCountAttr = attrByLocalName(root, "totalsRowCount");
|
|
150
|
+
if (!tableRef || !totalsRowCountAttr) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const totalsRowCount = parseInt(totalsRowCountAttr, 10);
|
|
154
|
+
if (!Number.isFinite(totalsRowCount) || totalsRowCount <= 0) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const autoFilterEl = findChildLocal(root, "autoFilter");
|
|
158
|
+
if (!autoFilterEl) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const autoRef = attrByLocalName(autoFilterEl, "ref");
|
|
162
|
+
if (!autoRef) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const tableRange = parseRangeRowRange(tableRef);
|
|
166
|
+
const autoRange = parseRangeRowRange(autoRef);
|
|
167
|
+
if (!tableRange || !autoRange) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
const tableBottom = tableRange.bottom;
|
|
171
|
+
const expectedAutoBottom = tableBottom - totalsRowCount;
|
|
172
|
+
if (autoRange.bottom !== expectedAutoBottom) {
|
|
173
|
+
ctx.reporter.error("table-autoFilter-covers-totalsRow", `${path}: autoFilter ref ends at row ${autoRange.bottom} but table ref ends ` +
|
|
174
|
+
`at row ${tableBottom} with totalsRowCount=${totalsRowCount}; ` +
|
|
175
|
+
`autoFilter must end at row ${expectedAutoBottom} (one row above the totals row).`, path);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workbook-level check.
|
|
3
|
+
*
|
|
4
|
+
* Reads `xl/workbook.xml` as DOM (replacing the previous regex-based
|
|
5
|
+
* approach, which missed namespaced elements like `<x:sheet>`) and walks
|
|
6
|
+
* every `<sheet>` declaration to verify:
|
|
7
|
+
*
|
|
8
|
+
* - `sheetId` uniqueness (OOXML requires globally unique sheet IDs).
|
|
9
|
+
* - `r:id` uniqueness and pointing to a worksheet-type relationship.
|
|
10
|
+
* - `name` attribute presence and Excel's name constraints:
|
|
11
|
+
* · 1–31 characters
|
|
12
|
+
* · No characters in `\ / ? * [ ] :`
|
|
13
|
+
* · Not repeated case-insensitively
|
|
14
|
+
* - CT_Workbook child element ordering (ECMA-376 Part 1 §18.2.27).
|
|
15
|
+
* Excel rejects files whose direct children of `<workbook>` violate
|
|
16
|
+
* the XSD sequence order.
|
|
17
|
+
*/
|
|
18
|
+
import { attrByLocalName, findChildLocal, findChildrenLocal, localName } from "./xml-utils.js";
|
|
19
|
+
const WORKBOOK_PATH = "xl/workbook.xml";
|
|
20
|
+
const WORKBOOK_RELS_PATH = "xl/_rels/workbook.xml.rels";
|
|
21
|
+
// Excel rejects sheet names that contain any of these characters. Source:
|
|
22
|
+
// https://support.microsoft.com/office/rename-a-worksheet-3f1f7148-ee83-404d-8ef0-9ff99fbad1f9
|
|
23
|
+
const INVALID_SHEET_NAME_CHARS = /[\\/?*[\]:]/;
|
|
24
|
+
const SHEET_NAME_MAX_LEN = 31;
|
|
25
|
+
/**
|
|
26
|
+
* CT_Workbook child element sequence per ECMA-376 Part 1 §18.2.27.
|
|
27
|
+
*
|
|
28
|
+
* Excel strictly enforces this order: any child appearing AFTER another
|
|
29
|
+
* that should precede it causes the file to be rejected as corrupt
|
|
30
|
+
* (no repair offered). The list below covers every element in the
|
|
31
|
+
* standard sequence. Unknown / extension elements (mc:AlternateContent,
|
|
32
|
+
* extLst, etc.) are ignored — they can appear anywhere without breaking
|
|
33
|
+
* conformance.
|
|
34
|
+
*/
|
|
35
|
+
const WORKBOOK_CHILD_ORDER = [
|
|
36
|
+
"fileVersion",
|
|
37
|
+
"fileSharing",
|
|
38
|
+
"workbookPr",
|
|
39
|
+
"workbookProtection",
|
|
40
|
+
"bookViews",
|
|
41
|
+
"sheets",
|
|
42
|
+
"functionGroups",
|
|
43
|
+
"externalReferences",
|
|
44
|
+
"definedNames",
|
|
45
|
+
"calcPr",
|
|
46
|
+
"oleSize",
|
|
47
|
+
"customWorkbookViews",
|
|
48
|
+
"pivotCaches",
|
|
49
|
+
"smartTagPr",
|
|
50
|
+
"smartTagTypes",
|
|
51
|
+
"webPublishing",
|
|
52
|
+
"fileRecoveryPr",
|
|
53
|
+
"webPublishObjects",
|
|
54
|
+
"extLst"
|
|
55
|
+
];
|
|
56
|
+
export function checkWorkbook(ctx) {
|
|
57
|
+
if (!ctx.has(WORKBOOK_PATH) || !ctx.has(WORKBOOK_RELS_PATH)) {
|
|
58
|
+
return; // missing-part already reported.
|
|
59
|
+
}
|
|
60
|
+
const dom = ctx.readDom(WORKBOOK_PATH, err => {
|
|
61
|
+
ctx.reporter.error("xml-malformed", `Malformed XML: ${err.message}`, WORKBOOK_PATH);
|
|
62
|
+
});
|
|
63
|
+
if (!dom) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const rels = ctx.readRels(WORKBOOK_RELS_PATH);
|
|
67
|
+
// --- Element order check ---
|
|
68
|
+
checkWorkbookChildOrder(ctx, dom.root);
|
|
69
|
+
// --- Sheet checks ---
|
|
70
|
+
const sheets = findChildLocal(dom.root, "sheets");
|
|
71
|
+
if (!sheets) {
|
|
72
|
+
// workbook with zero sheets is handled elsewhere as a structural issue
|
|
73
|
+
// — here we only care about sheet wiring.
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const seenSheetId = new Set();
|
|
77
|
+
const seenSheetRid = new Set();
|
|
78
|
+
const seenNamesLower = new Set();
|
|
79
|
+
for (const sheet of findChildrenLocal(sheets, "sheet")) {
|
|
80
|
+
if (ctx.reporter.capped) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const sheetId = attrByLocalName(sheet, "sheetId");
|
|
84
|
+
const rid = attrByLocalName(sheet, "id"); // r:id — local name "id"
|
|
85
|
+
const name = attrByLocalName(sheet, "name");
|
|
86
|
+
if (sheetId !== undefined) {
|
|
87
|
+
if (seenSheetId.has(sheetId)) {
|
|
88
|
+
ctx.reporter.error("workbook-duplicate-sheetId", `Duplicate sheetId in workbook: ${sheetId}`, WORKBOOK_PATH);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
seenSheetId.add(sheetId);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (rid !== undefined) {
|
|
95
|
+
if (seenSheetRid.has(rid)) {
|
|
96
|
+
ctx.reporter.error("workbook-duplicate-sheet-rid", `Duplicate sheet r:id in workbook: ${rid}`, WORKBOOK_PATH);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
seenSheetRid.add(rid);
|
|
100
|
+
}
|
|
101
|
+
const rel = rels.byId.get(rid);
|
|
102
|
+
if (!rel) {
|
|
103
|
+
ctx.reporter.error("workbook-sheet-missing-rel", `Workbook <sheet> references missing relationship: ${rid} (in ${WORKBOOK_RELS_PATH})`, WORKBOOK_PATH);
|
|
104
|
+
}
|
|
105
|
+
else if (!rel.type.includes("/relationships/worksheet") &&
|
|
106
|
+
!rel.type.includes("/relationships/chartsheet")) {
|
|
107
|
+
ctx.reporter.error("workbook-sheet-wrong-rel-type", `Workbook <sheet> ${rid} relationship is neither worksheet nor chartsheet: ${rel.type}`, WORKBOOK_PATH);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (name === undefined) {
|
|
111
|
+
ctx.reporter.error("workbook-sheet-missing-name", `Workbook <sheet> (sheetId=${sheetId ?? "?"}) missing name attribute`, WORKBOOK_PATH);
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (name.length === 0 || name.length > SHEET_NAME_MAX_LEN) {
|
|
115
|
+
ctx.reporter.error("workbook-sheet-name-too-long", `Sheet name "${name}" has ${name.length} characters; Excel limit is ${SHEET_NAME_MAX_LEN}`, WORKBOOK_PATH);
|
|
116
|
+
}
|
|
117
|
+
if (INVALID_SHEET_NAME_CHARS.test(name)) {
|
|
118
|
+
ctx.reporter.error("workbook-sheet-name-invalid-chars", `Sheet name "${name}" contains characters disallowed by Excel (\\ / ? * [ ] :)`, WORKBOOK_PATH);
|
|
119
|
+
}
|
|
120
|
+
const lower = name.toLowerCase();
|
|
121
|
+
if (seenNamesLower.has(lower)) {
|
|
122
|
+
ctx.reporter.error("workbook-sheet-name-duplicate", `Duplicate sheet name (case-insensitive): "${name}"`, WORKBOOK_PATH);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
seenNamesLower.add(lower);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Verify that the direct children of `<workbook>` follow the CT_Workbook
|
|
131
|
+
* XSD sequence. Excel is strict about this and rejects files with
|
|
132
|
+
* out-of-order elements as unrecoverable corruption.
|
|
133
|
+
*/
|
|
134
|
+
function checkWorkbookChildOrder(ctx, root) {
|
|
135
|
+
const orderIndex = new Map();
|
|
136
|
+
for (let i = 0; i < WORKBOOK_CHILD_ORDER.length; i++) {
|
|
137
|
+
orderIndex.set(WORKBOOK_CHILD_ORDER[i], i);
|
|
138
|
+
}
|
|
139
|
+
let maxSeenIdx = -1;
|
|
140
|
+
let maxSeenName = "";
|
|
141
|
+
for (const child of root.children) {
|
|
142
|
+
if (child.type !== "element") {
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
const local = localName(child.name);
|
|
146
|
+
const idx = orderIndex.get(local);
|
|
147
|
+
if (idx === undefined) {
|
|
148
|
+
// Unknown / extension element — skip (mc:AlternateContent etc.)
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
if (idx < maxSeenIdx) {
|
|
152
|
+
ctx.reporter.error("workbook-child-order", `Workbook child element <${local}> appears after <${maxSeenName}>, ` +
|
|
153
|
+
`violating CT_Workbook sequence order (ECMA-376 §18.2.27). ` +
|
|
154
|
+
`Excel will reject this file as corrupt.`, WORKBOOK_PATH);
|
|
155
|
+
// Report only the first violation to avoid noise
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (idx > maxSeenIdx) {
|
|
159
|
+
maxSeenIdx = idx;
|
|
160
|
+
maxSeenName = local;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|