-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## [v3.4.16] - 2024-08-27 ### New Features - Add icon column by @lrljoe in #1902 - Enable/Disable Tools/Toolbar by @lrljoe in #1896 ### Bug Fixes - Fix has actions by @lrljoe in #1901 - Use Computed Properties By Default by @lrljoe in #1898 ### Tweaks - PHPStan - Config File Update and Baseline by @lrljoe in #1903
- Loading branch information
Showing
32 changed files
with
807 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--- | ||
title: Icon Columns (beta) | ||
weight: 10 | ||
--- | ||
|
||
Icon columns provide a way to display icons in your table without having to use `format()` or partial views. | ||
|
||
### setIcon | ||
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 | ||
```php | ||
IconColumn::make('Icon', 'status') | ||
->setIcon(function ($row, $value) { | ||
if($value == 1) { | ||
return "heroicon-o-check-circle"; | ||
} | ||
else | ||
{ | ||
return "heroicon-o-x-circle"; | ||
} | ||
}), | ||
``` | ||
|
||
### attributes | ||
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. | ||
```php | ||
IconColumn::make('Icon', 'status') | ||
->setIcon(function ($row, $value) { if($value == 1) { return "heroicon-o-check-circle"; } else { return "heroicon-o-x-circle"; } }) | ||
->attributes(function ($row, $value) { | ||
if($value == 1) { | ||
return [ | ||
'class' => 'w-6 h-6', | ||
'stroke' => '#008000' | ||
]; | ||
} | ||
else | ||
{ | ||
return [ | ||
'class' => 'w-3 h-3', | ||
'stroke' => '#FF0000' | ||
]; | ||
} | ||
}), | ||
``` | ||
|
||
For example: | ||
### Example | ||
```php | ||
IconColumn::make('Icon', 'status') | ||
->setIcon(function ($row, $value) { if($value == 1) { return "heroicon-o-check-circle"; } else { return "heroicon-o-x-circle"; } }) | ||
->attributes(function ($row, $value) { | ||
if($value == 3) { | ||
return [ | ||
'class' => 'w-3 h-3', | ||
'stroke' => '#008000' | ||
]; | ||
} | ||
else if($value == 2) { | ||
return [ | ||
'class' => 'w-3 h-3', | ||
'stroke' => '#0000FF' | ||
]; | ||
} | ||
else | ||
{ | ||
return [ | ||
'class' => 'w-3 h-3', | ||
'stroke' => '#FF0000' | ||
]; | ||
} | ||
}), | ||
``` | ||
|
||
Please also see the following for other available methods: | ||
<ul> | ||
<li> | ||
<a href="https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/available-methods">Available Methods</a> | ||
</li> | ||
<li> | ||
<a href="https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/column-selection">Column Selection</a> | ||
</li> | ||
<li> | ||
<a href="https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/secondary-header">Secondary Header</a> | ||
</li> | ||
<li> | ||
<a href="https://rappasoft.com/docs/laravel-livewire-tables/v3/columns/footer">Footer</a> | ||
</li> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
title: Tools | ||
weight: 9 | ||
--- | ||
|
||
The Table offers additional configuration to show/hide the Tools/Toolbar sections: | ||
## Tools | ||
Contains: | ||
- Filter Pills | ||
- Sorting Pills | ||
- The Toolbar | ||
|
||
## Toolbar | ||
Contains: | ||
- Actions (if set to Toolbar) | ||
- Column Select dropdown | ||
- Configurable Areas for Toolbar | ||
- Filters Button/Dropdown/Popover | ||
- Pagination dropdown | ||
- Reorder Button | ||
- Search Input | ||
|
||
## Component Available Methods | ||
|
||
### setToolsEnabled | ||
The Default Behaviour, Tools Are Enabled. But will only be rendered if there are available/enabled elements. If the Toolbar is enabled, this takes into account any Toolbar elements that are present. | ||
```php | ||
public function configure(): void | ||
{ | ||
$this->setToolsEnabled(); | ||
} | ||
``` | ||
|
||
### setToolsDisabled | ||
Disables the Tools section, this includes the Toolbar, and Sort/Filter pills | ||
```php | ||
public function configure(): void | ||
{ | ||
$this->setToolsDisabled(); | ||
} | ||
``` | ||
|
||
### setToolBarEnabled | ||
The Default Behaviour, ToolBar is Enabled. But will only be rendered if there are available/enabled elements | ||
```php | ||
public function configure(): void | ||
{ | ||
$this->setToolBarEnabled(); | ||
} | ||
``` | ||
|
||
### setToolBarDisabled | ||
Disables the Toolbar, which contains the Reorder, Filters, Search, Column Select, Pagination buttons/options. Does not impact the Filter/Sort pills (if enabled) | ||
```php | ||
public function configure(): void | ||
{ | ||
$this->setToolBarDisabled(); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^Offset '1' on array\\<string, non\\-empty\\-array\\<int\\<0, max\\>, mixed\\>\\> in empty\\(\\) does not exist\\.$#" | ||
count: 1 | ||
path: src/DataTableComponent.php | ||
|
||
- | ||
message: "#^Offset '99' on array\\<string, non\\-empty\\-array\\<int\\<0, max\\>, mixed\\>\\> in isset\\(\\) does not exist\\.$#" | ||
count: 1 | ||
path: src/DataTableComponent.php | ||
|
||
- | ||
message: "#^Offset '99' on non\\-empty\\-array\\<1\\|string, array\\<int\\<0, max\\>, mixed\\>\\> in isset\\(\\) does not exist\\.$#" | ||
count: 1 | ||
path: src/DataTableComponent.php | ||
|
||
- | ||
message: "#^Property Illuminate\\\\Database\\\\Query\\\\Builder\\:\\:\\$joins \\(array\\) on left side of \\?\\? is not nullable\\.$#" | ||
count: 1 | ||
path: src/DataTableComponent.php | ||
|
||
- | ||
message: "#^Property Rappasoft\\\\LaravelLivewireTables\\\\DataTableComponent\\:\\:\\$model has no type specified\\.$#" | ||
count: 1 | ||
path: src/DataTableComponent.php | ||
|
||
- | ||
message: "#^Unsafe usage of new static\\(\\)\\.$#" | ||
count: 1 | ||
path: src/Views/Action.php | ||
|
||
- | ||
message: "#^Unsafe usage of new static\\(\\)\\.$#" | ||
count: 1 | ||
path: src/Views/Column.php | ||
|
||
- | ||
message: "#^Unsafe usage of new static\\(\\)\\.$#" | ||
count: 1 | ||
path: src/Views/Filter.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\$callback of method Illuminate\\\\Support\\\\Collection\\<int,string\\>\\:\\:filter\\(\\) expects \\(callable\\(string, int\\)\\: bool\\)\\|null, Closure\\(mixed\\)\\: int\\<0, max\\> given\\.$#" | ||
count: 1 | ||
path: src/Views/Filters/MultiSelectDropdownFilter.php | ||
|
||
- | ||
message: "#^Unable to resolve the template type TMapWithKeysKey in call to method Illuminate\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:mapWithKeys\\(\\)$#" | ||
count: 1 | ||
path: src/Views/Filters/MultiSelectDropdownFilter.php | ||
|
||
- | ||
message: "#^Unable to resolve the template type TMapWithKeysValue in call to method Illuminate\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:mapWithKeys\\(\\)$#" | ||
count: 1 | ||
path: src/Views/Filters/MultiSelectDropdownFilter.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\$callback of method Illuminate\\\\Support\\\\Collection\\<int,string\\>\\:\\:filter\\(\\) expects \\(callable\\(string, int\\)\\: bool\\)\\|null, Closure\\(mixed\\)\\: int\\<0, max\\> given\\.$#" | ||
count: 1 | ||
path: src/Views/Filters/MultiSelectFilter.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\$callback of method Illuminate\\\\Support\\\\Collection\\<int,string\\>\\:\\:filter\\(\\) expects \\(callable\\(string, int\\)\\: bool\\)\\|null, Closure\\(mixed\\)\\: int\\<0, max\\> given\\.$#" | ||
count: 1 | ||
path: src/Views/Filters/NumberRangeFilter.php | ||
|
||
- | ||
message: "#^Unable to resolve the template type TMapWithKeysKey in call to method Illuminate\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:mapWithKeys\\(\\)$#" | ||
count: 1 | ||
path: src/Views/Filters/SelectFilter.php | ||
|
||
- | ||
message: "#^Unable to resolve the template type TMapWithKeysValue in call to method Illuminate\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:mapWithKeys\\(\\)$#" | ||
count: 1 | ||
path: src/Views/Filters/SelectFilter.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class="livewire-tables-columns-icon"> | ||
@svg( | ||
$icon, | ||
$classes, | ||
$attributes, | ||
) | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.