@vaadin/password-field 24.4.0-alpha2 → 24.4.0-alpha4
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 +11 -10
- package/src/vaadin-lit-password-field-button.js +39 -0
- package/src/vaadin-lit-password-field.d.ts +6 -0
- package/src/vaadin-lit-password-field.js +40 -0
- package/src/vaadin-password-field-mixin.js +3 -3
- package/theme/lumo/vaadin-lit-password-field.js +9 -0
- package/theme/material/vaadin-lit-password-field.js +9 -0
- package/vaadin-lit-password-field.d.ts +1 -0
- package/vaadin-lit-password-field.js +3 -0
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/password-field",
|
|
3
|
-
"version": "24.4.0-
|
|
3
|
+
"version": "24.4.0-alpha4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,14 +36,15 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
38
|
"@polymer/polymer": "^3.0.0",
|
|
39
|
-
"@vaadin/a11y-base": "24.4.0-
|
|
40
|
-
"@vaadin/button": "24.4.0-
|
|
41
|
-
"@vaadin/component-base": "24.4.0-
|
|
42
|
-
"@vaadin/field-base": "24.4.0-
|
|
43
|
-
"@vaadin/text-field": "24.4.0-
|
|
44
|
-
"@vaadin/vaadin-lumo-styles": "24.4.0-
|
|
45
|
-
"@vaadin/vaadin-material-styles": "24.4.0-
|
|
46
|
-
"@vaadin/vaadin-themable-mixin": "24.4.0-
|
|
39
|
+
"@vaadin/a11y-base": "24.4.0-alpha4",
|
|
40
|
+
"@vaadin/button": "24.4.0-alpha4",
|
|
41
|
+
"@vaadin/component-base": "24.4.0-alpha4",
|
|
42
|
+
"@vaadin/field-base": "24.4.0-alpha4",
|
|
43
|
+
"@vaadin/text-field": "24.4.0-alpha4",
|
|
44
|
+
"@vaadin/vaadin-lumo-styles": "24.4.0-alpha4",
|
|
45
|
+
"@vaadin/vaadin-material-styles": "24.4.0-alpha4",
|
|
46
|
+
"@vaadin/vaadin-themable-mixin": "24.4.0-alpha4",
|
|
47
|
+
"lit": "^3.0.0"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
50
|
"@esm-bundle/chai": "^4.3.4",
|
|
@@ -54,5 +55,5 @@
|
|
|
54
55
|
"web-types.json",
|
|
55
56
|
"web-types.lit.json"
|
|
56
57
|
],
|
|
57
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "3f23b333c5e4dd06f3c6a6b2505a0efcd0814b05"
|
|
58
59
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
7
|
+
import { buttonStyles } from '@vaadin/button/src/vaadin-button-base.js';
|
|
8
|
+
import { ButtonMixin } from '@vaadin/button/src/vaadin-button-mixin.js';
|
|
9
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
|
+
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
11
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
12
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* An element used internally by `<vaadin-password-field>`. Not intended to be used separately.
|
|
16
|
+
*
|
|
17
|
+
* @customElement
|
|
18
|
+
* @extends HTMLElement
|
|
19
|
+
* @mixes ButtonMixin
|
|
20
|
+
* @mixes DirMixin
|
|
21
|
+
* @mixes ThemableMixin
|
|
22
|
+
* @private
|
|
23
|
+
*/
|
|
24
|
+
class PasswordFieldButton extends ButtonMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
25
|
+
static get is() {
|
|
26
|
+
return 'vaadin-password-field-button';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static get styles() {
|
|
30
|
+
return buttonStyles;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** @protected */
|
|
34
|
+
render() {
|
|
35
|
+
return html``;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
defineCustomElement(PasswordFieldButton);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import './vaadin-lit-password-field-button.js';
|
|
7
|
+
import { html } from 'lit';
|
|
8
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
|
+
import { TextField } from '@vaadin/text-field/src/vaadin-lit-text-field.js';
|
|
10
|
+
import { PasswordFieldMixin } from './vaadin-password-field-mixin.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* LitElement based version of `<vaadin-password-field>` web component.
|
|
14
|
+
*
|
|
15
|
+
* ## Disclaimer
|
|
16
|
+
*
|
|
17
|
+
* This component is an experiment and not yet a part of Vaadin platform.
|
|
18
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
19
|
+
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
20
|
+
*/
|
|
21
|
+
export class PasswordField extends PasswordFieldMixin(TextField) {
|
|
22
|
+
static get is() {
|
|
23
|
+
return 'vaadin-password-field';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @protected
|
|
28
|
+
* @override
|
|
29
|
+
*/
|
|
30
|
+
_renderSuffix() {
|
|
31
|
+
return html`
|
|
32
|
+
${super._renderSuffix()}
|
|
33
|
+
<div part="reveal-button" slot="suffix">
|
|
34
|
+
<slot name="reveal"></slot>
|
|
35
|
+
</div>
|
|
36
|
+
`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
defineCustomElement(PasswordField);
|
|
@@ -65,7 +65,7 @@ export const PasswordFieldMixin = (superClass) =>
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
static get observers() {
|
|
68
|
-
return ['__i18nChanged(i18n
|
|
68
|
+
return ['__i18nChanged(i18n)'];
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
constructor() {
|
|
@@ -184,14 +184,14 @@ export const PasswordFieldMixin = (superClass) =>
|
|
|
184
184
|
|
|
185
185
|
/** @private */
|
|
186
186
|
__updateAriaLabel(i18n) {
|
|
187
|
-
if (i18n.reveal && this._revealNode) {
|
|
187
|
+
if (i18n && i18n.reveal && this._revealNode) {
|
|
188
188
|
this._revealNode.setAttribute('aria-label', i18n.reveal);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
/** @private */
|
|
193
193
|
__i18nChanged(i18n) {
|
|
194
|
-
this.__updateAriaLabel(i18n
|
|
194
|
+
this.__updateAriaLabel(i18n);
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
/** @private */
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 2024 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-styles.js';
|
|
7
|
+
import './vaadin-password-field-button-styles.js';
|
|
8
|
+
import './vaadin-password-field-styles.js';
|
|
9
|
+
import '../../src/vaadin-lit-password-field.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 2024 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/material/vaadin-text-field-styles.js';
|
|
7
|
+
import './vaadin-password-field-button-styles.js';
|
|
8
|
+
import './vaadin-password-field-styles.js';
|
|
9
|
+
import '../../src/vaadin-lit-password-field.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/vaadin-password-field.js';
|
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": "24.4.0-
|
|
4
|
+
"version": "24.4.0-alpha4",
|
|
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\n`<vaadin-password-field>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.4.0-
|
|
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\n`<vaadin-password-field>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.4.0-alpha4/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n----------------|----------------------------------------------------\n`reveal-button` | The eye icon which toggles the password visibility\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description\n-------------------|---------------------------------\n`password-visible` | Set when the password is visible\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "disabled",
|
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": "24.4.0-
|
|
4
|
+
"version": "24.4.0-alpha4",
|
|
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\n`<vaadin-password-field>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.4.0-
|
|
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\n`<vaadin-password-field>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.4.0-alpha4/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n----------------|----------------------------------------------------\n`reveal-button` | The eye icon which toggles the password visibility\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description\n-------------------|---------------------------------\n`password-visible` | Set when the password is visible\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|