@etsoo/notificationbase 1.1.34 → 1.1.36
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/lib/Notification.js +1 -1
- package/lib/NotificationContainer.js +5 -6
- package/package.json +6 -6
- package/tsconfig.json +1 -1
package/lib/Notification.js
CHANGED
|
@@ -84,7 +84,7 @@ export class Notification {
|
|
|
84
84
|
else
|
|
85
85
|
this.align = NotificationAlign.Center;
|
|
86
86
|
// Display as modal will lasts otherwise 5 seconds to dismiss it
|
|
87
|
-
this.timespan = timespan
|
|
87
|
+
this.timespan = timespan ?? (this.modal ? 0 : 5);
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
90
|
* Dismiss it
|
|
@@ -156,7 +156,7 @@ export class NotificationContainer {
|
|
|
156
156
|
// Setup
|
|
157
157
|
const n = {
|
|
158
158
|
inputProps: props,
|
|
159
|
-
type: type
|
|
159
|
+
type: type ?? NotificationType.Error,
|
|
160
160
|
title,
|
|
161
161
|
content: error,
|
|
162
162
|
onReturn: callback
|
|
@@ -188,13 +188,12 @@ export class NotificationContainer {
|
|
|
188
188
|
* @param force Force to hide, otherwise, only the last one
|
|
189
189
|
*/
|
|
190
190
|
hideLoading(force) {
|
|
191
|
-
var _a;
|
|
192
191
|
// Deduct to count
|
|
193
192
|
this.loadingCount--;
|
|
194
193
|
if (force)
|
|
195
194
|
this.loadingCount = 0;
|
|
196
195
|
if (this.loadingCount === 0) {
|
|
197
|
-
|
|
196
|
+
this.lastLoading?.dismiss();
|
|
198
197
|
this.lastLoading = undefined;
|
|
199
198
|
}
|
|
200
199
|
}
|
|
@@ -208,7 +207,7 @@ export class NotificationContainer {
|
|
|
208
207
|
*/
|
|
209
208
|
message(type, message, title, parameters, props) {
|
|
210
209
|
// Destruct
|
|
211
|
-
const { align, timespan, callback, modal } = parameters
|
|
210
|
+
const { align, timespan, callback, modal } = parameters ?? {};
|
|
212
211
|
// Setup
|
|
213
212
|
const n = {
|
|
214
213
|
type,
|
|
@@ -252,7 +251,7 @@ export class NotificationContainer {
|
|
|
252
251
|
// Setup
|
|
253
252
|
const n = {
|
|
254
253
|
type: NotificationType.Loading,
|
|
255
|
-
content: title
|
|
254
|
+
content: title ?? ''
|
|
256
255
|
};
|
|
257
256
|
// Add to the collection
|
|
258
257
|
// Keep the reference
|
|
@@ -287,7 +286,7 @@ export class NotificationContainer {
|
|
|
287
286
|
*/
|
|
288
287
|
succeed(message, title, callback, timespan, props) {
|
|
289
288
|
// Default to zero for constant
|
|
290
|
-
timespan
|
|
289
|
+
timespan ?? (timespan = 0);
|
|
291
290
|
// Create as message
|
|
292
291
|
return this.message(NotificationMessageType.Success, message, title, {
|
|
293
292
|
align: NotificationAlign.Center,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/notificationbase",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.36",
|
|
4
4
|
"description": "TypeScript notification component for extending with all features described and partially implemented",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/ETSOO/NotificationBase#readme",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@etsoo/shared": "^1.2.
|
|
48
|
+
"@etsoo/shared": "^1.2.27"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@babel/core": "^7.
|
|
52
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
53
|
-
"@babel/preset-env": "^7.
|
|
54
|
-
"@babel/runtime-corejs3": "^7.
|
|
51
|
+
"@babel/core": "^7.24.0",
|
|
52
|
+
"@babel/plugin-transform-runtime": "^7.24.0",
|
|
53
|
+
"@babel/preset-env": "^7.24.0",
|
|
54
|
+
"@babel/runtime-corejs3": "^7.24.0",
|
|
55
55
|
"@types/jest": "^29.5.12",
|
|
56
56
|
"babel-jest": "^29.7.0",
|
|
57
57
|
"jest": "^29.7.0",
|