@cccteam/ccc-lib 0.0.13 → 0.0.14

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.
Files changed (76) hide show
  1. package/fesm2022/cccteam-ccc-lib-src-auth-authentication-guard.mjs +7 -15
  2. package/fesm2022/cccteam-ccc-lib-src-auth-authentication-guard.mjs.map +1 -1
  3. package/fesm2022/cccteam-ccc-lib-src-auth-authorization-guard.mjs +10 -9
  4. package/fesm2022/cccteam-ccc-lib-src-auth-authorization-guard.mjs.map +1 -1
  5. package/fesm2022/cccteam-ccc-lib-src-auth-forms.mjs +9 -10
  6. package/fesm2022/cccteam-ccc-lib-src-auth-forms.mjs.map +1 -1
  7. package/fesm2022/cccteam-ccc-lib-src-auth-has-permission.mjs +11 -18
  8. package/fesm2022/cccteam-ccc-lib-src-auth-has-permission.mjs.map +1 -1
  9. package/fesm2022/cccteam-ccc-lib-src-auth-service.mjs +45 -13
  10. package/fesm2022/cccteam-ccc-lib-src-auth-service.mjs.map +1 -1
  11. package/fesm2022/cccteam-ccc-lib-src-ui-alert.mjs +4 -4
  12. package/fesm2022/cccteam-ccc-lib-src-ui-alert.mjs.map +1 -1
  13. package/fesm2022/cccteam-ccc-lib-src-ui-core-service.mjs +41 -0
  14. package/fesm2022/cccteam-ccc-lib-src-ui-core-service.mjs.map +1 -0
  15. package/fesm2022/cccteam-ccc-lib-src-ui-interceptor.mjs +13 -11
  16. package/fesm2022/cccteam-ccc-lib-src-ui-interceptor.mjs.map +1 -1
  17. package/fesm2022/cccteam-ccc-lib-src-ui-notification-service.mjs +11 -5
  18. package/fesm2022/cccteam-ccc-lib-src-ui-notification-service.mjs.map +1 -1
  19. package/fesm2022/cccteam-ccc-lib-src-ui-sidenav.mjs +10 -20
  20. package/fesm2022/cccteam-ccc-lib-src-ui-sidenav.mjs.map +1 -1
  21. package/fesm2022/cccteam-ccc-lib.mjs +3 -4
  22. package/fesm2022/cccteam-ccc-lib.mjs.map +1 -1
  23. package/index.d.ts +12 -5
  24. package/package.json +11 -15
  25. package/src/auth-authentication-guard/index.d.ts +6 -5
  26. package/src/auth-authorization-guard/index.d.ts +6 -5
  27. package/src/auth-forms/index.d.ts +43 -3
  28. package/src/auth-has-permission/index.d.ts +15 -5
  29. package/src/auth-service/index.d.ts +36 -5
  30. package/src/types/index.d.ts +131 -3
  31. package/src/ui-alert/index.d.ts +16 -5
  32. package/src/ui-core-service/index.d.ts +20 -0
  33. package/src/ui-interceptor/index.d.ts +16 -5
  34. package/src/ui-notification-service/index.d.ts +33 -5
  35. package/src/ui-sidenav/index.d.ts +33 -5
  36. package/src/util-request-options/index.d.ts +12 -5
  37. package/cccteam-ccc-lib-0.0.13.tgz +0 -0
  38. package/fesm2022/cccteam-ccc-lib-src-auth-state.mjs +0 -109
  39. package/fesm2022/cccteam-ccc-lib-src-auth-state.mjs.map +0 -1
  40. package/fesm2022/cccteam-ccc-lib-src-ui-core-state.mjs +0 -100
  41. package/fesm2022/cccteam-ccc-lib-src-ui-core-state.mjs.map +0 -1
  42. package/public-api.d.ts +0 -13
  43. package/src/auth-authentication-guard/authentication.guard.d.ts +0 -3
  44. package/src/auth-authentication-guard/public-api.d.ts +0 -1
  45. package/src/auth-authorization-guard/authorization.guard.d.ts +0 -3
  46. package/src/auth-authorization-guard/public-api.d.ts +0 -1
  47. package/src/auth-forms/ccc-field/ccc-field.component.d.ts +0 -25
  48. package/src/auth-forms/form-helpers.d.ts +0 -16
  49. package/src/auth-forms/public-api.d.ts +0 -2
  50. package/src/auth-has-permission/has-permission.directive.d.ts +0 -12
  51. package/src/auth-has-permission/public-api.d.ts +0 -1
  52. package/src/auth-service/auth.service.d.ts +0 -24
  53. package/src/auth-service/public-api.d.ts +0 -1
  54. package/src/auth-state/auth.state.d.ts +0 -27
  55. package/src/auth-state/index.d.ts +0 -5
  56. package/src/auth-state/public-api.d.ts +0 -1
  57. package/src/types/auth.actions.d.ts +0 -41
  58. package/src/types/core.actions.d.ts +0 -31
  59. package/src/types/notification-message.d.ts +0 -18
  60. package/src/types/permissions.d.ts +0 -17
  61. package/src/types/public-api.d.ts +0 -6
  62. package/src/types/session-info.d.ts +0 -9
  63. package/src/types/tokens.d.ts +0 -13
  64. package/src/ui-alert/alert.component.d.ts +0 -13
  65. package/src/ui-alert/public-api.d.ts +0 -1
  66. package/src/ui-core-state/core.state.d.ts +0 -28
  67. package/src/ui-core-state/index.d.ts +0 -5
  68. package/src/ui-core-state/public-api.d.ts +0 -1
  69. package/src/ui-interceptor/api.interceptor.d.ts +0 -12
  70. package/src/ui-interceptor/public-api.d.ts +0 -1
  71. package/src/ui-notification-service/notification.service.d.ts +0 -30
  72. package/src/ui-notification-service/public-api.d.ts +0 -1
  73. package/src/ui-sidenav/public-api.d.ts +0 -1
  74. package/src/ui-sidenav/sidenav.component.d.ts +0 -31
  75. package/src/util-request-options/public-api.d.ts +0 -1
  76. package/src/util-request-options/request-options.d.ts +0 -8
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { signal, Injectable } from '@angular/core';
3
3
 
