@vaadin/overlay 24.7.0-alpha9 → 24.7.0-rc1

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": "24.7.0-alpha9",
3
+ "version": "24.7.0-rc1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,18 +36,18 @@
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
38
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/a11y-base": "24.7.0-alpha9",
40
- "@vaadin/component-base": "24.7.0-alpha9",
41
- "@vaadin/vaadin-lumo-styles": "24.7.0-alpha9",
42
- "@vaadin/vaadin-material-styles": "24.7.0-alpha9",
43
- "@vaadin/vaadin-themable-mixin": "24.7.0-alpha9",
39
+ "@vaadin/a11y-base": "24.7.0-rc1",
40
+ "@vaadin/component-base": "24.7.0-rc1",
41
+ "@vaadin/vaadin-lumo-styles": "24.7.0-rc1",
42
+ "@vaadin/vaadin-material-styles": "24.7.0-rc1",
43
+ "@vaadin/vaadin-themable-mixin": "24.7.0-rc1",
44
44
  "lit": "^3.0.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@vaadin/chai-plugins": "24.7.0-alpha9",
48
- "@vaadin/test-runner-commands": "24.7.0-alpha9",
47
+ "@vaadin/chai-plugins": "24.7.0-rc1",
48
+ "@vaadin/test-runner-commands": "24.7.0-rc1",
49
49
  "@vaadin/testing-helpers": "^1.1.0",
50
50
  "sinon": "^18.0.0"
51
51
  },
52
- "gitHead": "b0a16c6ed7fc50a22a42dcab0649d74f4c300485"
52
+ "gitHead": "28f6d361ebf39070c0961cee75ee6c14089109b2"
53
53
  }
@@ -28,6 +28,23 @@ const getOverlayInstances = () => getAttachedInstances().filter((el) => el.$.ove
28
28
  */
29
29
  export const isLastOverlay = (overlay) => overlay === getOverlayInstances().pop();
30
30
 
31
+ const overlayMap = new WeakMap();
32
+
33
+ /**
34
+ * Stores the reference to the nested overlay for given parent,
35
+ * or removes it when the nested overlay is null.
36
+ * @param {HTMLElement} parent
37
+ * @param {HTMLElement} nested
38
+ * @protected
39
+ */
40
+ export const setNestedOverlay = (parent, nested) => {
41
+ if (nested != null) {
42
+ overlayMap.set(parent, nested);
43
+ } else {
44
+ overlayMap.delete(parent);
45
+ }
46
+ };
47
+
31
48
  /**
32
49
  * @polymerMixin
33
50
  */
@@ -63,6 +80,11 @@ export const OverlayStackMixin = (superClass) =>
63
80
  }
64
81
  this.style.zIndex = zIndex;
65
82
  this.__zIndex = zIndex || parseFloat(getComputedStyle(this).zIndex);
83
+
84
+ // If there is a nested overlay, call `bringToFront()` for it as well.
85
+ if (overlayMap.has(this)) {
86
+ overlayMap.get(this).bringToFront();
87
+ }
66
88
  }
67
89
 
68
90
  /** @protected */