feat: replace flux:select with dropdown menus using Alpine.js for fuel filters
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.3) (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled

This commit is contained in:
Ovidiu U
2026-04-08 10:06:55 +01:00
parent 7b6aaac661
commit 1848c070da
6 changed files with 99 additions and 25 deletions

View File

@@ -1,7 +1,31 @@
<flux:select {{ $attributes }} size="sm">
<flux:select.option value="reliable">Best price (reliable)</flux:select.option>
<flux:select.option value="price">Cheapest first</flux:select.option>
<flux:select.option value="distance">Nearest first</flux:select.option>
<flux:select.option value="updated">Recently updated</flux:select.option>
<flux:select.option value="brand">Brand AZ</flux:select.option>
</flux:select>
<div
x-data="{
value: '',
labels: {
reliable: 'Best price (reliable)',
price: 'Cheapest first',
distance: 'Nearest first',
updated: 'Recently updated',
brand: 'Brand AZ',
},
get label() {
return this.labels[this.value] ?? 'Sort by';
},
}"
x-modelable="value"
{{ $attributes->whereStartsWith('wire:model') }}
>
<flux:dropdown>
<flux:button size="sm" icon:trailing="chevron-down">
<span x-text="label">Sort by</span>
</flux:button>
<flux:menu>
<flux:menu.item @click="value = 'reliable'">Best price (reliable)</flux:menu.item>
<flux:menu.item @click="value = 'price'">Cheapest first</flux:menu.item>
<flux:menu.item @click="value = 'distance'">Nearest first</flux:menu.item>
<flux:menu.item @click="value = 'updated'">Recently updated</flux:menu.item>
<flux:menu.item @click="value = 'brand'">Brand AZ</flux:menu.item>
</flux:menu>
</flux:dropdown>
</div>