simplr-forms-dom
Version:
DOM components for simplr-forms.
30 lines (29 loc) • 1.46 kB
TypeScript
/// <reference types="react" />
import * as React from "react";
import * as PropTypes from "prop-types";
import { BaseFieldState } from "simplr-forms";
import { FieldProps, FieldChildContext } from "simplr-forms/contracts";
import { HTMLElementProps, DomFieldTemplateCallback } from "../contracts/field";
import { BaseDomField } from "../abstractions";
export declare type RadioValue = string | number;
export interface RadioGroupProps extends FieldProps, HTMLElementProps<HTMLDivElement> {
name: string;
radioTemplate?: DomFieldTemplateCallback;
defaultValue?: RadioValue;
initialValue?: RadioValue;
value?: RadioValue;
}
export interface RadioGroupChildContext extends FieldChildContext {
RadioGroupOnChangeHandler: RadioOnChangeHandler;
RadioGroupOnFocus: React.FocusEventHandler<HTMLInputElement>;
RadioGroupOnBlur: React.FocusEventHandler<HTMLInputElement>;
}
export declare type RadioOnChangeHandler = (event: React.ChangeEvent<HTMLInputElement>, value: string) => void;
export declare class RadioGroup extends BaseDomField<RadioGroupProps, BaseFieldState> {
static childContextTypes: PropTypes.ValidationMap<RadioGroupChildContext>;
getChildContext(): RadioGroupChildContext;
protected readonly RawDefaultValue: string | number;
protected OnChangeHandler: RadioOnChangeHandler;
protected GetHTMLProps(props: RadioGroupProps): {};
renderField(): JSX.Element | null;
}