@etsoo/materialui 1.4.81 → 1.4.82
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/cjs/app/IServiceApp.d.ts +5 -0
- package/lib/cjs/app/ServiceApp.d.ts +5 -0
- package/lib/cjs/app/ServiceApp.js +9 -18
- package/lib/mjs/app/IServiceApp.d.ts +5 -0
- package/lib/mjs/app/ServiceApp.d.ts +5 -0
- package/lib/mjs/app/ServiceApp.js +9 -18
- package/package.json +3 -3
- package/src/app/IServiceApp.ts +6 -0
- package/src/app/ServiceApp.ts +18 -24
|
@@ -19,6 +19,11 @@ export interface IServiceApp extends ReactAppType {
|
|
|
19
19
|
* @param tryLogin Try login or not
|
|
20
20
|
*/
|
|
21
21
|
loadCore(tryLogin?: boolean): void;
|
|
22
|
+
/**
|
|
23
|
+
* Load URL with core origin
|
|
24
|
+
* @param url URL
|
|
25
|
+
*/
|
|
26
|
+
loadUrlEx(url: string): void;
|
|
22
27
|
/**
|
|
23
28
|
* Switch organization
|
|
24
29
|
* @param organizationId Organization ID
|
|
@@ -41,6 +41,11 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, S extends
|
|
|
41
41
|
* @param data Login parameters
|
|
42
42
|
*/
|
|
43
43
|
toLoginPage(data?: AppLoginParams): void;
|
|
44
|
+
/**
|
|
45
|
+
* Load URL with core origin
|
|
46
|
+
* @param url URL
|
|
47
|
+
*/
|
|
48
|
+
loadUrlEx(url: string): void;
|
|
44
49
|
/**
|
|
45
50
|
* Signout, with userLogout and toLoginPage
|
|
46
51
|
* @param action Callback
|
|
@@ -71,34 +71,25 @@ class ServiceApp extends ReactApp_1.ReactApp {
|
|
|
71
71
|
// Cache current URL
|
|
72
72
|
this.cachedUrl = removeUrl ? undefined : globalThis.location.href;
|
|
73
73
|
// Get the redirect URL
|
|
74
|
-
new appscript_1.AuthApi(this)
|
|
75
|
-
.getLogInUrl({
|
|
76
|
-
region: this.region,
|
|
77
|
-
device: this.deviceId
|
|
78
|
-
})
|
|
79
|
-
.then((url) => {
|
|
74
|
+
new appscript_1.AuthApi(this).getLogInUrl().then((url) => {
|
|
80
75
|
if (!url)
|
|
81
76
|
return;
|
|
82
77
|
// Add try login flag
|
|
83
78
|
if (params != null) {
|
|
84
79
|
url = url.addUrlParams(params);
|
|
85
80
|
}
|
|
86
|
-
|
|
87
|
-
if (this.embedded) {
|
|
88
|
-
globalThis.parent.postMessage(["login", url], this.coreOrigin);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
if (appscript_1.BridgeUtils.host == null) {
|
|
92
|
-
globalThis.location.href = url;
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
appscript_1.BridgeUtils.host.loadApp(this.coreName, url);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
81
|
+
this.loadUrlEx(url);
|
|
98
82
|
});
|
|
99
83
|
// Make sure apply new device id for new login
|
|
100
84
|
this.clearDeviceId();
|
|
101
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Load URL with core origin
|
|
88
|
+
* @param url URL
|
|
89
|
+
*/
|
|
90
|
+
loadUrlEx(url) {
|
|
91
|
+
super.loadUrl(url, this.coreOrigin);
|
|
92
|
+
}
|
|
102
93
|
/**
|
|
103
94
|
* Signout, with userLogout and toLoginPage
|
|
104
95
|
* @param action Callback
|
|
@@ -19,6 +19,11 @@ export interface IServiceApp extends ReactAppType {
|
|
|
19
19
|
* @param tryLogin Try login or not
|
|
20
20
|
*/
|
|
21
21
|
loadCore(tryLogin?: boolean): void;
|
|
22
|
+
/**
|
|
23
|
+
* Load URL with core origin
|
|
24
|
+
* @param url URL
|
|
25
|
+
*/
|
|
26
|
+
loadUrlEx(url: string): void;
|
|
22
27
|
/**
|
|
23
28
|
* Switch organization
|
|
24
29
|
* @param organizationId Organization ID
|
|
@@ -41,6 +41,11 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, S extends
|
|
|
41
41
|
* @param data Login parameters
|
|
42
42
|
*/
|
|
43
43
|
toLoginPage(data?: AppLoginParams): void;
|
|
44
|
+
/**
|
|
45
|
+
* Load URL with core origin
|
|
46
|
+
* @param url URL
|
|
47
|
+
*/
|
|
48
|
+
loadUrlEx(url: string): void;
|
|
44
49
|
/**
|
|
45
50
|
* Signout, with userLogout and toLoginPage
|
|
46
51
|
* @param action Callback
|
|
@@ -68,34 +68,25 @@ export class ServiceApp extends ReactApp {
|
|
|
68
68
|
// Cache current URL
|
|
69
69
|
this.cachedUrl = removeUrl ? undefined : globalThis.location.href;
|
|
70
70
|
// Get the redirect URL
|
|
71
|
-
new AuthApi(this)
|
|
72
|
-
.getLogInUrl({
|
|
73
|
-
region: this.region,
|
|
74
|
-
device: this.deviceId
|
|
75
|
-
})
|
|
76
|
-
.then((url) => {
|
|
71
|
+
new AuthApi(this).getLogInUrl().then((url) => {
|
|
77
72
|
if (!url)
|
|
78
73
|
return;
|
|
79
74
|
// Add try login flag
|
|
80
75
|
if (params != null) {
|
|
81
76
|
url = url.addUrlParams(params);
|
|
82
77
|
}
|
|
83
|
-
|
|
84
|
-
if (this.embedded) {
|
|
85
|
-
globalThis.parent.postMessage(["login", url], this.coreOrigin);
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
if (BridgeUtils.host == null) {
|
|
89
|
-
globalThis.location.href = url;
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
BridgeUtils.host.loadApp(this.coreName, url);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
78
|
+
this.loadUrlEx(url);
|
|
95
79
|
});
|
|
96
80
|
// Make sure apply new device id for new login
|
|
97
81
|
this.clearDeviceId();
|
|
98
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Load URL with core origin
|
|
85
|
+
* @param url URL
|
|
86
|
+
*/
|
|
87
|
+
loadUrlEx(url) {
|
|
88
|
+
super.loadUrl(url, this.coreOrigin);
|
|
89
|
+
}
|
|
99
90
|
/**
|
|
100
91
|
* Signout, with userLogout and toLoginPage
|
|
101
92
|
* @param action Callback
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.82",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"@dnd-kit/sortable": "^10.0.0",
|
|
41
41
|
"@emotion/react": "^11.14.0",
|
|
42
42
|
"@emotion/styled": "^11.14.0",
|
|
43
|
-
"@etsoo/appscript": "^1.6.
|
|
43
|
+
"@etsoo/appscript": "^1.6.6",
|
|
44
44
|
"@etsoo/notificationbase": "^1.1.58",
|
|
45
45
|
"@etsoo/react": "^1.8.30",
|
|
46
46
|
"@etsoo/shared": "^1.2.61",
|
|
47
47
|
"@mui/icons-material": "^6.4.4",
|
|
48
48
|
"@mui/material": "^6.4.4",
|
|
49
|
-
"@mui/x-data-grid": "^7.
|
|
49
|
+
"@mui/x-data-grid": "^7.27.0",
|
|
50
50
|
"chart.js": "^4.4.7",
|
|
51
51
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
52
52
|
"eventemitter3": "^5.0.1",
|
package/src/app/IServiceApp.ts
CHANGED
|
@@ -23,6 +23,12 @@ export interface IServiceApp extends ReactAppType {
|
|
|
23
23
|
*/
|
|
24
24
|
loadCore(tryLogin?: boolean): void;
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Load URL with core origin
|
|
28
|
+
* @param url URL
|
|
29
|
+
*/
|
|
30
|
+
loadUrlEx(url: string): void;
|
|
31
|
+
|
|
26
32
|
/**
|
|
27
33
|
* Switch organization
|
|
28
34
|
* @param organizationId Organization ID
|
package/src/app/ServiceApp.ts
CHANGED
|
@@ -97,35 +97,29 @@ export class ServiceApp<
|
|
|
97
97
|
this.cachedUrl = removeUrl ? undefined : globalThis.location.href;
|
|
98
98
|
|
|
99
99
|
// Get the redirect URL
|
|
100
|
-
new AuthApi(this)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
url = url.addUrlParams(params);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// Is it embeded?
|
|
114
|
-
if (this.embedded) {
|
|
115
|
-
globalThis.parent.postMessage(["login", url], this.coreOrigin);
|
|
116
|
-
} else {
|
|
117
|
-
if (BridgeUtils.host == null) {
|
|
118
|
-
globalThis.location.href = url;
|
|
119
|
-
} else {
|
|
120
|
-
BridgeUtils.host.loadApp(this.coreName, url);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
});
|
|
100
|
+
new AuthApi(this).getLogInUrl().then((url) => {
|
|
101
|
+
if (!url) return;
|
|
102
|
+
|
|
103
|
+
// Add try login flag
|
|
104
|
+
if (params != null) {
|
|
105
|
+
url = url.addUrlParams(params);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
this.loadUrlEx(url);
|
|
109
|
+
});
|
|
124
110
|
|
|
125
111
|
// Make sure apply new device id for new login
|
|
126
112
|
this.clearDeviceId();
|
|
127
113
|
}
|
|
128
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Load URL with core origin
|
|
117
|
+
* @param url URL
|
|
118
|
+
*/
|
|
119
|
+
loadUrlEx(url: string) {
|
|
120
|
+
super.loadUrl(url, this.coreOrigin);
|
|
121
|
+
}
|
|
122
|
+
|
|
129
123
|
/**
|
|
130
124
|
* Signout, with userLogout and toLoginPage
|
|
131
125
|
* @param action Callback
|