@vaadin/custom-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
@@ -30,29 +30,6 @@ Once installed, import the component in your application:
30
30
  import '@vaadin/custom-field';
31
31
  ```
32
32
 
33
- ## Themes
34
-
35
- Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
36
- The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/custom-field/vaadin-custom-field.js) of the package uses the Lumo theme.
37
-
38
- To use the Material theme, import the component from the `theme/material` folder:
39
-
40
- ```js
41
- import '@vaadin/custom-field/theme/material/vaadin-custom-field.js';
42
- ```
43
-
44
- You can also import the Lumo version of the component explicitly:
45
-
46
- ```js
47
- import '@vaadin/custom-field/theme/lumo/vaadin-custom-field.js';
48
- ```
49
-
50
- Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
51
-
52
- ```js
53
- import '@vaadin/custom-field/src/vaadin-custom-field.js';
54
- ```
55
-
56
33
  ## Contributing
57
34
 
58
35
  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/custom-field",
3
- "version": "24.8.0-alpha8",
3
+ "version": "25.0.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,34 +35,32 @@
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/vaadin-lumo-styles": "24.8.0-alpha8",
43
- "@vaadin/vaadin-material-styles": "24.8.0-alpha8",
44
- "@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/vaadin-lumo-styles": "25.0.0-alpha1",
42
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha1",
45
43
  "lit": "^3.0.0"
46
44
  },
47
45
  "devDependencies": {
48
- "@vaadin/chai-plugins": "24.8.0-alpha8",
49
- "@vaadin/combo-box": "24.8.0-alpha8",
50
- "@vaadin/date-picker": "24.8.0-alpha8",
51
- "@vaadin/email-field": "24.8.0-alpha8",
52
- "@vaadin/form-layout": "24.8.0-alpha8",
53
- "@vaadin/number-field": "24.8.0-alpha8",
54
- "@vaadin/password-field": "24.8.0-alpha8",
55
- "@vaadin/select": "24.8.0-alpha8",
56
- "@vaadin/test-runner-commands": "24.8.0-alpha8",
46
+ "@vaadin/chai-plugins": "25.0.0-alpha1",
47
+ "@vaadin/combo-box": "25.0.0-alpha1",
48
+ "@vaadin/date-picker": "25.0.0-alpha1",
49
+ "@vaadin/email-field": "25.0.0-alpha1",
50
+ "@vaadin/form-layout": "25.0.0-alpha1",
51
+ "@vaadin/number-field": "25.0.0-alpha1",
52
+ "@vaadin/password-field": "25.0.0-alpha1",
53
+ "@vaadin/select": "25.0.0-alpha1",
54
+ "@vaadin/test-runner-commands": "25.0.0-alpha1",
57
55
  "@vaadin/testing-helpers": "^1.1.0",
58
- "@vaadin/text-area": "24.8.0-alpha8",
59
- "@vaadin/text-field": "24.8.0-alpha8",
60
- "@vaadin/time-picker": "24.8.0-alpha8",
56
+ "@vaadin/text-area": "25.0.0-alpha1",
57
+ "@vaadin/text-field": "25.0.0-alpha1",
58
+ "@vaadin/time-picker": "25.0.0-alpha1",
61
59
  "sinon": "^18.0.0"
62
60
  },
63
61
  "web-types": [
64
62
  "web-types.json",
65
63
  "web-types.lit.json"
66
64
  ],
67
- "gitHead": "d914bb8f669d7e3d1981feb8eac05688ab9870b4"
65
+ "gitHead": "b8c22a4a0c64156210d0daac96b43ae4e5526d49"
68
66
  }
@@ -3,15 +3,14 @@
3
3
  * Copyright (c) 2019 - 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 { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
6
+ import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
9
- import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
9
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10
11
  import { CustomFieldMixin } from './vaadin-custom-field-mixin.js';
11
12
  import { customFieldStyles } from './vaadin-custom-field-styles.js';
12
13
 
13
- registerStyles('vaadin-custom-field', customFieldStyles, { moduleId: 'vaadin-custom-field-styles' });
14
-
15
14
  /**
16
15
  * `<vaadin-custom-field>` is a web component for wrapping multiple components as a single field.
17
16
  *
@@ -61,20 +60,25 @@ registerStyles('vaadin-custom-field', customFieldStyles, { moduleId: 'vaadin-cus
61
60
  * @mixes ElementMixin
62
61
  * @mixes ThemableMixin
63
62
  */
64
- class CustomField extends CustomFieldMixin(ThemableMixin(ElementMixin(PolymerElement))) {
63
+ class CustomField extends CustomFieldMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
65
64
  static get is() {
66
65
  return 'vaadin-custom-field';
67
66
  }
68
67
 
69
- static get template() {
68
+ static get styles() {
69
+ return customFieldStyles;
70
+ }
71
+
72
+ /** @protected */
73
+ render() {
70
74
  return html`
