import * as React from 'react'; import { Input, Textarea, ToggleSwitch, RadioButton, Checkbox, NumberInput, Dropdown } from '../../src/ts/index'; class FormsView extends React.Component<{}, { numberInputValue?: number, inputValue?: string, roundInputValue?: string, textareaValue?: string, toggleValue?: boolean, activeRadioButtonID?: string, checkboxValue?: boolean }> { constructor(props: any) { super(props); this.state = { numberInputValue: 0, inputValue: '', roundInputValue: '', textareaValue: '', toggleValue: false, activeRadioButtonID: 'One', }; } public onInputChange(e: React.FormEvent) { this.setState({ inputValue: e.currentTarget.value }); } public onRoundInputChange(e: React.FormEvent) { this.setState({ roundInputValue: e.currentTarget.value }); } public onTextareaChange(e: React.FormEvent) { this.setState({ textareaValue: e.currentTarget.value }); } public toggleCheckbox() { const { checkboxValue } = this.state; this.setState({ checkboxValue: !checkboxValue }); } public toggleSwitch() { const { toggleValue } = this.state; this.setState({ toggleValue: !toggleValue }); } public radioOnClick(key: string) { key === this.state.activeRadioButtonID ? this.setState({ activeRadioButtonID: null }) : this.setState({ activeRadioButtonID: key }); } public numberInputHandleChange(newValue: number) { this.setState({ numberInputValue: newValue }); } public onDropdownSelect(e: any) { // debugger; } public render() { const { textareaValue, activeRadioButtonID, numberInputValue } = this.state; return (

{'Forms'}

{'Text inputs'}

{'Dropdown'}

{'Round'}

{'Default'}

{'States'}

{'Default'}

{}} />

{'Filled'}

{}} value={'I am filled!'} />

{'Active'}

{}} autoFocus={true} />

{'Disabled'}

{}} disabled={true} />

{'Success'}

{}} validationState={true} />

{'Error'}

{}} validationState={false} />

{'Text Area'}

{'Default'}