linstrom/frontend-reactive/app/components/util/multiselect.hbs

26 lines
623 B
Handlebars
Raw Normal View History

<div class={{@wrapper-class}}>
{{#if @readonly}}
<ul>
{{#each this.args.elements as |element|}}
{{#if element.checked}}
<li>
<p>{{element.name}}</p>
</li>
{{/if}}
{{/each}}
</ul>
{{else}}
{{#each this.args.elements as |element|}}
<label class={{@label-class}}>
{{element.description}}
<Input
@type="checkbox"
name="{{element.name}}"
class="{{@input-classes}}"
@checked={{element.checked}}
{{on "change" this.onChange}}
/>
</label>
{{/each}}
{{/if}}
</div>