mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
@@ -4,6 +4,21 @@ import classNames from 'classnames';
|
||||
import useLocale from '../../../hooks/useLocale';
|
||||
import Palette from './Palette';
|
||||
|
||||
const COLOR_KEYS = [
|
||||
'red',
|
||||
'volcano',
|
||||
'orange',
|
||||
'lime',
|
||||
'gold',
|
||||
'yellow',
|
||||
'green',
|
||||
'cyan',
|
||||
'blue',
|
||||
'geekblue',
|
||||
'purple',
|
||||
'magenta',
|
||||
] as const;
|
||||
|
||||
const locales = {
|
||||
cn: {
|
||||
redTitle: '薄暮',
|
||||
@@ -84,71 +99,13 @@ const locales = {
|
||||
const ColorPalettes: React.FC<{ dark?: boolean }> = (props) => {
|
||||
const { dark } = props;
|
||||
const [locale] = useLocale(locales);
|
||||
const memoizedColors = useMemo(
|
||||
() => [
|
||||
{
|
||||
name: 'red',
|
||||
title: locale.redTitle,
|
||||
description: locale.redDescription,
|
||||
},
|
||||
{
|
||||
name: 'volcano',
|
||||
title: locale.volcanoTitle,
|
||||
description: locale.volcanoDescription,
|
||||
},
|
||||
{
|
||||
name: 'orange',
|
||||
title: locale.orangeTitle,
|
||||
description: locale.orangeDescription,
|
||||
},
|
||||
{
|
||||
name: 'lime',
|
||||
title: locale.limeTitle,
|
||||
description: locale.limeDescription,
|
||||
},
|
||||
{
|
||||
name: 'gold',
|
||||
title: locale.goldTitle,
|
||||
description: locale.goldDescription,
|
||||
},
|
||||
{
|
||||
name: 'yellow',
|
||||
title: locale.yellowTitle,
|
||||
description: locale.yellowDescription,
|
||||
},
|
||||
{
|
||||
name: 'green',
|
||||
title: locale.greenTitle,
|
||||
description: locale.greenDescription,
|
||||
},
|
||||
{
|
||||
name: 'cyan',
|
||||
title: locale.cyanTitle,
|
||||
description: locale.cyanDescription,
|
||||
},
|
||||
{
|
||||
name: 'blue',
|
||||
title: locale.blueTitle,
|
||||
description: locale.blueDescription,
|
||||
},
|
||||
{
|
||||
name: 'geekblue',
|
||||
title: locale.geekblueTitle,
|
||||
description: locale.geekblueDescription,
|
||||
},
|
||||
{
|
||||
name: 'purple',
|
||||
title: locale.purpleTitle,
|
||||
description: locale.purpleDescription,
|
||||
},
|
||||
{
|
||||
name: 'magenta',
|
||||
title: locale.magentaTitle,
|
||||
description: locale.magentaDescription,
|
||||
},
|
||||
],
|
||||
[locale],
|
||||
);
|
||||
const memoizedColors = useMemo(() => {
|
||||
return COLOR_KEYS.map((key) => ({
|
||||
name: key,
|
||||
title: locale[`${key}Title`],
|
||||
description: locale[`${key}Description`],
|
||||
}));
|
||||
}, [locale]);
|
||||
return (
|
||||
<div className={classNames('color-palettes', { 'color-palettes-dark': dark })}>
|
||||
{memoizedColors.map((color) => (
|
||||
|
||||
@@ -17,9 +17,14 @@ tag: vVERSION
|
||||
|
||||
## 5.26.7
|
||||
|
||||
`2025-07-28`
|
||||
`2025-07-29`
|
||||
|
||||
- 🐞 Fixed Card `tabBarExtraContent` typing to support both `React.ReactNode` and `{ left?: React.ReactNode; right?: React.ReactNode }` using `TabBarExtraContent` from `rc-tabs`. [#54470](https://github.com/ant-design/ant-design/pull/54470) [@pueding](https://github.com/pueding)
|
||||
- 🐞 Fixed the issue where the cursor position was incorrect after pasting text into TextArea. [#72](https://github.com/react-component/textarea/pull/72) [@QdabuliuQ](https://github.com/QdabuliuQ)
|
||||
- ⚡️ Optimized the size of the Result component icon. [#54455](https://github.com/ant-design/ant-design/pull/54455) [@765477020](https://github.com/765477020)
|
||||
- ⚡️ Optimized the calculation performance of internal methods of Dropdown, Tooltip, Tour. [#54443](https://github.com/ant-design/ant-design/pull/54443) [Meet-student](https://github.com/Meet-student)
|
||||
- TypeScript
|
||||
- 🤖 Fixed Tabs `TabPaneProps` type to be compatible with deprecated APIs. [#54482](https://github.com/ant-design/ant-design/pull/54482) [@leshalv](https://github.com/leshalv)
|
||||
|
||||
## 5.26.6
|
||||
|
||||
|
||||
@@ -17,9 +17,14 @@ tag: vVERSION
|
||||
|
||||
## 5.26.7
|
||||
|
||||
`2025-07-28`
|
||||
`2025-07-29`
|
||||
|
||||
- 🐞 修复 Card 的 `tabBarExtraContent` 类型定义,仅支持 `React.ReactNode` 的问题。现在支持完整的 `rc-tabs` 类型,包括 `{ left?: React.ReactNode; right?: React.ReactNode }`。[#54470](https://github.com/ant-design/ant-design/pull/54470) [@pueding](https://github.com/pueding)
|
||||
- 🐞 修复了 TextArea 在 Firefox 浏览器下粘贴文本后光标位置错误的问题。[#72](https://github.com/react-component/textarea/pull/72) [@QdabuliuQ](https://github.com/QdabuliuQ)
|
||||
- ⚡️ 优化了 Result 组件的图标的体积。[#54455](https://github.com/ant-design/ant-design/pull/54455) [@765477020](https://github.com/765477020)
|
||||
- ⚡️ 优化了 Dropdown、Tooltip、Tour 等弹层类组件的内部方法的计算性能。[#54443](https://github.com/ant-design/ant-design/pull/54443) [Meet-student](https://github.com/Meet-student)
|
||||
- TypeScript
|
||||
- 🤖 修正了 Tabs 的 `TabPaneProps` 类型以兼容废弃 api。[#54482](https://github.com/ant-design/ant-design/pull/54482) [@leshalv](https://github.com/leshalv)
|
||||
|
||||
## 5.26.6
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ const localeValues: Locale = {
|
||||
copy: 'Kopyala',
|
||||
copied: 'Kopyalandı',
|
||||
expand: 'Genişlet',
|
||||
collapse: 'Daralt'
|
||||
},
|
||||
Form: {
|
||||
optional: '(opsiyonel)',
|
||||
|
||||
@@ -120,7 +120,7 @@ const GlobalHolderWrapper = React.forwardRef<GlobalHolderRef, unknown>((_, ref)
|
||||
);
|
||||
});
|
||||
|
||||
function flushNotice() {
|
||||
const flushMessageQueue = () => {
|
||||
if (!message) {
|
||||
const holderFragment = document.createDocumentFragment();
|
||||
|
||||
@@ -144,7 +144,7 @@ function flushNotice() {
|
||||
if (!newMessage.instance && instance) {
|
||||
newMessage.instance = instance;
|
||||
newMessage.sync = sync;
|
||||
flushNotice();
|
||||
flushMessageQueue();
|
||||
}
|
||||
});
|
||||
}}
|
||||
@@ -203,7 +203,7 @@ function flushNotice() {
|
||||
|
||||
// Clean up
|
||||
taskQueue = [];
|
||||
}
|
||||
};
|
||||
|
||||
// ==============================================================================
|
||||
// == Export ==
|
||||
@@ -246,7 +246,7 @@ function open(config: ArgsProps): MessageType {
|
||||
};
|
||||
});
|
||||
|
||||
flushNotice();
|
||||
flushMessageQueue();
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -283,17 +283,14 @@ function typeOpen(type: NoticeType, args: Parameters<TypeOpen>): MessageType {
|
||||
};
|
||||
});
|
||||
|
||||
flushNotice();
|
||||
flushMessageQueue();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
const destroy: BaseMethods['destroy'] = (key) => {
|
||||
taskQueue.push({
|
||||
type: 'destroy',
|
||||
key,
|
||||
});
|
||||
flushNotice();
|
||||
taskQueue.push({ type: 'destroy', key });
|
||||
flushMessageQueue();
|
||||
};
|
||||
|
||||
interface BaseMethods {
|
||||
|
||||
@@ -114,7 +114,7 @@ const GlobalHolderWrapper = React.forwardRef<GlobalHolderRef, unknown>((_, ref)
|
||||
);
|
||||
});
|
||||
|
||||
function flushNotice() {
|
||||
const flushNotificationQueue = () => {
|
||||
if (!notification) {
|
||||
const holderFragment = document.createDocumentFragment();
|
||||
|
||||
@@ -137,7 +137,7 @@ function flushNotice() {
|
||||
if (!newNotification.instance && instance) {
|
||||
newNotification.instance = instance;
|
||||
newNotification.sync = sync;
|
||||
flushNotice();
|
||||
flushNotificationQueue();
|
||||
}
|
||||
});
|
||||
}}
|
||||
@@ -169,7 +169,7 @@ function flushNotice() {
|
||||
|
||||
case 'destroy':
|
||||
act(() => {
|
||||
notification?.instance!.destroy(task.key);
|
||||
notification?.instance?.destroy(task.key);
|
||||
});
|
||||
break;
|
||||
}
|
||||
@@ -177,7 +177,7 @@ function flushNotice() {
|
||||
|
||||
// Clean up
|
||||
taskQueue = [];
|
||||
}
|
||||
};
|
||||
|
||||
// ==============================================================================
|
||||
// == Export ==
|
||||
@@ -202,19 +202,13 @@ function open(config: ArgsProps) {
|
||||
warnContext('notification');
|
||||
}
|
||||
|
||||
taskQueue.push({
|
||||
type: 'open',
|
||||
config,
|
||||
});
|
||||
flushNotice();
|
||||
taskQueue.push({ type: 'open', config });
|
||||
flushNotificationQueue();
|
||||
}
|
||||
|
||||
const destroy: BaseMethods['destroy'] = (key) => {
|
||||
taskQueue.push({
|
||||
type: 'destroy',
|
||||
key,
|
||||
});
|
||||
flushNotice();
|
||||
taskQueue.push({ type: 'destroy', key });
|
||||
flushNotificationQueue();
|
||||
};
|
||||
|
||||
interface BaseMethods {
|
||||
|
||||
Reference in New Issue
Block a user