handsontable 0.0.0-next-f748da8-20240318 → 0.0.0-next-76fc9bd-20240319

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 (96) hide show
  1. package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
  2. package/3rdparty/walkontable/src/cell/range.js +5 -22
  3. package/3rdparty/walkontable/src/cell/range.mjs +5 -22
  4. package/base.js +2 -2
  5. package/base.mjs +2 -2
  6. package/core/viewportScroll/index.js +1 -4
  7. package/core/viewportScroll/index.mjs +1 -4
  8. package/core.d.ts +3 -4
  9. package/core.js +21 -76
  10. package/core.mjs +21 -76
  11. package/dist/handsontable.css +2 -2
  12. package/dist/handsontable.full.css +2 -2
  13. package/dist/handsontable.full.js +1359 -2612
  14. package/dist/handsontable.full.min.css +2 -2
  15. package/dist/handsontable.full.min.js +64 -64
  16. package/dist/handsontable.js +1363 -2616
  17. package/dist/handsontable.min.css +2 -2
  18. package/dist/handsontable.min.js +19 -19
  19. package/editorManager.js +8 -12
  20. package/editorManager.mjs +8 -12
  21. package/helpers/mixed.js +1 -1
  22. package/helpers/mixed.mjs +1 -1
  23. package/package.json +1 -1
  24. package/pluginHooks.d.ts +0 -4
  25. package/pluginHooks.js +1 -69
  26. package/pluginHooks.mjs +1 -69
  27. package/plugins/collapsibleColumns/collapsibleColumns.js +3 -9
  28. package/plugins/collapsibleColumns/collapsibleColumns.mjs +3 -9
  29. package/plugins/columnSorting/columnSorting.js +2 -8
  30. package/plugins/columnSorting/columnSorting.mjs +2 -8
  31. package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
  32. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
  33. package/plugins/mergeCells/calculations/selection.js +70 -1
  34. package/plugins/mergeCells/calculations/selection.mjs +70 -1
  35. package/plugins/mergeCells/cellsCollection.js +0 -116
  36. package/plugins/mergeCells/cellsCollection.mjs +0 -116
  37. package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
  38. package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
  39. package/plugins/mergeCells/mergeCells.js +192 -336
  40. package/plugins/mergeCells/mergeCells.mjs +192 -336
  41. package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
  42. package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
  43. package/plugins/nestedHeaders/nestedHeaders.js +0 -1
  44. package/plugins/nestedHeaders/nestedHeaders.mjs +0 -1
  45. package/plugins/nestedRows/nestedRows.js +3 -9
  46. package/plugins/nestedRows/nestedRows.mjs +3 -9
  47. package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
  48. package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
  49. package/selection/highlight/visualSelection.js +0 -2
  50. package/selection/highlight/visualSelection.mjs +0 -2
  51. package/selection/selection.js +40 -209
  52. package/selection/selection.mjs +39 -208
  53. package/selection/transformation.js +32 -83
  54. package/selection/transformation.mjs +32 -83
  55. package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
  56. package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
  57. package/shortcutContexts/commands/editor/open.js +3 -18
  58. package/shortcutContexts/commands/editor/open.mjs +3 -18
  59. package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
  60. package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
  61. package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
  62. package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
  63. package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
  64. package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
  65. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
  66. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
  67. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
  68. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
  69. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
  70. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
  71. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
  72. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
  73. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
  74. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
  75. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
  76. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
  77. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
  78. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
  79. package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
  80. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
  81. package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
  82. package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
  83. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
  84. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
  85. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
  86. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
  87. package/shortcutContexts/grid.js +9 -3
  88. package/shortcutContexts/grid.mjs +9 -3
  89. package/shortcuts/context.js +1 -2
  90. package/shortcuts/context.mjs +1 -2
  91. package/utils/dataStructures/linkedList.js +1 -6
  92. package/utils/dataStructures/linkedList.mjs +1 -6
  93. package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
  94. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
  95. package/plugins/mergeCells/focusOrder.js +0 -303
  96. package/plugins/mergeCells/focusOrder.mjs +0 -298
@@ -20,7 +20,6 @@ export default class CellRange {
20
20
  }): boolean;
21
21
  isSingleCell(): boolean;
22
22
  isSingleHeader(): boolean;
23
- isHeader(): boolean;
24
23
  containsHeaders(): boolean;
25
24
  getOuterHeight(): number;
26
25
  getOuterWidth(): number;
@@ -36,7 +35,7 @@ export default class CellRange {
36
35
  isOverlappingHorizontally(cellRange: CellRange): boolean;
37
36
  isOverlappingVertically(cellRange: CellRange): boolean;
38
37
  expand(cellCoords: CellCoords): boolean;
39
- expandByRange(expandingRange: CellRange, changeDirection: boolean): boolean;
38
+ expandByRange(expandingRange: CellRange): boolean;
40
39
  getDirection(): DirectionType;
41
40
  setDirection(direction: DirectionType): void;
42
41
  getVerticalDirection(): 'N-S' | 'S-N';
@@ -149,18 +149,6 @@ class CellRange {
149
149
  return (this.from.row < 0 || this.from.col < 0) && this.from.row === this.to.row && this.from.col === this.to.col;
150
150
  }
151
151
 
152
- /**
153
- * Checks if your range covers only headers range (negative coordinates, without any cells).
154
- *
155
- * @returns {boolean}
156
- */
157
- isHeader() {
158
- if (this.from.isHeader() && this.to.isHeader()) {
159
- return true;
160
- }
161
- return this.from.col < 0 && this.to.col < 0 || this.from.row < 0 && this.to.row < 0;
162
- }
163
-
164
152
  /**
165
153
  * Checks if your range overlaps headers range (negative coordinates).
166
154
  *
@@ -345,12 +333,9 @@ class CellRange {
345
333
  * Expand your range with another range (`expandingRange`).
346
334
  *
347
335
  * @param {CellRange} expandingRange A new range.
348
- * @param {boolean} [changeDirection=true] If `true`, the direction of your range is changed to the direction
349
- * of the `expandingRange` range.
350
336
  * @returns {boolean}
351
337
  */
352
338
  expandByRange(expandingRange) {
353
- let changeDirection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
354
339
  if (this.includesRange(expandingRange) || !this.overlaps(expandingRange)) {
355
340
  return false;
356
341
  }
@@ -368,13 +353,11 @@ class CellRange {
368
353
  this.from = finalFrom;
369
354
  this.to = finalTo;
370
355
  this.setDirection(initialDirection);
371
- if (changeDirection) {
372
- if (this.highlight.row === this.getOuterBottomRightCorner().row && this.getVerticalDirection() === 'N-S') {
373
- this.flipDirectionVertically();
374
- }
375
- if (this.highlight.col === this.getOuterTopRightCorner().col && this.getHorizontalDirection() === 'W-E') {
376
- this.flipDirectionHorizontally();
377
- }
356
+ if (this.highlight.row === this.getOuterBottomRightCorner().row && this.getVerticalDirection() === 'N-S') {
357
+ this.flipDirectionVertically();
358
+ }
359
+ if (this.highlight.col === this.getOuterTopRightCorner().col && this.getHorizontalDirection() === 'W-E') {
360
+ this.flipDirectionHorizontally();
378
361
  }
379
362
  return true;
380
363
  }
@@ -145,18 +145,6 @@ class CellRange {
145
145
  return (this.from.row < 0 || this.from.col < 0) && this.from.row === this.to.row && this.from.col === this.to.col;
146
146
  }
147
147
 
148
- /**
149
- * Checks if your range covers only headers range (negative coordinates, without any cells).
150
- *
151
- * @returns {boolean}
152
- */
153
- isHeader() {
154
- if (this.from.isHeader() && this.to.isHeader()) {
155
- return true;
156
- }
157
- return this.from.col < 0 && this.to.col < 0 || this.from.row < 0 && this.to.row < 0;
158
- }
159
-
160
148
  /**
161
149
  * Checks if your range overlaps headers range (negative coordinates).
162
150
  *
@@ -341,12 +329,9 @@ class CellRange {
341
329
  * Expand your range with another range (`expandingRange`).
342
330
  *
343
331
  * @param {CellRange} expandingRange A new range.
344
- * @param {boolean} [changeDirection=true] If `true`, the direction of your range is changed to the direction
345
- * of the `expandingRange` range.
346
332
  * @returns {boolean}
347
333
  */
348
334
  expandByRange(expandingRange) {
349
- let changeDirection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
350
335
  if (this.includesRange(expandingRange) || !this.overlaps(expandingRange)) {
351
336
  return false;
352
337
  }
@@ -364,13 +349,11 @@ class CellRange {
364
349
  this.from = finalFrom;
365
350
  this.to = finalTo;
366
351
  this.setDirection(initialDirection);
367
- if (changeDirection) {
368
- if (this.highlight.row === this.getOuterBottomRightCorner().row && this.getVerticalDirection() === 'N-S') {
369
- this.flipDirectionVertically();
370
- }
371
- if (this.highlight.col === this.getOuterTopRightCorner().col && this.getHorizontalDirection() === 'W-E') {
372
- this.flipDirectionHorizontally();
373
- }
352
+ if (this.highlight.row === this.getOuterBottomRightCorner().row && this.getVerticalDirection() === 'N-S') {
353
+ this.flipDirectionVertically();
354
+ }
355
+ if (this.highlight.col === this.getOuterTopRightCorner().col && this.getHorizontalDirection() === 'W-E') {
356
+ this.flipDirectionHorizontally();
374
357
  }
375
358
  return true;
376
359
  }
package/base.js CHANGED
@@ -45,8 +45,8 @@ 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 = "18/03/2024 14:25:26";
49
- Handsontable.version = "0.0.0-next-f748da8-20240318";
48
+ Handsontable.buildDate = "19/03/2024 08:48:09";
49
+ Handsontable.version = "0.0.0-next-76fc9bd-20240319";
50
50
  Handsontable.languages = {
51
51
  dictionaryKeys: _registry.dictionaryKeys,
52
52
  getLanguageDictionary: _registry.getLanguageDictionary,
package/base.mjs CHANGED
@@ -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 = "18/03/2024 14:25:31";
39
- Handsontable.version = "0.0.0-next-f748da8-20240318";
38
+ Handsontable.buildDate = "19/03/2024 08:48:15";
39
+ Handsontable.version = "0.0.0-next-76fc9bd-20240319";
40
40
  Handsontable.languages = {
41
41
  dictionaryKeys,
42
42
  getLanguageDictionary,
@@ -4,7 +4,6 @@ exports.__esModule = true;
4
4
  exports.createViewportScroller = createViewportScroller;
5
5
  var _columnHeaderScroll = require("./scrollStrategies/columnHeaderScroll");
6
6
  var _cornerHeaderScroll = require("./scrollStrategies/cornerHeaderScroll");
7
- var _focusScroll = require("./scrollStrategies/focusScroll");
8
7
  var _multipleScroll = require("./scrollStrategies/multipleScroll");
9
8
  var _noncontiguousScroll = require("./scrollStrategies/noncontiguousScroll");
10
9
  var _rowHeaderScroll = require("./scrollStrategies/rowHeaderScroll");
@@ -47,9 +46,7 @@ function createViewportScroller(hot) {
47
46
  return;
48
47
  }
49
48
  let scrollStrategy;
50
- if (selection.isFocusSelectionChanged()) {
51
- scrollStrategy = (0, _focusScroll.focusScrollStrategy)(hot);
52
- } else if (selection.isSelectedByCorner()) {
49
+ if (selection.isSelectedByCorner()) {
53
50
  scrollStrategy = (0, _cornerHeaderScroll.cornerHeaderScrollStrategy)(hot);
54
51
  } else if (selection.isSelectedByRowHeader()) {
55
52
  scrollStrategy = (0, _rowHeaderScroll.rowHeaderScrollStrategy)(hot);
@@ -1,6 +1,5 @@
1
1
  import { columnHeaderScrollStrategy } from "./scrollStrategies/columnHeaderScroll.mjs";
2
2
  import { cornerHeaderScrollStrategy } from "./scrollStrategies/cornerHeaderScroll.mjs";
3
- import { focusScrollStrategy } from "./scrollStrategies/focusScroll.mjs";
4
3
  import { multipleScrollStrategy } from "./scrollStrategies/multipleScroll.mjs";
5
4
  import { noncontiguousScrollStrategy } from "./scrollStrategies/noncontiguousScroll.mjs";
6
5
  import { rowHeaderScrollStrategy } from "./scrollStrategies/rowHeaderScroll.mjs";
@@ -43,9 +42,7 @@ export function createViewportScroller(hot) {
43
42
  return;
44
43
  }
45
44
  let scrollStrategy;
46
- if (selection.isFocusSelectionChanged()) {
47
- scrollStrategy = focusScrollStrategy(hot);
48
- } else if (selection.isSelectedByCorner()) {
45
+ if (selection.isSelectedByCorner()) {
49
46
  scrollStrategy = cornerHeaderScrollStrategy(hot);
50
47
  } else if (selection.isSelectedByRowHeader()) {
51
48
  scrollStrategy = rowHeaderScrollStrategy(hot);
package/core.d.ts CHANGED
@@ -3,7 +3,6 @@ import { Events } from './pluginHooks';
3
3
  import {
4
4
  CellValue,
5
5
  RowObject,
6
- SimpleCellCoords,
7
6
  } from './common';
8
7
  import {
9
8
  GridSettings,
@@ -136,12 +135,12 @@ export default class Core {
136
135
  scrollViewportTo(options: { row?: number, col?: number, verticalSnap?: 'top' | 'bottom', horizontalSnap?: 'start' | 'end', considerHiddenIndexes?: boolean }): boolean;
137
136
  scrollViewportTo(row?: number, column?: number, snapToBottom?: boolean, snapToRight?: boolean, considerHiddenIndexes?: boolean): boolean;
138
137
  scrollToFocusedCell(callback?: () => void): void;
139
- selectAll(includeRowHeaders?: boolean, includeColumnHeaders?: boolean, options?: { focusPosition?: SimpleCellCoords | CellCoords, disableHeadersHighlight?: boolean }): void;
138
+ selectAll(includeRowHeaders?: boolean, includeColumnHeaders?: boolean, options?: { focusPosition?: { row: number, col: number }, disableHeadersHighlight?: boolean }): void;
140
139
  selectCell(row: number, column: number, endRow?: number, endColumn?: number, scrollToCell?: boolean, changeListener?: boolean): boolean;
141
140
  selectCellByProp(row: number, prop: string, endRow?: number, endProp?: string, scrollToCell?: boolean): boolean;
142
141
  selectCells(coords: Array<[number, number | string, number, number | string]> | CellRange[], scrollToCell?: boolean, changeListener?: boolean): boolean;
143
- selectColumns(startColumn: number | string, endColumn?: number | string, focusPosition?: number | SimpleCellCoords | CellCoords): boolean;
144
- selectRows(startRow: number, endRow?: number, focusPosition?: number | SimpleCellCoords | CellCoords): boolean;
142
+ selectColumns(startColumn: number | string, endColumn?: number | string, focusPosition?: number): boolean;
143
+ selectRows(startRow: number, endRow?: number, focusPosition?: number): boolean;
145
144
  setCellMeta(row: number, column: number, key: string, val: any): void;
146
145
  setCellMeta<K extends keyof CellMeta>(row: number, column: number, key: K, val: CellMeta[K]): void;
147
146
  setCellMetaObject(row: number, column: number, prop: CellMeta): void;
package/core.js CHANGED
@@ -273,26 +273,6 @@ function Core(rootElement, userSettings) {
273
273
  renderableRow >= 0 ? instance.rowIndexMapper.getVisualFromRenderableIndex(renderableRow) : renderableRow, renderableColumn >= 0 ? instance.columnIndexMapper.getVisualFromRenderableIndex(renderableColumn) : renderableColumn // eslint-disable-line max-len
274
274
  );
275
275
  };
276
- const findFirstNonHiddenRenderableRow = (visualRowFrom, visualRowTo) => {
277
- const dir = visualRowTo > visualRowFrom ? 1 : -1;
278
- const minIndex = Math.min(visualRowFrom, visualRowTo);
279
- const maxIndex = Math.max(visualRowFrom, visualRowTo);
280
- const rowIndex = instance.rowIndexMapper.getNearestNotHiddenIndex(visualRowFrom, dir);
281
- if (rowIndex === null || dir === 1 && rowIndex > maxIndex || dir === -1 && rowIndex < minIndex) {
282
- return null;
283
- }
284
- return rowIndex >= 0 ? instance.rowIndexMapper.getRenderableFromVisualIndex(rowIndex) : rowIndex;
285
- };
286
- const findFirstNonHiddenRenderableColumn = (visualColumnFrom, visualColumnTo) => {
287
- const dir = visualColumnTo > visualColumnFrom ? 1 : -1;
288
- const minIndex = Math.min(visualColumnFrom, visualColumnTo);
289
- const maxIndex = Math.max(visualColumnFrom, visualColumnTo);
290
- const columnIndex = instance.columnIndexMapper.getNearestNotHiddenIndex(visualColumnFrom, dir);
291
- if (columnIndex === null || dir === 1 && columnIndex > maxIndex || dir === -1 && columnIndex < minIndex) {
292
- return null;
293
- }
294
- return columnIndex >= 0 ? instance.columnIndexMapper.getRenderableFromVisualIndex(columnIndex) : columnIndex;
295
- };
296
276
  let selection = new _selection.Selection(tableMeta, {
297
277
  rowIndexMapper: instance.rowIndexMapper,
298
278
  columnIndexMapper: instance.columnIndexMapper,
@@ -304,19 +284,11 @@ function Core(rootElement, userSettings) {
304
284
  countRenderableRows: () => this.view.countRenderableRows(),
305
285
  countRowHeaders: () => this.countRowHeaders(),
306
286
  countColHeaders: () => this.countColHeaders(),
307
- countRenderableRowsInRange: function () {
308
- return _this.view.countRenderableRowsInRange(...arguments);
309
- },
310
- countRenderableColumnsInRange: function () {
311
- return _this.view.countRenderableColumnsInRange(...arguments);
312
- },
313
287
  getShortcutManager: () => instance.getShortcutManager(),
314
288
  createCellCoords: (row, column) => instance._createCellCoords(row, column),
315
289
  createCellRange: (highlight, from, to) => instance._createCellRange(highlight, from, to),
316
290
  visualToRenderableCoords,
317
291
  renderableToVisualCoords,
318
- findFirstNonHiddenRenderableRow,
319
- findFirstNonHiddenRenderableColumn,
320
292
  isDisabledCellSelection: (visualRow, visualColumn) => {
321
293
  if (visualRow < 0 || visualColumn < 0) {
322
294
  return instance.getSettings().disableVisualSelection;
@@ -367,17 +339,6 @@ function Core(rootElement, userSettings) {
367
339
  }
368
340
  this._refreshBorders(null);
369
341
  });
370
- this.selection.addLocalHook('beforeSetFocus', cellCoords => {
371
- this.runHooks('beforeSelectionFocusSet', cellCoords.row, cellCoords.col);
372
- });
373
- this.selection.addLocalHook('afterSetFocus', cellCoords => {
374
- const preventScrolling = (0, _object.createObjectPropListener)(false);
375
- this.runHooks('afterSelectionFocusSet', cellCoords.row, cellCoords.col, preventScrolling);
376
- if (!preventScrolling.isTouched() || preventScrolling.isTouched() && !preventScrolling.value) {
377
- viewportScroller.scrollTo(cellCoords);
378
- }
379
- this._refreshBorders(null);
380
- });
381
342
  this.selection.addLocalHook('afterSelectionFinished', cellRanges => {
382
343
  const selectionLayerLevel = cellRanges.length - 1;
383
344
  const {
@@ -444,34 +405,24 @@ function Core(rootElement, userSettings) {
444
405
  args[_key9] = arguments[_key9];
445
406
  }
446
407
  return _this.runHooks('afterModifyTransformStart', ...args);
447
- }).addLocalHook('beforeModifyTransformFocus', function () {
408
+ }).addLocalHook('beforeModifyTransformEnd', function () {
448
409
  for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
449
410
  args[_key10] = arguments[_key10];
450
411
  }
451
- return _this.runHooks('modifyTransformFocus', ...args);
452
- }).addLocalHook('afterModifyTransformFocus', function () {
453
- for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
454
- args[_key11] = arguments[_key11];
455
- }
456
- return _this.runHooks('afterModifyTransformFocus', ...args);
457
- }).addLocalHook('beforeModifyTransformEnd', function () {
458
- for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
459
- args[_key12] = arguments[_key12];
460
- }
461
412
  return _this.runHooks('modifyTransformEnd', ...args);
462
413
  }).addLocalHook('afterModifyTransformEnd', function () {
463
- for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
464
- args[_key13] = arguments[_key13];
414
+ for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
415
+ args[_key11] = arguments[_key11];
465
416
  }
466
417
  return _this.runHooks('afterModifyTransformEnd', ...args);
467
418
  }).addLocalHook('beforeRowWrap', function () {
468
- for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
469
- args[_key14] = arguments[_key14];
419
+ for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
420
+ args[_key12] = arguments[_key12];
470
421
  }
471
422
  return _this.runHooks('beforeRowWrap', ...args);
472
423
  }).addLocalHook('beforeColumnWrap', function () {
473
- for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
474
- args[_key15] = arguments[_key15];
424
+ for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
425
+ args[_key13] = arguments[_key13];
475
426
  }
476
427
  return _this.runHooks('beforeColumnWrap', ...args);
477
428
  }).addLocalHook('insertRowRequire', totalRows => this.alter('insert_row_above', totalRows, 1, 'auto')).addLocalHook('insertColRequire', totalCols => this.alter('insert_col_start', totalCols, 1, 'auto'));
@@ -1610,8 +1561,8 @@ function Core(rootElement, userSettings) {
1610
1561
  * @returns {Array} Returns removed portion of columns.
1611
1562
  */
1612
1563
  this.spliceCol = function (column, index, amount) {
1613
- for (var _len16 = arguments.length, elements = new Array(_len16 > 3 ? _len16 - 3 : 0), _key16 = 3; _key16 < _len16; _key16++) {
1614
- elements[_key16 - 3] = arguments[_key16];
1564
+ for (var _len14 = arguments.length, elements = new Array(_len14 > 3 ? _len14 - 3 : 0), _key14 = 3; _key14 < _len14; _key14++) {
1565
+ elements[_key14 - 3] = arguments[_key14];
1615
1566
  }
1616
1567
  return datamap.spliceCol(column, index, amount, ...elements);
1617
1568
  };
@@ -1628,8 +1579,8 @@ function Core(rootElement, userSettings) {
1628
1579
  * @returns {Array} Returns removed portion of rows.
1629
1580
  */
1630
1581
  this.spliceRow = function (row, index, amount) {
1631
- for (var _len17 = arguments.length, elements = new Array(_len17 > 3 ? _len17 - 3 : 0), _key17 = 3; _key17 < _len17; _key17++) {
1632
- elements[_key17 - 3] = arguments[_key17];
1582
+ for (var _len15 = arguments.length, elements = new Array(_len15 > 3 ? _len15 - 3 : 0), _key15 = 3; _key15 < _len15; _key15++) {
1583
+ elements[_key15 - 3] = arguments[_key15];
1633
1584
  }
1634
1585
  return datamap.spliceRow(row, index, amount, ...elements);
1635
1586
  };
@@ -3026,8 +2977,8 @@ function Core(rootElement, userSettings) {
3026
2977
  */
3027
2978
  this.spliceCellsMeta = function (visualIndex) {
3028
2979
  let deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3029
- for (var _len18 = arguments.length, cellMetaRows = new Array(_len18 > 2 ? _len18 - 2 : 0), _key18 = 2; _key18 < _len18; _key18++) {
3030
- cellMetaRows[_key18 - 2] = arguments[_key18];
2980
+ for (var _len16 = arguments.length, cellMetaRows = new Array(_len16 > 2 ? _len16 - 2 : 0), _key16 = 2; _key16 < _len16; _key16++) {
2981
+ cellMetaRows[_key16 - 2] = arguments[_key16];
3031
2982
  }
3032
2983
  if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
3033
2984
  throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
@@ -3949,8 +3900,6 @@ function Core(rootElement, userSettings) {
3949
3900
  * hot.selectColumns(1, 2, -1);
3950
3901
  * // Select range of columns using visual indexes and mark the second cell as highlighted.
3951
3902
  * hot.selectColumns(2, 1, 1);
3952
- * // Select range of columns using visual indexes and move the focus position somewhere in the middle of the range.
3953
- * hot.selectColumns(2, 5, { row: 2, col: 3 });
3954
3903
  * // Select range of columns using column properties.
3955
3904
  * hot.selectColumns('id', 'last_name');
3956
3905
  * ```
@@ -3960,11 +3909,10 @@ function Core(rootElement, userSettings) {
3960
3909
  * @function selectColumns
3961
3910
  * @param {number} startColumn The visual column index from which the selection starts.
3962
3911
  * @param {number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`
3963
- * is not defined the column defined by `startColumn` will be selected.
3964
- * @param {number | { row: number, col: number } | CellCoords} [focusPosition=0] The argument allows changing the cell/header focus
3965
- * position. The value can take visual row index from -N to N, where negative values point to the headers and positive
3966
- * values point to the cell range. An object with `row` and `col` properties also can be passed to change the focus
3967
- * position horizontally.
3912
+ * is not defined the column defined by `startColumn` will be selected.
3913
+ * @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
3914
+ * The value can take visual row index from -N to N, where negative values
3915
+ * point to the headers and positive values point to the cell range.
3968
3916
  * @returns {boolean} `true` if selection was successful, `false` otherwise.
3969
3917
  */
3970
3918
  this.selectColumns = function (startColumn) {
@@ -3986,8 +3934,6 @@ function Core(rootElement, userSettings) {
3986
3934
  * hot.selectRows(1, 2, -1);
3987
3935
  * // Select range of rows using visual indexes and mark the second cell as highlighted.
3988
3936
  * hot.selectRows(2, 1, 1);
3989
- * // Select range of rows using visual indexes and move the focus position somewhere in the middle of the range.
3990
- * hot.selectRows(2, 5, { row: 2, col: 3 });
3991
3937
  * ```
3992
3938
  *
3993
3939
  * @memberof Core#
@@ -3995,11 +3941,10 @@ function Core(rootElement, userSettings) {
3995
3941
  * @function selectRows
3996
3942
  * @param {number} startRow The visual row index from which the selection starts.
3997
3943
  * @param {number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`
3998
- * is not defined the row defined by `startRow` will be selected.
3999
- * @param {number | { row: number, col: number } | CellCoords} [focusPosition=0] The argument allows changing the cell/header focus
4000
- * position. The value can take visual row index from -N to N, where negative values point to the headers and positive
4001
- * values point to the cell range. An object with `row` and `col` properties also can be passed to change the focus
4002
- * position vertically.
3944
+ * is not defined the row defined by `startRow` will be selected.
3945
+ * @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
3946
+ * The value can take visual column index from -N to N, where negative values
3947
+ * point to the headers and positive values point to the cell range.
4003
3948
  * @returns {boolean} `true` if selection was successful, `false` otherwise.
4004
3949
  */
4005
3950
  this.selectRows = function (startRow) {
package/core.mjs CHANGED
@@ -268,26 +268,6 @@ export default function Core(rootElement, userSettings) {
268
268
  renderableRow >= 0 ? instance.rowIndexMapper.getVisualFromRenderableIndex(renderableRow) : renderableRow, renderableColumn >= 0 ? instance.columnIndexMapper.getVisualFromRenderableIndex(renderableColumn) : renderableColumn // eslint-disable-line max-len
269
269
  );
270
270
  };
271
- const findFirstNonHiddenRenderableRow = (visualRowFrom, visualRowTo) => {
272
- const dir = visualRowTo > visualRowFrom ? 1 : -1;
273
- const minIndex = Math.min(visualRowFrom, visualRowTo);
274
- const maxIndex = Math.max(visualRowFrom, visualRowTo);
275
- const rowIndex = instance.rowIndexMapper.getNearestNotHiddenIndex(visualRowFrom, dir);
276
- if (rowIndex === null || dir === 1 && rowIndex > maxIndex || dir === -1 && rowIndex < minIndex) {
277
- return null;
278
- }
279
- return rowIndex >= 0 ? instance.rowIndexMapper.getRenderableFromVisualIndex(rowIndex) : rowIndex;
280
- };
281
- const findFirstNonHiddenRenderableColumn = (visualColumnFrom, visualColumnTo) => {
282
- const dir = visualColumnTo > visualColumnFrom ? 1 : -1;
283
- const minIndex = Math.min(visualColumnFrom, visualColumnTo);
284
- const maxIndex = Math.max(visualColumnFrom, visualColumnTo);
285
- const columnIndex = instance.columnIndexMapper.getNearestNotHiddenIndex(visualColumnFrom, dir);
286
- if (columnIndex === null || dir === 1 && columnIndex > maxIndex || dir === -1 && columnIndex < minIndex) {
287
- return null;
288
- }
289
- return columnIndex >= 0 ? instance.columnIndexMapper.getRenderableFromVisualIndex(columnIndex) : columnIndex;
290
- };
291
271
  let selection = new Selection(tableMeta, {
292
272
  rowIndexMapper: instance.rowIndexMapper,
293
273
  columnIndexMapper: instance.columnIndexMapper,
@@ -299,19 +279,11 @@ export default function Core(rootElement, userSettings) {
299
279
  countRenderableRows: () => this.view.countRenderableRows(),
300
280
  countRowHeaders: () => this.countRowHeaders(),
301
281
  countColHeaders: () => this.countColHeaders(),
302
- countRenderableRowsInRange: function () {
303
- return _this.view.countRenderableRowsInRange(...arguments);
304
- },
305
- countRenderableColumnsInRange: function () {
306
- return _this.view.countRenderableColumnsInRange(...arguments);
307
- },
308
282
  getShortcutManager: () => instance.getShortcutManager(),
309
283
  createCellCoords: (row, column) => instance._createCellCoords(row, column),
310
284
  createCellRange: (highlight, from, to) => instance._createCellRange(highlight, from, to),
311
285
  visualToRenderableCoords,
312
286
  renderableToVisualCoords,
313
- findFirstNonHiddenRenderableRow,
314
- findFirstNonHiddenRenderableColumn,
315
287
  isDisabledCellSelection: (visualRow, visualColumn) => {
316
288
  if (visualRow < 0 || visualColumn < 0) {
317
289
  return instance.getSettings().disableVisualSelection;
@@ -362,17 +334,6 @@ export default function Core(rootElement, userSettings) {
362
334
  }
363
335
  this._refreshBorders(null);
364
336
  });
365
- this.selection.addLocalHook('beforeSetFocus', cellCoords => {
366
- this.runHooks('beforeSelectionFocusSet', cellCoords.row, cellCoords.col);
367
- });
368
- this.selection.addLocalHook('afterSetFocus', cellCoords => {
369
- const preventScrolling = createObjectPropListener(false);
370
- this.runHooks('afterSelectionFocusSet', cellCoords.row, cellCoords.col, preventScrolling);
371
- if (!preventScrolling.isTouched() || preventScrolling.isTouched() && !preventScrolling.value) {
372
- viewportScroller.scrollTo(cellCoords);
373
- }
374
- this._refreshBorders(null);
375
- });
376
337
  this.selection.addLocalHook('afterSelectionFinished', cellRanges => {
377
338
  const selectionLayerLevel = cellRanges.length - 1;
378
339
  const {
@@ -439,34 +400,24 @@ export default function Core(rootElement, userSettings) {
439
400
  args[_key9] = arguments[_key9];
440
401
  }
441
402
  return _this.runHooks('afterModifyTransformStart', ...args);
442
- }).addLocalHook('beforeModifyTransformFocus', function () {
403
+ }).addLocalHook('beforeModifyTransformEnd', function () {
443
404
  for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
444
405
  args[_key10] = arguments[_key10];
445
406
  }
446
- return _this.runHooks('modifyTransformFocus', ...args);
447
- }).addLocalHook('afterModifyTransformFocus', function () {
448
- for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
449
- args[_key11] = arguments[_key11];
450
- }
451
- return _this.runHooks('afterModifyTransformFocus', ...args);
452
- }).addLocalHook('beforeModifyTransformEnd', function () {
453
- for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
454
- args[_key12] = arguments[_key12];
455
- }
456
407
  return _this.runHooks('modifyTransformEnd', ...args);
457
408
  }).addLocalHook('afterModifyTransformEnd', function () {
458
- for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
459
- args[_key13] = arguments[_key13];
409
+ for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
410
+ args[_key11] = arguments[_key11];
460
411
  }
461
412
  return _this.runHooks('afterModifyTransformEnd', ...args);
462
413
  }).addLocalHook('beforeRowWrap', function () {
463
- for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
464
- args[_key14] = arguments[_key14];
414
+ for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
415
+ args[_key12] = arguments[_key12];
465
416
  }
466
417
  return _this.runHooks('beforeRowWrap', ...args);
467
418
  }).addLocalHook('beforeColumnWrap', function () {
468
- for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
469
- args[_key15] = arguments[_key15];
419
+ for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
420
+ args[_key13] = arguments[_key13];
470
421
  }
471
422
  return _this.runHooks('beforeColumnWrap', ...args);
472
423
  }).addLocalHook('insertRowRequire', totalRows => this.alter('insert_row_above', totalRows, 1, 'auto')).addLocalHook('insertColRequire', totalCols => this.alter('insert_col_start', totalCols, 1, 'auto'));
@@ -1605,8 +1556,8 @@ export default function Core(rootElement, userSettings) {
1605
1556
  * @returns {Array} Returns removed portion of columns.
1606
1557
  */
1607
1558
  this.spliceCol = function (column, index, amount) {
1608
- for (var _len16 = arguments.length, elements = new Array(_len16 > 3 ? _len16 - 3 : 0), _key16 = 3; _key16 < _len16; _key16++) {
1609
- elements[_key16 - 3] = arguments[_key16];
1559
+ for (var _len14 = arguments.length, elements = new Array(_len14 > 3 ? _len14 - 3 : 0), _key14 = 3; _key14 < _len14; _key14++) {
1560
+ elements[_key14 - 3] = arguments[_key14];
1610
1561
  }
1611
1562
  return datamap.spliceCol(column, index, amount, ...elements);
1612
1563
  };
@@ -1623,8 +1574,8 @@ export default function Core(rootElement, userSettings) {
1623
1574
  * @returns {Array} Returns removed portion of rows.
1624
1575
  */
1625
1576
  this.spliceRow = function (row, index, amount) {
1626
- for (var _len17 = arguments.length, elements = new Array(_len17 > 3 ? _len17 - 3 : 0), _key17 = 3; _key17 < _len17; _key17++) {
1627
- elements[_key17 - 3] = arguments[_key17];
1577
+ for (var _len15 = arguments.length, elements = new Array(_len15 > 3 ? _len15 - 3 : 0), _key15 = 3; _key15 < _len15; _key15++) {
1578
+ elements[_key15 - 3] = arguments[_key15];
1628
1579
  }
1629
1580
  return datamap.spliceRow(row, index, amount, ...elements);
1630
1581
  };
@@ -3021,8 +2972,8 @@ export default function Core(rootElement, userSettings) {
3021
2972
  */
3022
2973
  this.spliceCellsMeta = function (visualIndex) {
3023
2974
  let deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3024
- for (var _len18 = arguments.length, cellMetaRows = new Array(_len18 > 2 ? _len18 - 2 : 0), _key18 = 2; _key18 < _len18; _key18++) {
3025
- cellMetaRows[_key18 - 2] = arguments[_key18];
2975
+ for (var _len16 = arguments.length, cellMetaRows = new Array(_len16 > 2 ? _len16 - 2 : 0), _key16 = 2; _key16 < _len16; _key16++) {
2976
+ cellMetaRows[_key16 - 2] = arguments[_key16];
3026
2977
  }
3027
2978
  if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
3028
2979
  throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
@@ -3944,8 +3895,6 @@ export default function Core(rootElement, userSettings) {
3944
3895
  * hot.selectColumns(1, 2, -1);
3945
3896
  * // Select range of columns using visual indexes and mark the second cell as highlighted.
3946
3897
  * hot.selectColumns(2, 1, 1);
3947
- * // Select range of columns using visual indexes and move the focus position somewhere in the middle of the range.
3948
- * hot.selectColumns(2, 5, { row: 2, col: 3 });
3949
3898
  * // Select range of columns using column properties.
3950
3899
  * hot.selectColumns('id', 'last_name');
3951
3900
  * ```
@@ -3955,11 +3904,10 @@ export default function Core(rootElement, userSettings) {
3955
3904
  * @function selectColumns
3956
3905
  * @param {number} startColumn The visual column index from which the selection starts.
3957
3906
  * @param {number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`
3958
- * is not defined the column defined by `startColumn` will be selected.
3959
- * @param {number | { row: number, col: number } | CellCoords} [focusPosition=0] The argument allows changing the cell/header focus
3960
- * position. The value can take visual row index from -N to N, where negative values point to the headers and positive
3961
- * values point to the cell range. An object with `row` and `col` properties also can be passed to change the focus
3962
- * position horizontally.
3907
+ * is not defined the column defined by `startColumn` will be selected.
3908
+ * @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
3909
+ * The value can take visual row index from -N to N, where negative values
3910
+ * point to the headers and positive values point to the cell range.
3963
3911
  * @returns {boolean} `true` if selection was successful, `false` otherwise.
3964
3912
  */
3965
3913
  this.selectColumns = function (startColumn) {
@@ -3981,8 +3929,6 @@ export default function Core(rootElement, userSettings) {
3981
3929
  * hot.selectRows(1, 2, -1);
3982
3930
  * // Select range of rows using visual indexes and mark the second cell as highlighted.
3983
3931
  * hot.selectRows(2, 1, 1);
3984
- * // Select range of rows using visual indexes and move the focus position somewhere in the middle of the range.
3985
- * hot.selectRows(2, 5, { row: 2, col: 3 });
3986
3932
  * ```
3987
3933
  *
3988
3934
  * @memberof Core#
@@ -3990,11 +3936,10 @@ export default function Core(rootElement, userSettings) {
3990
3936
  * @function selectRows
3991
3937
  * @param {number} startRow The visual row index from which the selection starts.
3992
3938
  * @param {number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`
3993
- * is not defined the row defined by `startRow` will be selected.
3994
- * @param {number | { row: number, col: number } | CellCoords} [focusPosition=0] The argument allows changing the cell/header focus
3995
- * position. The value can take visual row index from -N to N, where negative values point to the headers and positive
3996
- * values point to the cell range. An object with `row` and `col` properties also can be passed to change the focus
3997
- * position vertically.
3939
+ * is not defined the row defined by `startRow` will be selected.
3940
+ * @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
3941
+ * The value can take visual column index from -N to N, where negative values
3942
+ * point to the headers and positive values point to the cell range.
3998
3943
  * @returns {boolean} `true` if selection was successful, `false` otherwise.
3999
3944
  */
4000
3945
  this.selectRows = function (startRow) {
@@ -25,8 +25,8 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-f748da8-20240318
29
- * Release date: 06/03/2024 (built at 18/03/2024 14:25:36)
28
+ * Version: 0.0.0-next-76fc9bd-20240319
29
+ * Release date: 06/03/2024 (built at 19/03/2024 08:48:19)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles
@@ -25,8 +25,8 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-f748da8-20240318
29
- * Release date: 06/03/2024 (built at 18/03/2024 14:25:36)
28
+ * Version: 0.0.0-next-76fc9bd-20240319
29
+ * Release date: 06/03/2024 (built at 19/03/2024 08:48:19)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles