@vaadin/form-layout 22.0.0-alpha9 → 22.0.0

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,13 +1,10 @@
1
- # <vaadin-form-layout>
1
+ # @vaadin/form-layout
2
2
 
3
- [Live Demo ↗](https://vaadin.com/components/vaadin-form-layout/html-examples)
4
- |
5
- [API documentation ↗](https://vaadin.com/components/vaadin-form-layout/html-api)
3
+ A web component for building responsive forms with multiple columns.
6
4
 
7
- [<vaadin-form-layout>](https://vaadin.com/components/vaadin-form-layout) is a Web Component providing configurable responsive layout for form elements, part of the [Vaadin components](https://vaadin.com/components).
5
+ [Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/form-layout)
8
6
 
9
7
  [![npm version](https://badgen.net/npm/v/@vaadin/form-layout)](https://www.npmjs.com/package/@vaadin/form-layout)
10
- [![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-form-layout)
11
8
  [![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](https://discord.gg/PHmkCKC)
12
9
 
13
10
  ```html
@@ -18,45 +15,44 @@
18
15
  </vaadin-form-layout>
19
16
  ```
20
17
 
21
- [<img src="https://raw.githubusercontent.com/vaadin/vaadin-form-layout/master/screenshot.png" width="880" alt="Screenshot of vaadin-form-layout">](https://vaadin.com/components/vaadin-form-layout)
18
+ [<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/form-layout/screenshot.png" width="880" alt="Screenshot of vaadin-form-layout">](https://vaadin.com/docs/latest/ds/components/form-layout)
22
19
 
23
20
  ## Installation
24
21
 
25
- Install `vaadin-form-layout`:
22
+ Install the component:
26
23
 
27
24
  ```sh
28
- npm i @vaadin/form-layout --save
25
+ npm i @vaadin/form-layout
29
26
  ```
30
27
 
31
- Once installed, import it in your application:
28
+ Once installed, import the component in your application:
32
29
 
33
30
  ```js
34
- import '@vaadin/form-layout/vaadin-form-layout.js';
31
+ import '@vaadin/form-layout';
35
32
  ```
36
33
 
37
- ## Getting started
34
+ ## Themes
38
35
 
39
- Vaadin components use the Lumo theme by default.
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/form-layout/vaadin-form-layout.js) of the package uses the Lumo theme.
40
38
 
41
- To use the Material theme, import the correspondent file from the `theme/material` folder.
39
+ To use the Material theme, import the component from the `theme/material` folder:
42
40
 
43
- ## Entry points
44
-
45
- - The components with the Lumo theme:
46
-
47
- `theme/lumo/vaadin-form-layout.js`
48
- `theme/lumo/vaadin-form-item.js`
41
+ ```js
42
+ import '@vaadin/form-layout/theme/material/vaadin-form-layout.js';
43
+ ```
49
44
 
50
- - The components with the Material theme:
45
+ You can also import the Lumo version of the component explicitly:
51
46
 
52
- `theme/material/vaadin-form-layout.js`
53
- `theme/material/vaadin-form-item.js`
47
+ ```js
48
+ import '@vaadin/form-layout/theme/lumo/vaadin-form-layout.js';
49
+ ```
54
50
 
55
- - Alias for `theme/lumo/vaadin-form-layout.js`
56
- `theme/lumo/vaadin-form-item.js`:
51
+ Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
57
52
 
58
- `vaadin-form-layout.js`
59
- `vaadin-form-item.js`
53
+ ```js
54
+ import '@vaadin/form-layout/src/vaadin-form-layout.js';
55
+ ```
60
56
 
61
57
  ## Contributing
62
58
 
@@ -66,4 +62,5 @@ Read the [contributing guide](https://vaadin.com/docs/latest/guide/contributing/
66
62
 
67
63
  Apache License 2.0
68
64
 
69
- Vaadin collects development time usage statistics to improve this product. For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
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/form-layout",
3
- "version": "22.0.0-alpha9",
3
+ "version": "22.0.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -34,16 +34,16 @@
34
34
  "dependencies": {
35
35
  "@polymer/iron-resizable-behavior": "^3.0.0",
36
36
  "@polymer/polymer": "^3.0.0",
37
- "@vaadin/component-base": "22.0.0-alpha9",
38
- "@vaadin/vaadin-lumo-styles": "22.0.0-alpha9",
39
- "@vaadin/vaadin-material-styles": "22.0.0-alpha9",
40
- "@vaadin/vaadin-themable-mixin": "22.0.0-alpha9"
37
+ "@vaadin/component-base": "^22.0.0",
38
+ "@vaadin/vaadin-lumo-styles": "^22.0.0",
39
+ "@vaadin/vaadin-material-styles": "^22.0.0",
40
+ "@vaadin/vaadin-themable-mixin": "^22.0.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@esm-bundle/chai": "^4.3.4",
44
- "@vaadin/testing-helpers": "^0.3.0",
45
- "@vaadin/text-field": "22.0.0-alpha9",
44
+ "@vaadin/testing-helpers": "^0.3.2",
45
+ "@vaadin/text-field": "^22.0.0",
46
46
  "sinon": "^9.2.1"
47
47
  },
48
- "gitHead": "6e8c899dc65918f97e3c0acb2076122c4b2ef274"
48
+ "gitHead": "b668e9b1a975227fbe34beb70d1cd5b03dce2348"
49
49
  }
@@ -3,7 +3,7 @@
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';
6
+ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
7
7
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
8
 
9
9
  /**
@@ -109,13 +109,7 @@ class FormItem extends ThemableMixin(PolymerElement) {
109
109
  display: inline-flex;
110
110
  flex-direction: row;
111
111
  align-items: baseline;
112
-
113
- /* CSS API for host */
114
- --vaadin-form-item-label-width: 8em;
115
- --vaadin-form-item-label-spacing: 1em;
116
- --vaadin-form-item-row-spacing: 1em;
117
-
118
- margin: calc(0.5 * var(--vaadin-form-item-row-spacing)) 0;
112
+ margin: calc(0.5 * var(--vaadin-form-item-row-spacing, 1em)) 0;
119
113
  }
120
114
 
121
115
  :host([label-position='top']) {
@@ -128,7 +122,7 @@ class FormItem extends ThemableMixin(PolymerElement) {
128
122
  }
129
123
 
130
124
  #label {
131
- width: var(--vaadin-form-item-label-width);
125
+ width: var(--vaadin-form-item-label-width, 8em);
132
126
  flex: 0 0 auto;
133
127
  }
134
128
 
@@ -137,7 +131,7 @@ class FormItem extends ThemableMixin(PolymerElement) {
137
131
  }
138
132
 
139
133
  #spacing {
140
- width: var(--vaadin-form-item-label-spacing);
134
+ width: var(--vaadin-form-item-label-spacing, 1em);
141
135
  flex: 0 0 auto;
142
136
  }
143
137
 
@@ -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 { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
7
- import { beforeNextRender } from '@polymer/polymer/lib/utils/render-status.js';
6
+ import { IronResizableBehavior } from '@polymer/iron-resizable-behavior/iron-resizable-behavior.js';
8
7
  import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js';
9
8
  import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
10
- import { IronResizableBehavior } from '@polymer/iron-resizable-behavior/iron-resizable-behavior.js';
9
+ import { beforeNextRender } from '@polymer/polymer/lib/utils/render-status.js';
10
+ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
11
11
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
12
12
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
13
 
@@ -114,6 +114,9 @@ class FormLayout extends ElementMixin(ThemableMixin(mixinBehaviors([IronResizabl
114
114
  max-width: 100%;
115
115
  animation: 1ms vaadin-form-layout-appear;
116
116
  /* CSS API for host */
117
+ --vaadin-form-item-label-width: 8em;
118
+ --vaadin-form-item-label-spacing: 1em;
119
+ --vaadin-form-item-row-spacing: 1em;
117
120
  --vaadin-form-layout-column-spacing: 2em; /* (default) */
118
121
  align-self: stretch;
119
122
  }
@@ -1,8 +1,8 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
1
  import '@vaadin/vaadin-lumo-styles/color.js';
3
2
  import '@vaadin/vaadin-lumo-styles/spacing.js';
4
3
  import '@vaadin/vaadin-lumo-styles/style.js';
5
4
  import '@vaadin/vaadin-lumo-styles/typography.js';
5
+ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
6
6
 
7
7
  registerStyles(
8
8
  'vaadin-form-item',
@@ -1,5 +1,5 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
1
  import '@vaadin/vaadin-lumo-styles/spacing.js';
2
+ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
3
3
 
4
4
  registerStyles(
5
5
  'vaadin-form-layout',
@@ -1,6 +1,6 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
1
  import '@vaadin/vaadin-material-styles/color.js';
3
2
  import '@vaadin/vaadin-material-styles/typography.js';
3
+ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
4
4
 
5
5
  registerStyles(
6
6
  'vaadin-form-item',