|
1 | 1 | @php
|
| 2 | + use Filament\Support\Enums\Alignment; |
| 3 | +
|
2 | 4 | $isContained = $isContained();
|
3 | 5 | $striped = $getStriped();
|
4 | 6 | $showIndex = $getShowIndex();
|
@@ -29,8 +31,33 @@ class="gap-4"
|
29 | 31 | <tr>
|
30 | 32 | @if($showIndex)<th class="filament-table-repeateable-header-cell px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6"></th>@endif
|
31 | 33 | @foreach($getColumnLabels() as $label)
|
32 |
| - |
33 |
| - <th class="it-table-repeateable-header-cell font-semibold text-gray-950 dark:text-white text-start px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6">{{ $label['name'] }}</th> |
| 34 | + @php |
| 35 | + $alignment = $label['alignment']; |
| 36 | + if (! $alignment instanceof Alignment) { |
| 37 | + $alignment = filled($alignment) ? (Alignment::tryFrom($alignment) ?? $alignment) : null; |
| 38 | + } |
| 39 | + @endphp |
| 40 | + <th |
| 41 | + @class([ |
| 42 | + 'it-table-repeateable-header-cell font-semibold text-gray-950 dark:text-white text-start py-3.5 sm:first-of-type:ps-3 sm:last-of-type:pe-3', |
| 43 | + match ($alignment) { |
| 44 | + Alignment::Start => 'text-start', |
| 45 | + Alignment::Center => 'text-center', |
| 46 | + Alignment::End => 'text-end', |
| 47 | + Alignment::Left => 'text-left', |
| 48 | + Alignment::Right => 'text-right', |
| 49 | + Alignment::Justify, Alignment::Between => 'text-justify', |
| 50 | + default => $alignment, |
| 51 | + }, |
| 52 | + match ($alignment) { |
| 53 | + Alignment::Start, Alignment::Left => 'justify-start', |
| 54 | + Alignment::Center => 'justify-center', |
| 55 | + Alignment::End, Alignment::Right => 'justify-end', |
| 56 | + Alignment::Between, Alignment::Justify => 'justify-between', |
| 57 | + default => null, |
| 58 | + } |
| 59 | + ]) |
| 60 | + >{{ $label['name'] }}</th> |
34 | 61 | @endforeach
|
35 | 62 | </tr>
|
36 | 63 | </thead>
|
|
0 commit comments