handsontable 0.0.0-next-af5139c-20230620 → 0.0.0-next-06a64be-20230621

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 (239) 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 +355 -0
  28. package/3rdparty/walkontable/src/selection.mjs +349 -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 +309 -127
  45. package/core.mjs +309 -127
  46. package/dataMap/metaManager/metaSchema.js +0 -19
  47. package/dataMap/metaManager/metaSchema.mjs +0 -19
  48. package/dist/handsontable.css +3 -8
  49. package/dist/handsontable.full.css +3 -8
  50. package/dist/handsontable.full.js +9241 -11943
  51. package/dist/handsontable.full.min.css +3 -3
  52. package/dist/handsontable.full.min.js +107 -107
  53. package/dist/handsontable.js +12628 -15330
  54. package/dist/handsontable.min.css +3 -3
  55. package/dist/handsontable.min.js +4 -4
  56. package/editorManager.js +94 -21
  57. package/editorManager.mjs +98 -26
  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.d.ts +1 -5
  67. package/pluginHooks.js +1 -89
  68. package/pluginHooks.mjs +1 -89
  69. package/plugins/collapsibleColumns/collapsibleColumns.js +24 -81
  70. package/plugins/collapsibleColumns/collapsibleColumns.mjs +24 -81
  71. package/plugins/columnSorting/columnSorting.js +8 -50
  72. package/plugins/columnSorting/columnSorting.mjs +9 -49
  73. package/plugins/columnSorting/index.js +2 -4
  74. package/plugins/columnSorting/index.mjs +1 -1
  75. package/plugins/copyPaste/copyPaste.js +1 -5
  76. package/plugins/copyPaste/copyPaste.mjs +1 -5
  77. package/plugins/customBorders/customBorders.js +53 -18
  78. package/plugins/customBorders/customBorders.mjs +54 -19
  79. package/plugins/manualColumnResize/manualColumnResize.js +36 -5
  80. package/plugins/manualColumnResize/manualColumnResize.mjs +36 -5
  81. package/plugins/manualRowResize/manualRowResize.js +40 -9
  82. package/plugins/manualRowResize/manualRowResize.mjs +40 -9
  83. package/plugins/mergeCells/mergeCells.js +18 -5
  84. package/plugins/mergeCells/mergeCells.mjs +18 -5
  85. package/plugins/multiColumnSorting/multiColumnSorting.js +3 -42
  86. package/plugins/multiColumnSorting/multiColumnSorting.mjs +3 -42
  87. package/plugins/nestedHeaders/nestedHeaders.js +10 -132
  88. package/plugins/nestedHeaders/nestedHeaders.mjs +10 -132
  89. package/plugins/nestedHeaders/stateManager/index.js +0 -37
  90. package/plugins/nestedHeaders/stateManager/index.mjs +0 -37
  91. package/plugins/nestedRows/nestedRows.js +7 -52
  92. package/plugins/nestedRows/nestedRows.mjs +7 -52
  93. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
  94. package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
  95. package/selection/highlight/constants.js +16 -0
  96. package/selection/highlight/constants.mjs +6 -0
  97. package/selection/highlight/highlight.js +89 -312
  98. package/selection/highlight/highlight.mjs +85 -302
  99. package/selection/highlight/types/activeHeader.js +9 -10
  100. package/selection/highlight/types/activeHeader.mjs +8 -10
  101. package/selection/highlight/types/area.js +27 -12
  102. package/selection/highlight/types/area.mjs +30 -16
  103. package/selection/highlight/types/{focus.js → cell.js} +8 -5
  104. package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
  105. package/selection/highlight/types/customSelection.js +10 -7
  106. package/selection/highlight/types/customSelection.mjs +9 -7
  107. package/selection/highlight/types/fill.js +8 -5
  108. package/selection/highlight/types/fill.mjs +7 -5
  109. package/selection/highlight/types/header.js +20 -10
  110. package/selection/highlight/types/header.mjs +19 -10
  111. package/selection/highlight/types/{row.js → index.js} +31 -27
  112. package/selection/highlight/types/{row.mjs → index.mjs} +29 -24
  113. package/selection/highlight/visualSelection.js +27 -31
  114. package/selection/highlight/visualSelection.mjs +27 -31
  115. package/selection/index.js +7 -4
  116. package/selection/index.mjs +3 -2
  117. package/selection/mouseEventHandler.js +1 -1
  118. package/selection/mouseEventHandler.mjs +1 -1
  119. package/selection/range.js +8 -8
  120. package/selection/range.mjs +8 -8
  121. package/selection/selection.js +181 -315
  122. package/selection/selection.mjs +180 -310
  123. package/selection/transformation.js +96 -233
  124. package/selection/transformation.mjs +93 -230
  125. package/selection/utils.js +36 -12
  126. package/selection/utils.mjs +36 -13
  127. package/settings.d.ts +0 -1
  128. package/shortcuts/manager.js +0 -2
  129. package/shortcuts/manager.mjs +0 -2
  130. package/tableView.js +9 -58
  131. package/tableView.mjs +9 -58
  132. package/translations/indexMapper.js +9 -8
  133. package/translations/indexMapper.mjs +9 -8
  134. package/3rdparty/walkontable/src/selection/border/constants.js +0 -18
  135. package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -13
  136. package/3rdparty/walkontable/src/selection/constants.js +0 -63
  137. package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
  138. package/3rdparty/walkontable/src/selection/index.js +0 -30
  139. package/3rdparty/walkontable/src/selection/index.mjs +0 -5
  140. package/3rdparty/walkontable/src/selection/manager.js +0 -329
  141. package/3rdparty/walkontable/src/selection/manager.mjs +0 -323
  142. package/3rdparty/walkontable/src/selection/scanner.js +0 -364
  143. package/3rdparty/walkontable/src/selection/scanner.mjs +0 -360
  144. package/3rdparty/walkontable/src/selection/selection.js +0 -133
  145. package/3rdparty/walkontable/src/selection/selection.mjs +0 -127
  146. package/selection/highlight/types/areaLayered.js +0 -54
  147. package/selection/highlight/types/areaLayered.mjs +0 -49
  148. package/selection/highlight/types/column.js +0 -50
  149. package/selection/highlight/types/column.mjs +0 -45
  150. package/shortcutContexts/commands/editor/closeAndSave.js +0 -15
  151. package/shortcutContexts/commands/editor/closeAndSave.mjs +0 -10
  152. package/shortcutContexts/commands/editor/closeWithoutSaving.js +0 -13
  153. package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +0 -8
  154. package/shortcutContexts/commands/editor/fastOpen.js +0 -16
  155. package/shortcutContexts/commands/editor/fastOpen.mjs +0 -11
  156. package/shortcutContexts/commands/editor/index.js +0 -16
  157. package/shortcutContexts/commands/editor/index.mjs +0 -12
  158. package/shortcutContexts/commands/editor/open.js +0 -29
  159. package/shortcutContexts/commands/editor/open.mjs +0 -24
  160. package/shortcutContexts/commands/emptySelectedCells.js +0 -12
  161. package/shortcutContexts/commands/emptySelectedCells.mjs +0 -7
  162. package/shortcutContexts/commands/extendCellsSelection/down.js +0 -15
  163. package/shortcutContexts/commands/extendCellsSelection/down.mjs +0 -10
  164. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +0 -21
  165. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -16
  166. package/shortcutContexts/commands/extendCellsSelection/index.js +0 -26
  167. package/shortcutContexts/commands/extendCellsSelection/index.mjs +0 -22
  168. package/shortcutContexts/commands/extendCellsSelection/left.js +0 -15
  169. package/shortcutContexts/commands/extendCellsSelection/left.mjs +0 -10
  170. package/shortcutContexts/commands/extendCellsSelection/right.js +0 -15
  171. package/shortcutContexts/commands/extendCellsSelection/right.mjs +0 -10
  172. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +0 -19
  173. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +0 -14
  174. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +0 -22
  175. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +0 -17
  176. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +0 -17
  177. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +0 -12
  178. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +0 -17
  179. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +0 -12
  180. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +0 -40
  181. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -35
  182. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -40
  183. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -35
  184. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -22
  185. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -17
  186. package/shortcutContexts/commands/extendCellsSelection/toRows.js +0 -19
  187. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +0 -14
  188. package/shortcutContexts/commands/extendCellsSelection/up.js +0 -15
  189. package/shortcutContexts/commands/extendCellsSelection/up.mjs +0 -10
  190. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +0 -21
  191. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -16
  192. package/shortcutContexts/commands/index.js +0 -52
  193. package/shortcutContexts/commands/index.mjs +0 -48
  194. package/shortcutContexts/commands/moveCellSelection/down.js +0 -12
  195. package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -7
  196. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -29
  197. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -24
  198. package/shortcutContexts/commands/moveCellSelection/index.js +0 -28
  199. package/shortcutContexts/commands/moveCellSelection/index.mjs +0 -24
  200. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +0 -13
  201. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +0 -8
  202. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +0 -13
  203. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +0 -8
  204. package/shortcutContexts/commands/moveCellSelection/left.js +0 -11
  205. package/shortcutContexts/commands/moveCellSelection/left.mjs +0 -6
  206. package/shortcutContexts/commands/moveCellSelection/right.js +0 -11
  207. package/shortcutContexts/commands/moveCellSelection/right.mjs +0 -6
  208. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +0 -16
  209. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +0 -11
  210. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +0 -17
  211. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +0 -12
  212. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +0 -13
  213. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +0 -8
  214. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +0 -16
  215. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +0 -11
  216. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +0 -36
  217. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -31
  218. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -36
  219. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -31
  220. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +0 -16
  221. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +0 -11
  222. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +0 -18
  223. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +0 -13
  224. package/shortcutContexts/commands/moveCellSelection/up.js +0 -12
  225. package/shortcutContexts/commands/moveCellSelection/up.mjs +0 -7
  226. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +0 -29
  227. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -24
  228. package/shortcutContexts/commands/populateSelectedCellsData.js +0 -35
  229. package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -30
  230. package/shortcutContexts/commands/selectAll.js +0 -11
  231. package/shortcutContexts/commands/selectAll.mjs +0 -6
  232. package/shortcutContexts/constants.js +0 -19
  233. package/shortcutContexts/constants.mjs +0 -12
  234. package/shortcutContexts/editor.js +0 -29
  235. package/shortcutContexts/editor.mjs +0 -25
  236. package/shortcutContexts/grid.js +0 -244
  237. package/shortcutContexts/grid.mjs +0 -240
  238. package/shortcutContexts/index.js +0 -29
  239. package/shortcutContexts/index.mjs +0 -15
