@vaadin/horizontal-layout 25.0.0-alpha7 → 25.0.0-alpha9
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/package.json +9 -7
- package/src/styles/vaadin-horizontal-layout-base-styles.d.ts +8 -0
- package/src/styles/vaadin-horizontal-layout-base-styles.js +69 -0
- package/src/vaadin-horizontal-layout.d.ts +1 -1
- package/src/vaadin-horizontal-layout.js +2 -2
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/horizontal-layout",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha9",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
+
"!src/styles/*-base-styles.d.ts",
|
|
25
|
+
"!src/styles/*-base-styles.js",
|
|
24
26
|
"theme",
|
|
25
27
|
"vaadin-*.d.ts",
|
|
26
28
|
"vaadin-*.js",
|
|
@@ -35,19 +37,19 @@
|
|
|
35
37
|
],
|
|
36
38
|
"dependencies": {
|
|
37
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/component-base": "25.0.0-
|
|
39
|
-
"@vaadin/vaadin-lumo-styles": "25.0.0-
|
|
40
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-
|
|
40
|
+
"@vaadin/component-base": "25.0.0-alpha9",
|
|
41
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha9",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha9",
|
|
41
43
|
"lit": "^3.0.0"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
45
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
46
|
+
"@vaadin/chai-plugins": "25.0.0-alpha9",
|
|
47
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha9",
|
|
46
48
|
"@vaadin/testing-helpers": "^2.0.0"
|
|
47
49
|
},
|
|
48
50
|
"web-types": [
|
|
49
51
|
"web-types.json",
|
|
50
52
|
"web-types.lit.json"
|
|
51
53
|
],
|
|
52
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "bbe4720721e0955ffc87a79b412bee38b1f0eb1e"
|
|
53
55
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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/component-base/src/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
|
|
9
|
+
export const baseStyles = css`
|
|
10
|
+
:host {
|
|
11
|
+
display: flex;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host([hidden]) {
|
|
16
|
+
display: none !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Theme variations */
|
|
20
|
+
:host([theme~='margin']) {
|
|
21
|
+
margin: var(--vaadin-horizontal-layout-margin, var(--vaadin-padding));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host([theme~='padding']) {
|
|
25
|
+
padding: var(--vaadin-horizontal-layout-margin, var(--vaadin-padding));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host([theme~='spacing']) {
|
|
29
|
+
gap: var(--vaadin-horizontal-layout-gap, var(--vaadin-gap-container-inline));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([theme~='wrap']) {
|
|
33
|
+
flex-wrap: wrap;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:host([has-end]:not([has-middle])) ::slotted([last-start-child]) {
|
|
37
|
+
margin-inline-end: auto;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
::slotted([first-middle-child]) {
|
|
41
|
+
margin-inline-start: auto;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
::slotted([last-middle-child]) {
|
|
45
|
+
margin-inline-end: auto;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:host(:not([has-middle])) ::slotted([first-end-child]) {
|
|
49
|
+
margin-inline-start: auto;
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
// Layout improvements are part of a feature for Flow users where children that have been configured to use full size
|
|
54
|
+
// using `HasSize.setSizeFull()` and others, get additional styles so that they effectively take the remaining space in
|
|
55
|
+
// the layout, rather than explicitly use 100% width/height. The respective data attributes are set by Flow's `HasSize`
|
|
56
|
+
// class.
|
|
57
|
+
const enableLayoutImprovements = window.Vaadin.featureFlags.layoutComponentImprovements;
|
|
58
|
+
const layoutImprovementStyles = css`
|
|
59
|
+
::slotted([data-width-full]) {
|
|
60
|
+
flex: 1;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
::slotted(vaadin-horizontal-layout[data-width-full]),
|
|
64
|
+
::slotted(vaadin-vertical-layout[data-width-full]) {
|
|
65
|
+
min-width: 0;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
export const horizontalLayoutStyles = enableLayoutImprovements ? [baseStyles, layoutImprovementStyles] : [baseStyles];
|
|
@@ -10,7 +10,7 @@ import { HorizontalLayoutMixin } from './vaadin-horizontal-layout-mixin.js';
|
|
|
10
10
|
/**
|
|
11
11
|
* `<vaadin-horizontal-layout>` provides a simple way to horizontally align your HTML elements.
|
|
12
12
|
*
|
|
13
|
-
* ```
|
|
13
|
+
* ```html
|
|
14
14
|
* <vaadin-horizontal-layout>
|
|
15
15
|
* <div>Item 1</div>
|
|
16
16
|
* <div>Item 2</div>
|
|
@@ -15,7 +15,7 @@ import { HorizontalLayoutMixin } from './vaadin-horizontal-layout-mixin.js';
|
|
|
15
15
|
/**
|
|
16
16
|
* `<vaadin-horizontal-layout>` provides a simple way to horizontally align your HTML elements.
|
|
17
17
|
*
|
|
18
|
-
* ```
|
|
18
|
+
* ```html
|
|
19
19
|
* <vaadin-horizontal-layout>
|
|
20
20
|
* <div>Item 1</div>
|
|
21
21
|
* <div>Item 2</div>
|
|
@@ -50,7 +50,7 @@ import { HorizontalLayoutMixin } from './vaadin-horizontal-layout-mixin.js';
|
|
|
50
50
|
* @mixes HorizontalLayoutMixin
|
|
51
51
|
*/
|
|
52
52
|
class HorizontalLayout extends HorizontalLayoutMixin(
|
|
53
|
-
ThemableMixin(ElementMixin(LumoInjectionMixin(
|
|
53
|
+
ThemableMixin(ElementMixin(PolylitMixin(LumoInjectionMixin(LitElement)))),
|
|
54
54
|
) {
|
|
55
55
|
static get is() {
|
|
56
56
|
return 'vaadin-horizontal-layout';
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/horizontal-layout",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha9",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-horizontal-layout",
|
|
11
|
-
"description": "`<vaadin-horizontal-layout>` provides a simple way to horizontally align your HTML elements.\n\n
|
|
11
|
+
"description": "`<vaadin-horizontal-layout>` provides a simple way to horizontally align your HTML elements.\n\n```html\n<vaadin-horizontal-layout>\n <div>Item 1</div>\n <div>Item 2</div>\n</vaadin-horizontal-layout>\n```\n\n### Built-in Theme Variations\n\n`<vaadin-horizontal-layout>` supports the following theme variations:\n\nTheme variation | Description\n---|---\n`theme=\"margin\"` | Applies the default amount of CSS margin for the host element (specified by the theme)\n`theme=\"padding\"` | Applies the default amount of CSS padding for the host element (specified by the theme)\n`theme=\"spacing\"` | Applies the default amount of CSS margin between items (specified by the theme)\n`theme=\"wrap\"` | Items wrap to the next row when they exceed the layout width\n\n### Component's slots\n\nThe following slots are available to be set:\n\nSlot name | Description\n-------------------|---------------\nno name | Default slot\n`middle` | Slot for the content placed in the middle\n`end` | Slot for the content placed at the end",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "theme",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/horizontal-layout",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha9",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-horizontal-layout",
|
|
19
|
-
"description": "`<vaadin-horizontal-layout>` provides a simple way to horizontally align your HTML elements.\n\n
|
|
19
|
+
"description": "`<vaadin-horizontal-layout>` provides a simple way to horizontally align your HTML elements.\n\n```html\n<vaadin-horizontal-layout>\n <div>Item 1</div>\n <div>Item 2</div>\n</vaadin-horizontal-layout>\n```\n\n### Built-in Theme Variations\n\n`<vaadin-horizontal-layout>` supports the following theme variations:\n\nTheme variation | Description\n---|---\n`theme=\"margin\"` | Applies the default amount of CSS margin for the host element (specified by the theme)\n`theme=\"padding\"` | Applies the default amount of CSS padding for the host element (specified by the theme)\n`theme=\"spacing\"` | Applies the default amount of CSS margin between items (specified by the theme)\n`theme=\"wrap\"` | Items wrap to the next row when they exceed the layout width\n\n### Component's slots\n\nThe following slots are available to be set:\n\nSlot name | Description\n-------------------|---------------\nno name | Default slot\n`middle` | Slot for the content placed in the middle\n`end` | Slot for the content placed at the end",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": []
|
|
22
22
|
}
|