@cj-tech-master/excelts 9.4.2 → 9.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.browser.d.ts +8 -5
- package/dist/browser/index.browser.js +19 -1
- package/dist/browser/index.d.ts +4 -2
- package/dist/browser/index.js +9 -1
- package/dist/browser/modules/excel/chart/cache-populator.d.ts +49 -0
- package/dist/browser/modules/excel/chart/cache-populator.js +1171 -0
- package/dist/browser/modules/excel/chart/chart-api.d.ts +92 -0
- package/dist/browser/modules/excel/chart/chart-api.js +364 -0
- package/dist/browser/modules/excel/chart/chart-builder.d.ts +48 -0
- package/dist/browser/modules/excel/chart/chart-builder.js +2432 -0
- package/dist/browser/modules/excel/chart/chart-ex-builder.d.ts +36 -0
- package/dist/browser/modules/excel/chart/chart-ex-builder.js +903 -0
- package/dist/browser/modules/excel/chart/chart-ex-parser.d.ts +8 -0
- package/dist/browser/modules/excel/chart/chart-ex-parser.js +1205 -0
- package/dist/browser/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
- package/dist/browser/modules/excel/chart/chart-ex-renderer.js +5352 -0
- package/dist/browser/modules/excel/chart/chart-ex-types.d.ts +531 -0
- package/dist/browser/modules/excel/chart/chart-ex-types.js +11 -0
- package/dist/browser/modules/excel/chart/chart-images.d.ts +78 -0
- package/dist/browser/modules/excel/chart/chart-images.js +363 -0
- package/dist/browser/modules/excel/chart/chart-presets.d.ts +392 -0
- package/dist/browser/modules/excel/chart/chart-presets.js +179 -0
- package/dist/browser/modules/excel/chart/chart-renderer.d.ts +550 -0
- package/dist/browser/modules/excel/chart/chart-renderer.js +6440 -0
- package/dist/browser/modules/excel/chart/chart-sidecar.d.ts +21 -0
- package/dist/browser/modules/excel/chart/chart-sidecar.js +427 -0
- package/dist/browser/modules/excel/chart/chart-utils.d.ts +306 -0
- package/dist/browser/modules/excel/chart/chart-utils.js +821 -0
- package/dist/browser/modules/excel/chart/chart.d.ts +504 -0
- package/dist/browser/modules/excel/chart/chart.js +1320 -0
- package/dist/browser/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
- package/dist/browser/modules/excel/chart/glyph-rasterizer.js +658 -0
- package/dist/browser/modules/excel/chart/index.d.ts +54 -0
- package/dist/browser/modules/excel/chart/index.js +46 -0
- package/dist/browser/modules/excel/chart/install.d.ts +44 -0
- package/dist/browser/modules/excel/chart/install.js +91 -0
- package/dist/browser/modules/excel/chart/shape-properties.d.ts +156 -0
- package/dist/browser/modules/excel/chart/shape-properties.js +1557 -0
- package/dist/browser/modules/excel/chart/stroke-font.d.ts +36 -0
- package/dist/browser/modules/excel/chart/stroke-font.js +1556 -0
- package/dist/browser/modules/excel/chart/topojson.d.ts +98 -0
- package/dist/browser/modules/excel/chart/topojson.js +236 -0
- package/dist/browser/modules/excel/chart/types.d.ts +2559 -0
- package/dist/browser/modules/excel/chart/types.js +8 -0
- package/dist/browser/modules/excel/chart-host-registry.d.ts +157 -0
- package/dist/browser/modules/excel/chart-host-registry.js +90 -0
- package/dist/browser/modules/excel/chartsheet.d.ts +102 -0
- package/dist/browser/modules/excel/chartsheet.js +196 -0
- package/dist/browser/modules/excel/defined-names.d.ts +35 -0
- package/dist/browser/modules/excel/defined-names.js +44 -4
- package/dist/browser/modules/excel/errors.d.ts +6 -0
- package/dist/browser/modules/excel/errors.js +9 -0
- package/dist/browser/modules/excel/form-control.d.ts +6 -0
- package/dist/browser/modules/excel/form-control.js +17 -0
- package/dist/browser/modules/excel/image.js +12 -2
- package/dist/browser/modules/excel/pivot-chart.d.ts +7 -0
- package/dist/browser/modules/excel/pivot-chart.js +53 -0
- package/dist/browser/modules/excel/pivot-table.d.ts +55 -0
- package/dist/browser/modules/excel/pivot-table.js +35 -0
- package/dist/browser/modules/excel/range.js +5 -1
- package/dist/browser/modules/excel/sparkline/index.d.ts +7 -0
- package/dist/browser/modules/excel/sparkline/index.js +7 -0
- package/dist/browser/modules/excel/sparkline/sparkline.d.ts +206 -0
- package/dist/browser/modules/excel/sparkline/sparkline.js +750 -0
- package/dist/browser/modules/excel/stream/worksheet-writer.js +3 -2
- package/dist/browser/modules/excel/table.js +42 -6
- package/dist/browser/modules/excel/types.d.ts +72 -0
- package/dist/browser/modules/excel/utils/address.d.ts +18 -0
- package/dist/browser/modules/excel/utils/address.js +28 -0
- package/dist/browser/modules/excel/utils/drawing-utils.js +11 -6
- package/dist/browser/modules/excel/utils/guid.d.ts +15 -0
- package/dist/browser/modules/excel/utils/guid.js +35 -0
- package/dist/browser/modules/excel/utils/ooxml-paths.d.ts +74 -0
- package/dist/browser/modules/excel/utils/ooxml-paths.js +206 -9
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-table.js +177 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/context.js +191 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/index.js +102 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/reporter.js +61 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/types.js +12 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
- package/dist/browser/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
- package/dist/browser/modules/excel/workbook.browser.d.ts +248 -30
- package/dist/browser/modules/excel/workbook.browser.js +966 -31
- package/dist/browser/modules/excel/workbook.d.ts +43 -0
- package/dist/browser/modules/excel/workbook.js +48 -0
- package/dist/browser/modules/excel/worksheet.d.ts +157 -3
- package/dist/browser/modules/excel/worksheet.js +394 -35
- package/dist/browser/modules/excel/xlsx/rel-type.d.ts +40 -0
- package/dist/browser/modules/excel/xlsx/rel-type.js +41 -1
- package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
- package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
- package/dist/browser/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
- package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
- package/dist/browser/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
- package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
- package/dist/browser/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
- package/dist/browser/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
- package/dist/browser/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
- package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
- package/dist/browser/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
- package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
- package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
- package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
- package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
- package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
- package/dist/browser/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
- package/dist/browser/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
- package/dist/browser/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
- package/dist/browser/modules/excel/xlsx/xform/xsd-values.js +101 -0
- package/dist/browser/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
- package/dist/browser/modules/excel/xlsx/xlsx.browser.js +4422 -78
- package/dist/browser/modules/pdf/builder/document-builder.d.ts +74 -0
- package/dist/browser/modules/pdf/builder/document-builder.js +507 -2
- package/dist/browser/modules/pdf/builder/pdf-editor.js +48 -3
- package/dist/browser/modules/pdf/excel-bridge.d.ts +69 -0
- package/dist/browser/modules/pdf/excel-bridge.js +683 -12
- package/dist/browser/modules/pdf/font/font-manager.d.ts +25 -0
- package/dist/browser/modules/pdf/font/font-manager.js +39 -0
- package/dist/browser/modules/pdf/index.d.ts +5 -2
- package/dist/browser/modules/pdf/index.js +3 -1
- package/dist/browser/modules/pdf/render/chart-surface.d.ts +33 -0
- package/dist/browser/modules/pdf/render/chart-surface.js +200 -0
- package/dist/browser/modules/pdf/render/layout-engine.d.ts +22 -1
- package/dist/browser/modules/pdf/render/layout-engine.js +436 -56
- package/dist/browser/modules/pdf/render/page-renderer.js +169 -28
- package/dist/browser/modules/pdf/render/pdf-exporter.js +117 -7
- package/dist/browser/modules/pdf/types.d.ts +227 -23
- package/dist/browser/modules/pdf/types.js +4 -0
- package/dist/browser/modules/pdf/word-bridge.d.ts +47 -0
- package/dist/browser/modules/pdf/word-bridge.js +304 -0
- package/dist/browser/modules/word/constants.d.ts +179 -0
- package/dist/browser/modules/word/constants.js +231 -0
- package/dist/browser/modules/word/content-types.d.ts +27 -0
- package/dist/browser/modules/word/content-types.js +53 -0
- package/dist/browser/modules/word/digital-signatures.d.ts +87 -0
- package/dist/browser/modules/word/digital-signatures.js +134 -0
- package/dist/browser/modules/word/document.d.ts +728 -0
- package/dist/browser/modules/word/document.js +1795 -0
- package/dist/browser/modules/word/docx-packager.d.ts +14 -0
- package/dist/browser/modules/word/docx-packager.js +822 -0
- package/dist/browser/modules/word/docx-reader.d.ts +11 -0
- package/dist/browser/modules/word/docx-reader.js +4929 -0
- package/dist/browser/modules/word/encryption.d.ts +102 -0
- package/dist/browser/modules/word/encryption.js +274 -0
- package/dist/browser/modules/word/errors.d.ts +49 -0
- package/dist/browser/modules/word/errors.js +68 -0
- package/dist/browser/modules/word/font-obfuscation.d.ts +31 -0
- package/dist/browser/modules/word/font-obfuscation.js +83 -0
- package/dist/browser/modules/word/html-renderer.d.ts +38 -0
- package/dist/browser/modules/word/html-renderer.js +782 -0
- package/dist/browser/modules/word/index.base.d.ts +19 -0
- package/dist/browser/modules/word/index.base.js +51 -0
- package/dist/browser/modules/word/index.browser.d.ts +4 -0
- package/dist/browser/modules/word/index.browser.js +4 -0
- package/dist/browser/modules/word/index.d.ts +4 -0
- package/dist/browser/modules/word/index.js +4 -0
- package/dist/browser/modules/word/internal-utils.d.ts +23 -0
- package/dist/browser/modules/word/internal-utils.js +54 -0
- package/dist/browser/modules/word/relationships.d.ts +31 -0
- package/dist/browser/modules/word/relationships.js +56 -0
- package/dist/browser/modules/word/types.d.ts +2325 -0
- package/dist/browser/modules/word/types.js +10 -0
- package/dist/browser/modules/word/units.d.ts +49 -0
- package/dist/browser/modules/word/units.js +111 -0
- package/dist/browser/modules/word/writers/chart-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/chart-writer.js +385 -0
- package/dist/browser/modules/word/writers/checkbox-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/checkbox-writer.js +42 -0
- package/dist/browser/modules/word/writers/comment-writer.d.ts +15 -0
- package/dist/browser/modules/word/writers/comment-writer.js +70 -0
- package/dist/browser/modules/word/writers/document-writer.d.ts +16 -0
- package/dist/browser/modules/word/writers/document-writer.js +461 -0
- package/dist/browser/modules/word/writers/footnote-writer.d.ts +11 -0
- package/dist/browser/modules/word/writers/footnote-writer.js +72 -0
- package/dist/browser/modules/word/writers/header-footer-writer.d.ts +13 -0
- package/dist/browser/modules/word/writers/header-footer-writer.js +129 -0
- package/dist/browser/modules/word/writers/image-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/image-writer.js +185 -0
- package/dist/browser/modules/word/writers/math-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/math-writer.js +428 -0
- package/dist/browser/modules/word/writers/numbering-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/numbering-writer.js +125 -0
- package/dist/browser/modules/word/writers/paragraph-writer.d.ts +13 -0
- package/dist/browser/modules/word/writers/paragraph-writer.js +516 -0
- package/dist/browser/modules/word/writers/parts-writer.d.ts +26 -0
- package/dist/browser/modules/word/writers/parts-writer.js +660 -0
- package/dist/browser/modules/word/writers/run-writer.d.ts +15 -0
- package/dist/browser/modules/word/writers/run-writer.js +649 -0
- package/dist/browser/modules/word/writers/section-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/section-writer.js +238 -0
- package/dist/browser/modules/word/writers/styles-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/styles-writer.js +242 -0
- package/dist/browser/modules/word/writers/table-writer.d.ts +10 -0
- package/dist/browser/modules/word/writers/table-writer.js +503 -0
- package/dist/browser/modules/word/writers/textbox-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/textbox-writer.js +53 -0
- package/dist/browser/modules/word/writers/toc-writer.d.ts +9 -0
- package/dist/browser/modules/word/writers/toc-writer.js +79 -0
- package/dist/browser/modules/xml/encode.d.ts +56 -7
- package/dist/browser/modules/xml/encode.js +157 -11
- package/dist/cjs/index.js +13 -2
- package/dist/cjs/modules/excel/chart/cache-populator.js +1178 -0
- package/dist/cjs/modules/excel/chart/chart-api.js +371 -0
- package/dist/cjs/modules/excel/chart/chart-builder.js +2440 -0
- package/dist/cjs/modules/excel/chart/chart-ex-builder.js +907 -0
- package/dist/cjs/modules/excel/chart/chart-ex-parser.js +1208 -0
- package/dist/cjs/modules/excel/chart/chart-ex-renderer.js +5364 -0
- package/dist/cjs/modules/excel/chart/chart-ex-types.js +12 -0
- package/dist/cjs/modules/excel/chart/chart-images.js +366 -0
- package/dist/cjs/modules/excel/chart/chart-presets.js +184 -0
- package/dist/cjs/modules/excel/chart/chart-renderer.js +6450 -0
- package/dist/cjs/modules/excel/chart/chart-sidecar.js +433 -0
- package/dist/cjs/modules/excel/chart/chart-utils.js +845 -0
- package/dist/cjs/modules/excel/chart/chart.js +1324 -0
- package/dist/cjs/modules/excel/chart/glyph-rasterizer.js +664 -0
- package/dist/cjs/modules/excel/chart/index.js +101 -0
- package/dist/cjs/modules/excel/chart/install.js +95 -0
- package/dist/cjs/modules/excel/chart/shape-properties.js +1577 -0
- package/dist/cjs/modules/excel/chart/stroke-font.js +1559 -0
- package/dist/cjs/modules/excel/chart/topojson.js +239 -0
- package/dist/cjs/modules/excel/chart/types.js +9 -0
- package/dist/cjs/modules/excel/chart-host-registry.js +96 -0
- package/dist/cjs/modules/excel/chartsheet.js +199 -0
- package/dist/cjs/modules/excel/defined-names.js +44 -4
- package/dist/cjs/modules/excel/errors.js +11 -1
- package/dist/cjs/modules/excel/form-control.js +17 -0
- package/dist/cjs/modules/excel/image.js +12 -2
- package/dist/cjs/modules/excel/pivot-chart.js +56 -0
- package/dist/cjs/modules/excel/pivot-table.js +35 -0
- package/dist/cjs/modules/excel/range.js +5 -1
- package/dist/cjs/modules/excel/sparkline/index.js +23 -0
- package/dist/cjs/modules/excel/sparkline/sparkline.js +756 -0
- package/dist/cjs/modules/excel/stream/worksheet-writer.js +3 -2
- package/dist/cjs/modules/excel/table.js +42 -6
- package/dist/cjs/modules/excel/utils/address.js +29 -0
- package/dist/cjs/modules/excel/utils/drawing-utils.js +11 -6
- package/dist/cjs/modules/excel/utils/guid.js +38 -0
- package/dist/cjs/modules/excel/utils/ooxml-paths.js +246 -9
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +103 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-chart.js +2128 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-chartsheet.js +29 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-content-types.js +184 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-drawing.js +270 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-pivot.js +107 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-relationships.js +188 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-structure.js +60 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-styles.js +92 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-table.js +180 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-workbook.js +166 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/check-worksheet.js +572 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/context.js +196 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/index.js +105 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/path-utils.js +168 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/reporter.js +66 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/types.js +13 -0
- package/dist/cjs/modules/excel/utils/ooxml-validator/xml-utils.js +110 -0
- package/dist/cjs/modules/excel/workbook.browser.js +973 -38
- package/dist/cjs/modules/excel/workbook.js +48 -0
- package/dist/cjs/modules/excel/worksheet.js +393 -34
- package/dist/cjs/modules/excel/xlsx/rel-type.js +41 -1
- package/dist/cjs/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
- package/dist/cjs/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
- package/dist/cjs/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
- package/dist/cjs/modules/excel/xlsx/xform/chart/chart-space-xform.js +6003 -0
- package/dist/cjs/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +219 -0
- package/dist/cjs/modules/excel/xlsx/xform/core/content-types-xform.js +149 -10
- package/dist/cjs/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
- package/dist/cjs/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
- package/dist/cjs/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
- package/dist/cjs/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +228 -0
- package/dist/cjs/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
- package/dist/cjs/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
- package/dist/cjs/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
- package/dist/cjs/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +444 -0
- package/dist/cjs/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
- package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +195 -19
- package/dist/cjs/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
- package/dist/cjs/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
- package/dist/cjs/modules/excel/xlsx/xform/xsd-values.js +106 -0
- package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +4420 -76
- package/dist/cjs/modules/pdf/builder/document-builder.js +506 -1
- package/dist/cjs/modules/pdf/builder/pdf-editor.js +48 -3
- package/dist/cjs/modules/pdf/excel-bridge.js +684 -12
- package/dist/cjs/modules/pdf/font/font-manager.js +39 -0
- package/dist/cjs/modules/pdf/index.js +5 -1
- package/dist/cjs/modules/pdf/render/chart-surface.js +203 -0
- package/dist/cjs/modules/pdf/render/layout-engine.js +437 -56
- package/dist/cjs/modules/pdf/render/page-renderer.js +169 -28
- package/dist/cjs/modules/pdf/render/pdf-exporter.js +115 -5
- package/dist/cjs/modules/pdf/types.js +5 -0
- package/dist/cjs/modules/pdf/word-bridge.js +307 -0
- package/dist/cjs/modules/word/constants.js +234 -0
- package/dist/cjs/modules/word/content-types.js +57 -0
- package/dist/cjs/modules/word/digital-signatures.js +140 -0
- package/dist/cjs/modules/word/document.js +1909 -0
- package/dist/cjs/modules/word/docx-packager.js +825 -0
- package/dist/cjs/modules/word/docx-reader.js +4932 -0
- package/dist/cjs/modules/word/encryption.js +282 -0
- package/dist/cjs/modules/word/errors.js +88 -0
- package/dist/cjs/modules/word/font-obfuscation.js +88 -0
- package/dist/cjs/modules/word/html-renderer.js +785 -0
- package/dist/cjs/modules/word/index.base.js +199 -0
- package/dist/cjs/modules/word/index.browser.js +20 -0
- package/dist/cjs/modules/word/index.js +20 -0
- package/dist/cjs/modules/word/internal-utils.js +59 -0
- package/dist/cjs/modules/word/relationships.js +60 -0
- package/dist/cjs/modules/word/types.js +11 -0
- package/dist/cjs/modules/word/units.js +135 -0
- package/dist/cjs/modules/word/writers/chart-writer.js +388 -0
- package/dist/cjs/modules/word/writers/checkbox-writer.js +45 -0
- package/dist/cjs/modules/word/writers/comment-writer.js +74 -0
- package/dist/cjs/modules/word/writers/document-writer.js +465 -0
- package/dist/cjs/modules/word/writers/footnote-writer.js +76 -0
- package/dist/cjs/modules/word/writers/header-footer-writer.js +134 -0
- package/dist/cjs/modules/word/writers/image-writer.js +188 -0
- package/dist/cjs/modules/word/writers/math-writer.js +431 -0
- package/dist/cjs/modules/word/writers/numbering-writer.js +128 -0
- package/dist/cjs/modules/word/writers/paragraph-writer.js +521 -0
- package/dist/cjs/modules/word/writers/parts-writer.js +671 -0
- package/dist/cjs/modules/word/writers/run-writer.js +655 -0
- package/dist/cjs/modules/word/writers/section-writer.js +241 -0
- package/dist/cjs/modules/word/writers/styles-writer.js +245 -0
- package/dist/cjs/modules/word/writers/table-writer.js +506 -0
- package/dist/cjs/modules/word/writers/textbox-writer.js +56 -0
- package/dist/cjs/modules/word/writers/toc-writer.js +82 -0
- package/dist/cjs/modules/xml/encode.js +158 -11
- package/dist/esm/index.browser.js +20 -2
- package/dist/esm/index.js +9 -1
- package/dist/esm/modules/excel/chart/cache-populator.js +1171 -0
- package/dist/esm/modules/excel/chart/chart-api.js +364 -0
- package/dist/esm/modules/excel/chart/chart-builder.js +2432 -0
- package/dist/esm/modules/excel/chart/chart-ex-builder.js +903 -0
- package/dist/esm/modules/excel/chart/chart-ex-parser.js +1205 -0
- package/dist/esm/modules/excel/chart/chart-ex-renderer.js +5352 -0
- package/dist/esm/modules/excel/chart/chart-ex-types.js +11 -0
- package/dist/esm/modules/excel/chart/chart-images.js +363 -0
- package/dist/esm/modules/excel/chart/chart-presets.js +179 -0
- package/dist/esm/modules/excel/chart/chart-renderer.js +6440 -0
- package/dist/esm/modules/excel/chart/chart-sidecar.js +427 -0
- package/dist/esm/modules/excel/chart/chart-utils.js +821 -0
- package/dist/esm/modules/excel/chart/chart.js +1320 -0
- package/dist/esm/modules/excel/chart/glyph-rasterizer.js +658 -0
- package/dist/esm/modules/excel/chart/index.js +46 -0
- package/dist/esm/modules/excel/chart/install.js +91 -0
- package/dist/esm/modules/excel/chart/shape-properties.js +1557 -0
- package/dist/esm/modules/excel/chart/stroke-font.js +1556 -0
- package/dist/esm/modules/excel/chart/topojson.js +236 -0
- package/dist/esm/modules/excel/chart/types.js +8 -0
- package/dist/esm/modules/excel/chart-host-registry.js +90 -0
- package/dist/esm/modules/excel/chartsheet.js +196 -0
- package/dist/esm/modules/excel/defined-names.js +44 -4
- package/dist/esm/modules/excel/errors.js +9 -0
- package/dist/esm/modules/excel/form-control.js +17 -0
- package/dist/esm/modules/excel/image.js +12 -2
- package/dist/esm/modules/excel/pivot-chart.js +53 -0
- package/dist/esm/modules/excel/pivot-table.js +35 -0
- package/dist/esm/modules/excel/range.js +5 -1
- package/dist/esm/modules/excel/sparkline/index.js +7 -0
- package/dist/esm/modules/excel/sparkline/sparkline.js +750 -0
- package/dist/esm/modules/excel/stream/worksheet-writer.js +3 -2
- package/dist/esm/modules/excel/table.js +42 -6
- package/dist/esm/modules/excel/utils/address.js +28 -0
- package/dist/esm/modules/excel/utils/drawing-utils.js +11 -6
- package/dist/esm/modules/excel/utils/guid.js +35 -0
- package/dist/esm/modules/excel/utils/ooxml-paths.js +206 -9
- package/dist/esm/modules/excel/utils/ooxml-validator/check-chart-sidecar.js +101 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-chart.js +2125 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-chartsheet.js +26 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-content-types.js +181 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-drawing.js +267 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-pivot.js +104 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-relationships.js +184 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-structure.js +56 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-styles.js +89 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-table.js +177 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-workbook.js +163 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/check-worksheet.js +569 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/context.js +191 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/index.js +102 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/path-utils.js +156 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/reporter.js +61 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/types.js +12 -0
- package/dist/esm/modules/excel/utils/ooxml-validator/xml-utils.js +100 -0
- package/dist/esm/modules/excel/workbook.browser.js +969 -34
- package/dist/esm/modules/excel/workbook.js +48 -0
- package/dist/esm/modules/excel/worksheet.js +394 -35
- package/dist/esm/modules/excel/xlsx/rel-type.js +41 -1
- package/dist/esm/modules/excel/xlsx/xform/book/defined-name-xform.js +11 -2
- package/dist/esm/modules/excel/xlsx/xform/book/external-link-xform.js +12 -10
- package/dist/esm/modules/excel/xlsx/xform/book/workbook-xform.js +96 -22
- package/dist/esm/modules/excel/xlsx/xform/chart/chart-space-xform.js +6000 -0
- package/dist/esm/modules/excel/xlsx/xform/comment/threaded-comments-xform.js +213 -0
- package/dist/esm/modules/excel/xlsx/xform/core/content-types-xform.js +150 -11
- package/dist/esm/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +20 -1
- package/dist/esm/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +1 -1
- package/dist/esm/modules/excel/xlsx/xform/drawing/drawing-xform.js +109 -5
- package/dist/esm/modules/excel/xlsx/xform/drawing/graphic-frame-xform.js +225 -0
- package/dist/esm/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.js +18 -3
- package/dist/esm/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +294 -12
- package/dist/esm/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +32 -6
- package/dist/esm/modules/excel/xlsx/xform/sheet/chartsheet-xform.js +441 -0
- package/dist/esm/modules/excel/xlsx/xform/sheet/ext-lst-xform.js +51 -2
- package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +196 -20
- package/dist/esm/modules/excel/xlsx/xform/table/auto-filter-xform.js +16 -1
- package/dist/esm/modules/excel/xlsx/xform/table/table-column-xform.js +17 -2
- package/dist/esm/modules/excel/xlsx/xform/xsd-values.js +101 -0
- package/dist/esm/modules/excel/xlsx/xlsx.browser.js +4422 -78
- package/dist/esm/modules/pdf/builder/document-builder.js +507 -2
- package/dist/esm/modules/pdf/builder/pdf-editor.js +48 -3
- package/dist/esm/modules/pdf/excel-bridge.js +683 -12
- package/dist/esm/modules/pdf/font/font-manager.js +39 -0
- package/dist/esm/modules/pdf/index.js +3 -1
- package/dist/esm/modules/pdf/render/chart-surface.js +200 -0
- package/dist/esm/modules/pdf/render/layout-engine.js +436 -56
- package/dist/esm/modules/pdf/render/page-renderer.js +169 -28
- package/dist/esm/modules/pdf/render/pdf-exporter.js +117 -7
- package/dist/esm/modules/pdf/types.js +4 -0
- package/dist/esm/modules/pdf/word-bridge.js +304 -0
- package/dist/esm/modules/word/constants.js +231 -0
- package/dist/esm/modules/word/content-types.js +53 -0
- package/dist/esm/modules/word/digital-signatures.js +134 -0
- package/dist/esm/modules/word/document.js +1795 -0
- package/dist/esm/modules/word/docx-packager.js +822 -0
- package/dist/esm/modules/word/docx-reader.js +4929 -0
- package/dist/esm/modules/word/encryption.js +274 -0
- package/dist/esm/modules/word/errors.js +68 -0
- package/dist/esm/modules/word/font-obfuscation.js +83 -0
- package/dist/esm/modules/word/html-renderer.js +782 -0
- package/dist/esm/modules/word/index.base.js +51 -0
- package/dist/esm/modules/word/index.browser.js +4 -0
- package/dist/esm/modules/word/index.js +4 -0
- package/dist/esm/modules/word/internal-utils.js +54 -0
- package/dist/esm/modules/word/relationships.js +56 -0
- package/dist/esm/modules/word/types.js +10 -0
- package/dist/esm/modules/word/units.js +111 -0
- package/dist/esm/modules/word/writers/chart-writer.js +385 -0
- package/dist/esm/modules/word/writers/checkbox-writer.js +42 -0
- package/dist/esm/modules/word/writers/comment-writer.js +70 -0
- package/dist/esm/modules/word/writers/document-writer.js +461 -0
- package/dist/esm/modules/word/writers/footnote-writer.js +72 -0
- package/dist/esm/modules/word/writers/header-footer-writer.js +129 -0
- package/dist/esm/modules/word/writers/image-writer.js +185 -0
- package/dist/esm/modules/word/writers/math-writer.js +428 -0
- package/dist/esm/modules/word/writers/numbering-writer.js +125 -0
- package/dist/esm/modules/word/writers/paragraph-writer.js +516 -0
- package/dist/esm/modules/word/writers/parts-writer.js +660 -0
- package/dist/esm/modules/word/writers/run-writer.js +649 -0
- package/dist/esm/modules/word/writers/section-writer.js +238 -0
- package/dist/esm/modules/word/writers/styles-writer.js +242 -0
- package/dist/esm/modules/word/writers/table-writer.js +503 -0
- package/dist/esm/modules/word/writers/textbox-writer.js +53 -0
- package/dist/esm/modules/word/writers/toc-writer.js +79 -0
- package/dist/esm/modules/xml/encode.js +157 -11
- package/dist/iife/excelts.iife.js +11789 -687
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +52 -44
- package/dist/types/index.browser.d.ts +8 -5
- package/dist/types/index.d.ts +4 -2
- package/dist/types/modules/excel/chart/cache-populator.d.ts +49 -0
- package/dist/types/modules/excel/chart/chart-api.d.ts +92 -0
- package/dist/types/modules/excel/chart/chart-builder.d.ts +48 -0
- package/dist/types/modules/excel/chart/chart-ex-builder.d.ts +36 -0
- package/dist/types/modules/excel/chart/chart-ex-parser.d.ts +8 -0
- package/dist/types/modules/excel/chart/chart-ex-renderer.d.ts +187 -0
- package/dist/types/modules/excel/chart/chart-ex-types.d.ts +531 -0
- package/dist/types/modules/excel/chart/chart-images.d.ts +78 -0
- package/dist/types/modules/excel/chart/chart-presets.d.ts +392 -0
- package/dist/types/modules/excel/chart/chart-renderer.d.ts +550 -0
- package/dist/types/modules/excel/chart/chart-sidecar.d.ts +21 -0
- package/dist/types/modules/excel/chart/chart-utils.d.ts +306 -0
- package/dist/types/modules/excel/chart/chart.d.ts +504 -0
- package/dist/types/modules/excel/chart/glyph-rasterizer.d.ts +62 -0
- package/dist/types/modules/excel/chart/index.d.ts +54 -0
- package/dist/types/modules/excel/chart/install.d.ts +44 -0
- package/dist/types/modules/excel/chart/shape-properties.d.ts +156 -0
- package/dist/types/modules/excel/chart/stroke-font.d.ts +36 -0
- package/dist/types/modules/excel/chart/topojson.d.ts +98 -0
- package/dist/types/modules/excel/chart/types.d.ts +2559 -0
- package/dist/types/modules/excel/chart-host-registry.d.ts +157 -0
- package/dist/types/modules/excel/chartsheet.d.ts +102 -0
- package/dist/types/modules/excel/defined-names.d.ts +35 -0
- package/dist/types/modules/excel/errors.d.ts +6 -0
- package/dist/types/modules/excel/form-control.d.ts +6 -0
- package/dist/types/modules/excel/pivot-chart.d.ts +7 -0
- package/dist/types/modules/excel/pivot-table.d.ts +55 -0
- package/dist/types/modules/excel/sparkline/index.d.ts +7 -0
- package/dist/types/modules/excel/sparkline/sparkline.d.ts +206 -0
- package/dist/types/modules/excel/types.d.ts +72 -0
- package/dist/types/modules/excel/utils/address.d.ts +18 -0
- package/dist/types/modules/excel/utils/guid.d.ts +15 -0
- package/dist/types/modules/excel/utils/ooxml-paths.d.ts +74 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-chart-sidecar.d.ts +35 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-chart.d.ts +32 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-chartsheet.d.ts +9 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-content-types.d.ts +16 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-drawing.d.ts +34 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-pivot.d.ts +14 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-relationships.d.ts +18 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-structure.d.ts +21 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-styles.d.ts +15 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-table.d.ts +31 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-workbook.d.ts +19 -0
- package/dist/types/modules/excel/utils/ooxml-validator/check-worksheet.d.ts +25 -0
- package/dist/types/modules/excel/utils/ooxml-validator/context.d.ts +85 -0
- package/dist/types/modules/excel/utils/ooxml-validator/index.d.ts +31 -0
- package/dist/types/modules/excel/utils/ooxml-validator/path-utils.d.ts +67 -0
- package/dist/types/modules/excel/utils/ooxml-validator/reporter.d.ts +41 -0
- package/dist/types/modules/excel/utils/ooxml-validator/types.d.ts +109 -0
- package/dist/types/modules/excel/utils/ooxml-validator/xml-utils.d.ts +38 -0
- package/dist/types/modules/excel/workbook.browser.d.ts +248 -30
- package/dist/types/modules/excel/workbook.d.ts +43 -0
- package/dist/types/modules/excel/worksheet.d.ts +157 -3
- package/dist/types/modules/excel/xlsx/rel-type.d.ts +40 -0
- package/dist/types/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +1 -0
- package/dist/types/modules/excel/xlsx/xform/chart/chart-space-xform.d.ts +353 -0
- package/dist/types/modules/excel/xlsx/xform/comment/threaded-comments-xform.d.ts +60 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/drawing-xform.d.ts +30 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/graphic-frame-xform.d.ts +54 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/one-cell-anchor-xform.d.ts +3 -1
- package/dist/types/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +46 -0
- package/dist/types/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +13 -2
- package/dist/types/modules/excel/xlsx/xform/sheet/chartsheet-xform.d.ts +185 -0
- package/dist/types/modules/excel/xlsx/xform/sheet/ext-lst-xform.d.ts +1 -0
- package/dist/types/modules/excel/xlsx/xform/xsd-values.d.ts +63 -0
- package/dist/types/modules/excel/xlsx/xlsx.browser.d.ts +115 -21
- package/dist/types/modules/pdf/builder/document-builder.d.ts +74 -0
- package/dist/types/modules/pdf/excel-bridge.d.ts +69 -0
- package/dist/types/modules/pdf/font/font-manager.d.ts +25 -0
- package/dist/types/modules/pdf/index.d.ts +5 -2
- package/dist/types/modules/pdf/render/chart-surface.d.ts +33 -0
- package/dist/types/modules/pdf/render/layout-engine.d.ts +22 -1
- package/dist/types/modules/pdf/types.d.ts +227 -23
- package/dist/types/modules/pdf/word-bridge.d.ts +47 -0
- package/dist/types/modules/word/constants.d.ts +179 -0
- package/dist/types/modules/word/content-types.d.ts +27 -0
- package/dist/types/modules/word/digital-signatures.d.ts +87 -0
- package/dist/types/modules/word/document.d.ts +728 -0
- package/dist/types/modules/word/docx-packager.d.ts +14 -0
- package/dist/types/modules/word/docx-reader.d.ts +11 -0
- package/dist/types/modules/word/encryption.d.ts +102 -0
- package/dist/types/modules/word/errors.d.ts +49 -0
- package/dist/types/modules/word/font-obfuscation.d.ts +31 -0
- package/dist/types/modules/word/html-renderer.d.ts +38 -0
- package/dist/types/modules/word/index.base.d.ts +19 -0
- package/dist/types/modules/word/index.browser.d.ts +4 -0
- package/dist/types/modules/word/index.d.ts +4 -0
- package/dist/types/modules/word/internal-utils.d.ts +23 -0
- package/dist/types/modules/word/relationships.d.ts +31 -0
- package/dist/types/modules/word/types.d.ts +2325 -0
- package/dist/types/modules/word/units.d.ts +49 -0
- package/dist/types/modules/word/writers/chart-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/checkbox-writer.d.ts +9 -0
- package/dist/types/modules/word/writers/comment-writer.d.ts +15 -0
- package/dist/types/modules/word/writers/document-writer.d.ts +16 -0
- package/dist/types/modules/word/writers/footnote-writer.d.ts +11 -0
- package/dist/types/modules/word/writers/header-footer-writer.d.ts +13 -0
- package/dist/types/modules/word/writers/image-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/math-writer.d.ts +9 -0
- package/dist/types/modules/word/writers/numbering-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/paragraph-writer.d.ts +13 -0
- package/dist/types/modules/word/writers/parts-writer.d.ts +26 -0
- package/dist/types/modules/word/writers/run-writer.d.ts +15 -0
- package/dist/types/modules/word/writers/section-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/styles-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/table-writer.d.ts +10 -0
- package/dist/types/modules/word/writers/textbox-writer.d.ts +9 -0
- package/dist/types/modules/word/writers/toc-writer.d.ts +9 -0
- package/dist/types/modules/xml/encode.d.ts +56 -7
- package/package.json +29 -11
- package/dist/browser/modules/excel/utils/ooxml-validator.d.ts +0 -48
- package/dist/browser/modules/excel/utils/ooxml-validator.js +0 -493
- package/dist/browser/modules/excel/utils/passthrough-manager.d.ts +0 -77
- package/dist/browser/modules/excel/utils/passthrough-manager.js +0 -129
- package/dist/cjs/modules/excel/utils/ooxml-validator.js +0 -499
- package/dist/cjs/modules/excel/utils/passthrough-manager.js +0 -133
- package/dist/esm/modules/excel/utils/ooxml-validator.js +0 -493
- package/dist/esm/modules/excel/utils/passthrough-manager.js +0 -129
- package/dist/types/modules/excel/utils/ooxml-validator.d.ts +0 -48
- package/dist/types/modules/excel/utils/passthrough-manager.d.ts +0 -77
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DOCX Module - Chart Writer
|
|
4
|
+
*
|
|
5
|
+
* Generates DrawingML chart part XML (word/charts/chartN.xml) from
|
|
6
|
+
* high-level Chart definitions.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.renderChartPart = renderChartPart;
|
|
10
|
+
const constants_1 = require("../constants");
|
|
11
|
+
const NS_C = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
12
|
+
const NS_A_LOCAL = "http://schemas.openxmlformats.org/drawingml/2006/main";
|
|
13
|
+
const NS_R_LOCAL = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
14
|
+
const CHART_TYPE_CATEGORY = {
|
|
15
|
+
bar: { tag: "barChart", direction: "bar", grouping: "clustered" },
|
|
16
|
+
barStacked: { tag: "barChart", direction: "bar", grouping: "stacked" },
|
|
17
|
+
barPercentStacked: { tag: "barChart", direction: "bar", grouping: "percentStacked" },
|
|
18
|
+
column: { tag: "barChart", direction: "col", grouping: "clustered" },
|
|
19
|
+
columnStacked: { tag: "barChart", direction: "col", grouping: "stacked" },
|
|
20
|
+
columnPercentStacked: { tag: "barChart", direction: "col", grouping: "percentStacked" },
|
|
21
|
+
line: { tag: "lineChart", grouping: "standard" },
|
|
22
|
+
lineStacked: { tag: "lineChart", grouping: "stacked" },
|
|
23
|
+
lineMarked: { tag: "lineChart", grouping: "standard", marked: true },
|
|
24
|
+
area: { tag: "areaChart", grouping: "standard" },
|
|
25
|
+
areaStacked: { tag: "areaChart", grouping: "stacked" },
|
|
26
|
+
pie: { tag: "pieChart" },
|
|
27
|
+
pie3D: { tag: "pie3DChart" },
|
|
28
|
+
doughnut: { tag: "doughnutChart" },
|
|
29
|
+
scatter: { tag: "scatterChart", scatterStyle: "marker" },
|
|
30
|
+
scatterSmooth: { tag: "scatterChart", scatterStyle: "smoothMarker" },
|
|
31
|
+
radar: { tag: "radarChart" }
|
|
32
|
+
};
|
|
33
|
+
/** Render a chart part (word/charts/chartN.xml). */
|
|
34
|
+
function renderChartPart(xml, chart) {
|
|
35
|
+
xml.openXml(constants_1.STD_DOC_ATTRIBUTES);
|
|
36
|
+
xml.openNode("c:chartSpace", {
|
|
37
|
+
"xmlns:c": NS_C,
|
|
38
|
+
"xmlns:a": NS_A_LOCAL,
|
|
39
|
+
"xmlns:r": NS_R_LOCAL
|
|
40
|
+
});
|
|
41
|
+
// Date1904 (calendar base)
|
|
42
|
+
xml.leafNode("c:date1904", { val: "0" });
|
|
43
|
+
// Language
|
|
44
|
+
xml.leafNode("c:lang", { val: "en-US" });
|
|
45
|
+
// Round text
|
|
46
|
+
xml.leafNode("c:roundedCorners", { val: "0" });
|
|
47
|
+
// Chart style (optional, defaults to 2)
|
|
48
|
+
if (chart.style !== undefined) {
|
|
49
|
+
xml.openNode("mc:AlternateContent", {
|
|
50
|
+
"xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
51
|
+
});
|
|
52
|
+
xml.openNode("mc:Choice", {
|
|
53
|
+
Requires: "c14",
|
|
54
|
+
"xmlns:c14": "http://schemas.microsoft.com/office/drawing/2007/8/2/chart"
|
|
55
|
+
});
|
|
56
|
+
xml.leafNode("c14:style", { val: String(chart.style) });
|
|
57
|
+
xml.closeNode();
|
|
58
|
+
xml.openNode("mc:Fallback");
|
|
59
|
+
xml.leafNode("c:style", { val: String(Math.min(chart.style, 48)) });
|
|
60
|
+
xml.closeNode();
|
|
61
|
+
xml.closeNode();
|
|
62
|
+
}
|
|
63
|
+
// Chart
|
|
64
|
+
xml.openNode("c:chart");
|
|
65
|
+
// Title
|
|
66
|
+
if (chart.title) {
|
|
67
|
+
renderTitle(xml, chart.title);
|
|
68
|
+
xml.leafNode("c:autoTitleDeleted", { val: "0" });
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
xml.leafNode("c:autoTitleDeleted", { val: "1" });
|
|
72
|
+
}
|
|
73
|
+
// 3D view
|
|
74
|
+
if (chart.view3d) {
|
|
75
|
+
xml.openNode("c:view3D");
|
|
76
|
+
xml.leafNode("c:rotX", { val: "15" });
|
|
77
|
+
xml.leafNode("c:rotY", { val: "20" });
|
|
78
|
+
xml.leafNode("c:depthPercent", { val: "100" });
|
|
79
|
+
xml.leafNode("c:rAngAx", { val: "1" });
|
|
80
|
+
xml.closeNode();
|
|
81
|
+
}
|
|
82
|
+
// Plot area
|
|
83
|
+
xml.openNode("c:plotArea");
|
|
84
|
+
xml.leafNode("c:layout");
|
|
85
|
+
// Chart type-specific rendering
|
|
86
|
+
const catAxId = "111111111";
|
|
87
|
+
const valAxId = "222222222";
|
|
88
|
+
renderChartTypeElement(xml, chart, catAxId, valAxId);
|
|
89
|
+
// Axes (unless pie/doughnut which use no axes)
|
|
90
|
+
const noAxes = chart.type === "pie" || chart.type === "pie3D" || chart.type === "doughnut";
|
|
91
|
+
if (!noAxes) {
|
|
92
|
+
// Category axis
|
|
93
|
+
renderAxis(xml, "catAx", catAxId, valAxId, chart.categoryAxis, "b");
|
|
94
|
+
// Value axis
|
|
95
|
+
renderAxis(xml, "valAx", valAxId, catAxId, chart.valueAxis, "l");
|
|
96
|
+
}
|
|
97
|
+
// Plot area background
|
|
98
|
+
if (chart.plotAreaColor) {
|
|
99
|
+
xml.openNode("c:spPr");
|
|
100
|
+
xml.openNode("a:solidFill");
|
|
101
|
+
xml.leafNode("a:srgbClr", { val: chart.plotAreaColor });
|
|
102
|
+
xml.closeNode();
|
|
103
|
+
xml.closeNode();
|
|
104
|
+
}
|
|
105
|
+
xml.closeNode(); // c:plotArea
|
|
106
|
+
// Legend
|
|
107
|
+
if (chart.legend !== "none") {
|
|
108
|
+
xml.openNode("c:legend");
|
|
109
|
+
xml.leafNode("c:legendPos", { val: chart.legend ?? "r" });
|
|
110
|
+
xml.leafNode("c:overlay", { val: "0" });
|
|
111
|
+
xml.closeNode();
|
|
112
|
+
}
|
|
113
|
+
xml.leafNode("c:plotVisOnly", { val: "1" });
|
|
114
|
+
xml.leafNode("c:dispBlanksAs", { val: "gap" });
|
|
115
|
+
xml.closeNode(); // c:chart
|
|
116
|
+
// Chart area background
|
|
117
|
+
if (chart.chartAreaColor) {
|
|
118
|
+
xml.openNode("c:spPr");
|
|
119
|
+
xml.openNode("a:solidFill");
|
|
120
|
+
xml.leafNode("a:srgbClr", { val: chart.chartAreaColor });
|
|
121
|
+
xml.closeNode();
|
|
122
|
+
xml.closeNode();
|
|
123
|
+
}
|
|
124
|
+
xml.closeNode(); // c:chartSpace
|
|
125
|
+
}
|
|
126
|
+
function renderTitle(xml, title) {
|
|
127
|
+
xml.openNode("c:title");
|
|
128
|
+
xml.openNode("c:tx");
|
|
129
|
+
xml.openNode("c:rich");
|
|
130
|
+
xml.leafNode("a:bodyPr", {
|
|
131
|
+
rot: "0",
|
|
132
|
+
spcFirstLastPara: "1",
|
|
133
|
+
vertOverflow: "ellipsis",
|
|
134
|
+
wrap: "square",
|
|
135
|
+
anchor: "ctr",
|
|
136
|
+
anchorCtr: "1"
|
|
137
|
+
});
|
|
138
|
+
xml.leafNode("a:lstStyle");
|
|
139
|
+
xml.openNode("a:p");
|
|
140
|
+
xml.openNode("a:pPr");
|
|
141
|
+
xml.leafNode("a:defRPr", {
|
|
142
|
+
sz: "1400",
|
|
143
|
+
b: "0",
|
|
144
|
+
i: "0",
|
|
145
|
+
u: "none",
|
|
146
|
+
strike: "noStrike",
|
|
147
|
+
kern: "1200",
|
|
148
|
+
spc: "0",
|
|
149
|
+
baseline: "0"
|
|
150
|
+
});
|
|
151
|
+
xml.closeNode();
|
|
152
|
+
xml.openNode("a:r");
|
|
153
|
+
xml.leafNode("a:rPr", { lang: "en-US" });
|
|
154
|
+
xml.openNode("a:t");
|
|
155
|
+
xml.writeText(title);
|
|
156
|
+
xml.closeNode();
|
|
157
|
+
xml.closeNode();
|
|
158
|
+
xml.closeNode();
|
|
159
|
+
xml.closeNode(); // c:rich
|
|
160
|
+
xml.closeNode(); // c:tx
|
|
161
|
+
xml.leafNode("c:overlay", { val: "0" });
|
|
162
|
+
xml.closeNode(); // c:title
|
|
163
|
+
}
|
|
164
|
+
function renderChartTypeElement(xml, chart, catAxId, valAxId) {
|
|
165
|
+
const info = CHART_TYPE_CATEGORY[chart.type] ?? { tag: "barChart" };
|
|
166
|
+
const tagName = `c:${info.tag}`;
|
|
167
|
+
xml.openNode(tagName);
|
|
168
|
+
// Direction (bar vs col)
|
|
169
|
+
if ("direction" in info && info.direction) {
|
|
170
|
+
xml.leafNode("c:barDir", { val: info.direction });
|
|
171
|
+
}
|
|
172
|
+
// Grouping (stacked/clustered/percentStacked)
|
|
173
|
+
if ("grouping" in info && info.grouping) {
|
|
174
|
+
xml.leafNode("c:grouping", { val: info.grouping });
|
|
175
|
+
}
|
|
176
|
+
// Scatter style
|
|
177
|
+
if ("scatterStyle" in info && info.scatterStyle) {
|
|
178
|
+
xml.leafNode("c:scatterStyle", { val: info.scatterStyle });
|
|
179
|
+
}
|
|
180
|
+
xml.leafNode("c:varyColors", {
|
|
181
|
+
val: chart.type === "pie" || chart.type === "pie3D" || chart.type === "doughnut" ? "1" : "0"
|
|
182
|
+
});
|
|
183
|
+
// Series
|
|
184
|
+
chart.series.forEach((series, idx) => {
|
|
185
|
+
renderSeries(xml, series, idx, chart.type, "marked" in info && info.marked);
|
|
186
|
+
});
|
|
187
|
+
// Gap width / overlap (bar/column)
|
|
188
|
+
if (info.tag === "barChart") {
|
|
189
|
+
xml.leafNode("c:gapWidth", { val: "150" });
|
|
190
|
+
if (chart.type === "barStacked" ||
|
|
191
|
+
chart.type === "barPercentStacked" ||
|
|
192
|
+
chart.type === "columnStacked" ||
|
|
193
|
+
chart.type === "columnPercentStacked") {
|
|
194
|
+
xml.leafNode("c:overlap", { val: "100" });
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
// Axes IDs
|
|
198
|
+
const noAxes = chart.type === "pie" || chart.type === "pie3D" || chart.type === "doughnut";
|
|
199
|
+
if (!noAxes) {
|
|
200
|
+
xml.leafNode("c:axId", { val: catAxId });
|
|
201
|
+
xml.leafNode("c:axId", { val: valAxId });
|
|
202
|
+
}
|
|
203
|
+
xml.closeNode(); // chart type tag
|
|
204
|
+
}
|
|
205
|
+
function renderSeries(xml, series, index, chartType, markedLine) {
|
|
206
|
+
xml.openNode("c:ser");
|
|
207
|
+
xml.leafNode("c:idx", { val: String(index) });
|
|
208
|
+
xml.leafNode("c:order", { val: String(index) });
|
|
209
|
+
// Series name
|
|
210
|
+
xml.openNode("c:tx");
|
|
211
|
+
xml.openNode("c:strRef");
|
|
212
|
+
xml.openNode("c:f");
|
|
213
|
+
xml.writeText(`Sheet1!$${String.fromCharCode(66 + index)}$1`);
|
|
214
|
+
xml.closeNode();
|
|
215
|
+
xml.openNode("c:strCache");
|
|
216
|
+
xml.leafNode("c:ptCount", { val: "1" });
|
|
217
|
+
xml.openNode("c:pt", { idx: "0" });
|
|
218
|
+
xml.openNode("c:v");
|
|
219
|
+
xml.writeText(series.name);
|
|
220
|
+
xml.closeNode();
|
|
221
|
+
xml.closeNode();
|
|
222
|
+
xml.closeNode();
|
|
223
|
+
xml.closeNode();
|
|
224
|
+
xml.closeNode(); // c:tx
|
|
225
|
+
// Series fill color
|
|
226
|
+
if (series.color) {
|
|
227
|
+
xml.openNode("c:spPr");
|
|
228
|
+
xml.openNode("a:solidFill");
|
|
229
|
+
xml.leafNode("a:srgbClr", { val: series.color });
|
|
230
|
+
xml.closeNode();
|
|
231
|
+
if (chartType.startsWith("line") || chartType === "scatter" || chartType === "scatterSmooth") {
|
|
232
|
+
xml.openNode("a:ln", { w: "28575" });
|
|
233
|
+
xml.openNode("a:solidFill");
|
|
234
|
+
xml.leafNode("a:srgbClr", { val: series.color });
|
|
235
|
+
xml.closeNode();
|
|
236
|
+
xml.closeNode();
|
|
237
|
+
}
|
|
238
|
+
xml.closeNode();
|
|
239
|
+
}
|
|
240
|
+
// Per-point colors (for pie)
|
|
241
|
+
if (series.pointColors && series.pointColors.length > 0) {
|
|
242
|
+
series.pointColors.forEach((color, i) => {
|
|
243
|
+
xml.openNode("c:dPt");
|
|
244
|
+
xml.leafNode("c:idx", { val: String(i) });
|
|
245
|
+
xml.leafNode("c:bubble3D", { val: "0" });
|
|
246
|
+
xml.openNode("c:spPr");
|
|
247
|
+
xml.openNode("a:solidFill");
|
|
248
|
+
xml.leafNode("a:srgbClr", { val: color });
|
|
249
|
+
xml.closeNode();
|
|
250
|
+
xml.closeNode();
|
|
251
|
+
xml.closeNode();
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
// Markers for line charts
|
|
255
|
+
if (markedLine) {
|
|
256
|
+
xml.openNode("c:marker");
|
|
257
|
+
xml.leafNode("c:symbol", { val: "circle" });
|
|
258
|
+
xml.leafNode("c:size", { val: "5" });
|
|
259
|
+
xml.closeNode();
|
|
260
|
+
}
|
|
261
|
+
else if (chartType.startsWith("line")) {
|
|
262
|
+
xml.openNode("c:marker");
|
|
263
|
+
xml.leafNode("c:symbol", { val: "none" });
|
|
264
|
+
xml.closeNode();
|
|
265
|
+
}
|
|
266
|
+
// Smooth for line/scatter smooth
|
|
267
|
+
if (chartType === "scatterSmooth") {
|
|
268
|
+
xml.leafNode("c:smooth", { val: "1" });
|
|
269
|
+
}
|
|
270
|
+
// Data labels
|
|
271
|
+
if (series.showDataLabels) {
|
|
272
|
+
xml.openNode("c:dLbls");
|
|
273
|
+
xml.leafNode("c:showLegendKey", { val: "0" });
|
|
274
|
+
xml.leafNode("c:showVal", { val: "1" });
|
|
275
|
+
xml.leafNode("c:showCatName", { val: "0" });
|
|
276
|
+
xml.leafNode("c:showSerName", { val: "0" });
|
|
277
|
+
xml.leafNode("c:showPercent", { val: "0" });
|
|
278
|
+
xml.leafNode("c:showBubbleSize", { val: "0" });
|
|
279
|
+
xml.closeNode();
|
|
280
|
+
}
|
|
281
|
+
// Categories (c:cat)
|
|
282
|
+
if (chartType !== "scatter" && chartType !== "scatterSmooth") {
|
|
283
|
+
xml.openNode("c:cat");
|
|
284
|
+
xml.openNode("c:strRef");
|
|
285
|
+
xml.openNode("c:f");
|
|
286
|
+
xml.writeText(`Sheet1!$A$2:$A$${series.categories.length + 1}`);
|
|
287
|
+
xml.closeNode();
|
|
288
|
+
xml.openNode("c:strCache");
|
|
289
|
+
xml.leafNode("c:ptCount", { val: String(series.categories.length) });
|
|
290
|
+
series.categories.forEach((cat, i) => {
|
|
291
|
+
xml.openNode("c:pt", { idx: String(i) });
|
|
292
|
+
xml.openNode("c:v");
|
|
293
|
+
xml.writeText(cat);
|
|
294
|
+
xml.closeNode();
|
|
295
|
+
xml.closeNode();
|
|
296
|
+
});
|
|
297
|
+
xml.closeNode();
|
|
298
|
+
xml.closeNode();
|
|
299
|
+
xml.closeNode();
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
// For scatter: xVal
|
|
303
|
+
xml.openNode("c:xVal");
|
|
304
|
+
xml.openNode("c:numRef");
|
|
305
|
+
xml.openNode("c:f");
|
|
306
|
+
xml.writeText(`Sheet1!$A$2:$A$${series.categories.length + 1}`);
|
|
307
|
+
xml.closeNode();
|
|
308
|
+
xml.openNode("c:numCache");
|
|
309
|
+
xml.leafNode("c:formatCode", { val: "General" });
|
|
310
|
+
xml.leafNode("c:ptCount", { val: String(series.categories.length) });
|
|
311
|
+
series.categories.forEach((cat, i) => {
|
|
312
|
+
xml.openNode("c:pt", { idx: String(i) });
|
|
313
|
+
xml.openNode("c:v");
|
|
314
|
+
xml.writeText(cat);
|
|
315
|
+
xml.closeNode();
|
|
316
|
+
xml.closeNode();
|
|
317
|
+
});
|
|
318
|
+
xml.closeNode();
|
|
319
|
+
xml.closeNode();
|
|
320
|
+
xml.closeNode();
|
|
321
|
+
}
|
|
322
|
+
// Values (c:val or c:yVal)
|
|
323
|
+
const valTag = chartType === "scatter" || chartType === "scatterSmooth" ? "c:yVal" : "c:val";
|
|
324
|
+
xml.openNode(valTag);
|
|
325
|
+
xml.openNode("c:numRef");
|
|
326
|
+
xml.openNode("c:f");
|
|
327
|
+
xml.writeText(`Sheet1!$B$2:$B$${series.values.length + 1}`);
|
|
328
|
+
xml.closeNode();
|
|
329
|
+
xml.openNode("c:numCache");
|
|
330
|
+
xml.leafNode("c:formatCode", { val: "General" });
|
|
331
|
+
xml.leafNode("c:ptCount", { val: String(series.values.length) });
|
|
332
|
+
series.values.forEach((val, i) => {
|
|
333
|
+
xml.openNode("c:pt", { idx: String(i) });
|
|
334
|
+
xml.openNode("c:v");
|
|
335
|
+
xml.writeText(String(val));
|
|
336
|
+
xml.closeNode();
|
|
337
|
+
xml.closeNode();
|
|
338
|
+
});
|
|
339
|
+
xml.closeNode();
|
|
340
|
+
xml.closeNode();
|
|
341
|
+
xml.closeNode();
|
|
342
|
+
xml.closeNode(); // c:ser
|
|
343
|
+
}
|
|
344
|
+
function renderAxis(xml, tagName, axId, crossAxId, axis, defaultPos) {
|
|
345
|
+
xml.openNode(`c:${tagName}`);
|
|
346
|
+
xml.leafNode("c:axId", { val: axId });
|
|
347
|
+
// Scaling
|
|
348
|
+
xml.openNode("c:scaling");
|
|
349
|
+
xml.leafNode("c:orientation", { val: "minMax" });
|
|
350
|
+
if (axis?.min !== undefined) {
|
|
351
|
+
xml.leafNode("c:min", { val: String(axis.min) });
|
|
352
|
+
}
|
|
353
|
+
if (axis?.max !== undefined) {
|
|
354
|
+
xml.leafNode("c:max", { val: String(axis.max) });
|
|
355
|
+
}
|
|
356
|
+
xml.closeNode();
|
|
357
|
+
xml.leafNode("c:delete", { val: axis?.hidden ? "1" : "0" });
|
|
358
|
+
xml.leafNode("c:axPos", { val: defaultPos });
|
|
359
|
+
// Title
|
|
360
|
+
if (axis?.title) {
|
|
361
|
+
renderTitle(xml, axis.title);
|
|
362
|
+
}
|
|
363
|
+
// Number format
|
|
364
|
+
if (axis?.numberFormat) {
|
|
365
|
+
xml.leafNode("c:numFmt", { formatCode: axis.numberFormat, sourceLinked: "0" });
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
xml.leafNode("c:numFmt", { formatCode: "General", sourceLinked: "1" });
|
|
369
|
+
}
|
|
370
|
+
xml.leafNode("c:majorTickMark", { val: "out" });
|
|
371
|
+
xml.leafNode("c:minorTickMark", { val: "none" });
|
|
372
|
+
xml.leafNode("c:tickLblPos", { val: "nextTo" });
|
|
373
|
+
xml.leafNode("c:crossAx", { val: crossAxId });
|
|
374
|
+
xml.leafNode("c:crosses", { val: "autoZero" });
|
|
375
|
+
if (tagName === "catAx") {
|
|
376
|
+
xml.leafNode("c:auto", { val: "1" });
|
|
377
|
+
xml.leafNode("c:lblAlgn", { val: "ctr" });
|
|
378
|
+
xml.leafNode("c:lblOffset", { val: "100" });
|
|
379
|
+
xml.leafNode("c:noMultiLvlLbl", { val: "0" });
|
|
380
|
+
}
|
|
381
|
+
else {
|
|
382
|
+
xml.leafNode("c:crossBetween", { val: "between" });
|
|
383
|
+
if (axis?.majorUnit) {
|
|
384
|
+
xml.leafNode("c:majorUnit", { val: String(axis.majorUnit) });
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
xml.closeNode();
|
|
388
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DOCX Writers - CheckBox
|
|
4
|
+
*
|
|
5
|
+
* Renders checkbox as a structured document tag (SDT) with w14:checkbox.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.renderCheckBox = renderCheckBox;
|
|
9
|
+
const constants_1 = require("../constants");
|
|
10
|
+
/** Render a checkbox as a paragraph with SDT. */
|
|
11
|
+
function renderCheckBox(xml, cb) {
|
|
12
|
+
const checked = cb.checked ?? false;
|
|
13
|
+
const checkedChar = cb.checkedState?.value ?? "2612"; // ☒
|
|
14
|
+
const uncheckedChar = cb.uncheckedState?.value ?? "2610"; // ☐
|
|
15
|
+
const checkedFont = cb.checkedState?.font ?? "MS Gothic";
|
|
16
|
+
const uncheckedFont = cb.uncheckedState?.font ?? "MS Gothic";
|
|
17
|
+
const displayChar = checked ? checkedChar : uncheckedChar;
|
|
18
|
+
const displayFont = checked ? checkedFont : uncheckedFont;
|
|
19
|
+
xml.openNode("w:sdt");
|
|
20
|
+
// SDT properties
|
|
21
|
+
xml.openNode("w:sdtPr");
|
|
22
|
+
xml.openNode("w14:checkbox", { "xmlns:w14": constants_1.NS_W14 });
|
|
23
|
+
xml.leafNode("w14:checked", { "w14:val": checked ? "1" : "0" });
|
|
24
|
+
xml.leafNode("w14:checkedState", { "w14:val": checkedChar, "w14:font": checkedFont });
|
|
25
|
+
xml.leafNode("w14:uncheckedState", { "w14:val": uncheckedChar, "w14:font": uncheckedFont });
|
|
26
|
+
xml.closeNode();
|
|
27
|
+
xml.closeNode();
|
|
28
|
+
// SDT content - display the checkbox character
|
|
29
|
+
xml.openNode("w:sdtContent");
|
|
30
|
+
xml.openNode("w:r");
|
|
31
|
+
xml.openNode("w:rPr");
|
|
32
|
+
xml.leafNode("w:rFonts", {
|
|
33
|
+
"w:ascii": displayFont,
|
|
34
|
+
"w:hAnsi": displayFont,
|
|
35
|
+
"w:eastAsia": displayFont
|
|
36
|
+
});
|
|
37
|
+
xml.closeNode();
|
|
38
|
+
xml.openNode("w:t");
|
|
39
|
+
// Convert hex code point to character
|
|
40
|
+
xml.writeText(String.fromCodePoint(parseInt(displayChar, 16)));
|
|
41
|
+
xml.closeNode();
|
|
42
|
+
xml.closeNode();
|
|
43
|
+
xml.closeNode();
|
|
44
|
+
xml.closeNode(); // w:sdt
|
|
45
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DOCX Writers - Comments
|
|
4
|
+
*
|
|
5
|
+
* Renders word/comments.xml and word/commentsExtended.xml parts.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.renderComments = renderComments;
|
|
9
|
+
exports.renderCommentsExtended = renderCommentsExtended;
|
|
10
|
+
const constants_1 = require("../constants");
|
|
11
|
+
const paragraph_writer_1 = require("./paragraph-writer");
|
|
12
|
+
const NS_W15 = "http://schemas.microsoft.com/office/word/2012/wordml";
|
|
13
|
+
/** Render word/comments.xml. */
|
|
14
|
+
function renderComments(xml, comments) {
|
|
15
|
+
xml.openXml(constants_1.STD_DOC_ATTRIBUTES);
|
|
16
|
+
xml.openNode("w:comments", {
|
|
17
|
+
"xmlns:w": constants_1.NS_W,
|
|
18
|
+
"xmlns:r": constants_1.NS_R
|
|
19
|
+
});
|
|
20
|
+
for (const comment of comments) {
|
|
21
|
+
const attrs = {
|
|
22
|
+
"w:id": String(comment.id),
|
|
23
|
+
"w:author": comment.author
|
|
24
|
+
};
|
|
25
|
+
if (comment.date) {
|
|
26
|
+
attrs["w:date"] = comment.date;
|
|
27
|
+
}
|
|
28
|
+
if (comment.initials) {
|
|
29
|
+
attrs["w:initials"] = comment.initials;
|
|
30
|
+
}
|
|
31
|
+
xml.openNode("w:comment", attrs);
|
|
32
|
+
for (const para of comment.content) {
|
|
33
|
+
(0, paragraph_writer_1.renderParagraph)(xml, para);
|
|
34
|
+
}
|
|
35
|
+
xml.closeNode();
|
|
36
|
+
}
|
|
37
|
+
xml.closeNode();
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Render word/commentsExtended.xml — extended comment metadata (done/parentId).
|
|
41
|
+
* Only includes comments that have either `done` or `parentId` set.
|
|
42
|
+
* @returns true if any extended comments were rendered.
|
|
43
|
+
*/
|
|
44
|
+
function renderCommentsExtended(xml, comments) {
|
|
45
|
+
// Collect comments that need extension
|
|
46
|
+
const extended = comments.filter(c => c.done !== undefined || c.parentId !== undefined);
|
|
47
|
+
if (extended.length === 0) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
// Each extended comment must reference the paraId of its first paragraph
|
|
51
|
+
xml.openXml(constants_1.STD_DOC_ATTRIBUTES);
|
|
52
|
+
xml.openNode("w15:commentsEx", {
|
|
53
|
+
"xmlns:w": constants_1.NS_W,
|
|
54
|
+
"xmlns:w15": NS_W15,
|
|
55
|
+
"mc:Ignorable": "w15",
|
|
56
|
+
"xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
57
|
+
});
|
|
58
|
+
for (const c of extended) {
|
|
59
|
+
const firstPara = c.content[0];
|
|
60
|
+
if (!firstPara?.paraId) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
const attrs = { "w15:paraId": firstPara.paraId };
|
|
64
|
+
if (c.done) {
|
|
65
|
+
attrs["w15:done"] = "1";
|
|
66
|
+
}
|
|
67
|
+
if (c.parentId) {
|
|
68
|
+
attrs["w15:paraIdParent"] = c.parentId;
|
|
69
|
+
}
|
|
70
|
+
xml.leafNode("w15:commentEx", attrs);
|
|
71
|
+
}
|
|
72
|
+
xml.closeNode();
|
|
73
|
+
return true;
|
|
74
|
+
}
|