handsontable 0.0.0-next-d1c8e0e-20230621 → 0.0.0-next-dcd0acc-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 (279) 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 +10651 -13658
  51. package/dist/handsontable.full.min.css +3 -3
  52. package/dist/handsontable.full.min.js +112 -112
  53. package/dist/handsontable.js +13425 -16432
  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/comments/comments.js +4 -11
  76. package/plugins/comments/comments.mjs +4 -11
  77. package/plugins/contextMenu/contextMenu.d.ts +1 -1
  78. package/plugins/contextMenu/contextMenu.js +29 -80
  79. package/plugins/contextMenu/contextMenu.mjs +30 -81
  80. package/plugins/contextMenu/predefinedItems/alignment.js +0 -7
  81. package/plugins/contextMenu/predefinedItems/alignment.mjs +0 -7
  82. package/plugins/contextMenu/predefinedItems/clearColumn.js +3 -5
  83. package/plugins/contextMenu/predefinedItems/clearColumn.mjs +3 -5
  84. package/plugins/contextMenu/predefinedItems/columnLeft.js +3 -5
  85. package/plugins/contextMenu/predefinedItems/columnLeft.mjs +3 -5
  86. package/plugins/contextMenu/predefinedItems/columnRight.js +3 -5
  87. package/plugins/contextMenu/predefinedItems/columnRight.mjs +3 -5
  88. package/plugins/contextMenu/predefinedItems/readOnly.js +0 -7
  89. package/plugins/contextMenu/predefinedItems/readOnly.mjs +0 -7
  90. package/plugins/contextMenu/predefinedItems/removeColumn.js +5 -7
  91. package/plugins/contextMenu/predefinedItems/removeColumn.mjs +3 -5
  92. package/plugins/contextMenu/predefinedItems/removeRow.js +5 -7
  93. package/plugins/contextMenu/predefinedItems/removeRow.mjs +3 -5
  94. package/plugins/contextMenu/predefinedItems/rowAbove.js +3 -5
  95. package/plugins/contextMenu/predefinedItems/rowAbove.mjs +3 -5
  96. package/plugins/contextMenu/predefinedItems/rowBelow.js +3 -5
  97. package/plugins/contextMenu/predefinedItems/rowBelow.mjs +3 -5
  98. package/plugins/contextMenu/utils.js +16 -25
  99. package/plugins/contextMenu/utils.mjs +15 -24
  100. package/plugins/copyPaste/contextMenuItem/copy.js +0 -7
  101. package/plugins/copyPaste/contextMenuItem/copy.mjs +0 -7
  102. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +1 -9
  103. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +1 -9
  104. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +1 -9
  105. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +1 -9
  106. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +1 -9
  107. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +1 -9
  108. package/plugins/copyPaste/contextMenuItem/cut.js +0 -7
  109. package/plugins/copyPaste/contextMenuItem/cut.mjs +0 -7
  110. package/plugins/copyPaste/copyPaste.js +1 -5
  111. package/plugins/copyPaste/copyPaste.mjs +1 -5
  112. package/plugins/customBorders/customBorders.js +53 -25
  113. package/plugins/customBorders/customBorders.mjs +54 -26
  114. package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
  115. package/plugins/dropdownMenu/dropdownMenu.js +30 -94
  116. package/plugins/dropdownMenu/dropdownMenu.mjs +30 -94
  117. package/plugins/filters/filters.js +42 -62
  118. package/plugins/filters/filters.mjs +41 -61
  119. package/plugins/mergeCells/mergeCells.js +18 -5
  120. package/plugins/mergeCells/mergeCells.mjs +18 -5
  121. package/plugins/multiColumnSorting/multiColumnSorting.js +3 -42
  122. package/plugins/multiColumnSorting/multiColumnSorting.mjs +3 -42
  123. package/plugins/nestedHeaders/nestedHeaders.js +10 -132
  124. package/plugins/nestedHeaders/nestedHeaders.mjs +10 -132
  125. package/plugins/nestedHeaders/stateManager/index.js +0 -37
  126. package/plugins/nestedHeaders/stateManager/index.mjs +0 -37
  127. package/plugins/nestedRows/nestedRows.js +7 -52
  128. package/plugins/nestedRows/nestedRows.mjs +7 -52
  129. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
  130. package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
  131. package/selection/highlight/constants.js +16 -0
  132. package/selection/highlight/constants.mjs +6 -0
  133. package/selection/highlight/highlight.js +89 -312
  134. package/selection/highlight/highlight.mjs +85 -302
  135. package/selection/highlight/types/activeHeader.js +9 -10
  136. package/selection/highlight/types/activeHeader.mjs +8 -10
  137. package/selection/highlight/types/area.js +27 -12
  138. package/selection/highlight/types/area.mjs +30 -16
  139. package/selection/highlight/types/{focus.js → cell.js} +8 -5
  140. package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
  141. package/selection/highlight/types/customSelection.js +10 -7
  142. package/selection/highlight/types/customSelection.mjs +9 -7
  143. package/selection/highlight/types/fill.js +8 -5
  144. package/selection/highlight/types/fill.mjs +7 -5
  145. package/selection/highlight/types/header.js +20 -10
  146. package/selection/highlight/types/header.mjs +19 -10
  147. package/selection/highlight/types/{row.js → index.js} +31 -27
  148. package/selection/highlight/types/{row.mjs → index.mjs} +29 -24
  149. package/selection/highlight/visualSelection.js +27 -31
  150. package/selection/highlight/visualSelection.mjs +27 -31
  151. package/selection/index.js +7 -4
  152. package/selection/index.mjs +3 -2
  153. package/selection/mouseEventHandler.js +1 -1
  154. package/selection/mouseEventHandler.mjs +1 -1
  155. package/selection/range.js +8 -8
  156. package/selection/range.mjs +8 -8
  157. package/selection/selection.js +181 -315
  158. package/selection/selection.mjs +180 -310
  159. package/selection/transformation.js +96 -233
  160. package/selection/transformation.mjs +93 -230
  161. package/selection/utils.js +36 -12
  162. package/selection/utils.mjs +36 -13
  163. package/settings.d.ts +0 -1
  164. package/shortcuts/manager.js +0 -2
  165. package/shortcuts/manager.mjs +0 -2
  166. package/shortcuts/recorder.js +2 -2
  167. package/shortcuts/recorder.mjs +2 -2
  168. package/shortcuts/utils.js +5 -21
  169. package/shortcuts/utils.mjs +4 -20
  170. package/tableView.js +9 -58
  171. package/tableView.mjs +9 -58
  172. package/translations/indexMapper.js +9 -8
  173. package/translations/indexMapper.mjs +9 -8
  174. package/3rdparty/walkontable/src/selection/border/constants.js +0 -18
  175. package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -13
  176. package/3rdparty/walkontable/src/selection/constants.js +0 -63
  177. package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
  178. package/3rdparty/walkontable/src/selection/index.js +0 -30
  179. package/3rdparty/walkontable/src/selection/index.mjs +0 -5
  180. package/3rdparty/walkontable/src/selection/manager.js +0 -329
  181. package/3rdparty/walkontable/src/selection/manager.mjs +0 -323
  182. package/3rdparty/walkontable/src/selection/scanner.js +0 -364
  183. package/3rdparty/walkontable/src/selection/scanner.mjs +0 -360
  184. package/3rdparty/walkontable/src/selection/selection.js +0 -133
  185. package/3rdparty/walkontable/src/selection/selection.mjs +0 -127
  186. package/selection/highlight/types/areaLayered.js +0 -54
  187. package/selection/highlight/types/areaLayered.mjs +0 -49
  188. package/selection/highlight/types/column.js +0 -50
  189. package/selection/highlight/types/column.mjs +0 -45
  190. package/shortcutContexts/commands/editor/closeAndSave.js +0 -15
  191. package/shortcutContexts/commands/editor/closeAndSave.mjs +0 -10
  192. package/shortcutContexts/commands/editor/closeWithoutSaving.js +0 -13
  193. package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +0 -8
  194. package/shortcutContexts/commands/editor/fastOpen.js +0 -16
  195. package/shortcutContexts/commands/editor/fastOpen.mjs +0 -11
  196. package/shortcutContexts/commands/editor/index.js +0 -16
  197. package/shortcutContexts/commands/editor/index.mjs +0 -12
  198. package/shortcutContexts/commands/editor/open.js +0 -29
  199. package/shortcutContexts/commands/editor/open.mjs +0 -24
  200. package/shortcutContexts/commands/emptySelectedCells.js +0 -12
  201. package/shortcutContexts/commands/emptySelectedCells.mjs +0 -7
  202. package/shortcutContexts/commands/extendCellsSelection/down.js +0 -15
  203. package/shortcutContexts/commands/extendCellsSelection/down.mjs +0 -10
  204. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +0 -21
  205. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -16
  206. package/shortcutContexts/commands/extendCellsSelection/index.js +0 -26
  207. package/shortcutContexts/commands/extendCellsSelection/index.mjs +0 -22
  208. package/shortcutContexts/commands/extendCellsSelection/left.js +0 -15
  209. package/shortcutContexts/commands/extendCellsSelection/left.mjs +0 -10
  210. package/shortcutContexts/commands/extendCellsSelection/right.js +0 -15
  211. package/shortcutContexts/commands/extendCellsSelection/right.mjs +0 -10
  212. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +0 -19
  213. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +0 -14
  214. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +0 -22
  215. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +0 -17
  216. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +0 -17
  217. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +0 -12
  218. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +0 -17
  219. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +0 -12
  220. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +0 -40
  221. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -35
  222. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -40
  223. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -35
  224. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -22
  225. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -17
  226. package/shortcutContexts/commands/extendCellsSelection/toRows.js +0 -19
  227. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +0 -14
  228. package/shortcutContexts/commands/extendCellsSelection/up.js +0 -15
  229. package/shortcutContexts/commands/extendCellsSelection/up.mjs +0 -10
  230. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +0 -21
  231. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -16
  232. package/shortcutContexts/commands/index.js +0 -52
  233. package/shortcutContexts/commands/index.mjs +0 -48
  234. package/shortcutContexts/commands/moveCellSelection/down.js +0 -12
  235. package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -7
  236. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -29
  237. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -24
  238. package/shortcutContexts/commands/moveCellSelection/index.js +0 -28
  239. package/shortcutContexts/commands/moveCellSelection/index.mjs +0 -24
  240. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +0 -13
  241. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +0 -8
  242. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +0 -13
  243. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +0 -8
  244. package/shortcutContexts/commands/moveCellSelection/left.js +0 -11
  245. package/shortcutContexts/commands/moveCellSelection/left.mjs +0 -6
  246. package/shortcutContexts/commands/moveCellSelection/right.js +0 -11
  247. package/shortcutContexts/commands/moveCellSelection/right.mjs +0 -6
  248. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +0 -16
  249. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +0 -11
  250. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +0 -17
  251. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +0 -12
  252. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +0 -13
  253. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +0 -8
  254. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +0 -16
  255. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +0 -11
  256. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +0 -36
  257. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -31
  258. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -36
  259. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -31
  260. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +0 -16
  261. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +0 -11
  262. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +0 -18
  263. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +0 -13
  264. package/shortcutContexts/commands/moveCellSelection/up.js +0 -12
  265. package/shortcutContexts/commands/moveCellSelection/up.mjs +0 -7
  266. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +0 -29
  267. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -24
  268. package/shortcutContexts/commands/populateSelectedCellsData.js +0 -35
  269. package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -30
  270. package/shortcutContexts/commands/selectAll.js +0 -11
  271. package/shortcutContexts/commands/selectAll.mjs +0 -6
  272. package/shortcutContexts/constants.js +0 -19
  273. package/shortcutContexts/constants.mjs +0 -12
  274. package/shortcutContexts/editor.js +0 -29
  275. package/shortcutContexts/editor.mjs +0 -25
  276. package/shortcutContexts/grid.js +0 -247
  277. package/shortcutContexts/grid.mjs +0 -243
  278. package/shortcutContexts/index.js +0 -29
  279. package/shortcutContexts/index.mjs +0 -15
@@ -1,212 +1,127 @@
1
- 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); }
2
- import "core-js/modules/es.array.iterator.js";
3
- import "core-js/modules/es.object.to-string.js";
4
- import "core-js/modules/es.string.iterator.js";
5
- import "core-js/modules/es.weak-map.js";
6
- import "core-js/modules/web.dom-collections.iterator.js";
7
- import "core-js/modules/es.weak-set.js";
8
1
  import "core-js/modules/es.symbol.to-primitive.js";
9
2
  import "core-js/modules/es.date.to-primitive.js";
10
3
  import "core-js/modules/es.symbol.js";
11
4
  import "core-js/modules/es.symbol.description.js";
5
+ import "core-js/modules/es.object.to-string.js";
12
6
  import "core-js/modules/es.number.constructor.js";
13
7
  import "core-js/modules/es.symbol.iterator.js";
8
+ import "core-js/modules/es.array.iterator.js";
9
+ import "core-js/modules/es.string.iterator.js";
10
+ import "core-js/modules/web.dom-collections.iterator.js";
11
+ 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); }
14
12
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
13
  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); } }
16
14
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
17
15
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
18
16
  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); }
19
- function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
20
- function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
21
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
22
- function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
23
- function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
24
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
25
- function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
26
- function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
27
- function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
28
17
  import { mixin } from "../helpers/object.mjs";
