@etsoo/notificationbase 1.1.68 → 1.1.69
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/lib/cjs/Notification.js +57 -5
- package/lib/cjs/NotificationContainer.js +14 -6
- package/lib/mjs/Notification.js +57 -5
- package/lib/mjs/NotificationContainer.js +14 -6
- package/package.json +3 -3
- package/tsconfig.cjs.json +2 -1
- package/tsconfig.json +3 -2
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2004-
|
|
3
|
+
Copyright (c) 2004-2026 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
|
package/lib/cjs/Notification.js
CHANGED
|
@@ -51,12 +51,69 @@ exports.NotificationType = {
|
|
|
51
51
|
* Generic parameter UI presents UI element type
|
|
52
52
|
*/
|
|
53
53
|
class Notification {
|
|
54
|
+
/**
|
|
55
|
+
* Display align
|
|
56
|
+
*/
|
|
57
|
+
align;
|
|
58
|
+
/**
|
|
59
|
+
* Content
|
|
60
|
+
*/
|
|
61
|
+
content;
|
|
62
|
+
/**
|
|
63
|
+
* Dismiss timeout seed
|
|
64
|
+
*/
|
|
65
|
+
dismissSeed = 0;
|
|
66
|
+
/**
|
|
67
|
+
* Unique id
|
|
68
|
+
*/
|
|
69
|
+
id;
|
|
70
|
+
/**
|
|
71
|
+
* Input or control properties
|
|
72
|
+
*/
|
|
73
|
+
inputProps;
|
|
74
|
+
/**
|
|
75
|
+
* Display as modal
|
|
76
|
+
*/
|
|
77
|
+
modal;
|
|
78
|
+
/**
|
|
79
|
+
* On dismiss handling
|
|
80
|
+
*/
|
|
81
|
+
onDismiss;
|
|
82
|
+
/**
|
|
83
|
+
* On return value
|
|
84
|
+
*/
|
|
85
|
+
onReturn;
|
|
86
|
+
_open = true;
|
|
54
87
|
/**
|
|
55
88
|
* Is open or not
|
|
56
89
|
*/
|
|
57
90
|
get open() {
|
|
58
91
|
return this._open;
|
|
59
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Reference
|
|
95
|
+
*/
|
|
96
|
+
ref;
|
|
97
|
+
/**
|
|
98
|
+
* Render setup / callback
|
|
99
|
+
*/
|
|
100
|
+
renderSetup;
|
|
101
|
+
/**
|
|
102
|
+
* Show the icon or hide it
|
|
103
|
+
*/
|
|
104
|
+
showIcon;
|
|
105
|
+
/**
|
|
106
|
+
* Seconds to auto dismiss
|
|
107
|
+
*/
|
|
108
|
+
timespan;
|
|
109
|
+
/**
|
|
110
|
+
* Title
|
|
111
|
+
*/
|
|
112
|
+
title;
|
|
113
|
+
/**
|
|
114
|
+
* Type
|
|
115
|
+
*/
|
|
116
|
+
type;
|
|
60
117
|
/**
|
|
61
118
|
* Constructor
|
|
62
119
|
* @param type Type
|
|
@@ -66,11 +123,6 @@ class Notification {
|
|
|
66
123
|
* @param timespan Timespan
|
|
67
124
|
*/
|
|
68
125
|
constructor(type, content, title, align, timespan) {
|
|
69
|
-
/**
|
|
70
|
-
* Dismiss timeout seed
|
|
71
|
-
*/
|
|
72
|
-
this.dismissSeed = 0;
|
|
73
|
-
this._open = true;
|
|
74
126
|
this.id = shared_1.Utils.newGUID();
|
|
75
127
|
this.type = type;
|
|
76
128
|
this.content = content;
|
|
@@ -6,6 +6,11 @@ const Notification_1 = require("./Notification");
|
|
|
6
6
|
* Notification container class
|
|
7
7
|
*/
|
|
8
8
|
class NotificationContainer {
|
|
9
|
+
// Registered update action
|
|
10
|
+
update;
|
|
11
|
+
// Last loading
|
|
12
|
+
lastLoading;
|
|
13
|
+
_loadingCount = 0;
|
|
9
14
|
/**
|
|
10
15
|
* Loading count
|
|
11
16
|
*/
|
|
@@ -15,6 +20,14 @@ class NotificationContainer {
|
|
|
15
20
|
set loadingCount(value) {
|
|
16
21
|
this._loadingCount = value;
|
|
17
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Is debug mode
|
|
25
|
+
*/
|
|
26
|
+
debug = false;
|
|
27
|
+
/**
|
|
28
|
+
* Notification collection to display
|
|
29
|
+
*/
|
|
30
|
+
notifications;
|
|
18
31
|
/**
|
|
19
32
|
* Is loading bar showing
|
|
20
33
|
*/
|
|
@@ -31,11 +44,6 @@ class NotificationContainer {
|
|
|
31
44
|
* Constructor
|
|
32
45
|
*/
|
|
33
46
|
constructor(update) {
|
|
34
|
-
this._loadingCount = 0;
|
|
35
|
-
/**
|
|
36
|
-
* Is debug mode
|
|
37
|
-
*/
|
|
38
|
-
this.debug = false;
|
|
39
47
|
// Update callback
|
|
40
48
|
this.update = update;
|
|
41
49
|
// Init notification collection
|
|
@@ -328,7 +336,7 @@ class NotificationContainer {
|
|
|
328
336
|
*/
|
|
329
337
|
succeed(message, title, callback, timespan, props) {
|
|
330
338
|
// Default to zero for constant
|
|
331
|
-
timespan
|
|
339
|
+
timespan ??= 0;
|
|
332
340
|
// Create as message
|
|
333
341
|
return this.message(Notification_1.NotificationMessageType.Success, message, title, {
|
|
334
342
|
align: Notification_1.NotificationAlign.Center,
|
package/lib/mjs/Notification.js
CHANGED
|
@@ -48,12 +48,69 @@ export const NotificationType = {
|
|
|
48
48
|
* Generic parameter UI presents UI element type
|
|
49
49
|
*/
|
|
50
50
|
export class Notification {
|
|
51
|
+
/**
|
|
52
|
+
* Display align
|
|
53
|
+
*/
|
|
54
|
+
align;
|
|
55
|
+
/**
|
|
56
|
+
* Content
|
|
57
|
+
*/
|
|
58
|
+
content;
|
|
59
|
+
/**
|
|
60
|
+
* Dismiss timeout seed
|
|
61
|
+
*/
|
|
62
|
+
dismissSeed = 0;
|
|
63
|
+
/**
|
|
64
|
+
* Unique id
|
|
65
|
+
*/
|
|
66
|
+
id;
|
|
67
|
+
/**
|
|
68
|
+
* Input or control properties
|
|
69
|
+
*/
|
|
70
|
+
inputProps;
|
|
71
|
+
/**
|
|
72
|
+
* Display as modal
|
|
73
|
+
*/
|
|
74
|
+
modal;
|
|
75
|
+
/**
|
|
76
|
+
* On dismiss handling
|
|
77
|
+
*/
|
|
78
|
+
onDismiss;
|
|
79
|
+
/**
|
|
80
|
+
* On return value
|
|
81
|
+
*/
|
|
82
|
+
onReturn;
|
|
83
|
+
_open = true;
|
|
51
84
|
/**
|
|
52
85
|
* Is open or not
|
|
53
86
|
*/
|
|
54
87
|
get open() {
|
|
55
88
|
return this._open;
|
|
56
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Reference
|
|
92
|
+
*/
|
|
93
|
+
ref;
|
|
94
|
+
/**
|
|
95
|
+
* Render setup / callback
|
|
96
|
+
*/
|
|
97
|
+
renderSetup;
|
|
98
|
+
/**
|
|
99
|
+
* Show the icon or hide it
|
|
100
|
+
*/
|
|
101
|
+
showIcon;
|
|
102
|
+
/**
|
|
103
|
+
* Seconds to auto dismiss
|
|
104
|
+
*/
|
|
105
|
+
timespan;
|
|
106
|
+
/**
|
|
107
|
+
* Title
|
|
108
|
+
*/
|
|
109
|
+
title;
|
|
110
|
+
/**
|
|
111
|
+
* Type
|
|
112
|
+
*/
|
|
113
|
+
type;
|
|
57
114
|
/**
|
|
58
115
|
* Constructor
|
|
59
116
|
* @param type Type
|
|
@@ -63,11 +120,6 @@ export class Notification {
|
|
|
63
120
|
* @param timespan Timespan
|
|
64
121
|
*/
|
|
65
122
|
constructor(type, content, title, align, timespan) {
|
|
66
|
-
/**
|
|
67
|
-
* Dismiss timeout seed
|
|
68
|
-
*/
|
|
69
|
-
this.dismissSeed = 0;
|
|
70
|
-
this._open = true;
|
|
71
123
|
this.id = Utils.newGUID();
|
|
72
124
|
this.type = type;
|
|
73
125
|
this.content = content;
|
|
@@ -3,6 +3,11 @@ import { NotificationAlign, NotificationMessageType, NotificationModalType, Noti
|
|
|
3
3
|
* Notification container class
|
|
4
4
|
*/
|
|
5
5
|
export class NotificationContainer {
|
|
6
|
+
// Registered update action
|
|
7
|
+
update;
|
|
8
|
+
// Last loading
|
|
9
|
+
lastLoading;
|
|
10
|
+
_loadingCount = 0;
|
|
6
11
|
/**
|
|
7
12
|
* Loading count
|
|
8
13
|
*/
|
|
@@ -12,6 +17,14 @@ export class NotificationContainer {
|
|
|
12
17
|
set loadingCount(value) {
|
|
13
18
|
this._loadingCount = value;
|
|
14
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Is debug mode
|
|
22
|
+
*/
|
|
23
|
+
debug = false;
|
|
24
|
+
/**
|
|
25
|
+
* Notification collection to display
|
|
26
|
+
*/
|
|
27
|
+
notifications;
|
|
15
28
|
/**
|
|
16
29
|
* Is loading bar showing
|
|
17
30
|
*/
|
|
@@ -28,11 +41,6 @@ export class NotificationContainer {
|
|
|
28
41
|
* Constructor
|
|
29
42
|
*/
|
|
30
43
|
constructor(update) {
|
|
31
|
-
this._loadingCount = 0;
|
|
32
|
-
/**
|
|
33
|
-
* Is debug mode
|
|
34
|
-
*/
|
|
35
|
-
this.debug = false;
|
|
36
44
|
// Update callback
|
|
37
45
|
this.update = update;
|
|
38
46
|
// Init notification collection
|
|
@@ -325,7 +333,7 @@ export class NotificationContainer {
|
|
|
325
333
|
*/
|
|
326
334
|
succeed(message, title, callback, timespan, props) {
|
|
327
335
|
// Default to zero for constant
|
|
328
|
-
timespan
|
|
336
|
+
timespan ??= 0;
|
|
329
337
|
// Create as message
|
|
330
338
|
return this.message(NotificationMessageType.Success, message, title, {
|
|
331
339
|
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.69",
|
|
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",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/ETSOO/NotificationBase#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@etsoo/shared": "^1.2.
|
|
38
|
+
"@etsoo/shared": "^1.2.82"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@babel/core": "^7.29.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@babel/runtime-corejs3": "^7.29.2",
|
|
45
45
|
"@vitejs/plugin-react": "^6.0.1",
|
|
46
46
|
"jsdom": "^29.0.1",
|
|
47
|
-
"typescript": "^
|
|
47
|
+
"typescript": "^6.0.2",
|
|
48
48
|
"vitest": "^4.1.2"
|
|
49
49
|
}
|
|
50
50
|
}
|
package/tsconfig.cjs.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
|
-
"target": "
|
|
4
|
+
"target": "ES2025",
|
|
5
5
|
"module": "NodeNext",
|
|
6
6
|
"moduleResolution": "NodeNext",
|
|
7
7
|
"isolatedModules": true,
|
|
8
|
+
"rootDir": "./src",
|
|
8
9
|
"outDir": "./lib/cjs",
|
|
9
10
|
"noEmit": false,
|
|
10
11
|
"declaration": true,
|
package/tsconfig.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
|
-
"target": "
|
|
5
|
-
"module": "
|
|
4
|
+
"target": "ES2025",
|
|
5
|
+
"module": "ESNext",
|
|
6
6
|
"moduleResolution": "bundler",
|
|
7
7
|
"isolatedModules": true,
|
|
8
|
+
"rootDir": "./src",
|
|
8
9
|
"outDir": "./lib/mjs",
|
|
9
10
|
"noEmit": false,
|
|
10
11
|
"declaration": true,
|