handsontable 0.0.0-next-8d0643b-20230809 → 0.0.0-next-be16baf-20230809

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 (297) hide show
  1. package/3rdparty/walkontable/src/cell/coords.d.ts +6 -1
  2. package/3rdparty/walkontable/src/cell/coords.js +50 -11
  3. package/3rdparty/walkontable/src/cell/coords.mjs +50 -11
  4. package/3rdparty/walkontable/src/cell/range.d.ts +9 -2
  5. package/3rdparty/walkontable/src/cell/range.js +38 -7
  6. package/3rdparty/walkontable/src/cell/range.mjs +38 -7
  7. package/3rdparty/walkontable/src/core/_base.js +9 -3
  8. package/3rdparty/walkontable/src/core/_base.mjs +9 -3
  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 +3 -2
  12. package/3rdparty/walkontable/src/core/core.mjs +3 -2
  13. package/3rdparty/walkontable/src/event.js +7 -7
  14. package/3rdparty/walkontable/src/event.mjs +7 -7
  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 +10 -2
  18. package/3rdparty/walkontable/src/index.mjs +2 -2
  19. package/3rdparty/walkontable/src/overlay/_base.js +1 -1
  20. package/3rdparty/walkontable/src/overlay/_base.mjs +1 -1
  21. package/3rdparty/walkontable/src/overlay/inlineStart.js +2 -6
  22. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -6
  23. package/3rdparty/walkontable/src/overlay/top.js +2 -6
  24. package/3rdparty/walkontable/src/overlay/top.mjs +2 -6
  25. package/3rdparty/walkontable/src/{border.js → selection/border/border.js} +7 -12
  26. package/3rdparty/walkontable/src/{border.mjs → selection/border/border.mjs} +7 -12
  27. package/3rdparty/walkontable/src/selection/border/constants.js +16 -0
  28. package/3rdparty/walkontable/src/selection/border/constants.mjs +12 -0
  29. package/3rdparty/walkontable/src/selection/constants.js +62 -0
  30. package/3rdparty/walkontable/src/selection/constants.mjs +51 -0
  31. package/3rdparty/walkontable/src/selection/index.js +26 -0
  32. package/3rdparty/walkontable/src/selection/index.mjs +5 -0
  33. package/3rdparty/walkontable/src/selection/manager.js +259 -0
  34. package/3rdparty/walkontable/src/selection/manager.mjs +254 -0
  35. package/3rdparty/walkontable/src/selection/scanner.js +270 -0
  36. package/3rdparty/walkontable/src/selection/scanner.mjs +267 -0
  37. package/3rdparty/walkontable/src/selection/selection.js +101 -0
  38. package/3rdparty/walkontable/src/selection/selection.mjs +96 -0
  39. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +9 -0
  40. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +9 -0
  41. package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +9 -0
  42. package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +9 -0
  43. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +9 -0
  44. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +9 -0
  45. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +9 -0
  46. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +9 -0
  47. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +9 -0
  48. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +9 -0
  49. package/3rdparty/walkontable/src/table.js +6 -78
  50. package/3rdparty/walkontable/src/table.mjs +7 -79
  51. package/base.js +2 -2
  52. package/base.mjs +2 -2
  53. package/common.d.ts +1 -1
  54. package/core/focusCatcher/focusDetector.js +58 -0
  55. package/core/focusCatcher/focusDetector.mjs +54 -0
  56. package/core/focusCatcher/index.js +142 -0
  57. package/core/focusCatcher/index.mjs +138 -0
  58. package/core/index.js +9 -0
  59. package/core/index.mjs +1 -0
  60. package/core.d.ts +6 -3
  61. package/core.js +176 -293
  62. package/core.mjs +176 -293
  63. package/dataMap/metaManager/metaSchema.js +41 -0
  64. package/dataMap/metaManager/metaSchema.mjs +41 -0
  65. package/dist/handsontable.css +24 -4
  66. package/dist/handsontable.full.css +24 -4
  67. package/dist/handsontable.full.js +8682 -5378
  68. package/dist/handsontable.full.min.css +3 -3
  69. package/dist/handsontable.full.min.js +25 -25
  70. package/dist/handsontable.js +10989 -7685
  71. package/dist/handsontable.min.css +3 -3
  72. package/dist/handsontable.min.js +19 -19
  73. package/editorManager.js +11 -75
  74. package/editorManager.mjs +11 -74
  75. package/editors/baseEditor/baseEditor.d.ts +0 -1
  76. package/editors/textEditor/textEditor.js +3 -11
  77. package/editors/textEditor/textEditor.mjs +4 -12
  78. package/helpers/mixed.js +1 -1
  79. package/helpers/mixed.mjs +1 -1
  80. package/helpers/number.d.ts +1 -0
  81. package/helpers/number.js +18 -0
  82. package/helpers/number.mjs +17 -0
  83. package/package.json +1 -1
  84. package/pluginHooks.d.ts +7 -1
  85. package/pluginHooks.js +106 -1
  86. package/pluginHooks.mjs +106 -1
  87. package/plugins/collapsibleColumns/collapsibleColumns.js +58 -4
  88. package/plugins/collapsibleColumns/collapsibleColumns.mjs +58 -4
  89. package/plugins/columnSorting/columnSorting.js +38 -0
  90. package/plugins/columnSorting/columnSorting.mjs +38 -2
  91. package/plugins/columnSorting/index.js +3 -1
  92. package/plugins/columnSorting/index.mjs +1 -1
  93. package/plugins/comments/commentEditor.js +1 -0
  94. package/plugins/comments/commentEditor.mjs +1 -0
  95. package/plugins/comments/comments.js +251 -189
  96. package/plugins/comments/comments.mjs +250 -190
  97. package/plugins/comments/contextMenuItem/addEditComment.js +41 -0
  98. package/plugins/comments/contextMenuItem/addEditComment.mjs +35 -0
  99. package/plugins/comments/contextMenuItem/readOnlyComment.js +49 -0
  100. package/plugins/comments/contextMenuItem/readOnlyComment.mjs +43 -0
  101. package/plugins/comments/contextMenuItem/removeComment.js +38 -0
  102. package/plugins/comments/contextMenuItem/removeComment.mjs +32 -0
  103. package/plugins/contextMenu/contextMenu.d.ts +1 -1
  104. package/plugins/contextMenu/contextMenu.js +72 -30
  105. package/plugins/contextMenu/contextMenu.mjs +73 -31
  106. package/plugins/contextMenu/predefinedItems/alignment.js +7 -0
  107. package/plugins/contextMenu/predefinedItems/alignment.mjs +7 -0
  108. package/plugins/contextMenu/predefinedItems/clearColumn.js +5 -3
  109. package/plugins/contextMenu/predefinedItems/clearColumn.mjs +5 -3
  110. package/plugins/contextMenu/predefinedItems/columnLeft.js +5 -3
  111. package/plugins/contextMenu/predefinedItems/columnLeft.mjs +5 -3
  112. package/plugins/contextMenu/predefinedItems/columnRight.js +5 -3
  113. package/plugins/contextMenu/predefinedItems/columnRight.mjs +5 -3
  114. package/plugins/contextMenu/predefinedItems/readOnly.js +7 -0
  115. package/plugins/contextMenu/predefinedItems/readOnly.mjs +7 -0
  116. package/plugins/contextMenu/predefinedItems/removeColumn.js +7 -5
  117. package/plugins/contextMenu/predefinedItems/removeColumn.mjs +5 -3
  118. package/plugins/contextMenu/predefinedItems/removeRow.js +7 -5
  119. package/plugins/contextMenu/predefinedItems/removeRow.mjs +5 -3
  120. package/plugins/contextMenu/predefinedItems/rowAbove.js +5 -3
  121. package/plugins/contextMenu/predefinedItems/rowAbove.mjs +5 -3
  122. package/plugins/contextMenu/predefinedItems/rowBelow.js +5 -3
  123. package/plugins/contextMenu/predefinedItems/rowBelow.mjs +5 -3
  124. package/plugins/contextMenu/utils.js +28 -16
  125. package/plugins/contextMenu/utils.mjs +27 -15
  126. package/plugins/copyPaste/contextMenuItem/copy.js +7 -0
  127. package/plugins/copyPaste/contextMenuItem/copy.mjs +7 -0
  128. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +9 -1
  129. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +9 -1
  130. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +9 -1
  131. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +9 -1
  132. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +9 -1
  133. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +9 -1
  134. package/plugins/copyPaste/contextMenuItem/cut.js +7 -0
  135. package/plugins/copyPaste/contextMenuItem/cut.mjs +7 -0
  136. package/plugins/copyPaste/copyPaste.js +14 -10
  137. package/plugins/copyPaste/copyPaste.mjs +14 -10
  138. package/plugins/customBorders/customBorders.js +23 -20
  139. package/plugins/customBorders/customBorders.mjs +24 -21
  140. package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
  141. package/plugins/dropdownMenu/dropdownMenu.js +89 -32
  142. package/plugins/dropdownMenu/dropdownMenu.mjs +89 -32
  143. package/plugins/filters/filters.js +31 -14
  144. package/plugins/filters/filters.mjs +30 -13
  145. package/plugins/mergeCells/mergeCells.js +5 -17
  146. package/plugins/mergeCells/mergeCells.mjs +5 -17
  147. package/plugins/multiColumnSorting/multiColumnSorting.js +37 -2
  148. package/plugins/multiColumnSorting/multiColumnSorting.mjs +37 -2
  149. package/plugins/nestedHeaders/nestedHeaders.js +121 -8
  150. package/plugins/nestedHeaders/nestedHeaders.mjs +121 -8
  151. package/plugins/nestedHeaders/stateManager/index.js +37 -0
  152. package/plugins/nestedHeaders/stateManager/index.mjs +37 -0
  153. package/plugins/nestedRows/nestedRows.js +41 -0
  154. package/plugins/nestedRows/nestedRows.mjs +41 -0
  155. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
  156. package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
  157. package/selection/highlight/highlight.js +256 -71
  158. package/selection/highlight/highlight.mjs +250 -71
  159. package/selection/highlight/types/activeHeader.js +10 -8
  160. package/selection/highlight/types/activeHeader.mjs +10 -8
  161. package/selection/highlight/types/area.js +6 -18
  162. package/selection/highlight/types/area.mjs +6 -18
  163. package/selection/highlight/types/areaLayered.js +31 -0
  164. package/selection/highlight/types/areaLayered.mjs +26 -0
  165. package/selection/highlight/types/column.js +27 -0
  166. package/selection/highlight/types/column.mjs +22 -0
  167. package/selection/highlight/types/customSelection.js +7 -9
  168. package/selection/highlight/types/customSelection.mjs +7 -9
  169. package/selection/highlight/types/fill.js +5 -7
  170. package/selection/highlight/types/fill.mjs +5 -7
  171. package/selection/highlight/types/{cell.js → focus.js} +5 -7
  172. package/selection/highlight/types/{cell.mjs → focus.mjs} +5 -7
  173. package/selection/highlight/types/header.js +9 -18
  174. package/selection/highlight/types/header.mjs +9 -18
  175. package/selection/highlight/types/row.js +27 -0
  176. package/selection/highlight/types/row.mjs +22 -0
  177. package/selection/highlight/visualSelection.js +31 -27
  178. package/selection/highlight/visualSelection.mjs +31 -27
  179. package/selection/index.js +4 -7
  180. package/selection/index.mjs +2 -3
  181. package/selection/mouseEventHandler.js +1 -1
  182. package/selection/mouseEventHandler.mjs +1 -1
  183. package/selection/range.js +8 -8
  184. package/selection/range.mjs +8 -8
  185. package/selection/selection.js +293 -154
  186. package/selection/selection.mjs +290 -153
  187. package/selection/transformation.js +232 -90
  188. package/selection/transformation.mjs +232 -90
  189. package/selection/utils.js +15 -21
  190. package/selection/utils.mjs +16 -21
  191. package/settings.d.ts +2 -0
  192. package/shortcutContexts/commands/editor/closeAndSave.js +12 -0
  193. package/shortcutContexts/commands/editor/closeAndSave.mjs +8 -0
  194. package/shortcutContexts/commands/editor/closeWithoutSaving.js +12 -0
  195. package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +8 -0
  196. package/shortcutContexts/commands/editor/fastOpen.js +16 -0
  197. package/shortcutContexts/commands/editor/fastOpen.mjs +12 -0
  198. package/shortcutContexts/commands/editor/index.js +16 -0
  199. package/shortcutContexts/commands/editor/index.mjs +12 -0
  200. package/shortcutContexts/commands/editor/open.js +27 -0
  201. package/shortcutContexts/commands/editor/open.mjs +23 -0
  202. package/shortcutContexts/commands/emptySelectedCells.js +11 -0
  203. package/shortcutContexts/commands/emptySelectedCells.mjs +7 -0
  204. package/shortcutContexts/commands/extendCellsSelection/down.js +15 -0
  205. package/shortcutContexts/commands/extendCellsSelection/down.mjs +11 -0
  206. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +21 -0
  207. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +17 -0
  208. package/shortcutContexts/commands/extendCellsSelection/index.js +26 -0
  209. package/shortcutContexts/commands/extendCellsSelection/index.mjs +22 -0
  210. package/shortcutContexts/commands/extendCellsSelection/left.js +15 -0
  211. package/shortcutContexts/commands/extendCellsSelection/left.mjs +11 -0
  212. package/shortcutContexts/commands/extendCellsSelection/right.js +15 -0
  213. package/shortcutContexts/commands/extendCellsSelection/right.mjs +11 -0
  214. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +19 -0
  215. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +15 -0
  216. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +29 -0
  217. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +25 -0
  218. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +19 -0
  219. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +15 -0
  220. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +19 -0
  221. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +15 -0
  222. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +29 -0
  223. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +25 -0
  224. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +29 -0
  225. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +25 -0
  226. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +29 -0
  227. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +25 -0
  228. package/shortcutContexts/commands/extendCellsSelection/toRows.js +19 -0
  229. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +15 -0
  230. package/shortcutContexts/commands/extendCellsSelection/up.js +15 -0
  231. package/shortcutContexts/commands/extendCellsSelection/up.mjs +11 -0
  232. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +21 -0
  233. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +17 -0
  234. package/shortcutContexts/commands/index.js +35 -0
  235. package/shortcutContexts/commands/index.mjs +31 -0
  236. package/shortcutContexts/commands/moveCellSelection/down.js +13 -0
  237. package/shortcutContexts/commands/moveCellSelection/down.mjs +9 -0
  238. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +31 -0
  239. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +27 -0
  240. package/shortcutContexts/commands/moveCellSelection/index.js +28 -0
  241. package/shortcutContexts/commands/moveCellSelection/index.mjs +24 -0
  242. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +12 -0
  243. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -0
  244. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +12 -0
  245. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -0
  246. package/shortcutContexts/commands/moveCellSelection/left.js +10 -0
  247. package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -0
  248. package/shortcutContexts/commands/moveCellSelection/right.js +10 -0
  249. package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -0
  250. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +17 -0
  251. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +13 -0
  252. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +18 -0
  253. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +14 -0
  254. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +14 -0
  255. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +10 -0
  256. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +17 -0
  257. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +13 -0
  258. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +19 -0
  259. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +15 -0
  260. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +21 -0
  261. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +17 -0
  262. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +17 -0
  263. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +13 -0
  264. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +19 -0
  265. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +15 -0
  266. package/shortcutContexts/commands/moveCellSelection/up.js +13 -0
  267. package/shortcutContexts/commands/moveCellSelection/up.mjs +9 -0
  268. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +31 -0
  269. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +27 -0
  270. package/shortcutContexts/commands/populateSelectedCellsData.js +29 -0
  271. package/shortcutContexts/commands/populateSelectedCellsData.mjs +25 -0
  272. package/shortcutContexts/commands/scrollToFocusedCell.js +36 -0
  273. package/shortcutContexts/commands/scrollToFocusedCell.mjs +32 -0
  274. package/shortcutContexts/commands/selectAll.js +10 -0
  275. package/shortcutContexts/commands/selectAll.mjs +6 -0
  276. package/shortcutContexts/constants.js +13 -0
  277. package/shortcutContexts/constants.mjs +8 -0
  278. package/shortcutContexts/editor.js +25 -0
  279. package/shortcutContexts/editor.mjs +21 -0
  280. package/shortcutContexts/grid.js +163 -0
  281. package/shortcutContexts/grid.mjs +159 -0
  282. package/shortcutContexts/index.js +24 -0
  283. package/shortcutContexts/index.mjs +11 -0
  284. package/shortcuts/manager.js +2 -0
  285. package/shortcuts/manager.mjs +2 -0
  286. package/shortcuts/recorder.js +2 -2
  287. package/shortcuts/recorder.mjs +2 -2
  288. package/shortcuts/utils.js +19 -5
  289. package/shortcuts/utils.mjs +18 -4
  290. package/tableView.js +67 -13
  291. package/tableView.mjs +67 -13
  292. package/3rdparty/walkontable/src/selection.js +0 -295
  293. package/3rdparty/walkontable/src/selection.mjs +0 -290
  294. package/selection/highlight/constants.js +0 -15
  295. package/selection/highlight/constants.mjs +0 -6
  296. package/selection/highlight/types/index.js +0 -35
  297. package/selection/highlight/types/index.mjs +0 -31
@@ -2,9 +2,33 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.array.push.js");
5
- var _types = require("./types");
6
- var _constants = require("./constants");
5
+ require("core-js/modules/es.error.cause.js");
6
+ var _activeHeader = require("./types/activeHeader");
7
+ var _areaLayered = require("./types/areaLayered");
8
+ var _area = require("./types/area");
9
+ var _column = require("./types/column");
10
+ var _focus = require("./types/focus");
11
+ var _customSelection = require("./types/customSelection");
12
+ var _fill = require("./types/fill");
13
+ var _header = require("./types/header");
14
+ var _row = require("./types/row");
15
+ var _src = require("../../3rdparty/walkontable/src");
16
+ exports.ACTIVE_HEADER_TYPE = _src.HIGHLIGHT_ACTIVE_HEADER_TYPE;
17
+ exports.AREA_TYPE = _src.HIGHLIGHT_AREA_TYPE;
18
+ exports.FOCUS_TYPE = _src.HIGHLIGHT_FOCUS_TYPE;
19
+ exports.CUSTOM_SELECTION_TYPE = _src.HIGHLIGHT_CUSTOM_SELECTION_TYPE;
20
+ exports.FILL_TYPE = _src.HIGHLIGHT_FILL_TYPE;
21
+ exports.HEADER_TYPE = _src.HIGHLIGHT_HEADER_TYPE;
22
+ exports.ROW_TYPE = _src.HIGHLIGHT_ROW_TYPE;
23
+ exports.COLUMN_TYPE = _src.HIGHLIGHT_COLUMN_TYPE;
7
24
  var _array = require("./../../helpers/array");
