Add checking existing sort values
This commit is contained in:
parent
6272ed449a
commit
998b7ec6e7
1 changed files with 27 additions and 24 deletions
|
|
@ -13,30 +13,33 @@
|
|||
@value={{this.q}}
|
||||
@onChange={{this.searchTextChanged}}
|
||||
/>
|
||||
<div class='inline relative mb-4 sm:ml-4'>
|
||||
<Listbox @value={{this.sort}} @onChange={{set this 'sort'}} as |listbox|>
|
||||
<listbox.Button
|
||||
class='inline-flex items-center justify-center min-w-min w-24 px-3 py-2 border rounded cursor-pointer'
|
||||
>
|
||||
<Icons::Sort class='mr-1' />
|
||||
{{if this.sort this.sort 'Sort'}}
|
||||
</listbox.Button>
|
||||
<listbox.Options
|
||||
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'
|
||||
as |options|
|
||||
>
|
||||
{{#each this.sortValues as |item|}}
|
||||
<options.Option @value={{item}} class='outline-none'>
|
||||
<div
|
||||
class='flex items-center px-4 py-2 text-sm hover:bg-base-6 hover:text-base-1 cursor-pointer'
|
||||
>
|
||||
{{item}}
|
||||
</div>
|
||||
</options.Option>
|
||||
{{/each}}
|
||||
</listbox.Options>
|
||||
</Listbox>
|
||||
</div>
|
||||
|
||||
{{#if this.sortValues.length}}
|
||||
<div class='inline relative mb-4 sm:ml-4'>
|
||||
<Listbox @value={{this.sort}} @onChange={{set this 'sort'}} as |listbox|>
|
||||
<listbox.Button
|
||||
class='inline-flex items-center justify-center min-w-min w-24 px-3 py-2 border rounded cursor-pointer'
|
||||
>
|
||||
<Icons::Sort class='mr-1' />
|
||||
{{if this.sort this.sort 'Sort'}}
|
||||
</listbox.Button>
|
||||
<listbox.Options
|
||||
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'
|
||||
as |options|
|
||||
>
|
||||
{{#each this.sortValues as |item|}}
|
||||
<options.Option @value={{item}} class='outline-none'>
|
||||
<div
|
||||
class='flex items-center px-4 py-2 text-sm hover:bg-base-6 hover:text-base-1 cursor-pointer'
|
||||
>
|
||||
{{item}}
|
||||
</div>
|
||||
</options.Option>
|
||||
{{/each}}
|
||||
</listbox.Options>
|
||||
</Listbox>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
{{!-- <div class='flex items-center mb-4'>
|
||||
|
|
|
|||
Loading…
Reference in a new issue