handsontable 0.0.0-next-93e34dc-20230601 → 0.0.0-next-b7cca45-20230605

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 (216) hide show
  1. package/3rdparty/walkontable/src/{selection/border/border.js → border.js} +12 -7
  2. package/3rdparty/walkontable/src/{selection/border/border.mjs → border.mjs} +12 -7
  3. package/3rdparty/walkontable/src/cell/coords.d.ts +1 -6
  4. package/3rdparty/walkontable/src/cell/coords.js +12 -61
  5. package/3rdparty/walkontable/src/cell/coords.mjs +12 -61
  6. package/3rdparty/walkontable/src/cell/range.d.ts +2 -9
  7. package/3rdparty/walkontable/src/cell/range.js +7 -44
  8. package/3rdparty/walkontable/src/cell/range.mjs +7 -44
  9. package/3rdparty/walkontable/src/core/_base.js +3 -9
  10. package/3rdparty/walkontable/src/core/_base.mjs +3 -9
  11. package/3rdparty/walkontable/src/core/clone.js +2 -2
  12. package/3rdparty/walkontable/src/core/clone.mjs +2 -2
  13. package/3rdparty/walkontable/src/core/core.js +2 -3
  14. package/3rdparty/walkontable/src/core/core.mjs +2 -3
  15. package/3rdparty/walkontable/src/event.js +7 -7
  16. package/3rdparty/walkontable/src/event.mjs +7 -7
  17. package/3rdparty/walkontable/src/facade/core.js +2 -2
  18. package/3rdparty/walkontable/src/facade/core.mjs +2 -2
  19. package/3rdparty/walkontable/src/index.js +2 -10
  20. package/3rdparty/walkontable/src/index.mjs +2 -2
  21. package/3rdparty/walkontable/src/overlay/_base.js +1 -1
  22. package/3rdparty/walkontable/src/overlay/_base.mjs +1 -1
  23. package/3rdparty/walkontable/src/overlay/inlineStart.js +4 -2
  24. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +4 -2
  25. package/3rdparty/walkontable/src/overlay/top.js +4 -2
  26. package/3rdparty/walkontable/src/overlay/top.mjs +4 -2
  27. package/3rdparty/walkontable/src/selection.js +354 -0
  28. package/3rdparty/walkontable/src/selection.mjs +348 -0
  29. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +0 -9
  30. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +0 -9
  31. package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +0 -9
  32. package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +0 -9
  33. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +0 -9
  34. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +0 -9
  35. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +0 -9
  36. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +0 -9
  37. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +0 -9
  38. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +0 -9
  39. package/3rdparty/walkontable/src/table.js +79 -7
  40. package/3rdparty/walkontable/src/table.mjs +80 -8
  41. package/base.js +2 -2
  42. package/base.mjs +2 -2
  43. package/core.d.ts +3 -5
  44. package/core.js +300 -82
  45. package/core.mjs +300 -82
  46. package/dataMap/metaManager/metaSchema.js +0 -15
  47. package/dataMap/metaManager/metaSchema.mjs +0 -15
  48. package/dist/handsontable.css +3 -8
  49. package/dist/handsontable.full.css +3 -8
  50. package/dist/handsontable.full.js +9926 -12218
  51. package/dist/handsontable.full.min.css +3 -3
  52. package/dist/handsontable.full.min.js +120 -120
  53. package/dist/handsontable.js +14628 -16920
  54. package/dist/handsontable.min.css +3 -3
  55. package/dist/handsontable.min.js +4 -4
  56. package/editorManager.js +82 -20
  57. package/editorManager.mjs +86 -25
  58. package/editors/textEditor/textEditor.js +11 -3
  59. package/editors/textEditor/textEditor.mjs +12 -4
  60. package/helpers/mixed.js +1 -1
  61. package/helpers/mixed.mjs +1 -1
  62. package/helpers/number.d.ts +0 -1
  63. package/helpers/number.js +0 -18
  64. package/helpers/number.mjs +0 -17
  65. package/package.json +1 -1
  66. package/pluginHooks.js +1 -1
  67. package/pluginHooks.mjs +1 -1
  68. package/plugins/copyPaste/copyPaste.js +1 -5
  69. package/plugins/copyPaste/copyPaste.mjs +1 -5
  70. package/plugins/customBorders/customBorders.js +52 -18
  71. package/plugins/customBorders/customBorders.mjs +53 -19
  72. package/plugins/mergeCells/mergeCells.js +18 -5
  73. package/plugins/mergeCells/mergeCells.mjs +18 -5
  74. package/plugins/nestedHeaders/nestedHeaders.js +9 -89
  75. package/plugins/nestedHeaders/nestedHeaders.mjs +9 -89
  76. package/plugins/nestedHeaders/stateManager/index.js +0 -37
  77. package/plugins/nestedHeaders/stateManager/index.mjs +0 -37
  78. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
  79. package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
  80. package/selection/highlight/constants.js +16 -0
  81. package/selection/highlight/constants.mjs +6 -0
  82. package/selection/highlight/highlight.js +88 -311
  83. package/selection/highlight/highlight.mjs +84 -301
  84. package/selection/highlight/types/activeHeader.js +9 -10
  85. package/selection/highlight/types/activeHeader.mjs +8 -10
  86. package/selection/highlight/types/area.js +27 -12
  87. package/selection/highlight/types/area.mjs +30 -16
  88. package/selection/highlight/types/{focus.js → cell.js} +8 -5
  89. package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
  90. package/selection/highlight/types/customSelection.js +10 -7
  91. package/selection/highlight/types/customSelection.mjs +9 -7
  92. package/selection/highlight/types/fill.js +8 -5
  93. package/selection/highlight/types/fill.mjs +7 -5
  94. package/selection/highlight/types/header.js +20 -10
  95. package/selection/highlight/types/header.mjs +19 -10
  96. package/selection/highlight/types/{row.js → index.js} +31 -27
  97. package/selection/highlight/types/{row.mjs → index.mjs} +29 -24
  98. package/selection/highlight/visualSelection.js +28 -23
  99. package/selection/highlight/visualSelection.mjs +28 -23
  100. package/selection/index.js +7 -4
  101. package/selection/index.mjs +3 -2
  102. package/selection/mouseEventHandler.js +1 -1
  103. package/selection/mouseEventHandler.mjs +1 -1
  104. package/selection/range.js +8 -8
  105. package/selection/range.mjs +8 -8
  106. package/selection/selection.js +180 -296
  107. package/selection/selection.mjs +179 -291
  108. package/selection/transformation.js +96 -233
  109. package/selection/transformation.mjs +93 -230
  110. package/selection/utils.js +35 -12
  111. package/selection/utils.mjs +35 -13
  112. package/settings.d.ts +0 -1
  113. package/tableView.js +9 -58
  114. package/tableView.mjs +9 -58
  115. package/3rdparty/walkontable/src/selection/border/constants.js +0 -18
  116. package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -13
  117. package/3rdparty/walkontable/src/selection/constants.js +0 -63
  118. package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
  119. package/3rdparty/walkontable/src/selection/index.js +0 -30
  120. package/3rdparty/walkontable/src/selection/index.mjs +0 -5
  121. package/3rdparty/walkontable/src/selection/manager.js +0 -328
  122. package/3rdparty/walkontable/src/selection/manager.mjs +0 -322
  123. package/3rdparty/walkontable/src/selection/scanner.js +0 -363
  124. package/3rdparty/walkontable/src/selection/scanner.mjs +0 -359
  125. package/3rdparty/walkontable/src/selection/selection.js +0 -133
  126. package/3rdparty/walkontable/src/selection/selection.mjs +0 -127
  127. package/selection/highlight/types/areaLayered.js +0 -54
  128. package/selection/highlight/types/areaLayered.mjs +0 -49
  129. package/selection/highlight/types/column.js +0 -50
  130. package/selection/highlight/types/column.mjs +0 -45
  131. package/shortcutContexts/commands/editor/closeAndSave.js +0 -15
  132. package/shortcutContexts/commands/editor/closeAndSave.mjs +0 -10
  133. package/shortcutContexts/commands/editor/closeWithoutSaving.js +0 -13
  134. package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +0 -8
  135. package/shortcutContexts/commands/editor/fastOpen.js +0 -16
  136. package/shortcutContexts/commands/editor/fastOpen.mjs +0 -11
  137. package/shortcutContexts/commands/editor/index.js +0 -16
  138. package/shortcutContexts/commands/editor/index.mjs +0 -12
  139. package/shortcutContexts/commands/editor/open.js +0 -29
  140. package/shortcutContexts/commands/editor/open.mjs +0 -24
  141. package/shortcutContexts/commands/emptySelectedCells.js +0 -12
  142. package/shortcutContexts/commands/emptySelectedCells.mjs +0 -7
  143. package/shortcutContexts/commands/extendCellsSelection/down.js +0 -15
  144. package/shortcutContexts/commands/extendCellsSelection/down.mjs +0 -10
  145. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +0 -21
  146. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -16
  147. package/shortcutContexts/commands/extendCellsSelection/index.js +0 -24
  148. package/shortcutContexts/commands/extendCellsSelection/index.mjs +0 -20
  149. package/shortcutContexts/commands/extendCellsSelection/left.js +0 -15
  150. package/shortcutContexts/commands/extendCellsSelection/left.mjs +0 -10
  151. package/shortcutContexts/commands/extendCellsSelection/right.js +0 -15
  152. package/shortcutContexts/commands/extendCellsSelection/right.mjs +0 -10
  153. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +0 -22
  154. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +0 -17
  155. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +0 -17
  156. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +0 -12
  157. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +0 -17
  158. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +0 -12
  159. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +0 -39
  160. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -34
  161. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -39
  162. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -34
  163. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -22
  164. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -17
  165. package/shortcutContexts/commands/extendCellsSelection/up.js +0 -15
  166. package/shortcutContexts/commands/extendCellsSelection/up.mjs +0 -10
  167. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +0 -21
  168. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -16
  169. package/shortcutContexts/commands/index.js +0 -51
  170. package/shortcutContexts/commands/index.mjs +0 -47
  171. package/shortcutContexts/commands/moveCellSelection/down.js +0 -12
  172. package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -7
  173. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -11
  174. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -6
  175. package/shortcutContexts/commands/moveCellSelection/index.js +0 -28
  176. package/shortcutContexts/commands/moveCellSelection/index.mjs +0 -24
  177. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +0 -13
  178. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +0 -8
  179. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +0 -13
  180. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +0 -8
  181. package/shortcutContexts/commands/moveCellSelection/left.js +0 -11
  182. package/shortcutContexts/commands/moveCellSelection/left.mjs +0 -6
  183. package/shortcutContexts/commands/moveCellSelection/right.js +0 -11
  184. package/shortcutContexts/commands/moveCellSelection/right.mjs +0 -6
  185. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +0 -16
  186. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +0 -11
  187. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +0 -17
  188. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +0 -12
  189. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +0 -13
  190. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +0 -8
  191. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +0 -16
  192. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +0 -11
  193. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +0 -35
  194. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -30
  195. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -35
  196. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -30
  197. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +0 -16
  198. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +0 -11
  199. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +0 -18
  200. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +0 -13
  201. package/shortcutContexts/commands/moveCellSelection/up.js +0 -12
  202. package/shortcutContexts/commands/moveCellSelection/up.mjs +0 -7
  203. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +0 -11
  204. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -6
  205. package/shortcutContexts/commands/populateSelectedCellsData.js +0 -35
  206. package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -30
  207. package/shortcutContexts/commands/selectAll.js +0 -11
  208. package/shortcutContexts/commands/selectAll.mjs +0 -6
  209. package/shortcutContexts/constants.js +0 -19
  210. package/shortcutContexts/constants.mjs +0 -12
  211. package/shortcutContexts/editor.js +0 -29
  212. package/shortcutContexts/editor.mjs +0 -25
  213. package/shortcutContexts/grid.js +0 -232
  214. package/shortcutContexts/grid.mjs +0 -228
  215. package/shortcutContexts/index.js +0 -29
  216. package/shortcutContexts/index.mjs +0 -15
