@php use Filament\Tables\Actions\Position as ActionsPosition; use Filament\Tables\Filters\Layout as FiltersLayout; use Filament\Tables\Actions\RecordCheckboxPosition; $actions = $getActions(); $actionsPosition = $getActionsPosition(); $actionsColumnLabel = $getActionsColumnLabel(); $columns = $getColumns(); $collapsibleColumnsLayout = $getCollapsibleColumnsLayout(); $content = $getContent(); $contentGrid = $getContentGrid(); $contentFooter = $getContentFooter(); $filterIndicators = collect($getFilters()) ->mapWithKeys(fn (\Filament\Tables\Filters\BaseFilter $filter): array => [$filter->getName() => $filter->getIndicators()]) ->filter(fn (array $indicators): bool => count($indicators)) ->all(); $hasColumnsLayout = $hasColumnsLayout(); $header = $getHeader(); $headerActions = $getHeaderActions(); $heading = $getHeading(); $description = $getDescription(); $isReorderable = $isReorderable(); $isReordering = $isReordering(); $isColumnSearchVisible = $isSearchableByColumn(); $isGlobalSearchVisible = $isSearchable(); $isSelectionEnabled = $isSelectionEnabled(); $recordCheckboxPosition = $getRecordCheckboxPosition(); $isStriped = $isStriped(); $hasFilters = $isFilterable(); $hasFiltersPopover = $hasFilters && ($getFiltersLayout() === FiltersLayout::Popover); $hasFiltersAboveContent = $hasFilters && ($getFiltersLayout() === FiltersLayout::AboveContent); $hasFiltersAfterContent = $hasFilters && ($getFiltersLayout() === FiltersLayout::BelowContent); $isColumnToggleFormVisible = $hasToggleableColumns(); $records = $getRecords(); $columnsCount = count($columns); if (count($actions) && (! $isReordering)) $columnsCount++; if ($isSelectionEnabled || $isReordering) $columnsCount++; $getHiddenClasses = function (\Filament\Tables\Columns\Column $column): ?string { if ($breakpoint = $column->getHiddenFrom()) { return match ($breakpoint) { 'sm' => 'sm:hidden', 'md' => 'md:hidden', 'lg' => 'lg:hidden', 'xl' => 'xl:hidden', '2xl' => '2xl:hidden', }; } if ($breakpoint = $column->getVisibleFrom()) { return match ($breakpoint) { 'sm' => 'hidden sm:table-cell', 'md' => 'hidden md:table-cell', 'lg' => 'hidden lg:table-cell', 'xl' => 'hidden xl:table-cell', '2xl' => 'hidden 2xl:table-cell', }; } return null; }; @endphp
@if ($header) {{ $header }} @elseif ($heading || $headerActions)
! $heading && $isReordering, ])> {{ $heading }} {{ $description }}
@endif @if ($hasFiltersAboveContent)
@endif
@if ($isReorderable) @endif @if (! $isReordering) @endif
@if ($isGlobalSearchVisible || $hasFiltersPopover || $isColumnToggleFormVisible)
@if ($isGlobalSearchVisible)
@endif @if ($hasFiltersPopover) @endif @if ($isColumnToggleFormVisible) @endif
@endif
@if ($isReordering) @elseif ($isSelectionEnabled) @endif
config('tables.dark_mode'), 'overflow-x-auto' => $content || $hasColumnsLayout, 'rounded-t-xl' => ! $renderHeader, 'border-t' => $renderHeader, ]) x-bind:class="{ 'rounded-t-xl': ! hasHeader, 'border-t': hasHeader, }" > @if ($content || $hasColumnsLayout) @if (count($records)) @if (($content || $hasColumnsLayout) && (! $isReordering))
config('tables.dark_mode'), ])> @if ($isSelectionEnabled) @endif @php $sortableColumns = array_filter( $columns, fn (\Filament\Tables\Columns\Column $column): bool => $column->isSortable(), ); @endphp @if (count($sortableColumns))
@endif
@endif @if ($content) {{ $content->with(['records' => $records]) }} @else @foreach ($records as $record) @php $recordAction = $getRecordAction($record); $recordKey = $getRecordKey($record); $recordUrl = $getRecordUrl($record); $collapsibleColumnsLayout?->record($record); $hasCollapsibleColumnsLayout = $collapsibleColumnsLayout && (! $collapsibleColumnsLayout->isHidden()); @endphp
$recordUrl || $recordAction, 'dark:hover:bg-gray-500/10' => ($recordUrl || $recordAction) && config('tables.dark_mode'), 'dark:border-gray-600' => (! $contentGrid) && config('tables.dark_mode'), 'group' => $isReordering, 'rounded-xl shadow-sm border border-gray-200' => $contentGrid, 'dark:border-gray-700 dark:bg-gray-700/40' => $contentGrid && config('tables.dark_mode'), ], $getRecordClasses($record), )) >
(! $contentGrid), 'mr-6 rtl:mr-0 rtl:ml-6' => $isSelectionEnabled || $hasCollapsibleColumnsLayout || $isReordering, ])> @if ($isSelectionEnabled) @endif @if ($hasCollapsibleColumnsLayout)
$isSelectionEnabled, 'top-1' => ! $isSelectionEnabled, 'md:relative md:top-0 md:right-0 rtl:md:left-0' => ! $contentGrid, 'hidden' => $isReordering, ])>
@endif @if ($recordUrl) @elseif ($recordAction) @php if ($this->getCachedTableAction($recordAction)) { $recordWireClickAction = "mountTableAction('{$recordAction}', '{$recordKey}')"; } else { $recordWireClickAction = "{$recordAction}('{$recordKey}')"; } @endphp @else
@endif @if (count($actions)) @endif
@if ($hasCollapsibleColumnsLayout)
(! $contentGrid) && $isSelectionEnabled, 'md:pl-12 rtl:md:pl-0 rtl:md:pr-12' => (! $contentGrid) && (! $isSelectionEnabled), 'hidden' => $isReordering, ]) > {{ $collapsibleColumnsLayout->viewData(['recordKey' => $recordKey]) }}
@endif
@endforeach
@endif @if (($content || $hasColumnsLayout) && $contentFooter) {{ $contentFooter->with(['columns' => $columns, 'records' => $records]) }} @endif @else @if ($emptyState = $getEmptyState()) {{ $emptyState }} @else
{{ $getEmptyStateHeading() }} {{ $getEmptyStateDescription() }}
@endif @endif @else @if ($isReordering) @else @if (count($actions) && $actionsPosition === ActionsPosition::BeforeCells) @if ($actionsColumnLabel) {{ $actionsColumnLabel }} @else @endif @endif @if ($isSelectionEnabled && $recordCheckboxPosition === RecordCheckboxPosition::BeforeCells) @endif @if (count($actions) && $actionsPosition === ActionsPosition::BeforeColumns) @if ($actionsColumnLabel) {{ $actionsColumnLabel }} @else @endif @endif @endif @foreach ($columns as $column) {{ $column->getLabel() }} @endforeach @if (! $isReordering) @if (count($actions) && $actionsPosition === ActionsPosition::AfterColumns) @if ($actionsColumnLabel) {{ $actionsColumnLabel }} @else @endif @endif @if ($isSelectionEnabled && $recordCheckboxPosition === RecordCheckboxPosition::AfterCells) @endif @if (count($actions) && $actionsPosition === ActionsPosition::AfterCells) @if ($actionsColumnLabel) {{ $actionsColumnLabel }} @else @endif @endif @endif @if ($isColumnSearchVisible) @if ($isReordering) @else @if (count($actions) && in_array($actionsPosition, [ActionsPosition::BeforeCells, ActionsPosition::BeforeColumns])) @endif @if ($isSelectionEnabled && $recordCheckboxPosition === RecordCheckboxPosition::BeforeCells) @endif @endif @foreach ($columns as $column) @if ($column->isIndividuallySearchable()) @endif @endforeach @if (! $isReordering) @if (count($actions) && in_array($actionsPosition, [ActionsPosition::AfterColumns, ActionsPosition::AfterCells])) @endif @if ($isSelectionEnabled && $recordCheckboxPosition === RecordCheckboxPosition::AfterCells) @endif @endif @endif @if (count($records)) @foreach ($records as $record) @php $recordAction = $getRecordAction($record); $recordKey = $getRecordKey($record); $recordUrl = $getRecordUrl($record); @endphp @if ($isReordering) @endif @if (count($actions) && $actionsPosition === ActionsPosition::BeforeCells) @endif @if ($isSelectionEnabled && $recordCheckboxPosition === RecordCheckboxPosition::BeforeCells) @if ($isRecordSelectable($record)) @else @endif @endif @if (count($actions) && $actionsPosition === ActionsPosition::BeforeColumns) @endif @foreach ($columns as $column) @php $column->record($record); $column->rowLoop($loop->parent); @endphp @endforeach @if (count($actions) && $actionsPosition === ActionsPosition::AfterColumns) @endif @if ($isSelectionEnabled && $recordCheckboxPosition === RecordCheckboxPosition::AfterCells) @if ($isRecordSelectable($record)) @else @endif @endif @if (count($actions) && $actionsPosition === ActionsPosition::AfterCells) @endif @endforeach @if ($contentFooter) {{ $contentFooter->with(['columns' => $columns, 'records' => $records]) }} @endif @else @if ($emptyState = $getEmptyState()) {{ $emptyState }} @else
{{ $getEmptyStateHeading() }} {{ $getEmptyStateDescription() }}
@endif @endif
@endif
@if ( $records instanceof \Illuminate\Contracts\Pagination\Paginator && ((! $records instanceof \Illuminate\Contracts\Pagination\LengthAwarePaginator) || $records->total()) )
config('tables.dark_mode'), ])>
@endif @if ($hasFiltersAfterContent)
@endif
@php $action = $getMountedAction(); @endphp @if ($action) @if ($action->isModalCentered()) @if ($heading = $action->getModalHeading()) {{ $heading }} @endif @if ($subheading = $action->getModalSubheading()) {{ $subheading }} @endif @else @if ($heading = $action->getModalHeading()) {{ $heading }} @endif @if ($subheading = $action->getModalSubheading()) {{ $subheading }} @endif @endif {{ $action->getModalContent() }} @if ($action->hasFormSchema()) {{ $getMountedActionForm() }} @endif {{ $action->getModalFooter() }} @if (count($action->getModalActions())) @foreach ($action->getModalActions() as $modalAction) {{ $modalAction }} @endforeach @endif @endif
@php $action = $getMountedBulkAction(); @endphp @if ($action) @if ($action->isModalCentered()) @if ($heading = $action->getModalHeading()) {{ $heading }} @endif @if ($subheading = $action->getModalSubheading()) {{ $subheading }} @endif @else @if ($heading = $action->getModalHeading()) {{ $heading }} @endif @if ($subheading = $action->getModalSubheading()) {{ $subheading }} @endif @endif {{ $action->getModalContent() }} @if ($action->hasFormSchema()) {{ $getMountedBulkActionForm() }} @endif {{ $action->getModalFooter() }} @if (count($action->getModalActions())) @foreach ($action->getModalActions() as $modalAction) {{ $modalAction }} @endforeach @endif @endif
@if (! $this instanceof \Filament\Tables\Contracts\RendersFormComponentActionModal) {{ $this->modal }} @endif