Skip to content

Commit e74d834

Browse files
authored
Merge pull request rappasoft#1787 from rappasoft/development
v3.3.2
2 parents 6fb0016 + fe76d9c commit e74d834

File tree

17 files changed

+734
-284
lines changed

17 files changed

+734
-284
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
All notable changes to `laravel-livewire-tables` will be documented in this file
44

5+
## [v3.3.2] - 2024-07-20
6+
### New Features
7+
- Add a new ViewComponentColumn that runs the construction for a View Component by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1786
8+
- Set Custom Classes for Collapsing Column - Collapse/Expand buttons by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1785
9+
10+
### Bug Fixes
11+
- Fix DateTimeFilter by @RenoLooijmans in https://github.com/rappasoft/laravel-livewire-tables/pull/1784
12+
- Fix AggregateColumn SnakeCase issue by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1777
13+
514
## [v3.3.1] - 2024-07-16
615
### Bug Fixes
716
- Fix NumberRangeFilter initial state when loaded by querystring by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1774
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: View Component Columns
3+
weight: 14
4+
---
5+
6+
View Component columns let you specify a component name and attributes and provide attributes to the View Component. This will render the View Component in it's entirety.
7+
8+
```php
9+
10+
ViewComponentColumn::make('E-mail', 'email')
11+
->component('email')
12+
->attributes(fn ($value, $row, Column $column) => [
13+
'id' => $row->id,
14+
'email' => $value,
15+
]),
16+
```
17+
18+
Please also see the following for other available methods:
19+
<ul>
20+
<li>
21+
<a href="https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/available-methods">Available Methods</a>
22+
</li>
23+
<li>
24+
<a href="https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/column-selection">Column Selection</a>
25+
</li>
26+
<li>
27+
<a href="https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/secondary-header">Secondary Header</a>
28+
</li>
29+
<li>
30+
<a href="https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/footer">Footer</a>
31+
</li>
32+
</ul>

docs/column-types/wire_link_column.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Wire Link Column (beta)
3-
weight: 14
3+
weight: 15
44
---
55

66
WireLink columns provide a way to display Wired Links in your table without having to use `format()` or partial views, with or without a Confirmation Message

docs/datatable/available-methods.md

Lines changed: 2 additions & 278 deletions
Original file line numberDiff line numberDiff line change
@@ -20,283 +20,7 @@ public function configure(): void
2020

2121
## Attributes
2222

