handsontable 0.0.0-next-ff10728-20250410 → 0.0.0-next-d9b3885-20250415

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.

Potentially problematic release.


This version of handsontable might be problematic. Click here for more details.

Files changed (122) hide show
  1. package/3rdparty/walkontable/src/cell/range.js +14 -0
  2. package/3rdparty/walkontable/src/cell/range.mjs +14 -0
  3. package/3rdparty/walkontable/src/renderer/rowHeaders.js +4 -1
  4. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +4 -1
  5. package/3rdparty/walkontable/src/selection/border/border.js +5 -0
  6. package/3rdparty/walkontable/src/selection/border/border.mjs +5 -0
  7. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +3 -4
  8. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +3 -4
  9. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +8 -10
  10. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +8 -10
  11. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +3 -4
  12. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +3 -4
  13. package/3rdparty/walkontable/src/table.js +5 -2
  14. package/3rdparty/walkontable/src/table.mjs +5 -2
  15. package/CHANGELOG.md +39 -0
  16. package/base.js +2 -2
  17. package/base.mjs +2 -2
  18. package/core/focusCatcher/focusDetector.js +1 -1
  19. package/core/focusCatcher/focusDetector.mjs +2 -2
  20. package/core/hooks/constants.js +266 -0
  21. package/core/hooks/constants.mjs +266 -0
  22. package/core/hooks/index.d.ts +1 -0
  23. package/core.d.ts +0 -1
  24. package/core.js +71 -25
  25. package/core.mjs +72 -26
  26. package/dataMap/dataMap.js +0 -7
  27. package/dataMap/dataMap.mjs +0 -7
  28. package/dataMap/metaManager/metaSchema.js +28 -0
  29. package/dataMap/metaManager/metaSchema.mjs +28 -0
  30. package/dist/handsontable.css +3 -3
  31. package/dist/handsontable.full.css +3 -3
  32. package/dist/handsontable.full.js +1375 -350
  33. package/dist/handsontable.full.min.css +3 -3
  34. package/dist/handsontable.full.min.js +17 -17
  35. package/dist/handsontable.js +1375 -350
  36. package/dist/handsontable.min.css +3 -3
  37. package/dist/handsontable.min.js +18 -18
  38. package/editorManager.js +1 -7
  39. package/editorManager.mjs +1 -7
  40. package/editors/autocompleteEditor/autocompleteEditor.js +14 -4
  41. package/editors/autocompleteEditor/autocompleteEditor.mjs +14 -4
  42. package/editors/textEditor/textEditor.js +1 -1
  43. package/editors/textEditor/textEditor.mjs +2 -2
  44. package/helpers/browser.js +1 -1
  45. package/helpers/browser.mjs +1 -1
  46. package/helpers/dom/element.js +2 -2
  47. package/helpers/dom/element.mjs +1 -1
  48. package/helpers/mixed.js +2 -2
  49. package/helpers/mixed.mjs +2 -2
  50. package/helpers/object.js +3 -0
  51. package/helpers/object.mjs +3 -0
  52. package/package.json +1 -1
  53. package/plugins/autoColumnSize/autoColumnSize.js +48 -1
  54. package/plugins/autoColumnSize/autoColumnSize.mjs +48 -1
  55. package/plugins/autoRowSize/autoRowSize.js +46 -6
  56. package/plugins/autoRowSize/autoRowSize.mjs +46 -6
  57. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +13 -0
  58. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +13 -0
  59. package/plugins/collapsibleColumns/collapsibleColumns.js +31 -0
  60. package/plugins/collapsibleColumns/collapsibleColumns.mjs +31 -0
  61. package/plugins/columnSorting/columnSorting.js +0 -4
  62. package/plugins/columnSorting/columnSorting.mjs +0 -4
  63. package/plugins/columnSummary/columnSummary.js +33 -0
  64. package/plugins/columnSummary/columnSummary.mjs +33 -0
  65. package/plugins/comments/comments.js +54 -0
  66. package/plugins/comments/comments.mjs +54 -0
  67. package/plugins/contextMenu/menu/defaultShortcutsList.js +2 -2
  68. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +2 -2
  69. package/plugins/contextMenu/menu/menu.js +1 -0
  70. package/plugins/contextMenu/menu/menu.mjs +1 -0
  71. package/plugins/contextMenu/menu/positioner.js +10 -2
  72. package/plugins/contextMenu/menu/positioner.mjs +10 -2
  73. package/plugins/copyPaste/copyPaste.js +12 -15
  74. package/plugins/copyPaste/copyPaste.mjs +13 -16
  75. package/plugins/copyPaste/pasteEvent.js +3 -0
  76. package/plugins/copyPaste/pasteEvent.mjs +3 -0
  77. package/plugins/dropdownMenu/dropdownMenu.js +15 -0
  78. package/plugins/dropdownMenu/dropdownMenu.mjs +15 -0
  79. package/plugins/exportFile/exportFile.js +58 -0
  80. package/plugins/exportFile/exportFile.mjs +58 -0
  81. package/plugins/filters/filters.js +99 -24
  82. package/plugins/filters/filters.mjs +99 -24
  83. package/plugins/filters/ui/multipleSelect.js +7 -1
  84. package/plugins/filters/ui/multipleSelect.mjs +7 -1
  85. package/plugins/hiddenColumns/hiddenColumns.js +65 -1
  86. package/plugins/hiddenColumns/hiddenColumns.mjs +65 -1
  87. package/plugins/hiddenRows/hiddenRows.js +65 -1
  88. package/plugins/hiddenRows/hiddenRows.mjs +65 -1
  89. package/plugins/manualColumnResize/manualColumnResize.js +4 -6
  90. package/plugins/manualColumnResize/manualColumnResize.mjs +4 -6
  91. package/plugins/manualRowResize/manualRowResize.js +4 -6
  92. package/plugins/manualRowResize/manualRowResize.mjs +4 -6
  93. package/plugins/mergeCells/mergeCells.js +26 -29
  94. package/plugins/mergeCells/mergeCells.mjs +26 -29
  95. package/plugins/mergeCells/renderer.js +15 -0
  96. package/plugins/mergeCells/renderer.mjs +15 -0
  97. package/plugins/mergeCells/utils.js +31 -0
  98. package/plugins/mergeCells/utils.mjs +27 -0
  99. package/plugins/nestedHeaders/nestedHeaders.js +25 -0
  100. package/plugins/nestedHeaders/nestedHeaders.mjs +25 -0
  101. package/plugins/nestedRows/data/dataManager.js +2 -2
  102. package/plugins/nestedRows/data/dataManager.mjs +2 -2
  103. package/plugins/stretchColumns/stretchColumns.js +13 -0
  104. package/plugins/stretchColumns/stretchColumns.mjs +13 -0
  105. package/plugins/trimRows/trimRows.js +61 -0
  106. package/plugins/trimRows/trimRows.mjs +61 -0
  107. package/plugins/undoRedo/actions/removeColumn.js +19 -14
  108. package/plugins/undoRedo/actions/removeColumn.mjs +19 -14
  109. package/plugins/undoRedo/actions/removeRow.js +12 -4
  110. package/plugins/undoRedo/actions/removeRow.mjs +12 -4
  111. package/selection/selection.js +3 -1
  112. package/selection/selection.mjs +3 -1
  113. package/styles/handsontable.css +14 -15
  114. package/styles/handsontable.min.css +3 -3
  115. package/styles/ht-theme-horizon.css +2 -2
  116. package/styles/ht-theme-horizon.min.css +2 -2
  117. package/styles/ht-theme-main.css +2 -2
  118. package/styles/ht-theme-main.min.css +2 -2
  119. package/tableView.js +5 -8
  120. package/tableView.mjs +5 -8
  121. package/utils/ghostTable.js +3 -0
  122. package/utils/ghostTable.mjs +3 -0
