handsontable 0.0.0-next-50e428d-20231026 → 0.0.0-next-e54c3d6-20231026
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.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +3351 -2061
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +88 -81
- package/dist/handsontable.js +3353 -2063
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +24 -17
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +28 -6
- package/pluginHooks.js +116 -62
- package/pluginHooks.mjs +116 -62
- package/plugins/copyPaste/clipboardData/clipboardData.js +517 -0
- package/plugins/copyPaste/clipboardData/clipboardData.mjs +512 -0
- package/plugins/copyPaste/clipboardData/copyClipboardData.js +69 -0
- package/plugins/copyPaste/clipboardData/copyClipboardData.mjs +65 -0
- package/plugins/copyPaste/clipboardData/index.js +9 -0
- package/plugins/copyPaste/clipboardData/index.mjs +4 -0
- package/plugins/copyPaste/clipboardData/pasteClipboardData.js +81 -0
- package/plugins/copyPaste/clipboardData/pasteClipboardData.mjs +77 -0
- package/plugins/copyPaste/copyPaste.js +38 -92
- package/plugins/copyPaste/copyPaste.mjs +40 -94
- package/plugins/nestedHeaders/nestedHeaders.js +21 -22
- package/plugins/nestedHeaders/nestedHeaders.mjs +21 -22
- package/utils/parseTable.js +527 -83
- package/utils/parseTable.mjs +523 -82
- package/plugins/copyPaste/clipboardData.js +0 -18
- package/plugins/copyPaste/clipboardData.mjs +0 -14
- package/plugins/copyPaste/pasteEvent.js +0 -14
- package/plugins/copyPaste/pasteEvent.mjs +0 -9
package/helpers/mixed.js
CHANGED
@@ -134,7 +134,7 @@ const domMessages = {
|
|
134
134
|
function _injectProductInfo(key, element) {
|
135
135
|
const hasValidType = !isEmpty(key);
|
136
136
|
const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
137
|
-
const hotVersion = "0.0.0-next-
|
137
|
+
const hotVersion = "0.0.0-next-e54c3d6-20231026";
|
138
138
|
let keyValidityDate;
|
139
139
|
let consoleMessageState = 'invalid';
|
140
140
|
let domMessageState = 'invalid';
|
package/helpers/mixed.mjs
CHANGED
@@ -124,7 +124,7 @@ const domMessages = {
|
|
124
124
|
export function _injectProductInfo(key, element) {
|
125
125
|
const hasValidType = !isEmpty(key);
|
126
126
|
const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
127
|
-
const hotVersion = "0.0.0-next-
|
127
|
+
const hotVersion = "0.0.0-next-e54c3d6-20231026";
|
128
128
|
let keyValidityDate;
|
129
129
|
let consoleMessageState = 'invalid';
|
130
130
|
let domMessageState = 'invalid';
|
package/package.json
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
"url": "https://github.com/handsontable/handsontable/issues"
|
11
11
|
},
|
12
12
|
"author": "Handsoncode <hello@handsontable.com>",
|
13
|
-
"version": "0.0.0-next-
|
13
|
+
"version": "0.0.0-next-e54c3d6-20231026",
|
14
14
|
"main": "index",
|
15
15
|
"module": "index.mjs",
|
16
16
|
"jsnext:main": "index.mjs",
|
package/pluginHooks.d.ts
CHANGED
@@ -49,6 +49,7 @@ interface HookHighlightRowHeaderMeta {
|
|
49
49
|
selectionHeight: number;
|
50
50
|
classNames: string[];
|
51
51
|
}
|
52
|
+
|
52
53
|
interface HookHighlightColumnHeaderMeta {
|
53
54
|
selectionType: string;
|
54
55
|
columnCursor: number;
|
@@ -56,6 +57,27 @@ interface HookHighlightColumnHeaderMeta {
|
|
56
57
|
classNames: string[];
|
57
58
|
}
|
58
59
|
|
60
|
+
interface ClipboardData {
|
61
|
+
removeRows: (rows: number[]) => void;
|
62
|
+
removeColumns: (columns: number[]) => void;
|
63
|
+
insertAtRow: (rowIndex: number, values: any[]) => void;
|
64
|
+
insertAtColumn: (columnIndex: number, values: any[]) => void;
|
65
|
+
getCellAt: (row: number, col: number) => string;
|
66
|
+
setCellAt: (row: number, column: number, value: any) => void;
|
67
|
+
getData: () => any[][];
|
68
|
+
getMetaInfo: () => GridSettings;
|
69
|
+
getType: () => 'handsontable' | 'table' | 'unrecognizable';
|
70
|
+
}
|
71
|
+
|
72
|
+
interface PasteClipboardData extends ClipboardData {
|
73
|
+
getType: () => 'handsontable' | 'table' | 'unrecognizable';
|
74
|
+
}
|
75
|
+
|
76
|
+
interface CopyClipboardData extends ClipboardData {
|
77
|
+
getRanges: () => RangeType[];
|
78
|
+
getType: () => 'handsontable';
|
79
|
+
}
|
80
|
+
|
59
81
|
export interface Events {
|
60
82
|
afterAddChild?: (parent: RowObject, element: RowObject | undefined, index: number | undefined) => void;
|
61
83
|
afterAutofill?: (fillData: CellValue[][], sourceRange: CellRange, targetRange: CellRange, direction: 'up' | 'down' | 'left' | 'right') => void;
|
@@ -74,11 +96,11 @@ export interface Events {
|
|
74
96
|
afterContextMenuDefaultOptions?: (predefinedItems: Array<ContextMenuPredefinedMenuItemKey | ContextMenuMenuItemConfig>) => void;
|
75
97
|
afterContextMenuHide?: (context: ContextMenu) => void;
|
76
98
|
afterContextMenuShow?: (context: ContextMenu) => void;
|
77
|
-
afterCopy?: (
|
99
|
+
afterCopy?: (clipboardData: CopyClipboardData) => void;
|
78
100
|
afterCopyLimit?: (selectedRows: number, selectedColumns: number, copyRowsLimit: number, copyColumnsLimit: number) => void;
|
79
101
|
afterCreateCol?: (index: number, amount: number, source?: ChangeSource) => void;
|
80
102
|
afterCreateRow?: (index: number, amount: number, source?: ChangeSource) => void;
|
81
|
-
afterCut?: (
|
103
|
+
afterCut?: (clipboardData: CopyClipboardData) => void;
|
82
104
|
afterDeselect?: () => void;
|
83
105
|
afterDestroy?: () => void;
|
84
106
|
afterDetachChild?: (parent: RowObject, element: RowObject) => void;
|
@@ -113,7 +135,7 @@ export interface Events {
|
|
113
135
|
afterOnCellMouseOut?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
114
136
|
afterOnCellMouseOver?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
115
137
|
afterOnCellMouseUp?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
116
|
-
afterPaste?: (
|
138
|
+
afterPaste?: (clipboardData: PasteClipboardData) => void;
|
117
139
|
afterPluginsInitialized?: () => void;
|
118
140
|
afterRedo?: (action: UndoRedoAction) => void;
|
119
141
|
afterRedoStackChange?: (undoneActionsBefore: UndoRedoAction[], undoneActionsAfter: UndoRedoAction[]) => void;
|
@@ -172,10 +194,10 @@ export interface Events {
|
|
172
194
|
beforeColumnUnfreeze?: (columnIndex: number, isUnfreezingPerformed: boolean) => void | boolean;
|
173
195
|
beforeContextMenuSetItems?: (menuItems: ContextMenuMenuItemConfig[]) => void;
|
174
196
|
beforeContextMenuShow?: (context: ContextMenu) => void;
|
175
|
-
beforeCopy?: (
|
197
|
+
beforeCopy?: (clipboardData: CopyClipboardData) => void | boolean;
|
176
198
|
beforeCreateCol?: (index: number, amount: number, source?: ChangeSource) => void | boolean;
|
177
199
|
beforeCreateRow?: (index: number, amount: number, source?: ChangeSource) => void | boolean;
|
178
|
-
beforeCut?: (
|
200
|
+
beforeCut?: (clipboardData: CopyClipboardData) => void | boolean;
|
179
201
|
beforeDetachChild?: (parent: RowObject, element: RowObject) => void;
|
180
202
|
beforeDrawBorders?: (corners: number[], borderClassName: 'current' | 'area' | 'highlight' | undefined) => void;
|
181
203
|
beforeDropdownMenuSetItems?: (menuItems: ContextMenuMenuItemConfig[]) => void;
|
@@ -197,7 +219,7 @@ export interface Events {
|
|
197
219
|
beforeOnCellMouseOut?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
198
220
|
beforeOnCellMouseOver?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement, controller: SelectionController) => void;
|
199
221
|
beforeOnCellMouseUp?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
200
|
-
beforePaste?: (
|
222
|
+
beforePaste?: (clipboardData: PasteClipboardData) => boolean | void;
|
201
223
|
beforeRedo?: (action: UndoRedoAction) => void;
|
202
224
|
beforeRedoStackChange?: (undoneActions: UndoRedoAction[]) => void;
|
203
225
|
beforeRefreshDimensions?: (previousDimensions: object, currentDimensions: object, actionPossible: boolean) => boolean | void;
|
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 {
|
1510
|
-
* @param {
|
1511
|
-
*
|
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
|
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(
|
1519
|
-
* //
|
1520
|
-
*
|
1521
|
-
*
|
1522
|
-
* //
|
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(
|
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
|
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={(
|
1539
|
-
* //
|
1540
|
-
*
|
1541
|
-
*
|
1542
|
-
* //
|
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={(
|
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 {
|
1561
|
-
* @param {
|
1562
|
-
*
|
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 {
|
1570
|
-
* @param {
|
1571
|
-
*
|
1572
|
-
* @param {
|
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
|
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: (
|
1582
|
-
* //
|
1583
|
-
*
|
1584
|
-
*
|
1585
|
-
* //
|
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: (
|
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
|
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={(
|
1607
|
-
* //
|
1608
|
-
*
|
1609
|
-
*
|
1610
|
-
* //
|
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={(
|
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 {
|
1633
|
-
* @param {
|
1634
|
-
*
|
1635
|
-
* @param {
|
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 {
|
1644
|
-
* @param {
|
1645
|
-
*
|
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
|
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: (
|
1653
|
-
* //
|
1654
|
-
*
|
1655
|
-
*
|
1656
|
-
* //
|
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: (
|
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
|
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={(
|
1673
|
-
* //
|
1674
|
-
*
|
1675
|
-
*
|
1676
|
-
* //
|
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={(
|
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 {
|
1695
|
-
* @param {
|
1696
|
-
*
|
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
|
/**
|