@vaadin/text-field 24.8.0-alpha8 → 25.0.0-alpha1

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 CHANGED
@@ -24,29 +24,6 @@ Once installed, import the component in your application:
24
24
  import '@vaadin/text-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/text-field/vaadin-text-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/text-field/theme/material/vaadin-text-field.js';
36
- ```
37
-
38
- You can also import the Lumo version of the component explicitly:
39
-
40
- ```js
41
- import '@vaadin/text-field/theme/lumo/vaadin-text-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/text-field/src/vaadin-text-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/text-field",
3
- "version": "24.8.0-alpha8",
3
+ "version": "25.0.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,19 +35,17 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@polymer/polymer": "^3.0.0",
39
- "@vaadin/a11y-base": "24.8.0-alpha8",
40
- "@vaadin/component-base": "24.8.0-alpha8",
41
- "@vaadin/field-base": "24.8.0-alpha8",
42
- "@vaadin/input-container": "24.8.0-alpha8",
43
- "@vaadin/vaadin-lumo-styles": "24.8.0-alpha8",
44
- "@vaadin/vaadin-material-styles": "24.8.0-alpha8",
45
- "@vaadin/vaadin-themable-mixin": "24.8.0-alpha8",
38
+ "@vaadin/a11y-base": "25.0.0-alpha1",
39
+ "@vaadin/component-base": "25.0.0-alpha1",
40
+ "@vaadin/field-base": "25.0.0-alpha1",
41
+ "@vaadin/input-container": "25.0.0-alpha1",
42
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha1",
43
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha1",
46
44
  "lit": "^3.0.0"
47
45
  },
48
46
  "devDependencies": {
49
- "@vaadin/chai-plugins": "24.8.0-alpha8",
50
- "@vaadin/test-runner-commands": "24.8.0-alpha8",
47
+ "@vaadin/chai-plugins": "25.0.0-alpha1",
48
+ "@vaadin/test-runner-commands": "25.0.0-alpha1",
51
49
  "@vaadin/testing-helpers": "^1.1.0",
52
50
  "sinon": "^18.0.0"
53
51
  },
@@ -55,5 +53,5 @@
55
53
  "web-types.json",
56
54
  "web-types.lit.json"
57
55
  ],
58
- "gitHead": "d914bb8f669d7e3d1981feb8eac05688ab9870b4"
56
+ "gitHead": "b8c22a4a0c64156210d0daac96b43ae4e5526d49"
59
57
  }
@@ -8,7 +8,6 @@ import type { DelegateFocusMixinClass } from '@vaadin/a11y-base/src/delegate-foc
8
8
  import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js';
9
9
  import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
10
10
  import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
