@vaadin/notification 23.1.0-alpha2 → 23.1.0-beta1
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": "23.1.0-
|
|
3
|
+
"version": "23.1.0-beta1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@polymer/polymer": "^3.0.0",
|
|
37
|
-
"@vaadin/component-base": "23.1.0-
|
|
38
|
-
"@vaadin/vaadin-lumo-styles": "23.1.0-
|
|
39
|
-
"@vaadin/vaadin-material-styles": "23.1.0-
|
|
40
|
-
"@vaadin/vaadin-themable-mixin": "23.1.0-
|
|
37
|
+
"@vaadin/component-base": "23.1.0-beta1",
|
|
38
|
+
"@vaadin/vaadin-lumo-styles": "23.1.0-beta1",
|
|
39
|
+
"@vaadin/vaadin-material-styles": "23.1.0-beta1",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "23.1.0-beta1",
|
|
41
41
|
"lit": "^2.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@esm-bundle/chai": "^4.3.4",
|
|
45
|
-
"@vaadin/button": "23.1.0-
|
|
46
|
-
"@vaadin/polymer-legacy-adapter": "23.1.0-
|
|
45
|
+
"@vaadin/button": "23.1.0-beta1",
|
|
46
|
+
"@vaadin/polymer-legacy-adapter": "23.1.0-beta1",
|
|
47
47
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
48
|
-
"sinon": "^
|
|
48
|
+
"sinon": "^13.0.2"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "8be43cf83102a6b9ccf309687446e590ce0164e8"
|
|
51
51
|
}
|
|
@@ -148,13 +148,13 @@ declare class Notification extends ThemePropertyMixin(ElementMixin(HTMLElement))
|
|
|
148
148
|
addEventListener<K extends keyof NotificationEventMap>(
|
|
149
149
|
type: K,
|
|
150
150
|
listener: (this: Notification, ev: NotificationEventMap[K]) => void,
|
|
151
|
-
options?: boolean | AddEventListenerOptions
|
|
151
|
+
options?: boolean | AddEventListenerOptions,
|
|
152
152
|
): void;
|
|
153
153
|
|
|
154
154
|
removeEventListener<K extends keyof NotificationEventMap>(
|
|
155
155
|
type: K,
|
|
156
156
|
listener: (this: Notification, ev: NotificationEventMap[K]) => void,
|
|
157
|
-
options?: boolean | EventListenerOptions
|
|
157
|
+
options?: boolean | EventListenerOptions,
|
|
158
158
|
): void;
|
|
159
159
|
|
|
160
160
|
/**
|
|
@@ -105,8 +105,8 @@ class NotificationContainer extends ThemableMixin(ElementMixin(PolymerElement))
|
|
|
105
105
|
opened: {
|
|
106
106
|
type: Boolean,
|
|
107
107
|
value: false,
|
|
108
|
-
observer: '_openedChanged'
|
|
109
|
-
}
|
|
108
|
+
observer: '_openedChanged',
|
|
109
|
+
},
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -144,7 +144,7 @@ class NotificationContainer extends ThemableMixin(ElementMixin(PolymerElement))
|
|
|
144
144
|
const landscape = innerWidth > innerHeight;
|
|
145
145
|
const clientHeight = document.documentElement.clientHeight;
|
|
146
146
|
if (landscape && clientHeight > innerHeight) {
|
|
147
|
-
this.style.bottom = clientHeight - innerHeight
|
|
147
|
+
this.style.bottom = `${clientHeight - innerHeight}px`;
|
|
148
148
|
} else {
|
|
149
149
|
this.style.bottom = '0';
|
|
150
150
|
}
|
|
@@ -277,7 +277,7 @@ class Notification extends ThemePropertyMixin(ElementMixin(PolymerElement)) {
|
|
|
277
277
|
*/
|
|
278
278
|
duration: {
|
|
279
279
|
type: Number,
|
|
280
|
-
value: 5000
|
|
280
|
+
value: 5000,
|
|
281
281
|
},
|
|
282
282
|
|
|
283
283
|
/**
|
|
@@ -288,7 +288,7 @@ class Notification extends ThemePropertyMixin(ElementMixin(PolymerElement)) {
|
|
|
288
288
|
type: Boolean,
|
|
289
289
|
value: false,
|
|
290
290
|
notify: true,
|
|
291
|
-
observer: '_openedChanged'
|
|
291
|
+
observer: '_openedChanged',
|
|
292
292
|
},
|
|
293
293
|
|
|
294
294
|
/**
|
|
@@ -299,7 +299,7 @@ class Notification extends ThemePropertyMixin(ElementMixin(PolymerElement)) {
|
|
|
299
299
|
position: {
|
|
300
300
|
type: String,
|
|
301
301
|
value: 'bottom-start',
|
|
302
|
-
observer: '_positionChanged'
|
|
302
|
+
observer: '_positionChanged',
|
|
303
303
|
},
|
|
304
304
|
|
|
305
305
|
/**
|
|
@@ -311,7 +311,7 @@ class Notification extends ThemePropertyMixin(ElementMixin(PolymerElement)) {
|
|
|
311
311
|
* - `notification` The reference to the `<vaadin-notification>` element.
|
|
312
312
|
* @type {!NotificationRenderer | undefined}
|
|
313
313
|
*/
|
|
314
|
-
renderer: Function
|
|
314
|
+
renderer: Function,
|
|
315
315
|
};
|
|
316
316
|
}
|
|
317
317
|
|
|
@@ -437,14 +437,18 @@ class Notification extends ThemePropertyMixin(ElementMixin(PolymerElement)) {
|
|
|
437
437
|
|
|
438
438
|
/** @private */
|
|
439
439
|
_removeNotificationCard() {
|
|
440
|
-
|
|
440
|
+
if (this._card.parentNode) {
|
|
441
|
+
this._card.parentNode.removeChild(this._card);
|
|
442
|
+
}
|
|
441
443
|
this._card.removeAttribute('closing');
|
|
442
444
|
this._container.opened = Boolean(this._container.firstElementChild);
|
|
443
445
|
}
|
|
444
446
|
|
|
445
447
|
/** @private */
|
|
446
448
|
_closeNotificationCard() {
|
|
447
|
-
|
|
449
|
+
if (this._durationTimeoutId) {
|
|
450
|
+
clearTimeout(this._durationTimeoutId);
|
|
451
|
+
}
|
|
448
452
|
this._animatedRemoveNotificationCard();
|
|
449
453
|
}
|
|
450
454
|
|
|
@@ -452,7 +456,7 @@ class Notification extends ThemePropertyMixin(ElementMixin(PolymerElement)) {
|
|
|
452
456
|
_animatedRemoveNotificationCard() {
|
|
453
457
|
this._card.setAttribute('closing', '');
|
|
454
458
|
const name = getComputedStyle(this._card).getPropertyValue('animation-name');
|
|
455
|
-
if (name && name
|
|
459
|
+
if (name && name !== 'none') {
|
|
456
460
|
const listener = () => {
|
|
457
461
|
this._removeNotificationCard();
|
|
458
462
|
this._card.removeEventListener('animationend', listener);
|
|
@@ -22,7 +22,7 @@ registerStyles(
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
`,
|
|
25
|
-
{ moduleId: 'material-notification-container' }
|
|
25
|
+
{ moduleId: 'material-notification-container' },
|
|
26
26
|
);
|
|
27
27
|
|
|
28
28
|
const notificationCard = css`
|
|
@@ -152,5 +152,5 @@ const notificationCard = css`
|
|
|
152
152
|
`;
|
|
153
153
|
|
|
154
154
|
registerStyles('vaadin-notification-card', [colorDark, notificationCard], {
|
|
155
|
-
moduleId: 'material-notification-card'
|
|
155
|
+
moduleId: 'material-notification-card',
|
|
156
156
|
});
|