-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Tencent:develop' into test/alert
- Loading branch information
Showing
7 changed files
with
54 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,39 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
|
||
### Radio Props | ||
|
||
name | type | default | description | required | ||
-- | -- | -- | -- | -- | ||
className | String | - | 类名 | N | ||
style | Object | - | 样式,Typescript:`React.CSSProperties` | N | ||
className | String | - | className of component | N | ||
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N | ||
allowUncheck | Boolean | false | \- | N | ||
checked | Boolean | false | \- | N | ||
defaultChecked | Boolean | false | uncontrolled property | N | ||
children | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N | ||
disabled | Boolean | undefined | \- | N | ||
label | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N | ||
name | String | - | \- | N | ||
readonly | Boolean | undefined | \- | N | ||
value | String / Number / Boolean | undefined | Typescript:`T` | N | ||
onChange | Function | | Typescript:`(checked: boolean, context: { e: ChangeEvent }) => void`<br/> | N | ||
onClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/>trigger on click | N | ||
|
||
|
||
### RadioGroup Props | ||
|
||
name | type | default | description | required | ||
-- | -- | -- | -- | -- | ||
className | String | - | 类名 | N | ||
style | Object | - | 样式,Typescript:`React.CSSProperties` | N | ||
className | String | - | className of component | N | ||
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N | ||
allowUncheck | Boolean | false | \- | N | ||
disabled | Boolean | false | \- | N | ||
disabled | Boolean | undefined | \- | N | ||
name | String | - | \- | N | ||
options | Array | - | Typescript:`Array<RadioOption>` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string \| TNode; value?: string \| number; disabled?: boolean }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/radio/type.ts) | N | ||
size | String | medium | options:small/medium/large。Typescript:`SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N | ||
value | String / Number / Boolean | - | Typescript:`T` | N | ||
defaultValue | String / Number / Boolean | - | uncontrolled property。Typescript:`T` | N | ||
variant | String | outline | options:outline/primary-filled/default-filled | N | ||
onChange | Function | | Typescript:`(value: T, context: { e: ChangeEvent }) => void`<br/> | N | ||
options | Array | - | Typescript:`Array<RadioOption>` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string \| TNode; value?: string \| number \| boolean; disabled?: boolean }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/radio/type.ts) | N | ||
readonly | Boolean | undefined | \- | N | ||
size | String | medium | options: small/medium/large。Typescript:`SizeEnum`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N | ||
value | String / Number / Boolean | - | Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/radio/type.ts) | N | ||
defaultValue | String / Number / Boolean | - | uncontrolled property。Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/radio/type.ts) | N | ||
variant | String | outline | options: outline/primary-filled/default-filled | N | ||
onChange | Function | | Typescript:`(value: T, context: { e: ChangeEvent; name?: string }) => void`<br/> | N |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,39 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
|
||
### Radio Props | ||
|
||
名称 | 类型 | 默认值 | 说明 | 必传 | ||
名称 | 类型 | 默认值 | 描述 | 必传 | ||
-- | -- | -- | -- | -- | ||
className | String | - | 类名 | N | ||
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N | ||
allowUncheck | Boolean | false | 是否允许取消选中 | N | ||
checked | Boolean | false | 是否选中 | N | ||
defaultChecked | Boolean | false | 是否选中。非受控属性 | N | ||
children | TNode | - | 单选内容,同 label。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N | ||
disabled | Boolean | undefined | 是否为禁用态。如果存在父组件 RadioGroup,默认值由 RadioGroup.disabled 控制。Radio.disabled 优先级高于 RadioGroup.disabled | N | ||
disabled | Boolean | undefined | 是否为禁用态。如果存在父组件 RadioGroup,默认值由 RadioGroup.disabled 控制。优先级:Radio.disabled > RadioGroup.disabled | N | ||
label | TNode | - | 主文案。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N | ||
name | String | - | HTML 元素原生属性 | N | ||
readonly | Boolean | undefined | 只读状态 | N | ||
value | String / Number / Boolean | undefined | 单选按钮的值。TS 类型:`T` | N | ||
onChange | Function | | TS 类型:`(checked: boolean, context: { e: ChangeEvent }) => void`<br/>选中状态变化时触发 | N | ||
onClick | Function | | TS 类型:`(context: { e: MouseEvent }) => void`<br/>点击时触发,一般用于外层阻止冒泡场景 | N | ||
|
||
|
||
### RadioGroup Props | ||
|
||
名称 | 类型 | 默认值 | 说明 | 必传 | ||
名称 | 类型 | 默认值 | 描述 | 必传 | ||
-- | -- | -- | -- | -- | ||
className | String | - | 类名 | N | ||
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N | ||
allowUncheck | Boolean | false | 是否允许取消选中 | N | ||
disabled | Boolean | false | 是否禁用全部子单选框。默认为 false。RadioGroup.disabled 优先级低于 Radio.disabled | N | ||
disabled | Boolean | undefined | 是否禁用全部子单选框。优先级:Radio.disabled > RadioGroup.disabled | N | ||
name | String | - | HTML 元素原生属性 | N | ||
options | Array | - | 单选组件按钮形式。RadioOption 数据类型为 string 或 number 时,表示 label 和 value 值相同。TS 类型:`Array<RadioOption>` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string \| TNode; value?: string \| number; disabled?: boolean }`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/radio/type.ts) | N | ||
options | Array | - | 单选组件按钮形式。RadioOption 数据类型为 string 或 number 时,表示 label 和 value 值相同。TS 类型:`Array<RadioOption>` `type RadioOption = string \| number \| RadioOptionObj` `interface RadioOptionObj { label?: string \| TNode; value?: string \| number \| boolean; disabled?: boolean }`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/radio/type.ts) | N | ||
readonly | Boolean | undefined | 只读状态 | N | ||
size | String | medium | 组件尺寸【讨论中】。可选项:small/medium/large。TS 类型:`SizeEnum`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N | ||
value | String / Number / Boolean | - | 选中的值。TS 类型:`T` | N | ||
defaultValue | String / Number / Boolean | - | 选中的值。非受控属性。TS 类型:`T` | N | ||
value | String / Number / Boolean | - | 选中的值。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/radio/type.ts) | N | ||
defaultValue | String / Number / Boolean | - | 选中的值。非受控属性。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/radio/type.ts) | N | ||
variant | String | outline | 单选组件按钮形式。可选项:outline/primary-filled/default-filled | N | ||
onChange | Function | | TS 类型:`(value: T, context: { e: ChangeEvent }) => void`<br/>选中值发生变化时触发 | N | ||
onChange | Function | | TS 类型:`(value: T, context: { e: ChangeEvent; name?: string }) => void`<br/>选中值发生变化时触发, `context.name` 指 RadioGroup 的 name 属性 | N |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters