@vaadin/vaadin-notification 1.6.1 → 1.6.2

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/README.md CHANGED
@@ -1,21 +1,21 @@
1
- [![npm version](https://badgen.net/npm/v/@vaadin/vaadin-notification)](https://www.npmjs.com/package/@vaadin/vaadin-notification)
2
- [![Bower version](https://badgen.net/github/release/vaadin/vaadin-notification)](https://github.com/vaadin/vaadin-notification/releases)
3
- [![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/vaadin/vaadin-notification)
4
- [![Build Status](https://travis-ci.org/vaadin/vaadin-notification.svg?branch=master)](https://travis-ci.org/vaadin/vaadin-notification)
5
- [![Coverage Status](https://coveralls.io/repos/github/vaadin/vaadin-notification/badge.svg?branch=master)](https://coveralls.io/github/vaadin/vaadin-notification?branch=master)
6
- [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/vaadin/web-components?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
1
+ # <vaadin-notification>
7
2
 
8
- [![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-notification)
9
- [![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/vaadinvaadin-notification.svg)](https://vaadin.com/directory/component/vaadinvaadin-notification)
3
+ > ⚠️ Starting from Vaadin 20, the source code and issues for this component are migrated to the [`vaadin/web-components`](https://github.com/vaadin/web-components/tree/master/packages/vaadin-notification) monorepository.
4
+ > This repository contains the source code and releases of `<vaadin-notification>` for the Vaadin versions 10 to 19.
10
5
 
11
- # &lt;vaadin-notification&gt;
6
+ [&lt;vaadin-notification&gt;](https://vaadin.com/components/vaadin-notification) is a Web Component providing accessible and customizable notifications (toasts), part of the [Vaadin components](https://vaadin.com/components).
12
7
 
13
8
  [Live Demo ↗](https://vaadin.com/components/vaadin-notification/html-examples)
14
9
  |
15
10
  [API documentation ↗](https://vaadin.com/components/vaadin-notification/html-api)
16
11
 
17
-
18
- [&lt;vaadin-notification&gt;](https://vaadin.com/components/vaadin-notification) is a Web Component providing accessible and customizable notifications (toasts), part of the [Vaadin components](https://vaadin.com/components).
12
+ [![npm version](https://badgen.net/npm/v/@vaadin/vaadin-notification)](https://www.npmjs.com/package/@vaadin/vaadin-notification)
13
+ [![Bower version](https://badgen.net/github/release/vaadin/vaadin-notification)](https://github.com/vaadin/vaadin-notification/releases)
14
+ [![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/vaadin/vaadin-notification)
15
+ [![Build Status](https://travis-ci.org/vaadin/vaadin-notification.svg?branch=master)](https://travis-ci.org/vaadin/vaadin-notification)
16
+ [![Coverage Status](https://coveralls.io/repos/github/vaadin/vaadin-notification/badge.svg?branch=master)](https://coveralls.io/github/vaadin/vaadin-notification?branch=master)
17
+ [![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-notification)
18
+ [![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/vaadinvaadin-notification.svg)](https://vaadin.com/directory/component/vaadinvaadin-notification)
19
19
 
20
20
  <!--
21
21
  ```
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "repository": "vaadin/vaadin-notification",
11
11
  "homepage": "https://vaadin.com/components",
12
12
  "name": "@vaadin/vaadin-notification",
13
- "version": "1.6.1",
13
+ "version": "1.6.2",
14
14
  "main": "vaadin-notification.js",
15
15
  "author": "Vaadin Ltd",
16
16
  "license": "Apache-2.0",
@@ -40,9 +40,9 @@
40
40
  "@vaadin/vaadin-material-styles": "^1.3.2"
41
41
  },
42
42
  "scripts": {
43
- "generate-typings": "gen-typescript-declarations --outDir . --verify"
44
- },
45
- "devDependencies": {
43
+ "generate-typings": "gen-typescript-declarations --outDir . --verify"
44
+ },
45
+ "devDependencies": {
46
46
  "@polymer/iron-component-page": "^4.0.0",
47
47
  "@webcomponents/webcomponentsjs": "^2.0.0",
48
48
  "wct-browser-legacy": "^1.0.1",
@@ -112,12 +112,14 @@ class NotificationContainer extends ThemableMixin(ElementMixin(PolymerElement))
112
112
  _openedChanged(opened) {
113
113
  if (opened) {
114
114
  document.body.appendChild(this);
115
+ document.addEventListener('vaadin-overlay-close', this._boundVaadinOverlayClose);
115
116
  if (this._boundIosResizeListener) {
116
117
  this._detectIosNavbar();
117
118
  window.addEventListener('resize', this._boundIosResizeListener);
118
119
  }
119
120
  } else {
120
121
  document.body.removeChild(this);
122
+ document.removeEventListener('vaadin-overlay-close', this._boundVaadinOverlayClose);
121
123
  if (this._boundIosResizeListener) {
122
124
  window.removeEventListener('resize', this._boundIosResizeListener);
123
125
  }
@@ -127,6 +129,7 @@ class NotificationContainer extends ThemableMixin(ElementMixin(PolymerElement))
127
129
  constructor() {
128
130
  super();
129
131
 
132
+ this._boundVaadinOverlayClose = this._onVaadinOverlayClose.bind(this);
130
133
  if (/iPad|iPhone|iPod/.test(navigator.userAgent)) {
131
134
  this._boundIosResizeListener = () => this._detectIosNavbar();
132
135
  }
@@ -144,6 +147,17 @@ class NotificationContainer extends ThemableMixin(ElementMixin(PolymerElement))
144
147
  this.style.bottom = '0';
145
148
  }
146
149
  }
150
+
151
+ /** @private */
152
+ _onVaadinOverlayClose(event) {
153
+ // Notifications are a separate overlay mechanism from vaadin-overlay, and
154
+ // interacting with them should not close modal overlays
155
+ const sourceEvent = event.detail.sourceEvent;
156
+ const isFromNotification = sourceEvent && sourceEvent.composedPath().indexOf(this) >= 0;
157
+ if (isFromNotification) {
158
+ event.preventDefault();
159
+ }
160
+ }
147
161
  }
148
162
 
149
163
  /**
@@ -273,7 +287,7 @@ class NotificationElement extends ThemePropertyMixin(ElementMixin(PolymerElement
273
287
  }
274
288
 
275
289
  static get version() {
276
- return '1.6.1';
290
+ return '1.6.2';
277
291
  }
278
292
 
279
293
  static get properties() {