@vaadin/login 24.8.0-alpha9 → 25.0.0-alpha2
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/README.md +0 -26
- package/package.json +14 -17
- package/src/vaadin-login-form-wrapper.js +34 -32
- package/src/vaadin-login-form.js +36 -34
- package/src/vaadin-login-overlay-mixin.js +1 -0
- package/src/vaadin-login-overlay-wrapper.js +13 -11
- package/src/vaadin-login-overlay.js +36 -21
- package/theme/lumo/vaadin-login-overlay-styles.d.ts +0 -1
- package/theme/lumo/vaadin-login-overlay-styles.js +0 -1
- package/theme/lumo/vaadin-login-overlay.d.ts +2 -2
- package/theme/lumo/vaadin-login-overlay.js +2 -2
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
- package/src/vaadin-lit-login-form-wrapper.js +0 -86
- package/src/vaadin-lit-login-form.d.ts +0 -6
- package/src/vaadin-lit-login-form.js +0 -112
- package/src/vaadin-lit-login-overlay-wrapper.js +0 -52
- package/src/vaadin-lit-login-overlay.d.ts +0 -6
- package/src/vaadin-lit-login-overlay.js +0 -83
- package/theme/lumo/vaadin-lit-login-form.d.ts +0 -5
- package/theme/lumo/vaadin-lit-login-form.js +0 -5
- package/theme/lumo/vaadin-lit-login-overlay.d.ts +0 -3
- package/theme/lumo/vaadin-lit-login-overlay.js +0 -3
- package/theme/material/vaadin-lit-login-form.d.ts +0 -5
- package/theme/material/vaadin-lit-login-form.js +0 -5
- package/theme/material/vaadin-lit-login-overlay.d.ts +0 -3
- package/theme/material/vaadin-lit-login-overlay.js +0 -3
- package/theme/material/vaadin-login-form-wrapper-styles.d.ts +0 -1
- package/theme/material/vaadin-login-form-wrapper-styles.js +0 -109
- package/theme/material/vaadin-login-form.d.ts +0 -5
- package/theme/material/vaadin-login-form.js +0 -5
- package/theme/material/vaadin-login-overlay-styles.d.ts +0 -1
- package/theme/material/vaadin-login-overlay-styles.js +0 -352
- package/theme/material/vaadin-login-overlay.d.ts +0 -6
- package/theme/material/vaadin-login-overlay.js +0 -6
- package/vaadin-lit-login-form.d.ts +0 -1
- package/vaadin-lit-login-form.js +0 -3
- package/vaadin-lit-login-overlay.d.ts +0 -1
- package/vaadin-lit-login-overlay.js +0 -3
package/README.md
CHANGED
|
@@ -26,32 +26,6 @@ Once installed, import the component in your application:
|
|
|
26
26
|
import '@vaadin/login';
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
## Themes
|
|
30
|
-
|
|
31
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
|
|
32
|
-
The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/list-box/vaadin-list-box.js) of the package uses Lumo theme.
|
|
33
|
-
|
|
34
|
-
To use the Material theme, import the components from the `theme/material` folder:
|
|
35
|
-
|
|
36
|
-
```js
|
|
37
|
-
import '@vaadin/login/theme/material/vaadin-login-overlay.js';
|
|
38
|
-
import '@vaadin/login/theme/material/vaadin-login-form.js';
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
You can also import the Lumo version of the components explicitly:
|
|
42
|
-
|
|
43
|
-
```js
|
|
44
|
-
import '@vaadin/login/theme/lumo/vaadin-login-overlay.js';
|
|
45
|
-
import '@vaadin/login/theme/lumo/vaadin-login-form.js';
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Finally, you can import the un-themed components from the `src` folder to get a minimal starting point:
|
|
49
|
-
|
|
50
|
-
```js
|
|
51
|
-
import '@vaadin/login/src/vaadin-login-overlay.js';
|
|
52
|
-
import '@vaadin/login/src/vaadin-login-form.js';
|
|
53
|
-
```
|
|
54
|
-
|
|
55
29
|
## Contributing
|
|
56
30
|
|
|
57
31
|
Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/login",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0-alpha2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -31,32 +31,29 @@
|
|
|
31
31
|
"Vaadin",
|
|
32
32
|
"vaadin-login",
|
|
33
33
|
"web-components",
|
|
34
|
-
"web-component"
|
|
35
|
-
"polymer"
|
|
34
|
+
"web-component"
|
|
36
35
|
],
|
|
37
36
|
"dependencies": {
|
|
38
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
39
|
-
"@
|
|
40
|
-
"@vaadin/
|
|
41
|
-
"@vaadin/
|
|
42
|
-
"@vaadin/
|
|
43
|
-
"@vaadin/
|
|
44
|
-
"@vaadin/
|
|
45
|
-
"@vaadin/vaadin-
|
|
46
|
-
"@vaadin/vaadin-material-styles": "24.8.0-alpha9",
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "24.8.0-alpha9",
|
|
38
|
+
"@vaadin/button": "25.0.0-alpha2",
|
|
39
|
+
"@vaadin/component-base": "25.0.0-alpha2",
|
|
40
|
+
"@vaadin/overlay": "25.0.0-alpha2",
|
|
41
|
+
"@vaadin/password-field": "25.0.0-alpha2",
|
|
42
|
+
"@vaadin/text-field": "25.0.0-alpha2",
|
|
43
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha2",
|
|
44
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
|
|
48
45
|
"lit": "^3.0.0"
|
|
49
46
|
},
|
|
50
47
|
"devDependencies": {
|
|
51
|
-
"@vaadin/chai-plugins": "
|
|
52
|
-
"@vaadin/checkbox": "
|
|
53
|
-
"@vaadin/test-runner-commands": "
|
|
54
|
-
"@vaadin/testing-helpers": "^
|
|
48
|
+
"@vaadin/chai-plugins": "25.0.0-alpha2",
|
|
49
|
+
"@vaadin/checkbox": "25.0.0-alpha2",
|
|
50
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha2",
|
|
51
|
+
"@vaadin/testing-helpers": "^2.0.0",
|
|
55
52
|
"sinon": "^18.0.0"
|
|
56
53
|
},
|
|
57
54
|
"web-types": [
|
|
58
55
|
"web-types.json",
|
|
59
56
|
"web-types.lit.json"
|
|
60
57
|
],
|
|
61
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "67ffcd5355cf21ce1b5039c598525109fc4c164b"
|
|
62
59
|
}
|
|
@@ -3,15 +3,12 @@
|
|
|
3
3
|
* Copyright (c) 2018 - 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 { html,
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
-
import {
|
|
8
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
9
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
10
|
import { loginFormWrapperStyles } from './vaadin-login-form-wrapper-styles.js';
|
|
10
11
|
|
|
11
|
-
registerStyles('vaadin-login-form-wrapper', loginFormWrapperStyles, {
|
|
12
|
-
moduleId: 'vaadin-login-form-wrapper-styles',
|
|
13
|
-
});
|
|
14
|
-
|
|
15
12
|
/**
|
|
16
13
|
* An element used internally by `<vaadin-login-form>`. Not intended to be used separately.
|
|
17
14
|
*
|
|
@@ -19,36 +16,15 @@ registerStyles('vaadin-login-form-wrapper', loginFormWrapperStyles, {
|
|
|
19
16
|
* @mixes ThemableMixin
|
|
20
17
|
* @private
|
|
21
18
|
*/
|
|
22
|
-
class LoginFormWrapper extends ThemableMixin(
|
|
23
|
-
static get template() {
|
|
24
|
-
return html`
|
|
25
|
-
<section part="form">
|
|
26
|
-
<div part="form-title" part="form-title" role="heading" aria-level$="[[headingLevel]]">[[i18n.form.title]]</div>
|
|
27
|
-
<div part="error-message" hidden$="[[!error]]">
|
|
28
|
-
<strong part="error-message-title">[[i18n.errorMessage.title]]</strong>
|
|
29
|
-
<p part="error-message-description">[[i18n.errorMessage.message]]</p>
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<slot name="form"></slot>
|
|
33
|
-
|
|
34
|
-
<slot name="custom-form-area"></slot>
|
|
35
|
-
|
|
36
|
-
<slot name="submit"></slot>
|
|
37
|
-
|
|
38
|
-
<slot name="forgot-password"></slot>
|
|
39
|
-
|
|
40
|
-
<div part="footer">
|
|
41
|
-
<slot name="footer"></slot>
|
|
42
|
-
<p>[[i18n.additionalInformation]]</p>
|
|
43
|
-
</div>
|
|
44
|
-
</section>
|
|
45
|
-
`;
|
|
46
|
-
}
|
|
47
|
-
|
|
19
|
+
class LoginFormWrapper extends ThemableMixin(PolylitMixin(LitElement)) {
|
|
48
20
|
static get is() {
|
|
49
21
|
return 'vaadin-login-form-wrapper';
|
|
50
22
|
}
|
|
51
23
|
|
|
24
|
+
static get styles() {
|
|
25
|
+
return loginFormWrapperStyles;
|
|
26
|
+
}
|
|
27
|
+
|
|
52
28
|
static get properties() {
|
|
53
29
|
return {
|
|
54
30
|
/**
|
|
@@ -77,6 +53,32 @@ class LoginFormWrapper extends ThemableMixin(PolymerElement) {
|
|
|
77
53
|
},
|
|
78
54
|
};
|
|
79
55
|
}
|
|
56
|
+
|
|
57
|
+
/** @protected */
|
|
58
|
+
render() {
|
|
59
|
+
return html`
|
|
60
|
+
<section part="form">
|
|
61
|
+
<div part="form-title" role="heading" aria-level="${this.headingLevel}">${this.i18n.form.title}</div>
|
|
62
|
+
<div part="error-message" ?hidden="${!this.error}">
|
|
63
|
+
<strong part="error-message-title">${this.i18n.errorMessage.title}</strong>
|
|
64
|
+
<p part="error-message-description">${this.i18n.errorMessage.message}</p>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<slot name="form"></slot>
|
|
68
|
+
|
|
69
|
+
<slot name="custom-form-area"></slot>
|
|
70
|
+
|
|
71
|
+
<slot name="submit"></slot>
|
|
72
|
+
|
|
73
|
+
<slot name="forgot-password"></slot>
|
|
74
|
+
|
|
75
|
+
<div part="footer">
|
|
76
|
+
<slot name="footer"></slot>
|
|
77
|
+
<p>${this.i18n.additionalInformation}</p>
|
|
78
|
+
</div>
|
|
79
|
+
</section>
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
defineCustomElement(LoginFormWrapper);
|
package/src/vaadin-login-form.js
CHANGED
|
@@ -7,9 +7,11 @@ import '@vaadin/button/src/vaadin-button.js';
|
|
|
7
7
|
import '@vaadin/text-field/src/vaadin-text-field.js';
|
|
8
8
|
import '@vaadin/password-field/src/vaadin-password-field.js';
|
|
9
9
|
import './vaadin-login-form-wrapper.js';
|
|
10
|
-
import { html,
|
|
10
|
+
import { html, LitElement } from 'lit';
|
|
11
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
12
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
12
13
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
14
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
13
15
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
16
|
import { LoginFormMixin } from './vaadin-login-form-mixin.js';
|
|
15
17
|
|
|
@@ -53,8 +55,21 @@ import { LoginFormMixin } from './vaadin-login-form-mixin.js';
|
|
|
53
55
|
* @mixes ThemableMixin
|
|
54
56
|
* @mixes LoginFormMixin
|
|
55
57
|
*/
|
|
56
|
-
class LoginForm extends LoginFormMixin(ElementMixin(ThemableMixin(
|
|
57
|
-
static get
|
|
58
|
+
class LoginForm extends LoginFormMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
59
|
+
static get is() {
|
|
60
|
+
return 'vaadin-login-form';
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @protected
|
|
65
|
+
* @override
|
|
66
|
+
*/
|
|
67
|
+
createRenderRoot() {
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** @protected */
|
|
72
|
+
render() {
|
|
58
73
|
return html`
|
|
59
74
|
<style>
|
|
60
75
|
vaadin-login-form-wrapper > form > * {
|
|
@@ -63,72 +78,59 @@ class LoginForm extends LoginFormMixin(ElementMixin(ThemableMixin(PolymerElement
|
|
|
63
78
|
</style>
|
|
64
79
|
<vaadin-login-form-wrapper
|
|
65
80
|
id="vaadinLoginFormWrapper"
|
|
66
|
-
theme
|
|
67
|
-
error="
|
|
68
|
-
i18n="
|
|
69
|
-
|
|
81
|
+
theme="${ifDefined(this._theme)}"
|
|
82
|
+
.error="${this.error}"
|
|
83
|
+
.i18n="${this.__effectiveI18n}"
|
|
84
|
+
.headingLevel="${this.headingLevel}"
|
|
70
85
|
>
|
|
71
|
-
<form method="POST" action
|
|
86
|
+
<form method="POST" action="${ifDefined(this.action)}" @formdata="${this._onFormData}" slot="form">
|
|
72
87
|
<input id="csrf" type="hidden" />
|
|
73
88
|
<vaadin-text-field
|
|
74
89
|
name="username"
|
|
75
|
-
label="
|
|
76
|
-
|
|
90
|
+
.label="${this.__effectiveI18n.form.username}"
|
|
91
|
+
.errorMessage="${this.__effectiveI18n.errorMessage.username}"
|
|
77
92
|
id="vaadinLoginUsername"
|
|
78
93
|
required
|
|
79
|
-
|
|
94
|
+
@keydown="${this._handleInputKeydown}"
|
|
80
95
|
autocapitalize="none"
|
|
81
96
|
autocorrect="off"
|
|
82
97
|
spellcheck="false"
|
|
83
98
|
autocomplete="username"
|
|
84
99
|
manual-validation
|
|
85
100
|
>
|
|
86
|
-
<input type="text" slot="input"
|
|
101
|
+
<input type="text" slot="input" @keyup="${this._handleInputKeyup}" />
|
|
87
102
|
</vaadin-text-field>
|
|
88
103
|
|
|
89
104
|
<vaadin-password-field
|
|
90
105
|
name="password"
|
|
91
|
-
label="
|
|
92
|
-
|
|
106
|
+
.label="${this.__effectiveI18n.form.password}"
|
|
107
|
+
.errorMessage="${this.__effectiveI18n.errorMessage.password}"
|
|
93
108
|
id="vaadinLoginPassword"
|
|
94
109
|
required
|
|
95
|
-
|
|
110
|
+
@keydown="${this._handleInputKeydown}"
|
|
96
111
|
spellcheck="false"
|
|
97
112
|
autocomplete="current-password"
|
|
98
113
|
manual-validation
|
|
99
114
|
>
|
|
100
|
-
<input type="password" slot="input"
|
|
115
|
+
<input type="password" slot="input" @keyup="${this._handleInputKeyup}" />
|
|
101
116
|
</vaadin-password-field>
|
|
102
117
|
</form>
|
|
103
118
|
|
|
104
|
-
<vaadin-button slot="submit" theme="primary
|
|
105
|
-
|
|
119
|
+
<vaadin-button slot="submit" theme="primary submit" @click="${this.submit}" .disabled="${this.disabled}">
|
|
120
|
+
${this.__effectiveI18n.form.submit}
|
|
106
121
|
</vaadin-button>
|
|
107
122
|
|
|
108
123
|
<vaadin-button
|
|
109
124
|
slot="forgot-password"
|
|
110
125
|
theme="tertiary small"
|
|
111
|
-
|
|
112
|
-
hidden
|
|
126
|
+
@click="${this._onForgotPasswordClick}"
|
|
127
|
+
?hidden="${this.noForgotPassword}"
|
|
113
128
|
>
|
|
114
|
-
|
|
129
|
+
${this.__effectiveI18n.form.forgotPassword}
|
|
115
130
|
</vaadin-button>
|
|
116
131
|
</vaadin-login-form-wrapper>
|
|
117
132
|
`;
|
|
118
133
|
}
|
|
119
|
-
|
|
120
|
-
static get is() {
|
|
121
|
-
return 'vaadin-login-form';
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* @param {StampedTemplate} dom
|
|
126
|
-
* @return {null}
|
|
127
|
-
* @protected
|
|
128
|
-
*/
|
|
129
|
-
_attachDom(dom) {
|
|
130
|
-
this.appendChild(dom);
|
|
131
|
-
}
|
|
132
134
|
}
|
|
133
135
|
|
|
134
136
|
defineCustomElement(LoginForm);
|
|
@@ -3,17 +3,14 @@
|
|
|
3
3
|
* Copyright (c) 2018 - 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 { html,
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
8
9
|
import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
|
|
9
|
-
import {
|
|
10
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
11
|
import { LoginOverlayWrapperMixin } from './vaadin-login-overlay-wrapper-mixin.js';
|
|
11
12
|
import { loginOverlayWrapperStyles } from './vaadin-login-overlay-wrapper-styles.js';
|
|
12
13
|
|
|
13
|
-
registerStyles('vaadin-login-overlay-wrapper', [overlayStyles, loginOverlayWrapperStyles], {
|
|
14
|
-
moduleId: 'vaadin-login-overlay-wrapper-styles',
|
|
15
|
-
});
|
|
16
|
-
|
|
17
14
|
/**
|
|
18
15
|
* An element used internally by `<vaadin-login-overlay>`. Not intended to be used separately.
|
|
19
16
|
*
|
|
@@ -22,22 +19,27 @@ registerStyles('vaadin-login-overlay-wrapper', [overlayStyles, loginOverlayWrapp
|
|
|
22
19
|
* @mixes ThemableMixin
|
|
23
20
|
* @private
|
|
24
21
|
*/
|
|
25
|
-
class LoginOverlayWrapper extends LoginOverlayWrapperMixin(ThemableMixin(
|
|
22
|
+
class LoginOverlayWrapper extends LoginOverlayWrapperMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
26
23
|
static get is() {
|
|
27
24
|
return 'vaadin-login-overlay-wrapper';
|
|
28
25
|
}
|
|
29
26
|
|
|
30
|
-
static get
|
|
27
|
+
static get styles() {
|
|
28
|
+
return [overlayStyles, loginOverlayWrapperStyles];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** @protected */
|
|
32
|
+
render() {
|
|
31
33
|
return html`
|
|
32
|
-
<div id="backdrop" part="backdrop" hidden
|
|
34
|
+
<div id="backdrop" part="backdrop" ?hidden="${!this.withBackdrop}"></div>
|
|
33
35
|
<div part="overlay" id="overlay" tabindex="0">
|
|
34
36
|
<div part="content" id="content">
|
|
35
37
|
<section part="card">
|
|
36
38
|
<div part="brand">
|
|
37
39
|
<slot name="title">
|
|
38
|
-
<div part="title" role="heading" aria-level
|
|
40
|
+
<div part="title" role="heading" aria-level="${this.headingLevel}">${this.title}</div>
|
|
39
41
|
</slot>
|
|
40
|
-
<p part="description"
|
|
42
|
+
<p part="description">${this.description}</p>
|
|
41
43
|
</div>
|
|
42
44
|
<div part="form">
|
|
43
45
|
<slot></slot>
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import './vaadin-login-form.js';
|
|
7
7
|
import './vaadin-login-overlay-wrapper.js';
|
|
8
|
-
import { html,
|
|
8
|
+
import { html, LitElement } from 'lit';
|
|
9
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
9
10
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
11
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
12
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
13
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
14
|
import { LoginOverlayMixin } from './vaadin-login-overlay-mixin.js';
|
|
13
15
|
|
|
@@ -50,34 +52,41 @@ import { LoginOverlayMixin } from './vaadin-login-overlay-mixin.js';
|
|
|
50
52
|
* @mixes ThemableMixin
|
|
51
53
|
* @mixes LoginOverlayMixin
|
|
52
54
|
*/
|
|
53
|
-
class LoginOverlay extends LoginOverlayMixin(ElementMixin(ThemableMixin(
|
|
54
|
-
static get
|
|
55
|
+
class LoginOverlay extends LoginOverlayMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
56
|
+
static get is() {
|
|
57
|
+
return 'vaadin-login-overlay';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** @protected */
|
|
61
|
+
render() {
|
|
55
62
|
return html`
|
|
56
63
|
<vaadin-login-overlay-wrapper
|
|
57
64
|
id="vaadinLoginOverlayWrapper"
|
|
58
|
-
opened="{
|
|
65
|
+
.opened="${this.opened}"
|
|
66
|
+
.title="${this.title}"
|
|
67
|
+
.description="${this.description}"
|
|
68
|
+
.headingLevel="${this.headingLevel}"
|
|
59
69
|
role="dialog"
|
|
60
70
|
focus-trap
|
|
61
71
|
with-backdrop
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
on-vaadin-overlay-escape-press="_preventClosingLogin"
|
|
67
|
-
on-vaadin-overlay-outside-click="_preventClosingLogin"
|
|
72
|
+
theme="${ifDefined(this._theme)}"
|
|
73
|
+
@vaadin-overlay-escape-press="${this._preventClosingLogin}"
|
|
74
|
+
@vaadin-overlay-outside-click="${this._preventClosingLogin}"
|
|
75
|
+
@opened-changed="${this._onOpenedChanged}"
|
|
68
76
|
>
|
|
69
77
|
<vaadin-login-form
|
|
70
78
|
theme="with-overlay"
|
|
71
79
|
id="vaadinLoginForm"
|
|
72
|
-
action="
|
|
73
|
-
disabled="{
|
|
74
|
-
error="{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
i18n="{
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
.action="${this.action}"
|
|
81
|
+
.disabled="${this.disabled}"
|
|
82
|
+
.error="${this.error}"
|
|
83
|
+
.noAutofocus="${this.noAutofocus}"
|
|
84
|
+
.noForgotPassword="${this.noForgotPassword}"
|
|
85
|
+
.headingLevel="${this.__computeHeadingLevel(this.headingLevel)}"
|
|
86
|
+
.i18n="${this.__effectiveI18n}"
|
|
87
|
+
@login="${this._retargetEvent}"
|
|
88
|
+
@forgot-password="${this._retargetEvent}"
|
|
89
|
+
@disabled-changed="${this._onDisabledChanged}"
|
|
81
90
|
></vaadin-login-form>
|
|
82
91
|
</vaadin-login-overlay-wrapper>
|
|
83
92
|
|
|
@@ -88,8 +97,14 @@ class LoginOverlay extends LoginOverlayMixin(ElementMixin(ThemableMixin(PolymerE
|
|
|
88
97
|
`;
|
|
89
98
|
}
|
|
90
99
|
|
|
91
|
-
|
|
92
|
-
|
|
100
|
+
/** @private */
|
|
101
|
+
_onOpenedChanged(event) {
|
|
102
|
+
this.opened = event.detail.value;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** @private */
|
|
106
|
+
_onDisabledChanged(event) {
|
|
107
|
+
this.disabled = event.detail.value;
|
|
93
108
|
}
|
|
94
109
|
}
|
|
95
110
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
2
|
-
import './vaadin-login-form-wrapper-styles.js';
|
|
3
2
|
import { color } from '@vaadin/vaadin-lumo-styles/color.js';
|
|
4
3
|
import { overlay } from '@vaadin/vaadin-lumo-styles/mixins/overlay.js';
|
|
5
4
|
import { typography } from '@vaadin/vaadin-lumo-styles/typography.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import '@vaadin/button/theme/lumo/vaadin-button.js';
|
|
1
2
|
import '@vaadin/text-field/theme/lumo/vaadin-text-field.js';
|
|
2
3
|
import '@vaadin/password-field/theme/lumo/vaadin-password-field.js';
|
|
3
|
-
import '
|
|
4
|
-
import './vaadin-login-form.js';
|
|
4
|
+
import './vaadin-login-form-wrapper-styles.js';
|
|
5
5
|
import './vaadin-login-overlay-styles.js';
|
|
6
6
|
import '../../src/vaadin-login-overlay.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import '@vaadin/button/theme/lumo/vaadin-button.js';
|
|
1
2
|
import '@vaadin/text-field/theme/lumo/vaadin-text-field.js';
|
|
2
3
|
import '@vaadin/password-field/theme/lumo/vaadin-password-field.js';
|
|
3
|
-
import '
|
|
4
|
-
import './vaadin-login-form.js';
|
|
4
|
+
import './vaadin-login-form-wrapper-styles.js';
|
|
5
5
|
import './vaadin-login-overlay-styles.js';
|
|
6
6
|
import '../../src/vaadin-login-overlay.js';
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/login",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "25.0.0-alpha2",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
"name": "vaadin-login-overlay",
|
|
173
|
-
"description": "`<vaadin-login-overlay>` is a wrapper of the `<vaadin-login-form>` which opens a login form in an overlay and\nhaving an additional `brand` part for application title and description. Using `<vaadin-login-overlay>` allows\npassword managers to work with login form.\n\n```\n<vaadin-login-overlay opened></vaadin-login-overlay>\n```\n\n### Styling\n\nThe component doesn't have a shadowRoot, so the `<form>` and input fields can be styled from a global scope.\nUse `<vaadin-login-overlay-wrapper>` and `<vaadin-login-form-wrapper>` to apply styles.\n\nThe following shadow DOM parts of the `<vaadin-login-overlay-wrapper>` are available for styling:\n\nPart name | Description\n----------------|---------------------------------------------------------|\n`card` | Container for the entire component's content\n`brand` | Container for application title and description\n`form` | Container for the `<vaadin-login-form>` component\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\nSee [`<vaadin-login-form>`](https://cdn.vaadin.com/vaadin-web-components/
|
|
173
|
+
"description": "`<vaadin-login-overlay>` is a wrapper of the `<vaadin-login-form>` which opens a login form in an overlay and\nhaving an additional `brand` part for application title and description. Using `<vaadin-login-overlay>` allows\npassword managers to work with login form.\n\n```\n<vaadin-login-overlay opened></vaadin-login-overlay>\n```\n\n### Styling\n\nThe component doesn't have a shadowRoot, so the `<form>` and input fields can be styled from a global scope.\nUse `<vaadin-login-overlay-wrapper>` and `<vaadin-login-form-wrapper>` to apply styles.\n\nThe following shadow DOM parts of the `<vaadin-login-overlay-wrapper>` are available for styling:\n\nPart name | Description\n----------------|---------------------------------------------------------|\n`card` | Container for the entire component's content\n`brand` | Container for application title and description\n`form` | Container for the `<vaadin-login-form>` component\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\nSee [`<vaadin-login-form>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha2/#/elements/vaadin-login-form)\ndocumentation for `<vaadin-login-form-wrapper>` stylable parts.",
|
|
174
174
|
"attributes": [
|
|
175
175
|
{
|
|
176
176
|
"name": "action",
|
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/login",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "25.0.0-alpha2",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"name": "vaadin-login-overlay",
|
|
103
|
-
"description": "`<vaadin-login-overlay>` is a wrapper of the `<vaadin-login-form>` which opens a login form in an overlay and\nhaving an additional `brand` part for application title and description. Using `<vaadin-login-overlay>` allows\npassword managers to work with login form.\n\n```\n<vaadin-login-overlay opened></vaadin-login-overlay>\n```\n\n### Styling\n\nThe component doesn't have a shadowRoot, so the `<form>` and input fields can be styled from a global scope.\nUse `<vaadin-login-overlay-wrapper>` and `<vaadin-login-form-wrapper>` to apply styles.\n\nThe following shadow DOM parts of the `<vaadin-login-overlay-wrapper>` are available for styling:\n\nPart name | Description\n----------------|---------------------------------------------------------|\n`card` | Container for the entire component's content\n`brand` | Container for application title and description\n`form` | Container for the `<vaadin-login-form>` component\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\nSee [`<vaadin-login-form>`](https://cdn.vaadin.com/vaadin-web-components/
|
|
103
|
+
"description": "`<vaadin-login-overlay>` is a wrapper of the `<vaadin-login-form>` which opens a login form in an overlay and\nhaving an additional `brand` part for application title and description. Using `<vaadin-login-overlay>` allows\npassword managers to work with login form.\n\n```\n<vaadin-login-overlay opened></vaadin-login-overlay>\n```\n\n### Styling\n\nThe component doesn't have a shadowRoot, so the `<form>` and input fields can be styled from a global scope.\nUse `<vaadin-login-overlay-wrapper>` and `<vaadin-login-form-wrapper>` to apply styles.\n\nThe following shadow DOM parts of the `<vaadin-login-overlay-wrapper>` are available for styling:\n\nPart name | Description\n----------------|---------------------------------------------------------|\n`card` | Container for the entire component's content\n`brand` | Container for application title and description\n`form` | Container for the `<vaadin-login-form>` component\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\nSee [`<vaadin-login-form>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha2/#/elements/vaadin-login-form)\ndocumentation for `<vaadin-login-form-wrapper>` stylable parts.",
|
|
104
104
|
"extension": true,
|
|
105
105
|
"attributes": [
|
|
106
106
|
{
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2018 - 2025 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 { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
9
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
|
-
import { loginFormWrapperStyles } from './vaadin-login-form-wrapper-styles.js';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* An element used internally by `<vaadin-login-form>`. Not intended to be used separately.
|
|
14
|
-
*
|
|
15
|
-
* @extends HTMLElement
|
|
16
|
-
* @mixes ThemableMixin
|
|
17
|
-
* @private
|
|
18
|
-
*/
|
|
19
|
-
class LoginFormWrapper extends ThemableMixin(PolylitMixin(LitElement)) {
|
|
20
|
-
static get is() {
|
|
21
|
-
return 'vaadin-login-form-wrapper';
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
static get styles() {
|
|
25
|
-
return loginFormWrapperStyles;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
static get properties() {
|
|
29
|
-
return {
|
|
30
|
-
/**
|
|
31
|
-
* If set, the error message is shown. The message is hidden by default.
|
|
32
|
-
* When set, it changes the disabled state of the submit button.
|
|
33
|
-
* @type {boolean}
|
|
34
|
-
*/
|
|
35
|
-
error: {
|
|
36
|
-
type: Boolean,
|
|
37
|
-
value: false,
|
|
38
|
-
reflectToAttribute: true,
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The object used to localize this component.
|
|
43
|
-
*/
|
|
44
|
-
i18n: {
|
|
45
|
-
type: Object,
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Used to customize the `aria-level` attribute on the heading element.
|
|
50
|
-
*/
|
|
51
|
-
headingLevel: {
|
|
52
|
-
type: Number,
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** @protected */
|
|
58
|
-
render() {
|
|
59
|
-
return html`
|
|
60
|
-
<section part="form">
|
|
61
|
-
<div part="form-title" role="heading" aria-level="${this.headingLevel}">${this.i18n.form.title}</div>
|
|
62
|
-
<div part="error-message" ?hidden="${!this.error}">
|
|
63
|
-
<strong part="error-message-title">${this.i18n.errorMessage.title}</strong>
|
|
64
|
-
<p part="error-message-description">${this.i18n.errorMessage.message}</p>
|
|
65
|
-
</div>
|
|
66
|
-
|
|
67
|
-
<slot name="form"></slot>
|
|
68
|
-
|
|
69
|
-
<slot name="custom-form-area"></slot>
|
|
70
|
-
|
|
71
|
-
<slot name="submit"></slot>
|
|
72
|
-
|
|
73
|
-
<slot name="forgot-password"></slot>
|
|
74
|
-
|
|
75
|
-
<div part="footer">
|
|
76
|
-
<slot name="footer"></slot>
|
|
77
|
-
<p>${this.i18n.additionalInformation}</p>
|
|
78
|
-
</div>
|
|
79
|
-
</section>
|
|
80
|
-
`;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
defineCustomElement(LoginFormWrapper);
|
|
85
|
-
|
|
86
|
-
export { LoginFormWrapper };
|