@props(['column', 'index'])
@php
$allThAttributes = $this->getAllThAttributes($column);
$customThAttributes = $allThAttributes['customAttributes'];
$customSortButtonAttributes = $allThAttributes['sortButtonAttributes'];
$customLabelAttributes = $allThAttributes['labelAttributes'];
$customIconAttributes = $this->getThSortIconAttributes($column);
$direction = $column->hasField() ? $this->getSort($column->getColumnSelectName()) : $this->getSort($column->getSlug()) ?? null;
@endphp
merge($customThAttributes)
->class([
'text-gray-500 dark:bg-gray-800 dark:text-gray-400' => $this->isTailwind && (($customThAttributes['default-colors'] ?? true) || ($customThAttributes['default'] ?? true)),
'px-6 py-3 text-left text-xs font-medium whitespace-nowrap uppercase tracking-wider' => $this->isTailwind && (($customThAttributes['default-styling'] ?? true) || ($customThAttributes['default'] ?? true)),
'hidden' => $this->isTailwind && $column->shouldCollapseAlways(),
'hidden md:table-cell' => $this->isTailwind && $column->shouldCollapseOnMobile(),
'hidden lg:table-cell' => $this->isTailwind && $column->shouldCollapseOnTablet(),
'' => $this->isBootstrap && ($customThAttributes['default'] ?? true),
'd-none' => $this->isBootstrap && $column->shouldCollapseAlways(),
'd-none d-md-table-cell' => $this->isBootstrap && $column->shouldCollapseOnMobile(),
'd-none d-lg-table-cell' => $this->isBootstrap && $column->shouldCollapseOnTablet(),
])
->except(['default', 'default-colors', 'default-styling'])
}}>
@if($column->getColumnLabelStatus())
@unless ($this->sortingIsEnabled() && ($column->isSortable() || $column->getSortCallback()))
@else
@if ($this->isTailwind)
@elseif ($this->isBootstrap)
merge($customSortButtonAttributes)
->class([
'd-flex align-items-center laravel-livewire-tables-cursor' => (($customSortButtonAttributes['default-styling'] ?? true) || ($customSortButtonAttributes['default'] ?? true))
])
->except(['default', 'default-colors', 'default-styling', 'wire:key'])
}}>
@endif
@endunless
@endif
|