Symbole: alle Lucide-Symbole lokal verfügbar
All checks were successful
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m35s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m37s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m41s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m52s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 3m56s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 4m2s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 4m21s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 4m5s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m10s
All checks were successful
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m35s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m37s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m41s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m52s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 3m56s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 4m2s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 4m21s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 4m5s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m10s
- Vollständiger Satz (1.854 Symbole + Aliase älterer Namen) in resources/icons/svg.php (Admin) und resources/js/lib/icon-set.js (Portal, wird nur bei Bedarf geladen) - Kuratierte 66 mit deutscher Bezeichnung bleiben im Hauptpaket und stehen in Auswahlfeldern vorne; die Suche findet alle - AppIcon-Komponente für Menü, Schnellzugriffe und Pagebuilder; Symbolfeld im Pagebuilder mit Suche Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
23c36d28b5
commit
c71131d054
151 changed files with 4621 additions and 512 deletions
37
resources/js/components/AppIcon.vue
Normal file
37
resources/js/components/AppIcon.vue
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<script setup>
|
||||
import { computed, watchEffect } from 'vue';
|
||||
import { icons } from '@/lib/icons';
|
||||
import { iconMarkup, loadIconSet } from '@/lib/iconSet';
|
||||
|
||||
/**
|
||||
* Ein Symbol nach Namen. Kuratierte Symbole sind sofort da, alle anderen kommen
|
||||
* aus dem nachgeladenen Symbolsatz – der Platz bleibt so lange reserviert.
|
||||
*/
|
||||
const props = defineProps({
|
||||
name: { type: String, default: null },
|
||||
strokeWidth: { type: [Number, String], default: 2 },
|
||||
});
|
||||
|
||||
const component = computed(() => (props.name ? icons[props.name] : null));
|
||||
const markup = computed(() => (component.value ? null : iconMarkup(props.name)));
|
||||
|
||||
watchEffect(() => {
|
||||
if (props.name && !component.value) loadIconSet();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component :is="component" v-if="component" :stroke-width="strokeWidth" aria-hidden="true" />
|
||||
<svg
|
||||
v-else-if="name"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
:stroke-width="strokeWidth"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
aria-hidden="true"
|
||||
v-html="markup ?? ''"
|
||||
/>
|
||||
</template>
|
||||
|
|
@ -3,7 +3,7 @@ import { onMounted, ref } from 'vue';
|
|||
import { Link } from '@inertiajs/vue3';
|
||||
import { useEventListener, useResizeObserver } from '@vueuse/core';
|
||||
import { ChevronLeft, ChevronRight } from '@lucide/vue';
|
||||
import { icons } from '@/lib/icons';
|
||||
import AppIcon from '@/components/AppIcon.vue';
|
||||
|
||||
defineProps({
|
||||
links: { type: Array, required: true },
|
||||
|
|
@ -66,7 +66,7 @@ useEventListener(track, 'scroll', update, { passive: true });
|
|||
:rel="link.new_tab ? 'noopener' : undefined"
|
||||
class="flex w-[116px] shrink-0 snap-start flex-col items-center gap-2.5 rounded-md bg-muted px-2 py-4 text-center transition-colors hover:bg-brand-soft"
|
||||
>
|
||||
<component :is="icons[link.icon] ?? icons.link" class="size-6 text-brand-text" :stroke-width="1.6" />
|
||||
<AppIcon :name="link.icon || 'link'" class="size-6 text-brand-text" :stroke-width="1.6" />
|
||||
<span class="text-xs leading-tight font-medium">{{ link.label }}</span>
|
||||
</component>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ 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 { icons } from '@/lib/icons';
|
||||
import AppIcon from '@/components/AppIcon.vue';
|
||||
import { useThemePreference } from '@/composables/useThemePreference';
|
||||
|
||||
defineProps({
|
||||
|
|
@ -124,7 +124,7 @@ const themeOptions = [
|
|||
: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"
|
||||
>
|
||||
<component :is="icons[item.icon]" v-if="icons[item.icon]" class="size-[18px] opacity-80" />{{ item.label }}
|
||||
<AppIcon v-if="item.icon" :name="item.icon" class="size-[18px] opacity-80" />{{ 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">
|
||||
|
|
@ -136,7 +136,7 @@ const themeOptions = [
|
|||
:class="child.active ? 'bg-brand-soft font-medium text-brand-soft-foreground' : 'text-foreground/75 hover:bg-accent'"
|
||||
@click="mobileNavOpen = false"
|
||||
>
|
||||
<component :is="icons[child.icon]" v-if="icons[child.icon]" class="size-4 opacity-70" />{{ child.label }}
|
||||
<AppIcon v-if="child.icon" :name="child.icon" class="size-4 opacity-70" />{{ child.label }}
|
||||
</NavLink>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -152,7 +152,7 @@ const themeOptions = [
|
|||
<!-- 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.5 px-3 text-sm font-medium whitespace-nowrap">
|
||||
<component :is="icons[item.icon]" v-if="icons[item.icon]" class="size-4" />{{ item.label }}<ChevronDown v-if="item.children.length" class="size-4" />
|
||||
<AppIcon v-if="item.icon" :name="item.icon" class="size-4" />{{ item.label }}<ChevronDown v-if="item.children.length" class="size-4" />
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="flex h-full items-stretch gap-1">
|
||||
|
|
@ -162,7 +162,7 @@ const themeOptions = [
|
|||
class="relative flex items-center gap-1.5 px-3 text-sm font-medium whitespace-nowrap transition-colors outline-none"
|
||||
:class="item.active ? 'text-foreground' : 'text-foreground/70 hover:text-foreground'"
|
||||
>
|
||||
<component :is="icons[item.icon]" v-if="icons[item.icon]" class="size-4 opacity-80" />{{ item.label }} <ChevronDown class="size-4 opacity-70" />
|
||||
<AppIcon v-if="item.icon" :name="item.icon" class="size-4 opacity-80" />{{ 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">
|
||||
|
|
@ -174,7 +174,7 @@ const themeOptions = [
|
|||
</template>
|
||||
<DropdownMenuItem v-for="child in item.children" :key="child.key" as-child>
|
||||
<NavLink :item="child" :class="child.active ? 'font-semibold text-brand-text' : ''">
|
||||
<component :is="icons[child.icon]" v-if="icons[child.icon]" class="size-4 text-muted-foreground" />{{ child.label }}
|
||||
<AppIcon v-if="child.icon" :name="child.icon" class="size-4 text-muted-foreground" />{{ child.label }}
|
||||
</NavLink>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
|
|
@ -186,7 +186,7 @@ const themeOptions = [
|
|||
:class="item.active ? 'text-foreground' : 'text-foreground/70 hover:text-foreground'"
|
||||
:aria-current="item.active ? 'page' : undefined"
|
||||
>
|
||||
<component :is="icons[item.icon]" v-if="icons[item.icon]" class="size-4 opacity-80" />{{ item.label }}
|
||||
<AppIcon v-if="item.icon" :name="item.icon" class="size-4 opacity-80" />{{ item.label }}
|
||||
<span v-if="item.active" class="nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand" />
|
||||
</NavLink>
|
||||
</li>
|
||||
|
|
@ -207,13 +207,13 @@ const themeOptions = [
|
|||
<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' : ''">
|
||||
<component :is="icons[child.icon]" v-if="icons[child.icon]" class="size-4 text-muted-foreground" />{{ child.label }}
|
||||
<AppIcon v-if="child.icon" :name="child.icon" class="size-4 text-muted-foreground" />{{ child.label }}
|
||||
</NavLink>
|
||||
</DropdownMenuItem>
|
||||
</template>
|
||||
<DropdownMenuItem v-else as-child>
|
||||
<NavLink :item="item" :class="item.active ? 'font-semibold text-brand-text' : ''">
|
||||
<component :is="icons[item.icon]" v-if="icons[item.icon]" class="size-4 text-muted-foreground" />{{ item.label }}
|
||||
<AppIcon v-if="item.icon" :name="item.icon" class="size-4 text-muted-foreground" />{{ item.label }}
|
||||
</NavLink>
|
||||
</DropdownMenuItem>
|
||||
</template>
|
||||
|
|
|
|||
1859
resources/js/lib/icon-set.js
Normal file
1859
resources/js/lib/icon-set.js
Normal file
File diff suppressed because one or more lines are too long
26
resources/js/lib/iconSet.js
Normal file
26
resources/js/lib/iconSet.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { shallowRef } from 'vue';
|
||||
|
||||
/**
|
||||
* Alle Symbole (Lucide) – lokal, aber als eigene Datei, die erst geladen wird,
|
||||
* wenn ein Symbol außerhalb der kuratierten Auswahl gebraucht wird.
|
||||
*/
|
||||
export const iconSet = shallowRef(null);
|
||||
let loading = null;
|
||||
|
||||
export function loadIconSet() {
|
||||
loading ??= import('./icon-set.js').then((module) => {
|
||||
iconSet.value = { icons: module.default, aliases: module.aliases };
|
||||
|
||||
return iconSet.value;
|
||||
});
|
||||
|
||||
return loading;
|
||||
}
|
||||
|
||||
/** SVG-Inhalt eines Symbols aus dem geladenen Satz (oder null). */
|
||||
export function iconMarkup(name) {
|
||||
const set = iconSet.value;
|
||||
if (!set || !name) return null;
|
||||
|
||||
return set.icons[name] ?? set.icons[set.aliases[name]] ?? null;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// Erzeugt von scripts/generate-icons.mjs aus resources/icons/icons.json – nicht von Hand ändern.
|
||||
// Erzeugt von scripts/generate-icons.mjs – nicht von Hand ändern.
|
||||
import {
|
||||
Accessibility,
|
||||
Baby,
|
||||
|
|
@ -68,7 +68,7 @@ import {
|
|||
Wrench,
|
||||
} from '@lucide/vue';
|
||||
|
||||
/** Kuratierte Symbole für Menü, Schnellzugriffe und Pagebuilder – passt zu App\Support\Icons. */
|
||||
/** Kuratierte Symbole (sofort verfügbar). Alle übrigen lädt AppIcon bei Bedarf aus icon-set.js. */
|
||||
export const icons = {
|
||||
'house': House,
|
||||
'newspaper': Newspaper,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<script setup>
|
||||
import { Link as LinkIcon } from '@lucide/vue';
|
||||
import { icons } from '@/lib/icons';
|
||||
import AppIcon from '@/components/AppIcon.vue';
|
||||
|
||||
defineProps({ block: { type: Object, required: true } });
|
||||
</script>
|
||||
|
|
@ -15,7 +14,7 @@ defineProps({ block: { type: Object, required: true } });
|
|||
:class="[block.data.layout === 'grid' ? 'h-full rounded-lg border bg-card p-4' : '', item.url ? 'group' : '']"
|
||||
>
|
||||
<span class="grid size-10 shrink-0 place-items-center rounded-lg bg-brand-soft text-brand-text">
|
||||
<component :is="icons[item.icon] ?? LinkIcon" class="size-5" />
|
||||
<AppIcon :name="item.icon || 'link'" class="size-5" />
|
||||
</span>
|
||||
<span class="min-w-0">
|
||||
<span class="block font-medium" :class="{ 'group-hover:underline': item.url }">{{ item.title }}</span>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ import { Switch } from '@/components/ui/switch';
|
|||
import NativeSelect from '@/components/NativeSelect.vue';
|
||||
import PersonAvatar from '@/components/PersonAvatar.vue';
|
||||
import RichTextEditor from '@/components/RichTextEditor.vue';
|
||||
import { icons } from '@/lib/icons';
|
||||
import AppIcon from '@/components/AppIcon.vue';
|
||||
import { iconSet, loadIconSet } from '@/lib/iconSet';
|
||||
import { http } from '@/lib/http';
|
||||
|
||||
/**
|
||||
|
|
@ -150,7 +151,23 @@ const availableFiles = computed(() => editor.files.value.filter((file) => !(mode
|
|||
|
||||
const formatSize = (bytes) => (bytes > 1024 * 1024 ? `${(bytes / 1024 / 1024).toFixed(1).replace('.', ',')} MB` : `${Math.max(1, Math.round(bytes / 1024))} KB`);
|
||||
|
||||
const iconOptions = computed(() => (props.field.choices ?? []).map((choice) => ({ ...choice, icon: icons[choice.value] })));
|
||||
// Symbole: kuratierte Auswahl, per Suche alle (englische Namen, Satz lädt bei Bedarf).
|
||||
const iconQuery = ref('');
|
||||
const iconOptions = computed(() => {
|
||||
const query = iconQuery.value.trim().toLowerCase();
|
||||
const curated = (props.field.choices ?? []).map((choice) => ({ value: choice.value, label: choice.label }));
|
||||
|
||||
if (!query) {
|
||||
return model.value && !curated.some((c) => c.value === model.value) ? [{ value: model.value, label: model.value }, ...curated] : curated;
|
||||
}
|
||||
|
||||
const found = curated.filter((c) => c.label.toLowerCase().includes(query) || c.value.includes(query));
|
||||
const all = iconSet.value ? Object.keys(iconSet.value.icons).filter((name) => name.includes(query) && !found.some((f) => f.value === name)) : [];
|
||||
|
||||
return [...found, ...all.map((name) => ({ value: name, label: name }))].slice(0, 60);
|
||||
});
|
||||
|
||||
watch(iconQuery, (query) => query.trim() && loadIconSet());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -169,7 +186,9 @@ const iconOptions = computed(() => (props.field.choices ?? []).map((choice) => (
|
|||
<Switch :id="id" v-model="model" />
|
||||
</label>
|
||||
|
||||
<div v-else-if="field.type === 'icon'" class="grid grid-cols-6 gap-1.5">
|
||||
<div v-else-if="field.type === 'icon'" class="grid gap-2">
|
||||
<Input v-model="iconQuery" type="search" placeholder="Alle Symbole durchsuchen (englisch, z. B. calendar)" class="h-8 text-[13px]" />
|
||||
<div class="grid max-h-56 grid-cols-6 gap-1.5 overflow-y-auto">
|
||||
<button
|
||||
v-for="option in iconOptions"
|
||||
:key="option.value"
|
||||
|
|
@ -180,8 +199,10 @@ const iconOptions = computed(() => (props.field.choices ?? []).map((choice) => (
|
|||
:aria-pressed="model === option.value"
|
||||
@click="model = option.value"
|
||||
>
|
||||
<component :is="option.icon" class="size-4" />
|
||||
<AppIcon :name="option.value" class="size-4" />
|
||||
</button>
|
||||
<p v-if="iconQuery && !iconOptions.length" class="col-span-6 py-2 text-center text-xs text-muted-foreground">Kein Symbol gefunden.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else-if="field.type === 'image'" class="grid gap-2">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue