oiu-core1 0.1.15
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/README.md +143 -0
- package/dist/assets/oiu-core.css +1 -0
- package/dist/auth/AuthenticationProvider.d.ts +16 -0
- package/dist/auth/AuthenticationProvider.d.ts.map +1 -0
- package/dist/auth/AuthorizationProvider.d.ts +22 -0
- package/dist/auth/AuthorizationProvider.d.ts.map +1 -0
- package/dist/auth/Context.d.ts +5 -0
- package/dist/auth/Context.d.ts.map +1 -0
- package/dist/auth/OAuthService/index.d.ts +58 -0
- package/dist/auth/OAuthService/index.d.ts.map +1 -0
- package/dist/auth/OAuthService/utils.d.ts +23 -0
- package/dist/auth/OAuthService/utils.d.ts.map +1 -0
- package/dist/auth/_type.d.ts +157 -0
- package/dist/auth/_type.d.ts.map +1 -0
- package/dist/auth/index.d.ts +17 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/utils.d.ts +42 -0
- package/dist/auth/utils.d.ts.map +1 -0
- package/dist/components/Col/index.d.ts +17 -0
- package/dist/components/Col/index.d.ts.map +1 -0
- package/dist/components/ConfigLoader/index.d.ts +24 -0
- package/dist/components/ConfigLoader/index.d.ts.map +1 -0
- package/dist/components/ErrorCode/index.d.ts +16 -0
- package/dist/components/ErrorCode/index.d.ts.map +1 -0
- package/dist/components/FormErrorSummary/Content.d.ts +10 -0
- package/dist/components/FormErrorSummary/Content.d.ts.map +1 -0
- package/dist/components/FormErrorSummary/WithErrorFieldsMap.d.ts +28 -0
- package/dist/components/FormErrorSummary/WithErrorFieldsMap.d.ts.map +1 -0
- package/dist/components/FormErrorSummary/index.d.ts +11 -0
- package/dist/components/FormErrorSummary/index.d.ts.map +1 -0
- package/dist/components/LangProvider/index.d.ts +31 -0
- package/dist/components/LangProvider/index.d.ts.map +1 -0
- package/dist/components/Pagination/index.d.ts +18 -0
- package/dist/components/Pagination/index.d.ts.map +1 -0
- package/dist/components/Row/index.d.ts +15 -0
- package/dist/components/Row/index.d.ts.map +1 -0
- package/dist/components/SearchWithCard/index.d.ts +35 -0
- package/dist/components/SearchWithCard/index.d.ts.map +1 -0
- package/dist/components/Wait/_type.d.ts +33 -0
- package/dist/components/Wait/_type.d.ts.map +1 -0
- package/dist/components/Wait/index.d.ts +9 -0
- package/dist/components/Wait/index.d.ts.map +1 -0
- package/dist/components/_types.d.ts +4 -0
- package/dist/components/_types.d.ts.map +1 -0
- package/dist/components/index.d.ts +20 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/hoc/index.d.ts +3 -0
- package/dist/hoc/index.d.ts.map +1 -0
- package/dist/hoc/withError.d.ts +21 -0
- package/dist/hoc/withError.d.ts.map +1 -0
- package/dist/hoc/wl.d.ts +31 -0
- package/dist/hoc/wl.d.ts.map +1 -0
- package/dist/index-BRODpY4Y.js +2659 -0
- package/dist/init.d.ts +63 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/language/index.d.ts +75 -0
- package/dist/language/index.d.ts.map +1 -0
- package/dist/main-DEwdbtUG.js +23410 -0
- package/dist/main.d.ts +10 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +12 -0
- package/dist/redux/apiSlices/index.d.ts +19 -0
- package/dist/redux/apiSlices/index.d.ts.map +1 -0
- package/dist/redux/index.d.ts +18 -0
- package/dist/redux/index.d.ts.map +1 -0
- package/dist/redux/slices/appSlice.d.ts +67 -0
- package/dist/redux/slices/appSlice.d.ts.map +1 -0
- package/dist/redux/slices/errorSlice.d.ts +57 -0
- package/dist/redux/slices/errorSlice.d.ts.map +1 -0
- package/dist/redux/slices/langSlice.d.ts +41 -0
- package/dist/redux/slices/langSlice.d.ts.map +1 -0
- package/dist/theme/UITheme.d.ts +26 -0
- package/dist/theme/UITheme.d.ts.map +1 -0
- package/dist/theme/index.d.ts +16 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/utils/_types.d.ts +32 -0
- package/dist/utils/_types.d.ts.map +1 -0
- package/dist/utils/config.d.ts +32 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/promise.d.ts +14 -0
- package/dist/utils/promise.d.ts.map +1 -0
- package/dist/utils/string.d.ts +15 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/sys.d.ts +3 -0
- package/dist/utils/sys.d.ts.map +1 -0
- package/dist/utils/url.d.ts +47 -0
- package/dist/utils/url.d.ts.map +1 -0
- package/package.json +54 -0
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as auth from './auth';
|
|
2
|
+
import * as utils from './utils';
|
|
3
|
+
import * as redux from './redux';
|
|
4
|
+
import * as language from './language';
|
|
5
|
+
import * as components from './components';
|
|
6
|
+
import * as hoc from './hoc';
|
|
7
|
+
import * as theme from './theme';
|
|
8
|
+
export * from './init';
|
|
9
|
+
export { auth, components, language, redux, theme, utils, hoc };
|
|
10
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../lib/main.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAIjC,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC"}
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { i as e, b as t, h as u, j as i, c as n, e as o, f as h, u as c, g } from "./main-DEwdbtUG.js";
|
|
2
|
+
export {
|
|
3
|
+
e as auth,
|
|
4
|
+
t as components,
|
|
5
|
+
u as hoc,
|
|
6
|
+
i as initOIU,
|
|
7
|
+
n as language,
|
|
8
|
+
o as redux,
|
|
9
|
+
h as theme,
|
|
10
|
+
c as useInitOIU,
|
|
11
|
+
g as utils
|
|
12
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseQueryApi, BaseQueryFn, FetchArgs, FetchBaseQueryError, FetchBaseQueryMeta } from '@reduxjs/toolkit/query';
|
|
2
|
+
import { AuthPayload } from '../slices/appSlice';
|
|
3
|
+
export type OptionsX = {
|
|
4
|
+
spinTip?: string;
|
|
5
|
+
};
|
|
6
|
+
export type Fn<DefinitionExtraOptions extends OptionsX = OptionsX> = BaseQueryFn<string | FetchArgs, unknown, FetchBaseQueryError, DefinitionExtraOptions, FetchBaseQueryMeta>;
|
|
7
|
+
export type Configuration = {
|
|
8
|
+
getAccessToken?: (auth: AuthPayload) => Promise<string | undefined>;
|
|
9
|
+
/** Allow execute an operation before the fetch */
|
|
10
|
+
afterFetch?: (args: string | FetchArgs, api: BaseQueryApi, extraOptions?: OptionsX) => Promise<void>;
|
|
11
|
+
/** Allow execute an operation before the fetch */
|
|
12
|
+
beforeFetch?: (args: string | FetchArgs, api: BaseQueryApi, extraOptions?: OptionsX) => Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
/** Creates a base query function for making API requests with optional loading spinner and authentication.
|
|
15
|
+
* @param source Source of the API call, e.g. Local = 0
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare function fetchBaseQueryX<DefinitionExtraOptions extends OptionsX = OptionsX>(source: number, configuration: Configuration): Fn<DefinitionExtraOptions>;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/redux/apiSlices/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,WAAW,EACX,SAAS,EAET,mBAAmB,EACnB,kBAAkB,EACrB,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EAAE,WAAW,EAAyB,MAAM,oBAAoB,CAAC;AAMxE,MAAM,MAAM,QAAQ,GAAG;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,EAAE,CAAC,sBAAsB,SAAS,QAAQ,GAAG,QAAQ,IAAI,WAAW,CAC5E,MAAM,GAAG,SAAS,EAClB,OAAO,EACP,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,CACrB,CAAC;AACF,MAAM,MAAM,aAAa,GAAG;IACxB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACpE,kDAAkD;IAClD,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrG,kDAAkD;IAClD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzG,CAAC;AAEF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,sBAAsB,SAAS,QAAQ,GAAG,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,GAAG,EAAE,CAAC,sBAAsB,CAAC,CA8C5J"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DevToolsEnhancerOptions, Slice } from '@reduxjs/toolkit';
|
|
2
|
+
import { SetupOptions } from '../utils/sys';
|
|
3
|
+
/**
|
|
4
|
+
* Build the global storage
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildStorage(slices: Slice[], modules?: Array<Record<string, unknown>>, devOptionsSetup?: SetupOptions<DevToolsEnhancerOptions>): import("@reduxjs/toolkit").EnhancedStore<{
|
|
8
|
+
[x: string]: /*elided*/ any;
|
|
9
|
+
}, import("redux").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("redux").StoreEnhancer<{
|
|
10
|
+
dispatch: import("redux-thunk").ThunkDispatch<{
|
|
11
|
+
[x: string]: /*elided*/ any;
|
|
12
|
+
}, undefined, import("redux").UnknownAction>;
|
|
13
|
+
}>, import("redux").StoreEnhancer]>>;
|
|
14
|
+
export * from './slices/appSlice';
|
|
15
|
+
export * from './slices/langSlice';
|
|
16
|
+
export * from './slices/errorSlice';
|
|
17
|
+
export * from './apiSlices';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/redux/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,uBAAuB,EAAW,KAAK,EAAmB,MAAM,kBAAkB,CAAC;AAE5G,OAAO,EAAa,YAAY,EAAE,MAAM,cAAc,CAAC;AAuEvD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,GAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM,EAAE,eAAe,CAAC,EAAE,YAAY,CAAC,uBAAuB,CAAC;;;;;;qCAKlJ;AAgCD,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Action } from '@reduxjs/toolkit';
|
|
2
|
+
import { ThemeKey } from '../../utils/_types';
|
|
3
|
+
import { Identity } from '../../auth/_type';
|
|
4
|
+
export type AuthPayload = {
|
|
5
|
+
seed?: string;
|
|
6
|
+
/** Last reason of the operation */
|
|
7
|
+
reason: string;
|
|
8
|
+
identity?: Identity;
|
|
9
|
+
twoFactor?: {
|
|
10
|
+
username: string;
|
|
11
|
+
emailVerified: boolean;
|
|
12
|
+
phoneVerified: boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type ScreenPayload = {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
19
|
+
export type SpinPayload = {
|
|
20
|
+
/** If true some block the entirely UI process is running */
|
|
21
|
+
spin: boolean;
|
|
22
|
+
/** Message to display */
|
|
23
|
+
tip?: string;
|
|
24
|
+
};
|
|
25
|
+
export type ThemePayload = ThemeKey;
|
|
26
|
+
/** App store scheme */
|
|
27
|
+
export type AppStore = {
|
|
28
|
+
auth: AuthPayload;
|
|
29
|
+
screen: ScreenPayload;
|
|
30
|
+
spin: SpinPayload;
|
|
31
|
+
theme: ThemePayload;
|
|
32
|
+
};
|
|
33
|
+
type ScreenAction = Action<string> & {
|
|
34
|
+
payload: ScreenPayload;
|
|
35
|
+
};
|
|
36
|
+
type SpinAction = Action<string> & {
|
|
37
|
+
payload: SpinPayload;
|
|
38
|
+
};
|
|
39
|
+
type ThemeAction = Action<string> & {
|
|
40
|
+
payload: ThemePayload;
|
|
41
|
+
};
|
|
42
|
+
type AuthAction = Action<string> & {
|
|
43
|
+
payload: {
|
|
44
|
+
/** Reason of the operation */
|
|
45
|
+
reason: string;
|
|
46
|
+
/** Information of the customer profile */
|
|
47
|
+
identity?: Identity;
|
|
48
|
+
/** Customer is supplied username and passwd correct and now require check the 2fa */
|
|
49
|
+
twoFactor?: AuthPayload['twoFactor'];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/** App slice */
|
|
53
|
+
export declare const appSlice: import("@reduxjs/toolkit").Slice<AppStore, {
|
|
54
|
+
screenResize(state: import("immer").WritableDraft<AppStore>, action: ScreenAction): void;
|
|
55
|
+
spinUpdate(state: import("immer").WritableDraft<AppStore>, action: SpinAction): void;
|
|
56
|
+
changeTheme(state: import("immer").WritableDraft<AppStore>, action: ThemeAction): void;
|
|
57
|
+
setIdentity(state: import("immer").WritableDraft<AppStore>, action: AuthAction): void;
|
|
58
|
+
clearIdentity(state: import("immer").WritableDraft<AppStore>): void;
|
|
59
|
+
}, "app", "app", import("@reduxjs/toolkit").SliceSelectors<AppStore>>;
|
|
60
|
+
/**
|
|
61
|
+
* Get app store from state
|
|
62
|
+
* @param state
|
|
63
|
+
* @returns
|
|
64
|
+
*/
|
|
65
|
+
export declare const getAppStore: (state: any) => AppStore;
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=appSlice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appSlice.d.ts","sourceRoot":"","sources":["../../../lib/redux/slices/appSlice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAe,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAI5C,MAAM,MAAM,WAAW,GAAG;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,SAAS,CAAC,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,OAAO,CAAC;QACvB,aAAa,EAAE,OAAO,CAAC;KAC1B,CAAC;CACL,CAAC;AACF,MAAM,MAAM,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAC9D,MAAM,MAAM,WAAW,GAAG;IACtB,4DAA4D;IAC5D,IAAI,EAAE,OAAO,CAAC;IACd,yBAAyB;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;AAEpC,uBAAuB;AACvB,MAAM,MAAM,QAAQ,GAAG;IACnB,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;CACvB,CAAC;AACF,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,CAAC;AAChE,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC;AAC5D,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG;IAAE,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC;AAC9D,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG;IAC/B,OAAO,EAAE;QACL,8BAA8B;QAC9B,MAAM,EAAE,MAAM,CAAC;QACf,0CAA0C;QAC1C,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,qFAAqF;QACrF,SAAS,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;KACxC,CAAA;CACJ,CAAC;AAcF,gBAAgB;AAChB,eAAO,MAAM,QAAQ;yEAIe,YAAY;uEAGd,UAAU;wEAGT,WAAW;wEAMX,UAAU;;qEAe3C,CAAC;AAEH;;;;GAIG;AAEH,eAAO,MAAM,WAAW,GAAI,OAAO,GAAG,KAAyB,QAAQ,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Action } from '@reduxjs/toolkit';
|
|
2
|
+
export type Code = number;
|
|
3
|
+
export type ErrorText = string;
|
|
4
|
+
export type MSId = number;
|
|
5
|
+
/**
|
|
6
|
+
* Represent a bad response body coming from the backend. When an endpoint is requested and there is a validation error or any other error, the backend return
|
|
7
|
+
* a response with the status code and a body with the format of `IBadResModel`, this is used to load the error codes in the redux store and then use them in the app.
|
|
8
|
+
* Key is the field name and value is an array of error codes. Error codes are in the format of code:arg1:arg2, where code is the error code and arg1, arg2 are the arguments
|
|
9
|
+
* to format the error message.
|
|
10
|
+
* @example { email: ['4:30', '9'] } where 4 has attached "maximum length is {0}" and 9 is the parameter to format the code message resulting in "maximum length is 30".
|
|
11
|
+
* Code 9 mean is required so the message will be "This field is required".
|
|
12
|
+
* Those code number are just examples and the real meaning is defined in the backend, will change from different projects.
|
|
13
|
+
*/
|
|
14
|
+
export interface IBadResModel {
|
|
15
|
+
[key: string]: string[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Represent the error coming from the backend, this is the format returning for the /helps/errors endpoint.
|
|
19
|
+
*/
|
|
20
|
+
export interface IErrorModel {
|
|
21
|
+
code: Code;
|
|
22
|
+
name: string;
|
|
23
|
+
description: ErrorText;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Payload of the action to merge the error codes in the redux store, this is used to load the error codes in the redux store and then use them in the app.
|
|
27
|
+
*/
|
|
28
|
+
type ErrorPayload = {
|
|
29
|
+
service: MSId;
|
|
30
|
+
errors?: IErrorModel[];
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Error store, this is the format of the error store in the redux, it contains the list of the services Id wich the codes already get loaded and a list of the error codes and their corresponding descriptions. This is used to load the error codes in the redux store and then use them in the app.
|
|
34
|
+
*/
|
|
35
|
+
export type ErrorStore = {
|
|
36
|
+
/** List of the services Id wich the codes already get loaded */
|
|
37
|
+
loaded: Record<MSId, boolean>;
|
|
38
|
+
/** List of the error codes and their corresponding descriptions */
|
|
39
|
+
errors: Record<Code, ErrorText>;
|
|
40
|
+
};
|
|
41
|
+
type MergeErrorAction = Action<string> & {
|
|
42
|
+
payload: ErrorPayload;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Slice to manage the error codes in the redux store, this is used to load the error codes in the redux store and then use them in the app. The main action is pushErrors wich merge the new error codes with the existing ones in the store, but only if the service Id was not loaded before, this is to avoid loading the same error codes multiple times.
|
|
46
|
+
*/
|
|
47
|
+
export declare const errorSlice: import("@reduxjs/toolkit").Slice<ErrorStore, {
|
|
48
|
+
pushErrors(state: import("immer").WritableDraft<ErrorStore>, action: MergeErrorAction): void;
|
|
49
|
+
}, "error", "error", import("@reduxjs/toolkit").SliceSelectors<ErrorStore>>;
|
|
50
|
+
/**
|
|
51
|
+
* Get error store from state
|
|
52
|
+
* @param state
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
55
|
+
export declare const getErrorStore: (state: any) => ErrorStore;
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=errorSlice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorSlice.d.ts","sourceRoot":"","sources":["../../../lib/redux/slices/errorSlice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAe,MAAM,kBAAkB,CAAC;AAIvD,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAC1B,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAC/B,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAE1B;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC3B;AACD;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,SAAS,CAAC;CAC1B;AAED;;GAEG;AACH,KAAK,YAAY,GAAG;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B,CAAA;AACD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB,gEAAgE;IAChE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9B,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;CACnC,CAAC;AACF,KAAK,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG;IAAE,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC;AASnE;;GAEG;AACH,eAAO,MAAM,UAAU;yEAIW,gBAAgB;2EAchD,CAAC;AAEH;;;;GAIG;AAEH,eAAO,MAAM,aAAa,GAAI,OAAO,GAAG,KAA4B,UAAU,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Action } from '@reduxjs/toolkit';
|
|
2
|
+
import { MessageFormatElement } from 'react-intl';
|
|
3
|
+
import { LangInfo } from '../../language';
|
|
4
|
+
type MergeLangAction = Action<string> & {
|
|
5
|
+
payload: {
|
|
6
|
+
/** Language code: en */
|
|
7
|
+
locale: string;
|
|
8
|
+
/** File name of the language this is unique identifier */
|
|
9
|
+
file: string;
|
|
10
|
+
/** Key value pair with the language */
|
|
11
|
+
messages: object;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type ChangeLangAction = Action<string> & {
|
|
15
|
+
payload: {
|
|
16
|
+
/** Language code: en */
|
|
17
|
+
locale: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
/** Store scheme */
|
|
21
|
+
type LangFile = {
|
|
22
|
+
files: Record<string, boolean>;
|
|
23
|
+
messages: Record<string, MessageFormatElement[]>;
|
|
24
|
+
};
|
|
25
|
+
export type LangStore = {
|
|
26
|
+
lang: LangInfo;
|
|
27
|
+
data: Record<string, LangFile>;
|
|
28
|
+
};
|
|
29
|
+
/** App slice */
|
|
30
|
+
export declare const langSlice: import("@reduxjs/toolkit").Slice<LangStore, {
|
|
31
|
+
setLang(state: import("immer").WritableDraft<LangStore>, action: ChangeLangAction): void;
|
|
32
|
+
pushLangMessage(state: import("immer").WritableDraft<LangStore>, action: MergeLangAction): void;
|
|
33
|
+
}, "lang", "lang", import("@reduxjs/toolkit").SliceSelectors<LangStore>>;
|
|
34
|
+
/**
|
|
35
|
+
* Get app store from state
|
|
36
|
+
* @param state
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
export declare const getLangStore: (state: any) => LangStore;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=langSlice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"langSlice.d.ts","sourceRoot":"","sources":["../../../lib/redux/slices/langSlice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAe,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGlD,OAAO,EAAE,QAAQ,EAAe,MAAM,gBAAgB,CAAC;AAIvD,KAAK,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG;IACpC,OAAO,EAAE;QACL,wBAAwB;QACxB,MAAM,EAAE,MAAM,CAAC;QACf,0DAA0D;QAC1D,IAAI,EAAE,MAAM,CAAC;QACb,uCAAuC;QACvC,QAAQ,EAAE,MAAM,CAAC;KACpB,CAAC;CACL,CAAC;AACF,KAAK,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG;IACrC,OAAO,EAAE;QACL,wBAAwB;QACxB,MAAM,EAAE,MAAM,CAAC;KAClB,CAAA;CACJ,CAAA;AAED,mBAAmB;AACnB,KAAK,QAAQ,GAAG;IACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC;CACpD,CAAA;AACD,MAAM,MAAM,SAAS,GAAG;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CAClC,CAAC;AASF,gBAAgB;AAChB,eAAO,MAAM,SAAS;qEAIS,gBAAgB;6EAMR,eAAe;wEAkBpD,CAAC;AAEH;;;;GAIG;AAEH,eAAO,MAAM,YAAY,GAAI,OAAO,GAAG,KAAyB,SAAS,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComponentType, PropsWithChildren } from 'react';
|
|
2
|
+
import { LangInfo } from '../language';
|
|
3
|
+
import { ThemePayload } from '../redux';
|
|
4
|
+
export type UIThemeProps<Token> = PropsWithChildren<{
|
|
5
|
+
/** Theme used by default */
|
|
6
|
+
defaultTheme?: ThemePayload;
|
|
7
|
+
/** Style element ID in the document head where the CSS variables will be injected */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** Load the component styles configuration according with the selected theme */
|
|
10
|
+
getComponent: (theme: ThemePayload) => Token;
|
|
11
|
+
/** Load the gloval variables according with the selected theme */
|
|
12
|
+
genCSSVars?: (themeName: ThemePayload, token: Token) => string;
|
|
13
|
+
}>;
|
|
14
|
+
export type ProviderComponentType<Token = unknown> = ComponentType<PropsWithChildren<{
|
|
15
|
+
lang: LangInfo;
|
|
16
|
+
token: Token;
|
|
17
|
+
}>>;
|
|
18
|
+
export type UIThemeComponentType<Token = unknown> = ComponentType<UIThemeProps<Token>> & {
|
|
19
|
+
provider: ProviderComponentType<Token>;
|
|
20
|
+
};
|
|
21
|
+
/** Load the theme configuration and apply it to the application.
|
|
22
|
+
* @param param0
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
export declare function UITheme<Token = unknown>({ children, defaultTheme, genCSSVars, getComponent, id, }: UIThemeProps<Token>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
//# sourceMappingURL=UITheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UITheme.d.ts","sourceRoot":"","sources":["../../lib/theme/UITheme.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAA4B,MAAM,OAAO,CAAC;AAGnF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAuC,YAAY,EAAE,MAAM,UAAU,CAAC;AAM7E,MAAM,MAAM,YAAY,CAAC,KAAK,IAAI,iBAAiB,CAAC;IAChD,4BAA4B;IAC5B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,qFAAqF;IACrF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,gFAAgF;IAChF,YAAY,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,KAAK,CAAC;IAC7C,kEAAkE;IAClE,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC;CAClE,CAAC,CAAC;AAEH,MAAM,MAAM,qBAAqB,CAAC,KAAK,GAAG,OAAO,IAAI,aAAa,CAAC,iBAAiB,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC,CAAC;AACxH,MAAM,MAAM,oBAAoB,CAAC,KAAK,GAAG,OAAO,IAAI,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,GAAG;IACrF,QAAQ,EAAE,qBAAqB,CAAC,KAAK,CAAC,CAAC;CAC1C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,GAAG,OAAO,EAAE,EACrC,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,EAAkB,GACrB,EAAE,YAAY,CAAC,KAAK,CAAC,2CAgErB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ThemeKey } from '../utils/_types';
|
|
2
|
+
import { UITheme, UIThemeProps, ProviderComponentType, UIThemeComponentType } from './UITheme';
|
|
3
|
+
/** Get the resource path for a given theme
|
|
4
|
+
* @param theme
|
|
5
|
+
* @param resource
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
declare function getResByTheme(theme: ThemeKey, resource: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Hook to get the current theme name
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare function useThemeName(): string;
|
|
14
|
+
export { UITheme, getResByTheme };
|
|
15
|
+
export type { UIThemeProps, ProviderComponentType, UIThemeComponentType };
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/theme/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAI/F;;;;GAIG;AACH,iBAAS,aAAa,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAEvD;AACD;;;GAGG;AACH,wBAAgB,YAAY,WAE3B;AAED,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;AAClC,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare enum ErrType {
|
|
2
|
+
Info = 1,
|
|
3
|
+
Error = 2,
|
|
4
|
+
Warning = 3,
|
|
5
|
+
Success = 4
|
|
6
|
+
}
|
|
7
|
+
export type Guid = string[36];
|
|
8
|
+
export type IOrder = {
|
|
9
|
+
name: string;
|
|
10
|
+
asc: boolean;
|
|
11
|
+
};
|
|
12
|
+
export interface IPaging {
|
|
13
|
+
/**
|
|
14
|
+
* Current page number, starting from 0.
|
|
15
|
+
*/
|
|
16
|
+
page: number;
|
|
17
|
+
/**
|
|
18
|
+
* Number of items per page.
|
|
19
|
+
*/
|
|
20
|
+
pageSize: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ISearch<F> {
|
|
23
|
+
filter?: F;
|
|
24
|
+
paging?: IPaging;
|
|
25
|
+
order?: IOrder[];
|
|
26
|
+
}
|
|
27
|
+
export interface ISearchModel<T> {
|
|
28
|
+
total: number;
|
|
29
|
+
data: readonly T[];
|
|
30
|
+
}
|
|
31
|
+
export type ThemeKey = 'dark' | 'light' | string;
|
|
32
|
+
//# sourceMappingURL=_types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_types.d.ts","sourceRoot":"","sources":["../../lib/utils/_types.ts"],"names":[],"mappings":"AAIA,oBAAY,OAAO;IACf,IAAI,IAAI;IACR,KAAK,IAAI;IACT,OAAO,IAAI;IACX,OAAO,IAAI;CACd;AACD,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AAE9B,MAAM,MAAM,MAAM,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;CAChB,CAAC;AACF,MAAM,WAAW,OAAO;IACpB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,WAAW,OAAO,CAAC,CAAC;IACtB,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AACD,MAAM,WAAW,YAAY,CAAC,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;CACtB;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Represent the local configuration base type and is store as internal configuration for OIU library */
|
|
2
|
+
export type OIUConfig = {
|
|
3
|
+
_isLoaded: boolean;
|
|
4
|
+
version: string;
|
|
5
|
+
getEndpoint: (id: number) => string;
|
|
6
|
+
};
|
|
7
|
+
/** Function used to convert the remote configuration to local configuration */
|
|
8
|
+
export type FillFn<TRConfig, TConfig extends OIUConfig> = (config: TRConfig, local: TConfig) => TConfig | undefined;
|
|
9
|
+
/** Function used to load the remote configuration, this is optional by default the system will try to load from window.config */
|
|
10
|
+
export type ConfigLoader<TRConfig> = () => Promise<TRConfig>;
|
|
11
|
+
/**
|
|
12
|
+
* Wait for the configuration to be downloaded and assigned in window.config, then load from the window.config object into config var. This is a one-time operation.
|
|
13
|
+
* This process allow asynchronous loading of the configuration before the React app is started.
|
|
14
|
+
* @param config
|
|
15
|
+
* @param fill Receive the remote configuration and fill the local configuration object. example: () => { config.url = remoteConfig.url; return { version: '0.0.0', getEndpoint: () => remoteConfig.url,} as OIUConfig; }
|
|
16
|
+
* @param customLoadConfig
|
|
17
|
+
* @typeParam TRConfig The remote configuration type.
|
|
18
|
+
* @typeParam TConfig The local configuration base type.
|
|
19
|
+
* @returns If is the first time config load return true, otherwise false.
|
|
20
|
+
*/
|
|
21
|
+
export declare function loadConfig<TRConfig, TConfig extends OIUConfig>(config: TConfig, fill: FillFn<TRConfig, TConfig>, customLoadConfig?: ConfigLoader<TRConfig>): Promise<boolean>;
|
|
22
|
+
export declare const oiuConfig: {
|
|
23
|
+
ref: () => OIUConfig;
|
|
24
|
+
version: () => string;
|
|
25
|
+
/**
|
|
26
|
+
* Retrieve the base URL endpoint to be called for a given ID from the cached configuration.
|
|
27
|
+
* @param id
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
getEndpoint: (id: number) => string;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../lib/utils/config.ts"],"names":[],"mappings":"AAIA,yGAAyG;AACzG,MAAM,MAAM,SAAS,GAAG;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC,CAAC;AAEF,+EAA+E;AAC/E,MAAM,MAAM,MAAM,CAAC,QAAQ,EAAE,OAAO,SAAS,SAAS,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,GAAG,SAAS,CAAC;AACpH,iIAAiI;AACjI,MAAM,MAAM,YAAY,CAAC,QAAQ,IAAI,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;AAI7D;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,SAAS,SAAS,EAC1D,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,EAC/B,gBAAgB,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,GAC1C,OAAO,CAAC,OAAO,CAAC,CASlB;AA6CD,eAAO,MAAM,SAAS;;;IAMlB;;;;OAIG;sBACe,MAAM;CAI3B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './_types';
|
|
2
|
+
export * from './promise';
|
|
3
|
+
export * from './string';
|
|
4
|
+
export * from './sys';
|
|
5
|
+
export * from './url';
|
|
6
|
+
export { loadConfig, oiuConfig } from './config';
|
|
7
|
+
export type { FillFn, ConfigLoader, OIUConfig } from './config';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACjD,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface PromiseConstructor {
|
|
3
|
+
/** Wait for the specified number of milliseconds */
|
|
4
|
+
delay(ms: number): Promise<void>;
|
|
5
|
+
/** Wait until the specified condition is true or the timeout is reached */
|
|
6
|
+
waitUntil(condition: () => boolean, options?: {
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
intervalMs?: number;
|
|
9
|
+
timeoutMessage?: string;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export default Promise;
|
|
14
|
+
//# sourceMappingURL=promise.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../../lib/utils/promise.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,kBAAkB;QACxB,oDAAoD;QACpD,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACjC,2EAA2E;QAC3E,SAAS,CACL,SAAS,EAAE,MAAM,OAAO,EACxB,OAAO,CAAC,EAAE;YACN,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,cAAc,CAAC,EAAE,MAAM,CAAC;SAC3B,GACF,OAAO,CAAC,IAAI,CAAC,CAAC;KACpB;CACJ;AAqCD,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retrieve nameof type property.
|
|
3
|
+
* @param name
|
|
4
|
+
*/
|
|
5
|
+
export declare const nameof: <T>(name: keyof T) => string;
|
|
6
|
+
export declare const sig: () => string;
|
|
7
|
+
/**
|
|
8
|
+
* Allow format string using .net format String.Format()
|
|
9
|
+
* @param format
|
|
10
|
+
* @param args
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare function format(format: string, ...args: any[]): string;
|
|
14
|
+
export declare function decodeJwt(token?: string): any;
|
|
15
|
+
//# sourceMappingURL=string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../lib/utils/string.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,MAAM,GAAI,CAAC,EAAE,MAAM,MAAM,CAAC,KAAG,MAAwB,CAAC;AACnE,eAAO,MAAM,GAAG,cAAmC,CAAC;AAEpD;;;;;GAKG;AAEH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,UAOpD;AACD,wBAAgB,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM,OAevC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sys.d.ts","sourceRoot":"","sources":["../../lib/utils/sys.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,KAAK,IAAI,CAAA;AAErD,wBAAgB,SAAS,IAAI,MAAM,GAAG,SAAS,CAG9C"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { IStringifyOptions } from 'qs';
|
|
2
|
+
import { IOrder, IPaging, ISearch } from './_types';
|
|
3
|
+
/**
|
|
4
|
+
* State type for navigation return url. This is use to store the return url when the user is redirect to the login page.
|
|
5
|
+
*/
|
|
6
|
+
export type State = {
|
|
7
|
+
returnUrl?: string;
|
|
8
|
+
};
|
|
9
|
+
export type NavicationQS = (qs?: Record<string, string>) => void;
|
|
10
|
+
export type Navication = (url: string, qs?: Record<string, string>) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Get the url to return
|
|
13
|
+
* @param state
|
|
14
|
+
* @returns Decoded return url
|
|
15
|
+
*/
|
|
16
|
+
export declare function getReturnUrl(qs: URLSearchParams, state?: State | null, defaultPath?: string, decode?: boolean): string;
|
|
17
|
+
/**
|
|
18
|
+
* Compute the next search object based on the current search, the new paging and the new sorter. This is used to update the search object when the user changes the page or the page size or the sorting.
|
|
19
|
+
* @param search
|
|
20
|
+
* @param paging
|
|
21
|
+
* @param sorter
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
export declare function nextSearch<Filter>(search: ISearch<Filter>, paging?: IPaging, sorter?: IOrder | IOrder[]): ISearch<Filter>;
|
|
25
|
+
/**
|
|
26
|
+
* Check if local url use react navigation if not redirect to external url.
|
|
27
|
+
* @param navigate
|
|
28
|
+
* @param showSpin
|
|
29
|
+
* @param returnUrl
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
export declare function redirectTo(navigate: Navication, showSpin?: () => void, returnUrl?: string | null, url?: string): void;
|
|
33
|
+
export type RecursiveRecord = {
|
|
34
|
+
[key: string]: RecursiveRecord | number | string | undefined | null | boolean;
|
|
35
|
+
};
|
|
36
|
+
export declare function recursiveClean(data: RecursiveRecord, skipVersion: boolean): {
|
|
37
|
+
[key: string]: string | number | boolean | RecursiveRecord;
|
|
38
|
+
};
|
|
39
|
+
export declare function qs(obj?: RecursiveRecord, cleanEmptyString?: boolean, options?: IStringifyOptions, skipVersion?: boolean): string;
|
|
40
|
+
/**
|
|
41
|
+
* Add or remove query string parameters to the current URL. Taking into account the current search params and the supplied.
|
|
42
|
+
* @param navigator
|
|
43
|
+
* @param searchParams Current search params from the URL.
|
|
44
|
+
* @param modification Parameters to add or remove from the current search params. Id the value is `undefined` or `null`, the parameter will be removed. If the value is a string, it will be added or updated.
|
|
45
|
+
*/
|
|
46
|
+
export declare function buildQueryString(navigator: NavicationQS, searchParams: URLSearchParams, modification?: Record<string, string | undefined | null>): void;
|
|
47
|
+
//# sourceMappingURL=url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../lib/utils/url.ts"],"names":[],"mappings":"AAAA,OAAY,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAIpD;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;AAE5E;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,eAAe,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,WAAW,SAAM,EAAE,MAAM,UAAO,GAAG,MAAM,CAWhH;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,mBAwBvG;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,CAAC,EAAE,MAAM,QAO9G;AAED,MAAM,MAAM,eAAe,GAAG;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC;CACjF,CAAC;AACF,wBAAgB,cAAc,CAAC,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,OAAO;;EAczE;AACD,wBAAgB,EAAE,CACd,GAAG,CAAC,EAAE,eAAe,EACrB,gBAAgB,UAAO,EACvB,OAAO,GAAE,iBAA4C,EACrD,WAAW,UAAO,UAYrB;AAqBD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC5B,SAAS,EAAE,YAAY,EACvB,YAAY,EAAE,eAAe,EAC7B,YAAY,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAM,QAqB/D"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "oiu-core1",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.1.15",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"types": "./dist/main.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/main.d.ts",
|
|
13
|
+
"import": "./dist/main.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"dev": "vite",
|
|
18
|
+
"build": "vite build && tsc --p ./tsconfig.build.json",
|
|
19
|
+
"lint": "eslint .",
|
|
20
|
+
"preview": "vite preview",
|
|
21
|
+
"build-app": "tsc -b && vite build"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"antd": "^6.1.2"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@casl/ability": "^6.7.5",
|
|
28
|
+
"@casl/react": "^5.0.0",
|
|
29
|
+
"@reduxjs/toolkit": "^2.11.2",
|
|
30
|
+
"clsx": "^2.1.1",
|
|
31
|
+
"flat": "^6.0.1",
|
|
32
|
+
"oidc-client-ts": "^3.4.1",
|
|
33
|
+
"qs": "^6.14.0",
|
|
34
|
+
"react": "^19.2.0",
|
|
35
|
+
"react-dom": "^19.2.0",
|
|
36
|
+
"react-intl": "^10.1.5",
|
|
37
|
+
"react-redux": "^9.2.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@eslint/js": "^9.39.1",
|
|
41
|
+
"@types/node": "^24.10.4",
|
|
42
|
+
"@types/qs": "^6.14.0",
|
|
43
|
+
"@types/react": "^19.2.5",
|
|
44
|
+
"@types/react-dom": "^19.2.3",
|
|
45
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
46
|
+
"eslint": "^9.39.1",
|
|
47
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
48
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
49
|
+
"globals": "^16.5.0",
|
|
50
|
+
"typescript": "~5.9.3",
|
|
51
|
+
"typescript-eslint": "^8.46.4",
|
|
52
|
+
"vite": "^7.2.4"
|
|
53
|
+
}
|
|
54
|
+
}
|