23-
### setComponentWrapperAttributes
24-
25-
Set a list of attributes to override on the main wrapper of the component
26-
27-
```php
28-
public function configure(): void
29-
{
30-
$this->setComponentWrapperAttributes([
31-
'id' => 'my-id',
32-
'class' => 'this that',
33-
]);
34-
}
35-
```
36-
37-
### setTableWrapperAttributes
38-
39-
Set a list of attributes to override on the div that wraps the table
40-
41-
```php
42-
public function configure(): void
43-
{
44-
$this->setTableWrapperAttributes([
45-
'id' => 'my-id',
46-
'class' => 'this that',
47-
]);
48-
}
49-
```
50-
51-
By default, this replaces the default classes on the table wrapper, if you would like to keep them, set the default flag to true.
52-
53-
```php
54-
public function configure(): void
55-
{
56-
$this->setTableWrapperAttributes([
57-
'default' => true,
58-
'class' => 'added these classes',
59-
]);
60-
}
61-
```
62-
63-
### setTableAttributes
64-
65-
Set a list of attributes to override on the table element
66-
67-
```php
68-
public function configure(): void
69-
{
70-
$this->setTableAttributes([
71-
'id' => 'my-id',
72-
'class' => 'this that',
73-
]);
74-
}
75-
```
76-
77-
By default, this replaces the default classes on the table, if you would like to keep them, set the default flag to true.
78-
79-
```php
80-
public function configure(): void
81-
{
82-
$this->setTableAttributes([
83-
'default' => true,
84-
'class' => 'added these classes',
85-
]);
86-
}
87-
```
88-
89-
### setTheadAttributes
90-
91-
Set a list of attributes to override on the thead element
92-
93-
```php
94-
public function configure(): void
95-
{
96-
$this->setTheadAttributes([
97-
'id' => 'my-id',
98-
'class' => 'this that',
99-
]);
100-
}
101-
```
102-
103-
By default, this replaces the default classes on the thead, if you would like to keep them, set the default flag to true.
104-
105-
```php
106-
public function configure(): void
107-
{
108-
$this->setTheadAttributes([
109-
'default' => true,
110-
'class' => 'added these classes',
111-
]);
112-
}
113-
```
114-
115-
### setTbodyAttributes
116-
117-
Set a list of attributes to override on the tbody element
118-
119-
```php
120-
public function configure(): void
121-
{
122-
$this->setTbodyAttributes([
123-
'id' => 'my-id',
124-
'class' => 'this that',
125-
]);
126-
}
127-
```
128-
129-
By default, this replaces the default classes on the tbody, if you would like to keep them, set the default flag to true.
130-
131-
```php
132-
public function configure(): void
133-
{
134-
$this->setTbodyAttributes([
135-
'default' => true,
136-
'class' => 'added these classes',
137-
]);
138-
}
139-
```
140-
141-
### setThAttributes
142-
143-
Set a list of attributes to override on the th elements
144-
145-
```php
146-
public function configure(): void
147-
{
148-
// Takes a callback that gives you the current column.
149-
$this->setThAttributes(function(Column $column) {
150-
if ($column->isField('name')) {
151-
return [
152-
'class' => 'bg-green-500',
153-
];
154-
}
155-
156-
return [];
157-
});
158-
}
159-
```
160-
161-
By default, this replaces the default classes on the th, if you would like to keep them, set the default flag to true.
162-
163-
```php
164-
public function configure(): void
165-
{
166-
$this->setThAttributes(function(Column $column) {
167-
if ($column->isField('name')) {
168-
return [
169-
'default' => true,
170-
'class' => 'bg-green-500',
171-
];
172-
}
173-
174-
return ['default' => true];
175-
});
176-
}
177-
```
178-
179-
### setThSortButtonAttributes
180-
181-
Set a list of attributes to override on the th sort button elements
182-
183-
```php
184-
public function configure(): void
185-
{
186-
// Takes a callback that gives you the current column.
187-
$this->setThSortButtonAttributes(function(Column $column) {
188-
if ($column->isField('name')) {
189-
return [
190-
'class' => 'bg-green-500',
191-
];
192-
}
193-
194-
return [];
195-
});
196-
}
197-
```
198-
199-
### setTrAttributes
200-
201-
Set a list of attributes to override on the tr elements
202-
203-
```php
204-
public function configure(): void
205-
{
206-
// Takes a callback that gives you the current row and its index
207-
$this->setTrAttributes(function($row, $index) {
208-
if ($index % 2 === 0) {
209-
return [
210-
'class' => 'bg-gray-200',
211-
];
212-
}
213-
214-
return [];
215-
});
216-
}
217-
```
218-
219-
By default, this replaces the default classes on the tr, if you would like to keep them, set the default flag to true.
220-
221-
```php
222-
public function configure(): void
223-
{
224-
$this->setTrAttributes(function($row, $index) {
225-
if ($index % 2 === 0) {
226-
return [
227-
'default' => true,
228-
'class' => 'bg-gray-200',
229-
];
230-
}
231-
232-
return ['default' => true];
233-
});
234-
}
235-
```
236-
237-
### setTdAttributes
238-
239-
Set a list of attributes to override on the td elements
240-
241-
```php
242-
public function configure(): void
243-
{
244-
// Takes a callback that gives you the current column, row, column index, and row index
245-
$this->setTdAttributes(function(Column $column, $row, $columnIndex, $rowIndex) {
246-
if ($column->isField('total') && $row->total < 1000) {
247-
return [
248-
'class' => 'bg-red-500 text-white',
249-
];
250-
}
251-
252-
return [];
253-
});
254-
}
255-
```
256-
257-
By default, this replaces the default classes on the td, if you would like to keep them, set the default flag to true.
258-
259-
```php
260-
public function configure(): void
261-
{
262-
// Takes a callback that gives you the current column, row, column index, and row index
263-
$this->setTdAttributes(function(Column $column, $row, $columnIndex, $rowIndex) {
264-
if ($column->isField('total') && $row->total < 1000) {
265-
return [
266-
'default' => true,
267-
'class' => 'bg-red-500 text-white',
268-
];
269-
}
270-
271-
return ['default' => true];
272-
});
273-
}
274-
275-
```
276-
### setSearchFieldAttributes
277-
278-
Set a list of attributes to override on the search field
279-
280-
```php
281-
public function configure(): void
282-
{
283-
$this->setSearchFieldAttributes([
284-
'class' => 'this that',
285-
]);
286-
}
287-
```
288-
289-
By default, this replaces the default classes on the search field, if you would like to keep them, set the default flag to true.
290-
291-
```php
292-
public function configure(): void
293-
{
294-
$this->setSearchFieldAttributes([
295-
'default' => true,
296-
'class' => 'added these classes',
297-
]);
298-
}
299-
```
23+
Documentation for Data Table Styling/Attributes is now: <a href="https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/styling" aria-label="Documentation for Data Table Styling" >Here</a>
30024

30125
## Offline
30226

@@ -461,4 +185,4 @@ public function configure(): void
461185
{
462186
$this->setEmptyMessage('No results found');
463187
}
464-
```
188+
```

0 commit comments

Comments
 (0)