Repo rebuild

This commit is contained in:
Mark Gregory
2026-09-15 12:33:28 +01:00
commit be28c4feec
5629 changed files with 317074 additions and 0 deletions
@@ -0,0 +1,54 @@
@php
use Filament\Support\Enums\VerticalAlignment;
$actions = $getChildSchema()->getComponents();
$alignment = $getAlignment();
$isFullWidth = $isFullWidth();
$isSticky = $isSticky();
$verticalAlignment = $getVerticalAlignment();
if (!$verticalAlignment instanceof VerticalAlignment) {
$verticalAlignment = filled($verticalAlignment)
? VerticalAlignment::tryFrom($verticalAlignment) ?? $verticalAlignment
: null;
}
@endphp
<div @if ($isSticky) x-data="filamentActionsSchemaComponent()"
x-intersect:enter.half="disableSticky"
x-intersect:leave="enableSticky"
x-bind:class="{ 'fi-sticky': isSticky }" @endif
{{ $attributes->merge(
[
'id' => $getId(),
],
escape: false,
)->merge($getExtraAttributes(), escape: false)->class([
'fi-sc-actions',
$verticalAlignment instanceof VerticalAlignment
? "fi-vertical-align-{$verticalAlignment->value}"
: $verticalAlignment,
]) }}>
@if (filled($label = $getLabel()))
<div class="fi-sc-actions-label-ctn">
{{ $getChildSchema($schemaComponent::BEFORE_LABEL_SCHEMA_KEY) }}
<div class="fi-sc-actions-label">
{{ $label }}
</div>
{{ $getChildSchema($schemaComponent::AFTER_LABEL_SCHEMA_KEY) }}
</div>
@endif
@if ($aboveContentContainer = $getChildSchema($schemaComponent::ABOVE_CONTENT_SCHEMA_KEY)?->toHtmlString())
{{ $aboveContentContainer }}
@endif
<x-filament::actions :actions="$actions" :alignment="$alignment" :full-width="$isFullWidth"
:x-bind:style="$isSticky ? 'isSticky ? `width: ${width}px;` : \'\'' : null" />
@if ($belowContentContainer = $getChildSchema($schemaComponent::BELOW_CONTENT_SCHEMA_KEY)?->toHtmlString())
{{ $belowContentContainer }}
@endif
</div>
@@ -0,0 +1,24 @@
@php
use Filament\Support\Enums\IconSize;
$controls = $getChildSchema($schemaComponent::CONTROLS_SCHEMA_KEY)?->toHtmlString();
$extraAttributeBag = $getExtraAttributeBag();
$footer = $getChildSchema($schemaComponent::FOOTER_SCHEMA_KEY)?->toHtmlString();
$color = $getColor();
$description = $getDescription();
$heading = $getHeading();
$icon = $getIcon();
$iconColor = $getIconColor();
$iconSize = $getIconSize() ?? IconSize::Large;
@endphp
<x-filament::callout :attributes="\Filament\Support\prepare_inherited_attributes($extraAttributeBag)->class(['fi-sc-callout'])" :color="$color ?? 'gray'" :description="$description" :heading="$heading" :icon="$icon"
:icon-color="$iconColor" :icon-size="$iconSize">
<x-slot name="footer">
{{ $footer }}
</x-slot>
<x-slot name="controls">
{{ $controls }}
</x-slot>
</x-filament::callout>
@@ -0,0 +1,16 @@
@php
$description = $getDescription();
$footer = $getChildSchema($schemaComponent::FOOTER_SCHEMA_KEY)?->toHtmlString();
$heading = $getHeading();
$headingTag = $getHeadingTag();
$icon = $getIcon();
$iconColor = $getIconColor();
$iconSize = $getIconSize();
$isCompact = $isCompact();
$isContained = $isContained();
@endphp
<div {{ $attributes->merge($getExtraAttributes(), escape: false)->class(['fi-sc-empty-state']) }}>
<x-filament::empty-state :compact="$isCompact" :contained="$isContained" :description="$description" :footer="$footer" :heading="$heading"
:heading-tag="$headingTag" :icon="$icon" :icon-color="$iconColor" :icon-size="$iconSize" />
</div>
@@ -0,0 +1,19 @@
@php
$extraAttributes = $getExtraAttributes();
$id = $getId();
$isLabelHidden = $isLabelHidden();
$label = $getLabel();
$isContained = $isContained();
@endphp
<x-filament::fieldset :contained="$isContained" :label="$label" :label-hidden="$isLabelHidden" :required="isset($isMarkedAsRequired) ? $isMarkedAsRequired() : false" :attributes="\Filament\Support\prepare_inherited_attributes($attributes)
->merge(
[
'id' => $id,
],
escape: false,
)
->merge($extraAttributes, escape: false)
->class(['fi-sc-fieldset'])">
{{ $getChildSchema() }}
</x-filament::fieldset>
@@ -0,0 +1,79 @@
@php
use Filament\Actions\Action;
use Filament\Actions\ActionGroup;
use Filament\Schemas\Components\Component;
use Filament\Support\Enums\Alignment;
use Filament\Support\Enums\VerticalAlignment;
$statePath = $getStatePath();
$fromBreakpoint = $getFromBreakpoint();
$verticalAlignment = $getVerticalAlignment();
$alignment = $getAlignment();
if (!$verticalAlignment instanceof VerticalAlignment) {
$verticalAlignment = filled($verticalAlignment)
? VerticalAlignment::tryFrom($verticalAlignment) ?? $verticalAlignment
: null;
}
if (!$alignment instanceof Alignment) {
$alignment = filled($alignment) ? Alignment::tryFrom($alignment) ?? $alignment : null;
}
@endphp
<div
{{ $attributes->merge($getExtraAttributes(), escape: false)->class([
'fi-sc-flex',
'fi-dense' => $isDense(),
'fi-from-' . ($fromBreakpoint ?? 'default'),
$verticalAlignment instanceof VerticalAlignment
? "fi-vertical-align-{$verticalAlignment->value}"
: $verticalAlignment,
$alignment instanceof Alignment ? "fi-align-{$alignment->value}" : $alignment,
]) }}>
@foreach ($getChildSchema()->getComponents() as $schemaComponent)
@if ($schemaComponent instanceof Action || $schemaComponent instanceof ActionGroup)
<div>
{{ $schemaComponent }}
</div>
@else
@php
$hiddenJs = $schemaComponent->getHiddenJs();
$visibleJs = $schemaComponent->getVisibleJs();
$schemaComponentStatePath = $schemaComponent->getStatePath();
@endphp
<div x-data="filamentSchemaComponent({
path: @js($schemaComponentStatePath),
containerPath: @js($statePath),
$wire,
})" @if ($afterStateUpdatedJs = $schemaComponent->getAfterStateUpdatedJs()) x-init="{!! implode(
';',
array_map(
fn(string $js): string => '$wire; $wire.watch(' .
Js::from($schemaComponentStatePath) .
', ($state, $old) => isStateChanged($state, $old) && eval(' .
Js::from($js) .
'))',
$afterStateUpdatedJs,
),
) !!}" @endif
@if (filled(
$visibilityJs = match ([filled($hiddenJs), filled($visibleJs)]) {
[true, true] => "(! ({$hiddenJs})) && ({$visibleJs})",
[true, false] => "! ({$hiddenJs})",
[false, true] => $visibleJs,
default => null,
})) x-bind:class="{ 'fi-hidden': ! ({!! $visibilityJs !!}) }"
x-cloak @endif
@class([
'fi-growable' =>
$schemaComponent instanceof Component && $schemaComponent->canGrow(),
])>
{{ $schemaComponent }}
</div>
@endif
@endforeach
</div>
@@ -0,0 +1,14 @@
<form
{{ $attributes->merge(
[
'id' => $getId(),
'wire:submit' => $getLivewireSubmitHandler(),
],
escape: false,
)->merge($getExtraAttributes(), escape: false)->class(['fi-sc-form', 'fi-dense' => $isDense()]) }}>
{{ $getChildSchema($schemaComponent::HEADER_SCHEMA_KEY) }}
{{ $getChildSchema() }}
{{ $getChildSchema($schemaComponent::FOOTER_SCHEMA_KEY) }}
</form>
@@ -0,0 +1,64 @@
@php
use Filament\Forms\Components\Contracts\HasNestedRecursiveValidationRules;
use Filament\Forms\Components\Field;
$fieldWrapperView = $getFieldWrapperView();
$errorMessages = null;
$errorMessage = null;
foreach ($getChildComponentContainer()->getComponents() as $childComponent) {
if (!($childComponent instanceof Field)) {
continue;
}
$statePath = $childComponent->getStatePath();
if (blank($statePath)) {
continue;
}
if ($errors->has($statePath)) {
if ($childComponent->shouldShowAllValidationMessages()) {
$errorMessages = $errors->get($statePath);
$shouldShowAllValidationMessages = true;
} else {
$errorMessage = $errors->first($statePath);
}
$areHtmlValidationMessagesAllowed = $childComponent->areHtmlValidationMessagesAllowed();
break;
}
if (!($childComponent instanceof HasNestedRecursiveValidationRules)) {
continue;
}
if ($errors->has("{$statePath}.*")) {
if ($childComponent->shouldShowAllValidationMessages()) {
$errorMessages = $errors->get("{$statePath}.*");
$shouldShowAllValidationMessages = true;
} else {
$errorMessage = $errors->first("{$statePath}.*");
}
$areHtmlValidationMessagesAllowed = $childComponent->areHtmlValidationMessagesAllowed();
break;
}
}
@endphp
<x-dynamic-component :component="$fieldWrapperView" :error-message="$errorMessage" :error-messages="$errorMessages" :are-html-error-messages-allowed="$areHtmlValidationMessagesAllowed ?? false" :should-show-all-validation-messages="$shouldShowAllValidationMessages ?? false"
:field="$schemaComponent">
<div
{{ $attributes->merge(
[
'id' => $getId(),
],
escape: false,
)->merge($getExtraAttributes(), escape: false)->class(['fi-sc-fused-group']) }}>
{{ $getChildSchema() }}
</div>
</x-dynamic-component>
@@ -0,0 +1,9 @@
<div
{{ $attributes->merge(
[
'id' => $getId(),
],
escape: false,
)->merge($getExtraAttributes(), escape: false) }}>
{{ $getChildSchema() }}
</div>
@@ -0,0 +1,19 @@
@php
use Filament\Support\Enums\Alignment;
$alignment = $getAlignment();
$height = $getImageHeight() ?? '8rem';
$width = $getImageWidth();
$tooltip = $getTooltip();
if (!$alignment instanceof Alignment) {
$alignment = filled($alignment) ? Alignment::tryFrom($alignment) ?? $alignment : null;
}
@endphp
<img alt="{{ $getAlt() }}" src="{{ $getUrl() }}"
@if (filled($tooltip)) x-tooltip="{ content: @js($tooltip), theme: $store.theme, allowHTML: @js($tooltip instanceof \Illuminate\Contracts\Support\Htmlable) }" @endif
{{ $getExtraAttributeBag()->class(['fi-sc-image', $alignment instanceof Alignment ? "fi-align-{$alignment->value}" : $alignment])->style([
'height: ' . e($height) => $height,
'width: ' . e($width) => $width,
]) }} />
@@ -0,0 +1,26 @@
@php
$extraAttributes = $getExtraAttributes();
$id = $getId();
@endphp
@if (filled($id) || filled($extraAttributes))
{!! '<div' !!}
{{-- Avoid formatting issues with unclosed elements --}}
{{ $attributes->merge(
[
'id' => $id,
],
escape: false,
)->merge($extraAttributes, escape: false) }}
>
@endif
@if (filled($key = $getLivewireKey()))
@livewire($getComponent(), $getComponentProperties(), key($key))
@else
@livewire($getComponent(), $getComponentProperties())
@endif
@if (filled($id) || filled($extraAttributes))
{!! '</div>' !!}
{{-- Avoid formatting issues with unclosed elements --}}
@endif
@@ -0,0 +1,69 @@
@php
use Illuminate\Support\Js;
$afterHeader = $getChildSchema($schemaComponent::AFTER_HEADER_SCHEMA_KEY)?->toHtmlString();
$isAside = $isAside();
$isCollapsed = $isCollapsed();
$isCollapsible = $isCollapsible();
$isCompact = $isCompact();
$isContained = $isContained();
$isDivided = $isDivided();
$isFormBefore = $isFormBefore();
$description = $getDescription();
$footer = $getChildSchema($schemaComponent::FOOTER_SCHEMA_KEY)?->toHtmlString();
$heading = $getHeading();
$headingTag = $getHeadingTag();
$icon = $getIcon();
$iconColor = $getIconColor();
$iconSize = $getIconSize();
$shouldPersistCollapsed = $shouldPersistCollapsed();
$isSecondary = $isSecondary();
$id = $getId();
$stateResetHandler =
$isCollapsible && !$isAside && !$shouldPersistCollapsed
? 'if (($event.detail.livewireId === ' .
Js::from($this->getId()) .
') && ($event.detail.schemaKey === ' .
Js::from($getRootContainer()->getKey()) .
')) $nextTick(() => isCollapsed = ' .
Js::from($isCollapsed) .
')'
: null;
@endphp
<div
{{ $attributes->merge(
[
'id' => $id,
],
escape: false,
)->merge($getExtraAttributes(), escape: false)->merge($getExtraAlpineAttributes(), escape: false)->class(['fi-sc-section']) }}>
@if (filled($label = $getLabel()))
<div class="fi-sc-section-label-ctn">
{{ $getChildSchema($schemaComponent::BEFORE_LABEL_SCHEMA_KEY) }}
<div class="fi-sc-section-label">
{{ $label }}
</div>
{{ $getChildSchema($schemaComponent::AFTER_LABEL_SCHEMA_KEY) }}
</div>
@endif
@if ($aboveContentContainer = $getChildSchema($schemaComponent::ABOVE_CONTENT_SCHEMA_KEY)?->toHtmlString())
{{ $aboveContentContainer }}
@endif
<x-filament::section :x-on:reset-schema-component-state.window="$stateResetHandler" :after-header="$afterHeader"
:aside="$isAside" :collapsed="$isCollapsed" :collapse-id="$id" :collapsible="$isCollapsible && !$isAside" :compact="$isCompact" :contained="$isContained"
:content-before="$isFormBefore" :description="$description" :divided="$isDivided" :footer="$footer" :has-content-el="false" :heading="$heading"
:heading-tag="$headingTag" :icon="$icon" :icon-color="$iconColor" :icon-size="$iconSize" :persist-collapsed="$shouldPersistCollapsed"
:secondary="$isSecondary">
{{ $getChildSchema()->extraAttributes(['class' => 'fi-section-content']) }}
</x-filament::section>
@if ($belowContentContainer = $getChildSchema($schemaComponent::BELOW_CONTENT_SCHEMA_KEY)?->toHtmlString())
{{ $belowContentContainer }}
@endif
</div>
@@ -0,0 +1,256 @@
@php
use Filament\Schemas\Components\Tabs\Tab;
use Filament\Schemas\View\SchemaIconAlias;
use Filament\Support\Icons\Heroicon;
$activeTab = $getActiveTab();
$hasDeferredBadges = $hasDeferredBadges();
$id = $getId();
$isContained = $isContained();
$isScrollable = $isScrollable();
$isVertical = $isVertical();
$label = $getLabel();
$livewireProperty = $getLivewireProperty();
$renderHookScopes = $getRenderHookScopes();
$tabs = $getChildSchema()->getComponents();
$tabsKey = $getKey();
$getTabVisibilityJs = function (Tab $tab, ?int $index = null, ?string $mode = null) use ($isScrollable): ?string {
$hiddenJs = $tab->getHiddenJs();
$visibleJs = $tab->getVisibleJs();
$baseJs = match ([filled($hiddenJs), filled($visibleJs)]) {
[true, true] => "(! ({$hiddenJs})) && ({$visibleJs})",
[true, false] => "! ({$hiddenJs})",
[false, true] => $visibleJs,
default => null,
};
if ($isScrollable || $index === null || $mode === null) {
return $baseJs;
}
$tabKey = $tab->getKey(isAbsolute: false);
$dropdownJs = match ($mode) {
'inline' => "(!withinDropdownMounted || withinDropdownIndex === null || {$index} < withinDropdownIndex)",
'trigger'
=> "(withinDropdownMounted && withinDropdownIndex !== null && {$index} >= withinDropdownIndex && '{$tabKey}' === tab)",
default => null,
};
return $baseJs ? "{$baseJs} && {$dropdownJs}" : $dropdownJs;
};
@endphp
@if (blank($livewireProperty))
<div x-data="tabsSchemaComponent({
activeTab: @js($activeTab),
isScrollable: @js($isScrollable),
isTabPersisted: @js($isTabPersisted()),
isTabPersistedInQueryString: @js($isTabPersistedInQueryString()),
livewireId: @js($this->getId()),
schemaKey: @js($getRootContainer()->getKey()),
tab: @if ($isTabPersisted() && filled($id)) $persist(null).as(@js($id)) @else @js(null) @endif,
tabQueryStringKey: @js($getTabQueryStringKey()),
})" x-load
x-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('tabs', 'filament/schemas') }}"
wire:ignore.self
{{ $attributes->merge(
[
'id' => $id,
'wire:key' => $getLivewireKey() . '.container',
],
escape: false,
)->merge($getExtraAttributes(), escape: false)->merge($getExtraAlpineAttributes(), escape: false)->class(['fi-sc-tabs', 'fi-contained' => $isContained, 'fi-vertical' => $isVertical]) }}>
<input type="hidden"
value="{{ collect($tabs)->filter(static fn(Tab $tab): bool => $tab->isVisible())->map(static fn(Tab $tab) => $tab->getKey(isAbsolute: false))->values()->toJson() }}"
x-ref="tabsData" />
<x-filament::tabs :contained="$isContained" :label="$label" :vertical="$isVertical" x-cloak
:x-bind:class="!$isScrollable ? '{ \'fi-invisible\': ! withinDropdownMounted }' : null" :x-data="$hasDeferredBadges ? '{
deferredBadges: {},
isLoadingDeferredBadges: true,
async init() {
try {
const badges = await $wire.callSchemaComponentMethod(' . \Illuminate\Support\Js::from($tabsKey) . ', \'getDeferredTabBadges\')
this.deferredBadges = badges ?? {}
}
finally {
this.isLoadingDeferredBadges = false
}
},
}
' : null">
@foreach ($getStartRenderHooks() as $startRenderHook)
{{ \Filament\Support\Facades\FilamentView::renderHook($startRenderHook, scopes: $renderHookScopes) }}
@endforeach
@foreach ($tabs as $index => $tab)
@php
$isTabBadgeDeferred = $tab->isBadgeDeferred();
$tabBadge = $isTabBadgeDeferred ? null : $tab->getBadge();
$tabBadgeColor = $isTabBadgeDeferred ? null : $tab->getBadgeColor($tabBadge);
$tabBadgeIcon = $isTabBadgeDeferred ? null : $tab->getBadgeIcon($tabBadge);
$tabBadgeIconPosition = $isTabBadgeDeferred ? null : $tab->getBadgeIconPosition($tabBadge);
$tabBadgeTooltip = $isTabBadgeDeferred ? null : $tab->getBadgeTooltip($tabBadge);
$tabExtraAttributeBag = $tab->getExtraAttributeBag();
$tabIcon = $tab->getIcon();
$tabIconPosition = $tab->getIconPosition();
$tabKey = $tab->getKey(isAbsolute: false);
$tabLabel = $tab->getLabel();
$tabVisibilityJs = $getTabVisibilityJs($tab, $index, 'inline');
@endphp
<x-filament::tabs.item :alpine-active="'tab === \'' . $tabKey . '\''" :alpine-deferred-badge-data="$isTabBadgeDeferred ? 'deferredBadges[' . \Illuminate\Support\Js::from($index) . ']' : null" :alpine-deferred-badge-loading="$isTabBadgeDeferred ? 'isLoadingDeferredBadges' : null" :attributes="$tabExtraAttributeBag"
:badge="$tabBadge" :badge-color="$tabBadgeColor" :badge-icon="$tabBadgeIcon" :badge-icon-position="$tabBadgeIconPosition" :badge-tooltip="$tabBadgeTooltip"
:data-tab-key="$tabKey" :icon="$tabIcon" :icon-position="$tabIconPosition" :x-cloak="$tabVisibilityJs !== null"
:x-on:click="'tab = \'' . $tabKey . '\''" :x-show="$tabVisibilityJs">
{{ $tabLabel }}
</x-filament::tabs.item>
@endforeach
@if (!$isScrollable)
<x-filament::dropdown :placement="__('filament-panels::layout.direction') === 'ltr' ? 'bottom-start' : 'bottom-end'">
<x-slot name="trigger">
@foreach ($tabs as $index => $tab)
@php
$isTabBadgeDeferred = $tab->isBadgeDeferred();
$tabBadge = $isTabBadgeDeferred ? null : $tab->getBadge();
$tabBadgeColor = $isTabBadgeDeferred ? null : $tab->getBadgeColor($tabBadge);
$tabBadgeTooltip = $isTabBadgeDeferred ? null : $tab->getBadgeTooltip($tabBadge);
$tabExtraAttributeBag = $tab->getExtraAttributeBag();
$tabKey = $tab->getKey(isAbsolute: false);
$tabLabel = $tab->getLabel();
$tabVisibilityJs = $getTabVisibilityJs($tab, $index, 'trigger');
@endphp
<x-filament::tabs.item :alpine-active="'tab === \'' . $tabKey . '\''" :alpine-deferred-badge-data="$isTabBadgeDeferred
? 'deferredBadges[' . \Illuminate\Support\Js::from($index) . ']'
: null" :alpine-deferred-badge-loading="$isTabBadgeDeferred ? 'isLoadingDeferredBadges' : null"
:attributes="$tabExtraAttributeBag" :badge="$tabBadge" :badge-color="$tabBadgeColor" :badge-tooltip="$tabBadgeTooltip"
:icon="Heroicon::ChevronDown" :icon-alias="SchemaIconAlias::COMPONENTS_TABS_DROPDOWN_TRIGGER_BUTTON" :x-cloak="$tabVisibilityJs !== null" :x-show="$tabVisibilityJs">
{{ $tabLabel }}
</x-filament::tabs.item>
@endforeach
<x-filament::tabs.item x-show="isDropdownButtonVisible">
{{ \Filament\Support\generate_icon_html(
Heroicon::EllipsisHorizontal,
alias: SchemaIconAlias::COMPONENTS_TABS_MORE_TABS_BUTTON,
) }}
</x-filament::tabs.item>
</x-slot>
<x-filament::dropdown.list>
@foreach ($tabs as $index => $tab)
@php
$isTabBadgeDeferred = $tab->isBadgeDeferred();
$tabBadge = $isTabBadgeDeferred ? null : $tab->getBadge();
$tabBadgeColor = $isTabBadgeDeferred ? null : $tab->getBadgeColor($tabBadge);
$tabBadgeTooltip = $isTabBadgeDeferred ? null : $tab->getBadgeTooltip($tabBadge);
$tabIcon = $tab->getIcon();
$tabKey = $tab->getKey(isAbsolute: false);
$tabLabel = $tab->getLabel();
@endphp
<x-filament::dropdown.list.item :alpine-deferred-badge-data="$isTabBadgeDeferred
? 'deferredBadges[' . \Illuminate\Support\Js::from($index) . ']'
: null" :alpine-deferred-badge-loading="$isTabBadgeDeferred ? 'isLoadingDeferredBadges' : null" :badge="$tabBadge"
:badge-color="$tabBadgeColor" :badge-tooltip="$tabBadgeTooltip" :icon="$tabIcon"
x-bind:class="{ 'fi-selected': tab === '{{ $tabKey }}' }"
:x-on:click="'tab = \'' . $tabKey . '\'; close($event);'" :x-show="$index . ' >= withinDropdownIndex'">
{{ $tabLabel }}
</x-filament::dropdown.list.item>
@endforeach
</x-filament::dropdown.list>
</x-filament::dropdown>
@endif
@foreach ($getEndRenderHooks() as $endRenderHook)
{{ \Filament\Support\Facades\FilamentView::renderHook($endRenderHook, scopes: $renderHookScopes) }}
@endforeach
</x-filament::tabs>
@foreach ($tabs as $tab)
@php
$tabVisibilityJs = $getTabVisibilityJs($tab);
@endphp
@if ($tabVisibilityJs)
<div x-cloak x-show="{!! $tabVisibilityJs !!}">
{{ $tab }}
</div>
@else
{{ $tab }}
@endif
@endforeach
</div>
@else
@php
$activeTab = strval($this->{$livewireProperty});
@endphp
<div @if ($hasDeferredBadges) x-data="{
deferredBadges: {},
isLoadingDeferredBadges: true,
async init() {
try {
const badges = await $wire.callSchemaComponentMethod(
@js($tabsKey),
'getDeferredTabBadges',
)
this.deferredBadges = badges ?? {}
} finally {
this.isLoadingDeferredBadges = false
}
},
}" @endif
{{ $attributes->merge(
[
'id' => $id,
'wire:key' => $getLivewireKey() . '.container',
],
escape: false,
)->merge($getExtraAttributes(), escape: false)->class(['fi-sc-tabs', 'fi-contained' => $isContained, 'fi-vertical' => $isVertical]) }}>
<x-filament::tabs :contained="$isContained" :label="$label" :vertical="$isVertical">
@foreach ($getStartRenderHooks() as $startRenderHook)
{{ \Filament\Support\Facades\FilamentView::renderHook($startRenderHook, scopes: $renderHookScopes) }}
@endforeach
@foreach ($getChildSchema()->getComponents(withOriginalKeys: true) as $tabKey => $tab)
@php
$isTabBadgeDeferred = $tab->isBadgeDeferred();
$tabBadge = $isTabBadgeDeferred ? null : $tab->getBadge();
$tabBadgeColor = $isTabBadgeDeferred ? null : $tab->getBadgeColor($tabBadge);
$tabBadgeIcon = $isTabBadgeDeferred ? null : $tab->getBadgeIcon($tabBadge);
$tabBadgeIconPosition = $isTabBadgeDeferred ? null : $tab->getBadgeIconPosition($tabBadge);
$tabBadgeTooltip = $isTabBadgeDeferred ? null : $tab->getBadgeTooltip($tabBadge);
$tabExtraAttributeBag = $tab->getExtraAttributeBag();
$tabIcon = $tab->getIcon();
$tabIconPosition = $tab->getIconPosition();
$tabKey = strval($tabKey);
$tabLabel = $tab->getLabel() ?? $this->generateTabLabel($tabKey);
@endphp
<x-filament::tabs.item :active="$activeTab === $tabKey" :alpine-deferred-badge-data="$isTabBadgeDeferred ? 'deferredBadges[' . \Illuminate\Support\Js::from($tabKey) . ']' : null" :alpine-deferred-badge-loading="$isTabBadgeDeferred ? 'isLoadingDeferredBadges' : null" :attributes="$tabExtraAttributeBag"
:badge="$tabBadge" :badge-color="$tabBadgeColor" :badge-icon="$tabBadgeIcon" :badge-icon-position="$tabBadgeIconPosition" :badge-tooltip="$tabBadgeTooltip"
:icon="$tabIcon" :icon-position="$tabIconPosition"
:wire:click="'$set(\'' . $livewireProperty . '\', ' . (filled($tabKey) ? ('\'' . $tabKey . '\'') : 'null') . ')'">
{{ $tabLabel }}
</x-filament::tabs.item>
@endforeach
@foreach ($getEndRenderHooks() as $endRenderHook)
{{ \Filament\Support\Facades\FilamentView::renderHook($endRenderHook, scopes: $renderHookScopes) }}
@endforeach
</x-filament::tabs>
@foreach ($getChildSchema()->getComponents(withOriginalKeys: true) as $tabKey => $tab)
{{ $tab->key($tabKey) }}
@endforeach
</div>
@endif
@@ -0,0 +1,42 @@
@php
$id = $getId();
$key = $getKey(isAbsolute: false);
$tabs = $getContainer()->getParentComponent();
$isContained = $tabs->isContained();
$livewireProperty = $tabs->getLivewireProperty();
$childSchema = $getChildSchema();
@endphp
@if (!empty($childSchema->getComponents()))
@if (blank($livewireProperty))
<div x-bind:class="{
'fi-active': tab === @js($key),
}"
x-on:expand="tab = @js($key)"
{{ $attributes->merge(
[
'aria-labelledby' => $id,
'id' => $id,
'role' => 'tabpanel',
'wire:key' => $getLivewireKey() . '.container',
],
escape: false,
)->merge($getExtraAttributes(), escape: false)->class(['fi-sc-tabs-tab']) }}>
{{ $childSchema }}
</div>
@elseif (strval($this->{$livewireProperty}) === strval($key))
<div
{{ $attributes->merge(
[
'aria-labelledby' => $id,
'id' => $id,
'role' => 'tabpanel',
'wire:key' => $getLivewireKey() . '.container',
],
escape: false,
)->merge($getExtraAttributes(), escape: false)->class(['fi-sc-tabs-tab fi-active']) }}>
{{ $childSchema }}
</div>
@endif
@endif
@@ -0,0 +1,59 @@
@php
use Filament\Schemas\View\Components\TextComponent;
use Filament\Support\Enums\FontFamily;
use Filament\Support\Enums\FontWeight;
use Filament\Support\RawJs;
$color = $getColor();
$content = $getContent();
$icon = $getIcon();
$iconPosition = $getIconPosition();
$iconSize = $getIconSize();
$size = $getSize();
$tooltip = $getTooltip();
$weight = $getWeight();
$fontFamily = $getFontFamily();
$copyableState = $getCopyableState($content) ?? $content;
$copyMessage = $getCopyMessage($copyableState);
$copyMessageDuration = $getCopyMessageDuration($copyableState);
$isCopyable = $isCopyable($copyableState);
@endphp
@if ($isBadge())
<x-filament::badge :color="$color" :icon="$icon" :icon-position="$iconPosition" :icon-size="$iconSize" :size="$size instanceof \Filament\Support\Enums\TextSize ? $size->value : $size"
:x-on:click="
$isCopyable ? '
window.navigator.clipboard.writeText(' . \Illuminate\Support\Js::from($copyableState) . ')
$tooltip(' . \Illuminate\Support\Js::from($copyMessage) . ', {
theme: $store.theme,
timeout: ' . \Illuminate\Support\Js::from($copyMessageDuration) . ',
})
' : null
" :tag="$isCopyable ? 'button' : 'span'" :tooltip="$tooltip" :attributes="\Filament\Support\prepare_inherited_attributes($getExtraAttributeBag()->class(['fi-sc-text']))">
{{ $content }}
</x-filament::badge>
@else
<span
@if ($isCopyable) x-on:click="
window.navigator.clipboard.writeText(@js($copyableState))
$tooltip(@js($copyMessage), {
theme: $store.theme,
timeout: @js($copyMessageDuration),
})
" @endif
@if (filled($tooltip)) x-tooltip="{
content: @js($tooltip),
theme: $store.theme,
allowHTML: @js($tooltip instanceof \Illuminate\Contracts\Support\Htmlable),
}" @endif
{{ new \Illuminate\View\ComponentAttributeBag()->color(TextComponent::class, $color)->class([
'fi-sc-text',
'fi-copyable' => $isCopyable,
$size instanceof \BackedEnum ? "fi-size-{$size->value}" : $size,
$weight instanceof FontWeight ? "fi-font-{$weight->value}" : $weight,
$fontFamily instanceof FontFamily ? "fi-font-{$fontFamily->value}" : $fontFamily,
])->merge($getExtraAttributes(), escape: false) }}>
{{ $content }}
</span>
@endif
@@ -0,0 +1,11 @@
<ul
{{ $getExtraAttributeBag()->grid($getColumns(), \Filament\Support\Enums\GridDirection::Column)->class([
'fi-sc-unordered-list',
($size = $getSize()) instanceof \Filament\Support\Enums\TextSize ? "fi-size-{$size->value}" : $size,
]) }}>
@foreach ($getChildSchema()->getComponents() as $schemaComponent)
<li>
{{ $schemaComponent }}
</li>
@endforeach
</ul>
@@ -0,0 +1,129 @@
@php
$isContained = $isContained();
$key = $getKey();
$previousAction = $getAction('previous');
$nextAction = $getAction('next');
$steps = $getChildSchema()->getComponents();
$isHeaderHidden = $isHeaderHidden();
@endphp
<div x-load
x-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('wizard', 'filament/schemas') }}"
x-data="wizardSchemaComponent({
isSkippable: @js($isSkippable()),
isStepPersistedInQueryString: @js($isStepPersistedInQueryString()),
key: @js($key),
livewireId: @js($this->getId()),
schemaKey: @js($getRootContainer()->getKey()),
startStep: @js($getStartStep()),
stepQueryStringKey: @js($getStepQueryStringKey()),
})"
x-on:next-wizard-step.window="if ($event.detail.key === @js($key)) goToNextStep()"
x-on:go-to-wizard-step.window="$event.detail.key === @js($key) && goToStep($event.detail.step)"
wire:ignore.self
{{ $attributes->merge(
[
'id' => $getId(),
],
escape: false,
)->merge($getExtraAttributes(), escape: false)->merge($getExtraAlpineAttributes(), escape: false)->class(['fi-sc-wizard', 'fi-contained' => $isContained, 'fi-sc-wizard-header-hidden' => $isHeaderHidden]) }}>
<input type="hidden"
value="{{ collect($steps)->filter(static fn(\Filament\Schemas\Components\Wizard\Step $step): bool => $step->isVisible())->map(static fn(\Filament\Schemas\Components\Wizard\Step $step): ?string => $step->getKey())->values()->toJson() }}"
x-ref="stepsData" />
@if (!$isHeaderHidden)
<ol @if (filled($label = $getLabel())) aria-label="{{ $label }}" @endif role="list" x-cloak
x-ref="header" class="fi-sc-wizard-header">
@foreach ($steps as $step)
<li class="fi-sc-wizard-header-step"
x-bind:class="{
'fi-active': getStepIndex(step) === {{ $loop->index }},
'fi-completed': getStepIndex(step) > {{ $loop->index }},
}">
<button type="button"
x-bind:aria-current="getStepIndex(step) === {{ $loop->index }} ? 'step' : null"
x-on:click="step = @js($step->getKey())"
x-bind:disabled="!isStepAccessible(@js($step->getKey())) || @js($previousAction->isDisabled())"
class="fi-sc-wizard-header-step-btn">
<div class="fi-sc-wizard-header-step-icon-ctn">
@php
$completedIcon = $step->getCompletedIcon();
@endphp
{{ \Filament\Support\generate_icon_html(
$completedIcon ?? \Filament\Support\Icons\Heroicon::OutlinedCheck,
alias: filled($completedIcon) ? null : \Filament\Schemas\View\SchemaIconAlias::COMPONENTS_WIZARD_COMPLETED_STEP,
attributes: new \Illuminate\View\ComponentAttributeBag([
'x-cloak' => 'x-cloak',
'x-show' => "getStepIndex(step) > {$loop->index}",
]),
size: \Filament\Support\Enums\IconSize::Large,
) }}
@if (filled($icon = $step->getIcon()))
{{ \Filament\Support\generate_icon_html(
$icon,
attributes: new \Illuminate\View\ComponentAttributeBag([
'x-cloak' => 'x-cloak',
'x-show' => "getStepIndex(step) <= {$loop->index}",
]),
size: \Filament\Support\Enums\IconSize::Large,
) }}
@else
<span x-show="getStepIndex(step) <= {{ $loop->index }}"
class="fi-sc-wizard-header-step-number">
{{ str_pad($loop->index + 1, 2, '0', STR_PAD_LEFT) }}
</span>
@endif
</div>
<div class="fi-sc-wizard-header-step-text">
@if (!$step->isLabelHidden())
<span class="fi-sc-wizard-header-step-label">
{{ $step->getLabel() }}
</span>
@endif
@if (filled($description = $step->getDescription()))
<span class="fi-sc-wizard-header-step-description">
{{ $description }}
</span>
@endif
</div>
</button>
@if (!$loop->last)
<svg fill="none" preserveAspectRatio="none" viewBox="0 0 22 80" aria-hidden="true"
class="fi-sc-wizard-header-step-separator">
<path d="M0 -2L20 40L0 82" stroke-linejoin="round" stroke="currentcolor"
vector-effect="non-scaling-stroke"></path>
</svg>
@endif
</li>
@endforeach
</ol>
@endif
@foreach ($steps as $step)
{{ $step }}
@endforeach
<div x-cloak class="fi-sc-wizard-footer">
<div x-cloak @if (!$previousAction->isDisabled()) x-on:click="goToPreviousStep" @endif x-show="! isFirstStep()">
{{ $previousAction }}
</div>
<div x-show="isFirstStep()">
{{ $getCancelAction() }}
</div>
<div x-cloak @if (!$nextAction->isDisabled()) x-on:click="requestNextStep()" @endif
x-bind:class="{ 'fi-hidden': isLastStep() }" wire:loading.class="fi-disabled">
{{ $nextAction }}
</div>
<div x-bind:class="{ 'fi-hidden': !isLastStep() }">
{{ $getSubmitAction() }}
</div>
</div>
</div>
@@ -0,0 +1,36 @@
@php
$id = $getId();
$key = $getKey();
$wizard = $getContainer()->getParentComponent();
$isContained = $wizard->isContained();
$alpineSubmitHandler = $hasFormWrapper() ? $wizard->getAlpineSubmitHandler() : null;
@endphp
<{{ filled($alpineSubmitHandler) ? 'form' : 'div' }} x-bind:tabindex="$el.querySelector('[autofocus]') ? '-1' : '0'"
x-bind:class="{
'fi-active': step === @js($key),
}"
x-on:expand="
if (! isStepAccessible(@js($key))) {
return
}
step = @js($key)
"
@if (filled($alpineSubmitHandler)) x-on:submit.prevent="isLastStep() ? {!! $alpineSubmitHandler !!} : requestNextStep()" @endif
x-cloak x-ref="step-{{ $key }}"
{{ $attributes->merge(
[
'aria-labelledby' => $id,
'id' => $id,
'role' => 'tabpanel',
],
escape: false,
)->merge($getExtraAttributes(), escape: false)->class(['fi-sc-wizard-step']) }}>
{{ $getChildSchema() }}
@if (filled($alpineSubmitHandler))
{{-- This is a hack to allow the form to submit when the user presses the enter key, even if there is no other submit button in the form. --}}
<input type="submit" hidden />
@endif
</{{ filled($alpineSubmitHandler) ? 'form' : 'div' }}>