Skip to content

Commit 392e7d5

Browse files
committed
Rearrange wire:keys
1 parent 8f8fc73 commit 392e7d5

12 files changed

+41
-17
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
1111
- `$searchFilterDebounce`, `$searchFilterDefer`, `$searchFilterLazy`, for defining the search input data binding property. https://github.com/rappasoft/laravel-livewire-tables/pull/211
1212
- Remove ability to need to define filters if not defining defaults. https://github.com/rappasoft/laravel-livewire-tables/pull/213
1313

14+
### Changed
15+
16+
- Rearrange wire:keys
17+
1418
## [1.0.3] - 2021-04-18
1519

1620
### Added

resources/views/bootstrap-4/includes/bulk-actions.blade.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66

77
<div class="dropdown-menu dropdown-menu-right w-100" aria-labelledby="bulkActions">
88
@foreach($bulkActions as $action => $title)
9-
<a href="#" wire:click.prevent="{{ $action }}" class="dropdown-item">{{ $title }}</a>
9+
<a
10+
href="#"
11+
wire:click.prevent="{{ $action }}"
12+
wire:key="bulk-action-{{ $action }}"
13+
class="dropdown-item"
14+
>
15+
{{ $title }}
16+
</a>
1017
@endforeach
1118
</div>
1219
</div>

resources/views/bootstrap-4/includes/filter-pills.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@if ($showFilters && count(array_filter($filters)) && !(count(array_filter($filters)) === 1 && isset($filters['search'])))
2-
<div wire:key="filter-badges" class="mb-3">
2+
<div class="mb-3">
33
<small class="text-secondary">@lang('Applied Filters'):</small>
44

55
@foreach($filters as $key => $value)
66
@if ($key !== 'search' && strlen($value))
77
<span
8-
wire:key="filter-{{ $key }}"
8+
wire:key="filter-pill-{{ $key }}"
99
class="badge badge-pill badge-info d-inline-flex align-items-center"
1010
>
1111
{{ $filterNames[$key] ?? ucwords(strtr($key, ['_' => ' ', '-' => ' '])) }}: {{ ucwords(strtr($value, ['_' => ' ', '-' => ' '])) }}

resources/views/bootstrap-4/includes/filters.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@include($filtersView)
1818
@elseif (count($customFilters))
1919
@foreach ($customFilters as $key => $filter)
20-
<div class="p-2">
20+
<div wire:key="filter-{{ $key }}" class="p-2">
2121
@if ($filter->isSelect())
2222
<label for="filter-{{ $key }}" class="mb-2">
2323
{{ $filter->name() }}

resources/views/bootstrap-4/includes/sorting-pills.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
@if ($showSorting && count($sorts))
2-
<div wire:key="sort-badges" class="mb-3">
2+
<div class="mb-3">
33
<small class="text-secondary">@lang('Applied Sorting'):</small>
44

55
@foreach($sorts as $col => $dir)
66
<span
7-
wire:key="sort-{{ $col }}"
7+
wire:key="sorting-pill-{{ $key }}"
88
class="badge badge-pill badge-info d-inline-flex align-items-center"
99
>
1010
<span>{{ $sortNames[$col] ?? ucwords(strtr($col, ['_' => ' ', '-' => ' '])) }}: {{ $dir === 'asc' ? 'A-Z' : 'Z-A' }}</span>

resources/views/bootstrap-5/includes/bulk-actions.blade.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66

77
<div class="dropdown-menu dropdown-menu-end w-100" aria-labelledby="bulkActions">
88
@foreach($bulkActions as $action => $title)
9-
<a href="#" wire:click.prevent="{{ $action }}" class="dropdown-item">{{ $title }}</a>
9+
<a
10+
href="#"
11+
wire:click.prevent="{{ $action }}"
12+
wire:key="bulk-action-{{ $action }}"
13+
class="dropdown-item"
14+
>
15+
{{ $title }}
16+
</a>
1017
@endforeach
1118
</div>
1219
</div>

resources/views/bootstrap-5/includes/filter-pills.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@if ($showFilters && count(array_filter($filters)) && !(count(array_filter($filters)) === 1 && isset($filters['search'])))
2-
<div wire:key="filter-badges" class="mb-3">
2+
<div class="mb-3">
33
<small class="text-secondary">@lang('Applied Filters'):</small>
44

55
@foreach($filters as $key => $value)
66
@if ($key !== 'search' && strlen($value))
77
<span
8-
wire:key="filter-{{ $key }}"
8+
wire:key="filter-pill-{{ $key }}"
99
class="badge rounded-pill bg-info d-inline-flex align-items-center"
1010
>
1111
{{ $filterNames[$key] ?? ucwords(strtr($key, ['_' => ' ', '-' => ' '])) }}: {{ ucwords(strtr($value, ['_' => ' ', '-' => ' '])) }}

resources/views/bootstrap-5/includes/filters.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@include($filtersView)
1818
@elseif (count($customFilters))
1919
@foreach ($customFilters as $key => $filter)
20-
<div class="p-2">
20+
<div wire:key="filter-{{ $key }}" class="p-2">
2121
@if ($filter->isSelect())
2222
<label for="filter-{{ $key }}" class="mb-2">
2323
{{ $filter->name() }}

resources/views/bootstrap-5/includes/sorting-pills.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
@if ($showSorting && count($sorts))
2-
<div wire:key="sort-badges" class="mb-3">
2+
<div class="mb-3">
33
<small class="text-secondary">@lang('Applied Sorting'):</small>
44

55
@foreach($sorts as $col => $dir)
66
<span
7-
wire:key="sort-{{ $col }}"
7+
wire:key="sorting-pill-{{ $key }}"
88
class="badge rounded-pill bg-info d-inline-flex align-items-center"
99
>
1010
<span>{{ $sortNames[$col] ?? ucwords(strtr($col, ['_' => ' ', '-' => ' '])) }}: {{ $dir === 'asc' ? 'A-Z' : 'Z-A' }}</span>

resources/views/tailwind/includes/bulk-actions.blade.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ class="origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg z-50"
4040
<div class="rounded-md bg-white shadow-xs">
4141
<div class="py-1" role="menu" aria-orientation="vertical" aria-labelledby="options-menu">
4242
@foreach($bulkActions as $action => $title)
43-
<button wire:click="{{ $action }}" type="button" class="block w-full px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900 flex items-center space-x-2" role="menuitem">
43+
<button
44+
wire:click="{{ $action }}"
45+
wire:key="bulk-action-{{ $action }}"
46+
type="button"
47+
class="block w-full px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900 flex items-center space-x-2"
48+
role="menuitem"
49+
>
4450
<span>{{ $title }}</span>
4551
</button>
4652
@endforeach

0 commit comments

Comments
 (0)