handsontable 16.0.1 → 16.1.0-next-abd8f2e-20250904

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 (489) hide show
  1. package/3rdparty/walkontable/src/overlays.js +12 -2
  2. package/3rdparty/walkontable/src/overlays.mjs +12 -2
  3. package/3rdparty/walkontable/src/viewport.js +2 -6
  4. package/3rdparty/walkontable/src/viewport.mjs +2 -6
  5. package/CHANGELOG.md +37 -0
  6. package/base.js +2 -2
  7. package/base.mjs +2 -2
  8. package/cellTypes/autocompleteType/accessors/index.js +7 -0
  9. package/cellTypes/autocompleteType/accessors/index.mjs +2 -0
  10. package/cellTypes/autocompleteType/accessors/valueGetter.js +14 -0
  11. package/cellTypes/autocompleteType/accessors/valueGetter.mjs +10 -0
  12. package/cellTypes/autocompleteType/accessors/valueSetter.js +25 -0
  13. package/cellTypes/autocompleteType/accessors/valueSetter.mjs +21 -0
  14. package/cellTypes/autocompleteType/autocompleteType.js +4 -1
  15. package/cellTypes/autocompleteType/autocompleteType.mjs +4 -1
  16. package/cellTypes/checkboxType/accessors/index.js +5 -0
  17. package/cellTypes/checkboxType/accessors/index.mjs +1 -0
  18. package/cellTypes/checkboxType/accessors/valueSetter.js +26 -0
  19. package/cellTypes/checkboxType/accessors/valueSetter.mjs +22 -0
  20. package/cellTypes/checkboxType/checkboxType.js +3 -1
  21. package/cellTypes/checkboxType/checkboxType.mjs +3 -1
  22. package/cellTypes/dropdownType/accessors/index.js +7 -0
  23. package/cellTypes/dropdownType/accessors/index.mjs +2 -0
  24. package/cellTypes/dropdownType/accessors/valueGetter.js +14 -0
  25. package/cellTypes/dropdownType/accessors/valueGetter.mjs +10 -0
  26. package/cellTypes/dropdownType/accessors/valueSetter.js +17 -0
  27. package/cellTypes/dropdownType/accessors/valueSetter.mjs +13 -0
  28. package/cellTypes/dropdownType/dropdownType.js +4 -1
  29. package/cellTypes/dropdownType/dropdownType.mjs +4 -1
  30. package/cellTypes/numericType/accessors/index.js +5 -0
  31. package/cellTypes/numericType/accessors/index.mjs +1 -0
  32. package/cellTypes/numericType/accessors/valueSetter.js +19 -0
  33. package/cellTypes/numericType/accessors/valueSetter.mjs +15 -0
  34. package/cellTypes/numericType/numericType.js +3 -1
  35. package/cellTypes/numericType/numericType.mjs +3 -1
  36. package/core/focusCatcher/index.js +37 -112
  37. package/core/focusCatcher/index.mjs +35 -110
  38. package/core/focusCatcher/utils.js +31 -0
  39. package/core/focusCatcher/utils.mjs +27 -0
  40. package/core/hooks/constants.js +242 -0
  41. package/core/hooks/constants.mjs +242 -0
  42. package/core/hooks/index.d.ts +22 -0
  43. package/core/viewportScroll/scrollStrategies/focusScroll.js +5 -1
  44. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +5 -1
  45. package/core/viewportScroll/utils.js +1 -1
  46. package/core/viewportScroll/utils.mjs +1 -1
  47. package/core.d.ts +4 -0
  48. package/core.js +237 -139
  49. package/core.mjs +240 -142
  50. package/dataMap/dataMap.js +13 -3
  51. package/dataMap/dataMap.mjs +14 -4
  52. package/dataMap/dataSource.js +16 -0
  53. package/dataMap/dataSource.mjs +16 -0
  54. package/dataMap/metaManager/lazyFactoryMap.js +4 -3
  55. package/dataMap/metaManager/lazyFactoryMap.mjs +2 -1
  56. package/dataMap/metaManager/metaLayers/cellMeta.js +3 -2
  57. package/dataMap/metaManager/metaLayers/cellMeta.mjs +3 -2
  58. package/dataMap/metaManager/metaSchema.js +289 -4
  59. package/dataMap/metaManager/metaSchema.mjs +289 -4
  60. package/dataMap/metaManager/utils.js +0 -11
  61. package/dataMap/metaManager/utils.mjs +0 -10
  62. package/dataMap/replaceData.js +1 -0
  63. package/dataMap/replaceData.mjs +1 -0
  64. package/dist/handsontable.css +281 -4
  65. package/dist/handsontable.full.css +281 -4
  66. package/dist/handsontable.full.js +7844 -2990
  67. package/dist/handsontable.full.min.css +4 -5
  68. package/dist/handsontable.full.min.js +167 -165
  69. package/dist/handsontable.js +9639 -4806
  70. package/dist/handsontable.min.css +4 -4
  71. package/dist/handsontable.min.js +52 -50
  72. package/dist/languages/all.js +231 -21
  73. package/dist/languages/all.min.js +1 -1
  74. package/dist/languages/ar-AR.js +11 -1
  75. package/dist/languages/ar-AR.min.js +1 -1
  76. package/dist/languages/cs-CZ.js +11 -1
  77. package/dist/languages/cs-CZ.min.js +1 -1
  78. package/dist/languages/de-CH.js +11 -1
  79. package/dist/languages/de-CH.min.js +1 -1
  80. package/dist/languages/de-DE.js +11 -1
  81. package/dist/languages/de-DE.min.js +1 -1
  82. package/dist/languages/en-US.js +11 -1
  83. package/dist/languages/en-US.min.js +1 -1
  84. package/dist/languages/es-MX.js +11 -1
  85. package/dist/languages/es-MX.min.js +1 -1
  86. package/dist/languages/fa-IR.js +11 -1
  87. package/dist/languages/fa-IR.min.js +1 -1
  88. package/dist/languages/fr-FR.js +11 -1
  89. package/dist/languages/fr-FR.min.js +1 -1
  90. package/dist/languages/hr-HR.js +11 -1
  91. package/dist/languages/hr-HR.min.js +1 -1
  92. package/dist/languages/it-IT.js +11 -1
  93. package/dist/languages/it-IT.min.js +1 -1
  94. package/dist/languages/ja-JP.js +11 -1
  95. package/dist/languages/ja-JP.min.js +1 -1
  96. package/dist/languages/ko-KR.js +11 -1
  97. package/dist/languages/ko-KR.min.js +1 -1
  98. package/dist/languages/lv-LV.js +11 -1
  99. package/dist/languages/lv-LV.min.js +1 -1
  100. package/dist/languages/nb-NO.js +11 -1
  101. package/dist/languages/nb-NO.min.js +1 -1
  102. package/dist/languages/nl-NL.js +11 -1
  103. package/dist/languages/nl-NL.min.js +1 -1
  104. package/dist/languages/pl-PL.js +11 -1
  105. package/dist/languages/pl-PL.min.js +1 -1
  106. package/dist/languages/pt-BR.js +11 -1
  107. package/dist/languages/pt-BR.min.js +1 -1
  108. package/dist/languages/ru-RU.js +11 -1
  109. package/dist/languages/ru-RU.min.js +1 -1
  110. package/dist/languages/sr-SP.js +11 -1
  111. package/dist/languages/sr-SP.min.js +1 -1
  112. package/dist/languages/zh-CN.js +11 -1
  113. package/dist/languages/zh-CN.min.js +1 -1
  114. package/dist/languages/zh-TW.js +11 -1
  115. package/dist/languages/zh-TW.min.js +1 -1
  116. package/editorManager.js +4 -4
  117. package/editorManager.mjs +4 -4
  118. package/editors/autocompleteEditor/autocompleteEditor.js +50 -112
  119. package/editors/autocompleteEditor/autocompleteEditor.mjs +51 -113
  120. package/editors/baseEditor/baseEditor.js +10 -6
  121. package/editors/baseEditor/baseEditor.mjs +10 -6
  122. package/editors/handsontableEditor/handsontableEditor.js +9 -9
  123. package/editors/handsontableEditor/handsontableEditor.mjs +9 -9
  124. package/editors/textEditor/textEditor.js +0 -7
  125. package/editors/textEditor/textEditor.mjs +0 -7
  126. package/focusManager.js +2 -2
  127. package/focusManager.mjs +2 -2
  128. package/helpers/a11y.js +15 -2
  129. package/helpers/a11y.mjs +10 -2
  130. package/helpers/console.js +12 -0
  131. package/helpers/console.mjs +11 -0
  132. package/helpers/dom/element.js +4 -4
  133. package/helpers/dom/element.mjs +4 -4
  134. package/helpers/mixed.js +65 -2
  135. package/helpers/mixed.mjs +63 -2
  136. package/helpers/number.js +28 -0
  137. package/helpers/number.mjs +26 -0
  138. package/helpers/object.js +35 -0
  139. package/helpers/object.mjs +34 -0
  140. package/helpers/string.js +19 -0
  141. package/helpers/string.mjs +18 -0
  142. package/helpers/templateLiteralTag.js +57 -1
  143. package/helpers/templateLiteralTag.mjs +56 -1
  144. package/i18n/constants.js +13 -1
  145. package/i18n/constants.mjs +13 -1
  146. package/i18n/languages/ar-AR.js +11 -1
  147. package/i18n/languages/ar-AR.mjs +11 -1
  148. package/i18n/languages/cs-CZ.js +11 -1
  149. package/i18n/languages/cs-CZ.mjs +11 -1
  150. package/i18n/languages/de-CH.js +11 -1
  151. package/i18n/languages/de-CH.mjs +11 -1
  152. package/i18n/languages/de-DE.js +11 -1
  153. package/i18n/languages/de-DE.mjs +11 -1
  154. package/i18n/languages/en-US.js +11 -1
  155. package/i18n/languages/en-US.mjs +11 -1
  156. package/i18n/languages/es-MX.js +11 -1
  157. package/i18n/languages/es-MX.mjs +11 -1
  158. package/i18n/languages/fa-IR.js +11 -1
  159. package/i18n/languages/fa-IR.mjs +11 -1
  160. package/i18n/languages/fr-FR.js +11 -1
  161. package/i18n/languages/fr-FR.mjs +11 -1
  162. package/i18n/languages/hr-HR.js +11 -1
  163. package/i18n/languages/hr-HR.mjs +11 -1
  164. package/i18n/languages/it-IT.js +11 -1
  165. package/i18n/languages/it-IT.mjs +11 -1
  166. package/i18n/languages/ja-JP.js +11 -1
  167. package/i18n/languages/ja-JP.mjs +11 -1
  168. package/i18n/languages/ko-KR.js +11 -1
  169. package/i18n/languages/ko-KR.mjs +11 -1
  170. package/i18n/languages/lv-LV.js +11 -1
  171. package/i18n/languages/lv-LV.mjs +11 -1
  172. package/i18n/languages/nb-NO.js +11 -1
  173. package/i18n/languages/nb-NO.mjs +11 -1
  174. package/i18n/languages/nl-NL.js +11 -1
  175. package/i18n/languages/nl-NL.mjs +11 -1
  176. package/i18n/languages/pl-PL.js +11 -1
  177. package/i18n/languages/pl-PL.mjs +11 -1
  178. package/i18n/languages/pt-BR.js +11 -1
  179. package/i18n/languages/pt-BR.mjs +11 -1
  180. package/i18n/languages/ru-RU.js +11 -1
  181. package/i18n/languages/ru-RU.mjs +11 -1
  182. package/i18n/languages/sr-SP.js +11 -1
  183. package/i18n/languages/sr-SP.mjs +11 -1
  184. package/i18n/languages/zh-CN.js +11 -1
  185. package/i18n/languages/zh-CN.mjs +11 -1
  186. package/i18n/languages/zh-TW.js +11 -1
  187. package/i18n/languages/zh-TW.mjs +11 -1
  188. package/i18n/phraseFormatters/index.js +3 -1
  189. package/i18n/phraseFormatters/index.mjs +3 -1
  190. package/i18n/registry.js +5 -6
  191. package/i18n/registry.mjs +5 -6
  192. package/index.d.ts +27 -0
  193. package/languages/all.js +231 -21
  194. package/languages/ar-AR.js +11 -1
  195. package/languages/ar-AR.mjs +11 -1
  196. package/languages/cs-CZ.js +11 -1
  197. package/languages/cs-CZ.mjs +11 -1
  198. package/languages/de-CH.js +11 -1
  199. package/languages/de-CH.mjs +11 -1
  200. package/languages/de-DE.js +11 -1
  201. package/languages/de-DE.mjs +11 -1
  202. package/languages/en-US.js +11 -1
  203. package/languages/en-US.mjs +11 -1
  204. package/languages/es-MX.js +11 -1
  205. package/languages/es-MX.mjs +11 -1
  206. package/languages/fa-IR.js +11 -1
  207. package/languages/fa-IR.mjs +11 -1
  208. package/languages/fr-FR.js +11 -1
  209. package/languages/fr-FR.mjs +11 -1
  210. package/languages/hr-HR.js +11 -1
  211. package/languages/hr-HR.mjs +11 -1
  212. package/languages/index.js +231 -21
  213. package/languages/it-IT.js +11 -1
  214. package/languages/it-IT.mjs +11 -1
  215. package/languages/ja-JP.js +11 -1
  216. package/languages/ja-JP.mjs +11 -1
  217. package/languages/ko-KR.js +11 -1
  218. package/languages/ko-KR.mjs +11 -1
  219. package/languages/lv-LV.js +11 -1
  220. package/languages/lv-LV.mjs +11 -1
  221. package/languages/nb-NO.js +11 -1
  222. package/languages/nb-NO.mjs +11 -1
  223. package/languages/nl-NL.js +11 -1
  224. package/languages/nl-NL.mjs +11 -1
  225. package/languages/pl-PL.js +11 -1
  226. package/languages/pl-PL.mjs +11 -1
  227. package/languages/pt-BR.js +11 -1
  228. package/languages/pt-BR.mjs +11 -1
  229. package/languages/ru-RU.js +11 -1
  230. package/languages/ru-RU.mjs +11 -1
  231. package/languages/sr-SP.js +11 -1
  232. package/languages/sr-SP.mjs +11 -1
  233. package/languages/zh-CN.js +11 -1
  234. package/languages/zh-CN.mjs +11 -1
  235. package/languages/zh-TW.js +11 -1
  236. package/languages/zh-TW.mjs +11 -1
  237. package/mixins/localHooks.js +16 -0
  238. package/mixins/localHooks.mjs +16 -0
  239. package/package.json +19 -1
  240. package/plugins/autoRowSize/autoRowSize.js +43 -6
  241. package/plugins/autoRowSize/autoRowSize.mjs +43 -6
  242. package/plugins/autofill/autofill.js +50 -3
  243. package/plugins/autofill/autofill.mjs +50 -3
  244. package/plugins/base/base.js +86 -15
  245. package/plugins/base/base.mjs +87 -16
  246. package/plugins/collapsibleColumns/collapsibleColumns.js +4 -4
  247. package/plugins/collapsibleColumns/collapsibleColumns.mjs +4 -4
  248. package/plugins/columnSorting/columnSorting.js +3 -3
  249. package/plugins/columnSorting/columnSorting.mjs +3 -3
  250. package/plugins/comments/comments.js +52 -22
  251. package/plugins/comments/comments.mjs +52 -22
  252. package/plugins/comments/contextMenuItem/addEditComment.js +3 -3
  253. package/plugins/comments/contextMenuItem/addEditComment.mjs +3 -3
  254. package/plugins/comments/contextMenuItem/readOnlyComment.js +2 -2
  255. package/plugins/comments/contextMenuItem/readOnlyComment.mjs +2 -2
  256. package/plugins/comments/contextMenuItem/removeComment.js +2 -2
  257. package/plugins/comments/contextMenuItem/removeComment.mjs +2 -2
  258. package/plugins/contextMenu/contextMenu.js +4 -5
  259. package/plugins/contextMenu/contextMenu.mjs +4 -5
  260. package/plugins/contextMenu/menu/cursor.js +1 -1
  261. package/plugins/contextMenu/menu/cursor.mjs +1 -1
  262. package/plugins/contextMenu/menu/defaultShortcutsList.js +5 -5
  263. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +5 -5
  264. package/plugins/contextMenu/menu/menu.js +3 -3
  265. package/plugins/contextMenu/menu/menu.mjs +3 -3
  266. package/plugins/contextMenu/menu/positioner.js +1 -1
  267. package/plugins/contextMenu/menu/positioner.mjs +1 -1
  268. package/plugins/contextMenu/predefinedItems/alignment.js +1 -1
  269. package/plugins/contextMenu/predefinedItems/alignment.mjs +1 -1
  270. package/plugins/contextMenu/predefinedItems/clearColumn.js +1 -1
  271. package/plugins/contextMenu/predefinedItems/clearColumn.mjs +1 -1
  272. package/plugins/contextMenu/predefinedItems/columnLeft.js +3 -3
  273. package/plugins/contextMenu/predefinedItems/columnLeft.mjs +3 -3
  274. package/plugins/contextMenu/predefinedItems/columnRight.js +3 -3
  275. package/plugins/contextMenu/predefinedItems/columnRight.mjs +3 -3
  276. package/plugins/contextMenu/predefinedItems/readOnly.js +1 -1
  277. package/plugins/contextMenu/predefinedItems/readOnly.mjs +1 -1
  278. package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
  279. package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -1
  280. package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
  281. package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -1
  282. package/plugins/contextMenu/predefinedItems/rowAbove.js +3 -3
  283. package/plugins/contextMenu/predefinedItems/rowAbove.mjs +3 -3
  284. package/plugins/contextMenu/predefinedItems/rowBelow.js +3 -3
  285. package/plugins/contextMenu/predefinedItems/rowBelow.mjs +3 -3
  286. package/plugins/copyPaste/contextMenuItem/copy.js +1 -1
  287. package/plugins/copyPaste/contextMenuItem/copy.mjs +1 -1
  288. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +3 -3
  289. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +3 -3
  290. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +3 -3
  291. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +3 -3
  292. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +3 -3
  293. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +3 -3
  294. package/plugins/copyPaste/contextMenuItem/cut.js +1 -1
  295. package/plugins/copyPaste/contextMenuItem/cut.mjs +1 -1
  296. package/plugins/copyPaste/copyPaste.js +75 -40
  297. package/plugins/copyPaste/copyPaste.mjs +76 -41
  298. package/plugins/customBorders/customBorders.js +1 -1
  299. package/plugins/customBorders/customBorders.mjs +1 -1
  300. package/plugins/dialog/dialog.d.ts +23 -0
  301. package/plugins/dialog/dialog.js +489 -0
  302. package/plugins/dialog/dialog.mjs +485 -0
  303. package/plugins/dialog/index.d.ts +1 -0
  304. package/plugins/dialog/index.js +7 -0
  305. package/plugins/dialog/index.mjs +1 -0
  306. package/plugins/dialog/ui.js +264 -0
  307. package/plugins/dialog/ui.mjs +259 -0
  308. package/plugins/dropdownMenu/dropdownMenu.js +5 -4
  309. package/plugins/dropdownMenu/dropdownMenu.mjs +5 -4
  310. package/plugins/filters/filters.js +2 -2
  311. package/plugins/filters/filters.mjs +2 -2
  312. package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +3 -3
  313. package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +3 -3
  314. package/plugins/hiddenColumns/contextMenuItem/showColumn.js +4 -4
  315. package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +4 -4
  316. package/plugins/hiddenRows/contextMenuItem/hideRow.js +3 -3
  317. package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +3 -3
  318. package/plugins/hiddenRows/contextMenuItem/showRow.js +4 -4
  319. package/plugins/hiddenRows/contextMenuItem/showRow.mjs +4 -4
  320. package/plugins/index.d.ts +9 -0
  321. package/plugins/index.js +9 -0
  322. package/plugins/index.mjs +7 -1
  323. package/plugins/loading/content.js +36 -0
  324. package/plugins/loading/content.mjs +31 -0
  325. package/plugins/loading/index.d.ts +1 -0
  326. package/plugins/loading/index.js +7 -0
  327. package/plugins/loading/index.mjs +1 -0
  328. package/plugins/loading/loading.d.ts +19 -0
  329. package/plugins/loading/loading.js +292 -0
  330. package/plugins/loading/loading.mjs +287 -0
  331. package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
  332. package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
  333. package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
  334. package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
  335. package/plugins/manualColumnMove/manualColumnMove.js +3 -3
  336. package/plugins/manualColumnMove/manualColumnMove.mjs +3 -3
  337. package/plugins/manualColumnResize/manualColumnResize.js +3 -3
  338. package/plugins/manualColumnResize/manualColumnResize.mjs +3 -3
  339. package/plugins/manualRowMove/manualRowMove.js +4 -4
  340. package/plugins/manualRowMove/manualRowMove.mjs +4 -4
  341. package/plugins/manualRowResize/manualRowResize.js +5 -2
  342. package/plugins/manualRowResize/manualRowResize.mjs +5 -2
  343. package/plugins/mergeCells/contextMenuItem/toggleMerge.js +15 -15
  344. package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +15 -15
  345. package/plugins/mergeCells/focusOrder.js +75 -39
  346. package/plugins/mergeCells/focusOrder.mjs +75 -39
  347. package/plugins/mergeCells/mergeCells.js +26 -19
  348. package/plugins/mergeCells/mergeCells.mjs +26 -19
  349. package/plugins/mergeCells/renderer.js +14 -8
  350. package/plugins/mergeCells/renderer.mjs +14 -8
  351. package/plugins/multiColumnSorting/multiColumnSorting.js +3 -3
  352. package/plugins/multiColumnSorting/multiColumnSorting.mjs +3 -3
  353. package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +3 -3
  354. package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +3 -3
  355. package/plugins/nestedHeaders/nestedHeaders.js +47 -41
  356. package/plugins/nestedHeaders/nestedHeaders.mjs +47 -41
  357. package/plugins/nestedRows/nestedRows.js +3 -3
  358. package/plugins/nestedRows/nestedRows.mjs +3 -3
  359. package/plugins/nestedRows/ui/collapsing.js +1 -2
  360. package/plugins/nestedRows/ui/collapsing.mjs +1 -2
  361. package/plugins/nestedRows/ui/contextMenu.js +4 -4
  362. package/plugins/nestedRows/ui/contextMenu.mjs +4 -4
  363. package/plugins/nestedRows/ui/headers.js +4 -1
  364. package/plugins/nestedRows/ui/headers.mjs +4 -1
  365. package/plugins/pagination/focusController.js +27 -0
  366. package/plugins/pagination/focusController.mjs +23 -0
  367. package/plugins/pagination/index.d.ts +1 -0
  368. package/plugins/pagination/index.js +7 -0
  369. package/plugins/pagination/index.mjs +1 -0
  370. package/plugins/pagination/pagination.d.ts +52 -0
  371. package/plugins/pagination/pagination.js +1034 -0
  372. package/plugins/pagination/pagination.mjs +1030 -0
  373. package/plugins/pagination/strategies/autoPageSize.js +96 -0
  374. package/plugins/pagination/strategies/autoPageSize.mjs +92 -0
  375. package/plugins/pagination/strategies/fixedPageSize.js +88 -0
  376. package/plugins/pagination/strategies/fixedPageSize.mjs +84 -0
  377. package/plugins/pagination/strategies/index.js +22 -0
  378. package/plugins/pagination/strategies/index.mjs +18 -0
  379. package/plugins/pagination/ui.js +449 -0
  380. package/plugins/pagination/ui.mjs +443 -0
  381. package/plugins/pagination/utils.js +28 -0
  382. package/plugins/pagination/utils.mjs +24 -0
  383. package/plugins/stretchColumns/calculator.js +4 -0
  384. package/plugins/stretchColumns/calculator.mjs +4 -0
  385. package/plugins/stretchColumns/stretchColumns.js +1 -1
  386. package/plugins/stretchColumns/stretchColumns.mjs +1 -1
  387. package/plugins/undoRedo/actions/dataChange.js +17 -15
  388. package/plugins/undoRedo/actions/dataChange.mjs +17 -15
  389. package/renderers/checkboxRenderer/checkboxRenderer.js +3 -3
  390. package/renderers/checkboxRenderer/checkboxRenderer.mjs +3 -3
  391. package/selection/range.js +11 -0
  392. package/selection/range.mjs +11 -0
  393. package/selection/selection.js +163 -124
  394. package/selection/selection.mjs +163 -124
  395. package/selection/transformation/_base.js +448 -0
  396. package/selection/transformation/_base.mjs +443 -0
  397. package/selection/transformation/extender.js +55 -0
  398. package/selection/transformation/extender.mjs +51 -0
  399. package/selection/transformation/focus.js +77 -0
  400. package/selection/transformation/focus.mjs +73 -0
  401. package/selection/transformation/index.js +7 -0
  402. package/selection/transformation/index.mjs +2 -0
  403. package/selection/utils.js +2 -1
  404. package/selection/utils.mjs +2 -1
  405. package/settings.d.ts +10 -1
  406. package/shortcutContexts/commands/editor/fastOpen.js +1 -1
  407. package/shortcutContexts/commands/editor/fastOpen.mjs +1 -1
  408. package/shortcutContexts/commands/editor/open.js +10 -4
  409. package/shortcutContexts/commands/editor/open.mjs +10 -4
  410. package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
  411. package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
  412. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +2 -2
  413. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +2 -2
  414. package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
  415. package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
  416. package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
  417. package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
  418. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
  419. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
  420. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -1
  421. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -1
  422. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +1 -1
  423. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +1 -1
  424. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +1 -1
  425. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +1 -1
  426. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -1
  427. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -1
  428. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -1
  429. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -1
  430. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -1
  431. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -1
  432. package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
  433. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
  434. package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
  435. package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
  436. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +2 -2
  437. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +2 -2
  438. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +2 -2
  439. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +2 -2
  440. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +5 -2
  441. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +5 -2
  442. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +5 -2
  443. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +5 -2
  444. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +1 -1
  445. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +1 -1
  446. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +1 -1
  447. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +1 -1
  448. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +1 -1
  449. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +1 -1
  450. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +1 -1
  451. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +1 -1
  452. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +1 -1
  453. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +1 -1
  454. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +1 -1
  455. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +1 -1
  456. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +2 -2
  457. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +2 -2
  458. package/shortcutContexts/commands/scrollToFocusedCell.js +1 -1
  459. package/shortcutContexts/commands/scrollToFocusedCell.mjs +1 -1
  460. package/shortcutContexts/grid.js +3 -3
  461. package/shortcutContexts/grid.mjs +3 -3
  462. package/shortcuts/context.js +4 -1
  463. package/shortcuts/context.mjs +4 -1
  464. package/shortcuts/manager.js +17 -3
  465. package/shortcuts/manager.mjs +17 -3
  466. package/styles/handsontable.css +288 -22
  467. package/styles/handsontable.min.css +3 -3
  468. package/styles/ht-theme-classic.css +828 -0
  469. package/styles/ht-theme-classic.min.css +30 -0
  470. package/styles/ht-theme-horizon.css +122 -26
  471. package/styles/ht-theme-horizon.min.css +3 -3
  472. package/styles/ht-theme-main.css +124 -28
  473. package/styles/ht-theme-main.min.css +3 -3
  474. package/tableView.js +61 -25
  475. package/tableView.mjs +61 -25
  476. package/utils/a11yAnnouncer.js +70 -0
  477. package/utils/a11yAnnouncer.mjs +64 -0
  478. package/{core/focusCatcher → utils}/focusDetector.js +30 -12
  479. package/{core/focusCatcher → utils}/focusDetector.mjs +30 -12
  480. package/utils/samplesGenerator.js +17 -1
  481. package/utils/samplesGenerator.mjs +17 -1
  482. package/utils/stylesHandler.js +23 -8
  483. package/utils/stylesHandler.mjs +23 -8
  484. package/utils/valueAccessors.js +45 -0
  485. package/utils/valueAccessors.mjs +40 -0
  486. package/validators/autocompleteValidator/autocompleteValidator.js +2 -1
  487. package/validators/autocompleteValidator/autocompleteValidator.mjs +2 -1
  488. package/selection/transformation.js +0 -335
  489. package/selection/transformation.mjs +0 -331
