@rowsncolumns/spreadsheet-state 28.0.75 → 29.0.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/dist/cjs/api/anchored-objects.d.ts +66 -0
- package/dist/cjs/api/anchored-objects.d.ts.map +1 -0
- package/dist/cjs/api/anchored-objects.js +259 -0
- package/dist/cjs/api/copy-paste.d.ts +8 -1
- package/dist/cjs/api/copy-paste.d.ts.map +1 -1
- package/dist/cjs/api/copy-paste.js +4 -2
- package/dist/cjs/api/dependency.d.ts +13 -2
- package/dist/cjs/api/dependency.d.ts.map +1 -1
- package/dist/cjs/api/dependency.js +11 -5
- package/dist/cjs/api/formula.d.ts +61 -4
- package/dist/cjs/api/formula.d.ts.map +1 -1
- package/dist/cjs/api/formula.js +250 -61
- package/dist/cjs/api/immer-utils.d.ts +11 -1
- package/dist/cjs/api/immer-utils.d.ts.map +1 -1
- package/dist/cjs/api/immer-utils.js +17 -1
- package/dist/cjs/api/insert-cut-cells.d.ts +35 -0
- package/dist/cjs/api/insert-cut-cells.d.ts.map +1 -0
- package/dist/cjs/api/insert-cut-cells.js +60 -0
- package/dist/cjs/api/merges.d.ts +16 -0
- package/dist/cjs/api/merges.d.ts.map +1 -1
- package/dist/cjs/api/merges.js +75 -1
- package/dist/cjs/api/named-range-structural.d.ts +62 -0
- package/dist/cjs/api/named-range-structural.d.ts.map +1 -0
- package/dist/cjs/api/named-range-structural.js +197 -0
- package/dist/cjs/api/range-rule-helpers.d.ts +45 -1
- package/dist/cjs/api/range-rule-helpers.d.ts.map +1 -1
- package/dist/cjs/api/range-rule-helpers.js +159 -6
- package/dist/cjs/api/structural-formula-update.d.ts.map +1 -1
- package/dist/cjs/api/structural-formula-update.js +24 -6
- package/dist/cjs/api/structural-guards.d.ts +78 -0
- package/dist/cjs/api/structural-guards.d.ts.map +1 -0
- package/dist/cjs/api/structural-guards.js +202 -0
- package/dist/cjs/api/structural-table-refs.d.ts +94 -0
- package/dist/cjs/api/structural-table-refs.d.ts.map +1 -0
- package/dist/cjs/api/structural-table-refs.js +313 -0
- package/dist/cjs/api/subtotal.d.ts +20 -13
- package/dist/cjs/api/subtotal.d.ts.map +1 -1
- package/dist/cjs/api/subtotal.js +26 -19
- package/dist/cjs/commands.d.ts +9 -0
- package/dist/cjs/commands.d.ts.map +1 -1
- package/dist/cjs/constants.d.ts +25 -0
- package/dist/cjs/constants.d.ts.map +1 -0
- package/dist/cjs/constants.js +26 -0
- package/dist/cjs/hooks/use-calculation-worker.d.ts.map +1 -1
- package/dist/cjs/hooks/use-calculation-worker.js +64 -6
- package/dist/cjs/hooks/use-calculation.d.ts +7 -0
- package/dist/cjs/hooks/use-calculation.d.ts.map +1 -1
- package/dist/cjs/hooks/use-calculation.js +15 -0
- package/dist/cjs/hooks/use-on-calculation-success.d.ts +7 -0
- package/dist/cjs/hooks/use-on-calculation-success.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-calculation-success.js +7 -1
- package/dist/cjs/hooks/use-on-copy.d.ts +1 -1
- package/dist/cjs/hooks/use-on-copy.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-copy.js +2 -3
- package/dist/cjs/hooks/use-on-delete-cells-shift-left.d.ts +13 -3
- package/dist/cjs/hooks/use-on-delete-cells-shift-left.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-delete-cells-shift-left.js +27 -2
- package/dist/cjs/hooks/use-on-delete-cells-shift-up.d.ts +13 -3
- package/dist/cjs/hooks/use-on-delete-cells-shift-up.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-delete-cells-shift-up.js +27 -2
- package/dist/cjs/hooks/use-on-delete-column.d.ts +13 -4
- package/dist/cjs/hooks/use-on-delete-column.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-delete-column.js +14 -2
- package/dist/cjs/hooks/use-on-delete-row.d.ts +13 -4
- package/dist/cjs/hooks/use-on-delete-row.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-delete-row.js +14 -2
- package/dist/cjs/hooks/use-on-insert-cells-shift-down.d.ts +13 -3
- package/dist/cjs/hooks/use-on-insert-cells-shift-down.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-insert-cells-shift-down.js +27 -2
- package/dist/cjs/hooks/use-on-insert-cells-shift-right.d.ts +13 -3
- package/dist/cjs/hooks/use-on-insert-cells-shift-right.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-insert-cells-shift-right.js +27 -2
- package/dist/cjs/hooks/use-on-insert-column.d.ts +10 -3
- package/dist/cjs/hooks/use-on-insert-column.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-insert-column.js +33 -7
- package/dist/cjs/hooks/use-on-insert-row.d.ts +10 -3
- package/dist/cjs/hooks/use-on-insert-row.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-insert-row.js +32 -7
- package/dist/cjs/hooks/use-on-move-columns.d.ts +2 -1
- package/dist/cjs/hooks/use-on-move-columns.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-move-columns.js +14 -5
- package/dist/cjs/hooks/use-on-move-rows.d.ts +16 -1
- package/dist/cjs/hooks/use-on-move-rows.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-move-rows.js +30 -5
- package/dist/cjs/hooks/use-on-move-selection.d.ts +7 -2
- package/dist/cjs/hooks/use-on-move-selection.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-move-selection.js +14 -1
- package/dist/cjs/hooks/use-on-paste.d.ts +12 -2
- package/dist/cjs/hooks/use-on-paste.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-paste.js +56 -8
- package/dist/cjs/hooks/use-spreadsheet-state.d.ts +16 -5
- package/dist/cjs/hooks/use-spreadsheet-state.d.ts.map +1 -1
- package/dist/cjs/hooks/use-spreadsheet-state.js +141 -18
- package/dist/cjs/hooks/use-structured-reference.d.ts.map +1 -1
- package/dist/cjs/hooks/use-structured-reference.js +10 -6
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/interface/calculation-interface.d.ts +9 -0
- package/dist/cjs/interface/calculation-interface.d.ts.map +1 -1
- package/dist/cjs/interface/calculation-interface.js +31 -2
- package/dist/cjs/interface/delete-cells-shift-left.d.ts +8 -1
- package/dist/cjs/interface/delete-cells-shift-left.d.ts.map +1 -1
- package/dist/cjs/interface/delete-cells-shift-left.js +158 -80
- package/dist/cjs/interface/delete-cells-shift-up.d.ts +9 -1
- package/dist/cjs/interface/delete-cells-shift-up.d.ts.map +1 -1
- package/dist/cjs/interface/delete-cells-shift-up.js +155 -73
- package/dist/cjs/interface/delete-column.d.ts +1 -1
- package/dist/cjs/interface/delete-column.d.ts.map +1 -1
- package/dist/cjs/interface/delete-column.js +109 -50
- package/dist/cjs/interface/delete-row.d.ts +1 -1
- package/dist/cjs/interface/delete-row.d.ts.map +1 -1
- package/dist/cjs/interface/delete-row.js +105 -46
- package/dist/cjs/interface/insert-cells-shift-down.d.ts +10 -1
- package/dist/cjs/interface/insert-cells-shift-down.d.ts.map +1 -1
- package/dist/cjs/interface/insert-cells-shift-down.js +147 -52
- package/dist/cjs/interface/insert-cells-shift-right.d.ts +10 -1
- package/dist/cjs/interface/insert-cells-shift-right.d.ts.map +1 -1
- package/dist/cjs/interface/insert-cells-shift-right.js +154 -58
- package/dist/cjs/interface/insert-column.d.ts +1 -1
- package/dist/cjs/interface/insert-column.d.ts.map +1 -1
- package/dist/cjs/interface/insert-column.js +80 -26
- package/dist/cjs/interface/insert-row.d.ts +1 -1
- package/dist/cjs/interface/insert-row.d.ts.map +1 -1
- package/dist/cjs/interface/insert-row.js +63 -15
- package/dist/cjs/interface/spreadsheet-interface.d.ts.map +1 -1
- package/dist/cjs/interface/spreadsheet-interface.js +33 -0
- package/dist/cjs/sheet-cell.d.ts.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/api/anchored-objects.d.ts +66 -0
- package/dist/esm/api/anchored-objects.d.ts.map +1 -0
- package/dist/esm/api/anchored-objects.js +212 -0
- package/dist/esm/api/copy-paste.d.ts +8 -1
- package/dist/esm/api/copy-paste.d.ts.map +1 -1
- package/dist/esm/api/copy-paste.js +4 -2
- package/dist/esm/api/dependency.d.ts +13 -2
- package/dist/esm/api/dependency.d.ts.map +1 -1
- package/dist/esm/api/dependency.js +10 -4
- package/dist/esm/api/formula.d.ts +61 -4
- package/dist/esm/api/formula.d.ts.map +1 -1
- package/dist/esm/api/formula.js +238 -60
- package/dist/esm/api/immer-utils.d.ts +11 -1
- package/dist/esm/api/immer-utils.d.ts.map +1 -1
- package/dist/esm/api/immer-utils.js +16 -0
- package/dist/esm/api/insert-cut-cells.d.ts +35 -0
- package/dist/esm/api/insert-cut-cells.d.ts.map +1 -0
- package/dist/esm/api/insert-cut-cells.js +67 -0
- package/dist/esm/api/merges.d.ts +16 -0
- package/dist/esm/api/merges.d.ts.map +1 -1
- package/dist/esm/api/merges.js +60 -0
- package/dist/esm/api/named-range-structural.d.ts +62 -0
- package/dist/esm/api/named-range-structural.d.ts.map +1 -0
- package/dist/esm/api/named-range-structural.js +176 -0
- package/dist/esm/api/range-rule-helpers.d.ts +45 -1
- package/dist/esm/api/range-rule-helpers.d.ts.map +1 -1
- package/dist/esm/api/range-rule-helpers.js +153 -1
- package/dist/esm/api/structural-formula-update.d.ts.map +1 -1
- package/dist/esm/api/structural-formula-update.js +24 -6
- package/dist/esm/api/structural-guards.d.ts +78 -0
- package/dist/esm/api/structural-guards.d.ts.map +1 -0
- package/dist/esm/api/structural-guards.js +186 -0
- package/dist/esm/api/structural-table-refs.d.ts +94 -0
- package/dist/esm/api/structural-table-refs.d.ts.map +1 -0
- package/dist/esm/api/structural-table-refs.js +219 -0
- package/dist/esm/api/subtotal.d.ts +20 -13
- package/dist/esm/api/subtotal.d.ts.map +1 -1
- package/dist/esm/api/subtotal.js +15 -8
- package/dist/esm/commands.d.ts +9 -0
- package/dist/esm/commands.d.ts.map +1 -1
- package/dist/esm/constants.d.ts +25 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +26 -0
- package/dist/esm/hooks/use-calculation-worker.d.ts.map +1 -1
- package/dist/esm/hooks/use-calculation-worker.js +45 -0
- package/dist/esm/hooks/use-calculation.d.ts +7 -0
- package/dist/esm/hooks/use-calculation.d.ts.map +1 -1
- package/dist/esm/hooks/use-calculation.js +15 -0
- package/dist/esm/hooks/use-on-calculation-success.d.ts +7 -0
- package/dist/esm/hooks/use-on-calculation-success.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-calculation-success.js +7 -1
- package/dist/esm/hooks/use-on-copy.d.ts +1 -1
- package/dist/esm/hooks/use-on-copy.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-copy.js +2 -3
- package/dist/esm/hooks/use-on-delete-cells-shift-left.d.ts +13 -3
- package/dist/esm/hooks/use-on-delete-cells-shift-left.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-delete-cells-shift-left.js +26 -2
- package/dist/esm/hooks/use-on-delete-cells-shift-up.d.ts +13 -3
- package/dist/esm/hooks/use-on-delete-cells-shift-up.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-delete-cells-shift-up.js +26 -2
- package/dist/esm/hooks/use-on-delete-column.d.ts +13 -4
- package/dist/esm/hooks/use-on-delete-column.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-delete-column.js +14 -2
- package/dist/esm/hooks/use-on-delete-row.d.ts +13 -4
- package/dist/esm/hooks/use-on-delete-row.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-delete-row.js +14 -2
- package/dist/esm/hooks/use-on-insert-cells-shift-down.d.ts +13 -3
- package/dist/esm/hooks/use-on-insert-cells-shift-down.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-insert-cells-shift-down.js +26 -2
- package/dist/esm/hooks/use-on-insert-cells-shift-right.d.ts +13 -3
- package/dist/esm/hooks/use-on-insert-cells-shift-right.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-insert-cells-shift-right.js +26 -2
- package/dist/esm/hooks/use-on-insert-column.d.ts +10 -3
- package/dist/esm/hooks/use-on-insert-column.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-insert-column.js +33 -7
- package/dist/esm/hooks/use-on-insert-row.d.ts +10 -3
- package/dist/esm/hooks/use-on-insert-row.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-insert-row.js +32 -7
- package/dist/esm/hooks/use-on-move-columns.d.ts +2 -1
- package/dist/esm/hooks/use-on-move-columns.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-move-columns.js +14 -5
- package/dist/esm/hooks/use-on-move-rows.d.ts +16 -1
- package/dist/esm/hooks/use-on-move-rows.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-move-rows.js +30 -5
- package/dist/esm/hooks/use-on-move-selection.d.ts +7 -2
- package/dist/esm/hooks/use-on-move-selection.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-move-selection.js +14 -1
- package/dist/esm/hooks/use-on-paste.d.ts +12 -2
- package/dist/esm/hooks/use-on-paste.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-paste.js +41 -2
- package/dist/esm/hooks/use-spreadsheet-state.d.ts +16 -5
- package/dist/esm/hooks/use-spreadsheet-state.d.ts.map +1 -1
- package/dist/esm/hooks/use-spreadsheet-state.js +141 -17
- package/dist/esm/hooks/use-structured-reference.d.ts.map +1 -1
- package/dist/esm/hooks/use-structured-reference.js +10 -6
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +4 -0
- package/dist/esm/interface/calculation-interface.d.ts +9 -0
- package/dist/esm/interface/calculation-interface.d.ts.map +1 -1
- package/dist/esm/interface/calculation-interface.js +33 -2
- package/dist/esm/interface/delete-cells-shift-left.d.ts +8 -1
- package/dist/esm/interface/delete-cells-shift-left.d.ts.map +1 -1
- package/dist/esm/interface/delete-cells-shift-left.js +135 -59
- package/dist/esm/interface/delete-cells-shift-up.d.ts +9 -1
- package/dist/esm/interface/delete-cells-shift-up.d.ts.map +1 -1
- package/dist/esm/interface/delete-cells-shift-up.js +133 -53
- package/dist/esm/interface/delete-column.d.ts +1 -1
- package/dist/esm/interface/delete-column.d.ts.map +1 -1
- package/dist/esm/interface/delete-column.js +96 -38
- package/dist/esm/interface/delete-row.d.ts +1 -1
- package/dist/esm/interface/delete-row.d.ts.map +1 -1
- package/dist/esm/interface/delete-row.js +98 -39
- package/dist/esm/interface/insert-cells-shift-down.d.ts +10 -1
- package/dist/esm/interface/insert-cells-shift-down.d.ts.map +1 -1
- package/dist/esm/interface/insert-cells-shift-down.js +116 -47
- package/dist/esm/interface/insert-cells-shift-right.d.ts +10 -1
- package/dist/esm/interface/insert-cells-shift-right.d.ts.map +1 -1
- package/dist/esm/interface/insert-cells-shift-right.js +120 -51
- package/dist/esm/interface/insert-column.d.ts +1 -1
- package/dist/esm/interface/insert-column.d.ts.map +1 -1
- package/dist/esm/interface/insert-column.js +68 -18
- package/dist/esm/interface/insert-row.d.ts +1 -1
- package/dist/esm/interface/insert-row.d.ts.map +1 -1
- package/dist/esm/interface/insert-row.js +60 -14
- package/dist/esm/interface/spreadsheet-interface.d.ts.map +1 -1
- package/dist/esm/interface/spreadsheet-interface.js +29 -0
- package/dist/esm/sheet-cell.d.ts.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +18 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../../cellxfs-registry.ts","../../commands.ts","../../generated-names.ts","../../helpers.ts","../../index.ts","../../server-utils.ts","../../server.browser.ts","../../server.ts","../../shared-string-registry.ts","../../sheet-cell.ts","../../test-setup.ts","../../types.ts","../../vitest.config.ts","../../api/advanced-filter.ts","../../api/border.ts","../../api/conditional-format.ts","../../api/copy-paste.ts","../../api/data-validation.ts","../../api/datatype.ts","../../api/date.ts","../../api/decimals.ts","../../api/dependency.ts","../../api/fill-series-spec.ts","../../api/fill.ts","../../api/filter-range.ts","../../api/filter.ts","../../api/format-caches.ts","../../api/formula.ts","../../api/goal-seek.ts","../../api/immer-utils.ts","../../api/intl.ts","../../api/merges.ts","../../api/outline.ts","../../api/paint-format.ts","../../api/parse-html.ts","../../api/paste-special.ts","../../api/patches.ts","../../api/pivot-range.ts","../../api/range-rule-helpers.ts","../../api/range.ts","../../api/rename-sheet.ts","../../api/selection.ts","../../api/sort.ts","../../api/split-text.ts","../../api/structural-formula-update.ts","../../api/subtotal.ts","../../api/table.ts","../../api/validation.ts","../../api/xlsx-source.ts","../../atoms/delete-sheet-atom.ts","../../atoms/dialog-state.atom.ts","../../atoms/editing-data-validation-id.atom.ts","../../atoms/editing-embed.atom.ts","../../atoms/editing-table.atom.ts","../../atoms/error-state.atom.ts","../../atoms/index.ts","../../atoms/insert-image-state.atom.ts","../../atoms/named-range.atom.ts","../../atoms/resize-dimension.atom.ts","../../atoms/sheet-observer.atom.ts","../../components/index.tsx","../../components/dialogs/delete-sheet-confirmation.tsx","../../components/dialogs/error-state.tsx","../../components/editors/cell-format-editor.tsx","../../components/editors/conditional-format-editor.tsx","../../components/editors/conditional-format-rule-editor.tsx","../../components/editors/data-validation-editor.tsx","../../components/editors/data-validation-rule-editor.tsx","../../components/editors/embed-editor.tsx","../../components/editors/insert-image-editor.tsx","../../components/editors/insert-link-editor.tsx","../../components/editors/named-range-editor.tsx","../../components/editors/resize-dimension-editor.tsx","../../components/editors/sheet-filter.tsx","../../components/editors/table-editor.tsx","../../helpers/iterative-calculation.ts","../../helpers/sheet-title.ts","../../hooks/use-async-datasource.ts","../../hooks/use-calculation-initialize.ts","../../hooks/use-calculation-process-array.ts","../../hooks/use-calculation-queue.ts","../../hooks/use-calculation-worker.ts","../../hooks/use-calculation.ts","../../hooks/use-can-edit-cellrange.ts","../../hooks/use-cellxfs-registry.ts","../../hooks/use-citations.ts","../../hooks/use-comments.ts","../../hooks/use-conditional-formatting-rules.ts","../../hooks/use-data-validation-rules.ts","../../hooks/use-deferred-calculation-flush.ts","../../hooks/use-idle-scheduler.ts","../../hooks/use-indent.ts","../../hooks/use-named-range.ts","../../hooks/use-on-adjust-row-height.ts","../../hooks/use-on-advanced-filter.ts","../../hooks/use-on-autoresize.ts","../../hooks/use-on-banded-ranges.ts","../../hooks/use-on-calculation-begin.ts","../../hooks/use-on-calculation-success.ts","../../hooks/use-on-change-batch-stream.ts","../../hooks/use-on-change-batch.ts","../../hooks/use-on-change-calculated-column.ts","../../hooks/use-on-change-decimals.ts","../../hooks/use-on-change-formatting.ts","../../hooks/use-on-change-sheet-tabcolor.ts","../../hooks/use-on-change-table-column.ts","../../hooks/use-on-change-theme.ts","../../hooks/use-on-change.ts","../../hooks/use-on-clear-formatting.ts","../../hooks/use-on-collapse-column-group.ts","../../hooks/use-on-collapse-row-group.ts","../../hooks/use-on-copy.ts","../../hooks/use-on-create-named-range.ts","../../hooks/use-on-create-sheet.ts","../../hooks/use-on-delete-cells-shift-left.ts","../../hooks/use-on-delete-cells-shift-up.ts","../../hooks/use-on-delete-column.ts","../../hooks/use-on-delete-named-range.ts","../../hooks/use-on-delete-row.ts","../../hooks/use-on-delete-sheet.ts","../../hooks/use-on-delete-table-row.ts","../../hooks/use-on-delete.ts","../../hooks/use-on-drag-n-drop.ts","../../hooks/use-on-duplicate-sheet.ts","../../hooks/use-on-embeds.ts","../../hooks/use-on-expand-column-group.ts","../../hooks/use-on-expand-row-group.ts","../../hooks/use-on-fill-range.ts","../../hooks/use-on-fill.ts","../../hooks/use-on-filter-table.ts","../../hooks/use-on-find-replace.ts","../../hooks/use-on-freeze.ts","../../hooks/use-on-goal-seek.ts","../../hooks/use-on-group-columns.ts","../../hooks/use-on-group-rows.ts","../../hooks/use-on-hide-column.ts","../../hooks/use-on-hide-row.ts","../../hooks/use-on-hide-show-sheet.ts","../../hooks/use-on-import-csv-legacy.ts","../../hooks/use-on-import-csv.ts","../../hooks/use-on-import-excel.ts","../../hooks/use-on-insert-autosum.ts","../../hooks/use-on-insert-cells-shift-down.ts","../../hooks/use-on-insert-cells-shift-right.ts","../../hooks/use-on-insert-checkbox.ts","../../hooks/use-on-insert-column.ts","../../hooks/use-on-insert-date-time.ts","../../hooks/use-on-insert-date.ts","../../hooks/use-on-insert-image.ts","../../hooks/use-on-insert-link.ts","../../hooks/use-on-insert-note.ts","../../hooks/use-on-insert-row.ts","../../hooks/use-on-insert-table-row.ts","../../hooks/use-on-insert-time.ts","../../hooks/use-on-locale-change.ts","../../hooks/use-on-merge-unmerge-cells.ts","../../hooks/use-on-move-columns.ts","../../hooks/use-on-move-rows.ts","../../hooks/use-on-move-selection.ts","../../hooks/use-on-move-sheet.ts","../../hooks/use-on-move-table-columns.ts","../../hooks/use-on-paste.ts","../../hooks/use-on-protect-range.ts","../../hooks/use-on-protect-sheet.ts","../../hooks/use-on-remove-duplicates.ts","../../hooks/use-on-rename-sheet.ts","../../hooks/use-on-request-calculate-wrapper.ts","../../hooks/use-on-request-conditional-format.ts","../../hooks/use-on-request-data-validation.ts","../../hooks/use-on-request-define-named-range.ts","../../hooks/use-on-request-delete-sheet.ts","../../hooks/use-on-request-edit-table.ts","../../hooks/use-on-request-format-cells.ts","../../hooks/use-on-request-insert-image.ts","../../hooks/use-on-request-insert-link.ts","../../hooks/use-on-request-resize.ts","../../hooks/use-on-request-update-named-range.ts","../../hooks/use-on-resize-table.ts","../../hooks/use-on-resize.ts","../../hooks/use-on-set-outline-depth.ts","../../hooks/use-on-show-column.ts","../../hooks/use-on-show-row.ts","../../hooks/use-on-sort-column.ts","../../hooks/use-on-sort-range.ts","../../hooks/use-on-sort-table.ts","../../hooks/use-on-subtotal.ts","../../hooks/use-on-table.ts","../../hooks/use-on-trace-dependents-precedents.tsx","../../hooks/use-on-ungroup-columns.ts","../../hooks/use-on-ungroup-rows.ts","../../hooks/use-on-update-named-range.ts","../../hooks/use-on-update-note.ts","../../hooks/use-on-update-sheet.ts","../../hooks/use-paint-format.ts","../../hooks/use-search.ts","../../hooks/use-select-next-prev-sheet.ts","../../hooks/use-sheet-observer.ts","../../hooks/use-sheet-properties.ts","../../hooks/use-sheet-state.ts","../../hooks/use-sheetdata-subscriber.ts","../../hooks/use-slicers.ts","../../hooks/use-split-text-to-columns.ts","../../hooks/use-spreadsheet-state.ts","../../hooks/use-ss-registry.ts","../../hooks/use-structured-reference.ts","../../hooks/use-undo-redo-actions.ts","../../hooks/use-undo-redo.ts","../../hooks/utils/frozen-sort.ts","../../hooks/utils/sort-rows.ts","../../interface/apply-fill.ts","../../interface/auto-resize.ts","../../interface/calculation-interface.ts","../../interface/change-batch-stream.ts","../../interface/change-batch.ts","../../interface/change-border.ts","../../interface/change-calculated-column.ts","../../interface/change-decimals.ts","../../interface/change-formatting.ts","../../interface/change-sheet-tabcolor.ts","../../interface/change-table-column.ts","../../interface/change-theme.ts","../../interface/chart-extensions.ts","../../interface/citations.ts","../../interface/clear-formatting.ts","../../interface/conditional-formatting-rules.ts","../../interface/create-table.ts","../../interface/data-validation-rules.ts","../../interface/data-validation-utils.ts","../../interface/delete-cells-shift-left.ts","../../interface/delete-cells-shift-up.ts","../../interface/delete-cells.ts","../../interface/delete-column.ts","../../interface/delete-row.ts","../../interface/delete-sheet.ts","../../interface/delete-table-column.ts","../../interface/delete-table-row.ts","../../interface/duplicate-sheet.ts","../../interface/embeds.ts","../../interface/freeze.ts","../../interface/helpers.ts","../../interface/hide-column.ts","../../interface/hide-row.ts","../../interface/indent.ts","../../interface/insert-cells-shift-down.ts","../../interface/insert-cells-shift-right.ts","../../interface/insert-column.ts","../../interface/insert-note.ts","../../interface/insert-row.ts","../../interface/insert-table-row.ts","../../interface/interface-cli.ts","../../interface/named-range-operations.ts","../../interface/new-sheet.ts","../../interface/pivot-extensions.ts","../../interface/remove-duplicates.ts","../../interface/remove-table.ts","../../interface/resize-utils.ts","../../interface/resize.ts","../../interface/slicers.ts","../../interface/split-text.ts","../../interface/spreadsheet-interface.ts","../../interface/table-totalrow.ts","../../interface/table-utils.ts","../../interface/update-sheet.ts","../../interface/update-table.ts","../../validation-schema/table.schema.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["../../cellxfs-registry.ts","../../commands.ts","../../constants.ts","../../generated-names.ts","../../helpers.ts","../../index.ts","../../server-utils.ts","../../server.browser.ts","../../server.ts","../../shared-string-registry.ts","../../sheet-cell.ts","../../test-setup.ts","../../types.ts","../../vitest.config.ts","../../api/advanced-filter.ts","../../api/anchored-objects.ts","../../api/border.ts","../../api/conditional-format.ts","../../api/copy-paste.ts","../../api/data-validation.ts","../../api/datatype.ts","../../api/date.ts","../../api/decimals.ts","../../api/dependency.ts","../../api/fill-series-spec.ts","../../api/fill.ts","../../api/filter-range.ts","../../api/filter.ts","../../api/format-caches.ts","../../api/formula.ts","../../api/goal-seek.ts","../../api/immer-utils.ts","../../api/insert-cut-cells.ts","../../api/intl.ts","../../api/merges.ts","../../api/named-range-structural.ts","../../api/outline.ts","../../api/paint-format.ts","../../api/parse-html.ts","../../api/paste-special.ts","../../api/patches.ts","../../api/pivot-range.ts","../../api/range-rule-helpers.ts","../../api/range.ts","../../api/rename-sheet.ts","../../api/selection.ts","../../api/sort.ts","../../api/split-text.ts","../../api/structural-formula-update.ts","../../api/structural-guards.ts","../../api/structural-table-refs.ts","../../api/subtotal.ts","../../api/table.ts","../../api/validation.ts","../../api/xlsx-source.ts","../../atoms/delete-sheet-atom.ts","../../atoms/dialog-state.atom.ts","../../atoms/editing-data-validation-id.atom.ts","../../atoms/editing-embed.atom.ts","../../atoms/editing-table.atom.ts","../../atoms/error-state.atom.ts","../../atoms/index.ts","../../atoms/insert-image-state.atom.ts","../../atoms/named-range.atom.ts","../../atoms/resize-dimension.atom.ts","../../atoms/sheet-observer.atom.ts","../../components/index.tsx","../../components/dialogs/delete-sheet-confirmation.tsx","../../components/dialogs/error-state.tsx","../../components/editors/cell-format-editor.tsx","../../components/editors/conditional-format-editor.tsx","../../components/editors/conditional-format-rule-editor.tsx","../../components/editors/data-validation-editor.tsx","../../components/editors/data-validation-rule-editor.tsx","../../components/editors/embed-editor.tsx","../../components/editors/insert-image-editor.tsx","../../components/editors/insert-link-editor.tsx","../../components/editors/named-range-editor.tsx","../../components/editors/resize-dimension-editor.tsx","../../components/editors/sheet-filter.tsx","../../components/editors/table-editor.tsx","../../helpers/iterative-calculation.ts","../../helpers/sheet-title.ts","../../hooks/use-async-datasource.ts","../../hooks/use-calculation-initialize.ts","../../hooks/use-calculation-process-array.ts","../../hooks/use-calculation-queue.ts","../../hooks/use-calculation-worker.ts","../../hooks/use-calculation.ts","../../hooks/use-can-edit-cellrange.ts","../../hooks/use-cellxfs-registry.ts","../../hooks/use-citations.ts","../../hooks/use-comments.ts","../../hooks/use-conditional-formatting-rules.ts","../../hooks/use-data-validation-rules.ts","../../hooks/use-deferred-calculation-flush.ts","../../hooks/use-idle-scheduler.ts","../../hooks/use-indent.ts","../../hooks/use-named-range.ts","../../hooks/use-on-adjust-row-height.ts","../../hooks/use-on-advanced-filter.ts","../../hooks/use-on-autoresize.ts","../../hooks/use-on-banded-ranges.ts","../../hooks/use-on-calculation-begin.ts","../../hooks/use-on-calculation-success.ts","../../hooks/use-on-change-batch-stream.ts","../../hooks/use-on-change-batch.ts","../../hooks/use-on-change-calculated-column.ts","../../hooks/use-on-change-decimals.ts","../../hooks/use-on-change-formatting.ts","../../hooks/use-on-change-sheet-tabcolor.ts","../../hooks/use-on-change-table-column.ts","../../hooks/use-on-change-theme.ts","../../hooks/use-on-change.ts","../../hooks/use-on-clear-formatting.ts","../../hooks/use-on-collapse-column-group.ts","../../hooks/use-on-collapse-row-group.ts","../../hooks/use-on-copy.ts","../../hooks/use-on-create-named-range.ts","../../hooks/use-on-create-sheet.ts","../../hooks/use-on-delete-cells-shift-left.ts","../../hooks/use-on-delete-cells-shift-up.ts","../../hooks/use-on-delete-column.ts","../../hooks/use-on-delete-named-range.ts","../../hooks/use-on-delete-row.ts","../../hooks/use-on-delete-sheet.ts","../../hooks/use-on-delete-table-row.ts","../../hooks/use-on-delete.ts","../../hooks/use-on-drag-n-drop.ts","../../hooks/use-on-duplicate-sheet.ts","../../hooks/use-on-embeds.ts","../../hooks/use-on-expand-column-group.ts","../../hooks/use-on-expand-row-group.ts","../../hooks/use-on-fill-range.ts","../../hooks/use-on-fill.ts","../../hooks/use-on-filter-table.ts","../../hooks/use-on-find-replace.ts","../../hooks/use-on-freeze.ts","../../hooks/use-on-goal-seek.ts","../../hooks/use-on-group-columns.ts","../../hooks/use-on-group-rows.ts","../../hooks/use-on-hide-column.ts","../../hooks/use-on-hide-row.ts","../../hooks/use-on-hide-show-sheet.ts","../../hooks/use-on-import-csv-legacy.ts","../../hooks/use-on-import-csv.ts","../../hooks/use-on-import-excel.ts","../../hooks/use-on-insert-autosum.ts","../../hooks/use-on-insert-cells-shift-down.ts","../../hooks/use-on-insert-cells-shift-right.ts","../../hooks/use-on-insert-checkbox.ts","../../hooks/use-on-insert-column.ts","../../hooks/use-on-insert-date-time.ts","../../hooks/use-on-insert-date.ts","../../hooks/use-on-insert-image.ts","../../hooks/use-on-insert-link.ts","../../hooks/use-on-insert-note.ts","../../hooks/use-on-insert-row.ts","../../hooks/use-on-insert-table-row.ts","../../hooks/use-on-insert-time.ts","../../hooks/use-on-locale-change.ts","../../hooks/use-on-merge-unmerge-cells.ts","../../hooks/use-on-move-columns.ts","../../hooks/use-on-move-rows.ts","../../hooks/use-on-move-selection.ts","../../hooks/use-on-move-sheet.ts","../../hooks/use-on-move-table-columns.ts","../../hooks/use-on-paste.ts","../../hooks/use-on-protect-range.ts","../../hooks/use-on-protect-sheet.ts","../../hooks/use-on-remove-duplicates.ts","../../hooks/use-on-rename-sheet.ts","../../hooks/use-on-request-calculate-wrapper.ts","../../hooks/use-on-request-conditional-format.ts","../../hooks/use-on-request-data-validation.ts","../../hooks/use-on-request-define-named-range.ts","../../hooks/use-on-request-delete-sheet.ts","../../hooks/use-on-request-edit-table.ts","../../hooks/use-on-request-format-cells.ts","../../hooks/use-on-request-insert-image.ts","../../hooks/use-on-request-insert-link.ts","../../hooks/use-on-request-resize.ts","../../hooks/use-on-request-update-named-range.ts","../../hooks/use-on-resize-table.ts","../../hooks/use-on-resize.ts","../../hooks/use-on-set-outline-depth.ts","../../hooks/use-on-show-column.ts","../../hooks/use-on-show-row.ts","../../hooks/use-on-sort-column.ts","../../hooks/use-on-sort-range.ts","../../hooks/use-on-sort-table.ts","../../hooks/use-on-subtotal.ts","../../hooks/use-on-table.ts","../../hooks/use-on-trace-dependents-precedents.tsx","../../hooks/use-on-ungroup-columns.ts","../../hooks/use-on-ungroup-rows.ts","../../hooks/use-on-update-named-range.ts","../../hooks/use-on-update-note.ts","../../hooks/use-on-update-sheet.ts","../../hooks/use-paint-format.ts","../../hooks/use-search.ts","../../hooks/use-select-next-prev-sheet.ts","../../hooks/use-sheet-observer.ts","../../hooks/use-sheet-properties.ts","../../hooks/use-sheet-state.ts","../../hooks/use-sheetdata-subscriber.ts","../../hooks/use-slicers.ts","../../hooks/use-split-text-to-columns.ts","../../hooks/use-spreadsheet-state.ts","../../hooks/use-ss-registry.ts","../../hooks/use-structured-reference.ts","../../hooks/use-undo-redo-actions.ts","../../hooks/use-undo-redo.ts","../../hooks/utils/frozen-sort.ts","../../hooks/utils/sort-rows.ts","../../interface/apply-fill.ts","../../interface/auto-resize.ts","../../interface/calculation-interface.ts","../../interface/change-batch-stream.ts","../../interface/change-batch.ts","../../interface/change-border.ts","../../interface/change-calculated-column.ts","../../interface/change-decimals.ts","../../interface/change-formatting.ts","../../interface/change-sheet-tabcolor.ts","../../interface/change-table-column.ts","../../interface/change-theme.ts","../../interface/chart-extensions.ts","../../interface/citations.ts","../../interface/clear-formatting.ts","../../interface/conditional-formatting-rules.ts","../../interface/create-table.ts","../../interface/data-validation-rules.ts","../../interface/data-validation-utils.ts","../../interface/delete-cells-shift-left.ts","../../interface/delete-cells-shift-up.ts","../../interface/delete-cells.ts","../../interface/delete-column.ts","../../interface/delete-row.ts","../../interface/delete-sheet.ts","../../interface/delete-table-column.ts","../../interface/delete-table-row.ts","../../interface/duplicate-sheet.ts","../../interface/embeds.ts","../../interface/freeze.ts","../../interface/helpers.ts","../../interface/hide-column.ts","../../interface/hide-row.ts","../../interface/indent.ts","../../interface/insert-cells-shift-down.ts","../../interface/insert-cells-shift-right.ts","../../interface/insert-column.ts","../../interface/insert-note.ts","../../interface/insert-row.ts","../../interface/insert-table-row.ts","../../interface/interface-cli.ts","../../interface/named-range-operations.ts","../../interface/new-sheet.ts","../../interface/pivot-extensions.ts","../../interface/remove-duplicates.ts","../../interface/remove-table.ts","../../interface/resize-utils.ts","../../interface/resize.ts","../../interface/slicers.ts","../../interface/split-text.ts","../../interface/spreadsheet-interface.ts","../../interface/table-totalrow.ts","../../interface/table-utils.ts","../../interface/update-sheet.ts","../../interface/update-table.ts","../../validation-schema/table.schema.ts"],"version":"5.8.3"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { CellInterface, GridRange } from "@rowsncolumns/common-types";
|
|
2
|
+
import type { EmbeddedChart, EmbeddedObject, ProtectedRange } from "@rowsncolumns/spreadsheet";
|
|
3
|
+
import type { Draft } from "immer";
|
|
4
|
+
/**
|
|
5
|
+
* Structural (whole row / whole column insert or delete) relocation of the
|
|
6
|
+
* objects Excel anchors to cells rather than storing inside them: floating
|
|
7
|
+
* objects (charts, pictures / embeds), the ranges a chart reads, and
|
|
8
|
+
* AllowEditRange (protected range) rectangles.
|
|
9
|
+
*
|
|
10
|
+
* Excel rules (Sheets agree on every one):
|
|
11
|
+
* - A floating object's anchor cell shifts like any cell: pushed down/right by
|
|
12
|
+
* an insert at or before it, pulled up/left by a delete before it. When the
|
|
13
|
+
* anchor row/column itself is deleted the object snaps to the first
|
|
14
|
+
* surviving cell at the deletion index (Move-and-size / Move-don't-size both
|
|
15
|
+
* move; only absolute anchors stay put). Size never changes.
|
|
16
|
+
* - A range (chart series, AllowEditRange) shifts like a formula reference:
|
|
17
|
+
* insert at/before the start moves it, insert strictly inside grows it,
|
|
18
|
+
* delete inside shrinks it, delete of the whole span removes it (`#REF!`).
|
|
19
|
+
*
|
|
20
|
+
* The span rule here mirrors `shift_facet_span` in `rnc-store` exactly so both
|
|
21
|
+
* engines relocate identically.
|
|
22
|
+
*/
|
|
23
|
+
export type StructuralAxis = "row" | "column";
|
|
24
|
+
export type StructuralOp = "insert" | "delete";
|
|
25
|
+
/**
|
|
26
|
+
* Shift the `[start, end]` span of a range along the edited axis. Returns the
|
|
27
|
+
* new span, or `null` when a delete consumes it entirely.
|
|
28
|
+
*/
|
|
29
|
+
export declare const shiftSpanLikeReference: (start: number, end: number, op: StructuralOp, index: number, count: number) => [number, number] | null;
|
|
30
|
+
/**
|
|
31
|
+
* Shift a single row/column index the way a cell (and everything anchored to
|
|
32
|
+
* it) moves: pushed by an insert at or before it, pulled back by a delete
|
|
33
|
+
* before it, snapped to the deletion index when its own row/column is
|
|
34
|
+
* removed.
|
|
35
|
+
*/
|
|
36
|
+
export declare const shiftAnchorIndex: (anchorIndex: number, op: StructuralOp, index: number, count: number) => number;
|
|
37
|
+
export declare const shiftAnchorCell: (anchor: CellInterface, axis: StructuralAxis, op: StructuralOp, index: number, count: number) => CellInterface;
|
|
38
|
+
/**
|
|
39
|
+
* Shift a grid rectangle with the reference rule along one axis. Returns the
|
|
40
|
+
* same object when nothing moved, a new one when it did, `null` when a delete
|
|
41
|
+
* consumed the whole span.
|
|
42
|
+
*/
|
|
43
|
+
export declare const shiftGridRangeLikeReference: <R extends GridRange>(range: R, axis: StructuralAxis, op: StructuralOp, index: number, count: number) => R | null;
|
|
44
|
+
/**
|
|
45
|
+
* Walk a chart spec and rewrite every `SheetRange` it holds on `sheetId` —
|
|
46
|
+
* `dataRange`, per-series / per-domain `sources`, error-bar `plusRange` /
|
|
47
|
+
* `minusRange`, and any future range-valued key — with the reference rule.
|
|
48
|
+
* A range the delete consumes entirely is removed: spliced out of arrays
|
|
49
|
+
* (`sources`), nulled on properties (`dataRange`) — the chart's `#REF!`.
|
|
50
|
+
* Unknown keys are left untouched. Mutates in place; returns whether anything
|
|
51
|
+
* changed.
|
|
52
|
+
*/
|
|
53
|
+
export declare const shiftChartSpecRanges: (spec: unknown, sheetId: number, axis: StructuralAxis, op: StructuralOp, index: number, count: number) => boolean;
|
|
54
|
+
/** Shift the anchor cell of every embed (picture, shape, text box…) on the edited sheet. */
|
|
55
|
+
export declare const shiftEmbedsOnStructuralChange: (draft: Draft<EmbeddedObject>[], sheetId: number, axis: StructuralAxis, op: StructuralOp, index: number, count: number) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Shift every chart on the edited sheet: its anchor cell like a floating
|
|
58
|
+
* object, and the ranges inside its spec like references.
|
|
59
|
+
*/
|
|
60
|
+
export declare const shiftChartsOnStructuralChange: (draft: Draft<EmbeddedChart>[], sheetId: number, axis: StructuralAxis, op: StructuralOp, index: number, count: number) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Shift AllowEditRange rectangles. A protected range without a rectangle
|
|
63
|
+
* (sheet-scoped protection) is untouched; one the delete consumes is removed.
|
|
64
|
+
*/
|
|
65
|
+
export declare const shiftProtectedRangesOnStructuralChange: (draft: Draft<ProtectedRange>[], sheetId: number, axis: StructuralAxis, op: StructuralOp, index: number, count: number) => void;
|
|
66
|
+
//# sourceMappingURL=anchored-objects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchored-objects.d.ts","sourceRoot":"","sources":["../../../api/anchored-objects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EAEV,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAEnC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,QAAQ,CAAC;AAC9C,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE/C;;;GAGG;AACH,eAAO,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SAAS,MAAM,EACf,MAAM,cAAc,EACpB,IAAI,YAAY,EAChB,OAAO,MAAM,EACb,OAAO,MAAM,SAyCd,CAAC"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shift the `[start, end]` span of a range along the edited axis. Returns the
|
|
3
|
+
* new span, or `null` when a delete consumes it entirely.
|
|
4
|
+
*/
|
|
5
|
+
export const shiftSpanLikeReference = (start, end, op, index, count) => {
|
|
6
|
+
if (count <= 0)
|
|
7
|
+
return [start, end];
|
|
8
|
+
if (op === "insert") {
|
|
9
|
+
if (index <= start)
|
|
10
|
+
return [start + count, end + count];
|
|
11
|
+
if (index <= end)
|
|
12
|
+
return [start, end + count];
|
|
13
|
+
return [start, end];
|
|
14
|
+
}
|
|
15
|
+
const deleteEnd = index + count - 1;
|
|
16
|
+
if (start > deleteEnd)
|
|
17
|
+
return [start - count, end - count];
|
|
18
|
+
if (end < index)
|
|
19
|
+
return [start, end];
|
|
20
|
+
const nextStart = start < index ? start : start > deleteEnd ? start - count : index;
|
|
21
|
+
const nextEnd = end < index ? end : end > deleteEnd ? end - count : index - 1;
|
|
22
|
+
if (nextStart > nextEnd)
|
|
23
|
+
return null;
|
|
24
|
+
return [nextStart, nextEnd];
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Shift a single row/column index the way a cell (and everything anchored to
|
|
28
|
+
* it) moves: pushed by an insert at or before it, pulled back by a delete
|
|
29
|
+
* before it, snapped to the deletion index when its own row/column is
|
|
30
|
+
* removed.
|
|
31
|
+
*/
|
|
32
|
+
export const shiftAnchorIndex = (anchorIndex, op, index, count) => {
|
|
33
|
+
if (count <= 0)
|
|
34
|
+
return anchorIndex;
|
|
35
|
+
if (op === "insert") {
|
|
36
|
+
return anchorIndex >= index ? anchorIndex + count : anchorIndex;
|
|
37
|
+
}
|
|
38
|
+
const deleteEnd = index + count - 1;
|
|
39
|
+
if (anchorIndex > deleteEnd)
|
|
40
|
+
return anchorIndex - count;
|
|
41
|
+
if (anchorIndex >= index)
|
|
42
|
+
return Math.max(1, index);
|
|
43
|
+
return anchorIndex;
|
|
44
|
+
};
|
|
45
|
+
export const shiftAnchorCell = (anchor, axis, op, index, count) => {
|
|
46
|
+
if (axis === "row") {
|
|
47
|
+
const rowIndex = shiftAnchorIndex(anchor.rowIndex, op, index, count);
|
|
48
|
+
return rowIndex === anchor.rowIndex ? anchor : { ...anchor, rowIndex };
|
|
49
|
+
}
|
|
50
|
+
const columnIndex = shiftAnchorIndex(anchor.columnIndex, op, index, count);
|
|
51
|
+
return columnIndex === anchor.columnIndex
|
|
52
|
+
? anchor
|
|
53
|
+
: { ...anchor, columnIndex };
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Shift a grid rectangle with the reference rule along one axis. Returns the
|
|
57
|
+
* same object when nothing moved, a new one when it did, `null` when a delete
|
|
58
|
+
* consumed the whole span.
|
|
59
|
+
*/
|
|
60
|
+
export const shiftGridRangeLikeReference = (range, axis, op, index, count) => {
|
|
61
|
+
const [startKey, endKey] = axis === "row"
|
|
62
|
+
? ["startRowIndex", "endRowIndex"]
|
|
63
|
+
: ["startColumnIndex", "endColumnIndex"];
|
|
64
|
+
const span = shiftSpanLikeReference(range[startKey], range[endKey], op, index, count);
|
|
65
|
+
if (!span)
|
|
66
|
+
return null;
|
|
67
|
+
const [start, end] = span;
|
|
68
|
+
if (start === range[startKey] && end === range[endKey])
|
|
69
|
+
return range;
|
|
70
|
+
return { ...range, [startKey]: start, [endKey]: end };
|
|
71
|
+
};
|
|
72
|
+
const isSheetRangeLike = (value) => {
|
|
73
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
74
|
+
return false;
|
|
75
|
+
const v = value;
|
|
76
|
+
return (typeof v.sheetId === "number" &&
|
|
77
|
+
typeof v.startRowIndex === "number" &&
|
|
78
|
+
typeof v.endRowIndex === "number" &&
|
|
79
|
+
typeof v.startColumnIndex === "number" &&
|
|
80
|
+
typeof v.endColumnIndex === "number");
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Walk a chart spec and rewrite every `SheetRange` it holds on `sheetId` —
|
|
84
|
+
* `dataRange`, per-series / per-domain `sources`, error-bar `plusRange` /
|
|
85
|
+
* `minusRange`, and any future range-valued key — with the reference rule.
|
|
86
|
+
* A range the delete consumes entirely is removed: spliced out of arrays
|
|
87
|
+
* (`sources`), nulled on properties (`dataRange`) — the chart's `#REF!`.
|
|
88
|
+
* Unknown keys are left untouched. Mutates in place; returns whether anything
|
|
89
|
+
* changed.
|
|
90
|
+
*/
|
|
91
|
+
export const shiftChartSpecRanges = (spec, sheetId, axis, op, index, count) => {
|
|
92
|
+
let changed = false;
|
|
93
|
+
const shiftRange = (range) => {
|
|
94
|
+
if (range.sheetId !== sheetId)
|
|
95
|
+
return range;
|
|
96
|
+
const next = shiftGridRangeLikeReference(range, axis, op, index, count);
|
|
97
|
+
if (next !== range)
|
|
98
|
+
changed = true;
|
|
99
|
+
return next;
|
|
100
|
+
};
|
|
101
|
+
const walk = (node) => {
|
|
102
|
+
if (!node || typeof node !== "object")
|
|
103
|
+
return;
|
|
104
|
+
if (Array.isArray(node)) {
|
|
105
|
+
for (let i = node.length - 1; i >= 0; i--) {
|
|
106
|
+
const item = node[i];
|
|
107
|
+
if (isSheetRangeLike(item)) {
|
|
108
|
+
const next = shiftRange(item);
|
|
109
|
+
if (next === null)
|
|
110
|
+
node.splice(i, 1);
|
|
111
|
+
else if (next !== item)
|
|
112
|
+
node[i] = next;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
walk(item);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const obj = node;
|
|
121
|
+
for (const key of Object.keys(obj)) {
|
|
122
|
+
const value = obj[key];
|
|
123
|
+
if (isSheetRangeLike(value)) {
|
|
124
|
+
const next = shiftRange(value);
|
|
125
|
+
if (next !== value)
|
|
126
|
+
obj[key] = next;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
walk(value);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
walk(spec);
|
|
134
|
+
return changed;
|
|
135
|
+
};
|
|
136
|
+
/** Shift the anchor cell of every embed (picture, shape, text box…) on the edited sheet. */
|
|
137
|
+
export const shiftEmbedsOnStructuralChange = (draft, sheetId, axis, op, index, count) => {
|
|
138
|
+
for (const embed of draft) {
|
|
139
|
+
const position = embed.position;
|
|
140
|
+
if (!position || position.sheetId !== sheetId)
|
|
141
|
+
continue;
|
|
142
|
+
const overlay = position.overlayPosition;
|
|
143
|
+
if (!overlay?.anchorCell)
|
|
144
|
+
continue;
|
|
145
|
+
const next = shiftAnchorCell(overlay.anchorCell, axis, op, index, count);
|
|
146
|
+
if (next !== overlay.anchorCell)
|
|
147
|
+
overlay.anchorCell = next;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Shift every chart on the edited sheet: its anchor cell like a floating
|
|
152
|
+
* object, and the ranges inside its spec like references.
|
|
153
|
+
*/
|
|
154
|
+
export const shiftChartsOnStructuralChange = (draft, sheetId, axis, op, index, count) => {
|
|
155
|
+
for (const chart of draft) {
|
|
156
|
+
const position = chart.position;
|
|
157
|
+
if (position?.sheetId === sheetId && position.overlayPosition?.anchorCell) {
|
|
158
|
+
const overlay = position.overlayPosition;
|
|
159
|
+
const next = shiftAnchorCell(overlay.anchorCell, axis, op, index, count);
|
|
160
|
+
if (next !== overlay.anchorCell)
|
|
161
|
+
overlay.anchorCell = next;
|
|
162
|
+
}
|
|
163
|
+
// Series ranges may point at ANY sheet, so the spec walk is not gated on
|
|
164
|
+
// the chart's own sheet.
|
|
165
|
+
shiftChartSpecRanges(chart.spec, sheetId, axis, op, index, count);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Shift AllowEditRange rectangles. A protected range without a rectangle
|
|
170
|
+
* (sheet-scoped protection) is untouched; one the delete consumes is removed.
|
|
171
|
+
*/
|
|
172
|
+
export const shiftProtectedRangesOnStructuralChange = (draft, sheetId, axis, op, index, count) => {
|
|
173
|
+
const [startKey, endKey] = axis === "row"
|
|
174
|
+
? ["startRowIndex", "endRowIndex"]
|
|
175
|
+
: ["startColumnIndex", "endColumnIndex"];
|
|
176
|
+
for (let i = draft.length - 1; i >= 0; i--) {
|
|
177
|
+
const protectedRange = draft[i];
|
|
178
|
+
const range = protectedRange.range;
|
|
179
|
+
if (range.sheetId !== sheetId)
|
|
180
|
+
continue;
|
|
181
|
+
const start = range[startKey];
|
|
182
|
+
const end = range[endKey];
|
|
183
|
+
if (typeof start !== "number" || typeof end !== "number")
|
|
184
|
+
continue;
|
|
185
|
+
const span = shiftSpanLikeReference(start, end, op, index, count);
|
|
186
|
+
if (!span) {
|
|
187
|
+
draft.splice(i, 1);
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
if (span[0] !== start)
|
|
191
|
+
range[startKey] = span[0];
|
|
192
|
+
if (span[1] !== end)
|
|
193
|
+
range[endKey] = span[1];
|
|
194
|
+
if (protectedRange.unprotectedRanges) {
|
|
195
|
+
const kept = [];
|
|
196
|
+
let unprotectedChanged = false;
|
|
197
|
+
for (const unprotected of protectedRange.unprotectedRanges) {
|
|
198
|
+
if (unprotected.sheetId !== sheetId) {
|
|
199
|
+
kept.push(unprotected);
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
const next = shiftGridRangeLikeReference(unprotected, axis, op, index, count);
|
|
203
|
+
if (next !== unprotected)
|
|
204
|
+
unprotectedChanged = true;
|
|
205
|
+
if (next)
|
|
206
|
+
kept.push(next);
|
|
207
|
+
}
|
|
208
|
+
if (unprotectedChanged)
|
|
209
|
+
protectedRange.unprotectedRanges = kept;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
@@ -4,7 +4,14 @@ import type { GeneratedNames } from "../generated-names";
|
|
|
4
4
|
import type { UseSpreadsheetProps } from "../hooks/use-spreadsheet-state";
|
|
5
5
|
export type ClipBoardFormat = "text/html" | "text/csv" | "text/plain" | "application/json" | "image/apng" | "image/bmp" | "image/gif" | "image/jpeg" | "image/pjpeg" | "image/png" | "image/svg+xml" | "image/tiff" | "image/webp" | "image/x-icon";
|
|
6
6
|
export declare const SUPPORTED_IMAGE_TYPES: string[];
|
|
7
|
-
export declare const generateDataFromClipboard: <T extends CellData>(e: ClipboardEvent | undefined, activeCell: CellInterface, sheetId: number, activeSheetName: string, preserveFormatting?: boolean, locale?: string, idCreationStrategy?: UseSpreadsheetProps<T>["idCreationStrategy"], forcePlainText?: boolean, sanitizeHtml?: (html: string) => string, generatedNames?: GeneratedNames
|
|
7
|
+
export declare const generateDataFromClipboard: <T extends CellData>(e: ClipboardEvent | undefined, activeCell: CellInterface, sheetId: number, activeSheetName: string, preserveFormatting?: boolean, locale?: string, idCreationStrategy?: UseSpreadsheetProps<T>["idCreationStrategy"], forcePlainText?: boolean, sanitizeHtml?: (html: string) => string, generatedNames?: GeneratedNames, options?: {
|
|
8
|
+
/**
|
|
9
|
+
* Re-anchor each copied formula's relative refs from its `sourceCell` to the paste
|
|
10
|
+
* destination (a COPY). `false` for a CUT: Excel keeps a moved formula's text verbatim and
|
|
11
|
+
* only repoints references INTO the moved block, which the consumer does itself.
|
|
12
|
+
*/
|
|
13
|
+
relocateFormulas?: boolean;
|
|
14
|
+
}) => Promise<{
|
|
8
15
|
results?: (CellData | null | undefined)[][];
|
|
9
16
|
merges?: GridRange[];
|
|
10
17
|
embeds?: EmbeddedObject[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-paste.d.ts","sourceRoot":"","sources":["../../../api/copy-paste.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EACb,SAAS,EACV,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,SAAS,EAEV,MAAM,2BAA2B,CAAC;AAanC,OAAO,KAAK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,QAAQ,GAAG,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,EAAE,EAC7C,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,yCAwBhB;AAED,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAC7D,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,EAAE,KACnD,MAAM,EAmBR,CAAC"}
|
|
@@ -18,7 +18,7 @@ export const SUPPORTED_IMAGE_TYPES = [
|
|
|
18
18
|
"image/webp",
|
|
19
19
|
"image/x-icon",
|
|
20
20
|
];
|
|
21
|
-
export const generateDataFromClipboard = async (e, activeCell, sheetId, activeSheetName, preserveFormatting, locale, idCreationStrategy, forcePlainText, sanitizeHtml, generatedNames) => {
|
|
21
|
+
export const generateDataFromClipboard = async (e, activeCell, sheetId, activeSheetName, preserveFormatting, locale, idCreationStrategy, forcePlainText, sanitizeHtml, generatedNames, options) => {
|
|
22
22
|
const items = e?.clipboardData?.items;
|
|
23
23
|
const files = e?.clipboardData?.files;
|
|
24
24
|
const formatOrder = [
|
|
@@ -150,7 +150,9 @@ export const generateDataFromClipboard = async (e, activeCell, sheetId, activeSh
|
|
|
150
150
|
// Delete structured
|
|
151
151
|
delete data?.ev?.structuredValue;
|
|
152
152
|
// Move formulas if source cell is present
|
|
153
|
-
if (data?.ue?.fv &&
|
|
153
|
+
if (data?.ue?.fv &&
|
|
154
|
+
sourceCell &&
|
|
155
|
+
options?.relocateFormulas !== false) {
|
|
154
156
|
const destinationCell = {
|
|
155
157
|
rowIndex: activeCell.rowIndex + i,
|
|
156
158
|
columnIndex: activeCell.columnIndex + j,
|
|
@@ -3,8 +3,8 @@ import type { CellData } from "@rowsncolumns/spreadsheet";
|
|
|
3
3
|
import type { Draft } from "immer";
|
|
4
4
|
import type { useCalculation } from "../hooks/use-calculation";
|
|
5
5
|
import type { CellXfsRegistry } from "../hooks/use-cellxfs-registry";
|
|
6
|
-
import type { SharedStringRegistry } from "../hooks/use-ss-registry";
|
|
7
6
|
import type { SheetData } from "../hooks/use-spreadsheet-state";
|
|
7
|
+
import type { SharedStringRegistry } from "../hooks/use-ss-registry";
|
|
8
8
|
import type { RecalcCellCoordinate } from "../types";
|
|
9
9
|
type ProcessDependentCellsProps<T extends CellData> = {
|
|
10
10
|
rowIndex: number;
|
|
@@ -38,7 +38,7 @@ export declare const collectUniqueDependentsForRange: <T extends CellData>(param
|
|
|
38
38
|
rowIndex: number;
|
|
39
39
|
columnIndex: number;
|
|
40
40
|
}>;
|
|
41
|
-
export declare const moveFormulaAtPosition: <T extends CellData>({ draft, position, destinationSheetId, activeSheetName, enqueueCalculation, enqueueGraphOperation, recalcCells, movedKeys, rowDelta, columnDelta, sourceRange, locale, rowCount, columnCount, cellXfsRegistry, sharedStringRegistry, }: {
|
|
41
|
+
export declare const moveFormulaAtPosition: <T extends CellData>({ draft, position, destinationSheetId, activeSheetName, enqueueCalculation, enqueueGraphOperation, recalcCells, movedKeys, rowDelta, columnDelta, sourceRange, deletedRange, destinationPosition, locale, rowCount, columnCount, cellXfsRegistry, sharedStringRegistry, }: {
|
|
42
42
|
draft: Draft<SheetData<T>>;
|
|
43
43
|
position: {
|
|
44
44
|
sheetId: number;
|
|
@@ -54,6 +54,17 @@ export declare const moveFormulaAtPosition: <T extends CellData>({ draft, positi
|
|
|
54
54
|
rowDelta?: number;
|
|
55
55
|
columnDelta?: number;
|
|
56
56
|
sourceRange?: GridRange;
|
|
57
|
+
/** Cells removed by a delete-cells shift — references into it become `#REF!` (SHF-09). */
|
|
58
|
+
deletedRange?: GridRange;
|
|
59
|
+
/**
|
|
60
|
+
* Where the formula cell itself ends up. Defaults to `position + delta` (the cell moves with the
|
|
61
|
+
* shift). A dependent OUTSIDE the shifted band keeps its place while its references into the
|
|
62
|
+
* band still move by the delta — pass its own position here so the graph is re-keyed correctly.
|
|
63
|
+
*/
|
|
64
|
+
destinationPosition?: {
|
|
65
|
+
rowIndex: number;
|
|
66
|
+
columnIndex: number;
|
|
67
|
+
};
|
|
57
68
|
locale?: string;
|
|
58
69
|
rowCount?: number;
|
|
59
70
|
columnCount?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency.d.ts","sourceRoot":"","sources":["../../../api/dependency.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"dependency.d.ts","sourceRoot":"","sources":["../../../api/dependency.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAIrD,KAAK,0BAA0B,CAAC,CAAC,SAAS,QAAQ,IAAI;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,aAAa,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,eAAe,CAAC,CAAC;IAClE,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,kB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AAC,CAAC,CAAC,CAAC;IAC3B,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,oBAAoB,CAAC,CAAC;IAC7E,qBAAqB,CAAC,EAAE,UAAU,CAChC,OAAO,cAAc,CACtB,CAAC,uBAAuB,CAAC,CAAC;IAC3B,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC/C,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,0FAA0F;IAC1F,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C,SAwFA,CAAC"}
|
|
@@ -205,7 +205,7 @@ export const collectUniqueDependentsForRange = (params) => {
|
|
|
205
205
|
return dependentMap;
|
|
206
206
|
};
|
|
207
207
|
// Process a single formula move at a specific position with the specified deltas.
|
|
208
|
-
export const moveFormulaAtPosition = ({ draft, position, destinationSheetId, activeSheetName, enqueueCalculation, enqueueGraphOperation, recalcCells, movedKeys, rowDelta = 0, columnDelta = 0, sourceRange, locale, rowCount, columnCount, cellXfsRegistry, sharedStringRegistry, }) => {
|
|
208
|
+
export const moveFormulaAtPosition = ({ draft, position, destinationSheetId, activeSheetName, enqueueCalculation, enqueueGraphOperation, recalcCells, movedKeys, rowDelta = 0, columnDelta = 0, sourceRange, deletedRange, destinationPosition, locale, rowCount, columnCount, cellXfsRegistry, sharedStringRegistry, }) => {
|
|
209
209
|
const sheetCell = new SheetCell();
|
|
210
210
|
const currentSheet = createSheetDraft(draft, position.sheetId, position.rowIndex);
|
|
211
211
|
const cellData = currentSheet[position.rowIndex]?.values?.[position.columnIndex];
|
|
@@ -213,11 +213,17 @@ export const moveFormulaAtPosition = ({ draft, position, destinationSheetId, act
|
|
|
213
213
|
if (!movedKeys.has(sheetCell.key) && sheetCell.isFormula()) {
|
|
214
214
|
movedKeys.add(sheetCell.key);
|
|
215
215
|
const previousFormula = sheetCell.formula;
|
|
216
|
-
const newRowIndex = position.rowIndex + rowDelta;
|
|
217
|
-
const newColumnIndex = position.columnIndex + columnDelta;
|
|
216
|
+
const newRowIndex = destinationPosition?.rowIndex ?? position.rowIndex + rowDelta;
|
|
217
|
+
const newColumnIndex = destinationPosition?.columnIndex ?? position.columnIndex + columnDelta;
|
|
218
218
|
const resolvedSheetName = activeSheetName ?? "";
|
|
219
|
-
|
|
219
|
+
// The delta is applied to the references inside `sourceRange`; the formula cell's own
|
|
220
|
+
// destination (for the graph re-key) may differ when it does not move itself.
|
|
221
|
+
sheetCell.moveFormula({ rowIndex: position.rowIndex, columnIndex: position.columnIndex }, {
|
|
222
|
+
rowIndex: position.rowIndex + rowDelta,
|
|
223
|
+
columnIndex: position.columnIndex + columnDelta,
|
|
224
|
+
}, resolvedSheetName, {
|
|
220
225
|
exclusionRange: sourceRange,
|
|
226
|
+
deletedRange,
|
|
221
227
|
rowCount,
|
|
222
228
|
columnCount,
|
|
223
229
|
});
|
|
@@ -22,6 +22,23 @@ export declare const updateNamedRangeName: (formulaValue: string, newName: strin
|
|
|
22
22
|
* @param newName
|
|
23
23
|
*/
|
|
24
24
|
export declare const updateColumnName: (formulaValue: string, newName: string, oldName: string) => string;
|
|
25
|
+
/** The column specifier Excel writes for a deleted table column (`Table1[@#REF!]`). */
|
|
26
|
+
export declare const REF_ERROR_COLUMN = "#REF!";
|
|
27
|
+
/**
|
|
28
|
+
* Rewrite every structured reference into `tableName` to the `#REF!` token —
|
|
29
|
+
* Excel's text for a formula whose table was deleted (`=SUM(Table1[Price])`
|
|
30
|
+
* → `=SUM(#REF!)`), so the cell evaluates to `#REF!` rather than `#NAME?`.
|
|
31
|
+
* Returns the input unchanged when the formula never names the table.
|
|
32
|
+
*/
|
|
33
|
+
export declare const breakTableReferencesInFormula: (formulaValue: string, tableName: string) => string;
|
|
34
|
+
/**
|
|
35
|
+
* Rewrite the column specifiers of `columnNames` inside structured references
|
|
36
|
+
* to `tableName` (or, when `tableName` is undefined, the bare this-row form
|
|
37
|
+
* `[@Col]` whose table is implied by the formula's own cell) to `#REF!` —
|
|
38
|
+
* Excel's text for a deleted table column (`=Table1[@Qty]*2` →
|
|
39
|
+
* `=Table1[@#REF!]*2`). Keeps every other character of the reference as typed.
|
|
40
|
+
*/
|
|
41
|
+
export declare const breakTableColumnsInFormula: (formulaValue: string, tableName: string | undefined, columnNames: string[]) => string;
|
|
25
42
|
/**
|
|
26
43
|
* Converts tokens to string
|
|
27
44
|
* @param tokens
|
|
@@ -46,24 +63,64 @@ export declare const isAbsoluteColumnReference: (formula: string | undefined) =>
|
|
|
46
63
|
* @param formula
|
|
47
64
|
*/
|
|
48
65
|
export declare const isAbsoluteRowReference: (formula: string | undefined) => boolean;
|
|
66
|
+
export type StructuralRangeRewriteOptions = {
|
|
67
|
+
/**
|
|
68
|
+
* Whether references WITHOUT a sheet qualifier resolve to the edited sheet.
|
|
69
|
+
* True for a formula that lives on the edited sheet; false for a formula on
|
|
70
|
+
* another sheet, whose bare `A1:A3` is its own sheet's range and must not
|
|
71
|
+
* move when the edited sheet changes shape.
|
|
72
|
+
*/
|
|
73
|
+
includeUnqualifiedReferences?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Restrict the rewrite to ranges whose PERPENDICULAR span lies inside this
|
|
76
|
+
* band — an insert/delete-cells shift of columns `B:C` only touches ranges
|
|
77
|
+
* that live entirely inside columns B..C (SHF-08); a wider range keeps its
|
|
78
|
+
* address (SHF-07). Whole-column and whole-row references span the entire
|
|
79
|
+
* sheet, so they never fall inside a band.
|
|
80
|
+
*/
|
|
81
|
+
bandSpan?: RangeBandSpan;
|
|
82
|
+
};
|
|
83
|
+
/** Alias kept for callers that import the scope options under this name. */
|
|
84
|
+
export type StructuralFormulaScopeOptions = StructuralRangeRewriteOptions;
|
|
85
|
+
/**
|
|
86
|
+
* Restricts `expandRangesInFormula` / `contractRangesInFormula` to ranges whose PERPENDICULAR span
|
|
87
|
+
* lies within a band — an insert/delete-cells shift of columns `B:C` only expands ranges that live
|
|
88
|
+
* entirely inside columns B..C (SHF-08); a wider range keeps its address (SHF-07). Whole-column and
|
|
89
|
+
* whole-row references span the entire sheet, so they never fall inside a band.
|
|
90
|
+
*/
|
|
91
|
+
export type RangeBandSpan = {
|
|
92
|
+
startIndex: number;
|
|
93
|
+
endIndex: number;
|
|
94
|
+
};
|
|
49
95
|
/**
|
|
50
96
|
* Expands ranges in a formula when rows or columns are inserted within the range
|
|
51
97
|
* @param formula The formula to process
|
|
52
98
|
* @param insertionIndex The row or column index where insertion happens
|
|
53
99
|
* @param count Number of rows or columns being inserted
|
|
54
100
|
* @param dimension Whether inserting 'row' or 'column'
|
|
55
|
-
* @param activeSheetName
|
|
101
|
+
* @param activeSheetName Name of the EDITED sheet: only references that resolve
|
|
102
|
+
* to it are touched
|
|
103
|
+
* @param options `includeUnqualifiedReferences` — whether references without a
|
|
104
|
+
* sheet qualifier resolve to the edited sheet (true when the formula lives on
|
|
105
|
+
* it; false for a formula on another sheet, whose bare `A1:A3` is its own)
|
|
56
106
|
* @returns The formula with expanded ranges, or undefined if no changes
|
|
57
107
|
*/
|
|
58
|
-
export declare const expandRangesInFormula: (formula: string | undefined, insertionIndex: number, count: number, dimension: "row" | "column", activeSheetName: string) => string | undefined;
|
|
108
|
+
export declare const expandRangesInFormula: (formula: string | undefined, insertionIndex: number, count: number, dimension: "row" | "column", activeSheetName: string, options?: StructuralRangeRewriteOptions) => string | undefined;
|
|
59
109
|
/**
|
|
60
110
|
* Contracts ranges in a formula when rows or columns are deleted within the range
|
|
61
111
|
* @param formula The formula to process
|
|
62
112
|
* @param deletionIndex The row or column index where deletion starts
|
|
63
113
|
* @param count Number of rows or columns being deleted
|
|
64
114
|
* @param dimension Whether deleting 'row' or 'column'
|
|
65
|
-
* @param activeSheetName
|
|
115
|
+
* @param activeSheetName Name of the EDITED sheet: only references that resolve
|
|
116
|
+
* to it are touched
|
|
117
|
+
* @param options `includeUnqualifiedReferences` — see `expandRangesInFormula`
|
|
66
118
|
* @returns The formula with contracted ranges, or undefined if no changes
|
|
119
|
+
*
|
|
120
|
+
* Excel semantics for the deleted band: a range whose rows/columns are ALL
|
|
121
|
+
* deleted becomes the `#REF!` token (`=SUM(A2:A3)` → `=SUM(#REF!)`); a single
|
|
122
|
+
* cell reference into the band becomes `#REF!` (`=A3+1` → `=#REF!+1`, a spill
|
|
123
|
+
* reference `=C1#` → `=#REF!#`); a partially covered range shrinks.
|
|
67
124
|
*/
|
|
68
|
-
export declare const contractRangesInFormula: (formula: string | undefined, deletionIndex: number, count: number, dimension: "row" | "column", activeSheetName: string) => string | undefined;
|
|
125
|
+
export declare const contractRangesInFormula: (formula: string | undefined, deletionIndex: number, count: number, dimension: "row" | "column", activeSheetName: string, options?: StructuralRangeRewriteOptions) => string | undefined;
|
|
69
126
|
//# sourceMappingURL=formula.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formula.d.ts","sourceRoot":"","sources":["../../../api/formula.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formula.d.ts","sourceRoot":"","sources":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