Skip to content

Commit 0a23df2

Browse files
lrljoegithub-actions[bot]
authored andcommitted
Fix styling
1 parent d7adcec commit 0a23df2

File tree

5 files changed

+15
-29
lines changed

5 files changed

+15
-29
lines changed

src/Traits/Helpers/FilterHelpers.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,15 +346,13 @@ public function showFilterPillsSection(): bool
346346
return $this->filtersAreEnabled() && $this->filterPillsAreEnabled() && $this->hasAppliedVisibleFiltersForPills();
347347
}
348348

349-
#[On('livewireArrayFilterUpdateValues')]
349+
#[On('livewireArrayFilterUpdateValues')]
350350
public function updateLivewireArrayFilterValues(string $filterKey, string $tableName, array $values)
351351
{
352-
if ($this->tableName == $tableName)
353-
{
352+
if ($this->tableName == $tableName) {
354353
$filter = $this->getFilterByKey($filterKey);
355354
$filter->options($values);
356355
}
357356

358357
}
359-
360358
}

src/Views/Filters/LivewireComponentArrayFilter.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class LivewireComponentArrayFilter extends Filter
2020

2121
public function validate(array $value): array|bool
2222
{
23-
23+
2424
return $value;
2525
}
2626

@@ -50,6 +50,4 @@ public function getFilterPillValue($value): array|string|bool|null
5050

5151
return $values;
5252
}
53-
54-
5553
}

src/Views/Filters/LivewireComponentFilter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,4 @@ public function getFilterDefaultValue(): ?string
3333
{
3434
return $this->filterDefaultValue ?? null;
3535
}
36-
3736
}

src/Views/Traits/Filters/IsLivewireComponentFilter.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ public function getLivewireComponent(): string
3131
return $this->livewireComponent ?? '';
3232
}
3333

34-
3534
public function render(): string|\Illuminate\Contracts\Foundation\Application|\Illuminate\View\View|\Illuminate\View\Factory
3635
{
3736
if ($this->livewireComponent == '') {
3837
throw new DataTableConfigurationException('You must specify a valid path to your Livewire Component Filter.');
3938
}
40-
39+
4140
return view($this->getViewPath(), $this->getFilterDisplayData())->with([
4241
'livewireComponent' => $this->livewireComponent,
4342
]);
4443
}
45-
}
44+
}

src/Views/Traits/IsExternalArrayFilter.php

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ trait IsExternalArrayFilter
2424
public array $selectOptions = [];
2525

2626
#[On('filter-was-set')]
27-
#[Renderless]
27+
#[Renderless]
2828
public function setFilterValues($tableName, $filterKey, $value)
2929
{
30-
if ($tableName == $this->tableName && $filterKey == $this->filterKey)
31-
{
30+
if ($tableName == $this->tableName && $filterKey == $this->filterKey) {
3231
$this->selectedItems = $value;
3332
$this->clearFilter();
3433
$this->needsUpdating = false;
@@ -38,7 +37,7 @@ public function setFilterValues($tableName, $filterKey, $value)
3837

3938
protected function clearFilter() {}
4039

41-
#[Renderless]
40+
#[Renderless]
4241
public function updatedSelectedItems($values)
4342
{
4443
$this->needsUpdating = true;
@@ -54,18 +53,14 @@ protected function disableUpdateDispatch(): void
5453
$this->needsUpdating = false;
5554
}
5655

57-
#[Renderless]
56+
#[Renderless]
5857
protected function sendUpdateDispatch(array $returnValues)
5958
{
60-
if ($this->needsUpdating)
61-
{
62-
if (!empty($returnValues))
63-
{
64-
$this->dispatch('livewireArrayFilterUpdateValues', tableName: $this->tableName, filterKey: $this->filterKey, values: $returnValues)->to($this->tableComponent);
59+
if ($this->needsUpdating) {
60+
if (! empty($returnValues)) {
61+
$this->dispatch('livewireArrayFilterUpdateValues', tableName: $this->tableName, filterKey: $this->filterKey, values: $returnValues)->to($this->tableComponent);
6562
$this->value = array_keys($returnValues);
66-
}
67-
else
68-
{
63+
} else {
6964
$this->value = [];
7065
}
7166
$this->needsUpdating = false;
@@ -77,14 +72,11 @@ public function renderingIsExternalArrayFilter()
7772
{
7873
$returnValues = [];
7974

80-
if ($this->needsUpdating == true && !empty($this->selectedItems))
81-
{
82-
foreach ($this->selectedItems as $selectedItem)
83-
{
75+
if ($this->needsUpdating == true && ! empty($this->selectedItems)) {
76+
foreach ($this->selectedItems as $selectedItem) {
8477
$returnValues[$selectedItem] = $this->selectOptions[$selectedItem] ?? 'Unknown';
8578
}
8679
$this->sendUpdateDispatch($returnValues);
8780
}
8881
}
89-
9082
}

0 commit comments

Comments
 (0)