handsontable 16.1.1 → 16.2.0-next-90d1117-20251117

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.
Files changed (296) hide show
  1. package/3rdparty/walkontable/src/overlays.js +1 -1
  2. package/3rdparty/walkontable/src/overlays.mjs +1 -1
  3. package/3rdparty/walkontable/src/selection/border/border.js +19 -3
  4. package/3rdparty/walkontable/src/selection/border/border.mjs +19 -3
  5. package/CHANGELOG.md +39 -0
  6. package/base.js +2 -2
  7. package/base.mjs +2 -2
  8. package/core/coordsMapper/index.js +11 -0
  9. package/core/coordsMapper/index.mjs +1 -0
  10. package/core/hooks/bucket.js +7 -1
  11. package/core/hooks/bucket.mjs +7 -1
  12. package/core/hooks/constants.js +54 -0
  13. package/core/hooks/constants.mjs +54 -0
  14. package/core/hooks/index.d.ts +6 -0
  15. package/core/index.js +10 -4
  16. package/core/index.mjs +2 -1
  17. package/core.d.ts +3 -2
  18. package/core.js +67 -26
  19. package/core.mjs +56 -15
  20. package/dataMap/metaManager/metaSchema.js +197 -20
  21. package/dataMap/metaManager/metaSchema.mjs +197 -20
  22. package/dist/handsontable.css +175 -3
  23. package/dist/handsontable.full.css +175 -3
  24. package/dist/handsontable.full.js +10864 -8426
  25. package/dist/handsontable.full.min.css +5 -4
  26. package/dist/handsontable.full.min.js +194 -193
  27. package/dist/handsontable.js +7126 -4827
  28. package/dist/handsontable.min.css +4 -4
  29. package/dist/handsontable.min.js +43 -42
  30. package/dist/languages/all.js +168 -21
  31. package/dist/languages/all.min.js +1 -1
  32. package/dist/languages/ar-AR.js +8 -1
  33. package/dist/languages/ar-AR.min.js +1 -1
  34. package/dist/languages/cs-CZ.js +8 -1
  35. package/dist/languages/cs-CZ.min.js +1 -1
  36. package/dist/languages/de-CH.js +8 -1
  37. package/dist/languages/de-CH.min.js +1 -1
  38. package/dist/languages/de-DE.js +8 -1
  39. package/dist/languages/de-DE.min.js +1 -1
  40. package/dist/languages/en-US.js +8 -1
  41. package/dist/languages/en-US.min.js +1 -1
  42. package/dist/languages/es-MX.js +8 -1
  43. package/dist/languages/es-MX.min.js +1 -1
  44. package/dist/languages/fa-IR.js +8 -1
  45. package/dist/languages/fa-IR.min.js +1 -1
  46. package/dist/languages/fr-FR.js +8 -1
  47. package/dist/languages/fr-FR.min.js +1 -1
  48. package/dist/languages/hr-HR.js +8 -1
  49. package/dist/languages/hr-HR.min.js +1 -1
  50. package/dist/languages/it-IT.js +8 -1
  51. package/dist/languages/it-IT.min.js +1 -1
  52. package/dist/languages/ja-JP.js +8 -1
  53. package/dist/languages/ja-JP.min.js +1 -1
  54. package/dist/languages/ko-KR.js +8 -1
  55. package/dist/languages/ko-KR.min.js +1 -1
  56. package/dist/languages/lv-LV.js +8 -1
  57. package/dist/languages/lv-LV.min.js +1 -1
  58. package/dist/languages/nb-NO.js +8 -1
  59. package/dist/languages/nb-NO.min.js +1 -1
  60. package/dist/languages/nl-NL.js +8 -1
  61. package/dist/languages/nl-NL.min.js +1 -1
  62. package/dist/languages/pl-PL.js +8 -1
  63. package/dist/languages/pl-PL.min.js +1 -1
  64. package/dist/languages/pt-BR.js +8 -1
  65. package/dist/languages/pt-BR.min.js +1 -1
  66. package/dist/languages/ru-RU.js +8 -1
  67. package/dist/languages/ru-RU.min.js +1 -1
  68. package/dist/languages/sr-SP.js +8 -1
  69. package/dist/languages/sr-SP.min.js +1 -1
  70. package/dist/languages/zh-CN.js +8 -1
  71. package/dist/languages/zh-CN.min.js +1 -1
  72. package/dist/languages/zh-TW.js +8 -1
  73. package/dist/languages/zh-TW.min.js +1 -1
  74. package/editors/autocompleteEditor/autocompleteEditor.js +21 -1
  75. package/editors/autocompleteEditor/autocompleteEditor.mjs +22 -2
  76. package/focusManager/constants.js +25 -0
  77. package/focusManager/constants.mjs +22 -0
  78. package/focusManager/eventListener.js +107 -0
  79. package/focusManager/eventListener.mjs +103 -0
  80. package/{focusManager.d.ts → focusManager/grid.d.ts} +1 -1
  81. package/{focusManager.js → focusManager/grid.js} +48 -17
  82. package/{focusManager.mjs → focusManager/grid.mjs} +47 -16
  83. package/focusManager/index.d.ts +2 -0
  84. package/focusManager/index.js +20 -0
  85. package/focusManager/index.mjs +20 -0
  86. package/focusManager/scope.js +133 -0
  87. package/focusManager/scope.mjs +129 -0
  88. package/focusManager/scopeManager.d.ts +19 -0
  89. package/focusManager/scopeManager.js +268 -0
  90. package/focusManager/scopeManager.mjs +263 -0
  91. package/focusManager/scopes/grid.js +120 -0
  92. package/focusManager/scopes/grid.mjs +116 -0
  93. package/focusManager/scopes/index.js +13 -0
  94. package/focusManager/scopes/index.mjs +9 -0
  95. package/{utils → focusManager/utils}/focusDetector.js +21 -31
  96. package/{utils → focusManager/utils}/focusDetector.mjs +21 -31
  97. package/focusManager/utils/utils.js +95 -0
  98. package/focusManager/utils/utils.mjs +89 -0
  99. package/helpers/dom/element.js +1 -1
  100. package/helpers/dom/element.mjs +2 -2
  101. package/helpers/dom/event.js +1 -1
  102. package/helpers/dom/event.mjs +1 -1
  103. package/helpers/mixed.js +2 -65
  104. package/helpers/mixed.mjs +2 -63
  105. package/i18n/constants.js +10 -1
  106. package/i18n/constants.mjs +10 -1
  107. package/i18n/languages/ar-AR.js +8 -1
  108. package/i18n/languages/ar-AR.mjs +8 -1
  109. package/i18n/languages/cs-CZ.js +8 -1
  110. package/i18n/languages/cs-CZ.mjs +8 -1
  111. package/i18n/languages/de-CH.js +8 -1
  112. package/i18n/languages/de-CH.mjs +8 -1
  113. package/i18n/languages/de-DE.js +8 -1
  114. package/i18n/languages/de-DE.mjs +8 -1
  115. package/i18n/languages/en-US.js +8 -1
  116. package/i18n/languages/en-US.mjs +8 -1
  117. package/i18n/languages/es-MX.js +8 -1
  118. package/i18n/languages/es-MX.mjs +8 -1
  119. package/i18n/languages/fa-IR.js +8 -1
  120. package/i18n/languages/fa-IR.mjs +8 -1
  121. package/i18n/languages/fr-FR.js +8 -1
  122. package/i18n/languages/fr-FR.mjs +8 -1
  123. package/i18n/languages/hr-HR.js +8 -1
  124. package/i18n/languages/hr-HR.mjs +8 -1
  125. package/i18n/languages/it-IT.js +8 -1
  126. package/i18n/languages/it-IT.mjs +8 -1
  127. package/i18n/languages/ja-JP.js +8 -1
  128. package/i18n/languages/ja-JP.mjs +8 -1
  129. package/i18n/languages/ko-KR.js +8 -1
  130. package/i18n/languages/ko-KR.mjs +8 -1
  131. package/i18n/languages/lv-LV.js +8 -1
  132. package/i18n/languages/lv-LV.mjs +8 -1
  133. package/i18n/languages/nb-NO.js +8 -1
  134. package/i18n/languages/nb-NO.mjs +8 -1
  135. package/i18n/languages/nl-NL.js +8 -1
  136. package/i18n/languages/nl-NL.mjs +8 -1
  137. package/i18n/languages/pl-PL.js +8 -1
  138. package/i18n/languages/pl-PL.mjs +8 -1
  139. package/i18n/languages/pt-BR.js +8 -1
  140. package/i18n/languages/pt-BR.mjs +8 -1
  141. package/i18n/languages/ru-RU.js +8 -1
  142. package/i18n/languages/ru-RU.mjs +8 -1
  143. package/i18n/languages/sr-SP.js +8 -1
  144. package/i18n/languages/sr-SP.mjs +8 -1
  145. package/i18n/languages/zh-CN.js +8 -1
  146. package/i18n/languages/zh-CN.mjs +8 -1
  147. package/i18n/languages/zh-TW.js +8 -1
  148. package/i18n/languages/zh-TW.mjs +8 -1
  149. package/index.d.ts +9 -0
  150. package/languages/all.js +168 -21
  151. package/languages/ar-AR.js +8 -1
  152. package/languages/ar-AR.mjs +8 -1
  153. package/languages/cs-CZ.js +8 -1
  154. package/languages/cs-CZ.mjs +8 -1
  155. package/languages/de-CH.js +8 -1
  156. package/languages/de-CH.mjs +8 -1
  157. package/languages/de-DE.js +8 -1
  158. package/languages/de-DE.mjs +8 -1
  159. package/languages/en-US.js +8 -1
  160. package/languages/en-US.mjs +8 -1
  161. package/languages/es-MX.js +8 -1
  162. package/languages/es-MX.mjs +8 -1
  163. package/languages/fa-IR.js +8 -1
  164. package/languages/fa-IR.mjs +8 -1
  165. package/languages/fr-FR.js +8 -1
  166. package/languages/fr-FR.mjs +8 -1
  167. package/languages/hr-HR.js +8 -1
  168. package/languages/hr-HR.mjs +8 -1
  169. package/languages/index.js +168 -21
  170. package/languages/it-IT.js +8 -1
  171. package/languages/it-IT.mjs +8 -1
  172. package/languages/ja-JP.js +8 -1
  173. package/languages/ja-JP.mjs +8 -1
  174. package/languages/ko-KR.js +8 -1
  175. package/languages/ko-KR.mjs +8 -1
  176. package/languages/lv-LV.js +8 -1
  177. package/languages/lv-LV.mjs +8 -1
  178. package/languages/nb-NO.js +8 -1
  179. package/languages/nb-NO.mjs +8 -1
  180. package/languages/nl-NL.js +8 -1
  181. package/languages/nl-NL.mjs +8 -1
  182. package/languages/pl-PL.js +8 -1
  183. package/languages/pl-PL.mjs +8 -1
  184. package/languages/pt-BR.js +8 -1
  185. package/languages/pt-BR.mjs +8 -1
  186. package/languages/ru-RU.js +8 -1
  187. package/languages/ru-RU.mjs +8 -1
  188. package/languages/sr-SP.js +8 -1
  189. package/languages/sr-SP.mjs +8 -1
  190. package/languages/zh-CN.js +8 -1
  191. package/languages/zh-CN.mjs +8 -1
  192. package/languages/zh-TW.js +8 -1
  193. package/languages/zh-TW.mjs +8 -1
  194. package/package.json +25 -7
  195. package/plugins/autoRowSize/autoRowSize.js +8 -1
  196. package/plugins/autoRowSize/autoRowSize.mjs +8 -1
  197. package/plugins/base/base.js +36 -10
  198. package/plugins/base/base.mjs +36 -10
  199. package/plugins/columnSummary/endpoints.js +13 -3
  200. package/plugins/columnSummary/endpoints.mjs +13 -3
  201. package/plugins/customBorders/customBorders.d.ts +1 -0
  202. package/plugins/customBorders/customBorders.js +32 -2
  203. package/plugins/customBorders/customBorders.mjs +32 -2
  204. package/plugins/dialog/constants.js +7 -0
  205. package/plugins/dialog/constants.mjs +4 -0
  206. package/plugins/dialog/dialog.d.ts +22 -2
  207. package/plugins/dialog/dialog.js +197 -81
  208. package/plugins/dialog/dialog.mjs +196 -81
  209. package/plugins/dialog/templates/base.js +60 -0
  210. package/plugins/dialog/templates/base.mjs +56 -0
  211. package/plugins/dialog/templates/confirm.js +106 -0
  212. package/plugins/dialog/templates/confirm.mjs +102 -0
  213. package/plugins/dialog/templates/index.js +6 -0
  214. package/plugins/dialog/templates/index.mjs +4 -0
  215. package/plugins/dialog/ui.js +125 -41
  216. package/plugins/dialog/ui.mjs +119 -35
  217. package/plugins/emptyDataState/emptyDataState.d.ts +24 -0
  218. package/plugins/emptyDataState/emptyDataState.js +526 -0
  219. package/plugins/emptyDataState/emptyDataState.mjs +521 -0
  220. package/plugins/emptyDataState/index.d.ts +1 -0
  221. package/plugins/emptyDataState/index.js +7 -0
  222. package/plugins/emptyDataState/index.mjs +1 -0
  223. package/plugins/emptyDataState/ui.js +282 -0
  224. package/plugins/emptyDataState/ui.mjs +278 -0
  225. package/plugins/filters/component/value.js +16 -1
  226. package/plugins/filters/component/value.mjs +16 -1
  227. package/plugins/filters/filters.d.ts +5 -1
  228. package/plugins/filters/filters.js +22 -1
  229. package/plugins/filters/filters.mjs +22 -1
  230. package/plugins/filters/ui/multipleSelect.js +90 -79
  231. package/plugins/filters/ui/multipleSelect.mjs +90 -79
  232. package/plugins/index.d.ts +3 -0
  233. package/plugins/index.js +3 -0
  234. package/plugins/index.mjs +3 -1
  235. package/plugins/mergeCells/utils.js +1 -5
  236. package/plugins/mergeCells/utils.mjs +1 -5
  237. package/plugins/pagination/pagination.js +37 -175
  238. package/plugins/pagination/pagination.mjs +37 -175
  239. package/plugins/pagination/strategies/autoPageSize.js +2 -2
  240. package/plugins/pagination/strategies/autoPageSize.mjs +2 -2
  241. package/plugins/pagination/ui.js +6 -10
  242. package/plugins/pagination/ui.mjs +7 -11
  243. package/plugins/stretchColumns/calculator.js +3 -1
  244. package/plugins/stretchColumns/calculator.mjs +3 -1
  245. package/plugins/undoRedo/undoRedo.js +16 -6
  246. package/plugins/undoRedo/undoRedo.mjs +16 -5
  247. package/renderers/checkboxRenderer/checkboxRenderer.js +12 -15
  248. package/renderers/checkboxRenderer/checkboxRenderer.mjs +12 -15
  249. package/selection/selection.js +1 -1
  250. package/selection/selection.mjs +1 -1
  251. package/settings.d.ts +3 -0
  252. package/shortcutContexts/commands/index.js +2 -1
  253. package/shortcutContexts/commands/index.mjs +2 -1
  254. package/shortcutContexts/commands/tabNavigation.js +51 -0
  255. package/shortcutContexts/commands/tabNavigation.mjs +48 -0
  256. package/shortcutContexts/constants.js +16 -1
  257. package/shortcutContexts/constants.mjs +16 -1
  258. package/shortcutContexts/editor.js +2 -2
  259. package/shortcutContexts/editor.mjs +3 -3
  260. package/shortcutContexts/grid.js +19 -3
  261. package/shortcutContexts/grid.mjs +20 -4
  262. package/shortcuts/manager.d.ts +1 -0
  263. package/shortcuts/manager.js +17 -2
  264. package/shortcuts/manager.mjs +17 -2
  265. package/styles/handsontable.css +192 -35
  266. package/styles/handsontable.min.css +3 -3
  267. package/styles/ht-icons-horizon.css +233 -0
  268. package/styles/ht-icons-horizon.min.css +30 -0
  269. package/styles/ht-icons-main.css +233 -0
  270. package/styles/ht-icons-main.min.css +30 -0
  271. package/styles/ht-theme-classic-no-icons.css +399 -0
  272. package/styles/ht-theme-classic-no-icons.min.css +30 -0
  273. package/styles/ht-theme-classic.css +308 -556
  274. package/styles/ht-theme-classic.min.css +3 -3
  275. package/styles/ht-theme-horizon-no-icons.css +405 -0
  276. package/styles/ht-theme-horizon-no-icons.min.css +30 -0
  277. package/styles/ht-theme-horizon.css +312 -556
  278. package/styles/ht-theme-horizon.min.css +3 -3
  279. package/styles/ht-theme-main-no-icons.css +396 -0
  280. package/styles/ht-theme-main-no-icons.min.css +30 -0
  281. package/styles/ht-theme-main.css +303 -556
  282. package/styles/ht-theme-main.min.css +3 -3
  283. package/tableView.js +23 -5
  284. package/tableView.mjs +23 -5
  285. package/utils/dataStructures/uniqueMap.js +10 -0
  286. package/utils/dataStructures/uniqueMap.mjs +10 -0
  287. package/utils/ghostTable.js +0 -3
  288. package/utils/ghostTable.mjs +0 -3
  289. package/utils/stylesHandler.js +19 -4
  290. package/utils/stylesHandler.mjs +19 -4
  291. package/core/focusCatcher/index.js +0 -131
  292. package/core/focusCatcher/index.mjs +0 -127
  293. package/core/focusCatcher/utils.js +0 -31
  294. package/core/focusCatcher/utils.mjs +0 -27
  295. package/plugins/pagination/focusController.js +0 -27
  296. package/plugins/pagination/focusController.mjs +0 -23
