password-fieldpackage.src.vaadin-password-field.d.ts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vaadin-webcomponents Show documentation
Show all versions of vaadin-webcomponents Show documentation
Mvnpm composite: Vaadin webcomponents
The newest version!
/**
* @license
* Copyright (c) 2021 - 2024 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
import { TextField } from '@vaadin/text-field/src/vaadin-text-field.js';
import { PasswordFieldMixin } from './vaadin-password-field-mixin.js';
/**
* Fired when the user commits a value change.
*/
export type PasswordFieldChangeEvent = Event & {
target: PasswordField;
};
/**
* Fired when the `invalid` property changes.
*/
export type PasswordFieldInvalidChangedEvent = CustomEvent<{ value: boolean }>;
/**
* Fired when the `value` property changes.
*/
export type PasswordFieldValueChangedEvent = CustomEvent<{ value: string }>;
/**
* Fired whenever the field is validated.
*/
export type PasswordFieldValidatedEvent = CustomEvent<{ valid: boolean }>;
export interface PasswordFieldCustomEventMap {
'invalid-changed': PasswordFieldInvalidChangedEvent;
'value-changed': PasswordFieldValueChangedEvent;
validated: PasswordFieldValidatedEvent;
}
export interface PasswordFieldEventMap extends HTMLElementEventMap, PasswordFieldCustomEventMap {
change: PasswordFieldChangeEvent;
}
/**
* `` is an extension of `` component for entering passwords.
*
* ```html
*
* ```
*
* ### Styling
*
* `` provides the same set of shadow DOM parts and state attributes as ``.
* See [``](#/elements/vaadin-text-field) for the styling documentation.
*
* In addition to `` parts, the following parts are available for theming:
*
* Part name | Description
* ----------------|----------------------------------------------------
* `reveal-button` | The eye icon which toggles the password visibility
*
* In addition to `` state attributes, the following state attributes are available for theming:
*
* Attribute | Description
* -------------------|---------------------------------
* `password-visible` | Set when the password is visible
*
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
*
* @fires {Event} input - Fired when the value is changed by the user: on every typing keystroke, and the value is cleared using the clear button.
* @fires {Event} change - Fired when the user commits a value change.
* @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
* @fires {CustomEvent} value-changed - Fired when the `value` property changes.
* @fires {CustomEvent} validated - Fired whenever the field is validated.
*/
declare class PasswordField extends PasswordFieldMixin(TextField) {
addEventListener(
type: K,
listener: (this: PasswordField, ev: PasswordFieldEventMap[K]) => void,
options?: AddEventListenerOptions | boolean,
): void;
removeEventListener(
type: K,
listener: (this: PasswordField, ev: PasswordFieldEventMap[K]) => void,
options?: EventListenerOptions | boolean,
): void;
}
declare global {
interface HTMLElementTagNameMap {
'vaadin-password-field': PasswordField;
}
}
export { PasswordField };