handsontable 12.2.0 → 12.3.0-next-9dc4f5d-20221209

Sign up to get free protection for your applications and to get access to all the features.
Files changed (659) hide show
  1. package/3rdparty/walkontable/src/border.js +13 -6
  2. package/3rdparty/walkontable/src/border.mjs +12 -5
  3. package/3rdparty/walkontable/src/calculator/viewportColumns.js +10 -1
  4. package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +10 -1
  5. package/3rdparty/walkontable/src/calculator/viewportRows.js +10 -1
  6. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +10 -1
  7. package/3rdparty/walkontable/src/cell/coords.d.ts +1 -1
  8. package/3rdparty/walkontable/src/cell/coords.js +64 -26
  9. package/3rdparty/walkontable/src/cell/coords.mjs +64 -26
  10. package/3rdparty/walkontable/src/cell/range.d.ts +19 -16
  11. package/3rdparty/walkontable/src/cell/range.js +199 -104
  12. package/3rdparty/walkontable/src/cell/range.mjs +201 -106
  13. package/3rdparty/walkontable/src/core/_base.js +17 -3
  14. package/3rdparty/walkontable/src/core/_base.mjs +20 -6
  15. package/3rdparty/walkontable/src/core/clone.js +13 -7
  16. package/3rdparty/walkontable/src/core/clone.mjs +15 -9
  17. package/3rdparty/walkontable/src/core/core.js +8 -2
  18. package/3rdparty/walkontable/src/core/core.mjs +10 -4
  19. package/3rdparty/walkontable/src/event.js +10 -1
  20. package/3rdparty/walkontable/src/event.mjs +10 -1
  21. package/3rdparty/walkontable/src/facade/core.js +16 -2
  22. package/3rdparty/walkontable/src/facade/core.mjs +22 -8
  23. package/3rdparty/walkontable/src/filter/column.js +16 -2
  24. package/3rdparty/walkontable/src/filter/column.mjs +16 -2
  25. package/3rdparty/walkontable/src/filter/row.js +16 -2
  26. package/3rdparty/walkontable/src/filter/row.mjs +16 -2
  27. package/3rdparty/walkontable/src/overlay/_base.js +17 -3
  28. package/3rdparty/walkontable/src/overlay/_base.mjs +24 -10
  29. package/3rdparty/walkontable/src/overlay/bottom.js +13 -7
  30. package/3rdparty/walkontable/src/overlay/bottom.mjs +15 -9
  31. package/3rdparty/walkontable/src/overlay/bottomInlineStartCorner.js +8 -2
  32. package/3rdparty/walkontable/src/overlay/bottomInlineStartCorner.mjs +10 -4
  33. package/3rdparty/walkontable/src/overlay/inlineStart.js +8 -2
  34. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +10 -4
  35. package/3rdparty/walkontable/src/overlay/top.js +13 -7
  36. package/3rdparty/walkontable/src/overlay/top.mjs +15 -9
  37. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +13 -7
  38. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +15 -9
  39. package/3rdparty/walkontable/src/overlays.js +69 -19
  40. package/3rdparty/walkontable/src/overlays.mjs +71 -21
  41. package/3rdparty/walkontable/src/renderer/_base.js +16 -2
  42. package/3rdparty/walkontable/src/renderer/_base.mjs +20 -6
  43. package/3rdparty/walkontable/src/renderer/cells.js +8 -2
  44. package/3rdparty/walkontable/src/renderer/cells.mjs +20 -14
  45. package/3rdparty/walkontable/src/renderer/colGroup.js +8 -2
  46. package/3rdparty/walkontable/src/renderer/colGroup.mjs +19 -13
  47. package/3rdparty/walkontable/src/renderer/columnHeaders.js +8 -2
  48. package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +19 -13
  49. package/3rdparty/walkontable/src/renderer/index.js +16 -2
  50. package/3rdparty/walkontable/src/renderer/index.mjs +20 -6
  51. package/3rdparty/walkontable/src/renderer/rowHeaders.js +8 -2
  52. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +20 -14
  53. package/3rdparty/walkontable/src/renderer/rows.js +8 -3
  54. package/3rdparty/walkontable/src/renderer/rows.mjs +8 -3
  55. package/3rdparty/walkontable/src/renderer/table.js +16 -2
  56. package/3rdparty/walkontable/src/renderer/table.mjs +16 -2
  57. package/3rdparty/walkontable/src/scroll.js +16 -3
  58. package/3rdparty/walkontable/src/scroll.mjs +18 -5
  59. package/3rdparty/walkontable/src/selection.js +11 -5
  60. package/3rdparty/walkontable/src/selection.mjs +11 -5
  61. package/3rdparty/walkontable/src/settings.js +16 -2
  62. package/3rdparty/walkontable/src/settings.mjs +16 -2
  63. package/3rdparty/walkontable/src/table/bottom.js +8 -2
  64. package/3rdparty/walkontable/src/table/bottom.mjs +13 -7
  65. package/3rdparty/walkontable/src/table/bottomInlineStartCorner.js +8 -2
  66. package/3rdparty/walkontable/src/table/bottomInlineStartCorner.mjs +14 -8
  67. package/3rdparty/walkontable/src/table/inlineStart.js +8 -2
  68. package/3rdparty/walkontable/src/table/inlineStart.mjs +10 -4
  69. package/3rdparty/walkontable/src/table/master.js +8 -2
  70. package/3rdparty/walkontable/src/table/master.mjs +13 -7
  71. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +12 -6
  72. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +12 -6
  73. package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +12 -6
  74. package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +12 -6
  75. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +12 -6
  76. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +12 -6
  77. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +12 -6
  78. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +12 -6
  79. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +12 -6
  80. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +12 -6
  81. package/3rdparty/walkontable/src/table/top.js +8 -2
  82. package/3rdparty/walkontable/src/table/top.mjs +13 -7
  83. package/3rdparty/walkontable/src/table/topInlineStartCorner.js +8 -2
  84. package/3rdparty/walkontable/src/table/topInlineStartCorner.mjs +14 -8
  85. package/3rdparty/walkontable/src/table.js +13 -6
  86. package/3rdparty/walkontable/src/table.mjs +21 -14
  87. package/3rdparty/walkontable/src/utils/column.js +12 -2
  88. package/3rdparty/walkontable/src/utils/column.mjs +16 -6
  89. package/3rdparty/walkontable/src/utils/nodesPool.js +16 -2
  90. package/3rdparty/walkontable/src/utils/nodesPool.mjs +16 -2
  91. package/3rdparty/walkontable/src/utils/orderView/sharedView.js +8 -2
  92. package/3rdparty/walkontable/src/utils/orderView/sharedView.mjs +12 -6
  93. package/3rdparty/walkontable/src/utils/orderView/view.js +16 -2
  94. package/3rdparty/walkontable/src/utils/orderView/view.mjs +23 -9
  95. package/3rdparty/walkontable/src/utils/orderView/viewSize.js +16 -2
  96. package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +16 -2
  97. package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +16 -2
  98. package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +31 -17
  99. package/3rdparty/walkontable/src/utils/row.js +16 -2
  100. package/3rdparty/walkontable/src/utils/row.mjs +16 -2
  101. package/3rdparty/walkontable/src/viewport.js +16 -2
  102. package/3rdparty/walkontable/src/viewport.mjs +18 -4
  103. package/CHANGELOG.md +23 -0
  104. package/base.d.ts +1 -0
  105. package/base.js +7 -2
  106. package/base.mjs +9 -4
  107. package/cellTypes/index.mjs +4 -3
  108. package/core.d.ts +1 -1
  109. package/core.js +234 -122
  110. package/core.mjs +231 -119
  111. package/dataMap/dataMap.js +98 -28
  112. package/dataMap/dataMap.mjs +97 -27
  113. package/dataMap/dataSource.js +14 -2
  114. package/dataMap/dataSource.mjs +17 -5
  115. package/dataMap/metaManager/index.js +15 -2
  116. package/dataMap/metaManager/index.mjs +41 -28
  117. package/dataMap/metaManager/lazyFactoryMap.js +7 -1
  118. package/dataMap/metaManager/lazyFactoryMap.mjs +7 -1
  119. package/dataMap/metaManager/metaLayers/cellMeta.js +13 -8
  120. package/dataMap/metaManager/metaLayers/cellMeta.mjs +12 -7
  121. package/dataMap/metaManager/metaLayers/columnMeta.js +15 -2
  122. package/dataMap/metaManager/metaLayers/columnMeta.mjs +23 -9
  123. package/dataMap/metaManager/metaLayers/globalMeta.js +26 -2
  124. package/dataMap/metaManager/metaLayers/globalMeta.mjs +27 -3
  125. package/dataMap/metaManager/metaLayers/tableMeta.js +17 -3
  126. package/dataMap/metaManager/metaLayers/tableMeta.mjs +41 -27
  127. package/dataMap/metaManager/metaSchema.js +119 -66
  128. package/dataMap/metaManager/metaSchema.mjs +119 -66
  129. package/dataMap/metaManager/mods/dynamicCellMeta.js +12 -2
  130. package/dataMap/metaManager/mods/dynamicCellMeta.mjs +26 -16
  131. package/dataMap/metaManager/mods/extendMetaProperties.js +12 -2
  132. package/dataMap/metaManager/mods/extendMetaProperties.mjs +10 -1
  133. package/dataMap/metaManager/utils.js +44 -14
  134. package/dataMap/metaManager/utils.mjs +51 -20
  135. package/dataMap/replaceData.js +2 -1
  136. package/dataMap/replaceData.mjs +24 -22
  137. package/dist/handsontable.css +9 -9
  138. package/dist/handsontable.full.css +9 -9
  139. package/dist/handsontable.full.js +7350 -10885
  140. package/dist/handsontable.full.min.css +2 -2
  141. package/dist/handsontable.full.min.js +107 -113
  142. package/dist/handsontable.js +5800 -4499
  143. package/dist/handsontable.min.css +2 -2
  144. package/dist/handsontable.min.js +3 -3
  145. package/dist/languages/all.js +111 -65
  146. package/dist/languages/all.min.js +1 -1
  147. package/dist/languages/ar-AR.js +50 -4
  148. package/dist/languages/ar-AR.min.js +1 -1
  149. package/dist/languages/cs-CZ.js +52 -6
  150. package/dist/languages/cs-CZ.min.js +1 -1
  151. package/dist/languages/de-CH.js +52 -6
  152. package/dist/languages/de-CH.min.js +1 -1
  153. package/dist/languages/de-DE.js +53 -7
  154. package/dist/languages/de-DE.min.js +1 -1
  155. package/dist/languages/en-US.js +56 -10
  156. package/dist/languages/en-US.min.js +1 -1
  157. package/dist/languages/es-MX.js +56 -10
  158. package/dist/languages/es-MX.min.js +1 -1
  159. package/dist/languages/fr-FR.js +55 -9
  160. package/dist/languages/fr-FR.min.js +1 -1
  161. package/dist/languages/it-IT.js +55 -9
  162. package/dist/languages/it-IT.min.js +1 -1
  163. package/dist/languages/ja-JP.js +83 -33
  164. package/dist/languages/ja-JP.min.js +1 -1
  165. package/dist/languages/ko-KR.js +84 -33
  166. package/dist/languages/ko-KR.min.js +1 -1
  167. package/dist/languages/lv-LV.js +85 -33
  168. package/dist/languages/lv-LV.min.js +1 -1
  169. package/dist/languages/nb-NO.js +86 -33
  170. package/dist/languages/nb-NO.min.js +1 -1
  171. package/dist/languages/nl-NL.js +87 -33
  172. package/dist/languages/nl-NL.min.js +1 -1
  173. package/dist/languages/pl-PL.js +88 -33
  174. package/dist/languages/pl-PL.min.js +1 -1
  175. package/dist/languages/pt-BR.js +68 -19
  176. package/dist/languages/pt-BR.min.js +1 -1
  177. package/dist/languages/ru-RU.js +68 -19
  178. package/dist/languages/ru-RU.min.js +1 -1
  179. package/dist/languages/sr-SP.js +55 -6
  180. package/dist/languages/sr-SP.min.js +1 -1
  181. package/dist/languages/zh-CN.js +55 -6
  182. package/dist/languages/zh-CN.min.js +1 -1
  183. package/dist/languages/zh-TW.js +55 -6
  184. package/dist/languages/zh-TW.min.js +1 -1
  185. package/editorManager.js +18 -9
  186. package/editorManager.mjs +15 -6
  187. package/editors/autocompleteEditor/autocompleteEditor.js +10 -5
  188. package/editors/autocompleteEditor/autocompleteEditor.mjs +9 -4
  189. package/editors/baseEditor/baseEditor.js +11 -6
  190. package/editors/baseEditor/baseEditor.mjs +10 -5
  191. package/editors/checkboxEditor/checkboxEditor.js +6 -1
  192. package/editors/checkboxEditor/checkboxEditor.mjs +6 -1
  193. package/editors/dateEditor/dateEditor.js +6 -1
  194. package/editors/dateEditor/dateEditor.mjs +6 -1
  195. package/editors/dropdownEditor/dropdownEditor.js +6 -1
  196. package/editors/dropdownEditor/dropdownEditor.mjs +6 -1
  197. package/editors/handsontableEditor/handsontableEditor.js +6 -1
  198. package/editors/handsontableEditor/handsontableEditor.mjs +6 -1
  199. package/editors/index.mjs +4 -3
  200. package/editors/numericEditor/numericEditor.js +6 -1
  201. package/editors/numericEditor/numericEditor.mjs +6 -1
  202. package/editors/passwordEditor/passwordEditor.js +6 -1
  203. package/editors/passwordEditor/passwordEditor.mjs +6 -1
  204. package/editors/registry.js +3 -0
  205. package/editors/registry.mjs +5 -1
  206. package/editors/selectEditor/selectEditor.js +6 -1
  207. package/editors/selectEditor/selectEditor.mjs +6 -1
  208. package/editors/textEditor/caretPositioner.mjs +11 -10
  209. package/editors/textEditor/textEditor.js +7 -2
  210. package/editors/textEditor/textEditor.mjs +7 -2
  211. package/editors/timeEditor/timeEditor.js +6 -1
  212. package/editors/timeEditor/timeEditor.mjs +6 -1
  213. package/eventManager.js +24 -9
  214. package/eventManager.mjs +26 -11
  215. package/helpers/console.mjs +6 -5
  216. package/helpers/data.d.ts +0 -1
  217. package/helpers/data.js +0 -49
  218. package/helpers/data.mjs +1 -49
  219. package/helpers/dom/element.js +23 -0
  220. package/helpers/dom/element.mjs +30 -7
  221. package/helpers/feature.js +9 -36
  222. package/helpers/feature.mjs +3 -30
  223. package/helpers/function.mjs +7 -6
  224. package/helpers/mixed.js +2 -2
  225. package/helpers/mixed.mjs +9 -8
  226. package/helpers/object.js +15 -9
  227. package/helpers/object.mjs +17 -10
  228. package/helpers/string.mjs +7 -6
  229. package/helpers/templateLiteralTag.mjs +8 -7
  230. package/i18n/constants.js +49 -42
  231. package/i18n/constants.mjs +45 -41
  232. package/i18n/languages/ar-AR.js +12 -7
  233. package/i18n/languages/ar-AR.mjs +16 -2
  234. package/i18n/languages/cs-CZ.js +12 -7
  235. package/i18n/languages/cs-CZ.mjs +16 -2
  236. package/i18n/languages/de-CH.js +12 -7
  237. package/i18n/languages/de-CH.mjs +16 -2
  238. package/i18n/languages/de-DE.js +12 -7
  239. package/i18n/languages/de-DE.mjs +16 -2
  240. package/i18n/languages/en-US.js +13 -8
  241. package/i18n/languages/en-US.mjs +17 -3
  242. package/i18n/languages/es-MX.js +13 -8
  243. package/i18n/languages/es-MX.mjs +19 -4
  244. package/i18n/languages/fr-FR.js +12 -7
  245. package/i18n/languages/fr-FR.mjs +16 -2
  246. package/i18n/languages/it-IT.js +12 -7
  247. package/i18n/languages/it-IT.mjs +16 -2
  248. package/i18n/languages/ja-JP.js +12 -7
  249. package/i18n/languages/ja-JP.mjs +16 -2
  250. package/i18n/languages/ko-KR.js +12 -7
  251. package/i18n/languages/ko-KR.mjs +16 -2
  252. package/i18n/languages/lv-LV.js +13 -8
  253. package/i18n/languages/lv-LV.mjs +19 -5
  254. package/i18n/languages/nb-NO.js +12 -7
  255. package/i18n/languages/nb-NO.mjs +16 -2
  256. package/i18n/languages/nl-NL.js +13 -8
  257. package/i18n/languages/nl-NL.mjs +19 -5
  258. package/i18n/languages/pl-PL.js +13 -8
  259. package/i18n/languages/pl-PL.mjs +18 -4
  260. package/i18n/languages/pt-BR.js +12 -7
  261. package/i18n/languages/pt-BR.mjs +16 -2
  262. package/i18n/languages/ru-RU.js +12 -7
  263. package/i18n/languages/ru-RU.mjs +16 -2
  264. package/i18n/languages/sr-SP.js +12 -7
  265. package/i18n/languages/sr-SP.mjs +16 -2
  266. package/i18n/languages/zh-CN.js +12 -7
  267. package/i18n/languages/zh-CN.mjs +16 -2
  268. package/i18n/languages/zh-TW.js +12 -7
  269. package/i18n/languages/zh-TW.mjs +16 -2
  270. package/i18n/phraseFormatters/substituteVariables.mjs +9 -8
  271. package/i18n/utils.mjs +10 -9
  272. package/index.d.ts +9 -0
  273. package/index.js +4 -2
  274. package/index.mjs +2 -1
  275. package/languages/all.js +111 -65
  276. package/languages/ar-AR.js +50 -4
  277. package/languages/ar-AR.mjs +16 -2
  278. package/languages/cs-CZ.js +52 -6
  279. package/languages/cs-CZ.mjs +16 -2
  280. package/languages/de-CH.js +52 -6
  281. package/languages/de-CH.mjs +16 -2
  282. package/languages/de-DE.js +53 -7
  283. package/languages/de-DE.mjs +16 -2
  284. package/languages/en-US.js +56 -10
  285. package/languages/en-US.mjs +17 -3
  286. package/languages/es-MX.js +56 -10
  287. package/languages/es-MX.mjs +19 -4
  288. package/languages/fr-FR.js +55 -9
  289. package/languages/fr-FR.mjs +16 -2
  290. package/languages/index.js +111 -65
  291. package/languages/it-IT.js +55 -9
  292. package/languages/it-IT.mjs +16 -2
  293. package/languages/ja-JP.js +83 -33
  294. package/languages/ja-JP.mjs +16 -2
  295. package/languages/ko-KR.js +84 -33
  296. package/languages/ko-KR.mjs +16 -2
  297. package/languages/lv-LV.js +85 -33
  298. package/languages/lv-LV.mjs +19 -5
  299. package/languages/nb-NO.js +86 -33
  300. package/languages/nb-NO.mjs +16 -2
  301. package/languages/nl-NL.js +87 -33
  302. package/languages/nl-NL.mjs +19 -5
  303. package/languages/pl-PL.js +88 -33
  304. package/languages/pl-PL.mjs +18 -4
  305. package/languages/pt-BR.js +68 -19
  306. package/languages/pt-BR.mjs +16 -2
  307. package/languages/ru-RU.js +68 -19
  308. package/languages/ru-RU.mjs +16 -2
  309. package/languages/sr-SP.js +55 -6
  310. package/languages/sr-SP.mjs +16 -2
  311. package/languages/zh-CN.js +55 -6
  312. package/languages/zh-CN.mjs +16 -2
  313. package/languages/zh-TW.js +55 -6
  314. package/languages/zh-TW.mjs +16 -2
  315. package/mixins/hooksRefRegisterer.js +6 -3
  316. package/mixins/hooksRefRegisterer.mjs +6 -3
  317. package/mixins/localHooks.js +6 -3
  318. package/mixins/localHooks.mjs +6 -3
  319. package/package.json +2 -2
  320. package/pluginHooks.d.ts +7 -2
  321. package/pluginHooks.js +109 -24
  322. package/pluginHooks.mjs +109 -24
  323. package/plugins/autoColumnSize/autoColumnSize.js +7 -2
  324. package/plugins/autoColumnSize/autoColumnSize.mjs +7 -2
  325. package/plugins/autoRowSize/autoRowSize.js +16 -7
  326. package/plugins/autoRowSize/autoRowSize.mjs +16 -7
  327. package/plugins/autofill/autofill.js +7 -2
  328. package/plugins/autofill/autofill.mjs +7 -2
  329. package/plugins/base/base.js +8 -2
  330. package/plugins/base/base.mjs +8 -2
  331. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +6 -1
  332. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +6 -1
  333. package/plugins/bindRowsWithHeaders/maps/looseBindsMap.js +6 -1
  334. package/plugins/bindRowsWithHeaders/maps/looseBindsMap.mjs +6 -1
  335. package/plugins/bindRowsWithHeaders/maps/strictBindsMap.js +6 -1
  336. package/plugins/bindRowsWithHeaders/maps/strictBindsMap.mjs +6 -1
  337. package/plugins/collapsibleColumns/collapsibleColumns.js +10 -5
  338. package/plugins/collapsibleColumns/collapsibleColumns.mjs +9 -4
  339. package/plugins/columnSorting/columnSorting.js +8 -4
  340. package/plugins/columnSorting/columnSorting.mjs +8 -4
  341. package/plugins/columnSorting/columnStatesManager.js +12 -6
  342. package/plugins/columnSorting/columnStatesManager.mjs +9 -3
  343. package/plugins/columnSorting/rootComparator.mjs +8 -7
  344. package/plugins/columnSorting/sortFunction/checkbox.mjs +9 -8
  345. package/plugins/columnSorting/sortFunction/date.mjs +9 -8
  346. package/plugins/columnSorting/sortFunction/default.mjs +9 -8
  347. package/plugins/columnSorting/sortFunction/numeric.mjs +9 -8
  348. package/plugins/columnSummary/columnSummary.js +13 -8
  349. package/plugins/columnSummary/columnSummary.mjs +13 -8
  350. package/plugins/columnSummary/endpoints.js +17 -16
  351. package/plugins/columnSummary/endpoints.mjs +22 -21
  352. package/plugins/comments/commentEditor.js +16 -2
  353. package/plugins/comments/commentEditor.mjs +21 -7
  354. package/plugins/comments/comments.js +15 -4
  355. package/plugins/comments/comments.mjs +15 -4
  356. package/plugins/comments/displaySwitch.js +14 -1
  357. package/plugins/comments/displaySwitch.mjs +14 -1
  358. package/plugins/contextMenu/commandExecutor.js +22 -7
  359. package/plugins/contextMenu/commandExecutor.mjs +27 -12
  360. package/plugins/contextMenu/contextMenu.d.ts +4 -3
  361. package/plugins/contextMenu/contextMenu.js +7 -17
  362. package/plugins/contextMenu/contextMenu.mjs +7 -17
  363. package/plugins/contextMenu/cursor.js +16 -2
  364. package/plugins/contextMenu/cursor.mjs +21 -7
  365. package/plugins/contextMenu/itemsFactory.js +23 -8
  366. package/plugins/contextMenu/itemsFactory.mjs +28 -13
  367. package/plugins/contextMenu/menu.js +14 -3
  368. package/plugins/contextMenu/menu.mjs +13 -2
  369. package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
  370. package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -1
  371. package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
  372. package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -1
  373. package/plugins/contextMenu/predefinedItems.js +12 -7
  374. package/plugins/contextMenu/predefinedItems.mjs +14 -1
  375. package/plugins/contextMenu/utils.mjs +5 -4
  376. package/plugins/copyPaste/clipboardData.js +16 -2
  377. package/plugins/copyPaste/clipboardData.mjs +16 -2
  378. package/plugins/copyPaste/contextMenuItem/copy.js +4 -16
  379. package/plugins/copyPaste/contextMenuItem/copy.mjs +8 -7
  380. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +35 -0
  381. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +31 -0
  382. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +35 -0
  383. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +31 -0
  384. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +35 -0
  385. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +31 -0
  386. package/plugins/copyPaste/contextMenuItem/cut.mjs +5 -4
  387. package/plugins/copyPaste/copyPaste.d.ts +10 -2
  388. package/plugins/copyPaste/copyPaste.js +303 -202
  389. package/plugins/copyPaste/copyPaste.mjs +303 -202
  390. package/plugins/copyPaste/copyableRanges.js +269 -0
  391. package/plugins/copyPaste/copyableRanges.mjs +264 -0
  392. package/plugins/copyPaste/focusableElement.js +12 -2
  393. package/plugins/copyPaste/focusableElement.mjs +15 -5
  394. package/plugins/copyPaste/pasteEvent.js +16 -2
  395. package/plugins/copyPaste/pasteEvent.mjs +18 -4
  396. package/plugins/customBorders/contextMenuItem/bottom.mjs +5 -4
  397. package/plugins/customBorders/contextMenuItem/left.mjs +5 -4
  398. package/plugins/customBorders/contextMenuItem/noBorders.mjs +5 -4
  399. package/plugins/customBorders/contextMenuItem/right.mjs +5 -4
  400. package/plugins/customBorders/contextMenuItem/top.mjs +5 -4
  401. package/plugins/customBorders/customBorders.js +12 -7
  402. package/plugins/customBorders/customBorders.mjs +11 -6
  403. package/plugins/customBorders/utils.mjs +8 -7
  404. package/plugins/dragToScroll/dragToScroll.js +6 -1
  405. package/plugins/dragToScroll/dragToScroll.mjs +6 -1
  406. package/plugins/dropdownMenu/dropdownMenu.js +6 -1
  407. package/plugins/dropdownMenu/dropdownMenu.mjs +6 -1
  408. package/plugins/exportFile/dataProvider.js +13 -6
  409. package/plugins/exportFile/dataProvider.mjs +12 -5
  410. package/plugins/exportFile/exportFile.js +8 -3
  411. package/plugins/exportFile/exportFile.mjs +6 -1
  412. package/plugins/exportFile/typeFactory.js +14 -1
  413. package/plugins/exportFile/typeFactory.mjs +14 -1
  414. package/plugins/exportFile/types/_base.js +16 -2
  415. package/plugins/exportFile/types/_base.mjs +18 -4
  416. package/plugins/exportFile/types/csv.js +6 -1
  417. package/plugins/exportFile/types/csv.mjs +6 -1
  418. package/plugins/filters/component/_base.js +16 -2
  419. package/plugins/filters/component/_base.mjs +19 -5
  420. package/plugins/filters/component/actionBar.js +10 -4
  421. package/plugins/filters/component/actionBar.mjs +11 -5
  422. package/plugins/filters/component/condition.js +10 -4
  423. package/plugins/filters/component/condition.mjs +11 -5
  424. package/plugins/filters/component/operators.js +8 -3
  425. package/plugins/filters/component/operators.mjs +8 -3
  426. package/plugins/filters/component/value.js +9 -3
  427. package/plugins/filters/component/value.mjs +12 -6
  428. package/plugins/filters/condition/beginsWith.js +1 -1
  429. package/plugins/filters/condition/beginsWith.mjs +1 -1
  430. package/plugins/filters/condition/between.js +1 -1
  431. package/plugins/filters/condition/between.mjs +1 -1
  432. package/plugins/filters/condition/byValue.js +1 -1
  433. package/plugins/filters/condition/byValue.mjs +1 -1
  434. package/plugins/filters/condition/contains.js +1 -1
  435. package/plugins/filters/condition/contains.mjs +1 -1
  436. package/plugins/filters/condition/date/after.js +1 -1
  437. package/plugins/filters/condition/date/after.mjs +1 -1
  438. package/plugins/filters/condition/date/before.js +1 -1
  439. package/plugins/filters/condition/date/before.mjs +1 -1
  440. package/plugins/filters/condition/endsWith.js +1 -1
  441. package/plugins/filters/condition/endsWith.mjs +1 -1
  442. package/plugins/filters/condition/equal.js +1 -1
  443. package/plugins/filters/condition/equal.mjs +1 -1
  444. package/plugins/filters/condition/greaterThan.js +1 -1
  445. package/plugins/filters/condition/greaterThan.mjs +1 -1
  446. package/plugins/filters/condition/greaterThanOrEqual.js +1 -1
  447. package/plugins/filters/condition/greaterThanOrEqual.mjs +1 -1
  448. package/plugins/filters/condition/lessThan.js +1 -1
  449. package/plugins/filters/condition/lessThan.mjs +1 -1
  450. package/plugins/filters/condition/lessThanOrEqual.js +1 -1
  451. package/plugins/filters/condition/lessThanOrEqual.mjs +1 -1
  452. package/plugins/filters/conditionCollection.js +10 -4
  453. package/plugins/filters/conditionCollection.mjs +18 -12
  454. package/plugins/filters/conditionUpdateObserver.js +15 -2
  455. package/plugins/filters/conditionUpdateObserver.mjs +23 -10
  456. package/plugins/filters/constants.js +14 -1
  457. package/plugins/filters/constants.mjs +14 -1
  458. package/plugins/filters/dataFilter.js +16 -2
  459. package/plugins/filters/dataFilter.mjs +19 -5
  460. package/plugins/filters/filters.js +7 -2
  461. package/plugins/filters/filters.mjs +7 -2
  462. package/plugins/filters/ui/_base.js +12 -7
  463. package/plugins/filters/ui/_base.mjs +14 -1
  464. package/plugins/filters/ui/input.js +6 -1
  465. package/plugins/filters/ui/input.mjs +6 -1
  466. package/plugins/filters/ui/link.js +6 -1
  467. package/plugins/filters/ui/link.mjs +6 -1
  468. package/plugins/filters/ui/multipleSelect.js +14 -8
  469. package/plugins/filters/ui/multipleSelect.mjs +6 -1
  470. package/plugins/filters/ui/radioInput.js +6 -1
  471. package/plugins/filters/ui/radioInput.mjs +6 -1
  472. package/plugins/filters/ui/select.js +6 -1
  473. package/plugins/filters/ui/select.mjs +6 -1
  474. package/plugins/formulas/engine/register.mjs +6 -5
  475. package/plugins/formulas/engine/settings.js +12 -1
  476. package/plugins/formulas/engine/settings.mjs +12 -1
  477. package/plugins/formulas/formulas.js +24 -11
  478. package/plugins/formulas/formulas.mjs +24 -11
  479. package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +1 -1
  480. package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +6 -5
  481. package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +5 -4
  482. package/plugins/hiddenColumns/hiddenColumns.js +5 -1
  483. package/plugins/hiddenColumns/hiddenColumns.mjs +5 -1
  484. package/plugins/hiddenRows/contextMenuItem/hideRow.js +1 -1
  485. package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +6 -5
  486. package/plugins/hiddenRows/contextMenuItem/showRow.mjs +5 -4
  487. package/plugins/hiddenRows/hiddenRows.js +5 -1
  488. package/plugins/hiddenRows/hiddenRows.mjs +5 -1
  489. package/plugins/index.mjs +4 -3
  490. package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
  491. package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +6 -5
  492. package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
  493. package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +6 -5
  494. package/plugins/manualColumnFreeze/manualColumnFreeze.js +6 -1
  495. package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +6 -1
  496. package/plugins/manualColumnMove/manualColumnMove.js +6 -1
  497. package/plugins/manualColumnMove/manualColumnMove.mjs +6 -1
  498. package/plugins/manualColumnMove/ui/_base.js +14 -1
  499. package/plugins/manualColumnMove/ui/_base.mjs +14 -1
  500. package/plugins/manualColumnMove/ui/backlight.js +6 -1
  501. package/plugins/manualColumnMove/ui/backlight.mjs +6 -1
  502. package/plugins/manualColumnMove/ui/guideline.js +6 -1
  503. package/plugins/manualColumnMove/ui/guideline.mjs +6 -1
  504. package/plugins/manualColumnResize/manualColumnResize.js +6 -1
  505. package/plugins/manualColumnResize/manualColumnResize.mjs +6 -1
  506. package/plugins/manualRowMove/manualRowMove.js +6 -1
  507. package/plugins/manualRowMove/manualRowMove.mjs +6 -1
  508. package/plugins/manualRowMove/ui/_base.js +14 -1
  509. package/plugins/manualRowMove/ui/_base.mjs +14 -1
  510. package/plugins/manualRowMove/ui/backlight.js +6 -1
  511. package/plugins/manualRowMove/ui/backlight.mjs +6 -1
  512. package/plugins/manualRowMove/ui/guideline.js +6 -1
  513. package/plugins/manualRowMove/ui/guideline.mjs +6 -1
  514. package/plugins/manualRowResize/manualRowResize.js +6 -1
  515. package/plugins/manualRowResize/manualRowResize.mjs +6 -1
  516. package/plugins/mergeCells/calculations/autofill.js +13 -6
  517. package/plugins/mergeCells/calculations/autofill.mjs +15 -8
  518. package/plugins/mergeCells/calculations/selection.js +16 -2
  519. package/plugins/mergeCells/calculations/selection.mjs +16 -2
  520. package/plugins/mergeCells/cellCoords.js +16 -2
  521. package/plugins/mergeCells/cellCoords.mjs +21 -7
  522. package/plugins/mergeCells/cellsCollection.js +12 -5
  523. package/plugins/mergeCells/cellsCollection.mjs +14 -7
  524. package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +5 -4
  525. package/plugins/mergeCells/mergeCells.js +7 -2
  526. package/plugins/mergeCells/mergeCells.mjs +7 -2
  527. package/plugins/multiColumnSorting/multiColumnSorting.js +6 -1
  528. package/plugins/multiColumnSorting/multiColumnSorting.mjs +6 -1
  529. package/plugins/multiColumnSorting/rootComparator.mjs +8 -7
  530. package/plugins/multiColumnSorting/utils.mjs +4 -3
  531. package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +6 -1
  532. package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +6 -1
  533. package/plugins/nestedHeaders/nestedHeaders.js +124 -16
  534. package/plugins/nestedHeaders/nestedHeaders.mjs +131 -23
  535. package/plugins/nestedHeaders/stateManager/headersTree.js +10 -3
  536. package/plugins/nestedHeaders/stateManager/headersTree.mjs +10 -3
  537. package/plugins/nestedHeaders/stateManager/index.js +34 -14
  538. package/plugins/nestedHeaders/stateManager/index.mjs +67 -47
  539. package/plugins/nestedHeaders/stateManager/matrixGenerator.mjs +33 -31
  540. package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs +18 -17
  541. package/plugins/nestedHeaders/stateManager/nodeModifiers/expand.mjs +17 -16
  542. package/plugins/nestedHeaders/stateManager/nodeModifiers/hideColumn.mjs +7 -6
  543. package/plugins/nestedHeaders/stateManager/nodeModifiers/index.mjs +2 -1
  544. package/plugins/nestedHeaders/stateManager/nodeModifiers/showColumn.mjs +7 -6
  545. package/plugins/nestedHeaders/stateManager/settingsNormalizer.mjs +41 -39
  546. package/plugins/nestedHeaders/stateManager/sourceSettings.js +11 -3
  547. package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +23 -14
  548. package/plugins/nestedHeaders/utils/ghostTable.js +17 -3
  549. package/plugins/nestedHeaders/utils/ghostTable.mjs +24 -10
  550. package/plugins/nestedRows/data/dataManager.js +10 -4
  551. package/plugins/nestedRows/data/dataManager.mjs +12 -6
  552. package/plugins/nestedRows/nestedRows.js +6 -1
  553. package/plugins/nestedRows/nestedRows.mjs +6 -1
  554. package/plugins/nestedRows/ui/_base.js +16 -2
  555. package/plugins/nestedRows/ui/_base.mjs +16 -2
  556. package/plugins/nestedRows/ui/collapsing.js +8 -2
  557. package/plugins/nestedRows/ui/collapsing.mjs +14 -8
  558. package/plugins/nestedRows/ui/contextMenu.js +7 -2
  559. package/plugins/nestedRows/ui/contextMenu.mjs +6 -1
  560. package/plugins/nestedRows/ui/headers.js +8 -2
  561. package/plugins/nestedRows/ui/headers.mjs +14 -8
  562. package/plugins/nestedRows/utils/rowMoveController.js +11 -4
  563. package/plugins/nestedRows/utils/rowMoveController.mjs +25 -18
  564. package/plugins/persistentState/persistentState.js +6 -1
  565. package/plugins/persistentState/persistentState.mjs +6 -1
  566. package/plugins/persistentState/storage.js +16 -2
  567. package/plugins/persistentState/storage.mjs +19 -5
  568. package/plugins/registry.js +1 -1
  569. package/plugins/registry.mjs +3 -2
  570. package/plugins/search/search.js +6 -1
  571. package/plugins/search/search.mjs +6 -1
  572. package/plugins/touchScroll/touchScroll.js +6 -1
  573. package/plugins/touchScroll/touchScroll.mjs +6 -1
  574. package/plugins/trimRows/trimRows.js +5 -1
  575. package/plugins/trimRows/trimRows.mjs +5 -1
  576. package/plugins/undoRedo/undoRedo.js +50 -32
  577. package/plugins/undoRedo/undoRedo.mjs +50 -32
  578. package/registry.mjs +2 -1
  579. package/renderers/baseRenderer/baseRenderer.mjs +2 -1
  580. package/renderers/index.mjs +4 -3
  581. package/selection/highlight/highlight.js +10 -3
  582. package/selection/highlight/highlight.mjs +24 -17
  583. package/selection/highlight/types/activeHeader.js +13 -2
  584. package/selection/highlight/types/activeHeader.mjs +19 -7
  585. package/selection/highlight/types/area.js +13 -2
  586. package/selection/highlight/types/area.mjs +22 -10
  587. package/selection/highlight/types/cell.js +13 -2
  588. package/selection/highlight/types/cell.mjs +22 -10
  589. package/selection/highlight/types/customSelection.js +13 -2
  590. package/selection/highlight/types/customSelection.mjs +23 -11
  591. package/selection/highlight/types/fill.js +14 -3
  592. package/selection/highlight/types/fill.mjs +22 -10
  593. package/selection/highlight/types/header.js +13 -2
  594. package/selection/highlight/types/header.mjs +24 -12
  595. package/selection/highlight/types/index.js +14 -3
  596. package/selection/highlight/types/index.mjs +14 -3
  597. package/selection/highlight/visualSelection.js +11 -6
  598. package/selection/highlight/visualSelection.mjs +11 -6
  599. package/selection/mouseEventHandler.mjs +14 -13
  600. package/selection/range.js +9 -2
  601. package/selection/range.mjs +9 -2
  602. package/selection/selection.js +13 -6
  603. package/selection/selection.mjs +21 -14
  604. package/selection/transformation.js +16 -2
  605. package/selection/transformation.mjs +24 -10
  606. package/selection/utils.js +1 -1
  607. package/selection/utils.mjs +1 -1
  608. package/shortcuts/context.js +1 -1
  609. package/shortcuts/context.mjs +1 -1
  610. package/shortcuts/keyObserver.js +8 -4
  611. package/shortcuts/keyObserver.mjs +8 -4
  612. package/shortcuts/manager.js +1 -1
  613. package/shortcuts/manager.mjs +1 -1
  614. package/tableView.js +147 -68
  615. package/tableView.mjs +147 -68
  616. package/translations/changesObservable/observable.js +12 -2
  617. package/translations/changesObservable/observable.mjs +19 -9
  618. package/translations/changesObservable/observer.js +12 -2
  619. package/translations/changesObservable/observer.mjs +17 -7
  620. package/translations/indexMapper.js +12 -6
  621. package/translations/indexMapper.mjs +17 -11
  622. package/translations/mapCollections/aggregatedCollection.js +8 -2
  623. package/translations/mapCollections/aggregatedCollection.mjs +11 -5
  624. package/translations/mapCollections/mapCollection.js +10 -1
  625. package/translations/mapCollections/mapCollection.mjs +10 -1
  626. package/translations/maps/hidingMap.js +8 -2
  627. package/translations/maps/hidingMap.mjs +13 -7
  628. package/translations/maps/indexMap.js +16 -2
  629. package/translations/maps/indexMap.mjs +20 -6
  630. package/translations/maps/indexesSequence.js +8 -2
  631. package/translations/maps/indexesSequence.mjs +14 -8
  632. package/translations/maps/linkedPhysicalIndexToValueMap.js +12 -6
  633. package/translations/maps/linkedPhysicalIndexToValueMap.mjs +18 -12
  634. package/translations/maps/physicalIndexToValueMap.js +8 -2
  635. package/translations/maps/physicalIndexToValueMap.mjs +14 -8
  636. package/translations/maps/trimmingMap.js +8 -2
  637. package/translations/maps/trimmingMap.mjs +13 -7
  638. package/translations/maps/utils/actionsOnIndexes.mjs +9 -8
  639. package/translations/maps/utils/indexesSequence.mjs +10 -9
  640. package/translations/maps/utils/physicallyIndexed.mjs +11 -10
  641. package/utils/dataStructures/linkedList.js +21 -7
  642. package/utils/dataStructures/linkedList.mjs +21 -7
  643. package/utils/dataStructures/priorityMap.js +1 -1
  644. package/utils/dataStructures/priorityMap.mjs +1 -1
  645. package/utils/dataStructures/queue.js +16 -2
  646. package/utils/dataStructures/queue.mjs +16 -2
  647. package/utils/dataStructures/stack.js +16 -2
  648. package/utils/dataStructures/stack.mjs +16 -2
  649. package/utils/dataStructures/tree.js +8 -2
  650. package/utils/dataStructures/tree.mjs +8 -2
  651. package/utils/dataStructures/uniqueMap.js +1 -1
  652. package/utils/dataStructures/uniqueMap.mjs +1 -1
  653. package/utils/ghostTable.js +12 -5
  654. package/utils/ghostTable.mjs +12 -5
  655. package/utils/interval.js +23 -8
  656. package/utils/interval.mjs +18 -4
  657. package/utils/samplesGenerator.js +13 -3
  658. package/utils/samplesGenerator.mjs +15 -5
  659. package/validators/index.mjs +4 -3
@@ -2,11 +2,11 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
2
2
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
5
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8
8
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
9
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
10
10
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
11
  function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
12
12
  function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
@@ -17,37 +17,58 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
17
17
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
18
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
19
19
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
20
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
21
+ function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
22
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
23
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
25
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
26
+ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
27
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
28
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
29
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
30
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
31
+ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
32
+ import "core-js/modules/es.array.join.js";
33
+ import "core-js/modules/es.array.concat.js";
20
34
  import "core-js/modules/es.array.iterator.js";
35
+ import "core-js/modules/es.map.js";
21
36
  import "core-js/modules/es.object.to-string.js";
22
37
  import "core-js/modules/es.string.iterator.js";
23
- import "core-js/modules/es.weak-map.js";
24
38
  import "core-js/modules/web.dom-collections.iterator.js";
25
- import "core-js/modules/es.array.join.js";
26
- import "core-js/modules/es.array.index-of.js";
39
+ import "core-js/modules/es.array.map.js";
40
+ import "core-js/modules/es.array.filter.js";
41
+ import "core-js/modules/es.array.from.js";
27
42
  import "core-js/modules/es.regexp.exec.js";
28
- import "core-js/modules/es.array.concat.js";
43
+ import "core-js/modules/es.weak-map.js";
44
+ import "core-js/modules/es.weak-set.js";
45
+ import "core-js/modules/es.symbol.to-primitive.js";
46
+ import "core-js/modules/es.date.to-primitive.js";
47
+ import "core-js/modules/es.symbol.js";
48
+ import "core-js/modules/es.symbol.description.js";
49
+ import "core-js/modules/es.number.constructor.js";
29
50
  import "core-js/modules/es.object.set-prototype-of.js";
