@vaadin/overlay 25.3.0-alpha12 → 25.3.0-alpha13

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.
@@ -1020,6 +1020,7 @@
1020
1020
  },
1021
1021
  "tagName": "vaadin-overlay",
1022
1022
  "customElement": true,
1023
+ "deprecated": "`<vaadin-overlay>` is deprecated and will be removed in Vaadin 26. Consider using `OverlayMixin` and `PositionMixin` instead.",
1023
1024
  "attributes": [
1024
1025
  {
1025
1026
  "name": "autofocus",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/overlay",
3
- "version": "25.3.0-alpha12",
3
+ "version": "25.3.0-alpha13",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -34,19 +34,19 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@open-wc/dedupe-mixin": "^1.3.0",
37
- "@vaadin/a11y-base": "25.3.0-alpha12",
38
- "@vaadin/component-base": "25.3.0-alpha12",
39
- "@vaadin/vaadin-themable-mixin": "25.3.0-alpha12",
37
+ "@vaadin/a11y-base": "25.3.0-alpha13",
38
+ "@vaadin/component-base": "25.3.0-alpha13",
39
+ "@vaadin/vaadin-themable-mixin": "25.3.0-alpha13",
40
40
  "lit": "^3.0.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@vaadin/aura": "25.3.0-alpha12",
44
- "@vaadin/chai-plugins": "25.3.0-alpha12",
45
- "@vaadin/test-runner-commands": "25.3.0-alpha12",
43
+ "@vaadin/aura": "25.3.0-alpha13",
44
+ "@vaadin/chai-plugins": "25.3.0-alpha13",
45
+ "@vaadin/test-runner-commands": "25.3.0-alpha13",
46
46
  "@vaadin/testing-helpers": "^2.0.0",
47
- "@vaadin/vaadin-lumo-styles": "25.3.0-alpha12",
47
+ "@vaadin/vaadin-lumo-styles": "25.3.0-alpha13",
48
48
  "sinon": "^22.0.0"
49
49
  },
50
50
  "customElements": "custom-elements.json",
51
- "gitHead": "0f0337783efe38332f5dc6a8968f207d2982de4b"
51
+ "gitHead": "e23e44d29e6bc1e47245d5e2cc0e4b022ec61818"
52
52
  }
@@ -56,6 +56,11 @@ const overlayBase = css`
56
56
  display: none !important;
57
57
  }
58
58
 
59
+ :host([suppressed]) [part='overlay'],
60
+ :host([suppressed]) ::slotted(*) {
61
+ pointer-events: none !important;
62
+ }
63
+
59
64
  [part='overlay'] {
60
65
  color: var(--vaadin-overlay-text-color, var(--vaadin-text-color));
61
66
  background: var(--vaadin-overlay-background, var(--vaadin-background-color));
@@ -463,7 +463,7 @@ export const OverlayMixin = (superClass) =>
463
463
  _finishClosing() {
464
464
  this._detachOverlay();
465
465
  this._removeAttachedInstance();
466
- this.$.overlay.style.removeProperty('pointer-events');
466
+ this.toggleAttribute('suppressed', false);
467
467
  setOverlayStateAttribute(this, 'closing', false);
468
468
  this.dispatchEvent(new CustomEvent('vaadin-overlay-closed'));
469
469
  }
@@ -106,10 +106,10 @@ export const OverlayStackMixin = (superClass) =>
106
106
  document.body.style.pointerEvents = 'none';
107
107
  }
108
108
 
109
- // Disable pointer events in other attached overlays
109
+ // Suppress pointer events in other attached overlays
110
110
  getAttachedInstances().forEach((el) => {
111
111
  if (el !== this) {
112
- el.$.overlay.style.pointerEvents = 'none';
112
+ el.toggleAttribute('suppressed', true);
113
113
  }
114
114
  });
115
115
  }
@@ -122,7 +122,7 @@ export const OverlayStackMixin = (superClass) =>
122
122
  delete this._previousDocumentPointerEvents;
123
123
  }
124
124
 
125
- // Restore pointer events in the previous overlay(s)
125
+ // Stop suppressing pointer events in the previous overlay(s)
126
126
  const instances = getAttachedInstances();
127
127
 
128
128
  let el;
@@ -132,7 +132,7 @@ export const OverlayStackMixin = (superClass) =>
132
132
  // Skip the current instance
133
133
  continue;
134
134
  }
135
- el.$.overlay.style.removeProperty('pointer-events');
135
+ el.toggleAttribute('suppressed', false);
136
136
  if (!el.modeless) {
137
137
  // Stop after the last modal
138
138
  break;
@@ -118,6 +118,8 @@ export type OverlayEventMap = HTMLElementEventMap & OverlayCustomEventMap;
118
118
  * @fires {CustomEvent} vaadin-overlay-closed - Fired after the overlay is closed.
119
119
  * @fires {CustomEvent} vaadin-overlay-outside-click - Fired before the overlay is closed on outside click. Calling `preventDefault()` on the event cancels the closing.
120
120
  * @fires {CustomEvent} vaadin-overlay-escape-press - Fired before the overlay is closed on Escape key press. Calling `preventDefault()` on the event cancels the closing.
121
+ * @deprecated `<vaadin-overlay>` is deprecated and will be removed in Vaadin 26.
122
+ * Consider using `OverlayMixin` and `PositionMixin` instead.
121
123
  */
122
124
  declare class Overlay extends OverlayMixin(ThemableMixin(DirMixin(HTMLElement))) {
123
125
  addEventListener<K extends keyof OverlayEventMap>(
@@ -7,6 +7,7 @@ import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
9
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
+ import { issueWarning } from '@vaadin/component-base/src/warnings.js';
10
11
  import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
11
12
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
13
  import { overlayStyles } from './styles/vaadin-overlay-base-styles.js';
@@ -73,6 +74,8 @@ import { OverlayMixin } from './vaadin-overlay-mixin.js';
73
74
  *
74
75
  * @customElement vaadin-overlay
75
76
  * @extends HTMLElement
77
+ * @deprecated `<vaadin-overlay>` is deprecated and will be removed in Vaadin 26.
78
+ * Consider using `OverlayMixin` and `PositionMixin` instead.
76
79
  */
77
80
  class Overlay extends OverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
78
81
  static get is() {
@@ -94,6 +97,15 @@ class Overlay extends OverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LumoInjec
94
97
  </div>
95
98
  `;
96
99
  }
100
+
101
+ /** @protected */
102
+ firstUpdated() {
103
+ super.firstUpdated();
104
+
105
+ issueWarning(
106
+ '`<vaadin-overlay>` is deprecated and will be removed in Vaadin 26. Consider using `OverlayMixin` and `PositionMixin` instead.',
107
+ );
108
+ }
97
109
  }
98
110
 
99
111
  defineCustomElement(Overlay);