handsontable 0.0.0-next-200799f-20240311 → 0.0.0-next-bff5041-20240315

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of handsontable might be problematic. Click here for more details.

Files changed (272) hide show
  1. package/3rdparty/walkontable/src/calculator/viewportColumns.js +12 -17
  2. package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +12 -17
  3. package/3rdparty/walkontable/src/calculator/viewportRows.js +10 -15
  4. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +10 -15
  5. package/3rdparty/walkontable/src/cell/coords.js +12 -17
  6. package/3rdparty/walkontable/src/cell/coords.mjs +12 -17
  7. package/3rdparty/walkontable/src/cell/range.d.ts +0 -1
  8. package/3rdparty/walkontable/src/cell/range.js +23 -45
  9. package/3rdparty/walkontable/src/cell/range.mjs +23 -45
  10. package/3rdparty/walkontable/src/core/_base.js +1 -1
  11. package/3rdparty/walkontable/src/core/_base.mjs +1 -1
  12. package/3rdparty/walkontable/src/event.js +72 -104
  13. package/3rdparty/walkontable/src/event.mjs +72 -104
  14. package/3rdparty/walkontable/src/overlays.js +1 -1
  15. package/3rdparty/walkontable/src/overlays.mjs +1 -1
  16. package/3rdparty/walkontable/src/scroll.js +15 -17
  17. package/3rdparty/walkontable/src/scroll.mjs +15 -17
  18. package/3rdparty/walkontable/src/selection/manager.js +48 -69
  19. package/3rdparty/walkontable/src/selection/manager.mjs +48 -69
  20. package/3rdparty/walkontable/src/selection/scanner.js +33 -42
  21. package/3rdparty/walkontable/src/selection/scanner.mjs +33 -42
  22. package/3rdparty/walkontable/src/utils/columnStretching.js +27 -44
  23. package/3rdparty/walkontable/src/utils/columnStretching.mjs +27 -44
  24. package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
  25. package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
  26. package/base.js +2 -2
  27. package/base.mjs +2 -2
  28. package/core/viewportScroll/index.js +1 -4
  29. package/core/viewportScroll/index.mjs +1 -4
  30. package/core.d.ts +3 -4
  31. package/core.js +22 -79
  32. package/core.mjs +22 -79
  33. package/dataMap/dataSource.js +1 -1
  34. package/dataMap/dataSource.mjs +1 -1
  35. package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
  36. package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
  37. package/dataMap/replaceData.js +1 -1
  38. package/dataMap/replaceData.mjs +1 -1
  39. package/dist/handsontable.css +2 -2
  40. package/dist/handsontable.full.css +2 -2
  41. package/dist/handsontable.full.js +7620 -10327
  42. package/dist/handsontable.full.min.css +2 -2
  43. package/dist/handsontable.full.min.js +277 -277
  44. package/dist/handsontable.js +5525 -7779
  45. package/dist/handsontable.min.css +2 -2
  46. package/dist/handsontable.min.js +33 -33
  47. package/dist/languages/all.min.js +1 -1
  48. package/dist/languages/ar-AR.min.js +1 -1
  49. package/dist/languages/cs-CZ.min.js +1 -1
  50. package/dist/languages/de-CH.min.js +1 -1
  51. package/dist/languages/de-DE.min.js +1 -1
  52. package/dist/languages/en-US.min.js +1 -1
  53. package/dist/languages/es-MX.min.js +1 -1
  54. package/dist/languages/fr-FR.min.js +1 -1
  55. package/dist/languages/hr-HR.min.js +1 -1
  56. package/dist/languages/it-IT.min.js +1 -1
  57. package/dist/languages/ja-JP.min.js +1 -1
  58. package/dist/languages/ko-KR.min.js +1 -1
  59. package/dist/languages/lv-LV.min.js +1 -1
  60. package/dist/languages/nb-NO.min.js +1 -1
  61. package/dist/languages/nl-NL.min.js +1 -1
  62. package/dist/languages/pl-PL.min.js +1 -1
  63. package/dist/languages/pt-BR.min.js +1 -1
  64. package/dist/languages/ru-RU.min.js +1 -1
  65. package/dist/languages/sr-SP.min.js +1 -1
  66. package/dist/languages/zh-CN.min.js +1 -1
  67. package/dist/languages/zh-TW.min.js +1 -1
  68. package/editorManager.js +21 -27
  69. package/editorManager.mjs +21 -27
  70. package/editors/autocompleteEditor/autocompleteEditor.js +6 -10
  71. package/editors/autocompleteEditor/autocompleteEditor.mjs +6 -10
  72. package/eventManager.js +1 -1
  73. package/eventManager.mjs +1 -1
  74. package/focusManager.js +58 -82
  75. package/focusManager.mjs +58 -82
  76. package/helpers/dom/element.js +1 -1
  77. package/helpers/dom/element.mjs +1 -1
  78. package/helpers/mixed.js +1 -1
  79. package/helpers/mixed.mjs +1 -1
  80. package/helpers/object.js +2 -2
  81. package/helpers/object.mjs +2 -2
  82. package/index.d.ts +10 -0
  83. package/package.json +2 -1
  84. package/pluginHooks.d.ts +0 -4
  85. package/pluginHooks.js +2 -44
  86. package/pluginHooks.mjs +2 -44
  87. package/plugins/autoColumnSize/autoColumnSize.js +49 -65
  88. package/plugins/autoColumnSize/autoColumnSize.mjs +49 -65
  89. package/plugins/autoRowSize/autoRowSize.js +28 -34
  90. package/plugins/autoRowSize/autoRowSize.mjs +28 -34
  91. package/plugins/autofill/autofill.js +30 -38
  92. package/plugins/autofill/autofill.mjs +30 -38
  93. package/plugins/base/base.js +12 -17
  94. package/plugins/base/base.mjs +12 -17
  95. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
  96. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
  97. package/plugins/collapsibleColumns/collapsibleColumns.js +36 -54
  98. package/plugins/collapsibleColumns/collapsibleColumns.mjs +36 -54
  99. package/plugins/columnSorting/columnSorting.js +40 -46
  100. package/plugins/columnSorting/columnSorting.mjs +40 -46
  101. package/plugins/columnSummary/columnSummary.js +22 -26
  102. package/plugins/columnSummary/columnSummary.mjs +22 -26
  103. package/plugins/comments/comments.js +116 -158
  104. package/plugins/comments/comments.mjs +116 -158
  105. package/plugins/contextMenu/contextMenu.js +20 -26
  106. package/plugins/contextMenu/contextMenu.mjs +20 -26
  107. package/plugins/contextMenu/itemsFactory.js +1 -1
  108. package/plugins/contextMenu/itemsFactory.mjs +1 -1
  109. package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
  110. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
  111. package/plugins/contextMenu/menu/menu.js +13 -21
  112. package/plugins/contextMenu/menu/menu.mjs +13 -21
  113. package/plugins/contextMenu/menu/positioner.js +41 -58
  114. package/plugins/contextMenu/menu/positioner.mjs +41 -58
  115. package/plugins/copyPaste/copyPaste.js +113 -154
  116. package/plugins/copyPaste/copyPaste.mjs +113 -154
  117. package/plugins/copyPaste/copyableRanges.js +43 -66
  118. package/plugins/copyPaste/copyableRanges.mjs +43 -66
  119. package/plugins/customBorders/customBorders.js +11 -13
  120. package/plugins/customBorders/customBorders.mjs +11 -13
  121. package/plugins/dragToScroll/dragToScroll.js +6 -6
  122. package/plugins/dragToScroll/dragToScroll.mjs +6 -6
  123. package/plugins/dropdownMenu/dropdownMenu.js +78 -100
  124. package/plugins/dropdownMenu/dropdownMenu.mjs +78 -100
  125. package/plugins/exportFile/dataProvider.js +1 -1
  126. package/plugins/exportFile/dataProvider.mjs +1 -1
  127. package/plugins/filters/component/actionBar.js +9 -9
  128. package/plugins/filters/component/actionBar.mjs +8 -8
  129. package/plugins/filters/component/condition.js +13 -15
  130. package/plugins/filters/component/condition.mjs +13 -15
  131. package/plugins/filters/component/operators.js +6 -6
  132. package/plugins/filters/component/operators.mjs +6 -6
  133. package/plugins/filters/component/value.js +24 -28
  134. package/plugins/filters/component/value.mjs +24 -28
  135. package/plugins/filters/conditionUpdateObserver.js +22 -24
  136. package/plugins/filters/conditionUpdateObserver.mjs +22 -24
  137. package/plugins/filters/dataFilter.js +1 -1
  138. package/plugins/filters/dataFilter.mjs +1 -1
  139. package/plugins/filters/filters.js +81 -95
  140. package/plugins/filters/filters.mjs +81 -95
  141. package/plugins/filters/ui/input.js +13 -19
  142. package/plugins/filters/ui/input.mjs +13 -19
  143. package/plugins/filters/ui/link.js +8 -13
  144. package/plugins/filters/ui/link.mjs +8 -13
  145. package/plugins/filters/ui/multipleSelect.js +85 -112
  146. package/plugins/filters/ui/multipleSelect.mjs +85 -112
  147. package/plugins/filters/ui/radioInput.js +12 -20
  148. package/plugins/filters/ui/radioInput.mjs +12 -20
  149. package/plugins/filters/ui/select.js +50 -72
  150. package/plugins/filters/ui/select.mjs +49 -71
  151. package/plugins/formulas/formulas.js +268 -326
  152. package/plugins/formulas/formulas.mjs +269 -327
  153. package/plugins/formulas/indexSyncer/axisSyncer.js +38 -61
  154. package/plugins/formulas/indexSyncer/axisSyncer.mjs +38 -61
  155. package/plugins/formulas/indexSyncer/index.js +25 -48
  156. package/plugins/formulas/indexSyncer/index.mjs +25 -48
  157. package/plugins/hiddenColumns/hiddenColumns.js +64 -83
  158. package/plugins/hiddenColumns/hiddenColumns.mjs +64 -83
  159. package/plugins/hiddenRows/hiddenRows.js +63 -82
  160. package/plugins/hiddenRows/hiddenRows.mjs +63 -82
  161. package/plugins/manualColumnFreeze/manualColumnFreeze.js +24 -32
  162. package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +25 -33
  163. package/plugins/manualColumnMove/manualColumnMove.js +126 -170
  164. package/plugins/manualColumnMove/manualColumnMove.mjs +126 -170
  165. package/plugins/manualColumnResize/manualColumnResize.js +169 -230
  166. package/plugins/manualColumnResize/manualColumnResize.mjs +169 -230
  167. package/plugins/manualRowMove/manualRowMove.js +99 -128
  168. package/plugins/manualRowMove/manualRowMove.mjs +99 -128
  169. package/plugins/manualRowResize/manualRowResize.js +150 -209
  170. package/plugins/manualRowResize/manualRowResize.mjs +150 -209
  171. package/plugins/mergeCells/calculations/selection.js +71 -2
  172. package/plugins/mergeCells/calculations/selection.mjs +71 -2
  173. package/plugins/mergeCells/cellsCollection.js +1 -117
  174. package/plugins/mergeCells/cellsCollection.mjs +1 -117
  175. package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
  176. package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
  177. package/plugins/mergeCells/mergeCells.js +355 -595
  178. package/plugins/mergeCells/mergeCells.mjs +355 -595
  179. package/plugins/multiColumnSorting/multiColumnSorting.js +0 -6
  180. package/plugins/multiColumnSorting/multiColumnSorting.mjs +0 -6
  181. package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
  182. package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
  183. package/plugins/nestedHeaders/nestedHeaders.js +204 -254
  184. package/plugins/nestedHeaders/nestedHeaders.mjs +205 -255
  185. package/plugins/nestedHeaders/stateManager/headersTree.js +21 -32
  186. package/plugins/nestedHeaders/stateManager/headersTree.mjs +21 -32
  187. package/plugins/nestedHeaders/stateManager/index.js +30 -41
  188. package/plugins/nestedHeaders/stateManager/index.mjs +30 -41
  189. package/plugins/nestedHeaders/stateManager/sourceSettings.js +19 -30
  190. package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +19 -30
  191. package/plugins/nestedRows/data/dataManager.js +1 -1
  192. package/plugins/nestedRows/data/dataManager.mjs +1 -1
  193. package/plugins/nestedRows/nestedRows.js +138 -179
  194. package/plugins/nestedRows/nestedRows.mjs +139 -180
  195. package/plugins/nestedRows/ui/contextMenu.js +11 -15
  196. package/plugins/nestedRows/ui/contextMenu.mjs +10 -14
  197. package/plugins/nestedRows/utils/rowMoveController.js +1 -1
  198. package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
  199. package/plugins/persistentState/storage.js +2 -2
  200. package/plugins/persistentState/storage.mjs +2 -2
  201. package/plugins/search/search.js +7 -7
  202. package/plugins/search/search.mjs +7 -7
  203. package/plugins/touchScroll/touchScroll.js +15 -19
  204. package/plugins/touchScroll/touchScroll.mjs +16 -20
  205. package/plugins/trimRows/trimRows.js +6 -6
  206. package/plugins/trimRows/trimRows.mjs +6 -6
  207. package/renderers/checkboxRenderer/checkboxRenderer.js +4 -4
  208. package/renderers/checkboxRenderer/checkboxRenderer.mjs +4 -4
  209. package/selection/highlight/highlight.js +14 -14
  210. package/selection/highlight/highlight.mjs +13 -13
  211. package/selection/highlight/visualSelection.js +2 -16
  212. package/selection/highlight/visualSelection.mjs +2 -16
  213. package/selection/selection.js +60 -252
  214. package/selection/selection.mjs +59 -251
  215. package/selection/transformation.js +101 -175
  216. package/selection/transformation.mjs +101 -175
  217. package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
  218. package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
  219. package/shortcutContexts/commands/editor/open.js +3 -18
  220. package/shortcutContexts/commands/editor/open.mjs +3 -18
  221. package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
  222. package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
  223. package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
  224. package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
  225. package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
  226. package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
  227. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
  228. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
  229. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
  230. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
  231. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
  232. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
  233. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
  234. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
  235. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
  236. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
  237. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
  238. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
  239. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
  240. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
  241. package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
  242. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
  243. package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
  244. package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
  245. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
  246. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
  247. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
  248. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
  249. package/shortcutContexts/grid.js +2 -2
  250. package/shortcutContexts/grid.mjs +2 -2
  251. package/shortcuts/context.js +1 -2
  252. package/shortcuts/context.mjs +1 -2
  253. package/tableView.js +52 -98
  254. package/tableView.mjs +52 -98
  255. package/translations/changesObservable/observable.js +21 -38
  256. package/translations/changesObservable/observable.mjs +21 -38
  257. package/translations/changesObservable/observer.js +7 -12
  258. package/translations/changesObservable/observer.mjs +6 -11
  259. package/translations/mapCollections/aggregatedCollection.js +1 -1
  260. package/translations/mapCollections/aggregatedCollection.mjs +1 -1
  261. package/translations/maps/indexMap.js +1 -1
  262. package/translations/maps/indexMap.mjs +1 -1
  263. package/utils/dataStructures/linkedList.js +1 -6
  264. package/utils/dataStructures/linkedList.mjs +1 -6
  265. package/utils/dataStructures/tree.js +1 -1
  266. package/utils/dataStructures/tree.mjs +1 -1
  267. package/utils/interval.js +26 -44
  268. package/utils/interval.mjs +26 -44
  269. package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
  270. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
  271. package/plugins/mergeCells/focusOrder.js +0 -258
  272. package/plugins/mergeCells/focusOrder.mjs +0 -253
@@ -4,7 +4,7 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
7
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
8
8
  import { BasePlugin } from "../base/index.mjs";
9
9
  import LooseBindsMap from "./maps/looseBindsMap.mjs";
10
10
  import StrictBindsMap from "./maps/strictBindsMap.mjs";
@@ -45,7 +45,7 @@ const bindTypeToMapStrategy = new Map([['loose', LooseBindsMap], ['strict', Stri
45
45
  * ```
46
46
  * :::
47
47
  */
48
- var _onModifyRowHeader = /*#__PURE__*/new WeakSet();
48
+ var _BindRowsWithHeaders_brand = /*#__PURE__*/new WeakSet();
49
49
  export class BindRowsWithHeaders extends BasePlugin {
50
50
  constructor() {
51
51
  super(...arguments);
@@ -55,7 +55,7 @@ export class BindRowsWithHeaders extends BasePlugin {
55
55
  * @param {number} row Row index.
56
56
  * @returns {number}
57
57
  */
58
- _classPrivateMethodInitSpec(this, _onModifyRowHeader);
58
+ _classPrivateMethodInitSpec(this, _BindRowsWithHeaders_brand);
59
59
  /**
60
60
  * Plugin indexes cache.
61
61
  *
@@ -93,7 +93,7 @@ export class BindRowsWithHeaders extends BasePlugin {
93
93
  }
94
94
  const MapStrategy = bindTypeToMapStrategy.get(bindType);
95
95
  this.headerIndexes = this.hot.rowIndexMapper.registerMap('bindRowsWithHeaders', new MapStrategy());
96
- this.addHook('modifyRowHeader', row => _classPrivateMethodGet(this, _onModifyRowHeader, _onModifyRowHeader2).call(this, row));
96
+ this.addHook('modifyRowHeader', row => _assertClassBrand(_BindRowsWithHeaders_brand, this, _onModifyRowHeader).call(this, row));
97
97
  super.enablePlugin();
98
98
  }
99
99
 
@@ -111,6 +111,6 @@ export class BindRowsWithHeaders extends BasePlugin {
111
111
  super.destroy();
112
112
  }
113
113
  }
114
- function _onModifyRowHeader2(row) {
114
+ function _onModifyRowHeader(row) {
115
115
  return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(row));
116
116
  }
@@ -9,7 +9,6 @@ var _number = require("../../helpers/number");
9
9
  var _console = require("../../helpers/console");
10
10
  var _element = require("../../helpers/dom/element");
11
11
  var _event = require("../../helpers/dom/event");
12
- var _shortcutContexts = require("../../shortcutContexts");
13
12
  var _a11y = require("../../helpers/a11y");
14
13
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
15
14
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
@@ -17,12 +16,9 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
17
16
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
17
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
19
18
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
- function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
21
- function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
22
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
23
- function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
24
- function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
25
- 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
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
20
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
21
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
26
22
  const PLUGIN_KEY = exports.PLUGIN_KEY = 'collapsibleColumns';
27
23
  const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 290;
28
24
  const SETTING_KEYS = ['nestedHeaders'];
@@ -110,32 +106,10 @@ const actionDictionary = new Map([['collapse', {
110
106
  * :::
111
107
  */
112
108
  var _collapsedColumnsMap = /*#__PURE__*/new WeakMap();
113
- var _onAfterGetColHeader = /*#__PURE__*/new WeakSet();
114
- var _onBeforeOnCellMouseDown = /*#__PURE__*/new WeakSet();
115
- var _onInit = /*#__PURE__*/new WeakSet();
116
- var _onAfterLoadData = /*#__PURE__*/new WeakSet();
109
+ var _CollapsibleColumns_brand = /*#__PURE__*/new WeakSet();
117
110
  class CollapsibleColumns extends _base.BasePlugin {
118
111
  constructor() {
119
112
  super(...arguments);
120
- /**
121
- * Updates the plugin state after new dataset load.
122
- *
123
- * @param {Array[]} sourceData Array of arrays or array of objects containing data.
124
- * @param {boolean} initialLoad Flag that determines whether the data has been loaded
125
- * during the initialization.
126
- */
127
- _classPrivateMethodInitSpec(this, _onAfterLoadData);
128
- /**
129
- * Updates the plugin state after HoT initialization.
130
- */
131
- _classPrivateMethodInitSpec(this, _onInit);
132
- /**
133
- * Indicator mouse event callback.
134
- *
135
- * @param {object} event Mouse event.
136
- * @param {object} coords Event coordinates.
137
- */
138
- _classPrivateMethodInitSpec(this, _onBeforeOnCellMouseDown);
139
113
  /**
140
114
  * Adds the indicator to the headers.
141
115
  *
@@ -144,7 +118,7 @@ class CollapsibleColumns extends _base.BasePlugin {
144
118
  * @param {number} headerLevel The index of header level counting from the top (positive
145
119
  * values counting from 0 to N).
146
120
  */
147
- _classPrivateMethodInitSpec(this, _onAfterGetColHeader);
121
+ _classPrivateMethodInitSpec(this, _CollapsibleColumns_brand);
148
122
  /**
149
123
  * Cached reference to the NestedHeaders plugin.
150
124
  *
@@ -165,10 +139,7 @@ class CollapsibleColumns extends _base.BasePlugin {
165
139
  * @private
166
140
  * @type {HidingMap|null}
167
141
  */
168
- _classPrivateFieldInitSpec(this, _collapsedColumnsMap, {
169
- writable: true,
170
- value: null
171
- });
142
+ _classPrivateFieldInitSpec(this, _collapsedColumnsMap, null);
172
143
  }
173
144
  static get PLUGIN_KEY() {
174
145
  return PLUGIN_KEY;
@@ -206,23 +177,23 @@ class CollapsibleColumns extends _base.BasePlugin {
206
177
  if (!nestedHeaders) {
207
178
  (0, _console.warn)('You need to configure the Nested Headers plugin in order to use collapsible headers.');
208
179
  }
209
- _classPrivateFieldSet(this, _collapsedColumnsMap, this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName, 'hiding'));
180
+ _classPrivateFieldSet(_collapsedColumnsMap, this, this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName, 'hiding'));
210
181
  this.nestedHeadersPlugin = this.hot.getPlugin('nestedHeaders');
211
182
  this.headerStateManager = this.nestedHeadersPlugin.getStateManager();
212
- this.addHook('init', () => _classPrivateMethodGet(this, _onInit, _onInit2).call(this));
183
+ this.addHook('init', () => _assertClassBrand(_CollapsibleColumns_brand, this, _onInit).call(this));
213
184
  this.addHook('afterLoadData', function () {
214
185
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
215
186
  args[_key] = arguments[_key];
216
187
  }
217
- return _classPrivateMethodGet(_this, _onAfterLoadData, _onAfterLoadData2).call(_this, ...args);
188
+ return _assertClassBrand(_CollapsibleColumns_brand, _this, _onAfterLoadData).call(_this, ...args);
218
189
  });
219
190
  this.addHook('afterGetColHeader', function () {
220
191
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
221
192
  args[_key2] = arguments[_key2];
222
193
  }
223
- return _classPrivateMethodGet(_this, _onAfterGetColHeader, _onAfterGetColHeader2).call(_this, ...args);
194
+ return _assertClassBrand(_CollapsibleColumns_brand, _this, _onAfterGetColHeader).call(_this, ...args);
224
195
  });
225
- this.addHook('beforeOnCellMouseDown', (event, coords, TD) => _classPrivateMethodGet(this, _onBeforeOnCellMouseDown, _onBeforeOnCellMouseDown2).call(this, event, coords, TD));
196
+ this.addHook('beforeOnCellMouseDown', (event, coords, TD) => _assertClassBrand(_CollapsibleColumns_brand, this, _onBeforeOnCellMouseDown).call(this, event, coords, TD));
226
197
  this.registerShortcuts();
227
198
  super.enablePlugin();
228
199
  // @TODO: Workaround for broken plugin initialization abstraction (#6806).
@@ -269,7 +240,7 @@ class CollapsibleColumns extends _base.BasePlugin {
269
240
  */
270
241
  disablePlugin() {
271
242
  this.hot.columnIndexMapper.unregisterMap(this.pluginName);
272
- _classPrivateFieldSet(this, _collapsedColumnsMap, null);
243
+ _classPrivateFieldSet(_collapsedColumnsMap, this, null);
273
244
  this.nestedHeadersPlugin = null;
274
245
  this.unregisterShortcuts();
275
246
  this.clearButtons();
@@ -309,17 +280,12 @@ class CollapsibleColumns extends _base.BasePlugin {
309
280
  col: columnIndex
310
281
  });
311
282
  }
312
-
313
- // prevent default Enter behavior (move to the next row within a selection range)
314
- return false;
315
283
  },
316
284
  runOnlyIf: () => {
317
285
  var _this$hot$getSelected;
318
286
  return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
319
287
  },
320
- group: SHORTCUTS_GROUP,
321
- relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
322
- position: 'before'
288
+ group: SHORTCUTS_GROUP
323
289
  });
324
290
  }
325
291
 
@@ -503,7 +469,7 @@ class CollapsibleColumns extends _base.BasePlugin {
503
469
  }
504
470
  this.hot.batchExecution(() => {
505
471
  (0, _array.arrayEach)(affectedColumnsIndexes, visualColumn => {
506
- _classPrivateFieldGet(this, _collapsedColumnsMap).setValueAtIndex(this.hot.toPhysicalColumn(visualColumn), actionTranslator.hideColumn);
472
+ _classPrivateFieldGet(_collapsedColumnsMap, this).setValueAtIndex(this.hot.toPhysicalColumn(visualColumn), actionTranslator.hideColumn);
507
473
  });
508
474
  }, true);
509
475
  const isActionPerformed = this.getCollapsedColumns().length !== currentCollapsedColumns.length;
@@ -519,18 +485,18 @@ class CollapsibleColumns extends _base.BasePlugin {
519
485
  * @returns {number[]}
520
486
  */
521
487
  getCollapsedColumns() {
522
- return _classPrivateFieldGet(this, _collapsedColumnsMap).getHiddenIndexes();
488
+ return _classPrivateFieldGet(_collapsedColumnsMap, this).getHiddenIndexes();
523
489
  }
524
490
  /**
525
491
  * Destroys the plugin instance.
526
492
  */
527
493
  destroy() {
528
- _classPrivateFieldSet(this, _collapsedColumnsMap, null);
494
+ _classPrivateFieldSet(_collapsedColumnsMap, this, null);
529
495
  super.destroy();
530
496
  }
531
497
  }
532
498
  exports.CollapsibleColumns = CollapsibleColumns;
533
- function _onAfterGetColHeader2(column, TH, headerLevel) {
499
+ function _onAfterGetColHeader(column, TH, headerLevel) {
534
500
  var _this$headerStateMana3;
535
501
  const {
536
502
  collapsible,
@@ -573,7 +539,13 @@ function _onAfterGetColHeader2(column, TH, headerLevel) {
573
539
  (_collapsibleElement = collapsibleElement) === null || _collapsibleElement === void 0 || _collapsibleElement.remove();
574
540
  }
575
541
  }
576
- function _onBeforeOnCellMouseDown2(event, coords) {
542
+ /**
543
+ * Indicator mouse event callback.
544
+ *
545
+ * @param {object} event Mouse event.
546
+ * @param {object} coords Event coordinates.
547
+ */
548
+ function _onBeforeOnCellMouseDown(event, coords) {
577
549
  if ((0, _element.hasClass)(event.target, COLLAPSIBLE_ELEMENT_CLASS)) {
578
550
  if ((0, _element.hasClass)(event.target, 'expanded')) {
579
551
  this.eventManager.fireEvent(event.target, 'mouseup');
@@ -585,11 +557,21 @@ function _onBeforeOnCellMouseDown2(event, coords) {
585
557
  (0, _event.stopImmediatePropagation)(event);
586
558
  }
587
559
  }
588
- function _onInit2() {
560
+ /**
561
+ * Updates the plugin state after HoT initialization.
562
+ */
563
+ function _onInit() {
589
564
  // @TODO: Workaround for broken plugin initialization abstraction (#6806).
590
565
  this.updatePlugin();
591
566
  }
592
- function _onAfterLoadData2(sourceData, initialLoad) {
567
+ /**
568
+ * Updates the plugin state after new dataset load.
569
+ *
570
+ * @param {Array[]} sourceData Array of arrays or array of objects containing data.
571
+ * @param {boolean} initialLoad Flag that determines whether the data has been loaded
572
+ * during the initialization.
573
+ */
574
+ function _onAfterLoadData(sourceData, initialLoad) {
593
575
  if (!initialLoad) {
594
576
  this.updatePlugin();
595
577
  }
@@ -6,19 +6,15 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
6
6
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
7
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
8
8
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
- function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
10
- function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
11
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
12
- function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
13
- function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
14
- 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; } }
9
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
10
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
11
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
15
12
  import { BasePlugin } from "../base/index.mjs";
16
13
  import { arrayEach, arrayFilter, arrayUnique } from "../../helpers/array.mjs";
17
14
  import { rangeEach } from "../../helpers/number.mjs";
18
15
  import { warn } from "../../helpers/console.mjs";
19
16
  import { addClass, hasClass, removeClass, fastInnerText, removeAttribute, setAttribute } from "../../helpers/dom/element.mjs";
20
17
  import { stopImmediatePropagation } from "../../helpers/dom/event.mjs";
21
- import { EDITOR_EDIT_GROUP as SHORTCUTS_GROUP_EDITOR } from "../../shortcutContexts/index.mjs";
22
18
  import { A11Y_EXPANDED, A11Y_HIDDEN } from "../../helpers/a11y.mjs";
23
19
  export const PLUGIN_KEY = 'collapsibleColumns';
24
20
  export const PLUGIN_PRIORITY = 290;
@@ -107,32 +103,10 @@ const actionDictionary = new Map([['collapse', {
107
103
  * :::
108
104
  */
109
105
  var _collapsedColumnsMap = /*#__PURE__*/new WeakMap();
110
- var _onAfterGetColHeader = /*#__PURE__*/new WeakSet();
111
- var _onBeforeOnCellMouseDown = /*#__PURE__*/new WeakSet();
112
- var _onInit = /*#__PURE__*/new WeakSet();
113
- var _onAfterLoadData = /*#__PURE__*/new WeakSet();
106
+ var _CollapsibleColumns_brand = /*#__PURE__*/new WeakSet();
114
107
  export class CollapsibleColumns extends BasePlugin {
115
108
  constructor() {
116
109
  super(...arguments);
117
- /**
118
- * Updates the plugin state after new dataset load.
119
- *
120
- * @param {Array[]} sourceData Array of arrays or array of objects containing data.
121
- * @param {boolean} initialLoad Flag that determines whether the data has been loaded
122
- * during the initialization.
123
- */
124
- _classPrivateMethodInitSpec(this, _onAfterLoadData);
125
- /**
126
- * Updates the plugin state after HoT initialization.
127
- */
128
- _classPrivateMethodInitSpec(this, _onInit);
129
- /**
130
- * Indicator mouse event callback.
131
- *
132
- * @param {object} event Mouse event.
133
- * @param {object} coords Event coordinates.
134
- */
135
- _classPrivateMethodInitSpec(this, _onBeforeOnCellMouseDown);
136
110
  /**
137
111
  * Adds the indicator to the headers.
138
112
  *
@@ -141,7 +115,7 @@ export class CollapsibleColumns extends BasePlugin {
141
115
  * @param {number} headerLevel The index of header level counting from the top (positive
142
116
  * values counting from 0 to N).
143
117
  */
144
- _classPrivateMethodInitSpec(this, _onAfterGetColHeader);
118
+ _classPrivateMethodInitSpec(this, _CollapsibleColumns_brand);
145
119
  /**
146
120
  * Cached reference to the NestedHeaders plugin.
147
121
  *
@@ -162,10 +136,7 @@ export class CollapsibleColumns extends BasePlugin {
162
136
  * @private
163
137
  * @type {HidingMap|null}
164
138
  */
165
- _classPrivateFieldInitSpec(this, _collapsedColumnsMap, {
166
- writable: true,
167
- value: null
168
- });
139
+ _classPrivateFieldInitSpec(this, _collapsedColumnsMap, null);
169
140
  }
170
141
  static get PLUGIN_KEY() {
171
142
  return PLUGIN_KEY;
@@ -203,23 +174,23 @@ export class CollapsibleColumns extends BasePlugin {
203
174
  if (!nestedHeaders) {
204
175
  warn('You need to configure the Nested Headers plugin in order to use collapsible headers.');
205
176
  }
206
- _classPrivateFieldSet(this, _collapsedColumnsMap, this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName, 'hiding'));
177
+ _classPrivateFieldSet(_collapsedColumnsMap, this, this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName, 'hiding'));
207
178
  this.nestedHeadersPlugin = this.hot.getPlugin('nestedHeaders');
208
179
  this.headerStateManager = this.nestedHeadersPlugin.getStateManager();
209
- this.addHook('init', () => _classPrivateMethodGet(this, _onInit, _onInit2).call(this));
180
+ this.addHook('init', () => _assertClassBrand(_CollapsibleColumns_brand, this, _onInit).call(this));
210
181
  this.addHook('afterLoadData', function () {
211
182
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
212
183
  args[_key] = arguments[_key];
213
184
  }
214
- return _classPrivateMethodGet(_this, _onAfterLoadData, _onAfterLoadData2).call(_this, ...args);
185
+ return _assertClassBrand(_CollapsibleColumns_brand, _this, _onAfterLoadData).call(_this, ...args);
215
186
  });
216
187
  this.addHook('afterGetColHeader', function () {
217
188
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
218
189
  args[_key2] = arguments[_key2];
219
190
  }
220
- return _classPrivateMethodGet(_this, _onAfterGetColHeader, _onAfterGetColHeader2).call(_this, ...args);
191
+ return _assertClassBrand(_CollapsibleColumns_brand, _this, _onAfterGetColHeader).call(_this, ...args);
221
192
  });
222
- this.addHook('beforeOnCellMouseDown', (event, coords, TD) => _classPrivateMethodGet(this, _onBeforeOnCellMouseDown, _onBeforeOnCellMouseDown2).call(this, event, coords, TD));
193
+ this.addHook('beforeOnCellMouseDown', (event, coords, TD) => _assertClassBrand(_CollapsibleColumns_brand, this, _onBeforeOnCellMouseDown).call(this, event, coords, TD));
223
194
  this.registerShortcuts();
224
195
  super.enablePlugin();
225
196
  // @TODO: Workaround for broken plugin initialization abstraction (#6806).
@@ -266,7 +237,7 @@ export class CollapsibleColumns extends BasePlugin {
266
237
  */
267
238
  disablePlugin() {
268
239
  this.hot.columnIndexMapper.unregisterMap(this.pluginName);
269
- _classPrivateFieldSet(this, _collapsedColumnsMap, null);
240
+ _classPrivateFieldSet(_collapsedColumnsMap, this, null);
270
241
  this.nestedHeadersPlugin = null;
271
242
  this.unregisterShortcuts();
272
243
  this.clearButtons();
@@ -306,17 +277,12 @@ export class CollapsibleColumns extends BasePlugin {
306
277
  col: columnIndex
307
278
  });
308
279
  }
309
-
310
- // prevent default Enter behavior (move to the next row within a selection range)
311
- return false;
312
280
  },
313
281
  runOnlyIf: () => {
314
282
  var _this$hot$getSelected;
315
283
  return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
316
284
  },
317
- group: SHORTCUTS_GROUP,
318
- relativeToGroup: SHORTCUTS_GROUP_EDITOR,
319
- position: 'before'
285
+ group: SHORTCUTS_GROUP
320
286
  });
321
287
  }
322
288
 
@@ -500,7 +466,7 @@ export class CollapsibleColumns extends BasePlugin {
500
466
  }
501
467
  this.hot.batchExecution(() => {
502
468
  arrayEach(affectedColumnsIndexes, visualColumn => {
503
- _classPrivateFieldGet(this, _collapsedColumnsMap).setValueAtIndex(this.hot.toPhysicalColumn(visualColumn), actionTranslator.hideColumn);
469
+ _classPrivateFieldGet(_collapsedColumnsMap, this).setValueAtIndex(this.hot.toPhysicalColumn(visualColumn), actionTranslator.hideColumn);
504
470
  });
505
471
  }, true);
506
472
  const isActionPerformed = this.getCollapsedColumns().length !== currentCollapsedColumns.length;
@@ -516,17 +482,17 @@ export class CollapsibleColumns extends BasePlugin {
516
482
  * @returns {number[]}
517
483
  */
518
484
  getCollapsedColumns() {
519
- return _classPrivateFieldGet(this, _collapsedColumnsMap).getHiddenIndexes();
485
+ return _classPrivateFieldGet(_collapsedColumnsMap, this).getHiddenIndexes();
520
486
  }
521
487
  /**
522
488
  * Destroys the plugin instance.
523
489
  */
524
490
  destroy() {
525
- _classPrivateFieldSet(this, _collapsedColumnsMap, null);
491
+ _classPrivateFieldSet(_collapsedColumnsMap, this, null);
526
492
  super.destroy();
527
493
  }
528
494
  }
529
- function _onAfterGetColHeader2(column, TH, headerLevel) {
495
+ function _onAfterGetColHeader(column, TH, headerLevel) {
530
496
  var _this$headerStateMana3;
531
497
  const {
532
498
  collapsible,
@@ -569,7 +535,13 @@ function _onAfterGetColHeader2(column, TH, headerLevel) {
569
535
  (_collapsibleElement = collapsibleElement) === null || _collapsibleElement === void 0 || _collapsibleElement.remove();
570
536
  }
571
537
  }
572
- function _onBeforeOnCellMouseDown2(event, coords) {
538
+ /**
539
+ * Indicator mouse event callback.
540
+ *
541
+ * @param {object} event Mouse event.
542
+ * @param {object} coords Event coordinates.
543
+ */
544
+ function _onBeforeOnCellMouseDown(event, coords) {
573
545
  if (hasClass(event.target, COLLAPSIBLE_ELEMENT_CLASS)) {
574
546
  if (hasClass(event.target, 'expanded')) {
575
547
  this.eventManager.fireEvent(event.target, 'mouseup');
@@ -581,11 +553,21 @@ function _onBeforeOnCellMouseDown2(event, coords) {
581
553
  stopImmediatePropagation(event);
582
554
  }
583
555
  }
584
- function _onInit2() {
556
+ /**
557
+ * Updates the plugin state after HoT initialization.
558
+ */
559
+ function _onInit() {
585
560
  // @TODO: Workaround for broken plugin initialization abstraction (#6806).
586
561
  this.updatePlugin();
587
562
  }
588
- function _onAfterLoadData2(sourceData, initialLoad) {
563
+ /**
564
+ * Updates the plugin state after new dataset load.
565
+ *
566
+ * @param {Array[]} sourceData Array of arrays or array of objects containing data.
567
+ * @param {boolean} initialLoad Flag that determines whether the data has been loaded
568
+ * during the initialization.
569
+ */
570
+ function _onAfterLoadData(sourceData, initialLoad) {
589
571
  if (!initialLoad) {
590
572
  this.updatePlugin();
591
573
  }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- require("core-js/modules/es.array.push.js");
5
4
  require("core-js/modules/es.error.cause.js");
5
+ require("core-js/modules/es.array.push.js");
6
6
  var _element = require("../../helpers/dom/element");
7
7
  var _mixed = require("../../helpers/mixed");
8
8
  var _object = require("../../helpers/object");
@@ -12,7 +12,6 @@ var _base = require("../base");
12
12
  var _translations = require("../../translations");
13
13
  var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
14
14
  var _columnStatesManager = require("./columnStatesManager");
15
- var _shortcutContexts = require("../../shortcutContexts");
16
15
  var _utils = require("./utils");
17
16
  var _domHelpers = require("./domHelpers");
18
17
  var _rootComparator = require("./rootComparator");
@@ -24,7 +23,7 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
24
23
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25
24
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
26
25
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
27
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
26
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
28
27
  const PLUGIN_KEY = exports.PLUGIN_KEY = 'columnSorting';
29
28
  const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 50;
30
29
  const APPEND_COLUMN_CONFIG_STRATEGY = exports.APPEND_COLUMN_CONFIG_STRATEGY = 'append';
@@ -84,40 +83,14 @@ _pluginHooks.default.getSingleton().register('afterColumnSort');
84
83
  * }]
85
84
  * ```
86
85
  */
87
- var _loadOrSortBySettings = /*#__PURE__*/new WeakSet();
88
- var _onAfterGetColHeader = /*#__PURE__*/new WeakSet();
89
- var _onAfterLoadData = /*#__PURE__*/new WeakSet();
90
- var _onBeforeOnCellMouseDown = /*#__PURE__*/new WeakSet();
86
+ var _ColumnSorting_brand = /*#__PURE__*/new WeakSet();
91
87
  class ColumnSorting extends _base.BasePlugin {
92
88
  constructor() {
93
89
  super(...arguments);
94
- /**
95
- * Changes the behavior of selection / dragging.
96
- *
97
- * @param {MouseEvent} event The `mousedown` event.
98
- * @param {CellCoords} coords Visual coordinates.
99
- * @param {HTMLElement} TD The cell element.
100
- * @param {object} controller An object with properties `row`, `column` and `cell`. Each property contains
101
- * a boolean value that allows or disallows changing the selection for that particular area.
102
- */
103
- _classPrivateMethodInitSpec(this, _onBeforeOnCellMouseDown);
104
- /**
105
- * Callback for the `afterLoadData` hook.
106
- *
107
- * @param {boolean} initialLoad Flag that determines whether the data has been loaded during the initialization.
108
- */
109
- _classPrivateMethodInitSpec(this, _onAfterLoadData);
110
- /**
111
- * Callback for the `onAfterGetColHeader` hook. Adds column sorting CSS classes.
112
- *
113
- * @param {number} column Visual column index.
114
- * @param {Element} TH TH HTML element.
115
- */
116
- _classPrivateMethodInitSpec(this, _onAfterGetColHeader);
117
90
  /**
118
91
  * Load saved settings or sort by predefined plugin configuration.
119
92
  */
120
- _classPrivateMethodInitSpec(this, _loadOrSortBySettings);
93
+ _classPrivateMethodInitSpec(this, _ColumnSorting_brand);
121
94
  /**
122
95
  * Instance of column state manager.
123
96
  *
@@ -180,25 +153,25 @@ class ColumnSorting extends _base.BasePlugin {
180
153
  return this.getMergedPluginSettings(visualIndex);
181
154
  });
182
155
  this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`, this.columnMetaCache);
183
- this.addHook('afterGetColHeader', (column, TH) => _classPrivateMethodGet(this, _onAfterGetColHeader, _onAfterGetColHeader2).call(this, column, TH));
156
+ this.addHook('afterGetColHeader', (column, TH) => _assertClassBrand(_ColumnSorting_brand, this, _onAfterGetColHeader).call(this, column, TH));
184
157
  this.addHook('beforeOnCellMouseDown', function () {
185
158
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
186
159
  args[_key] = arguments[_key];
187
160
  }
188
- return _classPrivateMethodGet(_this, _onBeforeOnCellMouseDown, _onBeforeOnCellMouseDown2).call(_this, ...args);
161
+ return _assertClassBrand(_ColumnSorting_brand, _this, _onBeforeOnCellMouseDown).call(_this, ...args);
189
162
  });
190
163
  this.addHook('afterOnCellMouseDown', (event, target) => this.onAfterOnCellMouseDown(event, target));
191
- this.addHook('afterInit', () => _classPrivateMethodGet(this, _loadOrSortBySettings, _loadOrSortBySettings2).call(this));
164
+ this.addHook('afterInit', () => _assertClassBrand(_ColumnSorting_brand, this, _loadOrSortBySettings).call(this));
192
165
  this.addHook('afterLoadData', function () {
193
166
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
194
167
  args[_key2] = arguments[_key2];
195
168
  }
196
- return _classPrivateMethodGet(_this, _onAfterLoadData, _onAfterLoadData2).call(_this, ...args);
169
+ return _assertClassBrand(_ColumnSorting_brand, _this, _onAfterLoadData).call(_this, ...args);
197
170
  });
198
171
 
199
172
  // TODO: Workaround? It should be refactored / described.
200
173
  if (this.hot.view) {
201
- _classPrivateMethodGet(this, _loadOrSortBySettings, _loadOrSortBySettings2).call(this);
174
+ _assertClassBrand(_ColumnSorting_brand, this, _loadOrSortBySettings).call(this);
202
175
  }
203
176
  this.registerShortcuts();
204
177
  super.enablePlugin();
@@ -250,17 +223,12 @@ class ColumnSorting extends _base.BasePlugin {
250
223
  if (highlight.row === -1 && highlight.col >= 0) {
251
224
  this.sort(this.getColumnNextConfig(highlight.col));
252
225
  }
253
-
254
- // prevent default Enter behavior (move to the next row within a selection range)
255
- return false;
256
226
  },
257
227
  runOnlyIf: () => {
258
228
  var _this$hot$getSelected;
259
229
  const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
260
230
  return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
261
231
  },
262
- relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
263
- position: 'before',
264
232
  group: SHORTCUTS_GROUP
265
233
  });
266
234
  }
@@ -660,6 +628,14 @@ class ColumnSorting extends _base.BasePlugin {
660
628
  this.hot.render();
661
629
  }
662
630
  }
631
+
632
+ /**
633
+ * Callback for the `onAfterGetColHeader` hook. Adds column sorting CSS classes.
634
+ *
635
+ * @param {number} column Visual column index.
636
+ * @param {Element} TH TH HTML element.
637
+ */
638
+
663
639
  /**
664
640
  * Update header classes.
665
641
  *
@@ -694,6 +670,13 @@ class ColumnSorting extends _base.BasePlugin {
694
670
  this.sortBySettings(newSettings[this.pluginKey]);
695
671
  }
696
672
  }
673
+
674
+ /**
675
+ * Callback for the `afterLoadData` hook.
676
+ *
677
+ * @param {boolean} initialLoad Flag that determines whether the data has been loaded during the initialization.
678
+ */
679
+
697
680
  /**
698
681
  * Indicates if clickable header was clicked.
699
682
  *
@@ -707,6 +690,17 @@ class ColumnSorting extends _base.BasePlugin {
707
690
  const headerActionEnabled = pluginSettingsForColumn.headerAction;
708
691
  return headerActionEnabled && (0, _element.hasClass)(event.target, _utils.HEADER_SPAN_CLASS);
709
692
  }
693
+
694
+ /**
695
+ * Changes the behavior of selection / dragging.
696
+ *
697
+ * @param {MouseEvent} event The `mousedown` event.
698
+ * @param {CellCoords} coords Visual coordinates.
699
+ * @param {HTMLElement} TD The cell element.
700
+ * @param {object} controller An object with properties `row`, `column` and `cell`. Each property contains
701
+ * a boolean value that allows or disallows changing the selection for that particular area.
702
+ */
703
+
710
704
  /**
711
705
  * Callback for the `onAfterOnCellMouseDown` hook.
712
706
  *
@@ -739,7 +733,7 @@ class ColumnSorting extends _base.BasePlugin {
739
733
  }
740
734
  }
741
735
  exports.ColumnSorting = ColumnSorting;
742
- function _loadOrSortBySettings2() {
736
+ function _loadOrSortBySettings() {
743
737
  const storedAllSortSettings = this.getAllSavedSortSettings();
744
738
  if ((0, _object.isObject)(storedAllSortSettings)) {
745
739
  this.sortBySettings(storedAllSortSettings);
@@ -748,7 +742,7 @@ function _loadOrSortBySettings2() {
748
742
  this.sortBySettings(allSortSettings);
749
743
  }
750
744
  }
751
- function _onAfterGetColHeader2(column, TH) {
745
+ function _onAfterGetColHeader(column, TH) {
752
746
  const headerSpanElement = (0, _utils.getHeaderSpanElement)(TH);
753
747
  if ((0, _utils.isFirstLevelColumnHeader)(column, TH) === false || headerSpanElement === null) {
754
748
  return;
@@ -762,15 +756,15 @@ function _onAfterGetColHeader2(column, TH) {
762
756
  (0, _element.setAttribute)(TH, ...(0, _a11y.A11Y_SORT)(currentSortState ? `${currentSortState}ending` : 'none'));
763
757
  }
764
758
  }
765
- function _onAfterLoadData2(initialLoad) {
759
+ function _onAfterLoadData(initialLoad) {
766
760
  if (initialLoad === true) {
767
761
  // TODO: Workaround? It should be refactored / described.
768
762
  if (this.hot.view) {
769
- _classPrivateMethodGet(this, _loadOrSortBySettings, _loadOrSortBySettings2).call(this);
763
+ _assertClassBrand(_ColumnSorting_brand, this, _loadOrSortBySettings).call(this);
770
764
  }
771
765
  }
772
766
  }
773
- function _onBeforeOnCellMouseDown2(event, coords, TD, controller) {
767
+ function _onBeforeOnCellMouseDown(event, coords, TD, controller) {
774
768
  if ((0, _utils.wasHeaderClickedProperly)(coords.row, coords.col, event) === false) {
775
769
  return;
776
770
  }