handsontable 0.0.0-next-50e428d-20231026 → 0.0.0-next-42d5bd7-20231027

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of handsontable might be problematic. Click here for more details.

Files changed (84) hide show
  1. package/3rdparty/walkontable/src/renderer/columnHeaders.js +3 -0
  2. package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +4 -1
  3. package/3rdparty/walkontable/src/renderer/rowHeaders.js +3 -0
  4. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +4 -1
  5. package/base.js +2 -2
  6. package/base.mjs +2 -2
  7. package/core.js +1 -1
  8. package/core.mjs +1 -1
  9. package/dist/handsontable.css +45 -63
  10. package/dist/handsontable.full.css +45 -63
  11. package/dist/handsontable.full.js +3599 -2080
  12. package/dist/handsontable.full.min.css +5 -5
  13. package/dist/handsontable.full.min.js +70 -63
  14. package/dist/handsontable.js +3601 -2082
  15. package/dist/handsontable.min.css +5 -5
  16. package/dist/handsontable.min.js +25 -18
  17. package/dist/languages/all.js +24 -2
  18. package/dist/languages/all.min.js +1 -1
  19. package/dist/languages/en-US.js +12 -1
  20. package/dist/languages/en-US.min.js +1 -1
  21. package/dist/languages/pl-PL.js +12 -1
  22. package/dist/languages/pl-PL.min.js +1 -1
  23. package/helpers/a11y.js +2 -0
  24. package/helpers/a11y.mjs +1 -0
  25. package/helpers/dom/element.js +29 -0
  26. package/helpers/dom/element.mjs +28 -0
  27. package/helpers/mixed.js +1 -1
  28. package/helpers/mixed.mjs +1 -1
  29. package/i18n/constants.js +27 -1
  30. package/i18n/constants.mjs +14 -1
  31. package/i18n/languages/en-US.js +12 -1
  32. package/i18n/languages/en-US.mjs +12 -1
  33. package/i18n/languages/pl-PL.js +12 -1
  34. package/i18n/languages/pl-PL.mjs +12 -1
  35. package/languages/all.js +24 -2
  36. package/languages/en-US.js +12 -1
  37. package/languages/en-US.mjs +12 -1
  38. package/languages/index.js +24 -2
  39. package/languages/pl-PL.js +12 -1
  40. package/languages/pl-PL.mjs +12 -1
  41. package/package.json +1 -1
  42. package/pluginHooks.d.ts +28 -6
  43. package/pluginHooks.js +116 -62
  44. package/pluginHooks.mjs +116 -62
  45. package/plugins/collapsibleColumns/collapsibleColumns.js +3 -2
  46. package/plugins/collapsibleColumns/collapsibleColumns.mjs +4 -3
  47. package/plugins/columnSorting/columnSorting.js +29 -3
  48. package/plugins/columnSorting/columnSorting.mjs +31 -5
  49. package/plugins/contextMenu/menu/menuItemRenderer.js +12 -0
  50. package/plugins/contextMenu/menu/menuItemRenderer.mjs +14 -2
  51. package/plugins/copyPaste/clipboardData/clipboardData.js +517 -0
  52. package/plugins/copyPaste/clipboardData/clipboardData.mjs +512 -0
  53. package/plugins/copyPaste/clipboardData/copyClipboardData.js +69 -0
  54. package/plugins/copyPaste/clipboardData/copyClipboardData.mjs +65 -0
  55. package/plugins/copyPaste/clipboardData/index.js +9 -0
  56. package/plugins/copyPaste/clipboardData/index.mjs +4 -0
  57. package/plugins/copyPaste/clipboardData/pasteClipboardData.js +81 -0
  58. package/plugins/copyPaste/clipboardData/pasteClipboardData.mjs +77 -0
  59. package/plugins/copyPaste/copyPaste.js +38 -92
  60. package/plugins/copyPaste/copyPaste.mjs +40 -94
  61. package/plugins/dropdownMenu/dropdownMenu.js +2 -1
  62. package/plugins/dropdownMenu/dropdownMenu.mjs +3 -2
  63. package/plugins/filters/ui/input.js +0 -3
  64. package/plugins/filters/ui/input.mjs +0 -3
  65. package/plugins/filters/ui/select.js +6 -0
  66. package/plugins/filters/ui/select.mjs +6 -0
  67. package/plugins/hiddenColumns/hiddenColumns.js +48 -3
  68. package/plugins/hiddenColumns/hiddenColumns.mjs +47 -2
  69. package/plugins/hiddenRows/hiddenRows.js +48 -3
  70. package/plugins/hiddenRows/hiddenRows.mjs +47 -2
  71. package/plugins/multiColumnSorting/multiColumnSorting.js +21 -0
  72. package/plugins/multiColumnSorting/multiColumnSorting.mjs +22 -1
  73. package/plugins/nestedHeaders/nestedHeaders.js +21 -22
  74. package/plugins/nestedHeaders/nestedHeaders.mjs +21 -22
  75. package/plugins/nestedRows/nestedRows.js +2 -1
  76. package/plugins/nestedRows/nestedRows.mjs +2 -1
  77. package/plugins/nestedRows/ui/headers.js +3 -3
  78. package/plugins/nestedRows/ui/headers.mjs +4 -4
  79. package/utils/parseTable.js +527 -83
  80. package/utils/parseTable.mjs +523 -82
  81. package/plugins/copyPaste/clipboardData.js +0 -18
  82. package/plugins/copyPaste/clipboardData.mjs +0 -14
  83. package/plugins/copyPaste/pasteEvent.js +0 -14
  84. package/plugins/copyPaste/pasteEvent.mjs +0 -9
