@luigi-project/core-modular 0.0.7-dev.20260610120 → 0.0.8
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/luigi.js +40 -40
- package/luigi.js.map +1 -1
- package/package.json +1 -1
- package/services/navigation.service.d.ts +2 -1
- package/types/navigation.d.ts +25 -3
- package/utilities/helpers/context-switcher-helpers.d.ts +17 -0
- package/utilities/helpers/generic-helpers.d.ts +12 -0
- package/utilities/helpers/navigation-helpers.d.ts +2 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Luigi } from '../core-api/luigi';
|
|
2
2
|
import { AppSwitcher, BreadcrumbData, LeftNavData, NavigationOptions, NavigationRequestParams, NavItem, Node, PathData, TabNavData, TopNavData } from '../types/navigation';
|
|
3
|
-
import { NodeDataManagementService } from './node-data-management.service';
|
|
4
3
|
import { ModalService } from './modal.service';
|
|
4
|
+
import { NodeDataManagementService } from './node-data-management.service';
|
|
5
5
|
export declare class NavigationService {
|
|
6
6
|
private luigi;
|
|
7
7
|
modalService?: ModalService;
|
|
@@ -109,4 +109,5 @@ export declare class NavigationService {
|
|
|
109
109
|
* @returns The constructed path string.
|
|
110
110
|
*/
|
|
111
111
|
buildPath(incomingPath: string, options: NavigationOptions): Promise<string>;
|
|
112
|
+
private buildContextSwitcher;
|
|
112
113
|
}
|
package/types/navigation.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export interface TopNavData {
|
|
2
|
+
appSwitcher?: AppSwitcher;
|
|
2
3
|
appTitle: string;
|
|
4
|
+
contextSwitcher?: ContextSwitcher;
|
|
3
5
|
logo: string;
|
|
4
|
-
|
|
6
|
+
navClick?: (item: NavItem) => Promise<void>;
|
|
5
7
|
productSwitcher?: ProductSwitcher;
|
|
6
8
|
profile?: ProfileSettings;
|
|
7
|
-
|
|
8
|
-
navClick?: (item: NavItem) => Promise<void>;
|
|
9
|
+
topNodes: NavItem[];
|
|
9
10
|
}
|
|
10
11
|
export interface AppSwitcher {
|
|
11
12
|
showMainAppEntry?: boolean;
|
|
@@ -18,6 +19,25 @@ export interface AppSwitcherItem {
|
|
|
18
19
|
link?: string;
|
|
19
20
|
selectionConditions?: selectionConditions;
|
|
20
21
|
}
|
|
22
|
+
export interface ContextSwitcher {
|
|
23
|
+
actions?: any[];
|
|
24
|
+
config?: any;
|
|
25
|
+
options?: ContextSwitcherItem[];
|
|
26
|
+
selectedLabel?: string;
|
|
27
|
+
selectedNodePath?: any;
|
|
28
|
+
selectedOption?: ContextSwitcherItem;
|
|
29
|
+
switcherChange?: (selectedValue: string, selectedType?: string | undefined) => void;
|
|
30
|
+
}
|
|
31
|
+
export interface ContextSwitcherItem {
|
|
32
|
+
clickHandler?: any;
|
|
33
|
+
customRendererCategory?: any;
|
|
34
|
+
id?: string;
|
|
35
|
+
label?: string;
|
|
36
|
+
link?: string;
|
|
37
|
+
linkFromPath?: null | string;
|
|
38
|
+
position?: 'bottom' | 'top';
|
|
39
|
+
testId?: string;
|
|
40
|
+
}
|
|
21
41
|
export interface selectionConditions {
|
|
22
42
|
route?: string;
|
|
23
43
|
contextCriteria?: ContextCriteria[];
|
|
@@ -166,6 +186,7 @@ export interface BreadcrumbItem {
|
|
|
166
186
|
export interface NavItem {
|
|
167
187
|
altText?: string;
|
|
168
188
|
category?: Category;
|
|
189
|
+
externalLink?: ExternalLink;
|
|
169
190
|
href?: string;
|
|
170
191
|
icon?: string;
|
|
171
192
|
node?: Node;
|
|
@@ -207,6 +228,7 @@ export interface ProductSwitcher {
|
|
|
207
228
|
items?: [ProductSwitcherItem];
|
|
208
229
|
label?: string;
|
|
209
230
|
testId?: string;
|
|
231
|
+
productSwitcherItemClick?: (item: ProductSwitcherItem) => void;
|
|
210
232
|
}
|
|
211
233
|
export interface ProductSwitcherItem {
|
|
212
234
|
altText?: string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Luigi } from '../../core-api/luigi';
|
|
2
|
+
export declare const ContextSwitcherHelpers: {
|
|
3
|
+
_fallbackLabels: Map<any, any>;
|
|
4
|
+
resetFallbackLabelCache(): void;
|
|
5
|
+
getPreparedParentNodePath(config: Record<string, any>): string;
|
|
6
|
+
generateSwitcherNav(config: Record<string, any>, rawOptions: any[]): any[];
|
|
7
|
+
getNodePathFromCurrentPath(option: Record<string, any>, selectedOption: Record<string, any>, luigi: Luigi): string;
|
|
8
|
+
getOptionById(options: any[], id: string): any;
|
|
9
|
+
getLabelFromOptions(options: any[], id: string): string;
|
|
10
|
+
isContextSwitcherDetailsView(currentPath: string, parentNodePath: string): boolean;
|
|
11
|
+
getFallbackLabel(fallbackLabelResolver: any, id: string, luigi: Luigi): Promise<string>;
|
|
12
|
+
getSelectedId(currentPath: string, options: any[], parentNodePath: string): string | undefined;
|
|
13
|
+
getSelectedOption(currentPath: string, options: any[], parentNodePath: string): any;
|
|
14
|
+
getSelectedLabel(currentPath: string, options: any[], parentNodePath: string, fallbackLabelResolver: any, luigi: Luigi): Promise<string | undefined>;
|
|
15
|
+
getSelectedNode(currentPath: string, options: any[], parentNodePath: string): string | undefined;
|
|
16
|
+
fetchOptions(luigi: Luigi, existingOptions?: never[]): Promise<any[]>;
|
|
17
|
+
};
|
|
@@ -65,12 +65,24 @@ export declare const GenericHelpers: {
|
|
|
65
65
|
* @returns {string} string without leading slash
|
|
66
66
|
*/
|
|
67
67
|
trimLeadingSlash: (str: string) => string;
|
|
68
|
+
/**
|
|
69
|
+
* Adds a trailing slash to a string if it has none
|
|
70
|
+
* @param {string} str string to be checked
|
|
71
|
+
* @returns {string} string with a trailing slash
|
|
72
|
+
*/
|
|
73
|
+
addTrailingSlash: (str: string) => string;
|
|
68
74
|
/**
|
|
69
75
|
* Prepend current url to redirect_uri, if it is a relative path
|
|
70
76
|
* @param {string} str string from which any number of trailing slashes should be removed
|
|
71
77
|
* @returns {string} string without any trailing slash
|
|
72
78
|
*/
|
|
73
79
|
trimTrailingSlash: (str: string) => string;
|
|
80
|
+
/**
|
|
81
|
+
* Returns a path that starts and end with one (and only one) slash, regardless of the slashes being already present in the path given as input
|
|
82
|
+
* @param {string} str path to normalize
|
|
83
|
+
* @returns {string} path that starts and ends with a slash
|
|
84
|
+
*/
|
|
85
|
+
normalizePath: (str: string) => string;
|
|
74
86
|
/**
|
|
75
87
|
* Checks if HTML element is visible
|
|
76
88
|
* @param {Element} element to be checked in DOM
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FeatureToggles } from '../../core-api/feature-toggles';
|
|
2
2
|
import { Luigi } from '../../core-api/luigi';
|
|
3
|
-
import { AppSwitcher, Node, PathData, TitleResolver } from '../../types/navigation';
|
|
3
|
+
import { AppSwitcher, ExternalLink, Node, PathData, TitleResolver } from '../../types/navigation';
|
|
4
4
|
export declare const NavigationHelpers: {
|
|
5
5
|
normalizePath: (raw: string) => string;
|
|
6
6
|
segmentMatches: (linkSegment: string, pathSegment: string, pathParams: Record<string, any>) => boolean;
|
|
@@ -44,4 +44,5 @@ export declare const NavigationHelpers: {
|
|
|
44
44
|
label: string;
|
|
45
45
|
icon?: string;
|
|
46
46
|
};
|
|
47
|
+
openExternalLink(externalLink: ExternalLink, pathParams?: Record<string, any>): void;
|
|
47
48
|
};
|