@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 @@
|
|
|
1
|
+
{"version":3,"file":"numfmt.d.ts","sourceRoot":"","sources":["../../../../../excel-parser/plugins/xlsx/numfmt.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,IAAI,2BAA2B,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* XLSX pivot table parser — Phase D1.
|
|
3
|
+
*
|
|
4
|
+
* Parses two XML families:
|
|
5
|
+
* 1. xl/pivotTables/pivotTable<N>.xml (layout: rows/cols/values)
|
|
6
|
+
* 2. xl/pivotCache/pivotCacheDefinition<N>.xml (field names + source range)
|
|
7
|
+
*
|
|
8
|
+
* `xl/pivotCache/pivotCacheRecords<N>.xml` (the cached source data)
|
|
9
|
+
* is intentionally skipped — pivots in the host calculator pull
|
|
10
|
+
* live data from the sheet via the source range, so the cache
|
|
11
|
+
* records are redundant. Excel itself ignores stale caches when
|
|
12
|
+
* `refreshOnLoad="1"` is set.
|
|
13
|
+
*
|
|
14
|
+
* Output shape matches @rowsncolumns/spreadsheet `PivotTable` so
|
|
15
|
+
* imported pivots drop straight into `onChangePivotTables`.
|
|
16
|
+
*/
|
|
17
|
+
import type { PivotTable } from "@rowsncolumns/spreadsheet";
|
|
18
|
+
import type { XMLParser } from "fast-xml-parser";
|
|
19
|
+
import type { StreamingZipParser } from "../../zip-parser-streaming";
|
|
20
|
+
type SheetPivotRel = {
|
|
21
|
+
/** Relationship target → xl/pivotTables/pivotTable<N>.xml */
|
|
22
|
+
target: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Top-level: parse every pivotTable referenced by a worksheet's
|
|
26
|
+
* relationships. Returns a flat PivotTable[] (host attaches them
|
|
27
|
+
* to the host's `pivotTables` state).
|
|
28
|
+
*/
|
|
29
|
+
export declare const parsePivotTablesForSheet: (options: {
|
|
30
|
+
zipParser: StreamingZipParser;
|
|
31
|
+
xmlParser: XMLParser;
|
|
32
|
+
sheetRels: SheetPivotRel[];
|
|
33
|
+
/** ID we'll stamp on imported pivots. Host can normalize later. */
|
|
34
|
+
nextPivotId: () => string;
|
|
35
|
+
/** Map XLSX sheet name → host numeric sheetId. */
|
|
36
|
+
getSheetId: (sheetName: string) => number | undefined;
|
|
37
|
+
defaultSheetId: number;
|
|
38
|
+
}) => Promise<PivotTable[]>;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=pivots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pivots.d.ts","sourceRoot":"","sources":["../../../../../excel-parser/plugins/xlsx/pivots.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AASrE,KAAK,aAAa,GAAG;IACnB,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA6OF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GACnC,SAAS;IACP,SAAS,EAAE,kBAAkB,CAAC;IAC9B,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,mEAAmE;IACnE,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,kDAAkD;IAClD,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACtD,cAAc,EAAE,MAAM,CAAC;CACxB,KACA,OAAO,CAAC,UAAU,EAAE,CAoEtB,CAAC"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
const asArray = (value) => {
|
|
2
|
+
if (value === undefined || value === null)
|
|
3
|
+
return [];
|
|
4
|
+
return Array.isArray(value) ? value : [value];
|
|
5
|
+
};
|
|
6
|
+
const stripSheetPrefix = (ref) => {
|
|
7
|
+
// Source refs in XLSX include the sheet, e.g. "Sheet1!$A$1:$D$100".
|
|
8
|
+
// Quoted sheets: "'Sheet 1'!$A$1:$D$100".
|
|
9
|
+
const m = ref.match(/^(?:'([^']+)'|([^!]+))!(.+)$/);
|
|
10
|
+
if (!m)
|
|
11
|
+
return { a1: ref };
|
|
12
|
+
return { sheet: m[1] ?? m[2], a1: m[3] };
|
|
13
|
+
};
|
|
14
|
+
const parseA1Range = (a1) => {
|
|
15
|
+
// Accept "$A$1:$D$100", "A1:D100", "A1" (single cell), etc.
|
|
16
|
+
const range = a1.replace(/\$/g, "");
|
|
17
|
+
const [s, e] = range.split(":");
|
|
18
|
+
const startCell = parseA1Cell(s);
|
|
19
|
+
const endCell = e ? parseA1Cell(e) : startCell;
|
|
20
|
+
if (!startCell || !endCell)
|
|
21
|
+
return null;
|
|
22
|
+
return {
|
|
23
|
+
startCol: startCell.col,
|
|
24
|
+
endCol: endCell.col,
|
|
25
|
+
startRow: startCell.row,
|
|
26
|
+
endRow: endCell.row,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
const parseA1Cell = (cell) => {
|
|
30
|
+
const m = cell.match(/^([A-Za-z]+)(\d+)$/);
|
|
31
|
+
if (!m)
|
|
32
|
+
return null;
|
|
33
|
+
let col = 0;
|
|
34
|
+
for (const ch of m[1].toUpperCase()) {
|
|
35
|
+
col = col * 26 + (ch.charCodeAt(0) - 64);
|
|
36
|
+
}
|
|
37
|
+
return { col, row: Number(m[2]) };
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Map XLSX subtotal/aggregator name to our PivotValueSummarizeFunction.
|
|
41
|
+
* XLSX uses `subtotal="sum"|"average"|...`; we map "average" → "avg".
|
|
42
|
+
*/
|
|
43
|
+
const normalizeAggFunc = (raw) => {
|
|
44
|
+
const map = {
|
|
45
|
+
sum: "sum",
|
|
46
|
+
count: "counta",
|
|
47
|
+
countNums: "count",
|
|
48
|
+
average: "avg",
|
|
49
|
+
min: "min",
|
|
50
|
+
max: "max",
|
|
51
|
+
product: "product",
|
|
52
|
+
stdDev: "stddev",
|
|
53
|
+
stdDevp: "stddevp",
|
|
54
|
+
var: "var",
|
|
55
|
+
varp: "varp",
|
|
56
|
+
};
|
|
57
|
+
return map[raw ?? "sum"] ?? "sum";
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Parse one pivotCacheDefinition XML into a (sourceRange, fields) pair.
|
|
61
|
+
* Source range is resolved sheet-relative; the caller maps the sheet
|
|
62
|
+
* name to its numeric sheetId.
|
|
63
|
+
*/
|
|
64
|
+
const parsePivotCacheDefinition = (cacheXml) => {
|
|
65
|
+
const cacheDef = cacheXml?.pivotCacheDefinition ?? cacheXml?.["x:pivotCacheDefinition"];
|
|
66
|
+
if (!cacheDef)
|
|
67
|
+
return { fields: [] };
|
|
68
|
+
// cacheSource → worksheetSource@ref
|
|
69
|
+
const cacheSource = cacheDef.cacheSource ?? cacheDef["x:cacheSource"];
|
|
70
|
+
const wsSource = cacheSource?.worksheetSource ?? cacheSource?.["x:worksheetSource"];
|
|
71
|
+
const sourceRef = wsSource?.a$?.ref || wsSource?.["@_ref"];
|
|
72
|
+
const cacheFields = cacheDef.cacheFields ?? cacheDef["x:cacheFields"];
|
|
73
|
+
const rawFieldList = asArray(cacheFields?.cacheField ?? cacheFields?.["x:cacheField"]);
|
|
74
|
+
const fields = rawFieldList.map((cf) => {
|
|
75
|
+
const name = cf.a$?.name || cf["@_name"] || "";
|
|
76
|
+
const sharedItemsNode = cf.sharedItems ?? cf["x:sharedItems"];
|
|
77
|
+
const items = [];
|
|
78
|
+
if (sharedItemsNode) {
|
|
79
|
+
for (const s of asArray(sharedItemsNode.s ?? sharedItemsNode["x:s"])) {
|
|
80
|
+
items.push(String(s.a$?.v ?? s["@_v"] ?? ""));
|
|
81
|
+
}
|
|
82
|
+
for (const n of asArray(sharedItemsNode.n ?? sharedItemsNode["x:n"])) {
|
|
83
|
+
items.push(Number(n.a$?.v ?? n["@_v"] ?? 0));
|
|
84
|
+
}
|
|
85
|
+
for (const _ of asArray(sharedItemsNode.m ?? sharedItemsNode["x:m"])) {
|
|
86
|
+
items.push(null);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return { name, sharedItems: items.length > 0 ? items : undefined };
|
|
90
|
+
});
|
|
91
|
+
return { sourceRef, fields };
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Parse a single pivotTable.xml into a PivotTable record. Needs the
|
|
95
|
+
* cacheDefinition pre-parsed so we can resolve field-name indices.
|
|
96
|
+
*/
|
|
97
|
+
const parsePivotTableXml = (pivotXml, cacheDef, getSheetId, defaultSheetId, pivotId) => {
|
|
98
|
+
const pt = pivotXml?.pivotTableDefinition ?? pivotXml?.["x:pivotTableDefinition"];
|
|
99
|
+
if (!pt)
|
|
100
|
+
return null;
|
|
101
|
+
const name = pt.a$?.name || pt["@_name"];
|
|
102
|
+
// location@ref → rendered range on the worksheet
|
|
103
|
+
const location = pt.location ?? pt["x:location"];
|
|
104
|
+
const locRef = location?.a$?.ref || location?.["@_ref"];
|
|
105
|
+
const locRange = locRef ? parseA1Range(locRef) : null;
|
|
106
|
+
if (!locRange)
|
|
107
|
+
return null;
|
|
108
|
+
// Number of header rows / row-label columns gives us the data
|
|
109
|
+
// origin within the rendered range — but PivotTable only stores
|
|
110
|
+
// the target (top-left) and the full pivotRange.
|
|
111
|
+
const targetSheetId = defaultSheetId;
|
|
112
|
+
const targetPosition = {
|
|
113
|
+
sheetId: targetSheetId,
|
|
114
|
+
rowIndex: locRange.startRow,
|
|
115
|
+
columnIndex: locRange.startCol,
|
|
116
|
+
};
|
|
117
|
+
const pivotRange = {
|
|
118
|
+
sheetId: targetSheetId,
|
|
119
|
+
startRowIndex: locRange.startRow,
|
|
120
|
+
endRowIndex: locRange.endRow,
|
|
121
|
+
startColumnIndex: locRange.startCol,
|
|
122
|
+
endColumnIndex: locRange.endCol,
|
|
123
|
+
};
|
|
124
|
+
// Source range from cacheDef
|
|
125
|
+
let source;
|
|
126
|
+
if (cacheDef.sourceRef) {
|
|
127
|
+
const { sheet, a1 } = stripSheetPrefix(cacheDef.sourceRef);
|
|
128
|
+
const sourceRange = parseA1Range(a1);
|
|
129
|
+
if (sourceRange) {
|
|
130
|
+
const resolved = sheet ? getSheetId(sheet) : undefined;
|
|
131
|
+
const sId = typeof resolved === "number" ? resolved : targetSheetId;
|
|
132
|
+
source = {
|
|
133
|
+
sheetId: sId,
|
|
134
|
+
startRowIndex: sourceRange.startRow,
|
|
135
|
+
endRowIndex: sourceRange.endRow,
|
|
136
|
+
startColumnIndex: sourceRange.startCol,
|
|
137
|
+
endColumnIndex: sourceRange.endCol,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// Row + Column field axes — arrays of field indices into cacheFields.
|
|
142
|
+
const readAxis = (key) => {
|
|
143
|
+
const node = pt[key] ?? pt[`x:${key}`];
|
|
144
|
+
if (!node)
|
|
145
|
+
return [];
|
|
146
|
+
const fields = asArray(node.field ?? node["x:field"]);
|
|
147
|
+
return fields
|
|
148
|
+
.map((f) => Number(f.a$?.x ?? f["@_x"]))
|
|
149
|
+
.filter((n) => Number.isFinite(n));
|
|
150
|
+
};
|
|
151
|
+
const rowIndices = readAxis("rowFields");
|
|
152
|
+
const colIndices = readAxis("colFields");
|
|
153
|
+
// dataFields → value fields. Each has fld (cache-field index)
|
|
154
|
+
// and an optional subtotal aggregator.
|
|
155
|
+
const dataFieldsNode = pt.dataFields ?? pt["x:dataFields"];
|
|
156
|
+
const dataFieldList = asArray(dataFieldsNode?.dataField ?? dataFieldsNode?.["x:dataField"]);
|
|
157
|
+
const fieldNameAt = (idx) => cacheDef.fields[idx]?.name;
|
|
158
|
+
const rows = rowIndices
|
|
159
|
+
.map((idx) => fieldNameAt(idx))
|
|
160
|
+
.filter((n) => !!n && n !== "Values" && n !== "")
|
|
161
|
+
.map((field) => ({ field, displayName: field }));
|
|
162
|
+
const columns = colIndices
|
|
163
|
+
.map((idx) => fieldNameAt(idx))
|
|
164
|
+
.filter((n) => !!n && n !== "Values" && n !== "")
|
|
165
|
+
.map((field) => ({ field, displayName: field }));
|
|
166
|
+
const values = dataFieldList
|
|
167
|
+
.map((d) => {
|
|
168
|
+
const idx = Number(d.a$?.fld ?? d["@_fld"]);
|
|
169
|
+
const field = fieldNameAt(idx);
|
|
170
|
+
if (!field)
|
|
171
|
+
return null;
|
|
172
|
+
const aggFunc = normalizeAggFunc(d.a$?.subtotal || d["@_subtotal"]);
|
|
173
|
+
const displayName = d.a$?.name || d["@_name"] || `${aggFunc} of ${field}`;
|
|
174
|
+
return { field, displayName, aggFunc };
|
|
175
|
+
})
|
|
176
|
+
.filter((v) => v !== null);
|
|
177
|
+
// Display toggles (Phase A1 — round-trip these so the editor
|
|
178
|
+
// checkboxes pick up the imported values).
|
|
179
|
+
// XLSX: rowGrandTotals / colGrandTotals default to "1" (true).
|
|
180
|
+
const showRowGT = (pt.a$?.rowGrandTotals ?? pt["@_rowGrandTotals"]) !== "0";
|
|
181
|
+
const showColGT = (pt.a$?.colGrandTotals ?? pt["@_colGrandTotals"]) !== "0";
|
|
182
|
+
return {
|
|
183
|
+
pivotId,
|
|
184
|
+
name,
|
|
185
|
+
source,
|
|
186
|
+
targetPosition,
|
|
187
|
+
pivotRange,
|
|
188
|
+
rows,
|
|
189
|
+
columns,
|
|
190
|
+
values,
|
|
191
|
+
showRowGrandTotals: showRowGT,
|
|
192
|
+
showColumnGrandTotals: showColGT,
|
|
193
|
+
// Subtotal default on individual fields → leave true.
|
|
194
|
+
showSubtotals: true,
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Top-level: parse every pivotTable referenced by a worksheet's
|
|
199
|
+
* relationships. Returns a flat PivotTable[] (host attaches them
|
|
200
|
+
* to the host's `pivotTables` state).
|
|
201
|
+
*/
|
|
202
|
+
export const parsePivotTablesForSheet = async (options) => {
|
|
203
|
+
const { zipParser, xmlParser, sheetRels, nextPivotId, getSheetId, defaultSheetId, } = options;
|
|
204
|
+
const out = [];
|
|
205
|
+
for (const rel of sheetRels) {
|
|
206
|
+
// Normalize the path — pivot rels in worksheets typically look
|
|
207
|
+
// like "../pivotTables/pivotTable1.xml".
|
|
208
|
+
const pivotTablePath = rel.target.startsWith("/")
|
|
209
|
+
? rel.target.slice(1)
|
|
210
|
+
: rel.target.startsWith("../")
|
|
211
|
+
? `xl/${rel.target.slice(3)}`
|
|
212
|
+
: `xl/worksheets/${rel.target}`;
|
|
213
|
+
const pivotTableXmlText = await zipParser.getText(pivotTablePath);
|
|
214
|
+
if (!pivotTableXmlText)
|
|
215
|
+
continue;
|
|
216
|
+
const pivotXml = xmlParser.parse(pivotTableXmlText);
|
|
217
|
+
// Resolve the cacheDefinition path via the pivotTable's rels.
|
|
218
|
+
const pivotDir = pivotTablePath.substring(0, pivotTablePath.lastIndexOf("/"));
|
|
219
|
+
const fileName = pivotTablePath.split("/").pop();
|
|
220
|
+
const pivotRelsPath = `${pivotDir}/_rels/${fileName}.rels`;
|
|
221
|
+
const pivotRelsText = await zipParser.getText(pivotRelsPath);
|
|
222
|
+
let cacheDef = { fields: [] };
|
|
223
|
+
if (pivotRelsText) {
|
|
224
|
+
const pivotRels = xmlParser.parse(pivotRelsText);
|
|
225
|
+
const relList = asArray(pivotRels?.Relationships?.Relationship);
|
|
226
|
+
const cacheRel = relList.find((r) => {
|
|
227
|
+
const type = r.a$?.Type || r["@_Type"] || "";
|
|
228
|
+
return type.endsWith("pivotCacheDefinition");
|
|
229
|
+
});
|
|
230
|
+
if (cacheRel) {
|
|
231
|
+
let cachePath = cacheRel.a$?.Target || cacheRel["@_Target"];
|
|
232
|
+
if (cachePath?.startsWith("../")) {
|
|
233
|
+
cachePath = `xl/${cachePath.slice(3)}`;
|
|
234
|
+
}
|
|
235
|
+
else if (cachePath?.startsWith("/")) {
|
|
236
|
+
cachePath = cachePath.slice(1);
|
|
237
|
+
}
|
|
238
|
+
else if (cachePath && !cachePath.startsWith("xl/")) {
|
|
239
|
+
cachePath = `${pivotDir}/${cachePath}`;
|
|
240
|
+
}
|
|
241
|
+
const cacheText = cachePath
|
|
242
|
+
? await zipParser.getText(cachePath)
|
|
243
|
+
: undefined;
|
|
244
|
+
if (cacheText) {
|
|
245
|
+
cacheDef = parsePivotCacheDefinition(xmlParser.parse(cacheText));
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
const pivot = parsePivotTableXml(pivotXml, cacheDef, getSheetId, defaultSheetId, nextPivotId());
|
|
250
|
+
if (pivot)
|
|
251
|
+
out.push(pivot);
|
|
252
|
+
}
|
|
253
|
+
return out;
|
|
254
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../../../../excel-parser/plugins/xlsx/relationships.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,gBAAgB,GAAI,KAAK,GAAG,iCAaxC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const getRelationsById = (xml) => {
|
|
2
|
+
const rels = {};
|
|
3
|
+
for (const relationship of xml.Relationships?.Relationship || []) {
|
|
4
|
+
const id = relationship.a$.Id;
|
|
5
|
+
rels[id] = {
|
|
6
|
+
id,
|
|
7
|
+
type: relationship.a$.Type,
|
|
8
|
+
target: relationship.a$.Target,
|
|
9
|
+
mode: relationship.a$.TargetMode,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
return rels;
|
|
13
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts view properties from Excel sheet view data:
|
|
3
|
+
* - frozen rows / columns count
|
|
4
|
+
* - showGridLines (gridline visibility)
|
|
5
|
+
* - showRowColHeaders (row/column header visibility)
|
|
6
|
+
* - showZeros (whether zero values render in cells)
|
|
7
|
+
* - zoomScale (integer percent, 10-400; undefined = use Excel default 100)
|
|
8
|
+
*
|
|
9
|
+
* Works with both single sheet view and multiple sheet views.
|
|
10
|
+
*
|
|
11
|
+
* Defaults match Excel's defaults when the attribute is absent:
|
|
12
|
+
* showGridLines = true, showRowColHeaders = true, showZeros = true,
|
|
13
|
+
* zoomScale = undefined (consumers should treat as 100).
|
|
14
|
+
*/
|
|
15
|
+
export type SheetViewProperties = {
|
|
16
|
+
frozenRowCount: number;
|
|
17
|
+
frozenColumnCount: number;
|
|
18
|
+
/** Saved scroll position of the unfrozen pane (`<pane topLeftCell>`). */
|
|
19
|
+
paneTopLeftCell?: string;
|
|
20
|
+
showGridLines: boolean;
|
|
21
|
+
showRowColHeaders: boolean;
|
|
22
|
+
showZeros: boolean;
|
|
23
|
+
zoomScale?: number;
|
|
24
|
+
};
|
|
25
|
+
export declare function extractSheetViewProperties(sheetViewData: any): SheetViewProperties;
|
|
26
|
+
//# sourceMappingURL=sheet-views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-views.d.ts","sourceRoot":"","sources":["../../../../../excel-parser/plugins/xlsx/sheet-views.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAKF,wBAAgB,0BAA0B,CACxC,aAAa,EAAE,GAAG,GACjB,mBAAmB,CAqErB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const isFalseAttr = (val) => val === "0" || val === "false" || val === false;
|
|
2
|
+
export function extractSheetViewProperties(sheetViewData) {
|
|
3
|
+
const defaults = {
|
|
4
|
+
frozenRowCount: 0,
|
|
5
|
+
frozenColumnCount: 0,
|
|
6
|
+
showGridLines: true,
|
|
7
|
+
showRowColHeaders: true,
|
|
8
|
+
showZeros: true,
|
|
9
|
+
};
|
|
10
|
+
if (!sheetViewData)
|
|
11
|
+
return defaults;
|
|
12
|
+
// Handle multiple sheet views (array of sheet views)
|
|
13
|
+
const sheetViews = Array.isArray(sheetViewData)
|
|
14
|
+
? sheetViewData
|
|
15
|
+
: "sheetViews" in sheetViewData
|
|
16
|
+
? Array.isArray(sheetViewData.sheetViews)
|
|
17
|
+
? sheetViewData.sheetViews
|
|
18
|
+
: [sheetViewData.sheetViews]
|
|
19
|
+
: [sheetViewData];
|
|
20
|
+
const firstView = sheetViews[0];
|
|
21
|
+
const sheetView = "sheetView" in firstView ? firstView.sheetView : firstView;
|
|
22
|
+
let frozenRowCount = 0;
|
|
23
|
+
let frozenColumnCount = 0;
|
|
24
|
+
let paneTopLeftCell;
|
|
25
|
+
// Process pane information if available
|
|
26
|
+
if (sheetView.pane) {
|
|
27
|
+
const pane = sheetView.pane.a$ || sheetView.pane;
|
|
28
|
+
if (pane.ySplit) {
|
|
29
|
+
frozenRowCount = parseInt(pane.ySplit, 10);
|
|
30
|
+
}
|
|
31
|
+
if (pane.xSplit) {
|
|
32
|
+
frozenColumnCount = parseInt(pane.xSplit, 10);
|
|
33
|
+
}
|
|
34
|
+
if (pane.state !== "frozen" && pane.state !== "frozenSplit") {
|
|
35
|
+
frozenRowCount = 0;
|
|
36
|
+
frozenColumnCount = 0;
|
|
37
|
+
}
|
|
38
|
+
else if (typeof pane.topLeftCell === "string" && pane.topLeftCell) {
|
|
39
|
+
// The saved scroll position of the unfrozen quadrant. Preserved so an
|
|
40
|
+
// untouched import/export doesn't snap the view back to the freeze
|
|
41
|
+
// anchor.
|
|
42
|
+
paneTopLeftCell = pane.topLeftCell;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const viewAttrs = sheetView.a$ || {};
|
|
46
|
+
// zoomScale: Excel clamps to 10-400. Omit (= use default) when absent
|
|
47
|
+
// or out of range, so we don't lie about what the file contained.
|
|
48
|
+
let zoomScale;
|
|
49
|
+
if (viewAttrs.zoomScale != null && viewAttrs.zoomScale !== "") {
|
|
50
|
+
const parsed = parseInt(String(viewAttrs.zoomScale), 10);
|
|
51
|
+
if (Number.isFinite(parsed) && parsed >= 10 && parsed <= 400) {
|
|
52
|
+
zoomScale = parsed;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
frozenRowCount,
|
|
57
|
+
frozenColumnCount,
|
|
58
|
+
...(paneTopLeftCell ? { paneTopLeftCell } : {}),
|
|
59
|
+
showGridLines: !isFalseAttr(viewAttrs.showGridLines),
|
|
60
|
+
showRowColHeaders: !isFalseAttr(viewAttrs.showRowColHeaders),
|
|
61
|
+
showZeros: !isFalseAttr(viewAttrs.showZeros),
|
|
62
|
+
...(zoomScale !== undefined ? { zoomScale } : {}),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { GridRange } from "@rowsncolumns/common-types";
|
|
2
|
+
import type { CellData, Color, ExtendedValue, TextFormat } from "@rowsncolumns/spreadsheet";
|
|
3
|
+
import type { WorkBook } from "../../workbook";
|
|
4
|
+
import type { WorkbookStyles } from "./index";
|
|
5
|
+
type MergeCellContext = {
|
|
6
|
+
range: GridRange;
|
|
7
|
+
rowCellsByColumnIndex: Map<number, any>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Extract cell value and format information from Excel cell data
|
|
11
|
+
* @param {Object} cell - The cell object from the sheet data
|
|
12
|
+
* @param {WorkBook} workbook - The workbook object containing shared strings
|
|
13
|
+
* @returns {Object} Object containing value and cellFormat properties
|
|
14
|
+
*/
|
|
15
|
+
export declare function getCellValueAndFormat(cell: any, workbook: WorkBook, enableCellXfsRegistry?: boolean, enableSharedStrings?: boolean, activeSheetName?: string, mergeContext?: MergeCellContext): CellData | null;
|
|
16
|
+
/**
|
|
17
|
+
* Build a format-only CellData for a style index that a cell inherits from
|
|
18
|
+
* its row (`<row customFormat="1" s="N">`) or column (`<col style="N">`)
|
|
19
|
+
* rather than carrying itself. Excel paints such styles across every cell
|
|
20
|
+
* of the row/column even where no `<c>` element exists, so the importer
|
|
21
|
+
* materializes them as phantom cells. Returns null when the style resolves
|
|
22
|
+
* to an empty format (nothing to paint or inherit).
|
|
23
|
+
*/
|
|
24
|
+
export declare function getCellDataForStyleIndex(styleIndex: number, workbook: WorkBook, enableCellXfsRegistry?: boolean): CellData | null;
|
|
25
|
+
export declare const getExtendedValue: (rawValue: any) => ExtendedValue | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Resolve the xf for a cell and extract its protection flags. Returns
|
|
28
|
+
* undefined when the cell has no style or the style is at Excel defaults.
|
|
29
|
+
*/
|
|
30
|
+
export declare function extractCellProtection(cell: any, workbookStyles: WorkbookStyles): {
|
|
31
|
+
locked?: boolean;
|
|
32
|
+
hidden?: boolean;
|
|
33
|
+
} | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Parse a raw styles.xml `<font>` node into a TextFormat. Also used for the
|
|
36
|
+
* workbook default font (fonts[0]) so the exporter can round-trip it.
|
|
37
|
+
*/
|
|
38
|
+
export declare function fontNodeToTextFormat(font: any, workbookStyles: WorkbookStyles): TextFormat | null;
|
|
39
|
+
/**
|
|
40
|
+
* Extract color information
|
|
41
|
+
*/
|
|
42
|
+
export declare function extractColor(colorObj: any, indexedColors?: Array<string | undefined>): Color | undefined | null;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../excel-parser/plugins/xlsx/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAS,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAGV,QAAQ,EAER,KAAK,EAEL,aAAa,EAIb,UAAU,EACX,MAAM,2BAA2B,CAAC;AAKnC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAuD9C,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,SAAS,CAAC;IACjB,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACzC,CAAC;AAEF;;;;;GAKG;AAEH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,GAAG,EACT,QAAQ,EAAE,QAAQ,EAClB,qBAAqB,UAAQ,EAC7B,mBAAmB,UAAQ,EAC3B,eAAe,CAAC,EAAE,MAAM,EACxB,YAAY,CAAC,EAAE,gBAAgB,GAC9B,QAAQ,GAAG,IAAI,CAwJjB;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,QAAQ,EAClB,qBAAqB,UAAQ,GAC5B,QAAQ,GAAG,IAAI,CAoBjB;AAED,eAAO,MAAM,gBAAgB,GAAI,UAAU,GAAG,KAAG,aAAa,GAAG,SAShE,CAAC;AAuTF;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,GAAG,EACT,cAAc,EAAE,cAAc,GAC7B;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAUpD;AAuMD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,GAAG,EACT,cAAc,EAAE,cAAc,GAC7B,UAAU,GAAG,IAAI,CAwFnB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,GAAG,EACb,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,GACxC,KAAK,GAAG,SAAS,GAAG,IAAI,CA8C1B"}
|