handsontable 14.0.0-next-5fd908e-20231030 → 14.0.0-next-07c0a60-20231107

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/base.js +2 -2
  2. package/base.mjs +2 -2
  3. package/dist/handsontable.css +2 -2
  4. package/dist/handsontable.full.css +2 -2
  5. package/dist/handsontable.full.js +2075 -3376
  6. package/dist/handsontable.full.min.css +2 -2
  7. package/dist/handsontable.full.min.js +57 -64
  8. package/dist/handsontable.js +2077 -3378
  9. package/dist/handsontable.min.css +2 -2
  10. package/dist/handsontable.min.js +16 -23
  11. package/helpers/mixed.js +2 -2
  12. package/helpers/mixed.mjs +2 -2
  13. package/package.json +1 -1
  14. package/pluginHooks.d.ts +6 -28
  15. package/pluginHooks.js +62 -116
  16. package/pluginHooks.mjs +62 -116
  17. package/plugins/comments/contextMenuItem/addEditComment.js +2 -5
  18. package/plugins/comments/contextMenuItem/addEditComment.mjs +2 -5
  19. package/plugins/comments/contextMenuItem/readOnlyComment.js +2 -8
  20. package/plugins/comments/contextMenuItem/readOnlyComment.mjs +2 -8
  21. package/plugins/comments/contextMenuItem/removeComment.js +2 -5
  22. package/plugins/comments/contextMenuItem/removeComment.mjs +2 -5
  23. package/plugins/copyPaste/clipboardData.js +18 -0
  24. package/plugins/copyPaste/clipboardData.mjs +14 -0
  25. package/plugins/copyPaste/copyPaste.js +92 -38
  26. package/plugins/copyPaste/copyPaste.mjs +94 -40
  27. package/plugins/copyPaste/pasteEvent.js +14 -0
  28. package/plugins/copyPaste/pasteEvent.mjs +9 -0
  29. package/plugins/nestedHeaders/nestedHeaders.js +22 -21
  30. package/plugins/nestedHeaders/nestedHeaders.mjs +22 -21
  31. package/utils/parseTable.js +83 -527
  32. package/utils/parseTable.mjs +82 -523
  33. package/plugins/copyPaste/clipboardData/clipboardData.js +0 -516
  34. package/plugins/copyPaste/clipboardData/clipboardData.mjs +0 -512
  35. package/plugins/copyPaste/clipboardData/copyClipboardData.js +0 -69
  36. package/plugins/copyPaste/clipboardData/copyClipboardData.mjs +0 -65
  37. package/plugins/copyPaste/clipboardData/index.js +0 -9
  38. package/plugins/copyPaste/clipboardData/index.mjs +0 -4
  39. package/plugins/copyPaste/clipboardData/pasteClipboardData.js +0 -81
  40. package/plugins/copyPaste/clipboardData/pasteClipboardData.mjs +0 -77
package/pluginHooks.mjs CHANGED
@@ -1503,35 +1503,26 @@ 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
- *
1508
1506
  * @event Hooks#beforeCut
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.
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.
1519
1510
  * @returns {*} If returns `false` then operation of the cutting out is canceled.
1520
1511
  * @example
1521
1512
  * ::: only-for javascript
1522
1513
  * ```js
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.
1514
+ * // To disregard a single row, remove it from the array using data.splice(i, 1).
1524
1515
  * new Handsontable(element, {
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]]
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}]
1530
1521
  * }
1531
1522
  * });
1532
1523
  * // To cancel a cutting action, just return `false`.
1533
1524
  * new Handsontable(element, {
1534
- * beforeCut: function(clipboardData) {
1525
+ * beforeCut: function(data, coords) {
1535
1526
  * return false;
1536
1527
  * }
1537
1528
  * });
@@ -1540,18 +1531,18 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1540
1531
  *
1541
1532
  * ::: only-for react
1542
1533
  * ```jsx
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.
1534
+ * // To disregard a single row, remove it from the array using data.splice(i, 1).
1544
1535
  * <HotTable
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]]
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}]
1550
1541
  * }}
1551
1542
  * />
1552
1543
  * // To cancel a cutting action, just return `false`.
1553
1544
  * <HotTable
