@luigi-project/core-modular 0.0.4 → 0.0.5
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/core-api/dom-elements.d.ts +59 -0
- package/core-api/luigi.d.ts +3 -0
- package/core-api/navigation.d.ts +19 -4
- package/luigi-engine.d.ts +5 -3
- package/luigi.js +23 -23
- package/luigi.js.map +1 -1
- package/modules/ui-module.d.ts +7 -4
- package/modules/ux-module.d.ts +4 -3
- package/package.json +1 -1
- package/services/navigation.service.d.ts +3 -4
- package/services/routing.service.d.ts +19 -6
- package/types/connector.d.ts +6 -0
- package/types/navigation.d.ts +222 -1
- package/types/routing.d.ts +12 -0
- package/utilities/helpers/generic-helpers.d.ts +26 -2
- package/utilities/helpers/luigi-container-helpers.d.ts +18 -0
- package/utilities/helpers/navigation-helpers.d.ts +10 -1
- package/utilities/helpers/routing-helpers.d.ts +35 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { MicrofrontendInDom } from '../utilities/helpers/luigi-container-helpers';
|
|
2
|
+
import { Luigi } from './luigi';
|
|
3
|
+
export declare class Elements {
|
|
4
|
+
luigi: Luigi;
|
|
5
|
+
constructor(luigi: Luigi);
|
|
6
|
+
/**
|
|
7
|
+
* Returns the shellbar component.
|
|
8
|
+
* @returns {HTMLElement | null} the shellbar DOM element
|
|
9
|
+
* @memberof Elements
|
|
10
|
+
* @example
|
|
11
|
+
* Luigi.elements().getShellbar();
|
|
12
|
+
*/
|
|
13
|
+
getShellbar(): HTMLElement | null;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the shellbar actions.
|
|
16
|
+
* @returns {HTMLElement | null} the shellbar actions DOM element
|
|
17
|
+
* @memberof Elements
|
|
18
|
+
* @example
|
|
19
|
+
* Luigi.elements().getShellbarActions();
|
|
20
|
+
*/
|
|
21
|
+
getShellbarActions(): HTMLElement | null;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the main container of the Luigi application.
|
|
24
|
+
* @memberof Elements
|
|
25
|
+
* @returns {HTMLElement | null} the Luigi container DOM element
|
|
26
|
+
*/
|
|
27
|
+
getLuigiContainer(): HTMLElement | null;
|
|
28
|
+
/**
|
|
29
|
+
* Returns the navigation footer container of the Luigi application.
|
|
30
|
+
* @memberof Elements
|
|
31
|
+
* @returns {HTMLElement | null} the navigation footer container DOM element
|
|
32
|
+
*/
|
|
33
|
+
getNavFooterContainer(): HTMLElement | null;
|
|
34
|
+
/**
|
|
35
|
+
* Returns a list of all available micro frontends.
|
|
36
|
+
* @returns {Array<{id: string, active: boolean, container: HTMLElement, type: 'main'|'drawer'|'modal'}>} list of objects defining all micro frontends from the DOM
|
|
37
|
+
* @memberof Elements
|
|
38
|
+
* @example
|
|
39
|
+
* Luigi.elements().getMicrofrontends();
|
|
40
|
+
*/
|
|
41
|
+
getMicrofrontends(): MicrofrontendInDom[];
|
|
42
|
+
/**
|
|
43
|
+
* Returns all micro frontend iframes including the iframe from the modal if it exists.
|
|
44
|
+
* @returns {Array<HTMLElement>} an array of all micro frontend iframes from the DOM
|
|
45
|
+
* @memberof Elements
|
|
46
|
+
* @example
|
|
47
|
+
* Luigi.elements().getMicrofrontendIframes();
|
|
48
|
+
*/
|
|
49
|
+
getMicrofrontendIframes(): HTMLElement[] | null;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the active micro frontend iframe.
|
|
52
|
+
* If there is a modal, which includes the micro frontend iframe, the function returns this iframe.
|
|
53
|
+
* @returns {HTMLElement} the active micro frontend iframe DOM element
|
|
54
|
+
* @memberof Elements
|
|
55
|
+
* @example
|
|
56
|
+
* Luigi.elements().getCurrentMicrofrontendIframe();
|
|
57
|
+
*/
|
|
58
|
+
getCurrentMicrofrontendIframe(): HTMLElement | null;
|
|
59
|
+
}
|
package/core-api/luigi.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LuigiEngine } from '../luigi-engine';
|
|
2
2
|
import { i18nService } from '../services/i18n.service';
|
|
3
|
+
import { Elements } from './dom-elements';
|
|
3
4
|
import { LuigiAuthClass } from './auth';
|
|
4
5
|
import { FeatureToggles } from './feature-toggles';
|
|
5
6
|
import { Navigation } from './navigation';
|
|
@@ -14,6 +15,7 @@ export declare class Luigi {
|
|
|
14
15
|
_i18n: i18nService;
|
|
15
16
|
_theming?: Theming;
|
|
16
17
|
_routing?: Routing;
|
|
18
|
+
_elements?: Elements;
|
|
17
19
|
__cssVars?: any;
|
|
18
20
|
preventLoadingModalData?: boolean;
|
|
19
21
|
initialized: boolean;
|
|
@@ -71,6 +73,7 @@ export declare class Luigi {
|
|
|
71
73
|
*/
|
|
72
74
|
storeUserSettings(userSettingsObj: Record<string, any>, previousUserSettingsObj: Record<string, any>): Promise<any>;
|
|
73
75
|
i18n: () => i18nService;
|
|
76
|
+
elements: () => Elements;
|
|
74
77
|
navigation: () => Navigation;
|
|
75
78
|
ux: () => UX;
|
|
76
79
|
featureToggles: () => FeatureToggles;
|
package/core-api/navigation.d.ts
CHANGED
|
@@ -13,11 +13,25 @@ export declare class Navigation {
|
|
|
13
13
|
constructor(luigi: Luigi);
|
|
14
14
|
navigate: (path: string, preserveView?: string, modalSettings?: ModalSettings, splitViewSettings?: any, drawerSettings?: any) => Promise<void>;
|
|
15
15
|
openAsModal: (path: string, modalSettings: ModalSettings, onCloseCallback?: () => void) => Promise<void>;
|
|
16
|
-
openAsDrawer: (path: string,
|
|
16
|
+
openAsDrawer: (path: string, drawerSettings: ModalSettings, onCloseCallback?: () => void) => Promise<void>;
|
|
17
17
|
runTimeErrorHandler: (errorObj: object) => Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if the path you can navigate to exists in the main application. For example, you can use this helper method conditionally to display a DOM element like a button.
|
|
20
|
+
* @param {string} path - path which existence you want to check
|
|
21
|
+
* @returns {Promise<boolean>} A promise which resolves to a boolean variable specifying whether the path exists or not
|
|
22
|
+
* @example
|
|
23
|
+
* let pathExists;
|
|
24
|
+
* Luigi
|
|
25
|
+
* .navigation()
|
|
26
|
+
* .pathExists('projects/pr2')
|
|
27
|
+
* .then(
|
|
28
|
+
* (pathExists) => { }
|
|
29
|
+
* );
|
|
30
|
+
*/
|
|
31
|
+
pathExists: (path: string) => Promise<boolean>;
|
|
18
32
|
/**
|
|
19
33
|
* Sets the current navigation base to the parent node that is defined as virtualTree. This method works only when the currently active micro frontend is inside a virtualTree.
|
|
20
|
-
* @returns {
|
|
34
|
+
* @returns {Navigation} navigation instance
|
|
21
35
|
* @example
|
|
22
36
|
* Luigi.navigation().fromVirtualTreeRoot().navigate('/users/groups/stakeholders')
|
|
23
37
|
*/
|
|
@@ -25,12 +39,12 @@ export declare class Navigation {
|
|
|
25
39
|
/**
|
|
26
40
|
* Allows navigation from the node which has the navigation context set.
|
|
27
41
|
* @param navigationContext
|
|
28
|
-
* @returns {
|
|
42
|
+
* @returns {Navigation} navigation instance
|
|
29
43
|
*/
|
|
30
44
|
fromContext(navigationContext: string): Navigation;
|
|
31
45
|
/**
|
|
32
46
|
* Allows navigation from the closest node which has the navigation context set. If there are multiple nodes with the same navigation context, the closest one will be used as the navigation base.
|
|
33
|
-
* @returns {
|
|
47
|
+
* @returns {Navigation} navigation instance
|
|
34
48
|
*/
|
|
35
49
|
fromClosestContext(): Navigation;
|
|
36
50
|
/**
|
|
@@ -38,4 +52,5 @@ export declare class Navigation {
|
|
|
38
52
|
* @returns {navigation} navigation instance
|
|
39
53
|
*/
|
|
40
54
|
fromParent(): Navigation;
|
|
55
|
+
withParams(nodeParams: Record<string, any>): Navigation;
|
|
41
56
|
}
|
package/luigi-engine.d.ts
CHANGED
|
@@ -9,12 +9,14 @@ export declare class LuigiEngine {
|
|
|
9
9
|
navService: NavigationService;
|
|
10
10
|
routingService: RoutingService;
|
|
11
11
|
luigi: import('./core-api/luigi').Luigi;
|
|
12
|
+
modalContainer: any;
|
|
13
|
+
drawerContainer: any;
|
|
12
14
|
init: (luigi: import('./core-api/luigi').Luigi) => void;
|
|
13
15
|
update: (scopes?: string[]) => Promise<void>;
|
|
14
|
-
updateMainContent: (currentNode:
|
|
15
|
-
openModal: (luigi: import('./core-api/luigi').Luigi, node:
|
|
16
|
+
updateMainContent: (currentNode: import('./types/navigation').Node, luigi: import('./core-api/luigi').Luigi, luigiParams?: import('./types/routing').LuigiParams, withoutSync?: boolean, preventContextUpdate?: boolean) => Promise<void>;
|
|
17
|
+
openModal: (luigi: import('./core-api/luigi').Luigi, node: import('./types/navigation').Node, modalSettings: import('./types/navigation').ModalSettings, onCloseCallback?: () => void) => Promise<void>;
|
|
16
18
|
updateModalSettings: (modalSettings: import('./types/navigation').ModalSettings, addHistoryEntry: boolean, luigi: import('./core-api/luigi').Luigi) => void;
|
|
17
|
-
openDrawer: (luigi: import('./core-api/luigi').Luigi, node:
|
|
19
|
+
openDrawer: (luigi: import('./core-api/luigi').Luigi, node: import('./types/navigation').Node, drawerSettings: import('./types/navigation').ModalSettings, onCloseCallback?: () => void) => Promise<void>;
|
|
18
20
|
};
|
|
19
21
|
_comm: {
|
|
20
22
|
luigi: import('./core-api/luigi').Luigi;
|