install
This commit is contained in:
158
resources/views/vendor/filament-panels/components/layout/base.blade.php
vendored
Normal file
158
resources/views/vendor/filament-panels/components/layout/base.blade.php
vendored
Normal file
@@ -0,0 +1,158 @@
|
||||
@props([
|
||||
'livewire' => null,
|
||||
])
|
||||
|
||||
@php
|
||||
$renderHookScopes = $livewire?->getRenderHookScopes();
|
||||
@endphp
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
lang="{{ str_replace('_', '-', app()->getLocale()) }}"
|
||||
dir="{{ __('filament-panels::layout.direction') ?? 'ltr' }}"
|
||||
@class([
|
||||
'fi',
|
||||
'dark' => filament()->hasDarkModeForced(),
|
||||
])
|
||||
>
|
||||
<head>
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::HEAD_START, scopes: $renderHookScopes) }}
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
@if ($favicon = filament()->getFavicon())
|
||||
<link rel="icon" href="{{ $favicon }}" />
|
||||
@endif
|
||||
|
||||
@php
|
||||
$title = trim(strip_tags($livewire?->getTitle() ?? ''));
|
||||
$brandName = trim(strip_tags(filament()->getBrandName()));
|
||||
@endphp
|
||||
|
||||
<title>
|
||||
{{ filled($title) ? "{$title} - " : null }} {{ $brandName }}
|
||||
</title>
|
||||
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::STYLES_BEFORE, scopes: $renderHookScopes) }}
|
||||
|
||||
<style>
|
||||
[x-cloak=''],
|
||||
[x-cloak='x-cloak'],
|
||||
[x-cloak='1'] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
[x-cloak='inline-flex'] {
|
||||
display: inline-flex !important;
|
||||
}
|
||||
|
||||
@media (max-width: 1023px) {
|
||||
[x-cloak='-lg'] {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
[x-cloak='lg'] {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@filamentStyles
|
||||
|
||||
{{ filament()->getTheme()->getHtml() }}
|
||||
{{ filament()->getFontHtml() }}
|
||||
{{ filament()->getMonoFontHtml() }}
|
||||
{{ filament()->getSerifFontHtml() }}
|
||||
|
||||
<style>
|
||||
:root {
|
||||
--font-family: '{!! filament()->getFontFamily() !!}';
|
||||
--mono-font-family: '{!! filament()->getMonoFontFamily() !!}';
|
||||
--serif-font-family: '{!! filament()->getSerifFontFamily() !!}';
|
||||
--sidebar-width: {{ filament()->getSidebarWidth() }};
|
||||
--collapsed-sidebar-width: {{ filament()->getCollapsedSidebarWidth() }};
|
||||
--default-theme-mode: {{ filament()->getDefaultThemeMode()->value }};
|
||||
}
|
||||
</style>
|
||||
|
||||
@stack('styles')
|
||||
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::STYLES_AFTER, scopes: $renderHookScopes) }}
|
||||
|
||||
@if (! filament()->hasDarkMode())
|
||||
<script>
|
||||
localStorage.setItem('theme', 'light')
|
||||
</script>
|
||||
@elseif (filament()->hasDarkModeForced())
|
||||
<script>
|
||||
localStorage.setItem('theme', 'dark')
|
||||
</script>
|
||||
@else
|
||||
<script>
|
||||
const loadDarkMode = () => {
|
||||
window.theme = localStorage.getItem('theme') ?? @js(filament()->getDefaultThemeMode()->value)
|
||||
|
||||
if (
|
||||
window.theme === 'dark' ||
|
||||
(window.theme === 'system' &&
|
||||
window.matchMedia('(prefers-color-scheme: dark)')
|
||||
.matches)
|
||||
) {
|
||||
document.documentElement.classList.add('dark')
|
||||
}
|
||||
}
|
||||
|
||||
loadDarkMode()
|
||||
|
||||
document.addEventListener('livewire:navigated', loadDarkMode)
|
||||
</script>
|
||||
@endif
|
||||
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::HEAD_END, scopes: $renderHookScopes) }}
|
||||
</head>
|
||||
|
||||
<body
|
||||
{{
|
||||
$attributes
|
||||
->merge($livewire?->getExtraBodyAttributes() ?? [], escape: false)
|
||||
->class([
|
||||
'fi-body',
|
||||
'fi-panel-' . filament()->getId(),
|
||||
])
|
||||
}}
|
||||
>
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::BODY_START, scopes: $renderHookScopes) }}
|
||||
|
||||
{{ $slot }}
|
||||
|
||||
@livewire(Filament\Livewire\Notifications::class)
|
||||
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::SCRIPTS_BEFORE, scopes: $renderHookScopes) }}
|
||||
|
||||
@filamentScripts(withCore: true)
|
||||
|
||||
@if (filament()->hasBroadcasting() && config('filament.broadcasting.echo'))
|
||||
<script data-navigate-once>
|
||||
window.Echo = new window.EchoFactory(@js(config('filament.broadcasting.echo')))
|
||||
|
||||
window.dispatchEvent(new CustomEvent('EchoLoaded'))
|
||||
</script>
|
||||
@endif
|
||||
|
||||
@if (filament()->hasDarkMode() && (! filament()->hasDarkModeForced()))
|
||||
<script>
|
||||
loadDarkMode()
|
||||
</script>
|
||||
@endif
|
||||
|
||||
@stack('scripts')
|
||||
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::SCRIPTS_AFTER, scopes: $renderHookScopes) }}
|
||||
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::BODY_END, scopes: $renderHookScopes) }}
|
||||
</body>
|
||||
</html>
|
||||
119
resources/views/vendor/filament-panels/components/layout/index.blade.php
vendored
Normal file
119
resources/views/vendor/filament-panels/components/layout/index.blade.php
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
@php
|
||||
use Filament\Support\Enums\Width;
|
||||
|
||||
$livewire ??= null;
|
||||
|
||||
$hasTopbar = filament()->hasTopbar();
|
||||
$isSidebarCollapsibleOnDesktop = filament()->isSidebarCollapsibleOnDesktop();
|
||||
$isSidebarFullyCollapsibleOnDesktop = filament()->isSidebarFullyCollapsibleOnDesktop();
|
||||
$hasTopNavigation = filament()->hasTopNavigation();
|
||||
$hasNavigation = filament()->hasNavigation();
|
||||
$renderHookScopes = $livewire?->getRenderHookScopes();
|
||||
$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,
|
||||
])
|
||||
>
|
||||
@if ($hasTopbar)
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::TOPBAR_BEFORE, scopes: $renderHookScopes) }}
|
||||
|
||||
@livewire(filament()->getTopbarLivewireComponent())
|
||||
|
||||
{{ \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
|
||||
@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"
|
||||
/>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="fi-layout">
|
||||
{{ \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>
|
||||
|
||||
@livewire(filament()->getSidebarLivewireComponent())
|
||||
@endif
|
||||
|
||||
<div
|
||||
@if ($isSidebarCollapsibleOnDesktop)
|
||||
x-data="{}"
|
||||
x-bind:class="{
|
||||
'fi-main-ctn-sidebar-open': $store.sidebar.isOpen,
|
||||
}"
|
||||
x-bind:style="'display: flex; opacity:1;'"
|
||||
{{-- Mimics `x-cloak`, as using `x-cloak` causes visual issues with chart widgets --}}
|
||||
@elseif ($isSidebarFullyCollapsibleOnDesktop)
|
||||
x-data="{}"
|
||||
x-bind:class="{
|
||||
'fi-main-ctn-sidebar-open': $store.sidebar.isOpen,
|
||||
}"
|
||||
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)))
|
||||
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"
|
||||
>
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::CONTENT_BEFORE, scopes: $renderHookScopes) }}
|
||||
|
||||
<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 }}
|
||||
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::CONTENT_END, scopes: $renderHookScopes) }}
|
||||
</main>
|
||||
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::CONTENT_AFTER, scopes: $renderHookScopes) }}
|
||||
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::FOOTER, scopes: $renderHookScopes) }}
|
||||
</div>
|
||||
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::LAYOUT_END, scopes: $renderHookScopes) }}
|
||||
</div>
|
||||
</x-filament-panels::layout.base>
|
||||
54
resources/views/vendor/filament-panels/components/layout/simple.blade.php
vendored
Normal file
54
resources/views/vendor/filament-panels/components/layout/simple.blade.php
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
@php
|
||||
use Filament\Support\Enums\Width;
|
||||
|
||||
$livewire ??= null;
|
||||
|
||||
$renderHookScopes = $livewire?->getRenderHookScopes();
|
||||
$maxContentWidth ??= (filament()->getSimplePageMaxContentWidth() ?? Width::Large);
|
||||
|
||||
if (is_string($maxContentWidth)) {
|
||||
$maxContentWidth = Width::tryFrom($maxContentWidth) ?? $maxContentWidth;
|
||||
}
|
||||
@endphp
|
||||
|
||||
<x-filament-panels::layout.base :livewire="$livewire">
|
||||
@props([
|
||||
'after' => null,
|
||||
'heading' => null,
|
||||
'subheading' => null,
|
||||
])
|
||||
|
||||
<div class="fi-simple-layout">
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::SIMPLE_LAYOUT_START, scopes: $renderHookScopes) }}
|
||||
|
||||
@if (($hasTopbar ?? true) && filament()->auth()->check())
|
||||
<div class="fi-simple-layout-header">
|
||||
@if (filament()->hasDatabaseNotifications())
|
||||
@livewire(Filament\Livewire\DatabaseNotifications::class, [
|
||||
'lazy' => filament()->hasLazyLoadedDatabaseNotifications(),
|
||||
'position' => \Filament\Enums\DatabaseNotificationsPosition::Topbar,
|
||||
])
|
||||
@endif
|
||||
|
||||
@if (filament()->hasUserMenu())
|
||||
@livewire(Filament\Livewire\SimpleUserMenu::class)
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="fi-simple-main-ctn">
|
||||
<main
|
||||
@class([
|
||||
'fi-simple-main',
|
||||
($maxContentWidth instanceof Width) ? "fi-width-{$maxContentWidth->value}" : $maxContentWidth,
|
||||
])
|
||||
>
|
||||
{{ $slot }}
|
||||
</main>
|
||||
</div>
|
||||
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::FOOTER, scopes: $renderHookScopes) }}
|
||||
|
||||
{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::SIMPLE_LAYOUT_END, scopes: $renderHookScopes) }}
|
||||
</div>
|
||||
</x-filament-panels::layout.base>
|
||||
Reference in New Issue
Block a user