handsontable 0.0.0-next-cecf979-20231026 → 0.0.0-next-e54c3d6-20231026
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/cell/coords.d.ts +2 -0
- package/3rdparty/walkontable/src/cell/coords.js +29 -0
- package/3rdparty/walkontable/src/cell/coords.mjs +29 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/focusCatcher/index.js +26 -20
- package/core/focusCatcher/index.mjs +26 -20
- package/core.js +65 -53
- package/core.mjs +65 -53
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +3602 -2219
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +88 -81
- package/dist/handsontable.js +3603 -2220
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +30 -23
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +30 -6
- package/pluginHooks.js +148 -62
- package/pluginHooks.mjs +148 -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/selection/selection.js +12 -0
- package/selection/selection.mjs +12 -0
- package/selection/transformation.js +42 -44
- package/selection/transformation.mjs +42 -44
- package/shortcutContexts/grid.js +4 -0
- package/shortcutContexts/grid.mjs +4 -0
- 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;
|
@@ -168,13 +190,14 @@ export interface Events {
|
|
168
190
|
beforeColumnMove?: (movedColumns: number[], finalIndex: number, dropIndex: number | undefined, movePossible: boolean) => void | boolean;
|
169
191
|
beforeColumnResize?: (newSize: number, column: number, isDoubleClick: boolean) => void | number;
|
170
192
|
beforeColumnSort?: (currentSortConfig: ColumnSortingConfig[], destinationSortConfigs: ColumnSortingConfig[]) => void | boolean;
|
193
|
+
beforeColumnWrap?: (isAutoWrapEnabled: boolean, newCoords: CellCoords, isColumnFlipped: boolean) => void;
|
171
194
|
beforeColumnUnfreeze?: (columnIndex: number, isUnfreezingPerformed: boolean) => void | boolean;
|
172
195
|
beforeContextMenuSetItems?: (menuItems: ContextMenuMenuItemConfig[]) => void;
|
173
196
|
beforeContextMenuShow?: (context: ContextMenu) => void;
|
174
|
-
beforeCopy?: (
|
197
|
+
beforeCopy?: (clipboardData: CopyClipboardData) => void | boolean;
|
175
198
|
beforeCreateCol?: (index: number, amount: number, source?: ChangeSource) => void | boolean;
|
176
199
|
beforeCreateRow?: (index: number, amount: number, source?: ChangeSource) => void | boolean;
|
177
|
-
beforeCut?: (
|
200
|
+
beforeCut?: (clipboardData: CopyClipboardData) => void | boolean;
|
178
201
|
beforeDetachChild?: (parent: RowObject, element: RowObject) => void;
|
179
202
|
beforeDrawBorders?: (corners: number[], borderClassName: 'current' | 'area' | 'highlight' | undefined) => void;
|
180
203
|
beforeDropdownMenuSetItems?: (menuItems: ContextMenuMenuItemConfig[]) => void;
|
@@ -196,7 +219,7 @@ export interface Events {
|
|
196
219
|
beforeOnCellMouseOut?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
197
220
|
beforeOnCellMouseOver?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement, controller: SelectionController) => void;
|
198
221
|
beforeOnCellMouseUp?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
199
|
-
beforePaste?: (
|
222
|
+
beforePaste?: (clipboardData: PasteClipboardData) => boolean | void;
|
200
223
|
beforeRedo?: (action: UndoRedoAction) => void;
|
201
224
|
beforeRedoStackChange?: (undoneActions: UndoRedoAction[]) => void;
|
202
225
|
beforeRefreshDimensions?: (previousDimensions: object, currentDimensions: object, actionPossible: boolean) => boolean | void;
|
@@ -208,6 +231,7 @@ export interface Events {
|
|
208
231
|
beforeRenderer?: (TD: HTMLTableCellElement, row: number, column: number, prop: string | number, value: CellValue, cellProperties: CellProperties) => void;
|
209
232
|
beforeRowMove?: (movedRows: number[], finalIndex: number, dropIndex: number | undefined, movePossible: boolean) => void;
|
210
233
|
beforeRowResize?: (newSize: number, row: number, isDoubleClick: boolean) => number | void;
|
234
|
+
beforeRowWrap?: (isAutoWrapEnabled: boolean, newCoords: CellCoords, isRowFlipped: boolean) => void;
|
211
235
|
beforeSelectColumns?: (from: CellCoords, to: CellCoords, highlight: CellCoords) => void;
|
212
236
|
beforeSelectionHighlightSet?: () => void;
|
213
237
|
beforeSelectRows?: (from: CellCoords, to: CellCoords, highlight: CellCoords) => void;
|
package/pluginHooks.js
CHANGED
@@ -1202,6 +1202,38 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1202
1202
|
* If set to `false`, the rendering gets triggered by scrolling or moving the selection.
|
1203
1203
|
*/
|
1204
1204
|
'afterRender',
|
1205
|
+
/**
|
1206
|
+
* When the focus position is moved to the next or previous row caused by the {@link Options#autoWrapRow} option
|
1207
|
+
* the hook is triggered.
|
1208
|
+
*
|
1209
|
+
* @since 14.0.0
|
1210
|
+
* @event Hooks#beforeRowWrap
|
1211
|
+
* @param {boolean} isWrapEnabled Tells whether the row wrapping is going to happen.
|
1212
|
+
* There may be situations where the option does not work even though it is enabled.
|
1213
|
+
* This is due to the priority of other options that may block the feature.
|
1214
|
+
* For example, when the {@link Options#minSpareCols} is defined, the {@link Options#autoWrapRow} option is not checked.
|
1215
|
+
* Thus, row wrapping is off.
|
1216
|
+
* @param {CellCoords} newCoords The new focus position.
|
1217
|
+
* @param {boolean} isFlipped `true` if the row index was flipped, `false` otherwise.
|
1218
|
+
* Flipped index means that the user reached the last row and the focus is moved to the first row or vice versa.
|
1219
|
+
*/
|
1220
|
+
'beforeRowWrap',
|
1221
|
+
/**
|
1222
|
+
* When the focus position is moved to the next or previous column caused by the {@link Options#autoWrapCol} option
|
1223
|
+
* the hook is triggered.
|
1224
|
+
*
|
1225
|
+
* @since 14.0.0
|
1226
|
+
* @event Hooks#beforeColumnWrap
|
1227
|
+
* @param {boolean} isWrapEnabled Tells whether the column wrapping is going to happen.
|
1228
|
+
* There may be situations where the option does not work even though it is enabled.
|
1229
|
+
* This is due to the priority of other options that may block the feature.
|
1230
|
+
* For example, when the {@link Options#minSpareRows} is defined, the {@link Options#autoWrapCol} option is not checked.
|
1231
|
+
* Thus, column wrapping is off.
|
1232
|
+
* @param {CellCoords} newCoords The new focus position.
|
1233
|
+
* @param {boolean} isFlipped `true` if the column index was flipped, `false` otherwise.
|
1234
|
+
* Flipped index means that the user reached the last column and the focus is moved to the first column or vice versa.
|
1235
|
+
*/
|
1236
|
+
'beforeColumnWrap',
|
1205
1237
|
/**
|
1206
1238
|
* Fired before cell meta is changed.
|
1207
1239
|
*
|
@@ -1473,26 +1505,35 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1473
1505
|
* Fired by {@link CopyPaste} plugin before copying the values to the clipboard and before clearing values of
|
1474
1506
|
* the selected cells. This hook is fired when {@link Options#copyPaste} option is enabled.
|
1475
1507
|
*
|
1508
|
+
* Note: Please keep in mind since @14.0.0 the method arguments has been changed.
|
1509
|
+
*
|
1476
1510
|
* @event Hooks#beforeCut
|
1477
|
-
* @param {
|
1478
|
-
* @param {
|
1479
|
-
*
|
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.
|
1480
1521
|
* @returns {*} If returns `false` then operation of the cutting out is canceled.
|
1481
1522
|
* @example
|
1482
1523
|
* ::: only-for javascript
|
1483
1524
|
* ```js
|
1484
|
-
* // 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.
|
1485
1526
|
* new Handsontable(element, {
|
1486
|
-
* beforeCut: function(
|
1487
|
-
* //
|
1488
|
-
*
|
1489
|
-
*
|
1490
|
-
* //
|
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]]
|
1491
1532
|
* }
|
1492
1533
|
* });
|
1493
1534
|
* // To cancel a cutting action, just return `false`.
|
1494
1535
|
* new Handsontable(element, {
|
1495
|
-
* beforeCut: function(
|
1536
|
+
* beforeCut: function(clipboardData) {
|
1496
1537
|
* return false;
|
1497
1538
|
* }
|
1498
1539
|
* });
|
@@ -1501,18 +1542,18 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1501
1542
|
*
|
1502
1543
|
* ::: only-for react
|
1503
1544
|
* ```jsx
|
1504
|
-
* // 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.
|
1505
1546
|
* <HotTable
|
1506
|
-
* beforeCut={(
|
1507
|
-
* //
|
1508
|
-
*
|
1509
|
-
*
|
1510
|
-
* //
|
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]]
|
1511
1552
|
* }}
|
1512
1553
|
* />
|
1513
1554
|
* // To cancel a cutting action, just return `false`.
|
1514
1555
|
* <HotTable
|
1515
|
-
* beforeCut={(
|
1556
|
+
* beforeCut={(clipboardData) => {
|
1516
1557
|
* return false;
|
1517
1558
|
* }}
|
1518
1559
|
* />
|
@@ -1524,33 +1565,50 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1524
1565
|
* Fired by {@link CopyPaste} plugin after data was cut out from the table. This hook is fired when
|
1525
1566
|
* {@link Options#copyPaste} option is enabled.
|
1526
1567
|
*
|
1568
|
+
* Note: Please keep in mind since @14.0.0 the method arguments has been changed.
|
1569
|
+
*
|
1527
1570
|
* @event Hooks#afterCut
|
1528
|
-
* @param {
|
1529
|
-
* @param {
|
1530
|
-
*
|
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.
|
1531
1581
|
*/
|
1532
1582
|
'afterCut',
|
1533
1583
|
/**
|
1534
1584
|
* Fired before values are copied to the clipboard.
|
1535
1585
|
*
|
1586
|
+
* Note: Please keep in mind since @14.0.0 the method arguments has been changed.
|
1587
|
+
*
|
1536
1588
|
* @event Hooks#beforeCopy
|
1537
|
-
* @param {
|
1538
|
-
* @param {
|
1539
|
-
*
|
1540
|
-
* @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.
|
1541
1599
|
* @returns {*} If returns `false` then copying is canceled.
|
1542
1600
|
*
|
1543
1601
|
* @example
|
1544
1602
|
* ::: only-for javascript
|
1545
1603
|
* ```js
|
1546
|
-
* // 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.
|
1547
1605
|
* ...
|
1548
1606
|
* new Handsontable(document.getElementById('example'), {
|
1549
|
-
* beforeCopy: (
|
1550
|
-
* //
|
1551
|
-
*
|
1552
|
-
*
|
1553
|
-
* //
|
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]]
|
1554
1612
|
* }
|
1555
1613
|
* });
|
1556
1614
|
* ...
|
@@ -1558,7 +1616,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1558
1616
|
* // To cancel copying, return false from the callback.
|
1559
1617
|
* ...
|
1560
1618
|
* new Handsontable(document.getElementById('example'), {
|
1561
|
-
* beforeCopy: (
|
1619
|
+
* beforeCopy: (clipboardData) => {
|
1562
1620
|
* return false;
|
1563
1621
|
* }
|
1564
1622
|
* });
|
@@ -1568,14 +1626,14 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1568
1626
|
*
|
1569
1627
|
* ::: only-for react
|
1570
1628
|
* ```jsx
|
1571
|
-
* // 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.
|
1572
1630
|
* ...
|
1573
1631
|
* <HotTable
|
1574
|
-
* beforeCopy={(
|
1575
|
-
* //
|
1576
|
-
*
|
1577
|
-
*
|
1578
|
-
* //
|
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]]
|
1579
1637
|
* }}
|
1580
1638
|
* />
|
1581
1639
|
* ...
|
@@ -1583,7 +1641,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1583
1641
|
* // To cancel copying, return false from the callback.
|
1584
1642
|
* ...
|
1585
1643
|
* <HotTable
|
1586
|
-
* beforeCopy={(
|
1644
|
+
* beforeCopy={(clipboardData) => {
|
1587
1645
|
* return false;
|
1588
1646
|
* }}
|
1589
1647
|
* />
|
@@ -1596,37 +1654,55 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1596
1654
|
* Fired by {@link CopyPaste} plugin after data are pasted into table. This hook is fired when {@link Options#copyPaste}
|
1597
1655
|
* option is enabled.
|
1598
1656
|
*
|
1657
|
+
* Note: Please keep in mind since @14.0.0 the method arguments has been changed.
|
1658
|
+
*
|
1599
1659
|
* @event Hooks#afterCopy
|
1600
|
-
* @param {
|
1601
|
-
* @param {
|
1602
|
-
*
|
1603
|
-
* @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.
|
1604
1670
|
*/
|
1605
1671
|
'afterCopy',
|
1606
1672
|
/**
|
1607
1673
|
* Fired by {@link CopyPaste} plugin before values are pasted into table. This hook is fired when
|
1608
1674
|
* {@link Options#copyPaste} option is enabled.
|
1609
1675
|
*
|
1676
|
+
* Note: Please keep in mind since @14.0.0 the method arguments has been changed.
|
1677
|
+
*
|
1610
1678
|
* @event Hooks#beforePaste
|
1611
|
-
* @param {
|
1612
|
-
* @param {
|
1613
|
-
*
|
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).
|
1614
1690
|
* @returns {*} If returns `false` then pasting is canceled.
|
1615
1691
|
* @example
|
1616
1692
|
* ```js
|
1617
1693
|
* ::: only-for javascript
|
1618
|
-
* // 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.
|
1619
1695
|
* new Handsontable(example, {
|
1620
|
-
* beforePaste: (
|
1621
|
-
* //
|
1622
|
-
*
|
1623
|
-
*
|
1624
|
-
* //
|
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]]
|
1625
1701
|
* }
|
1626
1702
|
* });
|
1627
1703
|
* // To cancel pasting, return false from the callback.
|
1628
1704
|
* new Handsontable(example, {
|
1629
|
-
* beforePaste: (
|
1705
|
+
* beforePaste: (clipboardData) => {
|
1630
1706
|
* return false;
|
1631
1707
|
* }
|
1632
1708
|
* });
|
@@ -1635,18 +1711,18 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1635
1711
|
*
|
1636
1712
|
* ::: only-for react
|
1637
1713
|
* ```jsx
|
1638
|
-
* // 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.
|
1639
1715
|
* <HotTable
|
1640
|
-
* beforePaste={(
|
1641
|
-
* //
|
1642
|
-
*
|
1643
|
-
*
|
1644
|
-
* //
|
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]]
|
1645
1721
|
* }}
|
1646
1722
|
* />
|
1647
1723
|
* // To cancel pasting, return false from the callback.
|
1648
1724
|
* <HotTable
|
1649
|
-
* beforePaste={(
|
1725
|
+
* beforePaste={(clipboardData) => {
|
1650
1726
|
* return false;
|
1651
1727
|
* }}
|
1652
1728
|
* />
|
@@ -1658,10 +1734,20 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1658
1734
|
* Fired by {@link CopyPaste} plugin after values are pasted into table. This hook is fired when
|
1659
1735
|
* {@link Options#copyPaste} option is enabled.
|
1660
1736
|
*
|
1737
|
+
* Note: Please keep in mind since @14.0.0 the method arguments has been changed.
|
1738
|
+
*
|
1661
1739
|
* @event Hooks#afterPaste
|
1662
|
-
* @param {
|
1663
|
-
* @param {
|
1664
|
-
*
|
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).
|
1665
1751
|
*/
|
1666
1752
|
'afterPaste',
|
1667
1753
|
/**
|