lucid-ui
Version:
A UI component library from AppNexus.
42 lines (41 loc) • 2.19 kB
JavaScript
import React from 'react';
import createClass from 'create-react-class';
import { SearchableMultiSelect, Resizer } from '../../../index';
const { Option } = SearchableMultiSelect;
export default createClass({
getInitialState() {
return {
isRequired: false
};
},
handleChange(event) {
this.setState({
isRequired: event.length > 0
});
},
render() {
return (React.createElement(Resizer, null, width => {
const responsiveMode = width >= 768 ? 'large' : 'small';
return (React.createElement("section", null,
React.createElement("h5", null, "Loading"),
React.createElement(SearchableMultiSelect, { responsiveMode: responsiveMode, isLoading: true },
React.createElement(Option, null, "Alabama")),
React.createElement("h5", null, "Disabled"),
React.createElement(SearchableMultiSelect, { responsiveMode: responsiveMode, isDisabled: true },
React.createElement(Option, null, "Alabama")),
React.createElement("h5", null, "Custom option selections"),
React.createElement(SearchableMultiSelect, { responsiveMode: responsiveMode, selectedIndices: [0, 1, 2, 3] },
React.createElement(Option, { Selection: { kind: 'warning' } }, "Washington"),
React.createElement(Option, { Selection: { kind: 'success' } }, "Oregon"),
React.createElement(Option, { Selection: { kind: 'danger' } }, "California"),
React.createElement(Option, { Selection: { kind: 'container' } }, "Nevada")),
React.createElement("h5", null, "No remove all option"),
React.createElement(SearchableMultiSelect, { responsiveMode: responsiveMode, hasRemoveAll: false, initialState: {
selectedIndices: [0, 1, 2],
} },
React.createElement(Option, null, "Washington"),
React.createElement(Option, null, "Oregon"),
React.createElement(Option, null, "California"))));
}));
},
});