| Closure $schema */ final public function __construct(array | Closure $schema) { $this->schema($schema); } /** * @param array | Closure $schema */ public static function make(array | Closure $schema): static { $static = app(static::class, ['schema' => $schema]); $static->configure(); return $static; } public function toEmbeddedHtml(): string { $statePath = $this->getStatePath(); $fromBreakpoint = $this->getFromBreakpoint(); $verticalAlignment = $this->getVerticalAlignment(); $alignment = $this->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; } $attributes = (new FilamentComponentAttributeBag) ->merge($this->getExtraAttributes(), escape: false) ->class([ 'fi-sc-flex', 'fi-dense' => $this->isDense(), 'fi-from-' . ($fromBreakpoint ?? 'default'), ($verticalAlignment instanceof VerticalAlignment) ? "fi-vertical-align-{$verticalAlignment->value}" : $verticalAlignment, ($alignment instanceof Alignment) ? "fi-align-{$alignment->value}" : $alignment, ]); ob_start(); ?>
toHtml() ?>> getChildSchema()->getComponents() as $schemaComponent) { ?>
toHtml() ?>
getHiddenJs(); $visibleJs = $schemaComponent->getVisibleJs(); $schemaComponentStatePath = $schemaComponent->getStatePath(); $visibilityJs = match ([filled($hiddenJs), filled($visibleJs)]) { [true, true] => "(! ({$hiddenJs})) && ({$visibleJs})", [true, false] => "! ({$hiddenJs})", [false, true] => $visibleJs, default => null, }; ?>
getAfterStateUpdatedJs()) { ?> x-init=" '$wire; $wire.watch(' . Js::from($schemaComponentStatePath) . ', ($state, $old) => isStateChanged($state, $old) && eval(' . Js::from($js) . '))', $afterStateUpdatedJs, )) ?>" x-bind:class="{ 'fi-hidden': ! () }" x-cloak canGrow()) { ?> class="fi-growable" > toHtml() ?>