handsontable 0.0.0-next-cecf979-20231026 → 0.0.0-next-e54c3d6-20231026

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 (47) hide show
  1. package/3rdparty/walkontable/src/cell/coords.d.ts +2 -0
  2. package/3rdparty/walkontable/src/cell/coords.js +29 -0
  3. package/3rdparty/walkontable/src/cell/coords.mjs +29 -0
  4. package/base.js +2 -2
  5. package/base.mjs +2 -2
  6. package/core/focusCatcher/index.js +26 -20
  7. package/core/focusCatcher/index.mjs +26 -20
  8. package/core.js +65 -53
  9. package/core.mjs +65 -53
  10. package/dist/handsontable.css +2 -2
  11. package/dist/handsontable.full.css +2 -2
  12. package/dist/handsontable.full.js +3602 -2219
  13. package/dist/handsontable.full.min.css +2 -2
  14. package/dist/handsontable.full.min.js +88 -81
  15. package/dist/handsontable.js +3603 -2220
  16. package/dist/handsontable.min.css +2 -2
  17. package/dist/handsontable.min.js +30 -23
  18. package/helpers/mixed.js +1 -1
  19. package/helpers/mixed.mjs +1 -1
  20. package/package.json +1 -1
  21. package/pluginHooks.d.ts +30 -6
  22. package/pluginHooks.js +148 -62
  23. package/pluginHooks.mjs +148 -62
  24. package/plugins/copyPaste/clipboardData/clipboardData.js +517 -0
  25. package/plugins/copyPaste/clipboardData/clipboardData.mjs +512 -0
  26. package/plugins/copyPaste/clipboardData/copyClipboardData.js +69 -0
  27. package/plugins/copyPaste/clipboardData/copyClipboardData.mjs +65 -0
  28. package/plugins/copyPaste/clipboardData/index.js +9 -0
  29. package/plugins/copyPaste/clipboardData/index.mjs +4 -0
  30. package/plugins/copyPaste/clipboardData/pasteClipboardData.js +81 -0
  31. package/plugins/copyPaste/clipboardData/pasteClipboardData.mjs +77 -0
  32. package/plugins/copyPaste/copyPaste.js +38 -92
  33. package/plugins/copyPaste/copyPaste.mjs +40 -94
  34. package/plugins/nestedHeaders/nestedHeaders.js +21 -22
  35. package/plugins/nestedHeaders/nestedHeaders.mjs +21 -22
  36. package/selection/selection.js +12 -0
  37. package/selection/selection.mjs +12 -0
  38. package/selection/transformation.js +42 -44
  39. package/selection/transformation.mjs +42 -44
  40. package/shortcutContexts/grid.js +4 -0
  41. package/shortcutContexts/grid.mjs +4 -0
  42. package/utils/parseTable.js +527 -83
  43. package/utils/parseTable.mjs +523 -82
  44. package/plugins/copyPaste/clipboardData.js +0 -18
  45. package/plugins/copyPaste/clipboardData.mjs +0 -14
  46. package/plugins/copyPaste/pasteEvent.js +0 -14
  47. package/plugins/copyPaste/pasteEvent.mjs +0 -9
@@ -10,12 +10,14 @@ export default class CellCoords {
10
10
  countRowHeaders?: number;
11
11
  countColHeaders?: number;
12
12
  }): boolean;
13
+ isRtl(): boolean;
13
14
  isEqual(cellCoords: CellCoords): boolean;
14
15
  isSouthEastOf(testedCoords: any): boolean;
15
16
  isNorthWestOf(testedCoords: any): boolean;
16
17
  isSouthWestOf(testedCoords: any): boolean;
17
18
  isNorthEastOf(testedCoords: any): boolean;
18
19
  normalize(): CellCoords;
20
+ assign(coords: CellCoords | { row?: number, col?: number }): CellCoords;
19
21
  clone(): CellCoords;
20
22
  toObject(): any;
21
23
  }
@@ -140,6 +140,15 @@ class CellCoords {
140
140
  return this.row >= 0 && this.col >= 0;
141
141
  }
142
142
 
