@vaadin/vaadin-text-field 22.0.0-alpha4 → 22.0.0-alpha8

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,10 +1,29 @@
1
1
  {
2
2
  "name": "@vaadin/vaadin-text-field",
3
- "version": "22.0.0-alpha4",
3
+ "version": "22.0.0-alpha8",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
4
7
  "description": "vaadin-text-field",
8
+ "license": "Apache-2.0",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/vaadin/web-components.git",
12
+ "directory": "packages/vaadin-text-field"
13
+ },
14
+ "author": "Vaadin Ltd",
15
+ "homepage": "https://vaadin.com/components",
16
+ "bugs": {
17
+ "url": "https://github.com/vaadin/vaadin-text-field/issues"
18
+ },
5
19
  "main": "vaadin-text-field.js",
6
20
  "module": "vaadin-text-field.js",
7
- "repository": "vaadin/vaadin-text-field",
21
+ "files": [
22
+ "src",
23
+ "theme",
24
+ "vaadin-*.d.ts",
25
+ "vaadin-*.js"
26
+ ],
8
27
  "keywords": [
9
28
  "Vaadin",
10
29
  "input",
@@ -12,38 +31,14 @@
12
31
  "web-component",
13
32
  "polymer"
14
33
  ],
15
- "author": "Vaadin Ltd",
16
- "license": "Apache-2.0",
17
- "bugs": {
18
- "url": "https://github.com/vaadin/vaadin-text-field/issues"
19
- },
20
- "homepage": "https://vaadin.com/components",
21
- "files": [
22
- "vaadin-*.d.ts",
23
- "vaadin-*.js",
24
- "src",
25
- "theme"
26
- ],
27
34
  "dependencies": {
28
35
  "@polymer/polymer": "^3.0.0",
29
- "@vaadin/email-field": "^22.0.0-alpha4",
30
- "@vaadin/integer-field": "^22.0.0-alpha4",
31
- "@vaadin/number-field": "^22.0.0-alpha4",
32
- "@vaadin/password-field": "^22.0.0-alpha4",
33
- "@vaadin/text-area": "^22.0.0-alpha4",
34
- "@vaadin/vaadin-control-state-mixin": "^22.0.0-alpha4",
35
- "@vaadin/vaadin-element-mixin": "^22.0.0-alpha4",
36
- "@vaadin/vaadin-lumo-styles": "^22.0.0-alpha4",
37
- "@vaadin/vaadin-material-styles": "^22.0.0-alpha4",
38
- "@vaadin/vaadin-themable-mixin": "^22.0.0-alpha4"
39
- },
40
- "devDependencies": {
41
- "@esm-bundle/chai": "^4.3.4",
42
- "@vaadin/testing-helpers": "^0.2.1",
43
- "sinon": "^9.2.1"
44
- },
45
- "publishConfig": {
46
- "access": "public"
36
+ "@vaadin/email-field": "22.0.0-alpha8",
37
+ "@vaadin/integer-field": "22.0.0-alpha8",
38
+ "@vaadin/number-field": "22.0.0-alpha8",
39
+ "@vaadin/password-field": "22.0.0-alpha8",
40
+ "@vaadin/text-area": "22.0.0-alpha8",
41
+ "@vaadin/text-field": "22.0.0-alpha8"
47
42
  },
48
- "gitHead": "86c025abd605d5a4a3c0ae36eb07c34704cee1f2"
43
+ "gitHead": "c24468526298ee26ad7f7280b59f6c8789e1f75f"
49
44
  }
@@ -3,4 +3,16 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { EmailField } from '@vaadin/email-field/src/vaadin-email-field.js';
7
+
8
+ /**
9
+ * @deprecated Import `EmailField` from `@vaadin/email-field` instead.
10
+ */
11
+ export type EmailFieldElement = EmailField;
12
+
13
+ /**
14
+ * @deprecated Import `EmailField` from `@vaadin/email-field` instead.
15
+ */
16
+ export const EmailFieldElement: typeof EmailField;
17
+
6
18
  export * from '@vaadin/email-field/src/vaadin-email-field.js';
