@php
use Filament\Schemas\Components\Tabs\Tab;
use Filament\Schemas\View\SchemaIconAlias;
use Filament\Support\Icons\Heroicon;
$activeTab = $getActiveTab();
$id = $getId();
$isContained = $isContained();
$isScrollable = $isScrollable();
$isVertical = $isVertical();
$label = $getLabel();
$livewireProperty = $getLivewireProperty();
$renderHookScopes = $getRenderHookScopes();
$tabs = $getChildSchema()->getComponents();
$getTabVisibilityJs = function (Tab $tab, ?int $index = null, ?string $mode = null) use ($isScrollable): ?string {
$hiddenJs = $tab->getHiddenJs();
$visibleJs = $tab->getVisibleJs();
$baseJs = match ([filled($hiddenJs), filled($visibleJs)]) {
[true, true] => "(! ({$hiddenJs})) && ({$visibleJs})",
[true, false] => "! ({$hiddenJs})",
[false, true] => $visibleJs,
default => null,
};
if ($isScrollable || $index === null || $mode === null) {
return $baseJs;
}
$tabKey = $tab->getKey(isAbsolute: false);
$dropdownJs = match ($mode) {
'inline' => "(!withinDropdownMounted || withinDropdownIndex === null || {$index} < withinDropdownIndex)",
'trigger' => "(withinDropdownMounted && withinDropdownIndex !== null && {$index} >= withinDropdownIndex && '{$tabKey}' === tab)",
default => null,
};
return $baseJs ? "{$baseJs} && {$dropdownJs}" : $dropdownJs;
};
@endphp
@if (blank($livewireProperty))
merge([
'id' => $id,
'wire:key' => $getLivewireKey() . '.container',
], escape: false)
->merge($getExtraAttributes(), escape: false)
->merge($getExtraAlpineAttributes(), escape: false)
->class([
'fi-sc-tabs',
'fi-contained' => $isContained,
'fi-vertical' => $isVertical,
])
}}
>
@foreach ($getStartRenderHooks() as $startRenderHook)
{{ \Filament\Support\Facades\FilamentView::renderHook($startRenderHook, scopes: $renderHookScopes) }}
@endforeach
@foreach ($tabs as $index => $tab)
@php
$tabBadge = $tab->getBadge();
$tabBadgeColor = $tab->getBadgeColor();
$tabBadgeIcon = $tab->getBadgeIcon();
$tabBadgeIconPosition = $tab->getBadgeIconPosition();
$tabBadgeTooltip = $tab->getBadgeTooltip();
$tabExtraAttributeBag = $tab->getExtraAttributeBag();
$tabIcon = $tab->getIcon();
$tabIconPosition = $tab->getIconPosition();
$tabKey = $tab->getKey(isAbsolute: false);
$tabLabel = $tab->getLabel();
$tabVisibilityJs = $getTabVisibilityJs($tab, $index, 'inline');
@endphp
{{ $tabLabel }}
@endforeach
@if (! $isScrollable)
@foreach ($tabs as $index => $tab)
@php
$tabBadge = $tab->getBadge();
$tabBadgeColor = $tab->getBadgeColor();
$tabBadgeTooltip = $tab->getBadgeTooltip();
$tabExtraAttributeBag = $tab->getExtraAttributeBag();
$tabKey = $tab->getKey(isAbsolute: false);
$tabLabel = $tab->getLabel();
$tabVisibilityJs = $getTabVisibilityJs($tab, $index, 'trigger');
@endphp
{{ $tabLabel }}
@endforeach
{{
\Filament\Support\generate_icon_html(
Heroicon::EllipsisHorizontal,
alias: SchemaIconAlias::COMPONENTS_TABS_MORE_TABS_BUTTON,
)
}}
@foreach ($tabs as $index => $tab)
@php
$tabBadge = $tab->getBadge();
$tabBadgeColor = $tab->getBadgeColor();
$tabBadgeTooltip = $tab->getBadgeTooltip();
$tabIcon = $tab->getIcon();
$tabKey = $tab->getKey(isAbsolute: false);
$tabLabel = $tab->getLabel();
@endphp
{{ $tabLabel }}
@endforeach
@endif
@foreach ($getEndRenderHooks() as $endRenderHook)
{{ \Filament\Support\Facades\FilamentView::renderHook($endRenderHook, scopes: $renderHookScopes) }}
@endforeach
@foreach ($tabs as $tab)
@php
$tabVisibilityJs = $getTabVisibilityJs($tab);
@endphp
@if ($tabVisibilityJs)
{{ $tab }}
@else
{{ $tab }}
@endif
@endforeach
@else
@php
$activeTab = strval($this->{$livewireProperty});
@endphp
merge([
'id' => $id,
'wire:key' => $getLivewireKey() . '.container',
], escape: false)
->merge($getExtraAttributes(), escape: false)
->class([
'fi-sc-tabs',
'fi-contained' => $isContained,
'fi-vertical' => $isVertical,
])
}}
>
@foreach ($getStartRenderHooks() as $startRenderHook)
{{ \Filament\Support\Facades\FilamentView::renderHook($startRenderHook, scopes: $renderHookScopes) }}
@endforeach
@foreach ($getChildSchema()->getComponents(withOriginalKeys: true) as $tabKey => $tab)
@php
$tabBadge = $tab->getBadge();
$tabBadgeColor = $tab->getBadgeColor();
$tabBadgeIcon = $tab->getBadgeIcon();
$tabBadgeIconPosition = $tab->getBadgeIconPosition();
$tabBadgeTooltip = $tab->getBadgeTooltip();
$tabExtraAttributeBag = $tab->getExtraAttributeBag();
$tabIcon = $tab->getIcon();
$tabIconPosition = $tab->getIconPosition();
$tabKey = strval($tabKey);
$tabLabel = $tab->getLabel() ?? $this->generateTabLabel($tabKey);
@endphp
{{ $tabLabel }}
@endforeach
@foreach ($getEndRenderHooks() as $endRenderHook)
{{ \Filament\Support\Facades\FilamentView::renderHook($endRenderHook, scopes: $renderHookScopes) }}
@endforeach
@foreach ($getChildSchema()->getComponents(withOriginalKeys: true) as $tabKey => $tab)
{{ $tab->key($tabKey) }}
@endforeach
@endif