package/tableView.js CHANGED
@@ -165,25 +165,33 @@ class TableView {
165
165
  if (!this.hot.isRenderSuspended()) {
166
166
  const isFullRender = this.hot.forceFullRender;
167
167
  this.hot.runHooks('beforeRender', isFullRender);
168
+ this._wt.draw(!isFullRender);
169
+ _assertClassBrand(_TableView_brand, this, _updateScrollbarClassNames).call(this);
168
170
  if (this.postponedAdjustElementsSize) {
169
171
  this.postponedAdjustElementsSize = false;
170
- this.adjustElementsSize();
172
+ this.adjustElementsSize(true);
171
173
  }
172
- this._wt.draw(!isFullRender);
173
- _assertClassBrand(_TableView_brand, this, _updateScrollbarClassNames).call(this);
174
174
  this.hot.runHooks('afterRender', isFullRender);
175
175
  this.hot.forceFullRender = false;
176
176
  }
177
177
  }
178
178
 
179
179
  /**
180
- * Adjust overlays elements size and master table size.
180
+ * Adjust overlays elements size and master table size. By default the internal `adjustElementsSize`
181
+ * call of the Walkontable is postponed to the next render cycle. If `flush` is set to `true`, the method
182
+ * will be executed immediately.
183
+ *
184
+ * TODO: This method should not exist. It is a workaround for the issue with updating the elements
185
+ * size after render. It should be calculated and updated automatically in Walkontable.
186
+ *
187
+ * @param {boolean} [flush=false] If `true`, the method will be executed immediately.
181
188
  */
