chore: upgrade antd lib to 5.25.4

This commit is contained in:
jialin
2025-09-16 11:26:17 +08:00
parent 0c1057d554
commit 4f91443957
41 changed files with 4761 additions and 9139 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ const AutoTooltip: React.FC<AutoTooltipProps> = ({
<TooltipOverlayScroller
toolTipProps={{
...tooltipProps,
destroyTooltipOnHide: false
destroyOnHidden: false
}}
title={isOverflowing || showTitle ? title || children : false}
>
+1 -1
View File
@@ -138,7 +138,7 @@ const DeleteModal = forwardRef((props, ref) => {
open={visible}
onOk={handleOk}
onCancel={handleCancel}
destroyOnClose={false}
destroyOnHidden={false}
closeIcon={false}
maskClosable={false}
keyboard={false}
+8 -6
View File
@@ -48,12 +48,14 @@ const ToolsBar: React.FC<ToolsBarProps> = (props) => {
<Tooltip
placement="bottomLeft"
arrow={false}
overlayInnerStyle={{
background: 'var(--color-white-1)',
display: 'flex',
alignItems: 'center',
justifyContent: 'flex-start',
width: 160
styles={{
body: {
background: 'var(--color-white-1)',
display: 'flex',
alignItems: 'center',
justifyContent: 'flex-start',
width: 160
}
}}
title={
<div className="flex-column" style={{ width: '100%' }}>
+7 -4
View File
@@ -75,12 +75,15 @@ export const TooltipOverlayScroller: React.FC<
scrollbars,
oppositeTheme
}) => {
const { overlayInnerStyle, ...rest } = toolTipProps || {};
const { styles, ...rest } = toolTipProps || {};
return (
<Tooltip
overlayInnerStyle={{
paddingInline: 0,
...overlayInnerStyle
styles={{
...styles,
body: {
paddingInline: 0,
...styles?.body
}
}}
title={
title && (
+5 -1
View File
@@ -65,7 +65,11 @@ const RenderProgress = memo(
title={label}
open={open}
onOpenChange={setOpen}
overlayInnerStyle={{ paddingInline: 12 }}
styles={{
body: {
paddingInline: 12
}
}}
>
{renderProgress}
</Tooltip>
+1 -1
View File
@@ -45,7 +45,7 @@ const ScrollerModal = (props: ModalProps & { maxContentHeight?: number }) => {
return (
<Modal
{...props}
destroyOnClose={true}
destroyOnHidden={true}
styles={{
content: {
padding: 0
@@ -1,17 +1,9 @@
import useSetChunkRequest, {
createAxiosToken
} from '@/hooks/use-chunk-request';
import useUpdateChunkedList from '@/hooks/use-update-chunk-list';
import { createAxiosToken } from '@/hooks/use-chunk-request';
import { useMemoizedFn } from 'ahooks';
import { Col, Row, Spin } from 'antd';
import classNames from 'classnames';
import _ from 'lodash';
import React, {
useCallback,
useEffect,
useMemo,
useRef,
useState
} from 'react';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import RowContext from '../row-context';
import TableContext from '../table-context';
import { RowContextProps, SealTableProps } from '../types';
@@ -43,10 +35,8 @@ const TableRow: React.FC<
allChildren?: any[];
setDisableExpand?: (record: any) => boolean;
}>(TableContext);
const { setChunkRequest } = useSetChunkRequest();
const [childrenData, setChildrenData] = useState<any[]>([]);
const [loading, setLoading] = useState(false);
const [firstLoad, setFirstLoad] = useState(true);
const pollTimer = useRef<any>(null);
const chunkRequestRef = useRef<any>(null);
const childrenDataRef = useRef<any[]>([]);
@@ -55,12 +45,6 @@ const TableRow: React.FC<
const [updateChild, setUpdateChild] = useState(true);
const [currentExpand, setCurrentExpand] = useState(false);
const { updateChunkedList, cacheDataListRef } = useUpdateChunkedList({
dataList: childrenData,
limit: 100,
setDataList: setChildrenData
});
useEffect(() => {
return () => {
if (pollTimer.current) {
@@ -87,16 +71,6 @@ const TableRow: React.FC<
const renderChildrenData = () => {
if (childrenData.length === 0) {
// return (
// <Empty
// image={loading ? null : Empty.PRESENTED_IMAGE_SIMPLE}
// description={loading ? null : undefined}
// style={{
// marginBlock: 0,
// height: 54
// }}
// ></Empty>
// );
return null;
}
return renderChildren?.(childrenData, {
@@ -116,7 +90,7 @@ const TableRow: React.FC<
}
};
const handleLoadChildren = useCallback(async () => {
const handleLoadChildren = useMemoizedFn(async () => {
try {
axiosToken.current?.cancel?.();
axiosToken.current = createAxiosToken();
@@ -130,10 +104,8 @@ const TableRow: React.FC<
} catch (error) {
setChildrenData([]);
setLoading(false);
} finally {
setFirstLoad(false);
}
}, [record, loadChildren]);
});
const filterUpdateChildrenHandler = () => {
const dataList = _.filter(tableContext.allChildren, (data: any) => {
@@ -142,32 +114,6 @@ const TableRow: React.FC<
setChildrenData(dataList);
};
const updateChildrenHandler = (list: any) => {
_.each(list, (data: any) => {
updateChunkedList(data);
});
};
const createChunkRequest = () => {
chunkRequestRef.current?.current?.cancel?.();
if (!watchChildren) {
return;
}
const url = loadChildrenAPI?.(record) as string;
try {
chunkRequestRef.current = setChunkRequest({
url,
params: {
page: 1,
perPage: 100
},
handler: updateChildrenHandler
});
} catch (error) {
// ignore
}
};
const handleRowExpand = async () => {
onExpand?.(!expanded, record, record[rowKey]);
setCurrentExpand(!expanded);
@@ -216,7 +162,6 @@ const TableRow: React.FC<
useEffect(() => {
const handleVisibilityChange = async () => {
if (document.visibilityState === 'hidden') {
cacheDataListRef.current = [];
setUpdateChild(false);
} else {
setUpdateChild(true);
@@ -237,7 +182,6 @@ const TableRow: React.FC<
}
return () => {
chunkRequestRef.current?.current?.cancel?.();
cacheDataListRef.current = [];
};
}, [updateChild, tableContext.allChildren]);
@@ -259,13 +203,13 @@ const TableRow: React.FC<
disableExpand={disableExpand}
></RowPrefix>
<Row className="seal-table-row">
{columns?.map((columnProps) => {
{columns?.map(({ key, ...restProps }) => {
return (
<Col
key={`${columnProps.dataIndex}-${rowIndex}`}
span={columnProps.span}
key={`${restProps.dataIndex}-${rowIndex}`}
span={restProps.span}
>
<TableColumn {...columnProps}></TableColumn>
<TableColumn {...restProps}></TableColumn>
</Col>
);
})}
+1 -1
View File
@@ -157,7 +157,7 @@ const StatusTag: React.FC<StatusTagProps> = ({
autoHide: 'never'
}}
toolTipProps={{
destroyTooltipOnHide: true
destroyOnHidden: true
}}
>
<span className="txt err">
+6 -1
View File
@@ -46,7 +46,12 @@ const UploadAudio: React.FC<UploadAudioProps> = (props) => {
return (
<Tooltip
overlayInnerStyle={{ maxWidth: 290, width: 'max-content' }}
styles={{
body: {
maxWidth: 290,
width: 'max-content'
}
}}
title={intl.formatMessage(
{ id: 'playground.audio.uploadfile.tips' },
{ formats: props.accept }