|
1 | | -@props(['direction']) |
2 | | -<span {{ $attributes->class([ |
| 1 | +@props(['direction' => 'none']) |
| 2 | +@aware(['column']) |
| 3 | +<span @class([ |
3 | 4 | 'relative flex items-center' => $this->isTailwind, |
4 | 5 | 'relative d-flex align-items-center' => $this->isBootstrap |
5 | | - ]) }} |
| 6 | + ]) |
6 | 7 | > |
| 8 | +@php |
| 9 | +$customIconAttributes = $this->getThSortIconAttributes($column) |
| 10 | +@endphp |
| 11 | + |
7 | 12 | @if($this->isTailwind) |
8 | 13 | @switch($direction) |
9 | 14 | @case('asc') |
10 | | - <x-heroicon-o-chevron-up class="w-3 h-3 group-hover:opacity-0" /> |
11 | | - <x-heroicon-o-chevron-down class="w-3 h-3 opacity-0 group-hover:opacity-100 absolute"/> |
12 | | - @break |
| 15 | + <x-heroicon-o-chevron-up {{ $attributes->merge($customIconAttributes) |
| 16 | + ->class([ |
| 17 | + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), |
| 18 | + 'absolute opacity-100 group-hover:opacity-0', |
| 19 | + ]) |
| 20 | + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> |
| 21 | + <x-heroicon-o-chevron-down {{ $attributes->merge($customIconAttributes) |
| 22 | + ->class([ |
| 23 | + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), |
| 24 | + 'absolute opacity-0 group-hover:opacity-100', |
| 25 | + ]) |
| 26 | + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> |
| 27 | + @break |
13 | 28 | @case('desc') |
14 | | - <x-heroicon-o-chevron-down class="w-3 h-3 group-hover:opacity-0" /> |
15 | | - <x-heroicon-o-x-circle class="w-3 h-3 opacity-0 group-hover:opacity-100 absolute"/> |
16 | | - @break |
| 29 | + <x-heroicon-o-chevron-down {{ $attributes->merge($customIconAttributes) |
| 30 | + ->class([ |
| 31 | + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), |
| 32 | + 'absolute opacity-100 group-hover:opacity-0', |
| 33 | + ]) |
| 34 | + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> |
| 35 | + <x-heroicon-o-x-circle {{ $attributes->merge($customIconAttributes) |
| 36 | + ->class([ |
| 37 | + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), |
| 38 | + 'absolute opacity-0 group-hover:opacity-100', |
| 39 | + ]) |
| 40 | + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> |
| 41 | + |
| 42 | + @break |
17 | 43 | @default |
18 | | - <x-heroicon-o-chevron-up class="w-3 h-3 opacity-0 group-hover:opacity-100 transition-opacity duration-300" /> |
19 | | - @endswitch |
| 44 | + <x-heroicon-o-chevron-up-down {{ $attributes->merge($customIconAttributes) |
| 45 | + ->class([ |
| 46 | + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), |
| 47 | + 'absolute opacity-100 group-hover:opacity-0', |
| 48 | + ]) |
| 49 | + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> |
| 50 | + <x-heroicon-o-chevron-up {{ $attributes->merge($this->getThSortIconAttributes($column)) |
| 51 | + ->class([ |
| 52 | + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), |
| 53 | + 'absolute opacity-0 group-hover:opacity-100', |
| 54 | + ]) |
| 55 | + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> |
| 56 | + @endswitch |
| 57 | + |
| 58 | + |
20 | 59 | @else |
21 | 60 | @switch($direction) |
22 | 61 | @case('asc') |
23 | | - <x-heroicon-o-chevron-up class="laravel-livewire-tables-btn-smaller ms-1 " /> |
| 62 | + <x-heroicon-o-chevron-up {{ $attributes->merge($customIconAttributes) |
| 63 | + ->class([ |
| 64 | + 'laravel-livewire-tables-btn-smaller ms-1 ' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), |
| 65 | + ]) |
| 66 | + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> |
24 | 67 | @break |
25 | 68 | @case('desc') |
26 | | - <x-heroicon-o-chevron-down class="laravel-livewire-tables-btn-smaller ms-1" /> |
| 69 | + <x-heroicon-o-chevron-down {{ $attributes->merge($customIconAttributes) |
| 70 | + ->class([ |
| 71 | + 'laravel-livewire-tables-btn-smaller ms-1' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), |
| 72 | + ]) |
| 73 | + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> |
27 | 74 | @break |
28 | 75 | @default |
29 | | - <x-heroicon-o-chevron-up-down class="laravel-livewire-tables-btn-smaller ms-1" /> |
| 76 | + <x-heroicon-o-chevron-up-down {{ $attributes->merge($customIconAttributes) |
| 77 | + ->class([ |
| 78 | + 'laravel-livewire-tables-btn-smaller ms-1' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), |
| 79 | + ]) |
| 80 | + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> |
30 | 81 | @endswitch |
31 | 82 | @endif |
32 | 83 | </span> |
0 commit comments