Menü-Editor, farbige Initialen, Seitenköpfe, Favoriten, Vorschaubilder
All checks were successful
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m55s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m44s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m25s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m39s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 3m47s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 3m51s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 3m16s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 3m25s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m10s
All checks were successful
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m55s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m44s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m25s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m39s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 3m47s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 3m51s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 3m16s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 3m25s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m10s
- Admin → Portal → Menü: Bereiche, Seiten (mit Unterseiten), Links und Gruppen mit Unterpunkten, sortierbar, je Rolle einschränkbar; Kopfzeile misst den Platz und legt Überzähliges unter „Mehr“ - Initialen in fester Farbe je Person, Abteilungsfarben im Organigramm - PageHeader für alle Übersichtsseiten - Dokumente: Favoriten (auch als Startseiten-Kachel), „Häufig genutzt“, Vorschaubilder (Bilder, erste PDF-Seite per pdf.js im Browser) - Platzhalter beim Nachladen Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
114811e6c5
commit
dda250aaad
140 changed files with 1993 additions and 427 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
||||
import { Head, Link, router, usePage } from '@inertiajs/vue3';
|
||||
import { ChevronDown, LogOut, Menu, Monitor, Moon, Search, Settings, Sun, UserRound, UserRoundPen } from '@lucide/vue';
|
||||
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from '@/components/ui/sheet';
|
||||
|
|
@ -17,6 +17,7 @@ import { Toaster } from '@/components/ui/sonner';
|
|||
import BrandLogo from '@/components/BrandLogo.vue';
|
||||
import NotificationBell from '@/components/NotificationBell.vue';
|
||||
import PersonAvatar from '@/components/PersonAvatar.vue';
|
||||
import NavLink from '@/components/nav/NavLink.vue';
|
||||
import { useThemePreference } from '@/composables/useThemePreference';
|
||||
|
||||
defineProps({
|
||||
|
|
@ -28,6 +29,52 @@ const user = computed(() => page.props.auth.user);
|
|||
const branding = computed(() => page.props.branding);
|
||||
const headerStyle = computed(() => branding.value.header_style ?? 'light');
|
||||
const navigation = computed(() => page.props.navigation);
|
||||
|
||||
// Was nicht in die Kopfzeile passt, kommt unter „Mehr“. Gemessen wird an einer
|
||||
// unsichtbaren Kopie der Menüpunkte – so passt es bei jeder Breite und Beschriftung.
|
||||
const navBox = ref(null);
|
||||
const navMeasure = ref(null);
|
||||
const navFit = ref(navigation.value.length);
|
||||
const MORE_WIDTH = 84;
|
||||
|
||||
function measureNav() {
|
||||
const box = navBox.value;
|
||||
const items = navMeasure.value ? [...navMeasure.value.children] : [];
|
||||
if (!box || !items.length) return;
|
||||
|
||||
const widths = items.map((el) => el.getBoundingClientRect().width + 4);
|
||||
const available = box.clientWidth;
|
||||
|
||||
if (widths.reduce((sum, w) => sum + w, 0) <= available) {
|
||||
navFit.value = widths.length;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
let used = MORE_WIDTH;
|
||||
let fit = 0;
|
||||
|
||||
for (const width of widths) {
|
||||
if (used + width > available) break;
|
||||
used += width;
|
||||
fit++;
|
||||
}
|
||||
|
||||
navFit.value = Math.max(1, fit);
|
||||
}
|
||||
|
||||
let navObserver;
|
||||
onMounted(() => {
|
||||
navObserver = new ResizeObserver(measureNav);
|
||||
if (navBox.value) navObserver.observe(navBox.value);
|
||||
nextTick(measureNav);
|
||||
document.fonts?.ready.then(measureNav);
|
||||
});
|
||||
onBeforeUnmount(() => navObserver?.disconnect());
|
||||
watch(navigation, () => nextTick(measureNav));
|
||||
|
||||
const navVisible = computed(() => navigation.value.slice(0, navFit.value));
|
||||
const navMore = computed(() => navigation.value.slice(navFit.value));
|
||||
const { preference, setPreference } = useThemePreference();
|
||||
|
||||
const mobileNavOpen = ref(false);
|
||||
|
|
@ -67,17 +114,31 @@ const themeOptions = [
|
|||
<SheetHeader class="border-b px-5 py-4">
|
||||
<SheetTitle class="text-left"><BrandLogo /></SheetTitle>
|
||||
</SheetHeader>
|
||||
<nav class="grid gap-1 p-3" aria-label="Hauptnavigation">
|
||||
<Link
|
||||
v-for="item in navigation"
|
||||
:key="item.href"
|
||||
:href="item.href"
|
||||
class="rounded-md px-3 py-2.5 text-[15px] font-medium"
|
||||
:class="item.active ? 'bg-brand-soft text-brand-soft-foreground' : 'text-foreground/80 hover:bg-accent'"
|
||||
@click="mobileNavOpen = false"
|
||||
>
|
||||
{{ item.label }}
|
||||
</Link>
|
||||
<nav class="grid gap-1 overflow-y-auto p-3" aria-label="Hauptnavigation">
|
||||
<template v-for="item in navigation" :key="item.key">
|
||||
<NavLink
|
||||
v-if="item.href"
|
||||
:item="item"
|
||||
class="rounded-md px-3 py-2.5 text-[15px] font-medium"
|
||||
:class="item.active && !item.children.some((c) => c.active) ? 'bg-brand-soft text-brand-soft-foreground' : 'text-foreground/80 hover:bg-accent'"
|
||||
@click="mobileNavOpen = false"
|
||||
>
|
||||
{{ item.label }}
|
||||
</NavLink>
|
||||
<p v-else class="px-3 pt-3 pb-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase">{{ item.label }}</p>
|
||||
<div v-if="item.children.length" class="mb-1 ml-3 grid gap-0.5 border-l pl-2">
|
||||
<NavLink
|
||||
v-for="child in item.children"
|
||||
:key="child.key"
|
||||
:item="child"
|
||||
class="rounded-md px-3 py-2 text-sm"
|
||||
:class="child.active ? 'bg-brand-soft font-medium text-brand-soft-foreground' : 'text-foreground/75 hover:bg-accent'"
|
||||
@click="mobileNavOpen = false"
|
||||
>
|
||||
{{ child.label }}
|
||||
</NavLink>
|
||||
</div>
|
||||
</template>
|
||||
</nav>
|
||||
</SheetContent>
|
||||
</Sheet>
|
||||
|
|
@ -86,23 +147,76 @@ const themeOptions = [
|
|||
<BrandLogo :inverted="headerStyle !== 'light'" compact />
|
||||
</Link>
|
||||
|
||||
<nav class="hidden h-full lg:block" aria-label="Hauptnavigation">
|
||||
<nav ref="navBox" class="relative hidden h-full min-w-0 flex-1 lg:block" aria-label="Hauptnavigation">
|
||||
<!-- Unsichtbare Kopie zum Messen der Breiten -->
|
||||
<ul ref="navMeasure" class="pointer-events-none invisible absolute flex gap-1" aria-hidden="true">
|
||||
<li v-for="item in navigation" :key="item.key" class="flex items-center gap-1 px-3 text-sm font-medium whitespace-nowrap">
|
||||
{{ item.label }}<ChevronDown v-if="item.children.length" class="size-4" />
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="flex h-full items-stretch gap-1">
|
||||
<li v-for="item in navigation" :key="item.href" class="flex">
|
||||
<Link
|
||||
:href="item.href"
|
||||
<li v-for="item in navVisible" :key="item.key" class="flex">
|
||||
<DropdownMenu v-if="item.children.length">
|
||||
<DropdownMenuTrigger
|
||||
class="relative flex items-center gap-1 px-3 text-sm font-medium whitespace-nowrap transition-colors outline-none"
|
||||
:class="item.active ? 'text-foreground' : 'text-foreground/70 hover:text-foreground'"
|
||||
>
|
||||
{{ item.label }} <ChevronDown class="size-4 opacity-70" />
|
||||
<span v-if="item.active" class="nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand" />
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="start" class="min-w-56">
|
||||
<template v-if="item.href">
|
||||
<DropdownMenuItem as-child>
|
||||
<NavLink :item="item" :class="item.active && !item.children.some((c) => c.active) ? 'font-semibold text-brand-text' : 'font-medium'">{{ item.label }} – Übersicht</NavLink>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuSeparator />
|
||||
</template>
|
||||
<DropdownMenuItem v-for="child in item.children" :key="child.key" as-child>
|
||||
<NavLink :item="child" :class="child.active ? 'font-semibold text-brand-text' : ''">{{ child.label }}</NavLink>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
<NavLink
|
||||
v-else
|
||||
:item="item"
|
||||
class="relative flex items-center px-3 text-sm font-medium whitespace-nowrap transition-colors"
|
||||
:class="item.active ? 'text-foreground' : 'text-foreground/70 hover:text-foreground'"
|
||||
:aria-current="item.active ? 'page' : undefined"
|
||||
>
|
||||
{{ item.label }}
|
||||
<span v-if="item.active" class="nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand" />
|
||||
</Link>
|
||||
</NavLink>
|
||||
</li>
|
||||
<li v-if="navMore.length" class="flex">
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger
|
||||
class="relative flex items-center gap-1 px-3 text-sm font-medium whitespace-nowrap transition-colors outline-none"
|
||||
:class="navMore.some((i) => i.active) ? 'text-foreground' : 'text-foreground/70 hover:text-foreground'"
|
||||
>
|
||||
Mehr <ChevronDown class="size-4" />
|
||||
<span v-if="navMore.some((i) => i.active)" class="nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand" />
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="start" class="min-w-48">
|
||||
<template v-for="(item, index) in navMore" :key="item.key">
|
||||
<template v-if="item.children.length">
|
||||
<DropdownMenuSeparator v-if="index" />
|
||||
<DropdownMenuLabel class="text-xs text-muted-foreground">{{ item.label }}</DropdownMenuLabel>
|
||||
<DropdownMenuItem v-if="item.href" as-child><NavLink :item="item">Übersicht</NavLink></DropdownMenuItem>
|
||||
<DropdownMenuItem v-for="child in item.children" :key="child.key" as-child>
|
||||
<NavLink :item="child" :class="child.active ? 'font-semibold text-brand-text' : ''">{{ child.label }}</NavLink>
|
||||
</DropdownMenuItem>
|
||||
</template>
|
||||
<DropdownMenuItem v-else as-child>
|
||||
<NavLink :item="item" :class="item.active ? 'font-semibold text-brand-text' : ''">{{ item.label }}</NavLink>
|
||||
</DropdownMenuItem>
|
||||
</template>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="ml-auto flex items-center gap-1">
|
||||
<div class="ml-auto flex shrink-0 items-center gap-1">
|
||||
<form class="mr-2 hidden w-64 md:block xl:w-80" role="search" @submit.prevent="submitSearch">
|
||||
<label class="relative block">
|
||||
<span class="sr-only">Personen suchen</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue