Files
threshold-ui/addons/core/addon/components/dropdown/index.hbs
T
Cameron Perera 9fec047506 Icu 12060 move rose filterable dropdown to core (#2048)
* feat: 🎸 generate new dropdown component in core

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060

* feat: 🎸 add template and class code to new dropdown component

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060

* chore: 🤖 add lodash package to core addon

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060

* test: 💍 add tests for core/dropdown component

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060

* refactor: 💡 use new core/dropdown in targets list screen

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060

* refactor: 💡 remove rose/filterabledropdown

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060

* feat: 🎸 add maxHeight to core/dropdown component

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060

* style: 💄 fix lint errors in dropdown/index-tests

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060

* refactor: 💡 update height to match designs

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060

* chore: 🤖 remove lodash from ui/admin

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060

* chore: 🤖 remove lodash from ui/desktop

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060

* chore: 🤖 move lodash to devDep in core

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060

* chore: 🤖 add lodash as core dependency

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060

* test: 💍 use waitUntil & findAll instead of setTimeout

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060

* chore: 🤖 add lodash as peerDependency for core

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060

* refactor: 💡 update waitUntil with suggestion from PR

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12060
2024-01-16 10:17:46 -05:00

52 lines
1.3 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
<Hds::Dropdown @height='314px' @onClose={{this.close}} as |DD|>
<DD.ToggleButton
@color='secondary'
@text={{@name}}
@count={{@checkedItems.length}}
/>
{{#if @isSearchable}}
<DD.Header @hasDivider={{true}}>
<Hds::Form::TextInput::Base
@type='search'
@value={{this.searchTerm}}
placeholder={{t 'actions.narrow-results'}}
aria-label={{t 'actions.narrow-results'}}
{{on 'input' this.filterItems}}
data-test-dropdown-search
/>
</DD.Header>
{{/if}}
{{#unless this.itemOptions}}
<DD.Description @text={{t 'titles.no-results'}} />
{{/unless}}
{{#if (has-block)}}
{{yield DD this.selectItem this.itemOptions}}
{{else}}
{{#each this.itemOptions as |itemOption|}}
<DD.Checkbox
@value={{itemOption.id}}
data-test-checkbox={{itemOption.id}}
checked={{includes itemOption.id @checkedItems}}
{{on 'change' this.selectItem}}
>
{{itemOption.displayName}}
</DD.Checkbox>
{{/each}}
{{/if}}
<DD.Footer @hasDivider={{true}}>
<Hds::Button
@text='Apply'
@isFullWidth={{true}}
@size='small'
{{on 'click' (fn this.applyFilter DD.close)}}
data-test-dropdown-apply-button
/>
</DD.Footer>
</Hds::Dropdown>