@cccteam/ccc-lib 0.0.10 → 0.0.11
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/cccteam-ccc-lib-0.0.10.tgz +0 -0
- package/cccteam-ccc-lib-0.0.11.tgz +0 -0
- package/fesm2022/cccteam-ccc-lib.mjs +31 -31
- package/fesm2022/cccteam-ccc-lib.mjs.map +1 -1
- package/package.json +4 -6
- package/esm2022/cccteam-ccc-lib.mjs +0 -5
- package/esm2022/lib/auth/directives/has-permission.directive.mjs +0 -44
- package/esm2022/lib/auth/forms/ccc-field/ccc-field.component.mjs +0 -77
- package/esm2022/lib/auth/forms/form-helpers.mjs +0 -34
- package/esm2022/lib/auth/guards/authentication.guard.mjs +0 -38
- package/esm2022/lib/auth/guards/authorization.guard.mjs +0 -17
- package/esm2022/lib/auth/services/auth.service.mjs +0 -49
- package/esm2022/lib/auth/services/request-options.mjs +0 -12
- package/esm2022/lib/auth/state/auth.actions.mjs +0 -64
- package/esm2022/lib/auth/state/auth.state.mjs +0 -105
- package/esm2022/lib/types/base/tokens.mjs +0 -7
- package/esm2022/lib/types/notification-message.mjs +0 -7
- package/esm2022/lib/types/permissions.mjs +0 -3
- package/esm2022/lib/types/session-info.mjs +0 -2
- package/esm2022/lib/ui/components/alert/alert.component.mjs +0 -41
- package/esm2022/lib/ui/components/sidenav/sidenav.component.mjs +0 -63
- package/esm2022/lib/ui/interceptor/api.interceptor.mjs +0 -43
- package/esm2022/lib/ui/services/notification.service.mjs +0 -50
- package/esm2022/lib/ui/state/core.actions.mjs +0 -49
- package/esm2022/lib/ui/state/core.state.mjs +0 -95
- package/esm2022/public-api.mjs +0 -34
|
Binary file
|
|
Binary file
|
|
@@ -120,10 +120,10 @@ class AuthService {
|
|
|
120
120
|
loginRoute() {
|
|
121
121
|
return routes.login(this.apiUrl);
|
|
122
122
|
}
|
|
123
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
124
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
123
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AuthService, deps: [{ token: i1.HttpClient }, { token: API_URL }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
124
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AuthService, providedIn: 'root' });
|
|
125
125
|
}
|
|
126
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
126
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AuthService, decorators: [{
|
|
127
127
|
type: Injectable,
|
|
128
128
|
args: [{
|
|
129
129
|
providedIn: 'root',
|
|
@@ -254,8 +254,8 @@ let AuthState = class AuthState {
|
|
|
254
254
|
}));
|
|
255
255
|
return ctx.getState();
|
|
256
256
|
}
|
|
257
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
258
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
257
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AuthState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
258
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AuthState });
|
|
259
259
|
};
|
|
260
260
|
__decorate([
|
|
261
261
|
Action([AppAction.CheckUserSession, AuthenticationGuardAction.CheckUserSession])
|
|
@@ -286,7 +286,7 @@ AuthState = AuthState_1 = __decorate([
|
|
|
286
286
|
defaults: initState$1,
|
|
287
287
|
})
|
|
288
288
|
], AuthState);
|
|
289
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AuthState, decorators: [{
|
|
290
290
|
type: Injectable
|
|
291
291
|
}], ctorParameters: () => [], propDecorators: { checkUserSession: [], logout: [], setRedirectUrl: [] } });
|
|
292
292
|
|
|
@@ -315,10 +315,10 @@ class HasPermissionDirective {
|
|
|
315
315
|
}
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
319
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
318
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: HasPermissionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
319
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.3", type: HasPermissionDirective, isStandalone: true, selector: "[cccHasPermission]", inputs: { cccHasPermission: "cccHasPermission" }, ngImport: i0 });
|
|
320
320
|
}
|
|
321
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: HasPermissionDirective, decorators: [{
|
|
322
322
|
type: Directive,
|
|
323
323
|
args: [{
|
|
324
324
|
selector: '[cccHasPermission]',
|
|
@@ -381,17 +381,17 @@ class CccInputFieldComponent {
|
|
|
381
381
|
return false;
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
385
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
384
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: CccInputFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
385
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.3", type: CccInputFieldComponent, isStandalone: true, selector: "ccc-input-field", inputs: { className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: true, transformFunction: null }, resource: { classPropertyName: "resource", publicName: "resource", isSignal: true, isRequired: true, transformFunction: null }, domain: { classPropertyName: "domain", publicName: "domain", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
386
386
|
<mat-form-field [class]="className()">
|
|
387
387
|
<mat-label>{{ name() }}</mat-label>
|
|
388
388
|
<input matInput [disabled]="mode() === inputMode.Edit && canEdit()" [value]="value()" />
|
|
389
389
|
</mat-form-field>
|
|
390
|
-
`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }] });
|
|
390
|
+
`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] });
|
|
391
391
|
}
|
|
392
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
392
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: CccInputFieldComponent, decorators: [{
|
|
393
393
|
type: Component,
|
|
394
|
-
args: [{ selector: 'ccc-input-field',
|
|
394
|
+
args: [{ selector: 'ccc-input-field', imports: [MatFormFieldModule, MatInputModule], template: `
|
|
395
395
|
<mat-form-field [class]="className()">
|
|
396
396
|
<mat-label>{{ name() }}</mat-label>
|
|
397
397
|
<input matInput [disabled]="mode() === inputMode.Edit && canEdit()" [value]="value()" />
|
|
@@ -519,10 +519,10 @@ class NotificationService {
|
|
|
519
519
|
updateNotification(updatedNotification) {
|
|
520
520
|
this._notifications.update((current) => current.map((notification) => notification.id === updatedNotification.id ? { ...notification, ...updatedNotification } : notification));
|
|
521
521
|
}
|
|
522
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
523
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
522
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
523
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NotificationService, providedIn: 'root' });
|
|
524
524
|
}
|
|
525
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
525
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NotificationService, decorators: [{
|
|
526
526
|
type: Injectable,
|
|
527
527
|
args: [{
|
|
528
528
|
providedIn: 'root',
|
|
@@ -546,12 +546,12 @@ class AlertComponent {
|
|
|
546
546
|
this.errors.dismissGlobalNotification(this.error);
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
550
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
549
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
550
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AlertComponent, isStandalone: true, selector: "ccc-alert", inputs: { error: "error" }, outputs: { dismiss: "dismiss" }, ngImport: i0, template: "<div class=\"alert\" [ngClass]=\"error.level\">\n <div class=\"message\">\n <span>{{ error.message }}</span>\n </div>\n <div class=\"alert-end\">\n @if (error.link) {\n <span [routerLink]=\"error.link\" class=\"link\">View</span>\n }\n <button (click)=\"dismissAlert()\" mat-icon-button aria-label=\"Close Alert\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n</div>\n", styles: [".alert{margin:auto;border:1px solid;max-width:450px;border-radius:5px;background-color:#d3d3d3;display:flex;flex-direction:row;align-items:center;justify-content:space-between}.message{padding-left:15px;max-width:400px;display:flex;justify-content:space-between}.alert-end{display:flex;flex-direction:row;align-items:center;gap:5px}.link{cursor:pointer}.link:hover{text-decoration:underline}.warn{border-color:red;background-color:#fff5f4}.accent{border-color:#dfb51d;background-color:#fff8e0}.success{border-color:#4caf50;background-color:#f0fff0}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
|
551
551
|
}
|
|
552
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
552
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AlertComponent, decorators: [{
|
|
553
553
|
type: Component,
|
|
554
|
-
args: [{ selector: 'ccc-alert',
|
|
554
|
+
args: [{ selector: 'ccc-alert', imports: [MatIconModule, MatButtonModule, CommonModule, RouterModule], template: "<div class=\"alert\" [ngClass]=\"error.level\">\n <div class=\"message\">\n <span>{{ error.message }}</span>\n </div>\n <div class=\"alert-end\">\n @if (error.link) {\n <span [routerLink]=\"error.link\" class=\"link\">View</span>\n }\n <button (click)=\"dismissAlert()\" mat-icon-button aria-label=\"Close Alert\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n</div>\n", styles: [".alert{margin:auto;border:1px solid;max-width:450px;border-radius:5px;background-color:#d3d3d3;display:flex;flex-direction:row;align-items:center;justify-content:space-between}.message{padding-left:15px;max-width:400px;display:flex;justify-content:space-between}.alert-end{display:flex;flex-direction:row;align-items:center;gap:5px}.link{cursor:pointer}.link:hover{text-decoration:underline}.warn{border-color:red;background-color:#fff5f4}.accent{border-color:#dfb51d;background-color:#fff8e0}.success{border-color:#4caf50;background-color:#f0fff0}\n"] }]
|
|
555
555
|
}], propDecorators: { error: [{
|
|
556
556
|
type: Input,
|
|
557
557
|
args: [{ required: true }]
|
|
@@ -608,8 +608,8 @@ let CoreState = class CoreState {
|
|
|
608
608
|
sidenavOpened: !ctx.getState().sidenavOpened,
|
|
609
609
|
}));
|
|
610
610
|
}
|
|
611
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
612
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
611
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: CoreState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
612
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: CoreState });
|
|
613
613
|
};
|
|
614
614
|
__decorate([
|
|
615
615
|
Action([AppAction.SetNavIdentifier])
|
|
@@ -641,7 +641,7 @@ CoreState = __decorate([
|
|
|
641
641
|
defaults: initState,
|
|
642
642
|
})
|
|
643
643
|
], CoreState);
|
|
644
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
644
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: CoreState, decorators: [{
|
|
645
645
|
type: Injectable
|
|
646
646
|
}], propDecorators: { setNavIdentifier: [], publishError: [], beginActivity: [], endActivity: [], toggleSidenav: [] } });
|
|
647
647
|
|
|
@@ -674,12 +674,12 @@ class SidenavComponent {
|
|
|
674
674
|
}
|
|
675
675
|
return this.navGroups[identifier];
|
|
676
676
|
}
|
|
677
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
678
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
677
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: SidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
678
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.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$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i2$2.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"] }] });
|
|
679
679
|
}
|
|
680
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
680
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: SidenavComponent, decorators: [{
|
|
681
681
|
type: Component,
|
|
682
|
-
args: [{ selector: 'ccc-sidenav',
|
|
682
|
+
args: [{ selector: 'ccc-sidenav', imports: [
|
|
683
683
|
MatIconModule,
|
|
684
684
|
RouterModule,
|
|
685
685
|
CommonModule,
|
|
@@ -719,10 +719,10 @@ class ApiInterceptor {
|
|
|
719
719
|
this.store.dispatch(new ApiInterceptorAction.EndActivity(request.method + ' ' + request.url));
|
|
720
720
|
}));
|
|
721
721
|
}
|
|
722
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
723
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
722
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ApiInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
723
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ApiInterceptor });
|
|
724
724
|
}
|
|
725
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
725
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ApiInterceptor, decorators: [{
|
|
726
726
|
type: Injectable
|
|
727
727
|
}] });
|
|
728
728
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cccteam-ccc-lib.mjs","sources":["../../../projects/ccc-lib/src/lib/types/base/tokens.ts","../../../projects/ccc-lib/src/lib/ui/state/core.actions.ts","../../../projects/ccc-lib/src/lib/auth/services/request-options.ts","../../../projects/ccc-lib/src/lib/auth/services/auth.service.ts","../../../projects/ccc-lib/src/lib/auth/state/auth.actions.ts","../../../projects/ccc-lib/src/lib/auth/state/auth.state.ts","../../../projects/ccc-lib/src/lib/auth/directives/has-permission.directive.ts","../../../projects/ccc-lib/src/lib/types/permissions.ts","../../../projects/ccc-lib/src/lib/auth/forms/ccc-field/ccc-field.component.ts","../../../projects/ccc-lib/src/lib/auth/forms/form-helpers.ts","../../../projects/ccc-lib/src/lib/auth/guards/authentication.guard.ts","../../../projects/ccc-lib/src/lib/auth/guards/authorization.guard.ts","../../../projects/ccc-lib/src/lib/types/notification-message.ts","../../../projects/ccc-lib/src/lib/ui/services/notification.service.ts","../../../projects/ccc-lib/src/lib/ui/components/alert/alert.component.ts","../../../projects/ccc-lib/src/lib/ui/components/alert/alert.component.html","../../../projects/ccc-lib/src/lib/ui/state/core.state.ts","../../../projects/ccc-lib/src/lib/ui/components/sidenav/sidenav.component.ts","../../../projects/ccc-lib/src/lib/ui/components/sidenav/sidenav.component.html","../../../projects/ccc-lib/src/lib/ui/interceptor/api.interceptor.ts","../../../projects/ccc-lib/src/public-api.ts","../../../projects/ccc-lib/src/cccteam-ccc-lib.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Domain, Permission, Resource } from '../permissions';\n\nexport const BASE_URL = new InjectionToken<string>('BASE_URL');\nexport const API_URL = new InjectionToken<string>('API_URL');\nexport const PERMISSION_REQUIRED = new InjectionToken<(resource: Resource, permission: Permission) => boolean>(\n 'PERMISSION_REQUIRED',\n);\n\nexport const AVAILABLE_PERMISSIONS = new InjectionToken<{\n Create: Permission;\n Delete: Permission;\n List: Permission;\n Read: Permission;\n Update: Permission;\n}>('AVAILABLE_PERMISSIONS');\nexport const AVAILABLE_DOMAINS = new InjectionToken<Record<string, Domain>[]>('AVAILABLE_DOMAINS');\n","/* eslint-disable @typescript-eslint/no-namespace */\n// no-namespace rule is disabled because action hygiene prevents import pollution\n\nimport { CreateNotificationMessage } from '../../types/notification-message';\n\nexport namespace ApiInterceptorAction {\n export class BeginActivity {\n static readonly type = '[ApiInterceptor] Add Loading Activity';\n constructor(public process: string) {}\n }\n export class EndActivity {\n static readonly type = '[ApiInterceptor] Remove Loading Activity';\n constructor(public process: string) {}\n }\n export class PublishError {\n static readonly type = '[ApiInterceptor] Publish Error';\n constructor(public message: CreateNotificationMessage) {}\n }\n export class SetRedirectUrl {\n static readonly type = '[ApiInterceptor] Set Redirect Url';\n constructor(public redirectUrl: string) {}\n }\n}\n\nexport namespace HeaderAction {\n export class ToggleSidenav {\n static readonly type = '[Header] Toggle Sidenav';\n }\n\n export class Logout {\n static readonly type = '[Header] User Logout';\n }\n}\n","import { HttpContext, HttpContextToken } from '@angular/common/http';\n\nexport interface CustomHttpRequestOptions {\n suppressGlobalError: boolean;\n}\n\nexport const CUSTOM_HTTP_REQUEST_OPTIONS = new HttpContextToken<CustomHttpRequestOptions>(() => ({\n suppressGlobalError: false,\n}));\n\nexport function errorOptions(suppressGlobalError: boolean | undefined): { context: HttpContext } {\n return {\n context: new HttpContext().set(CUSTOM_HTTP_REQUEST_OPTIONS, {\n suppressGlobalError: suppressGlobalError ?? false,\n }),\n };\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Inject, Injectable } from '@angular/core';\nimport { map, Observable } from 'rxjs';\nimport { API_URL } from '../../types/base/tokens';\nimport { SessionInfo } from '../../types/session-info';\nimport { errorOptions } from './request-options';\n\nconst routes = {\n login: (rootUrl: string): string => `${rootUrl}/user/login`,\n session: (rootUrl: string): string => `${rootUrl}/user/session`,\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AuthService {\n constructor(\n private http: HttpClient,\n @Inject(API_URL) private apiUrl: string,\n ) {}\n\n /**\n * Logs a user out.\n *\n * @returns Observable with a boolean indicating whether they were logged out.\n */\n logout(): Observable<boolean> {\n return this.http.delete(routes.session(this.apiUrl), errorOptions(false)).pipe(map(() => true));\n }\n\n /**\n * Checks a user's session with the server.\n *\n * @returns Observable with the user session info\n */\n checkUserSession(): Observable<SessionInfo | null> {\n return this.http.get<SessionInfo>(routes.session(this.apiUrl), errorOptions(false));\n }\n\n loginRoute(): string {\n return routes.login(this.apiUrl);\n }\n}\n","/* eslint-disable @typescript-eslint/no-namespace */\n// no-namespace rule is disabled because action hygiene prevents import pollution\n\nimport { CreateNotificationMessage } from '../../types/notification-message';\n\nexport namespace AuthenticationGuardAction {\n export class SetRedirectUrl {\n static readonly type = '[AuthenticationGuard] Set Redirect Url And Navigate To Login Page';\n constructor(public redirectUrl: string) {}\n }\n\n export class CheckUserSession {\n static readonly type = '[AuthenticationGuard] Check User Session';\n }\n}\n\nexport namespace LoginAction {\n export class Logout {\n static readonly type = '[Login] Auto Logout';\n }\n\n export class SetRedirectUrl {\n static readonly type = '[Login] Set Redirect Url';\n constructor(public redirectUrl: string) {}\n }\n\n export class PublishError {\n static readonly type = '[Login] Publish Error';\n constructor(public message: CreateNotificationMessage) {}\n }\n}\n\nexport namespace AppAction {\n export class CheckUserSession {\n static readonly type = '[App] Check User Session';\n }\n\n export class SetRedirectUrl {\n static readonly type = '[App] Set Redirect Url';\n constructor(public redirectUrl: string) {}\n }\n\n export class SetNavIdentifier {\n static readonly type = '[App] Set Nav Identifier';\n constructor(public identifier: string) {}\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { Action, Selector, State, StateContext } from '@ngxs/store';\nimport { patch } from '@ngxs/store/operators';\nimport { cloneDeep } from 'lodash-es';\nimport { Observable, tap } from 'rxjs';\nimport { PERMISSION_REQUIRED } from '../../types/base/tokens';\nimport { Permission, PermissionScope, Resource } from '../../types/permissions';\nimport { SessionInfo } from '../../types/session-info';\nimport { ApiInterceptorAction } from '../../ui/state/core.actions';\nimport { AuthService } from '../services/auth.service';\nimport { AppAction, AuthenticationGuardAction, LoginAction } from './auth.actions';\n\nexport interface AuthStateModel {\n authenticated: boolean;\n redirectUrl: string;\n sessionInfo: SessionInfo | null;\n}\n\nexport const initState: AuthStateModel = {\n authenticated: false,\n redirectUrl: '',\n sessionInfo: null,\n};\n\n@State<AuthStateModel>({\n name: 'authState',\n defaults: initState,\n})\n@Injectable()\nexport class AuthState {\n private authService = inject(AuthService);\n private static permissionFn: (resource: Resource, permission: Permission) => boolean;\n\n constructor() {\n AuthState.initializePermissionFn();\n }\n\n private static initializePermissionFn(): void {\n if (!AuthState.permissionFn) {\n AuthState.permissionFn = inject(PERMISSION_REQUIRED);\n }\n }\n\n @Selector()\n static hasPermission(state: AuthStateModel): (scope?: PermissionScope) => boolean {\n return (scope?: PermissionScope) => {\n if (!scope) return true;\n const resourcePermissions = state?.sessionInfo?.permissions?.[scope.domain]?.[scope.resource];\n return Array.isArray(resourcePermissions) && resourcePermissions.includes(scope.permission);\n };\n }\n\n static requiresPermission(resource: Resource, permission: Permission): boolean {\n if (!AuthState.permissionFn) {\n throw new Error(\n `AuthState has not been initialized. Ensure AuthState is provided in your module or instantiated at least once.`,\n );\n }\n return AuthState.permissionFn(resource, permission);\n }\n\n @Selector()\n static isAuthenticated(state: AuthStateModel): boolean {\n return state?.authenticated;\n }\n\n @Selector()\n static redirectUrl(state: AuthStateModel): string {\n return state?.redirectUrl;\n }\n\n @Action([AppAction.CheckUserSession, AuthenticationGuardAction.CheckUserSession])\n checkUserSession(ctx: StateContext<AuthStateModel>): Observable<SessionInfo | null> {\n return this.authService.checkUserSession().pipe(\n tap((result) =>\n ctx.setState(\n patch({\n authenticated: !!result?.authenticated,\n sessionInfo: result,\n }),\n ),\n ),\n );\n }\n\n @Action([LoginAction.Logout])\n logout(ctx: StateContext<AuthStateModel>): Observable<boolean> {\n const localStateCopy = cloneDeep(initState);\n localStateCopy.redirectUrl = ctx.getState().redirectUrl;\n return this.authService.logout().pipe(\n tap(() => {\n ctx.setState(localStateCopy);\n }),\n );\n }\n\n @Action([\n AppAction.SetRedirectUrl,\n LoginAction.SetRedirectUrl,\n AuthenticationGuardAction.SetRedirectUrl,\n ApiInterceptorAction.SetRedirectUrl,\n ])\n setRedirectUrl(ctx: StateContext<AuthStateModel>, action: { redirectUrl: string }): AuthStateModel {\n ctx.setState(\n patch({\n redirectUrl: action.redirectUrl,\n }),\n );\n return ctx.getState();\n }\n}\n","import { Directive, Input, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Store } from '@ngxs/store';\nimport { Subject, catchError, combineLatest, map, of } from 'rxjs';\nimport { PermissionScope } from '../../types/permissions';\nimport { AuthState } from '../state/auth.state';\n\n@Directive({\n selector: '[cccHasPermission]',\n standalone: true,\n})\nexport class HasPermissionDirective {\n private templateRef = inject(TemplateRef<unknown>);\n private viewContainer = inject(ViewContainerRef);\n private store = inject(Store);\n\n private scope = new Subject<PermissionScope>();\n\n @Input()\n set cccHasPermission(scope: PermissionScope) {\n this.scope.next(scope);\n }\n\n constructor() {\n combineLatest({\n permissionFn: this.store.select(AuthState.hasPermission),\n scope: this.scope.asObservable(),\n })\n .pipe(\n takeUntilDestroyed(),\n map(({ permissionFn, scope }) => (scope !== undefined ? permissionFn(scope) : true)),\n catchError(() => of(false)),\n )\n .subscribe((result) => {\n if (result) {\n if (!this.viewContainer.get(0)) {\n this.viewContainer.createEmbeddedView(this.templateRef);\n }\n } else {\n this.viewContainer.clear();\n }\n });\n }\n}\n","type Brand<K, T> = K & { __brand: T };\n\nexport type Permission = Brand<string, 'Permission'>;\nexport type Resource = Brand<string, 'Resource'>;\nexport type Domain = Brand<string, 'Domain'>;\nexport type DomainPermissions = Record<Domain, Record<Resource, Record<Permission, Permissions>>>;\n\nexport interface PermissionScope {\n resource: Resource;\n permission: Permission;\n domain: Domain;\n}\n\nexport const ReadPermission = 'Read' as Permission;\nexport const UpdatePermission = 'Update' as Permission;\n","import { Component, computed, inject, input, OnInit, signal, Signal } from '@angular/core';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { Store } from '@ngxs/store';\nimport { Domain, ReadPermission, Resource, UpdatePermission } from '../../../types/permissions';\nimport { AuthState } from '../../state/auth.state';\n\nexport enum InputMode {\n Read = 'read',\n Edit = 'edit',\n}\n\n@Component({\n selector: 'ccc-input-field',\n standalone: true,\n imports: [MatFormFieldModule, MatInputModule],\n template: `\n <mat-form-field [class]=\"className()\">\n <mat-label>{{ name() }}</mat-label>\n <input matInput [disabled]=\"mode() === inputMode.Edit && canEdit()\" [value]=\"value()\" />\n </mat-form-field>\n `,\n styleUrl: './ccc-field.component.scss',\n})\nexport class CccInputFieldComponent implements OnInit {\n store = inject(Store);\n className = input();\n mode = input.required<InputMode>();\n resource = input.required<Resource>();\n domain = input.required<Domain>();\n value = input.required();\n name = input.required<string>();\n\n inputMode = InputMode;\n\n canEdit: Signal<boolean> = signal(false);\n canEditSelector = false;\n\n canRead: Signal<boolean> = signal(false);\n canReadSelector = false;\n\n ngOnInit(): void {\n this.canEditSelector = this.store.selectSnapshot(AuthState.hasPermission)({\n resource: this.resource(),\n permission: ReadPermission,\n domain: this.domain(),\n });\n this.canReadSelector = this.store.selectSnapshot(AuthState.hasPermission)({\n resource: this.resource(),\n permission: UpdatePermission,\n domain: this.domain(),\n });\n\n this.canRead = computed(() => {\n const res = this.resource();\n if (!res) {\n return false;\n }\n if (AuthState.requiresPermission(this.resource(), ReadPermission)) {\n return this.canReadSelector;\n }\n return false;\n });\n\n this.canEdit = computed(() => {\n const res = this.resource();\n if (!res) {\n return false;\n }\n if (AuthState.requiresPermission(this.resource(), UpdatePermission)) {\n return this.canEditSelector;\n }\n return false;\n });\n }\n}\n","import { FormArray, FormGroup } from '@angular/forms';\nimport { isEqual } from 'lodash-es';\n\n/**\n * Accepts a FormGroup and compares it to an object to return the dirty form values\n * as a sparse object\n * @param form - FormGroup\n * @param compareData - object to compare form values against\n * @returns Partial<T>\n * @example sparseFormData<UserCreate>(this.userForm, initUser)\n */\nexport function sparseFormData<T>(form: FormGroup, compareData: T): T {\n const sparseFormData: T = {} as T;\n\n for (const [key, control] of Object.entries(form.controls)) {\n const controlValue = control.value;\n const compareValue = compareData[key as keyof T];\n\n if (!isEqual(controlValue, compareValue)) {\n sparseFormData[key as keyof T] = controlValue as T[keyof T];\n }\n }\n\n return sparseFormData;\n}\n\n/**\n * Accepts a FormArray and removes empty strings\n * @param formArray - FormArray\n * @returns FormArray\n */\nexport function cleanStringFormArray(formArray: FormArray): FormArray {\n for (let i = formArray.controls.length - 1; i >= 0; i--) {\n if (formArray.at(i).value === '') {\n formArray.removeAt(i);\n }\n }\n return formArray;\n}\n","import { inject } from '@angular/core';\nimport { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';\nimport { Store } from '@ngxs/store';\nimport { Observable, of } from 'rxjs';\nimport { catchError, map, switchMap } from 'rxjs/operators';\nimport { BASE_URL } from '../../types/base/tokens';\nimport { AuthService } from '../services/auth.service';\nimport { AuthenticationGuardAction } from '../state/auth.actions';\nimport { AuthState } from '../state/auth.state';\n\nexport const AuthenticationGuard = (\n route: ActivatedRouteSnapshot,\n routerState: RouterStateSnapshot,\n): Observable<boolean> => {\n const store = inject(Store);\n const authService = inject(AuthService);\n\n const baseUrl = inject(BASE_URL);\n\n const authenticate = (): void => {\n const url = routerState.url;\n const absoluteUrl = baseUrl + (!url.toString().startsWith('/') ? '/' + url : url);\n const encodedUrl = encodeURIComponent(absoluteUrl);\n window.location.href = `${authService.loginRoute()}?returnUrl=${encodedUrl}`;\n };\n\n return store.select(AuthState.isAuthenticated).pipe(\n switchMap((authenticated) => {\n if (authenticated) {\n return of(authenticated);\n }\n // Handle uninitialized state (ie Browser reload)\n return store.dispatch(AuthenticationGuardAction.CheckUserSession).pipe(\n switchMap(() => {\n return store.select(AuthState.isAuthenticated);\n }),\n );\n }),\n map((authenticated) => {\n if (authenticated) {\n return true;\n }\n\n authenticate();\n\n return false;\n }),\n catchError(() => {\n authenticate();\n\n return of(false);\n }),\n );\n};\n","import { inject } from '@angular/core';\nimport { ActivatedRouteSnapshot, Router } from '@angular/router';\nimport { Store } from '@ngxs/store';\nimport { map, Observable } from 'rxjs';\nimport { AuthState } from '../state/auth.state';\n\nexport const AuthorizationGuard = (route: ActivatedRouteSnapshot): Observable<boolean> => {\n const store = inject(Store);\n const router = inject(Router);\n return store.select(AuthState.hasPermission).pipe(\n map((permissionFn) => permissionFn(route.data['scope'])),\n map((hasPermission) => {\n if (hasPermission) {\n return true;\n }\n router.navigate(['/']);\n return false;\n }),\n );\n};\n","export enum AlertLevel {\n ERROR = 'warn',\n INFO = 'accent',\n SUCCESS = 'success',\n}\n\nexport interface CreateNotificationMessage {\n duration?: number;\n message: string;\n link: string;\n level: AlertLevel;\n}\n\nexport interface NotificationMessage {\n id: number;\n duration?: number;\n message: string;\n link: string;\n level: AlertLevel;\n}\n","import { Injectable, signal } from '@angular/core';\nimport { CreateNotificationMessage, NotificationMessage } from '../../types/notification-message';\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","import { CommonModule } from '@angular/common';\nimport { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { RouterModule } from '@angular/router';\nimport { NotificationMessage } from '../../../types/notification-message';\nimport { NotificationService } from '../../services/notification.service';\n\n@Component({\n selector: 'ccc-alert',\n templateUrl: './alert.component.html',\n styleUrls: ['./alert.component.scss'],\n standalone: true,\n imports: [MatIconModule, MatButtonModule, CommonModule, RouterModule],\n})\nexport class AlertComponent implements OnInit {\n @Input({ required: true }) error!: NotificationMessage;\n @Output() dismiss = new EventEmitter();\n\n errors = inject(NotificationService);\n ngOnInit(): void {\n if (this.error.duration === undefined) {\n this.error.duration = 30000;\n }\n\n setTimeout(() => {\n this.dismissAlert();\n }, this.error.duration);\n }\n\n dismissAlert(): void {\n if (this.error.id !== undefined) {\n this.errors.dismissGlobalNotification(this.error);\n }\n }\n}\n","<div class=\"alert\" [ngClass]=\"error.level\">\n <div class=\"message\">\n <span>{{ error.message }}</span>\n </div>\n <div class=\"alert-end\">\n @if (error.link) {\n <span [routerLink]=\"error.link\" class=\"link\">View</span>\n }\n <button (click)=\"dismissAlert()\" mat-icon-button aria-label=\"Close Alert\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n</div>\n","import { Injectable, inject } from '@angular/core';\nimport { Action, Selector, State, StateContext } from '@ngxs/store';\nimport { patch } from '@ngxs/store/operators';\nimport { AppAction, LoginAction } from '../../auth/state/auth.actions';\nimport { CreateNotificationMessage } from '../../types/notification-message';\nimport { NotificationService } from '../services/notification.service';\nimport { ApiInterceptorAction, HeaderAction } from './core.actions';\n\ninterface CoreStateModel {\n loading: string[];\n sidenavOpened: boolean;\n currentSidenavIdentifier: string;\n}\n\nconst initState: CoreStateModel = {\n loading: [],\n sidenavOpened: true,\n currentSidenavIdentifier: '',\n};\n\n@State<CoreStateModel>({\n name: 'coreState',\n defaults: initState,\n})\n@Injectable()\nexport class CoreState {\n private notifications = inject(NotificationService);\n\n @Selector()\n static sidenavOpened(state: CoreStateModel): boolean {\n return state?.sidenavOpened;\n }\n\n @Selector()\n static isLoading(state: CoreStateModel): boolean {\n return state.loading.length > 0;\n }\n\n @Selector()\n static currentSidenavIdentifier(state: CoreStateModel): string {\n return state.currentSidenavIdentifier;\n }\n\n @Action([AppAction.SetNavIdentifier])\n setNavIdentifier(ctx: StateContext<CoreStateModel>, action: AppAction.SetNavIdentifier): void {\n ctx.setState(\n patch({\n currentSidenavIdentifier: action.identifier,\n }),\n );\n }\n\n @Action([ApiInterceptorAction.PublishError, LoginAction.PublishError])\n publishError(ctx: StateContext<CoreStateModel>, action: { message: CreateNotificationMessage }): void {\n this.notifications.addGlobalNotification(action.message);\n }\n\n @Action([ApiInterceptorAction.BeginActivity])\n beginActivity(ctx: StateContext<CoreStateModel>, action: { process: string }): CoreStateModel {\n const state = ctx.getState();\n ctx.patchState({\n loading: [action.process, ...state.loading],\n });\n return ctx.getState();\n }\n\n @Action([ApiInterceptorAction.EndActivity])\n endActivity(ctx: StateContext<CoreStateModel>, action: { process: string }): CoreStateModel | null {\n const loading = ctx.getState().loading;\n // There can be multiple activities running with the same process signature\n const index = loading.findIndex((activity) => activity === action.process);\n if (index !== -1) {\n const newLoading = [...loading.slice(0, index), ...loading.slice(index + 1)];\n ctx.patchState({\n loading: newLoading,\n });\n return ctx.getState();\n }\n return null;\n }\n\n @Action([HeaderAction.ToggleSidenav])\n toggleSidenav(ctx: StateContext<CoreStateModel>): void {\n ctx.setState(\n patch({\n sidenavOpened: !ctx.getState().sidenavOpened,\n }),\n );\n }\n}\n","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 { Observable, tap } from 'rxjs';\nimport { HasPermissionDirective } from '../../../auth/directives/has-permission.directive';\nimport { PermissionScope } from '../../../types/permissions';\nimport { CoreState } from '../../state/core.state';\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 standalone: true,\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","import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\nimport { inject, Injectable, NgZone } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { Store } from '@ngxs/store';\nimport { catchError, finalize, Observable, throwError } from 'rxjs';\nimport { CUSTOM_HTTP_REQUEST_OPTIONS } from '../../auth/services/request-options';\nimport { BASE_URL } from '../../types/base/tokens';\nimport { AlertLevel } from '../../types/notification-message';\nimport { ApiInterceptorAction } from '../state/core.actions';\n\n@Injectable()\nexport class ApiInterceptor implements HttpInterceptor {\n private store = inject(Store);\n private router = inject(Router);\n private ngZone = inject(NgZone);\n private baseUrl = inject(BASE_URL);\n\n intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\n this.store.dispatch(new ApiInterceptorAction.BeginActivity(request.method + ' ' + request.url));\n\n return next.handle(request).pipe(\n catchError((error: HttpErrorResponse): Observable<HttpEvent<unknown>> => {\n if (error.status === 401) {\n this.ngZone.run(() => {\n this.store.dispatch(new ApiInterceptorAction.SetRedirectUrl(this.baseUrl + this.router.url));\n this.router.navigate(['/login']);\n });\n }\n if (!request.context.get(CUSTOM_HTTP_REQUEST_OPTIONS).suppressGlobalError) {\n const message = error.error?.message ?? error.message ?? error.error;\n this.store.dispatch(\n new ApiInterceptorAction.PublishError({\n message: message,\n level: AlertLevel.ERROR,\n link: '',\n }),\n );\n }\n\n return throwError(() => error);\n }),\n finalize(() => {\n this.store.dispatch(new ApiInterceptorAction.EndActivity(request.method + ' ' + request.url));\n }),\n );\n }\n}\n","/*\n * Public API Surface of ccc-lib\n */\n\n// Auth directives\nexport * from './lib/auth/directives/has-permission.directive';\n\n// Auth forms\nexport * from './lib/auth/forms/ccc-field/ccc-field.component';\nexport * from './lib/auth/forms/form-helpers';\n\n// Auth guards\nexport * from './lib/auth/guards/authentication.guard';\nexport * from './lib/auth/guards/authorization.guard';\n\n// Auth services\nexport * from './lib/auth/services/auth.service';\nexport * from './lib/auth/services/request-options';\n\n// Auth state\nexport * from './lib/auth/state/auth.actions';\nexport * from './lib/auth/state/auth.state';\n\n// Types tokens\nexport * from './lib/types/base/tokens';\n\n// Types\nexport * from './lib/types/notification-message';\nexport * from './lib/types/permissions';\nexport * from './lib/types/session-info';\n\n// Ui components\nexport * from './lib/ui/components/alert/alert.component';\nexport * from './lib/ui/components/sidenav/sidenav.component';\n\n// Ui interceptor\nexport * from './lib/ui/interceptor/api.interceptor';\n\n// Ui services\nexport * from './lib/ui/services/notification.service';\n\n// Ui state\nexport * from './lib/ui/state/core.actions';\nexport * from './lib/ui/state/core.state';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["initState","map","catchError","i2","i4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;MAGa,QAAQ,GAAG,IAAI,cAAc,CAAS,UAAU,EAAE;MAClD,OAAO,GAAG,IAAI,cAAc,CAAS,SAAS,EAAE;MAChD,mBAAmB,GAAG,IAAI,cAAc,CACnD,qBAAqB,EACrB;MAEW,qBAAqB,GAAG,IAAI,cAAc,CAMpD,uBAAuB,EAAE;MACf,iBAAiB,GAAG,IAAI,cAAc,CAA2B,mBAAmB;;AChBjG;AACA;AAIM,IAAW,qBAiBhB;AAjBD,CAAA,UAAiB,oBAAoB,EAAA;AACnC,IAAA,MAAa,aAAa,CAAA;AAEL,QAAA,OAAA,CAAA;AADnB,QAAA,OAAgB,IAAI,GAAG,uCAAuC,CAAC;AAC/D,QAAA,WAAA,CAAmB,OAAe,EAAA;YAAf,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;SAAI;;AAF3B,IAAA,oBAAA,CAAA,aAAa,gBAGzB,CAAA;AACD,IAAA,MAAa,WAAW,CAAA;AAEH,QAAA,OAAA,CAAA;AADnB,QAAA,OAAgB,IAAI,GAAG,0CAA0C,CAAC;AAClE,QAAA,WAAA,CAAmB,OAAe,EAAA;YAAf,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;SAAI;;AAF3B,IAAA,oBAAA,CAAA,WAAW,cAGvB,CAAA;AACD,IAAA,MAAa,YAAY,CAAA;AAEJ,QAAA,OAAA,CAAA;AADnB,QAAA,OAAgB,IAA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AAC,CACH,CAAC;KACH;uGAlCU,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;2GAAd,cAAc,EAAA,CAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;;;ACVX;;AAEG;AAEH;;ACJA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cccteam-ccc-lib.mjs","sources":["../../../projects/ccc-lib/src/lib/types/base/tokens.ts","../../../projects/ccc-lib/src/lib/ui/state/core.actions.ts","../../../projects/ccc-lib/src/lib/auth/services/request-options.ts","../../../projects/ccc-lib/src/lib/auth/services/auth.service.ts","../../../projects/ccc-lib/src/lib/auth/state/auth.actions.ts","../../../projects/ccc-lib/src/lib/auth/state/auth.state.ts","../../../projects/ccc-lib/src/lib/auth/directives/has-permission.directive.ts","../../../projects/ccc-lib/src/lib/types/permissions.ts","../../../projects/ccc-lib/src/lib/auth/forms/ccc-field/ccc-field.component.ts","../../../projects/ccc-lib/src/lib/auth/forms/form-helpers.ts","../../../projects/ccc-lib/src/lib/auth/guards/authentication.guard.ts","../../../projects/ccc-lib/src/lib/auth/guards/authorization.guard.ts","../../../projects/ccc-lib/src/lib/types/notification-message.ts","../../../projects/ccc-lib/src/lib/ui/services/notification.service.ts","../../../projects/ccc-lib/src/lib/ui/components/alert/alert.component.ts","../../../projects/ccc-lib/src/lib/ui/components/alert/alert.component.html","../../../projects/ccc-lib/src/lib/ui/state/core.state.ts","../../../projects/ccc-lib/src/lib/ui/components/sidenav/sidenav.component.ts","../../../projects/ccc-lib/src/lib/ui/components/sidenav/sidenav.component.html","../../../projects/ccc-lib/src/lib/ui/interceptor/api.interceptor.ts","../../../projects/ccc-lib/src/public-api.ts","../../../projects/ccc-lib/src/cccteam-ccc-lib.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Domain, Permission, Resource } from '../permissions';\n\nexport const BASE_URL = new InjectionToken<string>('BASE_URL');\nexport const API_URL = new InjectionToken<string>('API_URL');\nexport const PERMISSION_REQUIRED = new InjectionToken<(resource: Resource, permission: Permission) => boolean>(\n 'PERMISSION_REQUIRED',\n);\n\nexport const AVAILABLE_PERMISSIONS = new InjectionToken<{\n Create: Permission;\n Delete: Permission;\n List: Permission;\n Read: Permission;\n Update: Permission;\n}>('AVAILABLE_PERMISSIONS');\nexport const AVAILABLE_DOMAINS = new InjectionToken<Record<string, Domain>[]>('AVAILABLE_DOMAINS');\n","/* eslint-disable @typescript-eslint/no-namespace */\n// no-namespace rule is disabled because action hygiene prevents import pollution\n\nimport { CreateNotificationMessage } from '../../types/notification-message';\n\nexport namespace ApiInterceptorAction {\n export class BeginActivity {\n static readonly type = '[ApiInterceptor] Add Loading Activity';\n constructor(public process: string) {}\n }\n export class EndActivity {\n static readonly type = '[ApiInterceptor] Remove Loading Activity';\n constructor(public process: string) {}\n }\n export class PublishError {\n static readonly type = '[ApiInterceptor] Publish Error';\n constructor(public message: CreateNotificationMessage) {}\n }\n export class SetRedirectUrl {\n static readonly type = '[ApiInterceptor] Set Redirect Url';\n constructor(public redirectUrl: string) {}\n }\n}\n\nexport namespace HeaderAction {\n export class ToggleSidenav {\n static readonly type = '[Header] Toggle Sidenav';\n }\n\n export class Logout {\n static readonly type = '[Header] User Logout';\n }\n}\n","import { HttpContext, HttpContextToken } from '@angular/common/http';\n\nexport interface CustomHttpRequestOptions {\n suppressGlobalError: boolean;\n}\n\nexport const CUSTOM_HTTP_REQUEST_OPTIONS = new HttpContextToken<CustomHttpRequestOptions>(() => ({\n suppressGlobalError: false,\n}));\n\nexport function errorOptions(suppressGlobalError: boolean | undefined): { context: HttpContext } {\n return {\n context: new HttpContext().set(CUSTOM_HTTP_REQUEST_OPTIONS, {\n suppressGlobalError: suppressGlobalError ?? false,\n }),\n };\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Inject, Injectable } from '@angular/core';\nimport { map, Observable } from 'rxjs';\nimport { API_URL } from '../../types/base/tokens';\nimport { SessionInfo } from '../../types/session-info';\nimport { errorOptions } from './request-options';\n\nconst routes = {\n login: (rootUrl: string): string => `${rootUrl}/user/login`,\n session: (rootUrl: string): string => `${rootUrl}/user/session`,\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AuthService {\n constructor(\n private http: HttpClient,\n @Inject(API_URL) private apiUrl: string,\n ) {}\n\n /**\n * Logs a user out.\n *\n * @returns Observable with a boolean indicating whether they were logged out.\n */\n logout(): Observable<boolean> {\n return this.http.delete(routes.session(this.apiUrl), errorOptions(false)).pipe(map(() => true));\n }\n\n /**\n * Checks a user's session with the server.\n *\n * @returns Observable with the user session info\n */\n checkUserSession(): Observable<SessionInfo | null> {\n return this.http.get<SessionInfo>(routes.session(this.apiUrl), errorOptions(false));\n }\n\n loginRoute(): string {\n return routes.login(this.apiUrl);\n }\n}\n","/* eslint-disable @typescript-eslint/no-namespace */\n// no-namespace rule is disabled because action hygiene prevents import pollution\n\nimport { CreateNotificationMessage } from '../../types/notification-message';\n\nexport namespace AuthenticationGuardAction {\n export class SetRedirectUrl {\n static readonly type = '[AuthenticationGuard] Set Redirect Url And Navigate To Login Page';\n constructor(public redirectUrl: string) {}\n }\n\n export class CheckUserSession {\n static readonly type = '[AuthenticationGuard] Check User Session';\n }\n}\n\nexport namespace LoginAction {\n export class Logout {\n static readonly type = '[Login] Auto Logout';\n }\n\n export class SetRedirectUrl {\n static readonly type = '[Login] Set Redirect Url';\n constructor(public redirectUrl: string) {}\n }\n\n export class PublishError {\n static readonly type = '[Login] Publish Error';\n constructor(public message: CreateNotificationMessage) {}\n }\n}\n\nexport namespace AppAction {\n export class CheckUserSession {\n static readonly type = '[App] Check User Session';\n }\n\n export class SetRedirectUrl {\n static readonly type = '[App] Set Redirect Url';\n constructor(public redirectUrl: string) {}\n }\n\n export class SetNavIdentifier {\n static readonly type = '[App] Set Nav Identifier';\n constructor(public identifier: string) {}\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { Action, Selector, State, StateContext } from '@ngxs/store';\nimport { patch } from '@ngxs/store/operators';\nimport { cloneDeep } from 'lodash-es';\nimport { Observable, tap } from 'rxjs';\nimport { PERMISSION_REQUIRED } from '../../types/base/tokens';\nimport { Permission, PermissionScope, Resource } from '../../types/permissions';\nimport { SessionInfo } from '../../types/session-info';\nimport { ApiInterceptorAction } from '../../ui/state/core.actions';\nimport { AuthService } from '../services/auth.service';\nimport { AppAction, AuthenticationGuardAction, LoginAction } from './auth.actions';\n\nexport interface AuthStateModel {\n authenticated: boolean;\n redirectUrl: string;\n sessionInfo: SessionInfo | null;\n}\n\nexport const initState: AuthStateModel = {\n authenticated: false,\n redirectUrl: '',\n sessionInfo: null,\n};\n\n@State<AuthStateModel>({\n name: 'authState',\n defaults: initState,\n})\n@Injectable()\nexport class AuthState {\n private authService = inject(AuthService);\n private static permissionFn: (resource: Resource, permission: Permission) => boolean;\n\n constructor() {\n AuthState.initializePermissionFn();\n }\n\n private static initializePermissionFn(): void {\n if (!AuthState.permissionFn) {\n AuthState.permissionFn = inject(PERMISSION_REQUIRED);\n }\n }\n\n @Selector()\n static hasPermission(state: AuthStateModel): (scope?: PermissionScope) => boolean {\n return (scope?: PermissionScope) => {\n if (!scope) return true;\n const resourcePermissions = state?.sessionInfo?.permissions?.[scope.domain]?.[scope.resource];\n return Array.isArray(resourcePermissions) && resourcePermissions.includes(scope.permission);\n };\n }\n\n static requiresPermission(resource: Resource, permission: Permission): boolean {\n if (!AuthState.permissionFn) {\n throw new Error(\n `AuthState has not been initialized. Ensure AuthState is provided in your module or instantiated at least once.`,\n );\n }\n return AuthState.permissionFn(resource, permission);\n }\n\n @Selector()\n static isAuthenticated(state: AuthStateModel): boolean {\n return state?.authenticated;\n }\n\n @Selector()\n static redirectUrl(state: AuthStateModel): string {\n return state?.redirectUrl;\n }\n\n @Action([AppAction.CheckUserSession, AuthenticationGuardAction.CheckUserSession])\n checkUserSession(ctx: StateContext<AuthStateModel>): Observable<SessionInfo | null> {\n return this.authService.checkUserSession().pipe(\n tap((result) =>\n ctx.setState(\n patch({\n authenticated: !!result?.authenticated,\n sessionInfo: result,\n }),\n ),\n ),\n );\n }\n\n @Action([LoginAction.Logout])\n logout(ctx: StateContext<AuthStateModel>): Observable<boolean> {\n const localStateCopy = cloneDeep(initState);\n localStateCopy.redirectUrl = ctx.getState().redirectUrl;\n return this.authService.logout().pipe(\n tap(() => {\n ctx.setState(localStateCopy);\n }),\n );\n }\n\n @Action([\n AppAction.SetRedirectUrl,\n LoginAction.SetRedirectUrl,\n AuthenticationGuardAction.SetRedirectUrl,\n ApiInterceptorAction.SetRedirectUrl,\n ])\n setRedirectUrl(ctx: StateContext<AuthStateModel>, action: { redirectUrl: string }): AuthStateModel {\n ctx.setState(\n patch({\n redirectUrl: action.redirectUrl,\n }),\n );\n return ctx.getState();\n }\n}\n","import { Directive, Input, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Store } from '@ngxs/store';\nimport { Subject, catchError, combineLatest, map, of } from 'rxjs';\nimport { PermissionScope } from '../../types/permissions';\nimport { AuthState } from '../state/auth.state';\n\n@Directive({\n selector: '[cccHasPermission]',\n standalone: true,\n})\nexport class HasPermissionDirective {\n private templateRef = inject(TemplateRef<unknown>);\n private viewContainer = inject(ViewContainerRef);\n private store = inject(Store);\n\n private scope = new Subject<PermissionScope>();\n\n @Input()\n set cccHasPermission(scope: PermissionScope) {\n this.scope.next(scope);\n }\n\n constructor() {\n combineLatest({\n permissionFn: this.store.select(AuthState.hasPermission),\n scope: this.scope.asObservable(),\n })\n .pipe(\n takeUntilDestroyed(),\n map(({ permissionFn, scope }) => (scope !== undefined ? permissionFn(scope) : true)),\n catchError(() => of(false)),\n )\n .subscribe((result) => {\n if (result) {\n if (!this.viewContainer.get(0)) {\n this.viewContainer.createEmbeddedView(this.templateRef);\n }\n } else {\n this.viewContainer.clear();\n }\n });\n }\n}\n","type Brand<K, T> = K & { __brand: T };\n\nexport type Permission = Brand<string, 'Permission'>;\nexport type Resource = Brand<string, 'Resource'>;\nexport type Domain = Brand<string, 'Domain'>;\nexport type DomainPermissions = Record<Domain, Record<Resource, Record<Permission, Permissions>>>;\n\nexport interface PermissionScope {\n resource: Resource;\n permission: Permission;\n domain: Domain;\n}\n\nexport const ReadPermission = 'Read' as Permission;\nexport const UpdatePermission = 'Update' as Permission;\n","import { Component, computed, inject, input, OnInit, signal, Signal } from '@angular/core';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { Store } from '@ngxs/store';\nimport { Domain, ReadPermission, Resource, UpdatePermission } from '../../../types/permissions';\nimport { AuthState } from '../../state/auth.state';\n\nexport enum InputMode {\n Read = 'read',\n Edit = 'edit',\n}\n\n@Component({\n selector: 'ccc-input-field',\n imports: [MatFormFieldModule, MatInputModule],\n template: `\n <mat-form-field [class]=\"className()\">\n <mat-label>{{ name() }}</mat-label>\n <input matInput [disabled]=\"mode() === inputMode.Edit && canEdit()\" [value]=\"value()\" />\n </mat-form-field>\n `,\n styleUrl: './ccc-field.component.scss'\n})\nexport class CccInputFieldComponent implements OnInit {\n store = inject(Store);\n className = input();\n mode = input.required<InputMode>();\n resource = input.required<Resource>();\n domain = input.required<Domain>();\n value = input.required();\n name = input.required<string>();\n\n inputMode = InputMode;\n\n canEdit: Signal<boolean> = signal(false);\n canEditSelector = false;\n\n canRead: Signal<boolean> = signal(false);\n canReadSelector = false;\n\n ngOnInit(): void {\n this.canEditSelector = this.store.selectSnapshot(AuthState.hasPermission)({\n resource: this.resource(),\n permission: ReadPermission,\n domain: this.domain(),\n });\n this.canReadSelector = this.store.selectSnapshot(AuthState.hasPermission)({\n resource: this.resource(),\n permission: UpdatePermission,\n domain: this.domain(),\n });\n\n this.canRead = computed(() => {\n const res = this.resource();\n if (!res) {\n return false;\n }\n if (AuthState.requiresPermission(this.resource(), ReadPermission)) {\n return this.canReadSelector;\n }\n return false;\n });\n\n this.canEdit = computed(() => {\n const res = this.resource();\n if (!res) {\n return false;\n }\n if (AuthState.requiresPermission(this.resource(), UpdatePermission)) {\n return this.canEditSelector;\n }\n return false;\n });\n }\n}\n","import { FormArray, FormGroup } from '@angular/forms';\nimport { isEqual } from 'lodash-es';\n\n/**\n * Accepts a FormGroup and compares it to an object to return the dirty form values\n * as a sparse object\n * @param form - FormGroup\n * @param compareData - object to compare form values against\n * @returns Partial<T>\n * @example sparseFormData<UserCreate>(this.userForm, initUser)\n */\nexport function sparseFormData<T>(form: FormGroup, compareData: T): T {\n const sparseFormData: T = {} as T;\n\n for (const [key, control] of Object.entries(form.controls)) {\n const controlValue = control.value;\n const compareValue = compareData[key as keyof T];\n\n if (!isEqual(controlValue, compareValue)) {\n sparseFormData[key as keyof T] = controlValue as T[keyof T];\n }\n }\n\n return sparseFormData;\n}\n\n/**\n * Accepts a FormArray and removes empty strings\n * @param formArray - FormArray\n * @returns FormArray\n */\nexport function cleanStringFormArray(formArray: FormArray): FormArray {\n for (let i = formArray.controls.length - 1; i >= 0; i--) {\n if (formArray.at(i).value === '') {\n formArray.removeAt(i);\n }\n }\n return formArray;\n}\n","import { inject } from '@angular/core';\nimport { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';\nimport { Store } from '@ngxs/store';\nimport { Observable, of } from 'rxjs';\nimport { catchError, map, switchMap } from 'rxjs/operators';\nimport { BASE_URL } from '../../types/base/tokens';\nimport { AuthService } from '../services/auth.service';\nimport { AuthenticationGuardAction } from '../state/auth.actions';\nimport { AuthState } from '../state/auth.state';\n\nexport const AuthenticationGuard = (\n route: ActivatedRouteSnapshot,\n routerState: RouterStateSnapshot,\n): Observable<boolean> => {\n const store = inject(Store);\n const authService = inject(AuthService);\n\n const baseUrl = inject(BASE_URL);\n\n const authenticate = (): void => {\n const url = routerState.url;\n const absoluteUrl = baseUrl + (!url.toString().startsWith('/') ? '/' + url : url);\n const encodedUrl = encodeURIComponent(absoluteUrl);\n window.location.href = `${authService.loginRoute()}?returnUrl=${encodedUrl}`;\n };\n\n return store.select(AuthState.isAuthenticated).pipe(\n switchMap((authenticated) => {\n if (authenticated) {\n return of(authenticated);\n }\n // Handle uninitialized state (ie Browser reload)\n return store.dispatch(AuthenticationGuardAction.CheckUserSession).pipe(\n switchMap(() => {\n return store.select(AuthState.isAuthenticated);\n }),\n );\n }),\n map((authenticated) => {\n if (authenticated) {\n return true;\n }\n\n authenticate();\n\n return false;\n }),\n catchError(() => {\n authenticate();\n\n return of(false);\n }),\n );\n};\n","import { inject } from '@angular/core';\nimport { ActivatedRouteSnapshot, Router } from '@angular/router';\nimport { Store } from '@ngxs/store';\nimport { map, Observable } from 'rxjs';\nimport { AuthState } from '../state/auth.state';\n\nexport const AuthorizationGuard = (route: ActivatedRouteSnapshot): Observable<boolean> => {\n const store = inject(Store);\n const router = inject(Router);\n return store.select(AuthState.hasPermission).pipe(\n map((permissionFn) => permissionFn(route.data['scope'])),\n map((hasPermission) => {\n if (hasPermission) {\n return true;\n }\n router.navigate(['/']);\n return false;\n }),\n );\n};\n","export enum AlertLevel {\n ERROR = 'warn',\n INFO = 'accent',\n SUCCESS = 'success',\n}\n\nexport interface CreateNotificationMessage {\n duration?: number;\n message: string;\n link: string;\n level: AlertLevel;\n}\n\nexport interface NotificationMessage {\n id: number;\n duration?: number;\n message: string;\n link: string;\n level: AlertLevel;\n}\n","import { Injectable, signal } from '@angular/core';\nimport { CreateNotificationMessage, NotificationMessage } from '../../types/notification-message';\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","import { CommonModule } from '@angular/common';\nimport { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { RouterModule } from '@angular/router';\nimport { NotificationMessage } from '../../../types/notification-message';\nimport { NotificationService } from '../../services/notification.service';\n\n@Component({\n selector: 'ccc-alert',\n templateUrl: './alert.component.html',\n styleUrls: ['./alert.component.scss'],\n imports: [MatIconModule, MatButtonModule, CommonModule, RouterModule]\n})\nexport class AlertComponent implements OnInit {\n @Input({ required: true }) error!: NotificationMessage;\n @Output() dismiss = new EventEmitter();\n\n errors = inject(NotificationService);\n ngOnInit(): void {\n if (this.error.duration === undefined) {\n this.error.duration = 30000;\n }\n\n setTimeout(() => {\n this.dismissAlert();\n }, this.error.duration);\n }\n\n dismissAlert(): void {\n if (this.error.id !== undefined) {\n this.errors.dismissGlobalNotification(this.error);\n }\n }\n}\n","<div class=\"alert\" [ngClass]=\"error.level\">\n <div class=\"message\">\n <span>{{ error.message }}</span>\n </div>\n <div class=\"alert-end\">\n @if (error.link) {\n <span [routerLink]=\"error.link\" class=\"link\">View</span>\n }\n <button (click)=\"dismissAlert()\" mat-icon-button aria-label=\"Close Alert\">\n <mat-icon>close</mat-icon>\n </button>\n </div>\n</div>\n","import { Injectable, inject } from '@angular/core';\nimport { Action, Selector, State, StateContext } from '@ngxs/store';\nimport { patch } from '@ngxs/store/operators';\nimport { AppAction, LoginAction } from '../../auth/state/auth.actions';\nimport { CreateNotificationMessage } from '../../types/notification-message';\nimport { NotificationService } from '../services/notification.service';\nimport { ApiInterceptorAction, HeaderAction } from './core.actions';\n\ninterface CoreStateModel {\n loading: string[];\n sidenavOpened: boolean;\n currentSidenavIdentifier: string;\n}\n\nconst initState: CoreStateModel = {\n loading: [],\n sidenavOpened: true,\n currentSidenavIdentifier: '',\n};\n\n@State<CoreStateModel>({\n name: 'coreState',\n defaults: initState,\n})\n@Injectable()\nexport class CoreState {\n private notifications = inject(NotificationService);\n\n @Selector()\n static sidenavOpened(state: CoreStateModel): boolean {\n return state?.sidenavOpened;\n }\n\n @Selector()\n static isLoading(state: CoreStateModel): boolean {\n return state.loading.length > 0;\n }\n\n @Selector()\n static currentSidenavIdentifier(state: CoreStateModel): string {\n return state.currentSidenavIdentifier;\n }\n\n @Action([AppAction.SetNavIdentifier])\n setNavIdentifier(ctx: StateContext<CoreStateModel>, action: AppAction.SetNavIdentifier): void {\n ctx.setState(\n patch({\n currentSidenavIdentifier: action.identifier,\n }),\n );\n }\n\n @Action([ApiInterceptorAction.PublishError, LoginAction.PublishError])\n publishError(ctx: StateContext<CoreStateModel>, action: { message: CreateNotificationMessage }): void {\n this.notifications.addGlobalNotification(action.message);\n }\n\n @Action([ApiInterceptorAction.BeginActivity])\n beginActivity(ctx: StateContext<CoreStateModel>, action: { process: string }): CoreStateModel {\n const state = ctx.getState();\n ctx.patchState({\n loading: [action.process, ...state.loading],\n });\n return ctx.getState();\n }\n\n @Action([ApiInterceptorAction.EndActivity])\n endActivity(ctx: StateContext<CoreStateModel>, action: { process: string }): CoreStateModel | null {\n const loading = ctx.getState().loading;\n // There can be multiple activities running with the same process signature\n const index = loading.findIndex((activity) => activity === action.process);\n if (index !== -1) {\n const newLoading = [...loading.slice(0, index), ...loading.slice(index + 1)];\n ctx.patchState({\n loading: newLoading,\n });\n return ctx.getState();\n }\n return null;\n }\n\n @Action([HeaderAction.ToggleSidenav])\n toggleSidenav(ctx: StateContext<CoreStateModel>): void {\n ctx.setState(\n patch({\n sidenavOpened: !ctx.getState().sidenavOpened,\n }),\n );\n }\n}\n","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 { Observable, tap } from 'rxjs';\nimport { HasPermissionDirective } from '../../../auth/directives/has-permission.directive';\nimport { PermissionScope } from '../../../types/permissions';\nimport { CoreState } from '../../state/core.state';\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","import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\nimport { inject, Injectable, NgZone } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { Store } from '@ngxs/store';\nimport { catchError, finalize, Observable, throwError } from 'rxjs';\nimport { CUSTOM_HTTP_REQUEST_OPTIONS } from '../../auth/services/request-options';\nimport { BASE_URL } from '../../types/base/tokens';\nimport { AlertLevel } from '../../types/notification-message';\nimport { ApiInterceptorAction } from '../state/core.actions';\n\n@Injectable()\nexport class ApiInterceptor implements HttpInterceptor {\n private store = inject(Store);\n private router = inject(Router);\n private ngZone = inject(NgZone);\n private baseUrl = inject(BASE_URL);\n\n intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\n this.store.dispatch(new ApiInterceptorAction.BeginActivity(request.method + ' ' + request.url));\n\n return next.handle(request).pipe(\n catchError((error: HttpErrorResponse): Observable<HttpEvent<unknown>> => {\n if (error.status === 401) {\n this.ngZone.run(() => {\n this.store.dispatch(new ApiInterceptorAction.SetRedirectUrl(this.baseUrl + this.router.url));\n this.router.navigate(['/login']);\n });\n }\n if (!request.context.get(CUSTOM_HTTP_REQUEST_OPTIONS).suppressGlobalError) {\n const message = error.error?.message ?? error.message ?? error.error;\n this.store.dispatch(\n new ApiInterceptorAction.PublishError({\n message: message,\n level: AlertLevel.ERROR,\n link: '',\n }),\n );\n }\n\n return throwError(() => error);\n }),\n finalize(() => {\n this.store.dispatch(new ApiInterceptorAction.EndActivity(request.method + ' ' + request.url));\n }),\n );\n }\n}\n","/*\n * Public API Surface of ccc-lib\n */\n\n// Auth directives\nexport * from './lib/auth/directives/has-permission.directive';\n\n// Auth forms\nexport * from './lib/auth/forms/ccc-field/ccc-field.component';\nexport * from './lib/auth/forms/form-helpers';\n\n// Auth guards\nexport * from './lib/auth/guards/authentication.guard';\nexport * from './lib/auth/guards/authorization.guard';\n\n// Auth services\nexport * from './lib/auth/services/auth.service';\nexport * from './lib/auth/services/request-options';\n\n// Auth state\nexport * from './lib/auth/state/auth.actions';\nexport * from './lib/auth/state/auth.state';\n\n// Types tokens\nexport * from './lib/types/base/tokens';\n\n// Types\nexport * from './lib/types/notification-message';\nexport * from './lib/types/permissions';\nexport * from './lib/types/session-info';\n\n// Ui components\nexport * from './lib/ui/components/alert/alert.component';\nexport * from './lib/ui/components/sidenav/sidenav.component';\n\n// Ui interceptor\nexport * from './lib/ui/interceptor/api.interceptor';\n\n// Ui services\nexport * from './lib/ui/services/notification.service';\n\n// Ui state\nexport * from './lib/ui/state/core.actions';\nexport * from './lib/ui/state/core.state';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["initState","map","catchError","i2","i4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;MAGa,QAAQ,GAAG,IAAI,cAAc,CAAS,UAAU;MAChD,OAAO,GAAG,IAAI,cAAc,CAAS,SAAS;MAC9C,mBAAmB,GAAG,IAAI,cAAc,CACnD,qBAAqB;MAGV,qBAAqB,GAAG,IAAI,cAAc,CAMpD,uBAAuB;MACb,iBAAiB,GAAG,IAAI,cAAc,CAA2B,mBAAmB;;AChBjG;AACA;AAIM,IAAW;AAAjB,CAAA,UAAiB,oBAAoB,EAAA;AACnC,IAAA,MAAa,aAAa,CAAA;AAEL,QAAA,OAAA;AADnB,QAAA,OAAgB,IAAI,GAAG,uCAAuC;AAC9D,QAAA,WAAA,CAAmB,OAAe,EAAA;YAAf,IAAO,CAAA,OAAA,GAAP,OAAO;;;AAFf,IAAA,oBAAA,CAAA,aAAa,gBAGzB;AACD,IAAA,MAAa,WAAW,CAAA;AAEH,QAAA,OAAA;AADnB,QAAA,OAAgB,IAAI,GAAG,0CAA0C;AACjE,QAAA,WAAA,CAAmB,OAA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c-lib.git"
|
|
7
7
|
},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@angular/common": "^
|
|
10
|
-
"@angular/core": "^
|
|
9
|
+
"@angular/common": "^19.0.2",
|
|
10
|
+
"@angular/core": "^19.0.2"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"tslib": "^2.3.0"
|
|
@@ -21,9 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
".": {
|
|
23
23
|
"types": "./index.d.ts",
|
|
24
|
-
"esm2022": "./esm2022/cccteam-ccc-lib.mjs",
|
|
25
|
-
"esm": "./esm2022/cccteam-ccc-lib.mjs",
|
|
26
24
|
"default": "./fesm2022/cccteam-ccc-lib.mjs"
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
|
-
}
|
|
27
|
+
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './public-api';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2NjdGVhbS1jY2MtbGliLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvY2NjLWxpYi9zcmMvY2NjdGVhbS1jY2MtbGliLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljLWFwaSc7XG4iXX0=
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Directive, Input, TemplateRef, ViewContainerRef, inject } from '@angular/core';
|
|
2
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
3
|
-
import { Store } from '@ngxs/store';
|
|
4
|
-
import { Subject, catchError, combineLatest, map, of } from 'rxjs';
|
|
5
|
-
import { AuthState } from '../state/auth.state';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export class HasPermissionDirective {
|
|
8
|
-
templateRef = inject((TemplateRef));
|
|
9
|
-
viewContainer = inject(ViewContainerRef);
|
|
10
|
-
store = inject(Store);
|
|
11
|
-
scope = new Subject();
|
|
12
|
-
set cccHasPermission(scope) {
|
|
13
|
-
this.scope.next(scope);
|
|
14
|
-
}
|
|
15
|
-
constructor() {
|
|
16
|
-
combineLatest({
|
|
17
|
-
permissionFn: this.store.select(AuthState.hasPermission),
|
|
18
|
-
scope: this.scope.asObservable(),
|
|
19
|
-
})
|
|
20
|
-
.pipe(takeUntilDestroyed(), map(({ permissionFn, scope }) => (scope !== undefined ? permissionFn(scope) : true)), catchError(() => of(false)))
|
|
21
|
-
.subscribe((result) => {
|
|
22
|
-
if (result) {
|
|
23
|
-
if (!this.viewContainer.get(0)) {
|
|
24
|
-
this.viewContainer.createEmbeddedView(this.templateRef);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
this.viewContainer.clear();
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: HasPermissionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
33
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.7", type: HasPermissionDirective, isStandalone: true, selector: "[cccHasPermission]", inputs: { cccHasPermission: "cccHasPermission" }, ngImport: i0 });
|
|
34
|
-
}
|
|
35
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: HasPermissionDirective, decorators: [{
|
|
36
|
-
type: Directive,
|
|
37
|
-
args: [{
|
|
38
|
-
selector: '[cccHasPermission]',
|
|
39
|
-
standalone: true,
|
|
40
|
-
}]
|
|
41
|
-
}], ctorParameters: () => [], propDecorators: { cccHasPermission: [{
|
|
42
|
-
type: Input
|
|
43
|
-
}] } });
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFzLXBlcm1pc3Npb24uZGlyZWN0aXZlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NjLWxpYi9zcmMvbGliL2F1dGgvZGlyZWN0aXZlcy9oYXMtcGVybWlzc2lvbi5kaXJlY3RpdmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUsV0FBVyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN4RixPQUFPLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUNoRSxPQUFPLEVBQUUsS0FBSyxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBQ3BDLE9BQU8sRUFBRSxPQUFPLEVBQUUsVUFBVSxFQUFFLGFBQWEsRUFBRSxHQUFHLEVBQUUsRUFBRSxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBRW5FLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQzs7QUFNaEQsTUFBTSxPQUFPLHNCQUFzQjtJQUN6QixXQUFXLEdBQUcsTUFBTSxDQUFDLENBQUEsV0FBb0IsQ0FBQSxDQUFDLENBQUM7SUFDM0MsYUFBYSxHQUFHLE1BQU0sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDO0lBQ3pDLEtBQUssR0FBRyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUM7SUFFdEIsS0FBSyxHQUFHLElBQUksT0FBTyxFQUFtQixDQU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