mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-04 04:58:55 +08:00
commit
236ac80adb
@ -1,4 +1,4 @@
|
||||
{
|
||||
"sandboxes": ["antd-reproduction-template-y9vgcf"],
|
||||
"node": "14"
|
||||
"sandboxes": ["antd-reproduction-template-forked-jyh2k9"],
|
||||
"node": "18"
|
||||
}
|
||||
|
14
.github/lock.yml
vendored
14
.github/lock.yml
vendored
@ -1,14 +0,0 @@
|
||||
# Configuration for lock-threads - https://github.com/dessant/lock-threads
|
||||
|
||||
# Number of days of inactivity before a closed issue or pull request is locked
|
||||
daysUntilLock: 365
|
||||
# Comment to post before locking. Set to `false` to disable
|
||||
lockComment: >
|
||||
This thread has been automatically locked because it has not had recent
|
||||
activity. Please open a new issue for related bugs and link to relevant
|
||||
comments in this thread.
|
||||
# Issues or pull requests with these labels will not be locked
|
||||
# exemptLabels:
|
||||
# - no-locking
|
||||
# Limit to only `issues` or `pulls`
|
||||
only: issues
|
3
.github/tests_checker.yml
vendored
3
.github/tests_checker.yml
vendored
@ -1,3 +0,0 @@
|
||||
comment: 'Could you please add tests to make sure this change works as expected?',
|
||||
fileExtensions: [.ts', '.tsx', '.json']
|
||||
testDir: '__tests__'
|
@ -104,7 +104,7 @@ export default App;
|
||||
|
||||
### 🛡 TypeScript
|
||||
|
||||
参考 [在 TypeScript 中使用](https://ant.design/docs/react/use-in-typescript-cn)。
|
||||
`antd` 使用 TypeScript 编写,具有完整的类型定义,参考 [在 create-react-app 中使用](https://ant.design/docs/react/use-with-create-react-app-cn)。
|
||||
|
||||
## 🌍 国际化
|
||||
|
||||
|
@ -100,7 +100,7 @@ export default App;
|
||||
|
||||
### TypeScript
|
||||
|
||||
`antd` is written in TypeScript with complete definitions, check [Use in TypeScript](https://ant.design/docs/react/use-in-typescript) to get started.
|
||||
`antd` is written in TypeScript with complete definitions, check [Usage with create-react-app](https://ant.design/docs/react/use-with-create-react-app) to get started.
|
||||
|
||||
## 🌍 Internationalization
|
||||
|
||||
|
@ -13,8 +13,8 @@ import { Footer, renderCloseIcon } from './shared';
|
||||
import useStyle from './style';
|
||||
|
||||
export interface PurePanelProps
|
||||
extends Omit<PanelProps, 'prefixCls'>,
|
||||
Pick<ModalFuncProps, 'type'> {
|
||||
extends Omit<PanelProps, 'prefixCls' | 'footer'>,
|
||||
Pick<ModalFuncProps, 'type' | 'footer'> {
|
||||
prefixCls?: string;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
@ -28,6 +28,7 @@ const PurePanel: React.FC<PurePanelProps> = (props) => {
|
||||
type,
|
||||
title,
|
||||
children,
|
||||
footer,
|
||||
...restProps
|
||||
} = props;
|
||||
const { getPrefixCls } = React.useContext(ConfigContext);
|
||||
@ -60,7 +61,7 @@ const PurePanel: React.FC<PurePanelProps> = (props) => {
|
||||
additionalProps = {
|
||||
closable: closable ?? true,
|
||||
title,
|
||||
footer: props.footer === undefined ? <Footer {...props} /> : props.footer,
|
||||
footer: footer !== null && <Footer {...props} />,
|
||||
children,
|
||||
};
|
||||
}
|
||||
|
@ -972,6 +972,164 @@ exports[`renders components/modal/demo/render-panel.tsx extend context correctly
|
||||
tabindex="0"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
aria-modal="true"
|
||||
class="ant-modal ant-modal-pure-panel"
|
||||
role="dialog"
|
||||
style="width: 380px; height: 200px;"
|
||||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width: 0px; height: 0px; overflow: hidden; outline: none;"
|
||||
tabindex="0"
|
||||
/>
|
||||
<div
|
||||
class="ant-modal-content"
|
||||
>
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
>
|
||||
<span
|
||||
aria-label="close"
|
||||
class="anticon anticon-close ant-modal-close-icon"
|
||||
role="img"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
data-icon="close"
|
||||
fill="currentColor"
|
||||
fill-rule="evenodd"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
</button>
|
||||
<div
|
||||
class="ant-modal-header"
|
||||
>
|
||||
<div
|
||||
class="ant-modal-title"
|
||||
>
|
||||
Custom Footer Render
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-modal-body"
|
||||
>
|
||||
<div
|
||||
class="ant-typography"
|
||||
>
|
||||
<a
|
||||
class="ant-typography"
|
||||
href="https://github.com/ant-design/ant-design/pull/44318"
|
||||
>
|
||||
Feature #44318
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-modal-footer"
|
||||
>
|
||||
<div
|
||||
class="ant-space ant-space-vertical ant-space-gap-row-small ant-space-gap-col-small"
|
||||
>
|
||||
<div
|
||||
class="ant-space-item"
|
||||
>
|
||||
<div
|
||||
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small"
|
||||
>
|
||||
<div
|
||||
class="ant-space-item"
|
||||
>
|
||||
<button
|
||||
class="ant-btn ant-btn-default"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
Cancel
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
class="ant-space-item"
|
||||
>
|
||||
<button
|
||||
class="ant-btn ant-btn-primary"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
OK
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-space-item"
|
||||
>
|
||||
<div
|
||||
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small"
|
||||
>
|
||||
<div
|
||||
class="ant-space-item"
|
||||
>
|
||||
<button
|
||||
class="ant-btn ant-btn-default"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
Cancel
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
class="ant-space-item"
|
||||
>
|
||||
<button
|
||||
class="ant-btn ant-btn-primary ant-btn-dangerous"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
Custom
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
class="ant-space-item"
|
||||
>
|
||||
<button
|
||||
class="ant-btn ant-btn-primary"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
OK
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width: 0px; height: 0px; overflow: hidden; outline: none;"
|
||||
tabindex="0"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
@ -938,6 +938,164 @@ exports[`renders components/modal/demo/render-panel.tsx correctly 1`] = `
|
||||
tabindex="0"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
aria-modal="true"
|
||||
class="ant-modal ant-modal-pure-panel"
|
||||
role="dialog"
|
||||
style="width:380px;height:200px"
|
||||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width:0;height:0;overflow:hidden;outline:none"
|
||||
tabindex="0"
|
||||
/>
|
||||
<div
|
||||
class="ant-modal-content"
|
||||
>
|
||||
<button
|
||||
aria-label="Close"
|
||||
class="ant-modal-close"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
class="ant-modal-close-x"
|
||||
>
|
||||
<span
|
||||
aria-label="close"
|
||||
class="anticon anticon-close ant-modal-close-icon"
|
||||
role="img"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
data-icon="close"
|
||||
fill="currentColor"
|
||||
fill-rule="evenodd"
|
||||
focusable="false"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
</button>
|
||||
<div
|
||||
class="ant-modal-header"
|
||||
>
|
||||
<div
|
||||
class="ant-modal-title"
|
||||
>
|
||||
Custom Footer Render
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-modal-body"
|
||||
>
|
||||
<div
|
||||
class="ant-typography"
|
||||
>
|
||||
<a
|
||||
class="ant-typography"
|
||||
href="https://github.com/ant-design/ant-design/pull/44318"
|
||||
>
|
||||
Feature #44318
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-modal-footer"
|
||||
>
|
||||
<div
|
||||
class="ant-space ant-space-vertical ant-space-gap-row-small ant-space-gap-col-small"
|
||||
>
|
||||
<div
|
||||
class="ant-space-item"
|
||||
>
|
||||
<div
|
||||
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small"
|
||||
>
|
||||
<div
|
||||
class="ant-space-item"
|
||||
>
|
||||
<button
|
||||
class="ant-btn ant-btn-default"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
Cancel
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
class="ant-space-item"
|
||||
>
|
||||
<button
|
||||
class="ant-btn ant-btn-primary"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
OK
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-space-item"
|
||||
>
|
||||
<div
|
||||
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small"
|
||||
>
|
||||
<div
|
||||
class="ant-space-item"
|
||||
>
|
||||
<button
|
||||
class="ant-btn ant-btn-default"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
Cancel
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
class="ant-space-item"
|
||||
>
|
||||
<button
|
||||
class="ant-btn ant-btn-primary ant-btn-dangerous"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
Custom
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
class="ant-space-item"
|
||||
>
|
||||
<button
|
||||
class="ant-btn ant-btn-primary"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
OK
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
style="width:0;height:0;overflow:hidden;outline:none"
|
||||
tabindex="0"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
@ -1,9 +1,23 @@
|
||||
import React from 'react';
|
||||
import { Modal } from 'antd';
|
||||
import { Button, Modal, Space, Typography } from 'antd';
|
||||
import type { ModalFuncProps } from 'antd/es/modal/interface';
|
||||
|
||||
/** Test usage. Do not use in your production. */
|
||||
const { _InternalPanelDoNotUseOrYouWillBeFired: InternalPanel } = Modal;
|
||||
|
||||
const customFooterFn: ModalFuncProps['footer'] = (originNode, { OkBtn, CancelBtn }) => (
|
||||
<Space direction="vertical">
|
||||
<Space>{originNode}</Space>
|
||||
<Space>
|
||||
<CancelBtn />
|
||||
<Button danger type="primary">
|
||||
Custom
|
||||
</Button>
|
||||
<OkBtn />
|
||||
</Space>
|
||||
</Space>
|
||||
);
|
||||
|
||||
export default () => (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', rowGap: 16 }}>
|
||||
<InternalPanel title="Hello World!" style={{ width: '100%', height: 200 }}>
|
||||
@ -15,5 +29,17 @@ export default () => (
|
||||
<InternalPanel title="Confirm This?" type="confirm" style={{ width: 300, height: 200 }}>
|
||||
Some descriptions.
|
||||
</InternalPanel>
|
||||
|
||||
<InternalPanel
|
||||
title="Custom Footer Render"
|
||||
style={{ width: 380, height: 200 }}
|
||||
footer={customFooterFn}
|
||||
>
|
||||
<Typography.Paragraph>
|
||||
<Typography.Link href="https://github.com/ant-design/ant-design/pull/44318">
|
||||
Feature #44318
|
||||
</Typography.Link>
|
||||
</Typography.Paragraph>
|
||||
</InternalPanel>
|
||||
</div>
|
||||
);
|
||||
|
@ -6,6 +6,7 @@ import type { GlobalToken } from '../../theme';
|
||||
import type { FullToken } from '../../theme/internal';
|
||||
import { genComponentStyleHook, mergeToken } from '../../theme/internal';
|
||||
import type { GenStyleFn } from '../../theme/util/genComponentStyleHook';
|
||||
import { TinyColor } from '@ctrl/tinycolor';
|
||||
|
||||
export interface ComponentToken {
|
||||
/**
|
||||
@ -143,7 +144,9 @@ export const prepareToken: (token: Parameters<GenStyleFn<'Tag'>>[0]) => TagToken
|
||||
};
|
||||
|
||||
export const prepareCommonToken: (token: GlobalToken) => ComponentToken = (token) => ({
|
||||
defaultBg: token.colorFillQuaternary,
|
||||
defaultBg: new TinyColor(token.colorFillQuaternary)
|
||||
.onBackground(token.colorBgContainer)
|
||||
.toHexString(),
|
||||
defaultColor: token.colorText,
|
||||
});
|
||||
|
||||
|
@ -121,7 +121,7 @@
|
||||
"@rc-component/color-picker": "~1.4.1",
|
||||
"@rc-component/mutate-observer": "^1.1.0",
|
||||
"@rc-component/tour": "~1.10.0",
|
||||
"@rc-component/trigger": "^1.18.0",
|
||||
"@rc-component/trigger": "^1.18.1",
|
||||
"classnames": "^2.3.2",
|
||||
"copy-to-clipboard": "^3.3.3",
|
||||
"dayjs": "^1.11.1",
|
||||
@ -152,12 +152,12 @@
|
||||
"rc-switch": "~4.1.0",
|
||||
"rc-table": "~7.35.2",
|
||||
"rc-tabs": "~12.13.1",
|
||||
"rc-textarea": "~1.5.1",
|
||||
"rc-textarea": "~1.5.2",
|
||||
"rc-tooltip": "~6.1.2",
|
||||
"rc-tree": "~5.8.2",
|
||||
"rc-tree-select": "~5.15.0",
|
||||
"rc-upload": "~4.3.5",
|
||||
"rc-util": "^5.38.0",
|
||||
"rc-util": "^5.38.1",
|
||||
"scroll-into-view-if-needed": "^3.1.0",
|
||||
"throttle-debounce": "^5.0.0"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user