@@ -3,4 +3,11 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { EmailField } from '@vaadin/email-field/src/vaadin-email-field.js';
7
+
8
+ /**
9
+ * @deprecated Import `EmailField` from `@vaadin/email-field` instead.
10
+ */
11
+ export const EmailFieldElement = EmailField;
12
+
6
13
  export * from '@vaadin/email-field/src/vaadin-email-field.js';
@@ -3,4 +3,16 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { IntegerField } from '@vaadin/integer-field/src/vaadin-integer-field.js';
7
+
8
+ /**
9
+ * @deprecated Import `IntegerField` from `@vaadin/integer-field` instead.
10
+ */
11
+ export type IntegerFieldElement = IntegerField;
12
+
13
+ /**
14
+ * @deprecated Import `IntegerField` from `@vaadin/integer-field` instead.
15
+ */
16
+ export const IntegerFieldElement: typeof IntegerField;
17
+
6
18
  export * from '@vaadin/integer-field/src/vaadin-integer-field.js';
@@ -3,4 +3,11 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { IntegerField } from '@vaadin/integer-field/src/vaadin-integer-field.js';
7
+
8
+ /**
9
+ * @deprecated Import `IntegerField` from `@vaadin/integer-field` instead.
10
+ */
11
+ export const IntegerFieldElement = IntegerField;
12
+
6
13
  export * from '@vaadin/integer-field/src/vaadin-integer-field.js';
@@ -3,4 +3,16 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { NumberField } from '@vaadin/number-field/src/vaadin-number-field.js';
7
+
8
+ /**
9
+ * @deprecated Import `NumberField` from `@vaadin/number-field` instead.
10
+ */
11
+ export type NumberFieldElement = NumberField;
12
+
13
+ /**
14
+ * @deprecated Import `NumberField` from `@vaadin/number-field` instead.
15
+ */
16
+ export const NumberFieldElement: typeof NumberField;
17
+
6
18
  export * from '@vaadin/number-field/src/vaadin-number-field.js';
@@ -3,4 +3,11 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { NumberField } from '@vaadin/number-field/src/vaadin-number-field.js';
7
+
8
+ /**
9
+ * @deprecated Import `NumberField` from `@vaadin/number-field` instead.
10
+ */
11
+ export const NumberFieldElement = NumberField;
12
+
6
13
  export * from '@vaadin/number-field/src/vaadin-number-field.js';
@@ -3,4 +3,16 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { PasswordField } from '@vaadin/password-field/src/vaadin-password-field.js';
7
+
8
+ /**
9
+ * @deprecated Import `PasswordField` from `@vaadin/password-field` instead.
10
+ */
11
+ export type PasswordFieldElement = PasswordField;
12
+
13
+ /**
14
+ * @deprecated Import `PasswordField` from `@vaadin/password-field` instead.
15
+ */
16
+ export const PasswordFieldElement: typeof PasswordField;
17
+
6
18
  export * from '@vaadin/password-field/src/vaadin-password-field.js';
@@ -3,4 +3,11 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { PasswordField } from '@vaadin/password-field/src/vaadin-password-field.js';
7
+
8
+ /**
9
+ * @deprecated Import `PasswordField` from `@vaadin/password-field` instead.
10
+ */
11
+ export const PasswordFieldElement = PasswordField;
12
+
6
13
  export * from '@vaadin/password-field/src/vaadin-password-field.js';
@@ -3,4 +3,16 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { TextArea } from '@vaadin/text-area/src/vaadin-text-area.js';
7
+
8
+ /**
9
+ * @deprecated Import `TextArea` from `@vaadin/text-area` instead.
10
+ */
11
+ export type TextAreaElement = TextArea;
12
+
13
+ /**
14
+ * @deprecated Import `TextArea` from `@vaadin/text-area` instead.
15
+ */
16
+ export const TextAreaElement: typeof TextArea;
17
+
6
18
  export * from '@vaadin/text-area/src/vaadin-text-area.js';
@@ -3,4 +3,11 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { TextArea } from '@vaadin/text-area/src/vaadin-text-area.js';
7
+
8
+ /**
9
+ * @deprecated Import `TextArea` from `@vaadin/text-area` instead.
10
+ */
11
+ export const TextAreaElement = TextArea;
12
+
6
13
  export * from '@vaadin/text-area/src/vaadin-text-area.js';
@@ -1,103 +1,18 @@
1
- import { TextFieldMixin } from './vaadin-text-field-mixin.js';
2
-
3
- import { ControlStateMixin } from '@vaadin/vaadin-control-state-mixin/vaadin-control-state-mixin.js';
4
-
5
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
6
-
7
- import { ElementMixin } from '@vaadin/vaadin-element-mixin/vaadin-element-mixin.js';
8
-
9
- import { TextFieldEventMap } from './interfaces';
10
-
11
1
  /**
12
- * `<vaadin-text-field>` is a Web Component for text field control in forms.
13
- *
14
- * ```html
15
- * <vaadin-text-field label="First Name">
16
- * </vaadin-text-field>
17
- * ```
18
- *
19
- * ### Prefixes and suffixes
20
- *
21
- * These are child elements of a `<vaadin-text-field>` that are displayed
22
- * inline with the input, before or after.
23
- * In order for an element to be considered as a prefix, it must have the slot
24
- * attribute set to `prefix` (and similarly for `suffix`).
25
- *
26
- * ```html
27
- * <vaadin-text-field label="Email address">
28
- * <div slot="prefix">Sent to:</div>
29
- * <div slot="suffix">@vaadin.com</div>
30
- * </vaadin-text-field>
31
- * ```
32
- *
33
- * ### Styling
34
- *
35
- * The following custom properties are available for styling:
36
- *
37
- * Custom property | Description | Default
38
- * ----------------|-------------|-------------
39
- * `--vaadin-text-field-default-width` | Set the default width of the input field | `12em`
40
- *
41
- * The following shadow DOM parts are available for styling:
42
- *
43
- * Part name | Description
44
- * ----------------|----------------
45
- * `label` | The label element
46
- * `input-field` | The element that wraps prefix, value and suffix
47
- * `value` | The text value element inside the `input-field` element
48
- * `error-message` | The error message element
49
- *
50
- * The following state attributes are available for styling:
51
- *
52
- * Attribute | Description | Part name
53
- * -------------|-------------|------------
54
- * `disabled` | Set to a disabled text field | :host
55
- * `has-value` | Set when the element has a value | :host
56
- * `has-label` | Set when the element has a label | :host
57
- * `has-helper` | Set when the element has helper text or slot | :host
58
- * `has-error-message` | Set when the element has an error message | :host
59
- * `invalid` | Set when the element is invalid | :host
60
- * `input-prevented` | Temporarily set when invalid input is prevented | :host
61
- * `focused` | Set when the element is focused | :host
62
- * `focus-ring` | Set when the element is keyboard focused | :host
63
- * `readonly` | Set to a readonly text field | :host
64
- *
65
- * See [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.
66
- *
67
- * @fires {Event} input - Fired when the value is changed by the user: on every typing keystroke, and the value is cleared using the clear button.
68
- * @fires {Event} change - Fired when the user commits a value change.
69
- * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
70
- * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
2
+ * @license
3
+ * Copyright (c) 2021 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
71
5
  */
