@testgorilla/tgo-ui 10.5.0 → 11.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testgorilla/tgo-ui",
3
- "version": "10.5.0",
3
+ "version": "11.0.0",
4
4
  "license": "proprietary-license",
5
5
  "lint-staged": {
6
6
  "{projects,components}/**/*.ts": [
@@ -1,7 +1,6 @@
1
1
  import * as rxjs from 'rxjs';
2
- import { BreakpointObserver } from '@angular/cdk/layout';
3
- import * as i0 from '@angular/core';
4
- import { InputSignal, TemplateRef, EventEmitter, Signal, DestroyRef } from '@angular/core';
2
+ import * as _angular_core from '@angular/core';
3
+ import { TemplateRef, Signal } from '@angular/core';
5
4
  import * as i10 from '@testgorilla/tgo-ui/components/avatar';
6
5
  import { AvatarSize } from '@testgorilla/tgo-ui/components/avatar';
7
6
  import * as i9 from '@testgorilla/tgo-ui/components/core';
@@ -9,8 +8,6 @@ import { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';
9
8
  export { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';
10
9
  import * as i7 from '@testgorilla/tgo-ui/components/logo';
11
10
  import { LogoTypeEnum } from '@testgorilla/tgo-ui/components/logo';
12
- import * as i11 from '@testgorilla/tgo-ui/components/side-sheet';
13
- import { SideSheetService } from '@testgorilla/tgo-ui/components/side-sheet';
14
11
  import * as i14 from '@testgorilla/tgo-ui/components/badge';
15
12
  import { RebrandBadgeColor, BadgeVariant } from '@testgorilla/tgo-ui/components/badge';
16
13
  import * as i8 from '@testgorilla/tgo-ui/components/icon';
@@ -21,6 +18,7 @@ import * as i3 from '@angular/material/icon';
21
18
  import * as i4 from '@angular/material/button';
22
19
  import * as i5 from '@angular/material/core';
23
20
  import * as i6 from '@angular/material/menu';
21
+ import * as i11 from '@testgorilla/tgo-ui/components/side-sheet';
24
22
  import * as i12 from '@testgorilla/tgo-ui/components/button';
25
23
 
26
24
  interface IRoute {
@@ -47,158 +45,170 @@ type ScreenSize = 'mobile' | 'tablet' | 'desktop';
47
45
 
48
46
  declare class NavbarComponent {
49
47
  private readonly breakpointObserver;
50
- private readonly defaultAppTheme;
51
48
  private readonly sideSheetService;
52
- private readonly destroyRef;
49
+ private readonly translatePipe;
50
+ private readonly defaultAppTheme;
53
51
  /**
54
52
  * Routes object
55
53
  *
56
- * @type {IRoute}
57
54
  * @memberof NavbarComponent
58
55
  * @ignore
59
56
  */
60
- routes: IRoute[];
57
+ readonly routes: _angular_core.InputSignal<IRoute[]>;
61
58
  /**
62
59
  * Actived route id
63
60
  *
64
- * @type {InputSignal<string>}
65
61
  * @memberof NavbarComponent
66
62
  */
67
- activedRoute: InputSignal<string>;
63
+ readonly activedRoute: _angular_core.InputSignal<string>;
68
64
  /**
69
65
  * User first name and last name
70
66
  *
71
- * @type {string}
72
67
  * @memberof NavbarComponent
73
68
  */
74
- userName: string;
69
+ readonly userName: _angular_core.InputSignal<string>;
75
70
  /**
76
71
  * User email
77
72
  *
78
- * @type {string}
79
73
  * @memberof NavbarComponent
80
74
  */
81
- email: string;
75
+ readonly email: _angular_core.InputSignal<string>;
82
76
  /**
83
77
  * Menu items to show in menu above the Log out button
84
78
  *
85
- * @type {string}
86
79
  * @memberof NavbarComponent
87
80
  */
88
- menuItems: MenuItem[];
81
+ readonly menuItems: _angular_core.InputSignal<MenuItem[]>;
89
82
  /**
90
- *
91
83
  * Defines the application theme
92
84
  *
93
- * @type {ApplicationTheme}
94
85
  * @memberof NavbarComponent
95
86
  */
96
- applicationTheme: ApplicationTheme;
87
+ readonly applicationTheme: _angular_core.InputSignal<ApplicationTheme>;
97
88
  /**
89
+ * It's ng-content for the collapsed (drawer) version
98
90
  *
99
- * It's ng-content for mobile version
100
- *
101
- * @type {ApplicationTheme}
102
91
  * @memberof NavbarComponent
103
92
  */
104
- contentTemplateRef: TemplateRef<unknown>;
93
+ readonly contentTemplateRef: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
105
94
  /**
106
95
  * Additional info template reference for the extra user info in the dropdown/sidesheet
107
- * @type {TemplateRef<unknown>}
96
+ *
108
97
  * @memberof NavbarComponent
109
98
  */
110
- userInfoExtraTemplateRef: TemplateRef<unknown>;
99
+ readonly userInfoExtraTemplateRef: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
111
100
  /**
112
101
  * Custom content template reference for the menu section between user info and menu items.
113
102
  * Use this to add custom components like credits display.
114
- * @type {TemplateRef<unknown>}
103
+ *
115
104
  * @memberof NavbarComponent
116
105
  */
117
- menuContentTemplateRef: TemplateRef<unknown>;
106
+ readonly menuContentTemplateRef: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
118
107
  /**
119
- * Mobile breakpoint
120
- * @type {number}
108
+ * Width at or below which the navbar renders its compact (brandmark) logo
109
+ *
121
110
  * @memberof NavbarComponent
122
111
  */
123
- set mobileBreakpoint(value: number);
112
+ readonly mobileBreakpoint: _angular_core.InputSignalWithTransform<number, number>;
124
113
  /**
114
+ * Width at or below which the horizontal navigation and the profile menu collapse
115
+ * into the hamburger-triggered drawer
125
116
  *
117
+ * @memberof NavbarComponent
118
+ */
119
+ readonly collapseBreakpoint: _angular_core.InputSignalWithTransform<number, number>;
120
+ /**
126
121
  * Show avatar with user initials
127
122
  *
128
- * @type {boolean}
129
123
  * @memberof NavbarComponent
130
124
  */
131
- isAvatar: boolean;
125
+ readonly isAvatar: _angular_core.InputSignal<boolean>;
132
126
  /**
133
127
  * Sets class for the menu
134
128
  *
135
- * @type {string}
136
129
  * @memberof NavbarComponent
137
130
  */
138
- menuClass: string;
131
+ readonly menuClass: _angular_core.InputSignal<string>;
139
132
  /**
140
133
  * @ignore
141
134
  */
142
- navigateEvent: EventEmitter<string>;
135
+ readonly navigateEvent: _angular_core.OutputEmitterRef<string>;
143
136
  /**
144
137
  * @ignore
145
138
  */
146
- menuItemClicked: EventEmitter<string>;
139
+ readonly menuItemClicked: _angular_core.OutputEmitterRef<string>;
147
140
  /**
148
141
  * @ignore
149
142
  */
150
- logoutEvent: EventEmitter<void>;
151
- menuState: EventEmitter<MenuState>;
152
- protected screenSize: ScreenSize;
153
- protected readonly translationContext = "NAVBAR.";
154
- private readonly _mobileBreakpoint$;
155
- private readonly _tabletBreakpoint$;
156
- private readonly mobileBreakpointObs$;
157
- private readonly tabletBreakpointObs$;
143
+ readonly logoutEvent: _angular_core.OutputEmitterRef<void>;
144
+ readonly menuState: _angular_core.OutputEmitterRef<MenuState>;
145
+ protected readonly isMobile: Signal<boolean>;
146
+ protected readonly isCollapsed: Signal<boolean>;
147
+ protected readonly screenSize: Signal<ScreenSize>;
148
+ /**
149
+ * @deprecated Use the `screenSize` reported by `menuState` instead. Removed in the next major.
150
+ */
158
151
  protected readonly isMobile$: rxjs.Observable<boolean>;
152
+ /**
153
+ * @deprecated Use the `screenSize` reported by `menuState` instead. Removed in the next major.
154
+ */
159
155
  protected readonly isTablet$: rxjs.Observable<boolean>;
160
- protected isOpened: boolean;
161
- protected logoType: typeof LogoTypeEnum;
162
- activeRoutesMap: Signal<Map<string, boolean>>;
163
- constructor(breakpointObserver: BreakpointObserver, defaultAppTheme: ApplicationTheme, sideSheetService: SideSheetService, destroyRef: DestroyRef);
156
+ protected readonly translationContext = "NAVBAR.";
157
+ protected readonly logoType: typeof LogoTypeEnum;
158
+ protected readonly AvatarSize: typeof AvatarSize;
159
+ readonly activeRoutesMap: Signal<Map<string, boolean>>;
160
+ /**
161
+ * Output subscriptions of the currently open drawer. Torn down when it closes, so repeated
162
+ * opens don't accumulate one set per open.
163
+ */
164
+ private drawerSubscriptions;
165
+ private readonly isDrawerOpened;
166
+ private readonly closeDrawerOnExpand;
164
167
  openMobileMenu(): void;
168
+ /**
169
+ * Closes the drawer if the navbar is currently collapsed. Consumers use this to dismiss the
170
+ * menu on navigation without reaching into the component's internals.
171
+ */
172
+ closeMenu(): void;
165
173
  navigate(routeId: string): void;
166
174
  logout(): void;
167
175
  clickMenuItem(id: string): void;
168
176
  onChangeMenuState(isOpened: boolean, screenSize: ScreenSize): void;
169
- protected readonly AvatarSize: typeof AvatarSize;
170
- static ɵfac: i0.ɵɵFactoryDeclaration<NavbarComponent, [null, { optional: true; }, null, null]>;
171
- static ɵcmp: i0.ɵɵComponentDeclaration<NavbarComponent, "ui-navbar", never, { "routes": { "alias": "routes"; "required": false; }; "activedRoute": { "alias": "activedRoute"; "required": false; "isSignal": true; }; "userName": { "alias": "userName"; "required": false; }; "email": { "alias": "email"; "required": false; }; "menuItems": { "alias": "menuItems"; "required": false; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; }; "contentTemplateRef": { "alias": "contentTemplateRef"; "required": false; }; "userInfoExtraTemplateRef": { "alias": "userInfoExtraTemplateRef"; "required": false; }; "menuContentTemplateRef": { "alias": "menuContentTemplateRef"; "required": false; }; "mobileBreakpoint": { "alias": "mobileBreakpoint"; "required": false; }; "isAvatar": { "alias": "isAvatar"; "required": false; }; "menuClass": { "alias": "menuClass"; "required": false; }; }, { "navigateEvent": "navigateEvent"; "menuItemClicked": "menuItemClicked"; "logoutEvent": "logoutEvent"; "menuState": "menuState"; }, never, ["[actions]", "*"], true, never>;
177
+ protected onSideSheetOpenChange(isOpened: boolean): void;
178
+ private teardownDrawerSubscriptions;
179
+ private observeMaxWidth;
180
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NavbarComponent, never>;
181
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NavbarComponent, "ui-navbar", never, { "routes": { "alias": "routes"; "required": false; "isSignal": true; }; "activedRoute": { "alias": "activedRoute"; "required": false; "isSignal": true; }; "userName": { "alias": "userName"; "required": false; "isSignal": true; }; "email": { "alias": "email"; "required": false; "isSignal": true; }; "menuItems": { "alias": "menuItems"; "required": false; "isSignal": true; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; "isSignal": true; }; "contentTemplateRef": { "alias": "contentTemplateRef"; "required": false; "isSignal": true; }; "userInfoExtraTemplateRef": { "alias": "userInfoExtraTemplateRef"; "required": false; "isSignal": true; }; "menuContentTemplateRef": { "alias": "menuContentTemplateRef"; "required": false; "isSignal": true; }; "mobileBreakpoint": { "alias": "mobileBreakpoint"; "required": false; "isSignal": true; }; "collapseBreakpoint": { "alias": "collapseBreakpoint"; "required": false; "isSignal": true; }; "isAvatar": { "alias": "isAvatar"; "required": false; "isSignal": true; }; "menuClass": { "alias": "menuClass"; "required": false; "isSignal": true; }; }, { "navigateEvent": "navigateEvent"; "menuItemClicked": "menuItemClicked"; "logoutEvent": "logoutEvent"; "menuState": "menuState"; }, never, ["[actions]", "*"], true, never>;
172
182
  }
173
183
 
174
184
  declare class MobileNavbarSideSheetComponent {
175
- routes: IRoute[];
176
- activedRoute: InputSignal<string>;
177
- email: string;
178
- userName: string;
179
- menuItems: MenuItem[];
180
- contentTemplateRef: TemplateRef<unknown>;
181
- userInfoExtraTemplateRef: TemplateRef<unknown>;
182
- menuContentTemplateRef: TemplateRef<unknown>;
183
- isDesktop: boolean;
184
- applicationTheme: ApplicationTheme;
185
- navigateEvent: EventEmitter<string>;
186
- menuItemClicked: EventEmitter<string>;
187
- logoutEvent: EventEmitter<void>;
185
+ readonly routes: _angular_core.InputSignal<IRoute[]>;
186
+ readonly activedRoute: _angular_core.InputSignal<string>;
187
+ readonly email: _angular_core.InputSignal<string>;
188
+ readonly userName: _angular_core.InputSignal<string>;
189
+ readonly menuItems: _angular_core.InputSignal<MenuItem[]>;
190
+ readonly contentTemplateRef: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
191
+ readonly userInfoExtraTemplateRef: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
192
+ readonly menuContentTemplateRef: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
193
+ readonly isDesktop: _angular_core.InputSignal<boolean>;
194
+ readonly applicationTheme: _angular_core.InputSignal<ApplicationTheme>;
195
+ readonly navigateEvent: _angular_core.OutputEmitterRef<string>;
196
+ readonly menuItemClicked: _angular_core.OutputEmitterRef<string>;
197
+ readonly logoutEvent: _angular_core.OutputEmitterRef<void>;
188
198
  protected readonly translationContext = "NAVBAR.";
189
- protected avatarSize: typeof AvatarSize;
190
- activeRoutesMap: Signal<Map<string, boolean>>;
199
+ protected readonly avatarSize: typeof AvatarSize;
200
+ readonly activeRoutesMap: Signal<Map<string, boolean>>;
191
201
  navigate(routeId: string): void;
192
202
  logout(): void;
193
203
  clickMenuItem(id: string): void;
194
- static ɵfac: i0.ɵɵFactoryDeclaration<MobileNavbarSideSheetComponent, never>;
195
- static ɵcmp: i0.ɵɵComponentDeclaration<MobileNavbarSideSheetComponent, "ui-mobile-navbar-side-sheet", never, { "routes": { "alias": "routes"; "required": false; }; "activedRoute": { "alias": "activedRoute"; "required": false; "isSignal": true; }; "email": { "alias": "email"; "required": false; }; "userName": { "alias": "userName"; "required": false; }; "menuItems": { "alias": "menuItems"; "required": false; }; "contentTemplateRef": { "alias": "contentTemplateRef"; "required": false; }; "userInfoExtraTemplateRef": { "alias": "userInfoExtraTemplateRef"; "required": false; }; "menuContentTemplateRef": { "alias": "menuContentTemplateRef"; "required": false; }; "isDesktop": { "alias": "isDesktop"; "required": false; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; }; }, { "navigateEvent": "navigateEvent"; "menuItemClicked": "menuItemClicked"; "logoutEvent": "logoutEvent"; }, never, never, true, never>;
204
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MobileNavbarSideSheetComponent, never>;
205
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<MobileNavbarSideSheetComponent, "ui-mobile-navbar-side-sheet", never, { "routes": { "alias": "routes"; "required": false; "isSignal": true; }; "activedRoute": { "alias": "activedRoute"; "required": false; "isSignal": true; }; "email": { "alias": "email"; "required": false; "isSignal": true; }; "userName": { "alias": "userName"; "required": false; "isSignal": true; }; "menuItems": { "alias": "menuItems"; "required": false; "isSignal": true; }; "contentTemplateRef": { "alias": "contentTemplateRef"; "required": false; "isSignal": true; }; "userInfoExtraTemplateRef": { "alias": "userInfoExtraTemplateRef"; "required": false; "isSignal": true; }; "menuContentTemplateRef": { "alias": "menuContentTemplateRef"; "required": false; "isSignal": true; }; "isDesktop": { "alias": "isDesktop"; "required": false; "isSignal": true; }; "applicationTheme": { "alias": "applicationTheme"; "required": false; "isSignal": true; }; }, { "navigateEvent": "navigateEvent"; "menuItemClicked": "menuItemClicked"; "logoutEvent": "logoutEvent"; }, never, never, true, never>;
196
206
  }
197
207
 
198
208
  declare class NavbarComponentModule {
199
- static ɵfac: i0.ɵɵFactoryDeclaration<NavbarComponentModule, never>;
200
- static ɵmod: i0.ɵɵNgModuleDeclaration<NavbarComponentModule, never, [typeof i1.CommonModule, typeof i2.MatToolbarModule, typeof i3.MatIconModule, typeof i4.MatButtonModule, typeof i5.MatRippleModule, typeof i6.MatMenuModule, typeof i7.LogoComponentModule, typeof i8.IconComponentModule, typeof i9.UiTranslatePipe, typeof i10.AvatarComponentModule, typeof i11.SideSheetComponentModule, typeof i12.ButtonComponentModule, typeof MobileNavbarSideSheetComponent, typeof i14.BadgeComponentModule, typeof NavbarComponent], [typeof NavbarComponent]>;
201
- static ɵinj: i0.ɵɵInjectorDeclaration<NavbarComponentModule>;
209
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NavbarComponentModule, never>;
210
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<NavbarComponentModule, never, [typeof i1.CommonModule, typeof i2.MatToolbarModule, typeof i3.MatIconModule, typeof i4.MatButtonModule, typeof i5.MatRippleModule, typeof i6.MatMenuModule, typeof i7.LogoComponentModule, typeof i8.IconComponentModule, typeof i9.UiTranslatePipe, typeof i10.AvatarComponentModule, typeof i11.SideSheetComponentModule, typeof i12.ButtonComponentModule, typeof MobileNavbarSideSheetComponent, typeof i14.BadgeComponentModule, typeof NavbarComponent], [typeof NavbarComponent]>;
211
+ static ɵinj: _angular_core.ɵɵInjectorDeclaration<NavbarComponentModule>;
202
212
  }
203
213
 
204
214
  export { MobileNavbarSideSheetComponent, NavbarComponent, NavbarComponentModule };
@@ -15,6 +15,12 @@ import * as i7 from '@testgorilla/tgo-ui/components/logo';
15
15
  interface SideSheetConfig {
16
16
  /** A component class on input; replaced with its created ComponentRef by SideSheetService.open. */
17
17
  componentRef: Type<unknown> | ComponentRef<unknown>;
18
+ /**
19
+ * Initial input values for the dynamically created component, applied via `ComponentRef.setInput()`.
20
+ * This is the only way to feed a component whose inputs are signal inputs, since those are readonly
21
+ * on the instance returned by `SideSheetService.open()`.
22
+ */
23
+ inputs?: Record<string, unknown>;
18
24
  title?: string;
19
25
  showLogo?: boolean;
20
26
  showBackButton?: boolean;