Skip to content

Commit e657503

Browse files
committed
Enhance filter dropdown in TasksBoard with improved layout and reset functionality
1 parent cfdc249 commit e657503

File tree

1 file changed

+38
-8
lines changed

1 file changed

+38
-8
lines changed

resources/views/components/filters.blade.php

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@php use Illuminate\View\ComponentAttributeBag;use function Filament\Support\prepare_inherited_attributes; @endphp
12
{{-- Native Filament table filters - zero custom code needed! --}}
23
@if(method_exists($this, 'getTable') && $this->getTable()->isFilterable())
34
<div class="fi-ta-header-toolbar mb-4">
@@ -7,18 +8,47 @@
78
placement="bottom-start"
89
width="2xl"
910
max-height="24rem"
10-
class="fi-ta-filters-dropdown"
11+
class="fi-ta-filters-dropdown z-50"
1112
>
1213
<x-slot name="trigger">
1314
{{ $this->getTable()->getFiltersTriggerAction()->badge($this->getTable()->getActiveFiltersCount()) }}
1415
</x-slot>
1516

16-
{{-- Filament's native filter component --}}
17-
<x-filament-tables::filters
18-
:apply-action="$this->getTable()->getFiltersApplyAction()"
19-
:form="$this->getTableFiltersForm()"
20-
heading-tag="h4"
21-
/>
17+
<div class="fi-ta-filters-dropdown-panel" style="padding: calc(var(--spacing) * 6); ">
18+
<div class="fi-ta-filters-header mb-4 flex items-center justify-between">
19+
<h2 class="fi-ta-filters-heading font-medium">
20+
{{ __('filament-tables::table.filters.heading') }}
21+
</h2>
22+
23+
<div>
24+
<x-filament::link
25+
:attributes="
26+
prepare_inherited_attributes(
27+
new ComponentAttributeBag([
28+
'color' => 'danger',
29+
'tag' => 'button',
30+
'wire:click' => 'resetTableFiltersForm',
31+
'wire:loading.remove.delay.' . config('filament.livewire_loading_delay', 'default') => '',
32+
'wire:target' => 'resetTableFiltersForm',
33+
])
34+
)
35+
"
36+
>
37+
{{ __('filament-tables::table.filters.actions.reset.label') }}
38+
</x-filament::link>
39+
</div>
40+
</div>
41+
42+
{{ $this->getTableFiltersForm() }}
43+
44+
45+
@if ($this->getTable()->getFiltersApplyAction()->isVisible())
46+
<div class="fi-ta-filters-apply-action-ctn" style="padding-top: calc(var(--spacing) * 4)">
47+
{{ $this->getTable()->getFiltersApplyAction() }}
48+
</div>
49+
@endif
50+
</div>
51+
2252
</x-filament::dropdown>
2353

2454
{{-- Native filter indicators --}}
@@ -33,4 +63,4 @@ class="fi-ta-filters-dropdown"
3363
@endif
3464
</div>
3565
</div>
36-
@endif
66+
@endif

0 commit comments

Comments
 (0)