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.

Files changed (47) hide show
  1. package/3rdparty/walkontable/src/cell/coords.d.ts +2 -0
  2. package/3rdparty/walkontable/src/cell/coords.js +29 -0
  3. package/3rdparty/walkontable/src/cell/coords.mjs +29 -0
  4. package/base.js +2 -2
  5. package/base.mjs +2 -2
  6. package/core/focusCatcher/index.js +26 -20
  7. package/core/focusCatcher/index.mjs +26 -20
  8. package/core.js +65 -53
  9. package/core.mjs +65 -53
  10. package/dist/handsontable.css +2 -2
  11. package/dist/handsontable.full.css +2 -2
  12. package/dist/handsontable.full.js +3602 -2219
  13. package/dist/handsontable.full.min.css +2 -2
  14. package/dist/handsontable.full.min.js +88 -81
  15. package/dist/handsontable.js +3603 -2220
  16. package/dist/handsontable.min.css +2 -2
  17. package/dist/handsontable.min.js +30 -23
  18. package/helpers/mixed.js +1 -1
  19. package/helpers/mixed.mjs +1 -1
  20. package/package.json +1 -1
  21. package/pluginHooks.d.ts +30 -6
  22. package/pluginHooks.js +148 -62
  23. package/pluginHooks.mjs +148 -62
  24. package/plugins/copyPaste/clipboardData/clipboardData.js +517 -0
  25. package/plugins/copyPaste/clipboardData/clipboardData.mjs +512 -0
  26. package/plugins/copyPaste/clipboardData/copyClipboardData.js +69 -0
  27. package/plugins/copyPaste/clipboardData/copyClipboardData.mjs +65 -0
  28. package/plugins/copyPaste/clipboardData/index.js +9 -0
  29. package/plugins/copyPaste/clipboardData/index.mjs +4 -0
  30. package/plugins/copyPaste/clipboardData/pasteClipboardData.js +81 -0
  31. package/plugins/copyPaste/clipboardData/pasteClipboardData.mjs +77 -0
  32. package/plugins/copyPaste/copyPaste.js +38 -92
  33. package/plugins/copyPaste/copyPaste.mjs +40 -94
  34. package/plugins/nestedHeaders/nestedHeaders.js +21 -22
  35. package/plugins/nestedHeaders/nestedHeaders.mjs +21 -22
  36. package/selection/selection.js +12 -0
  37. package/selection/selection.mjs +12 -0
  38. package/selection/transformation.js +42 -44
  39. package/selection/transformation.mjs +42 -44
  40. package/shortcutContexts/grid.js +4 -0
  41. package/shortcutContexts/grid.mjs +4 -0
  42. package/utils/parseTable.js +527 -83
  43. package/utils/parseTable.mjs +523 -82
  44. package/plugins/copyPaste/clipboardData.js +0 -18
  45. package/plugins/copyPaste/clipboardData.mjs +0 -14
  46. package/plugins/copyPaste/pasteEvent.js +0 -14
  47. package/plugins/copyPaste/pasteEvent.mjs +0 -9
