Repository URL to install this package:
|
Version:
2.3.1 ▾
|
import React from 'react'
import { isObj } from 'exotic'
import { ObserverForm, FormState } from 'src/forms'
import { SearchInputProps } from '../typings'
import { inputList } from './fixture'
class FormStateCard extends FormState {
inputsList = inputList
}
class Form extends ObserverForm<SearchProps> {
constructor(props) {
super(props)
this.state = new FormStateCard(props)
}
isSubmitButtonNeeded = false
static defaultProps = {
state: new FormStateCard(),
}
componentWillMount() {
const { searchAdditionalProps } = this.props
const searchInputList = this.state.get('search')
if (isObj(searchAdditionalProps)) {
Object.keys(searchAdditionalProps).forEach(
key => (searchInputList[key] = searchAdditionalProps[key])
)
}
}
}
export { Form }
export default Form