Skip to content

Commit 05de577

Browse files
committed
feat: table heading component to accept slot if provided
1 parent 44eb52a commit 05de577

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

resources/views/bootstrap-5/table/heading.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@
1111
'class' => $sortable ? $addSortClass() : ''
1212
]) }}
1313
>
14-
{{ $label }}
14+
@if($slot->isNotEmpty())
15+
{{ $slot }}
16+
@else
17+
{{ $label }}
18+
@endif
1519
</th>

resources/views/material-admin-26/table/heading.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@
1111
'class' => $sortable ? $addSortClass() : ''
1212
]) }}
1313
>
14-
{{ $label }}
14+
@if($slot->isNotEmpty())
15+
{{ $slot }}
16+
@else
17+
{{ $label }}
18+
@endif
1519
</th>

tests/TestSupport/views/table.blade.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@
7474
<x-forms::table.heading label="Date B"/>
7575
<x-forms::table.heading label="Date C"/>
7676
<x-forms::table.heading label="Date D"/>
77-
<x-forms::table.heading label="Date E"/>
77+
<x-forms::table.heading>
78+
Date E
79+
</x-forms::table.heading>
7880
</x-slot:headers>
7981

8082
{{-- <x-slot:rows>--}}
@@ -142,6 +144,3 @@
142144
</x-slot:rows>
143145
</x-forms::table>
144146
</div>
145-
146-
147-

0 commit comments

Comments
 (0)