Skip to content

Commit

Permalink
Update th.blade.php (#1773)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
RenoLooijmans authored Jul 16, 2024
1 parent 1717da5 commit e85f4a9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion config/livewire-tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
],
],
/**
Expand All @@ -106,7 +107,7 @@
],

/**
* Configuration options for MultiSelectFilter
* Configuration options for MultiSelectDropdownFilter
*/
'multiSelectDropdownFilter' => [
'defaultOptions' => [],
Expand Down
6 changes: 3 additions & 3 deletions resources/views/components/table/th.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ class="d-flex align-items-center"

<span class="relative d-flex align-items-center">
@if ($direction === 'asc')
<x-heroicon-o-chevron-up class="ml-1" style="width:1em;height:1em;" />
<x-heroicon-o-chevron-up class="ms-1" style="width:1em;height:1em;" />
@elseif ($direction === 'desc')
<x-heroicon-o-chevron-down class="ml-1" style="width:1em;height:1em;" />
<x-heroicon-o-chevron-down class="ms-1" style="width:1em;height:1em;" />
@else
<x-heroicon-o-chevron-up-down class="ml-1" style="width:1em;height:1em;" />
<x-heroicon-o-chevron-up-down class="ms-1" style="width:1em;height:1em;" />
@endif
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
<div id="{{ $tableName }}-numberRange-{{ $filterKey }}" x-data="numberRangeFilter($wire,'{{ $filterKey }}', '{{ $tableName }}-numberRange-{{ $filterKey }}-wrapper', @js($filter->getConfigs()), '{{ $tableName }}-numberRange-{{ $filterKey }}')" x-on:mousedown.away.throttle.2000ms="updateWireable" x-on:touchstart.away.throttle.2000ms="updateWireable" x-on:mouseleave.throttle.2000ms="updateWireable">
<x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap />
Expand All @@ -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 }}'
>
<input type="range" min="{{ $minRange }}" max="{{ $maxRange }}" value="{{ $currentMin }}"
id="{{ $tableName }}-numberRange-{{ $filterKey }}-min" x-model='filterMin' x-on:change="updateWire()"
Expand All @@ -34,4 +35,4 @@
<div class='range-slider__progress'></div>
</div>
</div>
</div>
</div>

0 comments on commit e85f4a9

Please sign in to comment.