@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
|
-
#
|
|
1
|
+
# @vaadin/form-layout
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
[
|
|
5
|
+
[Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/form-layout)
|
|
8
6
|
|
|
9
7
|
[](https://www.npmjs.com/package/@vaadin/form-layout)
|
|
10
|
-
[](https://vaadin.com/directory/component/vaadinvaadin-form-layout)
|
|
11
8
|
[](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/
|
|
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
|
|
22
|
+
Install the component:
|
|
26
23
|
|
|
27
24
|
```sh
|
|
28
|
-
npm i @vaadin/form-layout
|
|
25
|
+
npm i @vaadin/form-layout
|
|
29
26
|
```
|
|
30
27
|
|
|
31
|
-
Once installed, import
|
|
28
|
+
Once installed, import the component in your application:
|
|
32
29
|
|
|
33
30
|
```js
|
|
34
|
-
import '@vaadin/form-layout
|
|
31
|
+
import '@vaadin/form-layout';
|
|
35
32
|
```
|
|
36
33
|
|
|
37
|
-
##
|
|
34
|
+
## Themes
|
|
38
35
|
|
|
39
|
-
Vaadin components
|
|
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
|
|
39
|
+
To use the Material theme, import the component from the `theme/material` folder:
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
45
|
+
You can also import the Lumo version of the component explicitly:
|
|
51
46
|
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
```js
|
|
48
|
+
import '@vaadin/form-layout/theme/lumo/vaadin-form-layout.js';
|
|
49
|
+
```
|
|
54
50
|
|
|
55
|
-
-
|
|
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
|
-
|
|
59
|
-
|
|
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
|
|
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
|
|
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
|
|
38
|
-
"@vaadin/vaadin-lumo-styles": "22.0.0
|
|
39
|
-
"@vaadin/vaadin-material-styles": "22.0.0
|
|
40
|
-
"@vaadin/vaadin-themable-mixin": "22.0.0
|
|
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.
|
|
45
|
-
"@vaadin/text-field": "22.0.0
|
|
44
|
+
"@vaadin/testing-helpers": "^0.3.2",
|
|
45
|
+
"@vaadin/text-field": "^22.0.0",
|
|
46
46
|
"sinon": "^9.2.1"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "b668e9b1a975227fbe34beb70d1cd5b03dce2348"
|
|
49
49
|
}
|
package/src/vaadin-form-item.js
CHANGED
|
@@ -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 {
|
|
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 {
|
|
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 {
|
|
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',
|