@etsoo/materialui 1.4.12 → 1.4.14
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/app/ReactApp.d.ts +2 -2
- package/lib/app/ReactApp.js +7 -6
- package/lib/app/ServiceApp.d.ts +2 -2
- package/lib/app/ServiceApp.js +6 -4
- package/package.json +7 -7
- package/src/app/ReactApp.ts +7 -6
- package/src/app/ServiceApp.ts +6 -4
package/lib/app/ReactApp.d.ts
CHANGED
|
@@ -182,10 +182,10 @@ export declare class ReactApp<S extends IAppSettings, D extends IUser, P extends
|
|
|
182
182
|
freshCountdownUI(callback?: () => PromiseLike<unknown>): void;
|
|
183
183
|
/**
|
|
184
184
|
* Try login
|
|
185
|
-
* @param
|
|
185
|
+
* @param data Try login parameters
|
|
186
186
|
* @returns Result
|
|
187
187
|
*/
|
|
188
|
-
tryLogin(
|
|
188
|
+
tryLogin(data?: AppTryLoginParams): Promise<boolean>;
|
|
189
189
|
/**
|
|
190
190
|
* Check if the action result should be ignored during try login
|
|
191
191
|
* @param result Action result
|
package/lib/app/ReactApp.js
CHANGED
|
@@ -199,22 +199,22 @@ export class ReactApp extends CoreApp {
|
|
|
199
199
|
}
|
|
200
200
|
/**
|
|
201
201
|
* Try login
|
|
202
|
-
* @param
|
|
202
|
+
* @param data Try login parameters
|
|
203
203
|
* @returns Result
|
|
204
204
|
*/
|
|
205
|
-
async tryLogin(
|
|
205
|
+
async tryLogin(data) {
|
|
206
206
|
// Check status
|
|
207
|
-
const result = await super.tryLogin(
|
|
207
|
+
const result = await super.tryLogin(data);
|
|
208
208
|
if (!result) {
|
|
209
209
|
return false;
|
|
210
210
|
}
|
|
211
211
|
// Destruct
|
|
212
212
|
const { onFailure = () => {
|
|
213
213
|
this.toLoginPage(rest);
|
|
214
|
-
}, onSuccess, ...rest } =
|
|
214
|
+
}, onSuccess, ...rest } = data ?? {};
|
|
215
215
|
// Refresh token
|
|
216
216
|
await this.refreshToken({
|
|
217
|
-
showLoading:
|
|
217
|
+
showLoading: data?.showLoading
|
|
218
218
|
}, (result) => {
|
|
219
219
|
if (result === true) {
|
|
220
220
|
onSuccess?.();
|
|
@@ -223,7 +223,8 @@ export class ReactApp extends CoreApp {
|
|
|
223
223
|
onFailure();
|
|
224
224
|
}
|
|
225
225
|
else if (result != null && this.tryLoginIgnoreResult(result)) {
|
|
226
|
-
|
|
226
|
+
// Ignore the result warning
|
|
227
|
+
return true;
|
|
227
228
|
}
|
|
228
229
|
});
|
|
229
230
|
return true;
|
package/lib/app/ServiceApp.d.ts
CHANGED
|
@@ -36,9 +36,9 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, P extends
|
|
|
36
36
|
loadCore(): void;
|
|
37
37
|
/**
|
|
38
38
|
* Go to the login page
|
|
39
|
-
* @
|
|
39
|
+
* @param data Login parameters
|
|
40
40
|
*/
|
|
41
|
-
toLoginPage(
|
|
41
|
+
toLoginPage(data?: AppLoginParams): void;
|
|
42
42
|
/**
|
|
43
43
|
* User login extended
|
|
44
44
|
* @param user New user
|
package/lib/app/ServiceApp.js
CHANGED
|
@@ -38,11 +38,11 @@ export class ServiceApp extends ReactApp {
|
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Go to the login page
|
|
41
|
-
* @
|
|
41
|
+
* @param data Login parameters
|
|
42
42
|
*/
|
|
43
|
-
toLoginPage(
|
|
43
|
+
toLoginPage(data) {
|
|
44
44
|
// Destruct
|
|
45
|
-
const { removeUrl, showLoading,
|
|
45
|
+
const { removeUrl, showLoading, params } = data ?? {};
|
|
46
46
|
// Cache current URL
|
|
47
47
|
this.cachedUrl = removeUrl ? undefined : globalThis.location.href;
|
|
48
48
|
// Get the redirect URL
|
|
@@ -55,7 +55,9 @@ export class ServiceApp extends ReactApp {
|
|
|
55
55
|
if (!url)
|
|
56
56
|
return;
|
|
57
57
|
// Add try login flag
|
|
58
|
-
|
|
58
|
+
if (params != null) {
|
|
59
|
+
url = url.addUrlParams(params);
|
|
60
|
+
}
|
|
59
61
|
// Is it embeded?
|
|
60
62
|
if (this.embedded) {
|
|
61
63
|
globalThis.parent.postMessage(["login", url], this.coreOrigin);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.14",
|
|
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.4",
|
|
51
51
|
"@emotion/react": "^11.13.3",
|
|
52
52
|
"@emotion/styled": "^11.13.0",
|
|
53
|
-
"@etsoo/appscript": "^1.5.
|
|
53
|
+
"@etsoo/appscript": "^1.5.55",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.52",
|
|
55
|
-
"@etsoo/react": "^1.7.
|
|
55
|
+
"@etsoo/react": "^1.7.89",
|
|
56
56
|
"@etsoo/shared": "^1.2.51",
|
|
57
57
|
"@mui/icons-material": "^6.1.4",
|
|
58
58
|
"@mui/material": "^6.1.4",
|
|
59
|
-
"@mui/x-data-grid": "^7.
|
|
59
|
+
"@mui/x-data-grid": "^7.21.0",
|
|
60
60
|
"chart.js": "^4.4.5",
|
|
61
61
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
62
62
|
"eventemitter3": "^5.0.1",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@babel/preset-react": "^7.25.7",
|
|
78
78
|
"@babel/preset-typescript": "^7.25.7",
|
|
79
79
|
"@babel/runtime-corejs3": "^7.25.7",
|
|
80
|
-
"@testing-library/jest-dom": "^6.6.
|
|
80
|
+
"@testing-library/jest-dom": "^6.6.2",
|
|
81
81
|
"@testing-library/react": "^16.0.1",
|
|
82
82
|
"@types/jest": "^29.5.13",
|
|
83
83
|
"@types/pica": "^9.0.4",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"@types/react-dom": "^18.3.1",
|
|
88
88
|
"@types/react-input-mask": "^3.0.5",
|
|
89
89
|
"@types/react-window": "^1.8.8",
|
|
90
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
91
|
-
"@typescript-eslint/parser": "^8.
|
|
90
|
+
"@typescript-eslint/eslint-plugin": "^8.10.0",
|
|
91
|
+
"@typescript-eslint/parser": "^8.10.0",
|
|
92
92
|
"jest": "^29.7.0",
|
|
93
93
|
"jest-environment-jsdom": "^29.7.0",
|
|
94
94
|
"typescript": "^5.6.3"
|
package/src/app/ReactApp.ts
CHANGED
|
@@ -421,12 +421,12 @@ export class ReactApp<
|
|
|
421
421
|
|
|
422
422
|
/**
|
|
423
423
|
* Try login
|
|
424
|
-
* @param
|
|
424
|
+
* @param data Try login parameters
|
|
425
425
|
* @returns Result
|
|
426
426
|
*/
|
|
427
|
-
override async tryLogin(
|
|
427
|
+
override async tryLogin(data?: AppTryLoginParams) {
|
|
428
428
|
// Check status
|
|
429
|
-
const result = await super.tryLogin(
|
|
429
|
+
const result = await super.tryLogin(data);
|
|
430
430
|
if (!result) {
|
|
431
431
|
return false;
|
|
432
432
|
}
|
|
@@ -438,12 +438,12 @@ export class ReactApp<
|
|
|
438
438
|
},
|
|
439
439
|
onSuccess,
|
|
440
440
|
...rest
|
|
441
|
-
} =
|
|
441
|
+
} = data ?? {};
|
|
442
442
|
|
|
443
443
|
// Refresh token
|
|
444
444
|
await this.refreshToken(
|
|
445
445
|
{
|
|
446
|
-
showLoading:
|
|
446
|
+
showLoading: data?.showLoading
|
|
447
447
|
},
|
|
448
448
|
(result) => {
|
|
449
449
|
if (result === true) {
|
|
@@ -451,7 +451,8 @@ export class ReactApp<
|
|
|
451
451
|
} else if (result === false) {
|
|
452
452
|
onFailure();
|
|
453
453
|
} else if (result != null && this.tryLoginIgnoreResult(result)) {
|
|
454
|
-
|
|
454
|
+
// Ignore the result warning
|
|
455
|
+
return true;
|
|
455
456
|
}
|
|
456
457
|
}
|
|
457
458
|
);
|
package/src/app/ServiceApp.ts
CHANGED
|
@@ -76,11 +76,11 @@ export class ServiceApp<
|
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* Go to the login page
|
|
79
|
-
* @
|
|
79
|
+
* @param data Login parameters
|
|
80
80
|
*/
|
|
81
|
-
override toLoginPage(
|
|
81
|
+
override toLoginPage(data?: AppLoginParams) {
|
|
82
82
|
// Destruct
|
|
83
|
-
const { removeUrl, showLoading,
|
|
83
|
+
const { removeUrl, showLoading, params } = data ?? {};
|
|
84
84
|
|
|
85
85
|
// Cache current URL
|
|
86
86
|
this.cachedUrl = removeUrl ? undefined : globalThis.location.href;
|
|
@@ -95,7 +95,9 @@ export class ServiceApp<
|
|
|
95
95
|
if (!url) return;
|
|
96
96
|
|
|
97
97
|
// Add try login flag
|
|
98
|
-
|
|
98
|
+
if (params != null) {
|
|
99
|
+
url = url.addUrlParams(params);
|
|
100
|
+
}
|
|
99
101
|
|
|
100
102
|
// Is it embeded?
|
|
101
103
|
if (this.embedded) {
|