30
51
  import "core-js/modules/es.object.get-prototype-of.js";
31
52
  import "core-js/modules/es.reflect.construct.js";
32
53
  import "core-js/modules/es.reflect.get.js";
33
54
  import "core-js/modules/es.object.get-own-property-descriptor.js";
34
- import "core-js/modules/es.symbol.js";
35
- import "core-js/modules/es.symbol.description.js";
36
55
  import "core-js/modules/es.symbol.iterator.js";
37
56
  import "core-js/modules/es.array.slice.js";
38
57
  import "core-js/modules/es.function.name.js";
39
- import "core-js/modules/es.array.from.js";
40
58
  import { BasePlugin } from "../base/index.mjs";
41
59
  import Hooks from "../../pluginHooks.mjs";
42
60
  import { stringify, parse } from "../../3rdparty/SheetClip/index.mjs";
43
61
  import { arrayEach } from "../../helpers/array.mjs";
44
- import { rangeEach } from "../../helpers/number.mjs";
45
62
  import { sanitize } from "../../helpers/string.mjs";
46
63
  import { getSelectionText } from "../../helpers/dom/element.mjs";
47
64
  import copyItem from "./contextMenuItem/copy.mjs";
65
+ import copyColumnHeadersOnlyItem from "./contextMenuItem/copyColumnHeadersOnly.mjs";
66
+ import copyWithColumnGroupHeadersItem from "./contextMenuItem/copyWithColumnGroupHeaders.mjs";
67
+ import copyWithColumnHeadersItem from "./contextMenuItem/copyWithColumnHeaders.mjs";
48
68
  import cutItem from "./contextMenuItem/cut.mjs";
