@vaadin/vaadin-overlay 22.0.21 → 22.1.0-alpha1

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
@@ -7,4 +7,4 @@
7
7
 
8
8
  ## License
9
9
 
10
- Apache License 2.0
10
+ This program is available under Vaadin Commercial License and Service Terms. For license terms, see LICENSE.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@vaadin/vaadin-overlay",
3
- "version": "22.0.21",
3
+ "version": "22.1.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "description": "vaadin-overlay",
8
- "license": "Apache-2.0",
8
+ "license": "https://raw.githubusercontent.com/vaadin/web-components/22.1/LICENSE",
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "https://github.com/vaadin/web-components.git",
@@ -34,20 +34,20 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@polymer/polymer": "^3.0.0",
37
- "@vaadin/component-base": "^22.0.21",
38
- "@vaadin/vaadin-lumo-styles": "^22.0.21",
39
- "@vaadin/vaadin-material-styles": "^22.0.21",
40
- "@vaadin/vaadin-themable-mixin": "^22.0.21"
37
+ "@vaadin/component-base": "22.1.0-alpha1",
38
+ "@vaadin/vaadin-lumo-styles": "22.1.0-alpha1",
39
+ "@vaadin/vaadin-material-styles": "22.1.0-alpha1",
40
+ "@vaadin/vaadin-themable-mixin": "22.1.0-alpha1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@esm-bundle/chai": "^4.3.4",
44
44
  "@polymer/iron-overlay-behavior": "^3.0.0",
45
- "@vaadin/button": "^22.0.21",
46
- "@vaadin/radio-group": "^22.0.21",
45
+ "@vaadin/button": "22.1.0-alpha1",
46
+ "@vaadin/radio-group": "22.1.0-alpha1",
47
47
  "@vaadin/testing-helpers": "^0.3.2",
48
- "@vaadin/text-field": "^22.0.21",
48
+ "@vaadin/text-field": "22.1.0-alpha1",
49
49
  "lit": "^2.0.0",
50
50
  "sinon": "^9.2.1"
51
51
  },
52
- "gitHead": "f0a522c6e48a10c4850abc7be8bb2fbe3fdcc8f3"
52
+ "gitHead": "e387194c2c3608b7567b43b788b504c3a12194d9"
53
53
  }
@@ -1,7 +1,12 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2021 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
3
+ * Copyright (c) 2000 - 2023 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
5
10
  */
6
11
 
7
12
  /**
@@ -1,7 +1,12 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2022 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
3
+ * Copyright (c) 2000 - 2023 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
5
10
  */
6
11
 
7
12
  const PROP_NAMES_VERTICAL = {
@@ -74,11 +79,24 @@ export const PositionMixin = (superClass) =>
74
79
  type: Boolean,
75
80
  value: false,
76
81
  },
82
+
83
+ /**
84
+ * If the overlay content has no intrinsic height, this property can be used to set
85
+ * the minimum vertical space (in pixels) required by the overlay. Setting a value to
86
+ * the property effectively disables the content measurement in favor of using this
87
+ * fixed value for determining the open direction.
88
+ *
89
+ * @attr {number} required-vertical-space
90
+ */
91
+ requiredVerticalSpace: {
92
+ type: Number,
93
+ value: 0,
94
+ },
77
95
  };
78
96
  }
79
97
  static get observers() {
80
98
  return [
81
- '__positionSettingsChanged(positionTarget, horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap)',
99
+ '__positionSettingsChanged(positionTarget, horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap, requiredVerticalSpace)',
82
100
  '__overlayOpenedChanged(opened)',
83
101
  ];
84
102
  }
@@ -195,7 +213,8 @@ export const PositionMixin = (superClass) =>
195
213
  __shouldAlignStartVertically(targetRect) {
196
214
  // Using previous size to fix a case where window resize may cause the overlay to be squeezed
197
215
  // smaller than its current space before the fit-calculations.
198
- const contentHeight = Math.max(this.__oldContentHeight || 0, this.$.overlay.offsetHeight);
216
+ const contentHeight =
217
+ this.requiredVerticalSpace || Math.max(this.__oldContentHeight || 0, this.$.overlay.offsetHeight);
199
218
  this.__oldContentHeight = this.$.overlay.offsetHeight;
200
219
 
201
220
  const viewportHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);
@@ -1,7 +1,12 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2022 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
3
+ * Copyright (c) 2000 - 2023 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
5
10
  */
6
11
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
7
12
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
@@ -1,7 +1,12 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2022 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
3
+ * Copyright (c) 2000 - 2023 Vaadin Ltd.
4
+ *
5
+ * This program is available under Vaadin Commercial License and Service Terms.
6
+ *
7
+ *
8
+ * See https://vaadin.com/commercial-license-and-service-terms for the full
9
+ * license.
5
10
  */
6
11
  import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
7
12
  import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';