handsontable 0.0.0-next-bfb0e3a-20240403 → 0.0.0-next-5a535ed-20240403

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 (280) hide show
  1. package/3rdparty/walkontable/src/calculator/viewportColumns.js +17 -12
  2. package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +17 -12
  3. package/3rdparty/walkontable/src/calculator/viewportRows.js +15 -10
  4. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +15 -10
  5. package/3rdparty/walkontable/src/cell/coords.js +17 -12
  6. package/3rdparty/walkontable/src/cell/coords.mjs +17 -12
  7. package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
  8. package/3rdparty/walkontable/src/cell/range.js +28 -40
  9. package/3rdparty/walkontable/src/cell/range.mjs +28 -40
  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 +104 -72
  13. package/3rdparty/walkontable/src/event.mjs +104 -72
  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 +17 -15
  17. package/3rdparty/walkontable/src/scroll.mjs +17 -15
  18. package/3rdparty/walkontable/src/selection/manager.js +69 -48
  19. package/3rdparty/walkontable/src/selection/manager.mjs +69 -48
  20. package/3rdparty/walkontable/src/selection/scanner.js +42 -33
  21. package/3rdparty/walkontable/src/selection/scanner.mjs +42 -33
  22. package/3rdparty/walkontable/src/utils/columnStretching.js +44 -27
  23. package/3rdparty/walkontable/src/utils/columnStretching.mjs +44 -27
  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 -77
  32. package/core.mjs +22 -77
  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/metaManager/metaSchema.js +1 -1
  38. package/dataMap/metaManager/metaSchema.mjs +1 -1
  39. package/dataMap/replaceData.js +1 -1
  40. package/dataMap/replaceData.mjs +1 -1
  41. package/dist/handsontable.css +4 -4
  42. package/dist/handsontable.full.css +4 -4
  43. package/dist/handsontable.full.js +9117 -8969
  44. package/dist/handsontable.full.min.css +3 -3
  45. package/dist/handsontable.full.min.js +292 -292
  46. package/dist/handsontable.js +6569 -6874
  47. package/dist/handsontable.min.css +3 -3
  48. package/dist/handsontable.min.js +25 -25
  49. package/dist/languages/all.min.js +1 -1
  50. package/dist/languages/ar-AR.min.js +1 -1
  51. package/dist/languages/cs-CZ.min.js +1 -1
  52. package/dist/languages/de-CH.min.js +1 -1
  53. package/dist/languages/de-DE.min.js +1 -1
  54. package/dist/languages/en-US.min.js +1 -1
  55. package/dist/languages/es-MX.min.js +1 -1
  56. package/dist/languages/fr-FR.min.js +1 -1
  57. package/dist/languages/hr-HR.min.js +1 -1
  58. package/dist/languages/it-IT.min.js +1 -1
  59. package/dist/languages/ja-JP.min.js +1 -1
  60. package/dist/languages/ko-KR.min.js +1 -1
  61. package/dist/languages/lv-LV.min.js +1 -1
  62. package/dist/languages/nb-NO.min.js +1 -1
  63. package/dist/languages/nl-NL.min.js +1 -1
  64. package/dist/languages/pl-PL.min.js +1 -1
  65. package/dist/languages/pt-BR.min.js +1 -1
  66. package/dist/languages/ru-RU.min.js +1 -1
  67. package/dist/languages/sr-SP.min.js +1 -1
  68. package/dist/languages/zh-CN.min.js +1 -1
  69. package/dist/languages/zh-TW.min.js +1 -1
  70. package/editorManager.js +23 -25
  71. package/editorManager.mjs +23 -25
  72. package/editors/autocompleteEditor/autocompleteEditor.js +10 -6
  73. package/editors/autocompleteEditor/autocompleteEditor.mjs +10 -6
  74. package/editors/selectEditor/selectEditor.js +19 -20
  75. package/editors/selectEditor/selectEditor.mjs +19 -20
  76. package/eventManager.js +1 -1
  77. package/eventManager.mjs +1 -1
  78. package/focusManager.js +82 -64
  79. package/focusManager.mjs +82 -64
  80. package/helpers/dom/element.js +1 -1
  81. package/helpers/dom/element.mjs +1 -1
  82. package/helpers/mixed.js +1 -1
  83. package/helpers/mixed.mjs +1 -1
  84. package/helpers/object.js +2 -2
  85. package/helpers/object.mjs +2 -2
  86. package/index.d.ts +0 -10
  87. package/package.json +2 -7
  88. package/pluginHooks.d.ts +3 -4
  89. package/pluginHooks.js +38 -99
  90. package/pluginHooks.mjs +38 -99
  91. package/plugins/autoColumnSize/autoColumnSize.js +65 -49
  92. package/plugins/autoColumnSize/autoColumnSize.mjs +65 -49
  93. package/plugins/autoRowSize/autoRowSize.js +34 -28
  94. package/plugins/autoRowSize/autoRowSize.mjs +34 -28
  95. package/plugins/autofill/autofill.js +38 -30
  96. package/plugins/autofill/autofill.mjs +38 -30
  97. package/plugins/base/base.js +17 -12
  98. package/plugins/base/base.mjs +17 -12
  99. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
  100. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
  101. package/plugins/collapsibleColumns/collapsibleColumns.js +50 -59
  102. package/plugins/collapsibleColumns/collapsibleColumns.mjs +50 -59
  103. package/plugins/columnSorting/columnSorting.js +45 -49
  104. package/plugins/columnSorting/columnSorting.mjs +45 -49
  105. package/plugins/columnSummary/columnSummary.js +26 -22
  106. package/plugins/columnSummary/columnSummary.mjs +26 -22
  107. package/plugins/comments/comments.js +158 -116
  108. package/plugins/comments/comments.mjs +158 -116
  109. package/plugins/contextMenu/contextMenu.js +26 -20
  110. package/plugins/contextMenu/contextMenu.mjs +26 -20
  111. package/plugins/contextMenu/itemsFactory.js +1 -1
  112. package/plugins/contextMenu/itemsFactory.mjs +1 -1
  113. package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
  114. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
  115. package/plugins/contextMenu/menu/menu.js +21 -13
  116. package/plugins/contextMenu/menu/menu.mjs +21 -13
  117. package/plugins/contextMenu/menu/positioner.js +58 -41
  118. package/plugins/contextMenu/menu/positioner.mjs +58 -41
  119. package/plugins/copyPaste/copyPaste.js +157 -116
  120. package/plugins/copyPaste/copyPaste.mjs +157 -116
  121. package/plugins/copyPaste/copyableRanges.js +66 -43
  122. package/plugins/copyPaste/copyableRanges.mjs +66 -43
  123. package/plugins/customBorders/customBorders.js +13 -11
  124. package/plugins/customBorders/customBorders.mjs +13 -11
  125. package/plugins/dragToScroll/dragToScroll.js +6 -6
  126. package/plugins/dragToScroll/dragToScroll.mjs +6 -6
  127. package/plugins/dropdownMenu/dropdownMenu.js +106 -80
  128. package/plugins/dropdownMenu/dropdownMenu.mjs +106 -80
  129. package/plugins/exportFile/dataProvider.js +1 -1
  130. package/plugins/exportFile/dataProvider.mjs +1 -1
  131. package/plugins/filters/component/actionBar.js +9 -9
  132. package/plugins/filters/component/actionBar.mjs +8 -8
  133. package/plugins/filters/component/condition.js +15 -13
  134. package/plugins/filters/component/condition.mjs +15 -13
  135. package/plugins/filters/component/operators.js +6 -6
  136. package/plugins/filters/component/operators.mjs +6 -6
  137. package/plugins/filters/component/value.js +28 -24
  138. package/plugins/filters/component/value.mjs +28 -24
  139. package/plugins/filters/conditionUpdateObserver.js +24 -22
  140. package/plugins/filters/conditionUpdateObserver.mjs +24 -22
  141. package/plugins/filters/dataFilter.js +1 -1
  142. package/plugins/filters/dataFilter.mjs +1 -1
  143. package/plugins/filters/filters.js +95 -81
  144. package/plugins/filters/filters.mjs +95 -81
  145. package/plugins/filters/ui/input.js +19 -13
  146. package/plugins/filters/ui/input.mjs +19 -13
  147. package/plugins/filters/ui/link.js +13 -8
  148. package/plugins/filters/ui/link.mjs +13 -8
  149. package/plugins/filters/ui/multipleSelect.js +112 -85
  150. package/plugins/filters/ui/multipleSelect.mjs +112 -85
  151. package/plugins/filters/ui/radioInput.js +20 -12
  152. package/plugins/filters/ui/radioInput.mjs +20 -12
  153. package/plugins/filters/ui/select.js +72 -50
  154. package/plugins/filters/ui/select.mjs +71 -49
  155. package/plugins/formulas/formulas.js +326 -268
  156. package/plugins/formulas/formulas.mjs +327 -269
  157. package/plugins/formulas/indexSyncer/axisSyncer.js +61 -38
  158. package/plugins/formulas/indexSyncer/axisSyncer.mjs +61 -38
  159. package/plugins/formulas/indexSyncer/index.js +48 -25
  160. package/plugins/formulas/indexSyncer/index.mjs +48 -25
  161. package/plugins/hiddenColumns/hiddenColumns.js +83 -64
  162. package/plugins/hiddenColumns/hiddenColumns.mjs +83 -64
  163. package/plugins/hiddenRows/hiddenRows.js +82 -63
  164. package/plugins/hiddenRows/hiddenRows.mjs +82 -63
  165. package/plugins/manualColumnFreeze/manualColumnFreeze.js +32 -24
  166. package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +33 -25
  167. package/plugins/manualColumnMove/manualColumnMove.js +170 -126
  168. package/plugins/manualColumnMove/manualColumnMove.mjs +170 -126
  169. package/plugins/manualColumnResize/manualColumnResize.js +230 -169
  170. package/plugins/manualColumnResize/manualColumnResize.mjs +230 -169
  171. package/plugins/manualRowMove/manualRowMove.js +128 -99
  172. package/plugins/manualRowMove/manualRowMove.mjs +128 -99
  173. package/plugins/manualRowResize/manualRowResize.js +209 -150
  174. package/plugins/manualRowResize/manualRowResize.mjs +209 -150
  175. package/plugins/mergeCells/calculations/selection.js +71 -2
  176. package/plugins/mergeCells/calculations/selection.mjs +71 -2
  177. package/plugins/mergeCells/cellsCollection.js +1 -117
  178. package/plugins/mergeCells/cellsCollection.mjs +1 -117
  179. package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
  180. package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
  181. package/plugins/mergeCells/mergeCells.js +397 -499
  182. package/plugins/mergeCells/mergeCells.mjs +397 -499
  183. package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
  184. package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
  185. package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
  186. package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
  187. package/plugins/nestedHeaders/nestedHeaders.js +253 -205
  188. package/plugins/nestedHeaders/nestedHeaders.mjs +254 -206
  189. package/plugins/nestedHeaders/stateManager/headersTree.js +32 -21
  190. package/plugins/nestedHeaders/stateManager/headersTree.mjs +32 -21
  191. package/plugins/nestedHeaders/stateManager/index.js +41 -30
  192. package/plugins/nestedHeaders/stateManager/index.mjs +41 -30
  193. package/plugins/nestedHeaders/stateManager/sourceSettings.js +30 -19
  194. package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +30 -19
  195. package/plugins/nestedRows/data/dataManager.js +1 -1
  196. package/plugins/nestedRows/data/dataManager.mjs +1 -1
  197. package/plugins/nestedRows/nestedRows.js +182 -151
  198. package/plugins/nestedRows/nestedRows.mjs +183 -152
  199. package/plugins/nestedRows/ui/contextMenu.js +15 -11
  200. package/plugins/nestedRows/ui/contextMenu.mjs +14 -10
  201. package/plugins/nestedRows/utils/rowMoveController.js +1 -1
  202. package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
  203. package/plugins/persistentState/storage.js +2 -2
  204. package/plugins/persistentState/storage.mjs +2 -2
  205. package/plugins/search/search.js +7 -7
  206. package/plugins/search/search.mjs +7 -7
  207. package/plugins/touchScroll/touchScroll.js +19 -15
  208. package/plugins/touchScroll/touchScroll.mjs +20 -16
  209. package/plugins/trimRows/trimRows.js +6 -6
  210. package/plugins/trimRows/trimRows.mjs +6 -6
  211. package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
  212. package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
  213. package/selection/highlight/highlight.js +14 -14
  214. package/selection/highlight/highlight.mjs +13 -13
  215. package/selection/highlight/visualSelection.js +0 -2
  216. package/selection/highlight/visualSelection.mjs +0 -2
  217. package/selection/selection.js +67 -225
  218. package/selection/selection.mjs +66 -224
  219. package/selection/transformation.js +118 -149
  220. package/selection/transformation.mjs +118 -149
  221. package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
  222. package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
  223. package/shortcutContexts/commands/editor/open.js +3 -18
  224. package/shortcutContexts/commands/editor/open.mjs +3 -18
  225. package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
  226. package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
  227. package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
  228. package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
  229. package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
  230. package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
  231. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
  232. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
  233. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
  234. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
  235. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
  236. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
  237. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
  238. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
  239. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
  240. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
  241. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
  242. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
  243. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
  244. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
  245. package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
  246. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
  247. package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
  248. package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
  249. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
  250. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
  251. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
  252. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
  253. package/shortcutContexts/grid.js +3 -9
  254. package/shortcutContexts/grid.mjs +3 -9
  255. package/shortcuts/context.js +1 -2
  256. package/shortcuts/context.mjs +1 -2
  257. package/tableView.js +78 -52
  258. package/tableView.mjs +78 -52
  259. package/translations/changesObservable/observable.js +38 -21
  260. package/translations/changesObservable/observable.mjs +38 -21
  261. package/translations/changesObservable/observer.js +12 -7
  262. package/translations/changesObservable/observer.mjs +11 -6
  263. package/translations/mapCollections/aggregatedCollection.js +1 -1
  264. package/translations/mapCollections/aggregatedCollection.mjs +1 -1
  265. package/translations/maps/indexMap.js +1 -1
  266. package/translations/maps/indexMap.mjs +1 -1
  267. package/utils/dataStructures/linkedList.js +1 -6
  268. package/utils/dataStructures/linkedList.mjs +1 -6
  269. package/utils/dataStructures/tree.js +1 -1
  270. package/utils/dataStructures/tree.mjs +1 -1
  271. package/utils/interval.js +44 -26
  272. package/utils/interval.mjs +44 -26
  273. package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
  274. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
  275. package/i18n/languages/ar-AR.d.ts +0 -5
  276. package/i18n/languages/cs-CZ.d.ts +0 -5
  277. package/i18n/languages/hr-HR.d.ts +0 -5
  278. package/i18n/languages/sr-SP.d.ts +0 -5
  279. package/plugins/mergeCells/focusOrder.js +0 -305
  280. package/plugins/mergeCells/focusOrder.mjs +0 -300
package/focusManager.js CHANGED
@@ -8,9 +8,12 @@ var _function = require("./helpers/function");
8
8
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
9
9
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
10
10
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
11
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
12
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
13
- 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"); }
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 _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
13
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
14
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
15
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
16
+ 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; } }
14
17
  /**
15
18
  * Possible focus modes.
16
19
  * - CELL - The browser's focus stays on the lastly selected cell element.
@@ -32,20 +35,40 @@ var _focusMode = /*#__PURE__*/new WeakMap();
32
35
  var _refocusDelay = /*#__PURE__*/new WeakMap();
33
36
  var _refocusElementGetter = /*#__PURE__*/new WeakMap();
34
37
  var _debouncedSelect = /*#__PURE__*/new WeakMap();
35
- var _FocusManager_brand = /*#__PURE__*/new WeakSet();
38
+ var _getSelectedCell = /*#__PURE__*/new WeakSet();
39
+ var _focusCell = /*#__PURE__*/new WeakSet();
40
+ var _focusEditorElement = /*#__PURE__*/new WeakSet();
41
+ var _onUpdateSettings = /*#__PURE__*/new WeakSet();
36
42
  class FocusManager {
37
43
  constructor(hotInstance) {
38
44
  var _this = this;
45
+ /**
46
+ * Update the manager configuration after calling `updateSettings`.
47
+ *
48
+ * @param {object} newSettings The new settings passed to the `updateSettings` method.
49
+ */
50
+ _classPrivateMethodInitSpec(this, _onUpdateSettings);
51
+ /**
52
+ * Manage the browser's focus after cell selection end.
53
+ */
54
+ _classPrivateMethodInitSpec(this, _focusEditorElement);
55
+ /**
56
+ * Manage the browser's focus after each cell selection change.
57
+ */
58
+ _classPrivateMethodInitSpec(this, _focusCell);
39
59
  /**
40
60
  * Get and return the currently selected and highlighted cell/header element.
41
61
  *
42
62
  * @param {Function} callback Callback function to be called after the cell element is retrieved.
43
63
  */
44
- _classPrivateMethodInitSpec(this, _FocusManager_brand);
64
+ _classPrivateMethodInitSpec(this, _getSelectedCell);
45
65
  /**
46
66
  * The Handsontable instance.
47
67
  */
48
- _classPrivateFieldInitSpec(this, _hot, void 0);
68
+ _classPrivateFieldInitSpec(this, _hot, {
69
+ writable: true,
70
+ value: void 0
71
+ });
49
72
  /**
50
73
  * The currently enabled focus mode.
51
74
  * Can be either:
@@ -56,53 +79,59 @@ class FocusManager {
56
79
  *
57
80
  * @type {'cell' | 'mixed'}
58
81
  */
59
- _classPrivateFieldInitSpec(this, _focusMode, void 0);
82
+ _classPrivateFieldInitSpec(this, _focusMode, {
83
+ writable: true,
84
+ value: void 0
85
+ });
60
86
  /**
61
87
  * The delay after which the focus switches from the lastly selected cell to the active editor's `TEXTAREA`
62
88
  * element if the focus mode is set to 'mixed'.
63
89
  *
64
90
  * @type {number}
65
91
  */
66
- _classPrivateFieldInitSpec(this, _refocusDelay, 50);
92
+ _classPrivateFieldInitSpec(this, _refocusDelay, {
93
+ writable: true,
94
+ value: 50
95
+ });
67
96
  /**
68
97
  * Getter function for the element to be used when refocusing the browser after a delay. If `null`, the active
69
98
  * editor's `TEXTAREA` element will be used.
70
99
  *
71
100
  * @type {null|Function}
72
101
  */
73
- _classPrivateFieldInitSpec(this, _refocusElementGetter, null);
102
+ _classPrivateFieldInitSpec(this, _refocusElementGetter, {
103
+ writable: true,
104
+ value: null
105
+ });
74
106
  /**
75
107
  * Map of the debounced `select` functions.
76
108
  *
77
109
  * @type {Map<number, Function>}
78
110
  */
79
- _classPrivateFieldInitSpec(this, _debouncedSelect, new Map());
111
+ _classPrivateFieldInitSpec(this, _debouncedSelect, {
112
+ writable: true,
113
+ value: new Map()
114
+ });
80
115
  const hotSettings = hotInstance.getSettings();
81
- _classPrivateFieldSet(_hot, this, hotInstance);
82
- _classPrivateFieldSet(_focusMode, this, hotSettings.imeFastEdit ? FOCUS_MODES.MIXED : FOCUS_MODES.CELL);
83
- _classPrivateFieldGet(_hot, this).addHook('afterUpdateSettings', function () {
116
+ _classPrivateFieldSet(this, _hot, hotInstance);
117
+ _classPrivateFieldSet(this, _focusMode, hotSettings.imeFastEdit ? FOCUS_MODES.MIXED : FOCUS_MODES.CELL);
118
+ _classPrivateFieldGet(this, _hot).addHook('afterUpdateSettings', function () {
84
119
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
85
120
  args[_key] = arguments[_key];
86
121
  }
87
- return _assertClassBrand(_FocusManager_brand, _this, _onUpdateSettings).call(_this, ...args);
122
+ return _classPrivateMethodGet(_this, _onUpdateSettings, _onUpdateSettings2).call(_this, ...args);
88
123
  });
89
- _classPrivateFieldGet(_hot, this).addHook('afterSelection', function () {
124
+ _classPrivateFieldGet(this, _hot).addHook('afterSelection', function () {
90
125
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
91
126
  args[_key2] = arguments[_key2];
92
127
  }
93
- return _assertClassBrand(_FocusManager_brand, _this, _focusCell).call(_this, ...args);
128
+ return _classPrivateMethodGet(_this, _focusCell, _focusCell2).call(_this, ...args);
94
129
  });
95
- _classPrivateFieldGet(_hot, this).addHook('afterSelectionFocusSet', function () {
130
+ _classPrivateFieldGet(this, _hot).addHook('afterSelectionEnd', function () {
96
131
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
97
132
  args[_key3] = arguments[_key3];
98
133
  }
99
- return _assertClassBrand(_FocusManager_brand, _this, _focusCell).call(_this, ...args);
100
- });
101
- _classPrivateFieldGet(_hot, this).addHook('afterSelectionEnd', function () {
102
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
103
- args[_key4] = arguments[_key4];
104
- }
105
- return _assertClassBrand(_FocusManager_brand, _this, _focusEditorElement).call(_this, ...args);
134
+ return _classPrivateMethodGet(_this, _focusEditorElement, _focusEditorElement2).call(_this, ...args);
106
135
  });
107
136
  }
108
137
 
@@ -112,7 +141,7 @@ class FocusManager {
112
141
  * @returns {'cell' | 'mixed'}
113
142
  */
114
143
  getFocusMode() {
115
- return _classPrivateFieldGet(_focusMode, this);
144
+ return _classPrivateFieldGet(this, _focusMode);
116
145
  }
117
146
 
118
147
  /**
@@ -122,7 +151,7 @@ class FocusManager {
122
151
  */
123
152
  setFocusMode(focusMode) {
124
153
  if (Object.values(FOCUS_MODES).includes(focusMode)) {
125
- _classPrivateFieldSet(_focusMode, this, focusMode);
154
+ _classPrivateFieldSet(this, _focusMode, focusMode);
126
155
  } else {
127
156
  (0, _console.warn)(`"${focusMode}" is not a valid focus mode.`);
128
157
  }
@@ -135,7 +164,7 @@ class FocusManager {
135
164
  * @returns {number} Delay in milliseconds.
136
165
  */
137
166
  getRefocusDelay() {
138
- return _classPrivateFieldGet(_refocusDelay, this);
167
+ return _classPrivateFieldGet(this, _refocusDelay);
139
168
  }
140
169
 
141
170
  /**
@@ -145,7 +174,7 @@ class FocusManager {
145
174
  * @param {number} delay Delay in milliseconds.
146
175
  */
147
176
  setRefocusDelay(delay) {
148
- _classPrivateFieldSet(_refocusDelay, this, delay);
177
+ _classPrivateFieldSet(this, _refocusDelay, delay);
149
178
  }
150
179
 
151
180
  /**
@@ -154,7 +183,7 @@ class FocusManager {
154
183
  * @param {Function} getRefocusElementFunction The refocus element getter.
155
184
  */
156
185
  setRefocusElementGetter(getRefocusElementFunction) {
157
- _classPrivateFieldSet(_refocusElementGetter, this, getRefocusElementFunction);
186
+ _classPrivateFieldSet(this, _refocusElementGetter, getRefocusElementFunction);
158
187
  }
159
188
 
160
189
  /**
@@ -163,11 +192,11 @@ class FocusManager {
163
192
  * @returns {HTMLTextAreaElement|HTMLElement|undefined}
164
193
  */
165
194
  getRefocusElement() {
166
- if (typeof _classPrivateFieldGet(_refocusElementGetter, this) === 'function') {
167
- return _classPrivateFieldGet(_refocusElementGetter, this).call(this);
195
+ if (typeof _classPrivateFieldGet(this, _refocusElementGetter) === 'function') {
196
+ return _classPrivateFieldGet(this, _refocusElementGetter).call(this);
168
197
  } else {
169
198
  var _classPrivateFieldGet2;
170
- return (_classPrivateFieldGet2 = _classPrivateFieldGet(_hot, this).getActiveEditor()) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.TEXTAREA;
199
+ return (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _hot).getActiveEditor()) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.TEXTAREA;
171
200
  }
172
201
  }
173
202
 
@@ -179,15 +208,15 @@ class FocusManager {
179
208
  focusOnHighlightedCell(selectedCell) {
180
209
  const focusElement = element => {
181
210
  var _classPrivateFieldGet3, _classPrivateFieldGet4;
182
- const currentHighlightCoords = (_classPrivateFieldGet3 = _classPrivateFieldGet(_hot, this).getSelectedRangeLast()) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.highlight;
211
+ const currentHighlightCoords = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.highlight;
183
212
  if (!currentHighlightCoords) {
184
213
  return;
185
214
  }
186
- let elementToBeFocused = _classPrivateFieldGet(_hot, this).runHooks('modifyFocusedElement', currentHighlightCoords.row, currentHighlightCoords.col, element);
215
+ let elementToBeFocused = _classPrivateFieldGet(this, _hot).runHooks('modifyFocusedElement', currentHighlightCoords.row, currentHighlightCoords.col, element);
187
216
  if (!(elementToBeFocused instanceof HTMLElement)) {
188
217
  elementToBeFocused = element;
189
218
  }
190
- if (elementToBeFocused && !((_classPrivateFieldGet4 = _classPrivateFieldGet(_hot, this).getActiveEditor()) !== null && _classPrivateFieldGet4 !== void 0 && _classPrivateFieldGet4.isOpened())) {
219
+ if (elementToBeFocused && !((_classPrivateFieldGet4 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet4 !== void 0 && _classPrivateFieldGet4.isOpened())) {
191
220
  elementToBeFocused.focus({
192
221
  preventScroll: true
193
222
  });
@@ -196,7 +225,7 @@ class FocusManager {
196
225
  if (selectedCell) {
197
226
  focusElement(selectedCell);
198
227
  } else {
199
- _assertClassBrand(_FocusManager_brand, this, _getSelectedCell).call(this, element => focusElement(element));
228
+ _classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, element => focusElement(element));
200
229
  }
201
230
  }
202
231
 
@@ -208,45 +237,42 @@ class FocusManager {
208
237
  */
209
238
  refocusToEditorTextarea() {
210
239
  var _classPrivateFieldGet5;
211
- let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _classPrivateFieldGet(_refocusDelay, this);
240
+ let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _classPrivateFieldGet(this, _refocusDelay);
212
241
  const refocusElement = this.getRefocusElement();
213
242
 
214
243
  // Re-focus on the editor's `TEXTAREA` element (or a predefined element) if the `imeFastEdit` option is enabled.
215
- if (_classPrivateFieldGet(_hot, this).getSettings().imeFastEdit && !((_classPrivateFieldGet5 = _classPrivateFieldGet(_hot, this).getActiveEditor()) !== null && _classPrivateFieldGet5 !== void 0 && _classPrivateFieldGet5.isOpened()) && !!refocusElement) {
216
- if (!_classPrivateFieldGet(_debouncedSelect, this).has(delay)) {
217
- _classPrivateFieldGet(_debouncedSelect, this).set(delay, (0, _function.debounce)(() => {
244
+ if (_classPrivateFieldGet(this, _hot).getSettings().imeFastEdit && !((_classPrivateFieldGet5 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet5 !== void 0 && _classPrivateFieldGet5.isOpened()) && !!refocusElement) {
245
+ if (!_classPrivateFieldGet(this, _debouncedSelect).has(delay)) {
246
+ _classPrivateFieldGet(this, _debouncedSelect).set(delay, (0, _function.debounce)(() => {
218
247
  refocusElement.select();
219
248
  }, delay));
220
249
  }
221
- _classPrivateFieldGet(_debouncedSelect, this).get(delay)();
250
+ _classPrivateFieldGet(this, _debouncedSelect).get(delay)();
222
251
  }
223
252
  }
224
253
  }
225
254
  exports.FocusManager = FocusManager;
226
- function _getSelectedCell(callback) {
255
+ function _getSelectedCell2(callback) {
227
256
  var _classPrivateFieldGet6;
228
- const highlight = (_classPrivateFieldGet6 = _classPrivateFieldGet(_hot, this).getSelectedRangeLast()) === null || _classPrivateFieldGet6 === void 0 ? void 0 : _classPrivateFieldGet6.highlight;
229
- if (!highlight || !_classPrivateFieldGet(_hot, this).selection.isCellVisible(highlight)) {
257
+ const highlight = (_classPrivateFieldGet6 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet6 === void 0 ? void 0 : _classPrivateFieldGet6.highlight;
258
+ if (!highlight || !_classPrivateFieldGet(this, _hot).selection.isCellVisible(highlight)) {
230
259
  callback(null);
231
260
  return;
232
261
  }
233
- const cell = _classPrivateFieldGet(_hot, this).getCell(highlight.row, highlight.col, true);
262
+ const cell = _classPrivateFieldGet(this, _hot).getCell(highlight.row, highlight.col, true);
234
263
  if (cell === null) {
235
- _classPrivateFieldGet(_hot, this).addHookOnce('afterScroll', () => {
236
- callback(_classPrivateFieldGet(_hot, this).getCell(highlight.row, highlight.col, true));
264
+ _classPrivateFieldGet(this, _hot).addHookOnce('afterScroll', () => {
265
+ callback(_classPrivateFieldGet(this, _hot).getCell(highlight.row, highlight.col, true));
237
266
  });
238
267
  } else {
239
268
  callback(cell);
240
269
  }
241
270
  }
242
- /**
243
- * Manage the browser's focus after each cell selection change.
244
- */
245
- function _focusCell() {
246
- _assertClassBrand(_FocusManager_brand, this, _getSelectedCell).call(this, selectedCell => {
271
+ function _focusCell2() {
272
+ _classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, selectedCell => {
247
273
  const {
248
274
  activeElement
249
- } = _classPrivateFieldGet(_hot, this).rootDocument;
275
+ } = _classPrivateFieldGet(this, _hot).rootDocument;
250
276
 
251
277
  // Blurring the `activeElement` removes the unwanted border around the focusable element (#6877)
252
278
  // and resets the `document.activeElement` property. The blurring should happen only when the
@@ -258,22 +284,14 @@ function _focusCell() {
258
284
  this.focusOnHighlightedCell(selectedCell);
259
285
  });
260
286
  }
261
- /**
262
- * Manage the browser's focus after cell selection end.
263
- */
264
- function _focusEditorElement() {
265
- _assertClassBrand(_FocusManager_brand, this, _getSelectedCell).call(this, selectedCell => {
287
+ function _focusEditorElement2() {
288
+ _classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, selectedCell => {
266
289
  if (this.getFocusMode() === FOCUS_MODES.MIXED && selectedCell.nodeName === 'TD') {
267
290
  this.refocusToEditorTextarea();
268
291
  }
269
292
  });
270
293
  }
271
- /**
272
- * Update the manager configuration after calling `updateSettings`.
273
- *
274
- * @param {object} newSettings The new settings passed to the `updateSettings` method.
275
- */
276
- function _onUpdateSettings(newSettings) {
294
+ function _onUpdateSettings2(newSettings) {
277
295
  if (newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.MIXED) {
278
296
  this.setFocusMode(FOCUS_MODES.MIXED);
279
297
  } else if (!newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.CELL) {
package/focusManager.mjs CHANGED
@@ -2,9 +2,12 @@ import "core-js/modules/es.error.cause.js";
2
2
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
3
3
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
4
4
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
5
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
6
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
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"); }
5
+ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
6
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
7
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
8
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
9
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
10
+ 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; } }
8
11
  import { warn } from "./helpers/console.mjs";
9
12
  import { isOutsideInput } from "./helpers/dom/element.mjs";
10
13
  import { debounce } from "./helpers/function.mjs";
@@ -29,20 +32,40 @@ var _focusMode = /*#__PURE__*/new WeakMap();
29
32
  var _refocusDelay = /*#__PURE__*/new WeakMap();
30
33
  var _refocusElementGetter = /*#__PURE__*/new WeakMap();
31
34
  var _debouncedSelect = /*#__PURE__*/new WeakMap();
32
- var _FocusManager_brand = /*#__PURE__*/new WeakSet();
35
+ var _getSelectedCell = /*#__PURE__*/new WeakSet();
36
+ var _focusCell = /*#__PURE__*/new WeakSet();
37
+ var _focusEditorElement = /*#__PURE__*/new WeakSet();
38
+ var _onUpdateSettings = /*#__PURE__*/new WeakSet();
33
39
  export class FocusManager {
34
40
  constructor(hotInstance) {
35
41
  var _this = this;
42
+ /**
43
+ * Update the manager configuration after calling `updateSettings`.
44
+ *
45
+ * @param {object} newSettings The new settings passed to the `updateSettings` method.
46
+ */
47
+ _classPrivateMethodInitSpec(this, _onUpdateSettings);
48
+ /**
49
+ * Manage the browser's focus after cell selection end.
50
+ */
51
+ _classPrivateMethodInitSpec(this, _focusEditorElement);
52
+ /**
53
+ * Manage the browser's focus after each cell selection change.
54
+ */
55
+ _classPrivateMethodInitSpec(this, _focusCell);
36
56
  /**
37
57
  * Get and return the currently selected and highlighted cell/header element.
38
58
  *
39
59
  * @param {Function} callback Callback function to be called after the cell element is retrieved.
40
60
  */
41
- _classPrivateMethodInitSpec(this, _FocusManager_brand);
61
+ _classPrivateMethodInitSpec(this, _getSelectedCell);
42
62
  /**
43
63
  * The Handsontable instance.
44
64
  */
45
- _classPrivateFieldInitSpec(this, _hot, void 0);
65
+ _classPrivateFieldInitSpec(this, _hot, {
66
+ writable: true,
67
+ value: void 0
68
+ });
46
69
  /**
47
70
  * The currently enabled focus mode.
48
71
  * Can be either:
@@ -53,53 +76,59 @@ export class FocusManager {
53
76
  *
54
77
  * @type {'cell' | 'mixed'}
55
78
  */
56
- _classPrivateFieldInitSpec(this, _focusMode, void 0);
79
+ _classPrivateFieldInitSpec(this, _focusMode, {
80
+ writable: true,
81
+ value: void 0
82
+ });
57
83
  /**
58
84
  * The delay after which the focus switches from the lastly selected cell to the active editor's `TEXTAREA`
59
85
  * element if the focus mode is set to 'mixed'.
60
86
  *
61
87
  * @type {number}
62
88
  */
63
- _classPrivateFieldInitSpec(this, _refocusDelay, 50);
89
+ _classPrivateFieldInitSpec(this, _refocusDelay, {
90
+ writable: true,
91
+ value: 50
92
+ });
64
93
  /**
65
94
  * Getter function for the element to be used when refocusing the browser after a delay. If `null`, the active
66
95
  * editor's `TEXTAREA` element will be used.
67
96
  *
68
97
  * @type {null|Function}
69
98
  */
70
- _classPrivateFieldInitSpec(this, _refocusElementGetter, null);
99
+ _classPrivateFieldInitSpec(this, _refocusElementGetter, {
100
+ writable: true,
101
+ value: null
102
+ });
71
103
  /**
72
104
  * Map of the debounced `select` functions.
73
105
  *
74
106
  * @type {Map<number, Function>}
75
107
  */
76
- _classPrivateFieldInitSpec(this, _debouncedSelect, new Map());
108
+ _classPrivateFieldInitSpec(this, _debouncedSelect, {
109
+ writable: true,
110
+ value: new Map()
111
+ });
77
112
  const hotSettings = hotInstance.getSettings();
78
- _classPrivateFieldSet(_hot, this, hotInstance);
79
- _classPrivateFieldSet(_focusMode, this, hotSettings.imeFastEdit ? FOCUS_MODES.MIXED : FOCUS_MODES.CELL);
80
- _classPrivateFieldGet(_hot, this).addHook('afterUpdateSettings', function () {
113
+ _classPrivateFieldSet(this, _hot, hotInstance);
114
+ _classPrivateFieldSet(this, _focusMode, hotSettings.imeFastEdit ? FOCUS_MODES.MIXED : FOCUS_MODES.CELL);
115
+ _classPrivateFieldGet(this, _hot).addHook('afterUpdateSettings', function () {
81
116
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
82
117
  args[_key] = arguments[_key];
83
118
  }
84
- return _assertClassBrand(_FocusManager_brand, _this, _onUpdateSettings).call(_this, ...args);
119
+ return _classPrivateMethodGet(_this, _onUpdateSettings, _onUpdateSettings2).call(_this, ...args);
85
120
  });
86
- _classPrivateFieldGet(_hot, this).addHook('afterSelection', function () {
121
+ _classPrivateFieldGet(this, _hot).addHook('afterSelection', function () {
87
122
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
88
123
  args[_key2] = arguments[_key2];
89
124
  }
90
- return _assertClassBrand(_FocusManager_brand, _this, _focusCell).call(_this, ...args);
125
+ return _classPrivateMethodGet(_this, _focusCell, _focusCell2).call(_this, ...args);
91
126
  });
92
- _classPrivateFieldGet(_hot, this).addHook('afterSelectionFocusSet', function () {
127
+ _classPrivateFieldGet(this, _hot).addHook('afterSelectionEnd', function () {
93
128
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
94
129
  args[_key3] = arguments[_key3];
95
130
  }
96
- return _assertClassBrand(_FocusManager_brand, _this, _focusCell).call(_this, ...args);
97
- });
98
- _classPrivateFieldGet(_hot, this).addHook('afterSelectionEnd', function () {
99
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
100
- args[_key4] = arguments[_key4];
101
- }
102
- return _assertClassBrand(_FocusManager_brand, _this, _focusEditorElement).call(_this, ...args);
131
+ return _classPrivateMethodGet(_this, _focusEditorElement, _focusEditorElement2).call(_this, ...args);
103
132
  });
104
133
  }
105
134
 
@@ -109,7 +138,7 @@ export class FocusManager {
109
138
  * @returns {'cell' | 'mixed'}
110
139
  */
111
140
  getFocusMode() {
112
- return _classPrivateFieldGet(_focusMode, this);
141
+ return _classPrivateFieldGet(this, _focusMode);
113
142
  }
114
143
 
115
144
  /**
@@ -119,7 +148,7 @@ export class FocusManager {
119
148
  */
120
149
  setFocusMode(focusMode) {
121
150
  if (Object.values(FOCUS_MODES).includes(focusMode)) {
122
- _classPrivateFieldSet(_focusMode, this, focusMode);
151
+ _classPrivateFieldSet(this, _focusMode, focusMode);
123
152
  } else {
124
153
  warn(`"${focusMode}" is not a valid focus mode.`);
125
154
  }
@@ -132,7 +161,7 @@ export class FocusManager {
132
161
  * @returns {number} Delay in milliseconds.
133
162
  */
134
163
  getRefocusDelay() {
135
- return _classPrivateFieldGet(_refocusDelay, this);
164
+ return _classPrivateFieldGet(this, _refocusDelay);
136
165
  }
137
166
 
138
167
  /**
@@ -142,7 +171,7 @@ export class FocusManager {
142
171
  * @param {number} delay Delay in milliseconds.
143
172
  */
144
173
  setRefocusDelay(delay) {
145
- _classPrivateFieldSet(_refocusDelay, this, delay);
174
+ _classPrivateFieldSet(this, _refocusDelay, delay);
146
175
  }
147
176
 
148
177
  /**
@@ -151,7 +180,7 @@ export class FocusManager {
151
180
  * @param {Function} getRefocusElementFunction The refocus element getter.
152
181
  */
153
182
  setRefocusElementGetter(getRefocusElementFunction) {
154
- _classPrivateFieldSet(_refocusElementGetter, this, getRefocusElementFunction);
183
+ _classPrivateFieldSet(this, _refocusElementGetter, getRefocusElementFunction);
155
184
  }
156
185
 
157
186
  /**
@@ -160,11 +189,11 @@ export class FocusManager {
160
189
  * @returns {HTMLTextAreaElement|HTMLElement|undefined}
161
190
  */
162
191
  getRefocusElement() {
163
- if (typeof _classPrivateFieldGet(_refocusElementGetter, this) === 'function') {
164
- return _classPrivateFieldGet(_refocusElementGetter, this).call(this);
192
+ if (typeof _classPrivateFieldGet(this, _refocusElementGetter) === 'function') {
193
+ return _classPrivateFieldGet(this, _refocusElementGetter).call(this);
165
194
  } else {
166
195
  var _classPrivateFieldGet2;
167
- return (_classPrivateFieldGet2 = _classPrivateFieldGet(_hot, this).getActiveEditor()) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.TEXTAREA;
196
+ return (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _hot).getActiveEditor()) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.TEXTAREA;
168
197
  }
169
198
  }
170
199
 
@@ -176,15 +205,15 @@ export class FocusManager {
176
205
  focusOnHighlightedCell(selectedCell) {
177
206
  const focusElement = element => {
178
207
  var _classPrivateFieldGet3, _classPrivateFieldGet4;
179
- const currentHighlightCoords = (_classPrivateFieldGet3 = _classPrivateFieldGet(_hot, this).getSelectedRangeLast()) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.highlight;
208
+ const currentHighlightCoords = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.highlight;
180
209
  if (!currentHighlightCoords) {
181
210
  return;
182
211
  }
183
- let elementToBeFocused = _classPrivateFieldGet(_hot, this).runHooks('modifyFocusedElement', currentHighlightCoords.row, currentHighlightCoords.col, element);
212
+ let elementToBeFocused = _classPrivateFieldGet(this, _hot).runHooks('modifyFocusedElement', currentHighlightCoords.row, currentHighlightCoords.col, element);
184
213
  if (!(elementToBeFocused instanceof HTMLElement)) {
185
214
  elementToBeFocused = element;
186
215
  }
187
- if (elementToBeFocused && !((_classPrivateFieldGet4 = _classPrivateFieldGet(_hot, this).getActiveEditor()) !== null && _classPrivateFieldGet4 !== void 0 && _classPrivateFieldGet4.isOpened())) {
216
+ if (elementToBeFocused && !((_classPrivateFieldGet4 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet4 !== void 0 && _classPrivateFieldGet4.isOpened())) {
188
217
  elementToBeFocused.focus({
189
218
  preventScroll: true
190
219
  });
@@ -193,7 +222,7 @@ export class FocusManager {
193
222
  if (selectedCell) {
194
223
  focusElement(selectedCell);
195
224
  } else {
196
- _assertClassBrand(_FocusManager_brand, this, _getSelectedCell).call(this, element => focusElement(element));
225
+ _classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, element => focusElement(element));
197
226
  }
198
227
  }
199
228
 
@@ -205,44 +234,41 @@ export class FocusManager {
205
234
  */
206
235
  refocusToEditorTextarea() {
207
236
  var _classPrivateFieldGet5;
208
- let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _classPrivateFieldGet(_refocusDelay, this);
237
+ let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _classPrivateFieldGet(this, _refocusDelay);
209
238
  const refocusElement = this.getRefocusElement();
210
239
 
211
240
  // Re-focus on the editor's `TEXTAREA` element (or a predefined element) if the `imeFastEdit` option is enabled.
212
- if (_classPrivateFieldGet(_hot, this).getSettings().imeFastEdit && !((_classPrivateFieldGet5 = _classPrivateFieldGet(_hot, this).getActiveEditor()) !== null && _classPrivateFieldGet5 !== void 0 && _classPrivateFieldGet5.isOpened()) && !!refocusElement) {
213
- if (!_classPrivateFieldGet(_debouncedSelect, this).has(delay)) {
214
- _classPrivateFieldGet(_debouncedSelect, this).set(delay, debounce(() => {
241
+ if (_classPrivateFieldGet(this, _hot).getSettings().imeFastEdit && !((_classPrivateFieldGet5 = _classPrivateFieldGet(this, _hot).getActiveEditor()) !== null && _classPrivateFieldGet5 !== void 0 && _classPrivateFieldGet5.isOpened()) && !!refocusElement) {
242
+ if (!_classPrivateFieldGet(this, _debouncedSelect).has(delay)) {
243
+ _classPrivateFieldGet(this, _debouncedSelect).set(delay, debounce(() => {
215
244
  refocusElement.select();
216
245
  }, delay));
217
246
  }
218
- _classPrivateFieldGet(_debouncedSelect, this).get(delay)();
247
+ _classPrivateFieldGet(this, _debouncedSelect).get(delay)();
219
248
  }
220
249
  }
221
250
  }
222
- function _getSelectedCell(callback) {
251
+ function _getSelectedCell2(callback) {
223
252
  var _classPrivateFieldGet6;
224
- const highlight = (_classPrivateFieldGet6 = _classPrivateFieldGet(_hot, this).getSelectedRangeLast()) === null || _classPrivateFieldGet6 === void 0 ? void 0 : _classPrivateFieldGet6.highlight;
225
- if (!highlight || !_classPrivateFieldGet(_hot, this).selection.isCellVisible(highlight)) {
253
+ const highlight = (_classPrivateFieldGet6 = _classPrivateFieldGet(this, _hot).getSelectedRangeLast()) === null || _classPrivateFieldGet6 === void 0 ? void 0 : _classPrivateFieldGet6.highlight;
254
+ if (!highlight || !_classPrivateFieldGet(this, _hot).selection.isCellVisible(highlight)) {
226
255
  callback(null);
227
256
  return;
228
257
  }
229
- const cell = _classPrivateFieldGet(_hot, this).getCell(highlight.row, highlight.col, true);
258
+ const cell = _classPrivateFieldGet(this, _hot).getCell(highlight.row, highlight.col, true);
230
259
  if (cell === null) {
231
- _classPrivateFieldGet(_hot, this).addHookOnce('afterScroll', () => {
232
- callback(_classPrivateFieldGet(_hot, this).getCell(highlight.row, highlight.col, true));
260
+ _classPrivateFieldGet(this, _hot).addHookOnce('afterScroll', () => {
261
+ callback(_classPrivateFieldGet(this, _hot).getCell(highlight.row, highlight.col, true));
233
262
  });
234
263
  } else {
235
264
  callback(cell);
236
265
  }
237
266
  }
238
- /**
239
- * Manage the browser's focus after each cell selection change.
240
- */
241
- function _focusCell() {
242
- _assertClassBrand(_FocusManager_brand, this, _getSelectedCell).call(this, selectedCell => {
267
+ function _focusCell2() {
268
+ _classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, selectedCell => {
243
269
  const {
244
270
  activeElement
245
- } = _classPrivateFieldGet(_hot, this).rootDocument;
271
+ } = _classPrivateFieldGet(this, _hot).rootDocument;
246
272
 
247
273
  // Blurring the `activeElement` removes the unwanted border around the focusable element (#6877)
248
274
  // and resets the `document.activeElement` property. The blurring should happen only when the
@@ -254,22 +280,14 @@ function _focusCell() {
254
280
  this.focusOnHighlightedCell(selectedCell);
255
281
  });
256
282
  }
257
- /**
258
- * Manage the browser's focus after cell selection end.
259
- */
260
- function _focusEditorElement() {
261
- _assertClassBrand(_FocusManager_brand, this, _getSelectedCell).call(this, selectedCell => {
283
+ function _focusEditorElement2() {
284
+ _classPrivateMethodGet(this, _getSelectedCell, _getSelectedCell2).call(this, selectedCell => {
262
285
  if (this.getFocusMode() === FOCUS_MODES.MIXED && selectedCell.nodeName === 'TD') {
263
286
  this.refocusToEditorTextarea();
264
287
  }
265
288
  });
266
289
  }
267
- /**
268
- * Update the manager configuration after calling `updateSettings`.
269
- *
270
- * @param {object} newSettings The new settings passed to the `updateSettings` method.
271
- */
272
- function _onUpdateSettings(newSettings) {
290
+ function _onUpdateSettings2(newSettings) {
273
291
  if (newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.MIXED) {
274
292
  this.setFocusMode(FOCUS_MODES.MIXED);
275
293
  } else if (!newSettings.imeFastEdit && this.getFocusMode() !== FOCUS_MODES.CELL) {
@@ -56,8 +56,8 @@ exports.selectElementIfAllowed = selectElementIfAllowed;
56
56
  exports.setAttribute = setAttribute;
57
57
  exports.setCaretPosition = setCaretPosition;
58
58
  exports.setOverlayPosition = setOverlayPosition;
59
- require("core-js/modules/es.error.cause.js");
60
59
  require("core-js/modules/es.array.push.js");
60
+ require("core-js/modules/es.error.cause.js");
61
61
  var _string = require("../string");
62
62
  var _a11y = require("../a11y");
63
63
  /**
@@ -1,5 +1,5 @@
1
- import "core-js/modules/es.error.cause.js";
2
1
  import "core-js/modules/es.array.push.js";
2
+ import "core-js/modules/es.error.cause.js";
3
3
  import { sanitize } from "../string.mjs";
4
4
  import { A11Y_HIDDEN } from "../a11y.mjs";
5
5
  /**
package/helpers/mixed.js CHANGED
@@ -134,7 +134,7 @@ const domMessages = {
134
134
  function _injectProductInfo(key, element) {
135
135
  const hasValidType = !isEmpty(key);
136
136
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
137
- const hotVersion = "0.0.0-next-bfb0e3a-20240403";
137
+ const hotVersion = "0.0.0-next-5a535ed-20240403";
138
138
  let keyValidityDate;
139
139
  let consoleMessageState = 'invalid';
140
140
  let domMessageState = 'invalid';