package/core.js CHANGED
@@ -24,7 +24,6 @@ var _browser = require("./helpers/browser");
24
24
  var _editorManager = _interopRequireDefault(require("./editorManager"));
25
25
  var _eventManager = _interopRequireDefault(require("./eventManager"));
26
26
  var _object = require("./helpers/object");
27
- var _focusManager = require("./focusManager");
28
27
  var _array = require("./helpers/array");
29
28
  var _parseTable = require("./utils/parseTable");
30
29
  var _staticRegister = require("./utils/staticRegister");
@@ -40,19 +39,18 @@ var _data = require("./helpers/data");
40
39
  var _translations = require("./translations");
41
40
  var _rootInstance = require("./utils/rootInstance");
42
41
  var _src = require("./3rdparty/walkontable/src");
43
- var _hooks = require("./core/hooks");
44
42
  var _registry5 = require("./i18n/registry");
45
43
  var _utils = require("./i18n/utils");
46
44
  var _selection = require("./selection");
47
45
  var _dataMap = require("./dataMap");
48
46
  var _index = require("./core/index");
47
+ var _focusManager = require("./focusManager");
49
48
  var _uniqueMap = require("./utils/dataStructures/uniqueMap");
50
49
  var _shortcuts = require("./shortcuts");
51
50
  var _shortcutContexts = require("./shortcutContexts");
