shouldAutosize = $condition; return $this; } public function cols(int | Closure | null $cols): static { $this->cols = $cols; return $this; } public function rows(int | Closure | null $rows): static { $this->rows = $rows; return $this; } public function getCols(): ?int { return $this->evaluate($this->cols); } public function getRows(): ?int { return $this->evaluate($this->rows); } public function shouldAutosize(): bool { return (bool) $this->evaluate($this->shouldAutosize); } public function toEmbeddedHtml(): string { $isDisabled = $this->isDisabled(); $rows = $this->getRows(); $placeholder = $this->getPlaceholder(); $shouldAutosize = $this->shouldAutosize(); $statePath = $this->getStatePath(); $initialHeight = (($rows ?? 2) * 1.5) + 0.75; $wrapperAttributes = $this->getExtraAttributeBag() ->class([ 'fi-fo-textarea', 'fi-autosizable' => $shouldAutosize, ]); $textareaAttributes = $this->getExtraInputAttributeBag() ->merge([ 'autocomplete' => $this->getAutocomplete(), 'autofocus' => $this->isAutofocused(), 'cols' => $this->getCols(), 'disabled' => $isDisabled, 'id' => $this->getId(), 'maxlength' => $this->getMaxLength(), 'minlength' => $this->getMinLength(), 'placeholder' => filled($placeholder) ? e($placeholder) : null, 'readonly' => $this->isReadOnly(), 'required' => $this->isRequired(), 'rows' => $rows, $this->applyStateBindingModifiers('wire:model') => $statePath, ], escape: false); $alpineAttributes = $this->getExtraAlpineAttributeBag(); ob_start(); ?>