@foreach ($item->getComponents(withHidden: true) as $component) @php throw_unless( $component instanceof \Filament\Forms\Components\Field || $component instanceof \Filament\Infolists\Components\Entry, new \Exception('Table repeaters must only contain form fields and infolist entries, but [' . $component::class . '] was used.'), ); @endphp @if (count($tableColumns) > $counter) @if ($component instanceof \Filament\Forms\Components\Hidden) {{ $component }} @else @php $counter++; $isComponentVisible = $component->isVisible(); $componentStatePath = null; $canUseAlpineIntegration = false; try { $name = $component->getName(); $componentStatePath = $component->getStatePath(); $canUseAlpineIntegration = filled($componentStatePath) && $component->getLivewire(); } catch (\Exception $e) { $canUseAlpineIntegration = false; } $hiddenJs = null; $visibleJs = null; $visibilityJs = null; if ($canUseAlpineIntegration) { $hiddenJs = method_exists($component, 'getHiddenJs') ? $component->getHiddenJs() : null; $visibleJs = method_exists($component, 'getVisibleJs') ? $component->getVisibleJs() : null; $visibilityJs = match ([filled($hiddenJs), filled($visibleJs)]) { [true, true] => "(! ({$hiddenJs})) && ({$visibleJs})", [true, false] => "! ({$hiddenJs})", [false, true] => $visibleJs, default => null, }; } $attributes = (new \Illuminate\View\ComponentAttributeBag) ->merge([ 'wire:key' => $component->getLivewireKey() . '.cell', ...(method_exists($component, 'getPollingInterval') && ($pollingInterval = $component->getPollingInterval()) ? ["wire:poll.{$pollingInterval}" => "partiallyRenderSchemaComponent('{$component->getKey()}')"] : []), ], escape: false); @endphp getAfterStateUpdatedJs())) x-init="{{ implode(';', array_map( fn (string $js): string => '$wire.watch(' . \Illuminate\Support\Js::from($componentStatePath) . ', ($state, $old) => ($state !== undefined) && eval(' . \Illuminate\Support\Js::from($js) . '))', $afterStateUpdatedJs, )) }}" @endif @if (filled($visibilityJs)) x-bind:class="{ 'fi-hidden': ! ({{ $visibilityJs }}) }" x-cloak @endif @endif @if (! $isComponentVisible && ! filled($visibilityJs)) class="fi-hidden" @endif {{ $attributes->toHtml() }} > @if ($isComponentVisible) {{ $component }} @endif @endif @endif @endforeach