@kuzntsv/uikit 0.21.32 → 0.21.33

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.
@@ -1844,45 +1844,18 @@ var DialogAction;
1844
1844
  })(DialogAction || (DialogAction = {}));
1845
1845
 
1846
1846
  class NavBarComponent extends BaseNavBarMenuClass {
1847
- loggedIn$;
1848
- roles$;
1849
- fioUser = '';
1850
- photoURL = '';
1851
- authService = inject(AuthService);
1852
- userService = inject(UserService);
1853
- avatarService = inject(AvatarService);
1847
+ visibleOnLogout = input(false, ...(ngDevMode ? [{ debugName: "visibleOnLogout" }] : []));
1848
+ loggedIn = input(false, ...(ngDevMode ? [{ debugName: "loggedIn" }] : []));
1849
+ fioUser = input('', ...(ngDevMode ? [{ debugName: "fioUser" }] : []));
1850
+ roles = input([], ...(ngDevMode ? [{ debugName: "roles" }] : []));
1851
+ photoURL = input('', ...(ngDevMode ? [{ debugName: "photoURL" }] : []));
1852
+ logout = output();
1854
1853
  dialog = inject(MatDialog);
1855
1854
  constructor() {
1856
1855
  super();
1857
- this.loggedIn$ = this.authService.loggedIn$;
1858
- this.roles$ = this.authService.roles$;
1859
- this.fioUser = '';
1860
- const subs = this.loggedIn$.subscribe({
1861
- next: (value) => {
1862
- if (value) {
1863
- if (this.userService.userData) {
1864
- if (this.userService.userData.lastName && this.userService.userData.firstName) {
1865
- this.fioUser = this.userService.userData.lastName + ' ' + this.userService.userData.firstName;
1866
- }
1867
- if (this.userService.userData.idHuman) {
1868
- // Аватар сотрудника.
1869
- const subs2 = this.avatarService.getAvatarById(Number(this.userService.userData.idHuman))
1870
- .subscribe((image) => {
1871
- if (image) {
1872
- const blob = new Blob([image], { "type": "image/jpeg" });
1873
- this.photoURL = URL.createObjectURL(blob);
1874
- }
1875
- });
1876
- this.subscription.add(subs2);
1877
- }
1878
- }
1879
- }
1880
- }
1881
- });
1882
- this.subscription.add(subs);
1883
1856
  }
1884
- logout() {
1885
- this.authService.logout(this.router.url);
1857
+ onLogout() {
1858
+ this.logout.emit(this.router.url);
1886
1859
  }
1887
1860
  openDialog() {
1888
1861
  const dialogRef = this.dialog.open(DialogComponent, {
@@ -1897,19 +1870,18 @@ class NavBarComponent extends BaseNavBarMenuClass {
1897
1870
  });
1898
1871
  const subs = dialogRef.afterClosed().subscribe((id) => {
1899
1872
  if (id) {
1900
- this.logout();
1873
+ this.onLogout();
1901
1874
  }
1902
1875
  });
1903
1876
  this.subscription.add(subs);
1904
1877
  }
1905
1878
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NavBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1906
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: NavBarComponent, isStandalone: true, selector: "ngx-uik-navbar", usesInheritance: true, ngImport: i0, template: "@if (loggedIn$ | async) {\r\n <nav class=\"ngx-uik-navbar-header\">\r\n \r\n <ng-content></ng-content>\r\n\r\n <div class=\"flex-spacer\"></div>\r\n \r\n @if ((loggedIn$ | async) === false || !photoURL) {\r\n <mat-icon [matTooltip]=\"(roles$ | async)?.join(',')||''\">account_circle</mat-icon>\r\n }\r\n @if ((loggedIn$ | async) && photoURL) {\r\n <img\r\n class=\"user-photo\"\r\n [src]=\"photoURL | safe\"\r\n loading=\"lazy\"\r\n [alt]=\"fioUser\"\r\n [matTooltip]=\"(roles$ | async)?.join(',')||''\">\r\n }\r\n\r\n <span class = \"user-name\" [matTooltip]=\"(roles$ | async)?.join(',') || ''\">\r\n {{ fioUser }}\r\n </span>\r\n\r\n <a mat-button class=\"pm-button\" (click)=\"openDialog()\">\u0412\u044B\u0439\u0442\u0438 <mat-icon>logout</mat-icon></a>\r\n </nav>\r\n}", styles: [".ngx-uik-navbar-header{display:flex;flex-wrap:wrap;align-items:center;padding:8px 16px}.flex-spacer{flex-grow:1}.user-name{margin-left:8px;line-height:1rem;white-space:normal}.user-photo{border-radius:50%;width:32px;height:32px;margin-right:10px}.mat-mdc-button{color:#fff!important;padding-left:16px!important;padding-right:16px!important}.mdc-button{letter-spacing:normal}\n"], dependencies: [{ kind: "component", type: MatAnchor, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: SafePipe, name: "safe" }] });
1879
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: NavBarComponent, isStandalone: true, selector: "ngx-uik-navbar", inputs: { visibleOnLogout: { classPropertyName: "visibleOnLogout", publicName: "visibleOnLogout", isSignal: true, isRequired: false, transformFunction: null }, loggedIn: { classPropertyName: "loggedIn", publicName: "loggedIn", isSignal: true, isRequired: false, transformFunction: null }, fioUser: { classPropertyName: "fioUser", publicName: "fioUser", isSignal: true, isRequired: false, transformFunction: null }, roles: { classPropertyName: "roles", publicName: "roles", isSignal: true, isRequired: false, transformFunction: null }, photoURL: { classPropertyName: "photoURL", publicName: "photoURL", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { logout: "logout" }, usesInheritance: true, ngImport: i0, template: "@if (visibleOnLogout() || loggedIn()) {\r\n <nav class=\"ngx-uik-navbar-header\">\r\n \r\n <ng-content></ng-content>\r\n\r\n <div class=\"flex-spacer\"></div>\r\n \r\n @if (loggedIn() === false || !photoURL) {\r\n <mat-icon [matTooltip]=\"(roles())?.join(',')||''\">account_circle</mat-icon>\r\n }\r\n @if (loggedIn() && photoURL()) {\r\n <img\r\n class=\"user-photo\"\r\n [src]=\"photoURL() | safe\"\r\n loading=\"lazy\"\r\n [alt]=\"fioUser()\"\r\n [matTooltip]=\"(roles())?.join(',')||''\">\r\n }\r\n\r\n <span class = \"user-name\" [matTooltip]=\"(roles())?.join(',') || ''\">\r\n {{ fioUser() }}\r\n </span>\r\n\r\n <a mat-button class=\"pm-button\" (click)=\"openDialog()\">\u0412\u044B\u0439\u0442\u0438 <mat-icon>logout</mat-icon></a>\r\n </nav>\r\n}", styles: [".ngx-uik-navbar-header{display:flex;flex-wrap:wrap;align-items:center;padding:8px 16px}.flex-spacer{flex-grow:1}.user-name{margin-left:8px;line-height:1rem;white-space:normal}.user-photo{border-radius:50%;width:32px;height:32px;margin-right:10px}.mat-mdc-button{color:#fff!important;padding-left:16px!important;padding-right:16px!important}.mdc-button{letter-spacing:normal}\n"], dependencies: [{ kind: "component", type: MatAnchor, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: SafePipe, name: "safe" }] });
1907
1880
  }
1908
1881
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NavBarComponent, decorators: [{
1909
1882
  type: Component,
1910
- args: [{ selector: 'ngx-uik-navbar', imports: [MatAnchor, MatIcon, MatTooltip,
1911
- AsyncPipe, SafePipe], template: "@if (loggedIn$ | async) {\r\n <nav class=\"ngx-uik-navbar-header\">\r\n \r\n <ng-content></ng-content>\r\n\r\n <div class=\"flex-spacer\"></div>\r\n \r\n @if ((loggedIn$ | async) === false || !photoURL) {\r\n <mat-icon [matTooltip]=\"(roles$ | async)?.join(',')||''\">account_circle</mat-icon>\r\n }\r\n @if ((loggedIn$ | async) && photoURL) {\r\n <img\r\n class=\"user-photo\"\r\n [src]=\"photoURL | safe\"\r\n loading=\"lazy\"\r\n [alt]=\"fioUser\"\r\n [matTooltip]=\"(roles$ | async)?.join(',')||''\">\r\n }\r\n\r\n <span class = \"user-name\" [matTooltip]=\"(roles$ | async)?.join(',') || ''\">\r\n {{ fioUser }}\r\n </span>\r\n\r\n <a mat-button class=\"pm-button\" (click)=\"openDialog()\">\u0412\u044B\u0439\u0442\u0438 <mat-icon>logout</mat-icon></a>\r\n </nav>\r\n}", styles: [".ngx-uik-navbar-header{display:flex;flex-wrap:wrap;align-items:center;padding:8px 16px}.flex-spacer{flex-grow:1}.user-name{margin-left:8px;line-height:1rem;white-space:normal}.user-photo{border-radius:50%;width:32px;height:32px;margin-right:10px}.mat-mdc-button{color:#fff!important;padding-left:16px!important;padding-right:16px!important}.mdc-button{letter-spacing:normal}\n"] }]
1912
- }], ctorParameters: () => [] });
1883
+ args: [{ selector: 'ngx-uik-navbar', imports: [MatAnchor, MatIcon, MatTooltip, SafePipe], template: "@if (visibleOnLogout() || loggedIn()) {\r\n <nav class=\"ngx-uik-navbar-header\">\r\n \r\n <ng-content></ng-content>\r\n\r\n <div class=\"flex-spacer\"></div>\r\n \r\n @if (loggedIn() === false || !photoURL) {\r\n <mat-icon [matTooltip]=\"(roles())?.join(',')||''\">account_circle</mat-icon>\r\n }\r\n @if (loggedIn() && photoURL()) {\r\n <img\r\n class=\"user-photo\"\r\n [src]=\"photoURL() | safe\"\r\n loading=\"lazy\"\r\n [alt]=\"fioUser()\"\r\n [matTooltip]=\"(roles())?.join(',')||''\">\r\n }\r\n\r\n <span class = \"user-name\" [matTooltip]=\"(roles())?.join(',') || ''\">\r\n {{ fioUser() }}\r\n </span>\r\n\r\n <a mat-button class=\"pm-button\" (click)=\"openDialog()\">\u0412\u044B\u0439\u0442\u0438 <mat-icon>logout</mat-icon></a>\r\n </nav>\r\n}", styles: [".ngx-uik-navbar-header{display:flex;flex-wrap:wrap;align-items:center;padding:8px 16px}.flex-spacer{flex-grow:1}.user-name{margin-left:8px;line-height:1rem;white-space:normal}.user-photo{border-radius:50%;width:32px;height:32px;margin-right:10px}.mat-mdc-button{color:#fff!important;padding-left:16px!important;padding-right:16px!important}.mdc-button{letter-spacing:normal}\n"] }]
1884
+ }], ctorParameters: () => [], propDecorators: { visibleOnLogout: [{ type: i0.Input, args: [{ isSignal: true, alias: "visibleOnLogout", required: false }] }], loggedIn: [{ type: i0.Input, args: [{ isSignal: true, alias: "loggedIn", required: false }] }], fioUser: [{ type: i0.Input, args: [{ isSignal: true, alias: "fioUser", required: false }] }], roles: [{ type: i0.Input, args: [{ isSignal: true, alias: "roles", required: false }] }], photoURL: [{ type: i0.Input, args: [{ isSignal: true, alias: "photoURL", required: false }] }], logout: [{ type: i0.Output, args: ["logout"] }] } });
1913
1885
 
1914
1886
  class NotFoundComponent {
1915
1887
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NotFoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });