33namespace Rappasoft \LaravelLivewireTables \Views \Filters \Traits ;
44
55use Rappasoft \LaravelLivewireTables \Views \Filters \Traits \Styling \HandlesFilterPillsAttributes ;
6+ use Rappasoft \LaravelLivewireTables \Views \Filters \Traits \Pills \{HandlesPillsAsHtml ,HandlesPillsCustomBlade ,HandlesPillsLocale };
67
78trait HasFilterPills
89{
9- use HandlesFilterPillsAttributes;
10+ use HandlesPillsAsHtml,
11+ HandlesPillsCustomBlade,
12+ HandlesPillsLocale,
13+ HandlesFilterPillsAttributes;
1014
1115 protected ?string $ filterPillTitle = null ;
1216
1317 protected array $ filterPillValues = [];
1418
15- protected ?string $ filterCustomPillBlade = null ;
1619
17- protected bool $ pillsAsHtml = false ;
1820
1921 public function setFilterPillTitle (string $ title ): self
2022 {
@@ -33,12 +35,6 @@ public function setFilterPillValues(array $values): self
3335 return $ this ;
3436 }
3537
36- public function setFilterPillBlade (string $ blade ): self
37- {
38- $ this ->filterCustomPillBlade = $ blade ;
39-
40- return $ this ;
41- }
4238
4339 public function getCustomFilterPillTitle (): ?string
4440 {
@@ -71,41 +67,5 @@ public function getCustomFilterPillValue(string $value): ?string
7167 return $ this ->getCustomFilterPillValues ()[$ value ] ?? null ;
7268 }
7369
74- /**
75- * Determine if filter has a Custom Pill Blade
76- */
77- public function hasCustomPillBlade (): bool
78- {
79- return $ this ->filterCustomPillBlade != null ;
80- }
81-
82- /**
83- * Get the path to the Custom Pill Blade
84- */
85- public function getCustomPillBlade (): ?string
86- {
87- return $ this ->filterCustomPillBlade ;
88- }
89-
90- public function getPillsAreHtml (): bool
91- {
92- return $ this ->pillsAsHtml ?? false ;
93- }
9470
95- public function setPillsAsHtml (bool $ status = true ): self
96- {
97- $ this ->pillsAsHtml = $ status ;
98-
99- return $ this ;
100- }
101-
102- public function setPillsAsHtmlEnabled (): self
103- {
104- return $ this ->setPillsAsHtml (true );
105- }
106-
107- public function setPillsAsHtmlDisabled (): self
108- {
109- return $ this ->setPillsAsHtml (false );
110- }
11171}
0 commit comments