From e85f4a9bf7069a1ba9decf3614617be373e8816a Mon Sep 17 00:00:00 2001 From: RenoLooijmans <73367951+RenoLooijmans@users.noreply.github.com> Date: Tue, 16 Jul 2024 03:24:47 +0200 Subject: [PATCH] Update th.blade.php (#1773) * Update th.blade.php Fix margin styling for Bootstrap 5.x * Update number-range.blade.php Add prefix in addition to suffix. * Update livewire-tables.php --- config/livewire-tables.php | 3 ++- resources/views/components/table/th.blade.php | 6 +++--- .../views/components/tools/filters/number-range.blade.php | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/config/livewire-tables.php b/config/livewire-tables.php index c99a75aef..4cc3dccab 100644 --- a/config/livewire-tables.php +++ b/config/livewire-tables.php @@ -88,6 +88,7 @@ 'minRange' => 0, // The minimum possible value 'maxRange' => 100, // The maximum possible value 'suffix' => '', // A suffix to append to the values when displayed + 'prefix' => '', // A prefix to prepend to the values when displayed ], ], /** @@ -106,7 +107,7 @@ ], /** - * Configuration options for MultiSelectFilter + * Configuration options for MultiSelectDropdownFilter */ 'multiSelectDropdownFilter' => [ 'defaultOptions' => [], diff --git a/resources/views/components/table/th.blade.php b/resources/views/components/table/th.blade.php index ee6333ee6..184f71cd0 100644 --- a/resources/views/components/table/th.blade.php +++ b/resources/views/components/table/th.blade.php @@ -70,11 +70,11 @@ class="d-flex align-items-center" @if ($direction === 'asc') - + @elseif ($direction === 'desc') - + @else - + @endif diff --git a/resources/views/components/tools/filters/number-range.blade.php b/resources/views/components/tools/filters/number-range.blade.php index 8fe85bf06..b04ae3c5a 100644 --- a/resources/views/components/tools/filters/number-range.blade.php +++ b/resources/views/components/tools/filters/number-range.blade.php @@ -2,7 +2,8 @@ $filterKey = $filter->getKey(); $currentMin = $minRange = $filter->getConfig('minRange'); $currentMax = $maxRange = $filter->getConfig('maxRange'); - $suffix = $filter->getConfig('suffix'); + $suffix = $filter->hasConfig('suffix') ? '--suffix:"'. $filter->getConfig('suffix') .'";' : ''; + $prefix = $filter->hasConfig('prefix') ? '--prefix:"'.$filter->getConfig('prefix').'";' : ''; @endphp
@@ -19,7 +20,7 @@ 'range-slider flat' => $isTailwind, 'range-slider flat w-100' => $isBootstrap, ]) - style=' --min:{{ $minRange }}; --max:{{ $maxRange }}; --suffix:"{{ $suffix }}";' + style=' --min:{{ $minRange }}; --max:{{ $maxRange }}; {{ $suffix . $prefix }}' >
- \ No newline at end of file +