class(['h-6 w-6 rounded-md self-center' => $attributeBag['default'] ?? (empty($attributeBag['class']) || (!empty($attributeBag['class']) && ($attributeBag['default'] ?? false)))]) }}
+
class([
+ 'h-6 w-6 rounded-md self-center' => $isTailwind && ($attributeBag['default'] ?? (empty($attributeBag['class']) || (!empty($attributeBag['class']) && ($attributeBag['default'] ?? false)))),
+
+ ]) }}
@style([
"background-color: {$color}" => $color,
])
diff --git a/src/Views/Columns/ColorColumn.php b/src/Views/Columns/ColorColumn.php
index 02b87a3fa..2899a09fb 100644
--- a/src/Views/Columns/ColorColumn.php
+++ b/src/Views/Columns/ColorColumn.php
@@ -35,14 +35,14 @@ public function __construct(string $title, ?string $from = null)
public function getContents(Model $row): null|string|\Illuminate\Support\HtmlString|DataTableConfigurationException|\Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
{
return view($this->getView())
+ ->withIsTailwind($this->getComponent()->isTailwind())
+ ->withIsBootstrap($this->getComponent()->isBootstrap())
->withColor($this->getColor($row))
->withAttributeBag($this->getAttributeBag($row));
}
public function getValue(Model $row)
{
- $value = parent::getValue($row);
-
- return ! is_null($value) ? $value : $this->getDefaultValue();
+ return parent::getValue($row) ?? $this->getDefaultValue();
}
}
From b02a235762fc6115d18c656f58a5921b7e6c5e26 Mon Sep 17 00:00:00 2001
From: Joe <104938042+lrljoe@users.noreply.github.com>
Date: Sat, 9 Dec 2023 23:36:01 +0000
Subject: [PATCH 21/22] Update Changelog
---
CHANGELOG.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b1671ee9d..5f3355d2d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,9 +4,9 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
## UNRELEASED
### New Features
-- Add capability to use as a Full Page Component
-- Add DateColumn
-- Add ColorColumn
+- Add capability to use as a Full Page Component by @amshehzad and @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1580
+- Add DateColumn by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1589
+- Add ColorColumn by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1590
### Tweaks
- Internal - modify GitHub workflows to improve caching, but use unique caches per workflow matrix
From a45c6c06d86ee09c8f2ca675bc64dc646a87907d Mon Sep 17 00:00:00 2001
From: Joe <104938042+lrljoe@users.noreply.github.com>
Date: Sat, 9 Dec 2023 23:37:53 +0000
Subject: [PATCH 22/22] Add reference to tidying classes/traits
---
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5f3355d2d..bc2842a41 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
- Internal - modify GitHub workflows to improve caching, but use unique caches per workflow matrix
- Internal - remove superfluous PHPStan ignoreErrors
- Internal - update Test Suite to also test at PHP 8.3
+- Internal - tidying Classes & Traits by @lrljoe
- Docs - Update Anonymous Column documents to reference ability to use strings as well as views
## [v3.1.4] - 2023-12-04