@vaadin/custom-field 22.0.0-beta1 → 22.0.1

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
@@ -1,5 +1,66 @@
1
1
  # @vaadin/custom-field
2
2
 
3
- > ⚠️ Work in progress, please do not use this component yet.
3
+ A web component for wrapping multiple components as a single field.
4
4
 
5
- The new version of `vaadin-custom-field` component.
5
+ [Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/custom-field)
6
+
7
+ [![npm version](https://badgen.net/npm/v/@vaadin/custom-field)](https://www.npmjs.com/package/@vaadin/custom-field)
8
+ [![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](https://discord.gg/PHmkCKC)
9
+
10
+ ```html
11
+ <vaadin-custom-field label="Enrollment period" helper-text="Cannot be longer than 30 days" required>
12
+ <vaadin-date-picker id="start" placeholder="Start date"></vaadin-date-picker>
13
+ &ndash;
14
+ <vaadin-date-picker id="end" placeholder="End date"></vaadin-date-picker>
15
+ </vaadin-custom-field>
16
+ ```
17
+
18
+ [<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/custom-field/screenshot.png" width="401" alt="Screenshot of vaadin-custom-field">](https://vaadin.com/docs/latest/ds/components/custom-field)
19
+
20
+ ## Installation
21
+
22
+ Install the component:
23
+
24
+ ```sh
25
+ npm i @vaadin/custom-field
26
+ ```
27
+
28
+ Once installed, import the component in your application:
29
+
30
+ ```js
31
+ import '@vaadin/custom-field';
32
+ ```
33
+
34
+ ## Themes
35
+
36
+ Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes), Lumo and Material.
37
+ The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/custom-field/vaadin-custom-field.js) of the package uses the Lumo theme.
38
+
39
+ To use the Material theme, import the component from the `theme/material` folder:
40
+
41
+ ```js
42
+ import '@vaadin/custom-field/theme/material/vaadin-custom-field.js';
43
+ ```
44
+
45
+ You can also import the Lumo version of the component explicitly:
46
+
47
+ ```js
48
+ import '@vaadin/custom-field/theme/lumo/vaadin-custom-field.js';
49
+ ```
50
+
51
+ Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
52
+
53
+ ```js
54
+ import '@vaadin/custom-field/src/vaadin-custom-field.js';
55
+ ```
56
+
57
+ ## Contributing
58
+
59
+ Read the [contributing guide](https://vaadin.com/docs/latest/guide/contributing/overview) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
60
+
61
+ ## License
62
+
63
+ Apache License 2.0
64
+
65
+ Vaadin collects usage statistics at development time to improve this product.
66
+ For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/custom-field",
3
- "version": "22.0.0-beta1",
3
+ "version": "22.0.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -32,28 +32,28 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "@polymer/polymer": "^3.0.0",
35
- "@vaadin/component-base": "22.0.0-beta1",
36
- "@vaadin/field-base": "22.0.0-beta1",
37
- "@vaadin/vaadin-lumo-styles": "22.0.0-beta1",
38
- "@vaadin/vaadin-material-styles": "22.0.0-beta1",
39
- "@vaadin/vaadin-themable-mixin": "22.0.0-beta1"
35
+ "@vaadin/component-base": "^22.0.1",
36
+ "@vaadin/field-base": "^22.0.1",
37
+ "@vaadin/vaadin-lumo-styles": "^22.0.1",
38
+ "@vaadin/vaadin-material-styles": "^22.0.1",
39
+ "@vaadin/vaadin-themable-mixin": "^22.0.1"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@esm-bundle/chai": "^4.3.4",
43
- "@vaadin/combo-box": "22.0.0-beta1",
44
- "@vaadin/date-picker": "22.0.0-beta1",
45
- "@vaadin/email-field": "22.0.0-beta1",
46
- "@vaadin/form-layout": "22.0.0-beta1",
47
- "@vaadin/list-box": "22.0.0-beta1",
48
- "@vaadin/number-field": "22.0.0-beta1",
49
- "@vaadin/password-field": "22.0.0-beta1",
50
- "@vaadin/polymer-legacy-adapter": "22.0.0-beta1",
51
- "@vaadin/select": "22.0.0-beta1",
52
- "@vaadin/testing-helpers": "^0.3.0",
53
- "@vaadin/text-area": "22.0.0-beta1",
54
- "@vaadin/text-field": "22.0.0-beta1",
55
- "@vaadin/time-picker": "22.0.0-beta1",
43
+ "@vaadin/combo-box": "^22.0.1",
44
+ "@vaadin/date-picker": "^22.0.1",
45
+ "@vaadin/email-field": "^22.0.1",
46
+ "@vaadin/form-layout": "^22.0.1",
47
+ "@vaadin/list-box": "^22.0.1",
48
+ "@vaadin/number-field": "^22.0.1",
49
+ "@vaadin/password-field": "^22.0.1",
50
+ "@vaadin/polymer-legacy-adapter": "^22.0.1",
51
+ "@vaadin/select": "^22.0.1",
52
+ "@vaadin/testing-helpers": "^0.3.2",
53
+ "@vaadin/text-area": "^22.0.1",
54
+ "@vaadin/text-field": "^22.0.1",
55
+ "@vaadin/time-picker": "^22.0.1",
56
56
  "sinon": "^9.2.1"
57
57
  },
58
- "gitHead": "4cf8a9d0504994200c610e44b3676114fef49c1e"
58
+ "gitHead": "2b0a2bff0369d6020f7cc33ad35506aa2d1f6f68"
59
59
  }
@@ -3,8 +3,9 @@
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
6
  import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
7
+ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
8
+ import { isChrome } from '@vaadin/component-base/src/browser-utils.js';
8
9
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
9
10
  import { FocusMixin } from '@vaadin/component-base/src/focus-mixin.js';
10
11
  import { FieldMixin } from '@vaadin/field-base/src/field-mixin.js';
@@ -188,14 +189,6 @@ class CustomField extends FieldMixin(FocusMixin(ThemableMixin(ElementMixin(Polym
188
189
  };
189
190
  }
190
191
 
191
- /**
192
- * Attribute used by `FieldMixin` to set accessible name.
193
- * @protected
194
- */
195
- get _ariaAttr() {
196
- return 'aria-labelledby';
197
- }
198
-
199
192
  /** @protected */
200
193
  connectedCallback() {
201
194
  super.connectedCallback();
@@ -279,7 +272,6 @@ class CustomField extends FieldMixin(FocusMixin(ThemableMixin(ElementMixin(Polym
279
272
 
280
273
  /** @private */
281
274
  __fixChromeFocus() {
282
- const isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
283
275
  this.addEventListener('keydown', (e) => {
284
276
  if (e.keyCode === 9) {
285
277
  // FIXME(yuriy): remove this workaround once this issue is fixed:
@@ -3,13 +3,13 @@
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 { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
7
6
  import '@vaadin/vaadin-lumo-styles/color.js';
8
7
  import '@vaadin/vaadin-lumo-styles/sizing.js';
9
8
  import '@vaadin/vaadin-lumo-styles/spacing.js';
10
9
  import '@vaadin/vaadin-lumo-styles/typography.js';
11
10
  import { helper } from '@vaadin/vaadin-lumo-styles/mixins/helper.js';
12
11
  import { requiredField } from '@vaadin/vaadin-lumo-styles/mixins/required-field.js';
12
+ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
13
 
14
14
  const customField = css`
15
15
  :host {
@@ -3,11 +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 { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
7
6
  import '@vaadin/vaadin-material-styles/color.js';
8
7
  import '@vaadin/vaadin-material-styles/typography.js';
9
8
  import { helper } from '@vaadin/vaadin-material-styles/mixins/helper.js';
10
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
11
 
12
12
  const customField = css`
13
13
  :host {