1554
- * beforeCut={(clipboardData) => {
1545
+ * beforeCut={(data, coords) => {
1555
1546
  * return false;
1556
1547
  * }}
1557
1548
  * />
@@ -1563,50 +1554,33 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1563
1554
  * Fired by {@link CopyPaste} plugin after data was cut out from the table. This hook is fired when
1564
1555
  * {@link Options#copyPaste} option is enabled.
1565
1556
  *
1566
- * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1567
- *
1568
1557
  * @event Hooks#afterCut
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.
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.
1579
1561
  */
1580
1562
  'afterCut',
1581
1563
  /**
1582
1564
  * Fired before values are copied to the clipboard.
1583
1565
  *
1584
- * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1585
- *
1586
1566
  * @event Hooks#beforeCopy
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.
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.
1597
1571
  * @returns {*} If returns `false` then copying is canceled.
1598
1572
  *
1599
1573
  * @example
1600
1574
  * ::: only-for javascript
1601
1575
  * ```js
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.
1576
+ * // To disregard a single row, remove it from array using data.splice(i, 1).
1603
1577
  * ...
1604
1578
  * new Handsontable(document.getElementById('example'), {
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]]
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}]
1610
1584
  * }
1611
1585
  * });
1612
1586
  * ...
@@ -1614,7 +1588,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1614
1588
  * // To cancel copying, return false from the callback.
1615
1589
  * ...
1616
1590
  * new Handsontable(document.getElementById('example'), {
1617
- * beforeCopy: (clipboardData) => {
1591
+ * beforeCopy: (data, coords) => {
1618
1592
  * return false;
1619
1593
  * }
1620
1594
  * });
@@ -1624,14 +1598,14 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1624
1598
  *
1625
1599
  * ::: only-for react
1626
1600
  * ```jsx
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.
1601
+ * // To disregard a single row, remove it from array using data.splice(i, 1).
1628
1602
  * ...
1629
1603
  * <HotTable
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]]
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}]
1635
1609
  * }}
1636
1610
  * />
1637
1611
  * ...
@@ -1639,7 +1613,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1639
1613
  * // To cancel copying, return false from the callback.
1640
1614
  * ...
1641
1615
  * <HotTable
1642
- * beforeCopy={(clipboardData) => {
1616
+ * beforeCopy={(data, coords) => {
1643
1617
  * return false;
1644
1618
  * }}
1645
1619
  * />
@@ -1652,55 +1626,37 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1652
1626
  * Fired by {@link CopyPaste} plugin after data are pasted into table. This hook is fired when {@link Options#copyPaste}
1653
1627
  * option is enabled.
1654
1628
  *
1655
- * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1656
- *
1657
1629
  * @event Hooks#afterCopy
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.
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.
1668
1634
  */
1669
1635
  'afterCopy',
1670
1636
  /**
1671
1637
  * Fired by {@link CopyPaste} plugin before values are pasted into table. This hook is fired when
1672
1638
  * {@link Options#copyPaste} option is enabled.
1673
1639
  *
1674
- * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1675
- *
1676
1640
  * @event Hooks#beforePaste
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).
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.
1688
1644
  * @returns {*} If returns `false` then pasting is canceled.
1689
1645
  * @example
1690
1646
  * ```js
1691
1647
  * ::: only-for javascript
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.
1648
+ * // To disregard a single row, remove it from array using data.splice(i, 1).
1693
1649
  * new Handsontable(example, {
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]]
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}]
1699
1655
  * }
1700
1656
  * });
1701
1657
  * // To cancel pasting, return false from the callback.
1702
1658
  * new Handsontable(example, {
1703
- * beforePaste: (clipboardData) => {
1659
+ * beforePaste: (data, coords) => {
1704
1660
  * return false;
1705
1661
  * }
1706
1662
  * });
@@ -1709,18 +1665,18 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1709
1665
  *
1710
1666
  * ::: only-for react
1711
1667
  * ```jsx
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.
1668
+ * // To disregard a single row, remove it from array using data.splice(i, 1).
1713
1669
  * <HotTable
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]]
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}]
1719
1675
  * }}
1720
1676
  * />
1721
1677
  * // To cancel pasting, return false from the callback.
1722
1678
  * <HotTable
1723
- * beforePaste={(clipboardData) => {
1679
+ * beforePaste={(data, coords) => {
1724
1680
  * return false;
1725
1681
  * }}
1726
1682
  * />
@@ -1732,20 +1688,10 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1732
1688
  * Fired by {@link CopyPaste} plugin after values are pasted into table. This hook is fired when
1733
1689
  * {@link Options#copyPaste} option is enabled.
1734
1690
  *
1735
- * Note: Please keep in mind since @14.0.0 the method arguments has been changed.
1736
- *
1737
1691
  * @event Hooks#afterPaste
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).
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.
1749
1695
  */
1750
1696
  'afterPaste',
1751
1697
  /**
@@ -29,13 +29,10 @@ function addEditCommentItem(plugin) {
29
29
  },
30
30
  disabled() {
31
31
  const range = this.getSelectedRangeLast();
32
- if (!range) {
32
+ if (!range || range.highlight.isHeader() || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
33
33
  return true;
34
34
  }
35
- if (range.highlight.isHeader()) {
36
- return true;
37
- }
38
- return this.countRenderedRows() === 0 || this.countRenderedCols() === 0;
35
+ return false;
39
36
  }
40
37
  };
41
38
  }
@@ -23,13 +23,10 @@ export default function addEditCommentItem(plugin) {
23
23
  },
24
24
  disabled() {
25
25
  const range = this.getSelectedRangeLast();
26
- if (!range) {
26
+ if (!range || range.highlight.isHeader() || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
27
27
  return true;
28
28
  }
29
- if (range.highlight.isHeader()) {
30
- return true;
31
- }
32
- return this.countRenderedRows() === 0 || this.countRenderedCols() === 0;
29
+ return false;
33
30
  }
34
31
  };
35
32
  }
@@ -34,16 +34,10 @@ function readOnlyCommentItem(plugin) {
34
34
  },
35
35
  disabled() {
36
36
  const range = this.getSelectedRangeLast();
37
- if (!range) {
37
+ if (!range || range.highlight.isHeader() || !plugin.getCommentAtCell(range.highlight.row, range.highlight.col) || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
38
38
  return true;
39
39
  }
40
- if (range.highlight.isHeader()) {
41
- return true;
42
- }
43
- if (!plugin.getCommentAtCell(range.highlight.row, range.highlight.col)) {
44
- return true;
45
- }
46
- return this.countRenderedRows() === 0 || this.countRenderedCols() === 0;
40
+ return false;
47
41
  }
48
42
  };
49
43
  }
@@ -28,16 +28,10 @@ export default function readOnlyCommentItem(plugin) {
28
28
  },
29
29
  disabled() {
30
30
  const range = this.getSelectedRangeLast();
31
- if (!range) {
31
+ if (!range || range.highlight.isHeader() || !plugin.getCommentAtCell(range.highlight.row, range.highlight.col) || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
32
32
  return true;
33
33
  }
34
- if (range.highlight.isHeader()) {
35
- return true;
36
- }
37
- if (!plugin.getCommentAtCell(range.highlight.row, range.highlight.col)) {
38
- return true;
39
- }
40
- return this.countRenderedRows() === 0 || this.countRenderedCols() === 0;
34
+ return false;
41
35
  }
42
36
  };
43
37
  }
@@ -26,13 +26,10 @@ function removeCommentItem(plugin) {
26
26
  },
27
27
  disabled() {
28
28
  const range = this.getSelectedRangeLast();
29
- if (!range) {
29
+ if (!range || range.highlight.isHeader() || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
30
30
  return true;
31
31
  }
32
- if (range.highlight.isHeader()) {
33
- return true;
34
- }
35
- return this.countRenderedRows() === 0 || this.countRenderedCols() === 0;
32
+ return false;
36
33
  }
37
34
  };
38
35
  }
@@ -20,13 +20,10 @@ export default function removeCommentItem(plugin) {
20
20
  },
21
21
  disabled() {
22
22
  const range = this.getSelectedRangeLast();
23
- if (!range) {
23
+ if (!range || range.highlight.isHeader() || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
24
24
  return true;
25
25
  }
26
- if (range.highlight.isHeader()) {
27
- return true;
28
- }
29
- return this.countRenderedRows() === 0 || this.countRenderedCols() === 0;
26
+ return false;
30
27
  }
31
28
  };
32
29
  }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ /**
5
+ * @private
6
+ */
7
+ class ClipboardData {
8
+ constructor() {
9
+ this.data = {};
10
+ }
11
+ setData(type, value) {
12
+ this.data[type] = value;
13
+ }
14
+ getData(type) {
15
+ return this.data[type] || void 0;
16
+ }
17
+ }
18
+ exports.default = ClipboardData;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @private
3
+ */
4
+ export default class ClipboardData {
5
+ constructor() {
6
+ this.data = {};
7
+ }
8
+ setData(type, value) {
9
+ this.data[type] = value;
10
+ }
11
+ getData(type) {
12
+ return this.data[type] || void 0;
13
+ }
14
+ }