@rowsncolumns/toolkit 24.4.1
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/LICENSE.md +100 -0
- package/Readme.md +27 -0
- package/dist/cjs/autofilter-condition.d.ts +43 -0
- package/dist/cjs/autofilter-condition.d.ts.map +1 -0
- package/dist/cjs/autofilter-condition.js +155 -0
- package/dist/cjs/csv-export.d.ts +49 -0
- package/dist/cjs/csv-export.d.ts.map +1 -0
- package/dist/cjs/csv-export.js +142 -0
- package/dist/cjs/csv-import-worker.d.ts +16 -0
- package/dist/cjs/csv-import-worker.d.ts.map +1 -0
- package/dist/cjs/csv-import-worker.js +60 -0
- package/dist/cjs/csv-import.d.ts +38 -0
- package/dist/cjs/csv-import.d.ts.map +1 -0
- package/dist/cjs/csv-import.js +166 -0
- package/dist/cjs/csv-parser/helpers.d.ts +14 -0
- package/dist/cjs/csv-parser/helpers.d.ts.map +1 -0
- package/dist/cjs/csv-parser/helpers.js +145 -0
- package/dist/cjs/csv-parser/types.d.ts +66 -0
- package/dist/cjs/csv-parser/types.d.ts.map +1 -0
- package/dist/cjs/csv-parser/types.js +14 -0
- package/dist/cjs/csv-parser/worker.d.ts +2 -0
- package/dist/cjs/csv-parser/worker.d.ts.map +1 -0
- package/dist/cjs/csv-parser/worker.js +200 -0
- package/dist/cjs/excel-export.d.ts +11 -0
- package/dist/cjs/excel-export.d.ts.map +1 -0
- package/dist/cjs/excel-export.js +22 -0
- package/dist/cjs/excel-import-session.d.ts +51 -0
- package/dist/cjs/excel-import-session.d.ts.map +1 -0
- package/dist/cjs/excel-import-session.js +307 -0
- package/dist/cjs/excel-import-worker.d.ts +7 -0
- package/dist/cjs/excel-import-worker.d.ts.map +1 -0
- package/dist/cjs/excel-import-worker.js +119 -0
- package/dist/cjs/excel-parser/builtin-numfmts.d.ts +24 -0
- package/dist/cjs/excel-parser/builtin-numfmts.d.ts.map +1 -0
- package/dist/cjs/excel-parser/builtin-numfmts.js +63 -0
- package/dist/cjs/excel-parser/cfb-decryptor.d.ts +53 -0
- package/dist/cjs/excel-parser/cfb-decryptor.d.ts.map +1 -0
- package/dist/cjs/excel-parser/cfb-decryptor.js +553 -0
- package/dist/cjs/excel-parser/cfb-encryptor.d.ts +23 -0
- package/dist/cjs/excel-parser/cfb-encryptor.d.ts.map +1 -0
- package/dist/cjs/excel-parser/cfb-encryptor.js +200 -0
- package/dist/cjs/excel-parser/dv-cell-stamp.d.ts +29 -0
- package/dist/cjs/excel-parser/dv-cell-stamp.d.ts.map +1 -0
- package/dist/cjs/excel-parser/dv-cell-stamp.js +239 -0
- package/dist/cjs/excel-parser/helpers.d.ts +28 -0
- package/dist/cjs/excel-parser/helpers.d.ts.map +1 -0
- package/dist/cjs/excel-parser/helpers.js +188 -0
- package/dist/cjs/excel-parser/interface.d.ts +179 -0
- package/dist/cjs/excel-parser/interface.d.ts.map +1 -0
- package/dist/cjs/excel-parser/interface.js +1 -0
- package/dist/cjs/excel-parser/plugins/base/index.d.ts +31 -0
- package/dist/cjs/excel-parser/plugins/base/index.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/base/index.js +101 -0
- package/dist/cjs/excel-parser/plugins/ods/conditional-formatting.d.ts +16 -0
- package/dist/cjs/excel-parser/plugins/ods/conditional-formatting.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/ods/conditional-formatting.js +488 -0
- package/dist/cjs/excel-parser/plugins/ods/data-validations.d.ts +15 -0
- package/dist/cjs/excel-parser/plugins/ods/data-validations.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/ods/data-validations.js +353 -0
- package/dist/cjs/excel-parser/plugins/ods/formula.d.ts +8 -0
- package/dist/cjs/excel-parser/plugins/ods/formula.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/ods/formula.js +82 -0
- package/dist/cjs/excel-parser/plugins/ods/index.d.ts +122 -0
- package/dist/cjs/excel-parser/plugins/ods/index.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/ods/index.js +3642 -0
- package/dist/cjs/excel-parser/plugins/ods/sparklines.d.ts +25 -0
- package/dist/cjs/excel-parser/plugins/ods/sparklines.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/ods/sparklines.js +221 -0
- package/dist/cjs/excel-parser/plugins/ods/styles.d.ts +60 -0
- package/dist/cjs/excel-parser/plugins/ods/styles.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/ods/styles.js +808 -0
- package/dist/cjs/excel-parser/plugins/ods/types.d.ts +7 -0
- package/dist/cjs/excel-parser/plugins/ods/types.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/ods/types.js +1 -0
- package/dist/cjs/excel-parser/plugins/xls/index.d.ts +5 -0
- package/dist/cjs/excel-parser/plugins/xls/index.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xls/index.js +19 -0
- package/dist/cjs/excel-parser/plugins/xlsb/biff-record-reader.d.ts +13 -0
- package/dist/cjs/excel-parser/plugins/xlsb/biff-record-reader.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsb/biff-record-reader.js +49 -0
- package/dist/cjs/excel-parser/plugins/xlsb/index.d.ts +117 -0
- package/dist/cjs/excel-parser/plugins/xlsb/index.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsb/index.js +2972 -0
- package/dist/cjs/excel-parser/plugins/xlsb/rgce-parser.d.ts +18 -0
- package/dist/cjs/excel-parser/plugins/xlsb/rgce-parser.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsb/rgce-parser.js +527 -0
- package/dist/cjs/excel-parser/plugins/xlsm/index.d.ts +5 -0
- package/dist/cjs/excel-parser/plugins/xlsm/index.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsm/index.js +10 -0
- package/dist/cjs/excel-parser/plugins/xlsx/charts.d.ts +60 -0
- package/dist/cjs/excel-parser/plugins/xlsx/charts.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsx/charts.js +2178 -0
- package/dist/cjs/excel-parser/plugins/xlsx/conditional-formatting.d.ts +18 -0
- package/dist/cjs/excel-parser/plugins/xlsx/conditional-formatting.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsx/conditional-formatting.js +620 -0
- package/dist/cjs/excel-parser/plugins/xlsx/data-validations.d.ts +4 -0
- package/dist/cjs/excel-parser/plugins/xlsx/data-validations.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsx/data-validations.js +515 -0
- package/dist/cjs/excel-parser/plugins/xlsx/drawing.d.ts +39 -0
- package/dist/cjs/excel-parser/plugins/xlsx/drawing.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsx/drawing.js +941 -0
- package/dist/cjs/excel-parser/plugins/xlsx/index.d.ts +320 -0
- package/dist/cjs/excel-parser/plugins/xlsx/index.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsx/index.js +6056 -0
- package/dist/cjs/excel-parser/plugins/xlsx/numfmt.d.ts +2 -0
- package/dist/cjs/excel-parser/plugins/xlsx/numfmt.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsx/numfmt.js +3 -0
- package/dist/cjs/excel-parser/plugins/xlsx/pivots.d.ts +40 -0
- package/dist/cjs/excel-parser/plugins/xlsx/pivots.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsx/pivots.js +342 -0
- package/dist/cjs/excel-parser/plugins/xlsx/relationships.d.ts +8 -0
- package/dist/cjs/excel-parser/plugins/xlsx/relationships.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsx/relationships.js +26 -0
- package/dist/cjs/excel-parser/plugins/xlsx/sheet-views.d.ts +26 -0
- package/dist/cjs/excel-parser/plugins/xlsx/sheet-views.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsx/sheet-views.js +59 -0
- package/dist/cjs/excel-parser/plugins/xlsx/styles.d.ts +44 -0
- package/dist/cjs/excel-parser/plugins/xlsx/styles.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsx/styles.js +1377 -0
- package/dist/cjs/excel-parser/plugins/xlsx/theme.d.ts +50 -0
- package/dist/cjs/excel-parser/plugins/xlsx/theme.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsx/theme.js +150 -0
- package/dist/cjs/excel-parser/plugins/xlsx/threaded-comments.d.ts +47 -0
- package/dist/cjs/excel-parser/plugins/xlsx/threaded-comments.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsx/threaded-comments.js +141 -0
- package/dist/cjs/excel-parser/plugins/xlsx/value-type-detection.d.ts +44 -0
- package/dist/cjs/excel-parser/plugins/xlsx/value-type-detection.d.ts.map +1 -0
- package/dist/cjs/excel-parser/plugins/xlsx/value-type-detection.js +407 -0
- package/dist/cjs/excel-parser/registry.d.ts +5 -0
- package/dist/cjs/excel-parser/registry.d.ts.map +1 -0
- package/dist/cjs/excel-parser/registry.js +21 -0
- package/dist/cjs/excel-parser/style-registry.d.ts +51 -0
- package/dist/cjs/excel-parser/style-registry.d.ts.map +1 -0
- package/dist/cjs/excel-parser/style-registry.js +175 -0
- package/dist/cjs/excel-parser/theme-default.d.ts +3 -0
- package/dist/cjs/excel-parser/theme-default.d.ts.map +1 -0
- package/dist/cjs/excel-parser/theme-default.js +19 -0
- package/dist/cjs/excel-parser/types.d.ts +365 -0
- package/dist/cjs/excel-parser/types.d.ts.map +1 -0
- package/dist/cjs/excel-parser/types.js +59 -0
- package/dist/cjs/excel-parser/utils.d.ts +6 -0
- package/dist/cjs/excel-parser/utils.d.ts.map +1 -0
- package/dist/cjs/excel-parser/utils.js +30 -0
- package/dist/cjs/excel-parser/workbook.d.ts +51 -0
- package/dist/cjs/excel-parser/workbook.d.ts.map +1 -0
- package/dist/cjs/excel-parser/workbook.js +317 -0
- package/dist/cjs/excel-parser/worker.d.ts +2 -0
- package/dist/cjs/excel-parser/worker.d.ts.map +1 -0
- package/dist/cjs/excel-parser/worker.js +1149 -0
- package/dist/cjs/excel-parser/zip-parser-streaming.d.ts +13 -0
- package/dist/cjs/excel-parser/zip-parser-streaming.d.ts.map +1 -0
- package/dist/cjs/excel-parser/zip-parser-streaming.js +200 -0
- package/dist/cjs/excel-parser/zip-parser.d.ts +11 -0
- package/dist/cjs/excel-parser/zip-parser.d.ts.map +1 -0
- package/dist/cjs/excel-parser/zip-parser.js +49 -0
- package/dist/cjs/exporter/invalid-data-validation.d.ts +19 -0
- package/dist/cjs/exporter/invalid-data-validation.d.ts.map +1 -0
- package/dist/cjs/exporter/invalid-data-validation.js +39 -0
- package/dist/cjs/exporter/ods/ods-export.d.ts +26 -0
- package/dist/cjs/exporter/ods/ods-export.d.ts.map +1 -0
- package/dist/cjs/exporter/ods/ods-export.js +3714 -0
- package/dist/cjs/exporter/ods/sparkline-builder.d.ts +33 -0
- package/dist/cjs/exporter/ods/sparkline-builder.d.ts.map +1 -0
- package/dist/cjs/exporter/ods/sparkline-builder.js +221 -0
- package/dist/cjs/exporter/xlsx/chart-builder.d.ts +3 -0
- package/dist/cjs/exporter/xlsx/chart-builder.d.ts.map +1 -0
- package/dist/cjs/exporter/xlsx/chart-builder.js +1901 -0
- package/dist/cjs/exporter/xlsx/chart-templates.d.ts +1781 -0
- package/dist/cjs/exporter/xlsx/chart-templates.d.ts.map +1 -0
- package/dist/cjs/exporter/xlsx/chart-templates.js +1798 -0
- package/dist/cjs/exporter/xlsx/future-functions.d.ts +10 -0
- package/dist/cjs/exporter/xlsx/future-functions.d.ts.map +1 -0
- package/dist/cjs/exporter/xlsx/future-functions.js +264 -0
- package/dist/cjs/exporter/xlsx/pivot-builder.d.ts +58 -0
- package/dist/cjs/exporter/xlsx/pivot-builder.d.ts.map +1 -0
- package/dist/cjs/exporter/xlsx/pivot-builder.js +277 -0
- package/dist/cjs/exporter/xlsx/power-query-builder.d.ts +26 -0
- package/dist/cjs/exporter/xlsx/power-query-builder.d.ts.map +1 -0
- package/dist/cjs/exporter/xlsx/power-query-builder.js +306 -0
- package/dist/cjs/exporter/xlsx/slicer-builder.d.ts +11 -0
- package/dist/cjs/exporter/xlsx/slicer-builder.d.ts.map +1 -0
- package/dist/cjs/exporter/xlsx/slicer-builder.js +87 -0
- package/dist/cjs/exporter/xlsx/sparkline-builder.d.ts +61 -0
- package/dist/cjs/exporter/xlsx/sparkline-builder.d.ts.map +1 -0
- package/dist/cjs/exporter/xlsx/sparkline-builder.js +489 -0
- package/dist/cjs/exporter/xlsx/style-builder.d.ts +93 -0
- package/dist/cjs/exporter/xlsx/style-builder.d.ts.map +1 -0
- package/dist/cjs/exporter/xlsx/style-builder.js +813 -0
- package/dist/cjs/exporter/xlsx/threaded-comments-builder.d.ts +58 -0
- package/dist/cjs/exporter/xlsx/threaded-comments-builder.d.ts.map +1 -0
- package/dist/cjs/exporter/xlsx/threaded-comments-builder.js +189 -0
- package/dist/cjs/exporter/xlsx/xlsx-export.d.ts +121 -0
- package/dist/cjs/exporter/xlsx/xlsx-export.d.ts.map +1 -0
- package/dist/cjs/exporter/xlsx/xlsx-export.js +4596 -0
- package/dist/cjs/helpers/theme-xml-generator.d.ts +8 -0
- package/dist/cjs/helpers/theme-xml-generator.d.ts.map +1 -0
- package/dist/cjs/helpers/theme-xml-generator.js +33 -0
- package/dist/cjs/helpers.d.ts +34 -0
- package/dist/cjs/helpers.d.ts.map +1 -0
- package/dist/cjs/helpers.js +189 -0
- package/dist/cjs/index.d.ts +16 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +15 -0
- package/dist/cjs/indexed-colors.d.ts +2 -0
- package/dist/cjs/indexed-colors.d.ts.map +1 -0
- package/dist/cjs/indexed-colors.js +75 -0
- package/dist/cjs/ods-export.d.ts +24 -0
- package/dist/cjs/ods-export.d.ts.map +1 -0
- package/dist/cjs/ods-export.js +23 -0
- package/dist/cjs/parse.d.ts +24 -0
- package/dist/cjs/parse.d.ts.map +1 -0
- package/dist/cjs/parse.js +68 -0
- package/dist/cjs/power-query.d.ts +41 -0
- package/dist/cjs/power-query.d.ts.map +1 -0
- package/dist/cjs/power-query.js +22 -0
- package/dist/cjs/server.d.ts +9 -0
- package/dist/cjs/server.d.ts.map +1 -0
- package/dist/cjs/server.js +8 -0
- package/dist/cjs/theme1.d.ts +3 -0
- package/dist/cjs/theme1.d.ts.map +1 -0
- package/dist/cjs/theme1.js +2 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/cjs/types.d.ts +14 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +14 -0
- package/dist/cjs/vitest.config.d.ts +3 -0
- package/dist/cjs/vitest.config.d.ts.map +1 -0
- package/dist/cjs/vitest.config.js +16 -0
- package/dist/esm/autofilter-condition.d.ts +43 -0
- package/dist/esm/autofilter-condition.d.ts.map +1 -0
- package/dist/esm/autofilter-condition.js +145 -0
- package/dist/esm/csv-export.d.ts +49 -0
- package/dist/esm/csv-export.d.ts.map +1 -0
- package/dist/esm/csv-export.js +126 -0
- package/dist/esm/csv-import-worker.d.ts +16 -0
- package/dist/esm/csv-import-worker.d.ts.map +1 -0
- package/dist/esm/csv-import-worker.js +60 -0
- package/dist/esm/csv-import.d.ts +38 -0
- package/dist/esm/csv-import.d.ts.map +1 -0
- package/dist/esm/csv-import.js +132 -0
- package/dist/esm/csv-parser/helpers.d.ts +14 -0
- package/dist/esm/csv-parser/helpers.d.ts.map +1 -0
- package/dist/esm/csv-parser/helpers.js +0 -0
- package/dist/esm/csv-parser/types.d.ts +66 -0
- package/dist/esm/csv-parser/types.d.ts.map +1 -0
- package/dist/esm/csv-parser/types.js +14 -0
- package/dist/esm/csv-parser/worker.d.ts +2 -0
- package/dist/esm/csv-parser/worker.d.ts.map +1 -0
- package/dist/esm/csv-parser/worker.js +154 -0
- package/dist/esm/excel-export.d.ts +11 -0
- package/dist/esm/excel-export.d.ts.map +1 -0
- package/dist/esm/excel-export.js +13 -0
- package/dist/esm/excel-import-session.d.ts +51 -0
- package/dist/esm/excel-import-session.d.ts.map +1 -0
- package/dist/esm/excel-import-session.js +255 -0
- package/dist/esm/excel-import-worker.d.ts +7 -0
- package/dist/esm/excel-import-worker.d.ts.map +1 -0
- package/dist/esm/excel-import-worker.js +116 -0
- package/dist/esm/excel-parser/builtin-numfmts.d.ts +24 -0
- package/dist/esm/excel-parser/builtin-numfmts.d.ts.map +1 -0
- package/dist/esm/excel-parser/builtin-numfmts.js +59 -0
- package/dist/esm/excel-parser/cfb-decryptor.d.ts +53 -0
- package/dist/esm/excel-parser/cfb-decryptor.d.ts.map +1 -0
- package/dist/esm/excel-parser/cfb-decryptor.js +493 -0
- package/dist/esm/excel-parser/cfb-encryptor.d.ts +23 -0
- package/dist/esm/excel-parser/cfb-encryptor.d.ts.map +1 -0
- package/dist/esm/excel-parser/cfb-encryptor.js +181 -0
- package/dist/esm/excel-parser/dv-cell-stamp.d.ts +29 -0
- package/dist/esm/excel-parser/dv-cell-stamp.d.ts.map +1 -0
- package/dist/esm/excel-parser/dv-cell-stamp.js +155 -0
- package/dist/esm/excel-parser/helpers.d.ts +28 -0
- package/dist/esm/excel-parser/helpers.d.ts.map +1 -0
- package/dist/esm/excel-parser/helpers.js +160 -0
- package/dist/esm/excel-parser/interface.d.ts +179 -0
- package/dist/esm/excel-parser/interface.d.ts.map +1 -0
- package/dist/esm/excel-parser/interface.js +1 -0
- package/dist/esm/excel-parser/plugins/base/index.d.ts +31 -0
- package/dist/esm/excel-parser/plugins/base/index.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/base/index.js +64 -0
- package/dist/esm/excel-parser/plugins/ods/conditional-formatting.d.ts +16 -0
- package/dist/esm/excel-parser/plugins/ods/conditional-formatting.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/ods/conditional-formatting.js +405 -0
- package/dist/esm/excel-parser/plugins/ods/data-validations.d.ts +15 -0
- package/dist/esm/excel-parser/plugins/ods/data-validations.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/ods/data-validations.js +331 -0
- package/dist/esm/excel-parser/plugins/ods/formula.d.ts +8 -0
- package/dist/esm/excel-parser/plugins/ods/formula.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/ods/formula.js +82 -0
- package/dist/esm/excel-parser/plugins/ods/index.d.ts +122 -0
- package/dist/esm/excel-parser/plugins/ods/index.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/ods/index.js +2896 -0
- package/dist/esm/excel-parser/plugins/ods/sparklines.d.ts +25 -0
- package/dist/esm/excel-parser/plugins/ods/sparklines.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/ods/sparklines.js +188 -0
- package/dist/esm/excel-parser/plugins/ods/styles.d.ts +60 -0
- package/dist/esm/excel-parser/plugins/ods/styles.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/ods/styles.js +732 -0
- package/dist/esm/excel-parser/plugins/ods/types.d.ts +7 -0
- package/dist/esm/excel-parser/plugins/ods/types.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/ods/types.js +1 -0
- package/dist/esm/excel-parser/plugins/xls/index.d.ts +5 -0
- package/dist/esm/excel-parser/plugins/xls/index.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xls/index.js +7 -0
- package/dist/esm/excel-parser/plugins/xlsb/biff-record-reader.d.ts +13 -0
- package/dist/esm/excel-parser/plugins/xlsb/biff-record-reader.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsb/biff-record-reader.js +48 -0
- package/dist/esm/excel-parser/plugins/xlsb/index.d.ts +117 -0
- package/dist/esm/excel-parser/plugins/xlsb/index.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsb/index.js +2339 -0
- package/dist/esm/excel-parser/plugins/xlsb/rgce-parser.d.ts +18 -0
- package/dist/esm/excel-parser/plugins/xlsb/rgce-parser.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsb/rgce-parser.js +522 -0
- package/dist/esm/excel-parser/plugins/xlsm/index.d.ts +5 -0
- package/dist/esm/excel-parser/plugins/xlsm/index.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsm/index.js +6 -0
- package/dist/esm/excel-parser/plugins/xlsx/charts.d.ts +60 -0
- package/dist/esm/excel-parser/plugins/xlsx/charts.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsx/charts.js +2036 -0
- package/dist/esm/excel-parser/plugins/xlsx/conditional-formatting.d.ts +18 -0
- package/dist/esm/excel-parser/plugins/xlsx/conditional-formatting.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsx/conditional-formatting.js +621 -0
- package/dist/esm/excel-parser/plugins/xlsx/data-validations.d.ts +4 -0
- package/dist/esm/excel-parser/plugins/xlsx/data-validations.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsx/data-validations.js +493 -0
- package/dist/esm/excel-parser/plugins/xlsx/drawing.d.ts +39 -0
- package/dist/esm/excel-parser/plugins/xlsx/drawing.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsx/drawing.js +905 -0
- package/dist/esm/excel-parser/plugins/xlsx/index.d.ts +320 -0
- package/dist/esm/excel-parser/plugins/xlsx/index.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsx/index.js +4654 -0
- package/dist/esm/excel-parser/plugins/xlsx/numfmt.d.ts +2 -0
- package/dist/esm/excel-parser/plugins/xlsx/numfmt.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsx/numfmt.js +3 -0
- package/dist/esm/excel-parser/plugins/xlsx/pivots.d.ts +40 -0
- package/dist/esm/excel-parser/plugins/xlsx/pivots.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsx/pivots.js +254 -0
- package/dist/esm/excel-parser/plugins/xlsx/relationships.d.ts +8 -0
- package/dist/esm/excel-parser/plugins/xlsx/relationships.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsx/relationships.js +13 -0
- package/dist/esm/excel-parser/plugins/xlsx/sheet-views.d.ts +26 -0
- package/dist/esm/excel-parser/plugins/xlsx/sheet-views.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsx/sheet-views.js +64 -0
- package/dist/esm/excel-parser/plugins/xlsx/styles.d.ts +44 -0
- package/dist/esm/excel-parser/plugins/xlsx/styles.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsx/styles.js +1365 -0
- package/dist/esm/excel-parser/plugins/xlsx/theme.d.ts +50 -0
- package/dist/esm/excel-parser/plugins/xlsx/theme.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsx/theme.js +127 -0
- package/dist/esm/excel-parser/plugins/xlsx/threaded-comments.d.ts +47 -0
- package/dist/esm/excel-parser/plugins/xlsx/threaded-comments.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsx/threaded-comments.js +103 -0
- package/dist/esm/excel-parser/plugins/xlsx/value-type-detection.d.ts +44 -0
- package/dist/esm/excel-parser/plugins/xlsx/value-type-detection.d.ts.map +1 -0
- package/dist/esm/excel-parser/plugins/xlsx/value-type-detection.js +399 -0
- package/dist/esm/excel-parser/registry.d.ts +5 -0
- package/dist/esm/excel-parser/registry.d.ts.map +1 -0
- package/dist/esm/excel-parser/registry.js +20 -0
- package/dist/esm/excel-parser/style-registry.d.ts +51 -0
- package/dist/esm/excel-parser/style-registry.d.ts.map +1 -0
- package/dist/esm/excel-parser/style-registry.js +163 -0
- package/dist/esm/excel-parser/theme-default.d.ts +3 -0
- package/dist/esm/excel-parser/theme-default.d.ts.map +1 -0
- package/dist/esm/excel-parser/theme-default.js +19 -0
- package/dist/esm/excel-parser/types.d.ts +365 -0
- package/dist/esm/excel-parser/types.d.ts.map +1 -0
- package/dist/esm/excel-parser/types.js +59 -0
- package/dist/esm/excel-parser/utils.d.ts +6 -0
- package/dist/esm/excel-parser/utils.d.ts.map +1 -0
- package/dist/esm/excel-parser/utils.js +25 -0
- package/dist/esm/excel-parser/workbook.d.ts +51 -0
- package/dist/esm/excel-parser/workbook.d.ts.map +1 -0
- package/dist/esm/excel-parser/workbook.js +192 -0
- package/dist/esm/excel-parser/worker.d.ts +2 -0
- package/dist/esm/excel-parser/worker.d.ts.map +1 -0
- package/dist/esm/excel-parser/worker.js +862 -0
- package/dist/esm/excel-parser/zip-parser-streaming.d.ts +13 -0
- package/dist/esm/excel-parser/zip-parser-streaming.d.ts.map +1 -0
- package/dist/esm/excel-parser/zip-parser-streaming.js +119 -0
- package/dist/esm/excel-parser/zip-parser.d.ts +11 -0
- package/dist/esm/excel-parser/zip-parser.d.ts.map +1 -0
- package/dist/esm/excel-parser/zip-parser.js +43 -0
- package/dist/esm/exporter/invalid-data-validation.d.ts +19 -0
- package/dist/esm/exporter/invalid-data-validation.d.ts.map +1 -0
- package/dist/esm/exporter/invalid-data-validation.js +37 -0
- package/dist/esm/exporter/ods/ods-export.d.ts +26 -0
- package/dist/esm/exporter/ods/ods-export.d.ts.map +1 -0
- package/dist/esm/exporter/ods/ods-export.js +3238 -0
- package/dist/esm/exporter/ods/sparkline-builder.d.ts +33 -0
- package/dist/esm/exporter/ods/sparkline-builder.d.ts.map +1 -0
- package/dist/esm/exporter/ods/sparkline-builder.js +165 -0
- package/dist/esm/exporter/xlsx/chart-builder.d.ts +3 -0
- package/dist/esm/exporter/xlsx/chart-builder.d.ts.map +1 -0
- package/dist/esm/exporter/xlsx/chart-builder.js +1805 -0
- package/dist/esm/exporter/xlsx/chart-templates.d.ts +1781 -0
- package/dist/esm/exporter/xlsx/chart-templates.d.ts.map +1 -0
- package/dist/esm/exporter/xlsx/chart-templates.js +1798 -0
- package/dist/esm/exporter/xlsx/future-functions.d.ts +10 -0
- package/dist/esm/exporter/xlsx/future-functions.d.ts.map +1 -0
- package/dist/esm/exporter/xlsx/future-functions.js +264 -0
- package/dist/esm/exporter/xlsx/pivot-builder.d.ts +58 -0
- package/dist/esm/exporter/xlsx/pivot-builder.d.ts.map +1 -0
- package/dist/esm/exporter/xlsx/pivot-builder.js +230 -0
- package/dist/esm/exporter/xlsx/power-query-builder.d.ts +26 -0
- package/dist/esm/exporter/xlsx/power-query-builder.d.ts.map +1 -0
- package/dist/esm/exporter/xlsx/power-query-builder.js +257 -0
- package/dist/esm/exporter/xlsx/slicer-builder.d.ts +11 -0
- package/dist/esm/exporter/xlsx/slicer-builder.d.ts.map +1 -0
- package/dist/esm/exporter/xlsx/slicer-builder.js +84 -0
- package/dist/esm/exporter/xlsx/sparkline-builder.d.ts +61 -0
- package/dist/esm/exporter/xlsx/sparkline-builder.d.ts.map +1 -0
- package/dist/esm/exporter/xlsx/sparkline-builder.js +437 -0
- package/dist/esm/exporter/xlsx/style-builder.d.ts +93 -0
- package/dist/esm/exporter/xlsx/style-builder.d.ts.map +1 -0
- package/dist/esm/exporter/xlsx/style-builder.js +795 -0
- package/dist/esm/exporter/xlsx/threaded-comments-builder.d.ts +58 -0
- package/dist/esm/exporter/xlsx/threaded-comments-builder.d.ts.map +1 -0
- package/dist/esm/exporter/xlsx/threaded-comments-builder.js +175 -0
- package/dist/esm/exporter/xlsx/xlsx-export.d.ts +121 -0
- package/dist/esm/exporter/xlsx/xlsx-export.d.ts.map +1 -0
- package/dist/esm/exporter/xlsx/xlsx-export.js +4062 -0
- package/dist/esm/helpers/theme-xml-generator.d.ts +8 -0
- package/dist/esm/helpers/theme-xml-generator.d.ts.map +1 -0
- package/dist/esm/helpers/theme-xml-generator.js +33 -0
- package/dist/esm/helpers.d.ts +34 -0
- package/dist/esm/helpers.d.ts.map +1 -0
- package/dist/esm/helpers.js +182 -0
- package/dist/esm/index.d.ts +16 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/indexed-colors.d.ts +2 -0
- package/dist/esm/indexed-colors.d.ts.map +1 -0
- package/dist/esm/indexed-colors.js +75 -0
- package/dist/esm/ods-export.d.ts +24 -0
- package/dist/esm/ods-export.d.ts.map +1 -0
- package/dist/esm/ods-export.js +12 -0
- package/dist/esm/parse.d.ts +24 -0
- package/dist/esm/parse.d.ts.map +1 -0
- package/dist/esm/parse.js +55 -0
- package/dist/esm/power-query.d.ts +41 -0
- package/dist/esm/power-query.d.ts.map +1 -0
- package/dist/esm/power-query.js +19 -0
- package/dist/esm/server.d.ts +9 -0
- package/dist/esm/server.d.ts.map +1 -0
- package/dist/esm/server.js +8 -0
- package/dist/esm/theme1.d.ts +3 -0
- package/dist/esm/theme1.d.ts.map +1 -0
- package/dist/esm/theme1.js +2 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/esm/types.d.ts +14 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +14 -0
- package/dist/esm/vitest.config.d.ts +3 -0
- package/dist/esm/vitest.config.d.ts.map +1 -0
- package/dist/esm/vitest.config.js +16 -0
- package/package.json +62 -0
- package/xlsx.d.ts +52 -0
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import { cellToAddress } from "@rowsncolumns/utils";
|
|
2
|
+
/**
|
|
3
|
+
* Parse a SPARKLINE formula to extract data range and options
|
|
4
|
+
* Formula format: =SPARKLINE(A1:E1,{"charttype","column","color","#FF0000"})
|
|
5
|
+
*/
|
|
6
|
+
export function parseSparklineFormula(formula, sheetName) {
|
|
7
|
+
// Match SPARKLINE formula
|
|
8
|
+
const sparklineMatch = formula.match(/^=SPARKLINE\s*\(\s*([^,)]+)(?:\s*,\s*\{([^}]*)\})?\s*\)$/i);
|
|
9
|
+
if (!sparklineMatch)
|
|
10
|
+
return null;
|
|
11
|
+
let dataRange = sparklineMatch[1].trim();
|
|
12
|
+
const optionsStr = sparklineMatch[2];
|
|
13
|
+
// If the range doesn't have a sheet prefix, add current sheet name
|
|
14
|
+
if (!dataRange.includes("!")) {
|
|
15
|
+
dataRange = `${sheetName}!${dataRange}`;
|
|
16
|
+
}
|
|
17
|
+
// Parse options
|
|
18
|
+
let chartType = "line";
|
|
19
|
+
let color;
|
|
20
|
+
const opts = {};
|
|
21
|
+
const parseBool = (v) => {
|
|
22
|
+
const upper = v.toUpperCase();
|
|
23
|
+
if (upper === "TRUE" || upper === "1")
|
|
24
|
+
return true;
|
|
25
|
+
if (upper === "FALSE" || upper === "0")
|
|
26
|
+
return false;
|
|
27
|
+
return undefined;
|
|
28
|
+
};
|
|
29
|
+
const parseNum = (v) => {
|
|
30
|
+
const n = parseFloat(v);
|
|
31
|
+
return Number.isFinite(n) ? n : undefined;
|
|
32
|
+
};
|
|
33
|
+
if (optionsStr) {
|
|
34
|
+
// Tokenize on commas, strip outer quotes. The grammar is loose —
|
|
35
|
+
// Sheets accepts both `{"key","value", "key2","value2"}` and
|
|
36
|
+
// semicolon-separated pair forms — but our parser side always
|
|
37
|
+
// emits the comma form, so that's what we accept on the way back.
|
|
38
|
+
const tokens = optionsStr
|
|
39
|
+
.split(/[,;]/)
|
|
40
|
+
.map((t) => t.trim().replace(/^"|"$/g, ""));
|
|
41
|
+
for (let i = 0; i < tokens.length - 1; i += 2) {
|
|
42
|
+
const key = tokens[i].toLowerCase();
|
|
43
|
+
const value = tokens[i + 1];
|
|
44
|
+
switch (key) {
|
|
45
|
+
case "charttype":
|
|
46
|
+
if (value === "column")
|
|
47
|
+
chartType = "column";
|
|
48
|
+
else if (value === "winloss")
|
|
49
|
+
chartType = "stacked";
|
|
50
|
+
break;
|
|
51
|
+
case "color":
|
|
52
|
+
color = value;
|
|
53
|
+
break;
|
|
54
|
+
case "emptycells":
|
|
55
|
+
if (value === "gap" || value === "zero" || value === "span") {
|
|
56
|
+
opts.emptyCellsAs = value;
|
|
57
|
+
}
|
|
58
|
+
break;
|
|
59
|
+
case "dateaxis": {
|
|
60
|
+
const b = parseBool(value);
|
|
61
|
+
if (b)
|
|
62
|
+
opts.dateAxis = true;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
case "markers": {
|
|
66
|
+
const b = parseBool(value);
|
|
67
|
+
if (b)
|
|
68
|
+
opts.markers = true;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
// Two key spellings are accepted for the highlight flags:
|
|
72
|
+
// the new `high`/`low`/… names that match
|
|
73
|
+
// `SparkLineResultOptions` and the legacy `highpoint`/
|
|
74
|
+
// `lowpoint`/… names that the parser used to emit. Keep both
|
|
75
|
+
// so user-typed formulas and round-tripped files both work.
|
|
76
|
+
case "high":
|
|
77
|
+
case "highpoint": {
|
|
78
|
+
const b = parseBool(value);
|
|
79
|
+
if (b)
|
|
80
|
+
opts.high = true;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case "low":
|
|
84
|
+
case "lowpoint": {
|
|
85
|
+
const b = parseBool(value);
|
|
86
|
+
if (b)
|
|
87
|
+
opts.low = true;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
case "first":
|
|
91
|
+
case "firstpoint": {
|
|
92
|
+
const b = parseBool(value);
|
|
93
|
+
if (b)
|
|
94
|
+
opts.first = true;
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
case "last":
|
|
98
|
+
case "lastpoint": {
|
|
99
|
+
const b = parseBool(value);
|
|
100
|
+
if (b)
|
|
101
|
+
opts.last = true;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
case "negative":
|
|
105
|
+
case "negativepoints": {
|
|
106
|
+
const b = parseBool(value);
|
|
107
|
+
if (b)
|
|
108
|
+
opts.negative = true;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case "colorhigh":
|
|
112
|
+
opts.colorHigh = value;
|
|
113
|
+
break;
|
|
114
|
+
case "colorlow":
|
|
115
|
+
opts.colorLow = value;
|
|
116
|
+
break;
|
|
117
|
+
case "colorfirst":
|
|
118
|
+
opts.colorFirst = value;
|
|
119
|
+
break;
|
|
120
|
+
case "colorlast":
|
|
121
|
+
opts.colorLast = value;
|
|
122
|
+
break;
|
|
123
|
+
case "colormarkers":
|
|
124
|
+
opts.colorMarkers = value;
|
|
125
|
+
break;
|
|
126
|
+
case "colornegative":
|
|
127
|
+
opts.colorNegative = value;
|
|
128
|
+
break;
|
|
129
|
+
case "axis": {
|
|
130
|
+
const b = parseBool(value);
|
|
131
|
+
if (b)
|
|
132
|
+
opts.displayXAxis = true;
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
case "rtl": {
|
|
136
|
+
// Sheets' SPARKLINE option name for OOXML `rightToLeft`.
|
|
137
|
+
const b = parseBool(value);
|
|
138
|
+
if (b)
|
|
139
|
+
opts.rightToLeft = true;
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
case "displayhidden": {
|
|
143
|
+
const b = parseBool(value);
|
|
144
|
+
if (b)
|
|
145
|
+
opts.displayHidden = true;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
case "lineweight": {
|
|
149
|
+
const n = parseNum(value);
|
|
150
|
+
if (n != null)
|
|
151
|
+
opts.lineWeight = n;
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
case "max": {
|
|
155
|
+
const n = parseNum(value);
|
|
156
|
+
if (n != null)
|
|
157
|
+
opts.manualMax = n;
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
case "min": {
|
|
161
|
+
const n = parseNum(value);
|
|
162
|
+
if (n != null)
|
|
163
|
+
opts.manualMin = n;
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
case "minaxistype":
|
|
167
|
+
if (value === "individual" ||
|
|
168
|
+
value === "group" ||
|
|
169
|
+
value === "custom") {
|
|
170
|
+
opts.minAxisType = value;
|
|
171
|
+
}
|
|
172
|
+
break;
|
|
173
|
+
case "maxaxistype":
|
|
174
|
+
if (value === "individual" ||
|
|
175
|
+
value === "group" ||
|
|
176
|
+
value === "custom") {
|
|
177
|
+
opts.maxAxisType = value;
|
|
178
|
+
}
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return { dataRange, chartType, color, ...opts };
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Detect SPARKLINE formulas in a sheet and extract sparkline info
|
|
187
|
+
*/
|
|
188
|
+
export function detectSparklines(sheet, rowData) {
|
|
189
|
+
const sparklines = [];
|
|
190
|
+
for (const [rowIndexStr, row] of Object.entries(rowData)) {
|
|
191
|
+
const rowIndex = parseInt(rowIndexStr, 10);
|
|
192
|
+
for (const [colIndexStr, cell] of Object.entries(row)) {
|
|
193
|
+
const columnIndex = parseInt(colIndexStr, 10);
|
|
194
|
+
const formula = cell?.ue?.fv || cell?.userEnteredValue?.formulaValue;
|
|
195
|
+
if (formula && formula.toUpperCase().startsWith("=SPARKLINE(")) {
|
|
196
|
+
const parsed = parseSparklineFormula(formula, sheet.title);
|
|
197
|
+
if (parsed) {
|
|
198
|
+
const targetCell = cellToAddress({
|
|
199
|
+
rowIndex,
|
|
200
|
+
columnIndex,
|
|
201
|
+
});
|
|
202
|
+
if (targetCell) {
|
|
203
|
+
const { dataRange, chartType, color, ...axis } = parsed;
|
|
204
|
+
sparklines.push({
|
|
205
|
+
targetCell,
|
|
206
|
+
dataRange,
|
|
207
|
+
type: chartType,
|
|
208
|
+
color,
|
|
209
|
+
rowIndex,
|
|
210
|
+
columnIndex,
|
|
211
|
+
...axis,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return sparklines;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Group sparklines by their full style fingerprint — type + color +
|
|
222
|
+
* every axis option that affects rendering. Two sparklines only share
|
|
223
|
+
* a `<x14:sparklineGroup>` when every attribute matches, otherwise
|
|
224
|
+
* OOXML's "one set of attrs per group" model would silently merge
|
|
225
|
+
* different settings into one.
|
|
226
|
+
*/
|
|
227
|
+
function groupSparklines(sparklines) {
|
|
228
|
+
const groups = new Map();
|
|
229
|
+
const fingerprintAxis = (s) => [
|
|
230
|
+
s.emptyCellsAs ?? "",
|
|
231
|
+
s.dateAxis ? "1" : "",
|
|
232
|
+
s.markers ? "1" : "",
|
|
233
|
+
s.high ? "1" : "",
|
|
234
|
+
s.low ? "1" : "",
|
|
235
|
+
s.first ? "1" : "",
|
|
236
|
+
s.last ? "1" : "",
|
|
237
|
+
s.negative ? "1" : "",
|
|
238
|
+
s.displayXAxis ? "1" : "",
|
|
239
|
+
s.displayHidden ? "1" : "",
|
|
240
|
+
s.rightToLeft ? "1" : "",
|
|
241
|
+
s.lineWeight ?? "",
|
|
242
|
+
s.manualMax ?? "",
|
|
243
|
+
s.manualMin ?? "",
|
|
244
|
+
s.minAxisType ?? "",
|
|
245
|
+
s.maxAxisType ?? "",
|
|
246
|
+
s.colorHigh ?? "",
|
|
247
|
+
s.colorLow ?? "",
|
|
248
|
+
s.colorFirst ?? "",
|
|
249
|
+
s.colorLast ?? "",
|
|
250
|
+
s.colorMarkers ?? "",
|
|
251
|
+
s.colorNegative ?? "",
|
|
252
|
+
].join("|");
|
|
253
|
+
for (const sparkline of sparklines) {
|
|
254
|
+
const key = `${sparkline.type}|${sparkline.color || ""}|${fingerprintAxis(sparkline)}`;
|
|
255
|
+
if (!groups.has(key)) {
|
|
256
|
+
groups.set(key, {
|
|
257
|
+
type: sparkline.type,
|
|
258
|
+
color: sparkline.color,
|
|
259
|
+
sparklines: [],
|
|
260
|
+
emptyCellsAs: sparkline.emptyCellsAs,
|
|
261
|
+
dateAxis: sparkline.dateAxis,
|
|
262
|
+
markers: sparkline.markers,
|
|
263
|
+
high: sparkline.high,
|
|
264
|
+
low: sparkline.low,
|
|
265
|
+
first: sparkline.first,
|
|
266
|
+
last: sparkline.last,
|
|
267
|
+
negative: sparkline.negative,
|
|
268
|
+
displayXAxis: sparkline.displayXAxis,
|
|
269
|
+
displayHidden: sparkline.displayHidden,
|
|
270
|
+
rightToLeft: sparkline.rightToLeft,
|
|
271
|
+
lineWeight: sparkline.lineWeight,
|
|
272
|
+
manualMax: sparkline.manualMax,
|
|
273
|
+
manualMin: sparkline.manualMin,
|
|
274
|
+
minAxisType: sparkline.minAxisType,
|
|
275
|
+
maxAxisType: sparkline.maxAxisType,
|
|
276
|
+
colorHigh: sparkline.colorHigh,
|
|
277
|
+
colorLow: sparkline.colorLow,
|
|
278
|
+
colorFirst: sparkline.colorFirst,
|
|
279
|
+
colorLast: sparkline.colorLast,
|
|
280
|
+
colorMarkers: sparkline.colorMarkers,
|
|
281
|
+
colorNegative: sparkline.colorNegative,
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
groups.get(key).sparklines.push(sparkline);
|
|
285
|
+
}
|
|
286
|
+
return Array.from(groups.values());
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Convert hex color #RRGGBB to Excel's ARGB format FFRRGGBB
|
|
290
|
+
*/
|
|
291
|
+
function toExcelColor(color) {
|
|
292
|
+
// Remove # if present
|
|
293
|
+
const hex = color.replace(/^#/, "");
|
|
294
|
+
// Add alpha channel (FF = fully opaque)
|
|
295
|
+
return `FF${hex.toUpperCase()}`;
|
|
296
|
+
}
|
|
297
|
+
// Default colors for sparklines (Excel theme colors)
|
|
298
|
+
const DEFAULT_SPARKLINE_COLOR = "#4472C4"; // Excel default blue
|
|
299
|
+
const DEFAULT_MARKER_COLOR = "#4472C4"; // Same as line color
|
|
300
|
+
const DEFAULT_HIGH_COLOR = "#56A26B"; // Green for high point
|
|
301
|
+
const DEFAULT_LOW_COLOR = "#C55A5A"; // Red for low point
|
|
302
|
+
const DEFAULT_NEGATIVE_COLOR = "#C55A5A"; // Red for negative values
|
|
303
|
+
/**
|
|
304
|
+
* Build sparkline groups XML for worksheet extLst
|
|
305
|
+
* Returns null if no sparklines detected
|
|
306
|
+
*/
|
|
307
|
+
export function buildSparklineGroupsXml(sheet, rowData) {
|
|
308
|
+
const sparklines = detectSparklines(sheet, rowData);
|
|
309
|
+
if (sparklines.length === 0) {
|
|
310
|
+
return null;
|
|
311
|
+
}
|
|
312
|
+
const groups = groupSparklines(sparklines);
|
|
313
|
+
let groupsXml = "";
|
|
314
|
+
for (const group of groups) {
|
|
315
|
+
// Use specified color or default
|
|
316
|
+
const seriesColor = group.color || DEFAULT_SPARKLINE_COLOR;
|
|
317
|
+
// Build sparkline group attributes. Each axis option round-trips
|
|
318
|
+
// 1:1 with its OOXML attribute name. When a value was explicitly
|
|
319
|
+
// parsed off the formula we emit it verbatim; otherwise we keep
|
|
320
|
+
// the legacy "sensible defaults" path so plain `SPARKLINE(range)`
|
|
321
|
+
// formulas still get readable highlights when exported.
|
|
322
|
+
let groupAttrs = "";
|
|
323
|
+
if (group.type !== "line") {
|
|
324
|
+
groupAttrs += ` type="${group.type}"`;
|
|
325
|
+
}
|
|
326
|
+
if (group.lineWeight != null) {
|
|
327
|
+
groupAttrs += ` lineWeight="${group.lineWeight}"`;
|
|
328
|
+
}
|
|
329
|
+
if (group.dateAxis)
|
|
330
|
+
groupAttrs += ` dateAxis="1"`;
|
|
331
|
+
if (group.emptyCellsAs) {
|
|
332
|
+
groupAttrs += ` displayEmptyCellsAs="${group.emptyCellsAs}"`;
|
|
333
|
+
}
|
|
334
|
+
if (group.markers)
|
|
335
|
+
groupAttrs += ` markers="1"`;
|
|
336
|
+
if (group.high)
|
|
337
|
+
groupAttrs += ` high="1"`;
|
|
338
|
+
if (group.low)
|
|
339
|
+
groupAttrs += ` low="1"`;
|
|
340
|
+
if (group.first)
|
|
341
|
+
groupAttrs += ` first="1"`;
|
|
342
|
+
if (group.last)
|
|
343
|
+
groupAttrs += ` last="1"`;
|
|
344
|
+
if (group.negative)
|
|
345
|
+
groupAttrs += ` negative="1"`;
|
|
346
|
+
if (group.displayXAxis)
|
|
347
|
+
groupAttrs += ` displayXAxis="1"`;
|
|
348
|
+
if (group.displayHidden)
|
|
349
|
+
groupAttrs += ` displayHidden="1"`;
|
|
350
|
+
if (group.rightToLeft)
|
|
351
|
+
groupAttrs += ` rightToLeft="1"`;
|
|
352
|
+
if (group.manualMax != null)
|
|
353
|
+
groupAttrs += ` manualMax="${group.manualMax}"`;
|
|
354
|
+
if (group.manualMin != null)
|
|
355
|
+
groupAttrs += ` manualMin="${group.manualMin}"`;
|
|
356
|
+
if (group.minAxisType)
|
|
357
|
+
groupAttrs += ` minAxisType="${group.minAxisType}"`;
|
|
358
|
+
if (group.maxAxisType)
|
|
359
|
+
groupAttrs += ` maxAxisType="${group.maxAxisType}"`;
|
|
360
|
+
// Legacy "sensible defaults" — only when the formula didn't
|
|
361
|
+
// explicitly set markers / high / low / negative. Preserves the
|
|
362
|
+
// existing behavior for plain `SPARKLINE(range)` formulas that
|
|
363
|
+
// came through without options.
|
|
364
|
+
const hasExplicitHighlights = group.markers ||
|
|
365
|
+
group.high ||
|
|
366
|
+
group.low ||
|
|
367
|
+
group.first ||
|
|
368
|
+
group.last ||
|
|
369
|
+
group.negative;
|
|
370
|
+
if (!hasExplicitHighlights) {
|
|
371
|
+
if (group.type === "line") {
|
|
372
|
+
groupAttrs += ` markers="1" high="1" low="1"`;
|
|
373
|
+
}
|
|
374
|
+
else if (group.type === "column" || group.type === "stacked") {
|
|
375
|
+
groupAttrs += ` high="1" low="1" negative="1"`;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
// Build color elements. Per-point colors come from the original
|
|
379
|
+
// workbook when present (round-trip path); otherwise we fall back
|
|
380
|
+
// to readable defaults so plain `SPARKLINE(range)` formulas still
|
|
381
|
+
// get sensible highlights.
|
|
382
|
+
let colorsXml = "";
|
|
383
|
+
colorsXml += `<x14:colorSeries rgb="${toExcelColor(seriesColor)}"/>`;
|
|
384
|
+
if (group.type === "column" || group.type === "stacked") {
|
|
385
|
+
colorsXml += `<x14:colorNegative rgb="${toExcelColor(group.colorNegative ?? DEFAULT_NEGATIVE_COLOR)}"/>`;
|
|
386
|
+
}
|
|
387
|
+
else if (group.colorNegative) {
|
|
388
|
+
colorsXml += `<x14:colorNegative rgb="${toExcelColor(group.colorNegative)}"/>`;
|
|
389
|
+
}
|
|
390
|
+
if (group.type === "line") {
|
|
391
|
+
colorsXml += `<x14:colorMarkers rgb="${toExcelColor(group.colorMarkers ?? seriesColor)}"/>`;
|
|
392
|
+
}
|
|
393
|
+
else if (group.colorMarkers) {
|
|
394
|
+
colorsXml += `<x14:colorMarkers rgb="${toExcelColor(group.colorMarkers)}"/>`;
|
|
395
|
+
}
|
|
396
|
+
if (group.colorFirst) {
|
|
397
|
+
colorsXml += `<x14:colorFirst rgb="${toExcelColor(group.colorFirst)}"/>`;
|
|
398
|
+
}
|
|
399
|
+
if (group.colorLast) {
|
|
400
|
+
colorsXml += `<x14:colorLast rgb="${toExcelColor(group.colorLast)}"/>`;
|
|
401
|
+
}
|
|
402
|
+
colorsXml += `<x14:colorHigh rgb="${toExcelColor(group.colorHigh ?? DEFAULT_HIGH_COLOR)}"/>`;
|
|
403
|
+
colorsXml += `<x14:colorLow rgb="${toExcelColor(group.colorLow ?? DEFAULT_LOW_COLOR)}"/>`;
|
|
404
|
+
// Build individual sparklines
|
|
405
|
+
let sparklinesXml = "";
|
|
406
|
+
for (const sparkline of group.sparklines) {
|
|
407
|
+
sparklinesXml += `<x14:sparkline><xm:f>${sparkline.dataRange}</xm:f><xm:sqref>${sparkline.targetCell}</xm:sqref></x14:sparkline>`;
|
|
408
|
+
}
|
|
409
|
+
groupsXml += `<x14:sparklineGroup${groupAttrs}>${colorsXml}<x14:sparklines>${sparklinesXml}</x14:sparklines></x14:sparklineGroup>`;
|
|
410
|
+
}
|
|
411
|
+
return `<ext uri="{05C60535-1F16-4fd2-B633-F4F36F0B64E0}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main"><x14:sparklineGroups xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">${groupsXml}</x14:sparklineGroups></ext>`;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Build combined extLst for worksheet (sparklines + slicers)
|
|
415
|
+
*/
|
|
416
|
+
export function buildWorksheetExtLst(sparklineExtXml, slicerExtXml) {
|
|
417
|
+
const parts = [];
|
|
418
|
+
if (sparklineExtXml) {
|
|
419
|
+
parts.push(sparklineExtXml);
|
|
420
|
+
}
|
|
421
|
+
if (slicerExtXml) {
|
|
422
|
+
parts.push(slicerExtXml);
|
|
423
|
+
}
|
|
424
|
+
if (parts.length === 0) {
|
|
425
|
+
return "";
|
|
426
|
+
}
|
|
427
|
+
return `<extLst>${parts.join("")}</extLst>`;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Check if a cell has a SPARKLINE formula and should NOT be exported as a formula
|
|
431
|
+
* (the formula will be converted to native Excel sparkline instead)
|
|
432
|
+
*/
|
|
433
|
+
export function isSparklineCell(cell) {
|
|
434
|
+
const formula = cell?.ue?.fv || cell?.userEnteredValue?.formulaValue;
|
|
435
|
+
return (typeof formula === "string" &&
|
|
436
|
+
formula.toUpperCase().startsWith("=SPARKLINE("));
|
|
437
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { CellData, CellFormat, Color, TextFormat } from "@rowsncolumns/spreadsheet";
|
|
2
|
+
import { type CellXfs } from "@rowsncolumns/spreadsheet-state";
|
|
3
|
+
type NamedCellStyleRecord = {
|
|
4
|
+
name: string;
|
|
5
|
+
xfId: number;
|
|
6
|
+
builtinId?: number;
|
|
7
|
+
iLevel?: number;
|
|
8
|
+
hidden?: boolean;
|
|
9
|
+
customBuiltin?: boolean;
|
|
10
|
+
};
|
|
11
|
+
type CustomTableStyleRecord = {
|
|
12
|
+
name: string;
|
|
13
|
+
pivot?: boolean;
|
|
14
|
+
elements: Array<{
|
|
15
|
+
type: string;
|
|
16
|
+
size?: number;
|
|
17
|
+
backgroundColor?: Color;
|
|
18
|
+
textColor?: Color;
|
|
19
|
+
bold?: boolean;
|
|
20
|
+
italic?: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
23
|
+
export declare class StyleBuilder {
|
|
24
|
+
private numberFormats;
|
|
25
|
+
private fonts;
|
|
26
|
+
private fills;
|
|
27
|
+
private borders;
|
|
28
|
+
private namedCellStyles;
|
|
29
|
+
private customTableStyles;
|
|
30
|
+
/**
|
|
31
|
+
* Replace the named-cell-styles list emitted in `<cellStyles>`.
|
|
32
|
+
* Used for round-tripping the OOXML Heading 1 / Accent / Total /
|
|
33
|
+
* Good-Bad-Neutral gallery — the importer parses these from
|
|
34
|
+
* `xl/styles.xml` and exposes them on `workbook.workbookStyles.
|
|
35
|
+
* namedCellStyles`; hosts can forward that list back here.
|
|
36
|
+
*
|
|
37
|
+
* Excel requires at least a "Normal" entry pointing at xfId=0,
|
|
38
|
+
* builtinId=0 — when the supplied list doesn't contain one, we
|
|
39
|
+
* keep the default at the head of the list rather than risk
|
|
40
|
+
* emitting a file Excel rejects.
|
|
41
|
+
*/
|
|
42
|
+
setNamedCellStyles(entries: NamedCellStyleRecord[]): void;
|
|
43
|
+
/**
|
|
44
|
+
* Replace the user-authored table-style list emitted in the
|
|
45
|
+
* `<tableStyles>` block. The exporter registers each element's
|
|
46
|
+
* format as a dxf at `toXml()` time, so callers pass self-contained
|
|
47
|
+
* records (no dxfIds to manage). Used for round-tripping the
|
|
48
|
+
* OOXML custom-table-style list from
|
|
49
|
+
* `workbook.workbookStyles.getCustomTableStyleExports()`.
|
|
50
|
+
*/
|
|
51
|
+
setCustomTableStyles(entries: CustomTableStyleRecord[]): void;
|
|
52
|
+
private cellXfs;
|
|
53
|
+
private fontMap;
|
|
54
|
+
private fillMap;
|
|
55
|
+
private borderMap;
|
|
56
|
+
private formatMap;
|
|
57
|
+
private xfMap;
|
|
58
|
+
private dxfs;
|
|
59
|
+
private dxfMap;
|
|
60
|
+
constructor();
|
|
61
|
+
/**
|
|
62
|
+
* Replace the workbook default font (font id 0 — what every cell without
|
|
63
|
+
* an explicit font inherits). Callers pass the source workbook's parsed
|
|
64
|
+
* default (`WorkBook.getDefaultFont()`) so an imported workbook keeps its
|
|
65
|
+
* default typeface/size instead of the hardcoded Calibri 11. Must be
|
|
66
|
+
* called before any cell registration: cells explicitly styled with the
|
|
67
|
+
* old default must not collapse into font id 0.
|
|
68
|
+
*/
|
|
69
|
+
setDefaultFont(format?: TextFormat | null): void;
|
|
70
|
+
registerCell<T extends CellData>(cell: T | null | undefined, cellXfs: CellXfs | null | undefined,
|
|
71
|
+
/**
|
|
72
|
+
* Number format to use when the cell itself has none. Used by the
|
|
73
|
+
* exporter to layer in the precedent-derived number format on formula
|
|
74
|
+
* cells so Excel displays them correctly without requiring a recalc.
|
|
75
|
+
*/
|
|
76
|
+
derivedNumberFormat?: CellFormat["numberFormat"]): number;
|
|
77
|
+
registerDifferentialFormat(format?: CellFormat | null): number | undefined;
|
|
78
|
+
private getNumberFormatId;
|
|
79
|
+
private getFontId;
|
|
80
|
+
private getFillId;
|
|
81
|
+
private getBorderId;
|
|
82
|
+
private serializeFont;
|
|
83
|
+
private buildFontRecord;
|
|
84
|
+
private buildFontXml;
|
|
85
|
+
private buildFillXml;
|
|
86
|
+
private buildGradientFillXml;
|
|
87
|
+
private serializeFill;
|
|
88
|
+
private serializeBorder;
|
|
89
|
+
private serializeDxf;
|
|
90
|
+
toXml(): string;
|
|
91
|
+
}
|
|
92
|
+
export {};
|
|
93
|
+
//# sourceMappingURL=style-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-builder.d.ts","sourceRoot":"","sources":["../../../../exporter/xlsx/style-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,QAAQ,EACR,UAAU,EACV,KAAK,EAEL,UAAU,EACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAwF/D,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAKF,KAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,eAAe,CAAC,EAAE,KAAK,CAAC;QACxB,SAAS,CAAC,EAAE,KAAK,CAAC;QAClB,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC,CAAC;CACJ,CAAC;AAEF,qBAAa,YAAY;IACvB,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,KAAK,CAKX;IACF,OAAO,CAAC,KAAK,CAA+D;IAC5E,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,eAAe,CAErB;IACF,OAAO,CAAC,iBAAiB,CAAgC;IAEzD;;;;;;;;;;;OAWG;IACH,kBAAkB,CAAC,OAAO,EAAE,oBAAoB,EAAE;IAUlD;;;;;;;OAOG;IACH,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,EAAE;IAOtD,OAAO,CAAC,OAAO,CAOb;IAEF,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,SAAS,CAA6B;IAC9C,OAAO,CAAC,SAAS,CAA6B;IAC9C,OAAO,CAAC,KAAK,CAA6B;IAC1C,OAAO,CAAC,IAAI,CAAmB;IAC/B,OAAO,CAAC,MAAM,CAA6B;;IAU3C;;;;;;;OAOG;IACH,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI;IASzC,YAAY,CAAC,CAAC,SAAS,QAAQ,EAC7B,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAC1B,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS;IACnC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,GAC/C,MAAM;IAsET,0BAA0B,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI;IA0BrD,OAAO,CAAC,iBAAiB;IAoCzB,OAAO,CAAC,SAAS;IAcjB,OAAO,CAAC,SAAS;IA2DjB,OAAO,CAAC,WAAW;IA2BnB,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,eAAe;IA8BvB,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,YAAY;IAqCpB,OAAO,CAAC,oBAAoB;IAyB5B,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,YAAY;IAMpB,KAAK;CAuJN"}
|