@vaadin/text-field 24.3.0-alpha1 → 24.3.0-alpha11

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/text-field",
3
- "version": "24.3.0-alpha1",
3
+ "version": "24.3.0-alpha11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,8 +21,6 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
- "!src/vaadin-lit-text-field.d.ts",
25
- "!src/vaadin-lit-text-field.js",
26
24
  "theme",
27
25
  "vaadin-*.d.ts",
28
26
  "vaadin-*.js",
@@ -38,23 +36,23 @@
38
36
  "dependencies": {
39
37
  "@open-wc/dedupe-mixin": "^1.3.0",
40
38
  "@polymer/polymer": "^3.0.0",
41
- "@vaadin/a11y-base": "24.3.0-alpha1",
42
- "@vaadin/component-base": "24.3.0-alpha1",
43
- "@vaadin/field-base": "24.3.0-alpha1",
44
- "@vaadin/input-container": "24.3.0-alpha1",
45
- "@vaadin/vaadin-lumo-styles": "24.3.0-alpha1",
46
- "@vaadin/vaadin-material-styles": "24.3.0-alpha1",
47
- "@vaadin/vaadin-themable-mixin": "24.3.0-alpha1",
48
- "lit": "^2.0.0"
39
+ "@vaadin/a11y-base": "24.3.0-alpha11",
40
+ "@vaadin/component-base": "24.3.0-alpha11",
41
+ "@vaadin/field-base": "24.3.0-alpha11",
42
+ "@vaadin/input-container": "24.3.0-alpha11",
43
+ "@vaadin/vaadin-lumo-styles": "24.3.0-alpha11",
44
+ "@vaadin/vaadin-material-styles": "24.3.0-alpha11",
45
+ "@vaadin/vaadin-themable-mixin": "24.3.0-alpha11",
46
+ "lit": "^3.0.0"
49
47
  },
50
48
  "devDependencies": {
51
49
  "@esm-bundle/chai": "^4.3.4",
52
- "@vaadin/testing-helpers": "^0.5.0",
50
+ "@vaadin/testing-helpers": "^0.6.0",
53
51
  "sinon": "^13.0.2"
54
52
  },
55
53
  "web-types": [
56
54
  "web-types.json",
57
55
  "web-types.lit.json"
58
56
  ],
59
- "gitHead": "9ca6f3ca220a777e8eea181a1f5717e39a732240"
57
+ "gitHead": "123cf569a1b6ef6f4ef5fe8e60cb8d988699b98c"
60
58
  }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2021 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ export * from './vaadin-text-field.js';
