Skip to content

Commit 7becf76

Browse files
authored
Move customIconAttributes into th
1 parent 2b534f3 commit 7becf76

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

resources/views/components/table/th.blade.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
$customThAttributes = $allThAttributes['customAttributes'];
66
$customSortButtonAttributes = $allThAttributes['sortButtonAttributes'];
77
$customLabelAttributes = $allThAttributes['labelAttributes'];
8+
$customIconAttributes = $this->getThSortIconAttributes($column);
89
$direction = $column->hasField() ? $this->getSort($column->getColumnSelectName()) : $this->getSort($column->getSlug()) ?? null;
910
1011
@endphp
@@ -33,7 +34,7 @@
3334
}}
3435
>
3536
<span {{ $customLabelAttributes->except(['default', 'default-colors', 'default-styling']) }}>{{ $column->getTitle() }}</span>
36-
<x-livewire-tables::table.th.sort-icons :$direction />
37+
<x-livewire-tables::table.th.sort-icons :$direction :$customIconAttributes />
3738
</button>
3839
@endunless
3940
@endif
@@ -62,7 +63,7 @@ class="d-flex align-items-center laravel-livewire-tables-cursor"
6263
}}
6364
>
6465
<span {{ $customLabelAttributes->except(['default', 'default-colors', 'default-styling']) }}>{{ $column->getTitle() }}</span>
65-
<x-livewire-tables::table.th.sort-icons :$direction />
66+
<x-livewire-tables::table.th.sort-icons :$direction :$customIconAttributes />
6667

6768
</div>
6869
@endunless

resources/views/components/table/th/sort-icons.blade.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
@props(['direction' => 'none'])
1+
@props(['direction' => 'none', 'customIconAttributes'])
22
@aware(['column'])
33
<span @class([
44
'relative flex items-center' => $this->isTailwind,
55
'relative d-flex align-items-center' => $this->isBootstrap
66
])
77
>
8-
@php
9-
$customIconAttributes = $this->getThSortIconAttributes($column)
10-
@endphp
118

129
@if($this->isTailwind)
1310
@switch($direction)

0 commit comments

Comments
 (0)