@vaadin/login 25.0.0-alpha8 → 25.0.0-alpha9
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 +13 -12
- package/src/styles/vaadin-login-form-wrapper-base-styles.js +7 -12
- package/src/styles/vaadin-login-form-wrapper-core-styles.js +4 -9
- package/src/styles/vaadin-login-overlay-wrapper-base-styles.js +1 -5
- package/src/styles/vaadin-login-overlay-wrapper-core-styles.js +1 -1
- 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 +13 -22
- package/src/vaadin-login-form.d.ts +1 -4
- package/src/vaadin-login-form.js +26 -58
- package/src/vaadin-login-overlay-mixin.d.ts +1 -2
- package/src/vaadin-login-overlay-mixin.js +50 -88
- package/src/vaadin-login-overlay-wrapper.js +26 -9
- package/src/vaadin-login-overlay.d.ts +20 -18
- package/src/vaadin-login-overlay.js +58 -44
- package/theme/lumo/vaadin-login-form-wrapper-styles.js +2 -5
- package/theme/lumo/vaadin-login-overlay-styles.js +14 -26
- package/web-types.json +3 -3
- package/web-types.lit.json +3 -3
- package/src/vaadin-login-overlay-wrapper-mixin.js +0 -78
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
|
|
7
|
-
import {
|
|
7
|
+
import { TitleController } from './title-controller.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @polymerMixin
|
|
11
|
-
* @mixes LoginMixin
|
|
12
11
|
* @mixes OverlayClassMixin
|
|
13
12
|
*/
|
|
14
13
|
export const LoginOverlayMixin = (superClass) =>
|
|
15
|
-
class LoginOverlayMixin extends OverlayClassMixin(
|
|
14
|
+
class LoginOverlayMixin extends OverlayClassMixin(superClass) {
|
|
16
15
|
static get properties() {
|
|
17
16
|
return {
|
|
18
17
|
/**
|
|
@@ -32,8 +31,8 @@ export const LoginOverlayMixin = (superClass) =>
|
|
|
32
31
|
opened: {
|
|
33
32
|
type: Boolean,
|
|
34
33
|
value: false,
|
|
34
|
+
reflectToAttribute: true,
|
|
35
35
|
sync: true,
|
|
36
|
-
observer: '_onOpenedChange',
|
|
37
36
|
},
|
|
38
37
|
|
|
39
38
|
/**
|
|
@@ -47,15 +46,43 @@ export const LoginOverlayMixin = (superClass) =>
|
|
|
47
46
|
};
|
|
48
47
|
}
|
|
49
48
|
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
/** @protected */
|
|
50
|
+
firstUpdated() {
|
|
51
|
+
super.firstUpdated();
|
|
52
|
+
|
|
53
|
+
this.setAttribute('role', 'dialog');
|
|
54
|
+
|
|
55
|
+
this.__titleController = new TitleController(this);
|
|
56
|
+
this.addController(this.__titleController);
|
|
57
|
+
|
|
58
|
+
this._overlayElement = this.$.overlay;
|
|
52
59
|
}
|
|
53
60
|
|
|
54
61
|
/** @protected */
|
|
55
|
-
|
|
56
|
-
super.
|
|
62
|
+
willUpdate(props) {
|
|
63
|
+
super.willUpdate(props);
|
|
57
64
|
|
|
58
|
-
|
|
65
|
+
if (props.has('__effectiveI18n') && this.__effectiveI18n.header) {
|
|
66
|
+
this.title = this.__effectiveI18n.header.title;
|
|
67
|
+
this.description = this.__effectiveI18n.header.description;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** @protected */
|
|
72
|
+
updated(props) {
|
|
73
|
+
super.updated(props);
|
|
74
|
+
|
|
75
|
+
if (props.has('title') || props.has('__effectiveI18n')) {
|
|
76
|
+
this.__titleController.setTitle(this.title);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (props.has('headingLevel')) {
|
|
80
|
+
this.__titleController.setLevel(this.headingLevel);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (props.has('opened')) {
|
|
84
|
+
this._openedChanged(this.opened);
|
|
85
|
+
}
|
|
59
86
|
}
|
|
60
87
|
|
|
61
88
|
/** @protected */
|
|
@@ -72,19 +99,14 @@ export const LoginOverlayMixin = (superClass) =>
|
|
|
72
99
|
disconnectedCallback() {
|
|
73
100
|
super.disconnectedCallback();
|
|
74
101
|
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (!header) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
this.title = header.title;
|
|
87
|
-
this.description = header.description;
|
|
102
|
+
// Using a timeout to avoid toggling opened state
|
|
103
|
+
// when just moving the overlay in the DOM
|
|
104
|
+
setTimeout(() => {
|
|
105
|
+
if (!this.isConnected) {
|
|
106
|
+
this.__restoreOpened = this.opened;
|
|
107
|
+
this.opened = false;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
88
110
|
}
|
|
89
111
|
|
|
90
112
|
/** @protected */
|
|
@@ -92,77 +114,17 @@ export const LoginOverlayMixin = (superClass) =>
|
|
|
92
114
|
e.preventDefault();
|
|
93
115
|
}
|
|
94
116
|
|
|
95
|
-
/**
|
|
96
|
-
* @param {!Event} e
|
|
97
|
-
* @protected
|
|
98
|
-
*/
|
|
99
|
-
_retargetEvent(e) {
|
|
100
|
-
e.stopPropagation();
|
|
101
|
-
const { detail, composed, cancelable, bubbles } = e;
|
|
102
|
-
|
|
103
|
-
const firedEvent = this.dispatchEvent(new CustomEvent(e.type, { bubbles, cancelable, composed, detail }));
|
|
104
|
-
// Check if `eventTarget.preventDefault()` was called to prevent default in the original event
|
|
105
|
-
if (!firedEvent) {
|
|
106
|
-
e.preventDefault();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
117
|
/** @private */
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
form.$.vaadinLoginUsername.value = '';
|
|
116
|
-
form.$.vaadinLoginPassword.value = '';
|
|
118
|
+
_openedChanged(opened, oldOpened) {
|
|
119
|
+
if (oldOpened) {
|
|
120
|
+
this._userNameField.value = '';
|
|
121
|
+
this._passwordField.value = '';
|
|
117
122
|
this.disabled = false;
|
|
118
|
-
|
|
119
|
-
if (this._undoTitleTeleport) {
|
|
120
|
-
this._undoTitleTeleport();
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (this._undoFieldsTeleport) {
|
|
124
|
-
this._undoFieldsTeleport();
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
if (this._undoFooterTeleport) {
|
|
128
|
-
this._undoFooterTeleport();
|
|
129
|
-
}
|
|
130
|
-
} else {
|
|
131
|
-
this._undoTitleTeleport = this._teleport('title', this.$.vaadinLoginOverlayWrapper);
|
|
132
|
-
|
|
133
|
-
this._undoFieldsTeleport = this._teleport(
|
|
134
|
-
'custom-form-area',
|
|
135
|
-
form.$.vaadinLoginFormWrapper,
|
|
136
|
-
form.querySelector('vaadin-button'),
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
this._undoFooterTeleport = this._teleport('footer', form.$.vaadinLoginFormWrapper);
|
|
140
|
-
|
|
123
|
+
} else if (opened) {
|
|
141
124
|
// Overlay sets pointerEvents on body to `none`, which breaks LastPass popup
|
|
142
125
|
// Reverting it back to the previous state
|
|
143
126
|
// https://github.com/vaadin/vaadin-overlay/blob/041cde4481b6262eac68d3a699f700216d897373/src/vaadin-overlay.html#L660
|
|
144
|
-
document.body.style.pointerEvents = this.$.
|
|
127
|
+
document.body.style.pointerEvents = this.$.overlay._previousDocumentPointerEvents;
|
|
145
128
|
}
|
|
146
129
|
}
|
|
147
|
-
|
|
148
|
-
/** @private */
|
|
149
|
-
_teleport(slot, target, refNode) {
|
|
150
|
-
const teleported = [...this.querySelectorAll(`[slot="${slot}"]`)].map((el) => {
|
|
151
|
-
if (refNode) {
|
|
152
|
-
target.insertBefore(el, refNode);
|
|
153
|
-
} else {
|
|
154
|
-
target.appendChild(el);
|
|
155
|
-
}
|
|
156
|
-
return el;
|
|
157
|
-
});
|
|
158
|
-
// Function to undo the teleport
|
|
159
|
-
return () => {
|
|
160
|
-
this.append(...teleported);
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/** @private */
|
|
165
|
-
__computeHeadingLevel(headingLevel) {
|
|
166
|
-
return headingLevel + 1;
|
|
167
|
-
}
|
|
168
130
|
};
|
|
@@ -5,23 +5,23 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { html, LitElement } from 'lit';
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
8
9
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
+
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
9
11
|
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
10
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
13
|
import { loginOverlayWrapperStyles } from './styles/vaadin-login-overlay-wrapper-core-styles.js';
|
|
12
|
-
import { LoginOverlayWrapperMixin } from './vaadin-login-overlay-wrapper-mixin.js';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* An element used internally by `<vaadin-login-overlay>`. Not intended to be used separately.
|
|
16
17
|
*
|
|
17
18
|
* @extends HTMLElement
|
|
18
|
-
* @mixes
|
|
19
|
+
* @mixes DirMixin
|
|
20
|
+
* @mixes OverlayMixin
|
|
19
21
|
* @mixes ThemableMixin
|
|
20
22
|
* @private
|
|
21
23
|
*/
|
|
22
|
-
class LoginOverlayWrapper extends
|
|
23
|
-
ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))),
|
|
24
|
-
) {
|
|
24
|
+
class LoginOverlayWrapper extends OverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
25
25
|
static get is() {
|
|
26
26
|
return 'vaadin-login-overlay-wrapper';
|
|
27
27
|
}
|
|
@@ -30,6 +30,25 @@ class LoginOverlayWrapper extends LoginOverlayWrapperMixin(
|
|
|
30
30
|
return loginOverlayWrapperStyles;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
static get properties() {
|
|
34
|
+
return {
|
|
35
|
+
/**
|
|
36
|
+
* Application description. Displayed under the title.
|
|
37
|
+
*/
|
|
38
|
+
description: {
|
|
39
|
+
type: String,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @protected
|
|
46
|
+
* @override
|
|
47
|
+
*/
|
|
48
|
+
get _modalRoot() {
|
|
49
|
+
return this.owner;
|
|
50
|
+
}
|
|
51
|
+
|
|
33
52
|
/** @protected */
|
|
34
53
|
render() {
|
|
35
54
|
return html`
|
|
@@ -38,12 +57,10 @@ class LoginOverlayWrapper extends LoginOverlayWrapperMixin(
|
|
|
38
57
|
<div part="content" id="content">
|
|
39
58
|
<section part="card">
|
|
40
59
|
<div part="brand">
|
|
41
|
-
<slot name="title">
|
|
42
|
-
<div part="title" role="heading" aria-level="${this.headingLevel}">${this.title}</div>
|
|
43
|
-
</slot>
|
|
60
|
+
<slot name="title"></slot>
|
|
44
61
|
<div part="description">${this.description}</div>
|
|
45
62
|
</div>
|
|
46
|
-
<div part="form">
|
|
63
|
+
<div part="form-wrapper">
|
|
47
64
|
<slot></slot>
|
|
48
65
|
</div>
|
|
49
66
|
</section>
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
7
7
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
|
+
import { LoginFormMixin } from './vaadin-login-form-mixin.js';
|
|
8
9
|
import { LoginOverlayMixin } from './vaadin-login-overlay-mixin.js';
|
|
9
10
|
|
|
10
11
|
export { LoginI18n } from './vaadin-login-mixin.js';
|
|
@@ -48,9 +49,8 @@ export interface LoginOverlayCustomEventMap {
|
|
|
48
49
|
export interface LoginOverlayEventMap extends HTMLElementEventMap, LoginOverlayCustomEventMap {}
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
|
-
* `<vaadin-login-overlay>` is a
|
|
52
|
-
*
|
|
53
|
-
* password managers to work with login form.
|
|
52
|
+
* `<vaadin-login-overlay>` is a web component which renders a login form in an overlay and
|
|
53
|
+
* provides an additional `brand` part for application title and description.
|
|
54
54
|
*
|
|
55
55
|
* ```html
|
|
56
56
|
* <vaadin-login-overlay opened></vaadin-login-overlay>
|
|
@@ -58,21 +58,23 @@ export interface LoginOverlayEventMap extends HTMLElementEventMap, LoginOverlayC
|
|
|
58
58
|
*
|
|
59
59
|
* ### Styling
|
|
60
60
|
*
|
|
61
|
-
* The
|
|
62
|
-
* Use `<vaadin-login-overlay-wrapper>` and `<vaadin-login-form-wrapper>` to apply styles.
|
|
61
|
+
* The following shadow DOM parts are available for styling:
|
|
63
62
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* `
|
|
69
|
-
* `
|
|
70
|
-
* `
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
63
|
+
* Part name | Description
|
|
64
|
+
* -----------------------------|--------------------------------
|
|
65
|
+
* `backdrop` | Backdrop of the overlay
|
|
66
|
+
* `overlay` | The overlay container element
|
|
67
|
+
* `content` | The overlay content element
|
|
68
|
+
* `card` | Container for the brand and form wrapper
|
|
69
|
+
* `brand` | Container for application title and description
|
|
70
|
+
* `description` | The application description
|
|
71
|
+
* `form-wrapper` | The login form wrapper element
|
|
72
|
+
* `form` | The login form element
|
|
73
|
+
* `form-title` | Title of the login form
|
|
74
|
+
* `error-message` | Container for error message
|
|
75
|
+
* `error-message-title` | Container for error message title
|
|
76
|
+
* `error-message-description` | Container for error message description
|
|
77
|
+
* `footer` | Container for the footer element
|
|
76
78
|
*
|
|
77
79
|
* @fires {CustomEvent} description-changed - Fired when the `description` property changes.
|
|
78
80
|
* @fires {CustomEvent} disabled-changed - Fired when the `disabled` property changes.
|
|
@@ -80,7 +82,7 @@ export interface LoginOverlayEventMap extends HTMLElementEventMap, LoginOverlayC
|
|
|
80
82
|
* @fires {CustomEvent} forgot-password - Fired when user clicks on the "Forgot password" button.
|
|
81
83
|
* @fires {CustomEvent} login - Fired when a user submits the login.
|
|
82
84
|
*/
|
|
83
|
-
declare class LoginOverlay extends LoginOverlayMixin(ElementMixin(ThemableMixin(HTMLElement))) {
|
|
85
|
+
declare class LoginOverlay extends LoginFormMixin(LoginOverlayMixin(ElementMixin(ThemableMixin(HTMLElement)))) {
|
|
84
86
|
addEventListener<K extends keyof LoginOverlayEventMap>(
|
|
85
87
|
type: K,
|
|
86
88
|
listener: (this: LoginOverlay, ev: LoginOverlayEventMap[K]) => void,
|
|
@@ -3,20 +3,23 @@
|
|
|
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, LitElement } from 'lit';
|
|
11
|
+
import { css, html, LitElement } from 'lit';
|
|
9
12
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
10
13
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
11
14
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
12
15
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
13
16
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
17
|
+
import { LoginFormMixin } from './vaadin-login-form-mixin.js';
|
|
14
18
|
import { LoginOverlayMixin } from './vaadin-login-overlay-mixin.js';
|
|
15
19
|
|
|
16
20
|
/**
|
|
17
|
-
* `<vaadin-login-overlay>` is a
|
|
18
|
-
*
|
|
19
|
-
* 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.
|
|
20
23
|
*
|
|
21
24
|
* ```html
|
|
22
25
|
* <vaadin-login-overlay opened></vaadin-login-overlay>
|
|
@@ -24,22 +27,26 @@ import { LoginOverlayMixin } from './vaadin-login-overlay-mixin.js';
|
|
|
24
27
|
*
|
|
25
28
|
* ### Styling
|
|
26
29
|
*
|
|
27
|
-
* The
|
|
28
|
-
* Use `<vaadin-login-overlay-wrapper>` and `<vaadin-login-form-wrapper>` to apply styles.
|
|
30
|
+
* The following shadow DOM parts are available for styling:
|
|
29
31
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* `
|
|
35
|
-
* `
|
|
36
|
-
* `
|
|
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
|
|
37
47
|
*
|
|
38
48
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
39
49
|
*
|
|
40
|
-
* See [`<vaadin-login-form>`](#/elements/vaadin-login-form)
|
|
41
|
-
* documentation for `<vaadin-login-form-wrapper>` stylable parts.
|
|
42
|
-
*
|
|
43
50
|
* @fires {CustomEvent} description-changed - Fired when the `description` property changes.
|
|
44
51
|
* @fires {CustomEvent} disabled-changed - Fired when the `disabled` property changes.
|
|
45
52
|
* @fires {CustomEvent} error-changed - Fired when the `error` property changes.
|
|
@@ -50,50 +57,62 @@ import { LoginOverlayMixin } from './vaadin-login-overlay-mixin.js';
|
|
|
50
57
|
* @extends HTMLElement
|
|
51
58
|
* @mixes ElementMixin
|
|
52
59
|
* @mixes ThemableMixin
|
|
60
|
+
* @mixes LoginFormMixin
|
|
53
61
|
* @mixes LoginOverlayMixin
|
|
54
62
|
*/
|
|
55
|
-
class LoginOverlay extends LoginOverlayMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
63
|
+
class LoginOverlay extends LoginFormMixin(LoginOverlayMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement))))) {
|
|
56
64
|
static get is() {
|
|
57
65
|
return 'vaadin-login-overlay';
|
|
58
66
|
}
|
|
59
67
|
|
|
68
|
+
static get styles() {
|
|
69
|
+
return css`
|
|
70
|
+
:host {
|
|
71
|
+
display: block;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:host([hidden]) {
|
|
75
|
+
display: none !important;
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
78
|
+
}
|
|
79
|
+
|
|
60
80
|
/** @protected */
|
|
61
81
|
render() {
|
|
62
82
|
return html`
|
|
63
83
|
<vaadin-login-overlay-wrapper
|
|
64
|
-
id="
|
|
84
|
+
id="overlay"
|
|
85
|
+
.owner="${this}"
|
|
65
86
|
.opened="${this.opened}"
|
|
66
|
-
.title="${this.title}"
|
|
67
87
|
.description="${this.description}"
|
|
68
|
-
.headingLevel="${this.headingLevel}"
|
|
69
|
-
role="dialog"
|
|
70
88
|
focus-trap
|
|
71
89
|
with-backdrop
|
|
72
90
|
theme="${ifDefined(this._theme)}"
|
|
73
91
|
@vaadin-overlay-escape-press="${this._preventClosingLogin}"
|
|
74
92
|
@vaadin-overlay-outside-click="${this._preventClosingLogin}"
|
|
75
93
|
@opened-changed="${this._onOpenedChanged}"
|
|
94
|
+
exportparts="backdrop, overlay, content, card, brand, description, form-wrapper"
|
|
76
95
|
>
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
id="
|
|
80
|
-
.action="${this.action}"
|
|
81
|
-
.disabled="${this.disabled}"
|
|
96
|
+
<slot name="title" slot="title"></slot>
|
|
97
|
+
<vaadin-login-form-wrapper
|
|
98
|
+
id="form"
|
|
82
99
|
.error="${this.error}"
|
|
83
|
-
.noAutofocus="${this.noAutofocus}"
|
|
84
|
-
.noForgotPassword="${this.noForgotPassword}"
|
|
85
|
-
.headingLevel="${this.__computeHeadingLevel(this.headingLevel)}"
|
|
86
100
|
.i18n="${this.__effectiveI18n}"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
101
|
+
part="form"
|
|
102
|
+
role="region"
|
|
103
|
+
aria-labelledby="title"
|
|
104
|
+
exportparts="error-message, error-message-title, error-message-description, footer"
|
|
105
|
+
>
|
|
106
|
+
<div id="title" slot="form-title" part="form-title" role="heading" aria-level="${this.headingLevel + 1}">
|
|
107
|
+
${this.__effectiveI18n.form.title}
|
|
108
|
+
</div>
|
|
109
|
+
<slot name="form" slot="form"></slot>
|
|
110
|
+
<slot name="custom-form-area" slot="custom-form-area"></slot>
|
|
111
|
+
<slot name="submit" slot="submit"></slot>
|
|
112
|
+
<slot name="forgot-password" slot="forgot-password"></slot>
|
|
113
|
+
<slot name="footer" slot="footer"></slot>
|
|
114
|
+
</vaadin-login-form-wrapper>
|
|
91
115
|
</vaadin-login-overlay-wrapper>
|
|
92
|
-
|
|
93
|
-
<div hidden>
|
|
94
|
-
<slot name="custom-form-area"></slot>
|
|
95
|
-
<slot name="footer"></slot>
|
|
96
|
-
</div>
|
|
97
116
|
`;
|
|
98
117
|
}
|
|
99
118
|
|
|
@@ -101,11 +120,6 @@ class LoginOverlay extends LoginOverlayMixin(ElementMixin(ThemableMixin(PolylitM
|
|
|
101
120
|
_onOpenedChanged(event) {
|
|
102
121
|
this.opened = event.detail.value;
|
|
103
122
|
}
|
|
104
|
-
|
|
105
|
-
/** @private */
|
|
106
|
-
_onDisabledChanged(event) {
|
|
107
|
-
this.disabled = event.detail.value;
|
|
108
|
-
}
|
|
109
123
|
}
|
|
110
124
|
|
|
111
125
|
defineCustomElement(LoginOverlay);
|
|
@@ -7,20 +7,17 @@ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themab
|
|
|
7
7
|
const loginFormWrapper = css`
|
|
8
8
|
:host {
|
|
9
9
|
width: calc(var(--lumo-size-m) * 10);
|
|
10
|
+
padding: var(--lumo-space-l);
|
|
10
11
|
max-width: 100%;
|
|
11
12
|
background: var(--lumo-base-color) linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
[part='form'] {
|
|
15
|
-
padding: var(--lumo-space-l);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
15
|
::slotted(form) {
|
|
19
16
|
display: flex;
|
|
20
17
|
flex-direction: column;
|
|
21
18
|
}
|
|
22
19
|
|
|
23
|
-
[
|
|
20
|
+
::slotted([slot='form-title']) {
|
|
24
21
|
margin-top: calc(var(--lumo-font-size-xxxl) - var(--lumo-font-size-xxl));
|
|
25
22
|
color: var(--lumo-header-text-color);
|
|
26
23
|
font-size: var(--lumo-font-size-xxl);
|
|
@@ -28,7 +28,7 @@ const loginOverlayWrapper = css`
|
|
|
28
28
|
min-height: calc(var(--lumo-size-m) * 5);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
[
|
|
31
|
+
::slotted([slot='title']) {
|
|
32
32
|
font-size: var(--lumo-font-size-xxxl);
|
|
33
33
|
font-weight: 600;
|
|
34
34
|
line-height: var(--lumo-line-height-xs);
|
|
@@ -57,6 +57,11 @@ const loginOverlayWrapper = css`
|
|
|
57
57
|
height: auto;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
::slotted(vaadin-login-form-wrapper) {
|
|
61
|
+
min-height: 100%;
|
|
62
|
+
max-width: 100%;
|
|
63
|
+
}
|
|
64
|
+
|
|
60
65
|
/* Small screen */
|
|
61
66
|
@media only screen and (max-width: 500px) {
|
|
62
67
|
[part='overlay'],
|
|
@@ -94,7 +99,7 @@ const loginOverlayWrapper = css`
|
|
|
94
99
|
}
|
|
95
100
|
|
|
96
101
|
[part='brand'],
|
|
97
|
-
[part='form'] {
|
|
102
|
+
[part='form-wrapper'] {
|
|
98
103
|
flex: auto;
|
|
99
104
|
flex-basis: 0;
|
|
100
105
|
box-sizing: border-box;
|
|
@@ -104,10 +109,15 @@ const loginOverlayWrapper = css`
|
|
|
104
109
|
justify-content: flex-start;
|
|
105
110
|
}
|
|
106
111
|
|
|
107
|
-
[part='form'] {
|
|
112
|
+
[part='form-wrapper'] {
|
|
108
113
|
padding: var(--lumo-space-l);
|
|
109
114
|
overflow: auto;
|
|
110
115
|
}
|
|
116
|
+
|
|
117
|
+
::slotted(vaadin-login-form-wrapper) {
|
|
118
|
+
flex: 1;
|
|
119
|
+
padding: 2px;
|
|
120
|
+
}
|
|
111
121
|
}
|
|
112
122
|
|
|
113
123
|
/* Landscape really small screen */
|
|
@@ -127,7 +137,7 @@ const loginOverlayWrapper = css`
|
|
|
127
137
|
box-shadow: none;
|
|
128
138
|
}
|
|
129
139
|
|
|
130
|
-
[part='form'] {
|
|
140
|
+
[part='form-wrapper'] {
|
|
131
141
|
height: 100%;
|
|
132
142
|
overflow: auto;
|
|
133
143
|
}
|
|
@@ -161,25 +171,3 @@ const loginOverlayWrapper = css`
|
|
|
161
171
|
registerStyles('vaadin-login-overlay-wrapper', [overlay, loginOverlayWrapper], {
|
|
162
172
|
moduleId: 'lumo-login-overlay-wrapper',
|
|
163
173
|
});
|
|
164
|
-
|
|
165
|
-
const loginFormWrapper = css`
|
|
166
|
-
:host([theme~='with-overlay']) {
|
|
167
|
-
min-height: 100%;
|
|
168
|
-
display: flex;
|
|
169
|
-
justify-content: center;
|
|
170
|
-
max-width: 100%;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/* Landscape small screen */
|
|
174
|
-
@media only screen and (max-height: 600px) and (min-width: 600px) and (orientation: landscape) {
|
|
175
|
-
:host([theme~='with-overlay']) [part='form'] {
|
|
176
|
-
height: 100%;
|
|
177
|
-
flex: 1;
|
|
178
|
-
padding: 2px;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
`;
|
|
182
|
-
|
|
183
|
-
registerStyles('vaadin-login-form-wrapper', [loginFormWrapper], {
|
|
184
|
-
moduleId: 'lumo-login-overlay',
|
|
185
|
-
});
|
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": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha9",
|
|
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```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
|
|
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",
|