es-grid-template 1.7.29 → 1.7.31
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/InternalTable.js +0 -1
- package/es/grid-component/TempTable.js +2 -2
- package/es/table-component/TableContainerEdit.js +15 -3
- package/es/table-component/body/EditableCell.js +11 -11
- package/es/table-component/body/TableBodyCellEdit.js +284 -199
- package/es/table-component/footer/TableFooterRow.js +0 -2
- package/es/table-component/hook/utils.js +1 -1
- package/es/table-component/index.d.ts +2 -3
- package/es/table-component/index.js +3 -0
- package/es/table-component/style.scss +29 -20
- package/es/table-component/table/TableWrapper.js +6 -0
- package/lib/grid-component/InternalTable.js +0 -1
- package/lib/grid-component/TempTable.js +2 -2
- package/lib/table-component/TableContainerEdit.js +15 -3
- package/lib/table-component/body/EditableCell.js +11 -11
- package/lib/table-component/body/TableBodyCellEdit.js +284 -199
- package/lib/table-component/footer/TableFooterRow.js +0 -2
- package/lib/table-component/hook/utils.js +1 -1
- package/lib/table-component/index.d.ts +2 -3
- package/lib/table-component/index.js +1 -0
- package/lib/table-component/style.scss +29 -20
- package/lib/table-component/table/TableWrapper.js +6 -0
- package/package.json +1 -1
|
@@ -517,7 +517,6 @@ const InternalTable = props => {
|
|
|
517
517
|
const {
|
|
518
518
|
sortOrder
|
|
519
519
|
} = args;
|
|
520
|
-
console.log('sortOrder', sortOrder);
|
|
521
520
|
return /*#__PURE__*/React.createElement(Fragment, null, !sortOrder && /*#__PURE__*/React.createElement(SortCancel, {
|
|
522
521
|
fontSize: 15,
|
|
523
522
|
style: {
|
|
@@ -9,9 +9,9 @@ const TempTable = props => {
|
|
|
9
9
|
editAble,
|
|
10
10
|
...rest
|
|
11
11
|
} = props;
|
|
12
|
-
const TabComponent = groupAble ? InternalTable : Table;
|
|
13
|
-
// const TabComponent = editAble ? Table : InternalTable
|
|
14
12
|
|
|
13
|
+
// const TabComponent = groupAble ? InternalTable : Table
|
|
14
|
+
const TabComponent = editAble ? Table : InternalTable;
|
|
15
15
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(TabComponent, _extends({}, rest, {
|
|
16
16
|
infiniteScroll: infiniteScroll,
|
|
17
17
|
groupAble: groupAble,
|
|
@@ -1012,10 +1012,10 @@ const TableContainerEdit = props => {
|
|
|
1012
1012
|
const handleDeleteAll = React.useCallback(() => {
|
|
1013
1013
|
triggerChangeData?.([]);
|
|
1014
1014
|
}, [triggerChangeData]);
|
|
1015
|
-
const handleDeleteContent =
|
|
1015
|
+
const handleDeleteContent = () => {
|
|
1016
1016
|
if (startCell && endCell) {
|
|
1017
1017
|
const tmpData = flattenArray([...dataSource]);
|
|
1018
|
-
const rs = tmpData.map(row => {
|
|
1018
|
+
const rs = tmpData.map((row, index) => {
|
|
1019
1019
|
if (!rangeState?.rowRange.includes(row.rowId)) {
|
|
1020
1020
|
return row;
|
|
1021
1021
|
}
|
|
@@ -1024,8 +1024,20 @@ const TableContainerEdit = props => {
|
|
|
1024
1024
|
};
|
|
1025
1025
|
for (const colId of rangeState.colRange) {
|
|
1026
1026
|
const column = table.getVisibleFlatColumns().find(it => it.id === colId)?.columnDef.meta;
|
|
1027
|
+
const columnIndex = table.getVisibleFlatColumns().findIndex(it => it.id === colId);
|
|
1027
1028
|
if (isEditable(column, row)) {
|
|
1028
1029
|
updatedRow[colId] = '';
|
|
1030
|
+
handleCellChange({
|
|
1031
|
+
key: row[rowKey],
|
|
1032
|
+
field: column.field ?? column.dataIndex,
|
|
1033
|
+
record: updatedRow,
|
|
1034
|
+
prevState: row[column.field],
|
|
1035
|
+
newState: '',
|
|
1036
|
+
option: '',
|
|
1037
|
+
indexCol: columnIndex,
|
|
1038
|
+
indexRow: index,
|
|
1039
|
+
type: 'blur'
|
|
1040
|
+
});
|
|
1029
1041
|
}
|
|
1030
1042
|
}
|
|
1031
1043
|
return updatedRow;
|
|
@@ -1033,7 +1045,7 @@ const TableContainerEdit = props => {
|
|
|
1033
1045
|
const newData = unFlattenData(rs);
|
|
1034
1046
|
triggerChangeData?.([...newData]);
|
|
1035
1047
|
}
|
|
1036
|
-
}
|
|
1048
|
+
};
|
|
1037
1049
|
const toolbarItemsBottom = React.useMemo(() => {
|
|
1038
1050
|
if (!rowsFocus || rowsFocus.length === 0) {
|
|
1039
1051
|
return toolbarItems?.filter(it => it.position === 'Bottom' && it.visible !== false && it.key !== 'DUPLICATE' && it.key !== 'INSERT_BEFORE' && it.key !== 'INSERT_AFTER' && it.key !== 'DELETE_ROWS' && it.key !== 'INSERT_CHILDREN').map(item => {
|
|
@@ -170,7 +170,7 @@ const EditableCell = props => {
|
|
|
170
170
|
popupClassName: 'be-popup-container',
|
|
171
171
|
status: isInvalid ? 'error' : undefined,
|
|
172
172
|
"data-tooltip-content": message,
|
|
173
|
-
"data-tooltip-id": `${id}-tooltip-
|
|
173
|
+
"data-tooltip-id": `${id}-tooltip-error`
|
|
174
174
|
});
|
|
175
175
|
case 'datetime':
|
|
176
176
|
return /*#__PURE__*/React.createElement(DatePicker
|
|
@@ -226,7 +226,7 @@ const EditableCell = props => {
|
|
|
226
226
|
popupClassName: 'be-popup-container',
|
|
227
227
|
status: isInvalid ? 'error' : undefined,
|
|
228
228
|
"data-tooltip-content": message,
|
|
229
|
-
"data-tooltip-id": `${id}-tooltip-
|
|
229
|
+
"data-tooltip-id": `${id}-tooltip-error`,
|
|
230
230
|
autoFocus: column.field === startCell?.colId,
|
|
231
231
|
defaultOpen: column.field === startCell?.colId
|
|
232
232
|
});
|
|
@@ -254,7 +254,7 @@ const EditableCell = props => {
|
|
|
254
254
|
popupClassName: 'be-popup-container',
|
|
255
255
|
status: isInvalid ? 'error' : undefined,
|
|
256
256
|
"data-tooltip-content": message,
|
|
257
|
-
"data-tooltip-id": `${id}-tooltip-
|
|
257
|
+
"data-tooltip-id": `${id}-tooltip-error`,
|
|
258
258
|
autoFocus: column.field === startCell?.colId,
|
|
259
259
|
defaultOpen: column.field === startCell?.colId
|
|
260
260
|
});
|
|
@@ -276,7 +276,7 @@ const EditableCell = props => {
|
|
|
276
276
|
popupClassName: 'be-popup-container',
|
|
277
277
|
status: isInvalid ? 'error' : undefined,
|
|
278
278
|
"data-tooltip-content": message,
|
|
279
|
-
"data-tooltip-id": `${id}-tooltip-
|
|
279
|
+
"data-tooltip-id": `${id}-tooltip-error`,
|
|
280
280
|
autoFocus: column.field === startCell?.colId,
|
|
281
281
|
defaultOpen: column.field === startCell?.colId
|
|
282
282
|
});
|
|
@@ -305,7 +305,7 @@ const EditableCell = props => {
|
|
|
305
305
|
popupClassName: 'be-popup-container',
|
|
306
306
|
status: isInvalid ? 'error' : undefined,
|
|
307
307
|
"data-tooltip-content": message,
|
|
308
|
-
"data-tooltip-id": `${id}-tooltip-
|
|
308
|
+
"data-tooltip-id": `${id}-tooltip-error`,
|
|
309
309
|
autoFocus: column.field === startCell?.colId,
|
|
310
310
|
defaultOpen: column.field === startCell?.colId
|
|
311
311
|
});
|
|
@@ -433,7 +433,7 @@ const EditableCell = props => {
|
|
|
433
433
|
}
|
|
434
434
|
},
|
|
435
435
|
"data-tooltip-content": message,
|
|
436
|
-
"data-tooltip-id": `${id}-tooltip-
|
|
436
|
+
"data-tooltip-id": `${id}-tooltip-error`
|
|
437
437
|
});
|
|
438
438
|
case 'select':
|
|
439
439
|
let valueSelect = value;
|
|
@@ -519,7 +519,7 @@ const EditableCell = props => {
|
|
|
519
519
|
}
|
|
520
520
|
},
|
|
521
521
|
"data-tooltip-content": message,
|
|
522
|
-
"data-tooltip-id": `${id}-tooltip-
|
|
522
|
+
"data-tooltip-id": `${id}-tooltip-error`
|
|
523
523
|
});
|
|
524
524
|
case 'asyncSelect':
|
|
525
525
|
let valueAsyncSelect = value;
|
|
@@ -644,7 +644,7 @@ const EditableCell = props => {
|
|
|
644
644
|
}
|
|
645
645
|
},
|
|
646
646
|
"data-tooltip-content": message,
|
|
647
|
-
"data-tooltip-id": `${id}-tooltip-
|
|
647
|
+
"data-tooltip-id": `${id}-tooltip-error`
|
|
648
648
|
});
|
|
649
649
|
case 'treeSelect':
|
|
650
650
|
// let valueTreeSelect
|
|
@@ -719,7 +719,7 @@ const EditableCell = props => {
|
|
|
719
719
|
popupClassName: 'be-popup-container',
|
|
720
720
|
status: isInvalid ? 'error' : undefined,
|
|
721
721
|
"data-tooltip-content": message,
|
|
722
|
-
"data-tooltip-id": `${id}-tooltip-
|
|
722
|
+
"data-tooltip-id": `${id}-tooltip-error`
|
|
723
723
|
});
|
|
724
724
|
case 'checkbox':
|
|
725
725
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -956,7 +956,7 @@ const EditableCell = props => {
|
|
|
956
956
|
}
|
|
957
957
|
},
|
|
958
958
|
"data-tooltip-content": message,
|
|
959
|
-
"data-tooltip-id": `${id}-tooltip-
|
|
959
|
+
"data-tooltip-id": `${id}-tooltip-error`
|
|
960
960
|
}));
|
|
961
961
|
default:
|
|
962
962
|
return /*#__PURE__*/React.createElement(TextArea, {
|
|
@@ -1017,7 +1017,7 @@ const EditableCell = props => {
|
|
|
1017
1017
|
onChange: onChange,
|
|
1018
1018
|
status: isInvalid ? 'error' : undefined,
|
|
1019
1019
|
"data-tooltip-content": message,
|
|
1020
|
-
"data-tooltip-id": `${id}-tooltip-
|
|
1020
|
+
"data-tooltip-id": `${id}-tooltip-error`,
|
|
1021
1021
|
autoSize: {
|
|
1022
1022
|
minRows: 1,
|
|
1023
1023
|
maxRows: 1
|