@morozeckiy/dd-lib 0.7.55 → 0.7.62

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.
@@ -0,0 +1,12 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_1580_31182)">
3
+ <path d="M6 9C6 10.5913 6.63214 12.1174 7.75736 13.2426C8.88258 14.3679 10.4087 15 12 15C13.5913 15 15.1174 14.3679 16.2426 13.2426C17.3679 12.1174 18 10.5913 18 9C18 7.4087 17.3679 5.88258 16.2426 4.75736C15.1174 3.63214 13.5913 3 12 3C10.4087 3 8.88258 3.63214 7.75736 4.75736C6.63214 5.88258 6 7.4087 6 9Z" stroke="#07b700" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M12 15L15.4 20.89L16.998 17.657L20.596 17.889L17.196 12" stroke="#07b700" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/>
5
+ <path d="M6.80186 12L3.40186 17.89L6.99986 17.657L8.59786 20.889L11.9979 15" stroke="#07b700" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/>
6
+ </g>
7
+ <defs>
8
+ <clipPath id="clip0_1580_31182">
9
+ <rect width="24" height="24" fill="white"/>
10
+ </clipPath>
11
+ </defs>
12
+ </svg>
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { EventEmitter, Output, ViewChild, Input, Component, Injectable, InjectionToken, Inject, Pipe, Directive, HostListener, TemplateRef, ChangeDetectionStrategy, Injector, forwardRef, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, Optional, ElementRef, Host, SkipSelf, signal, input } from '@angular/core';
3
3
  import * as i1$4 from '@angular/forms';
4
4
  import { Validators, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
- import { BehaviorSubject, Subject, of, fromEvent, combineLatest } from 'rxjs';
5
+ import { BehaviorSubject, Subject, throwError, of, fromEvent, combineLatest } from 'rxjs';
6
6
  import { format, parse, isAfter, isBefore } from 'date-fns';
7
7
  import * as i1 from '@angular/common/http';
8
8
  import { HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';
@@ -312,13 +312,17 @@ class InterceptorsService {
312
312
  }
313
313
  /** перехватчик состояния запросов к api */
314
314
  intercept(req, next) {
315
+ // Пропускаем запросы к SVG
316
+ if (req.url.includes('.svg')) {
317
+ return next.handle(req);
318
+ }
315
319
  return next.handle(req).pipe(catchError(err => {
316
320
  if (err instanceof HttpErrorResponse) {
317
321
  if (err.status >= 500) {
318
322
  this.router.navigate(['tech-works']);
319
323
  }
320
324
  }
321
- throw err;
325
+ return throwError(() => err);
322
326
  }));
323
327
  }
324
328
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: InterceptorsService, deps: [{ token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
@@ -2057,15 +2061,21 @@ class LibSvgIconComponent {
2057
2061
  ngOnInit() {
2058
2062
  if (this.width) {
2059
2063
  this.el.nativeElement.style.width = this.width;
2060
- // this.rdr.setStyle(this.svgIcon, 'width', 'inherit')
2064
+ if (this.svgIcon) {
2065
+ this.svgIcon.style.setProperty('width', this.width, 'inherit');
2066
+ }
2061
2067
  }
2062
2068
  if (this.height) {
2063
2069
  this.el.nativeElement.style.height = this.height;
2064
- // this.rdr.setStyle(this.svgIcon, 'height', 'inherit')
2070
+ if (this.svgIcon) {
2071
+ this.svgIcon.style.setProperty('height', this.height, 'inherit');
2072
+ }
2065
2073
  }
2066
2074
  if (this.color) {
2067
2075
  this.el.nativeElement.style.fill = this.color;
2068
- // this.rdr.setStyle(this.svgIcon, 'stroke', this.color, RendererStyleFlags2.Important)
2076
+ if (this.svgIcon) {
2077
+ this.svgIcon.style.setProperty('stroke', this.color, 'important');
2078
+ }
2069
2079
  }
2070
2080
  }
2071
2081
  svgElementFromString(svgContent) {
@@ -3741,7 +3751,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
3741
3751
 
3742
3752
  Этот компонент значительно упрощает процесс отображения иконок на веб-странице, позволяя легко управлять их параметрами, такими как размеры и цвет.
3743
3753
  **/
3744
- // @Deprecate
3754
+ /**
3755
+ * @deprecated использовать lib-svg-viewer
3756
+ */
3745
3757
  class LibSvgComponent {
3746
3758
  constructor(http, rdr) {
3747
3759
  this.http = http;
@@ -3794,6 +3806,126 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
3794
3806
  type: Input
3795
3807
  }] } });
3796
3808
 
3809
+ class LibSvgViewerComponent {
3810
+ constructor(http, elementRef) {
3811
+ this.http = http;
3812
+ this.elementRef = elementRef;
3813
+ this.path = 'assets/images/';
3814
+ this.pack = 'svg'; // директория внутри path
3815
+ this.icon = '';
3816
+ this.width = '';
3817
+ this.height = '';
3818
+ this.color = '';
3819
+ this.containerClass = '';
3820
+ this.colorRules = [];
3821
+ }
3822
+ ngOnChanges(changes) {
3823
+ this.loadSvg();
3824
+ }
3825
+ loadSvg() {
3826
+ if (!this.path || !this.icon)
3827
+ return;
3828
+ this.http.get(`${this.path}${this.pack}/${this.icon}.svg`, { responseType: 'text' })
3829
+ .pipe(catchError((error) => {
3830
+ const errorMessage = error.message || 'Неизвестная ошибка';
3831
+ const customError = new HttpErrorResponse({
3832
+ error: `SVG не найден: ${errorMessage}`,
3833
+ status: 404,
3834
+ statusText: 'Not Found'
3835
+ });
3836
+ console.error(`Ошибка загрузки SVG: ${errorMessage}`, {
3837
+ path: `${this.path}${this.pack}/${this.icon}.svg`,
3838
+ status: error.status
3839
+ });
3840
+ return throwError(() => customError);
3841
+ }))
3842
+ .subscribe({
3843
+ next: (svg) => {
3844
+ this.renderSvg(svg);
3845
+ }
3846
+ });
3847
+ }
3848
+ renderSvg(svgString) {
3849
+ const container = this.elementRef.nativeElement.querySelector('.svg-container');
3850
+ container.innerHTML = svgString;
3851
+ const svg = container.querySelector('svg');
3852
+ if (!svg)
3853
+ return;
3854
+ // Применяем параметры
3855
+ if (this.width) {
3856
+ svg.style.width = this.width;
3857
+ }
3858
+ if (this.height) {
3859
+ svg.style.height = this.height;
3860
+ }
3861
+ this.applyColorRules(svg);
3862
+ if (this.color) {
3863
+ this.applyColor(svg);
3864
+ }
3865
+ }
3866
+ applyColorRules(svg) {
3867
+ this.colorRules.forEach(rule => {
3868
+ const elements = svg.querySelectorAll(rule.selector);
3869
+ elements.forEach(el => {
3870
+ if (rule.attribute === 'fill' || rule.attribute === 'both') {
3871
+ el.setAttribute('fill', rule.color);
3872
+ }
3873
+ if (rule.attribute === 'stroke' || rule.attribute === 'both') {
3874
+ el.setAttribute('stroke', rule.color);
3875
+ }
3876
+ // Если атрибут не указан, меняем и fill и stroke
3877
+ if (!rule.attribute) {
3878
+ if (el.hasAttribute('fill')) {
3879
+ el.setAttribute('fill', rule.color);
3880
+ }
3881
+ if (el.hasAttribute('stroke')) {
3882
+ el.setAttribute('stroke', rule.color);
3883
+ }
3884
+ }
3885
+ });
3886
+ });
3887
+ }
3888
+ applyColor(svg) {
3889
+ const elements = svg.querySelectorAll('[stroke], [fill]');
3890
+ elements.forEach(el => {
3891
+ // Обрабатываем stroke
3892
+ if (el.hasAttribute('stroke') &&
3893
+ el.getAttribute('stroke') !== 'none' &&
3894
+ el.getAttribute('stroke') !== 'transparent') {
3895
+ el.setAttribute('stroke', this.color);
3896
+ }
3897
+ // Обрабатываем fill
3898
+ if (el.hasAttribute('fill') &&
3899
+ el.getAttribute('fill') !== 'none' &&
3900
+ el.getAttribute('fill') !== 'transparent') {
3901
+ el.setAttribute('fill', this.color);
3902
+ }
3903
+ });
3904
+ }
3905
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: LibSvgViewerComponent, deps: [{ token: i1.HttpClient }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
3906
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: LibSvgViewerComponent, isStandalone: true, selector: "dd-lib-svg-viewer", inputs: { path: "path", pack: "pack", icon: "icon", width: "width", height: "height", color: "color", containerClass: "containerClass", colorRules: "colorRules" }, usesOnChanges: true, ngImport: i0, template: `<div #svgContainer class="svg-container"></div>`, isInline: true, styles: [":host{display:block}svg{width:100%;height:100%;display:block}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3907
+ }
3908
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: LibSvgViewerComponent, decorators: [{
3909
+ type: Component,
3910
+ args: [{ selector: 'dd-lib-svg-viewer', imports: [], standalone: true, template: `<div #svgContainer class="svg-container"></div>`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block}svg{width:100%;height:100%;display:block}\n"] }]
3911
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i0.ElementRef }], propDecorators: { path: [{
3912
+ type: Input
3913
+ }], pack: [{
3914
+ type: Input
3915
+ }], icon: [{
3916
+ type: Input
3917
+ }], width: [{
3918
+ type: Input
3919
+ }], height: [{
3920
+ type: Input
3921
+ }], color: [{
3922
+ type: Input
3923
+ }], containerClass: [{
3924
+ type: Input
3925
+ }], colorRules: [{
3926
+ type: Input
3927
+ }] } });
3928
+
3797
3929
  class ITab {
3798
3930
  constructor(body) {
3799
3931
  this.id = body.id;
@@ -5137,5 +5269,5 @@ const t = true;
5137
5269
  * Generated bundle index. Do not edit.
5138
5270
  */
5139
5271
 
5140
- export { API_URL, AutoHeightDirective, ClickOutsideDirective, CounterDirective, DDDialogRef, DEFAULT_FORMAT, DIALOG_CONFIG, DataEmptyComponent, DateService, Debounce, DeclensionDirective, DestroyService, DialogConfig, DialogService, DisableAfterNCall, Disabled, DropDownPositionDirective, ErrorPageComponent, FetcherService, FilterByKeyPipe, FilterPipe, FilterTabsPipe, FixedPositionDirective, FooterComponent, FooterLinkComponent, FooterLinksBlockComponent, HighlightPipe, ITab, InterceptorsService, LibAccordionComponent, LibBackButtonComponent, LibButtonComponent, LibCalendarComponent, LibCardComponent, LibCheckboxComponent, LibCommentInputComponent, LibCommonButtonComponent, LibCommonInputTextComponent, LibDateInputComponent, LibDateRangeComponent, LibDisclaimerComponent, LibFileLoaderComponent, LibFileUploadComponent, LibFilterButtonComponent, LibFilterComponent, LibHorizontalScrollComponent, LibImageLoaderComponent, LibInfoCardComponent, LibInputComponent, LibLoaderComponent, LibPeriodComponent, LibRadioComponent, LibSearchInputComponent, LibSelectComponent, LibSkeletonComponent, LibSortComponent, LibStepComponent, LibSvgComponent, LibSvgIconComponent, LibTabsFragmentComponent, LibTextareaComponent, ListKeyboardNavigationDirective, MainSharedComponent, ModalBaseComponent, ModalCommonComponent, NotFoundComponent, PhoneMaskDirective, ResizeTextareaDirective, ReversePipe, SafePipe, SelectableItemDirective, SvgIconsService, TOAST_CONFIG_TOKEN, TOOLTIP_DATA, TechWorksComponent, ThemeConfigurator, ThemeConstructorService, Throttle, ToastComponent, ToastConfig, ToastData, ToastRef, ToastService, ToastTypeData, TooltipComponent, TooltipDirective, TriangleDirective, ValidatorsService, completeIconSet, defaultToastConfig, provideToast, svgIconActogoneAccept, svgIconAll, svgIconAppgalery, svgIconAppstore, svgIconArrowDownRed, svgIconArrowUpGreen, svgIconBackArrow, svgIconBurger, svgIconCalendar, svgIconCheckGreen, svgIconCheckWhite, svgIconCircleNo, svgIconClear, svgIconClose, svgIconDangerT, svgIconDd, svgIconDdM, svgIconDobrodel, svgIconDownChevron, svgIconDownload, svgIconEds, svgIconEds2, svgIconEds2M, svgIconEdsM, svgIconEntry, svgIconErrorHint, svgIconEsia, svgIconEye, svgIconEyeOff, svgIconFile, svgIconFilter, svgIconGoogleapp, svgIconGrid, svgIconHealth, svgIconHealthM, svgIconInfoCircle, svgIconInfoT, svgIconLeftChevron, svgIconListSearch, svgIconLogout, svgIconMailExclamation, svgIconMaxFilter, svgIconMoon, svgIconMy, svgIconMyM, svgIconNews, svgIconNext, svgIconPaperclip, svgIconPenEdit, svgIconPguMo, svgIconPguMoM, svgIconPlug, svgIconPlugD, svgIconPlus, svgIconPreset, svgIconPrev, svgIconPrint, svgIconPrinter, svgIconQuestion, svgIconQuestionWhiteG, svgIconRedClose, svgIconReload, svgIconRightChevron, svgIconRustore, svgIconSearch, svgIconSend, svgIconSetAvatar, svgIconSharedLogo, svgIconSmallRoundLoader, svgIconSort, svgIconStar, svgIconSuccessT, svgIconSun, svgIconTg, svgIconToggleArrowLeft, svgIconToggleArrowRight, svgIconTrash, svgIconTrophy, svgIconUser, svgIconUserEmpty, svgIconUserEmptyD, svgIconVk, svgIconWarningT, t };
5272
+ export { API_URL, AutoHeightDirective, ClickOutsideDirective, CounterDirective, DDDialogRef, DEFAULT_FORMAT, DIALOG_CONFIG, DataEmptyComponent, DateService, Debounce, DeclensionDirective, DestroyService, DialogConfig, DialogService, DisableAfterNCall, Disabled, DropDownPositionDirective, ErrorPageComponent, FetcherService, FilterByKeyPipe, FilterPipe, FilterTabsPipe, FixedPositionDirective, FooterComponent, FooterLinkComponent, FooterLinksBlockComponent, HighlightPipe, ITab, InterceptorsService, LibAccordionComponent, LibBackButtonComponent, LibButtonComponent, LibCalendarComponent, LibCardComponent, LibCheckboxComponent, LibCommentInputComponent, LibCommonButtonComponent, LibCommonInputTextComponent, LibDateInputComponent, LibDateRangeComponent, LibDisclaimerComponent, LibFileLoaderComponent, LibFileUploadComponent, LibFilterButtonComponent, LibFilterComponent, LibHorizontalScrollComponent, LibImageLoaderComponent, LibInfoCardComponent, LibInputComponent, LibLoaderComponent, LibPeriodComponent, LibRadioComponent, LibSearchInputComponent, LibSelectComponent, LibSkeletonComponent, LibSortComponent, LibStepComponent, LibSvgComponent, LibSvgIconComponent, LibSvgViewerComponent, LibTabsFragmentComponent, LibTextareaComponent, ListKeyboardNavigationDirective, MainSharedComponent, ModalBaseComponent, ModalCommonComponent, NotFoundComponent, PhoneMaskDirective, ResizeTextareaDirective, ReversePipe, SafePipe, SelectableItemDirective, SvgIconsService, TOAST_CONFIG_TOKEN, TOOLTIP_DATA, TechWorksComponent, ThemeConfigurator, ThemeConstructorService, Throttle, ToastComponent, ToastConfig, ToastData, ToastRef, ToastService, ToastTypeData, TooltipComponent, TooltipDirective, TriangleDirective, ValidatorsService, completeIconSet, defaultToastConfig, provideToast, svgIconActogoneAccept, svgIconAll, svgIconAppgalery, svgIconAppstore, svgIconArrowDownRed, svgIconArrowUpGreen, svgIconBackArrow, svgIconBurger, svgIconCalendar, svgIconCheckGreen, svgIconCheckWhite, svgIconCircleNo, svgIconClear, svgIconClose, svgIconDangerT, svgIconDd, svgIconDdM, svgIconDobrodel, svgIconDownChevron, svgIconDownload, svgIconEds, svgIconEds2, svgIconEds2M, svgIconEdsM, svgIconEntry, svgIconErrorHint, svgIconEsia, svgIconEye, svgIconEyeOff, svgIconFile, svgIconFilter, svgIconGoogleapp, svgIconGrid, svgIconHealth, svgIconHealthM, svgIconInfoCircle, svgIconInfoT, svgIconLeftChevron, svgIconListSearch, svgIconLogout, svgIconMailExclamation, svgIconMaxFilter, svgIconMoon, svgIconMy, svgIconMyM, svgIconNews, svgIconNext, svgIconPaperclip, svgIconPenEdit, svgIconPguMo, svgIconPguMoM, svgIconPlug, svgIconPlugD, svgIconPlus, svgIconPreset, svgIconPrev, svgIconPrint, svgIconPrinter, svgIconQuestion, svgIconQuestionWhiteG, svgIconRedClose, svgIconReload, svgIconRightChevron, svgIconRustore, svgIconSearch, svgIconSend, svgIconSetAvatar, svgIconSharedLogo, svgIconSmallRoundLoader, svgIconSort, svgIconStar, svgIconSuccessT, svgIconSun, svgIconTg, svgIconToggleArrowLeft, svgIconToggleArrowRight, svgIconTrash, svgIconTrophy, svgIconUser, svgIconUserEmpty, svgIconUserEmptyD, svgIconVk, svgIconWarningT, t };
5141
5273
  //# sourceMappingURL=morozeckiy-dd-lib.mjs.map