11
- import type { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
12
11
  import type { DelegateStateMixinClass } from '@vaadin/component-base/src/delegate-state-mixin.js';
13
12
  import type { SlotStylesMixinClass } from '@vaadin/component-base/src/slot-styles-mixin.js';
14
13
  import type { ClearButtonMixinClass } from '@vaadin/field-base/src/clear-button-mixin.js';
@@ -26,7 +25,6 @@ import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.j
26
25
  export declare function TextFieldMixin<T extends Constructor<HTMLElement>>(
27
26
  base: T,
28
27
  ): Constructor<ClearButtonMixinClass> &
29
- Constructor<ControllerMixinClass> &
30
28
  Constructor<DelegateFocusMixinClass> &
31
29
  Constructor<DelegateStateMixinClass> &
32
30
  Constructor<DisabledMixinClass> &
@@ -4,16 +4,16 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import '@vaadin/input-container/src/vaadin-input-container.js';
7
- import { html, PolymerElement } from '@polymer/polymer';
7
+ import { html, LitElement } from 'lit';
8
+ import { ifDefined } from 'lit/directives/if-defined.js';
8
9
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
10
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
11
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
12
  import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
11
13
  import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
12
- import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
14
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
15
  import { TextFieldMixin } from './vaadin-text-field-mixin.js';
14
16
 
15
- registerStyles('vaadin-text-field', inputFieldShared, { moduleId: 'vaadin-text-field-styles' });
16
-
17
17
  /**
18
18
  * `<vaadin-text-field>` is a web component that allows the user to input and edit text.
19
19
  *
@@ -83,30 +83,34 @@ registerStyles('vaadin-text-field', inputFieldShared, { moduleId: 'vaadin-text-f
83
83
  * @mixes ThemableMixin
84
84
  * @mixes TextFieldMixin
85
85
  */
86
- export class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(PolymerElement))) {
86
+ export class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
87
87
  static get is() {
88
88
  return 'vaadin-text-field';
89
89
  }
90
90
 
91
- static get template() {
91
+ static get styles() {
92
+ return [inputFieldShared];
93
+ }
94
+
95
+ /** @protected */
96
+ render() {
92
97
  return html`
93
98
  <div class="vaadin-field-container">
94
99
  <div part="label">
95
100
  <slot name="label"></slot>
96
- <span part="required-indicator" aria-hidden="true" on-click="focus"></span>
101
+ <span part="required-indicator" aria-hidden="true" @click="${this.focus}"></span>
97
102
  </div>
98
103
 
99
104
  <vaadin-input-container
100
105
  part="input-field"
101
- readonly="[[readonly]]"
102
- disabled="[[disabled]]"
103
- invalid="[[invalid]]"
104
- theme$="[[_theme]]"
106
+ .readonly="${this.readonly}"
107
+ .disabled="${this.disabled}"
108
+ .invalid="${this.invalid}"
109
+ theme="${ifDefined(this._theme)}"
105
110
  >
106
111
  <slot name="prefix" slot="prefix"></slot>
107
112
  <slot name="input"></slot>
108
- <slot name="suffix" slot="suffix"></slot>
109
- <div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
113
+ ${this._renderSuffix()}
110
114
  </vaadin-input-container>
111
115
 
112
116
  <div part="helper-text">
@@ -130,6 +134,14 @@ export class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(Polymer
130
134
  this._tooltipController.setAriaTarget(this.inputElement);
131
135
  this.addController(this._tooltipController);
132
136
  }
137
+
138
+ /** @protected */
139
+ _renderSuffix() {
140
+ return html`
141
+ <slot name="suffix" slot="suffix"></slot>
142
+ <div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
143
+ `;
144
+ }
133
145
  }
134
146
 
135
147
  defineCustomElement(TextField);
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.8.0-alpha8",
4
+ "version": "25.0.0-alpha1",
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/text-field",
4
- "version": "24.8.0-alpha8",
4
+ "version": "25.0.0-alpha1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -1,6 +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
- export * from './vaadin-text-field.js';
@@ -1,88 +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/input-container/src/vaadin-lit-input-container.js';
7
- import { html, LitElement } from 'lit';
8
- import { ifDefined } from 'lit/directives/if-defined.js';
9
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
10
- import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
11
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
12
- import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
13
- import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
14
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
15
- import { TextFieldMixin } from './vaadin-text-field-mixin.js';
16
-
17
- /**
18
- * LitElement based version of `<vaadin-text-field>` web component.
19
- *
20
- * ## Disclaimer
21
- *
22
- * This component is an experiment and not yet a part of Vaadin platform.
23
- * There is no ETA regarding specific Vaadin version where it'll land.
24
- * Feel free to try this code in your apps as per Apache 2.0 license.
25
- */
26
- export class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
27
- static get is() {
28
- return 'vaadin-text-field';
29
- }
30
-
31
- static get styles() {
32
- return [inputFieldShared];
33
- }
34
-
35
- /** @protected */
36
- render() {
37
- return html`
38
- <div class="vaadin-field-container">
39
- <div part="label">
40
- <slot name="label"></slot>
41
- <span part="required-indicator" aria-hidden="true" @click="${this.focus}"></span>
42
- </div>
43
-
44
- <vaadin-input-container
45
- part="input-field"
46
- .readonly="${this.readonly}"
47
- .disabled="${this.disabled}"
48
- .invalid="${this.invalid}"
49
- theme="${ifDefined(this._theme)}"
50
- >
51
- <slot name="prefix" slot="prefix"></slot>
52
- <slot name="input"></slot>
53
- ${this._renderSuffix()}
54
- </vaadin-input-container>
55
-
56
- <div part="helper-text">
57
- <slot name="helper"></slot>
58
- </div>
59
-
60
- <div part="error-message">
61
- <slot name="error-message"></slot>
62
- </div>
63
- </div>
64
-
65
- <slot name="tooltip"></slot>
66
- `;
67
- }
68
-
69
- /** @protected */
70
- ready() {
71
- super.ready();
72
-
73
- this._tooltipController = new TooltipController(this);
74
- this._tooltipController.setPosition('top');
75
- this._tooltipController.setAriaTarget(this.inputElement);
76
- this.addController(this._tooltipController);
77
- }
78
-
79
- /** @protected */
80
- _renderSuffix() {
81
- return html`
82
- <slot name="suffix" slot="suffix"></slot>
83
- <div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
84
- `;
85
- }
86
- }
87
-
88
- defineCustomElement(TextField);
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 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-styles.js';
7
- import '../../src/vaadin-lit-text-field.js';
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 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-styles.js';
7
- import '../../src/vaadin-lit-text-field.js';
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 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-styles.js';
7
- import '../../src/vaadin-lit-text-field.js';
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 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-styles.js';
7
- import '../../src/vaadin-lit-text-field.js';
@@ -1,6 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2025 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/theme/material/vaadin-input-container-styles.js';
@@ -1,12 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2025 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/theme/material/vaadin-input-container-styles.js';
7
- import { inputFieldShared } from '@vaadin/vaadin-material-styles/mixins/input-field-shared.js';
8
- import { registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
9
-
10
- registerStyles('vaadin-text-field', inputFieldShared, {
11
- moduleId: 'material-text-field-styles',
12
- });
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 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-styles.js';
7
- import '../../src/vaadin-text-field.js';
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 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-styles.js';
7
- import '../../src/vaadin-text-field.js';
@@ -1 +0,0 @@
1
- export * from './src/vaadin-text-field.js';
@@ -1,3 +0,0 @@
1
- import './theme/lumo/vaadin-lit-text-field.js';
2
-
3
- export * from './src/vaadin-lit-text-field.js';