|
2 | 2 | <x-livewire-tables::tools.filter-label :$filter :$filterLayout :$tableName :$isTailwind :$isBootstrap4 :$isBootstrap5 :$isBootstrap /> |
3 | 3 |
|
4 | 4 | @if ($isTailwind) |
5 | | - <div class="rounded-md shadow-sm"> |
6 | | - <div> |
7 | | - <input |
8 | | - type="checkbox" |
9 | | - id="{{ $tableName }}-filter-{{ $filter->getKey() }}-select-all-@if($filter->hasCustomPosition()){{ $filter->getCustomPosition() }}@endif" |
10 | | - wire:input="selectAllFilterOptions('{{ $filter->getKey() }}')" |
11 | | - class="text-indigo-600 rounded border-gray-300 shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600 disabled:opacity-50 disabled:cursor-wait" |
12 | | - > |
13 | | - <label for="{{ $tableName }}-filter-{{ $filter->getKey() }}-select-all-@if($filter->hasCustomPosition()){{ $filter->getCustomPosition() }}@endif" class="dark:text-white"> |
| 5 | + <div class="rounded-md shadow-sm"> |
| 6 | + @endif |
| 7 | + <div @class(['form-check' => $isBootstrap])> |
| 8 | + <input id="{{ $tableName }}-filter-{{ $filter->getKey() }}-select-all{{ $filter->hasCustomPosition() ? '-'.$filter->getCustomPosition() : null }}" wire:input="selectAllFilterOptions('{{ $filter->getKey() }}')" {{ |
| 9 | + $filterInputAttributes->merge([ |
| 10 | + 'type' => 'checkbox' |
| 11 | + ]) |
| 12 | + ->class([ |
| 13 | + 'rounded shadow-sm transition duration-150 ease-in-out focus:ring focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-wait' => $isTailwind && ($filterInputAttributes['default-styling'] ?? true), |
| 14 | + 'text-indigo-600 border-gray-300 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600 ' => $isTailwind && ($filterInputAttributes['default-colors'] ?? true), |
| 15 | + 'form-check-input' => $isBootstrap && ($filterInputAttributes['default-styling'] ?? true), |
| 16 | + ]) |
| 17 | + ->except(['id','wire:key','value','default-styling','default-colors']) |
| 18 | + }}> |
| 19 | + <label for="{{ $tableName }}-filter-{{ $filter->getKey() }}-select-all{{ $filter->hasCustomPosition() ? '-'.$filter->getCustomPosition() : null }}" @class([ |
| 20 | + 'dark:text-white' => $isTailwind, |
| 21 | + 'form-check-label' => $isBootstrap, |
| 22 | + ])> |
14 | 23 | @if ($filter->getFirstOption() !== '') |
15 | 24 | {{ $filter->getFirstOption() }} |
16 | 25 | @else |
17 | 26 | {{ __($localisationPath.'All') }} |
18 | 27 | @endif |
19 | | - </label> |
20 | | - </div> |
21 | | - |
22 | | - @foreach($filter->getOptions() as $key => $value) |
23 | | - <div wire:key="{{ $tableName }}-filter-{{ $filter->getKey() }}-multiselect-{{ $key }}-@if($filter->hasCustomPosition()){{ $filter->getCustomPosition() }}@endif"> |
24 | | - <input |
25 | | - type="checkbox" |
26 | | - id="{{ $tableName }}-filter-{{ $filter->getKey() }}-{{ $loop->index }}-@if($filter->hasCustomPosition()){{ $filter->getCustomPosition() }}@endif" |
27 | | - value="{{ $key }}" |
28 | | - wire:key="{{ $tableName }}-filter-{{ $filter->getKey() }}-{{ $loop->index }}-@if($filter->hasCustomPosition()){{ $filter->getCustomPosition() }}@endif" |
29 | | - {{ $filter->getWireMethod('filterComponents.'.$filter->getKey()) }} |
30 | | - class="text-indigo-600 rounded border-gray-300 shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600 disabled:opacity-50 disabled:cursor-wait" |
31 | | - > |
32 | | - <label for="{{ $tableName }}-filter-{{ $filter->getKey() }}-{{ $loop->index }}-@if($filter->hasCustomPosition()){{ $filter->getCustomPosition() }}@endif" class="dark:text-white">{{ $value }}</label> |
33 | | - </div> |
34 | | - @endforeach |
35 | | - </div> |
36 | | - @elseif ($isBootstrap) |
37 | | - <div class="form-check"> |
38 | | - <input |
39 | | - type="checkbox" |
40 | | - id="{{ $tableName }}-filter-{{ $filter->getKey() }}-select-all-@if($filter->hasCustomPosition()){{ $filter->getCustomPosition() }}@endif" |
41 | | - wire:input="selectAllFilterOptions('{{ $filter->getKey() }}')" |
42 | | - class="form-check-input" |
43 | | - > |
44 | | - <label class="form-check-label" for="{{ $tableName }}-filter-{{ $filter->getKey() }}-@if($filter->hasCustomPosition()){{ $filter->getCustomPosition() }}@endif-select-all">{{ __($localisationPath.'All') }}</label> |
| 28 | + </label> |
45 | 29 | </div> |
46 | 30 |
|
47 | 31 | @foreach($filter->getOptions() as $key => $value) |
48 | | - <div class="form-check" wire:key="{{ $tableName }}-filter-{{ $filter->getKey() }}-multiselect-{{ $key }}-@if($filter->hasCustomPosition()){{ $filter->getCustomPosition() }}@endif"> |
49 | | - <input |
50 | | - class="form-check-input" |
51 | | - type="checkbox" |
52 | | - id="{{ $tableName }}-filter-{{ $filter->getKey() }}-{{ $loop->index }}-@if($filter->hasCustomPosition()){{ $filter->getCustomPosition() }}@endif" |
53 | | - value="{{ $key }}" |
54 | | - wire:key="{{ $tableName }}-filter-{{ $filter->getKey() }}-{{ $loop->index }}-@if($filter->hasCustomPosition()){{ $filter->getCustomPosition() }}@endif" |
55 | | - {{ $filter->getWireMethod('filterComponents.'.$filter->getKey()) }} |
56 | | - |
57 | | - > |
58 | | - <label class="form-check-label" for="{{ $tableName }}-filter-{{ $filter->getKey() }}-{{ $loop->index }}-@if($filter->hasCustomPosition()){{ $filter->getCustomPosition() }}@endif">{{ $value }}</label> |
| 32 | + <div @class([ |
| 33 | + 'form-check' => $isBootstrap, |
| 34 | + ]) wire:key="{{ $tableName }}-filter-{{ $filter->getKey() }}-multiselect-{{ $key }}{{ $filter->hasCustomPosition() ? '-'.$filter->getCustomPosition() : null }}"> |
| 35 | + <input {!! $filter->getWireMethod('filterComponents.'.$filter->getKey()) !!} |
| 36 | + id="{{ $tableName }}-filter-{{ $filter->getKey() }}-{{ $loop->index }}{{ $filter->hasCustomPosition() ? '-'.$filter->getCustomPosition() : null }}" |
| 37 | + |
| 38 | + wire:key="{{ $tableName }}-filter-{{ $filter->getKey() }}-{{ $loop->index }}{{ $filter->hasCustomPosition() ? '-'.$filter->getCustomPosition() : null }}" value="{{ $key }}" {{ |
| 39 | + $filterInputAttributes->merge([ |
| 40 | + 'type' => 'checkbox' |
| 41 | + ]) |
| 42 | + ->class([ |
| 43 | + 'rounded shadow-sm transition duration-150 ease-in-out focus:ring focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-wait' => $isTailwind && ($filterInputAttributes['default-styling'] ?? true), |
| 44 | + 'text-indigo-600 border-gray-300 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600 ' => $isTailwind && ($filterInputAttributes['default-colors'] ?? true), |
| 45 | + 'form-check-input' => $isBootstrap && ($filterInputAttributes['default-styling'] ?? true), |
| 46 | + ]) |
| 47 | + ->except(['id','wire:key','value','default-styling','default-colors']) |
| 48 | + }}> |
| 49 | + <label for="{{ $tableName }}-filter-{{ $filter->getKey() }}-{{ $loop->index }}{{ $filter->hasCustomPosition() ? '-'.$filter->getCustomPosition() : null }}" @class([ |
| 50 | + 'dark:text-white' => $isTailwind, |
| 51 | + 'form-check-label' => $isBootstrap, |
| 52 | + ])>{{ $value }}</label> |
59 | 53 | </div> |
60 | 54 | @endforeach |
| 55 | + @if ($isTailwind) |
| 56 | + </div> |
61 | 57 | @endif |
62 | 58 | </div> |
0 commit comments