@vaadin/overlay 23.3.6 → 23.3.8

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/overlay",
3
- "version": "23.3.6",
3
+ "version": "23.3.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,20 +36,20 @@
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
38
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/component-base": "~23.3.6",
40
- "@vaadin/vaadin-lumo-styles": "~23.3.6",
41
- "@vaadin/vaadin-material-styles": "~23.3.6",
42
- "@vaadin/vaadin-themable-mixin": "~23.3.6"
39
+ "@vaadin/component-base": "~23.3.8",
40
+ "@vaadin/vaadin-lumo-styles": "~23.3.8",
41
+ "@vaadin/vaadin-material-styles": "~23.3.8",
42
+ "@vaadin/vaadin-themable-mixin": "~23.3.8"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@esm-bundle/chai": "^4.3.4",
46
46
  "@polymer/iron-overlay-behavior": "^3.0.0",
47
- "@vaadin/button": "~23.3.6",
48
- "@vaadin/radio-group": "~23.3.6",
47
+ "@vaadin/button": "~23.3.8",
48
+ "@vaadin/radio-group": "~23.3.8",
49
49
  "@vaadin/testing-helpers": "^0.3.2",
50
- "@vaadin/text-field": "~23.3.6",
50
+ "@vaadin/text-field": "~23.3.8",
51
51
  "lit": "^2.0.0",
52
52
  "sinon": "^13.0.2"
53
53
  },
54
- "gitHead": "3ea0e9875f51cca9c4f78cf731fd8009c5a45ddb"
54
+ "gitHead": "f3bfde4c881f9deb7d757faf4ab070f0596b0a09"
55
55
  }
@@ -54,4 +54,14 @@ export declare class PositionMixinClass {
54
54
  * @attr {boolean} no-vertical-overlap
55
55
  */
56
56
  noVerticalOverlap: boolean;
57
+
58
+ /**
59
+ * If the overlay content has no intrinsic height, this property can be used to set
60
+ * the minimum vertical space (in pixels) required by the overlay. Setting a value to
61
+ * the property effectively disables the content measurement in favor of using this
62
+ * fixed value for determining the open direction.
63
+ *
64
+ * @attr {number} required-vertical-space
65
+ */
66
+ requiredVerticalSpace: number;
57
67
  }
@@ -93,12 +93,25 @@ export const PositionMixin = (superClass) =>
93
93
  type: Boolean,
94
94
  value: false,
95
95
  },
96
+
97
+ /**
98
+ * If the overlay content has no intrinsic height, this property can be used to set
99
+ * the minimum vertical space (in pixels) required by the overlay. Setting a value to
100
+ * the property effectively disables the content measurement in favor of using this
101
+ * fixed value for determining the open direction.
102
+ *
103
+ * @attr {number} required-vertical-space
104
+ */
105
+ requiredVerticalSpace: {
106
+ type: Number,
107
+ value: 0,
108
+ },
96
109
  };
97
110
  }
98
111
 
99
112
  static get observers() {
100
113
  return [
101
- '__positionSettingsChanged(horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap)',
114
+ '__positionSettingsChanged(horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap, requiredVerticalSpace)',
102
115
  '__overlayOpenedChanged(opened, positionTarget)',
103
116
  ];
104
117
  }
@@ -266,7 +279,8 @@ export const PositionMixin = (superClass) =>
266
279
  __shouldAlignStartVertically(targetRect) {
267
280
  // Using previous size to fix a case where window resize may cause the overlay to be squeezed
268
281
  // smaller than its current space before the fit-calculations.
269
- const contentHeight = Math.max(this.__oldContentHeight || 0, this.$.overlay.offsetHeight);
282
+ const contentHeight =
283
+ this.requiredVerticalSpace || Math.max(this.__oldContentHeight || 0, this.$.overlay.offsetHeight);
270
284
  this.__oldContentHeight = this.$.overlay.offsetHeight;
271
285
 
272
286
  const viewportHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);