@@ -49,6 +49,22 @@ exports.__esModule = true;
49
49
  * />
50
50
  * :::
51
51
  *
52
+ * ::: only-for angular
53
+ * ```ts
54
+ * settings = {
55
+ * afterChange: (changes, source) => {
56
+ * changes?.forEach(([row, prop, oldValue, newValue]) => {
57
+ * // Some logic...
58
+ * });
59
+ * },
60
+ * };
61
+ * ```
62
+ *
63
+ * ```html
64
+ * <hot-table [settings]="settings" />
65
+ * ```
66
+ * :::
67
+ *
52
68
  * ::: only-for javascript
53
69
  * ```js
54
70
  * // using events as plugin hooks
@@ -153,6 +169,22 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
153
169
  * />
154
170
  * ```
155
171
  * :::
172
+ *
173
+ * ::: only-for angular
174
+ * ```ts
175
+ * settings = {
176
+ * afterChange: (changes, source) => {
177
+ * changes?.forEach(([row, prop, oldValue, newValue]) => {
178
+ * // Some logic...
179
+ * });
180
+ * },
181
+ * };
182
+ * ```
183
+ *
184
+ * ```html
185
+ * <hot-table [settings]="settings"></hot-table>
186
+ * ```
187
+ * :::
156
188
  */
157
189
  'afterChange',
158
190
  /**
@@ -256,6 +288,21 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
256
288
  * />
257
289
  * ```
258
290
  * :::
291
+ *
292
+ * ::: only-for angular
293
+ * ```ts
294
+ * settings = {
295
+ * beforeCreateCol: (data, coords) => {
296
+ * // Return `false` to cancel column inserting.
297
+ * return false;
298
+ * },
299
+ * };
300
+ * ```
301
+ *
302
+ * ```html
303
+ * <hot-table [settings]="settings"></hot-table>
304
+ * ```
305
+ * :::
259
306
  */
260
307
  'beforeCreateCol',
261
308
  /**
@@ -336,6 +383,14 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
336
383
  * @returns {string[]|undefined} Can return an `Array` of `String`s. Each of these strings will act like class names to be removed from all the cells in the table.
337
384
  */
338
385
  'beforeRemoveCellClassNames',
386
+ /**
387
+ * Hook fired after `compositionstart` event is handled.
388
+ *
389
+ * @event Hooks#beforeCompositionStart
390
+ * @since 15.3.0
391
+ * @param {Event} event A native `composition` event object.
392
+ */
393
+ 'beforeCompositionStart',
339
394
  /**
340
395
  * Fired after getting the cell settings.
341
396
  *
@@ -631,6 +686,31 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
631
686
  * }}
632
687
  * />
633
688
  * ```
689
+ * :::
690
+ *
691
+ * ::: only-for angular
692
+ * ```ts
693
+ * settings = {
694
+ * afterSelection: (
695
+ * row,
696
+ * column,
697
+ * row2,
698
+ * column2,
699
+ * preventScrolling,
700
+ * selectionLayerLevel
701
+ * ) => {
702
+ * // If set to `false` (default): when cell selection is outside the viewport,
703
+ * // Handsontable scrolls the viewport to cell selection's end corner.
704
+ * // If set to `true`: when cell selection is outside the viewport,
705
+ * // Handsontable doesn't scroll to cell selection's end corner.
706
+ * preventScrolling.value = true;
707
+ * },
708
+ * };
709
+ * ```
710
+ *
711
+ * ```html
712
+ * <hot-table [settings]="settings"></hot-table>
713
+ * ```
634
714
  * :::
635
715
  */
636
716
  'afterSelection',
@@ -670,6 +750,28 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
670
750
  * />
671
751
  * ```
672
752
  * :::
753
+ *
754
+ * ::: only-for angular
755
+ * ```ts
756
+ * settings = {
757
+ * afterSelectionByProp: (
758
+ * row,
759
+ * column,
760
+ * row2,
761
+ * column2,
762
+ * preventScrolling,
763
+ * selectionLayerLevel
764
+ * ) => {
765
+ * // Setting if prevent scrolling after selection
766
+ * preventScrolling.value = true;
767
+ * },
768
+ * };
769
+ * ```
770
+ *
771
+ * ```html
772
+ * <hot-table [settings]="settings"></hot-table>
773
+ * ```
774
+ * :::
673
775
  */
674
776
  'afterSelectionByProp',
675
777
  /**
@@ -734,6 +836,24 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
734
836
  * />
735
837
  * ```
736
838
  * :::
