style: model list buttons
This commit is contained in:
@@ -53,12 +53,12 @@ const TableRow: React.FC<
|
||||
childrenDataRef.current = childrenData;
|
||||
const axiosToken = useRef<any>(null);
|
||||
const [updateChild, setUpdateChild] = useState(true);
|
||||
const [currentExpand, setCurrentExpand] = useState(false);
|
||||
|
||||
const { updateChunkedList, cacheDataListRef } = useUpdateChunkedList({
|
||||
dataList: childrenData,
|
||||
limit: 100,
|
||||
setDataList: setChildrenData
|
||||
// callback: (list) => renderChildren?.(list)
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
@@ -92,7 +92,10 @@ const TableRow: React.FC<
|
||||
></Empty>
|
||||
);
|
||||
}
|
||||
return renderChildren?.(childrenData, record);
|
||||
return renderChildren?.(childrenData, {
|
||||
parent: record,
|
||||
currentExpanded: currentExpand
|
||||
});
|
||||
};
|
||||
|
||||
const handlePolling = async () => {
|
||||
@@ -163,6 +166,7 @@ const TableRow: React.FC<
|
||||
|
||||
const handleRowExpand = async () => {
|
||||
onExpand?.(!expanded, record, record[rowKey]);
|
||||
setCurrentExpand(!expanded);
|
||||
|
||||
if (pollTimer.current) {
|
||||
clearInterval(pollTimer.current);
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 54px;
|
||||
padding-block: 5px;
|
||||
height: 54px;
|
||||
border-radius: var(--border-radius-mdium);
|
||||
transition: all 0.2s ease;
|
||||
|
||||
|
||||
@@ -59,7 +59,10 @@ export interface SealTableProps {
|
||||
onSort?: (dataIndex: string, order: 'ascend' | 'descend') => void;
|
||||
onExpand?: (expanded: boolean, record: any, rowKey: any) => void;
|
||||
onExpandAll?: (expanded: boolean) => void;
|
||||
renderChildren?: (data: any, parent?: any) => React.ReactNode;
|
||||
renderChildren?: (
|
||||
data: any,
|
||||
options: { parent?: any; [key: string]: any }
|
||||
) => React.ReactNode;
|
||||
loadChildren?: (record: any, options?: any) => Promise<any[]>;
|
||||
loadChildrenAPI?: (record: any) => string;
|
||||
contentRendered?: () => void;
|
||||
|
||||
Reference in New Issue
Block a user