Sha256: 4415c2227f6749526bb63873c7739af8a881d9e7c9a49d3d4b4f52a60ca457f5
Contents?: true
Size: 925 Bytes
Versions: 10
Compression:
Stored size: 925 Bytes
Contents
import React from 'react'; import PropTypes from 'prop-types'; import { FormGroup, ControlLabel } from 'react-bootstrap'; import BootstrapSelect from '../../move_to_pf/react-bootstrap-select'; function MultiSelect(props) { const { options, onChange, ...otherProps } = props; const optionComponents = options.map(option => ( <option key={`option-${option.value}`} value={option.value}> {option.label} </option> )); return ( <FormGroup controlId="formControlsSelectMultiple"> <ControlLabel srOnly>{__('Select Value')}</ControlLabel> <BootstrapSelect {...otherProps} multiple onChange={evt => onChange(evt)}> {optionComponents} </BootstrapSelect> </FormGroup> ); } MultiSelect.defaultProps = { onChange: () => {}, }; MultiSelect.propTypes = { options: PropTypes.arrayOf(PropTypes.object).isRequired, onChange: PropTypes.func, }; export default MultiSelect;
Version data entries
10 entries across 10 versions & 1 rubygems