handsontable 0.0.0-next-fad35d5-20240924 → 0.0.0-next-d7edb4b-20240927

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

Files changed (127) hide show
  1. package/3rdparty/walkontable/src/calculator/calculationType/renderedColumns.js +0 -23
  2. package/3rdparty/walkontable/src/calculator/calculationType/renderedColumns.mjs +0 -23
  3. package/3rdparty/walkontable/src/calculator/calculationType/renderedRows.js +0 -23
  4. package/3rdparty/walkontable/src/calculator/calculationType/renderedRows.mjs +0 -23
  5. package/3rdparty/walkontable/src/core/_base.js +0 -7
  6. package/3rdparty/walkontable/src/core/_base.mjs +0 -7
  7. package/3rdparty/walkontable/src/facade/core.js +0 -3
  8. package/3rdparty/walkontable/src/facade/core.mjs +0 -3
  9. package/3rdparty/walkontable/src/overlay/_base.js +0 -3
  10. package/3rdparty/walkontable/src/overlay/_base.mjs +0 -3
  11. package/3rdparty/walkontable/src/selection/border/border.js +45 -33
  12. package/3rdparty/walkontable/src/selection/border/border.mjs +46 -34
  13. package/3rdparty/walkontable/src/selection/scanner.js +11 -46
  14. package/3rdparty/walkontable/src/selection/scanner.mjs +11 -46
  15. package/3rdparty/walkontable/src/settings.js +0 -8
  16. package/3rdparty/walkontable/src/settings.mjs +0 -8
  17. package/3rdparty/walkontable/src/table/master.js +1 -1
  18. package/3rdparty/walkontable/src/table/master.mjs +2 -2
  19. package/3rdparty/walkontable/src/table.js +3 -6
  20. package/3rdparty/walkontable/src/table.mjs +3 -6
  21. package/3rdparty/walkontable/src/viewport.js +4 -26
  22. package/3rdparty/walkontable/src/viewport.mjs +4 -26
  23. package/base.js +4 -4
  24. package/base.mjs +3 -3
  25. package/core.d.ts +1 -1
  26. package/core.js +12 -13
  27. package/core.mjs +4 -5
  28. package/dataMap/metaManager/metaSchema.js +2 -68
  29. package/dataMap/metaManager/metaSchema.mjs +2 -68
  30. package/dataMap/metaManager/mods/dynamicCellMeta.js +3 -2
  31. package/dataMap/metaManager/mods/dynamicCellMeta.mjs +1 -1
  32. package/dist/handsontable.css +2 -2
  33. package/dist/handsontable.full.css +2 -2
  34. package/dist/handsontable.full.js +2685 -3046
  35. package/dist/handsontable.full.min.css +2 -2
  36. package/dist/handsontable.full.min.js +75 -75
  37. package/dist/handsontable.js +2687 -3048
  38. package/dist/handsontable.min.css +2 -2
  39. package/dist/handsontable.min.js +18 -18
  40. package/editorManager.js +2 -2
  41. package/editorManager.mjs +2 -2
  42. package/editors/autocompleteEditor/autocompleteEditor.js +31 -14
  43. package/editors/autocompleteEditor/autocompleteEditor.mjs +31 -14
  44. package/editors/baseEditor/baseEditor.js +17 -24
  45. package/editors/baseEditor/baseEditor.mjs +18 -25
  46. package/editors/dropdownEditor/dropdownEditor.js +3 -2
  47. package/editors/dropdownEditor/dropdownEditor.mjs +1 -1
  48. package/editors/handsontableEditor/handsontableEditor.js +24 -0
  49. package/editors/handsontableEditor/handsontableEditor.mjs +24 -0
  50. package/editors/registry.js +2 -2
  51. package/editors/registry.mjs +1 -1
  52. package/editors/textEditor/textEditor.js +2 -2
  53. package/editors/textEditor/textEditor.mjs +3 -3
  54. package/helpers/dom/element.js +4 -17
  55. package/helpers/dom/element.mjs +4 -16
  56. package/helpers/mixed.js +1 -1
  57. package/helpers/mixed.mjs +1 -1
  58. package/index.d.ts +1 -2
  59. package/package.json +1 -1
  60. package/{core/hooks/index.d.ts → pluginHooks.d.ts} +21 -17
  61. package/{core/hooks/constants.mjs → pluginHooks.js} +489 -16
  62. package/{core/hooks/constants.js → pluginHooks.mjs} +486 -20
  63. package/plugins/autoColumnSize/autoColumnSize.js +27 -18
  64. package/plugins/autoColumnSize/autoColumnSize.mjs +27 -18
  65. package/plugins/autoRowSize/autoRowSize.js +22 -16
  66. package/plugins/autoRowSize/autoRowSize.mjs +23 -17
  67. package/plugins/autofill/autofill.js +5 -4
  68. package/plugins/autofill/autofill.mjs +1 -1
  69. package/plugins/base/base.d.ts +1 -1
  70. package/plugins/base/base.js +0 -39
  71. package/plugins/base/base.mjs +1 -40
  72. package/plugins/base/index.js +1 -2
  73. package/plugins/base/index.mjs +1 -1
  74. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -2
  75. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -2
  76. package/plugins/columnSorting/columnSorting.js +4 -3
  77. package/plugins/columnSorting/columnSorting.mjs +1 -1
  78. package/plugins/comments/comments.js +15 -7
  79. package/plugins/comments/comments.mjs +16 -8
  80. package/plugins/contextMenu/contextMenu.js +7 -6
  81. package/plugins/contextMenu/contextMenu.mjs +1 -1
  82. package/plugins/contextMenu/menu/menu.js +1 -1
  83. package/plugins/contextMenu/menu/menu.mjs +2 -2
  84. package/plugins/contextMenu/menu/positioner.js +4 -2
  85. package/plugins/contextMenu/menu/positioner.mjs +4 -2
  86. package/plugins/copyPaste/copyPaste.js +23 -29
  87. package/plugins/copyPaste/copyPaste.mjs +15 -21
  88. package/plugins/dropdownMenu/dropdownMenu.js +7 -6
  89. package/plugins/dropdownMenu/dropdownMenu.mjs +1 -1
  90. package/plugins/formulas/formulas.js +7 -7
  91. package/plugins/formulas/formulas.mjs +1 -1
  92. package/plugins/hiddenColumns/hiddenColumns.js +30 -19
  93. package/plugins/hiddenColumns/hiddenColumns.mjs +26 -15
  94. package/plugins/hiddenRows/hiddenRows.js +29 -18
  95. package/plugins/hiddenRows/hiddenRows.mjs +25 -14
  96. package/plugins/manualColumnFreeze/manualColumnFreeze.js +5 -5
  97. package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +1 -1
  98. package/plugins/manualColumnMove/manualColumnMove.js +3 -3
  99. package/plugins/manualColumnMove/manualColumnMove.mjs +1 -1
  100. package/plugins/manualRowMove/manualRowMove.js +5 -5
  101. package/plugins/manualRowMove/manualRowMove.mjs +3 -3
  102. package/plugins/mergeCells/cellsCollection.js +3 -15
  103. package/plugins/mergeCells/cellsCollection.mjs +4 -16
  104. package/plugins/mergeCells/mergeCells.d.ts +2 -6
  105. package/plugins/mergeCells/mergeCells.js +55 -78
  106. package/plugins/mergeCells/mergeCells.mjs +53 -76
  107. package/plugins/mergeCells/renderer.js +3 -13
  108. package/plugins/mergeCells/renderer.mjs +3 -13
  109. package/plugins/persistentState/persistentState.js +4 -4
  110. package/plugins/persistentState/persistentState.mjs +1 -1
  111. package/plugins/undoRedo/undoRedo.js +5 -4
  112. package/plugins/undoRedo/undoRedo.mjs +3 -3
  113. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
  114. package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
  115. package/settings.d.ts +1 -3
  116. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +1 -1
  117. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +1 -1
  118. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +1 -1
  119. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +1 -1
  120. package/shortcutContexts/commands/scrollToFocusedCell.js +4 -4
  121. package/shortcutContexts/commands/scrollToFocusedCell.mjs +4 -4
  122. package/tableView.js +43 -38
  123. package/tableView.mjs +43 -38
  124. package/core/hooks/bucket.js +0 -180
  125. package/core/hooks/bucket.mjs +0 -176
  126. package/core/hooks/index.js +0 -385
  127. package/core/hooks/index.mjs +0 -381
