'use strict'; const React = require('react'); const InputWrapper = require('./input-wrapper'); const Widgets = require('react-widgets'); require('./input-tag.scss'); module.exports = React.createClass({ displayName: 'InputTag', getDefaultProps() { return { label: '', arrow: false, }; }, changeHandler() { this.setState({ open: !this.state.open, overlayShown: !this.state.open, }); }, multiSelect() { if (this.props.arrow) { return ( ); } else { return ( ); } }, inputWrapper() { const normalisedProps = InputWrapper.normaliseProps(this.props); return ( {this.multiSelect()} ); }, arrowWrapper() { let layer = null; if (this.state.overlayShown) { layer = (
); } let classes = cx({ 'empty': this.state.isEmpty, 'multiselect-arrow-container':true }); return (
{layer}
); }, render() { return ( { this.props.arrow ? this.arrowWrapper() : this.inputWrapper() } ); }, });