Loheide-eu-mitarbeiterplatt.../vendor/filament/widgets/resources/views/stats-overview-widget/stat.blade.php
Friederich Loheide 9c0f8de791
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
Phase 0: Fundament für Inhaus
- Laravel 13 mit Filament 5 (Admin), Inertia 3 + Vue 3 + Vuetify 4 (Material 3)
- Anmeldung über Fortify (Login, Passwort vergessen/ändern), keine Selbstregistrierung
- Profil mit Profilbild (WebP in festen Größen), Personenseiten, Header mit Avatar-Menü
- Material-3-Farbschema aus der Primärfarbe, hell/dunkel/System pro Person
- Basis-Branding (Portalname, Logo, Primärfarbe) im Admin unter „Erscheinungsbild“
- Benutzerverwaltung im Admin, Zugang vorläufig über is_admin
- vendor/ (ohne Dev-Pakete) und Frontend-Build mitversioniert, Dev-Pakete in vendor-dev/
- PHPUnit-Tests gegen MySQL/MariaDB, Forgejo-CI-Matrix, Docker-Entwicklungsumgebung
- VERSION, CHANGELOG.md und CONTRIBUTING.md mit Release-Ablauf

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 20:35:30 +00:00

100 lines
4 KiB
PHP

@php
use Filament\Support\Enums\IconPosition;
use Filament\Support\Facades\FilamentAsset;
use Filament\Support\View\ComponentAttributeBag as FilamentComponentAttributeBag;
use Filament\Widgets\View\Components\StatsOverviewWidgetComponent\StatComponent\DescriptionComponent;
use Filament\Widgets\View\Components\StatsOverviewWidgetComponent\StatComponent\StatsOverviewWidgetStatChartComponent;
$chartColor = $getChartColor() ?? 'gray';
$descriptionColor = $getDescriptionColor() ?? 'gray';
$descriptionIcon = $getDescriptionIcon();
$descriptionIconPosition = $getDescriptionIconPosition();
$url = $getUrl();
$tag = $url ? 'a' : 'div';
@endphp
<{!! $tag !!}
@if ($url)
{{ \Filament\Support\generate_href_html($url, $shouldOpenUrlInNewTab()) }}
@endif
{{
$getExtraAttributeBag()
->class([
'fi-wi-stats-overview-stat',
])
}}
>
<div class="fi-wi-stats-overview-stat-content">
<div class="fi-wi-stats-overview-stat-label-ctn">
{{ \Filament\Support\generate_icon_html($getIcon()) }}
<span class="fi-wi-stats-overview-stat-label">
{{ $getLabel() }}
</span>
</div>
@if (filled($value = $getValue()))
<div class="fi-wi-stats-overview-stat-value">
{{ $value }}
</div>
@else
<div class="fi-wi-stats-overview-stat-placeholder">
{{ $getPlaceholder() }}
</div>
@endif
@if ($description = $getDescription())
<div
{{ (new FilamentComponentAttributeBag)->color(DescriptionComponent::class, $descriptionColor)->class(['fi-wi-stats-overview-stat-description']) }}
>
@if ($descriptionIcon && in_array($descriptionIconPosition, [IconPosition::Before, 'before']))
{{ \Filament\Support\generate_icon_html($descriptionIcon, attributes: (new FilamentComponentAttributeBag)) }}
@endif
<span>
{{ $description }}
</span>
@if ($descriptionIcon && in_array($descriptionIconPosition, [IconPosition::After, 'after']))
{{ \Filament\Support\generate_icon_html($descriptionIcon, attributes: (new FilamentComponentAttributeBag)) }}
@endif
</div>
@endif
</div>
@if ($chart = $getChart())
{{-- An empty function to initialize the Alpine component with until it's loaded with `x-load`. --}}
<div x-data="{ statsOverviewStatChart() {} }">
<div
x-load
x-load-src="{{ FilamentAsset::getAlpineComponentSrc('stats-overview/stat/chart', 'filament/widgets') }}"
wire:ignore
x-data="statsOverviewStatChart({
key: @js($getKey(false)),
labels: @js(array_keys($chart)),
values: @js(array_values($chart)),
})"
{{ (new FilamentComponentAttributeBag)->color(StatsOverviewWidgetStatChartComponent::class, $chartColor)->class(['fi-wi-stats-overview-stat-chart']) }}
>
{{-- The label and value are already exposed as text, so the trend sparkline is decorative. --}}
<canvas x-ref="canvas" aria-hidden="true"></canvas>
{{--
These empty elements carry the colors the chart should be painted in, so that a theme
can set them with an ordinary `color` declaration.
--}}
<span
aria-hidden="true"
x-ref="backgroundColorElement"
class="fi-wi-stats-overview-stat-chart-bg-color"
></span>
<span
aria-hidden="true"
x-ref="borderColorElement"
class="fi-wi-stats-overview-stat-chart-border-color"
></span>
</div>
</div>
@endif
</{!! $tag !!}>