@vaadin/vertical-layout 24.7.0-alpha1 → 24.7.0-alpha10

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/vertical-layout",
3
- "version": "24.7.0-alpha1",
3
+ "version": "24.7.0-alpha10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,19 +36,20 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/component-base": "24.7.0-alpha1",
40
- "@vaadin/vaadin-lumo-styles": "24.7.0-alpha1",
41
- "@vaadin/vaadin-material-styles": "24.7.0-alpha1",
42
- "@vaadin/vaadin-themable-mixin": "24.7.0-alpha1",
39
+ "@vaadin/component-base": "24.7.0-alpha10",
40
+ "@vaadin/vaadin-lumo-styles": "24.7.0-alpha10",
41
+ "@vaadin/vaadin-material-styles": "24.7.0-alpha10",
42
+ "@vaadin/vaadin-themable-mixin": "24.7.0-alpha10",
43
43
  "lit": "^3.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@vaadin/chai-plugins": "24.7.0-alpha1",
47
- "@vaadin/testing-helpers": "^1.0.0"
46
+ "@vaadin/chai-plugins": "24.7.0-alpha10",
47
+ "@vaadin/test-runner-commands": "24.7.0-alpha10",
48
+ "@vaadin/testing-helpers": "^1.1.0"
48
49
  },
49
50
  "web-types": [
50
51
  "web-types.json",
51
52
  "web-types.lit.json"
52
53
  ],
53
- "gitHead": "04be941c9a7b659871c97f31b9cc3ffd7528087b"
54
+ "gitHead": "c0f8933df2a6a40648d3fb9cfbae6bbf86a8aa90"
54
55
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  export * from './vaadin-vertical-layout.js';
@@ -1,13 +1,14 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 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 { css, html, LitElement } from 'lit';
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
9
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
10
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
+ import { verticalLayoutStyles } from './vaadin-vertical-layout-styles.js';
11
12
 
12
13
  /**
13
14
  * LitElement based version of `<vaadin-vertical-layout>` web component.
@@ -19,38 +20,15 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
19
20
  * Feel free to try this code in your apps as per Apache 2.0 license.
20
21
  */
21
22
  class VerticalLayout extends ThemableMixin(ElementMixin(PolylitMixin(LitElement))) {
22
- static get styles() {
23
- return css`
24
- :host {
25
- display: flex;
26
- flex-direction: column;
27
- align-items: flex-start;
28
- box-sizing: border-box;
29
- }
30
-
31
- :host([hidden]) {
32
- display: none !important;
33
- }
34
-
35
- /* Theme variations */
36
- :host([theme~='margin']) {
37
- margin: 1em;
38
- }
39
-
40
- :host([theme~='padding']) {
41
- padding: 1em;
42
- }
43
-
44
- :host([theme~='spacing']) {
45
- gap: 1em;
46
- }
47
- `;
48
- }
49
-
50
23
  static get is() {
51
24
  return 'vaadin-vertical-layout';
52
25
  }
53
26
 
27
+ static get styles() {
28
+ return verticalLayoutStyles;
29
+ }
30
+
31
+ /** @protected */
54
32
  render() {
55
33
  return html`<slot></slot>`;
56
34
  }
@@ -0,0 +1,8 @@
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 type { CSSResult } from 'lit';
7
+
8
+ export const verticalLayoutStyles: CSSResult[];
@@ -0,0 +1,50 @@
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 { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
7
+
8
+ export const baseStyles = css`
9
+ :host {
10
+ display: flex;
11
+ flex-direction: column;
12
+ align-items: flex-start;
13
+ box-sizing: border-box;
14
+ }
15
+
16
+ :host([hidden]) {
17
+ display: none !important;
18
+ }
19
+
20
+ /* Theme variations */
21
+ :host([theme~='margin']) {
22
+ margin: 1em;
23
+ }
24
+
25
+ :host([theme~='padding']) {
26
+ padding: 1em;
27
+ }
28
+
29
+ :host([theme~='spacing']) {
30
+ gap: 1em;
31
+ }
32
+ `;
33
+
34
+ // Layout improvements are part of a feature for Flow users where children that have been configured to use full size
35
+ // using `HasSize.setSizeFull()` and others, get additional styles so that they effectively take the remaining space in
36
+ // the layout, rather than explicitly use 100% width/height. The respective data attributes are set by Flow's `HasSize`
37
+ // class.
38
+ const enableLayoutImprovements = window.Vaadin.featureFlags.layoutComponentImprovements;
39
+ const layoutImprovementStyles = css`
40
+ ::slotted([data-height-full]) {
41
+ flex: 1;
42
+ }
43
+
44
+ ::slotted(vaadin-horizontal-layout[data-height-full]),
45
+ ::slotted(vaadin-vertical-layout[data-height-full]) {
46
+ min-height: 0;
47
+ }
48
+ `;
49
+
50
+ export const verticalLayoutStyles = enableLayoutImprovements ? [baseStyles, layoutImprovementStyles] : [baseStyles];
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
@@ -1,12 +1,15 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
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 { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
9
+ import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10
+ import { verticalLayoutStyles } from './vaadin-vertical-layout-styles.js';
11
+
12
+ registerStyles('vaadin-vertical-layout', verticalLayoutStyles, { moduleId: 'vaadin-vertical-layout-styles' });
10
13
 
11
14
  /**
12
15
  * `<vaadin-vertical-layout>` provides a simple way to vertically align your HTML elements.
@@ -36,35 +39,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
36
39
  */
37
40
  class VerticalLayout extends ElementMixin(ThemableMixin(PolymerElement)) {
38
41
  static get template() {
39
- return html`
40
- <style>
41
- :host {
42
- display: flex;
43
- flex-direction: column;
44
- align-items: flex-start;
45
- box-sizing: border-box;
46
- }
47
-
48
- :host([hidden]) {
49
- display: none !important;
50
- }
51
-
52
- /* Theme variations */
53
- :host([theme~='margin']) {
54
- margin: 1em;
55
- }
56
-
57
- :host([theme~='padding']) {
58
- padding: 1em;
59
- }
60
-
61
- :host([theme~='spacing']) {
62
- gap: 1em;
63
- }
64
- </style>
65
-
66
- <slot></slot>
67
- `;
42
+ return html`<slot></slot>`;
68
43
  }
69
44
 
70
45
  static get is() {
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/vertical-layout",
4
- "version": "24.7.0-alpha1",
4
+ "version": "24.7.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/vertical-layout",
4
- "version": "24.7.0-alpha1",
4
+ "version": "24.7.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {