@etsoo/materialui 1.3.78 → 1.3.80
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/NotifierMU.d.ts +2 -1
- package/lib/NotifierMU.js +8 -2
- package/lib/app/ReactApp.d.ts +2 -1
- package/lib/app/ReactApp.js +5 -4
- package/lib/app/ServiceApp.d.ts +2 -1
- package/lib/app/ServiceApp.js +3 -2
- package/package.json +11 -11
- package/src/NotifierMU.tsx +12 -2
- package/src/app/ReactApp.ts +7 -6
- package/src/app/ServiceApp.ts +3 -2
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
|
package/lib/NotifierMU.d.ts
CHANGED
|
@@ -27,9 +27,10 @@ export declare class NotifierMU extends NotifierReact {
|
|
|
27
27
|
/**
|
|
28
28
|
* Create state and return provider
|
|
29
29
|
* @param className Style class name
|
|
30
|
+
* @param debug Debug mode
|
|
30
31
|
* @returns Provider
|
|
31
32
|
*/
|
|
32
|
-
static setup(className?: string): React.FunctionComponent<React.PropsWithChildren<import("@etsoo/react").NotificationReactRenderProps>>;
|
|
33
|
+
static setup(className?: string, debug?: boolean): React.FunctionComponent<React.PropsWithChildren<import("@etsoo/react").NotificationReactRenderProps>>;
|
|
33
34
|
private static getOrigin;
|
|
34
35
|
/**
|
|
35
36
|
* Create align container
|
package/lib/NotifierMU.js
CHANGED
|
@@ -277,12 +277,15 @@ export class NotifierMU extends NotifierReact {
|
|
|
277
277
|
/**
|
|
278
278
|
* Create state and return provider
|
|
279
279
|
* @param className Style class name
|
|
280
|
+
* @param debug Debug mode
|
|
280
281
|
* @returns Provider
|
|
281
282
|
*/
|
|
282
|
-
static setup(className =
|
|
283
|
+
static setup(className, debug = false) {
|
|
284
|
+
className ?? (className = "notifier-mu");
|
|
283
285
|
// Create an instance
|
|
284
286
|
const instance = new NotifierMU();
|
|
285
|
-
|
|
287
|
+
instance.debug = debug;
|
|
288
|
+
const provider = instance.createProvider(className, debug);
|
|
286
289
|
NotifierReact.updateInstance(instance);
|
|
287
290
|
return provider;
|
|
288
291
|
}
|
|
@@ -337,6 +340,9 @@ export class NotifierMU extends NotifierReact {
|
|
|
337
340
|
addRaw(data, modal) {
|
|
338
341
|
// Destruct
|
|
339
342
|
const { type, content, title, align, timespan = modal ? 0 : undefined, ...rest } = data;
|
|
343
|
+
if (this.debug) {
|
|
344
|
+
console.debug("NotificationMU.addRaw", data);
|
|
345
|
+
}
|
|
340
346
|
// Setup
|
|
341
347
|
const n = new NotificationMU(type, content, title, align, timespan);
|
|
342
348
|
// Assign other properties
|
package/lib/app/ReactApp.d.ts
CHANGED
|
@@ -137,8 +137,9 @@ export declare class ReactApp<S extends IAppSettings, D extends IUser, P extends
|
|
|
137
137
|
* Constructor
|
|
138
138
|
* @param settings Settings
|
|
139
139
|
* @param name Application name
|
|
140
|
+
* @param debug Debug mode
|
|
140
141
|
*/
|
|
141
|
-
constructor(settings: S, name: string);
|
|
142
|
+
constructor(settings: S, name: string, debug?: boolean);
|
|
142
143
|
/**
|
|
143
144
|
* Override alert action result
|
|
144
145
|
* @param result Action result
|
package/lib/app/ReactApp.js
CHANGED
|
@@ -57,18 +57,19 @@ export class ReactApp extends CoreApp {
|
|
|
57
57
|
static get notifierProvider() {
|
|
58
58
|
return this._notifierProvider;
|
|
59
59
|
}
|
|
60
|
-
static createNotifier() {
|
|
60
|
+
static createNotifier(debug) {
|
|
61
61
|
// Notifier
|
|
62
|
-
ReactApp._notifierProvider = NotifierMU.setup();
|
|
62
|
+
ReactApp._notifierProvider = NotifierMU.setup(undefined, debug);
|
|
63
63
|
return NotifierMU.instance;
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* Constructor
|
|
67
67
|
* @param settings Settings
|
|
68
68
|
* @param name Application name
|
|
69
|
+
* @param debug Debug mode
|
|
69
70
|
*/
|
|
70
|
-
constructor(settings, name) {
|
|
71
|
-
super(settings, createClient(), ReactApp.createNotifier(), new WindowStorage(), name);
|
|
71
|
+
constructor(settings, name, debug = false) {
|
|
72
|
+
super(settings, createClient(), ReactApp.createNotifier(debug), new WindowStorage(), name, debug);
|
|
72
73
|
/**
|
|
73
74
|
* User state
|
|
74
75
|
*/
|
package/lib/app/ServiceApp.d.ts
CHANGED
|
@@ -37,8 +37,9 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, P extends
|
|
|
37
37
|
* Constructor
|
|
38
38
|
* @param settings Settings
|
|
39
39
|
* @param name Application name
|
|
40
|
+
* @param debug Debug mode
|
|
40
41
|
*/
|
|
41
|
-
constructor(settings: S, name: string);
|
|
42
|
+
constructor(settings: S, name: string, debug?: boolean);
|
|
42
43
|
/**
|
|
43
44
|
* Service application API login
|
|
44
45
|
* @param appApi Service application API
|
package/lib/app/ServiceApp.js
CHANGED
|
@@ -22,9 +22,10 @@ export class ServiceApp extends ReactApp {
|
|
|
22
22
|
* Constructor
|
|
23
23
|
* @param settings Settings
|
|
24
24
|
* @param name Application name
|
|
25
|
+
* @param debug Debug mode
|
|
25
26
|
*/
|
|
26
|
-
constructor(settings, name) {
|
|
27
|
-
super(settings, name);
|
|
27
|
+
constructor(settings, name, debug = false) {
|
|
28
|
+
super(settings, name, debug);
|
|
28
29
|
/**
|
|
29
30
|
* Service passphrase
|
|
30
31
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.80",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -50,13 +50,13 @@
|
|
|
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.4
|
|
54
|
-
"@etsoo/notificationbase": "^1.1.
|
|
55
|
-
"@etsoo/react": "^1.7.
|
|
56
|
-
"@etsoo/shared": "^1.2.
|
|
57
|
-
"@mui/icons-material": "^5.16.
|
|
58
|
-
"@mui/material": "^5.16.
|
|
59
|
-
"@mui/x-data-grid": "^7.
|
|
53
|
+
"@etsoo/appscript": "^1.5.4",
|
|
54
|
+
"@etsoo/notificationbase": "^1.1.46",
|
|
55
|
+
"@etsoo/react": "^1.7.61",
|
|
56
|
+
"@etsoo/shared": "^1.2.44",
|
|
57
|
+
"@mui/icons-material": "^5.16.6",
|
|
58
|
+
"@mui/material": "^5.16.6",
|
|
59
|
+
"@mui/x-data-grid": "^7.12.0",
|
|
60
60
|
"chart.js": "^4.4.3",
|
|
61
61
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
62
62
|
"eventemitter3": "^5.0.1",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@babel/cli": "^7.24.8",
|
|
74
74
|
"@babel/core": "^7.25.2",
|
|
75
75
|
"@babel/plugin-transform-runtime": "^7.24.7",
|
|
76
|
-
"@babel/preset-env": "^7.25.
|
|
76
|
+
"@babel/preset-env": "^7.25.3",
|
|
77
77
|
"@babel/preset-react": "^7.24.7",
|
|
78
78
|
"@babel/preset-typescript": "^7.24.7",
|
|
79
79
|
"@babel/runtime-corejs3": "^7.25.0",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"@types/react-dom": "^18.3.0",
|
|
88
88
|
"@types/react-input-mask": "^3.0.5",
|
|
89
89
|
"@types/react-window": "^1.8.8",
|
|
90
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
91
|
-
"@typescript-eslint/parser": "^
|
|
90
|
+
"@typescript-eslint/eslint-plugin": "^8.0.1",
|
|
91
|
+
"@typescript-eslint/parser": "^8.0.1",
|
|
92
92
|
"jest": "^29.7.0",
|
|
93
93
|
"jest-environment-jsdom": "^29.7.0",
|
|
94
94
|
"typescript": "^5.5.4"
|
package/src/NotifierMU.tsx
CHANGED
|
@@ -602,13 +602,19 @@ export class NotifierMU extends NotifierReact {
|
|
|
602
602
|
/**
|
|
603
603
|
* Create state and return provider
|
|
604
604
|
* @param className Style class name
|
|
605
|
+
* @param debug Debug mode
|
|
605
606
|
* @returns Provider
|
|
606
607
|
*/
|
|
607
|
-
static setup(className =
|
|
608
|
+
static setup(className?: string, debug: boolean = false) {
|
|
609
|
+
className ??= "notifier-mu";
|
|
610
|
+
|
|
608
611
|
// Create an instance
|
|
609
612
|
const instance = new NotifierMU();
|
|
610
|
-
|
|
613
|
+
instance.debug = debug;
|
|
614
|
+
|
|
615
|
+
const provider = instance.createProvider(className, debug);
|
|
611
616
|
NotifierReact.updateInstance(instance);
|
|
617
|
+
|
|
612
618
|
return provider;
|
|
613
619
|
}
|
|
614
620
|
|
|
@@ -738,6 +744,10 @@ export class NotifierMU extends NotifierReact {
|
|
|
738
744
|
...rest
|
|
739
745
|
} = data;
|
|
740
746
|
|
|
747
|
+
if (this.debug) {
|
|
748
|
+
console.debug("NotificationMU.addRaw", data);
|
|
749
|
+
}
|
|
750
|
+
|
|
741
751
|
// Setup
|
|
742
752
|
const n = new NotificationMU(type, content, title, align, timespan);
|
|
743
753
|
|
package/src/app/ReactApp.ts
CHANGED
|
@@ -198,10 +198,9 @@ export class ReactApp<
|
|
|
198
198
|
return this._notifierProvider;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
private static createNotifier() {
|
|
201
|
+
private static createNotifier(debug: boolean) {
|
|
202
202
|
// Notifier
|
|
203
|
-
ReactApp._notifierProvider = NotifierMU.setup();
|
|
204
|
-
|
|
203
|
+
ReactApp._notifierProvider = NotifierMU.setup(undefined, debug);
|
|
205
204
|
return NotifierMU.instance;
|
|
206
205
|
}
|
|
207
206
|
|
|
@@ -249,14 +248,16 @@ export class ReactApp<
|
|
|
249
248
|
* Constructor
|
|
250
249
|
* @param settings Settings
|
|
251
250
|
* @param name Application name
|
|
251
|
+
* @param debug Debug mode
|
|
252
252
|
*/
|
|
253
|
-
constructor(settings: S, name: string) {
|
|
253
|
+
constructor(settings: S, name: string, debug: boolean = false) {
|
|
254
254
|
super(
|
|
255
255
|
settings,
|
|
256
256
|
createClient(),
|
|
257
|
-
ReactApp.createNotifier(),
|
|
257
|
+
ReactApp.createNotifier(debug),
|
|
258
258
|
new WindowStorage(),
|
|
259
|
-
name
|
|
259
|
+
name,
|
|
260
|
+
debug
|
|
260
261
|
);
|
|
261
262
|
|
|
262
263
|
if (BridgeUtils.host) {
|
package/src/app/ServiceApp.ts
CHANGED
|
@@ -64,9 +64,10 @@ export class ServiceApp<
|
|
|
64
64
|
* Constructor
|
|
65
65
|
* @param settings Settings
|
|
66
66
|
* @param name Application name
|
|
67
|
+
* @param debug Debug mode
|
|
67
68
|
*/
|
|
68
|
-
constructor(settings: S, name: string) {
|
|
69
|
-
super(settings, name);
|
|
69
|
+
constructor(settings: S, name: string, debug: boolean = false) {
|
|
70
|
+
super(settings, name, debug);
|
|
70
71
|
|
|
71
72
|
// Check
|
|
72
73
|
if (settings.serviceId == null || settings.serviceEndpoint == null) {
|