Browse Source

docs: improve methods desciption

pointhalo 2 years ago
parent
commit
c9aafbeed4

+ 3 - 2
content/input/checkbox/index-en-US.md

@@ -425,9 +425,10 @@ import { CheckboxGroup, Checkbox, Row, Col } from '@douyinfe/semi-ui';
 | value        | Specify selected options                                                | any\[]              | \[]        |
 | value        | Specify selected options                                                | any\[]              | \[]        |
 | onChange     | Callback function when selected options change                          | function(checkedValue) | -          |
 | onChange     | Callback function when selected options change                          | function(checkedValue) | -          |
 
 
-### Method
+## Methods
 
 
-#### Checkbox
+Some internal methods provided by Checkbox can be accessed through ref:
+### Checkbox
 
 
 | Name    | Description  |
 | Name    | Description  |
 | ------- | ------------ |
 | ------- | ------------ |

+ 2 - 0
content/input/input/index-en-US.md

@@ -473,6 +473,8 @@ Common attributes will be set to the child elements of InputGroup, such as disab
 
 
 ## Methods
 ## Methods
 
 
+Some internal methods provided by Input can be accessed through ref:
+
 | Name    | Description  |
 | Name    | Description  |
 |---------|--------------|
 |---------|--------------|
 | blur()  | Remove focus |
 | blur()  | Remove focus |

+ 2 - 0
content/input/input/index.md

@@ -482,6 +482,8 @@ import { Input, Typography, Form, TextArea, Button } from '@douyinfe/semi-ui';
 
 
 ## Methods
 ## Methods
 
 
+绑定在组件实例上的方法,可以通过 ref 调用实现某些特殊交互
+
 | 名称    | 描述     |
 | 名称    | 描述     |
 |---------|--------|
 |---------|--------|
 | blur()  | 移出焦点 |
 | blur()  | 移出焦点 |

+ 2 - 0
content/input/inputnumber/index-en-US.md

