handsontable 0.0.0-next-0bd37c1-20240513 → 0.0.0-next-c2f1254-20240515
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.js +76 -179
- package/core.mjs +76 -179
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +1969 -1977
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +6 -6
- package/dist/handsontable.js +2441 -2449
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +9 -9
- package/editorManager.js +0 -67
- package/editorManager.mjs +0 -67
- package/editors/baseEditor/baseEditor.js +1 -36
- package/editors/baseEditor/baseEditor.mjs +2 -37
- package/editors/dateEditor/dateEditor.js +4 -1
- package/editors/dateEditor/dateEditor.mjs +4 -1
- package/editors/handsontableEditor/handsontableEditor.js +2 -2
- package/editors/handsontableEditor/handsontableEditor.mjs +2 -2
- package/editors/selectEditor/selectEditor.js +1 -9
- package/editors/selectEditor/selectEditor.mjs +1 -9
- package/editors/textEditor/textEditor.js +2 -11
- package/editors/textEditor/textEditor.mjs +2 -11
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/plugins/autofill/autofill.js +1 -1
- package/plugins/autofill/autofill.mjs +1 -1
- package/selection/selection.js +156 -4
- package/selection/selection.mjs +156 -4
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -3
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -3
- package/shortcutContexts/commands/editor/closeAndSaveByArrowKeys.js +27 -0
- package/shortcutContexts/commands/editor/closeAndSaveByArrowKeys.mjs +24 -0
- package/shortcutContexts/commands/editor/closeAndSaveByEnter.js +11 -0
- package/shortcutContexts/commands/editor/closeAndSaveByEnter.mjs +8 -0
- package/shortcutContexts/commands/editor/index.js +3 -1
- package/shortcutContexts/commands/editor/index.mjs +3 -1
- package/shortcutContexts/editor.js +9 -1
- package/shortcutContexts/editor.mjs +9 -1
- package/shortcutContexts/index.js +1 -1
- package/shortcutContexts/index.mjs +1 -1
package/base.js
CHANGED
@@ -45,8 +45,8 @@ Handsontable.hooks = _pluginHooks.default.getSingleton();
|
|
45
45
|
Handsontable.CellCoords = _src.CellCoords;
|
46
46
|
Handsontable.CellRange = _src.CellRange;
|
47
47
|
Handsontable.packageName = 'handsontable';
|
48
|
-
Handsontable.buildDate = "
|
49
|
-
Handsontable.version = "0.0.0-next-
|
48
|
+
Handsontable.buildDate = "15/05/2024 07:15:18";
|
49
|
+
Handsontable.version = "0.0.0-next-c2f1254-20240515";
|
50
50
|
Handsontable.languages = {
|
51
51
|
dictionaryKeys: _registry.dictionaryKeys,
|
52
52
|
getLanguageDictionary: _registry.getLanguageDictionary,
|
package/base.mjs
CHANGED
@@ -35,8 +35,8 @@ Handsontable.hooks = Hooks.getSingleton();
|
|
35
35
|
Handsontable.CellCoords = CellCoords;
|
36
36
|
Handsontable.CellRange = CellRange;
|
37
37
|
Handsontable.packageName = 'handsontable';
|
38
|
-
Handsontable.buildDate = "
|
39
|
-
Handsontable.version = "0.0.0-next-
|
38
|
+
Handsontable.buildDate = "15/05/2024 07:15:24";
|
39
|
+
Handsontable.version = "0.0.0-next-c2f1254-20240515";
|
40
40
|
Handsontable.languages = {
|
41
41
|
dictionaryKeys,
|
42
42
|
getLanguageDictionary,
|
package/core.js
CHANGED
@@ -337,7 +337,7 @@ function Core(rootElement, userSettings) {
|
|
337
337
|
hiddenIndexesChanged
|
338
338
|
} = _ref;
|
339
339
|
if (hiddenIndexesChanged) {
|
340
|
-
this.selection.
|
340
|
+
this.selection.commit();
|
341
341
|
}
|
342
342
|
};
|
343
343
|
this.columnIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
|
@@ -372,7 +372,11 @@ function Core(rootElement, userSettings) {
|
|
372
372
|
} else {
|
373
373
|
(0, _element.removeClass)(this.rootElement, ['ht__selection--rows', 'ht__selection--columns']);
|
374
374
|
}
|
375
|
-
|
375
|
+
if (selection.getSelectionSource() !== 'shift') {
|
376
|
+
editorManager.closeEditor(null);
|
377
|
+
}
|
378
|
+
instance.view.render();
|
379
|
+
editorManager.prepareEditor();
|
376
380
|
});
|
377
381
|
this.selection.addLocalHook('beforeSetFocus', cellCoords => {
|
378
382
|
this.runHooks('beforeSelectionFocusSet', cellCoords.row, cellCoords.col);
|
@@ -383,7 +387,9 @@ function Core(rootElement, userSettings) {
|
|
383
387
|
if (!preventScrolling.isTouched() || preventScrolling.isTouched() && !preventScrolling.value) {
|
384
388
|
viewportScroller.scrollTo(cellCoords);
|
385
389
|
}
|
386
|
-
|
390
|
+
editorManager.closeEditor();
|
391
|
+
instance.view.render();
|
392
|
+
editorManager.prepareEditor();
|
387
393
|
});
|
388
394
|
this.selection.addLocalHook('afterSelectionFinished', cellRanges => {
|
389
395
|
const selectionLayerLevel = cellRanges.length - 1;
|
@@ -401,8 +407,8 @@ function Core(rootElement, userSettings) {
|
|
401
407
|
}
|
402
408
|
});
|
403
409
|
this.selection.addLocalHook('afterDeselect', () => {
|
404
|
-
editorManager.
|
405
|
-
|
410
|
+
editorManager.closeEditor();
|
411
|
+
instance.view.render();
|
406
412
|
(0, _element.removeClass)(this.rootElement, ['ht__selection--rows', 'ht__selection--columns']);
|
407
413
|
this.runHooks('afterDeselect');
|
408
414
|
});
|
@@ -557,47 +563,7 @@ function Core(rootElement, userSettings) {
|
|
557
563
|
source,
|
558
564
|
mode: insertRowMode
|
559
565
|
});
|
560
|
-
|
561
|
-
const currentSelectedRange = selection.selectedRange.current();
|
562
|
-
const currentFromRange = currentSelectedRange === null || currentSelectedRange === void 0 ? void 0 : currentSelectedRange.from;
|
563
|
-
const currentFromRow = currentFromRange === null || currentFromRange === void 0 ? void 0 : currentFromRange.row;
|
564
|
-
const startVisualRowIndex = instance.toVisualRow(startRowPhysicalIndex);
|
565
|
-
if (selection.isSelectedByCorner()) {
|
566
|
-
selection.selectAll(true, true, {
|
567
|
-
disableHeadersHighlight: true
|
568
|
-
});
|
569
|
-
} else if ((0, _mixed.isDefined)(currentFromRow) && currentFromRow >= startVisualRowIndex) {
|
570
|
-
// Moving the selection (if it exists) downward – it should be applied to the "old" row.
|
571
|
-
// TODO: The logic here should be handled by selection module.
|
572
|
-
const {
|
573
|
-
row: currentToRow,
|
574
|
-
col: currentToColumn
|
575
|
-
} = currentSelectedRange.to;
|
576
|
-
let currentFromColumn = currentFromRange.col;
|
577
|
-
|
578
|
-
// Workaround: headers are not stored inside selection.
|
579
|
-
if (selection.isSelectedByRowHeader()) {
|
580
|
-
currentFromColumn = -1;
|
581
|
-
}
|
582
|
-
|
583
|
-
// Remove from the stack the last added selection as that selection below will be
|
584
|
-
// replaced by new transformed selection.
|
585
|
-
selection.getSelectedRange().pop();
|
586
|
-
instance.addHookOnce('afterSelection', function () {
|
587
|
-
for (var _len16 = arguments.length, _ref5 = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {
|
588
|
-
_ref5[_key16] = arguments[_key16];
|
589
|
-
}
|
590
|
-
let [,,,, preventScrolling] = _ref5;
|
591
|
-
preventScrolling.value = true;
|
592
|
-
});
|
593
|
-
|
594
|
-
// I can't use transforms as they don't work in negative indexes.
|
595
|
-
selection.setRangeStartOnly(instance._createCellCoords(currentFromRow + rowDelta, currentFromColumn), true);
|
596
|
-
selection.setRangeEnd(instance._createCellCoords(currentToRow + rowDelta, currentToColumn)); // will call render() internally
|
597
|
-
} else {
|
598
|
-
instance._refreshBorders(); // it will call render and prepare methods
|
599
|
-
}
|
600
|
-
}
|
566
|
+
selection.shiftRows(instance.toVisualRow(startRowPhysicalIndex), rowDelta);
|
601
567
|
break;
|
602
568
|
case 'insert_col_start':
|
603
569
|
case 'insert_col_end':
|
@@ -620,38 +586,7 @@ function Core(rootElement, userSettings) {
|
|
620
586
|
spliceArray.length += colDelta; // inserts empty (undefined) elements at the end of an array
|
621
587
|
Array.prototype.splice.apply(tableMeta.colHeaders, spliceArray); // inserts empty (undefined) elements into the colHeader array
|
622
588
|
}
|
623
|
-
|
624
|
-
const currentFromRange = currentSelectedRange === null || currentSelectedRange === void 0 ? void 0 : currentSelectedRange.from;
|
625
|
-
const currentFromColumn = currentFromRange === null || currentFromRange === void 0 ? void 0 : currentFromRange.col;
|
626
|
-
const startVisualColumnIndex = instance.toVisualColumn(startColumnPhysicalIndex);
|
627
|
-
if (selection.isSelectedByCorner()) {
|
628
|
-
selection.selectAll(true, true, {
|
629
|
-
disableHeadersHighlight: true
|
630
|
-
});
|
631
|
-
} else if ((0, _mixed.isDefined)(currentFromColumn) && currentFromColumn >= startVisualColumnIndex) {
|
632
|
-
// Moving the selection (if it exists) rightward – it should be applied to the "old" column.
|
633
|
-
// TODO: The logic here should be handled by selection module.
|
634
|
-
const {
|
635
|
-
row: currentToRow,
|
636
|
-
col: currentToColumn
|
637
|
-
} = currentSelectedRange.to;
|
638
|
-
let currentFromRow = currentFromRange.row;
|
639
|
-
|
640
|
-
// Workaround: headers are not stored inside selection.
|
641
|
-
if (selection.isSelectedByColumnHeader()) {
|
642
|
-
currentFromRow = -1;
|
643
|
-
}
|
644
|
-
|
645
|
-
// Remove from the stack the last added selection as that selection below will be
|
646
|
-
// replaced by new transformed selection.
|
647
|
-
selection.getSelectedRange().pop();
|
648
|
-
|
649
|
-
// I can't use transforms as they don't work in negative indexes.
|
650
|
-
selection.setRangeStartOnly(instance._createCellCoords(currentFromRow, currentFromColumn + colDelta), true);
|
651
|
-
selection.setRangeEnd(instance._createCellCoords(currentToRow, currentToColumn + colDelta)); // will call render() internally
|
652
|
-
} else {
|
653
|
-
instance._refreshBorders(); // it will call render and prepare methods
|
654
|
-
}
|
589
|
+
selection.shiftColumns(instance.toVisualColumn(startColumnPhysicalIndex), colDelta);
|
655
590
|
}
|
656
591
|
break;
|
657
592
|
case 'remove_row':
|
@@ -659,8 +594,8 @@ function Core(rootElement, userSettings) {
|
|
659
594
|
let offset = 0;
|
660
595
|
|
661
596
|
// Normalize the {index, amount} groups into bigger groups.
|
662
|
-
(0, _array.arrayEach)(indexes,
|
663
|
-
let [groupIndex, groupAmount] =
|
597
|
+
(0, _array.arrayEach)(indexes, _ref5 => {
|
598
|
+
let [groupIndex, groupAmount] = _ref5;
|
664
599
|
const calcIndex = (0, _mixed.isEmpty)(groupIndex) ? instance.countRows() - 1 : Math.max(groupIndex - offset, 0);
|
665
600
|
|
666
601
|
// If the 'index' is an integer decrease it by 'offset' otherwise pass it through to make the value
|
@@ -676,7 +611,22 @@ function Core(rootElement, userSettings) {
|
|
676
611
|
if (!wasRemoved) {
|
677
612
|
return;
|
678
613
|
}
|
614
|
+
if (selection.isSelected()) {
|
615
|
+
const {
|
616
|
+
row
|
617
|
+
} = instance.getSelectedRangeLast().highlight;
|
618
|
+
if (row >= groupIndex && row <= groupIndex + groupAmount - 1) {
|
619
|
+
editorManager.closeEditor(true);
|
620
|
+
}
|
621
|
+
}
|
679
622
|
const totalRows = instance.countRows();
|
623
|
+
if (totalRows === 0) {
|
624
|
+
selection.deselect();
|
625
|
+
} else if (source === 'ContextMenu.removeRow') {
|
626
|
+
selection.refresh();
|
627
|
+
} else {
|
628
|
+
selection.shiftRows(groupIndex, -groupAmount);
|
629
|
+
}
|
680
630
|
const fixedRowsTop = tableMeta.fixedRowsTop;
|
681
631
|
if (fixedRowsTop >= calcIndex + 1) {
|
682
632
|
tableMeta.fixedRowsTop -= Math.min(groupAmount, fixedRowsTop - calcIndex);
|
@@ -693,16 +643,14 @@ function Core(rootElement, userSettings) {
|
|
693
643
|
} else {
|
694
644
|
removeRow([[index, amount]]);
|
695
645
|
}
|
696
|
-
grid.adjustRowsAndCols();
|
697
|
-
instance._refreshBorders(); // it will call render and prepare methods
|
698
646
|
break;
|
699
647
|
case 'remove_col':
|
700
648
|
const removeCol = indexes => {
|
701
649
|
let offset = 0;
|
702
650
|
|
703
651
|
// Normalize the {index, amount} groups into bigger groups.
|
704
|
-
(0, _array.arrayEach)(indexes,
|
705
|
-
let [groupIndex, groupAmount] =
|
652
|
+
(0, _array.arrayEach)(indexes, _ref6 => {
|
653
|
+
let [groupIndex, groupAmount] = _ref6;
|
706
654
|
const calcIndex = (0, _mixed.isEmpty)(groupIndex) ? instance.countCols() - 1 : Math.max(groupIndex - offset, 0);
|
707
655
|
let physicalColumnIndex = instance.toPhysicalColumn(calcIndex);
|
708
656
|
|
@@ -719,6 +667,22 @@ function Core(rootElement, userSettings) {
|
|
719
667
|
if (!wasRemoved) {
|
720
668
|
return;
|
721
669
|
}
|
670
|
+
if (selection.isSelected()) {
|
671
|
+
const {
|
672
|
+
col
|
673
|
+
} = instance.getSelectedRangeLast().highlight;
|
674
|
+
if (col >= groupIndex && col <= groupIndex + groupAmount - 1) {
|
675
|
+
editorManager.closeEditor(true);
|
676
|
+
}
|
677
|
+
}
|
678
|
+
const totalColumns = instance.countCols();
|
679
|
+
if (totalColumns === 0) {
|
680
|
+
selection.deselect();
|
681
|
+
} else if (source === 'ContextMenu.removeColumn') {
|
682
|
+
selection.refresh();
|
683
|
+
} else {
|
684
|
+
selection.shiftColumns(groupIndex, -groupAmount);
|
685
|
+
}
|
722
686
|
const fixedColumnsStart = tableMeta.fixedColumnsStart;
|
723
687
|
if (fixedColumnsStart >= calcIndex + 1) {
|
724
688
|
tableMeta.fixedColumnsStart -= Math.min(groupAmount, fixedColumnsStart - calcIndex);
|
@@ -737,13 +701,11 @@ function Core(rootElement, userSettings) {
|
|
737
701
|
} else {
|
738
702
|
removeCol([[index, amount]]);
|
739
703
|
}
|
740
|
-
grid.adjustRowsAndCols();
|
741
|
-
instance._refreshBorders(); // it will call render and prepare methods
|
742
|
-
|
743
704
|
break;
|
744
705
|
default:
|
745
706
|
throw new Error(`There is no such action "${action}"`);
|
746
707
|
}
|
708
|
+
instance.view.render();
|
747
709
|
if (!keepEmptyRows) {
|
748
710
|
grid.adjustRowsAndCols(); // makes sure that we did not add rows that will be removed in next refresh
|
749
711
|
}
|
@@ -758,9 +720,6 @@ function Core(rootElement, userSettings) {
|
|
758
720
|
const minSpareRows = tableMeta.minSpareRows;
|
759
721
|
const minCols = tableMeta.minCols;
|
760
722
|
const minSpareCols = tableMeta.minSpareCols;
|
761
|
-
if (instance.countRows() === 0 && instance.countCols() === 0) {
|
762
|
-
selection.deselect();
|
763
|
-
}
|
764
723
|
if (minRows) {
|
765
724
|
// should I add empty rows to data source to meet minRows?
|
766
725
|
const nrOfRows = instance.countRows();
|
@@ -819,55 +778,6 @@ function Core(rootElement, userSettings) {
|
|
819
778
|
});
|
820
779
|
}
|
821
780
|
}
|
822
|
-
if (selection.isSelected()) {
|
823
|
-
const rowCount = instance.countRows();
|
824
|
-
const colCount = instance.countCols();
|
825
|
-
(0, _array.arrayEach)(selection.selectedRange, range => {
|
826
|
-
let selectionChanged = false;
|
827
|
-
let fromRow = range.from.row;
|
828
|
-
let fromCol = range.from.col;
|
829
|
-
let toRow = range.to.row;
|
830
|
-
let toCol = range.to.col;
|
831
|
-
|
832
|
-
// if selection is outside, move selection to last row
|
833
|
-
if (fromRow > rowCount - 1) {
|
834
|
-
fromRow = rowCount - 1;
|
835
|
-
selectionChanged = true;
|
836
|
-
if (toRow > fromRow) {
|
837
|
-
toRow = fromRow;
|
838
|
-
}
|
839
|
-
} else if (toRow > rowCount - 1) {
|
840
|
-
toRow = rowCount - 1;
|
841
|
-
selectionChanged = true;
|
842
|
-
if (fromRow > toRow) {
|
843
|
-
fromRow = toRow;
|
844
|
-
}
|
845
|
-
}
|
846
|
-
// if selection is outside, move selection to last row
|
847
|
-
if (fromCol > colCount - 1) {
|
848
|
-
fromCol = colCount - 1;
|
849
|
-
selectionChanged = true;
|
850
|
-
if (toCol > fromCol) {
|
851
|
-
toCol = fromCol;
|
852
|
-
}
|
853
|
-
} else if (toCol > colCount - 1) {
|
854
|
-
toCol = colCount - 1;
|
855
|
-
selectionChanged = true;
|
856
|
-
if (fromCol > toCol) {
|
857
|
-
fromCol = toCol;
|
858
|
-
}
|
859
|
-
}
|
860
|
-
if (selectionChanged) {
|
861
|
-
if (fromCol < 0) {
|
862
|
-
instance.selectRows(fromRow, toRow, fromCol);
|
863
|
-
} else if (fromRow < 0) {
|
864
|
-
instance.selectColumns(fromCol, toCol, fromRow);
|
865
|
-
} else {
|
866
|
-
instance.selectCell(fromRow, fromCol, toRow, toCol);
|
867
|
-
}
|
868
|
-
}
|
869
|
-
});
|
870
|
-
}
|
871
781
|
if (instance.view) {
|
872
782
|
instance.view.adjustElementsSize();
|
873
783
|
}
|
@@ -1314,7 +1224,9 @@ function Core(rootElement, userSettings) {
|
|
1314
1224
|
instance.forceFullRender = true; // used when data was changed
|
1315
1225
|
grid.adjustRowsAndCols();
|
1316
1226
|
instance.runHooks('beforeChangeRender', changes, source);
|
1317
|
-
|
1227
|
+
editorManager.closeEditor();
|
1228
|
+
instance.view.render();
|
1229
|
+
editorManager.prepareEditor();
|
1318
1230
|
instance.view.adjustElementsSize();
|
1319
1231
|
instance.runHooks('afterChange', changes, source || 'edit');
|
1320
1232
|
const activeEditor = instance.getActiveEditor();
|
@@ -1594,7 +1506,11 @@ function Core(rootElement, userSettings) {
|
|
1594
1506
|
this.destroyEditor = function () {
|
1595
1507
|
let revertOriginal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
1596
1508
|
let prepareEditorIfNeeded = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
1597
|
-
|
1509
|
+
editorManager.closeEditor(revertOriginal);
|
1510
|
+
instance.view.render();
|
1511
|
+
if (prepareEditorIfNeeded && selection.isSelected()) {
|
1512
|
+
editorManager.prepareEditor();
|
1513
|
+
}
|
1598
1514
|
};
|
1599
1515
|
|
1600
1516
|
/**
|
@@ -1636,8 +1552,8 @@ function Core(rootElement, userSettings) {
|
|
1636
1552
|
* @returns {Array} Returns removed portion of columns.
|
1637
1553
|
*/
|
1638
1554
|
this.spliceCol = function (column, index, amount) {
|
1639
|
-
for (var
|
1640
|
-
elements[
|
1555
|
+
for (var _len16 = arguments.length, elements = new Array(_len16 > 3 ? _len16 - 3 : 0), _key16 = 3; _key16 < _len16; _key16++) {
|
1556
|
+
elements[_key16 - 3] = arguments[_key16];
|
1641
1557
|
}
|
1642
1558
|
return datamap.spliceCol(column, index, amount, ...elements);
|
1643
1559
|
};
|
@@ -1654,8 +1570,8 @@ function Core(rootElement, userSettings) {
|
|
1654
1570
|
* @returns {Array} Returns removed portion of rows.
|
1655
1571
|
*/
|
1656
1572
|
this.spliceRow = function (row, index, amount) {
|
1657
|
-
for (var
|
1658
|
-
elements[
|
1573
|
+
for (var _len17 = arguments.length, elements = new Array(_len17 > 3 ? _len17 - 3 : 0), _key17 = 3; _key17 < _len17; _key17++) {
|
1574
|
+
elements[_key17 - 3] = arguments[_key17];
|
1659
1575
|
}
|
1660
1576
|
return datamap.spliceRow(row, index, amount, ...elements);
|
1661
1577
|
};
|
@@ -1676,11 +1592,11 @@ function Core(rootElement, userSettings) {
|
|
1676
1592
|
this.getSelected = function () {
|
1677
1593
|
// https://github.com/handsontable/handsontable/issues/44 //cjl
|
1678
1594
|
if (selection.isSelected()) {
|
1679
|
-
return (0, _array.arrayMap)(selection.getSelectedRange(),
|
1595
|
+
return (0, _array.arrayMap)(selection.getSelectedRange(), _ref7 => {
|
1680
1596
|
let {
|
1681
1597
|
from,
|
1682
1598
|
to
|
1683
|
-
} =
|
1599
|
+
} = _ref7;
|
1684
1600
|
return [from.row, from.col, to.row, to.col];
|
1685
1601
|
});
|
1686
1602
|
}
|
@@ -1857,7 +1773,7 @@ function Core(rootElement, userSettings) {
|
|
1857
1773
|
if (this.renderCall) {
|
1858
1774
|
this.render();
|
1859
1775
|
} else {
|
1860
|
-
|
1776
|
+
instance.view.render();
|
1861
1777
|
}
|
1862
1778
|
}
|
1863
1779
|
};
|
@@ -1878,9 +1794,7 @@ function Core(rootElement, userSettings) {
|
|
1878
1794
|
this.forceFullRender = true; // used when data was changed
|
1879
1795
|
|
1880
1796
|
if (!this.isRenderSuspended()) {
|
1881
|
-
|
1882
|
-
this._refreshBorders(null);
|
1883
|
-
editorManager.unlockEditor();
|
1797
|
+
instance.view.render();
|
1884
1798
|
}
|
1885
1799
|
}
|
1886
1800
|
};
|
@@ -2147,6 +2061,7 @@ function Core(rootElement, userSettings) {
|
|
2147
2061
|
instance.columnIndexMapper.fitToLength(this.getInitialColumnCount());
|
2148
2062
|
instance.rowIndexMapper.fitToLength(this.countSourceRows());
|
2149
2063
|
grid.adjustRowsAndCols();
|
2064
|
+
selection.refresh();
|
2150
2065
|
}, {
|
2151
2066
|
hotInstance: instance,
|
2152
2067
|
dataMap: datamap,
|
@@ -2187,6 +2102,7 @@ function Core(rootElement, userSettings) {
|
|
2187
2102
|
metaManager.clearCellsCache();
|
2188
2103
|
instance.initIndexMappers();
|
2189
2104
|
grid.adjustRowsAndCols();
|
2105
|
+
selection.refresh();
|
2190
2106
|
if (firstRun) {
|
2191
2107
|
firstRun = [null, 'loadData'];
|
2192
2108
|
}
|
@@ -2474,10 +2390,8 @@ function Core(rootElement, userSettings) {
|
|
2474
2390
|
grid.adjustRowsAndCols();
|
2475
2391
|
if (instance.view && !firstRun) {
|
2476
2392
|
instance.forceFullRender = true; // used when data was changed
|
2477
|
-
|
2478
|
-
instance._refreshBorders(null);
|
2393
|
+
instance.view.render();
|
2479
2394
|
instance.view._wt.wtOverlays.adjustElementsSize();
|
2480
|
-
editorManager.unlockEditor();
|
2481
2395
|
}
|
2482
2396
|
if (!init && instance.view && (currentHeight === '' || height === '' || height === undefined) && currentHeight !== height) {
|
2483
2397
|
instance.view._wt.wtOverlays.updateMainScrollableElements();
|
@@ -2906,15 +2820,15 @@ function Core(rootElement, userSettings) {
|
|
2906
2820
|
const isThereAnySetSourceListener = this.hasHook('afterSetSourceDataAtCell');
|
2907
2821
|
const changesForHook = [];
|
2908
2822
|
if (isThereAnySetSourceListener) {
|
2909
|
-
(0, _array.arrayEach)(input,
|
2910
|
-
let [changeRow, changeProp, changeValue] =
|
2823
|
+
(0, _array.arrayEach)(input, _ref8 => {
|
2824
|
+
let [changeRow, changeProp, changeValue] = _ref8;
|
2911
2825
|
changesForHook.push([changeRow, changeProp, dataSource.getAtCell(changeRow, changeProp),
|
2912
2826
|
// The previous value.
|
2913
2827
|
changeValue]);
|
2914
2828
|
});
|
2915
2829
|
}
|
2916
|
-
(0, _array.arrayEach)(input,
|
2917
|
-
let [changeRow, changeProp, changeValue] =
|
2830
|
+
(0, _array.arrayEach)(input, _ref9 => {
|
2831
|
+
let [changeRow, changeProp, changeValue] = _ref9;
|
2918
2832
|
dataSource.setAtCell(changeRow, changeProp, changeValue);
|
2919
2833
|
});
|
2920
2834
|
if (isThereAnySetSourceListener) {
|
@@ -3052,8 +2966,8 @@ function Core(rootElement, userSettings) {
|
|
3052
2966
|
*/
|
3053
2967
|
this.spliceCellsMeta = function (visualIndex) {
|
3054
2968
|
let deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
3055
|
-
for (var
|
3056
|
-
cellMetaRows[
|
2969
|
+
for (var _len18 = arguments.length, cellMetaRows = new Array(_len18 > 2 ? _len18 - 2 : 0), _key18 = 2; _key18 < _len18; _key18++) {
|
2970
|
+
cellMetaRows[_key18 - 2] = arguments[_key18];
|
3057
2971
|
}
|
3058
2972
|
if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
|
3059
2973
|
throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
|
@@ -4266,8 +4180,8 @@ function Core(rootElement, userSettings) {
|
|
4266
4180
|
instance.batchExecution(() => {
|
4267
4181
|
instance.rowIndexMapper.unregisterAll();
|
4268
4182
|
instance.columnIndexMapper.unregisterAll();
|
4269
|
-
pluginsRegistry.getItems().forEach(
|
4270
|
-
let [, plugin] =
|
4183
|
+
pluginsRegistry.getItems().forEach(_ref10 => {
|
4184
|
+
let [, plugin] = _ref10;
|
4271
4185
|
plugin.destroy();
|
4272
4186
|
});
|
4273
4187
|
pluginsRegistry.clear();
|
@@ -4555,23 +4469,6 @@ function Core(rootElement, userSettings) {
|
|
4555
4469
|
});
|
4556
4470
|
};
|
4557
4471
|
|
4558
|
-
/**
|
4559
|
-
* Refresh selection borders. This is temporary method relic after selection rewrite.
|
4560
|
-
*
|
4561
|
-
* @private
|
4562
|
-
* @param {boolean} [revertOriginal=false] If `true`, the previous value will be restored. Otherwise, the edited value will be saved.
|
4563
|
-
* @param {boolean} [prepareEditorIfNeeded=true] If `true` the editor under the selected cell will be prepared to open.
|
4564
|
-
*/
|
4565
|
-
this._refreshBorders = function () {
|
4566
|
-
let revertOriginal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
4567
|
-
let prepareEditorIfNeeded = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
4568
|
-
editorManager.destroyEditor(revertOriginal);
|
4569
|
-
instance.view.render();
|
4570
|
-
if (prepareEditorIfNeeded && selection.isSelected()) {
|
4571
|
-
editorManager.prepareEditor();
|
4572
|
-
}
|
4573
|
-
};
|
4574
|
-
|
4575
4472
|
/**
|
4576
4473
|
* Gets the instance of the EditorManager.
|
4577
4474
|
*
|