2019-10-15 18:32:58 +00:00
|
|
|
<BasicDropdown
|
|
|
|
@horizontalPosition="left"
|
2022-03-08 17:28:36 +00:00
|
|
|
@onOpen={{action
|
|
|
|
(queue (action (mut this.isOpen) true) (action this.capture))
|
|
|
|
}}
|
|
|
|
@onClose={{action (mut this.isOpen) false}}
|
|
|
|
as |dd|
|
2019-10-15 18:32:58 +00:00
|
|
|
>
|
2022-03-08 17:28:36 +00:00
|
|
|
<dd.Trigger
|
|
|
|
data-test-dropdown-trigger
|
|
|
|
class="dropdown-trigger"
|
|
|
|
{{on "keyup" (action "openOnArrowDown" dd)}}
|
|
|
|
>
|
2020-08-25 15:56:02 +00:00
|
|
|
<div class="dropdown-trigger-label" id="{{this.elementId}}-label">
|
2020-07-09 20:19:07 +00:00
|
|
|
{{this.label}}
|
|
|
|
{{#if this.selection.length}}
|
2019-10-15 18:32:58 +00:00
|
|
|
<span data-test-dropdown-count class="tag is-light">
|
2020-07-09 20:19:07 +00:00
|
|
|
{{this.selection.length}}
|
2019-10-15 18:32:58 +00:00
|
|
|
</span>
|
2019-01-11 23:41:56 +00:00
|
|
|
{{/if}}
|
2019-10-15 18:32:58 +00:00
|
|
|
</div>
|
2019-01-10 01:54:28 +00:00
|
|
|
<span class="dropdown-trigger-icon ember-power-select-status-icon"></span>
|
2019-10-15 18:32:58 +00:00
|
|
|
</dd.Trigger>
|
|
|
|
<dd.Content class="dropdown-options">
|
2020-08-25 15:56:02 +00:00
|
|
|
{{#if this.options}}
|
2022-03-08 17:28:36 +00:00
|
|
|
<ul
|
|
|
|
role="listbox"
|
|
|
|
aria-labelledby="{{this.elementId}}-label"
|
|
|
|
data-test-dropdown-options
|
|
|
|
>
|
2020-08-25 15:56:02 +00:00
|
|
|
{{#each this.options key="key" as |option|}}
|
|
|
|
<div
|
|
|
|
data-test-dropdown-option={{option.key}}
|
|
|
|
class="dropdown-option"
|
|
|
|
tabindex="0"
|
2022-03-08 17:28:36 +00:00
|
|
|
onkeyup={{action "traverseList" option}}
|
2020-08-25 15:56:02 +00:00
|
|
|
>
|
|
|
|
<label>
|
|
|
|
<input
|
|
|
|
type="checkbox"
|
|
|
|
tabindex="-1"
|
2021-02-17 21:01:44 +00:00
|
|
|
checked={{includes option.key this.selection}}
|
2020-08-25 15:56:02 +00:00
|
|
|
role="option"
|
|
|
|
onchange={{action "toggle" option}}
|
|
|
|
/>
|
|
|
|
{{option.label}}
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
{{/each}}
|
|
|
|
</ul>
|
|
|
|
{{else}}
|
|
|
|
<ul aria-labelledby="{{this.elementId}}-label" data-test-dropdown-options>
|
|
|
|
<li data-test-dropdown-empty class="dropdown-empty">
|
2019-10-15 18:32:58 +00:00
|
|
|
No options
|
2020-08-25 15:56:02 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
{{/if}}
|
2019-10-15 18:32:58 +00:00
|
|
|
</dd.Content>
|
|
|
|
</BasicDropdown>
|