handsontable 0.0.0-next-a01036f-20230508 → 0.0.0-next-48677e7-20230509

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 (227) hide show
  1. package/3rdparty/walkontable/src/cell/coords.js +40 -13
  2. package/3rdparty/walkontable/src/cell/coords.mjs +40 -13
  3. package/3rdparty/walkontable/src/cell/range.js +29 -25
  4. package/3rdparty/walkontable/src/cell/range.mjs +28 -24
  5. package/3rdparty/walkontable/src/core/_base.js +9 -3
  6. package/3rdparty/walkontable/src/core/_base.mjs +9 -3
  7. package/3rdparty/walkontable/src/core/clone.js +2 -2
  8. package/3rdparty/walkontable/src/core/clone.mjs +2 -2
  9. package/3rdparty/walkontable/src/core/core.js +3 -2
  10. package/3rdparty/walkontable/src/core/core.mjs +3 -2
  11. package/3rdparty/walkontable/src/event.js +12 -10
  12. package/3rdparty/walkontable/src/event.mjs +12 -10
  13. package/3rdparty/walkontable/src/facade/core.js +2 -2
  14. package/3rdparty/walkontable/src/facade/core.mjs +2 -2
  15. package/3rdparty/walkontable/src/index.js +10 -2
  16. package/3rdparty/walkontable/src/index.mjs +2 -2
  17. package/3rdparty/walkontable/src/overlay/_base.js +8 -7
  18. package/3rdparty/walkontable/src/overlay/_base.mjs +8 -7
  19. package/3rdparty/walkontable/src/overlay/bottom.js +7 -6
  20. package/3rdparty/walkontable/src/overlay/bottom.mjs +7 -6
  21. package/3rdparty/walkontable/src/overlay/inlineStart.js +2 -4
  22. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -4
  23. package/3rdparty/walkontable/src/overlay/top.js +9 -10
  24. package/3rdparty/walkontable/src/overlay/top.mjs +9 -10
  25. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +12 -10
  26. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +12 -10
  27. package/3rdparty/walkontable/src/overlays.js +64 -55
  28. package/3rdparty/walkontable/src/overlays.mjs +64 -55
  29. package/3rdparty/walkontable/src/renderer/table.js +2 -0
  30. package/3rdparty/walkontable/src/renderer/table.mjs +2 -0
  31. package/3rdparty/walkontable/src/scroll.js +23 -20
  32. package/3rdparty/walkontable/src/scroll.mjs +23 -20
  33. package/3rdparty/walkontable/src/{border.js → selection/border/border.js} +7 -12
  34. package/3rdparty/walkontable/src/{border.mjs → selection/border/border.mjs} +7 -12
  35. package/3rdparty/walkontable/src/selection/border/constants.js +18 -0
  36. package/3rdparty/walkontable/src/selection/border/constants.mjs +13 -0
  37. package/3rdparty/walkontable/src/selection/constants.js +63 -0
  38. package/3rdparty/walkontable/src/selection/constants.mjs +51 -0
  39. package/3rdparty/walkontable/src/selection/index.js +30 -0
  40. package/3rdparty/walkontable/src/selection/index.mjs +5 -0
  41. package/3rdparty/walkontable/src/selection/manager.js +334 -0
  42. package/3rdparty/walkontable/src/selection/manager.mjs +328 -0
  43. package/3rdparty/walkontable/src/selection/scanner.js +363 -0
  44. package/3rdparty/walkontable/src/selection/scanner.mjs +359 -0
  45. package/3rdparty/walkontable/src/selection/selection.js +133 -0
  46. package/3rdparty/walkontable/src/selection/selection.mjs +127 -0
  47. package/3rdparty/walkontable/src/settings.js +15 -13
  48. package/3rdparty/walkontable/src/settings.mjs +15 -13
  49. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +9 -0
  50. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +9 -0
  51. package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +9 -0
  52. package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +9 -0
  53. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +9 -0
  54. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +9 -0
  55. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +9 -0
  56. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +9 -0
  57. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +9 -0
  58. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +9 -0
  59. package/3rdparty/walkontable/src/table.js +33 -101
  60. package/3rdparty/walkontable/src/table.mjs +34 -102
  61. package/base.js +4 -2
  62. package/base.mjs +2 -2
  63. package/core.d.ts +4 -0
  64. package/core.js +52 -19
  65. package/core.mjs +52 -19
  66. package/dataMap/dataSource.js +5 -5
  67. package/dataMap/dataSource.mjs +5 -5
  68. package/dataMap/metaManager/metaSchema.js +8 -1
  69. package/dataMap/metaManager/metaSchema.mjs +8 -1
  70. package/dist/handsontable.css +7 -2
  71. package/dist/handsontable.full.css +7 -2
  72. package/dist/handsontable.full.js +9413 -9096
  73. package/dist/handsontable.full.min.css +3 -3
  74. package/dist/handsontable.full.min.js +115 -123
  75. package/dist/handsontable.js +9501 -9183
  76. package/dist/handsontable.min.css +3 -3
  77. package/dist/handsontable.min.js +3 -11
  78. package/dist/languages/all.js +0 -133
  79. package/dist/languages/ar-AR.js +0 -7
  80. package/dist/languages/cs-CZ.js +0 -7
  81. package/dist/languages/de-CH.js +0 -7
  82. package/dist/languages/de-DE.js +0 -7
  83. package/dist/languages/en-US.js +0 -7
  84. package/dist/languages/es-MX.js +0 -7
  85. package/dist/languages/fr-FR.js +0 -7
  86. package/dist/languages/it-IT.js +0 -7
  87. package/dist/languages/ja-JP.js +0 -7
  88. package/dist/languages/ko-KR.js +0 -7
  89. package/dist/languages/lv-LV.js +0 -7
  90. package/dist/languages/nb-NO.js +0 -7
  91. package/dist/languages/nl-NL.js +0 -7
  92. package/dist/languages/pl-PL.js +0 -7
  93. package/dist/languages/pt-BR.js +0 -7
  94. package/dist/languages/ru-RU.js +0 -7
  95. package/dist/languages/sr-SP.js +0 -7
  96. package/dist/languages/zh-CN.js +0 -7
  97. package/dist/languages/zh-TW.js +0 -7
  98. package/editorManager.js +7 -3
  99. package/editorManager.mjs +7 -3
  100. package/editors/textEditor/textEditor.js +3 -16
  101. package/editors/textEditor/textEditor.mjs +4 -17
  102. package/focusManager.d.ts +12 -0
  103. package/focusManager.js +249 -0
  104. package/focusManager.mjs +245 -0
  105. package/helpers/dom/element.js +11 -0
  106. package/helpers/dom/element.mjs +10 -0
  107. package/helpers/mixed.js +1 -1
  108. package/helpers/mixed.mjs +1 -1
  109. package/i18n/languages/ar-AR.js +1 -7
  110. package/i18n/languages/cs-CZ.js +1 -7
  111. package/i18n/languages/de-CH.js +1 -7
  112. package/i18n/languages/de-DE.js +1 -7
  113. package/i18n/languages/en-US.js +1 -7
  114. package/i18n/languages/es-MX.js +1 -7
  115. package/i18n/languages/fr-FR.js +1 -7
  116. package/i18n/languages/it-IT.js +1 -7
  117. package/i18n/languages/ja-JP.js +1 -7
  118. package/i18n/languages/ko-KR.js +1 -7
  119. package/i18n/languages/lv-LV.js +1 -7
  120. package/i18n/languages/nb-NO.js +1 -7
  121. package/i18n/languages/nl-NL.js +1 -7
  122. package/i18n/languages/pl-PL.js +1 -7
  123. package/i18n/languages/pt-BR.js +1 -7
  124. package/i18n/languages/ru-RU.js +1 -7
  125. package/i18n/languages/sr-SP.js +1 -7
  126. package/i18n/languages/zh-CN.js +1 -7
  127. package/i18n/languages/zh-TW.js +1 -7
  128. package/languages/all.js +0 -133
  129. package/languages/ar-AR.js +0 -7
  130. package/languages/cs-CZ.js +0 -7
  131. package/languages/de-CH.js +0 -7
  132. package/languages/de-DE.js +0 -7
  133. package/languages/en-US.js +0 -7
  134. package/languages/es-MX.js +0 -7
  135. package/languages/fr-FR.js +0 -7
  136. package/languages/index.js +0 -133
  137. package/languages/it-IT.js +0 -7
  138. package/languages/ja-JP.js +0 -7
  139. package/languages/ko-KR.js +0 -7
  140. package/languages/lv-LV.js +0 -7
  141. package/languages/nb-NO.js +0 -7
  142. package/languages/nl-NL.js +0 -7
  143. package/languages/pl-PL.js +0 -7
  144. package/languages/pt-BR.js +0 -7
  145. package/languages/ru-RU.js +0 -7
  146. package/languages/sr-SP.js +0 -7
  147. package/languages/zh-CN.js +0 -7
  148. package/languages/zh-TW.js +0 -7
  149. package/package.json +2 -3
  150. package/pluginHooks.js +7 -17
  151. package/pluginHooks.mjs +4 -16
  152. package/plugins/autoRowSize/autoRowSize.js +2 -2
  153. package/plugins/autoRowSize/autoRowSize.mjs +2 -2
  154. package/plugins/copyPaste/copyPaste.js +12 -93
  155. package/plugins/copyPaste/copyPaste.mjs +12 -93
  156. package/plugins/copyPaste/copyableRanges.js +31 -25
  157. package/plugins/copyPaste/copyableRanges.mjs +24 -18
  158. package/plugins/customBorders/customBorders.js +6 -2
  159. package/plugins/customBorders/customBorders.mjs +7 -3
  160. package/plugins/filters/filters.js +0 -5
  161. package/plugins/filters/filters.mjs +0 -5
  162. package/plugins/formulas/formulas.js +168 -190
  163. package/plugins/formulas/formulas.mjs +168 -190
  164. package/plugins/mergeCells/mergeCells.js +0 -16
  165. package/plugins/mergeCells/mergeCells.mjs +0 -16
  166. package/plugins/nestedHeaders/nestedHeaders.js +3 -4
  167. package/plugins/nestedHeaders/nestedHeaders.mjs +3 -4
  168. package/plugins/nestedHeaders/stateManager/headersTree.js +26 -23
  169. package/plugins/nestedHeaders/stateManager/headersTree.mjs +23 -20
  170. package/plugins/nestedHeaders/stateManager/index.js +3 -3
  171. package/plugins/nestedHeaders/stateManager/matrixGenerator.js +0 -1
  172. package/plugins/nestedHeaders/stateManager/settingsNormalizer.js +1 -1
  173. package/plugins/nestedHeaders/utils/ghostTable.js +35 -30
  174. package/plugins/nestedHeaders/utils/ghostTable.mjs +35 -30
  175. package/plugins/registry.js +1 -3
  176. package/plugins/undoRedo/undoRedo.js +1 -0
  177. package/plugins/undoRedo/undoRedo.mjs +1 -0
  178. package/renderers/baseRenderer/baseRenderer.js +3 -0
  179. package/renderers/baseRenderer/baseRenderer.mjs +3 -0
  180. package/selection/highlight/highlight.js +335 -133
  181. package/selection/highlight/highlight.mjs +325 -129
  182. package/selection/highlight/types/activeHeader.js +10 -9
  183. package/selection/highlight/types/activeHeader.mjs +10 -8
  184. package/selection/highlight/types/area.js +12 -27
  185. package/selection/highlight/types/area.mjs +16 -30
  186. package/selection/highlight/types/areaLayered.js +54 -0
  187. package/selection/highlight/types/areaLayered.mjs +49 -0
  188. package/selection/highlight/types/column.js +50 -0
  189. package/selection/highlight/types/column.mjs +45 -0
  190. package/selection/highlight/types/customSelection.js +7 -10
  191. package/selection/highlight/types/customSelection.mjs +7 -9
  192. package/selection/highlight/types/fill.js +5 -8
  193. package/selection/highlight/types/fill.mjs +5 -7
  194. package/selection/highlight/types/{cell.js → focus.js} +5 -8
  195. package/selection/highlight/types/{cell.mjs → focus.mjs} +5 -7
  196. package/selection/highlight/types/header.js +10 -20
  197. package/selection/highlight/types/header.mjs +10 -19
  198. package/selection/highlight/types/{index.js → row.js} +27 -31
  199. package/selection/highlight/types/{index.mjs → row.mjs} +24 -29
  200. package/selection/highlight/visualSelection.js +12 -21
  201. package/selection/highlight/visualSelection.mjs +12 -21
  202. package/selection/index.js +4 -7
  203. package/selection/index.mjs +2 -3
  204. package/selection/selection.js +88 -46
  205. package/selection/selection.mjs +82 -44
  206. package/settings.d.ts +1 -0
  207. package/tableView.js +94 -66
  208. package/tableView.mjs +94 -66
  209. package/translations/changesObservable/observable.js +46 -41
  210. package/translations/changesObservable/observable.mjs +41 -36
  211. package/translations/changesObservable/observer.js +1 -1
  212. package/translations/indexMapper.js +0 -21
  213. package/translations/indexMapper.mjs +0 -21
  214. package/utils/dataStructures/tree.js +18 -15
  215. package/utils/dataStructures/tree.mjs +18 -15
  216. package/utils/parseTable.js +1 -5
  217. package/utils/parseTable.mjs +1 -5
  218. package/3rdparty/walkontable/src/selection.js +0 -354
  219. package/3rdparty/walkontable/src/selection.mjs +0 -348
  220. package/plugins/copyPaste/focusableElement.js +0 -219
  221. package/plugins/copyPaste/focusableElement.mjs +0 -213
  222. package/plugins/formulas/indexSyncer/axisSyncer.js +0 -379
  223. package/plugins/formulas/indexSyncer/axisSyncer.mjs +0 -374
  224. package/plugins/formulas/indexSyncer/index.js +0 -225
  225. package/plugins/formulas/indexSyncer/index.mjs +0 -219
  226. package/selection/highlight/constants.js +0 -16
  227. package/selection/highlight/constants.mjs +0 -6
@@ -5,6 +5,8 @@ require("core-js/modules/es.object.freeze.js");
5
5
  require("core-js/modules/es.symbol.iterator.js");
6
6
  require("core-js/modules/es.function.name.js");
7
7
  require("core-js/modules/es.regexp.exec.js");
8
+ require("core-js/modules/es.weak-map.js");
9
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
8
10
  exports.__esModule = true;
9
11
  exports.default = void 0;
10
12
  require("core-js/modules/es.array.iterator.js");
@@ -23,8 +25,7 @@ require("core-js/modules/es.symbol.to-primitive.js");
23
25
  require("core-js/modules/es.date.to-primitive.js");
24
26
  require("core-js/modules/es.symbol.js");
25
27
  require("core-js/modules/es.symbol.description.js");
26
- var _highlight = _interopRequireDefault(require("./highlight/highlight"));
27
- var _constants = require("./highlight/constants");
28
+ var _highlight = _interopRequireWildcard(require("./highlight/highlight"));
28
29
  var _range = _interopRequireDefault(require("./range"));
29
30
  var _object = require("./../helpers/object");
30
31
  var _mixed = require("./../helpers/mixed");
@@ -35,6 +36,8 @@ var _utils = require("./utils");
35
36
  var _templateLiteralTag = require("./../helpers/templateLiteralTag");
