55 */
66import { TextField } from '@vaadin/text-field/src/vaadin-text-field.js' ;
77
8+ /**
9+ * Fired when the `invalid` property changes.
10+ */
11+ export type PasswordFieldInvalidChangedEvent = CustomEvent < { value : boolean } > ;
12+
13+ /**
14+ * Fired when the `value` property changes.
15+ */
16+ export type PasswordFieldValueChangedEvent = CustomEvent < { value : string } > ;
17+
18+ export interface PasswordFieldCustomEventMap {
19+ 'invalid-changed' : PasswordFieldInvalidChangedEvent ;
20+
21+ 'value-changed' : PasswordFieldValueChangedEvent ;
22+ }
23+
24+ export interface PasswordFieldEventMap extends HTMLElementEventMap , PasswordFieldCustomEventMap { }
25+
26+ /**
27+ * `<vaadin-password-field>` is an extension of `<vaadin-text-field>` component for entering passwords.
28+ *
29+ * ```html
30+ * <vaadin-password-field label="Password"></vaadin-password-field>
31+ * ```
32+ *
33+ * ### Styling
34+ *
35+ * See [`<vaadin-text-field>`](#/elements/vaadin-text-field) for the styling documentation.
36+ *
37+ * In addition to `<vaadin-text-field>` parts, here's the list of `<vaadin-password-field>` specific parts:
38+ *
39+ * Part name | Description
40+ * ----------------|----------------------------------------------------
41+ * `reveal-button` | The eye icon which toggles the password visibility
42+ *
43+ * In addition to `<vaadin-text-field>` state attributes, here's the list of `<vaadin-password-field>` specific attributes:
44+ *
45+ * Attribute | Description | Part name
46+ * -------------------|-------------|------------
47+ * `password-visible` | Set when the password is visible | :host
48+ *
49+ * See [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.
50+ *
51+ * @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.
52+ * @fires {Event } change - Fired when the user commits a value change.
53+ * @fires {CustomEvent } invalid-changed - Fired when the `invalid` property changes.
54+ * @fires {CustomEvent } value-changed - Fired when the `value` property changes.
55+ */
856declare class PasswordField extends TextField {
957 /**
1058 * Set to true to hide the eye icon which toggles the password visibility.
@@ -30,6 +78,24 @@ declare class PasswordField extends TextField {
3078 * ```
3179 */
3280 i18n : { reveal : string } ;
81+
82+ addEventListener < K extends keyof PasswordFieldEventMap > (
83+ type : K ,
84+ listener : ( this : PasswordField , ev : PasswordFieldEventMap [ K ] ) => void ,
85+ options ?: boolean | AddEventListenerOptions
86+ ) : void ;
87+
88+ removeEventListener < K extends keyof PasswordFieldEventMap > (
89+ type : K ,
90+ listener : ( this : PasswordField , ev : PasswordFieldEventMap [ K ] ) => void ,
91+ options ?: boolean | EventListenerOptions
92+ ) : void ;
93+ }
94+
95+ declare global {
96+ interface HTMLElementTagNameMap {
97+ 'vaadin-password-field' : PasswordField ;
98+ }
3399}
34100
35101export { PasswordField } ;
0 commit comments