File tree Expand file tree Collapse file tree 4 files changed +34
-12
lines changed Expand file tree Collapse file tree 4 files changed +34
-12
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,17 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
4
4
5
5
## [ Unreleased]
6
6
7
+ ## [ 1.5.1] - 2021-05-02
8
+
9
+ ### Added
10
+
11
+ - Added clear search method.
12
+
13
+ ### Changed
14
+
15
+ - Changed resetAll method to include search and page and moved to parent component.
16
+ - Refactored search method to use new resetSearch.
17
+
7
18
## [ 1.5.0] - 2021-05-02
8
19
9
20
### Added
@@ -286,7 +297,8 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
286
297
287
298
- Initial release
288
299
289
- [ Unreleased ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v1.5.0...development
300
+ [ Unreleased ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v1.5.1...development
301
+ [ 1.5.1 ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v1.4.0...v1.5.1
290
302
[ 1.5.0 ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v1.4.0...v1.5.0
291
303
[ 1.4.0 ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v1.3.1...v1.4.0
292
304
[ 1.3.1 ] : https://github.com/rappasoft/laravel-livewire-tables/compare/v1.3.0...v1.3.1
Original file line number Diff line number Diff line change @@ -157,6 +157,18 @@ public function getRowsProperty()
157
157
return $ this ->rowsQuery ()->get ();
158
158
}
159
159
160
+ /**
161
+ * Reset all the criteria
162
+ */
163
+ public function resetAll (): void
164
+ {
165
+ $ this ->resetFilters ();
166
+ $ this ->resetSearch ();
167
+ $ this ->resetSorts ();
168
+ $ this ->resetBulk ();
169
+ $ this ->resetPage ();
170
+ }
171
+
160
172
/**
161
173
* The view to render each row of the table.
162
174
*
Original file line number Diff line number Diff line change @@ -67,16 +67,6 @@ public function updatingFilters(): void
67
67
$ this ->resetPage ();
68
68
}
69
69
70
- /**
71
- * Reset all the filters
72
- */
73
- public function resetAll (): void
74
- {
75
- $ this ->resetFilters ();
76
- $ this ->resetSorts ();
77
- $ this ->resetBulk ();
78
- }
79
-
80
70
/**
81
71
* Define the filters array
82
72
*
Original file line number Diff line number Diff line change @@ -35,10 +35,18 @@ trait WithSearch
35
35
public function updatedFilters (): void
36
36
{
37
37
if (isset ($ this ->filters ['search ' ]) && $ this ->filters ['search ' ] === '' ) {
38
- $ this ->filters [ ' search ' ] = null ;
38
+ $ this ->resetSearch () ;
39
39
}
40
40
}
41
41
42
+ /**
43
+ * Clear the search filter specifically
44
+ */
45
+ public function resetSearch (): void
46
+ {
47
+ $ this ->filters ['search ' ] = null ;
48
+ }
49
+
42
50
/**
43
51
* Build Livewire model options for the search input
44
52
*
You can’t perform that action at this time.
0 commit comments