@kuzntsv/uikit 1.0.112 → 1.0.114
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 +4 -4
- package/fesm2022/kuzntsv-uikit-interceptors.mjs.map +1 -1
- package/fesm2022/kuzntsv-uikit-ui.mjs +1696 -1684
- package/fesm2022/kuzntsv-uikit-ui.mjs.map +1 -1
- package/fesm2022/kuzntsv-uikit.mjs +3 -3
- package/fesm2022/kuzntsv-uikit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/kuzntsv-uikit-ui.d.ts +763 -765
- package/types/kuzntsv-uikit.d.ts +0 -1
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { ChangeDetectionStrategy, Component, Directive, ElementRef, Injectable, InjectionToken,
|
|
3
|
-
import { Router, RouterLink } from "@angular/router";
|
|
4
|
-
import { API_NAME, AuthService, HIDE_ROLE_MARKER, LoaderService, NotificationService, RoleService, SignalSelectionModel, UIKIT_NOTIFICATION_TOKEN, X_SKIP_LOADER, X_SKIP_NOTIFICATION, formatZodError } from "@kuzntsv/uikit";
|
|
5
|
-
import { ReplaySubject, Subject, Subscription, filter, forkJoin, lastValueFrom, map, of, switchMap, take, tap } from "rxjs";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, HostListener, Injectable, InjectionToken, Pipe, Service, computed, debounced, effect, inject, input, linkedSignal, makeEnvironmentProviders, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
6
3
|
import { MatAnchor, MatButton, MatIconButton } from "@angular/material/button";
|
|
7
|
-
import { MatCard, MatCardContent, MatCardHeader, MatCardTitle } from "@angular/material/card";
|
|
8
|
-
import { MatError, MatFormField, MatHint, MatLabel, MatSuffix } from "@angular/material/form-field";
|
|
9
|
-
import { MatIcon } from "@angular/material/icon";
|
|
10
|
-
import { MatInput } from "@angular/material/input";
|
|
11
|
-
import { FormField, FormRoot, debounce, disabled, form, validateHttp, validateStandardSchema } from "@angular/forms/signals";
|
|
12
|
-
import z, { z as z$1 } from "zod";
|
|
13
4
|
import { MatDivider } from "@angular/material/divider";
|
|
5
|
+
import { MatIcon } from "@angular/material/icon";
|
|
14
6
|
import { MatMenu, MatMenuContent, MatMenuItem, MatMenuTrigger } from "@angular/material/menu";
|
|
15
7
|
import { MatToolbar } from "@angular/material/toolbar";
|
|
16
8
|
import * as i4 from "@angular/material/tooltip";
|
|
17
9
|
import { MatTooltip, MatTooltipModule } from "@angular/material/tooltip";
|
|
10
|
+
import { API_NAME, AuthService, HIDE_ROLE_MARKER, LoaderService, NotificationService, RoleService, SignalSelectionModel, UIKIT_NOTIFICATION_TOKEN, X_SKIP_LOADER, X_SKIP_NOTIFICATION, formatZodError } from "@kuzntsv/uikit";
|
|
11
|
+
import z, { z as z$1 } from "zod";
|
|
12
|
+
import { Observable, Subject, Subscription, filter, forkJoin, lastValueFrom, map, of, switchMap, take, tap } from "rxjs";
|
|
18
13
|
import { HttpClient, HttpContext, HttpErrorResponse, HttpHeaders, HttpParams, httpResource } from "@angular/common/http";
|
|
19
14
|
import { DomSanitizer } from "@angular/platform-browser";
|
|
20
15
|
import { catchError, map as map$1 } from "rxjs/operators";
|
|
16
|
+
import { Router, RouterLink } from "@angular/router";
|
|
21
17
|
import { MAT_DIALOG_DATA, MatDialog, MatDialogActions, MatDialogClose, MatDialogConfig, MatDialogContent, MatDialogRef, MatDialogTitle } from "@angular/material/dialog";
|
|
22
18
|
import { NgControl } from "@angular/forms";
|
|
23
19
|
import { COMMA, ENTER } from "@angular/cdk/keycodes";
|
|
@@ -25,8 +21,12 @@ import * as i1$1 from "@angular/material/autocomplete";
|
|
|
25
21
|
import { MatAutocompleteModule, MatOption } from "@angular/material/autocomplete";
|
|
26
22
|
import * as i2$2 from "@angular/material/chips";
|
|
27
23
|
import { MatChipsModule } from "@angular/material/chips";
|
|
24
|
+
import { MatError, MatFormField, MatHint, MatLabel, MatSuffix } from "@angular/material/form-field";
|
|
25
|
+
import { FormField, FormRoot, debounce, disabled, form, required, validateHttp, validateStandardSchema } from "@angular/forms/signals";
|
|
28
26
|
import { DateAdapter, MAT_DATE_FORMATS, MatOptgroup, MatOption as MatOption$1, NativeDateAdapter } from "@angular/material/core";
|
|
29
27
|
import { MatDateRangeInput, MatDateRangePicker, MatDatepickerToggle, MatEndDate, MatStartDate } from "@angular/material/datepicker";
|
|
28
|
+
import { MatCard, MatCardContent, MatCardHeader, MatCardTitle } from "@angular/material/card";
|
|
29
|
+
import { MatInput } from "@angular/material/input";
|
|
30
30
|
import * as i2$1 from "@angular/cdk/scrolling";
|
|
31
31
|
import { ScrollingModule } from "@angular/cdk/scrolling";
|
|
32
32
|
import { MatFormField as MatFormField$1, MatLabel as MatLabel$1, MatSelect } from "@angular/material/select";
|
|
@@ -37,135 +37,369 @@ import * as i2 from "@angular/material/sort";
|
|
|
37
37
|
import { MatSort, MatSortModule } from "@angular/material/sort";
|
|
38
38
|
import * as i1 from "@angular/material/table";
|
|
39
39
|
import { MatTableDataSource, MatTableModule } from "@angular/material/table";
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
40
|
+
var BaseToolbarComponent = class BaseToolbarComponent {
|
|
41
|
+
rolesNewBtn = input([], ...ngDevMode ? [{ debugName: "rolesNewBtn" }] : /* istanbul ignore next */ []);
|
|
42
|
+
rolesEditBtn = input([], ...ngDevMode ? [{ debugName: "rolesEditBtn" }] : /* istanbul ignore next */ []);
|
|
43
|
+
rolesRemoveBtn = input([], ...ngDevMode ? [{ debugName: "rolesRemoveBtn" }] : /* istanbul ignore next */ []);
|
|
44
|
+
rolesCopyBtn = input([], ...ngDevMode ? [{ debugName: "rolesCopyBtn" }] : /* istanbul ignore next */ []);
|
|
45
|
+
rolesExcelBtn = input([], ...ngDevMode ? [{ debugName: "rolesExcelBtn" }] : /* istanbul ignore next */ []);
|
|
46
|
+
rolesCsvBtn = input([], ...ngDevMode ? [{ debugName: "rolesCsvBtn" }] : /* istanbul ignore next */ []);
|
|
47
|
+
rolesPdfBtn = input([], ...ngDevMode ? [{ debugName: "rolesPdfBtn" }] : /* istanbul ignore next */ []);
|
|
48
|
+
rolesPrintBtn = input([], ...ngDevMode ? [{ debugName: "rolesPrintBtn" }] : /* istanbul ignore next */ []);
|
|
49
|
+
rolesRefreshBtn = input([], ...ngDevMode ? [{ debugName: "rolesRefreshBtn" }] : /* istanbul ignore next */ []);
|
|
50
|
+
rolesClearBtn = input([], ...ngDevMode ? [{ debugName: "rolesClearBtn" }] : /* istanbul ignore next */ []);
|
|
51
|
+
newBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "newBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
52
|
+
editBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "editBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
53
|
+
removeBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "removeBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
54
|
+
copyBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "copyBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
55
|
+
excelBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "excelBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
56
|
+
csvBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "csvBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
57
|
+
pdfBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "pdfBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
58
|
+
printBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "printBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
59
|
+
refreshBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "refreshBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
60
|
+
clearBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "clearBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
61
|
+
newBtnTooltip = input("Добавить", ...ngDevMode ? [{ debugName: "newBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
62
|
+
editBtnTooltip = input("Изменить", ...ngDevMode ? [{ debugName: "editBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
63
|
+
removeBtnTooltip = input("Удалить", ...ngDevMode ? [{ debugName: "removeBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
64
|
+
copyBtnTooltip = input("Скопировать", ...ngDevMode ? [{ debugName: "copyBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
65
|
+
excelBtnTooltip = input("Экспортировать в Excel", ...ngDevMode ? [{ debugName: "excelBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
66
|
+
csvBtnTooltip = input("Экспортировать в Csv", ...ngDevMode ? [{ debugName: "csvBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
67
|
+
pdfBtnTooltip = input("Экспортировать в Pdf", ...ngDevMode ? [{ debugName: "pdfBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
68
|
+
printBtnTooltip = input("Печатать", ...ngDevMode ? [{ debugName: "printBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
69
|
+
refreshBtnTooltip = input("Обновить данные", ...ngDevMode ? [{ debugName: "refreshBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
70
|
+
clearBtnTooltip = input("Очистить фильтр", ...ngDevMode ? [{ debugName: "clearBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
71
|
+
newBtnOpt = input([], ...ngDevMode ? [{ debugName: "newBtnOpt" }] : /* istanbul ignore next */ []);
|
|
72
|
+
clickedNewBtn = output();
|
|
73
|
+
clickedEditBtn = output();
|
|
74
|
+
clickedRemoveBtn = output();
|
|
75
|
+
clickedCopyBtn = output();
|
|
76
|
+
clickedExcelBtn = output();
|
|
77
|
+
clickedCsvBtn = output();
|
|
78
|
+
clickedPdfBtn = output();
|
|
79
|
+
clickedPrintBtn = output();
|
|
80
|
+
clickedRefreshBtn = output();
|
|
81
|
+
clickedClearBtn = output();
|
|
82
|
+
roleService = inject(RoleService);
|
|
83
|
+
isNewBtnVisible = computed(() => this.checkVisibility(this.rolesNewBtn()), ...ngDevMode ? [{ debugName: "isNewBtnVisible" }] : /* istanbul ignore next */ []);
|
|
84
|
+
isEditBtnVisible = computed(() => this.checkVisibility(this.rolesEditBtn()), ...ngDevMode ? [{ debugName: "isEditBtnVisible" }] : /* istanbul ignore next */ []);
|
|
85
|
+
isRemoveBtnVisible = computed(() => this.checkVisibility(this.rolesRemoveBtn()), ...ngDevMode ? [{ debugName: "isRemoveBtnVisible" }] : /* istanbul ignore next */ []);
|
|
86
|
+
isCopyBtnVisible = computed(() => this.checkVisibility(this.rolesCopyBtn()), ...ngDevMode ? [{ debugName: "isCopyBtnVisible" }] : /* istanbul ignore next */ []);
|
|
87
|
+
isExcelBtnVisible = computed(() => this.checkVisibility(this.rolesExcelBtn()), ...ngDevMode ? [{ debugName: "isExcelBtnVisible" }] : /* istanbul ignore next */ []);
|
|
88
|
+
isCsvBtnVisible = computed(() => this.checkVisibility(this.rolesCsvBtn()), ...ngDevMode ? [{ debugName: "isCsvBtnVisible" }] : /* istanbul ignore next */ []);
|
|
89
|
+
isPdfBtnVisible = computed(() => this.checkVisibility(this.rolesPdfBtn()), ...ngDevMode ? [{ debugName: "isPdfBtnVisible" }] : /* istanbul ignore next */ []);
|
|
90
|
+
isPrintBtnVisible = computed(() => this.checkVisibility(this.rolesPrintBtn()), ...ngDevMode ? [{ debugName: "isPrintBtnVisible" }] : /* istanbul ignore next */ []);
|
|
91
|
+
isRefreshBtnVisible = computed(() => this.checkVisibility(this.rolesRefreshBtn()), ...ngDevMode ? [{ debugName: "isRefreshBtnVisible" }] : /* istanbul ignore next */ []);
|
|
92
|
+
isClearBtnVisible = computed(() => this.checkVisibility(this.rolesClearBtn()), ...ngDevMode ? [{ debugName: "isClearBtnVisible" }] : /* istanbul ignore next */ []);
|
|
93
|
+
checkVisibility(forbiddenRoles) {
|
|
94
|
+
return !this.roleService.hasForbiddenRole(forbiddenRoles);
|
|
61
95
|
}
|
|
62
|
-
|
|
63
|
-
this.
|
|
96
|
+
onNewClick() {
|
|
97
|
+
this.clickedNewBtn.emit();
|
|
98
|
+
}
|
|
99
|
+
onEditClick() {
|
|
100
|
+
this.clickedEditBtn.emit();
|
|
101
|
+
}
|
|
102
|
+
onRemoveClick() {
|
|
103
|
+
this.clickedRemoveBtn.emit();
|
|
104
|
+
}
|
|
105
|
+
onCopyClick() {
|
|
106
|
+
this.clickedCopyBtn.emit();
|
|
107
|
+
}
|
|
108
|
+
onExcelClick() {
|
|
109
|
+
this.clickedExcelBtn.emit();
|
|
110
|
+
}
|
|
111
|
+
onCsvClick() {
|
|
112
|
+
this.clickedCsvBtn.emit();
|
|
113
|
+
}
|
|
114
|
+
onPdfClick() {
|
|
115
|
+
this.clickedPdfBtn.emit();
|
|
116
|
+
}
|
|
117
|
+
onPrintClick() {
|
|
118
|
+
this.clickedPrintBtn.emit();
|
|
119
|
+
}
|
|
120
|
+
onRefreshGridClick() {
|
|
121
|
+
this.clickedRefreshBtn.emit();
|
|
122
|
+
}
|
|
123
|
+
onClearClick() {
|
|
124
|
+
this.clickedClearBtn.emit();
|
|
64
125
|
}
|
|
65
126
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
66
127
|
minVersion: "12.0.0",
|
|
67
128
|
version: "22.2.2",
|
|
68
129
|
ngImport: i0,
|
|
69
|
-
type:
|
|
130
|
+
type: BaseToolbarComponent,
|
|
70
131
|
deps: [],
|
|
71
132
|
target: i0.ɵɵFactoryTarget.Component
|
|
72
133
|
});
|
|
73
134
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
74
135
|
minVersion: "17.0.0",
|
|
75
136
|
version: "22.2.2",
|
|
76
|
-
type:
|
|
137
|
+
type: BaseToolbarComponent,
|
|
77
138
|
isStandalone: true,
|
|
78
|
-
selector: "ngx-uik-
|
|
79
|
-
inputs: {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
outputs: { submitted: "submitted" },
|
|
87
|
-
ngImport: i0,
|
|
88
|
-
template: "<mat-card appearance=\"outlined\">\r\n <mat-card-header>\r\n <mat-card-title> Авторизация </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <form [formRoot]=\"form\">\r\n <mat-form-field class=\"login-field\">\r\n <mat-label>Имя пользователя</mat-label>\r\n <input\r\n type=\"text\"\r\n matInput\r\n autocomplete=\"on\"\r\n placeholder=\"Имя пользователя\"\r\n [formField]=\"form.username\"\r\n />\r\n @if (form.username().touched() && form.username().invalid()) {\r\n <ng-container ngProjectAs=\"mat-error\">\r\n <mat-error>{{ form.username().errors()[0]?.message }}</mat-error>\r\n </ng-container>\r\n }\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"login-field\">\r\n <mat-label>Пароль</mat-label>\r\n <input\r\n [type]=\"isHidePassword() ? 'password' : 'text'\"\r\n matInput\r\n placeholder=\"Пароль\"\r\n [formField]=\"form.password\"\r\n />\r\n <mat-icon\r\n class=\"watcher\"\r\n matSuffix\r\n (mousedown)=\"showPassword()\"\r\n (mouseup)=\"hidePassword()\"\r\n >{{ isHidePassword() ? \"visibility_off\" : \"visibility\" }}</mat-icon\r\n >\r\n @if (form.password().touched() && form.password().invalid()) {\r\n <ng-container ngProjectAs=\"mat-error\">\r\n <mat-error>{{ form.password().errors()[0]?.message }}</mat-error>\r\n </ng-container>\r\n }\r\n </mat-form-field>\r\n\r\n <div class=\"loginButtons\">\r\n <button\r\n type=\"submit\"\r\n mat-button\r\n mat-stroked-button\r\n color=\"primary\"\r\n [disabled]=\"!form().valid() || pending()\"\r\n >\r\n Войти\r\n </button>\r\n </div>\r\n </form>\r\n </mat-card-content>\r\n</mat-card>\r\n",
|
|
89
|
-
styles: [":host{display:flex;justify-content:center;margin:32px 0}form{display:flex;flex-direction:column;gap:16px}.login-field{width:100%;min-width:300px}mat-card-header{justify-content:center}mat-card-content{font-size:16px}.loginButtons{display:flex;flex-direction:row;justify-content:flex-end}.watcher{cursor:default}\n"],
|
|
90
|
-
dependencies: [
|
|
91
|
-
{
|
|
92
|
-
kind: "directive",
|
|
93
|
-
type: FormRoot,
|
|
94
|
-
selector: "form[formRoot]",
|
|
95
|
-
inputs: ["formRoot"]
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
kind: "directive",
|
|
99
|
-
type: FormField,
|
|
100
|
-
selector: "[formField]",
|
|
101
|
-
inputs: ["formField"],
|
|
102
|
-
exportAs: ["formField"]
|
|
139
|
+
selector: "ngx-uik-base-toolbar",
|
|
140
|
+
inputs: {
|
|
141
|
+
rolesNewBtn: {
|
|
142
|
+
classPropertyName: "rolesNewBtn",
|
|
143
|
+
publicName: "rolesNewBtn",
|
|
144
|
+
isSignal: true,
|
|
145
|
+
isRequired: false,
|
|
146
|
+
transformFunction: null
|
|
103
147
|
},
|
|
104
|
-
{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
148
|
+
rolesEditBtn: {
|
|
149
|
+
classPropertyName: "rolesEditBtn",
|
|
150
|
+
publicName: "rolesEditBtn",
|
|
151
|
+
isSignal: true,
|
|
152
|
+
isRequired: false,
|
|
153
|
+
transformFunction: null
|
|
110
154
|
},
|
|
111
|
-
{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
155
|
+
rolesRemoveBtn: {
|
|
156
|
+
classPropertyName: "rolesRemoveBtn",
|
|
157
|
+
publicName: "rolesRemoveBtn",
|
|
158
|
+
isSignal: true,
|
|
159
|
+
isRequired: false,
|
|
160
|
+
transformFunction: null
|
|
115
161
|
},
|
|
116
|
-
{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
162
|
+
rolesCopyBtn: {
|
|
163
|
+
classPropertyName: "rolesCopyBtn",
|
|
164
|
+
publicName: "rolesCopyBtn",
|
|
165
|
+
isSignal: true,
|
|
166
|
+
isRequired: false,
|
|
167
|
+
transformFunction: null
|
|
120
168
|
},
|
|
121
|
-
{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
169
|
+
rolesExcelBtn: {
|
|
170
|
+
classPropertyName: "rolesExcelBtn",
|
|
171
|
+
publicName: "rolesExcelBtn",
|
|
172
|
+
isSignal: true,
|
|
173
|
+
isRequired: false,
|
|
174
|
+
transformFunction: null
|
|
125
175
|
},
|
|
126
|
-
{
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
"color",
|
|
133
|
-
"floatLabel",
|
|
134
|
-
"appearance",
|
|
135
|
-
"subscriptSizing",
|
|
136
|
-
"hintLabel"
|
|
137
|
-
],
|
|
138
|
-
exportAs: ["matFormField"]
|
|
176
|
+
rolesCsvBtn: {
|
|
177
|
+
classPropertyName: "rolesCsvBtn",
|
|
178
|
+
publicName: "rolesCsvBtn",
|
|
179
|
+
isSignal: true,
|
|
180
|
+
isRequired: false,
|
|
181
|
+
transformFunction: null
|
|
139
182
|
},
|
|
140
|
-
{
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
183
|
+
rolesPdfBtn: {
|
|
184
|
+
classPropertyName: "rolesPdfBtn",
|
|
185
|
+
publicName: "rolesPdfBtn",
|
|
186
|
+
isSignal: true,
|
|
187
|
+
isRequired: false,
|
|
188
|
+
transformFunction: null
|
|
144
189
|
},
|
|
145
|
-
{
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
"id",
|
|
152
|
-
"placeholder",
|
|
153
|
-
"name",
|
|
154
|
-
"required",
|
|
155
|
-
"type",
|
|
156
|
-
"errorStateMatcher",
|
|
157
|
-
"aria-describedby",
|
|
158
|
-
"value",
|
|
159
|
-
"readonly",
|
|
160
|
-
"disabledInteractive"
|
|
161
|
-
],
|
|
162
|
-
exportAs: ["matInput"]
|
|
190
|
+
rolesPrintBtn: {
|
|
191
|
+
classPropertyName: "rolesPrintBtn",
|
|
192
|
+
publicName: "rolesPrintBtn",
|
|
193
|
+
isSignal: true,
|
|
194
|
+
isRequired: false,
|
|
195
|
+
transformFunction: null
|
|
163
196
|
},
|
|
164
|
-
{
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
197
|
+
rolesRefreshBtn: {
|
|
198
|
+
classPropertyName: "rolesRefreshBtn",
|
|
199
|
+
publicName: "rolesRefreshBtn",
|
|
200
|
+
isSignal: true,
|
|
201
|
+
isRequired: false,
|
|
202
|
+
transformFunction: null
|
|
203
|
+
},
|
|
204
|
+
rolesClearBtn: {
|
|
205
|
+
classPropertyName: "rolesClearBtn",
|
|
206
|
+
publicName: "rolesClearBtn",
|
|
207
|
+
isSignal: true,
|
|
208
|
+
isRequired: false,
|
|
209
|
+
transformFunction: null
|
|
210
|
+
},
|
|
211
|
+
newBtnDisabled: {
|
|
212
|
+
classPropertyName: "newBtnDisabled",
|
|
213
|
+
publicName: "newBtnDisabled",
|
|
214
|
+
isSignal: true,
|
|
215
|
+
isRequired: false,
|
|
216
|
+
transformFunction: null
|
|
217
|
+
},
|
|
218
|
+
editBtnDisabled: {
|
|
219
|
+
classPropertyName: "editBtnDisabled",
|
|
220
|
+
publicName: "editBtnDisabled",
|
|
221
|
+
isSignal: true,
|
|
222
|
+
isRequired: false,
|
|
223
|
+
transformFunction: null
|
|
224
|
+
},
|
|
225
|
+
removeBtnDisabled: {
|
|
226
|
+
classPropertyName: "removeBtnDisabled",
|
|
227
|
+
publicName: "removeBtnDisabled",
|
|
228
|
+
isSignal: true,
|
|
229
|
+
isRequired: false,
|
|
230
|
+
transformFunction: null
|
|
231
|
+
},
|
|
232
|
+
copyBtnDisabled: {
|
|
233
|
+
classPropertyName: "copyBtnDisabled",
|
|
234
|
+
publicName: "copyBtnDisabled",
|
|
235
|
+
isSignal: true,
|
|
236
|
+
isRequired: false,
|
|
237
|
+
transformFunction: null
|
|
238
|
+
},
|
|
239
|
+
excelBtnDisabled: {
|
|
240
|
+
classPropertyName: "excelBtnDisabled",
|
|
241
|
+
publicName: "excelBtnDisabled",
|
|
242
|
+
isSignal: true,
|
|
243
|
+
isRequired: false,
|
|
244
|
+
transformFunction: null
|
|
245
|
+
},
|
|
246
|
+
csvBtnDisabled: {
|
|
247
|
+
classPropertyName: "csvBtnDisabled",
|
|
248
|
+
publicName: "csvBtnDisabled",
|
|
249
|
+
isSignal: true,
|
|
250
|
+
isRequired: false,
|
|
251
|
+
transformFunction: null
|
|
252
|
+
},
|
|
253
|
+
pdfBtnDisabled: {
|
|
254
|
+
classPropertyName: "pdfBtnDisabled",
|
|
255
|
+
publicName: "pdfBtnDisabled",
|
|
256
|
+
isSignal: true,
|
|
257
|
+
isRequired: false,
|
|
258
|
+
transformFunction: null
|
|
259
|
+
},
|
|
260
|
+
printBtnDisabled: {
|
|
261
|
+
classPropertyName: "printBtnDisabled",
|
|
262
|
+
publicName: "printBtnDisabled",
|
|
263
|
+
isSignal: true,
|
|
264
|
+
isRequired: false,
|
|
265
|
+
transformFunction: null
|
|
266
|
+
},
|
|
267
|
+
refreshBtnDisabled: {
|
|
268
|
+
classPropertyName: "refreshBtnDisabled",
|
|
269
|
+
publicName: "refreshBtnDisabled",
|
|
270
|
+
isSignal: true,
|
|
271
|
+
isRequired: false,
|
|
272
|
+
transformFunction: null
|
|
273
|
+
},
|
|
274
|
+
clearBtnDisabled: {
|
|
275
|
+
classPropertyName: "clearBtnDisabled",
|
|
276
|
+
publicName: "clearBtnDisabled",
|
|
277
|
+
isSignal: true,
|
|
278
|
+
isRequired: false,
|
|
279
|
+
transformFunction: null
|
|
280
|
+
},
|
|
281
|
+
newBtnTooltip: {
|
|
282
|
+
classPropertyName: "newBtnTooltip",
|
|
283
|
+
publicName: "newBtnTooltip",
|
|
284
|
+
isSignal: true,
|
|
285
|
+
isRequired: false,
|
|
286
|
+
transformFunction: null
|
|
287
|
+
},
|
|
288
|
+
editBtnTooltip: {
|
|
289
|
+
classPropertyName: "editBtnTooltip",
|
|
290
|
+
publicName: "editBtnTooltip",
|
|
291
|
+
isSignal: true,
|
|
292
|
+
isRequired: false,
|
|
293
|
+
transformFunction: null
|
|
294
|
+
},
|
|
295
|
+
removeBtnTooltip: {
|
|
296
|
+
classPropertyName: "removeBtnTooltip",
|
|
297
|
+
publicName: "removeBtnTooltip",
|
|
298
|
+
isSignal: true,
|
|
299
|
+
isRequired: false,
|
|
300
|
+
transformFunction: null
|
|
301
|
+
},
|
|
302
|
+
copyBtnTooltip: {
|
|
303
|
+
classPropertyName: "copyBtnTooltip",
|
|
304
|
+
publicName: "copyBtnTooltip",
|
|
305
|
+
isSignal: true,
|
|
306
|
+
isRequired: false,
|
|
307
|
+
transformFunction: null
|
|
308
|
+
},
|
|
309
|
+
excelBtnTooltip: {
|
|
310
|
+
classPropertyName: "excelBtnTooltip",
|
|
311
|
+
publicName: "excelBtnTooltip",
|
|
312
|
+
isSignal: true,
|
|
313
|
+
isRequired: false,
|
|
314
|
+
transformFunction: null
|
|
315
|
+
},
|
|
316
|
+
csvBtnTooltip: {
|
|
317
|
+
classPropertyName: "csvBtnTooltip",
|
|
318
|
+
publicName: "csvBtnTooltip",
|
|
319
|
+
isSignal: true,
|
|
320
|
+
isRequired: false,
|
|
321
|
+
transformFunction: null
|
|
322
|
+
},
|
|
323
|
+
pdfBtnTooltip: {
|
|
324
|
+
classPropertyName: "pdfBtnTooltip",
|
|
325
|
+
publicName: "pdfBtnTooltip",
|
|
326
|
+
isSignal: true,
|
|
327
|
+
isRequired: false,
|
|
328
|
+
transformFunction: null
|
|
329
|
+
},
|
|
330
|
+
printBtnTooltip: {
|
|
331
|
+
classPropertyName: "printBtnTooltip",
|
|
332
|
+
publicName: "printBtnTooltip",
|
|
333
|
+
isSignal: true,
|
|
334
|
+
isRequired: false,
|
|
335
|
+
transformFunction: null
|
|
336
|
+
},
|
|
337
|
+
refreshBtnTooltip: {
|
|
338
|
+
classPropertyName: "refreshBtnTooltip",
|
|
339
|
+
publicName: "refreshBtnTooltip",
|
|
340
|
+
isSignal: true,
|
|
341
|
+
isRequired: false,
|
|
342
|
+
transformFunction: null
|
|
343
|
+
},
|
|
344
|
+
clearBtnTooltip: {
|
|
345
|
+
classPropertyName: "clearBtnTooltip",
|
|
346
|
+
publicName: "clearBtnTooltip",
|
|
347
|
+
isSignal: true,
|
|
348
|
+
isRequired: false,
|
|
349
|
+
transformFunction: null
|
|
350
|
+
},
|
|
351
|
+
newBtnOpt: {
|
|
352
|
+
classPropertyName: "newBtnOpt",
|
|
353
|
+
publicName: "newBtnOpt",
|
|
354
|
+
isSignal: true,
|
|
355
|
+
isRequired: false,
|
|
356
|
+
transformFunction: null
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
outputs: {
|
|
360
|
+
clickedNewBtn: "clickedNewBtn",
|
|
361
|
+
clickedEditBtn: "clickedEditBtn",
|
|
362
|
+
clickedRemoveBtn: "clickedRemoveBtn",
|
|
363
|
+
clickedCopyBtn: "clickedCopyBtn",
|
|
364
|
+
clickedExcelBtn: "clickedExcelBtn",
|
|
365
|
+
clickedCsvBtn: "clickedCsvBtn",
|
|
366
|
+
clickedPdfBtn: "clickedPdfBtn",
|
|
367
|
+
clickedPrintBtn: "clickedPrintBtn",
|
|
368
|
+
clickedRefreshBtn: "clickedRefreshBtn",
|
|
369
|
+
clickedClearBtn: "clickedClearBtn"
|
|
370
|
+
},
|
|
371
|
+
ngImport: i0,
|
|
372
|
+
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",
|
|
373
|
+
styles: [""],
|
|
374
|
+
dependencies: [
|
|
375
|
+
{
|
|
376
|
+
kind: "component",
|
|
377
|
+
type: MatToolbar,
|
|
378
|
+
selector: "mat-toolbar",
|
|
379
|
+
inputs: ["color"],
|
|
380
|
+
exportAs: ["matToolbar"]
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
kind: "component",
|
|
384
|
+
type: MatIconButton,
|
|
385
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
386
|
+
exportAs: ["matButton", "matAnchor"]
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
kind: "directive",
|
|
390
|
+
type: MatTooltip,
|
|
391
|
+
selector: "[matTooltip]",
|
|
392
|
+
inputs: [
|
|
393
|
+
"matTooltipPosition",
|
|
394
|
+
"matTooltipPositionAtOrigin",
|
|
395
|
+
"matTooltipDisabled",
|
|
396
|
+
"matTooltipShowDelay",
|
|
397
|
+
"matTooltipHideDelay",
|
|
398
|
+
"matTooltipTouchGestures",
|
|
399
|
+
"matTooltip",
|
|
400
|
+
"matTooltipClass"
|
|
401
|
+
],
|
|
402
|
+
exportAs: ["matTooltip"]
|
|
169
403
|
},
|
|
170
404
|
{
|
|
171
405
|
kind: "component",
|
|
@@ -180,761 +414,112 @@ var LoginFormComponent = class LoginFormComponent {
|
|
|
180
414
|
],
|
|
181
415
|
exportAs: ["matIcon"]
|
|
182
416
|
},
|
|
417
|
+
{
|
|
418
|
+
kind: "component",
|
|
419
|
+
type: MatMenu,
|
|
420
|
+
selector: "mat-menu",
|
|
421
|
+
inputs: [
|
|
422
|
+
"backdropClass",
|
|
423
|
+
"aria-label",
|
|
424
|
+
"aria-labelledby",
|
|
425
|
+
"aria-describedby",
|
|
426
|
+
"xPosition",
|
|
427
|
+
"yPosition",
|
|
428
|
+
"overlapTrigger",
|
|
429
|
+
"hasBackdrop",
|
|
430
|
+
"class",
|
|
431
|
+
"classList"
|
|
432
|
+
],
|
|
433
|
+
outputs: ["closed", "close"],
|
|
434
|
+
exportAs: ["matMenu"]
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
kind: "component",
|
|
438
|
+
type: MatDivider,
|
|
439
|
+
selector: "mat-divider",
|
|
440
|
+
inputs: ["vertical", "inset"]
|
|
441
|
+
},
|
|
183
442
|
{
|
|
184
443
|
kind: "directive",
|
|
185
|
-
type:
|
|
186
|
-
selector: "[
|
|
187
|
-
inputs: [
|
|
444
|
+
type: MatMenuTrigger,
|
|
445
|
+
selector: "[mat-menu-trigger-for], [matMenuTriggerFor]",
|
|
446
|
+
inputs: [
|
|
447
|
+
"mat-menu-trigger-for",
|
|
448
|
+
"matMenuTriggerFor",
|
|
449
|
+
"matMenuTriggerData",
|
|
450
|
+
"matMenuTriggerRestoreFocus"
|
|
451
|
+
],
|
|
452
|
+
outputs: [
|
|
453
|
+
"menuOpened",
|
|
454
|
+
"onMenuOpen",
|
|
455
|
+
"menuClosed",
|
|
456
|
+
"onMenuClose"
|
|
457
|
+
],
|
|
458
|
+
exportAs: ["matMenuTrigger"]
|
|
188
459
|
},
|
|
189
460
|
{
|
|
190
461
|
kind: "component",
|
|
191
|
-
type:
|
|
192
|
-
selector: "
|
|
193
|
-
inputs: [
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
462
|
+
type: MatMenuItem,
|
|
463
|
+
selector: "[mat-menu-item]",
|
|
464
|
+
inputs: [
|
|
465
|
+
"role",
|
|
466
|
+
"disabled",
|
|
467
|
+
"disabledInteractive",
|
|
468
|
+
"disableRipple"
|
|
469
|
+
],
|
|
470
|
+
exportAs: ["matMenuItem"]
|
|
471
|
+
}
|
|
472
|
+
],
|
|
473
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
197
474
|
});
|
|
198
475
|
};
|
|
199
476
|
i0.ɵɵngDeclareClassMetadata({
|
|
200
477
|
minVersion: "12.0.0",
|
|
201
478
|
version: "22.2.2",
|
|
202
479
|
ngImport: i0,
|
|
203
|
-
type:
|
|
480
|
+
type: BaseToolbarComponent,
|
|
204
481
|
decorators: [{
|
|
205
482
|
type: Component,
|
|
206
483
|
args: [{
|
|
207
|
-
selector: "ngx-uik-
|
|
484
|
+
selector: "ngx-uik-base-toolbar",
|
|
485
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
208
486
|
imports: [
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
MatCardHeader,
|
|
213
|
-
MatCardTitle,
|
|
214
|
-
MatCardContent,
|
|
215
|
-
MatFormField,
|
|
216
|
-
MatLabel,
|
|
217
|
-
MatInput,
|
|
218
|
-
MatError,
|
|
487
|
+
MatToolbar,
|
|
488
|
+
MatIconButton,
|
|
489
|
+
MatTooltip,
|
|
219
490
|
MatIcon,
|
|
220
|
-
|
|
221
|
-
|
|
491
|
+
MatMenu,
|
|
492
|
+
MatDivider,
|
|
493
|
+
MatMenuTrigger,
|
|
494
|
+
MatMenuItem
|
|
222
495
|
],
|
|
223
|
-
template: "<mat-
|
|
224
|
-
styles: [":host{display:flex;justify-content:center;margin:32px 0}form{display:flex;flex-direction:column;gap:16px}.login-field{width:100%;min-width:300px}mat-card-header{justify-content:center}mat-card-content{font-size:16px}.loginButtons{display:flex;flex-direction:row;justify-content:flex-end}.watcher{cursor:default}\n"]
|
|
496
|
+
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"
|
|
225
497
|
}]
|
|
226
498
|
}],
|
|
227
499
|
propDecorators: {
|
|
228
|
-
|
|
500
|
+
rolesNewBtn: [{
|
|
229
501
|
type: i0.Input,
|
|
230
502
|
args: [{
|
|
231
503
|
isSignal: true,
|
|
232
|
-
alias: "
|
|
504
|
+
alias: "rolesNewBtn",
|
|
233
505
|
required: false
|
|
234
506
|
}]
|
|
235
507
|
}],
|
|
236
|
-
|
|
237
|
-
type: i0.
|
|
238
|
-
args: [
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
hidy = viewChild("hidy", ...ngDevMode ? [{ debugName: "hidy" }] : /* istanbul ignore next */ []);
|
|
244
|
-
submitted = output();
|
|
245
|
-
constructor() {
|
|
246
|
-
effect(() => {
|
|
247
|
-
const inputEl = this.hidy()?.nativeElement;
|
|
248
|
-
if (inputEl) inputEl.focus();
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
focusInput() {
|
|
252
|
-
this.hidy()?.nativeElement.focus();
|
|
253
|
-
}
|
|
254
|
-
onKeydown(event) {
|
|
255
|
-
if (event.key === "Enter") {
|
|
256
|
-
const inputEl = this.hidy()?.nativeElement;
|
|
257
|
-
if (inputEl?.value) {
|
|
258
|
-
this.submitted.emit(inputEl.value);
|
|
259
|
-
inputEl.value = "";
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
264
|
-
minVersion: "12.0.0",
|
|
265
|
-
version: "22.2.2",
|
|
266
|
-
ngImport: i0,
|
|
267
|
-
type: PermitFormComponent,
|
|
268
|
-
deps: [],
|
|
269
|
-
target: i0.ɵɵFactoryTarget.Component
|
|
270
|
-
});
|
|
271
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
272
|
-
minVersion: "17.2.0",
|
|
273
|
-
version: "22.2.2",
|
|
274
|
-
type: PermitFormComponent,
|
|
275
|
-
isStandalone: true,
|
|
276
|
-
selector: "ngx-uik-permit-form",
|
|
277
|
-
outputs: { submitted: "submitted" },
|
|
278
|
-
viewQueries: [{
|
|
279
|
-
propertyName: "hidy",
|
|
280
|
-
first: true,
|
|
281
|
-
predicate: ["hidy"],
|
|
282
|
-
descendants: true,
|
|
283
|
-
isSignal: true
|
|
508
|
+
rolesEditBtn: [{
|
|
509
|
+
type: i0.Input,
|
|
510
|
+
args: [{
|
|
511
|
+
isSignal: true,
|
|
512
|
+
alias: "rolesEditBtn",
|
|
513
|
+
required: false
|
|
514
|
+
}]
|
|
284
515
|
}],
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
selector: "mat-card",
|
|
293
|
-
inputs: ["appearance"],
|
|
294
|
-
exportAs: ["matCard"]
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
kind: "component",
|
|
298
|
-
type: MatCardHeader,
|
|
299
|
-
selector: "mat-card-header"
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
kind: "directive",
|
|
303
|
-
type: MatCardTitle,
|
|
304
|
-
selector: "mat-card-title, [mat-card-title], [matCardTitle]"
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
kind: "directive",
|
|
308
|
-
type: MatCardContent,
|
|
309
|
-
selector: "mat-card-content"
|
|
310
|
-
}
|
|
311
|
-
]
|
|
312
|
-
});
|
|
313
|
-
};
|
|
314
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
315
|
-
minVersion: "12.0.0",
|
|
316
|
-
version: "22.2.2",
|
|
317
|
-
ngImport: i0,
|
|
318
|
-
type: PermitFormComponent,
|
|
319
|
-
decorators: [{
|
|
320
|
-
type: Component,
|
|
321
|
-
args: [{
|
|
322
|
-
selector: "ngx-uik-permit-form",
|
|
323
|
-
imports: [
|
|
324
|
-
MatCard,
|
|
325
|
-
MatCardHeader,
|
|
326
|
-
MatCardTitle,
|
|
327
|
-
MatCardContent
|
|
328
|
-
],
|
|
329
|
-
template: "<mat-card appearance=\"outlined\">\r\n <mat-card-header>\r\n <mat-card-title>\r\n Приложите пропуск\r\n </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <div class=\"permit\"></div>\r\n </mat-card-content>\r\n</mat-card>\r\n<input #hidy class=\"hidy\" type=\"text\" (keydown)=\"onKeydown($event)\"/>",
|
|
330
|
-
styles: [":host{display:flex;justify-content:center;margin:32px 0}.mat-mdc-form-field{width:100%;min-width:300px}mat-card-title,mat-card-content{display:flex;justify-content:center}mat-card-content{font-size:16px}div.permit{border:none;width:300px;background-size:300px;height:180px}div.permit button div{margin-bottom:200px;color:#000;font-size:34px}input.hidy{opacity:0;position:absolute;left:-200px;top:-200px}\n"]
|
|
331
|
-
}]
|
|
332
|
-
}],
|
|
333
|
-
ctorParameters: () => [],
|
|
334
|
-
propDecorators: {
|
|
335
|
-
hidy: [{
|
|
336
|
-
type: i0.ViewChild,
|
|
337
|
-
args: ["hidy", { isSignal: true }]
|
|
338
|
-
}],
|
|
339
|
-
submitted: [{
|
|
340
|
-
type: i0.Output,
|
|
341
|
-
args: ["submitted"]
|
|
342
|
-
}]
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
var LoginPageComponent = class LoginPageComponent {
|
|
346
|
-
pending = signal(false, ...ngDevMode ? [{ debugName: "pending" }] : /* istanbul ignore next */ []);
|
|
347
|
-
isKiosk = signal(false, ...ngDevMode ? [{ debugName: "isKiosk" }] : /* istanbul ignore next */ []);
|
|
348
|
-
idCas = input(0, ...ngDevMode ? [{ debugName: "idCas" }] : /* istanbul ignore next */ []);
|
|
349
|
-
authService = inject(AuthService);
|
|
350
|
-
router = inject(Router);
|
|
351
|
-
notificationService = inject(UIKIT_NOTIFICATION_TOKEN, { optional: true });
|
|
352
|
-
constructor() {
|
|
353
|
-
if (localStorage.getItem("id_human") || localStorage.getItem("kiosk-keyboard-layout")) {}
|
|
354
|
-
}
|
|
355
|
-
async onSubmit(event) {
|
|
356
|
-
this.startLoading();
|
|
357
|
-
try {
|
|
358
|
-
await lastValueFrom(this.authService.login(event.username, event.password, this.idCas()));
|
|
359
|
-
this.handleSuccessLogin();
|
|
360
|
-
} catch (error) {
|
|
361
|
-
this.handleError(error);
|
|
362
|
-
} finally {
|
|
363
|
-
this.finishLoading();
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
async onSubmitPermit(permit) {
|
|
367
|
-
this.startLoading();
|
|
368
|
-
try {
|
|
369
|
-
await lastValueFrom(this.authService.loginByPermit(permit, this.idCas()));
|
|
370
|
-
this.handleSuccessLogin();
|
|
371
|
-
} catch (error) {
|
|
372
|
-
this.handleError(error);
|
|
373
|
-
} finally {
|
|
374
|
-
this.finishLoading();
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
startLoading() {
|
|
378
|
-
this.pending.set(true);
|
|
379
|
-
}
|
|
380
|
-
finishLoading() {
|
|
381
|
-
this.pending.set(false);
|
|
382
|
-
}
|
|
383
|
-
handleError(error) {
|
|
384
|
-
const errorMsg = "Ошибка при авторизации: " + (error.error || error.error?.message || error.message);
|
|
385
|
-
this.notificationService?.error(errorMsg, 0);
|
|
386
|
-
}
|
|
387
|
-
handleSuccessLogin() {
|
|
388
|
-
this.notificationService?.success("Успешная авторизация");
|
|
389
|
-
if (!this.router) return;
|
|
390
|
-
const returnUrl = this.router.parseUrl(this.router.url).queryParamMap.get("returnUrl");
|
|
391
|
-
if (returnUrl) this.router.navigateByUrl(decodeURIComponent(returnUrl));
|
|
392
|
-
else this.router.navigate(["/"]);
|
|
393
|
-
}
|
|
394
|
-
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
395
|
-
minVersion: "12.0.0",
|
|
396
|
-
version: "22.2.2",
|
|
397
|
-
ngImport: i0,
|
|
398
|
-
type: LoginPageComponent,
|
|
399
|
-
deps: [],
|
|
400
|
-
target: i0.ɵɵFactoryTarget.Component
|
|
401
|
-
});
|
|
402
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
403
|
-
minVersion: "17.0.0",
|
|
404
|
-
version: "22.2.2",
|
|
405
|
-
type: LoginPageComponent,
|
|
406
|
-
isStandalone: true,
|
|
407
|
-
selector: "ngx-uik-login-page",
|
|
408
|
-
inputs: { idCas: {
|
|
409
|
-
classPropertyName: "idCas",
|
|
410
|
-
publicName: "idCas",
|
|
411
|
-
isSignal: true,
|
|
412
|
-
isRequired: false,
|
|
413
|
-
transformFunction: null
|
|
414
|
-
} },
|
|
415
|
-
ngImport: i0,
|
|
416
|
-
template: "@if (isKiosk()) {\r\n <ngx-uik-permit-form (submitted)=\"onSubmitPermit($event)\" />\r\n} @else {\r\n <ngx-uik-login-form (submitted)=\"onSubmit($event)\" [pending]=\"pending()\" />\r\n}\r\n",
|
|
417
|
-
styles: [""],
|
|
418
|
-
dependencies: [{
|
|
419
|
-
kind: "component",
|
|
420
|
-
type: LoginFormComponent,
|
|
421
|
-
selector: "ngx-uik-login-form",
|
|
422
|
-
inputs: ["pending"],
|
|
423
|
-
outputs: ["submitted"]
|
|
424
|
-
}, {
|
|
425
|
-
kind: "component",
|
|
426
|
-
type: PermitFormComponent,
|
|
427
|
-
selector: "ngx-uik-permit-form",
|
|
428
|
-
outputs: ["submitted"]
|
|
429
|
-
}]
|
|
430
|
-
});
|
|
431
|
-
};
|
|
432
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
433
|
-
minVersion: "12.0.0",
|
|
434
|
-
version: "22.2.2",
|
|
435
|
-
ngImport: i0,
|
|
436
|
-
type: LoginPageComponent,
|
|
437
|
-
decorators: [{
|
|
438
|
-
type: Component,
|
|
439
|
-
args: [{
|
|
440
|
-
selector: "ngx-uik-login-page",
|
|
441
|
-
imports: [LoginFormComponent, PermitFormComponent],
|
|
442
|
-
template: "@if (isKiosk()) {\r\n <ngx-uik-permit-form (submitted)=\"onSubmitPermit($event)\" />\r\n} @else {\r\n <ngx-uik-login-form (submitted)=\"onSubmit($event)\" [pending]=\"pending()\" />\r\n}\r\n"
|
|
443
|
-
}]
|
|
444
|
-
}],
|
|
445
|
-
ctorParameters: () => [],
|
|
446
|
-
propDecorators: { idCas: [{
|
|
447
|
-
type: i0.Input,
|
|
448
|
-
args: [{
|
|
449
|
-
isSignal: true,
|
|
450
|
-
alias: "idCas",
|
|
451
|
-
required: false
|
|
452
|
-
}]
|
|
453
|
-
}] }
|
|
454
|
-
});
|
|
455
|
-
var BaseToolbarComponent = class BaseToolbarComponent {
|
|
456
|
-
rolesNewBtn = input([], ...ngDevMode ? [{ debugName: "rolesNewBtn" }] : /* istanbul ignore next */ []);
|
|
457
|
-
rolesEditBtn = input([], ...ngDevMode ? [{ debugName: "rolesEditBtn" }] : /* istanbul ignore next */ []);
|
|
458
|
-
rolesRemoveBtn = input([], ...ngDevMode ? [{ debugName: "rolesRemoveBtn" }] : /* istanbul ignore next */ []);
|
|
459
|
-
rolesCopyBtn = input([], ...ngDevMode ? [{ debugName: "rolesCopyBtn" }] : /* istanbul ignore next */ []);
|
|
460
|
-
rolesExcelBtn = input([], ...ngDevMode ? [{ debugName: "rolesExcelBtn" }] : /* istanbul ignore next */ []);
|
|
461
|
-
rolesCsvBtn = input([], ...ngDevMode ? [{ debugName: "rolesCsvBtn" }] : /* istanbul ignore next */ []);
|
|
462
|
-
rolesPdfBtn = input([], ...ngDevMode ? [{ debugName: "rolesPdfBtn" }] : /* istanbul ignore next */ []);
|
|
463
|
-
rolesPrintBtn = input([], ...ngDevMode ? [{ debugName: "rolesPrintBtn" }] : /* istanbul ignore next */ []);
|
|
464
|
-
rolesRefreshBtn = input([], ...ngDevMode ? [{ debugName: "rolesRefreshBtn" }] : /* istanbul ignore next */ []);
|
|
465
|
-
rolesClearBtn = input([], ...ngDevMode ? [{ debugName: "rolesClearBtn" }] : /* istanbul ignore next */ []);
|
|
466
|
-
newBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "newBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
467
|
-
editBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "editBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
468
|
-
removeBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "removeBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
469
|
-
copyBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "copyBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
470
|
-
excelBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "excelBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
471
|
-
csvBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "csvBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
472
|
-
pdfBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "pdfBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
473
|
-
printBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "printBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
474
|
-
refreshBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "refreshBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
475
|
-
clearBtnDisabled = input(false, ...ngDevMode ? [{ debugName: "clearBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
476
|
-
newBtnTooltip = input("Добавить", ...ngDevMode ? [{ debugName: "newBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
477
|
-
editBtnTooltip = input("Изменить", ...ngDevMode ? [{ debugName: "editBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
478
|
-
removeBtnTooltip = input("Удалить", ...ngDevMode ? [{ debugName: "removeBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
479
|
-
copyBtnTooltip = input("Скопировать", ...ngDevMode ? [{ debugName: "copyBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
480
|
-
excelBtnTooltip = input("Экспортировать в Excel", ...ngDevMode ? [{ debugName: "excelBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
481
|
-
csvBtnTooltip = input("Экспортировать в Csv", ...ngDevMode ? [{ debugName: "csvBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
482
|
-
pdfBtnTooltip = input("Экспортировать в Pdf", ...ngDevMode ? [{ debugName: "pdfBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
483
|
-
printBtnTooltip = input("Печатать", ...ngDevMode ? [{ debugName: "printBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
484
|
-
refreshBtnTooltip = input("Обновить данные", ...ngDevMode ? [{ debugName: "refreshBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
485
|
-
clearBtnTooltip = input("Очистить фильтр", ...ngDevMode ? [{ debugName: "clearBtnTooltip" }] : /* istanbul ignore next */ []);
|
|
486
|
-
newBtnOpt = input([], ...ngDevMode ? [{ debugName: "newBtnOpt" }] : /* istanbul ignore next */ []);
|
|
487
|
-
clickedNewBtn = output();
|
|
488
|
-
clickedEditBtn = output();
|
|
489
|
-
clickedRemoveBtn = output();
|
|
490
|
-
clickedCopyBtn = output();
|
|
491
|
-
clickedExcelBtn = output();
|
|
492
|
-
clickedCsvBtn = output();
|
|
493
|
-
clickedPdfBtn = output();
|
|
494
|
-
clickedPrintBtn = output();
|
|
495
|
-
clickedRefreshBtn = output();
|
|
496
|
-
clickedClearBtn = output();
|
|
497
|
-
roleService = inject(RoleService);
|
|
498
|
-
isNewBtnVisible = computed(() => this.checkVisibility(this.rolesNewBtn()), ...ngDevMode ? [{ debugName: "isNewBtnVisible" }] : /* istanbul ignore next */ []);
|
|
499
|
-
isEditBtnVisible = computed(() => this.checkVisibility(this.rolesEditBtn()), ...ngDevMode ? [{ debugName: "isEditBtnVisible" }] : /* istanbul ignore next */ []);
|
|
500
|
-
isRemoveBtnVisible = computed(() => this.checkVisibility(this.rolesRemoveBtn()), ...ngDevMode ? [{ debugName: "isRemoveBtnVisible" }] : /* istanbul ignore next */ []);
|
|
501
|
-
isCopyBtnVisible = computed(() => this.checkVisibility(this.rolesCopyBtn()), ...ngDevMode ? [{ debugName: "isCopyBtnVisible" }] : /* istanbul ignore next */ []);
|
|
502
|
-
isExcelBtnVisible = computed(() => this.checkVisibility(this.rolesExcelBtn()), ...ngDevMode ? [{ debugName: "isExcelBtnVisible" }] : /* istanbul ignore next */ []);
|
|
503
|
-
isCsvBtnVisible = computed(() => this.checkVisibility(this.rolesCsvBtn()), ...ngDevMode ? [{ debugName: "isCsvBtnVisible" }] : /* istanbul ignore next */ []);
|
|
504
|
-
isPdfBtnVisible = computed(() => this.checkVisibility(this.rolesPdfBtn()), ...ngDevMode ? [{ debugName: "isPdfBtnVisible" }] : /* istanbul ignore next */ []);
|
|
505
|
-
isPrintBtnVisible = computed(() => this.checkVisibility(this.rolesPrintBtn()), ...ngDevMode ? [{ debugName: "isPrintBtnVisible" }] : /* istanbul ignore next */ []);
|
|
506
|
-
isRefreshBtnVisible = computed(() => this.checkVisibility(this.rolesRefreshBtn()), ...ngDevMode ? [{ debugName: "isRefreshBtnVisible" }] : /* istanbul ignore next */ []);
|
|
507
|
-
isClearBtnVisible = computed(() => this.checkVisibility(this.rolesClearBtn()), ...ngDevMode ? [{ debugName: "isClearBtnVisible" }] : /* istanbul ignore next */ []);
|
|
508
|
-
checkVisibility(forbiddenRoles) {
|
|
509
|
-
return !this.roleService.hasForbiddenRole(forbiddenRoles);
|
|
510
|
-
}
|
|
511
|
-
onNewClick() {
|
|
512
|
-
this.clickedNewBtn.emit();
|
|
513
|
-
}
|
|
514
|
-
onEditClick() {
|
|
515
|
-
this.clickedEditBtn.emit();
|
|
516
|
-
}
|
|
517
|
-
onRemoveClick() {
|
|
518
|
-
this.clickedRemoveBtn.emit();
|
|
519
|
-
}
|
|
520
|
-
onCopyClick() {
|
|
521
|
-
this.clickedCopyBtn.emit();
|
|
522
|
-
}
|
|
523
|
-
onExcelClick() {
|
|
524
|
-
this.clickedExcelBtn.emit();
|
|
525
|
-
}
|
|
526
|
-
onCsvClick() {
|
|
527
|
-
this.clickedCsvBtn.emit();
|
|
528
|
-
}
|
|
529
|
-
onPdfClick() {
|
|
530
|
-
this.clickedPdfBtn.emit();
|
|
531
|
-
}
|
|
532
|
-
onPrintClick() {
|
|
533
|
-
this.clickedPrintBtn.emit();
|
|
534
|
-
}
|
|
535
|
-
onRefreshGridClick() {
|
|
536
|
-
this.clickedRefreshBtn.emit();
|
|
537
|
-
}
|
|
538
|
-
onClearClick() {
|
|
539
|
-
this.clickedClearBtn.emit();
|
|
540
|
-
}
|
|
541
|
-
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
542
|
-
minVersion: "12.0.0",
|
|
543
|
-
version: "22.2.2",
|
|
544
|
-
ngImport: i0,
|
|
545
|
-
type: BaseToolbarComponent,
|
|
546
|
-
deps: [],
|
|
547
|
-
target: i0.ɵɵFactoryTarget.Component
|
|
548
|
-
});
|
|
549
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
550
|
-
minVersion: "17.0.0",
|
|
551
|
-
version: "22.2.2",
|
|
552
|
-
type: BaseToolbarComponent,
|
|
553
|
-
isStandalone: true,
|
|
554
|
-
selector: "ngx-uik-base-toolbar",
|
|
555
|
-
inputs: {
|
|
556
|
-
rolesNewBtn: {
|
|
557
|
-
classPropertyName: "rolesNewBtn",
|
|
558
|
-
publicName: "rolesNewBtn",
|
|
559
|
-
isSignal: true,
|
|
560
|
-
isRequired: false,
|
|
561
|
-
transformFunction: null
|
|
562
|
-
},
|
|
563
|
-
rolesEditBtn: {
|
|
564
|
-
classPropertyName: "rolesEditBtn",
|
|
565
|
-
publicName: "rolesEditBtn",
|
|
566
|
-
isSignal: true,
|
|
567
|
-
isRequired: false,
|
|
568
|
-
transformFunction: null
|
|
569
|
-
},
|
|
570
|
-
rolesRemoveBtn: {
|
|
571
|
-
classPropertyName: "rolesRemoveBtn",
|
|
572
|
-
publicName: "rolesRemoveBtn",
|
|
573
|
-
isSignal: true,
|
|
574
|
-
isRequired: false,
|
|
575
|
-
transformFunction: null
|
|
576
|
-
},
|
|
577
|
-
rolesCopyBtn: {
|
|
578
|
-
classPropertyName: "rolesCopyBtn",
|
|
579
|
-
publicName: "rolesCopyBtn",
|
|
580
|
-
isSignal: true,
|
|
581
|
-
isRequired: false,
|
|
582
|
-
transformFunction: null
|
|
583
|
-
},
|
|
584
|
-
rolesExcelBtn: {
|
|
585
|
-
classPropertyName: "rolesExcelBtn",
|
|
586
|
-
publicName: "rolesExcelBtn",
|
|
587
|
-
isSignal: true,
|
|
588
|
-
isRequired: false,
|
|
589
|
-
transformFunction: null
|
|
590
|
-
},
|
|
591
|
-
rolesCsvBtn: {
|
|
592
|
-
classPropertyName: "rolesCsvBtn",
|
|
593
|
-
publicName: "rolesCsvBtn",
|
|
594
|
-
isSignal: true,
|
|
595
|
-
isRequired: false,
|
|
596
|
-
transformFunction: null
|
|
597
|
-
},
|
|
598
|
-
rolesPdfBtn: {
|
|
599
|
-
classPropertyName: "rolesPdfBtn",
|
|
600
|
-
publicName: "rolesPdfBtn",
|
|
601
|
-
isSignal: true,
|
|
602
|
-
isRequired: false,
|
|
603
|
-
transformFunction: null
|
|
604
|
-
},
|
|
605
|
-
rolesPrintBtn: {
|
|
606
|
-
classPropertyName: "rolesPrintBtn",
|
|
607
|
-
publicName: "rolesPrintBtn",
|
|
608
|
-
isSignal: true,
|
|
609
|
-
isRequired: false,
|
|
610
|
-
transformFunction: null
|
|
611
|
-
},
|
|
612
|
-
rolesRefreshBtn: {
|
|
613
|
-
classPropertyName: "rolesRefreshBtn",
|
|
614
|
-
publicName: "rolesRefreshBtn",
|
|
615
|
-
isSignal: true,
|
|
616
|
-
isRequired: false,
|
|
617
|
-
transformFunction: null
|
|
618
|
-
},
|
|
619
|
-
rolesClearBtn: {
|
|
620
|
-
classPropertyName: "rolesClearBtn",
|
|
621
|
-
publicName: "rolesClearBtn",
|
|
622
|
-
isSignal: true,
|
|
623
|
-
isRequired: false,
|
|
624
|
-
transformFunction: null
|
|
625
|
-
},
|
|
626
|
-
newBtnDisabled: {
|
|
627
|
-
classPropertyName: "newBtnDisabled",
|
|
628
|
-
publicName: "newBtnDisabled",
|
|
629
|
-
isSignal: true,
|
|
630
|
-
isRequired: false,
|
|
631
|
-
transformFunction: null
|
|
632
|
-
},
|
|
633
|
-
editBtnDisabled: {
|
|
634
|
-
classPropertyName: "editBtnDisabled",
|
|
635
|
-
publicName: "editBtnDisabled",
|
|
636
|
-
isSignal: true,
|
|
637
|
-
isRequired: false,
|
|
638
|
-
transformFunction: null
|
|
639
|
-
},
|
|
640
|
-
removeBtnDisabled: {
|
|
641
|
-
classPropertyName: "removeBtnDisabled",
|
|
642
|
-
publicName: "removeBtnDisabled",
|
|
643
|
-
isSignal: true,
|
|
644
|
-
isRequired: false,
|
|
645
|
-
transformFunction: null
|
|
646
|
-
},
|
|
647
|
-
copyBtnDisabled: {
|
|
648
|
-
classPropertyName: "copyBtnDisabled",
|
|
649
|
-
publicName: "copyBtnDisabled",
|
|
650
|
-
isSignal: true,
|
|
651
|
-
isRequired: false,
|
|
652
|
-
transformFunction: null
|
|
653
|
-
},
|
|
654
|
-
excelBtnDisabled: {
|
|
655
|
-
classPropertyName: "excelBtnDisabled",
|
|
656
|
-
publicName: "excelBtnDisabled",
|
|
657
|
-
isSignal: true,
|
|
658
|
-
isRequired: false,
|
|
659
|
-
transformFunction: null
|
|
660
|
-
},
|
|
661
|
-
csvBtnDisabled: {
|
|
662
|
-
classPropertyName: "csvBtnDisabled",
|
|
663
|
-
publicName: "csvBtnDisabled",
|
|
664
|
-
isSignal: true,
|
|
665
|
-
isRequired: false,
|
|
666
|
-
transformFunction: null
|
|
667
|
-
},
|
|
668
|
-
pdfBtnDisabled: {
|
|
669
|
-
classPropertyName: "pdfBtnDisabled",
|
|
670
|
-
publicName: "pdfBtnDisabled",
|
|
671
|
-
isSignal: true,
|
|
672
|
-
isRequired: false,
|
|
673
|
-
transformFunction: null
|
|
674
|
-
},
|
|
675
|
-
printBtnDisabled: {
|
|
676
|
-
classPropertyName: "printBtnDisabled",
|
|
677
|
-
publicName: "printBtnDisabled",
|
|
678
|
-
isSignal: true,
|
|
679
|
-
isRequired: false,
|
|
680
|
-
transformFunction: null
|
|
681
|
-
},
|
|
682
|
-
refreshBtnDisabled: {
|
|
683
|
-
classPropertyName: "refreshBtnDisabled",
|
|
684
|
-
publicName: "refreshBtnDisabled",
|
|
685
|
-
isSignal: true,
|
|
686
|
-
isRequired: false,
|
|
687
|
-
transformFunction: null
|
|
688
|
-
},
|
|
689
|
-
clearBtnDisabled: {
|
|
690
|
-
classPropertyName: "clearBtnDisabled",
|
|
691
|
-
publicName: "clearBtnDisabled",
|
|
692
|
-
isSignal: true,
|
|
693
|
-
isRequired: false,
|
|
694
|
-
transformFunction: null
|
|
695
|
-
},
|
|
696
|
-
newBtnTooltip: {
|
|
697
|
-
classPropertyName: "newBtnTooltip",
|
|
698
|
-
publicName: "newBtnTooltip",
|
|
699
|
-
isSignal: true,
|
|
700
|
-
isRequired: false,
|
|
701
|
-
transformFunction: null
|
|
702
|
-
},
|
|
703
|
-
editBtnTooltip: {
|
|
704
|
-
classPropertyName: "editBtnTooltip",
|
|
705
|
-
publicName: "editBtnTooltip",
|
|
706
|
-
isSignal: true,
|
|
707
|
-
isRequired: false,
|
|
708
|
-
transformFunction: null
|
|
709
|
-
},
|
|
710
|
-
removeBtnTooltip: {
|
|
711
|
-
classPropertyName: "removeBtnTooltip",
|
|
712
|
-
publicName: "removeBtnTooltip",
|
|
713
|
-
isSignal: true,
|
|
714
|
-
isRequired: false,
|
|
715
|
-
transformFunction: null
|
|
716
|
-
},
|
|
717
|
-
copyBtnTooltip: {
|
|
718
|
-
classPropertyName: "copyBtnTooltip",
|
|
719
|
-
publicName: "copyBtnTooltip",
|
|
720
|
-
isSignal: true,
|
|
721
|
-
isRequired: false,
|
|
722
|
-
transformFunction: null
|
|
723
|
-
},
|
|
724
|
-
excelBtnTooltip: {
|
|
725
|
-
classPropertyName: "excelBtnTooltip",
|
|
726
|
-
publicName: "excelBtnTooltip",
|
|
727
|
-
isSignal: true,
|
|
728
|
-
isRequired: false,
|
|
729
|
-
transformFunction: null
|
|
730
|
-
},
|
|
731
|
-
csvBtnTooltip: {
|
|
732
|
-
classPropertyName: "csvBtnTooltip",
|
|
733
|
-
publicName: "csvBtnTooltip",
|
|
734
|
-
isSignal: true,
|
|
735
|
-
isRequired: false,
|
|
736
|
-
transformFunction: null
|
|
737
|
-
},
|
|
738
|
-
pdfBtnTooltip: {
|
|
739
|
-
classPropertyName: "pdfBtnTooltip",
|
|
740
|
-
publicName: "pdfBtnTooltip",
|
|
741
|
-
isSignal: true,
|
|
742
|
-
isRequired: false,
|
|
743
|
-
transformFunction: null
|
|
744
|
-
},
|
|
745
|
-
printBtnTooltip: {
|
|
746
|
-
classPropertyName: "printBtnTooltip",
|
|
747
|
-
publicName: "printBtnTooltip",
|
|
748
|
-
isSignal: true,
|
|
749
|
-
isRequired: false,
|
|
750
|
-
transformFunction: null
|
|
751
|
-
},
|
|
752
|
-
refreshBtnTooltip: {
|
|
753
|
-
classPropertyName: "refreshBtnTooltip",
|
|
754
|
-
publicName: "refreshBtnTooltip",
|
|
755
|
-
isSignal: true,
|
|
756
|
-
isRequired: false,
|
|
757
|
-
transformFunction: null
|
|
758
|
-
},
|
|
759
|
-
clearBtnTooltip: {
|
|
760
|
-
classPropertyName: "clearBtnTooltip",
|
|
761
|
-
publicName: "clearBtnTooltip",
|
|
762
|
-
isSignal: true,
|
|
763
|
-
isRequired: false,
|
|
764
|
-
transformFunction: null
|
|
765
|
-
},
|
|
766
|
-
newBtnOpt: {
|
|
767
|
-
classPropertyName: "newBtnOpt",
|
|
768
|
-
publicName: "newBtnOpt",
|
|
769
|
-
isSignal: true,
|
|
770
|
-
isRequired: false,
|
|
771
|
-
transformFunction: null
|
|
772
|
-
}
|
|
773
|
-
},
|
|
774
|
-
outputs: {
|
|
775
|
-
clickedNewBtn: "clickedNewBtn",
|
|
776
|
-
clickedEditBtn: "clickedEditBtn",
|
|
777
|
-
clickedRemoveBtn: "clickedRemoveBtn",
|
|
778
|
-
clickedCopyBtn: "clickedCopyBtn",
|
|
779
|
-
clickedExcelBtn: "clickedExcelBtn",
|
|
780
|
-
clickedCsvBtn: "clickedCsvBtn",
|
|
781
|
-
clickedPdfBtn: "clickedPdfBtn",
|
|
782
|
-
clickedPrintBtn: "clickedPrintBtn",
|
|
783
|
-
clickedRefreshBtn: "clickedRefreshBtn",
|
|
784
|
-
clickedClearBtn: "clickedClearBtn"
|
|
785
|
-
},
|
|
786
|
-
ngImport: i0,
|
|
787
|
-
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",
|
|
788
|
-
styles: [""],
|
|
789
|
-
dependencies: [
|
|
790
|
-
{
|
|
791
|
-
kind: "component",
|
|
792
|
-
type: MatToolbar,
|
|
793
|
-
selector: "mat-toolbar",
|
|
794
|
-
inputs: ["color"],
|
|
795
|
-
exportAs: ["matToolbar"]
|
|
796
|
-
},
|
|
797
|
-
{
|
|
798
|
-
kind: "component",
|
|
799
|
-
type: MatIconButton,
|
|
800
|
-
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
801
|
-
exportAs: ["matButton", "matAnchor"]
|
|
802
|
-
},
|
|
803
|
-
{
|
|
804
|
-
kind: "directive",
|
|
805
|
-
type: MatTooltip,
|
|
806
|
-
selector: "[matTooltip]",
|
|
807
|
-
inputs: [
|
|
808
|
-
"matTooltipPosition",
|
|
809
|
-
"matTooltipPositionAtOrigin",
|
|
810
|
-
"matTooltipDisabled",
|
|
811
|
-
"matTooltipShowDelay",
|
|
812
|
-
"matTooltipHideDelay",
|
|
813
|
-
"matTooltipTouchGestures",
|
|
814
|
-
"matTooltip",
|
|
815
|
-
"matTooltipClass"
|
|
816
|
-
],
|
|
817
|
-
exportAs: ["matTooltip"]
|
|
818
|
-
},
|
|
819
|
-
{
|
|
820
|
-
kind: "component",
|
|
821
|
-
type: MatIcon,
|
|
822
|
-
selector: "mat-icon",
|
|
823
|
-
inputs: [
|
|
824
|
-
"color",
|
|
825
|
-
"inline",
|
|
826
|
-
"svgIcon",
|
|
827
|
-
"fontSet",
|
|
828
|
-
"fontIcon"
|
|
829
|
-
],
|
|
830
|
-
exportAs: ["matIcon"]
|
|
831
|
-
},
|
|
832
|
-
{
|
|
833
|
-
kind: "component",
|
|
834
|
-
type: MatMenu,
|
|
835
|
-
selector: "mat-menu",
|
|
836
|
-
inputs: [
|
|
837
|
-
"backdropClass",
|
|
838
|
-
"aria-label",
|
|
839
|
-
"aria-labelledby",
|
|
840
|
-
"aria-describedby",
|
|
841
|
-
"xPosition",
|
|
842
|
-
"yPosition",
|
|
843
|
-
"overlapTrigger",
|
|
844
|
-
"hasBackdrop",
|
|
845
|
-
"class",
|
|
846
|
-
"classList"
|
|
847
|
-
],
|
|
848
|
-
outputs: ["closed", "close"],
|
|
849
|
-
exportAs: ["matMenu"]
|
|
850
|
-
},
|
|
851
|
-
{
|
|
852
|
-
kind: "component",
|
|
853
|
-
type: MatDivider,
|
|
854
|
-
selector: "mat-divider",
|
|
855
|
-
inputs: ["vertical", "inset"]
|
|
856
|
-
},
|
|
857
|
-
{
|
|
858
|
-
kind: "directive",
|
|
859
|
-
type: MatMenuTrigger,
|
|
860
|
-
selector: "[mat-menu-trigger-for], [matMenuTriggerFor]",
|
|
861
|
-
inputs: [
|
|
862
|
-
"mat-menu-trigger-for",
|
|
863
|
-
"matMenuTriggerFor",
|
|
864
|
-
"matMenuTriggerData",
|
|
865
|
-
"matMenuTriggerRestoreFocus"
|
|
866
|
-
],
|
|
867
|
-
outputs: [
|
|
868
|
-
"menuOpened",
|
|
869
|
-
"onMenuOpen",
|
|
870
|
-
"menuClosed",
|
|
871
|
-
"onMenuClose"
|
|
872
|
-
],
|
|
873
|
-
exportAs: ["matMenuTrigger"]
|
|
874
|
-
},
|
|
875
|
-
{
|
|
876
|
-
kind: "component",
|
|
877
|
-
type: MatMenuItem,
|
|
878
|
-
selector: "[mat-menu-item]",
|
|
879
|
-
inputs: [
|
|
880
|
-
"role",
|
|
881
|
-
"disabled",
|
|
882
|
-
"disabledInteractive",
|
|
883
|
-
"disableRipple"
|
|
884
|
-
],
|
|
885
|
-
exportAs: ["matMenuItem"]
|
|
886
|
-
}
|
|
887
|
-
],
|
|
888
|
-
changeDetection: i0.ChangeDetectionStrategy.Eager
|
|
889
|
-
});
|
|
890
|
-
};
|
|
891
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
892
|
-
minVersion: "12.0.0",
|
|
893
|
-
version: "22.2.2",
|
|
894
|
-
ngImport: i0,
|
|
895
|
-
type: BaseToolbarComponent,
|
|
896
|
-
decorators: [{
|
|
897
|
-
type: Component,
|
|
898
|
-
args: [{
|
|
899
|
-
selector: "ngx-uik-base-toolbar",
|
|
900
|
-
changeDetection: ChangeDetectionStrategy.Eager,
|
|
901
|
-
imports: [
|
|
902
|
-
MatToolbar,
|
|
903
|
-
MatIconButton,
|
|
904
|
-
MatTooltip,
|
|
905
|
-
MatIcon,
|
|
906
|
-
MatMenu,
|
|
907
|
-
MatDivider,
|
|
908
|
-
MatMenuTrigger,
|
|
909
|
-
MatMenuItem
|
|
910
|
-
],
|
|
911
|
-
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"
|
|
912
|
-
}]
|
|
913
|
-
}],
|
|
914
|
-
propDecorators: {
|
|
915
|
-
rolesNewBtn: [{
|
|
916
|
-
type: i0.Input,
|
|
917
|
-
args: [{
|
|
918
|
-
isSignal: true,
|
|
919
|
-
alias: "rolesNewBtn",
|
|
920
|
-
required: false
|
|
921
|
-
}]
|
|
922
|
-
}],
|
|
923
|
-
rolesEditBtn: [{
|
|
924
|
-
type: i0.Input,
|
|
925
|
-
args: [{
|
|
926
|
-
isSignal: true,
|
|
927
|
-
alias: "rolesEditBtn",
|
|
928
|
-
required: false
|
|
929
|
-
}]
|
|
930
|
-
}],
|
|
931
|
-
rolesRemoveBtn: [{
|
|
932
|
-
type: i0.Input,
|
|
933
|
-
args: [{
|
|
934
|
-
isSignal: true,
|
|
935
|
-
alias: "rolesRemoveBtn",
|
|
936
|
-
required: false
|
|
937
|
-
}]
|
|
516
|
+
rolesRemoveBtn: [{
|
|
517
|
+
type: i0.Input,
|
|
518
|
+
args: [{
|
|
519
|
+
isSignal: true,
|
|
520
|
+
alias: "rolesRemoveBtn",
|
|
521
|
+
required: false
|
|
522
|
+
}]
|
|
938
523
|
}],
|
|
939
524
|
rolesCopyBtn: [{
|
|
940
525
|
type: i0.Input,
|
|
@@ -1437,50 +1022,68 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1437
1022
|
decorators: [{ type: Service }]
|
|
1438
1023
|
});
|
|
1439
1024
|
var SseService = class SseService {
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
constructor() {
|
|
1025
|
+
destroyRef = inject(DestroyRef);
|
|
1026
|
+
activeEventSource = null;
|
|
1027
|
+
stop$ = new Subject();
|
|
1028
|
+
constructor() {
|
|
1029
|
+
this.destroyRef.onDestroy(() => this.closeSseEventSource());
|
|
1030
|
+
}
|
|
1444
1031
|
createSseEventSource(baseUrl, user, topic) {
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1032
|
+
return new Observable((subscriber) => {
|
|
1033
|
+
let eventSource = null;
|
|
1034
|
+
let reconnectTimeoutId = null;
|
|
1035
|
+
let isClosed = false;
|
|
1036
|
+
const stopSubscription = this.stop$.subscribe(() => {
|
|
1037
|
+
cleanUp();
|
|
1038
|
+
subscriber.complete();
|
|
1039
|
+
});
|
|
1040
|
+
const connect = () => {
|
|
1041
|
+
if (isClosed) return;
|
|
1042
|
+
const topicUri = topic.getTopic(baseUrl, user);
|
|
1043
|
+
eventSource = new EventSource(topicUri);
|
|
1044
|
+
this.activeEventSource = eventSource;
|
|
1045
|
+
eventSource.onmessage = (event) => {
|
|
1046
|
+
try {
|
|
1047
|
+
const messageData = JSON.parse(event.data);
|
|
1048
|
+
subscriber.next(messageData);
|
|
1049
|
+
} catch (err) {
|
|
1050
|
+
console.error("Ошибка парсинга SSE данных:", err);
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
eventSource.onopen = () => {
|
|
1054
|
+
console.log("SSE connection opened.");
|
|
1055
|
+
};
|
|
1056
|
+
eventSource.onerror = (error) => {
|
|
1057
|
+
console.error("SSE error:", error);
|
|
1058
|
+
if (eventSource) eventSource.close();
|
|
1059
|
+
if (!isClosed) {
|
|
1060
|
+
console.log("Reconnecting to SSE in 1 second...");
|
|
1061
|
+
reconnectTimeoutId = setTimeout(() => connect(), 1e3);
|
|
1062
|
+
}
|
|
1063
|
+
};
|
|
1457
1064
|
};
|
|
1458
|
-
|
|
1459
|
-
|
|
1065
|
+
const cleanUp = () => {
|
|
1066
|
+
isClosed = true;
|
|
1067
|
+
if (reconnectTimeoutId) clearTimeout(reconnectTimeoutId);
|
|
1068
|
+
if (eventSource) {
|
|
1069
|
+
eventSource.close();
|
|
1070
|
+
if (this.activeEventSource === eventSource) this.activeEventSource = null;
|
|
1071
|
+
console.log("SSE Connection closed");
|
|
1072
|
+
}
|
|
1460
1073
|
};
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1074
|
+
connect();
|
|
1075
|
+
return () => {
|
|
1076
|
+
stopSubscription.unsubscribe();
|
|
1077
|
+
cleanUp();
|
|
1464
1078
|
};
|
|
1465
|
-
}
|
|
1466
|
-
return subject.asObservable();
|
|
1467
|
-
}
|
|
1468
|
-
reconnectOnError(baseUrl, user, topic, subject) {
|
|
1469
|
-
this.closeSseEventSource();
|
|
1470
|
-
if (this.isConnected) return;
|
|
1471
|
-
console.log("Reconnecting to SSE in 1 second...");
|
|
1472
|
-
setTimeout(() => {
|
|
1473
|
-
this.zone.run(() => {
|
|
1474
|
-
this.createSseEventSource(baseUrl, user, topic).subscribe(subject);
|
|
1475
|
-
});
|
|
1476
|
-
}, 1e3);
|
|
1079
|
+
});
|
|
1477
1080
|
}
|
|
1478
1081
|
closeSseEventSource() {
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
this.
|
|
1482
|
-
this.
|
|
1483
|
-
console.log("SSE Connection closed");
|
|
1082
|
+
this.stop$.next();
|
|
1083
|
+
if (this.activeEventSource) {
|
|
1084
|
+
this.activeEventSource.close();
|
|
1085
|
+
this.activeEventSource = null;
|
|
1086
|
+
console.log("SSE Connection force closed");
|
|
1484
1087
|
}
|
|
1485
1088
|
}
|
|
1486
1089
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
@@ -1489,13 +1092,14 @@ var SseService = class SseService {
|
|
|
1489
1092
|
ngImport: i0,
|
|
1490
1093
|
type: SseService,
|
|
1491
1094
|
deps: [],
|
|
1492
|
-
target: i0.ɵɵFactoryTarget.
|
|
1095
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
1493
1096
|
});
|
|
1494
|
-
static ɵprov = i0.ɵɵ
|
|
1495
|
-
minVersion: "
|
|
1097
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
1098
|
+
minVersion: "12.0.0",
|
|
1496
1099
|
version: "22.2.2",
|
|
1497
1100
|
ngImport: i0,
|
|
1498
|
-
type: SseService
|
|
1101
|
+
type: SseService,
|
|
1102
|
+
providedIn: "root"
|
|
1499
1103
|
});
|
|
1500
1104
|
};
|
|
1501
1105
|
i0.ɵɵngDeclareClassMetadata({
|
|
@@ -1503,7 +1107,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1503
1107
|
version: "22.2.2",
|
|
1504
1108
|
ngImport: i0,
|
|
1505
1109
|
type: SseService,
|
|
1506
|
-
decorators: [{
|
|
1110
|
+
decorators: [{
|
|
1111
|
+
type: Injectable,
|
|
1112
|
+
args: [{ providedIn: "root" }]
|
|
1113
|
+
}],
|
|
1507
1114
|
ctorParameters: () => []
|
|
1508
1115
|
});
|
|
1509
1116
|
var BaseFilterClass = class BaseFilterClass {
|
|
@@ -2208,7 +1815,10 @@ function isEmptyFilterValue(value) {
|
|
|
2208
1815
|
}
|
|
2209
1816
|
var BaseSignalPageClass = class BaseSignalPageClass {
|
|
2210
1817
|
dialog = inject(MatDialog);
|
|
2211
|
-
|
|
1818
|
+
router = inject(Router);
|
|
1819
|
+
localStorageService = inject(LocalStorageService);
|
|
1820
|
+
loaderService = inject(LoaderService);
|
|
1821
|
+
notificationService = inject(UIKIT_NOTIFICATION_TOKEN);
|
|
2212
1822
|
entityService;
|
|
2213
1823
|
entityEditComponent;
|
|
2214
1824
|
extraData;
|
|
@@ -2221,7 +1831,6 @@ var BaseSignalPageClass = class BaseSignalPageClass {
|
|
|
2221
1831
|
defaultPageSize = 10;
|
|
2222
1832
|
dialogEditWidth = "auto";
|
|
2223
1833
|
dialogRemoveWidth = "400px";
|
|
2224
|
-
routeAddress = "";
|
|
2225
1834
|
removalMessage = "";
|
|
2226
1835
|
pageTitle = "";
|
|
2227
1836
|
beforeOpenDialogOnNewEvent;
|
|
@@ -2234,7 +1843,10 @@ var BaseSignalPageClass = class BaseSignalPageClass {
|
|
|
2234
1843
|
executeRoles = [];
|
|
2235
1844
|
hideRoles = [HIDE_ROLE_MARKER];
|
|
2236
1845
|
allowMultiSelect = false;
|
|
1846
|
+
dblClickedEventEnable = true;
|
|
2237
1847
|
selected = signal([], ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
1848
|
+
editBtnDisabled = computed(() => !(this.selected() && this.selected().length === 1), ...ngDevMode ? [{ debugName: "editBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
1849
|
+
removeBtnDisabled = computed(() => !(this.selected() && this.selected().length > 0), ...ngDevMode ? [{ debugName: "removeBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
2238
1850
|
fnMapEntity;
|
|
2239
1851
|
dataResource;
|
|
2240
1852
|
countResource;
|
|
@@ -2254,63 +1866,8 @@ var BaseSignalPageClass = class BaseSignalPageClass {
|
|
|
2254
1866
|
if (this.dataResource.error() || this.countResource.error()) return false;
|
|
2255
1867
|
return this.dataResource.isLoading() || this.countResource.isLoading();
|
|
2256
1868
|
}, ...ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []);
|
|
2257
|
-
editBtnDisabled = computed(() => !(this.selected() && this.selected().length === 1), ...ngDevMode ? [{ debugName: "editBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
2258
|
-
removeBtnDisabled = computed(() => !(this.selected() && this.selected().length > 0), ...ngDevMode ? [{ debugName: "removeBtnDisabled" }] : /* istanbul ignore next */ []);
|
|
2259
|
-
dblClickedEventEnable = true;
|
|
2260
1869
|
opt = [];
|
|
2261
|
-
router = inject(Router);
|
|
2262
|
-
localStorageService = inject(LocalStorageService);
|
|
2263
|
-
loaderService = inject(LoaderService);
|
|
2264
|
-
notificationService = inject(UIKIT_NOTIFICATION_TOKEN);
|
|
2265
1870
|
subscription = new Subscription();
|
|
2266
|
-
getInitialFilters() {
|
|
2267
|
-
const saved = this.localStorageService.getData(this.constructor.name + "_Filters");
|
|
2268
|
-
return saved ? JSON.parse(saved) : {};
|
|
2269
|
-
}
|
|
2270
|
-
initFilters() {
|
|
2271
|
-
if (!this.filterSchema || !this.defaultFilters) return;
|
|
2272
|
-
const initial = { ...this.defaultFilters };
|
|
2273
|
-
Object.keys(this.defaultFilters).forEach((key) => {
|
|
2274
|
-
const storageKey = `${this.storagePrefix}${key}`;
|
|
2275
|
-
const rawValue = this.localStorageService.getData(storageKey);
|
|
2276
|
-
if (rawValue !== null && rawValue !== void 0) try {
|
|
2277
|
-
initial[key] = JSON.parse(rawValue);
|
|
2278
|
-
} catch {
|
|
2279
|
-
initial[key] = rawValue;
|
|
2280
|
-
}
|
|
2281
|
-
});
|
|
2282
|
-
const validation = this.filterSchema.safeParse(initial);
|
|
2283
|
-
this.filters.set(validation.success ? validation.data : this.defaultFilters);
|
|
2284
|
-
}
|
|
2285
|
-
getInitialFilters2() {
|
|
2286
|
-
const prefix = this.constructor.name + "_Filter_";
|
|
2287
|
-
const state = {};
|
|
2288
|
-
for (let i = 0; i < localStorage.length; i++) {
|
|
2289
|
-
const key = localStorage.key(i);
|
|
2290
|
-
if (key && key.startsWith(prefix)) {
|
|
2291
|
-
const filterKey = key.replace(prefix, "");
|
|
2292
|
-
const rawValue = this.localStorageService.getData(key);
|
|
2293
|
-
try {
|
|
2294
|
-
state[filterKey] = rawValue ? JSON.parse(rawValue) : rawValue;
|
|
2295
|
-
} catch {
|
|
2296
|
-
state[filterKey] = rawValue;
|
|
2297
|
-
}
|
|
2298
|
-
}
|
|
2299
|
-
}
|
|
2300
|
-
return state;
|
|
2301
|
-
}
|
|
2302
|
-
clearEvent() {
|
|
2303
|
-
if (!this.defaultFilters) return;
|
|
2304
|
-
Object.keys(this.defaultFilters).forEach((key) => {
|
|
2305
|
-
this.localStorageService.removeData(`${this.storagePrefix}${key}`);
|
|
2306
|
-
});
|
|
2307
|
-
this.tableState.update((prev) => ({
|
|
2308
|
-
...prev,
|
|
2309
|
-
pageIndex: 0
|
|
2310
|
-
}));
|
|
2311
|
-
this.filters.set({ ...this.defaultFilters });
|
|
2312
|
-
this.clearFilters.set({});
|
|
2313
|
-
}
|
|
2314
1871
|
filters = signal({}, ...ngDevMode ? [{ debugName: "filters" }] : /* istanbul ignore next */ []);
|
|
2315
1872
|
clearFilters = signal(null, ...ngDevMode ? [{ debugName: "clearFilters" }] : /* istanbul ignore next */ []);
|
|
2316
1873
|
tableState = signal({
|
|
@@ -2347,6 +1904,33 @@ var BaseSignalPageClass = class BaseSignalPageClass {
|
|
|
2347
1904
|
ngOnDestroy() {
|
|
2348
1905
|
this.subscription.unsubscribe();
|
|
2349
1906
|
}
|
|
1907
|
+
initFilters() {
|
|
1908
|
+
if (!this.filterSchema || !this.defaultFilters) return;
|
|
1909
|
+
const initial = { ...this.defaultFilters };
|
|
1910
|
+
Object.keys(this.defaultFilters).forEach((key) => {
|
|
1911
|
+
const storageKey = `${this.storagePrefix}${key}`;
|
|
1912
|
+
const rawValue = this.localStorageService.getData(storageKey);
|
|
1913
|
+
if (rawValue !== null && rawValue !== void 0) try {
|
|
1914
|
+
initial[key] = JSON.parse(rawValue);
|
|
1915
|
+
} catch {
|
|
1916
|
+
initial[key] = rawValue;
|
|
1917
|
+
}
|
|
1918
|
+
});
|
|
1919
|
+
const validation = this.filterSchema.safeParse(initial);
|
|
1920
|
+
this.filters.set(validation.success ? validation.data : this.defaultFilters);
|
|
1921
|
+
}
|
|
1922
|
+
clearEvent() {
|
|
1923
|
+
if (!this.defaultFilters) return;
|
|
1924
|
+
Object.keys(this.defaultFilters).forEach((key) => {
|
|
1925
|
+
this.localStorageService.removeData(`${this.storagePrefix}${key}`);
|
|
1926
|
+
});
|
|
1927
|
+
this.tableState.update((prev) => ({
|
|
1928
|
+
...prev,
|
|
1929
|
+
pageIndex: 0
|
|
1930
|
+
}));
|
|
1931
|
+
this.filters.set({ ...this.defaultFilters });
|
|
1932
|
+
this.clearFilters.set({});
|
|
1933
|
+
}
|
|
2350
1934
|
setFilter(key, value) {
|
|
2351
1935
|
const storageKey = `${this.storagePrefix}${String(key)}`;
|
|
2352
1936
|
this.tableState.update((prev) => ({
|
|
@@ -2411,7 +1995,7 @@ var BaseSignalPageClass = class BaseSignalPageClass {
|
|
|
2411
1995
|
this.selected.set(selected);
|
|
2412
1996
|
}
|
|
2413
1997
|
onRowDoubleClicked() {
|
|
2414
|
-
this.editEvent();
|
|
1998
|
+
if (this.dblClickedEventEnable) this.editEvent();
|
|
2415
1999
|
}
|
|
2416
2000
|
newEvent() {
|
|
2417
2001
|
if (this.entityEditComponent) {
|
|
@@ -2754,61 +2338,173 @@ var BaseSignalServiceClass = class BaseSignalServiceClass {
|
|
|
2754
2338
|
minVersion: "12.0.0",
|
|
2755
2339
|
version: "22.2.2",
|
|
2756
2340
|
ngImport: i0,
|
|
2757
|
-
type: BaseSignalServiceClass,
|
|
2341
|
+
type: BaseSignalServiceClass,
|
|
2342
|
+
deps: [],
|
|
2343
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
2344
|
+
});
|
|
2345
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
2346
|
+
minVersion: "12.0.0",
|
|
2347
|
+
version: "22.2.2",
|
|
2348
|
+
ngImport: i0,
|
|
2349
|
+
type: BaseSignalServiceClass,
|
|
2350
|
+
providedIn: "root"
|
|
2351
|
+
});
|
|
2352
|
+
};
|
|
2353
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2354
|
+
minVersion: "12.0.0",
|
|
2355
|
+
version: "22.2.2",
|
|
2356
|
+
ngImport: i0,
|
|
2357
|
+
type: BaseSignalServiceClass,
|
|
2358
|
+
decorators: [{
|
|
2359
|
+
type: Injectable,
|
|
2360
|
+
args: [{ providedIn: "root" }]
|
|
2361
|
+
}]
|
|
2362
|
+
});
|
|
2363
|
+
var DisableIfRoleDirective = class DisableIfRoleDirective {
|
|
2364
|
+
forbiddenRoles = input([], {
|
|
2365
|
+
...ngDevMode ? { debugName: "forbiddenRoles" } : /* istanbul ignore next */ {},
|
|
2366
|
+
alias: "ngxUikDisableIfRole"
|
|
2367
|
+
});
|
|
2368
|
+
el = inject(ElementRef);
|
|
2369
|
+
roleService = inject(RoleService);
|
|
2370
|
+
constructor() {
|
|
2371
|
+
effect(() => {
|
|
2372
|
+
const shouldDisable = this.roleService.hasForbiddenRole(this.forbiddenRoles());
|
|
2373
|
+
const nativeEl = this.el.nativeElement;
|
|
2374
|
+
if ("disabled" in nativeEl) nativeEl.disabled = shouldDisable;
|
|
2375
|
+
else if (shouldDisable) nativeEl.setAttribute("disabled", "true");
|
|
2376
|
+
else nativeEl.removeAttribute("disabled");
|
|
2377
|
+
});
|
|
2378
|
+
}
|
|
2379
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2380
|
+
minVersion: "12.0.0",
|
|
2381
|
+
version: "22.2.2",
|
|
2382
|
+
ngImport: i0,
|
|
2383
|
+
type: DisableIfRoleDirective,
|
|
2384
|
+
deps: [],
|
|
2385
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
2386
|
+
});
|
|
2387
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
2388
|
+
minVersion: "17.1.0",
|
|
2389
|
+
version: "22.2.2",
|
|
2390
|
+
type: DisableIfRoleDirective,
|
|
2391
|
+
isStandalone: true,
|
|
2392
|
+
selector: "[ngxUikDisableIfRole]",
|
|
2393
|
+
inputs: { forbiddenRoles: {
|
|
2394
|
+
classPropertyName: "forbiddenRoles",
|
|
2395
|
+
publicName: "ngxUikDisableIfRole",
|
|
2396
|
+
isSignal: true,
|
|
2397
|
+
isRequired: false,
|
|
2398
|
+
transformFunction: null
|
|
2399
|
+
} },
|
|
2400
|
+
ngImport: i0
|
|
2401
|
+
});
|
|
2402
|
+
};
|
|
2403
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2404
|
+
minVersion: "12.0.0",
|
|
2405
|
+
version: "22.2.2",
|
|
2406
|
+
ngImport: i0,
|
|
2407
|
+
type: DisableIfRoleDirective,
|
|
2408
|
+
decorators: [{
|
|
2409
|
+
type: Directive,
|
|
2410
|
+
args: [{ selector: "[ngxUikDisableIfRole]" }]
|
|
2411
|
+
}],
|
|
2412
|
+
ctorParameters: () => [],
|
|
2413
|
+
propDecorators: { forbiddenRoles: [{
|
|
2414
|
+
type: i0.Input,
|
|
2415
|
+
args: [{
|
|
2416
|
+
isSignal: true,
|
|
2417
|
+
alias: "ngxUikDisableIfRole",
|
|
2418
|
+
required: false
|
|
2419
|
+
}]
|
|
2420
|
+
}] }
|
|
2421
|
+
});
|
|
2422
|
+
var HideIfForbiddenRoleDirective = class HideIfForbiddenRoleDirective {
|
|
2423
|
+
forbiddenRoles = input([], {
|
|
2424
|
+
...ngDevMode ? { debugName: "forbiddenRoles" } : /* istanbul ignore next */ {},
|
|
2425
|
+
alias: "ngxUikHideIfForbiddenRole"
|
|
2426
|
+
});
|
|
2427
|
+
el = inject(ElementRef);
|
|
2428
|
+
roleService = inject(RoleService);
|
|
2429
|
+
constructor() {
|
|
2430
|
+
effect(() => {
|
|
2431
|
+
const shouldHide = this.roleService.hasForbiddenRole(this.forbiddenRoles());
|
|
2432
|
+
this.el.nativeElement.style.display = shouldHide ? "none" : "";
|
|
2433
|
+
});
|
|
2434
|
+
}
|
|
2435
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2436
|
+
minVersion: "12.0.0",
|
|
2437
|
+
version: "22.2.2",
|
|
2438
|
+
ngImport: i0,
|
|
2439
|
+
type: HideIfForbiddenRoleDirective,
|
|
2758
2440
|
deps: [],
|
|
2759
|
-
target: i0.ɵɵFactoryTarget.
|
|
2441
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
2760
2442
|
});
|
|
2761
|
-
static
|
|
2762
|
-
minVersion: "
|
|
2443
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
2444
|
+
minVersion: "17.1.0",
|
|
2763
2445
|
version: "22.2.2",
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2446
|
+
type: HideIfForbiddenRoleDirective,
|
|
2447
|
+
isStandalone: true,
|
|
2448
|
+
selector: "[ngxUikHideIfForbiddenRole]",
|
|
2449
|
+
inputs: { forbiddenRoles: {
|
|
2450
|
+
classPropertyName: "forbiddenRoles",
|
|
2451
|
+
publicName: "ngxUikHideIfForbiddenRole",
|
|
2452
|
+
isSignal: true,
|
|
2453
|
+
isRequired: false,
|
|
2454
|
+
transformFunction: null
|
|
2455
|
+
} },
|
|
2456
|
+
ngImport: i0
|
|
2767
2457
|
});
|
|
2768
2458
|
};
|
|
2769
2459
|
i0.ɵɵngDeclareClassMetadata({
|
|
2770
2460
|
minVersion: "12.0.0",
|
|
2771
2461
|
version: "22.2.2",
|
|
2772
2462
|
ngImport: i0,
|
|
2773
|
-
type:
|
|
2463
|
+
type: HideIfForbiddenRoleDirective,
|
|
2774
2464
|
decorators: [{
|
|
2775
|
-
type:
|
|
2776
|
-
args: [{
|
|
2777
|
-
}]
|
|
2465
|
+
type: Directive,
|
|
2466
|
+
args: [{ selector: "[ngxUikHideIfForbiddenRole]" }]
|
|
2467
|
+
}],
|
|
2468
|
+
ctorParameters: () => [],
|
|
2469
|
+
propDecorators: { forbiddenRoles: [{
|
|
2470
|
+
type: i0.Input,
|
|
2471
|
+
args: [{
|
|
2472
|
+
isSignal: true,
|
|
2473
|
+
alias: "ngxUikHideIfForbiddenRole",
|
|
2474
|
+
required: false
|
|
2475
|
+
}]
|
|
2476
|
+
}] }
|
|
2778
2477
|
});
|
|
2779
|
-
var
|
|
2780
|
-
|
|
2781
|
-
...ngDevMode ? { debugName: "
|
|
2782
|
-
alias: "
|
|
2478
|
+
var SetValueDirective = class SetValueDirective {
|
|
2479
|
+
value = input(null, {
|
|
2480
|
+
...ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {},
|
|
2481
|
+
alias: "setValue"
|
|
2783
2482
|
});
|
|
2784
|
-
|
|
2785
|
-
roleService = inject(RoleService);
|
|
2483
|
+
ngControl = inject(NgControl, { optional: true });
|
|
2786
2484
|
constructor() {
|
|
2787
2485
|
effect(() => {
|
|
2788
|
-
const
|
|
2789
|
-
const
|
|
2790
|
-
if (
|
|
2791
|
-
else if (shouldDisable) nativeEl.setAttribute("disabled", "true");
|
|
2792
|
-
else nativeEl.removeAttribute("disabled");
|
|
2486
|
+
const val = this.value();
|
|
2487
|
+
const normalizedValue = val === void 0 ? null : val;
|
|
2488
|
+
if (this.ngControl && this.ngControl.control) this.ngControl.control.setValue(normalizedValue, { emitEvent: false });
|
|
2793
2489
|
});
|
|
2794
2490
|
}
|
|
2795
2491
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2796
2492
|
minVersion: "12.0.0",
|
|
2797
2493
|
version: "22.2.2",
|
|
2798
2494
|
ngImport: i0,
|
|
2799
|
-
type:
|
|
2495
|
+
type: SetValueDirective,
|
|
2800
2496
|
deps: [],
|
|
2801
2497
|
target: i0.ɵɵFactoryTarget.Directive
|
|
2802
2498
|
});
|
|
2803
2499
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
2804
2500
|
minVersion: "17.1.0",
|
|
2805
2501
|
version: "22.2.2",
|
|
2806
|
-
type:
|
|
2502
|
+
type: SetValueDirective,
|
|
2807
2503
|
isStandalone: true,
|
|
2808
|
-
selector: "[
|
|
2809
|
-
inputs: {
|
|
2810
|
-
classPropertyName: "
|
|
2811
|
-
publicName: "
|
|
2504
|
+
selector: "[setValue]",
|
|
2505
|
+
inputs: { value: {
|
|
2506
|
+
classPropertyName: "value",
|
|
2507
|
+
publicName: "setValue",
|
|
2812
2508
|
isSignal: true,
|
|
2813
2509
|
isRequired: false,
|
|
2814
2510
|
transformFunction: null
|
|
@@ -2820,556 +2516,776 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2820
2516
|
minVersion: "12.0.0",
|
|
2821
2517
|
version: "22.2.2",
|
|
2822
2518
|
ngImport: i0,
|
|
2823
|
-
type:
|
|
2519
|
+
type: SetValueDirective,
|
|
2824
2520
|
decorators: [{
|
|
2825
2521
|
type: Directive,
|
|
2826
|
-
args: [{ selector: "[
|
|
2522
|
+
args: [{ selector: "[setValue]" }]
|
|
2827
2523
|
}],
|
|
2828
2524
|
ctorParameters: () => [],
|
|
2829
|
-
propDecorators: {
|
|
2525
|
+
propDecorators: { value: [{
|
|
2830
2526
|
type: i0.Input,
|
|
2831
2527
|
args: [{
|
|
2832
2528
|
isSignal: true,
|
|
2833
|
-
alias: "
|
|
2529
|
+
alias: "setValue",
|
|
2834
2530
|
required: false
|
|
2835
2531
|
}]
|
|
2836
2532
|
}] }
|
|
2837
2533
|
});
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2534
|
+
const authGuard = (allowedRoles) => {
|
|
2535
|
+
return (route, state) => {
|
|
2536
|
+
const authService = inject(AuthService);
|
|
2537
|
+
const router = inject(Router);
|
|
2538
|
+
const isLogin = authService.loggedIn();
|
|
2539
|
+
if (!isLogin) {
|
|
2540
|
+
console.log("state.url =", state.url);
|
|
2541
|
+
return router.createUrlTree(["/login"], { queryParams: { returnUrl: state.url } });
|
|
2542
|
+
}
|
|
2543
|
+
return isLogin;
|
|
2544
|
+
};
|
|
2545
|
+
};
|
|
2546
|
+
const redirectGuard = (route) => {
|
|
2547
|
+
const externalUrl = route.data?.["externalUrl"];
|
|
2548
|
+
if (externalUrl) window.open(externalUrl, "_self");
|
|
2549
|
+
return true;
|
|
2550
|
+
};
|
|
2551
|
+
const roleGuard = (allowedRoles) => {
|
|
2552
|
+
return (route, state) => {
|
|
2553
|
+
return inject(RoleService).hasAnyRole(allowedRoles);
|
|
2554
|
+
};
|
|
2555
|
+
};
|
|
2556
|
+
const LOGGER_CONFIG = new InjectionToken("LOGGER_CONFIG");
|
|
2557
|
+
var LoggerService = class LoggerService {
|
|
2558
|
+
logPrefix = "";
|
|
2559
|
+
isProduction;
|
|
2560
|
+
config = inject(LOGGER_CONFIG);
|
|
2561
|
+
constructor() {
|
|
2562
|
+
this.isProduction = this.config.isProduction;
|
|
2563
|
+
}
|
|
2564
|
+
log(message, ...args) {
|
|
2565
|
+
if (!this.isProduction) {
|
|
2566
|
+
args.unshift(this.logPrefix + " ");
|
|
2567
|
+
console.log(`[DEV LOG]: ${message}`, ...args);
|
|
2568
|
+
} else console.log(`[PROD LOG]: ${message}`, ...args);
|
|
2569
|
+
}
|
|
2570
|
+
error(message, ...args) {
|
|
2571
|
+
console.error(`[ERROR]: ${message}`, ...args);
|
|
2572
|
+
}
|
|
2573
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2574
|
+
minVersion: "12.0.0",
|
|
2575
|
+
version: "22.2.2",
|
|
2576
|
+
ngImport: i0,
|
|
2577
|
+
type: LoggerService,
|
|
2578
|
+
deps: [],
|
|
2579
|
+
target: i0.ɵɵFactoryTarget.Service
|
|
2580
|
+
});
|
|
2581
|
+
static ɵprov = i0.ɵɵngDeclareService({
|
|
2582
|
+
minVersion: "22.0.0",
|
|
2583
|
+
version: "22.2.2",
|
|
2584
|
+
ngImport: i0,
|
|
2585
|
+
type: LoggerService
|
|
2586
|
+
});
|
|
2587
|
+
};
|
|
2588
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2589
|
+
minVersion: "12.0.0",
|
|
2590
|
+
version: "22.2.2",
|
|
2591
|
+
ngImport: i0,
|
|
2592
|
+
type: LoggerService,
|
|
2593
|
+
decorators: [{ type: Service }],
|
|
2594
|
+
ctorParameters: () => []
|
|
2595
|
+
});
|
|
2596
|
+
function provideLogger(config) {
|
|
2597
|
+
return makeEnvironmentProviders([{
|
|
2598
|
+
provide: LOGGER_CONFIG,
|
|
2599
|
+
useValue: config
|
|
2600
|
+
}, LoggerService]);
|
|
2601
|
+
}
|
|
2602
|
+
const secUserViewSchema = z.object({
|
|
2603
|
+
id: z.number().default(0),
|
|
2604
|
+
idHuman: z.number().default(0),
|
|
2605
|
+
loginAD: z.string().default("").nullable(),
|
|
2606
|
+
dept: z.number().default(0),
|
|
2607
|
+
tabnum: z.number().default(0),
|
|
2608
|
+
lastname: z.string().default(""),
|
|
2609
|
+
firstname: z.string().default(""),
|
|
2610
|
+
middlename: z.string().default(""),
|
|
2611
|
+
fio: z.string().default(""),
|
|
2612
|
+
dateHuman: z.coerce.date().optional(),
|
|
2613
|
+
profession: z.string().default("")
|
|
2614
|
+
});
|
|
2615
|
+
const secUserSchema = z.object({
|
|
2616
|
+
id: z.number().default(0),
|
|
2617
|
+
login: z.string().default(""),
|
|
2618
|
+
fio: z.string().default(""),
|
|
2619
|
+
dept: z.number().default(0),
|
|
2620
|
+
tabnum: z.number().default(0),
|
|
2621
|
+
userView: secUserViewSchema.optional().nullable()
|
|
2622
|
+
});
|
|
2623
|
+
var SafePipe = class SafePipe {
|
|
2624
|
+
sanitizer = inject(DomSanitizer);
|
|
2625
|
+
transform(url, type = "url") {
|
|
2626
|
+
if (!url) return "";
|
|
2627
|
+
if (typeof url !== "string") return url;
|
|
2628
|
+
switch (type) {
|
|
2629
|
+
case "html": return this.sanitizer.bypassSecurityTrustHtml(url);
|
|
2630
|
+
case "style": return this.sanitizer.bypassSecurityTrustStyle(url);
|
|
2631
|
+
case "script": return this.sanitizer.bypassSecurityTrustScript(url);
|
|
2632
|
+
case "url": return this.sanitizer.bypassSecurityTrustUrl(url);
|
|
2633
|
+
case "resourceUrl": return this.sanitizer.bypassSecurityTrustResourceUrl(url);
|
|
2634
|
+
default: throw new Error(`SafePipe: Неизвестный тип безопасности ${type}`);
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2638
|
+
minVersion: "12.0.0",
|
|
2639
|
+
version: "22.2.2",
|
|
2640
|
+
ngImport: i0,
|
|
2641
|
+
type: SafePipe,
|
|
2642
|
+
deps: [],
|
|
2643
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
2644
|
+
});
|
|
2645
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
2646
|
+
minVersion: "14.0.0",
|
|
2647
|
+
version: "22.2.2",
|
|
2648
|
+
ngImport: i0,
|
|
2649
|
+
type: SafePipe,
|
|
2650
|
+
isStandalone: true,
|
|
2651
|
+
name: "safe"
|
|
2652
|
+
});
|
|
2653
|
+
};
|
|
2654
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2655
|
+
minVersion: "12.0.0",
|
|
2656
|
+
version: "22.2.2",
|
|
2657
|
+
ngImport: i0,
|
|
2658
|
+
type: SafePipe,
|
|
2659
|
+
decorators: [{
|
|
2660
|
+
type: Pipe,
|
|
2661
|
+
args: [{ name: "safe" }]
|
|
2662
|
+
}]
|
|
2663
|
+
});
|
|
2664
|
+
var TimePipe = class TimePipe {
|
|
2665
|
+
transform(value) {
|
|
2666
|
+
const hour = Math.abs(value) >= 60 ? Math.floor(Math.abs(value) / 60).toString().padStart(2, "0") : "00";
|
|
2667
|
+
const minute = Math.abs(value % 60).toString().padStart(2, "0");
|
|
2668
|
+
const time = hour + ":" + minute;
|
|
2669
|
+
return value < 0 ? "-" + time : time;
|
|
2670
|
+
}
|
|
2671
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2672
|
+
minVersion: "12.0.0",
|
|
2673
|
+
version: "22.2.2",
|
|
2674
|
+
ngImport: i0,
|
|
2675
|
+
type: TimePipe,
|
|
2676
|
+
deps: [],
|
|
2677
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
2678
|
+
});
|
|
2679
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
2680
|
+
minVersion: "14.0.0",
|
|
2681
|
+
version: "22.2.2",
|
|
2682
|
+
ngImport: i0,
|
|
2683
|
+
type: TimePipe,
|
|
2684
|
+
isStandalone: true,
|
|
2685
|
+
name: "time"
|
|
2686
|
+
});
|
|
2687
|
+
};
|
|
2688
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
2689
|
+
minVersion: "12.0.0",
|
|
2690
|
+
version: "22.2.2",
|
|
2691
|
+
ngImport: i0,
|
|
2692
|
+
type: TimePipe,
|
|
2693
|
+
decorators: [{
|
|
2694
|
+
type: Pipe,
|
|
2695
|
+
args: [{ name: "time" }]
|
|
2696
|
+
}]
|
|
2697
|
+
});
|
|
2698
|
+
var TruncatePipe = class TruncatePipe {
|
|
2699
|
+
transform(value, args) {
|
|
2700
|
+
const limit = args.length > 0 ? parseInt(args[0], 10) : 20;
|
|
2701
|
+
const trail = args.length > 1 ? args[1] : "...";
|
|
2702
|
+
return value.length > limit ? value.substring(0, limit) + trail : value;
|
|
2850
2703
|
}
|
|
2851
2704
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2852
2705
|
minVersion: "12.0.0",
|
|
2853
2706
|
version: "22.2.2",
|
|
2854
2707
|
ngImport: i0,
|
|
2855
|
-
type:
|
|
2708
|
+
type: TruncatePipe,
|
|
2856
2709
|
deps: [],
|
|
2857
|
-
target: i0.ɵɵFactoryTarget.
|
|
2710
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
2858
2711
|
});
|
|
2859
|
-
static
|
|
2860
|
-
minVersion: "
|
|
2712
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
2713
|
+
minVersion: "14.0.0",
|
|
2861
2714
|
version: "22.2.2",
|
|
2862
|
-
|
|
2715
|
+
ngImport: i0,
|
|
2716
|
+
type: TruncatePipe,
|
|
2863
2717
|
isStandalone: true,
|
|
2864
|
-
|
|
2865
|
-
inputs: { forbiddenRoles: {
|
|
2866
|
-
classPropertyName: "forbiddenRoles",
|
|
2867
|
-
publicName: "ngxUikHideIfForbiddenRole",
|
|
2868
|
-
isSignal: true,
|
|
2869
|
-
isRequired: false,
|
|
2870
|
-
transformFunction: null
|
|
2871
|
-
} },
|
|
2872
|
-
ngImport: i0
|
|
2718
|
+
name: "truncate"
|
|
2873
2719
|
});
|
|
2874
2720
|
};
|
|
2875
2721
|
i0.ɵɵngDeclareClassMetadata({
|
|
2876
2722
|
minVersion: "12.0.0",
|
|
2877
2723
|
version: "22.2.2",
|
|
2878
2724
|
ngImport: i0,
|
|
2879
|
-
type:
|
|
2725
|
+
type: TruncatePipe,
|
|
2880
2726
|
decorators: [{
|
|
2881
|
-
type:
|
|
2882
|
-
args: [{
|
|
2883
|
-
}]
|
|
2884
|
-
ctorParameters: () => [],
|
|
2885
|
-
propDecorators: { forbiddenRoles: [{
|
|
2886
|
-
type: i0.Input,
|
|
2887
|
-
args: [{
|
|
2888
|
-
isSignal: true,
|
|
2889
|
-
alias: "ngxUikHideIfForbiddenRole",
|
|
2890
|
-
required: false
|
|
2891
|
-
}]
|
|
2892
|
-
}] }
|
|
2727
|
+
type: Pipe,
|
|
2728
|
+
args: [{ name: "truncate" }]
|
|
2729
|
+
}]
|
|
2893
2730
|
});
|
|
2894
|
-
var
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2731
|
+
var ChipInputAutocompleteComponent = class ChipInputAutocompleteComponent {
|
|
2732
|
+
formFieldDirective = inject(FormField, {
|
|
2733
|
+
host: true,
|
|
2734
|
+
optional: true
|
|
2898
2735
|
});
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2736
|
+
items = input([], ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
|
|
2737
|
+
title = input("", ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
|
|
2738
|
+
value = model([], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
2739
|
+
filterQuery = model("", ...ngDevMode ? [{ debugName: "filterQuery" }] : /* istanbul ignore next */ []);
|
|
2740
|
+
separatorKeysCodes = [ENTER, COMMA];
|
|
2741
|
+
selectedItems = linkedSignal({
|
|
2742
|
+
...ngDevMode ? { debugName: "selectedItems" } : /* istanbul ignore next */ {},
|
|
2743
|
+
source: () => this.value(),
|
|
2744
|
+
computation: (inputKeys) => this.items().filter((item) => inputKeys.includes(item.value))
|
|
2745
|
+
});
|
|
2746
|
+
filteredItems = computed(() => {
|
|
2747
|
+
const allItems = this.items();
|
|
2748
|
+
const search = this.filterQuery().toLowerCase().trim();
|
|
2749
|
+
if (!search) return allItems;
|
|
2750
|
+
return allItems.filter((item) => item.viewValue.toLowerCase().includes(search));
|
|
2751
|
+
}, ...ngDevMode ? [{ debugName: "filteredItems" }] : /* istanbul ignore next */ []);
|
|
2752
|
+
isDisabled = computed(() => {
|
|
2753
|
+
return this.formFieldDirective?.state?.().disabled() ?? false;
|
|
2754
|
+
}, ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
|
|
2755
|
+
isInvalid = computed(() => {
|
|
2756
|
+
return this.formFieldDirective?.state()?.invalid() ?? false;
|
|
2757
|
+
}, ...ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []);
|
|
2758
|
+
remove(value) {
|
|
2759
|
+
if (this.isDisabled()) return;
|
|
2760
|
+
this.value.update((keys) => keys.filter((key) => key !== value));
|
|
2761
|
+
}
|
|
2762
|
+
selected(event) {
|
|
2763
|
+
const selectedValue = event.option.value;
|
|
2764
|
+
this.value.update((keys) => {
|
|
2765
|
+
return keys.includes(selectedValue) ? keys : [...keys, selectedValue];
|
|
2905
2766
|
});
|
|
2767
|
+
this.filterQuery.set("");
|
|
2768
|
+
}
|
|
2769
|
+
onCloseClick($event) {
|
|
2770
|
+
$event.stopPropagation();
|
|
2771
|
+
if (this.isDisabled()) return;
|
|
2772
|
+
this.value.set([]);
|
|
2773
|
+
this.filterQuery.set("");
|
|
2906
2774
|
}
|
|
2907
2775
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2908
2776
|
minVersion: "12.0.0",
|
|
2909
2777
|
version: "22.2.2",
|
|
2910
2778
|
ngImport: i0,
|
|
2911
|
-
type:
|
|
2779
|
+
type: ChipInputAutocompleteComponent,
|
|
2912
2780
|
deps: [],
|
|
2913
|
-
target: i0.ɵɵFactoryTarget.
|
|
2781
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
2914
2782
|
});
|
|
2915
|
-
static
|
|
2916
|
-
minVersion: "17.
|
|
2783
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2784
|
+
minVersion: "17.0.0",
|
|
2917
2785
|
version: "22.2.2",
|
|
2918
|
-
type:
|
|
2786
|
+
type: ChipInputAutocompleteComponent,
|
|
2919
2787
|
isStandalone: true,
|
|
2920
|
-
selector: "
|
|
2921
|
-
inputs: {
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2788
|
+
selector: "ngx-uik-chip-input-autocomplete",
|
|
2789
|
+
inputs: {
|
|
2790
|
+
items: {
|
|
2791
|
+
classPropertyName: "items",
|
|
2792
|
+
publicName: "items",
|
|
2793
|
+
isSignal: true,
|
|
2794
|
+
isRequired: false,
|
|
2795
|
+
transformFunction: null
|
|
2796
|
+
},
|
|
2797
|
+
title: {
|
|
2798
|
+
classPropertyName: "title",
|
|
2799
|
+
publicName: "title",
|
|
2800
|
+
isSignal: true,
|
|
2801
|
+
isRequired: false,
|
|
2802
|
+
transformFunction: null
|
|
2803
|
+
},
|
|
2804
|
+
value: {
|
|
2805
|
+
classPropertyName: "value",
|
|
2806
|
+
publicName: "value",
|
|
2807
|
+
isSignal: true,
|
|
2808
|
+
isRequired: false,
|
|
2809
|
+
transformFunction: null
|
|
2810
|
+
},
|
|
2811
|
+
filterQuery: {
|
|
2812
|
+
classPropertyName: "filterQuery",
|
|
2813
|
+
publicName: "filterQuery",
|
|
2814
|
+
isSignal: true,
|
|
2815
|
+
isRequired: false,
|
|
2816
|
+
transformFunction: null
|
|
2817
|
+
}
|
|
2818
|
+
},
|
|
2819
|
+
outputs: {
|
|
2820
|
+
value: "valueChange",
|
|
2821
|
+
filterQuery: "filterQueryChange"
|
|
2822
|
+
},
|
|
2823
|
+
ngImport: i0,
|
|
2824
|
+
template: "<mat-form-field class=\"chip-list\" appearance=\"fill\">\n <mat-label>{{ title() }}</mat-label>\n <mat-chip-grid #chipList aria-label=\"'Выбор '+title()\">\n @for (item of selectedItems(); track item.value) {\n <mat-chip-row color=\"primary\" (removed)=\"remove(item.value)\">\n {{ item.viewValue }}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n </mat-chip-grid>\n <input\n #input\n [value]=\"filterQuery()\"\n (input)=\"filterQuery.set($any($event.target).value)\"\n [placeholder]=\"'Введите ' + title() + '...'\"\n [matAutocomplete]=\"auto\"\n [matChipInputFor]=\"chipList\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n [disabled]=\"isDisabled()\"\n />\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"selected($event)\">\n @for (item of filteredItems(); track item.value) {\n <mat-option\n [value]=\"item.value\"\n [disabled]=\"selectedItems().includes(item)\"\n >\n {{ item.viewValue }}\n </mat-option>\n }\n </mat-autocomplete>\n @if (!isDisabled() && value().length > 0) {\n <button\n matSuffix\n mat-icon-button\n aria-label=\"Clear\"\n (click)=\"onCloseClick($event)\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n <!-- Блок вывода ошибки валидации родительской формы -->\n @if (isInvalid()) {\n <mat-error>Поле \"{{ title() }}\" заполнено некорректно</mat-error>\n }\n</mat-form-field>\n",
|
|
2825
|
+
styles: [".chip-list{width:100%}\n"],
|
|
2826
|
+
dependencies: [
|
|
2827
|
+
{
|
|
2828
|
+
kind: "component",
|
|
2829
|
+
type: MatFormField,
|
|
2830
|
+
selector: "mat-form-field",
|
|
2831
|
+
inputs: [
|
|
2832
|
+
"hideRequiredMarker",
|
|
2833
|
+
"color",
|
|
2834
|
+
"floatLabel",
|
|
2835
|
+
"appearance",
|
|
2836
|
+
"subscriptSizing",
|
|
2837
|
+
"hintLabel"
|
|
2838
|
+
],
|
|
2839
|
+
exportAs: ["matFormField"]
|
|
2840
|
+
},
|
|
2841
|
+
{
|
|
2842
|
+
kind: "ngmodule",
|
|
2843
|
+
type: MatAutocompleteModule
|
|
2844
|
+
},
|
|
2845
|
+
{
|
|
2846
|
+
kind: "component",
|
|
2847
|
+
type: i1$1.MatAutocomplete,
|
|
2848
|
+
selector: "mat-autocomplete",
|
|
2849
|
+
inputs: [
|
|
2850
|
+
"aria-label",
|
|
2851
|
+
"aria-labelledby",
|
|
2852
|
+
"displayWith",
|
|
2853
|
+
"autoActiveFirstOption",
|
|
2854
|
+
"autoSelectActiveOption",
|
|
2855
|
+
"requireSelection",
|
|
2856
|
+
"panelWidth",
|
|
2857
|
+
"disableRipple",
|
|
2858
|
+
"class",
|
|
2859
|
+
"hideSingleSelectionIndicator"
|
|
2860
|
+
],
|
|
2861
|
+
outputs: [
|
|
2862
|
+
"optionSelected",
|
|
2863
|
+
"opened",
|
|
2864
|
+
"closed",
|
|
2865
|
+
"optionActivated"
|
|
2866
|
+
],
|
|
2867
|
+
exportAs: ["matAutocomplete"]
|
|
2868
|
+
},
|
|
2869
|
+
{
|
|
2870
|
+
kind: "component",
|
|
2871
|
+
type: i1$1.MatOption,
|
|
2872
|
+
selector: "mat-option",
|
|
2873
|
+
inputs: [
|
|
2874
|
+
"value",
|
|
2875
|
+
"id",
|
|
2876
|
+
"disabled"
|
|
2877
|
+
],
|
|
2878
|
+
outputs: ["onSelectionChange"],
|
|
2879
|
+
exportAs: ["matOption"]
|
|
2880
|
+
},
|
|
2881
|
+
{
|
|
2882
|
+
kind: "directive",
|
|
2883
|
+
type: i1$1.MatAutocompleteTrigger,
|
|
2884
|
+
selector: "input[matAutocomplete], textarea[matAutocomplete]",
|
|
2885
|
+
inputs: [
|
|
2886
|
+
"matAutocomplete",
|
|
2887
|
+
"matAutocompletePosition",
|
|
2888
|
+
"matAutocompleteConnectedTo",
|
|
2889
|
+
"autocomplete",
|
|
2890
|
+
"matAutocompleteDisabled"
|
|
2891
|
+
],
|
|
2892
|
+
exportAs: ["matAutocompleteTrigger"]
|
|
2893
|
+
},
|
|
2894
|
+
{
|
|
2895
|
+
kind: "component",
|
|
2896
|
+
type: MatIcon,
|
|
2897
|
+
selector: "mat-icon",
|
|
2898
|
+
inputs: [
|
|
2899
|
+
"color",
|
|
2900
|
+
"inline",
|
|
2901
|
+
"svgIcon",
|
|
2902
|
+
"fontSet",
|
|
2903
|
+
"fontIcon"
|
|
2904
|
+
],
|
|
2905
|
+
exportAs: ["matIcon"]
|
|
2906
|
+
},
|
|
2907
|
+
{
|
|
2908
|
+
kind: "ngmodule",
|
|
2909
|
+
type: MatChipsModule
|
|
2910
|
+
},
|
|
2911
|
+
{
|
|
2912
|
+
kind: "component",
|
|
2913
|
+
type: i2$2.MatChipGrid,
|
|
2914
|
+
selector: "mat-chip-grid",
|
|
2915
|
+
inputs: [
|
|
2916
|
+
"disabled",
|
|
2917
|
+
"placeholder",
|
|
2918
|
+
"required",
|
|
2919
|
+
"value",
|
|
2920
|
+
"errorStateMatcher"
|
|
2921
|
+
],
|
|
2922
|
+
outputs: ["change", "valueChange"]
|
|
2923
|
+
},
|
|
2924
|
+
{
|
|
2925
|
+
kind: "directive",
|
|
2926
|
+
type: i2$2.MatChipInput,
|
|
2927
|
+
selector: "input[matChipInputFor]",
|
|
2928
|
+
inputs: [
|
|
2929
|
+
"matChipInputFor",
|
|
2930
|
+
"matChipInputAddOnBlur",
|
|
2931
|
+
"matChipInputSeparatorKeyCodes",
|
|
2932
|
+
"placeholder",
|
|
2933
|
+
"id",
|
|
2934
|
+
"disabled",
|
|
2935
|
+
"readonly",
|
|
2936
|
+
"matChipInputDisabledInteractive"
|
|
2937
|
+
],
|
|
2938
|
+
outputs: ["matChipInputTokenEnd"],
|
|
2939
|
+
exportAs: ["matChipInput", "matChipInputFor"]
|
|
2940
|
+
},
|
|
2941
|
+
{
|
|
2942
|
+
kind: "directive",
|
|
2943
|
+
type: i2$2.MatChipRemove,
|
|
2944
|
+
selector: "[matChipRemove]"
|
|
2945
|
+
},
|
|
2946
|
+
{
|
|
2947
|
+
kind: "component",
|
|
2948
|
+
type: i2$2.MatChipRow,
|
|
2949
|
+
selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]",
|
|
2950
|
+
inputs: ["editable"],
|
|
2951
|
+
outputs: ["edited"]
|
|
2952
|
+
},
|
|
2953
|
+
{
|
|
2954
|
+
kind: "directive",
|
|
2955
|
+
type: MatLabel,
|
|
2956
|
+
selector: "mat-label"
|
|
2957
|
+
},
|
|
2958
|
+
{
|
|
2959
|
+
kind: "directive",
|
|
2960
|
+
type: MatError,
|
|
2961
|
+
selector: "mat-error, [matError]",
|
|
2962
|
+
inputs: ["id"]
|
|
2963
|
+
}
|
|
2964
|
+
]
|
|
2929
2965
|
});
|
|
2930
2966
|
};
|
|
2931
2967
|
i0.ɵɵngDeclareClassMetadata({
|
|
2932
2968
|
minVersion: "12.0.0",
|
|
2933
2969
|
version: "22.2.2",
|
|
2934
2970
|
ngImport: i0,
|
|
2935
|
-
type:
|
|
2971
|
+
type: ChipInputAutocompleteComponent,
|
|
2936
2972
|
decorators: [{
|
|
2937
|
-
type:
|
|
2938
|
-
args: [{ selector: "[setValue]" }]
|
|
2939
|
-
}],
|
|
2940
|
-
ctorParameters: () => [],
|
|
2941
|
-
propDecorators: { value: [{
|
|
2942
|
-
type: i0.Input,
|
|
2973
|
+
type: Component,
|
|
2943
2974
|
args: [{
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2975
|
+
selector: "ngx-uik-chip-input-autocomplete",
|
|
2976
|
+
imports: [
|
|
2977
|
+
MatFormField,
|
|
2978
|
+
MatAutocompleteModule,
|
|
2979
|
+
MatIcon,
|
|
2980
|
+
MatOption,
|
|
2981
|
+
MatChipsModule,
|
|
2982
|
+
MatLabel,
|
|
2983
|
+
MatError
|
|
2984
|
+
],
|
|
2985
|
+
template: "<mat-form-field class=\"chip-list\" appearance=\"fill\">\n <mat-label>{{ title() }}</mat-label>\n <mat-chip-grid #chipList aria-label=\"'Выбор '+title()\">\n @for (item of selectedItems(); track item.value) {\n <mat-chip-row color=\"primary\" (removed)=\"remove(item.value)\">\n {{ item.viewValue }}\n <button matChipRemove>\n <mat-icon>cancel</mat-icon>\n </button>\n </mat-chip-row>\n }\n </mat-chip-grid>\n <input\n #input\n [value]=\"filterQuery()\"\n (input)=\"filterQuery.set($any($event.target).value)\"\n [placeholder]=\"'Введите ' + title() + '...'\"\n [matAutocomplete]=\"auto\"\n [matChipInputFor]=\"chipList\"\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\n [disabled]=\"isDisabled()\"\n />\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"selected($event)\">\n @for (item of filteredItems(); track item.value) {\n <mat-option\n [value]=\"item.value\"\n [disabled]=\"selectedItems().includes(item)\"\n >\n {{ item.viewValue }}\n </mat-option>\n }\n </mat-autocomplete>\n @if (!isDisabled() && value().length > 0) {\n <button\n matSuffix\n mat-icon-button\n aria-label=\"Clear\"\n (click)=\"onCloseClick($event)\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n <!-- Блок вывода ошибки валидации родительской формы -->\n @if (isInvalid()) {\n <mat-error>Поле \"{{ title() }}\" заполнено некорректно</mat-error>\n }\n</mat-form-field>\n",
|
|
2986
|
+
styles: [".chip-list{width:100%}\n"]
|
|
2987
|
+
}]
|
|
2988
|
+
}],
|
|
2989
|
+
propDecorators: {
|
|
2990
|
+
items: [{
|
|
2991
|
+
type: i0.Input,
|
|
2992
|
+
args: [{
|
|
2993
|
+
isSignal: true,
|
|
2994
|
+
alias: "items",
|
|
2995
|
+
required: false
|
|
2996
|
+
}]
|
|
2997
|
+
}],
|
|
2998
|
+
title: [{
|
|
2999
|
+
type: i0.Input,
|
|
3000
|
+
args: [{
|
|
3001
|
+
isSignal: true,
|
|
3002
|
+
alias: "title",
|
|
3003
|
+
required: false
|
|
3004
|
+
}]
|
|
3005
|
+
}],
|
|
3006
|
+
value: [{
|
|
3007
|
+
type: i0.Input,
|
|
3008
|
+
args: [{
|
|
3009
|
+
isSignal: true,
|
|
3010
|
+
alias: "value",
|
|
3011
|
+
required: false
|
|
3012
|
+
}]
|
|
3013
|
+
}, {
|
|
3014
|
+
type: i0.Output,
|
|
3015
|
+
args: ["valueChange"]
|
|
3016
|
+
}],
|
|
3017
|
+
filterQuery: [{
|
|
3018
|
+
type: i0.Input,
|
|
3019
|
+
args: [{
|
|
3020
|
+
isSignal: true,
|
|
3021
|
+
alias: "filterQuery",
|
|
3022
|
+
required: false
|
|
3023
|
+
}]
|
|
3024
|
+
}, {
|
|
3025
|
+
type: i0.Output,
|
|
3026
|
+
args: ["filterQueryChange"]
|
|
2947
3027
|
}]
|
|
2948
|
-
}] }
|
|
2949
|
-
});
|
|
2950
|
-
const authGuard = (allowedRoles) => {
|
|
2951
|
-
return (route, state) => {
|
|
2952
|
-
const authService = inject(AuthService);
|
|
2953
|
-
const router = inject(Router);
|
|
2954
|
-
const isLogin = authService.loggedIn();
|
|
2955
|
-
if (!isLogin) {
|
|
2956
|
-
console.log("state.url =", state.url);
|
|
2957
|
-
return router.createUrlTree(["/login"], { queryParams: { returnUrl: state.url } });
|
|
2958
|
-
}
|
|
2959
|
-
return isLogin;
|
|
2960
|
-
};
|
|
2961
|
-
};
|
|
2962
|
-
const redirectGuard = (route) => {
|
|
2963
|
-
const externalUrl = route.data?.["externalUrl"];
|
|
2964
|
-
if (externalUrl) window.location.href = externalUrl;
|
|
2965
|
-
return true;
|
|
2966
|
-
};
|
|
2967
|
-
const roleGuard = (allowedRoles) => {
|
|
2968
|
-
return (route, state) => {
|
|
2969
|
-
return inject(RoleService).hasAnyRole(allowedRoles);
|
|
2970
|
-
};
|
|
2971
|
-
};
|
|
2972
|
-
const LOGGER_CONFIG = new InjectionToken("LOGGER_CONFIG");
|
|
2973
|
-
var LoggerService = class LoggerService {
|
|
2974
|
-
logPrefix = "";
|
|
2975
|
-
isProduction;
|
|
2976
|
-
config = inject(LOGGER_CONFIG);
|
|
2977
|
-
constructor() {
|
|
2978
|
-
this.isProduction = this.config.isProduction;
|
|
2979
|
-
}
|
|
2980
|
-
log(message, ...args) {
|
|
2981
|
-
if (!this.isProduction) {
|
|
2982
|
-
args.unshift(this.logPrefix + " ");
|
|
2983
|
-
console.log(`[DEV LOG]: ${message}`, ...args);
|
|
2984
|
-
} else console.log(`[PROD LOG]: ${message}`, ...args);
|
|
2985
|
-
}
|
|
2986
|
-
error(message, ...args) {
|
|
2987
|
-
console.error(`[ERROR]: ${message}`, ...args);
|
|
2988
3028
|
}
|
|
2989
|
-
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2990
|
-
minVersion: "12.0.0",
|
|
2991
|
-
version: "22.2.2",
|
|
2992
|
-
ngImport: i0,
|
|
2993
|
-
type: LoggerService,
|
|
2994
|
-
deps: [],
|
|
2995
|
-
target: i0.ɵɵFactoryTarget.Service
|
|
2996
|
-
});
|
|
2997
|
-
static ɵprov = i0.ɵɵngDeclareService({
|
|
2998
|
-
minVersion: "22.0.0",
|
|
2999
|
-
version: "22.2.2",
|
|
3000
|
-
ngImport: i0,
|
|
3001
|
-
type: LoggerService
|
|
3002
|
-
});
|
|
3003
|
-
};
|
|
3004
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
3005
|
-
minVersion: "12.0.0",
|
|
3006
|
-
version: "22.2.2",
|
|
3007
|
-
ngImport: i0,
|
|
3008
|
-
type: LoggerService,
|
|
3009
|
-
decorators: [{ type: Service }],
|
|
3010
|
-
ctorParameters: () => []
|
|
3011
|
-
});
|
|
3012
|
-
function provideLogger(config) {
|
|
3013
|
-
return makeEnvironmentProviders([{
|
|
3014
|
-
provide: LOGGER_CONFIG,
|
|
3015
|
-
useValue: config
|
|
3016
|
-
}, LoggerService]);
|
|
3017
|
-
}
|
|
3018
|
-
const secUserViewSchema = z.object({
|
|
3019
|
-
id: z.number().default(0),
|
|
3020
|
-
idHuman: z.number().default(0),
|
|
3021
|
-
loginAD: z.string().default("").nullable(),
|
|
3022
|
-
dept: z.number().default(0),
|
|
3023
|
-
tabnum: z.number().default(0),
|
|
3024
|
-
lastname: z.string().default(""),
|
|
3025
|
-
firstname: z.string().default(""),
|
|
3026
|
-
middlename: z.string().default(""),
|
|
3027
|
-
fio: z.string().default(""),
|
|
3028
|
-
dateHuman: z.coerce.date().optional(),
|
|
3029
|
-
profession: z.string().default("")
|
|
3030
|
-
});
|
|
3031
|
-
const secUserSchema = z.object({
|
|
3032
|
-
id: z.number().default(0),
|
|
3033
|
-
login: z.string().default(""),
|
|
3034
|
-
fio: z.string().default(""),
|
|
3035
|
-
dept: z.number().default(0),
|
|
3036
|
-
tabnum: z.number().default(0),
|
|
3037
|
-
userView: secUserViewSchema.optional().nullable()
|
|
3038
3029
|
});
|
|
3039
|
-
var
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
case "script": return this.sanitizer.bypassSecurityTrustScript(url);
|
|
3048
|
-
case "url": return this.sanitizer.bypassSecurityTrustUrl(url);
|
|
3049
|
-
case "resourceUrl": return this.sanitizer.bypassSecurityTrustResourceUrl(url);
|
|
3050
|
-
default: throw new Error(`SafePipe: Неизвестный тип безопасности ${type}`);
|
|
3030
|
+
var CustomDateAdapter = class CustomDateAdapter extends NativeDateAdapter {
|
|
3031
|
+
parse(value) {
|
|
3032
|
+
if (typeof value === "string" && value.indexOf(".") > -1) {
|
|
3033
|
+
const str = value.split(".");
|
|
3034
|
+
const year = Number(str[2]);
|
|
3035
|
+
const month = Number(str[1]) - 1;
|
|
3036
|
+
const day = Number(str[0]);
|
|
3037
|
+
return new Date(year, month, day);
|
|
3051
3038
|
}
|
|
3039
|
+
const timestamp = typeof value === "number" ? value : Date.parse(value);
|
|
3040
|
+
return isNaN(timestamp) ? null : new Date(timestamp);
|
|
3052
3041
|
}
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
ngImport: i0,
|
|
3057
|
-
type: SafePipe,
|
|
3058
|
-
deps: [],
|
|
3059
|
-
target: i0.ɵɵFactoryTarget.Pipe
|
|
3060
|
-
});
|
|
3061
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
3062
|
-
minVersion: "14.0.0",
|
|
3063
|
-
version: "22.2.2",
|
|
3064
|
-
ngImport: i0,
|
|
3065
|
-
type: SafePipe,
|
|
3066
|
-
isStandalone: true,
|
|
3067
|
-
name: "safe"
|
|
3068
|
-
});
|
|
3069
|
-
};
|
|
3070
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
3071
|
-
minVersion: "12.0.0",
|
|
3072
|
-
version: "22.2.2",
|
|
3073
|
-
ngImport: i0,
|
|
3074
|
-
type: SafePipe,
|
|
3075
|
-
decorators: [{
|
|
3076
|
-
type: Pipe,
|
|
3077
|
-
args: [{ name: "safe" }]
|
|
3078
|
-
}]
|
|
3079
|
-
});
|
|
3080
|
-
var TimePipe = class TimePipe {
|
|
3081
|
-
transform(value) {
|
|
3082
|
-
const hour = Math.abs(value) >= 60 ? Math.floor(Math.abs(value) / 60).toString().padStart(2, "0") : "00";
|
|
3083
|
-
const minute = Math.abs(value % 60).toString().padStart(2, "0");
|
|
3084
|
-
const time = hour + ":" + minute;
|
|
3085
|
-
return value < 0 ? "-" + time : time;
|
|
3042
|
+
format(date, displayFormat) {
|
|
3043
|
+
if (displayFormat === "input") return `${String(date.getDate()).padStart(2, "0")}.${String(date.getMonth() + 1).padStart(2, "0")}.${date.getFullYear()}`;
|
|
3044
|
+
return super.format(date, displayFormat);
|
|
3086
3045
|
}
|
|
3087
3046
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
3088
3047
|
minVersion: "12.0.0",
|
|
3089
3048
|
version: "22.2.2",
|
|
3090
3049
|
ngImport: i0,
|
|
3091
|
-
type:
|
|
3092
|
-
deps:
|
|
3093
|
-
target: i0.ɵɵFactoryTarget.
|
|
3050
|
+
type: CustomDateAdapter,
|
|
3051
|
+
deps: null,
|
|
3052
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
3094
3053
|
});
|
|
3095
|
-
static
|
|
3096
|
-
minVersion: "
|
|
3054
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
3055
|
+
minVersion: "12.0.0",
|
|
3097
3056
|
version: "22.2.2",
|
|
3098
3057
|
ngImport: i0,
|
|
3099
|
-
type:
|
|
3100
|
-
isStandalone: true,
|
|
3101
|
-
name: "time"
|
|
3058
|
+
type: CustomDateAdapter
|
|
3102
3059
|
});
|
|
3103
3060
|
};
|
|
3104
3061
|
i0.ɵɵngDeclareClassMetadata({
|
|
3105
3062
|
minVersion: "12.0.0",
|
|
3106
3063
|
version: "22.2.2",
|
|
3107
3064
|
ngImport: i0,
|
|
3108
|
-
type:
|
|
3109
|
-
decorators: [{
|
|
3110
|
-
type: Pipe,
|
|
3111
|
-
args: [{ name: "time" }]
|
|
3112
|
-
}]
|
|
3065
|
+
type: CustomDateAdapter,
|
|
3066
|
+
decorators: [{ type: Injectable }]
|
|
3113
3067
|
});
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3068
|
+
const MY_NATIVE_FORMATS = {
|
|
3069
|
+
parse: { dateInput: "input" },
|
|
3070
|
+
display: {
|
|
3071
|
+
dateInput: "input",
|
|
3072
|
+
monthYearLabel: {
|
|
3073
|
+
year: "numeric",
|
|
3074
|
+
month: "short"
|
|
3075
|
+
},
|
|
3076
|
+
dateA11yLabel: {
|
|
3077
|
+
year: "numeric",
|
|
3078
|
+
month: "long",
|
|
3079
|
+
day: "numeric"
|
|
3080
|
+
},
|
|
3081
|
+
monthYearA11yLabel: {
|
|
3082
|
+
year: "numeric",
|
|
3083
|
+
month: "long"
|
|
3084
|
+
}
|
|
3119
3085
|
}
|
|
3120
|
-
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
3121
|
-
minVersion: "12.0.0",
|
|
3122
|
-
version: "22.2.2",
|
|
3123
|
-
ngImport: i0,
|
|
3124
|
-
type: TruncatePipe,
|
|
3125
|
-
deps: [],
|
|
3126
|
-
target: i0.ɵɵFactoryTarget.Pipe
|
|
3127
|
-
});
|
|
3128
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
3129
|
-
minVersion: "14.0.0",
|
|
3130
|
-
version: "22.2.2",
|
|
3131
|
-
ngImport: i0,
|
|
3132
|
-
type: TruncatePipe,
|
|
3133
|
-
isStandalone: true,
|
|
3134
|
-
name: "truncate"
|
|
3135
|
-
});
|
|
3136
3086
|
};
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
args: [{ name: "truncate" }]
|
|
3145
|
-
}]
|
|
3087
|
+
const toIsoString = (date) => {
|
|
3088
|
+
if (!date) return "";
|
|
3089
|
+
return date.toISOString().split("T")[0];
|
|
3090
|
+
};
|
|
3091
|
+
const dateRangeFormSchema = z$1.object({
|
|
3092
|
+
begin: z$1.instanceof(Date).nullable(),
|
|
3093
|
+
end: z$1.instanceof(Date).nullable()
|
|
3146
3094
|
});
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3095
|
+
const dateRangeSchema = dateRangeFormSchema.transform((data) => ({
|
|
3096
|
+
begin: toIsoString(data.begin),
|
|
3097
|
+
end: toIsoString(data.end)
|
|
3098
|
+
}));
|
|
3099
|
+
var DateRangeInputComponent = class DateRangeInputComponent {
|
|
3100
|
+
DEFAULT_MIN_DATE = new Date(2020, 0, 1);
|
|
3101
|
+
label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
3102
|
+
dateRange = input({
|
|
3103
|
+
begin: "",
|
|
3104
|
+
end: ""
|
|
3105
|
+
}, ...ngDevMode ? [{ debugName: "dateRange" }] : /* istanbul ignore next */ []);
|
|
3106
|
+
minDate = input(this.DEFAULT_MIN_DATE, ...ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []);
|
|
3107
|
+
clearInput = input(null, ...ngDevMode ? [{ debugName: "clearInput" }] : /* istanbul ignore next */ []);
|
|
3108
|
+
required = input(false, ...ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []);
|
|
3109
|
+
dateRangeChange = output();
|
|
3110
|
+
formModel = signal({
|
|
3111
|
+
begin: null,
|
|
3112
|
+
end: null
|
|
3113
|
+
}, ...ngDevMode ? [{ debugName: "formModel" }] : /* istanbul ignore next */ []);
|
|
3114
|
+
form = form(this.formModel, (schemaPath) => {
|
|
3115
|
+
validateStandardSchema(schemaPath, dateRangeFormSchema);
|
|
3116
|
+
required(schemaPath.begin, {
|
|
3117
|
+
message: "Укажите период",
|
|
3118
|
+
when: () => this.required()
|
|
3119
|
+
});
|
|
3120
|
+
required(schemaPath.end, {
|
|
3121
|
+
message: "Укажите период",
|
|
3122
|
+
when: () => this.required()
|
|
3123
|
+
});
|
|
3124
|
+
debounce(schemaPath.begin, 500);
|
|
3125
|
+
debounce(schemaPath.end, 500);
|
|
3161
3126
|
});
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
this.value.update((keys) => {
|
|
3181
|
-
return keys.includes(selectedValue) ? keys : [...keys, selectedValue];
|
|
3127
|
+
constructor() {
|
|
3128
|
+
effect(() => {
|
|
3129
|
+
this.clearInput();
|
|
3130
|
+
untracked(() => this.form().reset());
|
|
3131
|
+
});
|
|
3132
|
+
effect(() => {
|
|
3133
|
+
const value = this.dateRange();
|
|
3134
|
+
untracked(() => {
|
|
3135
|
+
this.form.begin().value.set(value.begin ? new Date(value.begin) : null);
|
|
3136
|
+
this.form.end().value.set(value.end ? new Date(value.end) : null);
|
|
3137
|
+
});
|
|
3138
|
+
});
|
|
3139
|
+
effect(() => {
|
|
3140
|
+
const currentValues = this.form().value();
|
|
3141
|
+
if (this.form().valid()) {
|
|
3142
|
+
const formattedRange = dateRangeSchema.safeParse(currentValues);
|
|
3143
|
+
if (formattedRange.success) this.dateRangeChange.emit(formattedRange.data);
|
|
3144
|
+
}
|
|
3182
3145
|
});
|
|
3183
|
-
this.filterQuery.set("");
|
|
3184
|
-
}
|
|
3185
|
-
onCloseClick($event) {
|
|
3186
|
-
$event.stopPropagation();
|
|
3187
|
-
if (this.isDisabled()) return;
|
|
3188
|
-
this.value.set([]);
|
|
3189
|
-
this.filterQuery.set("");
|
|
3190
3146
|
}
|
|
3191
3147
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
3192
3148
|
minVersion: "12.0.0",
|
|
3193
3149
|
version: "22.2.2",
|
|
3194
3150
|
ngImport: i0,
|
|
3195
|
-
type:
|
|
3151
|
+
type: DateRangeInputComponent,
|
|
3196
3152
|
deps: [],
|
|
3197
3153
|
target: i0.ɵɵFactoryTarget.Component
|
|
3198
3154
|
});
|
|
3199
3155
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
3200
3156
|
minVersion: "17.0.0",
|
|
3201
3157
|
version: "22.2.2",
|
|
3202
|
-
type:
|
|
3158
|
+
type: DateRangeInputComponent,
|
|
3203
3159
|
isStandalone: true,
|
|
3204
|
-
selector: "ngx-uik-
|
|
3160
|
+
selector: "ngx-uik-date-range-input",
|
|
3205
3161
|
inputs: {
|
|
3206
|
-
|
|
3207
|
-
classPropertyName: "
|
|
3208
|
-
publicName: "
|
|
3162
|
+
label: {
|
|
3163
|
+
classPropertyName: "label",
|
|
3164
|
+
publicName: "label",
|
|
3209
3165
|
isSignal: true,
|
|
3210
3166
|
isRequired: false,
|
|
3211
3167
|
transformFunction: null
|
|
3212
3168
|
},
|
|
3213
|
-
|
|
3214
|
-
classPropertyName: "
|
|
3215
|
-
publicName: "
|
|
3169
|
+
dateRange: {
|
|
3170
|
+
classPropertyName: "dateRange",
|
|
3171
|
+
publicName: "dateRange",
|
|
3216
3172
|
isSignal: true,
|
|
3217
3173
|
isRequired: false,
|
|
3218
3174
|
transformFunction: null
|
|
3219
3175
|
},
|
|
3220
|
-
|
|
3221
|
-
classPropertyName: "
|
|
3222
|
-
publicName: "
|
|
3176
|
+
minDate: {
|
|
3177
|
+
classPropertyName: "minDate",
|
|
3178
|
+
publicName: "minDate",
|
|
3223
3179
|
isSignal: true,
|
|
3224
3180
|
isRequired: false,
|
|
3225
3181
|
transformFunction: null
|
|
3226
3182
|
},
|
|
3227
|
-
|
|
3228
|
-
classPropertyName: "
|
|
3229
|
-
publicName: "
|
|
3183
|
+
clearInput: {
|
|
3184
|
+
classPropertyName: "clearInput",
|
|
3185
|
+
publicName: "clearInput",
|
|
3186
|
+
isSignal: true,
|
|
3187
|
+
isRequired: false,
|
|
3188
|
+
transformFunction: null
|
|
3189
|
+
},
|
|
3190
|
+
required: {
|
|
3191
|
+
classPropertyName: "required",
|
|
3192
|
+
publicName: "required",
|
|
3230
3193
|
isSignal: true,
|
|
3231
3194
|
isRequired: false,
|
|
3232
3195
|
transformFunction: null
|
|
3233
3196
|
}
|
|
3234
3197
|
},
|
|
3235
|
-
outputs: {
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
inputs: [
|
|
3248
|
-
"hideRequiredMarker",
|
|
3249
|
-
"color",
|
|
3250
|
-
"floatLabel",
|
|
3251
|
-
"appearance",
|
|
3252
|
-
"subscriptSizing",
|
|
3253
|
-
"hintLabel"
|
|
3254
|
-
],
|
|
3255
|
-
exportAs: ["matFormField"]
|
|
3256
|
-
},
|
|
3257
|
-
{
|
|
3258
|
-
kind: "ngmodule",
|
|
3259
|
-
type: MatAutocompleteModule
|
|
3260
|
-
},
|
|
3261
|
-
{
|
|
3262
|
-
kind: "component",
|
|
3263
|
-
type: i1$1.MatAutocomplete,
|
|
3264
|
-
selector: "mat-autocomplete",
|
|
3265
|
-
inputs: [
|
|
3266
|
-
"aria-label",
|
|
3267
|
-
"aria-labelledby",
|
|
3268
|
-
"displayWith",
|
|
3269
|
-
"autoActiveFirstOption",
|
|
3270
|
-
"autoSelectActiveOption",
|
|
3271
|
-
"requireSelection",
|
|
3272
|
-
"panelWidth",
|
|
3273
|
-
"disableRipple",
|
|
3274
|
-
"class",
|
|
3275
|
-
"hideSingleSelectionIndicator"
|
|
3276
|
-
],
|
|
3277
|
-
outputs: [
|
|
3278
|
-
"optionSelected",
|
|
3279
|
-
"opened",
|
|
3280
|
-
"closed",
|
|
3281
|
-
"optionActivated"
|
|
3282
|
-
],
|
|
3283
|
-
exportAs: ["matAutocomplete"]
|
|
3284
|
-
},
|
|
3285
|
-
{
|
|
3286
|
-
kind: "component",
|
|
3287
|
-
type: i1$1.MatOption,
|
|
3288
|
-
selector: "mat-option",
|
|
3289
|
-
inputs: [
|
|
3290
|
-
"value",
|
|
3291
|
-
"id",
|
|
3292
|
-
"disabled"
|
|
3293
|
-
],
|
|
3294
|
-
outputs: ["onSelectionChange"],
|
|
3295
|
-
exportAs: ["matOption"]
|
|
3296
|
-
},
|
|
3198
|
+
outputs: { dateRangeChange: "dateRangeChange" },
|
|
3199
|
+
providers: [{
|
|
3200
|
+
provide: DateAdapter,
|
|
3201
|
+
useClass: CustomDateAdapter
|
|
3202
|
+
}, {
|
|
3203
|
+
provide: MAT_DATE_FORMATS,
|
|
3204
|
+
useValue: MY_NATIVE_FORMATS
|
|
3205
|
+
}],
|
|
3206
|
+
ngImport: i0,
|
|
3207
|
+
template: "<mat-form-field appearance=\"fill\">\r\n <mat-label>{{ label() }}</mat-label>\r\n <mat-date-range-input\r\n [rangePicker]=\"picker\"\r\n [min]=\"minDate()\"\r\n >\r\n <input matStartDate [formField]=\"form.begin\" placeholder=\"Дата начала\" />\r\n <input matEndDate [formField]=\"form.end\" placeholder=\"Дата окончания\" />\r\n </mat-date-range-input>\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-date-range-picker #picker></mat-date-range-picker>\r\n @if (form.begin().touched() && form.begin().invalid()) {\r\n <ng-container ngProjectAs=\"mat-error\">\r\n <mat-error>{{ form.begin().errors()[0]?.message }}</mat-error>\r\n </ng-container>\r\n }\r\n @if (form.end().touched() && form.end().invalid()) {\r\n <ng-container ngProjectAs=\"mat-error\">\r\n <mat-error>{{ form.end().errors()[0]?.message }}</mat-error>\r\n </ng-container>\r\n }\r\n</mat-form-field>\r\n",
|
|
3208
|
+
styles: ["mat-form-field{margin-right:16px}\n"],
|
|
3209
|
+
dependencies: [
|
|
3297
3210
|
{
|
|
3298
3211
|
kind: "directive",
|
|
3299
|
-
type:
|
|
3300
|
-
selector: "
|
|
3301
|
-
inputs: [
|
|
3302
|
-
|
|
3303
|
-
"matAutocompletePosition",
|
|
3304
|
-
"matAutocompleteConnectedTo",
|
|
3305
|
-
"autocomplete",
|
|
3306
|
-
"matAutocompleteDisabled"
|
|
3307
|
-
],
|
|
3308
|
-
exportAs: ["matAutocompleteTrigger"]
|
|
3212
|
+
type: FormField,
|
|
3213
|
+
selector: "[formField]",
|
|
3214
|
+
inputs: ["formField"],
|
|
3215
|
+
exportAs: ["formField"]
|
|
3309
3216
|
},
|
|
3310
3217
|
{
|
|
3311
3218
|
kind: "component",
|
|
3312
|
-
type:
|
|
3313
|
-
selector: "mat-
|
|
3219
|
+
type: MatFormField,
|
|
3220
|
+
selector: "mat-form-field",
|
|
3314
3221
|
inputs: [
|
|
3222
|
+
"hideRequiredMarker",
|
|
3315
3223
|
"color",
|
|
3316
|
-
"
|
|
3317
|
-
"
|
|
3318
|
-
"
|
|
3319
|
-
"
|
|
3224
|
+
"floatLabel",
|
|
3225
|
+
"appearance",
|
|
3226
|
+
"subscriptSizing",
|
|
3227
|
+
"hintLabel"
|
|
3320
3228
|
],
|
|
3321
|
-
exportAs: ["
|
|
3229
|
+
exportAs: ["matFormField"]
|
|
3322
3230
|
},
|
|
3323
3231
|
{
|
|
3324
|
-
kind: "
|
|
3325
|
-
type:
|
|
3232
|
+
kind: "directive",
|
|
3233
|
+
type: MatLabel,
|
|
3234
|
+
selector: "mat-label"
|
|
3326
3235
|
},
|
|
3327
3236
|
{
|
|
3328
3237
|
kind: "component",
|
|
3329
|
-
type:
|
|
3330
|
-
selector: "mat-
|
|
3238
|
+
type: MatDateRangeInput,
|
|
3239
|
+
selector: "mat-date-range-input",
|
|
3331
3240
|
inputs: [
|
|
3332
|
-
"
|
|
3333
|
-
"placeholder",
|
|
3241
|
+
"rangePicker",
|
|
3334
3242
|
"required",
|
|
3335
|
-
"
|
|
3336
|
-
"
|
|
3243
|
+
"dateFilter",
|
|
3244
|
+
"min",
|
|
3245
|
+
"max",
|
|
3246
|
+
"disabled",
|
|
3247
|
+
"separator",
|
|
3248
|
+
"comparisonStart",
|
|
3249
|
+
"comparisonEnd"
|
|
3337
3250
|
],
|
|
3338
|
-
|
|
3251
|
+
exportAs: ["matDateRangeInput"]
|
|
3339
3252
|
},
|
|
3340
3253
|
{
|
|
3341
3254
|
kind: "directive",
|
|
3342
|
-
type:
|
|
3343
|
-
selector: "input[
|
|
3344
|
-
|
|
3345
|
-
"matChipInputFor",
|
|
3346
|
-
"matChipInputAddOnBlur",
|
|
3347
|
-
"matChipInputSeparatorKeyCodes",
|
|
3348
|
-
"placeholder",
|
|
3349
|
-
"id",
|
|
3350
|
-
"disabled",
|
|
3351
|
-
"readonly",
|
|
3352
|
-
"matChipInputDisabledInteractive"
|
|
3353
|
-
],
|
|
3354
|
-
outputs: ["matChipInputTokenEnd"],
|
|
3355
|
-
exportAs: ["matChipInput", "matChipInputFor"]
|
|
3255
|
+
type: MatStartDate,
|
|
3256
|
+
selector: "input[matStartDate]",
|
|
3257
|
+
outputs: ["dateChange", "dateInput"]
|
|
3356
3258
|
},
|
|
3357
3259
|
{
|
|
3358
3260
|
kind: "directive",
|
|
3359
|
-
type:
|
|
3360
|
-
selector: "[
|
|
3261
|
+
type: MatEndDate,
|
|
3262
|
+
selector: "input[matEndDate]",
|
|
3263
|
+
outputs: ["dateChange", "dateInput"]
|
|
3361
3264
|
},
|
|
3362
3265
|
{
|
|
3363
3266
|
kind: "component",
|
|
3364
|
-
type:
|
|
3365
|
-
selector: "mat-
|
|
3366
|
-
inputs: [
|
|
3367
|
-
|
|
3267
|
+
type: MatDatepickerToggle,
|
|
3268
|
+
selector: "mat-datepicker-toggle",
|
|
3269
|
+
inputs: [
|
|
3270
|
+
"for",
|
|
3271
|
+
"tabIndex",
|
|
3272
|
+
"aria-label",
|
|
3273
|
+
"disabled",
|
|
3274
|
+
"disableRipple"
|
|
3275
|
+
],
|
|
3276
|
+
exportAs: ["matDatepickerToggle"]
|
|
3368
3277
|
},
|
|
3369
3278
|
{
|
|
3370
3279
|
kind: "directive",
|
|
3371
|
-
type:
|
|
3372
|
-
selector: "
|
|
3280
|
+
type: MatSuffix,
|
|
3281
|
+
selector: "[matSuffix], [matIconSuffix], [matTextSuffix]",
|
|
3282
|
+
inputs: ["matTextSuffix"]
|
|
3283
|
+
},
|
|
3284
|
+
{
|
|
3285
|
+
kind: "component",
|
|
3286
|
+
type: MatDateRangePicker,
|
|
3287
|
+
selector: "mat-date-range-picker",
|
|
3288
|
+
exportAs: ["matDateRangePicker"]
|
|
3373
3289
|
},
|
|
3374
3290
|
{
|
|
3375
3291
|
kind: "directive",
|
|
@@ -3384,237 +3300,179 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3384
3300
|
minVersion: "12.0.0",
|
|
3385
3301
|
version: "22.2.2",
|
|
3386
3302
|
ngImport: i0,
|
|
3387
|
-
type:
|
|
3303
|
+
type: DateRangeInputComponent,
|
|
3388
3304
|
decorators: [{
|
|
3389
3305
|
type: Component,
|
|
3390
3306
|
args: [{
|
|
3391
|
-
selector: "ngx-uik-
|
|
3307
|
+
selector: "ngx-uik-date-range-input",
|
|
3392
3308
|
imports: [
|
|
3309
|
+
FormField,
|
|
3393
3310
|
MatFormField,
|
|
3394
|
-
MatAutocompleteModule,
|
|
3395
|
-
MatIcon,
|
|
3396
|
-
MatOption,
|
|
3397
|
-
MatChipsModule,
|
|
3398
3311
|
MatLabel,
|
|
3312
|
+
MatDateRangeInput,
|
|
3313
|
+
MatStartDate,
|
|
3314
|
+
MatEndDate,
|
|
3315
|
+
MatDatepickerToggle,
|
|
3316
|
+
MatSuffix,
|
|
3317
|
+
MatDateRangePicker,
|
|
3399
3318
|
MatError
|
|
3400
3319
|
],
|
|
3401
|
-
|
|
3402
|
-
|
|
3320
|
+
providers: [{
|
|
3321
|
+
provide: DateAdapter,
|
|
3322
|
+
useClass: CustomDateAdapter
|
|
3323
|
+
}, {
|
|
3324
|
+
provide: MAT_DATE_FORMATS,
|
|
3325
|
+
useValue: MY_NATIVE_FORMATS
|
|
3326
|
+
}],
|
|
3327
|
+
template: "<mat-form-field appearance=\"fill\">\r\n <mat-label>{{ label() }}</mat-label>\r\n <mat-date-range-input\r\n [rangePicker]=\"picker\"\r\n [min]=\"minDate()\"\r\n >\r\n <input matStartDate [formField]=\"form.begin\" placeholder=\"Дата начала\" />\r\n <input matEndDate [formField]=\"form.end\" placeholder=\"Дата окончания\" />\r\n </mat-date-range-input>\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-date-range-picker #picker></mat-date-range-picker>\r\n @if (form.begin().touched() && form.begin().invalid()) {\r\n <ng-container ngProjectAs=\"mat-error\">\r\n <mat-error>{{ form.begin().errors()[0]?.message }}</mat-error>\r\n </ng-container>\r\n }\r\n @if (form.end().touched() && form.end().invalid()) {\r\n <ng-container ngProjectAs=\"mat-error\">\r\n <mat-error>{{ form.end().errors()[0]?.message }}</mat-error>\r\n </ng-container>\r\n }\r\n</mat-form-field>\r\n",
|
|
3328
|
+
styles: ["mat-form-field{margin-right:16px}\n"]
|
|
3403
3329
|
}]
|
|
3404
3330
|
}],
|
|
3331
|
+
ctorParameters: () => [],
|
|
3405
3332
|
propDecorators: {
|
|
3406
|
-
|
|
3333
|
+
label: [{
|
|
3407
3334
|
type: i0.Input,
|
|
3408
3335
|
args: [{
|
|
3409
3336
|
isSignal: true,
|
|
3410
|
-
alias: "
|
|
3337
|
+
alias: "label",
|
|
3411
3338
|
required: false
|
|
3412
3339
|
}]
|
|
3413
3340
|
}],
|
|
3414
|
-
|
|
3341
|
+
dateRange: [{
|
|
3415
3342
|
type: i0.Input,
|
|
3416
3343
|
args: [{
|
|
3417
3344
|
isSignal: true,
|
|
3418
|
-
alias: "
|
|
3345
|
+
alias: "dateRange",
|
|
3419
3346
|
required: false
|
|
3420
3347
|
}]
|
|
3421
3348
|
}],
|
|
3422
|
-
|
|
3349
|
+
minDate: [{
|
|
3423
3350
|
type: i0.Input,
|
|
3424
3351
|
args: [{
|
|
3425
3352
|
isSignal: true,
|
|
3426
|
-
alias: "
|
|
3353
|
+
alias: "minDate",
|
|
3427
3354
|
required: false
|
|
3428
3355
|
}]
|
|
3429
|
-
}, {
|
|
3430
|
-
type: i0.Output,
|
|
3431
|
-
args: ["valueChange"]
|
|
3432
3356
|
}],
|
|
3433
|
-
|
|
3357
|
+
clearInput: [{
|
|
3434
3358
|
type: i0.Input,
|
|
3435
3359
|
args: [{
|
|
3436
3360
|
isSignal: true,
|
|
3437
|
-
alias: "
|
|
3361
|
+
alias: "clearInput",
|
|
3438
3362
|
required: false
|
|
3439
3363
|
}]
|
|
3440
|
-
},
|
|
3364
|
+
}],
|
|
3365
|
+
required: [{
|
|
3366
|
+
type: i0.Input,
|
|
3367
|
+
args: [{
|
|
3368
|
+
isSignal: true,
|
|
3369
|
+
alias: "required",
|
|
3370
|
+
required: false
|
|
3371
|
+
}]
|
|
3372
|
+
}],
|
|
3373
|
+
dateRangeChange: [{
|
|
3441
3374
|
type: i0.Output,
|
|
3442
|
-
args: ["
|
|
3375
|
+
args: ["dateRangeChange"]
|
|
3443
3376
|
}]
|
|
3444
3377
|
}
|
|
3445
3378
|
});
|
|
3446
|
-
var
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
}
|
|
3455
|
-
const timestamp = typeof value === "number" ? value : Date.parse(value);
|
|
3456
|
-
return isNaN(timestamp) ? null : new Date(timestamp);
|
|
3457
|
-
}
|
|
3458
|
-
format(date, displayFormat) {
|
|
3459
|
-
if (displayFormat === "input") return `${String(date.getDate()).padStart(2, "0")}.${String(date.getMonth() + 1).padStart(2, "0")}.${date.getFullYear()}`;
|
|
3460
|
-
return super.format(date, displayFormat);
|
|
3461
|
-
}
|
|
3379
|
+
var DialogAction;
|
|
3380
|
+
(function(DialogAction) {
|
|
3381
|
+
DialogAction["Add"] = "Добавить";
|
|
3382
|
+
DialogAction["Edit"] = "Изменить";
|
|
3383
|
+
DialogAction["Delete"] = "Удалить";
|
|
3384
|
+
DialogAction["None"] = "";
|
|
3385
|
+
})(DialogAction || (DialogAction = {}));
|
|
3386
|
+
var EmptyComponent = class EmptyComponent {
|
|
3462
3387
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
3463
3388
|
minVersion: "12.0.0",
|
|
3464
3389
|
version: "22.2.2",
|
|
3465
3390
|
ngImport: i0,
|
|
3466
|
-
type:
|
|
3467
|
-
deps:
|
|
3468
|
-
target: i0.ɵɵFactoryTarget.
|
|
3391
|
+
type: EmptyComponent,
|
|
3392
|
+
deps: [],
|
|
3393
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
3469
3394
|
});
|
|
3470
|
-
static
|
|
3471
|
-
minVersion: "
|
|
3395
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
3396
|
+
minVersion: "14.0.0",
|
|
3472
3397
|
version: "22.2.2",
|
|
3398
|
+
type: EmptyComponent,
|
|
3399
|
+
isStandalone: true,
|
|
3400
|
+
selector: "ngx-uik-empty-route-guard-holder",
|
|
3473
3401
|
ngImport: i0,
|
|
3474
|
-
|
|
3402
|
+
template: "",
|
|
3403
|
+
isInline: true
|
|
3475
3404
|
});
|
|
3476
3405
|
};
|
|
3477
3406
|
i0.ɵɵngDeclareClassMetadata({
|
|
3478
3407
|
minVersion: "12.0.0",
|
|
3479
3408
|
version: "22.2.2",
|
|
3480
3409
|
ngImport: i0,
|
|
3481
|
-
type:
|
|
3482
|
-
decorators: [{
|
|
3410
|
+
type: EmptyComponent,
|
|
3411
|
+
decorators: [{
|
|
3412
|
+
type: Component,
|
|
3413
|
+
args: [{
|
|
3414
|
+
selector: "ngx-uik-empty-route-guard-holder",
|
|
3415
|
+
template: ""
|
|
3416
|
+
}]
|
|
3417
|
+
}]
|
|
3483
3418
|
});
|
|
3484
|
-
const
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
dateInput: "input",
|
|
3488
|
-
monthYearLabel: {
|
|
3489
|
-
year: "numeric",
|
|
3490
|
-
month: "short"
|
|
3491
|
-
},
|
|
3492
|
-
dateA11yLabel: {
|
|
3493
|
-
year: "numeric",
|
|
3494
|
-
month: "long",
|
|
3495
|
-
day: "numeric"
|
|
3496
|
-
},
|
|
3497
|
-
monthYearA11yLabel: {
|
|
3498
|
-
year: "numeric",
|
|
3499
|
-
month: "long"
|
|
3500
|
-
}
|
|
3501
|
-
}
|
|
3502
|
-
};
|
|
3503
|
-
const toIsoString = (date) => {
|
|
3504
|
-
if (!date) return "";
|
|
3505
|
-
return date.toISOString().split("T")[0];
|
|
3506
|
-
};
|
|
3507
|
-
const dateRangeFormSchema = (isRequired) => z$1.object({
|
|
3508
|
-
begin: z$1.instanceof(Date).nullable().refine((val) => !isRequired || val !== null, { message: "Укажите период" }),
|
|
3509
|
-
end: z$1.instanceof(Date).nullable().refine((val) => !isRequired || val !== null, { message: "Укажите период" })
|
|
3419
|
+
const loginSchema = z$1.object({
|
|
3420
|
+
username: z$1.string().min(1, { message: "Пожалуйста, заполните это поле" }).regex(/^[A-Za-z]{1,}\.[A-Za-z]{1,}\.[A-Za-z]*$/, { message: "Пожалуйста, используйте формат \"a.p.petrov\"" }),
|
|
3421
|
+
password: z$1.string().min(1, { message: "Пожалуйста, заполните это поле" })
|
|
3510
3422
|
});
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
})
|
|
3515
|
-
var DateRangeInputComponent = class DateRangeInputComponent {
|
|
3516
|
-
DEFAULT_MIN_DATE = new Date(2020, 0, 1);
|
|
3517
|
-
label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
3518
|
-
dateRange = input({
|
|
3519
|
-
begin: "",
|
|
3520
|
-
end: ""
|
|
3521
|
-
}, ...ngDevMode ? [{ debugName: "dateRange" }] : /* istanbul ignore next */ []);
|
|
3522
|
-
minDate = input(this.DEFAULT_MIN_DATE, ...ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []);
|
|
3523
|
-
clearInput = input(null, ...ngDevMode ? [{ debugName: "clearInput" }] : /* istanbul ignore next */ []);
|
|
3524
|
-
required = input(false, ...ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []);
|
|
3525
|
-
dateRangeChange = output();
|
|
3423
|
+
var LoginFormComponent = class LoginFormComponent {
|
|
3424
|
+
pending = input(false, ...ngDevMode ? [{ debugName: "pending" }] : /* istanbul ignore next */ []);
|
|
3425
|
+
submitted = output();
|
|
3426
|
+
isHidePassword = signal(true, ...ngDevMode ? [{ debugName: "isHidePassword" }] : /* istanbul ignore next */ []);
|
|
3526
3427
|
formModel = signal({
|
|
3527
|
-
|
|
3528
|
-
|
|
3428
|
+
username: "",
|
|
3429
|
+
password: ""
|
|
3529
3430
|
}, ...ngDevMode ? [{ debugName: "formModel" }] : /* istanbul ignore next */ []);
|
|
3530
3431
|
form = form(this.formModel, (schemaPath) => {
|
|
3531
|
-
validateStandardSchema(schemaPath,
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
})
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
untracked(() => {
|
|
3543
|
-
this.form.begin().value.set(value.begin ? new Date(value.begin) : null);
|
|
3544
|
-
this.form.end().value.set(value.end ? new Date(value.end) : null);
|
|
3545
|
-
});
|
|
3546
|
-
});
|
|
3547
|
-
effect(() => {
|
|
3548
|
-
const currentValues = this.form().value();
|
|
3549
|
-
if (this.form().valid()) {
|
|
3550
|
-
const formattedRange = dateRangeSchema(this.required()).parse(currentValues);
|
|
3551
|
-
this.dateRangeChange.emit(formattedRange);
|
|
3552
|
-
}
|
|
3553
|
-
});
|
|
3432
|
+
validateStandardSchema(schemaPath, loginSchema);
|
|
3433
|
+
disabled(schemaPath.username, { when: () => this.pending() });
|
|
3434
|
+
disabled(schemaPath.password, { when: () => this.pending() });
|
|
3435
|
+
}, { submission: { action: async (field) => {
|
|
3436
|
+
this.submitted.emit(field().value());
|
|
3437
|
+
} } });
|
|
3438
|
+
showPassword() {
|
|
3439
|
+
this.isHidePassword.set(false);
|
|
3440
|
+
}
|
|
3441
|
+
hidePassword() {
|
|
3442
|
+
this.isHidePassword.set(true);
|
|
3554
3443
|
}
|
|
3555
3444
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
3556
3445
|
minVersion: "12.0.0",
|
|
3557
3446
|
version: "22.2.2",
|
|
3558
3447
|
ngImport: i0,
|
|
3559
|
-
type:
|
|
3448
|
+
type: LoginFormComponent,
|
|
3560
3449
|
deps: [],
|
|
3561
3450
|
target: i0.ɵɵFactoryTarget.Component
|
|
3562
3451
|
});
|
|
3563
3452
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
3564
3453
|
minVersion: "17.0.0",
|
|
3565
3454
|
version: "22.2.2",
|
|
3566
|
-
type:
|
|
3455
|
+
type: LoginFormComponent,
|
|
3567
3456
|
isStandalone: true,
|
|
3568
|
-
selector: "ngx-uik-
|
|
3569
|
-
inputs: {
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
dateRange: {
|
|
3578
|
-
classPropertyName: "dateRange",
|
|
3579
|
-
publicName: "dateRange",
|
|
3580
|
-
isSignal: true,
|
|
3581
|
-
isRequired: false,
|
|
3582
|
-
transformFunction: null
|
|
3583
|
-
},
|
|
3584
|
-
minDate: {
|
|
3585
|
-
classPropertyName: "minDate",
|
|
3586
|
-
publicName: "minDate",
|
|
3587
|
-
isSignal: true,
|
|
3588
|
-
isRequired: false,
|
|
3589
|
-
transformFunction: null
|
|
3590
|
-
},
|
|
3591
|
-
clearInput: {
|
|
3592
|
-
classPropertyName: "clearInput",
|
|
3593
|
-
publicName: "clearInput",
|
|
3594
|
-
isSignal: true,
|
|
3595
|
-
isRequired: false,
|
|
3596
|
-
transformFunction: null
|
|
3597
|
-
},
|
|
3598
|
-
required: {
|
|
3599
|
-
classPropertyName: "required",
|
|
3600
|
-
publicName: "required",
|
|
3601
|
-
isSignal: true,
|
|
3602
|
-
isRequired: false,
|
|
3603
|
-
transformFunction: null
|
|
3604
|
-
}
|
|
3605
|
-
},
|
|
3606
|
-
outputs: { dateRangeChange: "dateRangeChange" },
|
|
3607
|
-
providers: [{
|
|
3608
|
-
provide: DateAdapter,
|
|
3609
|
-
useClass: CustomDateAdapter
|
|
3610
|
-
}, {
|
|
3611
|
-
provide: MAT_DATE_FORMATS,
|
|
3612
|
-
useValue: MY_NATIVE_FORMATS
|
|
3613
|
-
}],
|
|
3457
|
+
selector: "ngx-uik-login-form",
|
|
3458
|
+
inputs: { pending: {
|
|
3459
|
+
classPropertyName: "pending",
|
|
3460
|
+
publicName: "pending",
|
|
3461
|
+
isSignal: true,
|
|
3462
|
+
isRequired: false,
|
|
3463
|
+
transformFunction: null
|
|
3464
|
+
} },
|
|
3465
|
+
outputs: { submitted: "submitted" },
|
|
3614
3466
|
ngImport: i0,
|
|
3615
|
-
template: "<mat-
|
|
3616
|
-
styles: ["
|
|
3467
|
+
template: "<mat-card appearance=\"outlined\">\r\n <mat-card-header>\r\n <mat-card-title> Авторизация </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <form [formRoot]=\"form\">\r\n <mat-form-field class=\"login-field\">\r\n <mat-label>Имя пользователя</mat-label>\r\n <input\r\n type=\"text\"\r\n matInput\r\n autocomplete=\"on\"\r\n placeholder=\"Имя пользователя\"\r\n [formField]=\"form.username\"\r\n />\r\n @if (form.username().touched() && form.username().invalid()) {\r\n <ng-container ngProjectAs=\"mat-error\">\r\n <mat-error>{{ form.username().errors()[0]?.message }}</mat-error>\r\n </ng-container>\r\n }\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"login-field\">\r\n <mat-label>Пароль</mat-label>\r\n <input\r\n [type]=\"isHidePassword() ? 'password' : 'text'\"\r\n matInput\r\n placeholder=\"Пароль\"\r\n [formField]=\"form.password\"\r\n />\r\n <mat-icon\r\n class=\"watcher\"\r\n matSuffix\r\n (mousedown)=\"showPassword()\"\r\n (mouseup)=\"hidePassword()\"\r\n >{{ isHidePassword() ? \"visibility_off\" : \"visibility\" }}</mat-icon\r\n >\r\n @if (form.password().touched() && form.password().invalid()) {\r\n <ng-container ngProjectAs=\"mat-error\">\r\n <mat-error>{{ form.password().errors()[0]?.message }}</mat-error>\r\n </ng-container>\r\n }\r\n </mat-form-field>\r\n\r\n <div class=\"loginButtons\">\r\n <button\r\n type=\"submit\"\r\n mat-button\r\n mat-stroked-button\r\n color=\"primary\"\r\n [disabled]=\"!form().valid() || pending()\"\r\n >\r\n Войти\r\n </button>\r\n </div>\r\n </form>\r\n </mat-card-content>\r\n</mat-card>\r\n",
|
|
3468
|
+
styles: [":host{display:flex;justify-content:center;margin:32px 0}form{display:flex;flex-direction:column;gap:16px}.login-field{width:100%;min-width:300px}mat-card-header{justify-content:center}mat-card-content{font-size:16px}.loginButtons{display:flex;flex-direction:row;justify-content:flex-end}.watcher{cursor:default}\n"],
|
|
3617
3469
|
dependencies: [
|
|
3470
|
+
{
|
|
3471
|
+
kind: "directive",
|
|
3472
|
+
type: FormRoot,
|
|
3473
|
+
selector: "form[formRoot]",
|
|
3474
|
+
inputs: ["formRoot"]
|
|
3475
|
+
},
|
|
3618
3476
|
{
|
|
3619
3477
|
kind: "directive",
|
|
3620
3478
|
type: FormField,
|
|
@@ -3622,6 +3480,28 @@ var DateRangeInputComponent = class DateRangeInputComponent {
|
|
|
3622
3480
|
inputs: ["formField"],
|
|
3623
3481
|
exportAs: ["formField"]
|
|
3624
3482
|
},
|
|
3483
|
+
{
|
|
3484
|
+
kind: "component",
|
|
3485
|
+
type: MatCard,
|
|
3486
|
+
selector: "mat-card",
|
|
3487
|
+
inputs: ["appearance"],
|
|
3488
|
+
exportAs: ["matCard"]
|
|
3489
|
+
},
|
|
3490
|
+
{
|
|
3491
|
+
kind: "component",
|
|
3492
|
+
type: MatCardHeader,
|
|
3493
|
+
selector: "mat-card-header"
|
|
3494
|
+
},
|
|
3495
|
+
{
|
|
3496
|
+
kind: "directive",
|
|
3497
|
+
type: MatCardTitle,
|
|
3498
|
+
selector: "mat-card-title, [mat-card-title], [matCardTitle]"
|
|
3499
|
+
},
|
|
3500
|
+
{
|
|
3501
|
+
kind: "directive",
|
|
3502
|
+
type: MatCardContent,
|
|
3503
|
+
selector: "mat-card-content"
|
|
3504
|
+
},
|
|
3625
3505
|
{
|
|
3626
3506
|
kind: "component",
|
|
3627
3507
|
type: MatFormField,
|
|
@@ -3641,65 +3521,172 @@ var DateRangeInputComponent = class DateRangeInputComponent {
|
|
|
3641
3521
|
type: MatLabel,
|
|
3642
3522
|
selector: "mat-label"
|
|
3643
3523
|
},
|
|
3524
|
+
{
|
|
3525
|
+
kind: "directive",
|
|
3526
|
+
type: MatInput,
|
|
3527
|
+
selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
|
|
3528
|
+
inputs: [
|
|
3529
|
+
"disabled",
|
|
3530
|
+
"id",
|
|
3531
|
+
"placeholder",
|
|
3532
|
+
"name",
|
|
3533
|
+
"required",
|
|
3534
|
+
"type",
|
|
3535
|
+
"errorStateMatcher",
|
|
3536
|
+
"aria-describedby",
|
|
3537
|
+
"value",
|
|
3538
|
+
"readonly",
|
|
3539
|
+
"disabledInteractive"
|
|
3540
|
+
],
|
|
3541
|
+
exportAs: ["matInput"]
|
|
3542
|
+
},
|
|
3543
|
+
{
|
|
3544
|
+
kind: "directive",
|
|
3545
|
+
type: MatError,
|
|
3546
|
+
selector: "mat-error, [matError]",
|
|
3547
|
+
inputs: ["id"]
|
|
3548
|
+
},
|
|
3549
|
+
{
|
|
3550
|
+
kind: "component",
|
|
3551
|
+
type: MatIcon,
|
|
3552
|
+
selector: "mat-icon",
|
|
3553
|
+
inputs: [
|
|
3554
|
+
"color",
|
|
3555
|
+
"inline",
|
|
3556
|
+
"svgIcon",
|
|
3557
|
+
"fontSet",
|
|
3558
|
+
"fontIcon"
|
|
3559
|
+
],
|
|
3560
|
+
exportAs: ["matIcon"]
|
|
3561
|
+
},
|
|
3562
|
+
{
|
|
3563
|
+
kind: "directive",
|
|
3564
|
+
type: MatSuffix,
|
|
3565
|
+
selector: "[matSuffix], [matIconSuffix], [matTextSuffix]",
|
|
3566
|
+
inputs: ["matTextSuffix"]
|
|
3567
|
+
},
|
|
3568
|
+
{
|
|
3569
|
+
kind: "component",
|
|
3570
|
+
type: MatButton,
|
|
3571
|
+
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] ",
|
|
3572
|
+
inputs: ["matButton"],
|
|
3573
|
+
exportAs: ["matButton", "matAnchor"]
|
|
3574
|
+
}
|
|
3575
|
+
]
|
|
3576
|
+
});
|
|
3577
|
+
};
|
|
3578
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
3579
|
+
minVersion: "12.0.0",
|
|
3580
|
+
version: "22.2.2",
|
|
3581
|
+
ngImport: i0,
|
|
3582
|
+
type: LoginFormComponent,
|
|
3583
|
+
decorators: [{
|
|
3584
|
+
type: Component,
|
|
3585
|
+
args: [{
|
|
3586
|
+
selector: "ngx-uik-login-form",
|
|
3587
|
+
imports: [
|
|
3588
|
+
FormRoot,
|
|
3589
|
+
FormField,
|
|
3590
|
+
MatCard,
|
|
3591
|
+
MatCardHeader,
|
|
3592
|
+
MatCardTitle,
|
|
3593
|
+
MatCardContent,
|
|
3594
|
+
MatFormField,
|
|
3595
|
+
MatLabel,
|
|
3596
|
+
MatInput,
|
|
3597
|
+
MatError,
|
|
3598
|
+
MatIcon,
|
|
3599
|
+
MatSuffix,
|
|
3600
|
+
MatButton
|
|
3601
|
+
],
|
|
3602
|
+
template: "<mat-card appearance=\"outlined\">\r\n <mat-card-header>\r\n <mat-card-title> Авторизация </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <form [formRoot]=\"form\">\r\n <mat-form-field class=\"login-field\">\r\n <mat-label>Имя пользователя</mat-label>\r\n <input\r\n type=\"text\"\r\n matInput\r\n autocomplete=\"on\"\r\n placeholder=\"Имя пользователя\"\r\n [formField]=\"form.username\"\r\n />\r\n @if (form.username().touched() && form.username().invalid()) {\r\n <ng-container ngProjectAs=\"mat-error\">\r\n <mat-error>{{ form.username().errors()[0]?.message }}</mat-error>\r\n </ng-container>\r\n }\r\n </mat-form-field>\r\n\r\n <mat-form-field class=\"login-field\">\r\n <mat-label>Пароль</mat-label>\r\n <input\r\n [type]=\"isHidePassword() ? 'password' : 'text'\"\r\n matInput\r\n placeholder=\"Пароль\"\r\n [formField]=\"form.password\"\r\n />\r\n <mat-icon\r\n class=\"watcher\"\r\n matSuffix\r\n (mousedown)=\"showPassword()\"\r\n (mouseup)=\"hidePassword()\"\r\n >{{ isHidePassword() ? \"visibility_off\" : \"visibility\" }}</mat-icon\r\n >\r\n @if (form.password().touched() && form.password().invalid()) {\r\n <ng-container ngProjectAs=\"mat-error\">\r\n <mat-error>{{ form.password().errors()[0]?.message }}</mat-error>\r\n </ng-container>\r\n }\r\n </mat-form-field>\r\n\r\n <div class=\"loginButtons\">\r\n <button\r\n type=\"submit\"\r\n mat-button\r\n mat-stroked-button\r\n color=\"primary\"\r\n [disabled]=\"!form().valid() || pending()\"\r\n >\r\n Войти\r\n </button>\r\n </div>\r\n </form>\r\n </mat-card-content>\r\n</mat-card>\r\n",
|
|
3603
|
+
styles: [":host{display:flex;justify-content:center;margin:32px 0}form{display:flex;flex-direction:column;gap:16px}.login-field{width:100%;min-width:300px}mat-card-header{justify-content:center}mat-card-content{font-size:16px}.loginButtons{display:flex;flex-direction:row;justify-content:flex-end}.watcher{cursor:default}\n"]
|
|
3604
|
+
}]
|
|
3605
|
+
}],
|
|
3606
|
+
propDecorators: {
|
|
3607
|
+
pending: [{
|
|
3608
|
+
type: i0.Input,
|
|
3609
|
+
args: [{
|
|
3610
|
+
isSignal: true,
|
|
3611
|
+
alias: "pending",
|
|
3612
|
+
required: false
|
|
3613
|
+
}]
|
|
3614
|
+
}],
|
|
3615
|
+
submitted: [{
|
|
3616
|
+
type: i0.Output,
|
|
3617
|
+
args: ["submitted"]
|
|
3618
|
+
}]
|
|
3619
|
+
}
|
|
3620
|
+
});
|
|
3621
|
+
var PermitFormComponent = class PermitFormComponent {
|
|
3622
|
+
hidy = viewChild("hidy", ...ngDevMode ? [{ debugName: "hidy" }] : /* istanbul ignore next */ []);
|
|
3623
|
+
submitted = output();
|
|
3624
|
+
constructor() {
|
|
3625
|
+
effect(() => {
|
|
3626
|
+
const inputEl = this.hidy()?.nativeElement;
|
|
3627
|
+
if (inputEl) inputEl.focus();
|
|
3628
|
+
});
|
|
3629
|
+
}
|
|
3630
|
+
focusInput() {
|
|
3631
|
+
this.hidy()?.nativeElement.focus();
|
|
3632
|
+
}
|
|
3633
|
+
onKeydown(event) {
|
|
3634
|
+
if (event.key === "Enter") {
|
|
3635
|
+
const inputEl = this.hidy()?.nativeElement;
|
|
3636
|
+
if (inputEl?.value && inputEl.value.trim()) {
|
|
3637
|
+
this.submitted.emit(inputEl.value);
|
|
3638
|
+
inputEl.value = "";
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
}
|
|
3642
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
3643
|
+
minVersion: "12.0.0",
|
|
3644
|
+
version: "22.2.2",
|
|
3645
|
+
ngImport: i0,
|
|
3646
|
+
type: PermitFormComponent,
|
|
3647
|
+
deps: [],
|
|
3648
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
3649
|
+
});
|
|
3650
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
3651
|
+
minVersion: "17.2.0",
|
|
3652
|
+
version: "22.2.2",
|
|
3653
|
+
type: PermitFormComponent,
|
|
3654
|
+
isStandalone: true,
|
|
3655
|
+
selector: "ngx-uik-permit-form",
|
|
3656
|
+
outputs: { submitted: "submitted" },
|
|
3657
|
+
host: { listeners: { "document:mouseup": "focusInput()" } },
|
|
3658
|
+
viewQueries: [{
|
|
3659
|
+
propertyName: "hidy",
|
|
3660
|
+
first: true,
|
|
3661
|
+
predicate: ["hidy"],
|
|
3662
|
+
descendants: true,
|
|
3663
|
+
isSignal: true
|
|
3664
|
+
}],
|
|
3665
|
+
ngImport: i0,
|
|
3666
|
+
template: "<mat-card appearance=\"outlined\">\r\n <mat-card-header>\r\n <mat-card-title>\r\n Приложите пропуск\r\n </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <div class=\"permit\"></div>\r\n </mat-card-content>\r\n</mat-card>\r\n<input #hidy class=\"hidy\" type=\"text\" (keydown)=\"onKeydown($event)\"/>",
|
|
3667
|
+
styles: [":host{display:flex;justify-content:center;margin:32px 0}.mat-mdc-form-field{width:100%;min-width:300px}mat-card-title,mat-card-content{display:flex;justify-content:center}mat-card-content{font-size:16px}div.permit{border:none;width:300px;background-size:300px;height:180px}div.permit button div{margin-bottom:200px;color:#000;font-size:34px}input.hidy{opacity:0;position:absolute;left:-200px;top:-200px}\n"],
|
|
3668
|
+
dependencies: [
|
|
3644
3669
|
{
|
|
3645
3670
|
kind: "component",
|
|
3646
|
-
type:
|
|
3647
|
-
selector: "mat-
|
|
3648
|
-
inputs: [
|
|
3649
|
-
|
|
3650
|
-
"required",
|
|
3651
|
-
"dateFilter",
|
|
3652
|
-
"min",
|
|
3653
|
-
"max",
|
|
3654
|
-
"disabled",
|
|
3655
|
-
"separator",
|
|
3656
|
-
"comparisonStart",
|
|
3657
|
-
"comparisonEnd"
|
|
3658
|
-
],
|
|
3659
|
-
exportAs: ["matDateRangeInput"]
|
|
3660
|
-
},
|
|
3661
|
-
{
|
|
3662
|
-
kind: "directive",
|
|
3663
|
-
type: MatStartDate,
|
|
3664
|
-
selector: "input[matStartDate]",
|
|
3665
|
-
outputs: ["dateChange", "dateInput"]
|
|
3666
|
-
},
|
|
3667
|
-
{
|
|
3668
|
-
kind: "directive",
|
|
3669
|
-
type: MatEndDate,
|
|
3670
|
-
selector: "input[matEndDate]",
|
|
3671
|
-
outputs: ["dateChange", "dateInput"]
|
|
3671
|
+
type: MatCard,
|
|
3672
|
+
selector: "mat-card",
|
|
3673
|
+
inputs: ["appearance"],
|
|
3674
|
+
exportAs: ["matCard"]
|
|
3672
3675
|
},
|
|
3673
3676
|
{
|
|
3674
3677
|
kind: "component",
|
|
3675
|
-
type:
|
|
3676
|
-
selector: "mat-
|
|
3677
|
-
inputs: [
|
|
3678
|
-
"for",
|
|
3679
|
-
"tabIndex",
|
|
3680
|
-
"aria-label",
|
|
3681
|
-
"disabled",
|
|
3682
|
-
"disableRipple"
|
|
3683
|
-
],
|
|
3684
|
-
exportAs: ["matDatepickerToggle"]
|
|
3678
|
+
type: MatCardHeader,
|
|
3679
|
+
selector: "mat-card-header"
|
|
3685
3680
|
},
|
|
3686
3681
|
{
|
|
3687
3682
|
kind: "directive",
|
|
3688
|
-
type:
|
|
3689
|
-
selector: "
|
|
3690
|
-
inputs: ["matTextSuffix"]
|
|
3691
|
-
},
|
|
3692
|
-
{
|
|
3693
|
-
kind: "component",
|
|
3694
|
-
type: MatDateRangePicker,
|
|
3695
|
-
selector: "mat-date-range-picker",
|
|
3696
|
-
exportAs: ["matDateRangePicker"]
|
|
3683
|
+
type: MatCardTitle,
|
|
3684
|
+
selector: "mat-card-title, [mat-card-title], [matCardTitle]"
|
|
3697
3685
|
},
|
|
3698
3686
|
{
|
|
3699
3687
|
kind: "directive",
|
|
3700
|
-
type:
|
|
3701
|
-
selector: "mat-
|
|
3702
|
-
inputs: ["id"]
|
|
3688
|
+
type: MatCardContent,
|
|
3689
|
+
selector: "mat-card-content"
|
|
3703
3690
|
}
|
|
3704
3691
|
]
|
|
3705
3692
|
});
|
|
@@ -3708,121 +3695,146 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3708
3695
|
minVersion: "12.0.0",
|
|
3709
3696
|
version: "22.2.2",
|
|
3710
3697
|
ngImport: i0,
|
|
3711
|
-
type:
|
|
3698
|
+
type: PermitFormComponent,
|
|
3712
3699
|
decorators: [{
|
|
3713
3700
|
type: Component,
|
|
3714
3701
|
args: [{
|
|
3715
|
-
selector: "ngx-uik-
|
|
3702
|
+
selector: "ngx-uik-permit-form",
|
|
3716
3703
|
imports: [
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
MatStartDate,
|
|
3722
|
-
MatEndDate,
|
|
3723
|
-
MatDatepickerToggle,
|
|
3724
|
-
MatSuffix,
|
|
3725
|
-
MatDateRangePicker,
|
|
3726
|
-
MatError
|
|
3704
|
+
MatCard,
|
|
3705
|
+
MatCardHeader,
|
|
3706
|
+
MatCardTitle,
|
|
3707
|
+
MatCardContent
|
|
3727
3708
|
],
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
useClass: CustomDateAdapter
|
|
3731
|
-
}, {
|
|
3732
|
-
provide: MAT_DATE_FORMATS,
|
|
3733
|
-
useValue: MY_NATIVE_FORMATS
|
|
3734
|
-
}],
|
|
3735
|
-
template: "<mat-form-field appearance=\"fill\">\r\n <mat-label>{{ label() }}</mat-label>\r\n <mat-date-range-input\r\n [rangePicker]=\"picker\"\r\n [min]=\"minDate()\"\r\n >\r\n <input matStartDate [formField]=\"form.begin\" placeholder=\"Дата начала\" />\r\n <input matEndDate [formField]=\"form.end\" placeholder=\"Дата окончания\" />\r\n </mat-date-range-input>\r\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\r\n <mat-date-range-picker #picker></mat-date-range-picker>\r\n @if (form.begin().touched() && form.begin().invalid()) {\r\n <ng-container ngProjectAs=\"mat-error\">\r\n <mat-error>{{ form.begin().errors()[0]?.message }}</mat-error>\r\n </ng-container>\r\n }\r\n @if (form.end().touched() && form.end().invalid()) {\r\n <ng-container ngProjectAs=\"mat-error\">\r\n <mat-error>{{ form.end().errors()[0]?.message }}</mat-error>\r\n </ng-container>\r\n }\r\n</mat-form-field>\r\n",
|
|
3736
|
-
styles: ["mat-form-field{margin-right:16px}\n"]
|
|
3709
|
+
template: "<mat-card appearance=\"outlined\">\r\n <mat-card-header>\r\n <mat-card-title>\r\n Приложите пропуск\r\n </mat-card-title>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <div class=\"permit\"></div>\r\n </mat-card-content>\r\n</mat-card>\r\n<input #hidy class=\"hidy\" type=\"text\" (keydown)=\"onKeydown($event)\"/>",
|
|
3710
|
+
styles: [":host{display:flex;justify-content:center;margin:32px 0}.mat-mdc-form-field{width:100%;min-width:300px}mat-card-title,mat-card-content{display:flex;justify-content:center}mat-card-content{font-size:16px}div.permit{border:none;width:300px;background-size:300px;height:180px}div.permit button div{margin-bottom:200px;color:#000;font-size:34px}input.hidy{opacity:0;position:absolute;left:-200px;top:-200px}\n"]
|
|
3737
3711
|
}]
|
|
3738
3712
|
}],
|
|
3739
3713
|
ctorParameters: () => [],
|
|
3740
3714
|
propDecorators: {
|
|
3741
|
-
|
|
3742
|
-
type: i0.
|
|
3743
|
-
args: [{
|
|
3744
|
-
isSignal: true,
|
|
3745
|
-
alias: "label",
|
|
3746
|
-
required: false
|
|
3747
|
-
}]
|
|
3748
|
-
}],
|
|
3749
|
-
dateRange: [{
|
|
3750
|
-
type: i0.Input,
|
|
3751
|
-
args: [{
|
|
3752
|
-
isSignal: true,
|
|
3753
|
-
alias: "dateRange",
|
|
3754
|
-
required: false
|
|
3755
|
-
}]
|
|
3756
|
-
}],
|
|
3757
|
-
minDate: [{
|
|
3758
|
-
type: i0.Input,
|
|
3759
|
-
args: [{
|
|
3760
|
-
isSignal: true,
|
|
3761
|
-
alias: "minDate",
|
|
3762
|
-
required: false
|
|
3763
|
-
}]
|
|
3764
|
-
}],
|
|
3765
|
-
clearInput: [{
|
|
3766
|
-
type: i0.Input,
|
|
3767
|
-
args: [{
|
|
3768
|
-
isSignal: true,
|
|
3769
|
-
alias: "clearInput",
|
|
3770
|
-
required: false
|
|
3771
|
-
}]
|
|
3772
|
-
}],
|
|
3773
|
-
required: [{
|
|
3774
|
-
type: i0.Input,
|
|
3775
|
-
args: [{
|
|
3776
|
-
isSignal: true,
|
|
3777
|
-
alias: "required",
|
|
3778
|
-
required: false
|
|
3779
|
-
}]
|
|
3715
|
+
hidy: [{
|
|
3716
|
+
type: i0.ViewChild,
|
|
3717
|
+
args: ["hidy", { isSignal: true }]
|
|
3780
3718
|
}],
|
|
3781
|
-
|
|
3719
|
+
submitted: [{
|
|
3782
3720
|
type: i0.Output,
|
|
3783
|
-
args: ["
|
|
3721
|
+
args: ["submitted"]
|
|
3722
|
+
}],
|
|
3723
|
+
focusInput: [{
|
|
3724
|
+
type: HostListener,
|
|
3725
|
+
args: ["document:mouseup"]
|
|
3784
3726
|
}]
|
|
3785
3727
|
}
|
|
3786
3728
|
});
|
|
3787
|
-
var
|
|
3788
|
-
(
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3729
|
+
var LoginPageComponent = class LoginPageComponent {
|
|
3730
|
+
pending = signal(false, ...ngDevMode ? [{ debugName: "pending" }] : /* istanbul ignore next */ []);
|
|
3731
|
+
isKiosk = signal(false, ...ngDevMode ? [{ debugName: "isKiosk" }] : /* istanbul ignore next */ []);
|
|
3732
|
+
idCas = input(0, ...ngDevMode ? [{ debugName: "idCas" }] : /* istanbul ignore next */ []);
|
|
3733
|
+
authService = inject(AuthService);
|
|
3734
|
+
router = inject(Router);
|
|
3735
|
+
notificationService = inject(UIKIT_NOTIFICATION_TOKEN, { optional: true });
|
|
3736
|
+
constructor() {
|
|
3737
|
+
if (localStorage.getItem("id_human") || localStorage.getItem("kiosk-keyboard-layout")) {}
|
|
3738
|
+
}
|
|
3739
|
+
async onSubmit(event) {
|
|
3740
|
+
this.startLoading();
|
|
3741
|
+
try {
|
|
3742
|
+
await lastValueFrom(this.authService.login(event.username, event.password, this.idCas()));
|
|
3743
|
+
this.handleSuccessLogin();
|
|
3744
|
+
} catch (error) {
|
|
3745
|
+
this.handleError(error);
|
|
3746
|
+
} finally {
|
|
3747
|
+
this.finishLoading();
|
|
3748
|
+
}
|
|
3749
|
+
}
|
|
3750
|
+
async onSubmitPermit(permit) {
|
|
3751
|
+
this.startLoading();
|
|
3752
|
+
try {
|
|
3753
|
+
await lastValueFrom(this.authService.loginByPermit(permit, this.idCas()));
|
|
3754
|
+
this.handleSuccessLogin();
|
|
3755
|
+
} catch (error) {
|
|
3756
|
+
this.handleError(error);
|
|
3757
|
+
} finally {
|
|
3758
|
+
this.finishLoading();
|
|
3759
|
+
}
|
|
3760
|
+
}
|
|
3761
|
+
startLoading() {
|
|
3762
|
+
this.pending.set(true);
|
|
3763
|
+
}
|
|
3764
|
+
finishLoading() {
|
|
3765
|
+
this.pending.set(false);
|
|
3766
|
+
}
|
|
3767
|
+
handleError(error) {
|
|
3768
|
+
const errorMsg = "Ошибка при авторизации: " + (error.error || error.error?.message || error.message);
|
|
3769
|
+
this.notificationService?.error(errorMsg, 0);
|
|
3770
|
+
}
|
|
3771
|
+
handleSuccessLogin() {
|
|
3772
|
+
this.notificationService?.success("Успешная авторизация");
|
|
3773
|
+
if (!this.router) return;
|
|
3774
|
+
const returnUrl = this.router.parseUrl(this.router.url).queryParamMap.get("returnUrl");
|
|
3775
|
+
if (returnUrl) this.router.navigateByUrl(decodeURIComponent(returnUrl));
|
|
3776
|
+
else this.router.navigate(["/"]);
|
|
3777
|
+
}
|
|
3795
3778
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
3796
3779
|
minVersion: "12.0.0",
|
|
3797
3780
|
version: "22.2.2",
|
|
3798
3781
|
ngImport: i0,
|
|
3799
|
-
type:
|
|
3782
|
+
type: LoginPageComponent,
|
|
3800
3783
|
deps: [],
|
|
3801
3784
|
target: i0.ɵɵFactoryTarget.Component
|
|
3802
3785
|
});
|
|
3803
3786
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
3804
|
-
minVersion: "
|
|
3787
|
+
minVersion: "17.0.0",
|
|
3805
3788
|
version: "22.2.2",
|
|
3806
|
-
type:
|
|
3789
|
+
type: LoginPageComponent,
|
|
3807
3790
|
isStandalone: true,
|
|
3808
|
-
selector: "ngx-uik-
|
|
3791
|
+
selector: "ngx-uik-login-page",
|
|
3792
|
+
inputs: { idCas: {
|
|
3793
|
+
classPropertyName: "idCas",
|
|
3794
|
+
publicName: "idCas",
|
|
3795
|
+
isSignal: true,
|
|
3796
|
+
isRequired: false,
|
|
3797
|
+
transformFunction: null
|
|
3798
|
+
} },
|
|
3809
3799
|
ngImport: i0,
|
|
3810
|
-
template: "",
|
|
3811
|
-
|
|
3800
|
+
template: "@if (isKiosk()) {\r\n <ngx-uik-permit-form (submitted)=\"onSubmitPermit($event)\" />\r\n} @else {\r\n <ngx-uik-login-form (submitted)=\"onSubmit($event)\" [pending]=\"pending()\" />\r\n}\r\n",
|
|
3801
|
+
styles: [""],
|
|
3802
|
+
dependencies: [{
|
|
3803
|
+
kind: "component",
|
|
3804
|
+
type: LoginFormComponent,
|
|
3805
|
+
selector: "ngx-uik-login-form",
|
|
3806
|
+
inputs: ["pending"],
|
|
3807
|
+
outputs: ["submitted"]
|
|
3808
|
+
}, {
|
|
3809
|
+
kind: "component",
|
|
3810
|
+
type: PermitFormComponent,
|
|
3811
|
+
selector: "ngx-uik-permit-form",
|
|
3812
|
+
outputs: ["submitted"]
|
|
3813
|
+
}]
|
|
3812
3814
|
});
|
|
3813
3815
|
};
|
|
3814
3816
|
i0.ɵɵngDeclareClassMetadata({
|
|
3815
3817
|
minVersion: "12.0.0",
|
|
3816
3818
|
version: "22.2.2",
|
|
3817
3819
|
ngImport: i0,
|
|
3818
|
-
type:
|
|
3820
|
+
type: LoginPageComponent,
|
|
3819
3821
|
decorators: [{
|
|
3820
3822
|
type: Component,
|
|
3821
3823
|
args: [{
|
|
3822
|
-
selector: "ngx-uik-
|
|
3823
|
-
|
|
3824
|
+
selector: "ngx-uik-login-page",
|
|
3825
|
+
imports: [LoginFormComponent, PermitFormComponent],
|
|
3826
|
+
template: "@if (isKiosk()) {\r\n <ngx-uik-permit-form (submitted)=\"onSubmitPermit($event)\" />\r\n} @else {\r\n <ngx-uik-login-form (submitted)=\"onSubmit($event)\" [pending]=\"pending()\" />\r\n}\r\n"
|
|
3824
3827
|
}]
|
|
3825
|
-
}]
|
|
3828
|
+
}],
|
|
3829
|
+
ctorParameters: () => [],
|
|
3830
|
+
propDecorators: { idCas: [{
|
|
3831
|
+
type: i0.Input,
|
|
3832
|
+
args: [{
|
|
3833
|
+
isSignal: true,
|
|
3834
|
+
alias: "idCas",
|
|
3835
|
+
required: false
|
|
3836
|
+
}]
|
|
3837
|
+
}] }
|
|
3826
3838
|
});
|
|
3827
3839
|
var NavBarComponent = class NavBarComponent extends BaseNavBarMenuClass {
|
|
3828
3840
|
visibleOnLogout = input(false, ...ngDevMode ? [{ debugName: "visibleOnLogout" }] : /* istanbul ignore next */ []);
|