@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
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": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha9",
|
|
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```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
|
|
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
|
{
|
|
@@ -1,78 +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 { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
7
|
-
import { SlotObserver } from '@vaadin/component-base/src/slot-observer.js';
|
|
8
|
-
import { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
|
|
9
|
-
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @polymerMixin
|
|
13
|
-
* @mixes DirMixin
|
|
14
|
-
* @mixes OverlayMixin
|
|
15
|
-
*/
|
|
16
|
-
export const LoginOverlayWrapperMixin = (superClass) =>
|
|
17
|
-
class LoginOverlayWrapperMixin extends OverlayMixin(DirMixin(superClass)) {
|
|
18
|
-
static get properties() {
|
|
19
|
-
return {
|
|
20
|
-
/**
|
|
21
|
-
* Title of the application.
|
|
22
|
-
*/
|
|
23
|
-
title: {
|
|
24
|
-
type: String,
|
|
25
|
-
observer: '_titleChanged',
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Application description. Displayed under the title.
|
|
30
|
-
*/
|
|
31
|
-
description: {
|
|
32
|
-
type: String,
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Used to customize the `aria-level` attribute on the heading element.
|
|
37
|
-
*/
|
|
38
|
-
headingLevel: {
|
|
39
|
-
type: Number,
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** @protected */
|
|
45
|
-
ready() {
|
|
46
|
-
super.ready();
|
|
47
|
-
|
|
48
|
-
// Use slot observer instead of slot controller since the latter
|
|
49
|
-
// does not work well with teleporting (it removes custom title).
|
|
50
|
-
const slot = this.shadowRoot.querySelector('slot[name="title"]');
|
|
51
|
-
this._titleSlotObserver = new SlotObserver(slot, () => {
|
|
52
|
-
const title = slot.assignedElements({ flatten: true })[0];
|
|
53
|
-
if (!title) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Only set ID on the custom slotted title and link it using
|
|
58
|
-
// aria-labelledby as the default title is in the shadow DOM.
|
|
59
|
-
if (title.getAttribute('part') === 'title') {
|
|
60
|
-
this.setAttribute('aria-label', this.title);
|
|
61
|
-
this.removeAttribute('aria-labelledby');
|
|
62
|
-
} else {
|
|
63
|
-
if (!title.id) {
|
|
64
|
-
title.id = `login-overlay-title-${generateUniqueId()}`;
|
|
65
|
-
}
|
|
66
|
-
this.removeAttribute('aria-label');
|
|
67
|
-
this.setAttribute('aria-labelledby', title.id);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/** @private */
|
|
73
|
-
_titleChanged(title) {
|
|
74
|
-
if (title && this.hasAttribute('aria-label')) {
|
|
75
|
-
this.setAttribute('aria-label', title);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
};
|