import { EventEmitter } from '../../stencil-public-runtime'; import type { InputAutocomplete, InputMode, InputType, EnterKeyHint, AutocapitalizeType } from './exports'; export declare class RInput { host: HTMLRInputElement; private static autofocusHandled; /** * ID of the form this input is associated with (mirrors native `form` attribute). * Use when the input is not a direct descendant of the target form element. */ form?: string; /** * If set, the field is skipped by built‑in (Constraint Validation API) validation logic. * Does not prevent custom validation you may trigger manually. */ novalidate?: boolean; /** * Input type (e.g. `text`, `email`, `number`, `password`). * See HTMLInputElement `type` for supported values. */ type: InputType; /** * Name used when contributing the value to form submission (`FormData` / POST body). */ name: string; /** * Current value. Mutable: can be changed programmatically or through user input. */ value?: string | null; /** * Placeholder hint text shown when the field is empty and unfocused. */ placeholder?: string; /** * Label text describing the field. Provide for accessibility (or use the `label` slot). */ label: string; /** * Small marker string appended to the label (e.g. “Optional”, localized markers, etc.). */ fieldIndicator?: string; /** * When true, hides visual label & messages (for internal layout use; accessibility still preserved). */ internal?: boolean; /** * Optional contextual help text displayed beneath the field. */ hint?: string; /** * When true, stretches the component horizontally to fill its container. */ fullWidth?: boolean; /** * Explicit valid state override (when set manually). */ valid?: boolean; /** * Explicit invalid state override (when set manually). */ invalid?: boolean; /** * Manual error message independent of native validation messages. * When set, native validation messages are suppressed. */ error?: string; /** * Disables the field (non-interactive, excluded from form submission). */ disabled?: boolean; /** * Marks the field as required; failing to provide a value triggers `valueMissing`. */ required?: boolean; /** Maximum character length (enforced by native input). */ maxlength?: number; /** Minimum character length (validation only). */ minlength?: number; /** Minimum numeric/date value (for supported types). */ min?: number; /** Maximum numeric/date value (for supported types). */ max?: number; /** Regex pattern the value must match (string form). */ pattern?: any; /** Step interval for numeric/date input types. */ step?: number; /** Custom message for `valueMissing`. */ valueMissingMessage?: string; /** Custom message for `typeMismatch`. */ typeMismatchMessage?: string; /** Custom message for `patternMismatch`. */ patternMismatchMessage?: string; /** Custom message for `tooLong`. */ tooLongMessage?: string; /** Custom message for `tooShort`. */ tooShortMessage?: string; /** Custom message for `rangeOverflow`. */ rangeOverflowMessage?: string; /** Custom message for `rangeUnderflow`. */ rangeUnderflowMessage?: string; /** Custom message for `stepMismatch`. */ stepMismatchMessage?: string; /** * Custom message for `badInput` (conversion / parsing failure). */ badInputMessage?: string; /** * Custom message for `customError` (applies when set via `setCustomValidity()` logic internally). */ customErrorMessage?: string; /** * Native `autocomplete` hint for browsers / password managers. */ autocomplete?: InputAutocomplete; /** * Hint for the action label/icon on the virtual keyboard's enter key. * Use cases: * - `enter`: Default, generic newline/submit action * - `done`: Finishes current input session (e.g., last field in a form) * - `go`: Navigates to URL input target (e.g., URL bar) * - `next`: Advances to next input field in a sequence * - `previous`: Goes back to previous input field * - `search`: Submits a search query * - `send`: Sends a message (e.g., chat, email) */ enterkeyhint?: EnterKeyHint; /** * Controls browser spell-checking for text input. * When true, enables spell-checking; when false, disables it. * Browser default behavior applies when not specified. */ spellcheck?: boolean; /** * Controls automatic capitalization of text input on mobile devices. * - `off` or `none`: No automatic capitalization * - `on` or `sentences`: Capitalize first letter of each sentence (default for most text inputs) * - `words`: Capitalize first letter of each word * - `characters`: Capitalize all characters */ autocapitalize?: AutocapitalizeType; /** * Safari-specific password rules for strong password generation (password inputs only). * Format: "minlength: X; required: lower; required: upper; required: digit; required: special;" * This attribute is Safari-specific and will be ignored by other browsers. * See: https://developer.apple.com/documentation/security/password_autofill/customizing_password_autofill_rules */ passwordrules?: string; /** * Automatically focus the input when it is first rendered. * Mirrors native `autofocus` attribute behavior. Avoid using multiple times per page. */ autofocus?: boolean; /** * Read-only mode (mirrors native `readonly`): value cannot be changed by the user, * but the field can still receive focus, be selected, and be submitted with a form. */ readonly?: boolean; /** Internal state for options extracted from slotted datalist */ private slottedOptions; /** * Hint to the browser about which keyboard to display on mobile devices. */ inputmode?: InputMode; /** * When `true` field renders valid/invalid marker within. */ validityMarker: boolean; /** Validity state passed from validateFormElement function after validation */ validityState: string; /** Validity message passed from validateFormElement function after validation */ validityMessage: string; /** Defines if the component has been touched by user */ touched: boolean; /** Defines if the value has been changed by user interaction */ dirty: boolean; /** Private flag to prevent validation during reset */ private isResetting; /** * Emitted after each validation attempt (native or triggered logic). */ rValidate: EventEmitter<{ state: string; message: string; }>; /** * Emitted on each user input (mirrors native `input` semantics). */ rInput: EventEmitter<{ element: HTMLRInputElement; value: any; }>; /** * Emitted when the input loses focus. */ rBlur: EventEmitter; /** * Emitted when the input receives focus. */ rFocus: EventEmitter; /** * Emitted when the committed value changes (mirrors native `change` semantics). */ rChange: EventEmitter<{ element: HTMLRInputElement; value: any; }>; /** * Emitted when a parent form is reset and the field restores its initial value. */ rReset: EventEmitter<{ element: HTMLRInputElement; value: any; }>; /** * Emitted when the input is about to be modified (mirrors native `beforeinput` semantics). * Use for intercepting and preventing input before it occurs. */ rBeforeInput: EventEmitter; /** * Emitted when the input fails validation (mirrors native `invalid` semantics). */ rInvalid: EventEmitter; /** * Emitted when a key is pressed down (mirrors native `keydown` semantics). */ rKeyDown: EventEmitter; /** * Emitted when a key is released (mirrors native `keyup` semantics). */ rKeyUp: EventEmitter; /** * Emitted when text is selected (mirrors native `select` semantics). */ rSelect: EventEmitter; /** * Programmatically focus the native input element. */ setFocus(): Promise; /** * Programmatically remove focus from the native input. */ setBlur(): Promise; /** * Select (highlight) the entire current input value. */ select(): Promise; /** * Get the start index of the current text selection (or null if unavailable). */ getSelectionStart(): Promise; /** * Get the end index of the current text selection (or null if unavailable). */ getSelectionEnd(): Promise; /** * Set a selection (or caret) range within the value. * @param start Start index (inclusive) * @param end End index (exclusive) * @param direction Selection direction (browser hint) */ setSelectionRange(start: number, end: number, direction?: 'forward' | 'backward' | 'none'): Promise; /** * Retrieve the current value (returns empty string if unset). */ getValue(): Promise; /** * Set the current value programmatically (does not fire native input/change automatically). */ setValue(value: string): Promise; /** Validates an element, displays provided message in case value is invalid. */ setCustomValidity(message: string): Promise; /** * Validates the input without triggering UI and returns a boolean indicating its validity. * @returns A boolean indicating whether the input is valid. */ checkValidity(): Promise; /** * Gets the touched state (whether user has interacted with the input) */ isTouched(): Promise; /** * Gets the dirty state (whether value has been changed by user) */ isDirty(): Promise; /** * Resets touched and dirty states to pristine (untouched/clean) */ markAsPristine(): Promise; private nativeElement; /** * Helper to set the native input element ref and apply boolean properties * that don't get properly set through JSX attribute spreading. */ private setNativeInputRef; private uniqueId; private get datalistId(); /** * Initial attributes state * */ private initial; /** * Cache for passthrough attributes to avoid recomputing on every render. * Cleared when attributes might have changed. */ private passthroughAttrsCache; /** * Checks if an attribute should be excluded from passthrough. */ private shouldExcludeAttribute; /** * Collects native HTML input attributes from the host element that aren't * already handled by explicit props. This allows passing through attributes * like 'list', 'multiple', 'size', etc. without creating explicit props. * Optimized with Set lookups (O(1)) and caching. */ private collectNativeAttributes; /** Identify wrapping form element */ private get parentFormEl(); private get ariaDescribedBy(); private get hasError(); private get hasValidationError(); private get hasMessage(); /** * Determine whether this element should be ignored * during Constraint Validation API validation. * */ private get isNoValidate(); private get hasTrailingSlot(); private getValidityStateData; private get validEmailPattern(); private validateFormElement; private onInput; private onChange; private onBlur; private onFocus; private onBeforeInput; private onInvalid; private onKeyDown; private onKeyUp; private onSelect; componentWillLoad(): void; /** * Extracts options from a slotted element. * Supports both default slot and slot="datalist" usage. */ private extractSlottedDatalistOptions; /** * Parses options from a HTMLDataListElement into InputOption array. */ private parseDatalistOptions; private contributeToFormData; private connectFormEventListeners; connectedCallback(): void; disconnectedCallback(): void; private datalistObserver; private setupDatalistObserver; private disconnectDatalistObserver; private onResetForm; private onSubmitForm; private handleKeyup; private disconnectFormEventListeners; private handleClick; handleValueChange(): void; handleTypeChange(): void; render(): any; }