@rowsncolumns/spreadsheet-state 29.0.0 → 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 +1 -2
- package/dist/cjs/api/copy-paste.d.ts.map +1 -1
- package/dist/cjs/api/copy-paste.js +1 -3
- 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/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/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 +129 -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-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 +3 -1
- package/dist/cjs/hooks/use-on-move-columns.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-move-columns.js +14 -1
- package/dist/cjs/hooks/use-on-move-rows.d.ts +3 -1
- package/dist/cjs/hooks/use-on-move-rows.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-move-rows.js +14 -1
- package/dist/cjs/hooks/use-on-move-selection.d.ts +3 -1
- package/dist/cjs/hooks/use-on-move-selection.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-move-selection.js +88 -25
- package/dist/cjs/hooks/use-on-paste.d.ts +22 -1
- package/dist/cjs/hooks/use-on-paste.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-paste.js +993 -776
- 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 +56 -10
- package/dist/cjs/hooks/use-spreadsheet-state.d.ts.map +1 -1
- package/dist/cjs/hooks/use-spreadsheet-state.js +322 -100
- 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 +7 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +8 -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 +9 -2
- 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 +223 -18
- 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 +67 -38
- 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 +9 -2
- 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 +1 -2
- package/dist/esm/api/copy-paste.d.ts.map +1 -1
- package/dist/esm/api/copy-paste.js +1 -3
- 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/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/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 +129 -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-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 +3 -1
- package/dist/esm/hooks/use-on-move-columns.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-move-columns.js +14 -1
- package/dist/esm/hooks/use-on-move-rows.d.ts +3 -1
- package/dist/esm/hooks/use-on-move-rows.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-move-rows.js +14 -1
- package/dist/esm/hooks/use-on-move-selection.d.ts +3 -1
- package/dist/esm/hooks/use-on-move-selection.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-move-selection.js +44 -1
- package/dist/esm/hooks/use-on-paste.d.ts +22 -1
- package/dist/esm/hooks/use-on-paste.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-paste.js +815 -672
- 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 +56 -10
- package/dist/esm/hooks/use-spreadsheet-state.d.ts.map +1 -1
- package/dist/esm/hooks/use-spreadsheet-state.js +259 -30
- 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 +7 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +8 -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 +9 -2
- 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 +173 -15
- 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 +48 -23
- 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 +9 -2
- 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 +19 -11
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CellInterface, GridRange } from "@rowsncolumns/common-types";
|
|
2
|
-
import type { EmbeddedChart, EmbeddedObject, ProtectedRange } from "@rowsncolumns/spreadsheet";
|
|
2
|
+
import type { EmbeddedChart, EmbeddedObject, OverlayPosition, OverlayToAnchor, ProtectedRange, Slicer, TableView } from "@rowsncolumns/spreadsheet";
|
|
3
3
|
import type { Draft } from "immer";
|
|
4
|
+
import type { RangeBandSpan } from "./formula";
|
|
4
5
|
/**
|
|
5
6
|
* Structural (whole row / whole column insert or delete) relocation of the
|
|
6
7
|
* objects Excel anchors to cells rather than storing inside them: floating
|
|
@@ -11,8 +12,11 @@ import type { Draft } from "immer";
|
|
|
11
12
|
* - A floating object's anchor cell shifts like any cell: pushed down/right by
|
|
12
13
|
* an insert at or before it, pulled up/left by a delete before it. When the
|
|
13
14
|
* anchor row/column itself is deleted the object snaps to the first
|
|
14
|
-
* surviving cell at the deletion index (
|
|
15
|
-
*
|
|
15
|
+
* surviving cell at the deletion index. `moveAndSize` (Excel's default)
|
|
16
|
+
* shifts its second anchor the same way, so an insert between the corners
|
|
17
|
+
* stretches the frame and a delete inside shrinks it; a delete consuming
|
|
18
|
+
* the whole span removes the object. `moveOnly` moves with a fixed size;
|
|
19
|
+
* `absolute` (Don't move or size with cells) stays put.
|
|
16
20
|
* - A range (chart series, AllowEditRange) shifts like a formula reference:
|
|
17
21
|
* insert at/before the start moves it, insert strictly inside grows it,
|
|
18
22
|
* delete inside shrinks it, delete of the whole span removes it (`#REF!`).
|
|
@@ -49,18 +53,130 @@ export declare const shiftGridRangeLikeReference: <R extends GridRange>(range: R
|
|
|
49
53
|
* (`sources`), nulled on properties (`dataRange`) — the chart's `#REF!`.
|
|
50
54
|
* Unknown keys are left untouched. Mutates in place; returns whether anything
|
|
51
55
|
* changed.
|
|
56
|
+
*
|
|
57
|
+
* `band` restricts the rewrite to ranges whose PERPENDICULAR span lies wholly
|
|
58
|
+
* inside it — the insert/delete-CELLS shift of columns `B:C` only touches
|
|
59
|
+
* ranges living entirely in B..C, exactly like `expandRangesInFormula` /
|
|
60
|
+
* `contractRangesInFormula` with the same `bandSpan` (SHF-07 / SHF-08), so a
|
|
61
|
+
* chart and a formula reading the same cells always agree. A range that only
|
|
62
|
+
* partially overlaps the band keeps its address, as in Excel.
|
|
63
|
+
*/
|
|
64
|
+
export declare const shiftChartSpecRanges: (spec: unknown, sheetId: number, axis: StructuralAxis, op: StructuralOp, index: number, count: number, band?: RangeBandSpan) => boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Record (or clear) the second anchor a move / resize gesture reported —
|
|
67
|
+
* `moveAndSize` objects carry one, `moveOnly` / `absolute` never do.
|
|
52
68
|
*/
|
|
53
|
-
export declare const
|
|
54
|
-
/**
|
|
69
|
+
export declare const setOverlayToAnchor: (overlay: Draft<OverlayPosition>, toAnchor: OverlayToAnchor | undefined) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Shift a floating object's anchors for a whole row / column insert or
|
|
72
|
+
* delete, per its placement mode. Returns `"removed"` when a delete consumed
|
|
73
|
+
* the whole span of a `moveAndSize` object (Excel deletes it), otherwise
|
|
74
|
+
* whether anything moved.
|
|
75
|
+
*/
|
|
76
|
+
export declare const shiftOverlayOnStructuralChange: (overlay: Draft<OverlayPosition>, axis: StructuralAxis, op: StructuralOp, index: number, count: number) => boolean | "removed";
|
|
77
|
+
/** Shift the anchors of every embed (picture, shape, text box…) on the edited sheet. */
|
|
55
78
|
export declare const shiftEmbedsOnStructuralChange: (draft: Draft<EmbeddedObject>[], sheetId: number, axis: StructuralAxis, op: StructuralOp, index: number, count: number) => void;
|
|
56
79
|
/**
|
|
57
|
-
* Shift every
|
|
80
|
+
* Shift the anchors of every slicer on the edited sheet — a slicer is a
|
|
81
|
+
* floating frame with the same placement modes as a picture (#668 C-46).
|
|
82
|
+
*/
|
|
83
|
+
export declare const shiftSlicersOnStructuralChange: (draft: Draft<Slicer>[], sheetId: number, axis: StructuralAxis, op: StructuralOp, index: number, count: number) => void;
|
|
84
|
+
/**
|
|
85
|
+
* Shift every chart on the edited sheet: its anchors like a floating
|
|
58
86
|
* object, and the ranges inside its spec like references.
|
|
59
87
|
*/
|
|
60
88
|
export declare const shiftChartsOnStructuralChange: (draft: Draft<EmbeddedChart>[], sheetId: number, axis: StructuralAxis, op: StructuralOp, index: number, count: number) => void;
|
|
89
|
+
/**
|
|
90
|
+
* Insert/delete CELLS with shift (SHF-*): only the ranges a chart reads move —
|
|
91
|
+
* those wholly inside the shifted band's columns (shift down/up) or rows
|
|
92
|
+
* (shift right/left), with the reference rule along the shift axis. Excel
|
|
93
|
+
* moves drawing anchors only for whole row/column edits, so the chart frame
|
|
94
|
+
* stays where it is.
|
|
95
|
+
*/
|
|
96
|
+
export declare const shiftChartsOnCellShift: (draft: Draft<EmbeddedChart>[], sheetId: number, axis: StructuralAxis, op: StructuralOp, index: number, count: number, band: RangeBandSpan) => void;
|
|
61
97
|
/**
|
|
62
98
|
* Shift AllowEditRange rectangles. A protected range without a rectangle
|
|
63
99
|
* (sheet-scoped protection) is untouched; one the delete consumes is removed.
|
|
64
100
|
*/
|
|
65
101
|
export declare const shiftProtectedRangesOnStructuralChange: (draft: Draft<ProtectedRange>[], sheetId: number, axis: StructuralAxis, op: StructuralOp, index: number, count: number) => void;
|
|
102
|
+
/**
|
|
103
|
+
* Deleting a sheet consumes every range on it: a chart elsewhere whose series
|
|
104
|
+
* / category / data range read the deleted sheet keeps the chart but loses
|
|
105
|
+
* that range (Excel's empty `#REF!` series).
|
|
106
|
+
*/
|
|
107
|
+
export declare const removeChartSpecRangesOnSheet: (spec: unknown, sheetId: number) => boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Re-point every range on `fromSheetId` at `toSheetId` — a duplicated sheet's
|
|
110
|
+
* charts read the copy's own cells (Excel), while ranges on other sheets keep
|
|
111
|
+
* reading the original.
|
|
112
|
+
*/
|
|
113
|
+
export declare const retargetChartSpecRanges: (spec: unknown, fromSheetId: number, toSheetId: number) => boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Relocate the ranges inside a chart spec when the block `from` on
|
|
116
|
+
* `fromSheetId` is moved (drag-move, cut → paste) to `to` on `toSheetId`, the
|
|
117
|
+
* way Excel re-points series like references: a range that lies ENTIRELY
|
|
118
|
+
* inside the moved block travels with it (shifted by the move delta and onto
|
|
119
|
+
* the destination sheet); a range the block covers only partially, and any
|
|
120
|
+
* range outside it, keeps referring to its original cells. Mirrors
|
|
121
|
+
* `move_spec_sheet_ranges` in `rnc-store`.
|
|
122
|
+
*/
|
|
123
|
+
export declare const moveChartSpecRanges: (spec: unknown, fromSheetId: number, from: GridRange, toSheetId: number, to: GridRange) => boolean;
|
|
124
|
+
/** Re-point the ranges of every chart when a cell block is moved (see `moveChartSpecRanges`). */
|
|
125
|
+
export declare const moveChartsOnRangeMove: (draft: Draft<EmbeddedChart>[], fromSheetId: number, from: GridRange, toSheetId: number, to: GridRange) => void;
|
|
126
|
+
/**
|
|
127
|
+
* Where line `index` (a row or column) ends up after the whole lines `lines`
|
|
128
|
+
* (sorted ascending) are moved so the block lands at `target` in the
|
|
129
|
+
* post-removal frame — the permutation a row/column move applies to every
|
|
130
|
+
* cell. A moved line lands at `target` + its rank in the block; a line outside
|
|
131
|
+
* closes the gap the block left and is pushed by the block landing at or
|
|
132
|
+
* before it. Mirrors `moved_line_index` in `rnc-store`.
|
|
133
|
+
*/
|
|
134
|
+
export declare const movedLineIndex: (lines: readonly number[], target: number, index: number) => number;
|
|
135
|
+
/**
|
|
136
|
+
* Re-point the ranges inside a chart spec when whole rows / columns of
|
|
137
|
+
* `sheetId` are moved (`lines` land at `target`), with the rule the engines
|
|
138
|
+
* apply to formula references: both edges follow their line, and the range is
|
|
139
|
+
* rewritten only when that yields a range of the same size — so a range wholly
|
|
140
|
+
* inside the moved block relocates with it, one wholly inside the displaced
|
|
141
|
+
* band shifts by the block size, and one straddling the block and its
|
|
142
|
+
* neighbours keeps its text (it still covers the same cells). Mirrors
|
|
143
|
+
* `permute_spec_sheet_ranges` in `rnc-store` / `remap_formula_axis`.
|
|
144
|
+
*/
|
|
145
|
+
export declare const reorderChartSpecRanges: (spec: unknown, sheetId: number, axis: StructuralAxis, lines: readonly number[], target: number) => boolean;
|
|
146
|
+
/** Re-point the ranges of every chart when whole rows / columns are moved (see `reorderChartSpecRanges`). */
|
|
147
|
+
export declare const reorderChartsOnLineMove: (draft: Draft<EmbeddedChart>[], sheetId: number, axis: StructuralAxis, lines: readonly number[], target: number) => void;
|
|
148
|
+
/**
|
|
149
|
+
* The table a chart range may be bound to — Excel's ListObject binding, taken BEFORE the table
|
|
150
|
+
* edit: `range` is the table's range, `rowStarts` the rows a bound range may begin at (the header
|
|
151
|
+
* row when shown, the first body row) and `bodyEndRowIndex` its last body row (the totals row
|
|
152
|
+
* excluded). Mirrors `TableBinding` in `rnc-store`.
|
|
153
|
+
*/
|
|
154
|
+
export type TableBinding = {
|
|
155
|
+
range: GridRange;
|
|
156
|
+
rowStarts: readonly number[];
|
|
157
|
+
bodyEndRowIndex: number;
|
|
158
|
+
};
|
|
159
|
+
export declare const tableBinding: (table: Pick<TableView, "range" | "headerRow" | "totalRow">) => TableBinding;
|
|
160
|
+
/**
|
|
161
|
+
* Insert / delete table rows (or columns): the cells inside the table's columns (rows) at/after
|
|
162
|
+
* `index` move, so every chart range wholly inside that band follows the reference rule like
|
|
163
|
+
* insert/delete-cells — except a range bound to the table (`isTableBoundRange`), which grows /
|
|
164
|
+
* shrinks by `count` even when the rows are appended below the last body row (where the
|
|
165
|
+
* reference rule would leave it alone) or inserted above the first one (where it would shift):
|
|
166
|
+
* Excel keeps the series on the table column. A range that collapses is removed (`#REF!`).
|
|
167
|
+
* Mutates in place; returns whether anything changed. Mirrors
|
|
168
|
+
* `shift_spec_sheet_ranges_for_table_edit` in `rnc-store`.
|
|
169
|
+
*/
|
|
170
|
+
export declare const shiftChartSpecRangesOnTableEdit: (spec: unknown, sheetId: number, binding: TableBinding, axis: StructuralAxis, op: StructuralOp, index: number, count: number) => boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Table growth without a cell shift — the resize handle, typing below / to the right of the
|
|
173
|
+
* table: a range bound to the table (`isTableBoundRange`) grows / shrinks with its body by
|
|
174
|
+
* `rowDelta` rows, then by `columnDelta` columns against the row-grown table. Mutates in place;
|
|
175
|
+
* returns whether anything changed. Mirrors `grow_table_bound_spec_ranges` in `rnc-store`.
|
|
176
|
+
*/
|
|
177
|
+
export declare const growTableBoundChartSpecRanges: (spec: unknown, sheetId: number, binding: TableBinding, rowDelta: number, columnDelta: number) => boolean;
|
|
178
|
+
/** Every chart's ranges follow a table-local row / column insert or delete (see `shiftChartSpecRangesOnTableEdit`). */
|
|
179
|
+
export declare const shiftChartsOnTableEdit: (draft: Draft<EmbeddedChart>[], sheetId: number, binding: TableBinding, axis: StructuralAxis, op: StructuralOp, index: number, count: number) => void;
|
|
180
|
+
/** Every chart's table-bound ranges grow / shrink with a resized or auto-expanded table (see `growTableBoundChartSpecRanges`). */
|
|
181
|
+
export declare const growChartsWithTable: (draft: Draft<EmbeddedChart>[], sheetId: number, binding: TableBinding, rowDelta: number, columnDelta: number) => void;
|
|
66
182
|
//# sourceMappingURL=anchored-objects.d.ts.map
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"anchored-objects.d.ts","sourceRoot":"","sources":["../../../api/anchored-objects.ts"],"names":[],"mappings":"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"}
|
|
@@ -87,11 +87,24 @@ const isSheetRangeLike = (value) => {
|
|
|
87
87
|
* (`sources`), nulled on properties (`dataRange`) — the chart's `#REF!`.
|
|
88
88
|
* Unknown keys are left untouched. Mutates in place; returns whether anything
|
|
89
89
|
* changed.
|
|
90
|
+
*
|
|
91
|
+
* `band` restricts the rewrite to ranges whose PERPENDICULAR span lies wholly
|
|
92
|
+
* inside it — the insert/delete-CELLS shift of columns `B:C` only touches
|
|
93
|
+
* ranges living entirely in B..C, exactly like `expandRangesInFormula` /
|
|
94
|
+
* `contractRangesInFormula` with the same `bandSpan` (SHF-07 / SHF-08), so a
|
|
95
|
+
* chart and a formula reading the same cells always agree. A range that only
|
|
96
|
+
* partially overlaps the band keeps its address, as in Excel.
|
|
90
97
|
*/
|
|
91
|
-
export const shiftChartSpecRanges = (spec, sheetId, axis, op, index, count) => {
|
|
98
|
+
export const shiftChartSpecRanges = (spec, sheetId, axis, op, index, count, band) => {
|
|
92
99
|
let changed = false;
|
|
100
|
+
const [acrossStartKey, acrossEndKey] = axis === "row"
|
|
101
|
+
? ["startColumnIndex", "endColumnIndex"]
|
|
102
|
+
: ["startRowIndex", "endRowIndex"];
|
|
103
|
+
const isWithinBand = (range) => !band ||
|
|
104
|
+
(range[acrossStartKey] >= band.startIndex &&
|
|
105
|
+
range[acrossEndKey] <= band.endIndex);
|
|
93
106
|
const shiftRange = (range) => {
|
|
94
|
-
if (range.sheetId !== sheetId)
|
|
107
|
+
if (range.sheetId !== sheetId || !isWithinBand(range))
|
|
95
108
|
return range;
|
|
96
109
|
const next = shiftGridRangeLikeReference(range, axis, op, index, count);
|
|
97
110
|
if (next !== range)
|
|
@@ -133,38 +146,121 @@ export const shiftChartSpecRanges = (spec, sheetId, axis, op, index, count) => {
|
|
|
133
146
|
walk(spec);
|
|
134
147
|
return changed;
|
|
135
148
|
};
|
|
136
|
-
/**
|
|
149
|
+
/**
|
|
150
|
+
* Record (or clear) the second anchor a move / resize gesture reported —
|
|
151
|
+
* `moveAndSize` objects carry one, `moveOnly` / `absolute` never do.
|
|
152
|
+
*/
|
|
153
|
+
export const setOverlayToAnchor = (overlay, toAnchor) => {
|
|
154
|
+
if (toAnchor) {
|
|
155
|
+
overlay.toCell = toAnchor.toCell;
|
|
156
|
+
overlay.toOffsetXPixels = toAnchor.toOffsetXPixels;
|
|
157
|
+
overlay.toOffsetYPixels = toAnchor.toOffsetYPixels;
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
delete overlay.toCell;
|
|
161
|
+
delete overlay.toOffsetXPixels;
|
|
162
|
+
delete overlay.toOffsetYPixels;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Shift a floating object's anchors for a whole row / column insert or
|
|
166
|
+
* delete, per its placement mode. Returns `"removed"` when a delete consumed
|
|
167
|
+
* the whole span of a `moveAndSize` object (Excel deletes it), otherwise
|
|
168
|
+
* whether anything moved.
|
|
169
|
+
*/
|
|
170
|
+
export const shiftOverlayOnStructuralChange = (overlay, axis, op, index, count) => {
|
|
171
|
+
if (!overlay.anchorCell || overlay.placement === "absolute")
|
|
172
|
+
return false;
|
|
173
|
+
const moveAndSize = (overlay.placement ?? "moveAndSize") === "moveAndSize";
|
|
174
|
+
const toCell = moveAndSize ? overlay.toCell : undefined;
|
|
175
|
+
if (toCell && op === "delete" && count > 0) {
|
|
176
|
+
const key = axis === "row" ? "rowIndex" : "columnIndex";
|
|
177
|
+
const start = overlay.anchorCell[key];
|
|
178
|
+
// `to` sits on the cell the corner lands in; a corner flush with the
|
|
179
|
+
// cell's leading edge does not occupy it.
|
|
180
|
+
const offset = axis === "row" ? overlay.toOffsetYPixels : overlay.toOffsetXPixels;
|
|
181
|
+
const end = (offset ?? 0) > 0 ? toCell[key] : Math.max(start, toCell[key] - 1);
|
|
182
|
+
if (index <= start && index + count - 1 >= end)
|
|
183
|
+
return "removed";
|
|
184
|
+
}
|
|
185
|
+
let changed = false;
|
|
186
|
+
const next = shiftAnchorCell(overlay.anchorCell, axis, op, index, count);
|
|
187
|
+
if (next !== overlay.anchorCell) {
|
|
188
|
+
overlay.anchorCell = next;
|
|
189
|
+
changed = true;
|
|
190
|
+
}
|
|
191
|
+
if (toCell) {
|
|
192
|
+
const nextTo = shiftAnchorCell(toCell, axis, op, index, count);
|
|
193
|
+
if (nextTo !== toCell) {
|
|
194
|
+
overlay.toCell = nextTo;
|
|
195
|
+
changed = true;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return changed;
|
|
199
|
+
};
|
|
200
|
+
/** Shift the anchors of every embed (picture, shape, text box…) on the edited sheet. */
|
|
137
201
|
export const shiftEmbedsOnStructuralChange = (draft, sheetId, axis, op, index, count) => {
|
|
138
|
-
for (
|
|
139
|
-
const position =
|
|
202
|
+
for (let i = draft.length - 1; i >= 0; i--) {
|
|
203
|
+
const position = draft[i].position;
|
|
140
204
|
if (!position || position.sheetId !== sheetId)
|
|
141
205
|
continue;
|
|
142
206
|
const overlay = position.overlayPosition;
|
|
143
207
|
if (!overlay?.anchorCell)
|
|
144
208
|
continue;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
209
|
+
if (shiftOverlayOnStructuralChange(overlay, axis, op, index, count) ===
|
|
210
|
+
"removed") {
|
|
211
|
+
draft.splice(i, 1);
|
|
212
|
+
}
|
|
148
213
|
}
|
|
149
214
|
};
|
|
150
215
|
/**
|
|
151
|
-
* Shift every
|
|
216
|
+
* Shift the anchors of every slicer on the edited sheet — a slicer is a
|
|
217
|
+
* floating frame with the same placement modes as a picture (#668 C-46).
|
|
218
|
+
*/
|
|
219
|
+
export const shiftSlicersOnStructuralChange = (draft, sheetId, axis, op, index, count) => {
|
|
220
|
+
for (let i = draft.length - 1; i >= 0; i--) {
|
|
221
|
+
const position = draft[i].position;
|
|
222
|
+
if (!position || position.sheetId !== sheetId)
|
|
223
|
+
continue;
|
|
224
|
+
const overlay = position.overlayPosition;
|
|
225
|
+
if (!overlay?.anchorCell)
|
|
226
|
+
continue;
|
|
227
|
+
if (shiftOverlayOnStructuralChange(overlay, axis, op, index, count) ===
|
|
228
|
+
"removed") {
|
|
229
|
+
draft.splice(i, 1);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Shift every chart on the edited sheet: its anchors like a floating
|
|
152
235
|
* object, and the ranges inside its spec like references.
|
|
153
236
|
*/
|
|
154
237
|
export const shiftChartsOnStructuralChange = (draft, sheetId, axis, op, index, count) => {
|
|
155
|
-
for (
|
|
238
|
+
for (let i = draft.length - 1; i >= 0; i--) {
|
|
239
|
+
const chart = draft[i];
|
|
156
240
|
const position = chart.position;
|
|
157
|
-
if (position?.sheetId === sheetId &&
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
241
|
+
if (position?.sheetId === sheetId &&
|
|
242
|
+
position.overlayPosition?.anchorCell &&
|
|
243
|
+
shiftOverlayOnStructuralChange(position.overlayPosition, axis, op, index, count) === "removed") {
|
|
244
|
+
draft.splice(i, 1);
|
|
245
|
+
continue;
|
|
162
246
|
}
|
|
163
247
|
// Series ranges may point at ANY sheet, so the spec walk is not gated on
|
|
164
248
|
// the chart's own sheet.
|
|
165
249
|
shiftChartSpecRanges(chart.spec, sheetId, axis, op, index, count);
|
|
166
250
|
}
|
|
167
251
|
};
|
|
252
|
+
/**
|
|
253
|
+
* Insert/delete CELLS with shift (SHF-*): only the ranges a chart reads move —
|
|
254
|
+
* those wholly inside the shifted band's columns (shift down/up) or rows
|
|
255
|
+
* (shift right/left), with the reference rule along the shift axis. Excel
|
|
256
|
+
* moves drawing anchors only for whole row/column edits, so the chart frame
|
|
257
|
+
* stays where it is.
|
|
258
|
+
*/
|
|
259
|
+
export const shiftChartsOnCellShift = (draft, sheetId, axis, op, index, count, band) => {
|
|
260
|
+
for (const chart of draft) {
|
|
261
|
+
shiftChartSpecRanges(chart.spec, sheetId, axis, op, index, count, band);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
168
264
|
/**
|
|
169
265
|
* Shift AllowEditRange rectangles. A protected range without a rectangle
|
|
170
266
|
* (sheet-scoped protection) is untouched; one the delete consumes is removed.
|
|
@@ -210,3 +306,267 @@ export const shiftProtectedRangesOnStructuralChange = (draft, sheetId, axis, op,
|
|
|
210
306
|
}
|
|
211
307
|
}
|
|
212
308
|
};
|
|
309
|
+
/**
|
|
310
|
+
* Visit every `SheetRange` a chart spec holds — `dataRange`, per-series /
|
|
311
|
+
* per-domain `sources`, error-bar `plusRange` / `minusRange`, and any future
|
|
312
|
+
* range-valued key — replacing it with what `rewrite` returns. A range the
|
|
313
|
+
* rewrite returns `null` for is removed — spliced out of arrays (`sources`),
|
|
314
|
+
* nulled on properties (`dataRange`) — the chart's `#REF!`; a move never
|
|
315
|
+
* consumes a range, so its rewrites always return a range. Mutates in place;
|
|
316
|
+
* returns whether anything changed.
|
|
317
|
+
*/
|
|
318
|
+
const rewriteChartSpecRanges = (spec, rewrite) => {
|
|
319
|
+
let changed = false;
|
|
320
|
+
const walk = (node) => {
|
|
321
|
+
if (!node || typeof node !== "object")
|
|
322
|
+
return;
|
|
323
|
+
if (Array.isArray(node)) {
|
|
324
|
+
for (let i = node.length - 1; i >= 0; i--) {
|
|
325
|
+
const item = node[i];
|
|
326
|
+
if (isSheetRangeLike(item)) {
|
|
327
|
+
const next = rewrite(item);
|
|
328
|
+
if (next === null) {
|
|
329
|
+
node.splice(i, 1);
|
|
330
|
+
changed = true;
|
|
331
|
+
}
|
|
332
|
+
else if (next !== item) {
|
|
333
|
+
node[i] = next;
|
|
334
|
+
changed = true;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
walk(item);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
const obj = node;
|
|
344
|
+
for (const key of Object.keys(obj)) {
|
|
345
|
+
const value = obj[key];
|
|
346
|
+
if (isSheetRangeLike(value)) {
|
|
347
|
+
const next = rewrite(value);
|
|
348
|
+
if (next !== value) {
|
|
349
|
+
obj[key] = next;
|
|
350
|
+
changed = true;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
walk(value);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
walk(spec);
|
|
359
|
+
return changed;
|
|
360
|
+
};
|
|
361
|
+
/**
|
|
362
|
+
* Deleting a sheet consumes every range on it: a chart elsewhere whose series
|
|
363
|
+
* / category / data range read the deleted sheet keeps the chart but loses
|
|
364
|
+
* that range (Excel's empty `#REF!` series).
|
|
365
|
+
*/
|
|
366
|
+
export const removeChartSpecRangesOnSheet = (spec, sheetId) => rewriteChartSpecRanges(spec, (range) => range.sheetId === sheetId ? null : range);
|
|
367
|
+
/**
|
|
368
|
+
* Re-point every range on `fromSheetId` at `toSheetId` — a duplicated sheet's
|
|
369
|
+
* charts read the copy's own cells (Excel), while ranges on other sheets keep
|
|
370
|
+
* reading the original.
|
|
371
|
+
*/
|
|
372
|
+
export const retargetChartSpecRanges = (spec, fromSheetId, toSheetId) => rewriteChartSpecRanges(spec, (range) => range.sheetId === fromSheetId ? { ...range, sheetId: toSheetId } : range);
|
|
373
|
+
/**
|
|
374
|
+
* Relocate the ranges inside a chart spec when the block `from` on
|
|
375
|
+
* `fromSheetId` is moved (drag-move, cut → paste) to `to` on `toSheetId`, the
|
|
376
|
+
* way Excel re-points series like references: a range that lies ENTIRELY
|
|
377
|
+
* inside the moved block travels with it (shifted by the move delta and onto
|
|
378
|
+
* the destination sheet); a range the block covers only partially, and any
|
|
379
|
+
* range outside it, keeps referring to its original cells. Mirrors
|
|
380
|
+
* `move_spec_sheet_ranges` in `rnc-store`.
|
|
381
|
+
*/
|
|
382
|
+
export const moveChartSpecRanges = (spec, fromSheetId, from, toSheetId, to) => {
|
|
383
|
+
const rowDelta = to.startRowIndex - from.startRowIndex;
|
|
384
|
+
const columnDelta = to.startColumnIndex - from.startColumnIndex;
|
|
385
|
+
if (rowDelta === 0 && columnDelta === 0 && fromSheetId === toSheetId) {
|
|
386
|
+
return false;
|
|
387
|
+
}
|
|
388
|
+
return rewriteChartSpecRanges(spec, (range) => {
|
|
389
|
+
if (range.sheetId !== fromSheetId ||
|
|
390
|
+
range.startRowIndex < from.startRowIndex ||
|
|
391
|
+
range.endRowIndex > from.endRowIndex ||
|
|
392
|
+
range.startColumnIndex < from.startColumnIndex ||
|
|
393
|
+
range.endColumnIndex > from.endColumnIndex) {
|
|
394
|
+
return range;
|
|
395
|
+
}
|
|
396
|
+
return {
|
|
397
|
+
...range,
|
|
398
|
+
sheetId: toSheetId,
|
|
399
|
+
startRowIndex: range.startRowIndex + rowDelta,
|
|
400
|
+
endRowIndex: range.endRowIndex + rowDelta,
|
|
401
|
+
startColumnIndex: range.startColumnIndex + columnDelta,
|
|
402
|
+
endColumnIndex: range.endColumnIndex + columnDelta,
|
|
403
|
+
};
|
|
404
|
+
});
|
|
405
|
+
};
|
|
406
|
+
/** Re-point the ranges of every chart when a cell block is moved (see `moveChartSpecRanges`). */
|
|
407
|
+
export const moveChartsOnRangeMove = (draft, fromSheetId, from, toSheetId, to) => {
|
|
408
|
+
for (const chart of draft) {
|
|
409
|
+
moveChartSpecRanges(chart.spec, fromSheetId, from, toSheetId, to);
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
/**
|
|
413
|
+
* Where line `index` (a row or column) ends up after the whole lines `lines`
|
|
414
|
+
* (sorted ascending) are moved so the block lands at `target` in the
|
|
415
|
+
* post-removal frame — the permutation a row/column move applies to every
|
|
416
|
+
* cell. A moved line lands at `target` + its rank in the block; a line outside
|
|
417
|
+
* closes the gap the block left and is pushed by the block landing at or
|
|
418
|
+
* before it. Mirrors `moved_line_index` in `rnc-store`.
|
|
419
|
+
*/
|
|
420
|
+
export const movedLineIndex = (lines, target, index) => {
|
|
421
|
+
const rank = lines.indexOf(index);
|
|
422
|
+
if (rank !== -1)
|
|
423
|
+
return target + rank;
|
|
424
|
+
let removedBefore = 0;
|
|
425
|
+
for (const line of lines) {
|
|
426
|
+
if (line < index)
|
|
427
|
+
removedBefore++;
|
|
428
|
+
}
|
|
429
|
+
const settled = index - removedBefore;
|
|
430
|
+
return settled < target ? settled : settled + lines.length;
|
|
431
|
+
};
|
|
432
|
+
/**
|
|
433
|
+
* Re-point the ranges inside a chart spec when whole rows / columns of
|
|
434
|
+
* `sheetId` are moved (`lines` land at `target`), with the rule the engines
|
|
435
|
+
* apply to formula references: both edges follow their line, and the range is
|
|
436
|
+
* rewritten only when that yields a range of the same size — so a range wholly
|
|
437
|
+
* inside the moved block relocates with it, one wholly inside the displaced
|
|
438
|
+
* band shifts by the block size, and one straddling the block and its
|
|
439
|
+
* neighbours keeps its text (it still covers the same cells). Mirrors
|
|
440
|
+
* `permute_spec_sheet_ranges` in `rnc-store` / `remap_formula_axis`.
|
|
441
|
+
*/
|
|
442
|
+
export const reorderChartSpecRanges = (spec, sheetId, axis, lines, target) => {
|
|
443
|
+
if (!lines.length)
|
|
444
|
+
return false;
|
|
445
|
+
const [startKey, endKey] = axis === "row"
|
|
446
|
+
? ["startRowIndex", "endRowIndex"]
|
|
447
|
+
: ["startColumnIndex", "endColumnIndex"];
|
|
448
|
+
return rewriteChartSpecRanges(spec, (range) => {
|
|
449
|
+
if (range.sheetId !== sheetId)
|
|
450
|
+
return range;
|
|
451
|
+
const start = range[startKey];
|
|
452
|
+
const end = range[endKey];
|
|
453
|
+
const nextStart = movedLineIndex(lines, target, start);
|
|
454
|
+
const nextEnd = movedLineIndex(lines, target, end);
|
|
455
|
+
if (nextEnd < nextStart ||
|
|
456
|
+
nextEnd - nextStart !== end - start ||
|
|
457
|
+
(nextStart === start && nextEnd === end)) {
|
|
458
|
+
return range;
|
|
459
|
+
}
|
|
460
|
+
return { ...range, [startKey]: nextStart, [endKey]: nextEnd };
|
|
461
|
+
});
|
|
462
|
+
};
|
|
463
|
+
/** Re-point the ranges of every chart when whole rows / columns are moved (see `reorderChartSpecRanges`). */
|
|
464
|
+
export const reorderChartsOnLineMove = (draft, sheetId, axis, lines, target) => {
|
|
465
|
+
for (const chart of draft) {
|
|
466
|
+
reorderChartSpecRanges(chart.spec, sheetId, axis, lines, target);
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
export const tableBinding = (table) => {
|
|
470
|
+
const { range } = table;
|
|
471
|
+
const bodyStartRowIndex = range.startRowIndex + (table.headerRow === false ? 0 : 1);
|
|
472
|
+
return {
|
|
473
|
+
range,
|
|
474
|
+
rowStarts: [range.startRowIndex, bodyStartRowIndex],
|
|
475
|
+
bodyEndRowIndex: range.endRowIndex - (table.totalRow ? 1 : 0),
|
|
476
|
+
};
|
|
477
|
+
};
|
|
478
|
+
/**
|
|
479
|
+
* A range bound to the table along `axis`: it covers the body rows (or header + body) of one or
|
|
480
|
+
* more table columns — for a column edit ALL of them, since a series is a column and only a range
|
|
481
|
+
* reading the whole table gains a column with it.
|
|
482
|
+
*/
|
|
483
|
+
const isTableBoundRange = (range, binding, axis) => binding.rowStarts.includes(range.startRowIndex) &&
|
|
484
|
+
range.endRowIndex === binding.bodyEndRowIndex &&
|
|
485
|
+
range.startColumnIndex >= binding.range.startColumnIndex &&
|
|
486
|
+
range.endColumnIndex <= binding.range.endColumnIndex &&
|
|
487
|
+
(axis === "row" ||
|
|
488
|
+
(range.startColumnIndex === binding.range.startColumnIndex &&
|
|
489
|
+
range.endColumnIndex === binding.range.endColumnIndex));
|
|
490
|
+
/** The table's extent across `axis` — the band a table-local edit moves cells in. */
|
|
491
|
+
const tableBand = (binding, axis) => axis === "row"
|
|
492
|
+
? {
|
|
493
|
+
startIndex: binding.range.startColumnIndex,
|
|
494
|
+
endIndex: binding.range.endColumnIndex,
|
|
495
|
+
}
|
|
496
|
+
: {
|
|
497
|
+
startIndex: binding.range.startRowIndex,
|
|
498
|
+
endIndex: binding.range.endRowIndex,
|
|
499
|
+
};
|
|
500
|
+
const growSpan = (range, axis, delta) => {
|
|
501
|
+
const [startKey, endKey] = axis === "row"
|
|
502
|
+
? ["startRowIndex", "endRowIndex"]
|
|
503
|
+
: ["startColumnIndex", "endColumnIndex"];
|
|
504
|
+
const end = range[endKey] + delta;
|
|
505
|
+
return end < range[startKey] ? null : { ...range, [endKey]: end };
|
|
506
|
+
};
|
|
507
|
+
/**
|
|
508
|
+
* Insert / delete table rows (or columns): the cells inside the table's columns (rows) at/after
|
|
509
|
+
* `index` move, so every chart range wholly inside that band follows the reference rule like
|
|
510
|
+
* insert/delete-cells — except a range bound to the table (`isTableBoundRange`), which grows /
|
|
511
|
+
* shrinks by `count` even when the rows are appended below the last body row (where the
|
|
512
|
+
* reference rule would leave it alone) or inserted above the first one (where it would shift):
|
|
513
|
+
* Excel keeps the series on the table column. A range that collapses is removed (`#REF!`).
|
|
514
|
+
* Mutates in place; returns whether anything changed. Mirrors
|
|
515
|
+
* `shift_spec_sheet_ranges_for_table_edit` in `rnc-store`.
|
|
516
|
+
*/
|
|
517
|
+
export const shiftChartSpecRangesOnTableEdit = (spec, sheetId, binding, axis, op, index, count) => {
|
|
518
|
+
const band = tableBand(binding, axis);
|
|
519
|
+
const [acrossStartKey, acrossEndKey] = axis === "row"
|
|
520
|
+
? ["startColumnIndex", "endColumnIndex"]
|
|
521
|
+
: ["startRowIndex", "endRowIndex"];
|
|
522
|
+
return rewriteChartSpecRanges(spec, (range) => {
|
|
523
|
+
if (range.sheetId !== sheetId ||
|
|
524
|
+
range[acrossStartKey] < band.startIndex ||
|
|
525
|
+
range[acrossEndKey] > band.endIndex) {
|
|
526
|
+
return range;
|
|
527
|
+
}
|
|
528
|
+
if (isTableBoundRange(range, binding, axis)) {
|
|
529
|
+
return growSpan(range, axis, op === "insert" ? count : -count);
|
|
530
|
+
}
|
|
531
|
+
return shiftGridRangeLikeReference(range, axis, op, index, count);
|
|
532
|
+
});
|
|
533
|
+
};
|
|
534
|
+
/**
|
|
535
|
+
* Table growth without a cell shift — the resize handle, typing below / to the right of the
|
|
536
|
+
* table: a range bound to the table (`isTableBoundRange`) grows / shrinks with its body by
|
|
537
|
+
* `rowDelta` rows, then by `columnDelta` columns against the row-grown table. Mutates in place;
|
|
538
|
+
* returns whether anything changed. Mirrors `grow_table_bound_spec_ranges` in `rnc-store`.
|
|
539
|
+
*/
|
|
540
|
+
export const growTableBoundChartSpecRanges = (spec, sheetId, binding, rowDelta, columnDelta) => {
|
|
541
|
+
if (rowDelta === 0 && columnDelta === 0)
|
|
542
|
+
return false;
|
|
543
|
+
const rowGrown = {
|
|
544
|
+
...binding,
|
|
545
|
+
range: { ...binding.range, endRowIndex: binding.range.endRowIndex + rowDelta },
|
|
546
|
+
bodyEndRowIndex: binding.bodyEndRowIndex + rowDelta,
|
|
547
|
+
};
|
|
548
|
+
return rewriteChartSpecRanges(spec, (range) => {
|
|
549
|
+
if (range.sheetId !== sheetId)
|
|
550
|
+
return range;
|
|
551
|
+
let next = range;
|
|
552
|
+
if (rowDelta !== 0 && isTableBoundRange(next, binding, "row")) {
|
|
553
|
+
next = growSpan(next, "row", rowDelta);
|
|
554
|
+
}
|
|
555
|
+
if (next && columnDelta !== 0 && isTableBoundRange(next, rowGrown, "column")) {
|
|
556
|
+
next = growSpan(next, "column", columnDelta);
|
|
557
|
+
}
|
|
558
|
+
return next;
|
|
559
|
+
});
|
|
560
|
+
};
|
|
561
|
+
/** Every chart's ranges follow a table-local row / column insert or delete (see `shiftChartSpecRangesOnTableEdit`). */
|
|
562
|
+
export const shiftChartsOnTableEdit = (draft, sheetId, binding, axis, op, index, count) => {
|
|
563
|
+
for (const chart of draft) {
|
|
564
|
+
shiftChartSpecRangesOnTableEdit(chart.spec, sheetId, binding, axis, op, index, count);
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
/** Every chart's table-bound ranges grow / shrink with a resized or auto-expanded table (see `growTableBoundChartSpecRanges`). */
|
|
568
|
+
export const growChartsWithTable = (draft, sheetId, binding, rowDelta, columnDelta) => {
|
|
569
|
+
for (const chart of draft) {
|
|
570
|
+
growTableBoundChartSpecRanges(chart.spec, sheetId, binding, rowDelta, columnDelta);
|
|
571
|
+
}
|
|
572
|
+
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { CellInterface, GridRange } from "@rowsncolumns/common-types";
|
|
2
2
|
import type { CellData, EmbeddedObject, TableView } from "@rowsncolumns/spreadsheet";
|
|
3
|
-
import type { GeneratedNames } from "../generated-names";
|
|
4
3
|
import type { UseSpreadsheetProps } from "../hooks/use-spreadsheet-state";
|
|
5
4
|
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
5
|
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,
|
|
6
|
+
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, options?: {
|
|
8
7
|
/**
|
|
9
8
|
* Re-anchor each copied formula's relative refs from its `sourceCell` to the paste
|
|
10
9
|
* destination (a COPY). `false` for a CUT: Excel keeps a moved formula's text verbatim and
|
|
@@ -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;
|
|
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;AAcnC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAW1E,MAAM,MAAM,eAAe,GACvB,WAAW,GACX,UAAU,GACV,YAAY,GACZ,kBAAkB,GAClB,YAAY,GACZ,WAAW,GACX,WAAW,GACX,YAAY,GACZ,aAAa,GACb,WAAW,GACX,eAAe,GACf,YAAY,GACZ,YAAY,GACZ,cAAc,CAAC;AAEnB,eAAO,MAAM,qBAAqB,UAWjC,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAU,CAAC,SAAS,QAAQ,EAChE,GAAG,cAAc,GAAG,SAAS,EAC7B,YAAY,aAAa,EACzB,SAAS,MAAM,EACf,iBAAiB,MAAM,EACvB,qBAAqB,OAAO,EAC5B,SAAS,MAAM,EACf,qBAAqB,mBAAmB,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,EACjE,iBAAiB,OAAO,EACxB,eAAe,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EACvC,UAAU;IACR;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,KACA,OAAO,CACN;IACE,OAAO,CAAC,EAAE,CAAC,QAAQ,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,EAAE,CAAC;IAC5C,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,GACD,SAAS,CAqQZ,CAAC;AAEF,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,SAazC;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,QAAQ,EAC/C,MAAM,EAAE,CAAC,QAAQ,GAAG,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,EAAE,yCAwB9C;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS,QAAQ,EAC1C,MAAM,EAAE,CAAC,QAAQ,GAAG,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,EAAE,EAC7C,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,yCAkChB;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,QAAQ,EAC5C,MAAM,EAAE,CAAC,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"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createCellDataArrayFromCSVString, readImageFileAsDataUri, } from "@rowsncolumns/toolkit";
|
|
2
2
|
import { getCellEffectiveFormat, isAFormula, isNil, log, } from "@rowsncolumns/utils";
|
|
3
3
|
import { uuid } from "@rowsncolumns/utils";
|
|
4
|
-
import { getGeneratedTableCopyName } from "../generated-names";
|
|
5
4
|
import { defaultCellCoords, defaultSheetId, isStyleReference, SheetCell, } from "../sheet-cell";
|
|
6
5
|
import { isRichSharedString } from "../types";
|
|
7
6
|
import { isBoolean, isValidURLorEmail } from "./datatype";
|
|
@@ -18,7 +17,7 @@ export const SUPPORTED_IMAGE_TYPES = [
|
|
|
18
17
|
"image/webp",
|
|
19
18
|
"image/x-icon",
|
|
20
19
|
];
|
|
21
|
-
export const generateDataFromClipboard = async (e, activeCell, sheetId, activeSheetName, preserveFormatting, locale, idCreationStrategy, forcePlainText, sanitizeHtml,
|
|
20
|
+
export const generateDataFromClipboard = async (e, activeCell, sheetId, activeSheetName, preserveFormatting, locale, idCreationStrategy, forcePlainText, sanitizeHtml, options) => {
|
|
22
21
|
const items = e?.clipboardData?.items;
|
|
23
22
|
const files = e?.clipboardData?.files;
|
|
24
23
|
const formatOrder = [
|
|
@@ -84,7 +83,6 @@ export const generateDataFromClipboard = async (e, activeCell, sheetId, activeSh
|
|
|
84
83
|
const rowSpan = table.range.endRowIndex - table.range.startRowIndex;
|
|
85
84
|
const colSpan = table.range.endColumnIndex - table.range.startColumnIndex;
|
|
86
85
|
table.id = idCreationStrategy?.("table") ?? uuid();
|
|
87
|
-
table.title = getGeneratedTableCopyName(table.title, generatedNames);
|
|
88
86
|
// Update sheet id
|
|
89
87
|
table.sheetId = sheetId;
|
|
90
88
|
table.range.startRowIndex = activeCell.rowIndex + rowDelta;
|