handsontable 0.0.0-next-820d8a2-20221122 → 0.0.0-next-6812ce6-20221122
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/range.js +8 -0
- package/3rdparty/walkontable/src/cell/range.mjs +8 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +1 -1
- package/core.js +37 -29
- package/core.mjs +37 -29
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +3135 -2444
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +62 -62
- package/dist/handsontable.js +2563 -1872
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +3 -3
- package/dist/languages/all.js +1 -1
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/en-US.js +1 -1
- package/dist/languages/en-US.min.js +1 -1
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/i18n/constants.js +49 -42
- package/i18n/constants.mjs +45 -41
- package/i18n/languages/en-US.js +1 -1
- package/i18n/languages/en-US.mjs +1 -1
- package/languages/all.js +1 -1
- package/languages/en-US.js +1 -1
- package/languages/en-US.mjs +1 -1
- package/languages/index.js +1 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +7 -2
- package/pluginHooks.js +23 -3
- package/pluginHooks.mjs +23 -3
- package/plugins/contextMenu/contextMenu.d.ts +4 -3
- package/plugins/copyPaste/contextMenuItem/copy.js +4 -16
- package/plugins/copyPaste/contextMenuItem/copy.mjs +4 -4
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +35 -0
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +31 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +35 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +31 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +35 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +31 -0
- package/plugins/copyPaste/copyPaste.d.ts +10 -2
- package/plugins/copyPaste/copyPaste.js +263 -173
- package/plugins/copyPaste/copyPaste.mjs +263 -173
- package/plugins/copyPaste/copyableRanges.js +260 -0
- package/plugins/copyPaste/copyableRanges.mjs +255 -0
- package/plugins/nestedHeaders/nestedHeaders.js +114 -11
- package/plugins/nestedHeaders/nestedHeaders.mjs +114 -11
- package/plugins/nestedHeaders/stateManager/headersTree.js +1 -0
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +1 -0
- package/plugins/nestedHeaders/stateManager/index.js +21 -10
- package/plugins/nestedHeaders/stateManager/index.mjs +21 -10
- package/selection/selection.js +2 -1
- package/selection/selection.mjs +2 -1
- package/tableView.js +133 -63
- package/tableView.mjs +133 -63
@@ -176,9 +176,15 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
176
176
|
this.addHook('modifyColWidth', function () {
|
177
177
|
return _this2.onModifyColWidth.apply(_this2, arguments);
|
178
178
|
});
|
179
|
+
this.addHook('modifyColumnHeaderValue', function () {
|
180
|
+
return _this2.onModifyColumnHeaderValue.apply(_this2, arguments);
|
181
|
+
});
|
179
182
|
this.addHook('beforeHighlightingColumnHeader', function () {
|
180
183
|
return _this2.onBeforeHighlightingColumnHeader.apply(_this2, arguments);
|
181
184
|
});
|
185
|
+
this.addHook('beforeCopy', function () {
|
186
|
+
return _this2.onBeforeCopy.apply(_this2, arguments);
|
187
|
+
});
|
182
188
|
this.addHook('afterViewportColumnCalculatorOverride', function () {
|
183
189
|
return _this2.onAfterViewportColumnCalculatorOverride.apply(_this2, arguments);
|
184
190
|
});
|
@@ -347,17 +353,16 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
347
353
|
var _this4$hot = _this4.hot,
|
348
354
|
columnIndexMapper = _this4$hot.columnIndexMapper,
|
349
355
|
view = _this4$hot.view;
|
350
|
-
var
|
351
|
-
if (
|
352
|
-
|
356
|
+
var visualColumnIndex = columnIndexMapper.getVisualFromRenderableIndex(renderedColumnIndex);
|
357
|
+
if (visualColumnIndex === null) {
|
358
|
+
visualColumnIndex = renderedColumnIndex;
|
353
359
|
}
|
354
360
|
TH.removeAttribute('colspan');
|
355
361
|
(0, _element.removeClass)(TH, 'hiddenHeader');
|
356
|
-
var _ref2 = (_classPrivateFieldGet2 = _classPrivateFieldGet(_this4, _stateManager).getHeaderSettings(headerLevel,
|
362
|
+
var _ref2 = (_classPrivateFieldGet2 = _classPrivateFieldGet(_this4, _stateManager).getHeaderSettings(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : {
|
357
363
|
label: ''
|
358
364
|
},
|
359
365
|
colspan = _ref2.colspan,
|
360
|
-
label = _ref2.label,
|
361
366
|
isHidden = _ref2.isHidden,
|
362
367
|
isPlaceholder = _ref2.isPlaceholder;
|
363
368
|
if (isPlaceholder || isHidden) {
|
@@ -374,12 +379,36 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
374
379
|
TH.setAttribute('colspan', correctedColspan);
|
375
380
|
}
|
376
381
|
}
|
377
|
-
_this4.hot.view.appendColHeader(
|
378
|
-
return
|
382
|
+
_this4.hot.view.appendColHeader(visualColumnIndex, TH, function () {
|
383
|
+
return _this4.getColumnHeaderValue.apply(_this4, arguments);
|
379
384
|
}, headerLevel);
|
380
385
|
};
|
381
386
|
}
|
382
387
|
|
388
|
+
/**
|
389
|
+
* Returns the column header value for specified column and header level index.
|
390
|
+
*
|
391
|
+
* @private
|
392
|
+
* @param {number} visualColumnIndex Visual column index.
|
393
|
+
* @param {number} headerLevel The index of header level. The header level accepts positive (0 to N)
|
394
|
+
* and negative (-1 to -N) values. For positive values, 0 points to the
|
395
|
+
* top most header, and for negative direction, -1 points to the most bottom
|
396
|
+
* header (the header closest to the cells).
|
397
|
+
* @returns {string} Returns the column header value to update.
|
398
|
+
*/
|
399
|
+
}, {
|
400
|
+
key: "getColumnHeaderValue",
|
401
|
+
value: function getColumnHeaderValue(visualColumnIndex, headerLevel) {
|
402
|
+
var _classPrivateFieldGet3;
|
403
|
+
var _ref3 = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet3 !== void 0 ? _classPrivateFieldGet3 : {},
|
404
|
+
isHidden = _ref3.isHidden,
|
405
|
+
isPlaceholder = _ref3.isPlaceholder;
|
406
|
+
if (isPlaceholder || isHidden) {
|
407
|
+
return '';
|
408
|
+
}
|
409
|
+
return this.hot.getColHeader(visualColumnIndex, headerLevel);
|
410
|
+
}
|
411
|
+
|
383
412
|
/**
|
384
413
|
* Allows to control which header DOM element will be used to highlight.
|
385
414
|
*
|
@@ -400,9 +429,9 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
400
429
|
columnCursor = highlightMeta.columnCursor,
|
401
430
|
selectionType = highlightMeta.selectionType,
|
402
431
|
selectionWidth = highlightMeta.selectionWidth;
|
403
|
-
var
|
404
|
-
isRoot =
|
405
|
-
colspan =
|
432
|
+
var _classPrivateFieldGet4 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumn),
|
433
|
+
isRoot = _classPrivateFieldGet4.isRoot,
|
434
|
+
colspan = _classPrivateFieldGet4.colspan;
|
406
435
|
if (selectionType === _selection.HEADER_TYPE) {
|
407
436
|
if (!isRoot) {
|
408
437
|
return headerNodeData.columnIndex;
|
@@ -417,7 +446,57 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
417
446
|
}
|
418
447
|
|
419
448
|
/**
|
420
|
-
*
|
449
|
+
* Listens the `beforeCopy` hook that allows processing the copied column headers so that the
|
450
|
+
* merged column headers do not propagate the value for each column but only once at the beginning
|
451
|
+
* of the column.
|
452
|
+
*
|
453
|
+
* @private
|
454
|
+
* @param {Array[]} data An array of arrays which contains data to copied.
|
455
|
+
* @param {object[]} copyableRanges An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
456
|
+
* which will copied.
|
457
|
+
* @param {{ columnHeadersCount: number }} copiedHeadersCount An object with keys that holds information with
|
458
|
+
* the number of copied headers.
|
459
|
+
*/
|
460
|
+
}, {
|
461
|
+
key: "onBeforeCopy",
|
462
|
+
value: function onBeforeCopy(data, copyableRanges, _ref4) {
|
463
|
+
var columnHeadersCount = _ref4.columnHeadersCount;
|
464
|
+
if (columnHeadersCount === 0) {
|
465
|
+
return;
|
466
|
+
}
|
467
|
+
for (var rangeIndex = 0; rangeIndex < copyableRanges.length; rangeIndex++) {
|
468
|
+
var _copyableRanges$range = copyableRanges[rangeIndex],
|
469
|
+
startRow = _copyableRanges$range.startRow,
|
470
|
+
startCol = _copyableRanges$range.startCol,
|
471
|
+
endRow = _copyableRanges$range.endRow,
|
472
|
+
endCol = _copyableRanges$range.endCol;
|
473
|
+
var rowsCount = endRow - startRow + 1;
|
474
|
+
var columnsCount = startCol - endCol + 1;
|
475
|
+
|
476
|
+
// do not process dataset ranges and column headers where only one column is copied
|
477
|
+
if (startRow >= 0 || columnsCount === 1) {
|
478
|
+
break;
|
479
|
+
}
|
480
|
+
for (var column = startCol; column <= endCol; column++) {
|
481
|
+
for (var row = startRow; row <= endRow; row++) {
|
482
|
+
var _classPrivateFieldGet5;
|
483
|
+
var zeroBasedColumnHeaderLevel = rowsCount + row;
|
484
|
+
var zeroBasedColumnIndex = column - startCol;
|
485
|
+
if (zeroBasedColumnIndex === 0) {
|
486
|
+
continue; // eslint-disable-line no-continue
|
487
|
+
}
|
488
|
+
|
489
|
+
var isRoot = (_classPrivateFieldGet5 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(row, column)) === null || _classPrivateFieldGet5 === void 0 ? void 0 : _classPrivateFieldGet5.isRoot;
|
490
|
+
if (isRoot === false) {
|
491
|
+
data[zeroBasedColumnHeaderLevel][zeroBasedColumnIndex] = '';
|
492
|
+
}
|
493
|
+
}
|
494
|
+
}
|
495
|
+
}
|
496
|
+
}
|
497
|
+
|
498
|
+
/**
|
499
|
+
* Allows blocking the column selection that is controlled by the core Selection module.
|
421
500
|
*
|
422
501
|
* @private
|
423
502
|
* @param {MouseEvent} event Mouse event.
|
@@ -586,6 +665,30 @@ var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
586
665
|
return width > cachedWidth ? width : cachedWidth;
|
587
666
|
}
|
588
667
|
|
668
|
+
/**
|
669
|
+
* Listens the `modifyColumnHeaderValue` hook that overwrites the column headers values based on
|
670
|
+
* the internal state and settings of the plugin.
|
671
|
+
*
|
672
|
+
* @private
|
673
|
+
* @param {string} value The column header value.
|
674
|
+
* @param {number} visualColumnIndex The visual column index.
|
675
|
+
* @param {number} headerLevel The index of header level. The header level accepts positive (0 to N)
|
676
|
+
* and negative (-1 to -N) values. For positive values, 0 points to the
|
677
|
+
* top most header, and for negative direction, -1 points to the most bottom
|
678
|
+
* header (the header closest to the cells).
|
679
|
+
* @returns {string} Returns the column header value to update.
|
680
|
+
*/
|
681
|
+
}, {
|
682
|
+
key: "onModifyColumnHeaderValue",
|
683
|
+
value: function onModifyColumnHeaderValue(value, visualColumnIndex, headerLevel) {
|
684
|
+
var _classPrivateFieldGet6;
|
685
|
+
var _ref5 = (_classPrivateFieldGet6 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet6 !== void 0 ? _classPrivateFieldGet6 : {
|
686
|
+
label: ''
|
687
|
+
},
|
688
|
+
label = _ref5.label;
|
689
|
+
return label;
|
690
|
+
}
|
691
|
+
|
589
692
|
/**
|
590
693
|
* Updates the plugin state after HoT initialization.
|
591
694
|
*
|
@@ -169,9 +169,15 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
169
169
|
this.addHook('modifyColWidth', function () {
|
170
170
|
return _this2.onModifyColWidth.apply(_this2, arguments);
|
171
171
|
});
|
172
|
+
this.addHook('modifyColumnHeaderValue', function () {
|
173
|
+
return _this2.onModifyColumnHeaderValue.apply(_this2, arguments);
|
174
|
+
});
|
172
175
|
this.addHook('beforeHighlightingColumnHeader', function () {
|
173
176
|
return _this2.onBeforeHighlightingColumnHeader.apply(_this2, arguments);
|
174
177
|
});
|
178
|
+
this.addHook('beforeCopy', function () {
|
179
|
+
return _this2.onBeforeCopy.apply(_this2, arguments);
|
180
|
+
});
|
175
181
|
this.addHook('afterViewportColumnCalculatorOverride', function () {
|
176
182
|
return _this2.onAfterViewportColumnCalculatorOverride.apply(_this2, arguments);
|
177
183
|
});
|
@@ -340,17 +346,16 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
340
346
|
var _this4$hot = _this4.hot,
|
341
347
|
columnIndexMapper = _this4$hot.columnIndexMapper,
|
342
348
|
view = _this4$hot.view;
|
343
|
-
var
|
344
|
-
if (
|
345
|
-
|
349
|
+
var visualColumnIndex = columnIndexMapper.getVisualFromRenderableIndex(renderedColumnIndex);
|
350
|
+
if (visualColumnIndex === null) {
|
351
|
+
visualColumnIndex = renderedColumnIndex;
|
346
352
|
}
|
347
353
|
TH.removeAttribute('colspan');
|
348
354
|
removeClass(TH, 'hiddenHeader');
|
349
|
-
var _ref2 = (_classPrivateFieldGet2 = _classPrivateFieldGet(_this4, _stateManager).getHeaderSettings(headerLevel,
|
355
|
+
var _ref2 = (_classPrivateFieldGet2 = _classPrivateFieldGet(_this4, _stateManager).getHeaderSettings(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : {
|
350
356
|
label: ''
|
351
357
|
},
|
352
358
|
colspan = _ref2.colspan,
|
353
|
-
label = _ref2.label,
|
354
359
|
isHidden = _ref2.isHidden,
|
355
360
|
isPlaceholder = _ref2.isPlaceholder;
|
356
361
|
if (isPlaceholder || isHidden) {
|
@@ -367,12 +372,36 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
367
372
|
TH.setAttribute('colspan', correctedColspan);
|
368
373
|
}
|
369
374
|
}
|
370
|
-
_this4.hot.view.appendColHeader(
|
371
|
-
return
|
375
|
+
_this4.hot.view.appendColHeader(visualColumnIndex, TH, function () {
|
376
|
+
return _this4.getColumnHeaderValue.apply(_this4, arguments);
|
372
377
|
}, headerLevel);
|
373
378
|
};
|
374
379
|
}
|
375
380
|
|
381
|
+
/**
|
382
|
+
* Returns the column header value for specified column and header level index.
|
383
|
+
*
|
384
|
+
* @private
|
385
|
+
* @param {number} visualColumnIndex Visual column index.
|
386
|
+
* @param {number} headerLevel The index of header level. The header level accepts positive (0 to N)
|
387
|
+
* and negative (-1 to -N) values. For positive values, 0 points to the
|
388
|
+
* top most header, and for negative direction, -1 points to the most bottom
|
389
|
+
* header (the header closest to the cells).
|
390
|
+
* @returns {string} Returns the column header value to update.
|
391
|
+
*/
|
392
|
+
}, {
|
393
|
+
key: "getColumnHeaderValue",
|
394
|
+
value: function getColumnHeaderValue(visualColumnIndex, headerLevel) {
|
395
|
+
var _classPrivateFieldGet3;
|
396
|
+
var _ref3 = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet3 !== void 0 ? _classPrivateFieldGet3 : {},
|
397
|
+
isHidden = _ref3.isHidden,
|
398
|
+
isPlaceholder = _ref3.isPlaceholder;
|
399
|
+
if (isPlaceholder || isHidden) {
|
400
|
+
return '';
|
401
|
+
}
|
402
|
+
return this.hot.getColHeader(visualColumnIndex, headerLevel);
|
403
|
+
}
|
404
|
+
|
376
405
|
/**
|
377
406
|
* Allows to control which header DOM element will be used to highlight.
|
378
407
|
*
|
@@ -393,9 +422,9 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
393
422
|
columnCursor = highlightMeta.columnCursor,
|
394
423
|
selectionType = highlightMeta.selectionType,
|
395
424
|
selectionWidth = highlightMeta.selectionWidth;
|
396
|
-
var
|
397
|
-
isRoot =
|
398
|
-
colspan =
|
425
|
+
var _classPrivateFieldGet4 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumn),
|
426
|
+
isRoot = _classPrivateFieldGet4.isRoot,
|
427
|
+
colspan = _classPrivateFieldGet4.colspan;
|
399
428
|
if (selectionType === HEADER_TYPE) {
|
400
429
|
if (!isRoot) {
|
401
430
|
return headerNodeData.columnIndex;
|
@@ -410,7 +439,57 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
410
439
|
}
|
411
440
|
|
412
441
|
/**
|
413
|
-
*
|
442
|
+
* Listens the `beforeCopy` hook that allows processing the copied column headers so that the
|
443
|
+
* merged column headers do not propagate the value for each column but only once at the beginning
|
444
|
+
* of the column.
|
445
|
+
*
|
446
|
+
* @private
|
447
|
+
* @param {Array[]} data An array of arrays which contains data to copied.
|
448
|
+
* @param {object[]} copyableRanges An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
449
|
+
* which will copied.
|
450
|
+
* @param {{ columnHeadersCount: number }} copiedHeadersCount An object with keys that holds information with
|
451
|
+
* the number of copied headers.
|
452
|
+
*/
|
453
|
+
}, {
|
454
|
+
key: "onBeforeCopy",
|
455
|
+
value: function onBeforeCopy(data, copyableRanges, _ref4) {
|
456
|
+
var columnHeadersCount = _ref4.columnHeadersCount;
|
457
|
+
if (columnHeadersCount === 0) {
|
458
|
+
return;
|
459
|
+
}
|
460
|
+
for (var rangeIndex = 0; rangeIndex < copyableRanges.length; rangeIndex++) {
|
461
|
+
var _copyableRanges$range = copyableRanges[rangeIndex],
|
462
|
+
startRow = _copyableRanges$range.startRow,
|
463
|
+
startCol = _copyableRanges$range.startCol,
|
464
|
+
endRow = _copyableRanges$range.endRow,
|
465
|
+
endCol = _copyableRanges$range.endCol;
|
466
|
+
var rowsCount = endRow - startRow + 1;
|
467
|
+
var columnsCount = startCol - endCol + 1;
|
468
|
+
|
469
|
+
// do not process dataset ranges and column headers where only one column is copied
|
470
|
+
if (startRow >= 0 || columnsCount === 1) {
|
471
|
+
break;
|
472
|
+
}
|
473
|
+
for (var column = startCol; column <= endCol; column++) {
|
474
|
+
for (var row = startRow; row <= endRow; row++) {
|
475
|
+
var _classPrivateFieldGet5;
|
476
|
+
var zeroBasedColumnHeaderLevel = rowsCount + row;
|
477
|
+
var zeroBasedColumnIndex = column - startCol;
|
478
|
+
if (zeroBasedColumnIndex === 0) {
|
479
|
+
continue; // eslint-disable-line no-continue
|
480
|
+
}
|
481
|
+
|
482
|
+
var isRoot = (_classPrivateFieldGet5 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(row, column)) === null || _classPrivateFieldGet5 === void 0 ? void 0 : _classPrivateFieldGet5.isRoot;
|
483
|
+
if (isRoot === false) {
|
484
|
+
data[zeroBasedColumnHeaderLevel][zeroBasedColumnIndex] = '';
|
485
|
+
}
|
486
|
+
}
|
487
|
+
}
|
488
|
+
}
|
489
|
+
}
|
490
|
+
|
491
|
+
/**
|
492
|
+
* Allows blocking the column selection that is controlled by the core Selection module.
|
414
493
|
*
|
415
494
|
* @private
|
416
495
|
* @param {MouseEvent} event Mouse event.
|
@@ -579,6 +658,30 @@ export var NestedHeaders = /*#__PURE__*/function (_BasePlugin) {
|
|
579
658
|
return width > cachedWidth ? width : cachedWidth;
|
580
659
|
}
|
581
660
|
|
661
|
+
/**
|
662
|
+
* Listens the `modifyColumnHeaderValue` hook that overwrites the column headers values based on
|
663
|
+
* the internal state and settings of the plugin.
|
664
|
+
*
|
665
|
+
* @private
|
666
|
+
* @param {string} value The column header value.
|
667
|
+
* @param {number} visualColumnIndex The visual column index.
|
668
|
+
* @param {number} headerLevel The index of header level. The header level accepts positive (0 to N)
|
669
|
+
* and negative (-1 to -N) values. For positive values, 0 points to the
|
670
|
+
* top most header, and for negative direction, -1 points to the most bottom
|
671
|
+
* header (the header closest to the cells).
|
672
|
+
* @returns {string} Returns the column header value to update.
|
673
|
+
*/
|
674
|
+
}, {
|
675
|
+
key: "onModifyColumnHeaderValue",
|
676
|
+
value: function onModifyColumnHeaderValue(value, visualColumnIndex, headerLevel) {
|
677
|
+
var _classPrivateFieldGet6;
|
678
|
+
var _ref5 = (_classPrivateFieldGet6 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet6 !== void 0 ? _classPrivateFieldGet6 : {
|
679
|
+
label: ''
|
680
|
+
},
|
681
|
+
label = _ref5.label;
|
682
|
+
return label;
|
683
|
+
}
|
684
|
+
|
582
685
|
/**
|
583
686
|
* Updates the plugin state after HoT initialization.
|
584
687
|
*
|
@@ -178,6 +178,7 @@ var HeadersTree = /*#__PURE__*/function () {
|
|
178
178
|
if (headerLevel === nodeHeaderLevel) {
|
179
179
|
if (normColumnIndex >= columnCursor && normColumnIndex <= columnCursor + origColspan - 1) {
|
180
180
|
treeNode = node;
|
181
|
+
treeNode.data.isRoot = columnIndex === treeNode.data.columnIndex;
|
181
182
|
return false; // Cancel tree traversing.
|
182
183
|
}
|
183
184
|
|
@@ -173,6 +173,7 @@ var HeadersTree = /*#__PURE__*/function () {
|
|
173
173
|
if (headerLevel === nodeHeaderLevel) {
|
174
174
|
if (normColumnIndex >= columnCursor && normColumnIndex <= columnCursor + origColspan - 1) {
|
175
175
|
treeNode = node;
|
176
|
+
treeNode.data.isRoot = columnIndex === treeNode.data.columnIndex;
|
176
177
|
return false; // Cancel tree traversing.
|
177
178
|
}
|
178
179
|
|
@@ -253,16 +253,20 @@ var StateManager = /*#__PURE__*/function () {
|
|
253
253
|
* │ │ │ │
|
254
254
|
*
|
255
255
|
* @param {number} rowIndex A visual row index.
|
256
|
-
* @returns {number} Returns unsigned number.
|
256
|
+
* @returns {number|null} Returns unsigned number.
|
257
257
|
*/
|
258
258
|
/* eslint-enable jsdoc/require-description-complete-sentence */
|
259
259
|
}, {
|
260
260
|
key: "rowCoordsToLevel",
|
261
261
|
value: function rowCoordsToLevel(rowIndex) {
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
262
|
+
if (rowIndex >= 0) {
|
263
|
+
return null;
|
264
|
+
}
|
265
|
+
var headerLevel = rowIndex + Math.max(this.getLayersCount(), 1);
|
266
|
+
if (headerLevel < 0) {
|
267
|
+
return null;
|
268
|
+
}
|
269
|
+
return headerLevel;
|
266
270
|
}
|
267
271
|
|
268
272
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
@@ -294,10 +298,14 @@ var StateManager = /*#__PURE__*/function () {
|
|
294
298
|
}, {
|
295
299
|
key: "levelToRowCoords",
|
296
300
|
value: function levelToRowCoords(headerLevel) {
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
+
if (headerLevel < 0) {
|
302
|
+
return null;
|
303
|
+
}
|
304
|
+
var rowIndex = headerLevel - Math.max(this.getLayersCount(), 1);
|
305
|
+
if (rowIndex >= 0) {
|
306
|
+
return null;
|
307
|
+
}
|
308
|
+
return rowIndex;
|
301
309
|
}
|
302
310
|
|
303
311
|
/**
|
@@ -316,7 +324,7 @@ var StateManager = /*#__PURE__*/function () {
|
|
316
324
|
if (headerLevel < 0) {
|
317
325
|
headerLevel = this.rowCoordsToLevel(headerLevel);
|
318
326
|
}
|
319
|
-
if (headerLevel >= this.getLayersCount()) {
|
327
|
+
if (headerLevel === null || headerLevel >= this.getLayersCount()) {
|
320
328
|
return null;
|
321
329
|
}
|
322
330
|
return (_classPrivateFieldGet2 = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _stateMatrix)[headerLevel]) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3[columnIndex]) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : null;
|
@@ -337,6 +345,9 @@ var StateManager = /*#__PURE__*/function () {
|
|
337
345
|
if (headerLevel < 0) {
|
338
346
|
headerLevel = this.rowCoordsToLevel(headerLevel);
|
339
347
|
}
|
348
|
+
if (headerLevel === null || headerLevel >= this.getLayersCount()) {
|
349
|
+
return null;
|
350
|
+
}
|
340
351
|
var node = _classPrivateFieldGet(this, _headersTree).getNode(headerLevel, columnIndex);
|
341
352
|
if (!node) {
|
342
353
|
return null;
|
@@ -248,16 +248,20 @@ var StateManager = /*#__PURE__*/function () {
|
|
248
248
|
* │ │ │ │
|
249
249
|
*
|
250
250
|
* @param {number} rowIndex A visual row index.
|
251
|
-
* @returns {number} Returns unsigned number.
|
251
|
+
* @returns {number|null} Returns unsigned number.
|
252
252
|
*/
|
253
253
|
/* eslint-enable jsdoc/require-description-complete-sentence */
|
254
254
|
}, {
|
255
255
|
key: "rowCoordsToLevel",
|
256
256
|
value: function rowCoordsToLevel(rowIndex) {
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
257
|
+
if (rowIndex >= 0) {
|
258
|
+
return null;
|
259
|
+
}
|
260
|
+
var headerLevel = rowIndex + Math.max(this.getLayersCount(), 1);
|
261
|
+
if (headerLevel < 0) {
|
262
|
+
return null;
|
263
|
+
}
|
264
|
+
return headerLevel;
|
261
265
|
}
|
262
266
|
|
263
267
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
@@ -289,10 +293,14 @@ var StateManager = /*#__PURE__*/function () {
|
|
289
293
|
}, {
|
290
294
|
key: "levelToRowCoords",
|
291
295
|
value: function levelToRowCoords(headerLevel) {
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
+
if (headerLevel < 0) {
|
297
|
+
return null;
|
298
|
+
}
|
299
|
+
var rowIndex = headerLevel - Math.max(this.getLayersCount(), 1);
|
300
|
+
if (rowIndex >= 0) {
|
301
|
+
return null;
|
302
|
+
}
|
303
|
+
return rowIndex;
|
296
304
|
}
|
297
305
|
|
298
306
|
/**
|
@@ -311,7 +319,7 @@ var StateManager = /*#__PURE__*/function () {
|
|
311
319
|
if (headerLevel < 0) {
|
312
320
|
headerLevel = this.rowCoordsToLevel(headerLevel);
|
313
321
|
}
|
314
|
-
if (headerLevel >= this.getLayersCount()) {
|
322
|
+
if (headerLevel === null || headerLevel >= this.getLayersCount()) {
|
315
323
|
return null;
|
316
324
|
}
|
317
325
|
return (_classPrivateFieldGet2 = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _stateMatrix)[headerLevel]) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3[columnIndex]) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : null;
|
@@ -332,6 +340,9 @@ var StateManager = /*#__PURE__*/function () {
|
|
332
340
|
if (headerLevel < 0) {
|
333
341
|
headerLevel = this.rowCoordsToLevel(headerLevel);
|
334
342
|
}
|
343
|
+
if (headerLevel === null || headerLevel >= this.getLayersCount()) {
|
344
|
+
return null;
|
345
|
+
}
|
335
346
|
var node = _classPrivateFieldGet(this, _headersTree).getNode(headerLevel, columnIndex);
|
336
347
|
if (!node) {
|
337
348
|
return null;
|
package/selection/selection.js
CHANGED
@@ -644,11 +644,12 @@ var Selection = /*#__PURE__*/function () {
|
|
644
644
|
return;
|
645
645
|
}
|
646
646
|
var startCoords = this.tableProps.createCellCoords(includeColumnHeaders ? -1 : 0, includeRowHeaders ? -1 : 0);
|
647
|
+
var endCoords = this.tableProps.createCellCoords(nrOfRows - 1, nrOfColumns - 1);
|
647
648
|
this.clear();
|
648
649
|
this.setRangeStartOnly(startCoords);
|
649
650
|
this.selectedByRowHeader.add(this.getLayerLevel());
|
650
651
|
this.selectedByColumnHeader.add(this.getLayerLevel());
|
651
|
-
this.setRangeEnd(
|
652
|
+
this.setRangeEnd(endCoords);
|
652
653
|
this.finish();
|
653
654
|
}
|
654
655
|
|
package/selection/selection.mjs
CHANGED
@@ -639,11 +639,12 @@ var Selection = /*#__PURE__*/function () {
|
|
639
639
|
return;
|
640
640
|
}
|
641
641
|
var startCoords = this.tableProps.createCellCoords(includeColumnHeaders ? -1 : 0, includeRowHeaders ? -1 : 0);
|
642
|
+
var endCoords = this.tableProps.createCellCoords(nrOfRows - 1, nrOfColumns - 1);
|
642
643
|
this.clear();
|
643
644
|
this.setRangeStartOnly(startCoords);
|
644
645
|
this.selectedByRowHeader.add(this.getLayerLevel());
|
645
646
|
this.selectedByColumnHeader.add(this.getLayerLevel());
|
646
|
-
this.setRangeEnd(
|
647
|
+
this.setRangeEnd(endCoords);
|
647
648
|
this.finish();
|
648
649
|
}
|
649
650
|
|