-
-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## [v3.5.1] - 2024-11-09 ### Bug Fixes - Fix NumberFilter bug for string values by @lrljoe in #2034 - Fixes for Filter Pills - Split blades, and ensure invalid filter alues are removed by @lrljoe in #2035
- Loading branch information
Showing
13 changed files
with
165 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
resources/views/components/tools/filter-pills/buttons/reset-all.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@aware(['isTailwind','isBootstrap','isBootstrap4','isBootstrap5']) | ||
@if ($isTailwind) | ||
<button | ||
wire:click.prevent="setFilterDefaults" | ||
@class([ | ||
"focus:outline-none active:outline-none" | ||
])> | ||
<span @class([ | ||
"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium", | ||
"bg-gray-100 text-gray-800 dark:bg-gray-200 dark:text-gray-900" | ||
])> | ||
@lang('livewire-tables::Clear') | ||
</span> | ||
</button> | ||
@else | ||
<a | ||
href="#" | ||
wire:click.prevent="setFilterDefaults" | ||
@class([ | ||
'badge badge-pill badge-light' => $isBootstrap4, | ||
'badge rounded-pill bg-light text-dark text-decoration-none' => $isBootstrap5, | ||
])> | ||
@lang('livewire-tables::Clear') | ||
</a> | ||
@endif |
31 changes: 31 additions & 0 deletions
31
resources/views/components/tools/filter-pills/buttons/reset-filter.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@aware(['tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5']) | ||
@props(['filterKey']) | ||
@if ($isTailwind) | ||
<button | ||
wire:click="resetFilter('{{ $filterKey }}')" | ||
type="button" | ||
@class([ | ||
"flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center focus:outline-none", | ||
"text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:bg-indigo-500 focus:text-white", | ||
]) | ||
> | ||
<span class="sr-only">@lang('livewire-tables::Remove filter option')</span> | ||
<x-heroicon-m-x-mark class="h-full" /> | ||
</button> | ||
@else | ||
<a | ||
href="#" | ||
wire:click="resetFilter('{{ $filterKey }}')" | ||
@class([ | ||
'text-white ml-2' => ($isBootstrap), | ||
]) | ||
> | ||
<span @class([ | ||
'sr-only' => $isBootstrap4, | ||
'visually-hidden' => $isBootstrap5, | ||
])> | ||
@lang('livewire-tables::Remove filter option') | ||
</span> | ||
<x-heroicon-m-x-mark class="laravel-livewire-tables-btn-tiny" /> | ||
</a> | ||
@endif |
23 changes: 23 additions & 0 deletions
23
resources/views/components/tools/filter-pills/item.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@aware(['tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5']) | ||
@props(['filterPillTitle', 'filterPillValue', 'filterSelectName', 'separator']) | ||
<span | ||
wire:key="{{ $tableName }}-filter-pill-{{ $filterSelectName }}" | ||
@class([ | ||
'inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium leading-4 bg-indigo-100 text-indigo-800 capitalize dark:bg-indigo-200 dark:text-indigo-900' => $isTailwind, | ||
'badge badge-pill badge-info d-inline-flex align-items-center' => $isBootstrap4, | ||
'badge rounded-pill bg-info d-inline-flex align-items-center' => $isBootstrap5, | ||
]) | ||
> | ||
{{ $filterPillTitle }}: | ||
|
||
@if(is_array($filterPillValue)) | ||
@foreach($filterPillValue as $filterPillArrayValue) | ||
{{ $filterPillArrayValue }}{!! !$loop->last ? $separator : '' !!} | ||
@endforeach | ||
@else | ||
{{ $filterPillValue }} | ||
@endif | ||
|
||
<x-livewire-tables::tools.filter-pills.buttons.reset-filter :filterKey="$filterSelectName" /> | ||
|
||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Rappasoft\LaravelLivewireTables\Views\Traits\Filters; | ||
|
||
use Closure; | ||
use Illuminate\View\ComponentAttributeBag; | ||
use Rappasoft\LaravelLivewireTables\Views\{Column,Filter}; | ||
|
||
trait IsNumericFilter | ||
{ | ||
public function isEmpty(float|int|string|array|null $value): bool | ||
{ | ||
return ! is_null($value) ? ($this->validate($value) == false) : true; | ||
} | ||
|
||
/** | ||
* Gets the Default Value for this Filter via the Component | ||
*/ | ||
public function getFilterDefaultValue(): ?string | ||
{ | ||
return $this->filterDefaultValue ?? null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.