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
@@ -292,7 +292,7 @@ class CollapsibleColumns extends _base.BasePlugin {
292
292
  const {
293
293
  row,
294
294
  col
295
- } = this.hot.getSelectedRangeLast().highlight;
295
+ } = this.hot.getSelectedRangeActive().highlight;
296
296
  const {
297
297
  collapsible,
298
298
  isCollapsed,
@@ -318,7 +318,7 @@ class CollapsibleColumns extends _base.BasePlugin {
318
318
  },
319
319
  runOnlyIf: () => {
320
320
  var _this$hot$getSelected, _this$hot$getSelected2;
321
- return ((_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.isSingle()) && ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isHeader());
321
+ return ((_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.isSingle()) && ((_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isHeader());
322
322
  },
323
323
  group: SHORTCUTS_GROUP,
324
324
  relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
@@ -510,7 +510,7 @@ class CollapsibleColumns extends _base.BasePlugin {
510
510
  });
511
511
  }, true);
512
512
  const isActionPerformed = this.getCollapsedColumns().length !== currentCollapsedColumns.length;
513
- const selectionRange = this.hot.getSelectedRangeLast();
513
+ const selectionRange = this.hot.getSelectedRangeActive();
514
514
  if (action === 'collapse' && isActionPerformed && selectionRange) {
515
515
  const {
516
516
  row,
@@ -526,8 +526,8 @@ class CollapsibleColumns extends _base.BasePlugin {
526
526
  }
527
527
  }
528
528
  this.hot.runHooks(actionTranslator.afterHook, currentCollapsedColumns, destinationCollapsedColumns, isActionPossible, isActionPerformed);
529
- this.hot.render();
530
529
  this.hot.view.adjustElementsSize();
530
+ this.hot.render();
531
531
  }
532
532
 
