2016-09-02 10:18:33 +03:00
|
|
|
import * as React from "react";
|
|
|
|
import ReactToolbox from "../index";
|
2016-07-24 14:17:16 +03:00
|
|
|
|
2016-12-19 22:13:36 +03:00
|
|
|
export interface RadioGroupProps extends ReactToolbox.Props {
|
2016-07-24 14:17:16 +03:00
|
|
|
/**
|
|
|
|
* Children to pass through the component.
|
|
|
|
*/
|
2016-09-02 10:18:33 +03:00
|
|
|
children?: React.ReactNode;
|
2016-07-24 14:17:16 +03:00
|
|
|
/**
|
|
|
|
* If true, the group will be displayed as disabled.
|
|
|
|
* @default false
|
|
|
|
*/
|
|
|
|
disabled?: boolean;
|
|
|
|
/**
|
|
|
|
* Name for the input element group.
|
|
|
|
*/
|
|
|
|
name?: string;
|
|
|
|
/**
|
|
|
|
* Callback function that will be invoked when the value changes.
|
|
|
|
*/
|
|
|
|
onChange?: Function;
|
|
|
|
/**
|
|
|
|
* Default value selected in the radio group.
|
|
|
|
*/
|
2016-08-10 10:35:51 +03:00
|
|
|
value?: any;
|
2016-07-24 14:17:16 +03:00
|
|
|
}
|
|
|
|
|
2016-09-02 10:18:33 +03:00
|
|
|
export class RadioGroup extends React.Component<RadioGroupProps, {}> { }
|
2016-07-24 14:17:16 +03:00
|
|
|
|
|
|
|
export interface RadioButtonTheme {
|
|
|
|
/**
|
|
|
|
* Added to the root of the Radio in case it's disabled.
|
|
|
|
*/
|
|
|
|
disabled?: string;
|
|
|
|
/**
|
|
|
|
* Used as the root class of the component.
|
|
|
|
*/
|
|
|
|
field?: string;
|
|
|
|
/**
|
|
|
|
* Used for the input element.
|
|
|
|
*/
|
|
|
|
input?: string;
|
|
|
|
/**
|
|
|
|
* Used to style the text label element.
|
|
|
|
*/
|
|
|
|
text?: string;
|
|
|
|
}
|
|
|
|
|
2016-12-19 22:13:36 +03:00
|
|
|
export interface RadioButtonProps extends ReactToolbox.Props {
|
2016-07-24 14:17:16 +03:00
|
|
|
/**
|
|
|
|
* If true, the input element will be selected by default. Transferred from the parent.
|
|
|
|
* @default false
|
|
|
|
*/
|
|
|
|
checked?: boolean;
|
2016-12-19 22:13:36 +03:00
|
|
|
/**
|
|
|
|
* Children to pass through the component.
|
|
|
|
*/
|
|
|
|
children?: React.ReactNode;
|
2016-07-24 14:17:16 +03:00
|
|
|
/**
|
|
|
|
* If true, the item will be displayed as disabled.
|
|
|
|
* @default false
|
|
|
|
*/
|
|
|
|
disabled?: boolean;
|
|
|
|
/**
|
|
|
|
* Label for the radio button.
|
|
|
|
*/
|
2016-09-02 10:18:33 +03:00
|
|
|
label?: React.ReactNode | string;
|
2016-07-24 14:17:16 +03:00
|
|
|
/**
|
|
|
|
* Name for the input element.
|
|
|
|
*/
|
|
|
|
name?: string;
|
|
|
|
/**
|
|
|
|
* Callback function that will be invoked when the input is blurred.
|
|
|
|
*/
|
2016-08-10 10:35:51 +03:00
|
|
|
onBlur?: Function;
|
2016-07-24 14:17:16 +03:00
|
|
|
/**
|
|
|
|
* Callback function that will be invoked when the value changes.
|
|
|
|
*/
|
2016-08-10 10:35:51 +03:00
|
|
|
onChange?: Function;
|
2016-07-24 14:17:16 +03:00
|
|
|
/**
|
|
|
|
* Callback function that will be invoked when the input is focused.
|
|
|
|
*/
|
2016-08-10 10:35:51 +03:00
|
|
|
onFocus?: Function;
|
2016-07-24 14:17:16 +03:00
|
|
|
/**
|
|
|
|
* Classnames object defining the component style.
|
|
|
|
*/
|
2016-12-19 22:13:36 +03:00
|
|
|
theme?: RadioButtonTheme & RadioTheme;
|
2016-07-24 14:17:16 +03:00
|
|
|
/**
|
|
|
|
* Value for the radio button.
|
|
|
|
*/
|
|
|
|
value?: any;
|
|
|
|
}
|
|
|
|
|
2016-09-02 10:18:33 +03:00
|
|
|
export class RadioButton extends React.Component<RadioButtonProps, {}> { }
|
2016-12-19 22:13:36 +03:00
|
|
|
|
|
|
|
export interface RadioTheme {
|
|
|
|
/**
|
|
|
|
* Used to for the radio element.
|
|
|
|
*/
|
|
|
|
radio?: string;
|
|
|
|
/**
|
|
|
|
* Used for the radio element when it's checked.
|
|
|
|
*/
|
|
|
|
radioChecked?: string;
|
|
|
|
/**
|
|
|
|
* To provide styles for the ripple.
|
|
|
|
*/
|
|
|
|
ripple?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface RadioProps {
|
|
|
|
/**
|
|
|
|
* If true, the input element will be selected by default. Transferred from the parent.
|
|
|
|
* @default false
|
|
|
|
*/
|
|
|
|
checked?: boolean;
|
|
|
|
/**
|
|
|
|
* Children to pass through the component.
|
|
|
|
*/
|
|
|
|
children?: React.ReactNode;
|
|
|
|
/**
|
|
|
|
* Callback invoked on mouse down.
|
|
|
|
*/
|
|
|
|
onMouseDown?: Function;
|
|
|
|
/**
|
|
|
|
* Additional properties passed to Radio container.
|
|
|
|
*/
|
|
|
|
[key: string]: any;
|
|
|
|
}
|