@vaadin/notification 24.0.0-alpha10 → 24.0.0-alpha12
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 +9 -9
- package/src/vaadin-notification.d.ts +2 -1
- package/src/vaadin-notification.js +10 -3
- package/web-types.json +23 -1
- package/web-types.lit.json +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/notification",
|
|
3
|
-
"version": "24.0.0-
|
|
3
|
+
"version": "24.0.0-alpha12",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,17 +38,17 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@polymer/polymer": "^3.0.0",
|
|
41
|
-
"@vaadin/component-base": "24.0.0-
|
|
42
|
-
"@vaadin/lit-renderer": "24.0.0-
|
|
43
|
-
"@vaadin/vaadin-lumo-styles": "24.0.0-
|
|
44
|
-
"@vaadin/vaadin-material-styles": "24.0.0-
|
|
45
|
-
"@vaadin/vaadin-themable-mixin": "24.0.0-
|
|
41
|
+
"@vaadin/component-base": "24.0.0-alpha12",
|
|
42
|
+
"@vaadin/lit-renderer": "24.0.0-alpha12",
|
|
43
|
+
"@vaadin/vaadin-lumo-styles": "24.0.0-alpha12",
|
|
44
|
+
"@vaadin/vaadin-material-styles": "24.0.0-alpha12",
|
|
45
|
+
"@vaadin/vaadin-themable-mixin": "24.0.0-alpha12",
|
|
46
46
|
"lit": "^2.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@esm-bundle/chai": "^4.3.4",
|
|
50
|
-
"@vaadin/button": "24.0.0-
|
|
51
|
-
"@vaadin/polymer-legacy-adapter": "24.0.0-
|
|
50
|
+
"@vaadin/button": "24.0.0-alpha12",
|
|
51
|
+
"@vaadin/polymer-legacy-adapter": "24.0.0-alpha12",
|
|
52
52
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
53
53
|
"sinon": "^13.0.2"
|
|
54
54
|
},
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"web-types.json",
|
|
57
57
|
"web-types.lit.json"
|
|
58
58
|
],
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "7e29eee4d522fb7b03ac8e7e385e9057d71c79ce"
|
|
60
60
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { TemplateResult } from 'lit';
|
|
7
7
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
8
|
+
import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
|
|
8
9
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
10
|
import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
|
|
10
11
|
|
|
@@ -99,7 +100,7 @@ declare class NotificationCard extends ThemableMixin(HTMLElement) {}
|
|
|
99
100
|
*
|
|
100
101
|
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
101
102
|
*/
|
|
102
|
-
declare class Notification extends ThemePropertyMixin(ElementMixin(HTMLElement)) {
|
|
103
|
+
declare class Notification extends OverlayClassMixin(ThemePropertyMixin(ElementMixin(HTMLElement))) {
|
|
103
104
|
/**
|
|
104
105
|
* Shows a notification with the given content.
|
|
105
106
|
* By default, positions the notification at `bottom-start` and uses a 5 second duration.
|
|
@@ -8,6 +8,7 @@ import { render } from 'lit';
|
|
|
8
8
|
import { isTemplateResult } from 'lit/directive-helpers.js';
|
|
9
9
|
import { isIOS } from '@vaadin/component-base/src/browser-utils.js';
|
|
10
10
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
11
|
+
import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
|
|
11
12
|
import { processTemplates } from '@vaadin/component-base/src/templates.js';
|
|
12
13
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
14
|
import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
|
|
@@ -251,8 +252,9 @@ class NotificationCard extends ThemableMixin(PolymerElement) {
|
|
|
251
252
|
* @extends HTMLElement
|
|
252
253
|
* @mixes ThemePropertyMixin
|
|
253
254
|
* @mixes ElementMixin
|
|
255
|
+
* @mixes OverlayClassMixin
|
|
254
256
|
*/
|
|
255
|
-
class Notification extends ThemePropertyMixin(ElementMixin(PolymerElement)) {
|
|
257
|
+
class Notification extends OverlayClassMixin(ThemePropertyMixin(ElementMixin(PolymerElement))) {
|
|
256
258
|
static get template() {
|
|
257
259
|
return html`
|
|
258
260
|
<style>
|
|
@@ -316,7 +318,7 @@ class Notification extends ThemePropertyMixin(ElementMixin(PolymerElement)) {
|
|
|
316
318
|
}
|
|
317
319
|
|
|
318
320
|
static get observers() {
|
|
319
|
-
return ['_durationChanged(duration, opened)', '_rendererChanged(renderer, opened,
|
|
321
|
+
return ['_durationChanged(duration, opened)', '_rendererChanged(renderer, opened, _overlayElement)'];
|
|
320
322
|
}
|
|
321
323
|
|
|
322
324
|
/**
|
|
@@ -385,11 +387,16 @@ class Notification extends ThemePropertyMixin(ElementMixin(PolymerElement)) {
|
|
|
385
387
|
return Notification._container;
|
|
386
388
|
}
|
|
387
389
|
|
|
390
|
+
/** @protected */
|
|
391
|
+
get _card() {
|
|
392
|
+
return this._overlayElement;
|
|
393
|
+
}
|
|
394
|
+
|
|
388
395
|
/** @protected */
|
|
389
396
|
ready() {
|
|
390
397
|
super.ready();
|
|
391
398
|
|
|
392
|
-
this.
|
|
399
|
+
this._overlayElement = this.shadowRoot.querySelector('vaadin-notification-card');
|
|
393
400
|
|
|
394
401
|
processTemplates(this);
|
|
395
402
|
}
|
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": "24.0.0-
|
|
4
|
+
"version": "24.0.0-alpha12",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -10,6 +10,17 @@
|
|
|
10
10
|
"name": "vaadin-notification",
|
|
11
11
|
"description": "`<vaadin-notification>` is a Web Component providing accessible and customizable notifications (toasts).\n\n### Rendering\n\nThe content of the notification can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `notification` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `notification`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-notification id=\"notification\"></vaadin-notification>\n```\n```js\nconst notification = document.querySelector('#notification');\nnotification.renderer = function(root, notification) {\n root.textContent = \"Your work has been saved\";\n};\n```\n\nRenderer is called on the opening of the notification.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\n`<vaadin-notification>` uses `<vaadin-notification-card>` internal\nthemable component as the actual visible notification cards.\n\nThe following shadow DOM parts of the `<vaadin-notification-card>` are available for styling:\n\nPart name | Description\n----------------|----------------\n`overlay` | The notification container\n`content` | The content of the notification\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.\n\nNote: the `theme` attribute value set on `<vaadin-notification>` is\npropagated to the internal `<vaadin-notification-card>`.",
|
|
12
12
|
"attributes": [
|
|
13
|
+
{
|
|
14
|
+
"name": "overlay-class",
|
|
15
|
+
"description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
|
|
16
|
+
"value": {
|
|
17
|
+
"type": [
|
|
18
|
+
"string",
|
|
19
|
+
"null",
|
|
20
|
+
"undefined"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
13
24
|
{
|
|
14
25
|
"name": "duration",
|
|
15
26
|
"description": "The duration in milliseconds to show the notification.\nSet to `0` or a negative number to disable the notification auto-closing.",
|
|
@@ -51,6 +62,17 @@
|
|
|
51
62
|
],
|
|
52
63
|
"js": {
|
|
53
64
|
"properties": [
|
|
65
|
+
{
|
|
66
|
+
"name": "overlayClass",
|
|
67
|
+
"description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
|
|
68
|
+
"value": {
|
|
69
|
+
"type": [
|
|
70
|
+
"string",
|
|
71
|
+
"null",
|
|
72
|
+
"undefined"
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
},
|
|
54
76
|
{
|
|
55
77
|
"name": "duration",
|
|
56
78
|
"description": "The duration in milliseconds to show the notification.\nSet to `0` or a negative number to disable the notification auto-closing.",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/notification",
|
|
4
|
-
"version": "24.0.0-
|
|
4
|
+
"version": "24.0.0-alpha12",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -26,6 +26,13 @@
|
|
|
26
26
|
"kind": "expression"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
+
{
|
|
30
|
+
"name": ".overlayClass",
|
|
31
|
+
"description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
|
|
32
|
+
"value": {
|
|
33
|
+
"kind": "expression"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
29
36
|
{
|
|
30
37
|
"name": ".duration",
|
|
31
38
|
"description": "The duration in milliseconds to show the notification.\nSet to `0` or a negative number to disable the notification auto-closing.",
|