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: docs/filters/filter-pills.md
+65-18Lines changed: 65 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,9 +52,9 @@ public function configure(): void
52
52
---
53
53
54
54
### setFilterPillsItemAttributes
55
-
Allows for customisation of the appearance of the "Filter Pills Item"
55
+
Allows for customisation of the appearance of each "Filter Pills Item"
56
56
57
-
Note that this utilises a refreshed approach for attributes, and allows for appending to, or replacing the styles and colors independently, via the below methods.
57
+
Note that this allows for appending to, or replacing the styles and colors independently, via the below methods.
58
58
59
59
#### default-colors
60
60
Setting to false will disable the default colors for the Filter Pills Item, the default colors are:
Setting to false will disable the default text styling for the Filter Pills Item, the default text styling is:
77
+
78
+
Bootstrap 4: none
79
+
80
+
Bootstrap 5: none
81
+
82
+
Tailwind: `text-xs font-medium capitalize`
83
+
84
+
Note that colors are handled via default-colours
85
+
74
86
75
87
```php
76
88
public function configure(): void
@@ -88,7 +100,7 @@ public function configure(): void
88
100
### setFilterPillsResetFilterButtonAttributes
89
101
Allows for customisation of the appearance of the "Filter Pills Reset Filter Button"
90
102
91
-
Note that this utilises a refreshed approach for attributes, and allows for appending to, or replacing the styles and colors independently, via the below methods.
103
+
Note that this utilises allows for appending to, or replacing the styles and colors independently, via the below methods.
92
104
93
105
#### default-colors
94
106
Setting to false will disable the default colors for the Filter Pills Reset Filter Button, the default colors are:
@@ -120,7 +132,7 @@ public function configure(): void
120
132
### setFilterPillsResetAllButtonAttributes
121
133
Allows for customisation of the appearance of the "Filter Pills Reset All Button"
122
134
123
-
Note that this utilises a refreshed approach for attributes, and allows for appending to, or replacing the styles and colors independently, via the below methods.
135
+
Note that this allows for appending to, or replacing the styles and colors independently, via the below methods.
124
136
125
137
#### default-colors
126
138
Setting to false will disable the default colors for the Filter Pills Reset All Button, the default colors are:
@@ -198,7 +210,10 @@ SelectFilter::make('Active')
198
210
199
211
### setFilterPillBlade
200
212
201
-
Set a blade file for use in displaying the filter values in the pills area. You can use this in conjunction with setFilterPillValues() to prettify your applied filter values display. You will receive two properties ($filter) containing the filter instance, and ($value) containing the filter value.
213
+
Set a blade file for use in displaying the filter values in the pills area. You can use this in conjunction with setFilterPillValues() to prettify your applied filter values display. You will receive two properties:
214
+
- $filter which contains the filter instance
215
+
- $filterPillData which contains an instance of "Rappasoft\LaravelLivewireTables\DataTransferObjects\Filters\FilterPillData"
216
+
This provides ready access to configured pills elements
@@ -230,7 +258,7 @@ This may be used in conjunction with, or instead of the setFilterPillsItemAttrib
230
258
231
259
Note that if used, this will **replace** any matching array keys defined in the setFilterPillsItemAttributes method.
232
260
233
-
Note that this utilises a refreshed approach for attributes, and allows for appending to, or replacing the styles and colors independently
261
+
Note that this allows for appending to, or replacing the styles and colors independently
234
262
235
263
#### default-colors
236
264
Setting to false will disable the default colors for this Filter's Pills Item, the default colors are:
@@ -265,4 +293,23 @@ SelectFilter::make('Active')
265
293
'default-colors' => false, // Replace the default colors classes
266
294
'default-styling' => true // Use the default styling classes
267
295
])
296
+
```
297
+
298
+
### setPillResetButtonAttributes
299
+
300
+
This method allows for customisation of the filter's reset button within the Pills. This will merge/over-ride anything set in the Component setFilterPillsResetFilterButtonAttributes() method.
301
+
302
+
```php
303
+
SelectFilter::make('Active')
304
+
->options([
305
+
'' => 'All',
306
+
'1' => 'Yes',
307
+
'0' => 'No',
308
+
])
309
+
->setFilterPillTitle('User Status')
310
+
->setPillResetButtonAttributes([
311
+
'class' => 'bg-red-500 text-cyan-500',
312
+
'default-colors' => false, // Replace the default colors classes
313
+
'default-styling' => true // Use the default styling classes
0 commit comments