Skip to content

Commit c576c28

Browse files
authored
v3.4.16 (rappasoft#1897)
## [v3.4.16] - 2024-08-27 ### New Features - Add icon column by @lrljoe in rappasoft#1902 - Enable/Disable Tools/Toolbar by @lrljoe in rappasoft#1896 ### Bug Fixes - Fix has actions by @lrljoe in rappasoft#1901 - Use Computed Properties By Default by @lrljoe in rappasoft#1898 ### Tweaks - PHPStan - Config File Update and Baseline by @lrljoe in rappasoft#1903
1 parent d140f39 commit c576c28

32 files changed

+807
-42
lines changed

CHANGELOG.md

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

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

5+
## [v3.4.16] - 2024-08-27
6+
### New Features
7+
- Add icon column by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1902
8+
- Enable/Disable Tools/Toolbar by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1896
9+
10+
### Bug Fixes
11+
- Fix has actions by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1901
12+
- Use Computed Properties By Default by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1898
13+
14+
### Tweaks
15+
- PHPStan - Config File Update and Baseline by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1903
16+
517
## [v3.4.15] - 2024-08-25
618
### New Features
719
- BooleanColumn - Toggleable Callback by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1892
Binary file not shown.

docs/column-types/icon_column.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: Icon Columns (beta)
3+
weight: 10
4+
---
5+
6+
Icon columns provide a way to display icons in your table without having to use `format()` or partial views.
7+
8+
### setIcon
9+
setIcon requires a valid path to an SVG (Directly or via a Library), it receives the $row, and $value (if available) to help you customise which icon to use
10+
```php
11+
IconColumn::make('Icon', 'status')
12+
->setIcon(function ($row, $value) {
13+
if($value == 1) {
14+
return "heroicon-o-check-circle";
15+
}
16+
else
17+
{
18+
return "heroicon-o-x-circle";
19+
}
20+
}),
21+
```
22+
23+
### attributes
24+
Attributes receives the $row, and $value (if available) to help you customise which attributes to apply, you may pass both classes, and other SVG specific attributes.
25+
```php
26+
IconColumn::make('Icon', 'status')
27+
->setIcon(function ($row, $value) { if($value == 1) { return "heroicon-o-check-circle"; } else { return "heroicon-o-x-circle"; } })
28+
->attributes(function ($row, $value) {
29+
if($value == 1) {
30+
return [
31+
'class' => 'w-6 h-6',
32+
'stroke' => '#008000'
33+
];
34+
}
35+
else
36+
{
37+
return [
38+
'class' => 'w-3 h-3',
39+
'stroke' => '#FF0000'
40+
];
41+
}
42+
}),
43+
```
44+
45+
For example:
46+
### Example
47+
```php
48+
IconColumn::make('Icon', 'status')
49+
->setIcon(function ($row, $value) { if($value == 1) { return "heroicon-o-check-circle"; } else { return "heroicon-o-x-circle"; } })
50+
->attributes(function ($row, $value) {
51+
if($value == 3) {
52+
return [
53+
'class' => 'w-3 h-3',
54+
'stroke' => '#008000'
55+
];
56+
}
57+
else if($value == 2) {
58+
return [
59+
'class' => 'w-3 h-3',
60+
'stroke' => '#0000FF'
61+
];
62+
}
63+
else
64+
{
65+
return [
66+
'class' => 'w-3 h-3',
67+
'stroke' => '#FF0000'
68+
];
69+
}
70+
}),
71+
```
72+
73+
Please also see the following for other available methods:
74+
<ul>
75+
<li>
76+
<a href="https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/available-methods">Available Methods</a>
77+
</li>
78+
<li>
79+
<a href="https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/column-selection">Column Selection</a>
80+
</li>
81+
<li>
82+
<a href="https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/secondary-header">Secondary Header</a>
83+
</li>
84+
<li>
85+
<a href="https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/footer">Footer</a>
86+
</li>
87+
</ul>

docs/column-types/image_columns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Image Columns
3-
weight: 10
3+
weight: 11
44
---
55

66
Image columns provide a way to display images in your table without having to use `format()` or partial views:

docs/column-types/link_columns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Link Columns
3-
weight: 11
3+
weight: 12
44
---
55

66
Link columns provide a way to display HTML links in your table without having to use `format()` or partial views:

docs/column-types/livewire_component_column.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Livewire Component (beta)
3-
weight: 12
3+
weight: 13
44
---
55

66
Livewire Component Columns allow for the use of a Livewire Component as a Column.

docs/column-types/sum_column.md

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

66
Sum columns provide an easy way to display the "Sum" of a field on a relation.

docs/column-types/view_component_column.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: View Component Columns
3-
weight: 14
3+
weight: 15
44
---
55

66
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.

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: 15
3+
weight: 16
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/columns/other-column-types.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ weight: 4
2828
<li>
2929
<a href="https://rappasoft.com/docs/laravel-livewire-tables/v3/column-types/date_columns">Date Columns</a>
3030
</li>
31+
<li>
32+
[Icon Columns (Beta)](../column-types/icon_columns)
33+
</li>
3134
<li>
3235
<a href="https://rappasoft.com/docs/laravel-livewire-tables/v3/column-types/image_columns">Image Columns</a>
3336
</li>

0 commit comments

Comments
 (0)