import { type PropertyValues } from 'lit'; import { WebAwesomeFormAssociatedElement } from '../../internal/webawesome-form-associated-element.js'; import '../icon/icon.js'; /** * @summary Inputs collect single-line data from the user, such as text, numbers, email addresses, and passwords. They * support labels, hints, validation, and prefix or suffix slots. * @documentation https://webawesome.com/docs/components/input * @status stable * @since 2.0 * * @dependency wa-icon * * @slot label - The input's label. Alternatively, you can use the `label` attribute. * @slot start - An element, such as ``, placed at the start of the input control. * @slot end - An element, such as ``, placed at the end of the input control. * @slot clear-icon - An icon to use in lieu of the default clear icon. * @slot show-password-icon - An icon to use in lieu of the default show password icon. * @slot hide-password-icon - An icon to use in lieu of the default hide password icon. * @slot hint - Text that describes how to use the input. Alternatively, you can use the `hint` attribute. * * @event blur - Emitted when the control loses focus. * @event change - Emitted when an alteration to the control's value is committed by the user. * @event focus - Emitted when the control gains focus. * @event input - Emitted when the control receives input. * @event wa-clear - Emitted when the clear button is activated. * @event wa-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied. * * @csspart label - The label * @csspart hint - The hint's wrapper. * @csspart base - The wrapper being rendered as an input * @csspart input - The internal `` control. * @csspart start - The container that wraps the `start` slot. * @csspart clear-button - The clear button. * @csspart password-toggle-button - The password toggle button. * @csspart end - The container that wraps the `end` slot. * * @cssstate blank - The input is empty. */ export default class WaInput extends WebAwesomeFormAssociatedElement { static css: import("lit").CSSResult[]; static shadowRootOptions: { delegatesFocus: boolean; clonable?: boolean; customElementRegistry?: CustomElementRegistry; mode: ShadowRootMode; serializable?: boolean; slotAssignment?: SlotAssignmentMode; }; static get validators(): import("../../internal/webawesome-form-associated-element.js").Validator[]; assumeInteractionOn: string[]; private readonly hasSlotController; private readonly localize; input: HTMLInputElement; title: string; /** * The type of input. Works the same as a native `` element, but only a subset of types are supported. Defaults * to `text`. */ type: 'date' | 'datetime-local' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url'; private _value; /** The current value of the input, submitted as a name/value pair with form data. */ get value(): string | null; set value(val: string | null); /** The default value of the form control. Primarily used for resetting the form control. */ defaultValue: string | null; /** The input's size. */ size: 'xs' | 's' | 'm' | 'l' | 'xl' | 'small' | 'medium' | 'large'; handleSizeChange(): void; /** The input's visual appearance. */ appearance: 'filled' | 'outlined' | 'filled-outlined'; /** Draws a pill-style input with rounded edges. */ pill: boolean; /** The input's label. If you need to display HTML, use the `label` slot instead. */ label: string; /** The input's hint. If you need to display HTML, use the `hint` slot instead. */ hint: string; /** Adds a clear button when the input is not empty. */ withClear: boolean; /** Placeholder text to show as a hint when the input is empty. */ placeholder: string; /** Makes the input readonly. */ readonly: boolean; /** Adds a button to toggle the password's visibility. Only applies to password types. */ passwordToggle: boolean; /** Determines whether or not the password is currently visible. Only applies to password input types. */ passwordVisible: boolean; /** Hides the browser's built-in increment/decrement spin buttons for number inputs. */ withoutSpinButtons: boolean; /** Makes the input a required field. */ required: boolean; /** A regular expression pattern to validate input against. */ pattern: string; /** The minimum length of input that will be considered valid. */ minlength: number; /** The maximum length of input that will be considered valid. */ maxlength: number; /** The input's minimum value. Only applies to date and number input types. */ min: number | string; /** The input's maximum value. Only applies to date and number input types. */ max: number | string; /** * Specifies the granularity that the value must adhere to, or the special value `any` which means no stepping is * implied, allowing any numeric value. Only applies to date and number input types. */ step: number | 'any'; /** Controls whether and how text input is automatically capitalized as it is entered by the user. */ autocapitalize: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters'; /** * Indicates whether the browser's autocorrect feature is on or off. When set as an attribute, use `"off"` or `"on"`. * When set as a property, use `true` or `false`. */ autocorrect: boolean; /** * Specifies what permission the browser has to provide assistance in filling out form field values. Refer to * [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values. */ autocomplete: string; /** Indicates that the input should receive focus on page load. */ autofocus: boolean; /** Used to customize the label or icon of the Enter key on virtual keyboards. */ enterkeyhint: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'; /** Enables spell checking on the input. */ spellcheck: boolean; /** * Tells the browser what type of data will be entered by the user, allowing it to display the appropriate virtual * keyboard on supportive devices. */ inputmode: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'; /** * Only required for SSR. Set to `true` if you're slotting in a `label` element so the server-rendered markup * includes the label before the component hydrates on the client. */ withLabel: boolean; /** * Only required for SSR. Set to `true` if you're slotting in a `hint` element so the server-rendered markup * includes the hint before the component hydrates on the client. */ withHint: boolean; private handleChange; private handleClearClick; private handleInput; private handleKeyDown; private handlePasswordToggle; updated(changedProperties: PropertyValues): void; handleStepChange(): void; /** Sets focus on the input. */ focus(options?: FocusOptions): void; /** Removes focus from the input. */ blur(): void; /** Selects all the text in the input. */ select(): void; /** Sets the start and end positions of the text selection (0-based). */ setSelectionRange(selectionStart: number, selectionEnd: number, selectionDirection?: 'forward' | 'backward' | 'none'): void; /** Replaces a range of text with a new string. */ setRangeText(replacement: string, start?: number, end?: number, selectMode?: 'select' | 'start' | 'end' | 'preserve'): void; /** Displays the browser picker for an input element (only works if the browser supports it for the input type). */ showPicker(): void; /** Increments the value of a numeric input type by the value of the step attribute. */ stepUp(): void; /** Decrements the value of a numeric input type by the value of the step attribute. */ stepDown(): void; formResetCallback(): void; render(): import("lit-html").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'wa-input': WaInput; } }