@kuzntsv/uikit 1.0.13 → 1.0.16
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/fesm2022/kuzntsv-uikit-interceptors.mjs +0 -2
- package/fesm2022/kuzntsv-uikit-interceptors.mjs.map +1 -1
- package/fesm2022/kuzntsv-uikit-ui.mjs +181 -74
- package/fesm2022/kuzntsv-uikit-ui.mjs.map +1 -1
- package/fesm2022/kuzntsv-uikit.mjs +100 -99
- package/fesm2022/kuzntsv-uikit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/kuzntsv-uikit-ui.d.ts +85 -29
- package/types/kuzntsv-uikit.d.ts +59 -30
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, effect, Component, viewChild, HostListener, inject, Injectable, Directive, signal, Pipe, ChangeDetectorRef, ChangeDetectionStrategy, linkedSignal, NgZone, ElementRef, InjectionToken, makeEnvironmentProviders } from '@angular/core';
|
|
3
|
-
import { Router, RouterLink
|
|
4
|
-
import {
|
|
2
|
+
import { input, output, effect, Component, viewChild, HostListener, inject, Injectable, computed, Directive, signal, Pipe, ChangeDetectorRef, ChangeDetectionStrategy, linkedSignal, NgZone, ElementRef, InjectionToken, makeEnvironmentProviders } from '@angular/core';
|
|
3
|
+
import { Router, RouterLink } from '@angular/router';
|
|
4
|
+
import { startWith, Subscription, Subject, tap, switchMap, map as map$1, forkJoin, take, filter, ReplaySubject, finalize } from 'rxjs';
|
|
5
|
+
import { RoleService, NotificationService, HIDE_ROLE_MARKER, UIKIT_NOTIFICATION_TOKEN, AuthService } from '@kuzntsv/uikit';
|
|
5
6
|
import * as i1 from '@angular/forms';
|
|
6
7
|
import { FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule, NgControl } from '@angular/forms';
|
|
7
8
|
import { MatButton, MatIconButton, MatAnchor } from '@angular/material/button';
|
|
@@ -18,7 +19,6 @@ import * as i2 from '@angular/material/autocomplete';
|
|
|
18
19
|
import { MatAutocompleteModule, MatOption } from '@angular/material/autocomplete';
|
|
19
20
|
import * as i3 from '@angular/material/chips';
|
|
20
21
|
import { MatChipsModule } from '@angular/material/chips';
|
|
21
|
-
import { startWith, Subscription, Subject, tap, switchMap, map as map$1, forkJoin, ReplaySubject } from 'rxjs';
|
|
22
22
|
import { map, debounceTime, distinctUntilChanged, startWith as startWith$1 } from 'rxjs/operators';
|
|
23
23
|
import { MAT_DATE_LOCALE, MAT_DATE_FORMATS, MatOption as MatOption$1, MatOptgroup } from '@angular/material/core';
|
|
24
24
|
import { MatDateRangeInput, MatStartDate, MatEndDate, MatDatepickerToggle, MatDateRangePicker } from '@angular/material/datepicker';
|
|
@@ -334,16 +334,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
334
334
|
}] });
|
|
335
335
|
|
|
336
336
|
class BaseToolbarComponent {
|
|
337
|
-
|
|
337
|
+
/**
|
|
338
|
+
* Список Ролей, для которых кнопка видна. Если в списке есть роль 'HIDE', то скрывается.
|
|
339
|
+
*/
|
|
338
340
|
rolesNewBtn = input([], ...(ngDevMode ? [{ debugName: "rolesNewBtn" }] : /* istanbul ignore next */ []));
|
|
341
|
+
/**
|
|
342
|
+
* Список Ролей, для которых кнопка видна. Если в списке есть роль 'HIDE', то скрывается.
|
|
343
|
+
*/
|
|
339
344
|
rolesEditBtn = input([], ...(ngDevMode ? [{ debugName: "rolesEditBtn" }] : /* istanbul ignore next */ []));
|
|
345
|
+
/**
|
|
346
|
+
* Список Ролей, для которых кнопка видна. Если в списке есть роль 'HIDE', то скрывается.
|
|
347
|
+
*/
|
|
340
348
|
rolesRemoveBtn = input([], ...(ngDevMode ? [{ debugName: "rolesRemoveBtn" }] : /* istanbul ignore next */ []));
|
|
349
|
+
/**
|
|
350
|
+
* Список Ролей, для которых кнопка видна. Если в списке есть роль 'HIDE', то скрывается.
|
|
351
|
+
*/
|
|
341
352
|
rolesCopyBtn = input([], ...(ngDevMode ? [{ debugName: "rolesCopyBtn" }] : /* istanbul ignore next */ []));
|
|
353
|
+
/**
|
|
354
|
+
* Список Ролей, для которых кнопка видна. Если в списке есть роль 'HIDE', то скрывается.
|
|
355
|
+
*/
|
|
342
356
|
rolesExcelBtn = input([], ...(ngDevMode ? [{ debugName: "rolesExcelBtn" }] : /* istanbul ignore next */ []));
|
|
357
|
+
/**
|
|
358
|
+
* Список Ролей, для которых кнопка видна. Если в списке есть роль 'HIDE', то скрывается.
|
|
359
|
+
*/
|
|
343
360
|
rolesCsvBtn = input([], ...(ngDevMode ? [{ debugName: "rolesCsvBtn" }] : /* istanbul ignore next */ []));
|
|
361
|
+
/**
|
|
362
|
+
* Список Ролей, для которых кнопка видна. Если в списке есть роль 'HIDE', то скрывается.
|
|
363
|
+
*/
|
|
344
364
|
rolesPdfBtn = input([], ...(ngDevMode ? [{ debugName: "rolesPdfBtn" }] : /* istanbul ignore next */ []));
|
|
365
|
+
/**
|
|
366
|
+
* Список Ролей, для которых кнопка видна. Если в списке есть роль 'HIDE', то скрывается.
|
|
367
|
+
*/
|
|
345
368
|
rolesPrintBtn = input([], ...(ngDevMode ? [{ debugName: "rolesPrintBtn" }] : /* istanbul ignore next */ []));
|
|
369
|
+
/**
|
|
370
|
+
* Список Ролей, для которых кнопка видна. Если в списке есть роль 'HIDE', то скрывается.
|
|
371
|
+
*/
|
|
346
372
|
rolesRefreshBtn = input([], ...(ngDevMode ? [{ debugName: "rolesRefreshBtn" }] : /* istanbul ignore next */ []));
|
|
373
|
+
/**
|
|
374
|
+
* Список Ролей, для которых кнопка видна. Если в списке есть роль 'HIDE', то скрывается.
|
|
375
|
+
*/
|
|
347
376
|
rolesClearBtn = input([], ...(ngDevMode ? [{ debugName: "rolesClearBtn" }] : /* istanbul ignore next */ []));
|
|
348
377
|
// Состояния блокировки
|
|
349
378
|
newBtnDisabled = input(false, ...(ngDevMode ? [{ debugName: "newBtnDisabled" }] : /* istanbul ignore next */ []));
|
|
@@ -381,10 +410,28 @@ class BaseToolbarComponent {
|
|
|
381
410
|
clickedRefreshBtn = output();
|
|
382
411
|
clickedClearBtn = output();
|
|
383
412
|
// DI
|
|
384
|
-
authService = inject(AuthService);
|
|
413
|
+
// protected authService = inject(AuthService);
|
|
385
414
|
roleService = inject(RoleService);
|
|
386
|
-
|
|
387
|
-
|
|
415
|
+
// Вычисляемые сигналы видимости кнопок.
|
|
416
|
+
isNewBtnVisible = computed(() => this.checkVisibility(this.rolesNewBtn()), ...(ngDevMode ? [{ debugName: "isNewBtnVisible" }] : /* istanbul ignore next */ []));
|
|
417
|
+
isEditBtnVisible = computed(() => this.checkVisibility(this.rolesEditBtn()), ...(ngDevMode ? [{ debugName: "isEditBtnVisible" }] : /* istanbul ignore next */ []));
|
|
418
|
+
isRemoveBtnVisible = computed(() => this.checkVisibility(this.rolesRemoveBtn()), ...(ngDevMode ? [{ debugName: "isRemoveBtnVisible" }] : /* istanbul ignore next */ []));
|
|
419
|
+
isCopyBtnVisible = computed(() => this.checkVisibility(this.rolesCopyBtn()), ...(ngDevMode ? [{ debugName: "isCopyBtnVisible" }] : /* istanbul ignore next */ []));
|
|
420
|
+
isExcelBtnVisible = computed(() => this.checkVisibility(this.rolesExcelBtn()), ...(ngDevMode ? [{ debugName: "isExcelBtnVisible" }] : /* istanbul ignore next */ []));
|
|
421
|
+
isCsvBtnVisible = computed(() => this.checkVisibility(this.rolesCsvBtn()), ...(ngDevMode ? [{ debugName: "isCsvBtnVisible" }] : /* istanbul ignore next */ []));
|
|
422
|
+
isPdfBtnVisible = computed(() => this.checkVisibility(this.rolesPdfBtn()), ...(ngDevMode ? [{ debugName: "isPdfBtnVisible" }] : /* istanbul ignore next */ []));
|
|
423
|
+
isPrintBtnVisible = computed(() => this.checkVisibility(this.rolesPrintBtn()), ...(ngDevMode ? [{ debugName: "isPrintBtnVisible" }] : /* istanbul ignore next */ []));
|
|
424
|
+
isRefreshBtnVisible = computed(() => this.checkVisibility(this.rolesRefreshBtn()), ...(ngDevMode ? [{ debugName: "isRefreshBtnVisible" }] : /* istanbul ignore next */ []));
|
|
425
|
+
isClearBtnVisible = computed(() => this.checkVisibility(this.rolesClearBtn()), ...(ngDevMode ? [{ debugName: "isClearBtnVisible" }] : /* istanbul ignore next */ []));
|
|
426
|
+
/**
|
|
427
|
+
* Внутренний метод для вычисления видимости.
|
|
428
|
+
* Не вызывается напрямую из шаблона, а служит хелпером для декларативных computed.
|
|
429
|
+
* Проверяет, заблокирован ли доступ к элементу на основе списка ограничений.
|
|
430
|
+
* Возвращает true, если у пользователя есть запрещенная роль или передан маркер 'HIDE'.
|
|
431
|
+
* Администратор (ADMIN) всегда игнорирует любые запреты и маркер 'HIDE'.
|
|
432
|
+
*/
|
|
433
|
+
checkVisibility(forbiddenRoles) {
|
|
434
|
+
return !this.roleService.hasForbiddenRole(forbiddenRoles);
|
|
388
435
|
}
|
|
389
436
|
onNewClick() {
|
|
390
437
|
this.clickedNewBtn.emit();
|
|
@@ -417,7 +464,7 @@ class BaseToolbarComponent {
|
|
|
417
464
|
this.clickedClearBtn.emit();
|
|
418
465
|
}
|
|
419
466
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: BaseToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
420
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: BaseToolbarComponent, isStandalone: true, selector: "ngx-uik-base-toolbar", inputs: { rolesNewBtn: { classPropertyName: "rolesNewBtn", publicName: "rolesNewBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesEditBtn: { classPropertyName: "rolesEditBtn", publicName: "rolesEditBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesRemoveBtn: { classPropertyName: "rolesRemoveBtn", publicName: "rolesRemoveBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesCopyBtn: { classPropertyName: "rolesCopyBtn", publicName: "rolesCopyBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesExcelBtn: { classPropertyName: "rolesExcelBtn", publicName: "rolesExcelBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesCsvBtn: { classPropertyName: "rolesCsvBtn", publicName: "rolesCsvBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesPdfBtn: { classPropertyName: "rolesPdfBtn", publicName: "rolesPdfBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesPrintBtn: { classPropertyName: "rolesPrintBtn", publicName: "rolesPrintBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesRefreshBtn: { classPropertyName: "rolesRefreshBtn", publicName: "rolesRefreshBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesClearBtn: { classPropertyName: "rolesClearBtn", publicName: "rolesClearBtn", isSignal: true, isRequired: false, transformFunction: null }, newBtnDisabled: { classPropertyName: "newBtnDisabled", publicName: "newBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, editBtnDisabled: { classPropertyName: "editBtnDisabled", publicName: "editBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, removeBtnDisabled: { classPropertyName: "removeBtnDisabled", publicName: "removeBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, copyBtnDisabled: { classPropertyName: "copyBtnDisabled", publicName: "copyBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, excelBtnDisabled: { classPropertyName: "excelBtnDisabled", publicName: "excelBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, csvBtnDisabled: { classPropertyName: "csvBtnDisabled", publicName: "csvBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, pdfBtnDisabled: { classPropertyName: "pdfBtnDisabled", publicName: "pdfBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, printBtnDisabled: { classPropertyName: "printBtnDisabled", publicName: "printBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, refreshBtnDisabled: { classPropertyName: "refreshBtnDisabled", publicName: "refreshBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, clearBtnDisabled: { classPropertyName: "clearBtnDisabled", publicName: "clearBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, newBtnTooltip: { classPropertyName: "newBtnTooltip", publicName: "newBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, editBtnTooltip: { classPropertyName: "editBtnTooltip", publicName: "editBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, removeBtnTooltip: { classPropertyName: "removeBtnTooltip", publicName: "removeBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, copyBtnTooltip: { classPropertyName: "copyBtnTooltip", publicName: "copyBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, excelBtnTooltip: { classPropertyName: "excelBtnTooltip", publicName: "excelBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, csvBtnTooltip: { classPropertyName: "csvBtnTooltip", publicName: "csvBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, pdfBtnTooltip: { classPropertyName: "pdfBtnTooltip", publicName: "pdfBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, printBtnTooltip: { classPropertyName: "printBtnTooltip", publicName: "printBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, refreshBtnTooltip: { classPropertyName: "refreshBtnTooltip", publicName: "refreshBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, clearBtnTooltip: { classPropertyName: "clearBtnTooltip", publicName: "clearBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, newBtnOpt: { classPropertyName: "newBtnOpt", publicName: "newBtnOpt", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickedNewBtn: "clickedNewBtn", clickedEditBtn: "clickedEditBtn", clickedRemoveBtn: "clickedRemoveBtn", clickedCopyBtn: "clickedCopyBtn", clickedExcelBtn: "clickedExcelBtn", clickedCsvBtn: "clickedCsvBtn", clickedPdfBtn: "clickedPdfBtn", clickedPrintBtn: "clickedPrintBtn", clickedRefreshBtn: "clickedRefreshBtn", clickedClearBtn: "clickedClearBtn" }, ngImport: i0, template: "<mat-toolbar>\r\n @if (isShow(rolesNewBtn())) {\r\n @if (newBtnOpt() && newBtnOpt().length > 0) {\r\n <button [disabled]=\"newBtnDisabled()\" [matMenuTriggerFor]=\"menuNewBtn\"\r\n mat-icon-button [matTooltip]=\"newBtnTooltip()\">\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n <mat-menu #menuNewBtn=\"matMenu\">\r\n @for (menuItem of newBtnOpt(); track menuItem) {\r\n @if (menuItem.title === '-' && !(menuItem.hideFn ? menuItem.hideFn(\"\") : menuItem.hide)) {\r\n <mat-divider></mat-divider>\r\n }\r\n @if (menuItem.title !== '-' && !(menuItem.hideFn ? menuItem.hideFn(\"\") : menuItem.hide)) {\r\n <button mat-menu-item\r\n (click)=\"menuItem.onClickFn ? menuItem.onClickFn('') : ''\"\r\n [disabled]=\"menuItem.disabledFn ? menuItem.disabledFn('') : menuItem.disabled\">\r\n @if (menuItem.icon) {\r\n <mat-icon>{{menuItem.icon}}</mat-icon>\r\n }\r\n {{ menuItem.title }}\r\n </button>\r\n }\r\n }\r\n </mat-menu>\r\n } \r\n @else {\r\n <button [disabled]=\"newBtnDisabled()\" (click)=\"onNewClick()\"\r\n mat-icon-button routerLink=\"new\" routerLinkActive=\"active\" [matTooltip]=\"newBtnTooltip()\">\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n }\r\n }\r\n\r\n @if (isShow(rolesEditBtn())) {\r\n <button [disabled]=\"editBtnDisabled()\" (click)=\"onEditClick()\"\r\n mat-icon-button routerLink=\"edit\" color=\"primary\" routerLinkActive=\"active\" [matTooltip]=\"editBtnTooltip()\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n }\r\n @if (isShow(rolesRemoveBtn())) {\r\n <button [disabled]=\"removeBtnDisabled()\" (click)=\"onRemoveClick()\"\r\n mat-icon-button routerLink=\"delete\" color=\"warn\" routerLinkActive=\"active\" [matTooltip]=\"removeBtnTooltip()\">\r\n <mat-icon>remove</mat-icon>\r\n </button>\r\n }\r\n @if (isShow(rolesCopyBtn())) {\r\n <button [disabled]=\"copyBtnDisabled()\" (click)=\"onCopyClick()\"\r\n mat-icon-button routerLink=\"delete\" routerLinkActive=\"active\" [matTooltip]=\"copyBtnTooltip()\">\r\n <mat-icon>content_copy</mat-icon>\r\n </button>\r\n }\r\n @if (isShow(rolesExcelBtn())) {\r\n <button [disabled]=\"excelBtnDisabled()\" (click)=\"onExcelClick()\"\r\n mat-icon-button routerLink=\"excel\" routerLinkActive=\"active\" [matTooltip]=\"excelBtnTooltip()\">\r\n <mat-icon class=\"material-icons-outlined\">explicit</mat-icon>\r\n </button>\r\n }\r\n @if (isShow(rolesCsvBtn())) {\r\n <button [disabled]=\"csvBtnDisabled()\" (click)=\"onCsvClick()\"\r\n mat-icon-button routerLink=\"csv\" routerLinkActive=\"active\" [matTooltip]=\"csvBtnTooltip()\">\r\n <mat-icon class=\"material-icons-outlined\">download</mat-icon>\r\n </button>\r\n }\r\n @if (isShow(rolesPdfBtn())) {\r\n <button [disabled]=\"pdfBtnDisabled()\" (click)=\"onPdfClick()\"\r\n mat-icon-button routerLink=\"pdf\" routerLinkActive=\"active\" [matTooltip]=\"pdfBtnTooltip()\">\r\n <mat-icon class=\"material-icons-outlined\">picture_as_pdf</mat-icon>\r\n </button>\r\n }\r\n @if (isShow(rolesPrintBtn())) {\r\n <button [disabled]=\"printBtnDisabled()\" (click)=\"onPrintClick()\"\r\n mat-icon-button routerLink=\"print\" routerLinkActive=\"active\" [matTooltip]=\"printBtnTooltip()\">\r\n <mat-icon class=\"material-icons-outlined\">print_outline</mat-icon>\r\n </button>\r\n }\r\n @if (isShow(rolesRefreshBtn())) {\r\n <button [disabled]=\"refreshBtnDisabled()\" (click)=\"onRefreshGridClick()\"\r\n mat-icon-button routerLink=\"refresh\" routerLinkActive=\"active\" [matTooltip]=\"refreshBtnTooltip()\">\r\n <mat-icon>refresh</mat-icon>\r\n </button>\r\n }\r\n @if (isShow(rolesClearBtn())) {\r\n <button [disabled]=\"clearBtnDisabled()\" (click)=\"onClearClick()\"\r\n mat-icon-button routerLink=\"clear\" routerLinkActive=\"active\" [matTooltip]=\"clearBtnTooltip()\">\r\n <mat-icon>clear</mat-icon>\r\n </button>\r\n }\r\n</mat-toolbar>\r\n", styles: [""], dependencies: [{ kind: "component", type: MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }] });
|
|
467
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: BaseToolbarComponent, isStandalone: true, selector: "ngx-uik-base-toolbar", inputs: { rolesNewBtn: { classPropertyName: "rolesNewBtn", publicName: "rolesNewBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesEditBtn: { classPropertyName: "rolesEditBtn", publicName: "rolesEditBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesRemoveBtn: { classPropertyName: "rolesRemoveBtn", publicName: "rolesRemoveBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesCopyBtn: { classPropertyName: "rolesCopyBtn", publicName: "rolesCopyBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesExcelBtn: { classPropertyName: "rolesExcelBtn", publicName: "rolesExcelBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesCsvBtn: { classPropertyName: "rolesCsvBtn", publicName: "rolesCsvBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesPdfBtn: { classPropertyName: "rolesPdfBtn", publicName: "rolesPdfBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesPrintBtn: { classPropertyName: "rolesPrintBtn", publicName: "rolesPrintBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesRefreshBtn: { classPropertyName: "rolesRefreshBtn", publicName: "rolesRefreshBtn", isSignal: true, isRequired: false, transformFunction: null }, rolesClearBtn: { classPropertyName: "rolesClearBtn", publicName: "rolesClearBtn", isSignal: true, isRequired: false, transformFunction: null }, newBtnDisabled: { classPropertyName: "newBtnDisabled", publicName: "newBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, editBtnDisabled: { classPropertyName: "editBtnDisabled", publicName: "editBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, removeBtnDisabled: { classPropertyName: "removeBtnDisabled", publicName: "removeBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, copyBtnDisabled: { classPropertyName: "copyBtnDisabled", publicName: "copyBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, excelBtnDisabled: { classPropertyName: "excelBtnDisabled", publicName: "excelBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, csvBtnDisabled: { classPropertyName: "csvBtnDisabled", publicName: "csvBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, pdfBtnDisabled: { classPropertyName: "pdfBtnDisabled", publicName: "pdfBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, printBtnDisabled: { classPropertyName: "printBtnDisabled", publicName: "printBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, refreshBtnDisabled: { classPropertyName: "refreshBtnDisabled", publicName: "refreshBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, clearBtnDisabled: { classPropertyName: "clearBtnDisabled", publicName: "clearBtnDisabled", isSignal: true, isRequired: false, transformFunction: null }, newBtnTooltip: { classPropertyName: "newBtnTooltip", publicName: "newBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, editBtnTooltip: { classPropertyName: "editBtnTooltip", publicName: "editBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, removeBtnTooltip: { classPropertyName: "removeBtnTooltip", publicName: "removeBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, copyBtnTooltip: { classPropertyName: "copyBtnTooltip", publicName: "copyBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, excelBtnTooltip: { classPropertyName: "excelBtnTooltip", publicName: "excelBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, csvBtnTooltip: { classPropertyName: "csvBtnTooltip", publicName: "csvBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, pdfBtnTooltip: { classPropertyName: "pdfBtnTooltip", publicName: "pdfBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, printBtnTooltip: { classPropertyName: "printBtnTooltip", publicName: "printBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, refreshBtnTooltip: { classPropertyName: "refreshBtnTooltip", publicName: "refreshBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, clearBtnTooltip: { classPropertyName: "clearBtnTooltip", publicName: "clearBtnTooltip", isSignal: true, isRequired: false, transformFunction: null }, newBtnOpt: { classPropertyName: "newBtnOpt", publicName: "newBtnOpt", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickedNewBtn: "clickedNewBtn", clickedEditBtn: "clickedEditBtn", clickedRemoveBtn: "clickedRemoveBtn", clickedCopyBtn: "clickedCopyBtn", clickedExcelBtn: "clickedExcelBtn", clickedCsvBtn: "clickedCsvBtn", clickedPdfBtn: "clickedPdfBtn", clickedPrintBtn: "clickedPrintBtn", clickedRefreshBtn: "clickedRefreshBtn", clickedClearBtn: "clickedClearBtn" }, ngImport: i0, template: "<mat-toolbar>\r\n @if (isNewBtnVisible()) {\r\n @if (newBtnOpt() && newBtnOpt().length > 0) {\r\n <button [disabled]=\"newBtnDisabled()\" [matMenuTriggerFor]=\"menuNewBtn\"\r\n mat-icon-button [matTooltip]=\"newBtnTooltip()\">\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n <mat-menu #menuNewBtn=\"matMenu\">\r\n @for (menuItem of newBtnOpt(); track menuItem) {\r\n @if (menuItem.title === '-' && !(menuItem.hideFn ? menuItem.hideFn(\"\") : menuItem.hide)) {\r\n <mat-divider></mat-divider>\r\n }\r\n @if (menuItem.title !== '-' && !(menuItem.hideFn ? menuItem.hideFn(\"\") : menuItem.hide)) {\r\n <button mat-menu-item\r\n (click)=\"menuItem.onClickFn ? menuItem.onClickFn('') : ''\"\r\n [disabled]=\"menuItem.disabledFn ? menuItem.disabledFn('') : menuItem.disabled\">\r\n @if (menuItem.icon) {\r\n <mat-icon>{{menuItem.icon}}</mat-icon>\r\n }\r\n {{ menuItem.title }}\r\n </button>\r\n }\r\n }\r\n </mat-menu>\r\n } \r\n @else {\r\n <button [disabled]=\"newBtnDisabled()\" (click)=\"onNewClick()\"\r\n mat-icon-button routerLink=\"new\" routerLinkActive=\"active\" [matTooltip]=\"newBtnTooltip()\">\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n }\r\n }\r\n\r\n @if (isEditBtnVisible()) {\r\n <button [disabled]=\"editBtnDisabled()\" (click)=\"onEditClick()\"\r\n mat-icon-button routerLink=\"edit\" color=\"primary\" routerLinkActive=\"active\" [matTooltip]=\"editBtnTooltip()\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n }\r\n @if (isRemoveBtnVisible()) {\r\n <button [disabled]=\"removeBtnDisabled()\" (click)=\"onRemoveClick()\"\r\n mat-icon-button routerLink=\"delete\" color=\"warn\" routerLinkActive=\"active\" [matTooltip]=\"removeBtnTooltip()\">\r\n <mat-icon>remove</mat-icon>\r\n </button>\r\n }\r\n @if (isCopyBtnVisible()) {\r\n <button [disabled]=\"copyBtnDisabled()\" (click)=\"onCopyClick()\"\r\n mat-icon-button routerLink=\"delete\" routerLinkActive=\"active\" [matTooltip]=\"copyBtnTooltip()\">\r\n <mat-icon>content_copy</mat-icon>\r\n </button>\r\n }\r\n @if (isExcelBtnVisible()) {\r\n <button [disabled]=\"excelBtnDisabled()\" (click)=\"onExcelClick()\"\r\n mat-icon-button routerLink=\"excel\" routerLinkActive=\"active\" [matTooltip]=\"excelBtnTooltip()\">\r\n <mat-icon class=\"material-icons-outlined\">explicit</mat-icon>\r\n </button>\r\n }\r\n @if (isCsvBtnVisible()) {\r\n <button [disabled]=\"csvBtnDisabled()\" (click)=\"onCsvClick()\"\r\n mat-icon-button routerLink=\"csv\" routerLinkActive=\"active\" [matTooltip]=\"csvBtnTooltip()\">\r\n <mat-icon class=\"material-icons-outlined\">download</mat-icon>\r\n </button>\r\n }\r\n @if (isPdfBtnVisible()) {\r\n <button [disabled]=\"pdfBtnDisabled()\" (click)=\"onPdfClick()\"\r\n mat-icon-button routerLink=\"pdf\" routerLinkActive=\"active\" [matTooltip]=\"pdfBtnTooltip()\">\r\n <mat-icon class=\"material-icons-outlined\">picture_as_pdf</mat-icon>\r\n </button>\r\n }\r\n @if (isPrintBtnVisible()) {\r\n <button [disabled]=\"printBtnDisabled()\" (click)=\"onPrintClick()\"\r\n mat-icon-button routerLink=\"print\" routerLinkActive=\"active\" [matTooltip]=\"printBtnTooltip()\">\r\n <mat-icon class=\"material-icons-outlined\">print_outline</mat-icon>\r\n </button>\r\n }\r\n @if (isRefreshBtnVisible()) {\r\n <button [disabled]=\"refreshBtnDisabled()\" (click)=\"onRefreshGridClick()\"\r\n mat-icon-button routerLink=\"refresh\" routerLinkActive=\"active\" [matTooltip]=\"refreshBtnTooltip()\">\r\n <mat-icon>refresh</mat-icon>\r\n </button>\r\n }\r\n @if (isClearBtnVisible()) {\r\n <button [disabled]=\"clearBtnDisabled()\" (click)=\"onClearClick()\"\r\n mat-icon-button routerLink=\"clear\" routerLinkActive=\"active\" [matTooltip]=\"clearBtnTooltip()\">\r\n <mat-icon>clear</mat-icon>\r\n </button>\r\n }\r\n</mat-toolbar>\r\n", styles: [""], dependencies: [{ kind: "component", type: MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }] });
|
|
421
468
|
}
|
|
422
469
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: BaseToolbarComponent, decorators: [{
|
|
423
470
|
type: Component,
|
|
@@ -430,7 +477,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
430
477
|
MatDivider,
|
|
431
478
|
MatMenuTrigger,
|
|
432
479
|
MatMenuItem,
|
|
433
|
-
], template: "<mat-toolbar>\r\n @if (
|
|
480
|
+
], template: "<mat-toolbar>\r\n @if (isNewBtnVisible()) {\r\n @if (newBtnOpt() && newBtnOpt().length > 0) {\r\n <button [disabled]=\"newBtnDisabled()\" [matMenuTriggerFor]=\"menuNewBtn\"\r\n mat-icon-button [matTooltip]=\"newBtnTooltip()\">\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n <mat-menu #menuNewBtn=\"matMenu\">\r\n @for (menuItem of newBtnOpt(); track menuItem) {\r\n @if (menuItem.title === '-' && !(menuItem.hideFn ? menuItem.hideFn(\"\") : menuItem.hide)) {\r\n <mat-divider></mat-divider>\r\n }\r\n @if (menuItem.title !== '-' && !(menuItem.hideFn ? menuItem.hideFn(\"\") : menuItem.hide)) {\r\n <button mat-menu-item\r\n (click)=\"menuItem.onClickFn ? menuItem.onClickFn('') : ''\"\r\n [disabled]=\"menuItem.disabledFn ? menuItem.disabledFn('') : menuItem.disabled\">\r\n @if (menuItem.icon) {\r\n <mat-icon>{{menuItem.icon}}</mat-icon>\r\n }\r\n {{ menuItem.title }}\r\n </button>\r\n }\r\n }\r\n </mat-menu>\r\n } \r\n @else {\r\n <button [disabled]=\"newBtnDisabled()\" (click)=\"onNewClick()\"\r\n mat-icon-button routerLink=\"new\" routerLinkActive=\"active\" [matTooltip]=\"newBtnTooltip()\">\r\n <mat-icon>add</mat-icon>\r\n </button>\r\n }\r\n }\r\n\r\n @if (isEditBtnVisible()) {\r\n <button [disabled]=\"editBtnDisabled()\" (click)=\"onEditClick()\"\r\n mat-icon-button routerLink=\"edit\" color=\"primary\" routerLinkActive=\"active\" [matTooltip]=\"editBtnTooltip()\">\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n }\r\n @if (isRemoveBtnVisible()) {\r\n <button [disabled]=\"removeBtnDisabled()\" (click)=\"onRemoveClick()\"\r\n mat-icon-button routerLink=\"delete\" color=\"warn\" routerLinkActive=\"active\" [matTooltip]=\"removeBtnTooltip()\">\r\n <mat-icon>remove</mat-icon>\r\n </button>\r\n }\r\n @if (isCopyBtnVisible()) {\r\n <button [disabled]=\"copyBtnDisabled()\" (click)=\"onCopyClick()\"\r\n mat-icon-button routerLink=\"delete\" routerLinkActive=\"active\" [matTooltip]=\"copyBtnTooltip()\">\r\n <mat-icon>content_copy</mat-icon>\r\n </button>\r\n }\r\n @if (isExcelBtnVisible()) {\r\n <button [disabled]=\"excelBtnDisabled()\" (click)=\"onExcelClick()\"\r\n mat-icon-button routerLink=\"excel\" routerLinkActive=\"active\" [matTooltip]=\"excelBtnTooltip()\">\r\n <mat-icon class=\"material-icons-outlined\">explicit</mat-icon>\r\n </button>\r\n }\r\n @if (isCsvBtnVisible()) {\r\n <button [disabled]=\"csvBtnDisabled()\" (click)=\"onCsvClick()\"\r\n mat-icon-button routerLink=\"csv\" routerLinkActive=\"active\" [matTooltip]=\"csvBtnTooltip()\">\r\n <mat-icon class=\"material-icons-outlined\">download</mat-icon>\r\n </button>\r\n }\r\n @if (isPdfBtnVisible()) {\r\n <button [disabled]=\"pdfBtnDisabled()\" (click)=\"onPdfClick()\"\r\n mat-icon-button routerLink=\"pdf\" routerLinkActive=\"active\" [matTooltip]=\"pdfBtnTooltip()\">\r\n <mat-icon class=\"material-icons-outlined\">picture_as_pdf</mat-icon>\r\n </button>\r\n }\r\n @if (isPrintBtnVisible()) {\r\n <button [disabled]=\"printBtnDisabled()\" (click)=\"onPrintClick()\"\r\n mat-icon-button routerLink=\"print\" routerLinkActive=\"active\" [matTooltip]=\"printBtnTooltip()\">\r\n <mat-icon class=\"material-icons-outlined\">print_outline</mat-icon>\r\n </button>\r\n }\r\n @if (isRefreshBtnVisible()) {\r\n <button [disabled]=\"refreshBtnDisabled()\" (click)=\"onRefreshGridClick()\"\r\n mat-icon-button routerLink=\"refresh\" routerLinkActive=\"active\" [matTooltip]=\"refreshBtnTooltip()\">\r\n <mat-icon>refresh</mat-icon>\r\n </button>\r\n }\r\n @if (isClearBtnVisible()) {\r\n <button [disabled]=\"clearBtnDisabled()\" (click)=\"onClearClick()\"\r\n mat-icon-button routerLink=\"clear\" routerLinkActive=\"active\" [matTooltip]=\"clearBtnTooltip()\">\r\n <mat-icon>clear</mat-icon>\r\n </button>\r\n }\r\n</mat-toolbar>\r\n" }]
|
|
434
481
|
}], propDecorators: { rolesNewBtn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rolesNewBtn", required: false }] }], rolesEditBtn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rolesEditBtn", required: false }] }], rolesRemoveBtn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rolesRemoveBtn", required: false }] }], rolesCopyBtn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rolesCopyBtn", required: false }] }], rolesExcelBtn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rolesExcelBtn", required: false }] }], rolesCsvBtn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rolesCsvBtn", required: false }] }], rolesPdfBtn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rolesPdfBtn", required: false }] }], rolesPrintBtn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rolesPrintBtn", required: false }] }], rolesRefreshBtn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rolesRefreshBtn", required: false }] }], rolesClearBtn: [{ type: i0.Input, args: [{ isSignal: true, alias: "rolesClearBtn", required: false }] }], newBtnDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "newBtnDisabled", required: false }] }], editBtnDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "editBtnDisabled", required: false }] }], removeBtnDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeBtnDisabled", required: false }] }], copyBtnDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "copyBtnDisabled", required: false }] }], excelBtnDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "excelBtnDisabled", required: false }] }], csvBtnDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "csvBtnDisabled", required: false }] }], pdfBtnDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "pdfBtnDisabled", required: false }] }], printBtnDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "printBtnDisabled", required: false }] }], refreshBtnDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "refreshBtnDisabled", required: false }] }], clearBtnDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearBtnDisabled", required: false }] }], newBtnTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "newBtnTooltip", required: false }] }], editBtnTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "editBtnTooltip", required: false }] }], removeBtnTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeBtnTooltip", required: false }] }], copyBtnTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "copyBtnTooltip", required: false }] }], excelBtnTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "excelBtnTooltip", required: false }] }], csvBtnTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "csvBtnTooltip", required: false }] }], pdfBtnTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "pdfBtnTooltip", required: false }] }], printBtnTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "printBtnTooltip", required: false }] }], refreshBtnTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "refreshBtnTooltip", required: false }] }], clearBtnTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearBtnTooltip", required: false }] }], newBtnOpt: [{ type: i0.Input, args: [{ isSignal: true, alias: "newBtnOpt", required: false }] }], clickedNewBtn: [{ type: i0.Output, args: ["clickedNewBtn"] }], clickedEditBtn: [{ type: i0.Output, args: ["clickedEditBtn"] }], clickedRemoveBtn: [{ type: i0.Output, args: ["clickedRemoveBtn"] }], clickedCopyBtn: [{ type: i0.Output, args: ["clickedCopyBtn"] }], clickedExcelBtn: [{ type: i0.Output, args: ["clickedExcelBtn"] }], clickedCsvBtn: [{ type: i0.Output, args: ["clickedCsvBtn"] }], clickedPdfBtn: [{ type: i0.Output, args: ["clickedPdfBtn"] }], clickedPrintBtn: [{ type: i0.Output, args: ["clickedPrintBtn"] }], clickedRefreshBtn: [{ type: i0.Output, args: ["clickedRefreshBtn"] }], clickedClearBtn: [{ type: i0.Output, args: ["clickedClearBtn"] }] } });
|
|
435
482
|
|
|
436
483
|
var Action;
|
|
@@ -510,16 +557,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
510
557
|
}], ctorParameters: () => [] });
|
|
511
558
|
|
|
512
559
|
class BaseNavBarMenuClass {
|
|
513
|
-
subscription = new Subscription();
|
|
514
|
-
authService = inject(AuthService);
|
|
515
560
|
roleService = inject(RoleService);
|
|
516
561
|
router = inject(Router);
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
562
|
+
/**
|
|
563
|
+
* Определяет видимость пункта меню на основе ЧЕРНОГО списка ролей.
|
|
564
|
+
* По умолчанию пункт меню ВИДИМ. Скрывается (возвращает false), если у пользователя
|
|
565
|
+
* есть запрещенная роль или если передан маркер скрытия фичи HIDE_ROLE_MARKER.
|
|
566
|
+
*/
|
|
567
|
+
isMenuVisibleForForbiddenRoles(forbiddenRoles) {
|
|
568
|
+
// Если роль запрещена, метод roleService вернет true.
|
|
569
|
+
// Мы инвертируем (!), чтобы видимость (isMenuVisible) стала false.
|
|
570
|
+
return !this.roleService.hasForbiddenRole(forbiddenRoles);
|
|
520
571
|
}
|
|
521
|
-
|
|
522
|
-
|
|
572
|
+
/**
|
|
573
|
+
* Определяет видимость пункта меню на основе БЕЛОГО списка ролей.
|
|
574
|
+
* По умолчанию пункт меню СКРЫТ. Показывается (возвращает true), только если у пользователя
|
|
575
|
+
* есть хотя бы одна из разрешенных ролей. Администратор (ADMIN) всегда видит элемент.
|
|
576
|
+
*/
|
|
577
|
+
isMenuVisibleForAllowedRoles(allowedRoles) {
|
|
578
|
+
// Проверяем, есть ли у пользователя хотя бы одна роль из разрешенного списка.
|
|
579
|
+
// (Предполагается, что у вашего roleService есть соответствующий метод, например, hasAnyRole)
|
|
580
|
+
return this.roleService.hasAnyRole(allowedRoles);
|
|
523
581
|
}
|
|
524
582
|
/** Нажата средняя кнопка (открыть ссылку в новой вкладке). */
|
|
525
583
|
onMiddleClick(event, baseUrl, menu) {
|
|
@@ -610,7 +668,7 @@ class BasePageClass {
|
|
|
610
668
|
editorRoles = [];
|
|
611
669
|
executeRoles = [];
|
|
612
670
|
/** Список ролей, для которых скрыть элемент. */
|
|
613
|
-
hideRoles = [
|
|
671
|
+
hideRoles = [HIDE_ROLE_MARKER];
|
|
614
672
|
/** Загрузка данных. */
|
|
615
673
|
loadData$ = new Subject();
|
|
616
674
|
/** Загрузка количества записей. */
|
|
@@ -1101,15 +1159,18 @@ class NavBarComponent extends BaseNavBarMenuClass {
|
|
|
1101
1159
|
title: 'Подтверждение',
|
|
1102
1160
|
message: 'Вы хотите выйти?',
|
|
1103
1161
|
btnNoTitle: 'Отмена',
|
|
1104
|
-
btnYesTitle: 'Выйти'
|
|
1105
|
-
}
|
|
1162
|
+
btnYesTitle: 'Выйти',
|
|
1163
|
+
},
|
|
1106
1164
|
});
|
|
1107
|
-
|
|
1165
|
+
dialogRef
|
|
1166
|
+
.afterClosed()
|
|
1167
|
+
.pipe(take(1), // Берем только одно значение (когда закрылся)
|
|
1168
|
+
filter((id) => !!id))
|
|
1169
|
+
.subscribe((id) => {
|
|
1108
1170
|
if (id) {
|
|
1109
1171
|
this.onLogout();
|
|
1110
1172
|
}
|
|
1111
1173
|
});
|
|
1112
|
-
this.subscription.add(subs);
|
|
1113
1174
|
}
|
|
1114
1175
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: NavBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1115
1176
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", 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()\">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()\">\r\n }\r\n\r\n <span class = \"user-name\" [matTooltip]=\"userTooltip()\">\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" }] });
|
|
@@ -1643,59 +1704,103 @@ class LoginPageComponent {
|
|
|
1643
1704
|
pending = false;
|
|
1644
1705
|
error = '';
|
|
1645
1706
|
isKiosk = false;
|
|
1646
|
-
/**
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1707
|
+
/**
|
|
1708
|
+
* Идентификатор АС получаем автоматически из ActivatedRoute Data!
|
|
1709
|
+
* (Для этого в настройках роутера должен быть включен withComponentInputBinding())
|
|
1710
|
+
*/
|
|
1711
|
+
idCas = input(0, ...(ngDevMode ? [{ debugName: "idCas" }] : /* istanbul ignore next */ []));
|
|
1650
1712
|
authService = inject(AuthService);
|
|
1651
|
-
|
|
1713
|
+
router = inject(Router);
|
|
1652
1714
|
loaderService = inject(LoaderService);
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
});
|
|
1657
|
-
}
|
|
1715
|
+
notificationService = inject(UIKIT_NOTIFICATION_TOKEN, {
|
|
1716
|
+
optional: true,
|
|
1717
|
+
});
|
|
1658
1718
|
ngOnInit() {
|
|
1659
|
-
if (localStorage.getItem('id_human') ||
|
|
1719
|
+
if (localStorage.getItem('id_human') ||
|
|
1720
|
+
localStorage.getItem('kiosk-keyboard-layout')) {
|
|
1660
1721
|
// this.isKiosk = true;
|
|
1661
1722
|
}
|
|
1662
1723
|
}
|
|
1663
|
-
ngOnDestroy() {
|
|
1664
|
-
this.sub.unsubscribe();
|
|
1665
|
-
}
|
|
1666
|
-
onSubmitError() {
|
|
1667
|
-
return () => {
|
|
1668
|
-
this.pending = false;
|
|
1669
|
-
this.loaderService.hide();
|
|
1670
|
-
};
|
|
1671
|
-
}
|
|
1672
1724
|
onSubmit($event) {
|
|
1673
1725
|
this.loaderService.show();
|
|
1674
1726
|
this.pending = true;
|
|
1675
|
-
this.authService
|
|
1727
|
+
this.authService
|
|
1728
|
+
.login($event.username, $event.password, this.idCas())
|
|
1729
|
+
.pipe(
|
|
1730
|
+
// Очищаем состояние лоадеров ВСЕГДА (и при успехе, и при ошибке)
|
|
1731
|
+
finalize(() => {
|
|
1732
|
+
this.pending = false;
|
|
1733
|
+
this.loaderService.hide();
|
|
1734
|
+
}))
|
|
1735
|
+
.subscribe({
|
|
1736
|
+
next: () => this.handleSuccessLogin(),
|
|
1737
|
+
error: (error) => {
|
|
1738
|
+
const errorMsg = error.error?.message || error.message || 'Ошибка при авторизации';
|
|
1739
|
+
this.notificationService?.error(errorMsg, 0);
|
|
1740
|
+
},
|
|
1741
|
+
});
|
|
1676
1742
|
}
|
|
1677
1743
|
onSubmitPermit($event) {
|
|
1678
1744
|
const permit = $event;
|
|
1679
|
-
this.
|
|
1745
|
+
this.loaderService.show();
|
|
1746
|
+
this.pending = true;
|
|
1747
|
+
this.authService
|
|
1748
|
+
.loginByPermit(permit, this.idCas())
|
|
1749
|
+
.pipe(
|
|
1750
|
+
// Очищаем состояние лоадеров ВСЕГДА (и при успехе, и при ошибке)
|
|
1751
|
+
finalize(() => {
|
|
1752
|
+
this.pending = false;
|
|
1753
|
+
this.loaderService.hide();
|
|
1754
|
+
}))
|
|
1755
|
+
.subscribe({
|
|
1756
|
+
next: () => this.handleSuccessLogin(),
|
|
1757
|
+
error: (error) => {
|
|
1758
|
+
const errorMsg = error.error?.message || error.message || 'Ошибка при авторизации';
|
|
1759
|
+
this.notificationService?.error(errorMsg, 0);
|
|
1760
|
+
},
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1763
|
+
handleSuccessLogin() {
|
|
1764
|
+
this.notificationService?.success('Успешная авторизация');
|
|
1765
|
+
// ЛОГИКА ВОЗВРАТА ПОСЛЕ УСПЕШНОГО ЛОГИНА
|
|
1766
|
+
if (this.router) {
|
|
1767
|
+
// Извлекаем returnUrl из текущего query-параметра текущего маршрута
|
|
1768
|
+
const currentUrlTree = this.router.parseUrl(this.router.url);
|
|
1769
|
+
const returnUrl = currentUrlTree.queryParamMap.get('returnUrl');
|
|
1770
|
+
if (returnUrl) {
|
|
1771
|
+
// Декодируем и перенаправляем пользователя туда, где он был
|
|
1772
|
+
this.router.navigateByUrl(decodeURIComponent(returnUrl));
|
|
1773
|
+
return;
|
|
1774
|
+
}
|
|
1775
|
+
// Если returnUrl нет, идем на главную
|
|
1776
|
+
this.router.navigate(['/']);
|
|
1777
|
+
}
|
|
1778
|
+
// Логика перенаправления обратно: достаем returnUrl из текущих query-параметров страницы логина
|
|
1779
|
+
const currentUrlTree = this.router.parseUrl(this.router.url);
|
|
1780
|
+
const returnUrl = currentUrlTree.queryParamMap.get('returnUrl');
|
|
1781
|
+
if (returnUrl) {
|
|
1782
|
+
this.router.navigateByUrl(decodeURIComponent(returnUrl));
|
|
1783
|
+
}
|
|
1784
|
+
{
|
|
1785
|
+
this.router.navigate(['/']); // дефолтный роут, если returnUrl нет
|
|
1786
|
+
}
|
|
1680
1787
|
}
|
|
1681
1788
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: LoginPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1682
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: LoginPageComponent, isStandalone: true, selector: "ngx-uik-login-page", ngImport: i0, template: "@if (!isKiosk) {\r\n <ngx-uik-login-form\r\n (submitted)=\"onSubmit($event)\"\r\n [pending]=\"pending\"\r\n [errorMessage]=\"error\">\r\n </ngx-uik-login-form>\r\n }\r\n @if (isKiosk) {\r\n <ngx-uik-permit-form\r\n (submitted)=\"onSubmitPermit($event)\"\r\n >\r\n </ngx-uik-permit-form>\r\n }", styles: [""], dependencies: [{ kind: "component", type: LoginFormComponent, selector: "ngx-uik-login-form", inputs: ["pending", "errorMessage"], outputs: ["submitted"] }, { kind: "component", type: PermitFormComponent, selector: "ngx-uik-permit-form", outputs: ["submitted"] }] });
|
|
1789
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: LoginPageComponent, isStandalone: true, selector: "ngx-uik-login-page", inputs: { idCas: { classPropertyName: "idCas", publicName: "idCas", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (!isKiosk) {\r\n <ngx-uik-login-form\r\n (submitted)=\"onSubmit($event)\"\r\n [pending]=\"pending\"\r\n [errorMessage]=\"error\">\r\n </ngx-uik-login-form>\r\n }\r\n @if (isKiosk) {\r\n <ngx-uik-permit-form\r\n (submitted)=\"onSubmitPermit($event)\"\r\n >\r\n </ngx-uik-permit-form>\r\n }", styles: [""], dependencies: [{ kind: "component", type: LoginFormComponent, selector: "ngx-uik-login-form", inputs: ["pending", "errorMessage"], outputs: ["submitted"] }, { kind: "component", type: PermitFormComponent, selector: "ngx-uik-permit-form", outputs: ["submitted"] }] });
|
|
1683
1790
|
}
|
|
1684
1791
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: LoginPageComponent, decorators: [{
|
|
1685
1792
|
type: Component,
|
|
1686
1793
|
args: [{ selector: 'ngx-uik-login-page', imports: [LoginFormComponent, PermitFormComponent], template: "@if (!isKiosk) {\r\n <ngx-uik-login-form\r\n (submitted)=\"onSubmit($event)\"\r\n [pending]=\"pending\"\r\n [errorMessage]=\"error\">\r\n </ngx-uik-login-form>\r\n }\r\n @if (isKiosk) {\r\n <ngx-uik-permit-form\r\n (submitted)=\"onSubmitPermit($event)\"\r\n >\r\n </ngx-uik-permit-form>\r\n }" }]
|
|
1687
|
-
}],
|
|
1794
|
+
}], propDecorators: { idCas: [{ type: i0.Input, args: [{ isSignal: true, alias: "idCas", required: false }] }] } });
|
|
1688
1795
|
|
|
1689
1796
|
class DisableIfRoleDirective {
|
|
1690
|
-
|
|
1797
|
+
forbiddenRoles = input([], { ...(ngDevMode ? { debugName: "forbiddenRoles" } : /* istanbul ignore next */ {}), alias: 'ngxUikDisableIfRole' });
|
|
1691
1798
|
el = inject(ElementRef);
|
|
1692
|
-
authService = inject(AuthService);
|
|
1693
1799
|
roleService = inject(RoleService);
|
|
1694
1800
|
constructor() {
|
|
1695
1801
|
effect(() => {
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
const shouldDisable = !hasRequiredRole;
|
|
1802
|
+
// Спрашиваем у сервиса, заблокирована ли данная конфигурация ролей
|
|
1803
|
+
const shouldDisable = this.roleService.hasForbiddenRole(this.forbiddenRoles());
|
|
1699
1804
|
// 2. Безопасное управление атрибутом для любых элементов
|
|
1700
1805
|
const nativeEl = this.el.nativeElement;
|
|
1701
1806
|
if ('disabled' in nativeEl) {
|
|
@@ -1713,7 +1818,7 @@ class DisableIfRoleDirective {
|
|
|
1713
1818
|
});
|
|
1714
1819
|
}
|
|
1715
1820
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: DisableIfRoleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1716
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.25", type: DisableIfRoleDirective, isStandalone: true, selector: "[ngxUikDisableIfRole]", inputs: {
|
|
1821
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.25", type: DisableIfRoleDirective, isStandalone: true, selector: "[ngxUikDisableIfRole]", inputs: { forbiddenRoles: { classPropertyName: "forbiddenRoles", publicName: "ngxUikDisableIfRole", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
1717
1822
|
}
|
|
1718
1823
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: DisableIfRoleDirective, decorators: [{
|
|
1719
1824
|
type: Directive,
|
|
@@ -1721,43 +1826,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1721
1826
|
selector: '[ngxUikDisableIfRole]',
|
|
1722
1827
|
standalone: true
|
|
1723
1828
|
}]
|
|
1724
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
1829
|
+
}], ctorParameters: () => [], propDecorators: { forbiddenRoles: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngxUikDisableIfRole", required: false }] }] } });
|
|
1725
1830
|
|
|
1726
|
-
class
|
|
1727
|
-
|
|
1831
|
+
class HideIfForbiddenRoleDirective {
|
|
1832
|
+
forbiddenRoles = input([], { ...(ngDevMode ? { debugName: "forbiddenRoles" } : /* istanbul ignore next */ {}), alias: 'ngxUikHideIfForbiddenRole' });
|
|
1728
1833
|
el = inject(ElementRef);
|
|
1729
|
-
authService = inject(AuthService);
|
|
1730
1834
|
roleService = inject(RoleService);
|
|
1731
1835
|
constructor() {
|
|
1732
1836
|
effect(() => {
|
|
1733
|
-
// Элемент скрывается, если у пользователя
|
|
1734
|
-
|
|
1735
|
-
const isHide = this.roleService.isHideElement(this.roles(), this.authService.roles());
|
|
1837
|
+
// Элемент скрывается, если у пользователя есть запрещенная роль или передан маркер HIDE_ROLE_MARKER
|
|
1838
|
+
const shouldHide = this.roleService.hasForbiddenRole(this.forbiddenRoles());
|
|
1736
1839
|
// Управляем отображением. Пустая строка возвращает дефолтный CSS-стиль элемента.
|
|
1737
|
-
this.el.nativeElement.style.display =
|
|
1840
|
+
this.el.nativeElement.style.display = shouldHide ? 'none' : '';
|
|
1738
1841
|
});
|
|
1739
1842
|
}
|
|
1740
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
1741
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.25", type:
|
|
1843
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: HideIfForbiddenRoleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1844
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.25", type: HideIfForbiddenRoleDirective, isStandalone: true, selector: "[ngxUikHideIfForbiddenRole]", inputs: { forbiddenRoles: { classPropertyName: "forbiddenRoles", publicName: "ngxUikHideIfForbiddenRole", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
1742
1845
|
}
|
|
1743
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type:
|
|
1846
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: HideIfForbiddenRoleDirective, decorators: [{
|
|
1744
1847
|
type: Directive,
|
|
1745
1848
|
args: [{
|
|
1746
|
-
selector: '[
|
|
1747
|
-
standalone: true
|
|
1849
|
+
selector: '[ngxUikHideIfForbiddenRole]',
|
|
1850
|
+
standalone: true,
|
|
1748
1851
|
}]
|
|
1749
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
1852
|
+
}], ctorParameters: () => [], propDecorators: { forbiddenRoles: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngxUikHideIfForbiddenRole", required: false }] }] } });
|
|
1750
1853
|
|
|
1751
1854
|
class SetValueDirective {
|
|
1752
|
-
value = input(
|
|
1855
|
+
value = input(null, { ...(ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {}), alias: 'setValue' });
|
|
1753
1856
|
// 3. Используем опциональный inject, чтобы директива не падала, если формы нет
|
|
1754
1857
|
ngControl = inject(NgControl, { optional: true });
|
|
1755
1858
|
constructor() {
|
|
1756
1859
|
effect(() => {
|
|
1757
1860
|
// Эффект автоматически отслеживает изменение входного значения
|
|
1758
1861
|
const val = this.value();
|
|
1759
|
-
|
|
1760
|
-
|
|
1862
|
+
// Безопасное приведение undefined к null для стандартизации значений в формах
|
|
1863
|
+
const normalizedValue = val === undefined ? null : val;
|
|
1864
|
+
// Используем проверку, так как на старте ngControl.control может быть еще не создан Angular-ом
|
|
1865
|
+
if (this.ngControl && this.ngControl.control) {
|
|
1866
|
+
this.ngControl.control.setValue(normalizedValue, { emitEvent: false });
|
|
1761
1867
|
}
|
|
1762
1868
|
});
|
|
1763
1869
|
}
|
|
@@ -1794,14 +1900,15 @@ const redirectGuard = (route) => {
|
|
|
1794
1900
|
return true;
|
|
1795
1901
|
};
|
|
1796
1902
|
|
|
1903
|
+
/**
|
|
1904
|
+
* Пускает на роут только тех пользователей, у которых есть роли из списка allowedRoles.
|
|
1905
|
+
* ADMIN всегда имеет доступ.
|
|
1906
|
+
*/
|
|
1797
1907
|
const roleGuard = (allowedRoles) => {
|
|
1798
1908
|
return (route, state) => {
|
|
1799
|
-
const authService = inject(AuthService);
|
|
1800
1909
|
const roleService = inject(RoleService);
|
|
1801
|
-
// Читаем роли из Сигнала
|
|
1802
|
-
const userRoles = authService.roles();
|
|
1803
1910
|
// Проверяем доступ на основе аргумента allowedRoles
|
|
1804
|
-
return roleService.
|
|
1911
|
+
return roleService.hasAnyRole(allowedRoles);
|
|
1805
1912
|
};
|
|
1806
1913
|
};
|
|
1807
1914
|
|
|
@@ -1878,5 +1985,5 @@ class SecUser {
|
|
|
1878
1985
|
* Generated bundle index. Do not edit.
|
|
1879
1986
|
*/
|
|
1880
1987
|
|
|
1881
|
-
export { Action, AvatarService, BaseEditClass, BaseFilterClass, BaseMatChipComponent, BaseNavBarMenuClass, BasePageClass, BaseSelectAutocompleteWithVsComponent, BaseSelectWithGroupComponent, BaseServiceClass, BaseToolbarComponent, DateRangeInputComponent, DialogAction, DialogComponent, DisableIfRoleDirective, EmptyComponent, EntityAction, ExportService,
|
|
1988
|
+
export { Action, AvatarService, BaseEditClass, BaseFilterClass, BaseMatChipComponent, BaseNavBarMenuClass, BasePageClass, BaseSelectAutocompleteWithVsComponent, BaseSelectWithGroupComponent, BaseServiceClass, BaseToolbarComponent, DateRangeInputComponent, DialogAction, DialogComponent, DisableIfRoleDirective, EmptyComponent, EntityAction, ExportService, HideIfForbiddenRoleDirective, LOGGER_CONFIG, LoaderService, LocalStorageService, LoggerService, LoginPageComponent, MY_FORMATS, NavBarComponent, NotFoundComponent, ProgressSpinnerComponent, SafePipe, SecUser, SetValueDirective, SseService, TableComponent, TimePipe, TruncatePipe, authGuard, dateFormat, provideLogger, redirectGuard, roleGuard };
|
|
1882
1989
|
//# sourceMappingURL=kuzntsv-uikit-ui.mjs.map
|