25
+ let _Symbol$iterator;
26
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
27
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
28
+ 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; }
29
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
30
+ 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); }
31
+ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
8
32
  /**
9
33
  * Highlight class responsible for managing Walkontable Selection classes.
10
34
  *
@@ -20,14 +44,24 @@ var _array = require("./../../helpers/array");
20
44
  * @class Highlight
21
45
  * @util
22
46
  */
47
+ var _createHighlight = /*#__PURE__*/new WeakSet();
48
+ _Symbol$iterator = Symbol.iterator;
23
49
  class Highlight {
24
50
  constructor(options) {
51
+ /**
52
+ * Creates (if not exist in the cache) Walkontable Selection instance.
53
+ *
54
+ * @param {Map} cacheMap The map where the instance will be cached.
55
+ * @param {Function} highlightFactory The function factory.
56
+ * @returns {VisualSelection}
57
+ */
58
+ _classPrivateMethodInitSpec(this, _createHighlight);
25
59
  /**
26
60
  * Options consumed by Highlight class and Walkontable Selection classes.
27
61
  *
28
62
  * @type {object}
29
63
  */
30
- this.options = options;
64
+ _defineProperty(this, "options", void 0);
31
65
  /**
32
66
  * The property which describes which layer level of the visual selection will be modified.
33
67
  * This option is valid only for `area` and `header` highlight types which occurs multiple times on
@@ -38,49 +72,96 @@ class Highlight {
38
72
  * @type {number}
39
73
  * @default 0
40
74
  */
41
- this.layerLevel = 0;
75
+ _defineProperty(this, "layerLevel", 0);
42
76
  /**
43
77
  * `cell` highlight object which describes attributes for the currently selected cell.
44
78
  * It can only occur only once on the table.
45
79
  *
46
80
  * @type {Selection}
47
81
  */
48
- this.cell = (0, _types.createHighlight)(_constants.CELL_TYPE, options);
82
+ _defineProperty(this, "focus", void 0);
49
83
  /**
50
84
  * `fill` highlight object which describes attributes for the borders for autofill functionality.
51
85
  * It can only occur only once on the table.
52
86
  *
53
87
  * @type {Selection}
54
88
  */
55
- this.fill = (0, _types.createHighlight)(_constants.FILL_TYPE, options);
89
+ _defineProperty(this, "fill", void 0);
56
90
  /**
57
91
  * Collection of the `area` highlights. That objects describes attributes for the borders and selection of
58
92
  * the multiple selected cells. It can occur multiple times on the table.
59
93
  *
60
94
  * @type {Map.<number, Selection>}
61
95
  */
62
- this.areas = new Map();
96
+ _defineProperty(this, "layeredAreas", new Map());
97
+ /**
98
+ * Collection of the `highlight` highlights. That objects describes attributes for the borders and selection of
99
+ * the multiple selected cells. It can occur multiple times on the table.
100
+ *
101
+ * @type {Map.<number, Selection>}
102
+ */
103
+ _defineProperty(this, "areas", new Map());
63
104
  /**
64
105
  * Collection of the `header` highlights. That objects describes attributes for the selection of
65
- * the multiple selected rows and columns in the table header. It can occur multiple times on the table.
106
+ * the multiple selected rows in the table header. It can occur multiple times on the table.
107
+ *
108
+ * @type {Map.<number, Selection>}
109
+ */
110
+ _defineProperty(this, "rowHeaders", new Map());
111
+ /**
112
+ * Collection of the `header` highlights. That objects describes attributes for the selection of
113
+ * the multiple selected columns in the table header. It can occur multiple times on the table.
114
+ *
115
+ * @type {Map.<number, Selection>}
116
+ */
117
+ _defineProperty(this, "columnHeaders", new Map());
118
+ /**
119
+ * Collection of the `active-header` highlights. That objects describes attributes for the selection of
120
+ * the multiple selected rows in the table header. The table headers which have selected all items in
121
+ * a row will be marked as `active-header`.
66
122
  *
67
123
  * @type {Map.<number, Selection>}
68
124
  */
69
- this.headers = new Map();
125
+ _defineProperty(this, "activeRowHeaders", new Map());
70
126
  /**
71
127
  * Collection of the `active-header` highlights. That objects describes attributes for the selection of
72
- * the multiple selected rows and columns in the table header. The table headers which have selected all items in
128
+ * the multiple selected columns in the table header. The table headers which have selected all items in
73
129
  * a row will be marked as `active-header`.
74
130
  *
75
131
  * @type {Map.<number, Selection>}
76
132
  */
77
- this.activeHeaders = new Map();
133
+ _defineProperty(this, "activeColumnHeaders", new Map());
134
+ /**
135
+ * Collection of the `active-header` highlights. That objects describes attributes for the selection of
136
+ * the selected corner in the table header. The table headers which have selected all items in
137
+ * a row will be marked as `active-header`.
138
+ *
139
+ * @type {Map.<number, Selection>}
140
+ */
141
+ _defineProperty(this, "activeCornerHeaders", new Map());
142
+ /**
143
+ * Collection of the `rows` highlights. That objects describes attributes for the selection of
144
+ * the multiple selected cells in a row. It can occur multiple times on the table.
145
+ *
146
+ * @type {Map.<number, Selection>}
147
+ */
148
+ _defineProperty(this, "rowHighlights", new Map());
149
+ /**
150
+ * Collection of the `columns` highlights. That objects describes attributes for the selection of
151
+ * the multiple selected cells in a column. It can occur multiple times on the table.
152
+ *
153
+ * @type {Map.<number, Selection>}
154
+ */
155
+ _defineProperty(this, "columnHighlights", new Map());
78
156
  /**
79
157
  * Collection of the `custom-selection`, holder for example borders added through CustomBorders plugin.
80
158
  *
81
159
  * @type {Selection[]}
82
160
  */
83
- this.customSelections = [];
161
+ _defineProperty(this, "customSelections", []);
162
+ this.options = options;
163
+ this.focus = (0, _focus.createHighlight)(options);
164
+ this.fill = (0, _fill.createHighlight)(options);
84
165
  }
85
166
 
86
167
  /**
@@ -94,11 +175,14 @@ class Highlight {
94
175
  let type = highlightType;
95
176
 
96
177
  // Legacy compatibility.
97
- if (highlightType === _constants.CELL_TYPE) {
178
+ if (highlightType === _src.HIGHLIGHT_FOCUS_TYPE) {
98
179
  type = 'current'; // One from settings for `disableVisualSelection` up to Handsontable 0.36/Handsontable Pro 1.16.0.
99
180
  }
100
181
 
101
- let disableHighlight = this.options.disabledCellSelection(coords.row, coords.col);
182
+ let disableHighlight = false;
183
+ if (coords.isCell()) {
184
+ disableHighlight = this.options.disabledCellSelection(coords.row, coords.col);
185
+ }
102
186
  if (typeof disableHighlight === 'string') {
103
187
  disableHighlight = [disableHighlight];
104
188
  }
@@ -118,12 +202,13 @@ class Highlight {
118
202
  }
119
203
 
120
204
  /**
121
- * Get Walkontable Selection instance created for controlling highlight of the currently selected/edited cell.
205
+ * Get Walkontable Selection instance created for controlling highlight of the currently
206
+ * focused cell (or header).
122
207
  *
123
208
  * @returns {Selection}
124
209
  */
125
- getCell() {
126
- return this.cell;
210
+ getFocus() {
211
+ return this.focus;
127
212
  }
128
213
 
129
214
  /**
@@ -136,24 +221,32 @@ class Highlight {
136
221
  }
137
222
 
138
223
  /**
139
- * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight
140
- * of the multiple selected cells.
224
+ * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
225
+ * `area` highlights.
141
226
  *
142
227
  * @returns {Selection}
143
228
  */
144
- createOrGetArea() {
145
- const layerLevel = this.layerLevel;
146
- let area;
147
- if (this.areas.has(layerLevel)) {
148
- area = this.areas.get(layerLevel);
149
- } else {
150
- area = (0, _types.createHighlight)(_constants.AREA_TYPE, {
151
- layerLevel,
152
- ...this.options
153
- });
154
- this.areas.set(layerLevel, area);
155
- }
156
- return area;
229
+ createLayeredArea() {
230
+ return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.layeredAreas, _areaLayered.createHighlight);
231
+ }
232
+
233
+ /**
234
+ * Get all Walkontable Selection instances which describes the state of the visual highlight of the cells.
235
+ *
236
+ * @returns {Selection[]}
237
+ */
238
+ getLayeredAreas() {
239
+ return [...this.layeredAreas.values()];
240
+ }
241
+
242
+ /**
243
+ * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
244
+ * `highlight` highlights.
245
+ *
246
+ * @returns {Selection}
247
+ */
248
+ createArea() {
249
+ return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.areas, _area.createHighlight);
157
250
  }
158
251
 
159
252
  /**
@@ -166,23 +259,13 @@ class Highlight {
166
259
  }
167
260
 
168
261
  /**
169
- * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight
170
- * of the multiple selected header cells.
262
+ * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
263
+ * header highlight for rows.
171
264
  *
172
265
  * @returns {Selection}
173
266
  */
174
- createOrGetHeader() {
175
- const layerLevel = this.layerLevel;
176
- let header;
177
- if (this.headers.has(layerLevel)) {
178
- header = this.headers.get(layerLevel);
179
- } else {
180
- header = (0, _types.createHighlight)(_constants.HEADER_TYPE, {
181
- ...this.options
182
- });
183
- this.headers.set(layerLevel, header);
184
- }
185
- return header;
267
+ createRowHeader() {
268
+ return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.rowHeaders, _header.createHighlight);
186
269
  }
187
270
 
188
271
  /**
@@ -190,28 +273,37 @@ class Highlight {
190
273
  *
191
274
  * @returns {Selection[]}
192
275
  */
193
- getHeaders() {
194
- return [...this.headers.values()];
276
+ getRowHeaders() {
277
+ return [...this.rowHeaders.values()];
195
278
  }
196
279
 
197
280
  /**
198
- * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight
199
- * of the multiple selected active header cells.
281
+ * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
282
+ * header highlight for columns.
200
283
  *
201
284
  * @returns {Selection}
202
285
  */
203
- createOrGetActiveHeader() {
204
- const layerLevel = this.layerLevel;
205
- let header;
206
- if (this.activeHeaders.has(layerLevel)) {
207
- header = this.activeHeaders.get(layerLevel);
208
- } else {
209
- header = (0, _types.createHighlight)(_constants.ACTIVE_HEADER_TYPE, {
210
- ...this.options
211
- });
212
- this.activeHeaders.set(layerLevel, header);
213
- }
214
- return header;
286
+ createColumnHeader() {
287
+ return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.columnHeaders, _header.createHighlight);
288
+ }
289
+
290
+ /**
291
+ * Get all Walkontable Selection instances which describes the state of the visual highlight of the headers.
292
+ *
293
+ * @returns {Selection[]}
294
+ */
295
+ getColumnHeaders() {
296
+ return [...this.columnHeaders.values()];
297
+ }
298
+
299
+ /**
300
+ * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
301
+ * highlight for active row headers.
302
+ *
303
+ * @returns {Selection}
304
+ */
305
+ createActiveRowHeader() {
306
+ return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.activeRowHeaders, _activeHeader.createHighlight);
215
307
  }
216
308
 
217
309
  /**
@@ -219,8 +311,84 @@ class Highlight {
219
311
  *
220
312
  * @returns {Selection[]}
221
313
  */
222
- getActiveHeaders() {
223
- return [...this.activeHeaders.values()];
314
+ getActiveRowHeaders() {
315
+ return [...this.activeRowHeaders.values()];
316
+ }
317
+
318
+ /**
319
+ * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
320
+ * highlight for active column headers.
321
+ *
322
+ * @returns {Selection}
323
+ */
324
+ createActiveColumnHeader() {
325
+ return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.activeColumnHeaders, _activeHeader.createHighlight);
326
+ }
327
+
328
+ /**
329
+ * Get all Walkontable Selection instances which describes the state of the visual highlight of the active headers.
330
+ *
331
+ * @returns {Selection[]}
332
+ */
333
+ getActiveColumnHeaders() {
334
+ return [...this.activeColumnHeaders.values()];
335
+ }
336
+
337
+ /**
338
+ * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
339
+ * highlight for the headers corner.
340
+ *
341
+ * @returns {Selection}
342
+ */
343
+ createActiveCornerHeader() {
344
+ return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.activeCornerHeaders, _activeHeader.createHighlight);
345
+ }
346
+
347
+ /**
348
+ * Get all Walkontable Selection instances which describes the state of the visual highlight of the headers corner.
349
+ *
350
+ * @returns {Selection[]}
351
+ */
352
+ getActiveCornerHeaders() {
353
+ return [...this.activeCornerHeaders.values()];
354
+ }
355
+
356
+ /**
357
+ * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
358
+ * highlight cells in a row.
359
+ *
360
+ * @returns {Selection}
361
+ */
362
+ createRowHighlight() {
363
+ return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.rowHighlights, _row.createHighlight);
364
+ }
365
+
366
+ /**
367
+ * Get all Walkontable Selection instances which describes the state of the rows highlighting.
368
+ *
369
+ * @returns {Selection[]}
370
+ */
371
+ getRowHighlights() {
372
+ return [...this.rowHighlights.values()];
373
+ }
374
+
375
+ /**
376
+ * Creates (if not exist in the cache) Walkontable Selection instance created for controlling
377
+ * highlight cells in a column.
378
+ *
379
+ * @returns {Selection}
380
+ */
381
+ createColumnHighlight() {
382
+ return _classPrivateMethodGet(this, _createHighlight, _createHighlight2).call(this, this.columnHighlights, _column.createHighlight);
383
+ }
384
+
385
+ /**
386
+ * Get all Walkontable Selection instances which describes the state of the columns highlighting.
387
+ *
388
+ * @returns {Selection[]}
389
+ */
390
+ getColumnHighlights() {
391
+ return [...this.columnHighlights.values()];
224
392
  }
