@vaadin/notification 25.0.0-alpha8 → 25.0.0-alpha9

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/notification",
3
- "version": "25.0.0-alpha8",
3
+ "version": "25.0.0-alpha9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,17 +37,16 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/component-base": "25.0.0-alpha8",
41
- "@vaadin/lit-renderer": "25.0.0-alpha8",
42
- "@vaadin/overlay": "25.0.0-alpha8",
43
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha8",
44
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha8",
40
+ "@vaadin/component-base": "25.0.0-alpha9",
41
+ "@vaadin/lit-renderer": "25.0.0-alpha9",
42
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha9",
43
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha9",
45
44
  "lit": "^3.0.0"
46
45
  },
47
46
  "devDependencies": {
48
- "@vaadin/button": "25.0.0-alpha8",
49
- "@vaadin/chai-plugins": "25.0.0-alpha8",
50
- "@vaadin/test-runner-commands": "25.0.0-alpha8",
47
+ "@vaadin/button": "25.0.0-alpha9",
48
+ "@vaadin/chai-plugins": "25.0.0-alpha9",
49
+ "@vaadin/test-runner-commands": "25.0.0-alpha9",
51
50
  "@vaadin/testing-helpers": "^2.0.0",
52
51
  "sinon": "^18.0.0"
53
52
  },
@@ -55,5 +54,5 @@
55
54
  "web-types.json",
56
55
  "web-types.lit.json"
57
56
  ],
58
- "gitHead": "ebf53673d5f639d2b1b6f2b31f640f530643ee2f"
57
+ "gitHead": "bbe4720721e0955ffc87a79b412bee38b1f0eb1e"
59
58
  }
@@ -8,13 +8,20 @@ import { css } from 'lit';
8
8
  export const notificationContainerStyles = css`
9
9
  :host {
10
10
  position: fixed;
11
- z-index: 1000;
12
11
  inset: 0;
13
12
  box-sizing: border-box;
14
13
  display: flex;
15
14
  flex-direction: column;
16
15
  align-items: stretch;
17
16
  pointer-events: none;
17
+
18
+ /* Override native [popover] user agent styles */
19
+ width: auto;
20
+ height: auto;
21
+ border: none;
22
+ padding: 0;
23
+ background-color: transparent;
24
+ overflow: visible;
18
25
  }
19
26
 
20
27
  [region-group] {
@@ -5,7 +5,6 @@
5
5
  */
6
6
  import type { Constructor } from '@open-wc/dedupe-mixin';
7
7
  import type { OverlayClassMixinClass } from '@vaadin/component-base/src/overlay-class-mixin.js';
8
- import type { OverlayStackMixinClass } from '@vaadin/overlay/src/vaadin-overlay-stack-mixin.js';
9
8
  import type { ThemePropertyMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
10
9
  import type { Notification } from './vaadin-notification.js';
11
10
 
@@ -27,7 +26,7 @@ export type NotificationRenderer = (root: HTMLElement, notification: Notificatio
27
26
  */
28
27
  export declare function NotificationContainerMixin<T extends Constructor<HTMLElement>>(
29
28
  base: T,
30
- ): Constructor<NotificationContainerMixinClass> & Constructor<OverlayStackMixinClass> & T;
29
+ ): Constructor<NotificationContainerMixinClass> & T;
31
30
 
32
31
  export declare class NotificationContainerMixinClass {
33
32
  /**
@@ -7,17 +7,15 @@ import { render } from 'lit';
7
7
  import { isTemplateResult } from 'lit/directive-helpers.js';
8
8
  import { isIOS } from '@vaadin/component-base/src/browser-utils.js';
9
9
  import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
10
- import { OverlayStackMixin } from '@vaadin/overlay/src/vaadin-overlay-stack-mixin.js';
11
10
  import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
12
11
 
13
12
  /**
14
13
  * A mixin providing common notification container functionality.
15
14
  *
16
15
  * @polymerMixin
17
- * @mixes OverlayStackMixin
18
16
  */
19
17
  export const NotificationContainerMixin = (superClass) =>
20
- class extends OverlayStackMixin(superClass) {
18
+ class extends superClass {
21
19
  static get properties() {
22
20
  return {
23
21
  /**
@@ -42,11 +40,28 @@ export const NotificationContainerMixin = (superClass) =>
42
40
  }
43
41
  }
44
42
 
43
+ /** @protected */
44
+ firstUpdated(props) {
45
+ super.firstUpdated(props);
46
+
47
+ this.popover = 'manual';
48
+ }
49
+
50
+ /**
51
+ * Move the notification container to the top of the stack.
52
+ */
53
+ bringToFront() {
54
+ if (this.matches(':popover-open')) {
55
+ this.hidePopover();
56
+ this.showPopover();
57
+ }
58
+ }
59
+
45
60
  /** @private */
46
61
  _openedChanged(opened) {
47
62
  if (opened) {
48
63
  document.body.appendChild(this);
49
- this._appendAttachedInstance();
64
+ this.showPopover();
50
65
  document.addEventListener('vaadin-overlay-close', this._boundVaadinOverlayClose);
51
66
  if (this._boundIosResizeListener) {
52
67
  this._detectIosNavbar();
@@ -54,7 +69,7 @@ export const NotificationContainerMixin = (superClass) =>
54
69
  }
55
70
  } else {
56
71
  document.body.removeChild(this);
57
- this._removeAttachedInstance();
72
+ this.hidePopover();
58
73
  document.removeEventListener('vaadin-overlay-close', this._boundVaadinOverlayClose);
59
74
  if (this._boundIosResizeListener) {
60
75
  window.removeEventListener('resize', this._boundIosResizeListener);
@@ -360,7 +375,11 @@ export const NotificationMixin = (superClass) =>
360
375
  return;
361
376
  }
362
377
 
363
- this._container.bringToFront();
378
+ // Only call bringToFront if the container already has a child / was already opened.
379
+ // Otherwise, just setting `opened` on the container will make it the topmost overlay.
380
+ if (this._container.firstElementChild) {
381
+ this._container.bringToFront();
382
+ }
364
383
 
365
384
  this._card.slot = this.position;
366
385
  if (this._container.firstElementChild && /top/u.test(this.position)) {
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/notification",
4
- "version": "25.0.0-alpha8",
4
+ "version": "25.0.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/notification",
4
- "version": "25.0.0-alpha8",
4
+ "version": "25.0.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {