@vaadin/login 25.4.0-alpha4 → 25.4.0-alpha6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/login",
3
- "version": "25.4.0-alpha4",
3
+ "version": "25.4.0-alpha6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,22 +35,22 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/button": "25.4.0-alpha4",
39
- "@vaadin/component-base": "25.4.0-alpha4",
40
- "@vaadin/overlay": "25.4.0-alpha4",
41
- "@vaadin/password-field": "25.4.0-alpha4",
42
- "@vaadin/text-field": "25.4.0-alpha4",
43
- "@vaadin/vaadin-themable-mixin": "25.4.0-alpha4",
38
+ "@vaadin/button": "25.4.0-alpha6",
39
+ "@vaadin/component-base": "25.4.0-alpha6",
40
+ "@vaadin/overlay": "25.4.0-alpha6",
41
+ "@vaadin/password-field": "25.4.0-alpha6",
42
+ "@vaadin/text-field": "25.4.0-alpha6",
43
+ "@vaadin/vaadin-themable-mixin": "25.4.0-alpha6",
44
44
  "lit": "^3.0.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@vaadin/a11y-base": "25.4.0-alpha4",
48
- "@vaadin/aura": "25.4.0-alpha4",
49
- "@vaadin/chai-plugins": "25.4.0-alpha4",
50
- "@vaadin/checkbox": "25.4.0-alpha4",
51
- "@vaadin/test-runner-commands": "25.4.0-alpha4",
47
+ "@vaadin/a11y-base": "25.4.0-alpha6",
48
+ "@vaadin/aura": "25.4.0-alpha6",
49
+ "@vaadin/chai-plugins": "25.4.0-alpha6",
50
+ "@vaadin/checkbox": "25.4.0-alpha6",
51
+ "@vaadin/test-runner-commands": "25.4.0-alpha6",
52
52
  "@vaadin/testing-helpers": "^2.0.0",
53
- "@vaadin/vaadin-lumo-styles": "25.4.0-alpha4",
53
+ "@vaadin/vaadin-lumo-styles": "25.4.0-alpha6",
54
54
  "sinon": "^22.0.0"
55
55
  },
56
56
  "customElements": "custom-elements.json",
@@ -58,5 +58,5 @@
58
58
  "web-types.json",
59
59
  "web-types.lit.json"
60
60
  ],
61
- "gitHead": "7809e4c099538333a6dbd11d8da18a0c6ec30dad"
61
+ "gitHead": "4ead7de23a27c47e5ef4cb172481f8c54e86691a"
62
62
  }
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2018 - 2026 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, render } from 'lit';
6
+ import { html } from 'lit';
7
7
  import { ifDefined } from 'lit/directives/if-defined.js';
8
8
  import { LoginMixin } from './vaadin-login-mixin.js';
9
9
 
@@ -30,17 +30,6 @@ export const LoginFormMixin = (superClass) =>
30
30
  return this.querySelector('#vaadinLoginPassword');
31
31
  }
32
32
 
33
- /**
34
- * Override update to render slotted form and buttons
35
- * into light DOM after rendering shadow DOM.
36
- * @protected
37
- */
38
- update(props) {
39
- super.update(props);
40
-
41
- this.__renderSlottedForm();
42
- }
43
-
44
33
  /** @protected */
45
34
  updated(props) {
46
35
  super.updated(props);
@@ -61,58 +50,65 @@ export const LoginFormMixin = (superClass) =>
61
50
  }
62
51
  }
63
52
 
64
- __renderSlottedForm() {
65
- render(
66
- html`
67
- <form method="POST" action="${ifDefined(this.action)}" @formdata="${this._onFormData}" slot="form">
68
- <input id="csrf" type="hidden" />
69
- <vaadin-text-field
70
- name="username"
71
- .label="${this.__effectiveI18n.form.username}"
72
- .errorMessage="${this.__effectiveI18n.errorMessage.username}"
73
- id="vaadinLoginUsername"
74
- required
75
- @keydown="${this._handleInputKeydown}"
76
- autocapitalize="none"
77
- autocorrect="off"
78
- spellcheck="false"
79
- autocomplete="username"
80
- manual-validation
81
- >
82
- <input type="text" slot="input" @keyup="${this._handleInputKeyup}" />
83
- </vaadin-text-field>
84
-
85
- <vaadin-password-field
86
- name="password"
87
- .label="${this.__effectiveI18n.form.password}"
88
- .errorMessage="${this.__effectiveI18n.errorMessage.password}"
89
- id="vaadinLoginPassword"
90
- required
91
- @keydown="${this._handleInputKeydown}"
92
- spellcheck="false"
93
- autocomplete="current-password"
94
- manual-validation
95
- >
96
- <input type="password" slot="input" @keyup="${this._handleInputKeyup}" />
97
- </vaadin-password-field>
98
- </form>
99
-
100
- <vaadin-button slot="submit" theme="primary submit" @click="${this.submit}" .disabled="${this.disabled}">
101
- ${this.__effectiveI18n.form.submit}
102
- </vaadin-button>
103
-
104
- <vaadin-button
105
- slot="forgot-password"
106
- theme="tertiary small"
107
- @click="${this._onForgotPasswordClick}"
108
- ?hidden="${this.noForgotPassword}"
53
+ /** @protected */
54
+ _renderForm() {
55
+ return html`
56
+ <form method="POST" action="${ifDefined(this.action)}" @formdata="${this._onFormData}" slot="form">
57
+ <input id="csrf" type="hidden" />
58
+ <vaadin-text-field
59
+ name="username"
60
+ .label="${this.__effectiveI18n.form.username}"
61
+ .errorMessage="${this.__effectiveI18n.errorMessage.username}"
62
+ id="vaadinLoginUsername"
63
+ required
64
+ @keydown="${this._handleInputKeydown}"
65
+ autocapitalize="none"
66
+ autocorrect="off"
67
+ spellcheck="false"
68
+ autocomplete="username"
69
+ manual-validation
70
+ >
71
+ <input type="text" slot="input" @keyup="${this._handleInputKeyup}" />
72
+ </vaadin-text-field>
73
+
74
+ <vaadin-password-field
75
+ name="password"
76
+ .label="${this.__effectiveI18n.form.password}"
77
+ .errorMessage="${this.__effectiveI18n.errorMessage.password}"
78
+ id="vaadinLoginPassword"
79
+ required
80
+ @keydown="${this._handleInputKeydown}"
81
+ spellcheck="false"
82
+ autocomplete="current-password"
83
+ manual-validation
109
84
  >
110
- ${this.__effectiveI18n.form.forgotPassword}
111
- </vaadin-button>
112
- `,
113
- this,
114
- { host: this },
115
- );
85
+ <input type="password" slot="input" @keyup="${this._handleInputKeyup}" />
86
+ </vaadin-password-field>
87
+ </form>
88
+ `;
89
+ }
90
+
91
+ /** @protected */
92
+ _renderSubmitButton() {
93
+ return html`
94
+ <vaadin-button slot="submit" theme="primary submit" @click="${this.submit}" .disabled="${this.disabled}">
95
+ ${this.__effectiveI18n.form.submit}
96
+ </vaadin-button>
97
+ `;
98
+ }
99
+
100
+ /** @protected */
101
+ _renderForgotPasswordButton() {
102
+ return html`
103
+ <vaadin-button
104
+ slot="forgot-password"
105
+ theme="tertiary small"
106
+ @click="${this._onForgotPasswordClick}"
107
+ ?hidden="${this.noForgotPassword}"
108
+ >
109
+ ${this.__effectiveI18n.form.forgotPassword}
110
+ </vaadin-button>
111
+ `;
116
112
  }
117
113
 
118
114
  /**
@@ -10,6 +10,7 @@ import './vaadin-login-form-wrapper.js';
10
10
  import { css, html, LitElement } from 'lit';
11
11
  import { ifDefined } from 'lit/directives/if-defined.js';
12
12
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
13
+ import { slotContent } from '@vaadin/component-base/src/directives/slot-content.js';
13
14
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
14
15
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
15
16
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
@@ -103,10 +104,10 @@ class LoginForm extends LoginFormMixin(ElementMixin(ThemableMixin(PolylitMixin(L
103
104
  <div id="title" slot="form-title" part="form-title" role="heading" aria-level="${this.headingLevel}">
104
105
  ${this.__effectiveI18n.form.title}
105
106
  </div>
106
- <slot name="form" slot="form"></slot>
107
+ <slot name="form" slot="form" ${slotContent(this._renderForm())}></slot>
107
108
  <slot name="custom-form-area" slot="custom-form-area"></slot>
108
- <slot name="submit" slot="submit"></slot>
109
- <slot name="forgot-password" slot="forgot-password"></slot>
109
+ <slot name="submit" slot="submit" ${slotContent(this._renderSubmitButton())}></slot>
110
+ <slot name="forgot-password" slot="forgot-password" ${slotContent(this._renderForgotPasswordButton())}></slot>
110
111
  <slot name="footer" slot="footer"></slot>
111
112
  </vaadin-login-form-wrapper>
112
113
  `;
@@ -11,6 +11,7 @@ import './vaadin-login-overlay-wrapper.js';
11
11
  import { css, html, LitElement } from 'lit';
12
12
  import { ifDefined } from 'lit/directives/if-defined.js';
13
13
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
14
+ import { slotContent } from '@vaadin/component-base/src/directives/slot-content.js';
14
15
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
15
16
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
16
17
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
@@ -135,10 +136,10 @@ class LoginOverlay extends LoginFormMixin(LoginOverlayMixin(ElementMixin(Themabl
135
136
  <div id="title" slot="form-title" part="form-title" role="heading" aria-level="${this.headingLevel + 1}">
136
137
  ${this.__effectiveI18n.form.title}
137
138
  </div>
138
- <slot name="form" slot="form"></slot>
139
+ <slot name="form" slot="form" ${slotContent(this._renderForm())}></slot>
139
140
  <slot name="custom-form-area" slot="custom-form-area"></slot>
140
- <slot name="submit" slot="submit"></slot>
141
- <slot name="forgot-password" slot="forgot-password"></slot>
141
+ <slot name="submit" slot="submit" ${slotContent(this._renderSubmitButton())}></slot>
142
+ <slot name="forgot-password" slot="forgot-password" ${slotContent(this._renderForgotPasswordButton())}></slot>
142
143
  <slot name="footer" slot="footer"></slot>
143
144
  </vaadin-login-form-wrapper>
144
145
  </vaadin-login-overlay-wrapper>
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": "25.4.0-alpha4",
4
+ "version": "25.4.0-alpha6",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/login",
4
- "version": "25.4.0-alpha4",
4
+ "version": "25.4.0-alpha6",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {