@luigi-project/core-modular 0.0.4-dev.202603120041 → 0.0.4-dev.202603131029
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-engine.d.ts +3 -3
- package/luigi.js +18 -18
- package/luigi.js.map +1 -1
- package/modules/ui-module.d.ts +5 -4
- package/package.json +1 -1
- package/services/navigation.service.d.ts +1 -1
- package/services/routing.service.d.ts +1 -6
- package/types/navigation.d.ts +217 -1
- package/types/routing.d.ts +12 -0
- package/utilities/helpers/navigation-helpers.d.ts +1 -1
package/modules/ui-module.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Luigi } from '../core-api/luigi';
|
|
2
2
|
import { NavigationService } from '../services/navigation.service';
|
|
3
3
|
import { RoutingService } from '../services/routing.service';
|
|
4
|
-
import { ModalSettings } from '../types/navigation';
|
|
4
|
+
import { ModalSettings, Node } from '../types/navigation';
|
|
5
|
+
import { LuigiParams } from '../types/routing';
|
|
5
6
|
export declare const UIModule: {
|
|
6
7
|
navService: NavigationService;
|
|
7
8
|
routingService: RoutingService;
|
|
8
9
|
luigi: Luigi;
|
|
9
10
|
init: (luigi: Luigi) => void;
|
|
10
11
|
update: (scopes?: string[]) => Promise<void>;
|
|
11
|
-
updateMainContent: (currentNode:
|
|
12
|
-
openModal: (luigi: Luigi, node:
|
|
12
|
+
updateMainContent: (currentNode: Node, luigi: Luigi, luigiParams?: LuigiParams, withoutSync?: boolean, preventContextUpdate?: boolean) => Promise<void>;
|
|
13
|
+
openModal: (luigi: Luigi, node: Node, modalSettings: ModalSettings, onCloseCallback?: () => void) => Promise<void>;
|
|
13
14
|
updateModalSettings: (modalSettings: ModalSettings, addHistoryEntry: boolean, luigi: Luigi) => void;
|
|
14
|
-
openDrawer: (luigi: Luigi, node:
|
|
15
|
+
openDrawer: (luigi: Luigi, node: Node, modalSettings: ModalSettings, onCloseCallback?: () => void) => Promise<void>;
|
|
15
16
|
};
|
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@ export declare class NavigationService {
|
|
|
23
23
|
* @param array children
|
|
24
24
|
* @returns array children
|
|
25
25
|
*/
|
|
26
|
-
getTruncatedChildren(children:
|
|
26
|
+
getTruncatedChildren(children: Node[]): Node[];
|
|
27
27
|
applyNavGroups(items: NavItem[]): NavItem[];
|
|
28
28
|
getLeftNavData(path: string, pData?: PathData): Promise<LeftNavData>;
|
|
29
29
|
navItemClick(node: Node, pathData?: PathData): void;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { Luigi } from '../core-api/luigi';
|
|
2
|
+
import { Route } from '../types/routing';
|
|
2
3
|
import { ModalSettings, Node, PathData } from '../types/navigation';
|
|
3
4
|
import { NavigationService } from './navigation.service';
|
|
4
|
-
export interface Route {
|
|
5
|
-
raw: string;
|
|
6
|
-
node?: Node;
|
|
7
|
-
path: string;
|
|
8
|
-
nodeParams?: Record<string, string>;
|
|
9
|
-
}
|
|
10
5
|
export declare class RoutingService {
|
|
11
6
|
private luigi;
|
|
12
7
|
navigationService?: NavigationService;
|
package/types/navigation.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export interface UserInfo {
|
|
|
59
59
|
description?: string;
|
|
60
60
|
}
|
|
61
61
|
export interface LeftNavData {
|
|
62
|
-
selectedNode:
|
|
62
|
+
selectedNode: Node;
|
|
63
63
|
items: NavItem[];
|
|
64
64
|
basePath: string;
|
|
65
65
|
sideNavFooterText?: string;
|
|
@@ -88,8 +88,10 @@ export interface Node {
|
|
|
88
88
|
changeCurrentLocale?: boolean;
|
|
89
89
|
urlParameters?: Record<string, any>;
|
|
90
90
|
};
|
|
91
|
+
compound?: CompoundConfig;
|
|
91
92
|
context?: Record<string, any>;
|
|
92
93
|
drawer?: ModalSettings;
|
|
94
|
+
decodeViewUrl?: boolean;
|
|
93
95
|
externalLink?: ExternalLink;
|
|
94
96
|
hideFromNav?: boolean;
|
|
95
97
|
hideSideNav?: boolean;
|
|
@@ -97,6 +99,9 @@ export interface Node {
|
|
|
97
99
|
isRootNode?: boolean;
|
|
98
100
|
keepSelectedForChildren?: boolean;
|
|
99
101
|
label?: string;
|
|
102
|
+
loadingIndicator?: {
|
|
103
|
+
enabled: boolean;
|
|
104
|
+
};
|
|
100
105
|
navigationContext?: string;
|
|
101
106
|
onNodeActivation?: (node: Node) => boolean | void;
|
|
102
107
|
openNodeInModal?: boolean;
|
|
@@ -106,9 +111,16 @@ export interface Node {
|
|
|
106
111
|
runTimeErrorHandler?: RunTimeErrorHandler;
|
|
107
112
|
tabNav?: boolean;
|
|
108
113
|
tooltipText?: string;
|
|
114
|
+
userSettingsGroup?: string;
|
|
109
115
|
viewUrl?: string;
|
|
110
116
|
visibleForFeatureToggles?: string[];
|
|
111
117
|
virtualTree?: boolean;
|
|
118
|
+
viewGroup?: string;
|
|
119
|
+
webcomponent?: boolean | {
|
|
120
|
+
type?: string;
|
|
121
|
+
selfRegistered?: boolean;
|
|
122
|
+
tagName?: string;
|
|
123
|
+
};
|
|
112
124
|
_virtualTree?: Node;
|
|
113
125
|
_virtualPathIndex?: number;
|
|
114
126
|
_virtualViewUrl?: string;
|
|
@@ -198,4 +210,208 @@ export interface NavigationRequestParams extends NavigationRequestBase {
|
|
|
198
210
|
export interface NavigationRequestEvent {
|
|
199
211
|
detail: NavigationRequestBase;
|
|
200
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* Configuration for compound web components in Luigi.
|
|
215
|
+
* Compound allows you to layout multiple web components in one micro frontend.
|
|
216
|
+
*/
|
|
217
|
+
export interface CompoundConfig {
|
|
218
|
+
/**
|
|
219
|
+
* Renderer configuration for the compound layout
|
|
220
|
+
*/
|
|
221
|
+
renderer?: {
|
|
222
|
+
/**
|
|
223
|
+
* The renderer to use - can be 'grid', a custom renderer object, or undefined for default
|
|
224
|
+
*/
|
|
225
|
+
use?: 'grid' | string | {
|
|
226
|
+
/**
|
|
227
|
+
* Base renderer to extend (e.g., 'grid')
|
|
228
|
+
*/
|
|
229
|
+
extends?: string;
|
|
230
|
+
/**
|
|
231
|
+
* Custom function to create the compound container
|
|
232
|
+
* @param config - The renderer configuration
|
|
233
|
+
* @param renderer - The parent/super renderer (if extending)
|
|
234
|
+
*/
|
|
235
|
+
createCompoundContainer?: (config: RendererConfig, renderer?: any) => HTMLDivElement;
|
|
236
|
+
/**
|
|
237
|
+
* Custom function to create individual compound item containers
|
|
238
|
+
* @param layoutConfig - Layout configuration for the item
|
|
239
|
+
* @param config - The overall renderer configuration
|
|
240
|
+
* @param renderer - The parent/super renderer (if extending)
|
|
241
|
+
*/
|
|
242
|
+
createCompoundItemContainer?: (layoutConfig?: LayoutConfig, config?: RendererConfig, renderer?: any) => HTMLDivElement;
|
|
243
|
+
/**
|
|
244
|
+
* Custom function to attach an item to the compound container
|
|
245
|
+
* @param compoundCnt - The compound container element
|
|
246
|
+
* @param compoundItemCnt - The item container to attach
|
|
247
|
+
* @param renderer - The parent/super renderer (if extending)
|
|
248
|
+
*/
|
|
249
|
+
attachCompoundItem?: (compoundCnt: HTMLElement, compoundItemCnt: HTMLElement, renderer?: any) => void;
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Configuration for the grid layout
|
|
253
|
+
*/
|
|
254
|
+
config?: {
|
|
255
|
+
/**
|
|
256
|
+
* CSS grid-template-columns value (e.g., '1fr 2fr')
|
|
257
|
+
*/
|
|
258
|
+
columns?: string;
|
|
259
|
+
/**
|
|
260
|
+
* CSS grid-template-rows value (e.g., '150px 150px')
|
|
261
|
+
*/
|
|
262
|
+
rows?: string;
|
|
263
|
+
/**
|
|
264
|
+
* CSS grid-gap value (e.g., 'auto', '10px')
|
|
265
|
+
*/
|
|
266
|
+
gap?: string;
|
|
267
|
+
/**
|
|
268
|
+
* Minimum height for the grid container
|
|
269
|
+
*/
|
|
270
|
+
minHeight?: string;
|
|
271
|
+
/**
|
|
272
|
+
* Responsive layout configurations for different viewport sizes
|
|
273
|
+
*/
|
|
274
|
+
layouts?: Array<{
|
|
275
|
+
/**
|
|
276
|
+
* CSS grid-template-columns for this breakpoint
|
|
277
|
+
*/
|
|
278
|
+
columns?: string | number;
|
|
279
|
+
/**
|
|
280
|
+
* CSS grid-template-rows for this breakpoint
|
|
281
|
+
*/
|
|
282
|
+
rows?: string | number;
|
|
283
|
+
/**
|
|
284
|
+
* CSS grid-gap for this breakpoint
|
|
285
|
+
*/
|
|
286
|
+
gap?: string | number;
|
|
287
|
+
/**
|
|
288
|
+
* Minimum viewport width for this layout (in pixels)
|
|
289
|
+
*/
|
|
290
|
+
minWidth?: number;
|
|
291
|
+
/**
|
|
292
|
+
* Maximum viewport width for this layout (in pixels)
|
|
293
|
+
*/
|
|
294
|
+
maxWidth?: number;
|
|
295
|
+
}>;
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
/**
|
|
299
|
+
* Lazy loading configuration for compound children
|
|
300
|
+
*/
|
|
301
|
+
lazyLoadingOptions?: {
|
|
302
|
+
/**
|
|
303
|
+
* Enable lazy loading using IntersectionObserver
|
|
304
|
+
* @default false
|
|
305
|
+
*/
|
|
306
|
+
enabled?: boolean;
|
|
307
|
+
/**
|
|
308
|
+
* IntersectionObserver rootMargin option
|
|
309
|
+
* Controls when children are loaded relative to viewport visibility
|
|
310
|
+
* @default "0px"
|
|
311
|
+
*/
|
|
312
|
+
intersectionRootMargin?: string;
|
|
313
|
+
/**
|
|
314
|
+
* Default temporary height for child containers before they load
|
|
315
|
+
* @default "500px"
|
|
316
|
+
*/
|
|
317
|
+
temporaryContainerHeight?: string;
|
|
318
|
+
/**
|
|
319
|
+
* Disable automatic temporary container heights
|
|
320
|
+
* Useful for custom renderers that manage heights themselves
|
|
321
|
+
* @default false
|
|
322
|
+
*/
|
|
323
|
+
noTemporaryContainerHeight?: boolean;
|
|
324
|
+
};
|
|
325
|
+
/**
|
|
326
|
+
* Array of child web component configurations
|
|
327
|
+
*/
|
|
328
|
+
children?: Array<{
|
|
329
|
+
/**
|
|
330
|
+
* Unique identifier for this child web component
|
|
331
|
+
*/
|
|
332
|
+
id: string;
|
|
333
|
+
/**
|
|
334
|
+
* URL pointing to the web component JavaScript file
|
|
335
|
+
* Supports {i18n.currentLocale} placeholder for localization
|
|
336
|
+
*/
|
|
337
|
+
viewUrl: string;
|
|
338
|
+
/**
|
|
339
|
+
* Context object passed to the web component
|
|
340
|
+
*/
|
|
341
|
+
context?: Record<string, any>;
|
|
342
|
+
/**
|
|
343
|
+
* Layout configuration for positioning this child
|
|
344
|
+
*/
|
|
345
|
+
layoutConfig?: {
|
|
346
|
+
/**
|
|
347
|
+
* CSS grid-row value (e.g., '1 / 3', 'auto')
|
|
348
|
+
* @default "auto"
|
|
349
|
+
*/
|
|
350
|
+
row?: string;
|
|
351
|
+
/**
|
|
352
|
+
* CSS grid-column value (e.g., '1 / -1', 'auto')
|
|
353
|
+
* @default "auto"
|
|
354
|
+
*/
|
|
355
|
+
column?: string;
|
|
356
|
+
/**
|
|
357
|
+
* Slot name for nested web components
|
|
358
|
+
* Use this instead of row/column to plug into a parent's slot
|
|
359
|
+
*/
|
|
360
|
+
slot?: string;
|
|
361
|
+
/**
|
|
362
|
+
* Override the default temporary container height for this specific child
|
|
363
|
+
* Only used when lazy loading is enabled
|
|
364
|
+
* * @default undefined
|
|
365
|
+
*/
|
|
366
|
+
temporaryContainerHeight?: string;
|
|
367
|
+
};
|
|
368
|
+
/**
|
|
369
|
+
* Event listeners for cross-component communication via event bus
|
|
370
|
+
*/
|
|
371
|
+
eventListeners?: Array<{
|
|
372
|
+
/**
|
|
373
|
+
* ID of the source web component (use '*' for any source)
|
|
374
|
+
*/
|
|
375
|
+
source: string;
|
|
376
|
+
/**
|
|
377
|
+
* Name of the event to listen for
|
|
378
|
+
*/
|
|
379
|
+
name: string;
|
|
380
|
+
/**
|
|
381
|
+
* Type of action to perform (e.g., 'update')
|
|
382
|
+
*/
|
|
383
|
+
action: string;
|
|
384
|
+
/**
|
|
385
|
+
* Optional function to convert event data before passing to listener
|
|
386
|
+
* @param data - The event data
|
|
387
|
+
*/
|
|
388
|
+
dataConverter?: (data: any) => any;
|
|
389
|
+
}>;
|
|
390
|
+
}>;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Supporting type for layout configuration
|
|
394
|
+
*/
|
|
395
|
+
export interface LayoutConfig {
|
|
396
|
+
column?: string;
|
|
397
|
+
row?: string;
|
|
398
|
+
slot?: string;
|
|
399
|
+
temporaryContainerHeight?: string;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Supporting type for renderer configuration
|
|
403
|
+
*/
|
|
404
|
+
export interface RendererConfig {
|
|
405
|
+
columns?: string;
|
|
406
|
+
rows?: string;
|
|
407
|
+
gap?: string;
|
|
408
|
+
minHeight?: string;
|
|
409
|
+
layouts?: Array<{
|
|
410
|
+
columns?: string;
|
|
411
|
+
rows?: string;
|
|
412
|
+
gap?: string | number;
|
|
413
|
+
minWidth?: number;
|
|
414
|
+
maxWidth?: number;
|
|
415
|
+
}>;
|
|
416
|
+
}
|
|
201
417
|
export type HistoryMethod = 'pushState' | 'replaceState';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Node } from './navigation';
|
|
2
|
+
export interface Route {
|
|
3
|
+
raw: string;
|
|
4
|
+
node?: Node;
|
|
5
|
+
path: string;
|
|
6
|
+
nodeParams?: Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
export interface LuigiParams {
|
|
9
|
+
nodeParams: Record<string, any> | {};
|
|
10
|
+
pathParams: Record<string, any> | {};
|
|
11
|
+
searchParams: Record<string, any> | {};
|
|
12
|
+
}
|
|
@@ -6,7 +6,7 @@ export declare const NavigationHelpers: {
|
|
|
6
6
|
segmentMatches: (linkSegment: string, pathSegment: string, pathParams: Record<string, any>) => boolean;
|
|
7
7
|
checkMatch: (route: string, nodesInPath: Array<any>, pathParams?: Record<string, any>) => boolean;
|
|
8
8
|
checkVisibleForFeatureToggles: (nodeToCheckPermission: any, featureToggles: FeatureToggles) => boolean;
|
|
9
|
-
generateTooltipText: (node:
|
|
9
|
+
generateTooltipText: (node: Node, translation: string, luigi: Luigi) => string;
|
|
10
10
|
isNodeAccessPermitted: (nodeToCheckPermissionFor: Node, parentNode: Node | undefined, currentContext: Record<string, any>, luigi: Luigi) => boolean;
|
|
11
11
|
updateHeaderTitle: (appSwitcherData: AppSwitcher, pathData: PathData) => string | undefined;
|
|
12
12
|
buildPath(pathToLeftNavParent: Node[], pathData?: PathData): string;
|