@@ -1,71 +1,50 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.symbol.to-primitive.js");
4
- require("core-js/modules/es.date.to-primitive.js");
5
- require("core-js/modules/es.number.constructor.js");
6
- require("core-js/modules/es.array.from.js");
7
- require("core-js/modules/es.array.slice.js");
8
- require("core-js/modules/es.regexp.to-string.js");
9
- require("core-js/modules/es.function.name.js");
10
- require("core-js/modules/es.regexp.exec.js");
11
3
  require("core-js/modules/es.object.keys.js");
12
4
  require("core-js/modules/es.array.filter.js");
13
5
  require("core-js/modules/es.object.get-own-property-descriptor.js");
14
6
  require("core-js/modules/web.dom-collections.for-each.js");
15
7
  require("core-js/modules/es.object.get-own-property-descriptors.js");
16
- 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); }
8
+ require("core-js/modules/es.array.from.js");
9
+ require("core-js/modules/es.array.slice.js");
10
+ require("core-js/modules/es.regexp.to-string.js");
11
+ require("core-js/modules/es.function.name.js");
12
+ require("core-js/modules/es.regexp.exec.js");
17
13
  exports.__esModule = true;
18
14
  exports.default = void 0;
15
+ require("core-js/modules/es.array.fill.js");
19
16
  require("core-js/modules/es.array.iterator.js");
20
17
  require("core-js/modules/es.map.js");
21
18
  require("core-js/modules/es.object.to-string.js");
22
19
  require("core-js/modules/es.string.iterator.js");
23
20
  require("core-js/modules/web.dom-collections.iterator.js");
24
- require("core-js/modules/es.array.fill.js");
25
21
  require("core-js/modules/es.array.includes.js");
26
22
  require("core-js/modules/es.string.includes.js");
27
23
  require("core-js/modules/es.array.concat.js");
28
24
  require("core-js/modules/es.symbol.iterator.js");
29
25
  require("core-js/modules/es.symbol.js");
30
26
  require("core-js/modules/es.symbol.description.js");
31
- require("core-js/modules/es.weak-set.js");
32
- var _activeHeader = require("./types/activeHeader");
33
- var _areaLayered = require("./types/areaLayered");
34
- var _area = require("./types/area");
35
- var _column = require("./types/column");
36
- var _focus = require("./types/focus");
37
- var _customSelection = require("./types/customSelection");
38
- var _fill = require("./types/fill");
39
- var _header = require("./types/header");
40
- var _row = require("./types/row");
41
- var _src = require("../../3rdparty/walkontable/src");
42
- exports.ACTIVE_HEADER_TYPE = _src.HIGHLIGHT_ACTIVE_HEADER_TYPE;
43
- exports.AREA_TYPE = _src.HIGHLIGHT_AREA_TYPE;
44
- exports.FOCUS_TYPE = _src.HIGHLIGHT_FOCUS_TYPE;
45
- exports.CUSTOM_SELECTION_TYPE = _src.HIGHLIGHT_CUSTOM_SELECTION_TYPE;
46
- exports.FILL_TYPE = _src.HIGHLIGHT_FILL_TYPE;
47
- exports.HEADER_TYPE = _src.HIGHLIGHT_HEADER_TYPE;
48
- exports.ROW_TYPE = _src.HIGHLIGHT_ROW_TYPE;
49
- exports.COLUMN_TYPE = _src.HIGHLIGHT_COLUMN_TYPE;
27
+ require("core-js/modules/es.symbol.to-primitive.js");
28
+ require("core-js/modules/es.date.to-primitive.js");
29
+ require("core-js/modules/es.number.constructor.js");
30
+ var _types = require("./types");
31
+ var _constants = require("./constants");
50
32
  var _array = require("./../../helpers/array");
51
- var _Symbol$iterator;
52
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
53
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
33
+ 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); }
54
34
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
55
35
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
56
36
  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); }
57
37
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
58
38
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
59
39
  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; }
40
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
41
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
42
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
60
43
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
61
44
  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); } }
62
45
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
63
- function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
64
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
65
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
66
46
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
67
47
  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); }
68
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
69
48
  /**
70
49
  * Highlight class responsible for managing Walkontable Selection classes.
71
50
  *
@@ -81,25 +60,15 @@ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(
81
60
  * @class Highlight
82
61
  * @util
83
62
  */
84
- var _createHighlight = /*#__PURE__*/new WeakSet();
85
- _Symbol$iterator = Symbol.iterator;
86
- var Highlight = /*#__PURE__*/function () {
63
+ var Highlight = /*#__PURE__*/function (_Symbol$iterator) {
87
64
  function Highlight(options) {
88
65
  _classCallCheck(this, Highlight);
89
- /**
90
- * Creates (if not exist in the cache) Walkontable Selection instance.
91
- *
92
- * @param {Map} cacheMap The map where the instance will be cached.
93
- * @param {Function} highlightFactory The function factory.
94
- * @returns {VisualSelection}
95
- */
96
- _classPrivateMethodInitSpec(this, _createHighlight);
97
66
  /**
98
67
  * Options consumed by Highlight class and Walkontable Selection classes.
99
68
  *
100
69
  * @type {object}
101
70
  */
102
- _defineProperty(this, "options", void 0);
71
+ this.options = options;
103
72
  /**
104
73
  * The property which describes which layer level of the visual selection will be modified.
105
74
  * This option is valid only for `area` and `header` highlight types which occurs multiple times on
@@ -110,96 +79,49 @@ var Highlight = /*#__PURE__*/function () {
110
79
  * @type {number}
111
80
  * @default 0
112
81
  */
113
- _defineProperty(this, "layerLevel", 0);
82
+ this.layerLevel = 0;
114
83
  /**
115
84
  * `cell` highlight object which describes attributes for the currently selected cell.
116
85
  * It can only occur only once on the table.
117
86
  *
118
87
  * @type {Selection}
119
88
  */
120
- _defineProperty(this, "focus", void 0);
89
+ this.cell = (0, _types.createHighlight)(_constants.CELL_TYPE, options);
121
90
  /**
122
91
  * `fill` highlight object which describes attributes for the borders for autofill functionality.
123
92
  * It can only occur only once on the table.
124
93
  *
125
94
  * @type {Selection}
126
95
  */
127
- _defineProperty(this, "fill", void 0);
96
+ this.fill = (0, _types.createHighlight)(_constants.FILL_TYPE, options);
128
97
  /**
129
98
  * Collection of the `area` highlights. That objects describes attributes for the borders and selection of
130
99
  * the multiple selected cells. It can occur multiple times on the table.
131
100
  *
132
101
  * @type {Map.<number, Selection>}
133
102
  */
134
- _defineProperty(this, "layeredAreas", new Map());
135
- /**
136
- * Collection of the `highlight` highlights. That objects describes attributes for the borders and selection of
137
- * the multiple selected cells. It can occur multiple times on the table.
138
- *
139
- * @type {Map.<number, Selection>}
140
- */
141
- _defineProperty(this, "areas", new Map());
142
- /**
143
- * Collection of the `header` highlights. That objects describes attributes for the selection of
144
- * the multiple selected rows in the table header. It can occur multiple times on the table.
145
- *
146
- * @type {Map.<number, Selection>}
147
- */
148
- _defineProperty(this, "rowHeaders", new Map());
103
+ this.areas = new Map();
149
104
  /**
150
105
  * Collection of the `header` highlights. That objects describes attributes for the selection of
151
- * the multiple selected columns in the table header. It can occur multiple times on the table.
106
+ * the multiple selected rows and columns in the table header. It can occur multiple times on the table.
152
107
  *
153
108
  * @type {Map.<number, Selection>}
154
109
  */
155
- _defineProperty(this, "columnHeaders", new Map());
110
+ this.headers = new Map();
156
111
  /**
157
112
  * Collection of the `active-header` highlights. That objects describes attributes for the selection of
158
- * the multiple selected rows in the table header. The table headers which have selected all items in
113
+ * the multiple selected rows and columns in the table header. The table headers which have selected all items in
159
114
  * a row will be marked as `active-header`.
160
115
  *
161
116
  * @type {Map.<number, Selection>}
162
117
  */
163
- _defineProperty(this, "activeRowHeaders", new Map());
164
- /**
165
- * Collection of the `active-header` highlights. That objects describes attributes for the selection of
166
- * the multiple selected columns in the table header. The table headers which have selected all items in
167
- * a row will be marked as `active-header`.
168
- *
169
- * @type {Map.<number, Selection>}
170
- */
171
- _defineProperty(this, "activeColumnHeaders", new Map());
172
- /**
173
- * Collection of the `active-header` highlights. That objects describes attributes for the selection of
174
- * the selected corner in the table header. The table headers which have selected all items in
175
- * a row will be marked as `active-header`.
176
- *
177
- * @type {Map.<number, Selection>}
178
- */
179
- _defineProperty(this, "activeCornerHeaders", new Map());
180
- /**
181
- * Collection of the `rows` highlights. That objects describes attributes for the selection of
182
- * the multiple selected cells in a row. It can occur multiple times on the table.
183
- *
184
- * @type {Map.<number, Selection>}
185
- */
186
- _defineProperty(this, "rowHighlights", new Map());
187
- /**
188
- * Collection of the `columns` highlights. That objects describes attributes for the selection of
189
- * the multiple selected cells in a column. It can occur multiple times on the table.
190
- *
191
- * @type {Map.<number, Selection>}
192
- */
193
- _defineProperty(this, "columnHighlights", new Map());
118
+ this.activeHeaders = new Map();
194
119
  /**
195
120
  * Collection of the `custom-selection`, holder for example borders added through CustomBorders plugin.
196
121
  *
197
122
  * @type {Selection[]}
198
123
  */
199
- _defineProperty(this, "customSelections", []);
200
- this.options = options;
201
- this.focus = (0, _focus.createHighlight)(options);
202
- this.fill = (0, _fill.createHighlight)(options);
124
+ this.customSelections = [];
203
125
  }
204
126
 
205
127
  /**
@@ -215,14 +137,11 @@ var Highlight = /*#__PURE__*/function () {
215
137
  var type = highlightType;
216
138
 
217
139
  // Legacy compatibility.
218
- if (highlightType === _src.HIGHLIGHT_FOCUS_TYPE) {
140
+ if (highlightType === _constants.CELL_TYPE) {
219
141
  type = 'current'; // One from settings for `disableVisualSelection` up to Handsontable 0.36/Handsontable Pro 1.16.0.
220
142
  }
221
143
 
222
- var disableHighlight = false;
223
- if (coords.isCell()) {
224
- disableHighlight = this.options.disabledCellSelection(coords.row, coords.col);
225
- }
144
+ var disableHighlight = this.options.disabledCellSelection(coords.row, coords.col);
226
145
  if (typeof disableHighlight === 'string') {
227
146
  disableHighlight = [disableHighlight];
228
147
  }
@@ -244,15 +163,14 @@ var Highlight = /*#__PURE__*/function () {
244
163
  }
245
164
 
246
165
  /**
247
- * Get Walkontable Selection instance created for controlling highlight of the currently
248
- * focused cell (or header).
166
+ * Get Walkontable Selection instance created for controlling highlight of the currently selected/edited cell.
249
167
  *
250
168
  * @returns {Selection}
251
169
  */
252
170
  }, {
253
- key: "getFocus",
254
- value: function getFocus() {
255
- return this.focus;
171
+ key: "getCell",
172
+ value: function getCell() {
173
+ return this.cell;
256
174
  }
257
175
 
258
176
  /**
@@ -267,38 +185,25 @@ var Highlight = /*#__PURE__*/function () {
267
185
  }
268
186
 
269
187
  /**
270
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
271
- * `area` highlights.
272
- *
273
- * @returns {Selection}
274
- */
275
- }, {
276
- key: "createLayeredArea",
277
- value: function createLayeredArea() {
278
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.layeredAreas, _areaLayered.createHighlight);
279
- }
280
-
281
- /**
282
- * Get all Walkontable Selection instances which describes the state of the visual highlight of the cells.
283
- *
284
- * @returns {Selection[]}
285
- */
286
- }, {
287
- key: "getLayeredAreas",
288
- value: function getLayeredAreas() {
289
- return _toConsumableArray(this.layeredAreas.values());
290
- }
291
-
292
- /**
293
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
294
- * `highlight` highlights.
188
+ * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight
189
+ * of the multiple selected cells.
295
190
  *
296
191
  * @returns {Selection}
297
192
  */
298
193
  }, {
299
- key: "createArea",
300
- value: function createArea() {
301
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.areas, _area.createHighlight);
194
+ key: "createOrGetArea",
195
+ value: function createOrGetArea() {
196
+ var layerLevel = this.layerLevel;
197
+ var area;
198
+ if (this.areas.has(layerLevel)) {
199
+ area = this.areas.get(layerLevel);
200
+ } else {
201
+ area = (0, _types.createHighlight)(_constants.AREA_TYPE, _objectSpread({
202
+ layerLevel: layerLevel
203
+ }, this.options));
204
+ this.areas.set(layerLevel, area);
205
+ }
206
+ return area;
302
207
  }
303
208
 
304
209
  /**
@@ -313,38 +218,23 @@ var Highlight = /*#__PURE__*/function () {
313
218
  }
314
219
 
315
220
  /**
316
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
317
- * header highlight for rows.
318
- *
319
- * @returns {Selection}
320
- */
321
- }, {
322
- key: "createRowHeader",
323
- value: function createRowHeader() {
324
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.rowHeaders, _header.createHighlight);
325
- }
326
-
327
- /**
328
- * Get all Walkontable Selection instances which describes the state of the visual highlight of the headers.
329
- *
330
- * @returns {Selection[]}
331
- */
332
- }, {
333
- key: "getRowHeaders",
334
- value: function getRowHeaders() {
335
- return _toConsumableArray(this.rowHeaders.values());
336
- }
337
-
338
- /**
339
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
340
- * header highlight for columns.
221
+ * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight
222
+ * of the multiple selected header cells.
341
223
  *
342
224
  * @returns {Selection}
343
225
  */
344
226
  }, {
345
- key: "createColumnHeader",
346
- value: function createColumnHeader() {
347
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.columnHeaders, _header.createHighlight);
227
+ key: "createOrGetHeader",
228
+ value: function createOrGetHeader() {
229
+ var layerLevel = this.layerLevel;
230
+ var header;
231
+ if (this.headers.has(layerLevel)) {
232
+ header = this.headers.get(layerLevel);
233
+ } else {
234
+ header = (0, _types.createHighlight)(_constants.HEADER_TYPE, _objectSpread({}, this.options));
235
+ this.headers.set(layerLevel, header);
236
+ }
237
+ return header;
348
238
  }
349
239
 
350
240
  /**
@@ -353,44 +243,29 @@ var Highlight = /*#__PURE__*/function () {
353
243
  * @returns {Selection[]}
354
244
  */
355
245
  }, {
356
- key: "getColumnHeaders",
357
- value: function getColumnHeaders() {
358
- return _toConsumableArray(this.columnHeaders.values());
246
+ key: "getHeaders",
247
+ value: function getHeaders() {
248
+ return _toConsumableArray(this.headers.values());
359
249
  }
360
250
 
361
251
  /**
362
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
363
- * highlight for active row headers.
252
+ * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight
253
+ * of the multiple selected active header cells.
364
254
  *
365
255
  * @returns {Selection}
366
256
  */
367
257
  }, {
368
- key: "createActiveRowHeader",
369
- value: function createActiveRowHeader() {
370
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.activeRowHeaders, _activeHeader.createHighlight);
371
- }
372
-
373
- /**
374
- * Get all Walkontable Selection instances which describes the state of the visual highlight of the active headers.
375
- *
376
- * @returns {Selection[]}
377
- */
378
- }, {
379
- key: "getActiveRowHeaders",
380
- value: function getActiveRowHeaders() {
381
- return _toConsumableArray(this.activeRowHeaders.values());
382
- }
383
-
384
- /**
385
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
386
- * highlight for active column headers.
387
- *
388
- * @returns {Selection}
389
- */
390
- }, {
391
- key: "createActiveColumnHeader",
392
- value: function createActiveColumnHeader() {
393
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.activeColumnHeaders, _activeHeader.createHighlight);
258
+ key: "createOrGetActiveHeader",
259
+ value: function createOrGetActiveHeader() {
260
+ var layerLevel = this.layerLevel;
261
+ var header;
262
+ if (this.activeHeaders.has(layerLevel)) {
263
+ header = this.activeHeaders.get(layerLevel);
264
+ } else {
265
+ header = (0, _types.createHighlight)(_constants.ACTIVE_HEADER_TYPE, _objectSpread({}, this.options));
266
+ this.activeHeaders.set(layerLevel, header);
267
+ }
268
+ return header;
394
269
  }
395
270
 
396
271
  /**
@@ -399,78 +274,9 @@ var Highlight = /*#__PURE__*/function () {
399
274
  * @returns {Selection[]}
400
275
  */
401
276
  }, {
402
- key: "getActiveColumnHeaders",
403
- value: function getActiveColumnHeaders() {
404
- return _toConsumableArray(this.activeColumnHeaders.values());
405
- }
406
-
407
- /**
408
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
409
- * highlight for the headers corner.
410
- *
411
- * @returns {Selection}
412
- */
413
- }, {
414
- key: "createActiveCornerHeader",
415
- value: function createActiveCornerHeader() {
416
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.activeCornerHeaders, _activeHeader.createHighlight);
417
- }
418
-
419
- /**
420
- * Get all Walkontable Selection instances which describes the state of the visual highlight of the headers corner.
421
- *
422
- * @returns {Selection[]}
423
- */
424
- }, {
425
- key: "getActiveCornerHeaders",
426
- value: function getActiveCornerHeaders() {
427
- return _toConsumableArray(this.activeCornerHeaders.values());
428
- }
429
-
430
- /**
431
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
432
- * highlight cells in a row.
433
- *
434
- * @returns {Selection}
435
- */
436
- }, {
437
- key: "createRowHighlight",
438
- value: function createRowHighlight() {
439
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.rowHighlights, _row.createHighlight);
440
- }
441
-
442
- /**
443
- * Get all Walkontable Selection instances which describes the state of the rows highlighting.
444
- *
445
- * @returns {Selection[]}
446
- */
447
- }, {
448
- key: "getRowHighlights",
449
- value: function getRowHighlights() {
450
- return _toConsumableArray(this.rowHighlights.values());
451
- }
452
-
453
- /**
454
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
455
- * highlight cells in a column.
456
- *
457
- * @returns {Selection}
458
- */
459
- }, {
460
- key: "createColumnHighlight",
461
- value: function createColumnHighlight() {
462
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.columnHighlights, _column.createHighlight);
463
- }
464
-
465
- /**
466
- * Get all Walkontable Selection instances which describes the state of the columns highlighting.
467
- *
468
- * @returns {Selection[]}
469
- */
470
- }, {
471
- key: "getColumnHighlights",
472
- value: function getColumnHighlights() {
473
- return _toConsumableArray(this.columnHighlights.values());
277
+ key: "getActiveHeaders",
278
+ value: function getActiveHeaders() {
279
+ return _toConsumableArray(this.activeHeaders.values());
474
280
  }
475
281
 
476
282
  /**
@@ -492,7 +298,7 @@ var Highlight = /*#__PURE__*/function () {
492
298
  }, {
493
299
  key: "addCustomSelection",
494
300
  value: function addCustomSelection(selectionInstance) {
495
- this.customSelections.push((0, _customSelection.createHighlight)(_objectSpread(_objectSpread({}, this.options), selectionInstance)));
301
+ this.customSelections.push((0, _types.createHighlight)(_constants.CUSTOM_SELECTION_TYPE, _objectSpread(_objectSpread({}, this.options), selectionInstance)));
496
302
  }
497
303
 
498
304
  /**
@@ -501,60 +307,31 @@ var Highlight = /*#__PURE__*/function () {
501
307
  }, {
502
308
  key: "clear",
503
309
  value: function clear() {
504
- this.focus.clear();
310
+ this.cell.clear();
505
311
  this.fill.clear();
506
312
  (0, _array.arrayEach)(this.areas.values(), function (highlight) {
507
313
  return void highlight.clear();
508
314
  });
509
- (0, _array.arrayEach)(this.layeredAreas.values(), function (highlight) {
510
- return void highlight.clear();
511
- });
512
- (0, _array.arrayEach)(this.rowHeaders.values(), function (highlight) {
513
- return void highlight.clear();
514
- });
515
- (0, _array.arrayEach)(this.columnHeaders.values(), function (highlight) {
516
- return void highlight.clear();
517
- });
518
- (0, _array.arrayEach)(this.activeRowHeaders.values(), function (highlight) {
519
- return void highlight.clear();
520
- });
521
- (0, _array.arrayEach)(this.activeColumnHeaders.values(), function (highlight) {
315
+ (0, _array.arrayEach)(this.headers.values(), function (highlight) {
522
316
  return void highlight.clear();
523
317
  });
524
- (0, _array.arrayEach)(this.activeCornerHeaders.values(), function (highlight) {
525
- return void highlight.clear();
526
- });
527
- (0, _array.arrayEach)(this.rowHighlights.values(), function (highlight) {
528
- return void highlight.clear();
529
- });
530
- (0, _array.arrayEach)(this.columnHighlights.values(), function (highlight) {
318
+ (0, _array.arrayEach)(this.activeHeaders.values(), function (highlight) {
531
319
  return void highlight.clear();
532
320
  });
533
321
  }
534
- }, {
535
- key: _Symbol$iterator,
536
- value:
322
+
537
323
  /**
538
324
  * This object can be iterate over using `for of` syntax or using internal `arrayEach` helper.
539
325
  *
540
326
  * @returns {Selection[]}
541
327
  */
542
- function value() {
543
- return [this.focus, this.fill].concat(_toConsumableArray(this.areas.values()), _toConsumableArray(this.layeredAreas.values()), _toConsumableArray(this.rowHeaders.values()), _toConsumableArray(this.columnHeaders.values()), _toConsumableArray(this.activeRowHeaders.values()), _toConsumableArray(this.activeColumnHeaders.values()), _toConsumableArray(this.activeCornerHeaders.values()), _toConsumableArray(this.rowHighlights.values()), _toConsumableArray(this.columnHighlights.values()), _toConsumableArray(this.customSelections))[Symbol.iterator]();
328
+ }, {
329
+ key: _Symbol$iterator,
330
+ value: function value() {
331
+ return [this.cell, this.fill].concat(_toConsumableArray(this.areas.values()), _toConsumableArray(this.headers.values()), _toConsumableArray(this.activeHeaders.values()), _toConsumableArray(this.customSelections))[Symbol.iterator]();
544
332
  }
545
333
  }]);
546
334
  return Highlight;
547
- }();
548
- function _createHighlight2(cacheMap, highlightFactory) {
549
- var layerLevel = this.layerLevel;
550
- if (cacheMap.has(layerLevel)) {
551
- return cacheMap.get(layerLevel);
552
- }
553
- var highlight = highlightFactory(_objectSpread({
554
- layerLevel: layerLevel
555
- }, this.options));
556
- cacheMap.set(layerLevel, highlight);
557
- return highlight;
558
- }
335
+ }(Symbol.iterator);
559
336
  var _default = Highlight;
560
337
  exports.default = _default;