@luigi-project/core-modular 0.0.3-dev.202602251029 → 0.0.3-dev.202602260045

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/package.json CHANGED
@@ -18,5 +18,5 @@
18
18
  "micro-frontends",
19
19
  "microfrontends"
20
20
  ],
21
- "version": "0.0.3-dev.202602251029"
21
+ "version": "0.0.3-dev.202602260045"
22
22
  }
@@ -1,10 +1,13 @@
1
1
  import { Luigi } from '../core-api/luigi';
2
2
  import { AppSwitcher, LeftNavData, NavigationRequestParams, NavItem, Node, PathData, TabNavData, TopNavData } from '../types/navigation';
3
3
  import { NodeDataManagementService } from './node-data-management.service';
4
+ import { ModalService } from './modal.service';
4
5
  export declare class NavigationService {
5
6
  private luigi;
7
+ modalService?: ModalService;
6
8
  nodeDataManagementService?: NodeDataManagementService;
7
9
  constructor(luigi: Luigi);
10
+ private getModalService;
8
11
  private getNodeDataManagementService;
9
12
  getPathData(path: string): Promise<PathData>;
10
13
  findMatchingNode(urlPathElement: string, nodes: Node[]): Node | undefined;
@@ -23,7 +26,7 @@ export declare class NavigationService {
23
26
  getTruncatedChildren(children: any): any[];
24
27
  applyNavGroups(items: NavItem[]): NavItem[];
25
28
  getLeftNavData(path: string, pData?: PathData): Promise<LeftNavData>;
26
- navItemClick(item: Node, parentPath: string): void;
29
+ navItemClick(node: Node, pathData?: PathData): void;
27
30
  getTopNavData(path: string, pData?: PathData): Promise<TopNavData>;
28
31
  getParentNode(node: Node | undefined, pathData: PathData): Node | undefined;
29
32
  getAppSwitcherData(appSwitcherData: AppSwitcher, headerSettings: any): AppSwitcher | undefined;
@@ -77,4 +80,31 @@ export declare class NavigationService {
77
80
  getChildren(node: Node | undefined, context?: Record<string, any>): Promise<Node[]>;
78
81
  getExpandStructuralPathSegment(node: Node): Node;
79
82
  bindChildToParent(child: Node, node: Node): Node;
83
+ /**
84
+ * Builds a virtual tree structure for the given node based on the provided path parameters.
85
+ *
86
+ * @param node - The node for which the virtual tree is being built.
87
+ * @param nodesInPath - An array of nodes representing the path in the virtual tree.
88
+ * @param pathParams - An object containing path parameters for the virtual tree.
89
+ */
90
+ buildVirtualTree(node: Node, nodesInPath: any, pathParams: Record<string, any>): void;
91
+ /**
92
+ * Requires str to include :virtualPath
93
+ * and pathParams consist of :virtualSegment_N
94
+ * for deep nested virtual tree building
95
+ *
96
+ * @param str - The base string for the virtual view URL.
97
+ * @param pathParams - An object containing path parameters for the virtual view URL.
98
+ * @param _virtualPathIndex - The index of the virtual path segment.
99
+ * @returns The constructed virtual view URL string.
100
+ */
101
+ buildVirtualViewUrl(str: string, pathParams: any, _virtualPathIndex: number): string;
102
+ /**
103
+ * Builds a path string by concatenating path segments from the virtual tree root or the incoming path.
104
+ *
105
+ * @param incomingPath - The incoming path segment to be appended.
106
+ * @param fromVirtualTreeRoot - A boolean indicating whether to build the path from the virtual tree root.
107
+ * @returns The constructed path string.
108
+ */
109
+ buildPath(incomingPath: string, fromVirtualTreeRoot?: boolean): Promise<string>;
80
110
  }
@@ -107,6 +107,10 @@ export interface Node {
107
107
  tooltipText?: string;
108
108
  viewUrl?: string;
109
109
  visibleForFeatureToggles?: string[];
110
+ virtualTree?: boolean;
111
+ _virtualTree?: Node;
112
+ _virtualPathIndex?: number;
113
+ _virtualViewUrl?: string;
110
114
  }
111
115
  export interface PageErrorHandler {
112
116
  timeout: number;
@@ -172,10 +176,17 @@ export interface ExternalLink {
172
176
  url?: string;
173
177
  sameWindow?: boolean;
174
178
  }
179
+ export interface NavigationOptions {
180
+ fromContext?: any;
181
+ fromClosestContext?: boolean;
182
+ fromVirtualTreeRoot?: boolean;
183
+ fromParent?: boolean;
184
+ }
175
185
  export interface NavigationRequestBase {
176
186
  preventContextUpdate?: boolean;
177
187
  preventHistoryEntry?: boolean;
178
188
  withoutSync?: boolean;
189
+ options?: NavigationOptions;
179
190
  }
180
191
  export interface NavigationRequestParams extends NavigationRequestBase {
181
192
  modalSettings?: any;
@@ -81,4 +81,30 @@ export declare const GenericHelpers: {
81
81
  */
82
82
  getConfigBooleanValue: (object: Record<string, any>, property: string) => boolean;
83
83
  getUrlParameter: (key: string) => string | null;
84
+ /**
85
+ * Returns a new Object with the same object,
86
+ * without the keys that were given.
87
+ * References still stay.
88
+ * Allows wildcard ending keys
89
+ *
90
+ * @param {Object} input - any given object
91
+ * @param {Array} keys - allows also wildcards at the end, like: _*
92
+ */
93
+ removeProperties(input: Record<string, any>, keys: any[]): Record<string, any>;
94
+ /**
95
+ * Replaces variables in the input string with the values from the params object. Variables are defined with a prefix and wrapped in curly braces, e.g. {i18n.key} or {config.key}.
96
+ * If the variable is not found in the params object, it will be removed from the string.
97
+ * @param inputString
98
+ * @param params
99
+ * @param prefix
100
+ * @param parenthesis
101
+ * @returns
102
+ */
103
+ replaceVars(inputString: string, params: Record<string, any>, prefix: string, parenthesis?: boolean): string;
104
+ /**
105
+ * Escapes special characters in a string for use in a regular expression.
106
+ * @param string
107
+ * @returns
108
+ */
109
+ escapeRegExp(string: string): string;
84
110
  };
@@ -12,4 +12,10 @@ export declare const NavigationHelpers: {
12
12
  buildPath(pathToLeftNavParent: Node[], pathData?: PathData): string;
13
13
  mergeContext(...objs: Record<string, any>[]): Record<string, any>;
14
14
  prepareForTests(...parts: string[]): string;
15
+ /**
16
+ * Finds the virtual tree root node for a given node by traversing up the node hierarchy until it finds a node with the virtualTree property set to true. If no such node is found, it returns undefined.
17
+ * @param node The node for which to find the virtual tree root node.
18
+ * @returns The virtual tree root node if found, otherwise undefined.
19
+ */
20
+ findVirtualTreeRootNode(node: Node): Node | undefined;
15
21
  };
@@ -262,4 +262,13 @@ export declare const RoutingHelpers: {
262
262
  * @param {*} pathParams
263
263
  */
264
264
  getDynamicNodeValue(node: Node, pathParams: Record<string, string>): string | undefined;
265
+ /**
266
+ * Builds a route string by recursively traversing up the node hierarchy and concatenating path segments.
267
+ * @param node - The current node from which to start building the route.
268
+ * @param path - The accumulated path string (used internally for recursion).
269
+ * @param params - Optional query parameters to append to the final route.
270
+ * @returns a string representing the full route from the root to the given node, including query parameters if provided.
271
+ */
272
+ buildRoute(node: Node, path?: string, params?: string): string;
273
+ substituteViewUrl(viewUrl: string, pathData: PathData, luigi: Luigi): string;
265
274
  };