handsontable 0.0.0-next-48677e7-20230509 → 0.0.0-next-834f47e-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/{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.js +13 -40
  4. package/3rdparty/walkontable/src/cell/coords.mjs +13 -40
  5. package/3rdparty/walkontable/src/cell/range.js +25 -29
  6. package/3rdparty/walkontable/src/cell/range.mjs +24 -28
  7. package/3rdparty/walkontable/src/core/_base.js +3 -9
  8. package/3rdparty/walkontable/src/core/_base.mjs +3 -9
  9. package/3rdparty/walkontable/src/core/clone.js +2 -2
  10. package/3rdparty/walkontable/src/core/clone.mjs +2 -2
  11. package/3rdparty/walkontable/src/core/core.js +2 -3
  12. package/3rdparty/walkontable/src/core/core.mjs +2 -3
  13. package/3rdparty/walkontable/src/event.js +10 -12
  14. package/3rdparty/walkontable/src/event.mjs +10 -12
  15. package/3rdparty/walkontable/src/facade/core.js +2 -2
  16. package/3rdparty/walkontable/src/facade/core.mjs +2 -2
  17. package/3rdparty/walkontable/src/index.js +2 -10
  18. package/3rdparty/walkontable/src/index.mjs +2 -2
  19. package/3rdparty/walkontable/src/overlay/_base.js +7 -8
  20. package/3rdparty/walkontable/src/overlay/_base.mjs +7 -8
  21. package/3rdparty/walkontable/src/overlay/bottom.js +6 -7
  22. package/3rdparty/walkontable/src/overlay/bottom.mjs +6 -7
  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 +10 -9
  26. package/3rdparty/walkontable/src/overlay/top.mjs +10 -9
  27. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +10 -12
  28. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +10 -12
  29. package/3rdparty/walkontable/src/overlays.js +55 -64
  30. package/3rdparty/walkontable/src/overlays.mjs +55 -64
  31. package/3rdparty/walkontable/src/renderer/table.js +0 -2
  32. package/3rdparty/walkontable/src/renderer/table.mjs +0 -2
  33. package/3rdparty/walkontable/src/scroll.js +20 -23
  34. package/3rdparty/walkontable/src/scroll.mjs +20 -23
  35. package/3rdparty/walkontable/src/selection.js +354 -0
  36. package/3rdparty/walkontable/src/selection.mjs +348 -0
  37. package/3rdparty/walkontable/src/settings.js +13 -15
  38. package/3rdparty/walkontable/src/settings.mjs +13 -15
  39. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +0 -9
  40. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +0 -9
  41. package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +0 -9
  42. package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +0 -9
  43. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +0 -9
  44. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +0 -9
  45. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +0 -9
  46. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +0 -9
  47. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +0 -9
  48. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +0 -9
  49. package/3rdparty/walkontable/src/table.js +101 -33
  50. package/3rdparty/walkontable/src/table.mjs +102 -34
  51. package/base.js +2 -4
  52. package/base.mjs +2 -2
  53. package/core.d.ts +0 -4
  54. package/core.js +19 -52
  55. package/core.mjs +19 -52
  56. package/dataMap/dataSource.js +5 -5
  57. package/dataMap/dataSource.mjs +5 -5
  58. package/dataMap/metaManager/metaSchema.js +1 -8
  59. package/dataMap/metaManager/metaSchema.mjs +1 -8
  60. package/dist/handsontable.css +2 -7
  61. package/dist/handsontable.full.css +2 -7
  62. package/dist/handsontable.full.js +9162 -9474
  63. package/dist/handsontable.full.min.css +3 -3
  64. package/dist/handsontable.full.min.js +123 -115
  65. package/dist/handsontable.js +8763 -9076
  66. package/dist/handsontable.min.css +3 -3
  67. package/dist/handsontable.min.js +11 -3
  68. package/dist/languages/all.js +133 -0
  69. package/dist/languages/ar-AR.js +7 -0
  70. package/dist/languages/cs-CZ.js +7 -0
  71. package/dist/languages/de-CH.js +7 -0
  72. package/dist/languages/de-DE.js +7 -0
  73. package/dist/languages/en-US.js +7 -0
  74. package/dist/languages/es-MX.js +7 -0
  75. package/dist/languages/fr-FR.js +7 -0
  76. package/dist/languages/it-IT.js +7 -0
  77. package/dist/languages/ja-JP.js +7 -0
  78. package/dist/languages/ko-KR.js +7 -0
  79. package/dist/languages/lv-LV.js +7 -0
  80. package/dist/languages/nb-NO.js +7 -0
  81. package/dist/languages/nl-NL.js +7 -0
  82. package/dist/languages/pl-PL.js +7 -0
  83. package/dist/languages/pt-BR.js +7 -0
  84. package/dist/languages/ru-RU.js +7 -0
  85. package/dist/languages/sr-SP.js +7 -0
  86. package/dist/languages/zh-CN.js +7 -0
  87. package/dist/languages/zh-TW.js +7 -0
  88. package/editorManager.js +3 -7
  89. package/editorManager.mjs +3 -7
  90. package/editors/textEditor/textEditor.js +16 -3
  91. package/editors/textEditor/textEditor.mjs +17 -4
  92. package/helpers/dom/element.js +0 -11
  93. package/helpers/dom/element.mjs +0 -10
  94. package/helpers/mixed.js +1 -1
  95. package/helpers/mixed.mjs +1 -1
  96. package/i18n/languages/ar-AR.js +7 -1
  97. package/i18n/languages/cs-CZ.js +7 -1
  98. package/i18n/languages/de-CH.js +7 -1
  99. package/i18n/languages/de-DE.js +7 -1
  100. package/i18n/languages/en-US.js +7 -1
  101. package/i18n/languages/es-MX.js +7 -1
  102. package/i18n/languages/fr-FR.js +7 -1
  103. package/i18n/languages/it-IT.js +7 -1
  104. package/i18n/languages/ja-JP.js +7 -1
  105. package/i18n/languages/ko-KR.js +7 -1
  106. package/i18n/languages/lv-LV.js +7 -1
  107. package/i18n/languages/nb-NO.js +7 -1
  108. package/i18n/languages/nl-NL.js +7 -1
  109. package/i18n/languages/pl-PL.js +7 -1
  110. package/i18n/languages/pt-BR.js +7 -1
  111. package/i18n/languages/ru-RU.js +7 -1
  112. package/i18n/languages/sr-SP.js +7 -1
  113. package/i18n/languages/zh-CN.js +7 -1
  114. package/i18n/languages/zh-TW.js +7 -1
  115. package/languages/all.js +133 -0
  116. package/languages/ar-AR.js +7 -0
  117. package/languages/cs-CZ.js +7 -0
  118. package/languages/de-CH.js +7 -0
  119. package/languages/de-DE.js +7 -0
  120. package/languages/en-US.js +7 -0
  121. package/languages/es-MX.js +7 -0
  122. package/languages/fr-FR.js +7 -0
  123. package/languages/index.js +133 -0
  124. package/languages/it-IT.js +7 -0
  125. package/languages/ja-JP.js +7 -0
  126. package/languages/ko-KR.js +7 -0
  127. package/languages/lv-LV.js +7 -0
  128. package/languages/nb-NO.js +7 -0
  129. package/languages/nl-NL.js +7 -0
  130. package/languages/pl-PL.js +7 -0
  131. package/languages/pt-BR.js +7 -0
  132. package/languages/ru-RU.js +7 -0
  133. package/languages/sr-SP.js +7 -0
  134. package/languages/zh-CN.js +7 -0
  135. package/languages/zh-TW.js +7 -0
  136. package/package.json +3 -2
  137. package/pluginHooks.js +17 -7
  138. package/pluginHooks.mjs +16 -4
  139. package/plugins/autoRowSize/autoRowSize.js +2 -2
  140. package/plugins/autoRowSize/autoRowSize.mjs +2 -2
  141. package/plugins/copyPaste/copyPaste.js +93 -12
  142. package/plugins/copyPaste/copyPaste.mjs +93 -12
  143. package/plugins/copyPaste/copyableRanges.js +25 -31
  144. package/plugins/copyPaste/copyableRanges.mjs +18 -24
  145. package/plugins/copyPaste/focusableElement.js +219 -0
  146. package/plugins/copyPaste/focusableElement.mjs +213 -0
  147. package/plugins/customBorders/customBorders.js +2 -6
  148. package/plugins/customBorders/customBorders.mjs +3 -7
  149. package/plugins/filters/filters.js +5 -0
  150. package/plugins/filters/filters.mjs +5 -0
  151. package/plugins/formulas/formulas.js +190 -168
  152. package/plugins/formulas/formulas.mjs +190 -168
  153. package/plugins/formulas/indexSyncer/axisSyncer.js +379 -0
  154. package/plugins/formulas/indexSyncer/axisSyncer.mjs +374 -0
  155. package/plugins/formulas/indexSyncer/index.js +225 -0
  156. package/plugins/formulas/indexSyncer/index.mjs +219 -0
  157. package/plugins/mergeCells/mergeCells.js +16 -0
  158. package/plugins/mergeCells/mergeCells.mjs +16 -0
  159. package/plugins/nestedHeaders/nestedHeaders.js +4 -3
  160. package/plugins/nestedHeaders/nestedHeaders.mjs +4 -3
  161. package/plugins/nestedHeaders/stateManager/headersTree.js +23 -26
  162. package/plugins/nestedHeaders/stateManager/headersTree.mjs +20 -23
  163. package/plugins/nestedHeaders/stateManager/index.js +3 -3
  164. package/plugins/nestedHeaders/stateManager/matrixGenerator.js +1 -0
  165. package/plugins/nestedHeaders/stateManager/settingsNormalizer.js +1 -1
  166. package/plugins/nestedHeaders/utils/ghostTable.js +30 -35
  167. package/plugins/nestedHeaders/utils/ghostTable.mjs +30 -35
  168. package/plugins/registry.js +3 -1
  169. package/plugins/undoRedo/undoRedo.js +0 -1
  170. package/plugins/undoRedo/undoRedo.mjs +0 -1
  171. package/renderers/baseRenderer/baseRenderer.js +0 -3
  172. package/renderers/baseRenderer/baseRenderer.mjs +0 -3
  173. package/selection/highlight/constants.js +16 -0
  174. package/selection/highlight/constants.mjs +6 -0
  175. package/selection/highlight/highlight.js +133 -335
  176. package/selection/highlight/highlight.mjs +129 -325
  177. package/selection/highlight/types/activeHeader.js +9 -10
  178. package/selection/highlight/types/activeHeader.mjs +8 -10
  179. package/selection/highlight/types/area.js +27 -12
  180. package/selection/highlight/types/area.mjs +30 -16
  181. package/selection/highlight/types/{focus.js → cell.js} +8 -5
  182. package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
  183. package/selection/highlight/types/customSelection.js +10 -7
  184. package/selection/highlight/types/customSelection.mjs +9 -7
  185. package/selection/highlight/types/fill.js +8 -5
  186. package/selection/highlight/types/fill.mjs +7 -5
  187. package/selection/highlight/types/header.js +20 -10
  188. package/selection/highlight/types/header.mjs +19 -10
  189. package/selection/highlight/types/{row.js → index.js} +31 -27
  190. package/selection/highlight/types/{row.mjs → index.mjs} +29 -24
  191. package/selection/highlight/visualSelection.js +21 -12
  192. package/selection/highlight/visualSelection.mjs +21 -12
  193. package/selection/index.js +7 -4
  194. package/selection/index.mjs +3 -2
  195. package/selection/selection.js +46 -88
  196. package/selection/selection.mjs +44 -82
  197. package/settings.d.ts +0 -1
  198. package/tableView.js +66 -94
  199. package/tableView.mjs +66 -94
  200. package/translations/changesObservable/observable.js +41 -46
  201. package/translations/changesObservable/observable.mjs +36 -41
  202. package/translations/changesObservable/observer.js +1 -1
  203. package/translations/indexMapper.js +21 -0
  204. package/translations/indexMapper.mjs +21 -0
  205. package/utils/dataStructures/tree.js +15 -18
  206. package/utils/dataStructures/tree.mjs +15 -18
  207. package/utils/parseTable.js +5 -1
  208. package/utils/parseTable.mjs +5 -1
  209. package/3rdparty/walkontable/src/selection/border/constants.js +0 -18
  210. package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -13
  211. package/3rdparty/walkontable/src/selection/constants.js +0 -63
  212. package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
  213. package/3rdparty/walkontable/src/selection/index.js +0 -30
  214. package/3rdparty/walkontable/src/selection/index.mjs +0 -5
  215. package/3rdparty/walkontable/src/selection/manager.js +0 -334
  216. package/3rdparty/walkontable/src/selection/manager.mjs +0 -328
  217. package/3rdparty/walkontable/src/selection/scanner.js +0 -363
  218. package/3rdparty/walkontable/src/selection/scanner.mjs +0 -359
  219. package/3rdparty/walkontable/src/selection/selection.js +0 -133
  220. package/3rdparty/walkontable/src/selection/selection.mjs +0 -127
  221. package/focusManager.d.ts +0 -12
  222. package/focusManager.js +0 -249
  223. package/focusManager.mjs +0 -245
  224. package/selection/highlight/types/areaLayered.js +0 -54
  225. package/selection/highlight/types/areaLayered.mjs +0 -49
  226. package/selection/highlight/types/column.js +0 -50
  227. package/selection/highlight/types/column.mjs +0 -45
@@ -585,7 +585,6 @@ UndoRedo.RemoveColumnAction.prototype.undo = function (instance, undoneCallback)
585
585
  });
586
586
  });
587
587
  instance.setSourceDataAtCell(changes, void 0, void 0, 'UndoRedo.undo');
588
- instance.columnIndexMapper.insertIndexes(ascendingIndexes[0], ascendingIndexes.length);
589
588
  if (typeof this.headers !== 'undefined') {
590
589
  arrayEach(sortedHeaders, function (headerData, columnIndex) {
591
590
  instance.getSettings().colHeaders[ascendingIndexes[columnIndex]] = headerData;
@@ -42,8 +42,5 @@ function baseRenderer(instance, TD, row, col, prop, value, cellProperties) {
42
42
  }
43
43
  (0, _element.removeClass)(TD, classesToRemove);
44
44
  (0, _element.addClass)(TD, classesToAdd);
45
- TD.ariaColIndex = "".concat(col);
46
- TD.setAttribute('tabindex', '-1');
47
- TD.setAttribute('role', 'gridcell');
48
45
  }
49
46
  baseRenderer.RENDERER_TYPE = RENDERER_TYPE;
@@ -35,8 +35,5 @@ export function baseRenderer(instance, TD, row, col, prop, value, cellProperties
35
35
  }
36
36
  removeClass(TD, classesToRemove);
37
37
  addClass(TD, classesToAdd);
38
- TD.ariaColIndex = "".concat(col);
39
- TD.setAttribute('tabindex', '-1');
40
- TD.setAttribute('role', 'gridcell');
41
38
  }
42
39
  baseRenderer.RENDERER_TYPE = RENDERER_TYPE;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.HEADER_TYPE = exports.FILL_TYPE = exports.CUSTOM_SELECTION_TYPE = exports.CELL_TYPE = exports.AREA_TYPE = exports.ACTIVE_HEADER_TYPE = void 0;
5
+ var ACTIVE_HEADER_TYPE = 'active-header';
6
+ exports.ACTIVE_HEADER_TYPE = ACTIVE_HEADER_TYPE;
7
+ var AREA_TYPE = 'area';
8
+ exports.AREA_TYPE = AREA_TYPE;
9
+ var CELL_TYPE = 'cell';
10
+ exports.CELL_TYPE = CELL_TYPE;
11
+ var FILL_TYPE = 'fill';
12
+ exports.FILL_TYPE = FILL_TYPE;
13
+ var HEADER_TYPE = 'header';
14
+ exports.HEADER_TYPE = HEADER_TYPE;
15
+ var CUSTOM_SELECTION_TYPE = 'custom-selection';
16
+ exports.CUSTOM_SELECTION_TYPE = CUSTOM_SELECTION_TYPE;
@@ -0,0 +1,6 @@
1
+ export var ACTIVE_HEADER_TYPE = 'active-header';
2
+ export var AREA_TYPE = 'area';
3
+ export var CELL_TYPE = 'cell';
4
+ export var FILL_TYPE = 'fill';
5
+ export var HEADER_TYPE = 'header';
6
+ export var CUSTOM_SELECTION_TYPE = 'custom-selection';
@@ -1,72 +1,49 @@
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.function.name.js");
9
- require("core-js/modules/es.regexp.exec.js");
10
3
  require("core-js/modules/es.object.keys.js");
11
4
  require("core-js/modules/es.array.filter.js");
12
5
  require("core-js/modules/es.object.get-own-property-descriptor.js");
13
6
  require("core-js/modules/web.dom-collections.for-each.js");
14
7
  require("core-js/modules/es.object.get-own-property-descriptors.js");
15
- 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.function.name.js");
11
+ require("core-js/modules/es.regexp.exec.js");
16
12
  exports.__esModule = true;
17
13
  exports.default = void 0;
14
+ require("core-js/modules/es.array.fill.js");
18
15
  require("core-js/modules/es.array.iterator.js");
19
16
  require("core-js/modules/es.map.js");
20
17
  require("core-js/modules/es.object.to-string.js");
21
18
  require("core-js/modules/es.string.iterator.js");
22
19
  require("core-js/modules/web.dom-collections.iterator.js");
23
- require("core-js/modules/es.array.fill.js");
24
20
  require("core-js/modules/es.array.includes.js");
25
21
  require("core-js/modules/es.string.includes.js");
26
22
  require("core-js/modules/es.array.concat.js");
27
23
  require("core-js/modules/es.symbol.iterator.js");
28
24
  require("core-js/modules/es.symbol.js");
29
25
  require("core-js/modules/es.symbol.description.js");
30
- require("core-js/modules/es.weak-set.js");
31
- var _activeHeader = require("./types/activeHeader");
32
- var _areaLayered = require("./types/areaLayered");
33
- var _area = require("./types/area");
34
- var _column = require("./types/column");
35
- var _focus = require("./types/focus");
36
- var _customSelection = require("./types/customSelection");
37
- var _fill = require("./types/fill");
38
- var _header = require("./types/header");
39
- var _row = require("./types/row");
40
- var _src = require("../../3rdparty/walkontable/src");
41
- exports.ACTIVE_HEADER_TYPE = _src.HIGHLIGHT_ACTIVE_HEADER_TYPE;
42
- exports.AREA_TYPE = _src.HIGHLIGHT_AREA_TYPE;
43
- exports.FOCUS_TYPE = _src.HIGHLIGHT_FOCUS_TYPE;
44
- exports.CUSTOM_SELECTION_TYPE = _src.HIGHLIGHT_CUSTOM_SELECTION_TYPE;
45
- exports.FILL_TYPE = _src.HIGHLIGHT_FILL_TYPE;
46
- exports.HEADER_TYPE = _src.HIGHLIGHT_HEADER_TYPE;
47
- exports.ROW_TYPE = _src.HIGHLIGHT_ROW_TYPE;
48
- exports.COLUMN_TYPE = _src.HIGHLIGHT_COLUMN_TYPE;
26
+ require("core-js/modules/es.symbol.to-primitive.js");
27
+ require("core-js/modules/es.date.to-primitive.js");
28
+ require("core-js/modules/es.number.constructor.js");
29
+ var _types = require("./types");
30
+ var _constants = require("./constants");
49
31
  var _array = require("./../../helpers/array");
50
- var _Symbol$iterator;
51
- 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; }
52
- 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; }
32
+ 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); }
53
33
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
54
34
  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."); }
55
35
  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); }
56
36
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
57
37
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
58
38
  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; }
39
+ 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; }
40
+ 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; }
41
+ 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; }
59
42
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
60
43
  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); } }
61
44
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
62
- function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
63
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
64
- 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; }
65
45
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
66
46
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
67
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
68
- var _createHighlight = /*#__PURE__*/new WeakSet();
69
- _Symbol$iterator = Symbol.iterator;
70
47
  /**
71
48
  * Highlight class responsible for managing Walkontable Selection classes.
72
49
  *
@@ -82,128 +59,68 @@ _Symbol$iterator = Symbol.iterator;
82
59
  * @class Highlight
83
60
  * @util
84
61
  */
85
- var Highlight = /*#__PURE__*/function () {
86
- /**
87
- * Options consumed by Highlight class and Walkontable Selection classes.
88
- *
89
- * @type {object}
90
- */
91
-
92
- /**
93
- * The property which describes which layer level of the visual selection will be modified.
94
- * This option is valid only for `area` and `header` highlight types which occurs multiple times on
95
- * the table (as a non-consecutive selection).
96
- *
97
- * An order of the layers is the same as the order of added new non-consecutive selections.
98
- *
99
- * @type {number}
100
- * @default 0
101
- */
102
-
103
- /**
104
- * `cell` highlight object which describes attributes for the currently selected cell.
105
- * It can only occur only once on the table.
106
- *
107
- * @type {Selection}
108
- */
109
-
110
- /**
111
- * `fill` highlight object which describes attributes for the borders for autofill functionality.
112
- * It can only occur only once on the table.
113
- *
114
- * @type {Selection}
115
- */
116
-
117
- /**
118
- * Collection of the `area` highlights. That objects describes attributes for the borders and selection of
119
- * the multiple selected cells. It can occur multiple times on the table.
120
- *
121
- * @type {Map.<number, Selection>}
122
- */
123
-
124
- /**
125
- * Collection of the `highlight` highlights. That objects describes attributes for the borders and selection of
126
- * the multiple selected cells. It can occur multiple times on the table.
127
- *
128
- * @type {Map.<number, Selection>}
129
- */
130
-
131
- /**
132
- * Collection of the `header` highlights. That objects describes attributes for the selection of
133
- * the multiple selected rows in the table header. It can occur multiple times on the table.
134
- *
135
- * @type {Map.<number, Selection>}
136
- */
137
-
138
- /**
139
- * Collection of the `header` highlights. That objects describes attributes for the selection of
140
- * the multiple selected columns in the table header. It can occur multiple times on the table.
141
- *
142
- * @type {Map.<number, Selection>}
143
- */
144
-
145
- /**
146
- * Collection of the `active-header` highlights. That objects describes attributes for the selection of
147
- * the multiple selected rows in the table header. The table headers which have selected all items in
148
- * a row will be marked as `active-header`.
149
- *
150
- * @type {Map.<number, Selection>}
151
- */
152
-
153
- /**
154
- * Collection of the `active-header` highlights. That objects describes attributes for the selection of
155
- * the multiple selected columns in the table header. The table headers which have selected all items in
156
- * a row will be marked as `active-header`.
157
- *
158
- * @type {Map.<number, Selection>}
159
- */
160
-
161
- /**
162
- * Collection of the `rows` highlights. That objects describes attributes for the selection of
163
- * the multiple selected cells in a row. It can occur multiple times on the table.
164
- *
165
- * @type {Map.<number, Selection>}
166
- */
167
-
168
- /**
169
- * Collection of the `columns` highlights. That objects describes attributes for the selection of
170
- * the multiple selected cells in a column. It can occur multiple times on the table.
171
- *
172
- * @type {Map.<number, Selection>}
173
- */
174
-
175
- /**
176
- * Collection of the `custom-selection`, holder for example borders added through CustomBorders plugin.
177
- *
178
- * @type {Selection[]}
179
- */
180
-
62
+ var Highlight = /*#__PURE__*/function (_Symbol$iterator) {
181
63
  function Highlight(options) {
182
64
  _classCallCheck(this, Highlight);
183
65
  /**
184
- * Creates (if not exist in the cache) Walkontable Selection instance.
66
+ * Options consumed by Highlight class and Walkontable Selection classes.
185
67
  *
186
- * @param {Map} cacheMap The map where the instance will be cached.
187
- * @param {Function} highlightFactory The function factory.
188
- * @returns {VisualSelection}
68
+ * @type {object}
189
69
  */
190
- _classPrivateMethodInitSpec(this, _createHighlight);
191
- _defineProperty(this, "options", void 0);
192
- _defineProperty(this, "layerLevel", 0);
193
- _defineProperty(this, "focus", void 0);
194
- _defineProperty(this, "fill", void 0);
195
- _defineProperty(this, "layeredAreas", new Map());
196
- _defineProperty(this, "areas", new Map());
197
- _defineProperty(this, "rowHeaders", new Map());
198
- _defineProperty(this, "columnHeaders", new Map());
199
- _defineProperty(this, "activeRowHeaders", new Map());
200
- _defineProperty(this, "activeColumnHeaders", new Map());
201
- _defineProperty(this, "rowHighlights", new Map());
202
- _defineProperty(this, "columnHighlights", new Map());
203
- _defineProperty(this, "customSelections", []);
204
70
  this.options = options;
205
- this.focus = (0, _focus.createHighlight)(options);
206
- this.fill = (0, _fill.createHighlight)(options);
71
+ /**
72
+ * The property which describes which layer level of the visual selection will be modified.
73
+ * This option is valid only for `area` and `header` highlight types which occurs multiple times on
74
+ * the table (as a non-consecutive selection).
75
+ *
76
+ * An order of the layers is the same as the order of added new non-consecutive selections.
77
+ *
78
+ * @type {number}
79
+ * @default 0
80
+ */
81
+ this.layerLevel = 0;
82
+ /**
83
+ * `cell` highlight object which describes attributes for the currently selected cell.
84
+ * It can only occur only once on the table.
85
+ *
86
+ * @type {Selection}
87
+ */
88
+ this.cell = (0, _types.createHighlight)(_constants.CELL_TYPE, options);
89
+ /**
90
+ * `fill` highlight object which describes attributes for the borders for autofill functionality.
91
+ * It can only occur only once on the table.
92
+ *
93
+ * @type {Selection}
94
+ */
95
+ this.fill = (0, _types.createHighlight)(_constants.FILL_TYPE, options);
96
+ /**
97
+ * Collection of the `area` highlights. That objects describes attributes for the borders and selection of
98
+ * the multiple selected cells. It can occur multiple times on the table.
99
+ *
100
+ * @type {Map.<number, Selection>}
101
+ */
102
+ this.areas = new Map();
103
+ /**
104
+ * Collection of the `header` highlights. That objects describes attributes for the selection of
105
+ * the multiple selected rows and columns in the table header. It can occur multiple times on the table.
106
+ *
107
+ * @type {Map.<number, Selection>}
108
+ */
109
+ this.headers = new Map();
110
+ /**
111
+ * Collection of the `active-header` highlights. That objects describes attributes for the selection of
112
+ * the multiple selected rows and columns in the table header. The table headers which have selected all items in
113
+ * a row will be marked as `active-header`.
114
+ *
115
+ * @type {Map.<number, Selection>}
116
+ */
117
+ this.activeHeaders = new Map();
118
+ /**
119
+ * Collection of the `custom-selection`, holder for example borders added through CustomBorders plugin.
120
+ *
121
+ * @type {Selection[]}
122
+ */
123
+ this.customSelections = [];
207
124
  }
208
125
 
209
126
  /**
@@ -219,14 +136,11 @@ var Highlight = /*#__PURE__*/function () {
219
136
  var type = highlightType;
220
137
 
221
138
  // Legacy compatibility.
222
- if (highlightType === _src.HIGHLIGHT_FOCUS_TYPE) {
139
+ if (highlightType === _constants.CELL_TYPE) {
223
140
  type = 'current'; // One from settings for `disableVisualSelection` up to Handsontable 0.36/Handsontable Pro 1.16.0.
224
141
  }
225
142
 
226
- var disableHighlight = false;
227
- if (coords.isCell()) {
228
- disableHighlight = this.options.disabledCellSelection(coords.row, coords.col);
229
- }
143
+ var disableHighlight = this.options.disabledCellSelection(coords.row, coords.col);
230
144
  if (typeof disableHighlight === 'string') {
231
145
  disableHighlight = [disableHighlight];
232
146
  }
@@ -248,15 +162,14 @@ var Highlight = /*#__PURE__*/function () {
248
162
  }
249
163
 
250
164
  /**
251
- * Get Walkontable Selection instance created for controlling highlight of the currently
252
- * focused cell (or header).
165
+ * Get Walkontable Selection instance created for controlling highlight of the currently selected/edited cell.
253
166
  *
254
167
  * @returns {Selection}
255
168
  */
256
169
  }, {
257
- key: "getFocus",
258
- value: function getFocus() {
259
- return this.focus;
170
+ key: "getCell",
171
+ value: function getCell() {
172
+ return this.cell;
260
173
  }
261
174
 
262
175
  /**
@@ -271,38 +184,25 @@ var Highlight = /*#__PURE__*/function () {
271
184
  }
272
185
 
273
186
  /**
274
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
275
- * `area` highlights.
276
- *
277
- * @returns {Selection}
278
- */
279
- }, {
280
- key: "createLayeredArea",
281
- value: function createLayeredArea() {
282
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.layeredAreas, _areaLayered.createHighlight);
283
- }
284
-
285
- /**
286
- * Get all Walkontable Selection instances which describes the state of the visual highlight of the cells.
287
- *
288
- * @returns {Selection[]}
289
- */
290
- }, {
291
- key: "getLayeredAreas",
292
- value: function getLayeredAreas() {
293
- return _toConsumableArray(this.layeredAreas.values());
294
- }
295
-
296
- /**
297
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
298
- * `highlight` highlights.
187
+ * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight
188
+ * of the multiple selected cells.
299
189
  *
300
190
  * @returns {Selection}
301
191
  */
302
192
  }, {
303
- key: "createArea",
304
- value: function createArea() {
305
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.areas, _area.createHighlight);
193
+ key: "createOrGetArea",
194
+ value: function createOrGetArea() {
195
+ var layerLevel = this.layerLevel;
196
+ var area;
197
+ if (this.areas.has(layerLevel)) {
198
+ area = this.areas.get(layerLevel);
199
+ } else {
200
+ area = (0, _types.createHighlight)(_constants.AREA_TYPE, _objectSpread({
201
+ layerLevel: layerLevel
202
+ }, this.options));
203
+ this.areas.set(layerLevel, area);
204
+ }
205
+ return area;
306
206
  }
307
207
 
308
208
  /**
@@ -317,38 +217,23 @@ var Highlight = /*#__PURE__*/function () {
317
217
  }
318
218
 
319
219
  /**
320
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
321
- * header highlight for rows.
322
- *
323
- * @returns {Selection}
324
- */
325
- }, {
326
- key: "createRowHeader",
327
- value: function createRowHeader() {
328
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.rowHeaders, _header.createHighlight);
329
- }
330
-
331
- /**
332
- * Get all Walkontable Selection instances which describes the state of the visual highlight of the headers.
333
- *
334
- * @returns {Selection[]}
335
- */
336
- }, {
337
- key: "getRowHeaders",
338
- value: function getRowHeaders() {
339
- return _toConsumableArray(this.rowHeaders.values());
340
- }
341
-
342
- /**
343
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
344
- * header highlight for columns.
220
+ * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight
221
+ * of the multiple selected header cells.
345
222
  *
346
223
  * @returns {Selection}
347
224
  */
348
225
  }, {
349
- key: "createColumnHeader",
350
- value: function createColumnHeader() {
351
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.columnHeaders, _header.createHighlight);
226
+ key: "createOrGetHeader",
227
+ value: function createOrGetHeader() {
228
+ var layerLevel = this.layerLevel;
229
+ var header;
230
+ if (this.headers.has(layerLevel)) {
231
+ header = this.headers.get(layerLevel);
232
+ } else {
233
+ header = (0, _types.createHighlight)(_constants.HEADER_TYPE, _objectSpread({}, this.options));
234
+ this.headers.set(layerLevel, header);
235
+ }
236
+ return header;
352
237
  }
353
238
 
354
239
  /**
@@ -357,44 +242,29 @@ var Highlight = /*#__PURE__*/function () {
357
242
  * @returns {Selection[]}
358
243
  */
359
244
  }, {
360
- key: "getColumnHeaders",
361
- value: function getColumnHeaders() {
362
- return _toConsumableArray(this.columnHeaders.values());
363
- }
364
-
365
- /**
366
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
367
- * highlight for active row headers.
368
- *
369
- * @returns {Selection}
370
- */
371
- }, {
372
- key: "createActiveRowHeader",
373
- value: function createActiveRowHeader() {
374
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.activeRowHeaders, _activeHeader.createHighlight);
375
- }
376
-
377
- /**
378
- * Get all Walkontable Selection instances which describes the state of the visual highlight of the active headers.
379
- *
380
- * @returns {Selection[]}
381
- */
382
- }, {
383
- key: "getActiveRowHeaders",
384
- value: function getActiveRowHeaders() {
385
- return _toConsumableArray(this.activeRowHeaders.values());
245
+ key: "getHeaders",
246
+ value: function getHeaders() {
247
+ return _toConsumableArray(this.headers.values());
386
248
  }
387
249
 
388
250
  /**
389
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
390
- * highlight for active column headers.
251
+ * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight
252
+ * of the multiple selected active header cells.
391
253
  *
392
254
  * @returns {Selection}
393
255
  */
394
256
  }, {
395
- key: "createActiveColumnHeader",
396
- value: function createActiveColumnHeader() {
397
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.activeColumnHeaders, _activeHeader.createHighlight);
257
+ key: "createOrGetActiveHeader",
258
+ value: function createOrGetActiveHeader() {
259
+ var layerLevel = this.layerLevel;
260
+ var header;
261
+ if (this.activeHeaders.has(layerLevel)) {
262
+ header = this.activeHeaders.get(layerLevel);
263
+ } else {
264
+ header = (0, _types.createHighlight)(_constants.ACTIVE_HEADER_TYPE, _objectSpread({}, this.options));
265
+ this.activeHeaders.set(layerLevel, header);
266
+ }
267
+ return header;
398
268
  }
399
269
 
400
270
  /**
@@ -403,55 +273,9 @@ var Highlight = /*#__PURE__*/function () {
403
273
  * @returns {Selection[]}
404
274
  */
405
275
  }, {
406
- key: "getActiveColumnHeaders",
407
- value: function getActiveColumnHeaders() {
408
- return _toConsumableArray(this.activeColumnHeaders.values());
409
- }
410
-
411
- /**
412
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
413
- * highlight cells in a row.
414
- *
415
- * @returns {Selection}
416
- */
417
- }, {
418
- key: "createRowHighlight",
419
- value: function createRowHighlight() {
420
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.rowHighlights, _row.createHighlight);
421
- }
422
-
423
- /**
424
- * Get all Walkontable Selection instances which describes the state of the rows highlighting.
425
- *
426
- * @returns {Selection[]}
427
- */
428
- }, {
429
- key: "getRowHighlights",
430
- value: function getRowHighlights() {
431
- return _toConsumableArray(this.rowHighlights.values());
432
- }
433
-
434
- /**
435
- * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
436
- * highlight cells in a column.
437
- *
438
- * @returns {Selection}
439
- */
440
- }, {
441
- key: "createColumnHighlight",
442
- value: function createColumnHighlight() {
443
- return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.columnHighlights, _column.createHighlight);
444
- }
445
-
446
- /**
447
- * Get all Walkontable Selection instances which describes the state of the columns highlighting.
448
- *
449
- * @returns {Selection[]}
450
- */
451
- }, {
452
- key: "getColumnHighlights",
453
- value: function getColumnHighlights() {
454
- return _toConsumableArray(this.columnHighlights.values());
276
+ key: "getActiveHeaders",
277
+ value: function getActiveHeaders() {
278
+ return _toConsumableArray(this.activeHeaders.values());
455
279
  }
456
280
 
457
281
  /**
@@ -473,7 +297,7 @@ var Highlight = /*#__PURE__*/function () {
473
297
  }, {
474
298
  key: "addCustomSelection",
475
299
  value: function addCustomSelection(selectionInstance) {
476
- this.customSelections.push((0, _customSelection.createHighlight)(_objectSpread(_objectSpread({}, this.options), selectionInstance)));
300
+ this.customSelections.push((0, _types.createHighlight)(_constants.CUSTOM_SELECTION_TYPE, _objectSpread(_objectSpread({}, this.options), selectionInstance)));
477
301
  }
478
302
 
479
303
  /**
@@ -482,57 +306,31 @@ var Highlight = /*#__PURE__*/function () {
482
306
  }, {
483
307
  key: "clear",
484
308
  value: function clear() {
485
- this.focus.clear();
309
+ this.cell.clear();
486
310
  this.fill.clear();
487
311
  (0, _array.arrayEach)(this.areas.values(), function (highlight) {
488
312
  return void highlight.clear();
489
313
  });
490
- (0, _array.arrayEach)(this.layeredAreas.values(), function (highlight) {
491
- return void highlight.clear();
492
- });
493
- (0, _array.arrayEach)(this.rowHeaders.values(), function (highlight) {
494
- return void highlight.clear();
495
- });
496
- (0, _array.arrayEach)(this.columnHeaders.values(), function (highlight) {
314
+ (0, _array.arrayEach)(this.headers.values(), function (highlight) {
497
315
  return void highlight.clear();
498
316
  });
499
- (0, _array.arrayEach)(this.activeRowHeaders.values(), function (highlight) {
500
- return void highlight.clear();
501
- });
502
- (0, _array.arrayEach)(this.activeColumnHeaders.values(), function (highlight) {
503
- return void highlight.clear();
504
- });
505
- (0, _array.arrayEach)(this.rowHighlights.values(), function (highlight) {
506
- return void highlight.clear();
507
- });
508
- (0, _array.arrayEach)(this.columnHighlights.values(), function (highlight) {
317
+ (0, _array.arrayEach)(this.activeHeaders.values(), function (highlight) {
509
318
  return void highlight.clear();
510
319
  });
511
320
  }
512
- }, {
513
- key: _Symbol$iterator,
514
- value:
321
+
515
322
  /**
516
323
  * This object can be iterate over using `for of` syntax or using internal `arrayEach` helper.
517
324
  *
518
325
  * @returns {Selection[]}
519
326
  */
520
- function value() {
521
- 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.rowHighlights.values()), _toConsumableArray(this.columnHighlights.values()), _toConsumableArray(this.customSelections))[Symbol.iterator]();
327
+ }, {
328
+ key: _Symbol$iterator,
329
+ value: function value() {
330
+ return [this.cell, this.fill].concat(_toConsumableArray(this.areas.values()), _toConsumableArray(this.headers.values()), _toConsumableArray(this.activeHeaders.values()), _toConsumableArray(this.customSelections))[Symbol.iterator]();
522
331
  }
523
332
  }]);
524
333
  return Highlight;
525
- }();
526
- function _createHighlight2(cacheMap, highlightFactory) {
527
- var layerLevel = this.layerLevel;
528
- if (cacheMap.has(layerLevel)) {
529
- return cacheMap.get(layerLevel);
530
- }
531
- var highlight = highlightFactory(_objectSpread({
532
- layerLevel: layerLevel
533
- }, this.options));
534
- cacheMap.set(layerLevel, highlight);
535
- return highlight;
536
- }
334
+ }(Symbol.iterator);
537
335
  var _default = Highlight;
538
336
  exports.default = _default;