@vaadin/notification 25.0.0-alpha7 → 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-alpha7",
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-alpha7",
41
- "@vaadin/lit-renderer": "25.0.0-alpha7",
42
- "@vaadin/overlay": "25.0.0-alpha7",
43
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha7",
44
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha7",
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-alpha7",
49
- "@vaadin/chai-plugins": "25.0.0-alpha7",
50
- "@vaadin/test-runner-commands": "25.0.0-alpha7",
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": "87f72707ce6866892f8be5782fa0da008e87dcbc"
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,10 +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);
64
+ this.showPopover();
49
65
  document.addEventListener('vaadin-overlay-close', this._boundVaadinOverlayClose);
50
66
  if (this._boundIosResizeListener) {
51
67
  this._detectIosNavbar();
@@ -53,6 +69,7 @@ export const NotificationContainerMixin = (superClass) =>
53
69
  }
54
70
  } else {
55
71
  document.body.removeChild(this);
72
+ this.hidePopover();
56
73
  document.removeEventListener('vaadin-overlay-close', this._boundVaadinOverlayClose);
57
74
  if (this._boundIosResizeListener) {
58
75
  window.removeEventListener('resize', this._boundIosResizeListener);
@@ -358,7 +375,11 @@ export const NotificationMixin = (superClass) =>
358
375
  return;
359
376
  }
360
377
 
361
- 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
+ }
362
383
 
363
384
  this._card.slot = this.position;
364
385
  if (this._container.firstElementChild && /top/u.test(this.position)) {
@@ -25,7 +25,7 @@ import { NotificationContainerMixin, NotificationMixin } from './vaadin-notifica
25
25
  * @private
26
26
  */
27
27
  class NotificationContainer extends NotificationContainerMixin(
28
- ThemableMixin(ElementMixin(LumoInjectionMixin(PolylitMixin(LitElement)))),
28
+ ThemableMixin(ElementMixin(PolylitMixin(LumoInjectionMixin(LitElement)))),
29
29
  ) {
30
30
  static get is() {
31
31
  return 'vaadin-notification-container';
@@ -63,7 +63,7 @@ class NotificationContainer extends NotificationContainerMixin(
63
63
  * @mixes ThemableMixin
64
64
  * @private
65
65
  */
66
- class NotificationCard extends ThemableMixin(LumoInjectionMixin(PolylitMixin(LitElement))) {
66
+ class NotificationCard extends ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))) {
67
67
  static get is() {
68
68
  return 'vaadin-notification-card';
69
69
  }
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-alpha7",
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-alpha7",
4
+ "version": "25.0.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {