@cj-tech-master/excelts 9.2.1 → 9.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -2
- package/README_zh.md +29 -6
- package/dist/browser/index.browser.d.ts +1 -1
- package/dist/browser/index.browser.js +4 -0
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.js +4 -0
- package/dist/browser/modules/excel/cell.d.ts +17 -3
- package/dist/browser/modules/excel/cell.js +170 -22
- package/dist/browser/modules/excel/defined-names.d.ts +96 -1
- package/dist/browser/modules/excel/defined-names.js +411 -21
- package/dist/browser/modules/excel/image.d.ts +11 -0
- package/dist/browser/modules/excel/image.js +24 -1
- package/dist/browser/modules/excel/stream/workbook-reader.browser.d.ts +9 -3
- package/dist/browser/modules/excel/stream/workbook-reader.browser.js +14 -0
- package/dist/browser/modules/excel/stream/workbook-reader.d.ts +2 -1
- package/dist/browser/modules/excel/stream/workbook-writer.browser.d.ts +39 -5
- package/dist/browser/modules/excel/stream/workbook-writer.browser.js +48 -1
- package/dist/browser/modules/excel/stream/workbook-writer.d.ts +3 -2
- package/dist/browser/modules/excel/stream/worksheet-reader.js +17 -1
- package/dist/browser/modules/excel/stream/worksheet-writer.d.ts +39 -6
- package/dist/browser/modules/excel/stream/worksheet-writer.js +45 -5
- package/dist/browser/modules/excel/table.js +15 -2
- package/dist/browser/modules/excel/types.d.ts +133 -2
- package/dist/browser/modules/excel/utils/col-cache.d.ts +1 -0
- package/dist/browser/modules/excel/utils/col-cache.js +15 -0
- package/dist/browser/modules/excel/utils/drawing-utils.d.ts +3 -3
- package/dist/browser/modules/excel/utils/drawing-utils.js +4 -0
- package/dist/browser/modules/excel/utils/external-link-formula.d.ts +76 -0
- package/dist/browser/modules/excel/utils/external-link-formula.js +208 -0
- package/dist/browser/modules/excel/utils/iterate-stream.d.ts +9 -3
- package/dist/browser/modules/excel/utils/iterate-stream.js +3 -1
- package/dist/browser/modules/excel/utils/ooxml-paths.d.ts +19 -0
- package/dist/browser/modules/excel/utils/ooxml-paths.js +37 -2
- package/dist/browser/modules/excel/utils/shared-strings.d.ts +8 -3
- package/dist/browser/modules/excel/utils/shared-strings.js +21 -2
- package/dist/browser/modules/excel/utils/workbook-protection.d.ts +30 -0
- package/dist/browser/modules/excel/utils/workbook-protection.js +30 -0
- package/dist/browser/modules/excel/workbook.browser.d.ts +257 -6
- package/dist/browser/modules/excel/workbook.browser.js +318 -34
- package/dist/browser/modules/excel/workbook.d.ts +1 -1
- package/dist/browser/modules/excel/worksheet.d.ts +3 -1
- package/dist/browser/modules/excel/worksheet.js +21 -2
- package/dist/browser/modules/excel/xlsx/rel-type.d.ts +15 -0
- package/dist/browser/modules/excel/xlsx/rel-type.js +16 -1
- package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +6 -5
- package/dist/browser/modules/excel/xlsx/xform/book/defined-name-xform.js +21 -86
- package/dist/browser/modules/excel/xlsx/xform/book/external-link-xform.d.ts +84 -0
- package/dist/browser/modules/excel/xlsx/xform/book/external-link-xform.js +330 -0
- package/dist/browser/modules/excel/xlsx/xform/book/external-reference-xform.d.ts +17 -0
- package/dist/browser/modules/excel/xlsx/xform/book/external-reference-xform.js +24 -0
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-calc-properties-xform.d.ts +3 -0
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-calc-properties-xform.js +11 -2
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-protection-xform.d.ts +20 -0
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-protection-xform.js +66 -0
- package/dist/browser/modules/excel/xlsx/xform/book/workbook-xform.js +38 -5
- package/dist/browser/modules/excel/xlsx/xform/core/content-types-xform.js +19 -1
- package/dist/browser/modules/excel/xlsx/xform/core/metadata-xform.d.ts +56 -0
- package/dist/browser/modules/excel/xlsx/xform/core/metadata-xform.js +158 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.d.ts +26 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +105 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +3 -0
- package/dist/browser/modules/excel/xlsx/xform/drawing/drawing-xform.js +10 -2
- package/dist/browser/modules/excel/xlsx/xform/sheet/cell-xform.d.ts +1 -1
- package/dist/browser/modules/excel/xlsx/xform/sheet/cell-xform.js +166 -8
- package/dist/browser/modules/excel/xlsx/xform/sheet/data-validations-xform.js +1 -1
- package/dist/browser/modules/excel/xlsx/xform/sheet/ignored-errors-xform.d.ts +21 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/ignored-errors-xform.js +80 -0
- package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +9 -4
- package/dist/browser/modules/excel/xlsx/xform/style/border-xform.js +4 -1
- package/dist/browser/modules/excel/xlsx/xlsx.browser.d.ts +172 -13
- package/dist/browser/modules/excel/xlsx/xlsx.browser.js +410 -20
- package/dist/browser/modules/excel/xlsx/xlsx.d.ts +7 -4
- package/dist/browser/modules/excel/xlsx/xlsx.js +4 -5
- package/dist/browser/modules/formula/compile/address-utils.d.ts +62 -0
- package/dist/browser/modules/formula/compile/address-utils.js +83 -0
- package/dist/browser/modules/formula/compile/binder.d.ts +42 -0
- package/dist/browser/modules/formula/compile/binder.js +487 -0
- package/dist/browser/modules/formula/compile/bound-ast.d.ts +230 -0
- package/dist/browser/modules/formula/compile/bound-ast.js +80 -0
- package/dist/browser/modules/formula/compile/compiled-formula.d.ts +137 -0
- package/dist/browser/modules/formula/compile/compiled-formula.js +383 -0
- package/dist/browser/modules/formula/compile/dependency-analysis.d.ts +93 -0
- package/dist/browser/modules/formula/compile/dependency-analysis.js +432 -0
- package/dist/browser/modules/formula/compile/structured-ref-utils.d.ts +93 -0
- package/dist/browser/modules/formula/compile/structured-ref-utils.js +136 -0
- package/dist/browser/modules/formula/default-syntax-probe.d.ts +79 -0
- package/dist/browser/modules/formula/default-syntax-probe.js +83 -0
- package/dist/browser/modules/formula/functions/_date-context.d.ts +4 -0
- package/dist/browser/modules/formula/functions/_date-context.js +29 -0
- package/dist/browser/modules/formula/functions/_shared.d.ts +121 -0
- package/dist/browser/modules/formula/functions/_shared.js +381 -0
- package/dist/browser/modules/formula/functions/conditional.d.ts +27 -0
- package/dist/browser/modules/formula/functions/conditional.js +343 -0
- package/dist/browser/modules/formula/functions/database.d.ts +37 -0
- package/dist/browser/modules/formula/functions/database.js +274 -0
- package/dist/browser/modules/formula/functions/date.d.ts +61 -0
- package/dist/browser/modules/formula/functions/date.js +855 -0
- package/dist/browser/modules/formula/functions/dynamic-array.d.ts +23 -0
- package/dist/browser/modules/formula/functions/dynamic-array.js +860 -0
- package/dist/browser/modules/formula/functions/engineering.d.ts +57 -0
- package/dist/browser/modules/formula/functions/engineering.js +1128 -0
- package/dist/browser/modules/formula/functions/financial.d.ts +202 -0
- package/dist/browser/modules/formula/functions/financial.js +2296 -0
- package/dist/browser/modules/formula/functions/lookup.d.ts +18 -0
- package/dist/browser/modules/formula/functions/lookup.js +886 -0
- package/dist/browser/modules/formula/functions/math.d.ts +114 -0
- package/dist/browser/modules/formula/functions/math.js +1406 -0
- package/dist/browser/modules/formula/functions/statistical.d.ts +193 -0
- package/dist/browser/modules/formula/functions/statistical.js +3390 -0
- package/dist/browser/modules/formula/functions/text.d.ts +86 -0
- package/dist/browser/modules/formula/functions/text.js +1845 -0
- package/dist/browser/modules/formula/host-registry.d.ts +53 -0
- package/dist/browser/modules/formula/host-registry.js +69 -0
- package/dist/browser/modules/formula/index.d.ts +39 -0
- package/dist/browser/modules/formula/index.js +49 -0
- package/dist/browser/modules/formula/install.d.ts +62 -0
- package/dist/browser/modules/formula/install.js +88 -0
- package/dist/browser/modules/formula/integration/apply-writeback-plan.d.ts +26 -0
- package/dist/browser/modules/formula/integration/apply-writeback-plan.js +210 -0
- package/dist/browser/modules/formula/integration/calculate-formulas-impl.d.ts +30 -0
- package/dist/browser/modules/formula/integration/calculate-formulas-impl.js +616 -0
- package/dist/browser/modules/formula/integration/calculate-formulas.d.ts +67 -0
- package/dist/browser/modules/formula/integration/calculate-formulas.js +68 -0
- package/dist/browser/modules/formula/integration/formula-instance.d.ts +64 -0
- package/dist/browser/modules/formula/integration/formula-instance.js +79 -0
- package/dist/browser/modules/formula/integration/workbook-adapter.d.ts +26 -0
- package/dist/browser/modules/formula/integration/workbook-adapter.js +324 -0
- package/dist/browser/modules/formula/integration/workbook-snapshot.d.ts +267 -0
- package/dist/browser/modules/formula/integration/workbook-snapshot.js +77 -0
- package/dist/browser/modules/formula/materialize/build-writeback-plan.d.ts +34 -0
- package/dist/browser/modules/formula/materialize/build-writeback-plan.js +473 -0
- package/dist/browser/modules/formula/materialize/spill-engine.d.ts +9 -0
- package/dist/browser/modules/formula/materialize/spill-engine.js +38 -0
- package/dist/browser/modules/formula/materialize/types.d.ts +179 -0
- package/dist/browser/modules/formula/materialize/types.js +29 -0
- package/dist/browser/modules/formula/materialize/writeback-plan.d.ts +167 -0
- package/dist/browser/modules/formula/materialize/writeback-plan.js +27 -0
- package/dist/browser/modules/formula/runtime/evaluator.d.ts +151 -0
- package/dist/browser/modules/formula/runtime/evaluator.js +2291 -0
- package/dist/browser/modules/formula/runtime/function-registry.d.ts +47 -0
- package/dist/browser/modules/formula/runtime/function-registry.js +840 -0
- package/dist/browser/modules/formula/runtime/values.d.ts +211 -0
- package/dist/browser/modules/formula/runtime/values.js +385 -0
- package/dist/browser/modules/formula/syntax/ast.d.ts +129 -0
- package/dist/browser/modules/formula/syntax/ast.js +28 -0
- package/dist/browser/modules/formula/syntax/parser.d.ts +18 -0
- package/dist/browser/modules/formula/syntax/parser.js +439 -0
- package/dist/browser/modules/formula/syntax/token-types.d.ts +153 -0
- package/dist/browser/modules/formula/syntax/token-types.js +59 -0
- package/dist/browser/modules/formula/syntax/tokenizer.d.ts +10 -0
- package/dist/browser/modules/formula/syntax/tokenizer.js +1074 -0
- package/dist/browser/modules/pdf/excel-bridge.js +9 -0
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/modules/excel/cell.js +170 -22
- package/dist/cjs/modules/excel/defined-names.js +411 -21
- package/dist/cjs/modules/excel/image.js +24 -1
- package/dist/cjs/modules/excel/stream/workbook-reader.browser.js +14 -0
- package/dist/cjs/modules/excel/stream/workbook-writer.browser.js +48 -1
- package/dist/cjs/modules/excel/stream/worksheet-reader.js +17 -1
- package/dist/cjs/modules/excel/stream/worksheet-writer.js +45 -5
- package/dist/cjs/modules/excel/table.js +15 -2
- package/dist/cjs/modules/excel/utils/col-cache.js +15 -0
- package/dist/cjs/modules/excel/utils/drawing-utils.js +4 -0
- package/dist/cjs/modules/excel/utils/external-link-formula.js +212 -0
- package/dist/cjs/modules/excel/utils/iterate-stream.js +3 -1
- package/dist/cjs/modules/excel/utils/ooxml-paths.js +42 -2
- package/dist/cjs/modules/excel/utils/shared-strings.js +21 -2
- package/dist/cjs/modules/excel/utils/workbook-protection.js +33 -0
- package/dist/cjs/modules/excel/workbook.browser.js +318 -34
- package/dist/cjs/modules/excel/worksheet.js +20 -1
- package/dist/cjs/modules/excel/xlsx/rel-type.js +16 -1
- package/dist/cjs/modules/excel/xlsx/xform/book/defined-name-xform.js +21 -86
- package/dist/cjs/modules/excel/xlsx/xform/book/external-link-xform.js +333 -0
- package/dist/cjs/modules/excel/xlsx/xform/book/external-reference-xform.js +27 -0
- package/dist/cjs/modules/excel/xlsx/xform/book/workbook-calc-properties-xform.js +11 -2
- package/dist/cjs/modules/excel/xlsx/xform/book/workbook-protection-xform.js +69 -0
- package/dist/cjs/modules/excel/xlsx/xform/book/workbook-xform.js +38 -5
- package/dist/cjs/modules/excel/xlsx/xform/core/content-types-xform.js +18 -0
- package/dist/cjs/modules/excel/xlsx/xform/core/metadata-xform.js +161 -0
- package/dist/cjs/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +108 -0
- package/dist/cjs/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +3 -0
- package/dist/cjs/modules/excel/xlsx/xform/drawing/drawing-xform.js +10 -2
- package/dist/cjs/modules/excel/xlsx/xform/sheet/cell-xform.js +166 -8
- package/dist/cjs/modules/excel/xlsx/xform/sheet/data-validations-xform.js +1 -1
- package/dist/cjs/modules/excel/xlsx/xform/sheet/ignored-errors-xform.js +83 -0
- package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +9 -4
- package/dist/cjs/modules/excel/xlsx/xform/style/border-xform.js +4 -1
- package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +408 -18
- package/dist/cjs/modules/excel/xlsx/xlsx.js +4 -5
- package/dist/cjs/modules/formula/compile/address-utils.js +89 -0
- package/dist/cjs/modules/formula/compile/binder.js +489 -0
- package/dist/cjs/modules/formula/compile/bound-ast.js +68 -0
- package/dist/cjs/modules/formula/compile/compiled-formula.js +387 -0
- package/dist/cjs/modules/formula/compile/dependency-analysis.js +437 -0
- package/dist/cjs/modules/formula/compile/structured-ref-utils.js +141 -0
- package/dist/cjs/modules/formula/default-syntax-probe.js +87 -0
- package/dist/cjs/modules/formula/functions/_date-context.js +33 -0
- package/dist/cjs/modules/formula/functions/_shared.js +396 -0
- package/dist/cjs/modules/formula/functions/conditional.js +354 -0
- package/dist/cjs/modules/formula/functions/database.js +288 -0
- package/dist/cjs/modules/formula/functions/date.js +883 -0
- package/dist/cjs/modules/formula/functions/dynamic-array.js +881 -0
- package/dist/cjs/modules/formula/functions/engineering.js +1183 -0
- package/dist/cjs/modules/formula/functions/financial.js +2348 -0
- package/dist/cjs/modules/formula/functions/lookup.js +902 -0
- package/dist/cjs/modules/formula/functions/math.js +1487 -0
- package/dist/cjs/modules/formula/functions/statistical.js +3488 -0
- package/dist/cjs/modules/formula/functions/text.js +1889 -0
- package/dist/cjs/modules/formula/host-registry.js +75 -0
- package/dist/cjs/modules/formula/index.js +58 -0
- package/dist/cjs/modules/formula/install.js +93 -0
- package/dist/cjs/modules/formula/integration/apply-writeback-plan.js +213 -0
- package/dist/cjs/modules/formula/integration/calculate-formulas-impl.js +619 -0
- package/dist/cjs/modules/formula/integration/calculate-formulas.js +71 -0
- package/dist/cjs/modules/formula/integration/formula-instance.js +82 -0
- package/dist/cjs/modules/formula/integration/workbook-adapter.js +327 -0
- package/dist/cjs/modules/formula/integration/workbook-snapshot.js +84 -0
- package/dist/cjs/modules/formula/materialize/build-writeback-plan.js +475 -0
- package/dist/cjs/modules/formula/materialize/spill-engine.js +42 -0
- package/dist/cjs/modules/formula/materialize/types.js +32 -0
- package/dist/cjs/modules/formula/materialize/writeback-plan.js +28 -0
- package/dist/cjs/modules/formula/runtime/evaluator.js +2298 -0
- package/dist/cjs/modules/formula/runtime/function-registry.js +846 -0
- package/dist/cjs/modules/formula/runtime/values.js +385 -0
- package/dist/cjs/modules/formula/syntax/ast.js +8 -0
- package/dist/cjs/modules/formula/syntax/parser.js +440 -0
- package/dist/cjs/modules/formula/syntax/token-types.js +32 -0
- package/dist/cjs/modules/formula/syntax/tokenizer.js +1076 -0
- package/dist/cjs/modules/pdf/excel-bridge.js +9 -0
- package/dist/esm/index.browser.js +4 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/modules/excel/cell.js +170 -22
- package/dist/esm/modules/excel/defined-names.js +411 -21
- package/dist/esm/modules/excel/image.js +24 -1
- package/dist/esm/modules/excel/stream/workbook-reader.browser.js +14 -0
- package/dist/esm/modules/excel/stream/workbook-writer.browser.js +48 -1
- package/dist/esm/modules/excel/stream/worksheet-reader.js +17 -1
- package/dist/esm/modules/excel/stream/worksheet-writer.js +45 -5
- package/dist/esm/modules/excel/table.js +15 -2
- package/dist/esm/modules/excel/utils/col-cache.js +15 -0
- package/dist/esm/modules/excel/utils/drawing-utils.js +4 -0
- package/dist/esm/modules/excel/utils/external-link-formula.js +208 -0
- package/dist/esm/modules/excel/utils/iterate-stream.js +3 -1
- package/dist/esm/modules/excel/utils/ooxml-paths.js +37 -2
- package/dist/esm/modules/excel/utils/shared-strings.js +21 -2
- package/dist/esm/modules/excel/utils/workbook-protection.js +30 -0
- package/dist/esm/modules/excel/workbook.browser.js +318 -34
- package/dist/esm/modules/excel/worksheet.js +21 -2
- package/dist/esm/modules/excel/xlsx/rel-type.js +16 -1
- package/dist/esm/modules/excel/xlsx/xform/book/defined-name-xform.js +21 -86
- package/dist/esm/modules/excel/xlsx/xform/book/external-link-xform.js +330 -0
- package/dist/esm/modules/excel/xlsx/xform/book/external-reference-xform.js +24 -0
- package/dist/esm/modules/excel/xlsx/xform/book/workbook-calc-properties-xform.js +11 -2
- package/dist/esm/modules/excel/xlsx/xform/book/workbook-protection-xform.js +66 -0
- package/dist/esm/modules/excel/xlsx/xform/book/workbook-xform.js +38 -5
- package/dist/esm/modules/excel/xlsx/xform/core/content-types-xform.js +19 -1
- package/dist/esm/modules/excel/xlsx/xform/core/metadata-xform.js +158 -0
- package/dist/esm/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.js +105 -0
- package/dist/esm/modules/excel/xlsx/xform/drawing/base-cell-anchor-xform.js +3 -0
- package/dist/esm/modules/excel/xlsx/xform/drawing/drawing-xform.js +10 -2
- package/dist/esm/modules/excel/xlsx/xform/sheet/cell-xform.js +166 -8
- package/dist/esm/modules/excel/xlsx/xform/sheet/data-validations-xform.js +1 -1
- package/dist/esm/modules/excel/xlsx/xform/sheet/ignored-errors-xform.js +80 -0
- package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +9 -4
- package/dist/esm/modules/excel/xlsx/xform/style/border-xform.js +4 -1
- package/dist/esm/modules/excel/xlsx/xlsx.browser.js +410 -20
- package/dist/esm/modules/excel/xlsx/xlsx.js +4 -5
- package/dist/esm/modules/formula/compile/address-utils.js +83 -0
- package/dist/esm/modules/formula/compile/binder.js +487 -0
- package/dist/esm/modules/formula/compile/bound-ast.js +80 -0
- package/dist/esm/modules/formula/compile/compiled-formula.js +383 -0
- package/dist/esm/modules/formula/compile/dependency-analysis.js +432 -0
- package/dist/esm/modules/formula/compile/structured-ref-utils.js +136 -0
- package/dist/esm/modules/formula/default-syntax-probe.js +83 -0
- package/dist/esm/modules/formula/functions/_date-context.js +29 -0
- package/dist/esm/modules/formula/functions/_shared.js +381 -0
- package/dist/esm/modules/formula/functions/conditional.js +343 -0
- package/dist/esm/modules/formula/functions/database.js +274 -0
- package/dist/esm/modules/formula/functions/date.js +855 -0
- package/dist/esm/modules/formula/functions/dynamic-array.js +860 -0
- package/dist/esm/modules/formula/functions/engineering.js +1128 -0
- package/dist/esm/modules/formula/functions/financial.js +2296 -0
- package/dist/esm/modules/formula/functions/lookup.js +886 -0
- package/dist/esm/modules/formula/functions/math.js +1406 -0
- package/dist/esm/modules/formula/functions/statistical.js +3390 -0
- package/dist/esm/modules/formula/functions/text.js +1845 -0
- package/dist/esm/modules/formula/host-registry.js +69 -0
- package/dist/esm/modules/formula/index.js +49 -0
- package/dist/esm/modules/formula/install.js +88 -0
- package/dist/esm/modules/formula/integration/apply-writeback-plan.js +210 -0
- package/dist/esm/modules/formula/integration/calculate-formulas-impl.js +616 -0
- package/dist/esm/modules/formula/integration/calculate-formulas.js +68 -0
- package/dist/esm/modules/formula/integration/formula-instance.js +79 -0
- package/dist/esm/modules/formula/integration/workbook-adapter.js +324 -0
- package/dist/esm/modules/formula/integration/workbook-snapshot.js +77 -0
- package/dist/esm/modules/formula/materialize/build-writeback-plan.js +473 -0
- package/dist/esm/modules/formula/materialize/spill-engine.js +38 -0
- package/dist/esm/modules/formula/materialize/types.js +29 -0
- package/dist/esm/modules/formula/materialize/writeback-plan.js +27 -0
- package/dist/esm/modules/formula/runtime/evaluator.js +2291 -0
- package/dist/esm/modules/formula/runtime/function-registry.js +840 -0
- package/dist/esm/modules/formula/runtime/values.js +385 -0
- package/dist/esm/modules/formula/syntax/ast.js +28 -0
- package/dist/esm/modules/formula/syntax/parser.js +439 -0
- package/dist/esm/modules/formula/syntax/token-types.js +59 -0
- package/dist/esm/modules/formula/syntax/tokenizer.js +1074 -0
- package/dist/esm/modules/pdf/excel-bridge.js +9 -0
- package/dist/iife/excelts.iife.js +2302 -373
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +34 -34
- package/dist/types/index.browser.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/modules/excel/cell.d.ts +17 -3
- package/dist/types/modules/excel/defined-names.d.ts +96 -1
- package/dist/types/modules/excel/image.d.ts +11 -0
- package/dist/types/modules/excel/stream/workbook-reader.browser.d.ts +9 -3
- package/dist/types/modules/excel/stream/workbook-reader.d.ts +2 -1
- package/dist/types/modules/excel/stream/workbook-writer.browser.d.ts +39 -5
- package/dist/types/modules/excel/stream/workbook-writer.d.ts +3 -2
- package/dist/types/modules/excel/stream/worksheet-writer.d.ts +39 -6
- package/dist/types/modules/excel/types.d.ts +133 -2
- package/dist/types/modules/excel/utils/col-cache.d.ts +1 -0
- package/dist/types/modules/excel/utils/drawing-utils.d.ts +3 -3
- package/dist/types/modules/excel/utils/external-link-formula.d.ts +76 -0
- package/dist/types/modules/excel/utils/iterate-stream.d.ts +9 -3
- package/dist/types/modules/excel/utils/ooxml-paths.d.ts +19 -0
- package/dist/types/modules/excel/utils/shared-strings.d.ts +8 -3
- package/dist/types/modules/excel/utils/workbook-protection.d.ts +30 -0
- package/dist/types/modules/excel/workbook.browser.d.ts +257 -6
- package/dist/types/modules/excel/workbook.d.ts +1 -1
- package/dist/types/modules/excel/worksheet.d.ts +3 -1
- package/dist/types/modules/excel/xlsx/rel-type.d.ts +15 -0
- package/dist/types/modules/excel/xlsx/xform/book/defined-name-xform.d.ts +6 -5
- package/dist/types/modules/excel/xlsx/xform/book/external-link-xform.d.ts +84 -0
- package/dist/types/modules/excel/xlsx/xform/book/external-reference-xform.d.ts +17 -0
- package/dist/types/modules/excel/xlsx/xform/book/workbook-calc-properties-xform.d.ts +3 -0
- package/dist/types/modules/excel/xlsx/xform/book/workbook-protection-xform.d.ts +20 -0
- package/dist/types/modules/excel/xlsx/xform/core/metadata-xform.d.ts +56 -0
- package/dist/types/modules/excel/xlsx/xform/drawing/absolute-anchor-xform.d.ts +26 -0
- package/dist/types/modules/excel/xlsx/xform/sheet/cell-xform.d.ts +1 -1
- package/dist/types/modules/excel/xlsx/xform/sheet/ignored-errors-xform.d.ts +21 -0
- package/dist/types/modules/excel/xlsx/xlsx.browser.d.ts +172 -13
- package/dist/types/modules/excel/xlsx/xlsx.d.ts +7 -4
- package/dist/types/modules/formula/compile/address-utils.d.ts +62 -0
- package/dist/types/modules/formula/compile/binder.d.ts +42 -0
- package/dist/types/modules/formula/compile/bound-ast.d.ts +230 -0
- package/dist/types/modules/formula/compile/compiled-formula.d.ts +137 -0
- package/dist/types/modules/formula/compile/dependency-analysis.d.ts +93 -0
- package/dist/types/modules/formula/compile/structured-ref-utils.d.ts +93 -0
- package/dist/types/modules/formula/default-syntax-probe.d.ts +79 -0
- package/dist/types/modules/formula/functions/_date-context.d.ts +4 -0
- package/dist/types/modules/formula/functions/_shared.d.ts +121 -0
- package/dist/types/modules/formula/functions/conditional.d.ts +27 -0
- package/dist/types/modules/formula/functions/database.d.ts +37 -0
- package/dist/types/modules/formula/functions/date.d.ts +61 -0
- package/dist/types/modules/formula/functions/dynamic-array.d.ts +23 -0
- package/dist/types/modules/formula/functions/engineering.d.ts +57 -0
- package/dist/types/modules/formula/functions/financial.d.ts +202 -0
- package/dist/types/modules/formula/functions/lookup.d.ts +18 -0
- package/dist/types/modules/formula/functions/math.d.ts +114 -0
- package/dist/types/modules/formula/functions/statistical.d.ts +193 -0
- package/dist/types/modules/formula/functions/text.d.ts +86 -0
- package/dist/types/modules/formula/host-registry.d.ts +53 -0
- package/dist/types/modules/formula/index.d.ts +39 -0
- package/dist/types/modules/formula/install.d.ts +62 -0
- package/dist/types/modules/formula/integration/apply-writeback-plan.d.ts +26 -0
- package/dist/types/modules/formula/integration/calculate-formulas-impl.d.ts +30 -0
- package/dist/types/modules/formula/integration/calculate-formulas.d.ts +67 -0
- package/dist/types/modules/formula/integration/formula-instance.d.ts +64 -0
- package/dist/types/modules/formula/integration/workbook-adapter.d.ts +26 -0
- package/dist/types/modules/formula/integration/workbook-snapshot.d.ts +267 -0
- package/dist/types/modules/formula/materialize/build-writeback-plan.d.ts +34 -0
- package/dist/types/modules/formula/materialize/spill-engine.d.ts +9 -0
- package/dist/types/modules/formula/materialize/types.d.ts +179 -0
- package/dist/types/modules/formula/materialize/writeback-plan.d.ts +167 -0
- package/dist/types/modules/formula/runtime/evaluator.d.ts +151 -0
- package/dist/types/modules/formula/runtime/function-registry.d.ts +47 -0
- package/dist/types/modules/formula/runtime/values.d.ts +211 -0
- package/dist/types/modules/formula/syntax/ast.d.ts +129 -0
- package/dist/types/modules/formula/syntax/parser.d.ts +18 -0
- package/dist/types/modules/formula/syntax/token-types.d.ts +153 -0
- package/dist/types/modules/formula/syntax/tokenizer.d.ts +10 -0
- package/package.json +28 -28
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { ValueType } from "../excel/enums.js";
|
|
18
18
|
import { formatCellValue } from "../excel/utils/cell-format.js";
|
|
19
|
+
import { tryInvokeFormulaEngine } from "../formula/host-registry.js";
|
|
19
20
|
import { base64ToUint8Array } from "../../utils/utils.base.js";
|
|
20
21
|
import { exportPdf } from "./render/pdf-exporter.js";
|
|
21
22
|
import { PdfCellType } from "./types.js";
|
|
@@ -34,6 +35,14 @@ import { PdfCellType } from "./types.js";
|
|
|
34
35
|
* @returns Promise of PDF file as a Uint8Array
|
|
35
36
|
*/
|
|
36
37
|
export async function excelToPdf(workbook, options) {
|
|
38
|
+
// Recalculate all formulas before conversion so that formula results
|
|
39
|
+
// reflect the latest cell values (fixes stale cached results from XLSX).
|
|
40
|
+
//
|
|
41
|
+
// The formula engine is opt-in: callers who import
|
|
42
|
+
// `@cj-tech-master/excelts/formula` get automatic recalculation here; callers
|
|
43
|
+
// who don't import it fall back to whatever cached results the XLSX
|
|
44
|
+
// shipped with (safe for workbooks last saved by Excel itself).
|
|
45
|
+
tryInvokeFormulaEngine(workbook);
|
|
37
46
|
const pdfWorkbook = excelWorkbookToPdf(workbook);
|
|
38
47
|
return exportPdf(pdfWorkbook, options);
|
|
39
48
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -40,6 +40,10 @@ var data_validations_1 = require("./modules/excel/data-validations.js");
|
|
|
40
40
|
Object.defineProperty(exports, "DataValidations", { enumerable: true, get: function () { return data_validations_1.DataValidations; } });
|
|
41
41
|
var form_control_1 = require("./modules/excel/form-control.js");
|
|
42
42
|
Object.defineProperty(exports, "FormCheckbox", { enumerable: true, get: function () { return form_control_1.FormCheckbox; } });
|
|
43
|
+
// Note: the formula engine lives at the `./formula` subpath so it stays
|
|
44
|
+
// out of bundles that only need to read / write XLSX files. Import
|
|
45
|
+
// `@cj-tech-master/excelts/formula` to enable `Workbook.calculateFormulas()`
|
|
46
|
+
// and automatic recalculation in `excelToPdf()`.
|
|
43
47
|
// =============================================================================
|
|
44
48
|
// Node.js Only: Streaming Classes
|
|
45
49
|
// These can also be accessed via Workbook.createStreamWriter/createStreamReader
|
|
@@ -13,6 +13,51 @@ const under_dash_1 = require("./utils/under-dash.js");
|
|
|
13
13
|
// empty string, and empty objects `{}`. This is used to prevent an empty `{}`
|
|
14
14
|
// style property on a row from shadowing a real style property on a column.
|
|
15
15
|
const hasOwnKeys = (v) => !!v && (typeof v !== "object" || Object.keys(v).length > 0);
|
|
16
|
+
/**
|
|
17
|
+
* Flatten a rich-text array into its plain-text representation by
|
|
18
|
+
* concatenating each run's `text`. Missing/null runs contribute "".
|
|
19
|
+
*/
|
|
20
|
+
function flattenRichText(runs) {
|
|
21
|
+
let out = "";
|
|
22
|
+
for (const run of runs) {
|
|
23
|
+
if (run && typeof run.text === "string") {
|
|
24
|
+
out += run.text;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return out;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Normalize a CellHyperlinkValue so the {@link NormalizedHyperlink} invariants
|
|
31
|
+
* hold.
|
|
32
|
+
*
|
|
33
|
+
* - If the caller supplied `richText` but no `text`, text is derived.
|
|
34
|
+
* - If the caller supplied `text` but no `richText`, richText stays absent.
|
|
35
|
+
* - If both are supplied, `richText` wins and `text` is regenerated
|
|
36
|
+
* (to keep `text === flatten(richText)`).
|
|
37
|
+
* - An empty `richText: []` is dropped (treated as "no rich text").
|
|
38
|
+
*/
|
|
39
|
+
function normalizeHyperlinkValue(value) {
|
|
40
|
+
let text;
|
|
41
|
+
let richText;
|
|
42
|
+
if (Array.isArray(value.richText) && value.richText.length > 0) {
|
|
43
|
+
richText = value.richText;
|
|
44
|
+
text = flattenRichText(richText);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
text = typeof value.text === "string" ? value.text : "";
|
|
48
|
+
}
|
|
49
|
+
const out = {
|
|
50
|
+
text,
|
|
51
|
+
hyperlink: typeof value.hyperlink === "string" ? value.hyperlink : ""
|
|
52
|
+
};
|
|
53
|
+
if (richText) {
|
|
54
|
+
out.richText = richText;
|
|
55
|
+
}
|
|
56
|
+
if (typeof value.tooltip === "string" && value.tooltip.length > 0) {
|
|
57
|
+
out.tooltip = value.tooltip;
|
|
58
|
+
}
|
|
59
|
+
return out;
|
|
60
|
+
}
|
|
16
61
|
// Cell requirements
|
|
17
62
|
// Operate inside a worksheet
|
|
18
63
|
// Store and retrieve a value with a range of types: text, number, date, hyperlink, reference, formula, etc.
|
|
@@ -237,12 +282,30 @@ class Cell {
|
|
|
237
282
|
}
|
|
238
283
|
/** @internal */
|
|
239
284
|
_upgradeToHyperlink(hyperlink) {
|
|
240
|
-
//
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
285
|
+
// Upgrade this cell to a Hyperlink while preserving the existing display
|
|
286
|
+
// text. Supports promotion from both plain String cells and RichText cells.
|
|
287
|
+
// For RichText cells, the runs are preserved on the new hyperlink value.
|
|
288
|
+
switch (this.type) {
|
|
289
|
+
case Cell.Types.String: {
|
|
290
|
+
this._value = Value.create(Cell.Types.Hyperlink, this, {
|
|
291
|
+
text: String(this._value.value),
|
|
292
|
+
hyperlink
|
|
293
|
+
});
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
296
|
+
case Cell.Types.RichText: {
|
|
297
|
+
const current = this._value.value;
|
|
298
|
+
const runs = current && Array.isArray(current.richText) ? current.richText : [];
|
|
299
|
+
this._value = Value.create(Cell.Types.Hyperlink, this, {
|
|
300
|
+
text: flattenRichText(runs),
|
|
301
|
+
richText: runs.length > 0 ? runs : undefined,
|
|
302
|
+
hyperlink
|
|
303
|
+
});
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
306
|
+
default:
|
|
307
|
+
// Other cell types (Number, Date, Formula, ...) are not auto-upgraded.
|
|
308
|
+
break;
|
|
246
309
|
}
|
|
247
310
|
}
|
|
248
311
|
// =========================================================================
|
|
@@ -253,6 +316,11 @@ class Cell {
|
|
|
253
316
|
get result() {
|
|
254
317
|
return this._value.result;
|
|
255
318
|
}
|
|
319
|
+
set result(value) {
|
|
320
|
+
if (this.type === Cell.Types.Formula) {
|
|
321
|
+
this._value.result = value;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
256
324
|
get formulaType() {
|
|
257
325
|
return this._value.formulaType ?? enums_1.Enums.FormulaType.None;
|
|
258
326
|
}
|
|
@@ -510,34 +578,95 @@ class HyperlinkValue {
|
|
|
510
578
|
constructor(cell, value) {
|
|
511
579
|
this.model = {
|
|
512
580
|
address: cell.address,
|
|
513
|
-
type: Cell.Types.Hyperlink
|
|
514
|
-
text: value ? value.text : undefined,
|
|
515
|
-
hyperlink: value ? value.hyperlink : undefined
|
|
581
|
+
type: Cell.Types.Hyperlink
|
|
516
582
|
};
|
|
517
|
-
if (value
|
|
518
|
-
|
|
583
|
+
if (value) {
|
|
584
|
+
// Formula + hyperlink: surface as a Hyperlink whose display is the
|
|
585
|
+
// formula's evaluated result, but persist the formula on the model so
|
|
586
|
+
// it round-trips on write. The cell value getter ignores the formula
|
|
587
|
+
// fields, keeping the public Hyperlink shape clean.
|
|
588
|
+
if ("formula" in value && typeof value.formula === "string") {
|
|
589
|
+
const fh = value;
|
|
590
|
+
const display = fh.result === undefined || fh.result === null ? "" : String(fh.result);
|
|
591
|
+
this.model.text = display;
|
|
592
|
+
this.model.hyperlink = fh.hyperlink ?? "";
|
|
593
|
+
if (fh.tooltip !== undefined) {
|
|
594
|
+
this.model.tooltip = fh.tooltip;
|
|
595
|
+
}
|
|
596
|
+
// Internal-only fields preserved for write-time re-emission.
|
|
597
|
+
this.model.formula =
|
|
598
|
+
fh.formula;
|
|
599
|
+
if (fh.result !== undefined) {
|
|
600
|
+
this.model.result = fh.result;
|
|
601
|
+
}
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
const normalized = normalizeHyperlinkValue(value);
|
|
605
|
+
this.model.text = normalized.text;
|
|
606
|
+
this.model.hyperlink = normalized.hyperlink;
|
|
607
|
+
if (normalized.richText) {
|
|
608
|
+
this.model.richText = normalized.richText;
|
|
609
|
+
}
|
|
610
|
+
if (normalized.tooltip !== undefined) {
|
|
611
|
+
this.model.tooltip = normalized.tooltip;
|
|
612
|
+
}
|
|
519
613
|
}
|
|
520
614
|
}
|
|
521
615
|
get value() {
|
|
522
|
-
|
|
616
|
+
const out = {
|
|
523
617
|
text: this.model.text ?? "",
|
|
524
|
-
hyperlink: this.model.hyperlink ?? ""
|
|
525
|
-
tooltip: this.model.tooltip
|
|
618
|
+
hyperlink: this.model.hyperlink ?? ""
|
|
526
619
|
};
|
|
620
|
+
if (this.model.richText && this.model.richText.length > 0) {
|
|
621
|
+
out.richText = this.model.richText;
|
|
622
|
+
}
|
|
623
|
+
if (this.model.tooltip !== undefined) {
|
|
624
|
+
out.tooltip = this.model.tooltip;
|
|
625
|
+
}
|
|
626
|
+
return out;
|
|
527
627
|
}
|
|
528
628
|
set value(value) {
|
|
529
|
-
|
|
530
|
-
this.model.
|
|
531
|
-
|
|
532
|
-
|
|
629
|
+
const normalized = normalizeHyperlinkValue(value);
|
|
630
|
+
this.model.text = normalized.text;
|
|
631
|
+
this.model.hyperlink = normalized.hyperlink;
|
|
632
|
+
if (normalized.richText) {
|
|
633
|
+
this.model.richText = normalized.richText;
|
|
634
|
+
}
|
|
635
|
+
else {
|
|
636
|
+
delete this.model.richText;
|
|
637
|
+
}
|
|
638
|
+
if (normalized.tooltip !== undefined) {
|
|
639
|
+
this.model.tooltip = normalized.tooltip;
|
|
640
|
+
}
|
|
641
|
+
else {
|
|
642
|
+
delete this.model.tooltip;
|
|
533
643
|
}
|
|
534
644
|
}
|
|
535
645
|
get text() {
|
|
536
646
|
return this.model.text;
|
|
537
647
|
}
|
|
538
648
|
set text(value) {
|
|
649
|
+
// Setting text while richText is present would break the invariant
|
|
650
|
+
// (text must equal flattenRichText(richText)). Dropping richText is the
|
|
651
|
+
// only safe resolution.
|
|
652
|
+
if (this.model.richText) {
|
|
653
|
+
delete this.model.richText;
|
|
654
|
+
}
|
|
539
655
|
this.model.text = value;
|
|
540
656
|
}
|
|
657
|
+
get richText() {
|
|
658
|
+
return this.model.richText;
|
|
659
|
+
}
|
|
660
|
+
set richText(value) {
|
|
661
|
+
if (Array.isArray(value) && value.length > 0) {
|
|
662
|
+
this.model.richText = value;
|
|
663
|
+
this.model.text = flattenRichText(value);
|
|
664
|
+
}
|
|
665
|
+
else {
|
|
666
|
+
delete this.model.richText;
|
|
667
|
+
// leave model.text untouched — caller may still want the plain text
|
|
668
|
+
}
|
|
669
|
+
}
|
|
541
670
|
get hyperlink() {
|
|
542
671
|
return this.model.hyperlink;
|
|
543
672
|
}
|
|
@@ -629,7 +758,8 @@ class FormulaValue {
|
|
|
629
758
|
ref: value ? value.ref : undefined,
|
|
630
759
|
formula: value ? value.formula : undefined,
|
|
631
760
|
sharedFormula: value ? value.sharedFormula : undefined,
|
|
632
|
-
result: value ? value.result : undefined
|
|
761
|
+
result: value ? value.result : undefined,
|
|
762
|
+
isDynamicArray: value ? value.isDynamicArray : undefined
|
|
633
763
|
};
|
|
634
764
|
}
|
|
635
765
|
_copyModel(model) {
|
|
@@ -649,6 +779,9 @@ class FormulaValue {
|
|
|
649
779
|
if (model.sharedFormula) {
|
|
650
780
|
copy.sharedFormula = model.sharedFormula;
|
|
651
781
|
}
|
|
782
|
+
if (model.isDynamicArray) {
|
|
783
|
+
copy.isDynamicArray = model.isDynamicArray;
|
|
784
|
+
}
|
|
652
785
|
return copy;
|
|
653
786
|
}
|
|
654
787
|
get value() {
|
|
@@ -670,6 +803,9 @@ class FormulaValue {
|
|
|
670
803
|
if (value.sharedFormula) {
|
|
671
804
|
this.model.sharedFormula = value.sharedFormula;
|
|
672
805
|
}
|
|
806
|
+
if (value.isDynamicArray !== undefined) {
|
|
807
|
+
this.model.isDynamicArray = value.isDynamicArray;
|
|
808
|
+
}
|
|
673
809
|
}
|
|
674
810
|
validate(value) {
|
|
675
811
|
switch (Value.getType(value)) {
|
|
@@ -957,14 +1093,26 @@ const Value = {
|
|
|
957
1093
|
if ("checkbox" in value && typeof value.checkbox === "boolean") {
|
|
958
1094
|
return Cell.Types.Checkbox;
|
|
959
1095
|
}
|
|
960
|
-
|
|
961
|
-
|
|
1096
|
+
// Hyperlink detection: requires `hyperlink` and either non-empty `text`
|
|
1097
|
+
// or a non-empty `richText` array, OR a formula (formula+hyperlink is
|
|
1098
|
+
// surfaced as a Hyperlink with the formula's result as display).
|
|
1099
|
+
// Checked before RichText/Formula so combined payloads route correctly.
|
|
1100
|
+
if ("hyperlink" in value && typeof value.hyperlink === "string" && value.hyperlink) {
|
|
1101
|
+
const hasText = "text" in value && typeof value.text === "string" && value.text.length > 0;
|
|
1102
|
+
const hasRichText = "richText" in value && Array.isArray(value.richText) && value.richText.length > 0;
|
|
1103
|
+
const hasFormula = "formula" in value && typeof value.formula === "string";
|
|
1104
|
+
if (hasText || hasRichText || hasFormula) {
|
|
1105
|
+
return Cell.Types.Hyperlink;
|
|
1106
|
+
}
|
|
962
1107
|
}
|
|
963
1108
|
if (("formula" in value && value.formula) ||
|
|
964
1109
|
("sharedFormula" in value && value.sharedFormula)) {
|
|
965
1110
|
return Cell.Types.Formula;
|
|
966
1111
|
}
|
|
967
|
-
|
|
1112
|
+
// RichText only when the runs array is non-empty. An empty `richText: []`
|
|
1113
|
+
// carries no content and falls through to JSON rather than producing a
|
|
1114
|
+
// RichText cell with no runs.
|
|
1115
|
+
if ("richText" in value && Array.isArray(value.richText) && value.richText.length > 0) {
|
|
968
1116
|
return Cell.Types.RichText;
|
|
969
1117
|
}
|
|
970
1118
|
if ("sharedString" in value && value.sharedString) {
|