@@ -0,0 +1,517 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ require("core-js/modules/es.error.cause.js");
5
+ var _mixed = require("../../../helpers/mixed");
6
+ var _object = require("../../../helpers/object");
7
+ var _templateLiteralTag = require("../../../helpers/templateLiteralTag");
8
+ var _console = require("../../../helpers/console");
9
+ var _parseTable = require("../../../utils/parseTable");
10
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
12
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
+ const META_HEAD = ['<meta name="generator" content="Handsontable"/>', '<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join('');
14
+
15
+ /**
16
+ * Creates an object containing information about performed action: copy, cut (performing also copying) or paste.
17
+ *
18
+ * @private
19
+ */
20
+ exports.META_HEAD = META_HEAD;
21
+ class ClipboardData {
22
+ constructor() {
23
+ /**
24
+ * Sanitized data of "text/html" type inside the clipboard.
25
+ *
26
+ * @private
27
+ * @type {string}
28
+ */
29
+ _defineProperty(this, "html", void 0);
30
+ /**
31
+ * Copied data stored as array of arrays.
32
+ *
33
+ * @private
34
+ * @type {string[][]}
35
+ */
36
+ _defineProperty(this, "data", void 0);
37
+ if (this.constructor === ClipboardData) {
38
+ throw new Error('The `ClipboardData` is an abstract class and it can\'t be instantiated. Please use ' + '`CopyClipboardData` or `PasteClipboardData` classes instead.');
39
+ }
40
+ }
41
+
42
+ /**
43
+ * Gets copied data stored as array of arrays.
44
+ *
45
+ * @returns {string[][]}
46
+ */
47
+ getData() {
48
+ return (0, _object.deepClone)(this.data);
49
+ }
50
+
51
+ /**
52
+ * Gets meta information about copied data.
53
+ *
54
+ * @returns {object} Object containing `data`, `colHeaders`, `rowHeaders`, `nestedHeaders`, `mergeCells` keys and
55
+ * the corresponding values.
56
+ */
57
+ getMetaInfo() {
58
+ return (0, _parseTable.htmlToGridSettings)(this.html);
59
+ }
60
+
61
+ /**
62
+ * Overwrite stored data basing on handled configuration.
63
+ *
64
+ * @private
65
+ * @param {object} config Configuration.
66
+ */
67
+ overwriteInfo(config) {
68
+ this.html = [this.isSerializedHandsontable() ? META_HEAD : '', (0, _parseTable.getHTMLFromConfig)(config)].join('');
69
+ this.data = (0, _parseTable.getDataWithHeadersByConfig)(config);
70
+ }
71
+
72
+ /**
73
+ * Adjust information about merged cells after removing some columns.
74
+ *
75
+ * Note: Used indexes refers to processed data, not to the instance of Handsontable.
76
+ *
77
+ * @private
78
+ * @param {object} metaInfo Object containing `data`, `colHeaders`, `rowHeaders`, `nestedHeaders`, `mergeCells`
79
+ * keys and the corresponding values, which will be changed by the reference.
80
+ * @param {number[]} removedColumns List of column indexes which should be excluded when creating copy/cut/paste data.
81
+ */
82
+ adjustAfterColumnsRemoval(metaInfo, removedColumns) {
83
+ const mergedCells = metaInfo.mergeCells;
84
+ if ((0, _mixed.isDefined)(mergedCells) === false) {
85
+ return;
86
+ }
87
+ metaInfo.mergeCells = mergedCells.reduce((filteredNestedCells, mergeArea) => {
88
+ const {
89
+ col: mergeStartColumn,
90
+ colspan
91
+ } = mergeArea;
92
+ const removedMergedColumns = removedColumns.filter(column => column >= mergeStartColumn && column < mergeStartColumn + colspan);
93
+ const removedMergedColumnsLength = removedMergedColumns.length;
94
+ if (removedMergedColumnsLength === colspan) {
95
+ return filteredNestedCells;
96
+ } else if (colspan - removedMergedColumnsLength === 1) {
97
+ delete mergeArea.colspan;
98
+ } else if (removedMergedColumnsLength > 0) {
99
+ mergeArea.colspan = colspan - removedMergedColumnsLength;
100
+ }
101
+ if (Number.isInteger(mergeArea.rowspan) || Number.isInteger(mergeArea.colspan)) {
102
+ return filteredNestedCells.concat(mergeArea);
103
+ }
104
+ return filteredNestedCells;
105
+ }, []);
106
+ metaInfo.mergeCells.forEach(mergeArea => {
107
+ const shiftedColumns = removedColumns.filter(column => column < mergeArea.col);
108
+ const shifterColumnsLength = shiftedColumns.length;
109
+ mergeArea.col = mergeArea.col - shifterColumnsLength;
110
+ });
111
+ if (metaInfo.mergeCells.length === 0) {
112
+ delete metaInfo.mergeCells;
113
+ }
114
+ }
115
+
116
+ /**
117
+ * Adjust information about merged cells after removing some rows.
118
+ *
119
+ * Note: Used indexes refers to processed data, not to the instance of Handsontable.
120
+ *
121
+ * @private
122
+ * @param {object} metaInfo Object containing `data`, `colHeaders`, `rowHeaders`, `nestedHeaders`, `mergeCells`
123
+ * keys and the corresponding values, which will be changed by the reference.
124
+ * @param {number[]} removedRows List of row indexes which should be excluded when creating copy/cut/paste data.
125
+ */
126
+ adjustAfterRowRemoval(metaInfo, removedRows) {
127
+ const mergedCells = metaInfo.mergeCells;
128
+ if ((0, _mixed.isDefined)(mergedCells) === false) {
129
+ return;
130
+ }
131
+ metaInfo.mergeCells = mergedCells.reduce((filteredNestedCells, mergeArea) => {
132
+ const {
133
+ row: mergeStartRow,
134
+ rowspan
135
+ } = mergeArea;
136
+ const removedMergedRows = removedRows.filter(row => row >= mergeStartRow && row < mergeStartRow + rowspan);
137
+ const removedMergedRowsLength = removedMergedRows.length;
138
+ if (removedMergedRowsLength === rowspan) {
139
+ return filteredNestedCells;
140
+ } else if (rowspan - removedMergedRowsLength === 1) {
141
+ delete mergeArea.rowspan;
142
+ } else if (removedMergedRowsLength > 0) {
143
+ mergeArea.rowspan = rowspan - removedMergedRowsLength;
144
+ }
145
+ if (Number.isInteger(mergeArea.rowspan) || Number.isInteger(mergeArea.colspan)) {
146
+ return filteredNestedCells.concat(mergeArea);
147
+ }
148
+ return filteredNestedCells;
149
+ }, []);
150
+ metaInfo.mergeCells.forEach(mergeArea => {
151
+ const shiftedRows = removedRows.filter(row => row < mergeArea.row);
152
+ const shifterRowsLength = shiftedRows.length;
153
+ mergeArea.row = mergeArea.row - shifterRowsLength;
154
+ });
155
+ if (metaInfo.mergeCells.length === 0) {
156
+ delete metaInfo.mergeCells;
157
+ }
158
+ }
159
+
160
+ /**
161
+ * Remove rows from the serialized dataset.
162
+ *
163
+ * Note: Used indexes refers to processed data, not to the instance of Handsontable. Please keep in mind that headers
164
+ * are handled separately from cells and they are recognised using negative indexes.
165
+ *
166
+ * @param {number[]} rows List of row indexes which should be excluded when creating copy/cut/paste data.
167
+ */
168
+ removeRows(rows) {
169
+ if (this.isSerializedTable() === false) {
170
+ return;
171
+ }
172
+ const metaInfo = this.getMetaInfo();
173
+ this.adjustAfterRowRemoval(metaInfo, rows);
174
+ const config = {
175
+ ...metaInfo,
176
+ excludedRows: rows
177
+ };
178
+ this.overwriteInfo(config);
179
+ }
180
+
181
+ /**
182
+ * Remove columns from the serialized dataset.
183
+ *
184
+ * Note: Used indexes refers to processed data, not to the instance of Handsontable. Please keep in mind that headers
185
+ * are handled separately from cells and they are recognised using negative indexes.
186
+ *
187
+ * @param {number[]} columns List of column indexes which should be excluded when creating copy/cut/paste data.
188
+ */
189
+ removeColumns(columns) {
190
+ if (this.isSerializedTable() === false) {
191
+ return;
192
+ }
193
+ const metaInfo = this.getMetaInfo();
194
+ const {
195
+ nestedHeaders,
196
+ colHeaders
197
+ } = metaInfo;
198
+ if (Array.isArray(nestedHeaders) && columns.length > 0) {
199
+ (0, _console.warn)('It\'s not possible to modify copied dataset containing nested headers.');
200
+ return;
201
+ }
202
+ if (Array.isArray(colHeaders) && columns.length > 0) {
203
+ metaInfo.colHeaders = colHeaders.filter(columnIndex => columns.includes(columnIndex) === false);
204
+ }
205
+ this.adjustAfterColumnsRemoval(metaInfo, columns);
206
+ const config = {
207
+ ...metaInfo,
208
+ excludedColumns: columns
209
+ };
210
+ this.overwriteInfo(config);
211
+ }
212
+
213
+ /**
214
+ * Get warning message when there is some problem with row insertion or undefined otherwise.
215
+ *
216
+ * @private
217
+ * @param {number} rowIndex An index of the row at which the new values will be inserted.
218
+ * @param {string[]} values List of values.
219
+ * @returns {undefined|string}
220
+ */
221
+ getRowInsertionWarn(rowIndex, values) {
222
+ const metaInfo = this.getMetaInfo();
223
+ const data = metaInfo.data;
224
+ const insertedElementsCount = values.length;
225
+ if (Array.isArray(data) === false) {
226
+ const {
227
+ nestedHeaders,
228
+ colHeaders
229
+ } = metaInfo;
230
+ if (rowIndex > 0) {
231
+ return (0, _templateLiteralTag.toSingleLine)`Invalid row insertion done inside some \`CopyPaste\` hook. There is no possibility to\x20
232
+ expand an empty dataset at position higher than zero.`;
233
+ }
234
+ if (Array.isArray(nestedHeaders) && nestedHeaders[0].length !== insertedElementsCount || Array.isArray(colHeaders) && colHeaders.length !== insertedElementsCount) {
235
+ return (0, _templateLiteralTag.toSingleLine)`Invalid row insertion done inside some \`CopyPaste\` hook. Please provide proper number\x20
236
+ of elements (corresponding to size of the dataset in other rows) for inserted rows.`;
237
+ }
238
+ return;
239
+ }
240
+ const numberOfRows = data.length;
241
+ const numberOfColumns = data[0].length;
242
+ if (rowIndex > numberOfRows) {
243
+ return (0, _templateLiteralTag.toSingleLine)`Invalid row insertion done inside some \`CopyPaste\` hook. Please provide an valid row\x20
244
+ index (not too high) for row data insertion.`;
245
+ }
246
+ if (numberOfColumns !== insertedElementsCount) {
247
+ return (0, _templateLiteralTag.toSingleLine)`Invalid row insertion done inside some \`CopyPaste\` hook. Please provide proper number of\x20
248
+ elements (corresponding to size of the dataset in other rows) for inserted rows.`;
249
+ }
250
+ }
251
+
252
+ /**
253
+ * Adjust information about merged cells after row insertion.
254
+ *
255
+ * Note: Used index refers to processed data, not to the instance of Handsontable.
256
+ *
257
+ * @private
258
+ * @param {object} metaInfo Object containing `data`, `colHeaders`, `rowHeaders`, `nestedHeaders`, `mergeCells`
259
+ * keys and the corresponding values, which will be changed by the reference.
260
+ * @param {number} rowIndex An index of the row at which the new values have been inserted.
261
+ */
262
+ adjustAfterRowInsertion(metaInfo, rowIndex) {
263
+ const {
264
+ mergeCells: mergedCells,
265
+ data
266
+ } = metaInfo;
267
+ mergedCells === null || mergedCells === void 0 || mergedCells.forEach(mergeArea => {
268
+ const {
269
+ row: mergeStartRow,
270
+ col: mergeStartColumn,
271
+ rowspan,
272
+ colspan
273
+ } = mergeArea;
274
+ if (rowIndex > mergeStartRow && rowIndex < mergeStartRow + rowspan) {
275
+ mergeArea.rowspan += 1;
276
+ for (let i = 0; i < colspan; i += 1) {
277
+ data[rowIndex][mergeStartColumn + i] = '';
278
+ }
279
+ }
280
+ });
281
+ mergedCells === null || mergedCells === void 0 || mergedCells.forEach(mergeArea => {
282
+ if (rowIndex <= mergeArea.row) {
283
+ mergeArea.row += 1;
284
+ }
285
+ });
286
+ }
287
+
288
+ /**
289
+ * Insert values at row index.
290
+ *
291
+ * Note: Used index refers to processed data, not to the instance of Handsontable.
292
+ *
293
+ * @param {number} rowIndex An index of the row at which the new values will be inserted.
294
+ * @param {string[]} values List of values.
295
+ */
296
+ insertAtRow(rowIndex, values) {
297
+ if (this.isSerializedTable() === false) {
298
+ return;
299
+ }
300
+ const metaInfo = this.getMetaInfo();
301
+ const data = metaInfo.data || [];
302
+ const rowInsertionWarn = this.getRowInsertionWarn(rowIndex, values);
303
+ if ((0, _mixed.isDefined)(rowInsertionWarn)) {
304
+ (0, _console.warn)(rowInsertionWarn);
305
+ return;
306
+ }
307
+ metaInfo.data = [...data.slice(0, rowIndex), values, ...data.slice(rowIndex)];
308
+ this.adjustAfterRowInsertion(metaInfo, rowIndex);
309
+ this.overwriteInfo(metaInfo);
310
+ }
311
+
312
+ /**
313
+ * Get warning message when there is some problem with row insertion or undefined otherwise.
314
+ *
315
+ * @private
316
+ * @param {number} columnIndex An index of the column at which the new values will be inserted or removed.
317
+ * @param {string[]} values List of values.
318
+ * @returns {undefined|string}
319
+ */
320
+ getColumnInsertionWarn(columnIndex, values) {
321
+ const {
322
+ nestedHeaders,
323
+ data,
324
+ colHeaders
325
+ } = this.getMetaInfo();
326
+ const headerLevels = (0, _mixed.isDefined)(colHeaders) ? 1 : 0;
327
+ if (Array.isArray(nestedHeaders)) {
328
+ return (0, _templateLiteralTag.toSingleLine)`Invalid column insertion done inside some \`CopyPaste\` hook. It's not possible to modify\x20
329
+ copied dataset containing nested headers`;
330
+ }
331
+ if (Array.isArray(data) === false) {
332
+ return;
333
+ }
334
+ const numberOfRows = data.length + headerLevels;
335
+ const numberOfColumns = data[0].length;
336
+ if (columnIndex > numberOfColumns) {
337
+ return (0, _templateLiteralTag.toSingleLine)`Invalid column insertion done inside some \`CopyPaste\` hook. Please provide an valid\x20
338
+ column index (not too high) for column data insertion.`;
339
+ }
340
+ if (values.length !== numberOfRows) {
341
+ return (0, _templateLiteralTag.toSingleLine)`Invalid column insertion done inside some \`CopyPaste\` hook. Please provide proper number\x20
342
+ of elements (corresponding to size of the dataset in other columns, including headers) for inserted columns.`;
343
+ }
344
+ }
345
+
346
+ /**
347
+ * Adjust information about merged cells after column insertion.
348
+ *
349
+ * Note: Used index refers to processed data, not to the instance of Handsontable.
350
+ *
351
+ * @private
352
+ * @param {object} metaInfo Object containing `data`, `colHeaders`, `rowHeaders`, `nestedHeaders`, `mergeCells`
353
+ * keys and the corresponding values, which will be changed by the reference.
354
+ * @param {number} columnIndex An index of the column at which the new values have been inserted.
355
+ */
356
+ adjustAfterColumnInsertion(metaInfo, columnIndex) {
357
+ const {
358
+ mergeCells: mergedCells,
359
+ data
360
+ } = metaInfo;
361
+ mergedCells === null || mergedCells === void 0 || mergedCells.forEach(mergeArea => {
362
+ const {
363
+ row: mergeStartRow,
364
+ col: mergeStartColumn,
365
+ colspan,
366
+ rowspan
367
+ } = mergeArea;
368
+ if (columnIndex > mergeStartColumn && columnIndex < mergeStartColumn + colspan) {
369
+ mergeArea.colspan += 1;
370
+ for (let i = 0; i < rowspan; i += 1) {
371
+ data[mergeStartRow + i][columnIndex] = '';
372
+ }
373
+ }
374
+ });
375
+ mergedCells === null || mergedCells === void 0 || mergedCells.forEach(mergeArea => {
376
+ if (columnIndex <= mergeArea.col) {
377
+ mergeArea.col += 1;
378
+ }
379
+ });
380
+ }
381
+
382
+ /**
383
+ * Insert values at column index.
384
+ *
385
+ * Note: Used index refers to processed data, not to the instance of Handsontable.
386
+ *
387
+ * @param {number} columnIndex An index of the column at which the new values will be inserted or removed.
388
+ * @param {string[]} values List of values.
389
+ */
390
+ insertAtColumn(columnIndex, values) {
391
+ if (this.isSerializedTable() === false) {
392
+ return;
393
+ }
394
+ const metaInfo = this.getMetaInfo();
395
+ const {
396
+ data,
397
+ colHeaders
398
+ } = metaInfo;
399
+ const headerLevels = (0, _mixed.isDefined)(colHeaders) ? 1 : 0;
400
+ const columnInsertionWarn = this.getColumnInsertionWarn(columnIndex, values);
401
+ if ((0, _mixed.isDefined)(columnInsertionWarn)) {
402
+ (0, _console.warn)(columnInsertionWarn);
403
+ return;
404
+ }
405
+ if (headerLevels > 0) {
406
+ colHeaders.splice(columnIndex, 0, values[0]);
407
+ }
408
+ data === null || data === void 0 || data.forEach((rowData, rowIndex) => {
409
+ rowData.splice(columnIndex, 0, values[rowIndex + headerLevels]);
410
+ });
411
+ this.adjustAfterColumnInsertion(metaInfo, columnIndex);
412
+ this.overwriteInfo(metaInfo);
413
+ }
414
+
415
+ /**
416
+ * Change headers or cells in the serialized dataset.
417
+ *
418
+ * Note: Used indexes refers to processed data, not to the instance of Handsontable. Please keep in mind that headers
419
+ * are handled separately from cells and they are recognised using negative indexes.
420
+ *
421
+ * @param {number} row Row index of cell which should be changed.
422
+ * @param {number} column Column index of cell which should be changed.
423
+ * @param {string} value Value for particular indexes.
424
+ */
425
+ setCellAt(row, column, value) {
426
+ if (this.isSerializedTable() === false) {
427
+ return;
428
+ }
429
+ const config = this.getMetaInfo();
430
+ const {
431
+ data,
432
+ nestedHeaders,
433
+ colHeaders
434
+ } = config;
435
+ if (row < 0) {
436
+ if (Array.isArray(nestedHeaders)) {
437
+ const rowRelative = row + nestedHeaders.length;
438
+ if (Array.isArray(nestedHeaders[rowRelative]) && (0, _mixed.isDefined)(nestedHeaders[rowRelative][column])) {
439
+ nestedHeaders[rowRelative][column] = value;
440
+ }
441
+ } else if (Array.isArray(colHeaders)) {
442
+ if ((0, _mixed.isDefined)(colHeaders[column])) {
443
+ colHeaders[column] = value;
444
+ }
445
+ }
446
+ } else if (row >= 0 && Array.isArray(data) && Array.isArray(data[row]) && (0, _mixed.isDefined)(data[row][column])) {
447
+ data[row][column] = value;
448
+ }
449
+ this.overwriteInfo(config);
450
+ }
451
+
452
+ /**
453
+ * Gets header or cell values from the serialized dataset.
454
+ *
455
+ * Note: Used indexes refers to processed data, not to the instance of Handsontable. Please keep in mind that headers
456
+ * are handled separately from cells and they are recognised using negative indexes.
457
+ *
458
+ * @param {number} row Row index of cell which should be get.
459
+ * @param {number} column Column index of cell which should be get.
460
+ * @returns {undefined|string}
461
+ */
462
+ getCellAt(row, column) {
463
+ if (this.isSerializedTable() === false) {
464
+ return;
465
+ }
466
+ const config = this.getMetaInfo();
467
+ const {
468
+ data,
469
+ nestedHeaders,
470
+ colHeaders
471
+ } = config;
472
+ if (row < 0) {
473
+ if (Array.isArray(nestedHeaders)) {
474
+ const rowRelative = row + nestedHeaders.length;
475
+ if (Array.isArray(nestedHeaders[rowRelative]) && (0, _mixed.isDefined)(nestedHeaders[rowRelative][column])) {
476
+ return nestedHeaders[rowRelative][column];
477
+ }
478
+ } else if (Array.isArray(colHeaders)) {
479
+ if ((0, _mixed.isDefined)(colHeaders[column])) {
480
+ return colHeaders[column];
481
+ }
482
+ }
483
+ } else if (row >= 0 && Array.isArray(data) && Array.isArray(data[row]) && (0, _mixed.isDefined)(data[row][column])) {
484
+ return data[row][column];
485
+ }
486
+ }
487
+
488
+ /**
489
+ * Checks whether serialized data is an array.
490
+ *
491
+ * @private
492
+ * @returns {boolean}
493
+ */
494
+ isSerializedTable() {
495
+ return true;
496
+ }
497
+
498
+ /**
499
+ * Checks whether serialized data is a Handsontable.
500
+ *
501
+ * @private
502
+ * @returns {boolean}
503
+ */
504
+ isSerializedHandsontable() {
505
+ return true;
506
+ }
507
+
508
+ /**
509
+ * Gets source of the copied data.
510
+ *
511
+ * @returns {string}
512
+ */
513
+ getType() {
514
+ return 'handsontable';
515
+ }
516
+ }
517
+ exports.ClipboardData = ClipboardData;