@rowsncolumns/spreadsheet-state 28.0.76 → 29.1.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 +122 -6
- package/dist/cjs/api/anchored-objects.d.ts.map +1 -1
- package/dist/cjs/api/anchored-objects.js +464 -43
- package/dist/cjs/api/copy-paste.d.ts +8 -2
- package/dist/cjs/api/copy-paste.d.ts.map +1 -1
- package/dist/cjs/api/copy-paste.js +4 -4
- package/dist/cjs/api/filter.d.ts +15 -1
- package/dist/cjs/api/filter.d.ts.map +1 -1
- package/dist/cjs/api/filter.js +32 -2
- package/dist/cjs/api/formula.d.ts +63 -0
- package/dist/cjs/api/formula.d.ts.map +1 -1
- package/dist/cjs/api/formula.js +278 -8
- 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 +8 -0
- package/dist/cjs/api/merges.d.ts.map +1 -1
- package/dist/cjs/api/merges.js +11 -0
- package/dist/cjs/api/paint-format.d.ts +22 -1
- package/dist/cjs/api/paint-format.d.ts.map +1 -1
- package/dist/cjs/api/paint-format.js +57 -1
- package/dist/cjs/api/sort.d.ts +23 -1
- package/dist/cjs/api/sort.d.ts.map +1 -1
- package/dist/cjs/api/sort.js +52 -6
- package/dist/cjs/api/structural-guards.d.ts +57 -0
- package/dist/cjs/api/structural-guards.d.ts.map +1 -1
- package/dist/cjs/api/structural-guards.js +93 -1
- package/dist/cjs/api/structural-table-refs.d.ts +58 -3
- package/dist/cjs/api/structural-table-refs.d.ts.map +1 -1
- package/dist/cjs/api/structural-table-refs.js +177 -16
- 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/api/table.d.ts +26 -2
- package/dist/cjs/api/table.d.ts.map +1 -1
- package/dist/cjs/api/table.js +93 -60
- package/dist/cjs/api/validation.d.ts.map +1 -1
- package/dist/cjs/api/validation.js +53 -8
- package/dist/cjs/atoms/creating-table.atom.d.ts +22 -0
- package/dist/cjs/atoms/creating-table.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/creating-table.atom.js +4 -0
- package/dist/cjs/atoms/dialog-state.atom.d.ts +8 -0
- package/dist/cjs/atoms/dialog-state.atom.d.ts.map +1 -1
- package/dist/cjs/atoms/dialog-state.atom.js +28 -0
- package/dist/cjs/atoms/editing-slicer.atom.d.ts +9 -0
- package/dist/cjs/atoms/editing-slicer.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/editing-slicer.atom.js +6 -0
- package/dist/cjs/atoms/index.d.ts +4 -0
- package/dist/cjs/atoms/index.d.ts.map +1 -1
- package/dist/cjs/atoms/index.js +4 -0
- package/dist/cjs/atoms/inserting-slicer.atom.d.ts +8 -0
- package/dist/cjs/atoms/inserting-slicer.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/inserting-slicer.atom.js +5 -0
- package/dist/cjs/atoms/resizing-table.atom.d.ts +8 -0
- package/dist/cjs/atoms/resizing-table.atom.d.ts.map +1 -0
- package/dist/cjs/atoms/resizing-table.atom.js +5 -0
- package/dist/cjs/commands.d.ts +138 -2
- package/dist/cjs/commands.d.ts.map +1 -1
- package/dist/cjs/components/editors/embed-editor.d.ts +4 -2
- package/dist/cjs/components/editors/embed-editor.d.ts.map +1 -1
- package/dist/cjs/components/editors/embed-editor.js +38 -9
- package/dist/cjs/components/editors/slicer-editor.d.ts +15 -0
- package/dist/cjs/components/editors/slicer-editor.d.ts.map +1 -0
- package/dist/cjs/components/editors/slicer-editor.js +87 -0
- package/dist/cjs/components/editors/table-editor.d.ts +58 -2
- package/dist/cjs/components/editors/table-editor.d.ts.map +1 -1
- package/dist/cjs/components/editors/table-editor.js +261 -20
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.d.ts.map +1 -1
- package/dist/cjs/components/index.js +1 -0
- package/dist/cjs/constants.d.ts +9 -1
- package/dist/cjs/constants.d.ts.map +1 -1
- package/dist/cjs/constants.js +12 -0
- package/dist/cjs/generated-names.d.ts +13 -3
- package/dist/cjs/generated-names.d.ts.map +1 -1
- package/dist/cjs/generated-names.js +3 -1
- package/dist/cjs/helpers.d.ts +5 -0
- package/dist/cjs/helpers.d.ts.map +1 -1
- package/dist/cjs/helpers.js +10 -1
- package/dist/cjs/hooks/use-on-change-batch.d.ts +19 -2
- package/dist/cjs/hooks/use-on-change-batch.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-change-batch.js +43 -35
- package/dist/cjs/hooks/use-on-change-calculated-column.d.ts +10 -1
- package/dist/cjs/hooks/use-on-change-calculated-column.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-change-calculated-column.js +17 -5
- package/dist/cjs/hooks/use-on-change-table-column.d.ts +6 -1
- package/dist/cjs/hooks/use-on-change-table-column.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-change-table-column.js +17 -5
- package/dist/cjs/hooks/use-on-change.d.ts +36 -3
- package/dist/cjs/hooks/use-on-change.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-change.js +218 -136
- 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-create-custom-table-style.d.ts +17 -0
- package/dist/cjs/hooks/use-on-create-custom-table-style.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-create-custom-table-style.js +28 -0
- package/dist/cjs/hooks/use-on-create-named-range.d.ts +4 -2
- package/dist/cjs/hooks/use-on-create-named-range.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-create-named-range.js +11 -1
- package/dist/cjs/hooks/use-on-delete-cells-shift-left.d.ts +2 -1
- 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 +3 -1
- package/dist/cjs/hooks/use-on-delete-cells-shift-up.d.ts +2 -1
- 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 +3 -1
- package/dist/cjs/hooks/use-on-delete-column.d.ts +2 -1
- package/dist/cjs/hooks/use-on-delete-column.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-delete-column.js +3 -1
- package/dist/cjs/hooks/use-on-delete-row.d.ts +2 -1
- package/dist/cjs/hooks/use-on-delete-row.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-delete-row.js +3 -1
- package/dist/cjs/hooks/use-on-delete-sheet.d.ts +9 -1
- package/dist/cjs/hooks/use-on-delete-sheet.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-delete-sheet.js +17 -1
- package/dist/cjs/hooks/use-on-delete-table-row.d.ts +4 -1
- package/dist/cjs/hooks/use-on-delete-table-row.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-delete-table-row.js +19 -1
- package/dist/cjs/hooks/use-on-delete.d.ts +5 -2
- package/dist/cjs/hooks/use-on-delete.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-delete.js +5 -1
- package/dist/cjs/hooks/use-on-embeds.d.ts +7 -4
- package/dist/cjs/hooks/use-on-embeds.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-embeds.js +26 -24
- package/dist/cjs/hooks/use-on-fill.d.ts +17 -2
- package/dist/cjs/hooks/use-on-fill.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-fill.js +29 -15
- package/dist/cjs/hooks/use-on-filter-table.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-filter-table.js +209 -103
- package/dist/cjs/hooks/use-on-import-excel.d.ts +2 -1
- package/dist/cjs/hooks/use-on-import-excel.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-import-excel.js +22 -19
- package/dist/cjs/hooks/use-on-insert-cells-shift-down.d.ts +2 -1
- 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 +3 -1
- package/dist/cjs/hooks/use-on-insert-cells-shift-right.d.ts +2 -1
- 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 +3 -1
- package/dist/cjs/hooks/use-on-insert-column.d.ts +2 -1
- package/dist/cjs/hooks/use-on-insert-column.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-insert-column.js +3 -1
- package/dist/cjs/hooks/use-on-insert-row.d.ts +2 -1
- package/dist/cjs/hooks/use-on-insert-row.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-insert-row.js +3 -1
- package/dist/cjs/hooks/use-on-insert-table-row.d.ts +5 -2
- package/dist/cjs/hooks/use-on-insert-table-row.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-insert-table-row.js +19 -1
- package/dist/cjs/hooks/use-on-merge-unmerge-cells.d.ts +3 -2
- package/dist/cjs/hooks/use-on-merge-unmerge-cells.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-merge-unmerge-cells.js +14 -1
- package/dist/cjs/hooks/use-on-move-columns.d.ts +4 -1
- package/dist/cjs/hooks/use-on-move-columns.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-move-columns.js +28 -6
- package/dist/cjs/hooks/use-on-move-rows.d.ts +18 -1
- package/dist/cjs/hooks/use-on-move-rows.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-move-rows.js +44 -6
- package/dist/cjs/hooks/use-on-move-selection.d.ts +9 -2
- package/dist/cjs/hooks/use-on-move-selection.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-move-selection.js +101 -25
- package/dist/cjs/hooks/use-on-paste.d.ts +33 -2
- package/dist/cjs/hooks/use-on-paste.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-paste.js +1005 -740
- package/dist/cjs/hooks/use-on-remove-duplicates.d.ts +5 -2
- package/dist/cjs/hooks/use-on-remove-duplicates.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-remove-duplicates.js +5 -1
- package/dist/cjs/hooks/use-on-request-create-table.d.ts +13 -0
- package/dist/cjs/hooks/use-on-request-create-table.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-request-create-table.js +44 -0
- package/dist/cjs/hooks/use-on-request-insert-slicer.d.ts +7 -0
- package/dist/cjs/hooks/use-on-request-insert-slicer.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-request-insert-slicer.js +15 -0
- package/dist/cjs/hooks/use-on-request-resize-table.d.ts +7 -0
- package/dist/cjs/hooks/use-on-request-resize-table.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-request-resize-table.js +15 -0
- package/dist/cjs/hooks/use-on-resize-table.d.ts +5 -1
- package/dist/cjs/hooks/use-on-resize-table.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-resize-table.js +110 -33
- package/dist/cjs/hooks/use-on-sort-column.d.ts +28 -3
- package/dist/cjs/hooks/use-on-sort-column.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-sort-column.js +136 -90
- package/dist/cjs/hooks/use-on-sort-range.d.ts +26 -3
- package/dist/cjs/hooks/use-on-sort-range.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-sort-range.js +113 -67
- package/dist/cjs/hooks/use-on-sort-table.d.ts +18 -1
- package/dist/cjs/hooks/use-on-sort-table.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-sort-table.js +128 -98
- package/dist/cjs/hooks/use-on-subtotal.d.ts +10 -3
- package/dist/cjs/hooks/use-on-subtotal.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-subtotal.js +13 -9
- package/dist/cjs/hooks/use-on-table.d.ts +39 -7
- package/dist/cjs/hooks/use-on-table.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-table.js +257 -49
- package/dist/cjs/hooks/use-on-undo-calculated-column.d.ts +23 -0
- package/dist/cjs/hooks/use-on-undo-calculated-column.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-undo-calculated-column.js +70 -0
- package/dist/cjs/hooks/use-on-undo-table-auto-expansion.d.ts +28 -0
- package/dist/cjs/hooks/use-on-undo-table-auto-expansion.d.ts.map +1 -0
- package/dist/cjs/hooks/use-on-undo-table-auto-expansion.js +96 -0
- package/dist/cjs/hooks/use-on-update-named-range.d.ts +4 -2
- package/dist/cjs/hooks/use-on-update-named-range.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-update-named-range.js +13 -1
- package/dist/cjs/hooks/use-sheet-properties.d.ts +1 -0
- package/dist/cjs/hooks/use-sheet-properties.d.ts.map +1 -1
- package/dist/cjs/hooks/use-sheet-properties.js +54 -34
- package/dist/cjs/hooks/use-slicers.d.ts +2 -2
- package/dist/cjs/hooks/use-slicers.d.ts.map +1 -1
- package/dist/cjs/hooks/use-slicers.js +17 -26
- package/dist/cjs/hooks/use-sparkline-groups.d.ts +50 -0
- package/dist/cjs/hooks/use-sparkline-groups.d.ts.map +1 -0
- package/dist/cjs/hooks/use-sparkline-groups.js +192 -0
- package/dist/cjs/hooks/use-spreadsheet-state.d.ts +69 -12
- package/dist/cjs/hooks/use-spreadsheet-state.d.ts.map +1 -1
- package/dist/cjs/hooks/use-spreadsheet-state.js +383 -84
- package/dist/cjs/hooks/use-structured-reference.d.ts.map +1 -1
- package/dist/cjs/hooks/use-structured-reference.js +17 -0
- package/dist/cjs/hooks/use-undo-redo-actions.d.ts +2 -1
- package/dist/cjs/hooks/use-undo-redo-actions.d.ts.map +1 -1
- package/dist/cjs/hooks/use-undo-redo-actions.js +10 -2
- package/dist/cjs/hooks/use-undo-redo.d.ts +12 -0
- package/dist/cjs/hooks/use-undo-redo.d.ts.map +1 -1
- package/dist/cjs/hooks/use-undo-redo.js +169 -10
- package/dist/cjs/hooks/utils/sort-rows.d.ts.map +1 -1
- package/dist/cjs/hooks/utils/sort-rows.js +4 -3
- package/dist/cjs/index.d.ts +8 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +9 -0
- package/dist/cjs/interface/apply-fill.d.ts +26 -3
- package/dist/cjs/interface/apply-fill.d.ts.map +1 -1
- package/dist/cjs/interface/apply-fill.js +207 -98
- package/dist/cjs/interface/change-batch.d.ts +1 -1
- package/dist/cjs/interface/change-batch.d.ts.map +1 -1
- package/dist/cjs/interface/change-batch.js +112 -15
- package/dist/cjs/interface/change-calculated-column.d.ts +6 -2
- package/dist/cjs/interface/change-calculated-column.d.ts.map +1 -1
- package/dist/cjs/interface/change-calculated-column.js +87 -17
- package/dist/cjs/interface/change-table-column.d.ts +81 -7
- package/dist/cjs/interface/change-table-column.d.ts.map +1 -1
- package/dist/cjs/interface/change-table-column.js +336 -76
- package/dist/cjs/interface/create-table.d.ts +15 -3
- package/dist/cjs/interface/create-table.d.ts.map +1 -1
- package/dist/cjs/interface/create-table.js +100 -25
- package/dist/cjs/interface/delete-cells-shift-left.d.ts +1 -1
- package/dist/cjs/interface/delete-cells-shift-left.d.ts.map +1 -1
- package/dist/cjs/interface/delete-cells-shift-left.js +10 -1
- package/dist/cjs/interface/delete-cells-shift-up.d.ts +1 -1
- package/dist/cjs/interface/delete-cells-shift-up.d.ts.map +1 -1
- package/dist/cjs/interface/delete-cells-shift-up.js +10 -1
- package/dist/cjs/interface/delete-cells.d.ts +1 -1
- package/dist/cjs/interface/delete-cells.d.ts.map +1 -1
- package/dist/cjs/interface/delete-cells.js +81 -25
- 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 +29 -22
- 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 +244 -39
- package/dist/cjs/interface/delete-sheet.d.ts +2 -2
- package/dist/cjs/interface/delete-sheet.d.ts.map +1 -1
- package/dist/cjs/interface/delete-sheet.js +118 -1
- package/dist/cjs/interface/delete-table-column.d.ts +1 -1
- package/dist/cjs/interface/delete-table-column.d.ts.map +1 -1
- package/dist/cjs/interface/delete-table-column.js +11 -1
- package/dist/cjs/interface/delete-table-row.d.ts +1 -1
- package/dist/cjs/interface/delete-table-row.d.ts.map +1 -1
- package/dist/cjs/interface/delete-table-row.js +361 -275
- package/dist/cjs/interface/duplicate-sheet.d.ts.map +1 -1
- package/dist/cjs/interface/duplicate-sheet.js +83 -31
- package/dist/cjs/interface/embeds.d.ts +10 -1
- package/dist/cjs/interface/embeds.d.ts.map +1 -1
- package/dist/cjs/interface/embeds.js +120 -6
- package/dist/cjs/interface/insert-cells-shift-down.d.ts +1 -1
- package/dist/cjs/interface/insert-cells-shift-down.d.ts.map +1 -1
- package/dist/cjs/interface/insert-cells-shift-down.js +10 -1
- package/dist/cjs/interface/insert-cells-shift-right.d.ts +1 -1
- package/dist/cjs/interface/insert-cells-shift-right.d.ts.map +1 -1
- package/dist/cjs/interface/insert-cells-shift-right.js +10 -1
- package/dist/cjs/interface/insert-column.d.ts +2 -2
- package/dist/cjs/interface/insert-column.d.ts.map +1 -1
- package/dist/cjs/interface/insert-column.js +101 -56
- 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 +25 -7
- package/dist/cjs/interface/insert-table-row.d.ts +2 -1
- package/dist/cjs/interface/insert-table-row.d.ts.map +1 -1
- package/dist/cjs/interface/insert-table-row.js +70 -19
- package/dist/cjs/interface/remove-duplicates.d.ts +1 -1
- package/dist/cjs/interface/remove-duplicates.d.ts.map +1 -1
- package/dist/cjs/interface/remove-duplicates.js +46 -6
- package/dist/cjs/interface/remove-table.d.ts +1 -1
- package/dist/cjs/interface/remove-table.d.ts.map +1 -1
- package/dist/cjs/interface/remove-table.js +72 -16
- package/dist/cjs/interface/slicers.d.ts +12 -1
- package/dist/cjs/interface/slicers.d.ts.map +1 -1
- package/dist/cjs/interface/slicers.js +47 -2
- package/dist/cjs/interface/spreadsheet-interface.d.ts +1 -1
- package/dist/cjs/interface/spreadsheet-interface.d.ts.map +1 -1
- package/dist/cjs/interface/spreadsheet-interface.js +64 -1
- package/dist/cjs/interface/table-totalrow.d.ts +13 -1
- package/dist/cjs/interface/table-totalrow.d.ts.map +1 -1
- package/dist/cjs/interface/table-totalrow.js +107 -73
- package/dist/cjs/interface/table-utils.d.ts +59 -6
- package/dist/cjs/interface/table-utils.d.ts.map +1 -1
- package/dist/cjs/interface/table-utils.js +211 -15
- package/dist/cjs/interface/update-table.d.ts +16 -1
- package/dist/cjs/interface/update-table.d.ts.map +1 -1
- package/dist/cjs/interface/update-table.js +190 -44
- package/dist/cjs/sheet-cell.d.ts.map +1 -1
- package/dist/cjs/test-setup.d.ts.map +1 -1
- package/dist/cjs/test-setup.js +6 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/cjs/validation-schema/table.schema.d.ts +11 -0
- package/dist/cjs/validation-schema/table.schema.d.ts.map +1 -1
- package/dist/cjs/validation-schema/table.schema.js +20 -3
- package/dist/esm/api/anchored-objects.d.ts +122 -6
- package/dist/esm/api/anchored-objects.d.ts.map +1 -1
- package/dist/esm/api/anchored-objects.js +375 -15
- package/dist/esm/api/copy-paste.d.ts +8 -2
- package/dist/esm/api/copy-paste.d.ts.map +1 -1
- package/dist/esm/api/copy-paste.js +4 -4
- package/dist/esm/api/filter.d.ts +15 -1
- package/dist/esm/api/filter.d.ts.map +1 -1
- package/dist/esm/api/filter.js +28 -0
- package/dist/esm/api/formula.d.ts +63 -0
- package/dist/esm/api/formula.d.ts.map +1 -1
- package/dist/esm/api/formula.js +235 -8
- 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 +8 -0
- package/dist/esm/api/merges.d.ts.map +1 -1
- package/dist/esm/api/merges.js +9 -0
- package/dist/esm/api/paint-format.d.ts +22 -1
- package/dist/esm/api/paint-format.d.ts.map +1 -1
- package/dist/esm/api/paint-format.js +44 -1
- package/dist/esm/api/sort.d.ts +23 -1
- package/dist/esm/api/sort.d.ts.map +1 -1
- package/dist/esm/api/sort.js +45 -6
- package/dist/esm/api/structural-guards.d.ts +57 -0
- package/dist/esm/api/structural-guards.d.ts.map +1 -1
- package/dist/esm/api/structural-guards.js +85 -0
- package/dist/esm/api/structural-table-refs.d.ts +58 -3
- package/dist/esm/api/structural-table-refs.d.ts.map +1 -1
- package/dist/esm/api/structural-table-refs.js +126 -6
- 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/api/table.d.ts +26 -2
- package/dist/esm/api/table.d.ts.map +1 -1
- package/dist/esm/api/table.js +70 -48
- package/dist/esm/api/validation.d.ts.map +1 -1
- package/dist/esm/api/validation.js +53 -8
- package/dist/esm/atoms/creating-table.atom.d.ts +22 -0
- package/dist/esm/atoms/creating-table.atom.d.ts.map +1 -0
- package/dist/esm/atoms/creating-table.atom.js +4 -0
- package/dist/esm/atoms/dialog-state.atom.d.ts +8 -0
- package/dist/esm/atoms/dialog-state.atom.d.ts.map +1 -1
- package/dist/esm/atoms/dialog-state.atom.js +12 -0
- package/dist/esm/atoms/editing-slicer.atom.d.ts +9 -0
- package/dist/esm/atoms/editing-slicer.atom.d.ts.map +1 -0
- package/dist/esm/atoms/editing-slicer.atom.js +6 -0
- package/dist/esm/atoms/index.d.ts +4 -0
- package/dist/esm/atoms/index.d.ts.map +1 -1
- package/dist/esm/atoms/index.js +4 -0
- package/dist/esm/atoms/inserting-slicer.atom.d.ts +8 -0
- package/dist/esm/atoms/inserting-slicer.atom.d.ts.map +1 -0
- package/dist/esm/atoms/inserting-slicer.atom.js +5 -0
- package/dist/esm/atoms/resizing-table.atom.d.ts +8 -0
- package/dist/esm/atoms/resizing-table.atom.d.ts.map +1 -0
- package/dist/esm/atoms/resizing-table.atom.js +5 -0
- package/dist/esm/commands.d.ts +138 -2
- package/dist/esm/commands.d.ts.map +1 -1
- package/dist/esm/components/editors/embed-editor.d.ts +4 -2
- package/dist/esm/components/editors/embed-editor.d.ts.map +1 -1
- package/dist/esm/components/editors/embed-editor.js +40 -6
- package/dist/esm/components/editors/slicer-editor.d.ts +15 -0
- package/dist/esm/components/editors/slicer-editor.d.ts.map +1 -0
- package/dist/esm/components/editors/slicer-editor.js +85 -0
- package/dist/esm/components/editors/table-editor.d.ts +58 -2
- package/dist/esm/components/editors/table-editor.d.ts.map +1 -1
- package/dist/esm/components/editors/table-editor.js +243 -19
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/constants.d.ts +9 -1
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/constants.js +12 -0
- package/dist/esm/generated-names.d.ts +13 -3
- package/dist/esm/generated-names.d.ts.map +1 -1
- package/dist/esm/generated-names.js +3 -1
- package/dist/esm/helpers.d.ts +5 -0
- package/dist/esm/helpers.d.ts.map +1 -1
- package/dist/esm/helpers.js +7 -1
- package/dist/esm/hooks/use-on-change-batch.d.ts +19 -2
- package/dist/esm/hooks/use-on-change-batch.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-change-batch.js +19 -3
- package/dist/esm/hooks/use-on-change-calculated-column.d.ts +10 -1
- package/dist/esm/hooks/use-on-change-calculated-column.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-change-calculated-column.js +17 -5
- package/dist/esm/hooks/use-on-change-table-column.d.ts +6 -1
- package/dist/esm/hooks/use-on-change-table-column.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-change-table-column.js +17 -5
- package/dist/esm/hooks/use-on-change.d.ts +36 -3
- package/dist/esm/hooks/use-on-change.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-change.js +214 -124
- 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-create-custom-table-style.d.ts +17 -0
- package/dist/esm/hooks/use-on-create-custom-table-style.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-create-custom-table-style.js +26 -0
- package/dist/esm/hooks/use-on-create-named-range.d.ts +4 -2
- package/dist/esm/hooks/use-on-create-named-range.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-create-named-range.js +11 -1
- package/dist/esm/hooks/use-on-delete-cells-shift-left.d.ts +2 -1
- 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 +3 -1
- package/dist/esm/hooks/use-on-delete-cells-shift-up.d.ts +2 -1
- 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 +3 -1
- package/dist/esm/hooks/use-on-delete-column.d.ts +2 -1
- package/dist/esm/hooks/use-on-delete-column.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-delete-column.js +3 -1
- package/dist/esm/hooks/use-on-delete-row.d.ts +2 -1
- package/dist/esm/hooks/use-on-delete-row.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-delete-row.js +3 -1
- package/dist/esm/hooks/use-on-delete-sheet.d.ts +9 -1
- package/dist/esm/hooks/use-on-delete-sheet.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-delete-sheet.js +17 -1
- package/dist/esm/hooks/use-on-delete-table-row.d.ts +4 -1
- package/dist/esm/hooks/use-on-delete-table-row.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-delete-table-row.js +19 -1
- package/dist/esm/hooks/use-on-delete.d.ts +5 -2
- package/dist/esm/hooks/use-on-delete.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-delete.js +5 -1
- package/dist/esm/hooks/use-on-embeds.d.ts +7 -4
- package/dist/esm/hooks/use-on-embeds.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-embeds.js +23 -6
- package/dist/esm/hooks/use-on-fill.d.ts +17 -2
- package/dist/esm/hooks/use-on-fill.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-fill.js +27 -1
- package/dist/esm/hooks/use-on-filter-table.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-filter-table.js +97 -26
- package/dist/esm/hooks/use-on-import-excel.d.ts +2 -1
- package/dist/esm/hooks/use-on-import-excel.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-import-excel.js +4 -1
- package/dist/esm/hooks/use-on-insert-cells-shift-down.d.ts +2 -1
- 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 +3 -1
- package/dist/esm/hooks/use-on-insert-cells-shift-right.d.ts +2 -1
- 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 +3 -1
- package/dist/esm/hooks/use-on-insert-column.d.ts +2 -1
- package/dist/esm/hooks/use-on-insert-column.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-insert-column.js +3 -1
- package/dist/esm/hooks/use-on-insert-row.d.ts +2 -1
- package/dist/esm/hooks/use-on-insert-row.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-insert-row.js +3 -1
- package/dist/esm/hooks/use-on-insert-table-row.d.ts +5 -2
- package/dist/esm/hooks/use-on-insert-table-row.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-insert-table-row.js +19 -1
- package/dist/esm/hooks/use-on-merge-unmerge-cells.d.ts +3 -2
- package/dist/esm/hooks/use-on-merge-unmerge-cells.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-merge-unmerge-cells.js +12 -1
- package/dist/esm/hooks/use-on-move-columns.d.ts +4 -1
- package/dist/esm/hooks/use-on-move-columns.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-move-columns.js +28 -6
- package/dist/esm/hooks/use-on-move-rows.d.ts +18 -1
- package/dist/esm/hooks/use-on-move-rows.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-move-rows.js +44 -6
- package/dist/esm/hooks/use-on-move-selection.d.ts +9 -2
- package/dist/esm/hooks/use-on-move-selection.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-move-selection.js +57 -1
- package/dist/esm/hooks/use-on-paste.d.ts +33 -2
- package/dist/esm/hooks/use-on-paste.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-paste.js +825 -643
- package/dist/esm/hooks/use-on-remove-duplicates.d.ts +5 -2
- package/dist/esm/hooks/use-on-remove-duplicates.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-remove-duplicates.js +5 -1
- package/dist/esm/hooks/use-on-request-create-table.d.ts +13 -0
- package/dist/esm/hooks/use-on-request-create-table.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-request-create-table.js +43 -0
- package/dist/esm/hooks/use-on-request-insert-slicer.d.ts +7 -0
- package/dist/esm/hooks/use-on-request-insert-slicer.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-request-insert-slicer.js +15 -0
- package/dist/esm/hooks/use-on-request-resize-table.d.ts +7 -0
- package/dist/esm/hooks/use-on-request-resize-table.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-request-resize-table.js +15 -0
- package/dist/esm/hooks/use-on-resize-table.d.ts +5 -1
- package/dist/esm/hooks/use-on-resize-table.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-resize-table.js +107 -27
- package/dist/esm/hooks/use-on-sort-column.d.ts +28 -3
- package/dist/esm/hooks/use-on-sort-column.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-sort-column.js +105 -68
- package/dist/esm/hooks/use-on-sort-range.d.ts +26 -3
- package/dist/esm/hooks/use-on-sort-range.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-sort-range.js +100 -64
- package/dist/esm/hooks/use-on-sort-table.d.ts +18 -1
- package/dist/esm/hooks/use-on-sort-table.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-sort-table.js +107 -86
- package/dist/esm/hooks/use-on-subtotal.d.ts +10 -3
- package/dist/esm/hooks/use-on-subtotal.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-subtotal.js +7 -5
- package/dist/esm/hooks/use-on-table.d.ts +39 -7
- package/dist/esm/hooks/use-on-table.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-table.js +234 -26
- package/dist/esm/hooks/use-on-undo-calculated-column.d.ts +23 -0
- package/dist/esm/hooks/use-on-undo-calculated-column.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-undo-calculated-column.js +62 -0
- package/dist/esm/hooks/use-on-undo-table-auto-expansion.d.ts +28 -0
- package/dist/esm/hooks/use-on-undo-table-auto-expansion.d.ts.map +1 -0
- package/dist/esm/hooks/use-on-undo-table-auto-expansion.js +75 -0
- package/dist/esm/hooks/use-on-update-named-range.d.ts +4 -2
- package/dist/esm/hooks/use-on-update-named-range.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-update-named-range.js +13 -1
- package/dist/esm/hooks/use-sheet-properties.d.ts +1 -0
- package/dist/esm/hooks/use-sheet-properties.d.ts.map +1 -1
- package/dist/esm/hooks/use-sheet-properties.js +38 -19
- package/dist/esm/hooks/use-slicers.d.ts +2 -2
- package/dist/esm/hooks/use-slicers.d.ts.map +1 -1
- package/dist/esm/hooks/use-slicers.js +16 -8
- package/dist/esm/hooks/use-sparkline-groups.d.ts +50 -0
- package/dist/esm/hooks/use-sparkline-groups.d.ts.map +1 -0
- package/dist/esm/hooks/use-sparkline-groups.js +146 -0
- package/dist/esm/hooks/use-spreadsheet-state.d.ts +69 -12
- package/dist/esm/hooks/use-spreadsheet-state.d.ts.map +1 -1
- package/dist/esm/hooks/use-spreadsheet-state.js +321 -14
- package/dist/esm/hooks/use-structured-reference.d.ts.map +1 -1
- package/dist/esm/hooks/use-structured-reference.js +17 -0
- package/dist/esm/hooks/use-undo-redo-actions.d.ts +2 -1
- package/dist/esm/hooks/use-undo-redo-actions.d.ts.map +1 -1
- package/dist/esm/hooks/use-undo-redo-actions.js +8 -2
- package/dist/esm/hooks/use-undo-redo.d.ts +12 -0
- package/dist/esm/hooks/use-undo-redo.d.ts.map +1 -1
- package/dist/esm/hooks/use-undo-redo.js +158 -7
- package/dist/esm/hooks/utils/sort-rows.d.ts.map +1 -1
- package/dist/esm/hooks/utils/sort-rows.js +4 -3
- package/dist/esm/index.d.ts +8 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +9 -0
- package/dist/esm/interface/apply-fill.d.ts +26 -3
- package/dist/esm/interface/apply-fill.d.ts.map +1 -1
- package/dist/esm/interface/apply-fill.js +188 -88
- package/dist/esm/interface/change-batch.d.ts +1 -1
- package/dist/esm/interface/change-batch.d.ts.map +1 -1
- package/dist/esm/interface/change-batch.js +89 -8
- package/dist/esm/interface/change-calculated-column.d.ts +6 -2
- package/dist/esm/interface/change-calculated-column.d.ts.map +1 -1
- package/dist/esm/interface/change-calculated-column.js +81 -16
- package/dist/esm/interface/change-table-column.d.ts +81 -7
- package/dist/esm/interface/change-table-column.d.ts.map +1 -1
- package/dist/esm/interface/change-table-column.js +295 -67
- package/dist/esm/interface/create-table.d.ts +15 -3
- package/dist/esm/interface/create-table.d.ts.map +1 -1
- package/dist/esm/interface/create-table.js +103 -27
- package/dist/esm/interface/delete-cells-shift-left.d.ts +1 -1
- package/dist/esm/interface/delete-cells-shift-left.d.ts.map +1 -1
- package/dist/esm/interface/delete-cells-shift-left.js +10 -1
- package/dist/esm/interface/delete-cells-shift-up.d.ts +1 -1
- package/dist/esm/interface/delete-cells-shift-up.d.ts.map +1 -1
- package/dist/esm/interface/delete-cells-shift-up.js +10 -1
- package/dist/esm/interface/delete-cells.d.ts +1 -1
- package/dist/esm/interface/delete-cells.d.ts.map +1 -1
- package/dist/esm/interface/delete-cells.js +47 -14
- 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 +26 -30
- 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 +191 -44
- package/dist/esm/interface/delete-sheet.d.ts +2 -2
- package/dist/esm/interface/delete-sheet.d.ts.map +1 -1
- package/dist/esm/interface/delete-sheet.js +113 -1
- package/dist/esm/interface/delete-table-column.d.ts +1 -1
- package/dist/esm/interface/delete-table-column.d.ts.map +1 -1
- package/dist/esm/interface/delete-table-column.js +11 -1
- package/dist/esm/interface/delete-table-row.d.ts +1 -1
- package/dist/esm/interface/delete-table-row.d.ts.map +1 -1
- package/dist/esm/interface/delete-table-row.js +312 -232
- package/dist/esm/interface/duplicate-sheet.d.ts.map +1 -1
- package/dist/esm/interface/duplicate-sheet.js +73 -26
- package/dist/esm/interface/embeds.d.ts +10 -1
- package/dist/esm/interface/embeds.d.ts.map +1 -1
- package/dist/esm/interface/embeds.js +84 -5
- package/dist/esm/interface/insert-cells-shift-down.d.ts +1 -1
- package/dist/esm/interface/insert-cells-shift-down.d.ts.map +1 -1
- package/dist/esm/interface/insert-cells-shift-down.js +10 -1
- package/dist/esm/interface/insert-cells-shift-right.d.ts +1 -1
- package/dist/esm/interface/insert-cells-shift-right.d.ts.map +1 -1
- package/dist/esm/interface/insert-cells-shift-right.js +10 -1
- package/dist/esm/interface/insert-column.d.ts +2 -2
- package/dist/esm/interface/insert-column.d.ts.map +1 -1
- package/dist/esm/interface/insert-column.js +70 -33
- 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 +22 -6
- package/dist/esm/interface/insert-table-row.d.ts +2 -1
- package/dist/esm/interface/insert-table-row.d.ts.map +1 -1
- package/dist/esm/interface/insert-table-row.js +67 -12
- package/dist/esm/interface/remove-duplicates.d.ts +1 -1
- package/dist/esm/interface/remove-duplicates.d.ts.map +1 -1
- package/dist/esm/interface/remove-duplicates.js +41 -6
- package/dist/esm/interface/remove-table.d.ts +1 -1
- package/dist/esm/interface/remove-table.d.ts.map +1 -1
- package/dist/esm/interface/remove-table.js +58 -10
- package/dist/esm/interface/slicers.d.ts +12 -1
- package/dist/esm/interface/slicers.d.ts.map +1 -1
- package/dist/esm/interface/slicers.js +44 -2
- package/dist/esm/interface/spreadsheet-interface.d.ts +1 -1
- package/dist/esm/interface/spreadsheet-interface.d.ts.map +1 -1
- package/dist/esm/interface/spreadsheet-interface.js +73 -1
- package/dist/esm/interface/table-totalrow.d.ts +13 -1
- package/dist/esm/interface/table-totalrow.d.ts.map +1 -1
- package/dist/esm/interface/table-totalrow.js +98 -68
- package/dist/esm/interface/table-utils.d.ts +59 -6
- package/dist/esm/interface/table-utils.d.ts.map +1 -1
- package/dist/esm/interface/table-utils.js +155 -14
- package/dist/esm/interface/update-table.d.ts +16 -1
- package/dist/esm/interface/update-table.d.ts.map +1 -1
- package/dist/esm/interface/update-table.js +203 -42
- package/dist/esm/sheet-cell.d.ts.map +1 -1
- package/dist/esm/test-setup.d.ts.map +1 -1
- package/dist/esm/test-setup.js +6 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/validation-schema/table.schema.d.ts +11 -0
- package/dist/esm/validation-schema/table.schema.d.ts.map +1 -1
- package/dist/esm/validation-schema/table.schema.js +15 -2
- package/package.json +25 -17
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Direction } from "@rowsncolumns/common-types";
|
|
2
|
+
import { getDeletableTableRowIndexes } from "@rowsncolumns/spreadsheet";
|
|
2
3
|
import { getCellUserEnteredValue, getExtendedValueFormula } from "@rowsncolumns/utils";
|
|
3
4
|
import { produceWithPatches } from "immer";
|
|
5
|
+
import { shiftChartsOnTableEdit, tableBinding } from "../api/anchored-objects";
|
|
4
6
|
import { collectUniqueDependentsForRange, moveFormulaAtPosition, } from "../api/dependency";
|
|
5
7
|
import { contractRangesInFormula, createSheetCellIdentifier, } from "../api/formula";
|
|
6
8
|
import { createSheetDraft } from "../api/immer-utils";
|
|
@@ -8,250 +10,289 @@ import { moveMergedCells } from "../api/merges";
|
|
|
8
10
|
import { updateSheetRangeOnDelete } from "../api/range";
|
|
9
11
|
import { moveFilterView } from "../api/selection";
|
|
10
12
|
import { SheetCell } from "../sheet-cell";
|
|
11
|
-
export const deleteTableRow = ({ rowCount, columnCount, locale, cellXfsRegistry, sharedStringRegistry, getSheetName, getDependents, createHistory, enqueueGraphOperation, enqueueCalculation, enqueueStructureChange, onChangeSheetData, onChangeSheets, onChangeTables, onChangeDataValidations, onChangeConditionalFormats, }) => {
|
|
13
|
+
export const deleteTableRow = ({ rowCount, columnCount, locale, cellXfsRegistry, sharedStringRegistry, getSheetName, getDependents, createHistory, enqueueGraphOperation, enqueueCalculation, enqueueStructureChange, onChangeSheetData, onChangeSheets, onChangeTables, onChangeCharts, onChangeDataValidations, onChangeConditionalFormats, }) => {
|
|
12
14
|
return (tableView, rowIndexes) => {
|
|
13
15
|
const { sheetId } = tableView;
|
|
14
|
-
rowIndexes = rowIndexes.sort((a, b) => a - b);
|
|
15
|
-
const saveHistory = createHistory();
|
|
16
|
-
const { 0: minRowIndex, [rowIndexes.length - 1]: maxRowIndex } = rowIndexes;
|
|
17
|
-
const count = rowIndexes.length;
|
|
18
16
|
const { startColumnIndex, endColumnIndex } = tableView.range;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
// Excel's "Delete table rows" never removes the header row or the totals row: they are
|
|
18
|
+
// dropped from the request, and a request holding nothing else changes nothing.
|
|
19
|
+
rowIndexes = getDeletableTableRowIndexes(tableView, rowIndexes).sort((a, b) => a - b);
|
|
20
|
+
if (!rowIndexes.length) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
// Excel never leaves a table without a data row: deleting every body row
|
|
24
|
+
// keeps ONE blank row — the lowest selected row is cleared in place while
|
|
25
|
+
// rows below it shift away.
|
|
26
|
+
const bodyStartRowIndex = tableView.range.startRowIndex + (tableView.headerRow !== false ? 1 : 0);
|
|
27
|
+
const bodyEndRowIndex = tableView.range.endRowIndex - (tableView.totalRow ? 1 : 0);
|
|
28
|
+
const blankRowIndex = rowIndexes.length > bodyEndRowIndex - bodyStartRowIndex
|
|
29
|
+
? rowIndexes[0]
|
|
30
|
+
: undefined;
|
|
31
|
+
if (blankRowIndex !== undefined) {
|
|
32
|
+
rowIndexes = rowIndexes.slice(1);
|
|
33
|
+
}
|
|
34
|
+
const saveHistory = createHistory();
|
|
30
35
|
// We need to track this for history. Precedent cells
|
|
31
36
|
const recalcCells = new Map();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
const clearBlankRow = (draft) => {
|
|
38
|
+
if (blankRowIndex === undefined)
|
|
39
|
+
return;
|
|
40
|
+
const currentSheet = createSheetDraft(draft, sheetId, blankRowIndex);
|
|
41
|
+
for (let columnIndex = startColumnIndex; columnIndex <= endColumnIndex; columnIndex++) {
|
|
42
|
+
currentSheet[blankRowIndex].values[columnIndex] = undefined;
|
|
43
|
+
enqueueCalculation?.({
|
|
44
|
+
type: "dirty",
|
|
45
|
+
position: { sheetId, rowIndex: blankRowIndex, columnIndex },
|
|
46
|
+
});
|
|
47
|
+
recalcCells.set(createSheetCellIdentifier(sheetId, blankRowIndex, columnIndex), { sheetId, rowIndex: blankRowIndex, columnIndex });
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
if (!rowIndexes.length) {
|
|
51
|
+
// The only body row: nothing shifts, the row is just blanked.
|
|
52
|
+
onChangeSheetData?.((prevSheetData) => {
|
|
53
|
+
const [nextState, patches, inversePatches] = produceWithPatches(prevSheetData, clearBlankRow);
|
|
54
|
+
saveHistory({
|
|
55
|
+
sheetData: { patches, inversePatches },
|
|
56
|
+
recalcCells: { undo: recalcCells, redo: recalcCells },
|
|
57
|
+
});
|
|
58
|
+
return nextState;
|
|
46
59
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const isInsideColumnBand = (range) => range.startColumnIndex >= startColumnIndex &&
|
|
63
|
+
range.endColumnIndex <= endColumnIndex;
|
|
64
|
+
// A non-contiguous selection is not one block from its lowest row: each contiguous run of
|
|
65
|
+
// rows is one shift, and the runs go highest-first so the lower rows' indexes stay valid
|
|
66
|
+
// (the Rust engine deletes row by row the same way).
|
|
67
|
+
const runs = [];
|
|
68
|
+
for (const rowIndex of rowIndexes) {
|
|
69
|
+
const run = runs[runs.length - 1];
|
|
70
|
+
if (run && run[1] + 1 === rowIndex) {
|
|
71
|
+
run[1] = rowIndex;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
runs.push([rowIndex, rowIndex]);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
let binding = tableBinding(tableView);
|
|
78
|
+
const deleteRun = (minRowIndex, maxRowIndex) => {
|
|
79
|
+
const count = maxRowIndex - minRowIndex + 1;
|
|
80
|
+
enqueueStructureChange?.({
|
|
81
|
+
kind: "delete-table-row",
|
|
82
|
+
sheetId,
|
|
83
|
+
index: minRowIndex,
|
|
84
|
+
count,
|
|
85
|
+
rowCount,
|
|
86
|
+
startColumnIndex: tableView.range.startColumnIndex,
|
|
87
|
+
endColumnIndex: tableView.range.endColumnIndex,
|
|
50
88
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
rule.ranges = ranges;
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
draft.splice(idx, 1);
|
|
89
|
+
// Update table position
|
|
90
|
+
onChangeTables?.((prevTables) => {
|
|
91
|
+
const [nextState, patches, inversePatches] = produceWithPatches(prevTables, (draft) => {
|
|
92
|
+
for (const table of draft) {
|
|
93
|
+
if (table.sheetId !== sheetId || !isInsideColumnBand(table.range)) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (table.id === tableView.id) {
|
|
97
|
+
table.range.endRowIndex -= count;
|
|
98
|
+
}
|
|
99
|
+
else if (maxRowIndex < table.range.startRowIndex) {
|
|
100
|
+
moveFilterView(table, count, Direction.Up);
|
|
101
|
+
}
|
|
68
102
|
}
|
|
69
|
-
}
|
|
103
|
+
});
|
|
104
|
+
// Save history
|
|
105
|
+
saveHistory({
|
|
106
|
+
tables: { patches, inversePatches },
|
|
107
|
+
});
|
|
108
|
+
return nextState;
|
|
70
109
|
});
|
|
71
|
-
|
|
72
|
-
|
|
110
|
+
// Chart ranges inside the table's columns follow the shifted cells; a range bound to the table
|
|
111
|
+
// (a column's body, or header + body) shrinks with it.
|
|
112
|
+
onChangeCharts?.((prevCharts) => {
|
|
113
|
+
const [nextState, patches, inversePatches] = produceWithPatches(prevCharts, (draft) => {
|
|
114
|
+
shiftChartsOnTableEdit(draft, sheetId, binding, "row", "delete", minRowIndex, count);
|
|
115
|
+
});
|
|
116
|
+
saveHistory({ charts: { patches, inversePatches } });
|
|
117
|
+
return nextState;
|
|
73
118
|
});
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
draft.splice(idx, 1);
|
|
119
|
+
// Update data validations
|
|
120
|
+
onChangeDataValidations?.((prevValidations) => {
|
|
121
|
+
const [nextState, patches, inversePatches] = produceWithPatches(prevValidations, (draft) => {
|
|
122
|
+
for (let idx = draft.length - 1; idx >= 0; idx--) {
|
|
123
|
+
const rule = draft[idx];
|
|
124
|
+
const ranges = rule.ranges
|
|
125
|
+
?.map((range) => isInsideColumnBand(range)
|
|
126
|
+
? updateSheetRangeOnDelete(range, "row", minRowIndex, count, sheetId)
|
|
127
|
+
: range)
|
|
128
|
+
.filter((range) => !!range) ?? [];
|
|
129
|
+
if (ranges.length) {
|
|
130
|
+
rule.ranges = ranges;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
draft.splice(idx, 1);
|
|
134
|
+
}
|
|
91
135
|
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
136
|
+
});
|
|
137
|
+
saveHistory({
|
|
138
|
+
dataValidations: { patches, inversePatches },
|
|
139
|
+
});
|
|
140
|
+
return nextState;
|
|
96
141
|
});
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if (minRowIndex < sheet.basicFilter.range.startRowIndex) {
|
|
110
|
-
moveFilterView(sheet.basicFilter, count, Direction.Up);
|
|
142
|
+
// Update conditional formats
|
|
143
|
+
onChangeConditionalFormats?.((prevConditionalFormats) => {
|
|
144
|
+
const [nextState, patches, inversePatches] = produceWithPatches(prevConditionalFormats, (draft) => {
|
|
145
|
+
for (let idx = draft.length - 1; idx >= 0; idx--) {
|
|
146
|
+
const rule = draft[idx];
|
|
147
|
+
const ranges = rule.ranges
|
|
148
|
+
?.map((range) => isInsideColumnBand(range)
|
|
149
|
+
? updateSheetRangeOnDelete(range, "row", minRowIndex, count, sheetId)
|
|
150
|
+
: range)
|
|
151
|
+
.filter((range) => !!range) ?? [];
|
|
152
|
+
if (ranges.length) {
|
|
153
|
+
rule.ranges = ranges;
|
|
111
154
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
sheet.basicFilter.range.endRowIndex -= count;
|
|
155
|
+
else {
|
|
156
|
+
draft.splice(idx, 1);
|
|
115
157
|
}
|
|
116
158
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
sheet.rowCount = Math.max(1, (sheet.rowCount ?? rowCount) - count);
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
// Save history
|
|
127
|
-
saveHistory({
|
|
128
|
-
sheets: { patches, inversePatches },
|
|
159
|
+
});
|
|
160
|
+
saveHistory({
|
|
161
|
+
conditionalFormats: { patches, inversePatches },
|
|
162
|
+
});
|
|
163
|
+
return nextState;
|
|
129
164
|
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
// Collect formulas that reference cells in the deletion range
|
|
161
|
-
const deletionRange = {
|
|
162
|
-
startRowIndex: minRowIndex,
|
|
163
|
-
endRowIndex: minRowIndex + count - 1,
|
|
164
|
-
startColumnIndex: tableView.range.startColumnIndex,
|
|
165
|
-
endColumnIndex: tableView.range.endColumnIndex,
|
|
166
|
-
};
|
|
167
|
-
const formulasToContract = collectUniqueDependentsForRange({
|
|
168
|
-
draft,
|
|
169
|
-
sheetId,
|
|
170
|
-
sourceRange: deletionRange,
|
|
171
|
-
getDependents,
|
|
165
|
+
// Update sheets
|
|
166
|
+
onChangeSheets?.((prevSheets) => {
|
|
167
|
+
const [nextState, patches, inversePatches] = produceWithPatches(prevSheets, (draft) => {
|
|
168
|
+
const sheet = draft.find((sheet) => sheet.sheetId === sheetId);
|
|
169
|
+
if (sheet) {
|
|
170
|
+
if (sheet.rowMetadata) {
|
|
171
|
+
sheet.rowMetadata.splice(minRowIndex, count);
|
|
172
|
+
}
|
|
173
|
+
if (sheet.basicFilter &&
|
|
174
|
+
isInsideColumnBand(sheet.basicFilter.range)) {
|
|
175
|
+
if (minRowIndex < sheet.basicFilter.range.startRowIndex) {
|
|
176
|
+
moveFilterView(sheet.basicFilter, count, Direction.Up);
|
|
177
|
+
}
|
|
178
|
+
if (minRowIndex > sheet.basicFilter.range.startRowIndex &&
|
|
179
|
+
minRowIndex <= sheet.basicFilter.range.endRowIndex) {
|
|
180
|
+
sheet.basicFilter.range.endRowIndex -= count;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (sheet.merges) {
|
|
184
|
+
sheet.merges = moveMergedCells(sheet.merges, "row-remove", minRowIndex, count, (area) => {
|
|
185
|
+
return (area.startColumnIndex >= tableView.range.startColumnIndex &&
|
|
186
|
+
area.endColumnIndex <= tableView.range.endColumnIndex);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
sheet.rowCount = Math.max(1, (sheet.rowCount ?? rowCount) - count);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
// Save history
|
|
193
|
+
saveHistory({
|
|
194
|
+
sheets: { patches, inversePatches },
|
|
172
195
|
});
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
return nextState;
|
|
197
|
+
});
|
|
198
|
+
// Sheet data
|
|
199
|
+
onChangeSheetData?.((prevSheetData) => {
|
|
200
|
+
const [nextState, patches, inversePatches] = produceWithPatches(prevSheetData, (draft) => {
|
|
201
|
+
const movedKeys = new Set();
|
|
202
|
+
const totalRows = draft[sheetId]?.length ?? 0;
|
|
203
|
+
// Every cell of the table's columns below the deleted run shifts up — through the
|
|
204
|
+
// sheet's last used row, not just the table's — so formulas inside that band and
|
|
205
|
+
// references into it re-anchor over the whole band (mirrors `insertTableRow`).
|
|
206
|
+
const sourceRange = {
|
|
207
|
+
...tableView.range,
|
|
208
|
+
startRowIndex: maxRowIndex + 1,
|
|
209
|
+
endRowIndex: Math.max(tableView.range.endRowIndex, totalRows - 1),
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* THREE-PASS FORMULA UPDATE STRATEGY FOR DELETION:
|
|
213
|
+
*
|
|
214
|
+
* PASS 1 (lines below): Contract ranges when deletion overlaps with them
|
|
215
|
+
* Example: Delete table row 5, =SUM(A1:A10) → =SUM(A1:A9)
|
|
216
|
+
* Uses dependency graph to find only formulas that reference the deletion range (efficient!)
|
|
217
|
+
*
|
|
218
|
+
* PASS 2 (after this loop): Shift references in formulas that DEPEND ON the moved cells
|
|
219
|
+
* Example: If A10 is moved to A9, formulas referencing A10 must update
|
|
220
|
+
* Uses dependency graph to find only affected formulas (efficient)
|
|
221
|
+
*
|
|
222
|
+
* PASS 3 (final loop): Shift references in formulas WITHIN the moved cells themselves
|
|
223
|
+
* Example: If A11 contains =A1+A2 and moves to A10, references stay the same
|
|
224
|
+
* But if it contains =A15, it needs adjustment based on sourceRange exclusion
|
|
225
|
+
*
|
|
226
|
+
* The 'movedKeys' Set ensures no formula is processed twice across passes 2 & 3.
|
|
227
|
+
* Range contraction (Pass 1) doesn't interfere with reference shifting (Pass 2 & 3).
|
|
228
|
+
*/
|
|
229
|
+
// PASS 1: Contract ranges using dependency graph (OPTIMIZED!)
|
|
230
|
+
// Collect formulas that reference cells in the deletion range
|
|
231
|
+
const deletionRange = {
|
|
232
|
+
startRowIndex: minRowIndex,
|
|
233
|
+
endRowIndex: minRowIndex + count - 1,
|
|
234
|
+
startColumnIndex: tableView.range.startColumnIndex,
|
|
235
|
+
endColumnIndex: tableView.range.endColumnIndex,
|
|
236
|
+
};
|
|
237
|
+
const formulasToContract = collectUniqueDependentsForRange({
|
|
238
|
+
draft,
|
|
239
|
+
sheetId,
|
|
240
|
+
sourceRange: deletionRange,
|
|
241
|
+
getDependents,
|
|
242
|
+
});
|
|
243
|
+
const sheetCell = new SheetCell();
|
|
244
|
+
for (const pos of formulasToContract.values()) {
|
|
245
|
+
const currentSheet = createSheetDraft(draft, sheetId, pos.rowIndex);
|
|
246
|
+
const cellData = currentSheet[pos.rowIndex]?.values?.[pos.columnIndex];
|
|
247
|
+
if (!cellData)
|
|
248
|
+
continue;
|
|
249
|
+
// Check if cell has a formula
|
|
250
|
+
sheetCell.assign(pos.sheetId, { rowIndex: pos.rowIndex, columnIndex: pos.columnIndex }, cellData, { locale });
|
|
251
|
+
const formulaValue = sheetCell.formula;
|
|
252
|
+
if (formulaValue) {
|
|
253
|
+
const activeSheetName = getSheetName(pos.sheetId);
|
|
254
|
+
const contractedFormula = contractRangesInFormula(formulaValue, minRowIndex, count, "row", activeSheetName);
|
|
255
|
+
// Update the formula if it changed
|
|
256
|
+
if (contractedFormula && contractedFormula !== formulaValue) {
|
|
257
|
+
// Preserve stale effective value until recalculation completes
|
|
258
|
+
sheetCell.setFormulaValue(contractedFormula, false);
|
|
259
|
+
currentSheet[pos.rowIndex].values[pos.columnIndex] =
|
|
260
|
+
sheetCell.getCellData();
|
|
261
|
+
// Adjust row index for formulas below the deleted range
|
|
262
|
+
// (they will shift up by `count` after the splice)
|
|
263
|
+
const adjustedRowIndex = pos.sheetId === sheetId && pos.rowIndex > maxRowIndex
|
|
264
|
+
? pos.rowIndex - count
|
|
265
|
+
: pos.rowIndex;
|
|
266
|
+
enqueueCalculation?.({
|
|
267
|
+
type: "add",
|
|
268
|
+
position: {
|
|
269
|
+
sheetId: pos.sheetId,
|
|
270
|
+
rowIndex: adjustedRowIndex,
|
|
271
|
+
columnIndex: pos.columnIndex,
|
|
272
|
+
},
|
|
273
|
+
force: true,
|
|
274
|
+
});
|
|
275
|
+
recalcCells.set(createSheetCellIdentifier(pos.sheetId, adjustedRowIndex, pos.columnIndex), {
|
|
199
276
|
sheetId: pos.sheetId,
|
|
200
277
|
rowIndex: adjustedRowIndex,
|
|
201
278
|
columnIndex: pos.columnIndex,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
recalcCells.set(createSheetCellIdentifier(pos.sheetId, adjustedRowIndex, pos.columnIndex), {
|
|
206
|
-
sheetId: pos.sheetId,
|
|
207
|
-
rowIndex: adjustedRowIndex,
|
|
208
|
-
columnIndex: pos.columnIndex,
|
|
209
|
-
force: true,
|
|
210
|
-
});
|
|
279
|
+
force: true,
|
|
280
|
+
});
|
|
281
|
+
}
|
|
211
282
|
}
|
|
212
283
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
const dependents = collectUniqueDependentsForRange({
|
|
216
|
-
draft,
|
|
217
|
-
sheetId,
|
|
218
|
-
sourceRange,
|
|
219
|
-
getDependents,
|
|
220
|
-
});
|
|
221
|
-
for (const pos of dependents.values()) {
|
|
222
|
-
moveFormulaAtPosition({
|
|
284
|
+
// PASS 2: Collect and process formulas that DEPEND ON the moved cells
|
|
285
|
+
const dependents = collectUniqueDependentsForRange({
|
|
223
286
|
draft,
|
|
224
|
-
|
|
225
|
-
activeSheetName: getSheetName(pos.sheetId),
|
|
226
|
-
enqueueCalculation,
|
|
227
|
-
enqueueGraphOperation,
|
|
228
|
-
recalcCells,
|
|
229
|
-
movedKeys,
|
|
230
|
-
rowDelta: -count,
|
|
231
|
-
columnDelta: 0,
|
|
287
|
+
sheetId,
|
|
232
288
|
sourceRange,
|
|
233
|
-
|
|
234
|
-
rowCount,
|
|
235
|
-
columnCount,
|
|
236
|
-
cellXfsRegistry,
|
|
237
|
-
sharedStringRegistry,
|
|
289
|
+
getDependents,
|
|
238
290
|
});
|
|
239
|
-
|
|
240
|
-
// PASS 3: Process formulas WITHIN the moved cells themselves
|
|
241
|
-
for (let rowIndex = minRowIndex; rowIndex <= tableView.range.endRowIndex; rowIndex++) {
|
|
242
|
-
const rowValues = draft[sheetId]?.[rowIndex]?.values;
|
|
243
|
-
if (!rowValues) {
|
|
244
|
-
continue;
|
|
245
|
-
}
|
|
246
|
-
for (let columnIndex = tableView.range.startColumnIndex; columnIndex <= tableView.range.endColumnIndex; columnIndex++) {
|
|
247
|
-
const cellData = rowValues?.[columnIndex];
|
|
248
|
-
const hasFormula = !!getExtendedValueFormula(getCellUserEnteredValue(cellData));
|
|
249
|
-
if (!hasFormula) {
|
|
250
|
-
continue;
|
|
251
|
-
}
|
|
291
|
+
for (const pos of dependents.values()) {
|
|
252
292
|
moveFormulaAtPosition({
|
|
253
293
|
draft,
|
|
254
|
-
position:
|
|
294
|
+
position: pos,
|
|
295
|
+
activeSheetName: getSheetName(pos.sheetId),
|
|
255
296
|
enqueueCalculation,
|
|
256
297
|
enqueueGraphOperation,
|
|
257
298
|
recalcCells,
|
|
@@ -266,22 +307,61 @@ export const deleteTableRow = ({ rowCount, columnCount, locale, cellXfsRegistry,
|
|
|
266
307
|
sharedStringRegistry,
|
|
267
308
|
});
|
|
268
309
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
310
|
+
// PASS 3: Process formulas WITHIN the moved cells themselves
|
|
311
|
+
for (let rowIndex = minRowIndex; rowIndex <= sourceRange.endRowIndex; rowIndex++) {
|
|
312
|
+
const rowValues = draft[sheetId]?.[rowIndex]?.values;
|
|
313
|
+
if (!rowValues) {
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
for (let columnIndex = tableView.range.startColumnIndex; columnIndex <= tableView.range.endColumnIndex; columnIndex++) {
|
|
317
|
+
const cellData = rowValues?.[columnIndex];
|
|
318
|
+
const hasFormula = !!getExtendedValueFormula(getCellUserEnteredValue(cellData));
|
|
319
|
+
if (!hasFormula) {
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
moveFormulaAtPosition({
|
|
323
|
+
draft,
|
|
324
|
+
position: { sheetId, rowIndex, columnIndex },
|
|
325
|
+
enqueueCalculation,
|
|
326
|
+
enqueueGraphOperation,
|
|
327
|
+
recalcCells,
|
|
328
|
+
movedKeys,
|
|
329
|
+
rowDelta: -count,
|
|
330
|
+
columnDelta: 0,
|
|
331
|
+
sourceRange,
|
|
332
|
+
locale,
|
|
333
|
+
rowCount,
|
|
334
|
+
columnCount,
|
|
335
|
+
cellXfsRegistry,
|
|
336
|
+
sharedStringRegistry,
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
clearBlankRow(draft);
|
|
341
|
+
// Shift values up inside the table range
|
|
342
|
+
for (let rowIndex = minRowIndex; rowIndex < totalRows; rowIndex++) {
|
|
343
|
+
const currentSheet = createSheetDraft(draft, sheetId, rowIndex);
|
|
344
|
+
for (let columnIndex = tableView.range.startColumnIndex; columnIndex <= tableView.range.endColumnIndex; columnIndex++) {
|
|
345
|
+
currentSheet[rowIndex].values[columnIndex] =
|
|
346
|
+
currentSheet[rowIndex + count]?.values?.[columnIndex];
|
|
347
|
+
}
|
|
276
348
|
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
349
|
+
});
|
|
350
|
+
// Save history
|
|
351
|
+
saveHistory({
|
|
352
|
+
sheetData: { patches, inversePatches },
|
|
353
|
+
recalcCells: { undo: recalcCells, redo: recalcCells },
|
|
354
|
+
});
|
|
355
|
+
return nextState;
|
|
283
356
|
});
|
|
284
|
-
|
|
285
|
-
|
|
357
|
+
binding = {
|
|
358
|
+
...binding,
|
|
359
|
+
range: { ...binding.range, endRowIndex: binding.range.endRowIndex - count },
|
|
360
|
+
bodyEndRowIndex: binding.bodyEndRowIndex - count,
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
for (let idx = runs.length - 1; idx >= 0; idx--) {
|
|
364
|
+
deleteRun(runs[idx][0], runs[idx][1]);
|
|
365
|
+
}
|
|
286
366
|
};
|
|
287
367
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"duplicate-sheet.d.ts","sourceRoot":"","sources":["../../../interface/duplicate-sheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAc,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"duplicate-sheet.d.ts","sourceRoot":"","sources":["../../../interface/duplicate-sheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAc,MAAM,2BAA2B,CAAC;AAc7E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAGhF,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,KAAK,EAAE,sPAejE,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,MACvB,SAAS,MAAM,EAAE,0BAA0B,MAAM,uBAkT1D,CAAC"}
|