2019-10-15 18:32:58 +00:00
|
|
|
<BasicDropdown
|
|
|
|
@horizontalPosition="left"
|
2020-07-09 20:19:07 +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
|
|
|
>
|
|
|
|
<dd.Trigger data-test-dropdown-trigger class="dropdown-trigger" {{on "keydown" (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}}
|
|
|
|
<ul role="listbox" aria-labelledby="{{this.elementId}}-label" data-test-dropdown-options>
|
|
|
|
{{#each this.options key="key" as |option|}}
|
|
|
|
<div
|
|
|
|
data-test-dropdown-option={{option.key}}
|
|
|
|
class="dropdown-option"
|
|
|
|
tabindex="0"
|
|
|
|
onkeydown={{action "traverseList" option}}
|
|
|
|
>
|
|
|
|
<label>
|
|
|
|
<input
|
|
|
|
type="checkbox"
|
|
|
|
tabindex="-1"
|
|
|
|
checked={{contains option.key this.selection}}
|
|
|
|
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>
|