From 30d65ac20b5b6d035f13bf2785134da13e3de043 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Fri, 16 Aug 2024 07:59:25 +0100 Subject: [PATCH 001/118] Add explanation of setRefreshMethod (#1857) --- docs/misc/refreshing.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/misc/refreshing.md b/docs/misc/refreshing.md index e318bfdc7..5e07f69b6 100644 --- a/docs/misc/refreshing.md +++ b/docs/misc/refreshing.md @@ -42,11 +42,16 @@ public function configure(): void ## setRefreshMethod -Fire a specific action when polling. +Fire a specific action when polling. This is only necessary when you wish to call additional actions on each refresh. You must have a public function with the same name as the refresh method. ```php public function configure(): void { - $this->setRefreshMethod('refresh'); + $this->setRefreshMethod('refreshTable'); +} + +public function refreshTable() +{ + // Custom Code Here } ``` From b3137d95e5d5bb7c7f5c60e587567d6960d55d6e Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sat, 17 Aug 2024 23:23:27 +0100 Subject: [PATCH 002/118] Unlocking Entangled Items (#1859) * Unlock properties locked in error --------- Co-authored-by: lrljoe --- CHANGELOG.md | 4 ++++ src/Traits/WithBulkActions.php | 4 ++++ src/Traits/WithFilters.php | 4 +++- src/Traits/WithPagination.php | 3 +++ src/Traits/WithReordering.php | 5 +++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5957e1bac..55abcde31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `laravel-livewire-tables` will be documented in this file +## [v3.4.7] - 2024-08-18 +### Bug Fixes +- Correct a locked property that is entangled in js, and add comments around some key properties to prevent reoccurrence by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1859 + ## [v3.4.6] - 2024-08-15 ### New Features - Column Features - deselectedIf/selectedIf by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1846 diff --git a/src/Traits/WithBulkActions.php b/src/Traits/WithBulkActions.php index f7121cf2d..c36b87bb4 100644 --- a/src/Traits/WithBulkActions.php +++ b/src/Traits/WithBulkActions.php @@ -12,14 +12,17 @@ trait WithBulkActions public bool $bulkActionsStatus = true; + // Entangled in JS public bool $selectAll = false; public array $bulkActions = []; public array $bulkActionConfirms = []; + // Entangled in JS public array $selected = []; + // Entangled in JS public bool $hideBulkActionsWhenEmpty = false; public ?string $bulkActionConfirmDefaultMessage; @@ -46,6 +49,7 @@ trait WithBulkActions protected array $bulkActionsMenuItemAttributes = ['default-colors' => true, 'default-styling' => true]; + // Entangled in JS public bool $delaySelectAll = false; public function bulkActions(): array diff --git a/src/Traits/WithFilters.php b/src/Traits/WithFilters.php index 1499fa1d0..d843f2a71 100644 --- a/src/Traits/WithFilters.php +++ b/src/Traits/WithFilters.php @@ -22,7 +22,7 @@ trait WithFilters #[Locked] public bool $filterPillsStatus = true; - #[Locked] + // Entangled in JS public bool $filterSlideDownDefaultVisible = false; #[Locked] @@ -31,8 +31,10 @@ trait WithFilters #[Locked] public int $filterCount; + // Set in JS public array $filterComponents = []; + // Set in Frontend public array $appliedFilters = []; public array $filterGenericData = []; diff --git a/src/Traits/WithPagination.php b/src/Traits/WithPagination.php index 28be97ee5..571c2b76c 100644 --- a/src/Traits/WithPagination.php +++ b/src/Traits/WithPagination.php @@ -32,10 +32,13 @@ trait WithPagination #[Locked] public bool $perPageVisibilityStatus = true; + // Entangled in JS public array $paginationCurrentItems = []; + // Entangled in JS public int $paginationCurrentCount = 0; + // Entangled in JS public ?int $paginationTotalItemCount = null; public array $numberOfPaginatorsRendered = []; diff --git a/src/Traits/WithReordering.php b/src/Traits/WithReordering.php index f9e833e4b..2251fe2c4 100644 --- a/src/Traits/WithReordering.php +++ b/src/Traits/WithReordering.php @@ -11,14 +11,19 @@ trait WithReordering use ReorderingConfiguration, ReorderingHelpers; + // Entangled in JS public bool $reorderStatus = false; + // Entangled in JS public bool $currentlyReorderingStatus = false; + // Entangled in JS public bool $hideReorderColumnUnlessReorderingStatus = false; + // Entangled in JS public bool $reorderDisplayColumn = false; + // Retrieved in JS public string $defaultReorderColumn = 'sort'; public array $orderedItems = []; From b6890e920324c7366533b346d14d3c3323bdfb26 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 18 Aug 2024 03:10:38 +0100 Subject: [PATCH 003/118] Add dispatch on updated filter components (#1861) * Add additional dispatch * Add FilterApplied Event * Add Filter Event Dispatch Tests --------- Co-authored-by: lrljoe --- CHANGELOG.md | 4 ++++ src/Traits/WithFilters.php | 5 +++++ tests/Traits/Visuals/FilterVisualsTest.php | 14 ++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55abcde31..5843df9ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `laravel-livewire-tables` will be documented in this file +## UNRELEASED +### New Features +- Add an event dispatch for Filter Was Set when filterComponents is updated by @lrljoe + ## [v3.4.7] - 2024-08-18 ### Bug Fixes - Correct a locked property that is entangled in js, and add comments around some key properties to prevent reoccurrence by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1859 diff --git a/src/Traits/WithFilters.php b/src/Traits/WithFilters.php index d843f2a71..49c91da8c 100644 --- a/src/Traits/WithFilters.php +++ b/src/Traits/WithFilters.php @@ -5,6 +5,7 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Support\Collection; use Livewire\Attributes\Locked; +use Rappasoft\LaravelLivewireTables\Events\FilterApplied; use Rappasoft\LaravelLivewireTables\Traits\Configuration\FilterConfiguration; use Rappasoft\LaravelLivewireTables\Traits\Helpers\FilterHelpers; @@ -103,6 +104,10 @@ public function updatedFilterComponents(string|array|null $value, string $filter } elseif ($filter) { $this->callHook('filterUpdated', ['filter' => $filter->getKey(), 'value' => $value]); $this->callTraitHook('filterUpdated', ['filter' => $filter->getKey(), 'value' => $value]); + if ($this->getEventStatusFilterApplied() && $filter->getKey() != null && $value != null) { + event(new FilterApplied($this->getTableName(), $filter->getKey(), $value)); + } + $this->dispatch('filter-was-set', tableName: $this->getTableName(), filterKey: $filter->getKey(), value: $value); } } diff --git a/tests/Traits/Visuals/FilterVisualsTest.php b/tests/Traits/Visuals/FilterVisualsTest.php index 221ee7836..5b34da945 100644 --- a/tests/Traits/Visuals/FilterVisualsTest.php +++ b/tests/Traits/Visuals/FilterVisualsTest.php @@ -49,6 +49,20 @@ public function test_filter_pills_show_when_enabled(): void ->assertSee('Applied Filters'); } + public function test_event_dispatched_when_filterComponents_set(): void + { + Livewire::test(PetsTable::class) + ->set('filterComponents.breed', [1]) + ->assertDispatched('filter-was-set'); + } + + public function test_event_dispatched_when_setFilter_dispatched(): void + { + Livewire::test(PetsTable::class) + ->dispatch('setFilter', filterKey: 'breed', value: [1]) + ->assertDispatched('filter-was-set'); + } + public function test_filter_pills_show_when_visible(): void { Livewire::test(PetsTable::class) From fb646a54fe929aa76ff44caa76b7470923ded6aa Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 18 Aug 2024 03:12:50 +0100 Subject: [PATCH 004/118] v3.4.8 --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5843df9ce..7f47783c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,9 @@ All notable changes to `laravel-livewire-tables` will be documented in this file -## UNRELEASED +## [v3.4.8] - 2024-08-18 ### New Features -- Add an event dispatch for Filter Was Set when filterComponents is updated by @lrljoe +- Add an event dispatch for Filter Was Set when filterComponents is updated by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1861 ## [v3.4.7] - 2024-08-18 ### Bug Fixes From 8eafffe945c0af2a2f2333e162d3bb4f253a48c6 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 21 Aug 2024 22:38:15 +0100 Subject: [PATCH 005/118] Fix superfluous bulk actions tr < (#1868) --- resources/views/components/table/tr/bulk-actions.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/components/table/tr/bulk-actions.blade.php b/resources/views/components/table/tr/bulk-actions.blade.php index 7c7815b91..73201debf 100644 --- a/resources/views/components/table/tr/bulk-actions.blade.php +++ b/resources/views/components/table/tr/bulk-actions.blade.php @@ -97,7 +97,7 @@ class="btn btn-primary btn-sm" - < diff --git a/resources/views/components/tools/filters/multi-select.blade.php b/resources/views/components/tools/filters/multi-select.blade.php index e09772b19..4b8f11a4e 100644 --- a/resources/views/components/tools/filters/multi-select.blade.php +++ b/resources/views/components/tools/filters/multi-select.blade.php @@ -15,7 +15,7 @@ class="text-indigo-600 rounded border-gray-300 shadow-sm transition duration-150 @if ($filter->getFirstOption() != "") {{ $filter->getFirstOption() }} @else - @lang('livewire-tables::All') + {{ __('livewire-tables::core.All') }} @endif @@ -42,7 +42,7 @@ class="text-indigo-600 rounded border-gray-300 shadow-sm transition duration-150 wire:input="selectAllFilterOptions('{{ $filter->getKey() }}')" class="form-check-input" > - + @foreach($filter->getOptions() as $key => $value) diff --git a/resources/views/components/tools/sorting-pills.blade.php b/resources/views/components/tools/sorting-pills.blade.php index b633cf1d8..f84391319 100644 --- a/resources/views/components/tools/sorting-pills.blade.php +++ b/resources/views/components/tools/sorting-pills.blade.php @@ -4,7 +4,7 @@
@if ($this->sortingPillsAreEnabled() && $this->hasSorts())
- @lang('livewire-tables::Applied Sorting'): + {{ __('livewire-tables::core.Applied Sorting') }}: @foreach($this->getSorts() as $columnSelectName => $direction) @php($column = $this->getColumnBySelectName($columnSelectName) ?? $this->getColumnBySlug($columnSelectName)) @@ -24,7 +24,7 @@ class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium l type="button" class="flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:outline-none focus:bg-indigo-500 focus:text-white" > - @lang('livewire-tables::Remove sort option') + {{ __('livewire-tables::core.Remove sort option') }} @@ -35,7 +35,7 @@ class="flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justif class="focus:outline-none active:outline-none" > - @lang('livewire-tables::Clear') + {{ __('livewire-tables::core.Clear') }}
@@ -45,7 +45,7 @@ class="focus:outline-none active:outline-none"
@if ($this->sortingPillsAreEnabled() && $this->hasSorts())
- @lang('livewire-tables::Applied Sorting'): + {{ __('livewire-tables::core.Applied Sorting') }}: @foreach($this->getSorts() as $columnSelectName => $direction) @php($column = $this->getColumnBySelectName($columnSelectName) ?? $this->getColumnBySlug($columnSelectName)) @@ -65,7 +65,7 @@ class="badge badge-pill badge-info d-inline-flex align-items-center" wire:click="clearSort('{{ $columnSelectName }}')" class="text-white ml-2" > - @lang('livewire-tables::Remove sort option') + {{ __('livewire-tables::core.Remove sort option') }} @@ -76,7 +76,7 @@ class="text-white ml-2" wire:click.prevent="clearSorts" class="badge badge-pill badge-light" > - @lang('livewire-tables::Clear') + {{ __('livewire-tables::core.Clear') }}
@endif @@ -85,7 +85,7 @@ class="badge badge-pill badge-light"
@if ($this->sortingPillsAreEnabled() && $this->hasSorts())
- @lang('livewire-tables::Applied Sorting'): + {{ __('livewire-tables::core.Applied Sorting') }}: @foreach($this->getSorts() as $columnSelectName => $direction) @php($column = $this->getColumnBySelectName($columnSelectName) ?? $this->getColumnBySlug($columnSelectName)) @@ -105,7 +105,7 @@ class="badge rounded-pill bg-info d-inline-flex align-items-center" wire:click="clearSort('{{ $columnSelectName }}')" class="text-white ms-2" > - @lang('livewire-tables::Remove sort option') + {{ __('livewire-tables::core.Remove sort option') }} @@ -116,7 +116,7 @@ class="text-white ms-2" wire:click.prevent="clearSorts" class="badge rounded-pill bg-light text-dark text-decoration-none" > - @lang('livewire-tables::Clear') + {{ __('livewire-tables::core.Clear') }}
@endif diff --git a/resources/views/components/tools/toolbar/items/bulk-actions.blade.php b/resources/views/components/tools/toolbar/items/bulk-actions.blade.php index 3be95e799..6e7cd4948 100644 --- a/resources/views/components/tools/toolbar/items/bulk-actions.blade.php +++ b/resources/views/components/tools/toolbar/items/bulk-actions.blade.php @@ -34,7 +34,8 @@ @endif aria-haspopup="true" aria-expanded="false"> - @lang('livewire-tables::Bulk Actions') + {{ __('livewire-tables::core.Bulk Actions') }} + @if($this->isTailwind) @endif diff --git a/resources/views/components/tools/toolbar/items/column-select.blade.php b/resources/views/components/tools/toolbar/items/column-select.blade.php index 24033daee..d74d71efd 100644 --- a/resources/views/components/tools/toolbar/items/column-select.blade.php +++ b/resources/views/components/tools/toolbar/items/column-select.blade.php @@ -18,7 +18,7 @@ class="inline-flex justify-center px-4 py-2 w-full text-sm font-medium text-gray x-bind:aria-expanded="open" aria-expanded="true" > - @lang('livewire-tables::Columns') + {{ __('livewire-tables::core.Columns') }} @@ -51,7 +51,7 @@ class="text-indigo-600 transition duration-150 ease-in-out border-gray-300 round @checked($component->getSelectableSelectedColumns()->count() == $component->getSelectableColumns()->count()) @if($component->getSelectableSelectedColumns()->count() == $component->getSelectableColumns()->count()) wire:click="deselectAllColumns" @else wire:click="selectAllColumns" @endif > - @lang('livewire-tables::All Columns') + {{ __('livewire-tables::core.All Columns') }}
@@ -104,7 +104,7 @@ class="text-indigo-600 rounded border-gray-300 shadow-sm transition duration-150 type="button" id="{{ $tableName }}-columnSelect" aria-haspopup="true" x-bind:aria-expanded="open" > - @lang('livewire-tables::Columns') + {{ __('livewire-tables::core.Columns') }}
- @lang('livewire-tables::All Columns') + {{ __('livewire-tables::core.All Columns') }} @@ -139,7 +139,7 @@ class="form-check-input" />
@endif diff --git a/resources/views/components/tools/toolbar/items/filter-button.blade.php b/resources/views/components/tools/toolbar/items/filter-button.blade.php index f3488639e..225f71dd0 100644 --- a/resources/views/components/tools/toolbar/items/filter-button.blade.php +++ b/resources/views/components/tools/toolbar/items/filter-button.blade.php @@ -33,7 +33,7 @@ @endif @if ($this->isFilterLayoutSlideDown()) x-on:click="filtersOpen = !filtersOpen" @endif > - @lang('livewire-tables::Filters') + {{ __('livewire-tables::core.Filters') }} @if ($count = $this->getFilterBadgeCount()) $this->isBootstrap5, ]) > - @lang('livewire-tables::Clear') + {{ __('livewire-tables::core.Clear') }} @endif @@ -74,7 +74,7 @@ class="block px-4 py-2 text-sm text-gray-700 space-y-1" type="button" class="w-full inline-flex items-center justify-center px-3 py-2 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-800 dark:border-gray-600 dark:text-white dark:hover:border-gray-500 dark:hover:bg-gray-600" > - @lang('livewire-tables::Clear') + {{ __('livewire-tables::core.Clear') }}
@endif diff --git a/resources/views/components/tools/toolbar/items/pagination-dropdown.blade.php b/resources/views/components/tools/toolbar/items/pagination-dropdown.blade.php index 5a2ae1845..46f2e83ff 100644 --- a/resources/views/components/tools/toolbar/items/pagination-dropdown.blade.php +++ b/resources/views/components/tools/toolbar/items/pagination-dropdown.blade.php @@ -21,7 +21,7 @@ value="{{ $item }}" wire:key="{{ $tableName }}-per-page-{{ $item }}" > - {{ $item === -1 ? __('livewire-tables::All') : $item }} + {{ $item === -1 ? __('livewire-tables::core.All') : $item }} @endforeach diff --git a/resources/views/components/tools/toolbar/items/reorder-buttons.blade.php b/resources/views/components/tools/toolbar/items/reorder-buttons.blade.php index 061b2ea8c..b33ea1d86 100644 --- a/resources/views/components/tools/toolbar/items/reorder-buttons.blade.php +++ b/resources/views/components/tools/toolbar/items/reorder-buttons.blade.php @@ -14,11 +14,11 @@ ]) > - @lang('livewire-tables::Cancel') + {{ __('livewire-tables::core.Cancel') }} - @lang('livewire-tables::Reorder') + {{ __('livewire-tables::core.Reorder') }} @@ -33,7 +33,7 @@ ]) > - @lang('livewire-tables::Save') + {{ __('livewire-tables::core.Save') }}
diff --git a/resources/views/includes/debug.blade.php b/resources/views/includes/debug.blade.php index d737f6941..791a7cfbb 100644 --- a/resources/views/includes/debug.blade.php +++ b/resources/views/includes/debug.blade.php @@ -1,6 +1,7 @@
@if ($this->debugIsEnabled()) -

@lang('livewire-tables::Debugging Values'):

+

{{ __('livewire-tables::core.Debugging Values') }}:

+ @if (! app()->runningInConsole())
@dump((new \Rappasoft\LaravelLivewireTables\DataTransferObjects\DebuggableData($this))->toArray())
diff --git a/resources/views/includes/offline.blade.php b/resources/views/includes/offline.blade.php index ae5dc5f37..c4889608b 100644 --- a/resources/views/includes/offline.blade.php +++ b/resources/views/includes/offline.blade.php @@ -9,7 +9,7 @@

- @lang('livewire-tables::You are not connected to the internet.') + {{ __('livewire-tables::core.You are not connected to the internet') }}.

@@ -19,7 +19,8 @@
- @lang('livewire-tables::You are not connected to the internet.') + {{ __('livewire-tables::core.You are not connected to the internet') }}. +
@endif diff --git a/src/LaravelLivewireTablesServiceProvider.php b/src/LaravelLivewireTablesServiceProvider.php index e10027b51..7002ae8d0 100644 --- a/src/LaravelLivewireTablesServiceProvider.php +++ b/src/LaravelLivewireTablesServiceProvider.php @@ -25,14 +25,7 @@ public function boot(): void ); // Load Default Translations - $this->loadJsonTranslationsFrom( - __DIR__.'/../resources/lang' - ); - - // Override if Published - $this->loadJsonTranslationsFrom( - $this->app->langPath('vendor/livewire-tables') - ); + $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'livewire-tables'); $this->loadViewsFrom(__DIR__.'/../resources/views', 'livewire-tables'); diff --git a/src/Traits/ComponentUtilities.php b/src/Traits/ComponentUtilities.php index de24d0e72..a8aa3832e 100644 --- a/src/Traits/ComponentUtilities.php +++ b/src/Traits/ComponentUtilities.php @@ -34,7 +34,7 @@ trait ComponentUtilities protected bool $eagerLoadAllRelationsStatus = false; - protected string $emptyMessage = 'No items found. Try to broaden your search.'; + protected string $emptyMessage = 'No items found, try to broaden your search'; protected array $additionalSelects = []; diff --git a/src/Traits/Helpers/BulkActionsHelpers.php b/src/Traits/Helpers/BulkActionsHelpers.php index 95c116900..7093f574c 100644 --- a/src/Traits/Helpers/BulkActionsHelpers.php +++ b/src/Traits/Helpers/BulkActionsHelpers.php @@ -181,7 +181,7 @@ public function getBulkActionConfirmMessage(string $bulkAction): string public function getBulkActionDefaultConfirmationMessage(): string { - return isset($this->bulkActionConfirmDefaultMessage) ? $this->bulkActionConfirmDefaultMessage : __('livewire-tables::Bulk Actions Confirm'); + return isset($this->bulkActionConfirmDefaultMessage) ? $this->bulkActionConfirmDefaultMessage : __('livewire-tables::core.Bulk Actions Confirm'); } #[Computed] diff --git a/src/Traits/Helpers/ComponentHelpers.php b/src/Traits/Helpers/ComponentHelpers.php index 980d8d28e..7ddce544b 100644 --- a/src/Traits/Helpers/ComponentHelpers.php +++ b/src/Traits/Helpers/ComponentHelpers.php @@ -62,7 +62,11 @@ public function getModel() */ public function getEmptyMessage(): string { - return __($this->emptyMessage); + if ($this->emptyMessage == 'No items found, try to broaden your search') { + return __('livewire-tables::core.No items found, try to broaden your search'); + } + + return $this->emptyMessage; } public function getOfflineIndicatorStatus(): bool diff --git a/src/Traits/Helpers/LoadingPlaceholderHelpers.php b/src/Traits/Helpers/LoadingPlaceholderHelpers.php index cd43c583f..ff3ee633e 100644 --- a/src/Traits/Helpers/LoadingPlaceholderHelpers.php +++ b/src/Traits/Helpers/LoadingPlaceholderHelpers.php @@ -16,7 +16,7 @@ public function getDisplayLoadingPlaceholder(): bool public function getLoadingPlaceholderContent(): string { - return $this->loadingPlaceholderContent ?? __('livewire-tables::loading'); + return $this->loadingPlaceholderContent ?? __('livewire-tables::core.loading'); } public function hasLoadingPlaceholderBlade(): bool diff --git a/src/Traits/Helpers/SearchHelpers.php b/src/Traits/Helpers/SearchHelpers.php index 059c17d32..1027778e5 100644 --- a/src/Traits/Helpers/SearchHelpers.php +++ b/src/Traits/Helpers/SearchHelpers.php @@ -127,7 +127,7 @@ public function getSearchPlaceholder(): string return $this->searchPlaceholder; } - return __('livewire-tables::Search'); + return __('livewire-tables::core.Search'); } public function hasSearchPlaceholder(): bool diff --git a/src/Views/Filters/DateRangeFilter.php b/src/Views/Filters/DateRangeFilter.php index 3c0d0a95e..7fae05c82 100644 --- a/src/Views/Filters/DateRangeFilter.php +++ b/src/Views/Filters/DateRangeFilter.php @@ -189,7 +189,7 @@ public function getFilterPillValue($value): array|string|bool|null if (($minDate instanceof Carbon) && $maxDate instanceof Carbon) { return $this->outputTranslatedDate($minDate) - .' '.__('livewire-tables::to').' '. + .' '.__('livewire-tables::core.to').' '. $this->outputTranslatedDate($maxDate); } } diff --git a/src/Views/Filters/NumberRangeFilter.php b/src/Views/Filters/NumberRangeFilter.php index a32a83667..ce02cb26d 100644 --- a/src/Views/Filters/NumberRangeFilter.php +++ b/src/Views/Filters/NumberRangeFilter.php @@ -89,7 +89,7 @@ public function getDefaultValue(): array|string public function getFilterPillValue($values): array|string|bool|null { if ($this->validate($values)) { - return __('livewire-tables::min').':'.$values['min'].', '.__('livewire-tables::max').':'.$values['max']; + return __('livewire-tables::core.min').':'.$values['min'].', '.__('livewire-tables::core.max').':'.$values['max']; } return ''; diff --git a/src/Views/Traits/Columns/IsSortable.php b/src/Views/Traits/Columns/IsSortable.php index b53c729d8..d21916001 100644 --- a/src/Views/Traits/Columns/IsSortable.php +++ b/src/Views/Traits/Columns/IsSortable.php @@ -99,7 +99,7 @@ public function getCustomSortingPillDirections(string $direction, ?string $defau return $this->sortingPillDirectionDesc ?? $defaultLabelDesc; } - return __('livewire-tables::not_applicable'); + return __('livewire-tables::core.not_applicable'); } public function getCustomSortingPillDirectionsLabel(string $direction, ?string $defaultLabelAsc = 'A-Z', ?string $defaultLabelDesc = 'Z-A'): string @@ -112,7 +112,7 @@ public function getCustomSortingPillDirectionsLabel(string $direction, ?string $ return $this->sortingPillDirectionDesc ?? $defaultLabelDesc; } - return __('livewire-tables::not_applicable'); + return __('livewire-tables::core.not_applicable'); } public function getSortingPillDirection(DataTableComponent $component, string $direction): string diff --git a/tests/Http/Livewire/PetsTable.php b/tests/Http/Livewire/PetsTable.php index 59b52049d..32024f7a5 100644 --- a/tests/Http/Livewire/PetsTable.php +++ b/tests/Http/Livewire/PetsTable.php @@ -3,6 +3,7 @@ namespace Rappasoft\LaravelLivewireTables\Tests\Http\Livewire; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Support\Facades\App; use Livewire\Attributes\On; use Rappasoft\LaravelLivewireTables\DataTableComponent; use Rappasoft\LaravelLivewireTables\Tests\Models\Breed; @@ -25,6 +26,11 @@ class PetsTable extends DataTableComponent public string $paginationTest = 'standard'; + public function changeLocale(string $locale) + { + App::setLocale($locale); + } + public function enableDetailedPagination(string $type = 'standard') { $this->setPerPageAccepted([1, 3, 5, 10, 15, 25, 50])->setPerPage(3); diff --git a/tests/Localisations/BaseLocalisationCase.php b/tests/Localisations/BaseLocalisationCase.php new file mode 100644 index 000000000..b95b606cc --- /dev/null +++ b/tests/Localisations/BaseLocalisationCase.php @@ -0,0 +1,72 @@ + $availableLocale, + // 'localisationStrings' => $array, + ]; + } + + return $localisations; + } +} diff --git a/tests/Localisations/Presence/CheckKeyPresenceTest.php b/tests/Localisations/Presence/CheckKeyPresenceTest.php new file mode 100644 index 000000000..46aedc84e --- /dev/null +++ b/tests/Localisations/Presence/CheckKeyPresenceTest.php @@ -0,0 +1,29 @@ +basicTable->changeLocale($locale); + $this->assertEquals($localisedString, $this->basicTable->getEmptyMessage()); + } + + #[DataProvider('localisationProvider')] + public function test_can_check_presence_of_keys(string $locale): void + { + $engStrings = self::getEnLocaleStrings(); + $localisedStrings = self::getLocaleStrings($locale); + foreach ($engStrings as $key => $value) { + $this->assertNotNull($localisedStrings[$key]); + } + } +} diff --git a/tests/Localisations/Unit/Component/EmptyStringTest.php b/tests/Localisations/Unit/Component/EmptyStringTest.php new file mode 100644 index 000000000..bed7acd91 --- /dev/null +++ b/tests/Localisations/Unit/Component/EmptyStringTest.php @@ -0,0 +1,17 @@ +basicTable->changeLocale($locale); + $this->assertEquals($localisedString, $this->basicTable->getEmptyMessage()); + } +} diff --git a/tests/Unit/Traits/Configuration/SearchConfigurationTest.php b/tests/Unit/Traits/Configuration/SearchConfigurationTest.php index c4704d03b..20e788849 100644 --- a/tests/Unit/Traits/Configuration/SearchConfigurationTest.php +++ b/tests/Unit/Traits/Configuration/SearchConfigurationTest.php @@ -170,7 +170,7 @@ public function test_cant_set_search_throttle_with_other_search_modifiers(): voi public function test_can_set_search_placeholder(): void { - $this->assertSame(__('livewire-tables::Search'), $this->basicTable->getSearchPlaceholder()); + $this->assertSame(__('livewire-tables::core.Search'), $this->basicTable->getSearchPlaceholder()); $this->basicTable->setSearchPlaceholder('Anthony'); diff --git a/tests/Unit/Traits/Helpers/ComponentHelpersTest.php b/tests/Unit/Traits/Helpers/ComponentHelpersTest.php index 38be7f469..0eed6b930 100644 --- a/tests/Unit/Traits/Helpers/ComponentHelpersTest.php +++ b/tests/Unit/Traits/Helpers/ComponentHelpersTest.php @@ -22,9 +22,9 @@ public function test_can_get_current_theme(): void $this->assertEquals('tailwind', $this->basicTable->getTheme()); } - public function test_can_get_empty_message(): void + public function test_can_get_default_empty_message(): void { - $this->assertEquals('No items found. Try to broaden your search.', $this->basicTable->getEmptyMessage()); + $this->assertEquals(__('livewire-tables::core.No items found, try to broaden your search'), $this->basicTable->getEmptyMessage()); } public function test_can_get_offline_status(): void From 7748021eeb323ff070c1e5b703167010cac8e1eb Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 10 Nov 2024 04:07:34 +0000 Subject: [PATCH 100/118] Add "save", "cancel" to Core Localisation (#2039) --- resources/lang/en/core.php | 2 ++ .../components/tools/toolbar/items/reorder-buttons.blade.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/lang/en/core.php b/resources/lang/en/core.php index 3a562980d..631762dba 100644 --- a/resources/lang/en/core.php +++ b/resources/lang/en/core.php @@ -7,6 +7,7 @@ 'Applied Sorting' => 'Applied Sorting', 'Bulk Actions' => 'Bulk Actions', 'Bulk Actions Confirm' => 'Are you sure?', + 'cancel' => 'Cancel', 'Clear' => 'Clear', 'Columns' => 'Columns', 'Debugging Values' => 'Debugging Values', @@ -27,6 +28,7 @@ 'row' => 'row', 'rows' => 'rows', 'rows, do you want to select all' => 'rows, do you want to select all', + 'save' => 'Save', 'Search' => 'Search', 'Select All' => 'Select All', 'Select All On Page' => 'Select All On Page', diff --git a/resources/views/components/tools/toolbar/items/reorder-buttons.blade.php b/resources/views/components/tools/toolbar/items/reorder-buttons.blade.php index b33ea1d86..00d89e384 100644 --- a/resources/views/components/tools/toolbar/items/reorder-buttons.blade.php +++ b/resources/views/components/tools/toolbar/items/reorder-buttons.blade.php @@ -14,7 +14,7 @@ ]) > - {{ __('livewire-tables::core.Cancel') }} + {{ __('livewire-tables::core.cancel') }} @@ -33,7 +33,7 @@ ]) > - {{ __('livewire-tables::core.Save') }} + {{ __('livewire-tables::core.save') }} From d4f62e8808d4f0c99becff9424e828d64fbfa5cb Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 10 Nov 2024 04:27:13 +0000 Subject: [PATCH 101/118] Minor Localisation Tweaks (#2042) --- .../filter-pills/buttons/reset-all.blade.php | 25 +++++++++++++++++++ .../buttons/reset-filter.blade.php | 7 +++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/resources/views/components/tools/filter-pills/buttons/reset-all.blade.php b/resources/views/components/tools/filter-pills/buttons/reset-all.blade.php index e69de29bb..1ffec0b94 100644 --- a/resources/views/components/tools/filter-pills/buttons/reset-all.blade.php +++ b/resources/views/components/tools/filter-pills/buttons/reset-all.blade.php @@ -0,0 +1,25 @@ +@aware(['isTailwind','isBootstrap','isBootstrap4','isBootstrap5']) +@if ($isTailwind) + +@else + $isBootstrap4, + 'badge rounded-pill bg-light text-dark text-decoration-none' => $isBootstrap5, + ])> + {{ __('livewire-tables::core.Clear') }} + +@endif diff --git a/resources/views/components/tools/filter-pills/buttons/reset-filter.blade.php b/resources/views/components/tools/filter-pills/buttons/reset-filter.blade.php index 5dfd85457..f65d13c5a 100644 --- a/resources/views/components/tools/filter-pills/buttons/reset-filter.blade.php +++ b/resources/views/components/tools/filter-pills/buttons/reset-filter.blade.php @@ -9,7 +9,7 @@ "text-indigo-400 hover:bg-indigo-200 hover:text-indigo-500 focus:bg-indigo-500 focus:text-white", ]) > - @lang('livewire-tables::Remove filter option') + {{ __('livewire-tables::core.Remove filter option') }} @else @@ -23,9 +23,8 @@ $isBootstrap4, 'visually-hidden' => $isBootstrap5, - ])> - @lang('livewire-tables::Remove filter option') - + ])>{{ __('livewire-tables::core.Remove filter option') }} + @endif From f7cd9080ef0ac1cbcf9ed57d01b9d865ab6b81bc Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 10 Nov 2024 06:25:39 +0000 Subject: [PATCH 102/118] Remove Duplicate Item (#2043) --- .../buttons/reset-filter.blade.php | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/resources/views/components/tools/filter-pills/buttons/reset-filter.blade.php b/resources/views/components/tools/filter-pills/buttons/reset-filter.blade.php index f65d13c5a..912611188 100644 --- a/resources/views/components/tools/filter-pills/buttons/reset-filter.blade.php +++ b/resources/views/components/tools/filter-pills/buttons/reset-filter.blade.php @@ -28,34 +28,3 @@ @endif -@aware(['tableName','isTailwind','isBootstrap','isBootstrap4','isBootstrap5']) -@props(['filterKey']) -@if ($isTailwind) - -@else - ($isBootstrap), - ]) - > - $isBootstrap4, - 'visually-hidden' => $isBootstrap5, - ])>{{ __('livewire-tables::core.Remove filter option') }} - - - - -@endif \ No newline at end of file From 38966bf7948aef38bc8fee554024a9740c0d9c65 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 10 Nov 2024 06:37:21 +0000 Subject: [PATCH 103/118] Update ChangeLog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20254a641..d2fdcb052 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `laravel-livewire-tables` will be documented in this file +## [v3.5.2] - 2024-11-09 +## Bug Fixes +- Migrate Localisation back to PHP Files from JSON by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2038 + ## [v3.5.1] - 2024-11-09 ### Bug Fixes - Fix NumberFilter bug for string values by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2034 From ce3abe806063356623761cc2033e52da17672385 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 10 Nov 2024 06:46:19 +0000 Subject: [PATCH 104/118] Adjust Readme - Reference PHPStan Level 6 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 61e6523ef..16e4c36ee 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Tests](https://github.com/rappasoft/laravel-livewire-tables/actions/workflows/run-tests.yml/badge.svg)](https://github.com/rappasoft/laravel-livewire-tables/actions/workflows/run-tests.yml) [![Total Downloads](https://img.shields.io/packagist/dt/rappasoft/laravel-livewire-tables.svg?style=flat-square)](https://packagist.org/packages/rappasoft/laravel-livewire-tables) [![codecov](https://codecov.io/gh/rappasoft/laravel-livewire-tables/graph/badge.svg?token=1B9VKO9KWG)](https://codecov.io/gh/rappasoft/laravel-livewire-tables) -![PHP Stan Level 5](https://img.shields.io/badge/PHPStan-level%205-brightgreen.svg?style=flat) +![PHP Stan Level 6](https://img.shields.io/badge/PHPStan-level%206-brightgreen.svg?style=flat) ### Enjoying this package? [Buy me a beer 🍺](https://www.buymeacoffee.com/rappasoft) From 07696631a375332c1777d7635c27309a5a9f3e92 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 10 Nov 2024 07:01:19 +0000 Subject: [PATCH 105/118] Add updatedPerPageTest (#2047) * Add updatedPerPageTest * Fix styling --------- Co-authored-by: lrljoe --- tests/Unit/Traits/Helpers/PaginationHelpersTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/Unit/Traits/Helpers/PaginationHelpersTest.php b/tests/Unit/Traits/Helpers/PaginationHelpersTest.php index fd4f04645..8374853bc 100644 --- a/tests/Unit/Traits/Helpers/PaginationHelpersTest.php +++ b/tests/Unit/Traits/Helpers/PaginationHelpersTest.php @@ -202,4 +202,17 @@ public function test_can_get_pagination_wrapper_attributes_bag(): void $this->assertSame((new \Illuminate\View\ComponentAttributeBag(['class' => 'text-lg', 'testval' => '123']))->getAttributes(), $this->basicTable->getPaginationWrapperAttributesBag()->getAttributes()); } + + public function test_check_updated_per_page_returns_correctly(): void + { + $rows = $this->basicTable->getRows(); + $this->basicTable->setPerPageAccepted([5, 10, 15, 25, 50]); + + $this->basicTable->setPerPage(5); + $this->assertSame(5, $this->basicTable->getPerPage()); + + $this->basicTable->updatedPerPage(15); + $this->assertSame(15, $this->basicTable->getPerPage()); + + } } From 009155de909189925cd2251801a640122406e58a Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 10 Nov 2024 07:10:05 +0000 Subject: [PATCH 106/118] Remove Waiting For Tests --- .github/workflows/run-tests-pcov-pull.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/run-tests-pcov-pull.yml b/.github/workflows/run-tests-pcov-pull.yml index 842d682ad..6a8de68c1 100644 --- a/.github/workflows/run-tests-pcov-pull.yml +++ b/.github/workflows/run-tests-pcov-pull.yml @@ -26,14 +26,6 @@ jobs: extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pcov,pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo steps: - - name: Wait for tests to finish - uses: lewagon/wait-on-check-action@v1.3.4 - with: - ref: ${{ github.ref }} - running-workflow-name: 'Run Tests Pull' - repo-token: ${{ secrets.GITHUB_TOKEN }} - wait-interval: 20 - - name: Checkout code uses: actions/checkout@v4 From b7e432437147e6d6a378bb3b055101cc1dfed7c0 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 10 Nov 2024 07:18:27 +0000 Subject: [PATCH 107/118] Use CODECOV_TOKEN --- .github/workflows/run-tests-pcov-pull.yml | 2 +- src/DataTableComponent.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests-pcov-pull.yml b/.github/workflows/run-tests-pcov-pull.yml index 6a8de68c1..10b4eba58 100644 --- a/.github/workflows/run-tests-pcov-pull.yml +++ b/.github/workflows/run-tests-pcov-pull.yml @@ -92,7 +92,7 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: - token: ${{ secrets.CODE_COV_TOKEN }} + token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage.xml verbose: true diff --git a/src/DataTableComponent.php b/src/DataTableComponent.php index cf6837d4f..77b8d365a 100644 --- a/src/DataTableComponent.php +++ b/src/DataTableComponent.php @@ -11,7 +11,7 @@ abstract class DataTableComponent extends Component use HasAllTraits; /** - * Runs on every request, immediately after the component is instantiated, but before any other lifecycle methods are called + * Runs on every request, immediately after the component is instantiated, but before any other lifecycle methods are called */ #[On('refreshDatatable')] public function boot(): void From 4309b8d4766d0e00fbbab32d237c34545abfd9ac Mon Sep 17 00:00:00 2001 From: lrljoe Date: Sun, 10 Nov 2024 07:18:54 +0000 Subject: [PATCH 108/118] Fix styling --- src/DataTableComponent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DataTableComponent.php b/src/DataTableComponent.php index 77b8d365a..cf6837d4f 100644 --- a/src/DataTableComponent.php +++ b/src/DataTableComponent.php @@ -11,7 +11,7 @@ abstract class DataTableComponent extends Component use HasAllTraits; /** - * Runs on every request, immediately after the component is instantiated, but before any other lifecycle methods are called + * Runs on every request, immediately after the component is instantiated, but before any other lifecycle methods are called */ #[On('refreshDatatable')] public function boot(): void From 4aa03fa3702e7f0be7c5afb4ddea1921341332db Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Tue, 12 Nov 2024 20:56:44 +0000 Subject: [PATCH 109/118] Update phpdoc for boot (#2055) * Update phpdoc for boot * Fix styling --------- Co-authored-by: lrljoe --- src/DataTableComponent.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/DataTableComponent.php b/src/DataTableComponent.php index cf6837d4f..e2a3f7b8f 100644 --- a/src/DataTableComponent.php +++ b/src/DataTableComponent.php @@ -12,6 +12,7 @@ abstract class DataTableComponent extends Component /** * Runs on every request, immediately after the component is instantiated, but before any other lifecycle methods are called + * Called when refreshDatatable is called as an event */ #[On('refreshDatatable')] public function boot(): void From 03c7796066432b4c131eafca9151de9a4fae0534 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Tue, 12 Nov 2024 21:29:54 +0000 Subject: [PATCH 110/118] Add test for No Columns defined - throws correct Exception (#2057) * Add test for No Columns * Fix styling --------- Co-authored-by: lrljoe --- .../Unit/Traits/Helpers/ColumnHelpersTest.php | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/Unit/Traits/Helpers/ColumnHelpersTest.php b/tests/Unit/Traits/Helpers/ColumnHelpersTest.php index 8239fcaf3..cfebce832 100644 --- a/tests/Unit/Traits/Helpers/ColumnHelpersTest.php +++ b/tests/Unit/Traits/Helpers/ColumnHelpersTest.php @@ -2,6 +2,8 @@ namespace Rappasoft\LaravelLivewireTables\Tests\Unit\Traits\Helpers; +use Rappasoft\LaravelLivewireTables\Exceptions\NoColumnsException; +use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\PetsTable; use Rappasoft\LaravelLivewireTables\Tests\Models\Pet; use Rappasoft\LaravelLivewireTables\Tests\TestCase; use Rappasoft\LaravelLivewireTables\Views\Column; @@ -360,4 +362,27 @@ public function test_can_check_if_column_label_has_attributes(): void $this->assertSame(['class' => 'text-xl', 'default' => true, 'default-colors' => false, 'default-styling' => false], $column->getLabelAttributes()); } + + public function test_throws_error_if_no_columns_are_defined(): void + { + $this->expectException(NoColumnsException::class); + + $testTable = new class extends PetsTable + { + public function columns(): array + { + return []; + } + }; + + $testTable->configure(); + $testTable->boot(); + $testTable->bootedComponentUtilities(); + $testTable->bootedWithData(); + $testTable->bootedWithColumns(); + $testTable->bootedWithColumnSelect(); + $testTable->bootedWithSecondaryHeader(); + $testTable->booted(); + + } } From 83b3ff972721bda563fff8a1e13b1f6704ca7dcf Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Tue, 12 Nov 2024 22:13:19 +0000 Subject: [PATCH 111/118] Add Simple updatedSearch tests (#2058) * Add Simple updatedSearch tests * Fix styling --------- Co-authored-by: lrljoe --- tests/Unit/Traits/WithSearchTest.php | 80 ++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/tests/Unit/Traits/WithSearchTest.php b/tests/Unit/Traits/WithSearchTest.php index 60389077c..37ab46f3d 100644 --- a/tests/Unit/Traits/WithSearchTest.php +++ b/tests/Unit/Traits/WithSearchTest.php @@ -2,6 +2,7 @@ namespace Rappasoft\LaravelLivewireTables\Tests\Unit\Traits; +use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\PetsTable; use Rappasoft\LaravelLivewireTables\Tests\TestCase; final class WithSearchTest extends TestCase @@ -34,4 +35,83 @@ public function test_when_search_is_applied_bulk_actions_are_cleared(): void // // $this->assertSame([], $this->basicTable->getSelected()); } + + public function test_updated_search_untrimmed_string(): void + { + $untrimmed = 'searchtext '; + $trimmed = 'searchtext'; + + $testTableDefault = new class extends PetsTable + { + public function configure(): void + { + parent::configure(); + + } + }; + + $testTableDefault->configure(); + $testTableDefault->boot(); + $testTableDefault->bootedComponentUtilities(); + $testTableDefault->bootedWithData(); + $testTableDefault->bootedWithColumns(); + $testTableDefault->bootedWithColumnSelect(); + $testTableDefault->bootedWithSecondaryHeader(); + $testTableDefault->booted(); + + $this->assertSame('', $testTableDefault->search); + + $testTableDefault->search = $untrimmed; + $testTableDefault->updatedSearch($untrimmed); + $this->assertSame($untrimmed, $testTableDefault->search); + + $testTableDefault->search = $trimmed; + $testTableDefault->updatedSearch($trimmed); + $this->assertSame($trimmed, $testTableDefault->search); + + $testTableDefault->search = ''; + $testTableDefault->updatedSearch(''); + $this->assertSame('', $testTableDefault->search); + + } + + public function test_updated_search_trimmed_string(): void + { + $untrimmed = 'searchtext '; + $trimmed = 'searchtext'; + + $testTableTrimSearch = new class extends PetsTable + { + public function configure(): void + { + $this->trimSearchString = true; + parent::configure(); + + } + }; + + $testTableTrimSearch->configure(); + $testTableTrimSearch->boot(); + $testTableTrimSearch->bootedComponentUtilities(); + $testTableTrimSearch->bootedWithData(); + $testTableTrimSearch->bootedWithColumns(); + $testTableTrimSearch->bootedWithColumnSelect(); + $testTableTrimSearch->bootedWithSecondaryHeader(); + $testTableTrimSearch->booted(); + + $this->assertSame('', $testTableTrimSearch->search); + + $testTableTrimSearch->search = $trimmed; + $testTableTrimSearch->updatedSearch($trimmed); + $this->assertSame($trimmed, $testTableTrimSearch->search); + + $testTableTrimSearch->search = $untrimmed; + $testTableTrimSearch->updatedSearch($untrimmed); + $this->assertSame($trimmed, $testTableTrimSearch->search); + + $testTableTrimSearch->search = ''; + $testTableTrimSearch->updatedSearch(''); + $this->assertSame('', $testTableTrimSearch->search); + + } } From 2ea9010b08bf01fd8d215b8f3752f707b878e5ba Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Tue, 12 Nov 2024 22:36:33 +0000 Subject: [PATCH 112/118] Add test for FilterApplied Event being dispatched (#2059) * Add test for FilterApplied being dispatched * Fix styling --------- Co-authored-by: lrljoe --- .../Unit/Traits/Helpers/FilterHelpersTest.php | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/Unit/Traits/Helpers/FilterHelpersTest.php b/tests/Unit/Traits/Helpers/FilterHelpersTest.php index 25aac3341..367dd1d1a 100644 --- a/tests/Unit/Traits/Helpers/FilterHelpersTest.php +++ b/tests/Unit/Traits/Helpers/FilterHelpersTest.php @@ -2,6 +2,9 @@ namespace Rappasoft\LaravelLivewireTables\Tests\Unit\Traits\Helpers; +use Illuminate\Support\Facades\Event; +use Rappasoft\LaravelLivewireTables\Events\FilterApplied; +use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\PetsTable; use Rappasoft\LaravelLivewireTables\Tests\TestCase; use Rappasoft\LaravelLivewireTables\Views\Filters\DateFilter; use Rappasoft\LaravelLivewireTables\Views\Filters\DateTimeFilter; @@ -207,4 +210,38 @@ public function test_can_check_if_filter_layout_slidedown_is_hidden(): void $this->assertFalse($this->basicTable->getFilterSlideDownDefaultStatus()); } + + public function test_event_fires_for_filter(): void + { + Event::fake(); + + $testTable = new class extends PetsTable + { + public function configure(): void + { + parent::configure(); + } + }; + $testTable->configure(); + $testTable->boot(); + $testTable->bootedComponentUtilities(); + $testTable->bootedWithData(); + $testTable->bootedWithColumns(); + $testTable->bootedWithColumnSelect(); + $testTable->bootedWithSecondaryHeader(); + $testTable->booted(); + + $testTable->setFilter('breed_id_filter', '2'); + $testTable->updatedFilterComponents('2', 'breed_id_filter'); + $this->assertSame(['breed_id_filter' => '2'], $testTable->getAppliedFiltersWithValues()); + Event::assertNotDispatched(FilterApplied::class); + + $testTable->enableFilterAppliedEvent(); + + $testTable->setFilter('breed_id_filter', '3'); + $testTable->updatedFilterComponents('3', 'breed_id_filter'); + $this->assertSame(['breed_id_filter' => '3'], $testTable->getAppliedFiltersWithValues()); + Event::assertDispatched(FilterApplied::class); + + } } From ff389514d26bf7a184028466b386ed1fef0213b2 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Tue, 12 Nov 2024 23:00:25 +0000 Subject: [PATCH 113/118] Add updatedSelectedColumns test for Event (#2060) * Add test for ColumnsSelected Event dispatch * Apply Separate Tests --------- Co-authored-by: lrljoe --- .../Helpers/ColumnSelectHelpersTest.php | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/tests/Unit/Traits/Helpers/ColumnSelectHelpersTest.php b/tests/Unit/Traits/Helpers/ColumnSelectHelpersTest.php index 7ddf9d04b..4da1d5912 100644 --- a/tests/Unit/Traits/Helpers/ColumnSelectHelpersTest.php +++ b/tests/Unit/Traits/Helpers/ColumnSelectHelpersTest.php @@ -2,6 +2,9 @@ namespace Rappasoft\LaravelLivewireTables\Tests\Unit\Traits\Helpers; +use Illuminate\Support\Facades\Event; +use Rappasoft\LaravelLivewireTables\Events\ColumnsSelected; +use Rappasoft\LaravelLivewireTables\Tests\Http\Livewire\PetsTable; use Rappasoft\LaravelLivewireTables\Tests\TestCase; final class ColumnSelectHelpersTest extends TestCase @@ -103,4 +106,99 @@ public function test_get_currently_selected_cols_works(): void $this->assertSame(8, count($this->basicTable->getDefaultVisibleColumns())); } + + public function test_event_fires_for_columnselect(): void + { + Event::fake(); + + $testTable = new class extends PetsTable + { + public function configure(): void + { + parent::configure(); + } + }; + $testTable->configure(); + $testTable->boot(); + $testTable->bootedComponentUtilities(); + $testTable->bootedWithData(); + $testTable->bootedWithColumns(); + $testTable->bootedWithColumnSelect(); + $testTable->bootedWithSecondaryHeader(); + $testTable->booted(); + + $this->assertSame(['id', 'sort', 'name', 'age', 'breed', 'other', 'link', 'rowimg'], $testTable->selectedColumns); + + $testTable->disableColumnSelectEvent(); + $testTable->selectedColumns = ['id', 'sort', 'name', 'age', 'breed', 'other', 'rowimg']; + $this->assertSame(['id', 'sort', 'name', 'age', 'breed', 'other', 'rowimg'], $testTable->selectedColumns); + $testTable->updatedSelectedColumns(); + Event::assertNotDispatched(ColumnsSelected::class); + + $testTable->enableColumnSelectEvent(); + + $testTable->selectedColumns = ['id', 'sort', 'name', 'age', 'breed', 'other', 'link', 'rowimg']; + $this->assertSame(['id', 'sort', 'name', 'age', 'breed', 'other', 'link', 'rowimg'], $testTable->selectedColumns); + $testTable->updatedSelectedColumns(); + Event::assertDispatched(ColumnsSelected::class); + + } + + public function test_event_does_fire_for_columnselect(): void + { + Event::fake(); + + $testTable = new class extends PetsTable + { + public function configure(): void + { + parent::configure(); + $this->enableColumnSelectEvent(); + } + }; + $testTable->configure(); + $testTable->boot(); + $testTable->bootedComponentUtilities(); + $testTable->bootedWithData(); + $testTable->bootedWithColumns(); + $testTable->bootedWithColumnSelect(); + $testTable->bootedWithSecondaryHeader(); + $testTable->booted(); + + $this->assertSame(['id', 'sort', 'name', 'age', 'breed', 'other', 'link', 'rowimg'], $testTable->selectedColumns); + + $testTable->selectedColumns = ['id', 'sort', 'name', 'age', 'breed', 'other', 'link', 'rowimg']; + $this->assertSame(['id', 'sort', 'name', 'age', 'breed', 'other', 'link', 'rowimg'], $testTable->selectedColumns); + $testTable->updatedSelectedColumns(); + Event::assertDispatched(ColumnsSelected::class); + + } + + public function test_event_does_not_fire_for_columnselect(): void + { + Event::fake(); + + $testTable = new class extends PetsTable + { + public function configure(): void + { + parent::configure(); + $this->disableColumnSelectEvent(); + } + }; + $testTable->configure(); + $testTable->boot(); + $testTable->bootedComponentUtilities(); + $testTable->bootedWithData(); + $testTable->bootedWithColumns(); + $testTable->bootedWithColumnSelect(); + $testTable->bootedWithSecondaryHeader(); + $testTable->booted(); + + $this->assertSame(['id', 'sort', 'name', 'age', 'breed', 'other', 'link', 'rowimg'], $testTable->selectedColumns); + $testTable->selectedColumns = ['id', 'sort', 'name', 'age', 'breed', 'other', 'rowimg']; + $this->assertSame(['id', 'sort', 'name', 'age', 'breed', 'other', 'rowimg'], $testTable->selectedColumns); + $testTable->updatedSelectedColumns(); + Event::assertNotDispatched(ColumnsSelected::class); + } } From c5a3a1dfbe8114425068ce9c4e988bb0f83e8b8e Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 17 Nov 2024 06:20:07 +0000 Subject: [PATCH 114/118] Adjustment for DateRangeFilter (#2064) --- src/Views/Filters/DateRangeFilter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Views/Filters/DateRangeFilter.php b/src/Views/Filters/DateRangeFilter.php index 7fae05c82..084353559 100644 --- a/src/Views/Filters/DateRangeFilter.php +++ b/src/Views/Filters/DateRangeFilter.php @@ -28,7 +28,7 @@ public function getKeys(): array return ['minDate' => '', 'maxDate' => '']; } - public function validate(array|string $values): array|bool + public function validate(array|string|null $values): array|bool { $this->getOptions(); $this->getConfigs(); @@ -197,7 +197,7 @@ public function getFilterPillValue($value): array|string|bool|null return ''; } - public function isEmpty(array|string $value): bool + public function isEmpty(array|string|null $value): bool { $values = []; if (is_array($value)) { From eec8385ba5a6db068d7c6282c57d45939d440f83 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 17 Nov 2024 06:20:23 +0000 Subject: [PATCH 115/118] Adjust SessionStorageHelpersTest (#2065) --- .../Unit/Traits/Helpers/SessionStorageHelpersTest.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/Unit/Traits/Helpers/SessionStorageHelpersTest.php b/tests/Unit/Traits/Helpers/SessionStorageHelpersTest.php index 017669ea6..08b252a3f 100644 --- a/tests/Unit/Traits/Helpers/SessionStorageHelpersTest.php +++ b/tests/Unit/Traits/Helpers/SessionStorageHelpersTest.php @@ -33,11 +33,11 @@ public function test_can_store_for_fikers(): void $this->basicTable->setFilter('breed', ['1']); $this->assertSame(['1'], $this->basicTable->getAppliedFilterWithValue('breed')); - $this->assertSame(['breed' => ['1']], $this->basicTable->appliedFilters); + $this->assertSame(['breed' => ['1']], $this->basicTable->filterComponents); $this->assertSame(['breed' => ['1']], $this->basicTable->getStoredFilterValues()); $this->basicTable->setFilter('breed', ['2']); - $this->assertSame(['breed' => ['2']], $this->basicTable->appliedFilters); + $this->assertSame(['breed' => ['2']], $this->basicTable->filterComponents); $this->assertSame(['2'], $this->basicTable->getAppliedFilterWithValue('breed')); $this->assertSame(['breed' => ['2']], $this->basicTable->getStoredFilterValues()); @@ -53,17 +53,16 @@ public function test_can_store_for_fikers(): void $this->assertSame(['breed' => ['3']], $this->basicTable->getStoredFilterValues()); $this->assertSame(['3'], $this->basicTable->getAppliedFilterWithValue('breed')); - $this->basicTable->appliedFilters = $this->basicTable->filterComponents = ['breed' => ['4']]; + $this->basicTable->setFilter('breed', ['4']); $this->basicTable->storeFilterValues(); $this->assertSame(['4'], $this->basicTable->getAppliedFilterWithValue('breed')); - $this->basicTable->appliedFilters = $this->basicTable->filterComponents = []; + $this->basicTable->filterComponents = []; $this->assertNull($this->basicTable->getAppliedFilterWithValue('breed')); - $this->assertSame([], $this->basicTable->appliedFilters); $this->assertSame([], $this->basicTable->filterComponents); $this->basicTable->restoreFilterValues(); - $this->assertSame(['breed' => ['4']], $this->basicTable->appliedFilters); + $this->assertSame(['breed' => ['4']], $this->basicTable->filterComponents); $this->assertSame(['4'], $this->basicTable->getAppliedFilterWithValue('breed')); $this->assertSame(['breed' => ['4']], $this->basicTable->getStoredFilterValues()); From a9afdd8cc71f32ab6596e43d7d90154b388ef655 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 17 Nov 2024 08:38:24 +0000 Subject: [PATCH 116/118] FixSetDefaultPerPage (#2067) * FixSetDefaultPerPage * Update getDefaultPerPage to respect getPerPageAccepted * Fix missing ) * Fix styling * Add test fix * Add final tests --------- Co-authored-by: lrljoe --- .../Configuration/PaginationConfiguration.php | 15 ++++++++++----- src/Traits/Helpers/PaginationHelpers.php | 9 +++++++-- src/Traits/WithPagination.php | 11 +++++++---- .../PaginationConfigurationTest.php | 18 +++++++++++++----- 4 files changed, 37 insertions(+), 16 deletions(-) diff --git a/src/Traits/Configuration/PaginationConfiguration.php b/src/Traits/Configuration/PaginationConfiguration.php index 35c618e0c..a74677255 100644 --- a/src/Traits/Configuration/PaginationConfiguration.php +++ b/src/Traits/Configuration/PaginationConfiguration.php @@ -107,6 +107,13 @@ public function setPerPage(int $perPage): self return $this; } + public function unsetPerPage(): self + { + $this->perPage = null; + + return $this; + } + public function setPaginationMethod(string $paginationMethod): self { $this->paginationMethod = $paginationMethod; @@ -138,12 +145,10 @@ public function setDisplayPaginationDetailsDisabled(): self /** * Set a default per-page value (if not set already by session or querystring) */ - public function setDefaultPerPage(int $perPage): self + public function setDefaultPerPage(int $defaultPerPage): self { - $defaultPerPage = $perPage; - - if ($this->perPage == 10) { - $this->setPerPage($perPage); + if (in_array((int) $defaultPerPage, $this->getPerPageAccepted())) { + $this->defaultPerPage = $defaultPerPage; } return $this; diff --git a/src/Traits/Helpers/PaginationHelpers.php b/src/Traits/Helpers/PaginationHelpers.php index 9654b3a72..b97666ca3 100644 --- a/src/Traits/Helpers/PaginationHelpers.php +++ b/src/Traits/Helpers/PaginationHelpers.php @@ -69,7 +69,12 @@ public function getComputedPageName(): string public function getPerPage(): int { - return $this->perPage; + return $this->perPage ?? $this->getDefaultPerPage(); + } + + public function getDefaultPerPage(): int + { + return in_array((int) $this->defaultPerPage, $this->getPerPageAccepted()) ? $this->defaultPerPage : ($this->getPerPageAccepted()[0] ?? 10); } /** @@ -128,7 +133,7 @@ public function setupPagination(): void if (in_array(session($this->getPerPagePaginationSessionKey(), $this->getPerPage()), $this->getPerPageAccepted(), true)) { $this->setPerPage(session($this->getPerPagePaginationSessionKey(), $this->getPerPage())); } else { - $this->setPerPage($this->getPerPageAccepted()[0] ?? 10); + $this->setPerPage($this->getDefaultPerPage()); } } diff --git a/src/Traits/WithPagination.php b/src/Traits/WithPagination.php index 8e6a44aa0..70e9d508e 100644 --- a/src/Traits/WithPagination.php +++ b/src/Traits/WithPagination.php @@ -15,7 +15,10 @@ trait WithPagination public ?string $pageName = null; - public int $perPage = 10; + public ?int $perPage; + + #[Locked] + public int $defaultPerPage = 10; #[Locked] public array $perPageAccepted = [10, 25, 50]; @@ -57,9 +60,9 @@ trait WithPagination public function mountWithPagination(): void { - $sessionPerPage = session()->get($this->getPerPagePaginationSessionKey(), $this->getPerPageAccepted()[0] ?? 10); + $sessionPerPage = session()->get($this->getPerPagePaginationSessionKey(), $this->getPerPage()); if (! in_array((int) $sessionPerPage, $this->getPerPageAccepted(), false)) { - $sessionPerPage = $this->getPerPageAccepted()[0] ?? 10; + $sessionPerPage = $this->getDefaultPerPage(); } $this->setPerPage($sessionPerPage); } @@ -68,7 +71,7 @@ public function mountWithPagination(): void public function updatedPerPage(int|string $value): void { if (! in_array((int) $value, $this->getPerPageAccepted(), false)) { - $value = $this->getPerPageAccepted()[0] ?? 10; + $value = $this->getDefaultPerPage(); } if (in_array(session($this->getPerPagePaginationSessionKey(), (int) $value), $this->getPerPageAccepted(), true)) { diff --git a/tests/Unit/Traits/Configuration/PaginationConfigurationTest.php b/tests/Unit/Traits/Configuration/PaginationConfigurationTest.php index 62cf06666..7c500aca4 100644 --- a/tests/Unit/Traits/Configuration/PaginationConfigurationTest.php +++ b/tests/Unit/Traits/Configuration/PaginationConfigurationTest.php @@ -113,10 +113,18 @@ public function test_can_set_per_page_manually(): void public function test_can_set_default_per_page(): void { - $this->assertSame(10, $this->unpaginatedTable->getPerPage()); - $this->unpaginatedTable->setDefaultPerPage(50); - $this->assertSame(50, $this->unpaginatedTable->getPerPage()); - $this->unpaginatedTable->perPage = 25; - $this->assertSame(25, $this->unpaginatedTable->getPerPage()); + $this->assertSame(10, $this->basicTable->getPerPage()); + $this->basicTable->unsetPerPage(); + $this->basicTable->setDefaultPerPage(50); + $this->assertSame(50, $this->basicTable->getDefaultPerPage()); + $this->assertSame(50, $this->basicTable->getPerPage()); + $this->basicTable->perPage = 25; + $this->assertSame(25, $this->basicTable->getPerPage()); + $this->basicTable->setPerPage(10); + $this->assertSame(10, $this->basicTable->getPerPage()); + $this->assertSame(50, $this->basicTable->getDefaultPerPage()); + $this->basicTable->unsetPerPage(); + $this->assertSame(50, $this->basicTable->getPerPage()); + } } From 2aeb8823df20d08d16771ff833e4525586782129 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Sun, 17 Nov 2024 09:13:38 +0000 Subject: [PATCH 117/118] Fix BooleanColumn unexpected truthy behaviour (#2066) * Fix BooleanColumn unexpected truthy behaviour * Support previous iteration --- resources/js/laravel-livewire-tables.js | 43 ++++++++++++++++++- resources/js/laravel-livewire-tables.min.js | 2 +- .../tools/filters/boolean.blade.php | 17 +++----- 3 files changed, 49 insertions(+), 13 deletions(-) diff --git a/resources/js/laravel-livewire-tables.js b/resources/js/laravel-livewire-tables.js index 6177ea37f..58964b9d5 100644 --- a/resources/js/laravel-livewire-tables.js +++ b/resources/js/laravel-livewire-tables.js @@ -250,7 +250,6 @@ document.addEventListener('alpine:init', () => { } })); - Alpine.data('booleanFilter', (wire,filterKey,tableName,defaultValue) => ({ switchOn: false, @@ -270,6 +269,47 @@ document.addEventListener('alpine:init', () => { } })); + Alpine.data('newBooleanFilter', (filterKey,tableName,defaultValue) => ({ + switchOn: false, + value: false, + toggleStatus() + { + let tempValue = Boolean(Number(this.$wire.get('filterComponents.'+filterKey) ?? this.value)); + let newBoolean = !tempValue; + this.switchOn = this.value = newBoolean; + return Number(newBoolean); + }, + toggleStatusWithUpdate() + { + let newValue = this.toggleStatus(); + this.$wire.set('filterComponents.'+filterKey, newValue); + }, + toggleStatusWithReset() + { + let newValue = this.toggleStatus(); + this.$wire.call('resetFilter',filterKey); + }, + setSwitchOn(val) + { + let number = Number(val ?? 0); + this.switchOn = Boolean(number); + }, + init() { + this.$nextTick(() => { + this.value = this.$wire.get('filterComponents.'+filterKey) ?? defaultValue; + this.setSwitchOn(this.value ?? 0); + }); + + this.listeners.push( + Livewire.on('filter-was-set', (detail) => { + if(detail.tableName == tableName && detail.filterKey == filterKey) { + this.switchOn = detail.value ?? defaultValue; + } + }) + ); + } + })); + Alpine.data('numberRangeFilter', (wire, filterKey, parentElementPath, filterConfig, childElementRoot) => ({ allFilters: wire.entangle('filterComponents', false), originalMin: 0, @@ -407,7 +447,6 @@ document.addEventListener('alpine:init', () => { })); - Alpine.data('tableWrapper', (wire, showBulkActionsAlpine) => ({ shouldBeDisplayed: wire.entangle('shouldBeDisplayed'), listeners: [], diff --git a/resources/js/laravel-livewire-tables.min.js b/resources/js/laravel-livewire-tables.min.js index a4fb93695..4f13539e9 100644 --- a/resources/js/laravel-livewire-tables.min.js +++ b/resources/js/laravel-livewire-tables.min.js @@ -1 +1 @@ -document.addEventListener("alpine:init",()=>{Alpine.data("laravellivewiretable",e=>({tableId:"",showBulkActionsAlpine:!1,primaryKeyName:"",shouldBeDisplayed:e.entangle("shouldBeDisplayed"),tableName:e.entangle("tableName"),dataTableFingerprint:e.entangle("dataTableFingerprint"),listeners:[],childElementOpen:!1,filtersOpen:e.entangle("filterSlideDownDefaultVisible"),paginationCurrentCount:e.entangle("paginationCurrentCount"),paginationTotalItemCount:e.entangle("paginationTotalItemCount"),paginationCurrentItems:e.entangle("paginationCurrentItems"),selectedItems:e.entangle("selected"),selectAllStatus:e.entangle("selectAll"),delaySelectAll:e.entangle("delaySelectAll"),hideBulkActionsWhenEmpty:e.entangle("hideBulkActionsWhenEmpty"),dragging:!1,reorderEnabled:!1,sourceID:"",targetID:"",evenRowClasses:"",oddRowClasses:"",currentlyHighlightedElement:"",evenRowClassArray:{},oddRowClassArray:{},evenNotInOdd:{},oddNotInEven:{},orderedRows:[],defaultReorderColumn:e.get("defaultReorderColumn"),reorderStatus:e.entangle("reorderStatus"),currentlyReorderingStatus:e.entangle("currentlyReorderingStatus"),hideReorderColumnUnlessReorderingStatus:e.entangle("hideReorderColumnUnlessReorderingStatus"),reorderDisplayColumn:e.entangle("reorderDisplayColumn"),dragStart(e){this.$nextTick(()=>{this.setupEvenOddClasses()}),this.sourceID=e.target.id,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id),e.target.classList.add("laravel-livewire-tables-dragging")},dragOverEvent(e){"object"==typeof this.currentlyHighlightedElement&&this.currentlyHighlightedElement.classList.remove("laravel-livewire-tables-highlight-bottom","laravel-livewire-tables-highlight-top");let t=e.target.closest("tr");this.currentlyHighlightedElement=t,e.offsetYt.getBoundingClientRect().height/2?l.insertBefore(i,t.nextSibling):l.insertBefore(i,t),a{this.setupEvenOddClasses()})},cancelReorder(){this.hideReorderColumnUnlessReorderingStatus&&(this.reorderDisplayColumn=!1),e.disableReordering()},updateOrderedItems(){let t=document.getElementById(this.tableId),l=[];for(let i=1,s;s=t.rows[i];i++)l.push({[this.primaryKeyName]:s.getAttribute("rowpk"),[this.defaultReorderColumn]:i});e.storeReorder(l)},setupEvenOddClasses(){if(void 0===this.evenNotInOdd.length||0==this.evenNotInOdd.length||void 0===this.oddNotInEven.length||0==this.oddNotInEven.length){let e=document.getElementById(this.tableId).getElementsByTagName("tbody")[0],t=[],l=[];void 0!==e.rows[0]&&void 0!==e.rows[1]&&(t=Array.from(e.rows[0].classList),l=Array.from(e.rows[1].classList),this.evenNotInOdd=t.filter(e=>!l.includes(e)),this.oddNotInEven=l.filter(e=>!t.includes(e)),t=[],l=[])}},toggleSelectAll(){this.showBulkActionsAlpine&&(this.paginationTotalItemCount===this.selectedItems.length?(this.clearSelected(),this.selectAllStatus=!1):this.delaySelectAll?this.setAllItemsSelected():this.setAllSelected())},setAllItemsSelected(){this.showBulkActionsAlpine&&(this.selectAllStatus=!0,this.selectAllOnPage())},setAllSelected(){this.showBulkActionsAlpine&&(this.delaySelectAll?(this.selectAllStatus=!0,this.selectAllOnPage()):e.setAllSelected())},clearSelected(){this.showBulkActionsAlpine&&(this.selectAllStatus=!1,e.clearSelected())},selectAllOnPage(){if(!this.showBulkActionsAlpine)return;let e=this.selectedItems,t=this.paginationCurrentItems.values();for(let l of t)e.push(l.toString());this.selectedItems=[...new Set(e)]},setTableId(e){this.tableId=e},setAlpineBulkActions(e){this.showBulkActionsAlpine=e},setPrimaryKeyName(e){this.primaryKeyName=e},showTable(e){let t=e.detail.tableName??"",l=e.detail.tableFingerpint??"";((t??"")!=""&&t===this.tableName||""!=l&&eventTableFingerpint===this.dataTableFingerprint)&&(this.shouldBeDisplayed=!0)},hideTable(e){let t=e.detail.tableName??"",l=e.detail.tableFingerpint??"";(""!=t&&t===this.tableName||""!=l&&eventTableFingerpint===this.dataTableFingerprint)&&(this.shouldBeDisplayed=!1)},destroy(){this.listeners.forEach(e=>{e()})}})),Alpine.data("booleanFilter",(e,t,l,i)=>({switchOn:!1,value:e.entangle("filterComponents."+t).live,init(){this.switchOn=!1,void 0!==this.value&&(this.switchOn=Boolean(Number(this.value))),this.listeners.push(Livewire.on("filter-was-set",e=>{e.tableName==l&&e.filterKey==t&&(this.switchOn=e.value??i)}))}})),Alpine.data("numberRangeFilter",(e,t,l,i,s)=>({allFilters:e.entangle("filterComponents",!1),originalMin:0,originalMax:100,filterMin:0,filterMax:100,currentMin:0,currentMax:100,hasUpdate:!1,wireValues:e.entangle("filterComponents."+t,!1),defaultMin:i.minRange,defaultMax:i.maxRange,restrictUpdates:!1,initialiseStyles(){let e=document.getElementById(l);e.style.setProperty("--value-a",this.wireValues.min??this.filterMin),e.style.setProperty("--text-value-a",JSON.stringify(this.wireValues.min??this.filterMin)),e.style.setProperty("--value-b",this.wireValues.max??this.filterMax),e.style.setProperty("--text-value-b",JSON.stringify(this.wireValues.max??this.filterMax))},updateStyles(e,t){let i=document.getElementById(l);i.style.setProperty("--value-a",e),i.style.setProperty("--text-value-a",JSON.stringify(e)),i.style.setProperty("--value-b",t),i.style.setProperty("--text-value-b",JSON.stringify(t))},setupWire(){void 0!==this.wireValues?(this.filterMin=this.originalMin=void 0!==this.wireValues.min?this.wireValues.min:this.defaultMin,this.filterMax=this.originalMax=void 0!==this.wireValues.max?this.wireValues.max:this.defaultMax):(this.filterMin=this.originalMin=this.defaultMin,this.filterMax=this.originalMax=this.defaultMax),this.updateStyles(this.filterMin,this.filterMax)},allowUpdates(){this.updateWire()},updateWire(){let e=parseInt(this.filterMin),t=parseInt(this.filterMax);(e!=this.originalMin||t!=this.originalMax)&&(tthis.setupWire())}})),Alpine.data("flatpickrFilter",(e,t,l,i,s)=>({wireValues:e.entangle("filterComponents."+t),flatpickrInstance:flatpickr(i,{mode:"range",altFormat:l.altFormat??"F j, Y",altInput:l.altInput??!1,allowInput:l.allowInput??!1,allowInvalidPreload:l.allowInvalidPreload??!0,ariaDateFormat:l.ariaDateFormat??"F j, Y",clickOpens:!0,dateFormat:l.dateFormat??"Y-m-d",defaultDate:l.defaultDate??null,defaultHour:l.defaultHour??12,defaultMinute:l.defaultMinute??0,enableTime:l.enableTime??!1,enableSeconds:l.enableSeconds??!1,hourIncrement:l.hourIncrement??1,locale:l.locale??"en",minDate:l.earliestDate??null,maxDate:l.latestDate??null,minuteIncrement:l.minuteIncrement??5,shorthandCurrentMonth:l.shorthandCurrentMonth??!1,time_24hr:l.time_24hr??!1,weekNumbers:l.weekNumbers??!1,onOpen:function(){window.childElementOpen=!0},onChange:function(l,i,s){if(l.length>1){var a=i.split(" "),n={};window.childElementOpen=!1,window.filterPopoverOpen=!1,n={minDate:a[0],maxDate:void 0===a[2]?a[0]:a[2]},e.set("filterComponents."+t,n)}}}),changedValue:function(l){l.length<5&&(this.flatpickrInstance.setDate([]),e.set("filterComponents."+t,{}))},setupWire(){if(void 0!==this.wireValues){if(void 0!==this.wireValues.minDate&&void 0!==this.wireValues.maxDate){let e=[this.wireValues.minDate,this.wireValues.maxDate];this.flatpickrInstance.setDate(e)}else this.flatpickrInstance.setDate([])}else this.flatpickrInstance.setDate([])},init(){this.setupWire(),this.$watch("wireValues",e=>this.setupWire())}})),Alpine.data("tableWrapper",(e,t)=>({shouldBeDisplayed:e.entangle("shouldBeDisplayed"),listeners:[],childElementOpen:!1,filtersOpen:e.entangle("filterSlideDownDefaultVisible"),paginationCurrentCount:e.entangle("paginationCurrentCount"),paginationTotalItemCount:e.entangle("paginationTotalItemCount"),paginationCurrentItems:e.entangle("paginationCurrentItems"),selectedItems:e.entangle("selected"),selectAllStatus:e.entangle("selectAll"),delaySelectAll:e.entangle("delaySelectAll"),hideBulkActionsWhenEmpty:e.entangle("hideBulkActionsWhenEmpty"),toggleSelectAll(){t&&(this.paginationTotalItemCount===this.selectedItems.length?(this.clearSelected(),this.selectAllStatus=!1):this.delaySelectAll?this.setAllItemsSelected():this.setAllSelected())},setAllItemsSelected(){t&&(this.selectAllStatus=!0,this.selectAllOnPage())},setAllSelected(){t&&(this.delaySelectAll?(this.selectAllStatus=!0,this.selectAllOnPage()):e.setAllSelected())},clearSelected(){t&&(this.selectAllStatus=!1,e.clearSelected())},selectAllOnPage(){if(!t)return;let e=this.selectedItems,l=this.paginationCurrentItems.values();for(let i of l)e.push(i.toString());this.selectedItems=[...new Set(e)]},destroy(){this.listeners.forEach(e=>{e()})}})),Alpine.data("reorderFunction",(e,t,l)=>({dragging:!1,reorderEnabled:!1,sourceID:"",targetID:"",evenRowClasses:"",oddRowClasses:"",currentlyHighlightedElement:"",evenRowClassArray:{},oddRowClassArray:{},evenNotInOdd:{},oddNotInEven:{},orderedRows:[],defaultReorderColumn:e.get("defaultReorderColumn"),reorderStatus:e.get("reorderStatus"),currentlyReorderingStatus:e.entangle("currentlyReorderingStatus"),hideReorderColumnUnlessReorderingStatus:e.entangle("hideReorderColumnUnlessReorderingStatus"),reorderDisplayColumn:e.entangle("reorderDisplayColumn"),dragStart(e){this.$nextTick(()=>{this.setupEvenOddClasses()}),this.sourceID=e.target.id,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id),e.target.classList.add("laravel-livewire-tables-dragging")},dragOverEvent(e){"object"==typeof this.currentlyHighlightedElement&&this.currentlyHighlightedElement.classList.remove("laravel-livewire-tables-highlight-bottom","laravel-livewire-tables-highlight-top");let t=e.target.closest("tr");this.currentlyHighlightedElement=t,e.offsetYl.getBoundingClientRect().height/2?i.insertBefore(s,l.nextSibling):i.insertBefore(s,l),n{this.setupEvenOddClasses()}),this.currentlyReorderingStatus?e.disableReordering():(this.setupEvenOddClasses(),this.hideReorderColumnUnlessReorderingStatus&&(this.reorderDisplayColumn=!0),e.enableReordering())},cancelReorder(){this.hideReorderColumnUnlessReorderingStatus&&(this.reorderDisplayColumn=!1),e.disableReordering()},updateOrderedItems(){let i=document.getElementById(t),s=[];for(let a=1,n;n=i.rows[a];a++)s.push({[l]:n.getAttribute("rowpk"),[this.defaultReorderColumn]:a});e.storeReorder(s)},setupEvenOddClasses(){if(void 0===this.evenNotInOdd.length||0==this.evenNotInOdd.length||void 0===this.oddNotInEven.length||0==this.oddNotInEven.length){let e=document.getElementById(t).getElementsByTagName("tbody")[0],l=[],i=[];void 0!==e.rows[0]&&void 0!==e.rows[1]&&(l=Array.from(e.rows[0].classList),i=Array.from(e.rows[1].classList),this.evenNotInOdd=l.filter(e=>!i.includes(e)),this.oddNotInEven=i.filter(e=>!l.includes(e)),l=[],i=[])}},init(){}}))}); \ No newline at end of file +document.addEventListener("alpine:init",()=>{Alpine.data("laravellivewiretable",e=>({tableId:"",showBulkActionsAlpine:!1,primaryKeyName:"",shouldBeDisplayed:e.entangle("shouldBeDisplayed"),tableName:e.entangle("tableName"),dataTableFingerprint:e.entangle("dataTableFingerprint"),listeners:[],childElementOpen:!1,filtersOpen:e.entangle("filterSlideDownDefaultVisible"),paginationCurrentCount:e.entangle("paginationCurrentCount"),paginationTotalItemCount:e.entangle("paginationTotalItemCount"),paginationCurrentItems:e.entangle("paginationCurrentItems"),selectedItems:e.entangle("selected"),selectAllStatus:e.entangle("selectAll"),delaySelectAll:e.entangle("delaySelectAll"),hideBulkActionsWhenEmpty:e.entangle("hideBulkActionsWhenEmpty"),dragging:!1,reorderEnabled:!1,sourceID:"",targetID:"",evenRowClasses:"",oddRowClasses:"",currentlyHighlightedElement:"",evenRowClassArray:{},oddRowClassArray:{},evenNotInOdd:{},oddNotInEven:{},orderedRows:[],defaultReorderColumn:e.get("defaultReorderColumn"),reorderStatus:e.entangle("reorderStatus"),currentlyReorderingStatus:e.entangle("currentlyReorderingStatus"),hideReorderColumnUnlessReorderingStatus:e.entangle("hideReorderColumnUnlessReorderingStatus"),reorderDisplayColumn:e.entangle("reorderDisplayColumn"),dragStart(e){this.$nextTick(()=>{this.setupEvenOddClasses()}),this.sourceID=e.target.id,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id),e.target.classList.add("laravel-livewire-tables-dragging")},dragOverEvent(e){"object"==typeof this.currentlyHighlightedElement&&this.currentlyHighlightedElement.classList.remove("laravel-livewire-tables-highlight-bottom","laravel-livewire-tables-highlight-top");let t=e.target.closest("tr");this.currentlyHighlightedElement=t,e.offsetYt.getBoundingClientRect().height/2?l.insertBefore(i,t.nextSibling):l.insertBefore(i,t),a{this.setupEvenOddClasses()})},cancelReorder(){this.hideReorderColumnUnlessReorderingStatus&&(this.reorderDisplayColumn=!1),e.disableReordering()},updateOrderedItems(){let t=document.getElementById(this.tableId),l=[];for(let i=1,s;s=t.rows[i];i++)l.push({[this.primaryKeyName]:s.getAttribute("rowpk"),[this.defaultReorderColumn]:i});e.storeReorder(l)},setupEvenOddClasses(){if(void 0===this.evenNotInOdd.length||0==this.evenNotInOdd.length||void 0===this.oddNotInEven.length||0==this.oddNotInEven.length){let e=document.getElementById(this.tableId).getElementsByTagName("tbody")[0],t=[],l=[];void 0!==e.rows[0]&&void 0!==e.rows[1]&&(t=Array.from(e.rows[0].classList),l=Array.from(e.rows[1].classList),this.evenNotInOdd=t.filter(e=>!l.includes(e)),this.oddNotInEven=l.filter(e=>!t.includes(e)),t=[],l=[])}},toggleSelectAll(){this.showBulkActionsAlpine&&(this.paginationTotalItemCount===this.selectedItems.length?(this.clearSelected(),this.selectAllStatus=!1):this.delaySelectAll?this.setAllItemsSelected():this.setAllSelected())},setAllItemsSelected(){this.showBulkActionsAlpine&&(this.selectAllStatus=!0,this.selectAllOnPage())},setAllSelected(){this.showBulkActionsAlpine&&(this.delaySelectAll?(this.selectAllStatus=!0,this.selectAllOnPage()):e.setAllSelected())},clearSelected(){this.showBulkActionsAlpine&&(this.selectAllStatus=!1,e.clearSelected())},selectAllOnPage(){if(!this.showBulkActionsAlpine)return;let e=this.selectedItems,t=this.paginationCurrentItems.values();for(let l of t)e.push(l.toString());this.selectedItems=[...new Set(e)]},setTableId(e){this.tableId=e},setAlpineBulkActions(e){this.showBulkActionsAlpine=e},setPrimaryKeyName(e){this.primaryKeyName=e},showTable(e){let t=e.detail.tableName??"",l=e.detail.tableFingerpint??"";((t??"")!=""&&t===this.tableName||""!=l&&eventTableFingerpint===this.dataTableFingerprint)&&(this.shouldBeDisplayed=!0)},hideTable(e){let t=e.detail.tableName??"",l=e.detail.tableFingerpint??"";(""!=t&&t===this.tableName||""!=l&&eventTableFingerpint===this.dataTableFingerprint)&&(this.shouldBeDisplayed=!1)},destroy(){this.listeners.forEach(e=>{e()})}})),Alpine.data("booleanFilter",(e,t,l,i)=>({switchOn:!1,value:e.entangle("filterComponents."+t).live,init(){this.switchOn=!1,void 0!==this.value&&(this.switchOn=Boolean(Number(this.value))),this.listeners.push(Livewire.on("filter-was-set",e=>{e.tableName==l&&e.filterKey==t&&(this.switchOn=e.value??i)}))}})),Alpine.data("newBooleanFilter",(e,t,l)=>({switchOn:!1,value:!1,toggleStatus(){let t=!Boolean(Number(this.$wire.get("filterComponents."+e)??this.value));return this.switchOn=this.value=t,Number(t)},toggleStatusWithUpdate(){let t=this.toggleStatus();this.$wire.set("filterComponents."+e,t)},toggleStatusWithReset(){this.toggleStatus(),this.$wire.call("resetFilter",e)},setSwitchOn(e){let t=Number(e??0);this.switchOn=Boolean(t)},init(){this.$nextTick(()=>{this.value=this.$wire.get("filterComponents."+e)??l,this.setSwitchOn(this.value??0)}),this.listeners.push(Livewire.on("filter-was-set",i=>{i.tableName==t&&i.filterKey==e&&(this.switchOn=i.value??l)}))}})),Alpine.data("numberRangeFilter",(e,t,l,i,s)=>({allFilters:e.entangle("filterComponents",!1),originalMin:0,originalMax:100,filterMin:0,filterMax:100,currentMin:0,currentMax:100,hasUpdate:!1,wireValues:e.entangle("filterComponents."+t,!1),defaultMin:i.minRange,defaultMax:i.maxRange,restrictUpdates:!1,initialiseStyles(){let e=document.getElementById(l);e.style.setProperty("--value-a",this.wireValues.min??this.filterMin),e.style.setProperty("--text-value-a",JSON.stringify(this.wireValues.min??this.filterMin)),e.style.setProperty("--value-b",this.wireValues.max??this.filterMax),e.style.setProperty("--text-value-b",JSON.stringify(this.wireValues.max??this.filterMax))},updateStyles(e,t){let i=document.getElementById(l);i.style.setProperty("--value-a",e),i.style.setProperty("--text-value-a",JSON.stringify(e)),i.style.setProperty("--value-b",t),i.style.setProperty("--text-value-b",JSON.stringify(t))},setupWire(){void 0!==this.wireValues?(this.filterMin=this.originalMin=void 0!==this.wireValues.min?this.wireValues.min:this.defaultMin,this.filterMax=this.originalMax=void 0!==this.wireValues.max?this.wireValues.max:this.defaultMax):(this.filterMin=this.originalMin=this.defaultMin,this.filterMax=this.originalMax=this.defaultMax),this.updateStyles(this.filterMin,this.filterMax)},allowUpdates(){this.updateWire()},updateWire(){let e=parseInt(this.filterMin),t=parseInt(this.filterMax);(e!=this.originalMin||t!=this.originalMax)&&(tthis.setupWire())}})),Alpine.data("flatpickrFilter",(e,t,l,i,s)=>({wireValues:e.entangle("filterComponents."+t),flatpickrInstance:flatpickr(i,{mode:"range",altFormat:l.altFormat??"F j, Y",altInput:l.altInput??!1,allowInput:l.allowInput??!1,allowInvalidPreload:l.allowInvalidPreload??!0,ariaDateFormat:l.ariaDateFormat??"F j, Y",clickOpens:!0,dateFormat:l.dateFormat??"Y-m-d",defaultDate:l.defaultDate??null,defaultHour:l.defaultHour??12,defaultMinute:l.defaultMinute??0,enableTime:l.enableTime??!1,enableSeconds:l.enableSeconds??!1,hourIncrement:l.hourIncrement??1,locale:l.locale??"en",minDate:l.earliestDate??null,maxDate:l.latestDate??null,minuteIncrement:l.minuteIncrement??5,shorthandCurrentMonth:l.shorthandCurrentMonth??!1,time_24hr:l.time_24hr??!1,weekNumbers:l.weekNumbers??!1,onOpen:function(){window.childElementOpen=!0},onChange:function(l,i,s){if(l.length>1){var a=i.split(" "),n={};window.childElementOpen=!1,window.filterPopoverOpen=!1,n={minDate:a[0],maxDate:void 0===a[2]?a[0]:a[2]},e.set("filterComponents."+t,n)}}}),changedValue:function(l){l.length<5&&(this.flatpickrInstance.setDate([]),e.set("filterComponents."+t,{}))},setupWire(){if(void 0!==this.wireValues){if(void 0!==this.wireValues.minDate&&void 0!==this.wireValues.maxDate){let e=[this.wireValues.minDate,this.wireValues.maxDate];this.flatpickrInstance.setDate(e)}else this.flatpickrInstance.setDate([])}else this.flatpickrInstance.setDate([])},init(){this.setupWire(),this.$watch("wireValues",e=>this.setupWire())}})),Alpine.data("tableWrapper",(e,t)=>({shouldBeDisplayed:e.entangle("shouldBeDisplayed"),listeners:[],childElementOpen:!1,filtersOpen:e.entangle("filterSlideDownDefaultVisible"),paginationCurrentCount:e.entangle("paginationCurrentCount"),paginationTotalItemCount:e.entangle("paginationTotalItemCount"),paginationCurrentItems:e.entangle("paginationCurrentItems"),selectedItems:e.entangle("selected"),selectAllStatus:e.entangle("selectAll"),delaySelectAll:e.entangle("delaySelectAll"),hideBulkActionsWhenEmpty:e.entangle("hideBulkActionsWhenEmpty"),toggleSelectAll(){t&&(this.paginationTotalItemCount===this.selectedItems.length?(this.clearSelected(),this.selectAllStatus=!1):this.delaySelectAll?this.setAllItemsSelected():this.setAllSelected())},setAllItemsSelected(){t&&(this.selectAllStatus=!0,this.selectAllOnPage())},setAllSelected(){t&&(this.delaySelectAll?(this.selectAllStatus=!0,this.selectAllOnPage()):e.setAllSelected())},clearSelected(){t&&(this.selectAllStatus=!1,e.clearSelected())},selectAllOnPage(){if(!t)return;let e=this.selectedItems,l=this.paginationCurrentItems.values();for(let i of l)e.push(i.toString());this.selectedItems=[...new Set(e)]},destroy(){this.listeners.forEach(e=>{e()})}})),Alpine.data("reorderFunction",(e,t,l)=>({dragging:!1,reorderEnabled:!1,sourceID:"",targetID:"",evenRowClasses:"",oddRowClasses:"",currentlyHighlightedElement:"",evenRowClassArray:{},oddRowClassArray:{},evenNotInOdd:{},oddNotInEven:{},orderedRows:[],defaultReorderColumn:e.get("defaultReorderColumn"),reorderStatus:e.get("reorderStatus"),currentlyReorderingStatus:e.entangle("currentlyReorderingStatus"),hideReorderColumnUnlessReorderingStatus:e.entangle("hideReorderColumnUnlessReorderingStatus"),reorderDisplayColumn:e.entangle("reorderDisplayColumn"),dragStart(e){this.$nextTick(()=>{this.setupEvenOddClasses()}),this.sourceID=e.target.id,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",e.target.id),e.target.classList.add("laravel-livewire-tables-dragging")},dragOverEvent(e){"object"==typeof this.currentlyHighlightedElement&&this.currentlyHighlightedElement.classList.remove("laravel-livewire-tables-highlight-bottom","laravel-livewire-tables-highlight-top");let t=e.target.closest("tr");this.currentlyHighlightedElement=t,e.offsetYl.getBoundingClientRect().height/2?i.insertBefore(s,l.nextSibling):i.insertBefore(s,l),n{this.setupEvenOddClasses()}),this.currentlyReorderingStatus?e.disableReordering():(this.setupEvenOddClasses(),this.hideReorderColumnUnlessReorderingStatus&&(this.reorderDisplayColumn=!0),e.enableReordering())},cancelReorder(){this.hideReorderColumnUnlessReorderingStatus&&(this.reorderDisplayColumn=!1),e.disableReordering()},updateOrderedItems(){let i=document.getElementById(t),s=[];for(let a=1,n;n=i.rows[a];a++)s.push({[l]:n.getAttribute("rowpk"),[this.defaultReorderColumn]:a});e.storeReorder(s)},setupEvenOddClasses(){if(void 0===this.evenNotInOdd.length||0==this.evenNotInOdd.length||void 0===this.oddNotInEven.length||0==this.oddNotInEven.length){let e=document.getElementById(t).getElementsByTagName("tbody")[0],l=[],i=[];void 0!==e.rows[0]&&void 0!==e.rows[1]&&(l=Array.from(e.rows[0].classList),i=Array.from(e.rows[1].classList),this.evenNotInOdd=l.filter(e=>!i.includes(e)),this.oddNotInEven=i.filter(e=>!l.includes(e)),l=[],i=[])}},init(){}}))}); \ No newline at end of file diff --git a/resources/views/components/tools/filters/boolean.blade.php b/resources/views/components/tools/filters/boolean.blade.php index 973dfa268..a2d9e12d9 100644 --- a/resources/views/components/tools/filters/boolean.blade.php +++ b/resources/views/components/tools/filters/boolean.blade.php @@ -1,24 +1,21 @@ @php($defaultValue = ($filter->hasFilterDefaultValue() ? (bool) $filter->getFilterDefaultValue() : false))
- + -