@spectrum-web-components/textfield
Version:
`sp-textfield` components are text boxes that allow users to input custom text entries with a keyboard. Various decorations can be displayed around the field to communicate the entry requirements.
65 lines (64 loc) • 2.63 kB
TypeScript
import { CSSResultArray, nothing, PropertyValues, TemplateResult } from '@spectrum-web-components/base';
import { Focusable } from '@spectrum-web-components/shared/src/focusable.js';
import '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark100.js';
import '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js';
declare const textfieldTypes: readonly ["text", "url", "tel", "email", "password"];
export declare type TextfieldType = typeof textfieldTypes[number];
declare const TextfieldBase_base: typeof Focusable & {
new (...args: any[]): import("@spectrum-web-components/help-text/src/manage-help-text.js").HelpTextElementInterface;
prototype: import("@spectrum-web-components/help-text/src/manage-help-text.js").HelpTextElementInterface;
};
/**
* @fires input - The value of the element has changed.
* @fires change - An alteration to the value of the element has been committed by the user.
*/
export declare class TextfieldBase extends TextfieldBase_base {
static get styles(): CSSResultArray;
allowedKeys: string;
focused: boolean;
protected inputElement: HTMLInputElement | HTMLTextAreaElement;
invalid: boolean;
label: string;
placeholder: string;
private _type;
get type(): TextfieldType;
set type(val: TextfieldType);
pattern?: string;
grows: boolean;
maxlength: number;
minlength: number;
multiline: boolean;
readonly: boolean;
valid: boolean;
set value(value: string | number);
get value(): string | number;
protected _value: string | number;
quiet: boolean;
required: boolean;
autocomplete?: HTMLInputElement['autocomplete'] | HTMLTextAreaElement['autocomplete'];
get focusElement(): HTMLInputElement | HTMLTextAreaElement;
protected onInput(): void;
protected onChange(): void;
protected onFocus(): void;
protected onBlur(): void;
protected renderStateIcons(): TemplateResult | typeof nothing;
protected get displayValue(): string;
select(): void;
private get renderMultiline();
private get renderInput();
protected renderField(): TemplateResult;
protected render(): TemplateResult;
protected updated(changedProperties: PropertyValues): void;
checkValidity(): boolean;
}
/**
* @element sp-textfield
* @slot help-text - default or non-negative help text to associate to your form element
* @slot negative-help-text - negative help text to associate to your form element when `invalid`
*/
export declare class Textfield extends TextfieldBase {
set value(value: string);
get value(): string;
protected _value: string;
}
export {};