handsontable 0.0.0-next-7b93b7d-20231107 → 0.0.0-next-5f253b5-20231108

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 (42) hide show
  1. package/3rdparty/walkontable/src/cell/coords.js +7 -5
  2. package/3rdparty/walkontable/src/cell/coords.mjs +7 -5
  3. package/base.js +2 -2
  4. package/base.mjs +2 -2
  5. package/dist/handsontable.css +2 -2
  6. package/dist/handsontable.full.css +2 -2
  7. package/dist/handsontable.full.js +102 -51
  8. package/dist/handsontable.full.min.css +2 -2
  9. package/dist/handsontable.full.min.js +10 -10
  10. package/dist/handsontable.js +102 -51
  11. package/dist/handsontable.min.css +2 -2
  12. package/dist/handsontable.min.js +10 -10
  13. package/helpers/mixed.js +1 -1
  14. package/helpers/mixed.mjs +1 -1
  15. package/package.json +1 -1
  16. package/plugins/autofill/autofill.d.ts +0 -1
  17. package/plugins/autofill/autofill.js +1 -0
  18. package/plugins/autofill/autofill.mjs +1 -0
  19. package/plugins/base/base.js +4 -6
  20. package/plugins/base/base.mjs +4 -6
  21. package/plugins/columnSorting/columnSorting.js +2 -1
  22. package/plugins/columnSorting/columnSorting.mjs +2 -1
  23. package/plugins/contextMenu/contextMenu.js +5 -1
  24. package/plugins/contextMenu/contextMenu.mjs +5 -1
  25. package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
  26. package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -1
  27. package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
  28. package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -1
  29. package/plugins/customBorders/customBorders.js +8 -2
  30. package/plugins/customBorders/customBorders.mjs +8 -2
  31. package/plugins/dropdownMenu/dropdownMenu.js +4 -2
  32. package/plugins/dropdownMenu/dropdownMenu.mjs +4 -2
  33. package/plugins/multiColumnSorting/multiColumnSorting.js +2 -1
  34. package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -1
  35. package/plugins/nestedRows/nestedRows.js +12 -4
  36. package/plugins/nestedRows/nestedRows.mjs +12 -4
  37. package/selection/selection.js +25 -7
  38. package/selection/selection.mjs +25 -7
  39. package/selection/utils.js +24 -14
  40. package/selection/utils.mjs +25 -15
  41. package/shortcuts/manager.js +1 -1
  42. package/shortcuts/manager.mjs +1 -1