29
18
  import localHooks from "./../mixins/localHooks.mjs";
30
19
  /**
31
20
  * The Transformation class implements algorithms for transforming coordinates based on current settings
32
- * passed to the Handsontable. The class performs the calculations based on the renderable indexes.
21
+ * passed to the Handsontable.
33
22
  *
34
23
  * Transformation is always applied relative to the current selection.
35
24
  *
36
- * The class operates on a table size defined by the renderable indexes. If the `navigableHeaders`
37
- * option is enabled, the table size is increased by the number of row and/or column headers.
38
- * Because the headers are treated as cells as part of the table size (indexes always go from 0 to N),
39
- * the algorithm can be written as simply as possible (without new if's that distinguish the headers
40
- * logic).
41
- *
42
25
  * @class Transformation
43
26
  * @util
44
27
  */
45
- var _range = /*#__PURE__*/new WeakMap();
46
- var _options = /*#__PURE__*/new WeakMap();
47
- var _offset = /*#__PURE__*/new WeakMap();
48
- var _setOffsetSize = /*#__PURE__*/new WeakSet();
49
- var _clampCoords = /*#__PURE__*/new WeakSet();
50
- var _getTableSize = /*#__PURE__*/new WeakSet();
51
- var _visualToZeroBasedCoords = /*#__PURE__*/new WeakSet();
52
- var _zeroBasedToVisualCoords = /*#__PURE__*/new WeakSet();
53
28
  var Transformation = /*#__PURE__*/function () {
54
29
  function Transformation(range, options) {
55
30
  _classCallCheck(this, Transformation);
56
- /**
57
- * Translates the zero-based coordinates to visual ones.
58
- *
59
- * @param {CellCoords} zeroBasedCoords The coordinates to process.
60
- * @returns {CellCoords}
61
- */
62
- _classPrivateMethodInitSpec(this, _zeroBasedToVisualCoords);
63
- /**
64
- * Translates the visual coordinates to zero-based ones.
65
- *
66
- * @param {CellCoords} visualCoords The visual coords to process.
67
- * @returns {{x: number, y: number}}
68
- */
69
- _classPrivateMethodInitSpec(this, _visualToZeroBasedCoords);
70
- /**
71
- * Gets the table size in number of rows with headers as "height" and number of columns with
72
- * headers as "width".
73
- *
74
- * @returns {{width: number, height: number}}
75
- */
76
- _classPrivateMethodInitSpec(this, _getTableSize);
77
- /**
78
- * Clamps the coords to make sure they points to the cell (or header) in the table range.
79
- *
80
- * @param {CellCoords} zeroBasedCoords The coords object to clamp.
81
- * @returns {{rowDir: 1|0|-1, colDir: 1|0|-1}}
82
- */
83
- _classPrivateMethodInitSpec(this, _clampCoords);
84
- /**
85
- * Sets the additional offset in table size that may occur when the `navigableHeaders` option
86
- * is enabled.
87
- *
88
- * @param {{x: number, y: number}} offset Offset as x and y properties.
89
- */
90
- _classPrivateMethodInitSpec(this, _setOffsetSize);
91
31
  /**
92
32
  * Instance of the SelectionRange, holder for visual coordinates applied to the table.
93
33
  *
94
34
  * @type {SelectionRange}
95
35
  */
96
- _classPrivateFieldInitSpec(this, _range, {
97
- writable: true,
98
- value: void 0
99
- });
36
+ this.range = range;
100
37
  /**
101
38
  * Additional options which define the state of the settings which can infer transformation and
102
39
  * give the possibility to translate indexes.
103
40
  *
104
41
  * @type {object}
105
42
  */
106
- _classPrivateFieldInitSpec(this, _options, {
107
- writable: true,
108
- value: void 0
109
- });
110
- /**
111
- * Increases the table size by applying the offsets. The option is used by the `navigableHeaders`
112
- * option.
113
- *
114
- * @type {{ x: number, y: number }}
115
- */
116
- _classPrivateFieldInitSpec(this, _offset, {
117
- writable: true,
118
- value: {
119
- x: 0,
120
- y: 0
121
- }
122
- });
123
- _classPrivateFieldSet(this, _range, range);
124
- _classPrivateFieldSet(this, _options, options);
43
+ this.options = options;
125
44
  }
126
45
 
127
46
  /**
128
- * Selects cell relative to the current cell (if possible).
47
+ * Selects cell relative to current cell (if possible).
129
48
  *
130
49
  * @param {number} rowDelta Rows number to move, value can be passed as negative number.
131
50
  * @param {number} colDelta Columns number to move, value can be passed as negative number.
132
- * @param {boolean} [createMissingRecords=false] If `true` the new rows/columns will be created if necessary. Otherwise, row/column will
51
+ * @param {boolean} [force=false] If `true` the new rows/columns will be created if necessary. Otherwise, row/column will
133
52
  * be created according to `minSpareRows/minSpareCols` settings of Handsontable.
134
53
  * @returns {CellCoords} Visual coordinates after transformation.
135
54
  */
136
55
  _createClass(Transformation, [{
137
56
  key: "transformStart",
138
57
  value: function transformStart(rowDelta, colDelta) {
139
- var createMissingRecords = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
140
- _classPrivateMethodGet(this, _setOffsetSize, _setOffsetSize2).call(this, {
141
- x: _classPrivateFieldGet(this, _options).navigableHeaders() ? _classPrivateFieldGet(this, _options).countRowHeaders() : 0,
142
- y: _classPrivateFieldGet(this, _options).navigableHeaders() ? _classPrivateFieldGet(this, _options).countColHeaders() : 0
143
- });
144
- var delta = _classPrivateFieldGet(this, _options).createCellCoords(rowDelta, colDelta);
145
- var visualCoords = _classPrivateFieldGet(this, _range).current().highlight;
146
- var highlightRenderableCoords = _classPrivateFieldGet(this, _options).visualToRenderableCoords(visualCoords);
58
+ var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
59
+ var delta = this.options.createCellCoords(rowDelta, colDelta);
60
+ var highlightCoords = this.range.current().highlight;
61
+ var _this$options$visualT = this.options.visualToRenderableCoords(highlightCoords),
62
+ renderableRow = _this$options$visualT.row,
63
+ renderableColumn = _this$options$visualT.col;
64
+ var visualCoords = highlightCoords;
147
65
  var rowTransformDir = 0;
148
66
  var colTransformDir = 0;
149
67
  this.runLocalHooks('beforeTransformStart', delta);
150
- if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null) {
151
- var _classPrivateMethodGe = _classPrivateMethodGet(this, _getTableSize, _getTableSize2).call(this),
152
- width = _classPrivateMethodGe.width,
153
- height = _classPrivateMethodGe.height;
154
- var _classPrivateMethodGe2 = _classPrivateMethodGet(this, _visualToZeroBasedCoords, _visualToZeroBasedCoords2).call(this, visualCoords),
155
- x = _classPrivateMethodGe2.x,
156
- y = _classPrivateMethodGe2.y;
157
- var fixedRowsBottom = _classPrivateFieldGet(this, _options).fixedRowsBottom();
158
- var minSpareRows = _classPrivateFieldGet(this, _options).minSpareRows();
159
- var minSpareCols = _classPrivateFieldGet(this, _options).minSpareCols();
160
- var autoWrapRow = _classPrivateFieldGet(this, _options).autoWrapRow();
161
- var autoWrapCol = _classPrivateFieldGet(this, _options).autoWrapCol();
162
- var rawCoords = {
163
- row: y + delta.row,
164
- col: x + delta.col
165
- };
166
- if (rawCoords.row >= height) {
167
- if (createMissingRecords && minSpareRows > 0 && fixedRowsBottom === 0) {
168
- this.runLocalHooks('insertRowRequire', _classPrivateFieldGet(this, _options).countRenderableRows());
68
+ if (renderableRow !== null && renderableColumn !== null) {
69
+ var totalRows = this.options.countRows();
70
+ var totalCols = this.options.countCols();
71
+ var fixedRowsBottom = this.options.fixedRowsBottom();
72
+ var minSpareRows = this.options.minSpareRows();
73
+ var minSpareCols = this.options.minSpareCols();
74
+ var autoWrapRow = this.options.autoWrapRow();
75
+ var autoWrapCol = this.options.autoWrapCol();
76
+ if (renderableRow + rowDelta > totalRows - 1) {
77
+ if (force && minSpareRows > 0 && !(fixedRowsBottom && renderableRow >= totalRows - fixedRowsBottom - 1)) {
78
+ this.runLocalHooks('insertRowRequire', totalRows);
79
+ totalRows = this.options.countRows();
169
80
  } else if (autoWrapCol) {
170
- var nextColumn = rawCoords.col + 1;
171
- rawCoords.row = rawCoords.row - height;
172
- rawCoords.col = nextColumn >= width ? nextColumn - width : nextColumn;
173
- }
174
- } else if (rawCoords.row < 0) {
175
- if (autoWrapCol) {
176
- var previousColumn = rawCoords.col - 1;
177
- rawCoords.row = height + rawCoords.row;
178
- rawCoords.col = previousColumn < 0 ? width + previousColumn : previousColumn;
81
+ delta.row = 1 - totalRows;
82
+ delta.col = renderableColumn + delta.col === totalCols - 1 ? 1 - totalCols : 1;
179
83
  }
84
+ } else if (autoWrapCol && renderableRow + delta.row < 0 && renderableColumn + delta.col >= 0) {
85
+ delta.row = totalRows - 1;
86
+ delta.col = renderableColumn + delta.col === 0 ? totalCols - 1 : -1;
180
87
  }
181
- if (rawCoords.col >= width) {
182
- if (createMissingRecords && minSpareCols > 0) {
183
- this.runLocalHooks('insertColRequire', _classPrivateFieldGet(this, _options).countRenderableColumns());
88
+ if (renderableColumn + delta.col > totalCols - 1) {
89
+ if (force && minSpareCols > 0) {
90
+ this.runLocalHooks('insertColRequire', totalCols);
91
+ totalCols = this.options.countCols();
184
92
  } else if (autoWrapRow) {
185
- var nextRow = rawCoords.row + 1;
186
- rawCoords.row = nextRow >= height ? nextRow - height : nextRow;
187
- rawCoords.col = rawCoords.col - width;
188
- }
189
- } else if (rawCoords.col < 0) {
190
- if (autoWrapRow) {
191
- var previousRow = rawCoords.row - 1;
192
- rawCoords.row = previousRow < 0 ? height + previousRow : previousRow;
193
- rawCoords.col = width + rawCoords.col;
93
+ delta.row = renderableRow + delta.row === totalRows - 1 ? 1 - totalRows : 1;
94
+ delta.col = 1 - totalCols;
194
95
  }
96
+ } else if (autoWrapRow && renderableColumn + delta.col < 0 && renderableRow + delta.row >= 0) {
97
+ delta.row = renderableRow + delta.row === 0 ? totalRows - 1 : -1;
98
+ delta.col = totalCols - 1;
99
+ }
100
+ var coords = this.options.createCellCoords(renderableRow + delta.row, renderableColumn + delta.col);
101
+ rowTransformDir = 0;
102
+ colTransformDir = 0;
103
+ if (coords.row < 0) {
104
+ rowTransformDir = -1;
105
+ coords.row = 0;
106
+ } else if (coords.row > 0 && coords.row >= totalRows) {
107
+ rowTransformDir = 1;
108
+ coords.row = totalRows - 1;
109
+ }
110
+ if (coords.col < 0) {
111
+ colTransformDir = -1;
112
+ coords.col = 0;
113
+ } else if (coords.col > 0 && coords.col >= totalCols) {
114
+ colTransformDir = 1;
115
+ coords.col = totalCols - 1;
195
116
  }
196
- var coords = _classPrivateFieldGet(this, _options).createCellCoords(rawCoords.row, rawCoords.col);
197
- var _classPrivateMethodGe3 = _classPrivateMethodGet(this, _clampCoords, _clampCoords2).call(this, coords),
198
- rowDir = _classPrivateMethodGe3.rowDir,
199
- colDir = _classPrivateMethodGe3.colDir;
200
- rowTransformDir = rowDir;
201
- colTransformDir = colDir;
202
- visualCoords = _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, coords);
117
+ visualCoords = this.options.renderableToVisualCoords(coords);
203
118
  }
204
119
  this.runLocalHooks('afterTransformStart', visualCoords, rowTransformDir, colTransformDir);
205
120
  return visualCoords;
206
121
  }
207
122
 
208
123
  /**
209
- * Sets selection end cell relative to the current selection end cell (if possible).
124
+ * Sets selection end cell relative to current selection end cell (if possible).
210
125
  *
211
126
  * @param {number} rowDelta Rows number to move, value can be passed as negative number.
212
127
  * @param {number} colDelta Columns number to move, value can be passed as negative number.
@@ -215,40 +130,41 @@ var Transformation = /*#__PURE__*/function () {
215
130
  }, {
216
131
  key: "transformEnd",
217
132
  value: function transformEnd(rowDelta, colDelta) {
218
- _classPrivateMethodGet(this, _setOffsetSize, _setOffsetSize2).call(this, {
219
- x: _classPrivateFieldGet(this, _options).navigableHeaders() ? _classPrivateFieldGet(this, _options).countRowHeaders() : 0,
220
- y: _classPrivateFieldGet(this, _options).navigableHeaders() ? _classPrivateFieldGet(this, _options).countColHeaders() : 0
221
- });
222
- var delta = _classPrivateFieldGet(this, _options).createCellCoords(rowDelta, colDelta);
223
- var cellRange = _classPrivateFieldGet(this, _range).current();
224
- var highlightRenderableCoords = _classPrivateFieldGet(this, _options).visualToRenderableCoords(cellRange.highlight);
225
- var visualCoords = cellRange.to.clone();
133
+ var delta = this.options.createCellCoords(rowDelta, colDelta);
134
+ var cellRange = this.range.current();
135
+ var visualCoords = cellRange.to;
226
136
  var rowTransformDir = 0;
227
137
  var colTransformDir = 0;
228
138
  this.runLocalHooks('beforeTransformEnd', delta);
229
- if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null) {
230
- var _classPrivateMethodGe4 = _classPrivateMethodGet(this, _visualToZeroBasedCoords, _visualToZeroBasedCoords2).call(this, cellRange.to),
231
- x = _classPrivateMethodGe4.x,
232
- y = _classPrivateMethodGe4.y;
233
- var rawCoords = {
234
- row: y + delta.row,
235
- col: x + delta.col
236
- };
237
- var coords = _classPrivateFieldGet(this, _options).createCellCoords(rawCoords.row, rawCoords.col);
238
- var _classPrivateMethodGe5 = _classPrivateMethodGet(this, _clampCoords, _clampCoords2).call(this, coords),
239
- rowDir = _classPrivateMethodGe5.rowDir,
240
- colDir = _classPrivateMethodGe5.colDir;
241
- rowTransformDir = rowDir;
242
- colTransformDir = colDir;
243
- var newVisualCoords = _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, coords);
244
- if (delta.row === 0 && delta.col !== 0) {
245
- visualCoords.col = newVisualCoords.col;
246
- } else if (delta.row !== 0 && delta.col === 0) {
247
- visualCoords.row = newVisualCoords.row;
248
- } else {
249
- visualCoords.row = newVisualCoords.row;
250
- visualCoords.col = newVisualCoords.col;
139
+ var _this$options$visualT2 = this.options.visualToRenderableCoords(cellRange.highlight),
140
+ rowHighlight = _this$options$visualT2.row,
141
+ colHighlight = _this$options$visualT2.col;
142
+
143
+ // We have highlight (start point for the selection).
144
+ if (rowHighlight !== null && colHighlight !== null) {
145
+ var totalRows = this.options.countRows();
146
+ var totalCols = this.options.countCols();
147
+ var _this$options$visualT3 = this.options.visualToRenderableCoords(cellRange.to),
148
+ rowTo = _this$options$visualT3.row,
149
+ colTo = _this$options$visualT3.col;
150
+ var coords = this.options.createCellCoords(rowTo + delta.row, colTo + delta.col);
151
+ rowTransformDir = 0;
152
+ colTransformDir = 0;
153
+ if (coords.row < 0) {
154
+ rowTransformDir = -1;
155
+ coords.row = 0;
156
+ } else if (coords.row > 0 && coords.row >= totalRows) {
157
+ rowTransformDir = 1;
158
+ coords.row = totalRows - 1;
159
+ }
160
+ if (coords.col < 0) {
161
+ colTransformDir = -1;
162
+ coords.col = 0;
163
+ } else if (coords.col > 0 && coords.col >= totalCols) {
164
+ colTransformDir = 1;
165
+ coords.col = totalCols - 1;
251
166
  }
167
+ visualCoords = this.options.renderableToVisualCoords(coords);
252
168
  }
253
169
  this.runLocalHooks('afterTransformEnd', visualCoords, rowTransformDir, colTransformDir);
254
170
  return visualCoords;
@@ -256,58 +172,5 @@ var Transformation = /*#__PURE__*/function () {
256
172
  }]);
257
173
  return Transformation;
258
174
  }();
259
- function _setOffsetSize2(_ref) {
260
- var x = _ref.x,
261
- y = _ref.y;
262
- _classPrivateFieldSet(this, _offset, {
263
- x: x,
264
- y: y
265
- });
266
- }
267
- function _clampCoords2(zeroBasedCoords) {
268
- var _classPrivateMethodGe6 = _classPrivateMethodGet(this, _getTableSize, _getTableSize2).call(this),
269
- width = _classPrivateMethodGe6.width,
270
- height = _classPrivateMethodGe6.height;
271
- var rowDir = 0;
272
- var colDir = 0;
273
- if (zeroBasedCoords.row < 0) {
274
- rowDir = -1;
275
- zeroBasedCoords.row = 0;
276
- } else if (zeroBasedCoords.row > 0 && zeroBasedCoords.row >= height) {
277
- rowDir = 1;
278
- zeroBasedCoords.row = height - 1;
279
- }
280
- if (zeroBasedCoords.col < 0) {
281
- colDir = -1;
282
- zeroBasedCoords.col = 0;
283
- } else if (zeroBasedCoords.col > 0 && zeroBasedCoords.col >= width) {
284
- colDir = 1;
285
- zeroBasedCoords.col = width - 1;
286
- }
287
- return {
288
- rowDir: rowDir,
289
- colDir: colDir
290
- };
291
- }
292
- function _getTableSize2() {
293
- return {
294
- width: _classPrivateFieldGet(this, _offset).x + _classPrivateFieldGet(this, _options).countRenderableColumns(),
295
- height: _classPrivateFieldGet(this, _offset).y + _classPrivateFieldGet(this, _options).countRenderableRows()
296
- };
297
- }
298
- function _visualToZeroBasedCoords2(visualCoords) {
299
- var _classPrivateFieldGet2 = _classPrivateFieldGet(this, _options).visualToRenderableCoords(visualCoords),
300
- row = _classPrivateFieldGet2.row,
301
- col = _classPrivateFieldGet2.col;
302
- return {
303
- x: _classPrivateFieldGet(this, _offset).x + col,
304
- y: _classPrivateFieldGet(this, _offset).y + row
305
- };
306
- }
307
- function _zeroBasedToVisualCoords2(zeroBasedCoords) {
308
- zeroBasedCoords.col = zeroBasedCoords.col - _classPrivateFieldGet(this, _offset).x;
309
- zeroBasedCoords.row = zeroBasedCoords.row - _classPrivateFieldGet(this, _offset).y;
310
- return _classPrivateFieldGet(this, _options).renderableToVisualCoords(zeroBasedCoords);
311
- }
312
175
  mixin(Transformation, localHooks);
313
176
  export default Transformation;
@@ -1,9 +1,14 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.symbol.iterator.js");
4
+ require("core-js/modules/es.array.slice.js");
5
+ require("core-js/modules/es.regexp.to-string.js");
6
+ require("core-js/modules/es.function.name.js");
7
+ require("core-js/modules/es.regexp.exec.js");
4
8
  exports.__esModule = true;
5
9
  exports.SELECTION_TYPE_UNRECOGNIZED = exports.SELECTION_TYPE_OBJECT = exports.SELECTION_TYPE_EMPTY = exports.SELECTION_TYPE_ARRAY = exports.SELECTION_TYPES = void 0;
6
10
  exports.detectSelectionType = detectSelectionType;
11
+ exports.isValidCoord = isValidCoord;
7
12
  exports.normalizeSelectionFactory = normalizeSelectionFactory;
8
13
  exports.transformSelectionToColumnDistance = transformSelectionToColumnDistance;
9
14
  exports.transformSelectionToRowDistance = transformSelectionToRowDistance;
@@ -21,6 +26,12 @@ require("core-js/modules/es.array.sort.js");
21
26
  var _src = require("./../3rdparty/walkontable/src");
22
27
  var _array = require("./../helpers/array");
23
28
  var _mixed = require("./../helpers/mixed");
29
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
30
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
31
+ 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); }
32
+ 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; }
33
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
34
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
35
  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); }
25
36
  var SELECTION_TYPE_UNRECOGNIZED = 0;
26
37
  exports.SELECTION_TYPE_UNRECOGNIZED = SELECTION_TYPE_UNRECOGNIZED;
@@ -124,9 +135,7 @@ function normalizeSelectionFactory(type) {
124
135
  rowEnd = Math.max(origRowStart, origRowEnd);
125
136
  columnEnd = Math.max(origColumnStart, origColumnEnd);
126
137
  }
127
- var from = new _src.CellCoords(rowStart, columnStart);
128
- var to = new _src.CellCoords(rowEnd, columnEnd);
129
- return new _src.CellRange(from, from, to);
138
+ return [rowStart, columnStart, rowEnd, columnEnd];
130
139
  };
