/** * Copyright Aquera Inc 2023 * * This source code is licensed under the BSD-3-Clause license found in the * LICENSE file in the root directory of this source tree. */ import { TemplateResult } from 'lit'; import '../nile-icon'; import type { CSSResultGroup } from 'lit'; import NileElement, { NileFormControl } from '../internal/nile-element'; /** * Nile icon component. * * @tag nile-input * */ export declare class NileInput extends NileElement implements NileFormControl { static styles: CSSResultGroup; private readonly formControlController; private readonly hasSlotController; input: HTMLInputElement; private hasFocus; 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'; /** The name of the input, submitted as a name/value pair with form data. */ name: string; /** The current value of the input, submitted as a name/value pair with form data. */ value: string; checkNonPrintableChar: boolean; /** The default value of the form control. Primarily used for resetting the form control. */ defaultValue: string; /** The input's size. */ size: 'small' | 'medium' | 'large'; /** Draws a filled input. */ filled: boolean; /** Sets the input to a warning state, changing its visual appearance. */ warning: boolean; /** Sets the input to an error state, changing its visual appearance. */ error: boolean; /** Sets the input to a success state, changing its visual appearance. */ success: boolean; /** Sets the input to a Destructive state, changing its visual appearance. */ destructive: boolean; /** 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; helpText: string; errorMessage: string; /** Adds a clear button when the input is not empty. */ clearable: boolean; /** Disables the input. */ disabled: 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. */ noSpinButtons: boolean; /** * By default, form controls are associated with the nearest containing `
` element. This attribute allows you * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in * the same document or shadow root for this to work. */ form: string; /** 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. */ autocorrect: 'off' | 'on'; /** * 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; canSavePassword: 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'; hasPrintableCharacters: boolean; markedValue: string; noOutline: any; noPadding: any; connectedCallback(): void; disconnectedCallback(): void; /** Gets or sets the current value as a `Date` object. Returns `null` if the value can't be converted. */ get valueAsDate(): Date | null; set valueAsDate(newValue: Date | null); /** Gets or sets the current value as a number. Returns `NaN` if the value can't be converted. */ get valueAsNumber(): number; set valueAsNumber(newValue: number); /** Gets the validity state object */ get validity(): ValidityState; /** Gets the validation message */ get validationMessage(): string; firstUpdated(): void; private handleBlur; private handleChange; private handleClearClick; private handleFocus; private handleInput; private handleInvalid; private handleKeyDown; private handlePasswordToggle; handleDisabledChange(): void; handleStepChange(): void; handleValueChange(): Promise; /** checks non printable characters in the value. */ markNonPrintableCharacters(): void; /** Removes all non printable characters from the value. */ removeAllNonPrintableCharacters(): 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; /** 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; /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */ checkValidity(): boolean; /** Gets the associated form, if one exists. */ getForm(): HTMLFormElement | null; /** Checks for validity and shows the browser's validation message if the control is invalid. */ reportValidity(): boolean; /** Sets a custom validation message. Pass an empty string to restore validity. */ setCustomValidity(message: string): void; inputFocus(): void; render(): TemplateResult<1>; } export default NileInput; declare global { interface HTMLElementTagNameMap { 'nile-input': NileInput; } }