blob: 783255eb9c3edf9d4625a4d386338e7dee8be062 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
<div>
@if($searchable || $showColumnSelect || $showPageSizeSelect)
<div class="table-controls pb-2 d-flex justify-content-between align-items-center">
<div>
@if($searchable)
<input class="form-control border-secondary" type="search"
wire:model.live.debounce.{{ $searchDebounce}}="search"
placeholder="{{ __('Search') }}..." />
@endif
</div>
<div class="d-flex gap-3">
@if($showColumnSelect)
<div class="dropdown">
<button type="button" class="btn btn-outline-secondary border-secondary"
data-bs-toggle="dropdown" aria-expanded="false"
data-bs-auto-close="outside">
{{ __('Columns') }}
</button>
<div class="dropdown-menu p-4">
@foreach($allColumns->filter(fn($c) => $c->getShowInSelect()) as $column)
<label class="d-block">
<input type="checkbox" wire:model.live="activeColumns"
value="{{ $column->name }}" />
{{ $column->getTitle() }}
</label>
@endforeach
</div>
</div>
@endif
@if($showPageSizeSelect)
<select wire:model.live="pageSize" class="form-select border-secondary">
@foreach($pageSizes as $size)
<option value="{{ $size }}">{{ $size }}</option>
@endforeach
</select>
@endif
</div>
</div>
@endif
<table class="table">
<colgroup>
@foreach($columns as $column)
<col @class([$column->getColClass()]) />
@endforeach
</colgroup>
<thead>
<tr>
@foreach($columns as $column)
<th scope="col">{{ $column->getTitle() }}</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach($data as $row)
<tr>
@foreach($columns as $column)
{{ $column->view($row) }}
@endforeach
</tr>
@endforeach
</tbody>
</table>
<div class="table-pagination d-flex justify-content-between align-items-center">
{{ $data->links() }}
<div>
{{ __('Showing') }} {{ $data->count() }}
{{ __('of') }} {{ $data->total() }}
</div>
</div>
</div>
|