143
+ /**
144
+ * Checks if the coordinates runs in RTL mode.
145
+ *
146
+ * @returns {boolean}
147
+ */
148
+ isRtl() {
149
+ return _classPrivateFieldGet(this, _isRtl);
150
+ }
151
+
143
152
  /**
144
153
  * Checks if another set of coordinates (`testedCoords`)
145
154
  * is south-east of the coordinates in your `CellCoords` instance.
@@ -197,6 +206,26 @@ class CellCoords {
197
206
  return this;
198
207
  }
199
208
 
209
+ /**
210
+ * Assigns the coordinates from another `CellCoords` instance (or compatible literal object)
211
+ * to your `CellCoords` instance.
212
+ *
213
+ * @param {CellCoords | { row?: number, col?: number }} coords The CellCoords instance or compatible literal object.
214
+ * @returns {CellCoords}
215
+ */
216
+ assign(coords) {
217
+ if (Number.isInteger(coords === null || coords === void 0 ? void 0 : coords.row)) {
218
+ this.row = coords.row;
219
+ }
220
+ if (Number.isInteger(coords === null || coords === void 0 ? void 0 : coords.col)) {
221
+ this.col = coords.col;
222
+ }
223
+ if (coords instanceof CellCoords) {
224
+ _classPrivateFieldSet(this, _isRtl, coords.isRtl());
225
+ }
226
+ return this;
227
+ }
228
+
200
229
  /**
201
230
  * Clones your `CellCoords` instance.
202
231
  *
@@ -137,6 +137,15 @@ class CellCoords {
137
137
  return this.row >= 0 && this.col >= 0;
138
138
  }
139
139
 
140
+ /**
141
+ * Checks if the coordinates runs in RTL mode.
142
+ *
143
+ * @returns {boolean}
144
+ */
145
+ isRtl() {
146
+ return _classPrivateFieldGet(this, _isRtl);
147
+ }
148
+
140
149
  /**
141
150
  * Checks if another set of coordinates (`testedCoords`)
142
151
  * is south-east of the coordinates in your `CellCoords` instance.
@@ -194,6 +203,26 @@ class CellCoords {
194
203
  return this;
195
204
  }
196
205
 
206
+ /**
207
+ * Assigns the coordinates from another `CellCoords` instance (or compatible literal object)
208
+ * to your `CellCoords` instance.
209
+ *
210
+ * @param {CellCoords | { row?: number, col?: number }} coords The CellCoords instance or compatible literal object.
211
+ * @returns {CellCoords}
212
+ */
213
+ assign(coords) {
214
+ if (Number.isInteger(coords === null || coords === void 0 ? void 0 : coords.row)) {
215
+ this.row = coords.row;
216
+ }
217
+ if (Number.isInteger(coords === null || coords === void 0 ? void 0 : coords.col)) {
218
+ this.col = coords.col;
219
+ }
220
+ if (coords instanceof CellCoords) {
221
+ _classPrivateFieldSet(this, _isRtl, coords.isRtl());
222
+ }
223
+ return this;
224
+ }
225
+
197
226
  /**
198
227
  * Clones your `CellCoords` instance.
199
228
  *
package/base.js CHANGED
@@ -43,8 +43,8 @@ Handsontable.hooks = _pluginHooks.default.getSingleton();
43
43
  Handsontable.CellCoords = _src.CellCoords;
44
44
  Handsontable.CellRange = _src.CellRange;
45
45
  Handsontable.packageName = 'handsontable';
46
- Handsontable.buildDate = "26/10/2023 11:29:18";
47
- Handsontable.version = "0.0.0-next-cecf979-20231026";
46
+ Handsontable.buildDate = "26/10/2023 20:16:30";
47
+ Handsontable.version = "0.0.0-next-e54c3d6-20231026";
48
48
  Handsontable.languages = {
49
49
  dictionaryKeys: _registry.dictionaryKeys,
50
50
  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 = "26/10/2023 11:29:28";
39
- Handsontable.version = "0.0.0-next-cecf979-20231026";
38
+ Handsontable.buildDate = "26/10/2023 20:16:43";
39
+ Handsontable.version = "0.0.0-next-e54c3d6-20231026";
40
40
  Handsontable.languages = {
41
41
  dictionaryKeys,
42
42
  getLanguageDictionary,
@@ -36,46 +36,52 @@ function installFocusCatcher(hot) {
36
36
  hot.listen();
37
37
  }
38
38
  });
39
+ const rowWrapState = {
40
+ wrapped: false,
41
+ flipped: false
42
+ };
39
43
  hot.addHook('afterListen', () => deactivate());
40
44
  hot.addHook('afterUnlisten', () => activate());
41
45
  hot.addHook('afterSelection', () => {
42
46
  var _hot$getSelectedRange;
43
47
  recentlyAddedFocusCoords = (_hot$getSelectedRange = hot.getSelectedRangeLast()) === null || _hot$getSelectedRange === void 0 ? void 0 : _hot$getSelectedRange.highlight;
44
48
  });
49
+ hot.addHook('beforeRowWrap', (isWrapEnabled, newCoords, isFlipped) => {
50
+ rowWrapState.wrapped = true;
51
+ rowWrapState.flipped = isFlipped;
52
+ });
53
+
54
+ /**
55
+ * Unselects the cell and deactivates the table.
56
+ */
57
+ function deactivateTable() {
58
+ rowWrapState.wrapped = false;
59
+ rowWrapState.flipped = false;
60
+ hot.deselectCell();
61
+ hot.unlisten();
62
+ }
45
63
  hot.getShortcutManager().getContext('grid').addShortcut({
46
64
  keys: [['Tab'], ['Shift', 'Tab']],
47
65
  callback: event => {
48
- var _hot$getSelectedRange2;
49
66
  const {
50
67
  disableTabNavigation,
51
68
  autoWrapRow
52
69
  } = hot.getSettings();
53
- if (disableTabNavigation) {
54
- hot.deselectCell();
55
- hot.unlisten();
70
+ if (disableTabNavigation || !hot.selection.isSelected() || autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped || !autoWrapRow && rowWrapState.wrapped) {
71
+ if (autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped) {
72
+ recentlyAddedFocusCoords = event.shiftKey ? getMostTopStartPosition(hot) : getMostBottomEndPosition(hot);
73
+ }
74
+ deactivateTable();
56
75
  return false;
57
76
  }
58
- const isSelected = hot.selection.isSelected();
59
- const highlight = (_hot$getSelectedRange2 = hot.getSelectedRangeLast()) === null || _hot$getSelectedRange2 === void 0 ? void 0 : _hot$getSelectedRange2.highlight;
60
- const mostTopStartCoords = getMostTopStartPosition(hot);
61
- const mostBottomEndCoords = getMostBottomEndPosition(hot);
62
77
 
63
- // For disabled `autoWrapRow` option set the row to the same position as the currently selected row.
64
- if (!autoWrapRow) {
65
- mostTopStartCoords.row = highlight.row;
66
- mostBottomEndCoords.row = highlight.row;
67
- }
68
- if (event.shiftKey && (!isSelected || highlight.isEqual(mostTopStartCoords)) || !event.shiftKey && (!isSelected || highlight.isEqual(mostBottomEndCoords))) {
69
- hot.deselectCell();
70
- hot.unlisten();
71
- return false;
72
- }
73
- return true;
78
+ // if the selection is still within the table's range then prevent default action
79
+ event.preventDefault();
74
80
  },
75
81
  runOnlyIf: () => !hot.getSettings().minSpareCols,
76
82
  preventDefault: false,
77
83
  stopPropagation: false,
78
- position: 'before',
84
+ position: 'after',
79
85
  relativeToGroup: _shortcutContexts.GRID_GROUP,
80
86
  group: 'focusCatcher'
81
87
  });
@@ -32,46 +32,52 @@ export function installFocusCatcher(hot) {
32
32
  hot.listen();
33
33
  }
34
34
  });
35
+ const rowWrapState = {
36
+ wrapped: false,
37
+ flipped: false
38
+ };
35
39
  hot.addHook('afterListen', () => deactivate());
36
40
  hot.addHook('afterUnlisten', () => activate());
37
41
  hot.addHook('afterSelection', () => {
38
42
  var _hot$getSelectedRange;
39
43
  recentlyAddedFocusCoords = (_hot$getSelectedRange = hot.getSelectedRangeLast()) === null || _hot$getSelectedRange === void 0 ? void 0 : _hot$getSelectedRange.highlight;
40
44
  });
45
+ hot.addHook('beforeRowWrap', (isWrapEnabled, newCoords, isFlipped) => {
46
+ rowWrapState.wrapped = true;
47
+ rowWrapState.flipped = isFlipped;
48
+ });
49
+
50
+ /**
51
+ * Unselects the cell and deactivates the table.
52
+ */
53
+ function deactivateTable() {
54
+ rowWrapState.wrapped = false;
55
+ rowWrapState.flipped = false;
56
+ hot.deselectCell();
57
+ hot.unlisten();
58
+ }
41
59
  hot.getShortcutManager().getContext('grid').addShortcut({
42
60
  keys: [['Tab'], ['Shift', 'Tab']],
43
61
  callback: event => {
44
- var _hot$getSelectedRange2;
45
62
  const {
46
63
  disableTabNavigation,
47
64
  autoWrapRow
48
65
  } = hot.getSettings();
49
- if (disableTabNavigation) {
50
- hot.deselectCell();
51
- hot.unlisten();
66
+ if (disableTabNavigation || !hot.selection.isSelected() || autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped || !autoWrapRow && rowWrapState.wrapped) {
67
+ if (autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped) {
68
+ recentlyAddedFocusCoords = event.shiftKey ? getMostTopStartPosition(hot) : getMostBottomEndPosition(hot);
69
+ }
70
+ deactivateTable();
52
71
  return false;
53
72
  }
54
- const isSelected = hot.selection.isSelected();
55
- const highlight = (_hot$getSelectedRange2 = hot.getSelectedRangeLast()) === null || _hot$getSelectedRange2 === void 0 ? void 0 : _hot$getSelectedRange2.highlight;
56
- const mostTopStartCoords = getMostTopStartPosition(hot);
57
- const mostBottomEndCoords = getMostBottomEndPosition(hot);
58
73
 
59
- // For disabled `autoWrapRow` option set the row to the same position as the currently selected row.
60
- if (!autoWrapRow) {
61
- mostTopStartCoords.row = highlight.row;
62
- mostBottomEndCoords.row = highlight.row;
63
- }
64
- if (event.shiftKey && (!isSelected || highlight.isEqual(mostTopStartCoords)) || !event.shiftKey && (!isSelected || highlight.isEqual(mostBottomEndCoords))) {
65
- hot.deselectCell();
66
- hot.unlisten();
67
- return false;
68
- }
69
- return true;
74
+ // if the selection is still within the table's range then prevent default action
75
+ event.preventDefault();
70
76
  },
71
77
  runOnlyIf: () => !hot.getSettings().minSpareCols,
72
78
  preventDefault: false,
73
79
  stopPropagation: false,
74
- position: 'before',
80
+ position: 'after',
75
81
  relativeToGroup: GRID_GROUP,
76
82
  group: 'focusCatcher'
77
83
  });
package/core.js CHANGED
@@ -304,18 +304,6 @@ function Core(rootElement, userSettings) {
304
304
  };
305
305
  this.columnIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
306
306
  this.rowIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
307
- this.selection.addLocalHook('beforeHighlightSet', () => {
308
- this.runHooks('beforeSelectionHighlightSet');
309
- });
310
- this.selection.addLocalHook('beforeSetRangeStart', cellCoords => {
311
- this.runHooks('beforeSetRangeStart', cellCoords);
312
- });
313
- this.selection.addLocalHook('beforeSetRangeStartOnly', cellCoords => {
314
- this.runHooks('beforeSetRangeStartOnly', cellCoords);
315
- });
316
- this.selection.addLocalHook('beforeSetRangeEnd', cellCoords => {
317
- this.runHooks('beforeSetRangeEnd', cellCoords);
318
- });
319
307
  this.selection.addLocalHook('afterSetRangeEnd', cellCoords => {
320
308
  const preventScrolling = (0, _object.createObjectPropListener)(false);
321
309
  const selectionRange = this.selection.getSelectedRange();
@@ -404,54 +392,78 @@ function Core(rootElement, userSettings) {
404
392
  isMultiple.value = changedIsMultiple;
405
393
  }
406
394
  });
407
- this.selection.addLocalHook('beforeSelectColumns', function () {
395
+ this.selection.addLocalHook('afterDeselect', () => {
396
+ editorManager.destroyEditor();
397
+ this._refreshBorders();
398
+ (0, _element.removeClass)(this.rootElement, ['ht__selection--rows', 'ht__selection--columns']);
399
+ this.runHooks('afterDeselect');
400
+ });
401
+ this.selection.addLocalHook('beforeHighlightSet', () => this.runHooks('beforeSelectionHighlightSet')).addLocalHook('beforeSetRangeStart', function () {
408
402
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
409
403
  args[_key] = arguments[_key];
410
404
  }
411
- return _this.runHooks('beforeSelectColumns', ...args);
412
- });
413
- this.selection.addLocalHook('afterSelectColumns', function () {
405
+ return _this.runHooks('beforeSetRangeStart', ...args);
406
+ }).addLocalHook('beforeSetRangeStartOnly', function () {
414
407
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
415
408
  args[_key2] = arguments[_key2];
416
409
  }
417
- return _this.runHooks('afterSelectColumns', ...args);
418
- });
419
- this.selection.addLocalHook('beforeSelectRows', function () {
410
+ return _this.runHooks('beforeSetRangeStartOnly', ...args);
411
+ }).addLocalHook('beforeSetRangeEnd', function () {
420
412
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
421
413
  args[_key3] = arguments[_key3];
422
414
  }
423
- return _this.runHooks('beforeSelectRows', ...args);
424
- });
425
- this.selection.addLocalHook('afterSelectRows', function () {
415
+ return _this.runHooks('beforeSetRangeEnd', ...args);
416
+ }).addLocalHook('beforeSelectColumns', function () {
426
417
  for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
427
418
  args[_key4] = arguments[_key4];
428
419
  }
420
+ return _this.runHooks('beforeSelectColumns', ...args);
421
+ }).addLocalHook('afterSelectColumns', function () {
422
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
423
+ args[_key5] = arguments[_key5];
424
+ }
425
+ return _this.runHooks('afterSelectColumns', ...args);
426
+ }).addLocalHook('beforeSelectRows', function () {
427
+ for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
428
+ args[_key6] = arguments[_key6];
429
+ }
430
+ return _this.runHooks('beforeSelectRows', ...args);
431
+ }).addLocalHook('afterSelectRows', function () {
432
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
433
+ args[_key7] = arguments[_key7];
434
+ }
429
435
  return _this.runHooks('afterSelectRows', ...args);
430
- });
431
- this.selection.addLocalHook('beforeModifyTransformStart', cellCoordsDelta => {
432
- this.runHooks('modifyTransformStart', cellCoordsDelta);
433
- });
434
- this.selection.addLocalHook('afterModifyTransformStart', (coords, rowTransformDir, colTransformDir) => {
435
- this.runHooks('afterModifyTransformStart', coords, rowTransformDir, colTransformDir);
436
- });
437
- this.selection.addLocalHook('beforeModifyTransformEnd', cellCoordsDelta => {
438
- this.runHooks('modifyTransformEnd', cellCoordsDelta);
439
- });
440
- this.selection.addLocalHook('afterModifyTransformEnd', (coords, rowTransformDir, colTransformDir) => {
441
- this.runHooks('afterModifyTransformEnd', coords, rowTransformDir, colTransformDir);
442
- });
443
- this.selection.addLocalHook('afterDeselect', () => {
444
- editorManager.destroyEditor();
445
- this._refreshBorders();
446
- (0, _element.removeClass)(this.rootElement, ['ht__selection--rows', 'ht__selection--columns']);
447
- this.runHooks('afterDeselect');
448
- });
449
- this.selection.addLocalHook('insertRowRequire', totalRows => {
450
- this.alter('insert_row_above', totalRows, 1, 'auto');
451
- });
452
- this.selection.addLocalHook('insertColRequire', totalCols => {
453
- this.alter('insert_col_start', totalCols, 1, 'auto');
454
- });
436
+ }).addLocalHook('beforeModifyTransformStart', function () {
437
+ for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
438
+ args[_key8] = arguments[_key8];
439
+ }
440
+ return _this.runHooks('modifyTransformStart', ...args);
441
+ }).addLocalHook('afterModifyTransformStart', function () {
442
+ for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
443
+ args[_key9] = arguments[_key9];
444
+ }
445
+ return _this.runHooks('afterModifyTransformStart', ...args);
446
+ }).addLocalHook('beforeModifyTransformEnd', function () {
447
+ for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
448
+ args[_key10] = arguments[_key10];
449
+ }
450
+ return _this.runHooks('modifyTransformEnd', ...args);
451
+ }).addLocalHook('afterModifyTransformEnd', function () {
452
+ for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
453
+ args[_key11] = arguments[_key11];
454
+ }
455
+ return _this.runHooks('afterModifyTransformEnd', ...args);
456
+ }).addLocalHook('beforeRowWrap', function () {
457
+ for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
458
+ args[_key12] = arguments[_key12];
459
+ }
460
+ return _this.runHooks('beforeRowWrap', ...args);
461
+ }).addLocalHook('beforeColumnWrap', function () {
462
+ for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
463
+ args[_key13] = arguments[_key13];
464
+ }
465
+ return _this.runHooks('beforeColumnWrap', ...args);
466
+ }).addLocalHook('insertRowRequire', totalRows => this.alter('insert_row_above', totalRows, 1, 'auto')).addLocalHook('insertColRequire', totalCols => this.alter('insert_col_start', totalCols, 1, 'auto'));
455
467
  grid = {
456
468
  /**
457
469
  * Inserts or removes rows and columns.
@@ -1587,8 +1599,8 @@ function Core(rootElement, userSettings) {
1587
1599
  * @returns {Array} Returns removed portion of columns.
1588
1600
  */
1589
1601
  this.spliceCol = function (column, index, amount) {
1590
- for (var _len5 = arguments.length, elements = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
1591
- elements[_key5 - 3] = arguments[_key5];
1602
+ for (var _len14 = arguments.length, elements = new Array(_len14 > 3 ? _len14 - 3 : 0), _key14 = 3; _key14 < _len14; _key14++) {
1603
+ elements[_key14 - 3] = arguments[_key14];
1592
1604
  }
1593
1605
  return datamap.spliceCol(column, index, amount, ...elements);
1594
1606
  };
@@ -1605,8 +1617,8 @@ function Core(rootElement, userSettings) {
1605
1617
  * @returns {Array} Returns removed portion of rows.
1606
1618
  */
1607
1619
  this.spliceRow = function (row, index, amount) {
1608
- for (var _len6 = arguments.length, elements = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
1609
- elements[_key6 - 3] = arguments[_key6];
1620
+ for (var _len15 = arguments.length, elements = new Array(_len15 > 3 ? _len15 - 3 : 0), _key15 = 3; _key15 < _len15; _key15++) {
1621
+ elements[_key15 - 3] = arguments[_key15];
1610
1622
  }
1611
1623
  return datamap.spliceRow(row, index, amount, ...elements);
1612
1624
  };
@@ -3003,8 +3015,8 @@ function Core(rootElement, userSettings) {
3003
3015
  */
3004
3016
  this.spliceCellsMeta = function (visualIndex) {
3005
3017
  let deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3006
- for (var _len7 = arguments.length, cellMetaRows = new Array(_len7 > 2 ? _len7 - 2 : 0), _key7 = 2; _key7 < _len7; _key7++) {
3007
- cellMetaRows[_key7 - 2] = arguments[_key7];
3018
+ for (var _len16 = arguments.length, cellMetaRows = new Array(_len16 > 2 ? _len16 - 2 : 0), _key16 = 2; _key16 < _len16; _key16++) {
3019
+ cellMetaRows[_key16 - 2] = arguments[_key16];
3008
3020
  }
3009
3021
  if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
3010
3022
  throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
package/core.mjs CHANGED
@@ -299,18 +299,6 @@ export default function Core(rootElement, userSettings) {
299
299
  };
300
300
  this.columnIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
301
301
  this.rowIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
302
- this.selection.addLocalHook('beforeHighlightSet', () => {
303
- this.runHooks('beforeSelectionHighlightSet');
304
- });
305
- this.selection.addLocalHook('beforeSetRangeStart', cellCoords => {
306
- this.runHooks('beforeSetRangeStart', cellCoords);
307
- });
308
- this.selection.addLocalHook('beforeSetRangeStartOnly', cellCoords => {
309
- this.runHooks('beforeSetRangeStartOnly', cellCoords);
310
- });
311
- this.selection.addLocalHook('beforeSetRangeEnd', cellCoords => {
312
- this.runHooks('beforeSetRangeEnd', cellCoords);
313
- });
314
302
  this.selection.addLocalHook('afterSetRangeEnd', cellCoords => {
315
303
  const preventScrolling = createObjectPropListener(false);
316
304
  const selectionRange = this.selection.getSelectedRange();
@@ -399,54 +387,78 @@ export default function Core(rootElement, userSettings) {
399
387
  isMultiple.value = changedIsMultiple;
400
388
  }
401
389
  });
402
- this.selection.addLocalHook('beforeSelectColumns', function () {
390
+ this.selection.addLocalHook('afterDeselect', () => {
391
+ editorManager.destroyEditor();
392
+ this._refreshBorders();
393
+ removeClass(this.rootElement, ['ht__selection--rows', 'ht__selection--columns']);
394
+ this.runHooks('afterDeselect');
395
+ });
396
+ this.selection.addLocalHook('beforeHighlightSet', () => this.runHooks('beforeSelectionHighlightSet')).addLocalHook('beforeSetRangeStart', function () {
403
397
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
404
398
  args[_key] = arguments[_key];
405
399
  }
406
- return _this.runHooks('beforeSelectColumns', ...args);
407
- });
408
- this.selection.addLocalHook('afterSelectColumns', function () {
400
+ return _this.runHooks('beforeSetRangeStart', ...args);
401
+ }).addLocalHook('beforeSetRangeStartOnly', function () {
409
402
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
410
403
  args[_key2] = arguments[_key2];
411
404
  }
412
- return _this.runHooks('afterSelectColumns', ...args);
413
- });
414
- this.selection.addLocalHook('beforeSelectRows', function () {
405
+ return _this.runHooks('beforeSetRangeStartOnly', ...args);
406
+ }).addLocalHook('beforeSetRangeEnd', function () {
415
407
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
416
408
  args[_key3] = arguments[_key3];
417
409
  }
418
- return _this.runHooks('beforeSelectRows', ...args);
419
- });
420
- this.selection.addLocalHook('afterSelectRows', function () {
410
+ return _this.runHooks('beforeSetRangeEnd', ...args);
411
+ }).addLocalHook('beforeSelectColumns', function () {
421
412
  for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
422
413
  args[_key4] = arguments[_key4];
423
414
  }
415
+ return _this.runHooks('beforeSelectColumns', ...args);
416
+ }).addLocalHook('afterSelectColumns', function () {
417
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
418
+ args[_key5] = arguments[_key5];
419
+ }
420
+ return _this.runHooks('afterSelectColumns', ...args);
421
+ }).addLocalHook('beforeSelectRows', function () {
422
+ for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
423
+ args[_key6] = arguments[_key6];
424
+ }
425
+ return _this.runHooks('beforeSelectRows', ...args);
426
+ }).addLocalHook('afterSelectRows', function () {
427
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
428
+ args[_key7] = arguments[_key7];
429
+ }
424
430
  return _this.runHooks('afterSelectRows', ...args);
425
- });
426
- this.selection.addLocalHook('beforeModifyTransformStart', cellCoordsDelta => {
427
- this.runHooks('modifyTransformStart', cellCoordsDelta);
428
- });
429
- this.selection.addLocalHook('afterModifyTransformStart', (coords, rowTransformDir, colTransformDir) => {
430
- this.runHooks('afterModifyTransformStart', coords, rowTransformDir, colTransformDir);
431
- });
432
- this.selection.addLocalHook('beforeModifyTransformEnd', cellCoordsDelta => {
433
- this.runHooks('modifyTransformEnd', cellCoordsDelta);
434
- });
435
- this.selection.addLocalHook('afterModifyTransformEnd', (coords, rowTransformDir, colTransformDir) => {
436
- this.runHooks('afterModifyTransformEnd', coords, rowTransformDir, colTransformDir);
437
- });
438
- this.selection.addLocalHook('afterDeselect', () => {
439
- editorManager.destroyEditor();
440
- this._refreshBorders();
441
- removeClass(this.rootElement, ['ht__selection--rows', 'ht__selection--columns']);
442
- this.runHooks('afterDeselect');
443
- });
444
- this.selection.addLocalHook('insertRowRequire', totalRows => {
445
- this.alter('insert_row_above', totalRows, 1, 'auto');
446
- });
447
- this.selection.addLocalHook('insertColRequire', totalCols => {
448
- this.alter('insert_col_start', totalCols, 1, 'auto');
449
- });
431
+ }).addLocalHook('beforeModifyTransformStart', function () {
432
+ for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
433
+ args[_key8] = arguments[_key8];
434
+ }
435
+ return _this.runHooks('modifyTransformStart', ...args);
436
+ }).addLocalHook('afterModifyTransformStart', function () {
437
+ for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
438
+ args[_key9] = arguments[_key9];
439
+ }
440
+ return _this.runHooks('afterModifyTransformStart', ...args);
441
+ }).addLocalHook('beforeModifyTransformEnd', function () {
442
+ for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
443
+ args[_key10] = arguments[_key10];
444
+ }
445
+ return _this.runHooks('modifyTransformEnd', ...args);
446
+ }).addLocalHook('afterModifyTransformEnd', function () {
447
+ for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
448
+ args[_key11] = arguments[_key11];
449
+ }
450
+ return _this.runHooks('afterModifyTransformEnd', ...args);
451
+ }).addLocalHook('beforeRowWrap', function () {
452
+ for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
453
+ args[_key12] = arguments[_key12];
454
+ }
455
+ return _this.runHooks('beforeRowWrap', ...args);
456
+ }).addLocalHook('beforeColumnWrap', function () {
457
+ for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
458
+ args[_key13] = arguments[_key13];
459
+ }
460
+ return _this.runHooks('beforeColumnWrap', ...args);
461
+ }).addLocalHook('insertRowRequire', totalRows => this.alter('insert_row_above', totalRows, 1, 'auto')).addLocalHook('insertColRequire', totalCols => this.alter('insert_col_start', totalCols, 1, 'auto'));
450
462
  grid = {
451
463
  /**
452
464
  * Inserts or removes rows and columns.
@@ -1582,8 +1594,8 @@ export default function Core(rootElement, userSettings) {
1582
1594
  * @returns {Array} Returns removed portion of columns.
1583
1595
  */
1584
1596
  this.spliceCol = function (column, index, amount) {
1585
- for (var _len5 = arguments.length, elements = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
1586
- elements[_key5 - 3] = arguments[_key5];
1597
+ for (var _len14 = arguments.length, elements = new Array(_len14 > 3 ? _len14 - 3 : 0), _key14 = 3; _key14 < _len14; _key14++) {
1598
+ elements[_key14 - 3] = arguments[_key14];
1587
1599
  }
1588
1600
  return datamap.spliceCol(column, index, amount, ...elements);
1589
1601
  };
@@ -1600,8 +1612,8 @@ export default function Core(rootElement, userSettings) {
1600
1612
  * @returns {Array} Returns removed portion of rows.
1601
1613
  */
1602
1614
  this.spliceRow = function (row, index, amount) {
1603
- for (var _len6 = arguments.length, elements = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
1604
- elements[_key6 - 3] = arguments[_key6];
1615
+ for (var _len15 = arguments.length, elements = new Array(_len15 > 3 ? _len15 - 3 : 0), _key15 = 3; _key15 < _len15; _key15++) {
1616
+ elements[_key15 - 3] = arguments[_key15];
1605
1617
  }
1606
1618
  return datamap.spliceRow(row, index, amount, ...elements);
1607
1619
  };
@@ -2998,8 +3010,8 @@ export default function Core(rootElement, userSettings) {
2998
3010
  */
2999
3011
  this.spliceCellsMeta = function (visualIndex) {
3000
3012
  let deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3001
- for (var _len7 = arguments.length, cellMetaRows = new Array(_len7 > 2 ? _len7 - 2 : 0), _key7 = 2; _key7 < _len7; _key7++) {
3002
- cellMetaRows[_key7 - 2] = arguments[_key7];
3013
+ for (var _len16 = arguments.length, cellMetaRows = new Array(_len16 > 2 ? _len16 - 2 : 0), _key16 = 2; _key16 < _len16; _key16++) {
3014
+ cellMetaRows[_key16 - 2] = arguments[_key16];
3003
3015
  }
3004
3016
  if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
3005
3017
  throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
@@ -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-cecf979-20231026
29
- * Release date: 31/08/2023 (built at 26/10/2023 11:29:36)
28
+ * Version: 0.0.0-next-e54c3d6-20231026
29
+ * Release date: 31/08/2023 (built at 26/10/2023 20:16:53)
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-cecf979-20231026
29
- * Release date: 31/08/2023 (built at 26/10/2023 11:29:36)
28
+ * Version: 0.0.0-next-e54c3d6-20231026
29
+ * Release date: 31/08/2023 (built at 26/10/2023 20:16:53)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles