@open-rlb/ng-app 3.1.122 → 3.1.123

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-rlb/ng-app",
3
- "version": "3.1.122",
3
+ "version": "3.1.123",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=21.0.0 <22.0.0",
6
6
  "@angular/core": ">=21.0.0 <22.0.0",
@@ -17,9 +17,12 @@ The shell renders the full app chrome (navbar, sidebar, modal/toast containers,
17
17
  <rlb-app-container
18
18
  modal-container-id="modal-c-1"
19
19
  toast-container-ids="toast-c-1"
20
- />`,
20
+ />
21
+ `,
21
22
  })
22
- export class AppComponent { /* dispatch config in constructor */ }
23
+ export class AppComponent {
24
+ /* dispatch config in constructor */
25
+ }
23
26
  ```
24
27
 
25
28
  `RlbAppModule` aggregates the library's standalone components/directives/pipes; import it wherever you use shell elements (`rlb-app-container`, `rlb-navbar-item`, the `*roles` directive, etc.).
@@ -34,16 +37,23 @@ this.store.dispatch(NavbarActions.setSettingsVisible({ visible: true }));
34
37
  this.store.dispatch(NavbarActions.setAppsVisible({ visible: true }));
35
38
 
36
39
  this.store.dispatch(SidebarActions.setAppsVisible({ visible: true }));
37
- this.store.dispatch(SidebarActions.setItems({
38
- items: [
39
- { title: 'Menu' }, // section header
40
- { label: 'Home', url: '/', icon: 'bi bi-house' },
41
- { label: 'Profile', url: '/profile', icon: 'bi bi-person', badgeCounter: 3 },
42
- { label: 'Links', icon: 'bi bi-link', items: [ // nested
43
- { label: 'GitHub', icon: 'bi bi-github', externalUrl: 'https://github.com' },
44
- ]},
45
- ],
46
- }));
40
+ this.store.dispatch(
41
+ SidebarActions.setItems({
42
+ items: [
43
+ { title: 'Menu' }, // section header
44
+ { label: 'Home', url: '/', icon: 'bi bi-house' },
45
+ { label: 'Profile', url: '/profile', icon: 'bi bi-person', badgeCounter: 3 },
46
+ {
47
+ label: 'Links',
48
+ icon: 'bi bi-link',
49
+ items: [
50
+ // nested
51
+ { label: 'GitHub', icon: 'bi bi-github', externalUrl: 'https://github.com' },
52
+ ],
53
+ },
54
+ ],
55
+ }),
56
+ );
47
57
 
48
58
  this.store.dispatch(AppContextActions.setSupportedLanguages({ supportedLanguages: ['en', 'it'] }));
49
59
  ```
