'primary',
'deleteButton' => null,
'disabled' => false,
'form' => null,
'formId' => null,
'href' => null,
'icon' => null,
'iconAlias' => null,
'iconPosition' => IconPosition::Before,
'iconSize' => null,
'keyBindings' => null,
'loadingIndicator' => true,
'size' => Size::Medium,
'spaMode' => null,
'tag' => 'span',
'target' => null,
'tooltip' => null,
'type' => 'button',
]));
foreach ($attributes->all() as $__key => $__value) {
if (in_array($__key, $__propNames)) {
$$__key = $$__key ?? $__value;
} else {
$__newAttributes[$__key] = $__value;
}
}
$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);
unset($__propNames);
unset($__newAttributes);
foreach (array_filter(([
'color' => 'primary',
'deleteButton' => null,
'disabled' => false,
'form' => null,
'formId' => null,
'href' => null,
'icon' => null,
'iconAlias' => null,
'iconPosition' => IconPosition::Before,
'iconSize' => null,
'keyBindings' => null,
'loadingIndicator' => true,
'size' => Size::Medium,
'spaMode' => null,
'tag' => 'span',
'target' => null,
'tooltip' => null,
'type' => 'button',
]), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
$$__key = $$__key ?? $__value;
}
$__defined_vars = get_defined_vars();
foreach ($attributes->all() as $__key => $__value) {
if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}
unset($__defined_vars, $__key, $__value); ?>
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);
?>
<
x-bind:id="$id('key-bindings')"
x-mousetrap.global.map(fn (string $keyBinding): string => str_replace('+', '-', $keyBinding))->implode('.')); ?>="document.getElementById($el.id)?.click()"
x-tooltip="{
content: toHtml() ?>,
theme: $store.theme,
allowHTML: toHtml() ?>,
}"
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)); ?>
>
$hasLoadingIndicator,
'wire:target' => $hasLoadingIndicator ? $loadingIndicatorTarget : false,
])), size: $iconSize ?? \Filament\Support\Enums\IconSize::Small)); ?>
'',
'wire:target' => $loadingIndicatorTarget,
])), size: $iconSize ?? \Filament\Support\Enums\IconSize::Small)); ?>
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);
}
?>
$hasLoadingIndicator,
'wire:target' => $hasLoadingIndicator ? $loadingIndicatorTarget : false,
])), size: $iconSize ?? \Filament\Support\Enums\IconSize::Small)); ?>
'',
'wire:target' => $loadingIndicatorTarget,
])), size: $iconSize ?? \Filament\Support\Enums\IconSize::Small)); ?>
>