@kuzntsv/uikit 0.21.32 → 0.21.34
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,28 @@ var DialogAction;
|
|
|
1844
1844
|
})(DialogAction || (DialogAction = {}));
|
|
1845
1845
|
|
|
1846
1846
|
class NavBarComponent extends BaseNavBarMenuClass {
|
|
1847
|
-
loggedIn
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1847
|
+
/** Видимость панели, когда loggedIn === false. */
|
|
1848
|
+
visibleOnLogout = input(false, ...(ngDevMode ? [{ debugName: "visibleOnLogout" }] : []));
|
|
1849
|
+
/** Видимость аватара. */
|
|
1850
|
+
visibleAvatar = input(false, ...(ngDevMode ? [{ debugName: "visibleAvatar" }] : []));
|
|
1851
|
+
/** Видимость кнопки "Выйти". */
|
|
1852
|
+
visibleLogoutBtn = input(false, ...(ngDevMode ? [{ debugName: "visibleLogoutBtn" }] : []));
|
|
1853
|
+
/** Признак, что пользователь авторизован. */
|
|
1854
|
+
loggedIn = input(false, ...(ngDevMode ? [{ debugName: "loggedIn" }] : []));
|
|
1855
|
+
/** ФИО пользователя. */
|
|
1856
|
+
fioUser = input('', ...(ngDevMode ? [{ debugName: "fioUser" }] : []));
|
|
1857
|
+
/** Всплывающая подсказка о пользователе. */
|
|
1858
|
+
userTooltip = input([], ...(ngDevMode ? [{ debugName: "userTooltip" }] : []));
|
|
1859
|
+
/** URL аватара */
|
|
1860
|
+
avatarURL = input('', ...(ngDevMode ? [{ debugName: "avatarURL" }] : []));
|
|
1861
|
+
/** Нажата кнопка "Выйти". */
|
|
1862
|
+
logout = output();
|
|
1854
1863
|
dialog = inject(MatDialog);
|
|
1855
1864
|
constructor() {
|
|
1856
1865
|
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
1866
|
}
|
|
1884
|
-
|
|
1885
|
-
this.
|
|
1867
|
+
onLogout() {
|
|
1868
|
+
this.logout.emit(this.router.url);
|
|
1886
1869
|
}
|
|
1887
1870
|
openDialog() {
|
|
1888
1871
|
const dialogRef = this.dialog.open(DialogComponent, {
|
|
@@ -1897,19 +1880,18 @@ class NavBarComponent extends BaseNavBarMenuClass {
|
|
|
1897
1880
|
});
|
|
1898
1881
|
const subs = dialogRef.afterClosed().subscribe((id) => {
|
|
1899
1882
|
if (id) {
|
|
1900
|
-
this.
|
|
1883
|
+
this.onLogout();
|
|
1901
1884
|
}
|
|
1902
1885
|
});
|
|
1903
1886
|
this.subscription.add(subs);
|
|
1904
1887
|
}
|
|
1905
1888
|
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 (
|
|
1889
|
+
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 }, visibleAvatar: { classPropertyName: "visibleAvatar", publicName: "visibleAvatar", isSignal: true, isRequired: false, transformFunction: null }, visibleLogoutBtn: { classPropertyName: "visibleLogoutBtn", publicName: "visibleLogoutBtn", 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 }, userTooltip: { classPropertyName: "userTooltip", publicName: "userTooltip", isSignal: true, isRequired: false, transformFunction: null }, avatarURL: { classPropertyName: "avatarURL", publicName: "avatarURL", 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 (visibleAvatar() && (loggedIn() === false || !avatarURL)) {\r\n <mat-icon [matTooltip]=\"(userTooltip())?.join(',')||''\">account_circle</mat-icon>\r\n }\r\n @if (visibleAvatar() && loggedIn() && avatarURL()) {\r\n <img\r\n class=\"user-photo\"\r\n [src]=\"avatarURL() | safe\"\r\n loading=\"lazy\"\r\n [alt]=\"fioUser()\"\r\n [matTooltip]=\"(userTooltip())?.join(',')||''\">\r\n }\r\n\r\n <span class = \"user-name\" [matTooltip]=\"(userTooltip())?.join(',') || ''\">\r\n {{ fioUser() }}\r\n </span>\r\n\r\n @if (visibleLogoutBtn()) {\r\n <a mat-button class=\"pm-button\" (click)=\"openDialog()\">\u0412\u044B\u0439\u0442\u0438 <mat-icon>logout</mat-icon></a>\r\n }\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
1890
|
}
|
|
1908
1891
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NavBarComponent, decorators: [{
|
|
1909
1892
|
type: Component,
|
|
1910
|
-
args: [{ selector: 'ngx-uik-navbar', imports: [MatAnchor, MatIcon, MatTooltip,
|
|
1911
|
-
|
|
1912
|
-
}], ctorParameters: () => [] });
|
|
1893
|
+
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 (visibleAvatar() && (loggedIn() === false || !avatarURL)) {\r\n <mat-icon [matTooltip]=\"(userTooltip())?.join(',')||''\">account_circle</mat-icon>\r\n }\r\n @if (visibleAvatar() && loggedIn() && avatarURL()) {\r\n <img\r\n class=\"user-photo\"\r\n [src]=\"avatarURL() | safe\"\r\n loading=\"lazy\"\r\n [alt]=\"fioUser()\"\r\n [matTooltip]=\"(userTooltip())?.join(',')||''\">\r\n }\r\n\r\n <span class = \"user-name\" [matTooltip]=\"(userTooltip())?.join(',') || ''\">\r\n {{ fioUser() }}\r\n </span>\r\n\r\n @if (visibleLogoutBtn()) {\r\n <a mat-button class=\"pm-button\" (click)=\"openDialog()\">\u0412\u044B\u0439\u0442\u0438 <mat-icon>logout</mat-icon></a>\r\n }\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"] }]
|
|
1894
|
+
}], ctorParameters: () => [], propDecorators: { visibleOnLogout: [{ type: i0.Input, args: [{ isSignal: true, alias: "visibleOnLogout", required: false }] }], visibleAvatar: [{ type: i0.Input, args: [{ isSignal: true, alias: "visibleAvatar", required: false }] }], visibleLogoutBtn: [{ type: i0.Input, args: [{ isSignal: true, alias: "visibleLogoutBtn", required: false }] }], loggedIn: [{ type: i0.Input, args: [{ isSignal: true, alias: "loggedIn", required: false }] }], fioUser: [{ type: i0.Input, args: [{ isSignal: true, alias: "fioUser", required: false }] }], userTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "userTooltip", required: false }] }], avatarURL: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatarURL", required: false }] }], logout: [{ type: i0.Output, args: ["logout"] }] } });
|
|
1913
1895
|
|
|
1914
1896
|
class NotFoundComponent {
|
|
1915
1897
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NotFoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|