Neuer Seitenrahmen (0.50.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 6m55s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 7m3s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m20s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m44s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 10m13s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 10m12s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 9m13s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 9m0s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 43s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m5s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 6m55s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 7m3s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m20s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m44s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 10m13s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 10m12s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 9m13s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 9m0s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 43s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m5s
Bleibendes Inertia-Layout (PortalFrame) mit festem Seitenkopf-Bereich; PageHeader teleportiert dorthin, AppLayout meldet Titel und Seitenvorlage (default/medium/narrow/app). Seiten ohne Kopf bekommen einen vom Rahmen. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d1d2b33760
commit
e191fb03b0
349 changed files with 1751 additions and 1623 deletions
|
|
@ -1,8 +1,9 @@
|
|||
<script setup>
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { computed } from 'vue';
|
||||
import { Link, usePage } from '@inertiajs/vue3';
|
||||
import { ChevronRight } from '@lucide/vue';
|
||||
import AppIcon from '@/components/AppIcon.vue';
|
||||
import { registerHeader, useFrame } from '@/lib/frame';
|
||||
|
||||
/**
|
||||
* Einheitlicher Seitenkopf: Pfad, Titel, Unterzeile und Aktionen rechts.
|
||||
|
|
@ -15,24 +16,21 @@ const props = defineProps({
|
|||
breadcrumbs: { type: Array, default: () => [] }, // [{ label, href }]
|
||||
/** Symbol des Bereichs (Lucide-Name); leer = Symbol des passenden Menüpunkts */
|
||||
icon: { type: String, default: null },
|
||||
/** intern: vom Rahmen selbst gezeigter Kopf (Seite ohne eigenen) */
|
||||
auto: { type: Boolean, default: false },
|
||||
});
|
||||
|
||||
const page = usePage();
|
||||
const variant = computed(() => page.props.branding?.page_header ?? 'band');
|
||||
|
||||
// Das Band läuft über die volle Breite – nur, wenn der Kopf auch die volle Inhaltsbreite hat
|
||||
// (nicht z. B. in einer Spalte neben einer Seitenleiste). Sonst schlichte Form mit Trennlinie.
|
||||
const el = ref(null);
|
||||
const fullWidth = ref(true);
|
||||
onMounted(() => {
|
||||
const parent = el.value?.parentElement;
|
||||
const main = el.value?.closest('main');
|
||||
if (!parent || !main) return;
|
||||
const inner = main.clientWidth - parseFloat(getComputedStyle(main).paddingLeft) - parseFloat(getComputedStyle(main).paddingRight);
|
||||
fullWidth.value = parent.getBoundingClientRect().width >= inner - 2;
|
||||
});
|
||||
const isBand = computed(() => (variant.value === 'band' || variant.value === 'band_icon') && fullWidth.value);
|
||||
const inset = computed(() => (variant.value === 'band' || variant.value === 'band_icon') && !fullWidth.value);
|
||||
// Im Portalrahmen erscheint der Kopf in dessen festem Bereich unter dem Menü – immer über die volle
|
||||
// Breite, ausgerichtet an der Breite der Seitenvorlage. Außerhalb des Rahmens steht er an Ort und Stelle.
|
||||
const frame = useFrame();
|
||||
const inFrame = !!frame && !props.auto;
|
||||
if (inFrame) registerHeader(frame);
|
||||
const maxWidth = computed(() => frame?.maxWidth ?? 'max-w-[1440px]');
|
||||
|
||||
const isBand = computed(() => variant.value === 'band' || variant.value === 'band_icon');
|
||||
const withIcon = computed(() => variant.value === 'band_icon' || variant.value === 'icon');
|
||||
|
||||
// Passender Menüpunkt – aktiv markiert oder, sonst, der längste, mit dem die Adresse beginnt
|
||||
|
|
@ -67,21 +65,15 @@ const showEyebrow = computed(() => variant.value === 'bold' && !props.breadcrumb
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<header
|
||||
ref="el"
|
||||
:class="{
|
||||
'mb-6 border-b pb-4': inset,
|
||||
'relative mb-6 border-b bg-card first:-mt-6 lg:first:-mt-7': isBand,
|
||||
'mb-6 border-b pb-5': variant === 'icon',
|
||||
'mb-7': variant === 'bold',
|
||||
}"
|
||||
:style="isBand ? { width: '100vw', marginLeft: 'calc(50% - 50vw)' } : null"
|
||||
>
|
||||
<Teleport to="#ih-page-header" defer :disabled="!inFrame">
|
||||
<header :class="[isBand ? 'border-b bg-card' : '', inFrame || auto ? '' : 'mb-6']">
|
||||
<div
|
||||
class="flex flex-wrap justify-between gap-y-3"
|
||||
class="mx-auto flex flex-wrap justify-between gap-y-3"
|
||||
:class="[
|
||||
isBand ? 'mx-auto max-w-[1440px] items-center gap-x-8 px-4 py-4 lg:px-6' : 'gap-x-6',
|
||||
variant === 'icon' ? 'items-center' : '',
|
||||
inFrame || auto ? `${maxWidth} px-4 lg:px-6` : '',
|
||||
isBand ? 'items-center gap-x-8 py-4' : 'gap-x-6',
|
||||
!isBand && (inFrame || auto) ? 'pt-6 lg:pt-7' : '',
|
||||
variant === 'icon' ? 'items-center border-b pb-5' : '',
|
||||
variant === 'bold' ? 'items-end' : '',
|
||||
]"
|
||||
>
|
||||
|
|
@ -107,7 +99,7 @@ const showEyebrow = computed(() => variant.value === 'bold' && !props.breadcrumb
|
|||
<h1
|
||||
class="leading-tight tracking-tight"
|
||||
:class="{
|
||||
'text-2xl font-semibold': isBand || inset,
|
||||
'text-2xl font-semibold': isBand,
|
||||
'text-[26px] font-semibold': variant === 'icon',
|
||||
'text-3xl font-bold': variant === 'bold',
|
||||
}"
|
||||
|
|
@ -129,4 +121,5 @@ const showEyebrow = computed(() => variant.value === 'bold' && !props.breadcrumb
|
|||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue