/** * @license * Copyright 2023 Nuraly, Laabidi Aymen * SPDX-License-Identifier: MIT */ import { LitElement, type PropertyValues } from 'lit'; import { TEXTAREA_STATE, TEXTAREA_SIZE, TEXTAREA_VARIANT, TEXTAREA_RESIZE, ValidationRule, TextareaValidationResult, FocusOptions } from './textarea.types.js'; import { ValidatableComponent, ValidationStatus } from '@nuralyui/common/mixins'; import { type TextareaValidationHost, type TextareaEventHost } from './controllers/index.js'; declare const NrTextareaElement_base: (new (...args: any[]) => import("@nuralyui/common/mixins").DependencyAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").ThemeAware) & (new (...args: any[]) => import("@nuralyui/common/mixins").EventHandlerCapable) & (new (...args: any[]) => import("packages/common/src/shared/base-mixin.js").LightDomContent) & typeof LitElement; /** * Versatile textarea component with validation, resize options, and interactive features. * * @example * ```html * * * * ``` * * @fires nr-textarea-change - Value changes * @fires nr-focus - Textarea focused * @fires nr-blur - Textarea blurred * @fires nr-clear - Clear button clicked * @fires nr-resize - Textarea resized * * @slot label - Textarea label * @slot helper-text - Helper text * @slot addon-before - Content before textarea * @slot addon-after - Content after textarea * * @csspart container - The outermost wrapper div * @csspart label - The label wrapper div * @csspart input - The native textarea element * @csspart helper-text - The helper/error text wrapper div */ export declare class NrTextareaElement extends NrTextareaElement_base implements TextareaValidationHost, TextareaEventHost, ValidatableComponent { static useShadowDom: boolean; static styles: import("lit").CSSResult; private textareaElement; private validationController; private eventController; /** Disables the textarea */ disabled: boolean; /** Makes the textarea read-only */ readonly: boolean; /** Visual state (default, success, warning, error) */ state: TEXTAREA_STATE; /** Current textarea value */ value: string; /** Textarea size (small, medium, large) */ size: TEXTAREA_SIZE; /** Visual variant (outlined, underlined, filled) */ variant: TEXTAREA_VARIANT; /** Resize behavior (none, vertical, horizontal, both) */ resize: TEXTAREA_RESIZE; /** Number of visible text lines */ rows: 3; /** Number of visible character columns */ cols: 50; /** Placeholder text */ placeholder: string; /** HTML autocomplete attribute */ autocomplete: string; /** Field name for form submission */ name?: string; /** Required field indicator */ required?: boolean; /** Shows clear button */ allowClear: boolean; /** Clearable alias for controller interface compatibility */ get clearable(): boolean; /** Shows character counter */ showCount: boolean; /** Maximum character limit */ maxLength?: number; /** Minimum height for auto-resize */ minHeight?: number; /** Maximum height for auto-resize */ maxHeight?: number; /** Auto-resize textarea based on content */ autoResize: boolean; /** Array of validation rules */ rules: ValidationRule[]; /** Validate on change */ validateOnChange: boolean; /** Validate on blur */ validateOnBlur: boolean; /** Show validation status icon */ hasFeedback: boolean; /** Custom validation message */ validationMessage?: string; private isFocused; private validationResult?; private characterCount; private resizeObserver?; constructor(); /** * Setup controller event listeners */ private setupControllerListeners; /** * Handle input from controller */ private handleControllerInput; /** * Handle clear from controller */ private handleControllerClear; connectedCallback(): void; disconnectedCallback(): void; firstUpdated(changedProperties: PropertyValues): void; updated(changedProperties: PropertyValues): void; private setupResizeObserver; private cleanupResizeObserver; private updateTextareaValue; private autoResizeIfNeeded; /** * Handle input event (now delegated to event controller via addEventListener) */ private handleInput; /** * Handle focus event (now delegated to event controller) */ private handleFocus; /** * Handle blur event (now delegated to event controller) */ private handleBlur; /** * Handle clear event (now delegated to event controller) */ private handleClear; private dispatchChangeEvent; private dispatchResizeEvent; /** * Focus the textarea with optional configuration */ focus(options?: FocusOptions): void; /** * Blur the textarea */ blur(): void; /** * Get validation status */ getValidationResult(): TextareaValidationResult | undefined; /** * Trigger validation manually (ValidatableComponent interface) */ validate(): Promise; /** * Clear validation state */ clearValidation(): void; /** * Clear the textarea value */ clear(): void; /** * Add a validation rule (ValidatableComponent interface) */ addRule(rule: ValidationRule): void; /** * Remove validation rules matching predicate (ValidatableComponent interface) */ removeRule(predicate: (rule: ValidationRule) => boolean): void; /** * Clear all validation rules (ValidatableComponent interface) */ clearRules(): void; /** * Get current validation status (ValidatableComponent interface) */ getValidationStatus(): ValidationStatus; /** * Check if the textarea value is valid */ isValid(): boolean; /** * Check validity (HTML form API compatibility) */ checkValidity(): boolean; /** * Report validity (HTML form API compatibility) */ reportValidity(): boolean; /** * Set custom validity message (HTML form API compatibility) */ setCustomValidity(message: string): void; /** * Trigger validation manually (enhanced version) */ validateTextarea(): Promise; /** * Set validation state externally (for form integration) */ setValidationStatus(result: TextareaValidationResult): void; private renderLabel; private renderTextarea; private renderValidationIcon; private renderClearButton; private renderCharacterCount; private renderHelperText; render(): import("lit-html").TemplateResult<1>; } export {}; //# sourceMappingURL=textarea.component.d.ts.map