Skip to content

Commit 709905c

Browse files
committed
Formatting
1 parent 42ef090 commit 709905c

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -386,15 +386,18 @@ In the component you have access to `$this->selectedRowsQuery` which is a **Buil
386386

387387
There are some class level properties you can set:
388388

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. |
389+
| Property | Default | Options | Usage |
390+
| -------- | ------- | ------- | ----- |
391+
| $showSearch | true | bool | Show the search box |
392+
| $showPerPage | true | bool | Show the per page selector |
393+
| $showPagination | true | bool | Show the pagination |
394+
| $showSorting | true | bool | Show the sorting pills |
395+
| $showFilters | true | bool | Show the filter pills |
396+
| $searchFilterDebounce | null | null/int | Adds a debounce of `$searchFilterDebounce` ms to the search input |
397+
| $searchFilterDefer | null | null/bool | Adds `.defer` to the search input |
398+
| $searchFilterLazy | null | null/bool | Adds `.lazy` to the search input |
399+
| $refresh | false | false/int/string | Whether or not to refresh the table at a certain interval. false = off, int = ms, string = functionCall |
400+
| $offlineIndicator | true | bool | Shows a red banner when there is no internet connection. |
398401

399402
#### Using more than one table on a page
400403

src/Traits/WithFilters.php

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,36 +31,40 @@ trait WithFilters
3131
];
3232

3333
/**
34-
* @var int
34+
* @var int|null
3535
*/
3636
public ?int $searchFilterDebounce = null;
3737

3838
/**
39-
* @var bool
39+
* @var bool|null
4040
*/
41-
public ?bool $searchFilterLazy = null;
41+
public ?bool $searchFilterDefer = null;
4242

4343
/**
44-
* @var bool
44+
* @var bool|null
4545
*/
46-
public ?bool $searchFilterDefer = null;
46+
public ?bool $searchFilterLazy = null;
4747

4848
/**
49-
* Build livewire model options for the search input
49+
* Build Livewire model options for the search input
5050
*
5151
* @return string
5252
*/
53-
public function getSearchFilterOptionsProperty()
53+
public function getSearchFilterOptionsProperty(): string
5454
{
55+
if ($this->searchFilterDebounce) {
56+
return '.debounce.' . $this->searchFilterDebounce . 'ms';
57+
}
58+
59+
if ($this->searchFilterDefer) {
60+
return '.defer';
61+
}
62+
5563
if ($this->searchFilterLazy) {
5664
return '.lazy';
57-
} elseif ($this->searchFilterDefer) {
58-
return '.defer';
59-
} elseif ($this->searchFilterDebounce) {
60-
return '.debounce.' . $this->searchFilterDebounce . 'ms';
61-
} else {
62-
return '';
6365
}
66+
67+
return '';
6468
}
6569

6670
public function resetFilters(): void

0 commit comments

Comments
 (0)