71
75
  <div class="vaadin-custom-field-container">
72
- <div part="label" on-click="focus">
76
+ <div part="label" @click="${this.focus}">
73
77
  <slot name="label"></slot>
74
78
  <span part="required-indicator" aria-hidden="true"></span>
75
79
  </div>
76
80
 
77
- <div class="inputs-wrapper" part="input-fields" on-change="_onInputChange">
81
+ <div class="inputs-wrapper" part="input-fields" @change="${this._onInputChange}">
78
82
  <slot id="slot"></slot>
79
83
  </div>
80
84
 
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/custom-field",
4
- "version": "24.8.0-alpha8",
4
+ "version": "25.0.0-alpha1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -111,7 +111,7 @@
111
111
  },
112
112
  {
113
113
  "name": "value",
114
- "description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha8/#/elements/vaadin-custom-field#property-formatValue)\nand [`parseValue`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha8/#/elements/vaadin-custom-field#property-parseValue)\nproperties to customize this behavior.",
114
+ "description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha1/#/elements/vaadin-custom-field#property-formatValue)\nand [`parseValue`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha1/#/elements/vaadin-custom-field#property-parseValue)\nproperties to customize this behavior.",
115
115
  "value": {
116
116
  "type": [
117
117
  "string",
@@ -235,7 +235,7 @@
235
235
  },
236
236
  {
237
237
  "name": "value",
238
- "description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha8/#/elements/vaadin-custom-field#property-formatValue)\nand [`parseValue`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha8/#/elements/vaadin-custom-field#property-parseValue)\nproperties to customize this behavior.",
238
+ "description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha1/#/elements/vaadin-custom-field#property-formatValue)\nand [`parseValue`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha1/#/elements/vaadin-custom-field#property-parseValue)\nproperties to customize this behavior.",
239
239
  "value": {
240
240
  "type": [
241
241
  "string",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/custom-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": {
@@ -84,7 +84,7 @@
84
84
  },
85
85
  {
86
86
  "name": ".value",
87
- "description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha8/#/elements/vaadin-custom-field#property-formatValue)\nand [`parseValue`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha8/#/elements/vaadin-custom-field#property-parseValue)\nproperties to customize this behavior.",
87
+ "description": "The value of the field. When wrapping several inputs, it will contain `\\t`\n(Tab character) as a delimiter indicating parts intended to be used as the\ncorresponding inputs values.\nUse the [`formatValue`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha1/#/elements/vaadin-custom-field#property-formatValue)\nand [`parseValue`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha1/#/elements/vaadin-custom-field#property-parseValue)\nproperties to customize this behavior.",
88
88
  "value": {
89
89
  "kind": "expression"
90
90
  }
@@ -1,6 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2019 - 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-custom-field.js';
@@ -1,67 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2019 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { html, LitElement } from 'lit';
7
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
- import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
9
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
- import { CustomFieldMixin } from './vaadin-custom-field-mixin.js';
12
- import { customFieldStyles } from './vaadin-custom-field-styles.js';
13
-
14
- /**
15
- * LitElement based version of `<vaadin-custom-field>` web component.
16
- *
17
- * ## Disclaimer
18
- *
19
- * This component is an experiment and not yet a part of Vaadin platform.
20
- * There is no ETA regarding specific Vaadin version where it'll land.
21
- * Feel free to try this code in your apps as per Apache 2.0 license.
22
- */
23
- class CustomField extends CustomFieldMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
24
- static get is() {
25
- return 'vaadin-custom-field';
26
- }
27
-
28
- static get styles() {
29
- return customFieldStyles;
30
- }
31
-
32
- /** @protected */
33
- render() {
34
- return html`
35
- <div class="vaadin-custom-field-container">
36
- <div part="label" @click="${this.focus}">
37
- <slot name="label"></slot>
38
- <span part="required-indicator" aria-hidden="true"></span>
39
- </div>
40
-
41
- <div class="inputs-wrapper" part="input-fields" @change="${this._onInputChange}">
42
- <slot id="slot"></slot>
43
- </div>
44
-
45
- <div part="helper-text">
46
- <slot name="helper"></slot>
47
- </div>
48
-
49
- <div part="error-message">
50
- <slot name="error-message"></slot>
51
- </div>
52
- </div>
53
-
54
- <slot name="tooltip"></slot>
55
- `;
56
- }
57
-
58
- /**
59
- * Fired when the user commits a value change for any of the internal inputs.
60
- *
61
- * @event change
62
- */
63
- }
64
-
65
- defineCustomElement(CustomField);
66
-
67
- export { CustomField };
@@ -1,2 +0,0 @@
1
- import './vaadin-custom-field-styles.js';
2
- import '../../src/vaadin-lit-custom-field.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-custom-field-styles.js';
2
- import '../../src/vaadin-lit-custom-field.js';
@@ -1,9 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2019 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import '@vaadin/vaadin-material-styles/color.js';
7
- import '@vaadin/vaadin-material-styles/typography.js';
8
- declare const customField: import("lit").CSSResult;
9
- export { customField };
@@ -1,51 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2019 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import '@vaadin/vaadin-material-styles/color.js';
7
- import '@vaadin/vaadin-material-styles/typography.js';
8
- import { helper } from '@vaadin/vaadin-material-styles/mixins/helper.js';
9
- import { requiredField } from '@vaadin/vaadin-material-styles/mixins/required-field.js';
10
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
-
12
- const customField = css`
13
- :host {
14
- display: inline-flex;
15
- position: relative;
16
- margin-bottom: 8px;
17
- outline: none;
18
- color: var(--material-body-text-color);
19
- font-size: var(--material-body-font-size);
20
- font-family: var(--material-font-family);
21
- line-height: 48px;
22
- -webkit-font-smoothing: antialiased;
23
- -moz-osx-font-smoothing: grayscale;
24
- }
25
-
26
- /* align with text-field label */
27
- :host([has-label]) {
28
- padding-top: 16px;
29
- }
30
-
31
- /* align with text-field error message */
32
- :host([has-error-message]) [part='error-message'],
33
- :host([has-helper]) [part='helper-text'] {
34
- margin-top: -8px;
35
- }
36
-
37
- :host([disabled]) [part='label'] {
38
- color: var(--material-disabled-text-color);
39
- -webkit-text-fill-color: var(--material-disabled-text-color);
40
- }
41
-
42
- :host([focused]:not([invalid])) [part='label'] {
43
- color: var(--material-primary-text-color);
44
- }
45
- `;
46
-
47
- registerStyles('vaadin-custom-field', [requiredField, helper, customField], {
48
- moduleId: 'material-custom-field',
49
- });
50
-
51
- export { customField };
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2019 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import './vaadin-custom-field-styles.js';
7
- import '../../src/vaadin-custom-field.js';
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2019 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import './vaadin-custom-field-styles.js';
7
- import '../../src/vaadin-custom-field.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-custom-field-styles.js';
2
- import '../../src/vaadin-lit-custom-field.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-custom-field-styles.js';
2
- import '../../src/vaadin-lit-custom-field.js';
@@ -1 +0,0 @@
1
- export * from './src/vaadin-custom-field.js';
@@ -1,3 +0,0 @@
1
- import './theme/lumo/vaadin-lit-custom-field.js';
2
-
3
- export * from './src/vaadin-lit-custom-field.js';