@vaadin/vaadin-overlay 23.2.0-dev.8a7678b70 → 23.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/vaadin-overlay",
3
- "version": "23.2.0-dev.8a7678b70",
3
+ "version": "23.3.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -14,7 +14,7 @@
14
14
  "author": "Vaadin Ltd",
15
15
  "homepage": "https://vaadin.com/components",
16
16
  "bugs": {
17
- "url": "https://github.com/vaadin/vaadin-overlay/issues"
17
+ "url": "https://github.com/vaadin/web-components/issues"
18
18
  },
19
19
  "main": "vaadin-overlay.js",
20
20
  "module": "vaadin-overlay.js",
@@ -35,20 +35,20 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@polymer/polymer": "^3.0.0",
38
- "@vaadin/component-base": "23.2.0-dev.8a7678b70",
39
- "@vaadin/vaadin-lumo-styles": "23.2.0-dev.8a7678b70",
40
- "@vaadin/vaadin-material-styles": "23.2.0-dev.8a7678b70",
41
- "@vaadin/vaadin-themable-mixin": "23.2.0-dev.8a7678b70"
38
+ "@vaadin/component-base": "23.3.0-alpha1",
39
+ "@vaadin/vaadin-lumo-styles": "23.3.0-alpha1",
40
+ "@vaadin/vaadin-material-styles": "23.3.0-alpha1",
41
+ "@vaadin/vaadin-themable-mixin": "23.3.0-alpha1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@esm-bundle/chai": "^4.3.4",
45
45
  "@polymer/iron-overlay-behavior": "^3.0.0",
46
- "@vaadin/button": "23.2.0-dev.8a7678b70",
47
- "@vaadin/radio-group": "23.2.0-dev.8a7678b70",
46
+ "@vaadin/button": "23.3.0-alpha1",
47
+ "@vaadin/radio-group": "23.3.0-alpha1",
48
48
  "@vaadin/testing-helpers": "^0.3.2",
49
- "@vaadin/text-field": "23.2.0-dev.8a7678b70",
49
+ "@vaadin/text-field": "23.3.0-alpha1",
50
50
  "lit": "^2.0.0",
51
51
  "sinon": "^13.0.2"
52
52
  },
53
- "gitHead": "85b403f96d8282f262322b56c0ff4289f843d02a"
53
+ "gitHead": "beabc527d4b1274eb798ff701d406fed45cfe638"
54
54
  }
@@ -15,6 +15,16 @@ const PROP_NAMES_HORIZONTAL = {
15
15
  end: 'right',
16
16
  };
17
17
 
18
+ const targetResizeObserver = new ResizeObserver((entries) => {
19
+ setTimeout(() => {
20
+ entries.forEach((entry) => {
21
+ if (entry.target.__overlay) {
22
+ entry.target.__overlay._updatePosition();
23
+ }
24
+ });
25
+ });
26
+ });
27
+
18
28
  /**
19
29
  * @polymerMixin
20
30
  */
@@ -132,8 +142,15 @@ export const PositionMixin = (superClass) =>
132
142
  __overlayOpenedChanged(opened, positionTarget) {
133
143
  this.__removeUpdatePositionEventListeners();
134
144
 
135
- if (opened && positionTarget) {
136
- this.__addUpdatePositionEventListeners();
145
+ if (positionTarget) {
146
+ positionTarget.__overlay = null;
147
+ targetResizeObserver.unobserve(positionTarget);
148
+
149
+ if (opened) {
150
+ this.__addUpdatePositionEventListeners();
151
+ positionTarget.__overlay = this;
152
+ targetResizeObserver.observe(positionTarget);
153
+ }
137
154
  }
138
155
 
139
156
  if (opened) {
@@ -135,7 +135,7 @@ export type OverlayEventMap = HTMLElementEventMap & OverlayElementEventMap;
135
135
  * ---|---|---
136
136
  * `--vaadin-overlay-viewport-bottom` | Bottom offset of the visible viewport area | `0` or detected offset
137
137
  *
138
- * See [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.
138
+ * See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
139
139
  *
140
140
  * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
141
141
  * @fires {CustomEvent} vaadin-overlay-open - Fired after the overlay is opened.
@@ -232,13 +232,13 @@ declare class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(HTML
232
232
  addEventListener<K extends keyof OverlayEventMap>(
233
233
  type: K,
234
234
  listener: (this: OverlayElement, ev: OverlayEventMap[K]) => void,
235
- options?: boolean | AddEventListenerOptions,
235
+ options?: AddEventListenerOptions | boolean,
236
236
  ): void;
237
237
 
238
238
  removeEventListener<K extends keyof OverlayEventMap>(
239
239
  type: K,
240
240
  listener: (this: OverlayElement, ev: OverlayEventMap[K]) => void,
241
- options?: boolean | EventListenerOptions,
241
+ options?: EventListenerOptions | boolean,
242
242
  ): void;
243
243
  }
244
244
 
@@ -90,7 +90,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
90
90
  * ---|---|---
91
91
  * `--vaadin-overlay-viewport-bottom` | Bottom offset of the visible viewport area | `0` or detected offset
92
92
  *
93
- * See [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.
93
+ * See [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.
94
94
  *
95
95
  * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
96
96
  * @fires {CustomEvent} vaadin-overlay-open - Fired after the overlay is opened.
@@ -404,7 +404,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
404
404
  * @protected
405
405
  */
406
406
  _setTemplateFromNodes(nodes) {
407
- this.template = nodes.filter((node) => node.localName && node.localName === 'template')[0] || this.template;
407
+ this.template = nodes.find((node) => node.localName && node.localName === 'template') || this.template;
408
408
  }
409
409
 
410
410
  /**