@@ -9,6 +9,10 @@ require("core-js/modules/es.symbol.iterator.js");
9
9
  require("core-js/modules/es.array.iterator.js");
10
10
  require("core-js/modules/es.string.iterator.js");
11
11
  require("core-js/modules/web.dom-collections.iterator.js");
12
+ require("core-js/modules/es.array.slice.js");
13
+ require("core-js/modules/es.function.name.js");
14
+ require("core-js/modules/es.array.from.js");
15
+ require("core-js/modules/es.regexp.exec.js");
12
16
  require("core-js/modules/es.weak-map.js");
13
17
  exports.__esModule = true;
14
18
  exports.PLUGIN_PRIORITY = exports.PLUGIN_KEY = exports.CustomBorders = void 0;
@@ -34,6 +38,12 @@ var _selection = require("../../selection");
34
38
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
39
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
36
40
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
41
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
42
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
43
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
44
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
45
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
46
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
37
47
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
38
48
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
39
49
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -219,11 +229,25 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
219
229
  var selectionType = (0, _selection.detectSelectionType)(selectionRanges);
220
230
  var selectionSchemaNormalizer = (0, _selection.normalizeSelectionFactory)(selectionType);
221
231
  (0, _array.arrayEach)(selectionRanges, function (selection) {
222
- selectionSchemaNormalizer(selection).forAll(function (row, col) {
223
- (0, _array.arrayEach)(borderKeys, function (borderKey) {
224
- _this3.prepareBorderFromCustomAdded(row, col, normBorder, (0, _utils.toInlinePropName)(borderKey));
225
- });
226
- });
232
+ var _selectionSchemaNorma = selectionSchemaNormalizer(selection),
233
+ _selectionSchemaNorma2 = _slicedToArray(_selectionSchemaNorma, 4),
234
+ rowStart = _selectionSchemaNorma2[0],
235
+ columnStart = _selectionSchemaNorma2[1],
236
+ rowEnd = _selectionSchemaNorma2[2],
237
+ columnEnd = _selectionSchemaNorma2[3];
238
+ var _loop = function _loop(row) {
239
+ var _loop2 = function _loop2(col) {
240
+ (0, _array.arrayEach)(borderKeys, function (borderKey) {
241
+ _this3.prepareBorderFromCustomAdded(row, col, normBorder, (0, _utils.toInlinePropName)(borderKey));
242
+ });
243
+ };
244
+ for (var col = columnStart; col <= columnEnd; col += 1) {
245
+ _loop2(col);
246
+ }
247
+ };
248
+ for (var row = rowStart; row <= rowEnd; row += 1) {
249
+ _loop(row);
250
+ }
227
251
  });
