Skip to content

Commit 42adf72

Browse files
committed
Ability to turn off filter dropdown
1 parent 5d4c00f commit 42adf72

File tree

6 files changed

+35
-8
lines changed

6 files changed

+35
-8
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- [Ability to turn off filter dropdown](https://github.com/rappasoft/laravel-livewire-tables/pull/285)
10+
11+
### Changed
12+
13+
- [Fix ambiguous column id when using Relation instead of Builder](https://github.com/rappasoft/laravel-livewire-tables/pull/283)
14+
- [Use column text for sorting and filter pills if no $filterNames or $sortNames exist](https://github.com/rappasoft/laravel-livewire-tables/pull/286)
15+
- [Fix tailwind pagination view](https://github.com/rappasoft/laravel-livewire-tables/pull/284)
16+
717
## [1.6.1] - 2021-05-13
818

919
### Changed

resources/views/bootstrap-4/datatable.blade.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ class="container-fluid p-0"
2020
<div class="d-md-flex">
2121
@include('livewire-tables::bootstrap-4.includes.search')
2222

23-
<div class="ml-0 ml-md-3 mb-3 mb-md-0">
24-
@include('livewire-tables::bootstrap-4.includes.filters')
25-
</div>
23+
@if ($showFilterDropdown)
24+
<div class="ml-0 ml-md-3 mb-3 mb-md-0">
25+
@include('livewire-tables::bootstrap-4.includes.filters')
26+
</div>
27+
@endif
2628
</div>
2729

2830
<div class="d-md-flex">

resources/views/bootstrap-5/datatable.blade.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ class="container-fluid p-0"
2020
<div class="d-md-flex">
2121
@include('livewire-tables::bootstrap-5.includes.search')
2222

23-
<div class="ms-0 ms-md-3 mb-3 mb-md-0">
24-
@include('livewire-tables::bootstrap-5.includes.filters')
25-
</div>
23+
@if ($showFilterDropdown)
24+
<div class="ms-0 ms-md-3 mb-3 mb-md-0">
25+
@include('livewire-tables::bootstrap-5.includes.filters')
26+
</div>
27+
@endif
2628
</div>
2729

2830
<div class="d-md-flex">

resources/views/tailwind/includes/filters.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@if ($showFilters && ($filtersView || count($customFilters)))
1+
@if ($showFilterDropdown && ($filtersView || count($customFilters)))
22
<div
33
x-data="{ open: false }"
44
@keydown.escape.stop="open = false"

src/Traits/WithBulkActions.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
trait WithBulkActions
1212
{
1313
public string $primaryKey = 'id';
14-
public bool $showFilters = true;
1514
public bool $selectPage = false;
1615
public bool $selectAll = false;
1716
public $selected = [];

src/Traits/WithFilters.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ trait WithFilters
2727
*/
2828
public array $filterNames = [];
2929

30+
/**
31+
* Show the filter pills
32+
*
33+
* @var bool
34+
*/
35+
public bool $showFilters = true;
36+
37+
/**
38+
* Show the filter dropdown
39+
*
40+
* @var bool
41+
*/
42+
public bool $showFilterDropdown = true;
43+
3044
/**
3145
* Default filters
3246
*

0 commit comments

Comments
 (0)