Add clear button to sort popup

This commit is contained in:
Stanislav Romanov 2022-09-10 18:14:42 +03:00
parent 18187c4796
commit f920f7969f
2 changed files with 18 additions and 3 deletions

View file

@ -1 +1 @@
<div class="border-b my-4"/>
<div class="border-b my-4" ...attributes/>

View file

@ -36,6 +36,16 @@
</div>
</options.Option>
{{/each}}
<Divider class="my-1"/>
<options.Option @value={{null}} class='outline-none'>
<div
class='flex items-center px-4 py-2 text-sm hover:bg-base-6 hover:text-base-1 cursor-pointer'
>
Clear
</div>
</options.Option>
</listbox.Options>
</Listbox>
</div>
@ -59,7 +69,7 @@
@checked={{not (includes item this.hiddenFields)}}
@label={{namelize item}}
@onChange={{fn this.toggleHiddenField item}}
class="w-full whitespace-nowrap"
class='w-full whitespace-nowrap'
/>
</div>
{{/each}}
@ -103,7 +113,12 @@
</Column>
{{/if}}
{{#each this.attributes as |field|}}
{{#if (and (not-eq field @model.index.primaryKey) (not (includes field this.hiddenFields)))}}
{{#if
(and
(not-eq field @model.index.primaryKey)
(not (includes field this.hiddenFields))
)
}}
<Column
@name={{capitalize field}}
@prop={{field}}