import DSASuccessText from '../../../components/success-text/success-text';
import type DSAInternalDateField from '../../components/date-field/date-field';
import { FormControlLayout } from '../../components/form-control/form-control-layout';
import { FormControlController } from '../../form';
import type { ShoelaceFormControl } from '../../shoelace-element';
import type { DSAInputTypes } from './input-base.utils';
/** InputBase communalizes common functionality between the inputs. */
export declare class InputBase extends FormControlLayout implements ShoelaceFormControl {
static dependencies: {
'dsa-success-text': typeof DSASuccessText;
'dsa-error-text': typeof import("../../../design-system").DSAErrorText;
};
protected hasFocus: boolean;
protected input: HTMLInputElement | DSAInternalDateField;
/** (internal) The form control controller, passed down from dsa-input */
protected readonly formControlController: FormControlController;
/**
* The type of input. Works the same as a native `` element, but only a subset of types are supported. Defaults
* to `text`.
*/
type: DSAInputTypes;
/** The current value of the input, submitted as a name/value pair with form data. */
value: string;
/** The default value of the form control. Primarily used for resetting the form control. */
defaultValue: string;
/** Adds a clear button when the input is not empty. */
clearable: boolean;
/** Determines whether or not the password is currently visible. Only applies to password input types. */
passwordVisible: 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;
/** Display the counter if maxlength is provided */
counter: boolean;
/** 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. */
private _autocorrect;
get autocorrect(): boolean;
set autocorrect(value: 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';
/**
* Getters and setters
*/
/** 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;
/**
* Common internal methods
*/
protected firstUpdated(): Promise;
protected handleBlur(): void;
protected handleChange(_event: Event): void;
protected handleClearClick(event: MouseEvent): void;
protected handleFocus(): void;
protected handleInput(_event: InputEvent): void;
protected handleInvalid(event: Event): void;
protected handleKeyDown(event: KeyboardEvent): void;
protected getDescriptionIds(): string;
/**
* Common behaviors on attributes change
*/
handleDisabledChange(): void;
handleStepChange(): void;
handleValueChange(): Promise;
/**
* Public methods
*/
/** 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 or time input type by the value of the step attribute, multiplied by an optional number parameter. */
stepUp(stepNumber?: number): void;
/** Decrements the value of a numeric or time input type by the value of the step attribute, multiplied by an optional number parameter. */
stepDown(stepNumber?: number): 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;
protected renderSuccessMessage(): import("lit").TemplateResult<1>;
}