4
4
  class NotificationService {
5
- notificationId = 0;
5
+ notificationId = signal(0);
6
6
  _notifications = signal([]);
7
7
  notifications = this._notifications.asReadonly();
8
8
  /**
@@ -11,10 +11,16 @@ class NotificationService {
11
11
  * @returns The unique ID assigned to the notification.
12
12
  */
13
13
  addGlobalNotification(notification) {
14
+ this.notificationId.update((id) => id + 1);
14
15
  const newNotification = {
15
16
  ...notification,
16
- id: this.notificationId++,
17
+ id: this.notificationId(),
17
18
  };
19
+ const existingNotification = this._notifications().find((n) => n.message === newNotification.message);
20
+ if (existingNotification) {
21
+ this.updateNotification({ ...existingNotification, ...newNotification });
22
+ return existingNotification.id;
23
+ }
18
24
  this._notifications.update((current) => [...current, newNotification]);
19
25
  return newNotification.id;
20
26
  }
@@ -39,10 +45,10 @@ class NotificationService {
39
45
  updateNotification(updatedNotification) {
40
46
  this._notifications.update((current) => current.map((notification) => notification.id === updatedNotification.id ? { ...notification, ...updatedNotification } : notification));
41
47
  }
42
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
43
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: NotificationService, providedIn: 'root' });
48
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
49
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NotificationService, providedIn: 'root' });
44
50
  }
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: NotificationService, decorators: [{
51
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: NotificationService, decorators: [{
46
52
  type: Injectable,
47
53
  args: [{
48
54
  providedIn: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"cccteam-ccc-lib-src-ui-notification-service.mjs","sources":["../../../projects/ccc-lib/src/ui-notification-service/notification.service.ts","../../../projects/ccc-lib/src/ui-notification-service/cccteam-ccc-lib-src-ui-notification-service.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\nimport { CreateNotificationMessage, NotificationMessage } from '@cccteam/ccc-lib/src/types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NotificationService {\n private notificationId = 0;\n private _notifications = signal<NotificationMessage[]>([]);\n notifications = this._notifications.asReadonly();\n\n /**\n * Adds a new global notification.\n * @param notification The notification message to add.\n * @returns The unique ID assigned to the notification.\n */\n addGlobalNotification(notification: CreateNotificationMessage): number {\n const newNotification: NotificationMessage = {\n ...notification,\n id: this.notificationId++,\n };\n this._notifications.update((current) => [...current, newNotification]);\n return newNotification.id;\n }\n\n /**\n * Dismisses a global notification by its ID.\n * @param notificationId The ID of the notification to dismiss.\n */\n dismissGlobalNotificationById(notificationId: number): void {\n this._notifications.update((current) => current.filter((notification) => notification.id !== notificationId));\n }\n\n /**\n * Dismisses a specific global notification.\n * @param notification The notification to dismiss.\n */\n dismissGlobalNotification(notification: NotificationMessage): void {\n this.dismissGlobalNotificationById(notification.id);\n }\n\n /**\n * Updates an existing notification.\n * @param updatedNotification The notification with updated information.\n */\n updateNotification(updatedNotification: NotificationMessage): void {\n this._notifications.update((current) =>\n current.map((notification) =>\n notification.id === updatedNotification.id ? { ...notification, ...updatedNotification } : notification,\n ),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,mBAAmB,CAAA;IACtB,cAAc,GAAG,CAAC;AAClB,IAAA,cAAc,GAAG,MAAM,CAAwB,EAAE,CAAC;AAC1D,IAAA,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE;AAEhD;;;;AAIG;AACH,IAAA,qBAAqB,CAAC,YAAuC,EAAA;AAC3D,QAAA,MAAM,eAAe,GAAwB;AAC3C,YAAA,GAAG,YAAY;AACf,YAAA,EAAE,EAAE,IAAI,CAAC,cAAc,EAAE;SAC1B;AACD,QAAA,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,OAAO,KAAK,CAAC,GAAG,OAAO,EAAE,eAAe,CAAC,CAAC;QACtE,OAAO,eAAe,CAAC,EAAE;;AAG3B;;;AAGG;AACH,IAAA,6BAA6B,CAAC,cAAsB,EAAA;QAClD,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,YAAY,KAAK,YAAY,CAAC,EAAE,KAAK,cAAc,CAAC,CAAC;;AAG/G;;;AAGG;AACH,IAAA,yBAAyB,CAAC,YAAiC,EAAA;AACzD,QAAA,IAAI,CAAC,6BAA6B,CAAC,YAAY,CAAC,EAAE,CAAC;;AAGrD;;;AAGG;AACH,IAAA,kBAAkB,CAAC,mBAAwC,EAAA;AACzD,QAAA,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,OAAO,KACjC,OAAO,CAAC,GAAG,CAAC,CAAC,YAAY,KACvB,YAAY,CAAC,EAAE,KAAK,mBAAmB,CAAC,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,GAAG,mBAAmB,EAAE,GAAG,YAAY,CACxG,CACF;;uGA5CQ,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFlB,MAAM,EAAA,CAAA;;2FAEP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACLD;;AAEG;;;;"}
1
+ {"version":3,"file":"cccteam-ccc-lib-src-ui-notification-service.mjs","sources":["../../../projects/ccc-lib/src/ui-notification-service/notification.service.ts","../../../projects/ccc-lib/src/ui-notification-service/cccteam-ccc-lib-src-ui-notification-service.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\nimport { CreateNotificationMessage, NotificationMessage } from '@cccteam/ccc-lib/src/types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NotificationService {\n private notificationId = signal(0);\n private _notifications = signal<NotificationMessage[]>([]);\n notifications = this._notifications.asReadonly();\n\n /**\n * Adds a new global notification.\n * @param notification The notification message to add.\n * @returns The unique ID assigned to the notification.\n */\n addGlobalNotification(notification: CreateNotificationMessage): number {\n this.notificationId.update((id) => id + 1);\n const newNotification: NotificationMessage = {\n ...notification,\n id: this.notificationId(),\n };\n const existingNotification = this._notifications().find((n) => n.message === newNotification.message);\n if (existingNotification) {\n this.updateNotification({ ...existingNotification, ...newNotification });\n return existingNotification.id;\n }\n this._notifications.update((current) => [...current, newNotification]);\n return newNotification.id;\n }\n\n /**\n * Dismisses a global notification by its ID.\n * @param notificationId The ID of the notification to dismiss.\n */\n dismissGlobalNotificationById(notificationId: number): void {\n this._notifications.update((current) => current.filter((notification) => notification.id !== notificationId));\n }\n\n /**\n * Dismisses a specific global notification.\n * @param notification The notification to dismiss.\n */\n dismissGlobalNotification(notification: NotificationMessage): void {\n this.dismissGlobalNotificationById(notification.id);\n }\n\n /**\n * Updates an existing notification.\n * @param updatedNotification The notification with updated information.\n */\n updateNotification(updatedNotification: NotificationMessage): void {\n this._notifications.update((current) =>\n current.map((notification) =>\n notification.id === updatedNotification.id ? { ...notification, ...updatedNotification } : notification,\n ),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,mBAAmB,CAAA;AACtB,IAAA,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC;AAC1B,IAAA,cAAc,GAAG,MAAM,CAAwB,EAAE,CAAC;AAC1D,IAAA,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE;AAEhD;;;;AAIG;AACH,IAAA,qBAAqB,CAAC,YAAuC,EAAA;AAC3D,QAAA,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AAC1C,QAAA,MAAM,eAAe,GAAwB;AAC3C,YAAA,GAAG,YAAY;AACf,YAAA,EAAE,EAAE,IAAI,CAAC,cAAc,EAAE;SAC1B;QACD,MAAM,oBAAoB,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,KAAK,eAAe,CAAC,OAAO,CAAC;QACrG,IAAI,oBAAoB,EAAE;YACxB,IAAI,CAAC,kBAAkB,CAAC,EAAE,G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ACLD;;AAEG;;;;"}
@@ -1,8 +1,7 @@
1
1
  import * as i3 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { inject, DestroyRef, Component, Input } from '@angular/core';
5
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
+ import { inject, computed, Input, Component } from '@angular/core';
6
5
  import { MatButtonModule } from '@angular/material/button';
7
6
  import { MatExpansionModule } from '@angular/material/expansion';
8
7
  import * as i1 from '@angular/material/icon';
@@ -10,24 +9,15 @@ import { MatIconModule } from '@angular/material/icon';
10
9
  import { MatSidenavModule } from '@angular/material/sidenav';
11
10
  import * as i2 from '@angular/router';
12
11
  import { RouterModule } from '@angular/router';
13
- import { Store } from '@ngxs/store';
14
12
  import { HasPermissionDirective } from '@cccteam/ccc-lib/src/auth-has-permission';
15
- import { CoreState } from '@cccteam/ccc-lib/src/ui-core-state';
16
- import { tap } from 'rxjs';
13
+ import { UiCoreService } from '@cccteam/ccc-lib/src/ui-core-service';
17
14
 
18
15
  class SidenavComponent {
19
- store = inject(Store);
20
- destroyRef = inject(DestroyRef);
16
+ ui = inject(UiCoreService);
21
17
  navGroups;
22
- currentNav = [];
23
- ngOnInit() {
24
- this.store
25
- .select(CoreState.currentSidenavIdentifier)
26
- .pipe(tap((identifier) => {
27
- this.currentNav = this.updateNavItems(identifier);
28
- }), takeUntilDestroyed(this.destroyRef))
29
- .subscribe();
30
- }
18
+ currentNav = computed(() => {
19
+ return this.updateNavItems(this.ui.currentSidenavIdentifier());
20
+ });
31
21
  /**
32
22
  * Updates the currentNav based on the identifier
33
23
  * @param identifier
@@ -44,10 +34,10 @@ class SidenavComponent {
44
34
  }
45
35
  return this.navGroups[identifier];
46
36
  }
47
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: SidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
48
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.3", type: SidenavComponent, isStandalone: true, selector: "ccc-sidenav", inputs: { navGroups: "navGroups" }, ngImport: i0, template: "<div class=\"nav-container\">\n <nav>\n @for (navItem of currentNav; track navItem.label) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItem }\"></ng-container>\n }\n </nav>\n</div>\n<ng-template #typeRendererTemplate let-navItem=\"navItem\">\n @switch (navItem.type) {\n @case ('header') {\n <ng-container [ngTemplateOutlet]=\"headerTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('link') {\n <ng-container [ngTemplateOutlet]=\"linkTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('expandable') {\n <ng-container\n [ngTemplateOutlet]=\"expandableTemplate\"\n [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n }\n</ng-template>\n<ng-template #headerTemplate let-navItem=\"navItem\">\n <div class=\"link-header\">{{ navItem.label }}</div>\n</ng-template>\n<ng-template #linkTemplate let-navItem=\"navItem\">\n <a [routerLink]=\"navItem.routerLink\" *cccHasPermission=\"navItem.permission\">\n <div class=\"nav-item\" routerLinkActive=\"active-link\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.icon }}\n </mat-icon>\n </div>\n <div class=\"text\">\n {{ navItem.label | titlecase }}\n </div>\n </div>\n </div>\n </a>\n</ng-template>\n<ng-template #expandableTemplate let-navItem=\"navItem\">\n <div class=\"nav-item\" aria-hidden=\"true\" (click)=\"navItem.isExpanded = !navItem.isExpanded\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.isExpanded ? 'expand_less' : 'expand_more' }}\n </mat-icon>\n </div>\n <div class=\"text\">{{ navItem.label }}</div>\n </div>\n </div>\n @if (navItem.isExpanded) {\n <div class=\"expandable-links\">\n @for (navItemChild of navItem.children; track navItemChild) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItemChild }\"> </ng-container>\n }\n </div>\n }\n</ng-template>\n", styles: [".nav-container{padding:0;height:100%}nav{max-width:100%;margin:0 10px}.nav-item{width:100%;height:48px;font-size:18px;display:flex;flex-direction:column;justify-content:center;color:#003b49;padding:0 15px;position:relative}.nav-item:hover{background-color:#0000000a;transition:background-color .1s ease}.nav-item:active{background-color:#0000001a;transition:background-color .1s ease}.link-header{color:#003b49;text-transform:uppercase;font-weight:700;font-size:12px;margin:20px 0 0 5px}.link-button{display:flex;flex-direction:row;width:100%}.link-button .icon{min-width:20px;margin-right:10px;display:flex;flex-direction:column;justify-content:center}.link-button .text{margin-right:10px;text-align:left;display:flex;flex-direction:row;justify-content:left;text-decoration:capitalize}.expandable-links{display:flex;flex-direction:column;width:100%;padding-left:30px}a:active,a:link,a:visited{color:#003b49!important}a{text-decoration:none}.active-link:before{content:\"\";position:absolute;left:3px;width:5px;height:38px;background-color:#003b49}.active-link{background-color:#0000000a;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i3.TitleCasePipe, name: "titlecase" }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatSidenavModule }, { kind: "directive", type: HasPermissionDirective, selector: "[cccHasPermission]", inputs: ["cccHasPermission"] }] });
37
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
38
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: SidenavComponent, isStandalone: true, selector: "ccc-sidenav", inputs: { navGroups: "navGroups" }, ngImport: i0, template: "<div class=\"nav-container\">\n <nav>\n @for (navItem of currentNav(); track navItem) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItem }\"></ng-container>\n }\n </nav>\n</div>\n<ng-template #typeRendererTemplate let-navItem=\"navItem\">\n @switch (navItem.type) {\n @case ('header') {\n <ng-container [ngTemplateOutlet]=\"headerTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('link') {\n <ng-container [ngTemplateOutlet]=\"linkTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('expandable') {\n <ng-container\n [ngTemplateOutlet]=\"expandableTemplate\"\n [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n }\n</ng-template>\n<ng-template #headerTemplate let-navItem=\"navItem\">\n <div class=\"link-header\">{{ navItem.label }}</div>\n</ng-template>\n<ng-template #linkTemplate let-navItem=\"navItem\">\n <a [routerLink]=\"navItem.routerLink\" *cccHasPermission=\"navItem.permission\">\n <div class=\"nav-item\" routerLinkActive=\"active-link\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.icon }}\n </mat-icon>\n </div>\n <div class=\"text\">\n {{ navItem.label | titlecase }}\n </div>\n </div>\n </div>\n </a>\n</ng-template>\n<ng-template #expandableTemplate let-navItem=\"navItem\">\n <div class=\"nav-item\" aria-hidden=\"true\" (click)=\"navItem.isExpanded = !navItem.isExpanded\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.isExpanded ? 'expand_less' : 'expand_more' }}\n </mat-icon>\n </div>\n <div class=\"text\">{{ navItem.label }}</div>\n </div>\n </div>\n @if (navItem.isExpanded) {\n <div class=\"expandable-links\">\n @for (navItemChild of navItem.children; track navItemChild) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItemChild }\"> </ng-container>\n }\n </div>\n }\n</ng-template>\n", styles: [".nav-container{padding:0;height:100%}nav{max-width:100%;margin:0 10px}.nav-item{width:100%;height:48px;font-size:18px;display:flex;flex-direction:column;justify-content:center;color:#003b49;padding:0 15px;position:relative}.nav-item:hover{background-color:#0000000a;transition:background-color .1s ease}.nav-item:active{background-color:#0000001a;transition:background-color .1s ease}.link-header{color:#003b49;text-transform:uppercase;font-weight:700;font-size:12px;margin:20px 0 0 5px}.link-button{display:flex;flex-direction:row;width:100%}.link-button .icon{min-width:20px;margin-right:10px;display:flex;flex-direction:column;justify-content:center}.link-button .text{margin-right:10px;text-align:left;display:flex;flex-direction:row;justify-content:left;text-decoration:capitalize}.expandable-links{display:flex;flex-direction:column;width:100%;padding-left:30px}a:active,a:link,a:visited{color:#003b49!important}a{text-decoration:none}.active-link:before{content:\"\";position:absolute;left:3px;width:5px;height:38px;background-color:#003b49}.active-link{background-color:#0000000a;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i3.TitleCasePipe, name: "titlecase" }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatSidenavModule }, { kind: "directive", type: HasPermissionDirective, selector: "[cccHasPermission]", inputs: ["cccHasPermission"] }] });
49
39
  }
50
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: SidenavComponent, decorators: [{
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SidenavComponent, decorators: [{
51
41
  type: Component,
52
42
  args: [{ selector: 'ccc-sidenav', imports: [
53
43
  MatIconModule,
@@ -57,7 +47,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
57
47
  MatButtonModule,
58
48
  MatSidenavModule,
59
49
  HasPermissionDirective,
60
- ], template: "<div class=\"nav-container\">\n <nav>\n @for (navItem of currentNav; track navItem.label) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItem }\"></ng-container>\n }\n </nav>\n</div>\n<ng-template #typeRendererTemplate let-navItem=\"navItem\">\n @switch (navItem.type) {\n @case ('header') {\n <ng-container [ngTemplateOutlet]=\"headerTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('link') {\n <ng-container [ngTemplateOutlet]=\"linkTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('expandable') {\n <ng-container\n [ngTemplateOutlet]=\"expandableTemplate\"\n [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n }\n</ng-template>\n<ng-template #headerTemplate let-navItem=\"navItem\">\n <div class=\"link-header\">{{ navItem.label }}</div>\n</ng-template>\n<ng-template #linkTemplate let-navItem=\"navItem\">\n <a [routerLink]=\"navItem.routerLink\" *cccHasPermission=\"navItem.permission\">\n <div class=\"nav-item\" routerLinkActive=\"active-link\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.icon }}\n </mat-icon>\n </div>\n <div class=\"text\">\n {{ navItem.label | titlecase }}\n </div>\n </div>\n </div>\n </a>\n</ng-template>\n<ng-template #expandableTemplate let-navItem=\"navItem\">\n <div class=\"nav-item\" aria-hidden=\"true\" (click)=\"navItem.isExpanded = !navItem.isExpanded\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.isExpanded ? 'expand_less' : 'expand_more' }}\n </mat-icon>\n </div>\n <div class=\"text\">{{ navItem.label }}</div>\n </div>\n </div>\n @if (navItem.isExpanded) {\n <div class=\"expandable-links\">\n @for (navItemChild of navItem.children; track navItemChild) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItemChild }\"> </ng-container>\n }\n </div>\n }\n</ng-template>\n", styles: [".nav-container{padding:0;height:100%}nav{max-width:100%;margin:0 10px}.nav-item{width:100%;height:48px;font-size:18px;display:flex;flex-direction:column;justify-content:center;color:#003b49;padding:0 15px;position:relative}.nav-item:hover{background-color:#0000000a;transition:background-color .1s ease}.nav-item:active{background-color:#0000001a;transition:background-color .1s ease}.link-header{color:#003b49;text-transform:uppercase;font-weight:700;font-size:12px;margin:20px 0 0 5px}.link-button{display:flex;flex-direction:row;width:100%}.link-button .icon{min-width:20px;margin-right:10px;display:flex;flex-direction:column;justify-content:center}.link-button .text{margin-right:10px;text-align:left;display:flex;flex-direction:row;justify-content:left;text-decoration:capitalize}.expandable-links{display:flex;flex-direction:column;width:100%;padding-left:30px}a:active,a:link,a:visited{color:#003b49!important}a{text-decoration:none}.active-link:before{content:\"\";position:absolute;left:3px;width:5px;height:38px;background-color:#003b49}.active-link{background-color:#0000000a;position:relative}\n"] }]
50
+ ], template: "<div class=\"nav-container\">\n <nav>\n @for (navItem of currentNav(); track navItem) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItem }\"></ng-container>\n }\n </nav>\n</div>\n<ng-template #typeRendererTemplate let-navItem=\"navItem\">\n @switch (navItem.type) {\n @case ('header') {\n <ng-container [ngTemplateOutlet]=\"headerTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('link') {\n <ng-container [ngTemplateOutlet]=\"linkTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('expandable') {\n <ng-container\n [ngTemplateOutlet]=\"expandableTemplate\"\n [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n }\n</ng-template>\n<ng-template #headerTemplate let-navItem=\"navItem\">\n <div class=\"link-header\">{{ navItem.label }}</div>\n</ng-template>\n<ng-template #linkTemplate let-navItem=\"navItem\">\n <a [routerLink]=\"navItem.routerLink\" *cccHasPermission=\"navItem.permission\">\n <div class=\"nav-item\" routerLinkActive=\"active-link\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.icon }}\n </mat-icon>\n </div>\n <div class=\"text\">\n {{ navItem.label | titlecase }}\n </div>\n </div>\n </div>\n </a>\n</ng-template>\n<ng-template #expandableTemplate let-navItem=\"navItem\">\n <div class=\"nav-item\" aria-hidden=\"true\" (click)=\"navItem.isExpanded = !navItem.isExpanded\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.isExpanded ? 'expand_less' : 'expand_more' }}\n </mat-icon>\n </div>\n <div class=\"text\">{{ navItem.label }}</div>\n </div>\n </div>\n @if (navItem.isExpanded) {\n <div class=\"expandable-links\">\n @for (navItemChild of navItem.children; track navItemChild) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItemChild }\"> </ng-container>\n }\n </div>\n }\n</ng-template>\n", styles: [".nav-container{padding:0;height:100%}nav{max-width:100%;margin:0 10px}.nav-item{width:100%;height:48px;font-size:18px;display:flex;flex-direction:column;justify-content:center;color:#003b49;padding:0 15px;position:relative}.nav-item:hover{background-color:#0000000a;transition:background-color .1s ease}.nav-item:active{background-color:#0000001a;transition:background-color .1s ease}.link-header{color:#003b49;text-transform:uppercase;font-weight:700;font-size:12px;margin:20px 0 0 5px}.link-button{display:flex;flex-direction:row;width:100%}.link-button .icon{min-width:20px;margin-right:10px;display:flex;flex-direction:column;justify-content:center}.link-button .text{margin-right:10px;text-align:left;display:flex;flex-direction:row;justify-content:left;text-decoration:capitalize}.expandable-links{display:flex;flex-direction:column;width:100%;padding-left:30px}a:active,a:link,a:visited{color:#003b49!important}a{text-decoration:none}.active-link:before{content:\"\";position:absolute;left:3px;width:5px;height:38px;background-color:#003b49}.active-link{background-color:#0000000a;position:relative}\n"] }]
61
51
  }], propDecorators: { navGroups: [{
62
52
  type: Input
63
53
  }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"cccteam-ccc-lib-src-ui-sidenav.mjs","sources":["../../../projects/ccc-lib/src/ui-sidenav/sidenav.component.ts","../../../projects/ccc-lib/src/ui-sidenav/sidenav.component.html","../../../projects/ccc-lib/src/ui-sidenav/cccteam-ccc-lib-src-ui-sidenav.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, DestroyRef, inject, Input, OnInit } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatExpansionModule } from '@angular/material/expansion';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatSidenavModule } from '@angular/material/sidenav';\nimport { RouterModule } from '@angular/router';\nimport { Store } from '@ngxs/store';\n\nimport { HasPermissionDirective } from '@cccteam/ccc-lib/src/auth-has-permission';\nimport { PermissionScope } from '@cccteam/ccc-lib/src/types';\nimport { CoreState } from '@cccteam/ccc-lib/src/ui-core-state';\nimport { Observable, tap } from 'rxjs';\n\nexport interface NavItem {\n type: 'link' | 'header' | 'expandable';\n routerLink?: string[];\n label: string;\n icon?: string;\n permission?: PermissionScope;\n children?: NavItem[];\n isExpanded?: boolean;\n attentionCount?: Observable<number>;\n}\n\nexport type NavGroups = Record<string, NavItem[]>;\n\n@Component({\n selector: 'ccc-sidenav',\n templateUrl: './sidenav.component.html',\n styleUrls: ['./sidenav.component.scss'],\n imports: [\n MatIconModule,\n RouterModule,\n CommonModule,\n MatExpansionModule,\n MatButtonModule,\n MatSidenavModule,\n HasPermissionDirective,\n ],\n})\nexport class SidenavComponent implements OnInit {\n private store = inject(Store);\n private destroyRef = inject(DestroyRef);\n\n @Input() navGroups?: NavGroups;\n currentNav: NavItem[] = [];\n\n ngOnInit(): void {\n this.store\n .select(CoreState.currentSidenavIdentifier)\n .pipe(\n tap((identifier) => {\n this.currentNav = this.updateNavItems(identifier);\n }),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe();\n }\n\n /**\n * Updates the currentNav based on the identifier\n * @param identifier\n * @returns NavItem[]\n * @memberof SidenavComponent\n */\n updateNavItems(identifier: string): NavItem[] {\n if (!this.navGroups) {\n return [];\n }\n if (!this.navGroups[identifier]) {\n // pick the first one if the identifier is not found so we don't break the UI\n identifier = Object.keys(this.navGroups)[0];\n }\n return this.navGroups[identifier];\n }\n}\n","<div class=\"nav-container\">\n <nav>\n @for (navItem of currentNav; track navItem.label) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItem }\"></ng-container>\n }\n </nav>\n</div>\n<ng-template #typeRendererTemplate let-navItem=\"navItem\">\n @switch (navItem.type) {\n @case ('header') {\n <ng-container [ngTemplateOutlet]=\"headerTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('link') {\n <ng-container [ngTemplateOutlet]=\"linkTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('expandable') {\n <ng-container\n [ngTemplateOutlet]=\"expandableTemplate\"\n [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n }\n</ng-template>\n<ng-template #headerTemplate let-navItem=\"navItem\">\n <div class=\"link-header\">{{ navItem.label }}</div>\n</ng-template>\n<ng-template #linkTemplate let-navItem=\"navItem\">\n <a [routerLink]=\"navItem.routerLink\" *cccHasPermission=\"navItem.permission\">\n <div class=\"nav-item\" routerLinkActive=\"active-link\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.icon }}\n </mat-icon>\n </div>\n <div class=\"text\">\n {{ navItem.label | titlecase }}\n </div>\n </div>\n </div>\n </a>\n</ng-template>\n<ng-template #expandableTemplate let-navItem=\"navItem\">\n <div class=\"nav-item\" aria-hidden=\"true\" (click)=\"navItem.isExpanded = !navItem.isExpanded\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.isExpanded ? 'expand_less' : 'expand_more' }}\n </mat-icon>\n </div>\n <div class=\"text\">{{ navItem.label }}</div>\n </div>\n </div>\n @if (navItem.isExpanded) {\n <div class=\"expandable-links\">\n @for (navItemChild of navItem.children; track navItemChild) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItemChild }\"> </ng-container>\n }\n </div>\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MA0Ca,gBAAgB,CAAA;AACnB,IAAA,KAAK,GAAG,MAAM,CAAC,K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P,aAAa;wBACb,YAAY;wBACZ,YAAY;wBACZ,kBAAkB;wBAClB,eAAe;wBACf,gBAAgB;wBAChB,sBAAsB;AACvB,qBAAA,EAAA,QAAA,EAAA,4uEAAA,EAAA,MAAA,EAAA,CAAA,slCAAA,CAAA,EAAA;8BAMQ,SAAS,EAAA,CAAA;sBAAjB;;;AE9CH;;AAEG;;;;"}
1
+ {"version":3,"file":"cccteam-ccc-lib-src-ui-sidenav.mjs","sources":["../../../projects/ccc-lib/src/ui-sidenav/sidenav.component.ts","../../../projects/ccc-lib/src/ui-sidenav/sidenav.component.html","../../../projects/ccc-lib/src/ui-sidenav/cccteam-ccc-lib-src-ui-sidenav.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, computed, inject, Input, Signal } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatExpansionModule } from '@angular/material/expansion';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatSidenavModule } from '@angular/material/sidenav';\nimport { RouterModule } from '@angular/router';\n\nimport { HasPermissionDirective } from '@cccteam/ccc-lib/src/auth-has-permission';\nimport { PermissionScope } from '@cccteam/ccc-lib/src/types';\nimport { UiCoreService } from '@cccteam/ccc-lib/src/ui-core-service';\n\nexport interface NavItem {\n type: 'link' | 'header' | 'expandable';\n routerLink?: string[];\n label: string;\n icon?: string;\n permission?: PermissionScope;\n children?: NavItem[];\n isExpanded?: boolean;\n attentionCount?: Signal<number>;\n}\n\nexport type NavGroups = Record<string, NavItem[]>;\n\n@Component({\n selector: 'ccc-sidenav',\n templateUrl: './sidenav.component.html',\n styleUrls: ['./sidenav.component.scss'],\n imports: [\n MatIconModule,\n RouterModule,\n CommonModule,\n MatExpansionModule,\n MatButtonModule,\n MatSidenavModule,\n HasPermissionDirective,\n ],\n})\nexport class SidenavComponent {\n ui = inject(UiCoreService);\n\n @Input() navGroups?: NavGroups;\n currentNav = computed(() => {\n return this.updateNavItems(this.ui.currentSidenavIdentifier());\n });\n\n /**\n * Updates the currentNav based on the identifier\n * @param identifier\n * @returns NavItem[]\n * @memberof SidenavComponent\n */\n updateNavItems(identifier: string): NavItem[] {\n if (!this.navGroups) {\n return [];\n }\n if (!this.navGroups[identifier]) {\n // pick the first one if the identifier is not found so we don't break the UI\n identifier = Object.keys(this.navGroups)[0];\n }\n return this.navGroups[identifier];\n }\n}\n","<div class=\"nav-container\">\n <nav>\n @for (navItem of currentNav(); track navItem) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItem }\"></ng-container>\n }\n </nav>\n</div>\n<ng-template #typeRendererTemplate let-navItem=\"navItem\">\n @switch (navItem.type) {\n @case ('header') {\n <ng-container [ngTemplateOutlet]=\"headerTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('link') {\n <ng-container [ngTemplateOutlet]=\"linkTemplate\" [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n @case ('expandable') {\n <ng-container\n [ngTemplateOutlet]=\"expandableTemplate\"\n [ngTemplateOutletContext]=\"{ navItem: navItem }\"></ng-container>\n }\n }\n</ng-template>\n<ng-template #headerTemplate let-navItem=\"navItem\">\n <div class=\"link-header\">{{ navItem.label }}</div>\n</ng-template>\n<ng-template #linkTemplate let-navItem=\"navItem\">\n <a [routerLink]=\"navItem.routerLink\" *cccHasPermission=\"navItem.permission\">\n <div class=\"nav-item\" routerLinkActive=\"active-link\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.icon }}\n </mat-icon>\n </div>\n <div class=\"text\">\n {{ navItem.label | titlecase }}\n </div>\n </div>\n </div>\n </a>\n</ng-template>\n<ng-template #expandableTemplate let-navItem=\"navItem\">\n <div class=\"nav-item\" aria-hidden=\"true\" (click)=\"navItem.isExpanded = !navItem.isExpanded\">\n <div class=\"link-button\">\n <div class=\"icon\">\n <mat-icon class=\"material-icons-outlined\" [inline]=\"true\">\n {{ navItem.isExpanded ? 'expand_less' : 'expand_more' }}\n </mat-icon>\n </div>\n <div class=\"text\">{{ navItem.label }}</div>\n </div>\n </div>\n @if (navItem.isExpanded) {\n <div class=\"expandable-links\">\n @for (navItemChild of navItem.children; track navItemChild) {\n <ng-container *ngTemplateOutlet=\"typeRendererTemplate; context: { navItem: navItemChild }\"> </ng-container>\n }\n </div>\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAuCa,gBAAgB,CAAA;AAC3B,IAAA,EAAE,GAAG,MAAM,CAAC,aAAa,CAAC;AAEjB,IAAA,SAAS;AAClB,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAK;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,wBAAwB,EAAE,CAAC;AAChE,KAAC,CAAC;AAEF;;;;;AAKG;AACH,IAAA,cAAc,CAAC,UAAkB,EAAA;AAC/B,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;AACnB,YAAA,OAAO,EAAE;;QAEX,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE;;AAE/B,YAAA,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;;AAE7C,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;;uGAtBxB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gBAAgB,ECvC7B,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,QAAA,E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AA,EAAA,CAAA,EAAA,CAAA;;2FAGb,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAd5B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAGd,OAAA,EAAA;wBACP,aAAa;wBACb,YAAY;wBACZ,YAAY;wBACZ,kBAAkB;wBAClB,eAAe;wBACf,gBAAgB;wBAChB,sBAAsB;AACvB,qBAAA,EAAA,QAAA,EAAA,wuEAAA,EAAA,MAAA,EAAA,CAAA,slCAAA,CAAA,EAAA;8BAKQ,SAAS,EAAA,CAAA;sBAAjB;;;AE1CH;;AAEG;;;;"}
@@ -1,21 +1,20 @@
1
+ export * from '@cccteam/ccc-lib/src/auth-service';
2
+ export * from '@cccteam/ccc-lib/src/ui-core-service';
1
3
  export * from '@cccteam/ccc-lib/src/auth-has-permission';
2
4
  export * from '@cccteam/ccc-lib/src/auth-forms';
3
5
  export * from '@cccteam/ccc-lib/src/auth-authentication-guard';
4
6
  export * from '@cccteam/ccc-lib/src/auth-authorization-guard';
5
- export * from '@cccteam/ccc-lib/src/auth-service';
6
7
  export * from '@cccteam/ccc-lib/src/util-request-options';
7
- export * from '@cccteam/ccc-lib/src/auth-state';
8
8
  export * from '@cccteam/ccc-lib/src/types';
9
9
  export * from '@cccteam/ccc-lib/src/ui-alert';
10
10
  export * from '@cccteam/ccc-lib/src/ui-sidenav';
11
11
  export * from '@cccteam/ccc-lib/src/ui-interceptor';
12
12
  export * from '@cccteam/ccc-lib/src/ui-notification-service';
13
- export * from '@cccteam/ccc-lib/src/ui-core-state';
14
13
 
15
14
  /*
16
15
  * Public API Surface of ccc-lib
17
16
  */
18
- // Auth directives
17
+ // Auth service
19
18
 
20
19
  /**
21
20
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"cccteam-ccc-lib.mjs","sources":["../../../projects/ccc-lib/src/public-api.ts","../../../projects/ccc-lib/src/cccteam-ccc-lib.ts"],"sourcesContent":["/*\n * Public API Surface of ccc-lib\n */\n\n// Auth directives\nexport * from '@cccteam/ccc-lib/src/auth-has-permission';\n\n// Auth forms\nexport * from '@cccteam/ccc-lib/src/auth-forms';\n\n// Auth guards\nexport * from '@cccteam/ccc-lib/src/auth-authentication-guard';\nexport * from '@cccteam/ccc-lib/src/auth-authorization-guard';\n\n// Auth services\nexport * from '@cccteam/ccc-lib/src/auth-service';\n\n// Util\nexport * from '@cccteam/ccc-lib/src/util-request-options';\n\n// Auth state\nexport * from '@cccteam/ccc-lib/src/auth-state';\n\n// Types\nexport * from '@cccteam/ccc-lib/src/types';\n\n// Ui components\nexport * from '@cccteam/ccc-lib/src/ui-alert';\nexport * from '@cccteam/ccc-lib/src/ui-sidenav';\n\n// Ui interceptor\nexport * from '@cccteam/ccc-lib/src/ui-interceptor';\n\n// Ui services\nexport * from '@cccteam/ccc-lib/src/ui-notification-service';\n\n// Ui state\nexport * from '@cccteam/ccc-lib/src/ui-core-state';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;AAEG;AAEH;;ACJA;;AAEG"}
1
+ {"version":3,"file":"cccteam-ccc-lib.mjs","sources":["../../../projects/ccc-lib/src/public-api.ts","../../../projects/ccc-lib/src/cccteam-ccc-lib.ts"],"sourcesContent":["/*\n * Public API Surface of ccc-lib\n */\n\n// Auth service\nexport * from '@cccteam/ccc-lib/src/auth-service';\n\n// UI Core service\nexport * from '@cccteam/ccc-lib/src/ui-core-service';\n\n// Auth directives\nexport * from '@cccteam/ccc-lib/src/auth-has-permission';\n\n// Auth forms\nexport * from '@cccteam/ccc-lib/src/auth-forms';\n\n// Auth guards\nexport * from '@cccteam/ccc-lib/src/auth-authentication-guard';\nexport * from '@cccteam/ccc-lib/src/auth-authorization-guard';\n\n// Util\nexport * from '@cccteam/ccc-lib/src/util-request-options';\n\n// Types\nexport * from '@cccteam/ccc-lib/src/types';\n\n// Ui components\nexport * from '@cccteam/ccc-lib/src/ui-alert';\nexport * from '@cccteam/ccc-lib/src/ui-sidenav';\n\n// Ui interceptor\nexport * from '@cccteam/ccc-lib/src/ui-interceptor';\n\n// Ui services\nexport * from '@cccteam/ccc-lib/src/ui-notification-service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;AAEG;AAEH;;ACJA;;AAEG"}
package/index.d.ts CHANGED
@@ -1,5 +1,12 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@cccteam/ccc-lib" />
5
- export * from './public-api';
1
+ export * from '@cccteam/ccc-lib/src/auth-service';
2
+ export * from '@cccteam/ccc-lib/src/ui-core-service';
3
+ export * from '@cccteam/ccc-lib/src/auth-has-permission';
4
+ export * from '@cccteam/ccc-lib/src/auth-forms';
5
+ export * from '@cccteam/ccc-lib/src/auth-authentication-guard';
6
+ export * from '@cccteam/ccc-lib/src/auth-authorization-guard';
7
+ export * from '@cccteam/ccc-lib/src/util-request-options';
8
+ export * from '@cccteam/ccc-lib/src/types';
9
+ export * from '@cccteam/ccc-lib/src/ui-alert';
10
+ export * from '@cccteam/ccc-lib/src/ui-sidenav';
11
+ export * from '@cccteam/ccc-lib/src/ui-interceptor';
12
+ export * from '@cccteam/ccc-lib/src/ui-notification-service';
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@cccteam/ccc-lib",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git://github.com/cccteam/ccc-lib.git"
7
7
  },
8
8
  "peerDependencies": {
9
- "@angular/common": "^19.0.2",
10
- "@angular/core": "^19.0.2"
9
+ "@angular/common": "^20.0.0",
10
+ "@angular/core": "^20.0.0"
11
11
  },
12
12
  "dependencies": {
13
13
  "tslib": "^2.3.0"
@@ -27,6 +27,10 @@
27
27
  "types": "./src/auth-authentication-guard/index.d.ts",
28
28
  "default": "./fesm2022/cccteam-ccc-lib-src-auth-authentication-guard.mjs"
29
29
  },
30
+ "./src/auth-authorization-guard": {
31
+ "types": "./src/auth-authorization-guard/index.d.ts",
32
+ "default": "./fesm2022/cccteam-ccc-lib-src-auth-authorization-guard.mjs"
33
+ },
30
34
  "./src/auth-forms": {
31
35
  "types": "./src/auth-forms/index.d.ts",
32
36
  "default": "./fesm2022/cccteam-ccc-lib-src-auth-forms.mjs"
@@ -35,18 +39,10 @@
35
39
  "types": "./src/auth-has-permission/index.d.ts",
36
40
  "default": "./fesm2022/cccteam-ccc-lib-src-auth-has-permission.mjs"
37
41
  },
38
- "./src/auth-authorization-guard": {
39
- "types": "./src/auth-authorization-guard/index.d.ts",
40
- "default": "./fesm2022/cccteam-ccc-lib-src-auth-authorization-guard.mjs"
41
- },
42
42
  "./src/auth-service": {
43
43
  "types": "./src/auth-service/index.d.ts",
44
44
  "default": "./fesm2022/cccteam-ccc-lib-src-auth-service.mjs"
45
45
  },
46
- "./src/auth-state": {
47
- "types": "./src/auth-state/index.d.ts",
48
- "default": "./fesm2022/cccteam-ccc-lib-src-auth-state.mjs"
49
- },
50
46
  "./src/types": {
51
47
  "types": "./src/types/index.d.ts",
52
48
  "default": "./fesm2022/cccteam-ccc-lib-src-types.mjs"
@@ -55,9 +51,9 @@
55
51
  "types": "./src/ui-alert/index.d.ts",
56
52
  "default": "./fesm2022/cccteam-ccc-lib-src-ui-alert.mjs"
57
53
  },
58
- "./src/ui-core-state": {
59
- "types": "./src/ui-core-state/index.d.ts",
60
- "default": "./fesm2022/cccteam-ccc-lib-src-ui-core-state.mjs"
54
+ "./src/ui-core-service": {
55
+ "types": "./src/ui-core-service/index.d.ts",
56
+ "default": "./fesm2022/cccteam-ccc-lib-src-ui-core-service.mjs"
61
57
  },
62
58
  "./src/ui-interceptor": {
63
59
  "types": "./src/ui-interceptor/index.d.ts",
@@ -76,4 +72,4 @@
76
72
  "default": "./fesm2022/cccteam-ccc-lib-src-util-request-options.mjs"
77
73
  }
78
74
  }
79
- }
75
+ }
@@ -1,5 +1,6 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@cccteam/ccc-lib/src/auth-authentication-guard" />
5
- export * from './public-api';
1
+ import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
2
+ import { Observable } from 'rxjs';
3
+
4
+ declare const AuthenticationGuard: (route: ActivatedRouteSnapshot, routerState: RouterStateSnapshot) => Observable<boolean>;
5
+
6
+ export { AuthenticationGuard };
@@ -1,5 +1,6 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@cccteam/ccc-lib/src/auth-authorization-guard" />
5
- export * from './public-api';
1
+ import { Signal } from '@angular/core';
2
+ import { ActivatedRouteSnapshot } from '@angular/router';
3
+
4
+ declare const AuthorizationGuard: (route: ActivatedRouteSnapshot) => Signal<boolean>;
5
+
6
+ export { AuthorizationGuard };
@@ -1,5 +1,45 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { OnInit, Signal } from '@angular/core';
3
+ import { AuthService } from '@cccteam/ccc-lib/src/auth-service';
4
+ import { Resource, Domain } from '@cccteam/ccc-lib/src/types';
5
+ import { FormGroup, FormArray } from '@angular/forms';
6
+
7
+ declare enum InputMode {
8
+ Read = "read",
9
+ Edit = "edit"
10
+ }
11
+ declare class CccInputFieldComponent implements OnInit {
12
+ auth: AuthService;
13
+ className: _angular_core.InputSignal<unknown>;
14
+ mode: _angular_core.InputSignal<InputMode>;
15
+ resource: _angular_core.InputSignal<Resource>;
16
+ domain: _angular_core.InputSignal<Domain>;
17
+ value: _angular_core.InputSignal<unknown>;
18
+ name: _angular_core.InputSignal<string>;
19
+ inputMode: typeof InputMode;
20
+ canEdit: Signal<boolean>;
21
+ canEditSelector: boolean;
22
+ canRead: Signal<boolean>;
23
+ canReadSelector: boolean;
24
+ ngOnInit(): void;
25
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CccInputFieldComponent, never>;
26
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CccInputFieldComponent, "ccc-input-field", never, { "className": { "alias": "className"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": true; "isSignal": true; }; "resource": { "alias": "resource"; "required": true; "isSignal": true; }; "domain": { "alias": "domain"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "name": { "alias": "name"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
27
+ }
28
+
1
29
  /**
2
- * Generated bundle index. Do not edit.
30
+ * Accepts a FormGroup and compares it to an object to return the dirty form values
31
+ * as a sparse object
32
+ * @param form - FormGroup
33
+ * @param compareData - object to compare form values against
34
+ * @returns Partial<T>
35
+ * @example sparseFormData<UserCreate>(this.userForm, initUser)
3
36
  */
4
- /// <amd-module name="@cccteam/ccc-lib/src/auth-forms" />
5
- export * from './public-api';
37
+ declare function sparseFormData<T>(form: FormGroup, compareData: T): T;
38
+ /**
39
+ * Accepts a FormArray and removes empty strings
40
+ * @param formArray - FormArray
41
+ * @returns FormArray
42
+ */
43
+ declare function cleanStringFormArray(formArray: FormArray): FormArray;
44
+
45
+ export { CccInputFieldComponent, InputMode, cleanStringFormArray, sparseFormData };
@@ -1,5 +1,15 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@cccteam/ccc-lib/src/auth-has-permission" />
5
- export * from './public-api';
1
+ import { PermissionScope } from '@cccteam/ccc-lib/src/types';
2
+ import * as i0 from '@angular/core';
3
+
4
+ declare class HasPermissionDirective {
5
+ private auth;
6
+ private templateRef;
7
+ private viewContainer;
8
+ private scope;
9
+ set cccHasPermission(scope: PermissionScope);
10
+ constructor();
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<HasPermissionDirective, never>;
12
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HasPermissionDirective, "[cccHasPermission]", never, { "cccHasPermission": { "alias": "cccHasPermission"; "required": false; }; }, {}, never, never, true, never>;
13
+ }
14
+
15
+ export { HasPermissionDirective };
@@ -1,5 +1,36 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@cccteam/ccc-lib/src/auth-service" />
5
- export * from './public-api';
1
+ import * as _angular_core from '@angular/core';
2
+ import { HttpClient } from '@angular/common/http';
3
+ import { SessionInfo, PermissionScope, Resource, Permission } from '@cccteam/ccc-lib/src/types';
4
+ import { Observable } from 'rxjs';
5
+
6
+ declare class AuthService {
7
+ private apiUrl;
8
+ http: HttpClient;
9
+ private authenticatedSignal;
10
+ private sessionInfoSignal;
11
+ redirectUrl: _angular_core.WritableSignal<string>;
12
+ authenticated: _angular_core.Signal<boolean>;
13
+ sessionInfo: _angular_core.Signal<SessionInfo>;
14
+ constructor(apiUrl: string);
15
+ private static permissionFn;
16
+ hasPermission(scope?: PermissionScope): boolean;
17
+ static requiresPermission(resource: Resource, permission: Permission): boolean;
18
+ private initializePermissionFn;
19
+ /**
20
+ * Logs a user out.
21
+ *
22
+ * @returns Observable with a boolean indicating whether they were logged out.
23
+ */
24
+ logout(): Observable<boolean>;
25
+ /**
26
+ * Checks a user's session with the server.
27
+ *
28
+ * @returns Observable with the user session info
29
+ */
30
+ checkUserSession(): Observable<SessionInfo>;
31
+ loginRoute(): string;
32
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AuthService, never>;
33
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<AuthService>;
34
+ }
35
+
36
+ export { AuthService };
@@ -1,5 +1,133 @@
1
+ import { InjectionToken } from '@angular/core';
2
+
3
+ declare enum AlertLevel {
4
+ ERROR = "warn",
5
+ INFO = "accent",
6
+ SUCCESS = "success"
7
+ }
8
+ interface CreateNotificationMessage {
9
+ duration?: number;
10
+ message: string;
11
+ link: string;
12
+ level: AlertLevel;
13
+ }
14
+ interface NotificationMessage {
15
+ id: number;
16
+ duration?: number;
17
+ message: string;
18
+ link: string;
19
+ level: AlertLevel;
20
+ }
21
+
22
+ declare namespace AuthenticationGuardAction {
23
+ class SetRedirectUrl {
24
+ redirectUrl: string;
25
+ static readonly type = "[AuthenticationGuard] Set Redirect Url And Navigate To Login Page";
26
+ constructor(redirectUrl: string);
27
+ }
28
+ class CheckUserSession {
29
+ static readonly type = "[AuthenticationGuard] Check User Session";
30
+ }
31
+ }
32
+ declare namespace LoginAction {
33
+ class Logout {
34
+ static readonly type = "[Login] Auto Logout";
35
+ }
36
+ class SetRedirectUrl {
37
+ redirectUrl: string;
38
+ static readonly type = "[Login] Set Redirect Url";
39
+ constructor(redirectUrl: string);
40
+ }
41
+ class PublishError {
42
+ message: CreateNotificationMessage;
43
+ static readonly type = "[Login] Publish Error";
44
+ constructor(message: CreateNotificationMessage);
45
+ }
46
+ }
47
+ declare namespace AppAction {
48
+ class CheckUserSession {
49
+ static readonly type = "[App] Check User Session";
50
+ }
51
+ class SetRedirectUrl {
52
+ redirectUrl: string;
53
+ static readonly type = "[App] Set Redirect Url";
54
+ constructor(redirectUrl: string);
55
+ }
56
+ class SetNavIdentifier {
57
+ identifier: string;
58
+ static readonly type = "[App] Set Nav Identifier";
59
+ constructor(identifier: string);
60
+ }
61
+ }
62
+
63
+ declare namespace ApiInterceptorAction {
64
+ class BeginActivity {
65
+ process: string;
66
+ static readonly type = "[ApiInterceptor] Add Loading Activity";
67
+ constructor(process: string);
68
+ }
69
+ class EndActivity {
70
+ process: string;
71
+ static readonly type = "[ApiInterceptor] Remove Loading Activity";
72
+ constructor(process: string);
73
+ }
74
+ class PublishError {
75
+ message: CreateNotificationMessage;
76
+ static readonly type = "[ApiInterceptor] Publish Error";
77
+ constructor(message: CreateNotificationMessage);
78
+ }
79
+ class SetRedirectUrl {
80
+ redirectUrl: string;
81
+ static readonly type = "[ApiInterceptor] Set Redirect Url";
82
+ constructor(redirectUrl: string);
83
+ }
84
+ }
85
+ declare namespace HeaderAction {
86
+ class ToggleSidenav {
87
+ static readonly type = "[Header] Toggle Sidenav";
88
+ }
89
+ class Logout {
90
+ static readonly type = "[Header] User Logout";
91
+ }
92
+ }
93
+
94
+ type Brand<K, T> = K & {
95
+ __brand: T;
96
+ };
97
+ type Permission = Brand<string, 'Permission'>;
98
+ type Resource = Brand<string, 'Resource'>;
99
+ type Domain = Brand<string, 'Domain'>;
100
+ type FieldName = Brand<string, 'FieldName'>;
101
+ type Method = Brand<string, 'Method'>;
102
+ type DomainPermissions = Record<Domain, Record<Resource, Record<Permission, Permissions>>>;
103
+ interface PermissionScope {
104
+ resource: Resource;
105
+ permission: Permission;
106
+ domain: Domain;
107
+ }
108
+ declare const ReadPermission: Permission;
109
+ declare const UpdatePermission: Permission;
110
+
1
111
  /**
2
- * Generated bundle index. Do not edit.
112
+ * Session Information for a logged in user
3
113
  */
4
- /// <amd-module name="@cccteam/ccc-lib/src/types" />
5
- export * from './public-api';
114
+ interface SessionInfo {
115
+ authenticated: boolean;
116
+ username: string;
117
+ permissions: DomainPermissions;
118
+ }
119
+
120
+ declare const BASE_URL: InjectionToken<string>;
121
+ declare const API_URL: InjectionToken<string>;
122
+ declare const PERMISSION_REQUIRED: InjectionToken<(resource: Resource, permission: Permission) => boolean>;
123
+ declare const AVAILABLE_PERMISSIONS: InjectionToken<{
124
+ Create: Permission;
125
+ Delete: Permission;
126
+ List: Permission;
127
+ Read: Permission;
128
+ Update: Permission;
129
+ }>;
130
+ declare const AVAILABLE_DOMAINS: InjectionToken<Record<string, Domain>[]>;
131
+
132
+ export { API_URL, AVAILABLE_DOMAINS, AVAILABLE_PERMISSIONS, AlertLevel, ApiInterceptorAction, AppAction, AuthenticationGuardAction, BASE_URL, HeaderAction, LoginAction, PERMISSION_REQUIRED, ReadPermission, UpdatePermission };
133
+ export type { CreateNotificationMessage, Domain, DomainPermissions, FieldName, Method, NotificationMessage, Permission, PermissionScope, Resource, SessionInfo };
@@ -1,5 +1,16 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@cccteam/ccc-lib/src/ui-alert" />
5
- export * from './public-api';
1
+ import * as i0 from '@angular/core';
2
+ import { OnInit, EventEmitter } from '@angular/core';
3
+ import { NotificationMessage } from '@cccteam/ccc-lib/src/types';
4
+ import { NotificationService } from '@cccteam/ccc-lib/src/ui-notification-service';
5
+
6
+ declare class AlertComponent implements OnInit {
7
+ error: NotificationMessage;
8
+ dismiss: EventEmitter<any>;
9
+ errors: NotificationService;
10
+ ngOnInit(): void;
11
+ dismissAlert(): void;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<AlertComponent, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<AlertComponent, "ccc-alert", never, { "error": { "alias": "error"; "required": true; }; }, { "dismiss": "dismiss"; }, never, never, true, never>;
14
+ }
15
+
16
+ export { AlertComponent };