@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
|
@@ -39,6 +39,60 @@ function getEffectiveCellType(cell) {
|
|
|
39
39
|
return cell.type;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Extract the display form of a hyperlink cell value that came either from
|
|
44
|
+
* a shared-string rich-text payload (`{ richText: [...] }`) or from a
|
|
45
|
+
* plain scalar.
|
|
46
|
+
*
|
|
47
|
+
* Input comes from the XML parser (`raw: unknown`), so every nested value is
|
|
48
|
+
* treated defensively — the public `RichText` shape is only produced after
|
|
49
|
+
* runtime validation, never asserted.
|
|
50
|
+
*
|
|
51
|
+
* Returns:
|
|
52
|
+
* - `text`: always a string (flattened rich-text or `String(raw)`)
|
|
53
|
+
* - `richText`: preserved if the source was a rich-text payload, else undefined
|
|
54
|
+
*
|
|
55
|
+
* This keeps the CellHyperlinkValue.text: string public contract intact while
|
|
56
|
+
* also letting the Hyperlink value class retain the formatted runs
|
|
57
|
+
* (see https://github.com/cjnoname/excelts/issues/142).
|
|
58
|
+
*/
|
|
59
|
+
function extractHyperlinkDisplay(raw) {
|
|
60
|
+
if (raw === null || raw === undefined) {
|
|
61
|
+
return { text: "" };
|
|
62
|
+
}
|
|
63
|
+
if (typeof raw === "string") {
|
|
64
|
+
return { text: raw };
|
|
65
|
+
}
|
|
66
|
+
if (typeof raw === "number" || typeof raw === "boolean") {
|
|
67
|
+
return { text: String(raw) };
|
|
68
|
+
}
|
|
69
|
+
if (typeof raw === "object") {
|
|
70
|
+
const obj = raw;
|
|
71
|
+
if (Array.isArray(obj.richText)) {
|
|
72
|
+
// Empty runs array carries no content — emit empty display text rather
|
|
73
|
+
// than falling through to `String(raw)` which would produce
|
|
74
|
+
// "[object Object]".
|
|
75
|
+
if (obj.richText.length === 0) {
|
|
76
|
+
return { text: "" };
|
|
77
|
+
}
|
|
78
|
+
const runs = obj.richText.map(rawRun => {
|
|
79
|
+
const run = rawRun;
|
|
80
|
+
const normalized = {
|
|
81
|
+
text: typeof run?.text === "string" ? run.text : ""
|
|
82
|
+
};
|
|
83
|
+
if (run?.font !== null && typeof run?.font === "object") {
|
|
84
|
+
normalized.font = run.font;
|
|
85
|
+
}
|
|
86
|
+
return normalized;
|
|
87
|
+
});
|
|
88
|
+
return { text: runs.map(r => r.text).join(""), richText: runs };
|
|
89
|
+
}
|
|
90
|
+
if (typeof obj.error === "string") {
|
|
91
|
+
return { text: obj.error };
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return { text: String(raw) };
|
|
95
|
+
}
|
|
42
96
|
class CellXform extends BaseXform {
|
|
43
97
|
constructor() {
|
|
44
98
|
super();
|
|
@@ -68,8 +122,15 @@ class CellXform extends BaseXform {
|
|
|
68
122
|
}
|
|
69
123
|
break;
|
|
70
124
|
case Enums.ValueType.Hyperlink:
|
|
71
|
-
if (options.sharedStrings
|
|
72
|
-
|
|
125
|
+
if (options.sharedStrings) {
|
|
126
|
+
// Prefer rich-text payload when present so formatted display
|
|
127
|
+
// survives a write. Fall back to plain text otherwise.
|
|
128
|
+
if (Array.isArray(model.richText) && model.richText.length > 0) {
|
|
129
|
+
model.ssId = options.sharedStrings.add({ richText: model.richText });
|
|
130
|
+
}
|
|
131
|
+
else if (model.text !== undefined && model.text !== null) {
|
|
132
|
+
model.ssId = options.sharedStrings.add(model.text);
|
|
133
|
+
}
|
|
73
134
|
}
|
|
74
135
|
options.hyperlinks.push({
|
|
75
136
|
address: model.address,
|
|
@@ -85,6 +146,22 @@ class CellXform extends BaseXform {
|
|
|
85
146
|
// in case valueType is date
|
|
86
147
|
model.date1904 = true;
|
|
87
148
|
}
|
|
149
|
+
// Convert isDynamicArray flag to cm attribute for XML rendering.
|
|
150
|
+
// All dynamic array cells share cm=1 pointing to a single XLDAPR metadata record.
|
|
151
|
+
if (model.isDynamicArray) {
|
|
152
|
+
model.cm = 1;
|
|
153
|
+
}
|
|
154
|
+
// A formula cell may also carry an attached hyperlink (e.g. when the
|
|
155
|
+
// model came from another writer or was constructed without going
|
|
156
|
+
// through the load-side reconcile that promotes type=Formula to
|
|
157
|
+
// type=Hyperlink). Re-emit the <hyperlink> element so it survives.
|
|
158
|
+
if (model.hyperlink) {
|
|
159
|
+
options.hyperlinks.push({
|
|
160
|
+
address: model.address,
|
|
161
|
+
target: model.hyperlink,
|
|
162
|
+
tooltip: model.tooltip
|
|
163
|
+
});
|
|
164
|
+
}
|
|
88
165
|
if (model.shareType === "shared") {
|
|
89
166
|
model.si = options.siFormulae++;
|
|
90
167
|
}
|
|
@@ -180,6 +257,10 @@ class CellXform extends BaseXform {
|
|
|
180
257
|
if (model.styleId) {
|
|
181
258
|
xmlStream.addAttribute("s", model.styleId);
|
|
182
259
|
}
|
|
260
|
+
// Dynamic array formulas require the cm attribute linking to xl/metadata.xml
|
|
261
|
+
if (model.cm) {
|
|
262
|
+
xmlStream.addAttribute("cm", model.cm);
|
|
263
|
+
}
|
|
183
264
|
switch (model.type) {
|
|
184
265
|
case Enums.ValueType.Null:
|
|
185
266
|
break;
|
|
@@ -222,10 +303,28 @@ class CellXform extends BaseXform {
|
|
|
222
303
|
xmlStream.leafNode("v", null, dateToExcel(model.value, model.date1904));
|
|
223
304
|
break;
|
|
224
305
|
case Enums.ValueType.Hyperlink:
|
|
225
|
-
|
|
306
|
+
// A hyperlink cell may also carry a formula (loaded from XLSX where
|
|
307
|
+
// a `<hyperlink>` entry shares its address with a formula `<c>`).
|
|
308
|
+
// Render the formula in that case so the underlying expression
|
|
309
|
+
// survives the round-trip; the <hyperlink> element is emitted
|
|
310
|
+
// separately via options.hyperlinks (collected in prepare).
|
|
311
|
+
if (model.formula || model.sharedFormula) {
|
|
312
|
+
this.renderFormula(xmlStream, model);
|
|
313
|
+
}
|
|
314
|
+
else if (model.ssId !== undefined) {
|
|
226
315
|
xmlStream.addAttribute("t", "s");
|
|
227
316
|
xmlStream.leafNode("v", null, model.ssId);
|
|
228
317
|
}
|
|
318
|
+
else if (Array.isArray(model.richText) && model.richText.length > 0) {
|
|
319
|
+
// Inline rich-text representation — used when shared strings are
|
|
320
|
+
// disabled (some streaming configurations).
|
|
321
|
+
xmlStream.addAttribute("t", "inlineStr");
|
|
322
|
+
xmlStream.openNode("is");
|
|
323
|
+
model.richText.forEach(text => {
|
|
324
|
+
this.richTextXform.render(xmlStream, text);
|
|
325
|
+
});
|
|
326
|
+
xmlStream.closeNode("is");
|
|
327
|
+
}
|
|
229
328
|
else {
|
|
230
329
|
xmlStream.addAttribute("t", "str");
|
|
231
330
|
xmlStream.leafNode("v", null, model.text);
|
|
@@ -257,6 +356,9 @@ class CellXform extends BaseXform {
|
|
|
257
356
|
if (node.attributes.s) {
|
|
258
357
|
this.model.styleId = parseInt(node.attributes.s, 10);
|
|
259
358
|
}
|
|
359
|
+
if (node.attributes.cm) {
|
|
360
|
+
this.model.cm = parseInt(node.attributes.cm, 10);
|
|
361
|
+
}
|
|
260
362
|
return true;
|
|
261
363
|
case "f":
|
|
262
364
|
this.currentNode = "f";
|
|
@@ -386,6 +488,9 @@ class CellXform extends BaseXform {
|
|
|
386
488
|
case "r":
|
|
387
489
|
this.model.value = this.model.value || {};
|
|
388
490
|
this.model.value.richText = this.model.value.richText ?? [];
|
|
491
|
+
// `this.parser` is guaranteed by parseOpen("r"), which instantiates
|
|
492
|
+
// a RichTextXform. A missing parser here means malformed XML that
|
|
493
|
+
// should surface as a parse error rather than silently swallow.
|
|
389
494
|
this.model.value.richText.push(this.parser.model);
|
|
390
495
|
this.parser = undefined;
|
|
391
496
|
this.currentNode = undefined;
|
|
@@ -409,11 +514,28 @@ class CellXform extends BaseXform {
|
|
|
409
514
|
switch (model.type) {
|
|
410
515
|
case Enums.ValueType.String:
|
|
411
516
|
if (typeof model.value === "number") {
|
|
517
|
+
// A numeric value on a String-typed cell is a sharedStrings index
|
|
518
|
+
// (originated from t="s" in parseClose).
|
|
519
|
+
//
|
|
520
|
+
// Two malformed-file cases to consider:
|
|
521
|
+
// 1. sharedStrings table missing entirely — degrade gracefully
|
|
522
|
+
// (consistent with the "missing-bits.xlsx" graceful-loading
|
|
523
|
+
// contract); leave value as the raw index so worksheets still
|
|
524
|
+
// load.
|
|
525
|
+
// 2. sharedStrings table present but the specific index is out of
|
|
526
|
+
// range — this is the case that previously crashed with
|
|
527
|
+
// `TypeError: cannot access property "richText"`. Fail loudly
|
|
528
|
+
// with a typed ExcelError so callers get file-corruption
|
|
529
|
+
// context.
|
|
412
530
|
if (options.sharedStrings) {
|
|
413
|
-
|
|
531
|
+
const ssIndex = model.value;
|
|
532
|
+
model.value = options.sharedStrings.getString(ssIndex);
|
|
533
|
+
if (model.value === undefined) {
|
|
534
|
+
throw new ExcelError(`Invalid shared string index ${ssIndex} in cell ${model.address}: the xlsx file appears to be corrupted`);
|
|
535
|
+
}
|
|
414
536
|
}
|
|
415
537
|
}
|
|
416
|
-
if (model.value.richText) {
|
|
538
|
+
if (model.value && model.value.richText) {
|
|
417
539
|
model.type = Enums.ValueType.RichText;
|
|
418
540
|
}
|
|
419
541
|
break;
|
|
@@ -444,6 +566,24 @@ class CellXform extends BaseXform {
|
|
|
444
566
|
}
|
|
445
567
|
delete model.si;
|
|
446
568
|
}
|
|
569
|
+
// Convert cm metadata index into isDynamicArray flag.
|
|
570
|
+
// The cm attribute (1-indexed) links to a cellMetadata record in
|
|
571
|
+
// xl/metadata.xml. We use the precise dynamicArrayCmIndices set
|
|
572
|
+
// (built by MetadataXform) to check whether this specific cm value
|
|
573
|
+
// maps to an XLDAPR metadataType. Falls back to the coarser
|
|
574
|
+
// hasDynamicArrayMetadata boolean for backwards compatibility.
|
|
575
|
+
// We strip cm from the model — it will be reassigned during write prepare.
|
|
576
|
+
if (model.cm) {
|
|
577
|
+
if (options.dynamicArrayCmIndices) {
|
|
578
|
+
if (options.dynamicArrayCmIndices.has(model.cm)) {
|
|
579
|
+
model.isDynamicArray = true;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
else if (options.hasDynamicArrayMetadata) {
|
|
583
|
+
model.isDynamicArray = true;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
delete model.cm;
|
|
447
587
|
break;
|
|
448
588
|
default:
|
|
449
589
|
break;
|
|
@@ -451,14 +591,32 @@ class CellXform extends BaseXform {
|
|
|
451
591
|
// look for hyperlink
|
|
452
592
|
const hyperlink = options.hyperlinkMap[model.address];
|
|
453
593
|
if (hyperlink) {
|
|
594
|
+
// CellHyperlinkValue.text is typed as string; if the shared-string
|
|
595
|
+
// resolution produced a rich-text payload ({ richText: [...] }) we must
|
|
596
|
+
// flatten it for `text` AND preserve the runs on `richText` so formatted
|
|
597
|
+
// display survives round-trip. (See issue #142.)
|
|
598
|
+
let source;
|
|
454
599
|
if (model.type === Enums.ValueType.Formula) {
|
|
455
|
-
|
|
456
|
-
model.
|
|
600
|
+
// Formula + hyperlink: surface as a Hyperlink cell whose display is
|
|
601
|
+
// the formula's evaluated result, but keep `model.formula` (and the
|
|
602
|
+
// original result) on the model so write-time can re-emit both the
|
|
603
|
+
// formula <c> and the <hyperlink> entry. The cell value layer ignores
|
|
604
|
+
// unknown model fields, so the public Hyperlink shape stays clean
|
|
605
|
+
// while round-trip data is preserved internally.
|
|
606
|
+
source = model.result;
|
|
457
607
|
}
|
|
458
608
|
else {
|
|
459
|
-
|
|
609
|
+
source = model.value;
|
|
460
610
|
model.value = undefined;
|
|
461
611
|
}
|
|
612
|
+
const display = extractHyperlinkDisplay(source);
|
|
613
|
+
model.text = display.text;
|
|
614
|
+
if (display.richText) {
|
|
615
|
+
model.richText = display.richText;
|
|
616
|
+
}
|
|
617
|
+
else {
|
|
618
|
+
delete model.richText;
|
|
619
|
+
}
|
|
462
620
|
model.type = Enums.ValueType.Hyperlink;
|
|
463
621
|
model.hyperlink = hyperlink;
|
|
464
622
|
}
|
|
@@ -57,7 +57,7 @@ function optimiseDataValidations(model) {
|
|
|
57
57
|
dataValidation,
|
|
58
58
|
marked: false
|
|
59
59
|
}))
|
|
60
|
-
.sort((a, b) => a.address
|
|
60
|
+
.sort((a, b) => colCache.compareAddress(a.address, b.address));
|
|
61
61
|
const dvMap = Object.fromEntries(dvList.map(dv => [dv.address, dv]));
|
|
62
62
|
const matchCol = (addr, height, col) => {
|
|
63
63
|
for (let i = 0; i < height; i++) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IgnoredError } from "../../../types.js";
|
|
2
|
+
import { BaseXform } from "../base-xform.js";
|
|
3
|
+
/**
|
|
4
|
+
* Xform for the <ignoredErrors> element in a worksheet.
|
|
5
|
+
*
|
|
6
|
+
* Renders:
|
|
7
|
+
* ```xml
|
|
8
|
+
* <ignoredErrors>
|
|
9
|
+
* <ignoredError sqref="A1:B10" numberStoredAsText="1" />
|
|
10
|
+
* </ignoredErrors>
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
declare class IgnoredErrorsXform extends BaseXform {
|
|
14
|
+
model: IgnoredError[];
|
|
15
|
+
get tag(): string;
|
|
16
|
+
render(xmlStream: any, model: IgnoredError[] | undefined): void;
|
|
17
|
+
parseOpen(node: any): boolean;
|
|
18
|
+
parseText(): void;
|
|
19
|
+
parseClose(name: string): boolean;
|
|
20
|
+
}
|
|
21
|
+
export { IgnoredErrorsXform };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { BaseXform } from "../base-xform.js";
|
|
2
|
+
/**
|
|
3
|
+
* Boolean attribute names supported on <ignoredError> elements.
|
|
4
|
+
* These correspond to the OOXML spec CT_IgnoredError attributes.
|
|
5
|
+
*/
|
|
6
|
+
const BOOL_ATTRS = [
|
|
7
|
+
"numberStoredAsText",
|
|
8
|
+
"formula",
|
|
9
|
+
"formulaRange",
|
|
10
|
+
"unlockedFormula",
|
|
11
|
+
"emptyCellReference",
|
|
12
|
+
"listDataValidation",
|
|
13
|
+
"calculatedColumn",
|
|
14
|
+
"evalError",
|
|
15
|
+
"twoDigitTextYear"
|
|
16
|
+
];
|
|
17
|
+
/**
|
|
18
|
+
* Xform for the <ignoredErrors> element in a worksheet.
|
|
19
|
+
*
|
|
20
|
+
* Renders:
|
|
21
|
+
* ```xml
|
|
22
|
+
* <ignoredErrors>
|
|
23
|
+
* <ignoredError sqref="A1:B10" numberStoredAsText="1" />
|
|
24
|
+
* </ignoredErrors>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
class IgnoredErrorsXform extends BaseXform {
|
|
28
|
+
get tag() {
|
|
29
|
+
return "ignoredErrors";
|
|
30
|
+
}
|
|
31
|
+
render(xmlStream, model) {
|
|
32
|
+
if (!model || model.length === 0) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
xmlStream.openNode("ignoredErrors");
|
|
36
|
+
for (const entry of model) {
|
|
37
|
+
const attrs = { sqref: entry.ref };
|
|
38
|
+
for (const attr of BOOL_ATTRS) {
|
|
39
|
+
if (entry[attr]) {
|
|
40
|
+
attrs[attr] = 1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
xmlStream.leafNode("ignoredError", attrs);
|
|
44
|
+
}
|
|
45
|
+
xmlStream.closeNode();
|
|
46
|
+
}
|
|
47
|
+
parseOpen(node) {
|
|
48
|
+
switch (node.name) {
|
|
49
|
+
case "ignoredErrors":
|
|
50
|
+
this.model = [];
|
|
51
|
+
return true;
|
|
52
|
+
case "ignoredError": {
|
|
53
|
+
const entry = {
|
|
54
|
+
ref: node.attributes.sqref ?? ""
|
|
55
|
+
};
|
|
56
|
+
for (const attr of BOOL_ATTRS) {
|
|
57
|
+
if (node.attributes[attr] === "1" || node.attributes[attr] === "true") {
|
|
58
|
+
entry[attr] = true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
this.model.push(entry);
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
default:
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
parseText() {
|
|
69
|
+
// no text content
|
|
70
|
+
}
|
|
71
|
+
parseClose(name) {
|
|
72
|
+
switch (name) {
|
|
73
|
+
case "ignoredErrors":
|
|
74
|
+
return false;
|
|
75
|
+
default:
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export { IgnoredErrorsXform };
|
|
@@ -14,6 +14,7 @@ import { DrawingXform } from "./drawing-xform.js";
|
|
|
14
14
|
import { ExtLstXform } from "./ext-lst-xform.js";
|
|
15
15
|
import { HeaderFooterXform } from "./header-footer-xform.js";
|
|
16
16
|
import { isInternalLink, HyperlinkXform } from "./hyperlink-xform.js";
|
|
17
|
+
import { IgnoredErrorsXform } from "./ignored-errors-xform.js";
|
|
17
18
|
import { MergeCellXform } from "./merge-cell-xform.js";
|
|
18
19
|
import { Merges } from "./merges.js";
|
|
19
20
|
import { PageMarginsXform } from "./page-margins-xform.js";
|
|
@@ -131,7 +132,8 @@ class WorkSheetXform extends BaseXform {
|
|
|
131
132
|
childXform: new TablePartXform()
|
|
132
133
|
}),
|
|
133
134
|
conditionalFormatting: new ConditionalFormattingsXform(),
|
|
134
|
-
extLst: new ExtLstXform()
|
|
135
|
+
extLst: new ExtLstXform(),
|
|
136
|
+
ignoredErrors: new IgnoredErrorsXform()
|
|
135
137
|
};
|
|
136
138
|
}
|
|
137
139
|
prepare(model, options) {
|
|
@@ -608,7 +610,9 @@ class WorkSheetXform extends BaseXform {
|
|
|
608
610
|
xmlStream.leafNode("mc:Fallback");
|
|
609
611
|
xmlStream.closeNode();
|
|
610
612
|
}
|
|
611
|
-
//
|
|
613
|
+
// ignoredErrors must come after controls, before tableParts (OOXML schema order).
|
|
614
|
+
this.map.ignoredErrors.render(xmlStream, model.ignoredErrors);
|
|
615
|
+
// tableParts must come after ignoredErrors.
|
|
612
616
|
this.map.tableParts.render(xmlStream, model.tables);
|
|
613
617
|
// extLst should be the last element in the worksheet.
|
|
614
618
|
this.map.extLst.render(xmlStream, model);
|
|
@@ -677,7 +681,8 @@ class WorkSheetXform extends BaseXform {
|
|
|
677
681
|
tables: this.map.tableParts.model,
|
|
678
682
|
conditionalFormattings,
|
|
679
683
|
rowBreaks: this.map.rowBreaks.model ?? [],
|
|
680
|
-
colBreaks: this.map.colBreaks.model ?? []
|
|
684
|
+
colBreaks: this.map.colBreaks.model ?? [],
|
|
685
|
+
ignoredErrors: this.map.ignoredErrors.model ?? []
|
|
681
686
|
};
|
|
682
687
|
if (this.map.autoFilter.model) {
|
|
683
688
|
this.model.autoFilter = this.map.autoFilter.model;
|
|
@@ -769,7 +774,7 @@ class WorkSheetXform extends BaseXform {
|
|
|
769
774
|
name: drawingName,
|
|
770
775
|
rels: options.drawingRels?.[drawingName] ?? drawing.rels ?? []
|
|
771
776
|
};
|
|
772
|
-
// Also extract images to model.media for backward compatibility
|
|
777
|
+
// Also extract images to model.media for backward compatibility.
|
|
773
778
|
drawing.anchors.forEach(anchor => {
|
|
774
779
|
if (anchor.medium) {
|
|
775
780
|
// Detect overlay watermarks: drawings that carry alphaModFix
|
|
@@ -167,13 +167,15 @@ class BorderXform extends BaseXform {
|
|
|
167
167
|
return true;
|
|
168
168
|
}
|
|
169
169
|
if (name === "border") {
|
|
170
|
-
const model =
|
|
170
|
+
const model = {};
|
|
171
|
+
let hasContent = false;
|
|
171
172
|
const add = (key, edgeModel, extensions) => {
|
|
172
173
|
if (edgeModel) {
|
|
173
174
|
if (extensions) {
|
|
174
175
|
Object.assign(edgeModel, extensions);
|
|
175
176
|
}
|
|
176
177
|
model[key] = edgeModel;
|
|
178
|
+
hasContent = true;
|
|
177
179
|
}
|
|
178
180
|
};
|
|
179
181
|
add("left", this.map.left.model);
|
|
@@ -181,6 +183,7 @@ class BorderXform extends BaseXform {
|
|
|
181
183
|
add("top", this.map.top.model);
|
|
182
184
|
add("bottom", this.map.bottom.model);
|
|
183
185
|
add("diagonal", this.map.diagonal.model, { up: this.diagonalUp, down: this.diagonalDown });
|
|
186
|
+
this.model = hasContent ? model : undefined;
|
|
184
187
|
}
|
|
185
188
|
return false;
|
|
186
189
|
}
|