未验证 提交 dcd97ca4 编写于 作者: 二货机器人 提交者: GitHub

Merge pull request #27055 from ant-design/master

chore: Feature merge master
......@@ -4,7 +4,7 @@ import TransitionEvents from '@ant-design/css-animation/lib/Event';
import raf from './raf';
import { ConfigConsumer, ConfigConsumerProps, CSPConfig, ConfigContext } from '../config-provider';
let styleForPesudo: HTMLStyleElement | null;
let styleForPseudo: HTMLStyleElement | null;
// Where el is the DOM element you'd like to test for visibility
function isHidden(element: HTMLElement) {
......@@ -74,8 +74,8 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
extraNode.className = `${getPrefixCls('')}-click-animating-node`;
const attributeName = this.getAttributeName();
node.setAttribute(attributeName, 'true');
// Not white or transparnt or grey
styleForPesudo = styleForPesudo || document.createElement('style');
// Not white or transparent or grey
styleForPseudo = styleForPseudo || document.createElement('style');
if (
waveColor &&
waveColor !== '#ffffff' &&
......@@ -86,18 +86,18 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
) {
// Add nonce if CSP exist
if (this.csp && this.csp.nonce) {
styleForPesudo.nonce = this.csp.nonce;
styleForPseudo.nonce = this.csp.nonce;
}
extraNode.style.borderColor = waveColor;
styleForPesudo.innerHTML = `
styleForPseudo.innerHTML = `
[${getPrefixCls('')}-click-animating-without-extra-node='true']::after, .${getPrefixCls(
'',
)}-click-animating-node {
--antd-wave-shadow-color: ${waveColor};
}`;
if (!document.body.contains(styleForPesudo)) {
document.body.appendChild(styleForPesudo);
if (!document.body.contains(styleForPseudo)) {
document.body.appendChild(styleForPseudo);
}
}
if (insertExtraNode) {
......@@ -180,8 +180,8 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
const attributeName = this.getAttributeName();
node.setAttribute(attributeName, 'false'); // edge has bug on `removeAttribute` #14466
if (styleForPesudo) {
styleForPesudo.innerHTML = '';
if (styleForPseudo) {
styleForPseudo.innerHTML = '';
}
if (insertExtraNode && this.extraNode && node.contains(this.extraNode)) {
......
......@@ -19,10 +19,10 @@ Alert component for feedback.
| afterClose | Called when close animation is finished | () => void | - |
| banner | Whether to show as banner | boolean | false |
| closable | Whether Alert can be closed | boolean | - |
| closeText | Close text to show | string \| ReactNode | - |
| description | Additional content of Alert | string \| ReactNode | - |
| closeText | Close text to show | ReactNode | - |
| description | Additional content of Alert | ReactNode | - |
| icon | Custom icon, effective when `showIcon` is true | ReactNode | - |
| message | Content of Alert | string \| ReactNode | - |
| message | Content of Alert | ReactNode | - |
| showIcon | Whether to show icon | boolean | false, in `banner` mode default is true |
| type | Type of Alert styles, options: `success`, `info`, `warning`, `error` | string | `info`, in `banner` mode default is `warning` |
| onClose | Callback when Alert is closed | (e: MouseEvent) => void | - |
......
......@@ -20,10 +20,10 @@ cover: https://gw.alipayobjects.com/zos/alicdn/8emPa3fjl/Alert.svg
| afterClose | 关闭动画结束后触发的回调函数 | () => void | - |
| banner | 是否用作顶部公告 | boolean | false |
| closable | 默认不显示关闭按钮 | boolean | - |
| closeText | 自定义关闭按钮 | string \| ReactNode | - |
| description | 警告提示的辅助性文字介绍 | string \| ReactNode | - |
| closeText | 自定义关闭按钮 | ReactNode | - |
| description | 警告提示的辅助性文字介绍 | ReactNode | - |
| icon | 自定义图标,`showIcon` 为 true 时有效 | ReactNode | - |
| message | 警告提示内容 | string \| ReactNode | - |
| message | 警告提示内容 | ReactNode | - |
| showIcon | 是否显示辅助图标 | boolean | false,`banner` 模式下默认值为 true |
| type | 指定警告提示的样式,有四种选择 `success``info``warning``error` | string | `info``banner` 模式下默认值为 `warning` |
| onClose | 关闭时触发的回调函数 | (e: MouseEvent) => void | - |
......
......@@ -30,8 +30,8 @@ For displaying anchor hyperlinks on page and jumping between them.
### Link Props
| Property | Description | Type | Default | Version |
| -------- | ----------------------------------------- | ------------------- | ------- | ------- |
| href | The target of hyperlink | string | | |
| title | The content of hyperlink | string \| ReactNode | | |
| target | Specifies where to display the linked URL | string | | |
| Property | Description | Type | Default | Version |
| -------- | ----------------------------------------- | --------- | ------- | ------- |
| href | The target of hyperlink | string | | |
| title | The content of hyperlink | ReactNode | | |
| target | Specifies where to display the linked URL | string | | |
......@@ -31,8 +31,8 @@ cover: https://gw.alipayobjects.com/zos/alicdn/_1-C1JwsC/Anchor.svg
### Link Props
| 成员 | 说明 | 类型 | 默认值 | 版本 |
| ------ | -------------------------------- | ------------------- | ------ | ---- |
| href | 锚点链接 | string | - | |
| title | 文字内容 | string \| ReactNode | - | |
| target | 该属性指定在何处显示链接的资源。 | string | - | |
| 成员 | 说明 | 类型 | 默认值 | 版本 |
| ------ | -------------------------------- | --------- | ------ | ---- |
| href | 锚点链接 | string | - | |
| title | 文字内容 | ReactNode | - | |
| target | 该属性指定在何处显示链接的资源。 | string | - | |
......@@ -22,7 +22,7 @@ A breadcrumb displays the current location within a hierarchy. It allows going b
| itemRender | Custom item renderer | (route, params, routes, paths) => ReactNode | - | |
| params | Routing parameters | object | - | |
| routes | The routing stack information of router | [routes\[\]](#routes) | - | |
| separator | Custom separator | string \| ReactNode | `/` | |
| separator | Custom separator | ReactNode | `/` | |
### Breadcrumb.Item
......@@ -35,9 +35,9 @@ A breadcrumb displays the current location within a hierarchy. It allows going b
### Breadcrumb.Separator
| Property | Description | Type | Default | Version |
| -------- | ---------------- | ------------------- | ------- | ------- |
| children | Custom separator | string \| ReactNode | `/` | |
| Property | Description | Type | Default | Version |
| -------- | ---------------- | --------- | ------- | ------- |
| children | Custom separator | ReactNode | `/` | |
> When using `Breadcrumb.Separator`,its parent component must be set to `separator=""`, otherwise the default separator of the parent component will appear.
......
......@@ -23,7 +23,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/9Ltop8JwH/Breadcrumb.svg
| itemRender | 自定义链接函数,和 react-router 配置使用 | (route, params, routes, paths) => ReactNode | - | |
| params | 路由的参数 | object | - | |
| routes | router 的路由栈信息 | [routes\[\]](#routes) | - | |
| separator | 分隔符自定义 | string \| ReactNode | `/` | |
| separator | 分隔符自定义 | ReactNode | `/` | |
### Breadcrumb.Item
......@@ -36,9 +36,9 @@ cover: https://gw.alipayobjects.com/zos/alicdn/9Ltop8JwH/Breadcrumb.svg
### Breadcrumb.Separator
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| -------- | -------------- | ------------------- | ------ | ---- |
| children | 要显示的分隔符 | string \| ReactNode | `/` | |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| -------- | -------------- | --------- | ------ | ---- |
| children | 要显示的分隔符 | ReactNode | `/` | |
> 注意:在使用 `Breadcrumb.Separator` 时,其父组件的分隔符必须设置为 `separator=""`,否则会出现父组件默认的分隔符。
......
......@@ -29,13 +29,13 @@ A card can be used to display content related to a single subject. The content c
| bordered | Toggles rendering of the border around the card | boolean | true | |
| cover | Card cover | ReactNode | - | |
| defaultActiveTabKey | Initial active TabPane's key, if `activeTabKey` is not set | string | - | |
| extra | Content to render in the top-right corner of the card | string \| ReactNode | - | |
| extra | Content to render in the top-right corner of the card | ReactNode | - | |
| hoverable | Lift up when hovering card | boolean | false | |
| loading | Shows a loading indicator while the contents of the card are being fetched | boolean | false | |
| tabList | List of TabPane's head | Array&lt;{key: string, tab: ReactNode}> | - | |
| tabBarExtraContent | Extra content in tab bar | ReactNode | - | |
| size | Size of card | `default` \| `small` | `default` | |
| title | Card title | string \| ReactNode | - | |
| title | Card title | ReactNode | - | |
| type | Card style type, can be set to `inner` or not set | string | - | |
| onTabChange | Callback when tab is switched | (key) => void | - | |
| tabProps | [Tabs](/components/tabs/#Tabs) | - | - | |
......
......@@ -30,13 +30,13 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/NqXt8DJhky/Card.svg
| bordered | 是否有边框 | boolean | true | |
| cover | 卡片封面 | ReactNode | - | |
| defaultActiveTabKey | 初始化选中页签的 key,如果没有设置 activeTabKey | string | `第一个页签` | |
| extra | 卡片右上角的操作区域 | string \| ReactNode | - | |
| extra | 卡片右上角的操作区域 | ReactNode | - | |
| hoverable | 鼠标移过时可浮起 | boolean | false | |
| loading | 当卡片内容还在加载中时,可以用 loading 展示一个占位 | boolean | false | |
| tabList | 页签标题列表 | Array&lt;{key: string, tab: ReactNode}> | - | |
| tabBarExtraContent | tab bar 上额外的元素 | ReactNode | - | |
| size | card 的尺寸 | `default` \| `small` | `default` | |
| title | 卡片标题 | string \| ReactNode | - | |
| title | 卡片标题 | ReactNode | - | |
| type | 卡片类型,可设置为 `inner` 或 不设置 | string | - | |
| onTabChange | 页签切换的回调 | (key) => void | - | |
| tabProps | [Tabs](/components/tabs/#Tabs) | - | - | |
......
......@@ -85,5 +85,11 @@
left: @control-padding-horizontal;
}
}
&-loading-icon {
.@{menu-rtl-cls} & {
transform: scaleY(-1);
}
}
}
}
......@@ -35,7 +35,7 @@ A content area which can be collapsed and expanded.
| --- | --- | --- | --- | --- |
| disabled | If true, panel cannot be opened or closed | boolean | false | |
| forceRender | Forced render of content on panel, instead of lazy rending after clicking on header | boolean | false | |
| header | Title of the panel | string \| ReactNode | - | |
| header | Title of the panel | ReactNode | - | |
| key | Unique key identifying the panel from among its siblings | string \| number | - | |
| showArrow | If false, panel will not show arrow icon | boolean | true | |
| extra | The extra element in the corner | ReactNode | - | |
......@@ -32,11 +32,11 @@ cover: https://gw.alipayobjects.com/zos/alicdn/IxH16B9RD/Collapse.svg
### Collapse.Panel
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| ----------- | ------------------------------------------ | ------------------- | ------ | ---- |
| disabled | 禁用后的面板展开与否将无法通过用户交互改变 | boolean | false | |
| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false | |
| header | 面板头内容 | string \| ReactNode | - | |
| key | 对应 activeKey | string \| number | - | |
| showArrow | 是否展示当前面板上的箭头 | boolean | true | |
| extra | 自定义渲染每个面板右上角的内容 | ReactNode | - | |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| ----------- | ------------------------------------------ | ---------------- | ------ | ---- |
| disabled | 禁用后的面板展开与否将无法通过用户交互改变 | boolean | false | |
| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false | |
| header | 面板头内容 | ReactNode | - | |
| key | 对应 activeKey | string \| number | - | |
| showArrow | 是否展示当前面板上的箭头 | boolean | true | |
| extra | 自定义渲染每个面板右上角的内容 | ReactNode | - | |
......@@ -17,8 +17,8 @@ Comments can be used to enable discussions on an entity such as a page, blog pos
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| actions | List of action items rendered below the comment content | Array&lt;ReactNode> | - | |
| author | The element to display as the comment author | string \| ReactNode | - | |
| avatar | The element to display as the comment avatar - generally an antd Avatar or src | string \| ReactNode | - | |
| author | The element to display as the comment author | ReactNode | - | |
| avatar | The element to display as the comment avatar - generally an antd Avatar or src | ReactNode | - | |
| children | Nested comments should be provided as children of the Comment | ReactNode | - | |
| content | The main content of the comment | string \| ReactNode | - | |
| datetime | A datetime element containing the time to be displayed | string \| ReactNode | - | |
| content | The main content of the comment | ReactNode | - | |
| datetime | A datetime element containing the time to be displayed | ReactNode | - | |
......@@ -18,8 +18,8 @@ cover: https://gw.alipayobjects.com/zos/alicdn/ILhxpGzBO/Comment.svg
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| actions | 在评论内容下面呈现的操作项列表 | Array&lt;ReactNode> | - | |
| author | 要显示为注释作者的元素 | string \| ReactNode | - | |
| avatar | 要显示为评论头像的元素 - 通常是 antd Avatar 或者 src | string \| ReactNode | - | |
| author | 要显示为注释作者的元素 | ReactNode | - | |
| avatar | 要显示为评论头像的元素 - 通常是 antd Avatar 或者 src | ReactNode | - | |
| children | 嵌套注释应作为注释的子项提供 | ReactNode | - | |
| content | 评论的主要内容 | string \| ReactNode | - | |
| datetime | 展示时间描述 | string \| ReactNode | - | |
| content | 评论的主要内容 | ReactNode | - | |
| datetime | 展示时间描述 | ReactNode | - | |
......@@ -19,7 +19,7 @@ Commonly displayed on the details page.
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| title | The title of the description list, placed at the top | ReactNode | - | |
| extra | The action area of the description list, placed at the top-right | string \| ReactNode | - | 4.5.0 |
| extra | The action area of the description list, placed at the top-right | ReactNode | - | 4.5.0 |
| bordered | Whether to display the border | boolean | false | |
| column | The number of `DescriptionItems` in a row,could be a number or a object like `{ xs: 8, sm: 16, md: 24}`,(Only set `bordered={true}` to take effect) | number | 3 | |
| size | Set the size of the list. Can be set to `middle`,`small`, or not filled | `default` \| `middle` \| `small` | - | |
......
......@@ -20,7 +20,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/MjtG9_FOI/Descriptions.svg
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| title | 描述列表的标题,显示在最顶部 | ReactNode | - | |
| extra | 描述列表的操作区域,显示在右上方 | string \| ReactNode | - | 4.5.0 |
| extra | 描述列表的操作区域,显示在右上方 | ReactNode | - | 4.5.0 |
| bordered | 是否展示边框 | boolean | false | |
| column | 一行的 `DescriptionItems` 数量,可以写成像素值或支持响应式的对象写法 `{ xs: 8, sm: 16, md: 24}` | number | 3 | |
| size | 设置列表的大小。可以设置为 `middle``small`, 或不填(只有设置 `bordered={true}` 生效) | `default` \| `middle` \| `small` | - | |
......
......@@ -32,7 +32,7 @@ A Drawer is a panel that is typically overlaid on top of a page and slides in fr
| drawerStyle | Style of the popup layer element | object | - |
| headerStyle | Style of the drawer header part | object | - |
| bodyStyle | Style of the drawer content part | object | - |
| title | The title for Drawer | string \| ReactNode | - |
| title | The title for Drawer | ReactNode | - |
| visible | Whether the Drawer dialog is visible or not | boolean | false |
| width | Width of the Drawer dialog | string \| number | 256 |
| height | Placement is `top` or `bottom`, height of the Drawer dialog | string \| number | 256 |
......
......@@ -31,7 +31,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/7z8NJQhFb/Drawer.svg
| drawerStyle | 用于设置 Drawer 弹出层的样式 | CSSProperties | - |
| headerStyle | 用于设置 Drawer 头部的样式 | CSSProperties | - |
| bodyStyle | 可用于设置 Drawer 内容部分的样式 | CSSProperties | - |
| title | 标题 | string \| ReactNode | - |
| title | 标题 | ReactNode | - |
| visible | Drawer 是否可见 | boolean | - |
| width | 宽度 | string \| number | 256 |
| height | 高度, 在 `placement``top``bottom` 时使用 | string \| number | 256 |
......
......@@ -23,9 +23,9 @@ Empty state placeholder.
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| description | Customize description | string \| ReactNode | - | |
| description | Customize description | ReactNode | - | |
| imageStyle | The style of image | CSSProperties | - | |
| image | Customize image. Will treat as image url when string provided | string \| ReactNode | `Empty.PRESENTED_IMAGE_DEFAULT` | |
| image | Customize image. Will treat as image url when string provided | ReactNode | `Empty.PRESENTED_IMAGE_DEFAULT` | |
## Built-in images
......
......@@ -24,9 +24,9 @@ cover: https://gw.alipayobjects.com/zos/alicdn/MNbKfLBVb/Empty.svg
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| description | 自定义描述内容 | string \| ReactNode | - | |
| description | 自定义描述内容 | ReactNode | - | |
| imageStyle | 图片样式 | CSSProperties | - | |
| image | 设置显示图片,为 string 时表示自定义图片地址。 | string \| ReactNode | `Empty.PRESENTED_IMAGE_DEFAULT` | |
| image | 设置显示图片,为 string 时表示自定义图片地址。 | ReactNode | `Empty.PRESENTED_IMAGE_DEFAULT` | |
## 内置图片
......
......@@ -74,15 +74,15 @@ Form field component for data bidirectional binding, validation, layout, and so
| --- | --- | --- | --- | --- |
| colon | Used with `label`, whether to display `:` after label text. | boolean | true | |
| dependencies | Set the dependency field. See [below](#dependencies) | [NamePath](#NamePath)[] | - | |
| extra | The extra prompt message. It is similar to help. Usage example: to display error message and prompt message at the same time | string \| ReactNode | - | |
| extra | The extra prompt message. It is similar to help. Usage example: to display error message and prompt message at the same time | ReactNode | - | |
| getValueFromEvent | Specify how to get value from event or other onChange arguments | (..args: any[]) => any | - | |
| getValueProps | Additional props with sub component | (value: any) => any | - | 4.2.0 |
| hasFeedback | Used with `validateStatus`, this option specifies the validation status icon. Recommended to be used only with `Input` | boolean | false | |
| help | The prompt message. If not provided, the prompt message will be generated by the validation rule. | string \| ReactNode | - | |
| help | The prompt message. If not provided, the prompt message will be generated by the validation rule. | ReactNode | - | |
| htmlFor | Set sub label `htmlFor` | string | - | |
| initialValue | Config sub default value. Form `initialValues` get higher priority when conflict | string | - | 4.2.0 |
| noStyle | No style for `true`, used as a pure field control | boolean | false | |
| label | Label text | string \| ReactNode | - | |
| label | Label text | ReactNode | - | |
| labelAlign | The text align of label | `left` \| `right` | `right` | |
<<<<<<< HEAD | labelCol | The layout of label. You can set `span` `offset` to something like `{span: 3, offset: 12}` or `sm: {span: 3, offset: 12}` same as with `<Col>`. You can set `labelCol` on Form. If both exists, use Item first | [object](/components/grid/#Col) | - | | | messageVariables | default validate filed info | Record<string, string> | - | 4.7.0 | ======= | labelCol | The layout of label. You can set `span` `offset` to something like `{span: 3, offset: 12}` or `sm: {span: 3, offset: 12}` same as with `<Col>`. You can set `labelCol` on Form which will not affect nest Item. If both exists, use Item first | [object](/components/grid/#Col) | - | |
......
......@@ -75,15 +75,15 @@ const validateMessages = {
| --- | --- | --- | --- | --- |
| colon | 配合 `label` 属性使用,表示是否显示 `label` 后面的冒号 | boolean | true | |
| dependencies | 设置依赖字段,说明[见下](#dependencies) | [NamePath](#NamePath)[] | - | |
| extra | 额外的提示信息,和 `help` 类似,当需要错误信息和提示文案同时出现时,可以使用这个。 | string \| ReactNode | - | |
| extra | 额外的提示信息,和 `help` 类似,当需要错误信息和提示文案同时出现时,可以使用这个。 | ReactNode | - | |
| getValueFromEvent | 设置如何将 event 的值转换成字段值 | (..args: any[]) => any | - | |
| getValueProps | 为子元素添加额外的属性 | (value: any) => any | - | 4.2.0 |
| hasFeedback | 配合 `validateStatus` 属性使用,展示校验状态图标,建议只配合 Input 组件使用 | boolean | false | |
| help | 提示信息,如不设置,则会根据校验规则自动生成 | string \| ReactNode | - | |
| help | 提示信息,如不设置,则会根据校验规则自动生成 | ReactNode | - | |
| htmlFor | 设置子元素 label `htmlFor` 属性 | string | - | |
| initialValue | 设置子元素默认值,如果与 Form 的 `initialValues` 冲突则以 Form 为准 | string | - | 4.2.0 |
| noStyle | 为 `true` 时不带样式,作为纯字段控件使用 | boolean | false | |
| label | `label` 标签的文本 | string \| ReactNode | - | |
| label | `label` 标签的文本 | ReactNode | - | |
| labelAlign | 标签文本对齐方式 | `left` \| `right` | `right` | |
<<<<<<< HEAD | labelCol | `label` 标签布局 `<Col>` 组件,设置 `span` `offset` 值,如 `{span: 3, offset: 12}` 或 `sm: {span: 3, offset: 12}`。你可以通过 Form 的 `labelCol` 进行统一设置。当和 Form 同时设置时,以 Item 为准 | [object](/components/grid/#Col) | - | | | messageVariables | 默认验证字段的信息 | Record<string, string> | - | 4.7.0 | ======= | labelCol | `label` 标签布局,同 `<Col>` 组件,设置 `span` `offset` 值,如 `{span: 3, offset: 12}` 或 `sm: {span: 3, offset: 12}`。你可以通过 Form 的 `labelCol` 进行统一设置,不会作用于嵌套 Item。当和 Form 同时设置时,以 Item 为准 | [object](/components/grid/#Col) | - | |
......
---
title: Migrate to v4
title: Migrate Form to v4
skip: true
---
......
---
title: 从 v3 到 v4
title: Form 从 v3 到 v4
skip: true
---
......
......@@ -18,15 +18,15 @@ A basic widget for getting the user input is a text field. Keyboard and mouse ca
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| addonAfter | The label text displayed after (on the right side of) the input field | string \| ReactNode | - | |
| addonBefore | The label text displayed before (on the left side of) the input field | string \| ReactNode | - | |
| 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 | - | |
| defaultValue | The initial input content | string | - | |
| disabled | Whether the input is disabled | boolean | false | |
| id | The ID for input | string | - | |
| maxLength | The max length | number | - | |
| prefix | The prefix icon for the Input | string \| ReactNode | - | |
| prefix | The prefix icon for the Input | ReactNode | - | |
| size | The size of the input box. Note: in the context of a form, the `large` size is used | `large` \| `middle` \| `small` | - | |
| suffix | The suffix icon for the Input | string \| ReactNode | - | |
| suffix | The suffix icon for the Input | ReactNode | - | |
| type | The type of input, see: [MDN](https://developer.mozilla.org/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types)( use `Input.TextArea` instead of `type="textarea"`) | string | `text` | |
| value | The input content value | string | - | |
| onChange | Callback when user input | function(e) | - | |
......
......@@ -19,15 +19,15 @@ cover: https://gw.alipayobjects.com/zos/alicdn/xS9YEJhfe/Input.svg
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| addonAfter | 带标签的 input,设置后置标签 | string \| ReactNode | - | |
| addonBefore | 带标签的 input,设置前置标签 | string \| ReactNode | - | |
| addonAfter | 带标签的 input,设置后置标签 | ReactNode | - | |
| addonBefore | 带标签的 input,设置前置标签 | ReactNode | - | |
| defaultValue | 输入框默认内容 | string | - | |
| disabled | 是否禁用状态,默认为 false | boolean | false | |
| id | 输入框的 id | string | - | |
| maxLength | 最大长度 | number | - | |
| prefix | 带有前缀图标的 input | string \| ReactNode | - | |
| prefix | 带有前缀图标的 input | ReactNode | - | |
| size | 控件大小。注:标准表单内的输入框大小限制为 `large` | `large` \| `middle` \| `small` | - | |
| suffix | 带有后缀图标的 input | string \| ReactNode | - | |
| suffix | 带有后缀图标的 input | ReactNode | - | |
| type | 声明 input 类型,同原生 input 标签的 type 属性,见:[MDN](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/input#属性)(请直接使用 `Input.TextArea` 代替 `type="textarea"`) | string | `text` | |
| value | 输入框内容 | string | - | |
| onChange | 输入框内容变化时的回调 | function(e) | - | |
......
......@@ -108,7 +108,11 @@ class InternalSider extends React.Component<InternalSideProps, SiderState> {
componentDidMount() {
if (this.mql) {
this.mql.addListener(this.responsiveHandler);
try {
this.mql.addEventListener('change', this.responsiveHandler);
} catch (error) {
this.mql.addListener(this.responsiveHandler);
}
this.responsiveHandler(this.mql);
}
......@@ -116,7 +120,11 @@ class InternalSider extends React.Component<InternalSideProps, SiderState> {
}
componentWillUnmount() {
this?.mql?.removeListener(this.responsiveHandler as any);
try {
this.mql?.removeEventListener('change', this.responsiveHandler);
} catch (error) {
this.mql?.removeListener(this.responsiveHandler);
}
this.props?.siderHook.removeSider(this.uniqueId);
}
......
......@@ -99,7 +99,7 @@ The sidebar.
| reverseArrow | Reverse direction of arrow, for a sider that expands from the right | boolean | false |
| style | To customize the styles | CSSProperties | - |
| theme | Color theme of the sidebar | `light` \| `dark` | `dark` |
| trigger | Specify the customized trigger, set to null to hide the trigger | string \| ReactNode | - |
| trigger | Specify the customized trigger, set to null to hide the trigger | ReactNode | - |
| width | Width of the sidebar | number \| string | 200 |
| zeroWidthTriggerStyle | To customize the styles of the special trigger that appears when `collapsedWidth` is 0 | object | - |
......
......@@ -100,7 +100,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/hzEndUVEx/Layout.svg
| reverseArrow | 翻转折叠提示箭头的方向,当 Sider 在右边时可以使用 | boolean | false |
| style | 指定样式 | CSSProperties | - |
| theme | 主题颜色 | `light` \| `dark` | `dark` |
| trigger | 自定义 trigger,设置为 null 时隐藏 trigger | string \| ReactNode | - |
| trigger | 自定义 trigger,设置为 null 时隐藏 trigger | ReactNode | - |
| width | 宽度 | number \| string | 200 |
| zeroWidthTriggerStyle | 指定当 `collapsedWidth` 为 0 时出现的特殊 trigger 的样式 | object | - |
......
......@@ -19,13 +19,13 @@ A list can be used to display content related to a single subject. The content c
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| bordered | Toggles rendering of the border around the list | boolean | false | |
| footer | List footer renderer | string \| ReactNode | - | |
| footer | List footer renderer | ReactNode | - | |
| grid | The grid type of list. You can set grid to something like {gutter: 16, column: 4} | [object](#List-grid-props) | - | |
| header | List header renderer | string \| ReactNode | - | |
| header | List header renderer | ReactNode | - | |
| itemLayout | The layout of list, default is `horizontal`, If a vertical list is desired, set the itemLayout property to `vertical` | string | - | |
| rowKey | Item's unique key, could be a string or function that returns a string | string \| Function(record): string | `key` | |
| loading | Shows a loading indicator while the contents of the list are being fetched | boolean \| [SpinProps](/components/spin/#API) ([more](https://github.com/ant-design/ant-design/issues/8659)) | false | |
| loadMore | Shows a load more content | string \| ReactNode | - | |
| loadMore | Shows a load more content | ReactNode | - | |
| locale | The i18n text including empty text | object | {emptyText: `No Data`} | |
| pagination | Pagination [config](/components/pagination/), hide it by setting it to false | boolean \| object | false | |
| size | Size of list | `default` \| `large` \| `small` | `default` | |
......@@ -61,12 +61,12 @@ More about pagination, please check [`Pagination`](/components/pagination/).
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| actions | The actions content of list item. If `itemLayout` is `vertical`, shows the content on bottom, otherwise shows content on the far right | Array&lt;ReactNode> | - | |
| extra | The extra content of list item. If `itemLayout` is `vertical`, shows the content on right, otherwise shows content on the far right | string \| ReactNode | - | |
| extra | The extra content of list item. If `itemLayout` is `vertical`, shows the content on right, otherwise shows content on the far right | ReactNode | - | |
### List.Item.Meta
| Property | Description | Type | Default | Version |
| ----------- | ---------------------------- | ------------------- | ------- | ------- |
| avatar | The avatar of list item | ReactNode | - | |
| description | The description of list item | string \| ReactNode | - | |
| title | The title of list item | string \| ReactNode | - | |
| Property | Description | Type | Default | Version |
| ----------- | ---------------------------- | --------- | ------- | ------- |
| avatar | The avatar of list item | ReactNode | - | |
| description | The description of list item | ReactNode | - | |
| title | The title of list item | ReactNode | - | |
......@@ -22,12 +22,12 @@ cover: https://gw.alipayobjects.com/zos/alicdn/5FrZKStG_/List.svg
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| bordered | 是否展示边框 | boolean | false | |
| footer | 列表底部 | string \| ReactNode | - | |
| footer | 列表底部 | ReactNode | - | |
| grid | 列表栅格配置 | [object](#List-grid-props) | - | |
| header | 列表头部 | string \| ReactNode | - | |
| header | 列表头部 | ReactNode | - | |
| itemLayout | 设置 `List.Item` 布局, 设置成 `vertical` 则竖直样式显示, 默认横排 | string | - | |
| loading | 当卡片内容还在加载中时,可以用 `loading` 展示一个占位 | boolean \| [object](/components/spin/#API) ([更多](https://github.com/ant-design/ant-design/issues/8659)) | false | |
| loadMore | 加载更多 | string \| ReactNode | - | |
| loadMore | 加载更多 | ReactNode | - | |
| locale | 默认文案设置,目前包括空数据文案 | object | {emptyText: `暂无数据`} | |
| pagination | 对应的 `pagination` 配置, 设置 false 不显示 | boolean \| object | false | |
| size | list 的尺寸 | `default` \| `large` \| `small` | `default` | |
......@@ -63,12 +63,12 @@ cover: https://gw.alipayobjects.com/zos/alicdn/5FrZKStG_/List.svg
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| actions | 列表操作组,根据 `itemLayout` 的不同, 位置在卡片底部或者最右侧 | Array&lt;ReactNode> | - | |
| extra | 额外内容, 通常用在 `itemLayout``vertical` 的情况下, 展示右侧内容; `horizontal` 展示在列表元素最右侧 | string \| ReactNode | - | |
| extra | 额外内容, 通常用在 `itemLayout``vertical` 的情况下, 展示右侧内容; `horizontal` 展示在列表元素最右侧 | ReactNode | - | |
### List.Item.Meta
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| ----------- | ------------------ | ------------------- | ------ | ---- |
| avatar | 列表元素的图标 | ReactNode | - | |
| description | 列表元素的描述内容 | string \| ReactNode | - | |
| title | 列表元素的标题 | string \| ReactNode | - | |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| ----------- | ------------------ | --------- | ------ | ---- |
| avatar | 列表元素的图标 | ReactNode | - | |
| description | 列表元素的描述内容 | ReactNode | - | |
| title | 列表元素的标题 | ReactNode | - | |
......@@ -75,6 +75,7 @@ const localeValues: Locale = {
back: 'Geri',
},
Form: {
optional: '(opsiyonel)',
defaultValidateMessages: {
default: 'Alan doğrulama hatası ${label}',
required: '${label} gerekli bir alan',
......
......@@ -89,16 +89,16 @@ More layouts with navigation: [Layout](/components/layout).
| children | Sub-menus or sub-menu items | Array&lt;MenuItem \| SubMenu> | - | |
| disabled | Whether sub-menu is disabled | boolean | false | |
| key | Unique ID of the sub-menu | string | - | |
| title | Title of sub menu | string \| ReactNode | - | |
| title | Title of sub menu | ReactNode | - | |
| icon | Icon of sub menu | ReactNode | - | 4.2.0 |
| onTitleClick | Callback executed when the sub-menu title is clicked | function({ key, domEvent }) | - | |
### Menu.ItemGroup
| Param | Description | Type | Default value | Version |
| -------- | ---------------------- | ------------------- | ------------- | ------- |
| children | Sub-menu items | MenuItem\[] | - | |
| title | The title of the group | string \| ReactNode | - | |
| Param | Description | Type | Default value | Version |
| -------- | ---------------------- | ----------- | ------------- | ------- |
| children | Sub-menu items | MenuItem\[] | - | |
| title | The title of the group | ReactNode | - | |
### Menu.Divider
......
......@@ -90,16 +90,16 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3XZcjGpvK/Menu.svg
| children | 子菜单的菜单项 | Array&lt;MenuItem \| SubMenu> | - | |
| disabled | 是否禁用 | boolean | false | |
| key | 唯一标志 | string | - | |
| title | 子菜单项值 | string \| ReactNode | - | |
| title | 子菜单项值 | ReactNode | - | |
| icon | 菜单图标 | ReactNode | - | 4.2.0 |
| onTitleClick | 点击子菜单标题 | function({ key, domEvent }) | - | |
### Menu.ItemGroup
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| -------- | ------------ | ------------------- | ------ | ---- |
| children | 分组的菜单项 | MenuItem\[] | - | |
| title | 分组标题 | string \| ReactNode | - | |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| -------- | ------------ | ----------- | ------ | ---- |
| children | 分组的菜单项 | MenuItem\[] | - | |
| title | 分组标题 | ReactNode | - | |
### Menu.Divider
......
......@@ -26,7 +26,7 @@ This components provides some static methods, with usage and arguments as follow
| Argument | Description | Type | Default |
| --- | --- | --- | --- |
| content | The content of the message | string \| ReactNode \| config | - |
| content | The content of the message | ReactNode \| config | - |
| duration | Time(seconds) before auto-dismiss, don't dismiss if set to 0 | number | 1.5 |
| onClose | Specify a function that will be called when the message is closed | function | - |
......
......@@ -25,11 +25,11 @@ cover: https://gw.alipayobjects.com/zos/alicdn/hAkKTIW0K/Message.svg
- `message.warn(content, [duration], onClose)` // alias of warning
- `message.loading(content, [duration], onClose)`
| 参数 | 说明 | 类型 | 默认值 |
| -------- | ------------------------------------------- | ----------------------------- | ------ |
| content | 提示内容 | string \| ReactNode \| config | - |
| duration | 自动关闭的延时,单位秒。设为 0 时不自动关闭 | number | 3 |
| onClose | 关闭时触发的回调函数 | function | - |
| 参数 | 说明 | 类型 | 默认值 |
| -------- | ------------------------------------------- | ------------------- | ------ |
| content | 提示内容 | ReactNode \| config | - |
| duration | 自动关闭的延时,单位秒。设为 0 时不自动关闭 | number | 3 |
| onClose | 关闭时触发的回调函数 | function | - |
组件同时提供 promise 接口。
......
......@@ -17,14 +17,14 @@ When requiring users to interact with the application, but without jumping to a
| --- | --- | --- | --- |
| afterClose | Specify a function that will be called when modal is closed completely | function | - |
| bodyStyle | Body style for modal body element. Such as height, padding etc | CSSProperties | {} |
| cancelText | Text of the Cancel button | string \| ReactNode | `Cancel` |
| cancelText | Text of the Cancel button | ReactNode | `Cancel` |
| cancelButtonProps | The cancel button props | [ButtonProps](/components/button/#API) | - |
| centered | Centered Modal | boolean | false |
| closable | Whether a close (x) button is visible on top right of the modal dialog or not | boolean | true |
| closeIcon | Custom close icon | ReactNode | &lt;CloseOutlined /> |
| confirmLoading | Whether to apply loading visual effect for OK button or not | boolean | false |
| destroyOnClose | Whether to unmount child components on onClose | boolean | false |
| footer | Footer content, set as `footer={null}` when you don't need default buttons | string \| ReactNode | (OK and Cancel buttons) |
| footer | Footer content, set as `footer={null}` when you don't need default buttons | ReactNode | (OK and Cancel buttons) |
| forceRender | Force render Modal | boolean | false |
| getContainer | Return the mount node for Modal | HTMLElement \| () => HTMLElement \| Selectors \| false | document.body |
| keyboard | Whether support press esc to close | boolean | true |
......@@ -33,12 +33,12 @@ When requiring users to interact with the application, but without jumping to a
| maskStyle | Style for modal's mask element | object | {} |
| modalRender | Custom modal content render | (node: ReactNode) => ReactNode | - | 4.7.0 |
| okButtonProps | The ok button props | [ButtonProps](/components/button/#API) | - |
| okText | Text of the OK button | string \| ReactNode | `OK` |
| okText | Text of the OK button | ReactNode | `OK` |
| okType | Button `type` of the OK button | string | `primary` |
| onCancel | Specify a function that will be called when a user clicks mask, close button on top right or Cancel button | function(e) | - |
| onOk | Specify a function that will be called when a user clicks the OK button | function(e) | - |
| style | Style of floating layer, typically used at least for adjusting the position | CSSProperties | - |
| title | The modal dialog's title | string \| ReactNode | - |
| title | The modal dialog's title | ReactNode | - |
| visible | Whether the modal dialog is visible or not | boolean | false |
| width | Width of the modal dialog | string \| number | 520 |
| wrapClassName | The class name of the container of the modal dialog | string | - |
......@@ -69,7 +69,7 @@ The items listed above are all functions, expecting a settings object as paramet
| cancelText | Text of the Cancel button with Modal.confirm | string | `Cancel` | |
| centered | Centered Modal | boolean | false | |
| className | The className of container | string | - | |
| content | Content | string \| ReactNode | - | |
| content | Content | ReactNode | - | |
| getContainer | Return the mount node for Modal | HTMLElement \| () => HTMLElement \| Selectors \| false | document.body | |
| icon | Custom icon | ReactNode | &lt;QuestionCircle /> | 3.12.0 |
| keyboard | Whether support press esc to close | boolean | true | |
......@@ -82,7 +82,7 @@ The items listed above are all functions, expecting a settings object as paramet
| onCancel | Specify a function that will be called when the user clicks the Cancel button. The parameter of this function is a function whose execution should include closing the dialog. You can also just return a promise and when the promise is resolved, the modal dialog will also be closed | function(close) | - | |
| onOk | Specify a function that will be called when the user clicks the OK button. The parameter of this function is a function whose execution should include closing the dialog. You can also just return a promise and when the promise is resolved, the modal dialog will also be closed | function(close) | - | |
| style | Style of floating layer, typically used at least for adjusting the position | CSSProperties | - | |
| title | Title | string \| ReactNode | - | |
| title | Title | ReactNode | - | |
| width | Width of the modal dialog | string \| number | 416 | |
| zIndex | The `z-index` of the Modal | number | 1000 | |
......
......@@ -21,13 +21,13 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3StSdUlSH/Modal.svg
| afterClose | Modal 完全关闭后的回调 | function | - |
| bodyStyle | Modal body 样式 | object | {} |
| cancelButtonProps | cancel 按钮 props | [ButtonProps](/components/button/#API) | - |
| cancelText | 取消按钮文字 | string \| ReactNode | `取消` |
| cancelText | 取消按钮文字 | ReactNode | `取消` |
| centered | 垂直居中展示 Modal | boolean | false |
| closable | 是否显示右上角的关闭按钮 | boolean | true |
| closeIcon | 自定义关闭图标 | ReactNode | &lt;CloseOutlined /> |
| confirmLoading | 确定按钮 loading | boolean | false |
| destroyOnClose | 关闭时销毁 Modal 里的子元素 | boolean | false |
| footer | 底部内容,当不需要默认底部按钮时,可以设为 `footer={null}` | string \| ReactNode | (确定取消按钮) |
| footer | 底部内容,当不需要默认底部按钮时,可以设为 `footer={null}` | ReactNode | (确定取消按钮) |
| forceRender | 强制渲染 Modal | boolean | false |
| getContainer | 指定 Modal 挂载的 HTML 节点, false 为挂载在当前 dom | HTMLElement \| () => HTMLElement \| Selectors \| false | document.body |
| keyboard | 是否支持键盘 esc 关闭 | boolean | true |
......@@ -36,12 +36,12 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3StSdUlSH/Modal.svg
| maskStyle | 遮罩样式 | object | {} |
| modalRender | 自定义渲染对话框 | (node: ReactNode) => ReactNode | - | 4.7.0 |
| okButtonProps | ok 按钮 props | [ButtonProps](/components/button/#API) | - |
| okText | 确认按钮文字 | string \| ReactNode | `确定` |
| okText | 确认按钮文字 | ReactNode | `确定` |
| okType | 确认按钮类型 | string | `primary` |
| onCancel | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | - |
| onOk | 点击确定回调 | function(e) | - |
| style | 可用于设置浮层的样式,调整浮层位置等 | CSSProperties | - |
| title | 标题 | string \| ReactNode | - |
| title | 标题 | ReactNode | - |
| visible | 对话框是否可见 | boolean | - |
| width | 宽度 | string \| number | 520 |
| wrapClassName | 对话框外层容器的类名 | string | - |
......@@ -72,7 +72,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3StSdUlSH/Modal.svg
| cancelText | 设置 Modal.confirm 取消按钮文字 | string | `取消` | |
| centered | 垂直居中展示 Modal | boolean | false | |
| className | 容器类名 | string | - | |
| content | 内容 | string \| ReactNode | - | |
| content | 内容 | ReactNode | - | |
| getContainer | 指定 Modal 挂载的 HTML 节点, false 为挂载在当前 dom | HTMLElement \| () => HTMLElement \| Selectors \| false | document.body | |
| icon | 自定义图标 | ReactNode | &lt;QuestionCircle /> | 3.12.0 |
| keyboard | 是否支持键盘 esc 关闭 | boolean | true | |
......@@ -85,7 +85,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3StSdUlSH/Modal.svg
| onCancel | 取消回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function(close) | - | |
| onOk | 点击确定回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function(close) | - | |
| style | 可用于设置浮层的样式,调整浮层位置等 | CSSProperties | - | |
| title | 标题 | string \| ReactNode | - | |
| title | 标题 | ReactNode | - | |
| width | 宽度 | string \| number | 416 | |
| zIndex | 设置 Modal 的 `z-index` | number | 1000 | |
......
......@@ -34,13 +34,13 @@ The properties of config are as follows:
| bottom | Distance from the bottom of the viewport, when `placement` is `bottomRight` or `bottomLeft` (unit: pixels) | number | 24 |
| btn | Customized close button | ReactNode | - |
| className | Customized CSS class | string | - |
| description | The content of notification box (required) | string \| ReactNode | - |
| description | The content of notification box (required) | ReactNode | - |
| duration | Time in seconds before Notification is closed. When set to 0 or null, it will never be closed automatically | number | 4.5 |
| getContainer | Return the mount node for Notification | () => HTMLNode | () => document.body |
| icon | Customized icon | ReactNode | - |
| closeIcon | Custom close icon | ReactNode | - |
| key | The unique identifier of the Notification | string | - |
| message | The title of notification box (required) | string \| ReactNode | - |
| message | The title of notification box (required) | ReactNode | - |
| onClose | Trigger when notification closed | function | - |
| onClick | Specify a function that will be called when the notification is clicked | function | - |
| placement | Position of Notification, can be one of `topLeft` `topRight` `bottomLeft` `bottomRight` | string | `topRight` |
......
......@@ -36,12 +36,12 @@ config 参数如下:
| bottom | 消息从底部弹出时,距离底部的位置,单位像素 | number | 24 |
| className | 自定义 CSS class | string | - |
| closeIcon | 自定义关闭图标 | ReactNode | - |
| description | 通知提醒内容,必选 | string \| ReactNode | - |
| description | 通知提醒内容,必选 | ReactNode | - |
| duration | 默认 4.5 秒后自动关闭,配置为 null 则不自动关闭 | number | 4.5 |
| getContainer | 配置渲染节点的输出位置 | () => HTMLNode | () => document.body |
| icon | 自定义图标 | ReactNode | - |
| key | 当前通知唯一标志 | string | - |
| message | 通知提醒标题,必选 | string \| ReactNode | - |
| message | 通知提醒标题,必选 | ReactNode | - |
| onClose | 当通知关闭时触发 | function | - |
| onClick | 点击通知时触发的回调函数 | function | - |
| placement | 弹出位置,可选 `topLeft` `topRight` `bottomLeft` `bottomRight` | string | `topRight` |
......
......@@ -22,7 +22,7 @@ The difference with the `confirm` modal dialog is that it's more lightweight tha
| okType | Button `type` of the Confirm button | string | `primary` |
| okButtonProps | The ok button props | [ButtonProps](/components/button/#API) | - |
| cancelButtonProps | The cancel button props | [ButtonProps](/components/button/#API) | - |
| title | The title of the confirmation box | string \| ReactNode \| () => ReactNode | - |
| title | The title of the confirmation box | ReactNode \| () => ReactNode | - |
| onCancel | A callback of cancel | function(e) | - |
| onConfirm | A callback of confirmation | function(e) | - |
| icon | Customize icon of confirmation | ReactNode | &lt;ExclamationCircle /> |
......
......@@ -23,7 +23,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/fjMCD9xRq/Popconfirm.svg
| okType | 确认按钮类型 | string | `primary` |
| okButtonProps | ok 按钮 props | [ButtonProps](/components/button/#API) | - |
| cancelButtonProps | cancel 按钮 props | [ButtonProps](/components/button/#API) | - |
| title | 确认框的描述 | string \| ReactNode \| () => ReactNode | - |
| title | 确认框的描述 | ReactNode \| () => ReactNode | - |
| onCancel | 点击取消的回调 | function(e) | - |
| onConfirm | 点击确认的回调 | function(e) | - |
| icon | 自定义弹出气泡 Icon 图标 | ReactNode | &lt;ExclamationCircle /> |
......
......@@ -15,10 +15,10 @@ Comparing with `Tooltip`, besides information `Popover` card can also provide ac
## API
| Param | Description | Type | Default value | Version |
| ------- | ------------------- | -------------------------------------- | ------------- | ------- |
| content | Content of the card | string \| ReactNode \| () => ReactNode | - | |
| title | Title of the card | string \| ReactNode \| () => ReactNode | - | |
| Param | Description | Type | Default value | Version |
| ------- | ------------------- | ---------------------------- | ------------- | ------- |
| content | Content of the card | ReactNode \| () => ReactNode | - | |
| title | Title of the card | ReactNode \| () => ReactNode | - | |
Consult [Tooltip's documentation](/components/tooltip/#API) to find more APIs.
......
......@@ -16,10 +16,10 @@ cover: https://gw.alipayobjects.com/zos/alicdn/1PNL1p_cO/Popover.svg
## API
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| ------- | -------- | -------------------------------------- | ------ | ---- |
| content | 卡片内容 | string \| ReactNode \| () => ReactNode | - | |
| title | 卡片标题 | string \| ReactNode \| () => ReactNode | - | |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| ------- | -------- | ---------------------------- | ------ | ---- |
| content | 卡片内容 | ReactNode \| () => ReactNode | - | |
| title | 卡片标题 | ReactNode \| () => ReactNode | - | |
更多属性请参考 [Tooltip](/components/tooltip/#API)
......
......@@ -1280,33 +1280,6 @@ Array [
>
a10
</span>
<span
aria-hidden="true"
class="ant-select-selection-item-remove"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
>
<span
aria-label="close"
class="anticon anticon-close"
role="img"
>
<svg
aria-hidden="true"
class=""
data-icon="close"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"
/>
</svg>
</span>
</span>
</span>
<span
class="ant-select-selection-item"
......@@ -1316,33 +1289,6 @@ Array [
>
c12
</span>
<span
aria-hidden="true"
class="ant-select-selection-item-remove"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
>
<span
aria-label="close"
class="anticon anticon-close"
role="img"
>
<svg
aria-hidden="true"
class=""
data-icon="close"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"
/>
</svg>
</span>
</span>
</span>
<span
class="ant-select-selection-search"
......
......@@ -64,7 +64,7 @@ Select component to select value from options.
| options | Select options. Will get better perf than jsx definition | { label, value }[] | - | |
| optionFilterProp | Which prop value of option will be used for filter if filterOption is true | string | `value` | |
| optionLabelProp | Which prop value of option will render as content of select. [Example](https://codesandbox.io/s/antd-reproduction-template-tk678) | string | `children` | |
| placeholder | Placeholder of select | string \| ReactNode | - | |
| placeholder | Placeholder of select | ReactNode | - | |
| removeIcon | The custom remove icon | ReactNode | - | |
| showArrow | Whether to show the drop-down arrow | boolean | true(for single select), false(for multiple select) | |
| showSearch | Whether show search input in single mode | boolean | false | |
......
......@@ -20,7 +20,7 @@ To input a value in a range.
| disabled | If true, the slider will not be interactable | boolean | false | |
| dots | Whether the thumb can drag over tick only | boolean | false | |
| included | Make effect when `marks` not null, true means containment and false means coordinative | boolean | true | |
| marks | Tick mark of Slider, type of key must be `number`, and must in closed interval \[min, max], each mark can declare its own style | object | { number: string \| ReactNode } \| { number: { style: object, label: string \| ReactNode } } | |
| marks | Tick mark of Slider, type of key must be `number`, and must in closed interval \[min, max], each mark can declare its own style | object | { number: ReactNode } \| { number: { style: object, label: ReactNode } } | |
| max | The maximum value the slider can slide to | number | 100 | |
| min | The minimum value the slider can slide to | number | 0 | |
| range | Dual thumb mode | boolean | false | |
......
......@@ -42,8 +42,6 @@ export interface SliderBaseProps {
className?: string;
id?: string;
style?: React.CSSProperties;
handleStyle?: React.CSSProperties;
trackStyle?: React.CSSProperties;
tooltipVisible?: boolean;
tooltipPlacement?: TooltipPlacement;
getTooltipPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
......@@ -56,6 +54,8 @@ export interface SliderSingleProps extends SliderBaseProps {
defaultValue?: number;
onChange?: (value: number) => void;
onAfterChange?: (value: number) => void;
handleStyle?: React.CSSProperties;
trackStyle?: React.CSSProperties;
}
export interface SliderRangeProps extends SliderBaseProps {
......@@ -64,6 +64,8 @@ export interface SliderRangeProps extends SliderBaseProps {
defaultValue?: [number, number];
onChange?: (value: [number, number]) => void;
onAfterChange?: (value: [number, number]) => void;
handleStyle?: React.CSSProperties[];
trackStyle?: React.CSSProperties[];
}
export type Visibles = { [index: number]: boolean };
......
......@@ -21,7 +21,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/HZ3meFc6W/Silder.svg
| disabled | 值为 true 时,滑块为禁用状态 | boolean | false | |
| dots | 是否只能拖拽到刻度上 | boolean | false | |
| included | `marks` 不为空对象时有效,值为 true 时表示值为包含关系,false 表示并列 | boolean | true | |
| marks | 刻度标记,key 的类型必须为 `number` 且取值在闭区间 \[min, max] 内,每个标签可以单独设置样式 | object | { number: string \| ReactNode } or { number: { style: object, label: string \| ReactNode } } | |
| marks | 刻度标记,key 的类型必须为 `number` 且取值在闭区间 \[min, max] 内,每个标签可以单独设置样式 | object | { number: ReactNode } or { number: { style: object, label: ReactNode } } | |
| max | 最大值 | number | 100 | |
| min | 最小值 | number | 0 | |
| range | 双滑块模式 | boolean | false | |
......
......@@ -22,20 +22,20 @@ Display statistic number.
| formatter | Customize value display logic | (value) => ReactNode | - | |
| groupSeparator | Group separator | string | `,` | |
| precision | The precision of input value | number | - | |
| prefix | The prefix node of value | string \| ReactNode | - | |
| suffix | The suffix node of value | string \| ReactNode | - | |
| title | Display title | string \| ReactNode | - | |
| prefix | The prefix node of value | ReactNode | - | |
| suffix | The suffix node of value | ReactNode | - | |
| title | Display title | ReactNode | - | |
| value | Display value | string \| number | - | |
| valueStyle | Set value css style | CSSProperties | - | |
#### Statistic.Countdown
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| format | Format as [moment](http://momentjs.com/) | string | `HH:mm:ss` | |
| onFinish | Trigger when time's up | () => void | - | |
| prefix | The prefix node of value | string \| ReactNode | - | |
| suffix | The suffix node of value | string \| ReactNode | - | |
| title | Display title | string \| ReactNode | - | |
| value | Set target countdown time | number \| moment | - | |
| valueStyle | Set value css style | CSSProperties | - | |
| Property | Description | Type | Default | Version |
| ---------- | ---------------------------------------- | ---------------- | ---------- | ------- |
| format | Format as [moment](http://momentjs.com/) | string | `HH:mm:ss` | |
| onFinish | Trigger when time's up | () => void | - | |
| prefix | The prefix node of value | ReactNode | - | |
| suffix | The suffix node of value | ReactNode | - | |
| title | Display title | ReactNode | - | |
| value | Set target countdown time | number \| moment | - | |
| valueStyle | Set value css style | CSSProperties | - | |
......@@ -23,9 +23,9 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/rcBNhLBrKbE/Statistic.svg
| formatter | 自定义数值展示 | (value) => ReactNode | - | |
| groupSeparator | 设置千分位标识符 | string | `,` | |
| precision | 数值精度 | number | - | |
| prefix | 设置数值的前缀 | string \| ReactNode | - | |
| suffix | 设置数值的后缀 | string \| ReactNode | - | |
| title | 数值的标题 | string \| ReactNode | - | |
| prefix | 设置数值的前缀 | ReactNode | - | |
| suffix | 设置数值的后缀 | ReactNode | - | |
| title | 数值的标题 | ReactNode | - | |
| value | 数值内容 | string \| number | - | |
| valueStyle | 设置数值的样式 | CSSProperties | - | |
......@@ -35,8 +35,8 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/rcBNhLBrKbE/Statistic.svg
| --- | --- | --- | --- | --- |
| format | 格式化倒计时展示,参考 [moment](http://momentjs.com/) | string | `HH:mm:ss` | |
| onFinish | 倒计时完成时触发 | () => void | - | |
| prefix | 设置数值的前缀 | string \| ReactNode | - | |
| suffix | 设置数值的后缀 | string \| ReactNode | - | |
| title | 数值的标题 | string \| ReactNode | - | |
| prefix | 设置数值的前缀 | ReactNode | - | |
| suffix | 设置数值的后缀 | ReactNode | - | |
| title | 数值的标题 | ReactNode | - | |
| value | 数值内容 | number \| moment | - | |
| valueStyle | 设置数值的样式 | CSSProperties | - | |
......@@ -46,9 +46,9 @@ A single step in the step bar.
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| description | Description of the step, optional property | string \| ReactNode | - | |
| icon | Icon of the step, optional property | string \| ReactNode | - | |
| description | Description of the step, optional property | ReactNode | - | |
| icon | Icon of the step, optional property | ReactNode | - | |
| status | To specify the status. It will be automatically set by `current` of `Steps` if not configured. Optional values are: `wait` `process` `finish` `error` | string | `wait` | |
| title | Title of the step | string \| ReactNode | - | |
| subTitle | Subtitle of the step | string \| ReactNode | - | |
| title | Title of the step | ReactNode | - | |
| subTitle | Subtitle of the step | ReactNode | - | |
| disabled | Disable click | boolean | false | |
......@@ -47,9 +47,9 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/UZYqMizXHaj/Steps.svg
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| description | 步骤的详情描述,可选 | string \| ReactNode | - | |
| description | 步骤的详情描述,可选 | ReactNode | - | |
| icon | 步骤图标的类型,可选 | ReactNode | - | |
| status | 指定状态。当不配置该属性时,会使用 Steps 的 `current` 来自动指定状态。可选:`wait` `process` `finish` `error` | string | `wait` | |
| title | 标题 | string \| ReactNode | - | |
| subTitle | 子标题 | string \| ReactNode | - | |
| title | 标题 | ReactNode | - | |
| subTitle | 子标题 | ReactNode | - | |
| disabled | 禁用点击 | boolean | false | |
......@@ -18,12 +18,12 @@ Switching Selector.
| --- | --- | --- | --- |
| autoFocus | Whether get focus when component mounted | boolean | false |
| checked | Determine whether the Switch is checked | boolean | false |
| checkedChildren | The content to be shown when the state is checked | string \| ReactNode | - |
| checkedChildren | The content to be shown when the state is checked | ReactNode | - |
| defaultChecked | Whether to set the initial state | boolean | false |
| disabled | Disable switch | boolean | false |
| loading | Loading state of switch | boolean | false |
| size | The size of the Switch, options: `default` `small` | string | `default` |
| unCheckedChildren | The content to be shown when the state is unchecked | string \| ReactNode | - |
| unCheckedChildren | The content to be shown when the state is unchecked | ReactNode | - |
| onChange | Trigger when the checked state is changing | function(checked: boolean, event: Event) | - |
| onClick | Trigger when clicked | function(checked: boolean, event: Event) | - |
| className | The additional class to Switch | string | - |
......
......@@ -19,12 +19,12 @@ cover: https://gw.alipayobjects.com/zos/alicdn/zNdJQMhfm/Switch.svg
| --- | --- | --- | --- |
| autoFocus | 组件自动获取焦点 | boolean | false |
| checked | 指定当前是否选中 | boolean | false |
| checkedChildren | 选中时的内容 | string \| ReactNode | - |
| checkedChildren | 选中时的内容 | ReactNode | - |
| defaultChecked | 初始是否选中 | boolean | false |
| disabled | 是否禁用 | boolean | false |
| loading | 加载中的开关 | boolean | false |
| size | 开关大小,可选值:`default` `small` | string | `default` |
| unCheckedChildren | 非选中时的内容 | string \| ReactNode | - |
| unCheckedChildren | 非选中时的内容 | ReactNode | - |
| onChange | 变化时回调函数 | function(checked: boolean, event: Event) | - |
| onClick | 点击时回调函数 | function(checked: boolean, event: Event) | - |
| className | Switch 器类名 | string | - |
......
......@@ -69,6 +69,19 @@ describe('Table.filter', () => {
expect(wrapper.find('.ant-table-filter-column')).toHaveLength(0);
});
// https://github.com/ant-design/ant-design/issues/26988
it('not show filter icon when filter and filterDropdown is undefined', () => {
const noFilterColumn = { ...column, filters: undefined, filterDropdown: undefined };
delete noFilterColumn.onFilter;
const wrapper = mount(
createTable({
columns: [noFilterColumn],
}),
);
expect(wrapper.find('.ant-table-filter-column')).toHaveLength(0);
});
it('renders filter correctly', () => {
const wrapper = mount(createTable());
......
......@@ -70,7 +70,7 @@ function injectFilter<RecordType>(
const columnPos = getColumnPos(index, pos);
const { filterMultiple = true } = column as ColumnType<RecordType>;
if (column.filters || 'filterDropdown' in column) {
if (column.filters || column.filterDropdown) {
const columnKey = getColumnKey(column, columnPos);
const filterState = filterStates.find(({ key }) => columnKey === key);
......
......@@ -147,9 +147,9 @@ One of the Table `columns` prop for describing the table's columns, Column has t
### ColumnGroup
| Property | Description | Type | Default |
| -------- | ------------------------- | ------------------- | ------- |
| title | Title of the column group | string \| ReactNode | - |
| Property | Description | Type | Default |
| -------- | ------------------------- | --------- | ------- |
| title | Title of the column group | ReactNode | - |
### pagination
......@@ -189,7 +189,7 @@ Properties for row selection.
| --- | --- | --- | --- | --- |
| checkStrictly | Check table row precisely; parent row and children rows are not associated | boolean | true | 4.4.0 |
| columnWidth | Set the width of the selection column | string \| number | `60px` | |
| columnTitle | Set the title of the selection column | string \| ReactNode | - | |
| columnTitle | Set the title of the selection column | ReactNode | - | |
| fixed | Fixed selection column on the left | boolean | - | |
| getCheckboxProps | Get Checkbox or Radio props | function(record) | - | |
| hideSelectAll | Hide the selectAll checkbox and custom selection | boolean | false | 4.3.0 |
......@@ -216,7 +216,7 @@ Properties for row selection.
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| key | Unique key of this selection | string | - |
| text | Display text of this selection | string \| ReactNode | - |
| text | Display text of this selection | ReactNode | - |
| onSelect | Callback executed when this selection is clicked | function(changeableRowKeys) | - |
## Using in TypeScript
......
......@@ -154,9 +154,9 @@ const columns = [
### ColumnGroup
| 参数 | 说明 | 类型 | 默认值 |
| ----- | ------------ | ------------------- | ------ |
| title | 列头显示文字 | string \| ReactNode | - |
| 参数 | 说明 | 类型 | 默认值 |
| ----- | ------------ | --------- | ------ |
| title | 列头显示文字 | ReactNode | - |
### pagination
......@@ -196,7 +196,7 @@ const columns = [
| --- | --- | --- | --- | --- |
| checkStrictly | checkable 状态下节点选择完全受控(父子数据选中状态不再关联) | boolean | true | 4.4.0 |
| columnWidth | 自定义列表选择框宽度 | string \| number | `60px` | |
| columnTitle | 自定义列表选择框标题 | string \| ReactNode | - | |
| columnTitle | 自定义列表选择框标题 | ReactNode | - | |
| fixed | 把选择框列固定在左边 | boolean | - | |
| getCheckboxProps | 选择框的默认属性配置 | function(record) | - | |
| hideSelectAll | 隐藏全选勾选框与自定义选择项 | boolean | false | 4.3.0 |
......@@ -223,7 +223,7 @@ const columns = [
| 参数 | 说明 | 类型 | 默认值 |
| -------- | -------------------------- | --------------------------- | ------ |
| key | React 需要的 key,建议设置 | string | - |
| text | 选择项显示的文字 | string \| ReactNode | - |
| text | 选择项显示的文字 | ReactNode | - |
| onSelect | 选择项点击回调 | function(changeableRowKeys) | - |
## 在 TypeScript 中使用
......
......@@ -49,7 +49,7 @@ More option at [rc-tabs option](https://github.com/react-component/tabs#tabs)
| --- | --- | --- | --- |
| forceRender | Forced render of content in tabs, not lazy render after clicking on tabs | boolean | false |
| key | TabPane's key | string | - |
| tab | Show text in TabPane's head | string \| ReactNode | - |
| tab | Show text in TabPane's head | ReactNode | - |
| closeIcon | Customize close icon in TabPane's head. Only works while `type="editable-card"` | ReactNode | - |
More option at [rc-tabs option](https://github.com/react-component/tabs#tabpane)
......@@ -46,9 +46,9 @@ Ant Design 依次提供了三级选项卡,分别用于不同的场景。
### Tabs.TabPane
| 参数 | 说明 | 类型 | 默认值 |
| ----------- | ----------------------------------------------- | ------------------- | ------ |
| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false |
| key | 对应 activeKey | string | - |
| tab | 选项卡头显示文字 | string \| ReactNode | - |
| closeIcon | 自定义关闭图标,`在 type="editable-card"`时有效 | ReactNode | - |
| 参数 | 说明 | 类型 | 默认值 |
| ----------- | ----------------------------------------------- | --------- | ------ |
| forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false |
| key | 对应 activeKey | string | - |
| tab | 选项卡头显示文字 | ReactNode | - |
| closeIcon | 自定义关闭图标,`在 type="editable-card"`时有效 | ReactNode | - |
......@@ -2,7 +2,7 @@ import * as React from 'react';
import classNames from 'classnames';
import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
import TimelineItem, { TimeLineItemProps } from './TimelineItem';
import TimelineItem, { TimelineItemProps } from './TimelineItem';
import { ConfigContext } from '../config-provider';
import { cloneElement } from '../_util/reactNode';
......@@ -18,7 +18,7 @@ export interface TimelineProps {
}
interface TimelineType extends React.FC<TimelineProps> {
Item: React.FC<TimeLineItemProps>;
Item: React.FC<TimelineItemProps>;
}
const Timeline: TimelineType = props => {
......
......@@ -3,7 +3,7 @@ import classNames from 'classnames';
import omit from 'omit.js';
import { ConfigContext } from '../config-provider';
export interface TimeLineItemProps {
export interface TimelineItemProps {
prefixCls?: string;
className?: string;
color?: string;
......@@ -14,7 +14,13 @@ export interface TimeLineItemProps {
label?: React.ReactNode;
}
const TimelineItem: React.FC<TimeLineItemProps> = props => {
// for compatibililty
// https://github.com/ant-design/ant-design/pull/26832
export interface TimeLineItemProps extends TimelineItemProps {
__deprecated_do_not_use_it__?: any; // eslint-disable-line camelcase
}
const TimelineItem: React.FC<TimelineItemProps> = props => {
const { getPrefixCls } = React.useContext(ConfigContext);
const {
prefixCls: customizePrefixCls,
......
......@@ -29,8 +29,8 @@ Timeline
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| pending | Set the last ghost node's existence or its content | boolean \| string \| ReactNode | false |
| pendingDot | Set the dot of the last ghost node when pending is true | string \| ReactNode | &lt;LoadingOutlined /> |
| pending | Set the last ghost node's existence or its content | boolean \| ReactNode | false |
| pendingDot | Set the dot of the last ghost node when pending is true | ReactNode | &lt;LoadingOutlined /> |
| reverse | Whether reverse nodes or not | boolean | false |
| mode | By sending `alternate` the timeline will distribute the nodes to the left and right | `left` \| `alternate` \| `right` | - |
......@@ -41,6 +41,6 @@ Node of timeline
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| color | Set the circle's color to `blue`, `red`, `green`, `gray` or other custom colors | string | `blue` |
| dot | Customize timeline dot | string \| ReactNode | - |
| dot | Customize timeline dot | ReactNode | - |
| position | Customize node position | `left` \| `right` | - |
| label | Set the label | ReactNode | - |
import Timeline from './Timeline';
export { TimelineProps } from './Timeline';
export { TimeLineItemProps } from './TimelineItem';
export { TimelineItemProps } from './TimelineItem';
export default Timeline;
......@@ -30,8 +30,8 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/vJmo00mmgR/Timeline.svg
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| pending | 指定最后一个幽灵节点是否存在或内容 | boolean \| string \| ReactNode | false |
| pendingDot | 当最后一个幽灵节点存在時,指定其时间图点 | string \| ReactNode | &lt;LoadingOutlined /> |
| pending | 指定最后一个幽灵节点是否存在或内容 | boolean \| ReactNode | false |
| pendingDot | 当最后一个幽灵节点存在時,指定其时间图点 | ReactNode | &lt;LoadingOutlined /> |
| reverse | 节点排序 | boolean | false |
| mode | 通过设置 `mode` 可以改变时间轴和内容的相对位置 | `left` \| `alternate` \| `right` | - |
......@@ -42,6 +42,6 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/vJmo00mmgR/Timeline.svg
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| color | 指定圆圈颜色 `blue`, `red`, `green`, `gray`,或自定义的色值 | string | `blue` |
| dot | 自定义时间轴点 | string \| ReactNode | - |
| dot | 自定义时间轴点 | ReactNode | - |
| position | 自定义节点位置 | `left` \| `right` | - |
| label | 设置标签 | ReactNode | - |
......@@ -14,9 +14,9 @@ A simple text popup tip.
## API
| Property | Description | Type | Default |
| -------- | ----------------------------- | -------------------------------------- | ------- |
| title | The text shown in the tooltip | string \| ReactNode \| () => ReactNode | - |
| Property | Description | Type | Default |
| -------- | ----------------------------- | ---------------------------- | ------- |
| title | The text shown in the tooltip | ReactNode \| () => ReactNode | - |
### Common API
......
......@@ -16,9 +16,9 @@ cover: https://gw.alipayobjects.com/zos/alicdn/Vyyeu8jq2/Tooltp.svg
## API
| 参数 | 说明 | 类型 | 默认值 |
| ----- | -------- | -------------------------------------- | ------ |
| title | 提示文字 | string \| ReactNode \| () => ReactNode | - |
| 参数 | 说明 | 类型 | 默认值 |
| ----- | -------- | ---------------------------- | ------ |
| title | 提示文字 | ReactNode \| () => ReactNode | - |
### 共同的 API
......
......@@ -78,7 +78,7 @@ Tree selection control.
| disabled | Disabled or not | boolean | false | |
| isLeaf | Leaf node or not | boolean | false | |
| key | Required property (unless using `treeDataSimpleMode`), should be unique in the tree | string | - | |
| title | Content showed on the treeNodes | string \| ReactNode | `---` | |
| title | Content showed on the treeNodes | ReactNode | `---` | |
| value | Will be treated as `treeNodeFilterProp` by default, should be unique in the tree | string | - | |
## FAQ
......
......@@ -71,16 +71,16 @@ cover: https://gw.alipayobjects.com/zos/alicdn/Ax4DA0njr/TreeSelect.svg
> 建议使用 treeData 来代替 TreeNode,免去手工构造麻烦
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| selectable | 是否可选 | boolean | true | |
| checkable | 当树为 Checkbox 时,设置独立节点是否展示 Checkbox | boolean | - | |
| disableCheckbox | 禁掉 Checkbox | boolean | false | |
| disabled | 是否禁用 | boolean | false | |
| isLeaf | 是否是叶子节点 | boolean | false | |
| key | 此项必须设置(其值在整个树范围内唯一) | string | - | |
| title | 树节点显示的内容 | string \| ReactNode | `---` | |
| value | 默认根据此属性值进行筛选(其值在整个树范围内唯一) | string | - | |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --------------- | -------------------------------------------------- | --------- | ------ | ---- |
| selectable | 是否可选 | boolean | true | |
| checkable | 当树为 Checkbox 时,设置独立节点是否展示 Checkbox | boolean | - | |
| disableCheckbox | 禁掉 Checkbox | boolean | false | |
| disabled | 是否禁用 | boolean | false | |
| isLeaf | 是否是叶子节点 | boolean | false | |
| key | 此项必须设置(其值在整个树范围内唯一) | string | - | |
| title | 树节点显示的内容 | ReactNode | `---` | |
| value | 默认根据此属性值进行筛选(其值在整个树范围内唯一) | string | - | |
## FAQ
......
......@@ -49,5 +49,11 @@
}
}
}
&-loading-icon {
.@{tree-select-prefix-cls}-dropdown-rtl & {
transform: scaleY(-1);
}
}
}
}
......@@ -67,7 +67,7 @@ Almost anything can be represented in a tree structure. Examples include directo
| isLeaf | Determines if this is a leaf node(effective when `loadData` is specified). `false` will force trade TreeNode as a parent node | boolean | - | |
| key | Used with (default)ExpandedKeys / (default)CheckedKeys / (default)SelectedKeys. P.S.: It must be unique in all of treeNodes of the tree | string | (internal calculated position of treeNode) | |
| selectable | Set whether the treeNode can be selected | boolean | true | |
| title | Title | string \| ReactNode | `---` | |
| title | Title | ReactNode | `---` | |
### DirectoryTree props
......
......@@ -68,7 +68,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/Xh-oWqg9k/Tree.svg
| isLeaf | 设置为叶子节点(设置了`loadData`时有效)。为 `false` 时会强制将其作为父节点 | boolean | - |
| key | 被树的 (default)ExpandedKeys / (default)CheckedKeys / (default)SelectedKeys 属性所用。注意:整个树范围内的所有节点的 key 值不能重复! | string | (内部计算出的节点位置) |
| selectable | 设置节点是否可被选中 | boolean | true |
| title | 标题 | string \| ReactNode | `---` |
| title | 标题 | ReactNode | `---` |
### DirectoryTree props
......
......@@ -29,6 +29,12 @@
}
}
}
&-loading-icon {
.@{tree-prefix-cls}-rtl& {
transform: scaleY(-1);
}
}
}
// ==================== Show Line =====================
&-show-line {
......
......@@ -129,7 +129,7 @@ Recommend to start from the reading flow, collapsed content should always be on
<img class="preview-img no-padding good" align="right" src="https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*tK-AQaE5h1YAAAAAAAAAAABkARQnAQ" alt="Do">
<img class="preview-img no-padding bad" align="right" src="https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*_gU7ToHiZz4AAAAAAAAAAABkARQnAQ" alt="Don't" description="When button group has no space in betwee, it is easy to confuse it with Toggle Button.">
<img class="preview-img no-padding bad" align="right" src="https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*_gU7ToHiZz4AAAAAAAAAAABkARQnAQ" alt="Don't" description="When button group has no space in between, it is easy to confuse it with Toggle Button.">
When multiple buttons form a group, align buttons in one line with spaces in between.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册