|
7 | 7 | $customLabelAttributes = $allThAttributes['labelAttributes']; |
8 | 8 | $customIconAttributes = $this->getThSortIconAttributes($column); |
9 | 9 | $direction = $column->hasField() ? $this->getSort($column->getColumnSelectName()) : $this->getSort($column->getSlug()) ?? null; |
10 | | -
|
11 | 10 | @endphp |
12 | 11 |
|
13 | | -@if ($this->isTailwind) |
14 | | - <th scope="col" {{ |
15 | | - $attributes->merge($customThAttributes) |
16 | | - ->class(['text-gray-500 dark:bg-gray-800 dark:text-gray-400' => (($customThAttributes['default-colors'] ?? true) || ($customThAttributes['default'] ?? true))]) |
17 | | - ->class(['px-6 py-3 text-left text-xs font-medium whitespace-nowrap uppercase tracking-wider' => (($customThAttributes['default-styling'] ?? true) || ($customThAttributes['default'] ?? true))]) |
18 | | - ->class(['hidden' => $column->shouldCollapseAlways()]) |
19 | | - ->class(['hidden md:table-cell' => $column->shouldCollapseOnMobile()]) |
20 | | - ->class(['hidden lg:table-cell' => $column->shouldCollapseOnTablet()]) |
21 | | - ->except(['default', 'default-colors', 'default-styling']) |
22 | | - }} |
23 | | - > |
24 | | - @if($column->getColumnLabelStatus()) |
25 | | - @unless ($this->sortingIsEnabled() && ($column->isSortable() || $column->getSortCallback())) |
26 | | - <span {{ $customLabelAttributes->except(['default', 'default-colors', 'default-styling']) }}>{{ $column->getTitle() }}</span> |
27 | | - @else |
28 | | - <button wire:click="sortBy('{{ $column->getColumnSortKey() }}')" |
29 | | - {{ |
| 12 | +<th {{ |
| 13 | + $attributes->merge($customThAttributes) |
| 14 | + ->class([ |
| 15 | + 'text-gray-500 dark:bg-gray-800 dark:text-gray-400' => $this->isTailwind && (($customThAttributes['default-colors'] ?? true) || ($customThAttributes['default'] ?? true)), |
| 16 | + 'px-6 py-3 text-left text-xs font-medium whitespace-nowrap uppercase tracking-wider' => $this->isTailwind && (($customThAttributes['default-styling'] ?? true) || ($customThAttributes['default'] ?? true)), |
| 17 | + 'hidden' => $this->isTailwind && $column->shouldCollapseAlways(), |
| 18 | + 'hidden md:table-cell' => $this->isTailwind && $column->shouldCollapseOnMobile(), |
| 19 | + 'hidden lg:table-cell' => $this->isTailwind && $column->shouldCollapseOnTablet(), |
| 20 | + '' => $this->isBootstrap && ($customThAttributes['default'] ?? true), |
| 21 | + 'd-none' => $this->isBootstrap && $column->shouldCollapseAlways(), |
| 22 | + 'd-none d-md-table-cell' => $this->isBootstrap && $column->shouldCollapseOnMobile(), |
| 23 | + 'd-none d-lg-table-cell' => $this->isBootstrap && $column->shouldCollapseOnTablet(), |
| 24 | + ]) |
| 25 | + ->except(['default', 'default-colors', 'default-styling']) |
| 26 | +}}> |
| 27 | + @if($column->getColumnLabelStatus()) |
| 28 | + @unless ($this->sortingIsEnabled() && ($column->isSortable() || $column->getSortCallback())) |
| 29 | + <span {{ $customLabelAttributes->except(['default', 'default-colors', 'default-styling']) }}>{{ $column->getTitle() }}</span> |
| 30 | + @else |
| 31 | + @if ($this->isTailwind) |
| 32 | + |
| 33 | + <button wire:click="sortBy('{{ $column->getColumnSortKey() }}')" {{ |
30 | 34 | $attributes->merge($customSortButtonAttributes) |
31 | | - ->class(['text-gray-500 dark:text-gray-400' => (($customSortButtonAttributes['default-colors'] ?? true) || ($customSortButtonAttributes['default'] ?? true))]) |
32 | | - ->class(['flex items-center space-x-1 text-left text-xs leading-4 font-medium uppercase tracking-wider group focus:outline-none' => (($customSortButtonAttributes['default-styling'] ?? true) || ($customSortButtonAttributes['default'] ?? true))]) |
| 35 | + ->class([ |
| 36 | + 'text-gray-500 dark:text-gray-400' => (($customSortButtonAttributes['default-colors'] ?? true) || ($customSortButtonAttributes['default'] ?? true)), |
| 37 | + 'flex items-center space-x-1 text-left text-xs leading-4 font-medium uppercase tracking-wider group focus:outline-none' => (($customSortButtonAttributes['default-styling'] ?? true) || ($customSortButtonAttributes['default'] ?? true)), |
| 38 | + ]) |
33 | 39 | ->except(['default', 'default-colors', 'default-styling', 'wire:key']) |
34 | | - }} |
35 | | - > |
| 40 | + }}> |
36 | 41 | <span {{ $customLabelAttributes->except(['default', 'default-colors', 'default-styling']) }}>{{ $column->getTitle() }}</span> |
37 | 42 | <x-livewire-tables::table.th.sort-icons :$direction :$customIconAttributes /> |
38 | 43 | </button> |
39 | | - @endunless |
40 | | - @endif |
41 | | - </th> |
42 | | -@elseif ($this->isBootstrap) |
43 | | - <th scope="col" {{ |
44 | | - $attributes->merge($customThAttributes) |
45 | | - ->class(['' => $customThAttributes['default'] ?? true]) |
46 | | - ->class(['d-none' => $column->shouldCollapseAlways()]) |
47 | | - ->class(['d-none d-md-table-cell' => $column->shouldCollapseOnMobile()]) |
48 | | - ->class(['d-none d-lg-table-cell' => $column->shouldCollapseOnTablet()]) |
49 | | - ->except(['default','default-styling','default-colors']) |
50 | | - }} |
51 | | - > |
52 | | - @if($column->getColumnLabelStatus()) |
53 | | - @unless ($this->sortingIsEnabled() && ($column->isSortable() || $column->getSortCallback())) |
54 | | - <span {{ $customLabelAttributes->except(['default', 'default-colors', 'default-styling']) }}>{{ $column->getTitle() }}</span> |
55 | | - @else |
56 | | - <div |
57 | | - class="d-flex align-items-center laravel-livewire-tables-cursor" |
58 | | - wire:click="sortBy('{{ $column->getColumnSortKey() }}')" |
59 | | - {{ |
| 44 | + @elseif ($this->isBootstrap) |
| 45 | + <div wire:click="sortBy('{{ $column->getColumnSortKey() }}')" {{ |
60 | 46 | $attributes->merge($customSortButtonAttributes) |
61 | | - ->class(['' => (($customSortButtonAttributes['default-styling'] ?? true) || ($customSortButtonAttributes['default'] ?? true))]) |
| 47 | + ->class(['d-flex align-items-center laravel-livewire-tables-cursor' => (($customSortButtonAttributes['default-styling'] ?? true) || ($customSortButtonAttributes['default'] ?? true))]) |
62 | 48 | ->except(['default', 'default-colors', 'default-styling', 'wire:key']) |
63 | | - }} |
64 | | - > |
| 49 | + }}> |
65 | 50 | <span {{ $customLabelAttributes->except(['default', 'default-colors', 'default-styling']) }}>{{ $column->getTitle() }}</span> |
66 | 51 | <x-livewire-tables::table.th.sort-icons :$direction :$customIconAttributes /> |
67 | 52 |
|
68 | 53 | </div> |
69 | | - @endunless |
70 | | - @endif |
71 | | - </th> |
72 | | -@endif |
| 54 | + @endif |
| 55 | + |
| 56 | + @endunless |
| 57 | + @endif |
| 58 | +</th> |
0 commit comments