@php use Filament\Infolists\Components\TextEntry\TextEntrySize; use Filament\Support\Enums\FontFamily; use Filament\Support\Enums\FontWeight; use Filament\Support\Enums\IconPosition; @endphp @php $isBadge = $isBadge(); $iconPosition = $getIconPosition(); $isListWithLineBreaks = $isListWithLineBreaks(); $isProse = $isProse(); $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 <{{ $isListWithLineBreaks ? 'ul' : 'div' }} @class([ 'list-inside list-disc' => $isBulleted(), 'flex flex-wrap items-center gap-1' => $isBadge, ]) > @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); $proseClasses = \Illuminate\Support\Arr::toCssClasses([ 'prose max-w-none dark:prose-invert [&>*:first-child]:mt-0 [&>*:last-child]:mb-0', 'pt-2' => ! $isLabelHidden(), match ($size) { TextEntrySize::ExtraSmall, 'xs' => 'prose-xs', TextEntrySize::Small, 'sm', null => 'prose-sm', TextEntrySize::Medium, 'base', 'md' => 'prose-base', TextEntrySize::Large, 'lg' => 'prose-lg', default => $size, }, ]); $iconClasses = \Illuminate\Support\Arr::toCssClasses([ 'fi-in-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-data="{}" x-on:click=" window.navigator.clipboard.writeText(@js($copyableState)) $tooltip(@js($copyMessage), { timeout: @js($copyMessageDuration) }) " class="cursor-pointer max-w-max" @endif > @if ($isBadge) {{ $formattedState }} @else
$url, match ($size) { TextEntrySize::ExtraSmall, 'xs' => 'text-xs', TextEntrySize::Small, 'sm', null => 'text-sm leading-6', TextEntrySize::Medium, 'base', 'md' => 'text-base', TextEntrySize::Large, 'lg' => 'text-lg', default => $size, }, 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', }, match ($weight) { FontWeight::Thin, 'thin' => 'font-thin', FontWeight::ExtraLight, 'extralight' => 'font-extralight', FontWeight::Light, 'light' => 'font-light', FontWeight::Medium, 'medium' => 'font-medium', FontWeight::SemiBold, 'semibold' => 'font-semibold', FontWeight::Bold, 'bold' => 'font-bold', FontWeight::ExtraBold, 'extrabold' => 'font-extrabold', FontWeight::Black, 'black' => 'font-black', default => $weight, }, match ($fontFamily) { FontFamily::Sans, 'sans' => 'font-sans', FontFamily::Serif, 'serif' => 'font-serif', FontFamily::Mono, 'mono' => 'font-mono', default => $fontFamily, }, ]) @style([ \Filament\Support\get_color_css_variables($color, shades: [400, 600]) => ! in_array($color, [null, 'gray']), ]) > @if ($icon && in_array($iconPosition, [IconPosition::Before, 'before'])) @endif
$isProse, ]) > {{ $formattedState }}
@if ($icon && in_array($iconPosition, [IconPosition::After, 'after'])) @endif
@endif @endif @endforeach @if ($limitedArrayStateCount = count($limitedArrayState ?? [])) <{{ $isListWithLineBreaks ? 'li' : 'div' }} class="text-sm text-gray-500 dark:text-gray-400" > {{ trans_choice('filament-infolists::components.text_entry.more_list_items', $limitedArrayStateCount) }} @endif