handsontable 0.0.0-next-08765b9-20230809 → 0.0.0-next-912c214-20230818

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 (299) 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 +11 -50
  5. package/3rdparty/walkontable/src/cell/coords.mjs +11 -50
  6. package/3rdparty/walkontable/src/cell/range.d.ts +2 -9
  7. package/3rdparty/walkontable/src/cell/range.js +7 -38
  8. package/3rdparty/walkontable/src/cell/range.mjs +7 -38
  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 +6 -2
  24. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +6 -2
  25. package/3rdparty/walkontable/src/overlay/top.js +6 -2
  26. package/3rdparty/walkontable/src/overlay/top.mjs +6 -2
  27. package/3rdparty/walkontable/src/selection.js +295 -0
  28. package/3rdparty/walkontable/src/selection.mjs +290 -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 +78 -6
  40. package/3rdparty/walkontable/src/table.mjs +79 -7
  41. package/base.js +2 -2
  42. package/base.mjs +2 -2
  43. package/common.d.ts +1 -1
  44. package/core.d.ts +3 -6
  45. package/core.js +290 -173
  46. package/core.mjs +290 -173
  47. package/dataMap/metaManager/metaSchema.js +0 -41
  48. package/dataMap/metaManager/metaSchema.mjs +0 -41
  49. package/dist/handsontable.css +4 -24
  50. package/dist/handsontable.full.css +4 -24
  51. package/dist/handsontable.full.js +5589 -8684
  52. package/dist/handsontable.full.min.css +3 -3
  53. package/dist/handsontable.full.min.js +25 -25
  54. package/dist/handsontable.js +8036 -11131
  55. package/dist/handsontable.min.css +3 -3
  56. package/dist/handsontable.min.js +19 -19
  57. package/editorManager.js +75 -11
  58. package/editorManager.mjs +74 -11
  59. package/editors/baseEditor/baseEditor.d.ts +1 -0
  60. package/editors/textEditor/textEditor.js +11 -3
  61. package/editors/textEditor/textEditor.mjs +12 -4
  62. package/helpers/mixed.js +1 -1
  63. package/helpers/mixed.mjs +1 -1
  64. package/helpers/number.d.ts +0 -1
  65. package/helpers/number.js +0 -18
  66. package/helpers/number.mjs +0 -17
  67. package/package.json +1 -1
  68. package/pluginHooks.d.ts +1 -7
  69. package/pluginHooks.js +1 -106
  70. package/pluginHooks.mjs +1 -106
  71. package/plugins/collapsibleColumns/collapsibleColumns.js +4 -58
  72. package/plugins/collapsibleColumns/collapsibleColumns.mjs +4 -58
  73. package/plugins/columnSorting/columnSorting.js +0 -38
  74. package/plugins/columnSorting/columnSorting.mjs +2 -38
  75. package/plugins/columnSorting/index.js +1 -3
  76. package/plugins/columnSorting/index.mjs +1 -1
  77. package/plugins/comments/commentEditor.js +0 -1
  78. package/plugins/comments/commentEditor.mjs +0 -1
  79. package/plugins/comments/comments.js +189 -251
  80. package/plugins/comments/comments.mjs +190 -250
  81. package/plugins/contextMenu/contextMenu.d.ts +1 -1
  82. package/plugins/contextMenu/contextMenu.js +30 -72
  83. package/plugins/contextMenu/contextMenu.mjs +31 -73
  84. package/plugins/contextMenu/predefinedItems/alignment.js +0 -7
  85. package/plugins/contextMenu/predefinedItems/alignment.mjs +0 -7
  86. package/plugins/contextMenu/predefinedItems/clearColumn.js +3 -5
  87. package/plugins/contextMenu/predefinedItems/clearColumn.mjs +3 -5
  88. package/plugins/contextMenu/predefinedItems/columnLeft.js +3 -5
  89. package/plugins/contextMenu/predefinedItems/columnLeft.mjs +3 -5
  90. package/plugins/contextMenu/predefinedItems/columnRight.js +3 -5
  91. package/plugins/contextMenu/predefinedItems/columnRight.mjs +3 -5
  92. package/plugins/contextMenu/predefinedItems/readOnly.js +0 -7
  93. package/plugins/contextMenu/predefinedItems/readOnly.mjs +0 -7
  94. package/plugins/contextMenu/predefinedItems/removeColumn.js +5 -7
  95. package/plugins/contextMenu/predefinedItems/removeColumn.mjs +3 -5
  96. package/plugins/contextMenu/predefinedItems/removeRow.js +5 -7
  97. package/plugins/contextMenu/predefinedItems/removeRow.mjs +3 -5
  98. package/plugins/contextMenu/predefinedItems/rowAbove.js +3 -5
  99. package/plugins/contextMenu/predefinedItems/rowAbove.mjs +3 -5
  100. package/plugins/contextMenu/predefinedItems/rowBelow.js +3 -5
  101. package/plugins/contextMenu/predefinedItems/rowBelow.mjs +3 -5
  102. package/plugins/contextMenu/utils.js +16 -28
  103. package/plugins/contextMenu/utils.mjs +15 -27
  104. package/plugins/copyPaste/contextMenuItem/copy.js +0 -7
  105. package/plugins/copyPaste/contextMenuItem/copy.mjs +0 -7
  106. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +1 -9
  107. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +1 -9
  108. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +1 -9
  109. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +1 -9
  110. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +1 -9
  111. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +1 -9
  112. package/plugins/copyPaste/contextMenuItem/cut.js +0 -7
  113. package/plugins/copyPaste/contextMenuItem/cut.mjs +0 -7
  114. package/plugins/copyPaste/copyPaste.js +10 -14
  115. package/plugins/copyPaste/copyPaste.mjs +10 -14
  116. package/plugins/customBorders/customBorders.js +20 -23
  117. package/plugins/customBorders/customBorders.mjs +21 -24
  118. package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
  119. package/plugins/dropdownMenu/dropdownMenu.js +32 -89
  120. package/plugins/dropdownMenu/dropdownMenu.mjs +32 -89
  121. package/plugins/filters/filters.js +14 -31
  122. package/plugins/filters/filters.mjs +13 -30
  123. package/plugins/manualColumnResize/manualColumnResize.js +6 -0
  124. package/plugins/manualColumnResize/manualColumnResize.mjs +7 -1
  125. package/plugins/mergeCells/mergeCells.js +17 -5
  126. package/plugins/mergeCells/mergeCells.mjs +17 -5
  127. package/plugins/multiColumnSorting/multiColumnSorting.js +2 -37
  128. package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -37
  129. package/plugins/nestedHeaders/nestedHeaders.js +8 -121
  130. package/plugins/nestedHeaders/nestedHeaders.mjs +8 -121
  131. package/plugins/nestedHeaders/stateManager/index.js +0 -37
  132. package/plugins/nestedHeaders/stateManager/index.mjs +0 -37
  133. package/plugins/nestedRows/nestedRows.js +0 -41
  134. package/plugins/nestedRows/nestedRows.mjs +0 -41
  135. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
  136. package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
  137. package/selection/highlight/constants.js +15 -0
  138. package/selection/highlight/constants.mjs +6 -0
  139. package/selection/highlight/highlight.js +71 -256
  140. package/selection/highlight/highlight.mjs +71 -250
  141. package/selection/highlight/types/activeHeader.js +8 -10
  142. package/selection/highlight/types/activeHeader.mjs +8 -10
  143. package/selection/highlight/types/area.js +18 -6
  144. package/selection/highlight/types/area.mjs +18 -6
  145. package/selection/highlight/types/{focus.js → cell.js} +7 -5
  146. package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
  147. package/selection/highlight/types/customSelection.js +9 -7
  148. package/selection/highlight/types/customSelection.mjs +9 -7
  149. package/selection/highlight/types/fill.js +7 -5
  150. package/selection/highlight/types/fill.mjs +7 -5
  151. package/selection/highlight/types/header.js +18 -9
  152. package/selection/highlight/types/header.mjs +18 -9
  153. package/selection/highlight/types/index.js +35 -0
  154. package/selection/highlight/types/index.mjs +31 -0
  155. package/selection/highlight/visualSelection.js +27 -31
  156. package/selection/highlight/visualSelection.mjs +27 -31
  157. package/selection/index.js +7 -4
  158. package/selection/index.mjs +3 -2
  159. package/selection/mouseEventHandler.js +1 -1
  160. package/selection/mouseEventHandler.mjs +1 -1
  161. package/selection/range.js +8 -8
  162. package/selection/range.mjs +8 -8
  163. package/selection/selection.js +154 -290
  164. package/selection/selection.mjs +153 -287
  165. package/selection/transformation.js +90 -232
  166. package/selection/transformation.mjs +90 -232
  167. package/selection/utils.js +21 -15
  168. package/selection/utils.mjs +21 -16
  169. package/settings.d.ts +0 -2
  170. package/shortcuts/manager.js +0 -2
  171. package/shortcuts/manager.mjs +0 -2
  172. package/shortcuts/recorder.js +2 -2
  173. package/shortcuts/recorder.mjs +2 -2
  174. package/shortcuts/utils.js +5 -19
  175. package/shortcuts/utils.mjs +4 -18
  176. package/tableView.js +13 -67
  177. package/tableView.mjs +13 -67
  178. package/3rdparty/walkontable/src/selection/border/constants.js +0 -16
  179. package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -12
  180. package/3rdparty/walkontable/src/selection/constants.js +0 -62
  181. package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
  182. package/3rdparty/walkontable/src/selection/index.js +0 -26
  183. package/3rdparty/walkontable/src/selection/index.mjs +0 -5
  184. package/3rdparty/walkontable/src/selection/manager.js +0 -259
  185. package/3rdparty/walkontable/src/selection/manager.mjs +0 -254
  186. package/3rdparty/walkontable/src/selection/scanner.js +0 -270
  187. package/3rdparty/walkontable/src/selection/scanner.mjs +0 -267
  188. package/3rdparty/walkontable/src/selection/selection.js +0 -101
  189. package/3rdparty/walkontable/src/selection/selection.mjs +0 -96
  190. package/core/focusCatcher/focusDetector.js +0 -58
  191. package/core/focusCatcher/focusDetector.mjs +0 -54
  192. package/core/focusCatcher/index.js +0 -142
  193. package/core/focusCatcher/index.mjs +0 -138
  194. package/core/index.js +0 -9
  195. package/core/index.mjs +0 -1
  196. package/plugins/comments/contextMenuItem/addEditComment.js +0 -41
  197. package/plugins/comments/contextMenuItem/addEditComment.mjs +0 -35
  198. package/plugins/comments/contextMenuItem/readOnlyComment.js +0 -49
  199. package/plugins/comments/contextMenuItem/readOnlyComment.mjs +0 -43
  200. package/plugins/comments/contextMenuItem/removeComment.js +0 -38
  201. package/plugins/comments/contextMenuItem/removeComment.mjs +0 -32
  202. package/selection/highlight/types/areaLayered.js +0 -31
  203. package/selection/highlight/types/areaLayered.mjs +0 -26
  204. package/selection/highlight/types/column.js +0 -27
  205. package/selection/highlight/types/column.mjs +0 -22
  206. package/selection/highlight/types/row.js +0 -27
  207. package/selection/highlight/types/row.mjs +0 -22
  208. package/shortcutContexts/commands/editor/closeAndSave.js +0 -12
  209. package/shortcutContexts/commands/editor/closeAndSave.mjs +0 -8
  210. package/shortcutContexts/commands/editor/closeWithoutSaving.js +0 -12
  211. package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +0 -8
  212. package/shortcutContexts/commands/editor/fastOpen.js +0 -16
  213. package/shortcutContexts/commands/editor/fastOpen.mjs +0 -12
  214. package/shortcutContexts/commands/editor/index.js +0 -16
  215. package/shortcutContexts/commands/editor/index.mjs +0 -12
  216. package/shortcutContexts/commands/editor/open.js +0 -27
  217. package/shortcutContexts/commands/editor/open.mjs +0 -23
  218. package/shortcutContexts/commands/emptySelectedCells.js +0 -11
  219. package/shortcutContexts/commands/emptySelectedCells.mjs +0 -7
  220. package/shortcutContexts/commands/extendCellsSelection/down.js +0 -15
  221. package/shortcutContexts/commands/extendCellsSelection/down.mjs +0 -11
  222. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +0 -21
  223. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -17
  224. package/shortcutContexts/commands/extendCellsSelection/index.js +0 -26
  225. package/shortcutContexts/commands/extendCellsSelection/index.mjs +0 -22
  226. package/shortcutContexts/commands/extendCellsSelection/left.js +0 -15
  227. package/shortcutContexts/commands/extendCellsSelection/left.mjs +0 -11
  228. package/shortcutContexts/commands/extendCellsSelection/right.js +0 -15
  229. package/shortcutContexts/commands/extendCellsSelection/right.mjs +0 -11
  230. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +0 -19
  231. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +0 -15
  232. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +0 -29
  233. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +0 -25
  234. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +0 -19
  235. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +0 -15
  236. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +0 -19
  237. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +0 -15
  238. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +0 -29
  239. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -25
  240. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -29
  241. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -25
  242. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -29
  243. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -25
  244. package/shortcutContexts/commands/extendCellsSelection/toRows.js +0 -19
  245. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +0 -15
  246. package/shortcutContexts/commands/extendCellsSelection/up.js +0 -15
  247. package/shortcutContexts/commands/extendCellsSelection/up.mjs +0 -11
  248. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +0 -21
  249. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -17
  250. package/shortcutContexts/commands/index.js +0 -35
  251. package/shortcutContexts/commands/index.mjs +0 -31
  252. package/shortcutContexts/commands/moveCellSelection/down.js +0 -13
  253. package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -9
  254. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -31
  255. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -27
  256. package/shortcutContexts/commands/moveCellSelection/index.js +0 -28
  257. package/shortcutContexts/commands/moveCellSelection/index.mjs +0 -24
  258. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +0 -12
  259. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +0 -8
  260. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +0 -12
  261. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +0 -8
  262. package/shortcutContexts/commands/moveCellSelection/left.js +0 -10
  263. package/shortcutContexts/commands/moveCellSelection/left.mjs +0 -6
  264. package/shortcutContexts/commands/moveCellSelection/right.js +0 -10
  265. package/shortcutContexts/commands/moveCellSelection/right.mjs +0 -6
  266. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +0 -17
  267. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +0 -13
  268. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +0 -18
  269. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +0 -14
  270. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +0 -14
  271. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +0 -10
  272. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +0 -17
  273. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +0 -13
  274. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +0 -19
  275. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -15
  276. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -21
  277. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -17
  278. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +0 -17
  279. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +0 -13
  280. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +0 -19
  281. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +0 -15
  282. package/shortcutContexts/commands/moveCellSelection/up.js +0 -13
  283. package/shortcutContexts/commands/moveCellSelection/up.mjs +0 -9
  284. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +0 -31
  285. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -27
  286. package/shortcutContexts/commands/populateSelectedCellsData.js +0 -29
  287. package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -25
  288. package/shortcutContexts/commands/scrollToFocusedCell.js +0 -36
  289. package/shortcutContexts/commands/scrollToFocusedCell.mjs +0 -32
  290. package/shortcutContexts/commands/selectAll.js +0 -10
  291. package/shortcutContexts/commands/selectAll.mjs +0 -6
  292. package/shortcutContexts/constants.js +0 -13
  293. package/shortcutContexts/constants.mjs +0 -8
  294. package/shortcutContexts/editor.js +0 -25
  295. package/shortcutContexts/editor.mjs +0 -21
  296. package/shortcutContexts/grid.js +0 -163
  297. package/shortcutContexts/grid.mjs +0 -159
  298. package/shortcutContexts/index.js +0 -24
  299. package/shortcutContexts/index.mjs +0 -11
@@ -1,259 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- require("core-js/modules/es.array.unscopables.flat.js");
5
- require("core-js/modules/es.error.cause.js");
6
- var _element = require("../../../../helpers/dom/element");
7
- var _scanner2 = require("./scanner");
8
- var _border = _interopRequireDefault(require("./border/border"));
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
11
- function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
12
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
13
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
14
- function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
15
- function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
16
- function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
17
- function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
18
- 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; } }
19
- /**
20
- * Module responsible for rendering selections (CSS classes) and borders based on the
21
- * collection of the Selection instances provided throughout the `selections` Walkontable
22
- * setting.
23
- *
24
- * @private
25
- */
26
- var _activeOverlaysWot = /*#__PURE__*/new WeakMap();
27
- var _selections = /*#__PURE__*/new WeakMap();
28
- var _scanner = /*#__PURE__*/new WeakMap();
29
- var _appliedClasses = /*#__PURE__*/new WeakMap();
30
- var _destroyListeners = /*#__PURE__*/new WeakMap();
31
- var _selectionBorders = /*#__PURE__*/new WeakMap();
32
- var _resetCells = /*#__PURE__*/new WeakSet();
33
- class SelectionManager {
34
- constructor(selections) {
35
- /**
36
- * Resets the elements to their initial state (remove the CSS classes that are added in the
37
- * previous render cycle).
38
- */
39
- _classPrivateMethodInitSpec(this, _resetCells);
40
- /**
41
- * The overlay's Walkontable instance that are currently processed.
42
- *
43
- * @type {Walkontable}
44
- */
45
- _classPrivateFieldInitSpec(this, _activeOverlaysWot, {
46
- writable: true,
47
- value: void 0
48
- });
49
- /**
50
- * The Highlight instance that holds Selections instances within it.
51
- *
52
- * @type {Highlight|null}
53
- */
54
- _classPrivateFieldInitSpec(this, _selections, {
55
- writable: true,
56
- value: void 0
57
- });
58
- /**
59
- * The SelectionScanner allows to scan and collect the cell and header elements that matches
60
- * to the coords defined in the selections.
61
- *
62
- * @type {SelectionScanner}
63
- */
64
- _classPrivateFieldInitSpec(this, _scanner, {
65
- writable: true,
66
- value: new _scanner2.SelectionScanner()
67
- });
68
- /**
69
- * The Map tracks applied CSS classes. It's used to reset the elements state to their initial state.
70
- *
71
- * @type {WeakMap}
72
- */
73
- _classPrivateFieldInitSpec(this, _appliedClasses, {
74
- writable: true,
75
- value: new WeakMap()
76
- });
77
- /**
78
- * The Map tracks applied "destroy" listeners for Selection instances.
79
- *
80
- * @type {WeakMap}
81
- */
82
- _classPrivateFieldInitSpec(this, _destroyListeners, {
83
- writable: true,
84
- value: new WeakSet()
85
- });
86
- /**
87
- * The Map holds references to Border classes for Selection instances which requires that when
88
- * the "border" setting is defined.
89
- *
90
- * @type {Map}
91
- */
92
- _classPrivateFieldInitSpec(this, _selectionBorders, {
93
- writable: true,
94
- value: new Map()
95
- });
96
- _classPrivateFieldSet(this, _selections, selections);
97
- }
98
-
99
- /**
100
- * Sets the active Walkontable instance.
101
- *
102
- * @param {Walkontable} activeWot The overlays or master Walkontable instance.
103
- * @returns {SelectionManager}
104
- */
105
- setActiveOverlay(activeWot) {
106
- _classPrivateFieldSet(this, _activeOverlaysWot, activeWot);
107
- _classPrivateFieldGet(this, _scanner).setActiveOverlay(_classPrivateFieldGet(this, _activeOverlaysWot));
108
- if (!_classPrivateFieldGet(this, _appliedClasses).has(_classPrivateFieldGet(this, _activeOverlaysWot))) {
109
- _classPrivateFieldGet(this, _appliedClasses).set(_classPrivateFieldGet(this, _activeOverlaysWot), new Set());
110
- }
111
- return this;
112
- }
113
-
114
- /**
115
- * Gets the Selection instance of the "focus" type.
116
- *
117
- * @returns {Selection|null}
118
- */
119
- getFocusSelection() {
120
- return _classPrivateFieldGet(this, _selections) !== null ? _classPrivateFieldGet(this, _selections).getFocus() : null;
121
- }
122
-
123
- /**
124
- * Gets the Selection instance of the "area" type.
125
- *
126
- * @returns {Selection|null}
127
- */
128
- getAreaSelection() {
129
- return _classPrivateFieldGet(this, _selections) !== null ? _classPrivateFieldGet(this, _selections).createLayeredArea() : null;
130
- }
131
-
132
- /**
133
- * Gets the Border instance associated with Selection instance.
134
- *
135
- * @param {Selection} selection The selection instance.
136
- * @returns {Border|null} Returns the Border instance (new for each overlay Walkontable instance).
137
- */
138
- getBorderInstance(selection) {
139
- if (!selection.settings.border) {
140
- return null;
141
- }
142
- if (_classPrivateFieldGet(this, _selectionBorders).has(selection)) {
143
- const borders = _classPrivateFieldGet(this, _selectionBorders).get(selection);
144
- if (borders.has(_classPrivateFieldGet(this, _activeOverlaysWot))) {
145
- return borders.get(_classPrivateFieldGet(this, _activeOverlaysWot));
146
- }
147
- const border = new _border.default(_classPrivateFieldGet(this, _activeOverlaysWot), selection.settings);
148
- borders.set(_classPrivateFieldGet(this, _activeOverlaysWot), border);
149
- return border;
150
- }
151
- const border = new _border.default(_classPrivateFieldGet(this, _activeOverlaysWot), selection.settings);
152
- _classPrivateFieldGet(this, _selectionBorders).set(selection, new Map([[_classPrivateFieldGet(this, _activeOverlaysWot), border]]));
153
- return border;
154
- }
155
-
156
- /**
157
- * Gets all Border instances associated with Selection instance for all overlays.
158
- *
159
- * @param {Selection} selection The selection instance.
160
- * @returns {Border[]}
161
- */
162
- getBorderInstances(selection) {
163
- var _classPrivateFieldGet2, _classPrivateFieldGet3;
164
- return Array.from((_classPrivateFieldGet2 = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _selectionBorders).get(selection)) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.values()) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : []);
165
- }
166
-
167
- /**
168
- * Destroys the Border instance associated with Selection instance.
169
- *
170
- * @param {Selection} selection The selection instance.
171
- */
172
- destroyBorders(selection) {
173
- _classPrivateFieldGet(this, _selectionBorders).get(selection).forEach(border => border.destroy());
174
- _classPrivateFieldGet(this, _selectionBorders).delete(selection);
175
- }
176
-
177
- /**
178
- * Renders all the selections (add CSS classes to cells and draw borders).
179
- *
180
- * @param {boolean} fastDraw Indicates the render cycle type (fast/slow).
181
- */
182
- render(fastDraw) {
183
- if (_classPrivateFieldGet(this, _selections) === null) {
184
- return;
185
- }
186
- if (fastDraw) {
187
- // there was no rerender, so we need to remove classNames by ourselves
188
- _classPrivateMethodGet(this, _resetCells, _resetCells2).call(this);
189
- }
190
- const selections = Array.from(_classPrivateFieldGet(this, _selections));
191
- const classNamesMap = new Map();
192
- for (let i = 0; i < selections.length; i++) {
193
- const selection = selections[i];
194
- const {
195
- className,
196
- createLayers,
197
- selectionType
198
- } = selection.settings;
199
- if (!_classPrivateFieldGet(this, _destroyListeners).has(selection)) {
200
- _classPrivateFieldGet(this, _destroyListeners).add(selection);
201
- selection.addLocalHook('destroy', () => this.destroyBorders(selection));
202
- }
203
- const borderInstance = this.getBorderInstance(selection);
204
- if (selection.isEmpty()) {
205
- borderInstance === null || borderInstance === void 0 ? void 0 : borderInstance.disappear();
206
- continue; // eslint-disable-line no-continue
207
- }
208
-
209
- if (className) {
210
- const elements = _classPrivateFieldGet(this, _scanner).setActiveSelection(selection).scan();
211
- elements.forEach(element => {
212
- if (classNamesMap.has(element)) {
213
- const classNamesLayers = classNamesMap.get(element);
214
- if (classNamesLayers.has(className) && createLayers === true) {
215
- classNamesLayers.set(className, classNamesLayers.get(className) + 1);
216
- } else {
217
- classNamesLayers.set(className, 1);
218
- }
219
- } else {
220
- classNamesMap.set(element, new Map([[className, 1]]));
221
- }
222
- });
223
- }
224
- const corners = selection.getCorners();
225
- _classPrivateFieldGet(this, _activeOverlaysWot).getSetting('onBeforeDrawBorders', corners, selectionType);
226
- borderInstance === null || borderInstance === void 0 ? void 0 : borderInstance.appear(corners);
227
- }
228
- classNamesMap.forEach((classNamesLayers, element) => {
229
- const classNames = Array.from(classNamesLayers).map(_ref => {
230
- let [className, occurrenceCount] = _ref;
231
- if (occurrenceCount === 1) {
232
- return className;
233
- }
234
- return [className, ...Array.from({
235
- length: occurrenceCount - 1
236
- }, (_, i) => `${className}-${i + 1}`)];
237
- }).flat();
238
- classNames.forEach(className => _classPrivateFieldGet(this, _appliedClasses).get(_classPrivateFieldGet(this, _activeOverlaysWot)).add(className));
239
- (0, _element.addClass)(element, classNames);
240
- });
241
- }
242
- }
243
- exports.SelectionManager = SelectionManager;
244
- function _resetCells2() {
245
- const appliedOverlaysClasses = _classPrivateFieldGet(this, _appliedClasses).get(_classPrivateFieldGet(this, _activeOverlaysWot));
246
- const classesToRemove = _classPrivateFieldGet(this, _activeOverlaysWot).wtSettings.getSetting('onBeforeRemoveCellClassNames');
247
- if (Array.isArray(classesToRemove)) {
248
- for (let i = 0; i < classesToRemove.length; i++) {
249
- appliedOverlaysClasses.add(classesToRemove[i]);
250
- }
251
- }
252
- appliedOverlaysClasses.forEach(className => {
253
- const nodes = _classPrivateFieldGet(this, _activeOverlaysWot).wtTable.TABLE.querySelectorAll(`.${className}`);
254
- for (let i = 0, len = nodes.length; i < len; i++) {
255
- (0, _element.removeClass)(nodes[i], className);
256
- }
257
- });
258
- appliedOverlaysClasses.clear();
259
- }
@@ -1,254 +0,0 @@
1
- import "core-js/modules/es.array.unscopables.flat.js";
2
- import "core-js/modules/es.error.cause.js";
3
- function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
4
- function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
5
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
6
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
7
- function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
8
- function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
9
- function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
10
- function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
11
- 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; } }
12
- import { removeClass, addClass } from "../../../../helpers/dom/element.mjs";
13
- import { SelectionScanner } from "./scanner.mjs";
14
- import Border from "./border/border.mjs";
15
- /**
16
- * Module responsible for rendering selections (CSS classes) and borders based on the
17
- * collection of the Selection instances provided throughout the `selections` Walkontable
18
- * setting.
19
- *
20
- * @private
21
- */
22
- var _activeOverlaysWot = /*#__PURE__*/new WeakMap();
23
- var _selections = /*#__PURE__*/new WeakMap();
24
- var _scanner = /*#__PURE__*/new WeakMap();
25
- var _appliedClasses = /*#__PURE__*/new WeakMap();
26
- var _destroyListeners = /*#__PURE__*/new WeakMap();
27
- var _selectionBorders = /*#__PURE__*/new WeakMap();
28
- var _resetCells = /*#__PURE__*/new WeakSet();
29
- export class SelectionManager {
30
- constructor(selections) {
31
- /**
32
- * Resets the elements to their initial state (remove the CSS classes that are added in the
33
- * previous render cycle).
34
- */
35
- _classPrivateMethodInitSpec(this, _resetCells);
36
- /**
37
- * The overlay's Walkontable instance that are currently processed.
38
- *
39
- * @type {Walkontable}
40
- */
41
- _classPrivateFieldInitSpec(this, _activeOverlaysWot, {
42
- writable: true,
43
- value: void 0
44
- });
45
- /**
46
- * The Highlight instance that holds Selections instances within it.
47
- *
48
- * @type {Highlight|null}
49
- */
50
- _classPrivateFieldInitSpec(this, _selections, {
51
- writable: true,
52
- value: void 0
53
- });
54
- /**
55
- * The SelectionScanner allows to scan and collect the cell and header elements that matches
56
- * to the coords defined in the selections.
57
- *
58
- * @type {SelectionScanner}
59
- */
60
- _classPrivateFieldInitSpec(this, _scanner, {
61
- writable: true,
62
- value: new SelectionScanner()
63
- });
64
- /**
65
- * The Map tracks applied CSS classes. It's used to reset the elements state to their initial state.
66
- *
67
- * @type {WeakMap}
68
- */
69
- _classPrivateFieldInitSpec(this, _appliedClasses, {
70
- writable: true,
71
- value: new WeakMap()
72
- });
73
- /**
74
- * The Map tracks applied "destroy" listeners for Selection instances.
75
- *
76
- * @type {WeakMap}
77
- */
78
- _classPrivateFieldInitSpec(this, _destroyListeners, {
79
- writable: true,
80
- value: new WeakSet()
81
- });
82
- /**
83
- * The Map holds references to Border classes for Selection instances which requires that when
84
- * the "border" setting is defined.
85
- *
86
- * @type {Map}
87
- */
88
- _classPrivateFieldInitSpec(this, _selectionBorders, {
89
- writable: true,
90
- value: new Map()
91
- });
92
- _classPrivateFieldSet(this, _selections, selections);
93
- }
94
-
95
- /**
96
- * Sets the active Walkontable instance.
97
- *
98
- * @param {Walkontable} activeWot The overlays or master Walkontable instance.
99
- * @returns {SelectionManager}
100
- */
101
- setActiveOverlay(activeWot) {
102
- _classPrivateFieldSet(this, _activeOverlaysWot, activeWot);
103
- _classPrivateFieldGet(this, _scanner).setActiveOverlay(_classPrivateFieldGet(this, _activeOverlaysWot));
104
- if (!_classPrivateFieldGet(this, _appliedClasses).has(_classPrivateFieldGet(this, _activeOverlaysWot))) {
105
- _classPrivateFieldGet(this, _appliedClasses).set(_classPrivateFieldGet(this, _activeOverlaysWot), new Set());
106
- }
107
- return this;
108
- }
109
-
110
- /**
111
- * Gets the Selection instance of the "focus" type.
112
- *
113
- * @returns {Selection|null}
114
- */
115
- getFocusSelection() {
116
- return _classPrivateFieldGet(this, _selections) !== null ? _classPrivateFieldGet(this, _selections).getFocus() : null;
117
- }
118
-
119
- /**
120
- * Gets the Selection instance of the "area" type.
121
- *
122
- * @returns {Selection|null}
123
- */
124
- getAreaSelection() {
125
- return _classPrivateFieldGet(this, _selections) !== null ? _classPrivateFieldGet(this, _selections).createLayeredArea() : null;
126
- }
127
-
128
- /**
129
- * Gets the Border instance associated with Selection instance.
130
- *
131
- * @param {Selection} selection The selection instance.
132
- * @returns {Border|null} Returns the Border instance (new for each overlay Walkontable instance).
133
- */
134
- getBorderInstance(selection) {
135
- if (!selection.settings.border) {
136
- return null;
137
- }
138
- if (_classPrivateFieldGet(this, _selectionBorders).has(selection)) {
139
- const borders = _classPrivateFieldGet(this, _selectionBorders).get(selection);
140
- if (borders.has(_classPrivateFieldGet(this, _activeOverlaysWot))) {
141
- return borders.get(_classPrivateFieldGet(this, _activeOverlaysWot));
142
- }
143
- const border = new Border(_classPrivateFieldGet(this, _activeOverlaysWot), selection.settings);
144
- borders.set(_classPrivateFieldGet(this, _activeOverlaysWot), border);
145
- return border;
146
- }
147
- const border = new Border(_classPrivateFieldGet(this, _activeOverlaysWot), selection.settings);
148
- _classPrivateFieldGet(this, _selectionBorders).set(selection, new Map([[_classPrivateFieldGet(this, _activeOverlaysWot), border]]));
149
- return border;
150
- }
151
-
152
- /**
153
- * Gets all Border instances associated with Selection instance for all overlays.
154
- *
155
- * @param {Selection} selection The selection instance.
156
- * @returns {Border[]}
157
- */
158
- getBorderInstances(selection) {
159
- var _classPrivateFieldGet2, _classPrivateFieldGet3;
160
- return Array.from((_classPrivateFieldGet2 = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _selectionBorders).get(selection)) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.values()) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : []);
161
- }
162
-
163
- /**
164
- * Destroys the Border instance associated with Selection instance.
165
- *
166
- * @param {Selection} selection The selection instance.
167
- */
168
- destroyBorders(selection) {
169
- _classPrivateFieldGet(this, _selectionBorders).get(selection).forEach(border => border.destroy());
170
- _classPrivateFieldGet(this, _selectionBorders).delete(selection);
171
- }
172
-
173
- /**
174
- * Renders all the selections (add CSS classes to cells and draw borders).
175
- *
176
- * @param {boolean} fastDraw Indicates the render cycle type (fast/slow).
177
- */
178
- render(fastDraw) {
179
- if (_classPrivateFieldGet(this, _selections) === null) {
180
- return;
181
- }
182
- if (fastDraw) {
183
- // there was no rerender, so we need to remove classNames by ourselves
184
- _classPrivateMethodGet(this, _resetCells, _resetCells2).call(this);
185
- }
186
- const selections = Array.from(_classPrivateFieldGet(this, _selections));
187
- const classNamesMap = new Map();
188
- for (let i = 0; i < selections.length; i++) {
189
- const selection = selections[i];
190
- const {
191
- className,
192
- createLayers,
193
- selectionType
194
- } = selection.settings;
195
- if (!_classPrivateFieldGet(this, _destroyListeners).has(selection)) {
196
- _classPrivateFieldGet(this, _destroyListeners).add(selection);
197
- selection.addLocalHook('destroy', () => this.destroyBorders(selection));
198
- }
199
- const borderInstance = this.getBorderInstance(selection);
200
- if (selection.isEmpty()) {
201
- borderInstance === null || borderInstance === void 0 ? void 0 : borderInstance.disappear();
202
- continue; // eslint-disable-line no-continue
203
- }
204
-
205
- if (className) {
206
- const elements = _classPrivateFieldGet(this, _scanner).setActiveSelection(selection).scan();
207
- elements.forEach(element => {
208
- if (classNamesMap.has(element)) {
209
- const classNamesLayers = classNamesMap.get(element);
210
- if (classNamesLayers.has(className) && createLayers === true) {
211
- classNamesLayers.set(className, classNamesLayers.get(className) + 1);
212
- } else {
213
- classNamesLayers.set(className, 1);
214
- }
215
- } else {
216
- classNamesMap.set(element, new Map([[className, 1]]));
217
- }
218
- });
219
- }
220
- const corners = selection.getCorners();
221
- _classPrivateFieldGet(this, _activeOverlaysWot).getSetting('onBeforeDrawBorders', corners, selectionType);
222
- borderInstance === null || borderInstance === void 0 ? void 0 : borderInstance.appear(corners);
223
- }
224
- classNamesMap.forEach((classNamesLayers, element) => {
225
- const classNames = Array.from(classNamesLayers).map(_ref => {
226
- let [className, occurrenceCount] = _ref;
227
- if (occurrenceCount === 1) {
228
- return className;
229
- }
230
- return [className, ...Array.from({
231
- length: occurrenceCount - 1
232
- }, (_, i) => `${className}-${i + 1}`)];
233
- }).flat();
234
- classNames.forEach(className => _classPrivateFieldGet(this, _appliedClasses).get(_classPrivateFieldGet(this, _activeOverlaysWot)).add(className));
235
- addClass(element, classNames);
236
- });
237
- }
238
- }
239
- function _resetCells2() {
240
- const appliedOverlaysClasses = _classPrivateFieldGet(this, _appliedClasses).get(_classPrivateFieldGet(this, _activeOverlaysWot));
241
- const classesToRemove = _classPrivateFieldGet(this, _activeOverlaysWot).wtSettings.getSetting('onBeforeRemoveCellClassNames');
242
- if (Array.isArray(classesToRemove)) {
243
- for (let i = 0; i < classesToRemove.length; i++) {
244
- appliedOverlaysClasses.add(classesToRemove[i]);
245
- }
246
- }
247
- appliedOverlaysClasses.forEach(className => {
248
- const nodes = _classPrivateFieldGet(this, _activeOverlaysWot).wtTable.TABLE.querySelectorAll(`.${className}`);
249
- for (let i = 0, len = nodes.length; i < len; i++) {
250
- removeClass(nodes[i], className);
251
- }
252
- });
253
- appliedOverlaysClasses.clear();
254
- }