@etsoo/materialui 1.4.62 → 1.4.64
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/IServiceApp.d.ts +18 -5
- package/lib/app/IServiceApp.js +5 -1
- package/lib/app/ReactApp.d.ts +13 -0
- package/lib/app/ReactApp.js +4 -0
- package/package.json +1 -1
- package/src/app/IServiceApp.ts +24 -5
- package/src/app/ReactApp.ts +16 -0
package/lib/app/IServiceApp.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { ApiRefreshTokenDto, IApi } from "@etsoo/appscript";
|
|
2
|
-
import { ReactAppType } from "./ReactApp";
|
|
1
|
+
import { ApiRefreshTokenDto, IApi, IApiPayload } from "@etsoo/appscript";
|
|
2
|
+
import { ReactAppData, ReactAppType } from "./ReactApp";
|
|
3
3
|
import { IServiceUser, ServiceUserToken } from "./IServiceUser";
|
|
4
|
+
import { IActionResult } from "@etsoo/shared";
|
|
5
|
+
import React from "react";
|
|
6
|
+
/**
|
|
7
|
+
* Service application context
|
|
8
|
+
*/
|
|
9
|
+
export declare const ServiceAppContext: React.Context<ReactAppData<IServiceApp> | null>;
|
|
4
10
|
/**
|
|
5
11
|
* Service application interface
|
|
6
12
|
*/
|
|
@@ -15,14 +21,21 @@ export interface IServiceApp extends ReactAppType {
|
|
|
15
21
|
readonly coreOrigin: string;
|
|
16
22
|
/**
|
|
17
23
|
* Load core system UI
|
|
24
|
+
* @param tryLogin Try login or not
|
|
25
|
+
*/
|
|
26
|
+
loadCore(tryLogin?: boolean): void;
|
|
27
|
+
/**
|
|
28
|
+
* Switch organization
|
|
29
|
+
* @param organizationId Organization ID
|
|
30
|
+
* @param fromOrganizationId From organization ID
|
|
31
|
+
* @param payload Payload
|
|
18
32
|
*/
|
|
19
|
-
|
|
33
|
+
switchOrg(organizationId: number, fromOrganizationId?: number, payload?: IApiPayload<IActionResult<IServiceUser & ServiceUserToken>>): Promise<IActionResult<IServiceUser & ServiceUserToken> | undefined>;
|
|
20
34
|
/**
|
|
21
35
|
*
|
|
22
36
|
* @param user Current user
|
|
23
37
|
* @param core Core system API token data
|
|
24
|
-
* @param keep Keep in local storage or not
|
|
25
38
|
* @param dispatch User state dispatch
|
|
26
39
|
*/
|
|
27
|
-
userLoginEx(user: IServiceUser & ServiceUserToken, core?: ApiRefreshTokenDto,
|
|
40
|
+
userLoginEx(user: IServiceUser & ServiceUserToken, core?: ApiRefreshTokenDto, dispatch?: boolean): void;
|
|
28
41
|
}
|
package/lib/app/IServiceApp.js
CHANGED
package/lib/app/ReactApp.d.ts
CHANGED
|
@@ -8,6 +8,19 @@ import { NavigateFunction, NavigateOptions } from "react-router";
|
|
|
8
8
|
* React Application Type
|
|
9
9
|
*/
|
|
10
10
|
export type ReactAppType = IApp & IReactAppBase;
|
|
11
|
+
/**
|
|
12
|
+
* React application data
|
|
13
|
+
*/
|
|
14
|
+
export type ReactAppData<A extends ReactAppType> = {
|
|
15
|
+
/**
|
|
16
|
+
* Current application
|
|
17
|
+
*/
|
|
18
|
+
app: A;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* React application context
|
|
22
|
+
*/
|
|
23
|
+
export declare const ReactAppContext: React.Context<ReactAppData<ReactAppType> | null>;
|
|
11
24
|
/**
|
|
12
25
|
* Global application
|
|
13
26
|
*/
|
package/lib/app/ReactApp.js
CHANGED
|
@@ -6,6 +6,10 @@ import { NotifierMU } from "../NotifierMU";
|
|
|
6
6
|
import { ProgressCount } from "../ProgressCount";
|
|
7
7
|
import { Labels } from "./Labels";
|
|
8
8
|
import { CultureState, PageActionType, PageState, UserActionType, UserState } from "@etsoo/react";
|
|
9
|
+
/**
|
|
10
|
+
* React application context
|
|
11
|
+
*/
|
|
12
|
+
export const ReactAppContext = React.createContext(null);
|
|
9
13
|
/**
|
|
10
14
|
* Global application
|
|
11
15
|
*/
|
package/package.json
CHANGED
package/src/app/IServiceApp.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { ApiRefreshTokenDto, IApi } from "@etsoo/appscript";
|
|
2
|
-
import { ReactAppType } from "./ReactApp";
|
|
1
|
+
import { ApiRefreshTokenDto, IApi, IApiPayload } from "@etsoo/appscript";
|
|
2
|
+
import { ReactAppData, ReactAppType } from "./ReactApp";
|
|
3
3
|
import { IServiceUser, ServiceUserToken } from "./IServiceUser";
|
|
4
|
+
import { IActionResult } from "@etsoo/shared";
|
|
5
|
+
import React from "react";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Service application context
|
|
9
|
+
*/
|
|
10
|
+
export const ServiceAppContext =
|
|
11
|
+
React.createContext<ReactAppData<IServiceApp> | null>(null);
|
|
4
12
|
|
|
5
13
|
/**
|
|
6
14
|
* Service application interface
|
|
@@ -18,20 +26,31 @@ export interface IServiceApp extends ReactAppType {
|
|
|
18
26
|
|
|
19
27
|
/**
|
|
20
28
|
* Load core system UI
|
|
29
|
+
* @param tryLogin Try login or not
|
|
30
|
+
*/
|
|
31
|
+
loadCore(tryLogin?: boolean): void;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Switch organization
|
|
35
|
+
* @param organizationId Organization ID
|
|
36
|
+
* @param fromOrganizationId From organization ID
|
|
37
|
+
* @param payload Payload
|
|
21
38
|
*/
|
|
22
|
-
|
|
39
|
+
switchOrg(
|
|
40
|
+
organizationId: number,
|
|
41
|
+
fromOrganizationId?: number,
|
|
42
|
+
payload?: IApiPayload<IActionResult<IServiceUser & ServiceUserToken>>
|
|
43
|
+
): Promise<IActionResult<IServiceUser & ServiceUserToken> | undefined>;
|
|
23
44
|
|
|
24
45
|
/**
|
|
25
46
|
*
|
|
26
47
|
* @param user Current user
|
|
27
48
|
* @param core Core system API token data
|
|
28
|
-
* @param keep Keep in local storage or not
|
|
29
49
|
* @param dispatch User state dispatch
|
|
30
50
|
*/
|
|
31
51
|
userLoginEx(
|
|
32
52
|
user: IServiceUser & ServiceUserToken,
|
|
33
53
|
core?: ApiRefreshTokenDto,
|
|
34
|
-
keep?: boolean,
|
|
35
54
|
dispatch?: boolean
|
|
36
55
|
): void;
|
|
37
56
|
}
|
package/src/app/ReactApp.ts
CHANGED
|
@@ -42,6 +42,22 @@ import { NavigateFunction, NavigateOptions } from "react-router";
|
|
|
42
42
|
*/
|
|
43
43
|
export type ReactAppType = IApp & IReactAppBase;
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* React application data
|
|
47
|
+
*/
|
|
48
|
+
export type ReactAppData<A extends ReactAppType> = {
|
|
49
|
+
/**
|
|
50
|
+
* Current application
|
|
51
|
+
*/
|
|
52
|
+
app: A;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* React application context
|
|
57
|
+
*/
|
|
58
|
+
export const ReactAppContext =
|
|
59
|
+
React.createContext<ReactAppData<ReactAppType> | null>(null);
|
|
60
|
+
|
|
45
61
|
/**
|
|
46
62
|
* Global application
|
|
47
63
|
*/
|