Skip to content

Commit 4a67838

Browse files
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
1 parent 9593691 commit 4a67838

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

resources/views/components/inline-filters.blade.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,13 @@ class="{{ $tdClasses }}"
4040
$filterClass = str(data_get($column, 'filters.className'));
4141
@endphp
4242
<td
43-
class="{{ data_get($theme, 'table.tdBodyClass') }}"
43+
@class([data_get($theme, 'table.tdBodyClass'), data_get($theme, 'table.tdFiltersClass')])
4444
wire:key="column-filter-{{ data_get($column, 'field') }}"
45-
style="{{ data_get($column, 'hidden') === true ? 'display:none' : '' }}; {{ data_get($theme, 'table.tdBodyStyle') }}"
45+
@style([
46+
'display:none' => data_get($column, 'hidden') === true,
47+
data_get($theme, 'table.tdBodyStyle'),
48+
data_get($theme, 'table.tdFiltersStyle')
49+
])
4650
>
4751
<div wire:key="filter-{{ data_get($column, 'field') }}-{{ $loop->index }}">
4852
@if ($filterClass->contains('FilterMultiSelect'))

resources/views/components/table/th-empty.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class="{{ data_get($theme, 'table.trBodyClass') }}"
55
<th
66
class="{{ data_get($theme, 'table.tdBodyEmptyClass') }}"
77
style="{{ data_get($theme, 'table.tdBodyEmptyStyle') }}"
8-
colspan="{{ ($checkbox ? 1 : 0) + count($columns) + (data_get($setUp, 'detail.showCollapseIcon') ? 1 : 0) }}"
8+
colspan="999"
99
>
1010
{!! $this->processNoDataLabel() !!}
1111
</th>

src/PowerGridComponent.php

+7
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@ private function getTheme(): array
188188
{
189189
$class = $this->template() ?? powerGridTheme();
190190

191+
if (app()->hasDebugModeEnabled()) {
192+
/** @var ThemeBase $themeBase */
193+
$themeBase = PowerGrid::theme($class);
194+
195+
return convertObjectsToArray((array) $themeBase->apply());
196+
}
197+
191198
return Cache::rememberForever('powerGridTheme_' . $class, function () use ($class) {
192199
/** @var ThemeBase $themeBase */
193200
$themeBase = PowerGrid::theme($class);

src/Themes/Tailwind.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ public function table(): Table
3333
->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')
3434
->tbody('text-pg-primary-800')
3535
->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')
36-
->tdBody('px-3 py-2 whitespace-nowrap dark:text-pg-primary-200')
37-
->tdBodyEmpty('px-3 py-2 whitespace-nowrap dark:text-pg-primary-200')
36+
->tdBody('p-2 whitespace-nowrap dark:text-pg-primary-200')
37+
->tdBodyEmpty('p-2 whitespace-nowrap dark:text-pg-primary-200')
3838
->trBodyClassTotalColumns('')
39-
->tdBodyTotalColumns('px-3 py-2 whitespace-nowrap dark:text-pg-primary-200 text-sm text-pg-primary-600 text-right space-y-2');
39+
->tdBodyTotalColumns('p-2 whitespace-nowrap dark:text-pg-primary-200 text-sm text-pg-primary-600 text-right space-y-2');
4040
}
4141

4242
public function footer(): Footer

0 commit comments

Comments
 (0)