@vaadin/password-field 25.0.0-alpha9 → 25.0.0-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +12 -15
- package/src/styles/vaadin-password-field-base-styles.js +2 -2
- package/src/styles/vaadin-password-field-button-base-styles.js +4 -4
- package/src/vaadin-password-field-button.js +1 -1
- package/src/vaadin-password-field-mixin.d.ts +1 -1
- package/src/vaadin-password-field-mixin.js +26 -71
- package/src/vaadin-password-field.d.ts +27 -10
- package/src/vaadin-password-field.js +29 -12
- package/vaadin-password-field.js +1 -1
- package/web-types.json +3 -3
- package/web-types.lit.json +3 -3
- package/src/styles/vaadin-password-field-button-core-styles.js +0 -8
- package/src/styles/vaadin-password-field-core-styles.d.ts +0 -8
- package/src/styles/vaadin-password-field-core-styles.js +0 -9
- package/theme/lumo/vaadin-password-field-button-styles.d.ts +0 -1
- package/theme/lumo/vaadin-password-field-button-styles.js +0 -26
- package/theme/lumo/vaadin-password-field-styles.d.ts +0 -8
- package/theme/lumo/vaadin-password-field-styles.js +0 -32
- package/theme/lumo/vaadin-password-field.d.ts +0 -9
- package/theme/lumo/vaadin-password-field.js +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/password-field",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-beta2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,9 +21,6 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
-
"!src/styles/*-base-styles.d.ts",
|
|
25
|
-
"!src/styles/*-base-styles.js",
|
|
26
|
-
"theme",
|
|
27
24
|
"vaadin-*.d.ts",
|
|
28
25
|
"vaadin-*.js",
|
|
29
26
|
"web-types.json",
|
|
@@ -37,24 +34,24 @@
|
|
|
37
34
|
],
|
|
38
35
|
"dependencies": {
|
|
39
36
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
40
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
41
|
-
"@vaadin/button": "25.0.0-
|
|
42
|
-
"@vaadin/component-base": "25.0.0-
|
|
43
|
-
"@vaadin/field-base": "25.0.0-
|
|
44
|
-
"@vaadin/text-field": "25.0.0-
|
|
45
|
-
"@vaadin/vaadin-
|
|
46
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha9",
|
|
37
|
+
"@vaadin/a11y-base": "25.0.0-beta2",
|
|
38
|
+
"@vaadin/button": "25.0.0-beta2",
|
|
39
|
+
"@vaadin/component-base": "25.0.0-beta2",
|
|
40
|
+
"@vaadin/field-base": "25.0.0-beta2",
|
|
41
|
+
"@vaadin/text-field": "25.0.0-beta2",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-beta2",
|
|
47
43
|
"lit": "^3.0.0"
|
|
48
44
|
},
|
|
49
45
|
"devDependencies": {
|
|
50
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
51
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
46
|
+
"@vaadin/chai-plugins": "25.0.0-beta2",
|
|
47
|
+
"@vaadin/test-runner-commands": "25.0.0-beta2",
|
|
52
48
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
53
|
-
"
|
|
49
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-beta2",
|
|
50
|
+
"sinon": "^21.0.0"
|
|
54
51
|
},
|
|
55
52
|
"web-types": [
|
|
56
53
|
"web-types.json",
|
|
57
54
|
"web-types.lit.json"
|
|
58
55
|
],
|
|
59
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "e078f8371ae266f05c7ca1ec25686cc489c83f24"
|
|
60
57
|
}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
import { css } from 'lit';
|
|
7
7
|
|
|
8
8
|
export const passwordFieldStyles = css`
|
|
9
|
-
[part
|
|
9
|
+
[part~='reveal-button']::before {
|
|
10
10
|
display: none;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
[part='input-field']:has([part
|
|
13
|
+
[part='input-field']:has([part~='reveal-button']:focus-within) {
|
|
14
14
|
outline: none;
|
|
15
15
|
--vaadin-input-field-border-color: inherit;
|
|
16
16
|
}
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import '@vaadin/component-base/src/style-props.js';
|
|
6
|
+
import '@vaadin/component-base/src/styles/style-props.js';
|
|
7
7
|
import { css } from 'lit';
|
|
8
8
|
import { buttonStyles } from '@vaadin/button/src/styles/vaadin-button-base-styles.js';
|
|
9
9
|
|
|
10
10
|
const passwordFieldBase = css`
|
|
11
11
|
:host {
|
|
12
12
|
--vaadin-button-background: transparent;
|
|
13
|
-
--vaadin-button-border: none;
|
|
14
13
|
--vaadin-button-padding: 0;
|
|
15
|
-
color: var(--vaadin-input-field-button-color, inherit);
|
|
14
|
+
color: var(--vaadin-input-field-button-text-color, inherit);
|
|
16
15
|
display: block;
|
|
16
|
+
border: none;
|
|
17
17
|
cursor: var(--vaadin-clickable-cursor);
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -22,7 +22,7 @@ const passwordFieldBase = css`
|
|
|
22
22
|
content: '';
|
|
23
23
|
display: block;
|
|
24
24
|
height: var(--vaadin-icon-size, 1lh);
|
|
25
|
-
mask
|
|
25
|
+
mask: var(--_vaadin-icon-eye) 50% / var(--vaadin-icon-visual-size, 100%) no-repeat;
|
|
26
26
|
width: var(--vaadin-icon-size, 1lh);
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -10,7 +10,7 @@ import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
|
10
10
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
11
|
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
12
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
-
import { passwordFieldButton } from './styles/vaadin-password-field-button-
|
|
13
|
+
import { passwordFieldButton } from './styles/vaadin-password-field-button-base-styles.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* An element used internally by `<vaadin-password-field>`. Not intended to be used separately.
|
|
@@ -35,7 +35,7 @@ export declare class PasswordFieldMixinClass {
|
|
|
35
35
|
* An object with translated strings used for localization.
|
|
36
36
|
* It has the following structure and default values:
|
|
37
37
|
*
|
|
38
|
-
* ```
|
|
38
|
+
* ```js
|
|
39
39
|
* {
|
|
40
40
|
* // Translation of the reveal icon button accessible label
|
|
41
41
|
* reveal: 'Show password'
|
|
@@ -26,7 +26,6 @@ export const PasswordFieldMixin = (superClass) =>
|
|
|
26
26
|
*/
|
|
27
27
|
revealButtonHidden: {
|
|
28
28
|
type: Boolean,
|
|
29
|
-
observer: '_revealButtonHiddenChanged',
|
|
30
29
|
value: false,
|
|
31
30
|
},
|
|
32
31
|
|
|
@@ -38,7 +37,6 @@ export const PasswordFieldMixin = (superClass) =>
|
|
|
38
37
|
type: Boolean,
|
|
39
38
|
value: false,
|
|
40
39
|
reflectToAttribute: true,
|
|
41
|
-
observer: '_passwordVisibleChanged',
|
|
42
40
|
readOnly: true,
|
|
43
41
|
},
|
|
44
42
|
|
|
@@ -46,7 +44,7 @@ export const PasswordFieldMixin = (superClass) =>
|
|
|
46
44
|
* An object with translated strings used for localization.
|
|
47
45
|
* It has the following structure and default values:
|
|
48
46
|
*
|
|
49
|
-
* ```
|
|
47
|
+
* ```js
|
|
50
48
|
* {
|
|
51
49
|
* // Translation of the reveal icon button accessible label
|
|
52
50
|
* reveal: 'Show password'
|
|
@@ -64,10 +62,6 @@ export const PasswordFieldMixin = (superClass) =>
|
|
|
64
62
|
};
|
|
65
63
|
}
|
|
66
64
|
|
|
67
|
-
static get observers() {
|
|
68
|
-
return ['__i18nChanged(i18n)'];
|
|
69
|
-
}
|
|
70
|
-
|
|
71
65
|
/** @override */
|
|
72
66
|
static get delegateAttrs() {
|
|
73
67
|
// Do not delegate autocapitalize as it should be always set to "off"
|
|
@@ -95,20 +89,15 @@ export const PasswordFieldMixin = (superClass) =>
|
|
|
95
89
|
];
|
|
96
90
|
}
|
|
97
91
|
|
|
98
|
-
/** @protected */
|
|
99
|
-
get _revealNode() {
|
|
100
|
-
return this._revealButtonController && this._revealButtonController.node;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
92
|
/** @protected */
|
|
104
93
|
ready() {
|
|
105
94
|
super.ready();
|
|
106
95
|
|
|
107
|
-
this._revealPart = this.shadowRoot.querySelector('[part
|
|
96
|
+
this._revealPart = this.shadowRoot.querySelector('[part~="reveal-button"]');
|
|
108
97
|
|
|
109
98
|
this._revealButtonController = new SlotController(this, 'reveal', 'vaadin-password-field-button', {
|
|
110
99
|
initializer: (btn) => {
|
|
111
|
-
|
|
100
|
+
this._revealNode = btn;
|
|
112
101
|
|
|
113
102
|
btn.addEventListener('click', this.__boundRevealButtonClick);
|
|
114
103
|
btn.addEventListener('mousedown', this.__boundRevealButtonMouseDown);
|
|
@@ -116,16 +105,33 @@ export const PasswordFieldMixin = (superClass) =>
|
|
|
116
105
|
});
|
|
117
106
|
this.addController(this._revealButtonController);
|
|
118
107
|
|
|
119
|
-
this.__updateAriaLabel(this.i18n);
|
|
120
|
-
|
|
121
|
-
this._updateToggleState(false);
|
|
122
|
-
this._toggleRevealHidden(this.revealButtonHidden);
|
|
123
|
-
|
|
124
108
|
if (this.inputElement) {
|
|
125
109
|
this.inputElement.autocapitalize = 'off';
|
|
126
110
|
}
|
|
127
111
|
}
|
|
128
112
|
|
|
113
|
+
/** @protected */
|
|
114
|
+
updated(props) {
|
|
115
|
+
super.updated(props);
|
|
116
|
+
|
|
117
|
+
if (props.has('disabled')) {
|
|
118
|
+
this._revealNode.disabled = this.disabled;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (props.has('revealButtonHidden')) {
|
|
122
|
+
this._toggleRevealHidden(this.revealButtonHidden);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (props.has('passwordVisible')) {
|
|
126
|
+
this._setType(this.passwordVisible ? 'text' : 'password');
|
|
127
|
+
this._revealNode.setAttribute('aria-pressed', this.passwordVisible ? 'true' : 'false');
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (props.has('i18n') && this.i18n && this.i18n.reveal) {
|
|
131
|
+
this._revealNode.setAttribute('aria-label', this.i18n.reveal);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
129
135
|
/**
|
|
130
136
|
* Override an event listener inherited from `InputControlMixin`
|
|
131
137
|
* to store the value at the moment of the native `change` event.
|
|
@@ -188,31 +194,9 @@ export const PasswordFieldMixin = (superClass) =>
|
|
|
188
194
|
}
|
|
189
195
|
}
|
|
190
196
|
|
|
191
|
-
/** @private */
|
|
192
|
-
__updateAriaLabel(i18n) {
|
|
193
|
-
if (i18n && i18n.reveal && this._revealNode) {
|
|
194
|
-
this._revealNode.setAttribute('aria-label', i18n.reveal);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/** @private */
|
|
199
|
-
__i18nChanged(i18n) {
|
|
200
|
-
this.__updateAriaLabel(i18n);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/** @private */
|
|
204
|
-
_revealButtonHiddenChanged(hidden) {
|
|
205
|
-
this._toggleRevealHidden(hidden);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/** @private */
|
|
209
|
-
_togglePasswordVisibility() {
|
|
210
|
-
this._setPasswordVisible(!this.passwordVisible);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
197
|
/** @private */
|
|
214
198
|
_onRevealButtonClick() {
|
|
215
|
-
this.
|
|
199
|
+
this._setPasswordVisible(!this.passwordVisible);
|
|
216
200
|
}
|
|
217
201
|
|
|
218
202
|
/** @private */
|
|
@@ -239,33 +223,4 @@ export const PasswordFieldMixin = (superClass) =>
|
|
|
239
223
|
}
|
|
240
224
|
}
|
|
241
225
|
}
|
|
242
|
-
|
|
243
|
-
/** @private */
|
|
244
|
-
_updateToggleState(passwordVisible) {
|
|
245
|
-
if (this._revealNode) {
|
|
246
|
-
this._revealNode.setAttribute('aria-pressed', passwordVisible ? 'true' : 'false');
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
/** @private */
|
|
251
|
-
_passwordVisibleChanged(passwordVisible) {
|
|
252
|
-
this._setType(passwordVisible ? 'text' : 'password');
|
|
253
|
-
|
|
254
|
-
this._updateToggleState(passwordVisible);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Override method inherited from `DisabledMixin` to synchronize the reveal button
|
|
259
|
-
* disabled state with the password field disabled state.
|
|
260
|
-
* @param {boolean} disabled
|
|
261
|
-
* @param {boolean} oldDisabled
|
|
262
|
-
* @protected
|
|
263
|
-
*/
|
|
264
|
-
_disabledChanged(disabled, oldDisabled) {
|
|
265
|
-
super._disabledChanged(disabled, oldDisabled);
|
|
266
|
-
|
|
267
|
-
if (this._revealNode) {
|
|
268
|
-
this._revealNode.disabled = disabled;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
226
|
};
|
|
@@ -49,20 +49,37 @@ export interface PasswordFieldEventMap extends HTMLElementEventMap, PasswordFiel
|
|
|
49
49
|
*
|
|
50
50
|
* ### Styling
|
|
51
51
|
*
|
|
52
|
-
*
|
|
53
|
-
* See [`<vaadin-text-field>`](#/elements/vaadin-text-field) for the styling documentation.
|
|
52
|
+
* The following shadow DOM parts are available for styling:
|
|
54
53
|
*
|
|
55
|
-
*
|
|
54
|
+
* Part name | Description
|
|
55
|
+
* ---------------------|----------------
|
|
56
|
+
* `label` | The label element
|
|
57
|
+
* `input-field` | The element that wraps prefix, value and suffix
|
|
58
|
+
* `field-button` | Set on both clear and reveal buttons
|
|
59
|
+
* `clear-button` | The clear button
|
|
60
|
+
* `error-message` | The error message element
|
|
61
|
+
* `helper-text` | The helper text element wrapper
|
|
62
|
+
* `required-indicator` | The `required` state indicator element
|
|
63
|
+
* `reveal-button` | The eye icon which toggles the password visibility
|
|
56
64
|
*
|
|
57
|
-
*
|
|
58
|
-
* ----------------|----------------------------------------------------
|
|
59
|
-
* `reveal-button` | The eye icon which toggles the password visibility
|
|
65
|
+
* The following state attributes are available for styling:
|
|
60
66
|
*
|
|
61
|
-
*
|
|
67
|
+
* Attribute | Description
|
|
68
|
+
* ---------------------|---------------------------------
|
|
69
|
+
* `disabled` | Set when the element is disabled
|
|
70
|
+
* `has-value` | Set when the element has a value
|
|
71
|
+
* `has-label` | Set when the element has a label
|
|
72
|
+
* `has-helper` | Set when the element has helper text or slot
|
|
73
|
+
* `has-error-message` | Set when the element has an error message
|
|
74
|
+
* `has-tooltip` | Set when the element has a slotted tooltip
|
|
75
|
+
* `invalid` | Set when the element is invalid
|
|
76
|
+
* `input-prevented` | Temporarily set when invalid input is prevented
|
|
77
|
+
* `focused` | Set when the element is focused
|
|
78
|
+
* `focus-ring` | Set when the element is keyboard focused
|
|
79
|
+
* `readonly` | Set when the element is readonly
|
|
80
|
+
* `password-visible` | Set when the password is visible
|
|
62
81
|
*
|
|
63
|
-
*
|
|
64
|
-
* -------------------|---------------------------------
|
|
65
|
-
* `password-visible` | Set when the password is visible
|
|
82
|
+
* Note, the `input-prevented` state attribute is only supported when `allowedCharPattern` is set.
|
|
66
83
|
*
|
|
67
84
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
68
85
|
*
|
|
@@ -7,7 +7,7 @@ import './vaadin-password-field-button.js';
|
|
|
7
7
|
import { html } from 'lit';
|
|
8
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
9
|
import { TextField } from '@vaadin/text-field/src/vaadin-text-field.js';
|
|
10
|
-
import { passwordFieldStyles } from './styles/vaadin-password-field-
|
|
10
|
+
import { passwordFieldStyles } from './styles/vaadin-password-field-base-styles.js';
|
|
11
11
|
import { PasswordFieldMixin } from './vaadin-password-field-mixin.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -19,20 +19,37 @@ import { PasswordFieldMixin } from './vaadin-password-field-mixin.js';
|
|
|
19
19
|
*
|
|
20
20
|
* ### Styling
|
|
21
21
|
*
|
|
22
|
-
*
|
|
23
|
-
* See [`<vaadin-text-field>`](#/elements/vaadin-text-field) for the styling documentation.
|
|
22
|
+
* The following shadow DOM parts are available for styling:
|
|
24
23
|
*
|
|
25
|
-
*
|
|
24
|
+
* Part name | Description
|
|
25
|
+
* ---------------------|----------------
|
|
26
|
+
* `label` | The label element
|
|
27
|
+
* `input-field` | The element that wraps prefix, value and suffix
|
|
28
|
+
* `field-button` | Set on both clear and reveal buttons
|
|
29
|
+
* `clear-button` | The clear button
|
|
30
|
+
* `error-message` | The error message element
|
|
31
|
+
* `helper-text` | The helper text element wrapper
|
|
32
|
+
* `required-indicator` | The `required` state indicator element
|
|
33
|
+
* `reveal-button` | The eye icon which toggles the password visibility
|
|
26
34
|
*
|
|
27
|
-
*
|
|
28
|
-
* ----------------|----------------------------------------------------
|
|
29
|
-
* `reveal-button` | The eye icon which toggles the password visibility
|
|
35
|
+
* The following state attributes are available for styling:
|
|
30
36
|
*
|
|
31
|
-
*
|
|
37
|
+
* Attribute | Description
|
|
38
|
+
* ---------------------|---------------------------------
|
|
39
|
+
* `disabled` | Set when the element is disabled
|
|
40
|
+
* `has-value` | Set when the element has a value
|
|
41
|
+
* `has-label` | Set when the element has a label
|
|
42
|
+
* `has-helper` | Set when the element has helper text or slot
|
|
43
|
+
* `has-error-message` | Set when the element has an error message
|
|
44
|
+
* `has-tooltip` | Set when the element has a slotted tooltip
|
|
45
|
+
* `invalid` | Set when the element is invalid
|
|
46
|
+
* `input-prevented` | Temporarily set when invalid input is prevented
|
|
47
|
+
* `focused` | Set when the element is focused
|
|
48
|
+
* `focus-ring` | Set when the element is keyboard focused
|
|
49
|
+
* `readonly` | Set when the element is readonly
|
|
50
|
+
* `password-visible` | Set when the password is visible
|
|
32
51
|
*
|
|
33
|
-
*
|
|
34
|
-
* -------------------|---------------------------------
|
|
35
|
-
* `password-visible` | Set when the password is visible
|
|
52
|
+
* Note, the `input-prevented` state attribute is only supported when `allowedCharPattern` is set.
|
|
36
53
|
*
|
|
37
54
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
38
55
|
*
|
|
@@ -62,7 +79,7 @@ export class PasswordField extends PasswordFieldMixin(TextField) {
|
|
|
62
79
|
_renderSuffix() {
|
|
63
80
|
return html`
|
|
64
81
|
${super._renderSuffix()}
|
|
65
|
-
<div part="reveal-button" slot="suffix">
|
|
82
|
+
<div part="field-button reveal-button" slot="suffix">
|
|
66
83
|
<slot name="reveal"></slot>
|
|
67
84
|
</div>
|
|
68
85
|
`;
|
package/vaadin-password-field.js
CHANGED
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/password-field",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-beta2",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-password-field",
|
|
11
|
-
"description": "`<vaadin-password-field>` is an extension of `<vaadin-text-field>` component for entering passwords.\n\n```html\n<vaadin-password-field label=\"Password\"></vaadin-password-field>\n```\n\n### Styling\n\
|
|
11
|
+
"description": "`<vaadin-password-field>` is an extension of `<vaadin-text-field>` component for entering passwords.\n\n```html\n<vaadin-password-field label=\"Password\"></vaadin-password-field>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and suffix\n`field-button` | Set on both clear and reveal buttons\n`clear-button` | The clear button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`reveal-button` | The eye icon which toggles the password visibility\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n`invalid` | Set when the element is invalid\n`input-prevented` | Temporarily set when invalid input is prevented\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`password-visible` | Set when the password is visible\n\nNote, the `input-prevented` state attribute is only supported when `allowedCharPattern` is set.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "disabled",
|
|
@@ -576,7 +576,7 @@
|
|
|
576
576
|
},
|
|
577
577
|
{
|
|
578
578
|
"name": "i18n",
|
|
579
|
-
"description": "An object with translated strings used for localization.\nIt has the following structure and default values:\n\n
|
|
579
|
+
"description": "An object with translated strings used for localization.\nIt has the following structure and default values:\n\n```js\n{\n // Translation of the reveal icon button accessible label\n reveal: 'Show password'\n}\n```",
|
|
580
580
|
"value": {
|
|
581
581
|
"type": [
|
|
582
582
|
"Object",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/password-field",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-beta2",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-password-field",
|
|
19
|
-
"description": "`<vaadin-password-field>` is an extension of `<vaadin-text-field>` component for entering passwords.\n\n```html\n<vaadin-password-field label=\"Password\"></vaadin-password-field>\n```\n\n### Styling\n\
|
|
19
|
+
"description": "`<vaadin-password-field>` is an extension of `<vaadin-text-field>` component for entering passwords.\n\n```html\n<vaadin-password-field label=\"Password\"></vaadin-password-field>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and suffix\n`field-button` | Set on both clear and reveal buttons\n`clear-button` | The clear button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`reveal-button` | The eye icon which toggles the password visibility\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n`invalid` | Set when the element is invalid\n`input-prevented` | Temporarily set when invalid input is prevented\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`password-visible` | Set when the password is visible\n\nNote, the `input-prevented` state attribute is only supported when `allowedCharPattern` is set.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
198
|
"name": ".i18n",
|
|
199
|
-
"description": "An object with translated strings used for localization.\nIt has the following structure and default values:\n\n
|
|
199
|
+
"description": "An object with translated strings used for localization.\nIt has the following structure and default values:\n\n```js\n{\n // Translation of the reveal icon button accessible label\n reveal: 'Show password'\n}\n```",
|
|
200
200
|
"value": {
|
|
201
201
|
"kind": "expression"
|
|
202
202
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { buttonStyles } from '@vaadin/button/src/styles/vaadin-button-core-styles.js';
|
|
7
|
-
|
|
8
|
-
export const passwordFieldButton = [buttonStyles];
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css } from 'lit';
|
|
7
|
-
|
|
8
|
-
// Custom styles are only used in base styles version, but we need a matching export
|
|
9
|
-
export const passwordFieldStyles = css``;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { button } from '@vaadin/button/theme/lumo/vaadin-button-styles.js';
|
|
7
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
|
-
|
|
9
|
-
const passwordFieldButton = css`
|
|
10
|
-
:host {
|
|
11
|
-
position: absolute;
|
|
12
|
-
right: 0;
|
|
13
|
-
top: 0;
|
|
14
|
-
margin: 0;
|
|
15
|
-
padding: 0;
|
|
16
|
-
width: 100%;
|
|
17
|
-
height: 100%;
|
|
18
|
-
min-width: auto;
|
|
19
|
-
background: transparent;
|
|
20
|
-
outline: none;
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
registerStyles('vaadin-password-field-button', [button, passwordFieldButton], {
|
|
25
|
-
moduleId: 'lumo-password-field-button',
|
|
26
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import '@vaadin/vaadin-lumo-styles/font-icons.js';
|
|
7
|
-
import '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
8
|
-
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import '@vaadin/vaadin-lumo-styles/font-icons.js';
|
|
7
|
-
import '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
8
|
-
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
9
|
-
import { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';
|
|
10
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
|
-
|
|
12
|
-
const passwordField = css`
|
|
13
|
-
[part='reveal-button']::before {
|
|
14
|
-
content: var(--lumo-icons-eye);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:host([password-visible]) [part='reveal-button']::before {
|
|
18
|
-
content: var(--lumo-icons-eye-disabled);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/* Make it easy to hide the button across the whole app */
|
|
22
|
-
[part='reveal-button'] {
|
|
23
|
-
position: relative;
|
|
24
|
-
display: var(--lumo-password-field-reveal-button-display, block);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
[part='reveal-button'][hidden] {
|
|
28
|
-
display: none !important;
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
|
-
registerStyles('vaadin-password-field', [inputFieldShared, passwordField], { moduleId: 'lumo-password-field' });
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import '@vaadin/text-field/theme/lumo/vaadin-text-field.js';
|
|
7
|
-
import './vaadin-password-field-button-styles.js';
|
|
8
|
-
import './vaadin-password-field-styles.js';
|
|
9
|
-
import '../../src/vaadin-password-field.js';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import '@vaadin/text-field/theme/lumo/vaadin-text-field.js';
|
|
7
|
-
import './vaadin-password-field-button-styles.js';
|
|
8
|
-
import './vaadin-password-field-styles.js';
|
|
9
|
-
import '../../src/vaadin-password-field.js';
|