es-grid-template 1.3.8 → 1.3.9
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.
|
@@ -833,7 +833,7 @@ const GridEdit = props => {
|
|
|
833
833
|
if (!isEqualSet(cells, rangeCells)) {
|
|
834
834
|
onRemoveBgSelectedCell(rangeCells, id);
|
|
835
835
|
onRemoveBorderSelectedCell(rangeCells, id);
|
|
836
|
-
hideDraggingPoint(
|
|
836
|
+
hideDraggingPoint(rangeCells, id);
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
839
|
if (rowsSelected.current && rowsSelected.current.size > 0) {
|
|
@@ -859,11 +859,12 @@ const GridEdit = props => {
|
|
|
859
859
|
};
|
|
860
860
|
const triggerDragPaste = pastesArray => {
|
|
861
861
|
const mergedSet = new Set([...selectedCells.current, ...pastesArray]);
|
|
862
|
+
const tmpCols = flatColumns2(columns.filter(it => it.visible !== false));
|
|
862
863
|
const rowSelectedFirst = getFirstSelectCell(selectedCells.current).row;
|
|
863
864
|
const rowPasteLast = getLastSelectCell(pasteCells.current).row;
|
|
864
865
|
const selectedArray = Array.from(selectedCells.current).map(key => {
|
|
865
866
|
const [row, col] = key.split("-").map(Number);
|
|
866
|
-
const columnKey =
|
|
867
|
+
const columnKey = tmpCols[col].field;
|
|
867
868
|
|
|
868
869
|
// @ts-ignore
|
|
869
870
|
return {
|
|
@@ -957,13 +958,13 @@ const GridEdit = props => {
|
|
|
957
958
|
}
|
|
958
959
|
rowValues.forEach((cellValue, colIndex) => {
|
|
959
960
|
const targetCol = startCol + colIndex;
|
|
960
|
-
if (targetCol >=
|
|
961
|
+
if (targetCol >= tmpCols.length) {
|
|
961
962
|
// Không vượt quá số cột
|
|
962
963
|
return;
|
|
963
964
|
}
|
|
964
965
|
|
|
965
966
|
// @ts-ignore
|
|
966
|
-
const columnKey =
|
|
967
|
+
const columnKey = tmpCols[targetCol].field;
|
|
967
968
|
|
|
968
969
|
// @ts-ignore
|
|
969
970
|
newData[targetRow] = {
|
|
@@ -1822,6 +1823,7 @@ const GridEdit = props => {
|
|
|
1822
1823
|
}
|
|
1823
1824
|
hideDraggingPoint(selectedCells.current, id);
|
|
1824
1825
|
selectedCells.current = cells;
|
|
1826
|
+
setRangeCells(cells);
|
|
1825
1827
|
setTimeout(() => {
|
|
1826
1828
|
onAddBgSelectedCell(selectedCells.current, id);
|
|
1827
1829
|
onAddBorderSelectedCell(selectedCells.current, id);
|
|
@@ -841,7 +841,7 @@ const GridEdit = props => {
|
|
|
841
841
|
if (!(0, _hooks.isEqualSet)(cells, rangeCells)) {
|
|
842
842
|
(0, _hooks.onRemoveBgSelectedCell)(rangeCells, id);
|
|
843
843
|
(0, _hooks.onRemoveBorderSelectedCell)(rangeCells, id);
|
|
844
|
-
(0, _hooks.hideDraggingPoint)(
|
|
844
|
+
(0, _hooks.hideDraggingPoint)(rangeCells, id);
|
|
845
845
|
}
|
|
846
846
|
}
|
|
847
847
|
if (rowsSelected.current && rowsSelected.current.size > 0) {
|
|
@@ -867,11 +867,12 @@ const GridEdit = props => {
|
|
|
867
867
|
};
|
|
868
868
|
const triggerDragPaste = pastesArray => {
|
|
869
869
|
const mergedSet = new Set([...selectedCells.current, ...pastesArray]);
|
|
870
|
+
const tmpCols = (0, _columns.flatColumns2)(columns.filter(it => it.visible !== false));
|
|
870
871
|
const rowSelectedFirst = (0, _hooks.getFirstSelectCell)(selectedCells.current).row;
|
|
871
872
|
const rowPasteLast = (0, _hooks.getLastSelectCell)(pasteCells.current).row;
|
|
872
873
|
const selectedArray = Array.from(selectedCells.current).map(key => {
|
|
873
874
|
const [row, col] = key.split("-").map(Number);
|
|
874
|
-
const columnKey =
|
|
875
|
+
const columnKey = tmpCols[col].field;
|
|
875
876
|
|
|
876
877
|
// @ts-ignore
|
|
877
878
|
return {
|
|
@@ -965,13 +966,13 @@ const GridEdit = props => {
|
|
|
965
966
|
}
|
|
966
967
|
rowValues.forEach((cellValue, colIndex) => {
|
|
967
968
|
const targetCol = startCol + colIndex;
|
|
968
|
-
if (targetCol >=
|
|
969
|
+
if (targetCol >= tmpCols.length) {
|
|
969
970
|
// Không vượt quá số cột
|
|
970
971
|
return;
|
|
971
972
|
}
|
|
972
973
|
|
|
973
974
|
// @ts-ignore
|
|
974
|
-
const columnKey =
|
|
975
|
+
const columnKey = tmpCols[targetCol].field;
|
|
975
976
|
|
|
976
977
|
// @ts-ignore
|
|
977
978
|
newData[targetRow] = {
|
|
@@ -1830,6 +1831,7 @@ const GridEdit = props => {
|
|
|
1830
1831
|
}
|
|
1831
1832
|
(0, _hooks.hideDraggingPoint)(selectedCells.current, id);
|
|
1832
1833
|
selectedCells.current = cells;
|
|
1834
|
+
setRangeCells(cells);
|
|
1833
1835
|
setTimeout(() => {
|
|
1834
1836
|
(0, _hooks.onAddBgSelectedCell)(selectedCells.current, id);
|
|
1835
1837
|
(0, _hooks.onAddBorderSelectedCell)(selectedCells.current, id);
|