839
+ *
840
+ * ::: only-for angular
841
+ * ```ts
842
+ * settings = {
843
+ * afterSelectionFocusSet: (row, column, preventScrolling) => {
844
+ * // If set to `false` (default): when focused cell selection is outside the viewport,
845
+ * // Handsontable scrolls the viewport to that cell.
846
+ * // If set to `true`: when focused cell selection is outside the viewport,
847
+ * // Handsontable doesn't scroll the viewport.
848
+ * preventScrolling.value = true;
849
+ * },
850
+ * };
851
+ * ```
852
+ *
853
+ * ```html
854
+ * <hot-table [settings]="settings"></hot-table>
855
+ * ```
856
+ * :::
737
857
  */
738
858
  'afterSelectionFocusSet',
739
859
  /**
@@ -768,6 +888,22 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
768
888
  * />
769
889
  * ```
770
890
  * :::
891
+ *
892
+ * ::: only-for angular
893
+ * ```ts
894
+ * settings = {
895
+ * beforeSelectColumns: (from, to, highlight) => {
896
+ * // Extend the column selection by one column left and one column right.
897
+ * from.col = Math.max(from.col - 1, 0);
898
+ * to.col = Math.min(to.col + 1, this.countCols() - 1);
899
+ * },
900
+ * };
901
+ * ```
902
+ *
903
+ * ```html
904
+ * <hot-table [settings]="settings"></hot-table>
905
+ * ```
906
+ * :::
771
907
  */
772
908
  'beforeSelectColumns',
773
909
  /**
@@ -812,6 +948,22 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
812
948
  * />
813
949
  * ```
814
950
  * :::
951
+ *
952
+ * ::: only-for angular
953
+ * ```ts
954
+ * settings = {
955
+ * beforeSelectRows: (from, to, highlight) => {
956
+ * // Extend the row selection by one row up and one row down.
957
+ * from.row = Math.max(from.row - 1, 0);
958
+ * to.row = Math.min(to.row + 1, this.countRows() - 1);
959
+ * },
960
+ * };
961
+ * ```
962
+ *
963
+ * ```html
964
+ * <hot-table [settings]="settings"></hot-table>
965
+ * ```
966
+ * :::
815
967
  */
816
968
  'beforeSelectRows',
817
969
  /**
@@ -1032,6 +1184,42 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
1032
1184
  * />
1033
1185
  * ```
1034
1186
  * :::
1187
+ * ::: only-for angular
1188
+ *```ts
1189
+ * // To alter a single change, overwrite the desired value with `changes[i][3]`
1190
+ * settings1 = {
1191
+ * beforeChange: (changes, source) => {
1192
+ * // [[row, prop, oldVal, newVal], ...]
1193
+ * changes[0][3] = 10;
1194
+ * },
1195
+ * };
1196
+ *
1197
+ * // To ignore a single change, set `changes[i]` to `null`
1198
+ * // or remove `changes[i]` from the array, by using changes.splice(i, 1).
1199
+ * settings2 = {
1200
+ * beforeChange: (changes, source) => {
1201
+ * // [[row, prop, oldVal, newVal], ...]
1202
+ * changes[0] = null;
1203
+ * },
1204
+ * };
1205
+ *
1206
+ * // To ignore all changes, return `false`
1207
+ * // or set the array's length to 0 (`changes.length = 0`)
1208
+ * settings3 = {
1209
+ * beforeChange: (changes, source) => {
1210
+ * // [[row, prop, oldVal, newVal], ...]
1211
+ * return false;
1212
+ * },
1213
+ * };
1214
+ * ```
1215
+ *
1216
+ * ```html
1217
+ * <hot-table [settings]="settings1"></hot-table>
1218
+ * <hot-table [settings]="settings2"></hot-table>
1219
+ * <hot-table [settings]="settings3"></hot-table>
1220
+ * ```
1221
+ *
1222
+ * :::
1035
1223
  */
1036
1224
  'beforeChange',
1037
1225
  /**
@@ -1642,6 +1830,32 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
1642
1830
  * />
1643
1831
  * ```
1644
1832
  * :::
1833
+ *
1834
+ * ::: only-for angular
1835
+ *```ts
1836
+ * // To disregard a single row, remove it from the array using data.splice(i, 1).
1837
+ * settings1 = {
1838
+ * beforeCut: (data, coords) => {
1839
+ * // data -> [[1, 2, 3], [4, 5, 6]]
1840
+ * data.splice(0, 1);
1841
+ * // data -> [[4, 5, 6]]
1842
+ * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1843
+ * },
1844
+ * };
1845
+ *
1846
+ * // To cancel a cutting action, just return `false`.
1847
+ * settings2 = {
1848
+ * beforeCut: (data, coords) => {
1849
+ * return false;
1850
+ * },
1851
+ * };
1852
+ * ```
1853
+ *
1854
+ * ```html
1855
+ * <hot-table [settings]="settings1"></hot-table>
1856
+ * <hot-table [settings]="settings2"></hot-table>
1857
+ * ```
1858
+ * :::
1645
1859
  */
1646
1860
  'beforeCut',
1647
1861
  /**
@@ -1714,6 +1928,32 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
1714
1928
  * ...
1715
1929
  * ```
1716
1930
  * :::
1931
+ *
1932
+ * ::: only-for angular
1933
+ * ```ts
1934
+ * // To disregard a single row, remove it from the array using data.splice(i, 1).
1935
+ * settings1 = {
1936
+ * beforeCopy: (data, coords) => {
1937
+ * // data -> [[1, 2, 3], [4, 5, 6]]
1938
+ * data.splice(0, 1);
1939
+ * // data -> [[4, 5, 6]]
1940
+ * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1941
+ * },
1942
+ * };
1943
+ *
1944
+ * // To cancel copying, return false from the callback.
1945
+ * settings2 = {
1946
+ * beforeCopy: (data, coords) => {
1947
+ * return false;
1948
+ * },
1949
+ * };
1950
+ * ```
1951
+ *
1952
+ * ```html
1953
+ * <hot-table [settings]="settings1"></hot-table>
1954
+ * <hot-table [settings]="settings2"></hot-table>
1955
+ * ```
1956
+ * :::
1717
1957
  */
1718
1958
  'beforeCopy',
1719
1959
  /**
@@ -1776,6 +2016,32 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
1776
2016
  * />
1777
2017
  * ```
1778
2018
  * :::
2019
+ *
2020
+ * ::: only-for angular
2021
+ * ```ts
2022
+ * // To disregard a single row, remove it from the array using data.splice(i, 1).
2023
+ * settings1 = {
2024
+ * beforePaste: (data, coords) => {
2025
+ * // data -> [[1, 2, 3], [4, 5, 6]]
2026
+ * data.splice(0, 1);
2027
+ * // data -> [[4, 5, 6]]
2028
+ * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
2029
+ * },
2030
+ * };
2031
+ *
2032
+ * // To cancel pasting, return false from the callback.
2033
+ * settings2 = {
2034
+ * beforePaste: (data, coords) => {
2035
+ * return false;
2036
+ * },
2037
+ * };
2038
+ * ```
2039
+ *
2040
+ * ```html
2041
+ * <hot-table [settings]="settings1"></hot-table>
2042
+ * <hot-table [settings]="settings2"></hot-table>
2043
+ * ```
2044
+ * :::
1779
2045
  */
1780
2046
  'beforePaste',
1781
2047
  /**
@@ -46,6 +46,22 @@
46
46
  * />
47
47
  * :::
48
48
  *
49
+ * ::: only-for angular
50
+ * ```ts
51
+ * settings = {
52
+ * afterChange: (changes, source) => {
53
+ * changes?.forEach(([row, prop, oldValue, newValue]) => {
54
+ * // Some logic...
55
+ * });
56
+ * },
57
+ * };
58
+ * ```
59
+ *
60
+ * ```html
61
+ * <hot-table [settings]="settings" />
62
+ * ```
63
+ * :::
64
+ *
49
65
  * ::: only-for javascript
50
66
  * ```js
51
67
  * // using events as plugin hooks
@@ -150,6 +166,22 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
150
166
  * />
151
167
  * ```
152
168
  * :::
169
+ *
170
+ * ::: only-for angular
171
+ * ```ts
172
+ * settings = {
173
+ * afterChange: (changes, source) => {
174
+ * changes?.forEach(([row, prop, oldValue, newValue]) => {
175
+ * // Some logic...
176
+ * });
177
+ * },
178
+ * };
179
+ * ```
180
+ *
181
+ * ```html
182
+ * <hot-table [settings]="settings"></hot-table>
183
+ * ```
184
+ * :::
153
185
  */
