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