Skip to content

Commit

Permalink
feat(radio): readonly default value changed to undefined (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 authored Sep 21, 2024
1 parent e6376c3 commit b00fb70
Show file tree
Hide file tree
Showing 26 changed files with 29 additions and 28 deletions.
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ max-content-row | Number | 5 | \- | N
max-label-row | Number | 3 | \- | N
name | String | - | \- | N
placement | String | left | options: left/right | N
readonly | Boolean | false | \- | N
readonly | Boolean | undefined | \- | N
value | String / Number / Boolean | false | Typescript:`T` `type RadioValue = string \| number \| boolean`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio/type.ts) | N

### Radio Events
Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-miniprogram/src/radio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ max-content-row | Number | 5 | 内容最大行数限制 | N
max-label-row | Number | 3 | 主文案最大行数限制 | N
name | String | - | HTML 元素原生属性 | N
placement | String | left | 复选框和内容相对位置。可选项:left/right | N
readonly | Boolean | false | 只读状态 | N
readonly | Boolean | undefined | 只读状态 | N
value | String / Number / Boolean | false | 单选按钮的值。TS 类型:`T` `type RadioValue = string \| number \| boolean`[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/radio/type.ts) | N

### Radio Events
Expand Down
4 changes: 2 additions & 2 deletions packages/products/tdesign-miniprogram/src/radio/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ const props: TdRadioProps = {
},
/** 只读状态 */
readonly: {
type: Boolean,
value: false,
type: null,
value: undefined,
},
/** 单选按钮的值 */
value: {
Expand Down
1 change: 0 additions & 1 deletion packages/products/tdesign-miniprogram/src/radio/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export interface TdRadioProps<T = RadioValue> {
};
/**
* 只读状态
* @default false
*/
readonly?: {
type: BooleanConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const radioDefaultProps: TdRadioProps = {
maxContentRow: 5,
maxLabelRow: 3,
placement: 'left',
readonly: false,
readonly: undefined,
value: undefined,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## API


### Radio Props

name | type | default | description | required
Expand All @@ -25,7 +24,7 @@ maxContentRow | Number | 5 | \- | N
maxLabelRow | Number | 3 | \- | N
name | String | - | \- | N
placement | String | left | options: left/right | N
readonly | Boolean | false | \- | N
readonly | Boolean | undefined | \- | N
value | String / Number / Boolean | undefined | Typescript:`T` | N
onChange | Function | | Typescript:`(checked: boolean, context: { e: ChangeEvent }) => void`<br/> | N

Expand Down
3 changes: 1 addition & 2 deletions packages/products/tdesign-mobile-react/src/radio/radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## API


### Radio Props

名称 | 类型 | 默认值 | 描述 | 必传
Expand All @@ -25,7 +24,7 @@ maxContentRow | Number | 5 | 内容最大行数限制 | N
maxLabelRow | Number | 3 | 主文案最大行数限制 | N
name | String | - | HTML 元素原生属性 | N
placement | String | left | 复选框和内容相对位置。可选项:left/right | N
readonly | Boolean | false | 只读状态 | N
readonly | Boolean | undefined | 只读状态 | N
value | String / Number / Boolean | undefined | 单选按钮的值。TS 类型:`T` | N
onChange | Function | | TS 类型:`(checked: boolean, context: { e: ChangeEvent }) => void`<br/>选中状态变化时触发 | N

Expand Down
1 change: 0 additions & 1 deletion packages/products/tdesign-mobile-react/src/radio/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export interface TdRadioProps<T = RadioValue> {
placement?: 'left' | 'right';
/**
* 只读状态
* @default false
*/
readonly?: boolean;
/**
Expand Down
5 changes: 4 additions & 1 deletion packages/products/tdesign-mobile-vue/src/radio/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ export default {
},
},
/** 只读状态 */
readonly: Boolean,
readonly: {
type: Boolean,
default: undefined,
},
/** 单选按钮的值 */
value: {
type: [String, Number, Boolean] as PropType<TdRadioProps['value']>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ maxContentRow | Number | 5 | \- | N
maxLabelRow | Number | 3 | \- | N
name | String | - | \- | N
placement | String | left | options: left/right | N
readonly | Boolean | false | \- | N
readonly | Boolean | undefined | \- | N
value | String / Number / Boolean | undefined | Typescript:`T` | N
onChange | Function | | Typescript:`(checked: boolean, context: { e: Event }) => void`<br/> | N

Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-mobile-vue/src/radio/radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ maxContentRow | Number | 5 | 内容最大行数限制 | N
maxLabelRow | Number | 3 | 主文案最大行数限制 | N
name | String | - | HTML 元素原生属性 | N
placement | String | left | 复选框和内容相对位置。可选项:left/right | N
readonly | Boolean | false | 只读状态 | N
readonly | Boolean | undefined | 只读状态 | N
value | String / Number / Boolean | undefined | 单选按钮的值。TS 类型:`T` | N
onChange | Function | | TS 类型:`(checked: boolean, context: { e: Event }) => void`<br/>选中状态变化时触发 | N

Expand Down
1 change: 0 additions & 1 deletion packages/products/tdesign-mobile-vue/src/radio/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export interface TdRadioProps<T = RadioValue> {
placement?: 'left' | 'right';
/**
* 只读状态
* @default false
*/
readonly?: boolean;
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-react/src/radio/defaultProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const radioDefaultProps: TdRadioProps = {
allowUncheck: false,
defaultChecked: false,
disabled: undefined,
readonly: false,
readonly: undefined,
value: undefined,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-react/src/radio/radio.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ children | TNode | - | Typescript:`string \| TNode`。[see more ts definition]
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 | false | \- | 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
Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-react/src/radio/radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ children | TNode | - | 单选内容,同 label。TS 类型:`string \| TNode`
disabled | Boolean | undefined | 是否为禁用态。如果存在父组件 RadioGroup,默认值由 RadioGroup.disabled 控制。优先级:Radio.disabled > RadioGroup.disabled > Form.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 | false | 只读状态 | 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
Expand Down
1 change: 0 additions & 1 deletion packages/products/tdesign-react/src/radio/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export interface TdRadioProps<T = RadioValue> {
name?: string;
/**
* 只读状态
* @default false
*/
readonly?: boolean;
/**
Expand Down
5 changes: 4 additions & 1 deletion packages/products/tdesign-vue-next/src/radio/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ export default {
default: '',
},
/** 只读状态 */
readonly: Boolean,
readonly: {
type: Boolean,
default: undefined,
},
/** 单选按钮的值 */
value: {
type: [String, Number, Boolean] as PropType<TdRadioProps['value']>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ default | String / Slot / Function | - | Typescript:`string \| TNode`。[see m
disabled | Boolean | undefined | \- | N
label | String / Slot / Function | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
name | String | - | \- | N
readonly | Boolean | false | \- | N
readonly | Boolean | undefined | \- | N
value | String / Number / Boolean | undefined | Typescript:`T` | N
onChange | Function | | Typescript:`(checked: boolean, context: { e: Event }) => void`<br/> | N
onClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/>trigger on click | N
Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-vue-next/src/radio/radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ default | String / Slot / Function | - | 单选按钮内容,同 label。TS 类
disabled | Boolean | undefined | 是否为禁用态。如果存在父组件 RadioGroup,默认值由 RadioGroup.disabled 控制。优先级:Radio.disabled > RadioGroup.disabled > Form.disabled | N
label | String / Slot / Function | - | 主文案。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
name | String | - | HTML 元素原生属性 | N
readonly | Boolean | false | 只读状态 | N
readonly | Boolean | undefined | 只读状态 | N
value | String / Number / Boolean | undefined | 单选按钮的值。TS 类型:`T` | N
onChange | Function | | TS 类型:`(checked: boolean, context: { e: Event }) => void`<br/>选中状态变化时触发 | N
onClick | Function | | TS 类型:`(context: { e: MouseEvent }) => void`<br/>点击时触发,一般用于外层阻止冒泡场景 | N
Expand Down
1 change: 0 additions & 1 deletion packages/products/tdesign-vue-next/src/radio/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export interface TdRadioProps<T = RadioValue> {
name?: string;
/**
* 只读状态
* @default false
*/
readonly?: boolean;
/**
Expand Down
5 changes: 4 additions & 1 deletion packages/products/tdesign-vue/src/radio/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export default {
default: '',
},
/** 只读状态 */
readonly: Boolean,
readonly: {
type: Boolean,
default: undefined,
},
/** 单选按钮的值 */
value: {
type: [String, Number, Boolean] as PropType<TdRadioProps['value']>,
Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-vue/src/radio/radio.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ default | String / Slot / Function | - | Typescript:`string \| TNode`。[see m
disabled | Boolean | undefined | \- | N
label | String / Slot / Function | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
name | String | - | \- | N
readonly | Boolean | false | \- | N
readonly | Boolean | undefined | \- | N
value | String / Number / Boolean | undefined | Typescript:`T` | N
onChange | Function | | Typescript:`(checked: boolean, context: { e: Event }) => void`<br/> | N
onClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/>trigger on click | N
Expand Down
2 changes: 1 addition & 1 deletion packages/products/tdesign-vue/src/radio/radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ default | String / Slot / Function | - | 单选按钮内容,同 label。TS 类
disabled | Boolean | undefined | 是否为禁用态。如果存在父组件 RadioGroup,默认值由 RadioGroup.disabled 控制。优先级:Radio.disabled > RadioGroup.disabled > Form.disabled | N
label | String / Slot / Function | - | 主文案。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
name | String | - | HTML 元素原生属性 | N
readonly | Boolean | false | 只读状态 | N
readonly | Boolean | undefined | 只读状态 | N
value | String / Number / Boolean | undefined | 单选按钮的值。TS 类型:`T` | N
onChange | Function | | TS 类型:`(checked: boolean, context: { e: Event }) => void`<br/>选中状态变化时触发 | N
onClick | Function | | TS 类型:`(context: { e: MouseEvent }) => void`<br/>点击时触发,一般用于外层阻止冒泡场景 | N
Expand Down
1 change: 0 additions & 1 deletion packages/products/tdesign-vue/src/radio/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export interface TdRadioProps<T = RadioValue> {
name?: string;
/**
* 只读状态
* @default false
*/
readonly?: boolean;
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -88263,7 +88263,7 @@
"field_type": [
"4"
],
"field_default_value": "false",
"field_default_value": "undefined",
"field_enum": "",
"field_desc_zh": "只读状态",
"field_desc_en": null,
Expand Down

0 comments on commit b00fb70

Please sign in to comment.