Repository URL to install this package:
|
Version:
0.14.1 ▾
|
import React from 'react'
import { isValid } from 'src/forms/deps/isValid'
import { RadioGroup, RadioGroupState } from 'molecules/Toggle/RadioGroup'
import { InputChain } from '../../InputChain'
class RadioGroupInput extends InputChain {
static isSatisfiedByProps(props): boolean {
return props.type === 'radioGroup'
}
validate(): void {
console.log('RadioGroupInput_validate')
const value = this.getValue()
this.isValid = isValid(value, this.state.validationType)
}
render() {
const state = new RadioGroupState()
// or props.radioGroupName
const props = this.store.get('props')
state.name = props.name
// @todo - should be done on willMount!!!!!!!!!!!!!!!!!!
// this.state = state
// this.state.__fixme = state
const { radioInputsList } = props
console.log({ state, radioInputsList })
state.updateFrom(radioInputsList)
return <RadioGroup state={state} />
}
}
export { RadioGroupInput }
export default RadioGroupInput