handsontable 0.0.0-next-b96fb9f-20231207 → 0.0.0-next-3d099da-20231208
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 +6 -11
- package/3rdparty/walkontable/src/calculator/index.mjs +3 -5
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +122 -1
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +124 -2
- package/3rdparty/walkontable/src/calculator/viewportRows.js +1 -1
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +3 -2
- package/3rdparty/walkontable/src/core/_base.js +12 -0
- package/3rdparty/walkontable/src/core/_base.mjs +12 -0
- package/3rdparty/walkontable/src/core/core.js +2 -0
- package/3rdparty/walkontable/src/core/core.mjs +2 -0
- package/3rdparty/walkontable/src/facade/core.js +9 -0
- package/3rdparty/walkontable/src/facade/core.mjs +9 -0
- package/3rdparty/walkontable/src/index.js +4 -3
- package/3rdparty/walkontable/src/index.mjs +2 -1
- package/3rdparty/walkontable/src/overlays.js +3 -0
- package/3rdparty/walkontable/src/overlays.mjs +4 -0
- package/3rdparty/walkontable/src/renderer/colGroup.js +0 -10
- package/3rdparty/walkontable/src/renderer/colGroup.mjs +0 -10
- package/3rdparty/walkontable/src/renderer/rows.js +3 -4
- package/3rdparty/walkontable/src/renderer/rows.mjs +3 -4
- package/3rdparty/walkontable/src/selection/manager.js +1 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +1 -0
- package/3rdparty/walkontable/src/settings.js +0 -3
- package/3rdparty/walkontable/src/settings.mjs +0 -2
- package/3rdparty/walkontable/src/table.js +1 -0
- package/3rdparty/walkontable/src/table.mjs +1 -0
- package/3rdparty/walkontable/src/utils/column.js +12 -27
- package/3rdparty/walkontable/src/utils/column.mjs +12 -27
- package/3rdparty/walkontable/src/viewport.js +17 -22
- package/3rdparty/walkontable/src/viewport.mjs +18 -23
- package/base.js +2 -4
- package/base.mjs +2 -2
- package/core/focusCatcher/index.js +6 -44
- package/core/focusCatcher/index.mjs +6 -44
- package/core.js +11 -0
- package/core.mjs +11 -0
- package/dataMap/dataMap.js +0 -1
- package/dataMap/metaManager/metaSchema.js +2 -28
- package/dataMap/metaManager/metaSchema.mjs +2 -28
- package/dataMap/metaManager/mods/extendMetaProperties.js +0 -12
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +0 -12
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +3903 -2640
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +70 -66
- package/dist/handsontable.js +3906 -2643
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +39 -35
- package/editorManager.js +4 -3
- package/editorManager.mjs +4 -3
- package/editors/autocompleteEditor/autocompleteEditor.js +2 -0
- package/editors/autocompleteEditor/autocompleteEditor.mjs +2 -0
- package/editors/handsontableEditor/handsontableEditor.js +1 -0
- package/editors/handsontableEditor/handsontableEditor.mjs +1 -0
- package/editors/textEditor/textEditor.js +4 -0
- package/editors/textEditor/textEditor.mjs +4 -0
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +29 -6
- package/pluginHooks.js +123 -65
- package/pluginHooks.mjs +122 -62
- package/plugins/copyPaste/clipboardData/clipboardData.js +588 -0
- package/plugins/copyPaste/clipboardData/clipboardData.mjs +584 -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 +51 -129
- package/plugins/copyPaste/copyPaste.mjs +54 -132
- package/plugins/copyPaste/copyableRanges.js +7 -43
- package/plugins/copyPaste/copyableRanges.mjs +7 -42
- package/plugins/copyPaste/pasteEvent.mjs +1 -1
- package/plugins/customBorders/customBorders.js +5 -0
- package/plugins/customBorders/customBorders.mjs +5 -0
- package/plugins/customBorders/utils.js +1 -0
- package/plugins/customBorders/utils.mjs +1 -0
- package/plugins/filters/ui/radioInput.js +1 -1
- package/plugins/filters/ui/radioInput.mjs +1 -1
- package/plugins/formulas/formulas.js +2 -0
- package/plugins/formulas/formulas.mjs +2 -0
- package/plugins/formulas/indexSyncer/axisSyncer.js +1 -0
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +1 -0
- package/plugins/manualColumnResize/manualColumnResize.js +1 -0
- package/plugins/manualColumnResize/manualColumnResize.mjs +1 -0
- package/plugins/mergeCells/mergeCells.js +127 -1
- package/plugins/mergeCells/mergeCells.mjs +127 -1
- package/plugins/nestedHeaders/nestedHeaders.js +87 -41
- package/plugins/nestedHeaders/nestedHeaders.mjs +88 -42
- package/plugins/nestedHeaders/stateManager/headersTree.js +1 -0
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +1 -0
- package/plugins/undoRedo/undoRedo.js +2 -0
- package/plugins/undoRedo/undoRedo.mjs +2 -0
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +1 -0
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +1 -0
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -0
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +2 -0
- package/selection/highlight/highlight.js +1 -0
- package/selection/highlight/highlight.mjs +1 -0
- package/selection/index.js +3 -1
- package/selection/index.mjs +2 -2
- package/selection/utils.js +34 -0
- package/selection/utils.mjs +33 -0
- package/settings.d.ts +0 -1
- package/tableView.js +2 -1
- package/tableView.mjs +2 -1
- package/translations/indexMapper.js +1 -2
- package/utils/parseTable.js +538 -84
- package/utils/parseTable.mjs +534 -83
- package/validators/timeValidator/timeValidator.js +1 -0
- package/validators/timeValidator/timeValidator.mjs +1 -0
- package/3rdparty/walkontable/src/calculator/renderAllColumns.js +0 -50
- package/3rdparty/walkontable/src/calculator/renderAllColumns.mjs +0 -46
- package/3rdparty/walkontable/src/calculator/renderAllRows.js +0 -50
- package/3rdparty/walkontable/src/calculator/renderAllRows.mjs +0 -46
- package/3rdparty/walkontable/src/utils/columnStretching.js +0 -219
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +0 -215
- package/plugins/copyPaste/clipboardData.js +0 -18
- package/plugins/copyPaste/clipboardData.mjs +0 -14
package/editorManager.js
CHANGED
@@ -149,7 +149,6 @@ class EditorManager {
|
|
149
149
|
* Prepare text input to be displayed at given grid cell.
|
150
150
|
*/
|
151
151
|
prepareEditor() {
|
152
|
-
var _this$hot$getSelected;
|
153
152
|
if (this.lock) {
|
154
153
|
return;
|
155
154
|
}
|
@@ -161,8 +160,10 @@ class EditorManager {
|
|
161
160
|
});
|
162
161
|
return;
|
163
162
|
}
|
164
|
-
const
|
165
|
-
|
163
|
+
const {
|
164
|
+
highlight
|
165
|
+
} = this.hot.getSelectedRangeLast();
|
166
|
+
if (highlight.isHeader()) {
|
166
167
|
return;
|
167
168
|
}
|
168
169
|
const {
|
package/editorManager.mjs
CHANGED
@@ -145,7 +145,6 @@ class EditorManager {
|
|
145
145
|
* Prepare text input to be displayed at given grid cell.
|
146
146
|
*/
|
147
147
|
prepareEditor() {
|
148
|
-
var _this$hot$getSelected;
|
149
148
|
if (this.lock) {
|
150
149
|
return;
|
151
150
|
}
|
@@ -157,8 +156,10 @@ class EditorManager {
|
|
157
156
|
});
|
158
157
|
return;
|
159
158
|
}
|
160
|
-
const
|
161
|
-
|
159
|
+
const {
|
160
|
+
highlight
|
161
|
+
} = this.hot.getSelectedRangeLast();
|
162
|
+
if (highlight.isHeader()) {
|
162
163
|
return;
|
163
164
|
}
|
164
165
|
const {
|
@@ -191,6 +191,7 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
191
191
|
if (scrollbarWidth === 0 && (0, _browser.isMacOS)()) {
|
192
192
|
scrollbarWidth += 15; // default scroll bar width if scroll bars are visible only when scrolling
|
193
193
|
}
|
194
|
+
|
194
195
|
this.addHook('beforeKeyDown', event => this.onBeforeKeyDown(event));
|
195
196
|
this.htEditor.updateSettings({
|
196
197
|
colWidths: trimDropdown ? [(0, _element.outerWidth)(this.TEXTAREA) - 2] : undefined,
|
@@ -390,6 +391,7 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
390
391
|
if (this.htEditor.flipped) {
|
391
392
|
this.htEditor.rootElement.style.top = `${parseInt(this.htEditor.rootElement.style.top, 10) + dropdownHeight - height}px`; // eslint-disable-line max-len
|
392
393
|
}
|
394
|
+
|
393
395
|
this.setDropdownHeight(tempHeight - lastRowHeight);
|
394
396
|
}
|
395
397
|
}
|
@@ -188,6 +188,7 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
188
188
|
if (scrollbarWidth === 0 && isMacOS()) {
|
189
189
|
scrollbarWidth += 15; // default scroll bar width if scroll bars are visible only when scrolling
|
190
190
|
}
|
191
|
+
|
191
192
|
this.addHook('beforeKeyDown', event => this.onBeforeKeyDown(event));
|
192
193
|
this.htEditor.updateSettings({
|
193
194
|
colWidths: trimDropdown ? [outerWidth(this.TEXTAREA) - 2] : undefined,
|
@@ -387,6 +388,7 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
387
388
|
if (this.htEditor.flipped) {
|
388
389
|
this.htEditor.rootElement.style.top = `${parseInt(this.htEditor.rootElement.style.top, 10) + dropdownHeight - height}px`; // eslint-disable-line max-len
|
389
390
|
}
|
391
|
+
|
390
392
|
this.setDropdownHeight(tempHeight - lastRowHeight);
|
391
393
|
}
|
392
394
|
}
|
@@ -137,6 +137,7 @@ class HandsontableEditor extends _textEditor.TextEditor {
|
|
137
137
|
// if focus is still in the HOT editor
|
138
138
|
this.hot.listen(); // return the focus to the parent HOT instance
|
139
139
|
}
|
140
|
+
|
140
141
|
if (this.htEditor && this.htEditor.getSelectedLast()) {
|
141
142
|
const value = this.htEditor.getValue();
|
142
143
|
if (value !== undefined) {
|
@@ -134,6 +134,7 @@ export class HandsontableEditor extends TextEditor {
|
|
134
134
|
// if focus is still in the HOT editor
|
135
135
|
this.hot.listen(); // return the focus to the parent HOT instance
|
136
136
|
}
|
137
|
+
|
137
138
|
if (this.htEditor && this.htEditor.getSelectedLast()) {
|
138
139
|
const value = this.htEditor.getValue();
|
139
140
|
if (value !== undefined) {
|
@@ -128,6 +128,7 @@ class TextEditor extends _baseEditor.BaseEditor {
|
|
128
128
|
if ((0, _element.isThisHotChild)(this.hot.rootDocument.activeElement, this.hot.rootElement)) {
|
129
129
|
this.hot.listen(); // don't refocus the table if user focused some cell outside of HT on purpose
|
130
130
|
}
|
131
|
+
|
131
132
|
this.hideEditableElement();
|
132
133
|
this.unregisterShortcuts();
|
133
134
|
}
|
@@ -298,6 +299,7 @@ class TextEditor extends _baseEditor.BaseEditor {
|
|
298
299
|
if (!force) {
|
299
300
|
this.close(); // TODO shouldn't it be this.finishEditing() ?
|
300
301
|
}
|
302
|
+
|
301
303
|
return;
|
302
304
|
}
|
303
305
|
const {
|
@@ -400,6 +402,7 @@ class TextEditor extends _baseEditor.BaseEditor {
|
|
400
402
|
insertNewLine();
|
401
403
|
return false; // Will block closing editor.
|
402
404
|
},
|
405
|
+
|
403
406
|
runOnlyIf: event => !this.hot.selection.isMultiple() &&
|
404
407
|
// We trigger a data population for multiple selection.
|
405
408
|
// catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
|
@@ -410,6 +413,7 @@ class TextEditor extends _baseEditor.BaseEditor {
|
|
410
413
|
insertNewLine();
|
411
414
|
return false; // Will block closing editor.
|
412
415
|
},
|
416
|
+
|
413
417
|
runOnlyIf: () => !this.hot.selection.isMultiple() // We trigger a data population for multiple selection.
|
414
418
|
}, {
|
415
419
|
keys: [['Alt', 'Enter']],
|
@@ -124,6 +124,7 @@ export class TextEditor extends BaseEditor {
|
|
124
124
|
if (isThisHotChild(this.hot.rootDocument.activeElement, this.hot.rootElement)) {
|
125
125
|
this.hot.listen(); // don't refocus the table if user focused some cell outside of HT on purpose
|
126
126
|
}
|
127
|
+
|
127
128
|
this.hideEditableElement();
|
128
129
|
this.unregisterShortcuts();
|
129
130
|
}
|
@@ -294,6 +295,7 @@ export class TextEditor extends BaseEditor {
|
|
294
295
|
if (!force) {
|
295
296
|
this.close(); // TODO shouldn't it be this.finishEditing() ?
|
296
297
|
}
|
298
|
+
|
297
299
|
return;
|
298
300
|
}
|
299
301
|
const {
|
@@ -396,6 +398,7 @@ export class TextEditor extends BaseEditor {
|
|
396
398
|
insertNewLine();
|
397
399
|
return false; // Will block closing editor.
|
398
400
|
},
|
401
|
+
|
399
402
|
runOnlyIf: event => !this.hot.selection.isMultiple() &&
|
400
403
|
// We trigger a data population for multiple selection.
|
401
404
|
// catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
|
@@ -406,6 +409,7 @@ export class TextEditor extends BaseEditor {
|
|
406
409
|
insertNewLine();
|
407
410
|
return false; // Will block closing editor.
|
408
411
|
},
|
412
|
+
|
409
413
|
runOnlyIf: () => !this.hot.selection.isMultiple() // We trigger a data population for multiple selection.
|
410
414
|
}, {
|
411
415
|
keys: [['Alt', 'Enter']],
|
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-3d099da-20231208";
|
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-3d099da-20231208";
|
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-3d099da-20231208",
|
14
14
|
"main": "index",
|
15
15
|
"module": "index.mjs",
|
16
16
|
"jsnext:main": "index.mjs",
|
package/pluginHooks.d.ts
CHANGED
@@ -48,12 +48,35 @@ interface HookHighlightRowHeaderMeta {
|
|
48
48
|
rowCursor: number;
|
49
49
|
selectionHeight: number;
|
50
50
|
}
|
51
|
+
|
51
52
|
interface HookHighlightColumnHeaderMeta {
|
52
53
|
selectionType: string;
|
53
54
|
columnCursor: number;
|
54
55
|
selectionWidth: number;
|
55
56
|
}
|
56
57
|
|
58
|
+
interface ClipboardData {
|
59
|
+
removeRows: (rows: number[]) => void;
|
60
|
+
removeColumns: (columns: number[]) => void;
|
61
|
+
insertAtRow: (rowIndex: number, values: any[]) => void;
|
62
|
+
insertAtColumn: (columnIndex: number, values: any[]) => void;
|
63
|
+
getCellAt: (row: number, col: number) => string;
|
64
|
+
setCellAt: (row: number, column: number, value: any) => void;
|
65
|
+
getData: () => any[][];
|
66
|
+
getMetaInfo: () => GridSettings;
|
67
|
+
setMetaInfo: (property: 'colHeaders' | 'nestedHeaders' | 'mergeCells' | 'data', value: any) => void;
|
68
|
+
getType: () => 'handsontable' | 'table' | 'unrecognizable';
|
69
|
+
}
|
70
|
+
|
71
|
+
interface PasteClipboardData extends ClipboardData {
|
72
|
+
getType: () => 'handsontable' | 'table' | 'unrecognizable';
|
73
|
+
}
|
74
|
+
|
75
|
+
interface CopyClipboardData extends ClipboardData {
|
76
|
+
getRanges: () => RangeType[];
|
77
|
+
getType: () => 'handsontable';
|
78
|
+
}
|
79
|
+
|
57
80
|
export interface Events {
|
58
81
|
afterAddChild?: (parent: RowObject, element: RowObject | undefined, index: number | undefined) => void;
|
59
82
|
afterAutofill?: (fillData: CellValue[][], sourceRange: CellRange, targetRange: CellRange, direction: 'up' | 'down' | 'left' | 'right') => void;
|
@@ -72,11 +95,11 @@ export interface Events {
|
|
72
95
|
afterContextMenuDefaultOptions?: (predefinedItems: Array<ContextMenuPredefinedMenuItemKey | ContextMenuMenuItemConfig>) => void;
|
73
96
|
afterContextMenuHide?: (context: ContextMenu) => void;
|
74
97
|
afterContextMenuShow?: (context: ContextMenu) => void;
|
75
|
-
afterCopy?: (
|
98
|
+
afterCopy?: (clipboardData: CopyClipboardData) => void;
|
76
99
|
afterCopyLimit?: (selectedRows: number, selectedColumns: number, copyRowsLimit: number, copyColumnsLimit: number) => void;
|
77
100
|
afterCreateCol?: (index: number, amount: number, source?: ChangeSource) => void;
|
78
101
|
afterCreateRow?: (index: number, amount: number, source?: ChangeSource) => void;
|
79
|
-
afterCut?: (
|
102
|
+
afterCut?: (clipboardData: CopyClipboardData) => void;
|
80
103
|
afterDeselect?: () => void;
|
81
104
|
afterDestroy?: () => void;
|
82
105
|
afterDetachChild?: (parent: RowObject, element: RowObject) => void;
|
@@ -111,7 +134,7 @@ export interface Events {
|
|
111
134
|
afterOnCellMouseOut?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
112
135
|
afterOnCellMouseOver?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
113
136
|
afterOnCellMouseUp?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
114
|
-
afterPaste?: (
|
137
|
+
afterPaste?: (clipboardData: PasteClipboardData) => void;
|
115
138
|
afterPluginsInitialized?: () => void;
|
116
139
|
afterRedo?: (action: UndoRedoAction) => void;
|
117
140
|
afterRedoStackChange?: (undoneActionsBefore: UndoRedoAction[], undoneActionsAfter: UndoRedoAction[]) => void;
|
@@ -170,10 +193,10 @@ export interface Events {
|
|
170
193
|
beforeColumnUnfreeze?: (columnIndex: number, isUnfreezingPerformed: boolean) => void | boolean;
|
171
194
|
beforeContextMenuSetItems?: (menuItems: ContextMenuMenuItemConfig[]) => void;
|
172
195
|
beforeContextMenuShow?: (context: ContextMenu) => void;
|
173
|
-
beforeCopy?: (
|
196
|
+
beforeCopy?: (clipboardData: CopyClipboardData) => void | boolean;
|
174
197
|
beforeCreateCol?: (index: number, amount: number, source?: ChangeSource) => void | boolean;
|
175
198
|
beforeCreateRow?: (index: number, amount: number, source?: ChangeSource) => void | boolean;
|
176
|
-
beforeCut?: (
|
199
|
+
beforeCut?: (clipboardData: CopyClipboardData) => void | boolean;
|
177
200
|
beforeDetachChild?: (parent: RowObject, element: RowObject) => void;
|
178
201
|
beforeDrawBorders?: (corners: number[], borderClassName: 'current' | 'area' | 'highlight' | undefined) => void;
|
179
202
|
beforeDropdownMenuSetItems?: (menuItems: ContextMenuMenuItemConfig[]) => void;
|
@@ -195,7 +218,7 @@ export interface Events {
|
|
195
218
|
beforeOnCellMouseOut?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
196
219
|
beforeOnCellMouseOver?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement, controller: SelectionController) => void;
|
197
220
|
beforeOnCellMouseUp?: (event: MouseEvent, coords: CellCoords, TD: HTMLTableCellElement) => void;
|
198
|
-
beforePaste?: (
|
221
|
+
beforePaste?: (clipboardData: PasteClipboardData) => boolean | void;
|
199
222
|
beforeRedo?: (action: UndoRedoAction) => void;
|
200
223
|
beforeRedoStackChange?: (undoneActions: UndoRedoAction[]) => void;
|
201
224
|
beforeRefreshDimensions?: (previousDimensions: object, currentDimensions: object, actionPossible: boolean) => boolean | void;
|
package/pluginHooks.js
CHANGED
@@ -122,9 +122,7 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
122
122
|
* });
|
123
123
|
* :::
|
124
124
|
* ...
|
125
|
-
*/
|
126
|
-
|
127
|
-
// @TODO: Move plugin description hooks to plugin?
|
125
|
+
*/ // @TODO: Move plugin description hooks to plugin?
|
128
126
|
const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sentence */
|
129
127
|
/**
|
130
128
|
* Fired after resetting a cell's meta. This happens when the {@link Core#updateSettings} method is called.
|
@@ -1513,26 +1511,36 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1513
1511
|
* Fired by {@link CopyPaste} plugin before copying the values to the clipboard and before clearing values of
|
1514
1512
|
* the selected cells. This hook is fired when {@link Options#copyPaste} option is enabled.
|
1515
1513
|
*
|
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
|
-
*
|
1517
|
+
* @param {object} clipboardData Information about cut action which is going to happen.
|
1518
|
+
* @param {Function} clipboardData.removeRow Remove row from the copied dataset.
|
1519
|
+
* @param {Function} clipboardData.removeColumn Remove column from the copied dataset.
|
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.
|
1520
1528
|
* @returns {*} If returns `false` then operation of the cutting out is canceled.
|
1521
1529
|
* @example
|
1522
1530
|
* ::: only-for javascript
|
1523
1531
|
* ```js
|
1524
|
-
* // To disregard a single row, remove it from
|
1532
|
+
* // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
|
1525
1533
|
* new Handsontable(element, {
|
1526
|
-
* beforeCut: function(
|
1527
|
-
* //
|
1528
|
-
*
|
1529
|
-
*
|
1530
|
-
* //
|
1534
|
+
* beforeCut: function(clipboardData) {
|
1535
|
+
* // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
|
1536
|
+
* clipboardData.removeRows([0]);
|
1537
|
+
* clipboardData.removeColumns([0]);
|
1538
|
+
* // clipboardData.getData() -> [[5, 6]]
|
1531
1539
|
* }
|
1532
1540
|
* });
|
1533
1541
|
* // To cancel a cutting action, just return `false`.
|
1534
1542
|
* new Handsontable(element, {
|
1535
|
-
* beforeCut: function(
|
1543
|
+
* beforeCut: function(clipboardData) {
|
1536
1544
|
* return false;
|
1537
1545
|
* }
|
1538
1546
|
* });
|
@@ -1541,18 +1549,18 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1541
1549
|
*
|
1542
1550
|
* ::: only-for react
|
1543
1551
|
* ```jsx
|
1544
|
-
* // To disregard a single row, remove it from
|
1552
|
+
* // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
|
1545
1553
|
* <HotTable
|
1546
|
-
* beforeCut={(
|
1547
|
-
* //
|
1548
|
-
*
|
1549
|
-
*
|
1550
|
-
* //
|
1554
|
+
* beforeCut={(clipboardData) => {
|
1555
|
+
* // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
|
1556
|
+
* clipboardData.removeRows([0]);
|
1557
|
+
* clipboardData.removeColumns([0]);
|
1558
|
+
* // clipboardData.getData() -> [[5, 6]]
|
1551
1559
|
* }}
|
1552
1560
|
* />
|
1553
1561
|
* // To cancel a cutting action, just return `false`.
|
1554
1562
|
* <HotTable
|
1555
|
-
* beforeCut={(
|
1563
|
+
* beforeCut={(clipboardData) => {
|
1556
1564
|
* return false;
|
1557
1565
|
* }}
|
1558
1566
|
* />
|
@@ -1564,33 +1572,52 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1564
1572
|
* Fired by {@link CopyPaste} plugin after data was cut out from the table. This hook is fired when
|
1565
1573
|
* {@link Options#copyPaste} option is enabled.
|
1566
1574
|
*
|
1575
|
+
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1576
|
+
*
|
1567
1577
|
* @event Hooks#afterCut
|
1568
|
-
* @param {
|
1569
|
-
* @param {
|
1570
|
-
*
|
1578
|
+
* @param {object} clipboardData Information about already performed cut action.
|
1579
|
+
* @param {Function} clipboardData.removeRow Remove row from the copied dataset.
|
1580
|
+
* @param {Function} clipboardData.removeColumn Remove column from the copied dataset.
|
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.
|
1571
1589
|
*/
|
1572
1590
|
'afterCut',
|
1573
1591
|
/**
|
1574
1592
|
* Fired before values are copied to the clipboard.
|
1575
1593
|
*
|
1594
|
+
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1595
|
+
*
|
1576
1596
|
* @event Hooks#beforeCopy
|
1577
|
-
* @param {
|
1578
|
-
* @param {
|
1579
|
-
*
|
1580
|
-
* @param {
|
1597
|
+
* @param {object} clipboardData Information about copy action which is going to happen.
|
1598
|
+
* @param {Function} clipboardData.removeRow Remove row from the copied dataset.
|
1599
|
+
* @param {Function} clipboardData.removeColumn Remove column from the copied dataset.
|
1600
|
+
* @param {Function} clipboardData.insertAtRow Insert values at row index.
|
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.
|
1581
1608
|
* @returns {*} If returns `false` then copying is canceled.
|
1582
1609
|
*
|
1583
1610
|
* @example
|
1584
1611
|
* ::: only-for javascript
|
1585
1612
|
* ```js
|
1586
|
-
* // To disregard a single row, remove it from
|
1613
|
+
* // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
|
1587
1614
|
* ...
|
1588
1615
|
* new Handsontable(document.getElementById('example'), {
|
1589
|
-
* beforeCopy: (
|
1590
|
-
* //
|
1591
|
-
*
|
1592
|
-
*
|
1593
|
-
* //
|
1616
|
+
* beforeCopy: (clipboardData) => {
|
1617
|
+
* // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
|
1618
|
+
* clipboardData.removeRows([0]);
|
1619
|
+
* clipboardData.removeColumns([0]);
|
1620
|
+
* // clipboardData.getData() -> [[5, 6]]
|
1594
1621
|
* }
|
1595
1622
|
* });
|
1596
1623
|
* ...
|
@@ -1598,7 +1625,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1598
1625
|
* // To cancel copying, return false from the callback.
|
1599
1626
|
* ...
|
1600
1627
|
* new Handsontable(document.getElementById('example'), {
|
1601
|
-
* beforeCopy: (
|
1628
|
+
* beforeCopy: (clipboardData) => {
|
1602
1629
|
* return false;
|
1603
1630
|
* }
|
1604
1631
|
* });
|
@@ -1608,14 +1635,14 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1608
1635
|
*
|
1609
1636
|
* ::: only-for react
|
1610
1637
|
* ```jsx
|
1611
|
-
* // To disregard a single row, remove it from
|
1638
|
+
* // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
|
1612
1639
|
* ...
|
1613
1640
|
* <HotTable
|
1614
|
-
* beforeCopy={(
|
1615
|
-
* //
|
1616
|
-
*
|
1617
|
-
*
|
1618
|
-
* //
|
1641
|
+
* beforeCopy={(clipboardData) => {
|
1642
|
+
* // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
|
1643
|
+
* clipboardData.removeRows([0]);
|
1644
|
+
* clipboardData.removeColumns([0]);
|
1645
|
+
* // clipboardData.getData() -> [[5, 6]]
|
1619
1646
|
* }}
|
1620
1647
|
* />
|
1621
1648
|
* ...
|
@@ -1623,7 +1650,7 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1623
1650
|
* // To cancel copying, return false from the callback.
|
1624
1651
|
* ...
|
1625
1652
|
* <HotTable
|
1626
|
-
* beforeCopy={(
|
1653
|
+
* beforeCopy={(clipboardData) => {
|
1627
1654
|
* return false;
|
1628
1655
|
* }}
|
1629
1656
|
* />
|
@@ -1636,37 +1663,57 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1636
1663
|
* Fired by {@link CopyPaste} plugin after data are pasted into table. This hook is fired when {@link Options#copyPaste}
|
1637
1664
|
* option is enabled.
|
1638
1665
|
*
|
1666
|
+
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1667
|
+
*
|
1639
1668
|
* @event Hooks#afterCopy
|
1640
|
-
* @param {
|
1641
|
-
* @param {
|
1642
|
-
*
|
1643
|
-
* @param {
|
1669
|
+
* @param {object} clipboardData Information about already performed copy action.
|
1670
|
+
* @param {Function} clipboardData.removeRow Remove row from the copied dataset.
|
1671
|
+
* @param {Function} clipboardData.removeColumn Remove column from the copied dataset.
|
1672
|
+
* @param {Function} clipboardData.insertAtRow Insert values at row index.
|
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.
|
1644
1680
|
*/
|
1645
1681
|
'afterCopy',
|
1646
1682
|
/**
|
1647
1683
|
* Fired by {@link CopyPaste} plugin before values are pasted into table. This hook is fired when
|
1648
1684
|
* {@link Options#copyPaste} option is enabled.
|
1649
1685
|
*
|
1686
|
+
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1687
|
+
*
|
1650
1688
|
* @event Hooks#beforePaste
|
1651
|
-
* @param {
|
1652
|
-
* @param {
|
1653
|
-
*
|
1689
|
+
* @param {object} clipboardData Information about paste action which is going to happen.
|
1690
|
+
* @param {Function} clipboardData.removeRow Remove row from the pasted dataset.
|
1691
|
+
* @param {Function} clipboardData.removeColumn Remove column from the pasted dataset.
|
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).
|
1654
1701
|
* @returns {*} If returns `false` then pasting is canceled.
|
1655
1702
|
* @example
|
1656
1703
|
* ```js
|
1657
1704
|
* ::: only-for javascript
|
1658
|
-
* // To disregard a single row, remove it from
|
1705
|
+
* // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
|
1659
1706
|
* new Handsontable(example, {
|
1660
|
-
* beforePaste: (
|
1661
|
-
* //
|
1662
|
-
*
|
1663
|
-
*
|
1664
|
-
* //
|
1707
|
+
* beforePaste: (clipboardData) => {
|
1708
|
+
* // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
|
1709
|
+
* clipboardData.removeRows([0]);
|
1710
|
+
* clipboardData.removeColumns([0]);
|
1711
|
+
* // clipboardData.getData() -> [[5, 6]]
|
1665
1712
|
* }
|
1666
1713
|
* });
|
1667
1714
|
* // To cancel pasting, return false from the callback.
|
1668
1715
|
* new Handsontable(example, {
|
1669
|
-
* beforePaste: (
|
1716
|
+
* beforePaste: (clipboardData) => {
|
1670
1717
|
* return false;
|
1671
1718
|
* }
|
1672
1719
|
* });
|
@@ -1675,18 +1722,18 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1675
1722
|
*
|
1676
1723
|
* ::: only-for react
|
1677
1724
|
* ```jsx
|
1678
|
-
* // To disregard a single row, remove it from
|
1725
|
+
* // To disregard a single row or column, remove it from copied dataset using `removeRows`/`removeColumns` method on the object from the first callback argument.
|
1679
1726
|
* <HotTable
|
1680
|
-
* beforePaste={(
|
1681
|
-
* //
|
1682
|
-
*
|
1683
|
-
*
|
1684
|
-
* //
|
1727
|
+
* beforePaste={(clipboardData) => {
|
1728
|
+
* // clipboardData.getData() -> [[1, 2, 3], [4, 5, 6]]
|
1729
|
+
* clipboardData.removeRows([0]);
|
1730
|
+
* clipboardData.removeColumns([0]);
|
1731
|
+
* // clipboardData.getData() -> [[5, 6]]
|
1685
1732
|
* }}
|
1686
1733
|
* />
|
1687
1734
|
* // To cancel pasting, return false from the callback.
|
1688
1735
|
* <HotTable
|
1689
|
-
* beforePaste={(
|
1736
|
+
* beforePaste={(clipboardData) => {
|
1690
1737
|
* return false;
|
1691
1738
|
* }}
|
1692
1739
|
* />
|
@@ -1698,10 +1745,21 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
1698
1745
|
* Fired by {@link CopyPaste} plugin after values are pasted into table. This hook is fired when
|
1699
1746
|
* {@link Options#copyPaste} option is enabled.
|
1700
1747
|
*
|
1748
|
+
* Note: Please keep in mind since @15.0.0 the method arguments has been changed.
|
1749
|
+
*
|
1701
1750
|
* @event Hooks#afterPaste
|
1702
|
-
* @param {
|
1703
|
-
* @param {
|
1704
|
-
*
|
1751
|
+
* @param {object} clipboardData Information about already performed paste action.
|
1752
|
+
* @param {Function} clipboardData.removeRow Remove row from the pasted dataset.
|
1753
|
+
* @param {Function} clipboardData.removeColumn Remove column from the pasted dataset.
|
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).
|
1705
1763
|
*/
|
1706
1764
|
'afterPaste',
|
1707
1765
|
/**
|