Sha256: 9de76c0bd7154b149774bcc8ba3f456895e7dc50b0a89b270eb66708fbc192da
Contents?: true
Size: 1.2 KB
Versions: 15
Compression:
Stored size: 1.2 KB
Contents
Rev.registerComponent('StoreInput', class extends React.Component { static get mixins() { return [ Rev.App.Mixins.StoreInputMixin, Backbone.Events ] } static get propTypes() { store: React.PropTypes.object.isRequired field: React.PropTypes.string.isRequired name: React.PropTypes.string baseName: React.PropTypes.string } constructor(props) { super(props) this.onFieldChange = this.onFieldChange.bind(this) this.isCheckbox = this.isCheckbox.bind(this) this.onBlur = this.onBlur.bind(this) } errors() { return this.props.store.errors[this.props.field] } render() { var t var form_params = { defaultValue: this.defaultValue(), value: this.value(), name: this.name() } if(this.props.type == 'select' || this.props.type == 'textarea') { t = this.props.type } if(this.isCheckbox()) { form_params['defaultChecked'] = this.value() } return <Rev.Components.Input key={this.props.field} dom={t} {...form_params} {...this.props} onChange={ this.onFieldChange } error={ this.errors() } onBlur={ this.onBlur }> { this.props.children } </Rev.Components.Input> } })
Version data entries
15 entries across 15 versions & 1 rubygems