package/pluginHooks.js CHANGED
@@ -1505,26 +1505,35 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1505
1505
  * Fired by {@link CopyPaste} plugin before copying the values to the clipboard and before clearing values of
1506
1506
  * the selected cells. This hook is fired when {@link Options#copyPaste} option is enabled.
1507
1507
  *
1508
+ * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1509
+ *
1508
1510
  * @event Hooks#beforeCut
1509
- * @param {Array[]} data An array of arrays which contains data to cut.
1510
- * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1511
- * which will be cut out.
1511
+ * @param {object} clipboardData Information about cut action which is going to happen.
1512
+ * @param {Function} clipboardData.removeRow Remove row from the copied dataset.
1513
+ * @param {Function} clipboardData.removeColumn Remove column from the copied dataset.
1514
+ * @param {Function} clipboardData.insertAtRow Insert values at row index.
1515
+ * @param {Function} clipboardData.insertAtColumn Insert values at column index.
1516
+ * @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
1517
+ * @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
1518
+ * @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
1519
+ * @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
1520
+ * @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
1512
1521
  * @returns {*} If returns `false` then operation of the cutting out is canceled.
1513
1522
  * @example
1514
1523
  * ::: only-for javascript
1515
1524
  * ```js
1516
- * // To disregard a single row, remove it from the array using data.splice(i, 1).
1525
+ * // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
1517
1526
  * new Handsontable(element, {
1518
- * beforeCut: function(data, coords) {
1519
- * // data -> [[1, 2, 3], [4, 5, 6]]
1520
- * data.splice(0, 1);
1521
- * // data -> [[4, 5, 6]]
1522
- * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1527
+ * beforeCut: function(clipboardData) {
1528
+ * // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
1529
+ * clipboardData.removeRows([0]);
1530
+ * clipboardData.removeColumns([0]);
1531
+ * // clipboardData.getData() -> [[5, 6]]
1523
1532
  * }
1524
1533
  * });
1525
1534
  * // To cancel a cutting action, just return `false`.
1526
1535
  * new Handsontable(element, {
1527
- * beforeCut: function(data, coords) {
1536
+ * beforeCut: function(clipboardData) {
1528
1537
  * return false;
1529
1538
  * }
1530
1539
  * });
@@ -1533,18 +1542,18 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1533
1542
  *
1534
1543
  * ::: only-for react
1535
1544
  * ```jsx
1536
- * // To disregard a single row, remove it from the array using data.splice(i, 1).
1545
+ * // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
1537
1546
  * <HotTable
1538
- * beforeCut={(data, coords) => {
1539
- * // data -> [[1, 2, 3], [4, 5, 6]]
1540
- * data.splice(0, 1);
1541
- * // data -> [[4, 5, 6]]
1542
- * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1547
+ * beforeCut={(clipboardData) => {
1548
+ * // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
1549
+ * clipboardData.removeRows([0]);
1550
+ * clipboardData.removeColumns([0]);
1551
+ * // clipboardData.getData() -> [[5, 6]]
1543
1552
  * }}
1544
1553
  * />
1545
1554
  * // To cancel a cutting action, just return `false`.
1546
1555
  * <HotTable
1547
- * beforeCut={(data, coords) => {
1556
+ * beforeCut={(clipboardData) => {
1548
1557
  * return false;
1549
1558
  * }}
1550
1559
  * />
@@ -1556,33 +1565,50 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1556
1565
  * Fired by {@link CopyPaste} plugin after data was cut out from the table. This hook is fired when
1557
1566
  * {@link Options#copyPaste} option is enabled.
1558
1567
  *
1568
+ * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1569
+ *
1559
1570
  * @event Hooks#afterCut
1560
- * @param {Array[]} data An array of arrays with the cut data.
1561
- * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1562
- * which was cut out.
1571
+ * @param {object} clipboardData Information about already performed cut action.
1572
+ * @param {Function} clipboardData.removeRow Remove row from the copied dataset.
1573
+ * @param {Function} clipboardData.removeColumn Remove column from the copied dataset.
1574
+ * @param {Function} clipboardData.insertAtRow Insert values at row index.
1575
+ * @param {Function} clipboardData.insertAtColumn Insert values at column index.
1576
+ * @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
1577
+ * @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
1578
+ * @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
1579
+ * @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
1580
+ * @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
1563
1581
  */
1564
1582
  'afterCut',
1565
1583
  /**
1566
1584
  * Fired before values are copied to the clipboard.
1567
1585
  *
1586
+ * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1587
+ *
1568
1588
  * @event Hooks#beforeCopy
1569
- * @param {Array[]} data An array of arrays which contains data to copied.
1570
- * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1571
- * which will copied.
1572
- * @param {{ columnHeadersCount: number }} copiedHeadersCount (Since 12.3.0) The number of copied column headers.
1589
+ * @param {object} clipboardData Information about copy action which is going to happen.
1590
+ * @param {Function} clipboardData.removeRow Remove row from the copied dataset.
1591
+ * @param {Function} clipboardData.removeColumn Remove column from the copied dataset.
1592
+ * @param {Function} clipboardData.insertAtRow Insert values at row index.
1593
+ * @param {Function} clipboardData.insertAtColumn Insert values at column index.
1594
+ * @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
1595
+ * @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
1596
+ * @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
1597
+ * @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
1598
+ * @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
1573
1599
  * @returns {*} If returns `false` then copying is canceled.
1574
1600
  *
1575
1601
  * @example
1576
1602
  * ::: only-for javascript
1577
1603
  * ```js
1578
- * // To disregard a single row, remove it from array using data.splice(i, 1).
1604
+ * // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
1579
1605
  * ...
1580
1606
  * new Handsontable(document.getElementById('example'), {
1581
- * beforeCopy: (data, coords) => {
1582
- * // data -> [[1, 2, 3], [4, 5, 6]]
1583
- * data.splice(0, 1);
1584
- * // data -> [[4, 5, 6]]
1585
- * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1607
+ * beforeCopy: (clipboardData) => {
1608
+ * // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
1609
+ * clipboardData.removeRows([0]);
1610
+ * clipboardData.removeColumns([0]);
1611
+ * // clipboardData.getData() -> [[5, 6]]
1586
1612
  * }
1587
1613
  * });
1588
1614
  * ...
@@ -1590,7 +1616,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1590
1616
  * // To cancel copying, return false from the callback.
1591
1617
  * ...
1592
1618
  * new Handsontable(document.getElementById('example'), {
1593
- * beforeCopy: (data, coords) => {
1619
+ * beforeCopy: (clipboardData) => {
1594
1620
  * return false;
1595
1621
  * }
1596
1622
  * });
@@ -1600,14 +1626,14 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1600
1626
  *
1601
1627
  * ::: only-for react
1602
1628
  * ```jsx
1603
- * // To disregard a single row, remove it from array using data.splice(i, 1).
1629
+ * // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
1604
1630
  * ...
1605
1631
  * <HotTable
1606
- * beforeCopy={(data, coords) => {
1607
- * // data -> [[1, 2, 3], [4, 5, 6]]
1608
- * data.splice(0, 1);
1609
- * // data -> [[4, 5, 6]]
1610
- * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1632
+ * beforeCopy={(clipboardData) => {
1633
+ * // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
1634
+ * clipboardData.removeRows([0]);
1635
+ * clipboardData.removeColumns([0]);
1636
+ * // clipboardData.getData() -> [[5, 6]]
1611
1637
  * }}
1612
1638
  * />
1613
1639
  * ...
@@ -1615,7 +1641,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1615
1641
  * // To cancel copying, return false from the callback.
1616
1642
  * ...
1617
1643
  * <HotTable
1618
- * beforeCopy={(data, coords) => {
1644
+ * beforeCopy={(clipboardData) => {
1619
1645
  * return false;
1620
1646
  * }}
1621
1647
  * />
@@ -1628,37 +1654,55 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1628
1654
  * Fired by {@link CopyPaste} plugin after data are pasted into table. This hook is fired when {@link Options#copyPaste}
1629
1655
  * option is enabled.
1630
1656
  *
1657
+ * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1658
+ *
1631
1659
  * @event Hooks#afterCopy
1632
- * @param {Array[]} data An array of arrays which contains the copied data.
1633
- * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1634
- * which was copied.
1635
- * @param {{ columnHeadersCount: number }} copiedHeadersCount (Since 12.3.0) The number of copied column headers.
1660
+ * @param {object} clipboardData Information about already performed copy action.
1661
+ * @param {Function} clipboardData.removeRow Remove row from the copied dataset.
1662
+ * @param {Function} clipboardData.removeColumn Remove column from the copied dataset.
1663
+ * @param {Function} clipboardData.insertAtRow Insert values at row index.
1664
+ * @param {Function} clipboardData.insertAtColumn Insert values at column index.
1665
+ * @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
1666
+ * @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
1667
+ * @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
1668
+ * @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
1669
+ * @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
1636
1670
  */
1637
1671
  'afterCopy',
1638
1672
  /**
1639
1673
  * Fired by {@link CopyPaste} plugin before values are pasted into table. This hook is fired when
1640
1674
  * {@link Options#copyPaste} option is enabled.
1641
1675
  *
1676
+ * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1677
+ *
1642
1678
  * @event Hooks#beforePaste
1643
- * @param {Array[]} data An array of arrays which contains data to paste.
1644
- * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1645
- * that correspond to the previously selected area.
1679
+ * @param {object} clipboardData Information about paste action which is going to happen.
1680
+ * @param {Function} clipboardData.removeRow Remove row from the pasted dataset.
1681
+ * @param {Function} clipboardData.removeColumn Remove column from the pasted dataset.
1682
+ * @param {Function} clipboardData.insertAtRow Insert values at row index.
1683
+ * @param {Function} clipboardData.insertAtColumn Insert values at column index.
1684
+ * @param {Function} clipboardData.setCellAt Change headers or cells in the pasted dataset.
1685
+ * @param {Function} clipboardData.getCellAt Get headers or cells from the pasted dataset.
1686
+ * @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
1687
+ * @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
1688
+ * @param {Function} clipboardData.getSource Gets information about source of the copied data
1689
+ * (Handsontable, table or string).
1646
1690
  * @returns {*} If returns `false` then pasting is canceled.
1647
1691
  * @example
1648
1692
  * ```js
1649
1693
  * ::: only-for javascript
1650
- * // To disregard a single row, remove it from array using data.splice(i, 1).
1694
+ * // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
1651
1695
  * new Handsontable(example, {
1652
- * beforePaste: (data, coords) => {
1653
- * // data -> [[1, 2, 3], [4, 5, 6]]
1654
- * data.splice(0, 1);
1655
- * // data -> [[4, 5, 6]]
1656
- * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1696
+ * beforePaste: (clipboardData) => {
1697
+ * // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
1698
+ * clipboardData.removeRows([0]);
1699
+ * clipboardData.removeColumns([0]);
1700
+ * // clipboardData.getData() -> [[5, 6]]
1657
1701
  * }
1658
1702
  * });
1659
1703
  * // To cancel pasting, return false from the callback.
1660
1704
  * new Handsontable(example, {
1661
- * beforePaste: (data, coords) => {
1705
+ * beforePaste: (clipboardData) => {
1662
1706
  * return false;
1663
1707
  * }
1664
1708
  * });
@@ -1667,18 +1711,18 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1667
1711
  *
1668
1712
  * ::: only-for react
1669
1713
  * ```jsx
1670
- * // To disregard a single row, remove it from array using data.splice(i, 1).
1714
+ * // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
1671
1715
  * <HotTable
1672
- * beforePaste={(data, coords) => {
1673
- * // data -> [[1, 2, 3], [4, 5, 6]]
1674
- * data.splice(0, 1);
1675
- * // data -> [[4, 5, 6]]
1676
- * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1716
+ * beforePaste={(clipboardData) => {
1717
+ * // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
1718
+ * clipboardData.removeRows([0]);
1719
+ * clipboardData.removeColumns([0]);
1720
+ * // clipboardData.getData() -> [[5, 6]]
1677
1721
  * }}
1678
1722
  * />
1679
1723
  * // To cancel pasting, return false from the callback.
1680
1724
  * <HotTable
1681
- * beforePaste={(data, coords) => {
1725
+ * beforePaste={(clipboardData) => {
1682
1726
  * return false;
1683
1727
  * }}
1684
1728
  * />
@@ -1690,10 +1734,20 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1690
1734
  * Fired by {@link CopyPaste} plugin after values are pasted into table. This hook is fired when
1691
1735
  * {@link Options#copyPaste} option is enabled.
1692
1736
  *
1737
+ * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1738
+ *
1693
1739
  * @event Hooks#afterPaste
1694
- * @param {Array[]} data An array of arrays with the pasted data.
1695
- * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1696
- * that correspond to the previously selected area.
1740
+ * @param {object} clipboardData Information about already performed paste action.
1741
+ * @param {Function} clipboardData.removeRow Remove row from the pasted dataset.
1742
+ * @param {Function} clipboardData.removeColumn Remove column from the pasted dataset.
1743
+ * @param {Function} clipboardData.insertAtRow Insert values at row index.
1744
+ * @param {Function} clipboardData.insertAtColumn Insert values at column index.
1745
+ * @param {Function} clipboardData.setCellAt Change headers or cells in the pasted dataset.
1746
+ * @param {Function} clipboardData.getCellAt Get headers or cells from the pasted dataset.
1747
+ * @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
1748
+ * @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
1749
+ * @param {Function} clipboardData.getSource Gets information about source of the copied data
1750
+ * (Handsontable, table or string).
1697
1751
  */
1698
1752
  'afterPaste',
1699
1753
  /**
package/pluginHooks.mjs CHANGED
@@ -1503,26 +1503,35 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1503
1503
  * Fired by {@link CopyPaste} plugin before copying the values to the clipboard and before clearing values of
1504
1504
  * the selected cells. This hook is fired when {@link Options#copyPaste} option is enabled.
1505
1505
  *
1506
+ * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1507
+ *
1506
1508
  * @event Hooks#beforeCut
1507
- * @param {Array[]} data An array of arrays which contains data to cut.
1508
- * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1509
- * which will be cut out.
1509
+ * @param {object} clipboardData Information about cut action which is going to happen.
1510
+ * @param {Function} clipboardData.removeRow Remove row from the copied dataset.
1511
+ * @param {Function} clipboardData.removeColumn Remove column from the copied dataset.
1512
+ * @param {Function} clipboardData.insertAtRow Insert values at row index.
1513
+ * @param {Function} clipboardData.insertAtColumn Insert values at column index.
1514
+ * @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
1515
+ * @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
1516
+ * @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
1517
+ * @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
1518
+ * @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
1510
1519
  * @returns {*} If returns `false` then operation of the cutting out is canceled.
1511
1520
  * @example
1512
1521
  * ::: only-for javascript
1513
1522
  * ```js
1514
- * // To disregard a single row, remove it from the array using data.splice(i, 1).
1523
+ * // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
1515
1524
  * new Handsontable(element, {
1516
- * beforeCut: function(data, coords) {
1517
- * // data -> [[1, 2, 3], [4, 5, 6]]
1518
- * data.splice(0, 1);
1519
- * // data -> [[4, 5, 6]]
1520
- * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1525
+ * beforeCut: function(clipboardData) {
1526
+ * // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
1527
+ * clipboardData.removeRows([0]);
1528
+ * clipboardData.removeColumns([0]);
1529
+ * // clipboardData.getData() -> [[5, 6]]
1521
1530
  * }
1522
1531
  * });
1523
1532
  * // To cancel a cutting action, just return `false`.
1524
1533
  * new Handsontable(element, {
1525
- * beforeCut: function(data, coords) {
1534
+ * beforeCut: function(clipboardData) {
1526
1535
  * return false;
1527
1536
  * }
1528
1537
  * });
@@ -1531,18 +1540,18 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1531
1540
  *
1532
1541
  * ::: only-for react
1533
1542
  * ```jsx
1534
- * // To disregard a single row, remove it from the array using data.splice(i, 1).
1543
+ * // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
1535
1544
  * <HotTable
1536
- * beforeCut={(data, coords) => {
1537
- * // data -> [[1, 2, 3], [4, 5, 6]]
1538
- * data.splice(0, 1);
1539
- * // data -> [[4, 5, 6]]
1540
- * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1545
+ * beforeCut={(clipboardData) => {
1546
+ * // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
1547
+ * clipboardData.removeRows([0]);
1548
+ * clipboardData.removeColumns([0]);
1549
+ * // clipboardData.getData() -> [[5, 6]]
1541
1550
  * }}
1542
1551
  * />
1543
1552
  * // To cancel a cutting action, just return `false`.
1544
1553
  * <HotTable
1545
- * beforeCut={(data, coords) => {
1554
+ * beforeCut={(clipboardData) => {
1546
1555
  * return false;
1547
1556
  * }}
1548
1557
  * />
@@ -1554,33 +1563,50 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1554
1563
  * Fired by {@link CopyPaste} plugin after data was cut out from the table. This hook is fired when
1555
1564
  * {@link Options#copyPaste} option is enabled.
1556
1565
  *
1566
+ * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1567
+ *
1557
1568
  * @event Hooks#afterCut
1558
- * @param {Array[]} data An array of arrays with the cut data.
1559
- * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1560
- * which was cut out.
1569
+ * @param {object} clipboardData Information about already performed cut action.
1570
+ * @param {Function} clipboardData.removeRow Remove row from the copied dataset.
1571
+ * @param {Function} clipboardData.removeColumn Remove column from the copied dataset.
1572
+ * @param {Function} clipboardData.insertAtRow Insert values at row index.
1573
+ * @param {Function} clipboardData.insertAtColumn Insert values at column index.
1574
+ * @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
1575
+ * @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
1576
+ * @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
1577
+ * @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
1578
+ * @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
1561
1579
  */
1562
1580
  'afterCut',
1563
1581
  /**
1564
1582
  * Fired before values are copied to the clipboard.
1565
1583
  *
1584
+ * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1585
+ *
1566
1586
  * @event Hooks#beforeCopy
1567
- * @param {Array[]} data An array of arrays which contains data to copied.
1568
- * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1569
- * which will copied.
1570
- * @param {{ columnHeadersCount: number }} copiedHeadersCount (Since 12.3.0) The number of copied column headers.
1587
+ * @param {object} clipboardData Information about copy action which is going to happen.
1588
+ * @param {Function} clipboardData.removeRow Remove row from the copied dataset.
1589
+ * @param {Function} clipboardData.removeColumn Remove column from the copied dataset.
1590
+ * @param {Function} clipboardData.insertAtRow Insert values at row index.
1591
+ * @param {Function} clipboardData.insertAtColumn Insert values at column index.
1592
+ * @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
1593
+ * @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
1594
+ * @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
1595
+ * @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
1596
+ * @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
1571
1597
  * @returns {*} If returns `false` then copying is canceled.
1572
1598
  *
1573
1599
  * @example
1574
1600
  * ::: only-for javascript
1575
1601
  * ```js
1576
- * // To disregard a single row, remove it from array using data.splice(i, 1).
1602
+ * // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
1577
1603
  * ...
1578
1604
  * new Handsontable(document.getElementById('example'), {
1579
- * beforeCopy: (data, coords) => {
1580
- * // data -> [[1, 2, 3], [4, 5, 6]]
1581
- * data.splice(0, 1);
1582
- * // data -> [[4, 5, 6]]
1583
- * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1605
+ * beforeCopy: (clipboardData) => {
1606
+ * // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
1607
+ * clipboardData.removeRows([0]);
1608
+ * clipboardData.removeColumns([0]);
1609
+ * // clipboardData.getData() -> [[5, 6]]
1584
1610
  * }
1585
1611
  * });
1586
1612
  * ...
@@ -1588,7 +1614,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1588
1614
  * // To cancel copying, return false from the callback.
1589
1615
  * ...
1590
1616
  * new Handsontable(document.getElementById('example'), {
1591
- * beforeCopy: (data, coords) => {
1617
+ * beforeCopy: (clipboardData) => {
1592
1618
  * return false;
1593
1619
  * }
1594
1620
  * });
@@ -1598,14 +1624,14 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1598
1624
  *
1599
1625
  * ::: only-for react
1600
1626
  * ```jsx
1601
- * // To disregard a single row, remove it from array using data.splice(i, 1).
1627
+ * // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
1602
1628
  * ...
1603
1629
  * <HotTable
1604
- * beforeCopy={(data, coords) => {
1605
- * // data -> [[1, 2, 3], [4, 5, 6]]
1606
- * data.splice(0, 1);
1607
- * // data -> [[4, 5, 6]]
1608
- * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1630
+ * beforeCopy={(clipboardData) => {
1631
+ * // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
1632
+ * clipboardData.removeRows([0]);
1633
+ * clipboardData.removeColumns([0]);
1634
+ * // clipboardData.getData() -> [[5, 6]]
1609
1635
  * }}
1610
1636
  * />
1611
1637
  * ...
@@ -1613,7 +1639,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1613
1639
  * // To cancel copying, return false from the callback.
1614
1640
  * ...
1615
1641
  * <HotTable
1616
- * beforeCopy={(data, coords) => {
1642
+ * beforeCopy={(clipboardData) => {
1617
1643
  * return false;
1618
1644
  * }}
1619
1645
  * />
@@ -1626,37 +1652,55 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1626
1652
  * Fired by {@link CopyPaste} plugin after data are pasted into table. This hook is fired when {@link Options#copyPaste}
1627
1653
  * option is enabled.
1628
1654
  *
1655
+ * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1656
+ *
1629
1657
  * @event Hooks#afterCopy
1630
- * @param {Array[]} data An array of arrays which contains the copied data.
1631
- * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1632
- * which was copied.
1633
- * @param {{ columnHeadersCount: number }} copiedHeadersCount (Since 12.3.0) The number of copied column headers.
1658
+ * @param {object} clipboardData Information about already performed copy action.
1659
+ * @param {Function} clipboardData.removeRow Remove row from the copied dataset.
1660
+ * @param {Function} clipboardData.removeColumn Remove column from the copied dataset.
1661
+ * @param {Function} clipboardData.insertAtRow Insert values at row index.
1662
+ * @param {Function} clipboardData.insertAtColumn Insert values at column index.
1663
+ * @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
1664
+ * @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
1665
+ * @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
1666
+ * @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
1667
+ * @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
1634
1668
  */
1635
1669
  'afterCopy',
1636
1670
  /**
1637
1671
  * Fired by {@link CopyPaste} plugin before values are pasted into table. This hook is fired when
1638
1672
  * {@link Options#copyPaste} option is enabled.
1639
1673
  *
1674
+ * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1675
+ *
1640
1676
  * @event Hooks#beforePaste
1641
- * @param {Array[]} data An array of arrays which contains data to paste.
1642
- * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1643
- * that correspond to the previously selected area.
1677
+ * @param {object} clipboardData Information about paste action which is going to happen.
1678
+ * @param {Function} clipboardData.removeRow Remove row from the pasted dataset.
1679
+ * @param {Function} clipboardData.removeColumn Remove column from the pasted dataset.
1680
+ * @param {Function} clipboardData.insertAtRow Insert values at row index.
1681
+ * @param {Function} clipboardData.insertAtColumn Insert values at column index.
1682
+ * @param {Function} clipboardData.setCellAt Change headers or cells in the pasted dataset.
1683
+ * @param {Function} clipboardData.getCellAt Get headers or cells from the pasted dataset.
1684
+ * @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
1685
+ * @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
1686
+ * @param {Function} clipboardData.getSource Gets information about source of the copied data
1687
+ * (Handsontable, table or string).
1644
1688
  * @returns {*} If returns `false` then pasting is canceled.
1645
1689
  * @example
1646
1690
  * ```js
1647
1691
  * ::: only-for javascript
1648
- * // To disregard a single row, remove it from array using data.splice(i, 1).
1692
+ * // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
1649
1693
  * new Handsontable(example, {
1650
- * beforePaste: (data, coords) => {
1651
- * // data -> [[1, 2, 3], [4, 5, 6]]
1652
- * data.splice(0, 1);
1653
- * // data -> [[4, 5, 6]]
1654
- * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1694
+ * beforePaste: (clipboardData) => {
1695
+ * // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
1696
+ * clipboardData.removeRows([0]);
1697
+ * clipboardData.removeColumns([0]);
1698
+ * // clipboardData.getData() -> [[5, 6]]
1655
1699
  * }
1656
1700
  * });
1657
1701
  * // To cancel pasting, return false from the callback.
1658
1702
  * new Handsontable(example, {
1659
- * beforePaste: (data, coords) => {
1703
+ * beforePaste: (clipboardData) => {
1660
1704
  * return false;
1661
1705
  * }
1662
1706
  * });
@@ -1665,18 +1709,18 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1665
1709
  *
1666
1710
  * ::: only-for react
1667
1711
  * ```jsx
1668
- * // To disregard a single row, remove it from array using data.splice(i, 1).
1712
+ * // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
1669
1713
  * <HotTable
1670
- * beforePaste={(data, coords) => {
1671
- * // data -> [[1, 2, 3], [4, 5, 6]]
1672
- * data.splice(0, 1);
1673
- * // data -> [[4, 5, 6]]
1674
- * // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
1714
+ * beforePaste={(clipboardData) => {
1715
+ * // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
1716
+ * clipboardData.removeRows([0]);
1717
+ * clipboardData.removeColumns([0]);
1718
+ * // clipboardData.getData() -> [[5, 6]]
1675
1719
  * }}
1676
1720
  * />
1677
1721
  * // To cancel pasting, return false from the callback.
1678
1722
  * <HotTable
1679
- * beforePaste={(data, coords) => {
1723
+ * beforePaste={(clipboardData) => {
1680
1724
  * return false;
1681
1725
  * }}
1682
1726
  * />
@@ -1688,10 +1732,20 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1688
1732
  * Fired by {@link CopyPaste} plugin after values are pasted into table. This hook is fired when
1689
1733
  * {@link Options#copyPaste} option is enabled.
1690
1734
  *
1735
+ * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1736
+ *
1691
1737
  * @event Hooks#afterPaste
1692
- * @param {Array[]} data An array of arrays with the pasted data.
1693
- * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1694
- * that correspond to the previously selected area.
1738
+ * @param {object} clipboardData Information about already performed paste action.
1739
+ * @param {Function} clipboardData.removeRow Remove row from the pasted dataset.
1740
+ * @param {Function} clipboardData.removeColumn Remove column from the pasted dataset.
1741
+ * @param {Function} clipboardData.insertAtRow Insert values at row index.
1742
+ * @param {Function} clipboardData.insertAtColumn Insert values at column index.
1743
+ * @param {Function} clipboardData.setCellAt Change headers or cells in the pasted dataset.
1744
+ * @param {Function} clipboardData.getCellAt Get headers or cells from the pasted dataset.
1745
+ * @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
1746
+ * @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
1747
+ * @param {Function} clipboardData.getSource Gets information about source of the copied data
1748
+ * (Handsontable, table or string).
1695
1749
  */
1696
1750
  'afterPaste',
1697
1751
  /**
@@ -11,6 +11,7 @@ var _element = require("../../helpers/dom/element");
11
11
  var _eventManager = _interopRequireDefault(require("../../eventManager"));
12
12
  var _event = require("../../helpers/dom/event");
13
13
  var _a11y = require("../../helpers/a11y");
14
+ var _constants = require("../../i18n/constants");
14
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
16
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
16
17
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
@@ -520,7 +521,7 @@ class CollapsibleColumns extends _base.BasePlugin {
520
521
 
521
522
  // Add ARIA tags
522
523
  if (isAriaTagsEnabled) {
523
- (0, _element.setAttribute)(TH, ...(0, _a11y.A11Y_EXPANDED)(false));
524
+ (0, _element.setAttribute)(TH, [(0, _a11y.A11Y_EXPANDED)(false), (0, _a11y.A11Y_DESCRIPTION)(this.hot.getTranslatedPhrase(_constants.COLUMN_HEADER_DESCRIPTION_EXPAND_COLUMN))]);
524
525
  }
525
526
  } else {
526
527
  (0, _element.addClass)(collapsibleElement, 'expanded');
@@ -528,7 +529,7 @@ class CollapsibleColumns extends _base.BasePlugin {
528
529
 
529
530
  // Add ARIA tags
530
531
  if (isAriaTagsEnabled) {
531
- (0, _element.setAttribute)(TH, ...(0, _a11y.A11Y_EXPANDED)(true));
532
+ (0, _element.setAttribute)(TH, [(0, _a11y.A11Y_EXPANDED)(true), (0, _a11y.A11Y_DESCRIPTION)(this.hot.getTranslatedPhrase(_constants.COLUMN_HEADER_DESCRIPTION_COLLAPSE_COLUMN))]);
532
533
  }
533
534
  }
534
535
  if (isAriaTagsEnabled) {