ChatInput
class ChatInput extends BeartropyComponent
ChatInput component.
A specialized textarea for chat applications with auto-resize, single-line/stacked layout switching, and submit-on-Enter.
Traits
Trait HasPresets.
Trait HasErrorBag.
Properties
| string|null | $size | Component size (md, lg, etc.) used for preset resolution. |
from BeartropyComponent |
| string|null | $id | Component id. |
|
| string|null | $name | Input name. |
|
| string|null | $label | Input label. |
|
| string|null | $color | Color preset key. |
|
| string | $placeholder | Placeholder text. |
|
| bool | $disabled | Disabled state. |
|
| bool | $readonly | Readonly state. |
|
| bool | $required | Required state. |
|
| string|null | $help | Helper text. |
|
| string|null | $hint | Hint text. |
|
| mixed | $customError | Custom error message. |
|
| int|null | $maxLength | Max character length. |
|
| bool | $stacked | Stacked layout. |
|
| bool | $submitOnEnter | Submit form on Enter key. |
|
| string|null | $action | Livewire action to fire on submit. |
|
| bool | $border | Show border styling. |
Methods
Compute component presets based on context.
No description
No description
No description
No description
No description
No description
No description
No description
No description
Determine the error state for a specific field.
Analyze wire:model attributes to determine binding state.
Resolve the size preset for the component.
Create a new ChatInput component instance.
Get the view / contents that represent the component.
Details
in
HasPresets at line 21
array
getComponentPresets(string|null $componentName = null, ComponentAttributeBag|null $attributes = null)
Compute component presets based on context.
in
HasPresets at line 59
protected array
loadPresets(string $componentName)
No description
in
HasPresets at line 73
protected array
loadComponentDefaults(string $componentName)
No description
in
HasPresets at line 88
protected bool
detectHasVariants(array $colors)
No description
in
HasPresets at line 116
protected array
computeSupports(array $sizes, array $colorsArray, array $defaults, array $magicProps)
No description
in
HasPresets at line 137
protected array
resolveSize(array $supports, array $sizes, array $defaults, array $magicProps)
No description
in
HasPresets at line 174
protected array
resolveVariant(array $supports, array $colorsArray, array $componentPresets, array $defaults, array $magicProps, bool $hasVariants)
No description
in
HasPresets at line 223
protected array
resolveColor(array $supports, array $colorsArray, array $componentPresets, array $defaults, array $magicProps, string|null $variant, bool $hasVariants)
No description
in
HasPresets at line 293
protected array
resolveFill(array $supports, array $attributes, array $defaults)
No description
in
HasPresets at line 338
protected string
buildCacheKey(string $component, array $supports, string|null $size, string|null $variant, string|null $color, bool $shouldFill)
No description
in
HasPresets at line 349
protected void
syncInstanceProps(array $supports, string|null $size, string|null $variant, string|null $color)
No description
in
HasPresets at line 365
protected array
buildPresetNames(array $supports, string|null $size, string|null $variant, string|null $color, bool $shouldFill, string $sizeOrigin, string $variantOrigin, string $colorOrigin, string $fillOrigin)
No description
in
HasPresets at line 384
protected void
debugWarnings(array $supports, array $sizePreset, array $colorPreset, string $componentName, string|null $variant, string|null $color)
No description
in
HasErrorBag at line 24
array
getErrorState(ComponentAttributeBag|null $attributes = null, ViewErrorBag|MessageBag|null $errors = null, string|null $error = null)
Determine the error state for a specific field.
Checks both the session error bag and specific error attributes.
Looks up errors by wire:model value or name attribute.
in
BeartropyComponent at line 33
array
getWireModelState(ComponentAttributeBag|null $attributes = null)
Analyze wire:model attributes to determine binding state.
Detects if wire:model is present and if it uses dot notation (e.g., user.name).
in
BeartropyComponent at line 64
array
getSizePreset(string|null $componentName = null, array|ComponentAttributeBag|null $attributes = null, string $defaultSize = 'md')
Resolve the size preset for the component.
Checks:
- Explicit
$this->size. - Magic attributes (e.g.,
<x-button sm />). - Default size.
at line 66
__construct(string|null $id = null, string|null $name = null, string|null $label = null, string|null $color = null, string $placeholder = '', bool $disabled = false, bool $readonly = false, bool $required = false, string|null $help = null, string|null $hint = null, mixed $customError = null, int|null $maxLength = null, bool $stacked = false, bool $submitOnEnter = true, string|null $action = null, bool $border = false)
Create a new ChatInput component instance.
Blade Props
Slots
at line 95
View
render()
Get the view / contents that represent the component.