package/helpers/mixed.js CHANGED
@@ -134,7 +134,7 @@ const domMessages = {
134
134
  function _injectProductInfo(key, element) {
135
135
  const hasValidType = !isEmpty(key);
136
136
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
137
- const hotVersion = "0.0.0-next-7b93b7d-20231107";
137
+ const hotVersion = "0.0.0-next-5f253b5-20231108";
138
138
  let keyValidityDate;
139
139
  let consoleMessageState = 'invalid';
140
140
  let domMessageState = 'invalid';
package/helpers/mixed.mjs CHANGED
@@ -124,7 +124,7 @@ const domMessages = {
124
124
  export function _injectProductInfo(key, element) {
125
125
  const hasValidType = !isEmpty(key);
126
126
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
127
- const hotVersion = "0.0.0-next-7b93b7d-20231107";
127
+ const hotVersion = "0.0.0-next-5f253b5-20231108";
128
128
  let keyValidityDate;
129
129
  let consoleMessageState = 'invalid';
130
130
  let domMessageState = 'invalid';
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/handsontable/handsontable/issues"
11
11
  },
12
12
  "author": "Handsoncode <hello@handsontable.com>",
13
- "version": "0.0.0-next-7b93b7d-20231107",
13
+ "version": "0.0.0-next-5f253b5-20231108",
14
14
  "main": "index",
15
15
  "module": "index.mjs",
16
16
  "jsnext:main": "index.mjs",
@@ -12,7 +12,6 @@ export type Settings = boolean | Direction | DetailedSettings;
12
12
 
13
13
  export class Autofill extends BasePlugin {
14
14
  constructor(hotInstance: Core);
15
- autoInsertRow: boolean;
16
15
 
17
16
  isEnabled(): boolean;
18
17
  }
@@ -112,6 +112,7 @@ class Autofill extends _base.BasePlugin {
112
112
  /**
113
113
  * Specifies if can insert new rows if needed.
114
114
  *
115
+ * @private
115
116
  * @type {boolean}
116
117
  */
117
118
  _defineProperty(this, "autoInsertRow", false);
@@ -106,6 +106,7 @@ export class Autofill extends BasePlugin {
106
106
  /**
107
107
  * Specifies if can insert new rows if needed.
108
108
  *
109
+ * @private
109
110
  * @type {boolean}
110
111
  */
111
112
  _defineProperty(this, "autoInsertRow", false);
@@ -173,9 +173,8 @@ class BasePlugin {
173
173
  * Disable plugin for this Handsontable instance.
174
174
  */
175
175
  disablePlugin() {
176
- if (this.eventManager) {
177
- this.eventManager.clear();
178
- }
176
+ var _this$eventManager;
177
+ (_this$eventManager = this.eventManager) === null || _this$eventManager === void 0 || _this$eventManager.clear();
179
178
  this.clearHooks();
180
179
  this.enabled = false;
181
180
  }
@@ -269,9 +268,8 @@ class BasePlugin {
269
268
  * Destroy plugin.
270
269
  */
271
270
  destroy() {
272
- if (this.eventManager) {
273
- this.eventManager.destroy();
274
- }
271
+ var _this$eventManager2;
272
+ (_this$eventManager2 = this.eventManager) === null || _this$eventManager2 === void 0 || _this$eventManager2.destroy();
275
273
  this.clearHooks();
276
274
  (0, _object.objectEach)(this, (value, property) => {
277
275
  if (property !== 'hot') {
@@ -168,9 +168,8 @@ export class BasePlugin {
168
168
  * Disable plugin for this Handsontable instance.
169
169
  */
170
170
  disablePlugin() {
171
- if (this.eventManager) {
172
- this.eventManager.clear();
173
- }
171
+ var _this$eventManager;
172
+ (_this$eventManager = this.eventManager) === null || _this$eventManager === void 0 || _this$eventManager.clear();
174
173
  this.clearHooks();
175
174
  this.enabled = false;
176
175
  }
@@ -264,9 +263,8 @@ export class BasePlugin {
264
263
  * Destroy plugin.
265
264
  */
266
265
  destroy() {
267
- if (this.eventManager) {
268
- this.eventManager.destroy();
269
- }
266
+ var _this$eventManager2;
267
+ (_this$eventManager2 = this.eventManager) === null || _this$eventManager2 === void 0 || _this$eventManager2.destroy();
270
268
  this.clearHooks();
271
269
  objectEach(this, (value, property) => {
272
270
  if (property !== 'hot') {
@@ -258,7 +258,8 @@ class ColumnSorting extends _base.BasePlugin {
258
258
  },
259
259
  runOnlyIf: () => {
260
260
  var _this$hot$getSelected;
261
- return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
261
+ const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
262
+ return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
262
263
  },
263
264
  group: SHORTCUTS_GROUP
264
265
  });
@@ -250,7 +250,8 @@ export class ColumnSorting extends BasePlugin {
250
250
  },
251
251
  runOnlyIf: () => {
252
252
  var _this$hot$getSelected;
253
- return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
253
+ const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
254
+ return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
254
255
  },
255
256
  group: SHORTCUTS_GROUP
256
257
  });
@@ -208,7 +208,11 @@ class ContextMenu extends _base.BasePlugin {
208
208
  above: -rect.height
209
209
  });
210
210
  },
211
- runOnlyIf: () => this.hot.getSelectedRangeLast() && !this.menu.isOpened(),
211
+ runOnlyIf: () => {
212
+ var _this$hot$getSelected;
213
+ const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
214
+ return highlight && this.hot.selection.isCellVisible(highlight) && !this.menu.isOpened();
215
+ },
212
216
  group: SHORTCUTS_GROUP
213
217
  });
214
218
  }
@@ -202,7 +202,11 @@ export class ContextMenu extends BasePlugin {
202
202
  above: -rect.height
203
203
  });
204
204
  },
205
- runOnlyIf: () => this.hot.getSelectedRangeLast() && !this.menu.isOpened(),
205
+ runOnlyIf: () => {
206
+ var _this$hot$getSelected;
207
+ const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
208
+ return highlight && this.hot.selection.isCellVisible(highlight) && !this.menu.isOpened();
209
+ },
206
210
  group: SHORTCUTS_GROUP
207
211
  });
208
212
  }
@@ -31,7 +31,7 @@ function removeColumnItem() {
31
31
  return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_REMOVE_COLUMN, pluralForm);
32
32
  },
33
33
  callback() {
34
- this.alter('remove_col', (0, _utils.transformSelectionToColumnDistance)(this.getSelected()), null, 'ContextMenu.removeColumn');
34
+ this.alter('remove_col', (0, _utils.transformSelectionToColumnDistance)(this), null, 'ContextMenu.removeColumn');
35
35
  },
36
36
  disabled() {
37
37
  if (!this.isColumnModificationAllowed()) {
@@ -24,7 +24,7 @@ export default function removeColumnItem() {
24
24
  return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_REMOVE_COLUMN, pluralForm);
25
25
  },
26
26
  callback() {
27
- this.alter('remove_col', transformSelectionToColumnDistance(this.getSelected()), null, 'ContextMenu.removeColumn');
27
+ this.alter('remove_col', transformSelectionToColumnDistance(this), null, 'ContextMenu.removeColumn');
28
28
  },
29
29
  disabled() {
30
30
  if (!this.isColumnModificationAllowed()) {
@@ -33,7 +33,7 @@ function removeRowItem() {
33
33
  callback() {
34
34
  // TODO: Please keep in mind that below `1` may be improper. The table's way of work, before change `f1747b3912ea3b21fe423fd102ca94c87db81379` was restored.
35
35
  // There is still problem when removing more than one row.
36
- this.alter('remove_row', (0, _utils.transformSelectionToRowDistance)(this.getSelected()), 1, 'ContextMenu.removeRow');
36
+ this.alter('remove_row', (0, _utils.transformSelectionToRowDistance)(this), 1, 'ContextMenu.removeRow');
37
37
  },
38
38
  disabled() {
39
39
  const range = this.getSelectedRangeLast();
@@ -26,7 +26,7 @@ export default function removeRowItem() {
26
26
  callback() {
27
27
  // TODO: Please keep in mind that below `1` may be improper. The table's way of work, before change `f1747b3912ea3b21fe423fd102ca94c87db81379` was restored.
28
28
  // There is still problem when removing more than one row.
29
- this.alter('remove_row', transformSelectionToRowDistance(this.getSelected()), 1, 'ContextMenu.removeRow');
29
+ this.alter('remove_row', transformSelectionToRowDistance(this), 1, 'ContextMenu.removeRow');
30
30
  },
31
31
  disabled() {
32
32
  const range = this.getSelectedRangeLast();
@@ -180,7 +180,10 @@ class CustomBorders extends _base.BasePlugin {
180
180
  normBorder = (0, _utils.normalizeBorder)(borderObject);
181
181
  }
182
182
  const selectionType = (0, _selection.detectSelectionType)(selectionRanges);
183
- const selectionSchemaNormalizer = (0, _selection.normalizeSelectionFactory)(selectionType);
183
+ const selectionSchemaNormalizer = (0, _selection.normalizeSelectionFactory)(selectionType, {
184
+ createCellCoords: this.hot._createCellCoords.bind(this.hot),
185
+ createCellRange: this.hot._createCellRange.bind(this.hot)
186
+ });
184
187
  (0, _array.arrayEach)(selectionRanges, selection => {
185
188
  selectionSchemaNormalizer(selection).forAll((row, col) => {
186
189
  (0, _array.arrayEach)(borderKeys, borderKey => {
@@ -223,7 +226,10 @@ class CustomBorders extends _base.BasePlugin {
223
226
  return this.savedBorders;
224
227
  }
225
228
  const selectionType = (0, _selection.detectSelectionType)(selectionRanges);
226
- const selectionSchemaNormalizer = (0, _selection.normalizeSelectionFactory)(selectionType);
229
+ const selectionSchemaNormalizer = (0, _selection.normalizeSelectionFactory)(selectionType, {
230
+ createCellCoords: this.hot._createCellCoords.bind(this.hot),
231
+ createCellRange: this.hot._createCellRange.bind(this.hot)
232
+ });
227
233
  const selectedBorders = [];
228
234
  (0, _array.arrayEach)(selectionRanges, selection => {
229
235
  selectionSchemaNormalizer(selection).forAll((row, col) => {
@@ -173,7 +173,10 @@ export class CustomBorders extends BasePlugin {
173
173
  normBorder = normalizeBorder(borderObject);
174
174
  }
175
175
  const selectionType = detectSelectionType(selectionRanges);
176
- const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
176
+ const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType, {
177
+ createCellCoords: this.hot._createCellCoords.bind(this.hot),
178
+ createCellRange: this.hot._createCellRange.bind(this.hot)
179
+ });
177
180
  arrayEach(selectionRanges, selection => {
178
181
  selectionSchemaNormalizer(selection).forAll((row, col) => {
179
182
  arrayEach(borderKeys, borderKey => {
@@ -216,7 +219,10 @@ export class CustomBorders extends BasePlugin {
216
219
  return this.savedBorders;
217
220
  }
218
221
  const selectionType = detectSelectionType(selectionRanges);
219
- const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
222
+ const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType, {
223
+ createCellCoords: this.hot._createCellCoords.bind(this.hot),
224
+ createCellRange: this.hot._createCellRange.bind(this.hot)
225
+ });
220
226
  const selectedBorders = [];
221
227
  arrayEach(selectionRanges, selection => {
222
228
  selectionSchemaNormalizer(selection).forAll((row, col) => {
@@ -306,7 +306,8 @@ class DropdownMenu extends _base.BasePlugin {
306
306
  callback,
307
307
  runOnlyIf: () => {
308
308
  var _this$hot$getSelected;
309
- return ((_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader()) && !this.menu.isOpened();
309
+ const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
310
+ return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader() && !this.menu.isOpened();
310
311
  },
311
312
  captureCtrl: true,
312
313
  group: SHORTCUTS_GROUP
@@ -315,7 +316,8 @@ class DropdownMenu extends _base.BasePlugin {
315
316
  callback,
316
317
  runOnlyIf: () => {
317
318
  var _this$hot$getSelected2;
318
- return ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isCell()) && !this.menu.isOpened();
319
+ const highlight = (_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight;
320
+ return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isCell() && !this.menu.isOpened();
319
321
  },
320
322
  group: SHORTCUTS_GROUP
321
323
  }]);
@@ -300,7 +300,8 @@ export class DropdownMenu extends BasePlugin {
300
300
  callback,
301
301
  runOnlyIf: () => {
302
302
  var _this$hot$getSelected;
303
- return ((_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader()) && !this.menu.isOpened();
303
+ const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
304
+ return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader() && !this.menu.isOpened();
304
305
  },
305
306
  captureCtrl: true,
306
307
  group: SHORTCUTS_GROUP
@@ -309,7 +310,8 @@ export class DropdownMenu extends BasePlugin {
309
310
  callback,
310
311
  runOnlyIf: () => {
311
312
  var _this$hot$getSelected2;
312
- return ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isCell()) && !this.menu.isOpened();
313
+ const highlight = (_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight;
314
+ return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isCell() && !this.menu.isOpened();
313
315
  },
314
316
  group: SHORTCUTS_GROUP
315
317
  }]);
@@ -137,7 +137,8 @@ class MultiColumnSorting extends _columnSorting.ColumnSorting {
137
137
  },
138
138
  runOnlyIf: () => {
139
139
  var _this$hot$getSelected;
140
- return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
140
+ const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
141
+ return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
141
142
  },
142
143
  group: SHORTCUTS_GROUP
143
144
  });
@@ -132,7 +132,8 @@ export class MultiColumnSorting extends ColumnSorting {
132
132
  },
133
133
  runOnlyIf: () => {
134
134
  var _this$hot$getSelected;
135
- return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
135
+ const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
136
+ return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
136
137
  },
137
138
  group: SHORTCUTS_GROUP
138
139
  });
@@ -32,7 +32,6 @@ exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
32
32
  const SHORTCUTS_GROUP = PLUGIN_KEY;
33
33
 
34
34
  /* eslint-disable jsdoc/require-description-complete-sentence */
35
-
36
35
  /**
37
36
  * Error message for the wrong data type error.
38
37
  */
@@ -203,6 +202,8 @@ class NestedRows extends _base.BasePlugin {
203
202
  */
204
203
  _defineProperty(this, "collapsedRowsMap", null);
205
204
  /**
205
+ * Allows skipping the render cycle if set as `true`.
206
+ *
206
207
  * @type {boolean}
207
208
  */
208
209
  _classPrivateFieldInitSpec(this, _skipRender, {
@@ -210,6 +211,8 @@ class NestedRows extends _base.BasePlugin {
210
211
  value: false
211
212
  });
212
213
  /**
214
+ * Allows skipping the internal Core methods call if set as `true`.
215
+ *
213
216
  * @type {boolean}
214
217
  */
215
218
  _classPrivateFieldInitSpec(this, _skipCoreAPIModifiers, {
@@ -403,7 +406,8 @@ class NestedRows extends _base.BasePlugin {
403
406
  },
404
407
  runOnlyIf: () => {
405
408
  var _this$hot$getSelected;
406
- return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
409
+ const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
410
+ return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
407
411
  },
408
412
  group: SHORTCUTS_GROUP
409
413
  });
@@ -420,6 +424,8 @@ class NestedRows extends _base.BasePlugin {
420
424
  /**
421
425
  * Enable the modify hook skipping flag - allows retrieving the data from Handsontable without this plugin's
422
426
  * modifications.
427
+ *
428
+ * @private
423
429
  */
424
430
  disableCoreAPIModifiers() {
425
431
  _classPrivateFieldSet(this, _skipCoreAPIModifiers, true);
@@ -427,6 +433,8 @@ class NestedRows extends _base.BasePlugin {
427
433
 
428
434
  /**
429
435
  * Disable the modify hook skipping flag.
436
+ *
437
+ * @private
430
438
  */
431
439
  enableCoreAPIModifiers() {
432
440
  _classPrivateFieldSet(this, _skipCoreAPIModifiers, false);
@@ -498,7 +506,7 @@ function _onAfterGetRowHeader2(row, TH) {
498
506
  this.headersUI.appendLevelIndicators(row, TH);
499
507
  }
500
508
  function _onModifyRowHeaderWidth2(rowHeaderWidth) {
501
- return this.headersUI.rowHeaderWidthCache || rowHeaderWidth;
509
+ return Math.max(this.headersUI.rowHeaderWidthCache, rowHeaderWidth);
502
510
  }
503
511
  function _onAfterRemoveRow2(index, amount, logicRows, source) {
504
512
  if (source === this.pluginName) {
@@ -508,7 +516,7 @@ function _onAfterRemoveRow2(index, amount, logicRows, source) {
508
516
  _classPrivateFieldSet(this, _skipRender, false);
509
517
  this.headersUI.updateRowHeaderWidth();
510
518
  this.collapsingUI.collapsedRowsStash.applyStash();
511
- }, 0);
519
+ });
512
520
  }
513
521
  function _onBeforeRemoveRow2(index, amount, physicalRows) {
514
522
  const modifiedPhysicalRows = Array.from(physicalRows.reduce((removedRows, physicalIndex) => {
@@ -26,7 +26,6 @@ export const PLUGIN_PRIORITY = 300;
26
26
  const SHORTCUTS_GROUP = PLUGIN_KEY;
27
27
 
28
28
  /* eslint-disable jsdoc/require-description-complete-sentence */
29
-
30
29
  /**
31
30
  * Error message for the wrong data type error.
32
31
  */
@@ -197,6 +196,8 @@ export class NestedRows extends BasePlugin {
197
196
  */
198
197
  _defineProperty(this, "collapsedRowsMap", null);
199
198
  /**
199
+ * Allows skipping the render cycle if set as `true`.
200
+ *
200
201
  * @type {boolean}
201
202
  */
202
203
  _classPrivateFieldInitSpec(this, _skipRender, {
@@ -204,6 +205,8 @@ export class NestedRows extends BasePlugin {
204
205
  value: false
205
206
  });
206
207
  /**
208
+ * Allows skipping the internal Core methods call if set as `true`.
209
+ *
207
210
  * @type {boolean}
208
211
  */
209
212
  _classPrivateFieldInitSpec(this, _skipCoreAPIModifiers, {
@@ -397,7 +400,8 @@ export class NestedRows extends BasePlugin {
397
400
  },
398
401
  runOnlyIf: () => {
399
402
  var _this$hot$getSelected;
400
- return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
403
+ const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
404
+ return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
401
405
  },
402
406
  group: SHORTCUTS_GROUP
403
407
  });
@@ -414,6 +418,8 @@ export class NestedRows extends BasePlugin {
414
418
  /**
415
419
  * Enable the modify hook skipping flag - allows retrieving the data from Handsontable without this plugin's
416
420
  * modifications.
421
+ *
422
+ * @private
417
423
  */
418
424
  disableCoreAPIModifiers() {
419
425
  _classPrivateFieldSet(this, _skipCoreAPIModifiers, true);
@@ -421,6 +427,8 @@ export class NestedRows extends BasePlugin {
421
427
 
422
428
  /**
423
429
  * Disable the modify hook skipping flag.
430
+ *
431
+ * @private
424
432
  */
425
433
  enableCoreAPIModifiers() {
426
434
  _classPrivateFieldSet(this, _skipCoreAPIModifiers, false);
@@ -491,7 +499,7 @@ function _onAfterGetRowHeader2(row, TH) {
491
499
  this.headersUI.appendLevelIndicators(row, TH);
492
500
  }
493
501
  function _onModifyRowHeaderWidth2(rowHeaderWidth) {
494
- return this.headersUI.rowHeaderWidthCache || rowHeaderWidth;
502
+ return Math.max(this.headersUI.rowHeaderWidthCache, rowHeaderWidth);
495
503
  }
496
504
  function _onAfterRemoveRow2(index, amount, logicRows, source) {
497
505
  if (source === this.pluginName) {
@@ -501,7 +509,7 @@ function _onAfterRemoveRow2(index, amount, logicRows, source) {
501
509
  _classPrivateFieldSet(this, _skipRender, false);
502
510
  this.headersUI.updateRowHeaderWidth();
503
511
  this.collapsingUI.collapsedRowsStash.applyStash();
504
- }, 0);
512
+ });
505
513
  }
506
514
  function _onBeforeRemoveRow2(index, amount, physicalRows) {
507
515
  const modifiedPhysicalRows = Array.from(physicalRows.reduce((removedRows, physicalIndex) => {
@@ -2,7 +2,6 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
- var _src = require("./../3rdparty/walkontable/src");
6
5
  var _highlight = _interopRequireWildcard(require("./highlight/highlight"));
7
6
  var _range = _interopRequireDefault(require("./range"));
8
7
  var _object = require("./../helpers/object");
@@ -561,6 +560,18 @@ class Selection {
561
560
  return this.settings.fillHandle && !this.tableProps.isEditorOpened() && !this.isMultiple();
562
561
  }
563
562
 
563
+ /**
564
+ * Returns `true` if the cell coordinates are visible (renderable).
565
+ *
566
+ * @private
567
+ * @param {CellCoords} coords The cell coordinates to check.
568
+ * @returns {boolean}
569
+ */
570
+ isCellVisible(coords) {
571
+ const renderableCoords = this.tableProps.visualToRenderableCoords(coords);
572
+ return renderableCoords.row !== null && renderableCoords.col !== null;
573
+ }
574
+
564
575
  /**
565
576
  * Returns `true` if the area corner should be visible.
566
577
  *
@@ -663,6 +674,7 @@ class Selection {
663
674
  * @returns {boolean} Returns `true` if selection was successful, `false` otherwise.
664
675
  */
665
676
  selectCells(selectionRanges) {
677
+ var _this2 = this;
666
678
  const selectionType = (0, _utils.detectSelectionType)(selectionRanges);
667
679
  if (selectionType === _utils.SELECTION_TYPE_EMPTY) {
668
680
  return false;
@@ -672,6 +684,12 @@ class Selection {
672
684
  columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);
673
685
  }
674
686
  const selectionSchemaNormalizer = (0, _utils.normalizeSelectionFactory)(selectionType, {
687
+ createCellCoords: function () {
688
+ return _this2.tableProps.createCellCoords(...arguments);
689
+ },
690
+ createCellRange: function () {
691
+ return _this2.tableProps.createCellRange(...arguments);
692
+ },
675
693
  propToCol: prop => this.tableProps.propToCol(prop),
676
694
  keepDirection: true
677
695
  });
@@ -724,9 +742,9 @@ class Selection {
724
742
  const countCols = this.tableProps.countCols();
725
743
  const countColHeaders = this.tableProps.countColHeaders();
726
744
  const columnHeaderLastIndex = countColHeaders === 0 ? 0 : -countColHeaders;
727
- const fromCoords = new _src.CellCoords(columnHeaderLastIndex, start);
728
- const toCoords = new _src.CellCoords(countRows - 1, end);
729
- const isValid = new _src.CellRange(fromCoords, fromCoords, toCoords).isValid({
745
+ const fromCoords = this.tableProps.createCellCoords(columnHeaderLastIndex, start);
746
+ const toCoords = this.tableProps.createCellCoords(countRows - 1, end);
747
+ const isValid = this.tableProps.createCellRange(fromCoords, fromCoords, toCoords).isValid({
730
748
  countRows,
731
749
  countCols,
732
750
  countRowHeaders: 0,
@@ -769,9 +787,9 @@ class Selection {
769
787
  const countCols = this.tableProps.countCols();
770
788
  const countRowHeaders = this.tableProps.countRowHeaders();
771
789
  const rowHeaderLastIndex = countRowHeaders === 0 ? 0 : -countRowHeaders;
772
- const fromCoords = new _src.CellCoords(startRow, rowHeaderLastIndex);
773
- const toCoords = new _src.CellCoords(endRow, countCols - 1);
774
- const isValid = new _src.CellRange(fromCoords, fromCoords, toCoords).isValid({
790
+ const fromCoords = this.tableProps.createCellCoords(startRow, rowHeaderLastIndex);
791
+ const toCoords = this.tableProps.createCellCoords(endRow, countCols - 1);
792
+ const isValid = this.tableProps.createCellRange(fromCoords, fromCoords, toCoords).isValid({
775
793
  countRows,
776
794
  countCols,
777
795
  countRowHeaders,
@@ -9,7 +9,6 @@ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.
9
9
  function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
10
10
  function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
11
11
  function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
12
- import { CellCoords, CellRange } from "./../3rdparty/walkontable/src/index.mjs";
13
12
  import Highlight, { AREA_TYPE, HEADER_TYPE, FOCUS_TYPE } from "./highlight/highlight.mjs";
14
13
  import SelectionRange from "./range.mjs";
15
14
  import { createObjectPropListener, mixin } from "./../helpers/object.mjs";
@@ -555,6 +554,18 @@ class Selection {
555
554
  return this.settings.fillHandle && !this.tableProps.isEditorOpened() && !this.isMultiple();
556
555
  }
557
556
 
557
+ /**
558
+ * Returns `true` if the cell coordinates are visible (renderable).
559
+ *
560
+ * @private
561
+ * @param {CellCoords} coords The cell coordinates to check.
562
+ * @returns {boolean}
563
+ */
564
+ isCellVisible(coords) {
565
+ const renderableCoords = this.tableProps.visualToRenderableCoords(coords);
566
+ return renderableCoords.row !== null && renderableCoords.col !== null;
567
+ }
568
+
558
569
  /**
559
570
  * Returns `true` if the area corner should be visible.
560
571
  *
@@ -657,6 +668,7 @@ class Selection {
657
668
  * @returns {boolean} Returns `true` if selection was successful, `false` otherwise.
658
669
  */
659
670
  selectCells(selectionRanges) {
671
+ var _this2 = this;
660
672
  const selectionType = detectSelectionType(selectionRanges);
661
673
  if (selectionType === SELECTION_TYPE_EMPTY) {
662
674
  return false;
@@ -666,6 +678,12 @@ class Selection {
666
678
  columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);
667
679
  }
668
680
  const selectionSchemaNormalizer = normalizeSelectionFactory(selectionType, {
681
+ createCellCoords: function () {
682
+ return _this2.tableProps.createCellCoords(...arguments);
683
+ },
684
+ createCellRange: function () {
685
+ return _this2.tableProps.createCellRange(...arguments);
686
+ },
669
687
  propToCol: prop => this.tableProps.propToCol(prop),
670
688
  keepDirection: true
671
689
  });
@@ -718,9 +736,9 @@ class Selection {
718
736
  const countCols = this.tableProps.countCols();
719
737
  const countColHeaders = this.tableProps.countColHeaders();
720
738
  const columnHeaderLastIndex = countColHeaders === 0 ? 0 : -countColHeaders;
721
- const fromCoords = new CellCoords(columnHeaderLastIndex, start);
722
- const toCoords = new CellCoords(countRows - 1, end);
723
- const isValid = new CellRange(fromCoords, fromCoords, toCoords).isValid({
739
+ const fromCoords = this.tableProps.createCellCoords(columnHeaderLastIndex, start);
740
+ const toCoords = this.tableProps.createCellCoords(countRows - 1, end);
741
+ const isValid = this.tableProps.createCellRange(fromCoords, fromCoords, toCoords).isValid({
724
742
  countRows,
725
743
  countCols,
726
744
  countRowHeaders: 0,
@@ -763,9 +781,9 @@ class Selection {
763
781
  const countCols = this.tableProps.countCols();
764
782
  const countRowHeaders = this.tableProps.countRowHeaders();
765
783
  const rowHeaderLastIndex = countRowHeaders === 0 ? 0 : -countRowHeaders;
766
- const fromCoords = new CellCoords(startRow, rowHeaderLastIndex);
767
- const toCoords = new CellCoords(endRow, countCols - 1);
768
- const isValid = new CellRange(fromCoords, fromCoords, toCoords).isValid({
784
+ const fromCoords = this.tableProps.createCellCoords(startRow, rowHeaderLastIndex);
785
+ const toCoords = this.tableProps.createCellCoords(endRow, countCols - 1);
786
+ const isValid = this.tableProps.createCellRange(fromCoords, fromCoords, toCoords).isValid({
769
787
  countRows,
770
788
  countCols,
771
789
  countRowHeaders,