@vaadin/email-field 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 -23
- package/package.json +11 -11
- package/{theme/material/vaadin-email-field.js → src/styles/vaadin-email-field-core-styles.d.ts} +3 -3
- package/src/styles/vaadin-email-field-core-styles.js +18 -0
- package/src/vaadin-email-field.js +11 -4
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
- package/src/vaadin-lit-email-field.js +0 -44
- package/theme/lumo/vaadin-lit-email-field.d.ts +0 -3
- package/theme/lumo/vaadin-lit-email-field.js +0 -3
- package/theme/material/vaadin-email-field-styles.d.ts +0 -1
- package/theme/material/vaadin-email-field-styles.js +0 -11
- package/theme/material/vaadin-email-field.d.ts +0 -8
- package/theme/material/vaadin-lit-email-field.d.ts +0 -3
- package/theme/material/vaadin-lit-email-field.js +0 -3
- package/vaadin-lit-email-field.d.ts +0 -1
- package/vaadin-lit-email-field.js +0 -3
- /package/src/{vaadin-email-field-styles.d.ts → styles/vaadin-email-field-base-styles.d.ts} +0 -0
- /package/src/{vaadin-email-field-styles.js → styles/vaadin-email-field-base-styles.js} +0 -0
package/README.md
CHANGED
|
@@ -24,29 +24,6 @@ Once installed, import the component in your application:
|
|
|
24
24
|
import '@vaadin/email-field';
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
## Themes
|
|
28
|
-
|
|
29
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
|
|
30
|
-
The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/email-field/vaadin-email-field.js) of the package uses Lumo theme.
|
|
31
|
-
|
|
32
|
-
To use the Material theme, import the component from the `theme/material` folder:
|
|
33
|
-
|
|
34
|
-
```js
|
|
35
|
-
import '@vaadin/email-field/theme/material/vaadin-email-field.js';
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
You can also import the Lumo version of the component explicitly:
|
|
39
|
-
|
|
40
|
-
```js
|
|
41
|
-
import '@vaadin/email-field/theme/lumo/vaadin-email-field.js';
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
|
|
45
|
-
|
|
46
|
-
```js
|
|
47
|
-
import '@vaadin/email-field/src/vaadin-email-field.js';
|
|
48
|
-
```
|
|
49
|
-
|
|
50
27
|
## Contributing
|
|
51
28
|
|
|
52
29
|
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/email-field",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0-alpha10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
+
"!src/styles/*-base-styles.d.ts",
|
|
25
|
+
"!src/styles/*-base-styles.js",
|
|
24
26
|
"theme",
|
|
25
27
|
"vaadin-*.d.ts",
|
|
26
28
|
"vaadin-*.js",
|
|
@@ -34,23 +36,21 @@
|
|
|
34
36
|
"web-component"
|
|
35
37
|
],
|
|
36
38
|
"dependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"@vaadin/
|
|
39
|
-
"@vaadin/
|
|
40
|
-
"@vaadin/vaadin-
|
|
41
|
-
"@vaadin/vaadin-material-styles": "~24.8.4",
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "~24.8.4",
|
|
39
|
+
"@vaadin/component-base": "25.0.0-alpha10",
|
|
40
|
+
"@vaadin/text-field": "25.0.0-alpha10",
|
|
41
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
|
|
43
43
|
"lit": "^3.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@vaadin/chai-plugins": "
|
|
47
|
-
"@vaadin/test-runner-commands": "
|
|
48
|
-
"@vaadin/testing-helpers": "^
|
|
46
|
+
"@vaadin/chai-plugins": "25.0.0-alpha10",
|
|
47
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha10",
|
|
48
|
+
"@vaadin/testing-helpers": "^2.0.0",
|
|
49
49
|
"sinon": "^18.0.0"
|
|
50
50
|
},
|
|
51
51
|
"web-types": [
|
|
52
52
|
"web-types.json",
|
|
53
53
|
"web-types.lit.json"
|
|
54
54
|
],
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
|
|
56
56
|
}
|
package/{theme/material/vaadin-email-field.js → src/styles/vaadin-email-field-core-styles.d.ts}
RENAMED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* Copyright (c) 2021 - 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 '
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import type { CSSResult } from 'lit';
|
|
7
|
+
|
|
8
|
+
export const emailFieldStyles: CSSResult;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { css } from 'lit';
|
|
7
|
+
|
|
8
|
+
// See https://github.com/vaadin/vaadin-text-field/issues/466
|
|
9
|
+
export const emailFieldStyles = css`
|
|
10
|
+
:host([dir='rtl']) [part='input-field'] {
|
|
11
|
+
direction: ltr;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host([dir='rtl']) [part='input-field'] ::slotted(input)::placeholder {
|
|
15
|
+
direction: rtl;
|
|
16
|
+
text-align: left;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
@@ -5,10 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
7
7
|
import { TextField } from '@vaadin/text-field/src/vaadin-text-field.js';
|
|
8
|
-
import {
|
|
9
|
-
import { emailFieldStyles } from './vaadin-email-field-styles.js';
|
|
10
|
-
|
|
11
|
-
registerStyles('vaadin-email-field', emailFieldStyles, { moduleId: 'vaadin-email-field-styles' });
|
|
8
|
+
import { emailFieldStyles } from './styles/vaadin-email-field-core-styles.js';
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
11
|
* `<vaadin-email-field>` is a Web Component for email field control in forms.
|
|
@@ -38,6 +35,16 @@ export class EmailField extends TextField {
|
|
|
38
35
|
return 'vaadin-email-field';
|
|
39
36
|
}
|
|
40
37
|
|
|
38
|
+
static get styles() {
|
|
39
|
+
return [...super.styles, emailFieldStyles];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** @override */
|
|
43
|
+
static get delegateAttrs() {
|
|
44
|
+
// Do not delegate autocapitalize as it should be always set to "off"
|
|
45
|
+
return super.delegateAttrs.filter((attr) => attr !== 'autocapitalize');
|
|
46
|
+
}
|
|
47
|
+
|
|
41
48
|
constructor() {
|
|
42
49
|
super();
|
|
43
50
|
this._setType('email');
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/email-field",
|
|
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-email-field",
|
|
11
|
-
"description": "`<vaadin-email-field>` is a Web Component for email field control in forms.\n\n```html\n<vaadin-email-field label=\"Email\"></vaadin-email-field>\n```\n\n### Styling\n\n`<vaadin-email-field>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/
|
|
11
|
+
"description": "`<vaadin-email-field>` is a Web Component for email field control in forms.\n\n```html\n<vaadin-email-field label=\"Email\"></vaadin-email-field>\n```\n\n### Styling\n\n`<vaadin-email-field>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-text-field) for the styling documentation.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "disabled",
|
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/email-field",
|
|
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-email-field",
|
|
19
|
-
"description": "`<vaadin-email-field>` is a Web Component for email field control in forms.\n\n```html\n<vaadin-email-field label=\"Email\"></vaadin-email-field>\n```\n\n### Styling\n\n`<vaadin-email-field>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/
|
|
19
|
+
"description": "`<vaadin-email-field>` is a Web Component for email field control in forms.\n\n```html\n<vaadin-email-field label=\"Email\"></vaadin-email-field>\n```\n\n### Styling\n\n`<vaadin-email-field>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha10/#/elements/vaadin-text-field) for the styling documentation.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
7
|
-
import { TextField } from '@vaadin/text-field/src/vaadin-lit-text-field.js';
|
|
8
|
-
import { emailFieldStyles } from './vaadin-email-field-styles.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* LitElement based version of `<vaadin-email-field>` web component.
|
|
12
|
-
*
|
|
13
|
-
* ## Disclaimer
|
|
14
|
-
*
|
|
15
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
16
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
17
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
18
|
-
*/
|
|
19
|
-
export class EmailField extends TextField {
|
|
20
|
-
static get is() {
|
|
21
|
-
return 'vaadin-email-field';
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
static get styles() {
|
|
25
|
-
return [...super.styles, emailFieldStyles];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
constructor() {
|
|
29
|
-
super();
|
|
30
|
-
this._setType('email');
|
|
31
|
-
this.pattern = '^[a-zA-Z0-9_\\-+]+(?:\\.[a-zA-Z0-9_\\-+]+)*@[a-zA-Z0-9\\-.]+\\.[a-zA-Z0-9\\-]{2,}$';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** @protected */
|
|
35
|
-
ready() {
|
|
36
|
-
super.ready();
|
|
37
|
-
|
|
38
|
-
if (this.inputElement) {
|
|
39
|
-
this.inputElement.autocapitalize = 'off';
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
defineCustomElement(EmailField);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { inputFieldShared } from '@vaadin/vaadin-material-styles/mixins/input-field-shared.js';
|
|
7
|
-
import { registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
|
-
|
|
9
|
-
registerStyles('vaadin-email-field', inputFieldShared, {
|
|
10
|
-
moduleId: 'material-email-field',
|
|
11
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2021 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import '@vaadin/text-field/theme/material/vaadin-text-field.js';
|
|
7
|
-
import './vaadin-email-field-styles.js';
|
|
8
|
-
import '../../src/vaadin-email-field.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-email-field.js';
|
|
File without changes
|
|
File without changes
|