|
1 | 1 | <div>
|
2 |
| -@if ($showFilters && count($this->getFiltersWithoutSearch())) |
3 |
| - <div class="p-6 md:p-0"> |
4 |
| - <small class="text-gray-700">@lang('Applied Filters'):</small> |
| 2 | + @if ($showFilters && count($this->getFiltersWithoutSearch())) |
| 3 | + <div class="mb-4 p-6 md:p-0"> |
| 4 | + <small class="text-gray-700">@lang('Applied Filters'):</small> |
5 | 5 |
|
6 |
| - @foreach($filters as $key => $value) |
7 |
| - @if ($key !== 'search' && strlen($value)) |
8 |
| - <span |
9 |
| - wire:key="filter-pill-{{ $key }}" |
10 |
| - class="inline-flex items-center py-0.5 pl-2 pr-0.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-700" |
11 |
| - > |
12 |
| - {{ $filterNames[$key] ?? collect($this->columns())->pluck('text', 'column')->get($key, ucwords(strtr($key, ['_' => ' ', '-' => ' ']))) }}: |
13 |
| - @if(isset($customFilters[$key]) && method_exists($customFilters[$key], 'options')) |
14 |
| - {{ $customFilters[$key]->options()[$value] ?? $value }} |
15 |
| - @else |
16 |
| - {{ ucwords(strtr($value, ['_' => ' ', '-' => ' '])) }} |
17 |
| - @endif |
18 |
| - |
19 |
| - <button |
20 |
| - wire:click="removeFilter('{{ $key }}')" |
21 |
| - type="button" |
22 |
| - class="flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white" |
| 6 | + @foreach($filters as $key => $value) |
| 7 | + @if ($key !== 'search' && strlen($value)) |
| 8 | + <span |
| 9 | + wire:key="filter-pill-{{ $key }}" |
| 10 | + class="inline-flex items-center py-0.5 pl-2 pr-0.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-700" |
23 | 11 | >
|
24 |
| - <span class="sr-only">@lang('Remove filter option')</span> |
25 |
| - <svg class="h-2 w-2" stroke="currentColor" fill="none" viewBox="0 0 8 8"> |
26 |
| - <path stroke-linecap="round" stroke-width="1.5" d="M1 1l6 6m0-6L1 7" /> |
27 |
| - </svg> |
28 |
| - </button> |
29 |
| - </span> |
30 |
| - @endif |
31 |
| - @endforeach |
| 12 | + {{ $filterNames[$key] ?? collect($this->columns())->pluck('text', 'column')->get($key, ucwords(strtr($key, ['_' => ' ', '-' => ' ']))) }}: |
| 13 | + @if(isset($customFilters[$key]) && method_exists($customFilters[$key], 'options')) |
| 14 | + {{ $customFilters[$key]->options()[$value] ?? $value }} |
| 15 | + @else |
| 16 | + {{ ucwords(strtr($value, ['_' => ' ', '-' => ' '])) }} |
| 17 | + @endif |
32 | 18 |
|
33 |
| - <button class="focus:outline-none active:outline-none" wire:click.prevent="resetFilters"> |
34 |
| - <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800"> |
35 |
| - @lang('Clear') |
36 |
| - </span> |
37 |
| - </button> |
38 |
| - </div> |
39 |
| -@endif |
| 19 | + <button |
| 20 | + wire:click="removeFilter('{{ $key }}')" |
| 21 | + type="button" |
| 22 | + class="flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white" |
| 23 | + > |
| 24 | + <span class="sr-only">@lang('Remove filter option')</span> |
| 25 | + <svg class="h-2 w-2" stroke="currentColor" fill="none" viewBox="0 0 8 8"> |
| 26 | + <path stroke-linecap="round" stroke-width="1.5" d="M1 1l6 6m0-6L1 7" /> |
| 27 | + </svg> |
| 28 | + </button> |
| 29 | + </span> |
| 30 | + @endif |
| 31 | + @endforeach |
| 32 | + |
| 33 | + <button class="focus:outline-none active:outline-none" wire:click.prevent="resetFilters"> |
| 34 | + <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800"> |
| 35 | + @lang('Clear') |
| 36 | + </span> |
| 37 | + </button> |
| 38 | + </div> |
| 39 | + @endif |
40 | 40 | </div>
|
0 commit comments