mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-29 18:50:00 +08:00
site(api-table): support show deprecated api (#51342)
This commit is contained in:
parent
e0e0cc211e
commit
bb58221893
@ -3,6 +3,7 @@ import { BugOutlined, CodeOutlined, ExperimentOutlined } from '@ant-design/icons
|
||||
import { ConfigProvider, Tooltip, Button } from 'antd';
|
||||
import classNames from 'classnames';
|
||||
import { DumiDemoGrid, FormattedMessage } from 'dumi';
|
||||
import { css, Global } from '@emotion/react';
|
||||
|
||||
import useLayoutState from '../../../hooks/useLayoutState';
|
||||
import useLocale from '../../../hooks/useLocale';
|
||||
@ -67,6 +68,13 @@ const DemoWrapper: typeof DumiDemoGrid = ({ items }) => {
|
||||
'demo-wrapper-show-debug': showDebug,
|
||||
})}
|
||||
>
|
||||
<Global
|
||||
styles={css`
|
||||
:root {
|
||||
--antd-site-api-deprecated-display: ${showDebug ? 'table-row' : 'none'};
|
||||
}
|
||||
`}
|
||||
/>
|
||||
<span className="all-code-box-controls">
|
||||
<Tooltip
|
||||
title={
|
||||
|
@ -373,6 +373,24 @@ const GlobalStyle: React.FC = () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Api 表中某些属性用 del 标记,表示已废弃(但仍期望给开发者一个过渡期)用 css 标记出来。仅此而已。
|
||||
有更多看法?移步讨论区: https://github.com/ant-design/ant-design/discussions/51298
|
||||
*/
|
||||
tr:has(td:first-child > del) {
|
||||
color: ${token.colorWarning} !important;
|
||||
background-color: ${token.colorWarningBg} !important;
|
||||
display: var(--antd-site-api-deprecated-display, none);
|
||||
|
||||
del {
|
||||
color: ${token.colorWarning};
|
||||
}
|
||||
|
||||
&:hover del {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.grid-demo,
|
||||
|
@ -54,6 +54,7 @@ Common props ref:[Common props](/docs/react/common-props)
|
||||
| addonAfter | The label text displayed after (on the right side of) the input field | ReactNode | - | |
|
||||
| addonBefore | The label text displayed before (on the left side of) the input field | ReactNode | - | |
|
||||
| allowClear | If allow to remove input content with clear icon | boolean \| { clearIcon: ReactNode } | false | |
|
||||
| ~~bordered~~ | Whether has border style | boolean | true | 4.5.0 |
|
||||
| classNames | Semantic DOM class | Record<[SemanticDOM](#input-1), string> | - | 5.4.0 |
|
||||
| count | Character count config | [CountConfig](#countconfig) | - | 5.10.0 |
|
||||
| defaultValue | The initial input content | string | - | |
|
||||
|
@ -55,6 +55,7 @@ demo:
|
||||
| addonAfter | 带标签的 input,设置后置标签 | ReactNode | - | |
|
||||
| addonBefore | 带标签的 input,设置前置标签 | ReactNode | - | |
|
||||
| allowClear | 可以点击清除图标删除内容 | boolean \| { clearIcon: ReactNode } | - | |
|
||||
| ~~bordered~~ | 是否有边框 | boolean | true | 4.5.0 |
|
||||
| classNames | 语义化结构 class | Record<[SemanticDOM](#input-1), string> | - | 5.4.0 |
|
||||
| count | 字符计数配置 | [CountConfig](#countconfig) | - | 5.10.0 |
|
||||
| defaultValue | 输入框默认内容 | string | - | |
|
||||
|
Loading…
Reference in New Issue
Block a user