@influenzanet/case-web-app-core 2.7.3
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/CHANGELOG.md +276 -0
- package/LICENSE +202 -0
- package/build/AppCore.d.ts +31 -0
- package/build/api/authAPI.d.ts +7 -0
- package/build/api/instances/authenticatedApi.d.ts +5 -0
- package/build/api/instances/defaultApi.d.ts +2 -0
- package/build/api/studyAPI.d.ts +29 -0
- package/build/api/types/authAPI.d.ts +37 -0
- package/build/api/types/general.d.ts +5 -0
- package/build/api/types/studyAPI.d.ts +91 -0
- package/build/api/types/user.d.ts +46 -0
- package/build/api/userAPI.d.ts +20 -0
- package/build/api/utils.d.ts +1 -0
- package/build/components/dialogs/GlobalDialogs/AlertDialog.d.ts +5 -0
- package/build/components/dialogs/GlobalDialogs/ChangeEmail.d.ts +5 -0
- package/build/components/dialogs/GlobalDialogs/ChangeLanguage.d.ts +6 -0
- package/build/components/dialogs/GlobalDialogs/ChangeNotifications.d.ts +5 -0
- package/build/components/dialogs/GlobalDialogs/ChangePassword.d.ts +5 -0
- package/build/components/dialogs/GlobalDialogs/DeleteAccount.d.ts +5 -0
- package/build/components/dialogs/GlobalDialogs/EditProfile.d.ts +9 -0
- package/build/components/dialogs/GlobalDialogs/Login.d.ts +11 -0
- package/build/components/dialogs/GlobalDialogs/ManageProfiles.d.ts +5 -0
- package/build/components/dialogs/GlobalDialogs/PasswordForgotten.d.ts +3 -0
- package/build/components/dialogs/GlobalDialogs/Signup.d.ts +3 -0
- package/build/components/dialogs/GlobalDialogs/SignupSuccess.d.ts +3 -0
- package/build/components/dialogs/GlobalDialogs.d.ts +8 -0
- package/build/components/layout/FooterRenderer.d.ts +9 -0
- package/build/components/layout/HeaderRenderer.d.ts +9 -0
- package/build/components/misc/InternalNavigator.d.ts +9 -0
- package/build/components/misc/LocalStorage.d.ts +3 -0
- package/build/components/misc/PreventAccidentalNavigationPrompt.d.ts +7 -0
- package/build/components/misc/ScrollToTop.d.ts +1 -0
- package/build/components/navbar/Navbar.d.ts +9 -0
- package/build/components/navbar/NavbarComponents/Drawer.d.ts +13 -0
- package/build/components/navbar/NavbarComponents/DrawerDropdownItem.d.ts +10 -0
- package/build/components/navbar/NavbarComponents/NavbarDropdownItem.d.ts +10 -0
- package/build/components/navbar/NavbarComponents/NavbarItem.d.ts +10 -0
- package/build/components/navbar/NavbarComponents/NormalNavbar.d.ts +28 -0
- package/build/components/navbar/NavbarComponents/SurveyModeNavbar.d.ts +14 -0
- package/build/components/pages/Pages.d.ts +19 -0
- package/build/components/pages/components/ContentRenderer.d.ts +21 -0
- package/build/components/pages/components/LinkResolver/LinkResolver.d.ts +14 -0
- package/build/components/pages/components/LinkResolver/Resolvers/ContactVerification.d.ts +7 -0
- package/build/components/pages/components/LinkResolver/Resolvers/Invitation.d.ts +7 -0
- package/build/components/pages/components/LinkResolver/Resolvers/PasswordReset.d.ts +7 -0
- package/build/components/pages/components/LinkResolver/Resolvers/StudyLogin.d.ts +7 -0
- package/build/components/pages/components/RouteToLayout.d.ts +17 -0
- package/build/components/pages/components/SurveyPage/Dialogs/LoginRequiredDialog.d.ts +14 -0
- package/build/components/pages/components/SurveyPage/Dialogs/ProfileSelectionDialog.d.ts +17 -0
- package/build/components/pages/components/SurveyPage/Dialogs/SubmitSuccessWithLoginOptionsDialog.d.ts +16 -0
- package/build/components/pages/components/SurveyPage/Dialogs/SuccessDialog.d.ts +12 -0
- package/build/components/pages/components/SurveyPage/PageComponents/ErrorWithRetry.d.ts +10 -0
- package/build/components/pages/components/SurveyPage/SurveyPage.d.ts +16 -0
- package/build/components/settings/AccountSettings.d.ts +7 -0
- package/build/components/settings/CommunicationSettings.d.ts +7 -0
- package/build/components/settings/DeleteAccount.d.ts +6 -0
- package/build/components/settings/SystemInfo.d.ts +7 -0
- package/build/components/study/ReportList.d.ts +19 -0
- package/build/components/study/SurveyList.d.ts +10 -0
- package/build/constants/index.d.ts +1 -0
- package/build/hooks/useAuthTokenCheck.d.ts +1 -0
- package/build/hooks/useIsAuthenticated.d.ts +1 -0
- package/build/hooks/useLogout.d.ts +1 -0
- package/build/hooks/useSetAuthState.d.ts +3 -0
- package/build/hooks/useTranslatedMarkdown.d.ts +5 -0
- package/build/hooks/useUrlQuery.d.ts +1 -0
- package/build/i18n.d.ts +12 -0
- package/build/index.d.ts +79 -0
- package/build/index.es.js +30438 -0
- package/build/index.es.js.map +1 -0
- package/build/index.js +30475 -0
- package/build/index.js.map +1 -0
- package/build/localStyles.d.ts +8 -0
- package/build/store/ReducersManager.d.ts +66 -0
- package/build/store/appSlice.d.ts +35 -0
- package/build/store/configSlice.d.ts +11 -0
- package/build/store/dialogSlice.d.ts +43 -0
- package/build/store/localStorage.d.ts +4 -0
- package/build/store/rootReducer.d.ts +13 -0
- package/build/store/signupActions.d.ts +3 -0
- package/build/store/store.d.ts +9 -0
- package/build/store/userSlice.d.ts +17 -0
- package/build/types/appConfig.d.ts +13 -0
- package/build/types/extensionComponents.d.ts +14 -0
- package/build/types/footerConfig.d.ts +14 -0
- package/build/types/headerConfig.d.ts +23 -0
- package/build/types/navbarConfig.d.ts +17 -0
- package/build/types/pagesConfig.d.ts +226 -0
- package/build/types/routing.d.ts +8 -0
- package/build/utils/LocalStorageManager.d.ts +53 -0
- package/build/utils/blurEmail.d.ts +1 -0
- package/build/utils/parseBooleanFlag.d.ts +1 -0
- package/build/utils/parseGRPCTimestamp.d.ts +1 -0
- package/build/utils/passwordRules.d.ts +1 -0
- package/package.json +96 -0
- package/readme.md +22 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import '@fontsource/open-sans';
|
|
2
|
+
import '@fontsource/open-sans/400-italic.css';
|
|
3
|
+
import '@fontsource/open-sans/700.css';
|
|
4
|
+
import '@fortawesome/fontawesome-free/js/solid';
|
|
5
|
+
import '@fortawesome/fontawesome-free/js/brands';
|
|
6
|
+
import '@fortawesome/fontawesome-free/js/fontawesome';
|
|
7
|
+
import 'case-web-ui/build/scss/theme-default.scss';
|
|
8
|
+
import 'bootstrap/dist/js/bootstrap.bundle';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { AnyAction, ReducersMapObject } from '@reduxjs/toolkit';
|
|
2
|
+
declare type Listener = Function;
|
|
3
|
+
/**
|
|
4
|
+
* The `ReducersManager` class is used to manage and extend a map of reducers,
|
|
5
|
+
* represented as an object of slice reducers.
|
|
6
|
+
*
|
|
7
|
+
* It provides methods for adding and removing reducers from the map, and it creates
|
|
8
|
+
* a combined reducer function that can be passed to the Redux store.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ReducersManager<S> {
|
|
11
|
+
private reducers;
|
|
12
|
+
private combinedReducer;
|
|
13
|
+
private keysToRemove;
|
|
14
|
+
private changeListener;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a `ReducersManager` instance.
|
|
17
|
+
*
|
|
18
|
+
* @param initialReducers initial map of reducers
|
|
19
|
+
*/
|
|
20
|
+
constructor(initialReducers: ReducersMapObject);
|
|
21
|
+
/**
|
|
22
|
+
* Combines the map of `reducers` in a single `Reducer` function.
|
|
23
|
+
*
|
|
24
|
+
* @param reducers map of reducers.
|
|
25
|
+
* @returns a `Reducer` function that invokes every reducer in the `reducers` map.
|
|
26
|
+
*/
|
|
27
|
+
private combineReducers;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @returns the reducer map currently managed by the `ReducersManager`
|
|
31
|
+
*/
|
|
32
|
+
getReducerMap: () => ReducersMapObject<any, import("redux").Action<any>>;
|
|
33
|
+
/**
|
|
34
|
+
* The reducer function obtained as a combination of all reducers currently managed by
|
|
35
|
+
* the `ReducersManager`.
|
|
36
|
+
*
|
|
37
|
+
* @param state a state object
|
|
38
|
+
* @param action a Redux action
|
|
39
|
+
* @returns the new state produced, as a result of the reducers applied to `state`
|
|
40
|
+
* @throws If one of the reducers returns undefined, the returned `Reducer` function will throw an `Error` when executed.
|
|
41
|
+
*/
|
|
42
|
+
reduce: (state: any, action: AnyAction) => S;
|
|
43
|
+
/**
|
|
44
|
+
* Add a new reducers map object to the map object already managed by
|
|
45
|
+
* the `ReducersManager`.
|
|
46
|
+
*
|
|
47
|
+
* @param reducerMap a new reducer map to be added to the current reducer map.
|
|
48
|
+
*/
|
|
49
|
+
add: (reducerMap: ReducersMapObject) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Removes the `Reducer`function associated to the given `key`from the reducers map.
|
|
52
|
+
*
|
|
53
|
+
* @param key key to be removed from the reducers map.
|
|
54
|
+
*/
|
|
55
|
+
remove: (key: string) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Add a listener to be execute after reducers are added.
|
|
58
|
+
* This gives a chance to perform actions after adding reducers.
|
|
59
|
+
* Most notably, sending a reserved event in order to initialize the newly
|
|
60
|
+
* added reducers, like redux does after creating the store.
|
|
61
|
+
*
|
|
62
|
+
* @param listener
|
|
63
|
+
*/
|
|
64
|
+
setChangeListener(listener: Listener): void;
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
+
import { Profile } from '../api/types/user';
|
|
3
|
+
export interface AuthInfo {
|
|
4
|
+
accessToken: string;
|
|
5
|
+
refreshToken: string;
|
|
6
|
+
expiresAt: number;
|
|
7
|
+
}
|
|
8
|
+
export interface AppState {
|
|
9
|
+
persistState: boolean;
|
|
10
|
+
auth?: AuthInfo;
|
|
11
|
+
surveyMode: {
|
|
12
|
+
active: boolean;
|
|
13
|
+
profile?: Profile;
|
|
14
|
+
};
|
|
15
|
+
lastAction?: {
|
|
16
|
+
name: string;
|
|
17
|
+
time: Date;
|
|
18
|
+
info?: any;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare const initialState: AppState;
|
|
22
|
+
export declare const setPersistState: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, setAppAuth: import("@reduxjs/toolkit").ActionCreatorWithPayload<AuthInfo, string>, reset: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, closeSurveyMode: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, openSurveyMode: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<Profile | undefined, string>;
|
|
23
|
+
export declare const appActions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
24
|
+
reset: (state: import("immer/dist/internal").WritableDraft<AppState>) => import("immer/dist/internal").WritableDraft<AppState>;
|
|
25
|
+
setPersistState: (state: import("immer/dist/internal").WritableDraft<AppState>, action: PayloadAction<boolean>) => void;
|
|
26
|
+
setAppAuth: (state: import("immer/dist/internal").WritableDraft<AppState>, action: PayloadAction<AuthInfo>) => void;
|
|
27
|
+
openSurveyMode: (state: import("immer/dist/internal").WritableDraft<AppState>, action: PayloadAction<Profile | undefined>) => void;
|
|
28
|
+
closeSurveyMode: (state: import("immer/dist/internal").WritableDraft<AppState>) => void;
|
|
29
|
+
updateLastAction: (state: import("immer/dist/internal").WritableDraft<AppState>, action: PayloadAction<{
|
|
30
|
+
actionName: string;
|
|
31
|
+
info?: any;
|
|
32
|
+
}>) => void;
|
|
33
|
+
}>;
|
|
34
|
+
declare const _default: import("redux").Reducer<AppState, import("redux").AnyAction>;
|
|
35
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
+
import { AppConfig, AvatarConfig, LanguageConfig } from '../types/appConfig';
|
|
3
|
+
export declare const initialState: AppConfig;
|
|
4
|
+
export declare const appConfig: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
5
|
+
reset: (state: import("immer/dist/internal").WritableDraft<AppConfig>) => import("immer/dist/internal").WritableDraft<AppConfig>;
|
|
6
|
+
updateInstanceID: (state: import("immer/dist/internal").WritableDraft<AppConfig>, action: PayloadAction<string>) => void;
|
|
7
|
+
updateLanguages: (state: import("immer/dist/internal").WritableDraft<AppConfig>, action: PayloadAction<Array<LanguageConfig>>) => void;
|
|
8
|
+
updateAvatars: (state: import("immer/dist/internal").WritableDraft<AppConfig>, action: PayloadAction<Array<AvatarConfig>>) => void;
|
|
9
|
+
}>;
|
|
10
|
+
declare const _default: import("redux").Reducer<AppConfig, import("redux").AnyAction>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
+
export declare type DialogOrigin = 'surveyFlow';
|
|
3
|
+
interface DialogWithoutPayload {
|
|
4
|
+
type: string;
|
|
5
|
+
origin?: DialogOrigin;
|
|
6
|
+
}
|
|
7
|
+
export interface LoginDialog {
|
|
8
|
+
type: 'login';
|
|
9
|
+
origin?: DialogOrigin;
|
|
10
|
+
payload: {
|
|
11
|
+
email: string;
|
|
12
|
+
password: string;
|
|
13
|
+
rememberMe: boolean;
|
|
14
|
+
verificationCode?: string;
|
|
15
|
+
preventNavigateOnSuccess?: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface AlertDialog {
|
|
19
|
+
type: 'alertDialog';
|
|
20
|
+
origin?: DialogOrigin;
|
|
21
|
+
payload: {
|
|
22
|
+
color: 'danger' | 'warning' | 'success';
|
|
23
|
+
title: string;
|
|
24
|
+
content: string;
|
|
25
|
+
btn: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface DialogState {
|
|
29
|
+
config?: DialogWithoutPayload | LoginDialog | AlertDialog;
|
|
30
|
+
}
|
|
31
|
+
export declare let initialState: DialogState;
|
|
32
|
+
export declare const dialogActions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
33
|
+
reset(state: import("immer/dist/internal").WritableDraft<DialogState>): import("immer/dist/internal").WritableDraft<DialogState>;
|
|
34
|
+
closeDialog(state: import("immer/dist/internal").WritableDraft<DialogState>): void;
|
|
35
|
+
openDialogWithoutPayload(state: import("immer/dist/internal").WritableDraft<DialogState>, action: PayloadAction<{
|
|
36
|
+
type: string;
|
|
37
|
+
origin?: DialogOrigin;
|
|
38
|
+
}>): void;
|
|
39
|
+
openLoginDialog(state: import("immer/dist/internal").WritableDraft<DialogState>, action: PayloadAction<LoginDialog>): void;
|
|
40
|
+
openAlertDialog(state: import("immer/dist/internal").WritableDraft<DialogState>, action: PayloadAction<AlertDialog>): void;
|
|
41
|
+
}>;
|
|
42
|
+
declare const _default: import("redux").Reducer<DialogState, import("redux").AnyAction>;
|
|
43
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AnyAction, Reducer, ReducersMapObject } from '@reduxjs/toolkit';
|
|
2
|
+
export declare const initialRootState: {
|
|
3
|
+
app: import("./appSlice").AppState;
|
|
4
|
+
dialog: import("./dialogSlice").DialogState;
|
|
5
|
+
user: import("./userSlice").UserState;
|
|
6
|
+
config: import("../types/appConfig").AppConfig;
|
|
7
|
+
};
|
|
8
|
+
declare const rootReducers: RootReducerMap;
|
|
9
|
+
export declare type RootState = typeof initialRootState;
|
|
10
|
+
export declare type RootReducerMap = ReducersMapObject<RootState, AnyAction>;
|
|
11
|
+
export declare type GlobalState = RootState & Record<string, any>;
|
|
12
|
+
export declare type GlobalReducerMap = RootReducerMap & Record<string, Reducer<any, AnyAction>>;
|
|
13
|
+
export default rootReducers;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GlobalState } from './rootReducer';
|
|
2
|
+
import { LocalStorageManager } from '../utils/LocalStorageManager';
|
|
3
|
+
import { ReducersManager } from './ReducersManager';
|
|
4
|
+
export declare const reducersManager: ReducersManager<GlobalState>;
|
|
5
|
+
export declare const localStorageManager: LocalStorageManager<GlobalState>;
|
|
6
|
+
declare const store: import("@reduxjs/toolkit").EnhancedStore<GlobalState, import("redux").AnyAction, [import("redux-thunk").ThunkMiddleware<GlobalState, import("redux").AnyAction, undefined>]>;
|
|
7
|
+
export declare type AppDispatch = typeof store.dispatch;
|
|
8
|
+
export default store;
|
|
9
|
+
export declare const resetStore: () => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
+
import { User } from '../api/types/user';
|
|
3
|
+
import { TokenResponse } from '../api/types/authAPI';
|
|
4
|
+
export interface UserState {
|
|
5
|
+
currentUser: User;
|
|
6
|
+
}
|
|
7
|
+
export declare const initialState: UserState;
|
|
8
|
+
export declare const userActions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
9
|
+
reset: (state: import("immer/dist/internal").WritableDraft<UserState>) => import("immer/dist/internal").WritableDraft<UserState>;
|
|
10
|
+
initializeLanguage: (state: import("immer/dist/internal").WritableDraft<UserState>, action: PayloadAction<string>) => import("immer/dist/internal").WritableDraft<UserState>;
|
|
11
|
+
setFromTokenResponse: (state: import("immer/dist/internal").WritableDraft<UserState>, action: PayloadAction<TokenResponse>) => void;
|
|
12
|
+
setUser: (state: import("immer/dist/internal").WritableDraft<UserState>, action: PayloadAction<User>) => void;
|
|
13
|
+
setUserID: (state: import("immer/dist/internal").WritableDraft<UserState>, action: PayloadAction<string>) => void;
|
|
14
|
+
setPreferredLanguage: (state: import("immer/dist/internal").WritableDraft<UserState>, action: PayloadAction<string>) => void;
|
|
15
|
+
}>;
|
|
16
|
+
declare const _default: import("redux").Reducer<UserState, import("redux").AnyAction>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface AppConfig {
|
|
2
|
+
instanceId: string;
|
|
3
|
+
languages: Array<LanguageConfig>;
|
|
4
|
+
avatars: Array<AvatarConfig>;
|
|
5
|
+
}
|
|
6
|
+
export interface LanguageConfig {
|
|
7
|
+
code: string;
|
|
8
|
+
itemKey: string;
|
|
9
|
+
}
|
|
10
|
+
export interface AvatarConfig {
|
|
11
|
+
avatarId: string;
|
|
12
|
+
url: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PageItem } from "./pagesConfig";
|
|
3
|
+
export interface GenericPageItemProps {
|
|
4
|
+
pageKey: string;
|
|
5
|
+
itemKey: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
dateLocales?: Array<{
|
|
8
|
+
code: string;
|
|
9
|
+
locale: any;
|
|
10
|
+
format: string;
|
|
11
|
+
}>;
|
|
12
|
+
renderGenericItemFunc: (item: PageItem) => React.ReactElement | null;
|
|
13
|
+
onNavigate: (url: string) => void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface FooterConfig {
|
|
2
|
+
columns: Array<FooterColumnConfig>;
|
|
3
|
+
}
|
|
4
|
+
export interface FooterColumnConfig {
|
|
5
|
+
columnKey: string;
|
|
6
|
+
classNameOverride?: string;
|
|
7
|
+
items: Array<FooterLinkItemConfig>;
|
|
8
|
+
}
|
|
9
|
+
export interface FooterLinkItemConfig {
|
|
10
|
+
type: 'internal' | 'external' | 'language';
|
|
11
|
+
itemKey: string;
|
|
12
|
+
value: string;
|
|
13
|
+
iconClass?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface HeaderConfig {
|
|
2
|
+
config: SimpleLogoHeaderConfig;
|
|
3
|
+
}
|
|
4
|
+
export interface SimpleLogoHeaderConfig {
|
|
5
|
+
type: 'simpleLogo';
|
|
6
|
+
image: {
|
|
7
|
+
altKey?: string;
|
|
8
|
+
sm: {
|
|
9
|
+
url: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
height?: number;
|
|
12
|
+
width?: number;
|
|
13
|
+
};
|
|
14
|
+
lg: {
|
|
15
|
+
url: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
height?: number;
|
|
18
|
+
width?: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
className?: string;
|
|
22
|
+
useLanguageSelector?: boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface NavbarConfig {
|
|
2
|
+
leftItems: Array<NavbarItemConfig>;
|
|
3
|
+
rightItems: Array<NavbarItemConfig>;
|
|
4
|
+
unauthRightItems?: Array<NavbarItemConfig>;
|
|
5
|
+
breakpoint?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface NavbarItemConfig {
|
|
8
|
+
type: 'internal' | 'dropdown' | 'dialog';
|
|
9
|
+
url?: string;
|
|
10
|
+
itemKey: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
hideWhen?: 'auth' | 'unauth';
|
|
13
|
+
iconClass?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
dropdownItems?: Array<NavbarItemConfig>;
|
|
16
|
+
dropdownAlign?: 'start' | 'end';
|
|
17
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { DefaultRoutes } from "./routing";
|
|
2
|
+
export interface PagesConfig {
|
|
3
|
+
pages: Array<PageConfig>;
|
|
4
|
+
defaultRoutes?: DefaultRoutes;
|
|
5
|
+
}
|
|
6
|
+
export interface HelmetPageConfig {
|
|
7
|
+
override: 'global' | 'local';
|
|
8
|
+
ignoreTitle?: boolean;
|
|
9
|
+
ignoreDescription?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface PageConfig {
|
|
12
|
+
path: string;
|
|
13
|
+
pageKey: string;
|
|
14
|
+
hideWhen?: 'auth' | 'unauth';
|
|
15
|
+
rows: Array<PageRow>;
|
|
16
|
+
subPages?: PagesConfig;
|
|
17
|
+
hideTitleBar?: boolean;
|
|
18
|
+
helmet?: HelmetPageConfig;
|
|
19
|
+
}
|
|
20
|
+
export interface PageRow {
|
|
21
|
+
key: string;
|
|
22
|
+
containerClassName?: string;
|
|
23
|
+
rowClassNameOverride?: string;
|
|
24
|
+
fullWidth?: boolean;
|
|
25
|
+
hideWhen?: 'auth' | 'unauth';
|
|
26
|
+
columns: Array<PageColumn>;
|
|
27
|
+
}
|
|
28
|
+
export interface PageColumn {
|
|
29
|
+
key?: string;
|
|
30
|
+
className?: string;
|
|
31
|
+
hideWhen?: 'auth' | 'unauth';
|
|
32
|
+
items: Array<PageItem>;
|
|
33
|
+
}
|
|
34
|
+
export interface PageItem {
|
|
35
|
+
itemKey: string;
|
|
36
|
+
className?: string;
|
|
37
|
+
hideWhen?: 'auth' | 'unauth';
|
|
38
|
+
config: PageItemConfig;
|
|
39
|
+
}
|
|
40
|
+
declare type PageItemConfig = TeaserImageConfig | RouterComponentConfig | MarkdownComponentConfig | ImageCardConfig | LoginCardConfig | VideoConfig | ImageConfig | AccordionListConfig | SimpleCard | SystemInfoConfig | AccountSettingsConfig | CommunicationSettingsConfig | DeleteAccountConfig | LogoCreditsConfig | SurveyListConfig | LinkListConfig | MapDataSeriesConfig | LineWithScatterChartConfig | ContainerConfig | PlaceholderComponentConfig | ExtensionComponent | ActionCardConfig | ReportListConfig | HelmetConfig | IframeConfig;
|
|
41
|
+
export interface MarkdownComponentConfig {
|
|
42
|
+
type: 'markdown';
|
|
43
|
+
markdownUrl: string;
|
|
44
|
+
flavor?: 'chart-renderer';
|
|
45
|
+
}
|
|
46
|
+
export interface ImageConfig {
|
|
47
|
+
type: 'image';
|
|
48
|
+
url?: string;
|
|
49
|
+
urlKey?: string;
|
|
50
|
+
altKey?: string;
|
|
51
|
+
maxWidth?: number;
|
|
52
|
+
maxHeight?: number;
|
|
53
|
+
}
|
|
54
|
+
export interface VideoConfig {
|
|
55
|
+
type: 'video';
|
|
56
|
+
minHeight?: number;
|
|
57
|
+
posterUrlKey?: string;
|
|
58
|
+
videoSources: Array<{
|
|
59
|
+
urlKey: string;
|
|
60
|
+
type: string;
|
|
61
|
+
}>;
|
|
62
|
+
tracks?: Array<{
|
|
63
|
+
src: string;
|
|
64
|
+
default?: boolean;
|
|
65
|
+
srcLang: string;
|
|
66
|
+
label: string;
|
|
67
|
+
kind: string;
|
|
68
|
+
}>;
|
|
69
|
+
fallbackTextKey?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface TeaserImageConfig {
|
|
72
|
+
type: 'teaserImage';
|
|
73
|
+
image: {
|
|
74
|
+
url: string;
|
|
75
|
+
height?: number;
|
|
76
|
+
className?: string;
|
|
77
|
+
backgroundPosition?: string;
|
|
78
|
+
copyrightNotice?: string;
|
|
79
|
+
copyrightNoticeXAlignment?: 'start' | 'end';
|
|
80
|
+
};
|
|
81
|
+
textBox?: {
|
|
82
|
+
className?: string;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export interface ImageCardConfig {
|
|
86
|
+
type: 'imageCard';
|
|
87
|
+
action?: {
|
|
88
|
+
type: 'navigate' | 'openDialog';
|
|
89
|
+
value: string;
|
|
90
|
+
};
|
|
91
|
+
imageSrc?: string;
|
|
92
|
+
className?: string;
|
|
93
|
+
showActionBtn?: boolean;
|
|
94
|
+
}
|
|
95
|
+
export interface ActionCardConfig {
|
|
96
|
+
type: 'actionCard';
|
|
97
|
+
action?: {
|
|
98
|
+
type: 'navigate' | 'openDialog';
|
|
99
|
+
value: string;
|
|
100
|
+
};
|
|
101
|
+
image?: {
|
|
102
|
+
url: string;
|
|
103
|
+
as?: 'div' | 'img';
|
|
104
|
+
alt?: string;
|
|
105
|
+
className?: string;
|
|
106
|
+
copyrightNotice?: string;
|
|
107
|
+
copyrightNoticeXAlignment?: 'start' | 'end';
|
|
108
|
+
backgroundPosition?: string;
|
|
109
|
+
backgroundSize?: string;
|
|
110
|
+
placement: 'top' | 'left';
|
|
111
|
+
height?: string;
|
|
112
|
+
width?: string;
|
|
113
|
+
minWidth?: string | number;
|
|
114
|
+
maxWidth?: string | number;
|
|
115
|
+
minHeight?: string | number;
|
|
116
|
+
maxHeight?: string | number;
|
|
117
|
+
};
|
|
118
|
+
bodyBgImage?: {
|
|
119
|
+
url: string;
|
|
120
|
+
backgroundPosition?: string;
|
|
121
|
+
backgroundSize?: string;
|
|
122
|
+
overlayOpacity?: number;
|
|
123
|
+
};
|
|
124
|
+
hideBodyContent?: boolean;
|
|
125
|
+
useFooterText?: boolean;
|
|
126
|
+
className?: string;
|
|
127
|
+
}
|
|
128
|
+
interface LoginCardConfig {
|
|
129
|
+
type: 'loginCard';
|
|
130
|
+
showInfoText: boolean;
|
|
131
|
+
}
|
|
132
|
+
export interface AccordionListConfig {
|
|
133
|
+
type: 'accordionList';
|
|
134
|
+
accordionCtrlsKey: string;
|
|
135
|
+
}
|
|
136
|
+
export interface SimpleCard {
|
|
137
|
+
type: 'simpleCard';
|
|
138
|
+
variant?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
139
|
+
}
|
|
140
|
+
export interface LinkListConfig {
|
|
141
|
+
type: 'linkList';
|
|
142
|
+
links: Array<{
|
|
143
|
+
linkKey: string;
|
|
144
|
+
type: 'internal' | 'external' | 'language' | 'dialog';
|
|
145
|
+
value: string;
|
|
146
|
+
}>;
|
|
147
|
+
}
|
|
148
|
+
export interface SystemInfoConfig {
|
|
149
|
+
type: 'systemInfo';
|
|
150
|
+
showBrowserInfo: boolean;
|
|
151
|
+
}
|
|
152
|
+
export interface AccountSettingsConfig {
|
|
153
|
+
type: 'accountSettings';
|
|
154
|
+
hideProfileSettings?: boolean;
|
|
155
|
+
}
|
|
156
|
+
export interface CommunicationSettingsConfig {
|
|
157
|
+
type: 'communicationSettings';
|
|
158
|
+
hideLanguageSelector?: boolean;
|
|
159
|
+
}
|
|
160
|
+
export interface DeleteAccountConfig {
|
|
161
|
+
type: 'deleteAccount';
|
|
162
|
+
}
|
|
163
|
+
export interface LogoCreditsConfig {
|
|
164
|
+
type: 'logoCredits';
|
|
165
|
+
useTitle?: boolean;
|
|
166
|
+
className?: string;
|
|
167
|
+
images: Array<{
|
|
168
|
+
key: string;
|
|
169
|
+
url: string;
|
|
170
|
+
altKey: string;
|
|
171
|
+
width?: number | string;
|
|
172
|
+
height?: number | string;
|
|
173
|
+
className?: string;
|
|
174
|
+
}>;
|
|
175
|
+
}
|
|
176
|
+
export interface MapDataSeriesConfig {
|
|
177
|
+
type: 'mapDataSeries';
|
|
178
|
+
mapUrl: string;
|
|
179
|
+
dataUrl: string;
|
|
180
|
+
}
|
|
181
|
+
export interface LineWithScatterChartConfig {
|
|
182
|
+
type: 'lineWithScatterChart';
|
|
183
|
+
dataUrl: string;
|
|
184
|
+
}
|
|
185
|
+
export interface SurveyListConfig {
|
|
186
|
+
type: 'surveyList';
|
|
187
|
+
}
|
|
188
|
+
export interface ReportListConfig {
|
|
189
|
+
type: 'reportList';
|
|
190
|
+
studyKeys?: string[];
|
|
191
|
+
reportKey?: string;
|
|
192
|
+
cardBgOverride?: string;
|
|
193
|
+
hideStudyKey?: boolean;
|
|
194
|
+
ignoreReports?: string[];
|
|
195
|
+
maxReportAgeInSeconds?: number;
|
|
196
|
+
}
|
|
197
|
+
export interface ContainerConfig {
|
|
198
|
+
type: 'container';
|
|
199
|
+
items: PageItem[];
|
|
200
|
+
}
|
|
201
|
+
export interface PlaceholderComponentConfig {
|
|
202
|
+
type: 'placeholder';
|
|
203
|
+
label: string;
|
|
204
|
+
height?: number;
|
|
205
|
+
}
|
|
206
|
+
export interface RouterComponentConfig {
|
|
207
|
+
type: 'router';
|
|
208
|
+
pagesConfig: PagesConfig;
|
|
209
|
+
}
|
|
210
|
+
export interface HelmetConfig {
|
|
211
|
+
type: 'helmet';
|
|
212
|
+
updateTitle?: boolean;
|
|
213
|
+
updateDescription?: boolean;
|
|
214
|
+
}
|
|
215
|
+
export interface IframeConfig {
|
|
216
|
+
type: 'iframe';
|
|
217
|
+
url: string;
|
|
218
|
+
scrolling?: boolean;
|
|
219
|
+
height?: string | number;
|
|
220
|
+
log?: boolean;
|
|
221
|
+
}
|
|
222
|
+
export interface ExtensionComponent {
|
|
223
|
+
type: 'extension';
|
|
224
|
+
config: any;
|
|
225
|
+
}
|
|
226
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represent a function to be invoked before `state` is persisted
|
|
3
|
+
* to the LocalStorage.
|
|
4
|
+
*
|
|
5
|
+
* The function needs to be pure and have no side effects. Should not throw any exception.
|
|
6
|
+
*/
|
|
7
|
+
export declare type OnSaveCallback<T> = (state: T) => T;
|
|
8
|
+
/**
|
|
9
|
+
* The `LocalStorageManager` class is used for managing data persistence in the browser's LocalStorage.
|
|
10
|
+
*
|
|
11
|
+
* @template T - The type of the data being persisted.
|
|
12
|
+
*/
|
|
13
|
+
export declare class LocalStorageManager<T> {
|
|
14
|
+
/**
|
|
15
|
+
* Callbacks to be invoked before `state` is persisted to LocalStorage.
|
|
16
|
+
* These functions should be pure and have no side effects. They should not throw any exceptions.
|
|
17
|
+
*/
|
|
18
|
+
private onSaveStateCallbacks;
|
|
19
|
+
/**
|
|
20
|
+
* The key to use for storing data in the LocalStorage.
|
|
21
|
+
*/
|
|
22
|
+
storageKey: string;
|
|
23
|
+
/**
|
|
24
|
+
* Creates a new `LocalStorageManager` instance.
|
|
25
|
+
*
|
|
26
|
+
* @param storageKey - The key to use for storing data in the LocalStorage.
|
|
27
|
+
*/
|
|
28
|
+
constructor(storageKey: string);
|
|
29
|
+
/**
|
|
30
|
+
* Loads data from the LocalStorage.
|
|
31
|
+
*
|
|
32
|
+
* @returns The data stored in LocalStorage. If no data is found or an error occurs during the parsing of the data, `null` is returned instead.
|
|
33
|
+
*/
|
|
34
|
+
load: () => T | null;
|
|
35
|
+
/**
|
|
36
|
+
* Saves data to the LocalStorage.
|
|
37
|
+
*
|
|
38
|
+
* Before saving the data, it executes the registered callbacks. @see `onSave`
|
|
39
|
+
*
|
|
40
|
+
* @param state - The data to save to the LocalStorage.
|
|
41
|
+
*/
|
|
42
|
+
save: (state: T) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Registers a callback to be invoked before `state` is persisted to the LocalStorage.
|
|
45
|
+
*
|
|
46
|
+
* @param callback - The callback function to be registered.
|
|
47
|
+
*/
|
|
48
|
+
onSave: (callback: OnSaveCallback<T>) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Removes the data associate with the `storageKey` from the LocalStorage.
|
|
51
|
+
*/
|
|
52
|
+
remove: () => void;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const blurEmail: (email: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseBooleanFlag: (v: string | undefined, empty: boolean, other: boolean) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseGRPCTimestamp: (grpcValue?: string | number | undefined) => number | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkPasswordRules: (password: string) => boolean;
|