import hbs from 'htmlbars-inline-precompile'; export default { title: 'Components|Multi-Select Dropdown', }; let options1 = [ { key: 'option-1', label: 'Option One' }, { key: 'option-2', label: 'Option Two' }, { key: 'option-3', label: 'Option Three' }, { key: 'option-4', label: 'Option Four' }, { key: 'option-5', label: 'Option Five' }, ]; let selection1 = ['option-2', 'option-4', 'option-5']; export let Standard = () => { return { template: hbs`
A wrapper around basic-dropdown for creating a list of checkboxes and tracking the state thereof.
`, context: { options1, selection1, }, }; }; export let RightAligned = () => { return { template: hbs`A strength of the multi-select-dropdown is its simple presentation. It is quick to select options and it is quick to remove options. However, this strength becomes a weakness when there are too many options. Since the selection isn't pinned in any way, removing a selection can become an adventure of scrolling up and down. Also since the selection isn't pinned, this component can't support search, since search would entirely mask the selection.
`, context: { optionsMany: Array(100) .fill(null) .map((_, i) => ({ label: `Option ${i}`, key: `option-${i}` })), selectionMany: [], }, }; }; export let Bar = () => { return { template: hbs`
Since this is a core component for faceted search, it makes sense to letruct an arrangement of multi-select dropdowns.
Do this by wrapping all the options in a .button-bar
container.