228
252
 
229
253
  /*
@@ -266,13 +290,27 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
266
290
  var selectionSchemaNormalizer = (0, _selection.normalizeSelectionFactory)(selectionType);
267
291
  var selectedBorders = [];
268
292
  (0, _array.arrayEach)(selectionRanges, function (selection) {
269
- selectionSchemaNormalizer(selection).forAll(function (row, col) {
270
- (0, _array.arrayEach)(_this4.savedBorders, function (border) {
271
- if (border.row === row && border.col === col) {
272
- selectedBorders.push((0, _utils.denormalizeBorder)(border));
273
- }
274
- });
275
- });
293
+ var _selectionSchemaNorma3 = selectionSchemaNormalizer(selection),
294
+ _selectionSchemaNorma4 = _slicedToArray(_selectionSchemaNorma3, 4),
295
+ rowStart = _selectionSchemaNorma4[0],
296
+ columnStart = _selectionSchemaNorma4[1],
297
+ rowEnd = _selectionSchemaNorma4[2],
298
+ columnEnd = _selectionSchemaNorma4[3];
299
+ var _loop3 = function _loop3(row) {
300
+ var _loop4 = function _loop4(col) {
301
+ (0, _array.arrayEach)(_this4.savedBorders, function (border) {
302
+ if (border.row === row && border.col === col) {
303
+ selectedBorders.push((0, _utils.denormalizeBorder)(border));
304
+ }
305
+ });
306
+ };
307
+ for (var col = columnStart; col <= columnEnd; col += 1) {
308
+ _loop4(col);
309
+ }
310
+ };
311
+ for (var row = rowStart; row <= rowEnd; row += 1) {
312
+ _loop3(row);
313
+ }
276
314
  });
277
315
  return selectedBorders;
278
316
  }
@@ -697,12 +735,10 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
697
735
  }, {
698
736
  key: "checkCustomSelectionsFromContextMenu",
699
737
  value: function checkCustomSelectionsFromContextMenu(border, place, remove) {
700
- var _this12 = this;
701
738
  var check = false;
702
739
  (0, _array.arrayEach)(this.hot.selection.highlight.customSelections, function (customSelection) {
703
740
  if (border.id === customSelection.settings.id) {
704
- var borders = _this12.hot.view._wt.selectionManager.getBorderInstances(customSelection);
705
- (0, _array.arrayEach)(borders, function (borderObject) {
741
+ (0, _object.objectEach)(customSelection.instanceBorders, function (borderObject) {
706
742
  borderObject.toggleHiddenClass(place, remove); // TODO this also bad?
707
743
  });
708
744
 
@@ -727,7 +763,6 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
727
763
  }, {
728
764
  key: "checkCustomSelections",
729
765
  value: function checkCustomSelections(border, cellRange, place) {
730
- var _this13 = this;
731
766
  var hideCount = this.countHide(border);
732
767
  var check = false;
733
768
  if (hideCount === 4) {
@@ -739,8 +774,7 @@ var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
739
774
  customSelection.visualCellRange = cellRange;
740
775
  customSelection.commit();
741
776
  if (place) {
742
- var borders = _this13.hot.view._wt.selectionManager.getBorderInstances(customSelection);
743
- (0, _array.arrayEach)(borders, function (borderObject) {
777
+ (0, _object.objectEach)(customSelection.instanceBorders, function (borderObject) {
744
778
  borderObject.changeBorderStyle(place, border);
745
779
  });
746
780
  }
@@ -1,4 +1,10 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2
8
  import "core-js/modules/es.array.concat.js";
3
9
  import "core-js/modules/es.object.keys.js";
4
10
  import "core-js/modules/es.object.assign.js";
@@ -19,6 +25,10 @@ import "core-js/modules/es.symbol.iterator.js";
19
25
  import "core-js/modules/es.array.iterator.js";
20
26
  import "core-js/modules/es.string.iterator.js";
21
27
  import "core-js/modules/web.dom-collections.iterator.js";
28
+ import "core-js/modules/es.array.slice.js";
29
+ import "core-js/modules/es.function.name.js";
30
+ import "core-js/modules/es.array.from.js";
31
+ import "core-js/modules/es.regexp.exec.js";
22
32
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23
33
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
24
34
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -35,7 +45,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
35
45
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
36
46
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
37
47
  import { BasePlugin } from "../base/index.mjs";
38
- import { hasOwnProperty, deepClone } from "../../helpers/object.mjs";
48
+ import { hasOwnProperty, objectEach, deepClone } from "../../helpers/object.mjs";
39
49
  import { rangeEach } from "../../helpers/number.mjs";
40
50
  import { arrayEach, arrayReduce, arrayMap } from "../../helpers/array.mjs";
41
51
  import * as C from "../../i18n/constants.mjs";
@@ -210,11 +220,25 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
210
220
  var selectionType = detectSelectionType(selectionRanges);
211
221
  var selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
212
222
  arrayEach(selectionRanges, function (selection) {
213
- selectionSchemaNormalizer(selection).forAll(function (row, col) {
214
- arrayEach(borderKeys, function (borderKey) {
215
- _this3.prepareBorderFromCustomAdded(row, col, normBorder, toInlinePropName(borderKey));
216
- });
217
- });
223
+ var _selectionSchemaNorma = selectionSchemaNormalizer(selection),
224
+ _selectionSchemaNorma2 = _slicedToArray(_selectionSchemaNorma, 4),
225
+ rowStart = _selectionSchemaNorma2[0],
226
+ columnStart = _selectionSchemaNorma2[1],
227
+ rowEnd = _selectionSchemaNorma2[2],
228
+ columnEnd = _selectionSchemaNorma2[3];
229
+ var _loop = function _loop(row) {
230
+ var _loop2 = function _loop2(col) {
231
+ arrayEach(borderKeys, function (borderKey) {
232
+ _this3.prepareBorderFromCustomAdded(row, col, normBorder, toInlinePropName(borderKey));
233
+ });
234
+ };
235
+ for (var col = columnStart; col <= columnEnd; col += 1) {
236
+ _loop2(col);
237
+ }
238
+ };
239
+ for (var row = rowStart; row <= rowEnd; row += 1) {
240
+ _loop(row);
241
+ }
218
242
  });
219
243
 
220
244
  /*
@@ -257,13 +281,27 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
257
281
  var selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);
258
282
  var selectedBorders = [];
259
283
  arrayEach(selectionRanges, function (selection) {
260
- selectionSchemaNormalizer(selection).forAll(function (row, col) {
261
- arrayEach(_this4.savedBorders, function (border) {
262
- if (border.row === row && border.col === col) {
263
- selectedBorders.push(denormalizeBorder(border));
264
- }
265
- });
266
- });
284
+ var _selectionSchemaNorma3 = selectionSchemaNormalizer(selection),
285
+ _selectionSchemaNorma4 = _slicedToArray(_selectionSchemaNorma3, 4),
286
+ rowStart = _selectionSchemaNorma4[0],
287
+ columnStart = _selectionSchemaNorma4[1],
288
+ rowEnd = _selectionSchemaNorma4[2],
289
+ columnEnd = _selectionSchemaNorma4[3];
290
+ var _loop3 = function _loop3(row) {
291
+ var _loop4 = function _loop4(col) {
292
+ arrayEach(_this4.savedBorders, function (border) {
293
+ if (border.row === row && border.col === col) {
294
+ selectedBorders.push(denormalizeBorder(border));
295
+ }
296
+ });
297
+ };
298
+ for (var col = columnStart; col <= columnEnd; col += 1) {
299
+ _loop4(col);
300
+ }
301
+ };
302
+ for (var row = rowStart; row <= rowEnd; row += 1) {
303
+ _loop3(row);
304
+ }
267
305
  });
268
306
  return selectedBorders;
269
307
  }
@@ -688,12 +726,10 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
688
726
  }, {
689
727
  key: "checkCustomSelectionsFromContextMenu",
690
728
  value: function checkCustomSelectionsFromContextMenu(border, place, remove) {
691
- var _this12 = this;
692
729
  var check = false;
693
730
  arrayEach(this.hot.selection.highlight.customSelections, function (customSelection) {
694
731
  if (border.id === customSelection.settings.id) {
695
- var borders = _this12.hot.view._wt.selectionManager.getBorderInstances(customSelection);
696
- arrayEach(borders, function (borderObject) {
732
+ objectEach(customSelection.instanceBorders, function (borderObject) {
697
733
  borderObject.toggleHiddenClass(place, remove); // TODO this also bad?
698
734
  });
699
735
 
@@ -718,7 +754,6 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
718
754
  }, {
719
755
  key: "checkCustomSelections",
720
756
  value: function checkCustomSelections(border, cellRange, place) {
721
- var _this13 = this;
722
757
  var hideCount = this.countHide(border);
723
758
  var check = false;
724
759
  if (hideCount === 4) {
@@ -730,8 +765,7 @@ export var CustomBorders = /*#__PURE__*/function (_BasePlugin) {
730
765
  customSelection.visualCellRange = cellRange;
731
766
  customSelection.commit();
732
767
  if (place) {
733
- var borders = _this13.hot.view._wt.selectionManager.getBorderInstances(customSelection);
734
- arrayEach(borders, function (borderObject) {
768
+ objectEach(customSelection.instanceBorders, function (borderObject) {
735
769
  borderObject.changeBorderStyle(place, border);
736
770
  });
737
771
  }
@@ -242,6 +242,9 @@ var MergeCells = /*#__PURE__*/function (_BasePlugin) {
242
242
  this.addHook('afterDrawSelection', function () {
243
243
  return _this2.onAfterDrawSelection.apply(_this2, arguments);
244
244
  });
245
+ this.addHook('beforeRemoveCellClassNames', function () {
246
+ return _this2.onBeforeRemoveCellClassNames.apply(_this2, arguments);
247
+ });
245
248
  this.addHook('beforeUndoStackChange', function (action, source) {
246
249
  if (source === 'MergeCells') {
247
250
  return false;
@@ -658,11 +661,8 @@ var MergeCells = /*#__PURE__*/function (_BasePlugin) {
658
661
  gridContext.addShortcut({
659
662
  keys: [['Control', 'm']],
660
663
  callback: function callback() {
661
- var range = _this7.hot.getSelectedRangeLast();
662
- if (range && !range.isSingleHeader()) {
663
- _this7.toggleMerge(range);
664
- _this7.hot.render();
665
- }
664
+ _this7.toggleMerge(_this7.hot.getSelectedRangeLast());
665
+ _this7.hot.render();
666
666
  },
667
667
  runOnlyIf: function runOnlyIf(event) {
668
668
  return !event.altKey;
@@ -1339,6 +1339,19 @@ var MergeCells = /*#__PURE__*/function (_BasePlugin) {
1339
1339
  }
1340
1340
  return this.selectionCalculations.getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel);
1341
1341
  }
1342
+
1343
+ /**
1344
+ * `beforeRemoveCellClassNames` hook callback. Used to remove additional class name from all cells in the table.
1345
+ *
1346
+ * @private
1347
+ * @returns {string[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from
1348
+ * all the cells in the table.
1349
+ */
1350
+ }, {
1351
+ key: "onBeforeRemoveCellClassNames",
1352
+ value: function onBeforeRemoveCellClassNames() {
1353
+ return this.selectionCalculations.getSelectedMergedCellClassNameToRemove();
1354
+ }
1342
1355
  }], [{
1343
1356
  key: "PLUGIN_KEY",
1344
1357
  get: function get() {
@@ -235,6 +235,9 @@ export var MergeCells = /*#__PURE__*/function (_BasePlugin) {
235
235
  this.addHook('afterDrawSelection', function () {
236
236
  return _this2.onAfterDrawSelection.apply(_this2, arguments);
237
237
  });
238
+ this.addHook('beforeRemoveCellClassNames', function () {
239
+ return _this2.onBeforeRemoveCellClassNames.apply(_this2, arguments);
240
+ });
238
241
  this.addHook('beforeUndoStackChange', function (action, source) {
239
242
  if (source === 'MergeCells') {
240
243
  return false;
@@ -651,11 +654,8 @@ export var MergeCells = /*#__PURE__*/function (_BasePlugin) {
651
654
  gridContext.addShortcut({
652
655
  keys: [['Control', 'm']],
653
656
  callback: function callback() {
654
- var range = _this7.hot.getSelectedRangeLast();
655
- if (range && !range.isSingleHeader()) {
656
- _this7.toggleMerge(range);
657
- _this7.hot.render();
658
- }
657
+ _this7.toggleMerge(_this7.hot.getSelectedRangeLast());
658
+ _this7.hot.render();
659
659
  },
660
660
  runOnlyIf: function runOnlyIf(event) {
661
661
  return !event.altKey;
@@ -1332,6 +1332,19 @@ export var MergeCells = /*#__PURE__*/function (_BasePlugin) {
1332
1332
  }
1333
1333
  return this.selectionCalculations.getSelectedMergedCellClassName(currentRow, currentColumn, cornersOfSelection, layerLevel);
1334
1334
  }
1335
+
1336
+ /**
1337
+ * `beforeRemoveCellClassNames` hook callback. Used to remove additional class name from all cells in the table.
1338
+ *
1339
+ * @private
1340
+ * @returns {string[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from
1341
+ * all the cells in the table.
1342
+ */
1343
+ }, {
1344
+ key: "onBeforeRemoveCellClassNames",
1345
+ value: function onBeforeRemoveCellClassNames() {
1346
+ return this.selectionCalculations.getSelectedMergedCellClassNameToRemove();
1347
+ }
1335
1348
  }], [{
1336
1349
  key: "PLUGIN_KEY",
1337
1350
  get: function get() {
@@ -201,12 +201,6 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
201
201
  this.addHook('beforeOnCellMouseOver', function () {
202
202
  return _this2.onBeforeOnCellMouseOver.apply(_this2, arguments);
203
203
  });
204
- this.addHook('modifyTransformStart', function () {
205
- return _this2.onModifyTransformStart.apply(_this2, arguments);
206
- });
207
- this.addHook('afterSelection', function () {
208
- return _this2.updateFocusHighlightPosition();
209
- });
210
204
  this.addHook('afterGetColumnHeaderRenderers', function (array) {
211
205
  return _this2.onAfterGetColumnHeaderRenderers(array);
212
206
  });
@@ -225,12 +219,6 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
225
219
  this.addHook('afterViewportColumnCalculatorOverride', function () {
226
220
  return _this2.onAfterViewportColumnCalculatorOverride.apply(_this2, arguments);
227
221
  });
228
- this.hot.columnIndexMapper.addLocalHook('cacheUpdated', function () {
229
- return _this2.updateFocusHighlightPosition();
230
- });
231
- this.hot.rowIndexMapper.addLocalHook('cacheUpdated', function () {
232
- return _this2.updateFocusHighlightPosition();
233
- });
234
222
  _get(_getPrototypeOf(NestedHeaders.prototype), "enablePlugin", this).call(this);
235
223
  this.updatePlugin(); // @TODO: Workaround for broken plugin initialization abstraction.
236
224
  }
@@ -452,34 +440,6 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
452
440
  return this.hot.getColHeader(visualColumnIndex, headerLevel);
453
441
  }
454
442
 
455
- /**
456
- * Updates the selection focus highlight position to point to the nested header root element (TH)
457
- * even when the logical coordinates point in-between the header.
458
- *
459
- * @private
460
- */
461
- }, {
462
- key: "updateFocusHighlightPosition",
463
- value: function updateFocusHighlightPosition() {
464
- var _this$hot;
465
- var selection = (_this$hot = this.hot) === null || _this$hot === void 0 ? void 0 : _this$hot.getSelectedRangeLast();
466
- if (!selection) {
467
- return;
468
- }
469
- var highlight = selection.highlight;
470
- var isNestedHeadersRange = highlight.isHeader() && highlight.col >= 0;
471
- if (isNestedHeadersRange) {
472
- var columnIndex = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(highlight.row, highlight.col);
473
- var focusHighlight = this.hot.selection.highlight.getFocus();
474
-
475
- // Correct the highlight/focus selection to highlight the correct TH element
476
- focusHighlight.visualCellRange.highlight.col = columnIndex;
477
- focusHighlight.visualCellRange.from.col = columnIndex;
478
- focusHighlight.visualCellRange.to.col = columnIndex;
479
- focusHighlight.commit();
480
- }
481
- }
482
-
483
443
  /**
484
444
  * Allows to control which header DOM element will be used to highlight.
485
445
  *
@@ -496,7 +456,8 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
496
456
  if (!headerNodeData) {
497
457
  return visualColumn;
498
458
  }
499
- var columnCursor = highlightMeta.columnCursor,
459
+ var classNames = highlightMeta.classNames,
460
+ columnCursor = highlightMeta.columnCursor,
500
461
  selectionType = highlightMeta.selectionType,
501
462
  selectionWidth = highlightMeta.selectionWidth;
502
463
  var _classPrivateFieldGet4 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumn),
@@ -508,8 +469,8 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
508
469
  }
509
470
  } else if (selectionType === _selection.ACTIVE_HEADER_TYPE) {
510
471
  if (colspan > selectionWidth - columnCursor || !isRoot) {
511
- // Prevents adding any CSS class names to the TH element
512
- return null;
472
+ // Reset the class names array so the generated TH element won't be modified.
473
+ classNames.length = 0;
513
474
  }
514
475
  }
515
476
  return visualColumn;
@@ -640,7 +601,7 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
640
601
  }, {
641
602
  key: "onBeforeOnCellMouseOver",
642
603
  value: function onBeforeOnCellMouseOver(event, coords, TD, controller) {
643
- var _this$hot$selection;
604
+ var _this$hot;
644
605
  if (!this.hot.view.isMouseDown()) {
645
606
  return;
646
607
  }
@@ -661,54 +622,13 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
661
622
  controller.cell = true;
662
623
  var columnsToSelect = [];
663
624
  if (coords.col < from.col) {
664
- columnsToSelect.push(bottomEndCoords.col, columnIndex, coords.row);
625
+ columnsToSelect.push(bottomEndCoords.col, columnIndex);
665
626
  } else if (coords.col > from.col) {
666
- columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1, coords.row);
627
+ columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1);
667
628
  } else {
668
- columnsToSelect.push(columnIndex, columnIndex + origColspan - 1, coords.row);
669
- }
670
- (_this$hot$selection = this.hot.selection).selectColumns.apply(_this$hot$selection, columnsToSelect);
671
- }
672
-
673
- /**
674
- * `modifyTransformStart` hook is called every time the keyboard navigation is used.
675
- *
676
- * @private
677
- * @param {object} delta The transformation delta.
678
- */
679
- }, {
680
- key: "onModifyTransformStart",
681
- value: function onModifyTransformStart(delta) {
682
- var _this$hot$getSelected = this.hot.getSelectedRangeLast(),
683
- highlight = _this$hot$getSelected.highlight;
684
- var nextCoords = this.hot._createCellCoords(highlight.row + delta.row, highlight.col + delta.col);
685
- var isNestedHeadersRange = nextCoords.isHeader() && nextCoords.col >= 0;
686
- if (!isNestedHeadersRange) {
687
- return;
688
- }
689
- var visualColumnIndexStart = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(nextCoords.row, nextCoords.col);
690
- var visualColumnIndexEnd = _classPrivateFieldGet(this, _stateManager).findRightMostColumnIndex(nextCoords.row, nextCoords.col);
691
- if (delta.col < 0) {
692
- var nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexStart - 1 : visualColumnIndexEnd;
693
- var notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(nextColumn, -1);
694
- if (notHiddenColumnIndex === null) {
695
- // There are no visible columns anymore, so move the selection out of the table edge. This will
696
- // be processed by the selection Transformer class as a move selection to the previous row (if autoWrapRow is enabled).
697
- delta.col = -this.hot.view.countRenderableColumnsInRange(0, highlight.col);
698
- } else {
699
- delta.col = -Math.max(this.hot.view.countRenderableColumnsInRange(notHiddenColumnIndex, highlight.col) - 1, 1);
700
- }
701
- } else if (delta.col > 0) {
702
- var _nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexEnd + 1 : visualColumnIndexStart;
703
- var _notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(_nextColumn, 1);
704
- if (_notHiddenColumnIndex === null) {
705
- // There are no visible columns anymore, so move the selection out of the table edge. This will
706
- // be processed by the selection Transformer class as a move selection to the next row (if autoWrapRow is enabled).
707
- delta.col = this.hot.view.countRenderableColumnsInRange(highlight.col, this.hot.countCols());
708
- } else {
709
- delta.col = Math.max(this.hot.view.countRenderableColumnsInRange(highlight.col, _notHiddenColumnIndex) - 1, 1);
710
- }
629
+ columnsToSelect.push(columnIndex, columnIndex + origColspan - 1);
711
630
  }
631
+ (_this$hot = this.hot).selectColumns.apply(_this$hot, columnsToSelect);
712
632
  }
713
633
 
714
634
  /**
@@ -194,12 +194,6 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
194
194
  this.addHook('beforeOnCellMouseOver', function () {
195
195
  return _this2.onBeforeOnCellMouseOver.apply(_this2, arguments);
196
196
  });
197
- this.addHook('modifyTransformStart', function () {
198
- return _this2.onModifyTransformStart.apply(_this2, arguments);
199
- });
200
- this.addHook('afterSelection', function () {
201
- return _this2.updateFocusHighlightPosition();
202
- });
203
197
  this.addHook('afterGetColumnHeaderRenderers', function (array) {
204
198
  return _this2.onAfterGetColumnHeaderRenderers(array);
205
199
  });
@@ -218,12 +212,6 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
218
212
  this.addHook('afterViewportColumnCalculatorOverride', function () {
219
213
  return _this2.onAfterViewportColumnCalculatorOverride.apply(_this2, arguments);
220
214
  });
221
- this.hot.columnIndexMapper.addLocalHook('cacheUpdated', function () {
222
- return _this2.updateFocusHighlightPosition();
223
- });
224
- this.hot.rowIndexMapper.addLocalHook('cacheUpdated', function () {
225
- return _this2.updateFocusHighlightPosition();
226
- });
227
215
  _get(_getPrototypeOf(NestedHeaders.prototype), "enablePlugin", this).call(this);
228
216
  this.updatePlugin(); // @TODO: Workaround for broken plugin initialization abstraction.
229
217
  }
@@ -445,34 +433,6 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
445
433
  return this.hot.getColHeader(visualColumnIndex, headerLevel);
446
434
  }
447
435
 
448
- /**
449
- * Updates the selection focus highlight position to point to the nested header root element (TH)
450
- * even when the logical coordinates point in-between the header.
451
- *
452
- * @private
453
- */
454
- }, {
455
- key: "updateFocusHighlightPosition",
456
- value: function updateFocusHighlightPosition() {
457
- var _this$hot;
458
- var selection = (_this$hot = this.hot) === null || _this$hot === void 0 ? void 0 : _this$hot.getSelectedRangeLast();
459
- if (!selection) {
460
- return;
461
- }
462
- var highlight = selection.highlight;
463
- var isNestedHeadersRange = highlight.isHeader() && highlight.col >= 0;
464
- if (isNestedHeadersRange) {
465
- var columnIndex = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(highlight.row, highlight.col);
466
- var focusHighlight = this.hot.selection.highlight.getFocus();
467
-
468
- // Correct the highlight/focus selection to highlight the correct TH element
469
- focusHighlight.visualCellRange.highlight.col = columnIndex;
470
- focusHighlight.visualCellRange.from.col = columnIndex;
471
- focusHighlight.visualCellRange.to.col = columnIndex;
472
- focusHighlight.commit();
473
- }
474
- }
475
-
476
436
  /**
477
437
  * Allows to control which header DOM element will be used to highlight.
478
438
  *
@@ -489,7 +449,8 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
489
449
  if (!headerNodeData) {
490
450
  return visualColumn;
491
451
  }
492
- var columnCursor = highlightMeta.columnCursor,
452
+ var classNames = highlightMeta.classNames,
453
+ columnCursor = highlightMeta.columnCursor,
493
454
  selectionType = highlightMeta.selectionType,
494
455
  selectionWidth = highlightMeta.selectionWidth;
495
456
  var _classPrivateFieldGet4 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumn),
@@ -501,8 +462,8 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
501
462
  }
502
463
  } else if (selectionType === ACTIVE_HEADER_TYPE) {
503
464
  if (colspan > selectionWidth - columnCursor || !isRoot) {
504
- // Prevents adding any CSS class names to the TH element
505
- return null;
465
+ // Reset the class names array so the generated TH element won't be modified.
466
+ classNames.length = 0;
506
467
  }
507
468
  }
508
469
  return visualColumn;
@@ -633,7 +594,7 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
633
594
  }, {
634
595
  key: "onBeforeOnCellMouseOver",
635
596
  value: function onBeforeOnCellMouseOver(event, coords, TD, controller) {
636
- var _this$hot$selection;
597
+ var _this$hot;
637
598
  if (!this.hot.view.isMouseDown()) {
638
599
  return;
639
600
  }
@@ -654,54 +615,13 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
654
615
  controller.cell = true;
655
616
  var columnsToSelect = [];
656
617
  if (coords.col < from.col) {
657
- columnsToSelect.push(bottomEndCoords.col, columnIndex, coords.row);
618
+ columnsToSelect.push(bottomEndCoords.col, columnIndex);
658
619
  } else if (coords.col > from.col) {
659
- columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1, coords.row);
620
+ columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1);
660
621
  } else {
661
- columnsToSelect.push(columnIndex, columnIndex + origColspan - 1, coords.row);
662
- }
663
- (_this$hot$selection = this.hot.selection).selectColumns.apply(_this$hot$selection, columnsToSelect);
664
- }
665
-
666
- /**
667
- * `modifyTransformStart` hook is called every time the keyboard navigation is used.
668
- *
669
- * @private
670
- * @param {object} delta The transformation delta.
671
- */
672
- }, {
673
- key: "onModifyTransformStart",
674
- value: function onModifyTransformStart(delta) {
675
- var _this$hot$getSelected = this.hot.getSelectedRangeLast(),
676
- highlight = _this$hot$getSelected.highlight;
677
- var nextCoords = this.hot._createCellCoords(highlight.row + delta.row, highlight.col + delta.col);
678
- var isNestedHeadersRange = nextCoords.isHeader() && nextCoords.col >= 0;
679
- if (!isNestedHeadersRange) {
680
- return;
681
- }
682
- var visualColumnIndexStart = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(nextCoords.row, nextCoords.col);
683
- var visualColumnIndexEnd = _classPrivateFieldGet(this, _stateManager).findRightMostColumnIndex(nextCoords.row, nextCoords.col);
684
- if (delta.col < 0) {
685
- var nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexStart - 1 : visualColumnIndexEnd;
686
- var notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(nextColumn, -1);
687
- if (notHiddenColumnIndex === null) {
688
- // There are no visible columns anymore, so move the selection out of the table edge. This will
689
- // be processed by the selection Transformer class as a move selection to the previous row (if autoWrapRow is enabled).
690
- delta.col = -this.hot.view.countRenderableColumnsInRange(0, highlight.col);
691
- } else {
692
- delta.col = -Math.max(this.hot.view.countRenderableColumnsInRange(notHiddenColumnIndex, highlight.col) - 1, 1);
693
- }
694
- } else if (delta.col > 0) {
695
- var _nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexEnd + 1 : visualColumnIndexStart;
696
- var _notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(_nextColumn, 1);
697
- if (_notHiddenColumnIndex === null) {
698
- // There are no visible columns anymore, so move the selection out of the table edge. This will
699
- // be processed by the selection Transformer class as a move selection to the next row (if autoWrapRow is enabled).
700
- delta.col = this.hot.view.countRenderableColumnsInRange(highlight.col, this.hot.countCols());
701
- } else {
702
- delta.col = Math.max(this.hot.view.countRenderableColumnsInRange(highlight.col, _notHiddenColumnIndex) - 1, 1);
703
- }
622
+ columnsToSelect.push(columnIndex, columnIndex + origColspan - 1);
704
623
  }
624
+ (_this$hot = this.hot).selectColumns.apply(_this$hot, columnsToSelect);
705
625
  }
706
626
 
707
627
  /**