131
140
  }
132
141
 
@@ -153,10 +162,11 @@ function transformSelectionToColumnDistance(selectionRanges) {
153
162
  // Iterate through all ranges and collect all column indexes which are not saved yet.
154
163
  (0, _array.arrayEach)(selectionRanges, function (selection) {
155
164
  var _selectionSchemaNorma = selectionSchemaNormalizer(selection),
156
- from = _selectionSchemaNorma.from,
157
- to = _selectionSchemaNorma.to;
158
- var columnNonHeaderStart = Math.max(from.col, 0);
159
- var amount = to.col - columnNonHeaderStart + 1;
165
+ _selectionSchemaNorma2 = _slicedToArray(_selectionSchemaNorma, 4),
166
+ columnStart = _selectionSchemaNorma2[1],
167
+ columnEnd = _selectionSchemaNorma2[3];
168
+ var columnNonHeaderStart = Math.max(columnStart, 0);
169
+ var amount = columnEnd - columnNonHeaderStart + 1;
160
170
  (0, _array.arrayEach)(Array.from(new Array(amount), function (_, i) {
161
171
  return columnNonHeaderStart + i;
162
172
  }), function (index) {
@@ -203,11 +213,12 @@ function transformSelectionToRowDistance(selectionRanges) {
203
213
 
204
214
  // Iterate through all ranges and collect all column indexes which are not saved yet.
205
215
  (0, _array.arrayEach)(selectionRanges, function (selection) {
206
- var _selectionSchemaNorma2 = selectionSchemaNormalizer(selection),
207
- from = _selectionSchemaNorma2.from,
208
- to = _selectionSchemaNorma2.to;
209
- var rowNonHeaderStart = Math.max(from.row, 0);
210
- var amount = to.row - rowNonHeaderStart + 1;
216
+ var _selectionSchemaNorma3 = selectionSchemaNormalizer(selection),
217
+ _selectionSchemaNorma4 = _slicedToArray(_selectionSchemaNorma3, 3),
218
+ rowStart = _selectionSchemaNorma4[0],
219
+ rowEnd = _selectionSchemaNorma4[2];
220
+ var rowNonHeaderStart = Math.max(rowStart, 0);
221
+ var amount = rowEnd - rowNonHeaderStart + 1;
211
222
  (0, _array.arrayEach)(Array.from(new Array(amount), function (_, i) {
212
223
  return rowNonHeaderStart + i;
213
224
  }), function (index) {
@@ -230,4 +241,17 @@ function transformSelectionToRowDistance(selectionRanges) {
230
241
  return acc;
231
242
  }, []);
232
243
  return normalizedRowRanges;
244
+ }
245
+
246
+ /**
247
+ * Check if passed value can be treated as valid cell coordinate. The second argument is
248
+ * used to check if the value doesn't exceed the defined max table rows/columns count.
249
+ *
250
+ * @param {number} coord The coordinate to validate (row index or column index).
251
+ * @param {number} maxTableItemsCount The value that declares the maximum coordinate that is still validatable.
252
+ * @returns {boolean}
253
+ */
254
+ function isValidCoord(coord) {
255
+ var maxTableItemsCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
256
+ return typeof coord === 'number' && coord >= 0 && coord < maxTableItemsCount;
233
257
  }
@@ -1,3 +1,9 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ 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); }
4
+ 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; }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1
7
  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); }
2
8
  import "core-js/modules/es.symbol.js";
3
9
  import "core-js/modules/es.symbol.description.js";
@@ -11,7 +17,11 @@ import "core-js/modules/web.dom-collections.iterator.js";
11
17
  import "core-js/modules/es.array.from.js";
12
18
  import "core-js/modules/es.array.sort.js";
13
19
  import "core-js/modules/es.symbol.iterator.js";
14
- import { CellRange, CellCoords } from "./../3rdparty/walkontable/src/index.mjs";
20
+ import "core-js/modules/es.array.slice.js";
21
+ import "core-js/modules/es.regexp.to-string.js";
22
+ import "core-js/modules/es.function.name.js";
23
+ import "core-js/modules/es.regexp.exec.js";
24
+ import { CellRange } from "./../3rdparty/walkontable/src/index.mjs";
15
25
  import { arrayEach, arrayReduce } from "./../helpers/array.mjs";
16
26
  import { isUndefined } from "./../helpers/mixed.mjs";
17
27
  export var SELECTION_TYPE_UNRECOGNIZED = 0;
@@ -111,9 +121,7 @@ export function normalizeSelectionFactory(type) {
111
121
  rowEnd = Math.max(origRowStart, origRowEnd);
112
122
  columnEnd = Math.max(origColumnStart, origColumnEnd);
113
123
  }
114
- var from = new CellCoords(rowStart, columnStart);
115
- var to = new CellCoords(rowEnd, columnEnd);
116
- return new CellRange(from, from, to);
124
+ return [rowStart, columnStart, rowEnd, columnEnd];
117
125
  };
118
126
  }
119
127
 
@@ -140,10 +148,11 @@ export function transformSelectionToColumnDistance(selectionRanges) {
140
148
  // Iterate through all ranges and collect all column indexes which are not saved yet.
141
149
  arrayEach(selectionRanges, function (selection) {
142
150
  var _selectionSchemaNorma = selectionSchemaNormalizer(selection),
143
- from = _selectionSchemaNorma.from,
144
- to = _selectionSchemaNorma.to;
145
- var columnNonHeaderStart = Math.max(from.col, 0);
146
- var amount = to.col - columnNonHeaderStart + 1;
151
+ _selectionSchemaNorma2 = _slicedToArray(_selectionSchemaNorma, 4),
152
+ columnStart = _selectionSchemaNorma2[1],
153
+ columnEnd = _selectionSchemaNorma2[3];
154
+ var columnNonHeaderStart = Math.max(columnStart, 0);
155
+ var amount = columnEnd - columnNonHeaderStart + 1;
147
156
  arrayEach(Array.from(new Array(amount), function (_, i) {
148
157
  return columnNonHeaderStart + i;
149
158
  }), function (index) {
@@ -190,11 +199,12 @@ export function transformSelectionToRowDistance(selectionRanges) {
190
199
 
191
200
  // Iterate through all ranges and collect all column indexes which are not saved yet.
192
201
  arrayEach(selectionRanges, function (selection) {
193
- var _selectionSchemaNorma2 = selectionSchemaNormalizer(selection),
194
- from = _selectionSchemaNorma2.from,
195
- to = _selectionSchemaNorma2.to;
196
- var rowNonHeaderStart = Math.max(from.row, 0);
197
- var amount = to.row - rowNonHeaderStart + 1;
202
+ var _selectionSchemaNorma3 = selectionSchemaNormalizer(selection),
203
+ _selectionSchemaNorma4 = _slicedToArray(_selectionSchemaNorma3, 3),
204
+ rowStart = _selectionSchemaNorma4[0],
205
+ rowEnd = _selectionSchemaNorma4[2];
206
+ var rowNonHeaderStart = Math.max(rowStart, 0);
207
+ var amount = rowEnd - rowNonHeaderStart + 1;
198
208
  arrayEach(Array.from(new Array(amount), function (_, i) {
199
209
  return rowNonHeaderStart + i;
200
210
  }), function (index) {
@@ -217,4 +227,17 @@ export function transformSelectionToRowDistance(selectionRanges) {
217
227
  return acc;
218
228
  }, []);
219
229
  return normalizedRowRanges;
230
+ }
231
+
232
+ /**
233
+ * Check if passed value can be treated as valid cell coordinate. The second argument is
234
+ * used to check if the value doesn't exceed the defined max table rows/columns count.
235
+ *
236
+ * @param {number} coord The coordinate to validate (row index or column index).
237
+ * @param {number} maxTableItemsCount The value that declares the maximum coordinate that is still validatable.
238
+ * @returns {boolean}
239
+ */
240
+ export function isValidCoord(coord) {
241
+ var maxTableItemsCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
242
+ return typeof coord === 'number' && coord >= 0 && coord < maxTableItemsCount;
220
243
  }
package/settings.d.ts CHANGED
@@ -164,7 +164,6 @@ export interface GridSettings extends Events {
164
164
  minSpareCols?: number;
165
165
  minSpareRows?: number;
166
166
  multiColumnSorting?: MultiColumnSortingSettings;
167
- navigableHeaders?: boolean;
168
167
  nestedHeaders?: NestedHeadersSettings;
169
168
  nestedRows?: boolean;
170
169
  noWordWrapClassName?: string;
@@ -3,7 +3,6 @@
3
3
  exports.__esModule = true;
4
4
  exports.createShortcutManager = void 0;
5
5
  var _uniqueMap = require("../utils/dataStructures/uniqueMap");
6
- var _event = require("../helpers/dom/event");
7
6
  var _context = require("./context");
8
7
  var _recorder = require("./recorder");
9
8
  /* eslint-disable jsdoc/require-description-complete-sentence */
@@ -127,7 +126,6 @@ var createShortcutManager = function createShortcutManager(_ref) {
127
126
  event.preventDefault();
128
127
  }
129
128
  if (stopPropagation) {
130
- (0, _event.stopImmediatePropagation)(event);
131
129
  event.stopPropagation();
132
130
  }
133
131
  if (isExecutionCancelled) {
@@ -1,5 +1,4 @@
1
1
  import { createUniqueMap } from "../utils/dataStructures/uniqueMap.mjs";
2
- import { stopImmediatePropagation } from "../helpers/dom/event.mjs";
3
2
  import { createContext } from "./context.mjs";
4
3
  import { useRecorder } from "./recorder.mjs";
5
4
  /* eslint-disable jsdoc/require-description-complete-sentence */
@@ -122,7 +121,6 @@ export var createShortcutManager = function createShortcutManager(_ref) {
122
121
  event.preventDefault();
123
122
  }
124
123
  if (stopPropagation) {
125
- stopImmediatePropagation(event);
126
124
  event.stopPropagation();
127
125
  }
128
126
  if (isExecutionCancelled) {
@@ -88,7 +88,7 @@ function useRecorder(ownerWindow, handleEvent, beforeKeyDown, afterKeyDown, call
88
88
  if (event.keyCode === 229 || result === false || (0, _event.isImmediatePropagationStopped)(event)) {
89
89
  return;
90
90
  }
91
- var pressedKey = (0, _utils.normalizeEventKey)(event);
91
+ var pressedKey = (0, _utils.normalizeEventKey)(event.key);
92
92
  var extraModifierKeys = [];
93
93
  if (isModifierKey(pressedKey)) {
94
94
  modifierKeysObserver.press(pressedKey);
@@ -114,7 +114,7 @@ function useRecorder(ownerWindow, handleEvent, beforeKeyDown, afterKeyDown, call
114
114
  if (handleEvent(event) === false) {
115
115
  return;
116
116
  }
117
- var pressedKey = (0, _utils.normalizeEventKey)(event);
117
+ var pressedKey = (0, _utils.normalizeEventKey)(event.key);
118
118
  if (isModifierKey(pressedKey) === false) {
119
119
  return;
120
120
  }