154
186
  'afterChange',
155
187
  /**
@@ -253,6 +285,21 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
253
285
  * />
254
286
  * ```
255
287
  * :::
288
+ *
289
+ * ::: only-for angular
290
+ * ```ts
291
+ * settings = {
292
+ * beforeCreateCol: (data, coords) => {
293
+ * // Return `false` to cancel column inserting.
294
+ * return false;
295
+ * },
296
+ * };
297
+ * ```
298
+ *
299
+ * ```html
300
+ * <hot-table [settings]="settings"></hot-table>
301
+ * ```
302
+ * :::
256
303
  */
257
304
  'beforeCreateCol',
258
305
  /**
@@ -333,6 +380,14 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
333
380
  * @returns {string[]|undefined} Can return an `Array` of `String`s. Each of these strings will act like class names to be removed from all the cells in the table.
334
381
  */
335
382
  'beforeRemoveCellClassNames',
383
+ /**
384
+ * Hook fired after `compositionstart` event is handled.
385
+ *
386
+ * @event Hooks#beforeCompositionStart
387
+ * @since 15.3.0
388
+ * @param {Event} event A native `composition` event object.
389
+ */
390
+ 'beforeCompositionStart',
336
391
  /**
337
392
  * Fired after getting the cell settings.
338
393
  *
@@ -628,6 +683,31 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
628
683
  * }}
629
684
  * />
630
685
  * ```
686
+ * :::
687
+ *
688
+ * ::: only-for angular
689
+ * ```ts
690
+ * settings = {
691
+ * afterSelection: (
692
+ * row,
693
+ * column,
694
+ * row2,
695
+ * column2,
696
+ * preventScrolling,
697
+ * selectionLayerLevel
698
+ * ) => {
699
+ * // If set to `false` (default): when cell selection is outside the viewport,
700
+ * // Handsontable scrolls the viewport to cell selection's end corner.
701
+ * // If set to `true`: when cell selection is outside the viewport,
702
+ * // Handsontable doesn't scroll to cell selection's end corner.
703
+ * preventScrolling.value = true;
704
+ * },
705
+ * };
706
+ * ```
707
+ *
708
+ * ```html
709
+ * <hot-table [settings]="settings"></hot-table>
710
+ * ```
631
711
  * :::
632
712
  */
633
713
  'afterSelection',
@@ -667,6 +747,28 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
667
747
  * />
668
748
  * ```
669
749
  * :::
750
+ *
751
+ * ::: only-for angular
752
+ * ```ts
753
+ * settings = {
754
+ * afterSelectionByProp: (
755
+ * row,
756
+ * column,
757
+ * row2,
758
+ * column2,
759
+ * preventScrolling,
760
+ * selectionLayerLevel
761
+ * ) => {
762
+ * // Setting if prevent scrolling after selection
763
+ * preventScrolling.value = true;
764
+ * },
765
+ * };
766
+ * ```
767
+ *
768
+ * ```html
769
+ * <hot-table [settings]="settings"></hot-table>
770
+ * ```
771
+ * :::
670
772
  */
671
773
  'afterSelectionByProp',
672
774
  /**
@@ -731,6 +833,24 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
731
833
  * />
732
834
  * ```
733
835
  * :::
836
+ *
837
+ * ::: only-for angular
838
+ * ```ts
839
+ * settings = {
840
+ * afterSelectionFocusSet: (row, column, preventScrolling) => {
841
+ * // If set to `false` (default): when focused cell selection is outside the viewport,
842
+ * // Handsontable scrolls the viewport to that cell.
843
+ * // If set to `true`: when focused cell selection is outside the viewport,
844
+ * // Handsontable doesn't scroll the viewport.
845
+ * preventScrolling.value = true;
846
+ * },
847
+ * };
848
+ * ```
849
+ *
850
+ * ```html
851
+ * <hot-table [settings]="settings"></hot-table>
852
+ * ```
853
+ * :::
734
854
  */
