From 674ee73a2f64822d4396d8a0a8fbfe9335150564 Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Thu, 2 Jul 2020 14:55:12 +0800 Subject: [PATCH] docs: format api alert/drawer/modal (#25387) --- components/alert/index.en-US.md | 16 ++++++------- components/alert/index.zh-CN.md | 12 +++++----- components/drawer/index.en-US.md | 36 ++++++++++++++-------------- components/drawer/index.zh-CN.md | 4 ++-- components/modal/index.en-US.md | 40 ++++++++++++++++---------------- components/modal/index.zh-CN.md | 32 ++++++++++++------------- 6 files changed, 70 insertions(+), 70 deletions(-) diff --git a/components/alert/index.en-US.md b/components/alert/index.en-US.md index 261e0e9f33..aa96e9c895 100644 --- a/components/alert/index.en-US.md +++ b/components/alert/index.en-US.md @@ -19,17 +19,17 @@ 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 | - | -| icon | Custom icon, effective when `showIcon` is `true` | ReactNode | - | -| message | Content of Alert | string\|ReactNode | - | +| closeText | Close text to show | string \| ReactNode | - | +| description | Additional content of Alert | string \| ReactNode | - | +| icon | Custom icon, effective when `showIcon` is true | ReactNode | - | +| message | Content of Alert | string \| 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 | - | ### Alert.ErrorBoundary -| Property | Description | Type | Default | Version | -| ----------- | -------------------------------- | --------- | ------------------- | ------- | -| message | custom error message to show | ReactNode | `{{ error }}` | | -| description | custom error description to show | ReactNode | `{{ error stack }}` | | +| Property | Description | Type | Default | Version | +| ----------- | -------------------------------- | --------- | ----------------- | ------- | +| message | Custom error message to show | ReactNode | {{ error }} | | +| description | Custom error description to show | ReactNode | {{ error stack }} | | diff --git a/components/alert/index.zh-CN.md b/components/alert/index.zh-CN.md index a6506aa6ff..85694c19a0 100644 --- a/components/alert/index.zh-CN.md +++ b/components/alert/index.zh-CN.md @@ -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 | - | -| icon | 自定义图标,`showIcon` 为 `true` 时有效 | ReactNode | - | -| message | 警告提示内容 | string\|ReactNode | - | +| closeText | 自定义关闭按钮 | string \| ReactNode | - | +| description | 警告提示的辅助性文字介绍 | string \| ReactNode | - | +| icon | 自定义图标,`showIcon` 为 true 时有效 | ReactNode | - | +| message | 警告提示内容 | string \| ReactNode | - | | showIcon | 是否显示辅助图标 | boolean | false,`banner` 模式下默认值为 true | | type | 指定警告提示的样式,有四种选择 `success`、`info`、`warning`、`error` | string | `info`,`banner` 模式下默认值为 `warning` | | onClose | 关闭时触发的回调函数 | (e: MouseEvent) => void | - | @@ -32,5 +32,5 @@ cover: https://gw.alipayobjects.com/zos/alicdn/8emPa3fjl/Alert.svg | 参数 | 说明 | 类型 | 默认值 | 版本 | | --- | --- | --- | --- | --- | -| message | 自定义错误标题,如果未指定会展示原生报错信息 | ReactNode | `{{ error }}` | | -| description | 自定义错误内容,如果未指定会展示报错堆栈 | ReactNode | `{{ error stack }}` | | +| message | 自定义错误标题,如果未指定会展示原生报错信息 | ReactNode | {{ error }} | | +| description | 自定义错误内容,如果未指定会展示报错堆栈 | ReactNode | {{ error stack }} | | diff --git a/components/drawer/index.en-US.md b/components/drawer/index.en-US.md index 25e6da6157..f2cc4e0970 100644 --- a/components/drawer/index.en-US.md +++ b/components/drawer/index.en-US.md @@ -20,27 +20,27 @@ A Drawer is a panel that is typically overlaid on top of a page and slides in fr | Props | Description | Type | Default | | --- | --- | --- | --- | -| closable | Whether a close (x) button is visible on top right of the Drawer dialog or not. | boolean | true | -| closeIcon | custom close icon | ReactNode | `` | -| destroyOnClose | Whether to unmount child components on closing drawer or not. | boolean | false | +| closable | Whether a close (x) button is visible on top right of the Drawer dialog or not | boolean | true | +| closeIcon | Custom close icon | ReactNode | <CloseOutlined /> | +| destroyOnClose | Whether to unmount child components on closing drawer or not | boolean | false | | forceRender | Prerender Drawer component forcely | boolean | false | -| getContainer | Return the mounted node for Drawer. | HTMLElement \| `() => HTMLElement` \| Selectors \| false | 'body' | -| mask | Whether to show mask or not. | boolean | true | -| maskClosable | Clicking on the mask (area outside the Drawer) to close the Drawer or not. | boolean | true | -| maskStyle | Style for Drawer's mask element. | CSSProperties | {} | +| getContainer | Return the mounted node for Drawer | HTMLElement \| () => HTMLElement \| Selectors \| false | body | +| mask | Whether to show mask or not | boolean | true | +| maskClosable | Clicking on the mask (area outside the Drawer) to close the Drawer or not | boolean | true | +| maskStyle | Style for Drawer's mask element | CSSProperties | {} | | style | Style of wrapper element which **contains mask** compare to `drawerStyle` | CSSProperties | - | | 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 | - | -| 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 | -| className | The class name of the container of the Drawer dialog. | string | - | -| zIndex | The `z-index` of the Drawer. | Number | 1000 | -| placement | The placement of the Drawer. | `top` \| `right` \| `bottom` \| `left` | `right` | -| onClose | Specify a callback that will be called when a user clicks mask, close button or Cancel button. | function(e) | - | -| afterVisibleChange | Callback after the animation ends when switching drawers. | function(visible) | - | +| title | The title for Drawer | string \| 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 | +| className | The class name of the container of the Drawer dialog | string | - | +| zIndex | The `z-index` of the Drawer | number | 1000 | +| placement | The placement of the Drawer | `top` \| `right` \| `bottom` \| `left` | `right` | +| onClose | Specify a callback that will be called when a user clicks mask, close button or Cancel button | function(e) | - | +| afterVisibleChange | Callback after the animation ends when switching drawers | function(visible) | - | | keyboard | Whether support press esc to close | boolean | true | -| footer | The footer for Drawer. | ReactNode | - | -| footerStyle | Style of the drawer footer part. | CSSProperties | - | +| footer | The footer for Drawer | ReactNode | - | +| footerStyle | Style of the drawer footer part | CSSProperties | - | diff --git a/components/drawer/index.zh-CN.md b/components/drawer/index.zh-CN.md index a81f476c82..7402599a6c 100644 --- a/components/drawer/index.zh-CN.md +++ b/components/drawer/index.zh-CN.md @@ -20,10 +20,10 @@ cover: https://gw.alipayobjects.com/zos/alicdn/7z8NJQhFb/Drawer.svg | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | closable | 是否显示右上角的关闭按钮 | boolean | true | -| closeIcon | 自定义关闭图标 | ReactNode | `` | +| closeIcon | 自定义关闭图标 | ReactNode | <CloseOutlined /> | | destroyOnClose | 关闭时销毁 Drawer 里的子元素 | boolean | false | | forceRender | 预渲染 Drawer 内元素 | boolean | false | -| getContainer | 指定 Drawer 挂载的 HTML 节点, false 为挂载在当前 dom | HTMLElement \| `() => HTMLElement` \| Selectors \| false | 'body' | +| getContainer | 指定 Drawer 挂载的 HTML 节点, false 为挂载在当前 dom | HTMLElement \| () => HTMLElement \| Selectors \| false | body | | maskClosable | 点击蒙层是否允许关闭 | boolean | true | | mask | 是否展示遮罩 | boolean | true | | maskStyle | 遮罩样式 | CSSProperties | {} | diff --git a/components/modal/index.en-US.md b/components/modal/index.en-US.md index 26aeffe360..1a58a4c474 100644 --- a/components/modal/index.en-US.md +++ b/components/modal/index.en-US.md @@ -15,30 +15,30 @@ When requiring users to interact with the application, but without jumping to a | Property | Description | Type | Default | | --- | --- | --- | --- | -| 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` | +| 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` | | 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 | `` | +| closeIcon | Custom close icon | ReactNode | <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 | string \| ReactNode | (OK and Cancel buttons) | | forceRender | Force render Modal | boolean | false | -| getContainer | Return the mount node for Modal | HTMLElement \| `() => HTMLElement` \| Selectors \| false | document.body | -| mask | Whether show mask or not. | boolean | true | +| getContainer | Return the mount node for Modal | HTMLElement \| () => HTMLElement \| Selectors \| false | document.body | +| mask | Whether show mask or not | boolean | true | | maskClosable | Whether to close the modal dialog when the mask (area outside the modal) is clicked | boolean | true | -| maskStyle | Style for modal's mask element. | object | {} | -| okText | Text of the OK button | string\|ReactNode | `OK` | +| maskStyle | Style for modal's mask element | object | {} | +| okText | Text of the OK button | string \| ReactNode | `OK` | | okType | Button `type` of the OK button | string | `primary` | | okButtonProps | The ok button props | [ButtonProps](/components/button/#API) | - | | cancelButtonProps | The cancel button props | [ButtonProps](/components/button/#API) | - | -| style | Style of floating layer, typically used at least for adjusting the position. | CSSProperties | - | -| title | The modal dialog's title | string\|ReactNode | - | +| style | Style of floating layer, typically used at least for adjusting the position | CSSProperties | - | +| title | The modal dialog's title | string \| ReactNode | - | | visible | Whether the modal dialog is visible or not | boolean | false | -| width | Width of the modal dialog | string\|number | 520 | +| width | Width of the modal dialog | string \| number | 520 | | wrapClassName | The class name of the container of the modal dialog | string | - | -| zIndex | The `z-index` of the Modal | Number | 1000 | +| zIndex | The `z-index` of the Modal | number | 1000 | | 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) | - | @@ -62,12 +62,12 @@ The items listed above are all functions, expecting a settings object as paramet | Property | Description | Type | Default | Version | | --- | --- | --- | --- | --- | -| autoFocusButton | Specify which button to autofocus | null\| `ok` \| `cancel` | `ok` | | +| autoFocusButton | Specify which button to autofocus | null \| `ok` \| `cancel` | `ok` | | | cancelText | Text of the Cancel button with Modal.confirm | string | `Cancel` | | | centered | Centered Modal | boolean | false | | -| className | className of container | string | - | | -| content | Content | string\|ReactNode | - | | -| icon | custom icon | ReactNode | [](/components/icon/) | 3.12.0 | +| className | The className of container | string | - | | +| content | Content | string \| ReactNode | - | | +| icon | Custom icon | ReactNode | <QuestionCircle /> | 3.12.0 | | keyboard | Whether support press esc to close | boolean | true | | | mask | Whether show mask or not. | boolean | true | | | maskClosable | Whether to close the modal dialog when the mask (area outside the modal) is clicked | boolean | false | | @@ -75,9 +75,9 @@ The items listed above are all functions, expecting a settings object as paramet | okType | Button `type` of the OK button | string | `primary` | | | okButtonProps | The ok button props | [ButtonProps](/components/button/#API) | - | | | cancelButtonProps | The cancel button props | [ButtonProps](/components/button/#API) | - | | -| title | Title | string\|ReactNode | - | | -| width | Width of the modal dialog | string\|number | 416 | | -| zIndex | The `z-index` of the Modal | Number | 1000 | | +| title | Title | string \| ReactNode | - | | +| width | Width of the modal dialog | string \| number | 416 | | +| zIndex | The `z-index` of the Modal | number | 1000 | | | 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) | - | | diff --git a/components/modal/index.zh-CN.md b/components/modal/index.zh-CN.md index a636b226c8..11764946e2 100644 --- a/components/modal/index.zh-CN.md +++ b/components/modal/index.zh-CN.md @@ -20,29 +20,29 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3StSdUlSH/Modal.svg | --- | --- | --- | --- | | afterClose | Modal 完全关闭后的回调 | function | - | | bodyStyle | Modal body 样式 | object | {} | -| cancelText | 取消按钮文字 | string\|ReactNode | 取消 | +| cancelText | 取消按钮文字 | string \| ReactNode | `取消` | | centered | 垂直居中展示 Modal | boolean | false | | closable | 是否显示右上角的关闭按钮 | boolean | true | -| closeIcon | 自定义关闭图标 | ReactNode | `` | +| closeIcon | 自定义关闭图标 | ReactNode | <CloseOutlined /> | | confirmLoading | 确定按钮 loading | boolean | false | | destroyOnClose | 关闭时销毁 Modal 里的子元素 | boolean | false | -| footer | 底部内容,当不需要默认底部按钮时,可以设为 `footer={null}` | string\|ReactNode | 确定取消按钮 | +| footer | 底部内容,当不需要默认底部按钮时,可以设为 `footer={null}` | string \| ReactNode | (确定取消按钮) | | forceRender | 强制渲染 Modal | boolean | false | -| getContainer | 指定 Modal 挂载的 HTML 节点, false 为挂载在当前 dom | HTMLElement \| `() => HTMLElement` \| Selectors \| false | document.body | +| getContainer | 指定 Modal 挂载的 HTML 节点, false 为挂载在当前 dom | HTMLElement \| () => HTMLElement \| Selectors \| false | document.body | | keyboard | 是否支持键盘 esc 关闭 | boolean | true | | mask | 是否展示遮罩 | boolean | true | | maskClosable | 点击蒙层是否允许关闭 | boolean | true | | maskStyle | 遮罩样式 | object | {} | -| okText | 确认按钮文字 | string\|ReactNode | 确定 | +| okText | 确认按钮文字 | string \| ReactNode | `确定` | | okType | 确认按钮类型 | string | `primary` | | okButtonProps | ok 按钮 props | [ButtonProps](/components/button/#API) | - | | cancelButtonProps | cancel 按钮 props | [ButtonProps](/components/button/#API) | - | | style | 可用于设置浮层的样式,调整浮层位置等 | CSSProperties | - | -| title | 标题 | string\|ReactNode | - | +| title | 标题 | string \| ReactNode | - | | visible | 对话框是否可见 | boolean | - | -| width | 宽度 | string\|number | 520 | +| width | 宽度 | string \| number | 520 | | wrapClassName | 对话框外层容器的类名 | string | - | -| zIndex | 设置 Modal 的 `z-index` | Number | 1000 | +| zIndex | 设置 Modal 的 `z-index` | number | 1000 | | onCancel | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | - | | onOk | 点击确定回调 | function(e) | - | @@ -66,20 +66,20 @@ cover: https://gw.alipayobjects.com/zos/alicdn/3StSdUlSH/Modal.svg | 参数 | 说明 | 类型 | 默认值 | 版本 | | --- | --- | --- | --- | --- | -| autoFocusButton | 指定自动获得焦点的按钮 | null\| `ok` \| `cancel` | `ok` | | -| cancelText | 设置 Modal.confirm 取消按钮文字 | string | 取消 | | +| autoFocusButton | 指定自动获得焦点的按钮 | null \| `ok` \| `cancel` | `ok` | | +| cancelText | 设置 Modal.confirm 取消按钮文字 | string | `取消` | | | centered | 垂直居中展示 Modal | boolean | false | | | className | 容器类名 | string | - | | -| content | 内容 | string\|ReactNode | - | | -| icon | 自定义图标 | ReactNode | [](/components/icon/) | 3.12.0 | +| content | 内容 | string \| ReactNode | - | | +| icon | 自定义图标 | ReactNode | <QuestionCircle /> | 3.12.0 | | maskClosable | 点击蒙层是否允许关闭 | boolean | false | | -| okText | 确认按钮文字 | string | 确定 | | +| okText | 确认按钮文字 | string | `确定` | | | okType | 确认按钮类型 | string | `primary` | | | okButtonProps | ok 按钮 props | [ButtonProps](/components/button/#API) | - | | | cancelButtonProps | cancel 按钮 props | [ButtonProps](/components/button/#API) | - | | -| title | 标题 | string\|ReactNode | - | | -| width | 宽度 | string\|number | 416 | | -| zIndex | 设置 Modal 的 `z-index` | Number | 1000 | | +| title | 标题 | string \| ReactNode | - | | +| width | 宽度 | string \| number | 416 | | +| zIndex | 设置 Modal 的 `z-index` | number | 1000 | | | onCancel | 取消回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function(close) | - | | | onOk | 点击确定回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function(close) | - | |