ontime-components
Version:
List of react components
37 lines (36 loc) • 1.02 kB
TypeScript
import { PureComponent } from 'react';
import { IProps } from '../../libs/interfaces';
import { TFuncClick, TFuncChange, TFuncFocus } from '../../libs/types';
interface IToggleProps extends IProps {
label?: string;
children?: any;
value?: boolean;
disabled?: boolean;
onClick?: Function;
onFocus?: Function;
onBlur?: Function;
onChange?: Function;
}
interface IToggleDefProps {
value: boolean;
}
interface IToggleState {
value: boolean;
isFocused: boolean;
}
declare class Toggle extends PureComponent<IToggleProps & IToggleDefProps, IToggleState> {
static defaultProps: {
value: boolean;
};
readonly state: IToggleState;
static getDerivedStateFromProps(nextProps: any, prevState: any): {
value: any;
} | null;
constructor(props: IToggleProps & IToggleDefProps);
onClick: TFuncClick;
onFocus: TFuncFocus;
onBlur: TFuncFocus;
onChange: TFuncChange;
render(): JSX.Element;
}
export { Toggle, IToggleProps, IToggleState };