@luigi-project/core-modular 0.0.10-dev.202606260113 → 0.0.10-dev.202606270109
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/custom-messages.d.ts +26 -0
- package/core-api/global-search.d.ts +1 -18
- package/core-api/ux.d.ts +94 -1
- package/luigi-engine.d.ts +2 -2
- package/luigi.js +2174 -2155
- package/luigi.js.map +1 -1
- package/modules/ux-module.d.ts +2 -30
- package/package.json +1 -1
- package/services/global-search.service.d.ts +2 -1
- package/types/compound-config.d.ts +204 -0
- package/types/connector.d.ts +8 -19
- package/types/dom-elements.d.ts +13 -0
- package/types/global-search.d.ts +64 -0
- package/types/navigation.d.ts +11 -210
- package/types/ux.d.ts +43 -0
- package/utilities/helpers/global-search-helpers.d.ts +1 -1
package/modules/ux-module.d.ts
CHANGED
|
@@ -1,42 +1,14 @@
|
|
|
1
1
|
import { LuigiCompoundContainer, LuigiContainer } from '@luigi-project/container';
|
|
2
2
|
import { Luigi } from '../core-api/luigi';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
id?: string;
|
|
6
|
-
links?: Record<string, Link>;
|
|
7
|
-
text?: string;
|
|
8
|
-
ttl?: number;
|
|
9
|
-
type?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface AlertHandler {
|
|
12
|
-
openFromClient: boolean;
|
|
13
|
-
close(): void;
|
|
14
|
-
link(linkKey: string): boolean;
|
|
15
|
-
}
|
|
3
|
+
import { AlertSettings, ConfirmationModalSettings, Link } from '../types/ux';
|
|
4
|
+
export type { AlertHandler, AlertSettings, ConfirmationModalHandler, ConfirmationModalSettings, Link } from '../types/ux';
|
|
16
5
|
export interface ProcessedAlertSettings {
|
|
17
6
|
settings: AlertSettings;
|
|
18
7
|
}
|
|
19
|
-
export interface Link {
|
|
20
|
-
elemId: string;
|
|
21
|
-
url?: string;
|
|
22
|
-
dismissKey?: string;
|
|
23
|
-
}
|
|
24
8
|
export interface ProcessedTextAndLinks {
|
|
25
9
|
sanitizedText: string;
|
|
26
10
|
links: Link[];
|
|
27
11
|
}
|
|
28
|
-
export interface ConfirmationModalSettings {
|
|
29
|
-
icon?: string;
|
|
30
|
-
type?: string;
|
|
31
|
-
header?: string;
|
|
32
|
-
body?: string;
|
|
33
|
-
buttonConfirm?: string;
|
|
34
|
-
buttonDismiss?: string;
|
|
35
|
-
}
|
|
36
|
-
export interface ConfirmationModalHandler {
|
|
37
|
-
confirm(): void;
|
|
38
|
-
dismiss(): void;
|
|
39
|
-
}
|
|
40
12
|
export interface UserSettings {
|
|
41
13
|
[key: string]: number | string | boolean;
|
|
42
14
|
}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GlobalSearchProvider, SearchResultItem } from '../
|
|
1
|
+
import { GlobalSearchProvider, SearchResultItem } from '../types/global-search';
|
|
2
2
|
import { Luigi } from '../core-api/luigi';
|
|
3
3
|
export declare class GlobalSearchService {
|
|
4
4
|
private luigi;
|
|
@@ -8,6 +8,7 @@ export declare class GlobalSearchService {
|
|
|
8
8
|
searchResult: SearchResultItem[];
|
|
9
9
|
constructor(luigi: Luigi);
|
|
10
10
|
get searchProvider(): GlobalSearchProvider;
|
|
11
|
+
private getHandler;
|
|
11
12
|
hasSearchProvider(): boolean;
|
|
12
13
|
getFieldVisibility(): boolean;
|
|
13
14
|
setFieldVisibility(value: boolean): void;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for compound web components in Luigi.
|
|
3
|
+
* Compound allows you to layout multiple web components in one micro frontend.
|
|
4
|
+
*/
|
|
5
|
+
export interface CompoundConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Renderer configuration for the compound layout
|
|
8
|
+
*/
|
|
9
|
+
renderer?: {
|
|
10
|
+
/**
|
|
11
|
+
* The renderer to use - can be 'grid', a custom renderer object, or undefined for default
|
|
12
|
+
*/
|
|
13
|
+
use?: 'grid' | string | {
|
|
14
|
+
/**
|
|
15
|
+
* Base renderer to extend (e.g., 'grid')
|
|
16
|
+
*/
|
|
17
|
+
extends?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Custom function to create the compound container
|
|
20
|
+
* @param config - The renderer configuration
|
|
21
|
+
* @param renderer - The parent/super renderer (if extending)
|
|
22
|
+
*/
|
|
23
|
+
createCompoundContainer?: (config: RendererConfig, renderer?: any) => HTMLDivElement;
|
|
24
|
+
/**
|
|
25
|
+
* Custom function to create individual compound item containers
|
|
26
|
+
* @param layoutConfig - Layout configuration for the item
|
|
27
|
+
* @param config - The overall renderer configuration
|
|
28
|
+
* @param renderer - The parent/super renderer (if extending)
|
|
29
|
+
*/
|
|
30
|
+
createCompoundItemContainer?: (layoutConfig?: LayoutConfig, config?: RendererConfig, renderer?: any) => HTMLDivElement;
|
|
31
|
+
/**
|
|
32
|
+
* Custom function to attach an item to the compound container
|
|
33
|
+
* @param compoundCnt - The compound container element
|
|
34
|
+
* @param compoundItemCnt - The item container to attach
|
|
35
|
+
* @param renderer - The parent/super renderer (if extending)
|
|
36
|
+
*/
|
|
37
|
+
attachCompoundItem?: (compoundCnt: HTMLElement, compoundItemCnt: HTMLElement, renderer?: any) => void;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Configuration for the grid layout
|
|
41
|
+
*/
|
|
42
|
+
config?: {
|
|
43
|
+
/**
|
|
44
|
+
* CSS grid-template-columns value (e.g., '1fr 2fr')
|
|
45
|
+
*/
|
|
46
|
+
columns?: string;
|
|
47
|
+
/**
|
|
48
|
+
* CSS grid-template-rows value (e.g., '150px 150px')
|
|
49
|
+
*/
|
|
50
|
+
rows?: string;
|
|
51
|
+
/**
|
|
52
|
+
* CSS grid-gap value (e.g., 'auto', '10px')
|
|
53
|
+
*/
|
|
54
|
+
gap?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Minimum height for the grid container
|
|
57
|
+
*/
|
|
58
|
+
minHeight?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Responsive layout configurations for different viewport sizes
|
|
61
|
+
*/
|
|
62
|
+
layouts?: Array<{
|
|
63
|
+
/**
|
|
64
|
+
* CSS grid-template-columns for this breakpoint
|
|
65
|
+
*/
|
|
66
|
+
columns?: string | number;
|
|
67
|
+
/**
|
|
68
|
+
* CSS grid-template-rows for this breakpoint
|
|
69
|
+
*/
|
|
70
|
+
rows?: string | number;
|
|
71
|
+
/**
|
|
72
|
+
* CSS grid-gap for this breakpoint
|
|
73
|
+
*/
|
|
74
|
+
gap?: string | number;
|
|
75
|
+
/**
|
|
76
|
+
* Minimum viewport width for this layout (in pixels)
|
|
77
|
+
*/
|
|
78
|
+
minWidth?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Maximum viewport width for this layout (in pixels)
|
|
81
|
+
*/
|
|
82
|
+
maxWidth?: number;
|
|
83
|
+
}>;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Lazy loading configuration for compound children
|
|
88
|
+
*/
|
|
89
|
+
lazyLoadingOptions?: {
|
|
90
|
+
/**
|
|
91
|
+
* Enable lazy loading using IntersectionObserver
|
|
92
|
+
* @default false
|
|
93
|
+
*/
|
|
94
|
+
enabled?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* IntersectionObserver rootMargin option
|
|
97
|
+
* Controls when children are loaded relative to viewport visibility
|
|
98
|
+
* @default "0px"
|
|
99
|
+
*/
|
|
100
|
+
intersectionRootMargin?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Default temporary height for child containers before they load
|
|
103
|
+
* @default "500px"
|
|
104
|
+
*/
|
|
105
|
+
temporaryContainerHeight?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Disable automatic temporary container heights
|
|
108
|
+
* Useful for custom renderers that manage heights themselves
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
noTemporaryContainerHeight?: boolean;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Array of child web component configurations
|
|
115
|
+
*/
|
|
116
|
+
children?: Array<{
|
|
117
|
+
/**
|
|
118
|
+
* Unique identifier for this child web component
|
|
119
|
+
*/
|
|
120
|
+
id: string;
|
|
121
|
+
/**
|
|
122
|
+
* URL pointing to the web component JavaScript file
|
|
123
|
+
* Supports {i18n.currentLocale} placeholder for localization
|
|
124
|
+
*/
|
|
125
|
+
viewUrl: string;
|
|
126
|
+
/**
|
|
127
|
+
* Context object passed to the web component
|
|
128
|
+
*/
|
|
129
|
+
context?: Record<string, any>;
|
|
130
|
+
/**
|
|
131
|
+
* Layout configuration for positioning this child
|
|
132
|
+
*/
|
|
133
|
+
layoutConfig?: {
|
|
134
|
+
/**
|
|
135
|
+
* CSS grid-row value (e.g., '1 / 3', 'auto')
|
|
136
|
+
* @default "auto"
|
|
137
|
+
*/
|
|
138
|
+
row?: string;
|
|
139
|
+
/**
|
|
140
|
+
* CSS grid-column value (e.g., '1 / -1', 'auto')
|
|
141
|
+
* @default "auto"
|
|
142
|
+
*/
|
|
143
|
+
column?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Slot name for nested web components
|
|
146
|
+
* Use this instead of row/column to plug into a parent's slot
|
|
147
|
+
*/
|
|
148
|
+
slot?: string;
|
|
149
|
+
/**
|
|
150
|
+
* Override the default temporary container height for this specific child
|
|
151
|
+
* Only used when lazy loading is enabled
|
|
152
|
+
* * @default undefined
|
|
153
|
+
*/
|
|
154
|
+
temporaryContainerHeight?: string;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Event listeners for cross-component communication via event bus
|
|
158
|
+
*/
|
|
159
|
+
eventListeners?: Array<{
|
|
160
|
+
/**
|
|
161
|
+
* ID of the source web component (use '*' for any source)
|
|
162
|
+
*/
|
|
163
|
+
source: string;
|
|
164
|
+
/**
|
|
165
|
+
* Name of the event to listen for
|
|
166
|
+
*/
|
|
167
|
+
name: string;
|
|
168
|
+
/**
|
|
169
|
+
* Type of action to perform (e.g., 'update')
|
|
170
|
+
*/
|
|
171
|
+
action: string;
|
|
172
|
+
/**
|
|
173
|
+
* Optional function to convert event data before passing to listener
|
|
174
|
+
* @param data - The event data
|
|
175
|
+
*/
|
|
176
|
+
dataConverter?: (data: any) => any;
|
|
177
|
+
}>;
|
|
178
|
+
}>;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Supporting type for layout configuration
|
|
182
|
+
*/
|
|
183
|
+
export interface LayoutConfig {
|
|
184
|
+
column?: string;
|
|
185
|
+
row?: string;
|
|
186
|
+
slot?: string;
|
|
187
|
+
temporaryContainerHeight?: string;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Supporting type for renderer configuration
|
|
191
|
+
*/
|
|
192
|
+
export interface RendererConfig {
|
|
193
|
+
columns?: string;
|
|
194
|
+
rows?: string;
|
|
195
|
+
gap?: string;
|
|
196
|
+
minHeight?: string;
|
|
197
|
+
layouts?: Array<{
|
|
198
|
+
columns?: string;
|
|
199
|
+
rows?: string;
|
|
200
|
+
gap?: string | number;
|
|
201
|
+
minWidth?: number;
|
|
202
|
+
maxWidth?: number;
|
|
203
|
+
}>;
|
|
204
|
+
}
|
package/types/connector.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { CoreAPISupportedElements } from './dom-elements';
|
|
2
|
+
import { GlobalSearchHandler } from './global-search';
|
|
3
|
+
import { AlertHandler, AlertSettings, ConfirmationModalHandler, ConfirmationModalSettings } from './ux';
|
|
3
4
|
import { ModalSettings, LeftNavData, Node, TopNavData, TabNavData, BreadcrumbData, DrawerSettings, UserSettingsDialogSettings } from './navigation';
|
|
4
5
|
export interface LuigiConnector {
|
|
5
6
|
renderMainLayout(): void;
|
|
6
7
|
renderTopNav(data: TopNavData): void;
|
|
7
8
|
renderLeftNav(data: LeftNavData): void;
|
|
8
9
|
getContainerWrapper(): HTMLElement;
|
|
9
|
-
renderModal(content: HTMLElement, modalSettings: ModalSettings, onCloseCallback?: () => void, onCloseRequest?: () => void):
|
|
10
|
-
renderDrawer(content: HTMLElement, drawerSettings: DrawerSettings, onCloseCallback?: () => void, onCloseRequest?: () => void):
|
|
10
|
+
renderModal(content: HTMLElement, modalSettings: ModalSettings, onCloseCallback?: () => void, onCloseRequest?: () => void): void;
|
|
11
|
+
renderDrawer(content: HTMLElement, drawerSettings: DrawerSettings, onCloseCallback?: () => void, onCloseRequest?: () => void): void;
|
|
11
12
|
renderTabNav(data: TabNavData): void;
|
|
12
13
|
renderBreadcrumbs(data: BreadcrumbData): void;
|
|
13
14
|
renderAlert(alertSettings: AlertSettings, alertHandler: AlertHandler): void;
|
|
@@ -18,26 +19,14 @@ export interface LuigiConnector {
|
|
|
18
19
|
hideLoadingIndicator(container?: HTMLElement): void;
|
|
19
20
|
addBackdrop(): void;
|
|
20
21
|
removeBackdrop(): void;
|
|
21
|
-
openUserSettings(dialogSettings: UserSettingsDialogSettings, userSettingData: any[], previousUserSettings: any): void;
|
|
22
|
+
openUserSettings(dialogSettings: UserSettingsDialogSettings, userSettingData: Record<string, any>[], previousUserSettings: Record<string, any> | null): void;
|
|
22
23
|
closeUserSettings(): void;
|
|
23
24
|
setCurrentLocale(locale: string): void;
|
|
24
25
|
getCurrentLocale(): string;
|
|
25
26
|
updateModalSettings(modalSettings: ModalSettings): void;
|
|
26
27
|
showFatalError(error: string): void;
|
|
27
|
-
getCoreAPISupportedElements():
|
|
28
|
-
getShellbarElement(): HTMLElement | null;
|
|
29
|
-
getShellbarActions(): HTMLElement | null;
|
|
30
|
-
getLuigiContainer(): HTMLElement | null;
|
|
31
|
-
getNavFooterContainer(): HTMLElement | null;
|
|
32
|
-
};
|
|
28
|
+
getCoreAPISupportedElements(): CoreAPISupportedElements;
|
|
33
29
|
unload(): void;
|
|
34
|
-
|
|
35
|
-
closeSearchField(): void;
|
|
36
|
-
clearSearchField(): void;
|
|
37
|
-
showSearchResult(searchResultItems: SearchResultItem[], searchQuery: string, isCentered: boolean, onShowCallback: (rendererSlot?: any) => void): void;
|
|
38
|
-
closeSearchResult(): void;
|
|
39
|
-
setSearchString(searchString: string, onSetCallback: (inputElem?: HTMLInputElement) => void): void;
|
|
40
|
-
setSearchInputPlaceholder(placeholder: string): void;
|
|
41
|
-
toggleSearch(isSearchFieldVisible: boolean, onToggleCallback: (inputElem?: HTMLInputElement) => void): void;
|
|
30
|
+
getGlobalSearchHandler?(): GlobalSearchHandler;
|
|
42
31
|
}
|
|
43
32
|
export type { Node };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM elements the connector exposes to Luigi's core API.
|
|
3
|
+
*
|
|
4
|
+
* Returned from `LuigiConnector.getCoreAPISupportedElements()` and consumed by
|
|
5
|
+
* `Luigi.elements()` to give micro-frontend authors access to shell-owned
|
|
6
|
+
* regions of the page.
|
|
7
|
+
*/
|
|
8
|
+
export interface CoreAPISupportedElements {
|
|
9
|
+
getShellbarElement(): HTMLElement | null;
|
|
10
|
+
getShellbarActions(): HTMLElement | null;
|
|
11
|
+
getLuigiContainer(): HTMLElement | null;
|
|
12
|
+
getNavFooterContainer(): HTMLElement | null;
|
|
13
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Top-level `globalSearch` section of the Luigi configuration.
|
|
3
|
+
*
|
|
4
|
+
* See https://docs.luigi-project.io/docs/navigation-parameters-reference?section=global-search.
|
|
5
|
+
*/
|
|
6
|
+
export interface GlobalSearch {
|
|
7
|
+
/**
|
|
8
|
+
* Disables Luigi's internal keyup/etc. handlers on the search input field.
|
|
9
|
+
* When `true`, a `searchProvider` must be defined to attach custom logic.
|
|
10
|
+
*/
|
|
11
|
+
disableInputHandlers?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Label for the cancel button shown next to the search field on small viewports
|
|
14
|
+
* in centered mode. Only used when `searchFieldCentered` is active. Defaults to
|
|
15
|
+
* `'Cancel'`.
|
|
16
|
+
*/
|
|
17
|
+
globalSearchCenteredCancelButton?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Render the search input in the center of the shellbar instead of inline.
|
|
20
|
+
*/
|
|
21
|
+
searchFieldCentered?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Provider object carrying the renderers and event callbacks Luigi invokes
|
|
24
|
+
* during search interaction.
|
|
25
|
+
*/
|
|
26
|
+
searchProvider?: GlobalSearchProvider;
|
|
27
|
+
}
|
|
28
|
+
export interface GlobalSearchProvider {
|
|
29
|
+
customSearchResultItemRenderer?: (searchResultItem: any, slot: HTMLLIElement, searchApiObj: any) => object;
|
|
30
|
+
customSearchResultRenderer?: (searchResults: any[], slot: HTMLDivElement, searchApiObj: any) => object;
|
|
31
|
+
/**
|
|
32
|
+
* Placeholder text for the search input. May be a plain string, a function
|
|
33
|
+
* returning a string, or a locale-keyed map (`{ en: '...', de: '...' }`).
|
|
34
|
+
*/
|
|
35
|
+
inputPlaceholder?: string | (() => string) | Record<string, string>;
|
|
36
|
+
onEnter?: () => void;
|
|
37
|
+
onEscape?: () => void;
|
|
38
|
+
onInput?: () => void;
|
|
39
|
+
onSearchBtnClick?: () => void;
|
|
40
|
+
onSearchResultItemSelected?: (searchResultItem: any) => void;
|
|
41
|
+
toggleSearch?: (element: HTMLInputElement, visible: boolean) => void;
|
|
42
|
+
}
|
|
43
|
+
export interface SearchResultItem {
|
|
44
|
+
description: string;
|
|
45
|
+
label: string;
|
|
46
|
+
pathObject: Record<string, any>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Imperative global-search surface exposed by a Luigi connector.
|
|
50
|
+
*
|
|
51
|
+
* The connector returns this handler from `getGlobalSearchHandler()`; if the
|
|
52
|
+
* connector does not implement global search, it may omit `getGlobalSearchHandler`
|
|
53
|
+
* entirely.
|
|
54
|
+
*/
|
|
55
|
+
export interface GlobalSearchHandler {
|
|
56
|
+
openSearchField(): void;
|
|
57
|
+
closeSearchField(): void;
|
|
58
|
+
clearSearchField(): void;
|
|
59
|
+
showSearchResult(searchResultItems: SearchResultItem[], searchQuery: string, isCentered: boolean, onShowCallback: (rendererSlot?: any) => void): void;
|
|
60
|
+
closeSearchResult(): void;
|
|
61
|
+
setSearchString(searchString: string, onSetCallback: (inputElem?: HTMLInputElement) => void): void;
|
|
62
|
+
setSearchInputPlaceholder(placeholder: string): void;
|
|
63
|
+
toggleSearch(isSearchFieldVisible: boolean, onToggleCallback: (inputElem?: HTMLInputElement) => void): void;
|
|
64
|
+
}
|
package/types/navigation.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GlobalSearch } from './global-search';
|
|
2
|
+
import { CompoundConfig } from './compound-config';
|
|
2
3
|
export interface TopNavData {
|
|
3
4
|
appSwitcher?: AppSwitcher;
|
|
4
5
|
appTitle: string;
|
|
5
6
|
contextSwitcher?: ContextSwitcher;
|
|
6
|
-
|
|
7
|
+
globalSearch?: GlobalSearch;
|
|
7
8
|
logo: string;
|
|
8
9
|
navClick?: (item: NavItem) => Promise<void>;
|
|
9
10
|
productSwitcher?: ProductSwitcher;
|
|
@@ -219,9 +220,12 @@ export interface BreadcrumbData {
|
|
|
219
220
|
renderer?: any;
|
|
220
221
|
selectedNode?: Node;
|
|
221
222
|
}
|
|
223
|
+
export interface DrawerHeader {
|
|
224
|
+
title: string;
|
|
225
|
+
}
|
|
222
226
|
export interface DrawerSettings {
|
|
223
227
|
backdrop?: boolean;
|
|
224
|
-
header?:
|
|
228
|
+
header?: DrawerHeader;
|
|
225
229
|
overlap?: boolean;
|
|
226
230
|
size?: 'l' | 'm' | 's' | 'xs';
|
|
227
231
|
}
|
|
@@ -257,11 +261,11 @@ export interface ExternalLink {
|
|
|
257
261
|
sameWindow?: boolean;
|
|
258
262
|
}
|
|
259
263
|
export interface NavigationOptions {
|
|
260
|
-
fromContext?:
|
|
264
|
+
fromContext?: string | null;
|
|
261
265
|
fromClosestContext?: boolean;
|
|
262
266
|
fromVirtualTreeRoot?: boolean;
|
|
263
267
|
fromParent?: boolean;
|
|
264
|
-
relative?:
|
|
268
|
+
relative?: boolean;
|
|
265
269
|
nodeParams?: Record<string, any>;
|
|
266
270
|
}
|
|
267
271
|
export interface NavigationRequestBase {
|
|
@@ -292,216 +296,13 @@ export interface NavigationRequestDetail {
|
|
|
292
296
|
preventContextUpdate: boolean;
|
|
293
297
|
preventHistoryEntry: boolean;
|
|
294
298
|
fromVirtualTreeRoot: boolean;
|
|
295
|
-
fromContext:
|
|
299
|
+
fromContext: string | null;
|
|
296
300
|
fromClosestContext: boolean;
|
|
297
301
|
fromParent: boolean;
|
|
298
302
|
relative: boolean;
|
|
299
303
|
nodeParams: Record<string, string>;
|
|
300
304
|
}
|
|
301
|
-
|
|
302
|
-
* Configuration for compound web components in Luigi.
|
|
303
|
-
* Compound allows you to layout multiple web components in one micro frontend.
|
|
304
|
-
*/
|
|
305
|
-
export interface CompoundConfig {
|
|
306
|
-
/**
|
|
307
|
-
* Renderer configuration for the compound layout
|
|
308
|
-
*/
|
|
309
|
-
renderer?: {
|
|
310
|
-
/**
|
|
311
|
-
* The renderer to use - can be 'grid', a custom renderer object, or undefined for default
|
|
312
|
-
*/
|
|
313
|
-
use?: 'grid' | string | {
|
|
314
|
-
/**
|
|
315
|
-
* Base renderer to extend (e.g., 'grid')
|
|
316
|
-
*/
|
|
317
|
-
extends?: string;
|
|
318
|
-
/**
|
|
319
|
-
* Custom function to create the compound container
|
|
320
|
-
* @param config - The renderer configuration
|
|
321
|
-
* @param renderer - The parent/super renderer (if extending)
|
|
322
|
-
*/
|
|
323
|
-
createCompoundContainer?: (config: RendererConfig, renderer?: any) => HTMLDivElement;
|
|
324
|
-
/**
|
|
325
|
-
* Custom function to create individual compound item containers
|
|
326
|
-
* @param layoutConfig - Layout configuration for the item
|
|
327
|
-
* @param config - The overall renderer configuration
|
|
328
|
-
* @param renderer - The parent/super renderer (if extending)
|
|
329
|
-
*/
|
|
330
|
-
createCompoundItemContainer?: (layoutConfig?: LayoutConfig, config?: RendererConfig, renderer?: any) => HTMLDivElement;
|
|
331
|
-
/**
|
|
332
|
-
* Custom function to attach an item to the compound container
|
|
333
|
-
* @param compoundCnt - The compound container element
|
|
334
|
-
* @param compoundItemCnt - The item container to attach
|
|
335
|
-
* @param renderer - The parent/super renderer (if extending)
|
|
336
|
-
*/
|
|
337
|
-
attachCompoundItem?: (compoundCnt: HTMLElement, compoundItemCnt: HTMLElement, renderer?: any) => void;
|
|
338
|
-
};
|
|
339
|
-
/**
|
|
340
|
-
* Configuration for the grid layout
|
|
341
|
-
*/
|
|
342
|
-
config?: {
|
|
343
|
-
/**
|
|
344
|
-
* CSS grid-template-columns value (e.g., '1fr 2fr')
|
|
345
|
-
*/
|
|
346
|
-
columns?: string;
|
|
347
|
-
/**
|
|
348
|
-
* CSS grid-template-rows value (e.g., '150px 150px')
|
|
349
|
-
*/
|
|
350
|
-
rows?: string;
|
|
351
|
-
/**
|
|
352
|
-
* CSS grid-gap value (e.g., 'auto', '10px')
|
|
353
|
-
*/
|
|
354
|
-
gap?: string;
|
|
355
|
-
/**
|
|
356
|
-
* Minimum height for the grid container
|
|
357
|
-
*/
|
|
358
|
-
minHeight?: string;
|
|
359
|
-
/**
|
|
360
|
-
* Responsive layout configurations for different viewport sizes
|
|
361
|
-
*/
|
|
362
|
-
layouts?: Array<{
|
|
363
|
-
/**
|
|
364
|
-
* CSS grid-template-columns for this breakpoint
|
|
365
|
-
*/
|
|
366
|
-
columns?: string | number;
|
|
367
|
-
/**
|
|
368
|
-
* CSS grid-template-rows for this breakpoint
|
|
369
|
-
*/
|
|
370
|
-
rows?: string | number;
|
|
371
|
-
/**
|
|
372
|
-
* CSS grid-gap for this breakpoint
|
|
373
|
-
*/
|
|
374
|
-
gap?: string | number;
|
|
375
|
-
/**
|
|
376
|
-
* Minimum viewport width for this layout (in pixels)
|
|
377
|
-
*/
|
|
378
|
-
minWidth?: number;
|
|
379
|
-
/**
|
|
380
|
-
* Maximum viewport width for this layout (in pixels)
|
|
381
|
-
*/
|
|
382
|
-
maxWidth?: number;
|
|
383
|
-
}>;
|
|
384
|
-
};
|
|
385
|
-
};
|
|
386
|
-
/**
|
|
387
|
-
* Lazy loading configuration for compound children
|
|
388
|
-
*/
|
|
389
|
-
lazyLoadingOptions?: {
|
|
390
|
-
/**
|
|
391
|
-
* Enable lazy loading using IntersectionObserver
|
|
392
|
-
* @default false
|
|
393
|
-
*/
|
|
394
|
-
enabled?: boolean;
|
|
395
|
-
/**
|
|
396
|
-
* IntersectionObserver rootMargin option
|
|
397
|
-
* Controls when children are loaded relative to viewport visibility
|
|
398
|
-
* @default "0px"
|
|
399
|
-
*/
|
|
400
|
-
intersectionRootMargin?: string;
|
|
401
|
-
/**
|
|
402
|
-
* Default temporary height for child containers before they load
|
|
403
|
-
* @default "500px"
|
|
404
|
-
*/
|
|
405
|
-
temporaryContainerHeight?: string;
|
|
406
|
-
/**
|
|
407
|
-
* Disable automatic temporary container heights
|
|
408
|
-
* Useful for custom renderers that manage heights themselves
|
|
409
|
-
* @default false
|
|
410
|
-
*/
|
|
411
|
-
noTemporaryContainerHeight?: boolean;
|
|
412
|
-
};
|
|
413
|
-
/**
|
|
414
|
-
* Array of child web component configurations
|
|
415
|
-
*/
|
|
416
|
-
children?: Array<{
|
|
417
|
-
/**
|
|
418
|
-
* Unique identifier for this child web component
|
|
419
|
-
*/
|
|
420
|
-
id: string;
|
|
421
|
-
/**
|
|
422
|
-
* URL pointing to the web component JavaScript file
|
|
423
|
-
* Supports {i18n.currentLocale} placeholder for localization
|
|
424
|
-
*/
|
|
425
|
-
viewUrl: string;
|
|
426
|
-
/**
|
|
427
|
-
* Context object passed to the web component
|
|
428
|
-
*/
|
|
429
|
-
context?: Record<string, any>;
|
|
430
|
-
/**
|
|
431
|
-
* Layout configuration for positioning this child
|
|
432
|
-
*/
|
|
433
|
-
layoutConfig?: {
|
|
434
|
-
/**
|
|
435
|
-
* CSS grid-row value (e.g., '1 / 3', 'auto')
|
|
436
|
-
* @default "auto"
|
|
437
|
-
*/
|
|
438
|
-
row?: string;
|
|
439
|
-
/**
|
|
440
|
-
* CSS grid-column value (e.g., '1 / -1', 'auto')
|
|
441
|
-
* @default "auto"
|
|
442
|
-
*/
|
|
443
|
-
column?: string;
|
|
444
|
-
/**
|
|
445
|
-
* Slot name for nested web components
|
|
446
|
-
* Use this instead of row/column to plug into a parent's slot
|
|
447
|
-
*/
|
|
448
|
-
slot?: string;
|
|
449
|
-
/**
|
|
450
|
-
* Override the default temporary container height for this specific child
|
|
451
|
-
* Only used when lazy loading is enabled
|
|
452
|
-
* * @default undefined
|
|
453
|
-
*/
|
|
454
|
-
temporaryContainerHeight?: string;
|
|
455
|
-
};
|
|
456
|
-
/**
|
|
457
|
-
* Event listeners for cross-component communication via event bus
|
|
458
|
-
*/
|
|
459
|
-
eventListeners?: Array<{
|
|
460
|
-
/**
|
|
461
|
-
* ID of the source web component (use '*' for any source)
|
|
462
|
-
*/
|
|
463
|
-
source: string;
|
|
464
|
-
/**
|
|
465
|
-
* Name of the event to listen for
|
|
466
|
-
*/
|
|
467
|
-
name: string;
|
|
468
|
-
/**
|
|
469
|
-
* Type of action to perform (e.g., 'update')
|
|
470
|
-
*/
|
|
471
|
-
action: string;
|
|
472
|
-
/**
|
|
473
|
-
* Optional function to convert event data before passing to listener
|
|
474
|
-
* @param data - The event data
|
|
475
|
-
*/
|
|
476
|
-
dataConverter?: (data: any) => any;
|
|
477
|
-
}>;
|
|
478
|
-
}>;
|
|
479
|
-
}
|
|
480
|
-
/**
|
|
481
|
-
* Supporting type for layout configuration
|
|
482
|
-
*/
|
|
483
|
-
export interface LayoutConfig {
|
|
484
|
-
column?: string;
|
|
485
|
-
row?: string;
|
|
486
|
-
slot?: string;
|
|
487
|
-
temporaryContainerHeight?: string;
|
|
488
|
-
}
|
|
489
|
-
/**
|
|
490
|
-
* Supporting type for renderer configuration
|
|
491
|
-
*/
|
|
492
|
-
export interface RendererConfig {
|
|
493
|
-
columns?: string;
|
|
494
|
-
rows?: string;
|
|
495
|
-
gap?: string;
|
|
496
|
-
minHeight?: string;
|
|
497
|
-
layouts?: Array<{
|
|
498
|
-
columns?: string;
|
|
499
|
-
rows?: string;
|
|
500
|
-
gap?: string | number;
|
|
501
|
-
minWidth?: number;
|
|
502
|
-
maxWidth?: number;
|
|
503
|
-
}>;
|
|
504
|
-
}
|
|
305
|
+
export type { CompoundConfig, LayoutConfig, RendererConfig } from './compound-config';
|
|
505
306
|
export interface TitleResolverCache {
|
|
506
307
|
key: string;
|
|
507
308
|
value: {
|