@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
|
@@ -41,10 +41,64 @@ export function renderPage(page, options, fontManager, totalPages) {
|
|
|
41
41
|
for (const cell of page.cells) {
|
|
42
42
|
drawCellBorders(stream, cell);
|
|
43
43
|
}
|
|
44
|
+
// --- Step 3.5: Erase grid lines and borders in text overflow regions ---
|
|
45
|
+
// In Excel, text overflowing into adjacent empty cells hides gridlines and
|
|
46
|
+
// borders underneath. We draw white only over the portions of the overflow
|
|
47
|
+
// area that do NOT have a cell fill (cells with fill already cover gridlines
|
|
48
|
+
// in Step 2, and we must not erase their background).
|
|
49
|
+
for (const cell of page.cells) {
|
|
50
|
+
if (!cell.textOverflowWidth || cell.textOverflowWidth <= 0) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const overflowLeft = cell.rect.x + cell.rect.width;
|
|
54
|
+
const overflowRight = overflowLeft + cell.textOverflowWidth;
|
|
55
|
+
const cellY = cell.rect.y;
|
|
56
|
+
const cellH = cell.rect.height;
|
|
57
|
+
// Find neighbor cells whose x range overlaps the overflow region and
|
|
58
|
+
// are on the same row (same y and height).
|
|
59
|
+
// Collect filled sub-ranges to skip.
|
|
60
|
+
const filledRanges = [];
|
|
61
|
+
for (const other of page.cells) {
|
|
62
|
+
if (other === cell || !other.fillColor) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
// Same row check: same y position and height
|
|
66
|
+
if (Math.abs(other.rect.y - cellY) > 0.01 || Math.abs(other.rect.height - cellH) > 0.01) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
const oLeft = other.rect.x;
|
|
70
|
+
const oRight = oLeft + other.rect.width;
|
|
71
|
+
// Check overlap with overflow region
|
|
72
|
+
if (oRight > overflowLeft && oLeft < overflowRight) {
|
|
73
|
+
filledRanges.push({
|
|
74
|
+
left: Math.max(oLeft, overflowLeft),
|
|
75
|
+
right: Math.min(oRight, overflowRight)
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Draw white in unfilled portions of the overflow area
|
|
80
|
+
if (filledRanges.length === 0) {
|
|
81
|
+
stream.fillRect(overflowLeft, cellY, cell.textOverflowWidth, cellH, { r: 1, g: 1, b: 1 });
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
// Sort filled ranges and draw white in gaps
|
|
85
|
+
filledRanges.sort((a, b) => a.left - b.left);
|
|
86
|
+
let cursor = overflowLeft;
|
|
87
|
+
for (const fr of filledRanges) {
|
|
88
|
+
if (fr.left > cursor) {
|
|
89
|
+
stream.fillRect(cursor, cellY, fr.left - cursor, cellH, { r: 1, g: 1, b: 1 });
|
|
90
|
+
}
|
|
91
|
+
cursor = Math.max(cursor, fr.right);
|
|
92
|
+
}
|
|
93
|
+
if (cursor < overflowRight) {
|
|
94
|
+
stream.fillRect(cursor, cellY, overflowRight - cursor, cellH, { r: 1, g: 1, b: 1 });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
44
98
|
// --- Step 4: Draw cell text ---
|
|
45
99
|
const sf = page.scaleFactor;
|
|
46
100
|
for (const cell of page.cells) {
|
|
47
|
-
if (cell.text) {
|
|
101
|
+
if (cell.text || cell.richText) {
|
|
48
102
|
drawCellText(stream, cell, fontManager, alphaValues, sf);
|
|
49
103
|
}
|
|
50
104
|
}
|
|
@@ -296,54 +350,41 @@ function drawRichText(stream, cell, fontManager, indentPts, scaleFactor = 1) {
|
|
|
296
350
|
if (availWidth <= 0) {
|
|
297
351
|
return;
|
|
298
352
|
}
|
|
299
|
-
// Concatenate full text and wrap it
|
|
300
|
-
const fullText = runs.map(r => r.text).join("");
|
|
301
|
-
const primaryResource = runResource(runs[0]);
|
|
302
|
-
const measure = (s) => fontManager.measureText(s, primaryResource, primaryFontSize);
|
|
303
|
-
const lines = wrapTextLines(fullText, measure, availWidth);
|
|
304
353
|
// Build a character-to-run mapping so we know which run each char belongs to
|
|
354
|
+
const fullText = runs.map(r => r.text).join("");
|
|
305
355
|
const runForChar = [];
|
|
306
356
|
for (let ri = 0; ri < runs.length; ri++) {
|
|
307
357
|
for (let ci = 0; ci < runs[ri].text.length; ci++) {
|
|
308
358
|
runForChar.push(ri);
|
|
309
359
|
}
|
|
310
360
|
}
|
|
311
|
-
|
|
361
|
+
// Run-aware word-wrap using each character's actual run font size
|
|
362
|
+
const runResources = runs.map(r => runResource(r));
|
|
363
|
+
// Word-wrap using actual per-run measurements — returns character ranges
|
|
364
|
+
const lineRanges = wrapRichTextLines(fullText, runForChar, runs, runResources, fontManager, availWidth);
|
|
365
|
+
const primaryResourceName = runResources[0];
|
|
312
366
|
const ascent = fontManager.getFontAscent(primaryResourceName, primaryFontSize);
|
|
313
|
-
const totalTextHeight =
|
|
367
|
+
const totalTextHeight = lineRanges.length * lineHeight;
|
|
314
368
|
const textStartY = computeTextStartY(verticalAlign, rect, totalTextHeight, ascent, pad.top, pad.bottom);
|
|
315
|
-
let
|
|
316
|
-
for (let li = 0; li < lines.length; li++) {
|
|
369
|
+
for (let li = 0; li < lineRanges.length; li++) {
|
|
317
370
|
const lineY = textStartY - li * lineHeight;
|
|
318
|
-
const
|
|
371
|
+
const { start: lineStart, end: lineEnd } = lineRanges[li];
|
|
319
372
|
// Split the line into segments by run
|
|
320
373
|
const segments = [];
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
const globalIdx = charPos + ci;
|
|
324
|
-
const ri = runForChar[globalIdx] ?? runForChar.length - 1;
|
|
374
|
+
for (let ci = lineStart; ci < lineEnd; ci++) {
|
|
375
|
+
const ri = runForChar[ci] ?? runForChar.length - 1;
|
|
325
376
|
const last = segments[segments.length - 1];
|
|
326
377
|
if (last && last.run === runs[ri]) {
|
|
327
|
-
last.text +=
|
|
378
|
+
last.text += fullText[ci];
|
|
328
379
|
}
|
|
329
380
|
else {
|
|
330
381
|
segments.push({
|
|
331
382
|
run: runs[ri],
|
|
332
|
-
text:
|
|
333
|
-
resourceName:
|
|
383
|
+
text: fullText[ci],
|
|
384
|
+
resourceName: runResources[ri]
|
|
334
385
|
});
|
|
335
386
|
}
|
|
336
387
|
}
|
|
337
|
-
charPos += lineLen;
|
|
338
|
-
// Skip whitespace chars consumed by word-wrap between lines
|
|
339
|
-
while (charPos < runForChar.length && charPos < segStart + lineLen + 1) {
|
|
340
|
-
const nextLineStart = li + 1 < lines.length ? fullText.indexOf(lines[li + 1], charPos) : fullText.length;
|
|
341
|
-
if (nextLineStart > charPos) {
|
|
342
|
-
charPos = nextLineStart;
|
|
343
|
-
break;
|
|
344
|
-
}
|
|
345
|
-
break;
|
|
346
|
-
}
|
|
347
388
|
// Measure total line width for alignment
|
|
348
389
|
let lineWidth = 0;
|
|
349
390
|
for (const seg of segments) {
|
|
@@ -901,6 +942,106 @@ export function wrapTextLines(text, measure, maxWidth) {
|
|
|
901
942
|
}
|
|
902
943
|
return allLines.length > 0 ? allLines : [""];
|
|
903
944
|
}
|
|
945
|
+
function wrapRichTextLines(fullText, runForChar, runs, runResources, fontManager, maxWidth) {
|
|
946
|
+
if (!fullText) {
|
|
947
|
+
return [{ start: 0, end: 0 }];
|
|
948
|
+
}
|
|
949
|
+
// Measure a substring using each character's actual run font size
|
|
950
|
+
const measureRange = (start, end) => {
|
|
951
|
+
if (start >= end) {
|
|
952
|
+
return 0;
|
|
953
|
+
}
|
|
954
|
+
let width = 0;
|
|
955
|
+
let segStart = start;
|
|
956
|
+
let currentRi = runForChar[start] ?? 0;
|
|
957
|
+
for (let i = start + 1; i <= end; i++) {
|
|
958
|
+
const ri = i < end ? (runForChar[i] ?? currentRi) : -1;
|
|
959
|
+
if (ri !== currentRi) {
|
|
960
|
+
const run = runs[currentRi];
|
|
961
|
+
const seg = fullText.slice(segStart, i);
|
|
962
|
+
width += fontManager.measureText(seg, runResources[currentRi], run.fontSize);
|
|
963
|
+
segStart = i;
|
|
964
|
+
currentRi = ri;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
return width;
|
|
968
|
+
};
|
|
969
|
+
const allLines = [];
|
|
970
|
+
let globalOffset = 0;
|
|
971
|
+
const len = fullText.length;
|
|
972
|
+
// Process paragraph by paragraph (split on newlines)
|
|
973
|
+
while (globalOffset <= len) {
|
|
974
|
+
// Find end of current paragraph
|
|
975
|
+
let paraEnd = fullText.indexOf("\n", globalOffset);
|
|
976
|
+
if (paraEnd === -1) {
|
|
977
|
+
paraEnd = len;
|
|
978
|
+
}
|
|
979
|
+
if (paraEnd === globalOffset) {
|
|
980
|
+
// Empty paragraph
|
|
981
|
+
allLines.push({ start: globalOffset, end: globalOffset });
|
|
982
|
+
globalOffset = paraEnd + 1;
|
|
983
|
+
continue;
|
|
984
|
+
}
|
|
985
|
+
// Handle \r\n: exclude \r from paragraph content
|
|
986
|
+
const paraContentEnd = paraEnd > globalOffset && fullText[paraEnd - 1] === "\r" ? paraEnd - 1 : paraEnd;
|
|
987
|
+
if (paraContentEnd === globalOffset) {
|
|
988
|
+
// Paragraph was just \r\n — treat as empty
|
|
989
|
+
allLines.push({ start: globalOffset, end: globalOffset });
|
|
990
|
+
globalOffset = paraEnd + 1;
|
|
991
|
+
continue;
|
|
992
|
+
}
|
|
993
|
+
// Word-wrap this paragraph
|
|
994
|
+
const paraText = fullText.slice(globalOffset, paraContentEnd);
|
|
995
|
+
// Find word boundaries within this paragraph
|
|
996
|
+
const wordStarts = [];
|
|
997
|
+
const wordEnds = [];
|
|
998
|
+
let inWord = false;
|
|
999
|
+
for (let i = 0; i < paraText.length; i++) {
|
|
1000
|
+
const isSpace = paraText[i] === " " || paraText[i] === "\t";
|
|
1001
|
+
if (!isSpace && !inWord) {
|
|
1002
|
+
wordStarts.push(i);
|
|
1003
|
+
inWord = true;
|
|
1004
|
+
}
|
|
1005
|
+
else if (isSpace && inWord) {
|
|
1006
|
+
wordEnds.push(i);
|
|
1007
|
+
inWord = false;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
if (inWord) {
|
|
1011
|
+
wordEnds.push(paraText.length);
|
|
1012
|
+
}
|
|
1013
|
+
let lineStart = globalOffset;
|
|
1014
|
+
let lineEnd = globalOffset;
|
|
1015
|
+
for (let wi = 0; wi < wordStarts.length; wi++) {
|
|
1016
|
+
const wordEnd = globalOffset + wordEnds[wi];
|
|
1017
|
+
if (lineEnd === lineStart) {
|
|
1018
|
+
// First word on line — always take it
|
|
1019
|
+
lineEnd = wordEnd;
|
|
1020
|
+
continue;
|
|
1021
|
+
}
|
|
1022
|
+
// Test if adding this word (with preceding space) fits
|
|
1023
|
+
if (measureRange(lineStart, wordEnd) <= maxWidth) {
|
|
1024
|
+
lineEnd = wordEnd;
|
|
1025
|
+
}
|
|
1026
|
+
else {
|
|
1027
|
+
// Emit current line
|
|
1028
|
+
allLines.push({ start: lineStart, end: lineEnd });
|
|
1029
|
+
// Start new line at this word
|
|
1030
|
+
lineStart = globalOffset + wordStarts[wi];
|
|
1031
|
+
lineEnd = wordEnd;
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
// Emit last line of paragraph
|
|
1035
|
+
if (lineEnd > lineStart || wordStarts.length === 0) {
|
|
1036
|
+
allLines.push({ start: lineStart, end: Math.max(lineEnd, lineStart) });
|
|
1037
|
+
}
|
|
1038
|
+
globalOffset = paraEnd + 1;
|
|
1039
|
+
if (paraEnd === len) {
|
|
1040
|
+
break;
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
return allLines.length > 0 ? allLines : [{ start: 0, end: 0 }];
|
|
1044
|
+
}
|
|
904
1045
|
// =============================================================================
|
|
905
1046
|
// Page Header / Footer
|
|
906
1047
|
// =============================================================================
|
|
@@ -17,8 +17,9 @@ import { PdfError, PdfRenderError } from "../errors.js";
|
|
|
17
17
|
import { FontManager, resolvePdfFontName } from "../font/font-manager.js";
|
|
18
18
|
import { discoverSystemFontCandidates } from "../font/system-fonts.js";
|
|
19
19
|
import { parseTtf } from "../font/ttf-parser.js";
|
|
20
|
-
import { PageSizes, PdfCellType } from "../types.js";
|
|
21
|
-
import {
|
|
20
|
+
import { PageSizes, PdfCellType, isPdfChartsheet } from "../types.js";
|
|
21
|
+
import { createChartSurface } from "./chart-surface.js";
|
|
22
|
+
import { layoutChartsheet, layoutSheet } from "./layout-engine.js";
|
|
22
23
|
import { renderPage, alphaGsName, renderWatermark } from "./page-renderer.js";
|
|
23
24
|
import { argbToPdfColor } from "./style-converter.js";
|
|
24
25
|
// =============================================================================
|
|
@@ -90,11 +91,17 @@ function prepareExport(workbook, options) {
|
|
|
90
91
|
}
|
|
91
92
|
/**
|
|
92
93
|
* Layout a single sheet and append its pages to the context.
|
|
94
|
+
*
|
|
95
|
+
* Dispatches on `sheet.kind`: chartsheets produce exactly one page via
|
|
96
|
+
* {@link layoutChartsheet}; cell-grid worksheets go through the full
|
|
97
|
+
* pagination pipeline via {@link layoutSheet}.
|
|
93
98
|
*/
|
|
94
99
|
async function layoutSheetInto(ctx, sheet, options) {
|
|
95
100
|
try {
|
|
96
101
|
const resolved = resolveOptions(options, sheet);
|
|
97
|
-
const pages =
|
|
102
|
+
const pages = isPdfChartsheet(sheet)
|
|
103
|
+
? layoutChartsheet(sheet, resolved)
|
|
104
|
+
: await layoutSheet(sheet, resolved, ctx.fontManager);
|
|
98
105
|
ctx.allPages.push(...pages);
|
|
99
106
|
}
|
|
100
107
|
catch (err) {
|
|
@@ -144,6 +151,7 @@ function ensureAtLeastOnePage(allPages, documentOptions, sheets) {
|
|
|
144
151
|
rowYPositions: [],
|
|
145
152
|
rowHeights: [],
|
|
146
153
|
images: [],
|
|
154
|
+
charts: [],
|
|
147
155
|
scaleFactor: 1
|
|
148
156
|
});
|
|
149
157
|
}
|
|
@@ -201,6 +209,35 @@ function renderSinglePage(page, fontManager, writer, fontObjectMap, totalPages,
|
|
|
201
209
|
contentStream.drawImage(imgName, img.rect.x, img.rect.y, img.rect.width, img.rect.height);
|
|
202
210
|
}
|
|
203
211
|
}
|
|
212
|
+
// Handle charts. Two paths:
|
|
213
|
+
// - `drawVector` charts go through a {@link createChartSurface}
|
|
214
|
+
// adapter so the vector PDF operators (lines, text, shapes) land
|
|
215
|
+
// in the same content stream as the cells. Text stays selectable
|
|
216
|
+
// and the chart scales crisply at any zoom level.
|
|
217
|
+
// - `raster` charts fall back to the image XObject pipeline, which
|
|
218
|
+
// is identical to an embedded PNG. Used only for ChartEx layouts
|
|
219
|
+
// outside the vector-render whitelist.
|
|
220
|
+
if (page.charts.length > 0) {
|
|
221
|
+
let rasterCounter = page.images.length;
|
|
222
|
+
for (const chart of page.charts) {
|
|
223
|
+
if (chart.drawVector) {
|
|
224
|
+
const surface = createChartSurface(contentStream, fontManager, alphaValues);
|
|
225
|
+
// Constrain aspect ratio: charts look best at roughly 16:9 to
|
|
226
|
+
// 4:3. If the allocated rect is too extreme (e.g. very tall and
|
|
227
|
+
// narrow due to page layout), letterbox the chart within the
|
|
228
|
+
// rect so it keeps a sensible proportion.
|
|
229
|
+
const drawRect = constrainChartAspectRatio(chart.rect);
|
|
230
|
+
chart.drawVector(surface, drawRect);
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
if (chart.raster) {
|
|
234
|
+
const imgName = `Im${++rasterCounter}`;
|
|
235
|
+
const imgObjNum = writeImageXObject(writer, chart.raster.data, chart.raster.format);
|
|
236
|
+
imageXObjects.set(imgName, imgObjNum);
|
|
237
|
+
contentStream.drawImage(imgName, chart.rect.x, chart.rect.y, chart.rect.width, chart.rect.height);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
204
241
|
// --- Render watermark into a separate content stream ---
|
|
205
242
|
// PDF supports Contents as an array of stream references. The watermark stream
|
|
206
243
|
// is placed BEFORE the main content stream so it renders behind everything.
|
|
@@ -371,10 +408,21 @@ function selectSheets(workbook, sheets) {
|
|
|
371
408
|
* Resolve user options with defaults.
|
|
372
409
|
*/
|
|
373
410
|
function resolveOptions(options, sheet) {
|
|
374
|
-
// Use sheet's pageSetup as fallback for unspecified options
|
|
411
|
+
// Use sheet's pageSetup as fallback for unspecified options. Chartsheets
|
|
412
|
+
// expose a narrower pageSetup shape (`CT_CsPageSetup`) — the fields we
|
|
413
|
+
// care about (orientation, paperSize, margins) live in the same places
|
|
414
|
+
// so the same destructuring works.
|
|
375
415
|
const ps = sheet?.pageSetup;
|
|
376
416
|
const pageSize = resolvePageSize(options?.pageSize, ps?.paperSize);
|
|
377
|
-
|
|
417
|
+
// Chartsheets carry their own `orientation` override (Excel defaults
|
|
418
|
+
// to landscape for chartsheets); if set, it wins over the pageSetup
|
|
419
|
+
// fallback. Note: `layoutChartsheet` applies the same rule in its
|
|
420
|
+
// own clone of the resolved options, so selecting orientation here
|
|
421
|
+
// is only the document-level hint.
|
|
422
|
+
const chartsheetOrientation = sheet && isPdfChartsheet(sheet) ? sheet.orientation : undefined;
|
|
423
|
+
const orientation = options?.orientation ??
|
|
424
|
+
chartsheetOrientation ??
|
|
425
|
+
(ps?.orientation === "landscape" ? "landscape" : "portrait");
|
|
378
426
|
const margins = resolveMargins(options?.margins, ps?.margins);
|
|
379
427
|
const gridLineColorStr = options?.gridLineColor ?? "FFD0D0D0";
|
|
380
428
|
const gridLineColor = argbToPdfColor(gridLineColorStr) ?? {
|
|
@@ -382,9 +430,11 @@ function resolveOptions(options, sheet) {
|
|
|
382
430
|
g: 0.816,
|
|
383
431
|
b: 0.816
|
|
384
432
|
};
|
|
385
|
-
// Use sheet's printTitlesRow as fallback for repeatRows
|
|
433
|
+
// Use sheet's printTitlesRow as fallback for repeatRows. Only
|
|
434
|
+
// PdfSheetData carries `printTitlesRow` — chartsheets never have
|
|
435
|
+
// repeated header rows.
|
|
386
436
|
let repeatRows = options?.repeatRows ?? false;
|
|
387
|
-
if (repeatRows === false && ps?.printTitlesRow) {
|
|
437
|
+
if (repeatRows === false && sheet && !isPdfChartsheet(sheet) && ps?.printTitlesRow) {
|
|
388
438
|
// printTitlesRow format: "1:3" (repeat rows 1-3) or "1" (repeat row 1)
|
|
389
439
|
const match = ps.printTitlesRow.match(/^(\d+)(?::(\d+))?$/);
|
|
390
440
|
if (match) {
|
|
@@ -533,10 +583,20 @@ function isWatermarkApplicable(watermark, page) {
|
|
|
533
583
|
/**
|
|
534
584
|
* Collect all non-WinAnsi code points from sheet text (single pass).
|
|
535
585
|
* Returns an empty set if all text is WinAnsi-representable.
|
|
586
|
+
*
|
|
587
|
+
* Chartsheets are skipped — the chart surface renders text via the
|
|
588
|
+
* same font manager but the characters come from the chart model (axis
|
|
589
|
+
* labels, data labels, title), which gets tracked via `fontManager.trackText`
|
|
590
|
+
* during rendering rather than here. This keeps the font-discovery scan
|
|
591
|
+
* focused on cell text, which is where non-WinAnsi characters
|
|
592
|
+
* overwhelmingly appear.
|
|
536
593
|
*/
|
|
537
594
|
function collectNonWinAnsiCodePoints(sheets) {
|
|
538
595
|
const result = new Set();
|
|
539
596
|
for (const sheet of sheets) {
|
|
597
|
+
if (isPdfChartsheet(sheet)) {
|
|
598
|
+
continue;
|
|
599
|
+
}
|
|
540
600
|
for (const row of sheet.rows.values()) {
|
|
541
601
|
for (const cell of row.cells.values()) {
|
|
542
602
|
collectFromText(cell.text, result);
|
|
@@ -568,3 +628,53 @@ function collectFromText(text, out) {
|
|
|
568
628
|
}
|
|
569
629
|
}
|
|
570
630
|
}
|
|
631
|
+
// =============================================================================
|
|
632
|
+
// Chart Aspect Ratio Constraint
|
|
633
|
+
// =============================================================================
|
|
634
|
+
/**
|
|
635
|
+
* Constrain a chart drawing rectangle to a reasonable aspect ratio.
|
|
636
|
+
*
|
|
637
|
+
* Charts render best at roughly 16:9 (landscape) to 4:3. When the
|
|
638
|
+
* allocated page rect has an extreme ratio (e.g. very wide + short, or
|
|
639
|
+
* very tall + narrow — common when the chart anchor spans many rows but
|
|
640
|
+
* few columns or vice versa), letterbox the chart within the rect using
|
|
641
|
+
* a target ratio of 16:9 so it renders with correct proportions.
|
|
642
|
+
*
|
|
643
|
+
* The returned rect is centred within the original rect.
|
|
644
|
+
*/
|
|
645
|
+
function constrainChartAspectRatio(rect) {
|
|
646
|
+
const { x, y, width, height } = rect;
|
|
647
|
+
if (width <= 0 || height <= 0) {
|
|
648
|
+
return rect;
|
|
649
|
+
}
|
|
650
|
+
const ratio = width / height;
|
|
651
|
+
// Target aspect ratio: 16:9 ≈ 1.78. Allow a generous range [1.0, 2.5]
|
|
652
|
+
// before applying correction. This avoids touching charts that already
|
|
653
|
+
// have a reasonable shape (e.g. 4:3 = 1.33, 16:9 = 1.78).
|
|
654
|
+
const minRatio = 1.0;
|
|
655
|
+
const maxRatio = 2.5;
|
|
656
|
+
const targetRatio = 16 / 9; // 1.778
|
|
657
|
+
if (ratio >= minRatio && ratio <= maxRatio) {
|
|
658
|
+
// Already in acceptable range — use as-is.
|
|
659
|
+
return rect;
|
|
660
|
+
}
|
|
661
|
+
let newWidth = width;
|
|
662
|
+
let newHeight = height;
|
|
663
|
+
if (ratio > maxRatio) {
|
|
664
|
+
// Too wide — shrink width to fit target ratio within the height.
|
|
665
|
+
newWidth = height * targetRatio;
|
|
666
|
+
}
|
|
667
|
+
else {
|
|
668
|
+
// Too tall — shrink height to fit target ratio within the width.
|
|
669
|
+
newHeight = width / targetRatio;
|
|
670
|
+
}
|
|
671
|
+
// Centre within the original rect.
|
|
672
|
+
const dx = (width - newWidth) / 2;
|
|
673
|
+
const dy = (height - newHeight) / 2;
|
|
674
|
+
return {
|
|
675
|
+
x: x + dx,
|
|
676
|
+
y: y + dy,
|
|
677
|
+
width: newWidth,
|
|
678
|
+
height: newHeight
|
|
679
|
+
};
|
|
680
|
+
}
|
|
@@ -23,6 +23,10 @@ export const PdfCellType = {
|
|
|
23
23
|
Hyperlink: 8,
|
|
24
24
|
Merge: 9
|
|
25
25
|
};
|
|
26
|
+
/** Type guard distinguishing chartsheets from cell-grid worksheets. */
|
|
27
|
+
export function isPdfChartsheet(sheet) {
|
|
28
|
+
return sheet.kind === "chartsheet";
|
|
29
|
+
}
|
|
26
30
|
/**
|
|
27
31
|
* Predefined page sizes.
|
|
28
32
|
*/
|