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
@@ -2,6 +2,8 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
+ require("core-js/modules/es.array.at.js");
6
+ require("core-js/modules/es.string.at-alternative.js");
5
7
  require("core-js/modules/esnext.iterator.constructor.js");
6
8
  require("core-js/modules/esnext.iterator.for-each.js");
7
9
  require("core-js/modules/esnext.iterator.map.js");
@@ -14,8 +16,6 @@ var _a11yAnnouncer = require("../../utils/a11yAnnouncer");
14
16
  var _strategies = require("./strategies");
15
17
  var _templateLiteralTag = require("../../helpers/templateLiteralTag");
16
18
  var _console = require("../../helpers/console");
17
- var _focusController2 = require("./focusController");
18
- var _focusDetector2 = require("../../utils/focusDetector");
19
19
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
20
20
  function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
21
21
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
@@ -24,7 +24,6 @@ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a),
24
24
  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"); }
25
25
  const PLUGIN_KEY = exports.PLUGIN_KEY = 'pagination';
26
26
  const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 900;
27
- const SHORTCUTS_GROUP = PLUGIN_KEY;
28
27
  const SHORTCUTS_CONTEXT_NAME = `plugin:${PLUGIN_KEY}`;
29
28
  const AUTO_PAGE_SIZE_WARNING = (0, _templateLiteralTag.toSingleLine)`The \`auto\` page size setting requires the \`autoRowSize\`\x20
30
29
  plugin to be enabled. Set the \`autoRowSize: true\` in the configuration to ensure correct behavior.`;
@@ -110,15 +109,13 @@ var _ui = /*#__PURE__*/new WeakMap();
110
109
  var _calcStrategy = /*#__PURE__*/new WeakMap();
111
110
  var _internalExecutionCall = /*#__PURE__*/new WeakMap();
112
111
  var _internalRenderCall = /*#__PURE__*/new WeakMap();
113
- var _focusController = /*#__PURE__*/new WeakMap();
114
- var _focusDetector = /*#__PURE__*/new WeakMap();
115
112
  var _Pagination_brand = /*#__PURE__*/new WeakSet();
116
113
  var _onIndexCacheUpdate = /*#__PURE__*/new WeakMap();
117
114
  class Pagination extends _base.BasePlugin {
118
115
  constructor() {
119
116
  super(...arguments);
120
117
  /**
121
- * Bind the events used by the plugin.
118
+ * Updates the visibility state of the pagination sections based on the current settings.
122
119
  */
123
120
  _classPrivateMethodInitSpec(this, _Pagination_brand);
124
121
  /**
@@ -168,18 +165,6 @@ class Pagination extends _base.BasePlugin {
168
165
  * @type {boolean}
169
166
  */
170
167
  _classPrivateFieldInitSpec(this, _internalRenderCall, false);
171
- /**
172
- * Pagination focus controller instance.
173
- *
174
- * @type {PaginationController}
175
- */
176
- _classPrivateFieldInitSpec(this, _focusController, null);
177
- /**
178
- * Pagination focus detector instance.
179
- *
180
- * @type {object}
181
- */
182
- _classPrivateFieldInitSpec(this, _focusDetector, null);
183
168
  /**
184
169
  * IndexMapper cache update listener. Once the cache is updated, we need to recompute
185
170
  * the pagination state.
@@ -259,35 +244,8 @@ class Pagination extends _base.BasePlugin {
259
244
  a11yAnnouncer: message => (0, _a11yAnnouncer.announce)(message)
260
245
  }));
261
246
  _assertClassBrand(_Pagination_brand, this, _updateSectionsVisibilityState).call(this);
262
- _classPrivateFieldGet(_ui, this).addLocalHook('firstPageClick', () => this.firstPage()).addLocalHook('prevPageClick', () => this.prevPage()).addLocalHook('nextPageClick', () => this.nextPage()).addLocalHook('lastPageClick', () => this.lastPage()).addLocalHook('pageSizeChange', pageSize => this.setPageSize(pageSize)).addLocalHook('focus', element => {
263
- _classPrivateFieldGet(_focusController, this).setCurrentPage(_classPrivateFieldGet(_ui, this).getFocusableElements().indexOf(element));
264
- this.hot.unlisten();
265
- this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
266
- this.hot.listen();
267
- _classPrivateFieldGet(_focusDetector, this).deactivate();
268
- });
247
+ _classPrivateFieldGet(_ui, this).addLocalHook('firstPageClick', () => this.firstPage()).addLocalHook('prevPageClick', () => this.prevPage()).addLocalHook('nextPageClick', () => this.nextPage()).addLocalHook('lastPageClick', () => this.lastPage()).addLocalHook('pageSizeChange', pageSize => this.setPageSize(pageSize));
269
248
  }
270
- if (!_classPrivateFieldGet(_focusController, this)) {
271
- _classPrivateFieldSet(_focusController, this, (0, _focusController2.createPaginationFocusController)({
272
- focusableElements: () => _classPrivateFieldGet(_ui, this).getFocusableElements()
273
- }));
274
- }
275
- if (!_classPrivateFieldGet(_focusDetector, this)) {
276
- _classPrivateFieldSet(_focusDetector, this, (0, _focusDetector2.installFocusDetector)(this.hot, _classPrivateFieldGet(_ui, this).getContainer(), {
277
- onFocus: from => {
278
- this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
279
- this.hot.listen();
280
- if (from === 'from_above') {
281
- _classPrivateFieldGet(_focusController, this).toFirstItem();
282
- } else {
283
- _classPrivateFieldGet(_focusController, this).toLastItem();
284
- }
285
- _classPrivateFieldGet(_focusDetector, this).deactivate();
286
- }
287
- }));
288
- }
289
- _assertClassBrand(_Pagination_brand, this, _registerEvents).call(this);
290
- _assertClassBrand(_Pagination_brand, this, _registerShortcuts).call(this);
291
249
 
292
250
  // Place the onInit hook before others to make sure that the pagination state is computed
293
251
  // and applied to the index mapper before AutoColumnSize plugin begins calculate the column sizes.
@@ -351,37 +309,20 @@ class Pagination extends _base.BasePlugin {
351
309
  }
352
310
  return _assertClassBrand(_Pagination_brand, _this, _onAfterLanguageChange).call(_this, ...args);
353
311
  });
354
- this.addHook('modifyRowHeight', function () {
312
+ this.addHook('beforeHeightChange', function () {
355
313
  for (var _len1 = arguments.length, args = new Array(_len1), _key1 = 0; _key1 < _len1; _key1++) {
356
314
  args[_key1] = arguments[_key1];
357
315
  }
358
- return _assertClassBrand(_Pagination_brand, _this, _onModifyRowHeight).call(_this, ...args);
359
- });
360
- this.addHook('beforeHeightChange', function () {
361
- for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
362
- args[_key10] = arguments[_key10];
363
- }
364
316
  return _assertClassBrand(_Pagination_brand, _this, _onBeforeHeightChange).call(_this, ...args);
365
317
  });
366
318
  this.addHook('afterSetTheme', function () {
367
- for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
368
- args[_key11] = arguments[_key11];
319
+ for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
320
+ args[_key10] = arguments[_key10];
369
321
  }
370
322
  return _assertClassBrand(_Pagination_brand, _this, _onAfterSetTheme).call(_this, ...args);
371
323
  });
372
- this.addHook('afterDialogShow', function () {
373
- for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
374
- args[_key12] = arguments[_key12];
375
- }
376
- return _assertClassBrand(_Pagination_brand, _this, _onAfterDialogShow).call(_this, ...args);
377
- });
378
- this.addHook('beforeDialogHide', function () {
379
- for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
380
- args[_key13] = arguments[_key13];
381
- }
382
- return _assertClassBrand(_Pagination_brand, _this, _onAfterDialogHide).call(_this, ...args);
383
- });
384
324
  this.hot.rowIndexMapper.addLocalHook('cacheUpdated', _classPrivateFieldGet(_onIndexCacheUpdate, this));
325
+ _assertClassBrand(_Pagination_brand, this, _registerFocusScope).call(this);
385
326
  super.enablePlugin();
386
327
  }
387
328
 
@@ -400,11 +341,12 @@ class Pagination extends _base.BasePlugin {
400
341
  */
401
342
  disablePlugin() {
402
343
  this.hot.rowIndexMapper.removeLocalHook('cacheUpdated', _classPrivateFieldGet(_onIndexCacheUpdate, this)).unregisterMap(this.pluginName);
344
+ _assertClassBrand(_Pagination_brand, this, _unregisterFocusScope).call(this);
403
345
  _classPrivateFieldGet(_ui, this).destroy();
404
346
  _classPrivateFieldSet(_ui, this, null);
405
- _assertClassBrand(_Pagination_brand, this, _unregisterShortcuts).call(this);
406
347
  super.disablePlugin();
407
348
  }
349
+
408
350
  /**
409
351
  * Gets the pagination current state. Returns an object with the following properties:
410
352
  * - `currentPage`: The current page number.
@@ -660,11 +602,6 @@ class Pagination extends _base.BasePlugin {
660
602
  _classPrivateFieldGet(_ui, this).setNavigationSectionVisibility(false);
661
603
  this.hot.runHooks('afterPageNavigationVisibilityChange', false);
662
604
  }
663
-
664
- /**
665
- * Updates the visibility state of the pagination sections based on the current settings.
666
- */
667
-
668
605
  /**
669
606
  * Destroys the plugin instance.
670
607
  */
@@ -678,59 +615,6 @@ class Pagination extends _base.BasePlugin {
678
615
  }
679
616
  }
680
617
  exports.Pagination = Pagination;
681
- function _registerEvents() {
682
- // TODO: move to general focus manager module
683
- this.eventManager.addEventListener(this.hot.rootDocument, 'mouseup', event => {
684
- const container = _classPrivateFieldGet(_ui, this).getContainer();
685
- if (!container.contains(event.target) && this.hot.getShortcutManager().getActiveContextName() === SHORTCUTS_CONTEXT_NAME) {
686
- _classPrivateFieldGet(_focusDetector, this).activate();
687
- _classPrivateFieldGet(_focusController, this).clear();
688
- this.hot.getShortcutManager().setActiveContextName('grid');
689
- }
690
- });
691
- }
692
- /**
693
- * Register shortcuts responsible for navigating through the pagination.
694
- */
695
- function _registerShortcuts() {
696
- var _manager$getContext;
697
- const manager = this.hot.getShortcutManager();
698
- const pluginContext = (_manager$getContext = manager.getContext(SHORTCUTS_CONTEXT_NAME)) !== null && _manager$getContext !== void 0 ? _manager$getContext : manager.addContext(SHORTCUTS_CONTEXT_NAME, 'global');
699
- pluginContext.addShortcut({
700
- keys: [['Shift', 'Tab'], ['Tab']],
701
- preventDefault: false,
702
- callback: event => {
703
- let previousIndex = _classPrivateFieldGet(_focusController, this).getCurrentPage();
704
- if (event.shiftKey) {
705
- _classPrivateFieldGet(_focusController, this).toPreviousItem();
706
- const currentPage = _classPrivateFieldGet(_focusController, this).getCurrentPage();
707
- if (currentPage >= previousIndex) {
708
- _assertClassBrand(_Pagination_brand, this, _unFocusPagination).call(this);
709
- return;
710
- }
711
- previousIndex = currentPage;
712
- } else {
713
- _classPrivateFieldGet(_focusController, this).toNextItem();
714
- const currentPage = _classPrivateFieldGet(_focusController, this).getCurrentPage();
715
- if (currentPage <= previousIndex) {
716
- _assertClassBrand(_Pagination_brand, this, _unFocusPagination).call(this);
717
- return;
718
- }
719
- previousIndex = currentPage;
720
- }
721
- event.preventDefault();
722
- },
723
- group: SHORTCUTS_GROUP
724
- });
725
- }
726
- /**
727
- * Unregister shortcuts responsible for navigating through the pagination.
728
- */
729
- function _unregisterShortcuts() {
730
- const shortcutManager = this.hot.getShortcutManager();
731
- const pluginContext = shortcutManager.getContext(SHORTCUTS_CONTEXT_NAME);
732
- pluginContext.removeShortcutsByGroup(SHORTCUTS_GROUP);
733
- }
734
618
  function _updateSectionsVisibilityState() {
735
619
  if (this.getSetting('showPageSize')) {
736
620
  this.showPageSizeSection();
@@ -778,10 +662,10 @@ function _computeAndApplyState() {
778
662
  return view.getViewportHeight() - scrollbarWidth;
779
663
  },
780
664
  itemsSizeProvider: () => {
781
- const defaultRowHeight = stylesHandler.getDefaultRowHeight();
782
665
  const rowHeights = this.hot.rowIndexMapper.getRenderableIndexes().map(physicalIndex => {
783
666
  var _this$hot$getRowHeigh;
784
- return (_this$hot$getRowHeigh = this.hot.getRowHeight(this.hot.toVisualRow(physicalIndex))) !== null && _this$hot$getRowHeigh !== void 0 ? _this$hot$getRowHeigh : defaultRowHeight;
667
+ const visualRowIndex = this.hot.toVisualRow(physicalIndex);
668
+ return (_this$hot$getRowHeigh = this.hot.getRowHeight(visualRowIndex)) !== null && _this$hot$getRowHeigh !== void 0 ? _this$hot$getRowHeigh : stylesHandler.getDefaultRowHeight(visualRowIndex);
785
669
  });
786
670
  return rowHeights;
787
671
  }
@@ -808,11 +692,6 @@ function _computeAndApplyState() {
808
692
  ...paginationData,
809
693
  totalRenderedRows: renderableRowsLength
810
694
  });
811
- if ((this.getSetting('showPageSize') || this.getSetting('showNavigation')) && paginationData.totalPages > 1) {
812
- _classPrivateFieldGet(_focusDetector, this).activate();
813
- } else {
814
- _classPrivateFieldGet(_focusDetector, this).deactivate();
815
- }
816
695
  }
817
696
  /**
818
697
  * Based on the external factors (like the scroll position of the table, size etc.) it computes
@@ -838,6 +717,31 @@ function _computeNeedsBorder() {
838
717
  } = this.getPaginationData();
839
718
  return view.getLastFullyVisibleRow() !== lastVisibleRowIndex;
840
719
  }
720
+ /**
721
+ * Registers the focus scope for the pagination plugin.
722
+ */
723
+ function _registerFocusScope() {
724
+ this.hot.getFocusScopeManager().registerScope(PLUGIN_KEY, _classPrivateFieldGet(_ui, this).getContainer(), {
725
+ shortcutsContextName: SHORTCUTS_CONTEXT_NAME,
726
+ runOnlyIf: () => this.getSetting('showPageSize') || this.getSetting('showNavigation'),
727
+ onActivate: focusSource => {
728
+ const focusableElements = _classPrivateFieldGet(_ui, this).getFocusableElements();
729
+ if (focusableElements.length > 0) {
730
+ if (focusSource === 'tab_from_above') {
731
+ focusableElements.at(0).focus();
732
+ } else if (focusSource === 'tab_from_below') {
733
+ focusableElements.at(-1).focus();
734
+ }
735
+ }
736
+ }
737
+ });
738
+ }
739
+ /**
740
+ * Unregisters the focus scope for the pagination plugin.
741
+ */
742
+ function _unregisterFocusScope() {
743
+ this.hot.getFocusScopeManager().unregisterScope(PLUGIN_KEY);
744
+ }
841
745
  /**
842
746
  * Called before the selection of columns or all table is made. It modifies the selection rows range
843
747
  * to the range of the current page.
@@ -912,27 +816,6 @@ function _onBeforePaste(pastedData, ranges) {
912
816
  pastedData.splice(0, rowsToRemove);
913
817
  });
914
818
  }
915
- /**
916
- * Called when the row height is modified. It adds 1px border top compensation for
917
- * the first row of the each page to make sure that the table's hider element
918
- * height is correctly calculated.
919
- *
920
- * @param {number | undefined} height Row height.
921
- * @param {number} row Visual row index.
922
- * @returns {number}
923
- */
924
- function _onModifyRowHeight(height, row) {
925
- if (height === undefined || !_classPrivateFieldGet(_calcStrategy, this).getState(_classPrivateFieldGet(_currentPage, this))) {
926
- return;
927
- }
928
- const {
929
- firstVisibleRowIndex
930
- } = this.getPaginationData();
931
- if (row !== 0 && row === firstVisibleRowIndex) {
932
- height += 1; // 1px border top compensation for the first row of the page.
933
- }
934
- return height;
935
- }
936
819
  /**
937
820
  * Called after the view is rendered. It recalculates the pagination state only when
938
821
  * the `pageSize` is set to `'auto'`. In this case, the plugin will compute the
@@ -1010,25 +893,4 @@ function _onAfterLanguageChange() {
1010
893
  */
1011
894
  function _onAfterSetTheme(themeName) {
1012
895
  _classPrivateFieldGet(_ui, this).updateTheme(themeName);
1013
- }
1014
- /**
1015
- * Unfocuses the pagination and sets the active context for the shortcuts.
1016
- */
1017
- function _unFocusPagination() {
1018
- _classPrivateFieldGet(_focusDetector, this).activate();
1019
- _classPrivateFieldGet(_focusController, this).clear();
1020
- this.hot.unlisten();
1021
- this.hot.getShortcutManager().setActiveContextName('grid');
1022
- }
1023
- /**
1024
- * Called after the dialog is shown. It sets the active context for the shortcuts.
1025
- */
1026
- function _onAfterDialogShow() {
1027
- _classPrivateFieldGet(_focusDetector, this).deactivate();
1028
- }
1029
- /**
1030
- * Called after the dialog is hidden. It sets the active context for the shortcuts.
1031
- */
1032
- function _onAfterDialogHide() {
1033
- _classPrivateFieldGet(_focusDetector, this).activate();
1034
896
  }
@@ -1,4 +1,6 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
+ import "core-js/modules/es.array.at.js";
3
+ import "core-js/modules/es.string.at-alternative.js";
2
4
  import "core-js/modules/esnext.iterator.constructor.js";
3
5
  import "core-js/modules/esnext.iterator.for-each.js";
4
6
  import "core-js/modules/esnext.iterator.map.js";
@@ -17,11 +19,8 @@ import { announce } from "../../utils/a11yAnnouncer.mjs";
17
19
  import { createPaginatorStrategy } from "./strategies/index.mjs";
18
20
  import { toSingleLine } from "../../helpers/templateLiteralTag.mjs";
19
21
  import { warn } from "../../helpers/console.mjs";
20
- import { createPaginationFocusController } from "./focusController.mjs";
21
- import { installFocusDetector } from "../../utils/focusDetector.mjs";
22
22
  export const PLUGIN_KEY = 'pagination';
23
23
  export const PLUGIN_PRIORITY = 900;
24
- const SHORTCUTS_GROUP = PLUGIN_KEY;
25
24
  const SHORTCUTS_CONTEXT_NAME = `plugin:${PLUGIN_KEY}`;
26
25
  const AUTO_PAGE_SIZE_WARNING = toSingleLine`The \`auto\` page size setting requires the \`autoRowSize\`\x20
27
26
  plugin to be enabled. Set the \`autoRowSize: true\` in the configuration to ensure correct behavior.`;
@@ -107,15 +106,13 @@ var _ui = /*#__PURE__*/new WeakMap();
107
106
  var _calcStrategy = /*#__PURE__*/new WeakMap();
108
107
  var _internalExecutionCall = /*#__PURE__*/new WeakMap();
109
108
  var _internalRenderCall = /*#__PURE__*/new WeakMap();
110
- var _focusController = /*#__PURE__*/new WeakMap();
111
- var _focusDetector = /*#__PURE__*/new WeakMap();
112
109
  var _Pagination_brand = /*#__PURE__*/new WeakSet();
113
110
  var _onIndexCacheUpdate = /*#__PURE__*/new WeakMap();
114
111
  export class Pagination extends BasePlugin {
115
112
  constructor() {
116
113
  super(...arguments);
117
114
  /**
118
- * Bind the events used by the plugin.
115
+ * Updates the visibility state of the pagination sections based on the current settings.
119
116
  */
120
117
  _classPrivateMethodInitSpec(this, _Pagination_brand);
121
118
  /**
@@ -165,18 +162,6 @@ export class Pagination extends BasePlugin {
165
162
  * @type {boolean}
166
163
  */
167
164
  _classPrivateFieldInitSpec(this, _internalRenderCall, false);
168
- /**
169
- * Pagination focus controller instance.
170
- *
171
- * @type {PaginationController}
172
- */
173
- _classPrivateFieldInitSpec(this, _focusController, null);
174
- /**
175
- * Pagination focus detector instance.
176
- *
177
- * @type {object}
178
- */
179
- _classPrivateFieldInitSpec(this, _focusDetector, null);
180
165
  /**
181
166
  * IndexMapper cache update listener. Once the cache is updated, we need to recompute
182
167
  * the pagination state.
@@ -256,35 +241,8 @@ export class Pagination extends BasePlugin {
256
241
  a11yAnnouncer: message => announce(message)
257
242
  }));
258
243
  _assertClassBrand(_Pagination_brand, this, _updateSectionsVisibilityState).call(this);
259
- _classPrivateFieldGet(_ui, this).addLocalHook('firstPageClick', () => this.firstPage()).addLocalHook('prevPageClick', () => this.prevPage()).addLocalHook('nextPageClick', () => this.nextPage()).addLocalHook('lastPageClick', () => this.lastPage()).addLocalHook('pageSizeChange', pageSize => this.setPageSize(pageSize)).addLocalHook('focus', element => {
260
- _classPrivateFieldGet(_focusController, this).setCurrentPage(_classPrivateFieldGet(_ui, this).getFocusableElements().indexOf(element));
261
- this.hot.unlisten();
262
- this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
263
- this.hot.listen();
264
- _classPrivateFieldGet(_focusDetector, this).deactivate();
265
- });
244
+ _classPrivateFieldGet(_ui, this).addLocalHook('firstPageClick', () => this.firstPage()).addLocalHook('prevPageClick', () => this.prevPage()).addLocalHook('nextPageClick', () => this.nextPage()).addLocalHook('lastPageClick', () => this.lastPage()).addLocalHook('pageSizeChange', pageSize => this.setPageSize(pageSize));
266
245
  }
267
- if (!_classPrivateFieldGet(_focusController, this)) {
268
- _classPrivateFieldSet(_focusController, this, createPaginationFocusController({
269
- focusableElements: () => _classPrivateFieldGet(_ui, this).getFocusableElements()
270
- }));
271
- }
272
- if (!_classPrivateFieldGet(_focusDetector, this)) {
273
- _classPrivateFieldSet(_focusDetector, this, installFocusDetector(this.hot, _classPrivateFieldGet(_ui, this).getContainer(), {
274
- onFocus: from => {
275
- this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
276
- this.hot.listen();
277
- if (from === 'from_above') {
278
- _classPrivateFieldGet(_focusController, this).toFirstItem();
279
- } else {
280
- _classPrivateFieldGet(_focusController, this).toLastItem();
281
- }
282
- _classPrivateFieldGet(_focusDetector, this).deactivate();
283
- }
284
- }));
285
- }
286
- _assertClassBrand(_Pagination_brand, this, _registerEvents).call(this);
287
- _assertClassBrand(_Pagination_brand, this, _registerShortcuts).call(this);
288
246
 
289
247
  // Place the onInit hook before others to make sure that the pagination state is computed
290
248
  // and applied to the index mapper before AutoColumnSize plugin begins calculate the column sizes.
@@ -348,37 +306,20 @@ export class Pagination extends BasePlugin {
348
306
  }
349
307
  return _assertClassBrand(_Pagination_brand, _this, _onAfterLanguageChange).call(_this, ...args);
350
308
  });
351
- this.addHook('modifyRowHeight', function () {
309
+ this.addHook('beforeHeightChange', function () {
352
310
  for (var _len1 = arguments.length, args = new Array(_len1), _key1 = 0; _key1 < _len1; _key1++) {
353
311
  args[_key1] = arguments[_key1];
354
312
  }
355
- return _assertClassBrand(_Pagination_brand, _this, _onModifyRowHeight).call(_this, ...args);
356
- });
357
- this.addHook('beforeHeightChange', function () {
358
- for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
359
- args[_key10] = arguments[_key10];
360
- }
361
313
  return _assertClassBrand(_Pagination_brand, _this, _onBeforeHeightChange).call(_this, ...args);
362
314
  });
363
315
  this.addHook('afterSetTheme', function () {
364
- for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
365
- args[_key11] = arguments[_key11];
316
+ for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
317
+ args[_key10] = arguments[_key10];
366
318
  }
367
319
  return _assertClassBrand(_Pagination_brand, _this, _onAfterSetTheme).call(_this, ...args);
368
320
  });
369
- this.addHook('afterDialogShow', function () {
370
- for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
371
- args[_key12] = arguments[_key12];
372
- }
373
- return _assertClassBrand(_Pagination_brand, _this, _onAfterDialogShow).call(_this, ...args);
374
- });
375
- this.addHook('beforeDialogHide', function () {
376
- for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
377
- args[_key13] = arguments[_key13];
378
- }
379
- return _assertClassBrand(_Pagination_brand, _this, _onAfterDialogHide).call(_this, ...args);
380
- });
381
321
  this.hot.rowIndexMapper.addLocalHook('cacheUpdated', _classPrivateFieldGet(_onIndexCacheUpdate, this));
322
+ _assertClassBrand(_Pagination_brand, this, _registerFocusScope).call(this);
382
323
  super.enablePlugin();
383
324
  }
384
325
 
@@ -397,11 +338,12 @@ export class Pagination extends BasePlugin {
397
338
  */
398
339
  disablePlugin() {
399
340
  this.hot.rowIndexMapper.removeLocalHook('cacheUpdated', _classPrivateFieldGet(_onIndexCacheUpdate, this)).unregisterMap(this.pluginName);
341
+ _assertClassBrand(_Pagination_brand, this, _unregisterFocusScope).call(this);
400
342
  _classPrivateFieldGet(_ui, this).destroy();
401
343
  _classPrivateFieldSet(_ui, this, null);
402
- _assertClassBrand(_Pagination_brand, this, _unregisterShortcuts).call(this);
403
344
  super.disablePlugin();
404
345
  }
346
+
405
347
  /**
406
348
  * Gets the pagination current state. Returns an object with the following properties:
407
349
  * - `currentPage`: The current page number.
@@ -657,11 +599,6 @@ export class Pagination extends BasePlugin {
657
599
  _classPrivateFieldGet(_ui, this).setNavigationSectionVisibility(false);
658
600
  this.hot.runHooks('afterPageNavigationVisibilityChange', false);
659
601
  }
660
-
661
- /**
662
- * Updates the visibility state of the pagination sections based on the current settings.
663
- */
664
-
665
602
  /**
666
603
  * Destroys the plugin instance.
667
604
  */
@@ -674,59 +611,6 @@ export class Pagination extends BasePlugin {
674
611
  super.destroy();
675
612
  }
676
613
  }
677
- function _registerEvents() {
678
- // TODO: move to general focus manager module
679
- this.eventManager.addEventListener(this.hot.rootDocument, 'mouseup', event => {
680
- const container = _classPrivateFieldGet(_ui, this).getContainer();
681
- if (!container.contains(event.target) && this.hot.getShortcutManager().getActiveContextName() === SHORTCUTS_CONTEXT_NAME) {
682
- _classPrivateFieldGet(_focusDetector, this).activate();
683
- _classPrivateFieldGet(_focusController, this).clear();
684
- this.hot.getShortcutManager().setActiveContextName('grid');
685
- }
686
- });
687
- }
688
- /**
689
- * Register shortcuts responsible for navigating through the pagination.
690
- */
691
- function _registerShortcuts() {
692
- var _manager$getContext;
693
- const manager = this.hot.getShortcutManager();
694
- const pluginContext = (_manager$getContext = manager.getContext(SHORTCUTS_CONTEXT_NAME)) !== null && _manager$getContext !== void 0 ? _manager$getContext : manager.addContext(SHORTCUTS_CONTEXT_NAME, 'global');
695
- pluginContext.addShortcut({
696
- keys: [['Shift', 'Tab'], ['Tab']],
697
- preventDefault: false,
698
- callback: event => {
699
- let previousIndex = _classPrivateFieldGet(_focusController, this).getCurrentPage();
700
- if (event.shiftKey) {
701
- _classPrivateFieldGet(_focusController, this).toPreviousItem();
702
- const currentPage = _classPrivateFieldGet(_focusController, this).getCurrentPage();
703
- if (currentPage >= previousIndex) {
704
- _assertClassBrand(_Pagination_brand, this, _unFocusPagination).call(this);
705
- return;
706
- }
707
- previousIndex = currentPage;
708
- } else {
709
- _classPrivateFieldGet(_focusController, this).toNextItem();
710
- const currentPage = _classPrivateFieldGet(_focusController, this).getCurrentPage();
711
- if (currentPage <= previousIndex) {
712
- _assertClassBrand(_Pagination_brand, this, _unFocusPagination).call(this);
713
- return;
714
- }
715
- previousIndex = currentPage;
716
- }
717
- event.preventDefault();
718
- },
719
- group: SHORTCUTS_GROUP
720
- });
721
- }
722
- /**
723
- * Unregister shortcuts responsible for navigating through the pagination.
724
- */
725
- function _unregisterShortcuts() {
726
- const shortcutManager = this.hot.getShortcutManager();
727
- const pluginContext = shortcutManager.getContext(SHORTCUTS_CONTEXT_NAME);
728
- pluginContext.removeShortcutsByGroup(SHORTCUTS_GROUP);
729
- }
730
614
  function _updateSectionsVisibilityState() {
731
615
  if (this.getSetting('showPageSize')) {
732
616
  this.showPageSizeSection();
@@ -774,10 +658,10 @@ function _computeAndApplyState() {
774
658
  return view.getViewportHeight() - scrollbarWidth;
775
659
  },
776
660
  itemsSizeProvider: () => {
777
- const defaultRowHeight = stylesHandler.getDefaultRowHeight();
778
661
  const rowHeights = this.hot.rowIndexMapper.getRenderableIndexes().map(physicalIndex => {
779
662
  var _this$hot$getRowHeigh;
780
- return (_this$hot$getRowHeigh = this.hot.getRowHeight(this.hot.toVisualRow(physicalIndex))) !== null && _this$hot$getRowHeigh !== void 0 ? _this$hot$getRowHeigh : defaultRowHeight;
663
+ const visualRowIndex = this.hot.toVisualRow(physicalIndex);
664
+ return (_this$hot$getRowHeigh = this.hot.getRowHeight(visualRowIndex)) !== null && _this$hot$getRowHeigh !== void 0 ? _this$hot$getRowHeigh : stylesHandler.getDefaultRowHeight(visualRowIndex);
781
665
  });
782
666
  return rowHeights;
783
667
  }
@@ -804,11 +688,6 @@ function _computeAndApplyState() {
804
688
  ...paginationData,
805
689
  totalRenderedRows: renderableRowsLength
806
690
  });
807
- if ((this.getSetting('showPageSize') || this.getSetting('showNavigation')) && paginationData.totalPages > 1) {
808
- _classPrivateFieldGet(_focusDetector, this).activate();
809
- } else {
810
- _classPrivateFieldGet(_focusDetector, this).deactivate();
811
- }
812
691
  }
813
692
  /**
814
693
  * Based on the external factors (like the scroll position of the table, size etc.) it computes
@@ -834,6 +713,31 @@ function _computeNeedsBorder() {
834
713
  } = this.getPaginationData();
835
714
  return view.getLastFullyVisibleRow() !== lastVisibleRowIndex;
836
715
  }
716
+ /**
717
+ * Registers the focus scope for the pagination plugin.
718
+ */
719
+ function _registerFocusScope() {
720
+ this.hot.getFocusScopeManager().registerScope(PLUGIN_KEY, _classPrivateFieldGet(_ui, this).getContainer(), {
721
+ shortcutsContextName: SHORTCUTS_CONTEXT_NAME,
722
+ runOnlyIf: () => this.getSetting('showPageSize') || this.getSetting('showNavigation'),
723
+ onActivate: focusSource => {
724
+ const focusableElements = _classPrivateFieldGet(_ui, this).getFocusableElements();
725
+ if (focusableElements.length > 0) {
726
+ if (focusSource === 'tab_from_above') {
727
+ focusableElements.at(0).focus();
728
+ } else if (focusSource === 'tab_from_below') {
729
+ focusableElements.at(-1).focus();
730
+ }
731
+ }
732
+ }
733
+ });
734
+ }
735
+ /**
736
+ * Unregisters the focus scope for the pagination plugin.
737
+ */
738
+ function _unregisterFocusScope() {
739
+ this.hot.getFocusScopeManager().unregisterScope(PLUGIN_KEY);
740
+ }
837
741
  /**
838
742
  * Called before the selection of columns or all table is made. It modifies the selection rows range
839
743
  * to the range of the current page.
@@ -908,27 +812,6 @@ function _onBeforePaste(pastedData, ranges) {
908
812
  pastedData.splice(0, rowsToRemove);
909
813
  });
910
814
  }
911
- /**
912
- * Called when the row height is modified. It adds 1px border top compensation for
913
- * the first row of the each page to make sure that the table's hider element
914
- * height is correctly calculated.
915
- *
916
- * @param {number | undefined} height Row height.
917
- * @param {number} row Visual row index.
918
- * @returns {number}
919
- */
920
- function _onModifyRowHeight(height, row) {
921
- if (height === undefined || !_classPrivateFieldGet(_calcStrategy, this).getState(_classPrivateFieldGet(_currentPage, this))) {
922
- return;
923
- }
924
- const {
925
- firstVisibleRowIndex
926
- } = this.getPaginationData();
927
- if (row !== 0 && row === firstVisibleRowIndex) {
928
- height += 1; // 1px border top compensation for the first row of the page.
929
- }
930
- return height;
931
- }
932
815
  /**
933
816
  * Called after the view is rendered. It recalculates the pagination state only when
934
817
  * the `pageSize` is set to `'auto'`. In this case, the plugin will compute the
@@ -1006,25 +889,4 @@ function _onAfterLanguageChange() {
1006
889
  */
1007
890
  function _onAfterSetTheme(themeName) {
1008
891
  _classPrivateFieldGet(_ui, this).updateTheme(themeName);
1009
- }
1010
- /**
1011
- * Unfocuses the pagination and sets the active context for the shortcuts.
1012
- */
1013
- function _unFocusPagination() {
1014
- _classPrivateFieldGet(_focusDetector, this).activate();
1015
- _classPrivateFieldGet(_focusController, this).clear();
1016
- this.hot.unlisten();
1017
- this.hot.getShortcutManager().setActiveContextName('grid');
1018
- }
1019
- /**
1020
- * Called after the dialog is shown. It sets the active context for the shortcuts.
1021
- */
1022
- function _onAfterDialogShow() {
1023
- _classPrivateFieldGet(_focusDetector, this).deactivate();
1024
- }
1025
- /**
1026
- * Called after the dialog is hidden. It sets the active context for the shortcuts.
1027
- */
1028
- function _onAfterDialogHide() {
1029
- _classPrivateFieldGet(_focusDetector, this).activate();
1030
892
  }
@@ -45,7 +45,7 @@ class AutoPageSizeStrategy {
45
45
  const viewportSize = viewportSizeProvider();
46
46
  const pages = [];
47
47
  let startIndex = 0;
48
- let totalSize = 1; // 1px border compensation for the first row
48
+ let totalSize = 0;
49
49
  let pageSize = 0;
50
50
  for (let index = 0; index < itemSizes.length; index++) {
51
51
  const itemSize = itemSizes[index];
@@ -56,7 +56,7 @@ class AutoPageSizeStrategy {
56
56
  pageSize
57
57
  });
58
58
  startIndex = index;
59
- totalSize = 1; // 1px border compensation for the first row
59
+ totalSize = 0;
60
60
  pageSize = 0;
61
61
  }
62
62
  totalSize += itemSize;