mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
@@ -46,7 +46,7 @@ const useStyle = createStyles(({ css, cssVar }) => ({
|
||||
font-weight: normal;
|
||||
font-size: ${cssVar.fontSizeSM};
|
||||
opacity: 0.8;
|
||||
margin-left: 4px;
|
||||
margin-inline-start: ${cssVar.marginSM};
|
||||
`,
|
||||
}));
|
||||
|
||||
@@ -66,6 +66,7 @@ const MenuItemLabelWithTag: React.FC<MenuItemLabelProps> = (props) => {
|
||||
const { before, after, link, title, subtitle, search, tag, className } = props;
|
||||
|
||||
const [locale] = useLocale(locales);
|
||||
|
||||
const getLocale = (name: string) => {
|
||||
return (locale as any)[name.toLowerCase()] ?? name;
|
||||
};
|
||||
@@ -73,7 +74,7 @@ const MenuItemLabelWithTag: React.FC<MenuItemLabelProps> = (props) => {
|
||||
if (!before && !after) {
|
||||
return (
|
||||
<Link to={`${link}${search}`} className={clsx(className, { [styles.link]: tag })}>
|
||||
<Flex justify="flex-start" align="center" gap="small">
|
||||
<Flex justify="flex-start" align="center">
|
||||
<span>{title}</span>
|
||||
{subtitle && <span className={styles.subtitle}>{subtitle}</span>}
|
||||
</Flex>
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import React from 'react';
|
||||
import { CustomerServiceOutlined, QuestionCircleOutlined, SyncOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
Alert,
|
||||
Card,
|
||||
Carousel,
|
||||
DatePicker,
|
||||
Flex,
|
||||
FloatButton,
|
||||
Masonry,
|
||||
Modal,
|
||||
Progress,
|
||||
Splitter,
|
||||
Tag,
|
||||
Tour,
|
||||
Typography,
|
||||
@@ -181,29 +182,30 @@ const ComponentsList: React.FC = () => {
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
title: 'Progress',
|
||||
type: 'update',
|
||||
node: (
|
||||
<Flex gap="small" vertical>
|
||||
<Flex gap="small" align="center">
|
||||
<Progress type="circle" railColor="#e6f4ff" percent={60} size={14} />
|
||||
{locale.inProgress}
|
||||
</Flex>
|
||||
<Flex gap="small" align="center">
|
||||
<Progress type="circle" percent={100} size={14} />
|
||||
{locale.success}
|
||||
</Flex>
|
||||
<Flex gap="small" align="center">
|
||||
<Progress type="circle" status="exception" percent={88} size={14} />
|
||||
{locale.taskFailed}
|
||||
</Flex>
|
||||
</Flex>
|
||||
),
|
||||
},
|
||||
// {
|
||||
// title: 'Progress',
|
||||
// type: 'update',
|
||||
// node: (
|
||||
// <Flex gap="small" vertical>
|
||||
// <Flex gap="small" align="center">
|
||||
// <Progress type="circle" railColor="#e6f4ff" percent={60} size={14} />
|
||||
// {locale.inProgress}
|
||||
// </Flex>
|
||||
// <Flex gap="small" align="center">
|
||||
// <Progress type="circle" percent={100} size={14} />
|
||||
// {locale.success}
|
||||
// </Flex>
|
||||
// <Flex gap="small" align="center">
|
||||
// <Progress type="circle" status="exception" percent={88} size={14} />
|
||||
// {locale.taskFailed}
|
||||
// </Flex>
|
||||
// </Flex>
|
||||
// ),
|
||||
// },
|
||||
|
||||
{
|
||||
title: 'Tour',
|
||||
type: 'new',
|
||||
type: 'update',
|
||||
node: (
|
||||
<TourDoNotUseOrYouWillBeFired
|
||||
title="Ant Design"
|
||||
@@ -214,9 +216,10 @@ const ComponentsList: React.FC = () => {
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
title: 'FloatButton',
|
||||
type: 'new',
|
||||
type: 'update',
|
||||
node: (
|
||||
<Flex align="center" gap="large">
|
||||
<FloatButtonDoNotUseOrYouWillBeFired
|
||||
@@ -246,17 +249,76 @@ const ComponentsList: React.FC = () => {
|
||||
// },
|
||||
|
||||
{
|
||||
title: 'Alert',
|
||||
type: 'update',
|
||||
title: 'Splitter',
|
||||
type: 'new',
|
||||
node: (
|
||||
<Alert
|
||||
style={{ width: 400 }}
|
||||
title="Ant Design"
|
||||
description={locale.sampleContent}
|
||||
closable={{ closeIcon: true, disabled: true }}
|
||||
<Splitter
|
||||
style={{
|
||||
height: 200,
|
||||
width: 300,
|
||||
backgroundColor: '#fff',
|
||||
boxShadow: '0 0 10px rgba(0, 0, 0, 0.1)',
|
||||
}}
|
||||
>
|
||||
<Splitter.Panel defaultSize="40%" min="20%" max="70%">
|
||||
<Flex justify="center" align="center" style={{ height: '100%' }}>
|
||||
<Typography.Title type="secondary" level={5} style={{ whiteSpace: 'nowrap' }}>
|
||||
First
|
||||
</Typography.Title>
|
||||
</Flex>
|
||||
</Splitter.Panel>
|
||||
|
||||
<Splitter.Panel>
|
||||
<Flex justify="center" align="center" style={{ height: '100%' }}>
|
||||
<Typography.Title type="secondary" level={5} style={{ whiteSpace: 'nowrap' }}>
|
||||
Second
|
||||
</Typography.Title>
|
||||
</Flex>
|
||||
</Splitter.Panel>
|
||||
</Splitter>
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
title: 'Masonry',
|
||||
type: 'new',
|
||||
node: (
|
||||
<Masonry
|
||||
columns={2}
|
||||
gutter={8}
|
||||
style={{ width: '300px', height: '320px' }}
|
||||
items={[
|
||||
{ key: '1', data: 80 },
|
||||
{ key: '2', data: 60 },
|
||||
{ key: '3', data: 40 },
|
||||
{ key: '4', data: 120 },
|
||||
{ key: '5', data: 90 },
|
||||
{ key: '6', data: 40 },
|
||||
{ key: '7', data: 60 },
|
||||
{ key: '8', data: 70 },
|
||||
{ key: '9', data: 120 },
|
||||
]}
|
||||
itemRender={({ data, index }) => (
|
||||
<Card size="small" style={{ height: data }}>
|
||||
{index + 1}
|
||||
</Card>
|
||||
)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
||||
// {
|
||||
// title: 'Alert',
|
||||
// type: 'update',
|
||||
// node: (
|
||||
// <Alert
|
||||
// style={{ width: 400 }}
|
||||
// title="Ant Design"
|
||||
// description={locale.sampleContent}
|
||||
// closable={{ closeIcon: true, disabled: true }}
|
||||
// />
|
||||
// ),
|
||||
// },
|
||||
],
|
||||
[
|
||||
isMobile,
|
||||
|
||||
@@ -83,6 +83,7 @@ const Sandpack: React.FC<React.PropsWithChildren<SandpackProps>> = (props) => {
|
||||
<OriginSandpack
|
||||
theme={searchParams.getAll('theme').includes('dark') ? 'dark' : undefined}
|
||||
customSetup={setup}
|
||||
template="vite-react-ts"
|
||||
options={options}
|
||||
files={{
|
||||
'index.tsx': indexContent,
|
||||
|
||||
@@ -22,7 +22,7 @@ const useStyle = createStyles(({ cssVar }) => ({
|
||||
width: 100%;
|
||||
min-height: 600px;
|
||||
height: fit-content;
|
||||
background-color: #f5f5f5;
|
||||
background-color: ${cssVar.colorBgLayout};
|
||||
border: 1px solid #e8e8e8;
|
||||
border-radius: ${cssVar.borderRadiusLG};
|
||||
overflow: hidden;
|
||||
@@ -54,7 +54,7 @@ const useStyle = createStyles(({ cssVar }) => ({
|
||||
inset-inline-end: 20px;
|
||||
z-index: 10;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
font-size: ${cssVar.fontSize};
|
||||
`,
|
||||
mvp: css`
|
||||
margin-inline-end: ${cssVar.marginMD};
|
||||
|
||||
@@ -2,50 +2,45 @@ import { useMemo } from 'react';
|
||||
|
||||
import type { BehaviorMapItem } from './BehaviorMap';
|
||||
|
||||
export const useMermaidCode = (data: BehaviorMapItem): string => {
|
||||
const generateMermaidCode = (root: BehaviorMapItem): string => {
|
||||
const lines: string[] = [];
|
||||
const generateMermaidCode = (root: BehaviorMapItem) => {
|
||||
const lines: string[] = [];
|
||||
|
||||
lines.push('graph LR');
|
||||
lines.push('graph LR');
|
||||
|
||||
lines.push(`classDef baseNode fill:#fff,stroke:none,stroke-width:0px,rx:5,ry:5,font-size:14px`);
|
||||
lines.push(`classDef baseNode fill:#fff,stroke:none,stroke-width:0px,rx:5,ry:5,font-size:14px`);
|
||||
|
||||
const traverse = (node: BehaviorMapItem, parentId?: string) => {
|
||||
const safeId = `node_${node.id.replace(/[^a-z0-9]/gi, '_')}`;
|
||||
let labelText = node.label.replace(/"/g, "'");
|
||||
const traverse = (node: BehaviorMapItem, parentId?: string) => {
|
||||
const safeId = `node_${node.id.replace(/[^a-z0-9]/gi, '_')}`;
|
||||
let labelText = node.label.replace(/"/g, "'");
|
||||
|
||||
if (!parentId) {
|
||||
lines.push(`style ${safeId} font-size:16px`);
|
||||
labelText = `**${labelText}**`;
|
||||
} else if (node.targetType === 'mvp') {
|
||||
const blueDot = `<span style="display:inline-block;width:8px;height:8px;background-color:rgb(22, 119, 255);border-radius:50%;margin-right:8px;vertical-align:middle;"></span>`;
|
||||
labelText = `${blueDot}${labelText}`;
|
||||
} else if (node.targetType === 'extension') {
|
||||
const grayDot = `<span style="display:inline-block;width:8px;height:8px;background-color:rgb(160, 160, 160);border-radius:50%;margin-right:8px;vertical-align:middle;"></span>`;
|
||||
labelText = `${grayDot}${labelText}`;
|
||||
}
|
||||
lines.push(`${safeId}["${labelText}"]:::baseNode`);
|
||||
if (!parentId) {
|
||||
lines.push(`style ${safeId} font-size:16px`);
|
||||
labelText = `**${labelText}**`;
|
||||
} else if (node.targetType === 'mvp') {
|
||||
const blueDot = `<span style="display:inline-block;width:8px;height:8px;background-color:rgb(22, 119, 255);border-radius:50%;margin-inline-end:8px;vertical-align:middle;"></span>`;
|
||||
labelText = `${blueDot}${labelText}`;
|
||||
} else if (node.targetType === 'extension') {
|
||||
const grayDot = `<span style="display:inline-block;width:8px;height:8px;background-color:rgb(160, 160, 160);border-radius:50%;margin-inline-end:8px;vertical-align:middle;"></span>`;
|
||||
labelText = `${grayDot}${labelText}`;
|
||||
}
|
||||
lines.push(`${safeId}["${labelText}"]:::baseNode`);
|
||||
|
||||
if (node.link) {
|
||||
lines.push(`click ${safeId} "#${node.link}"`);
|
||||
}
|
||||
if (node.link) {
|
||||
lines.push(`click ${safeId} "#${node.link}"`);
|
||||
}
|
||||
|
||||
if (parentId) {
|
||||
lines.push(`${parentId} --> ${safeId}`);
|
||||
}
|
||||
if (parentId) {
|
||||
lines.push(`${parentId} --> ${safeId}`);
|
||||
}
|
||||
|
||||
if (node.children && node.children.length > 0) {
|
||||
node.children.forEach((child) => traverse(child, safeId));
|
||||
}
|
||||
};
|
||||
|
||||
traverse(root);
|
||||
return lines.join('\n');
|
||||
if (node.children && node.children.length > 0) {
|
||||
node.children.forEach((child) => traverse(child, safeId));
|
||||
}
|
||||
};
|
||||
|
||||
const mermaidCode = useMemo(() => {
|
||||
return generateMermaidCode(data);
|
||||
}, [data]);
|
||||
|
||||
return mermaidCode;
|
||||
traverse(root);
|
||||
return lines.join('\n');
|
||||
};
|
||||
|
||||
export const useMermaidCode = (data: BehaviorMapItem) => {
|
||||
return useMemo(() => generateMermaidCode(data), [data]);
|
||||
};
|
||||
|
||||
2
.github/workflows/pr-check-merge.yml
vendored
2
.github/workflows/pr-check-merge.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: (github.event.pull_request.head.ref == 'next' || github.event.pull_request.head.ref == 'feature' || github.event.pull_request.head.ref == 'master') && github.event.pull_request.head.user.login == 'ant-design'
|
||||
steps:
|
||||
- uses: actions-cool/issues-helper@d1d51fccf39469b5458203b1369060db0ff0c0db
|
||||
- uses: actions-cool/issues-helper@e2ff99831a4f13625d35064e2b3dfe65c07a0396
|
||||
with:
|
||||
actions: create-comment
|
||||
issue-number: ${{ github.event.number }}
|
||||
|
||||
1
.jest.js
1
.jest.js
@@ -9,6 +9,7 @@ const compileModules = [
|
||||
'@rc-component',
|
||||
// jsdom 27+ depends on ESM parse5, need transform
|
||||
'parse5',
|
||||
'@exodus',
|
||||
'jsdom',
|
||||
];
|
||||
|
||||
|
||||
@@ -15,6 +15,13 @@ tag: vVERSION
|
||||
|
||||
---
|
||||
|
||||
## 6.1.3
|
||||
|
||||
`2025-12-29`
|
||||
|
||||
- 🐞 Fix Drawer.PurePanel failing to respond to mouse interactions. [#56387](https://github.com/ant-design/ant-design/pull/56387) [@wanpan11](https://github.com/wanpan11)
|
||||
- 🐞 Fix Select `options` props leaking to DOM elements and causing React unknown-prop warnings. [#56341](https://github.com/ant-design/ant-design/pull/56341) [@afc163](https://github.com/afc163)
|
||||
|
||||
## 6.1.2
|
||||
|
||||
`2025-12-24`
|
||||
|
||||
@@ -15,6 +15,13 @@ tag: vVERSION
|
||||
|
||||
---
|
||||
|
||||
## 6.1.3
|
||||
|
||||
`2025-12-29`
|
||||
|
||||
- 🐞 修复 Drawer.PurePanel 无法响应鼠标交互的问题。[#56387](https://github.com/ant-design/ant-design/pull/56387) [@wanpan11](https://github.com/wanpan11)
|
||||
- 🐞 修复 Select options 属性透传至原生 DOM 导致 React 未知属性警告的问题。[#56341](https://github.com/ant-design/ant-design/pull/56341) [@afc163](https://github.com/afc163)
|
||||
|
||||
## 6.1.2
|
||||
|
||||
`2025-12-24`
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface ScrollNumberProps {
|
||||
motionClassName?: string;
|
||||
count?: string | number | null;
|
||||
children?: React.ReactElement;
|
||||
component?: React.ComponentType<any>;
|
||||
component?: React.ComponentType<React.HTMLAttributes<HTMLElement>>;
|
||||
style?: React.CSSProperties;
|
||||
title?: string | number | null;
|
||||
show: boolean;
|
||||
|
||||
@@ -120,7 +120,7 @@ const ButtonTypeMap: Partial<Record<ButtonType, ColorVariantPairType>> = {
|
||||
primary: ['primary', 'solid'],
|
||||
dashed: ['default', 'dashed'],
|
||||
// `link` is not a real color but we should compatible with it
|
||||
link: ['link' as any, 'link'],
|
||||
link: ['link' as ButtonColorType, 'link'],
|
||||
text: ['default', 'text'],
|
||||
};
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ const genDrawerStyle: GenerateStyle<DrawerToken> = (token) => {
|
||||
background: colorBgElevated,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
pointerEvents: 'auto',
|
||||
|
||||
[`&${componentCls}-left`]: {
|
||||
boxShadow: token.boxShadowDrawerLeft,
|
||||
|
||||
@@ -254,7 +254,7 @@ const Search = React.forwardRef<InputRef, SearchProps>((props, ref) => {
|
||||
onChange,
|
||||
disabled,
|
||||
},
|
||||
Object.keys(rootProps) as any[],
|
||||
Object.keys(rootProps) as Array<keyof typeof rootProps>,
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
@@ -40,7 +40,7 @@ export interface PureContentProps {
|
||||
export const PureContent: React.FC<React.PropsWithChildren<PureContentProps>> = (props) => {
|
||||
const { prefixCls, type, icon, children, classNames: pureContentClassNames, styles } = props;
|
||||
const iconElement = icon || (type && TypeIcon[type]);
|
||||
const iconNode = cloneElement<any>(iconElement, (currentProps) => {
|
||||
const iconNode = cloneElement<React.HTMLAttributes<HTMLElement>>(iconElement, (currentProps) => {
|
||||
const mergedStyle: React.CSSProperties = { ...currentProps?.style, ...styles?.icon };
|
||||
return {
|
||||
className: clsx(currentProps.className, pureContentClassNames?.icon),
|
||||
|
||||
@@ -328,7 +328,7 @@ methods.forEach((type: keyof MessageMethods) => {
|
||||
// ==============================================================================
|
||||
const noop = () => {};
|
||||
|
||||
let _actWrapper: (wrapper: any) => void = noop;
|
||||
let _actWrapper: (wrapper: (fn: () => void) => void) => void = noop;
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
_actWrapper = (wrapper) => {
|
||||
act = wrapper;
|
||||
|
||||
@@ -247,7 +247,7 @@ methods.forEach((type: keyof NoticeMethods) => {
|
||||
// ==============================================================================
|
||||
const noop = () => {};
|
||||
|
||||
let _actWrapper: (wrapper: any) => void = noop;
|
||||
let _actWrapper: (wrapper: (fn: () => void) => void) => void = noop;
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
_actWrapper = (wrapper) => {
|
||||
act = wrapper;
|
||||
|
||||
12
package.json
12
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "antd",
|
||||
"version": "6.1.2",
|
||||
"version": "6.1.3",
|
||||
"description": "An enterprise-class UI design language and React components implementation",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
@@ -247,7 +247,7 @@
|
||||
"eslint-plugin-react-hooks": "^7.0.1",
|
||||
"eslint-plugin-react-refresh": "^0.4.24",
|
||||
"fast-glob": "^3.3.3",
|
||||
"father": "4.6.11",
|
||||
"father": "4.6.12",
|
||||
"fs-extra": "^11.3.2",
|
||||
"gh-pages": "^6.3.0",
|
||||
"github-slugger": "^2.0.0",
|
||||
@@ -268,7 +268,7 @@
|
||||
"jest-image-snapshot": "^6.5.1",
|
||||
"jest-puppeteer": "^11.0.0",
|
||||
"jquery": "^3.7.1",
|
||||
"jsdom": "27.3.0",
|
||||
"jsdom": "27.4.0",
|
||||
"jsonml-to-react-element": "^1.1.11",
|
||||
"jsonml.js": "^0.1.0",
|
||||
"lint-staged": "^16.2.7",
|
||||
@@ -284,9 +284,9 @@
|
||||
"ora": "^9.0.0",
|
||||
"p-all": "^5.0.1",
|
||||
"package-manager-detector": "^1.6.0",
|
||||
"parse5": "6.0.1",
|
||||
"parse5-htmlparser2-tree-adapter": "6.0.1",
|
||||
"parse5-parser-stream": "6.0.1",
|
||||
"parse5": "8.0.0",
|
||||
"parse5-htmlparser2-tree-adapter": "8.0.0",
|
||||
"parse5-parser-stream": "8.0.0",
|
||||
"pngjs": "^7.0.0",
|
||||
"portfinder": "^1.0.38",
|
||||
"prettier": "^3.7.4",
|
||||
|
||||
Reference in New Issue
Block a user