182
189
  adjustElementsSize() {
183
- if (this.hot.isRenderSuspended()) {
184
- this.postponedAdjustElementsSize = true;
185
- } else {
190
+ let flush = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
191
+ if (flush) {
186
192
  this._wt.wtOverlays.adjustElementsSize();
193
+ } else {
194
+ this.postponedAdjustElementsSize = true;
187
195
  }
188
196
  }
189
197
 
@@ -285,6 +293,7 @@ class TableView {
285
293
  */
286
294
  registerEvents() {
287
295
  const {
296
+ rootWrapperElement,
288
297
  rootElement,
289
298
  rootDocument,
290
299
  selection,
@@ -318,15 +327,19 @@ class TableView {
318
327
  }
319
328
  });
320
329
  this.eventManager.addEventListener(documentElement, 'mouseup', event => {
330
+ var _rootDocument$querySe;
321
331
  if (selection.isInProgress() && (0, _event.isLeftClick)(event)) {
322
332
  selection.finish();
323
333
  }
324
334
  _classPrivateFieldSet(_mouseDown, this, false);
325
335
  const isOutsideInputElement = (0, _element.isOutsideInput)(rootDocument.activeElement);
326
- if ((0, _element.isInput)(rootDocument.activeElement) && !isOutsideInputElement) {
336
+ // TODO: This is a workaround to prevent the unlisten event from being triggered when the active element is inside a dialog.
337
+ // Should be removed when the focus manager is implemented.
338
+ const isInsideDialog = (_rootDocument$querySe = rootDocument.querySelector('.ht-dialog')) === null || _rootDocument$querySe === void 0 ? void 0 : _rootDocument$querySe.contains(rootDocument.activeElement);
339
+ if ((0, _element.isInput)(rootDocument.activeElement) && !isOutsideInputElement || isInsideDialog) {
327
340
  return;
328
341
  }
329
- if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !rootElement.contains(event.target) && !(0, _event.isRightClick)(event)) {
342
+ if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !(rootWrapperElement !== null && rootWrapperElement !== void 0 ? rootWrapperElement : rootElement).contains(event.target) && !(0, _event.isRightClick)(event)) {
330
343
  this.hot.unlisten();
331
344
  }
332
345
  });
@@ -1081,6 +1094,7 @@ class TableView {
1081
1094
  * @returns {boolean}
1082
1095
  */
1083
1096
  isTextSelectionAllowed(el) {
1097
+ var _this$hot$getSelected, _this$hot$getSelected2;
1084
1098
  if ((0, _element.isInput)(el)) {
1085
1099
  return true;
1086
1100
  }
@@ -1088,10 +1102,11 @@ class TableView {
1088
1102
  if (this.settings.fragmentSelection === true && isChildOfTableBody) {
1089
1103
  return true;
1090
1104
  }
1091
- if (this.settings.fragmentSelection === 'cell' && this.isSelectedOnlyCell() && isChildOfTableBody) {
1105
+ const isSingleCell = (_this$hot$getSelected = (_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingleCell()) !== null && _this$hot$getSelected !== void 0 ? _this$hot$getSelected : false;
1106
+ if (this.settings.fragmentSelection === 'cell' && isSingleCell && isChildOfTableBody) {
1092
1107
  return true;
1093
1108
  }
1094
- if (!this.settings.fragmentSelection && this.isCellEdited() && this.isSelectedOnlyCell()) {
1109
+ if (!this.settings.fragmentSelection && this.isCellEdited() && isSingleCell) {
1095
1110
  return true;
1096
1111
  }
1097
1112
  return false;
@@ -1107,17 +1122,6 @@ class TableView {
1107
1122
  return _classPrivateFieldGet(_mouseDown, this);
1108
1123
  }
1109
1124
 
1110
- /**
1111
- * Check if selected only one cell.
1112
- *
1113
- * @private
1114
- * @returns {boolean}
1115
- */
1116
- isSelectedOnlyCell() {
1117
- var _this$hot$getSelected, _this$hot$getSelected2;
1118
- return (_this$hot$getSelected = (_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingleCell()) !== null && _this$hot$getSelected !== void 0 ? _this$hot$getSelected : false;
1119
- }
1120
-
1121
1125
  /**
1122
1126
  * Checks if active cell is editing.
1123
1127
  *
@@ -1572,7 +1576,8 @@ class TableView {
1572
1576
  }
1573
1577
 
1574
1578
  /**
1575
- * Gets the table's width.
1579
+ * Gets table's width. The returned width is the width of the rendered cells that fit in the
1580
+ * current viewport. The value may change depends on the viewport position (scroll position).
1576
1581
  *
1577
1582
  * @returns {boolean}
1578
1583
  */
@@ -1581,7 +1586,8 @@ class TableView {
1581
1586
  }
1582
1587
 
1583
1588
  /**
1584
- * Gets the table's height.
1589
+ * Gets table's height. The returned height is the height of the rendered cells that fit in the
1590
+ * current viewport. The value may change depends on the viewport position (scroll position).
1585
1591
  *
1586
1592
  * @returns {boolean}
1587
1593
  */
@@ -1589,6 +1595,26 @@ class TableView {
1589
1595
  return this._wt.wtTable.getHeight();
1590
1596
  }
1591
1597
 
1598
+ /**
1599
+ * Gets table's total width. The returned width is the width of all rendered cells (including headers)
1600
+ * that can be displayed in the table.
1601
+ *
1602
+ * @returns {boolean}
1603
+ */
1604
+ getTotalTableWidth() {
1605
+ return this._wt.wtTable.getTotalWidth();
1606
+ }
1607
+
1608
+ /**
1609
+ * Gets table's total height. The returned height is the height of all rendered cells (including headers)
1610
+ * that can be displayed in the table.
1611
+ *
1612
+ * @returns {boolean}
1613
+ */
1614
+ getTotalTableHeight() {
1615
+ return this._wt.wtTable.getTotalHeight();
1616
+ }
1617
+
1592
1618
  /**
1593
1619
  * Gets the table's offset.
1594
1620
  *
@@ -1661,7 +1687,7 @@ function _updateAriaColcount(delta) {
1661
1687
  * Updates the class names on the root element based on the presence of scrollbars.
1662
1688
  *
1663
1689
  * This method checks if the table has vertical and/or horizontal scrollbars and
1664
- * adds or removes the corresponding class names (`htHasScrollY` and `htHasScrollX`)
1690
+ * adds or removes the corresponding class names (`htHasScrollY`, `htHasScrollX` and more)
1665
1691
  * to/from the root element.
1666
1692
  */
1667
1693
  function _updateScrollbarClassNames() {
@@ -1671,10 +1697,20 @@ function _updateScrollbarClassNames() {
1671
1697
  } else {
1672
1698
  (0, _element.removeClass)(rootElement, 'htHasScrollY');
1673
1699
  }
1700
+ if (this.isVerticallyScrollableByWindow()) {
1701
+ (0, _element.addClass)(rootElement, 'htVerticallyScrollableByWindow');
1702
+ } else {
1703
+ (0, _element.removeClass)(rootElement, 'htVerticallyScrollableByWindow');
1704
+ }
1674
1705
  if (this.hasHorizontalScroll()) {
1675
1706
  (0, _element.addClass)(rootElement, 'htHasScrollX');
1676
1707
  } else {
1677
1708
  (0, _element.removeClass)(rootElement, 'htHasScrollX');
1678
1709
  }
1710
+ if (this.isHorizontallyScrollableByWindow()) {
1711
+ (0, _element.addClass)(rootElement, 'htHorizontallyScrollableByWindow');
1712
+ } else {
1713
+ (0, _element.removeClass)(rootElement, 'htHorizontallyScrollableByWindow');
1714
+ }
1679
1715
  }
1680
1716
  var _default = exports.default = TableView;
package/tableView.mjs CHANGED
@@ -161,25 +161,33 @@ class TableView {
161
161
  if (!this.hot.isRenderSuspended()) {
162
162
  const isFullRender = this.hot.forceFullRender;
163
163
  this.hot.runHooks('beforeRender', isFullRender);
164
+ this._wt.draw(!isFullRender);
165
+ _assertClassBrand(_TableView_brand, this, _updateScrollbarClassNames).call(this);
164
166
  if (this.postponedAdjustElementsSize) {
165
167
  this.postponedAdjustElementsSize = false;
166
- this.adjustElementsSize();
168
+ this.adjustElementsSize(true);
167
169
  }
168
- this._wt.draw(!isFullRender);
169
- _assertClassBrand(_TableView_brand, this, _updateScrollbarClassNames).call(this);
170
170
  this.hot.runHooks('afterRender', isFullRender);
171
171
  this.hot.forceFullRender = false;
172
172
  }
173
173
  }
174
174
 
175
175
  /**
176
- * Adjust overlays elements size and master table size.
176
+ * Adjust overlays elements size and master table size. By default the internal `adjustElementsSize`
177
+ * call of the Walkontable is postponed to the next render cycle. If `flush` is set to `true`, the method
178
+ * will be executed immediately.
179
+ *
180
+ * TODO: This method should not exist. It is a workaround for the issue with updating the elements
181
+ * size after render. It should be calculated and updated automatically in Walkontable.
182
+ *
183
+ * @param {boolean} [flush=false] If `true`, the method will be executed immediately.
177
184
  */
178
185
  adjustElementsSize() {
179
- if (this.hot.isRenderSuspended()) {
180
- this.postponedAdjustElementsSize = true;
181
- } else {
186
+ let flush = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
187
+ if (flush) {
182
188
  this._wt.wtOverlays.adjustElementsSize();
189
+ } else {
190
+ this.postponedAdjustElementsSize = true;
183
191
  }
184
192
  }
185
193
 
@@ -281,6 +289,7 @@ class TableView {
281
289
  */
282
290
  registerEvents() {
283
291
  const {
292
+ rootWrapperElement,
284
293
  rootElement,
285
294
  rootDocument,
286
295
  selection,
@@ -314,15 +323,19 @@ class TableView {
314
323
  }
315
324
  });
316
325
  this.eventManager.addEventListener(documentElement, 'mouseup', event => {
326
+ var _rootDocument$querySe;
317
327
  if (selection.isInProgress() && isLeftClick(event)) {
318
328
  selection.finish();
319
329
  }
320
330
  _classPrivateFieldSet(_mouseDown, this, false);
321
331
  const isOutsideInputElement = isOutsideInput(rootDocument.activeElement);
322
- if (isInput(rootDocument.activeElement) && !isOutsideInputElement) {
332
+ // TODO: This is a workaround to prevent the unlisten event from being triggered when the active element is inside a dialog.
333
+ // Should be removed when the focus manager is implemented.
334
+ const isInsideDialog = (_rootDocument$querySe = rootDocument.querySelector('.ht-dialog')) === null || _rootDocument$querySe === void 0 ? void 0 : _rootDocument$querySe.contains(rootDocument.activeElement);
335
+ if (isInput(rootDocument.activeElement) && !isOutsideInputElement || isInsideDialog) {
323
336
  return;
324
337
  }
325
- if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !rootElement.contains(event.target) && !isRightClick(event)) {
338
+ if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !(rootWrapperElement !== null && rootWrapperElement !== void 0 ? rootWrapperElement : rootElement).contains(event.target) && !isRightClick(event)) {
326
339
  this.hot.unlisten();
327
340
  }
328
341
  });
@@ -1077,6 +1090,7 @@ class TableView {
1077
1090
  * @returns {boolean}
1078
1091
  */
1079
1092
  isTextSelectionAllowed(el) {
1093
+ var _this$hot$getSelected, _this$hot$getSelected2;
1080
1094
  if (isInput(el)) {
1081
1095
  return true;
1082
1096
  }
@@ -1084,10 +1098,11 @@ class TableView {
1084
1098
  if (this.settings.fragmentSelection === true && isChildOfTableBody) {
1085
1099
  return true;
1086
1100
  }
1087
- if (this.settings.fragmentSelection === 'cell' && this.isSelectedOnlyCell() && isChildOfTableBody) {
1101
+ const isSingleCell = (_this$hot$getSelected = (_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingleCell()) !== null && _this$hot$getSelected !== void 0 ? _this$hot$getSelected : false;
1102
+ if (this.settings.fragmentSelection === 'cell' && isSingleCell && isChildOfTableBody) {
1088
1103
  return true;
1089
1104
  }
1090
- if (!this.settings.fragmentSelection && this.isCellEdited() && this.isSelectedOnlyCell()) {
1105
+ if (!this.settings.fragmentSelection && this.isCellEdited() && isSingleCell) {
1091
1106
  return true;
1092
1107
  }
1093
1108
  return false;
@@ -1103,17 +1118,6 @@ class TableView {
1103
1118
  return _classPrivateFieldGet(_mouseDown, this);
1104
1119
  }
1105
1120
 
1106
- /**
1107
- * Check if selected only one cell.
1108
- *
1109
- * @private
1110
- * @returns {boolean}
1111
- */
1112
- isSelectedOnlyCell() {
1113
- var _this$hot$getSelected, _this$hot$getSelected2;
1114
- return (_this$hot$getSelected = (_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingleCell()) !== null && _this$hot$getSelected !== void 0 ? _this$hot$getSelected : false;
1115
- }
1116
-
1117
1121
  /**
1118
1122
  * Checks if active cell is editing.
1119
1123
  *
@@ -1568,7 +1572,8 @@ class TableView {
1568
1572
  }
1569
1573
 
1570
1574
  /**
1571
- * Gets the table's width.
1575
+ * Gets table's width. The returned width is the width of the rendered cells that fit in the
1576
+ * current viewport. The value may change depends on the viewport position (scroll position).
1572
1577
  *
1573
1578
  * @returns {boolean}
1574
1579
  */
@@ -1577,7 +1582,8 @@ class TableView {
1577
1582
  }
1578
1583
 
1579
1584
  /**
1580
- * Gets the table's height.
1585
+ * Gets table's height. The returned height is the height of the rendered cells that fit in the
1586
+ * current viewport. The value may change depends on the viewport position (scroll position).
1581
1587
  *
1582
1588
  * @returns {boolean}
1583
1589
  */
@@ -1585,6 +1591,26 @@ class TableView {
1585
1591
  return this._wt.wtTable.getHeight();
1586
1592
  }
1587
1593
 
1594
+ /**
1595
+ * Gets table's total width. The returned width is the width of all rendered cells (including headers)
1596
+ * that can be displayed in the table.
1597
+ *
1598
+ * @returns {boolean}
1599
+ */
1600
+ getTotalTableWidth() {
1601
+ return this._wt.wtTable.getTotalWidth();
1602
+ }
1603
+
1604
+ /**
1605
+ * Gets table's total height. The returned height is the height of all rendered cells (including headers)
1606
+ * that can be displayed in the table.
1607
+ *
1608
+ * @returns {boolean}
1609
+ */
1610
+ getTotalTableHeight() {
1611
+ return this._wt.wtTable.getTotalHeight();
1612
+ }
1613
+
1588
1614
  /**
1589
1615
  * Gets the table's offset.
1590
1616
  *
@@ -1657,7 +1683,7 @@ function _updateAriaColcount(delta) {
1657
1683
  * Updates the class names on the root element based on the presence of scrollbars.
1658
1684
  *
1659
1685
  * This method checks if the table has vertical and/or horizontal scrollbars and
1660
- * adds or removes the corresponding class names (`htHasScrollY` and `htHasScrollX`)
1686
+ * adds or removes the corresponding class names (`htHasScrollY`, `htHasScrollX` and more)
1661
1687
  * to/from the root element.
1662
1688
  */
1663
1689
  function _updateScrollbarClassNames() {
@@ -1667,10 +1693,20 @@ function _updateScrollbarClassNames() {
1667
1693
  } else {
1668
1694
  removeClass(rootElement, 'htHasScrollY');
1669
1695
  }
1696
+ if (this.isVerticallyScrollableByWindow()) {
1697
+ addClass(rootElement, 'htVerticallyScrollableByWindow');
1698
+ } else {
1699
+ removeClass(rootElement, 'htVerticallyScrollableByWindow');
1700
+ }
1670
1701
  if (this.hasHorizontalScroll()) {
1671
1702
  addClass(rootElement, 'htHasScrollX');
1672
1703
  } else {
1673
1704
  removeClass(rootElement, 'htHasScrollX');
1674
1705
  }
1706
+ if (this.isHorizontallyScrollableByWindow()) {
1707
+ addClass(rootElement, 'htHorizontallyScrollableByWindow');
1708
+ } else {
1709
+ removeClass(rootElement, 'htHorizontallyScrollableByWindow');
1710
+ }
1675
1711
  }
1676
1712
  export default TableView;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.announce = announce;
5
+ exports.install = install;
6
+ exports.uninstall = uninstall;
7
+ /**
8
+ * The module provides functionality to announce custom messages to assistive technologies.
9
+ */
10
+ let announcerElement = null;
11
+ let installCounter = 0;
12
+
13
+ /**
14
+ * Installs the a11y announcer element into the provided root portal element. For each new Handsontable
15
+ * instance only one announcer element is created, so it can be reused across multiple instances.
16
+ *
17
+ * @param {HTMLElement} rootPortalElement The root element where the announcer will be installed.
18
+ */
19
+ function install(rootPortalElement) {
20
+ const document = rootPortalElement.ownerDocument;
21
+ if (!announcerElement) {
22
+ announcerElement = document.createElement('div');
23
+ announcerElement.setAttribute('role', 'status');
24
+ announcerElement.setAttribute('aria-live', 'assertive');
25
+ announcerElement.setAttribute('aria-atomic', 'true');
26
+ const style = announcerElement.style;
27
+ style.position = 'absolute';
28
+ style.width = '1px';
29
+ style.height = '1px';
30
+ style.margin = '-1px';
31
+ style.overflow = 'hidden';
32
+ style.clipPath = 'rect(0 0 0 0)';
33
+ style.whiteSpace = 'nowrap';
34
+ rootPortalElement.appendChild(announcerElement);
35
+ }
36
+ installCounter += 1;
37
+ }
38
+
39
+ /**
40
+ * Uninstalls the a11y announcer element if it was installed.
41
+ */
42
+ function uninstall() {
43
+ if (installCounter === 0) {
44
+ return;
45
+ }
46
+ if (installCounter === 1) {
47
+ announcerElement.remove();
48
+ announcerElement = null;
49
+ }
50
+ installCounter -= 1;
51
+ }
52
+
53
+ /**
54
+ * Announces a message to assistive technologies by updating the content of the a11y announcer element.
55
+ *
56
+ * @param {string} message The message to announce.
57
+ */
58
+ function announce(message) {
59
+ if (!announcerElement) {
60
+ return;
61
+ }
62
+
63
+ // The value needs to be cleared first to ensure that screen readers announce the new message.
64
+ announcerElement.textContent = '';
65
+ setTimeout(() => {
66
+ if (announcerElement) {
67
+ announcerElement.textContent = message;
68
+ }
69
+ }, 100);
70
+ }
@@ -0,0 +1,64 @@
1
+ /**
2
+ * The module provides functionality to announce custom messages to assistive technologies.
3
+ */
4
+ let announcerElement = null;
5
+ let installCounter = 0;
6
+
7
+ /**
8
+ * Installs the a11y announcer element into the provided root portal element. For each new Handsontable
9
+ * instance only one announcer element is created, so it can be reused across multiple instances.
10
+ *
11
+ * @param {HTMLElement} rootPortalElement The root element where the announcer will be installed.
12
+ */
13
+ export function install(rootPortalElement) {
14
+ const document = rootPortalElement.ownerDocument;
15
+ if (!announcerElement) {
16
+ announcerElement = document.createElement('div');
17
+ announcerElement.setAttribute('role', 'status');
18
+ announcerElement.setAttribute('aria-live', 'assertive');
19
+ announcerElement.setAttribute('aria-atomic', 'true');
20
+ const style = announcerElement.style;
21
+ style.position = 'absolute';
22
+ style.width = '1px';
23
+ style.height = '1px';
24
+ style.margin = '-1px';
25
+ style.overflow = 'hidden';
26
+ style.clipPath = 'rect(0 0 0 0)';
27
+ style.whiteSpace = 'nowrap';
28
+ rootPortalElement.appendChild(announcerElement);
29
+ }
30
+ installCounter += 1;
31
+ }
32
+
33
+ /**
34
+ * Uninstalls the a11y announcer element if it was installed.
35
+ */
36
+ export function uninstall() {
37
+ if (installCounter === 0) {
38
+ return;
39
+ }
40
+ if (installCounter === 1) {
41
+ announcerElement.remove();
42
+ announcerElement = null;
43
+ }
44
+ installCounter -= 1;
45
+ }
46
+
47
+ /**
48
+ * Announces a message to assistive technologies by updating the content of the a11y announcer element.
49
+ *
50
+ * @param {string} message The message to announce.
51
+ */
52
+ export function announce(message) {
53
+ if (!announcerElement) {
54
+ return;
55
+ }
56
+
57
+ // The value needs to be cleared first to ensure that screen readers announce the new message.
58
+ announcerElement.textContent = '';
59
+ setTimeout(() => {
60
+ if (announcerElement) {
61
+ announcerElement.textContent = message;
62
+ }
63
+ }, 100);
64
+ }
@@ -2,8 +2,14 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.installFocusDetector = installFocusDetector;
5
- var _element = require("../../helpers/dom/element");
6
- var _a11y = require("../../helpers/a11y");
5
+ var _element = require("../helpers/dom/element");
6
+ var _a11y = require("../helpers/a11y");
7
+ /**
8
+ * @typedef {object} FocusDetector
9
+ * @property {function(): void} activate Activates the focus detector.
10
+ * @property {function(): void} deactivate Deactivates the focus detector.
11
+ * @property {function('from_above' | 'from_below'): void} focus Focuses the input element in the given direction.
12
+ */
7
13
  /**
8
14
  * Installs a focus detector module. The module appends two input elements into the DOM side by side.
9
15
  * When the first input is focused, then it means that a user entered to the component using the TAB key
@@ -11,19 +17,31 @@ var _a11y = require("../../helpers/a11y");
11
17
  * the element below the table. Each action, once detected, triggers the specific hook.
12
18
  *
13
19
  * @param {Handsontable} hot The Handsontable instance.
14
- * @param {{ onFocusFromTop: Function, onFocusFromBottom: Function }} hooks An object with defined callbacks to call.
15
- * @returns {{ activate: Function, deactivate: Function }}
20
+ * @param {HTMLElement} wrapperElement The wrapper element to install the focus detector into.
21
+ * @param {{ onFocus: Function }} hooks An object with defined callbacks to call.
22
+ * @returns {FocusDetector}
16
23
  */
17
- function installFocusDetector(hot) {
18
- let hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
19
- const rootElement = hot.rootElement;
24
+ function installFocusDetector(hot, wrapperElement) {
25
+ let hooks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
20
26
  const inputTrapTop = createInputElement(hot);
21
27
  const inputTrapBottom = createInputElement(hot);
22
- inputTrapTop.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocusFromTop());
23
- inputTrapBottom.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocusFromBottom());
24
- rootElement.before(inputTrapTop);
25
- rootElement.after(inputTrapBottom);
28
+ inputTrapTop.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocus('from_above'));
29
+ inputTrapBottom.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocus('from_below'));
30
+ wrapperElement.prepend(inputTrapTop);
31
+ wrapperElement.append(inputTrapBottom);
26
32
  return {
33
+ /**
34
+ * Focuses the input element in the given direction.
35
+ *
36
+ * @param {string} direction The direction to focus the input element in.
37
+ */
38
+ focus(direction) {
39
+ if (direction === 'from_above') {
40
+ inputTrapTop.focus();
41
+ } else {
42
+ inputTrapBottom.focus();
43
+ }
44
+ },
27
45
  /**
28
46
  * Activates the detector by resetting the tabIndex of the input elements.
29
47
  */
@@ -55,7 +73,7 @@ function createInputElement(hot) {
55
73
  const rootDocument = hot.rootDocument;
56
74
  const input = rootDocument.createElement('input');
57
75
  input.type = 'text';
58
- input.name = '__htFocusCatcher';
76
+ input.name = 'htFocusCatcher';
59
77
  input.classList.add('htFocusCatcher');
60
78
  if (hot.getSettings().ariaTags) {
61
79
  (0, _element.setAttribute)(input, [(0, _a11y.A11Y_LABEL)('Focus catcher')]);
@@ -1,5 +1,11 @@
1
- import { setAttribute } from "../../helpers/dom/element.mjs";
2
- import { A11Y_LABEL } from "../../helpers/a11y.mjs";
1
+ import { setAttribute } from "../helpers/dom/element.mjs";
2
+ import { A11Y_LABEL } from "../helpers/a11y.mjs";
3
+ /**
4
+ * @typedef {object} FocusDetector
5
+ * @property {function(): void} activate Activates the focus detector.
6
+ * @property {function(): void} deactivate Deactivates the focus detector.
7
+ * @property {function('from_above' | 'from_below'): void} focus Focuses the input element in the given direction.
8
+ */
3
9
  /**
4
10
  * Installs a focus detector module. The module appends two input elements into the DOM side by side.
5
11
  * When the first input is focused, then it means that a user entered to the component using the TAB key
@@ -7,19 +13,31 @@ import { A11Y_LABEL } from "../../helpers/a11y.mjs";
7
13
  * the element below the table. Each action, once detected, triggers the specific hook.
8
14
  *
9
15
  * @param {Handsontable} hot The Handsontable instance.
10
- * @param {{ onFocusFromTop: Function, onFocusFromBottom: Function }} hooks An object with defined callbacks to call.
11
- * @returns {{ activate: Function, deactivate: Function }}
16
+ * @param {HTMLElement} wrapperElement The wrapper element to install the focus detector into.
17
+ * @param {{ onFocus: Function }} hooks An object with defined callbacks to call.
18
+ * @returns {FocusDetector}
12
19
  */
13
- export function installFocusDetector(hot) {
14
- let hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
15
- const rootElement = hot.rootElement;
20
+ export function installFocusDetector(hot, wrapperElement) {
21
+ let hooks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
16
22
  const inputTrapTop = createInputElement(hot);
17
23
  const inputTrapBottom = createInputElement(hot);
18
- inputTrapTop.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocusFromTop());
19
- inputTrapBottom.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocusFromBottom());
20
- rootElement.before(inputTrapTop);
21
- rootElement.after(inputTrapBottom);
24
+ inputTrapTop.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocus('from_above'));
25
+ inputTrapBottom.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocus('from_below'));
26
+ wrapperElement.prepend(inputTrapTop);
27
+ wrapperElement.append(inputTrapBottom);
22
28
  return {
29
+ /**
30
+ * Focuses the input element in the given direction.
31
+ *
32
+ * @param {string} direction The direction to focus the input element in.
33
+ */
34
+ focus(direction) {
35
+ if (direction === 'from_above') {
36
+ inputTrapTop.focus();
37
+ } else {
38
+ inputTrapBottom.focus();
39
+ }
40
+ },
23
41
  /**
24
42
  * Activates the detector by resetting the tabIndex of the input elements.
25
43
  */
@@ -51,7 +69,7 @@ function createInputElement(hot) {
51
69
  const rootDocument = hot.rootDocument;
52
70
  const input = rootDocument.createElement('input');
53
71
  input.type = 'text';
54
- input.name = '__htFocusCatcher';
72
+ input.name = 'htFocusCatcher';
55
73
  input.classList.add('htFocusCatcher');
56
74
  if (hot.getSettings().ariaTags) {
57
75
  setAttribute(input, [A11Y_LABEL('Focus catcher')]);
@@ -50,6 +50,13 @@ class SamplesGenerator {
50
50
  * @default {false}
51
51
  */
52
52
  _defineProperty(this, "allowDuplicates", false);
53
+ /**
54
+ * `true` if hidden samples should be included, `false` otherwise.
55
+ *
56
+ * @type {boolean}
57
+ * @default {false}
58
+ */
59
+ _defineProperty(this, "includeHidden", false);
53
60
  this.dataFactory = dataFactory;
54
61
  }
55
62
 
@@ -83,6 +90,15 @@ class SamplesGenerator {
83
90
  this.allowDuplicates = allowDuplicates;
84
91
  }
85
92
 
93
+ /**
94
+ * Sets the sampler to the mode where it will generate samples for hidden indexes.
95
+ *
96
+ * @param {boolean} includeHidden `true` to include hidden indexes, `false` otherwise.
97
+ */
98
+ setIncludeHidden(includeHidden) {
99
+ this.includeHidden = includeHidden;
100
+ }
101
+
86
102
  /**
87
103
  * Generate samples for row. You can control which area should be sampled by passing `rowRange` object and `colRange` object.
88
104
  *
@@ -145,7 +161,7 @@ class SamplesGenerator {
145
161
  const computedKey = type === 'row' ? 'col' : 'row';
146
162
  const sampledValues = [];
147
163
  (0, _number.rangeEach)(range.from, range.to, index => {
148
- const data = type === 'row' ? this.dataFactory(specifierValue, index) : this.dataFactory(index, specifierValue);
164
+ const data = type === 'row' ? this.dataFactory(specifierValue, index, this) : this.dataFactory(index, specifierValue, this);
149
165
  if (data === false) {
150
166
  return;
151
167
  }