@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
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared helpers for native function implementations.
|
|
3
|
+
*
|
|
4
|
+
* Centralizes small utilities that were previously duplicated across multiple
|
|
5
|
+
* function files (math, statistical, financial, text, date, engineering,
|
|
6
|
+
* conditional, dynamic-array, database, lookup). None of these change runtime
|
|
7
|
+
* semantics — they are the canonical extractions of the identical helpers that
|
|
8
|
+
* appeared in several modules.
|
|
9
|
+
*/
|
|
10
|
+
import { RVKind, BLANK, toNumberRV, topLeft } from "../runtime/values.js";
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// Error propagation
|
|
13
|
+
// ============================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Return the error value if `v` (as a scalar, extracted via `topLeft`) is an
|
|
16
|
+
* error; otherwise return `null`. Used by text / date / engineering functions
|
|
17
|
+
* for the standard "propagate first-arg error" pattern.
|
|
18
|
+
*/
|
|
19
|
+
export function checkError(v) {
|
|
20
|
+
const s = topLeft(v);
|
|
21
|
+
return s.kind === RVKind.Error ? s : null;
|
|
22
|
+
}
|
|
23
|
+
// ============================================================================
|
|
24
|
+
// Argument coercion
|
|
25
|
+
// ============================================================================
|
|
26
|
+
/**
|
|
27
|
+
* Coerce a single RuntimeValue argument to a number. Applies `topLeft` first
|
|
28
|
+
* so that a 1×1 (or arbitrary) array yields its top-left scalar before
|
|
29
|
+
* numeric coercion. Matches the semantics formerly found as `argToNumber` in
|
|
30
|
+
* `math.ts` and `numArg(args, idx)` in `statistical.ts`.
|
|
31
|
+
*/
|
|
32
|
+
export function argToNumber(arg) {
|
|
33
|
+
const s = topLeft(arg);
|
|
34
|
+
if (s.kind === RVKind.Error) {
|
|
35
|
+
return s;
|
|
36
|
+
}
|
|
37
|
+
return toNumberRV(s);
|
|
38
|
+
}
|
|
39
|
+
// ============================================================================
|
|
40
|
+
// Flattening
|
|
41
|
+
// ============================================================================
|
|
42
|
+
/**
|
|
43
|
+
* Flatten a list of arguments into a sequence of numeric values (or errors).
|
|
44
|
+
*
|
|
45
|
+
* Array arguments contribute only their `Number` and `Error` cells — booleans,
|
|
46
|
+
* strings, and blanks inside arrays are skipped (Excel range semantics).
|
|
47
|
+
* Direct scalar arguments are coerced via `toNumberRV`, except for direct
|
|
48
|
+
* `Blank` scalars which are skipped (Excel aggregate semantics).
|
|
49
|
+
*
|
|
50
|
+
* Returns a list of `NumberValue | ErrorValue`. Callers that need raw
|
|
51
|
+
* `number[]` after an error check should map `.value` themselves.
|
|
52
|
+
*/
|
|
53
|
+
export function flattenNumbers(args) {
|
|
54
|
+
const result = [];
|
|
55
|
+
for (const arg of args) {
|
|
56
|
+
if (arg.kind === RVKind.Array) {
|
|
57
|
+
for (const row of arg.rows) {
|
|
58
|
+
for (const cell of row) {
|
|
59
|
+
if (cell.kind === RVKind.Error) {
|
|
60
|
+
result.push(cell);
|
|
61
|
+
}
|
|
62
|
+
else if (cell.kind === RVKind.Number) {
|
|
63
|
+
result.push(cell);
|
|
64
|
+
}
|
|
65
|
+
// Skip booleans, strings, blanks in array context (Excel behavior).
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else if (arg.kind === RVKind.Error) {
|
|
70
|
+
result.push(arg);
|
|
71
|
+
}
|
|
72
|
+
else if (arg.kind !== RVKind.Blank) {
|
|
73
|
+
result.push(toNumberRV(arg));
|
|
74
|
+
}
|
|
75
|
+
// Skip blanks for direct scalar args.
|
|
76
|
+
}
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Flatten all cells from the arguments into a flat list of ScalarValue,
|
|
81
|
+
* preserving every cell (including blanks, errors, booleans, strings).
|
|
82
|
+
* Direct scalar arguments are projected via `topLeft`.
|
|
83
|
+
*/
|
|
84
|
+
export function flattenAll(args) {
|
|
85
|
+
const result = [];
|
|
86
|
+
for (const arg of args) {
|
|
87
|
+
if (arg.kind === RVKind.Array) {
|
|
88
|
+
for (const row of arg.rows) {
|
|
89
|
+
for (const cell of row) {
|
|
90
|
+
result.push(cell);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
result.push(topLeft(arg));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Return the first `ErrorValue` in a list of `NumberValue | ErrorValue`,
|
|
102
|
+
* or `null` if none is present.
|
|
103
|
+
*/
|
|
104
|
+
export function firstError(values) {
|
|
105
|
+
for (const v of values) {
|
|
106
|
+
if (v.kind === RVKind.Error) {
|
|
107
|
+
return v;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
// ============================================================================
|
|
113
|
+
// Array helpers
|
|
114
|
+
// ============================================================================
|
|
115
|
+
/**
|
|
116
|
+
* Narrow a RuntimeValue to an ArrayValue, returning `null` if it is not an
|
|
117
|
+
* array. Used by conditional / database / lookup / dynamic-array families.
|
|
118
|
+
*/
|
|
119
|
+
export function asArray(v) {
|
|
120
|
+
return v.kind === RVKind.Array ? v : null;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Safe cell accessor for ArrayValue — returns `BLANK` for out-of-bounds (r, c).
|
|
124
|
+
*/
|
|
125
|
+
export function getCell(arr, r, c) {
|
|
126
|
+
if (r < arr.height && c < arr.width) {
|
|
127
|
+
return arr.rows[r][c];
|
|
128
|
+
}
|
|
129
|
+
return BLANK;
|
|
130
|
+
}
|
|
131
|
+
// ============================================================================
|
|
132
|
+
// Excel wildcard helpers
|
|
133
|
+
// ============================================================================
|
|
134
|
+
/**
|
|
135
|
+
* Return `true` if `s` contains an unescaped `*` or `?`. Excel uses `~` as
|
|
136
|
+
* the escape character, so `~*` and `~?` are literals while `*` and `?` at
|
|
137
|
+
* any other position are wildcards. `~~` is an escaped tilde.
|
|
138
|
+
*
|
|
139
|
+
* Centralised here so every wildcard-consuming function (SEARCH, MATCH,
|
|
140
|
+
* XLOOKUP, SUMIF/COUNTIF/…) agrees on whether a criterion should trigger
|
|
141
|
+
* the wildcard code path.
|
|
142
|
+
*/
|
|
143
|
+
export function hasUnescapedWildcard(s) {
|
|
144
|
+
for (let i = 0; i < s.length; i++) {
|
|
145
|
+
const ch = s[i];
|
|
146
|
+
if (ch === "~" && i + 1 < s.length) {
|
|
147
|
+
i++; // skip the escaped char
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (ch === "*" || ch === "?") {
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
/** Escape a single character for use in a regex literal. */
|
|
157
|
+
function regexEscapeChar(ch) {
|
|
158
|
+
return /[.*+^${}()|[\]\\?]/.test(ch) ? "\\" + ch : ch;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Convert an Excel wildcard pattern to a JavaScript regex source. Rules:
|
|
162
|
+
* `*` → `.*`
|
|
163
|
+
* `?` → `.`
|
|
164
|
+
* `~*` → literal `*`
|
|
165
|
+
* `~?` → literal `?`
|
|
166
|
+
* `~~` → literal `~`
|
|
167
|
+
* `~x` → literal `x` (any other character after `~` is treated literally,
|
|
168
|
+
* matching Excel's tolerant behaviour)
|
|
169
|
+
* everything else → regex-escaped literal
|
|
170
|
+
*
|
|
171
|
+
* Callers typically wrap the result in `^…$` and use the `i` flag for
|
|
172
|
+
* case-insensitive matching.
|
|
173
|
+
*/
|
|
174
|
+
export function excelWildcardToRegex(s) {
|
|
175
|
+
let out = "";
|
|
176
|
+
for (let i = 0; i < s.length; i++) {
|
|
177
|
+
const ch = s[i];
|
|
178
|
+
if (ch === "~" && i + 1 < s.length) {
|
|
179
|
+
out += regexEscapeChar(s[i + 1]);
|
|
180
|
+
i++;
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
if (ch === "*") {
|
|
184
|
+
out += ".*";
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
if (ch === "?") {
|
|
188
|
+
out += ".";
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
out += regexEscapeChar(ch);
|
|
192
|
+
}
|
|
193
|
+
return out;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Strip `~` escape characters from an Excel criteria string so the remaining
|
|
197
|
+
* text can be used for a literal comparison. `~*` → `*`, `~?` → `?`,
|
|
198
|
+
* `~~` → `~`, etc. Only used when the caller has already determined that the
|
|
199
|
+
* pattern contains no unescaped wildcards.
|
|
200
|
+
*/
|
|
201
|
+
export function unescapeExcelWildcard(s) {
|
|
202
|
+
let out = "";
|
|
203
|
+
for (let i = 0; i < s.length; i++) {
|
|
204
|
+
const ch = s[i];
|
|
205
|
+
if (ch === "~" && i + 1 < s.length) {
|
|
206
|
+
out += s[i + 1];
|
|
207
|
+
i++;
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
out += ch;
|
|
211
|
+
}
|
|
212
|
+
return out;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Replace every cell marked by the array's `subtotalMask` with BLANK so an
|
|
216
|
+
* outer SUBTOTAL/AGGREGATE call does not double-count the inner aggregate's
|
|
217
|
+
* result. Only ArrayValue args carrying a mask are rewritten; scalars and
|
|
218
|
+
* arrays without masks pass through unchanged.
|
|
219
|
+
*
|
|
220
|
+
* Excel behavior: SUBTOTAL and AGGREGATE deliberately skip any cell whose
|
|
221
|
+
* own formula is itself SUBTOTAL or AGGREGATE — this is how the classic
|
|
222
|
+
* "totals row inside a filtered range" case works without double-counting.
|
|
223
|
+
*/
|
|
224
|
+
export function stripSubtotalMaskedCells(args) {
|
|
225
|
+
let needsCopy = false;
|
|
226
|
+
for (const arg of args) {
|
|
227
|
+
if (arg.kind === RVKind.Array && arg.subtotalMask) {
|
|
228
|
+
needsCopy = true;
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (!needsCopy) {
|
|
233
|
+
return args;
|
|
234
|
+
}
|
|
235
|
+
const out = [];
|
|
236
|
+
for (const arg of args) {
|
|
237
|
+
if (arg.kind !== RVKind.Array || !arg.subtotalMask) {
|
|
238
|
+
out.push(arg);
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
const mask = arg.subtotalMask;
|
|
242
|
+
const newRows = [];
|
|
243
|
+
for (let r = 0; r < arg.height; r++) {
|
|
244
|
+
const srcRow = arg.rows[r];
|
|
245
|
+
const maskRow = mask[r];
|
|
246
|
+
const newRow = new Array(arg.width);
|
|
247
|
+
for (let c = 0; c < arg.width; c++) {
|
|
248
|
+
newRow[c] = maskRow?.[c] ? BLANK : srcRow[c];
|
|
249
|
+
}
|
|
250
|
+
newRows.push(newRow);
|
|
251
|
+
}
|
|
252
|
+
// Drop the mask on the rewritten array — masked cells are already BLANK.
|
|
253
|
+
// Preserve hiddenRowMask so downstream SUBTOTAL 1xx / AGGREGATE opt
|
|
254
|
+
// 5/7 handling still applies to rows whose visibility was recorded.
|
|
255
|
+
out.push({
|
|
256
|
+
kind: RVKind.Array,
|
|
257
|
+
rows: newRows,
|
|
258
|
+
height: arg.height,
|
|
259
|
+
width: arg.width,
|
|
260
|
+
...(arg.originRow !== undefined
|
|
261
|
+
? { originRow: arg.originRow, originCol: arg.originCol }
|
|
262
|
+
: {}),
|
|
263
|
+
...(arg.hiddenRowMask ? { hiddenRowMask: arg.hiddenRowMask } : {})
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
return out;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Replace every cell in a hidden row with BLANK so aggregate functions
|
|
270
|
+
* drop them during flattening. Callers: SUBTOTAL's 1xx-variant codes
|
|
271
|
+
* (101-111) and AGGREGATE with option 5 or 7.
|
|
272
|
+
*
|
|
273
|
+
* Only ArrayValue args carrying a hiddenRowMask are rewritten.
|
|
274
|
+
*/
|
|
275
|
+
export function stripHiddenRowCells(args) {
|
|
276
|
+
let needsCopy = false;
|
|
277
|
+
for (const arg of args) {
|
|
278
|
+
if (arg.kind === RVKind.Array && arg.hiddenRowMask) {
|
|
279
|
+
needsCopy = true;
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
if (!needsCopy) {
|
|
284
|
+
return args;
|
|
285
|
+
}
|
|
286
|
+
const out = [];
|
|
287
|
+
for (const arg of args) {
|
|
288
|
+
if (arg.kind !== RVKind.Array || !arg.hiddenRowMask) {
|
|
289
|
+
out.push(arg);
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
const mask = arg.hiddenRowMask;
|
|
293
|
+
const newRows = [];
|
|
294
|
+
for (let r = 0; r < arg.height; r++) {
|
|
295
|
+
if (mask[r]) {
|
|
296
|
+
const blankRow = new Array(arg.width).fill(BLANK);
|
|
297
|
+
newRows.push(blankRow);
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
newRows.push(arg.rows[r].slice());
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
// Drop hiddenRowMask on rewritten output; preserve subtotalMask if any.
|
|
304
|
+
out.push({
|
|
305
|
+
kind: RVKind.Array,
|
|
306
|
+
rows: newRows,
|
|
307
|
+
height: arg.height,
|
|
308
|
+
width: arg.width,
|
|
309
|
+
...(arg.originRow !== undefined
|
|
310
|
+
? { originRow: arg.originRow, originCol: arg.originCol }
|
|
311
|
+
: {}),
|
|
312
|
+
...(arg.subtotalMask ? { subtotalMask: arg.subtotalMask } : {})
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
return out;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Replace every error cell inside ArrayValue args with BLANK so
|
|
319
|
+
* aggregate functions simply skip them during flattening. Callers:
|
|
320
|
+
* AGGREGATE with option 2, 3, 6, or 7.
|
|
321
|
+
*
|
|
322
|
+
* Direct scalar error args are left alone — AGGREGATE's caller
|
|
323
|
+
* already passes them as scalars; our aggregators will surface them
|
|
324
|
+
* as-is, which matches Excel when a direct literal is an error.
|
|
325
|
+
*
|
|
326
|
+
* This is distinct from the standard error-propagation path: arrays
|
|
327
|
+
* that contain errors normally propagate those errors out of the
|
|
328
|
+
* aggregate. With option 2/3/6/7, errors inside the *arrays* are
|
|
329
|
+
* deliberately ignored.
|
|
330
|
+
*/
|
|
331
|
+
export function stripErrorCells(args) {
|
|
332
|
+
let needsCopy = false;
|
|
333
|
+
for (const arg of args) {
|
|
334
|
+
if (arg.kind === RVKind.Array) {
|
|
335
|
+
for (const row of arg.rows) {
|
|
336
|
+
for (const cell of row) {
|
|
337
|
+
if (cell.kind === RVKind.Error) {
|
|
338
|
+
needsCopy = true;
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
if (needsCopy) {
|
|
343
|
+
break;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
if (needsCopy) {
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
if (!needsCopy) {
|
|
352
|
+
return args;
|
|
353
|
+
}
|
|
354
|
+
const out = [];
|
|
355
|
+
for (const arg of args) {
|
|
356
|
+
if (arg.kind !== RVKind.Array) {
|
|
357
|
+
out.push(arg);
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
360
|
+
const newRows = [];
|
|
361
|
+
for (const srcRow of arg.rows) {
|
|
362
|
+
const newRow = new Array(srcRow.length);
|
|
363
|
+
for (let c = 0; c < srcRow.length; c++) {
|
|
364
|
+
newRow[c] = srcRow[c].kind === RVKind.Error ? BLANK : srcRow[c];
|
|
365
|
+
}
|
|
366
|
+
newRows.push(newRow);
|
|
367
|
+
}
|
|
368
|
+
out.push({
|
|
369
|
+
kind: RVKind.Array,
|
|
370
|
+
rows: newRows,
|
|
371
|
+
height: arg.height,
|
|
372
|
+
width: arg.width,
|
|
373
|
+
...(arg.originRow !== undefined
|
|
374
|
+
? { originRow: arg.originRow, originCol: arg.originCol }
|
|
375
|
+
: {}),
|
|
376
|
+
...(arg.subtotalMask ? { subtotalMask: arg.subtotalMask } : {}),
|
|
377
|
+
...(arg.hiddenRowMask ? { hiddenRowMask: arg.hiddenRowMask } : {})
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
return out;
|
|
381
|
+
}
|