36
37
  var _templateObject;
37
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
39
+ 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); }
40
+ 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; }
38
41
  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); }
39
42
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
40
43
  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."); }
@@ -152,6 +155,12 @@ var Selection = /*#__PURE__*/function () {
152
155
  countCols: function countCols() {
153
156
  return _this.tableProps.countColsTranslated();
154
157
  },
158
+ countRowHeaders: function countRowHeaders() {
159
+ return _this.tableProps.countRowHeaders();
160
+ },
161
+ countColHeaders: function countColHeaders() {
162
+ return _this.tableProps.countColHeaders();
163
+ },
155
164
  visualToRenderableCoords: function visualToRenderableCoords(coords) {
156
165
  return _this.tableProps.visualToRenderableCoords(coords);
157
166
  },
@@ -336,9 +345,9 @@ var Selection = /*#__PURE__*/function () {
336
345
  }
337
346
 
338
347
  // Set up current selection.
339
- this.highlight.getCell().clear();
340
- if (this.highlight.isEnabledFor(_constants.CELL_TYPE, cellRange.highlight)) {
341
- this.highlight.getCell().add(this.selectedRange.current().highlight).commit().syncWith(cellRange);
348
+ this.highlight.getFocus().clear();
349
+ if (this.highlight.isEnabledFor(_highlight.FOCUS_TYPE, cellRange.highlight)) {
350
+ this.highlight.getFocus().add(this.selectedRange.current().highlight).commit().syncWith(cellRange);
342
351
  }
343
352
  var layerLevel = this.getLayerLevel();
344
353
 
@@ -348,64 +357,85 @@ var Selection = /*#__PURE__*/function () {
348
357
  (0, _array.arrayEach)(this.highlight.getAreas(), function (highlight) {
349
358
  return void highlight.clear();
350
359
  });
351
- (0, _array.arrayEach)(this.highlight.getHeaders(), function (highlight) {
360
+ (0, _array.arrayEach)(this.highlight.getLayeredAreas(), function (highlight) {
361
+ return void highlight.clear();
362
+ });
363
+ (0, _array.arrayEach)(this.highlight.getRowHeaders(), function (highlight) {
364
+ return void highlight.clear();
365
+ });
366
+ (0, _array.arrayEach)(this.highlight.getColumnHeaders(), function (highlight) {
367
+ return void highlight.clear();
368
+ });
369
+ (0, _array.arrayEach)(this.highlight.getActiveRowHeaders(), function (highlight) {
370
+ return void highlight.clear();
371
+ });
372
+ (0, _array.arrayEach)(this.highlight.getActiveColumnHeaders(), function (highlight) {
373
+ return void highlight.clear();
374
+ });
375
+ (0, _array.arrayEach)(this.highlight.getRowHighlights(), function (highlight) {
352
376
  return void highlight.clear();
353
377
  });
354
- (0, _array.arrayEach)(this.highlight.getActiveHeaders(), function (highlight) {
378
+ (0, _array.arrayEach)(this.highlight.getColumnHighlights(), function (highlight) {
355
379
  return void highlight.clear();
356
380
  });
357
381
  }
358
382
  this.highlight.useLayerLevel(layerLevel);
359
- var areaHighlight = this.highlight.createOrGetArea();
360
- var headerHighlight = this.highlight.createOrGetHeader();
361
- var activeHeaderHighlight = this.highlight.createOrGetActiveHeader();
383
+ var areaHighlight = this.highlight.createArea();
384
+ var layeredAreaHighlight = this.highlight.createLayeredArea();
385
+ var rowHeaderHighlight = this.highlight.createRowHeader();
386
+ var columnHeaderHighlight = this.highlight.createColumnHeader();
387
+ var activeRowHeaderHighlight = this.highlight.createActiveRowHeader();
388
+ var activeColumnHeaderHighlight = this.highlight.createActiveColumnHeader();
389
+ var rowHighlight = this.highlight.createRowHighlight();
390
+ var columnHighlight = this.highlight.createColumnHighlight();
362
391
  areaHighlight.clear();
363
- headerHighlight.clear();
364
- activeHeaderHighlight.clear();
365
- if (this.highlight.isEnabledFor(_constants.AREA_TYPE, cellRange.highlight) && (this.isMultiple() || layerLevel >= 1)) {
392
+ layeredAreaHighlight.clear();
393
+ rowHeaderHighlight.clear();
394
+ columnHeaderHighlight.clear();
395
+ activeRowHeaderHighlight.clear();
396
+ activeColumnHeaderHighlight.clear();
397
+ rowHighlight.clear();
398
+ columnHighlight.clear();
399
+ if (this.highlight.isEnabledFor(_highlight.AREA_TYPE, cellRange.highlight) && (this.isMultiple() || layerLevel >= 1)) {
366
400
  areaHighlight.add(cellRange.from).add(cellRange.to).commit();
401
+ layeredAreaHighlight.add(cellRange.from).add(cellRange.to).commit();
367
402
  if (layerLevel === 1) {
368
403
  // For single cell selection in the same layer, we do not create area selection to prevent blue background.
369
404
  // When non-consecutive selection is performed we have to add that missing area selection to the previous layer
370
405
  // based on previous coordinates. It only occurs when the previous selection wasn't select multiple cells.
371
406
  var previousRange = this.selectedRange.previous();
372
- this.highlight.useLayerLevel(layerLevel - 1).createOrGetArea().add(previousRange.from).commit()
407
+ this.highlight.useLayerLevel(layerLevel - 1);
408
+ this.highlight.createArea().add(previousRange.from).commit()
409
+ // Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).
410
+ .syncWith(previousRange);
411
+ this.highlight.createLayeredArea().add(previousRange.from).commit()
373
412
  // Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).
374
413
  .syncWith(previousRange);
375
414
  this.highlight.useLayerLevel(layerLevel);
376
415
  }
377
416
  }
378
- if (this.highlight.isEnabledFor(_constants.HEADER_TYPE, cellRange.highlight)) {
379
- // The header selection generally contains cell selection. In a case when all rows (or columns)
380
- // are hidden that visual coordinates are translated to renderable coordinates that do not exist.
381
- // Hence no header highlight is generated. In that case, to make a column (or a row) header
382
- // highlight, the row and column index has to point to the header (the negative value). See #7052.
383
- var areAnyRowsRendered = this.tableProps.countRowsTranslated() === 0;
384
- var areAnyColumnsRendered = this.tableProps.countColsTranslated() === 0;
385
- var headerCellRange = cellRange;
386
- if (areAnyRowsRendered || areAnyColumnsRendered) {
387
- headerCellRange = cellRange.clone();
388
- }
389
- if (areAnyRowsRendered) {
390
- headerCellRange.from.row = -1;
391
- }
392
- if (areAnyColumnsRendered) {
393
- headerCellRange.from.col = -1;
394
- }
417
+ if (this.highlight.isEnabledFor(_highlight.HEADER_TYPE, cellRange.highlight)) {
418
+ var rowCoordsFrom = this.tableProps.createCellCoords(Math.max(cellRange.from.row, 0), -1);
419
+ var rowCoordsTo = this.tableProps.createCellCoords(cellRange.to.row, -1);
420
+ var columnCoordsFrom = this.tableProps.createCellCoords(-1, Math.max(cellRange.from.col, 0));
421
+ var columnCoordsTo = this.tableProps.createCellCoords(-1, cellRange.to.col);
395
422
  if (this.settings.selectionMode === 'single') {
396
- if (this.isSelectedByAnyHeader()) {
397
- headerCellRange.from.normalize();
398
- }
399
- headerHighlight.add(headerCellRange.from).commit();
423
+ rowHeaderHighlight.add(rowCoordsFrom).commit();
424
+ columnHeaderHighlight.add(columnCoordsFrom).commit();
425
+ rowHighlight.add(rowCoordsFrom).commit();
426
+ columnHighlight.add(columnCoordsFrom).commit();
400
427
  } else {
401
- headerHighlight.add(headerCellRange.from).add(headerCellRange.to).commit();
428
+ rowHeaderHighlight.add(rowCoordsFrom).add(rowCoordsTo).commit();
429
+ columnHeaderHighlight.add(columnCoordsFrom).add(columnCoordsTo).commit();
430
+ rowHighlight.add(rowCoordsFrom).add(rowCoordsTo).commit();
431
+ columnHighlight.add(columnCoordsFrom).add(columnCoordsTo).commit();
402
432
  }
403
433
  if (this.isEntireRowSelected()) {
404
434
  var isRowSelected = this.tableProps.countCols() === cellRange.getWidth();
405
435
 
406
436
  // Make sure that the whole row is selected (in case where selectionMode is set to 'single')
407
437
  if (isRowSelected) {
408
- activeHeaderHighlight.add(this.tableProps.createCellCoords(cellRange.from.row, -1)).add(this.tableProps.createCellCoords(cellRange.to.row, -1)).commit();
438
+ activeRowHeaderHighlight.add(this.tableProps.createCellCoords(cellRange.from.row, Math.min(-this.tableProps.countRowHeaders(), -1))).add(this.tableProps.createCellCoords(cellRange.to.row, -1)).commit();
409
439
  }
410
440
  }
411
441
  if (this.isEntireColumnSelected()) {
@@ -413,7 +443,7 @@ var Selection = /*#__PURE__*/function () {
413
443
 
414
444
  // Make sure that the whole column is selected (in case where selectionMode is set to 'single')
415
445
  if (isColumnSelected) {
416
- activeHeaderHighlight.add(this.tableProps.createCellCoords(-1, cellRange.from.col)).add(this.tableProps.createCellCoords(-1, cellRange.to.col)).commit();
446
+ activeColumnHeaderHighlight.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(), -1), cellRange.from.col)).add(this.tableProps.createCellCoords(-1, cellRange.to.col)).commit();
417
447
  }
418
448
  }
419
449
  }
@@ -648,7 +678,9 @@ var Selection = /*#__PURE__*/function () {
648
678
  if (!includeRowHeaders && !includeColumnHeaders && (nrOfRows === 0 || nrOfColumns === 0)) {
649
679
  return;
650
680
  }
651
- var startCoords = this.tableProps.createCellCoords(includeColumnHeaders ? -1 : 0, includeRowHeaders ? -1 : 0);
681
+ var rowFrom = includeColumnHeaders ? -this.tableProps.countColHeaders() : 0;
682
+ var columnFrom = includeRowHeaders ? -this.tableProps.countRowHeaders() : 0;
683
+ var startCoords = this.tableProps.createCellCoords(rowFrom, columnFrom);
652
684
  var endCoords = this.tableProps.createCellCoords(nrOfRows - 1, nrOfColumns - 1);
653
685
  this.clear();
654
686
  this.setRangeStartOnly(startCoords);
@@ -782,19 +814,29 @@ var Selection = /*#__PURE__*/function () {
782
814
  if (!this.isSelected()) {
783
815
  return;
784
816
  }
785
- var cellHighlight = this.highlight.getCell();
817
+ var focusHighlight = this.highlight.getFocus();
786
818
  var currentLayer = this.getLayerLevel();
787
- cellHighlight.commit().syncWith(this.selectedRange.current());
819
+ focusHighlight.commit().syncWith(this.selectedRange.current());
788
820
 
789
821
  // Rewriting rendered ranges going through all layers.
790
822
  for (var layerLevel = 0; layerLevel < this.selectedRange.size(); layerLevel += 1) {
791
823
  this.highlight.useLayerLevel(layerLevel);
792
- var areaHighlight = this.highlight.createOrGetArea();
793
- var headerHighlight = this.highlight.createOrGetHeader();
794
- var activeHeaderHighlight = this.highlight.createOrGetActiveHeader();
824
+ var areaHighlight = this.highlight.createArea();
825
+ var areaLayeredHighlight = this.highlight.createLayeredArea();
826
+ var rowHeaderHighlight = this.highlight.createRowHeader();
827
+ var columnHeaderHighlight = this.highlight.createColumnHeader();
828
+ var activeRowHeaderHighlight = this.highlight.createActiveRowHeader();
829
+ var activeColumnHeaderHighlight = this.highlight.createActiveColumnHeader();
830
+ var rowHighlight = this.highlight.createRowHighlight();
831
+ var columnHighlight = this.highlight.createColumnHighlight();
795
832
  areaHighlight.commit();
796
- headerHighlight.commit();
797
- activeHeaderHighlight.commit();
833
+ areaLayeredHighlight.commit();
834
+ rowHeaderHighlight.commit();
835
+ columnHeaderHighlight.commit();
836
+ activeRowHeaderHighlight.commit();
837
+ activeColumnHeaderHighlight.commit();
838
+ rowHighlight.commit();
839
+ columnHighlight.commit();
798
840
  }
799
841
 
800
842
  // Reverting starting layer for the Highlight.
@@ -33,8 +33,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
33
33
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
34
34
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
35
35
  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); }
36
- import Highlight from "./highlight/highlight.mjs";
37
- import { AREA_TYPE, HEADER_TYPE, CELL_TYPE } from "./highlight/constants.mjs";
36
+ import Highlight, { AREA_TYPE, HEADER_TYPE, FOCUS_TYPE } from "./highlight/highlight.mjs";
38
37
  import SelectionRange from "./range.mjs";
39
38
  import { createObjectPropListener, mixin } from "./../helpers/object.mjs";
40
39
  import { isUndefined } from "./../helpers/mixed.mjs";
@@ -147,6 +146,12 @@ var Selection = /*#__PURE__*/function () {
147
146
  countCols: function countCols() {
148
147
  return _this.tableProps.countColsTranslated();
149
148
  },
149
+ countRowHeaders: function countRowHeaders() {
150
+ return _this.tableProps.countRowHeaders();
151
+ },
152
+ countColHeaders: function countColHeaders() {
153
+ return _this.tableProps.countColHeaders();
154
+ },
150
155
  visualToRenderableCoords: function visualToRenderableCoords(coords) {
151
156
  return _this.tableProps.visualToRenderableCoords(coords);
152
157
  },
@@ -331,9 +336,9 @@ var Selection = /*#__PURE__*/function () {
331
336
  }
332
337
 
333
338
  // Set up current selection.
334
- this.highlight.getCell().clear();
335
- if (this.highlight.isEnabledFor(CELL_TYPE, cellRange.highlight)) {
336
- this.highlight.getCell().add(this.selectedRange.current().highlight).commit().syncWith(cellRange);
339
+ this.highlight.getFocus().clear();
340
+ if (this.highlight.isEnabledFor(FOCUS_TYPE, cellRange.highlight)) {
341
+ this.highlight.getFocus().add(this.selectedRange.current().highlight).commit().syncWith(cellRange);
337
342
  }
338
343
  var layerLevel = this.getLayerLevel();
339
344
 
@@ -343,64 +348,85 @@ var Selection = /*#__PURE__*/function () {
343
348
  arrayEach(this.highlight.getAreas(), function (highlight) {
344
349
  return void highlight.clear();
345
350
  });
346
- arrayEach(this.highlight.getHeaders(), function (highlight) {
351
+ arrayEach(this.highlight.getLayeredAreas(), function (highlight) {
352
+ return void highlight.clear();
353
+ });
354
+ arrayEach(this.highlight.getRowHeaders(), function (highlight) {
355
+ return void highlight.clear();
356
+ });
357
+ arrayEach(this.highlight.getColumnHeaders(), function (highlight) {
358
+ return void highlight.clear();
359
+ });
360
+ arrayEach(this.highlight.getActiveRowHeaders(), function (highlight) {
361
+ return void highlight.clear();
362
+ });
363
+ arrayEach(this.highlight.getActiveColumnHeaders(), function (highlight) {
364
+ return void highlight.clear();
365
+ });
366
+ arrayEach(this.highlight.getRowHighlights(), function (highlight) {
347
367
  return void highlight.clear();
348
368
  });
349
- arrayEach(this.highlight.getActiveHeaders(), function (highlight) {
369
+ arrayEach(this.highlight.getColumnHighlights(), function (highlight) {
350
370
  return void highlight.clear();
351
371
  });
352
372
  }
353
373
  this.highlight.useLayerLevel(layerLevel);
354
- var areaHighlight = this.highlight.createOrGetArea();
355
- var headerHighlight = this.highlight.createOrGetHeader();
356
- var activeHeaderHighlight = this.highlight.createOrGetActiveHeader();
374
+ var areaHighlight = this.highlight.createArea();
375
+ var layeredAreaHighlight = this.highlight.createLayeredArea();
376
+ var rowHeaderHighlight = this.highlight.createRowHeader();
377
+ var columnHeaderHighlight = this.highlight.createColumnHeader();
378
+ var activeRowHeaderHighlight = this.highlight.createActiveRowHeader();
379
+ var activeColumnHeaderHighlight = this.highlight.createActiveColumnHeader();
380
+ var rowHighlight = this.highlight.createRowHighlight();
381
+ var columnHighlight = this.highlight.createColumnHighlight();
357
382
  areaHighlight.clear();
358
- headerHighlight.clear();
359
- activeHeaderHighlight.clear();
383
+ layeredAreaHighlight.clear();
384
+ rowHeaderHighlight.clear();
385
+ columnHeaderHighlight.clear();
386
+ activeRowHeaderHighlight.clear();
387
+ activeColumnHeaderHighlight.clear();
388
+ rowHighlight.clear();
389
+ columnHighlight.clear();
360
390
  if (this.highlight.isEnabledFor(AREA_TYPE, cellRange.highlight) && (this.isMultiple() || layerLevel >= 1)) {
361
391
  areaHighlight.add(cellRange.from).add(cellRange.to).commit();
392
+ layeredAreaHighlight.add(cellRange.from).add(cellRange.to).commit();
362
393
  if (layerLevel === 1) {
363
394
  // For single cell selection in the same layer, we do not create area selection to prevent blue background.
364
395
  // When non-consecutive selection is performed we have to add that missing area selection to the previous layer
365
396
  // based on previous coordinates. It only occurs when the previous selection wasn't select multiple cells.
366
397
  var previousRange = this.selectedRange.previous();
367
- this.highlight.useLayerLevel(layerLevel - 1).createOrGetArea().add(previousRange.from).commit()
398
+ this.highlight.useLayerLevel(layerLevel - 1);
399
+ this.highlight.createArea().add(previousRange.from).commit()
400
+ // Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).
401
+ .syncWith(previousRange);
402
+ this.highlight.createLayeredArea().add(previousRange.from).commit()
368
403
  // Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).
369
404
  .syncWith(previousRange);
370
405
  this.highlight.useLayerLevel(layerLevel);
371
406
  }
372
407
  }
373
408
  if (this.highlight.isEnabledFor(HEADER_TYPE, cellRange.highlight)) {
374
- // The header selection generally contains cell selection. In a case when all rows (or columns)
375
- // are hidden that visual coordinates are translated to renderable coordinates that do not exist.
376
- // Hence no header highlight is generated. In that case, to make a column (or a row) header
377
- // highlight, the row and column index has to point to the header (the negative value). See #7052.
378
- var areAnyRowsRendered = this.tableProps.countRowsTranslated() === 0;
379
- var areAnyColumnsRendered = this.tableProps.countColsTranslated() === 0;
380
- var headerCellRange = cellRange;
381
- if (areAnyRowsRendered || areAnyColumnsRendered) {
382
- headerCellRange = cellRange.clone();
383
- }
384
- if (areAnyRowsRendered) {
385
- headerCellRange.from.row = -1;
386
- }
387
- if (areAnyColumnsRendered) {
388
- headerCellRange.from.col = -1;
389
- }
409
+ var rowCoordsFrom = this.tableProps.createCellCoords(Math.max(cellRange.from.row, 0), -1);
410
+ var rowCoordsTo = this.tableProps.createCellCoords(cellRange.to.row, -1);
411
+ var columnCoordsFrom = this.tableProps.createCellCoords(-1, Math.max(cellRange.from.col, 0));
412
+ var columnCoordsTo = this.tableProps.createCellCoords(-1, cellRange.to.col);
390
413
  if (this.settings.selectionMode === 'single') {
391
- if (this.isSelectedByAnyHeader()) {
392
- headerCellRange.from.normalize();
393
- }
394
- headerHighlight.add(headerCellRange.from).commit();
414
+ rowHeaderHighlight.add(rowCoordsFrom).commit();
415
+ columnHeaderHighlight.add(columnCoordsFrom).commit();
416
+ rowHighlight.add(rowCoordsFrom).commit();
417
+ columnHighlight.add(columnCoordsFrom).commit();
395
418
  } else {
396
- headerHighlight.add(headerCellRange.from).add(headerCellRange.to).commit();
419
+ rowHeaderHighlight.add(rowCoordsFrom).add(rowCoordsTo).commit();
420
+ columnHeaderHighlight.add(columnCoordsFrom).add(columnCoordsTo).commit();
421
+ rowHighlight.add(rowCoordsFrom).add(rowCoordsTo).commit();
422
+ columnHighlight.add(columnCoordsFrom).add(columnCoordsTo).commit();
397
423
  }
398
424
  if (this.isEntireRowSelected()) {
399
425
  var isRowSelected = this.tableProps.countCols() === cellRange.getWidth();
400
426
 
401
427
  // Make sure that the whole row is selected (in case where selectionMode is set to 'single')
402
428
  if (isRowSelected) {
403
- activeHeaderHighlight.add(this.tableProps.createCellCoords(cellRange.from.row, -1)).add(this.tableProps.createCellCoords(cellRange.to.row, -1)).commit();
429
+ activeRowHeaderHighlight.add(this.tableProps.createCellCoords(cellRange.from.row, Math.min(-this.tableProps.countRowHeaders(), -1))).add(this.tableProps.createCellCoords(cellRange.to.row, -1)).commit();
404
430
  }
405
431
  }
406
432
  if (this.isEntireColumnSelected()) {
@@ -408,7 +434,7 @@ var Selection = /*#__PURE__*/function () {
408
434
 
409
435
  // Make sure that the whole column is selected (in case where selectionMode is set to 'single')
410
436
  if (isColumnSelected) {
411
- activeHeaderHighlight.add(this.tableProps.createCellCoords(-1, cellRange.from.col)).add(this.tableProps.createCellCoords(-1, cellRange.to.col)).commit();
437
+ activeColumnHeaderHighlight.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(), -1), cellRange.from.col)).add(this.tableProps.createCellCoords(-1, cellRange.to.col)).commit();
412
438
  }
413
439
  }
414
440
  }
@@ -643,7 +669,9 @@ var Selection = /*#__PURE__*/function () {
643
669
  if (!includeRowHeaders && !includeColumnHeaders && (nrOfRows === 0 || nrOfColumns === 0)) {
644
670
  return;
645
671
  }
646
- var startCoords = this.tableProps.createCellCoords(includeColumnHeaders ? -1 : 0, includeRowHeaders ? -1 : 0);
672
+ var rowFrom = includeColumnHeaders ? -this.tableProps.countColHeaders() : 0;
673
+ var columnFrom = includeRowHeaders ? -this.tableProps.countRowHeaders() : 0;
674
+ var startCoords = this.tableProps.createCellCoords(rowFrom, columnFrom);
647
675
  var endCoords = this.tableProps.createCellCoords(nrOfRows - 1, nrOfColumns - 1);
648
676
  this.clear();
649
677
  this.setRangeStartOnly(startCoords);
@@ -777,19 +805,29 @@ var Selection = /*#__PURE__*/function () {
777
805
  if (!this.isSelected()) {
778
806
  return;
779
807
  }
780
- var cellHighlight = this.highlight.getCell();
808
+ var focusHighlight = this.highlight.getFocus();
781
809
  var currentLayer = this.getLayerLevel();
782
- cellHighlight.commit().syncWith(this.selectedRange.current());
810
+ focusHighlight.commit().syncWith(this.selectedRange.current());
783
811
 
784
812
  // Rewriting rendered ranges going through all layers.
785
813
  for (var layerLevel = 0; layerLevel < this.selectedRange.size(); layerLevel += 1) {
786
814
  this.highlight.useLayerLevel(layerLevel);
787
- var areaHighlight = this.highlight.createOrGetArea();
788
- var headerHighlight = this.highlight.createOrGetHeader();
789
- var activeHeaderHighlight = this.highlight.createOrGetActiveHeader();
815
+ var areaHighlight = this.highlight.createArea();
816
+ var areaLayeredHighlight = this.highlight.createLayeredArea();
817
+ var rowHeaderHighlight = this.highlight.createRowHeader();
818
+ var columnHeaderHighlight = this.highlight.createColumnHeader();
819
+ var activeRowHeaderHighlight = this.highlight.createActiveRowHeader();
820
+ var activeColumnHeaderHighlight = this.highlight.createActiveColumnHeader();
821
+ var rowHighlight = this.highlight.createRowHighlight();
822
+ var columnHighlight = this.highlight.createColumnHighlight();
790
823
  areaHighlight.commit();
791
- headerHighlight.commit();
792
- activeHeaderHighlight.commit();
824
+ areaLayeredHighlight.commit();
825
+ rowHeaderHighlight.commit();
826
+ columnHeaderHighlight.commit();
827
+ activeRowHeaderHighlight.commit();
828
+ activeColumnHeaderHighlight.commit();
829
+ rowHighlight.commit();
830
+ columnHighlight.commit();
793
831
  }
794
832
 
795
833
  // Reverting starting layer for the Highlight.
package/settings.d.ts CHANGED
@@ -144,6 +144,7 @@ export interface GridSettings extends Events {
144
144
  hiddenColumns?: HiddenColumnsSettings;
145
145
  hiddenRows?: HiddenRowsSettings;
146
146
  invalidCellClassName?: string;
147
+ imeFastEdit?: boolean;
147
148
  isEmptyCol?: (this: Core, col: number) => boolean;
148
149
  isEmptyRow?: (this: Core, row: number) => boolean;
149
150
  label?: LabelOptions;
package/tableView.js CHANGED
@@ -58,88 +58,98 @@ var privatePool = new WeakMap();
58
58
  var _columnHeadersCount = /*#__PURE__*/new WeakMap();
59
59
  var _rowHeadersCount = /*#__PURE__*/new WeakMap();
60
60
  var TableView = /*#__PURE__*/function () {
61
+ /**
62
+ * Instance of {@link Handsontable}.
63
+ *
64
+ * @private
65
+ * @type {Handsontable}
66
+ */
67
+
68
+ /**
69
+ * Instance of {@link EventManager}.
70
+ *
71
+ * @private
72
+ * @type {EventManager}
73
+ */
74
+
75
+ /**
76
+ * Current Handsontable's GridSettings object.
77
+ *
78
+ * @private
79
+ * @type {GridSettings}
80
+ */
81
+
82
+ /**
83
+ * Main <THEAD> element.
84
+ *
85
+ * @private
86
+ * @type {HTMLTableSectionElement}
87
+ */
88
+
89
+ /**
90
+ * Main <TBODY> element.
91
+ *
92
+ * @private
93
+ * @type {HTMLTableSectionElement}
94
+ */
95
+
96
+ /**
97
+ * Main Walkontable instance.
98
+ *
99
+ * @private
100
+ * @type {Walkontable}
101
+ */
102
+
103
+ /**
104
+ * Main Walkontable instance.
105
+ *
106
+ * @private
107
+ * @type {Walkontable}
108
+ */
109
+
110
+ /**
111
+ * The total number of the column header renderers applied to the table through the
112
+ * `afterGetColumnHeaderRenderers` hook.
113
+ *
114
+ * @type {number}
115
+ */
116
+
117
+ /**
118
+ * The total number of the row header renderers applied to the table through the
119
+ * `afterGetRowHeaderRenderers` hook.
120
+ *
121
+ * @type {number}
122
+ */
123
+
124
+ /**
125
+ * The flag determines if the `adjustElementsSize` method call was made during
126
+ * the render suspending. If true, the method has to be triggered once after render
127
+ * resuming.
128
+ *
129
+ * @private
130
+ * @type {boolean}
131
+ */
132
+
61
133
  /**
62
134
  * @param {Hanstontable} instance Instance of {@link Handsontable}.
63
135
  */
64
136
  function TableView(instance) {
65
137
  _classCallCheck(this, TableView);
66
- /**
67
- * Instance of {@link Handsontable}.
68
- *
69
- * @private
70
- * @type {Handsontable}
71
- */
72
138
  _defineProperty(this, "instance", void 0);
73
- /**
74
- * Instance of {@link EventManager}.
75
- *
76
- * @private
77
- * @type {EventManager}
78
- */
79
139
  _defineProperty(this, "eventManager", void 0);
80
- /**
81
- * Current Handsontable's GridSettings object.
82
- *
83
- * @private
84
- * @type {GridSettings}
85
- */
86
140
  _defineProperty(this, "settings", void 0);
87
- /**
88
- * Main <THEAD> element.
89
- *
90
- * @private
91
- * @type {HTMLTableSectionElement}
92
- */
93
141
  _defineProperty(this, "THEAD", void 0);
94
- /**
95
- * Main <TBODY> element.
96
- *
97
- * @private
98
- * @type {HTMLTableSectionElement}
99
- */
100
142
  _defineProperty(this, "TBODY", void 0);
101
- /**
102
- * Main Walkontable instance.
103
- *
104
- * @private
105
- * @type {Walkontable}
106
- */
107
143
  _defineProperty(this, "_wt", void 0);
108
- /**
109
- * Main Walkontable instance.
110
- *
111
- * @private
112
- * @type {Walkontable}
113
- */
114
144
  _defineProperty(this, "activeWt", void 0);
115
- /**
116
- * The total number of the column header renderers applied to the table through the
117
- * `afterGetColumnHeaderRenderers` hook.
118
- *
119
- * @type {number}
120
- */
121
145
  _classPrivateFieldInitSpec(this, _columnHeadersCount, {
122
146
  writable: true,
123
147
  value: 0
124
148
  });
125
- /**
126
- * The total number of the row header renderers applied to the table through the
127
- * `afterGetRowHeaderRenderers` hook.
128
- *
129
- * @type {number}
130
- */
131
149
  _classPrivateFieldInitSpec(this, _rowHeadersCount, {
132
150
  writable: true,
133
151
  value: 0
134
152
  });
135
- /**
136
- * The flag determines if the `adjustElementsSize` method call was made during
137
- * the render suspending. If true, the method has to be triggered once after render
138
- * resuming.
139
- *
140
- * @private
141
- * @type {boolean}
142
- */
143
153
  _defineProperty(this, "postponedAdjustElementsSize", false);
144
154
  this.instance = instance;
145
155
  this.eventManager = new _eventManager.default(this.instance);
@@ -287,6 +297,7 @@ var TableView = /*#__PURE__*/function () {
287
297
  }, {
288
298
  key: "createElements",
289
299
  value: function createElements() {
300
+ var _this$settings, _this$settings$data, _this$settings2, _this$settings2$data$;
290
301
  var priv = privatePool.get(this);
291
302
  var _this$instance = this.instance,
292
303
  rootElement = _this$instance.rootElement,
@@ -299,6 +310,9 @@ var TableView = /*#__PURE__*/function () {
299
310
  (0, _element.addClass)(rootElement, 'handsontable');
300
311
  priv.table = rootDocument.createElement('TABLE');
301
312
  (0, _element.addClass)(priv.table, 'htCore');
313
+ priv.table.ariaRowCount = (_this$settings = this.settings) === null || _this$settings === void 0 ? void 0 : (_this$settings$data = _this$settings.data) === null || _this$settings$data === void 0 ? void 0 : _this$settings$data.length;
314
+ priv.table.ariaColCount = (_this$settings2 = this.settings) === null || _this$settings2 === void 0 ? void 0 : (_this$settings2$data$ = _this$settings2.data[0]) === null || _this$settings2$data$ === void 0 ? void 0 : _this$settings2$data$.length;
315
+ priv.table.setAttribute('role', 'treegrid');
302
316
  if (this.instance.getSettings().tableClassName) {
303
317
  (0, _element.addClass)(priv.table, this.instance.getSettings().tableClassName);
304
318
  }
@@ -883,15 +897,29 @@ var TableView = /*#__PURE__*/function () {
883
897
  },
884
898
  onBeforeHighlightingRowHeader: function onBeforeHighlightingRowHeader(renderableRow, headerLevel, highlightMeta) {
885
899
  var rowMapper = _this2.instance.rowIndexMapper;
886
- var visualRow = rowMapper.getVisualFromRenderableIndex(renderableRow);
900
+ var areColumnHeadersSelected = renderableRow < 0;
901
+ var visualRow = renderableRow;
902
+ if (!areColumnHeadersSelected) {
903
+ visualRow = rowMapper.getVisualFromRenderableIndex(renderableRow);
904
+ }
887
905
  var newVisualRow = _this2.instance.runHooks('beforeHighlightingRowHeader', visualRow, headerLevel, highlightMeta);
888
- return rowMapper.getRenderableFromVisualIndex(rowMapper.getNearestNotHiddenIndex(newVisualRow, 1));
906
+ if (!areColumnHeadersSelected) {
907
+ return rowMapper.getRenderableFromVisualIndex(rowMapper.getNearestNotHiddenIndex(newVisualRow, 1));
908
+ }
909
+ return newVisualRow;
889
910
  },
890
911
  onBeforeHighlightingColumnHeader: function onBeforeHighlightingColumnHeader(renderableColumn, headerLevel, highlightMeta) {
891
912
  var columnMapper = _this2.instance.columnIndexMapper;
892
- var visualColumn = columnMapper.getVisualFromRenderableIndex(renderableColumn);
913
+ var areRowHeadersSelected = renderableColumn < 0;
914
+ var visualColumn = renderableColumn;
915
+ if (!areRowHeadersSelected) {
916
+ visualColumn = columnMapper.getVisualFromRenderableIndex(renderableColumn);
917
+ }
893
918
  var newVisualColumn = _this2.instance.runHooks('beforeHighlightingColumnHeader', visualColumn, headerLevel, highlightMeta);
894
- return columnMapper.getRenderableFromVisualIndex(columnMapper.getNearestNotHiddenIndex(newVisualColumn, 1));
919
+ if (!areRowHeadersSelected) {
920
+ return columnMapper.getRenderableFromVisualIndex(columnMapper.getNearestNotHiddenIndex(newVisualColumn, 1));
921
+ }
922
+ return newVisualColumn;
895
923
  },
896
924
  onAfterDrawSelection: function onAfterDrawSelection(currentRow, currentColumn, layerLevel) {
897
925
  var cornersOfSelection;