es-grid-template 1.4.3 → 1.4.4

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.
@@ -188,7 +188,7 @@ const GridEdit = props => {
188
188
  dataSource,
189
189
  components,
190
190
  allowResizing,
191
- rowKey = 'id',
191
+ rowKey = 'rowId',
192
192
  selectionSettings,
193
193
  height,
194
194
  format,
@@ -365,13 +365,13 @@ const GridEdit = props => {
365
365
  // thêm n dòng bên trên
366
366
  const handleInsertBefore = _react.default.useCallback((item, n) => {
367
367
  //
368
- (0, _hooks.onRemoveBgSelectedCell)(selectedCells.current, id);
369
- (0, _hooks.onRemoveBorderSelectedCell)(selectedCells.current, id);
368
+ // onRemoveBgSelectedCell(selectedCells.current, id)
369
+ // onRemoveBorderSelectedCell(selectedCells.current, id)
370
370
  //
371
371
 
372
372
  setTimeout(() => {
373
- (0, _hooks.onAddBgSelectedCell)(selectedCells.current, id);
374
- (0, _hooks.onAddBorderSelectedCell)(selectedCells.current, id);
373
+ // onAddBgSelectedCell(selectedCells.current, id)
374
+ // onAddBorderSelectedCell(selectedCells.current, id)
375
375
  }, 10);
376
376
  const defaultRowValue = (0, _hooks.getDefaultValue)(defaultValue);
377
377
  // const rowId = defaultRowValue && defaultRowValue.id ? defaultRowValue.id : newGuid()
@@ -561,8 +561,8 @@ const GridEdit = props => {
561
561
  }, [dataSource, defaultValue, getRowKey, mergedExpandedKeys, rowKey, rowsFocus, triggerChangeData]);
562
562
  const handleDeleteRows = _react.default.useCallback(item => {
563
563
  setTimeout(() => {
564
- (0, _hooks.onAddBgSelectedCell)(selectedCells.current, id);
565
- (0, _hooks.onAddBorderSelectedCell)(selectedCells.current, id);
564
+ // onAddBgSelectedCell(selectedCells.current, id)
565
+ // onAddBorderSelectedCell(selectedCells.current, id)
566
566
  });
567
567
  if (item.onClick) {
568
568
  item.onClick({
@@ -824,7 +824,7 @@ const GridEdit = props => {
824
824
  }
825
825
  } = (0, _reactHookForm.useForm)({
826
826
  mode: 'onChange',
827
- resolver: (0, _yup.yupResolver)(validate)
827
+ resolver: validate ? (0, _yup.yupResolver)(validate) : undefined
828
828
  });
829
829
  const isEditing = _react.default.useCallback(record => {
830
830
  return record[rowKey] === editingKey;
@@ -874,77 +874,6 @@ const GridEdit = props => {
874
874
  document.removeEventListener("click", handleClickOutside);
875
875
  };
876
876
  }, [id]);
877
- const handleMouseDown = (record, row, col, e) => {
878
- if (editingKey && editingKey === record[rowKey]) {
879
- return;
880
- }
881
- if (e.button === 2) {
882
- e.stopPropagation();
883
- return;
884
- }
885
-
886
- // isDragMouse.current = true
887
- isMouseDown.current = true;
888
- if (e.ctrlKey) {
889
- isSelecting.current = true;
890
- startCell.current = {
891
- row,
892
- col
893
- };
894
-
895
- // const cell: any = new Set([`${row}-${col}`])
896
-
897
- // setCurrentCtrlCells(cell)
898
- } else {
899
- isSelecting.current = true;
900
- startCell.current = {
901
- row,
902
- col
903
- };
904
- const target = e.target;
905
- if (target.closest('.dragging-point')) {
906
- e.stopPropagation();
907
- e.preventDefault();
908
- return; // Không xử lý gì cả
909
- } else {
910
- // setStartSelectedCell({row, col})
911
-
912
- startSelectedCells.current = {
913
- row,
914
- col
915
- };
916
-
917
- // setSelectedCells(new Set([`${row}-${col}`]));
918
-
919
- const cells = new Set([`${row}-${col}`]);
920
- if (selectedCells.current && selectedCells.current.size > 0) {
921
- if (!(0, _hooks.isEqualSet)(cells, rangeCells)) {
922
- (0, _hooks.onRemoveBgSelectedCell)(rangeCells, id);
923
- (0, _hooks.onRemoveBorderSelectedCell)(rangeCells, id);
924
- (0, _hooks.hideDraggingPoint)(rangeCells, id);
925
- }
926
- }
927
- if (rowsSelected.current && rowsSelected.current.size > 0) {
928
- (0, _hooks.removeClassCellIndexSelected)(rowsSelected.current, id);
929
- }
930
- if (!(0, _hooks.isEqualSet)(cells, selectedCells.current)) {
931
- selectedCells.current = cells;
932
- if (editingKey) {
933
- setTimeout(() => {
934
- (0, _hooks.onAddBgSelectedCell)(cells, id);
935
- (0, _hooks.onAddBorderSelectedCell)(cells, id);
936
- }, 200);
937
- } else {
938
- (0, _hooks.onAddBgSelectedCell)(cells, id);
939
- (0, _hooks.onAddBorderSelectedCell)(cells, id);
940
- }
941
- }
942
-
943
- // setRowsSelected(new Set())
944
- rowsSelected.current = new Set();
945
- }
946
- }
947
- };
948
877
  const triggerDragPaste = pastesArray => {
949
878
  const mergedSet = new Set([...selectedCells.current, ...pastesArray]);
950
879
  const tmpCols = {
@@ -965,35 +894,6 @@ const GridEdit = props => {
965
894
  // return { row, col, value: '' };
966
895
  });
967
896
 
968
- // let selectedArray = []
969
- //
970
- // if (rowPasteLast > rowSelectedFirst) {
971
- // // kéo xuóng
972
- // selectedArray = Array.from(selectedCells).map((key: any) => {
973
- //
974
- // const [row, col] = key.split("-").map(Number);
975
- // // @ts-ignore
976
- // const columnKey = columns[col].field;
977
- //
978
- // // @ts-ignore
979
- // return { row, col, value: flattenData(childrenColumnName as any,dataSource)[row][columnKey] };
980
- // // return { row, col, value: '' };
981
- // });
982
- // } else {
983
- // // kéo lên
984
- //
985
- // selectedArray = Array.from(sortedSetDSC(selectedCells)).map((key: any) => {
986
- //
987
- // const [row, col] = key.split("-").map(Number);
988
- // // @ts-ignore
989
- // const columnKey = columns[col].field;
990
- //
991
- // // @ts-ignore
992
- // return { row, col, value: flattenData(childrenColumnName as any,dataSource)[row][columnKey] };
993
- // // return { row, col, value: '' };
994
- // });
995
- // }
996
-
997
897
  // Xác định min/max row và col để sắp xếp dữ liệu
998
898
  const minRow = Math.min(...selectedArray.map(cell => cell.row));
999
899
  const maxRow = Math.max(...selectedArray.map(cell => cell.row));
@@ -1073,18 +973,20 @@ const GridEdit = props => {
1073
973
 
1074
974
  /// cập nhật cell class
1075
975
  if (selectedCells.current && selectedCells.current.size > 0) {
1076
- (0, _hooks.onRemoveBgSelectedCell)(rangeCells, id);
1077
- (0, _hooks.onRemoveBorderSelectedCell)(rangeCells, id);
976
+ // onRemoveBgSelectedCell(rangeCells, id)
977
+ // onRemoveBorderSelectedCell(rangeCells, id)
1078
978
  }
1079
979
 
1080
980
  // selectedCells.current = sortedSetASC(mergedSet)
1081
981
  (0, _hooks.hideDraggingPoint)(selectedCells.current, id);
1082
- selectedCells.current = (0, _hooks.sortedSetASC)(mergedSet);
1083
- setRangeCells((0, _hooks.sortedSetASC)(mergedSet));
982
+ const newCells = (0, _hooks.sortedSetASC)(mergedSet);
983
+ selectedCells.current = newCells;
984
+ (0, _hooks.onAddBgCellIndex)(newCells, id);
985
+ setRangeCells(newCells);
986
+ (0, _hooks.onAddBgSelectedCell)(newCells, id);
987
+ (0, _hooks.onAddBorderSelectedCell)(newCells, id);
1084
988
  setTimeout(() => {
1085
- (0, _hooks.onAddBgSelectedCell)((0, _hooks.sortedSetASC)(mergedSet), id);
1086
- (0, _hooks.onAddBorderSelectedCell)((0, _hooks.sortedSetASC)(mergedSet), id);
1087
- (0, _hooks.showDraggingPoint)((0, _hooks.sortedSetASC)(mergedSet), id);
989
+ (0, _hooks.showDraggingPoint)(newCells, id);
1088
990
  }, 50);
1089
991
 
1090
992
  // setPasteCells(new Set())
@@ -1109,6 +1011,80 @@ const GridEdit = props => {
1109
1011
  (0, _hooks.hideDraggingPoint)(selectedCells.current, id);
1110
1012
  triggerDragPaste(newPasteCells);
1111
1013
  };
1014
+ const handleMouseDown = (record, row, col, e) => {
1015
+ if (e.button === 2) {
1016
+ e.stopPropagation();
1017
+ return;
1018
+ }
1019
+ if (editingKey && editingKey === record[rowKey]) {
1020
+ return;
1021
+ }
1022
+ if (record[rowKey] !== editingKey && editingKey !== '') {
1023
+ setEditingKey('');
1024
+ }
1025
+
1026
+ // isDragMouse.current = true
1027
+ isMouseDown.current = true;
1028
+ if (e.ctrlKey) {
1029
+ isSelecting.current = true;
1030
+ startCell.current = {
1031
+ row,
1032
+ col
1033
+ };
1034
+
1035
+ // const cell: any = new Set([`${row}-${col}`])
1036
+
1037
+ // setCurrentCtrlCells(cell)
1038
+ } else {
1039
+ isSelecting.current = true;
1040
+ startCell.current = {
1041
+ row,
1042
+ col
1043
+ };
1044
+ const target = e.target;
1045
+ if (target.closest('.dragging-point')) {
1046
+ e.stopPropagation();
1047
+ e.preventDefault();
1048
+ return; // Không xử lý gì cả
1049
+ } else {
1050
+ // setStartSelectedCell({row, col})
1051
+
1052
+ startSelectedCells.current = {
1053
+ row,
1054
+ col
1055
+ };
1056
+
1057
+ // setSelectedCells(new Set([`${row}-${col}`]));
1058
+
1059
+ const cells = new Set([`${row}-${col}`]);
1060
+ if (selectedCells.current && selectedCells.current.size > 0) {
1061
+ if (!(0, _hooks.isEqualSet)(cells, rangeCells)) {
1062
+ // onRemoveBgSelectedCell(rangeCells, id)
1063
+ // onRemoveBorderSelectedCell(rangeCells, id)
1064
+ (0, _hooks.hideDraggingPoint)(rangeCells, id);
1065
+ (0, _hooks.onRemoveBgCellIndex)(selectedCells.current, id);
1066
+ }
1067
+ }
1068
+ if (rowsSelected.current && rowsSelected.current.size > 0) {
1069
+ (0, _hooks.removeClassCellIndexSelected)(rowsSelected.current, id);
1070
+ }
1071
+ if (!(0, _hooks.isEqualSet)(cells, selectedCells.current)) {
1072
+ (0, _hooks.onRemoveBgSelectedCell)(selectedCells.current, id);
1073
+ (0, _hooks.hideDraggingPoint)(selectedCells.current, id);
1074
+ selectedCells.current = cells;
1075
+ // setRangeCells(cells)
1076
+
1077
+ (0, _hooks.onAddBgCellIndex)(cells, id);
1078
+ (0, _hooks.onAddBorderSelectedCell)(cells, id);
1079
+ (0, _hooks.onAddBgSelectedCell)(selectedCells.current, id, false);
1080
+ (0, _hooks.showDraggingPoint)(selectedCells.current, id);
1081
+ }
1082
+
1083
+ // setRowsSelected(new Set())
1084
+ rowsSelected.current = new Set();
1085
+ }
1086
+ }
1087
+ };
1112
1088
  const handleMouseUp = e => {
1113
1089
  isSelecting.current = false;
1114
1090
  startCell.current = null;
@@ -1117,12 +1093,6 @@ const GridEdit = props => {
1117
1093
  isDragMouse.current = false;
1118
1094
  isMouseDown.current = false;
1119
1095
  setIsPasteDragging(false);
1120
-
1121
- // isPasteDragging.current = false
1122
- // setSelectIsDragging(false);
1123
-
1124
- // setCurrentCtrlCells(new Set())
1125
-
1126
1096
  if (e.ctrlKey) {
1127
1097
 
1128
1098
  // setCtrlCells([...ctrlCells, currentCtrlCells])
@@ -1134,18 +1104,20 @@ const GridEdit = props => {
1134
1104
  triggerDragPaste(pasteCells.current);
1135
1105
  } else {
1136
1106
  setRangeCells(selectedCells.current);
1137
- (0, _hooks.onRemoveBorderSelectedCell)(rangeCells, id);
1138
- (0, _hooks.onAddBorderSelectedCell)(selectedCells.current, id);
1139
1107
  const target = e.target;
1140
1108
  if (target.closest('.dragging-point')) {
1141
1109
  e.stopPropagation();
1142
1110
  e.preventDefault();
1143
1111
  return; // Không xử lý gì cả
1144
1112
  }
1145
- if (selectedCells.current && selectedCells.current.size > 0) {
1113
+ if (selectedCells.current && selectedCells.current.size > 1) {
1146
1114
  (0, _hooks.hideDraggingPoint)(selectedCells.current, id);
1115
+ (0, _hooks.onAddBorderSelectedCell)(selectedCells.current, id);
1116
+
1117
+ // showDraggingPoint(selectedCells.current, id)
1147
1118
  }
1148
1119
  (0, _hooks.showDraggingPoint)(selectedCells.current, id);
1120
+ // onAddBorderSelectedCell(selectedCells.current, id)
1149
1121
  }
1150
1122
  };
1151
1123
  const handleMouseEnter = (row, col, e) => {
@@ -1264,15 +1236,17 @@ const GridEdit = props => {
1264
1236
  // setSelectedCells(new Set(newSelectedCells));
1265
1237
 
1266
1238
  if (selectedCells.current && selectedCells.current.size > 0) {
1267
- (0, _hooks.onRemoveBgSelectedCell)(selectedCells.current, id);
1268
- (0, _hooks.onRemoveBorderSelectedCell)(selectedCells.current, id);
1239
+ // onRemoveBgSelectedCell(selectedCells.current, id)
1240
+ // onRemoveBorderSelectedCell(selectedCells.current, id)
1269
1241
  }
1270
1242
  if (rowsSelected.current && rowsSelected.current.size > 0) {
1271
1243
  (0, _hooks.removeClassCellIndexSelected)(rowsSelected.current, id);
1272
1244
  }
1273
1245
  selectedCells.current = newSelectedCells;
1274
- (0, _hooks.onAddBgSelectedCell)(newSelectedCells, id);
1275
- (0, _hooks.onAddBorderSelectedCell)(newSelectedCells, id);
1246
+
1247
+ // onAddBgSelectedCell(newSelectedCells, id)
1248
+ // onAddBorderSelectedCell(newSelectedCells, id)
1249
+
1276
1250
  (0, _hooks.hideDraggingPoint)(selectedCells.current, id);
1277
1251
  (0, _hooks.showDraggingPoint)(newSelectedCells, id);
1278
1252
  };
@@ -1281,6 +1255,9 @@ const GridEdit = props => {
1281
1255
  e.stopPropagation();
1282
1256
  return;
1283
1257
  }
1258
+ if (editingKey) {
1259
+ setEditingKey('');
1260
+ }
1284
1261
  isSelectingRow.current = true;
1285
1262
  rowStart.current = {
1286
1263
  row,
@@ -1293,13 +1270,11 @@ const GridEdit = props => {
1293
1270
  newSelectedCells.add(`${r}-${c}`);
1294
1271
  }
1295
1272
  }
1296
-
1297
- // setSelectedCells(newSelectedCells)
1298
- // setRowsSelected(new Set([`${row}-${col}`]));
1299
-
1300
1273
  if (selectedCells.current && selectedCells.current.size > 0) {
1274
+ (0, _hooks.onRemoveBgCellIndex)(selectedCells.current, id);
1301
1275
  (0, _hooks.onRemoveBgSelectedCell)(selectedCells.current, id);
1302
1276
  (0, _hooks.onRemoveBorderSelectedCell)(selectedCells.current, id);
1277
+ // onRemoveBorderSelectedCell(selectedCells.current, id)
1303
1278
  }
1304
1279
  if (rowsSelected.current && rowsSelected.current.size > 0) {
1305
1280
  (0, _hooks.removeClassCellIndexSelected)(rowsSelected.current, id);
@@ -1308,7 +1283,9 @@ const GridEdit = props => {
1308
1283
  selectedCells.current = newSelectedCells;
1309
1284
  rowsSelected.current = new Set([`${row}-${col}`]);
1310
1285
  (0, _hooks.onAddBgSelectedCell)(newSelectedCells, id, false);
1311
- (0, _hooks.onAddBorderSelectedCell)(newSelectedCells, id);
1286
+ setTimeout(() => {
1287
+ (0, _hooks.onAddBgSelectedCell)(newSelectedCells, id, false);
1288
+ }, 10);
1312
1289
  (0, _hooks.addClassCellIndexSelected)(new Set([`${row}-${col}`]), id);
1313
1290
  };
1314
1291
  const handleMouseEnterRowHeader = (row, col, e) => {
@@ -1338,13 +1315,11 @@ const GridEdit = props => {
1338
1315
  if (selectedCells.current && selectedCells.current.size > 0) {
1339
1316
  (0, _hooks.onRemoveBgSelectedCell)(selectedCells.current, id);
1340
1317
  }
1341
- // setSelectedCells(newSelectedCells)
1342
1318
  selectedCells.current = newSelectedCells;
1343
1319
  (0, _hooks.onAddBgSelectedCell)(newSelectedCells, id);
1344
1320
  if (rowsSelected.current && rowsSelected.current.size > 0) {
1345
1321
  (0, _hooks.removeClassCellIndexSelected)(rowsSelected.current, id);
1346
1322
  }
1347
- // setRowsSelected(newSelectedRows)
1348
1323
  rowsSelected.current = newSelectedRows;
1349
1324
  (0, _hooks.addClassCellIndexSelected)(newSelectedRows, id);
1350
1325
  };
@@ -1763,6 +1738,7 @@ const GridEdit = props => {
1763
1738
  }
1764
1739
  };
1765
1740
  const handleEdit = (record, col, editType, e) => {
1741
+ (0, _hooks.onRemoveBorderSelectedCell)(selectedCells.current, id);
1766
1742
  setTooltipContent('');
1767
1743
  // @ts-ignore
1768
1744
  setEditingKey(record[rowKey]);
@@ -1862,10 +1838,16 @@ const GridEdit = props => {
1862
1838
  (0, _hooks.hideDraggingPoint)(selectedCells.current, id);
1863
1839
  selectedCells.current = cells;
1864
1840
  setRangeCells(cells);
1865
- setTimeout(() => {
1866
- (0, _hooks.onAddBgSelectedCell)(selectedCells.current, id);
1867
- (0, _hooks.onAddBorderSelectedCell)(selectedCells.current, id);
1868
- }, 50);
1841
+
1842
+ // setTimeout(() => {
1843
+ //
1844
+ // // onAddBgSelectedCell(selectedCells.current, id)
1845
+ // // onAddBorderSelectedCell(selectedCells.current, id)
1846
+ //
1847
+ // }, 50)
1848
+
1849
+ (0, _hooks.onAddBgSelectedCell)(selectedCells.current, id);
1850
+ (0, _hooks.onAddBorderSelectedCell)(selectedCells.current, id);
1869
1851
  (0, _hooks.showDraggingPoint)(cells, id);
1870
1852
  };
1871
1853
  const focusNextCell = (editingCell, cellEditable) => {
@@ -1874,6 +1856,7 @@ const GridEdit = props => {
1874
1856
  updateSelection();
1875
1857
  if (e?.key !== 'Tab') {
1876
1858
  editingCell.focus();
1859
+ // editingCell.click()
1877
1860
  }
1878
1861
  }
1879
1862
  if (scrollType === 'horizontal' && editingCell) {
@@ -1885,6 +1868,8 @@ const GridEdit = props => {
1885
1868
  scrollToCell(rowIndex, colIndex, cellEdit, 'vertical');
1886
1869
  if (e?.key !== 'Tab') {
1887
1870
  cellEditable.focus();
1871
+ (0, _hooks.onAddBorderSelectedCell)(selectedCells.current, id);
1872
+ // editingCell.click()
1888
1873
  }
1889
1874
  }
1890
1875
  } else {
@@ -1892,6 +1877,7 @@ const GridEdit = props => {
1892
1877
  updateSelection();
1893
1878
  if (e?.key !== 'Tab') {
1894
1879
  cellEditable.focus();
1880
+ (0, _hooks.onAddBorderSelectedCell)(selectedCells.current, id);
1895
1881
  }
1896
1882
  }
1897
1883
  if (cellEditable) {
@@ -1913,296 +1899,312 @@ const GridEdit = props => {
1913
1899
  focusNextCell(cellEdit, cell);
1914
1900
  }
1915
1901
  };
1916
- const convertColumns = (0, _columns.flatColumns2)(columns.filter(it => it.visible !== false)).map((column, colIndex) => {
1917
- if (column === _InternalTable.SELECTION_COLUMN) {
1918
- return _InternalTable.SELECTION_COLUMN;
1919
- }
1920
- if (column.field === '#') {
1902
+ const convertColumns = _react.default.useMemo(() => {
1903
+ return (0, _columns.flatColumns2)(columns.filter(it => it.visible !== false)).map((column, colIndex) => {
1904
+ if (column === _InternalTable.SELECTION_COLUMN) {
1905
+ return _InternalTable.SELECTION_COLUMN;
1906
+ }
1907
+ if (column.field === '#') {
1908
+ return {
1909
+ ...column,
1910
+ className: 'rc-ui-cell-editable rc-ui-cell-index',
1911
+ onCell: (record, rowIndex) => {
1912
+ const rowNumber = (0, _hooks.getRowNumber)(dataSource, record[rowKey], rowKey);
1913
+ return {
1914
+ 'data-row-index': rowNumber,
1915
+ onPaste: event => {
1916
+ if (editingKey === '') {
1917
+ handlePaste(record, colIndex + 1, rowNumber, event);
1918
+ event.preventDefault();
1919
+ }
1920
+ },
1921
+ onCopy: e => {
1922
+ if (editingKey === '') {
1923
+ handleCopy(e);
1924
+ e.preventDefault();
1925
+ }
1926
+ },
1927
+ // onClick: () => {
1928
+ // if (record[rowKey] !== editingKey && (editingKey !== '')) {
1929
+ // setEditingKey('')
1930
+ // }
1931
+ // },
1932
+ tabIndex: (rowIndex ?? 0) * visibleCols.length + colIndex
1933
+ };
1934
+ },
1935
+ render: (value, record) => {
1936
+ const rowNumber = (0, _hooks.getRowNumber)(dataSource, record[rowKey], rowKey);
1937
+ return /*#__PURE__*/_react.default.createElement("div", {
1938
+ className: (0, _classnames.default)('ui-rc_cell-content ui-rc_cell-content--index', {}),
1939
+ onMouseDown: event => handleMouseDownRowHeader(rowNumber, colIndex, column, event),
1940
+ onMouseEnter: event => handleMouseEnterRowHeader(rowNumber, colIndex, event),
1941
+ onMouseUp: event => handleMouseUp(event)
1942
+ }, /*#__PURE__*/_react.default.createElement("div", {
1943
+ className: 'ui-rc_content'
1944
+ }, (0, _hooks.findItemPath)(dataSource, record, rowKey)));
1945
+ }
1946
+ };
1947
+ }
1948
+ if (column.field === 'command') {
1949
+ return {
1950
+ ...column
1951
+ };
1952
+ }
1921
1953
  return {
1922
1954
  ...column,
1923
- className: 'rc-ui-cell-editable rc-ui-cell-index',
1924
1955
  onCell: (record, rowIndex) => {
1925
1956
  const rowNumber = (0, _hooks.getRowNumber)(dataSource, record[rowKey], rowKey);
1926
1957
  return {
1927
- 'data-row-index': rowNumber,
1928
- onPaste: event => {
1929
- if (editingKey === '') {
1930
- handlePaste(record, colIndex + 1, rowNumber, event);
1931
- event.preventDefault();
1932
- }
1933
- },
1934
- onCopy: e => {
1935
- if (editingKey === '') {
1936
- handleCopy(e);
1937
- e.preventDefault();
1938
- }
1939
- },
1940
- onClick: () => {
1941
- if (record[rowKey] !== editingKey && editingKey !== '') {
1942
- setEditingKey('');
1943
- }
1944
- },
1945
- tabIndex: (rowIndex ?? 0) * visibleCols.length + colIndex
1946
- };
1947
- },
1948
- render: (value, record) => {
1949
- const rowNumber = (0, _hooks.getRowNumber)(dataSource, record[rowKey], rowKey);
1950
- return /*#__PURE__*/_react.default.createElement("div", {
1951
- className: (0, _classnames.default)('ui-rc_cell-content ui-rc_cell-content--index', {}),
1952
- onMouseDown: event => handleMouseDownRowHeader(rowNumber, colIndex, column, event),
1953
- onMouseEnter: event => handleMouseEnterRowHeader(rowNumber, colIndex, event),
1954
- onMouseUp: handleMouseUp
1955
- }, /*#__PURE__*/_react.default.createElement("div", {
1956
- className: 'ui-rc_content'
1957
- }, (0, _hooks.findItemPath)(dataSource, record, rowKey)));
1958
- }
1959
- };
1960
- }
1961
- if (column.field === 'command') {
1962
- return {
1963
- ...column
1964
- };
1965
- }
1966
- return {
1967
- ...column,
1968
- onCell: (record, rowIndex) => {
1969
- const rowNumber = (0, _hooks.getRowNumber)(dataSource, record[rowKey], rowKey);
1970
- return {
1971
- ...column?.onCell?.(record, rowIndex),
1972
- onKeyDown: event => {
1973
- const key = getRowKey(record, dataSource.indexOf(record));
1974
- if (event.key === 'Control' && event.ctrlKey) {} else {
1975
- if (event.key.length === 1 && !event.ctrlKey && !event.metaKey || event.key === 'Enter') {
1976
- if (record[rowKey] !== editingKey && (0, _hooks.isEditable)(column, record)) {
1977
- // ~~ khi editingKey = ''
1978
- event.preventDefault();
1979
- event.stopPropagation();
1980
- handleEdit(record, column, column.editType, event);
1981
- (0, _hooks.onRemoveBgSelectedCell)(selectedCells.current, id);
1982
- (0, _hooks.onRemoveBorderSelectedCell)(selectedCells.current, id);
1983
- selectedCells.current = new Set();
1984
- handleCellClick(rowNumber, record, column);
1985
- const hasKey = mergedExpandedKeys.has(key);
1986
- if (hasKey) {
1987
- // mergedExpandedKeys.delete(key);
1988
- // newExpandedKeys = [...mergedExpandedKeys];
1989
- } else {
1990
- onTriggerExpand(record);
1991
- }
1992
- } else {
1993
- if (event.key === 'Enter') {
1958
+ ...column?.onCell?.(record, rowIndex),
1959
+ onKeyDown: event => {
1960
+ const key = getRowKey(record, dataSource.indexOf(record));
1961
+ if (event.key === 'Control' && event.ctrlKey) {} else {
1962
+ if (event.key.length === 1 && !event.ctrlKey && !event.metaKey || event.key === 'Enter') {
1963
+ if (record[rowKey] !== editingKey && (0, _hooks.isEditable)(column, record)) {
1964
+ // ~~ khi editingKey = ''
1994
1965
  event.preventDefault();
1995
1966
  event.stopPropagation();
1996
- if (editingKey && editingKey !== '' && (rowNumber ?? 0) + 1 < (0, _hooks.flattenArray)(dataSource).length && event.key === 'Enter') {
1997
- handleFocusCell((rowNumber ?? 0) + 1, colIndex, column, 'vertical', event);
1998
- } else {
1999
- // // focus cell hiện tại và tắt edit
2000
- // handleFocusCell((rowNumber ?? 0), colIndex, column, 'vertical', event)
2001
- // setEditingKey('')
1967
+ handleEdit(record, column, column.editType, event);
2002
1968
 
2003
- // thêm dòng mới
1969
+ // onRemoveBgSelectedCell(selectedCells.current, id)
1970
+ // onRemoveBorderSelectedCell(selectedCells.current, id)
2004
1971
 
2005
- handleAddSingle();
2006
- handleFocusCell((rowNumber ?? 0) + 1, colIndex, column, 'vertical', event, true);
1972
+ // selectedCells.current = new Set()
1973
+
1974
+ handleCellClick(rowNumber, record, column);
1975
+ const hasKey = mergedExpandedKeys.has(key);
1976
+ if (hasKey) {
1977
+ // mergedExpandedKeys.delete(key);
1978
+ // newExpandedKeys = [...mergedExpandedKeys];
1979
+ } else {
1980
+ onTriggerExpand(record);
1981
+ }
1982
+ } else {
1983
+ if (event.key === 'Enter') {
1984
+ event.preventDefault();
1985
+ event.stopPropagation();
1986
+ if (editingKey && editingKey !== '' && (rowNumber ?? 0) + 1 < (0, _hooks.flattenArray)(dataSource).length && event.key === 'Enter') {
1987
+ handleFocusCell((rowNumber ?? 0) + 1, colIndex, column, 'vertical', event);
1988
+ } else {
1989
+ // // focus cell hiện tại và tắt edit
1990
+ // handleFocusCell((rowNumber ?? 0), colIndex, column, 'vertical', event)
1991
+ // setEditingKey('')
1992
+
1993
+ // thêm dòng mới
1994
+
1995
+ handleAddSingle();
1996
+ handleFocusCell((rowNumber ?? 0) + 1, colIndex, column, 'vertical', event, true);
1997
+ }
2007
1998
  }
2008
1999
  }
2009
2000
  }
2010
- }
2011
- if (event.key === 'Tab') {
2012
- if (editingKey) {} else {
2013
- if (colIndex + 1 !== visibleCols.length) {
2001
+ if (event.key === 'Tab') {
2002
+ if (editingKey) {} else {
2003
+ if (colIndex + 1 !== visibleCols.length) {
2004
+ handleFocusCell(rowNumber, colIndex + 1, column, 'horizontal', event);
2005
+ } else {
2006
+ event.stopPropagation();
2007
+ event.preventDefault();
2008
+ }
2009
+ }
2010
+ }
2011
+ if (event.key === 'ArrowRight' && colIndex + 1 !== visibleCols.length) {
2012
+ if (editingKey !== '') {} else {
2014
2013
  handleFocusCell(rowNumber, colIndex + 1, column, 'horizontal', event);
2015
- } else {
2014
+ }
2015
+ }
2016
+ if (event.key === 'ArrowLeft' && colIndex > 0) {
2017
+ if (!column.dataIndex && !column.key || column.field === '#' || column.dataIndex === '#') {
2016
2018
  event.stopPropagation();
2017
2019
  event.preventDefault();
2020
+ } else {
2021
+ if (editingKey !== '') {} else {
2022
+ handleFocusCell(rowNumber, colIndex - 1, column, 'horizontal', event);
2023
+ }
2018
2024
  }
2019
2025
  }
2020
- }
2021
- if (event.key === 'ArrowRight' && colIndex + 1 !== visibleCols.length) {
2022
- if (editingKey !== '') {} else {
2023
- handleFocusCell(rowNumber, colIndex + 1, column, 'horizontal', event);
2026
+ if (event.key === 'ArrowDown' && (rowNumber ?? 0) + 1 < (0, _hooks.flattenArray)(dataSource).length) {
2027
+ if (isEditing(record) && ((0, _hooks.getEditType)(column, record) === 'treeSelect' || (0, _hooks.getEditType)(column, record) === 'select' || (0, _hooks.getEditType)(column, record) === 'selectTable' || (0, _hooks.getEditType)(column, record) === 'asyncSelect')) {
2028
+ event.stopPropagation();
2029
+ } else {
2030
+ handleFocusCell((rowNumber ?? 0) + 1, colIndex, column, 'vertical', event);
2031
+ }
2024
2032
  }
2025
- }
2026
- if (event.key === 'ArrowLeft' && colIndex > 0) {
2027
- if (!column.dataIndex && !column.key || column.field === '#' || column.dataIndex === '#') {
2028
- event.stopPropagation();
2029
- event.preventDefault();
2030
- } else {
2031
- if (editingKey !== '') {} else {
2032
- handleFocusCell(rowNumber, colIndex - 1, column, 'horizontal', event);
2033
+ if (event.key === 'ArrowUp' && (rowNumber ?? 0) > 0) {
2034
+ if (isEditing(record) && ((0, _hooks.getEditType)(column, record) === 'asyncSelect' || (0, _hooks.getEditType)(column, record) === 'select' || (0, _hooks.getEditType)(column, record) === 'selectTable' || (0, _hooks.getEditType)(column, record) === 'treeSelect')) {
2035
+ event.stopPropagation();
2036
+ } else {
2037
+ handleFocusCell((rowNumber ?? 0) - 1, colIndex, column, 'vertical', event);
2033
2038
  }
2034
2039
  }
2035
- }
2036
- if (event.key === 'ArrowDown' && (rowNumber ?? 0) + 1 < (0, _hooks.flattenArray)(dataSource).length) {
2037
- if (isEditing(record) && ((0, _hooks.getEditType)(column, record) === 'treeSelect' || (0, _hooks.getEditType)(column, record) === 'select' || (0, _hooks.getEditType)(column, record) === 'selectTable' || (0, _hooks.getEditType)(column, record) === 'asyncSelect')) {
2038
- event.stopPropagation();
2039
- } else {
2040
- handleFocusCell((rowNumber ?? 0) + 1, colIndex, column, 'vertical', event);
2040
+ if (event.key === 'Delete') {
2041
+ handleDeleteContent();
2041
2042
  }
2042
- }
2043
- if (event.key === 'ArrowUp' && (rowNumber ?? 0) > 0) {
2044
- if (isEditing(record) && ((0, _hooks.getEditType)(column, record) === 'asyncSelect' || (0, _hooks.getEditType)(column, record) === 'select' || (0, _hooks.getEditType)(column, record) === 'selectTable' || (0, _hooks.getEditType)(column, record) === 'treeSelect')) {
2045
- event.stopPropagation();
2046
- } else {
2047
- handleFocusCell((rowNumber ?? 0) - 1, colIndex, column, 'vertical', event);
2043
+ if (event.key === 'Escape') {
2044
+ setEditingKey('');
2048
2045
  }
2049
2046
  }
2050
- if (event.key === 'Delete') {
2051
- handleDeleteContent();
2047
+ },
2048
+ onPaste: event => {
2049
+ if (editingKey === '') {
2050
+ handlePaste(record, colIndex, rowNumber, event);
2051
+ event.preventDefault();
2052
2052
  }
2053
- if (event.key === 'Escape') {
2054
- setEditingKey('');
2053
+ },
2054
+ onCopy: e => {
2055
+ if (editingKey === '') {
2056
+ handleCopy(e);
2057
+ e.preventDefault();
2055
2058
  }
2056
- }
2057
- },
2058
- onPaste: event => {
2059
- if (editingKey === '') {
2060
- handlePaste(record, colIndex, rowNumber, event);
2061
- event.preventDefault();
2062
- }
2063
- },
2064
- onCopy: e => {
2065
- if (editingKey === '') {
2066
- handleCopy(e);
2067
- e.preventDefault();
2068
- }
2069
- },
2070
- onDoubleClick: event => {
2071
- if (!isEditing(record) && record[rowKey] !== editingKey && (0, _hooks.isEditable)(column, record)) {
2072
- handleEdit(record, column, (0, _hooks.getEditType)(column, record), event);
2073
- (0, _hooks.onRemoveBgSelectedCell)(selectedCells.current, id);
2074
- (0, _hooks.onRemoveBorderSelectedCell)(selectedCells.current, id);
2075
- handleCellClick(rowNumber, record, column);
2076
- }
2077
- },
2078
- onContextMenu: () => {
2079
- // isSelecting.current = true;
2080
- // startCell.current = { row: rowNumber, col: colIndex };
2081
-
2082
- if (selectedCells.size === 0) {
2083
- // setStartSelectedCell({ row: rowNumber, col: colIndex })
2084
- // setSelectedCells(new Set([`${rowNumber}-${colIndex}`]));
2085
-
2086
- startSelectedCells.current = {
2087
- row: rowNumber,
2088
- col: colIndex
2089
- };
2090
- selectedCells.current = new Set([`${rowNumber}-${colIndex}`]);
2091
- rowsSelected.current = new Set();
2092
- }
2093
- },
2094
- onClick: () => {
2095
- if (record[rowKey] !== editingKey && editingKey !== '') {
2096
- setEditingKey('');
2097
- } else {
2098
- if (editingKey) {
2059
+ },
2060
+ onDoubleClick: event => {
2061
+ if (!isEditing(record) && record[rowKey] !== editingKey && (0, _hooks.isEditable)(column, record)) {
2062
+ handleEdit(record, column, (0, _hooks.getEditType)(column, record), event);
2063
+
2064
+ // onRemoveBgSelectedCell(selectedCells.current, id)
2065
+ // onRemoveBorderSelectedCell(selectedCells.current, id)
2099
2066
  handleCellClick(rowNumber, record, column);
2100
2067
  }
2068
+ },
2069
+ onContextMenu: () => {
2070
+ // isSelecting.current = true;
2071
+ // startCell.current = { row: rowNumber, col: colIndex };
2072
+
2073
+ if (selectedCells.size === 0) {
2074
+ // setStartSelectedCell({ row: rowNumber, col: colIndex })
2075
+ // setSelectedCells(new Set([`${rowNumber}-${colIndex}`]));
2076
+
2077
+ startSelectedCells.current = {
2078
+ row: rowNumber,
2079
+ col: colIndex
2080
+ };
2081
+ selectedCells.current = new Set([`${rowNumber}-${colIndex}`]);
2082
+ rowsSelected.current = new Set();
2083
+ }
2084
+ },
2085
+ onClick: () => {
2086
+ if (record[rowKey] !== editingKey && editingKey !== '') {
2087
+ // setEditingKey('')
2088
+ } else {
2089
+ if (record[rowKey] !== editingKey) {
2090
+ (0, _hooks.onAddBorderSelectedCell)(selectedCells.current, id);
2091
+ }
2092
+ if (editingKey) {
2093
+ handleCellClick(rowNumber, record, column);
2094
+ }
2095
+ }
2096
+ },
2097
+ // className: isEditing(record) ? `rc-ui-cell-editable cell-editing ${!isEditable(column as any, record) ? 'disable' : ''}` : `rc-ui-cell-editable cell-editable ${!isEditable(column as any, record) ? 'disable' : ''}`,
2098
+ className: (0, _classnames.default)('rc-ui-cell-editable', {
2099
+ 'cell-editing': isEditing(record),
2100
+ 'cell-editable': !isEditing(record)
2101
+ // selected: isSelectedCell(rangeCells,rowIndex, colIndex),
2102
+ // 'cell-border-bottom': isRangeCell(rangeCells, 'bottom',rowIndex, colIndex),
2103
+ // 'cell-border-right': isRangeCell(rangeCells, 'right',rowIndex, colIndex),
2104
+ // 'cell-border-top': isRangeCell(rangeCells, 'top',rowIndex, colIndex),
2105
+ // 'cell-border-left': isRangeCell(rangeCells, 'left',rowIndex, colIndex),
2106
+ // disable: !isEditable(column as any, record)
2107
+ }),
2108
+ record,
2109
+ column: column,
2110
+ editType: (0, _hooks.getEditType)(column, record),
2111
+ dataIndex: column.dataIndex,
2112
+ indexRow: rowNumber,
2113
+ indexCol: colIndex,
2114
+ title: (0, _columns.getValueCell)(column, record[column.field], format),
2115
+ 'data-col-index': colIndex,
2116
+ 'data-row-index': rowNumber,
2117
+ 'data-tooltip-id': "tooltip-cell-content",
2118
+ editing: isEditing(record) && rowEditable?.(record) !== false && (0, _hooks.isEditable)(column, record),
2119
+ cellEditing,
2120
+ t,
2121
+ tabIndex: (rowIndex ?? 0) * visibleCols.length + colIndex,
2122
+ style: isPasteDragging ? {
2123
+ cursor: "crosshair"
2124
+ } : {}
2125
+ };
2126
+ },
2127
+ onHeaderCell: (data, index) => {
2128
+ return {
2129
+ ...(column.onHeaderCell ? column.onHeaderCell?.(data, index) : {}),
2130
+ onClick: () => {
2131
+ handleClickColHeader(column, colIndex);
2132
+ },
2133
+ onCopy: e => {
2134
+ if (editingKey === '') {
2135
+ handleCopy(e);
2136
+ e.preventDefault();
2137
+ }
2138
+ },
2139
+ onPaste: event => {
2140
+ if (editingKey === '') {
2141
+ handlePaste(dataSource[0], colIndex, 0, event);
2142
+ event.preventDefault();
2143
+ }
2144
+ },
2145
+ style: {
2146
+ userSelect: 'none'
2101
2147
  }
2102
- },
2103
- className: isEditing(record) ? `rc-ui-cell-editable cell-editing ${!(0, _hooks.isEditable)(column, record) ? 'disable' : ''}` : `rc-ui-cell-editable cell-editable ${!(0, _hooks.isEditable)(column, record) ? 'disable' : ''}`,
2104
- record,
2105
- column: column,
2106
- editType: (0, _hooks.getEditType)(column, record),
2107
- dataIndex: column.dataIndex,
2108
- indexRow: rowNumber,
2109
- indexCol: colIndex,
2110
- title: (0, _columns.getValueCell)(column, record[column.field], format),
2111
- 'data-col-index': colIndex,
2112
- 'data-row-index': rowNumber,
2113
- 'data-tooltip-id': "tooltip-cell-content",
2114
- // 'data-tooltip-content': 'tooltip-cell-content',
2115
- // 'data-tooltip-delay-show': 1000,
2116
- // 'data-tooltip-content': getValueCell(column, record[column.field as any], format),
2117
- editing: isEditing(record) && rowEditable?.(record) !== false && (0, _hooks.isEditable)(column, record),
2118
- cellEditing,
2119
- t,
2120
- tabIndex: (rowIndex ?? 0) * visibleCols.length + colIndex,
2121
- style: isPasteDragging ? {
2122
- cursor: "crosshair"
2123
- } : {}
2124
- };
2125
- },
2126
- onHeaderCell: (data, index) => {
2127
- return {
2128
- ...(column.onHeaderCell ? column.onHeaderCell?.(data, index) : {}),
2129
- onClick: () => {
2130
- handleClickColHeader(column, colIndex);
2131
- },
2132
- onCopy: e => {
2133
- if (editingKey === '') {
2134
- handleCopy(e);
2135
- e.preventDefault();
2136
- }
2137
- },
2138
- onPaste: event => {
2139
- if (editingKey === '') {
2140
- handlePaste(dataSource[0], colIndex, 0, event);
2141
- event.preventDefault();
2142
- }
2143
- },
2144
- style: {
2145
- userSelect: 'none'
2146
- }
2147
- };
2148
- },
2149
- render: (value, record, rowIndex) => {
2150
- const rowNumber = (0, _hooks.getRowNumber)(dataSource, record[rowKey], rowKey);
2151
- const colFormat = typeof column.format === 'function' ? column.format(record) : column.format;
2152
- const cellFormat = (0, _hooks.getFormat)(colFormat, format);
2153
- const rowError = dataErrors.find(it => it.index === rowNumber);
2154
- const cellError = rowError && column.field && rowError[column.field]?.field === column.field ? rowError[column.field] : null;
2155
-
2156
- // const aaa = dataErrors.find((it) => column?.field && it[column.field].field === column.field && it.index === rowNumber)
2157
- // const aaa = column.field && rowError && rowError[column.field]?.field === column?.field
2158
-
2159
- return /*#__PURE__*/_react.default.createElement("div", {
2160
- className: (0, _classnames.default)('ui-rc_cell-content', {
2161
- // disable: !isEditable(column as any, record)
2162
- isValid: column.field && rowError && rowError[column.field]?.field === column?.field
2163
- }),
2164
- onMouseDown: event => handleMouseDown(record, rowNumber, colIndex, event),
2165
- onMouseEnter: event => {
2166
- // setTooltipContent(cellError ? cellError.message : renderContent(column as any, value, record, rowIndex, cellFormat))
2167
- setTooltipContent(cellError ? cellError.message : '');
2168
- handleMouseEnter(rowNumber, colIndex, event);
2169
- },
2170
- onMouseUp: handleMouseUp,
2171
- onMouseMove: () => {
2172
- if (selectedCells && selectedCells.current.size > 0 && isMouseDown.current) {
2173
- (0, _hooks.hideDraggingPoint)(selectedCells.current, id);
2174
- isDragMouse.current = true;
2175
- }
2176
- }
2148
+ };
2149
+ },
2150
+ render: (value, record, rowIndex) => {
2151
+ const rowNumber = (0, _hooks.getRowNumber)(dataSource, record[rowKey], rowKey);
2152
+ const colFormat = typeof column.format === 'function' ? column.format(record) : column.format;
2153
+ const cellFormat = (0, _hooks.getFormat)(colFormat, format);
2154
+ const rowError = dataErrors.find(it => it.index === rowNumber);
2155
+ const cellError = rowError && column.field && rowError[column.field]?.field === column.field ? rowError[column.field] : null;
2177
2156
 
2178
- // onClick={(event) => {
2179
- //
2180
- // handleClickCell(event)
2181
- //
2182
- // }}
2183
- }, /*#__PURE__*/_react.default.createElement("div", {
2184
- className: 'ui-rc_content'
2185
- }, (0, _columns.renderContent)(column, value, record, rowIndex, cellFormat)),
2186
- // selectedCells.current && selectedCells.current.size > 0 && getLastSelectCell(selectedCells.current).row === rowNumber &&
2187
- // getLastSelectCell(selectedCells.current).col === colIndex &&
2188
- // isEditable(column as any, record) &&
2189
-
2190
- !isDragMouse.current && /*#__PURE__*/_react.default.createElement("div", {
2191
- className: 'dragging-point hidden',
2192
- onMouseDown: e => {
2193
- // e.stopPropagation()
2194
- e.preventDefault();
2195
- if (e.button === 0) {
2196
- setIsPasteDragging(true);
2157
+ // const aaa = dataErrors.find((it) => column?.field && it[column.field].field === column.field && it.index === rowNumber)
2158
+ // const aaa = column.field && rowError && rowError[column.field]?.field === column?.field
2159
+
2160
+ return /*#__PURE__*/_react.default.createElement("div", {
2161
+ className: (0, _classnames.default)('ui-rc_cell-content', {
2162
+ // disable: !isEditable(column as any, record)
2163
+ isValid: column.field && rowError && rowError[column.field]?.field === column?.field
2164
+ }),
2165
+ onMouseDown: event => handleMouseDown(record, rowNumber, colIndex, event),
2166
+ onMouseEnter: event => {
2167
+ // setTooltipContent(cellError ? cellError.message : renderContent(column as any, value, record, rowIndex, cellFormat))
2168
+ setTooltipContent(cellError ? cellError.message : '');
2169
+ handleMouseEnter(rowNumber, colIndex, event);
2170
+ },
2171
+ onMouseUp: handleMouseUp,
2172
+ onMouseMove: () => {
2173
+ if (selectedCells && selectedCells.current.size > 0 && isMouseDown.current) {
2174
+ (0, _hooks.hideDraggingPoint)(selectedCells.current, id);
2175
+ isDragMouse.current = true;
2176
+ }
2197
2177
  }
2198
- },
2199
- onDoubleClick: handlePointDoubleClick
2200
- }, /*#__PURE__*/_react.default.createElement("span", {
2201
- className: 'dot-point'
2202
- })));
2203
- }
2204
- };
2205
- });
2178
+
2179
+ // onClick={(event) => {
2180
+ //
2181
+ // handleClickCell(event)
2182
+ //
2183
+ // }}
2184
+ }, /*#__PURE__*/_react.default.createElement("div", {
2185
+ className: 'ui-rc_content'
2186
+ }, (0, _columns.renderContent)(column, value, record, rowIndex, cellFormat)),
2187
+ // selectedCells.current && selectedCells.current.size > 0 && getLastSelectCell(selectedCells.current).row === rowNumber &&
2188
+ // getLastSelectCell(selectedCells.current).col === colIndex &&
2189
+ // isEditable(column as any, record) &&
2190
+
2191
+ !isDragMouse.current && /*#__PURE__*/_react.default.createElement("div", {
2192
+ className: 'dragging-point hidden',
2193
+ onMouseDown: e => {
2194
+ // e.stopPropagation()
2195
+ e.preventDefault();
2196
+ if (e.button === 0) {
2197
+ setIsPasteDragging(true);
2198
+ }
2199
+ },
2200
+ onDoubleClick: handlePointDoubleClick
2201
+ }, /*#__PURE__*/_react.default.createElement("span", {
2202
+ className: 'dot-point'
2203
+ })));
2204
+ }
2205
+ };
2206
+ });
2207
+ }, [cellEditing, columns, dataErrors, dataSource, editingKey, format, getRowKey, handleAddSingle, handleCellClick, handleClickColHeader, handleCopy, handleDeleteContent, handleEdit, handleFocusCell, handleMouseDown, handleMouseDownRowHeader, handleMouseEnter, handleMouseEnterRowHeader, handleMouseUp, handlePaste, handlePointDoubleClick, id, isEditing, isPasteDragging, mergedExpandedKeys, onTriggerExpand, rangeCells, rowEditable, rowKey, setTooltipContent, t, visibleCols.length]);
2206
2208
  const transformColumns = _react.default.useCallback(cols => {
2207
2209
  // @ts-ignore
2208
2210
  return cols.map(column => {