@@ -0,0 +1,87 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2021 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import '@vaadin/input-container/src/vaadin-lit-input-container.js';
7
+ import { css, html, LitElement } from 'lit';
8
+ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
+ import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
10
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
11
+ import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
12
+ import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
13
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
14
+ import { TextFieldMixin } from './vaadin-text-field-mixin.js';
15
+
16
+ /**
17
+ * LitElement based version of `<vaadin-text-field>` web component.
18
+ *
19
+ * ## Disclaimer
20
+ *
21
+ * This component is an experiment not intended for publishing to npm.
22
+ * There is no ETA regarding specific Vaadin version where it'll land.
23
+ * Feel free to try this code in your apps as per Apache 2.0 license.
24
+ */
25
+ export class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
26
+ static get is() {
27
+ return 'vaadin-text-field';
28
+ }
29
+
30
+ static get styles() {
31
+ return [
32
+ inputFieldShared,
33
+ css`
34
+ [part='input-field'] {
35
+ flex-grow: 0;
36
+ }
37
+ `,
38
+ ];
39
+ }
40
+
41
+ /** @protected */
42
+ render() {
43
+ return html`
44
+ <div class="vaadin-field-container">
45
+ <div part="label">
46
+ <slot name="label"></slot>
47
+ <span part="required-indicator" aria-hidden="true" @click="${this.focus}"></span>
48
+ </div>
49
+
50
+ <vaadin-input-container
51
+ part="input-field"
52
+ .readonly="${this.readonly}"
53
+ .disabled="${this.disabled}"
54
+ .invalid="${this.invalid}"
55
+ theme="${this._theme}"
56
+ >
57
+ <slot name="prefix" slot="prefix"></slot>
58
+ <slot name="input"></slot>
59
+ <slot name="suffix" slot="suffix"></slot>
60
+ <div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
61
+ </vaadin-input-container>
62
+
63
+ <div part="helper-text">
64
+ <slot name="helper"></slot>
65
+ </div>
66
+
67
+ <div part="error-message">
68
+ <slot name="error-message"></slot>
69
+ </div>
70
+ </div>
71
+
72
+ <slot name="tooltip"></slot>
73
+ `;
74
+ }
75
+
76
+ /** @protected */
77
+ ready() {
78
+ super.ready();
79
+
80
+ this._tooltipController = new TooltipController(this);
81
+ this._tooltipController.setPosition('top');
82
+ this._tooltipController.setAriaTarget(this.inputElement);
83
+ this.addController(this._tooltipController);
84
+ }
85
+ }
86
+
87
+ defineCustomElement(TextField);
@@ -39,11 +39,11 @@ export declare function TextFieldMixin<T extends Constructor<HTMLElement>>(
39
39
  Constructor<KeyboardMixinClass> &
40
40
  Constructor<LabelMixinClass> &
41
41
  Constructor<SlotStylesMixinClass> &
42
- Constructor<TexFieldMixinClass> &
42
+ Constructor<TextFieldMixinClass> &
43
43
  Constructor<ValidateMixinClass> &
44
44
  T;
45
45
 
46
- export declare class TexFieldMixinClass {
46
+ export declare class TextFieldMixinClass {
47
47
  /**
48
48
  * Maximum number of characters (in Unicode code points) that the user can enter.
49
49
  */
@@ -19,11 +19,6 @@ export type TextFieldChangeEvent = Event & {
19
19
  */
20
20
  export type TextFieldInvalidChangedEvent = CustomEvent<{ value: boolean }>;
21
21
 
22
- /**
23
- * Fired when the `dirty` property changes.
24
- */
25
- export type TextFieldDirtyChangedEvent = CustomEvent<{ value: boolean }>;
26
-
27
22
  /**
28
23
  * Fired when the `value` property changes.
29
24
  */
@@ -37,8 +32,6 @@ export type TextFieldValidatedEvent = CustomEvent<{ valid: boolean }>;
37
32
  export interface TextFieldCustomEventMap {
38
33
  'invalid-changed': TextFieldInvalidChangedEvent;
39
34
 
40
- 'dirty-changed': TextFieldDirtyChangedEvent;
41
-
42
35
  'value-changed': TextFieldValueChangedEvent;
43
36
 
44
37
  validated: TextFieldValidatedEvent;
@@ -108,7 +101,6 @@ export interface TextFieldEventMap extends HTMLElementEventMap, TextFieldCustomE
108
101
  * @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.
109
102
  * @fires {Event} change - Fired when the user commits a value change.
110
103
  * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
111
- * @fires {CustomEvent} dirty-changed - Fired when the `dirty` property changes.
112
104
  * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
113
105
  * @fires {CustomEvent} validated - Fired whenever the field is validated.
114
106
  */
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2023 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-styles.js';
7
+ import '../../src/vaadin-lit-text-field.js';
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
6
7
  import { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';
7
8
  import { registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
9
 
@@ -3,6 +3,5 @@
3
3
  * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import '@vaadin/input-container/theme/lumo/vaadin-input-container.js';
7
6
  import './vaadin-text-field-styles.js';
8
7
  import '../../src/vaadin-text-field.js';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2023 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-styles.js';
7
+ import '../../src/vaadin-lit-text-field.js';
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import '@vaadin/input-container/theme/material/vaadin-input-container-styles.js';
6
7
  import { inputFieldShared } from '@vaadin/vaadin-material-styles/mixins/input-field-shared.js';
7
8
  import { registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
9
 
@@ -3,6 +3,5 @@
3
3
  * Copyright (c) 2017 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import '@vaadin/input-container/theme/material/vaadin-input-container.js';
7
6
  import './vaadin-text-field-styles.js';
8
7
  import '../../src/vaadin-text-field.js';
@@ -0,0 +1 @@
1
+ export * from './src/vaadin-text-field.js';
@@ -0,0 +1,3 @@
1
+ import './theme/lumo/vaadin-lit-text-field.js';
2
+
3
+ export * from './src/vaadin-lit-text-field.js';
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/text-field",
4
- "version": "24.3.0-alpha1",
4
+ "version": "24.3.0-alpha11",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -120,17 +120,6 @@
120
120
  ]
121
121
  }
122
122
  },
123
- {
124
- "name": "dirty",
125
- "description": "Whether the field is dirty.\n\nThe field is automatically marked as dirty once the user triggers\nan `input` or `change` event. Additionally, the field can be manually\nmarked as dirty by setting the property to `true`.",
126
- "value": {
127
- "type": [
128
- "boolean",
129
- "null",
130
- "undefined"
131
- ]
132
- }
133
- },
134
123
  {
135
124
  "name": "clear-button-visible",
136
125
  "description": "Set to true to display the clear icon which clears the input.\n\nIt is up to the component to choose where to place the clear icon:\nin the Shadow DOM or in the light DOM. In any way, a reference to\nthe clear icon element should be provided via the `clearElement` getter.",
@@ -398,17 +387,6 @@
398
387
  ]
399
388
  }
400
389
  },
401
- {
402
- "name": "dirty",
403
- "description": "Whether the field is dirty.\n\nThe field is automatically marked as dirty once the user triggers\nan `input` or `change` event. Additionally, the field can be manually\nmarked as dirty by setting the property to `true`.",
404
- "value": {
405
- "type": [
406
- "boolean",
407
- "null",
408
- "undefined"
409
- ]
410
- }
411
- },
412
390
  {
413
391
  "name": "clearButtonVisible",
414
392
  "description": "Set to true to display the clear icon which clears the input.\n\nIt is up to the component to choose where to place the clear icon:\nin the Shadow DOM or in the light DOM. In any way, a reference to\nthe clear icon element should be provided via the `clearElement` getter.",
@@ -573,10 +551,6 @@
573
551
  {
574
552
  "name": "value-changed",
575
553
  "description": "Fired when the `value` property changes."
576
- },
577
- {
578
- "name": "dirty-changed",
579
- "description": "Fired when the `dirty` property changes."
580
554
  }
581
555
  ]
582
556
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/text-field",
4
- "version": "24.3.0-alpha1",
4
+ "version": "24.3.0-alpha11",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -47,13 +47,6 @@
47
47
  "kind": "expression"
48
48
  }
49
49
  },
50
- {
51
- "name": "?dirty",
52
- "description": "Whether the field is dirty.\n\nThe field is automatically marked as dirty once the user triggers\nan `input` or `change` event. Additionally, the field can be manually\nmarked as dirty by setting the property to `true`.",
53
- "value": {
54
- "kind": "expression"
55
- }
56
- },
57
50
  {
58
51
  "name": "?clearButtonVisible",
59
52
  "description": "Set to true to display the clear icon which clears the input.\n\nIt is up to the component to choose where to place the clear icon:\nin the Shadow DOM or in the light DOM. In any way, a reference to\nthe clear icon element should be provided via the `clearElement` getter.",
@@ -221,13 +214,6 @@
221
214
  "value": {
222
215
  "kind": "expression"
223
216
  }
224
- },
225
- {
226
- "name": "@dirty-changed",
227
- "description": "Fired when the `dirty` property changes.",
228
- "value": {
229
- "kind": "expression"
230
- }
231
217
  }
232
218
  ]
233
219
  }