72
- declare class TextFieldElement extends TextFieldMixin(ControlStateMixin(ThemableMixin(ElementMixin(HTMLElement)))) {
73
- /**
74
- * A regular expression that the value is checked against.
75
- * The pattern must match the entire value, not just some subset.
76
- */
77
- pattern: string | null | undefined;
78
-
79
- /**
80
- * The text usually displayed in a tooltip popup when the mouse is over the field.
81
- */
82
- title: string;
6
+ import { TextField } from '@vaadin/text-field/src/vaadin-text-field.js';
83
7
 
84
- addEventListener<K extends keyof TextFieldEventMap>(
85
- type: K,
86
- listener: (this: TextFieldElement, ev: TextFieldEventMap[K]) => void,
87
- options?: boolean | AddEventListenerOptions
88
- ): void;
89
-
90
- removeEventListener<K extends keyof TextFieldEventMap>(
91
- type: K,
92
- listener: (this: TextFieldElement, ev: TextFieldEventMap[K]) => void,
93
- options?: boolean | EventListenerOptions
94
- ): void;
95
- }
8
+ /**
9
+ * @deprecated Import `TextField` from `@vaadin/text-field` instead.
10
+ */
11
+ export type TextFieldElement = TextField;
96
12
 
97
- declare global {
98
- interface HTMLElementTagNameMap {
99
- 'vaadin-text-field': TextFieldElement;
100
- }
101
- }
13
+ /**
14
+ * @deprecated Import `TextField` from `@vaadin/text-field` instead.
15
+ */
16
+ export const TextFieldElement: typeof TextField;
102
17
 
103
- export { TextFieldElement };
18
+ export * from '@vaadin/text-field/src/vaadin-text-field.js';
@@ -3,138 +3,11 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
7
- import { TextFieldMixin } from './vaadin-text-field-mixin.js';
8
- import { ControlStateMixin } from '@vaadin/vaadin-control-state-mixin/vaadin-control-state-mixin.js';
9
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10
- import { ElementMixin } from '@vaadin/vaadin-element-mixin/vaadin-element-mixin.js';
6
+ import { TextField } from '@vaadin/text-field/src/vaadin-text-field.js';
11
7
 
12
8
  /**
13
- * `<vaadin-text-field>` is a Web Component for text field control in forms.
14
- *
15
- * ```html
16
- * <vaadin-text-field label="First Name">
17
- * </vaadin-text-field>
18
- * ```
19
- *
20
- * ### Prefixes and suffixes
21
- *
22
- * These are child elements of a `<vaadin-text-field>` that are displayed
23
- * inline with the input, before or after.
24
- * In order for an element to be considered as a prefix, it must have the slot
25
- * attribute set to `prefix` (and similarly for `suffix`).
26
- *
27
- * ```html
28
- * <vaadin-text-field label="Email address">
29
- * <div slot="prefix">Sent to:</div>
30
- * <div slot="suffix">@vaadin.com</div>
31
- * </vaadin-text-field>
32
- * ```
33
- *
34
- * ### Styling
35
- *
36
- * The following custom properties are available for styling:
37
- *
38
- * Custom property | Description | Default
39
- * ----------------|-------------|-------------
40
- * `--vaadin-text-field-default-width` | Set the default width of the input field | `12em`
41
- *
42
- * The following shadow DOM parts are available for styling:
43
- *
44
- * Part name | Description
45
- * ----------------|----------------
46
- * `label` | The label element
47
- * `input-field` | The element that wraps prefix, value and suffix
48
- * `value` | The text value element inside the `input-field` element
49
- * `error-message` | The error message element
50
- *
51
- * The following state attributes are available for styling:
52
- *
53
- * Attribute | Description | Part name
54
- * -------------|-------------|------------
55
- * `disabled` | Set to a disabled text field | :host
56
- * `has-value` | Set when the element has a value | :host
57
- * `has-label` | Set when the element has a label | :host
58
- * `has-helper` | Set when the element has helper text or slot | :host
59
- * `has-error-message` | Set when the element has an error message | :host
60
- * `invalid` | Set when the element is invalid | :host
61
- * `input-prevented` | Temporarily set when invalid input is prevented | :host
62
- * `focused` | Set when the element is focused | :host
63
- * `focus-ring` | Set when the element is keyboard focused | :host
64
- * `readonly` | Set to a readonly text field | :host
65
- *
66
- * See [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.
67
- *
68
- * @fires {Event} input - Fired when the value is changed by the user: on every typing keystroke, and the value is cleared using the clear button.
69
- * @fires {Event} change - Fired when the user commits a value change.
70
- * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
71
- * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
72
- *
73
- * @extends HTMLElement
74
- * @mixes TextFieldMixin
75
- * @mixes ControlStateMixin
76
- * @mixes ThemableMixin
77
- * @mixes ElementMixin
9
+ * @deprecated Import `TextField` from `@vaadin/text-field` instead.
78
10
  */
