Skip to content

Commit 62a449f

Browse files
author
zhaoge
committed
feat: upgrade antd's version to 4.24.16
1 parent 950c864 commit 62a449f

File tree

24 files changed

+1809
-1625
lines changed

24 files changed

+1809
-1625
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
"@dtinsight/dt-utils": "^1.3.1",
115115
"@dtinsight/react-icons": "^1.0.0",
116116
"@handsontable/react": "2.1.0",
117-
"antd": "4.22.5",
117+
"antd": "4.24.16",
118118
"classnames": "^2.2.6",
119119
"handsontable": "6.2.2",
120120
"highlight.js": "^10.5.0",

pnpm-lock.yaml

Lines changed: 1742 additions & 1539 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/catalogue/components/catalogue.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ interface NormalCatalogueProps<U extends Record<string, any> = {}>
3131
placeholder?: string;
3232
loading?: boolean;
3333
onCancelSave?: (item: ITreeNode<U>) => void;
34-
overlay?: (item: ITreeNode<U>) => DropdownProps['overlay'];
34+
overlay?: (item: ITreeNode<U>) => DropdownProps['dropdownRender'];
3535
onSearch?: (value: string) => void;
3636
onSave?: (data: ITreeNode<U>, value: string) => Promise<string | void>;
3737
}
@@ -150,11 +150,11 @@ const Catalogue = <U extends Record<string, any> = {}, T extends readOnlyTab = a
150150
}
151151
activeKey={activeTabKey}
152152
onChange={onTabChange}
153-
>
154-
{tabList?.map((tab: { key: string; title: React.ReactNode }) => (
155-
<Tabs.TabPane tab={tab.title} key={tab.key} />
156-
))}
157-
</Tabs>
153+
items={tabList?.map((tab: { key: string; title: React.ReactNode }) => ({
154+
key: tab.key,
155+
label: tab.title,
156+
}))}
157+
/>
158158
);
159159
};
160160

@@ -177,7 +177,7 @@ const Catalogue = <U extends Record<string, any> = {}, T extends readOnlyTab = a
177177
>
178178
{overlay && (
179179
<Dropdown
180-
overlay={overlay(item)}
180+
dropdownRender={overlay(item)}
181181
placement="bottomRight"
182182
arrow
183183
destroyPopupOnHide

src/chat/__tests__/__snapshots__/input.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ exports[`Test Chat Input Match snapshot 1`] = `
77
>
88
<textarea
99
class="ant-input dtc__chat__textarea"
10+
style="height: -28px; resize: none; min-height: -8px; max-height: -28px;"
1011
/>
1112
<span
1213
class="dtc__icon dtc__chat__textarea__send"

src/chat/demos/global-state/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ export default function () {
9898
});
9999
}
100100
};
101-
102101
return (
103102
<>
104103
<Tabs
@@ -112,11 +111,8 @@ export default function () {
112111
remove(targetKey as string);
113112
}
114113
}}
115-
>
116-
{tabs.map((i) => (
117-
<Tabs.TabPane tab={i.label} key={i.key} closable={tabs.length !== 1} />
118-
))}
119-
</Tabs>
114+
items={tabs}
115+
/>
120116
<AI data={data} onSubmit={handleSubmit} />
121117
</>
122118
);

src/collapsibleActionItems/index.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,13 @@ const CollapsibleActionItems: React.FC<ICollapsibleActionItems> = (props) => {
6767
.map((item) => getActionItemNode(item, false));
6868

6969
// 折叠展示的下拉菜单
70-
const dropdownMenu = isOverMaxCount ? (
71-
<Menu data-testid="action-dropdown-menu" onClick={(info) => onItemClick?.(info.key)}>
72-
{actionItems.slice(maxCount - 1).map((item) => getActionItemNode(item, true))}
73-
</Menu>
74-
) : null;
70+
const dropdownMenu = isOverMaxCount
71+
? () => (
72+
<Menu data-testid="action-dropdown-menu" onClick={(info) => onItemClick?.(info.key)}>
73+
{actionItems.slice(maxCount - 1).map((item) => getActionItemNode(item, true))}
74+
</Menu>
75+
)
76+
: null;
7577

7678
return (
7779
<div className={classNames('dtc-collapsibleActionItems', className)} style={style}>
@@ -86,7 +88,7 @@ const CollapsibleActionItems: React.FC<ICollapsibleActionItems> = (props) => {
8688
})}
8789
{dropdownMenu && (
8890
<Dropdown
89-
overlay={dropdownMenu}
91+
dropdownRender={dropdownMenu}
9092
getPopupContainer={(triggerNode) => triggerNode.parentElement ?? document.body}
9193
{...dropdownProps}
9294
>

src/contextMenu/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function ContextMenu({
4545
wrapperClassName,
4646
...restProps
4747
}: PropsWithChildren<IContextMenu>) {
48-
const menu = (
48+
const menu = () => (
4949
<Menu
5050
className="dtc-contextMenu-menu"
5151
onClick={(item) => {
@@ -72,7 +72,7 @@ export default function ContextMenu({
7272
if (!data.length) return <span className={wrapperClassName}>{children}</span>;
7373

7474
return (
75-
<Dropdown overlay={menu} trigger={['contextMenu']} {...restProps}>
75+
<Dropdown dropdownRender={menu} trigger={['contextMenu']} {...restProps}>
7676
<span className={wrapperClassName}>{children}</span>
7777
</Dropdown>
7878
);

src/drawer/index.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,8 @@ const Drawer = <T extends readOnlyTab>(props: DrawerProps<T>) => {
155155
activeKey={currentKey}
156156
onChange={handleChangeKey}
157157
className={`${drawerPrefixCls}-tabs`}
158-
>
159-
{props.tabs?.map((tab: { key: string; title: React.ReactNode }) => (
160-
<Tabs.TabPane tab={tab.title} key={tab.key} />
161-
))}
162-
</Tabs>
158+
items={props.tabs?.map((tab) => ({ key: tab.key, label: tab.title }))}
159+
/>
163160
)}
164161
<div
165162
className={classNames(`${drawerPrefixCls}-body`, bodyClassName)}

src/dropdown/__tests__/__snapshots__/dropdown.test.tsx.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ exports[`Test Dropdown.Select Component Should match snapshot 1`] = `
3434
aria-checked="mixed"
3535
class="ant-checkbox-input"
3636
type="checkbox"
37-
value=""
3837
/>
3938
<span
4039
class="ant-checkbox-inner"

src/dropdown/select.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export default function Select({
124124
!isEqual(options.map((i) => i.value).sort(), [...selected].sort()) &&
125125
options.some((o) => selected.includes(o.value));
126126

127-
const overlay = (
127+
const overlay = () => (
128128
<>
129129
<Row>
130130
<Col span={24} className={`${prefix}__col`}>
@@ -183,12 +183,12 @@ export default function Select({
183183

184184
return (
185185
<Dropdown
186-
visible={visible}
186+
open={visible}
187187
overlayClassName={classNames(`${prefix}__container`, className)}
188188
trigger={['click']}
189-
overlay={overlay}
189+
dropdownRender={overlay}
190190
getPopupContainer={getPopupContainer}
191-
onVisibleChange={(visible) => {
191+
onOpenChange={(visible) => {
192192
if (visible) {
193193
setVisible(true);
194194
} else {

0 commit comments

Comments
 (0)