Files
fuel-price/resources/views/components/fuel/sort-select.blade.php
Ovidiu U 1848c070da
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
feat: replace flux:select with dropdown menus using Alpine.js for fuel filters
2026-04-08 10:06:55 +01:00

32 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<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>