@umbraco-ui/uui-toast-notification 1.0.0-rc.1 → 1.0.0-rc.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/custom-elements.json
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"attributes": [
|
|
8
8
|
{
|
|
9
9
|
"name": "color",
|
|
10
|
-
"description": "Changes the
|
|
11
|
-
"type": "
|
|
10
|
+
"description": "Changes the color of the notification to one of the predefined, symbolic colors. Example: set this to danger to indicate errors.",
|
|
11
|
+
"type": "'' | 'default' | 'positive' | 'warning' | 'danger'",
|
|
12
12
|
"default": "\"\\\"\\\"\""
|
|
13
13
|
},
|
|
14
14
|
{
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
{
|
|
34
34
|
"name": "color",
|
|
35
35
|
"attribute": "color",
|
|
36
|
-
"description": "Changes the
|
|
37
|
-
"type": "
|
|
36
|
+
"description": "Changes the color of the notification to one of the predefined, symbolic colors. Example: set this to danger to indicate errors.",
|
|
37
|
+
"type": "'' | 'default' | 'positive' | 'warning' | 'danger'",
|
|
38
38
|
"default": "\"\\\"\\\"\""
|
|
39
39
|
},
|
|
40
40
|
{
|
package/lib/index.js
CHANGED
|
@@ -94,7 +94,12 @@ let UUIToastNotificationElement = class extends LitElement {
|
|
|
94
94
|
demandCustomElement(this, "uui-icon");
|
|
95
95
|
}
|
|
96
96
|
_getAnimationDuration() {
|
|
97
|
-
return parseInt(
|
|
97
|
+
return parseInt(
|
|
98
|
+
getComputedStyle(this).getPropertyValue(
|
|
99
|
+
"--uui-toast-notification-animation-duration"
|
|
100
|
+
),
|
|
101
|
+
10
|
|
102
|
+
) || 480;
|
|
98
103
|
}
|
|
99
104
|
_makeOpen() {
|
|
100
105
|
if (this._open === true) {
|
|
@@ -112,7 +117,9 @@ let UUIToastNotificationElement = class extends LitElement {
|
|
|
112
117
|
this.setAttribute("is-open", "");
|
|
113
118
|
this.style.height = this._toastEl.getBoundingClientRect().height + "px";
|
|
114
119
|
this._animate = true;
|
|
115
|
-
this.dispatchEvent(
|
|
120
|
+
this.dispatchEvent(
|
|
121
|
+
new UUIToastNotificationEvent(UUIToastNotificationEvent.OPENING)
|
|
122
|
+
);
|
|
116
123
|
this._animationTimeout = window.setTimeout(() => {
|
|
117
124
|
var _a;
|
|
118
125
|
if (this.isOpen === true) {
|
|
@@ -121,7 +128,9 @@ let UUIToastNotificationElement = class extends LitElement {
|
|
|
121
128
|
if (this._pauseTimer === false) {
|
|
122
129
|
(_a = this._timer) == null ? void 0 : _a.start();
|
|
123
130
|
}
|
|
124
|
-
this.dispatchEvent(
|
|
131
|
+
this.dispatchEvent(
|
|
132
|
+
new UUIToastNotificationEvent(UUIToastNotificationEvent.OPENED)
|
|
133
|
+
);
|
|
125
134
|
}
|
|
126
135
|
}, this._getAnimationDuration());
|
|
127
136
|
});
|
|
@@ -132,7 +141,10 @@ let UUIToastNotificationElement = class extends LitElement {
|
|
|
132
141
|
if (this._open === false) {
|
|
133
142
|
return;
|
|
134
143
|
}
|
|
135
|
-
const event = new UUIToastNotificationEvent(
|
|
144
|
+
const event = new UUIToastNotificationEvent(
|
|
145
|
+
UUIToastNotificationEvent.CLOSING,
|
|
146
|
+
{ cancelable: true }
|
|
147
|
+
);
|
|
136
148
|
this.dispatchEvent(event);
|
|
137
149
|
if (event.defaultPrevented === true) {
|
|
138
150
|
return;
|
|
@@ -153,7 +165,9 @@ let UUIToastNotificationElement = class extends LitElement {
|
|
|
153
165
|
this._animationTimeout = window.setTimeout(() => {
|
|
154
166
|
if (this.isOpen === false) {
|
|
155
167
|
this._animate = false;
|
|
156
|
-
this.dispatchEvent(
|
|
168
|
+
this.dispatchEvent(
|
|
169
|
+
new UUIToastNotificationEvent(UUIToastNotificationEvent.CLOSED)
|
|
170
|
+
);
|
|
157
171
|
if (this.parentNode) {
|
|
158
172
|
this.parentNode.removeChild(this);
|
|
159
173
|
}
|
|
@@ -261,7 +275,7 @@ UUIToastNotificationElement.styles = [
|
|
|
261
275
|
color: var(--uui-color-text,#060606);
|
|
262
276
|
border-color: var(--uui-color-surface,#fff);
|
|
263
277
|
}
|
|
264
|
-
:host([color='
|
|
278
|
+
:host([color='default']) #toast > div {
|
|
265
279
|
background-color: var(--uui-color-default,#1b264f);
|
|
266
280
|
color: var(--uui-color-default-contrast,#fff);
|
|
267
281
|
border-color: var(--uui-color-default-standalone,rgb(28, 35, 59));
|
|
@@ -11,8 +11,8 @@ import { LitElement } from 'lit';
|
|
|
11
11
|
export declare class UUIToastNotificationElement extends LitElement {
|
|
12
12
|
static styles: import("lit").CSSResult[];
|
|
13
13
|
/**
|
|
14
|
-
* Changes the
|
|
15
|
-
* @type {
|
|
14
|
+
* Changes the color of the notification to one of the predefined, symbolic colors. Example: set this to danger to indicate errors.
|
|
15
|
+
* @type {'' | 'default' | 'positive' | 'warning' | 'danger'}
|
|
16
16
|
* @attr
|
|
17
17
|
* @default ""
|
|
18
18
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-toast-notification",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Umbraco",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"custom-elements.json"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@umbraco-ui/uui-base": "1.0.0-rc.
|
|
34
|
-
"@umbraco-ui/uui-button": "1.0.0-rc.
|
|
35
|
-
"@umbraco-ui/uui-css": "1.0.0-rc.
|
|
36
|
-
"@umbraco-ui/uui-icon": "1.0.0-rc.
|
|
37
|
-
"@umbraco-ui/uui-icon-registry-essential": "1.0.0-rc.
|
|
33
|
+
"@umbraco-ui/uui-base": "1.0.0-rc.2",
|
|
34
|
+
"@umbraco-ui/uui-button": "1.0.0-rc.2",
|
|
35
|
+
"@umbraco-ui/uui-css": "1.0.0-rc.2",
|
|
36
|
+
"@umbraco-ui/uui-icon": "1.0.0-rc.2",
|
|
37
|
+
"@umbraco-ui/uui-icon-registry-essential": "1.0.0-rc.2"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://uui.umbraco.com/?path=/story/uui-toast-notification",
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "436dd8d9fff81481feb88f06b461167c98dac91a"
|
|
49
49
|
}
|