@etsoo/react 1.7.59 → 1.7.61
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.
|
@@ -91,16 +91,10 @@ export interface INotifierReact extends INotifier<React.ReactNode, NotificationR
|
|
|
91
91
|
/**
|
|
92
92
|
* Create state provider
|
|
93
93
|
* @param className Style class name
|
|
94
|
-
* @param
|
|
94
|
+
* @param debug Is debug mode
|
|
95
95
|
* @returns Provider
|
|
96
96
|
*/
|
|
97
|
-
createProvider(className?: string,
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Notifier options generator
|
|
101
|
-
*/
|
|
102
|
-
export interface INotifierOptions {
|
|
103
|
-
(): any;
|
|
97
|
+
createProvider(className?: string, debug?: boolean): React.FunctionComponent<NotificationReactRenderProps>;
|
|
104
98
|
}
|
|
105
99
|
/**
|
|
106
100
|
* Notifier for React
|
|
@@ -136,6 +130,6 @@ export declare abstract class NotifierReact extends NotificationContainer<React.
|
|
|
136
130
|
* @param className Style class name
|
|
137
131
|
* @returns Provider
|
|
138
132
|
*/
|
|
139
|
-
createProvider(className?: string): React.FunctionComponent<React.PropsWithChildren<NotificationReactRenderProps>>;
|
|
133
|
+
createProvider(className?: string, debug?: boolean): React.FunctionComponent<React.PropsWithChildren<NotificationReactRenderProps>>;
|
|
140
134
|
}
|
|
141
135
|
export {};
|
package/lib/notifier/Notifier.js
CHANGED
|
@@ -28,6 +28,10 @@ export class NotifierReact extends NotificationContainer {
|
|
|
28
28
|
*/
|
|
29
29
|
constructor() {
|
|
30
30
|
super((notification, dismiss) => {
|
|
31
|
+
// Debug
|
|
32
|
+
if (this.debug) {
|
|
33
|
+
console.debug('NotifierReact.updateCallback', notification, dismiss, this.loadingCount);
|
|
34
|
+
}
|
|
31
35
|
// Make sure the state update is set
|
|
32
36
|
if (this.stateUpdate)
|
|
33
37
|
this.stateUpdate({ notification, dismiss });
|
|
@@ -38,7 +42,7 @@ export class NotifierReact extends NotificationContainer {
|
|
|
38
42
|
* @param className Style class name
|
|
39
43
|
* @returns Provider
|
|
40
44
|
*/
|
|
41
|
-
createProvider(className) {
|
|
45
|
+
createProvider(className, debug) {
|
|
42
46
|
// Custom creator
|
|
43
47
|
const creator = (state, update, props) => {
|
|
44
48
|
// Hold the current state update
|
|
@@ -53,6 +57,10 @@ export class NotifierReact extends NotificationContainer {
|
|
|
53
57
|
// Add to the collection
|
|
54
58
|
aligns.push(this.createContainer(Number(align), ui));
|
|
55
59
|
}
|
|
60
|
+
// Debug
|
|
61
|
+
if (debug) {
|
|
62
|
+
console.debug('NotifierReact.createProvider', className, state, aligns);
|
|
63
|
+
}
|
|
56
64
|
// Generate the component
|
|
57
65
|
return React.createElement('div', { className }, aligns);
|
|
58
66
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/react",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.61",
|
|
4
4
|
"description": "TypeScript ReactJs UI Independent Framework",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@emotion/css": "^11.13.0",
|
|
51
51
|
"@emotion/react": "^11.13.0",
|
|
52
52
|
"@emotion/styled": "^11.13.0",
|
|
53
|
-
"@etsoo/appscript": "^1.5.
|
|
53
|
+
"@etsoo/appscript": "^1.5.4",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.46",
|
|
55
55
|
"@etsoo/shared": "^1.2.44",
|
|
56
56
|
"react": "^18.3.1",
|
package/src/notifier/Notifier.ts
CHANGED
|
@@ -135,22 +135,15 @@ export interface INotifierReact
|
|
|
135
135
|
/**
|
|
136
136
|
* Create state provider
|
|
137
137
|
* @param className Style class name
|
|
138
|
-
* @param
|
|
138
|
+
* @param debug Is debug mode
|
|
139
139
|
* @returns Provider
|
|
140
140
|
*/
|
|
141
141
|
createProvider(
|
|
142
142
|
className?: string,
|
|
143
|
-
|
|
143
|
+
debug?: boolean
|
|
144
144
|
): React.FunctionComponent<NotificationReactRenderProps>;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
/**
|
|
148
|
-
* Notifier options generator
|
|
149
|
-
*/
|
|
150
|
-
export interface INotifierOptions {
|
|
151
|
-
(): any;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
147
|
/**
|
|
155
148
|
* Notifier for React
|
|
156
149
|
*/
|
|
@@ -181,6 +174,16 @@ export abstract class NotifierReact
|
|
|
181
174
|
*/
|
|
182
175
|
protected constructor() {
|
|
183
176
|
super((notification, dismiss) => {
|
|
177
|
+
// Debug
|
|
178
|
+
if (this.debug) {
|
|
179
|
+
console.debug(
|
|
180
|
+
'NotifierReact.updateCallback',
|
|
181
|
+
notification,
|
|
182
|
+
dismiss,
|
|
183
|
+
this.loadingCount
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
184
187
|
// Make sure the state update is set
|
|
185
188
|
if (this.stateUpdate) this.stateUpdate({ notification, dismiss });
|
|
186
189
|
});
|
|
@@ -207,7 +210,7 @@ export abstract class NotifierReact
|
|
|
207
210
|
* @param className Style class name
|
|
208
211
|
* @returns Provider
|
|
209
212
|
*/
|
|
210
|
-
createProvider(className?: string) {
|
|
213
|
+
createProvider(className?: string, debug?: boolean) {
|
|
211
214
|
// Custom creator
|
|
212
215
|
const creator = (
|
|
213
216
|
state: ReactNotifications,
|
|
@@ -235,6 +238,16 @@ export abstract class NotifierReact
|
|
|
235
238
|
aligns.push(this.createContainer(Number(align), ui));
|
|
236
239
|
}
|
|
237
240
|
|
|
241
|
+
// Debug
|
|
242
|
+
if (debug) {
|
|
243
|
+
console.debug(
|
|
244
|
+
'NotifierReact.createProvider',
|
|
245
|
+
className,
|
|
246
|
+
state,
|
|
247
|
+
aligns
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
|
|
238
251
|
// Generate the component
|
|
239
252
|
return React.createElement('div', { className }, aligns);
|
|
240
253
|
};
|