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