79
- class TextFieldElement extends ElementMixin(TextFieldMixin(ControlStateMixin(ThemableMixin(PolymerElement)))) {
80
- static get template() {
81
- return html`
82
- <style include="vaadin-text-field-shared-styles"></style>
11
+ export const TextFieldElement = TextField;
83
12
 
84
- <div class="vaadin-text-field-container">
85
- <label part="label" on-click="focus" id="[[_labelId]]">[[label]]</label>
86
-
87
- <div part="input-field" id="[[_inputId]]">
88
- <slot name="prefix"></slot>
89
-
90
- <slot name="input">
91
- <input part="value" />
92
- </slot>
93
-
94
- <div part="clear-button" id="clearButton" role="button" aria-label$="[[i18n.clear]]"></div>
95
- <slot name="suffix"></slot>
96
- </div>
97
-
98
- <div part="helper-text" id="[[_helperTextId]]">
99
- <slot name="helper">[[helperText]]</slot>
100
- </div>
101
-
102
- <div
103
- part="error-message"
104
- id="[[_errorId]]"
105
- aria-live="assertive"
106
- aria-hidden$="[[_getErrorMessageAriaHidden(invalid, errorMessage, _errorId)]]"
107
- >[[errorMessage]]</div
108
- >
109
- </div>
110
- `;
111
- }
112
-
113
- static get is() {
114
- return 'vaadin-text-field';
115
- }
116
-
117
- static get properties() {
118
- return {
119
- /**
120
- * A regular expression that the value is checked against.
121
- * The pattern must match the entire value, not just some subset.
122
- */
123
- pattern: {
124
- type: String
125
- },
126
-
127
- /**
128
- * The text usually displayed in a tooltip popup when the mouse is over the field.
129
- * @type {string}
130
- */
131
- title: {
132
- type: String
133
- }
134
- };
135
- }
136
- }
137
-
138
- customElements.define(TextFieldElement.is, TextFieldElement);
139
-
140
- export { TextFieldElement };
13
+ export * from '@vaadin/text-field/src/vaadin-text-field.js';
@@ -1,2 +1,6 @@
1
- import './vaadin-text-field-styles.js';
2
- import '../../src/vaadin-text-field.js';
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2021 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/lumo/vaadin-text-field.js';
@@ -1,2 +1,6 @@
1
- import './vaadin-text-field-styles.js';
2
- import '../../src/vaadin-text-field.js';
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2021 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';
@@ -1,2 +1 @@
1
1
  export * from './src/vaadin-text-field.js';
2
- export * from './src/interfaces';
@@ -1,21 +0,0 @@
1
- export type TextFieldAutoCapitalize = 'on' | 'off' | 'none' | 'characters' | 'words' | 'sentences';
2
-
3
- export type TextFieldAutoCorrect = 'on' | 'off';
4
-
5
- /**
6
- * Fired when the `invalid` property changes.
7
- */
8
- export type TextFieldInvalidChangedEvent = CustomEvent<{ value: boolean }>;
9
-
10
- /**
11
- * Fired when the `value` property changes.
12
- */
13
- export type TextFieldValueChangedEvent = CustomEvent<{ value: string }>;
14
-
15
- export interface TextFieldElementEventMap {
16
- 'invalid-changed': TextFieldInvalidChangedEvent;
17
-
18
- 'value-changed': TextFieldValueChangedEvent;
19
- }
20
-
21
- export interface TextFieldEventMap extends HTMLElementEventMap, TextFieldElementEventMap {}