site(api-table): support show deprecated api (#51342)

This commit is contained in:
𝑾𝒖𝒙𝒉 2024-10-23 11:25:33 +08:00 committed by GitHub
parent e0e0cc211e
commit bb58221893
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 28 additions and 0 deletions

View File

@ -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={

View File

@ -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,

View File

@ -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 | - | |

View File

@ -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 | - | |