@@ -233,6 +233,8 @@ function Demo () {
 
 
 ## Methods
 ## Methods
 
 
+Some internal methods provided by InputNumber can be accessed through ref:
+
 | Name    | Description     |
 | Name    | Description     |
 | ------- | --------------- |
 | ------- | --------------- |
 | blur()  | Move the focus. |
 | blur()  | Move the focus. |

+ 2 - 0
content/input/inputnumber/index.md

@@ -207,6 +207,8 @@ function Demo () {
 
 
 ## Methods
 ## Methods
 
 
+绑定在组件实例上的方法,可以通过 ref 调用实现某些特殊交互
+
 | 名称    | 描述     |
 | 名称    | 描述     |
 | ------- | -------- |
 | ------- | -------- |
 | blur()  | 移出焦点 |
 | blur()  | 移出焦点 |

+ 1 - 1
content/input/radio/index-en-US.md

@@ -412,7 +412,7 @@ class App extends React.Component {
 | value | Used to set the currently selected value | string \| number | - |
 | value | Used to set the currently selected value | string \| number | - |
 | type | Set the type of radio, one of `default`, `button`, `card`, `pureCard` <br/>**This api is provided after v1.26.0, and card and pureCard are in v1.30.0 Provided after ** | string | `default` |
 | type | Set the type of radio, one of `default`, `button`, `card`, `pureCard` <br/>**This api is provided after v1.26.0, and card and pureCard are in v1.30.0 Provided after ** | string | `default` |
 | onChange | Callback function when the selected option changes | Function (e: Event) | - |
 | onChange | Callback function when the selected option changes | Function (e: Event) | - |
-## Method
+## Methods
 
 
 ### Radio
 ### Radio
 
 

+ 1 - 1
content/input/radio/index.md

@@ -361,7 +361,7 @@ class App extends React.Component {
 |type|设置所有radio的样式类型,可选值为:`default`、`button`、`card`、`pureCard` <br/>**该 api 在 v1.26.0 后提供,其中 card 和 pureCard 在 v1.30.0 后提供**    |string|`default`|
 |type|设置所有radio的样式类型,可选值为:`default`、`button`、`card`、`pureCard` <br/>**该 api 在 v1.26.0 后提供,其中 card 和 pureCard 在 v1.30.0 后提供**    |string|`default`|
 | onChange     | 选项变化时的回调函数                                                                        | function(e:Event)                                                         | -            |
 | onChange     | 选项变化时的回调函数                                                                        | function(e:Event)                                                         | -            |
 
 
-## 方法
+## Methods
 
 
 ### Radio
 ### Radio
 
 

+ 2 - 1
content/input/select/index-en-US.md

@@ -1379,7 +1379,8 @@ import { Select, Checkbox } from '@douyinfe/semi-ui';
 | label      | Text displayed.    | ReactNode | v0.31.0 |
 | label      | Text displayed.    | ReactNode | v0.31.0 |
 | style      | Inline Style       | object    | v0.31.0 |
 | style      | Inline Style       | object    | v0.31.0 |
 
 
-### Method()
+## Methods
+Some internal methods provided by Select can be accessed through ref:
 
 
 | Method      | Instructions                    | Version |
 | Method      | Instructions                    | Version |
 | ----------- | ------------------------------- | ------- |
 | ----------- | ------------------------------- | ------- |

+ 2 - 2
content/input/select/index.md

@@ -1448,9 +1448,9 @@ import { Select, Checkbox } from '@douyinfe/semi-ui';
 | label     | 展示的文本 | ReactNode | v0.31.0 |
 | label     | 展示的文本 | ReactNode | v0.31.0 |
 | style     | 样式       | object    | v0.31.0 |
 | style     | 样式       | object    | v0.31.0 |
 
 
-### Method()
+## Methods
 
 
-绑定在 ref 上的方法,可以通过 ref 调用实现某些特殊交互
+绑定在组件实例上的方法,可以通过 ref 调用实现某些特殊交互
 
 
 | 方法        | 说明                                | 版本    |
 | 方法        | 说明                                | 版本    |
 | ----------- | ----------------------------------- | ------- |
 | ----------- | ----------------------------------- | ------- |

+ 1 - 0
content/input/taginput/index-en-US.md

@@ -471,6 +471,7 @@ import { TagInput } from '@douyinfe/semi-ui';
 |onRemove      |Callback invoked when tags are removed           |(removedValue: string, idx: number) => void                                 | -        |1.19.0|
 |onRemove      |Callback invoked when tags are removed           |(removedValue: string, idx: number) => void                                 | -        |1.19.0|
 
 
 ## Methods
 ## Methods
+Some internal methods provided by TagInput can be accessed through ref:
 
 
 |Name   |Description |Version |
 |Name   |Description |Version |
 |-------|------------|--------|
 |-------|------------|--------|

+ 3 - 1
content/input/taginput/index.md

@@ -471,7 +471,9 @@ import { TagInput } from '@douyinfe/semi-ui';
 |onKeyDown    |keydown 回调                             |(e: React.KeyboardEvent) => void          | -        |2.1.0|
 |onKeyDown    |keydown 回调                             |(e: React.KeyboardEvent) => void          | -        |2.1.0|
 |onRemove     |移除标签时的回调                                     |(removedValue: string, idx: number) => void     | -        |1.19.0|
 |onRemove     |移除标签时的回调                                     |(removedValue: string, idx: number) => void     | -        |1.19.0|
 
 
-## 方法
+## Methods
+
+绑定在组件实例上的方法,可以通过 ref 调用实现某些特殊交互
 
 
 |名称    |描述   |版本     |
 |名称    |描述   |版本     |
 |-------|------|---------|
 |-------|------|---------|

+ 2 - 1
content/input/timepicker/index-en-US.md

@@ -344,7 +344,8 @@ function Demo(props = {}) {
 | onFocus | Callback when focus is obtained | (e: domEvent) => void | () => {} | **1.0.0** |
 | onFocus | Callback when focus is obtained | (e: domEvent) => void | () => {} | **1.0.0** |
 | onOpenChange | A callback when the panel is on / off | (isOpen: boolean) => void |  |
 | onOpenChange | A callback when the panel is on / off | (isOpen: boolean) => void |  |
 
 
-## Method
+## Methods
+Some internal methods provided by TimePicker can be accessed through ref:
 
 
 | Name    | Description   |
 | Name    | Description   |
 | ------- | ------------- |
 | ------- | ------------- |

+ 3 - 1
content/input/timepicker/index.md

@@ -335,7 +335,9 @@ function Demo(props = {}) {
 | onFocus             | 获得焦点时的回调                                       | (e: domEvent) => void                                                             | () => {}                                                          | **1.0.0**          |
 | onFocus             | 获得焦点时的回调                                       | (e: domEvent) => void                                                             | () => {}                                                          | **1.0.0**          |
 | onOpenChange        | 面板打开/关闭时的回调                                  | Function(isOpen: boolean): void                                                   | 无                                                                |                    |
 | onOpenChange        | 面板打开/关闭时的回调                                  | Function(isOpen: boolean): void                                                   | 无                                                                |                    |
 
 
-## 方法
+## Methods
+
+绑定在组件实例上的方法,可以通过 ref 调用实现某些特殊交互
 
 
 | 名称    | 描述     |
 | 名称    | 描述     |
 | ------- | -------- |
 | ------- | -------- |

+ 5 - 2
content/input/transfer/index-en-US.md

@@ -969,9 +969,12 @@ TreeItem inherits all the properties of Item
 | -------- | -------------- | ---------------- | ------- |
 | -------- | -------------- | ---------------- | ------- |
 | children | Children Items | array<TreeItem\> |         |
 | children | Children Items | array<TreeItem\> |         |
 
 
-### Method
+## Methods
+Some internal methods provided by Transfer can be accessed through ref:
 
 
-- search(value: string): You can call this method through ref to search, and the search value will be set to Input.
+| Name    | Description   |
+| ------- | ------------- |
+| search(value: string)  |  You can call this method through ref to search, and the search value will be set to Input.  |
 
 
 ## Design Tokens
 ## Design Tokens
 <DesignToken/>
 <DesignToken/>

+ 5 - 2
content/input/transfer/index.md

@@ -971,9 +971,12 @@ TreeItem 继承 Item 的所有属性
 | -------- | ------ | ---------------- | ------ |
 | -------- | ------ | ---------------- | ------ |
 | children | 子元素 | Array<TreeItem\> |        |
 | children | 子元素 | Array<TreeItem\> |        |
 
 
-### Method
+## Methods
+绑定在组件实例上的方法,可以通过 ref 调用实现某些特殊交互
 
 
-- search(value: string):可通过 ref 调用该方法进行搜索,该搜索值会被置给 Input。
+| Name    | Description   |
+| ------- | ------------- |
+| search(value: string)  |  可通过 ref 调用该方法进行搜索,该搜索值会被置给 Input。  |
 
 
 ## 设计变量
 ## 设计变量
 <DesignToken/>
 <DesignToken/>

+ 6 - 3
content/input/treeselect/index-en-US.md

@@ -1464,9 +1464,12 @@ function Demo() {
 | key        | Required and must be unique                 | string            | -       |
 | key        | Required and must be unique                 | string            | -       |
 | isLeaf     | Whether it is a leaf node | boolean |-|
 | isLeaf     | Whether it is a leaf node | boolean |-|
 
 
-### Method
-- search(sugInput: string)
-For custom rendering of input box.
+## Methods
+Some internal methods provided by TreeSelect can be accessed through ref:
+
+| Name    | Description  |
+|---------|--------------|
+| search(sugInput: string)  | If you need to customize the search box externally, you can actively call this method when the value of the custom search box changes to change the filtering results |
 
 
 ## Accessibility
 ## Accessibility
 
 

+ 8 - 3
content/input/treeselect/index.md

@@ -1448,9 +1448,14 @@ function Demo() {
 | isLeaf| 是否为叶子节点 | boolean |-|
 | isLeaf| 是否为叶子节点 | boolean |-|
 
 
 
 
-### Method
-- search(sugInput: string)
-如果需要自定义搜索框可以使用该方法。
+### Methods
+
+绑定在组件实例上的方法,可以通过 ref 调用实现某些特殊交互
+
+| Name    | Description  |
+|---------|--------------|
+| search(sugInput: string)  | 如果需要在外部自定义搜索框,可以在自定义搜索框值变更时主动调用该方法,改变筛选结果 |
+
 
 
 ## Accessibility
 ## Accessibility
 
 

+ 3 - 0
content/input/upload/index-en-US.md

@@ -1309,6 +1309,9 @@ interface FileItem {
 ```
 ```
 
 
 ## Methods
 ## Methods
+
+Some internal methods provided by Upload can be accessed through ref:
+
 |Name | Description | Type | Version|
 |Name | Description | Type | Version|
 |----|----|----|----|
 |----|----|----|----|
 | insert | Upload file, when index is passed, it will be inserted at the specified position, if not passed, it will be inserted at the end | (files: Array<File\>, index?: number) => void | 2.2.0 |
 | insert | Upload file, when index is passed, it will be inserted at the specified position, if not passed, it will be inserted at the end | (files: Array<File\>, index?: number) => void | 2.2.0 |

+ 3 - 0
content/input/upload/index.md

@@ -1309,6 +1309,9 @@ interface FileItem {
 ```
 ```
 
 
 ## Methods
 ## Methods
+
+绑定在组件实例上的方法,可以通过 ref 调用实现某些特殊交互
+
 |名称 | 描述 | 类型 | 版本 |
 |名称 | 描述 | 类型 | 版本 |
 |----|----|----|----|
 |----|----|----|----|
 | insert | 上传文件,当index传入时,会插入到指定位置,不传则插入到最后 | (files: Array<File\>, index?: number) => void | 2.2.0 |
 | insert | 上传文件,当index传入时,会插入到指定位置,不传则插入到最后 | (files: Array<File\>, index?: number) => void | 2.2.0 |

+ 3 - 1
content/navigation/tree/index-en-US.md

@@ -2193,7 +2193,9 @@ import { IconFixedStroked, IconSectionStroked, IconAbsoluteStroked, IconInnerSec
 | itemSize | Height for each line of treeNode, required | number | - |
 | itemSize | Height for each line of treeNode, required | number | - |
 | width | Width | number\|string | '100%' |
 | width | Width | number\|string | '100%' |
 
 
-### Methods
+## Methods
+Some internal methods provided by Tree can be accessed through ref:
+
 |Name | Description | Type | Version |
 |Name | Description | Type | Version |
 |----|----|----|----|
 |----|----|----|----|
 | search | Trigger search manually | (value: string) => void |-|
 | search | Trigger search manually | (value: string) => void |-|

+ 2 - 0
content/navigation/tree/index.md

@@ -2187,6 +2187,8 @@ import { IconFixedStroked, IconSectionStroked, IconAbsoluteStroked, IconInnerSec
 
 
 ### Methods
 ### Methods
 
 
+绑定在组件实例上的方法,可以通过 ref 调用实现某些特殊交互
+
 |名称 | 描述 | 类型 | 版本  |
 |名称 | 描述 | 类型 | 版本  |
 |----|----|----|----|
 |----|----|----|----|
 | search | 手动触发搜索 | (value: string) => void |-|
 | search | 手动触发搜索 | (value: string) => void |-|

+ 2 - 1
content/show/carousel/index-en-US.md

@@ -681,7 +681,8 @@ class CarouselDemo extends React.Component {
 |props           |Parameters on the arrow div, including style, onClick events, etc                                      |DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement\>, HTMLDivElement\>         |-     |2.10.0|
 |props           |Parameters on the arrow div, including style, onClick events, etc                                      |DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement\>, HTMLDivElement\>         |-     |2.10.0|
 |children         |Arrow custom icon                                              |React.ReactNode      |-     |2.10.0|
 |children         |Arrow custom icon                                              |React.ReactNode      |-     |2.10.0|
 
 
-**Method()**
+## Methods
+Some internal methods provided by Carousel can be accessed through ref:
 
 
 | Method             | Instructions                    | Version |
 | Method             | Instructions                    | Version |
 | ------------------ | ------------------------------- | ------- |
 | ------------------ | ------------------------------- | ------- |

+ 2 - 1
content/show/carousel/index.md

@@ -679,8 +679,9 @@ class CarouselDemo extends React.Component {
 |------------------|---------------------------------------------------------------|------------------|------|------|
 |------------------|---------------------------------------------------------------|------------------|------|------|
 |props             |箭头div上的可传参数,包括style, onClick事件等                                                  | React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement\>, HTMLDivElement\>       |-     |2.10.0|
 |props             |箭头div上的可传参数,包括style, onClick事件等                                                  | React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement\>, HTMLDivElement\>       |-     |2.10.0|
 |children          |箭头自定义Icon                                                   |React.ReactNode      |-     |2.10.0|
 |children          |箭头自定义Icon                                                   |React.ReactNode      |-     |2.10.0|
+## Methods
 
 
-**Method()**
+绑定在组件实例上的方法,可以通过 ref 调用实现某些特殊交互
 
 
 | 方法               | 说明                        | 版本    |
 | 方法               | 说明                        | 版本    |
 | ----------------- | --------------------------  | ------ |
 | ----------------- | --------------------------  | ------ |