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
package/tableView.js CHANGED
@@ -612,44 +612,6 @@ var TableView = /*#__PURE__*/function () {
612
612
  return this.countNotHiddenRowIndexes(visualFixedRowsBottom, 1);
613
613
  }
614
614
 
615
- /**
616
- * The function returns the number of renderable column indexes within the passed range of the visual indexes.
617
- *
618
- * @param {number} columnStart The column visual start index.
619
- * @param {number} columnEnd The column visual end index.
620
- * @returns {number}
621
- */
622
- }, {
623
- key: "countRenderableColumnsInRange",
624
- value: function countRenderableColumnsInRange(columnStart, columnEnd) {
625
- var count = 0;
626
- for (var column = columnStart; column <= columnEnd; column++) {
627
- if (this.instance.columnIndexMapper.getRenderableFromVisualIndex(column) !== null) {
628
- count += 1;
629
- }
630
- }
631
- return count;
632
- }
633
-
634
- /**
635
- * The function returns the number of renderable row indexes within the passed range of the visual indexes.
636
- *
637
- * @param {number} rowStart The row visual start index.
638
- * @param {number} rowEnd The row visual end index.
639
- * @returns {number}
640
- */
641
- }, {
642
- key: "countRenderableRowsInRange",
643
- value: function countRenderableRowsInRange(rowStart, rowEnd) {
644
- var count = 0;
645
- for (var row = rowStart; row <= rowEnd; row++) {
646
- if (this.instance.rowIndexMapper.getRenderableFromVisualIndex(row) !== null) {
647
- count += 1;
648
- }
649
- }
650
- return count;
651
- }
652
-
653
615
  /**
654
616
  * Checks if at least one cell than belongs to the main table is not covered by the top, left or
655
617
  * bottom overlay.
@@ -921,29 +883,15 @@ var TableView = /*#__PURE__*/function () {
921
883
  },
922
884
  onBeforeHighlightingRowHeader: function onBeforeHighlightingRowHeader(renderableRow, headerLevel, highlightMeta) {
923
885
  var rowMapper = _this2.instance.rowIndexMapper;
924
- var areColumnHeadersSelected = renderableRow < 0;
925
- var visualRow = renderableRow;
926
- if (!areColumnHeadersSelected) {
927
- visualRow = rowMapper.getVisualFromRenderableIndex(renderableRow);
928
- }
886
+ var visualRow = rowMapper.getVisualFromRenderableIndex(renderableRow);
929
887
  var newVisualRow = _this2.instance.runHooks('beforeHighlightingRowHeader', visualRow, headerLevel, highlightMeta);
930
- if (!areColumnHeadersSelected) {
931
- return rowMapper.getRenderableFromVisualIndex(rowMapper.getNearestNotHiddenIndex(newVisualRow, 1));
932
- }
933
- return newVisualRow;
888
+ return rowMapper.getRenderableFromVisualIndex(rowMapper.getNearestNotHiddenIndex(newVisualRow, 1));
934
889
  },
935
890
  onBeforeHighlightingColumnHeader: function onBeforeHighlightingColumnHeader(renderableColumn, headerLevel, highlightMeta) {
936
891
  var columnMapper = _this2.instance.columnIndexMapper;
937
- var areRowHeadersSelected = renderableColumn < 0;
938
- var visualColumn = renderableColumn;
939
- if (!areRowHeadersSelected) {
940
- visualColumn = columnMapper.getVisualFromRenderableIndex(renderableColumn);
941
- }
892
+ var visualColumn = columnMapper.getVisualFromRenderableIndex(renderableColumn);
942
893
  var newVisualColumn = _this2.instance.runHooks('beforeHighlightingColumnHeader', visualColumn, headerLevel, highlightMeta);
943
- if (!areRowHeadersSelected) {
944
- return columnMapper.getRenderableFromVisualIndex(columnMapper.getNearestNotHiddenIndex(newVisualColumn, 1));
945
- }
946
- return newVisualColumn;
894
+ return columnMapper.getRenderableFromVisualIndex(columnMapper.getNearestNotHiddenIndex(newVisualColumn, 1));
947
895
  },
948
896
  onAfterDrawSelection: function onAfterDrawSelection(currentRow, currentColumn, layerLevel) {
949
897
  var cornersOfSelection;
@@ -954,7 +902,10 @@ var TableView = /*#__PURE__*/function () {
954
902
  var selectedRange = _this2.instance.selection.getSelectedRange();
955
903
  var selectionRangeSize = selectedRange.size();
956
904
  if (selectionRangeSize > 0) {
957
- var selectionForLayer = selectedRange.peekByIndex(layerLevel !== null && layerLevel !== void 0 ? layerLevel : 0);
905
+ // Selection layers are stored from the "oldest" to the "newest". We should calculate the offset.
906
+ // Please look at the `SelectedRange` class and it's method for getting selection's layer for more information.
907
+ var selectionOffset = (layerLevel !== null && layerLevel !== void 0 ? layerLevel : 0) + 1 - selectionRangeSize;
908
+ var selectionForLayer = selectedRange.peekByIndex(selectionOffset);
958
909
  cornersOfSelection = [selectionForLayer.from.row, selectionForLayer.from.col, selectionForLayer.to.row, selectionForLayer.to.col];
959
910
  }
960
911
  return _this2.instance.runHooks('afterDrawSelection', visualRowIndex, visualColumnIndex, cornersOfSelection, layerLevel);
@@ -1128,7 +1079,7 @@ var TableView = /*#__PURE__*/function () {
1128
1079
  key: "isSelectedOnlyCell",
1129
1080
  value: function isSelectedOnlyCell() {
1130
1081
  var _this$instance$getSel, _this$instance$getSel2;
1131
- return (_this$instance$getSel = (_this$instance$getSel2 = this.instance.getSelectedRangeLast()) === null || _this$instance$getSel2 === void 0 ? void 0 : _this$instance$getSel2.isSingleCell()) !== null && _this$instance$getSel !== void 0 ? _this$instance$getSel : false;
1082
+ return (_this$instance$getSel = (_this$instance$getSel2 = this.instance.getSelectedRangeLast()) === null || _this$instance$getSel2 === void 0 ? void 0 : _this$instance$getSel2.isSingle()) !== null && _this$instance$getSel !== void 0 ? _this$instance$getSel : false;
1132
1083
  }
1133
1084
 
1134
1085
  /**
package/tableView.mjs CHANGED
@@ -607,44 +607,6 @@ var TableView = /*#__PURE__*/function () {
607
607
  return this.countNotHiddenRowIndexes(visualFixedRowsBottom, 1);
608
608
  }
609
609
 
610
- /**
611
- * The function returns the number of renderable column indexes within the passed range of the visual indexes.
612
- *
613
- * @param {number} columnStart The column visual start index.
614
- * @param {number} columnEnd The column visual end index.
615
- * @returns {number}
616
- */
617
- }, {
618
- key: "countRenderableColumnsInRange",
619
- value: function countRenderableColumnsInRange(columnStart, columnEnd) {
620
- var count = 0;
621
- for (var column = columnStart; column <= columnEnd; column++) {
622
- if (this.instance.columnIndexMapper.getRenderableFromVisualIndex(column) !== null) {
623
- count += 1;
624
- }
625
- }
626
- return count;
627
- }
628
-
629
- /**
630
- * The function returns the number of renderable row indexes within the passed range of the visual indexes.
631
- *
632
- * @param {number} rowStart The row visual start index.
633
- * @param {number} rowEnd The row visual end index.
634
- * @returns {number}
635
- */
636
- }, {
637
- key: "countRenderableRowsInRange",
638
- value: function countRenderableRowsInRange(rowStart, rowEnd) {
639
- var count = 0;
640
- for (var row = rowStart; row <= rowEnd; row++) {
641
- if (this.instance.rowIndexMapper.getRenderableFromVisualIndex(row) !== null) {
642
- count += 1;
643
- }
644
- }
645
- return count;
646
- }
647
-
648
610
  /**
649
611
  * Checks if at least one cell than belongs to the main table is not covered by the top, left or
650
612
  * bottom overlay.
@@ -916,29 +878,15 @@ var TableView = /*#__PURE__*/function () {
916
878
  },
917
879
  onBeforeHighlightingRowHeader: function onBeforeHighlightingRowHeader(renderableRow, headerLevel, highlightMeta) {
918
880
  var rowMapper = _this2.instance.rowIndexMapper;
919
- var areColumnHeadersSelected = renderableRow < 0;
920
- var visualRow = renderableRow;
921
- if (!areColumnHeadersSelected) {
922
- visualRow = rowMapper.getVisualFromRenderableIndex(renderableRow);
923
- }
881
+ var visualRow = rowMapper.getVisualFromRenderableIndex(renderableRow);
924
882
  var newVisualRow = _this2.instance.runHooks('beforeHighlightingRowHeader', visualRow, headerLevel, highlightMeta);
925
- if (!areColumnHeadersSelected) {
926
- return rowMapper.getRenderableFromVisualIndex(rowMapper.getNearestNotHiddenIndex(newVisualRow, 1));
927
- }
928
- return newVisualRow;
883
+ return rowMapper.getRenderableFromVisualIndex(rowMapper.getNearestNotHiddenIndex(newVisualRow, 1));
929
884
  },
930
885
  onBeforeHighlightingColumnHeader: function onBeforeHighlightingColumnHeader(renderableColumn, headerLevel, highlightMeta) {
931
886
  var columnMapper = _this2.instance.columnIndexMapper;
932
- var areRowHeadersSelected = renderableColumn < 0;
933
- var visualColumn = renderableColumn;
934
- if (!areRowHeadersSelected) {
935
- visualColumn = columnMapper.getVisualFromRenderableIndex(renderableColumn);
936
- }
887
+ var visualColumn = columnMapper.getVisualFromRenderableIndex(renderableColumn);
937
888
  var newVisualColumn = _this2.instance.runHooks('beforeHighlightingColumnHeader', visualColumn, headerLevel, highlightMeta);
938
- if (!areRowHeadersSelected) {
939
- return columnMapper.getRenderableFromVisualIndex(columnMapper.getNearestNotHiddenIndex(newVisualColumn, 1));
940
- }
941
- return newVisualColumn;
889
+ return columnMapper.getRenderableFromVisualIndex(columnMapper.getNearestNotHiddenIndex(newVisualColumn, 1));
942
890
  },
943
891
  onAfterDrawSelection: function onAfterDrawSelection(currentRow, currentColumn, layerLevel) {
944
892
  var cornersOfSelection;
@@ -949,7 +897,10 @@ var TableView = /*#__PURE__*/function () {
949
897
  var selectedRange = _this2.instance.selection.getSelectedRange();
950
898
  var selectionRangeSize = selectedRange.size();
951
899
  if (selectionRangeSize > 0) {
952
- var selectionForLayer = selectedRange.peekByIndex(layerLevel !== null && layerLevel !== void 0 ? layerLevel : 0);
900
+ // Selection layers are stored from the "oldest" to the "newest". We should calculate the offset.
901
+ // Please look at the `SelectedRange` class and it's method for getting selection's layer for more information.
902
+ var selectionOffset = (layerLevel !== null && layerLevel !== void 0 ? layerLevel : 0) + 1 - selectionRangeSize;
903
+ var selectionForLayer = selectedRange.peekByIndex(selectionOffset);
953
904
  cornersOfSelection = [selectionForLayer.from.row, selectionForLayer.from.col, selectionForLayer.to.row, selectionForLayer.to.col];
954
905
  }
955
906
  return _this2.instance.runHooks('afterDrawSelection', visualRowIndex, visualColumnIndex, cornersOfSelection, layerLevel);
@@ -1123,7 +1074,7 @@ var TableView = /*#__PURE__*/function () {
1123
1074
  key: "isSelectedOnlyCell",
1124
1075
  value: function isSelectedOnlyCell() {
1125
1076
  var _this$instance$getSel, _this$instance$getSel2;
1126
- return (_this$instance$getSel = (_this$instance$getSel2 = this.instance.getSelectedRangeLast()) === null || _this$instance$getSel2 === void 0 ? void 0 : _this$instance$getSel2.isSingleCell()) !== null && _this$instance$getSel !== void 0 ? _this$instance$getSel : false;
1077
+ return (_this$instance$getSel = (_this$instance$getSel2 = this.instance.getSelectedRangeLast()) === null || _this$instance$getSel2 === void 0 ? void 0 : _this$instance$getSel2.isSingle()) !== null && _this$instance$getSel !== void 0 ? _this$instance$getSel : false;
1127
1078
  }
1128
1079
 
1129
1080
  /**
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.CORNER_DEFAULT_STYLE = void 0;
5
- require("core-js/modules/es.object.freeze.js");
6
- /**
7
- * Default border corner style.
8
- *
9
- * @type {object}
10
- */
11
- var CORNER_DEFAULT_STYLE = Object.freeze({
12
- width: '6px',
13
- height: '6px',
14
- borderWidth: '1px',
15
- borderStyle: 'solid',
16
- borderColor: '#FFF'
17
- });
18
- exports.CORNER_DEFAULT_STYLE = CORNER_DEFAULT_STYLE;
@@ -1,13 +0,0 @@
1
- import "core-js/modules/es.object.freeze.js";
2
- /**
3
- * Default border corner style.
4
- *
5
- * @type {object}
6
- */
7
- export var CORNER_DEFAULT_STYLE = Object.freeze({
8
- width: '6px',
9
- height: '6px',
10
- borderWidth: '1px',
11
- borderStyle: 'solid',
12
- borderColor: '#FFF'
13
- });
@@ -1,63 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.ROW_TYPE = exports.HEADER_TYPE = exports.FOCUS_TYPE = exports.FILL_TYPE = exports.CUSTOM_SELECTION_TYPE = exports.COLUMN_TYPE = exports.AREA_TYPE = exports.ACTIVE_HEADER_TYPE = void 0;
5
- /**
6
- * Selection type that is visible only if the row or column header is clicked. If that happened
7
- * all row or column header layers are highlighted.
8
- *
9
- * @type {string}
10
- */
11
- var ACTIVE_HEADER_TYPE = 'active-header';
12
- /**
13
- * Selection type that is visible only if the a cell or cells are clicked. If that happened
14
- * only the most closest to the cells row or column header is highlighted.
15
- *
16
- * @type {string}
17
- */
18
- exports.ACTIVE_HEADER_TYPE = ACTIVE_HEADER_TYPE;
19
- var HEADER_TYPE = 'header';
20
- /**
21
- * Selection type that is visible when a cell or cells are clicked. The selected cells are
22
- * highlighted.
23
- *
24
- * @type {string}
25
- */
26
- exports.HEADER_TYPE = HEADER_TYPE;
27
- var AREA_TYPE = 'area';
28
- /**
29
- * Selection type defines a cell that follows the user (keyboard navigation).
30
- *
31
- * @type {string}
32
- */
33
- exports.AREA_TYPE = AREA_TYPE;
34
- var FOCUS_TYPE = 'focus';
35
- /**
36
- * Selection type defines borders for the autofill functionality.
37
- *
38
- * @type {string}
39
- */
40
- exports.FOCUS_TYPE = FOCUS_TYPE;
41
- var FILL_TYPE = 'fill';
42
- /**
43
- * Selection type defines highlights for the `currentRowClassName` option.
44
- *
45
- * @type {string}
46
- */
47
- exports.FILL_TYPE = FILL_TYPE;
48
- var ROW_TYPE = 'row';
49
- /**
50
- * Selection type defines highlights for the `currentColumnClassName` option.
51
- *
52
- * @type {string}
53
- */
54
- exports.ROW_TYPE = ROW_TYPE;
55
- var COLUMN_TYPE = 'column';
56
- /**
57
- * Selection type defines highlights managed by the CustomBorders plugin.
58
- *
59
- * @type {string}
60
- */
61
- exports.COLUMN_TYPE = COLUMN_TYPE;
62
- var CUSTOM_SELECTION_TYPE = 'custom-selection';
63
- exports.CUSTOM_SELECTION_TYPE = CUSTOM_SELECTION_TYPE;
@@ -1,51 +0,0 @@
1
- /**
2
- * Selection type that is visible only if the row or column header is clicked. If that happened
3
- * all row or column header layers are highlighted.
4
- *
5
- * @type {string}
6
- */
7
- export var ACTIVE_HEADER_TYPE = 'active-header';
8
- /**
9
- * Selection type that is visible only if the a cell or cells are clicked. If that happened
10
- * only the most closest to the cells row or column header is highlighted.
11
- *
12
- * @type {string}
13
- */
14
- export var HEADER_TYPE = 'header';
15
- /**
16
- * Selection type that is visible when a cell or cells are clicked. The selected cells are
17
- * highlighted.
18
- *
19
- * @type {string}
20
- */
21
- export var AREA_TYPE = 'area';
22
- /**
23
- * Selection type defines a cell that follows the user (keyboard navigation).
24
- *
25
- * @type {string}
26
- */
27
- export var FOCUS_TYPE = 'focus';
28
- /**
29
- * Selection type defines borders for the autofill functionality.
30
- *
31
- * @type {string}
32
- */
33
- export var FILL_TYPE = 'fill';
34
- /**
35
- * Selection type defines highlights for the `currentRowClassName` option.
36
- *
37
- * @type {string}
38
- */
39
- export var ROW_TYPE = 'row';
40
- /**
41
- * Selection type defines highlights for the `currentColumnClassName` option.
42
- *
43
- * @type {string}
44
- */
45
- export var COLUMN_TYPE = 'column';
46
- /**
47
- * Selection type defines highlights managed by the CustomBorders plugin.
48
- *
49
- * @type {string}
50
- */
51
- export var CUSTOM_SELECTION_TYPE = 'custom-selection';
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.object.to-string.js");
4
- require("core-js/modules/web.dom-collections.for-each.js");
5
- require("core-js/modules/es.object.keys.js");
6
- exports.__esModule = true;
7
- var _exportNames = {
8
- SelectionManager: true,
9
- Selection: true
10
- };
11
- exports.SelectionManager = void 0;
12
- var _selection = _interopRequireDefault(require("./selection"));
13
- exports.Selection = _selection.default;
14
- var _constants = require("./constants");
15
- Object.keys(_constants).forEach(function (key) {
16
- if (key === "default" || key === "__esModule") return;
17
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
18
- if (key in exports && exports[key] === _constants[key]) return;
19
- exports[key] = _constants[key];
20
- });
21
- var _constants2 = require("./border/constants");
22
- Object.keys(_constants2).forEach(function (key) {
23
- if (key === "default" || key === "__esModule") return;
24
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
25
- if (key in exports && exports[key] === _constants2[key]) return;
26
- exports[key] = _constants2[key];
27
- });
28
- var _manager = require("./manager");
29
- exports.SelectionManager = _manager.SelectionManager;
30
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,5 +0,0 @@
1
- import Selection from "./selection.mjs";
2
- export * from "./constants.mjs";
3
- export * from "./border/constants.mjs";
4
- export { SelectionManager } from "./manager.mjs";
5
- export { Selection };