You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
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.0.4] - 2021-04-18
8
+
9
+
### Added
10
+
11
+
-`$searchFilterDebounce`, `$searchFilterDefer`, `$searchFilterLazy`, for defining the search input data binding property. https://github.com/rappasoft/laravel-livewire-tables/pull/211
12
+
- Remove ability to need to define filters if not defining defaults. https://github.com/rappasoft/laravel-livewire-tables/pull/213
13
+
14
+
### Changed
15
+
16
+
- Rearrange wire:keys
17
+
7
18
## [1.0.3] - 2021-04-18
8
19
9
20
### Added
@@ -181,7 +192,8 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
Copy file name to clipboardExpand all lines: README.md
+28-27Lines changed: 28 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -234,22 +234,7 @@ You will see how to get more out of this base query using filters and search bel
234
234
235
235
Creating filters is not required, and the filters box will be hidden if none are defined.
236
236
237
-
Creating filters requires a few easy steps.
238
-
239
-
#### Adding to the filters array
240
-
241
-
You must first define a filter key in the **$filters** array, this tells the component to save the filter status in the query string for page reloads, as well as let you set a default.
242
-
243
-
```php
244
-
public array $filters = [
245
-
'type' => null,
246
-
'active' => null,
247
-
];
248
-
```
249
-
250
-
#### Defining the filter UI
251
-
252
-
After you define the filters for the component, you must specify their options using the **filters()** method.
237
+
#### Defining the filters
253
238
254
239
Right now the only supported filter type is a select dropdown.
255
240
@@ -273,10 +258,21 @@ public function filters(): array
273
258
}
274
259
```
275
260
276
-
You specify your filters array using the **key** as the filter name supplied in the **$filters** array on the component.
277
-
278
261
The keys of the options you supply will be validated on select to make sure they match one of the options on the backend, otherwise it will be changed to _null_ for safety.
279
262
263
+
#### Setting filter defaults
264
+
265
+
When you define the filters, a class property of $filters is generated for you.
266
+
267
+
```php
268
+
public array $filters = [
269
+
'type' => null,
270
+
'active' => null,
271
+
];
272
+
```
273
+
274
+
You may overwrite this property to set defaults to your filters if you would like.
275
+
280
276
#### Alternate: Defining a filter view
281
277
282
278
If you want full control over your filters, you can omit the **filters()** method and instead add a **filtersView()** method that return the string view name, which will be included in the master component on render. This is useful when you have different types of filters than the package offers:
@@ -386,15 +382,18 @@ In the component you have access to `$this->selectedRowsQuery` which is a **Buil
386
382
387
383
There are some class level properties you can set:
388
384
389
-
| Property | Default | Usage |
390
-
| -------- | ------- | ----- |
391
-
| $showSearch | true | Show the search box |
392
-
| $showPerPage | true | Show the per page selector |
393
-
| $showPagination | true | Show the pagination |
394
-
| $showSorting | true | Show the sorting pills |
395
-
| $showFilters | true | Show the filter pills |
396
-
| $refresh | false | Whether or not to refresh the table at a certain interval. false = off, int = ms, string = functionCall |
397
-
| $offlineIndicator | true | Shows a red banner when there is no internet connection. |
385
+
| Property | Default | Options | Usage |
386
+
| -------- | ------- | ------- | ----- |
387
+
| $showSearch | true | bool | Show the search box |
388
+
| $showPerPage | true | bool | Show the per page selector |
389
+
| $showPagination | true | bool | Show the pagination |
390
+
| $showSorting | true | bool | Show the sorting pills |
391
+
| $showFilters | true | bool | Show the filter pills |
392
+
| $searchFilterDebounce | null | null/int | Adds a debounce of `$searchFilterDebounce` ms to the search input |
393
+
| $searchFilterDefer | null | null/bool | Adds `.defer` to the search input |
394
+
| $searchFilterLazy | null | null/bool | Adds `.lazy` to the search input |
395
+
| $refresh | false | false/int/string | Whether or not to refresh the table at a certain interval. false = off, int = ms, string = functionCall |
396
+
| $offlineIndicator | true | bool | Shows a red banner when there is no internet connection. |
398
397
399
398
#### Using more than one table on a page
400
399
@@ -618,9 +617,11 @@ The final result would look like:
0 commit comments