@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
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.layoutSheet = layoutSheet;
|
|
22
|
+
exports.layoutChartsheet = layoutChartsheet;
|
|
22
23
|
exports.paginateRows = paginateRows;
|
|
23
24
|
exports.borderPrecedence = borderPrecedence;
|
|
24
25
|
exports.resolveSharedBorders = resolveSharedBorders;
|
|
@@ -98,8 +99,77 @@ async function layoutSheet(sheet, options, fontManager) {
|
|
|
98
99
|
if (layoutPages.length > 0 && sheet.images) {
|
|
99
100
|
assignImagesToPages(sheet.images, layoutPages, ctx.scaleFactor);
|
|
100
101
|
}
|
|
102
|
+
if (layoutPages.length > 0 && sheet.charts) {
|
|
103
|
+
assignChartsToPages(sheet.charts, layoutPages, ctx.scaleFactor);
|
|
104
|
+
}
|
|
101
105
|
return layoutPages;
|
|
102
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Produce the layout for a chartsheet — a single PDF page whose entire
|
|
109
|
+
* content area is covered by one chart.
|
|
110
|
+
*
|
|
111
|
+
* Chartsheets have no row/column grid, so we bypass the cell-layout
|
|
112
|
+
* pipeline entirely. Page dimensions come from `options.pageSize`, with
|
|
113
|
+
* orientation overridden by the chartsheet's own `orientation` field
|
|
114
|
+
* (Excel's chartsheet convention defaults to landscape; see the
|
|
115
|
+
* `CHARTSHEET_EMU_CX/CY` constants that define the drawing canvas in
|
|
116
|
+
* `xlsx.browser.ts`).
|
|
117
|
+
*
|
|
118
|
+
* The returned LayoutPage has:
|
|
119
|
+
* - `cells = []` (no grid to render)
|
|
120
|
+
* - `charts` containing one full-content-area chart
|
|
121
|
+
* - all other cell-grid arrays empty
|
|
122
|
+
*
|
|
123
|
+
* The existing `renderSinglePage` in `pdf-exporter.ts` already handles
|
|
124
|
+
* pages with zero cells and a non-empty `charts` array via the shared
|
|
125
|
+
* chart-rendering path, so no exporter changes are needed here.
|
|
126
|
+
*/
|
|
127
|
+
function layoutChartsheet(sheet, documentOptions) {
|
|
128
|
+
// Chartsheet orientation override — independent of the document
|
|
129
|
+
// default. We clone the options so neighbouring worksheets aren't
|
|
130
|
+
// affected when a single chartsheet flips to portrait.
|
|
131
|
+
const orientation = sheet.orientation ?? documentOptions.orientation;
|
|
132
|
+
const options = { ...documentOptions, orientation };
|
|
133
|
+
let pageWidth = options.pageSize.width;
|
|
134
|
+
let pageHeight = options.pageSize.height;
|
|
135
|
+
if (options.orientation === "landscape") {
|
|
136
|
+
[pageWidth, pageHeight] = [pageHeight, pageWidth];
|
|
137
|
+
}
|
|
138
|
+
const margins = options.margins;
|
|
139
|
+
const headerHeight = options.showSheetNames ? 20 : 0;
|
|
140
|
+
const contentX = margins.left;
|
|
141
|
+
const contentY = margins.bottom;
|
|
142
|
+
const contentWidth = pageWidth - margins.left - margins.right;
|
|
143
|
+
const contentHeight = pageHeight - margins.top - margins.bottom - headerHeight;
|
|
144
|
+
const chart = {
|
|
145
|
+
rect: {
|
|
146
|
+
x: contentX,
|
|
147
|
+
y: contentY,
|
|
148
|
+
width: Math.max(0, contentWidth),
|
|
149
|
+
height: Math.max(0, contentHeight)
|
|
150
|
+
},
|
|
151
|
+
drawVector: sheet.chart.drawVector,
|
|
152
|
+
raster: sheet.chart.raster
|
|
153
|
+
};
|
|
154
|
+
const page = {
|
|
155
|
+
pageNumber: 1,
|
|
156
|
+
options,
|
|
157
|
+
cells: [],
|
|
158
|
+
width: pageWidth,
|
|
159
|
+
height: pageHeight,
|
|
160
|
+
sheetName: sheet.name,
|
|
161
|
+
sheetCols: [],
|
|
162
|
+
columnOffsets: [],
|
|
163
|
+
columnWidths: [],
|
|
164
|
+
sheetRows: [],
|
|
165
|
+
rowYPositions: [],
|
|
166
|
+
rowHeights: [],
|
|
167
|
+
images: [],
|
|
168
|
+
charts: [chart],
|
|
169
|
+
scaleFactor: 1
|
|
170
|
+
};
|
|
171
|
+
return [page];
|
|
172
|
+
}
|
|
103
173
|
/**
|
|
104
174
|
* Steps 1–5: compute columns, scale, rows, merges, pagination.
|
|
105
175
|
* Returns null if the sheet has no visible columns (→ caller should emit an empty page).
|
|
@@ -265,6 +335,7 @@ function buildPageLayout(ctx, rowPage, colGroup, currentPageCount, sheet, option
|
|
|
265
335
|
rowYPositions,
|
|
266
336
|
rowHeights: pageRowHeights,
|
|
267
337
|
images: [],
|
|
338
|
+
charts: [],
|
|
268
339
|
scaleFactor
|
|
269
340
|
};
|
|
270
341
|
}
|
|
@@ -288,6 +359,7 @@ function createEmptyPage(sheet, options) {
|
|
|
288
359
|
rowYPositions: [],
|
|
289
360
|
rowHeights: [],
|
|
290
361
|
images: [],
|
|
362
|
+
charts: [],
|
|
291
363
|
scaleFactor: 1
|
|
292
364
|
};
|
|
293
365
|
}
|
|
@@ -480,6 +552,17 @@ function countWrapLines(cell, fontSize, scaleFactor, sheet, fontManager, options
|
|
|
480
552
|
: 0;
|
|
481
553
|
const padding = constants_1.CELL_PADDING_H + borderLeft + (constants_1.CELL_PADDING_H + borderRight) + indent * constants_1.INDENT_WIDTH;
|
|
482
554
|
const effectiveWidth = Math.max(scaledColPts - padding, 1);
|
|
555
|
+
// For rich text cells, use per-run font size measurement to match rendering
|
|
556
|
+
if (cell.type === types_1.PdfCellType.RichText) {
|
|
557
|
+
const value = cell.value;
|
|
558
|
+
if (value && typeof value === "object" && "richText" in value) {
|
|
559
|
+
const runs = value.richText;
|
|
560
|
+
if (runs.length > 0) {
|
|
561
|
+
const wrappedCount = countRichTextWrapLines(text, runs, scaleFactor, effectiveWidth, fontManager, options);
|
|
562
|
+
return Math.max(lineCount, wrappedCount);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
483
566
|
const scaledFontSize = fontSize * scaleFactor;
|
|
484
567
|
const fontProps = (0, style_converter_1.extractFontProperties)(cell.style.font, options.defaultFontFamily, options.defaultFontSize);
|
|
485
568
|
const pdfFontName = (0, font_manager_1.resolvePdfFontName)(fontProps.fontFamily, fontProps.bold, fontProps.italic);
|
|
@@ -490,6 +573,119 @@ function countWrapLines(cell, fontSize, scaleFactor, sheet, fontManager, options
|
|
|
490
573
|
const wrappedLines = (0, page_renderer_1.wrapTextLines)(text, measure, effectiveWidth);
|
|
491
574
|
return Math.max(lineCount, wrappedLines.length);
|
|
492
575
|
}
|
|
576
|
+
/**
|
|
577
|
+
* Count wrap lines for a rich text cell using per-run font sizes.
|
|
578
|
+
* This mirrors the logic in wrapRichTextLines (page-renderer) so that
|
|
579
|
+
* the row height calculation matches the actual rendering.
|
|
580
|
+
*/
|
|
581
|
+
function countRichTextWrapLines(text, runs, scaleFactor, effectiveWidth, fontManager, options) {
|
|
582
|
+
// Build character-to-run mapping
|
|
583
|
+
const runForChar = [];
|
|
584
|
+
for (let ri = 0; ri < runs.length; ri++) {
|
|
585
|
+
for (let ci = 0; ci < runs[ri].text.length; ci++) {
|
|
586
|
+
runForChar.push(ri);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
// Resolve font resources for each run
|
|
590
|
+
const runResources = runs.map(run => {
|
|
591
|
+
const fontProps = (0, style_converter_1.extractFontProperties)(run.font, options.defaultFontFamily, options.defaultFontSize);
|
|
592
|
+
const pdfFontName = (0, font_manager_1.resolvePdfFontName)(fontProps.fontFamily, fontProps.bold, fontProps.italic);
|
|
593
|
+
return fontManager.hasEmbeddedFont()
|
|
594
|
+
? fontManager.getEmbeddedResourceName()
|
|
595
|
+
: fontManager.ensureFont(pdfFontName);
|
|
596
|
+
});
|
|
597
|
+
// Resolve scaled font sizes for each run
|
|
598
|
+
const runFontSizes = runs.map(run => {
|
|
599
|
+
const fontProps = (0, style_converter_1.extractFontProperties)(run.font, options.defaultFontFamily, options.defaultFontSize);
|
|
600
|
+
return fontProps.fontSize * scaleFactor;
|
|
601
|
+
});
|
|
602
|
+
// Measure a range of fullText using per-character run font sizes
|
|
603
|
+
const measureRange = (start, end) => {
|
|
604
|
+
let width = 0;
|
|
605
|
+
let segStart = start;
|
|
606
|
+
let currentRi = runForChar[start] ?? 0;
|
|
607
|
+
for (let i = start + 1; i <= end; i++) {
|
|
608
|
+
const ri = i < end ? (runForChar[i] ?? currentRi) : -1;
|
|
609
|
+
if (ri !== currentRi) {
|
|
610
|
+
const seg = text.slice(segStart, i);
|
|
611
|
+
width += fontManager.measureText(seg, runResources[currentRi], runFontSizes[currentRi]);
|
|
612
|
+
segStart = i;
|
|
613
|
+
currentRi = ri;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return width;
|
|
617
|
+
};
|
|
618
|
+
// Word-wrap using per-run measurements — mirrors wrapRichTextLines in
|
|
619
|
+
// page-renderer exactly (paragraph split on \n, word boundaries by
|
|
620
|
+
// scanning space/tab characters) to ensure line count matches rendering.
|
|
621
|
+
let totalLines = 0;
|
|
622
|
+
let globalOffset = 0;
|
|
623
|
+
const len = text.length;
|
|
624
|
+
while (globalOffset <= len) {
|
|
625
|
+
// Find end of current paragraph (handles both \n and \r\n)
|
|
626
|
+
let paraEnd = text.indexOf("\n", globalOffset);
|
|
627
|
+
if (paraEnd === -1) {
|
|
628
|
+
paraEnd = len;
|
|
629
|
+
}
|
|
630
|
+
// Skip \r before \n
|
|
631
|
+
const paraContentEnd = paraEnd > globalOffset && text[paraEnd - 1] === "\r" ? paraEnd - 1 : paraEnd;
|
|
632
|
+
if (paraContentEnd === globalOffset) {
|
|
633
|
+
// Empty paragraph
|
|
634
|
+
totalLines++;
|
|
635
|
+
globalOffset = paraEnd + 1;
|
|
636
|
+
if (paraEnd === len) {
|
|
637
|
+
break;
|
|
638
|
+
}
|
|
639
|
+
continue;
|
|
640
|
+
}
|
|
641
|
+
// Find word boundaries within this paragraph (space/tab are separators)
|
|
642
|
+
const paraText = text.slice(globalOffset, paraContentEnd);
|
|
643
|
+
const wordStarts = [];
|
|
644
|
+
const wordEnds = [];
|
|
645
|
+
let inWord = false;
|
|
646
|
+
for (let i = 0; i < paraText.length; i++) {
|
|
647
|
+
const isSpace = paraText[i] === " " || paraText[i] === "\t";
|
|
648
|
+
if (!isSpace && !inWord) {
|
|
649
|
+
wordStarts.push(i);
|
|
650
|
+
inWord = true;
|
|
651
|
+
}
|
|
652
|
+
else if (isSpace && inWord) {
|
|
653
|
+
wordEnds.push(i);
|
|
654
|
+
inWord = false;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
if (inWord) {
|
|
658
|
+
wordEnds.push(paraText.length);
|
|
659
|
+
}
|
|
660
|
+
let lineStart = globalOffset;
|
|
661
|
+
let lineEnd = globalOffset;
|
|
662
|
+
let linesInParagraph = 0;
|
|
663
|
+
for (let wi = 0; wi < wordStarts.length; wi++) {
|
|
664
|
+
const wordEnd = globalOffset + wordEnds[wi];
|
|
665
|
+
if (lineEnd === lineStart) {
|
|
666
|
+
lineEnd = wordEnd;
|
|
667
|
+
continue;
|
|
668
|
+
}
|
|
669
|
+
if (measureRange(lineStart, wordEnd) <= effectiveWidth) {
|
|
670
|
+
lineEnd = wordEnd;
|
|
671
|
+
}
|
|
672
|
+
else {
|
|
673
|
+
linesInParagraph++;
|
|
674
|
+
lineStart = globalOffset + wordStarts[wi];
|
|
675
|
+
lineEnd = wordEnd;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
if (lineEnd > lineStart || wordStarts.length === 0) {
|
|
679
|
+
linesInParagraph++;
|
|
680
|
+
}
|
|
681
|
+
totalLines += linesInParagraph;
|
|
682
|
+
globalOffset = paraEnd + 1;
|
|
683
|
+
if (paraEnd === len) {
|
|
684
|
+
break;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
return Math.max(1, totalLines);
|
|
688
|
+
}
|
|
493
689
|
// =============================================================================
|
|
494
690
|
// Row Breaks
|
|
495
691
|
// =============================================================================
|
|
@@ -784,70 +980,242 @@ function resolveSharedBorders(cellGrid, rowCount, colCount) {
|
|
|
784
980
|
}
|
|
785
981
|
}
|
|
786
982
|
// =============================================================================
|
|
787
|
-
// Image Placement
|
|
983
|
+
// Image & Chart Placement
|
|
788
984
|
// =============================================================================
|
|
985
|
+
/**
|
|
986
|
+
* Resolve an anchor's page-space rectangle by combining the `tl` / `br` /
|
|
987
|
+
* `ext` fields of a {@link PdfSheetImage.range} or {@link PdfSheetChart.range}.
|
|
988
|
+
*
|
|
989
|
+
* The convention is identical for both object types:
|
|
990
|
+
* - `tl` locates the upper-left corner in sheet coordinates (`nativeCol`,
|
|
991
|
+
* `nativeRow`, + sub-cell offsets in EMU).
|
|
992
|
+
* - `br` — when present — locates the opposite corner, so the rect size is
|
|
993
|
+
* the difference.
|
|
994
|
+
* - `ext` — when present — overrides the size directly. Images use pixels
|
|
995
|
+
* (px × 0.75 = pt); charts use EMU (EMU / 9525 = pt). The `extUnit`
|
|
996
|
+
* field disambiguates. Historical callers that omit `extUnit` keep
|
|
997
|
+
* the legacy px behaviour.
|
|
998
|
+
*
|
|
999
|
+
* Returns `null` if the anchor does not land on any of the supplied
|
|
1000
|
+
* pages (e.g. the object is anchored below the printed area).
|
|
1001
|
+
*/
|
|
1002
|
+
function resolveAnchorRect(range, layoutPages, scaleFactor) {
|
|
1003
|
+
const tl = range.tl;
|
|
1004
|
+
const tlCol = (tl.nativeCol ?? tl.col ?? 0) + 1; // 0-indexed → 1-indexed
|
|
1005
|
+
const tlRow = (tl.nativeRow ?? tl.row ?? 0) + 1;
|
|
1006
|
+
const targetPage = layoutPages.find(page => page.sheetCols.includes(tlCol) && page.sheetRows.includes(tlRow));
|
|
1007
|
+
if (!targetPage) {
|
|
1008
|
+
return null;
|
|
1009
|
+
}
|
|
1010
|
+
const pageColIndex = targetPage.sheetCols.indexOf(tlCol);
|
|
1011
|
+
const pageRowIndex = targetPage.sheetRows.indexOf(tlRow);
|
|
1012
|
+
const baseX = targetPage.columnOffsets[pageColIndex] ?? targetPage.options.margins.left;
|
|
1013
|
+
const baseY = targetPage.rowYPositions[pageRowIndex] ??
|
|
1014
|
+
targetPage.height -
|
|
1015
|
+
targetPage.options.margins.top -
|
|
1016
|
+
(targetPage.options.showSheetNames ? 20 : 0);
|
|
1017
|
+
// Apply sub-cell offsets (EMU: 1pt = 12700 EMU), scaled to match page layout
|
|
1018
|
+
const tlColOff = ((tl.nativeColOff ?? 0) / 12700 || 0) * scaleFactor;
|
|
1019
|
+
const tlRowOff = ((tl.nativeRowOff ?? 0) / 12700 || 0) * scaleFactor;
|
|
1020
|
+
const x = baseX + tlColOff;
|
|
1021
|
+
const yTop = baseY - tlRowOff;
|
|
1022
|
+
// Determine width / height
|
|
1023
|
+
let width = 100;
|
|
1024
|
+
let height = 100;
|
|
1025
|
+
const extUnit = range.extUnit ?? "px";
|
|
1026
|
+
if (range.ext) {
|
|
1027
|
+
if (extUnit === "emu") {
|
|
1028
|
+
// EMU → pt (1 pt = 9525 EMU, same as the Excel drawing ext.cx/cy).
|
|
1029
|
+
width = (range.ext.width / 9525) * scaleFactor;
|
|
1030
|
+
height = (range.ext.height / 9525) * scaleFactor;
|
|
1031
|
+
}
|
|
1032
|
+
else {
|
|
1033
|
+
// Legacy pixel → pt (0.75 factor = 72/96 dpi)
|
|
1034
|
+
width = range.ext.width * 0.75 * scaleFactor;
|
|
1035
|
+
height = range.ext.height * 0.75 * scaleFactor;
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
else if (range.br) {
|
|
1039
|
+
const br = range.br;
|
|
1040
|
+
const brCol = (br.nativeCol ?? br.col ?? 0) + 1;
|
|
1041
|
+
const brRow = (br.nativeRow ?? br.row ?? 0) + 1;
|
|
1042
|
+
const brPageColIndex = targetPage.sheetCols.indexOf(brCol);
|
|
1043
|
+
const brPageRowIndex = targetPage.sheetRows.indexOf(brRow);
|
|
1044
|
+
let brBaseX;
|
|
1045
|
+
let brBaseY;
|
|
1046
|
+
if (brPageColIndex >= 0) {
|
|
1047
|
+
brBaseX = targetPage.columnOffsets[brPageColIndex];
|
|
1048
|
+
}
|
|
1049
|
+
else {
|
|
1050
|
+
// br column is beyond this page — sum column widths from tl
|
|
1051
|
+
// through the last page column, then extrapolate remaining cols
|
|
1052
|
+
// at the average page column width so the chart stretches to its
|
|
1053
|
+
// intended width even when the page doesn't extend far enough.
|
|
1054
|
+
const lastCI = targetPage.sheetCols.length - 1;
|
|
1055
|
+
const lastPageCol = targetPage.sheetCols[lastCI] ?? tlCol;
|
|
1056
|
+
// End of the last column on this page:
|
|
1057
|
+
const lastColEnd = lastCI >= 0
|
|
1058
|
+
? targetPage.columnOffsets[lastCI] + (targetPage.columnWidths[lastCI] ?? 0)
|
|
1059
|
+
: baseX;
|
|
1060
|
+
if (brCol <= lastPageCol) {
|
|
1061
|
+
// brCol should be on this page but indexOf missed — use end of
|
|
1062
|
+
// the closest column as a fallback.
|
|
1063
|
+
brBaseX = lastColEnd;
|
|
1064
|
+
}
|
|
1065
|
+
else {
|
|
1066
|
+
const avgColWidth = targetPage.columnWidths.length > 0
|
|
1067
|
+
? targetPage.columnWidths.reduce((s, w) => s + w, 0) / targetPage.columnWidths.length
|
|
1068
|
+
: 48;
|
|
1069
|
+
const extraCols = brCol - lastPageCol;
|
|
1070
|
+
brBaseX = lastColEnd + extraCols * avgColWidth;
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
if (brPageRowIndex >= 0) {
|
|
1074
|
+
brBaseY = targetPage.rowYPositions[brPageRowIndex];
|
|
1075
|
+
}
|
|
1076
|
+
else {
|
|
1077
|
+
// br row is beyond this page — accumulate row heights from tl
|
|
1078
|
+
// downward to compute the real chart height. In PDF coords,
|
|
1079
|
+
// rows stack downward (decreasing y). `baseY` (= yTop before
|
|
1080
|
+
// offsets) is the PDF y of the top of `tlRow`. Each subsequent
|
|
1081
|
+
// row's top y = previous row's top y - that row's height.
|
|
1082
|
+
const lastRI = targetPage.sheetRows.length - 1;
|
|
1083
|
+
const lastPageRow = targetPage.sheetRows[lastRI] ?? tlRow;
|
|
1084
|
+
if (brRow <= lastPageRow) {
|
|
1085
|
+
// brRow is on this page — sum heights from tl up to br.
|
|
1086
|
+
let accH = 0;
|
|
1087
|
+
for (let ri = pageRowIndex; ri <= lastRI; ri++) {
|
|
1088
|
+
if (targetPage.sheetRows[ri] >= brRow) {
|
|
1089
|
+
break;
|
|
1090
|
+
}
|
|
1091
|
+
accH += targetPage.rowHeights[ri] ?? 0;
|
|
1092
|
+
}
|
|
1093
|
+
brBaseY = baseY - accH;
|
|
1094
|
+
}
|
|
1095
|
+
else {
|
|
1096
|
+
// brRow exceeds the page — sum all rows from tl to end of page,
|
|
1097
|
+
// then extrapolate remaining rows at default height.
|
|
1098
|
+
let accH = 0;
|
|
1099
|
+
for (let ri = pageRowIndex; ri <= lastRI; ri++) {
|
|
1100
|
+
accH += targetPage.rowHeights[ri] ?? 0;
|
|
1101
|
+
}
|
|
1102
|
+
const remainingRows = brRow - lastPageRow - 1;
|
|
1103
|
+
accH += remainingRows * (15 * scaleFactor);
|
|
1104
|
+
brBaseY = baseY - accH;
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
const brColOff = ((br.nativeColOff ?? 0) / 12700 || 0) * scaleFactor;
|
|
1108
|
+
const brRowOff = ((br.nativeRowOff ?? 0) / 12700 || 0) * scaleFactor;
|
|
1109
|
+
const brX = brBaseX + brColOff;
|
|
1110
|
+
const brYTop = brBaseY - brRowOff;
|
|
1111
|
+
width = brX - x;
|
|
1112
|
+
height = yTop - brYTop;
|
|
1113
|
+
}
|
|
1114
|
+
// Normalise to bottom-left y (PDF origin is bottom-left).
|
|
1115
|
+
// Clamp width to the page's content area; for height, if the chart's
|
|
1116
|
+
// anchor extends well below the page boundary (less than 50% of the
|
|
1117
|
+
// chart fits on this page), skip it entirely — drawing a severely
|
|
1118
|
+
// clipped chart is worse than omitting it. Otherwise keep the full
|
|
1119
|
+
// computed height so the chart renders at the correct aspect ratio
|
|
1120
|
+
// even if it slightly overflows the page bottom.
|
|
1121
|
+
const contentRight = targetPage.width - targetPage.options.margins.right;
|
|
1122
|
+
const contentBottom = targetPage.options.margins.bottom;
|
|
1123
|
+
const absWidth = Math.min(Math.abs(width), Math.max(0, contentRight - x));
|
|
1124
|
+
const absHeight = Math.abs(height);
|
|
1125
|
+
const availableHeight = Math.max(0, yTop - contentBottom);
|
|
1126
|
+
if (absHeight > 0 && availableHeight < absHeight * 0.5) {
|
|
1127
|
+
// Less than half the chart fits on this page — skip it.
|
|
1128
|
+
return null;
|
|
1129
|
+
}
|
|
1130
|
+
return {
|
|
1131
|
+
page: targetPage,
|
|
1132
|
+
x,
|
|
1133
|
+
y: yTop - absHeight,
|
|
1134
|
+
width: absWidth,
|
|
1135
|
+
height: absHeight
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
789
1138
|
/**
|
|
790
1139
|
* Assign pre-collected images to the pages that contain their top-left anchor.
|
|
791
1140
|
*/
|
|
792
1141
|
function assignImagesToPages(images, layoutPages, scaleFactor) {
|
|
793
1142
|
for (const img of images) {
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
const tlRow = (tl.nativeRow ?? tl.row ?? 0) + 1;
|
|
797
|
-
const targetPage = layoutPages.find(page => page.sheetCols.includes(tlCol) && page.sheetRows.includes(tlRow));
|
|
798
|
-
if (!targetPage) {
|
|
1143
|
+
const placement = resolveAnchorRect(img.range, layoutPages, scaleFactor);
|
|
1144
|
+
if (!placement) {
|
|
799
1145
|
continue;
|
|
800
1146
|
}
|
|
801
|
-
|
|
802
|
-
const pageRowIndex = targetPage.sheetRows.indexOf(tlRow);
|
|
803
|
-
const baseX = targetPage.columnOffsets[pageColIndex] ?? targetPage.options.margins.left;
|
|
804
|
-
const baseY = targetPage.rowYPositions[pageRowIndex] ??
|
|
805
|
-
targetPage.height -
|
|
806
|
-
targetPage.options.margins.top -
|
|
807
|
-
(targetPage.options.showSheetNames ? 20 : 0);
|
|
808
|
-
// Apply sub-cell offsets (EMU: 1pt = 12700 EMU), scaled to match page layout
|
|
809
|
-
const tlColOff = ((tl.nativeColOff ?? 0) / 12700 || 0) * scaleFactor;
|
|
810
|
-
const tlRowOff = ((tl.nativeRowOff ?? 0) / 12700 || 0) * scaleFactor;
|
|
811
|
-
const imgX = baseX + tlColOff;
|
|
812
|
-
const imgY = baseY - tlRowOff;
|
|
813
|
-
// Determine image size
|
|
814
|
-
let imgWidth = 100;
|
|
815
|
-
let imgHeight = 100;
|
|
816
|
-
if (img.range.ext) {
|
|
817
|
-
imgWidth = (img.range.ext.width ?? 100) * 0.75 * scaleFactor;
|
|
818
|
-
imgHeight = (img.range.ext.height ?? 100) * 0.75 * scaleFactor;
|
|
819
|
-
}
|
|
820
|
-
else if (img.range.br) {
|
|
821
|
-
const br = img.range.br;
|
|
822
|
-
const brCol = (br.nativeCol ?? br.col ?? 0) + 1;
|
|
823
|
-
const brRow = (br.nativeRow ?? br.row ?? 0) + 1;
|
|
824
|
-
const brPageColIndex = targetPage.sheetCols.indexOf(brCol);
|
|
825
|
-
const brPageRowIndex = targetPage.sheetRows.indexOf(brRow);
|
|
826
|
-
const brBaseX = brPageColIndex >= 0
|
|
827
|
-
? targetPage.columnOffsets[brPageColIndex]
|
|
828
|
-
: imgX + (targetPage.columnWidths[pageColIndex] ?? 100);
|
|
829
|
-
const brBaseY = brPageRowIndex >= 0
|
|
830
|
-
? targetPage.rowYPositions[brPageRowIndex]
|
|
831
|
-
: imgY - (targetPage.rowHeights[pageRowIndex] ?? 100);
|
|
832
|
-
const brColOff = ((br.nativeColOff ?? 0) / 12700 || 0) * scaleFactor;
|
|
833
|
-
const brRowOff = ((br.nativeRowOff ?? 0) / 12700 || 0) * scaleFactor;
|
|
834
|
-
const brX = brBaseX + brColOff;
|
|
835
|
-
const brY = brBaseY - brRowOff;
|
|
836
|
-
imgWidth = brX - imgX;
|
|
837
|
-
imgHeight = imgY - brY;
|
|
838
|
-
}
|
|
839
|
-
targetPage.images.push({
|
|
1147
|
+
placement.page.images.push({
|
|
840
1148
|
data: img.data,
|
|
841
1149
|
format: img.format,
|
|
842
1150
|
rect: {
|
|
843
|
-
x:
|
|
844
|
-
y:
|
|
845
|
-
width:
|
|
846
|
-
height:
|
|
1151
|
+
x: placement.x,
|
|
1152
|
+
y: placement.y,
|
|
1153
|
+
width: placement.width,
|
|
1154
|
+
height: placement.height
|
|
847
1155
|
}
|
|
848
1156
|
});
|
|
849
1157
|
}
|
|
850
1158
|
}
|
|
1159
|
+
/**
|
|
1160
|
+
* Assign pre-collected charts to the pages that contain their top-left
|
|
1161
|
+
* anchor. When a chart's anchor doesn't fit on any page (e.g. it spans
|
|
1162
|
+
* most of its height below the page boundary), place it full-page on
|
|
1163
|
+
* the next available page so it's not lost entirely.
|
|
1164
|
+
*/
|
|
1165
|
+
function assignChartsToPages(charts, layoutPages, scaleFactor) {
|
|
1166
|
+
for (const chart of charts) {
|
|
1167
|
+
const placement = resolveAnchorRect(chart.range, layoutPages, scaleFactor);
|
|
1168
|
+
if (placement) {
|
|
1169
|
+
placement.page.charts.push({
|
|
1170
|
+
rect: {
|
|
1171
|
+
x: placement.x,
|
|
1172
|
+
y: placement.y,
|
|
1173
|
+
width: placement.width,
|
|
1174
|
+
height: placement.height
|
|
1175
|
+
},
|
|
1176
|
+
drawVector: chart.drawVector,
|
|
1177
|
+
raster: chart.raster
|
|
1178
|
+
});
|
|
1179
|
+
continue;
|
|
1180
|
+
}
|
|
1181
|
+
// Chart didn't fit — find the page whose rows are closest to the
|
|
1182
|
+
// chart's tl row and place it full-content-area on that page (or
|
|
1183
|
+
// the next one if it exists). This handles charts whose tl anchor
|
|
1184
|
+
// is near a page break: rather than clipping them to a sliver, we
|
|
1185
|
+
// push them onto the following page at full size.
|
|
1186
|
+
const tl = chart.range.tl;
|
|
1187
|
+
const tlRow = (tl.nativeRow ?? tl.row ?? 0) + 1;
|
|
1188
|
+
let targetPage;
|
|
1189
|
+
for (let pi = 0; pi < layoutPages.length; pi++) {
|
|
1190
|
+
const page = layoutPages[pi];
|
|
1191
|
+
const lastPageRow = page.sheetRows[page.sheetRows.length - 1] ?? 0;
|
|
1192
|
+
if (lastPageRow >= tlRow - 1 && pi + 1 < layoutPages.length) {
|
|
1193
|
+
targetPage = layoutPages[pi + 1];
|
|
1194
|
+
break;
|
|
1195
|
+
}
|
|
1196
|
+
if (lastPageRow >= tlRow) {
|
|
1197
|
+
targetPage = page;
|
|
1198
|
+
break;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
if (!targetPage) {
|
|
1202
|
+
targetPage = layoutPages[layoutPages.length - 1];
|
|
1203
|
+
}
|
|
1204
|
+
if (targetPage) {
|
|
1205
|
+
const margins = targetPage.options.margins;
|
|
1206
|
+
const headerH = targetPage.options.showSheetNames ? 20 : 0;
|
|
1207
|
+
const contentX = margins.left;
|
|
1208
|
+
const contentY = margins.bottom;
|
|
1209
|
+
const contentW = targetPage.width - margins.left - margins.right;
|
|
1210
|
+
const contentH = targetPage.height - margins.top - margins.bottom - headerH;
|
|
1211
|
+
targetPage.charts.push({
|
|
1212
|
+
rect: { x: contentX, y: contentY, width: contentW, height: contentH },
|
|
1213
|
+
drawVector: chart.drawVector,
|
|
1214
|
+
raster: chart.raster
|
|
1215
|
+
});
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
851
1219
|
// =============================================================================
|
|
852
1220
|
// Merge Border Propagation
|
|
853
1221
|
// =============================================================================
|
|
@@ -895,16 +1263,29 @@ function computeTextOverflows(cellGrid, rowPage, colGroup, visibleRows, visibleC
|
|
|
895
1263
|
if (!cell ||
|
|
896
1264
|
cell.wrapText ||
|
|
897
1265
|
cell.colSpan > 1 ||
|
|
898
|
-
!cell.text ||
|
|
899
|
-
cell.richText ||
|
|
1266
|
+
(!cell.text && !cell.richText) ||
|
|
900
1267
|
(typeof cell.textRotation === "number" && cell.textRotation !== 0) ||
|
|
901
1268
|
cell.textRotation === "vertical") {
|
|
902
1269
|
continue;
|
|
903
1270
|
}
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
1271
|
+
// Measure the total text width (plain text or rich text runs)
|
|
1272
|
+
let textWidth;
|
|
1273
|
+
if (cell.richText) {
|
|
1274
|
+
textWidth = 0;
|
|
1275
|
+
const isEmbedded = fontManager.hasEmbeddedFont();
|
|
1276
|
+
for (const run of cell.richText) {
|
|
1277
|
+
const resourceName = isEmbedded
|
|
1278
|
+
? fontManager.getEmbeddedResourceName()
|
|
1279
|
+
: fontManager.ensureFont((0, font_manager_1.resolvePdfFontName)(run.fontFamily, run.bold, run.italic));
|
|
1280
|
+
textWidth += fontManager.measureText(run.text, resourceName, run.fontSize);
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
else {
|
|
1284
|
+
const resourceName = fontManager.hasEmbeddedFont()
|
|
1285
|
+
? fontManager.getEmbeddedResourceName()
|
|
1286
|
+
: fontManager.ensureFont((0, font_manager_1.resolvePdfFontName)(cell.fontFamily, cell.bold, cell.italic));
|
|
1287
|
+
textWidth = fontManager.measureText(cell.text, resourceName, cell.fontSize);
|
|
1288
|
+
}
|
|
908
1289
|
const cellContentWidth = cell.rect.width -
|
|
909
1290
|
(constants_1.CELL_PADDING_H + cell.borderInsets.left) -
|
|
910
1291
|
(constants_1.CELL_PADDING_H + cell.borderInsets.right);
|
|
@@ -921,7 +1302,7 @@ function computeTextOverflows(cellGrid, rowPage, colGroup, visibleRows, visibleC
|
|
|
921
1302
|
break;
|
|
922
1303
|
}
|
|
923
1304
|
const neighborCell = cellGrid.get(`${ri}:${j}`);
|
|
924
|
-
if (neighborCell?.text) {
|
|
1305
|
+
if (neighborCell?.text || neighborCell?.richText) {
|
|
925
1306
|
break;
|
|
926
1307
|
}
|
|
927
1308
|
overflowAvailable += groupColWidths[j];
|