es-grid-template 1.9.26 → 1.9.28
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.
- package/es/grid-component/type.d.ts +4 -1
- package/es/table-component/InternalTable.js +31 -1
- package/es/table-component/TableContainerEdit.js +59 -23
- package/es/table-component/body/EditableCell.js +68 -27
- package/es/table-component/body/TableBody.js +1 -1
- package/es/table-component/body/TableBodyCell.js +6 -2
- package/es/table-component/body/TableBodyCellEdit.js +7 -5
- package/es/table-component/footer/TableFooterRow.js +1 -1
- package/es/table-component/header/TableHeadCell2.js +2 -1
- package/es/table-component/style.js +12 -9
- package/es/table-component/style.scss +40 -232
- package/es/table-component/table/Grid.js +2 -1
- package/es/table-virtuoso/body/TableBodyCell.js +4 -1
- package/es/table-virtuoso/body/TableBodyRow.js +6 -7
- package/es/table-virtuoso/style.js +1 -1
- package/es/table-virtuoso/table/TableWrapper.js +3 -1
- package/lib/grid-component/type.d.ts +4 -1
- package/lib/table-component/InternalTable.js +31 -1
- package/lib/table-component/TableContainerEdit.js +84 -48
- package/lib/table-component/body/EditableCell.js +68 -27
- package/lib/table-component/body/TableBody.js +1 -1
- package/lib/table-component/body/TableBodyCell.js +6 -2
- package/lib/table-component/body/TableBodyCellEdit.js +7 -5
- package/lib/table-component/footer/TableFooterRow.js +1 -1
- package/lib/table-component/header/TableHeadCell2.js +3 -2
- package/lib/table-component/style.js +11 -8
- package/lib/table-component/style.scss +40 -232
- package/lib/table-component/table/Grid.js +2 -1
- package/lib/table-virtuoso/body/TableBodyCell.js +4 -1
- package/lib/table-virtuoso/body/TableBodyRow.js +6 -7
- package/lib/table-virtuoso/style.js +1 -1
- package/lib/table-virtuoso/table/TableWrapper.js +3 -1
- package/package.json +1 -1
|
@@ -491,7 +491,10 @@ export type TableProps<RecordType = AnyObject> = {
|
|
|
491
491
|
/** Cho phép chỉnh sửa dữ liệu */
|
|
492
492
|
editAble?: boolean;
|
|
493
493
|
/** Callback khi data thay đổi */
|
|
494
|
-
onDataChange?: (data: RecordType[]
|
|
494
|
+
onDataChange?: (data: RecordType[], args?: {
|
|
495
|
+
type: string;
|
|
496
|
+
row?: number;
|
|
497
|
+
}) => void;
|
|
495
498
|
/** Giá trị mặc định khi thêm mới */
|
|
496
499
|
defaultValue?: AnyObject | (() => AnyObject);
|
|
497
500
|
/** Callback xử lý paste dữ liệu */
|
|
@@ -167,7 +167,37 @@ const InternalTable = props => {
|
|
|
167
167
|
}
|
|
168
168
|
};
|
|
169
169
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
170
|
-
locale: language
|
|
170
|
+
locale: language,
|
|
171
|
+
theme: {
|
|
172
|
+
token: {
|
|
173
|
+
colorPrimary: '#eb4619',
|
|
174
|
+
colorLink: '#eb4619'
|
|
175
|
+
},
|
|
176
|
+
components: {
|
|
177
|
+
Input: {
|
|
178
|
+
activeBorderColor: '#1677ff',
|
|
179
|
+
hoverBorderColor: '#1677ff'
|
|
180
|
+
},
|
|
181
|
+
Button: {
|
|
182
|
+
colorLink: '#eb4619',
|
|
183
|
+
colorLinkHover: '#eb4619'
|
|
184
|
+
},
|
|
185
|
+
Select: {
|
|
186
|
+
activeBorderColor: '#1677ff',
|
|
187
|
+
hoverBorderColor: '#1677ff'
|
|
188
|
+
// colorPrimary: '#eb4619',
|
|
189
|
+
// colorBgBase: 'red'
|
|
190
|
+
},
|
|
191
|
+
DatePicker: {
|
|
192
|
+
colorPrimary: '#eb4619',
|
|
193
|
+
activeBorderColor: '#1677ff',
|
|
194
|
+
hoverBorderColor: '#1677ff'
|
|
195
|
+
},
|
|
196
|
+
Pagination: {
|
|
197
|
+
fontSize: 12
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
171
201
|
}, /*#__PURE__*/React.createElement(CustomProvider, {
|
|
172
202
|
locale: languages
|
|
173
203
|
}, /*#__PURE__*/React.createElement(Grid, _extends({}, rest, {
|
|
@@ -8,7 +8,9 @@ sumSize,
|
|
|
8
8
|
unFlattenData, updateArrayByKey, updateColumnWidthsRecursive, updateOrInsert } from "./hook/utils";
|
|
9
9
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
10
10
|
import { useForm } from 'react-hook-form';
|
|
11
|
-
import {
|
|
11
|
+
import { Modal, Typography } from "antd";
|
|
12
|
+
import Button from "rc-master-ui/es/button";
|
|
13
|
+
import Dropdown from "rc-master-ui/es/dropdown";
|
|
12
14
|
import Pagination from "rc-master-ui/es/pagination";
|
|
13
15
|
import { numericFormatter, removeNumericFormat } from "react-numeric-component";
|
|
14
16
|
import { TableContext } from "./useContext";
|
|
@@ -76,19 +78,15 @@ const TableContainerEdit = props => {
|
|
|
76
78
|
expandable,
|
|
77
79
|
wrapSettings,
|
|
78
80
|
recordDoubleClick,
|
|
79
|
-
// triggerFilter,
|
|
80
81
|
selectionSettings,
|
|
81
82
|
isSelectionChange,
|
|
82
83
|
setIsSelectionChange,
|
|
83
|
-
// onContextMenu,
|
|
84
84
|
contextMenuItems,
|
|
85
85
|
setSorterChange,
|
|
86
86
|
setFilterChange,
|
|
87
87
|
defaultFilter,
|
|
88
88
|
onCellPaste,
|
|
89
|
-
// triggerPaste,
|
|
90
89
|
validate,
|
|
91
|
-
// triggerChangeData,
|
|
92
90
|
onCellChange,
|
|
93
91
|
onDataChange,
|
|
94
92
|
defaultValue,
|
|
@@ -286,14 +284,16 @@ const TableContainerEdit = props => {
|
|
|
286
284
|
|
|
287
285
|
copy(tsv).then(() => {}).catch(() => {});
|
|
288
286
|
}, [startCell, endCell, table]);
|
|
289
|
-
const triggerChangeData = React.useCallback(newData => {
|
|
290
|
-
onDataChange?.(newData);
|
|
287
|
+
const triggerChangeData = React.useCallback((newData, args) => {
|
|
288
|
+
onDataChange?.(newData, args);
|
|
291
289
|
}, [onDataChange, dataSource]);
|
|
292
290
|
const triggerPaste = React.useCallback((pastedRows, pastedColumnsArray, newData, copyRows) => {
|
|
293
291
|
const handlePasteCallback = callbackData => {
|
|
294
292
|
const rsFilterData = updateOrInsert(flattenArray([...originData]), flattenArray([...callbackData]));
|
|
295
293
|
const rs = unFlattenData(rsFilterData);
|
|
296
|
-
triggerChangeData(rs
|
|
294
|
+
triggerChangeData(rs, {
|
|
295
|
+
type: 'OnPaste'
|
|
296
|
+
});
|
|
297
297
|
};
|
|
298
298
|
if (onCellPaste && onCellPaste.onPasted) {
|
|
299
299
|
if (onCellPaste.onPasted.length > 1) {
|
|
@@ -314,10 +314,14 @@ const TableContainerEdit = props => {
|
|
|
314
314
|
data: originData,
|
|
315
315
|
pastedColumns: pastedColumnsArray
|
|
316
316
|
}, handlePasteCallback);
|
|
317
|
-
triggerChangeData(newData
|
|
317
|
+
triggerChangeData(newData, {
|
|
318
|
+
type: 'OnPaste'
|
|
319
|
+
});
|
|
318
320
|
}
|
|
319
321
|
} else {
|
|
320
|
-
triggerChangeData(newData
|
|
322
|
+
triggerChangeData(newData, {
|
|
323
|
+
type: 'OnPaste'
|
|
324
|
+
});
|
|
321
325
|
}
|
|
322
326
|
}, [onCellPaste, originData, triggerChangeData]);
|
|
323
327
|
const handlePasted = React.useCallback(pasteData => {
|
|
@@ -745,7 +749,9 @@ const TableContainerEdit = props => {
|
|
|
745
749
|
const index = flattenData(childrenColumnName, newData).findIndex(item => formData[rowKey] === item[rowKey]);
|
|
746
750
|
const rs = updateArrayByKey(newData, row, rowKey);
|
|
747
751
|
if (index > -1) {
|
|
748
|
-
triggerChangeData?.(rs
|
|
752
|
+
triggerChangeData?.(rs, {
|
|
753
|
+
type: 'CellChange'
|
|
754
|
+
});
|
|
749
755
|
}
|
|
750
756
|
} catch (errInfo) {
|
|
751
757
|
console.log('Validate Failed:', errInfo);
|
|
@@ -765,7 +771,9 @@ const TableContainerEdit = props => {
|
|
|
765
771
|
const index = flattenData(childrenColumnName, newData).findIndex(item => formData[rowKey] === item[rowKey]);
|
|
766
772
|
const rs = updateArrayByKey(newData, row, rowKey);
|
|
767
773
|
if (index > -1) {
|
|
768
|
-
triggerChangeData?.(rs
|
|
774
|
+
triggerChangeData?.(rs, {
|
|
775
|
+
type: 'CellChange'
|
|
776
|
+
});
|
|
769
777
|
}
|
|
770
778
|
} catch (errInfo) {
|
|
771
779
|
console.log('Validate Failed:', errInfo);
|
|
@@ -965,7 +973,9 @@ const TableContainerEdit = props => {
|
|
|
965
973
|
const rs = updateOrInsert(originData, rsFilter);
|
|
966
974
|
// const rs2 = mergeWithFilter(originData, rsFilter)
|
|
967
975
|
|
|
968
|
-
triggerChangeData?.(rs
|
|
976
|
+
triggerChangeData?.(rs, {
|
|
977
|
+
type: 'DUPLICATE'
|
|
978
|
+
});
|
|
969
979
|
}, [dataSource, focusedCell, originData, rowKey, table, triggerChangeData]);
|
|
970
980
|
|
|
971
981
|
// thêm n dòng bên trên
|
|
@@ -1001,7 +1011,10 @@ const TableContainerEdit = props => {
|
|
|
1001
1011
|
setMergedFilterKeys?.(rs);
|
|
1002
1012
|
const index = newData.findIndex(obj => obj[rowKey] === record[rowKey]);
|
|
1003
1013
|
newData.splice(index, 0, ...newRows);
|
|
1004
|
-
triggerChangeData?.(newData
|
|
1014
|
+
triggerChangeData?.(newData, {
|
|
1015
|
+
type: 'INSERT_BEFORE',
|
|
1016
|
+
row: n
|
|
1017
|
+
});
|
|
1005
1018
|
} else {
|
|
1006
1019
|
const newData = [...originData];
|
|
1007
1020
|
const parent = findItemByKey(newData, rowKey, record.parentId);
|
|
@@ -1027,7 +1040,10 @@ const TableContainerEdit = props => {
|
|
|
1027
1040
|
children: childData
|
|
1028
1041
|
};
|
|
1029
1042
|
const newDataSource = updateArrayByKey(newData, newRowData, rowKey);
|
|
1030
|
-
triggerChangeData?.(newDataSource
|
|
1043
|
+
triggerChangeData?.(newDataSource, {
|
|
1044
|
+
type: 'INSERT_BEFORE',
|
|
1045
|
+
row: n
|
|
1046
|
+
});
|
|
1031
1047
|
}
|
|
1032
1048
|
}
|
|
1033
1049
|
}, [defaultValue, focusedCell, mergedFilterKeys, originData, rowKey, rowsFocus, setMergedFilterKeys, table, triggerChangeData]);
|
|
@@ -1065,7 +1081,10 @@ const TableContainerEdit = props => {
|
|
|
1065
1081
|
setMergedFilterKeys?.(rs);
|
|
1066
1082
|
const index = newData.findIndex(obj => obj[rowKey] === record[rowKey]);
|
|
1067
1083
|
newData.splice(index + 1, 0, ...newRows);
|
|
1068
|
-
triggerChangeData?.(newData
|
|
1084
|
+
triggerChangeData?.(newData, {
|
|
1085
|
+
type: 'INSERT_AFTER',
|
|
1086
|
+
row: n
|
|
1087
|
+
});
|
|
1069
1088
|
} else {
|
|
1070
1089
|
const newData = [...originData];
|
|
1071
1090
|
const parent = findItemByKey(newData, rowKey, record.parentId);
|
|
@@ -1094,7 +1113,10 @@ const TableContainerEdit = props => {
|
|
|
1094
1113
|
children: childData
|
|
1095
1114
|
};
|
|
1096
1115
|
const newDataSource = updateArrayByKey(newData, newRowData, rowKey);
|
|
1097
|
-
triggerChangeData?.(newDataSource
|
|
1116
|
+
triggerChangeData?.(newDataSource, {
|
|
1117
|
+
type: 'INSERT_AFTER',
|
|
1118
|
+
row: n
|
|
1119
|
+
});
|
|
1098
1120
|
}
|
|
1099
1121
|
}
|
|
1100
1122
|
}, [defaultValue, table, focusedCell?.rowId, originData, mergedFilterKeys, setMergedFilterKeys, triggerChangeData, rowKey]);
|
|
@@ -1132,7 +1154,9 @@ const TableContainerEdit = props => {
|
|
|
1132
1154
|
const rs = mergedFilterKeys ? [...mergedFilterKeys, rowId] : [rowId];
|
|
1133
1155
|
setMergedFilterKeys?.(rs);
|
|
1134
1156
|
const newDataSource = updateArrayByKey(newData, newElement, rowKey);
|
|
1135
|
-
triggerChangeData?.(newDataSource
|
|
1157
|
+
triggerChangeData?.(newDataSource, {
|
|
1158
|
+
type: 'INSERT_CHILDREN'
|
|
1159
|
+
});
|
|
1136
1160
|
}
|
|
1137
1161
|
setTimeout(() => {
|
|
1138
1162
|
const row = table.getRowModel().rows.find(it => it.id === focusedCell?.rowId);
|
|
@@ -1175,12 +1199,18 @@ const TableContainerEdit = props => {
|
|
|
1175
1199
|
buttonsStyling: false
|
|
1176
1200
|
}).then(async result => {
|
|
1177
1201
|
if (result.value) {
|
|
1178
|
-
triggerChangeData?.([...newDaa]
|
|
1202
|
+
triggerChangeData?.([...newDaa], {
|
|
1203
|
+
type: 'DELETE_ROWS',
|
|
1204
|
+
row: rowsFocus.length
|
|
1205
|
+
});
|
|
1179
1206
|
} else if (result.dismiss === MySwal.DismissReason.cancel) {}
|
|
1180
1207
|
});
|
|
1181
1208
|
} else {
|
|
1182
1209
|
// không hiện dialog
|
|
1183
|
-
triggerChangeData?.([...newDaa]
|
|
1210
|
+
triggerChangeData?.([...newDaa], {
|
|
1211
|
+
type: 'DELETE_ROWS',
|
|
1212
|
+
row: rowsFocus.length
|
|
1213
|
+
});
|
|
1184
1214
|
}
|
|
1185
1215
|
}
|
|
1186
1216
|
}, [commandSettings, originData, rowKey, rowsFocus, t, triggerChangeData]);
|
|
@@ -1206,11 +1236,15 @@ const TableContainerEdit = props => {
|
|
|
1206
1236
|
buttonsStyling: false
|
|
1207
1237
|
}).then(async result => {
|
|
1208
1238
|
if (result.value) {
|
|
1209
|
-
triggerChangeData?.([]
|
|
1239
|
+
triggerChangeData?.([], {
|
|
1240
|
+
type: 'DELETE'
|
|
1241
|
+
});
|
|
1210
1242
|
} else if (result.dismiss === MySwal.DismissReason.cancel) {}
|
|
1211
1243
|
});
|
|
1212
1244
|
} else {
|
|
1213
|
-
triggerChangeData?.([]
|
|
1245
|
+
triggerChangeData?.([], {
|
|
1246
|
+
type: 'DELETE'
|
|
1247
|
+
});
|
|
1214
1248
|
}
|
|
1215
1249
|
}
|
|
1216
1250
|
}, [commandSettings, t, triggerChangeData]);
|
|
@@ -1256,7 +1290,9 @@ const TableContainerEdit = props => {
|
|
|
1256
1290
|
return updatedRow;
|
|
1257
1291
|
});
|
|
1258
1292
|
const newData = unFlattenData(rs);
|
|
1259
|
-
triggerChangeData?.([...newData]
|
|
1293
|
+
triggerChangeData?.([...newData], {
|
|
1294
|
+
type: 'DELETE_CONTENT'
|
|
1295
|
+
});
|
|
1260
1296
|
}
|
|
1261
1297
|
};
|
|
1262
1298
|
const toolbarItemsBottom = React.useMemo(() => {
|
|
@@ -176,8 +176,53 @@ const EditableCell = props => {
|
|
|
176
176
|
placeholder: t && column.placeholder ? t(column.placeholder) : undefined,
|
|
177
177
|
disabled: isDisable(column, record) ?? false,
|
|
178
178
|
maxDate: maxDate,
|
|
179
|
-
minDate: minDate
|
|
180
|
-
|
|
179
|
+
minDate: minDate
|
|
180
|
+
// mode="date"
|
|
181
|
+
|
|
182
|
+
// onChange={(newDate, dateString) => {
|
|
183
|
+
|
|
184
|
+
// const newDateValue = dateString ? moment(convertDayjsToDate(dateString as string, dateFormat)).format() : null
|
|
185
|
+
|
|
186
|
+
// onChange(newDateValue)
|
|
187
|
+
|
|
188
|
+
// setTimeout(() => {
|
|
189
|
+
// // @ts-ignore
|
|
190
|
+
// dateTimePickerRef.current?.focus()
|
|
191
|
+
// }, 0)
|
|
192
|
+
|
|
193
|
+
// }}
|
|
194
|
+
|
|
195
|
+
// onBlur={() => {
|
|
196
|
+
// const formState = getValues()
|
|
197
|
+
// const itemState = getValues(dataIndex)
|
|
198
|
+
// // @ts-ignore
|
|
199
|
+
// const prevState = record[dataIndex]
|
|
200
|
+
// const newState = itemState
|
|
201
|
+
|
|
202
|
+
// if (prevState !== newState) {
|
|
203
|
+
// handleCellChange?.({
|
|
204
|
+
// key: key as any,
|
|
205
|
+
// field: column.field ?? column.field as any,
|
|
206
|
+
// record: formState,
|
|
207
|
+
// prevState,
|
|
208
|
+
// newState,
|
|
209
|
+
// option: newState,
|
|
210
|
+
// indexCol,
|
|
211
|
+
// indexRow,
|
|
212
|
+
// type: 'blur'
|
|
213
|
+
// })
|
|
214
|
+
// }
|
|
215
|
+
// }}
|
|
216
|
+
,
|
|
217
|
+
|
|
218
|
+
popupClassName: 'be-popup-container',
|
|
219
|
+
status: isInvalid ? 'error' : undefined,
|
|
220
|
+
"data-tooltip-content": message,
|
|
221
|
+
"data-tooltip-id": `${id}-tooltip-error`,
|
|
222
|
+
autoFocus: column.field === startCell?.colId,
|
|
223
|
+
defaultOpen: column.field === startCell?.colId,
|
|
224
|
+
needConfirm: false,
|
|
225
|
+
onCalendarChange: (newDate, dateString) => {
|
|
181
226
|
const newDateValue = dateString ? moment(convertDayjsToDate(dateString, dateFormat)).format() : null;
|
|
182
227
|
onChange(newDateValue);
|
|
183
228
|
setTimeout(() => {
|
|
@@ -185,32 +230,28 @@ const EditableCell = props => {
|
|
|
185
230
|
dateTimePickerRef.current?.focus();
|
|
186
231
|
}, 0);
|
|
187
232
|
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
233
|
+
onOpenChange: open => {
|
|
234
|
+
if (!open) {
|
|
235
|
+
const formState = getValues();
|
|
236
|
+
const itemState = getValues(dataIndex);
|
|
237
|
+
// @ts-ignore
|
|
238
|
+
const prevState = record[dataIndex];
|
|
239
|
+
const newState = itemState;
|
|
240
|
+
if (prevState !== newState) {
|
|
241
|
+
handleCellChange?.({
|
|
242
|
+
key: key,
|
|
243
|
+
field: column.field ?? column.field,
|
|
244
|
+
record: formState,
|
|
245
|
+
prevState,
|
|
246
|
+
newState,
|
|
247
|
+
option: newState,
|
|
248
|
+
indexCol,
|
|
249
|
+
indexRow,
|
|
250
|
+
type: 'blur'
|
|
251
|
+
});
|
|
252
|
+
}
|
|
206
253
|
}
|
|
207
|
-
}
|
|
208
|
-
popupClassName: 'be-popup-container',
|
|
209
|
-
status: isInvalid ? 'error' : undefined,
|
|
210
|
-
"data-tooltip-content": message,
|
|
211
|
-
"data-tooltip-id": `${id}-tooltip-error`,
|
|
212
|
-
autoFocus: column.field === startCell?.colId,
|
|
213
|
-
defaultOpen: column.field === startCell?.colId
|
|
254
|
+
}
|
|
214
255
|
});
|
|
215
256
|
case 'month':
|
|
216
257
|
case 'quarter':
|
|
@@ -30,7 +30,7 @@ const TableBody = ({
|
|
|
30
30
|
//dynamic row height virtualization - alternatively you could use a simpler fixed row height strategy without the need for `measureElement`
|
|
31
31
|
const rowVirtualizer = useVirtualizer({
|
|
32
32
|
count: rows.length,
|
|
33
|
-
estimateSize: () =>
|
|
33
|
+
estimateSize: () => 32,
|
|
34
34
|
//estimate row height for accurate scrollbar dragging
|
|
35
35
|
getScrollElement: () => tableContainerRef.current,
|
|
36
36
|
//measure dynamic row height, except in firefox because it measures table border height incorrectly
|
|
@@ -339,7 +339,7 @@ const TableBodyCell = props => {
|
|
|
339
339
|
style: {
|
|
340
340
|
...cellStyles,
|
|
341
341
|
display: 'flex',
|
|
342
|
-
minHeight:
|
|
342
|
+
minHeight: 32,
|
|
343
343
|
width: cell.column.getSize(),
|
|
344
344
|
minWidth: cell.column.getSize(),
|
|
345
345
|
...getCommonPinningStyles(cell.column)
|
|
@@ -390,9 +390,10 @@ const TableBodyCell = props => {
|
|
|
390
390
|
style: {
|
|
391
391
|
...cellStyles,
|
|
392
392
|
display: 'flex',
|
|
393
|
+
alignItems: 'center',
|
|
393
394
|
width: cell.column.getSize(),
|
|
394
395
|
minWidth: cell.column.getSize(),
|
|
395
|
-
minHeight:
|
|
396
|
+
minHeight: 32,
|
|
396
397
|
...getCommonPinningStyles(cell.column)
|
|
397
398
|
},
|
|
398
399
|
onMouseEnter: e => {
|
|
@@ -456,6 +457,9 @@ const TableBodyCell = props => {
|
|
|
456
457
|
}
|
|
457
458
|
},
|
|
458
459
|
onClick: e => {
|
|
460
|
+
if (e.detail === 2) {
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
459
463
|
recordClick?.({
|
|
460
464
|
e,
|
|
461
465
|
rowData: record,
|
|
@@ -536,7 +536,8 @@ const TableBodyCellEdit = props => {
|
|
|
536
536
|
setEditingKey?.(record[rowKey]);
|
|
537
537
|
// setTooltipContent('')
|
|
538
538
|
|
|
539
|
-
handleCellClick?.(rowNumber, record, columnMeta, record[rowKey], record[columnMeta.field ?? ''])
|
|
539
|
+
// handleCellClick?.(rowNumber, record, columnMeta as any, record[rowKey], record[columnMeta.field ?? ''])
|
|
540
|
+
|
|
540
541
|
reset?.();
|
|
541
542
|
|
|
542
543
|
// const formattedRecord = { ...record };
|
|
@@ -897,7 +898,7 @@ const TableBodyCellEdit = props => {
|
|
|
897
898
|
}),
|
|
898
899
|
style: {
|
|
899
900
|
display: 'flex',
|
|
900
|
-
height: '
|
|
901
|
+
height: '32px',
|
|
901
902
|
userSelect: 'none',
|
|
902
903
|
width: cell.column.getSize(),
|
|
903
904
|
// flexBasis: cell.column.getSize(),
|
|
@@ -986,7 +987,7 @@ const TableBodyCellEdit = props => {
|
|
|
986
987
|
}),
|
|
987
988
|
style: {
|
|
988
989
|
display: 'flex',
|
|
989
|
-
height: '
|
|
990
|
+
height: '32px',
|
|
990
991
|
width: cell.column.getSize(),
|
|
991
992
|
minWidth: cell.column.getSize(),
|
|
992
993
|
// flex: 1,
|
|
@@ -1012,7 +1013,7 @@ const TableBodyCellEdit = props => {
|
|
|
1012
1013
|
}),
|
|
1013
1014
|
style: {
|
|
1014
1015
|
display: 'flex',
|
|
1015
|
-
height: '
|
|
1016
|
+
height: '32px',
|
|
1016
1017
|
width: cell.column.getSize(),
|
|
1017
1018
|
minWidth: cell.column.getSize(),
|
|
1018
1019
|
// flex: 1,
|
|
@@ -1150,11 +1151,12 @@ const TableBodyCellEdit = props => {
|
|
|
1150
1151
|
}),
|
|
1151
1152
|
style: {
|
|
1152
1153
|
display: 'flex',
|
|
1154
|
+
alignItems: 'center',
|
|
1153
1155
|
width: cell.column.getSize(),
|
|
1154
1156
|
minWidth: cell.column.getSize(),
|
|
1155
1157
|
// flex: 1,
|
|
1156
1158
|
// maxWidth: cell.column.getSize(),
|
|
1157
|
-
height: '
|
|
1159
|
+
height: '32px',
|
|
1158
1160
|
...getCommonPinningStyles(cell.column),
|
|
1159
1161
|
cursor: isPasting ? 'crosshair' : undefined
|
|
1160
1162
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Space } from 'antd';
|
|
3
|
+
import Button from 'rc-master-ui/es/button';
|
|
3
4
|
import { ArrowDown, ArrowUp, FilterFill, SortCancel } from 'becoxy-icons';
|
|
4
5
|
import classNames from 'classnames';
|
|
5
6
|
import { Checkbox, Dropdown, Select } from 'rc-master-ui';
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import styled from
|
|
1
|
+
import styled from 'styled-components';
|
|
2
2
|
// const prefix = "ui-rc";
|
|
3
3
|
// const antdPrefix = "ant";
|
|
4
|
-
|
|
4
|
+
const fontFamily = 'Montserrat, Helvetica, Arial, serif ';
|
|
5
5
|
// const borderRadius = "6px";
|
|
6
6
|
|
|
7
7
|
// const boxShadowColor = "rgba(220, 0, 0, 0.09)";
|
|
8
|
-
const color =
|
|
9
|
-
const
|
|
8
|
+
const color = '#000000';
|
|
9
|
+
const fontSize = '12px';
|
|
10
|
+
const fwBody = '500';
|
|
11
|
+
const fwHeader = '600';
|
|
12
|
+
const BgColor = '#ffffff ';
|
|
10
13
|
|
|
11
14
|
// const primary = "#eb4619";
|
|
12
15
|
|
|
13
16
|
// const rowHoverBg = "#FBDED6";
|
|
14
17
|
// const rowSelectedBg = "#FEF2EF";
|
|
15
18
|
|
|
16
|
-
const tableBorderColor =
|
|
19
|
+
const tableBorderColor = '#e0e0e0';
|
|
17
20
|
|
|
18
21
|
// const borderSelectedColor = "#0550C5";
|
|
19
22
|
// const cellSelectedBg = "#F3F8FF";
|
|
@@ -23,7 +26,7 @@ const tableBorderColor = "#e0e0e0";
|
|
|
23
26
|
// 404071
|
|
24
27
|
|
|
25
28
|
// dark
|
|
26
|
-
const tableBorderColorDark =
|
|
29
|
+
const tableBorderColorDark = '#44485E';
|
|
27
30
|
|
|
28
31
|
// const rowHoverBgDark = "#404071 ";
|
|
29
32
|
|
|
@@ -34,8 +37,8 @@ const tableBorderColorDark = "#44485E";
|
|
|
34
37
|
|
|
35
38
|
// const bodyColorDark = "#343e59";
|
|
36
39
|
|
|
37
|
-
const BgColorDark =
|
|
38
|
-
const colorDark =
|
|
40
|
+
const BgColorDark = '#343e59 ';
|
|
41
|
+
const colorDark = '#e6e4f3e6 ';
|
|
39
42
|
|
|
40
43
|
// const cellSelectedBgDark = " #F3F8FF ";
|
|
41
44
|
// const cellIndexFocusBgDark = "#E6EFFD ";
|
|
@@ -45,4 +48,4 @@ const colorDark = "#e6e4f3e6 ";
|
|
|
45
48
|
export const GridStyle = styled.div.withConfig({
|
|
46
49
|
displayName: "GridStyle",
|
|
47
50
|
componentId: "es-grid-template__sc-hdqm5k-0"
|
|
48
|
-
})(["&.", "-grid{color:", ";font-size:
|
|
51
|
+
})(["&.", "-grid{color:", ";font-size:", ";background-color:", ";font-family:", ";&.", "-grid-editable{.", "-grid-container{.", "-grid-tbody{.", "-grid-row{background-color:", ";color:", ";&.", "-grid-row-parent{background-color:#ffffff;font-weight:500;}}}}}table{table-layout:fixed;border-collapse:separate;border-spacing:0;}.", "-grid-container{border:1px solid ", ";border-right:0;&::after{position:absolute;top:0px;right:0;z-index:1;height:100%;border-right:1px solid ", ";content:'';pointer-events:none;}.", "-grid-cell{padding:5px 8px;&.", "-grid-cell-text-center{text-align:center;justify-content:center;}&.", "-grid-cell-text-right{justify-content:flex-end;text-align:right;}&.", "-grid-cell-ellipsis{.ui-rc_cell-content{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;&.select-cell{padding-right:18px;position:relative;}.caret-down{float:right;position:absolute;right:0;&::before{content:'';display:inline-block;margin-left:4px;vertical-align:middle;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #6f7777;}}}}&.", "-grid-cell-wrap{white-space:normal;text-overflow:ellipsis;word-break:break-word;}.", "-grid-header-text-wrap{white-space:normal;overflow:hidden;text-overflow:ellipsis;word-break:break-word;}}.", "-grid-thead{background-color:", ";font-weight:", ";.", "-grid-cell{font-weight:inherit;color:", ";background-color:inherit;border-inline-end:1px solid ", ";border-bottom:1px solid ", ";&.ui-rc-grid-cell-ellipsis{.ui-rc-table-column-title,.", "-grid-cell-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all;}}&.ui-rc-grid-cell-wrap{.ui-rc-table-column-title,.", "-grid-cell-text-wrap{white-space:normal;word-break:break-word;overflow:hidden;}}&:hover{.ui-rc-header-trigger{.ui-rc-table-column-sorter-cancel{opacity:1;}}}.", "-grid-filter-column{display:flex;justify-content:space-between;width:100%;align-items:center;position:relative;z-index:3;}.ui-rc-header-trigger{padding-left:6px;display:flex;align-items:center;.ui-rc-table-column-sorter-cancel{opacity:0;}}.resizer{cursor:col-resize;height:100%;position:absolute;right:0;top:0;z-index:3;touch-action:none;user-select:none;width:5px;}.resizer.isResizing{opacity:1;}}}.", "-grid-tbody{.", "-grid-row{font-weight:", ";background-color:", ";color:", ";&.", "-grid-row-odd{background-color:#f9f8fd;}&.", "-grid-row-even{}&.", "-grid-row-parent{background-color:#f5f5f5;font-weight:500;}}}.", "-grid-tfoot{.", "-grid-footer-row{border-bottom-width:1px;border-bottom-color:", ";border-bottom-style:solid;border-top-width:1px;border-top-color:", ";border-top-style:solid;background-color:#fafafa;}.", "-grid-cell{background-color:inherit;border-inline-end:1px solid ", ";}}}&.", "-grid-dark{background-color:", ";color:", ";.", "-grid-container{border-color:", ";&::after{border-right-color:", ";}}}}"], props => props.$prefix, color, fontSize, BgColor, fontFamily, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, fwHeader, props => props.$prefix, props => `${props.$theme.color ? props.$theme.color : color}`, tableBorderColor, tableBorderColor, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, fwBody, props => `${props.$theme.backgroundColor ? props.$theme.backgroundColor : BgColor}`, props => `${props.$theme.color ? props.$theme.color : color}`, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, props => props.$prefix, tableBorderColor, tableBorderColor, props => props.$prefix, tableBorderColor, props => props.$prefix, BgColorDark, colorDark, props => props.$prefix, tableBorderColorDark, tableBorderColorDark);
|