@@ -58,12 +68,45 @@ Override navbar slots by providing `RLB_APP_NAVCOMP` (via `appDescriber.provider
58
68
  {
59
69
  provide: RLB_APP_NAVCOMP,
60
70
  useValue: {
61
- left: [{ component: MyNavItemComponent, name: 'my-item' }],
62
- right: [{ component: MyNavItemComponent, name: 'my-item' }],
71
+ left: [{ component: MyNavItemComponent, name: 'my-item' }],
72
+ right: [{ component: MyNavItemComponent, name: 'my-item' }],
73
+ mobile: [{ component: MyMobileMenuComponent, name: 'my-mobile-menu' }], // optional
63
74
  },
64
75
  }
65
76
  ```
66
77
 
78
+ Registering a component is not enough — activate it from the store:
79
+
80
+ ```typescript
81
+ this.store.dispatch(NavbarActions.setLeftItems({ items: ['my-item'] }));
82
+ this.store.dispatch(NavbarActions.setRightItems({ items: ['my-item'] }));
83
+ this.store.dispatch(NavbarActions.setMobileItems({ items: ['my-mobile-menu'] }));
84
+ ```
85
+
67
86
  Icons are Bootstrap Icons (`bi bi-*`), available because the shell registers `bootstrap-icons.css`.
68
87
 
88
+ ### The mobile surface
89
+
90
+ Below the `lg` breakpoint the navbar collapse is not reachable, so `left`/`right` components are
91
+ **not rendered**. That breakpoint has its own surface: an offcanvas "Menu" panel, filled from
92
+ `mobileItems` (resolved against the `mobile` slot, falling back to `right` when `mobile` is
93
+ omitted).
94
+
95
+ Alongside the app's own components the panel renders core content — the apps grid
96
+ (`setAppsVisible`) and the settings/account carousel (`setSettingsVisible`). Both honour the same
97
+ flags as the desktop navbar, so `setSettingsVisible({ visible: false })` removes the core account,
98
+ status and cookies tiles on mobile too. When nothing at all would render, the toggler is hidden
99
+ rather than opening an empty panel — an app that suppresses the core content should register
100
+ `mobileItems`, otherwise mobile users get no menu button.
101
+
102
+ To serve both surfaces from one component, register the same name in `right` and `mobile` and
103
+ branch on the surface the shell provides:
104
+
105
+ ```typescript
106
+ private readonly surface = inject(RLB_NAV_SURFACE, { optional: true }); // 'navbar' | 'mobile-menu' | null
107
+ ```
108
+
109
+ Keep it `{ optional: true }` — the token is absent anywhere the component is used outside the
110
+ shell outlets.
111
+
69
112
  Related: [[rlb-app-config]], [[rlb-app-apps]], [[rlb-app-store]], [[rlb-app-auth-acl]].
@@ -192,6 +192,12 @@ interface Navbar {
192
192
  searchText: string | null;
193
193
  leftItems: string[];
194
194
  rightItems: string[];
195
+ /**
196
+ * Named components rendered in the mobile menu (offcanvas below `lg`), resolved against
197
+ * `NavbarComponents.mobile ?? NavbarComponents.right`. Empty means the mobile menu shows
198
+ * only core content.
199
+ */
200
+ mobileItems: string[];
195
201
  loginVisible: boolean;
196
202
  settingsVisible: boolean;
197
203
  appsVisible: boolean;
@@ -381,6 +387,11 @@ declare const NavbarActions: {
381
387
  }) => {
382
388
  items: string[];
383
389
  } & _ngrx_store.Action<"[Navbar/API] SetRightItems">>;
390
+ setMobileItems: _ngrx_store.ActionCreator<"[Navbar/API] SetMobileItems", (props: {
391
+ items: string[];
392
+ }) => {
393
+ items: string[];
394
+ } & _ngrx_store.Action<"[Navbar/API] SetMobileItems">>;
384
395
  setLoginVisible: _ngrx_store.ActionCreator<"[Navbar/API] SetLoginVisible", (props: {
385
396
  visible: boolean;
386
397
  }) => {
@@ -706,6 +717,14 @@ declare const RLB_CFG_AUTH: InjectionToken<AuthConfiguration>;
706
717
  declare const RLB_APP_NAVCOMP: InjectionToken<NavbarComponents>;
707
718
  declare const RLB_APP_SIDEBARCOMP: InjectionToken<SidebarComponents>;
708
719
  declare const RLB_CFG_ACL: InjectionToken<AclConfiguration>;
720
+ /**
721
+ * Which chrome surface a custom navbar component is currently rendered in.
722
+ * Provided by the shell around each component outlet. Inject it with
723
+ * `{ optional: true }` — components registered before this token existed
724
+ * simply don't see it.
725
+ */
726
+ type NavSurface = 'navbar' | 'mobile-menu';
727
+ declare const RLB_NAV_SURFACE: InjectionToken<NavSurface>;
709
728
  type AuthUrlHandler = (url: string) => void | Promise<void>;
710
729
  declare const RLB_AUTH_URL_HANDLER: InjectionToken<AuthUrlHandler>;
711
730
  interface InterceptorMapping {
@@ -726,15 +745,20 @@ interface ProviderConfiguration extends OpenIdConfiguration {
726
745
  roleClaim?: (data: any) => string | string[];
727
746
  acl?: ProviderAclConfiguration;
728
747
  }
748
+ interface NavbarComponent {
749
+ component: Type<any>;
750
+ name: string;
751
+ }
729
752
  interface NavbarComponents {
730
- left: {
731
- component: Type<any>;
732
- name: string;
733
- }[];
734
- right: {
735
- component: Type<any>;
736
- name: string;
737
- }[];
753
+ left: NavbarComponent[];
754
+ right: NavbarComponent[];
755
+ /**
756
+ * Components available to the mobile menu (offcanvas below the `lg` breakpoint),
757
+ * activated with `NavbarActions.setMobileItems`. Falls back to `right` when omitted,
758
+ * so an app can register one component for both surfaces and branch on
759
+ * {@link RLB_NAV_SURFACE}.
760
+ */
761
+ mobile?: NavbarComponent[];
738
762
  }
739
763
  interface SidebarComponents {
740
764
  footer: {
@@ -1109,6 +1133,13 @@ declare class LeftComponentPipe implements PipeTransform {
1109
1133
  static ɵpipe: i0.ɵɵPipeDeclaration<LeftComponentPipe, "leftComponent", true>;
1110
1134
  }
1111
1135
 
1136
+ declare class MobileComponentPipe implements PipeTransform {
1137
+ private config;
1138
+ transform(value: string): Type<any>;
1139
+ static ɵfac: i0.ɵɵFactoryDeclaration<MobileComponentPipe, never>;
1140
+ static ɵpipe: i0.ɵɵPipeDeclaration<MobileComponentPipe, "mobileComponent", true>;
1141
+ }
1142
+
1112
1143
  declare class RightComponentPipe implements PipeTransform {
1113
1144
  private config;
1114
1145
  transform(value: string): Type<any>;
@@ -1204,6 +1235,9 @@ declare class AppTemplateComponent {
1204
1235
  readonly appsService: AppsService;
1205
1236
  private readonly authService;
1206
1237
  private readonly router;
1238
+ private readonly injector;
1239
+ readonly navbarSurfaceInjector: i0.DestroyableInjector;
1240
+ readonly mobileSurfaceInjector: i0.DestroyableInjector;
1207
1241
  readonly sidebarVisible: i0.Signal<boolean>;
1208
1242
  readonly sidearHasLogin: i0.Signal<boolean>;
1209
1243
  readonly sidearHasSearch: i0.Signal<boolean>;
@@ -1216,6 +1250,7 @@ declare class AppTemplateComponent {
1216
1250
  readonly navHeader: i0.Signal<_open_rlb_ng_app.NavbarHeader | null>;
1217
1251
  readonly navLeftItems: i0.Signal<string[]>;
1218
1252
  readonly navRightItems: i0.Signal<string[]>;
1253
+ readonly navMobileItems: i0.Signal<string[]>;
1219
1254
  readonly navbarHasLogin: i0.Signal<boolean>;
1220
1255
  readonly navbarHasSettings: i0.Signal<boolean>;
1221
1256
  readonly navbarHasApps: i0.Signal<any>;
@@ -1225,6 +1260,8 @@ declare class AppTemplateComponent {
1225
1260
  readonly userInfo: i0.Signal<any>;
1226
1261
  readonly theme: i0.Signal<any>;
1227
1262
  readonly apps: i0.Signal<any>;
1263
+ /** Mirrors the mobile offcanvas body: false means the panel would render empty. */
1264
+ readonly mobileMenuHasContent: i0.Signal<any>;
1228
1265
  constructor();
1229
1266
  loginNav(event: MouseEvent): void;
1230
1267
  onSideBarItemClick(item: SidebarNavigableItem): void;
@@ -1344,7 +1381,7 @@ declare class AppDropdownSelectorComponent {
1344
1381
 
1345
1382
  declare class RlbAppModule {
1346
1383
  static ɵfac: i0.ɵɵFactoryDeclaration<RlbAppModule, never>;
1347
- static ɵmod: i0.ɵɵNgModuleDeclaration<RlbAppModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i2.ReactiveFormsModule, typeof i3.TranslateModule, typeof _open_rlb_ng_bootstrap.RlbBootstrapModule, typeof i5.RouterModule, typeof CmsContentComponent, typeof CookiesComponent, typeof NotFoundComponent, typeof PrivacyComponent, typeof SupportComponent, typeof TermsAndConditionsComponent, typeof ForbiddenComponent, typeof CmsPipe, typeof AsMultiPipe, typeof AsSinglePipe, typeof LeftComponentPipe, typeof RightComponentPipe, typeof TruncatePipe, typeof AutolinkPipe, typeof BaseComponent, typeof CmsComponent, typeof ContentComponent, typeof AppTemplateComponent, typeof AppContainerComponent, typeof SettingsDropdownSelectorComponent, typeof AppDropdownSelectorComponent, typeof RlbRole], [typeof CmsPipe, typeof AsMultiPipe, typeof AsSinglePipe, typeof LeftComponentPipe, typeof RightComponentPipe, typeof TruncatePipe, typeof AutolinkPipe, typeof BaseComponent, typeof CmsComponent, typeof ContentComponent, typeof AppTemplateComponent, typeof AppContainerComponent, typeof i3.TranslateModule, typeof _open_rlb_ng_bootstrap.RlbBootstrapModule, typeof i5.RouterModule, typeof i2.FormsModule, typeof RlbRole]>;
1384
+ static ɵmod: i0.ɵɵNgModuleDeclaration<RlbAppModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i2.ReactiveFormsModule, typeof i3.TranslateModule, typeof _open_rlb_ng_bootstrap.RlbBootstrapModule, typeof i5.RouterModule, typeof CmsContentComponent, typeof CookiesComponent, typeof NotFoundComponent, typeof PrivacyComponent, typeof SupportComponent, typeof TermsAndConditionsComponent, typeof ForbiddenComponent, typeof CmsPipe, typeof AsMultiPipe, typeof AsSinglePipe, typeof LeftComponentPipe, typeof MobileComponentPipe, typeof RightComponentPipe, typeof TruncatePipe, typeof AutolinkPipe, typeof BaseComponent, typeof CmsComponent, typeof ContentComponent, typeof AppTemplateComponent, typeof AppContainerComponent, typeof SettingsDropdownSelectorComponent, typeof AppDropdownSelectorComponent, typeof RlbRole], [typeof CmsPipe, typeof AsMultiPipe, typeof AsSinglePipe, typeof LeftComponentPipe, typeof MobileComponentPipe, typeof RightComponentPipe, typeof TruncatePipe, typeof AutolinkPipe, typeof BaseComponent, typeof CmsComponent, typeof ContentComponent, typeof AppTemplateComponent, typeof AppContainerComponent, typeof i3.TranslateModule, typeof _open_rlb_ng_bootstrap.RlbBootstrapModule, typeof i5.RouterModule, typeof i2.FormsModule, typeof RlbRole]>;
1348
1385
  static ɵinj: i0.ɵɵInjectorDeclaration<RlbAppModule>;
1349
1386
  }
1350
1387
 
@@ -1353,5 +1390,5 @@ declare function provideRlbConfig<T = {
1353
1390
  }>(env: ProjectConfiguration<T>): (EnvironmentProviders | Provider)[];
1354
1391
  declare function provideApp(app: AppDescriber): (EnvironmentProviders | Provider)[];
1355
1392
 
1356
- export { AbstractMdService, AbstractSupportService, AclStore, AppBreadcrumbService, AppContainerComponent, AppContextActions, AppContextActionsInternal, AppLoggerService, AppStorageService, AppTemplateComponent, AppsService, AsMultiPipe, AsSinglePipe, AuthActions, AuthActionsInternal, AuthFeatureService, AuthenticationService, AutolinkPipe, BaseComponent, CmsComponent, CmsPipe, ContentComponent, CookiesService, ErrorManagementService, ErrorModalComponent, KeycloakProfileService, LanguageService, LeftComponentPipe, LocalCacheService, ModalAppsComponent, NavbarActions, NavbarActionsInternal, OauthPasswordService, ParseJwtService, PwaUpdaterService, RLB_APPS, RLB_APP_NAVCOMP, RLB_APP_SIDEBARCOMP, RLB_AUTH_URL_HANDLER, RLB_CFG, RLB_CFG_ACL, RLB_CFG_AUTH, RLB_CFG_CMS, RLB_CFG_ENV, RLB_CFG_I18N, RLB_CFG_PAGES, RLB_INIT_PROVIDER, RightComponentPipe, RlbAppModule, RlbRole, SidebarActions, SidebarActionsInternal, SidebarFooterComponentPipe, StrapiService, ToastComponent, TokenOauthInterceptor, TranslateBrowserLoader, TruncatePipe, UtilsService, aclFeatureKey, appContextFeatureKey, authsFeatureKey, getDefaultRoutes, initialAclState, initialAppContextState, initialAuthState, initialNavbarState, initialSidebarState, navbarsFeatureKey, oauthGuard, oauthPasswordGuard, permissionGuard, provideApp, provideRlbCodeBrowserOAuth, provideRlbConfig, provideRlbI18n, sidebarsFeatureKey, translateBrowserLoaderFactory, verifyDeactivate };
1357
- export type { Acl, AclConfiguration, AclState, AppContext, AppDescriber, AppDetails, AppInfo, AppInfoData, AppState, AppTheme, AppViewMode, Auth, AuthConfiguration, AuthState, AuthUrlHandler, BaseState, CacheItem, CmsConfiguration, Endpoint, EnvironmentConfiguration, ErrorOutput, Faq, FaqGroup, Home, IConfiguration, InterceptorMapping, InternationalizationConfiguration, JwtUser, KeycloakClient, KeycloakCredential, KeycloakDevice, KeycloakSession, KeycloakUser, KeycloakUserCredentialMetadata, LogLevel, LoggerContext, MenuItem, Navbar, NavbarActionsLayout, NavbarComponents, NavbarHeader, NavbarState, Page, PageTemplate, PagesConfiguration, ProjectConfiguration, ProviderAclConfiguration, ProviderConfiguration, Resource, RlbInitProvider, Sidebar, SidebarComponents, SidebarState, Step, Tab, Token, Topic, UserClaims, UserResource, VerifyDeactivate, _KeycloakCredential };
1393
+ export { AbstractMdService, AbstractSupportService, AclStore, AppBreadcrumbService, AppContainerComponent, AppContextActions, AppContextActionsInternal, AppLoggerService, AppStorageService, AppTemplateComponent, AppsService, AsMultiPipe, AsSinglePipe, AuthActions, AuthActionsInternal, AuthFeatureService, AuthenticationService, AutolinkPipe, BaseComponent, CmsComponent, CmsPipe, ContentComponent, CookiesService, ErrorManagementService, ErrorModalComponent, KeycloakProfileService, LanguageService, LeftComponentPipe, LocalCacheService, MobileComponentPipe, ModalAppsComponent, NavbarActions, NavbarActionsInternal, OauthPasswordService, ParseJwtService, PwaUpdaterService, RLB_APPS, RLB_APP_NAVCOMP, RLB_APP_SIDEBARCOMP, RLB_AUTH_URL_HANDLER, RLB_CFG, RLB_CFG_ACL, RLB_CFG_AUTH, RLB_CFG_CMS, RLB_CFG_ENV, RLB_CFG_I18N, RLB_CFG_PAGES, RLB_INIT_PROVIDER, RLB_NAV_SURFACE, RightComponentPipe, RlbAppModule, RlbRole, SidebarActions, SidebarActionsInternal, SidebarFooterComponentPipe, StrapiService, ToastComponent, TokenOauthInterceptor, TranslateBrowserLoader, TruncatePipe, UtilsService, aclFeatureKey, appContextFeatureKey, authsFeatureKey, getDefaultRoutes, initialAclState, initialAppContextState, initialAuthState, initialNavbarState, initialSidebarState, navbarsFeatureKey, oauthGuard, oauthPasswordGuard, permissionGuard, provideApp, provideRlbCodeBrowserOAuth, provideRlbConfig, provideRlbI18n, sidebarsFeatureKey, translateBrowserLoaderFactory, verifyDeactivate };
1394
+ export type { Acl, AclConfiguration, AclState, AppContext, AppDescriber, AppDetails, AppInfo, AppInfoData, AppState, AppTheme, AppViewMode, Auth, AuthConfiguration, AuthState, AuthUrlHandler, BaseState, CacheItem, CmsConfiguration, Endpoint, EnvironmentConfiguration, ErrorOutput, Faq, FaqGroup, Home, IConfiguration, InterceptorMapping, InternationalizationConfiguration, JwtUser, KeycloakClient, KeycloakCredential, KeycloakDevice, KeycloakSession, KeycloakUser, KeycloakUserCredentialMetadata, LogLevel, LoggerContext, MenuItem, NavSurface, Navbar, NavbarActionsLayout, NavbarComponent, NavbarComponents, NavbarHeader, NavbarState, Page, PageTemplate, PagesConfiguration, ProjectConfiguration, ProviderAclConfiguration, ProviderConfiguration, Resource, RlbInitProvider, Sidebar, SidebarComponents, SidebarState, Step, Tab, Token, Topic, UserClaims, UserResource, VerifyDeactivate, _KeycloakCredential };