@@ -193,18 +193,21 @@ export class SelectionScanner {
193
193
  * @param {function(HTMLTableElement): void} callback The callback function to trigger.
194
194
  */
195
195
  scanCellsRange(callback) {
196
+ const [topRow, topColumn, bottomRow, bottomColumn] = _classPrivateFieldGet(_selection, this).getCorners();
196
197
  const {
197
198
  wtTable
198
199
  } = _classPrivateFieldGet(_activeOverlaysWot, this);
199
200
  _assertClassBrand(_SelectionScanner_brand, this, _scanCellsRange).call(this, (sourceRow, sourceColumn) => {
200
- const cell = wtTable.getCell(_classPrivateFieldGet(_activeOverlaysWot, this).createCellCoords(sourceRow, sourceColumn));
201
+ if (sourceRow >= topRow && sourceRow <= bottomRow && sourceColumn >= topColumn && sourceColumn <= bottomColumn) {
202
+ const cell = wtTable.getCell(_classPrivateFieldGet(_activeOverlaysWot, this).createCellCoords(sourceRow, sourceColumn));
201
203
 
202
- // support for old API
203
- const additionalSelectionClass = _classPrivateFieldGet(_activeOverlaysWot, this).getSetting('onAfterDrawSelection', sourceRow, sourceColumn, _classPrivateFieldGet(_selection, this).settings.layerLevel);
204
- if (typeof additionalSelectionClass === 'string') {
205
- addClass(cell, additionalSelectionClass);
204
+ // support for old API
205
+ const additionalSelectionClass = _classPrivateFieldGet(_activeOverlaysWot, this).getSetting('onAfterDrawSelection', sourceRow, sourceColumn, _classPrivateFieldGet(_selection, this).settings.layerLevel);
206
+ if (typeof additionalSelectionClass === 'string') {
207
+ addClass(cell, additionalSelectionClass);
208
+ }
209
+ callback(cell);
206
210
  }
207
- callback(cell);
208
211
  });
209
212
  }
210
213
 
@@ -220,7 +223,7 @@ export class SelectionScanner {
220
223
  const {
221
224
  wtTable
222
225
  } = _classPrivateFieldGet(_activeOverlaysWot, this);
223
- _assertClassBrand(_SelectionScanner_brand, this, _scanViewportRange).call(this, (sourceRow, sourceColumn) => {
226
+ _assertClassBrand(_SelectionScanner_brand, this, _scanCellsRange).call(this, (sourceRow, sourceColumn) => {
224
227
  if (sourceRow >= topRow && sourceRow <= bottomRow) {
225
228
  const cell = wtTable.getCell(_classPrivateFieldGet(_activeOverlaysWot, this).createCellCoords(sourceRow, sourceColumn));
226
229
  callback(cell);
@@ -239,7 +242,7 @@ export class SelectionScanner {
239
242
  const {
240
243
  wtTable
241
244
  } = _classPrivateFieldGet(_activeOverlaysWot, this);
242
- _assertClassBrand(_SelectionScanner_brand, this, _scanViewportRange).call(this, (sourceRow, sourceColumn) => {
245
+ _assertClassBrand(_SelectionScanner_brand, this, _scanCellsRange).call(this, (sourceRow, sourceColumn) => {
243
246
  if (sourceColumn >= topColumn && sourceColumn <= bottomColumn) {
244
247
  const cell = wtTable.getCell(_classPrivateFieldGet(_activeOverlaysWot, this).createCellCoords(sourceRow, sourceColumn));
245
248
  callback(cell);
@@ -248,44 +251,6 @@ export class SelectionScanner {
248
251
  }
249
252
  }
250
253
  function _scanCellsRange(callback) {
251
- let [topRow, startColumn, bottomRow, endColumn] = _classPrivateFieldGet(_selection, this).getCorners();
252
- if (topRow < 0 && bottomRow < 0 || startColumn < 0 && endColumn < 0) {
253
- return;
254
- }
255
- const {
256
- wtTable
257
- } = _classPrivateFieldGet(_activeOverlaysWot, this);
258
- const isMultiple = topRow !== bottomRow || startColumn !== endColumn;
259
- startColumn = Math.max(startColumn, 0);
260
- endColumn = Math.max(endColumn, 0);
261
- topRow = Math.max(topRow, 0);
262
- bottomRow = Math.max(bottomRow, 0);
263
- if (isMultiple) {
264
- startColumn = Math.max(startColumn, wtTable.getFirstRenderedColumn());
265
- endColumn = Math.min(endColumn, wtTable.getLastRenderedColumn());
266
- topRow = Math.max(topRow, wtTable.getFirstRenderedRow());
267
- bottomRow = Math.min(bottomRow, wtTable.getLastRenderedRow());
268
- if (endColumn < startColumn || bottomRow < topRow) {
269
- return;
270
- }
271
- } else {
272
- const cell = wtTable.getCell(_classPrivateFieldGet(_activeOverlaysWot, this).createCellCoords(topRow, startColumn));
273
- if (!(cell instanceof HTMLElement)) {
274
- return;
275
- }
276
- }
277
- for (let row = topRow; row <= bottomRow; row += 1) {
278
- for (let column = startColumn; column <= endColumn; column += 1) {
279
- callback(row, column);
280
- }
281
- }
282
- }
283
- /**
284
- * The method triggers a callback for each rendered cell including headers.
285
- *
286
- * @param {function(number, number): void} callback The callback function to trigger.
287
- */
288
- function _scanViewportRange(callback) {
289
254
  const {
290
255
  wtTable
291
256
  } = _classPrivateFieldGet(_activeOverlaysWot, this);
@@ -66,8 +66,6 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
66
66
  * @property {?Option} onCellMouseUp Option `onCellMouseUp`.
67
67
  * @property {?Option} onDraw Option `onDraw`.
68
68
  * @property {?Option} onModifyGetCellCoords Option `onModifyGetCellCoords`.
69
- * @property {?Option} onModifyGetCoordsElement Option `onModifyGetCoordsElement`.
70
- * @property {?Option} onModifyGetCoords Option `onModifyGetCoords`.
71
69
  * @property {?Option} onModifyRowHeaderWidth Option `onModifyRowHeaderWidth`.
72
70
  * @property {?Option} onBeforeViewportScrollHorizontally Option `onBeforeViewportScrollHorizontally`.
73
71
  * @property {?Option} onBeforeViewportScrollVertically Option `onBeforeViewportScrollVertically`.
@@ -78,8 +76,6 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
78
76
  * @property {?Option} selections Option `selections`.
79
77
  * @property {?Option} viewportColumnCalculatorOverride Option `viewportColumnCalculatorOverride`.
80
78
  * @property {?Option} viewportRowCalculatorOverride Option `viewportRowCalculatorOverride`.
81
- * @property {?Option} viewportColumnRenderingThreshold Option `viewportColumnRenderingThreshold`.
82
- * @property {?Option} viewportRowRenderingThreshold Option `viewportRowRenderingThreshold`.
83
79
  */
84
80
 
85
81
  /**
@@ -197,8 +193,6 @@ class Settings {
197
193
  hideBorderOnMouseDownOver: false,
198
194
  viewportRowCalculatorOverride: null,
199
195
  viewportColumnCalculatorOverride: null,
200
- viewportRowRenderingThreshold: null,
201
- viewportColumnRenderingThreshold: null,
202
196
  // callbacks
203
197
  onCellMouseDown: null,
204
198
  onCellContextMenu: null,
@@ -226,8 +220,6 @@ class Settings {
226
220
  onBeforeStretchingColumnWidth: width => width,
227
221
  onModifyRowHeaderWidth: null,
228
222
  onModifyGetCellCoords: null,
229
- onModifyGetCoordsElement: null,
230
- onModifyGetCoords: null,
231
223
  onBeforeHighlightingRowHeader: sourceRow => sourceRow,
232
224
  onBeforeHighlightingColumnHeader: sourceCol => sourceCol,
233
225
  onWindowResize: null,
@@ -63,8 +63,6 @@ import { objectEach } from "../../../helpers/object.mjs";
63
63
  * @property {?Option} onCellMouseUp Option `onCellMouseUp`.
64
64
  * @property {?Option} onDraw Option `onDraw`.
65
65
  * @property {?Option} onModifyGetCellCoords Option `onModifyGetCellCoords`.
66
- * @property {?Option} onModifyGetCoordsElement Option `onModifyGetCoordsElement`.
67
- * @property {?Option} onModifyGetCoords Option `onModifyGetCoords`.
68
66
  * @property {?Option} onModifyRowHeaderWidth Option `onModifyRowHeaderWidth`.
69
67
  * @property {?Option} onBeforeViewportScrollHorizontally Option `onBeforeViewportScrollHorizontally`.
70
68
  * @property {?Option} onBeforeViewportScrollVertically Option `onBeforeViewportScrollVertically`.
@@ -75,8 +73,6 @@ import { objectEach } from "../../../helpers/object.mjs";
75
73
  * @property {?Option} selections Option `selections`.
76
74
  * @property {?Option} viewportColumnCalculatorOverride Option `viewportColumnCalculatorOverride`.
77
75
  * @property {?Option} viewportRowCalculatorOverride Option `viewportRowCalculatorOverride`.
78
- * @property {?Option} viewportColumnRenderingThreshold Option `viewportColumnRenderingThreshold`.
79
- * @property {?Option} viewportRowRenderingThreshold Option `viewportRowRenderingThreshold`.
80
76
  */
81
77
  /**
82
78
  * @template TValue.
@@ -192,8 +188,6 @@ export default class Settings {
192
188
  hideBorderOnMouseDownOver: false,
193
189
  viewportRowCalculatorOverride: null,
194
190
  viewportColumnCalculatorOverride: null,
195
- viewportRowRenderingThreshold: null,
196
- viewportColumnRenderingThreshold: null,
197
191
  // callbacks
198
192
  onCellMouseDown: null,
199
193
  onCellContextMenu: null,
@@ -221,8 +215,6 @@ export default class Settings {
221
215
  onBeforeStretchingColumnWidth: width => width,
222
216
  onModifyRowHeaderWidth: null,
223
217
  onModifyGetCellCoords: null,
224
- onModifyGetCoordsElement: null,
225
- onModifyGetCoords: null,
226
218
  onBeforeHighlightingRowHeader: sourceRow => sourceRow,
227
219
  onBeforeHighlightingColumnHeader: sourceCol => sourceCol,
228
220
  onWindowResize: null,
@@ -61,7 +61,7 @@ class MasterTable extends _table.default {
61
61
  } else {
62
62
  trimmingElementParent.appendChild(cloneNode);
63
63
  }
64
- const cloneHeight = parseInt((0, _element.getComputedStyle)(cloneNode, rootWindow).height, 10);
64
+ const cloneHeight = parseInt(rootWindow.getComputedStyle(cloneNode).height, 10);
65
65
  trimmingElementParent.removeChild(cloneNode);
66
66
  if (cloneHeight === 0) {
67
67
  height = 0;
@@ -1,4 +1,4 @@
1
- import { getStyle, getComputedStyle, getTrimmingContainer, isVisible } from "./../../../../helpers/dom/element.mjs";
1
+ import { getStyle, getTrimmingContainer, isVisible } from "./../../../../helpers/dom/element.mjs";
2
2
  import Table from "../table.mjs";
3
3
  import calculatedRows from "./mixin/calculatedRows.mjs";
4
4
  import calculatedColumns from "./mixin/calculatedColumns.mjs";
@@ -57,7 +57,7 @@ class MasterTable extends Table {
57
57
  } else {
58
58
  trimmingElementParent.appendChild(cloneNode);
59
59
  }
60
- const cloneHeight = parseInt(getComputedStyle(cloneNode, rootWindow).height, 10);
60
+ const cloneHeight = parseInt(rootWindow.getComputedStyle(cloneNode).height, 10);
61
61
  trimmingElementParent.removeChild(cloneNode);
62
62
  if (cloneHeight === 0) {
63
63
  height = 0;
@@ -466,7 +466,7 @@ class Table {
466
466
  getCell(coords) {
467
467
  let row = coords.row;
468
468
  let column = coords.col;
469
- const hookResult = this.wtSettings.getSetting('onModifyGetCellCoords', row, column, !this.isMaster, 'render');
469
+ const hookResult = this.wtSettings.getSetting('onModifyGetCellCoords', row, column);
470
470
  if (hookResult && Array.isArray(hookResult)) {
471
471
  [row, column] = hookResult;
472
472
  }
@@ -519,8 +519,9 @@ class Table {
519
519
  } else {
520
520
  return parentElement.childNodes[renderedRowIndex];
521
521
  }
522
+ } else {
523
+ return false;
522
524
  }
523
- return false;
524
525
  }
525
526
 
526
527
  /**
@@ -630,10 +631,6 @@ class Table {
630
631
  } else {
631
632
  col = this.columnFilter.visibleRowHeadedColumnToSourceColumn(col);
632
633
  }
633
- const hookResult = this.wtSettings.getSetting('onModifyGetCoordsElement', row, col);
634
- if (hookResult && Array.isArray(hookResult)) {
635
- [row, col] = hookResult;
636
- }
637
634
  return this.wot.createCellCoords(row, col);
638
635
  }
639
636
 
@@ -462,7 +462,7 @@ class Table {
462
462
  getCell(coords) {
463
463
  let row = coords.row;
464
464
  let column = coords.col;
465
- const hookResult = this.wtSettings.getSetting('onModifyGetCellCoords', row, column, !this.isMaster, 'render');
465
+ const hookResult = this.wtSettings.getSetting('onModifyGetCellCoords', row, column);
466
466
  if (hookResult && Array.isArray(hookResult)) {
467
467
  [row, column] = hookResult;
468
468
  }
@@ -515,8 +515,9 @@ class Table {
515
515
  } else {
516
516
  return parentElement.childNodes[renderedRowIndex];
517
517
  }
518
+ } else {
519
+ return false;
518
520
  }
519
- return false;
520
521
  }
521
522
 
522
523
  /**
@@ -626,10 +627,6 @@ class Table {
626
627
  } else {
627
628
  col = this.columnFilter.visibleRowHeadedColumnToSourceColumn(col);
628
629
  }
629
- const hookResult = this.wtSettings.getSetting('onModifyGetCoordsElement', row, col);
630
- if (hookResult && Array.isArray(hookResult)) {
631
- [row, col] = hookResult;
632
- }
633
630
  return this.wot.createCellCoords(row, col);
634
631
  }
635
632
 
@@ -403,22 +403,11 @@ class Viewport {
403
403
  }
404
404
  const {
405
405
  startRow: renderedStartRow,
406
- endRow: renderedEndRow,
407
- rowStartOffset,
408
- rowEndOffset
406
+ endRow: renderedEndRow
409
407
  } = this.rowsRenderCalculator;
410
- const totalRows = this.wtSettings.getSetting('totalRows') - 1;
411
- const renderingThreshold = this.wtSettings.getSetting('viewportRowRenderingThreshold');
412
- if (Number.isInteger(renderingThreshold) && renderingThreshold > 0) {
413
- startRow = Math.max(0, startRow - Math.min(rowStartOffset, renderingThreshold));
414
- endRow = Math.min(totalRows, endRow + Math.min(rowEndOffset, renderingThreshold));
415
- } else if (renderingThreshold === 'auto') {
416
- startRow = Math.max(0, startRow - Math.ceil(rowStartOffset / 2));
417
- endRow = Math.min(totalRows, endRow + Math.ceil(rowEndOffset / 2));
418
- }
419
408
  if (startRow < renderedStartRow || startRow === renderedStartRow && startRow > 0) {
420
409
  return false;
421
- } else if (endRow > renderedEndRow || endRow === renderedEndRow && endRow < totalRows) {
410
+ } else if (endRow > renderedEndRow || endRow === renderedEndRow && endRow < this.wtSettings.getSetting('totalRows') - 1) {
422
411
  return false;
423
412
  }
424
413
  return true;
@@ -452,22 +441,11 @@ class Viewport {
452
441
  }
453
442
  const {
454
443
  startColumn: renderedStartColumn,
455
- endColumn: renderedEndColumn,
456
- columnStartOffset,
457
- columnEndOffset
444
+ endColumn: renderedEndColumn
458
445
  } = this.columnsRenderCalculator;
459
- const totalColumns = this.wtSettings.getSetting('totalColumns') - 1;
460
- const renderingThreshold = this.wtSettings.getSetting('viewportColumnRenderingThreshold');
461
- if (Number.isInteger(renderingThreshold) && renderingThreshold > 0) {
462
- startColumn = Math.max(0, startColumn - Math.min(columnStartOffset, renderingThreshold));
463
- endColumn = Math.min(totalColumns, endColumn + Math.min(columnEndOffset, renderingThreshold));
464
- } else if (renderingThreshold === 'auto') {
465
- startColumn = Math.max(0, startColumn - Math.ceil(columnStartOffset / 2));
466
- endColumn = Math.min(totalColumns, endColumn + Math.ceil(columnEndOffset / 2));
467
- }
468
446
  if (startColumn < renderedStartColumn || startColumn === renderedStartColumn && startColumn > 0) {
469
447
  return false;
470
- } else if (endColumn > renderedEndColumn || endColumn === renderedEndColumn && endColumn < totalColumns) {
448
+ } else if (endColumn > renderedEndColumn || endColumn === renderedEndColumn && endColumn < this.wtSettings.getSetting('totalColumns') - 1) {
471
449
  return false;
472
450
  }
473
451
  return true;
@@ -400,22 +400,11 @@ class Viewport {
400
400
  }
401
401
  const {
402
402
  startRow: renderedStartRow,
403
- endRow: renderedEndRow,
404
- rowStartOffset,
405
- rowEndOffset
403
+ endRow: renderedEndRow
406
404
  } = this.rowsRenderCalculator;
407
- const totalRows = this.wtSettings.getSetting('totalRows') - 1;
408
- const renderingThreshold = this.wtSettings.getSetting('viewportRowRenderingThreshold');
409
- if (Number.isInteger(renderingThreshold) && renderingThreshold > 0) {
410
- startRow = Math.max(0, startRow - Math.min(rowStartOffset, renderingThreshold));
411
- endRow = Math.min(totalRows, endRow + Math.min(rowEndOffset, renderingThreshold));
412
- } else if (renderingThreshold === 'auto') {
413
- startRow = Math.max(0, startRow - Math.ceil(rowStartOffset / 2));
414
- endRow = Math.min(totalRows, endRow + Math.ceil(rowEndOffset / 2));
415
- }
416
405
  if (startRow < renderedStartRow || startRow === renderedStartRow && startRow > 0) {
417
406
  return false;
418
- } else if (endRow > renderedEndRow || endRow === renderedEndRow && endRow < totalRows) {
407
+ } else if (endRow > renderedEndRow || endRow === renderedEndRow && endRow < this.wtSettings.getSetting('totalRows') - 1) {
419
408
  return false;
420
409
  }
421
410
  return true;
@@ -449,22 +438,11 @@ class Viewport {
449
438
  }
450
439
  const {
451
440
  startColumn: renderedStartColumn,
452
- endColumn: renderedEndColumn,
453
- columnStartOffset,
454
- columnEndOffset
441
+ endColumn: renderedEndColumn
455
442
  } = this.columnsRenderCalculator;
456
- const totalColumns = this.wtSettings.getSetting('totalColumns') - 1;
457
- const renderingThreshold = this.wtSettings.getSetting('viewportColumnRenderingThreshold');
458
- if (Number.isInteger(renderingThreshold) && renderingThreshold > 0) {
459
- startColumn = Math.max(0, startColumn - Math.min(columnStartOffset, renderingThreshold));
460
- endColumn = Math.min(totalColumns, endColumn + Math.min(columnEndOffset, renderingThreshold));
461
- } else if (renderingThreshold === 'auto') {
462
- startColumn = Math.max(0, startColumn - Math.ceil(columnStartOffset / 2));
463
- endColumn = Math.min(totalColumns, endColumn + Math.ceil(columnEndOffset / 2));
464
- }
465
443
  if (startColumn < renderedStartColumn || startColumn === renderedStartColumn && startColumn > 0) {
466
444
  return false;
467
- } else if (endColumn > renderedEndColumn || endColumn === renderedEndColumn && endColumn < totalColumns) {
445
+ } else if (endColumn > renderedEndColumn || endColumn === renderedEndColumn && endColumn < this.wtSettings.getSetting('totalColumns') - 1) {
468
446
  return false;
469
447
  }
470
448
  return true;
package/base.js CHANGED
@@ -4,7 +4,7 @@ exports.__esModule = true;
4
4
  var _core = _interopRequireDefault(require("./core"));
5
5
  var _rootInstance = require("./utils/rootInstance");
6
6
  var _dataMap = require("./dataMap");
7
- var _hooks = require("./core/hooks");
7
+ var _pluginHooks = _interopRequireDefault(require("./pluginHooks"));
8
8
  var _registry = require("./i18n/registry");
9
9
  var _registry2 = require("./cellTypes/registry");
10
10
  var _textType = require("./cellTypes/textType");
@@ -41,12 +41,12 @@ Handsontable.Core = function (rootElement) {
41
41
  return new _core.default(rootElement, userSettings, _rootInstance.rootInstanceSymbol);
42
42
  };
43
43
  Handsontable.DefaultSettings = (0, _dataMap.metaSchemaFactory)();
44
- Handsontable.hooks = _hooks.Hooks.getSingleton();
44
+ Handsontable.hooks = _pluginHooks.default.getSingleton();
45
45
  Handsontable.CellCoords = _src.CellCoords;
46
46
  Handsontable.CellRange = _src.CellRange;
47
47
  Handsontable.packageName = 'handsontable';
48
- Handsontable.buildDate = "24/09/2024 12:48:10";
49
- Handsontable.version = "0.0.0-next-fad35d5-20240924";
48
+ Handsontable.buildDate = "27/09/2024 11:04:37";
49
+ Handsontable.version = "0.0.0-next-d7edb4b-20240927";
50
50
  Handsontable.languages = {
51
51
  dictionaryKeys: _registry.dictionaryKeys,
52
52
  getLanguageDictionary: _registry.getLanguageDictionary,
package/base.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import Core from "./core.mjs";
2
2
  import { rootInstanceSymbol } from "./utils/rootInstance.mjs";
3
3
  import { metaSchemaFactory } from "./dataMap/index.mjs";
4
- import { Hooks } from "./core/hooks/index.mjs"; // FIXME: Bug in eslint-plugin-import: https://github.com/benmosher/eslint-plugin-import/issues/1883
4
+ import Hooks from "./pluginHooks.mjs"; // FIXME: Bug in eslint-plugin-import: https://github.com/benmosher/eslint-plugin-import/issues/1883
5
5
  /* eslint-disable import/named */
6
6
  import { dictionaryKeys, getTranslatedPhrase, registerLanguageDictionary, getLanguagesDictionaries, getLanguageDictionary } from "./i18n/registry.mjs";
7
7
  /* eslint-enable import/named */
@@ -35,8 +35,8 @@ Handsontable.hooks = Hooks.getSingleton();
35
35
  Handsontable.CellCoords = CellCoords;
36
36
  Handsontable.CellRange = CellRange;
37
37
  Handsontable.packageName = 'handsontable';
38
- Handsontable.buildDate = "24/09/2024 12:48:16";
39
- Handsontable.version = "0.0.0-next-fad35d5-20240924";
38
+ Handsontable.buildDate = "27/09/2024 11:04:43";
39
+ Handsontable.version = "0.0.0-next-d7edb4b-20240927";
40
40
  Handsontable.languages = {
41
41
  dictionaryKeys,
42
42
  getLanguageDictionary,
package/core.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { IndexMapper } from './translations';
2
- import { Events } from './core/hooks';
2
+ import { Events } from './pluginHooks';
3
3
  import {
4
4
  CellValue,
5
5
  RowObject,
package/core.js CHANGED
@@ -34,7 +34,7 @@ var _data = require("./helpers/data");
34
34
  var _translations = require("./translations");
35
35
  var _rootInstance = require("./utils/rootInstance");
36
36
  var _src = require("./3rdparty/walkontable/src");
37
- var _hooks = require("./core/hooks");
37
+ var _pluginHooks = _interopRequireDefault(require("./pluginHooks"));
38
38
  var _registry5 = require("./i18n/registry");
39
39
  var _utils = require("./i18n/utils");
40
40
  var _selection = require("./selection");
@@ -2293,11 +2293,10 @@ function Core(rootElement, userSettings) {
2293
2293
  } else if (i === 'tableClassName' && instance.table) {
2294
2294
  setClassName('tableClassName', settings.tableClassName);
2295
2295
  instance.view._wt.wtOverlays.syncOverlayTableClassNames();
2296
- } else if (_hooks.Hooks.getSingleton().isRegistered(i) || _hooks.Hooks.getSingleton().isDeprecated(i)) {
2297
- if ((0, _function.isFunction)(settings[i])) {
2298
- _hooks.Hooks.getSingleton().addAsFixed(i, settings[i], instance);
2299
- } else if (Array.isArray(settings[i])) {
2300
- _hooks.Hooks.getSingleton().add(i, settings[i], instance);
2296
+ } else if (_pluginHooks.default.getSingleton().isRegistered(i) || _pluginHooks.default.getSingleton().isDeprecated(i)) {
2297
+ if ((0, _function.isFunction)(settings[i]) || Array.isArray(settings[i])) {
2298
+ settings[i].initialHook = true;
2299
+ instance.addHook(i, settings[i]);
2301
2300
  }
2302
2301
  } else if (!init && (0, _object.hasOwnProperty)(settings, i)) {
2303
2302
  // Update settings
@@ -4192,7 +4191,7 @@ function Core(rootElement, userSettings) {
4192
4191
  pluginsRegistry.clear();
4193
4192
  instance.runHooks('afterDestroy');
4194
4193
  }, true);
4195
- _hooks.Hooks.getSingleton().destroy(instance);
4194
+ _pluginHooks.default.getSingleton().destroy(instance);
4196
4195
  (0, _object.objectEach)(instance, (property, key, obj) => {
4197
4196
  // replace instance methods with post mortem
4198
4197
  if ((0, _function.isFunction)(property)) {
@@ -4456,7 +4455,7 @@ function Core(rootElement, userSettings) {
4456
4455
  * ```
4457
4456
  */
4458
4457
  this.addHook = function (key, callback, orderIndex) {
4459
- _hooks.Hooks.getSingleton().add(key, callback, instance, orderIndex);
4458
+ _pluginHooks.default.getSingleton().add(key, callback, instance, orderIndex);
4460
4459
  };
4461
4460
 
4462
4461
  /**
@@ -4475,7 +4474,7 @@ function Core(rootElement, userSettings) {
4475
4474
  * ```
4476
4475
  */
4477
4476
  this.hasHook = function (key) {
4478
- return _hooks.Hooks.getSingleton().has(key, instance) || _hooks.Hooks.getSingleton().has(key);
4477
+ return _pluginHooks.default.getSingleton().has(key, instance) || _pluginHooks.default.getSingleton().has(key);
4479
4478
  };
4480
4479
 
4481
4480
  /**
@@ -4497,7 +4496,7 @@ function Core(rootElement, userSettings) {
4497
4496
  * ```
4498
4497
  */
4499
4498
  this.addHookOnce = function (key, callback, orderIndex) {
4500
- _hooks.Hooks.getSingleton().once(key, callback, instance, orderIndex);
4499
+ _pluginHooks.default.getSingleton().once(key, callback, instance, orderIndex);
4501
4500
  };
4502
4501
 
4503
4502
  /**
@@ -4515,7 +4514,7 @@ function Core(rootElement, userSettings) {
4515
4514
  * ```
4516
4515
  */
4517
4516
  this.removeHook = function (key, callback) {
4518
- _hooks.Hooks.getSingleton().remove(key, callback, instance);
4517
+ _pluginHooks.default.getSingleton().remove(key, callback, instance);
4519
4518
  };
4520
4519
 
4521
4520
  /**
@@ -4542,7 +4541,7 @@ function Core(rootElement, userSettings) {
4542
4541
  * ```
4543
4542
  */
4544
4543
  this.runHooks = function (key, p1, p2, p3, p4, p5, p6) {
4545
- return _hooks.Hooks.getSingleton().run(instance, key, p1, p2, p3, p4, p5, p6);
4544
+ return _pluginHooks.default.getSingleton().run(instance, key, p1, p2, p3, p4, p5, p6);
4546
4545
  };
4547
4546
 
4548
4547
  /**
@@ -4732,5 +4731,5 @@ function Core(rootElement, userSettings) {
4732
4731
  });
4733
4732
  (0, _shortcutContexts.registerAllShortcutContexts)(instance);
4734
4733
  shortcutManager.setActiveContextName('grid');
4735
- _hooks.Hooks.getSingleton().run(instance, 'construct');
4734
+ _pluginHooks.default.getSingleton().run(instance, 'construct');
4736
4735
  }
package/core.mjs CHANGED
@@ -30,7 +30,7 @@ import { spreadsheetColumnLabel } from "./helpers/data.mjs";
30
30
  import { IndexMapper } from "./translations/index.mjs";
31
31
  import { registerAsRootInstance, hasValidParameter, isRootInstance } from "./utils/rootInstance.mjs";
32
32
  import { DEFAULT_COLUMN_WIDTH } from "./3rdparty/walkontable/src/index.mjs";
33
- import { Hooks } from "./core/hooks/index.mjs";
33
+ import Hooks from "./pluginHooks.mjs";
34
34
  import { hasLanguageDictionary, getValidLanguageCode, getTranslatedPhrase } from "./i18n/registry.mjs";
35
35
  import { warnUserAboutLanguageRegistration, normalizeLanguageCode } from "./i18n/utils.mjs";
36
36
  import { Selection } from "./selection/index.mjs";
@@ -2289,10 +2289,9 @@ export default function Core(rootElement, userSettings) {
2289
2289
  setClassName('tableClassName', settings.tableClassName);
2290
2290
  instance.view._wt.wtOverlays.syncOverlayTableClassNames();
2291
2291
  } else if (Hooks.getSingleton().isRegistered(i) || Hooks.getSingleton().isDeprecated(i)) {
2292
- if (isFunction(settings[i])) {
2293
- Hooks.getSingleton().addAsFixed(i, settings[i], instance);
2294
- } else if (Array.isArray(settings[i])) {
2295
- Hooks.getSingleton().add(i, settings[i], instance);
2292
+ if (isFunction(settings[i]) || Array.isArray(settings[i])) {
2293
+ settings[i].initialHook = true;
2294
+ instance.addHook(i, settings[i]);
2296
2295
  }
2297
2296
  } else if (!init && hasOwnProperty(settings, i)) {
2298
2297
  // Update settings
@@ -4681,7 +4681,7 @@ var _default = () => {
4681
4681
  * - [Performance: Define the number of pre-rendered rows and columns](@/guides/optimization/performance/performance.md#define-the-number-of-pre-rendered-rows-and-columns)
4682
4682
  *
4683
4683
  * @memberof Options#
4684
- * @type {number|'auto'}
4684
+ * @type {number|string}
4685
4685
  * @default 'auto'
4686
4686
  * @category Core
4687
4687
  *
@@ -4711,7 +4711,7 @@ var _default = () => {
4711
4711
  * - [Column virtualization](@/guides/columns/column-virtualization/column-virtualization.md)
4712
4712
  *
4713
4713
  * @memberof Options#
4714
- * @type {number|'auto'}
4714
+ * @type {number|string}
4715
4715
  * @default 'auto'
4716
4716
  * @category Core
4717
4717
  *
@@ -4722,72 +4722,6 @@ var _default = () => {
4722
4722
  * ```
4723
4723
  */
4724
4724
  viewportRowRenderingOffset: 'auto',
4725
- /**
4726
- * @description
4727
- * The `viewportColumnRenderingThreshold` option configures what column number starting from the left or right
4728
- * (depends on the scroll direction) should trigger the rendering of columns outside of the grid's viewport.
4729
- *
4730
- * You can set the `viewportColumnRenderingThreshold` option to one of the following:
4731
- *
4732
- * | Setting | Description |
4733
- * | ------------------ | ------------------------------------------------------- |
4734
- * | `auto` | Triggers rendering at half the offset defined by [`viewportColumnRenderingOffset`](#viewportColumnRenderingOffset) option |
4735
- * | A number | Sets the offset manually (`0` is a default) |
4736
- *
4737
- * The `viewportColumnRenderingThreshold` setting is ignored when [`renderAllColumn`](#renderAllColumn) is set to `true`.
4738
- *
4739
- * Read more:
4740
- * - [Performance: Define the number of pre-rendered rows and columns](@/guides/optimization/performance/performance.md#define-the-number-of-pre-rendered-rows-and-columns)
4741
- * - [Column virtualization](@/guides/columns/column-virtualization/column-virtualization.md)
4742
- *
4743
- * @memberof Options#
4744
- * @since 1.14.7
4745
- * @type {number|'auto'}
4746
- * @default 0
4747
- * @category Core
4748
- *
4749
- * @example
4750
- * ```js
4751
- * // render 12 columns outside of the grid's viewport
4752
- * viewportColumnRenderingOffset: 12,
4753
- * // the columns outside of the viewport will be rendered when the user scrolls to the 8th column from/to
4754
- * viewportColumnRenderingThreshold: 8,
4755
- * ```
4756
- */
4757
- viewportColumnRenderingThreshold: 0,
4758
- /**
4759
- * @description
4760
- * The `viewportRowRenderingThreshold` option configures what row number starting from the top or bottom
4761
- * (depends on the scroll direction) should trigger the rendering of rows outside of the grid's viewport.
4762
- *
4763
- * You can set the `viewportRowRenderingThreshold` option to one of the following:
4764
- *
4765
- * | Setting | Description |
4766
- * | ------------------ | ------------------------------------------------------- |
4767
- * | `auto` | Triggers rendering at half the offset defined by [`viewportRowRenderingOffset`](#viewportRowRenderingOffset) option |
4768
- * | A number | Sets the offset manually (`0` is a default) |
4769
- *
4770
- * The `viewportRowRenderingThreshold` setting is ignored when [`renderAllRows`](#renderAllRows) is set to `true`.
4771
- *
4772
- * Read more:
4773
- * - [Performance: Define the number of pre-rendered rows and columns](@/guides/optimization/performance/performance.md#define-the-number-of-pre-rendered-rows-and-columns)
4774
- * - [Row virtualization](@/guides/rows/row-virtualization/row-virtualization.md)
4775
- *
4776
- * @memberof Options#
4777
- * @since 1.14.7
4778
- * @type {number|'auto'}
4779
- * @default 0
4780
- * @category Core
4781
- *
4782
- * @example
4783
- * ```js
4784
- * // render 12 rows outside of the grid's viewport
4785
- * viewportRowRenderingOffset: 12,
4786
- * // the rows outside of the viewport will be rendered when the user scrolls to the 8th row from/to
4787
- * viewportRowRenderingThreshold: 8,
4788
- * ```
4789
- */
4790
- viewportRowRenderingThreshold: 0,
4791
4725
  /**
4792
4726
  * The `visibleRows` option sets the height of the [`autocomplete`](@/guides/cell-types/autocomplete-cell-type/autocomplete-cell-type.md)
4793
4727
  * and [`dropdown`](@/guides/cell-types/dropdown-cell-type/dropdown-cell-type.md) lists.