@kuzntsv/uikit 1.0.113 → 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.
@@ -1,23 +1,19 @@
1
1
  import * as i0 from "@angular/core";
2
- import { ChangeDetectionStrategy, Component, Directive, ElementRef, Injectable, InjectionToken, NgZone, Pipe, Service, computed, debounced, effect, inject, input, linkedSignal, makeEnvironmentProviders, model, output, signal, untracked, viewChild } from "@angular/core";
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
- const loginSchema = z$1.object({
41
- username: z$1.string().min(1, { message: "Пожалуйста, заполните это поле" }).regex(/^[A-Za-z]{1,}\.[A-Za-z]{1,}\.[A-Za-z]*$/, { message: "Пожалуйста, используйте формат \"a.p.petrov\"" }),
42
- password: z$1.string().min(1, { message: "Пожалуйста, заполните это поле" })
43
- });
44
- var LoginFormComponent = class LoginFormComponent {
45
- pending = input(false, ...ngDevMode ? [{ debugName: "pending" }] : /* istanbul ignore next */ []);
46
- submitted = output();
47
- isHidePassword = signal(true, ...ngDevMode ? [{ debugName: "isHidePassword" }] : /* istanbul ignore next */ []);
48
- formModel = signal({
49
- username: "",
50
- password: ""
51
- }, ...ngDevMode ? [{ debugName: "formModel" }] : /* istanbul ignore next */ []);
52
- form = form(this.formModel, (schemaPath) => {
53
- validateStandardSchema(schemaPath, loginSchema);
54
- disabled(schemaPath.username, { when: () => this.pending() });
55
- disabled(schemaPath.password, { when: () => this.pending() });
56
- }, { submission: { action: async (field) => {
57
- this.submitted.emit(field().value());
58
- } } });
59
- showPassword() {
60
- this.isHidePassword.set(false);
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
- hidePassword() {
63
- this.isHidePassword.set(true);
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: LoginFormComponent,
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: LoginFormComponent,
137
+ type: BaseToolbarComponent,
77
138
  isStandalone: true,
78
- selector: "ngx-uik-login-form",
79
- inputs: { pending: {
80
- classPropertyName: "pending",
81
- publicName: "pending",
82
- isSignal: true,
83
- isRequired: false,
84
- transformFunction: null
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
- kind: "component",
106
- type: MatCard,
107
- selector: "mat-card",
108
- inputs: ["appearance"],
109
- exportAs: ["matCard"]
148
+ rolesEditBtn: {
149
+ classPropertyName: "rolesEditBtn",
150
+ publicName: "rolesEditBtn",
151
+ isSignal: true,
152
+ isRequired: false,
153
+ transformFunction: null
110
154
  },
111
- {
112
- kind: "component",
113
- type: MatCardHeader,
114
- selector: "mat-card-header"
155
+ rolesRemoveBtn: {
156
+ classPropertyName: "rolesRemoveBtn",
157
+ publicName: "rolesRemoveBtn",
158
+ isSignal: true,
159
+ isRequired: false,
160
+ transformFunction: null
115
161
  },
116
- {
117
- kind: "directive",
118
- type: MatCardTitle,
119
- selector: "mat-card-title, [mat-card-title], [matCardTitle]"
162
+ rolesCopyBtn: {
163
+ classPropertyName: "rolesCopyBtn",
164
+ publicName: "rolesCopyBtn",
165
+ isSignal: true,
166
+ isRequired: false,
167
+ transformFunction: null
120
168
  },
121
- {
122
- kind: "directive",
123
- type: MatCardContent,
124
- selector: "mat-card-content"
169
+ rolesExcelBtn: {
170
+ classPropertyName: "rolesExcelBtn",
171
+ publicName: "rolesExcelBtn",
172
+ isSignal: true,
173
+ isRequired: false,
174
+ transformFunction: null
125
175
  },
126
- {
127
- kind: "component",
128
- type: MatFormField,
129
- selector: "mat-form-field",
130
- inputs: [
131
- "hideRequiredMarker",
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
- kind: "directive",
142
- type: MatLabel,
143
- selector: "mat-label"
183
+ rolesPdfBtn: {
184
+ classPropertyName: "rolesPdfBtn",
185
+ publicName: "rolesPdfBtn",
186
+ isSignal: true,
187
+ isRequired: false,
188
+ transformFunction: null
144
189
  },
145
- {
146
- kind: "directive",
147
- type: MatInput,
148
- selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]",
149
- inputs: [
150
- "disabled",
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
- kind: "directive",
166
- type: MatError,
167
- selector: "mat-error, [matError]",
168
- inputs: ["id"]
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: MatSuffix,
186
- selector: "[matSuffix], [matIconSuffix], [matTextSuffix]",
187
- inputs: ["matTextSuffix"]
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: MatButton,
192
- 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] ",
193
- inputs: ["matButton"],
194
- exportAs: ["matButton", "matAnchor"]
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: LoginFormComponent,
480
+ type: BaseToolbarComponent,
204
481
  decorators: [{
205
482
  type: Component,
206
483
  args: [{
207
- selector: "ngx-uik-login-form",
484
+ selector: "ngx-uik-base-toolbar",
485
+ changeDetection: ChangeDetectionStrategy.Eager,
208
486
  imports: [
209
- FormRoot,
210
- FormField,
211
- MatCard,
212
- MatCardHeader,
213
- MatCardTitle,
214
- MatCardContent,
215
- MatFormField,
216
- MatLabel,
217
- MatInput,
218
- MatError,
487
+ MatToolbar,
488
+ MatIconButton,
489
+ MatTooltip,
219
490
  MatIcon,
220
- MatSuffix,
221
- MatButton
491
+ MatMenu,
492
+ MatDivider,
493
+ MatMenuTrigger,
494
+ MatMenuItem
222
495
  ],
223
- 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",
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
- pending: [{
500
+ rolesNewBtn: [{
229
501
  type: i0.Input,
230
502
  args: [{
231
503
  isSignal: true,
232
- alias: "pending",
504
+ alias: "rolesNewBtn",
233
505
  required: false
234
506
  }]
235
507
  }],
236
- submitted: [{
237
- type: i0.Output,
238
- args: ["submitted"]
239
- }]
240
- }
241
- });
242
- var PermitFormComponent = class PermitFormComponent {
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
- ngImport: i0,
286
- 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)\"/>",
287
- 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"],
288
- dependencies: [
289
- {
290
- kind: "component",
291
- type: MatCard,
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
- zone = inject(NgZone);
1441
- eventSource = null;
1442
- isConnected = false;
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
- const subject = new ReplaySubject(1);
1446
- this.closeSseEventSource();
1447
- const topicUri = topic.getTopic(baseUrl, user);
1448
- this.eventSource = new EventSource(topicUri);
1449
- if (this.eventSource) {
1450
- this.isConnected = true;
1451
- this.eventSource.onmessage = (event) => {
1452
- console.log(event);
1453
- const messageData = JSON.parse(event.data);
1454
- this.zone.run(() => {
1455
- subject.next(messageData);
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
- this.eventSource.onopen = () => {
1459
- console.log("SSE connection opened.");
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
- this.eventSource.onerror = (error) => {
1462
- console.error("SSE error:", error);
1463
- this.reconnectOnError(baseUrl, user, topic, subject);
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
- if (this.eventSource) {
1480
- this.eventSource.close();
1481
- this.eventSource = null;
1482
- this.isConnected = false;
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.Service
1095
+ target: i0.ɵɵFactoryTarget.Injectable
1493
1096
  });
1494
- static ɵprov = i0.ɵɵngDeclareService({
1495
- minVersion: "22.0.0",
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: [{ type: Service }],
1110
+ decorators: [{
1111
+ type: Injectable,
1112
+ args: [{ providedIn: "root" }]
1113
+ }],
1507
1114
  ctorParameters: () => []
1508
1115
  });
1509
1116
  var BaseFilterClass = class BaseFilterClass {
@@ -2731,61 +2338,173 @@ var BaseSignalServiceClass = class BaseSignalServiceClass {
2731
2338
  minVersion: "12.0.0",
2732
2339
  version: "22.2.2",
2733
2340
  ngImport: i0,
2734
- 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,
2735
2440
  deps: [],
2736
- target: i0.ɵɵFactoryTarget.Injectable
2441
+ target: i0.ɵɵFactoryTarget.Directive
2737
2442
  });
2738
- static ɵprov = i0.ɵɵngDeclareInjectable({
2739
- minVersion: "12.0.0",
2443
+ static ɵdir = i0.ɵɵngDeclareDirective({
2444
+ minVersion: "17.1.0",
2740
2445
  version: "22.2.2",
2741
- ngImport: i0,
2742
- type: BaseSignalServiceClass,
2743
- providedIn: "root"
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
2744
2457
  });
2745
2458
  };
2746
2459
  i0.ɵɵngDeclareClassMetadata({
2747
2460
  minVersion: "12.0.0",
2748
2461
  version: "22.2.2",
2749
2462
  ngImport: i0,
2750
- type: BaseSignalServiceClass,
2463
+ type: HideIfForbiddenRoleDirective,
2751
2464
  decorators: [{
2752
- type: Injectable,
2753
- args: [{ providedIn: "root" }]
2754
- }]
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
+ }] }
2755
2477
  });
2756
- var DisableIfRoleDirective = class DisableIfRoleDirective {
2757
- forbiddenRoles = input([], {
2758
- ...ngDevMode ? { debugName: "forbiddenRoles" } : /* istanbul ignore next */ {},
2759
- alias: "ngxUikDisableIfRole"
2478
+ var SetValueDirective = class SetValueDirective {
2479
+ value = input(null, {
2480
+ ...ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {},
2481
+ alias: "setValue"
2760
2482
  });
2761
- el = inject(ElementRef);
2762
- roleService = inject(RoleService);
2483
+ ngControl = inject(NgControl, { optional: true });
2763
2484
  constructor() {
2764
2485
  effect(() => {
2765
- const shouldDisable = this.roleService.hasForbiddenRole(this.forbiddenRoles());
2766
- const nativeEl = this.el.nativeElement;
2767
- if ("disabled" in nativeEl) nativeEl.disabled = shouldDisable;
2768
- else if (shouldDisable) nativeEl.setAttribute("disabled", "true");
2769
- 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 });
2770
2489
  });
2771
2490
  }
2772
2491
  static ɵfac = i0.ɵɵngDeclareFactory({
2773
2492
  minVersion: "12.0.0",
2774
2493
  version: "22.2.2",
2775
2494
  ngImport: i0,
2776
- type: DisableIfRoleDirective,
2495
+ type: SetValueDirective,
2777
2496
  deps: [],
2778
2497
  target: i0.ɵɵFactoryTarget.Directive
2779
2498
  });
2780
2499
  static ɵdir = i0.ɵɵngDeclareDirective({
2781
2500
  minVersion: "17.1.0",
2782
2501
  version: "22.2.2",
2783
- type: DisableIfRoleDirective,
2502
+ type: SetValueDirective,
2784
2503
  isStandalone: true,
2785
- selector: "[ngxUikDisableIfRole]",
2786
- inputs: { forbiddenRoles: {
2787
- classPropertyName: "forbiddenRoles",
2788
- publicName: "ngxUikDisableIfRole",
2504
+ selector: "[setValue]",
2505
+ inputs: { value: {
2506
+ classPropertyName: "value",
2507
+ publicName: "setValue",
2789
2508
  isSignal: true,
2790
2509
  isRequired: false,
2791
2510
  transformFunction: null
@@ -2797,556 +2516,776 @@ i0.ɵɵngDeclareClassMetadata({
2797
2516
  minVersion: "12.0.0",
2798
2517
  version: "22.2.2",
2799
2518
  ngImport: i0,
2800
- type: DisableIfRoleDirective,
2519
+ type: SetValueDirective,
2801
2520
  decorators: [{
2802
2521
  type: Directive,
2803
- args: [{ selector: "[ngxUikDisableIfRole]" }]
2522
+ args: [{ selector: "[setValue]" }]
2804
2523
  }],
2805
2524
  ctorParameters: () => [],
2806
- propDecorators: { forbiddenRoles: [{
2525
+ propDecorators: { value: [{
2807
2526
  type: i0.Input,
2808
2527
  args: [{
2809
2528
  isSignal: true,
2810
- alias: "ngxUikDisableIfRole",
2529
+ alias: "setValue",
2811
2530
  required: false
2812
2531
  }]
2813
2532
  }] }
2814
2533
  });
2815
- var HideIfForbiddenRoleDirective = class HideIfForbiddenRoleDirective {
2816
- forbiddenRoles = input([], {
2817
- ...ngDevMode ? { debugName: "forbiddenRoles" } : /* istanbul ignore next */ {},
2818
- alias: "ngxUikHideIfForbiddenRole"
2819
- });
2820
- el = inject(ElementRef);
2821
- roleService = inject(RoleService);
2822
- constructor() {
2823
- effect(() => {
2824
- const shouldHide = this.roleService.hasForbiddenRole(this.forbiddenRoles());
2825
- this.el.nativeElement.style.display = shouldHide ? "none" : "";
2826
- });
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;
2827
2703
  }
2828
2704
  static ɵfac = i0.ɵɵngDeclareFactory({
2829
2705
  minVersion: "12.0.0",
2830
2706
  version: "22.2.2",
2831
2707
  ngImport: i0,
2832
- type: HideIfForbiddenRoleDirective,
2708
+ type: TruncatePipe,
2833
2709
  deps: [],
2834
- target: i0.ɵɵFactoryTarget.Directive
2710
+ target: i0.ɵɵFactoryTarget.Pipe
2835
2711
  });
2836
- static ɵdir = i0.ɵɵngDeclareDirective({
2837
- minVersion: "17.1.0",
2712
+ static ɵpipe = i0.ɵɵngDeclarePipe({
2713
+ minVersion: "14.0.0",
2838
2714
  version: "22.2.2",
2839
- type: HideIfForbiddenRoleDirective,
2715
+ ngImport: i0,
2716
+ type: TruncatePipe,
2840
2717
  isStandalone: true,
2841
- selector: "[ngxUikHideIfForbiddenRole]",
2842
- inputs: { forbiddenRoles: {
2843
- classPropertyName: "forbiddenRoles",
2844
- publicName: "ngxUikHideIfForbiddenRole",
2845
- isSignal: true,
2846
- isRequired: false,
2847
- transformFunction: null
2848
- } },
2849
- ngImport: i0
2718
+ name: "truncate"
2850
2719
  });
2851
2720
  };
2852
2721
  i0.ɵɵngDeclareClassMetadata({
2853
2722
  minVersion: "12.0.0",
2854
2723
  version: "22.2.2",
2855
2724
  ngImport: i0,
2856
- type: HideIfForbiddenRoleDirective,
2725
+ type: TruncatePipe,
2857
2726
  decorators: [{
2858
- type: Directive,
2859
- args: [{ selector: "[ngxUikHideIfForbiddenRole]" }]
2860
- }],
2861
- ctorParameters: () => [],
2862
- propDecorators: { forbiddenRoles: [{
2863
- type: i0.Input,
2864
- args: [{
2865
- isSignal: true,
2866
- alias: "ngxUikHideIfForbiddenRole",
2867
- required: false
2868
- }]
2869
- }] }
2727
+ type: Pipe,
2728
+ args: [{ name: "truncate" }]
2729
+ }]
2870
2730
  });
2871
- var SetValueDirective = class SetValueDirective {
2872
- value = input(null, {
2873
- ...ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {},
2874
- alias: "setValue"
2731
+ var ChipInputAutocompleteComponent = class ChipInputAutocompleteComponent {
2732
+ formFieldDirective = inject(FormField, {
2733
+ host: true,
2734
+ optional: true
2875
2735
  });
2876
- ngControl = inject(NgControl, { optional: true });
2877
- constructor() {
2878
- effect(() => {
2879
- const val = this.value();
2880
- const normalizedValue = val === void 0 ? null : val;
2881
- if (this.ngControl && this.ngControl.control) this.ngControl.control.setValue(normalizedValue, { emitEvent: false });
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];
2882
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("");
2883
2774
  }
2884
2775
  static ɵfac = i0.ɵɵngDeclareFactory({
2885
2776
  minVersion: "12.0.0",
2886
2777
  version: "22.2.2",
2887
2778
  ngImport: i0,
2888
- type: SetValueDirective,
2779
+ type: ChipInputAutocompleteComponent,
2889
2780
  deps: [],
2890
- target: i0.ɵɵFactoryTarget.Directive
2781
+ target: i0.ɵɵFactoryTarget.Component
2891
2782
  });
2892
- static ɵdir = i0.ɵɵngDeclareDirective({
2893
- minVersion: "17.1.0",
2783
+ static ɵcmp = i0.ɵɵngDeclareComponent({
2784
+ minVersion: "17.0.0",
2894
2785
  version: "22.2.2",
2895
- type: SetValueDirective,
2786
+ type: ChipInputAutocompleteComponent,
2896
2787
  isStandalone: true,
2897
- selector: "[setValue]",
2898
- inputs: { value: {
2899
- classPropertyName: "value",
2900
- publicName: "setValue",
2901
- isSignal: true,
2902
- isRequired: false,
2903
- transformFunction: null
2904
- } },
2905
- ngImport: i0
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
+ ]
2906
2965
  });
2907
2966
  };
2908
2967
  i0.ɵɵngDeclareClassMetadata({
2909
2968
  minVersion: "12.0.0",
2910
2969
  version: "22.2.2",
2911
2970
  ngImport: i0,
2912
- type: SetValueDirective,
2971
+ type: ChipInputAutocompleteComponent,
2913
2972
  decorators: [{
2914
- type: Directive,
2915
- args: [{ selector: "[setValue]" }]
2916
- }],
2917
- ctorParameters: () => [],
2918
- propDecorators: { value: [{
2919
- type: i0.Input,
2973
+ type: Component,
2920
2974
  args: [{
2921
- isSignal: true,
2922
- alias: "setValue",
2923
- required: false
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"]
2924
3027
  }]
2925
- }] }
2926
- });
2927
- const authGuard = (allowedRoles) => {
2928
- return (route, state) => {
2929
- const authService = inject(AuthService);
2930
- const router = inject(Router);
2931
- const isLogin = authService.loggedIn();
2932
- if (!isLogin) {
2933
- console.log("state.url =", state.url);
2934
- return router.createUrlTree(["/login"], { queryParams: { returnUrl: state.url } });
2935
- }
2936
- return isLogin;
2937
- };
2938
- };
2939
- const redirectGuard = (route) => {
2940
- const externalUrl = route.data?.["externalUrl"];
2941
- if (externalUrl) window.location.href = externalUrl;
2942
- return true;
2943
- };
2944
- const roleGuard = (allowedRoles) => {
2945
- return (route, state) => {
2946
- return inject(RoleService).hasAnyRole(allowedRoles);
2947
- };
2948
- };
2949
- const LOGGER_CONFIG = new InjectionToken("LOGGER_CONFIG");
2950
- var LoggerService = class LoggerService {
2951
- logPrefix = "";
2952
- isProduction;
2953
- config = inject(LOGGER_CONFIG);
2954
- constructor() {
2955
- this.isProduction = this.config.isProduction;
2956
- }
2957
- log(message, ...args) {
2958
- if (!this.isProduction) {
2959
- args.unshift(this.logPrefix + " ");
2960
- console.log(`[DEV LOG]: ${message}`, ...args);
2961
- } else console.log(`[PROD LOG]: ${message}`, ...args);
2962
- }
2963
- error(message, ...args) {
2964
- console.error(`[ERROR]: ${message}`, ...args);
2965
3028
  }
2966
- static ɵfac = i0.ɵɵngDeclareFactory({
2967
- minVersion: "12.0.0",
2968
- version: "22.2.2",
2969
- ngImport: i0,
2970
- type: LoggerService,
2971
- deps: [],
2972
- target: i0.ɵɵFactoryTarget.Service
2973
- });
2974
- static ɵprov = i0.ɵɵngDeclareService({
2975
- minVersion: "22.0.0",
2976
- version: "22.2.2",
2977
- ngImport: i0,
2978
- type: LoggerService
2979
- });
2980
- };
2981
- i0.ɵɵngDeclareClassMetadata({
2982
- minVersion: "12.0.0",
2983
- version: "22.2.2",
2984
- ngImport: i0,
2985
- type: LoggerService,
2986
- decorators: [{ type: Service }],
2987
- ctorParameters: () => []
2988
- });
2989
- function provideLogger(config) {
2990
- return makeEnvironmentProviders([{
2991
- provide: LOGGER_CONFIG,
2992
- useValue: config
2993
- }, LoggerService]);
2994
- }
2995
- const secUserViewSchema = z.object({
2996
- id: z.number().default(0),
2997
- idHuman: z.number().default(0),
2998
- loginAD: z.string().default("").nullable(),
2999
- dept: z.number().default(0),
3000
- tabnum: z.number().default(0),
3001
- lastname: z.string().default(""),
3002
- firstname: z.string().default(""),
3003
- middlename: z.string().default(""),
3004
- fio: z.string().default(""),
3005
- dateHuman: z.coerce.date().optional(),
3006
- profession: z.string().default("")
3007
- });
3008
- const secUserSchema = z.object({
3009
- id: z.number().default(0),
3010
- login: z.string().default(""),
3011
- fio: z.string().default(""),
3012
- dept: z.number().default(0),
3013
- tabnum: z.number().default(0),
3014
- userView: secUserViewSchema.optional().nullable()
3015
3029
  });
3016
- var SafePipe = class SafePipe {
3017
- sanitizer = inject(DomSanitizer);
3018
- transform(url, type = "url") {
3019
- if (!url) return "";
3020
- if (typeof url !== "string") return url;
3021
- switch (type) {
3022
- case "html": return this.sanitizer.bypassSecurityTrustHtml(url);
3023
- case "style": return this.sanitizer.bypassSecurityTrustStyle(url);
3024
- case "script": return this.sanitizer.bypassSecurityTrustScript(url);
3025
- case "url": return this.sanitizer.bypassSecurityTrustUrl(url);
3026
- case "resourceUrl": return this.sanitizer.bypassSecurityTrustResourceUrl(url);
3027
- 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);
3028
3038
  }
3039
+ const timestamp = typeof value === "number" ? value : Date.parse(value);
3040
+ return isNaN(timestamp) ? null : new Date(timestamp);
3029
3041
  }
3030
- static ɵfac = i0.ɵɵngDeclareFactory({
3031
- minVersion: "12.0.0",
3032
- version: "22.2.2",
3033
- ngImport: i0,
3034
- type: SafePipe,
3035
- deps: [],
3036
- target: i0.ɵɵFactoryTarget.Pipe
3037
- });
3038
- static ɵpipe = i0.ɵɵngDeclarePipe({
3039
- minVersion: "14.0.0",
3040
- version: "22.2.2",
3041
- ngImport: i0,
3042
- type: SafePipe,
3043
- isStandalone: true,
3044
- name: "safe"
3045
- });
3046
- };
3047
- i0.ɵɵngDeclareClassMetadata({
3048
- minVersion: "12.0.0",
3049
- version: "22.2.2",
3050
- ngImport: i0,
3051
- type: SafePipe,
3052
- decorators: [{
3053
- type: Pipe,
3054
- args: [{ name: "safe" }]
3055
- }]
3056
- });
3057
- var TimePipe = class TimePipe {
3058
- transform(value) {
3059
- const hour = Math.abs(value) >= 60 ? Math.floor(Math.abs(value) / 60).toString().padStart(2, "0") : "00";
3060
- const minute = Math.abs(value % 60).toString().padStart(2, "0");
3061
- const time = hour + ":" + minute;
3062
- 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);
3063
3045
  }
3064
3046
  static ɵfac = i0.ɵɵngDeclareFactory({
3065
3047
  minVersion: "12.0.0",
3066
3048
  version: "22.2.2",
3067
3049
  ngImport: i0,
3068
- type: TimePipe,
3069
- deps: [],
3070
- target: i0.ɵɵFactoryTarget.Pipe
3050
+ type: CustomDateAdapter,
3051
+ deps: null,
3052
+ target: i0.ɵɵFactoryTarget.Injectable
3071
3053
  });
3072
- static ɵpipe = i0.ɵɵngDeclarePipe({
3073
- minVersion: "14.0.0",
3054
+ static ɵprov = i0.ɵɵngDeclareInjectable({
3055
+ minVersion: "12.0.0",
3074
3056
  version: "22.2.2",
3075
3057
  ngImport: i0,
3076
- type: TimePipe,
3077
- isStandalone: true,
3078
- name: "time"
3058
+ type: CustomDateAdapter
3079
3059
  });
3080
3060
  };
3081
3061
  i0.ɵɵngDeclareClassMetadata({
3082
3062
  minVersion: "12.0.0",
3083
3063
  version: "22.2.2",
3084
3064
  ngImport: i0,
3085
- type: TimePipe,
3086
- decorators: [{
3087
- type: Pipe,
3088
- args: [{ name: "time" }]
3089
- }]
3065
+ type: CustomDateAdapter,
3066
+ decorators: [{ type: Injectable }]
3090
3067
  });
3091
- var TruncatePipe = class TruncatePipe {
3092
- transform(value, args) {
3093
- const limit = args.length > 0 ? parseInt(args[0], 10) : 20;
3094
- const trail = args.length > 1 ? args[1] : "...";
3095
- return value.length > limit ? value.substring(0, limit) + trail : value;
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
+ }
3096
3085
  }
3097
- static ɵfac = i0.ɵɵngDeclareFactory({
3098
- minVersion: "12.0.0",
3099
- version: "22.2.2",
3100
- ngImport: i0,
3101
- type: TruncatePipe,
3102
- deps: [],
3103
- target: i0.ɵɵFactoryTarget.Pipe
3104
- });
3105
- static ɵpipe = i0.ɵɵngDeclarePipe({
3106
- minVersion: "14.0.0",
3107
- version: "22.2.2",
3108
- ngImport: i0,
3109
- type: TruncatePipe,
3110
- isStandalone: true,
3111
- name: "truncate"
3112
- });
3113
3086
  };
3114
- i0.ɵɵngDeclareClassMetadata({
3115
- minVersion: "12.0.0",
3116
- version: "22.2.2",
3117
- ngImport: i0,
3118
- type: TruncatePipe,
3119
- decorators: [{
3120
- type: Pipe,
3121
- args: [{ name: "truncate" }]
3122
- }]
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()
3123
3094
  });
3124
- var ChipInputAutocompleteComponent = class ChipInputAutocompleteComponent {
3125
- formFieldDirective = inject(FormField, {
3126
- host: true,
3127
- optional: true
3128
- });
3129
- items = input([], ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
3130
- title = input("", ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
3131
- value = model([], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
3132
- filterQuery = model("", ...ngDevMode ? [{ debugName: "filterQuery" }] : /* istanbul ignore next */ []);
3133
- separatorKeysCodes = [ENTER, COMMA];
3134
- selectedItems = linkedSignal({
3135
- ...ngDevMode ? { debugName: "selectedItems" } : /* istanbul ignore next */ {},
3136
- source: () => this.value(),
3137
- computation: (inputKeys) => this.items().filter((item) => inputKeys.includes(item.value))
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);
3138
3126
  });
3139
- filteredItems = computed(() => {
3140
- const allItems = this.items();
3141
- const search = this.filterQuery().toLowerCase().trim();
3142
- if (!search) return allItems;
3143
- return allItems.filter((item) => item.viewValue.toLowerCase().includes(search));
3144
- }, ...ngDevMode ? [{ debugName: "filteredItems" }] : /* istanbul ignore next */ []);
3145
- isDisabled = computed(() => {
3146
- return this.formFieldDirective?.state?.().disabled() ?? false;
3147
- }, ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
3148
- isInvalid = computed(() => {
3149
- return this.formFieldDirective?.state()?.invalid() ?? false;
3150
- }, ...ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []);
3151
- remove(value) {
3152
- if (this.isDisabled()) return;
3153
- this.value.update((keys) => keys.filter((key) => key !== value));
3154
- }
3155
- selected(event) {
3156
- const selectedValue = event.option.value;
3157
- this.value.update((keys) => {
3158
- 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
+ }
3159
3145
  });
3160
- this.filterQuery.set("");
3161
- }
3162
- onCloseClick($event) {
3163
- $event.stopPropagation();
3164
- if (this.isDisabled()) return;
3165
- this.value.set([]);
3166
- this.filterQuery.set("");
3167
3146
  }
3168
3147
  static ɵfac = i0.ɵɵngDeclareFactory({
3169
3148
  minVersion: "12.0.0",
3170
3149
  version: "22.2.2",
3171
3150
  ngImport: i0,
3172
- type: ChipInputAutocompleteComponent,
3151
+ type: DateRangeInputComponent,
3173
3152
  deps: [],
3174
3153
  target: i0.ɵɵFactoryTarget.Component
3175
3154
  });
3176
3155
  static ɵcmp = i0.ɵɵngDeclareComponent({
3177
3156
  minVersion: "17.0.0",
3178
3157
  version: "22.2.2",
3179
- type: ChipInputAutocompleteComponent,
3158
+ type: DateRangeInputComponent,
3180
3159
  isStandalone: true,
3181
- selector: "ngx-uik-chip-input-autocomplete",
3160
+ selector: "ngx-uik-date-range-input",
3182
3161
  inputs: {
3183
- items: {
3184
- classPropertyName: "items",
3185
- publicName: "items",
3162
+ label: {
3163
+ classPropertyName: "label",
3164
+ publicName: "label",
3186
3165
  isSignal: true,
3187
3166
  isRequired: false,
3188
3167
  transformFunction: null
3189
3168
  },
3190
- title: {
3191
- classPropertyName: "title",
3192
- publicName: "title",
3169
+ dateRange: {
3170
+ classPropertyName: "dateRange",
3171
+ publicName: "dateRange",
3193
3172
  isSignal: true,
3194
3173
  isRequired: false,
3195
3174
  transformFunction: null
3196
3175
  },
3197
- value: {
3198
- classPropertyName: "value",
3199
- publicName: "value",
3176
+ minDate: {
3177
+ classPropertyName: "minDate",
3178
+ publicName: "minDate",
3200
3179
  isSignal: true,
3201
3180
  isRequired: false,
3202
3181
  transformFunction: null
3203
3182
  },
3204
- filterQuery: {
3205
- classPropertyName: "filterQuery",
3206
- publicName: "filterQuery",
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",
3207
3193
  isSignal: true,
3208
3194
  isRequired: false,
3209
3195
  transformFunction: null
3210
3196
  }
3211
3197
  },
3212
- outputs: {
3213
- value: "valueChange",
3214
- filterQuery: "filterQueryChange"
3215
- },
3216
- ngImport: i0,
3217
- 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",
3218
- styles: [".chip-list{width:100%}\n"],
3219
- dependencies: [
3220
- {
3221
- kind: "component",
3222
- type: MatFormField,
3223
- selector: "mat-form-field",
3224
- inputs: [
3225
- "hideRequiredMarker",
3226
- "color",
3227
- "floatLabel",
3228
- "appearance",
3229
- "subscriptSizing",
3230
- "hintLabel"
3231
- ],
3232
- exportAs: ["matFormField"]
3233
- },
3234
- {
3235
- kind: "ngmodule",
3236
- type: MatAutocompleteModule
3237
- },
3238
- {
3239
- kind: "component",
3240
- type: i1$1.MatAutocomplete,
3241
- selector: "mat-autocomplete",
3242
- inputs: [
3243
- "aria-label",
3244
- "aria-labelledby",
3245
- "displayWith",
3246
- "autoActiveFirstOption",
3247
- "autoSelectActiveOption",
3248
- "requireSelection",
3249
- "panelWidth",
3250
- "disableRipple",
3251
- "class",
3252
- "hideSingleSelectionIndicator"
3253
- ],
3254
- outputs: [
3255
- "optionSelected",
3256
- "opened",
3257
- "closed",
3258
- "optionActivated"
3259
- ],
3260
- exportAs: ["matAutocomplete"]
3261
- },
3262
- {
3263
- kind: "component",
3264
- type: i1$1.MatOption,
3265
- selector: "mat-option",
3266
- inputs: [
3267
- "value",
3268
- "id",
3269
- "disabled"
3270
- ],
3271
- outputs: ["onSelectionChange"],
3272
- exportAs: ["matOption"]
3273
- },
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: [
3274
3210
  {
3275
3211
  kind: "directive",
3276
- type: i1$1.MatAutocompleteTrigger,
3277
- selector: "input[matAutocomplete], textarea[matAutocomplete]",
3278
- inputs: [
3279
- "matAutocomplete",
3280
- "matAutocompletePosition",
3281
- "matAutocompleteConnectedTo",
3282
- "autocomplete",
3283
- "matAutocompleteDisabled"
3284
- ],
3285
- exportAs: ["matAutocompleteTrigger"]
3212
+ type: FormField,
3213
+ selector: "[formField]",
3214
+ inputs: ["formField"],
3215
+ exportAs: ["formField"]
3286
3216
  },
3287
3217
  {
3288
3218
  kind: "component",
3289
- type: MatIcon,
3290
- selector: "mat-icon",
3219
+ type: MatFormField,
3220
+ selector: "mat-form-field",
3291
3221
  inputs: [
3222
+ "hideRequiredMarker",
3292
3223
  "color",
3293
- "inline",
3294
- "svgIcon",
3295
- "fontSet",
3296
- "fontIcon"
3224
+ "floatLabel",
3225
+ "appearance",
3226
+ "subscriptSizing",
3227
+ "hintLabel"
3297
3228
  ],
3298
- exportAs: ["matIcon"]
3229
+ exportAs: ["matFormField"]
3299
3230
  },
3300
3231
  {
3301
- kind: "ngmodule",
3302
- type: MatChipsModule
3232
+ kind: "directive",
3233
+ type: MatLabel,
3234
+ selector: "mat-label"
3303
3235
  },
3304
3236
  {
3305
3237
  kind: "component",
3306
- type: i2$2.MatChipGrid,
3307
- selector: "mat-chip-grid",
3238
+ type: MatDateRangeInput,
3239
+ selector: "mat-date-range-input",
3308
3240
  inputs: [
3309
- "disabled",
3310
- "placeholder",
3241
+ "rangePicker",
3311
3242
  "required",
3312
- "value",
3313
- "errorStateMatcher"
3243
+ "dateFilter",
3244
+ "min",
3245
+ "max",
3246
+ "disabled",
3247
+ "separator",
3248
+ "comparisonStart",
3249
+ "comparisonEnd"
3314
3250
  ],
3315
- outputs: ["change", "valueChange"]
3251
+ exportAs: ["matDateRangeInput"]
3316
3252
  },
3317
3253
  {
3318
3254
  kind: "directive",
3319
- type: i2$2.MatChipInput,
3320
- selector: "input[matChipInputFor]",
3321
- inputs: [
3322
- "matChipInputFor",
3323
- "matChipInputAddOnBlur",
3324
- "matChipInputSeparatorKeyCodes",
3325
- "placeholder",
3326
- "id",
3327
- "disabled",
3328
- "readonly",
3329
- "matChipInputDisabledInteractive"
3330
- ],
3331
- outputs: ["matChipInputTokenEnd"],
3332
- exportAs: ["matChipInput", "matChipInputFor"]
3255
+ type: MatStartDate,
3256
+ selector: "input[matStartDate]",
3257
+ outputs: ["dateChange", "dateInput"]
3333
3258
  },
3334
3259
  {
3335
3260
  kind: "directive",
3336
- type: i2$2.MatChipRemove,
3337
- selector: "[matChipRemove]"
3261
+ type: MatEndDate,
3262
+ selector: "input[matEndDate]",
3263
+ outputs: ["dateChange", "dateInput"]
3338
3264
  },
3339
3265
  {
3340
3266
  kind: "component",
3341
- type: i2$2.MatChipRow,
3342
- selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]",
3343
- inputs: ["editable"],
3344
- outputs: ["edited"]
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"]
3345
3277
  },
3346
3278
  {
3347
3279
  kind: "directive",
3348
- type: MatLabel,
3349
- selector: "mat-label"
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"]
3350
3289
  },
3351
3290
  {
3352
3291
  kind: "directive",
@@ -3361,237 +3300,179 @@ i0.ɵɵngDeclareClassMetadata({
3361
3300
  minVersion: "12.0.0",
3362
3301
  version: "22.2.2",
3363
3302
  ngImport: i0,
3364
- type: ChipInputAutocompleteComponent,
3303
+ type: DateRangeInputComponent,
3365
3304
  decorators: [{
3366
3305
  type: Component,
3367
3306
  args: [{
3368
- selector: "ngx-uik-chip-input-autocomplete",
3307
+ selector: "ngx-uik-date-range-input",
3369
3308
  imports: [
3309
+ FormField,
3370
3310
  MatFormField,
3371
- MatAutocompleteModule,
3372
- MatIcon,
3373
- MatOption,
3374
- MatChipsModule,
3375
3311
  MatLabel,
3312
+ MatDateRangeInput,
3313
+ MatStartDate,
3314
+ MatEndDate,
3315
+ MatDatepickerToggle,
3316
+ MatSuffix,
3317
+ MatDateRangePicker,
3376
3318
  MatError
3377
3319
  ],
3378
- 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",
3379
- styles: [".chip-list{width:100%}\n"]
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"]
3380
3329
  }]
3381
3330
  }],
3331
+ ctorParameters: () => [],
3382
3332
  propDecorators: {
3383
- items: [{
3333
+ label: [{
3384
3334
  type: i0.Input,
3385
3335
  args: [{
3386
3336
  isSignal: true,
3387
- alias: "items",
3337
+ alias: "label",
3388
3338
  required: false
3389
3339
  }]
3390
3340
  }],
3391
- title: [{
3341
+ dateRange: [{
3392
3342
  type: i0.Input,
3393
3343
  args: [{
3394
3344
  isSignal: true,
3395
- alias: "title",
3345
+ alias: "dateRange",
3396
3346
  required: false
3397
3347
  }]
3398
3348
  }],
3399
- value: [{
3349
+ minDate: [{
3400
3350
  type: i0.Input,
3401
3351
  args: [{
3402
3352
  isSignal: true,
3403
- alias: "value",
3353
+ alias: "minDate",
3404
3354
  required: false
3405
3355
  }]
3406
- }, {
3407
- type: i0.Output,
3408
- args: ["valueChange"]
3409
3356
  }],
3410
- filterQuery: [{
3357
+ clearInput: [{
3411
3358
  type: i0.Input,
3412
3359
  args: [{
3413
3360
  isSignal: true,
3414
- alias: "filterQuery",
3361
+ alias: "clearInput",
3415
3362
  required: false
3416
3363
  }]
3417
- }, {
3364
+ }],
3365
+ required: [{
3366
+ type: i0.Input,
3367
+ args: [{
3368
+ isSignal: true,
3369
+ alias: "required",
3370
+ required: false
3371
+ }]
3372
+ }],
3373
+ dateRangeChange: [{
3418
3374
  type: i0.Output,
3419
- args: ["filterQueryChange"]
3375
+ args: ["dateRangeChange"]
3420
3376
  }]
3421
3377
  }
3422
3378
  });
3423
- var CustomDateAdapter = class CustomDateAdapter extends NativeDateAdapter {
3424
- parse(value) {
3425
- if (typeof value === "string" && value.indexOf(".") > -1) {
3426
- const str = value.split(".");
3427
- const year = Number(str[2]);
3428
- const month = Number(str[1]) - 1;
3429
- const day = Number(str[0]);
3430
- return new Date(year, month, day);
3431
- }
3432
- const timestamp = typeof value === "number" ? value : Date.parse(value);
3433
- return isNaN(timestamp) ? null : new Date(timestamp);
3434
- }
3435
- format(date, displayFormat) {
3436
- if (displayFormat === "input") return `${String(date.getDate()).padStart(2, "0")}.${String(date.getMonth() + 1).padStart(2, "0")}.${date.getFullYear()}`;
3437
- return super.format(date, displayFormat);
3438
- }
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 {
3439
3387
  static ɵfac = i0.ɵɵngDeclareFactory({
3440
3388
  minVersion: "12.0.0",
3441
3389
  version: "22.2.2",
3442
3390
  ngImport: i0,
3443
- type: CustomDateAdapter,
3444
- deps: null,
3445
- target: i0.ɵɵFactoryTarget.Injectable
3391
+ type: EmptyComponent,
3392
+ deps: [],
3393
+ target: i0.ɵɵFactoryTarget.Component
3446
3394
  });
3447
- static ɵprov = i0.ɵɵngDeclareInjectable({
3448
- minVersion: "12.0.0",
3395
+ static ɵcmp = i0.ɵɵngDeclareComponent({
3396
+ minVersion: "14.0.0",
3449
3397
  version: "22.2.2",
3398
+ type: EmptyComponent,
3399
+ isStandalone: true,
3400
+ selector: "ngx-uik-empty-route-guard-holder",
3450
3401
  ngImport: i0,
3451
- type: CustomDateAdapter
3402
+ template: "",
3403
+ isInline: true
3452
3404
  });
3453
3405
  };
3454
3406
  i0.ɵɵngDeclareClassMetadata({
3455
3407
  minVersion: "12.0.0",
3456
3408
  version: "22.2.2",
3457
3409
  ngImport: i0,
3458
- type: CustomDateAdapter,
3459
- decorators: [{ type: Injectable }]
3410
+ type: EmptyComponent,
3411
+ decorators: [{
3412
+ type: Component,
3413
+ args: [{
3414
+ selector: "ngx-uik-empty-route-guard-holder",
3415
+ template: ""
3416
+ }]
3417
+ }]
3460
3418
  });
3461
- const MY_NATIVE_FORMATS = {
3462
- parse: { dateInput: "input" },
3463
- display: {
3464
- dateInput: "input",
3465
- monthYearLabel: {
3466
- year: "numeric",
3467
- month: "short"
3468
- },
3469
- dateA11yLabel: {
3470
- year: "numeric",
3471
- month: "long",
3472
- day: "numeric"
3473
- },
3474
- monthYearA11yLabel: {
3475
- year: "numeric",
3476
- month: "long"
3477
- }
3478
- }
3479
- };
3480
- const toIsoString = (date) => {
3481
- if (!date) return "";
3482
- return date.toISOString().split("T")[0];
3483
- };
3484
- const dateRangeFormSchema = (isRequired) => z$1.object({
3485
- begin: z$1.instanceof(Date).nullable().refine((val) => !isRequired || val !== null, { message: "Укажите период" }),
3486
- 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: "Пожалуйста, заполните это поле" })
3487
3422
  });
3488
- const dateRangeSchema = (isRequired) => dateRangeFormSchema(isRequired).transform((data) => ({
3489
- begin: toIsoString(data.begin),
3490
- end: toIsoString(data.end)
3491
- }));
3492
- var DateRangeInputComponent = class DateRangeInputComponent {
3493
- DEFAULT_MIN_DATE = new Date(2020, 0, 1);
3494
- label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
3495
- dateRange = input({
3496
- begin: "",
3497
- end: ""
3498
- }, ...ngDevMode ? [{ debugName: "dateRange" }] : /* istanbul ignore next */ []);
3499
- minDate = input(this.DEFAULT_MIN_DATE, ...ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []);
3500
- clearInput = input(null, ...ngDevMode ? [{ debugName: "clearInput" }] : /* istanbul ignore next */ []);
3501
- required = input(false, ...ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []);
3502
- 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 */ []);
3503
3427
  formModel = signal({
3504
- begin: null,
3505
- end: null
3428
+ username: "",
3429
+ password: ""
3506
3430
  }, ...ngDevMode ? [{ debugName: "formModel" }] : /* istanbul ignore next */ []);
3507
3431
  form = form(this.formModel, (schemaPath) => {
3508
- validateStandardSchema(schemaPath, dateRangeFormSchema(this.required()));
3509
- debounce(schemaPath.begin, 500);
3510
- debounce(schemaPath.end, 500);
3511
- });
3512
- constructor() {
3513
- effect(() => {
3514
- this.clearInput();
3515
- untracked(() => this.form().reset());
3516
- });
3517
- effect(() => {
3518
- const value = this.dateRange();
3519
- untracked(() => {
3520
- this.form.begin().value.set(value.begin ? new Date(value.begin) : null);
3521
- this.form.end().value.set(value.end ? new Date(value.end) : null);
3522
- });
3523
- });
3524
- effect(() => {
3525
- const currentValues = this.form().value();
3526
- if (this.form().valid()) {
3527
- const formattedRange = dateRangeSchema(this.required()).parse(currentValues);
3528
- this.dateRangeChange.emit(formattedRange);
3529
- }
3530
- });
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);
3531
3443
  }
3532
3444
  static ɵfac = i0.ɵɵngDeclareFactory({
3533
3445
  minVersion: "12.0.0",
3534
3446
  version: "22.2.2",
3535
3447
  ngImport: i0,
3536
- type: DateRangeInputComponent,
3448
+ type: LoginFormComponent,
3537
3449
  deps: [],
3538
3450
  target: i0.ɵɵFactoryTarget.Component
3539
3451
  });
3540
3452
  static ɵcmp = i0.ɵɵngDeclareComponent({
3541
3453
  minVersion: "17.0.0",
3542
3454
  version: "22.2.2",
3543
- type: DateRangeInputComponent,
3455
+ type: LoginFormComponent,
3544
3456
  isStandalone: true,
3545
- selector: "ngx-uik-date-range-input",
3546
- inputs: {
3547
- label: {
3548
- classPropertyName: "label",
3549
- publicName: "label",
3550
- isSignal: true,
3551
- isRequired: false,
3552
- transformFunction: null
3553
- },
3554
- dateRange: {
3555
- classPropertyName: "dateRange",
3556
- publicName: "dateRange",
3557
- isSignal: true,
3558
- isRequired: false,
3559
- transformFunction: null
3560
- },
3561
- minDate: {
3562
- classPropertyName: "minDate",
3563
- publicName: "minDate",
3564
- isSignal: true,
3565
- isRequired: false,
3566
- transformFunction: null
3567
- },
3568
- clearInput: {
3569
- classPropertyName: "clearInput",
3570
- publicName: "clearInput",
3571
- isSignal: true,
3572
- isRequired: false,
3573
- transformFunction: null
3574
- },
3575
- required: {
3576
- classPropertyName: "required",
3577
- publicName: "required",
3578
- isSignal: true,
3579
- isRequired: false,
3580
- transformFunction: null
3581
- }
3582
- },
3583
- outputs: { dateRangeChange: "dateRangeChange" },
3584
- providers: [{
3585
- provide: DateAdapter,
3586
- useClass: CustomDateAdapter
3587
- }, {
3588
- provide: MAT_DATE_FORMATS,
3589
- useValue: MY_NATIVE_FORMATS
3590
- }],
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" },
3591
3466
  ngImport: i0,
3592
- 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",
3593
- styles: ["mat-form-field{margin-right:16px}\n"],
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"],
3594
3469
  dependencies: [
3470
+ {
3471
+ kind: "directive",
3472
+ type: FormRoot,
3473
+ selector: "form[formRoot]",
3474
+ inputs: ["formRoot"]
3475
+ },
3595
3476
  {
3596
3477
  kind: "directive",
3597
3478
  type: FormField,
@@ -3599,6 +3480,28 @@ var DateRangeInputComponent = class DateRangeInputComponent {
3599
3480
  inputs: ["formField"],
3600
3481
  exportAs: ["formField"]
3601
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
+ },
3602
3505
  {
3603
3506
  kind: "component",
3604
3507
  type: MatFormField,
@@ -3618,65 +3521,172 @@ var DateRangeInputComponent = class DateRangeInputComponent {
3618
3521
  type: MatLabel,
3619
3522
  selector: "mat-label"
3620
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: [
3621
3669
  {
3622
3670
  kind: "component",
3623
- type: MatDateRangeInput,
3624
- selector: "mat-date-range-input",
3625
- inputs: [
3626
- "rangePicker",
3627
- "required",
3628
- "dateFilter",
3629
- "min",
3630
- "max",
3631
- "disabled",
3632
- "separator",
3633
- "comparisonStart",
3634
- "comparisonEnd"
3635
- ],
3636
- exportAs: ["matDateRangeInput"]
3637
- },
3638
- {
3639
- kind: "directive",
3640
- type: MatStartDate,
3641
- selector: "input[matStartDate]",
3642
- outputs: ["dateChange", "dateInput"]
3643
- },
3644
- {
3645
- kind: "directive",
3646
- type: MatEndDate,
3647
- selector: "input[matEndDate]",
3648
- outputs: ["dateChange", "dateInput"]
3671
+ type: MatCard,
3672
+ selector: "mat-card",
3673
+ inputs: ["appearance"],
3674
+ exportAs: ["matCard"]
3649
3675
  },
3650
3676
  {
3651
3677
  kind: "component",
3652
- type: MatDatepickerToggle,
3653
- selector: "mat-datepicker-toggle",
3654
- inputs: [
3655
- "for",
3656
- "tabIndex",
3657
- "aria-label",
3658
- "disabled",
3659
- "disableRipple"
3660
- ],
3661
- exportAs: ["matDatepickerToggle"]
3678
+ type: MatCardHeader,
3679
+ selector: "mat-card-header"
3662
3680
  },
3663
3681
  {
3664
3682
  kind: "directive",
3665
- type: MatSuffix,
3666
- selector: "[matSuffix], [matIconSuffix], [matTextSuffix]",
3667
- inputs: ["matTextSuffix"]
3668
- },
3669
- {
3670
- kind: "component",
3671
- type: MatDateRangePicker,
3672
- selector: "mat-date-range-picker",
3673
- exportAs: ["matDateRangePicker"]
3683
+ type: MatCardTitle,
3684
+ selector: "mat-card-title, [mat-card-title], [matCardTitle]"
3674
3685
  },
3675
3686
  {
3676
3687
  kind: "directive",
3677
- type: MatError,
3678
- selector: "mat-error, [matError]",
3679
- inputs: ["id"]
3688
+ type: MatCardContent,
3689
+ selector: "mat-card-content"
3680
3690
  }
3681
3691
  ]
3682
3692
  });
@@ -3685,121 +3695,146 @@ i0.ɵɵngDeclareClassMetadata({
3685
3695
  minVersion: "12.0.0",
3686
3696
  version: "22.2.2",
3687
3697
  ngImport: i0,
3688
- type: DateRangeInputComponent,
3698
+ type: PermitFormComponent,
3689
3699
  decorators: [{
3690
3700
  type: Component,
3691
3701
  args: [{
3692
- selector: "ngx-uik-date-range-input",
3702
+ selector: "ngx-uik-permit-form",
3693
3703
  imports: [
3694
- FormField,
3695
- MatFormField,
3696
- MatLabel,
3697
- MatDateRangeInput,
3698
- MatStartDate,
3699
- MatEndDate,
3700
- MatDatepickerToggle,
3701
- MatSuffix,
3702
- MatDateRangePicker,
3703
- MatError
3704
+ MatCard,
3705
+ MatCardHeader,
3706
+ MatCardTitle,
3707
+ MatCardContent
3704
3708
  ],
3705
- providers: [{
3706
- provide: DateAdapter,
3707
- useClass: CustomDateAdapter
3708
- }, {
3709
- provide: MAT_DATE_FORMATS,
3710
- useValue: MY_NATIVE_FORMATS
3711
- }],
3712
- 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",
3713
- 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"]
3714
3711
  }]
3715
3712
  }],
3716
3713
  ctorParameters: () => [],
3717
3714
  propDecorators: {
3718
- label: [{
3719
- type: i0.Input,
3720
- args: [{
3721
- isSignal: true,
3722
- alias: "label",
3723
- required: false
3724
- }]
3725
- }],
3726
- dateRange: [{
3727
- type: i0.Input,
3728
- args: [{
3729
- isSignal: true,
3730
- alias: "dateRange",
3731
- required: false
3732
- }]
3733
- }],
3734
- minDate: [{
3735
- type: i0.Input,
3736
- args: [{
3737
- isSignal: true,
3738
- alias: "minDate",
3739
- required: false
3740
- }]
3741
- }],
3742
- clearInput: [{
3743
- type: i0.Input,
3744
- args: [{
3745
- isSignal: true,
3746
- alias: "clearInput",
3747
- required: false
3748
- }]
3749
- }],
3750
- required: [{
3751
- type: i0.Input,
3752
- args: [{
3753
- isSignal: true,
3754
- alias: "required",
3755
- required: false
3756
- }]
3715
+ hidy: [{
3716
+ type: i0.ViewChild,
3717
+ args: ["hidy", { isSignal: true }]
3757
3718
  }],
3758
- dateRangeChange: [{
3719
+ submitted: [{
3759
3720
  type: i0.Output,
3760
- args: ["dateRangeChange"]
3721
+ args: ["submitted"]
3722
+ }],
3723
+ focusInput: [{
3724
+ type: HostListener,
3725
+ args: ["document:mouseup"]
3761
3726
  }]
3762
3727
  }
3763
3728
  });
3764
- var DialogAction;
3765
- (function(DialogAction) {
3766
- DialogAction["Add"] = "Добавить";
3767
- DialogAction["Edit"] = "Изменить";
3768
- DialogAction["Delete"] = "Удалить";
3769
- DialogAction["None"] = "";
3770
- })(DialogAction || (DialogAction = {}));
3771
- var EmptyComponent = class EmptyComponent {
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
+ }
3772
3778
  static ɵfac = i0.ɵɵngDeclareFactory({
3773
3779
  minVersion: "12.0.0",
3774
3780
  version: "22.2.2",
3775
3781
  ngImport: i0,
3776
- type: EmptyComponent,
3782
+ type: LoginPageComponent,
3777
3783
  deps: [],
3778
3784
  target: i0.ɵɵFactoryTarget.Component
3779
3785
  });
3780
3786
  static ɵcmp = i0.ɵɵngDeclareComponent({
3781
- minVersion: "14.0.0",
3787
+ minVersion: "17.0.0",
3782
3788
  version: "22.2.2",
3783
- type: EmptyComponent,
3789
+ type: LoginPageComponent,
3784
3790
  isStandalone: true,
3785
- selector: "ngx-uik-empty-route-guard-holder",
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
+ } },
3786
3799
  ngImport: i0,
3787
- template: "",
3788
- isInline: true
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
+ }]
3789
3814
  });
3790
3815
  };
3791
3816
  i0.ɵɵngDeclareClassMetadata({
3792
3817
  minVersion: "12.0.0",
3793
3818
  version: "22.2.2",
3794
3819
  ngImport: i0,
3795
- type: EmptyComponent,
3820
+ type: LoginPageComponent,
3796
3821
  decorators: [{
3797
3822
  type: Component,
3798
3823
  args: [{
3799
- selector: "ngx-uik-empty-route-guard-holder",
3800
- template: ""
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"
3801
3827
  }]
3802
- }]
3828
+ }],
3829
+ ctorParameters: () => [],
3830
+ propDecorators: { idCas: [{
3831
+ type: i0.Input,
3832
+ args: [{
3833
+ isSignal: true,
3834
+ alias: "idCas",
3835
+ required: false
3836
+ }]
3837
+ }] }
3803
3838
  });
3804
3839
  var NavBarComponent = class NavBarComponent extends BaseNavBarMenuClass {
3805
3840
  visibleOnLogout = input(false, ...ngDevMode ? [{ debugName: "visibleOnLogout" }] : /* istanbul ignore next */ []);