@php use Filament\Support\Enums\Alignment; use Filament\Support\Enums\FontFamily; use Filament\Support\Enums\FontWeight; use Filament\Support\Enums\IconPosition; use Filament\Tables\Columns\TextColumn\TextColumnSize; $alignment = $getAlignment(); $canWrap = $canWrap(); $descriptionAbove = $getDescriptionAbove(); $descriptionBelow = $getDescriptionBelow(); $iconPosition = $getIconPosition(); $isBadge = $isBadge(); $isBulleted = $isBulleted(); $isListWithLineBreaks = $isListWithLineBreaks(); $isLimitedListExpandable = $isLimitedListExpandable(); $url = $getUrl(); if (! $alignment instanceof Alignment) { $alignment = filled($alignment) ? (Alignment::tryFrom($alignment) ?? $alignment) : null; } $arrayState = $getState(); if ($arrayState instanceof \Illuminate\Support\Collection) { $arrayState = $arrayState->all(); } $listLimit = 1; if (is_array($arrayState)) { if ($listLimit = $getListLimit()) { $limitedArrayStateCount = (count($arrayState) > $listLimit) ? (count($arrayState) - $listLimit) : 0; if (! $isListWithLineBreaks) { $arrayState = array_slice($arrayState, 0, $listLimit); } } $listLimit ??= count($arrayState); if ((! $isListWithLineBreaks) && (! $isBadge)) { $arrayState = implode( ', ', array_map( fn ($value) => $value instanceof \Filament\Support\Contracts\HasLabel ? $value->getLabel() : $value, $arrayState, ), ); } } $arrayState = \Illuminate\Support\Arr::wrap($arrayState); @endphp
$canWrap, ]) > {{ $descriptionAbove }}
@endif <{{ $isListWithLineBreaks ? 'ul' : 'div' }} @class([ 'flex' => ! $isBulleted, 'flex-col' => (! $isBulleted) && $isListWithLineBreaks, 'list-inside list-disc' => $isBulleted, 'gap-1.5' => $isBadge, 'flex-wrap' => $isBadge && (! $isListWithLineBreaks), match ($alignment) { Alignment::Start => 'text-start', Alignment::Center => 'text-center', Alignment::End => 'text-end', Alignment::Left => 'text-left', Alignment::Right => 'text-right', Alignment::Justify, Alignment::Between => 'text-justify', default => $alignment, }, match ($alignment) { Alignment::Start, Alignment::Left => 'justify-start', Alignment::Center => 'justify-center', Alignment::End, Alignment::Right => 'justify-end', Alignment::Between, Alignment::Justify => 'justify-between', default => null, } => $isBulleted || (! $isListWithLineBreaks), match ($alignment) { Alignment::Start, Alignment::Left => 'items-start', Alignment::Center => 'items-center', Alignment::End, Alignment::Right => 'items-end', Alignment::Between, Alignment::Justify => 'items-stretch', default => null, } => $isListWithLineBreaks && (! $isBulleted), ]) @if ($isListWithLineBreaks && $isLimitedListExpandable) x-data="{ isLimited: true }" @endif > @foreach ($arrayState as $state) @if (filled($formattedState = $formatState($state)) && (! ($isListWithLineBreaks && (! $isLimitedListExpandable) && ($loop->iteration > $listLimit)))) @php $color = $getColor($state); $copyableState = $getCopyableState($state) ?? $state; $copyMessage = $getCopyMessage($state); $copyMessageDuration = $getCopyMessageDuration($state); $fontFamily = $getFontFamily($state); $icon = $getIcon($state); $iconColor = $getIconColor($state) ?? $color; $itemIsCopyable = $isCopyable($state); $lineClamp = $getLineClamp($state); $size = $getSize($state); $weight = $getWeight($state); $iconClasses = \Illuminate\Support\Arr::toCssClasses([ 'fi-ta-text-item-icon h-5 w-5', match ($iconColor) { 'gray', null => 'text-gray-400 dark:text-gray-500', default => 'text-custom-500', }, ]); $iconStyles = \Illuminate\Support\Arr::toCssStyles([ \Filament\Support\get_color_css_variables( $iconColor, shades: [500], alias: 'tables::columns.text-column.item.icon', ) => $iconColor !== 'gray', ]); @endphp <{{ $isListWithLineBreaks ? 'li' : 'div' }} @if ($itemIsCopyable) x-on:click=" window.navigator.clipboard.writeText(@js($copyableState)) $tooltip(@js($copyMessage), { theme: $store.theme, timeout: @js($copyMessageDuration), }) " @endif @if ($isListWithLineBreaks && ($loop->iteration > $listLimit)) x-cloak x-show="! isLimited" x-transition @endif @class([ 'flex' => ! $isBulleted, 'max-w-max' => ! ($isBulleted || $isBadge), 'w-max' => $isBadge, 'cursor-pointer' => $itemIsCopyable, match ($color) { null => 'text-gray-950 dark:text-white', 'gray' => 'text-gray-500 dark:text-gray-400', default => 'text-custom-600 dark:text-custom-400', } => $isBulleted, ]) @style([ \Filament\Support\get_color_css_variables( $color, shades: [400, 600], alias: 'tables::columns.text-column.item.container', ) => $isBulleted && (! in_array($color, [null, 'gray'])), ]) > @if ($isBadge)$canWrap, ]) > {{ $descriptionBelow }}
@endif @elseif (($placeholder = $getPlaceholder()) !== null)