735
855
  'afterSelectionFocusSet',
736
856
  /**
@@ -765,6 +885,22 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
765
885
  * />
766
886
  * ```
767
887
  * :::
888
+ *
889
+ * ::: only-for angular
890
+ * ```ts
891
+ * settings = {
892
+ * beforeSelectColumns: (from, to, highlight) => {
893
+ * // Extend the column selection by one column left and one column right.
894
+ * from.col = Math.max(from.col - 1, 0);
895
+ * to.col = Math.min(to.col + 1, this.countCols() - 1);
896
+ * },
897
+ * };
898
+ * ```
899
+ *
900
+ * ```html
901
+ * <hot-table [settings]="settings"></hot-table>
902
+ * ```
903
+ * :::
768
904
  */
769
905
  'beforeSelectColumns',
770
906
  /**
@@ -809,6 +945,22 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
809
945
  * />
810
946
  * ```
811
947
  * :::
948
+ *
949
+ * ::: only-for angular
950
+ * ```ts
951
+ * settings = {
952
+ * beforeSelectRows: (from, to, highlight) => {
953
+ * // Extend the row selection by one row up and one row down.
954
+ * from.row = Math.max(from.row - 1, 0);
955
+ * to.row = Math.min(to.row + 1, this.countRows() - 1);
956
+ * },
957
+ * };
958
+ * ```
959
+ *
960
+ * ```html
961
+ * <hot-table [settings]="settings"></hot-table>
962
+ * ```
963
+ * :::
812
964
  */
813
965
  'beforeSelectRows',
814
966
  /**
@@ -1029,6 +1181,42 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
1029
1181
  * />
1030
1182
  * ```
1031
1183
  * :::
1184
+ * ::: only-for angular
1185
+ *```ts
1186
+ * // To alter a single change, overwrite the desired value with `changes[i][3]`
1187
+ * settings1 = {
1188
+ * beforeChange: (changes, source) => {
1189
+ * // [[row, prop, oldVal, newVal], ...]
1190
+ * changes[0][3] = 10;
1191
+ * },
1192
+ * };
1193
+ *
1194
+ * // To ignore a single change, set `changes[i]` to `null`
1195
+ * // or remove `changes[i]` from the array, by using changes.splice(i, 1).
1196
+ * settings2 = {
1197
+ * beforeChange: (changes, source) => {
1198
+ * // [[row, prop, oldVal, newVal], ...]
1199
+ * changes[0] = null;
1200
+ * },
1201
+ * };
1202
+ *
1203
+ * // To ignore all changes, return `false`
1204
+ * // or set the array's length to 0 (`changes.length = 0`)
1205
+ * settings3 = {
1206
+ * beforeChange: (changes, source) => {
1207
+ * // [[row, prop, oldVal, newVal], ...]
1208
+ * return false;
1209
+ * },
1210
+ * };
1211
+ * ```
1212
+ *
1213
+ * ```html
1214
+ * <hot-table [settings]="settings1"></hot-table>
1215
+ * <hot-table [settings]="settings2"></hot-table>
1216
+ * <hot-table [settings]="settings3"></hot-table>
1217
+ * ```
1218
+ *
1219
+ * :::
1032
1220
  */
1033
1221
  'beforeChange',
1034
1222
  /**
@@ -1639,6 +1827,32 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
1639
1827
  * />
1640
1828
  * ```
1641
1829
  * :::
1830
+ *
1831
+ * ::: only-for angular
1832
+ *```ts
1833
+ * // To disregard a single row, remove it from the array using data.splice(i, 1).
1834
+ * settings1 = {
1835
+ * beforeCut: (data, coords) => {
1836
+ * // data -> [[1, 2, 3], [4, 5, 6]]
1837
+ * data.splice(0, 1);
1838
+ * // data -> [[4, 5, 6]]
1839
+ * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1840
+ * },
1841
+ * };
1842
+ *
1843
+ * // To cancel a cutting action, just return `false`.
1844
+ * settings2 = {
1845
+ * beforeCut: (data, coords) => {
1846
+ * return false;
1847
+ * },
1848
+ * };
1849
+ * ```
1850
+ *
1851
+ * ```html
1852
+ * <hot-table [settings]="settings1"></hot-table>
1853
+ * <hot-table [settings]="settings2"></hot-table>
1854
+ * ```
1855
+ * :::
1642
1856
  */
