Skip to content

Commit 0127339

Browse files
lrljoegithub-actions[bot]
authored andcommitted
Fix styling
1 parent 767ab6f commit 0127339

File tree

4 files changed

+79
-84
lines changed

4 files changed

+79
-84
lines changed
Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1-
<?php
2-
3-
namespace Rappasoft\LaravelLivewireTables\Traits\Styling\Configuration;
4-
5-
trait SearchFieldStylingConfiguration
6-
{
7-
protected function setSearchIcon(string $searchIcon): self
8-
{
9-
$this->searchIcon = $searchIcon;
10-
$this->searchIconSet = true;
11-
12-
return $this;
13-
}
14-
15-
public function setSearchIconAttributes(array $attributes = []): self
16-
{
17-
$this->setCustomAttributes('searchIconAttributes', array_merge(['default' => false, 'default-colors' => false, 'default-styling' => false], $attributes));
18-
19-
return $this;
20-
}
21-
22-
23-
public function setSearchFieldAttributes(array $attributes = []): self
24-
{
25-
$this->setCustomAttributes('searchFieldAttributes', array_merge(['default' => false, 'default-colors' => false, 'default-styling' => false], $attributes));
26-
27-
return $this;
28-
}
29-
}
1+
<?php
2+
3+
namespace Rappasoft\LaravelLivewireTables\Traits\Styling\Configuration;
4+
5+
trait SearchFieldStylingConfiguration
6+
{
7+
protected function setSearchIcon(string $searchIcon): self
8+
{
9+
$this->searchIcon = $searchIcon;
10+
$this->searchIconSet = true;
11+
12+
return $this;
13+
}
14+
15+
public function setSearchIconAttributes(array $attributes = []): self
16+
{
17+
$this->setCustomAttributes('searchIconAttributes', array_merge(['default' => false, 'default-colors' => false, 'default-styling' => false], $attributes));
18+
19+
return $this;
20+
}
21+
22+
public function setSearchFieldAttributes(array $attributes = []): self
23+
{
24+
$this->setCustomAttributes('searchFieldAttributes', array_merge(['default' => false, 'default-colors' => false, 'default-styling' => false], $attributes));
25+
26+
return $this;
27+
}
28+
}
Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
<?php
2-
3-
namespace Rappasoft\LaravelLivewireTables\Traits\Styling;
4-
5-
use Rappasoft\LaravelLivewireTables\Traits\Styling\Configuration\SearchFieldStylingConfiguration;
6-
use Rappasoft\LaravelLivewireTables\Traits\Styling\Helpers\SearchFieldStylingHelpers;
7-
8-
trait HasSearchFieldStyling
9-
{
10-
use SearchFieldStylingConfiguration,
11-
SearchFieldStylingHelpers;
12-
13-
protected array $searchFieldAttributes = [];
14-
15-
protected bool $searchIconSet = false;
16-
17-
protected ?string $searchIcon = null;
18-
19-
protected array $searchIconAttributes = ['default-colors' => true, 'default-styling' => true];
20-
21-
}
1+
<?php
2+
3+
namespace Rappasoft\LaravelLivewireTables\Traits\Styling;
4+
5+
use Rappasoft\LaravelLivewireTables\Traits\Styling\Configuration\SearchFieldStylingConfiguration;
6+
use Rappasoft\LaravelLivewireTables\Traits\Styling\Helpers\SearchFieldStylingHelpers;
7+
8+
trait HasSearchFieldStyling
9+
{
10+
use SearchFieldStylingConfiguration,
11+
SearchFieldStylingHelpers;
12+
13+
protected array $searchFieldAttributes = [];
14+
15+
protected bool $searchIconSet = false;
16+
17+
protected ?string $searchIcon = null;
18+
19+
protected array $searchIconAttributes = ['default-colors' => true, 'default-styling' => true];
20+
}
Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
1-
<?php
2-
3-
namespace Rappasoft\LaravelLivewireTables\Traits\Styling\Helpers;
4-
5-
use Livewire\Attributes\Computed;
6-
7-
trait SearchFieldStylingHelpers
8-
{
9-
10-
public function getSearchFieldAttributes(): array
11-
{
12-
return $this->getCustomAttributes('searchFieldAttributes', true);
13-
}
14-
15-
#[Computed]
16-
public function hasSearchIcon(): bool
17-
{
18-
return $this->searchIconSet;
19-
}
20-
21-
#[Computed]
22-
public function getSearchIcon(): string
23-
{
24-
return $this->hasSearchIcon() ? $this->searchIcon : 'heroicon-m-magnifying-glass';
25-
}
26-
27-
#[Computed]
28-
public function getSearchIconAttributes(): array
29-
{
30-
return $this->getCustomAttributes('searchIconAttributes', true, false);
31-
}
32-
33-
}
1+
<?php
2+
3+
namespace Rappasoft\LaravelLivewireTables\Traits\Styling\Helpers;
4+
5+
use Livewire\Attributes\Computed;
6+
7+
trait SearchFieldStylingHelpers
8+
{
9+
public function getSearchFieldAttributes(): array
10+
{
11+
return $this->getCustomAttributes('searchFieldAttributes', true);
12+
}
13+
14+
#[Computed]
15+
public function hasSearchIcon(): bool
16+
{
17+
return $this->searchIconSet;
18+
}
19+
20+
#[Computed]
21+
public function getSearchIcon(): string
22+
{
23+
return $this->hasSearchIcon() ? $this->searchIcon : 'heroicon-m-magnifying-glass';
24+
}
25+
26+
#[Computed]
27+
public function getSearchIconAttributes(): array
28+
{
29+
return $this->getCustomAttributes('searchIconAttributes', true, false);
30+
}
31+
}

src/Traits/WithSearch.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ trait WithSearch
4040

4141
protected bool $trimSearchString = false;
4242

43-
4443
// TODO
4544
public function applySearch(): Builder
4645
{

0 commit comments

Comments
 (0)