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