oip-common 0.6.4 → 0.7.0
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/README.md +189 -68
- package/assets/demo/code.scss +17 -17
- package/assets/demo/demo.scss +2 -2
- package/assets/demo/flags/flags.scss +984 -984
- package/assets/i18n/extensions.en.json +1 -1
- package/assets/layout/_core.scss +30 -30
- package/assets/layout/_footer.scss +8 -8
- package/assets/layout/_main.scss +12 -12
- package/assets/layout/_menu.scss +148 -148
- package/assets/layout/_mixins.scss +15 -15
- package/assets/layout/_preloading.scss +49 -49
- package/assets/layout/_responsive.scss +108 -108
- package/assets/layout/_topbar.scss +168 -168
- package/assets/layout/_typography.scss +68 -68
- package/assets/layout/_utils.scss +25 -25
- package/assets/layout/layout.scss +13 -13
- package/assets/layout/variables/_common.scss +20 -20
- package/assets/layout/variables/_dark.scss +5 -5
- package/assets/layout/variables/_light.scss +5 -5
- package/assets/oip-common.scss +6 -6
- package/assets/tailwind.css +3 -3
- package/fesm2022/oip-common.mjs +1033 -241
- package/fesm2022/oip-common.mjs.map +1 -1
- package/index.d.ts +319 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { OnDestroy, OnInit, DestroyRef, WritableSignal, OnChanges, SimpleChanges
|
|
|
3
3
|
import * as rxjs from 'rxjs';
|
|
4
4
|
import { Observable, BehaviorSubject, Subscription, Subject } from 'rxjs';
|
|
5
5
|
import { MessageService, ToastMessageOptions, ConfirmationService, MenuItem, FilterMetadata } from 'primeng/api';
|
|
6
|
-
import { Router, ActivatedRoute, QueryParamsHandling, IsActiveMatchOptions, Params, CanActivateChildFn } from '@angular/router';
|
|
6
|
+
import { Router, ActivatedRoute, QueryParamsHandling, IsActiveMatchOptions, Params, CanActivateChildFn, UrlTree, CanActivateFn, Routes, Route } from '@angular/router';
|
|
7
7
|
import { TranslationObject, InterpolationParameters, Translation, TranslateService } from '@ngx-translate/core';
|
|
8
8
|
import { ContextMenu } from 'primeng/contextmenu';
|
|
9
9
|
import { PaletteDesignToken, Preset } from '@primeuix/themes/types';
|
|
@@ -349,6 +349,45 @@ interface PutSecurityDto {
|
|
|
349
349
|
securities: SecurityDto[];
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
+
/**
|
|
353
|
+
* Tracks whether the application is switching between modules.
|
|
354
|
+
*
|
|
355
|
+
* Two sources feed the state:
|
|
356
|
+
* - router navigation, from `NavigationStart` until the navigation ends, is cancelled or fails;
|
|
357
|
+
* - explicit work registered with {@link begin}/{@link end} or {@link track}, which covers everything
|
|
358
|
+
* running after `NavigationEnd`: module instance rights, settings and extension loading.
|
|
359
|
+
*
|
|
360
|
+
* The UI blocker rendered by the layout observes {@link loading}.
|
|
361
|
+
*/
|
|
362
|
+
declare class ModuleLoadingService {
|
|
363
|
+
/** Releases a stuck blocker when a caller never balances its `begin()`. */
|
|
364
|
+
private static readonly watchdogTimeoutMs;
|
|
365
|
+
private readonly router;
|
|
366
|
+
private readonly navigating;
|
|
367
|
+
private readonly pending;
|
|
368
|
+
private watchdogHandle?;
|
|
369
|
+
/** True while a module transition is in progress. */
|
|
370
|
+
readonly loading: i0.Signal<boolean>;
|
|
371
|
+
constructor();
|
|
372
|
+
/**
|
|
373
|
+
* Registers one unit of loading work. Every call must be balanced with {@link end},
|
|
374
|
+
* preferably from a `finally` block. Prefer {@link track} when the work is a promise.
|
|
375
|
+
*/
|
|
376
|
+
begin(): void;
|
|
377
|
+
/** Releases one unit of loading work registered with {@link begin}. */
|
|
378
|
+
end(): void;
|
|
379
|
+
/**
|
|
380
|
+
* Blocks the UI until `work` settles, and keeps the blocker released when it rejects.
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* await this.moduleLoading.track(this.reloadModuleInstance());
|
|
384
|
+
*/
|
|
385
|
+
track<T>(work: PromiseLike<T>): Promise<T>;
|
|
386
|
+
private armWatchdog;
|
|
387
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ModuleLoadingService, never>;
|
|
388
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ModuleLoadingService>;
|
|
389
|
+
}
|
|
390
|
+
|
|
352
391
|
declare abstract class BaseModuleComponent<TBackendStoreSettings, TLocalStoreSettings> implements OnInit, OnDestroy {
|
|
353
392
|
private static readonly readRight;
|
|
354
393
|
private static readonly editRight;
|
|
@@ -360,6 +399,7 @@ declare abstract class BaseModuleComponent<TBackendStoreSettings, TLocalStoreSet
|
|
|
360
399
|
protected securitySettings: SecurityDto[];
|
|
361
400
|
protected readonly destroyRef: DestroyRef;
|
|
362
401
|
protected readonly securityService: SecurityService;
|
|
402
|
+
protected readonly moduleLoadingService: ModuleLoadingService;
|
|
363
403
|
protected readonly httpClient: HttpClient<any>;
|
|
364
404
|
/**
|
|
365
405
|
* Provide access to app settings
|
|
@@ -732,6 +772,10 @@ interface ModuleInstanceDto {
|
|
|
732
772
|
parentId?: number | null;
|
|
733
773
|
order?: number;
|
|
734
774
|
separator?: boolean;
|
|
775
|
+
isStart?: boolean;
|
|
776
|
+
}
|
|
777
|
+
interface SetStartModuleParams {
|
|
778
|
+
id: number;
|
|
735
779
|
}
|
|
736
780
|
interface GetModuleInstanceRightsParams {
|
|
737
781
|
id?: number;
|
|
@@ -745,6 +789,8 @@ interface ChangeOrderParams {
|
|
|
745
789
|
}
|
|
746
790
|
|
|
747
791
|
interface ContextMenuItemDto {
|
|
792
|
+
moduleInstanceId: number;
|
|
793
|
+
isStart?: boolean;
|
|
748
794
|
url: any;
|
|
749
795
|
class: string | string[] | Set<string> | {
|
|
750
796
|
[p: string]: any;
|
|
@@ -828,6 +874,8 @@ declare class MenuService {
|
|
|
828
874
|
|
|
829
875
|
declare class MenuApi<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
830
876
|
get: (params?: RequestParams) => Promise<ModuleInstanceDto[]>;
|
|
877
|
+
setStartModule: ({ id, ...query }: SetStartModuleParams, params?: RequestParams) => Promise<void>;
|
|
878
|
+
deleteStartModule: (params?: RequestParams) => Promise<void>;
|
|
831
879
|
getModuleInstanceRights: (query: GetModuleInstanceRightsParams, params?: RequestParams) => Promise<string[]>;
|
|
832
880
|
getAdminMenu: (params?: RequestParams) => Promise<ModuleInstanceDto[]>;
|
|
833
881
|
getModules: (params?: RequestParams) => Promise<IntKeyValueDto[]>;
|
|
@@ -876,6 +924,7 @@ declare class MenuItemEditDialogComponent {
|
|
|
876
924
|
visible: boolean;
|
|
877
925
|
visibleChange: EventEmitter<boolean>;
|
|
878
926
|
roles: string[];
|
|
927
|
+
moduleName: string;
|
|
879
928
|
iconOptions: PrimeIconOption[];
|
|
880
929
|
item: EditModuleInstanceDto;
|
|
881
930
|
saving: boolean;
|
|
@@ -1176,6 +1225,12 @@ declare class AppConfiguratorComponent implements OnInit {
|
|
|
1176
1225
|
private readonly themePresets;
|
|
1177
1226
|
private readonly themePresetsMap;
|
|
1178
1227
|
private readonly defaultThemePreset;
|
|
1228
|
+
/**
|
|
1229
|
+
* Presets resolved so far, keyed by theme id. Seeded with the eagerly provided ones and filled in
|
|
1230
|
+
* as loaders resolve; it is a signal so the color swatches recompute once a preset arrives.
|
|
1231
|
+
*/
|
|
1232
|
+
private readonly resolvedPresets;
|
|
1233
|
+
private readonly pendingPresets;
|
|
1179
1234
|
private readonly fallbackPrimaryColors;
|
|
1180
1235
|
presets: {
|
|
1181
1236
|
label: string;
|
|
@@ -1231,12 +1286,21 @@ declare class AppConfiguratorComponent implements OnInit {
|
|
|
1231
1286
|
};
|
|
1232
1287
|
private getThemePresets;
|
|
1233
1288
|
private getThemeById;
|
|
1289
|
+
/**
|
|
1290
|
+
* The preset of a theme, or `undefined` while its loader is still in flight.
|
|
1291
|
+
*/
|
|
1292
|
+
private getResolvedPreset;
|
|
1293
|
+
/**
|
|
1294
|
+
* Resolves a theme preset, running its loader at most once and caching the result.
|
|
1295
|
+
* A failed load falls back to the default preset so the configurator stays usable.
|
|
1296
|
+
*/
|
|
1297
|
+
private loadPreset;
|
|
1234
1298
|
private getPrimaryColorOptions;
|
|
1235
1299
|
private getSurfaceColorOptions;
|
|
1236
1300
|
private ensureValidThemeId;
|
|
1237
1301
|
updateColors(event: MouseEvent, type: string, color: SurfacesType): void;
|
|
1238
1302
|
applyTheme(type: string, color: SurfacesType): void;
|
|
1239
|
-
onPresetChange(event: string): void
|
|
1303
|
+
onPresetChange(event: string): Promise<void>;
|
|
1240
1304
|
onMenuModeChange(event: string): void;
|
|
1241
1305
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppConfiguratorComponent, never>;
|
|
1242
1306
|
static ɵcmp: i0.ɵɵComponentDeclaration<AppConfiguratorComponent, "app-configurator", never, {}, {}, never, never, true, never>;
|
|
@@ -1423,7 +1487,9 @@ declare class ExtensionModuleHostComponent extends BaseModuleComponent<unknown,
|
|
|
1423
1487
|
protected onSecurityRightsChange(): void;
|
|
1424
1488
|
ngOnDestroy(): void;
|
|
1425
1489
|
private loadExtensionMetadata;
|
|
1490
|
+
/** Blocks the UI while the extension is (re)mounted, including the queued render after the view init. */
|
|
1426
1491
|
private renderExtension;
|
|
1492
|
+
private renderExtensionInternal;
|
|
1427
1493
|
private queueRenderExtension;
|
|
1428
1494
|
private destroyExtensionComponent;
|
|
1429
1495
|
private renderFederatedExtension;
|
|
@@ -1521,6 +1587,51 @@ declare class AppTopbarApplicationSwitcherComponent implements OnInit {
|
|
|
1521
1587
|
static ɵcmp: i0.ɵɵComponentDeclaration<AppTopbarApplicationSwitcherComponent, "app-topbar-application-switcher", never, {}, {}, never, never, true, never>;
|
|
1522
1588
|
}
|
|
1523
1589
|
|
|
1590
|
+
/**
|
|
1591
|
+
* Full screen blocker shown while the application switches between modules.
|
|
1592
|
+
*
|
|
1593
|
+
* Render it as a sibling of `.layout-wrapper`, not inside it: while the blocker is visible the
|
|
1594
|
+
* wrapper is marked `inert`, which would also disable an overlay nested in it.
|
|
1595
|
+
*
|
|
1596
|
+
* The blocker appears only when a transition outlasts {@link showDelayMs} and then stays for at
|
|
1597
|
+
* least {@link minVisibleMs}, so quick navigation does not flash a spinner.
|
|
1598
|
+
*/
|
|
1599
|
+
declare class BlockLoaderComponent implements OnDestroy {
|
|
1600
|
+
private static readonly showDelayMs;
|
|
1601
|
+
private static readonly minVisibleMs;
|
|
1602
|
+
private readonly translations;
|
|
1603
|
+
private readonly moduleLoadingService;
|
|
1604
|
+
private showHandle?;
|
|
1605
|
+
private hideHandle?;
|
|
1606
|
+
private shownAt;
|
|
1607
|
+
protected readonly visible: i0.WritableSignal<boolean>;
|
|
1608
|
+
constructor();
|
|
1609
|
+
ngOnDestroy(): void;
|
|
1610
|
+
private scheduleShow;
|
|
1611
|
+
private scheduleHide;
|
|
1612
|
+
private clearTimer;
|
|
1613
|
+
private clearTimers;
|
|
1614
|
+
/**
|
|
1615
|
+
* Takes the application out of the interaction and accessibility trees while the blocker is up,
|
|
1616
|
+
* so pointer, keyboard and screen reader input cannot reach a module that is still loading.
|
|
1617
|
+
*/
|
|
1618
|
+
private blockInteraction;
|
|
1619
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BlockLoaderComponent, never>;
|
|
1620
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BlockLoaderComponent, "block-loader", never, {}, {}, never, never, true, never>;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
/**
|
|
1624
|
+
* Landing page shown when the user has no module instance to open.
|
|
1625
|
+
*
|
|
1626
|
+
* Rendered inside the shell on purpose: the menu and the top bar stay available, so an
|
|
1627
|
+
* administrator can keep working while a regular user sees why the page is empty.
|
|
1628
|
+
*/
|
|
1629
|
+
declare class NoModulesComponent {
|
|
1630
|
+
private readonly translations;
|
|
1631
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NoModulesComponent, never>;
|
|
1632
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NoModulesComponent, "app-no-modules", never, {}, {}, never, never, true, never>;
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1524
1635
|
/**
|
|
1525
1636
|
* A route guard that ensures the user is authenticated and has a valid access token.
|
|
1526
1637
|
* If the access token is expired, it attempts to refresh the session.
|
|
@@ -1629,6 +1740,51 @@ declare class TableFilterService {
|
|
|
1629
1740
|
static ɵprov: i0.ɵɵInjectableDeclaration<TableFilterService>;
|
|
1630
1741
|
}
|
|
1631
1742
|
|
|
1743
|
+
/**
|
|
1744
|
+
* Resolves the module instance the current user lands on when no explicit route is requested.
|
|
1745
|
+
*
|
|
1746
|
+
* The menu returned by the backend is already filtered by the rights of the current user, so the
|
|
1747
|
+
* first navigable leaf of that menu is always a module the user may open. When the user picked a
|
|
1748
|
+
* start module explicitly it comes back marked with `isStart`, and a module that was deleted or
|
|
1749
|
+
* whose rights were revoked simply disappears from the menu, which falls back to the first leaf.
|
|
1750
|
+
*
|
|
1751
|
+
* The resolved url is cached per user and dropped whenever the authenticated user changes or the
|
|
1752
|
+
* start module is reassigned.
|
|
1753
|
+
*/
|
|
1754
|
+
declare class StartPageService {
|
|
1755
|
+
private readonly menuApi;
|
|
1756
|
+
private readonly router;
|
|
1757
|
+
private readonly securityService;
|
|
1758
|
+
private request;
|
|
1759
|
+
private cachedIdentity;
|
|
1760
|
+
constructor();
|
|
1761
|
+
/**
|
|
1762
|
+
* Gets the url of the start module instance.
|
|
1763
|
+
*
|
|
1764
|
+
* @returns The url tree to navigate to, or `null` when the user has no module available.
|
|
1765
|
+
*/
|
|
1766
|
+
resolveStartUrl(): Promise<UrlTree | null>;
|
|
1767
|
+
/**
|
|
1768
|
+
* Makes the module instance the start page of the current user.
|
|
1769
|
+
*
|
|
1770
|
+
* @param moduleInstanceId Module instance to open by default.
|
|
1771
|
+
*/
|
|
1772
|
+
setStartModule(moduleInstanceId: number): Promise<void>;
|
|
1773
|
+
/**
|
|
1774
|
+
* Clears the start page of the current user, falling back to the first available module.
|
|
1775
|
+
*/
|
|
1776
|
+
clearStartModule(): Promise<void>;
|
|
1777
|
+
/**
|
|
1778
|
+
* Drops the cached url, for example after the menu was changed.
|
|
1779
|
+
*/
|
|
1780
|
+
clearCache(): void;
|
|
1781
|
+
private loadStartUrl;
|
|
1782
|
+
private findStartItem;
|
|
1783
|
+
private collectNavigableLeaves;
|
|
1784
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StartPageService, never>;
|
|
1785
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<StartPageService>;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1632
1788
|
declare class ExtensionLoaderService {
|
|
1633
1789
|
private readonly loadedScripts;
|
|
1634
1790
|
loadScript(scriptUrl: string): Promise<void>;
|
|
@@ -1636,10 +1792,22 @@ declare class ExtensionLoaderService {
|
|
|
1636
1792
|
static ɵprov: i0.ɵɵInjectableDeclaration<ExtensionLoaderService>;
|
|
1637
1793
|
}
|
|
1638
1794
|
|
|
1795
|
+
/**
|
|
1796
|
+
* Defers loading of a theme preset until the theme is actually selected.
|
|
1797
|
+
*
|
|
1798
|
+
* Presets are large, so a preset that is not the application default should be provided as a loader
|
|
1799
|
+
* built on a dynamic import, which keeps it out of the initial bundle:
|
|
1800
|
+
*
|
|
1801
|
+
* ```ts
|
|
1802
|
+
* { id: 'Lara', preset: () => import('@primeng/themes/lara').then((m) => m.default as Preset) }
|
|
1803
|
+
* ```
|
|
1804
|
+
*/
|
|
1805
|
+
type AppThemePresetLoader = () => Promise<Preset>;
|
|
1639
1806
|
interface AppThemePreset {
|
|
1640
1807
|
id: string;
|
|
1641
1808
|
label?: string;
|
|
1642
|
-
preset
|
|
1809
|
+
/** The preset itself, or a {@link AppThemePresetLoader} resolving it on first use. */
|
|
1810
|
+
preset: Preset | AppThemePresetLoader;
|
|
1643
1811
|
primaryColors?: Record<string, PaletteDesignToken | undefined>;
|
|
1644
1812
|
surfaceColors?: Record<string, PaletteDesignToken | undefined>;
|
|
1645
1813
|
}
|
|
@@ -1822,7 +1990,9 @@ declare class CustomElementExtensionModuleHostComponent extends BaseModuleCompon
|
|
|
1822
1990
|
ngOnDestroy(): void;
|
|
1823
1991
|
reloadExtension(): Promise<void>;
|
|
1824
1992
|
private loadExtensionMetadata;
|
|
1993
|
+
/** Blocks the UI while the extension is (re)mounted, including the queued render after the view init. */
|
|
1825
1994
|
private renderExtension;
|
|
1995
|
+
private renderExtensionInternal;
|
|
1826
1996
|
private queueRenderExtension;
|
|
1827
1997
|
private isActiveTab;
|
|
1828
1998
|
private queueActiveTabSync;
|
|
@@ -1839,5 +2009,149 @@ declare class CustomElementExtensionModuleHostComponent extends BaseModuleCompon
|
|
|
1839
2009
|
static ɵcmp: i0.ɵɵComponentDeclaration<CustomElementExtensionModuleHostComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
1840
2010
|
}
|
|
1841
2011
|
|
|
1842
|
-
|
|
1843
|
-
|
|
2012
|
+
/**
|
|
2013
|
+
* Guard that requires an authenticated session and preserves the requested url as the return url.
|
|
2014
|
+
*
|
|
2015
|
+
* Use it on every application route rendered inside the oip shell instead of repeating the
|
|
2016
|
+
* `inject(AuthGuardService)` lambda.
|
|
2017
|
+
*/
|
|
2018
|
+
declare const oipAuthGuard: CanActivateFn;
|
|
2019
|
+
/**
|
|
2020
|
+
* Route data read by {@link oipStartRedirectGuard}.
|
|
2021
|
+
*/
|
|
2022
|
+
interface StartRouteData {
|
|
2023
|
+
/** Explicit start route of the host application, taking precedence over the user's own choice. */
|
|
2024
|
+
startRoute?: string;
|
|
2025
|
+
/** Where to go when the user has no module available. */
|
|
2026
|
+
noModulesPath?: string;
|
|
2027
|
+
}
|
|
2028
|
+
/**
|
|
2029
|
+
* Redirects the empty route to the module instance the user lands on by default.
|
|
2030
|
+
*
|
|
2031
|
+
* The order is: the explicit `startRoute` of the host application, then the module the user marked
|
|
2032
|
+
* as their start page, then the first module available to them, and finally the no modules page.
|
|
2033
|
+
*/
|
|
2034
|
+
declare const oipStartRedirectGuard: CanActivateFn;
|
|
2035
|
+
/**
|
|
2036
|
+
* Page shown when the user has no module instance to open.
|
|
2037
|
+
*/
|
|
2038
|
+
declare function oipNoModulesRoute(path?: string): Route;
|
|
2039
|
+
/**
|
|
2040
|
+
* Empty route redirecting to the start module of the current user.
|
|
2041
|
+
*
|
|
2042
|
+
* Registered last among the shell children so a host application can claim the empty path itself.
|
|
2043
|
+
*/
|
|
2044
|
+
declare function oipStartRoute(path?: string, data?: StartRouteData): Route;
|
|
2045
|
+
/**
|
|
2046
|
+
* Access denied page. Referenced by {@link AuthGuardService} and {@link moduleAccessGuard} redirects,
|
|
2047
|
+
* so keep it registered unless the host application provides its own `access` route.
|
|
2048
|
+
*/
|
|
2049
|
+
declare function oipAccessRoute(path?: string): Route;
|
|
2050
|
+
/** Authentication error page. */
|
|
2051
|
+
declare function oipErrorRoute(path?: string): Route;
|
|
2052
|
+
/** Current user profile. */
|
|
2053
|
+
declare function oipProfileRoute(path?: string): Route;
|
|
2054
|
+
/** Application configuration. */
|
|
2055
|
+
declare function oipConfigRoute(path?: string): Route;
|
|
2056
|
+
/** Registered applications, administrators only. */
|
|
2057
|
+
declare function oipApplicationsRoute(path?: string): Route;
|
|
2058
|
+
/** Module registry, administrators only. */
|
|
2059
|
+
declare function oipModulesRoute(path?: string): Route;
|
|
2060
|
+
/** Discussion module. The path must keep an `:id` segment. */
|
|
2061
|
+
declare function oipDiscussionRoute(path?: string): Route;
|
|
2062
|
+
/** Database migration module. The path must keep an `:id` segment. */
|
|
2063
|
+
declare function oipDbMigrationRoute(path?: string): Route;
|
|
2064
|
+
/** Iframe module host. The path must keep an `:id` segment. */
|
|
2065
|
+
declare function oipIframeModuleRoute(path?: string): Route;
|
|
2066
|
+
/** Extension module host. The path must keep the `:extensionKey` and `:id` segments. */
|
|
2067
|
+
declare function oipExtensionsRoute(path?: string): Route;
|
|
2068
|
+
/**
|
|
2069
|
+
* Switch for a built-in route.
|
|
2070
|
+
*
|
|
2071
|
+
* - `true` enables the route under its default path.
|
|
2072
|
+
* - `false` disables it.
|
|
2073
|
+
* - a string enables it under that path, which must keep the same route parameters as the default.
|
|
2074
|
+
*/
|
|
2075
|
+
type OipRouteToggle = boolean | string;
|
|
2076
|
+
/**
|
|
2077
|
+
* Built-in routes provided by oip-common. Every one of them is enabled by default; disable the ones
|
|
2078
|
+
* a host application does not expose.
|
|
2079
|
+
*/
|
|
2080
|
+
interface OipRouteFeatures {
|
|
2081
|
+
/** Access denied page. Default path: `access`. */
|
|
2082
|
+
access?: OipRouteToggle;
|
|
2083
|
+
/** Authentication error page. Default path: `error`. */
|
|
2084
|
+
error?: OipRouteToggle;
|
|
2085
|
+
/** Current user profile. Default path: `profile`. */
|
|
2086
|
+
profile?: OipRouteToggle;
|
|
2087
|
+
/** Application configuration. Default path: `config`. */
|
|
2088
|
+
config?: OipRouteToggle;
|
|
2089
|
+
/** Registered applications, administrators only. Default path: `applications`. */
|
|
2090
|
+
applications?: OipRouteToggle;
|
|
2091
|
+
/** Module registry, administrators only. Default path: `modules`. */
|
|
2092
|
+
modules?: OipRouteToggle;
|
|
2093
|
+
/** Discussion module. Default path: `discussion/:id`. */
|
|
2094
|
+
discussion?: OipRouteToggle;
|
|
2095
|
+
/** Database migration module. Default path: `db-migration/:id`. */
|
|
2096
|
+
dbMigration?: OipRouteToggle;
|
|
2097
|
+
/** Iframe module host. Default path: `iframe-module/:id`. */
|
|
2098
|
+
iframeModule?: OipRouteToggle;
|
|
2099
|
+
/** Extension module host. Default path: `extensions/:extensionKey/:id`. */
|
|
2100
|
+
extensions?: OipRouteToggle;
|
|
2101
|
+
/** Page shown when no module is available. Default path: `no-modules`. */
|
|
2102
|
+
noModules?: OipRouteToggle;
|
|
2103
|
+
/** Empty route redirecting to the start module. Default path: `` (the shell root). */
|
|
2104
|
+
start?: OipRouteToggle;
|
|
2105
|
+
}
|
|
2106
|
+
/**
|
|
2107
|
+
* Options accepted by {@link provideOipRoutes}.
|
|
2108
|
+
*/
|
|
2109
|
+
interface OipRoutesOptions {
|
|
2110
|
+
/** Application specific routes rendered inside the shell. */
|
|
2111
|
+
children?: Routes;
|
|
2112
|
+
/** Which built-in routes to register, and under which paths. All of them are on by default. */
|
|
2113
|
+
features?: OipRouteFeatures;
|
|
2114
|
+
/**
|
|
2115
|
+
* Route opened by the empty path, overriding the start module of the user. Leave it unset to land
|
|
2116
|
+
* on the module the user chose, or on the first module available to them.
|
|
2117
|
+
*/
|
|
2118
|
+
startRoute?: string;
|
|
2119
|
+
/** Shell component wrapping every child route. Default: {@link AppLayoutComponent}. */
|
|
2120
|
+
layout?: Type<unknown>;
|
|
2121
|
+
/** Routes registered outside the shell, before the not found handling. */
|
|
2122
|
+
rootRoutes?: Routes;
|
|
2123
|
+
/** Path of the not found page. Default: `notfound`. */
|
|
2124
|
+
notFoundPath?: string;
|
|
2125
|
+
/** Path of the unauthorized page. Default: `unauthorized`. */
|
|
2126
|
+
unauthorizedPath?: string;
|
|
2127
|
+
/**
|
|
2128
|
+
* Whether to append the `**` route redirecting to the not found page.
|
|
2129
|
+
* Disable it when the host application registers its own catch-all after these routes.
|
|
2130
|
+
* Default: `true`.
|
|
2131
|
+
*/
|
|
2132
|
+
wildcard?: boolean;
|
|
2133
|
+
}
|
|
2134
|
+
/**
|
|
2135
|
+
* Builds the standard oip route tree: an authenticated shell holding the application routes and the
|
|
2136
|
+
* built-in pages, followed by the unauthorized, not found and catch-all routes.
|
|
2137
|
+
*
|
|
2138
|
+
* The returned array is ordered so that the `**` route stays last; concatenating anything after it
|
|
2139
|
+
* makes those routes unreachable.
|
|
2140
|
+
*
|
|
2141
|
+
* @example
|
|
2142
|
+
* export const appRoutes = provideOipRoutes({
|
|
2143
|
+
* children: [
|
|
2144
|
+
* {
|
|
2145
|
+
* path: 'dashboard/:id',
|
|
2146
|
+
* loadComponent: () => import('./dashboard.component').then((m) => m.DashboardComponent),
|
|
2147
|
+
* canActivate: [oipAuthGuard]
|
|
2148
|
+
* }
|
|
2149
|
+
* ],
|
|
2150
|
+
* features: { dbMigration: 'legacy-migration/:id', modules: false },
|
|
2151
|
+
* startRoute: '/dashboard/1'
|
|
2152
|
+
* });
|
|
2153
|
+
*/
|
|
2154
|
+
declare function provideOipRoutes(options?: OipRoutesOptions): Routes;
|
|
2155
|
+
|
|
2156
|
+
export { APP_INFO_TOKEN, APP_THEME_PRESETS, APP_THEME_PRESETS_MERGE_MODE, AccessComponent, AppConfiguratorComponent, AppFloatingConfiguratorComponent, AppInfoService, AppLayoutComponent, AppModulesComponent, AppTopbar, AppTopbarApplicationSwitcherComponent, ApplicationRegistryService, ApplicationsApi, ApplicationsComponent, AuthGuardService, BaseModuleComponent, BffSecurityService, BlockLoaderComponent, ConfigComponent, ContentType, CustomElementExtensionModuleHostComponent, DbMigrationComponent, DiscussionComponent, ErrorComponent, ExtensionLoaderService, ExtensionModuleHostComponent, FolderModuleApi, FooterComponent, HttpClient, IframeModuleApi, IframeModuleComponent, L10nService, LOGO_COMPONENT_TOKEN, LayoutService, LogoComponent, LogoService, MenuComponent, MenuService, ModuleInstanceRightsService, ModuleLoadingService, MsgService, NoModulesComponent, NotfoundComponent, NotificationApi, NotificationService, OIP_EXTENSION_EVENTS, SecurityApi, SecurityComponent, SecurityService, SidebarComponent, StartPageService, TableFilterService, TopBarService, UnauthorizedComponent, UserNotificationsComponent, UserProfileApi, UserProfileComponent, UserService, convertToPrimeNgDateFormat, defaultTheme, emitOipContextChange, emitOipError, emitOipNavigate, emitOipNotify, emitOipSettingsChange, emitOipTitleChange, langIntercept, mergeWithDefaults, moduleAccessGuard, oipAccessRoute, oipApplicationsRoute, oipAuthGuard, oipConfigRoute, oipDbMigrationRoute, oipDiscussionRoute, oipErrorRoute, oipExtensionsRoute, oipIframeModuleRoute, oipModulesRoute, oipNoModulesRoute, oipProfileRoute, oipStartRedirectGuard, oipStartRoute, provideAppInfo, provideAppThemes, provideLogoComponent, provideOip, provideOipRoutes, provideTranslations, replaceDefaults };
|
|
2157
|
+
export type { AppConfig, AppInfo, AppInfoValue, AppThemePreset, AppThemePresetLoader, AppThemePresetMergeMode, AuthCsrfToken, LanguageDto, MenuChangeEvent, ModuleAccessRouteData, NoSettingsDto, OipExtensionHostContext, OipExtensionLoadType, OipExtensionManifest, OipExtensionModuleMetadata, OipExtensionNavigateEvent, OipExtensionNotifyEvent, OipRouteFeatures, OipRouteToggle, OipRoutesOptions, PutSecurityDto, RequestParams, SecurityDto, StartRouteData, TopBarDto };
|