@vaadin/login 24.8.4 → 25.0.0-alpha10
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 +17 -17
- package/src/styles/vaadin-login-form-wrapper-base-styles.js +65 -0
- package/src/styles/vaadin-login-form-wrapper-core-styles.d.ts +8 -0
- package/src/{vaadin-login-form-wrapper-styles.js → styles/vaadin-login-form-wrapper-core-styles.js} +8 -9
- package/src/styles/vaadin-login-overlay-wrapper-base-styles.js +55 -0
- package/src/styles/vaadin-login-overlay-wrapper-core-styles.d.ts +8 -0
- package/src/{vaadin-login-overlay-wrapper-styles.js → styles/vaadin-login-overlay-wrapper-core-styles.js} +5 -2
- package/src/title-controller.d.ts +11 -0
- package/src/title-controller.js +100 -0
- package/src/vaadin-login-form-mixin.js +93 -17
- package/src/vaadin-login-form-wrapper.js +34 -40
- package/src/vaadin-login-form.d.ts +2 -5
- package/src/vaadin-login-form.js +41 -76
- package/src/vaadin-login-overlay-mixin.d.ts +1 -2
- package/src/vaadin-login-overlay-mixin.js +59 -85
- package/src/vaadin-login-overlay-wrapper.js +39 -18
- package/src/vaadin-login-overlay.d.ts +29 -19
- package/src/vaadin-login-overlay.js +80 -49
- package/theme/lumo/vaadin-login-form-wrapper-styles.d.ts +3 -0
- package/theme/lumo/vaadin-login-form-wrapper-styles.js +11 -7
- package/theme/lumo/vaadin-login-overlay-styles.d.ts +2 -1
- package/theme/lumo/vaadin-login-overlay-styles.js +18 -33
- package/theme/lumo/vaadin-login-overlay.d.ts +2 -2
- package/theme/lumo/vaadin-login-overlay.js +2 -2
- package/web-types.json +7 -3
- package/web-types.lit.json +10 -3
- package/src/vaadin-lit-login-form-wrapper.js +0 -86
- 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.js +0 -83
- package/src/vaadin-login-overlay-wrapper-mixin.js +0 -78
- 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/src/{vaadin-login-form-wrapper-styles.d.ts → styles/vaadin-login-form-wrapper-base-styles.d.ts} +0 -0
- /package/src/{vaadin-login-overlay-wrapper-styles.d.ts → styles/vaadin-login-overlay-wrapper-base-styles.d.ts} +0 -0
|
@@ -3,93 +3,124 @@
|
|
|
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 '
|
|
6
|
+
import '@vaadin/button/src/vaadin-button.js';
|
|
7
|
+
import '@vaadin/text-field/src/vaadin-text-field.js';
|
|
8
|
+
import '@vaadin/password-field/src/vaadin-password-field.js';
|
|
9
|
+
import './vaadin-login-form-wrapper.js';
|
|
7
10
|
import './vaadin-login-overlay-wrapper.js';
|
|
8
|
-
import { html,
|
|
11
|
+
import { css, html, LitElement } from 'lit';
|
|
12
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
9
13
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
14
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
15
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
16
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
17
|
+
import { LoginFormMixin } from './vaadin-login-form-mixin.js';
|
|
12
18
|
import { LoginOverlayMixin } from './vaadin-login-overlay-mixin.js';
|
|
13
19
|
|
|
14
20
|
/**
|
|
15
|
-
* `<vaadin-login-overlay>` is a
|
|
16
|
-
*
|
|
17
|
-
* password managers to work with login form.
|
|
21
|
+
* `<vaadin-login-overlay>` is a web component which renders a login form in an overlay and
|
|
22
|
+
* provides an additional `brand` part for application title and description.
|
|
18
23
|
*
|
|
19
|
-
* ```
|
|
24
|
+
* ```html
|
|
20
25
|
* <vaadin-login-overlay opened></vaadin-login-overlay>
|
|
21
26
|
* ```
|
|
22
27
|
*
|
|
23
28
|
* ### Styling
|
|
24
29
|
*
|
|
25
|
-
* The
|
|
26
|
-
* Use `<vaadin-login-overlay-wrapper>` and `<vaadin-login-form-wrapper>` to apply styles.
|
|
27
|
-
*
|
|
28
|
-
* The following shadow DOM parts of the `<vaadin-login-overlay-wrapper>` are available for styling:
|
|
30
|
+
* The following shadow DOM parts are available for styling:
|
|
29
31
|
*
|
|
30
|
-
* Part name
|
|
31
|
-
*
|
|
32
|
-
* `
|
|
33
|
-
* `
|
|
34
|
-
* `
|
|
32
|
+
* Part name | Description
|
|
33
|
+
* -----------------------------|--------------------------------
|
|
34
|
+
* `backdrop` | Backdrop of the overlay
|
|
35
|
+
* `overlay` | The overlay container element
|
|
36
|
+
* `content` | The overlay content element
|
|
37
|
+
* `card` | Container for the brand and form wrapper
|
|
38
|
+
* `brand` | Container for application title and description
|
|
39
|
+
* `description` | The application description
|
|
40
|
+
* `form-wrapper` | The login form wrapper element
|
|
41
|
+
* `form` | The login form element
|
|
42
|
+
* `form-title` | Title of the login form
|
|
43
|
+
* `error-message` | Container for error message
|
|
44
|
+
* `error-message-title` | Container for error message title
|
|
45
|
+
* `error-message-description` | Container for error message description
|
|
46
|
+
* `footer` | Container for the footer element
|
|
35
47
|
*
|
|
36
48
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
37
49
|
*
|
|
38
|
-
* See [`<vaadin-login-form>`](#/elements/vaadin-login-form)
|
|
39
|
-
* documentation for `<vaadin-login-form-wrapper>` stylable parts.
|
|
40
|
-
*
|
|
41
50
|
* @fires {CustomEvent} description-changed - Fired when the `description` property changes.
|
|
42
51
|
* @fires {CustomEvent} disabled-changed - Fired when the `disabled` property changes.
|
|
43
52
|
* @fires {CustomEvent} error-changed - Fired when the `error` property changes.
|
|
44
53
|
* @fires {CustomEvent} forgot-password - Fired when user clicks on the "Forgot password" button.
|
|
45
54
|
* @fires {CustomEvent} login - Fired when a user submits the login.
|
|
55
|
+
* @fires {CustomEvent} closed - Fired when the overlay is closed.
|
|
46
56
|
*
|
|
47
57
|
* @customElement
|
|
48
58
|
* @extends HTMLElement
|
|
49
59
|
* @mixes ElementMixin
|
|
50
60
|
* @mixes ThemableMixin
|
|
61
|
+
* @mixes LoginFormMixin
|
|
51
62
|
* @mixes LoginOverlayMixin
|
|
52
63
|
*/
|
|
53
|
-
class LoginOverlay extends LoginOverlayMixin(ElementMixin(ThemableMixin(
|
|
54
|
-
static get
|
|
64
|
+
class LoginOverlay extends LoginFormMixin(LoginOverlayMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement))))) {
|
|
65
|
+
static get is() {
|
|
66
|
+
return 'vaadin-login-overlay';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
static get styles() {
|
|
70
|
+
return css`
|
|
71
|
+
:host {
|
|
72
|
+
display: block;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:host([hidden]) {
|
|
76
|
+
display: none !important;
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** @protected */
|
|
82
|
+
render() {
|
|
55
83
|
return html`
|
|
56
84
|
<vaadin-login-overlay-wrapper
|
|
57
|
-
id="
|
|
58
|
-
|
|
59
|
-
|
|
85
|
+
id="overlay"
|
|
86
|
+
.owner="${this}"
|
|
87
|
+
.opened="${this.opened}"
|
|
88
|
+
.description="${this.description}"
|
|
60
89
|
focus-trap
|
|
61
90
|
with-backdrop
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
91
|
+
theme="${ifDefined(this._theme)}"
|
|
92
|
+
@vaadin-overlay-escape-press="${this._preventClosingLogin}"
|
|
93
|
+
@vaadin-overlay-outside-click="${this._preventClosingLogin}"
|
|
94
|
+
@vaadin-overlay-closed="${this.__handleOverlayClosed}"
|
|
95
|
+
@opened-changed="${this._onOpenedChanged}"
|
|
96
|
+
exportparts="backdrop, overlay, content, card, brand, description, form-wrapper"
|
|
68
97
|
>
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
id="
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
98
|
+
<slot name="title" slot="title"></slot>
|
|
99
|
+
<vaadin-login-form-wrapper
|
|
100
|
+
id="form"
|
|
101
|
+
.error="${this.error}"
|
|
102
|
+
.i18n="${this.__effectiveI18n}"
|
|
103
|
+
part="form"
|
|
104
|
+
role="region"
|
|
105
|
+
aria-labelledby="title"
|
|
106
|
+
exportparts="error-message, error-message-title, error-message-description, footer"
|
|
107
|
+
>
|
|
108
|
+
<div id="title" slot="form-title" part="form-title" role="heading" aria-level="${this.headingLevel + 1}">
|
|
109
|
+
${this.__effectiveI18n.form.title}
|
|
110
|
+
</div>
|
|
111
|
+
<slot name="form" slot="form"></slot>
|
|
112
|
+
<slot name="custom-form-area" slot="custom-form-area"></slot>
|
|
113
|
+
<slot name="submit" slot="submit"></slot>
|
|
114
|
+
<slot name="forgot-password" slot="forgot-password"></slot>
|
|
115
|
+
<slot name="footer" slot="footer"></slot>
|
|
116
|
+
</vaadin-login-form-wrapper>
|
|
82
117
|
</vaadin-login-overlay-wrapper>
|
|
83
|
-
|
|
84
|
-
<div hidden>
|
|
85
|
-
<slot name="custom-form-area"></slot>
|
|
86
|
-
<slot name="footer"></slot>
|
|
87
|
-
</div>
|
|
88
118
|
`;
|
|
89
119
|
}
|
|
90
120
|
|
|
91
|
-
|
|
92
|
-
|
|
121
|
+
/** @private */
|
|
122
|
+
_onOpenedChanged(event) {
|
|
123
|
+
this.opened = event.detail.value;
|
|
93
124
|
}
|
|
94
125
|
}
|
|
95
126
|
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
+
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
2
|
+
import '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
1
3
|
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
2
|
-
import
|
|
3
|
-
import { typography } from '@vaadin/vaadin-lumo-styles/typography.js';
|
|
4
|
+
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
4
5
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
5
6
|
|
|
6
7
|
const loginFormWrapper = css`
|
|
7
8
|
:host {
|
|
8
|
-
|
|
9
|
+
width: calc(var(--lumo-size-m) * 10);
|
|
10
|
+
padding: var(--lumo-space-l);
|
|
11
|
+
max-width: 100%;
|
|
9
12
|
background: var(--lumo-base-color) linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
|
|
10
13
|
}
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
::slotted(form) {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
14
18
|
}
|
|
15
19
|
|
|
16
|
-
[
|
|
20
|
+
::slotted([slot='form-title']) {
|
|
17
21
|
margin-top: calc(var(--lumo-font-size-xxxl) - var(--lumo-font-size-xxl));
|
|
18
22
|
color: var(--lumo-header-text-color);
|
|
19
23
|
font-size: var(--lumo-font-size-xxl);
|
|
@@ -89,6 +93,6 @@ const loginFormWrapper = css`
|
|
|
89
93
|
}
|
|
90
94
|
`;
|
|
91
95
|
|
|
92
|
-
registerStyles('vaadin-login-form-wrapper',
|
|
96
|
+
registerStyles('vaadin-login-form-wrapper', loginFormWrapper, {
|
|
93
97
|
moduleId: 'lumo-login-form-wrapper',
|
|
94
98
|
});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
1
2
|
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
2
|
-
import '
|
|
3
|
-
import { color } from '@vaadin/vaadin-lumo-styles/color.js';
|
|
3
|
+
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
4
4
|
import { overlay } from '@vaadin/vaadin-lumo-styles/mixins/overlay.js';
|
|
5
|
-
import { typography } from '@vaadin/vaadin-lumo-styles/typography.js';
|
|
6
5
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
7
6
|
|
|
8
7
|
const loginOverlayWrapper = css`
|
|
@@ -29,7 +28,7 @@ const loginOverlayWrapper = css`
|
|
|
29
28
|
min-height: calc(var(--lumo-size-m) * 5);
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
[
|
|
31
|
+
::slotted([slot='title']) {
|
|
33
32
|
font-size: var(--lumo-font-size-xxxl);
|
|
34
33
|
font-weight: 600;
|
|
35
34
|
line-height: var(--lumo-line-height-xs);
|
|
@@ -38,7 +37,7 @@ const loginOverlayWrapper = css`
|
|
|
38
37
|
[part='description'] {
|
|
39
38
|
line-height: var(--lumo-line-height-s);
|
|
40
39
|
color: var(--lumo-tint-70pct);
|
|
41
|
-
margin
|
|
40
|
+
margin: 0.5em 0 0;
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
[part='content'] {
|
|
@@ -58,6 +57,11 @@ const loginOverlayWrapper = css`
|
|
|
58
57
|
height: auto;
|
|
59
58
|
}
|
|
60
59
|
|
|
60
|
+
::slotted(vaadin-login-form-wrapper) {
|
|
61
|
+
min-height: 100%;
|
|
62
|
+
max-width: 100%;
|
|
63
|
+
}
|
|
64
|
+
|
|
61
65
|
/* Small screen */
|
|
62
66
|
@media only screen and (max-width: 500px) {
|
|
63
67
|
[part='overlay'],
|
|
@@ -95,7 +99,7 @@ const loginOverlayWrapper = css`
|
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
[part='brand'],
|
|
98
|
-
[part='form'] {
|
|
102
|
+
[part='form-wrapper'] {
|
|
99
103
|
flex: auto;
|
|
100
104
|
flex-basis: 0;
|
|
101
105
|
box-sizing: border-box;
|
|
@@ -105,10 +109,15 @@ const loginOverlayWrapper = css`
|
|
|
105
109
|
justify-content: flex-start;
|
|
106
110
|
}
|
|
107
111
|
|
|
108
|
-
[part='form'] {
|
|
112
|
+
[part='form-wrapper'] {
|
|
109
113
|
padding: var(--lumo-space-l);
|
|
110
114
|
overflow: auto;
|
|
111
115
|
}
|
|
116
|
+
|
|
117
|
+
::slotted(vaadin-login-form-wrapper) {
|
|
118
|
+
flex: 1;
|
|
119
|
+
padding: 2px;
|
|
120
|
+
}
|
|
112
121
|
}
|
|
113
122
|
|
|
114
123
|
/* Landscape really small screen */
|
|
@@ -128,10 +137,9 @@ const loginOverlayWrapper = css`
|
|
|
128
137
|
box-shadow: none;
|
|
129
138
|
}
|
|
130
139
|
|
|
131
|
-
[part='form'] {
|
|
140
|
+
[part='form-wrapper'] {
|
|
132
141
|
height: 100%;
|
|
133
142
|
overflow: auto;
|
|
134
|
-
-webkit-overflow-scrolling: touch;
|
|
135
143
|
}
|
|
136
144
|
}
|
|
137
145
|
|
|
@@ -160,29 +168,6 @@ const loginOverlayWrapper = css`
|
|
|
160
168
|
}
|
|
161
169
|
`;
|
|
162
170
|
|
|
163
|
-
registerStyles('vaadin-login-overlay-wrapper', [
|
|
171
|
+
registerStyles('vaadin-login-overlay-wrapper', [overlay, loginOverlayWrapper], {
|
|
164
172
|
moduleId: 'lumo-login-overlay-wrapper',
|
|
165
173
|
});
|
|
166
|
-
|
|
167
|
-
const loginFormWrapper = css`
|
|
168
|
-
:host([theme~='with-overlay']) {
|
|
169
|
-
min-height: 100%;
|
|
170
|
-
display: flex;
|
|
171
|
-
justify-content: center;
|
|
172
|
-
max-width: 100%;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/* Landscape small screen */
|
|
176
|
-
@media only screen and (max-height: 600px) and (min-width: 600px) and (orientation: landscape) {
|
|
177
|
-
:host([theme~='with-overlay']) [part='form'] {
|
|
178
|
-
height: 100%;
|
|
179
|
-
-webkit-overflow-scrolling: touch;
|
|
180
|
-
flex: 1;
|
|
181
|
-
padding: 2px;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
`;
|
|
185
|
-
|
|
186
|
-
registerStyles('vaadin-login-form-wrapper', [loginFormWrapper], {
|
|
187
|
-
moduleId: 'lumo-login-overlay',
|
|
188
|
-
});
|
|
@@ -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,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/login",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "25.0.0-alpha10",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-login-form",
|
|
11
|
-
"description": "`<vaadin-login-form>` is a Web Component providing an easy way to require users\nto log in into an application. Note that component has no shadowRoot.\n\n
|
|
11
|
+
"description": "`<vaadin-login-form>` is a Web Component providing an easy way to require users\nto log in into an application. Note that component has no shadowRoot.\n\n```html\n<vaadin-login-form></vaadin-login-form>\n```\n\nComponent has to be accessible from the `document` layer in order to allow password managers to work properly with form values.\nUsing `<vaadin-login-overlay>` allows to always attach the component to the document body.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------|---------------------------------------------------------|\n`form` | Container for the entire component's content\n`form-title` | Title of the login form\n`error-message`| Container for error message, contains error-message-title and error-message-description parts. Hidden by default.\n`error-message-title` | Container for error message title\n`error-message-description` | Container for error message description\n`footer` | Container additional information text from `i18n` object\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "action",
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
"name": "vaadin-login-overlay",
|
|
173
|
-
"description": "`<vaadin-login-overlay>` is a
|
|
173
|
+
"description": "`<vaadin-login-overlay>` is a web component which renders a login form in an overlay and\nprovides an additional `brand` part for application title and description.\n\n```html\n<vaadin-login-overlay opened></vaadin-login-overlay>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------------------|--------------------------------\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container element\n`content` | The overlay content element\n`card` | Container for the brand and form wrapper\n`brand` | Container for application title and description\n`description` | The application description\n`form-wrapper` | The login form wrapper element\n`form` | The login form element\n`form-title` | Title of the login form\n`error-message` | Container for error message\n`error-message-title` | Container for error message title\n`error-message-description` | Container for error message description\n`footer` | Container for the footer element\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
174
174
|
"attributes": [
|
|
175
175
|
{
|
|
176
176
|
"name": "action",
|
|
@@ -395,6 +395,10 @@
|
|
|
395
395
|
"name": "login",
|
|
396
396
|
"description": "Fired when an user submits the login.\nThe event contains `username` and `password` values in the `detail` property."
|
|
397
397
|
},
|
|
398
|
+
{
|
|
399
|
+
"name": "closed",
|
|
400
|
+
"description": "Fired when the overlay is closed."
|
|
401
|
+
},
|
|
398
402
|
{
|
|
399
403
|
"name": "disabled-changed",
|
|
400
404
|
"description": "Fired when the `disabled` property changes."
|
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-alpha10",
|
|
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-login-form",
|
|
19
|
-
"description": "`<vaadin-login-form>` is a Web Component providing an easy way to require users\nto log in into an application. Note that component has no shadowRoot.\n\n
|
|
19
|
+
"description": "`<vaadin-login-form>` is a Web Component providing an easy way to require users\nto log in into an application. Note that component has no shadowRoot.\n\n```html\n<vaadin-login-form></vaadin-login-form>\n```\n\nComponent has to be accessible from the `document` layer in order to allow password managers to work properly with form values.\nUsing `<vaadin-login-overlay>` allows to always attach the component to the document body.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------|---------------------------------------------------------|\n`form` | Container for the entire component's content\n`form-title` | Title of the login form\n`error-message`| Container for error message, contains error-message-title and error-message-description parts. Hidden by default.\n`error-message-title` | Container for error message title\n`error-message-description` | Container for error message description\n`footer` | Container additional information text from `i18n` object\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"name": "vaadin-login-overlay",
|
|
103
|
-
"description": "`<vaadin-login-overlay>` is a
|
|
103
|
+
"description": "`<vaadin-login-overlay>` is a web component which renders a login form in an overlay and\nprovides an additional `brand` part for application title and description.\n\n```html\n<vaadin-login-overlay opened></vaadin-login-overlay>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------------------|--------------------------------\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container element\n`content` | The overlay content element\n`card` | Container for the brand and form wrapper\n`brand` | Container for application title and description\n`description` | The application description\n`form-wrapper` | The login form wrapper element\n`form` | The login form element\n`form-title` | Title of the login form\n`error-message` | Container for error message\n`error-message-title` | Container for error message title\n`error-message-description` | Container for error message description\n`footer` | Container for the footer element\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
104
104
|
"extension": true,
|
|
105
105
|
"attributes": [
|
|
106
106
|
{
|
|
@@ -194,6 +194,13 @@
|
|
|
194
194
|
"kind": "expression"
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
|
+
{
|
|
198
|
+
"name": "@closed",
|
|
199
|
+
"description": "Fired when the overlay is closed.",
|
|
200
|
+
"value": {
|
|
201
|
+
"kind": "expression"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
197
204
|
{
|
|
198
205
|
"name": "@disabled-changed",
|
|
199
206
|
"description": "Fired when the `disabled` property changes.",
|
|
@@ -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 };
|
|
@@ -1,112 +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 '@vaadin/button/src/vaadin-lit-button.js';
|
|
7
|
-
import '@vaadin/text-field/src/vaadin-lit-text-field.js';
|
|
8
|
-
import '@vaadin/password-field/src/vaadin-lit-password-field.js';
|
|
9
|
-
import './vaadin-lit-login-form-wrapper.js';
|
|
10
|
-
import { html, LitElement } from 'lit';
|
|
11
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
12
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
13
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
14
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
15
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
16
|
-
import { LoginFormMixin } from './vaadin-login-form-mixin.js';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* LitElement based version of `<vaadin-login-form>` web component.
|
|
20
|
-
*
|
|
21
|
-
* ## Disclaimer
|
|
22
|
-
*
|
|
23
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
24
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
25
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
26
|
-
*/
|
|
27
|
-
class LoginForm extends LoginFormMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
28
|
-
static get is() {
|
|
29
|
-
return 'vaadin-login-form';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @protected
|
|
34
|
-
* @override
|
|
35
|
-
*/
|
|
36
|
-
createRenderRoot() {
|
|
37
|
-
return this;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** @protected */
|
|
41
|
-
render() {
|
|
42
|
-
return html`
|
|
43
|
-
<style>
|
|
44
|
-
vaadin-login-form-wrapper > form > * {
|
|
45
|
-
width: 100%;
|
|
46
|
-
}
|
|
47
|
-
</style>
|
|
48
|
-
<vaadin-login-form-wrapper
|
|
49
|
-
id="vaadinLoginFormWrapper"
|
|
50
|
-
theme="${ifDefined(this._theme)}"
|
|
51
|
-
.error="${this.error}"
|
|
52
|
-
.i18n="${this.__effectiveI18n}"
|
|
53
|
-
.headingLevel="${this.headingLevel}"
|
|
54
|
-
>
|
|
55
|
-
<form method="POST" action="${ifDefined(this.action)}" @formdata="${this._onFormData}" slot="form">
|
|
56
|
-
<input id="csrf" type="hidden" />
|
|
57
|
-
<vaadin-text-field
|
|
58
|
-
name="username"
|
|
59
|
-
.label="${this.__effectiveI18n.form.username}"
|
|
60
|
-
.errorMessage="${this.__effectiveI18n.errorMessage.username}"
|
|
61
|
-
id="vaadinLoginUsername"
|
|
62
|
-
required
|
|
63
|
-
@keydown="${this._handleInputKeydown}"
|
|
64
|
-
autocapitalize="none"
|
|
65
|
-
autocorrect="off"
|
|
66
|
-
spellcheck="false"
|
|
67
|
-
autocomplete="username"
|
|
68
|
-
manual-validation
|
|
69
|
-
>
|
|
70
|
-
<input type="text" slot="input" @keyup="${this._handleInputKeyup}" />
|
|
71
|
-
</vaadin-text-field>
|
|
72
|
-
|
|
73
|
-
<vaadin-password-field
|
|
74
|
-
name="password"
|
|
75
|
-
.label="${this.__effectiveI18n.form.password}"
|
|
76
|
-
.errorMessage="${this.__effectiveI18n.errorMessage.password}"
|
|
77
|
-
id="vaadinLoginPassword"
|
|
78
|
-
required
|
|
79
|
-
@keydown="${this._handleInputKeydown}"
|
|
80
|
-
spellcheck="false"
|
|
81
|
-
autocomplete="current-password"
|
|
82
|
-
manual-validation
|
|
83
|
-
>
|
|
84
|
-
<input type="password" slot="input" @keyup="${this._handleInputKeyup}" />
|
|
85
|
-
</vaadin-password-field>
|
|
86
|
-
</form>
|
|
87
|
-
|
|
88
|
-
<vaadin-button
|
|
89
|
-
slot="submit"
|
|
90
|
-
theme="primary contained submit"
|
|
91
|
-
@click="${this.submit}"
|
|
92
|
-
.disabled="${this.disabled}"
|
|
93
|
-
>
|
|
94
|
-
${this.__effectiveI18n.form.submit}
|
|
95
|
-
</vaadin-button>
|
|
96
|
-
|
|
97
|
-
<vaadin-button
|
|
98
|
-
slot="forgot-password"
|
|
99
|
-
theme="tertiary small"
|
|
100
|
-
@click="${this._onForgotPasswordClick}"
|
|
101
|
-
?hidden="${this.noForgotPassword}"
|
|
102
|
-
>
|
|
103
|
-
${this.__effectiveI18n.form.forgotPassword}
|
|
104
|
-
</vaadin-button>
|
|
105
|
-
</vaadin-login-form-wrapper>
|
|
106
|
-
`;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
defineCustomElement(LoginForm);
|
|
111
|
-
|
|
112
|
-
export { LoginForm };
|