handsontable 0.0.0-next-3d099da-20231208 → 0.0.0-next-51d3397-20231211
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.
- package/3rdparty/walkontable/src/calculator/index.js +11 -6
- package/3rdparty/walkontable/src/calculator/index.mjs +5 -3
- package/3rdparty/walkontable/src/calculator/renderAllColumns.js +50 -0
- package/3rdparty/walkontable/src/calculator/renderAllColumns.mjs +46 -0
- package/3rdparty/walkontable/src/calculator/renderAllRows.js +50 -0
- package/3rdparty/walkontable/src/calculator/renderAllRows.mjs +46 -0
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +1 -122
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +2 -124
- package/3rdparty/walkontable/src/calculator/viewportRows.js +1 -1
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +2 -3
- package/3rdparty/walkontable/src/core/_base.js +0 -12
- package/3rdparty/walkontable/src/core/_base.mjs +0 -12
- package/3rdparty/walkontable/src/core/core.js +0 -2
- package/3rdparty/walkontable/src/core/core.mjs +0 -2
- package/3rdparty/walkontable/src/facade/core.js +0 -9
- package/3rdparty/walkontable/src/facade/core.mjs +0 -9
- package/3rdparty/walkontable/src/index.js +3 -4
- package/3rdparty/walkontable/src/index.mjs +1 -2
- package/3rdparty/walkontable/src/overlays.js +0 -3
- package/3rdparty/walkontable/src/overlays.mjs +0 -4
- package/3rdparty/walkontable/src/renderer/colGroup.js +10 -0
- package/3rdparty/walkontable/src/renderer/colGroup.mjs +10 -0
- package/3rdparty/walkontable/src/renderer/rows.js +4 -3
- package/3rdparty/walkontable/src/renderer/rows.mjs +4 -3
- package/3rdparty/walkontable/src/selection/manager.js +0 -1
- package/3rdparty/walkontable/src/selection/manager.mjs +0 -1
- package/3rdparty/walkontable/src/settings.js +3 -0
- package/3rdparty/walkontable/src/settings.mjs +2 -0
- package/3rdparty/walkontable/src/table.js +0 -1
- package/3rdparty/walkontable/src/table.mjs +0 -1
- package/3rdparty/walkontable/src/utils/column.js +27 -12
- package/3rdparty/walkontable/src/utils/column.mjs +27 -12
- package/3rdparty/walkontable/src/utils/columnStretching.js +219 -0
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +215 -0
- package/3rdparty/walkontable/src/viewport.js +22 -17
- package/3rdparty/walkontable/src/viewport.mjs +23 -18
- package/base.js +4 -2
- package/base.mjs +2 -2
- package/core/focusCatcher/index.js +44 -6
- package/core/focusCatcher/index.mjs +44 -6
- package/core.js +0 -11
- package/core.mjs +0 -11
- package/dataMap/dataMap.js +1 -0
- package/dataMap/metaManager/metaSchema.js +28 -2
- package/dataMap/metaManager/metaSchema.mjs +28 -2
- package/dataMap/metaManager/mods/extendMetaProperties.js +12 -0
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +12 -0
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +3 -3
- package/dist/handsontable.full.js +3979 -5577
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +66 -71
- package/dist/handsontable.js +3058 -4305
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +35 -39
- package/editorManager.js +3 -4
- package/editorManager.mjs +3 -4
- package/editors/autocompleteEditor/autocompleteEditor.js +0 -2
- package/editors/autocompleteEditor/autocompleteEditor.mjs +0 -2
- package/editors/dateEditor/dateEditor.d.ts +1 -1
- package/editors/dateEditor/dateEditor.js +4 -1
- package/editors/dateEditor/dateEditor.mjs +4 -1
- package/editors/handsontableEditor/handsontableEditor.js +0 -1
- package/editors/handsontableEditor/handsontableEditor.mjs +0 -1
- package/editors/textEditor/textEditor.js +0 -4
- package/editors/textEditor/textEditor.mjs +0 -4
- package/helpers/browser.js +5 -2
- package/helpers/browser.mjs +5 -2
- package/helpers/feature.js +10 -0
- package/helpers/feature.mjs +9 -0
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +3 -4
- package/pluginHooks.d.ts +6 -29
- package/pluginHooks.js +65 -123
- package/pluginHooks.mjs +62 -122
- package/plugins/copyPaste/clipboardData.js +18 -0
- package/plugins/copyPaste/clipboardData.mjs +14 -0
- package/plugins/copyPaste/copyPaste.js +129 -51
- package/plugins/copyPaste/copyPaste.mjs +132 -54
- package/plugins/copyPaste/copyableRanges.js +43 -7
- package/plugins/copyPaste/copyableRanges.mjs +42 -7
- package/plugins/copyPaste/pasteEvent.mjs +1 -1
- package/plugins/customBorders/customBorders.js +0 -5
- package/plugins/customBorders/customBorders.mjs +0 -5
- package/plugins/customBorders/utils.js +0 -1
- package/plugins/customBorders/utils.mjs +0 -1
- package/plugins/filters/ui/radioInput.js +1 -1
- package/plugins/filters/ui/radioInput.mjs +1 -1
- package/plugins/formulas/formulas.js +0 -2
- package/plugins/formulas/formulas.mjs +0 -2
- package/plugins/formulas/indexSyncer/axisSyncer.js +0 -1
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +0 -1
- package/plugins/manualColumnResize/manualColumnResize.js +0 -1
- package/plugins/manualColumnResize/manualColumnResize.mjs +0 -1
- package/plugins/mergeCells/mergeCells.js +1 -127
- package/plugins/mergeCells/mergeCells.mjs +1 -127
- package/plugins/nestedHeaders/nestedHeaders.js +41 -87
- package/plugins/nestedHeaders/nestedHeaders.mjs +42 -88
- package/plugins/nestedHeaders/stateManager/headersTree.js +0 -1
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +0 -1
- package/plugins/undoRedo/undoRedo.js +0 -2
- package/plugins/undoRedo/undoRedo.mjs +0 -2
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +0 -1
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +0 -1
- package/renderers/checkboxRenderer/checkboxRenderer.js +0 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +0 -2
- package/selection/highlight/highlight.js +0 -1
- package/selection/highlight/highlight.mjs +0 -1
- package/selection/index.js +1 -3
- package/selection/index.mjs +2 -2
- package/selection/utils.js +0 -34
- package/selection/utils.mjs +0 -33
- package/settings.d.ts +2 -1
- package/tableView.js +1 -2
- package/tableView.mjs +1 -2
- package/translations/indexMapper.js +2 -1
- package/utils/parseTable.js +84 -538
- package/utils/parseTable.mjs +83 -534
- package/validators/timeValidator/timeValidator.js +0 -1
- package/validators/timeValidator/timeValidator.mjs +0 -1
- package/plugins/copyPaste/clipboardData/clipboardData.js +0 -588
- package/plugins/copyPaste/clipboardData/clipboardData.mjs +0 -584
- package/plugins/copyPaste/clipboardData/copyClipboardData.js +0 -69
- package/plugins/copyPaste/clipboardData/copyClipboardData.mjs +0 -65
- package/plugins/copyPaste/clipboardData/index.js +0 -9
- package/plugins/copyPaste/clipboardData/index.mjs +0 -4
- package/plugins/copyPaste/clipboardData/pasteClipboardData.js +0 -81
- package/plugins/copyPaste/clipboardData/pasteClipboardData.mjs +0 -77
package/pluginHooks.js
CHANGED
@@ -122,7 +122,9 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
122
122
|
* });
|
123
123
|
* :::
|
124
124
|
* ...
|
125
|
-
*/
|
125
|
+
*/
|
126
|
+
|
127
|
+
// @TODO: Move plugin description hooks to plugin?
|
126
128
|
const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sentence */
|
127
129
|
/**
|
128
130
|
* Fired after resetting a cell's meta. This happens when the {@link Core#updateSettings} method is called.
|
@@ -1511,36 +1513,26 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1511
1513
|
* Fired by {@link CopyPaste} plugin before copying the values to the clipboard and before clearing values of
|
1512
1514
|
* the selected cells. This hook is fired when {@link Options#copyPaste} option is enabled.
|
1513
1515
|
*
|
1514
|
-
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1515
|
-
*
|
1516
1516
|
* @event Hooks#beforeCut
|
1517
|
-
* @param {
|
1518
|
-
* @param {
|
1519
|
-
*
|
1520
|
-
* @param {Function} clipboardData.insertAtRow Insert values at row index.
|
1521
|
-
* @param {Function} clipboardData.insertAtColumn Insert values at column index.
|
1522
|
-
* @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
|
1523
|
-
* @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
|
1524
|
-
* @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
|
1525
|
-
* @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
|
1526
|
-
* @param {Function} clipboardData.setMetaInfo Sets meta information for the copied data.
|
1527
|
-
* @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
|
1517
|
+
* @param {Array[]} data An array of arrays which contains data to cut.
|
1518
|
+
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1519
|
+
* which will be cut out.
|
1528
1520
|
* @returns {*} If returns `false` then operation of the cutting out is canceled.
|
1529
1521
|
* @example
|
1530
1522
|
* ::: only-for javascript
|
1531
1523
|
* ```js
|
1532
|
-
* // To disregard a single row
|
1524
|
+
* // To disregard a single row, remove it from the array using data.splice(i, 1).
|
1533
1525
|
* new Handsontable(element, {
|
1534
|
-
* beforeCut: function(
|
1535
|
-
* //
|
1536
|
-
*
|
1537
|
-
*
|
1538
|
-
* //
|
1526
|
+
* beforeCut: function(data, coords) {
|
1527
|
+
* // data -> [[1, 2, 3], [4, 5, 6]]
|
1528
|
+
* data.splice(0, 1);
|
1529
|
+
* // data -> [[4, 5, 6]]
|
1530
|
+
* // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
|
1539
1531
|
* }
|
1540
1532
|
* });
|
1541
1533
|
* // To cancel a cutting action, just return `false`.
|
1542
1534
|
* new Handsontable(element, {
|
1543
|
-
* beforeCut: function(
|
1535
|
+
* beforeCut: function(data, coords) {
|
1544
1536
|
* return false;
|
1545
1537
|
* }
|
1546
1538
|
* });
|
@@ -1549,18 +1541,18 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1549
1541
|
*
|
1550
1542
|
* ::: only-for react
|
1551
1543
|
* ```jsx
|
1552
|
-
* // To disregard a single row
|
1544
|
+
* // To disregard a single row, remove it from the array using data.splice(i, 1).
|
1553
1545
|
* <HotTable
|
1554
|
-
* beforeCut={(
|
1555
|
-
* //
|
1556
|
-
*
|
1557
|
-
*
|
1558
|
-
* //
|
1546
|
+
* beforeCut={(data, coords) => {
|
1547
|
+
* // data -> [[1, 2, 3], [4, 5, 6]]
|
1548
|
+
* data.splice(0, 1);
|
1549
|
+
* // data -> [[4, 5, 6]]
|
1550
|
+
* // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
|
1559
1551
|
* }}
|
1560
1552
|
* />
|
1561
1553
|
* // To cancel a cutting action, just return `false`.
|
1562
1554
|
* <HotTable
|
1563
|
-
* beforeCut={(
|
1555
|
+
* beforeCut={(data, coords) => {
|
1564
1556
|
* return false;
|
1565
1557
|
* }}
|
1566
1558
|
* />
|
@@ -1572,52 +1564,33 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1572
1564
|
* Fired by {@link CopyPaste} plugin after data was cut out from the table. This hook is fired when
|
1573
1565
|
* {@link Options#copyPaste} option is enabled.
|
1574
1566
|
*
|
1575
|
-
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1576
|
-
*
|
1577
1567
|
* @event Hooks#afterCut
|
1578
|
-
* @param {
|
1579
|
-
* @param {
|
1580
|
-
*
|
1581
|
-
* @param {Function} clipboardData.insertAtRow Insert values at row index.
|
1582
|
-
* @param {Function} clipboardData.insertAtColumn Insert values at column index.
|
1583
|
-
* @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
|
1584
|
-
* @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
|
1585
|
-
* @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
|
1586
|
-
* @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
|
1587
|
-
* @param {Function} clipboardData.setMetaInfo Sets meta information for the copied data.
|
1588
|
-
* @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
|
1568
|
+
* @param {Array[]} data An array of arrays with the cut data.
|
1569
|
+
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1570
|
+
* which was cut out.
|
1589
1571
|
*/
|
1590
1572
|
'afterCut',
|
1591
1573
|
/**
|
1592
1574
|
* Fired before values are copied to the clipboard.
|
1593
1575
|
*
|
1594
|
-
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1595
|
-
*
|
1596
1576
|
* @event Hooks#beforeCopy
|
1597
|
-
* @param {
|
1598
|
-
* @param {
|
1599
|
-
*
|
1600
|
-
* @param {
|
1601
|
-
* @param {Function} clipboardData.insertAtColumn Insert values at column index.
|
1602
|
-
* @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
|
1603
|
-
* @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
|
1604
|
-
* @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
|
1605
|
-
* @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
|
1606
|
-
* @param {Function} clipboardData.setMetaInfo Sets meta information for the copied data.
|
1607
|
-
* @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
|
1577
|
+
* @param {Array[]} data An array of arrays which contains data to copied.
|
1578
|
+
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1579
|
+
* which will copied.
|
1580
|
+
* @param {{ columnHeadersCount: number }} copiedHeadersCount (Since 12.3.0) The number of copied column headers.
|
1608
1581
|
* @returns {*} If returns `false` then copying is canceled.
|
1609
1582
|
*
|
1610
1583
|
* @example
|
1611
1584
|
* ::: only-for javascript
|
1612
1585
|
* ```js
|
1613
|
-
* // To disregard a single row
|
1586
|
+
* // To disregard a single row, remove it from array using data.splice(i, 1).
|
1614
1587
|
* ...
|
1615
1588
|
* new Handsontable(document.getElementById('example'), {
|
1616
|
-
* beforeCopy: (
|
1617
|
-
* //
|
1618
|
-
*
|
1619
|
-
*
|
1620
|
-
* //
|
1589
|
+
* beforeCopy: (data, coords) => {
|
1590
|
+
* // data -> [[1, 2, 3], [4, 5, 6]]
|
1591
|
+
* data.splice(0, 1);
|
1592
|
+
* // data -> [[4, 5, 6]]
|
1593
|
+
* // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
|
1621
1594
|
* }
|
1622
1595
|
* });
|
1623
1596
|
* ...
|
@@ -1625,7 +1598,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1625
1598
|
* // To cancel copying, return false from the callback.
|
1626
1599
|
* ...
|
1627
1600
|
* new Handsontable(document.getElementById('example'), {
|
1628
|
-
* beforeCopy: (
|
1601
|
+
* beforeCopy: (data, coords) => {
|
1629
1602
|
* return false;
|
1630
1603
|
* }
|
1631
1604
|
* });
|
@@ -1635,14 +1608,14 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1635
1608
|
*
|
1636
1609
|
* ::: only-for react
|
1637
1610
|
* ```jsx
|
1638
|
-
* // To disregard a single row
|
1611
|
+
* // To disregard a single row, remove it from array using data.splice(i, 1).
|
1639
1612
|
* ...
|
1640
1613
|
* <HotTable
|
1641
|
-
* beforeCopy={(
|
1642
|
-
* //
|
1643
|
-
*
|
1644
|
-
*
|
1645
|
-
* //
|
1614
|
+
* beforeCopy={(data, coords) => {
|
1615
|
+
* // data -> [[1, 2, 3], [4, 5, 6]]
|
1616
|
+
* data.splice(0, 1);
|
1617
|
+
* // data -> [[4, 5, 6]]
|
1618
|
+
* // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
|
1646
1619
|
* }}
|
1647
1620
|
* />
|
1648
1621
|
* ...
|
@@ -1650,7 +1623,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1650
1623
|
* // To cancel copying, return false from the callback.
|
1651
1624
|
* ...
|
1652
1625
|
* <HotTable
|
1653
|
-
* beforeCopy={(
|
1626
|
+
* beforeCopy={(data, coords) => {
|
1654
1627
|
* return false;
|
1655
1628
|
* }}
|
1656
1629
|
* />
|
@@ -1663,57 +1636,37 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1663
1636
|
* Fired by {@link CopyPaste} plugin after data are pasted into table. This hook is fired when {@link Options#copyPaste}
|
1664
1637
|
* option is enabled.
|
1665
1638
|
*
|
1666
|
-
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1667
|
-
*
|
1668
1639
|
* @event Hooks#afterCopy
|
1669
|
-
* @param {
|
1670
|
-
* @param {
|
1671
|
-
*
|
1672
|
-
* @param {
|
1673
|
-
* @param {Function} clipboardData.insertAtColumn Insert values at column index.
|
1674
|
-
* @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
|
1675
|
-
* @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
|
1676
|
-
* @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
|
1677
|
-
* @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
|
1678
|
-
* @param {Function} clipboardData.setMetaInfo Sets meta information for the copied data.
|
1679
|
-
* @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
|
1640
|
+
* @param {Array[]} data An array of arrays which contains the copied data.
|
1641
|
+
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1642
|
+
* which was copied.
|
1643
|
+
* @param {{ columnHeadersCount: number }} copiedHeadersCount (Since 12.3.0) The number of copied column headers.
|
1680
1644
|
*/
|
1681
1645
|
'afterCopy',
|
1682
1646
|
/**
|
1683
1647
|
* Fired by {@link CopyPaste} plugin before values are pasted into table. This hook is fired when
|
1684
1648
|
* {@link Options#copyPaste} option is enabled.
|
1685
1649
|
*
|
1686
|
-
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1687
|
-
*
|
1688
1650
|
* @event Hooks#beforePaste
|
1689
|
-
* @param {
|
1690
|
-
* @param {
|
1691
|
-
*
|
1692
|
-
* @param {Function} clipboardData.insertAtRow Insert values at row index.
|
1693
|
-
* @param {Function} clipboardData.insertAtColumn Insert values at column index.
|
1694
|
-
* @param {Function} clipboardData.setCellAt Change headers or cells in the pasted dataset.
|
1695
|
-
* @param {Function} clipboardData.getCellAt Get headers or cells from the pasted dataset.
|
1696
|
-
* @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
|
1697
|
-
* @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
|
1698
|
-
* @param {Function} clipboardData.setMetaInfo Sets meta information for the copied data.
|
1699
|
-
* @param {Function} clipboardData.getSource Gets information about source of the copied data
|
1700
|
-
* (Handsontable, table or string).
|
1651
|
+
* @param {Array[]} data An array of arrays which contains data to paste.
|
1652
|
+
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1653
|
+
* that correspond to the previously selected area.
|
1701
1654
|
* @returns {*} If returns `false` then pasting is canceled.
|
1702
1655
|
* @example
|
1703
1656
|
* ```js
|
1704
1657
|
* ::: only-for javascript
|
1705
|
-
* // To disregard a single row
|
1658
|
+
* // To disregard a single row, remove it from array using data.splice(i, 1).
|
1706
1659
|
* new Handsontable(example, {
|
1707
|
-
* beforePaste: (
|
1708
|
-
* //
|
1709
|
-
*
|
1710
|
-
*
|
1711
|
-
* //
|
1660
|
+
* beforePaste: (data, coords) => {
|
1661
|
+
* // data -> [[1, 2, 3], [4, 5, 6]]
|
1662
|
+
* data.splice(0, 1);
|
1663
|
+
* // data -> [[4, 5, 6]]
|
1664
|
+
* // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
|
1712
1665
|
* }
|
1713
1666
|
* });
|
1714
1667
|
* // To cancel pasting, return false from the callback.
|
1715
1668
|
* new Handsontable(example, {
|
1716
|
-
* beforePaste: (
|
1669
|
+
* beforePaste: (data, coords) => {
|
1717
1670
|
* return false;
|
1718
1671
|
* }
|
1719
1672
|
* });
|
@@ -1722,18 +1675,18 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1722
1675
|
*
|
1723
1676
|
* ::: only-for react
|
1724
1677
|
* ```jsx
|
1725
|
-
* // To disregard a single row
|
1678
|
+
* // To disregard a single row, remove it from array using data.splice(i, 1).
|
1726
1679
|
* <HotTable
|
1727
|
-
* beforePaste={(
|
1728
|
-
* //
|
1729
|
-
*
|
1730
|
-
*
|
1731
|
-
* //
|
1680
|
+
* beforePaste={(data, coords) => {
|
1681
|
+
* // data -> [[1, 2, 3], [4, 5, 6]]
|
1682
|
+
* data.splice(0, 1);
|
1683
|
+
* // data -> [[4, 5, 6]]
|
1684
|
+
* // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
|
1732
1685
|
* }}
|
1733
1686
|
* />
|
1734
1687
|
* // To cancel pasting, return false from the callback.
|
1735
1688
|
* <HotTable
|
1736
|
-
* beforePaste={(
|
1689
|
+
* beforePaste={(data, coords) => {
|
1737
1690
|
* return false;
|
1738
1691
|
* }}
|
1739
1692
|
* />
|
@@ -1745,21 +1698,10 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1745
1698
|
* Fired by {@link CopyPaste} plugin after values are pasted into table. This hook is fired when
|
1746
1699
|
* {@link Options#copyPaste} option is enabled.
|
1747
1700
|
*
|
1748
|
-
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1749
|
-
*
|
1750
1701
|
* @event Hooks#afterPaste
|
1751
|
-
* @param {
|
1752
|
-
* @param {
|
1753
|
-
*
|
1754
|
-
* @param {Function} clipboardData.insertAtRow Insert values at row index.
|
1755
|
-
* @param {Function} clipboardData.insertAtColumn Insert values at column index.
|
1756
|
-
* @param {Function} clipboardData.setCellAt Change headers or cells in the pasted dataset.
|
1757
|
-
* @param {Function} clipboardData.getCellAt Get headers or cells from the pasted dataset.
|
1758
|
-
* @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
|
1759
|
-
* @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
|
1760
|
-
* @param {Function} clipboardData.setMetaInfo Sets meta information for the copied data.
|
1761
|
-
* @param {Function} clipboardData.getSource Gets information about source of the copied data
|
1762
|
-
* (Handsontable, table or string).
|
1702
|
+
* @param {Array[]} data An array of arrays with the pasted data.
|
1703
|
+
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1704
|
+
* that correspond to the previously selected area.
|
1763
1705
|
*/
|
1764
1706
|
'afterPaste',
|
1765
1707
|
/**
|
package/pluginHooks.mjs
CHANGED
@@ -1509,36 +1509,26 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1509
1509
|
* Fired by {@link CopyPaste} plugin before copying the values to the clipboard and before clearing values of
|
1510
1510
|
* the selected cells. This hook is fired when {@link Options#copyPaste} option is enabled.
|
1511
1511
|
*
|
1512
|
-
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1513
|
-
*
|
1514
1512
|
* @event Hooks#beforeCut
|
1515
|
-
* @param {
|
1516
|
-
* @param {
|
1517
|
-
*
|
1518
|
-
* @param {Function} clipboardData.insertAtRow Insert values at row index.
|
1519
|
-
* @param {Function} clipboardData.insertAtColumn Insert values at column index.
|
1520
|
-
* @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
|
1521
|
-
* @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
|
1522
|
-
* @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
|
1523
|
-
* @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
|
1524
|
-
* @param {Function} clipboardData.setMetaInfo Sets meta information for the copied data.
|
1525
|
-
* @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
|
1513
|
+
* @param {Array[]} data An array of arrays which contains data to cut.
|
1514
|
+
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1515
|
+
* which will be cut out.
|
1526
1516
|
* @returns {*} If returns `false` then operation of the cutting out is canceled.
|
1527
1517
|
* @example
|
1528
1518
|
* ::: only-for javascript
|
1529
1519
|
* ```js
|
1530
|
-
* // To disregard a single row
|
1520
|
+
* // To disregard a single row, remove it from the array using data.splice(i, 1).
|
1531
1521
|
* new Handsontable(element, {
|
1532
|
-
* beforeCut: function(
|
1533
|
-
* //
|
1534
|
-
*
|
1535
|
-
*
|
1536
|
-
* //
|
1522
|
+
* beforeCut: function(data, coords) {
|
1523
|
+
* // data -> [[1, 2, 3], [4, 5, 6]]
|
1524
|
+
* data.splice(0, 1);
|
1525
|
+
* // data -> [[4, 5, 6]]
|
1526
|
+
* // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
|
1537
1527
|
* }
|
1538
1528
|
* });
|
1539
1529
|
* // To cancel a cutting action, just return `false`.
|
1540
1530
|
* new Handsontable(element, {
|
1541
|
-
* beforeCut: function(
|
1531
|
+
* beforeCut: function(data, coords) {
|
1542
1532
|
* return false;
|
1543
1533
|
* }
|
1544
1534
|
* });
|
@@ -1547,18 +1537,18 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1547
1537
|
*
|
1548
1538
|
* ::: only-for react
|
1549
1539
|
* ```jsx
|
1550
|
-
* // To disregard a single row
|
1540
|
+
* // To disregard a single row, remove it from the array using data.splice(i, 1).
|
1551
1541
|
* <HotTable
|
1552
|
-
* beforeCut={(
|
1553
|
-
* //
|
1554
|
-
*
|
1555
|
-
*
|
1556
|
-
* //
|
1542
|
+
* beforeCut={(data, coords) => {
|
1543
|
+
* // data -> [[1, 2, 3], [4, 5, 6]]
|
1544
|
+
* data.splice(0, 1);
|
1545
|
+
* // data -> [[4, 5, 6]]
|
1546
|
+
* // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
|
1557
1547
|
* }}
|
1558
1548
|
* />
|
1559
1549
|
* // To cancel a cutting action, just return `false`.
|
1560
1550
|
* <HotTable
|
1561
|
-
* beforeCut={(
|
1551
|
+
* beforeCut={(data, coords) => {
|
1562
1552
|
* return false;
|
1563
1553
|
* }}
|
1564
1554
|
* />
|
@@ -1570,52 +1560,33 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1570
1560
|
* Fired by {@link CopyPaste} plugin after data was cut out from the table. This hook is fired when
|
1571
1561
|
* {@link Options#copyPaste} option is enabled.
|
1572
1562
|
*
|
1573
|
-
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1574
|
-
*
|
1575
1563
|
* @event Hooks#afterCut
|
1576
|
-
* @param {
|
1577
|
-
* @param {
|
1578
|
-
*
|
1579
|
-
* @param {Function} clipboardData.insertAtRow Insert values at row index.
|
1580
|
-
* @param {Function} clipboardData.insertAtColumn Insert values at column index.
|
1581
|
-
* @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
|
1582
|
-
* @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
|
1583
|
-
* @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
|
1584
|
-
* @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
|
1585
|
-
* @param {Function} clipboardData.setMetaInfo Sets meta information for the copied data.
|
1586
|
-
* @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
|
1564
|
+
* @param {Array[]} data An array of arrays with the cut data.
|
1565
|
+
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1566
|
+
* which was cut out.
|
1587
1567
|
*/
|
1588
1568
|
'afterCut',
|
1589
1569
|
/**
|
1590
1570
|
* Fired before values are copied to the clipboard.
|
1591
1571
|
*
|
1592
|
-
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1593
|
-
*
|
1594
1572
|
* @event Hooks#beforeCopy
|
1595
|
-
* @param {
|
1596
|
-
* @param {
|
1597
|
-
*
|
1598
|
-
* @param {
|
1599
|
-
* @param {Function} clipboardData.insertAtColumn Insert values at column index.
|
1600
|
-
* @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
|
1601
|
-
* @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
|
1602
|
-
* @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
|
1603
|
-
* @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
|
1604
|
-
* @param {Function} clipboardData.setMetaInfo Sets meta information for the copied data.
|
1605
|
-
* @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
|
1573
|
+
* @param {Array[]} data An array of arrays which contains data to copied.
|
1574
|
+
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1575
|
+
* which will copied.
|
1576
|
+
* @param {{ columnHeadersCount: number }} copiedHeadersCount (Since 12.3.0) The number of copied column headers.
|
1606
1577
|
* @returns {*} If returns `false` then copying is canceled.
|
1607
1578
|
*
|
1608
1579
|
* @example
|
1609
1580
|
* ::: only-for javascript
|
1610
1581
|
* ```js
|
1611
|
-
* // To disregard a single row
|
1582
|
+
* // To disregard a single row, remove it from array using data.splice(i, 1).
|
1612
1583
|
* ...
|
1613
1584
|
* new Handsontable(document.getElementById('example'), {
|
1614
|
-
* beforeCopy: (
|
1615
|
-
* //
|
1616
|
-
*
|
1617
|
-
*
|
1618
|
-
* //
|
1585
|
+
* beforeCopy: (data, coords) => {
|
1586
|
+
* // data -> [[1, 2, 3], [4, 5, 6]]
|
1587
|
+
* data.splice(0, 1);
|
1588
|
+
* // data -> [[4, 5, 6]]
|
1589
|
+
* // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
|
1619
1590
|
* }
|
1620
1591
|
* });
|
1621
1592
|
* ...
|
@@ -1623,7 +1594,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1623
1594
|
* // To cancel copying, return false from the callback.
|
1624
1595
|
* ...
|
1625
1596
|
* new Handsontable(document.getElementById('example'), {
|
1626
|
-
* beforeCopy: (
|
1597
|
+
* beforeCopy: (data, coords) => {
|
1627
1598
|
* return false;
|
1628
1599
|
* }
|
1629
1600
|
* });
|
@@ -1633,14 +1604,14 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1633
1604
|
*
|
1634
1605
|
* ::: only-for react
|
1635
1606
|
* ```jsx
|
1636
|
-
* // To disregard a single row
|
1607
|
+
* // To disregard a single row, remove it from array using data.splice(i, 1).
|
1637
1608
|
* ...
|
1638
1609
|
* <HotTable
|
1639
|
-
* beforeCopy={(
|
1640
|
-
* //
|
1641
|
-
*
|
1642
|
-
*
|
1643
|
-
* //
|
1610
|
+
* beforeCopy={(data, coords) => {
|
1611
|
+
* // data -> [[1, 2, 3], [4, 5, 6]]
|
1612
|
+
* data.splice(0, 1);
|
1613
|
+
* // data -> [[4, 5, 6]]
|
1614
|
+
* // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
|
1644
1615
|
* }}
|
1645
1616
|
* />
|
1646
1617
|
* ...
|
@@ -1648,7 +1619,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1648
1619
|
* // To cancel copying, return false from the callback.
|
1649
1620
|
* ...
|
1650
1621
|
* <HotTable
|
1651
|
-
* beforeCopy={(
|
1622
|
+
* beforeCopy={(data, coords) => {
|
1652
1623
|
* return false;
|
1653
1624
|
* }}
|
1654
1625
|
* />
|
@@ -1661,57 +1632,37 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1661
1632
|
* Fired by {@link CopyPaste} plugin after data are pasted into table. This hook is fired when {@link Options#copyPaste}
|
1662
1633
|
* option is enabled.
|
1663
1634
|
*
|
1664
|
-
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1665
|
-
*
|
1666
1635
|
* @event Hooks#afterCopy
|
1667
|
-
* @param {
|
1668
|
-
* @param {
|
1669
|
-
*
|
1670
|
-
* @param {
|
1671
|
-
* @param {Function} clipboardData.insertAtColumn Insert values at column index.
|
1672
|
-
* @param {Function} clipboardData.setCellAt Change headers or cells in the copied dataset.
|
1673
|
-
* @param {Function} clipboardData.getCellAt Get headers or cells from the copied dataset.
|
1674
|
-
* @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
|
1675
|
-
* @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
|
1676
|
-
* @param {Function} clipboardData.setMetaInfo Sets meta information for the copied data.
|
1677
|
-
* @param {Function} clipboardData.getRanges Returns ranges related to copied part of Handsontable.
|
1636
|
+
* @param {Array[]} data An array of arrays which contains the copied data.
|
1637
|
+
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1638
|
+
* which was copied.
|
1639
|
+
* @param {{ columnHeadersCount: number }} copiedHeadersCount (Since 12.3.0) The number of copied column headers.
|
1678
1640
|
*/
|
1679
1641
|
'afterCopy',
|
1680
1642
|
/**
|
1681
1643
|
* Fired by {@link CopyPaste} plugin before values are pasted into table. This hook is fired when
|
1682
1644
|
* {@link Options#copyPaste} option is enabled.
|
1683
1645
|
*
|
1684
|
-
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1685
|
-
*
|
1686
1646
|
* @event Hooks#beforePaste
|
1687
|
-
* @param {
|
1688
|
-
* @param {
|
1689
|
-
*
|
1690
|
-
* @param {Function} clipboardData.insertAtRow Insert values at row index.
|
1691
|
-
* @param {Function} clipboardData.insertAtColumn Insert values at column index.
|
1692
|
-
* @param {Function} clipboardData.setCellAt Change headers or cells in the pasted dataset.
|
1693
|
-
* @param {Function} clipboardData.getCellAt Get headers or cells from the pasted dataset.
|
1694
|
-
* @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
|
1695
|
-
* @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
|
1696
|
-
* @param {Function} clipboardData.setMetaInfo Sets meta information for the copied data.
|
1697
|
-
* @param {Function} clipboardData.getSource Gets information about source of the copied data
|
1698
|
-
* (Handsontable, table or string).
|
1647
|
+
* @param {Array[]} data An array of arrays which contains data to paste.
|
1648
|
+
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1649
|
+
* that correspond to the previously selected area.
|
1699
1650
|
* @returns {*} If returns `false` then pasting is canceled.
|
1700
1651
|
* @example
|
1701
1652
|
* ```js
|
1702
1653
|
* ::: only-for javascript
|
1703
|
-
* // To disregard a single row
|
1654
|
+
* // To disregard a single row, remove it from array using data.splice(i, 1).
|
1704
1655
|
* new Handsontable(example, {
|
1705
|
-
* beforePaste: (
|
1706
|
-
* //
|
1707
|
-
*
|
1708
|
-
*
|
1709
|
-
* //
|
1656
|
+
* beforePaste: (data, coords) => {
|
1657
|
+
* // data -> [[1, 2, 3], [4, 5, 6]]
|
1658
|
+
* data.splice(0, 1);
|
1659
|
+
* // data -> [[4, 5, 6]]
|
1660
|
+
* // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
|
1710
1661
|
* }
|
1711
1662
|
* });
|
1712
1663
|
* // To cancel pasting, return false from the callback.
|
1713
1664
|
* new Handsontable(example, {
|
1714
|
-
* beforePaste: (
|
1665
|
+
* beforePaste: (data, coords) => {
|
1715
1666
|
* return false;
|
1716
1667
|
* }
|
1717
1668
|
* });
|
@@ -1720,18 +1671,18 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1720
1671
|
*
|
1721
1672
|
* ::: only-for react
|
1722
1673
|
* ```jsx
|
1723
|
-
* // To disregard a single row
|
1674
|
+
* // To disregard a single row, remove it from array using data.splice(i, 1).
|
1724
1675
|
* <HotTable
|
1725
|
-
* beforePaste={(
|
1726
|
-
* //
|
1727
|
-
*
|
1728
|
-
*
|
1729
|
-
* //
|
1676
|
+
* beforePaste={(data, coords) => {
|
1677
|
+
* // data -> [[1, 2, 3], [4, 5, 6]]
|
1678
|
+
* data.splice(0, 1);
|
1679
|
+
* // data -> [[4, 5, 6]]
|
1680
|
+
* // coords -> [{startRow: 0, startCol: 0, endRow: 1, endCol: 2}]
|
1730
1681
|
* }}
|
1731
1682
|
* />
|
1732
1683
|
* // To cancel pasting, return false from the callback.
|
1733
1684
|
* <HotTable
|
1734
|
-
* beforePaste={(
|
1685
|
+
* beforePaste={(data, coords) => {
|
1735
1686
|
* return false;
|
1736
1687
|
* }}
|
1737
1688
|
* />
|
@@ -1743,21 +1694,10 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1743
1694
|
* Fired by {@link CopyPaste} plugin after values are pasted into table. This hook is fired when
|
1744
1695
|
* {@link Options#copyPaste} option is enabled.
|
1745
1696
|
*
|
1746
|
-
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1747
|
-
*
|
1748
1697
|
* @event Hooks#afterPaste
|
1749
|
-
* @param {
|
1750
|
-
* @param {
|
1751
|
-
*
|
1752
|
-
* @param {Function} clipboardData.insertAtRow Insert values at row index.
|
1753
|
-
* @param {Function} clipboardData.insertAtColumn Insert values at column index.
|
1754
|
-
* @param {Function} clipboardData.setCellAt Change headers or cells in the pasted dataset.
|
1755
|
-
* @param {Function} clipboardData.getCellAt Get headers or cells from the pasted dataset.
|
1756
|
-
* @param {Function} clipboardData.getData Gets copied data stored as array of arrays.
|
1757
|
-
* @param {Function} clipboardData.getMetaInfo Gets meta information for the copied data.
|
1758
|
-
* @param {Function} clipboardData.setMetaInfo Sets meta information for the copied data.
|
1759
|
-
* @param {Function} clipboardData.getSource Gets information about source of the copied data
|
1760
|
-
* (Handsontable, table or string).
|
1698
|
+
* @param {Array[]} data An array of arrays with the pasted data.
|
1699
|
+
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1700
|
+
* that correspond to the previously selected area.
|
1761
1701
|
*/
|
1762
1702
|
'afterPaste',
|
1763
1703
|
/**
|
@@ -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;
|