@snabcentr/client-ui 1.6.2 → 1.6.3
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.
Potentially problematic release.
This version of @snabcentr/client-ui might be problematic. Click here for more details.
- package/esm2020/form-fields/suggestion-field/sc-suggestion-field.component.mjs +16 -7
- package/fesm2015/snabcentr-client-ui.mjs +16 -8
- package/fesm2015/snabcentr-client-ui.mjs.map +1 -1
- package/fesm2020/snabcentr-client-ui.mjs +15 -7
- package/fesm2020/snabcentr-client-ui.mjs.map +1 -1
- package/form-fields/suggestion-field/sc-suggestion-field.component.d.ts +4 -0
- package/package.json +1 -1
- package/styles/tailwind/tailwind.scss +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Component, ChangeDetectionStrategy, Inject, Input, Output, SkipSelf, Directive, HostBinding, ContentChild, ViewChild, NgModule, ContentChildren, HostListener, Injectable,
|
|
2
|
+
import { EventEmitter, Component, ChangeDetectionStrategy, Inject, Input, Output, SkipSelf, inject, Directive, HostBinding, ContentChild, ViewChild, NgModule, ContentChildren, HostListener, Injectable, ElementRef, Optional, ChangeDetectorRef, Self, InjectionToken, forwardRef } from '@angular/core';
|
|
3
3
|
import * as i1 from '@snabcentr/client-core';
|
|
4
4
|
import { ScUserMetrikaGoalsEnum, ScISuggestionType, ScOpfList, ScWarehouseService, ScAuthService, SEARCH_TERM, ScImageHelper, SC_PATH_IMAGE_NOT_FOUND, IS_RUNNING_ON_TERMINAL, SC_URLS, TERMINAL_PROVIDERS, SEARCH_TERM_PROVIDERS, ScCatalogService, ScCartService, ScIconTypesEnum, ScUserService } from '@snabcentr/client-core';
|
|
5
5
|
import * as i5 from 'rxjs';
|
|
@@ -7,7 +7,7 @@ import { Subject, map, filter, switchMap, tap, catchError, of, finalize, startWi
|
|
|
7
7
|
import * as i2 from '@angular/common';
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
|
9
9
|
import * as i4 from '@taiga-ui/core';
|
|
10
|
-
import { TuiButtonModule, TuiModeModule, TuiDialogModule, TuiDialogService, TuiTextfieldControllerModule, TuiLabelModule, TuiErrorModule, TuiDataListModule, TuiLoaderModule, TuiNotificationModule, TuiLinkModule, TuiFormatPhonePipeModule, tuiFadeIn, TUI_MONTHS, TuiSvgModule, TuiHintModule, TuiFormatNumberPipeModule } from '@taiga-ui/core';
|
|
10
|
+
import { TUI_DATA_LIST_HOST, TuiButtonModule, TuiModeModule, TuiDialogModule, TuiDialogService, TuiTextfieldControllerModule, TuiLabelModule, TuiErrorModule, TuiDataListModule, TuiLoaderModule, TuiNotificationModule, TuiLinkModule, TuiFormatPhonePipeModule, tuiFadeIn, TUI_MONTHS, TuiSvgModule, TuiHintModule, TuiFormatNumberPipeModule } from '@taiga-ui/core';
|
|
11
11
|
import { HttpErrorResponse } from '@angular/common/http';
|
|
12
12
|
import * as i3 from '@angular/forms';
|
|
13
13
|
import { FormGroupDirective, FormGroup, FormControl, Validators, NgControl, FormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
@@ -672,6 +672,12 @@ class ScSuggestionFieldComponent {
|
|
|
672
672
|
* Перечисление типов подсказок.
|
|
673
673
|
*/
|
|
674
674
|
this.suggestionType = ScISuggestionType;
|
|
675
|
+
/**
|
|
676
|
+
* Компонент обёртка выпадающего списка.
|
|
677
|
+
*/
|
|
678
|
+
this.host = inject(TUI_DATA_LIST_HOST, {
|
|
679
|
+
optional: true,
|
|
680
|
+
});
|
|
675
681
|
}
|
|
676
682
|
/** @inheritDoc */
|
|
677
683
|
ngOnInit() {
|
|
@@ -699,12 +705,12 @@ class ScSuggestionFieldComponent {
|
|
|
699
705
|
switch (this.type) {
|
|
700
706
|
case ScISuggestionType.fio:
|
|
701
707
|
if ('fio' in suggestion) {
|
|
702
|
-
this.control.control?.patchValue(suggestion.fio);
|
|
708
|
+
this.control.control?.patchValue(suggestion.fio, { emitEvent: false });
|
|
703
709
|
}
|
|
704
710
|
break;
|
|
705
711
|
case ScISuggestionType.address:
|
|
706
712
|
if ('addressString' in suggestion) {
|
|
707
|
-
this.control.control?.patchValue(suggestion.addressString);
|
|
713
|
+
this.control.control?.patchValue(suggestion.addressString, { emitEvent: false });
|
|
708
714
|
}
|
|
709
715
|
break;
|
|
710
716
|
case ScISuggestionType.bank:
|
|
@@ -713,7 +719,7 @@ class ScSuggestionFieldComponent {
|
|
|
713
719
|
bankName: suggestion.name,
|
|
714
720
|
bic: suggestion.bic,
|
|
715
721
|
correspondentAccount: suggestion.correspondentAccount,
|
|
716
|
-
});
|
|
722
|
+
}, { emitEvent: false });
|
|
717
723
|
}
|
|
718
724
|
break;
|
|
719
725
|
case ScISuggestionType.organization:
|
|
@@ -728,17 +734,19 @@ class ScSuggestionFieldComponent {
|
|
|
728
734
|
legalAddress: suggestion.legalAddress,
|
|
729
735
|
postalAddress: suggestion.postalAddress,
|
|
730
736
|
actualAddress: suggestion.actualAddress,
|
|
731
|
-
});
|
|
737
|
+
}, { emitEvent: false });
|
|
732
738
|
}
|
|
733
739
|
break;
|
|
734
740
|
case ScISuggestionType.email:
|
|
735
741
|
if ('email' in suggestion) {
|
|
736
|
-
this.control.control?.patchValue(suggestion.email);
|
|
742
|
+
this.control.control?.patchValue(suggestion.email, { emitEvent: false });
|
|
737
743
|
}
|
|
738
744
|
break;
|
|
739
745
|
default:
|
|
740
746
|
break;
|
|
741
747
|
}
|
|
748
|
+
// Дёргаем внутренний обработчик выбора элемента выпадающего списка.
|
|
749
|
+
this.host?.handleOption(this.control.value);
|
|
742
750
|
this.selectedClick.emit(suggestion);
|
|
743
751
|
}
|
|
744
752
|
}
|