@etsoo/materialui 1.6.84 → 1.6.86
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.
|
@@ -64,12 +64,12 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, S extends
|
|
|
64
64
|
* @param keep Keep in local storage or not
|
|
65
65
|
* @param dispatch User state dispatch
|
|
66
66
|
*/
|
|
67
|
-
userLoginEx(user: U & ServiceUserToken, core?: ApiRefreshTokenDto, dispatch?: boolean): void
|
|
67
|
+
userLoginEx(user: U & ServiceUserToken, core?: ApiRefreshTokenDto, dispatch?: boolean): Promise<void>;
|
|
68
68
|
/**
|
|
69
69
|
* Save core system data
|
|
70
70
|
* @param data Data
|
|
71
71
|
*/
|
|
72
|
-
protected saveCoreToken(data: ApiRefreshTokenDto): void
|
|
72
|
+
protected saveCoreToken(data: ApiRefreshTokenDto): Promise<void>;
|
|
73
73
|
/**
|
|
74
74
|
* On switch organization handler
|
|
75
75
|
* This method is called when the organization is switched successfully
|
|
@@ -120,14 +120,14 @@ class ServiceApp extends ReactApp_1.ReactApp {
|
|
|
120
120
|
* @param keep Keep in local storage or not
|
|
121
121
|
* @param dispatch User state dispatch
|
|
122
122
|
*/
|
|
123
|
-
userLoginEx(user, core, dispatch) {
|
|
123
|
+
async userLoginEx(user, core, dispatch) {
|
|
124
124
|
if (user.clientDeviceId && user.passphrase) {
|
|
125
125
|
// Save the passphrase
|
|
126
126
|
// Interpolated string expressions are different between TypeScript and C# for the null value
|
|
127
|
-
const passphrase = this.decrypt(user.passphrase, `${user.uid ?? ""}-${this.settings.appId}`);
|
|
127
|
+
const passphrase = await this.decrypt(user.passphrase, `${user.uid ?? ""}-${this.settings.appId}`);
|
|
128
128
|
if (passphrase) {
|
|
129
129
|
this.deviceId = user.clientDeviceId;
|
|
130
|
-
this.updatePassphrase(passphrase);
|
|
130
|
+
await this.updatePassphrase(passphrase);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
// User login
|
|
@@ -149,11 +149,11 @@ class ServiceApp extends ReactApp_1.ReactApp {
|
|
|
149
149
|
* Save core system data
|
|
150
150
|
* @param data Data
|
|
151
151
|
*/
|
|
152
|
-
saveCoreToken(data) {
|
|
152
|
+
async saveCoreToken(data) {
|
|
153
153
|
// Hold the core system access token
|
|
154
154
|
this.coreAccessToken = data.accessToken;
|
|
155
155
|
// Cache the core system refresh token
|
|
156
|
-
this.storage.setData(coreTokenKey, this.encrypt(data.refreshToken));
|
|
156
|
+
this.storage.setData(coreTokenKey, await this.encrypt(data.refreshToken));
|
|
157
157
|
// Exchange tokens
|
|
158
158
|
this.exchangeTokenAll(data);
|
|
159
159
|
}
|
|
@@ -203,7 +203,7 @@ class ServiceApp extends ReactApp_1.ReactApp {
|
|
|
203
203
|
callback?.({ ok: false, type: "noData", title: "Core token is blank" });
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
|
-
const coreTokenDecrypted = this.decrypt(coreToken);
|
|
206
|
+
const coreTokenDecrypted = await this.decrypt(coreToken);
|
|
207
207
|
if (!coreTokenDecrypted) {
|
|
208
208
|
callback?.({
|
|
209
209
|
ok: false,
|
|
@@ -64,12 +64,12 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, S extends
|
|
|
64
64
|
* @param keep Keep in local storage or not
|
|
65
65
|
* @param dispatch User state dispatch
|
|
66
66
|
*/
|
|
67
|
-
userLoginEx(user: U & ServiceUserToken, core?: ApiRefreshTokenDto, dispatch?: boolean): void
|
|
67
|
+
userLoginEx(user: U & ServiceUserToken, core?: ApiRefreshTokenDto, dispatch?: boolean): Promise<void>;
|
|
68
68
|
/**
|
|
69
69
|
* Save core system data
|
|
70
70
|
* @param data Data
|
|
71
71
|
*/
|
|
72
|
-
protected saveCoreToken(data: ApiRefreshTokenDto): void
|
|
72
|
+
protected saveCoreToken(data: ApiRefreshTokenDto): Promise<void>;
|
|
73
73
|
/**
|
|
74
74
|
* On switch organization handler
|
|
75
75
|
* This method is called when the organization is switched successfully
|
|
@@ -117,14 +117,14 @@ export class ServiceApp extends ReactApp {
|
|
|
117
117
|
* @param keep Keep in local storage or not
|
|
118
118
|
* @param dispatch User state dispatch
|
|
119
119
|
*/
|
|
120
|
-
userLoginEx(user, core, dispatch) {
|
|
120
|
+
async userLoginEx(user, core, dispatch) {
|
|
121
121
|
if (user.clientDeviceId && user.passphrase) {
|
|
122
122
|
// Save the passphrase
|
|
123
123
|
// Interpolated string expressions are different between TypeScript and C# for the null value
|
|
124
|
-
const passphrase = this.decrypt(user.passphrase, `${user.uid ?? ""}-${this.settings.appId}`);
|
|
124
|
+
const passphrase = await this.decrypt(user.passphrase, `${user.uid ?? ""}-${this.settings.appId}`);
|
|
125
125
|
if (passphrase) {
|
|
126
126
|
this.deviceId = user.clientDeviceId;
|
|
127
|
-
this.updatePassphrase(passphrase);
|
|
127
|
+
await this.updatePassphrase(passphrase);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
// User login
|
|
@@ -146,11 +146,11 @@ export class ServiceApp extends ReactApp {
|
|
|
146
146
|
* Save core system data
|
|
147
147
|
* @param data Data
|
|
148
148
|
*/
|
|
149
|
-
saveCoreToken(data) {
|
|
149
|
+
async saveCoreToken(data) {
|
|
150
150
|
// Hold the core system access token
|
|
151
151
|
this.coreAccessToken = data.accessToken;
|
|
152
152
|
// Cache the core system refresh token
|
|
153
|
-
this.storage.setData(coreTokenKey, this.encrypt(data.refreshToken));
|
|
153
|
+
this.storage.setData(coreTokenKey, await this.encrypt(data.refreshToken));
|
|
154
154
|
// Exchange tokens
|
|
155
155
|
this.exchangeTokenAll(data);
|
|
156
156
|
}
|
|
@@ -200,7 +200,7 @@ export class ServiceApp extends ReactApp {
|
|
|
200
200
|
callback?.({ ok: false, type: "noData", title: "Core token is blank" });
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
|
-
const coreTokenDecrypted = this.decrypt(coreToken);
|
|
203
|
+
const coreTokenDecrypted = await this.decrypt(coreToken);
|
|
204
204
|
if (!coreTokenDecrypted) {
|
|
205
205
|
callback?.({
|
|
206
206
|
ok: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.86",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -36,17 +36,17 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/ETSOO/ReactMU#readme",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@base-ui/react": "^1.
|
|
39
|
+
"@base-ui/react": "^1.8.0",
|
|
40
40
|
"@dnd-kit/react": "^0.5.0",
|
|
41
41
|
"@emotion/react": "^11.14.0",
|
|
42
42
|
"@emotion/styled": "^11.14.1",
|
|
43
|
-
"@etsoo/appscript": "^1.6.
|
|
43
|
+
"@etsoo/appscript": "^1.6.77",
|
|
44
44
|
"@etsoo/notificationbase": "^1.1.75",
|
|
45
|
-
"@etsoo/react": "^1.9.
|
|
45
|
+
"@etsoo/react": "^1.9.2",
|
|
46
46
|
"@etsoo/shared": "^1.2.91",
|
|
47
|
-
"@mui/icons-material": "^9.
|
|
48
|
-
"@mui/material": "^9.
|
|
49
|
-
"@mui/x-data-grid": "^9.
|
|
47
|
+
"@mui/icons-material": "^9.4.0",
|
|
48
|
+
"@mui/material": "^9.4.0",
|
|
49
|
+
"@mui/x-data-grid": "^9.13.0",
|
|
50
50
|
"chart.js": "^4.5.1",
|
|
51
51
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
52
52
|
"dompurify": "^3.4.14",
|
|
@@ -66,24 +66,18 @@
|
|
|
66
66
|
"react-dom": "$react-dom"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@babel/core": "^8.0.1",
|
|
70
|
-
"@babel/plugin-transform-runtime": "^8.0.1",
|
|
71
|
-
"@babel/preset-env": "^8.0.2",
|
|
72
|
-
"@babel/preset-react": "^8.0.1",
|
|
73
|
-
"@babel/preset-typescript": "^8.0.1",
|
|
74
|
-
"@babel/runtime-corejs3": "^8.0.0",
|
|
75
69
|
"@testing-library/jest-dom": "^7.0.1",
|
|
76
|
-
"@testing-library/react": "^16.3.
|
|
70
|
+
"@testing-library/react": "^16.3.3",
|
|
77
71
|
"@types/pica": "^9.0.5",
|
|
78
72
|
"@types/pulltorefreshjs": "^0.1.7",
|
|
79
73
|
"@types/react": "^19.2.18",
|
|
80
74
|
"@types/react-avatar-editor": "^13.0.4",
|
|
81
|
-
"@types/react-dom": "^19.2.
|
|
75
|
+
"@types/react-dom": "^19.2.7",
|
|
82
76
|
"@types/react-input-mask": "^3.0.6",
|
|
83
|
-
"@vitejs/plugin-react": "^6.1.
|
|
77
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
84
78
|
"jsdom": "^30.0.1",
|
|
85
79
|
"typescript": "^7.0.2",
|
|
86
|
-
"vitest": "^
|
|
80
|
+
"vitest": "^5.0.0"
|
|
87
81
|
},
|
|
88
82
|
"allowScripts": {
|
|
89
83
|
"core-js-pure@3.49.0": true
|
package/src/app/ServiceApp.ts
CHANGED
|
@@ -25,9 +25,9 @@ const tryLoginKey = "tryLogin";
|
|
|
25
25
|
* Use the new acess token and refresh token to login
|
|
26
26
|
*/
|
|
27
27
|
export class ServiceApp<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
U extends IServiceUser = IServiceUser,
|
|
29
|
+
S extends IServiceAppSettings = IServiceAppSettings
|
|
30
|
+
>
|
|
31
31
|
extends ReactApp<S, U>
|
|
32
32
|
implements IServiceApp
|
|
33
33
|
{
|
|
@@ -157,7 +157,7 @@ export class ServiceApp<
|
|
|
157
157
|
* @param keep Keep in local storage or not
|
|
158
158
|
* @param dispatch User state dispatch
|
|
159
159
|
*/
|
|
160
|
-
userLoginEx(
|
|
160
|
+
async userLoginEx(
|
|
161
161
|
user: U & ServiceUserToken,
|
|
162
162
|
core?: ApiRefreshTokenDto,
|
|
163
163
|
dispatch?: boolean
|
|
@@ -165,13 +165,13 @@ export class ServiceApp<
|
|
|
165
165
|
if (user.clientDeviceId && user.passphrase) {
|
|
166
166
|
// Save the passphrase
|
|
167
167
|
// Interpolated string expressions are different between TypeScript and C# for the null value
|
|
168
|
-
const passphrase = this.decrypt(
|
|
168
|
+
const passphrase = await this.decrypt(
|
|
169
169
|
user.passphrase,
|
|
170
170
|
`${user.uid ?? ""}-${this.settings.appId}`
|
|
171
171
|
);
|
|
172
172
|
if (passphrase) {
|
|
173
173
|
this.deviceId = user.clientDeviceId;
|
|
174
|
-
this.updatePassphrase(passphrase);
|
|
174
|
+
await this.updatePassphrase(passphrase);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -198,12 +198,12 @@ export class ServiceApp<
|
|
|
198
198
|
* Save core system data
|
|
199
199
|
* @param data Data
|
|
200
200
|
*/
|
|
201
|
-
protected saveCoreToken(data: ApiRefreshTokenDto) {
|
|
201
|
+
protected async saveCoreToken(data: ApiRefreshTokenDto) {
|
|
202
202
|
// Hold the core system access token
|
|
203
203
|
this.coreAccessToken = data.accessToken;
|
|
204
204
|
|
|
205
205
|
// Cache the core system refresh token
|
|
206
|
-
this.storage.setData(coreTokenKey, this.encrypt(data.refreshToken));
|
|
206
|
+
this.storage.setData(coreTokenKey, await this.encrypt(data.refreshToken));
|
|
207
207
|
|
|
208
208
|
// Exchange tokens
|
|
209
209
|
this.exchangeTokenAll(data);
|
|
@@ -278,7 +278,7 @@ export class ServiceApp<
|
|
|
278
278
|
return;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
const coreTokenDecrypted = this.decrypt(coreToken);
|
|
281
|
+
const coreTokenDecrypted = await this.decrypt(coreToken);
|
|
282
282
|
if (!coreTokenDecrypted) {
|
|
283
283
|
callback?.({
|
|
284
284
|
ok: false,
|