phases one of time logged now with log display

This commit is contained in:
Mark Gregory
2026-06-22 12:53:56 +01:00
parent c1a9d0de27
commit 052bae718e
231 changed files with 15113 additions and 12891 deletions
@@ -7,12 +7,4 @@
$alt = __('filament-panels::layout.avatar.alt', ['name' => filament()->getTenantName($tenant)]);
@endphp
<x-filament::avatar
:circular="false"
:src="$src"
:alt="$alt"
:attributes="
\Filament\Support\prepare_inherited_attributes($attributes)
->class(['fi-tenant-avatar'])
"
/>
<x-filament::avatar :circular="false" :src="$src" :alt="$alt" :attributes="\Filament\Support\prepare_inherited_attributes($attributes)->class(['fi-tenant-avatar'])" />
@@ -7,11 +7,4 @@
$alt = __('filament-panels::layout.avatar.alt', ['name' => filament()->getUserName($user)]);
@endphp
<x-filament::avatar
:src="$src"
:alt="$alt"
:attributes="
\Filament\Support\prepare_inherited_attributes($attributes)
->class(['fi-user-avatar'])
"
/>
<x-filament::avatar :src="$src" :alt="$alt" :attributes="\Filament\Support\prepare_inherited_attributes($attributes)->class(['fi-user-avatar'])" />
@@ -6,14 +6,7 @@
'subheading' => null,
])
<header
{{
$attributes->class([
'fi-header',
'fi-header-has-breadcrumbs' => $breadcrumbs,
])
}}
>
<header {{ $attributes->class(['fi-header', 'fi-header-has-breadcrumbs' => $breadcrumbs]) }}>
<div>
@if ($breadcrumbs)
<x-filament::breadcrumbs :breadcrumbs="$breadcrumbs" />
@@ -37,8 +30,14 @@
</div>
@php
$beforeActions = \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_HEADER_ACTIONS_BEFORE, scopes: $this->getRenderHookScopes());
$afterActions = \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_HEADER_ACTIONS_AFTER, scopes: $this->getRenderHookScopes());
$beforeActions = \Filament\Support\Facades\FilamentView::renderHook(
\Filament\View\PanelsRenderHook::PAGE_HEADER_ACTIONS_BEFORE,
scopes: $this->getRenderHookScopes(),
);
$afterActions = \Filament\Support\Facades\FilamentView::renderHook(
\Filament\View\PanelsRenderHook::PAGE_HEADER_ACTIONS_AFTER,
scopes: $this->getRenderHookScopes(),
);
@endphp
@if (filled($beforeActions) || $actions || filled($afterActions))
@@ -46,10 +45,7 @@
{{ $beforeActions }}
@if ($actions)
<x-filament::actions
:actions="$actions"
:alignment="$actionsAlignment"
/>
<x-filament::actions :actions="$actions" :alignment="$actionsAlignment" />
@endif
{{ $afterActions }}
@@ -9,23 +9,20 @@
$hasTopNavigation = filament()->hasTopNavigation();
$hasNavigation = filament()->hasNavigation();
$renderHookScopes = $livewire?->getRenderHookScopes();
$maxContentWidth ??= (filament()->getMaxContentWidth() ?? Width::SevenExtraLarge);
$maxContentWidth ??= filament()->getMaxContentWidth() ?? Width::SevenExtraLarge;
if (is_string($maxContentWidth)) {
$maxContentWidth = Width::tryFrom($maxContentWidth) ?? $maxContentWidth;
}
@endphp
<x-filament-panels::layout.base
:livewire="$livewire"
@class([
'fi-body-has-navigation' => $hasNavigation,
'fi-body-has-sidebar-collapsible-on-desktop' => $isSidebarCollapsibleOnDesktop,
'fi-body-has-sidebar-fully-collapsible-on-desktop' => $isSidebarFullyCollapsibleOnDesktop,
'fi-body-has-topbar' => $hasTopbar,
'fi-body-has-top-navigation' => $hasTopNavigation,
])
>
<x-filament-panels::layout.base :livewire="$livewire" @class([
'fi-body-has-navigation' => $hasNavigation,
'fi-body-has-sidebar-collapsible-on-desktop' => $isSidebarCollapsibleOnDesktop,
'fi-body-has-sidebar-fully-collapsible-on-desktop' => $isSidebarFullyCollapsibleOnDesktop,
'fi-body-has-topbar' => $hasTopbar,
'fi-body-has-top-navigation' => $hasTopNavigation,
])>
@if ($hasTopbar)
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::TOPBAR_BEFORE, scopes: $renderHookScopes) }}
@@ -33,27 +30,14 @@
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::TOPBAR_AFTER, scopes: $renderHookScopes) }}
@elseif ($hasNavigation)
<div
@if ($isSidebarFullyCollapsibleOnDesktop)
x-data="{}"
x-bind:class="{ 'lg:fi-hidden': $store.sidebar.isOpen }"
@endif
<div @if ($isSidebarFullyCollapsibleOnDesktop) x-data="{}"
x-bind:class="{ 'lg:fi-hidden': $store.sidebar.isOpen }" @endif
@class([
'fi-layout-sidebar-toggle-btn-ctn',
'lg:fi-hidden' => ! $isSidebarFullyCollapsibleOnDesktop,
])
>
<x-filament::icon-button
color="gray"
:icon="\Filament\Support\Icons\Heroicon::OutlinedBars3"
:icon-alias="\Filament\View\PanelsIconAlias::SIDEBAR_EXPAND_BUTTON"
icon-size="lg"
:label="__('filament-panels::layout.actions.sidebar.expand.label')"
x-cloak
x-data="{}"
x-on:click="$store.sidebar.open()"
class="fi-layout-sidebar-toggle-btn"
/>
'lg:fi-hidden' => !$isSidebarFullyCollapsibleOnDesktop,
])>
<x-filament::icon-button color="gray" :icon="\Filament\Support\Icons\Heroicon::OutlinedBars3" :icon-alias="\Filament\View\PanelsIconAlias::SIDEBAR_EXPAND_BUTTON" icon-size="lg" :label="__('filament-panels::layout.actions.sidebar.expand.label')"
x-cloak x-data="{}" x-on:click="$store.sidebar.open()" class="fi-layout-sidebar-toggle-btn" />
</div>
@endif
@@ -61,21 +45,13 @@
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::LAYOUT_START, scopes: $renderHookScopes) }}
@if ($hasNavigation)
<div
x-cloak
x-data="{}"
x-on:click="$store.sidebar.close()"
x-show="$store.sidebar.isOpen"
x-transition.opacity.300ms
class="fi-sidebar-close-overlay"
></div>
<div x-cloak x-data="{}" x-on:click="$store.sidebar.close()" x-show="$store.sidebar.isOpen"
x-transition.opacity.300ms class="fi-sidebar-close-overlay"></div>
@livewire(filament()->getSidebarLivewireComponent())
@endif
<div
@if ($isSidebarCollapsibleOnDesktop)
x-data="{}"
<div @if ($isSidebarCollapsibleOnDesktop) x-data="{}"
x-bind:class="{
'fi-main-ctn-sidebar-open': $store.sidebar.isOpen,
}"
@@ -88,20 +64,18 @@
}"
x-bind:style="'display: flex; opacity:1;'"
{{-- Mimics `x-cloak`, as using `x-cloak` causes visual issues with chart widgets --}}
@elseif (! ($isSidebarCollapsibleOnDesktop || $isSidebarFullyCollapsibleOnDesktop || $hasTopNavigation || (! $hasNavigation)))
@elseif (!($isSidebarCollapsibleOnDesktop || $isSidebarFullyCollapsibleOnDesktop || $hasTopNavigation || !$hasNavigation))
x-data="{}"
x-bind:style="'display: flex; opacity:1;'" {{-- Mimics `x-cloak`, as using `x-cloak` causes visual issues with chart widgets --}}
@endif
class="fi-main-ctn"
>
x-bind:style="'display: flex; opacity:1;'" {{-- Mimics `x-cloak`, as using `x-cloak` causes visual issues with chart widgets --}} @endif
class="fi-main-ctn">
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::CONTENT_BEFORE, scopes: $renderHookScopes) }}
<main
@class([
'fi-main',
($maxContentWidth instanceof Width) ? "fi-width-{$maxContentWidth->value}" : $maxContentWidth,
])
>
<main @class([
'fi-main',
$maxContentWidth instanceof Width
? "fi-width-{$maxContentWidth->value}"
: $maxContentWidth,
])>
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::CONTENT_START, scopes: $renderHookScopes) }}
{{ $slot }}
@@ -4,7 +4,7 @@
$livewire ??= null;
$renderHookScopes = $livewire?->getRenderHookScopes();
$maxContentWidth ??= (filament()->getSimplePageMaxContentWidth() ?? Width::Large);
$maxContentWidth ??= filament()->getSimplePageMaxContentWidth() ?? Width::Large;
if (is_string($maxContentWidth)) {
$maxContentWidth = Width::tryFrom($maxContentWidth) ?? $maxContentWidth;
@@ -37,12 +37,12 @@
@endif
<div class="fi-simple-main-ctn">
<main
@class([
'fi-simple-main',
($maxContentWidth instanceof Width) ? "fi-width-{$maxContentWidth->value}" : $maxContentWidth,
])
>
<main @class([
'fi-simple-main',
$maxContentWidth instanceof Width
? "fi-width-{$maxContentWidth->value}"
: $maxContentWidth,
])>
{{ $slot }}
</main>
</div>
@@ -5,9 +5,9 @@
$darkModeBrandLogo = filament()->getDarkModeBrandLogo();
$hasDarkModeBrandLogo = filled($darkModeBrandLogo);
$getLogoClasses = fn (bool $isDarkMode): string => \Illuminate\Support\Arr::toCssClasses([
$getLogoClasses = fn(bool $isDarkMode): string => \Illuminate\Support\Arr::toCssClasses([
'fi-logo',
'fi-logo-light' => $hasDarkModeBrandLogo && (! $isDarkMode),
'fi-logo-light' => $hasDarkModeBrandLogo && !$isDarkMode,
'fi-logo-dark' => $isDarkMode,
]);
@@ -16,33 +16,14 @@
@capture($content, $logo, $isDarkMode = false)
@if ($logo instanceof \Illuminate\Contracts\Support\Htmlable)
<div
{{
$attributes
->class([$getLogoClasses($isDarkMode)])
->style([$logoStyles])
}}
>
<div {{ $attributes->class([$getLogoClasses($isDarkMode)])->style([$logoStyles]) }}>
{{ $logo }}
</div>
@elseif (filled($logo))
<img
alt="{{ __('filament-panels::layout.logo.alt', ['name' => $brandName]) }}"
src="{{ $logo }}"
{{
$attributes
->class([$getLogoClasses($isDarkMode)])
->style([$logoStyles])
}}
/>
<img alt="{{ __('filament-panels::layout.logo.alt', ['name' => $brandName]) }}" src="{{ $logo }}"
{{ $attributes->class([$getLogoClasses($isDarkMode)])->style([$logoStyles]) }} />
@else
<div
{{
$attributes->class([
$getLogoClasses($isDarkMode),
])
}}
>
<div {{ $attributes->class([$getLogoClasses($isDarkMode)]) }}>
{{ $brandName }}
</div>
@endif
@@ -11,33 +11,24 @@
@endphp
<div
{{
$attributes->class([
'fi-page',
'fi-height-full' => $fullHeight,
'fi-page-has-sub-navigation' => $subNavigation,
"fi-page-has-sub-navigation-{$subNavigationPosition->value}" => $subNavigation,
...$this->getPageClasses(),
])
}}
>
{{ $attributes->class([
'fi-page',
'fi-height-full' => $fullHeight,
'fi-page-has-sub-navigation' => $subNavigation,
"fi-page-has-sub-navigation-{$subNavigationPosition->value}" => $subNavigation,
...$this->getPageClasses(),
]) }}>
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_START, scopes: $this->getRenderHookScopes()) }}
<div class="fi-page-header-main-ctn">
@if ($subNavigation)
<div
class="fi-page-main-sub-navigation-mobile-menu-render-hook-ctn"
>
<div class="fi-page-main-sub-navigation-mobile-menu-render-hook-ctn">
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_MOBILE_MENU_BEFORE, scopes: $this->getRenderHookScopes()) }}
</div>
<x-filament-panels::page.sub-navigation.mobile-menu
:navigation="$subNavigation"
/>
<x-filament-panels::page.sub-navigation.mobile-menu :navigation="$subNavigation" />
<div
class="fi-page-main-sub-navigation-mobile-menu-render-hook-ctn"
>
<div class="fi-page-main-sub-navigation-mobile-menu-render-hook-ctn">
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_MOBILE_MENU_AFTER, scopes: $this->getRenderHookScopes()) }}
</div>
@endif
@@ -54,13 +45,8 @@
@endphp
@if (filled($headerActions) || $breadcrumbs || filled($heading) || filled($subheading))
<x-filament-panels::header
:actions="$headerActions"
:actions-alignment="$headerActionsAlignment"
:breadcrumbs="$breadcrumbs"
:heading="$heading"
:subheading="$subheading"
>
<x-filament-panels::header :actions="$headerActions" :actions-alignment="$headerActionsAlignment" :breadcrumbs="$breadcrumbs" :heading="$heading"
:subheading="$subheading">
@if ($heading instanceof \Illuminate\Contracts\Support\Htmlable)
<x-slot name="heading">
{{ $heading }}
@@ -81,9 +67,7 @@
@if ($subNavigationPosition === SubNavigationPosition::Start)
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_START_BEFORE, scopes: $this->getRenderHookScopes()) }}
<x-filament-panels::page.sub-navigation.sidebar
:navigation="$subNavigation"
/>
<x-filament-panels::page.sub-navigation.sidebar :navigation="$subNavigation" />
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_START_AFTER, scopes: $this->getRenderHookScopes()) }}
@endif
@@ -91,9 +75,7 @@
@if ($subNavigationPosition === SubNavigationPosition::Top)
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_TOP_BEFORE, scopes: $this->getRenderHookScopes()) }}
<x-filament-panels::page.sub-navigation.tabs
:navigation="$subNavigation"
/>
<x-filament-panels::page.sub-navigation.tabs :navigation="$subNavigation" />
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_TOP_AFTER, scopes: $this->getRenderHookScopes()) }}
@endif
@@ -118,9 +100,7 @@
@if ($subNavigation && $subNavigationPosition === SubNavigationPosition::End)
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_END_BEFORE, scopes: $this->getRenderHookScopes()) }}
<x-filament-panels::page.sub-navigation.sidebar
:navigation="$subNavigation"
/>
<x-filament-panels::page.sub-navigation.sidebar :navigation="$subNavigation" />
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_END_AFTER, scopes: $this->getRenderHookScopes()) }}
@endif
@@ -131,18 +111,18 @@
@endif
</div>
@if (! ($this instanceof \Filament\Tables\Contracts\HasTable))
@if (!($this instanceof \Filament\Tables\Contracts\HasTable))
<x-filament-actions::modals />
@elseif ($this->isTableLoaded() && filled($this->defaultTableAction))
<div
wire:init="mountAction(@js($this->defaultTableAction) , @if (filled($this->defaultTableActionArguments)) @js($this->defaultTableActionArguments) @else {} @endif , @js(['table' => true, 'recordKey' => $this->defaultTableActionRecord]))"
></div>
wire:init="mountAction(@js($this->defaultTableAction) , @if (filled($this->defaultTableActionArguments)) @js($this->defaultTableActionArguments) @else {} @endif , @js(['table' => true, 'recordKey' => $this->defaultTableActionRecord]))">
</div>
@endif
@if (filled($this->defaultAction))
<div
wire:init="mountAction(@js($this->defaultAction) @if (filled($this->defaultActionArguments) || filled($this->defaultActionContext)) , @if (filled($this->defaultActionArguments)) @js($this->defaultActionArguments) @else {} @endif @endif @if (filled($this->defaultActionContext)) , @js($this->defaultActionContext) @endif)"
></div>
wire:init="mountAction(@js($this->defaultAction) @if (filled($this->defaultActionArguments) || filled($this->defaultActionContext)) , @if (filled($this->defaultActionArguments)) @js($this->defaultActionArguments) @else {} @endif @endif @if (filled($this->defaultActionContext)) , @js($this->defaultActionContext) @endif)">
</div>
@endif
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_END, scopes: $this->getRenderHookScopes()) }}
@@ -161,13 +141,15 @@
@else
@script
<script>
setUpUnsavedDataChangesAlert({ $wire })
setUpUnsavedDataChangesAlert({
$wire
})
</script>
@endscript
@endif
@endif
@if (! app()->hasDebugModeEnabled())
@if (!app()->hasDebugModeEnabled())
@script
<script>
window.filamentErrorNotifications = @js($this->hasErrorNotifications() ? $this->getErrorNotifications() : null)
@@ -14,17 +14,13 @@
<div class="fi-simple-page-content">
@if (filled($heading) || $hasLogo || filled($subheading))
<x-filament-panels::header.simple
:heading="$heading"
:logo="$hasLogo"
:subheading="$subheading"
/>
<x-filament-panels::header.simple :heading="$heading" :logo="$hasLogo" :subheading="$subheading" />
@endif
{{ $slot }}
</div>
@if (! $this instanceof \Filament\Tables\Contracts\HasTable)
@if (!$this instanceof \Filament\Tables\Contracts\HasTable)
<x-filament-actions::modals />
@endif
@@ -1,15 +1,6 @@
@props([
'navigation',
])
@props(['navigation'])
<x-filament::dropdown
placement="bottom-start"
width="xs"
:attributes="
\Filament\Support\prepare_inherited_attributes($attributes)
->class(['fi-page-sub-navigation-dropdown'])
"
>
<x-filament::dropdown placement="bottom-start" width="xs" :attributes="\Filament\Support\prepare_inherited_attributes($attributes)->class(['fi-page-sub-navigation-dropdown'])">
<x-slot name="trigger">
@php
$activeItem = null;
@@ -27,12 +18,7 @@
}
@endphp
<x-filament::button
color="gray"
:icon="\Filament\Support\Icons\Heroicon::ChevronDown"
:icon-alias="\Filament\View\PanelsIconAlias::SUB_NAVIGATION_MOBILE_MENU_BUTTON"
icon-position="after"
>
<x-filament::button color="gray" :icon="\Filament\Support\Icons\Heroicon::ChevronDown" :icon-alias="\Filament\View\PanelsIconAlias::SUB_NAVIGATION_MOBILE_MENU_BUTTON" icon-position="after">
{{ $activeItem?->getLabel() }}
</x-filament::button>
</x-slot>
@@ -50,21 +36,16 @@
@php
$navigationItemBadge = $navigationItem->getBadge();
$navigationItemBadgeColor = $navigationItem->getBadgeColor($navigationItemBadge);
$navigationItemIcon = $navigationItem->isActive() ? ($navigationItem->getActiveIcon() ?? $navigationItem->getIcon()) : $navigationItem->getIcon();
$navigationItemIcon = $navigationItem->isActive()
? $navigationItem->getActiveIcon() ?? $navigationItem->getIcon()
: $navigationItem->getIcon();
$navigationItemUrl = $navigationItem->getUrl();
$shouldNavigationItemOpenUrlInNewTab = $navigationItem->shouldOpenUrlInNewTab();
$navigationItemExtraAttributes = $navigationItemChild->getExtraAttributeBag();
@endphp
<x-filament::dropdown.list.item
:badge="$navigationItemBadge"
:badge-color="$navigationItemBadgeColor"
:href="$navigationItemUrl"
:icon="$navigationItemIcon"
tag="a"
:target="$shouldNavigationItemOpenUrlInNewTab ? '_blank' : null"
:attributes="\Filament\Support\prepare_inherited_attributes($navigationItemExtraAttributes)"
>
<x-filament::dropdown.list.item :badge="$navigationItemBadge" :badge-color="$navigationItemBadgeColor" :href="$navigationItemUrl"
:icon="$navigationItemIcon" tag="a" :target="$shouldNavigationItemOpenUrlInNewTab ? '_blank' : null" :attributes="\Filament\Support\prepare_inherited_attributes($navigationItemExtraAttributes)">
{{ $navigationItemChild->getLabel() }}
</x-filament::dropdown.list.item>
@endforeach
@@ -1,10 +1,6 @@
@props([
'navigation',
])
@props(['navigation'])
<div
{{ $attributes->class(['fi-page-sub-navigation-sidebar-ctn']) }}
>
<div {{ $attributes->class(['fi-page-sub-navigation-sidebar-ctn']) }}>
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::PAGE_SUB_NAVIGATION_SIDEBAR_BEFORE, scopes: $this->getRenderHookScopes()) }}
<ul class="fi-page-sub-navigation-sidebar">
@@ -18,16 +14,8 @@
$navigationGroupExtraSidebarAttributeBag = $navigationGroup->getExtraSidebarAttributeBag();
@endphp
<x-filament-panels::sidebar.group
:active="$isNavigationGroupActive"
:collapsible="$isNavigationGroupCollapsible"
:icon="$navigationGroupIcon"
:items="$navigationGroupItems"
:label="$navigationGroupLabel"
:sidebar-collapsible="false"
sub-navigation
:attributes="\Filament\Support\prepare_inherited_attributes($navigationGroupExtraSidebarAttributeBag)"
/>
<x-filament-panels::sidebar.group :active="$isNavigationGroupActive" :collapsible="$isNavigationGroupCollapsible" :icon="$navigationGroupIcon" :items="$navigationGroupItems"
:label="$navigationGroupLabel" :sidebar-collapsible="false" sub-navigation :attributes="\Filament\Support\prepare_inherited_attributes($navigationGroupExtraSidebarAttributeBag)" />
@endforeach
</ul>
@@ -1,10 +1,6 @@
@props([
'navigation',
])
@props(['navigation'])
<x-filament::tabs
:attributes="\Filament\Support\prepare_inherited_attributes($attributes)->class(['fi-page-sub-navigation-tabs'])"
>
<x-filament::tabs :attributes="\Filament\Support\prepare_inherited_attributes($attributes)->class(['fi-page-sub-navigation-tabs'])">
@foreach ($navigation as $navigationGroup)
@php
$navigationGroupLabel = $navigationGroup->getLabel();
@@ -15,10 +11,7 @@
@if ($navigationGroupLabel)
<x-filament::dropdown placement="bottom-start">
<x-slot name="trigger">
<x-filament::tabs.item
:active="$isNavigationGroupActive"
:icon="$navigationGroupIcon"
>
<x-filament::tabs.item :active="$isNavigationGroupActive" :icon="$navigationGroupIcon">
{{ $navigationGroupLabel }}
</x-filament::tabs.item>
</x-slot>
@@ -29,22 +22,16 @@
$navigationItemBadge = $navigationItem->getBadge();
$navigationItemBadgeColor = $navigationItem->getBadgeColor($navigationItemBadge);
$navigationItemBadgeTooltip = $navigationItem->getBadgeTooltip($navigationItemBadge);
$navigationItemIcon = $navigationItem->isActive() ? ($navigationItem->getActiveIcon() ?? $navigationItem->getIcon()) : $navigationItem->getIcon();
$navigationItemIcon = $navigationItem->isActive()
? $navigationItem->getActiveIcon() ?? $navigationItem->getIcon()
: $navigationItem->getIcon();
$navigationItemUrl = $navigationItem->getUrl();
$shouldNavigationItemOpenUrlInNewTab = $navigationItem->shouldOpenUrlInNewTab();
$navigationItemExtraAttributes = $navigationItem->getExtraAttributeBag();
@endphp
<x-filament::dropdown.list.item
:badge="$navigationItemBadge"
:badge-color="$navigationItemBadgeColor"
:badge-tooltip="$navigationItemBadgeTooltip"
:href="$navigationItemUrl"
:icon="$navigationItemIcon"
tag="a"
:target="$shouldNavigationItemOpenUrlInNewTab ? '_blank' : null"
:attributes="\Filament\Support\prepare_inherited_attributes($navigationItemExtraAttributes)"
>
<x-filament::dropdown.list.item :badge="$navigationItemBadge" :badge-color="$navigationItemBadgeColor" :badge-tooltip="$navigationItemBadgeTooltip"
:href="$navigationItemUrl" :icon="$navigationItemIcon" tag="a" :target="$shouldNavigationItemOpenUrlInNewTab ? '_blank' : null" :attributes="\Filament\Support\prepare_inherited_attributes($navigationItemExtraAttributes)">
{{ $navigationItem->getLabel() }}
@if ($navigationItemIcon instanceof \Illuminate\Contracts\Support\Htmlable)
@@ -63,23 +50,16 @@
$navigationItemBadge = $navigationItem->getBadge();
$navigationItemBadgeColor = $navigationItem->getBadgeColor($navigationItemBadge);
$navigationItemBadgeTooltip = $navigationItem->getBadgeTooltip($navigationItemBadge);
$navigationItemIcon = $navigationItem->isActive() ? ($navigationItem->getActiveIcon() ?? $navigationItem->getIcon()) : $navigationItem->getIcon();
$navigationItemIcon = $navigationItem->isActive()
? $navigationItem->getActiveIcon() ?? $navigationItem->getIcon()
: $navigationItem->getIcon();
$navigationItemUrl = $navigationItem->getUrl();
$shouldNavigationItemOpenUrlInNewTab = $navigationItem->shouldOpenUrlInNewTab();
$navigationItemExtraAttributes = $navigationItem->getExtraAttributeBag();
@endphp
<x-filament::tabs.item
:active="$isNavigationItemActive"
:badge="$navigationItemBadge"
:badge-color="$navigationItemBadgeColor"
:badge-tooltip="$navigationItemBadgeTooltip"
:href="$navigationItemUrl"
:icon="$navigationItemIcon"
tag="a"
:target="$shouldNavigationItemOpenUrlInNewTab ? '_blank' : null"
:attributes="\Filament\Support\prepare_inherited_attributes($navigationItemExtraAttributes)"
>
<x-filament::tabs.item :active="$isNavigationItemActive" :badge="$navigationItemBadge" :badge-color="$navigationItemBadgeColor" :badge-tooltip="$navigationItemBadgeTooltip"
:href="$navigationItemUrl" :icon="$navigationItemIcon" tag="a" :target="$shouldNavigationItemOpenUrlInNewTab ? '_blank' : null" :attributes="\Filament\Support\prepare_inherited_attributes($navigationItemExtraAttributes)">
{{ $navigationItem->getLabel() }}
@if ($navigationItemIcon instanceof \Illuminate\Contracts\Support\Htmlable)
@@ -6,27 +6,21 @@
{{ \Filament\Support\generate_icon_html(\Filament\Support\Icons\Heroicon::OutlinedBell, alias: \Filament\View\PanelsIconAlias::SIDEBAR_OPEN_DATABASE_NOTIFICATIONS_BUTTON, size: \Filament\Support\Enums\IconSize::Large) }}
<span
@if ($isSidebarCollapsibleOnDesktop)
x-show="$store.sidebar.isOpen"
@if ($isSidebarCollapsibleOnDesktop) x-show="$store.sidebar.isOpen"
x-transition:enter="fi-transition-enter"
x-transition:enter-start="fi-transition-enter-start"
x-transition:enter-end="fi-transition-enter-end"
@endif
class="fi-sidebar-database-notifications-btn-label"
>
x-transition:enter-end="fi-transition-enter-end" @endif
class="fi-sidebar-database-notifications-btn-label">
{{ __('filament-panels::layout.actions.open_database_notifications.label') }}
</span>
@if ($unreadNotificationsCount)
<span
@if ($isSidebarCollapsibleOnDesktop)
x-show="$store.sidebar.isOpen"
@if ($isSidebarCollapsibleOnDesktop) x-show="$store.sidebar.isOpen"
x-transition:enter="fi-transition-enter"
x-transition:enter-start="fi-transition-enter-start"
x-transition:enter-end="fi-transition-enter-end"
@endif
class="fi-sidebar-database-notifications-btn-badge-ctn"
>
x-transition:enter-end="fi-transition-enter-end" @endif
class="fi-sidebar-database-notifications-btn-badge-ctn">
<x-filament::badge>
{{ $unreadNotificationsCount }}
</x-filament::badge>
@@ -13,31 +13,16 @@
$hasDropdown = filled($label) && filled($icon) && $sidebarCollapsible;
@endphp
<li
x-data="{ label: @js($subNavigation ? "sub_navigation_{$label}" : $label) }"
data-group-label="{{ $subNavigation ? "sub_navigation_{$label}" : $label }}"
<li x-data="{ label: @js($subNavigation ? "sub_navigation_{$label}" : $label) }" data-group-label="{{ $subNavigation ? "sub_navigation_{$label}" : $label }}"
x-bind:class="{ 'fi-collapsed': $store.sidebar.groupIsCollapsed(label) }"
{{
$attributes->class([
'fi-sidebar-group',
'fi-active' => $active,
'fi-collapsible' => $collapsible,
])
}}
>
{{ $attributes->class(['fi-sidebar-group', 'fi-active' => $active, 'fi-collapsible' => $collapsible]) }}>
@if ($label)
<div
@if ($collapsible)
x-on:click="$store.sidebar.toggleCollapsedGroup(label)"
@endif
@if ($sidebarCollapsible)
x-show="$store.sidebar.isOpen"
<div @if ($collapsible) x-on:click="$store.sidebar.toggleCollapsedGroup(label)" @endif
@if ($sidebarCollapsible) x-show="$store.sidebar.isOpen"
x-transition:enter="fi-transition-enter"
x-transition:enter-start="fi-transition-enter-start"
x-transition:enter-end="fi-transition-enter-end"
@endif
class="fi-sidebar-group-btn"
>
x-transition:enter-end="fi-transition-enter-end" @endif
class="fi-sidebar-group-btn">
@if ($icon)
{{ \Filament\Support\generate_icon_html($icon, size: \Filament\Support\Enums\IconSize::Large) }}
@endif
@@ -47,27 +32,17 @@
</span>
@if ($collapsible)
<x-filament::icon-button
color="gray"
:icon="\Filament\Support\Icons\Heroicon::ChevronUp"
:icon-alias="\Filament\View\PanelsIconAlias::SIDEBAR_GROUP_COLLAPSE_BUTTON"
:label="$label"
x-bind:aria-expanded="! $store.sidebar.groupIsCollapsed(label)"
x-on:click.stop="$store.sidebar.toggleCollapsedGroup(label)"
class="fi-sidebar-group-collapse-btn"
/>
<x-filament::icon-button color="gray" :icon="\Filament\Support\Icons\Heroicon::ChevronUp" :icon-alias="\Filament\View\PanelsIconAlias::SIDEBAR_GROUP_COLLAPSE_BUTTON" :label="$label"
x-bind:aria-expanded="!$store.sidebar.groupIsCollapsed(label)"
x-on:click.stop="$store.sidebar.toggleCollapsedGroup(label)" class="fi-sidebar-group-collapse-btn" />
@endif
</div>
@endif
@if ($hasDropdown)
<x-filament::dropdown
:placement="(__('filament-panels::layout.direction') === 'rtl') ? 'left-start' : 'right-start'"
x-show="! $store.sidebar.isOpen"
>
<x-filament::dropdown :placement="(__('filament-panels::layout.direction') === 'rtl') ? 'left-start' : 'right-start'" x-show="! $store.sidebar.isOpen">
<x-slot name="trigger">
<button
x-data="{ tooltip: false }"
<button x-data="{ tooltip: false }"
x-effect="
tooltip = $store.sidebar.isOpen
? false
@@ -77,9 +52,7 @@
theme: $store.theme,
}
"
x-tooltip.html="tooltip"
class="fi-sidebar-group-dropdown-trigger-btn"
>
x-tooltip.html="tooltip" class="fi-sidebar-group-dropdown-trigger-btn">
{{ \Filament\Support\generate_icon_html($icon, size: \Filament\Support\Enums\IconSize::Large) }}
</button>
</x-slot>
@@ -89,10 +62,7 @@
foreach ($items as $item) {
if ($childItems = $item->getChildItems()) {
$lists[] = [
$item,
...$childItems,
];
$lists[] = [$item, ...$childItems];
$lists[] = [];
continue;
@@ -127,22 +97,14 @@
$itemBadgeColor = $item->getBadgeColor($itemBadge);
$itemBadgeTooltip = $item->getBadgeTooltip($itemBadge);
$itemUrl = $item->getUrl();
$itemIcon = $itemIsActive ? ($item->getActiveIcon() ?? $item->getIcon()) : $item->getIcon();
$itemIcon = $itemIsActive ? $item->getActiveIcon() ?? $item->getIcon() : $item->getIcon();
$shouldItemOpenUrlInNewTab = $item->shouldOpenUrlInNewTab();
$itemExtraAttributes = $item->getExtraAttributeBag();
@endphp
<x-filament::dropdown.list.item
:badge="$itemBadge"
:badge-color="$itemBadgeColor"
:badge-tooltip="$itemBadgeTooltip"
:color="$itemIsActive ? 'primary' : 'gray'"
:href="$itemUrl"
:icon="$itemIcon"
tag="a"
:target="$shouldItemOpenUrlInNewTab ? '_blank' : null"
:attributes="\Filament\Support\prepare_inherited_attributes($itemExtraAttributes)"
>
<x-filament::dropdown.list.item :badge="$itemBadge" :badge-color="$itemBadgeColor" :badge-tooltip="$itemBadgeTooltip"
:color="$itemIsActive ? 'primary' : 'gray'" :href="$itemUrl" :icon="$itemIcon" tag="a" :target="$shouldItemOpenUrlInNewTab ? '_blank' : null"
:attributes="\Filament\Support\prepare_inherited_attributes($itemExtraAttributes)">
{{ $item->getLabel() }}
</x-filament::dropdown.list.item>
@endforeach
@@ -151,26 +113,20 @@
</x-filament::dropdown>
@endif
<ul
@if (filled($label))
@if ($sidebarCollapsible)
<ul @if (filled($label)) @if ($sidebarCollapsible)
x-show="$store.sidebar.isOpen ? ! $store.sidebar.groupIsCollapsed(label) : ! @js($hasDropdown)"
@else
x-show="! $store.sidebar.groupIsCollapsed(label)"
@endif
x-collapse.duration.200ms
@endif
@if ($sidebarCollapsible)
x-transition:enter="fi-transition-enter"
x-show="! $store.sidebar.groupIsCollapsed(label)" @endif
x-collapse.duration.200ms @endif
@if ($sidebarCollapsible) x-transition:enter="fi-transition-enter"
x-transition:enter-start="fi-transition-enter-start"
x-transition:enter-end="fi-transition-enter-end"
@endif
x-transition:enter-end="fi-transition-enter-end" @endif
class="fi-sidebar-group-items"
>
>
@foreach ($items as $item)
@php
$isItemChildItemsActive = $item->isChildItemsActive();
$isItemActive = (! $isItemChildItemsActive) && $item->isActive();
$isItemActive = !$isItemChildItemsActive && $item->isActive();
$itemActiveIcon = $item->getActiveIcon();
$itemBadge = $item->getBadge();
$itemBadgeColor = $item->getBadgeColor($itemBadge);
@@ -186,29 +142,19 @@
$itemIcon = null;
$itemActiveIcon = null;
} else {
throw new \Exception('Navigation group [' . $label . '] has an icon but one or more of its items also have icons. Either the group or its items can have icons, but not both. This is to ensure a proper user experience.');
throw new \Exception(
'Navigation group [' .
$label .
'] has an icon but one or more of its items also have icons. Either the group or its items can have icons, but not both. This is to ensure a proper user experience.',
);
}
}
@endphp
<x-filament-panels::sidebar.item
:active="$isItemActive"
:active-child-items="$isItemChildItemsActive"
:active-icon="$itemActiveIcon"
:badge="$itemBadge"
:badge-color="$itemBadgeColor"
:badge-tooltip="$itemBadgeTooltip"
:child-items="$itemChildItems"
:first="$loop->first"
:grouped="filled($label)"
:icon="$itemIcon"
:last="$loop->last"
:should-open-url-in-new-tab="$shouldItemOpenUrlInNewTab"
:sidebar-collapsible="$sidebarCollapsible"
:sub-navigation="$subNavigation"
:url="$itemUrl"
:attributes="\Filament\Support\prepare_inherited_attributes($itemExtraAttributes)"
>
<x-filament-panels::sidebar.item :active="$isItemActive" :active-child-items="$isItemChildItemsActive" :active-icon="$itemActiveIcon" :badge="$itemBadge"
:badge-color="$itemBadgeColor" :badge-tooltip="$itemBadgeTooltip" :child-items="$itemChildItems" :first="$loop->first" :grouped="filled($label)"
:icon="$itemIcon" :last="$loop->last" :should-open-url-in-new-tab="$shouldItemOpenUrlInNewTab" :sidebar-collapsible="$sidebarCollapsible" :sub-navigation="$subNavigation"
:url="$itemUrl" :attributes="\Filament\Support\prepare_inherited_attributes($itemExtraAttributes)">
{{ $item->getLabel() }}
@if ($itemIcon instanceof \Illuminate\Contracts\Support\Htmlable)
@@ -22,20 +22,15 @@
@endphp
<li
{{
$attributes->class([
'fi-sidebar-item',
'fi-active' => $active,
'fi-sidebar-item-has-active-child-items' => $activeChildItems,
'fi-sidebar-item-has-url' => filled($url),
])
}}
>
<a
{{ \Filament\Support\generate_href_html($url, $shouldOpenUrlInNewTab) }}
{{ $attributes->class([
'fi-sidebar-item',
'fi-active' => $active,
'fi-sidebar-item-has-active-child-items' => $activeChildItems,
'fi-sidebar-item-has-url' => filled($url),
]) }}>
<a {{ \Filament\Support\generate_href_html($url, $shouldOpenUrlInNewTab) }}
x-on:click="window.matchMedia(`(max-width: 1024px)`).matches && $store.sidebar.close()"
@if ($sidebarCollapsible && (! $subNavigation))
x-data="{ tooltip: false }"
@if ($sidebarCollapsible && !$subNavigation) x-data="{ tooltip: false }"
x-effect="
tooltip = $store.sidebar.isOpen
? false
@@ -45,35 +40,27 @@
theme: $store.theme,
}
"
x-tooltip.html="tooltip"
@endif
class="fi-sidebar-item-btn"
>
@if (filled($icon) && ((! $subGrouped) || ($sidebarCollapsible && (! $subNavigation))))
{{
\Filament\Support\generate_icon_html(($active && $activeIcon) ? $activeIcon : $icon, attributes: (new \Illuminate\View\ComponentAttributeBag([
'x-show' => ($subGrouped && $sidebarCollapsible) ? '! $store.sidebar.isOpen' : false,
]))->class(['fi-sidebar-item-icon']), size: \Filament\Support\Enums\IconSize::Large)
}}
x-tooltip.html="tooltip" @endif
class="fi-sidebar-item-btn">
@if (filled($icon) && (!$subGrouped || ($sidebarCollapsible && !$subNavigation)))
{{ \Filament\Support\generate_icon_html(
$active && $activeIcon ? $activeIcon : $icon,
attributes: new \Illuminate\View\ComponentAttributeBag([
'x-show' => $subGrouped && $sidebarCollapsible ? '! $store.sidebar.isOpen' : false,
])->class(['fi-sidebar-item-icon']),
size: \Filament\Support\Enums\IconSize::Large,
) }}
@endif
@if ((blank($icon) && $grouped) || $subGrouped)
<div
@if (filled($icon) && $subGrouped && $sidebarCollapsible && (! $subNavigation))
x-show="$store.sidebar.isOpen"
@endif
class="fi-sidebar-item-grouped-border"
>
@if (! $first)
<div
class="fi-sidebar-item-grouped-border-part-not-first"
></div>
<div @if (filled($icon) && $subGrouped && $sidebarCollapsible && !$subNavigation) x-show="$store.sidebar.isOpen" @endif
class="fi-sidebar-item-grouped-border">
@if (!$first)
<div class="fi-sidebar-item-grouped-border-part-not-first"></div>
@endif
@if (! $last)
<div
class="fi-sidebar-item-grouped-border-part-not-last"
></div>
@if (!$last)
<div class="fi-sidebar-item-grouped-border-part-not-last"></div>
@endif
<div class="fi-sidebar-item-grouped-border-part"></div>
@@ -81,31 +68,22 @@
@endif
<span
@if ($sidebarCollapsible && (! $subNavigation))
x-show="$store.sidebar.isOpen"
@if ($sidebarCollapsible && !$subNavigation) x-show="$store.sidebar.isOpen"
x-transition:enter="fi-transition-enter"
x-transition:enter-start="fi-transition-enter-start"
x-transition:enter-end="fi-transition-enter-end"
@endif
class="fi-sidebar-item-label"
>
x-transition:enter-end="fi-transition-enter-end" @endif
class="fi-sidebar-item-label">
{{ $slot }}
</span>
@if (filled($badge))
<span
@if ($sidebarCollapsible && (! $subNavigation))
x-show="$store.sidebar.isOpen"
@if ($sidebarCollapsible && !$subNavigation) x-show="$store.sidebar.isOpen"
x-transition:enter="fi-transition-enter"
x-transition:enter-start="fi-transition-enter-start"
x-transition:enter-end="fi-transition-enter-end"
@endif
class="fi-sidebar-item-badge-ctn"
>
<x-filament::badge
:color="$badgeColor"
:tooltip="$badgeTooltip"
>
x-transition:enter-end="fi-transition-enter-end" @endif
class="fi-sidebar-item-badge-ctn">
<x-filament::badge :color="$badgeColor" :tooltip="$badgeTooltip">
{{ $badge }}
</x-filament::badge>
</span>
@@ -117,7 +95,7 @@
@foreach ($childItems as $childItem)
@php
$isChildItemChildItemsActive = $childItem->isChildItemsActive();
$isChildActive = (! $isChildItemChildItemsActive) && $childItem->isActive();
$isChildActive = !$isChildItemChildItemsActive && $childItem->isActive();
$childItemActiveIcon = $childItem->getActiveIcon();
$childItemBadge = $childItem->getBadge();
$childItemBadgeColor = $childItem->getBadgeColor($childItemBadge);
@@ -128,23 +106,9 @@
$childItemExtraAttributes = $childItem->getExtraAttributeBag();
@endphp
<x-filament-panels::sidebar.item
:active="$isChildActive"
:active-child-items="$isChildItemChildItemsActive"
:active-icon="$childItemActiveIcon"
:badge="$childItemBadge"
:badge-color="$childItemBadgeColor"
:badge-tooltip="$childItemBadgeTooltip"
:first="$loop->first"
grouped
:icon="$childItemIcon"
:last="$loop->last"
:should-open-url-in-new-tab="$shouldChildItemOpenUrlInNewTab"
sub-grouped
:sub-navigation="$subNavigation"
:url="$childItemUrl"
:attributes="\Filament\Support\prepare_inherited_attributes($childItemExtraAttributes)"
>
<x-filament-panels::sidebar.item :active="$isChildActive" :active-child-items="$isChildItemChildItemsActive" :active-icon="$childItemActiveIcon" :badge="$childItemBadge"
:badge-color="$childItemBadgeColor" :badge-tooltip="$childItemBadgeTooltip" :first="$loop->first" grouped :icon="$childItemIcon" :last="$loop->last"
:should-open-url-in-new-tab="$shouldChildItemOpenUrlInNewTab" sub-grouped :sub-navigation="$subNavigation" :url="$childItemUrl" :attributes="\Filament\Support\prepare_inherited_attributes($childItemExtraAttributes)">
{{ $childItem->getLabel() }}
</x-filament-panels::sidebar.item>
@endforeach
@@ -11,15 +11,19 @@
$items = $this->getTenantMenuItems();
$canSwitchTenants = filament()->hasTenantSwitcher() && filled($tenants = array_filter(
filament()->getUserTenants(filament()->auth()->user()),
fn (\Illuminate\Database\Eloquent\Model $tenant): bool => ! $tenant->is($currentTenant),
));
$canSwitchTenants =
filament()->hasTenantSwitcher() &&
filled(
$tenants = array_filter(
filament()->getUserTenants(filament()->auth()->user()),
fn(\Illuminate\Database\Eloquent\Model $tenant): bool => !$tenant->is($currentTenant),
),
);
$isSearchable = $canSwitchTenants && (filament()->isTenantMenuSearchable() ?? (count($tenants) >= 10));
$isSearchable = $canSwitchTenants && (filament()->isTenantMenuSearchable() ?? count($tenants) >= 10);
$itemsBeforeAndAfterTenantSwitcher = collect($items)
->groupBy(fn (Action $item): bool => $canSwitchTenants && ($item->getSort() < 0), preserveKeys: true)
->groupBy(fn(Action $item): bool => $canSwitchTenants && $item->getSort() < 0, preserveKeys: true)
->all();
$itemsBeforeTenantSwitcher = $itemsBeforeAndAfterTenantSwitcher[true] ?? collect();
$itemsAfterTenantSwitcher = $itemsBeforeAndAfterTenantSwitcher[false] ?? collect();
@@ -29,19 +33,10 @@
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::TENANT_MENU_BEFORE) }}
<x-filament::dropdown
placement="bottom-start"
size
:teleport="$teleport"
:attributes="
\Filament\Support\prepare_inherited_attributes($attributes)
->class(['fi-tenant-menu'])
"
>
<x-filament::dropdown placement="bottom-start" size :teleport="$teleport" :attributes="\Filament\Support\prepare_inherited_attributes($attributes)->class(['fi-tenant-menu'])">
<x-slot name="trigger">
<button
@if ($isSidebarCollapsibleOnDesktop)
x-data="{ tooltip: false }"
@if ($isSidebarCollapsibleOnDesktop) x-data="{ tooltip: false }"
x-effect="
tooltip = $store.sidebar.isOpen
? false
@@ -51,22 +46,12 @@
theme: $store.theme,
}
"
x-tooltip.html="tooltip"
@endif
type="button"
class="fi-tenant-menu-trigger"
>
<x-filament-panels::avatar.tenant
:tenant="$currentTenant"
loading="lazy"
/>
x-tooltip.html="tooltip" @endif
type="button" class="fi-tenant-menu-trigger">
<x-filament-panels::avatar.tenant :tenant="$currentTenant" loading="lazy" />
<span
@if ($isSidebarCollapsibleOnDesktop)
x-show="$store.sidebar.isOpen"
@endif
class="fi-tenant-menu-trigger-text"
>
<span @if ($isSidebarCollapsibleOnDesktop) x-show="$store.sidebar.isOpen" @endif
class="fi-tenant-menu-trigger-text">
@if ($currentTenant instanceof \Filament\Models\Contracts\HasCurrentTenantLabel)
<span class="fi-tenant-menu-trigger-current-tenant-label">
{{ $currentTenant->getCurrentTenantLabel() }}
@@ -78,11 +63,13 @@
</span>
</span>
{{
\Filament\Support\generate_icon_html(\Filament\Support\Icons\Heroicon::ChevronDown, alias: \Filament\View\PanelsIconAlias::TENANT_MENU_TOGGLE_BUTTON, attributes: new \Illuminate\View\ComponentAttributeBag([
{{ \Filament\Support\generate_icon_html(
\Filament\Support\Icons\Heroicon::ChevronDown,
alias: \Filament\View\PanelsIconAlias::TENANT_MENU_TOGGLE_BUTTON,
attributes: new \Illuminate\View\ComponentAttributeBag([
'x-show' => $isSidebarCollapsibleOnDesktop ? '$store.sidebar.isOpen' : null,
]))
}}
]),
) }}
</button>
</x-slot>
@@ -103,12 +90,9 @@
{{ __('filament-panels::layout.tenant_menu.search_field.label') }}
</label>
<x-filament::input
x-bind:id="$id('input')"
x-model="search"
<x-filament::input x-bind:id="$id('input')" x-model="search"
placeholder="{{ __('filament-panels::layout.tenant_menu.search_field.placeholder') }}"
type="search"
/>
type="search" />
</div>
@endif
@@ -125,13 +109,8 @@
@js($tenantName).replace(/ /g, '')
.toLowerCase()
.includes(search.replace(/ /g, '').toLowerCase())
"
>
<x-filament::dropdown.list.item
:href="$tenantUrl"
:image="$tenantImage"
tag="a"
>
">
<x-filament::dropdown.list.item :href="$tenantUrl" :image="$tenantImage" tag="a">
{{ $tenantName }}
</x-filament::dropdown.list.item>
</div>
@@ -1,28 +1,21 @@
@props([
'icon',
'theme',
])
@props(['icon', 'theme'])
@php
$label = __("filament-panels::layout.actions.theme_switcher.{$theme}.label");
@endphp
<button
aria-label="{{ $label }}"
type="button"
x-on:click="(theme = @js($theme)) && close()"
<button aria-label="{{ $label }}" type="button" x-on:click="(theme = @js($theme)) && close()"
x-tooltip="{
content: @js($label),
theme: $store.theme,
}"
x-bind:class="{ 'fi-active': theme === @js($theme) }"
class="fi-theme-switcher-btn"
>
{{
\Filament\Support\generate_icon_html($icon, alias: match ($theme) {
x-bind:class="{ 'fi-active': theme === @js($theme) }" class="fi-theme-switcher-btn">
{{ \Filament\Support\generate_icon_html(
$icon,
alias: match ($theme) {
'light' => \Filament\View\PanelsIconAlias::THEME_SWITCHER_LIGHT_BUTTON,
'dark' => \Filament\View\PanelsIconAlias::THEME_SWITCHER_DARK_BUTTON,
'system' => \Filament\View\PanelsIconAlias::THEME_SWITCHER_SYSTEM_BUTTON,
})
}}
},
) }}
</button>
@@ -1,26 +1,11 @@
<div
x-data="{ theme: null }"
x-init="
$watch('theme', () => {
$dispatch('theme-changed', theme)
})
<div x-data="{ theme: null }" x-init="$watch('theme', () => {
$dispatch('theme-changed', theme)
})
theme = localStorage.getItem('theme') || @js(filament()->getDefaultThemeMode()->value)
"
class="fi-theme-switcher"
>
<x-filament-panels::theme-switcher.button
:icon="\Filament\Support\Icons\Heroicon::Sun"
theme="light"
/>
theme = localStorage.getItem('theme') || @js(filament()->getDefaultThemeMode()->value)" class="fi-theme-switcher">
<x-filament-panels::theme-switcher.button :icon="\Filament\Support\Icons\Heroicon::Sun" theme="light" />
<x-filament-panels::theme-switcher.button
:icon="\Filament\Support\Icons\Heroicon::Moon"
theme="dark"
/>
<x-filament-panels::theme-switcher.button :icon="\Filament\Support\Icons\Heroicon::Moon" theme="dark" />
<x-filament-panels::theme-switcher.button
:icon="\Filament\Support\Icons\Heroicon::ComputerDesktop"
theme="system"
/>
<x-filament-panels::theme-switcher.button :icon="\Filament\Support\Icons\Heroicon::ComputerDesktop" theme="system" />
</div>
@@ -1,9 +1,2 @@
<x-filament::icon-button
:badge="$unreadNotificationsCount ?: null"
color="gray"
:icon="\Filament\Support\Icons\Heroicon::OutlinedBell"
:icon-alias="\Filament\View\PanelsIconAlias::TOPBAR_OPEN_DATABASE_NOTIFICATIONS_BUTTON"
icon-size="lg"
:label="__('filament-panels::layout.actions.open_database_notifications.label')"
class="fi-topbar-database-notifications-btn"
/>
<x-filament::icon-button :badge="$unreadNotificationsCount ?: null" color="gray" :icon="\Filament\Support\Icons\Heroicon::OutlinedBell" :icon-alias="\Filament\View\PanelsIconAlias::TOPBAR_OPEN_DATABASE_NOTIFICATIONS_BUTTON" icon-size="lg"
:label="__('filament-panels::layout.actions.open_database_notifications.label')" class="fi-topbar-database-notifications-btn" />
@@ -13,24 +13,14 @@
$tag = $url ? 'a' : 'button';
@endphp
<li
{{
$attributes->class([
'fi-topbar-item',
'fi-active' => $active,
])
}}
>
<li {{ $attributes->class(['fi-topbar-item', 'fi-active' => $active]) }}>
<{{ $tag }}
@if ($url)
{{ \Filament\Support\generate_href_html($url, $shouldOpenUrlInNewTab) }}
@if ($url) {{ \Filament\Support\generate_href_html($url, $shouldOpenUrlInNewTab) }}
@else
type="button"
@endif
class="fi-topbar-item-btn"
>
type="button" @endif
class="fi-topbar-item-btn">
@if ($icon || $activeIcon)
{{ \Filament\Support\generate_icon_html(($active && $activeIcon) ? $activeIcon : $icon, attributes: (new \Illuminate\View\ComponentAttributeBag)->class(['fi-topbar-item-icon'])) }}
{{ \Filament\Support\generate_icon_html($active && $activeIcon ? $activeIcon : $icon, attributes: new \Illuminate\View\ComponentAttributeBag()->class(['fi-topbar-item-icon'])) }}
@endif
<span class="fi-topbar-item-label">
@@ -38,17 +28,13 @@
</span>
@if (filled($badge))
<x-filament::badge
:color="$badgeColor"
size="sm"
:tooltip="$badgeTooltip"
>
<x-filament::badge :color="$badgeColor" size="sm" :tooltip="$badgeTooltip">
{{ $badge }}
</x-filament::badge>
@endif
@if (! $url)
{{ \Filament\Support\generate_icon_html(\Filament\Support\Icons\Heroicon::ChevronDown, alias: \Filament\View\PanelsIconAlias::TOPBAR_GROUP_TOGGLE_BUTTON, attributes: (new \Illuminate\View\ComponentAttributeBag)->class(['fi-topbar-group-toggle-icon'])) }}
@if (!$url)
{{ \Filament\Support\generate_icon_html(\Filament\Support\Icons\Heroicon::ChevronDown, alias: \Filament\View\PanelsIconAlias::TOPBAR_GROUP_TOGGLE_BUTTON, attributes: new \Illuminate\View\ComponentAttributeBag()->class(['fi-topbar-group-toggle-icon'])) }}
@endif
</{{ $tag }}>
</{{ $tag }}>
</li>
@@ -12,17 +12,21 @@
$items = $this->getUserMenuItems();
$itemsBeforeAndAfterThemeSwitcher = collect($items)
->groupBy(fn (Action $item): bool => $item->getSort() < 0, preserveKeys: true)
->groupBy(fn(Action $item): bool => $item->getSort() < 0, preserveKeys: true)
->all();
$itemsBeforeThemeSwitcher = $itemsBeforeAndAfterThemeSwitcher[true] ?? collect();
$itemsAfterThemeSwitcher = $itemsBeforeAndAfterThemeSwitcher[false] ?? collect();
$hasProfileHeader = $itemsBeforeThemeSwitcher->has('profile') &&
$hasProfileHeader =
$itemsBeforeThemeSwitcher->has('profile') &&
blank(($item = Arr::first($itemsBeforeThemeSwitcher))->getUrl()) &&
(! $item->hasAction());
!$item->hasAction();
if ($itemsBeforeThemeSwitcher->has('profile')) {
$itemsBeforeThemeSwitcher = $itemsBeforeThemeSwitcher->prepend($itemsBeforeThemeSwitcher->pull('profile'), 'profile');
$itemsBeforeThemeSwitcher = $itemsBeforeThemeSwitcher->prepend(
$itemsBeforeThemeSwitcher->pull('profile'),
'profile',
);
}
$position ??= filament()->getUserMenuPosition();
@@ -32,45 +36,30 @@
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::USER_MENU_BEFORE) }}
<x-filament::dropdown
:placement="($position === UserMenuPosition::Topbar) ? 'bottom-end' : 'top-end'"
:teleport="$position === UserMenuPosition::Topbar"
:attributes="
\Filament\Support\prepare_inherited_attributes($attributes)
->class(['fi-user-menu'])
"
>
<x-filament::dropdown :placement="$position === UserMenuPosition::Topbar ? 'bottom-end' : 'top-end'" :teleport="$position === UserMenuPosition::Topbar" :attributes="\Filament\Support\prepare_inherited_attributes($attributes)->class(['fi-user-menu'])">
<x-slot name="trigger">
@if ($position === UserMenuPosition::Topbar)
<button
aria-label="{{ __('filament-panels::layout.actions.open_user_menu.label') }}"
type="button"
class="fi-user-menu-trigger"
>
<button aria-label="{{ __('filament-panels::layout.actions.open_user_menu.label') }}" type="button"
class="fi-user-menu-trigger">
<x-filament-panels::avatar.user :user="$user" loading="lazy" />
</button>
@else
<button
aria-label="{{ __('filament-panels::layout.actions.open_user_menu.label') }}"
type="button"
class="fi-user-menu-trigger"
>
<button aria-label="{{ __('filament-panels::layout.actions.open_user_menu.label') }}" type="button"
class="fi-user-menu-trigger">
<x-filament-panels::avatar.user :user="$user" loading="lazy" />
<span
@if ($isSidebarCollapsibleOnDesktop)
x-show="$store.sidebar.isOpen"
@endif
class="fi-user-menu-trigger-text"
>
<span @if ($isSidebarCollapsibleOnDesktop) x-show="$store.sidebar.isOpen" @endif
class="fi-user-menu-trigger-text">
{{ filament()->getUserName($user) }}
</span>
{{
\Filament\Support\generate_icon_html(\Filament\Support\Icons\Heroicon::ChevronUp, alias: \Filament\View\PanelsIconAlias::USER_MENU_TOGGLE_BUTTON, attributes: new \Illuminate\View\ComponentAttributeBag([
{{ \Filament\Support\generate_icon_html(
\Filament\Support\Icons\Heroicon::ChevronUp,
alias: \Filament\View\PanelsIconAlias::USER_MENU_TOGGLE_BUTTON,
attributes: new \Illuminate\View\ComponentAttributeBag([
'x-show' => $isSidebarCollapsibleOnDesktop ? '$store.sidebar.isOpen' : null,
]))
}}
]),
) }}
</button>
@endif
</x-slot>
@@ -109,7 +98,7 @@
</x-filament::dropdown.list>
@endif
@if (filament()->hasDarkMode() && (! filament()->hasDarkModeForced()))
@if (filament()->hasDarkMode() && !filament()->hasDarkModeForced())
<x-filament::dropdown.list>
<x-filament-panels::theme-switcher />
</x-filament::dropdown.list>