49
69
  import PasteEvent from "./pasteEvent.mjs";
50
70
  import { createElement, destroyElement } from "./focusableElement.mjs";
71
+ import { CopyableRangesFactory, normalizeRanges } from "./copyableRanges.mjs";
51
72
  import { _dataToHTML, htmlToGridSettings } from "../../utils/parseTable.mjs";
52
73
  Hooks.getSingleton().register('afterCopyLimit');
53
74
  Hooks.getSingleton().register('modifyCopyableRange');
@@ -60,118 +81,131 @@ Hooks.getSingleton().register('afterCopy');
60
81
  export var PLUGIN_KEY = 'copyPaste';
61
82
  export var PLUGIN_PRIORITY = 80;
62
83
  var SETTING_KEYS = ['fragmentSelection'];
63
- var ROWS_LIMIT = Infinity;
64
- var COLUMNS_LIMIT = Infinity;
65
- var privatePool = new WeakMap();
66
84
  var META_HEAD = ['<meta name="generator" content="Handsontable"/>', '<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join('');
67
85
 
68
86
  /* eslint-disable jsdoc/require-description-complete-sentence */
69
87
  /**
70
88
  * @description
71
- * This plugin enables the copy/paste functionality in the Handsontable. The functionality works for API, Context Menu,
72
- * using keyboard shortcuts and menu bar from the browser.
73
- * Possible values:
74
- * * `true` (to enable default options),
75
- * * `false` (to disable completely).
89
+ * Copy, cut, and paste data by using the `CopyPaste` plugin.
76
90
  *
77
- * or an object with values:
78
- * * `'columnsLimit'` (see {@link CopyPaste#columnsLimit})
79
- * * `'rowsLimit'` (see {@link CopyPaste#rowsLimit})
80
- * * `'pasteMode'` (see {@link CopyPaste#pasteMode})
81
- * * `'uiContainer'` (see {@link CopyPaste#uiContainer}).
91
+ * Control the `CopyPaste` plugin programmatically through its [API methods](#methods).
82
92
  *
83
- * See [the copy/paste demo](@/guides/cell-features/clipboard.md) for examples.
93
+ * The user can access the copy-paste features through:
94
+ * - The [context menu](@/guides/cell-features/clipboard.md#context-menu).
95
+ * - The [keyboard shortcuts](@/guides/cell-features/clipboard.md#related-keyboard-shortcuts).
96
+ * - The browser's menu bar.
97
+ *
98
+ * Read more:
99
+ * - [Guides: Clipboard](@/guides/cell-features/clipboard.md)
100
+ * - [Configuration options: `copyPaste`](@/api/options.md#copypaste)
84
101
  *
85
102
  * @example
86
103
  * ```js
87
- * // Enables the plugin with default values
104
+ * // enable the plugin with the default configuration
88
105
  * copyPaste: true,
89
- * // Enables the plugin with custom values
106
+ *
107
+ * // or, enable the plugin with a custom configuration
90
108
  * copyPaste: {
91
109
  * columnsLimit: 25,
92
110
  * rowsLimit: 50,
93
111
  * pasteMode: 'shift_down',
112
+ * copyColumnHeaders: true,
113
+ * copyColumnGroupHeaders: true,
114
+ * copyColumnHeadersOnly: true,
94
115
  * uiContainer: document.body,
95
116
  * },
96
117
  * ```
97
118
  * @class CopyPaste
98
119
  * @plugin CopyPaste
99
120
  */
121
+ var _enableCopyColumnHeaders = /*#__PURE__*/new WeakMap();
122
+ var _enableCopyColumnGroupHeaders = /*#__PURE__*/new WeakMap();
123
+ var _enableCopyColumnHeadersOnly = /*#__PURE__*/new WeakMap();
124
+ var _copyMode = /*#__PURE__*/new WeakMap();
125
+ var _isTriggeredByCopy = /*#__PURE__*/new WeakMap();
126
+ var _isTriggeredByCut = /*#__PURE__*/new WeakMap();
127
+ var _copyableRangesFactory = /*#__PURE__*/new WeakMap();
128
+ var _countCopiedHeaders = /*#__PURE__*/new WeakSet();
100
129
  export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
101
130
  _inherits(CopyPaste, _BasePlugin);
102
131
  var _super = _createSuper(CopyPaste);
103
- function CopyPaste(hotInstance) {
132
+ function CopyPaste() {
104
133
  var _this;
105
134
  _classCallCheck(this, CopyPaste);
106
- _this = _super.call(this, hotInstance);
107
- /**
108
- * Maximum number of columns than can be copied to clipboard using <kbd>**Ctrl**</kbd>/<kbd>**Cmd**</kbd> + <kbd>**C**</kbd>.
109
- *
110
- * @type {number}
111
- * @default Infinity
112
- */
113
- _this.columnsLimit = COLUMNS_LIMIT;
114
- /**
115
- * Ranges of the cells coordinates, which should be used to copy/cut/paste actions.
116
- *
117
- * @private
118
- * @type {Array}
119
- */
120
- _this.copyableRanges = [];
121
- /**
122
- * Provides focusable element to support IME and copy/paste/cut actions.
123
- *
124
- * @private
125
- * @type {FocusableWrapper}
126
- */
127
- _this.focusableElement = void 0;
128
- /**
129
- * Defines paste (<kbd>**Ctrl**</kbd>/<kbd>**Cmd**</kbd> + <kbd>**V**</kbd>) behavior.
130
- * * Default value `"overwrite"` will paste clipboard value over current selection.
131
- * * When set to `"shift_down"`, clipboard data will be pasted in place of current selection, while all selected cells are moved down.
132
- * * When set to `"shift_right"`, clipboard data will be pasted in place of current selection, while all selected cells are moved right.
133
- *
134
- * @type {string}
135
- * @default 'overwrite'
136
- */
137
- _this.pasteMode = 'overwrite';
138
- /**
139
- * Maximum number of rows than can be copied to clipboard using <kbd>**Ctrl**</kbd>/<kbd>**Cmd**</kbd> + <kbd>**C**</kbd>.
140
- *
141
- * @type {number}
142
- * @default Infinity
143
- */
144
- _this.rowsLimit = ROWS_LIMIT;
145
-
146
- /**
147
- * UI container for the secondary focusable element.
148
- *
149
- * @type {HTMLElement}
150
- */
151
- _this.uiContainer = _this.hot.rootDocument.body;
152
- privatePool.set(_assertThisInitialized(_this), {
153
- isTriggeredByCopy: false,
154
- isTriggeredByCut: false,
155
- isBeginEditing: false,
156
- isFragmentSelectionEnabled: false
135
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
136
+ args[_key] = arguments[_key];
137
+ }
138
+ _this = _super.call.apply(_super, [this].concat(args));
139
+ _classPrivateMethodInitSpec(_assertThisInitialized(_this), _countCopiedHeaders);
140
+ _defineProperty(_assertThisInitialized(_this), "columnsLimit", Infinity);
141
+ _defineProperty(_assertThisInitialized(_this), "rowsLimit", Infinity);
142
+ _defineProperty(_assertThisInitialized(_this), "pasteMode", 'overwrite');
143
+ _defineProperty(_assertThisInitialized(_this), "uiContainer", _this.hot.rootDocument.body);
144
+ _classPrivateFieldInitSpec(_assertThisInitialized(_this), _enableCopyColumnHeaders, {
145
+ writable: true,
146
+ value: false
147
+ });
148
+ _classPrivateFieldInitSpec(_assertThisInitialized(_this), _enableCopyColumnGroupHeaders, {
149
+ writable: true,
150
+ value: false
151
+ });
152
+ _classPrivateFieldInitSpec(_assertThisInitialized(_this), _enableCopyColumnHeadersOnly, {
153
+ writable: true,
154
+ value: false
155
+ });
156
+ _classPrivateFieldInitSpec(_assertThisInitialized(_this), _copyMode, {
157
+ writable: true,
158
+ value: 'cells-only'
159
+ });
160
+ _classPrivateFieldInitSpec(_assertThisInitialized(_this), _isTriggeredByCopy, {
161
+ writable: true,
162
+ value: false
157
163
  });
164
+ _classPrivateFieldInitSpec(_assertThisInitialized(_this), _isTriggeredByCut, {
165
+ writable: true,
166
+ value: false
167
+ });
168
+ _classPrivateFieldInitSpec(_assertThisInitialized(_this), _copyableRangesFactory, {
169
+ writable: true,
170
+ value: new CopyableRangesFactory({
171
+ countRows: function countRows() {
172
+ return _this.hot.countRows();
173
+ },
174
+ countColumns: function countColumns() {
175
+ return _this.hot.countCols();
176
+ },
177
+ rowsLimit: function rowsLimit() {
178
+ return _this.rowsLimit;
179
+ },
180
+ columnsLimit: function columnsLimit() {
181
+ return _this.columnsLimit;
182
+ },
183
+ countColumnHeaders: function countColumnHeaders() {
184
+ return _this.hot.view.getColumnHeadersCount();
185
+ }
186
+ })
187
+ });
188
+ _defineProperty(_assertThisInitialized(_this), "copyableRanges", []);
189
+ _defineProperty(_assertThisInitialized(_this), "focusableElement", void 0);
158
190
  return _this;
159
191
  }
160
-
161
- /**
162
- * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}
163
- * hook and if it returns `true` then the {@link CopyPaste#enablePlugin} method is called.
164
- *
165
- * @returns {boolean}
166
- */
167
192
  _createClass(CopyPaste, [{
168
193
  key: "isEnabled",
169
- value: function isEnabled() {
194
+ value:
195
+ /**
196
+ * Checks if the [`CopyPaste`](#copypaste) plugin is enabled.
197
+ *
198
+ * This method gets called by Handsontable's [`beforeInit`](@/api/hooks.md#beforeinit) hook.
199
+ * If it returns `true`, the [`enablePlugin()`](#enableplugin) method gets called.
200
+ *
201
+ * @returns {boolean}
202
+ */
203
+ function isEnabled() {
170
204
  return !!this.hot.getSettings()[PLUGIN_KEY];
171
205
  }
172
206
 
173
207
  /**
174
- * Enables the plugin functionality for this Handsontable instance.
208
+ * Enables the [`CopyPaste`](#copypaste) plugin for your Handsontable instance.
175
209
  */
176
210
  }, {
177
211
  key: "enablePlugin",
@@ -181,15 +215,16 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
181
215
  return;
182
216
  }
183
217
  var _this$hot$getSettings = this.hot.getSettings(),
184
- settings = _this$hot$getSettings[PLUGIN_KEY],
185
- fragmentSelection = _this$hot$getSettings.fragmentSelection;
186
- var priv = privatePool.get(this);
187
- priv.isFragmentSelectionEnabled = !!fragmentSelection;
218
+ settings = _this$hot$getSettings[PLUGIN_KEY];
188
219
  if (_typeof(settings) === 'object') {
189
- this.pasteMode = settings.pasteMode || this.pasteMode;
220
+ var _settings$pasteMode, _settings$uiContainer;
221
+ this.pasteMode = (_settings$pasteMode = settings.pasteMode) !== null && _settings$pasteMode !== void 0 ? _settings$pasteMode : this.pasteMode;
190
222
  this.rowsLimit = isNaN(settings.rowsLimit) ? this.rowsLimit : settings.rowsLimit;
191
223
  this.columnsLimit = isNaN(settings.columnsLimit) ? this.columnsLimit : settings.columnsLimit;
192
- this.uiContainer = settings.uiContainer || this.uiContainer;
224
+ _classPrivateFieldSet(this, _enableCopyColumnHeaders, !!settings.copyColumnHeaders);
225
+ _classPrivateFieldSet(this, _enableCopyColumnGroupHeaders, !!settings.copyColumnGroupHeaders);
226
+ _classPrivateFieldSet(this, _enableCopyColumnHeadersOnly, !!settings.copyColumnHeadersOnly);
227
+ this.uiContainer = (_settings$uiContainer = settings.uiContainer) !== null && _settings$uiContainer !== void 0 ? _settings$uiContainer : this.uiContainer;
193
228
  }
194
229
  this.addHook('afterContextMenuDefaultOptions', function (options) {
195
230
  return _this2.onAfterContextMenuDefaultOptions(options);
@@ -215,9 +250,10 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
215
250
  }
216
251
 
217
252
  /**
218
- * Updates the plugin's state.
253
+ * Updates the state of the [`CopyPaste`](#copypaste) plugin.
219
254
  *
220
- * This method is executed when [`updateSettings()`](@/api/core.md#updatesettings) is invoked with any of the following configuration options:
255
+ * Gets called when [`updateSettings()`](@/api/core.md#updatesettings)
256
+ * is invoked with any of the following configuration options:
221
257
  * - [`copyPaste`](@/api/options.md#copypaste)
222
258
  * - [`fragmentSelection`](@/api/options.md#fragmentselection)
223
259
  */
@@ -231,7 +267,7 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
231
267
  }
232
268
 
233
269
  /**
234
- * Disables the plugin functionality for this Handsontable instance.
270
+ * Disables the [`CopyPaste`](#copypaste) plugin for your Handsontable instance.
235
271
  */
236
272
  }, {
237
273
  key: "disablePlugin",
@@ -243,114 +279,125 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
243
279
  }
244
280
 
245
281
  /**
246
- * Copies the selected cell into the clipboard.
282
+ * Copies the contents of the selected cells (and/or their related column headers) to the system clipboard.
283
+ *
284
+ * Takes an optional parameter (`copyMode`) that defines the scope of copying:
285
+ *
286
+ * | `copyMode` value | Description |
287
+ * | --------------------------- | --------------------------------------------------------------- |
288
+ * | `'cells-only'` (default) | Copy the selected cells |
289
+ * | `'with-column-headers'` | - Copy the selected cells<br>- Copy the nearest column headers |
290
+ * | `'with-all-column-headers'` | - Copy the selected cells<br>- Copy all related columns headers |
291
+ * | `'column-headers-only'` | Copy the nearest column headers (without copying cells) |
292
+ *
293
+ * @param {string} [copyMode='cells-only'] Copy mode.
247
294
  */
248
295
  }, {
249
296
  key: "copy",
250
297
  value: function copy() {
251
- var priv = privatePool.get(this);
252
- priv.isTriggeredByCopy = true;
298
+ var copyMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'cells-only';
299
+ _classPrivateFieldSet(this, _copyMode, copyMode);
300
+ _classPrivateFieldSet(this, _isTriggeredByCopy, true);
253
301
  this.getOrCreateFocusableElement();
254
302
  this.focusableElement.focus();
255
303
  this.hot.rootDocument.execCommand('copy');
256
304
  }
257
305
 
258
306
  /**
259
- * Cuts the selected cell into the clipboard.
307
+ * Copies the contents of the selected cells.
308
+ */
309
+ }, {
310
+ key: "copyCellsOnly",
311
+ value: function copyCellsOnly() {
312
+ this.copy('cells-only');
313
+ }
314
+ /**
315
+ * Copies the contents of column headers that are nearest to the selected cells.
316
+ */
317
+ }, {
318
+ key: "copyColumnHeadersOnly",
319
+ value: function copyColumnHeadersOnly() {
320
+ this.copy('column-headers-only');
321
+ }
322
+ /**
323
+ * Copies the contents of the selected cells and all their related column headers.
324
+ */
325
+ }, {
326
+ key: "copyWithAllColumnHeaders",
327
+ value: function copyWithAllColumnHeaders() {
328
+ this.copy('with-column-group-headers');
329
+ }
330
+ /**
331
+ * Copies the contents of the selected cells and their nearest column headers.
332
+ */
333
+ }, {
334
+ key: "copyWithColumnHeaders",
335
+ value: function copyWithColumnHeaders() {
336
+ this.copy('with-column-headers');
337
+ }
338
+
339
+ /**
340
+ * Cuts the contents of the selected cells to the system clipboard.
260
341
  */
261
342
  }, {
262
343
  key: "cut",
263
344
  value: function cut() {
264
- var priv = privatePool.get(this);
265
- priv.isTriggeredByCut = true;
345
+ _classPrivateFieldSet(this, _isTriggeredByCut, true);
266
346
  this.getOrCreateFocusableElement();
267
347
  this.focusableElement.focus();
268
348
  this.hot.rootDocument.execCommand('cut');
269
349
  }
270
350
 
271
351
  /**
272
- * Creates copyable text releated to range objects.
352
+ * Converts the contents of multiple ranges (`ranges`) into a single string.
273
353
  *
274
- * @param {object[]} ranges Array of objects with properties `startRow`, `endRow`, `startCol` and `endCol`.
275
- * @returns {string} Returns string which will be copied into clipboard.
354
+ * @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges Array of objects with properties `startRow`, `endRow`, `startCol` and `endCol`.
355
+ * @returns {string} A string that will be copied to the clipboard.
276
356
  */
277
357
  }, {
278
358
  key: "getRangedCopyableData",
279
359
  value: function getRangedCopyableData(ranges) {
280
- var _this3 = this;
281
- var dataSet = [];
282
- var copyableRows = [];
283
- var copyableColumns = [];
284
-
285
- // Count all copyable rows and columns
286
- arrayEach(ranges, function (range) {
287
- rangeEach(range.startRow, range.endRow, function (row) {
288
- if (copyableRows.indexOf(row) === -1) {
289
- copyableRows.push(row);
290
- }
291
- });
292
- rangeEach(range.startCol, range.endCol, function (column) {
293
- if (copyableColumns.indexOf(column) === -1) {
294
- copyableColumns.push(column);
295
- }
296
- });
297
- });
298
- // Concat all rows and columns data defined in ranges into one copyable string
299
- arrayEach(copyableRows, function (row) {
300
- var rowSet = [];
301
- arrayEach(copyableColumns, function (column) {
302
- rowSet.push(_this3.hot.getCopyableData(row, column));
303
- });
304
- dataSet.push(rowSet);
305
- });
306
- return stringify(dataSet);
360
+ return stringify(this.getRangedData(ranges));
307
361
  }
308
362
 
309
363
  /**
310
- * Creates copyable text releated to range objects.
364
+ * Converts the contents of multiple ranges (`ranges`) into an array of arrays.
311
365
  *
312
- * @param {object[]} ranges Array of objects with properties `startRow`, `startCol`, `endRow` and `endCol`.
313
- * @returns {Array[]} Returns array of arrays which will be copied into clipboard.
366
+ * @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges Array of objects with properties `startRow`, `startCol`, `endRow` and `endCol`.
367
+ * @returns {Array[]} An array of arrays that will be copied to the clipboard.
314
368
  */
315
369
  }, {
316
370
  key: "getRangedData",
317
371
  value: function getRangedData(ranges) {
318
- var _this4 = this;
319
- var dataSet = [];
320
- var copyableRows = [];
321
- var copyableColumns = [];
372
+ var _this3 = this;
373
+ var data = [];
374
+ var _normalizeRanges = normalizeRanges(ranges),
375
+ rows = _normalizeRanges.rows,
376
+ columns = _normalizeRanges.columns;
322
377
 
323
- // Count all copyable rows and columns
324
- arrayEach(ranges, function (range) {
325
- rangeEach(range.startRow, range.endRow, function (row) {
326
- if (copyableRows.indexOf(row) === -1) {
327
- copyableRows.push(row);
328
- }
329
- });
330
- rangeEach(range.startCol, range.endCol, function (column) {
331
- if (copyableColumns.indexOf(column) === -1) {
332
- copyableColumns.push(column);
333
- }
334
- });
335
- });
336
- // Concat all rows and columns data defined in ranges into one copyable string
337
- arrayEach(copyableRows, function (row) {
378
+ // concatenate all rows and columns data defined in ranges into one copyable string
379
+ arrayEach(rows, function (row) {
338
380
  var rowSet = [];
339
- arrayEach(copyableColumns, function (column) {
340
- rowSet.push(_this4.hot.getCopyableData(row, column));
381
+ arrayEach(columns, function (column) {
382
+ if (row < 0) {
383
+ // `row` as the second argument acts here as the `headerLevel` argument
384
+ rowSet.push(_this3.hot.getColHeader(column, row));
385
+ } else {
386
+ rowSet.push(_this3.hot.getCopyableData(row, column));
387
+ }
341
388
  });
342
- dataSet.push(rowSet);
389
+ data.push(rowSet);
343
390
  });
344
- return dataSet;
391
+ return data;
345
392
  }
346
393
 
347
394
  /**
348
395
  * Simulates the paste action.
349
396
  *
350
- * Due to security reasons, modern browsers disallow reading from the system clipboard.
397
+ * For security reasons, modern browsers don't allow reading from the system clipboard.
351
398
  *
352
- * @param {string} pastableText Value as raw string to paste.
353
- * @param {string} [pastableHtml=''] Value as HTML to paste.
399
+ * @param {string} pastableText The value to paste, as a raw string.
400
+ * @param {string} [pastableHtml=''] The value to paste, as HTML.
354
401
  */
355
402
  }, {
356
403
  key: "paste",
@@ -377,27 +424,43 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
377
424
  }, {
378
425
  key: "setCopyableText",
379
426
  value: function setCopyableText() {
380
- var selRange = this.hot.getSelectedRangeLast();
381
- if (!selRange) {
427
+ var selectionRange = this.hot.getSelectedRangeLast();
428
+ if (!selectionRange) {
382
429
  return;
383
430
  }
384
- var topStart = selRange.getTopStartCorner();
385
- var bottomEnd = selRange.getBottomEndCorner();
386
- var startRow = topStart.row;
387
- var startCol = topStart.col;
388
- var endRow = bottomEnd.row;
389
- var endCol = bottomEnd.col;
390
- var finalEndRow = Math.min(endRow, startRow + this.rowsLimit - 1);
391
- var finalEndCol = Math.min(endCol, startCol + this.columnsLimit - 1);
392
- this.copyableRanges.length = 0;
393
- this.copyableRanges.push({
394
- startRow: startRow,
395
- startCol: startCol,
396
- endRow: finalEndRow,
397
- endCol: finalEndCol
431
+ _classPrivateFieldGet(this, _copyableRangesFactory).setSelectedRange(selectionRange);
432
+ var groupedRanges = new Map([['headers', null], ['cells', null]]);
433
+ if (_classPrivateFieldGet(this, _copyMode) === 'column-headers-only') {
434
+ groupedRanges.set('headers', _classPrivateFieldGet(this, _copyableRangesFactory).getMostBottomColumnHeadersRange());
435
+ } else {
436
+ if (_classPrivateFieldGet(this, _copyMode) === 'with-column-headers') {
437
+ groupedRanges.set('headers', _classPrivateFieldGet(this, _copyableRangesFactory).getMostBottomColumnHeadersRange());
438
+ } else if (_classPrivateFieldGet(this, _copyMode) === 'with-column-group-headers') {
439
+ groupedRanges.set('headers', _classPrivateFieldGet(this, _copyableRangesFactory).getAllColumnHeadersRange());
440
+ }
441
+ groupedRanges.set('cells', _classPrivateFieldGet(this, _copyableRangesFactory).getCellsRange());
442
+ }
443
+ this.copyableRanges = Array.from(groupedRanges.values()).filter(function (range) {
444
+ return range !== null;
445
+ }).map(function (_ref) {
446
+ var startRow = _ref.startRow,
447
+ startCol = _ref.startCol,
448
+ endRow = _ref.endRow,
449
+ endCol = _ref.endCol;
450
+ return {
451
+ startRow: startRow,
452
+ startCol: startCol,
453
+ endRow: endRow,
454
+ endCol: endCol
455
+ };
398
456
  });
399
457
  this.copyableRanges = this.hot.runHooks('modifyCopyableRange', this.copyableRanges);
400
- if (endRow !== finalEndRow || endCol !== finalEndCol) {
458
+ var cellsRange = groupedRanges.get('cells');
459
+ if (cellsRange !== null && cellsRange.isRangeTrimmed) {
460
+ var startRow = cellsRange.startRow,
461
+ startCol = cellsRange.startCol,
462
+ endRow = cellsRange.endRow,
463
+ endCol = cellsRange.endCol;
401
464
  this.hot.runHooks('afterCopyLimit', endRow - startRow + 1, endCol - startCol + 1, this.rowsLimit, this.columnsLimit);
402
465
  }
403
466
  }
@@ -410,8 +473,8 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
410
473
  }, {
411
474
  key: "getOrCreateFocusableElement",
412
475
  value: function getOrCreateFocusableElement() {
413
- var editor = this.hot.getActiveEditor();
414
- var editableElement = editor ? editor.TEXTAREA : void 0;
476
+ var _this$hot$getActiveEd;
477
+ var editableElement = (_this$hot$getActiveEd = this.hot.getActiveEditor()) === null || _this$hot$getActiveEd === void 0 ? void 0 : _this$hot$getActiveEd.TEXTAREA;
415
478
  if (editableElement) {
416
479
  this.focusableElement.setFocusableElement(editableElement);
417
480
  } else {
@@ -428,10 +491,21 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
428
491
  }, {
429
492
  key: "isEditorOpened",
430
493
  value: function isEditorOpened() {
431
- var editor = this.hot.getActiveEditor();
432
- return editor && editor.isOpened();
494
+ var _this$hot$getActiveEd2;
495
+ return (_this$hot$getActiveEd2 = this.hot.getActiveEditor()) === null || _this$hot$getActiveEd2 === void 0 ? void 0 : _this$hot$getActiveEd2.isOpened();
433
496
  }
434
497
 
498
+ /**
499
+ * Counts how many column headers will be copied based on the passed range.
500
+ *
501
+ * @private
502
+ * @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges Array of objects with properties `startRow`, `startCol`, `endRow` and `endCol`.
503
+ * @returns {{ columnHeadersCount: number }} Returns an object with keys that holds
504
+ * information with the number of copied headers.
505
+ */
506
+ }, {
507
+ key: "populateValues",
508
+ value:
435
509
  /**
436
510
  * Prepares new values to populate them into datasource.
437
511
  *
@@ -440,9 +514,7 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
440
514
  * @param {Array} [selection] The selection which indicates from what position the data will be populated.
441
515
  * @returns {Array} Range coordinates after populate data.
442
516
  */
443
- }, {
444
- key: "populateValues",
445
- value: function populateValues(inputArray) {
517
+ function populateValues(inputArray) {
446
518
  var selection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.hot.getSelectedRangeLast();
447
519
  if (!inputArray.length) {
448
520
  return;
@@ -505,25 +577,26 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
505
577
  }, {
506
578
  key: "onCopy",
507
579
  value: function onCopy(event) {
508
- var priv = privatePool.get(this);
509
- if (!this.hot.isListening() && !priv.isTriggeredByCopy || this.isEditorOpened()) {
580
+ if (!this.hot.isListening() && !_classPrivateFieldGet(this, _isTriggeredByCopy) || this.isEditorOpened()) {
510
581
  return;
511
582
  }
512
583
  this.setCopyableText();
513
- priv.isTriggeredByCopy = false;
514
- var rangedData = this.getRangedData(this.copyableRanges);
515
- var allowCopying = !!this.hot.runHooks('beforeCopy', rangedData, this.copyableRanges);
584
+ _classPrivateFieldSet(this, _isTriggeredByCopy, false);
585
+ var data = this.getRangedData(this.copyableRanges);
586
+ var copiedHeadersCount = _classPrivateMethodGet(this, _countCopiedHeaders, _countCopiedHeaders2).call(this, this.copyableRanges);
587
+ var allowCopying = !!this.hot.runHooks('beforeCopy', data, this.copyableRanges, copiedHeadersCount);
516
588
  if (allowCopying) {
517
- var textPlain = stringify(rangedData);
589
+ var textPlain = stringify(data);
518
590
  if (event && event.clipboardData) {
519
- var textHTML = _dataToHTML(rangedData, this.hot.rootDocument);
591
+ var textHTML = _dataToHTML(data, this.hot.rootDocument);
520
592
  event.clipboardData.setData('text/plain', textPlain);
521
593
  event.clipboardData.setData('text/html', [META_HEAD, textHTML].join(''));
522
594
  } else if (typeof ClipboardEvent === 'undefined') {
523
595
  this.hot.rootWindow.clipboardData.setData('Text', textPlain);
524
596
  }
525
- this.hot.runHooks('afterCopy', rangedData, this.copyableRanges);
597
+ this.hot.runHooks('afterCopy', data, this.copyableRanges, copiedHeadersCount);
526
598
  }
599
+ _classPrivateFieldSet(this, _copyMode, 'cells-only');
527
600
  event.preventDefault();
528
601
  }
529
602
 
@@ -536,12 +609,11 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
536
609
  }, {
537
610
  key: "onCut",
538
611
  value: function onCut(event) {
539
- var priv = privatePool.get(this);
540
- if (!this.hot.isListening() && !priv.isTriggeredByCut || this.isEditorOpened()) {
612
+ if (!this.hot.isListening() && !_classPrivateFieldGet(this, _isTriggeredByCut) || this.isEditorOpened()) {
541
613
  return;
542
614
  }
543
615
  this.setCopyableText();
544
- priv.isTriggeredByCut = false;
616
+ _classPrivateFieldSet(this, _isTriggeredByCut, false);
545
617
  var rangedData = this.getRangedData(this.copyableRanges);
546
618
  var allowCuttingOut = !!this.hot.runHooks('beforeCut', rangedData, this.copyableRanges);
547
619
  if (allowCuttingOut) {
@@ -620,7 +692,17 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
620
692
  value: function onAfterContextMenuDefaultOptions(options) {
621
693
  options.items.push({
622
694
  name: '---------'
623
- }, copyItem(this), cutItem(this));
695
+ }, copyItem(this));
696
+ if (_classPrivateFieldGet(this, _enableCopyColumnHeaders)) {
697
+ options.items.push(copyWithColumnHeadersItem(this));
698
+ }
699
+ if (_classPrivateFieldGet(this, _enableCopyColumnGroupHeaders)) {
700
+ options.items.push(copyWithColumnGroupHeadersItem(this));
701
+ }
702
+ if (_classPrivateFieldGet(this, _enableCopyColumnHeadersOnly)) {
703
+ options.items.push(copyColumnHeadersOnlyItem(this));
704
+ }
705
+ options.items.push(cutItem(this));
624
706
  }
625
707
 
626
708
  /**
@@ -648,13 +730,11 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
648
730
  }, {
649
731
  key: "onAfterSelectionEnd",
650
732
  value: function onAfterSelectionEnd() {
651
- var _privatePool$get = privatePool.get(this),
652
- isFragmentSelectionEnabled = _privatePool$get.isFragmentSelectionEnabled;
653
733
  if (this.isEditorOpened()) {
654
734
  return;
655
735
  }
656
736
  this.getOrCreateFocusableElement();
657
- if (isFragmentSelectionEnabled && this.focusableElement.getFocusableElement() !== this.hot.rootDocument.activeElement && getSelectionText()) {
737
+ if (this.hot.getSettings().fragmentSelection && this.focusableElement.getFocusableElement() !== this.hot.rootDocument.activeElement && getSelectionText()) {
658
738
  return;
659
739
  }
660
740
  this.setCopyableText();
@@ -682,7 +762,7 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
682
762
  }
683
763
 
684
764
  /**
685
- * Destroys the plugin instance.
765
+ * Destroys the `CopyPaste` plugin instance.
686
766
  */
687
767
  }, {
688
768
  key: "destroy",
@@ -708,6 +788,27 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
708
788
  get: function get() {
709
789
  return PLUGIN_PRIORITY;
710
790
  }
791
+
792
+ /**
793
+ * The maximum number of columns than can be copied to the clipboard.
794
+ *
795
+ * @type {number}
796
+ * @default Infinity
797
+ */
711
798
  }]);
712
799
  return CopyPaste;
713
- }(BasePlugin);
800
+ }(BasePlugin);
801
+ function _countCopiedHeaders2(ranges) {
802
+ var _normalizeRanges2 = normalizeRanges(ranges),
803
+ rows = _normalizeRanges2.rows;
804
+ var columnHeadersCount = 0;
805
+ for (var row = 0; row < rows.length; row++) {
806
+ if (rows[row] >= 0) {
807
+ break;
808
+ }
809
+ columnHeadersCount += 1;
810
+ }
811
+ return {
812
+ columnHeadersCount: columnHeadersCount
813
+ };
814
+ }