Skip to content

Feat/RadioButton - value type update #790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion generatedTypes/components/radioButton/RadioButton.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface RadioButtonPropTypes {
/**
* The identifier value of the radio button. must be different than other RadioButtons in the same group
*/
value?: string | boolean;
value?: string | number | boolean;
/**
* When using RadioButton without a RadioGroup, use this prop to toggle selection
*/
Expand Down
2 changes: 1 addition & 1 deletion generatedTypes/components/radioButton/RadioGroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ interface RadioGroupPropTypes {
/**
* The initial value of the selected radio button
*/
initialValue?: string | boolean;
initialValue?: string | number | boolean;
/**
* Invoked once when value changes, by selecting one of the radio buttons in the group
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export interface RadioGroupContextPropTypes {
/**
* The identifier value of the radio button. must be different than other RadioButtons in the same group
*/
value?: string | boolean;
value?: string | number | boolean;
/**
* Invoked once when value changes, by selecting one of the radio buttons in the group
*/
Expand Down
2 changes: 1 addition & 1 deletion src/components/radioButton/RadioButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface RadioButtonPropTypes {
/**
* The identifier value of the radio button. must be different than other RadioButtons in the same group
*/
value?: string | boolean;
value?: string | number | boolean;
/**
* When using RadioButton without a RadioGroup, use this prop to toggle selection
*/
Expand Down
4 changes: 2 additions & 2 deletions src/components/radioButton/RadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ interface RadioGroupPropTypes {
/**
* The initial value of the selected radio button
*/
initialValue?: string | boolean;
initialValue?: string | number | boolean;
/**
* Invoked once when value changes, by selecting one of the radio buttons in the group
*/
onValueChange?: Function;
}

interface RadioGroupState {
value?: string | boolean;
value?: RadioGroupPropTypes['initialValue'];
}

type Props = RadioGroupPropTypes & BaseComponentInjectedProps & ForwardRefInjectedProps;
Expand Down
2 changes: 1 addition & 1 deletion src/components/radioButton/RadioGroupContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface RadioGroupContextPropTypes {
/**
* The identifier value of the radio button. must be different than other RadioButtons in the same group
*/
value?: string | boolean;
value?: string | number | boolean;
/**
* Invoked once when value changes, by selecting one of the radio buttons in the group
*/
Expand Down
4 changes: 2 additions & 2 deletions src/components/radioButton/asRadioGroupChild.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface RadioGroupChildPropTypes {
/**
* The identifier value of the radio button. must be different than other RadioButtons in the same group
*/
value?: string | boolean;
value?: string | number | boolean;
/**
* When using RadioButton without a RadioGroup, use this prop to toggle selection
*/
Expand All @@ -19,7 +19,7 @@ type PropTypes = RadioGroupChildPropTypes;
export default function asRadioGroupChild(WrappedComponent: React.ComponentType<any>) {
class RadioGroupChild extends Component<PropTypes> {
static displayName: string | undefined;

render() {
const {value: buttonValue, selected} = this.props;
return (
Expand Down