@kuzntsv/uikit 1.0.17 → 1.0.19
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,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, output, effect, Component, viewChild, HostListener, inject, Injectable, computed, Directive, signal, Pipe, ChangeDetectorRef, ChangeDetectionStrategy, linkedSignal, NgZone, ElementRef, InjectionToken, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
import { Router, RouterLink } from '@angular/router';
|
|
4
|
-
import { startWith, Subscription, Subject, tap, switchMap, map as map$1, forkJoin, take, filter, ReplaySubject, finalize } from 'rxjs';
|
|
5
|
-
import { RoleService, NotificationService, HIDE_ROLE_MARKER, UIKIT_NOTIFICATION_TOKEN, AuthService } from '@kuzntsv/uikit';
|
|
4
|
+
import { startWith, Subscription, Subject, tap, switchMap, map as map$1, forkJoin, take, filter, of, ReplaySubject, finalize } from 'rxjs';
|
|
5
|
+
import { RoleService, NotificationService, HIDE_ROLE_MARKER, UIKIT_NOTIFICATION_TOKEN, API_NAME, AuthService } from '@kuzntsv/uikit';
|
|
6
6
|
import * as i1 from '@angular/forms';
|
|
7
7
|
import { FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule, NgControl } from '@angular/forms';
|
|
8
8
|
import { MatButton, MatIconButton, MatAnchor } from '@angular/material/button';
|
|
@@ -10,7 +10,7 @@ import { MatCard, MatCardHeader, MatCardTitle, MatCardContent } from '@angular/m
|
|
|
10
10
|
import { MatFormField, MatLabel, MatError, MatSuffix, MatHint } from '@angular/material/form-field';
|
|
11
11
|
import { MatIcon } from '@angular/material/icon';
|
|
12
12
|
import { MatInput } from '@angular/material/input';
|
|
13
|
-
import { HttpClient, HttpParams } from '@angular/common/http';
|
|
13
|
+
import { HttpClient, HttpParams, HttpContext } from '@angular/common/http';
|
|
14
14
|
import { Overlay } from '@angular/cdk/overlay';
|
|
15
15
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
16
16
|
import { ENTER, COMMA } from '@angular/cdk/keycodes';
|
|
@@ -19,7 +19,7 @@ import * as i2 from '@angular/material/autocomplete';
|
|
|
19
19
|
import { MatAutocompleteModule, MatOption } from '@angular/material/autocomplete';
|
|
20
20
|
import * as i3 from '@angular/material/chips';
|
|
21
21
|
import { MatChipsModule } from '@angular/material/chips';
|
|
22
|
-
import { map, debounceTime, distinctUntilChanged, startWith as startWith$1 } from 'rxjs/operators';
|
|
22
|
+
import { map, debounceTime, distinctUntilChanged, startWith as startWith$1, catchError } from 'rxjs/operators';
|
|
23
23
|
import { MAT_DATE_LOCALE, MAT_DATE_FORMATS, MatOption as MatOption$1, MatOptgroup } from '@angular/material/core';
|
|
24
24
|
import { MatDateRangeInput, MatStartDate, MatEndDate, MatDatepickerToggle, MatDateRangePicker } from '@angular/material/datepicker';
|
|
25
25
|
import 'moment/locale/ru';
|
|
@@ -1607,6 +1607,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1607
1607
|
}]
|
|
1608
1608
|
}] });
|
|
1609
1609
|
|
|
1610
|
+
class SecureImageService {
|
|
1611
|
+
http = inject(HttpClient);
|
|
1612
|
+
sanitizer = inject(DomSanitizer);
|
|
1613
|
+
/**
|
|
1614
|
+
* Загружает защищенное изображение и возвращает SafeUrl
|
|
1615
|
+
*/
|
|
1616
|
+
getSecureUrl(relativeUrl, apiKey = 'default') {
|
|
1617
|
+
if (!relativeUrl) {
|
|
1618
|
+
return of('');
|
|
1619
|
+
}
|
|
1620
|
+
const context = new HttpContext().set(API_NAME, apiKey);
|
|
1621
|
+
return this.http.get(relativeUrl, { responseType: 'blob', context }).pipe(map((blob) => {
|
|
1622
|
+
const objectUrl = URL.createObjectURL(blob);
|
|
1623
|
+
return this.sanitizer.bypassSecurityTrustUrl(objectUrl);
|
|
1624
|
+
}), catchError((err) => {
|
|
1625
|
+
console.error(`[SecureImageService] Ошибка загрузки картинки с API "${apiKey}":`, err);
|
|
1626
|
+
return of('');
|
|
1627
|
+
}));
|
|
1628
|
+
}
|
|
1629
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: SecureImageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1630
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: SecureImageService, providedIn: 'root' // Сервис будет доступен глобально во всем приложении
|
|
1631
|
+
});
|
|
1632
|
+
}
|
|
1633
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: SecureImageService, decorators: [{
|
|
1634
|
+
type: Injectable,
|
|
1635
|
+
args: [{
|
|
1636
|
+
providedIn: 'root' // Сервис будет доступен глобально во всем приложении
|
|
1637
|
+
}]
|
|
1638
|
+
}] });
|
|
1639
|
+
|
|
1610
1640
|
class ExportService {
|
|
1611
1641
|
// Экспорт в CSV
|
|
1612
1642
|
exportCSV(data, filename = 'data', arrHeader, newHeaders) {
|
|
@@ -2008,5 +2038,5 @@ class SecUser {
|
|
|
2008
2038
|
* Generated bundle index. Do not edit.
|
|
2009
2039
|
*/
|
|
2010
2040
|
|
|
2011
|
-
export { Action, AvatarService, BaseEditClass, BaseFilterClass, BaseMatChipComponent, BaseNavBarMenuClass, BasePageClass, BaseSelectAutocompleteWithVsComponent, BaseSelectWithGroupComponent, BaseServiceClass, BaseToolbarComponent, DateRangeInputComponent, DialogAction, DialogComponent, DisableIfRoleDirective, EmptyComponent, EntityAction, ExportService, HideIfForbiddenRoleDirective, LOGGER_CONFIG, LoaderService, LocalStorageService, LoggerService, LoginPageComponent, MY_FORMATS, NavBarComponent, NotFoundComponent, ProgressSpinnerComponent, SafePipe, SecUser, SetValueDirective, SseService, TableComponent, TimePipe, TruncatePipe, authGuard, dateFormat, provideLogger, redirectGuard, roleGuard };
|
|
2041
|
+
export { Action, AvatarService, BaseEditClass, BaseFilterClass, BaseMatChipComponent, BaseNavBarMenuClass, BasePageClass, BaseSelectAutocompleteWithVsComponent, BaseSelectWithGroupComponent, BaseServiceClass, BaseToolbarComponent, DateRangeInputComponent, DialogAction, DialogComponent, DisableIfRoleDirective, EmptyComponent, EntityAction, ExportService, HideIfForbiddenRoleDirective, LOGGER_CONFIG, LoaderService, LocalStorageService, LoggerService, LoginPageComponent, MY_FORMATS, NavBarComponent, NotFoundComponent, ProgressSpinnerComponent, SafePipe, SecUser, SecureImageService, SetValueDirective, SseService, TableComponent, TimePipe, TruncatePipe, authGuard, dateFormat, provideLogger, redirectGuard, roleGuard };
|
|
2012
2042
|
//# sourceMappingURL=kuzntsv-uikit-ui.mjs.map
|