discourse/app/assets/javascripts/admin/addon/components/value-list.hbs

42 lines
1.1 KiB
Handlebars

{{#if this.collection}}
<div class="values">
{{#each this.collection as |value index|}}
<div data-index={{index}} class="value">
<DButton
@action={{fn this.removeValue value}}
@icon="xmark"
class="remove-value-btn btn-small"
/>
<Input
title={{value}}
@value={{value}}
class="value-input"
{{on "focusout" (fn this.changeValue index)}}
/>
{{#if this.showUpDownButtons}}
<DButton
@action={{fn this.shift -1 index}}
@icon="arrow-up"
class="shift-up-value-btn btn-small"
/>
<DButton
@action={{fn this.shift 1 index}}
@icon="arrow-down"
class="shift-down-value-btn btn-small"
/>
{{/if}}
</div>
{{/each}}
</div>
{{/if}}
<ComboBox
@valueProperty={{null}}
@nameProperty={{null}}
@value={{this.newValue}}
@content={{this.filteredChoices}}
@onChange={{this.selectChoice}}
@options={{hash allowAny=true none=this.noneKey}}
/>