From 4a67838da8213e39a85a32ba6892c8d2e45c5033 Mon Sep 17 00:00:00 2001
From: Luan Freitas <33601626+luanfreitasdev@users.noreply.github.com>
Date: Mon, 27 May 2024 13:41:49 -0300
Subject: [PATCH] Fix missing td action class for inline filters (#1575)
* enable realtime update when debug has enable
* Fix missing tdFilters classes
* remove unnecessary count colspan
* fix phpstan
---
resources/views/components/inline-filters.blade.php | 8 ++++++--
resources/views/components/table/th-empty.blade.php | 2 +-
src/PowerGridComponent.php | 7 +++++++
src/Themes/Tailwind.php | 6 +++---
4 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/resources/views/components/inline-filters.blade.php b/resources/views/components/inline-filters.blade.php
index 7da2e7774..e3b8c5a47 100644
--- a/resources/views/components/inline-filters.blade.php
+++ b/resources/views/components/inline-filters.blade.php
@@ -40,9 +40,13 @@ class="{{ $tdClasses }}"
$filterClass = str(data_get($column, 'filters.className'));
@endphp
data_get($column, 'hidden') === true,
+ data_get($theme, 'table.tdBodyStyle'),
+ data_get($theme, 'table.tdFiltersStyle')
+ ])
>
@if ($filterClass->contains('FilterMultiSelect'))
diff --git a/resources/views/components/table/th-empty.blade.php b/resources/views/components/table/th-empty.blade.php
index 53a8bbd19..e18b571c2 100644
--- a/resources/views/components/table/th-empty.blade.php
+++ b/resources/views/components/table/th-empty.blade.php
@@ -5,7 +5,7 @@ class="{{ data_get($theme, 'table.trBodyClass') }}"
|
{!! $this->processNoDataLabel() !!}
|
diff --git a/src/PowerGridComponent.php b/src/PowerGridComponent.php
index b6fda4089..b3a577ef4 100644
--- a/src/PowerGridComponent.php
+++ b/src/PowerGridComponent.php
@@ -188,6 +188,13 @@ private function getTheme(): array
{
$class = $this->template() ?? powerGridTheme();
+ if (app()->hasDebugModeEnabled()) {
+ /** @var ThemeBase $themeBase */
+ $themeBase = PowerGrid::theme($class);
+
+ return convertObjectsToArray((array) $themeBase->apply());
+ }
+
return Cache::rememberForever('powerGridTheme_' . $class, function () use ($class) {
/** @var ThemeBase $themeBase */
$themeBase = PowerGrid::theme($class);
diff --git a/src/Themes/Tailwind.php b/src/Themes/Tailwind.php
index 9db0d71ea..386bed9e4 100644
--- a/src/Themes/Tailwind.php
+++ b/src/Themes/Tailwind.php
@@ -33,10 +33,10 @@ public function table(): Table
->th('font-extrabold px-2 pr-4 py-3 text-left text-xs text-pg-primary-700 tracking-wider whitespace-nowrap dark:text-pg-primary-300')
->tbody('text-pg-primary-800')
->trBody('border-b border-pg-primary-100 dark:border-pg-primary-600 hover:bg-pg-primary-50 dark:bg-pg-primary-800 dark:hover:bg-pg-primary-700')
- ->tdBody('px-3 py-2 whitespace-nowrap dark:text-pg-primary-200')
- ->tdBodyEmpty('px-3 py-2 whitespace-nowrap dark:text-pg-primary-200')
+ ->tdBody('p-2 whitespace-nowrap dark:text-pg-primary-200')
+ ->tdBodyEmpty('p-2 whitespace-nowrap dark:text-pg-primary-200')
->trBodyClassTotalColumns('')
- ->tdBodyTotalColumns('px-3 py-2 whitespace-nowrap dark:text-pg-primary-200 text-sm text-pg-primary-600 text-right space-y-2');
+ ->tdBodyTotalColumns('p-2 whitespace-nowrap dark:text-pg-primary-200 text-sm text-pg-primary-600 text-right space-y-2');
}
public function footer(): Footer