@snabcentr/client-ui 1.9.1 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2020/form-fields/suggestion-field/sc-suggestion-field.component.mjs +7 -3
- package/esm2020/user/user-managers/sc-user-managers.component.mjs +2 -2
- package/fesm2015/snabcentr-client-ui.mjs +7 -3
- package/fesm2015/snabcentr-client-ui.mjs.map +1 -1
- package/fesm2020/snabcentr-client-ui.mjs +7 -3
- 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 +109 -109
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
2
|
import { EventEmitter, Component, ChangeDetectionStrategy, Inject, Input, Output, SkipSelf, inject, Directive, HostBinding, ContentChild, ViewChild, NgModule, ContentChildren, HostListener, Renderer2, ElementRef, Pipe, Optional, Injectable, ChangeDetectorRef, Self, forwardRef, InjectionToken } from '@angular/core';
|
3
3
|
import * as i1 from '@snabcentr/client-core';
|
4
|
-
import { ScUserMetrikaGoalsEnum, ScISuggestionType, ScOpfList, ScWarehouseService, ScAuthService, SEARCH_TERM, ScUnitsHelper, ScImageHelper, SC_PATH_IMAGE_NOT_FOUND, ScPhoneService, IS_RUNNING_ON_TERMINAL, SC_URLS, TERMINAL_PROVIDERS, SEARCH_TERM_PROVIDERS, ScPaginationService, SC_NEXT_PAGE_PAGINATION_CLICK, SC_PRODUCT_PAGINATION_OPTIONS, ScIconTypesEnum, ScUserService } from '@snabcentr/client-core';
|
4
|
+
import { ScUserMetrikaGoalsEnum, ScISuggestionType, SC_MIN_LENGTH_SEARCH_TERM, ScOpfList, ScWarehouseService, ScAuthService, SEARCH_TERM, ScUnitsHelper, ScImageHelper, SC_PATH_IMAGE_NOT_FOUND, ScPhoneService, IS_RUNNING_ON_TERMINAL, SC_URLS, TERMINAL_PROVIDERS, SEARCH_TERM_PROVIDERS, ScPaginationService, SC_NEXT_PAGE_PAGINATION_CLICK, SC_PRODUCT_PAGINATION_OPTIONS, ScIconTypesEnum, ScUserService } from '@snabcentr/client-core';
|
5
5
|
import * as i6$2 from 'rxjs';
|
6
6
|
import { Subject, map, filter, switchMap, tap, catchError, of, finalize, startWith, share, timer, scan, takeWhile, endWith, distinctUntilChanged, combineLatest, debounceTime, throwError, shareReplay, interval, takeUntil, skip } from 'rxjs';
|
7
7
|
import * as i2 from '@angular/common';
|
@@ -678,10 +678,14 @@ class ScSuggestionFieldComponent {
|
|
678
678
|
this.host = inject(TUI_DATA_LIST_HOST, {
|
679
679
|
optional: true,
|
680
680
|
});
|
681
|
+
/**
|
682
|
+
* Минимальная длина поискового запроса для получения данных.
|
683
|
+
*/
|
684
|
+
this.minLengthSearchTerm = inject(SC_MIN_LENGTH_SEARCH_TERM);
|
681
685
|
}
|
682
686
|
/** @inheritDoc */
|
683
687
|
ngOnInit() {
|
684
|
-
const request$ = tuiControlValue(this.control).pipe(debounceTime(500), filter(tuiIsPresent), map((term) => term.trim()), filter((term) => term.length >=
|
688
|
+
const request$ = tuiControlValue(this.control).pipe(debounceTime(500), filter(tuiIsPresent), map((term) => term.trim()), filter((term) => term.length >= this.minLengthSearchTerm), switchMap((term) => this.suggestionService.getData(term, this.type).pipe(startWith(null))), catchError((error) => {
|
685
689
|
if (error instanceof HttpErrorResponse) {
|
686
690
|
const errorResponse = error.error;
|
687
691
|
if (this.control.control) {
|
@@ -5388,7 +5392,7 @@ class ScUserManagersComponent {
|
|
5388
5392
|
* Персональные менеджеры пользователя.
|
5389
5393
|
*/
|
5390
5394
|
this.managers$ = this.userService
|
5391
|
-
.
|
5395
|
+
.getUserChange$()
|
5392
5396
|
.pipe(map((user) => user.managers?.sort((a, b) => Number(Boolean(b.isPrimary)) - Number(Boolean(a.isPrimary)))));
|
5393
5397
|
/**
|
5394
5398
|
* Событие нажатия на кнопку QR кода.
|