@etsoo/notificationbase 1.1.44 → 1.1.46
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/LICENSE +1 -1
- package/__tests__/Notification.ts +1 -1
- package/lib/cjs/NotificationContainer.d.ts +18 -1
- package/lib/cjs/NotificationContainer.js +14 -1
- package/lib/mjs/NotificationContainer.d.ts +18 -1
- package/lib/mjs/NotificationContainer.js +14 -1
- package/package.json +7 -7
- package/src/NotificationContainer.ts +27 -1
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2004-2024 ETSOO® (亿速思维 ®), https://
|
|
3
|
+
Copyright (c) 2004-2024 ETSOO ® (亿速思维 ®), https://etsoo.com, https://etsoo.nz
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -55,7 +55,7 @@ test('Tests for notification dismiss', () => {
|
|
|
55
55
|
jest.runOnlyPendingTimers();
|
|
56
56
|
|
|
57
57
|
// dismiss should be called 2 times
|
|
58
|
-
expect(spy).
|
|
58
|
+
expect(spy).toHaveBeenCalledTimes(2);
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
test('Tests for notification container add', () => {
|
|
@@ -23,6 +23,14 @@ export interface INotifier<UI, C extends NotificationCallProps> {
|
|
|
23
23
|
* Is model window showing
|
|
24
24
|
*/
|
|
25
25
|
readonly isModeling: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Loading count
|
|
28
|
+
*/
|
|
29
|
+
readonly loadingCount: number;
|
|
30
|
+
/**
|
|
31
|
+
* Is debug mode
|
|
32
|
+
*/
|
|
33
|
+
debug: boolean;
|
|
26
34
|
/**
|
|
27
35
|
* Add notification
|
|
28
36
|
* @param notification Notification
|
|
@@ -124,7 +132,16 @@ export interface INotifier<UI, C extends NotificationCallProps> {
|
|
|
124
132
|
export declare abstract class NotificationContainer<UI, C extends NotificationCallProps> implements INotifier<UI, C> {
|
|
125
133
|
private update;
|
|
126
134
|
private lastLoading?;
|
|
127
|
-
private
|
|
135
|
+
private _loadingCount;
|
|
136
|
+
/**
|
|
137
|
+
* Loading count
|
|
138
|
+
*/
|
|
139
|
+
get loadingCount(): number;
|
|
140
|
+
private set loadingCount(value);
|
|
141
|
+
/**
|
|
142
|
+
* Is debug mode
|
|
143
|
+
*/
|
|
144
|
+
debug: boolean;
|
|
128
145
|
/**
|
|
129
146
|
* Notification collection to display
|
|
130
147
|
*/
|
|
@@ -6,6 +6,15 @@ const Notification_1 = require("./Notification");
|
|
|
6
6
|
* Notification container class
|
|
7
7
|
*/
|
|
8
8
|
class NotificationContainer {
|
|
9
|
+
/**
|
|
10
|
+
* Loading count
|
|
11
|
+
*/
|
|
12
|
+
get loadingCount() {
|
|
13
|
+
return this._loadingCount;
|
|
14
|
+
}
|
|
15
|
+
set loadingCount(value) {
|
|
16
|
+
this._loadingCount = value;
|
|
17
|
+
}
|
|
9
18
|
/**
|
|
10
19
|
* Is loading bar showing
|
|
11
20
|
*/
|
|
@@ -22,7 +31,11 @@ class NotificationContainer {
|
|
|
22
31
|
* Constructor
|
|
23
32
|
*/
|
|
24
33
|
constructor(update) {
|
|
25
|
-
this.
|
|
34
|
+
this._loadingCount = 0;
|
|
35
|
+
/**
|
|
36
|
+
* Is debug mode
|
|
37
|
+
*/
|
|
38
|
+
this.debug = false;
|
|
26
39
|
// Update callback
|
|
27
40
|
this.update = update;
|
|
28
41
|
// Init notification collection
|
|
@@ -23,6 +23,14 @@ export interface INotifier<UI, C extends NotificationCallProps> {
|
|
|
23
23
|
* Is model window showing
|
|
24
24
|
*/
|
|
25
25
|
readonly isModeling: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Loading count
|
|
28
|
+
*/
|
|
29
|
+
readonly loadingCount: number;
|
|
30
|
+
/**
|
|
31
|
+
* Is debug mode
|
|
32
|
+
*/
|
|
33
|
+
debug: boolean;
|
|
26
34
|
/**
|
|
27
35
|
* Add notification
|
|
28
36
|
* @param notification Notification
|
|
@@ -124,7 +132,16 @@ export interface INotifier<UI, C extends NotificationCallProps> {
|
|
|
124
132
|
export declare abstract class NotificationContainer<UI, C extends NotificationCallProps> implements INotifier<UI, C> {
|
|
125
133
|
private update;
|
|
126
134
|
private lastLoading?;
|
|
127
|
-
private
|
|
135
|
+
private _loadingCount;
|
|
136
|
+
/**
|
|
137
|
+
* Loading count
|
|
138
|
+
*/
|
|
139
|
+
get loadingCount(): number;
|
|
140
|
+
private set loadingCount(value);
|
|
141
|
+
/**
|
|
142
|
+
* Is debug mode
|
|
143
|
+
*/
|
|
144
|
+
debug: boolean;
|
|
128
145
|
/**
|
|
129
146
|
* Notification collection to display
|
|
130
147
|
*/
|
|
@@ -3,6 +3,15 @@ import { NotificationAlign, NotificationMessageType, NotificationModalType, Noti
|
|
|
3
3
|
* Notification container class
|
|
4
4
|
*/
|
|
5
5
|
export class NotificationContainer {
|
|
6
|
+
/**
|
|
7
|
+
* Loading count
|
|
8
|
+
*/
|
|
9
|
+
get loadingCount() {
|
|
10
|
+
return this._loadingCount;
|
|
11
|
+
}
|
|
12
|
+
set loadingCount(value) {
|
|
13
|
+
this._loadingCount = value;
|
|
14
|
+
}
|
|
6
15
|
/**
|
|
7
16
|
* Is loading bar showing
|
|
8
17
|
*/
|
|
@@ -19,7 +28,11 @@ export class NotificationContainer {
|
|
|
19
28
|
* Constructor
|
|
20
29
|
*/
|
|
21
30
|
constructor(update) {
|
|
22
|
-
this.
|
|
31
|
+
this._loadingCount = 0;
|
|
32
|
+
/**
|
|
33
|
+
* Is debug mode
|
|
34
|
+
*/
|
|
35
|
+
this.debug = false;
|
|
23
36
|
// Update callback
|
|
24
37
|
this.update = update;
|
|
25
38
|
// Init notification collection
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/notificationbase",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.46",
|
|
4
4
|
"description": "TypeScript notification component for extending with all features described and partially implemented",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -52,18 +52,18 @@
|
|
|
52
52
|
},
|
|
53
53
|
"homepage": "https://github.com/ETSOO/NotificationBase#readme",
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@etsoo/shared": "^1.2.
|
|
55
|
+
"@etsoo/shared": "^1.2.44"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@babel/core": "^7.
|
|
58
|
+
"@babel/core": "^7.25.2",
|
|
59
59
|
"@babel/plugin-transform-runtime": "^7.24.7",
|
|
60
|
-
"@babel/preset-env": "^7.
|
|
61
|
-
"@babel/runtime-corejs3": "^7.
|
|
60
|
+
"@babel/preset-env": "^7.25.3",
|
|
61
|
+
"@babel/runtime-corejs3": "^7.25.0",
|
|
62
62
|
"@types/jest": "^29.5.12",
|
|
63
63
|
"babel-jest": "^29.7.0",
|
|
64
64
|
"jest": "^29.7.0",
|
|
65
65
|
"jest-environment-jsdom": "^29.7.0",
|
|
66
|
-
"ts-jest": "^29.
|
|
67
|
-
"typescript": "^5.4
|
|
66
|
+
"ts-jest": "^29.2.4",
|
|
67
|
+
"typescript": "^5.5.4"
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -39,6 +39,16 @@ export interface INotifier<UI, C extends NotificationCallProps> {
|
|
|
39
39
|
*/
|
|
40
40
|
readonly isModeling: boolean;
|
|
41
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Loading count
|
|
44
|
+
*/
|
|
45
|
+
readonly loadingCount: number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Is debug mode
|
|
49
|
+
*/
|
|
50
|
+
debug: boolean;
|
|
51
|
+
|
|
42
52
|
/**
|
|
43
53
|
* Add notification
|
|
44
54
|
* @param notification Notification
|
|
@@ -192,7 +202,23 @@ export abstract class NotificationContainer<UI, C extends NotificationCallProps>
|
|
|
192
202
|
|
|
193
203
|
// Last loading
|
|
194
204
|
private lastLoading?: INotification<UI, C>;
|
|
195
|
-
|
|
205
|
+
|
|
206
|
+
private _loadingCount = 0;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Loading count
|
|
210
|
+
*/
|
|
211
|
+
get loadingCount() {
|
|
212
|
+
return this._loadingCount;
|
|
213
|
+
}
|
|
214
|
+
private set loadingCount(value: number) {
|
|
215
|
+
this._loadingCount = value;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Is debug mode
|
|
220
|
+
*/
|
|
221
|
+
debug: boolean = false;
|
|
196
222
|
|
|
197
223
|
/**
|
|
198
224
|
* Notification collection to display
|