| Closure | null */ protected string | array | Closure | null $prefixIconColor = null; protected string | BackedEnum | Htmlable | Closure | null $suffixIcon = null; /** * @var string | array | Closure | null */ protected string | array | Closure | null $suffixIconColor = null; protected bool | Closure $isPrefixInline = false; protected bool | Closure $isSuffixInline = false; protected function setUp(): void { parent::setUp(); $this->disabledClick(); } public function type(string | Closure | null $type): static { $this->type = $type; return $this; } public function getType(): string { return $this->evaluate($this->type) ?? 'text'; } public function mask(string | RawJs | Closure | null $mask): static { $this->mask = $mask; return $this; } public function getMask(): string | RawJs | null { return $this->evaluate($this->mask); } public function prefix(string | Htmlable | Closure | null $label, bool | Closure $isInline = false): static { $this->prefixLabel = $label; $this->inlinePrefix($isInline); return $this; } public function suffix(string | Htmlable | Closure | null $label, bool | Closure $isInline = false): static { $this->suffixLabel = $label; $this->inlineSuffix($isInline); return $this; } public function inlinePrefix(bool | Closure $isInline = true): static { $this->isPrefixInline = $isInline; return $this; } public function inlineSuffix(bool | Closure $isInline = true): static { $this->isSuffixInline = $isInline; return $this; } public function prefixIcon(string | BackedEnum | Htmlable | Closure | null $icon, bool | Closure $isInline = false): static { $this->prefixIcon = $icon; $this->inlinePrefix($isInline); return $this; } /** * @param string | array | Closure | null $color */ public function prefixIconColor(string | array | Closure | null $color = null): static { $this->prefixIconColor = $color; return $this; } public function suffixIcon(string | BackedEnum | Htmlable | Closure | null $icon, bool | Closure $isInline = false): static { $this->suffixIcon = $icon; $this->inlineSuffix($isInline); return $this; } /** * @param string | array | Closure | null $color */ public function suffixIconColor(string | array | Closure | null $color = null): static { $this->suffixIconColor = $color; return $this; } public function getPrefixLabel(): string | Htmlable | null { return $this->evaluate($this->prefixLabel); } public function getSuffixLabel(): string | Htmlable | null { return $this->evaluate($this->suffixLabel); } public function getPrefixIcon(): string | BackedEnum | Htmlable | null { return $this->evaluate($this->prefixIcon); } public function getSuffixIcon(): string | BackedEnum | Htmlable | null { return $this->evaluate($this->suffixIcon); } /** * @return string | array | null */ public function getPrefixIconColor(): string | array | null { return $this->evaluate($this->prefixIconColor); } /** * @return string | array | null */ public function getSuffixIconColor(): string | array | null { return $this->evaluate($this->suffixIconColor); } public function isPrefixInline(): bool { return (bool) $this->evaluate($this->isPrefixInline); } public function isSuffixInline(): bool { return (bool) $this->evaluate($this->isSuffixInline); } public function toEmbeddedHtml(): string { $isDisabled = $this->isDisabled(); $state = $this->getState(); $mask = $this->getMask(); $alignment = $this->getAlignment() ?? Alignment::Start; if (! $alignment instanceof Alignment) { $alignment = filled($alignment) ? (Alignment::tryFrom($alignment) ?? $alignment) : null; } $type = filled($mask) ? 'text' : $this->getType(); $prefixIcon = $this->getPrefixIcon(); $prefixIconColor = $this->getPrefixIconColor(); $prefixLabel = $this->getPrefixLabel(); $suffixIcon = $this->getSuffixIcon(); $suffixIconColor = $this->getSuffixIconColor(); $suffixLabel = $this->getSuffixLabel(); $isPrefixInline = $this->isPrefixInline(); $isSuffixInline = $this->isSuffixInline(); $hasPrefix = $prefixIcon || filled($prefixLabel); $hasSuffix = $suffixIcon || filled($suffixLabel); $attributes = $this->getExtraAttributeBag() ->merge([ 'x-load' => true, 'x-load-src' => FilamentAsset::getAlpineComponentSrc('columns/text-input', 'filament/tables'), 'x-data' => 'textInputTableColumn({ name: ' . Js::from($this->getName()) . ', recordKey: ' . Js::from($this->getRecordKey()) . ', state: ' . Js::from($state) . ', })', ], escape: false) ->class([ 'fi-ta-text-input', 'fi-inline' => $this->isInline(), ]); $inputAttributes = $this->getExtraInputAttributeBag() ->merge([ 'aria-label' => e(trim(strip_tags(($ariaLabel = $this->getLabel()) instanceof Htmlable ? $ariaLabel->toHtml() : $ariaLabel)), doubleEncode: false), 'disabled' => $isDisabled, 'wire:loading.attr' => 'disabled', 'wire:target' => implode(',', Table::LOADING_TARGETS), 'x-bind:disabled' => $isDisabled ? null : 'isLoading', 'inputmode' => $this->getInputMode(), 'placeholder' => filled($placeholder = $this->getPlaceholder()) ? e($placeholder) : null, 'step' => $this->getStep(), 'type' => $type, 'x-mask' . ($mask instanceof RawJs ? ':dynamic' : '') => filled($mask) ? $mask : null, 'x-tooltip' => filled($tooltip = $this->getTooltip($state)) ? '{ content: ' . Js::from($tooltip) . ', theme: $store.theme, allowHTML: ' . Js::from($tooltip instanceof Htmlable) . ', }' : null, ], escape: false) ->class([ 'fi-input', ($alignment instanceof Alignment) ? "fi-align-{$alignment->value}" : (is_string($alignment) ? $alignment : ''), ]); ob_start(); ?>
toHtml() ?> >
color(IconComponent::class, $prefixIconColor))?->toHtml() ?>
onclick="if (typeof this.showPicker === 'function') { this.showPicker() }" x-model.lazy="state" toHtml() ?> />
color(IconComponent::class, $suffixIconColor))?->toHtml() ?>