52
51
  var _themes = require("./helpers/themes");
53
52
  var _stylesHandler = require("./utils/stylesHandler");
54
53
  var _console = require("./helpers/console");
55
- var _rangeToRenderableMapper = require("./core/coordsMapper/rangeToRenderableMapper");
56
54
  var _a11yAnnouncer = require("./utils/a11yAnnouncer");
57
55
  var _valueAccessors = require("./utils/valueAccessors");
58
56
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -182,7 +180,7 @@ function Core(rootContainer, userSettings) {
182
180
  let dataSource;
183
181
  let grid;
184
182
  let editorManager;
185
- let focusManager;
183
+ let focusGridManager;
186
184
  let viewportScroller;
187
185
  let firstRun = true;
188
186
  const mergedUserSettings = {
@@ -342,6 +340,7 @@ function Core(rootContainer, userSettings) {
342
340
  * @type {StylesHandler}
343
341
  */
344
342
  this.stylesHandler = new _stylesHandler.StylesHandler({
343
+ hot: instance,
345
344
  rootElement: instance.rootElement,
346
345
  rootDocument: instance.rootDocument,
347
346
  onThemeChange: validThemeName => {
@@ -362,7 +361,7 @@ function Core(rootContainer, userSettings) {
362
361
  mergedUserSettings.language = (0, _registry5.getValidLanguageCode)(mergedUserSettings.language);
363
362
  const settingsWithoutHooks = Object.fromEntries(Object.entries(mergedUserSettings).filter(_ref => {
364
363
  let [key] = _ref;
365
- return !(_hooks.Hooks.getSingleton().isRegistered(key) || _hooks.Hooks.getSingleton().isDeprecated(key));
364
+ return !(_index.Hooks.getSingleton().isRegistered(key) || _index.Hooks.getSingleton().isDeprecated(key));
366
365
  }));
367
366
  const metaManager = new _dataMap.MetaManager(instance, settingsWithoutHooks, [_dataMap.DynamicCellMetaMod, _dataMap.ExtendMetaPropertiesMod]);
368
367
  const tableMeta = metaManager.getTableMeta();
@@ -402,7 +401,7 @@ function Core(rootContainer, userSettings) {
402
401
  });
403
402
  dataSource = new _dataSource.default(instance);
404
403
  const moduleRegisterer = (0, _staticRegister.staticRegister)(this.guid);
405
- moduleRegisterer.register('cellRangeMapper', new _rangeToRenderableMapper.CellRangeToRenderableMapper({
404
+ moduleRegisterer.register('cellRangeMapper', new _index.CellRangeToRenderableMapper({
406
405
  rowIndexMapper: this.rowIndexMapper,
407
406
  columnIndexMapper: this.columnIndexMapper
408
407
  }));
@@ -489,8 +488,14 @@ function Core(rootContainer, userSettings) {
489
488
  this.selection.commit();
490
489
  }
491
490
  };
492
- this.columnIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
493
- this.rowIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
491
+ this.columnIndexMapper.addLocalHook('cacheUpdated', indexesChangesState => {
492
+ onIndexMapperCacheUpdate(indexesChangesState);
493
+ this.runHooks('afterColumnSequenceCacheUpdate', indexesChangesState);
494
+ });
495
+ this.rowIndexMapper.addLocalHook('cacheUpdated', indexesChangesState => {
496
+ onIndexMapperCacheUpdate(indexesChangesState);
497
+ this.runHooks('afterRowSequenceCacheUpdate', indexesChangesState);
498
+ });
494
499
  this.selection.addLocalHook('afterSetRangeEnd', (cellCoords, isLastSelectionLayer) => {
495
500
  const preventScrolling = (0, _object.createObjectPropListener)(false);
496
501
  const selectionRange = this.selection.getSelectedRange();
@@ -1207,9 +1212,8 @@ function Core(rootContainer, userSettings) {
1207
1212
  this.view = new _tableView.default(this);
1208
1213
  editorManager = _editorManager.default.getInstance(instance, tableMeta, selection);
1209
1214
  viewportScroller = (0, _index.createViewportScroller)(instance);
1210
- focusManager = new _focusManager.FocusManager(instance);
1215
+ focusGridManager.init();
1211
1216
  if ((0, _rootInstance.isRootInstance)(this)) {
1212
- (0, _index.installFocusCatcher)(instance);
1213
1217
  (0, _a11yAnnouncer.install)(instance.rootPortalElement);
1214
1218
  (0, _mixed._injectProductInfo)(mergedUserSettings.licenseKey, this.rootWrapperElement);
1215
1219
  }
@@ -2509,6 +2513,9 @@ function Core(rootContainer, userSettings) {
2509
2513
  if ((0, _mixed.isDefined)(settings.ganttChart)) {
2510
2514
  throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');
2511
2515
  }
2516
+ if ((0, _mixed.isDefined)(settings.rowHeights) && (0, _mixed.isDefined)(settings.minRowHeights)) {
2517
+ (0, _console.warn)('Both `rowHeights` and `minRowHeights` are defined in your configuration. ' + 'As one is the alias of the other, only one of them can be used at a time. ' + '`rowHeights` will be used as the row height configuration.');
2518
+ }
2512
2519
 
2513
2520
  // eslint-disable-next-line no-restricted-syntax
2514
2521
  for (i in settings) {
@@ -2519,13 +2526,13 @@ function Core(rootContainer, userSettings) {
2519
2526
  } else if (i === 'tableClassName' && instance.table) {
2520
2527
  setClassName('tableClassName', settings.tableClassName);
2521
2528
  instance.view._wt.wtOverlays.syncOverlayTableClassNames();
2522
- } else if (_hooks.Hooks.getSingleton().isRegistered(i) || _hooks.Hooks.getSingleton().isDeprecated(i)) {
2529
+ } else if (_index.Hooks.getSingleton().isRegistered(i) || _index.Hooks.getSingleton().isDeprecated(i)) {
2523
2530
  const hook = settings[i];
2524
2531
  if ((0, _function.isFunction)(hook)) {
2525
- _hooks.Hooks.getSingleton().addAsFixed(i, hook, instance);
2532
+ _index.Hooks.getSingleton().addAsFixed(i, hook, instance);
2526
2533
  tableMeta[i] = hook;
2527
2534
  } else if (Array.isArray(hook)) {
2528
- _hooks.Hooks.getSingleton().add(i, hook, instance);
2535
+ _index.Hooks.getSingleton().add(i, hook, instance);
2529
2536
  tableMeta[i] = hook;
2530
2537
  }
2531
2538
  } else if (!init && (0, _object.hasOwnProperty)(settings, i)) {
@@ -2548,7 +2555,7 @@ function Core(rootContainer, userSettings) {
2548
2555
  }
2549
2556
  if ((0, _rootInstance.isRootInstance)(instance) && !deprecatedWarnInstances.has(instance) && instance.stylesHandler.isClassicTheme()) {
2550
2557
  // eslint-disable-next-line max-len
2551
- (0, _console.deprecatedWarn)('Handsontable classic theme is a legacy theme and will be removed in version 17.0. Please update your theme settings to ensure compatibility with future versions.');
2558
+ (0, _console.deprecatedWarn)('The stylesheet you are using is deprecated and will be removed in version 17.0. Please update your theme configuration to ensure compatibility with future releases.');
2552
2559
  deprecatedWarnInstances.add(instance);
2553
2560
  }
2554
2561
 
@@ -3757,7 +3764,7 @@ function Core(rootContainer, userSettings) {
3757
3764
  break;
3758
3765
  }
3759
3766
  if (typeof width === 'string') {
3760
- width = parseInt(width, 10);
3767
+ width = Number.parseInt(width, 10);
3761
3768
  }
3762
3769
  }
3763
3770
  return width;
@@ -3792,8 +3799,9 @@ function Core(rootContainer, userSettings) {
3792
3799
  * @returns {number}
3793
3800
  */
3794
3801
  this._getRowHeightFromSettings = function (row) {
3795
- const defaultRowHeight = instance.stylesHandler.getDefaultRowHeight();
3796
- let height = tableMeta.rowHeights;
3802
+ var _tableMeta$rowHeights;
3803
+ const defaultRowHeight = instance.stylesHandler.getDefaultRowHeight(row);
3804
+ let height = (_tableMeta$rowHeights = tableMeta.rowHeights) !== null && _tableMeta$rowHeights !== void 0 ? _tableMeta$rowHeights : tableMeta.minRowHeights;
3797
3805
  if (height !== undefined && height !== null) {
3798
3806
  switch (typeof height) {
3799
3807
  case 'object':
@@ -3807,7 +3815,7 @@ function Core(rootContainer, userSettings) {
3807
3815
  break;
3808
3816
  }
3809
3817
  if (typeof height === 'string') {
3810
- height = parseInt(height, 10);
3818
+ height = Number.parseInt(height, 10);
3811
3819
  }
3812
3820
  }
3813
3821
  return height !== undefined && height !== null && height < defaultRowHeight ? defaultRowHeight : height;
@@ -4448,6 +4456,7 @@ function Core(rootContainer, userSettings) {
4448
4456
  dataSource = null;
4449
4457
  if ((0, _rootInstance.isRootInstance)(this)) {
4450
4458
  (0, _a11yAnnouncer.uninstall)();
4459
+ this.getFocusScopeManager().destroy();
4451
4460
  }
4452
4461
  this.getShortcutManager().destroy();
4453
4462
  moduleRegisterer.clear();
@@ -4476,7 +4485,7 @@ function Core(rootContainer, userSettings) {
4476
4485
  pluginsRegistry.clear();
4477
4486
  instance.runHooks('afterDestroy');
4478
4487
  }, true);
4479
- _hooks.Hooks.getSingleton().destroy(instance);
4488
+ _index.Hooks.getSingleton().destroy(instance);
4480
4489
  (0, _object.objectEach)(instance, (property, key, obj) => {
4481
4490
  // replace instance methods with post mortem
4482
4491
  if ((0, _function.isFunction)(property)) {
@@ -4734,7 +4743,7 @@ function Core(rootContainer, userSettings) {
4734
4743
  * ```
4735
4744
  */
4736
4745
  this.addHook = function (key, callback, orderIndex) {
4737
- _hooks.Hooks.getSingleton().add(key, callback, instance, orderIndex);
4746
+ _index.Hooks.getSingleton().add(key, callback, instance, orderIndex);
4738
4747
  };
4739
4748
 
4740
4749
  /**
@@ -4753,7 +4762,7 @@ function Core(rootContainer, userSettings) {
4753
4762
  * ```
4754
4763
  */
4755
4764
  this.hasHook = function (key) {
4756
- return _hooks.Hooks.getSingleton().has(key, instance) || _hooks.Hooks.getSingleton().has(key);
4765
+ return _index.Hooks.getSingleton().has(key, instance) || _index.Hooks.getSingleton().has(key);
4757
4766
  };
4758
4767
 
4759
4768
  /**
@@ -4775,7 +4784,7 @@ function Core(rootContainer, userSettings) {
4775
4784
  * ```
4776
4785
  */
4777
4786
  this.addHookOnce = function (key, callback, orderIndex) {
4778
- _hooks.Hooks.getSingleton().once(key, callback, instance, orderIndex);
4787
+ _index.Hooks.getSingleton().once(key, callback, instance, orderIndex);
4779
4788
  };
4780
4789
 
4781
4790
  /**
@@ -4793,7 +4802,7 @@ function Core(rootContainer, userSettings) {
4793
4802
  * ```
4794
4803
  */
4795
4804
  this.removeHook = function (key, callback) {
4796
- _hooks.Hooks.getSingleton().remove(key, callback, instance);
4805
+ _index.Hooks.getSingleton().remove(key, callback, instance);
4797
4806
  };
4798
4807
 
4799
4808
  /**
@@ -4820,7 +4829,7 @@ function Core(rootContainer, userSettings) {
4820
4829
  * ```
4821
4830
  */
4822
4831
  this.runHooks = function (key, p1, p2, p3, p4, p5, p6) {
4823
- return _hooks.Hooks.getSingleton().run(instance, key, p1, p2, p3, p4, p5, p6);
4832
+ return _index.Hooks.getSingleton().run(instance, key, p1, p2, p3, p4, p5, p6);
4824
4833
  };
4825
4834
 
4826
4835
  /**
@@ -5031,6 +5040,8 @@ function Core(rootContainer, userSettings) {
5031
5040
  this.getShortcutManager = function () {
5032
5041
  return shortcutManager;
5033
5042
  };
5043
+ focusGridManager = new _focusManager.FocusGridManager(instance);
5044
+ const focusScopeManager = (0, _rootInstance.isRootInstance)(this) ? (0, _focusManager.createFocusScopeManager)(instance) : null;
5034
5045
 
5035
5046
  /**
5036
5047
  * Return the Focus Manager responsible for managing the browser's focus in the table.
@@ -5041,13 +5052,43 @@ function Core(rootContainer, userSettings) {
5041
5052
  * @returns {FocusManager}
5042
5053
  */
5043
5054
  this.getFocusManager = function () {
5044
- return focusManager;
5055
+ return focusGridManager;
5056
+ };
5057
+
5058
+ /**
5059
+ * Returns the Focus Scope Manager. The module allows to register focus scopes for different parts of the grid
5060
+ * e.g. for dialogs, pagination, and other plugins that have own UI elements and need separate context.
5061
+ *
5062
+ * @memberof Core#
5063
+ * @since 16.2.0
5064
+ * @function getFocusScopeManager
5065
+ * @returns {FocusScopeManager} Instance of {@link FocusScopeManager}
5066
+ *
5067
+ * @example
5068
+ * ```js
5069
+ * hot.getFocusScopeManager().registerScope('myPluginName', containerElement, {
5070
+ * shortcutsContextName: 'plugin:myPluginName',
5071
+ * onActivate: (focusSource) => {
5072
+ * // Focus the internal focusable element within the plugin UI element
5073
+ * // depends on the activation focus source.
5074
+ * },
5075
+ * });
5076
+ * ```
5077
+ */
5078
+ this.getFocusScopeManager = function () {
5079
+ if (!(0, _rootInstance.isRootInstance)(instance)) {
5080
+ throw new Error('The FocusScopeManager is only available for the main Handsontable instance.');
5081
+ }
5082
+ return focusScopeManager;
5045
5083
  };
5046
5084
  (0, _registry.getPluginsNames)().forEach(pluginName => {
5047
5085
  const PluginClass = (0, _registry.getPlugin)(pluginName);
5048
5086
  pluginsRegistry.addItem(pluginName, new PluginClass(this));
5049
5087
  });
5050
5088
  (0, _shortcutContexts.registerAllShortcutContexts)(instance);
5089
+ if ((0, _rootInstance.isRootInstance)(this)) {
5090
+ (0, _focusManager.registerAllFocusScopes)(instance);
5091
+ }
5051
5092
  shortcutManager.setActiveContextName('grid');
5052
- _hooks.Hooks.getSingleton().run(instance, 'construct');
5093
+ _index.Hooks.getSingleton().run(instance, 'construct');
5053
5094
  }
package/core.mjs CHANGED
@@ -20,7 +20,6 @@ import { isMobileBrowser, isIpadOS } from "./helpers/browser.mjs";
20
20
  import EditorManager from "./editorManager.mjs";
21
21
  import EventManager from "./eventManager.mjs";
22
22
  import { deepClone, duckSchema, isObjectEqual, isObject, deepObjectSize, hasOwnProperty, createObjectPropListener, objectEach } from "./helpers/object.mjs";
23
- import { FocusManager } from "./focusManager.mjs";
24
23
  import { arrayMap, arrayEach, arrayReduce, getDifferenceOfArrays, stringToArray, pivot } from "./helpers/array.mjs";
25
24
  import { instanceToHTML } from "./utils/parseTable.mjs";
26
25
  import { staticRegister } from "./utils/staticRegister.mjs";
@@ -36,19 +35,18 @@ import { spreadsheetColumnLabel } from "./helpers/data.mjs";
36
35
  import { IndexMapper } from "./translations/index.mjs";
37
36
  import { registerAsRootInstance, hasValidParameter, isRootInstance } from "./utils/rootInstance.mjs";
38
37
  import { DEFAULT_COLUMN_WIDTH } from "./3rdparty/walkontable/src/index.mjs";
39
- import { Hooks } from "./core/hooks/index.mjs";
40
38
  import { hasLanguageDictionary, getValidLanguageCode, getTranslatedPhrase } from "./i18n/registry.mjs";
41
39
  import { warnUserAboutLanguageRegistration, normalizeLanguageCode } from "./i18n/utils.mjs";
42
40
  import { Selection } from "./selection/index.mjs";
43
41
  import { MetaManager, DynamicCellMetaMod, ExtendMetaPropertiesMod, replaceData } from "./dataMap/index.mjs";
44
- import { installFocusCatcher, createViewportScroller } from "./core/index.mjs";
42
+ import { createViewportScroller, Hooks, CellRangeToRenderableMapper } from "./core/index.mjs";
43
+ import { FocusGridManager, createFocusScopeManager, registerAllFocusScopes } from "./focusManager/index.mjs";
45
44
  import { createUniqueMap } from "./utils/dataStructures/uniqueMap.mjs";
46
45
  import { createShortcutManager } from "./shortcuts/index.mjs";
47
46
  import { registerAllShortcutContexts } from "./shortcutContexts/index.mjs";
48
47
  import { getThemeClassName } from "./helpers/themes.mjs";
49
48
  import { StylesHandler } from "./utils/stylesHandler.mjs";
50
49
  import { deprecatedWarn, warn } from "./helpers/console.mjs";
51
- import { CellRangeToRenderableMapper } from "./core/coordsMapper/rangeToRenderableMapper.mjs";
52
50
  import { install as installAccessibilityAnnouncer, uninstall as uninstallAccessibilityAnnouncer } from "./utils/a11yAnnouncer.mjs";
53
51
  import { getValueSetterValue } from "./utils/valueAccessors.mjs";
54
52
  let activeGuid = null;
@@ -177,7 +175,7 @@ export default function Core(rootContainer, userSettings) {
177
175
  let dataSource;
178
176
  let grid;
179
177
  let editorManager;
180
- let focusManager;
178
+ let focusGridManager;
181
179
  let viewportScroller;
182
180
  let firstRun = true;
183
181
  const mergedUserSettings = {
@@ -337,6 +335,7 @@ export default function Core(rootContainer, userSettings) {
337
335
  * @type {StylesHandler}
338
336
  */
339
337
  this.stylesHandler = new StylesHandler({
338
+ hot: instance,
340
339
  rootElement: instance.rootElement,
341
340
  rootDocument: instance.rootDocument,
342
341
  onThemeChange: validThemeName => {
@@ -484,8 +483,14 @@ export default function Core(rootContainer, userSettings) {
484
483
  this.selection.commit();
485
484
  }
486
485
  };
487
- this.columnIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
488
- this.rowIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
486
+ this.columnIndexMapper.addLocalHook('cacheUpdated', indexesChangesState => {
487
+ onIndexMapperCacheUpdate(indexesChangesState);
488
+ this.runHooks('afterColumnSequenceCacheUpdate', indexesChangesState);
489
+ });
490
+ this.rowIndexMapper.addLocalHook('cacheUpdated', indexesChangesState => {
491
+ onIndexMapperCacheUpdate(indexesChangesState);
492
+ this.runHooks('afterRowSequenceCacheUpdate', indexesChangesState);
493
+ });
489
494
  this.selection.addLocalHook('afterSetRangeEnd', (cellCoords, isLastSelectionLayer) => {
490
495
  const preventScrolling = createObjectPropListener(false);
491
496
  const selectionRange = this.selection.getSelectedRange();
@@ -1202,9 +1207,8 @@ export default function Core(rootContainer, userSettings) {
1202
1207
  this.view = new TableView(this);
1203
1208
  editorManager = EditorManager.getInstance(instance, tableMeta, selection);
1204
1209
  viewportScroller = createViewportScroller(instance);
1205
- focusManager = new FocusManager(instance);
1210
+ focusGridManager.init();
1206
1211
  if (isRootInstance(this)) {
1207
- installFocusCatcher(instance);
1208
1212
  installAccessibilityAnnouncer(instance.rootPortalElement);
1209
1213
  _injectProductInfo(mergedUserSettings.licenseKey, this.rootWrapperElement);
1210
1214
  }
@@ -2504,6 +2508,9 @@ export default function Core(rootContainer, userSettings) {
2504
2508
  if (isDefined(settings.ganttChart)) {
2505
2509
  throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');
2506
2510
  }
2511
+ if (isDefined(settings.rowHeights) && isDefined(settings.minRowHeights)) {
2512
+ warn('Both `rowHeights` and `minRowHeights` are defined in your configuration. ' + 'As one is the alias of the other, only one of them can be used at a time. ' + '`rowHeights` will be used as the row height configuration.');
2513
+ }
2507
2514
 
2508
2515
  // eslint-disable-next-line no-restricted-syntax
2509
2516
  for (i in settings) {
@@ -2543,7 +2550,7 @@ export default function Core(rootContainer, userSettings) {
2543
2550
  }
2544
2551
  if (isRootInstance(instance) && !deprecatedWarnInstances.has(instance) && instance.stylesHandler.isClassicTheme()) {
2545
2552
  // eslint-disable-next-line max-len
2546
- deprecatedWarn('Handsontable classic theme is a legacy theme and will be removed in version 17.0. Please update your theme settings to ensure compatibility with future versions.');
2553
+ deprecatedWarn('The stylesheet you are using is deprecated and will be removed in version 17.0. Please update your theme configuration to ensure compatibility with future releases.');
2547
2554
  deprecatedWarnInstances.add(instance);
2548
2555
  }
2549
2556
 
@@ -3752,7 +3759,7 @@ export default function Core(rootContainer, userSettings) {
3752
3759
  break;
3753
3760
  }
3754
3761
  if (typeof width === 'string') {
3755
- width = parseInt(width, 10);
3762
+ width = Number.parseInt(width, 10);
3756
3763
  }
3757
3764
  }
3758
3765
  return width;
@@ -3787,8 +3794,9 @@ export default function Core(rootContainer, userSettings) {
3787
3794
  * @returns {number}
3788
3795
  */
3789
3796
  this._getRowHeightFromSettings = function (row) {
3790
- const defaultRowHeight = instance.stylesHandler.getDefaultRowHeight();
3791
- let height = tableMeta.rowHeights;
3797
+ var _tableMeta$rowHeights;
3798
+ const defaultRowHeight = instance.stylesHandler.getDefaultRowHeight(row);
3799
+ let height = (_tableMeta$rowHeights = tableMeta.rowHeights) !== null && _tableMeta$rowHeights !== void 0 ? _tableMeta$rowHeights : tableMeta.minRowHeights;
3792
3800
  if (height !== undefined && height !== null) {
3793
3801
  switch (typeof height) {
3794
3802
  case 'object':
@@ -3802,7 +3810,7 @@ export default function Core(rootContainer, userSettings) {
3802
3810
  break;
3803
3811
  }
3804
3812
  if (typeof height === 'string') {
3805
- height = parseInt(height, 10);
3813
+ height = Number.parseInt(height, 10);
3806
3814
  }
3807
3815
  }
3808
3816
  return height !== undefined && height !== null && height < defaultRowHeight ? defaultRowHeight : height;
@@ -4443,6 +4451,7 @@ export default function Core(rootContainer, userSettings) {
4443
4451
  dataSource = null;
4444
4452
  if (isRootInstance(this)) {
4445
4453
  uninstallAccessibilityAnnouncer();
4454
+ this.getFocusScopeManager().destroy();
4446
4455
  }
4447
4456
  this.getShortcutManager().destroy();
4448
4457
  moduleRegisterer.clear();
@@ -5026,6 +5035,8 @@ export default function Core(rootContainer, userSettings) {
5026
5035
  this.getShortcutManager = function () {
5027
5036
  return shortcutManager;
5028
5037
  };
5038
+ focusGridManager = new FocusGridManager(instance);
5039
+ const focusScopeManager = isRootInstance(this) ? createFocusScopeManager(instance) : null;
5029
5040
 
5030
5041
  /**
5031
5042
  * Return the Focus Manager responsible for managing the browser's focus in the table.
@@ -5036,13 +5047,43 @@ export default function Core(rootContainer, userSettings) {
5036
5047
  * @returns {FocusManager}
5037
5048
  */
5038
5049
  this.getFocusManager = function () {
5039
- return focusManager;
5050
+ return focusGridManager;
5051
+ };
5052
+
5053
+ /**
5054
+ * Returns the Focus Scope Manager. The module allows to register focus scopes for different parts of the grid
5055
+ * e.g. for dialogs, pagination, and other plugins that have own UI elements and need separate context.
5056
+ *
5057
+ * @memberof Core#
5058
+ * @since 16.2.0
5059
+ * @function getFocusScopeManager
5060
+ * @returns {FocusScopeManager} Instance of {@link FocusScopeManager}
5061
+ *
5062
+ * @example
5063
+ * ```js
5064
+ * hot.getFocusScopeManager().registerScope('myPluginName', containerElement, {
5065
+ * shortcutsContextName: 'plugin:myPluginName',
5066
+ * onActivate: (focusSource) => {
5067
+ * // Focus the internal focusable element within the plugin UI element
5068
+ * // depends on the activation focus source.
5069
+ * },
5070
+ * });
5071
+ * ```
5072
+ */
5073
+ this.getFocusScopeManager = function () {
5074
+ if (!isRootInstance(instance)) {
5075
+ throw new Error('The FocusScopeManager is only available for the main Handsontable instance.');
5076
+ }
5077
+ return focusScopeManager;
5040
5078
  };
5041
5079
  getPluginsNames().forEach(pluginName => {
5042
5080
  const PluginClass = getPlugin(pluginName);
5043
5081
  pluginsRegistry.addItem(pluginName, new PluginClass(this));
5044
5082
  });
5045
5083
  registerAllShortcutContexts(instance);
5084
+ if (isRootInstance(this)) {
5085
+ registerAllFocusScopes(instance);
5086
+ }
5046
5087
  shortcutManager.setActiveContextName('grid');
5047
5088
  Hooks.getSingleton().run(instance, 'construct');
5048
5089
  }