@rowsncolumns/spreadsheet-state 28.0.74 → 28.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/anchored-objects.d.ts +66 -0
- package/dist/cjs/api/anchored-objects.d.ts.map +1 -0
- package/dist/cjs/api/anchored-objects.js +259 -0
- package/dist/cjs/api/datatype.d.ts.map +1 -1
- package/dist/cjs/api/datatype.js +8 -1
- package/dist/cjs/api/dependency.d.ts +13 -2
- package/dist/cjs/api/dependency.d.ts.map +1 -1
- package/dist/cjs/api/dependency.js +11 -5
- package/dist/cjs/api/fill-series-spec.d.ts +35 -0
- package/dist/cjs/api/fill-series-spec.d.ts.map +1 -0
- package/dist/cjs/api/fill-series-spec.js +164 -0
- package/dist/cjs/api/fill.d.ts +95 -3
- package/dist/cjs/api/fill.d.ts.map +1 -1
- package/dist/cjs/api/fill.js +1186 -418
- package/dist/cjs/api/formula.d.ts +61 -4
- package/dist/cjs/api/formula.d.ts.map +1 -1
- package/dist/cjs/api/formula.js +250 -61
- package/dist/cjs/api/immer-utils.d.ts.map +1 -1
- package/dist/cjs/api/immer-utils.js +20 -15
- package/dist/cjs/api/intl.d.ts.map +1 -1
- 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 +64 -1
- package/dist/cjs/api/named-range-structural.d.ts +62 -0
- package/dist/cjs/api/named-range-structural.d.ts.map +1 -0
- package/dist/cjs/api/named-range-structural.js +197 -0
- package/dist/cjs/api/paint-format.d.ts +15 -1
- package/dist/cjs/api/paint-format.d.ts.map +1 -1
- package/dist/cjs/api/paint-format.js +69 -10
- package/dist/cjs/api/range-rule-helpers.d.ts +45 -1
- package/dist/cjs/api/range-rule-helpers.d.ts.map +1 -1
- package/dist/cjs/api/range-rule-helpers.js +159 -6
- package/dist/cjs/api/structural-formula-update.d.ts.map +1 -1
- package/dist/cjs/api/structural-formula-update.js +24 -6
- package/dist/cjs/api/structural-guards.d.ts +78 -0
- package/dist/cjs/api/structural-guards.d.ts.map +1 -0
- package/dist/cjs/api/structural-guards.js +202 -0
- package/dist/cjs/api/structural-table-refs.d.ts +94 -0
- package/dist/cjs/api/structural-table-refs.d.ts.map +1 -0
- package/dist/cjs/api/structural-table-refs.js +313 -0
- package/dist/cjs/commands.d.ts +11 -1
- package/dist/cjs/commands.d.ts.map +1 -1
- package/dist/cjs/constants.d.ts +25 -0
- package/dist/cjs/constants.d.ts.map +1 -0
- package/dist/cjs/constants.js +26 -0
- package/dist/cjs/hooks/use-calculation-worker.d.ts.map +1 -1
- package/dist/cjs/hooks/use-calculation-worker.js +64 -6
- package/dist/cjs/hooks/use-calculation.d.ts +8 -1
- package/dist/cjs/hooks/use-calculation.d.ts.map +1 -1
- package/dist/cjs/hooks/use-calculation.js +15 -0
- package/dist/cjs/hooks/use-on-calculation-success.d.ts +7 -0
- package/dist/cjs/hooks/use-on-calculation-success.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-calculation-success.js +7 -1
- package/dist/cjs/hooks/use-on-delete-cells-shift-left.d.ts +13 -3
- package/dist/cjs/hooks/use-on-delete-cells-shift-left.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-delete-cells-shift-left.js +27 -2
- package/dist/cjs/hooks/use-on-delete-cells-shift-up.d.ts +13 -3
- package/dist/cjs/hooks/use-on-delete-cells-shift-up.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-delete-cells-shift-up.js +27 -2
- package/dist/cjs/hooks/use-on-delete-column.d.ts +13 -4
- package/dist/cjs/hooks/use-on-delete-column.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-delete-column.js +14 -2
- package/dist/cjs/hooks/use-on-delete-row.d.ts +13 -4
- package/dist/cjs/hooks/use-on-delete-row.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-delete-row.js +14 -2
- package/dist/cjs/hooks/use-on-fill.d.ts +13 -4
- package/dist/cjs/hooks/use-on-fill.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-fill.js +28 -7
- package/dist/cjs/hooks/use-on-insert-cells-shift-down.d.ts +13 -3
- package/dist/cjs/hooks/use-on-insert-cells-shift-down.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-insert-cells-shift-down.js +27 -2
- package/dist/cjs/hooks/use-on-insert-cells-shift-right.d.ts +13 -3
- package/dist/cjs/hooks/use-on-insert-cells-shift-right.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-insert-cells-shift-right.js +27 -2
- package/dist/cjs/hooks/use-on-insert-column.d.ts +10 -3
- package/dist/cjs/hooks/use-on-insert-column.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-insert-column.js +33 -7
- package/dist/cjs/hooks/use-on-insert-row.d.ts +10 -3
- package/dist/cjs/hooks/use-on-insert-row.d.ts.map +1 -1
- package/dist/cjs/hooks/use-on-insert-row.js +32 -7
- package/dist/cjs/hooks/use-paint-format.d.ts.map +1 -1
- package/dist/cjs/hooks/use-paint-format.js +10 -7
- package/dist/cjs/hooks/use-spreadsheet-state.d.ts +3 -3
- package/dist/cjs/hooks/use-spreadsheet-state.d.ts.map +1 -1
- package/dist/cjs/hooks/use-spreadsheet-state.js +73 -16
- package/dist/cjs/hooks/use-structured-reference.d.ts.map +1 -1
- package/dist/cjs/hooks/use-structured-reference.js +10 -6
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/interface/apply-fill.d.ts +3 -3
- package/dist/cjs/interface/apply-fill.d.ts.map +1 -1
- package/dist/cjs/interface/apply-fill.js +100 -53
- package/dist/cjs/interface/calculation-interface.d.ts +9 -0
- package/dist/cjs/interface/calculation-interface.d.ts.map +1 -1
- package/dist/cjs/interface/calculation-interface.js +31 -2
- package/dist/cjs/interface/delete-cells-shift-left.d.ts +8 -1
- package/dist/cjs/interface/delete-cells-shift-left.d.ts.map +1 -1
- package/dist/cjs/interface/delete-cells-shift-left.js +158 -80
- package/dist/cjs/interface/delete-cells-shift-up.d.ts +9 -1
- package/dist/cjs/interface/delete-cells-shift-up.d.ts.map +1 -1
- package/dist/cjs/interface/delete-cells-shift-up.js +155 -73
- package/dist/cjs/interface/delete-column.d.ts +1 -1
- package/dist/cjs/interface/delete-column.d.ts.map +1 -1
- package/dist/cjs/interface/delete-column.js +90 -31
- 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 +85 -26
- package/dist/cjs/interface/insert-cells-shift-down.d.ts +10 -1
- package/dist/cjs/interface/insert-cells-shift-down.d.ts.map +1 -1
- package/dist/cjs/interface/insert-cells-shift-down.js +147 -52
- package/dist/cjs/interface/insert-cells-shift-right.d.ts +10 -1
- package/dist/cjs/interface/insert-cells-shift-right.d.ts.map +1 -1
- package/dist/cjs/interface/insert-cells-shift-right.js +154 -58
- package/dist/cjs/interface/insert-column.d.ts +1 -1
- package/dist/cjs/interface/insert-column.d.ts.map +1 -1
- package/dist/cjs/interface/insert-column.js +46 -8
- 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 +47 -10
- 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 +33 -0
- package/dist/cjs/sheet-cell.d.ts.map +1 -1
- package/dist/cjs/sheet-cell.js +30 -6
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/api/anchored-objects.d.ts +66 -0
- package/dist/esm/api/anchored-objects.d.ts.map +1 -0
- package/dist/esm/api/anchored-objects.js +212 -0
- package/dist/esm/api/datatype.d.ts.map +1 -1
- package/dist/esm/api/datatype.js +8 -1
- package/dist/esm/api/dependency.d.ts +13 -2
- package/dist/esm/api/dependency.d.ts.map +1 -1
- package/dist/esm/api/dependency.js +10 -4
- package/dist/esm/api/fill-series-spec.d.ts +35 -0
- package/dist/esm/api/fill-series-spec.d.ts.map +1 -0
- package/dist/esm/api/fill-series-spec.js +160 -0
- package/dist/esm/api/fill.d.ts +95 -3
- package/dist/esm/api/fill.d.ts.map +1 -1
- package/dist/esm/api/fill.js +1158 -418
- package/dist/esm/api/formula.d.ts +61 -4
- package/dist/esm/api/formula.d.ts.map +1 -1
- package/dist/esm/api/formula.js +238 -60
- package/dist/esm/api/immer-utils.d.ts.map +1 -1
- package/dist/esm/api/immer-utils.js +20 -15
- package/dist/esm/api/intl.d.ts.map +1 -1
- 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 +51 -0
- package/dist/esm/api/named-range-structural.d.ts +62 -0
- package/dist/esm/api/named-range-structural.d.ts.map +1 -0
- package/dist/esm/api/named-range-structural.js +176 -0
- package/dist/esm/api/paint-format.d.ts +15 -1
- package/dist/esm/api/paint-format.d.ts.map +1 -1
- package/dist/esm/api/paint-format.js +46 -1
- package/dist/esm/api/range-rule-helpers.d.ts +45 -1
- package/dist/esm/api/range-rule-helpers.d.ts.map +1 -1
- package/dist/esm/api/range-rule-helpers.js +153 -1
- package/dist/esm/api/structural-formula-update.d.ts.map +1 -1
- package/dist/esm/api/structural-formula-update.js +24 -6
- package/dist/esm/api/structural-guards.d.ts +78 -0
- package/dist/esm/api/structural-guards.d.ts.map +1 -0
- package/dist/esm/api/structural-guards.js +186 -0
- package/dist/esm/api/structural-table-refs.d.ts +94 -0
- package/dist/esm/api/structural-table-refs.d.ts.map +1 -0
- package/dist/esm/api/structural-table-refs.js +219 -0
- package/dist/esm/commands.d.ts +11 -1
- package/dist/esm/commands.d.ts.map +1 -1
- package/dist/esm/constants.d.ts +25 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +26 -0
- package/dist/esm/hooks/use-calculation-worker.d.ts.map +1 -1
- package/dist/esm/hooks/use-calculation-worker.js +45 -0
- package/dist/esm/hooks/use-calculation.d.ts +8 -1
- package/dist/esm/hooks/use-calculation.d.ts.map +1 -1
- package/dist/esm/hooks/use-calculation.js +15 -0
- package/dist/esm/hooks/use-on-calculation-success.d.ts +7 -0
- package/dist/esm/hooks/use-on-calculation-success.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-calculation-success.js +7 -1
- package/dist/esm/hooks/use-on-delete-cells-shift-left.d.ts +13 -3
- package/dist/esm/hooks/use-on-delete-cells-shift-left.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-delete-cells-shift-left.js +26 -2
- package/dist/esm/hooks/use-on-delete-cells-shift-up.d.ts +13 -3
- package/dist/esm/hooks/use-on-delete-cells-shift-up.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-delete-cells-shift-up.js +26 -2
- package/dist/esm/hooks/use-on-delete-column.d.ts +13 -4
- package/dist/esm/hooks/use-on-delete-column.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-delete-column.js +14 -2
- package/dist/esm/hooks/use-on-delete-row.d.ts +13 -4
- package/dist/esm/hooks/use-on-delete-row.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-delete-row.js +14 -2
- package/dist/esm/hooks/use-on-fill.d.ts +13 -4
- package/dist/esm/hooks/use-on-fill.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-fill.js +24 -4
- package/dist/esm/hooks/use-on-insert-cells-shift-down.d.ts +13 -3
- package/dist/esm/hooks/use-on-insert-cells-shift-down.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-insert-cells-shift-down.js +26 -2
- package/dist/esm/hooks/use-on-insert-cells-shift-right.d.ts +13 -3
- package/dist/esm/hooks/use-on-insert-cells-shift-right.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-insert-cells-shift-right.js +26 -2
- package/dist/esm/hooks/use-on-insert-column.d.ts +10 -3
- package/dist/esm/hooks/use-on-insert-column.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-insert-column.js +33 -7
- package/dist/esm/hooks/use-on-insert-row.d.ts +10 -3
- package/dist/esm/hooks/use-on-insert-row.d.ts.map +1 -1
- package/dist/esm/hooks/use-on-insert-row.js +32 -7
- package/dist/esm/hooks/use-paint-format.d.ts.map +1 -1
- package/dist/esm/hooks/use-paint-format.js +10 -7
- package/dist/esm/hooks/use-spreadsheet-state.d.ts +3 -3
- package/dist/esm/hooks/use-spreadsheet-state.d.ts.map +1 -1
- package/dist/esm/hooks/use-spreadsheet-state.js +73 -16
- package/dist/esm/hooks/use-structured-reference.d.ts.map +1 -1
- package/dist/esm/hooks/use-structured-reference.js +10 -6
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/interface/apply-fill.d.ts +3 -3
- package/dist/esm/interface/apply-fill.d.ts.map +1 -1
- package/dist/esm/interface/apply-fill.js +93 -48
- package/dist/esm/interface/calculation-interface.d.ts +9 -0
- package/dist/esm/interface/calculation-interface.d.ts.map +1 -1
- package/dist/esm/interface/calculation-interface.js +33 -2
- package/dist/esm/interface/delete-cells-shift-left.d.ts +8 -1
- package/dist/esm/interface/delete-cells-shift-left.d.ts.map +1 -1
- package/dist/esm/interface/delete-cells-shift-left.js +135 -59
- package/dist/esm/interface/delete-cells-shift-up.d.ts +9 -1
- package/dist/esm/interface/delete-cells-shift-up.d.ts.map +1 -1
- package/dist/esm/interface/delete-cells-shift-up.js +133 -53
- package/dist/esm/interface/delete-column.d.ts +1 -1
- package/dist/esm/interface/delete-column.d.ts.map +1 -1
- package/dist/esm/interface/delete-column.js +80 -11
- 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 +81 -11
- package/dist/esm/interface/insert-cells-shift-down.d.ts +10 -1
- package/dist/esm/interface/insert-cells-shift-down.d.ts.map +1 -1
- package/dist/esm/interface/insert-cells-shift-down.js +116 -47
- package/dist/esm/interface/insert-cells-shift-right.d.ts +10 -1
- package/dist/esm/interface/insert-cells-shift-right.d.ts.map +1 -1
- package/dist/esm/interface/insert-cells-shift-right.js +120 -51
- package/dist/esm/interface/insert-column.d.ts +1 -1
- package/dist/esm/interface/insert-column.d.ts.map +1 -1
- package/dist/esm/interface/insert-column.js +46 -8
- 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 +47 -10
- 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 +29 -0
- package/dist/esm/sheet-cell.d.ts.map +1 -1
- package/dist/esm/sheet-cell.js +30 -6
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +17 -17
|
@@ -14,12 +14,13 @@ import { useCalculation } from "./use-calculation";
|
|
|
14
14
|
import { useCalculationInitialize } from "./use-calculation-initialize";
|
|
15
15
|
import { useCalculationWorker } from "./use-calculation-worker";
|
|
16
16
|
import { useCellXfsRegistry } from "./use-cellxfs-registry";
|
|
17
|
-
import { useComments } from "./use-comments";
|
|
18
17
|
import { useCitations } from "./use-citations";
|
|
18
|
+
import { useComments } from "./use-comments";
|
|
19
19
|
import { useConditionalFormattingRules } from "./use-conditional-formatting-rules";
|
|
20
20
|
import { useDataValidationRules } from "./use-data-validation-rules";
|
|
21
21
|
import { useIndent } from "./use-indent";
|
|
22
22
|
import { useNamedRange } from "./use-named-range";
|
|
23
|
+
import { useOnAdvancedFilter } from "./use-on-advanced-filter";
|
|
23
24
|
import { useOnAutoResize } from "./use-on-autoresize";
|
|
24
25
|
import { useOnBandedRanges } from "./use-on-banded-ranges";
|
|
25
26
|
import { useOnCalculationBegin } from "./use-on-calculation-begin";
|
|
@@ -32,6 +33,8 @@ import { useOnChangeFormatting } from "./use-on-change-formatting";
|
|
|
32
33
|
import { useOnChangeSheetTabcolor } from "./use-on-change-sheet-tabcolor";
|
|
33
34
|
import { useOnChangeTheme } from "./use-on-change-theme";
|
|
34
35
|
import { useOnClearFormatting } from "./use-on-clear-formatting";
|
|
36
|
+
import { useOnCollapseColumnGroup } from "./use-on-collapse-column-group";
|
|
37
|
+
import { useOnCollapseRowGroup } from "./use-on-collapse-row-group";
|
|
35
38
|
import { useOnCopy } from "./use-on-copy";
|
|
36
39
|
import { useOnCreateNamedRange } from "./use-on-create-named-range";
|
|
37
40
|
import { useOnCreateNewSheet } from "./use-on-create-sheet";
|
|
@@ -46,23 +49,18 @@ import { useOnDeleteTableRow } from "./use-on-delete-table-row";
|
|
|
46
49
|
import { useOnDragnDrop } from "./use-on-drag-n-drop";
|
|
47
50
|
import { useOnDuplicateSheet } from "./use-on-duplicate-sheet";
|
|
48
51
|
import { useOnEmbeds } from "./use-on-embeds";
|
|
49
|
-
import {
|
|
52
|
+
import { useOnExpandColumnGroup } from "./use-on-expand-column-group";
|
|
53
|
+
import { useOnExpandRowGroup } from "./use-on-expand-row-group";
|
|
50
54
|
import { useOnFill } from "./use-on-fill";
|
|
51
55
|
import { useOnFillRange } from "./use-on-fill-range";
|
|
52
56
|
import { useOnFilterTable } from "./use-on-filter-table";
|
|
53
57
|
import { useOnFindReplace } from "./use-on-find-replace";
|
|
54
58
|
import { useOnFreeze } from "./use-on-freeze";
|
|
55
|
-
import {
|
|
56
|
-
import { useOnCollapseRowGroup } from "./use-on-collapse-row-group";
|
|
57
|
-
import { useOnExpandColumnGroup } from "./use-on-expand-column-group";
|
|
58
|
-
import { useOnExpandRowGroup } from "./use-on-expand-row-group";
|
|
59
|
+
import { useOnGoalSeek } from "./use-on-goal-seek";
|
|
59
60
|
import { useOnGroupColumns } from "./use-on-group-columns";
|
|
60
61
|
import { useOnGroupRows } from "./use-on-group-rows";
|
|
61
|
-
import { useOnSetOutlineDepth } from "./use-on-set-outline-depth";
|
|
62
62
|
import { useOnHideColumn } from "./use-on-hide-column";
|
|
63
63
|
import { useOnHideRow } from "./use-on-hide-row";
|
|
64
|
-
import { useOnUngroupColumns } from "./use-on-ungroup-columns";
|
|
65
|
-
import { useOnUngroupRows } from "./use-on-ungroup-rows";
|
|
66
64
|
import { useOnShowHideSheet } from "./use-on-hide-show-sheet";
|
|
67
65
|
import { useOnImportCSV } from "./use-on-import-csv";
|
|
68
66
|
import { useOnImportCSVLegacy } from "./use-on-import-csv-legacy";
|
|
@@ -80,6 +78,7 @@ import { useOnInsertNote } from "./use-on-insert-note";
|
|
|
80
78
|
import { useOnInsertRow } from "./use-on-insert-row";
|
|
81
79
|
import { useOnInsertTableRow } from "./use-on-insert-table-row";
|
|
82
80
|
import { useOnInsertTime } from "./use-on-insert-time";
|
|
81
|
+
import { useOnLocaleChange } from "./use-on-locale-change";
|
|
83
82
|
import { useOnMergeUnMergeCells } from "./use-on-merge-unmerge-cells";
|
|
84
83
|
import { useOnMoveColumns } from "./use-on-move-columns";
|
|
85
84
|
import { useOnMoveRows } from "./use-on-move-rows";
|
|
@@ -88,6 +87,7 @@ import { useOnMoveSheet } from "./use-on-move-sheet";
|
|
|
88
87
|
import { useOnPaste } from "./use-on-paste";
|
|
89
88
|
import { useOnProtectRange } from "./use-on-protect-range";
|
|
90
89
|
import { useOnProtectSheet } from "./use-on-protect-sheet";
|
|
90
|
+
import { useOnRemoveDuplicates } from "./use-on-remove-duplicates";
|
|
91
91
|
import { useOnRenameSheet } from "./use-on-rename-sheet";
|
|
92
92
|
import { useOnRequestCalculateWrapper } from "./use-on-request-calculate-wrapper";
|
|
93
93
|
import { useOnRequestConditionalFormat } from "./use-on-request-conditional-format";
|
|
@@ -102,13 +102,17 @@ import { useOnRequestResize } from "./use-on-request-resize";
|
|
|
102
102
|
import { useOnRequestUpdateNamedRange } from "./use-on-request-update-named-range";
|
|
103
103
|
import { useOnResize } from "./use-on-resize";
|
|
104
104
|
import { useOnResizeTable } from "./use-on-resize-table";
|
|
105
|
+
import { useOnSetOutlineDepth } from "./use-on-set-outline-depth";
|
|
105
106
|
import { useOnShowColumn } from "./use-on-show-column";
|
|
106
107
|
import { useOnShowRow } from "./use-on-show-row";
|
|
107
108
|
import { useOnSortColumn } from "./use-on-sort-column";
|
|
108
109
|
import { useOnSortRange } from "./use-on-sort-range";
|
|
109
110
|
import { useOnSortTable } from "./use-on-sort-table";
|
|
111
|
+
import { useOnSubtotal } from "./use-on-subtotal";
|
|
110
112
|
import { useOnTable } from "./use-on-table";
|
|
111
113
|
import { useOnTraceDependentsPrecedents } from "./use-on-trace-dependents-precedents";
|
|
114
|
+
import { useOnUngroupColumns } from "./use-on-ungroup-columns";
|
|
115
|
+
import { useOnUngroupRows } from "./use-on-ungroup-rows";
|
|
112
116
|
import { useOnUpdateNamedRange } from "./use-on-update-named-range";
|
|
113
117
|
import { useOnUpdateNote } from "./use-on-update-note";
|
|
114
118
|
import { useOnUpdateSheet } from "./use-on-update-sheet";
|
|
@@ -118,12 +122,8 @@ import { useSheetObserver } from "./use-sheet-observer";
|
|
|
118
122
|
import { useSheetProperties } from "./use-sheet-properties";
|
|
119
123
|
import { useSheetState } from "./use-sheet-state";
|
|
120
124
|
import { useSheetDataSubscriber } from "./use-sheetdata-subscriber";
|
|
125
|
+
import { useSlicers } from "./use-slicers";
|
|
121
126
|
import { useSplitTextToColumns } from "./use-split-text-to-columns";
|
|
122
|
-
import { useOnLocaleChange } from "./use-on-locale-change";
|
|
123
|
-
import { useOnRemoveDuplicates } from "./use-on-remove-duplicates";
|
|
124
|
-
import { useOnGoalSeek } from "./use-on-goal-seek";
|
|
125
|
-
import { useOnSubtotal } from "./use-on-subtotal";
|
|
126
|
-
import { useOnAdvancedFilter } from "./use-on-advanced-filter";
|
|
127
127
|
import { useSharedStringRegistry } from "./use-ss-registry";
|
|
128
128
|
import { useStructuredReference } from "./use-structured-reference";
|
|
129
129
|
import { useUndoRedo } from "./use-undo-redo";
|
|
@@ -528,7 +528,7 @@ sanitizeHtml, }) => {
|
|
|
528
528
|
enabled: calculationMode !== "worker",
|
|
529
529
|
});
|
|
530
530
|
// Use the appropriate calculation hook based on mode
|
|
531
|
-
const { enqueueCalculation, enqueueGraphOperation, enqueueStructureChange, clearRangeCache, onRequestCalculate: onRequestCalculateWithoutFormatting, getPrecedents, getDependents, getPrecedentsFromFormulaString, getGraphNodes, getGraphNodesInSheet, addStaticReference, addFormulaToGraph, removeStaticReference, onResetCalculator, getDependencyGraph, updateDependencyGraph, isArrayFormula, applyNamedRanges, } = calculationMode === "worker" ? workerCalculation : singleCalculation;
|
|
531
|
+
const { enqueueCalculation, enqueueGraphOperation, enqueueStructureChange, clearRangeCache, onRequestCalculate: onRequestCalculateWithoutFormatting, getPrecedents, getDependents, getPrecedentsFromFormulaString, getGraphNodes, getGraphNodesInSheet, addStaticReference, addFormulaToGraph, removeStaticReference, onResetCalculator, getDependencyGraph, updateDependencyGraph, isArrayFormula, getArrayRange, applyNamedRanges, } = calculationMode === "worker" ? workerCalculation : singleCalculation;
|
|
532
532
|
// Bind the forward-ref so `useSheetProperties.getEffectiveFormat` can walk
|
|
533
533
|
// precedents now that the calculator is initialised.
|
|
534
534
|
getPrecedentsRef.current = getPrecedents;
|
|
@@ -998,7 +998,16 @@ sanitizeHtml, }) => {
|
|
|
998
998
|
...props,
|
|
999
999
|
customAutofillLists: props.customAutofillLists ?? customAutofillLists,
|
|
1000
1000
|
}), [rawGetAutoFillValues, customAutofillLists]);
|
|
1001
|
-
// Fill
|
|
1001
|
+
// Fill. A merged seed lands one merged block per target block (Excel replicates the merge
|
|
1002
|
+
// shape); the target's own merges give way, and the snapped fill extent stays selected.
|
|
1003
|
+
const onFillMerges = useCallback((sheetId, activeCell, clearRange, fillMerges, selectRange) => {
|
|
1004
|
+
onUnMergeCells(sheetId, activeCell, [{ range: clearRange }]);
|
|
1005
|
+
if (fillMerges.length) {
|
|
1006
|
+
onMergeCells(sheetId, activeCell, fillMerges.map((range) => ({ range })));
|
|
1007
|
+
}
|
|
1008
|
+
// `onMergeCells` clears the selection; the filled range stays selected like Excel.
|
|
1009
|
+
onChangeSelections?.(sheetId, [{ range: selectRange }]);
|
|
1010
|
+
}, [onUnMergeCells, onMergeCells, onChangeSelections]);
|
|
1002
1011
|
const onFill = useOnFill({
|
|
1003
1012
|
locale,
|
|
1004
1013
|
cellXfsRegistry,
|
|
@@ -1015,6 +1024,8 @@ sanitizeHtml, }) => {
|
|
|
1015
1024
|
onChangeDataValidations,
|
|
1016
1025
|
createHistory,
|
|
1017
1026
|
onCommand,
|
|
1027
|
+
getMerges: getPaintMerges,
|
|
1028
|
+
onFillMerges,
|
|
1018
1029
|
});
|
|
1019
1030
|
// Delete row
|
|
1020
1031
|
const onDeleteRow = useOnDeleteRow({
|
|
@@ -1041,8 +1052,14 @@ sanitizeHtml, }) => {
|
|
|
1041
1052
|
onChangeDataValidations,
|
|
1042
1053
|
onChangeCitations,
|
|
1043
1054
|
onChangePivotTables,
|
|
1055
|
+
onChangeNamedRanges,
|
|
1056
|
+
onChangeEmbeds,
|
|
1057
|
+
onChangeCharts,
|
|
1058
|
+
onChangeProtectedRanges,
|
|
1044
1059
|
getSheetName,
|
|
1045
1060
|
onCommand,
|
|
1061
|
+
tables,
|
|
1062
|
+
getArrayRange,
|
|
1046
1063
|
});
|
|
1047
1064
|
// Delete row
|
|
1048
1065
|
const onDeleteColumn = useOnDeleteColumn({
|
|
@@ -1069,8 +1086,14 @@ sanitizeHtml, }) => {
|
|
|
1069
1086
|
onChangeDataValidations,
|
|
1070
1087
|
onChangeCitations,
|
|
1071
1088
|
onChangePivotTables,
|
|
1089
|
+
onChangeNamedRanges,
|
|
1090
|
+
onChangeEmbeds,
|
|
1091
|
+
onChangeCharts,
|
|
1092
|
+
onChangeProtectedRanges,
|
|
1072
1093
|
getSheetName,
|
|
1073
1094
|
onCommand,
|
|
1095
|
+
tables,
|
|
1096
|
+
getArrayRange,
|
|
1074
1097
|
});
|
|
1075
1098
|
// Delete cells shift up
|
|
1076
1099
|
const onDeleteCellsShiftUp = useOnDeleteCellsShiftUp({
|
|
@@ -1082,13 +1105,19 @@ sanitizeHtml, }) => {
|
|
|
1082
1105
|
getActiveCell,
|
|
1083
1106
|
getSelections,
|
|
1084
1107
|
getDependents,
|
|
1108
|
+
getSheetName,
|
|
1085
1109
|
enqueueGraphOperation,
|
|
1086
1110
|
enqueueCalculation,
|
|
1087
1111
|
enqueueStructureChange,
|
|
1088
1112
|
createHistory,
|
|
1089
1113
|
onChangeSheets,
|
|
1090
1114
|
onChangeSheetData,
|
|
1115
|
+
onChangeTables,
|
|
1116
|
+
onChangeCitations,
|
|
1091
1117
|
onCommand,
|
|
1118
|
+
sheetData,
|
|
1119
|
+
sheets,
|
|
1120
|
+
tables,
|
|
1092
1121
|
});
|
|
1093
1122
|
// Delete cells shift left
|
|
1094
1123
|
const onDeleteCellsShiftLeft = useOnDeleteCellsShiftLeft({
|
|
@@ -1100,13 +1129,19 @@ sanitizeHtml, }) => {
|
|
|
1100
1129
|
getActiveCell,
|
|
1101
1130
|
getSelections,
|
|
1102
1131
|
getDependents,
|
|
1132
|
+
getSheetName,
|
|
1103
1133
|
enqueueGraphOperation,
|
|
1104
1134
|
enqueueCalculation,
|
|
1105
1135
|
enqueueStructureChange,
|
|
1106
1136
|
createHistory,
|
|
1107
1137
|
onChangeSheets,
|
|
1108
1138
|
onChangeSheetData,
|
|
1139
|
+
onChangeTables,
|
|
1140
|
+
onChangeCitations,
|
|
1109
1141
|
onCommand,
|
|
1142
|
+
sheetData,
|
|
1143
|
+
sheets,
|
|
1144
|
+
tables,
|
|
1110
1145
|
});
|
|
1111
1146
|
// Insert cells shift right
|
|
1112
1147
|
const onInsertCellsShiftRight = useOnInsertCellsShiftRight({
|
|
@@ -1118,13 +1153,19 @@ sanitizeHtml, }) => {
|
|
|
1118
1153
|
getActiveCell,
|
|
1119
1154
|
getSelections,
|
|
1120
1155
|
getDependents,
|
|
1156
|
+
getSheetName,
|
|
1121
1157
|
enqueueGraphOperation,
|
|
1122
1158
|
enqueueCalculation,
|
|
1123
1159
|
enqueueStructureChange,
|
|
1124
1160
|
createHistory,
|
|
1125
1161
|
onChangeSheets,
|
|
1126
1162
|
onChangeSheetData,
|
|
1163
|
+
onChangeTables,
|
|
1164
|
+
onChangeCitations,
|
|
1127
1165
|
onCommand,
|
|
1166
|
+
sheetData,
|
|
1167
|
+
sheets,
|
|
1168
|
+
tables,
|
|
1128
1169
|
});
|
|
1129
1170
|
// Delete cells shift up
|
|
1130
1171
|
const onInsertCellsShiftDown = useOnInsertCellsShiftDown({
|
|
@@ -1136,13 +1177,19 @@ sanitizeHtml, }) => {
|
|
|
1136
1177
|
getActiveCell,
|
|
1137
1178
|
getSelections,
|
|
1138
1179
|
getDependents,
|
|
1180
|
+
getSheetName,
|
|
1139
1181
|
enqueueGraphOperation,
|
|
1140
1182
|
enqueueCalculation,
|
|
1141
1183
|
enqueueStructureChange,
|
|
1142
1184
|
createHistory,
|
|
1143
1185
|
onChangeSheets,
|
|
1144
1186
|
onChangeSheetData,
|
|
1187
|
+
onChangeTables,
|
|
1188
|
+
onChangeCitations,
|
|
1145
1189
|
onCommand,
|
|
1190
|
+
sheetData,
|
|
1191
|
+
sheets,
|
|
1192
|
+
tables,
|
|
1146
1193
|
});
|
|
1147
1194
|
// Insert row
|
|
1148
1195
|
const onInsertRow = useOnInsertRow({
|
|
@@ -1150,6 +1197,7 @@ sanitizeHtml, }) => {
|
|
|
1150
1197
|
columnCount,
|
|
1151
1198
|
locale,
|
|
1152
1199
|
maxRowCount,
|
|
1200
|
+
sheetData,
|
|
1153
1201
|
cellXfsRegistry,
|
|
1154
1202
|
getActiveCell,
|
|
1155
1203
|
getSelections,
|
|
@@ -1166,6 +1214,10 @@ sanitizeHtml, }) => {
|
|
|
1166
1214
|
onChangeDataValidations,
|
|
1167
1215
|
onChangeCitations,
|
|
1168
1216
|
onChangePivotTables,
|
|
1217
|
+
onChangeNamedRanges,
|
|
1218
|
+
onChangeEmbeds,
|
|
1219
|
+
onChangeCharts,
|
|
1220
|
+
onChangeProtectedRanges,
|
|
1169
1221
|
onChangeTables,
|
|
1170
1222
|
getSheetName,
|
|
1171
1223
|
onCommand,
|
|
@@ -1177,6 +1229,7 @@ sanitizeHtml, }) => {
|
|
|
1177
1229
|
locale,
|
|
1178
1230
|
tables,
|
|
1179
1231
|
maxColumnCount,
|
|
1232
|
+
sheetData,
|
|
1180
1233
|
cellXfsRegistry,
|
|
1181
1234
|
sharedStringRegistry,
|
|
1182
1235
|
getDependents,
|
|
@@ -1193,6 +1246,10 @@ sanitizeHtml, }) => {
|
|
|
1193
1246
|
onChangeDataValidations,
|
|
1194
1247
|
onChangeCitations,
|
|
1195
1248
|
onChangePivotTables,
|
|
1249
|
+
onChangeNamedRanges,
|
|
1250
|
+
onChangeEmbeds,
|
|
1251
|
+
onChangeCharts,
|
|
1252
|
+
onChangeProtectedRanges,
|
|
1196
1253
|
getActiveCell,
|
|
1197
1254
|
getSelections,
|
|
1198
1255
|
getSheetName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-structured-reference.d.ts","sourceRoot":"","sources":["../../../hooks/use-structured-reference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAG/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAK3D,eAAO,MAAM,sBAAsB,GAAI,oCAIpC;IACD,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;CACvC,iBAGgB,MAAM,GAAG,SAAS,eAChB,MAAM,EAAE,GAAG,SAAS,WACxB,OAAO,eACH,MAAM,GAAG,SAAS,aACpB,MAAM,QACX,UAAU,KACf,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"use-structured-reference.d.ts","sourceRoot":"","sources":["../../../hooks/use-structured-reference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAG/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAK3D,eAAO,MAAM,sBAAsB,GAAI,oCAIpC;IACD,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;CACvC,iBAGgB,MAAM,GAAG,SAAS,eAChB,MAAM,EAAE,GAAG,SAAS,WACxB,OAAO,eACH,MAAM,GAAG,SAAS,aACpB,MAAM,QACX,UAAU,KACf,SAAS,GAAG,UA0JlB,CAAC"}
|
|
@@ -15,8 +15,10 @@ export const useStructuredReference = ({ tables, sheetId, getSheetName, }) => {
|
|
|
15
15
|
});
|
|
16
16
|
// Current row
|
|
17
17
|
const { row: rowIndex } = cell;
|
|
18
|
+
// Excel: a structured reference whose table no longer exists (the table
|
|
19
|
+
// was deleted, or every one of its rows) is `#REF!`, never `#NAME?`.
|
|
18
20
|
if (!table) {
|
|
19
|
-
throw new FormulaError("#
|
|
21
|
+
throw new FormulaError("#REF!", "Table could not be found");
|
|
20
22
|
}
|
|
21
23
|
// Special this row item
|
|
22
24
|
if (specialItem === "#This Row") {
|
|
@@ -30,12 +32,14 @@ export const useStructuredReference = ({ tables, sheetId, getSheetName, }) => {
|
|
|
30
32
|
const [from, to] = columnNames ?? [];
|
|
31
33
|
const startColIndex = getColumnIndexFromColumnName(table, from);
|
|
32
34
|
const endColIndex = getColumnIndexFromColumnName(table, to);
|
|
33
|
-
// Exit early, if column could not be found
|
|
35
|
+
// Exit early, if column could not be found. Excel: a reference to a
|
|
36
|
+
// column the table does not have — including the `#REF!` specifier a
|
|
37
|
+
// column delete writes (`Table1[@#REF!]`) — is `#REF!`.
|
|
34
38
|
if (!isNil(to) && isNil(endColIndex)) {
|
|
35
|
-
throw new FormulaError("#
|
|
39
|
+
throw new FormulaError("#REF!", `Column not found ${to}`);
|
|
36
40
|
}
|
|
37
41
|
if (!isNil(from) && isNil(startColIndex)) {
|
|
38
|
-
throw new FormulaError("#
|
|
42
|
+
throw new FormulaError("#REF!", `Column not found ${from}`);
|
|
39
43
|
}
|
|
40
44
|
const startColumnIndex = isNil(startColIndex)
|
|
41
45
|
? range.startColumnIndex
|
|
@@ -92,10 +96,10 @@ export const useStructuredReference = ({ tables, sheetId, getSheetName, }) => {
|
|
|
92
96
|
}
|
|
93
97
|
// If column is not found, lets not select anything
|
|
94
98
|
if (from && isNil(startColIndex)) {
|
|
95
|
-
throw new FormulaError("#
|
|
99
|
+
throw new FormulaError("#REF!", `Column: ${from} could not be found`);
|
|
96
100
|
}
|
|
97
101
|
if (to && isNil(endColIndex)) {
|
|
98
|
-
throw new FormulaError("#
|
|
102
|
+
throw new FormulaError("#REF!", `Column: ${to} could not be found`);
|
|
99
103
|
}
|
|
100
104
|
// Check if thisrow is active and current cell is in bounds
|
|
101
105
|
if (thisRow &&
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -20,8 +20,11 @@ export * from "./helpers";
|
|
|
20
20
|
export * from "./api/fill";
|
|
21
21
|
export * from "./api/immer-utils";
|
|
22
22
|
export * from "./api/range";
|
|
23
|
+
export * from "./api/anchored-objects";
|
|
23
24
|
export * from "./atoms";
|
|
24
25
|
export * from "./api/formula";
|
|
26
|
+
export * from "./api/structural-guards";
|
|
27
|
+
export * from "./constants";
|
|
25
28
|
export * from "./types";
|
|
26
29
|
export * from "./commands";
|
|
27
30
|
export type { ClearType } from "./interface/delete-cells";
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,WAAW,EACX,SAAS,EACT,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,4BAA4B,EAC5B,yBAAyB,EACzB,sBAAsB,EACtB,0BAA0B,EAC1B,KAAK,2BAA2B,GACjC,MAAM,qBAAqB,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,4BAA4B,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAE1D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAG7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,WAAW,EACX,SAAS,EACT,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,4BAA4B,EAC5B,yBAAyB,EACzB,sBAAsB,EACtB,0BAA0B,EAC1B,KAAK,2BAA2B,GACjC,MAAM,qBAAqB,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,4BAA4B,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAE1D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAG7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -20,8 +20,11 @@ export * from "./helpers";
|
|
|
20
20
|
export * from "./api/fill";
|
|
21
21
|
export * from "./api/immer-utils";
|
|
22
22
|
export * from "./api/range";
|
|
23
|
+
export * from "./api/anchored-objects";
|
|
23
24
|
export * from "./atoms";
|
|
24
25
|
export * from "./api/formula";
|
|
26
|
+
export * from "./api/structural-guards";
|
|
27
|
+
export * from "./constants";
|
|
25
28
|
export * from "./types";
|
|
26
29
|
export * from "./commands";
|
|
27
30
|
// Register
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CellInterface, SelectionArea } from "@rowsncolumns/common-types";
|
|
2
|
-
import type { CellData, SelectionAttributes, Sheet } from "@rowsncolumns/spreadsheet";
|
|
3
|
-
import type
|
|
2
|
+
import type { CellData, FillOptions, SelectionAttributes, Sheet } from "@rowsncolumns/spreadsheet";
|
|
3
|
+
import { type AutoFillType } from "../api/fill";
|
|
4
4
|
import type { UseOnFillProps } from "../hooks/use-on-fill";
|
|
5
|
-
export declare const applyFill: <T extends CellData, S extends Sheet>({ locale, cellXfsRegistry, sharedStringRegistry, getDataValidationById, getCellData, getEffectiveValue, getFormattedValue, getAutoFillValues, getSheetName, enqueueCalculation, enqueueStructureChange, onChangeSheetData, createHistory, onChangeDataValidations, }: UseOnFillProps<T, S>) => (sheetId: number, activeCell: CellInterface, fillSelection: SelectionArea, selections: SelectionArea<SelectionAttributes>[], fillableSelections?: SelectionArea<SelectionAttributes>[], fillType?: AutoFillType) => Promise<void>;
|
|
5
|
+
export declare const applyFill: <T extends CellData, S extends Sheet>({ locale, cellXfsRegistry, sharedStringRegistry, getDataValidationById, getCellData, getEffectiveValue, getFormattedValue, getAutoFillValues, getSheetName, enqueueCalculation, enqueueStructureChange, onChangeSheetData, createHistory, onChangeDataValidations, getMerges, onFillMerges, }: UseOnFillProps<T, S>) => (sheetId: number, activeCell: CellInterface, fillSelection: SelectionArea, selections: SelectionArea<SelectionAttributes>[], fillableSelections?: SelectionArea<SelectionAttributes>[], fillType?: AutoFillType, options?: FillOptions) => Promise<void>;
|
|
6
6
|
//# sourceMappingURL=apply-fill.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-fill.d.ts","sourceRoot":"","sources":["../../../interface/apply-fill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"apply-fill.d.ts","sourceRoot":"","sources":["../../../interface/apply-fill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEb,aAAa,EACd,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,KAAK,EACN,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,aAAa,CAAC;AAGhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAW3D,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,KAAK,EAAE,+RAiB5D,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,MAGnB,SAAS,MAAM,EAEf,YAAY,aAAa,EAEzB,eAAe,aAAa,EAE5B,YAAY,aAAa,CAAC,mBAAmB,CAAC,EAAE,EAChD,qBAAqB,aAAa,CAAC,mBAAmB,CAAC,EAAE,EAEzD,WAAW,YAAY,EAEvB,UAAU,WAAW,kBA+SxB,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Direction } from "@rowsncolumns/common-types";
|
|
2
2
|
import { selectionFromActiveCell } from "@rowsncolumns/utils";
|
|
3
3
|
import { produceWithPatches } from "immer";
|
|
4
|
+
import { FILL_UNTOUCHED } from "../api/fill";
|
|
4
5
|
import { createSheetCellIdentifier } from "../api/formula";
|
|
5
6
|
import { createSheetDraft } from "../api/immer-utils";
|
|
6
7
|
import { defaultCellCoords, defaultSheetId, SheetCell } from "../sheet-cell";
|
|
7
8
|
import { getFillDirection } from "./../api/selection";
|
|
8
9
|
import { collectDataValidationTarget, extendDataValidationRanges, } from "./data-validation-utils";
|
|
9
|
-
export const applyFill = ({ locale, cellXfsRegistry, sharedStringRegistry, getDataValidationById, getCellData, getEffectiveValue, getFormattedValue, getAutoFillValues, getSheetName, enqueueCalculation, enqueueStructureChange, onChangeSheetData, createHistory, onChangeDataValidations, }) => {
|
|
10
|
+
export const applyFill = ({ locale, cellXfsRegistry, sharedStringRegistry, getDataValidationById, getCellData, getEffectiveValue, getFormattedValue, getAutoFillValues, getSheetName, enqueueCalculation, enqueueStructureChange, onChangeSheetData, createHistory, onChangeDataValidations, getMerges, onFillMerges, }) => {
|
|
10
11
|
return async (
|
|
11
12
|
// Active sheet ID
|
|
12
13
|
sheetId,
|
|
@@ -17,7 +18,9 @@ export const applyFill = ({ locale, cellXfsRegistry, sharedStringRegistry, getDa
|
|
|
17
18
|
// Current selections of the user
|
|
18
19
|
selections, fillableSelections,
|
|
19
20
|
// Fill type - if not specified, will auto-detect
|
|
20
|
-
fillType
|
|
21
|
+
fillType,
|
|
22
|
+
// Ctrl/Cmd toggle held on the fill handle and/or Series-dialog parameters
|
|
23
|
+
options) => {
|
|
21
24
|
const finalSelections = selections.length
|
|
22
25
|
? selections
|
|
23
26
|
: selectionFromActiveCell(activeCell);
|
|
@@ -41,12 +44,47 @@ export const applyFill = ({ locale, cellXfsRegistry, sharedStringRegistry, getDa
|
|
|
41
44
|
locale,
|
|
42
45
|
cellXfsRegistry,
|
|
43
46
|
getDataValidationById,
|
|
44
|
-
|
|
47
|
+
merges: getMerges?.(sheetId),
|
|
48
|
+
fillType: fillType ?? options?.fillType,
|
|
49
|
+
modifier: options?.modifier,
|
|
50
|
+
series: options?.series,
|
|
45
51
|
});
|
|
52
|
+
// A merged seed snaps the fill extent to whole blocks — that is the area written (and the
|
|
53
|
+
// selection left behind); the drag's raw extent only feeds the cache invalidation below.
|
|
54
|
+
const targetBounds = fillValues.snappedFillBounds ?? fillBounds;
|
|
55
|
+
const filledArea = direction === Direction.Down
|
|
56
|
+
? {
|
|
57
|
+
startRowIndex: selection.range.endRowIndex + 1,
|
|
58
|
+
endRowIndex: targetBounds.endRowIndex,
|
|
59
|
+
startColumnIndex: selection.range.startColumnIndex,
|
|
60
|
+
endColumnIndex: selection.range.endColumnIndex,
|
|
61
|
+
}
|
|
62
|
+
: direction === Direction.Up
|
|
63
|
+
? {
|
|
64
|
+
startRowIndex: targetBounds.startRowIndex,
|
|
65
|
+
endRowIndex: selection.range.startRowIndex - 1,
|
|
66
|
+
startColumnIndex: selection.range.startColumnIndex,
|
|
67
|
+
endColumnIndex: selection.range.endColumnIndex,
|
|
68
|
+
}
|
|
69
|
+
: direction === Direction.Right
|
|
70
|
+
? {
|
|
71
|
+
startRowIndex: selection.range.startRowIndex,
|
|
72
|
+
endRowIndex: selection.range.endRowIndex,
|
|
73
|
+
startColumnIndex: selection.range.endColumnIndex + 1,
|
|
74
|
+
endColumnIndex: targetBounds.endColumnIndex,
|
|
75
|
+
}
|
|
76
|
+
: {
|
|
77
|
+
startRowIndex: selection.range.startRowIndex,
|
|
78
|
+
endRowIndex: selection.range.endRowIndex,
|
|
79
|
+
startColumnIndex: targetBounds.startColumnIndex,
|
|
80
|
+
endColumnIndex: selection.range.startColumnIndex - 1,
|
|
81
|
+
};
|
|
46
82
|
// Sample cell
|
|
47
83
|
const sheetCell = new SheetCell(defaultSheetId, defaultCellCoords, undefined, { locale, cellXfsRegistry, getDataValidationById });
|
|
48
84
|
const getFillValue = (rowIndex, columnIndex) => {
|
|
49
|
-
const fillValue = fillValues[rowIndex][columnIndex];
|
|
85
|
+
const fillValue = fillValues[rowIndex]?.[columnIndex];
|
|
86
|
+
if (fillValue === FILL_UNTOUCHED)
|
|
87
|
+
return FILL_UNTOUCHED;
|
|
50
88
|
if (typeof fillValue !== "object") {
|
|
51
89
|
sheetCell.setUserEnteredValue(fillValue);
|
|
52
90
|
sharedStringRegistry?.registerCell(sheetCell);
|
|
@@ -55,6 +93,37 @@ export const applyFill = ({ locale, cellXfsRegistry, sharedStringRegistry, getDa
|
|
|
55
93
|
}
|
|
56
94
|
return fillValue;
|
|
57
95
|
};
|
|
96
|
+
/**
|
|
97
|
+
* Write one cell of the fill into the draft and register it for validation, recalculation and
|
|
98
|
+
* history — the single write path for filled targets and rewritten seeds.
|
|
99
|
+
*/
|
|
100
|
+
const writeCell = (draft, rowIndex, columnIndex, cellData) => {
|
|
101
|
+
const newSheet = createSheetDraft(draft, sheetId, rowIndex);
|
|
102
|
+
newSheet[rowIndex].values[columnIndex] = cellData;
|
|
103
|
+
collectDataValidationTarget(dataValidationTargets, sheetId, rowIndex, columnIndex, cellData);
|
|
104
|
+
enqueueCalculation({
|
|
105
|
+
position: { rowIndex, columnIndex, sheetId },
|
|
106
|
+
type: "add",
|
|
107
|
+
force: true,
|
|
108
|
+
});
|
|
109
|
+
recalcCells.set(createSheetCellIdentifier(sheetId, rowIndex, columnIndex), {
|
|
110
|
+
rowIndex,
|
|
111
|
+
columnIndex,
|
|
112
|
+
sheetId,
|
|
113
|
+
force: true,
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Write the fill value at `[rollingRowIndex][rollingColumnIndex]` into the target cell. A
|
|
118
|
+
* Series-dialog `stop` reached before the selection's end marks the target untouched — Excel
|
|
119
|
+
* writes nothing there, so neither do we.
|
|
120
|
+
*/
|
|
121
|
+
const writeFilledCell = (draft, rowIndex, columnIndex, rollingRowIndex, rollingColumnIndex) => {
|
|
122
|
+
const cellData = getFillValue(rollingRowIndex, rollingColumnIndex);
|
|
123
|
+
if (cellData === FILL_UNTOUCHED)
|
|
124
|
+
return;
|
|
125
|
+
writeCell(draft, rowIndex, columnIndex, cellData);
|
|
126
|
+
};
|
|
58
127
|
// Fill writes through `onChangeSheetData` directly. The calculator
|
|
59
128
|
// only invalidates `rangeCache` for cells it recomputes, so the
|
|
60
129
|
// freshly-filled positions stay cached until we tell it otherwise.
|
|
@@ -74,7 +143,7 @@ export const applyFill = ({ locale, cellXfsRegistry, sharedStringRegistry, getDa
|
|
|
74
143
|
switch (direction) {
|
|
75
144
|
case Direction.Down: {
|
|
76
145
|
const start = selection.range.endRowIndex + 1;
|
|
77
|
-
const end =
|
|
146
|
+
const end = targetBounds.endRowIndex;
|
|
78
147
|
let counter = 0;
|
|
79
148
|
for (let i = start; i <= end; i++) {
|
|
80
149
|
let rowIndex = selection.range.startRowIndex + counter;
|
|
@@ -85,16 +154,7 @@ export const applyFill = ({ locale, cellXfsRegistry, sharedStringRegistry, getDa
|
|
|
85
154
|
const rollingRowIndex = i - start;
|
|
86
155
|
for (let columnIndex = selection.range.startColumnIndex; columnIndex <= selection.range.endColumnIndex; columnIndex++) {
|
|
87
156
|
const rollingColumnIndex = columnIndex - selection.range.startColumnIndex;
|
|
88
|
-
|
|
89
|
-
const newCellData = getFillValue(rollingRowIndex, rollingColumnIndex);
|
|
90
|
-
newSheet[i].values[columnIndex] = newCellData;
|
|
91
|
-
collectDataValidationTarget(dataValidationTargets, sheetId, i, columnIndex, newCellData);
|
|
92
|
-
enqueueCalculation({
|
|
93
|
-
position: { rowIndex: i, columnIndex, sheetId },
|
|
94
|
-
type: "add",
|
|
95
|
-
force: true,
|
|
96
|
-
});
|
|
97
|
-
recalcCells.set(createSheetCellIdentifier(sheetId, i, columnIndex), { rowIndex: i, columnIndex, sheetId, force: true });
|
|
157
|
+
writeFilledCell(draft, i, columnIndex, rollingRowIndex, rollingColumnIndex);
|
|
98
158
|
}
|
|
99
159
|
counter++;
|
|
100
160
|
}
|
|
@@ -102,20 +162,12 @@ export const applyFill = ({ locale, cellXfsRegistry, sharedStringRegistry, getDa
|
|
|
102
162
|
}
|
|
103
163
|
case Direction.Up: {
|
|
104
164
|
const start = selection.range.startRowIndex - 1;
|
|
105
|
-
const end =
|
|
165
|
+
const end = targetBounds.startRowIndex;
|
|
106
166
|
for (let i = start; i >= end; i--) {
|
|
107
|
-
const rollingRowIndex = i -
|
|
167
|
+
const rollingRowIndex = i - targetBounds.startRowIndex;
|
|
108
168
|
for (let columnIndex = selection.range.startColumnIndex; columnIndex <= selection.range.endColumnIndex; columnIndex++) {
|
|
109
169
|
const rollingColumnIndex = columnIndex - selection.range.startColumnIndex;
|
|
110
|
-
|
|
111
|
-
newSheet[i].values[columnIndex] = getFillValue(rollingRowIndex, rollingColumnIndex);
|
|
112
|
-
collectDataValidationTarget(dataValidationTargets, sheetId, i, columnIndex, newSheet[i].values[columnIndex]);
|
|
113
|
-
enqueueCalculation({
|
|
114
|
-
position: { rowIndex: i, columnIndex, sheetId },
|
|
115
|
-
type: "add",
|
|
116
|
-
force: true,
|
|
117
|
-
});
|
|
118
|
-
recalcCells.set(createSheetCellIdentifier(sheetId, i, columnIndex), { rowIndex: i, columnIndex, sheetId, force: true });
|
|
170
|
+
writeFilledCell(draft, i, columnIndex, rollingRowIndex, rollingColumnIndex);
|
|
119
171
|
}
|
|
120
172
|
}
|
|
121
173
|
break;
|
|
@@ -123,7 +175,7 @@ export const applyFill = ({ locale, cellXfsRegistry, sharedStringRegistry, getDa
|
|
|
123
175
|
case Direction.Right: {
|
|
124
176
|
for (let rowIndex = selection.range.startRowIndex; rowIndex <= selection.range.endRowIndex; rowIndex++) {
|
|
125
177
|
const start = selection.range.endColumnIndex + 1;
|
|
126
|
-
const end =
|
|
178
|
+
const end = targetBounds.endColumnIndex;
|
|
127
179
|
let counter = 0;
|
|
128
180
|
const rollingRowIndex = rowIndex - selection.range.startRowIndex;
|
|
129
181
|
for (let j = start; j <= end; j++) {
|
|
@@ -133,15 +185,7 @@ export const applyFill = ({ locale, cellXfsRegistry, sharedStringRegistry, getDa
|
|
|
133
185
|
columnIndex = selection.range.startColumnIndex;
|
|
134
186
|
}
|
|
135
187
|
const rollingColumnIndex = j - start;
|
|
136
|
-
|
|
137
|
-
newSheet[rowIndex].values[j] = getFillValue(rollingRowIndex, rollingColumnIndex);
|
|
138
|
-
collectDataValidationTarget(dataValidationTargets, sheetId, rowIndex, j, newSheet[rowIndex].values[j]);
|
|
139
|
-
enqueueCalculation({
|
|
140
|
-
position: { rowIndex, columnIndex: j, sheetId },
|
|
141
|
-
type: "add",
|
|
142
|
-
force: true,
|
|
143
|
-
});
|
|
144
|
-
recalcCells.set(createSheetCellIdentifier(sheetId, rowIndex, j), { rowIndex, columnIndex: j, sheetId, force: true });
|
|
188
|
+
writeFilledCell(draft, rowIndex, j, rollingRowIndex, rollingColumnIndex);
|
|
145
189
|
counter++;
|
|
146
190
|
}
|
|
147
191
|
}
|
|
@@ -150,7 +194,7 @@ export const applyFill = ({ locale, cellXfsRegistry, sharedStringRegistry, getDa
|
|
|
150
194
|
case Direction.Left: {
|
|
151
195
|
for (let rowIndex = selection.range.startRowIndex; rowIndex <= selection.range.endRowIndex; rowIndex++) {
|
|
152
196
|
const start = selection.range.startColumnIndex - 1;
|
|
153
|
-
const end =
|
|
197
|
+
const end = targetBounds.startColumnIndex;
|
|
154
198
|
const rollingRowIndex = rowIndex - selection.range.startRowIndex;
|
|
155
199
|
let counter = 0;
|
|
156
200
|
for (let j = start; j >= end; j--) {
|
|
@@ -159,22 +203,18 @@ export const applyFill = ({ locale, cellXfsRegistry, sharedStringRegistry, getDa
|
|
|
159
203
|
counter = 0;
|
|
160
204
|
columnIndex = selection.range.endColumnIndex;
|
|
161
205
|
}
|
|
162
|
-
const rollingColumnIndex = j -
|
|
163
|
-
|
|
164
|
-
newSheet[rowIndex].values[j] = getFillValue(rollingRowIndex, rollingColumnIndex);
|
|
165
|
-
collectDataValidationTarget(dataValidationTargets, sheetId, rowIndex, j, newSheet[rowIndex].values[j]);
|
|
166
|
-
enqueueCalculation({
|
|
167
|
-
position: { rowIndex, columnIndex: j, sheetId },
|
|
168
|
-
type: "add",
|
|
169
|
-
force: true,
|
|
170
|
-
});
|
|
171
|
-
recalcCells.set(createSheetCellIdentifier(sheetId, rowIndex, j), { rowIndex, columnIndex: j, sheetId, force: true });
|
|
206
|
+
const rollingColumnIndex = j - targetBounds.startColumnIndex;
|
|
207
|
+
writeFilledCell(draft, rowIndex, j, rollingRowIndex, rollingColumnIndex);
|
|
172
208
|
counter--;
|
|
173
209
|
}
|
|
174
210
|
}
|
|
175
211
|
break;
|
|
176
212
|
}
|
|
177
213
|
}
|
|
214
|
+
// Series-dialog Trend: the seed cells Excel replaces with the fitted values.
|
|
215
|
+
for (const seed of fillValues.seedCells ?? []) {
|
|
216
|
+
writeCell(draft, seed.rowIndex, seed.columnIndex, seed.cell);
|
|
217
|
+
}
|
|
178
218
|
});
|
|
179
219
|
// Save history
|
|
180
220
|
saveHistory({
|
|
@@ -184,12 +224,17 @@ export const applyFill = ({ locale, cellXfsRegistry, sharedStringRegistry, getDa
|
|
|
184
224
|
activeCell: { undo: activeCell, redo: activeCell },
|
|
185
225
|
selections: {
|
|
186
226
|
undo: fillableSelections ?? selections,
|
|
187
|
-
redo: [fillSelection],
|
|
227
|
+
redo: [{ ...fillSelection, range: targetBounds }],
|
|
188
228
|
},
|
|
189
229
|
});
|
|
190
230
|
extendDataValidationRanges(dataValidationTargets, onChangeDataValidations, saveHistory);
|
|
191
231
|
sharedStringRegistry?.getPatches(saveHistory);
|
|
192
232
|
return nextState;
|
|
193
233
|
});
|
|
234
|
+
// A merged seed replicates its block shape over the filled area (Excel).
|
|
235
|
+
const fillMerges = fillValues.fillMerges;
|
|
236
|
+
if (fillMerges?.length) {
|
|
237
|
+
onFillMerges?.(sheetId, activeCell, filledArea, fillMerges, targetBounds);
|
|
238
|
+
}
|
|
194
239
|
};
|
|
195
240
|
};
|
|
@@ -60,6 +60,15 @@ export declare class CalculationInterface {
|
|
|
60
60
|
private ensureWorkerMetadata;
|
|
61
61
|
private isClientOnlyFormula;
|
|
62
62
|
private executeOperations;
|
|
63
|
+
/**
|
|
64
|
+
* Mirror a dynamic-array anchor's spill rectangle on the local graph (a
|
|
65
|
+
* matrix result registers it, a scalar clears it) so structural edits can
|
|
66
|
+
* find the projected cells of an anchor they delete — the same bookkeeping
|
|
67
|
+
* the React worker hook does in `handleArrayEvaluation`.
|
|
68
|
+
*/
|
|
69
|
+
private trackArrayResult;
|
|
70
|
+
/** The spill rectangle currently anchored at `position`, if it is a dynamic array. */
|
|
71
|
+
getArrayRange(position: CellCoordinate): CellCoordinateRange | undefined;
|
|
63
72
|
private createDefaultWorker;
|
|
64
73
|
private ensureWorker;
|
|
65
74
|
}
|