@spicainternational/ngx-sds-components 9.1.1 → 9.2.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.
@@ -1,7 +1,9 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { Signal, OnInit, OnDestroy, OnChanges, QueryList, SimpleChanges, EventEmitter, PipeTransform } from '@angular/core';
2
+ import { Signal, QueryList, OnInit, OnChanges, EventEmitter, SimpleChanges, PipeTransform } from '@angular/core';
3
3
  import * as _fortawesome_fontawesome_common_types from '@fortawesome/fontawesome-common-types';
4
- import { Router } from '@angular/router';
4
+ import { ConnectedPosition } from '@angular/cdk/overlay';
5
+ import { UrlTree } from '@angular/router';
6
+ import { IconProp } from '@fortawesome/fontawesome-svg-core';
5
7
  import { ProductModel } from '@spicainternational/ngx-sds-components/src/lib/app-switcher';
6
8
 
7
9
  interface CollapsibleNavigationEntity {
@@ -38,9 +40,8 @@ declare class SdsNavigationRouteLinkComponent implements CollapsibleNavigationEn
38
40
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdsNavigationRouteLinkComponent, "sds-navigation-route-link", never, { "link": { "alias": "link"; "required": false; "isSignal": true; }; "nestedLinks": { "alias": "nestedLinks"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; "activeRoutePattern": { "alias": "activeRoutePattern"; "required": false; "isSignal": true; }; "additionalInfo": { "alias": "additionalInfo"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "isCollapsed": { "alias": "isCollapsed"; "required": false; "isSignal": true; }; "ignoreQueryParamsInActiveRoute": { "alias": "ignoreQueryParamsInActiveRoute"; "required": false; "isSignal": true; }; }, { "isCollapsed": "isCollapsedChange"; }, never, ["[navigationIcon]"], true, never>;
39
41
  }
40
42
 
41
- declare class SdsNavigationGroupComponent implements OnInit, OnDestroy, CollapsibleNavigationEntity, OnChanges {
43
+ declare class SdsNavigationGroupComponent implements CollapsibleNavigationEntity {
42
44
  #private;
43
- private _router;
44
45
  /**
45
46
  @deprecated Use `activeRoutePattern` instead.
46
47
  * List of paths allowed/expected within this module.
@@ -48,16 +49,13 @@ declare class SdsNavigationGroupComponent implements OnInit, OnDestroy, Collapsi
48
49
  * elements, but through links in other parts of the application (e.g. link
49
50
  * on form)
50
51
  */
51
- private _navigationGroupNestedRoutes;
52
- /** @deprecated Use `activeRoutePattern` instead. */
53
- set navigationGroupNestedRoutes(value: string[]);
54
- get navigationGroupNestedRoutes(): string[];
52
+ navigationGroupNestedRoutes: _angular_core.InputSignal<string[]>;
55
53
  text: string;
56
54
  icon: string;
57
- defaultRouterLink: string;
55
+ defaultRouterLink: _angular_core.InputSignal<string>;
58
56
  reverse: boolean;
59
57
  /** @deprecated Use `activeRoutePattern` instead. */
60
- ignoreQueryParamsInActiveRoute: boolean;
58
+ ignoreQueryParamsInActiveRoute: _angular_core.InputSignal<boolean>;
61
59
  disabled: boolean;
62
60
  showPopover: boolean;
63
61
  showPopoverHeader: boolean;
@@ -76,27 +74,18 @@ declare class SdsNavigationGroupComponent implements OnInit, OnDestroy, Collapsi
76
74
  isPopoverVisible: _angular_core.WritableSignal<boolean>;
77
75
  faAngleUpRegular: _fortawesome_fontawesome_common_types.IconDefinition;
78
76
  faAngleDownRegular: _fortawesome_fontawesome_common_types.IconDefinition;
79
- /**
80
- * Current app URL (e.g. ['layout-showcase', 'default'])
81
- */
82
- currentUrl: string[];
83
- private _unsubscribe;
84
- isGroupActive: boolean;
77
+ isGroupActive: _angular_core.Signal<boolean>;
85
78
  protected isActiveGroupClosed: boolean;
86
- constructor(_router: Router);
87
79
  isCollapsed: _angular_core.ModelSignal<boolean>;
88
80
  protected lastPointerType: _angular_core.WritableSignal<string>;
89
81
  protected isTouchPointerType: _angular_core.Signal<boolean>;
90
- ngOnInit(): void;
91
- ngOnChanges(changes: SimpleChanges): void;
92
- ngOnDestroy(): void;
93
82
  onMouseEnter(): void;
94
83
  onMouseLeave(): void;
95
84
  onClick(): void;
96
85
  onHiding(e: any): void;
97
86
  rememberPointer(e: PointerEvent): void;
98
87
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdsNavigationGroupComponent, never>;
99
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdsNavigationGroupComponent, "sds-navigation-group", never, { "navigationGroupNestedRoutes": { "alias": "navigationGroupNestedRoutes"; "required": false; }; "text": { "alias": "text"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "defaultRouterLink": { "alias": "defaultRouterLink"; "required": false; }; "reverse": { "alias": "reverse"; "required": false; }; "ignoreQueryParamsInActiveRoute": { "alias": "ignoreQueryParamsInActiveRoute"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "showPopover": { "alias": "showPopover"; "required": false; }; "showPopoverHeader": { "alias": "showPopoverHeader"; "required": false; }; "lightStyle": { "alias": "lightStyle"; "required": false; "isSignal": true; }; "activeRoutePattern": { "alias": "activeRoutePattern"; "required": false; "isSignal": true; }; "additionalInfo": { "alias": "additionalInfo"; "required": false; "isSignal": true; }; "isCollapsed": { "alias": "isCollapsed"; "required": false; "isSignal": true; }; }, { "isCollapsed": "isCollapsedChange"; }, ["routerLinkComponents"], ["[navigationIcon]", "*", "[popoverContent]"], true, never>;
88
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdsNavigationGroupComponent, "sds-navigation-group", never, { "navigationGroupNestedRoutes": { "alias": "navigationGroupNestedRoutes"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "defaultRouterLink": { "alias": "defaultRouterLink"; "required": false; "isSignal": true; }; "reverse": { "alias": "reverse"; "required": false; }; "ignoreQueryParamsInActiveRoute": { "alias": "ignoreQueryParamsInActiveRoute"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; "showPopover": { "alias": "showPopover"; "required": false; }; "showPopoverHeader": { "alias": "showPopoverHeader"; "required": false; }; "lightStyle": { "alias": "lightStyle"; "required": false; "isSignal": true; }; "activeRoutePattern": { "alias": "activeRoutePattern"; "required": false; "isSignal": true; }; "additionalInfo": { "alias": "additionalInfo"; "required": false; "isSignal": true; }; "isCollapsed": { "alias": "isCollapsed"; "required": false; "isSignal": true; }; }, { "isCollapsed": "isCollapsedChange"; }, ["routerLinkComponents"], ["[navigationIcon]", "*", "[popoverContent]"], true, never>;
100
89
  }
101
90
 
102
91
  declare class SdsNavigationSeparatorComponent implements OnInit, CollapsibleNavigationEntity {
@@ -172,6 +161,110 @@ declare class SdsNavigationUserProfileComponent implements OnInit, OnChanges, Co
172
161
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdsNavigationUserProfileComponent, "sds-navigation-user-profile", never, { "profile": { "alias": "profile"; "required": false; }; "profileInfo": { "alias": "profileInfo"; "required": false; }; "showSignOut": { "alias": "showSignOut"; "required": false; }; "showProfile": { "alias": "showProfile"; "required": false; }; "signOutText": { "alias": "signOutText"; "required": false; }; "profileText": { "alias": "profileText"; "required": false; }; "showNotificationBadge": { "alias": "showNotificationBadge"; "required": false; }; "newNotificationsText": { "alias": "newNotificationsText"; "required": false; }; "showOptions": { "alias": "showOptions"; "required": false; }; "isCollapsed": { "alias": "isCollapsed"; "required": false; "isSignal": true; }; "sideBarInstanceName": { "alias": "sideBarInstanceName"; "required": false; "isSignal": true; }; }, { "profileClick": "profileClick"; "signOutClick": "signOutClick"; "notificationBadgeClick": "notificationBadgeClick"; "showOptionsChange": "showOptionsChange"; "isCollapsed": "isCollapsedChange"; }, never, ["*"], true, never>;
173
162
  }
174
163
 
164
+ /**
165
+ * Color scheme and default icon of the callout:
166
+ * - `info` - base color `--bs-primary`, icon `faCircleInfo`
167
+ * - `warning` - base color `--bs-orange`, icon `faTriangleExclamation`
168
+ * - `danger` - base color `--bs-pink`, icon `faCircleExclamation`
169
+ */
170
+ type SdsNavigationCalloutVariant = 'info' | 'warning' | 'danger';
171
+ /**
172
+ * Behaviour of the callout when the navigation is collapsed:
173
+ * - `hide` - the callout is not rendered at all
174
+ * - `icon` - only the icon is rendered; clicking it opens a popup with the full callout
175
+ */
176
+ type SdsNavigationCalloutCollapsedMode = 'hide' | 'icon';
177
+ /**
178
+ * Generic sidebar message: icon + title + description + an optional action. Carries no
179
+ * knowledge of what it's displaying (trial status, payment issues, announcements, ...) - callers
180
+ * pass in already-resolved text.
181
+ *
182
+ * The action is either a button (handle `actionClicked`) or, when `actionLink` is set, a router
183
+ * link that navigates on its own. When the navigation is collapsed the callout is either hidden
184
+ * or shown as an icon that opens the full callout in a popup (see `collapsedMode`).
185
+ *
186
+ * Colors are CSS custom properties derived from the base color `--sds-navigation-callout-color`
187
+ * (set by `variant`); override the base or any of the derived ones:
188
+ * `--sds-navigation-callout-bg`, `-border`, `-title` (also the icon), `-description`, `-action`.
189
+ *
190
+ * @example
191
+ * <!-- Action button -->
192
+ * <sds-navigation-callout
193
+ * variant="warning"
194
+ * title="Trial ends today"
195
+ * description="Choose a plan to keep using the app."
196
+ * actionText="Upgrade to paid"
197
+ * (actionClicked)="openUpgradeDialog()">
198
+ * </sds-navigation-callout>
199
+ *
200
+ * <!-- Redirect -->
201
+ * <sds-navigation-callout
202
+ * variant="danger"
203
+ * title="Payment failed"
204
+ * description="Pay the invoice to keep your subscription."
205
+ * actionText="Go to billing page"
206
+ * actionLink="/billing">
207
+ * </sds-navigation-callout>
208
+ */
209
+ declare class SdsNavigationCalloutComponent implements CollapsibleNavigationEntity {
210
+ /**
211
+ * Required. Color scheme and default icon:
212
+ * `info` (`--bs-primary`), `warning` (`--bs-orange`) or `danger` (`--bs-pink`).
213
+ */
214
+ variant: _angular_core.InputSignal<SdsNavigationCalloutVariant>;
215
+ /**
216
+ * Font Awesome icon shown next to the title (and as the collapsed icon).
217
+ * Falls back to the default icon of the `variant` when not provided.
218
+ * @default null
219
+ */
220
+ icon: _angular_core.InputSignal<IconProp | null>;
221
+ /** Required. Title shown next to the icon. Displayed as given - pass already translated text. */
222
+ title: _angular_core.InputSignal<string>;
223
+ /** Required. Text shown below the title. Displayed as given - pass already translated text. */
224
+ description: _angular_core.InputSignal<string>;
225
+ /**
226
+ * Text of the action. The action is shown only when this is not empty.
227
+ * @default ''
228
+ */
229
+ actionText: _angular_core.InputSignal<string>;
230
+ /**
231
+ * Route of the action - accepts the same values as `routerLink` (string, commands array or `UrlTree`).
232
+ * When set the action is rendered as a link that navigates to the route, otherwise as a button.
233
+ * Ignored when `actionText` is empty.
234
+ * @default null
235
+ */
236
+ actionLink: _angular_core.InputSignal<string | readonly any[] | UrlTree | null>;
237
+ /**
238
+ * Behaviour when the navigation is collapsed:
239
+ * `icon` shows only the icon, which opens the full callout in a popup; `hide` hides the callout.
240
+ * @default 'icon'
241
+ */
242
+ collapsedMode: _angular_core.InputSignal<SdsNavigationCalloutCollapsedMode>;
243
+ /**
244
+ * Collapsed state of the navigation. Set automatically by `sds-navigation-container` -
245
+ * bind it only when the callout is used outside of a container.
246
+ * @default false
247
+ */
248
+ isCollapsed: _angular_core.ModelSignal<boolean>;
249
+ /**
250
+ * Emitted when the action is clicked, for both buttons and links. For a link it is only a
251
+ * notification - the router navigates on its own. The popup (collapsed mode) is closed first.
252
+ */
253
+ actionClicked: _angular_core.OutputEmitterRef<void>;
254
+ protected resolvedIcon: _angular_core.Signal<IconProp>;
255
+ protected isHidden: _angular_core.Signal<boolean>;
256
+ protected isIconOnly: _angular_core.Signal<boolean>;
257
+ protected isPopupOpen: _angular_core.WritableSignal<boolean>;
258
+ protected popupPositions: ConnectedPosition[];
259
+ constructor();
260
+ protected togglePopup(): void;
261
+ protected onPopupOutsideClick(event: MouseEvent, origin: HTMLElement): void;
262
+ protected onPopupKeydown(event: KeyboardEvent): void;
263
+ protected onActionClick(): void;
264
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdsNavigationCalloutComponent, never>;
265
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdsNavigationCalloutComponent, "sds-navigation-callout", never, { "variant": { "alias": "variant"; "required": true; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": true; "isSignal": true; }; "description": { "alias": "description"; "required": true; "isSignal": true; }; "actionText": { "alias": "actionText"; "required": false; "isSignal": true; }; "actionLink": { "alias": "actionLink"; "required": false; "isSignal": true; }; "collapsedMode": { "alias": "collapsedMode"; "required": false; "isSignal": true; }; "isCollapsed": { "alias": "isCollapsed"; "required": false; "isSignal": true; }; }, { "isCollapsed": "isCollapsedChange"; "actionClicked": "actionClicked"; }, never, never, true, never>;
266
+ }
267
+
175
268
  declare class SdsNavigationContainerComponent implements OnInit, CollapsibleNavigationEntity {
176
269
  isCollapsed: _angular_core.ModelSignal<boolean>;
177
270
  groupComponentChildren: _angular_core.Signal<readonly SdsNavigationGroupComponent[]>;
@@ -181,10 +274,11 @@ declare class SdsNavigationContainerComponent implements OnInit, CollapsibleNavi
181
274
  externalLinkComponentChildren: _angular_core.Signal<readonly SdsNavigationExternalLinkComponent[]>;
182
275
  userProfileComponentChildren: _angular_core.Signal<readonly SdsNavigationUserProfileComponent[]>;
183
276
  collapsibleFrameComponentChildren: _angular_core.Signal<readonly SdsNavigationCollapsibleFrameComponent[]>;
277
+ calloutComponentChildren: _angular_core.Signal<readonly SdsNavigationCalloutComponent[]>;
184
278
  constructor();
185
279
  ngOnInit(): void;
186
280
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdsNavigationContainerComponent, never>;
187
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdsNavigationContainerComponent, "sds-navigation-container", never, { "isCollapsed": { "alias": "isCollapsed"; "required": false; "isSignal": true; }; }, { "isCollapsed": "isCollapsedChange"; }, ["groupComponentChildren", "routeLinkComponentChildren", "separatorComponentChildren", "headerComponentChildren", "externalLinkComponentChildren", "userProfileComponentChildren", "collapsibleFrameComponentChildren"], ["*"], true, never>;
281
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdsNavigationContainerComponent, "sds-navigation-container", never, { "isCollapsed": { "alias": "isCollapsed"; "required": false; "isSignal": true; }; }, { "isCollapsed": "isCollapsedChange"; }, ["groupComponentChildren", "routeLinkComponentChildren", "separatorComponentChildren", "headerComponentChildren", "externalLinkComponentChildren", "userProfileComponentChildren", "collapsibleFrameComponentChildren", "calloutComponentChildren"], ["*"], true, never>;
188
282
  }
189
283
 
190
284
  type UserProfileSelectorContent = 'profileList' | 'selectDefaultProfile';
@@ -252,5 +346,21 @@ declare class SdsActiveRoutePatternPipe implements PipeTransform {
252
346
  static ɵpipe: _angular_core.ɵɵPipeDeclaration<SdsActiveRoutePatternPipe, "sdsActiveRoutePattern", true>;
253
347
  }
254
348
 
255
- export { SdsActiveRoutePatternPipe, SdsNavigationCollapsibleFrameComponent, SdsNavigationContainerComponent, SdsNavigationExternalLinkComponent, SdsNavigationGroupComponent, SdsNavigationHeaderComponent, SdsNavigationRouteLinkComponent, SdsNavigationSeparatorComponent, SdsNavigationUserProfileComponent, SdsProductHomeComponent, SdsUserProfileSelectorComponent };
256
- export type { NavigationProfile, UserProfileSelectorContent };
349
+ interface RouteActiveOptions {
350
+ /** Pattern tested against the full URL. Has priority over the legacy options below. */
351
+ activeRoutePattern?: RegExp | string | null;
352
+ /** @deprecated Use `activeRoutePattern` instead. */
353
+ nestedRoutes?: string[];
354
+ defaultLink?: string;
355
+ /** @deprecated Use `activeRoutePattern` instead. */
356
+ ignoreQueryParams?: boolean;
357
+ }
358
+ /**
359
+ * Determines if the provided URL (e.g. router.url) is active for a navigation entity.
360
+ * If `activeRoutePattern` is provided, it is tested against the full URL.
361
+ * Otherwise the legacy matching (default link + nested routes) is used.
362
+ */
363
+ declare function isRouteActive(url: string, options: RouteActiveOptions): boolean;
364
+
365
+ export { SdsActiveRoutePatternPipe, SdsNavigationCalloutComponent, SdsNavigationCollapsibleFrameComponent, SdsNavigationContainerComponent, SdsNavigationExternalLinkComponent, SdsNavigationGroupComponent, SdsNavigationHeaderComponent, SdsNavigationRouteLinkComponent, SdsNavigationSeparatorComponent, SdsNavigationUserProfileComponent, SdsProductHomeComponent, SdsUserProfileSelectorComponent, isRouteActive };
366
+ export type { NavigationProfile, RouteActiveOptions, SdsNavigationCalloutCollapsedMode, SdsNavigationCalloutVariant, UserProfileSelectorContent };