|
1 | | -@php use Illuminate\View\ComponentAttributeBag;use function Filament\Support\prepare_inherited_attributes; @endphp |
2 | | -{{-- Native Filament table filters with dynamic width support --}} |
3 | | -@if(method_exists($this, 'getTable') && $this->getTable()->isFilterable()) |
4 | | - <div class="fi-ta-header-toolbar mb-4"> |
5 | | - <div class="fi-ta-actions fi-align-start fi-wrapped"> |
6 | | - {{-- Use Filament's exact filter system with configurable width --}} |
| 1 | +@php |
| 2 | + use Illuminate\View\ComponentAttributeBag;use function Filament\Support\prepare_inherited_attributes; |
| 3 | + $isFilterable = $this->getTable()->isFilterable(); |
| 4 | + $isFiltered = $this->getTable()->isFiltered(); |
| 5 | + $isSearchable = $this->getTable()->isSearchable(); |
| 6 | +@endphp |
| 7 | + |
| 8 | + |
| 9 | +<div class="fi-ta-header-toolbar mb-4 ms-2"> |
| 10 | + <div class="fi-ta-actions fi-align-start fi-wrapped space-x-4 mb-2"> |
| 11 | + @if($isFilterable) |
7 | 12 | <x-filament::dropdown |
8 | 13 | placement="bottom-start" |
9 | 14 | :width="$this->getTable()->getFiltersFormWidth()" |
@@ -50,17 +55,25 @@ class="fi-ta-filters-dropdown z-40" |
50 | 55 | </div> |
51 | 56 |
|
52 | 57 | </x-filament::dropdown> |
| 58 | + @endif |
53 | 59 |
|
54 | | - {{-- Native filter indicators --}} |
55 | | - @if($this->getTable()->isFiltered()) |
56 | | - <div class="fi-ta-filter-indicators flex gap-1"> |
57 | | - @foreach($this->getTable()->getFilterIndicators() as $indicator) |
58 | | - <x-filament::badge color="primary" size="sm"> |
59 | | - {{ $indicator->getLabel() }} |
60 | | - </x-filament::badge> |
61 | | - @endforeach |
62 | | - </div> |
63 | | - @endif |
64 | | - </div> |
| 60 | + @if($isSearchable) |
| 61 | + {{-- Search input --}} |
| 62 | + <x-filament-tables::search-field |
| 63 | + :debounce="$this->getTable()->getSearchDebounce()" |
| 64 | + :on-blur="$this->getTable()->isSearchOnBlur()" |
| 65 | + :placeholder="$this->getTable()->getSearchPlaceholder()" |
| 66 | + /> |
| 67 | + @endif |
65 | 68 | </div> |
66 | | -@endif |
| 69 | + |
| 70 | + @if($isFiltered) |
| 71 | + <div class="fi-ta-filter-indicators flex gap-1"> |
| 72 | + @foreach($this->getTable()->getFilterIndicators() as $indicator) |
| 73 | + <x-filament::badge color="primary" size="sm"> |
| 74 | + {{ $indicator->getLabel() }} |
| 75 | + </x-filament::badge> |
| 76 | + @endforeach |
| 77 | + </div> |
| 78 | + @endif |
| 79 | +</div> |
0 commit comments