Phase 0: Fundament für Inhaus
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
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
- 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>
This commit is contained in:
parent
7197eaebf2
commit
9c0f8de791
15771 changed files with 1564103 additions and 5 deletions
58
vendor/filament/support/resources/views/components/actions.blade.php
vendored
Normal file
58
vendor/filament/support/resources/views/components/actions.blade.php
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
@props([
|
||||
'actions' => [],
|
||||
'alignment' => null,
|
||||
'fullWidth' => false,
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Enums\Alignment;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
|
||||
$alignment ??= Alignment::Start;
|
||||
|
||||
if (is_array($actions)) {
|
||||
$actions = array_filter(
|
||||
$actions,
|
||||
fn ($action): bool => $action->isVisible(),
|
||||
);
|
||||
}
|
||||
|
||||
if (! $alignment instanceof Alignment) {
|
||||
$alignment = filled($alignment) ? (Alignment::tryFrom($alignment) ?? $alignment) : null;
|
||||
}
|
||||
|
||||
$hasActions = false;
|
||||
|
||||
$hasSlot = ! \Filament\Support\is_slot_empty($slot);
|
||||
$actionsAreHtmlable = $actions instanceof Htmlable;
|
||||
|
||||
if ($hasSlot) {
|
||||
$hasActions = true;
|
||||
} elseif ($actionsAreHtmlable) {
|
||||
$hasActions = ! \Filament\Support\is_slot_empty($actions);
|
||||
} else {
|
||||
$hasActions = filled($actions);
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if ($hasActions)
|
||||
<div
|
||||
{{
|
||||
$attributes->class([
|
||||
'fi-ac',
|
||||
'fi-width-full' => $fullWidth,
|
||||
($alignment instanceof Alignment) ? "fi-align-{$alignment->value}" : (is_string($alignment) ? $alignment : null) => ! $fullWidth,
|
||||
])
|
||||
}}
|
||||
>
|
||||
@if ($hasSlot)
|
||||
{{ $slot }}
|
||||
@elseif ($actionsAreHtmlable)
|
||||
{{ $actions }}
|
||||
@else
|
||||
@foreach ($actions as $action)
|
||||
{{ $action }}
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
20
vendor/filament/support/resources/views/components/avatar.blade.php
vendored
Normal file
20
vendor/filament/support/resources/views/components/avatar.blade.php
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
@props([
|
||||
'alt' => '',
|
||||
'circular' => true,
|
||||
'size' => 'md',
|
||||
])
|
||||
|
||||
<img
|
||||
alt="{{ $alt }}"
|
||||
{{
|
||||
$attributes
|
||||
->class([
|
||||
'fi-avatar',
|
||||
'fi-circular' => $circular,
|
||||
match ($size) {
|
||||
'sm', 'md', 'lg' => "fi-size-{$size}",
|
||||
default => $size,
|
||||
},
|
||||
])
|
||||
}}
|
||||
/>
|
||||
192
vendor/filament/support/resources/views/components/badge.blade.php
vendored
Normal file
192
vendor/filament/support/resources/views/components/badge.blade.php
vendored
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
@props([
|
||||
'color' => 'primary',
|
||||
'deleteButton' => null,
|
||||
'disabled' => false,
|
||||
'form' => null,
|
||||
'formId' => null,
|
||||
'href' => null,
|
||||
'icon' => null,
|
||||
'iconAlias' => null,
|
||||
'iconPosition' => null,
|
||||
'iconSize' => null,
|
||||
'keyBindings' => null,
|
||||
'loadingIndicator' => true,
|
||||
'size' => null,
|
||||
'spaMode' => null,
|
||||
'tag' => 'span',
|
||||
'target' => null,
|
||||
'tooltip' => null,
|
||||
'type' => 'button',
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Enums\IconPosition;
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Support\Enums\Size;
|
||||
use Filament\Support\View\Components\BadgeComponent;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
use Illuminate\View\ComponentAttributeBag;
|
||||
|
||||
$iconPosition ??= IconPosition::Before;
|
||||
$size ??= Size::Medium;
|
||||
|
||||
if (! $iconPosition instanceof IconPosition) {
|
||||
$iconPosition = filled($iconPosition) ? (IconPosition::tryFrom($iconPosition) ?? $iconPosition) : null;
|
||||
}
|
||||
|
||||
if (! $size instanceof Size) {
|
||||
$size = filled($size) ? (Size::tryFrom($size) ?? $size) : null;
|
||||
}
|
||||
|
||||
if (filled($iconSize) && (! $iconSize instanceof IconSize)) {
|
||||
$iconSize = IconSize::tryFrom($iconSize) ?? $iconSize;
|
||||
}
|
||||
|
||||
$isDeletable = count($deleteButton?->attributes->getAttributes() ?? []) > 0;
|
||||
|
||||
$wireTarget = $loadingIndicator ? $attributes->whereStartsWith(['wire:target', 'wire:click'])->filter(fn ($value): bool => filled($value))->first() : null;
|
||||
|
||||
$hasLoadingIndicator = filled($wireTarget) || ($type === 'submit' && filled($form));
|
||||
|
||||
if ($hasLoadingIndicator) {
|
||||
$loadingIndicatorTarget = html_entity_decode($wireTarget ?: $form, ENT_QUOTES);
|
||||
}
|
||||
|
||||
$hasTooltip = filled($tooltip);
|
||||
|
||||
$loadingDelay = ($icon || $hasLoadingIndicator || $isDeletable)
|
||||
? config('filament.livewire_loading_delay', 'default')
|
||||
: null;
|
||||
@endphp
|
||||
|
||||
<{{ $tag }}
|
||||
@if (($tag === 'a') && (! ($disabled && $hasTooltip)))
|
||||
{{ \Filament\Support\generate_href_html($href, $target === '_blank', $spaMode) }}
|
||||
@endif
|
||||
@if ($keyBindings)
|
||||
x-bind:id="$id('key-bindings')"
|
||||
x-mousetrap.global.{{ collect($keyBindings)->map(fn (string $keyBinding): string => str_replace('+', '-', $keyBinding))->implode('.') }}="document.getElementById($el.id)?.click()"
|
||||
@endif
|
||||
@if ($hasTooltip)
|
||||
x-tooltip="{
|
||||
content: @js($tooltip),
|
||||
theme: $store.theme,
|
||||
allowHTML: @js($tooltip instanceof Htmlable),
|
||||
}"
|
||||
@endif
|
||||
{{
|
||||
$attributes
|
||||
->merge([
|
||||
'aria-disabled' => $disabled ? 'true' : null,
|
||||
'disabled' => $disabled && blank($tooltip),
|
||||
'form' => $tag === 'button' ? $formId : null,
|
||||
'type' => $tag === 'button' ? $type : null,
|
||||
'wire:loading.attr' => $tag === 'button' ? 'disabled' : null,
|
||||
'wire:target' => ($hasLoadingIndicator && $loadingIndicatorTarget) ? $loadingIndicatorTarget : null,
|
||||
], escape: false)
|
||||
->when(
|
||||
$disabled && $hasTooltip,
|
||||
fn (ComponentAttributeBag $attributes) => $attributes->filter(
|
||||
fn (mixed $value, string $key): bool => ! str($key)->startsWith(['href', 'x-on:', 'wire:click']),
|
||||
),
|
||||
)
|
||||
->class([
|
||||
'fi-badge',
|
||||
'fi-disabled' => $disabled,
|
||||
($size instanceof Size) ? "fi-size-{$size->value}" : (is_string($size) ? $size : ''),
|
||||
])
|
||||
->color(BadgeComponent::class, $color)
|
||||
}}
|
||||
>
|
||||
@if ($iconPosition === IconPosition::Before)
|
||||
@if ($icon || $iconAlias)
|
||||
{{
|
||||
\Filament\Support\generate_icon_html($icon, $iconAlias, (new Filament\Support\View\ComponentAttributeBag([
|
||||
'wire:loading.remove.delay.' . $loadingDelay => $hasLoadingIndicator,
|
||||
'wire:target' => $hasLoadingIndicator ? $loadingIndicatorTarget : false,
|
||||
])), size: $iconSize ?? IconSize::Small)
|
||||
}}
|
||||
@endif
|
||||
|
||||
@if ($hasLoadingIndicator)
|
||||
{{
|
||||
\Filament\Support\generate_loading_indicator_html((new Filament\Support\View\ComponentAttributeBag([
|
||||
'wire:loading.delay.' . $loadingDelay => '',
|
||||
'wire:target' => $loadingIndicatorTarget,
|
||||
])), size: $iconSize ?? IconSize::Small)
|
||||
}}
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<span class="fi-badge-label-ctn">
|
||||
<span class="fi-badge-label">
|
||||
{{ $slot }}
|
||||
</span>
|
||||
</span>
|
||||
|
||||
@if ($isDeletable)
|
||||
@php
|
||||
$deleteButtonWireTarget = $deleteButton->attributes->whereStartsWith(['wire:target', 'wire:click'])->filter(fn ($value): bool => filled($value))->first();
|
||||
|
||||
$deleteButtonHasLoadingIndicator = filled($deleteButtonWireTarget);
|
||||
|
||||
if ($deleteButtonHasLoadingIndicator) {
|
||||
$deleteButtonLoadingIndicatorTarget = html_entity_decode($deleteButtonWireTarget, ENT_QUOTES);
|
||||
}
|
||||
@endphp
|
||||
|
||||
<button
|
||||
type="button"
|
||||
{{
|
||||
$deleteButton->attributes
|
||||
->except(['label'])
|
||||
->class([
|
||||
'fi-badge-delete-btn',
|
||||
])
|
||||
}}
|
||||
>
|
||||
<span
|
||||
{{
|
||||
(new Filament\Support\View\ComponentAttributeBag([
|
||||
'aria-hidden' => 'true',
|
||||
'wire:loading.remove.delay.' . $loadingDelay => $deleteButtonHasLoadingIndicator,
|
||||
'wire:target' => $deleteButtonHasLoadingIndicator ? $deleteButtonLoadingIndicatorTarget : false,
|
||||
]))->class([
|
||||
'fi-badge-delete-btn-icon',
|
||||
])
|
||||
}}
|
||||
></span>
|
||||
|
||||
@if ($deleteButtonHasLoadingIndicator)
|
||||
{{
|
||||
\Filament\Support\generate_loading_indicator_html((new Filament\Support\View\ComponentAttributeBag([
|
||||
'wire:loading.delay.' . $loadingDelay => '',
|
||||
'wire:target' => $deleteButtonLoadingIndicatorTarget,
|
||||
])), size: IconSize::ExtraSmall)
|
||||
}}
|
||||
@endif
|
||||
|
||||
<span class="fi-sr-only">
|
||||
{{ filled($label = $deleteButton->attributes->get('label')) ? $label : __('filament::components/badge.actions.delete.label') }}
|
||||
</span>
|
||||
</button>
|
||||
@elseif ($iconPosition === IconPosition::After)
|
||||
@if ($icon || $iconAlias)
|
||||
{{
|
||||
\Filament\Support\generate_icon_html($icon, $iconAlias, (new Filament\Support\View\ComponentAttributeBag([
|
||||
'wire:loading.remove.delay.' . $loadingDelay => $hasLoadingIndicator,
|
||||
'wire:target' => $hasLoadingIndicator ? $loadingIndicatorTarget : false,
|
||||
])), size: $iconSize ?? IconSize::Small)
|
||||
}}
|
||||
@endif
|
||||
|
||||
@if ($hasLoadingIndicator)
|
||||
{{
|
||||
\Filament\Support\generate_loading_indicator_html((new Filament\Support\View\ComponentAttributeBag([
|
||||
'wire:loading.delay.' . $loadingDelay => '',
|
||||
'wire:target' => $loadingIndicatorTarget,
|
||||
])), size: $iconSize ?? IconSize::Small)
|
||||
}}
|
||||
@endif
|
||||
@endif
|
||||
</{{ $tag }}>
|
||||
56
vendor/filament/support/resources/views/components/breadcrumbs.blade.php
vendored
Normal file
56
vendor/filament/support/resources/views/components/breadcrumbs.blade.php
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
@props([
|
||||
'breadcrumbs' => [],
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Support\View\ComponentAttributeBag as FilamentComponentAttributeBag;
|
||||
use Filament\Support\View\SupportIconAlias;
|
||||
|
||||
use function Filament\Support\generate_icon_html;
|
||||
@endphp
|
||||
|
||||
<nav
|
||||
{{
|
||||
$attributes
|
||||
->merge(['aria-label' => __('filament::components/breadcrumbs.label')], escape: true)
|
||||
->class(['fi-breadcrumbs'])
|
||||
}}
|
||||
>
|
||||
<ol class="fi-breadcrumbs-list">
|
||||
@foreach ($breadcrumbs as $url => $label)
|
||||
<li class="fi-breadcrumbs-item">
|
||||
@if (! $loop->first)
|
||||
{{
|
||||
generate_icon_html(Heroicon::ChevronRight, alias: SupportIconAlias::BREADCRUMBS_SEPARATOR, attributes: (new FilamentComponentAttributeBag)->merge(['aria-hidden' => 'true'], escape: false)->class([
|
||||
'fi-breadcrumbs-item-separator fi-ltr',
|
||||
]))
|
||||
}}
|
||||
|
||||
{{
|
||||
generate_icon_html(Heroicon::ChevronLeft, alias: SupportIconAlias::BREADCRUMBS_SEPARATOR_RTL, attributes: (new FilamentComponentAttributeBag)->merge(['aria-hidden' => 'true'], escape: false)->class([
|
||||
'fi-breadcrumbs-item-separator fi-rtl',
|
||||
]))
|
||||
}}
|
||||
@endif
|
||||
|
||||
@if (is_int($url))
|
||||
<span
|
||||
@if ($loop->last) aria-current="page" @endif
|
||||
class="fi-breadcrumbs-item-label"
|
||||
>
|
||||
{{ $label }}
|
||||
</span>
|
||||
@else
|
||||
<a
|
||||
{{ \Filament\Support\generate_href_html($url) }}
|
||||
@if ($loop->last) aria-current="page" @endif
|
||||
class="fi-breadcrumbs-item-label"
|
||||
>
|
||||
{{ $label }}
|
||||
</a>
|
||||
@endif
|
||||
</li>
|
||||
@endforeach
|
||||
</ol>
|
||||
</nav>
|
||||
3
vendor/filament/support/resources/views/components/button/group.blade.php
vendored
Normal file
3
vendor/filament/support/resources/views/components/button/group.blade.php
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<div {{ $attributes->class(['fi-btn-group']) }}>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
250
vendor/filament/support/resources/views/components/button/index.blade.php
vendored
Normal file
250
vendor/filament/support/resources/views/components/button/index.blade.php
vendored
Normal file
|
|
@ -0,0 +1,250 @@
|
|||
@props([
|
||||
'badge' => null,
|
||||
'badgeColor' => 'primary',
|
||||
'badgeSize' => null,
|
||||
'color' => 'primary',
|
||||
'disabled' => false,
|
||||
'form' => null,
|
||||
'formId' => null,
|
||||
'href' => null,
|
||||
'icon' => null,
|
||||
'iconAlias' => null,
|
||||
'iconPosition' => null,
|
||||
'iconSize' => null,
|
||||
'keyBindings' => null,
|
||||
'labeledFrom' => null,
|
||||
'labelSrOnly' => false,
|
||||
'loadingIndicator' => true,
|
||||
'outlined' => false,
|
||||
'size' => null,
|
||||
'spaMode' => null,
|
||||
'tag' => 'button',
|
||||
'target' => null,
|
||||
'tooltip' => null,
|
||||
'type' => 'button',
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Enums\IconPosition;
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Support\Enums\Size;
|
||||
use Filament\Support\View\ComponentAttributeBag as FilamentComponentAttributeBag;
|
||||
use Filament\Support\View\Components\BadgeComponent;
|
||||
use Filament\Support\View\Components\ButtonComponent;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
use Illuminate\Support\Js;
|
||||
use Illuminate\View\ComponentAttributeBag;
|
||||
use Illuminate\View\ComponentSlot;
|
||||
|
||||
$badgeSize ??= Size::ExtraSmall;
|
||||
$iconPosition ??= IconPosition::Before;
|
||||
$size ??= Size::Medium;
|
||||
|
||||
if (! $iconPosition instanceof IconPosition) {
|
||||
$iconPosition = filled($iconPosition) ? (IconPosition::tryFrom($iconPosition) ?? $iconPosition) : null;
|
||||
}
|
||||
|
||||
if (! $size instanceof Size) {
|
||||
$size = filled($size) ? (Size::tryFrom($size) ?? $size) : null;
|
||||
}
|
||||
|
||||
if (! $badgeSize instanceof Size) {
|
||||
$badgeSize = filled($badgeSize) ? (Size::tryFrom($badgeSize) ?? $badgeSize) : null;
|
||||
}
|
||||
|
||||
if (filled($iconSize) && (! $iconSize instanceof IconSize)) {
|
||||
$iconSize = IconSize::tryFrom($iconSize) ?? $iconSize;
|
||||
}
|
||||
|
||||
$iconSize ??= match ($size) {
|
||||
Size::ExtraSmall, Size::Small => IconSize::Small,
|
||||
default => null,
|
||||
};
|
||||
|
||||
$wireTarget = $loadingIndicator ? $attributes->whereStartsWith(['wire:target', 'wire:click'])->filter(fn ($value): bool => filled($value))->first() : null;
|
||||
|
||||
$hasFormProcessingLoadingIndicator = $type === 'submit' && filled($form);
|
||||
$hasLoadingIndicator = filled($wireTarget) || $hasFormProcessingLoadingIndicator;
|
||||
|
||||
if ($hasLoadingIndicator) {
|
||||
$loadingIndicatorTarget = html_entity_decode($wireTarget ?: $form, ENT_QUOTES);
|
||||
}
|
||||
|
||||
$hasTooltip = filled($tooltip);
|
||||
|
||||
$loadingDelay = ($icon || $hasLoadingIndicator)
|
||||
? config('filament.livewire_loading_delay', 'default')
|
||||
: null;
|
||||
@endphp
|
||||
|
||||
@if ($labeledFrom)
|
||||
<x-filament::icon-button
|
||||
:badge="$badge"
|
||||
:badge-color="$badgeColor"
|
||||
:badge-size="$badgeSize"
|
||||
:color="$color"
|
||||
:disabled="$disabled"
|
||||
:form="$form"
|
||||
:form-id="$formId"
|
||||
:href="$href"
|
||||
:icon="$icon"
|
||||
:icon-alias="$iconAlias"
|
||||
:icon-size="$iconSize"
|
||||
:key-bindings="$keyBindings"
|
||||
:label="$slot"
|
||||
:loading-indicator="$loadingIndicator"
|
||||
:size="$size"
|
||||
:spa-mode="$spaMode"
|
||||
:tag="$tag"
|
||||
:target="$target"
|
||||
:tooltip="$tooltip"
|
||||
:type="$type"
|
||||
:attributes="\Filament\Support\prepare_inherited_attributes($attributes)"
|
||||
/>
|
||||
@endif
|
||||
|
||||
<{{ $tag }}
|
||||
@if (($tag === 'a') && (! ($disabled && $hasTooltip)))
|
||||
{{ \Filament\Support\generate_href_html($href, $target === '_blank', $spaMode) }}
|
||||
@endif
|
||||
@if ($keyBindings)
|
||||
x-bind:id="$id('key-bindings')"
|
||||
x-mousetrap.global.{{ collect($keyBindings)->map(fn (string $keyBinding): string => str_replace('+', '-', $keyBinding))->implode('.') }}="document.getElementById($el.id)?.click()"
|
||||
@endif
|
||||
@if ($hasTooltip)
|
||||
x-tooltip="{
|
||||
content: @js($tooltip),
|
||||
theme: $store.theme,
|
||||
allowHTML: @js($tooltip instanceof Htmlable),
|
||||
}"
|
||||
@endif
|
||||
@if ($hasFormProcessingLoadingIndicator)
|
||||
x-data="filamentFormButton"
|
||||
x-bind:class="{ 'fi-processing': isProcessing }"
|
||||
@endif
|
||||
{{
|
||||
$attributes
|
||||
->merge([
|
||||
'aria-disabled' => $disabled ? 'true' : null,
|
||||
// Security: These attributes are rendered without escaping, so the `aria-label` must be escaped here, otherwise an `Htmlable` label could break out of the attribute. `doubleEncode: false` preserves entities that Blade has already escaped in the slot.
|
||||
'aria-label' => $labelSrOnly ? e(trim(strip_tags($slot->toHtml())), doubleEncode: false) : null,
|
||||
'disabled' => $disabled && blank($tooltip),
|
||||
'form' => $formId,
|
||||
'tabindex' => (($tag === 'a') && $disabled && $hasTooltip) ? '0' : null,
|
||||
'type' => $tag === 'button' ? $type : null,
|
||||
'wire:loading.attr' => $tag === 'button' ? 'disabled' : null,
|
||||
'wire:target' => ($hasLoadingIndicator && $loadingIndicatorTarget) ? $loadingIndicatorTarget : null,
|
||||
'x-bind:disabled' => $hasFormProcessingLoadingIndicator ? 'isProcessing' : null,
|
||||
'x-bind:aria-label' => ($labelSrOnly && $hasFormProcessingLoadingIndicator) ? ('isProcessing ? processingMessage : ' . Js::from(trim(strip_tags($slot->toHtml())))) : null,
|
||||
], escape: false)
|
||||
->when(
|
||||
$disabled && $hasTooltip,
|
||||
fn (ComponentAttributeBag $attributes) => $attributes->filter(
|
||||
fn (mixed $value, string $key): bool => ! str($key)->startsWith(['href', 'x-on:', 'wire:click']),
|
||||
),
|
||||
)
|
||||
->class([
|
||||
'fi-btn',
|
||||
'fi-disabled' => $disabled,
|
||||
'fi-outlined' => $outlined,
|
||||
($size instanceof Size) ? "fi-size-{$size->value}" : (is_string($size) ? $size : ''),
|
||||
is_string($labeledFrom) ? "fi-labeled-from-{$labeledFrom}" : null,
|
||||
])
|
||||
->color(ButtonComponent::make($outlined), $color)
|
||||
}}
|
||||
>
|
||||
@if ($iconPosition === IconPosition::Before)
|
||||
@if ($icon || $iconAlias)
|
||||
{{
|
||||
\Filament\Support\generate_icon_html($icon, $iconAlias, (new Filament\Support\View\ComponentAttributeBag([
|
||||
'wire:loading.remove.delay.' . $loadingDelay => $hasLoadingIndicator,
|
||||
'wire:target' => $hasLoadingIndicator ? $loadingIndicatorTarget : false,
|
||||
])), size: $iconSize)
|
||||
}}
|
||||
@endif
|
||||
|
||||
@if ($hasLoadingIndicator)
|
||||
{{
|
||||
\Filament\Support\generate_loading_indicator_html((new Filament\Support\View\ComponentAttributeBag([
|
||||
'wire:loading.delay.' . $loadingDelay => '',
|
||||
'wire:target' => $loadingIndicatorTarget,
|
||||
])), size: $iconSize)
|
||||
}}
|
||||
@endif
|
||||
|
||||
@if ($hasFormProcessingLoadingIndicator)
|
||||
{{
|
||||
\Filament\Support\generate_loading_indicator_html((new Filament\Support\View\ComponentAttributeBag([
|
||||
'x-cloak' => 'x-cloak',
|
||||
'x-show' => 'isProcessing',
|
||||
])), size: $iconSize)
|
||||
}}
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if (! $labelSrOnly)
|
||||
@if ($hasFormProcessingLoadingIndicator)
|
||||
<span x-show="! isProcessing">
|
||||
{{ $slot }}
|
||||
</span>
|
||||
@else
|
||||
{{ $slot }}
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if ($hasFormProcessingLoadingIndicator && (! $labelSrOnly))
|
||||
<span
|
||||
x-cloak
|
||||
x-show="isProcessing"
|
||||
x-text="processingMessage"
|
||||
></span>
|
||||
@endif
|
||||
|
||||
@if ($iconPosition === IconPosition::After)
|
||||
@if ($icon || $iconAlias)
|
||||
{{
|
||||
\Filament\Support\generate_icon_html($icon, $iconAlias, (new Filament\Support\View\ComponentAttributeBag([
|
||||
'wire:loading.remove.delay.' . $loadingDelay => $hasLoadingIndicator,
|
||||
'wire:target' => $hasLoadingIndicator ? $loadingIndicatorTarget : false,
|
||||
])), size: $iconSize)
|
||||
}}
|
||||
@endif
|
||||
|
||||
@if ($hasLoadingIndicator)
|
||||
{{
|
||||
\Filament\Support\generate_loading_indicator_html((new Filament\Support\View\ComponentAttributeBag([
|
||||
'wire:loading.delay.' . $loadingDelay => '',
|
||||
'wire:target' => $loadingIndicatorTarget,
|
||||
])), size: $iconSize)
|
||||
}}
|
||||
@endif
|
||||
|
||||
@if ($hasFormProcessingLoadingIndicator)
|
||||
{{
|
||||
\Filament\Support\generate_loading_indicator_html((new Filament\Support\View\ComponentAttributeBag([
|
||||
'x-cloak' => 'x-cloak',
|
||||
'x-show' => 'isProcessing',
|
||||
])), size: $iconSize)
|
||||
}}
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if (filled($badge))
|
||||
<div class="fi-btn-badge-ctn">
|
||||
@if ($badge instanceof ComponentSlot)
|
||||
{{ $badge }}
|
||||
@else
|
||||
<span
|
||||
{{
|
||||
(new FilamentComponentAttributeBag)->color(BadgeComponent::class, $badgeColor)->class([
|
||||
'fi-badge',
|
||||
($badgeSize instanceof Size) ? "fi-size-{$badgeSize->value}" : (is_string($badgeSize) ? $badgeSize : ''),
|
||||
])
|
||||
}}
|
||||
>
|
||||
{{ $badge }}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</{{ $tag }}>
|
||||
84
vendor/filament/support/resources/views/components/callout.blade.php
vendored
Normal file
84
vendor/filament/support/resources/views/components/callout.blade.php
vendored
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
@props([
|
||||
'color' => 'gray',
|
||||
'controls' => null,
|
||||
'description' => null,
|
||||
'footer' => null,
|
||||
'heading' => null,
|
||||
'icon' => null,
|
||||
'iconColor' => null,
|
||||
'iconSize' => null,
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Support\View\ComponentAttributeBag;
|
||||
use Filament\Support\View\Components\CalloutComponent;
|
||||
use Filament\Support\View\Components\CalloutComponent\IconComponent;
|
||||
|
||||
use function Filament\Support\generate_icon_html;
|
||||
use function Filament\Support\is_slot_empty;
|
||||
|
||||
if (filled($iconSize) && (! $iconSize instanceof IconSize)) {
|
||||
$iconSize = IconSize::tryFrom($iconSize) ?? $iconSize;
|
||||
}
|
||||
|
||||
$iconColor ??= $color;
|
||||
|
||||
$hasDescription = filled((string) $description);
|
||||
$hasHeading = filled($heading);
|
||||
$hasFooter = ! is_slot_empty($footer);
|
||||
$hasIcon = filled($icon);
|
||||
$hasControls = ! is_slot_empty($controls);
|
||||
@endphp
|
||||
|
||||
<div
|
||||
{{
|
||||
$attributes
|
||||
->color(CalloutComponent::class, $color)
|
||||
->class(['fi-callout'])
|
||||
}}
|
||||
>
|
||||
@if ($hasIcon)
|
||||
{{
|
||||
generate_icon_html(
|
||||
$icon,
|
||||
attributes: (new ComponentAttributeBag(['aria-hidden' => 'true']))
|
||||
->color(IconComponent::class, $iconColor)
|
||||
->class(['fi-callout-icon']),
|
||||
size: $iconSize ?? IconSize::Large,
|
||||
)
|
||||
}}
|
||||
@endif
|
||||
|
||||
@if ($hasHeading || $hasDescription || $hasFooter)
|
||||
<div class="fi-callout-main">
|
||||
@if ($hasHeading || $hasDescription)
|
||||
<div class="fi-callout-text">
|
||||
@if ($hasHeading)
|
||||
<h4 class="fi-callout-heading">
|
||||
{{ $heading }}
|
||||
</h4>
|
||||
@endif
|
||||
|
||||
@if ($hasDescription)
|
||||
<p class="fi-callout-description">
|
||||
{{ $description }}
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($hasFooter)
|
||||
<div class="fi-callout-footer">
|
||||
{{ $footer }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($hasControls)
|
||||
<div class="fi-callout-controls">
|
||||
{{ $controls }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
5
vendor/filament/support/resources/views/components/card.blade.php
vendored
Normal file
5
vendor/filament/support/resources/views/components/card.blade.php
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<x-filament::section
|
||||
:attributes="\Filament\Support\prepare_inherited_attributes($attributes)"
|
||||
>
|
||||
{{ $slot }}
|
||||
</x-filament::section>
|
||||
31
vendor/filament/support/resources/views/components/dropdown/header.blade.php
vendored
Normal file
31
vendor/filament/support/resources/views/components/dropdown/header.blade.php
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
@props([
|
||||
'color' => 'gray',
|
||||
'icon' => null,
|
||||
'iconSize' => null,
|
||||
'tag' => 'div',
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Support\View\Components\DropdownComponent\HeaderComponent;
|
||||
|
||||
if (! ($iconSize instanceof IconSize)) {
|
||||
$iconSize = filled($iconSize) ? (IconSize::tryFrom($iconSize) ?? $iconSize) : null;
|
||||
}
|
||||
@endphp
|
||||
|
||||
<{{ $tag }}
|
||||
{{
|
||||
$attributes
|
||||
->class([
|
||||
'fi-dropdown-header',
|
||||
])
|
||||
->color(HeaderComponent::class, $color)
|
||||
}}
|
||||
>
|
||||
{{ \Filament\Support\generate_icon_html($icon, size: $iconSize) }}
|
||||
|
||||
<span>
|
||||
{{ $slot }}
|
||||
</span>
|
||||
</{{ $tag }}>
|
||||
66
vendor/filament/support/resources/views/components/dropdown/index.blade.php
vendored
Normal file
66
vendor/filament/support/resources/views/components/dropdown/index.blade.php
vendored
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
@props([
|
||||
'availableHeight' => null,
|
||||
'availableWidth' => null,
|
||||
'flip' => true,
|
||||
'maxHeight' => null,
|
||||
'offset' => 8,
|
||||
'placement' => null,
|
||||
'shift' => false,
|
||||
'size' => false,
|
||||
'sizePadding' => 16,
|
||||
'teleport' => false,
|
||||
'trigger' => null,
|
||||
'width' => null,
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Enums\Width;
|
||||
|
||||
$sizeConfig = collect([
|
||||
'availableHeight' => $availableHeight,
|
||||
'availableWidth' => $availableWidth,
|
||||
'padding' => $sizePadding,
|
||||
])->filter()->toJson();
|
||||
|
||||
if (is_string($width)) {
|
||||
$width = Width::tryFrom($width) ?? $width;
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div
|
||||
x-data="filamentDropdown"
|
||||
{{ $attributes->class(['fi-dropdown']) }}
|
||||
>
|
||||
<div
|
||||
x-on:keyup.enter="toggle($event)"
|
||||
x-on:keyup.space="toggle($event)"
|
||||
x-on:mousedown="if ($event.button === 0) toggle($event)"
|
||||
{{ $trigger->attributes->class(['fi-dropdown-trigger']) }}
|
||||
>
|
||||
{{ $trigger }}
|
||||
</div>
|
||||
|
||||
@if (! \Filament\Support\is_slot_empty($slot))
|
||||
<div
|
||||
x-cloak
|
||||
x-float{{ $placement ? ".placement.{$placement}" : '' }}{{ $size ? '.size' : '' }}{{ $flip ? '.flip' : '' }}{{ $shift ? '.shift' : '' }}{{ $teleport ? '.teleport' : '' }}{{ $offset ? '.offset' : '' }}="{ offset: {{ $offset }}, {{ $size ? ('size: ' . $sizeConfig) : '' }} }"
|
||||
x-ref="panel"
|
||||
x-transition:enter-start="fi-opacity-0"
|
||||
x-transition:leave-end="fi-opacity-0"
|
||||
@if ($attributes->has('wire:key'))
|
||||
wire:ignore.self
|
||||
wire:key="{{ $attributes->get('wire:key') }}.panel"
|
||||
@endif
|
||||
@class([
|
||||
'fi-dropdown-panel',
|
||||
($width instanceof Width) ? "fi-width-{$width->value}" : (is_string($width) ? $width : ''),
|
||||
'fi-scrollable' => $maxHeight || $size,
|
||||
])
|
||||
@style([
|
||||
('max-height: ' . e($maxHeight)) => $maxHeight,
|
||||
])
|
||||
>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
3
vendor/filament/support/resources/views/components/dropdown/list/index.blade.php
vendored
Normal file
3
vendor/filament/support/resources/views/components/dropdown/list/index.blade.php
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<div {{ $attributes->class(['fi-dropdown-list']) }}>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
195
vendor/filament/support/resources/views/components/dropdown/list/item.blade.php
vendored
Normal file
195
vendor/filament/support/resources/views/components/dropdown/list/item.blade.php
vendored
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
@props([
|
||||
'alpineDeferredBadgeData' => null,
|
||||
'alpineDeferredBadgeLoading' => null,
|
||||
'badge' => null,
|
||||
'badgeColor' => 'primary',
|
||||
'badgeTooltip' => null,
|
||||
'color' => 'gray',
|
||||
'disabled' => false,
|
||||
'href' => null,
|
||||
'icon' => null,
|
||||
'iconAlias' => null,
|
||||
'iconColor' => null,
|
||||
'iconSize' => null,
|
||||
'image' => null,
|
||||
'keyBindings' => null,
|
||||
'loadingIndicator' => true,
|
||||
'spaMode' => null,
|
||||
'tag' => 'button',
|
||||
'target' => null,
|
||||
'tooltip' => null,
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Support\View\ComponentAttributeBag as FilamentComponentAttributeBag;
|
||||
use Filament\Support\View\Components\BadgeComponent;
|
||||
use Filament\Support\View\Components\DropdownComponent\ItemComponent;
|
||||
use Filament\Support\View\Components\DropdownComponent\ItemComponent\IconComponent;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
use Illuminate\View\ComponentAttributeBag;
|
||||
use Illuminate\View\ComponentSlot;
|
||||
|
||||
if (filled($iconSize) && (! $iconSize instanceof IconSize)) {
|
||||
$iconSize = IconSize::tryFrom($iconSize) ?? $iconSize;
|
||||
}
|
||||
|
||||
$iconColor ??= $color;
|
||||
|
||||
$wireTarget = $loadingIndicator ? $attributes->whereStartsWith(['wire:target', 'wire:click'])->filter(fn ($value): bool => filled($value))->first() : null;
|
||||
|
||||
$hasLoadingIndicator = filled($wireTarget);
|
||||
|
||||
if ($hasLoadingIndicator) {
|
||||
$loadingIndicatorTarget = html_entity_decode($wireTarget, ENT_QUOTES);
|
||||
}
|
||||
|
||||
$hasDeferredBadge = filled($alpineDeferredBadgeData);
|
||||
$hasTooltip = filled($tooltip);
|
||||
|
||||
$loadingDelay = ($icon || $hasLoadingIndicator)
|
||||
? config('filament.livewire_loading_delay', 'default')
|
||||
: null;
|
||||
@endphp
|
||||
|
||||
{!! ($tag === 'form') ? ('<form ' . $attributes->only(['action', 'class', 'method', 'wire:submit'])->toHtml() . '>') : '' !!}
|
||||
|
||||
@if ($tag === 'form')
|
||||
@csrf
|
||||
@endif
|
||||
|
||||
<{{ ($tag === 'form') ? 'button' : $tag }}
|
||||
@if (($tag === 'a') && (! ($disabled && $hasTooltip)))
|
||||
{{ \Filament\Support\generate_href_html($href, $target === '_blank', $spaMode) }}
|
||||
@endif
|
||||
@if ($keyBindings)
|
||||
x-bind:id="$id('key-bindings')"
|
||||
x-mousetrap.global.{{ collect($keyBindings)->map(fn (string $keyBinding): string => str_replace('+', '-', $keyBinding))->implode('.') }}="document.getElementById($el.id)?.click()"
|
||||
@endif
|
||||
@if ($hasTooltip)
|
||||
x-tooltip="{
|
||||
content: @js($tooltip),
|
||||
theme: $store.theme,
|
||||
allowHTML: @js($tooltip instanceof Htmlable),
|
||||
}"
|
||||
@endif
|
||||
{{
|
||||
$attributes
|
||||
->when(
|
||||
$tag === 'form',
|
||||
fn (ComponentAttributeBag $attributes) => $attributes->except(['action', 'class', 'method', 'wire:submit']),
|
||||
)
|
||||
->merge([
|
||||
'aria-disabled' => $disabled ? 'true' : null,
|
||||
'disabled' => $disabled && blank($tooltip),
|
||||
'type' => match ($tag) {
|
||||
'button' => 'button',
|
||||
'form' => 'submit',
|
||||
default => null,
|
||||
},
|
||||
'wire:loading.attr' => $tag === 'button' ? 'disabled' : null,
|
||||
'wire:target' => ($hasLoadingIndicator && $loadingIndicatorTarget) ? $loadingIndicatorTarget : null,
|
||||
], escape: false)
|
||||
->when(
|
||||
$disabled && $hasTooltip,
|
||||
fn (ComponentAttributeBag $attributes) => $attributes->filter(
|
||||
fn (mixed $value, string $key): bool => ! str($key)->startsWith(['href', 'x-on:', 'wire:click']),
|
||||
),
|
||||
)
|
||||
->class([
|
||||
'fi-dropdown-list-item',
|
||||
'fi-disabled' => $disabled,
|
||||
])
|
||||
->color(ItemComponent::class, $color)
|
||||
}}
|
||||
>
|
||||
@if ($icon || $iconAlias)
|
||||
{{
|
||||
\Filament\Support\generate_icon_html($icon, $iconAlias, (new FilamentComponentAttributeBag([
|
||||
'wire:loading.remove.delay.' . $loadingDelay => $hasLoadingIndicator,
|
||||
'wire:target' => $hasLoadingIndicator ? $loadingIndicatorTarget : false,
|
||||
]))->color(IconComponent::class, $iconColor), size: $iconSize)
|
||||
}}
|
||||
@endif
|
||||
|
||||
@if ($image)
|
||||
<div
|
||||
class="fi-dropdown-list-item-image"
|
||||
style="background-image: url('{{ $image }}')"
|
||||
@if ($hasLoadingIndicator)
|
||||
wire:loading.remove.delay.{{ $loadingDelay }}
|
||||
wire:target="{{ $loadingIndicatorTarget }}"
|
||||
@endif
|
||||
></div>
|
||||
@endif
|
||||
|
||||
@if ($hasLoadingIndicator)
|
||||
{{
|
||||
\Filament\Support\generate_loading_indicator_html((new FilamentComponentAttributeBag([
|
||||
'wire:loading.delay.' . $loadingDelay => '',
|
||||
'wire:target' => $loadingIndicatorTarget,
|
||||
]))->color(IconComponent::class, $iconColor), size: $iconSize)
|
||||
}}
|
||||
@endif
|
||||
|
||||
<span class="fi-dropdown-list-item-label">
|
||||
{{ $slot }}
|
||||
</span>
|
||||
|
||||
@if (filled($badge))
|
||||
@if ($badge instanceof ComponentSlot)
|
||||
{{ $badge }}
|
||||
@else
|
||||
<span
|
||||
@if ($badgeTooltip)
|
||||
x-tooltip="{
|
||||
content: @js($badgeTooltip),
|
||||
theme: $store.theme,
|
||||
allowHTML: @js($badgeTooltip instanceof Htmlable),
|
||||
}"
|
||||
@endif
|
||||
{{ (new FilamentComponentAttributeBag)->color(BadgeComponent::class, $badgeColor)->class(['fi-badge']) }}
|
||||
>
|
||||
{{ $badge }}
|
||||
</span>
|
||||
@endif
|
||||
@elseif ($hasDeferredBadge)
|
||||
<span
|
||||
x-show="{{ $alpineDeferredBadgeLoading }}"
|
||||
x-cloak
|
||||
class="fi-dropdown-list-item-badge-placeholder"
|
||||
>
|
||||
{{ \Filament\Support\generate_loading_indicator_html(size: IconSize::Small) }}
|
||||
</span>
|
||||
|
||||
<template
|
||||
x-if="
|
||||
! {{ $alpineDeferredBadgeLoading }} &&
|
||||
{{ $alpineDeferredBadgeData }}?.badge != null
|
||||
"
|
||||
>
|
||||
<span
|
||||
x-bind:class="'fi-badge ' + ({{ $alpineDeferredBadgeData }}?.badgeColorClasses ?? '')"
|
||||
x-bind:style="{{ $alpineDeferredBadgeData }}?.badgeColorStyles ?? ''"
|
||||
x-init="
|
||||
let tooltip = {{ $alpineDeferredBadgeData }}?.badgeTooltip
|
||||
if (tooltip) {
|
||||
window.tippy?.($el, {
|
||||
content: tooltip,
|
||||
theme: $store.theme,
|
||||
})
|
||||
}
|
||||
"
|
||||
>
|
||||
<span class="fi-badge-label-ctn">
|
||||
<span
|
||||
class="fi-badge-label"
|
||||
x-text="{{ $alpineDeferredBadgeData }}?.badge"
|
||||
></span>
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
@endif
|
||||
</{{ ($tag === 'form') ? 'button' : $tag }}>
|
||||
|
||||
{!! ($tag === 'form') ? '</form>' : '' !!}
|
||||
69
vendor/filament/support/resources/views/components/empty-state.blade.php
vendored
Normal file
69
vendor/filament/support/resources/views/components/empty-state.blade.php
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
@props([
|
||||
'compact' => false,
|
||||
'contained' => true,
|
||||
'description' => null,
|
||||
'footer' => null,
|
||||
'heading',
|
||||
'headingTag' => 'h2',
|
||||
'icon' => null,
|
||||
'iconColor' => 'primary',
|
||||
'iconSize' => null,
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Support\View\ComponentAttributeBag;
|
||||
use Filament\Support\View\Components\SectionComponent\IconComponent;
|
||||
|
||||
if (filled($iconSize) && (! $iconSize instanceof IconSize)) {
|
||||
$iconSize = IconSize::tryFrom($iconSize) ?? $iconSize;
|
||||
}
|
||||
|
||||
$hasDescription = filled((string) $description);
|
||||
$hasFooter = filled((string) $footer);
|
||||
$hasIcon = filled($icon);
|
||||
@endphp
|
||||
|
||||
<div
|
||||
{{
|
||||
$attributes->class([
|
||||
'fi-empty-state',
|
||||
'fi-compact' => $compact,
|
||||
'fi-empty-state-not-contained' => ! $contained,
|
||||
])
|
||||
}}
|
||||
>
|
||||
<div class="fi-empty-state-content">
|
||||
@if ($hasIcon)
|
||||
<div
|
||||
@class([
|
||||
'fi-empty-state-icon-bg',
|
||||
'fi-color ' . ('fi-color-' . $iconColor) => $iconColor !== 'gray',
|
||||
])
|
||||
>
|
||||
{{
|
||||
\Filament\Support\generate_icon_html($icon, attributes: (new ComponentAttributeBag)
|
||||
->color(IconComponent::class, $iconColor), size: $iconSize ?? IconSize::Large)
|
||||
}}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="fi-empty-state-text-ctn">
|
||||
<{{ $headingTag }} class="fi-empty-state-heading">
|
||||
{{ $heading }}
|
||||
</{{ $headingTag }}>
|
||||
|
||||
@if ($hasDescription)
|
||||
<p class="fi-empty-state-description">
|
||||
{{ $description }}
|
||||
</p>
|
||||
@endif
|
||||
|
||||
@if ($hasFooter)
|
||||
<footer class="fi-empty-state-footer">
|
||||
{{ $footer }}
|
||||
</footer>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
25
vendor/filament/support/resources/views/components/fieldset.blade.php
vendored
Normal file
25
vendor/filament/support/resources/views/components/fieldset.blade.php
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
@props([
|
||||
'contained' => true,
|
||||
'label' => null,
|
||||
'labelHidden' => false,
|
||||
'required' => false,
|
||||
])
|
||||
|
||||
<fieldset
|
||||
{{
|
||||
$attributes->class([
|
||||
'fi-fieldset',
|
||||
'fi-fieldset-label-hidden' => $labelHidden,
|
||||
'fi-fieldset-not-contained' => ! $contained,
|
||||
])
|
||||
}}
|
||||
>
|
||||
@if (filled($label))
|
||||
<legend>
|
||||
{{ $label }}@if ($required)<sup class="fi-fieldset-label-required-mark">*</sup>
|
||||
@endif
|
||||
</legend>
|
||||
@endif
|
||||
|
||||
{{ $slot }}
|
||||
</fieldset>
|
||||
147
vendor/filament/support/resources/views/components/icon-button.blade.php
vendored
Normal file
147
vendor/filament/support/resources/views/components/icon-button.blade.php
vendored
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
@props([
|
||||
'badge' => null,
|
||||
'badgeColor' => 'primary',
|
||||
'badgeSize' => null,
|
||||
'color' => 'primary',
|
||||
'disabled' => false,
|
||||
'form' => null,
|
||||
'formId' => null,
|
||||
'href' => null,
|
||||
'icon' => null,
|
||||
'iconAlias' => null,
|
||||
'iconSize' => null,
|
||||
'keyBindings' => null,
|
||||
'label' => null,
|
||||
'loadingIndicator' => true,
|
||||
'size' => null,
|
||||
'spaMode' => null,
|
||||
'tag' => 'button',
|
||||
'target' => null,
|
||||
'tooltip' => null,
|
||||
'type' => 'button',
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Support\Enums\Size;
|
||||
use Filament\Support\View\ComponentAttributeBag as FilamentComponentAttributeBag;
|
||||
use Filament\Support\View\Components\BadgeComponent;
|
||||
use Filament\Support\View\Components\IconButtonComponent;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
use Illuminate\View\ComponentAttributeBag;
|
||||
use Illuminate\View\ComponentSlot;
|
||||
|
||||
$badgeSize ??= Size::ExtraSmall;
|
||||
$size ??= Size::Medium;
|
||||
|
||||
if (! $size instanceof Size) {
|
||||
$size = filled($size) ? (Size::tryFrom($size) ?? $size) : null;
|
||||
}
|
||||
|
||||
if (! $badgeSize instanceof Size) {
|
||||
$badgeSize = filled($badgeSize) ? (Size::tryFrom($badgeSize) ?? $badgeSize) : null;
|
||||
}
|
||||
|
||||
if (filled($iconSize) && (! $iconSize instanceof IconSize)) {
|
||||
$iconSize = IconSize::tryFrom($iconSize) ?? $iconSize;
|
||||
}
|
||||
|
||||
$iconSize ??= match ($size) {
|
||||
Size::ExtraSmall => IconSize::Small,
|
||||
Size::Large, Size::ExtraLarge => IconSize::Large,
|
||||
default => null,
|
||||
};
|
||||
|
||||
$wireTarget = $loadingIndicator ? $attributes->whereStartsWith(['wire:target', 'wire:click'])->filter(fn ($value): bool => filled($value))->first() : null;
|
||||
|
||||
$hasLoadingIndicator = filled($wireTarget) || ($type === 'submit' && filled($form));
|
||||
|
||||
if ($hasLoadingIndicator) {
|
||||
$loadingIndicatorTarget = html_entity_decode($wireTarget ?: $form, ENT_QUOTES);
|
||||
}
|
||||
|
||||
$hasTooltip = $hasTooltip = filled($tooltip);
|
||||
|
||||
$loadingDelay = config('filament.livewire_loading_delay', 'default');
|
||||
@endphp
|
||||
|
||||
<{{ $tag }}
|
||||
@if (($tag === 'a') && (! ($disabled && $hasTooltip)))
|
||||
{{ \Filament\Support\generate_href_html($href, $target === '_blank', $spaMode) }}
|
||||
@endif
|
||||
@if ($keyBindings)
|
||||
x-bind:id="$id('key-bindings')"
|
||||
x-mousetrap.global.{{ collect($keyBindings)->map(fn (string $keyBinding): string => str_replace('+', '-', $keyBinding))->implode('.') }}="document.getElementById($el.id)?.click()"
|
||||
@endif
|
||||
@if ($hasTooltip)
|
||||
x-tooltip="{
|
||||
content: @js($tooltip),
|
||||
theme: $store.theme,
|
||||
allowHTML: @js($tooltip instanceof Htmlable),
|
||||
}"
|
||||
@endif
|
||||
{{
|
||||
$attributes
|
||||
->merge([
|
||||
'aria-disabled' => $disabled ? 'true' : null,
|
||||
// Security: These attributes are rendered without escaping, so the `aria-label` must be escaped here, otherwise an `Htmlable` label could break out of the attribute. `doubleEncode: false` preserves entities that Blade has already escaped in a string label.
|
||||
'aria-label' => filled($label) ? e(trim(strip_tags($label instanceof Htmlable ? $label->toHtml() : $label)), doubleEncode: false) : null,
|
||||
'disabled' => $disabled && blank($tooltip),
|
||||
'form' => $formId,
|
||||
'tabindex' => (($tag === 'a') && $disabled && $hasTooltip) ? '0' : null,
|
||||
'type' => $tag === 'button' ? $type : null,
|
||||
'wire:loading.attr' => $tag === 'button' ? 'disabled' : null,
|
||||
'wire:target' => ($hasLoadingIndicator && $loadingIndicatorTarget) ? $loadingIndicatorTarget : null,
|
||||
], escape: false)
|
||||
->merge([
|
||||
'title' => $hasTooltip ? null : $label,
|
||||
], escape: true)
|
||||
->when(
|
||||
$disabled && $hasTooltip,
|
||||
fn (ComponentAttributeBag $attributes) => $attributes->filter(
|
||||
fn (mixed $value, string $key): bool => ! str($key)->startsWith(['href', 'x-on:', 'wire:click']),
|
||||
),
|
||||
)
|
||||
->class([
|
||||
'fi-icon-btn',
|
||||
'fi-disabled' => $disabled,
|
||||
($size instanceof Size) ? "fi-size-{$size->value}" : (is_string($size) ? $size : ''),
|
||||
])
|
||||
->color(IconButtonComponent::class, $color)
|
||||
}}
|
||||
>
|
||||
{{
|
||||
\Filament\Support\generate_icon_html($icon, $iconAlias, (new Filament\Support\View\ComponentAttributeBag([
|
||||
'wire:loading.remove.delay.' . $loadingDelay => $hasLoadingIndicator,
|
||||
'wire:target' => $hasLoadingIndicator ? $loadingIndicatorTarget : false,
|
||||
])), size: $iconSize)
|
||||
}}
|
||||
|
||||
@if ($hasLoadingIndicator)
|
||||
{{
|
||||
\Filament\Support\generate_loading_indicator_html((new Filament\Support\View\ComponentAttributeBag([
|
||||
'wire:loading.delay.' . $loadingDelay => '',
|
||||
'wire:target' => $loadingIndicatorTarget,
|
||||
])), size: $iconSize)
|
||||
}}
|
||||
@endif
|
||||
|
||||
@if (filled($badge))
|
||||
<div class="fi-icon-btn-badge-ctn">
|
||||
@if ($badge instanceof ComponentSlot)
|
||||
{{ $badge }}
|
||||
@else
|
||||
<span
|
||||
{{
|
||||
(new FilamentComponentAttributeBag)->color(BadgeComponent::class, $badgeColor)->class([
|
||||
'fi-badge',
|
||||
($badgeSize instanceof Size) ? "fi-size-{$badgeSize->value}" : (is_string($badgeSize) ? $badgeSize : ''),
|
||||
])
|
||||
}}
|
||||
>
|
||||
{{ $badge }}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</{{ $tag }}>
|
||||
7
vendor/filament/support/resources/views/components/icon.blade.php
vendored
Normal file
7
vendor/filament/support/resources/views/components/icon.blade.php
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
@props([
|
||||
'alias' => null,
|
||||
'icon' => null,
|
||||
'size' => null,
|
||||
])
|
||||
|
||||
{{ \Filament\Support\generate_icon_html($icon, $alias, $attributes, $size) }}
|
||||
26
vendor/filament/support/resources/views/components/input/checkbox.blade.php
vendored
Normal file
26
vendor/filament/support/resources/views/components/input/checkbox.blade.php
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
@props([
|
||||
'alpineValid' => null,
|
||||
'valid' => true,
|
||||
])
|
||||
|
||||
@php
|
||||
$hasAlpineValidClasses = filled($alpineValid);
|
||||
@endphp
|
||||
|
||||
<input
|
||||
type="checkbox"
|
||||
@if ($hasAlpineValidClasses)
|
||||
x-bind:class="{
|
||||
'fi-valid': {{ $alpineValid }},
|
||||
'fi-invalid': {{ "(! {$alpineValid})" }},
|
||||
}"
|
||||
@endif
|
||||
{{
|
||||
$attributes
|
||||
->class([
|
||||
'fi-checkbox-input',
|
||||
'fi-valid' => (! $hasAlpineValidClasses) && $valid,
|
||||
'fi-invalid' => (! $hasAlpineValidClasses) && (! $valid),
|
||||
])
|
||||
}}
|
||||
/>
|
||||
14
vendor/filament/support/resources/views/components/input/index.blade.php
vendored
Normal file
14
vendor/filament/support/resources/views/components/input/index.blade.php
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
@props([
|
||||
'inlinePrefix' => false,
|
||||
'inlineSuffix' => false,
|
||||
])
|
||||
|
||||
<input
|
||||
{{
|
||||
$attributes->class([
|
||||
'fi-input',
|
||||
'fi-input-has-inline-prefix' => $inlinePrefix,
|
||||
'fi-input-has-inline-suffix' => $inlineSuffix,
|
||||
])
|
||||
}}
|
||||
/>
|
||||
39
vendor/filament/support/resources/views/components/input/one-time-code.blade.php
vendored
Normal file
39
vendor/filament/support/resources/views/components/input/one-time-code.blade.php
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
@props([
|
||||
'length' => 6,
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\View\ComponentAttributeBag;
|
||||
|
||||
$inputAttributes = $input?->attributes ?? new ComponentAttributeBag;
|
||||
$isDisabled = filter_var($inputAttributes->get('disabled'), FILTER_VALIDATE_BOOLEAN);
|
||||
$isReadOnly = filter_var($inputAttributes->get('readonly'), FILTER_VALIDATE_BOOLEAN);
|
||||
@endphp
|
||||
|
||||
<div
|
||||
x-data="filamentOneTimeCodeInput"
|
||||
x-modelable="state"
|
||||
role="group"
|
||||
{{ $attributes->class(['fi-one-time-code-input-ctn']) }}
|
||||
>
|
||||
@foreach (range(0, $length - 1) as $index)
|
||||
@if ($index === 0)
|
||||
<input
|
||||
autocomplete="one-time-code"
|
||||
inputmode="numeric"
|
||||
type="text"
|
||||
{{ $inputAttributes->class(['fi-one-time-code-input-digit']) }}
|
||||
/>
|
||||
@else
|
||||
<input
|
||||
aria-label="{{ __('filament::components/input/one-time-code.aria_label', ['position' => $index + 1, 'count' => $length]) }}"
|
||||
autocomplete="off"
|
||||
inputmode="numeric"
|
||||
type="text"
|
||||
@disabled($isDisabled)
|
||||
@readonly($isReadOnly)
|
||||
class="fi-one-time-code-input-digit"
|
||||
/>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
14
vendor/filament/support/resources/views/components/input/radio.blade.php
vendored
Normal file
14
vendor/filament/support/resources/views/components/input/radio.blade.php
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
@props([
|
||||
'valid' => true,
|
||||
])
|
||||
|
||||
<input
|
||||
type="radio"
|
||||
{{
|
||||
$attributes
|
||||
->class([
|
||||
'fi-radio-input',
|
||||
'fi-invalid' => ! $valid,
|
||||
])
|
||||
}}
|
||||
/>
|
||||
15
vendor/filament/support/resources/views/components/input/select.blade.php
vendored
Normal file
15
vendor/filament/support/resources/views/components/input/select.blade.php
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
@props([
|
||||
'inlinePrefix' => false,
|
||||
'inlineSuffix' => false,
|
||||
])
|
||||
|
||||
<select
|
||||
{{
|
||||
$attributes->class([
|
||||
'fi-select-input',
|
||||
'fi-select-input-has-inline-prefix' => $inlinePrefix,
|
||||
])
|
||||
}}
|
||||
>
|
||||
{{ $slot }}
|
||||
</select>
|
||||
189
vendor/filament/support/resources/views/components/input/wrapper.blade.php
vendored
Normal file
189
vendor/filament/support/resources/views/components/input/wrapper.blade.php
vendored
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
@props([
|
||||
'alpineDisabled' => null,
|
||||
'alpineValid' => null,
|
||||
'disabled' => false,
|
||||
'inlinePrefix' => false,
|
||||
'inlineSuffix' => false,
|
||||
'prefix' => null,
|
||||
'prefixActions' => [],
|
||||
'prefixIcon' => null,
|
||||
'prefixIconColor' => 'gray',
|
||||
'prefixIconAlias' => null,
|
||||
'suffix' => null,
|
||||
'suffixActions' => [],
|
||||
'suffixIcon' => null,
|
||||
'suffixIconColor' => 'gray',
|
||||
'suffixIconAlias' => null,
|
||||
'valid' => true,
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Support\View\ComponentAttributeBag;
|
||||
use Filament\Support\View\Components\InputComponent\WrapperComponent\IconComponent;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$prefixActions = array_filter(
|
||||
$prefixActions,
|
||||
fn (Action $prefixAction): bool => $prefixAction->isVisible(),
|
||||
);
|
||||
|
||||
$suffixActions = array_filter(
|
||||
$suffixActions,
|
||||
fn (Action $suffixAction): bool => $suffixAction->isVisible(),
|
||||
);
|
||||
|
||||
$hasAlpineDisabledClasses = filled($alpineDisabled);
|
||||
$hasAlpineValidClasses = filled($alpineValid);
|
||||
$hasAlpineClasses = $hasAlpineDisabledClasses || $hasAlpineValidClasses;
|
||||
|
||||
$wireTarget = $attributes->whereStartsWith(['wire:target'])->first();
|
||||
|
||||
$hasLoadingIndicator = filled($wireTarget);
|
||||
|
||||
if ($hasLoadingIndicator) {
|
||||
$loadingIndicatorTarget = html_entity_decode($wireTarget, ENT_QUOTES);
|
||||
}
|
||||
|
||||
$loadingDelay = ($prefixIcon || $prefixIconAlias || $suffixIcon || $suffixIconAlias || $hasLoadingIndicator)
|
||||
? config('filament.livewire_loading_delay', 'default')
|
||||
: null;
|
||||
|
||||
$prefixIconHtml = ($prefixIcon || $prefixIconAlias)
|
||||
? \Filament\Support\generate_icon_html($prefixIcon, $prefixIconAlias, (new ComponentAttributeBag)
|
||||
->merge([
|
||||
'wire:loading.remove.delay.' . $loadingDelay => $hasLoadingIndicator,
|
||||
'wire:target' => $hasLoadingIndicator ? $loadingIndicatorTarget : false,
|
||||
], escape: false)
|
||||
->color(IconComponent::class, $prefixIconColor))
|
||||
: null;
|
||||
|
||||
$suffixIconHtml = ($suffixIcon || $suffixIconAlias)
|
||||
? \Filament\Support\generate_icon_html($suffixIcon, $suffixIconAlias, (new ComponentAttributeBag)
|
||||
->merge([
|
||||
'wire:loading.remove.delay.' . $loadingDelay => $hasLoadingIndicator,
|
||||
'wire:target' => $hasLoadingIndicator ? $loadingIndicatorTarget : false,
|
||||
], escape: false)
|
||||
->color(IconComponent::class, $suffixIconColor))
|
||||
: null;
|
||||
|
||||
$hasPrefix = count($prefixActions) || ($prefixIconHtml !== null) || filled($prefix);
|
||||
$hasSuffix = count($suffixActions) || ($suffixIconHtml !== null) || filled($suffix);
|
||||
|
||||
$hasFocusInputListener = $attributes->has('x-on:focus-input.stop');
|
||||
$canClickPrefixAffix = $hasFocusInputListener && (($prefixIconHtml !== null) || filled($prefix));
|
||||
$canClickSuffixAffix = $hasFocusInputListener && (($suffixIconHtml !== null) || filled($suffix));
|
||||
@endphp
|
||||
|
||||
<div
|
||||
@if ($hasAlpineClasses)
|
||||
x-bind:class="{
|
||||
{{ $hasAlpineDisabledClasses ? "'fi-disabled': {$alpineDisabled}," : null }}
|
||||
{{ $hasAlpineValidClasses ? "'fi-invalid': ! ({$alpineValid})," : null }}
|
||||
}"
|
||||
@endif
|
||||
{{
|
||||
$attributes
|
||||
->except(['wire:target', 'tabindex'])
|
||||
->class([
|
||||
'fi-input-wrp',
|
||||
'fi-disabled' => (! $hasAlpineClasses) && $disabled,
|
||||
'fi-invalid' => (! $hasAlpineClasses) && (! $valid),
|
||||
])
|
||||
}}
|
||||
>
|
||||
@if ($hasPrefix || $hasLoadingIndicator)
|
||||
<div
|
||||
@if (! $hasPrefix)
|
||||
wire:loading.delay.{{ $loadingDelay }}.flex
|
||||
wire:target="{{ $loadingIndicatorTarget }}"
|
||||
wire:key="{{ Str::random() }}" {{-- Makes sure the loading indicator gets hidden again. --}}
|
||||
@endif
|
||||
@if ($canClickPrefixAffix)
|
||||
x-on:click="$dispatch('focus-input')"
|
||||
@endif
|
||||
@class([
|
||||
'fi-input-wrp-prefix',
|
||||
'fi-input-wrp-prefix-has-content' => $hasPrefix,
|
||||
'fi-inline' => $inlinePrefix,
|
||||
'fi-input-wrp-prefix-has-label' => filled($prefix),
|
||||
])
|
||||
>
|
||||
@if (count($prefixActions))
|
||||
<div
|
||||
@class(['fi-input-wrp-actions'])
|
||||
@if ($canClickPrefixAffix) x-on:click.stop @endif
|
||||
>
|
||||
@foreach ($prefixActions as $prefixAction)
|
||||
{{ $prefixAction }}
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{ $prefixIconHtml }}
|
||||
|
||||
@if ($hasLoadingIndicator)
|
||||
{{
|
||||
\Filament\Support\generate_loading_indicator_html((new ComponentAttributeBag([
|
||||
'wire:loading.delay.' . $loadingDelay => $hasPrefix,
|
||||
'wire:target' => $hasPrefix ? $loadingIndicatorTarget : null,
|
||||
]))->color(IconComponent::class, 'gray'))
|
||||
}}
|
||||
@endif
|
||||
|
||||
@if (filled($prefix))
|
||||
<span class="fi-input-wrp-label">
|
||||
{{ $prefix }}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div
|
||||
@if ($hasLoadingIndicator && (! $hasPrefix))
|
||||
@if ($inlinePrefix)
|
||||
wire:loading.delay.{{ $loadingDelay }}.class.remove="ps-3"
|
||||
@endif
|
||||
|
||||
wire:target="{{ $loadingIndicatorTarget }}"
|
||||
@endif
|
||||
@class([
|
||||
'fi-input-wrp-content-ctn',
|
||||
'fi-input-wrp-content-ctn-ps' => $hasLoadingIndicator && (! $hasPrefix) && $inlinePrefix,
|
||||
])
|
||||
>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
|
||||
@if ($hasSuffix)
|
||||
<div
|
||||
@if ($canClickSuffixAffix)
|
||||
x-on:click="$dispatch('focus-input')"
|
||||
@endif
|
||||
@class([
|
||||
'fi-input-wrp-suffix',
|
||||
'fi-inline' => $inlineSuffix,
|
||||
'fi-input-wrp-suffix-has-label' => filled($suffix),
|
||||
])
|
||||
>
|
||||
@if (filled($suffix))
|
||||
<span class="fi-input-wrp-label">
|
||||
{{ $suffix }}
|
||||
</span>
|
||||
@endif
|
||||
|
||||
{{ $suffixIconHtml }}
|
||||
|
||||
@if (count($suffixActions))
|
||||
<div
|
||||
@class(['fi-input-wrp-actions'])
|
||||
@if ($canClickSuffixAffix) x-on:click.stop @endif
|
||||
>
|
||||
@foreach ($suffixActions as $suffixAction)
|
||||
{{ $suffixAction }}
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
191
vendor/filament/support/resources/views/components/link.blade.php
vendored
Normal file
191
vendor/filament/support/resources/views/components/link.blade.php
vendored
Normal file
|
|
@ -0,0 +1,191 @@
|
|||
@props([
|
||||
'badge' => null,
|
||||
'badgeColor' => 'primary',
|
||||
'badgeSize' => null,
|
||||
'color' => 'primary',
|
||||
'disabled' => false,
|
||||
'form' => null,
|
||||
'formId' => null,
|
||||
'href' => null,
|
||||
'icon' => null,
|
||||
'iconAlias' => null,
|
||||
'iconPosition' => null,
|
||||
'iconSize' => null,
|
||||
'keyBindings' => null,
|
||||
'labelSrOnly' => false,
|
||||
'loadingIndicator' => true,
|
||||
'size' => null,
|
||||
'spaMode' => null,
|
||||
'tag' => 'a',
|
||||
'target' => null,
|
||||
'tooltip' => null,
|
||||
'type' => 'button',
|
||||
'weight' => null,
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Enums\FontWeight;
|
||||
use Filament\Support\Enums\IconPosition;
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Support\Enums\Size;
|
||||
use Filament\Support\View\ComponentAttributeBag as FilamentComponentAttributeBag;
|
||||
use Filament\Support\View\Components\BadgeComponent;
|
||||
use Filament\Support\View\Components\LinkComponent;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
use Illuminate\View\ComponentAttributeBag;
|
||||
use Illuminate\View\ComponentSlot;
|
||||
|
||||
$badgeSize ??= Size::ExtraSmall;
|
||||
$iconPosition ??= IconPosition::Before;
|
||||
$size ??= Size::Medium;
|
||||
|
||||
if (! $iconPosition instanceof IconPosition) {
|
||||
$iconPosition = filled($iconPosition) ? (IconPosition::tryFrom($iconPosition) ?? $iconPosition) : null;
|
||||
}
|
||||
|
||||
if (! $badgeSize instanceof Size) {
|
||||
$badgeSize = filled($badgeSize) ? (Size::tryFrom($badgeSize) ?? $badgeSize) : null;
|
||||
}
|
||||
|
||||
if (! $size instanceof Size) {
|
||||
$size = filled($size) ? (Size::tryFrom($size) ?? $size) : null;
|
||||
}
|
||||
|
||||
if (filled($iconSize) && (! $iconSize instanceof IconSize)) {
|
||||
$iconSize = IconSize::tryFrom($iconSize) ?? $iconSize;
|
||||
}
|
||||
|
||||
$iconSize ??= match ($size) {
|
||||
Size::ExtraSmall, Size::Small => IconSize::Small,
|
||||
default => null,
|
||||
};
|
||||
|
||||
if (! $weight instanceof FontWeight) {
|
||||
$weight = filled($weight) ? (FontWeight::tryFrom($weight) ?? $weight) : null;
|
||||
}
|
||||
|
||||
$wireTarget = $loadingIndicator ? $attributes->whereStartsWith(['wire:target', 'wire:click'])->filter(fn ($value): bool => filled($value))->first() : null;
|
||||
|
||||
$hasLoadingIndicator = filled($wireTarget) || ($type === 'submit' && filled($form));
|
||||
|
||||
if ($hasLoadingIndicator) {
|
||||
$loadingIndicatorTarget = html_entity_decode($wireTarget ?: $form, ENT_QUOTES);
|
||||
}
|
||||
|
||||
$hasTooltip = filled($tooltip);
|
||||
|
||||
$loadingDelay = ($icon || $hasLoadingIndicator)
|
||||
? config('filament.livewire_loading_delay', 'default')
|
||||
: null;
|
||||
@endphp
|
||||
|
||||
<{{ $tag }}
|
||||
@if (($tag === 'a') && (! ($disabled && $hasTooltip)))
|
||||
{{ \Filament\Support\generate_href_html($href, $target === '_blank', $spaMode) }}
|
||||
@endif
|
||||
@if ($keyBindings)
|
||||
x-bind:id="$id('key-bindings')"
|
||||
x-mousetrap.global.{{ collect($keyBindings)->map(fn (string $keyBinding): string => str_replace('+', '-', $keyBinding))->implode('.') }}="document.getElementById($el.id)?.click()"
|
||||
@endif
|
||||
@if ($hasTooltip)
|
||||
x-tooltip="{
|
||||
content: @js($tooltip),
|
||||
theme: $store.theme,
|
||||
allowHTML: @js($tooltip instanceof Htmlable),
|
||||
}"
|
||||
@endif
|
||||
{{
|
||||
$attributes
|
||||
->merge([
|
||||
'aria-disabled' => $disabled ? 'true' : null,
|
||||
// Security: These attributes are rendered without escaping, so the `aria-label` must be escaped here, otherwise an `Htmlable` label could break out of the attribute. `doubleEncode: false` preserves entities that Blade has already escaped in the slot.
|
||||
'aria-label' => $labelSrOnly
|
||||
? e(trim(strip_tags($slot->toHtml())), doubleEncode: false)
|
||||
: null,
|
||||
'disabled' => $disabled && blank($tooltip),
|
||||
'form' => $formId,
|
||||
'type' => $tag === 'button' ? $type : null,
|
||||
'wire:loading.attr' => $tag === 'button' ? 'disabled' : null,
|
||||
'wire:target' => ($hasLoadingIndicator && $loadingIndicatorTarget) ? $loadingIndicatorTarget : null,
|
||||
], escape: false)
|
||||
->when(
|
||||
$disabled && $hasTooltip,
|
||||
fn (ComponentAttributeBag $attributes) => $attributes->filter(
|
||||
fn (mixed $value, string $key): bool => ! str($key)->startsWith(['href', 'x-on:', 'wire:click']),
|
||||
),
|
||||
)
|
||||
->class([
|
||||
'fi-link',
|
||||
'fi-disabled' => $disabled,
|
||||
($size instanceof Size) ? "fi-size-{$size->value}" : (is_string($size) ? $size : ''),
|
||||
($weight instanceof FontWeight) ? "fi-font-{$weight->value}" : (is_string($weight) ? $weight : ''),
|
||||
])
|
||||
->color(LinkComponent::class, $color)
|
||||
}}
|
||||
>
|
||||
@if ($iconPosition === IconPosition::Before)
|
||||
@if ($icon || $iconAlias)
|
||||
{{
|
||||
\Filament\Support\generate_icon_html($icon, $iconAlias, (new Filament\Support\View\ComponentAttributeBag([
|
||||
'wire:loading.remove.delay.' . $loadingDelay => $hasLoadingIndicator,
|
||||
'wire:target' => $hasLoadingIndicator ? $loadingIndicatorTarget : false,
|
||||
])), size: $iconSize)
|
||||
}}
|
||||
@endif
|
||||
|
||||
@if ($hasLoadingIndicator)
|
||||
{{
|
||||
\Filament\Support\generate_loading_indicator_html((new Filament\Support\View\ComponentAttributeBag([
|
||||
'wire:loading.delay.' . $loadingDelay => '',
|
||||
'wire:target' => $loadingIndicatorTarget,
|
||||
])), size: $iconSize)
|
||||
}}
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if (! $labelSrOnly)
|
||||
<span class="fi-link-label">
|
||||
{{ $slot }}
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if ($iconPosition === IconPosition::After)
|
||||
@if ($icon || $iconAlias)
|
||||
{{
|
||||
\Filament\Support\generate_icon_html($icon, $iconAlias, (new Filament\Support\View\ComponentAttributeBag([
|
||||
'wire:loading.remove.delay.' . $loadingDelay => $hasLoadingIndicator,
|
||||
'wire:target' => $hasLoadingIndicator ? $loadingIndicatorTarget : false,
|
||||
])), size: $iconSize)
|
||||
}}
|
||||
@endif
|
||||
|
||||
@if ($hasLoadingIndicator)
|
||||
{{
|
||||
\Filament\Support\generate_loading_indicator_html((new Filament\Support\View\ComponentAttributeBag([
|
||||
'wire:loading.delay.' . $loadingDelay => '',
|
||||
'wire:target' => $loadingIndicatorTarget,
|
||||
])), size: $iconSize)
|
||||
}}
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if (filled($badge))
|
||||
<div class="fi-link-badge-ctn">
|
||||
@if ($badge instanceof ComponentSlot)
|
||||
{{ $badge }}
|
||||
@else
|
||||
<span
|
||||
{{
|
||||
(new FilamentComponentAttributeBag)->color(BadgeComponent::class, $badgeColor)->class([
|
||||
'fi-badge',
|
||||
($badgeSize instanceof Size) ? "fi-size-{$badgeSize->value}" : (is_string($badgeSize) ? $badgeSize : ''),
|
||||
])
|
||||
}}
|
||||
>
|
||||
{{ $badge }}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</{{ $tag }}>
|
||||
@trim
|
||||
1
vendor/filament/support/resources/views/components/loading-indicator.blade.php
vendored
Normal file
1
vendor/filament/support/resources/views/components/loading-indicator.blade.php
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{{ \Filament\Support\generate_loading_indicator_html($attributes) }}
|
||||
25
vendor/filament/support/resources/views/components/loading-section.blade.php
vendored
Normal file
25
vendor/filament/support/resources/views/components/loading-section.blade.php
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
@props([
|
||||
'columnSpan' => [],
|
||||
'columnStart' => [],
|
||||
'height' => null,
|
||||
'loadingLabel' => null,
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\View\ComponentAttributeBag;
|
||||
@endphp
|
||||
|
||||
<div
|
||||
role="status"
|
||||
aria-busy="true"
|
||||
{{
|
||||
($attributes ?? new ComponentAttributeBag)
|
||||
->gridColumn($columnSpan, $columnStart)
|
||||
->class(['fi-section fi-loading-section'])
|
||||
->style(['height: ' . e($height ?? '8rem')])
|
||||
}}
|
||||
>
|
||||
<span class="fi-sr-only">
|
||||
{{ $loadingLabel ?? __('filament::components/loading-section.label') }}
|
||||
</span>
|
||||
</div>
|
||||
5
vendor/filament/support/resources/views/components/modal/description.blade.php
vendored
Normal file
5
vendor/filament/support/resources/views/components/modal/description.blade.php
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<p
|
||||
{{ $attributes->class(['fi-modal-description']) }}
|
||||
>
|
||||
{{ $slot }}
|
||||
</p>
|
||||
14
vendor/filament/support/resources/views/components/modal/heading.blade.php
vendored
Normal file
14
vendor/filament/support/resources/views/components/modal/heading.blade.php
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
@props([
|
||||
'level' => 2,
|
||||
])
|
||||
|
||||
@php
|
||||
$level = max(1, (int) $level);
|
||||
$headingTag = ($level > 6) ? 'p' : "h{$level}";
|
||||
@endphp
|
||||
|
||||
<{{ $headingTag }}
|
||||
{{ $attributes->class(['fi-modal-heading']) }}
|
||||
>
|
||||
{{ $slot }}
|
||||
</{{ $headingTag }}>
|
||||
340
vendor/filament/support/resources/views/components/modal/index.blade.php
vendored
Normal file
340
vendor/filament/support/resources/views/components/modal/index.blade.php
vendored
Normal file
|
|
@ -0,0 +1,340 @@
|
|||
@props([
|
||||
'alert' => false,
|
||||
'alignment' => null,
|
||||
'ariaLabelledby' => null,
|
||||
'autofocus' => null,
|
||||
'clickThrough' => false,
|
||||
'closeButton' => null,
|
||||
'closeByClickingAway' => null,
|
||||
'closeByEscaping' => null,
|
||||
'closeEventName' => 'close-modal',
|
||||
'closeQuietlyEventName' => 'close-modal-quietly',
|
||||
'description' => null,
|
||||
'restoresFocus' => true,
|
||||
'extraModalWindowAttributeBag' => null,
|
||||
'extraModalOverlayAttributeBag' => null,
|
||||
'footer' => null,
|
||||
'footerActions' => [],
|
||||
'footerActionsAlignment' => null,
|
||||
'header' => null,
|
||||
'heading' => null,
|
||||
'icon' => null,
|
||||
'iconAlias' => null,
|
||||
'iconColor' => 'primary',
|
||||
'id' => null,
|
||||
'openEventName' => 'open-modal',
|
||||
'slideOver' => false,
|
||||
'slideOverPosition' => null,
|
||||
'stickyFooter' => false,
|
||||
'stickyHeader' => false,
|
||||
'teleport' => null,
|
||||
'trigger' => null,
|
||||
'visible' => true,
|
||||
'width' => 'sm',
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Enums\Alignment;
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Support\Enums\SlideOverPosition;
|
||||
use Filament\Support\Enums\Width;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Support\View\ComponentAttributeBag as FilamentComponentAttributeBag;
|
||||
use Filament\Support\View\Components\ModalComponent;
|
||||
use Filament\Support\View\Components\ModalComponent\IconComponent;
|
||||
use Filament\Support\View\SupportIconAlias;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
use Illuminate\Support\Js;
|
||||
|
||||
$alignment ??= Alignment::Start;
|
||||
$autofocus ??= ModalComponent::$isAutofocused;
|
||||
$closeButton ??= ModalComponent::$hasCloseButton;
|
||||
$closeByClickingAway ??= ModalComponent::$isClosedByClickingAway;
|
||||
$closeByEscaping ??= ModalComponent::$isClosedByEscaping;
|
||||
$footerActionsAlignment ??= Alignment::Start;
|
||||
$slideOverPosition ??= SlideOverPosition::End;
|
||||
|
||||
$hasContent = ! \Filament\Support\is_slot_empty($slot);
|
||||
$hasDescription = filled($description);
|
||||
$hasFooter = (! \Filament\Support\is_slot_empty($footer)) || (is_array($footerActions) && count($footerActions)) || (! is_array($footerActions) && (! \Filament\Support\is_slot_empty($footerActions)));
|
||||
$hasHeading = filled($heading);
|
||||
$iconHtml = ($icon || $iconAlias) ? \Filament\Support\generate_icon_html($icon, $iconAlias, size: IconSize::Large) : null;
|
||||
$hasIcon = $iconHtml !== null;
|
||||
|
||||
$headingId = filled($id) ? "{$id}.heading" : null;
|
||||
|
||||
// The description is only rendered when the built-in heading is, so the
|
||||
// `aria-describedby` reference must be gated to the same conditions.
|
||||
$descriptionId = ($hasDescription && $hasHeading && (! $header) && filled($id)) ? "{$id}.description" : null;
|
||||
|
||||
if (! $alignment instanceof Alignment) {
|
||||
$alignment = filled($alignment) ? (Alignment::tryFrom($alignment) ?? $alignment) : null;
|
||||
}
|
||||
|
||||
if (! $footerActionsAlignment instanceof Alignment) {
|
||||
$footerActionsAlignment = filled($footerActionsAlignment) ? (Alignment::tryFrom($footerActionsAlignment) ?? $footerActionsAlignment) : null;
|
||||
}
|
||||
|
||||
if (is_string($width)) {
|
||||
$width = Width::tryFrom($width) ?? $width;
|
||||
}
|
||||
|
||||
$closeEventHandler = filled($id) ? '$dispatch(' . Js::from($closeEventName) . ', { id: ' . Js::from($id) . ' })' : 'close()';
|
||||
|
||||
$wireSubmitHandler = $attributes->get('wire:submit.prevent');
|
||||
$attributes = $attributes->except(['wire:submit.prevent']);
|
||||
|
||||
$isClickThrough = (bool) $clickThrough;
|
||||
|
||||
// Click-through and closing by clicking away are incompatible, so enabling
|
||||
// click-through silently disables closing the modal by clicking away.
|
||||
if ($isClickThrough) {
|
||||
$closeByClickingAway = false;
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if ($trigger)
|
||||
{!! '<div>' !!}
|
||||
{{-- Avoid formatting issues with unclosed elements --}}
|
||||
|
||||
<div
|
||||
@if (! $trigger->attributes->get('disabled'))
|
||||
@if ($id)
|
||||
x-on:click="$dispatch(@js($openEventName), { id: @js($id) })"
|
||||
@else
|
||||
x-on:click="$el.nextElementSibling.dispatchEvent(new CustomEvent(@js($openEventName)))"
|
||||
@endif
|
||||
@endif
|
||||
{{ $trigger->attributes->except(['disabled'])->class(['fi-modal-trigger']) }}
|
||||
>
|
||||
{{ $trigger }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (filled($teleport))
|
||||
{!! "<template x-teleport=\"{$teleport}\">" !!}
|
||||
{{-- Avoid formatting issues with unclosed elements --}}
|
||||
@endif
|
||||
|
||||
<div
|
||||
@if ($descriptionId)
|
||||
aria-describedby="{{ $descriptionId }}"
|
||||
@endif
|
||||
@if ($ariaLabelledby)
|
||||
aria-labelledby="{{ $ariaLabelledby }}"
|
||||
@elseif ($hasHeading && $headingId)
|
||||
aria-labelledby="{{ $headingId }}"
|
||||
@elseif ($hasHeading)
|
||||
aria-label="{{ trim(strip_tags($heading instanceof Htmlable ? $heading->toHtml() : $heading)) }}"
|
||||
@endif
|
||||
aria-modal="{{ $isClickThrough ? 'false' : 'true' }}"
|
||||
id="{{ $id }}"
|
||||
role="{{ $alert ? 'alertdialog' : 'dialog' }}"
|
||||
tabindex="-1"
|
||||
x-data="filamentModal({
|
||||
id: @js($id),
|
||||
isScrollLocked: @js(! $isClickThrough),
|
||||
shouldRestoreFocus: @js($restoresFocus && (! $isClickThrough)),
|
||||
})"
|
||||
@if ($id)
|
||||
data-fi-modal-id="{{ $id }}"
|
||||
x-on:{{ $closeEventName }}.window="if (($event.detail.id === @js($id)) && isOpen) close()"
|
||||
x-on:{{ $closeQuietlyEventName }}.window="if (($event.detail.id === @js($id)) && isOpen) closeQuietly()"
|
||||
x-on:{{ $openEventName }}.window="if (($event.detail.id === @js($id)) && (! isOpen)) open()"
|
||||
@else
|
||||
x-on:{{ $closeEventName }}.stop="if (isOpen) close()"
|
||||
x-on:{{ $closeQuietlyEventName }}.stop="if (isOpen) closeQuietly()"
|
||||
x-on:{{ $openEventName }}.stop="if (! isOpen) open()"
|
||||
@endif
|
||||
x-bind:class="{
|
||||
'fi-modal-open': isOpen,
|
||||
}"
|
||||
x-cloak
|
||||
x-show="isOpen"
|
||||
{{
|
||||
$attributes->class([
|
||||
'fi-modal',
|
||||
'fi-absolute-positioning-context',
|
||||
'fi-modal-slide-over' => $slideOver,
|
||||
'fi-modal-slide-over-from-start' => $slideOver && $slideOverPosition === SlideOverPosition::Start,
|
||||
'fi-modal-slide-over-from-end' => $slideOver && $slideOverPosition === SlideOverPosition::End,
|
||||
'fi-modal-has-sticky-header' => $stickyHeader,
|
||||
'fi-modal-has-sticky-footer' => $stickyFooter,
|
||||
'fi-width-screen' => $width === Width::Screen,
|
||||
'fi-modal-click-through' => $isClickThrough,
|
||||
])
|
||||
}}
|
||||
>
|
||||
@if (! $isClickThrough)
|
||||
<div
|
||||
aria-hidden="true"
|
||||
x-show="isOpen"
|
||||
x-transition.duration.300ms.opacity
|
||||
{{
|
||||
($extraModalOverlayAttributeBag ?? new FilamentComponentAttributeBag)->class([
|
||||
'fi-modal-close-overlay',
|
||||
])
|
||||
}}
|
||||
></div>
|
||||
@endif
|
||||
|
||||
<div
|
||||
tabindex="-1"
|
||||
@if ($closeByClickingAway)
|
||||
x-on:click.self="{{ $closeEventHandler }}"
|
||||
@endif
|
||||
@if (! $isClickThrough)
|
||||
x-trap.noreturn{{ $autofocus ? '' : '.noautofocus' }}="isTrapActive"
|
||||
@endif
|
||||
@class([
|
||||
'fi-modal-window-ctn',
|
||||
'fi-clickable' => $closeByClickingAway,
|
||||
])
|
||||
>
|
||||
<{{ filled($wireSubmitHandler) ? 'form' : 'div' }}
|
||||
@if ($closeByEscaping)
|
||||
x-on:keydown.window.escape="if (isTopmost()) {{ $closeEventHandler }}"
|
||||
@endif
|
||||
x-show="isWindowVisible"
|
||||
x-transition:enter="fi-transition-enter"
|
||||
x-transition:leave="fi-transition-leave"
|
||||
@if ($width !== Width::Screen)
|
||||
x-transition:enter-start="fi-transition-enter-start"
|
||||
x-transition:enter-end="fi-transition-enter-end"
|
||||
x-transition:leave-start="fi-transition-leave-start"
|
||||
x-transition:leave-end="fi-transition-leave-end"
|
||||
@endif
|
||||
@if (filled($wireSubmitHandler))
|
||||
wire:submit.prevent="{!! $wireSubmitHandler !!}"
|
||||
@endif
|
||||
@if (filled($id))
|
||||
wire:key="{{ isset($this) ? "{$this->getId()}." : '' }}modal.{{ $id }}.window"
|
||||
@endif
|
||||
{{
|
||||
($extraModalWindowAttributeBag ?? new FilamentComponentAttributeBag)->merge([
|
||||
// When `Escape` does not close the modal, the close button stays in the tab order as the only keyboard way to dismiss it, so the window takes the focus trap's `[autofocus]` to stop the button from being autofocused when the modal opens.
|
||||
'autofocus' => $closeButton && (! $closeByEscaping) && ($heading || $header),
|
||||
'tabindex' => ($closeButton && (! $closeByEscaping) && ($heading || $header)) ? '-1' : null,
|
||||
])->class([
|
||||
'fi-modal-window',
|
||||
'fi-modal-window-has-close-btn' => $closeButton,
|
||||
'fi-modal-window-has-content' => $hasContent,
|
||||
'fi-modal-window-has-footer' => $hasFooter,
|
||||
'fi-modal-window-has-icon' => $hasIcon,
|
||||
'fi-hidden' => ! $visible,
|
||||
($alignment instanceof Alignment) ? "fi-align-{$alignment->value}" : null,
|
||||
($width instanceof Width) ? "fi-width-{$width->value}" : (is_string($width) ? $width : null),
|
||||
])
|
||||
}}
|
||||
>
|
||||
@if ($heading || $header)
|
||||
<div
|
||||
@if (filled($id))
|
||||
wire:key="{{ isset($this) ? "{$this->getId()}." : '' }}modal.{{ $id }}.header"
|
||||
@endif
|
||||
@class([
|
||||
'fi-modal-header',
|
||||
'fi-vertical-align-center' => $hasIcon && $hasHeading && (! $hasDescription) && in_array($alignment, [Alignment::Start, Alignment::Left]),
|
||||
])
|
||||
>
|
||||
@if ($closeButton)
|
||||
{{-- The close button is removed from the tab order when `Escape` also closes the modal, so it can sit first in the focus trap without being autofocused when the modal opens. When `Escape` does not close the modal, the button is the only keyboard way to dismiss it, so it stays in the tab order and the modal window is autofocused instead. --}}
|
||||
<x-filament::icon-button
|
||||
color="gray"
|
||||
:icon="Heroicon::OutlinedXMark"
|
||||
:icon-alias="SupportIconAlias::MODAL_CLOSE_BUTTON"
|
||||
icon-size="lg"
|
||||
:label="__('filament::components/modal.actions.close.label')"
|
||||
:tabindex="$closeByEscaping ? '-1' : null"
|
||||
:x-on:click="$closeEventHandler"
|
||||
class="fi-modal-close-btn"
|
||||
/>
|
||||
@endif
|
||||
|
||||
@if ($header)
|
||||
{{ $header }}
|
||||
@else
|
||||
@if ($hasIcon)
|
||||
<div class="fi-modal-icon-ctn">
|
||||
<div
|
||||
{{ (new FilamentComponentAttributeBag)->color(IconComponent::class, $iconColor)->class(['fi-modal-icon-bg']) }}
|
||||
>
|
||||
{{ $iconHtml }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div>
|
||||
<h2
|
||||
@if ($headingId)
|
||||
id="{{ $headingId }}"
|
||||
@endif
|
||||
class="fi-modal-heading"
|
||||
>
|
||||
{{ $heading }}
|
||||
</h2>
|
||||
|
||||
@if ($hasDescription)
|
||||
<p
|
||||
@if ($descriptionId)
|
||||
id="{{ $descriptionId }}"
|
||||
@endif
|
||||
class="fi-modal-description"
|
||||
>
|
||||
{{ $description }}
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($hasContent)
|
||||
<div
|
||||
@if (filled($id))
|
||||
wire:key="{{ isset($this) ? "{$this->getId()}." : '' }}modal.{{ $id }}.content"
|
||||
@endif
|
||||
class="fi-modal-content"
|
||||
>
|
||||
{{ $slot }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($hasFooter)
|
||||
<div
|
||||
@if (filled($id))
|
||||
wire:key="{{ isset($this) ? "{$this->getId()}." : '' }}modal.{{ $id }}.footer"
|
||||
@endif
|
||||
@class([
|
||||
'fi-modal-footer',
|
||||
($footerActionsAlignment instanceof Alignment) ? "fi-align-{$footerActionsAlignment->value}" : null,
|
||||
])
|
||||
>
|
||||
@if (! \Filament\Support\is_slot_empty($footer))
|
||||
{{ $footer }}
|
||||
@else
|
||||
<div class="fi-modal-footer-actions">
|
||||
@if (is_array($footerActions))
|
||||
@foreach ($footerActions as $action)
|
||||
{{ $action }}
|
||||
@endforeach
|
||||
@else
|
||||
{{ $footerActions }}
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</{{ filled($wireSubmitHandler) ? 'form' : 'div' }}>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (filled($teleport))
|
||||
{!! '</template>' !!}
|
||||
{{-- Avoid formatting issues with unclosed elements --}}
|
||||
@endif
|
||||
|
||||
@if ($trigger)
|
||||
{!! '</div>' !!}
|
||||
{{-- Avoid formatting issues with unclosed elements --}}
|
||||
@endif
|
||||
211
vendor/filament/support/resources/views/components/pagination/index.blade.php
vendored
Normal file
211
vendor/filament/support/resources/views/components/pagination/index.blade.php
vendored
Normal file
|
|
@ -0,0 +1,211 @@
|
|||
@props([
|
||||
'currentPageOptionProperty' => 'tableRecordsPerPage',
|
||||
'extremeLinks' => false,
|
||||
'paginator',
|
||||
'pageOptions' => [],
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Support\View\SupportIconAlias;
|
||||
use Illuminate\Contracts\Pagination\CursorPaginator;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Number;
|
||||
|
||||
$isRtl = __('filament-panels::layout.direction') === 'rtl';
|
||||
$isSimple = ! $paginator instanceof LengthAwarePaginator;
|
||||
@endphp
|
||||
|
||||
<nav
|
||||
aria-label="{{ __('filament::components/pagination.label') }}"
|
||||
{{
|
||||
$attributes->class([
|
||||
'fi-pagination',
|
||||
'fi-simple' => $isSimple,
|
||||
])
|
||||
}}
|
||||
>
|
||||
@if (! $paginator->onFirstPage())
|
||||
@php
|
||||
if ($paginator instanceof CursorPaginator) {
|
||||
$wireClickAction = "setPage('{$paginator->previousCursor()->encode()}', '{$paginator->getCursorName()}')";
|
||||
} else {
|
||||
$wireClickAction = "previousPage('{$paginator->getPageName()}')";
|
||||
}
|
||||
@endphp
|
||||
|
||||
<x-filament::button
|
||||
color="gray"
|
||||
rel="prev"
|
||||
:wire:click="$wireClickAction"
|
||||
:wire:key="$this->getId() . '.pagination.previous'"
|
||||
class="fi-pagination-previous-btn"
|
||||
>
|
||||
{{ __('filament::components/pagination.actions.previous.label') }}
|
||||
</x-filament::button>
|
||||
@endif
|
||||
|
||||
@if (! $isSimple)
|
||||
<span class="fi-pagination-overview">
|
||||
{{
|
||||
trans_choice(
|
||||
'filament::components/pagination.overview',
|
||||
$paginator->total(),
|
||||
[
|
||||
'first' => Number::format($paginator->firstItem() ?? 0),
|
||||
'last' => Number::format($paginator->lastItem() ?? 0),
|
||||
'total' => Number::format($paginator->total()),
|
||||
],
|
||||
)
|
||||
}}
|
||||
</span>
|
||||
@endif
|
||||
|
||||
@if (count($pageOptions) > 1)
|
||||
<div class="fi-pagination-records-per-page-select-ctn">
|
||||
<label class="fi-pagination-records-per-page-select fi-compact">
|
||||
<x-filament::input.wrapper>
|
||||
<x-filament::input.select
|
||||
:wire:model.live="$currentPageOptionProperty"
|
||||
>
|
||||
@foreach ($pageOptions as $option)
|
||||
<option value="{{ $option }}">
|
||||
{{ $option === 'all' ? __('filament::components/pagination.fields.records_per_page.options.all') : $option }}
|
||||
</option>
|
||||
@endforeach
|
||||
</x-filament::input.select>
|
||||
</x-filament::input.wrapper>
|
||||
|
||||
<span class="fi-sr-only">
|
||||
{{ __('filament::components/pagination.fields.records_per_page.label') }}
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<label class="fi-pagination-records-per-page-select">
|
||||
<x-filament::input.wrapper
|
||||
:prefix="__('filament::components/pagination.fields.records_per_page.label')"
|
||||
>
|
||||
<x-filament::input.select
|
||||
:wire:model.live="$currentPageOptionProperty"
|
||||
>
|
||||
@foreach ($pageOptions as $option)
|
||||
<option value="{{ $option }}">
|
||||
{{ $option === 'all' ? __('filament::components/pagination.fields.records_per_page.options.all') : $option }}
|
||||
</option>
|
||||
@endforeach
|
||||
</x-filament::input.select>
|
||||
</x-filament::input.wrapper>
|
||||
</label>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($paginator->hasMorePages())
|
||||
@php
|
||||
if ($paginator instanceof CursorPaginator) {
|
||||
$wireClickAction = "setPage('{$paginator->nextCursor()->encode()}', '{$paginator->getCursorName()}')";
|
||||
} else {
|
||||
$wireClickAction = "nextPage('{$paginator->getPageName()}')";
|
||||
}
|
||||
@endphp
|
||||
|
||||
<x-filament::button
|
||||
color="gray"
|
||||
rel="next"
|
||||
:wire:click="$wireClickAction"
|
||||
:wire:key="$this->getId() . '.pagination.next'"
|
||||
class="fi-pagination-next-btn"
|
||||
>
|
||||
{{ __('filament::components/pagination.actions.next.label') }}
|
||||
</x-filament::button>
|
||||
@endif
|
||||
|
||||
@if ((! $isSimple) && $paginator->hasPages())
|
||||
<ol class="fi-pagination-items">
|
||||
@if (! $paginator->onFirstPage())
|
||||
@if ($extremeLinks)
|
||||
<x-filament::pagination.item
|
||||
:aria-label="__('filament::components/pagination.actions.first.label')"
|
||||
:icon="$isRtl ? Heroicon::ChevronDoubleRight : Heroicon::ChevronDoubleLeft"
|
||||
:icon-alias="
|
||||
$isRtl
|
||||
? SupportIconAlias::PAGINATION_FIRST_BUTTON_RTL
|
||||
: SupportIconAlias::PAGINATION_FIRST_BUTTON
|
||||
"
|
||||
rel="first"
|
||||
:wire:click="'gotoPage(1, \'' . $paginator->getPageName() . '\')'"
|
||||
:wire:key="$this->getId() . '.pagination.first'"
|
||||
/>
|
||||
@endif
|
||||
|
||||
<x-filament::pagination.item
|
||||
:aria-label="__('filament::components/pagination.actions.previous.label')"
|
||||
:icon="$isRtl ? Heroicon::ChevronRight : Heroicon::ChevronLeft"
|
||||
{{-- @deprecated Use `SupportIconAlias::PAGINATION_PREVIOUS_BUTTON_RTL` instead of `SupportIconAlias::PAGINATION_PREVIOUS_BUTTON` for RTL. --}}
|
||||
:icon-alias="
|
||||
$isRtl
|
||||
? [
|
||||
SupportIconAlias::PAGINATION_PREVIOUS_BUTTON_RTL,
|
||||
SupportIconAlias::PAGINATION_PREVIOUS_BUTTON,
|
||||
]
|
||||
: SupportIconAlias::PAGINATION_PREVIOUS_BUTTON
|
||||
"
|
||||
rel="prev"
|
||||
:wire:click="'previousPage(\'' . $paginator->getPageName() . '\')'"
|
||||
:wire:key="$this->getId() . '.pagination.previous'"
|
||||
/>
|
||||
@endif
|
||||
|
||||
@foreach ($paginator->render()->offsetGet('elements') as $element)
|
||||
@if (is_string($element))
|
||||
<x-filament::pagination.item disabled :label="$element" />
|
||||
@endif
|
||||
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
<x-filament::pagination.item
|
||||
:active="$page === $paginator->currentPage()"
|
||||
:aria-label="trans_choice('filament::components/pagination.actions.go_to_page.label', $page, ['page' => Number::format($page)])"
|
||||
:label="Number::format($page)"
|
||||
:wire:click="'gotoPage(' . $page . ', \'' . $paginator->getPageName() . '\')'"
|
||||
:wire:key="$this->getId() . '.pagination.' . $paginator->getPageName() . '.' . $page"
|
||||
/>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@if ($paginator->hasMorePages())
|
||||
<x-filament::pagination.item
|
||||
:aria-label="__('filament::components/pagination.actions.next.label')"
|
||||
:icon="$isRtl ? Heroicon::ChevronLeft : Heroicon::ChevronRight"
|
||||
{{-- @deprecated Use `SupportIconAlias::PAGINATION_NEXT_BUTTON_RTL` instead of `SupportIconAlias::PAGINATION_NEXT_BUTTON` for RTL. --}}
|
||||
:icon-alias="
|
||||
$isRtl
|
||||
? [
|
||||
SupportIconAlias::PAGINATION_NEXT_BUTTON_RTL,
|
||||
SupportIconAlias::PAGINATION_NEXT_BUTTON,
|
||||
]
|
||||
: SupportIconAlias::PAGINATION_NEXT_BUTTON
|
||||
"
|
||||
rel="next"
|
||||
:wire:click="'nextPage(\'' . $paginator->getPageName() . '\')'"
|
||||
:wire:key="$this->getId() . '.pagination.next'"
|
||||
/>
|
||||
|
||||
@if ($extremeLinks)
|
||||
<x-filament::pagination.item
|
||||
:aria-label="__('filament::components/pagination.actions.last.label')"
|
||||
:icon="$isRtl ? Heroicon::ChevronDoubleLeft : Heroicon::ChevronDoubleRight"
|
||||
:icon-alias="
|
||||
$isRtl
|
||||
? SupportIconAlias::PAGINATION_LAST_BUTTON_RTL
|
||||
: SupportIconAlias::PAGINATION_LAST_BUTTON
|
||||
"
|
||||
rel="last"
|
||||
:wire:click="'gotoPage(' . $paginator->lastPage() . ', \'' . $paginator->getPageName() . '\')'"
|
||||
:wire:key="$this->getId() . '.pagination.last'"
|
||||
/>
|
||||
@endif
|
||||
@endif
|
||||
</ol>
|
||||
@endif
|
||||
</nav>
|
||||
52
vendor/filament/support/resources/views/components/pagination/item.blade.php
vendored
Normal file
52
vendor/filament/support/resources/views/components/pagination/item.blade.php
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
@props([
|
||||
'active' => false,
|
||||
'ariaLabel' => null,
|
||||
'disabled' => false,
|
||||
'icon' => null,
|
||||
'iconAlias' => null,
|
||||
'label' => null,
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\View\ComponentAttributeBag;
|
||||
use Illuminate\Support\Number;
|
||||
@endphp
|
||||
|
||||
<li
|
||||
{{
|
||||
$attributes->class([
|
||||
'fi-pagination-item',
|
||||
'fi-disabled' => $disabled,
|
||||
'fi-active' => $active,
|
||||
])
|
||||
}}
|
||||
>
|
||||
<button
|
||||
@if (filled($ariaLabel))
|
||||
aria-label="{{ $ariaLabel }}"
|
||||
@endif
|
||||
@if ($active)
|
||||
aria-current="page"
|
||||
@endif
|
||||
@if ($disabled)
|
||||
aria-hidden="true"
|
||||
@endif
|
||||
@disabled($disabled)
|
||||
type="button"
|
||||
class="fi-pagination-item-btn"
|
||||
>
|
||||
@if ($icon || $iconAlias)
|
||||
{{
|
||||
\Filament\Support\generate_icon_html($icon, $iconAlias, attributes: (new ComponentAttributeBag)->merge(['aria-hidden' => 'true'], escape: false)->class([
|
||||
'fi-pagination-item-icon',
|
||||
]))
|
||||
}}
|
||||
@endif
|
||||
|
||||
@if (filled($label))
|
||||
<span class="fi-pagination-item-label">
|
||||
{{ is_numeric($label) ? Number::format($label) : ($label ?? '...') }}
|
||||
</span>
|
||||
@endif
|
||||
</button>
|
||||
</li>
|
||||
5
vendor/filament/support/resources/views/components/section/description.blade.php
vendored
Normal file
5
vendor/filament/support/resources/views/components/section/description.blade.php
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<p
|
||||
{{ $attributes->class(['fi-section-header-description']) }}
|
||||
>
|
||||
{{ $slot }}
|
||||
</p>
|
||||
14
vendor/filament/support/resources/views/components/section/heading.blade.php
vendored
Normal file
14
vendor/filament/support/resources/views/components/section/heading.blade.php
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
@props([
|
||||
'level' => 2,
|
||||
])
|
||||
|
||||
@php
|
||||
$level = max(1, (int) $level);
|
||||
$headingTag = ($level > 6) ? 'p' : "h{$level}";
|
||||
@endphp
|
||||
|
||||
<{{ $headingTag }}
|
||||
{{ $attributes->class(['fi-section-header-heading']) }}
|
||||
>
|
||||
{{ $slot }}
|
||||
</{{ $headingTag }}>
|
||||
149
vendor/filament/support/resources/views/components/section/index.blade.php
vendored
Normal file
149
vendor/filament/support/resources/views/components/section/index.blade.php
vendored
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
@props([
|
||||
'afterHeader' => null,
|
||||
'aside' => false,
|
||||
'collapsed' => false,
|
||||
'collapseId' => null,
|
||||
'collapsible' => false,
|
||||
'compact' => false,
|
||||
'contained' => true,
|
||||
'contentBefore' => false,
|
||||
'description' => null,
|
||||
'divided' => false,
|
||||
'footer' => null,
|
||||
'hasContentEl' => true,
|
||||
'heading' => null,
|
||||
'headingTag' => 'h2',
|
||||
'icon' => null,
|
||||
'iconColor' => 'gray',
|
||||
'iconSize' => null,
|
||||
'persistCollapsed' => false,
|
||||
'secondary' => false,
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Support\View\ComponentAttributeBag;
|
||||
use Filament\Support\View\Components\SectionComponent\IconComponent;
|
||||
use Filament\Support\View\SupportIconAlias;
|
||||
use Illuminate\Support\Js;
|
||||
|
||||
use function Filament\Support\is_slot_empty;
|
||||
|
||||
if (filled($iconSize) && (! $iconSize instanceof IconSize)) {
|
||||
$iconSize = IconSize::tryFrom($iconSize) ?? $iconSize;
|
||||
}
|
||||
|
||||
$hasDescription = filled((string) $description);
|
||||
$hasHeading = filled($heading);
|
||||
$hasIcon = filled($icon);
|
||||
$hasHeader = $hasIcon || $hasHeading || $hasDescription || $collapsible || (! is_slot_empty($afterHeader));
|
||||
$hasContentContainer = (! is_slot_empty($slot)) || (! is_slot_empty($footer));
|
||||
@endphp
|
||||
|
||||
<section
|
||||
{{-- TODO: Investigate Livewire bug - https://github.com/filamentphp/filament/pull/8511 --}}
|
||||
x-data="{
|
||||
isCollapsed: @if ($persistCollapsed) $persist(@js($collapsed)).as(`section-${@js($collapseId) ?? $el.id}-isCollapsed`) @else @js($collapsed) @endif,
|
||||
}"
|
||||
@if ($collapsible)
|
||||
x-id="['fi-section-content']"
|
||||
x-on:collapse-section.window="if ($event.detail.id == (@js($collapseId) ?? $el.id)) isCollapsed = true"
|
||||
x-on:expand="isCollapsed = false"
|
||||
x-on:expand-section.window="if ($event.detail.id == (@js($collapseId) ?? $el.id)) isCollapsed = false"
|
||||
x-on:open-section.window="if ($event.detail.id == (@js($collapseId) ?? $el.id)) isCollapsed = false"
|
||||
x-on:toggle-section.window="if ($event.detail.id == (@js($collapseId) ?? $el.id)) isCollapsed = ! isCollapsed"
|
||||
x-bind:class="isCollapsed && 'fi-collapsed'"
|
||||
@endif
|
||||
{{
|
||||
$attributes->class([
|
||||
'fi-section',
|
||||
'fi-section-not-contained' => ! $contained,
|
||||
'fi-section-has-content-before' => $contentBefore,
|
||||
'fi-section-has-header' => $hasHeader,
|
||||
'fi-aside' => $aside,
|
||||
'fi-compact' => $compact,
|
||||
'fi-collapsible' => $collapsible,
|
||||
'fi-divided' => $divided,
|
||||
'fi-secondary' => $secondary,
|
||||
])
|
||||
}}
|
||||
>
|
||||
@if ($hasHeader)
|
||||
<header
|
||||
@if ($collapsible)
|
||||
x-on:click="if (! $event.target.closest('.fi-section-header-after-ctn')) isCollapsed = ! isCollapsed"
|
||||
@endif
|
||||
class="fi-section-header"
|
||||
>
|
||||
{{
|
||||
\Filament\Support\generate_icon_html($icon, attributes: (new ComponentAttributeBag)
|
||||
->color(IconComponent::class, $iconColor), size: $iconSize ?? IconSize::Large)
|
||||
}}
|
||||
|
||||
@if ($hasHeading || $hasDescription)
|
||||
<div class="fi-section-header-text-ctn">
|
||||
@if ($hasHeading)
|
||||
<{{ $headingTag }} class="fi-section-header-heading">
|
||||
{{ $heading }}
|
||||
</{{ $headingTag }}>
|
||||
@endif
|
||||
|
||||
@if ($hasDescription)
|
||||
<p class="fi-section-header-description">
|
||||
{{ $description }}
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (! is_slot_empty($afterHeader))
|
||||
<div class="fi-section-header-after-ctn">
|
||||
{{ $afterHeader }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($collapsible)
|
||||
{{-- The content container is not rendered when the slot and footer are empty, so `aria-controls` must not reference it then. --}}
|
||||
<x-filament::icon-button
|
||||
color="gray"
|
||||
:icon="Heroicon::ChevronUp"
|
||||
:icon-alias="SupportIconAlias::SECTION_COLLAPSE_BUTTON"
|
||||
:label="__($collapsed ? 'filament::components/section.actions.expand.label' : 'filament::components/section.actions.collapse.label')"
|
||||
:x-bind:aria-label="'isCollapsed ? ' . Js::from(__('filament::components/section.actions.expand.label')) . ' : ' . Js::from(__('filament::components/section.actions.collapse.label'))"
|
||||
aria-expanded="{{ $collapsed ? 'false' : 'true' }}"
|
||||
x-bind:aria-expanded="(! isCollapsed).toString()"
|
||||
:x-bind:aria-controls="$hasContentContainer ? '$id(\'fi-section-content\')' : null"
|
||||
x-on:click.stop="isCollapsed = ! isCollapsed"
|
||||
class="fi-section-collapse-btn"
|
||||
/>
|
||||
@endif
|
||||
</header>
|
||||
@endif
|
||||
|
||||
@if ($hasContentContainer)
|
||||
<div
|
||||
@if ($collapsible)
|
||||
x-bind:id="$id('fi-section-content')"
|
||||
@if ($collapsed || $persistCollapsed)
|
||||
x-cloak
|
||||
@endif
|
||||
@endif
|
||||
class="fi-section-content-ctn"
|
||||
>
|
||||
@if ($hasContentEl)
|
||||
<div class="fi-section-content">
|
||||
{{ $slot }}
|
||||
</div>
|
||||
@else
|
||||
{{ $slot }}
|
||||
@endif
|
||||
|
||||
@if (! is_slot_empty($footer))
|
||||
<footer class="fi-section-footer">
|
||||
{{ $footer }}
|
||||
</footer>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
</section>
|
||||
21
vendor/filament/support/resources/views/components/tabs/index.blade.php
vendored
Normal file
21
vendor/filament/support/resources/views/components/tabs/index.blade.php
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
@props([
|
||||
'contained' => false,
|
||||
'label' => null,
|
||||
'vertical' => false,
|
||||
])
|
||||
|
||||
<nav
|
||||
{{
|
||||
$attributes
|
||||
->merge([
|
||||
'aria-label' => $label ?? __('filament::components/tabs.label'),
|
||||
])
|
||||
->class([
|
||||
'fi-tabs',
|
||||
'fi-contained' => $contained,
|
||||
'fi-vertical' => $vertical,
|
||||
])
|
||||
}}
|
||||
>
|
||||
{{ $slot }}
|
||||
</nav>
|
||||
147
vendor/filament/support/resources/views/components/tabs/item.blade.php
vendored
Normal file
147
vendor/filament/support/resources/views/components/tabs/item.blade.php
vendored
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
@props([
|
||||
'active' => false,
|
||||
'alpineActive' => null,
|
||||
'alpineDeferredBadgeData' => null,
|
||||
'alpineDeferredBadgeLoading' => null,
|
||||
'badge' => null,
|
||||
'badgeColor' => null,
|
||||
'badgeTooltip' => null,
|
||||
'badgeIcon' => null,
|
||||
'badgeIconPosition' => null,
|
||||
'href' => null,
|
||||
'icon' => null,
|
||||
'iconColor' => 'gray',
|
||||
'iconPosition' => null,
|
||||
'spaMode' => null,
|
||||
'tag' => 'button',
|
||||
'target' => null,
|
||||
'type' => 'button',
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Enums\IconPosition;
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Illuminate\View\ComponentSlot;
|
||||
|
||||
$badgeIconPosition ??= IconPosition::Before;
|
||||
$iconPosition ??= IconPosition::Before;
|
||||
|
||||
if (! $iconPosition instanceof IconPosition) {
|
||||
$iconPosition = filled($iconPosition) ? (IconPosition::tryFrom($iconPosition) ?? $iconPosition) : null;
|
||||
}
|
||||
|
||||
$hasAlpineActiveClasses = filled($alpineActive);
|
||||
$hasDeferredBadge = filled($alpineDeferredBadgeData);
|
||||
@endphp
|
||||
|
||||
<{{ $tag }}
|
||||
@if ($tag === 'button')
|
||||
type="{{ $type }}"
|
||||
@elseif ($tag === 'a')
|
||||
{{ \Filament\Support\generate_href_html($href, $target === '_blank', $spaMode) }}
|
||||
@endif
|
||||
@if ($hasAlpineActiveClasses)
|
||||
x-bind:class="{
|
||||
'fi-active': {{ $alpineActive }},
|
||||
}"
|
||||
@endif
|
||||
{{
|
||||
$attributes
|
||||
->merge([
|
||||
'aria-current' => $active ? (($tag === 'a') ? 'page' : 'true') : null,
|
||||
])
|
||||
->class([
|
||||
'fi-tabs-item',
|
||||
'fi-active' => (! $hasAlpineActiveClasses) && $active,
|
||||
])
|
||||
}}
|
||||
>
|
||||
@if ($icon && $iconPosition === IconPosition::Before)
|
||||
{{ \Filament\Support\generate_icon_html($icon) }}
|
||||
@endif
|
||||
|
||||
<span class="fi-tabs-item-label">
|
||||
{{ $slot }}
|
||||
</span>
|
||||
|
||||
@if ($icon && $iconPosition === IconPosition::After)
|
||||
{{ \Filament\Support\generate_icon_html($icon) }}
|
||||
@endif
|
||||
|
||||
@if (filled($badge))
|
||||
@if ($badge instanceof ComponentSlot)
|
||||
{{ $badge }}
|
||||
@else
|
||||
<x-filament::badge
|
||||
:color="$badgeColor"
|
||||
:icon="$badgeIcon"
|
||||
:icon-position="$badgeIconPosition"
|
||||
size="sm"
|
||||
:tooltip="$badgeTooltip"
|
||||
>
|
||||
{{ $badge }}
|
||||
</x-filament::badge>
|
||||
@endif
|
||||
@elseif ($hasDeferredBadge)
|
||||
<span
|
||||
x-show="{{ $alpineDeferredBadgeLoading }}"
|
||||
x-cloak
|
||||
class="fi-tabs-item-badge-placeholder"
|
||||
>
|
||||
{{ \Filament\Support\generate_loading_indicator_html(size: IconSize::Small) }}
|
||||
</span>
|
||||
|
||||
<template
|
||||
x-if="
|
||||
! {{ $alpineDeferredBadgeLoading }} &&
|
||||
{{ $alpineDeferredBadgeData }}?.badge != null
|
||||
"
|
||||
>
|
||||
<span
|
||||
x-bind:class="
|
||||
'fi-badge fi-size-sm ' +
|
||||
({{ $alpineDeferredBadgeData }}?.badgeColorClasses ?? '')
|
||||
"
|
||||
x-bind:style="{{ $alpineDeferredBadgeData }}?.badgeColorStyles ?? ''"
|
||||
x-init="
|
||||
let tooltip = {{ $alpineDeferredBadgeData }}?.badgeTooltip
|
||||
if (tooltip) {
|
||||
window.tippy?.($el, {
|
||||
content: tooltip,
|
||||
theme: $store.theme,
|
||||
})
|
||||
}
|
||||
"
|
||||
>
|
||||
<template
|
||||
x-if="
|
||||
{{ $alpineDeferredBadgeData }}?.badgeIconHtml &&
|
||||
{{ $alpineDeferredBadgeData }}?.badgeIconPosition !== 'after'
|
||||
"
|
||||
>
|
||||
<span
|
||||
x-html="{{ $alpineDeferredBadgeData }}.badgeIconHtml"
|
||||
></span>
|
||||
</template>
|
||||
|
||||
<span class="fi-badge-label-ctn">
|
||||
<span
|
||||
class="fi-badge-label"
|
||||
x-text="{{ $alpineDeferredBadgeData }}?.badge"
|
||||
></span>
|
||||
</span>
|
||||
|
||||
<template
|
||||
x-if="
|
||||
{{ $alpineDeferredBadgeData }}?.badgeIconHtml &&
|
||||
{{ $alpineDeferredBadgeData }}?.badgeIconPosition === 'after'
|
||||
"
|
||||
>
|
||||
<span
|
||||
x-html="{{ $alpineDeferredBadgeData }}.badgeIconHtml"
|
||||
></span>
|
||||
</template>
|
||||
</span>
|
||||
</template>
|
||||
@endif
|
||||
</{{ $tag }}>
|
||||
69
vendor/filament/support/resources/views/components/toggle.blade.php
vendored
Normal file
69
vendor/filament/support/resources/views/components/toggle.blade.php
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
@props([
|
||||
'state',
|
||||
'offColor' => 'gray',
|
||||
'offIcon' => null,
|
||||
'onColor' => 'primary',
|
||||
'onIcon' => null,
|
||||
])
|
||||
|
||||
@php
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Support\View\Components\ToggleComponent;
|
||||
use Illuminate\Support\Arr;
|
||||
@endphp
|
||||
|
||||
<button
|
||||
x-data="{ state: {{ $state }} }"
|
||||
x-bind:aria-checked="state ? 'true' : 'false'"
|
||||
x-on:click="state = ! state"
|
||||
x-bind:class="
|
||||
state ? @js(Arr::toCssClasses([
|
||||
'fi-toggle-on',
|
||||
...\Filament\Support\get_component_color_classes(ToggleComponent::class, $onColor),
|
||||
])) : @js(Arr::toCssClasses([
|
||||
'fi-toggle-off',
|
||||
...\Filament\Support\get_component_color_classes(ToggleComponent::class, $offColor),
|
||||
]))
|
||||
"
|
||||
@if ($state)
|
||||
x-cloak
|
||||
@endif
|
||||
{{
|
||||
$attributes
|
||||
->merge([
|
||||
'aria-checked' => $state ? 'true' : 'false',
|
||||
'role' => 'switch',
|
||||
'type' => 'button',
|
||||
], escape: false)
|
||||
->class(['fi-toggle'])
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
<div aria-hidden="true">
|
||||
{{ \Filament\Support\generate_icon_html($offIcon, size: IconSize::ExtraSmall) }}
|
||||
</div>
|
||||
|
||||
<div aria-hidden="true">
|
||||
{{ \Filament\Support\generate_icon_html($onIcon, size: IconSize::ExtraSmall) }}
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
@if ($state)
|
||||
<div
|
||||
x-cloak="inline-flex"
|
||||
wire:ignore
|
||||
@class([
|
||||
'fi-toggle fi-toggle-on fi-hidden',
|
||||
...\Filament\Support\get_component_color_classes(ToggleComponent::class, $onColor),
|
||||
])
|
||||
>
|
||||
<div>
|
||||
<div aria-hidden="true"></div>
|
||||
|
||||
<div aria-hidden="true">
|
||||
{{ \Filament\Support\generate_icon_html($onIcon, size: IconSize::ExtraSmall) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue