@php use Filament\Support\Enums\FontFamily; use Filament\Support\Enums\FontWeight; use Filament\Support\Enums\IconPosition; use Filament\Tables\Columns\TextColumn\TextColumnSize; $canWrap = $canWrap(); $descriptionAbove = $getDescriptionAbove(); $descriptionBelow = $getDescriptionBelow(); $isBadge = $isBadge(); $iconPosition = $getIconPosition(); $isListWithLineBreaks = $isListWithLineBreaks(); $url = $getUrl(); $arrayState = $getState(); if ($arrayState instanceof \Illuminate\Support\Collection) { $arrayState = $arrayState->all(); } if (is_array($arrayState)) { if ($listLimit = $getListLimit()) { $limitedArrayState = array_slice($arrayState, $listLimit); $arrayState = array_slice($arrayState, 0, $listLimit); } 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
{{ $descriptionAbove }}
@endif <{{ $isListWithLineBreaks ? 'ul' : 'div' }} @class([ 'list-inside list-disc' => $isBulleted(), 'flex flex-wrap items-center gap-1' => $isBadge, 'whitespace-normal' => $canWrap, ]) > @foreach ($arrayState as $state) @if (filled($formattedState = $formatState($state))) @php $color = $getColor($state); $copyableState = $getCopyableState($state) ?? $state; $copyMessage = $getCopyMessage($state); $copyMessageDuration = $getCopyMessageDuration($state); $fontFamily = $getFontFamily($state); $icon = $getIcon($state); $itemIsCopyable = $isCopyable($state); $size = $getSize($state); $weight = $getWeight($state); $iconClasses = \Illuminate\Support\Arr::toCssClasses([ 'fi-ta-text-item-icon h-5 w-5', match ($color) { 'gray', null => 'text-gray-400 dark:text-gray-500', default => 'text-custom-500', }, ]); $iconStyles = \Illuminate\Support\Arr::toCssStyles([ \Filament\Support\get_color_css_variables($color, shades: [500]) => $color !== 'gray', ]); @endphp <{{ $isListWithLineBreaks ? 'li' : 'div' }} @if ($itemIsCopyable) x-on:click=" window.navigator.clipboard.writeText(@js($copyableState)) $tooltip(@js($copyMessage), { timeout: @js($copyMessageDuration) }) " @endif @class([ 'flex max-w-max', 'cursor-pointer' => $itemIsCopyable, ]) > @if ($isBadge){{ $descriptionBelow }}
@endif