225
393
 
226
394
  /**
@@ -238,7 +406,7 @@ class Highlight {
238
406
  * @param {object} selectionInstance The selection instance.
239
407
  */
240
408
  addCustomSelection(selectionInstance) {
241
- this.customSelections.push((0, _types.createHighlight)(_constants.CUSTOM_SELECTION_TYPE, {
409
+ this.customSelections.push((0, _customSelection.createHighlight)({
242
410
  ...this.options,
243
411
  ...selectionInstance
244
412
  }));
@@ -248,21 +416,38 @@ class Highlight {
248
416
  * Perform cleaning visual highlights for the whole table.
249
417
  */
250
418
  clear() {
251
- this.cell.clear();
419
+ this.focus.clear();
252
420
  this.fill.clear();
253
421
  (0, _array.arrayEach)(this.areas.values(), highlight => void highlight.clear());
254
- (0, _array.arrayEach)(this.headers.values(), highlight => void highlight.clear());
255
- (0, _array.arrayEach)(this.activeHeaders.values(), highlight => void highlight.clear());
422
+ (0, _array.arrayEach)(this.layeredAreas.values(), highlight => void highlight.clear());
423
+ (0, _array.arrayEach)(this.rowHeaders.values(), highlight => void highlight.clear());
424
+ (0, _array.arrayEach)(this.columnHeaders.values(), highlight => void highlight.clear());
425
+ (0, _array.arrayEach)(this.activeRowHeaders.values(), highlight => void highlight.clear());
426
+ (0, _array.arrayEach)(this.activeColumnHeaders.values(), highlight => void highlight.clear());
427
+ (0, _array.arrayEach)(this.activeCornerHeaders.values(), highlight => void highlight.clear());
428
+ (0, _array.arrayEach)(this.rowHighlights.values(), highlight => void highlight.clear());
429
+ (0, _array.arrayEach)(this.columnHighlights.values(), highlight => void highlight.clear());
256
430
  }
257
-
258
431
  /**
259
432
  * This object can be iterate over using `for of` syntax or using internal `arrayEach` helper.
260
433
  *
261
434
  * @returns {Selection[]}
262
435
  */
263
- [Symbol.iterator]() {
264
- return [this.cell, this.fill, ...this.areas.values(), ...this.headers.values(), ...this.activeHeaders.values(), ...this.customSelections][Symbol.iterator]();
436
+ [_Symbol$iterator]() {
437
+ return [this.focus, this.fill, ...this.areas.values(), ...this.layeredAreas.values(), ...this.rowHeaders.values(), ...this.columnHeaders.values(), ...this.activeRowHeaders.values(), ...this.activeColumnHeaders.values(), ...this.activeCornerHeaders.values(), ...this.rowHighlights.values(), ...this.columnHighlights.values(), ...this.customSelections][Symbol.iterator]();
438
+ }
439
+ }
440
+ function _createHighlight2(cacheMap, highlightFactory) {
441
+ const layerLevel = this.layerLevel;
442
+ if (cacheMap.has(layerLevel)) {
443
+ return cacheMap.get(layerLevel);
265
444
  }
445
+ const highlight = highlightFactory({
446
+ layerLevel,
447
+ ...this.options
448
+ });
449
+ cacheMap.set(layerLevel, highlight);
450
+ return highlight;
266
451
  }
267
452
  var _default = Highlight;
268
453
  exports.default = _default;