2020-01-16 18:14:03 +03:00
|
|
|
<SortableObjects
|
|
|
|
@tagName="ul"
|
2020-05-18 00:35:53 +03:00
|
|
|
@id={{concat "ember-power-select-multiple-options-" @select.uniqueId}}
|
2020-01-16 18:14:03 +03:00
|
|
|
@class="ember-power-select-multiple-options"
|
2020-05-18 00:35:53 +03:00
|
|
|
@sortableObjectList={{@select.selected}}
|
2020-01-16 18:14:03 +03:00
|
|
|
@enableSort={{true}}
|
|
|
|
@useSwap={{false}}
|
|
|
|
@sortEndAction={{action "reorderItems"}}
|
|
|
|
>
|
2020-05-18 00:35:53 +03:00
|
|
|
{{#each @select.selected as |opt idx|}}
|
|
|
|
{{#component (or @extra.tokenComponent "draggable-object")
|
2017-10-31 12:10:49 +03:00
|
|
|
tagName="li"
|
|
|
|
class="ember-power-select-multiple-option"
|
2020-05-18 00:35:53 +03:00
|
|
|
select=@select
|
2018-03-13 14:17:29 +03:00
|
|
|
content=(readonly opt)
|
2017-10-31 12:10:49 +03:00
|
|
|
idx=idx
|
|
|
|
isSortable=true
|
2020-05-18 00:35:53 +03:00
|
|
|
mouseDown=this.handleOptionMouseDown
|
|
|
|
touchStart=this.handleOptionTouchStart
|
2017-10-31 12:10:49 +03:00
|
|
|
}}
|
2020-05-18 00:35:53 +03:00
|
|
|
{{#if @selectedItemComponent}}
|
|
|
|
{{component @selectedItemComponent option=(readonly opt) select=(readonly @select)}}
|
2017-10-31 12:10:49 +03:00
|
|
|
{{else}}
|
2020-05-18 00:35:53 +03:00
|
|
|
{{yield opt @select}}
|
2017-10-31 12:10:49 +03:00
|
|
|
{{/if}}
|
2020-05-18 00:35:53 +03:00
|
|
|
{{#unless @select.disabled}}
|
2017-10-31 12:10:49 +03:00
|
|
|
<span role="button"
|
|
|
|
aria-label="remove element"
|
|
|
|
class="ember-power-select-multiple-remove-btn"
|
2018-03-13 14:17:29 +03:00
|
|
|
data-selected-index={{idx}}
|
|
|
|
>
|
|
|
|
{{svg-jar "close" data-selected-index=idx}}
|
2017-10-31 12:10:49 +03:00
|
|
|
</span>
|
|
|
|
{{/unless}}
|
|
|
|
{{/component}}
|
|
|
|
{{else}}
|
2020-05-18 00:35:53 +03:00
|
|
|
{{#if (and @placeholder (not @searchEnabled))}}
|
|
|
|
<span class="ember-power-select-placeholder">{{@placeholder}}</span>
|
2017-10-31 12:10:49 +03:00
|
|
|
{{/if}}
|
|
|
|
{{/each}}
|
|
|
|
|
2020-05-18 00:35:53 +03:00
|
|
|
{{#if @searchEnabled}}
|
2020-01-15 16:53:51 +03:00
|
|
|
<input
|
|
|
|
type="search"
|
|
|
|
class="ember-power-select-trigger-multiple-input"
|
|
|
|
autocomplete="off"
|
|
|
|
autocorrect="off"
|
|
|
|
autocapitalize="off"
|
|
|
|
spellcheck="false"
|
|
|
|
id="ember-power-select-trigger-multiple-input-{{@select.uniqueId}}"
|
|
|
|
value={{@select.searchText}}
|
2020-05-18 00:35:53 +03:00
|
|
|
aria-controls={{@listboxId}}
|
2020-01-15 16:53:51 +03:00
|
|
|
style={{this.triggerMultipleInputStyle}}
|
|
|
|
placeholder={{this.maybePlaceholder}}
|
|
|
|
disabled={{@select.disabled}}
|
|
|
|
tabindex={{@tabindex}}
|
|
|
|
{{on "focus" @onFocus}}
|
|
|
|
{{on "blur" @onBlur}}
|
|
|
|
{{on "input" this.handleInput}}
|
|
|
|
{{on "keydown" this.handleKeydown}}
|
|
|
|
{{did-insert this.storeInputStyles}}
|
|
|
|
>
|
2017-10-31 12:10:49 +03:00
|
|
|
{{/if}}
|
2020-01-16 18:14:03 +03:00
|
|
|
</SortableObjects>
|
2017-10-31 12:10:49 +03:00
|
|
|
<span class="ember-power-select-status-icon"></span>
|