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
@@ -21,9 +21,11 @@ import { valueAccordingPercent, rangeEach } from "../../helpers/number.mjs";
21
21
  import SamplesGenerator from "../../utils/samplesGenerator.mjs";
22
22
  import { isPercentValue } from "../../helpers/string.mjs";
23
23
  import { PhysicalIndexToValueMap as IndexToValueMap } from "../../translations/index.mjs";
24
+ import { addClass, removeClass } from "../../helpers/dom/element.mjs";
24
25
  export const PLUGIN_KEY = 'autoRowSize';
25
26
  export const PLUGIN_PRIORITY = 40;
26
27
  const ROW_WIDTHS_MAP_NAME = 'autoRowSize';
28
+ const FIRST_COLUMN_NOT_RENDERED_CLASS_NAME = 'htFirstDatasetColumnNotRendered';
27
29
 
28
30
  /* eslint-disable jsdoc/require-description-complete-sentence */
29
31
  /**
@@ -210,9 +212,8 @@ export class AutoRowSize extends BasePlugin {
210
212
  * @type {SamplesGenerator}
211
213
  */
212
214
  _defineProperty(this, "samplesGenerator", new SamplesGenerator((row, column) => {
213
- const physicalRow = this.hot.toPhysicalRow(row);
214
215
  const physicalColumn = this.hot.toPhysicalColumn(column);
215
- if (this.hot.rowIndexMapper.isHidden(physicalRow) || this.hot.columnIndexMapper.isHidden(physicalColumn)) {
216
+ if (this.hot.columnIndexMapper.isHidden(physicalColumn)) {
216
217
  return false;
217
218
  }
218
219
  if (row >= 0 && column >= 0) {
@@ -313,6 +314,7 @@ export class AutoRowSize extends BasePlugin {
313
314
  }
314
315
  return _assertClassBrand(_AutoRowSize_brand, _this, _onAfterFormulasValuesUpdate).call(_this, ...args);
315
316
  });
317
+ this.addHook('beforeViewRender', () => _assertClassBrand(_AutoRowSize_brand, this, _onBeforeViewRender).call(this));
316
318
  this.addHook('beforeRender', () => _assertClassBrand(_AutoRowSize_brand, this, _onBeforeRender).call(this));
317
319
  this.addHook('modifyRowHeight', (height, row) => this.getRowHeight(row, height));
318
320
  this.addHook('init', () => _assertClassBrand(_AutoRowSize_brand, this, _onInit).call(this));
@@ -327,6 +329,9 @@ export class AutoRowSize extends BasePlugin {
327
329
  this.headerHeight = null;
328
330
  super.disablePlugin();
329
331
 
332
+ // Remove the "first dataset column not rendered" class name when the plugin is disabled.
333
+ _assertClassBrand(_AutoRowSize_brand, this, _toggleFirstDatasetColumnRenderedClassName).call(this, false);
334
+
330
335
  // Leave the listener active to allow auto-sizing the rows when the plugin is disabled.
331
336
  // This is necessary for height recalculation for resize handler doubleclick (ManualRowResize).
332
337
  this.addHook('beforeRowResize', (size, row, isDblClick) => _assertClassBrand(_AutoRowSize_brand, this, _onBeforeRowResize).call(this, size, row, isDblClick));
@@ -514,10 +519,19 @@ export class AutoRowSize extends BasePlugin {
514
519
  * @param {number} [defaultHeight] If no height is found, `defaultHeight` is returned instead.
515
520
  * @returns {number} The height of the specified row, in pixels.
516
521
  */
517
- getRowHeight(row, defaultHeight) {
518
- const cachedHeight = row < 0 ? this.headerHeight : this.rowHeightsMap.getValueAtIndex(this.hot.toPhysicalRow(row));
522
+ getRowHeight(row) {
523
+ let defaultHeight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.hot.stylesHandler.getDefaultRowHeight();
524
+ if (row < 0) {
525
+ var _this$headerHeight;
526
+ return (_this$headerHeight = this.headerHeight) !== null && _this$headerHeight !== void 0 ? _this$headerHeight : defaultHeight;
527
+ }
528
+ const physicalRow = this.hot.toPhysicalRow(row);
529
+ if (this.hot.rowIndexMapper.isHidden(physicalRow)) {
530
+ return defaultHeight;
531
+ }
532
+ const cachedHeight = this.rowHeightsMap.getValueAtIndex(physicalRow);
519
533
  let height = defaultHeight;
520
- if (cachedHeight !== null && cachedHeight > (defaultHeight || 0)) {
534
+ if (cachedHeight !== null && cachedHeight > defaultHeight) {
521
535
  height = cachedHeight;
522
536
  }
523
537
  return height;
@@ -601,7 +615,10 @@ export class AutoRowSize extends BasePlugin {
601
615
  }
602
616
 
603
617
  /**
604
- * On before view render listener.
618
+ * Toggles the "first dataset column not rendered" class name.
619
+ * Used to apply special styling when the first column is visible (used only in the classic (legacy) theme, with the AutoRowSize plugin enabled).
620
+ *
621
+ * @param {boolean} [forceState] Force the class to be added or removed (`true` to add, `false` to remove).
605
622
  */
606
623
 
607
624
  /**
@@ -633,6 +650,26 @@ function _calculateSpecificRowsHeight(visualRows) {
633
650
  this.ghostTable.clean();
634
651
  }
635
652
  }
653
+ function _toggleFirstDatasetColumnRenderedClassName(forceState) {
654
+ if (this.hot.stylesHandler.isClassicTheme()) {
655
+ const firstRenderedColumnVisualIndex = this.hot.getFirstRenderedVisibleColumn();
656
+ const firstRenderedColumnPhysicalIndex = this.hot.columnIndexMapper.getPhysicalFromVisualIndex(firstRenderedColumnVisualIndex);
657
+ if (forceState === false || firstRenderedColumnPhysicalIndex === this.hot.columnIndexMapper.getPhysicalFromRenderableIndex(0)) {
658
+ removeClass(this.hot.rootElement, FIRST_COLUMN_NOT_RENDERED_CLASS_NAME);
659
+ } else {
660
+ addClass(this.hot.rootElement, FIRST_COLUMN_NOT_RENDERED_CLASS_NAME);
661
+ }
662
+ }
663
+ }
664
+ /**
665
+ * `beforeViewRender` hook listener.
666
+ */
667
+ function _onBeforeViewRender() {
668
+ _assertClassBrand(_AutoRowSize_brand, this, _toggleFirstDatasetColumnRenderedClassName).call(this);
669
+ }
670
+ /**
671
+ * `beforeRender` hook listener.
672
+ */
636
673
  function _onBeforeRender() {
637
674
  this.calculateVisibleRowsHeight();
638
675
  if (!this.inProgress) {
@@ -3,9 +3,12 @@
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
5
  require("core-js/modules/es.array.push.js");
6
+ require("core-js/modules/esnext.iterator.constructor.js");
7
+ require("core-js/modules/esnext.iterator.some.js");
6
8
  var _base = require("../base");
7
9
  var _hooks = require("../../core/hooks");
8
10
  var _element = require("../../helpers/dom/element");
11
+ var _object = require("../../helpers/object");
9
12
  var _array = require("../../helpers/array");
10
13
  var _mixed = require("../../helpers/mixed");
11
14
  var _utils = require("./utils");
@@ -43,9 +46,13 @@ class Autofill extends _base.BasePlugin {
43
46
  constructor() {
44
47
  super(...arguments);
45
48
  /**
46
- * On cell corner double click callback.
49
+ * Extends the fill data with the source data based on the content of the target cells.
47
50
  *
48
- * @private
51
+ * @param {Array} fillData The fill data to extend.
52
+ * @param {Array} selectionSourceData The source data to extend the fill data with.
53
+ * @param {CellCoords} startOfDragCoords The start of the drag area.
54
+ * @param {CellCoords} endOfDragCoords The end of the drag area.
55
+ * @returns {Array} The extended fill data.
49
56
  */
50
57
  _classPrivateMethodInitSpec(this, _Autofill_brand);
51
58
  /**
@@ -149,9 +156,11 @@ class Autofill extends _base.BasePlugin {
149
156
  * Gets selection data.
150
157
  *
151
158
  * @private
159
+ * @param {boolean} [useSource=false] If `true`, returns copyable source data instead of copyable data.
152
160
  * @returns {object[]} Ranges Array of objects with properties `startRow`, `startCol`, `endRow` and `endCol`.
153
161
  */
154
162
  getSelectionData() {
163
+ let useSource = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
155
164
  const selection = this.hot.getSelectedRangeLast();
156
165
  const {
157
166
  row: startRow,
@@ -185,7 +194,12 @@ class Autofill extends _base.BasePlugin {
185
194
  (0, _array.arrayEach)(copyableRows, row => {
186
195
  const rowSet = [];
187
196
  (0, _array.arrayEach)(copyableColumns, column => {
188
- rowSet.push(this.hot.getCopyableData(row, column));
197
+ const sourceDataAtSource = useSource ? this.hot.getSourceDataAtCell(row, column) : null;
198
+ if (useSource && (0, _object.isObject)(sourceDataAtSource)) {
199
+ rowSet.push(this.hot.getCopyableSourceData(row, column));
200
+ } else {
201
+ rowSet.push(this.hot.getCopyableData(row, column));
202
+ }
189
203
  });
190
204
  data.push(rowSet);
191
205
  });
@@ -224,6 +238,7 @@ class Autofill extends _base.BasePlugin {
224
238
  } = (0, _utils.getDragDirectionAndRange)(cornersOfSelectedCells, cornersOfSelectionAndDragAreas, (row, column) => this.hot._createCellCoords(row, column));
225
239
  if (startOfDragCoords && startOfDragCoords.row > -1 && startOfDragCoords.col > -1) {
226
240
  const selectionData = this.getSelectionData();
241
+ const selectionSourceData = this.getSelectionData(true);
227
242
  const sourceRange = selectionRangeLast.clone();
228
243
  const targetRange = this.hot._createCellRange(startOfDragCoords, startOfDragCoords, endOfDragCoords);
229
244
  const beforeAutofillHookResult = this.hot.runHooks('beforeAutofill', selectionData, sourceRange, targetRange, directionOfDrag);
@@ -253,6 +268,14 @@ class Autofill extends _base.BasePlugin {
253
268
  }
254
269
  }
255
270
  }
271
+
272
+ // If the source data contains objects, we need to check every target cell for the data type.
273
+ if (selectionSourceData.some(row => row.some(cell => (0, _object.isObject)(cell)))) {
274
+ const fullFillData = _assertClassBrand(_Autofill_brand, this, _extendFillDataWithSourceData).call(this, fillData, selectionSourceData, startOfDragCoords, endOfDragCoords, directionOfDrag);
275
+ if (fullFillData.length) {
276
+ fillData = fullFillData;
277
+ }
278
+ }
256
279
  this.hot.populateFromArray(startOfDragCoords.row, startOfDragCoords.col, fillData, endOfDragCoords.row, endOfDragCoords.col, `${this.pluginName}.fill`, null);
257
280
  this.setSelection(cornersOfSelectionAndDragAreas);
258
281
  this.hot.runHooks('afterAutofill', fillData, sourceRange, targetRange, directionOfDrag);
@@ -496,6 +519,30 @@ class Autofill extends _base.BasePlugin {
496
519
  }
497
520
  }
498
521
  exports.Autofill = Autofill;
522
+ function _extendFillDataWithSourceData(fillData, selectionSourceData, startOfDragCoords, endOfDragCoords) {
523
+ const fullFillData = [];
524
+ for (let rowIndex = Math.min(startOfDragCoords.row, endOfDragCoords.row); rowIndex <= Math.max(startOfDragCoords.row, endOfDragCoords.row); rowIndex += 1) {
525
+ fullFillData.push([]);
526
+ for (let columnIndex = Math.min(startOfDragCoords.col, endOfDragCoords.col); columnIndex <= Math.max(startOfDragCoords.col, endOfDragCoords.col); columnIndex += 1) {
527
+ const sourceCell = this.hot.getSourceDataAtCell(rowIndex, columnIndex);
528
+ const relativeRowIndex = rowIndex - Math.min(startOfDragCoords.row, endOfDragCoords.row);
529
+ const relativeColumnIndex = columnIndex - Math.min(startOfDragCoords.col, endOfDragCoords.col);
530
+ const modRelativeRowIndex = relativeRowIndex % selectionSourceData.length;
531
+ const modRelativeColumnIndex = relativeColumnIndex % selectionSourceData[0].length;
532
+ if ((0, _object.isObject)(sourceCell)) {
533
+ fullFillData[relativeRowIndex][relativeColumnIndex] = selectionSourceData[modRelativeRowIndex][modRelativeColumnIndex];
534
+ } else {
535
+ fullFillData[relativeRowIndex][relativeColumnIndex] = fillData[modRelativeRowIndex][modRelativeColumnIndex];
536
+ }
537
+ }
538
+ }
539
+ return fullFillData;
540
+ }
541
+ /**
542
+ * On cell corner double click callback.
543
+ *
544
+ * @private
545
+ */
499
546
  function _onCellCornerDblClick() {
500
547
  const selectionApplied = this.selectAdjacent();
501
548
  if (selectionApplied) {
@@ -1,5 +1,7 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
2
  import "core-js/modules/es.array.push.js";
3
+ import "core-js/modules/esnext.iterator.constructor.js";
4
+ import "core-js/modules/esnext.iterator.some.js";
3
5
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
4
6
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
5
7
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -9,6 +11,7 @@ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.h
9
11
  import { BasePlugin } from "../base/index.mjs";
10
12
  import { Hooks } from "../../core/hooks/index.mjs";
11
13
  import { offset, outerHeight, outerWidth } from "../../helpers/dom/element.mjs";
14
+ import { isObject } from "../../helpers/object.mjs";
12
15
  import { arrayEach, arrayMap } from "../../helpers/array.mjs";
13
16
  import { isEmpty } from "../../helpers/mixed.mjs";
14
17
  import { getDragDirectionAndRange, DIRECTIONS, getMappedFillHandleSetting } from "./utils.mjs";
@@ -40,9 +43,13 @@ export class Autofill extends BasePlugin {
40
43
  constructor() {
41
44
  super(...arguments);
42
45
  /**
43
- * On cell corner double click callback.
46
+ * Extends the fill data with the source data based on the content of the target cells.
44
47
  *
45
- * @private
48
+ * @param {Array} fillData The fill data to extend.
49
+ * @param {Array} selectionSourceData The source data to extend the fill data with.
50
+ * @param {CellCoords} startOfDragCoords The start of the drag area.
51
+ * @param {CellCoords} endOfDragCoords The end of the drag area.
52
+ * @returns {Array} The extended fill data.
46
53
  */
47
54
  _classPrivateMethodInitSpec(this, _Autofill_brand);
48
55
  /**
@@ -146,9 +153,11 @@ export class Autofill extends BasePlugin {
146
153
  * Gets selection data.
147
154
  *
148
155
  * @private
156
+ * @param {boolean} [useSource=false] If `true`, returns copyable source data instead of copyable data.
149
157
  * @returns {object[]} Ranges Array of objects with properties `startRow`, `startCol`, `endRow` and `endCol`.
150
158
  */
151
159
  getSelectionData() {
160
+ let useSource = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
152
161
  const selection = this.hot.getSelectedRangeLast();
153
162
  const {
154
163
  row: startRow,
@@ -182,7 +191,12 @@ export class Autofill extends BasePlugin {
182
191
  arrayEach(copyableRows, row => {
183
192
  const rowSet = [];
184
193
  arrayEach(copyableColumns, column => {
185
- rowSet.push(this.hot.getCopyableData(row, column));
194
+ const sourceDataAtSource = useSource ? this.hot.getSourceDataAtCell(row, column) : null;
195
+ if (useSource && isObject(sourceDataAtSource)) {
196
+ rowSet.push(this.hot.getCopyableSourceData(row, column));
197
+ } else {
198
+ rowSet.push(this.hot.getCopyableData(row, column));
199
+ }
186
200
  });
187
201
  data.push(rowSet);
188
202
  });
@@ -221,6 +235,7 @@ export class Autofill extends BasePlugin {
221
235
  } = getDragDirectionAndRange(cornersOfSelectedCells, cornersOfSelectionAndDragAreas, (row, column) => this.hot._createCellCoords(row, column));
222
236
  if (startOfDragCoords && startOfDragCoords.row > -1 && startOfDragCoords.col > -1) {
223
237
  const selectionData = this.getSelectionData();
238
+ const selectionSourceData = this.getSelectionData(true);
224
239
  const sourceRange = selectionRangeLast.clone();
225
240
  const targetRange = this.hot._createCellRange(startOfDragCoords, startOfDragCoords, endOfDragCoords);
226
241
  const beforeAutofillHookResult = this.hot.runHooks('beforeAutofill', selectionData, sourceRange, targetRange, directionOfDrag);
@@ -250,6 +265,14 @@ export class Autofill extends BasePlugin {
250
265
  }
251
266
  }
252
267
  }
268
+
269
+ // If the source data contains objects, we need to check every target cell for the data type.
270
+ if (selectionSourceData.some(row => row.some(cell => isObject(cell)))) {
271
+ const fullFillData = _assertClassBrand(_Autofill_brand, this, _extendFillDataWithSourceData).call(this, fillData, selectionSourceData, startOfDragCoords, endOfDragCoords, directionOfDrag);
272
+ if (fullFillData.length) {
273
+ fillData = fullFillData;
274
+ }
275
+ }
253
276
  this.hot.populateFromArray(startOfDragCoords.row, startOfDragCoords.col, fillData, endOfDragCoords.row, endOfDragCoords.col, `${this.pluginName}.fill`, null);
254
277
  this.setSelection(cornersOfSelectionAndDragAreas);
255
278
  this.hot.runHooks('afterAutofill', fillData, sourceRange, targetRange, directionOfDrag);
@@ -492,6 +515,30 @@ export class Autofill extends BasePlugin {
492
515
  super.destroy();
493
516
  }
494
517
  }
518
+ function _extendFillDataWithSourceData(fillData, selectionSourceData, startOfDragCoords, endOfDragCoords) {
519
+ const fullFillData = [];
520
+ for (let rowIndex = Math.min(startOfDragCoords.row, endOfDragCoords.row); rowIndex <= Math.max(startOfDragCoords.row, endOfDragCoords.row); rowIndex += 1) {
521
+ fullFillData.push([]);
522
+ for (let columnIndex = Math.min(startOfDragCoords.col, endOfDragCoords.col); columnIndex <= Math.max(startOfDragCoords.col, endOfDragCoords.col); columnIndex += 1) {
523
+ const sourceCell = this.hot.getSourceDataAtCell(rowIndex, columnIndex);
524
+ const relativeRowIndex = rowIndex - Math.min(startOfDragCoords.row, endOfDragCoords.row);
525
+ const relativeColumnIndex = columnIndex - Math.min(startOfDragCoords.col, endOfDragCoords.col);
526
+ const modRelativeRowIndex = relativeRowIndex % selectionSourceData.length;
527
+ const modRelativeColumnIndex = relativeColumnIndex % selectionSourceData[0].length;
528
+ if (isObject(sourceCell)) {
529
+ fullFillData[relativeRowIndex][relativeColumnIndex] = selectionSourceData[modRelativeRowIndex][modRelativeColumnIndex];
530
+ } else {
531
+ fullFillData[relativeRowIndex][relativeColumnIndex] = fillData[modRelativeRowIndex][modRelativeColumnIndex];
532
+ }
533
+ }
534
+ }
535
+ return fullFillData;
536
+ }
537
+ /**
538
+ * On cell corner double click callback.
539
+ *
540
+ * @private
541
+ */
495
542
  function _onCellCornerDblClick() {
496
543
  const selectionApplied = this.selectAdjacent();
497
544
  if (selectionApplied) {
@@ -13,13 +13,15 @@ var _registry3 = require("../../editors/registry");
13
13
  var _registry4 = require("../../renderers/registry");
14
14
  var _registry5 = require("../../validators/registry");
15
15
  var _eventManager = _interopRequireDefault(require("../../eventManager"));
16
+ var _console = require("../../helpers/console");
16
17
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
18
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
18
- function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
19
- function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
20
19
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
21
20
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
22
21
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
22
+ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
23
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
24
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
23
25
  function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
24
26
  function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
25
27
  const DEPS_TYPE_CHECKERS = new Map([['plugin', _registry.hasPlugin], ['cell-type', _registry2.hasCellType], ['editor', _registry3.hasEditor], ['renderer', _registry4.hasRenderer], ['validator', _registry5.hasValidator]]);
@@ -32,6 +34,7 @@ let initializedPlugins = null;
32
34
  * @util
33
35
  * @property {Core} hot Handsontable instance.
34
36
  */
37
+ var _pluginSettings = /*#__PURE__*/new WeakMap();
35
38
  var _hooks = /*#__PURE__*/new WeakMap();
36
39
  var _BasePlugin_brand = /*#__PURE__*/new WeakSet();
37
40
  class BasePlugin {
@@ -62,9 +65,18 @@ class BasePlugin {
62
65
  }
63
66
 
64
67
  /**
65
- * The instance of the {@link EventManager} class.
68
+ * Validators for plugin settings.
66
69
  *
67
- * @type {EventManager}
70
+ * @type {Function|object|null}
71
+ */
72
+ static get SETTINGS_VALIDATORS() {
73
+ return null;
74
+ }
75
+
76
+ /**
77
+ * Plugin settings.
78
+ *
79
+ * @type {object|null}
68
80
  */
69
81
 
70
82
  /**
@@ -81,6 +93,12 @@ class BasePlugin {
81
93
  * @returns {boolean}
82
94
  */
83
95
  _classPrivateMethodInitSpec(this, _BasePlugin_brand);
96
+ _classPrivateFieldInitSpec(this, _pluginSettings, null);
97
+ /**
98
+ * The instance of the {@link EventManager} class.
99
+ *
100
+ * @type {EventManager}
101
+ */
84
102
  _defineProperty(this, "eventManager", new _eventManager.default(this));
85
103
  /**
86
104
  * @type {string}
@@ -121,6 +139,7 @@ class BasePlugin {
121
139
  }
122
140
  init() {
123
141
  this.pluginName = this.hot.getPluginName(this);
142
+ this.updatePluginSettings(this.hot.getSettings()[this.constructor.PLUGIN_KEY]);
124
143
  const pluginDeps = this.constructor.PLUGIN_DEPS;
125
144
  const deps = Array.isArray(pluginDeps) ? pluginDeps : [];
126
145
  if (deps.length > 0) {
@@ -188,25 +207,75 @@ class BasePlugin {
188
207
  * @returns {*}
189
208
  */
190
209
  getSetting(settingName) {
191
- const pluginSettings = this.hot.getSettings()[this.constructor.PLUGIN_KEY];
210
+ const defaultSettings = this.constructor.DEFAULT_SETTINGS;
192
211
  if (settingName === undefined) {
193
- return pluginSettings;
212
+ if ((0, _object.isObject)(_classPrivateFieldGet(_pluginSettings, this))) {
213
+ return (0, _object.assignObjectDefaults)(_classPrivateFieldGet(_pluginSettings, this), defaultSettings);
214
+ }
215
+ return _classPrivateFieldGet(_pluginSettings, this);
194
216
  }
195
- const defaultSettings = this.constructor.DEFAULT_SETTINGS;
196
- if ((Array.isArray(pluginSettings) || (0, _object.isObject)(pluginSettings)) && defaultSettings[defaultMainSettingSymbol] === settingName) {
197
- var _pluginSettings$setti;
198
- if (Array.isArray(pluginSettings)) {
199
- return pluginSettings;
217
+ if ((Array.isArray(_classPrivateFieldGet(_pluginSettings, this)) || (0, _object.isObject)(_classPrivateFieldGet(_pluginSettings, this))) && defaultSettings[defaultMainSettingSymbol] === settingName) {
218
+ var _classPrivateFieldGet2;
219
+ if (Array.isArray(_classPrivateFieldGet(_pluginSettings, this))) {
220
+ return _classPrivateFieldGet(_pluginSettings, this);
200
221
  }
201
- return (_pluginSettings$setti = pluginSettings[settingName]) !== null && _pluginSettings$setti !== void 0 ? _pluginSettings$setti : defaultSettings[settingName];
222
+ return (_classPrivateFieldGet2 = _classPrivateFieldGet(_pluginSettings, this)[settingName]) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : defaultSettings[settingName];
202
223
  }
203
- if ((0, _object.isObject)(pluginSettings)) {
204
- var _pluginSettings$setti2;
205
- return (_pluginSettings$setti2 = pluginSettings[settingName]) !== null && _pluginSettings$setti2 !== void 0 ? _pluginSettings$setti2 : defaultSettings[settingName];
224
+ if (settingName.includes('.')) {
225
+ const pluginValue = (0, _object.getProperty)(_classPrivateFieldGet(_pluginSettings, this), settingName);
226
+ const defaultValue = (0, _object.getProperty)(defaultSettings, settingName);
227
+ if ((0, _object.isObject)(pluginValue)) {
228
+ return (0, _object.assignObjectDefaults)(pluginValue, defaultValue);
229
+ }
230
+ return pluginValue !== undefined ? pluginValue : defaultValue;
231
+ }
232
+ if ((0, _object.isObject)(_classPrivateFieldGet(_pluginSettings, this))) {
233
+ return (0, _object.assignObjectDefaults)(_classPrivateFieldGet(_pluginSettings, this), defaultSettings)[settingName];
206
234
  }
207
235
  return defaultSettings[settingName];
208
236
  }
209
237
 
238
+ /**
239
+ * Update plugin settings.
240
+ *
241
+ * @param {*} newSettings New settings.
242
+ * @returns {object} Updated settings object.
243
+ */
244
+ updatePluginSettings(newSettings) {
245
+ const settingsValidators = this.constructor.SETTINGS_VALIDATORS;
246
+ if (settingsValidators && typeof settingsValidators === 'function' && typeof newSettings !== 'object') {
247
+ const isValid = settingsValidators(newSettings);
248
+ if (isValid === false) {
249
+ (0, _console.warn)(`${this.pluginName} Plugin: option is not valid and it will be ignored.`);
250
+ return;
251
+ }
252
+ _classPrivateFieldSet(_pluginSettings, this, newSettings);
253
+ return _classPrivateFieldGet(_pluginSettings, this);
254
+ }
255
+ if (settingsValidators && typeof settingsValidators === 'object' && typeof newSettings === 'object') {
256
+ if (_classPrivateFieldGet(_pluginSettings, this) === null || typeof _classPrivateFieldGet(_pluginSettings, this) !== 'object') {
257
+ _classPrivateFieldSet(_pluginSettings, this, {
258
+ ...this.constructor.DEFAULT_SETTINGS
259
+ });
260
+ }
261
+ Object.keys(settingsValidators).forEach(key => {
262
+ if (!(key in newSettings)) {
263
+ return;
264
+ }
265
+ const validator = settingsValidators[key];
266
+ const isValid = validator ? validator(newSettings[key]) : true;
267
+ if (isValid === false) {
268
+ (0, _console.warn)(`${this.pluginName} Plugin: "${key}" option is not valid and it will be ignored.`);
269
+ return;
270
+ }
271
+ _classPrivateFieldGet(_pluginSettings, this)[key] = newSettings[key];
272
+ });
273
+ return _classPrivateFieldGet(_pluginSettings, this);
274
+ }
275
+ _classPrivateFieldSet(_pluginSettings, this, newSettings);
276
+ return newSettings;
277
+ }
278
+
210
279
  /**
211
280
  * Add listener to plugin hooks system.
212
281
  *
@@ -284,6 +353,7 @@ class BasePlugin {
284
353
  this.enablePlugin();
285
354
  }
286
355
  if (this.enabled && this.isEnabled() && relevantToSettings) {
356
+ this.updatePluginSettings(newSettings[this.constructor.PLUGIN_KEY]);
287
357
  this.updatePlugin(newSettings);
288
358
  }
289
359
  }
@@ -301,6 +371,7 @@ class BasePlugin {
301
371
  */
302
372
  destroy() {
303
373
  var _this$eventManager2;
374
+ _classPrivateFieldSet(_pluginSettings, this, null);
304
375
  (_this$eventManager2 = this.eventManager) === null || _this$eventManager2 === void 0 || _this$eventManager2.destroy();
305
376
  this.clearHooks();
306
377
  (0, _object.objectEach)(this, (value, property) => {
@@ -3,14 +3,15 @@ import "core-js/modules/es.array.push.js";
3
3
  import "core-js/modules/esnext.iterator.constructor.js";
4
4
  import "core-js/modules/esnext.iterator.for-each.js";
5
5
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
6
- function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
7
- function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
8
6
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
7
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
8
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
+ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
10
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
11
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
11
12
  function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
12
13
  function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
13
- import { defineGetter, objectEach, isObject } from "../../helpers/object.mjs";
14
+ import { defineGetter, objectEach, isObject, assignObjectDefaults, getProperty } from "../../helpers/object.mjs";
14
15
  import { arrayEach } from "../../helpers/array.mjs";
15
16
  import { getPluginsNames, hasPlugin } from "../registry.mjs";
16
17
  import { hasCellType } from "../../cellTypes/registry.mjs";
@@ -18,6 +19,7 @@ import { hasEditor } from "../../editors/registry.mjs";
18
19
  import { hasRenderer } from "../../renderers/registry.mjs";
19
20
  import { hasValidator } from "../../validators/registry.mjs";
20
21
  import EventManager from "../../eventManager.mjs";
22
+ import { warn } from "../../helpers/console.mjs";
21
23
  const DEPS_TYPE_CHECKERS = new Map([['plugin', hasPlugin], ['cell-type', hasCellType], ['editor', hasEditor], ['renderer', hasRenderer], ['validator', hasValidator]]);
22
24
  export const defaultMainSettingSymbol = Symbol('mainSetting');
23
25
  export const PLUGIN_KEY = 'base';
@@ -28,6 +30,7 @@ let initializedPlugins = null;
28
30
  * @util
29
31
  * @property {Core} hot Handsontable instance.
30
32
  */
33
+ var _pluginSettings = /*#__PURE__*/new WeakMap();
31
34
  var _hooks = /*#__PURE__*/new WeakMap();
32
35
  var _BasePlugin_brand = /*#__PURE__*/new WeakSet();
33
36
  export class BasePlugin {
@@ -58,9 +61,18 @@ export class BasePlugin {
58
61
  }
59
62
 
60
63
  /**
61
- * The instance of the {@link EventManager} class.
64
+ * Validators for plugin settings.
62
65
  *
63
- * @type {EventManager}
66
+ * @type {Function|object|null}
67
+ */
68
+ static get SETTINGS_VALIDATORS() {
69
+ return null;
70
+ }
71
+
72
+ /**
73
+ * Plugin settings.
74
+ *
75
+ * @type {object|null}
64
76
  */
65
77
 
66
78
  /**
@@ -77,6 +89,12 @@ export class BasePlugin {
77
89
  * @returns {boolean}
78
90
  */
79
91
  _classPrivateMethodInitSpec(this, _BasePlugin_brand);
92
+ _classPrivateFieldInitSpec(this, _pluginSettings, null);
93
+ /**
94
+ * The instance of the {@link EventManager} class.
95
+ *
96
+ * @type {EventManager}
97
+ */
80
98
  _defineProperty(this, "eventManager", new EventManager(this));
81
99
  /**
82
100
  * @type {string}
@@ -117,6 +135,7 @@ export class BasePlugin {
117
135
  }
118
136
  init() {
119
137
  this.pluginName = this.hot.getPluginName(this);
138
+ this.updatePluginSettings(this.hot.getSettings()[this.constructor.PLUGIN_KEY]);
120
139
  const pluginDeps = this.constructor.PLUGIN_DEPS;
121
140
  const deps = Array.isArray(pluginDeps) ? pluginDeps : [];
122
141
  if (deps.length > 0) {
@@ -184,25 +203,75 @@ export class BasePlugin {
184
203
  * @returns {*}
185
204
  */
186
205
  getSetting(settingName) {
187
- const pluginSettings = this.hot.getSettings()[this.constructor.PLUGIN_KEY];
206
+ const defaultSettings = this.constructor.DEFAULT_SETTINGS;
188
207
  if (settingName === undefined) {
189
- return pluginSettings;
208
+ if (isObject(_classPrivateFieldGet(_pluginSettings, this))) {
209
+ return assignObjectDefaults(_classPrivateFieldGet(_pluginSettings, this), defaultSettings);
210
+ }
211
+ return _classPrivateFieldGet(_pluginSettings, this);
190
212
  }
191
- const defaultSettings = this.constructor.DEFAULT_SETTINGS;
192
- if ((Array.isArray(pluginSettings) || isObject(pluginSettings)) && defaultSettings[defaultMainSettingSymbol] === settingName) {
193
- var _pluginSettings$setti;
194
- if (Array.isArray(pluginSettings)) {
195
- return pluginSettings;
213
+ if ((Array.isArray(_classPrivateFieldGet(_pluginSettings, this)) || isObject(_classPrivateFieldGet(_pluginSettings, this))) && defaultSettings[defaultMainSettingSymbol] === settingName) {
214
+ var _classPrivateFieldGet2;
215
+ if (Array.isArray(_classPrivateFieldGet(_pluginSettings, this))) {
216
+ return _classPrivateFieldGet(_pluginSettings, this);
196
217
  }
197
- return (_pluginSettings$setti = pluginSettings[settingName]) !== null && _pluginSettings$setti !== void 0 ? _pluginSettings$setti : defaultSettings[settingName];
218
+ return (_classPrivateFieldGet2 = _classPrivateFieldGet(_pluginSettings, this)[settingName]) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : defaultSettings[settingName];
198
219
  }
199
- if (isObject(pluginSettings)) {
200
- var _pluginSettings$setti2;
201
- return (_pluginSettings$setti2 = pluginSettings[settingName]) !== null && _pluginSettings$setti2 !== void 0 ? _pluginSettings$setti2 : defaultSettings[settingName];
220
+ if (settingName.includes('.')) {
221
+ const pluginValue = getProperty(_classPrivateFieldGet(_pluginSettings, this), settingName);
222
+ const defaultValue = getProperty(defaultSettings, settingName);
223
+ if (isObject(pluginValue)) {
224
+ return assignObjectDefaults(pluginValue, defaultValue);
225
+ }
226
+ return pluginValue !== undefined ? pluginValue : defaultValue;
227
+ }
228
+ if (isObject(_classPrivateFieldGet(_pluginSettings, this))) {
229
+ return assignObjectDefaults(_classPrivateFieldGet(_pluginSettings, this), defaultSettings)[settingName];
202
230
  }
203
231
  return defaultSettings[settingName];
204
232
  }
205
233
 
234
+ /**
235
+ * Update plugin settings.
236
+ *
237
+ * @param {*} newSettings New settings.
238
+ * @returns {object} Updated settings object.
239
+ */
240
+ updatePluginSettings(newSettings) {
241
+ const settingsValidators = this.constructor.SETTINGS_VALIDATORS;
242
+ if (settingsValidators && typeof settingsValidators === 'function' && typeof newSettings !== 'object') {
243
+ const isValid = settingsValidators(newSettings);
244
+ if (isValid === false) {
245
+ warn(`${this.pluginName} Plugin: option is not valid and it will be ignored.`);
246
+ return;
247
+ }
248
+ _classPrivateFieldSet(_pluginSettings, this, newSettings);
249
+ return _classPrivateFieldGet(_pluginSettings, this);
250
+ }
251
+ if (settingsValidators && typeof settingsValidators === 'object' && typeof newSettings === 'object') {
252
+ if (_classPrivateFieldGet(_pluginSettings, this) === null || typeof _classPrivateFieldGet(_pluginSettings, this) !== 'object') {
253
+ _classPrivateFieldSet(_pluginSettings, this, {
254
+ ...this.constructor.DEFAULT_SETTINGS
255
+ });
256
+ }
257
+ Object.keys(settingsValidators).forEach(key => {
258
+ if (!(key in newSettings)) {
259
+ return;
260
+ }
261
+ const validator = settingsValidators[key];
262
+ const isValid = validator ? validator(newSettings[key]) : true;
263
+ if (isValid === false) {
264
+ warn(`${this.pluginName} Plugin: "${key}" option is not valid and it will be ignored.`);
265
+ return;
266
+ }
267
+ _classPrivateFieldGet(_pluginSettings, this)[key] = newSettings[key];
268
+ });
269
+ return _classPrivateFieldGet(_pluginSettings, this);
270
+ }
271
+ _classPrivateFieldSet(_pluginSettings, this, newSettings);
272
+ return newSettings;
273
+ }
274
+
206
275
  /**
207
276
  * Add listener to plugin hooks system.
208
277
  *
@@ -280,6 +349,7 @@ export class BasePlugin {
280
349
  this.enablePlugin();
281
350
  }
282
351
  if (this.enabled && this.isEnabled() && relevantToSettings) {
352
+ this.updatePluginSettings(newSettings[this.constructor.PLUGIN_KEY]);
283
353
  this.updatePlugin(newSettings);
284
354
  }
285
355
  }
@@ -297,6 +367,7 @@ export class BasePlugin {
297
367
  */
298
368
  destroy() {
299
369
  var _this$eventManager2;
370
+ _classPrivateFieldSet(_pluginSettings, this, null);
300
371
  (_this$eventManager2 = this.eventManager) === null || _this$eventManager2 === void 0 || _this$eventManager2.destroy();
301
372
  this.clearHooks();
302
373
  objectEach(this, (value, property) => {