1643
1857
  'beforeCut',
1644
1858
  /**
@@ -1711,6 +1925,32 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
1711
1925
  * ...
1712
1926
  * ```
1713
1927
  * :::
1928
+ *
1929
+ * ::: only-for angular
1930
+ * ```ts
1931
+ * // To disregard a single row, remove it from the array using data.splice(i, 1).
1932
+ * settings1 = {
1933
+ * beforeCopy: (data, coords) => {
1934
+ * // data -> [[1, 2, 3], [4, 5, 6]]
1935
+ * data.splice(0, 1);
1936
+ * // data -> [[4, 5, 6]]
1937
+ * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1938
+ * },
1939
+ * };
1940
+ *
1941
+ * // To cancel copying, return false from the callback.
1942
+ * settings2 = {
1943
+ * beforeCopy: (data, coords) => {
1944
+ * return false;
1945
+ * },
1946
+ * };
1947
+ * ```
1948
+ *
1949
+ * ```html
1950
+ * <hot-table [settings]="settings1"></hot-table>
1951
+ * <hot-table [settings]="settings2"></hot-table>
1952
+ * ```
1953
+ * :::
1714
1954
  */
1715
1955
  'beforeCopy',
1716
1956
  /**
@@ -1773,6 +2013,32 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
1773
2013
  * />
1774
2014
  * ```
1775
2015
  * :::
2016
+ *
2017
+ * ::: only-for angular
2018
+ * ```ts
2019
+ * // To disregard a single row, remove it from the array using data.splice(i, 1).
2020
+ * settings1 = {
2021
+ * beforePaste: (data, coords) => {
2022
+ * // data -> [[1, 2, 3], [4, 5, 6]]
2023
+ * data.splice(0, 1);
2024
+ * // data -> [[4, 5, 6]]
2025
+ * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
2026
+ * },
2027
+ * };
2028
+ *
2029
+ * // To cancel pasting, return false from the callback.
2030
+ * settings2 = {
2031
+ * beforePaste: (data, coords) => {
2032
+ * return false;
2033
+ * },
2034
+ * };
2035
+ * ```
2036
+ *
2037
+ * ```html
2038
+ * <hot-table [settings]="settings1"></hot-table>
2039
+ * <hot-table [settings]="settings2"></hot-table>
2040
+ * ```
2041
+ * :::
1776
2042
  */
1777
2043
  'beforePaste',
1778
2044
  /**
@@ -167,6 +167,7 @@ export interface Events {
167
167
  beforeColumnSort?: (currentSortConfig: ColumnSortingConfig[], destinationSortConfigs: ColumnSortingConfig[]) => void | boolean;
168
168
  beforeColumnWrap?: (isActionInterrupted: { value: boolean }, newCoords: CellCoords, isColumnFlipped: boolean) => void;
169
169
  beforeColumnUnfreeze?: (columnIndex: number, isUnfreezingPerformed: boolean) => void | boolean;
170
+ beforeCompositionStart?: (event: CompositionEvent) => void;
170
171
  beforeContextMenuSetItems?: (menuItems: ContextMenuMenuItemConfig[]) => void;
171
172
  beforeContextMenuShow?: (context: ContextMenu) => void;
172
173
  beforeCopy?: (data: CellValue[][], coords: RangeType[], copiedHeadersCount: { columnHeadersCount: number }) => void | boolean;
package/core.d.ts CHANGED
@@ -140,7 +140,6 @@ export default class Core {
140
140
  removeCellMeta(row: number, column: number, key: (keyof CellMeta) | string): void;
141
141
  removeHook<K extends keyof Events>(key: K, callback: Events[K]): void;
142
142
  render(): void;
143
- renderCall: boolean;
144
143
  resumeExecution(): void;
145
144
  resumeRender(): void;
146
145
  rootDocument: Document;