533
533
  /**
@@ -289,7 +289,7 @@ export class CollapsibleColumns extends BasePlugin {
289
289
  const {
290
290
  row,
291
291
  col
292
- } = this.hot.getSelectedRangeLast().highlight;
292
+ } = this.hot.getSelectedRangeActive().highlight;
293
293
  const {
294
294
  collapsible,
295
295
  isCollapsed,
@@ -315,7 +315,7 @@ export class CollapsibleColumns extends BasePlugin {
315
315
  },
316
316
  runOnlyIf: () => {
317
317
  var _this$hot$getSelected, _this$hot$getSelected2;
318
- return ((_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.isSingle()) && ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isHeader());
318
+ return ((_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.isSingle()) && ((_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isHeader());
319
319
  },
320
320
  group: SHORTCUTS_GROUP,
321
321
  relativeToGroup: SHORTCUTS_GROUP_EDITOR,
@@ -507,7 +507,7 @@ export class CollapsibleColumns extends BasePlugin {
507
507
  });
508
508
  }, true);
509
509
  const isActionPerformed = this.getCollapsedColumns().length !== currentCollapsedColumns.length;
510
- const selectionRange = this.hot.getSelectedRangeLast();
510
+ const selectionRange = this.hot.getSelectedRangeActive();
511
511
  if (action === 'collapse' && isActionPerformed && selectionRange) {
512
512
  const {
513
513
  row,
@@ -523,8 +523,8 @@ export class CollapsibleColumns extends BasePlugin {
523
523
  }
524
524
  }
525
525
  this.hot.runHooks(actionTranslator.afterHook, currentCollapsedColumns, destinationCollapsedColumns, isActionPossible, isActionPerformed);
526
- this.hot.render();
527
526
  this.hot.view.adjustElementsSize();
527
+ this.hot.render();
528
528
  }
529
529
 
530
530
  /**
@@ -238,7 +238,7 @@ class ColumnSorting extends _base.BasePlugin {
238
238
  callback: () => {
239
239
  const {
240
240
  highlight
241
- } = this.hot.getSelectedRangeLast();
241
+ } = this.hot.getSelectedRangeActive();
242
242
  this.sort(this.getColumnNextConfig(highlight.col));
243
243
 
244
244
  // prevent default Enter behavior (move to the next row within a selection range)
@@ -246,8 +246,8 @@ class ColumnSorting extends _base.BasePlugin {
246
246
  },
247
247
  runOnlyIf: () => {
248
248
  var _this$hot$getSelected, _this$hot$getSelected2;
249
- const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
250
- return highlight && ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingle()) && this.hot.selection.isCellVisible(highlight) && highlight.row === -1 && highlight.col >= 0;
249
+ const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
250
+ return highlight && ((_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingle()) && this.hot.selection.isCellVisible(highlight) && highlight.row === -1 && highlight.col >= 0;
251
251
  },
252
252
  relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
253
253
  position: 'before',
@@ -235,7 +235,7 @@ export class ColumnSorting extends BasePlugin {
235
235
  callback: () => {
236
236
  const {
237
237
  highlight
238
- } = this.hot.getSelectedRangeLast();
238
+ } = this.hot.getSelectedRangeActive();
239
239
  this.sort(this.getColumnNextConfig(highlight.col));
240
240
 
241
241
  // prevent default Enter behavior (move to the next row within a selection range)
@@ -243,8 +243,8 @@ export class ColumnSorting extends BasePlugin {
243
243
  },
244
244
  runOnlyIf: () => {
245
245
  var _this$hot$getSelected, _this$hot$getSelected2;
246
- const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
247
- return highlight && ((_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingle()) && this.hot.selection.isCellVisible(highlight) && highlight.row === -1 && highlight.col >= 0;
246
+ const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
247
+ return highlight && ((_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingle()) && this.hot.selection.isCellVisible(highlight) && highlight.row === -1 && highlight.col >= 0;
248
248
  },
249
249
  relativeToGroup: SHORTCUTS_GROUP_EDITOR,
250
250
  position: 'before',
@@ -6,6 +6,7 @@ require("core-js/modules/es.array.push.js");
6
6
  var _element = require("../../helpers/dom/element");
7
7
  var _event = require("../../helpers/dom/event");
8
8
  var _object = require("../../helpers/object");
9
+ var _src = require("../../3rdparty/walkontable/src");
9
10
  var _base = require("../base");
10
11
  var _commentEditor = _interopRequireDefault(require("./commentEditor"));
11
12
  var _displaySwitch2 = _interopRequireDefault(require("./displaySwitch"));
@@ -179,6 +180,7 @@ var _editor = /*#__PURE__*/new WeakMap();
179
180
  var _displaySwitch = /*#__PURE__*/new WeakMap();
180
181
  var _preventEditorAutoSwitch = /*#__PURE__*/new WeakMap();
181
182
  var _preventEditorHiding = /*#__PURE__*/new WeakMap();
183
+ var _preventEditorSaveOnBlur = /*#__PURE__*/new WeakMap();
182
184
  var _cellBelowCursor = /*#__PURE__*/new WeakMap();
183
185
  var _commentValueBeforeSave = /*#__PURE__*/new WeakMap();
184
186
  var _Comments_brand = /*#__PURE__*/new WeakSet();
@@ -200,21 +202,18 @@ class Comments extends _base.BasePlugin {
200
202
  /**
201
203
  * Instance of {@link CommentEditor}.
202
204
  *
203
- * @private
204
205
  * @type {CommentEditor}
205
206
  */
206
207
  _classPrivateFieldInitSpec(this, _editor, null);
207
208
  /**
208
209
  * Instance of {@link DisplaySwitch}.
209
210
  *
210
- * @private
211
211
  * @type {DisplaySwitch}
212
212
  */
213
213
  _classPrivateFieldInitSpec(this, _displaySwitch, null);
214
214
  /**
215
215
  * Prevents showing/hiding editor that reacts on the logic triggered by the "mouseover" events.
216
216
  *
217
- * @private
218
217
  * @type {boolean}
219
218
  */
220
219
  _classPrivateFieldInitSpec(this, _preventEditorAutoSwitch, false);
@@ -222,21 +221,24 @@ class Comments extends _base.BasePlugin {
222
221
  * Prevents hiding editor when the table viewport is scrolled and that scroll is triggered by the
223
222
  * keyboard shortcut that insert or edits the comment.
224
223
  *
225
- * @private
226
224
  * @type {boolean}
227
225
  */
228
226
  _classPrivateFieldInitSpec(this, _preventEditorHiding, false);
227
+ /**
228
+ * Prevents saving the comment value when the editor is blurred.
229
+ *
230
+ * @type {boolean}
231
+ */
232
+ _classPrivateFieldInitSpec(this, _preventEditorSaveOnBlur, false);
229
233
  /**
230
234
  * The flag that allows processing mousedown event correctly when comments editor is triggered.
231
235
  *
232
- * @private
233
236
  * @type {boolean}
234
237
  */
235
238
  _classPrivateFieldInitSpec(this, _cellBelowCursor, null);
236
239
  /**
237
240
  * Holds the comment value before it's actually saved to the cell meta.
238
241
  *
239
- * @private
240
242
  * @type {string}
241
243
  */
242
244
  _classPrivateFieldInitSpec(this, _commentValueBeforeSave, '');
@@ -331,7 +333,7 @@ class Comments extends _base.BasePlugin {
331
333
  gridContext.addShortcut({
332
334
  keys: [['Control', 'Alt', 'M']],
333
335
  callback: () => {
334
- const range = this.hot.getSelectedRangeLast();
336
+ const range = this.hot.getSelectedRangeActive();
335
337
  _classPrivateFieldSet(_preventEditorHiding, this, true);
336
338
  this.hot.scrollToFocusedCell(() => {
337
339
  this.setRange(range);
@@ -346,7 +348,7 @@ class Comments extends _base.BasePlugin {
346
348
  stopPropagation: true,
347
349
  runOnlyIf: () => {
348
350
  var _this$hot$getSelected;
349
- return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isCell();
351
+ return (_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isCell();
350
352
  },
351
353
  group: SHORTCUTS_GROUP
352
354
  });
@@ -373,7 +375,9 @@ class Comments extends _base.BasePlugin {
373
375
  keys: [['Shift', 'Tab'], ['Tab']],
374
376
  forwardToContext: manager.getContext('grid'),
375
377
  callback: () => {
378
+ _classPrivateFieldSet(_preventEditorSaveOnBlur, this, true);
376
379
  _classPrivateFieldGet(_editor, this).setValue(_classPrivateFieldGet(_editor, this).getValue());
380
+ this.setComment();
377
381
  this.hide();
378
382
  manager.setActiveContextName('grid');
379
383
  },
@@ -463,8 +467,10 @@ class Comments extends _base.BasePlugin {
463
467
  } else if (editorValue !== null && editorValue !== undefined) {
464
468
  comment = editorValue;
465
469
  }
466
- const row = this.range.from.row;
467
- const col = this.range.from.col;
470
+ const {
471
+ row,
472
+ col
473
+ } = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
468
474
  this.updateCommentMeta(row, col, {
469
475
  [META_COMMENT_VALUE]: comment
470
476
  });
@@ -495,7 +501,11 @@ class Comments extends _base.BasePlugin {
495
501
  if (!this.range.from) {
496
502
  throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');
497
503
  }
498
- this.hot.setCellMeta(this.range.from.row, this.range.from.col, META_COMMENT);
504
+ const {
505
+ row,
506
+ col
507
+ } = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
508
+ this.hot.setCellMeta(row, col, META_COMMENT);
499
509
  if (forceRender) {
500
510
  this.hot.render();
501
511
  }
@@ -523,9 +533,11 @@ class Comments extends _base.BasePlugin {
523
533
  * @returns {string|undefined} Returns a content of the comment.
524
534
  */
525
535
  getComment() {
526
- const row = this.range.from.row;
527
- const column = this.range.from.col;
528
- return this.getCommentMeta(row, column, META_COMMENT_VALUE);
536
+ const {
537
+ row,
538
+ col
539
+ } = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
540
+ return this.getCommentMeta(row, col, META_COMMENT_VALUE);
529
541
  }
530
542
 
531
543
  /**
@@ -550,15 +562,13 @@ class Comments extends _base.BasePlugin {
550
562
  throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');
551
563
  }
552
564
  const {
553
- from: {
554
- row,
555
- col
556
- }
557
- } = this.range;
565
+ row,
566
+ col
567
+ } = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
558
568
  if (row < 0 || row > this.hot.countSourceRows() - 1 || col < 0 || col > this.hot.countSourceCols() - 1) {
559
569
  return false;
560
570
  }
561
- const meta = this.hot.getCellMeta(this.range.from.row, this.range.from.col);
571
+ const meta = this.hot.getCellMeta(row, col);
562
572
  _classPrivateFieldGet(_displaySwitch, this).cancelHiding();
563
573
  _classPrivateFieldGet(_editor, this).setValue((_ref = meta[META_COMMENT] ? meta[META_COMMENT][META_COMMENT_VALUE] : null) !== null && _ref !== void 0 ? _ref : '');
564
574
  _classPrivateFieldGet(_editor, this).show();
@@ -604,7 +614,7 @@ class Comments extends _base.BasePlugin {
604
614
  const {
605
615
  row: visualRow,
606
616
  col: visualColumn
607
- } = this.range.from;
617
+ } = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
608
618
  let renderableRow = rowIndexMapper.getRenderableFromVisualIndex(visualRow);
609
619
  let renderableColumn = columnIndexMapper.getRenderableFromVisualIndex(visualColumn);
610
620
  // Used when the requested row is hidden, and the editor needs to be positioned on the previous row's coords.
@@ -747,6 +757,12 @@ class Comments extends _base.BasePlugin {
747
757
  return _classPrivateFieldGet(_editor, this).getInputElement();
748
758
  }
749
759
 
760
+ /**
761
+ * Gets the coords object from the range object.
762
+ *
763
+ * @returns {CellCoords} The coords object.
764
+ */
765
+
750
766
  /**
751
767
  * Destroys the plugin instance.
752
768
  */
@@ -823,6 +839,10 @@ function _onAfterRenderer(TD, cellProperties) {
823
839
  * editor content and gives back the keyboard shortcuts control by switching to the "grid" context.
824
840
  */
825
841
  function _onEditorBlur() {
842
+ if (_classPrivateFieldGet(_preventEditorSaveOnBlur, this)) {
843
+ _classPrivateFieldSet(_preventEditorSaveOnBlur, this, false);
844
+ return;
845
+ }
826
846
  _classPrivateFieldSet(_commentValueBeforeSave, this, '');
827
847
  this.hot.getShortcutManager().setActiveContextName('grid');
828
848
  this.setComment();
@@ -843,7 +863,11 @@ function _onEditorFocus() {
843
863
  * @param {number} height The new height of the editor.
844
864
  */
845
865
  function _onEditorResize(width, height) {
846
- this.updateCommentMeta(this.range.from.row, this.range.from.col, {
866
+ const {
867
+ row,
868
+ col
869
+ } = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
870
+ this.updateCommentMeta(row, col, {
847
871
  [META_STYLE]: {
848
872
  width,
849
873
  height
@@ -868,4 +892,10 @@ function _onAfterScroll() {
868
892
  if (!_classPrivateFieldGet(_preventEditorHiding, this)) {
869
893
  this.hide();
870
894
  }
895
+ }
896
+ function _getRangeCoords() {
897
+ if (this.range instanceof _src.CellRange) {
898
+ return this.range.highlight;
899
+ }
900
+ return this.hot._createCellCoords(this.range.from.row, this.range.from.col);
871
901
  }
@@ -12,6 +12,7 @@ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.h
12
12
  import { addClass, closest, getScrollbarWidth, hasClass, hasVerticalScrollbar, hasHorizontalScrollbar, isChildOf, outerHeight } from "../../helpers/dom/element.mjs";
13
13
  import { stopImmediatePropagation } from "../../helpers/dom/event.mjs";
14
14
  import { deepClone, deepExtend } from "../../helpers/object.mjs";
15
+ import { CellRange } from "../../3rdparty/walkontable/src/index.mjs";
15
16
  import { BasePlugin } from "../base/index.mjs";
16
17
  import CommentEditor from "./commentEditor.mjs";
17
18
  import DisplaySwitch from "./displaySwitch.mjs";
@@ -175,6 +176,7 @@ var _editor = /*#__PURE__*/new WeakMap();
175
176
  var _displaySwitch = /*#__PURE__*/new WeakMap();
176
177
  var _preventEditorAutoSwitch = /*#__PURE__*/new WeakMap();
177
178
  var _preventEditorHiding = /*#__PURE__*/new WeakMap();
179
+ var _preventEditorSaveOnBlur = /*#__PURE__*/new WeakMap();
178
180
  var _cellBelowCursor = /*#__PURE__*/new WeakMap();
179
181
  var _commentValueBeforeSave = /*#__PURE__*/new WeakMap();
180
182
  var _Comments_brand = /*#__PURE__*/new WeakSet();
@@ -196,21 +198,18 @@ export class Comments extends BasePlugin {
196
198
  /**
197
199
  * Instance of {@link CommentEditor}.
198
200
  *
199
- * @private
200
201
  * @type {CommentEditor}
201
202
  */
202
203
  _classPrivateFieldInitSpec(this, _editor, null);
203
204
  /**
204
205
  * Instance of {@link DisplaySwitch}.
205
206
  *
206
- * @private
207
207
  * @type {DisplaySwitch}
208
208
  */
209
209
  _classPrivateFieldInitSpec(this, _displaySwitch, null);
210
210
  /**
211
211
  * Prevents showing/hiding editor that reacts on the logic triggered by the "mouseover" events.
212
212
  *
213
- * @private
214
213
  * @type {boolean}
215
214
  */
216
215
  _classPrivateFieldInitSpec(this, _preventEditorAutoSwitch, false);
@@ -218,21 +217,24 @@ export class Comments extends BasePlugin {
218
217
  * Prevents hiding editor when the table viewport is scrolled and that scroll is triggered by the
219
218
  * keyboard shortcut that insert or edits the comment.
220
219
  *
221
- * @private
222
220
  * @type {boolean}
223
221
  */
224
222
  _classPrivateFieldInitSpec(this, _preventEditorHiding, false);
223
+ /**
224
+ * Prevents saving the comment value when the editor is blurred.
225
+ *
226
+ * @type {boolean}
227
+ */
228
+ _classPrivateFieldInitSpec(this, _preventEditorSaveOnBlur, false);
225
229
  /**
226
230
  * The flag that allows processing mousedown event correctly when comments editor is triggered.
227
231
  *
228
- * @private
229
232
  * @type {boolean}
230
233
  */
231
234
  _classPrivateFieldInitSpec(this, _cellBelowCursor, null);
232
235
  /**
233
236
  * Holds the comment value before it's actually saved to the cell meta.
234
237
  *
235
- * @private
236
238
  * @type {string}
237
239
  */
238
240
  _classPrivateFieldInitSpec(this, _commentValueBeforeSave, '');
@@ -327,7 +329,7 @@ export class Comments extends BasePlugin {
327
329
  gridContext.addShortcut({
328
330
  keys: [['Control', 'Alt', 'M']],
329
331
  callback: () => {
330
- const range = this.hot.getSelectedRangeLast();
332
+ const range = this.hot.getSelectedRangeActive();
331
333
  _classPrivateFieldSet(_preventEditorHiding, this, true);
332
334
  this.hot.scrollToFocusedCell(() => {
333
335
  this.setRange(range);
@@ -342,7 +344,7 @@ export class Comments extends BasePlugin {
342
344
  stopPropagation: true,
343
345
  runOnlyIf: () => {
344
346
  var _this$hot$getSelected;
345
- return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isCell();
347
+ return (_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isCell();
346
348
  },
347
349
  group: SHORTCUTS_GROUP
348
350
  });
@@ -369,7 +371,9 @@ export class Comments extends BasePlugin {
369
371
  keys: [['Shift', 'Tab'], ['Tab']],
370
372
  forwardToContext: manager.getContext('grid'),
371
373
  callback: () => {
374
+ _classPrivateFieldSet(_preventEditorSaveOnBlur, this, true);
372
375
  _classPrivateFieldGet(_editor, this).setValue(_classPrivateFieldGet(_editor, this).getValue());
376
+ this.setComment();
373
377
  this.hide();
374
378
  manager.setActiveContextName('grid');
375
379
  },
@@ -459,8 +463,10 @@ export class Comments extends BasePlugin {
459
463
  } else if (editorValue !== null && editorValue !== undefined) {
460
464
  comment = editorValue;
461
465
  }
462
- const row = this.range.from.row;
463
- const col = this.range.from.col;
466
+ const {
467
+ row,
468
+ col
469
+ } = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
464
470
  this.updateCommentMeta(row, col, {
465
471
  [META_COMMENT_VALUE]: comment
466
472
  });
@@ -491,7 +497,11 @@ export class Comments extends BasePlugin {
491
497
  if (!this.range.from) {
492
498
  throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');
493
499
  }
494
- this.hot.setCellMeta(this.range.from.row, this.range.from.col, META_COMMENT);
500
+ const {
501
+ row,
502
+ col
503
+ } = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
504
+ this.hot.setCellMeta(row, col, META_COMMENT);
495
505
  if (forceRender) {
496
506
  this.hot.render();
497
507
  }
@@ -519,9 +529,11 @@ export class Comments extends BasePlugin {
519
529
  * @returns {string|undefined} Returns a content of the comment.
520
530
  */
521
531
  getComment() {
522
- const row = this.range.from.row;
523
- const column = this.range.from.col;
524
- return this.getCommentMeta(row, column, META_COMMENT_VALUE);
532
+ const {
533
+ row,
534
+ col
535
+ } = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
536
+ return this.getCommentMeta(row, col, META_COMMENT_VALUE);
525
537
  }
526
538
 
527
539
  /**
@@ -546,15 +558,13 @@ export class Comments extends BasePlugin {
546
558
  throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');
547
559
  }
548
560
  const {
549
- from: {
550
- row,
551
- col
552
- }
553
- } = this.range;
561
+ row,
562
+ col
563
+ } = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
554
564
  if (row < 0 || row > this.hot.countSourceRows() - 1 || col < 0 || col > this.hot.countSourceCols() - 1) {
555
565
  return false;
556
566
  }
557
- const meta = this.hot.getCellMeta(this.range.from.row, this.range.from.col);
567
+ const meta = this.hot.getCellMeta(row, col);
558
568
  _classPrivateFieldGet(_displaySwitch, this).cancelHiding();
559
569
  _classPrivateFieldGet(_editor, this).setValue((_ref = meta[META_COMMENT] ? meta[META_COMMENT][META_COMMENT_VALUE] : null) !== null && _ref !== void 0 ? _ref : '');
560
570
  _classPrivateFieldGet(_editor, this).show();
@@ -600,7 +610,7 @@ export class Comments extends BasePlugin {
600
610
  const {
601
611
  row: visualRow,
602
612
  col: visualColumn
603
- } = this.range.from;
613
+ } = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
604
614
  let renderableRow = rowIndexMapper.getRenderableFromVisualIndex(visualRow);
605
615
  let renderableColumn = columnIndexMapper.getRenderableFromVisualIndex(visualColumn);
606
616
  // Used when the requested row is hidden, and the editor needs to be positioned on the previous row's coords.
@@ -743,6 +753,12 @@ export class Comments extends BasePlugin {
743
753
  return _classPrivateFieldGet(_editor, this).getInputElement();
744
754
  }
745
755
 
756
+ /**
757
+ * Gets the coords object from the range object.
758
+ *
759
+ * @returns {CellCoords} The coords object.
760
+ */
761
+
746
762
  /**
747
763
  * Destroys the plugin instance.
748
764
  */
@@ -818,6 +834,10 @@ function _onAfterRenderer(TD, cellProperties) {
818
834
  * editor content and gives back the keyboard shortcuts control by switching to the "grid" context.
819
835
  */
820
836
  function _onEditorBlur() {
837
+ if (_classPrivateFieldGet(_preventEditorSaveOnBlur, this)) {
838
+ _classPrivateFieldSet(_preventEditorSaveOnBlur, this, false);
839
+ return;
840
+ }
821
841
  _classPrivateFieldSet(_commentValueBeforeSave, this, '');
822
842
  this.hot.getShortcutManager().setActiveContextName('grid');
823
843
  this.setComment();
@@ -838,7 +858,11 @@ function _onEditorFocus() {
838
858
  * @param {number} height The new height of the editor.
839
859
  */
840
860
  function _onEditorResize(width, height) {
841
- this.updateCommentMeta(this.range.from.row, this.range.from.col, {
861
+ const {
862
+ row,
863
+ col
864
+ } = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
865
+ this.updateCommentMeta(row, col, {
842
866
  [META_STYLE]: {
843
867
  width,
844
868
  height
@@ -863,4 +887,10 @@ function _onAfterScroll() {
863
887
  if (!_classPrivateFieldGet(_preventEditorHiding, this)) {
864
888
  this.hide();
865
889
  }
890
+ }
891
+ function _getRangeCoords() {
892
+ if (this.range instanceof CellRange) {
893
+ return this.range.highlight;
894
+ }
895
+ return this.hot._createCellCoords(this.range.from.row, this.range.from.col);
866
896
  }
@@ -13,20 +13,20 @@ function addEditCommentItem(plugin) {
13
13
  key: 'commentsAddEdit',
14
14
  name() {
15
15
  var _this$getSelectedRang;
16
- const highlight = (_this$getSelectedRang = this.getSelectedRangeLast()) === null || _this$getSelectedRang === void 0 ? void 0 : _this$getSelectedRang.highlight;
16
+ const highlight = (_this$getSelectedRang = this.getSelectedRangeActive()) === null || _this$getSelectedRang === void 0 ? void 0 : _this$getSelectedRang.highlight;
17
17
  if (highlight !== null && highlight !== void 0 && highlight.isCell() && plugin.getCommentAtCell(highlight.row, highlight.col)) {
18
18
  return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_EDIT_COMMENT);
19
19
  }
20
20
  return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ADD_COMMENT);
21
21
  },
22
22
  callback() {
23
- const range = this.getSelectedRangeLast();
23
+ const range = this.getSelectedRangeActive();
24
24
  plugin.setRange(range);
25
25
  plugin.show();
26
26
  plugin.focusEditor();
27
27
  },
28
28
  disabled() {
29
- const range = this.getSelectedRangeLast();
29
+ const range = this.getSelectedRangeActive();
30
30
  if (!range || range.highlight.isHeader() || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
31
31
  return true;
32
32
  }
@@ -8,20 +8,20 @@ export default function addEditCommentItem(plugin) {
8
8
  key: 'commentsAddEdit',
9
9
  name() {
10
10
  var _this$getSelectedRang;
11
- const highlight = (_this$getSelectedRang = this.getSelectedRangeLast()) === null || _this$getSelectedRang === void 0 ? void 0 : _this$getSelectedRang.highlight;
11
+ const highlight = (_this$getSelectedRang = this.getSelectedRangeActive()) === null || _this$getSelectedRang === void 0 ? void 0 : _this$getSelectedRang.highlight;
12
12
  if (highlight !== null && highlight !== void 0 && highlight.isCell() && plugin.getCommentAtCell(highlight.row, highlight.col)) {
13
13
  return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_EDIT_COMMENT);
14
14
  }
15
15
  return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ADD_COMMENT);
16
16
  },
17
17
  callback() {
18
- const range = this.getSelectedRangeLast();
18
+ const range = this.getSelectedRangeActive();
19
19
  plugin.setRange(range);
20
20
  plugin.show();
21
21
  plugin.focusEditor();
22
22
  },
23
23
  disabled() {
24
- const range = this.getSelectedRangeLast();
24
+ const range = this.getSelectedRangeActive();
25
25
  if (!range || range.highlight.isHeader() || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
26
26
  return true;
27
27
  }
@@ -21,7 +21,7 @@ function readOnlyCommentItem(plugin) {
21
21
  return areReadOnly ? (0, _utils.markLabelAsSelected)(label) : label;
22
22
  },
23
23
  callback() {
24
- const range = this.getSelectedRangeLast();
24
+ const range = this.getSelectedRangeActive();
25
25
  range.forAll((row, column) => {
26
26
  if (row >= 0 && column >= 0) {
27
27
  const currentState = !!plugin.getCommentMeta(row, column, _comments.META_READONLY);
@@ -32,7 +32,7 @@ function readOnlyCommentItem(plugin) {
32
32
  });
33
33
  },
34
34
  disabled() {
35
- const range = this.getSelectedRangeLast();
35
+ const range = this.getSelectedRangeActive();
36
36
  if (!range || range.highlight.isHeader() || !plugin.getCommentAtCell(range.highlight.row, range.highlight.col) || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
37
37
  return true;
38
38
  }
@@ -16,7 +16,7 @@ export default function readOnlyCommentItem(plugin) {
16
16
  return areReadOnly ? markLabelAsSelected(label) : label;
17
17
  },
18
18
  callback() {
19
- const range = this.getSelectedRangeLast();
19
+ const range = this.getSelectedRangeActive();
20
20
  range.forAll((row, column) => {
21
21
  if (row >= 0 && column >= 0) {
22
22
  const currentState = !!plugin.getCommentMeta(row, column, META_READONLY);
@@ -27,7 +27,7 @@ export default function readOnlyCommentItem(plugin) {
27
27
  });
28
28
  },
29
29
  disabled() {
30
- const range = this.getSelectedRangeLast();
30
+ const range = this.getSelectedRangeActive();
31
31
  if (!range || range.highlight.isHeader() || !plugin.getCommentAtCell(range.highlight.row, range.highlight.col) || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
32
32
  return true;
33
33
  }
@@ -15,7 +15,7 @@ function removeCommentItem(plugin) {
15
15
  return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_REMOVE_COMMENT);
16
16
  },
17
17
  callback() {
18
- const range = this.getSelectedRangeLast();
18
+ const range = this.getSelectedRangeActive();
19
19
  range.forAll((row, column) => {
20
20
  if (row >= 0 && column >= 0) {
21
21
  plugin.removeCommentAtCell(row, column, false);
@@ -24,7 +24,7 @@ function removeCommentItem(plugin) {
24
24
  this.render();
25
25
  },
26
26
  disabled() {
27
- const range = this.getSelectedRangeLast();
27
+ const range = this.getSelectedRangeActive();
28
28
  if (!range || range.highlight.isHeader() || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
29
29
  return true;
30
30
  }
@@ -10,7 +10,7 @@ export default function removeCommentItem(plugin) {
10
10
  return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_REMOVE_COMMENT);
11
11
  },
12
12
  callback() {
13
- const range = this.getSelectedRangeLast();
13
+ const range = this.getSelectedRangeActive();
14
14
  range.forAll((row, column) => {
15
15
  if (row >= 0 && column >= 0) {
16
16
  plugin.removeCommentAtCell(row, column, false);
@@ -19,7 +19,7 @@ export default function removeCommentItem(plugin) {
19
19
  this.render();
20
20
  },
21
21
  disabled() {
22
- const range = this.getSelectedRangeLast();
22
+ const range = this.getSelectedRangeActive();
23
23
  if (!range || range.highlight.isHeader() || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
24
24
  return true;
25
25
  }