44 lines
1.4 KiB
Handlebars
44 lines
1.4 KiB
Handlebars
<Form::Element
|
|
@label={{@label}}
|
|
@for={{this.id}}
|
|
@required={{@required}}
|
|
@helper={{@helper}}
|
|
...attributes
|
|
>
|
|
<Menu as |menu|>
|
|
<menu.Button as |menuButton|>
|
|
<Button @onClick={{menuButton.toggleMenu}} class='w-auto'>
|
|
<Icons::CogOutline />
|
|
</Button>
|
|
</menu.Button>
|
|
|
|
<menu.Items
|
|
class='absolute z-dropdown right-0 w-28 min-w-min mt-2 py-1 origin-top-right bg-base-7 border rounded shadow-sm outline-none'
|
|
{{sortable-group onChange=@onChangeSort}}
|
|
>
|
|
{{#each @items as |item|}}
|
|
{{!-- @ts-ignore --}}
|
|
<div
|
|
class='flex items-center px-4 py-2 text-sm hover:bg-base-6 hover:text-base-1 cursor-pointer'
|
|
{{sortable-item model=item}}
|
|
>
|
|
<Icons::DragVertical {{sortable-handle}} class='mr-2 fill-base-3 cursor-move' />
|
|
<span class="whitespace-nowrap mr-3">
|
|
{{namelize item}}
|
|
</span>
|
|
{{! @ts-ignore }}
|
|
{{!-- template-lint-disable no-args-paths --}}
|
|
{{!-- argument action doesn't work like helper with @ --}}
|
|
<Form::Checkbox
|
|
@checked={{this.args.isItemChecked item}}
|
|
@onChange={{fn @onToggleItem item}}
|
|
@checkedIcon={{this.checkedIcon}}
|
|
@uncheckedIcon={{this.uncheckedIcon}}
|
|
@iconClass='fill-base-3'
|
|
class='ml-auto'
|
|
/>
|
|
</div>
|
|
{{/each}}
|
|
</menu.Items>
|
|
</Menu>
|
|
</Form::Element>
|