@snabcentr/client-ui 5.0.0 → 5.1.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.
@@ -4,7 +4,7 @@ import * as i1$3 from '@snabcentr/client-core';
4
4
  import { ScContactsService, ScUserService, ScISuggestionType, SC_MIN_LENGTH_SEARCH_TERM, ScSuggestionService, ScAuthService, SEARCH_TERM, ScUnitsHelper, ScImageHelper, SC_PATH_IMAGE_NOT_FOUND, ScImage, ScVCardService, IS_RUNNING_ON_TERMINAL, ScPhoneService, ScUserMetrikaService, ScUserMetrikaGoalsEnum, ScVerificationService, ScConvertersService, ScReferencesService, ScOpfList, ScLocationsService, ScBannerService, ScMediaImageTransformerPipe, ScWarehouseService, SEARCH_TERM_PROVIDERS, ScCartService, ScUploadedFile, ScMimeTypes, ScCatalogService, ScPaginationService, SC_NEXT_PAGE_PAGINATION_CLICK, SC_PRODUCT_PAGINATION_OPTIONS, ScContragentService, ScDeliveryAddressService, SC_URLS, IS_SERVER, RESPONSE, ScIconTypesEnum, ScDocumentInfoTypesEnum, ScFilesService, ScFrequentlyAskedQuestionsService, SC_COMPANY_INFO, ScFeedbackService, ScIdOrSlugPipe, ScJsonLdComponent } from '@snabcentr/client-core';
5
5
  import { EMPTY, BehaviorSubject, switchMap, of, shareReplay, debounceTime, filter, map, startWith, catchError, throwError, share, Subject, tap, finalize, timer, scan, takeWhile, endWith, distinctUntilChanged, combineLatest, Observable, pairwise, noop, first, merge, skip } from 'rxjs';
6
6
  import * as i1$1 from '@angular/common';
7
- import { AsyncPipe, NgTemplateOutlet, CommonModule, NgClass } from '@angular/common';
7
+ import { AsyncPipe, DOCUMENT, NgTemplateOutlet, CommonModule, NgClass } from '@angular/common';
8
8
  import { HttpErrorResponse, HttpClient } from '@angular/common/http';
9
9
  import { toSignal, outputFromObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
10
10
  import * as i1 from '@angular/forms';
@@ -896,6 +896,87 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
896
896
  }]
897
897
  }] });
898
898
 
899
+ /**
900
+ * Директива для автоматической установки фокуса на первое невалидное поле формы при submit.
901
+ */
902
+ class ScFocusFirstInvalidFieldDirective {
903
+ constructor() {
904
+ /**
905
+ * Порядок проверки полей формы.
906
+ */
907
+ this.fieldOrder = input([], ...(ngDevMode ? [{ debugName: "fieldOrder" }] : []));
908
+ /**
909
+ * Объект {@link Document}, предоставляющий доступ к DOM страницы.
910
+ */
911
+ this.document = inject(DOCUMENT);
912
+ /**
913
+ * Директива формы.
914
+ */
915
+ this.formGroupDirective = inject(FormGroupDirective);
916
+ }
917
+ /**
918
+ * Обработчик события submit формы.
919
+ */
920
+ onSubmit() {
921
+ const { form } = this.formGroupDirective;
922
+ if (this.fieldOrder().length === 0) {
923
+ return;
924
+ }
925
+ if (form.valid) {
926
+ return;
927
+ }
928
+ const firstInvalidFieldName = this.fieldOrder().find((fieldName) => {
929
+ const control = form.get(fieldName);
930
+ return control && control.invalid && !control.disabled;
931
+ });
932
+ const firstInvalidField = firstInvalidFieldName ? form.get(firstInvalidFieldName) : null;
933
+ if (firstInvalidField) {
934
+ firstInvalidField.markAsTouched();
935
+ firstInvalidField.updateValueAndValidity();
936
+ }
937
+ setTimeout(() => {
938
+ this.focusFirstInvalidField(form);
939
+ }, 0);
940
+ }
941
+ /**
942
+ * Устанавливает фокус на первое поле формы с ошибкой.
943
+ *
944
+ * @param form Форма для проверки.
945
+ */
946
+ focusFirstInvalidField(form) {
947
+ const firstInvalidField = this.fieldOrder().find((fieldName) => {
948
+ const control = form.get(fieldName);
949
+ return control && control.invalid && control.touched && !control.disabled;
950
+ });
951
+ if (!firstInvalidField) {
952
+ return;
953
+ }
954
+ const element = this.document.querySelector(`[formControlName="${firstInvalidField}"]`);
955
+ if (!element) {
956
+ return;
957
+ }
958
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
959
+ const queryResult = element.querySelector('input, select, textarea');
960
+ const nativeElement = element.nativeFocusableElement ?? (queryResult ? queryResult : null) ?? element;
961
+ if (nativeElement instanceof HTMLElement) {
962
+ nativeElement.focus();
963
+ nativeElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
964
+ }
965
+ }
966
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: ScFocusFirstInvalidFieldDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
967
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.9", type: ScFocusFirstInvalidFieldDirective, isStandalone: true, selector: "form[formGroup][scFocusFirstInvalidField]", inputs: { fieldOrder: { classPropertyName: "fieldOrder", publicName: "fieldOrder", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "ngSubmit": "onSubmit()" } }, ngImport: i0 }); }
968
+ }
969
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: ScFocusFirstInvalidFieldDirective, decorators: [{
970
+ type: Directive,
971
+ args: [{
972
+ standalone: true,
973
+ selector: 'form[formGroup][scFocusFirstInvalidField]',
974
+ host: {
975
+ '(ngSubmit)': 'onSubmit()',
976
+ },
977
+ }]
978
+ }], propDecorators: { fieldOrder: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldOrder", required: false }] }] } });
979
+
899
980
  /**
900
981
  * Директива для обработки события фокуса поля ввода, для последующего выделения содержимого поля ввода.
901
982
  */
@@ -1316,6 +1397,9 @@ class ScVerificationPhoneCheckFormComponent {
1316
1397
  * @param haveCode Признак того есть ли код подтверждения или нет.
1317
1398
  */
1318
1399
  setHaveCode(haveCode) {
1400
+ if (haveCode) {
1401
+ this.form.controls.verificationCode.reset();
1402
+ }
1319
1403
  this.haveCode.set(haveCode);
1320
1404
  }
1321
1405
  /**
@@ -1609,10 +1693,16 @@ class ScSignInFormByEmailComponent {
1609
1693
  // eslint-disable-next-line sonarjs/cognitive-complexity
1610
1694
  catchError((error) => {
1611
1695
  if (error instanceof HttpErrorResponse) {
1696
+ console.log(error);
1612
1697
  if ('error' in error.error) {
1613
1698
  const errorResponse = error.error;
1614
1699
  if (errorResponse.error.includes('invalid_grant')) {
1615
- this.formByEmail.setErrors({ serverResponse: ['Пользователь с указанными учетными данными не найден. Проверьте правильность ввода.'] });
1700
+ if (errorResponse.errorDescription?.toLocaleLowerCase().includes('invalid')) {
1701
+ this.formByEmail.setErrors({ serverResponse: ['Неверный адрес электронной почты или пароль. Проверьте правильность ввода.'] });
1702
+ }
1703
+ if (errorResponse.errorDescription?.toLocaleLowerCase().includes('disabled')) {
1704
+ this.formByEmail.setErrors({ serverResponse: ['Учетная запись заблокирована, свяжитесь с администратором.'] });
1705
+ }
1616
1706
  }
1617
1707
  else {
1618
1708
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
@@ -1697,6 +1787,10 @@ class ScSignInFormByPhoneComponent {
1697
1787
  * {@link Subject} события отправки формы.
1698
1788
  */
1699
1789
  this.onSubmit = new Subject();
1790
+ /**
1791
+ * Сервис для отображения Push-уведомлений с контактами для помощи клиенту.
1792
+ */
1793
+ this.helpNotificationService = inject(ScHelpNotificationService);
1700
1794
  /**
1701
1795
  * {@link Observable} запроса данных аутентификации.
1702
1796
  */
@@ -1706,8 +1800,12 @@ class ScSignInFormByPhoneComponent {
1706
1800
  if (error instanceof HttpErrorResponse) {
1707
1801
  if ('error' in error.error) {
1708
1802
  const errorResponse = error.error;
1709
- if (errorResponse.error.includes('invalid_credentials')) {
1710
- this.form.setErrors({ serverResponse: ['Неверный код подтверждения.'] });
1803
+ if (errorResponse.error.includes('invalid_credentials') && errorResponse.errorDescription?.toLocaleLowerCase().includes('invalid')) {
1804
+ this.form.get('verificationCode')?.setErrors({ serverResponse: ['Неверный СМС-код подтверждения.'] });
1805
+ }
1806
+ else if (errorResponse.error.includes('invalid_grant') && errorResponse.errorDescription?.toLocaleLowerCase().includes('disabled')) {
1807
+ this.form.setErrors({ serverResponse: ['Учетная запись заблокирована, свяжитесь с администратором.'] });
1808
+ this.helpNotificationService.helpNotificationByPhone(value.phone);
1711
1809
  }
1712
1810
  else {
1713
1811
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
@@ -3425,14 +3523,23 @@ class ScPriceWarehouseStockComponent {
3425
3523
  /** @inheritDoc */
3426
3524
  ngOnInit() {
3427
3525
  this.selectedWarehouse$ = this.fromMain ? this.warehouseService.getCatalogWarehouseChange$() : this.warehouseService.getWarehouseSelectChange$();
3428
- this.warehousesList$ = this.selectedWarehouse$.pipe(switchMap((warehouse) => this.warehouseService.getWarehouses$().pipe(map((warehouses) => this.product.stockCount?.map((sc) => ({ w: warehouses.find((w) => w.id === sc.warehouseId), sc: sc }))), map((items) => items?.sort((item) => (item.w?.id === warehouse?.id ? -1 : 1))))));
3526
+ this.warehousesList$ = this.selectedWarehouse$.pipe(switchMap((warehouse) => this.warehouseService.getWarehouses$().pipe(map((warehouses) => {
3527
+ const items = warehouses.map((w) => {
3528
+ const stockCount = this.product.stockCount?.find((sc) => sc.warehouseId === w.id);
3529
+ return {
3530
+ w: w,
3531
+ sc: stockCount ?? { warehouseId: w.id, count: 0 },
3532
+ };
3533
+ });
3534
+ return items.sort((item) => (item.w.id === warehouse?.id ? -1 : 1));
3535
+ }))));
3429
3536
  }
3430
3537
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: ScPriceWarehouseStockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3431
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: ScPriceWarehouseStockComponent, isStandalone: true, selector: "sc-price-warehouse-stock", inputs: { classList: "classList", product: "product", withStockHint: "withStockHint", fromMain: "fromMain" }, ngImport: i0, template: "@if (product) {\n @let isDisabled = product.isHidden || product.isNull;\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n <span *tuiLet=\"withStockHint && !!(warehousesList$ | async)?.length as showStockHint\">\n @if (!product.stockCount?.length && product.getNotStockMessage(warehouseSelect); as message) {\n <a\n *tuiLet=\"!!(product.properties?.planingIncomingDate || product.properties?.planingProductionDate) as showPlaningHint\"\n tuiLink\n [pseudo]=\"showPlaningHint\"\n [tuiHint]=\"showPlaningHint && planingHint\"\n [class.disabled]=\"isDisabled\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [style.color]=\"'var(--tui-status-negative)'\"\n [style.cursor]=\"showPlaningHint && planingHint ? 'pointer' : 'default'\"\n [ngClass]=\"classList\"\n >\n {{ message }}\n </a>\n }\n <ng-template #planingHint>\n @if (product.properties?.planingIncomingDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u043F\u043E\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u044F <br />\n \u043D\u0430 \u041E\u0441\u043D\u043E\u0432\u043D\u043E\u0439 \u0441\u043A\u043B\u0430\u0434:\n <span class=\"font-bold\">{{ product.properties?.planingIncomingDate }}</span>\n </span>\n }\n @if (product.properties?.planingProductionDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u0430:\n <span class=\"font-bold\">{{ product.properties?.planingProductionDate }}</span>\n </span>\n }\n </ng-template>\n @if (product.stockCount && product.stockCount.length && !product.onOrder) {\n <span>\n <span\n tuiLink\n [style.color]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"showStockHint && stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [ngClass]=\"classList\"\n [class.disabled]=\"isDisabled\"\n class=\"!underline\"\n >\n \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u043D\u0430\u043B\u0438\u0447\u0438\u0435\n </span>\n </span>\n }\n @if (product.onOrder) {\n <span\n [style.color]=\"'var(--tui-status-warning)'\"\n [ngClass]=\"classList\"\n >\n \u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437\n </span>\n }\n </span>\n }\n <ng-template #stockHint>\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n <table\n class=\"stock-table table-auto text-body-s\"\n [ngClass]=\"classList\"\n >\n <tbody>\n @for (item of warehousesList$ | async; track item) {\n <tr class=\"border-b\">\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count ? item.sc.count + ' ' + product.quantityUnit : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n }\n </tbody>\n </table>\n }\n </ng-template>\n}\n", styles: ["::ng-deep tui-hint:has(.stock-table){max-inline-size:22rem}[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: TuiTextfieldControllerModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"], outputs: ["tuiHintVisible"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo"] }, { kind: "directive", type: TuiLet, selector: "[tuiLet]", inputs: ["tuiLet"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3538
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: ScPriceWarehouseStockComponent, isStandalone: true, selector: "sc-price-warehouse-stock", inputs: { classList: "classList", product: "product", withStockHint: "withStockHint", fromMain: "fromMain" }, ngImport: i0, template: "@if (product) {\n @let isDisabled = product.isHidden || product.isNull;\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n <span *tuiLet=\"withStockHint && !!(warehousesList$ | async)?.length as showStockHint\">\n @if (!product.stockCount?.length && product.getNotStockMessage(warehouseSelect); as message) {\n <a\n *tuiLet=\"!!(product.properties?.planingIncomingDate || product.properties?.planingProductionDate) as showPlaningHint\"\n tuiLink\n [pseudo]=\"showPlaningHint\"\n [tuiHint]=\"showPlaningHint && planingHint\"\n [class.disabled]=\"isDisabled\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [style.color]=\"'var(--tui-status-negative)'\"\n [style.cursor]=\"showPlaningHint && planingHint ? 'pointer' : 'default'\"\n [ngClass]=\"classList\"\n >\n {{ message }}\n </a>\n }\n <ng-template #planingHint>\n @if (product.properties?.planingIncomingDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u043F\u043E\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u044F <br />\n \u043D\u0430 \u041E\u0441\u043D\u043E\u0432\u043D\u043E\u0439 \u0441\u043A\u043B\u0430\u0434:\n <span class=\"font-bold\">{{ product.properties?.planingIncomingDate }}</span>\n </span>\n }\n @if (product.properties?.planingProductionDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u0430:\n <span class=\"font-bold\">{{ product.properties?.planingProductionDate }}</span>\n </span>\n }\n </ng-template>\n @if (product.stockCount && product.stockCount.length && !product.onOrder) {\n <span>\n <span\n tuiLink\n [style.color]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"showStockHint && stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [ngClass]=\"classList\"\n [class.disabled]=\"isDisabled\"\n class=\"!underline\"\n >\n \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u043D\u0430\u043B\u0438\u0447\u0438\u0435\n </span>\n </span>\n }\n @if (product.onOrder) {\n <span\n [style.color]=\"'var(--tui-status-warning)'\"\n [ngClass]=\"classList\"\n >\n \u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437\n </span>\n }\n </span>\n }\n <ng-template #stockHint>\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n <table\n class=\"stock-table table-auto text-body-s\"\n [ngClass]=\"classList\"\n >\n <tbody>\n @for (item of warehousesList$ | async; track item) {\n <tr class=\"border-b\">\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count !== undefined && item.sc.count !== null ? item.sc.count + ' ' + product.quantityUnit : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n }\n </tbody>\n </table>\n }\n </ng-template>\n}\n", styles: ["::ng-deep tui-hint:has(.stock-table){max-inline-size:22rem}[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: TuiTextfieldControllerModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"], outputs: ["tuiHintVisible"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo"] }, { kind: "directive", type: TuiLet, selector: "[tuiLet]", inputs: ["tuiLet"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3432
3539
  }
3433
3540
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: ScPriceWarehouseStockComponent, decorators: [{
3434
3541
  type: Component,
3435
- args: [{ selector: 'sc-price-warehouse-stock', imports: [CommonModule, RouterModule, TuiTextfieldControllerModule, FormsModule, ReactiveFormsModule, ...TuiHint, TuiLink, TuiLet, ScFormatDatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (product) {\n @let isDisabled = product.isHidden || product.isNull;\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n <span *tuiLet=\"withStockHint && !!(warehousesList$ | async)?.length as showStockHint\">\n @if (!product.stockCount?.length && product.getNotStockMessage(warehouseSelect); as message) {\n <a\n *tuiLet=\"!!(product.properties?.planingIncomingDate || product.properties?.planingProductionDate) as showPlaningHint\"\n tuiLink\n [pseudo]=\"showPlaningHint\"\n [tuiHint]=\"showPlaningHint && planingHint\"\n [class.disabled]=\"isDisabled\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [style.color]=\"'var(--tui-status-negative)'\"\n [style.cursor]=\"showPlaningHint && planingHint ? 'pointer' : 'default'\"\n [ngClass]=\"classList\"\n >\n {{ message }}\n </a>\n }\n <ng-template #planingHint>\n @if (product.properties?.planingIncomingDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u043F\u043E\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u044F <br />\n \u043D\u0430 \u041E\u0441\u043D\u043E\u0432\u043D\u043E\u0439 \u0441\u043A\u043B\u0430\u0434:\n <span class=\"font-bold\">{{ product.properties?.planingIncomingDate }}</span>\n </span>\n }\n @if (product.properties?.planingProductionDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u0430:\n <span class=\"font-bold\">{{ product.properties?.planingProductionDate }}</span>\n </span>\n }\n </ng-template>\n @if (product.stockCount && product.stockCount.length && !product.onOrder) {\n <span>\n <span\n tuiLink\n [style.color]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"showStockHint && stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [ngClass]=\"classList\"\n [class.disabled]=\"isDisabled\"\n class=\"!underline\"\n >\n \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u043D\u0430\u043B\u0438\u0447\u0438\u0435\n </span>\n </span>\n }\n @if (product.onOrder) {\n <span\n [style.color]=\"'var(--tui-status-warning)'\"\n [ngClass]=\"classList\"\n >\n \u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437\n </span>\n }\n </span>\n }\n <ng-template #stockHint>\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n <table\n class=\"stock-table table-auto text-body-s\"\n [ngClass]=\"classList\"\n >\n <tbody>\n @for (item of warehousesList$ | async; track item) {\n <tr class=\"border-b\">\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count ? item.sc.count + ' ' + product.quantityUnit : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n }\n </tbody>\n </table>\n }\n </ng-template>\n}\n", styles: ["::ng-deep tui-hint:has(.stock-table){max-inline-size:22rem}[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"] }]
3542
+ args: [{ selector: 'sc-price-warehouse-stock', imports: [CommonModule, RouterModule, TuiTextfieldControllerModule, FormsModule, ReactiveFormsModule, ...TuiHint, TuiLink, TuiLet], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (product) {\n @let isDisabled = product.isHidden || product.isNull;\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n <span *tuiLet=\"withStockHint && !!(warehousesList$ | async)?.length as showStockHint\">\n @if (!product.stockCount?.length && product.getNotStockMessage(warehouseSelect); as message) {\n <a\n *tuiLet=\"!!(product.properties?.planingIncomingDate || product.properties?.planingProductionDate) as showPlaningHint\"\n tuiLink\n [pseudo]=\"showPlaningHint\"\n [tuiHint]=\"showPlaningHint && planingHint\"\n [class.disabled]=\"isDisabled\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [style.color]=\"'var(--tui-status-negative)'\"\n [style.cursor]=\"showPlaningHint && planingHint ? 'pointer' : 'default'\"\n [ngClass]=\"classList\"\n >\n {{ message }}\n </a>\n }\n <ng-template #planingHint>\n @if (product.properties?.planingIncomingDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u043F\u043E\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u044F <br />\n \u043D\u0430 \u041E\u0441\u043D\u043E\u0432\u043D\u043E\u0439 \u0441\u043A\u043B\u0430\u0434:\n <span class=\"font-bold\">{{ product.properties?.planingIncomingDate }}</span>\n </span>\n }\n @if (product.properties?.planingProductionDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u0430:\n <span class=\"font-bold\">{{ product.properties?.planingProductionDate }}</span>\n </span>\n }\n </ng-template>\n @if (product.stockCount && product.stockCount.length && !product.onOrder) {\n <span>\n <span\n tuiLink\n [style.color]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"showStockHint && stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [ngClass]=\"classList\"\n [class.disabled]=\"isDisabled\"\n class=\"!underline\"\n >\n \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u043D\u0430\u043B\u0438\u0447\u0438\u0435\n </span>\n </span>\n }\n @if (product.onOrder) {\n <span\n [style.color]=\"'var(--tui-status-warning)'\"\n [ngClass]=\"classList\"\n >\n \u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437\n </span>\n }\n </span>\n }\n <ng-template #stockHint>\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n <table\n class=\"stock-table table-auto text-body-s\"\n [ngClass]=\"classList\"\n >\n <tbody>\n @for (item of warehousesList$ | async; track item) {\n <tr class=\"border-b\">\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count !== undefined && item.sc.count !== null ? item.sc.count + ' ' + product.quantityUnit : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n }\n </tbody>\n </table>\n }\n </ng-template>\n}\n", styles: ["::ng-deep tui-hint:has(.stock-table){max-inline-size:22rem}[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"] }]
3436
3543
  }], propDecorators: { classList: [{
3437
3544
  type: Input
3438
3545
  }], product: [{
@@ -4472,11 +4579,11 @@ class ScPriceListPaginationComponent {
4472
4579
  });
4473
4580
  }
4474
4581
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: ScPriceListPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4475
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: ScPriceListPaginationComponent, isStandalone: true, selector: "sc-price-list-pagination", ngImport: i0, template: "@if (meta$ | async; as meta) {\n @if (meta?.currentPage !== meta?.lastPage) {\n <button\n tuiButton\n (click)=\"showMore()\"\n [disabled]=\"!!(disabled$ | async)\"\n appearance=\"secondary\"\n class=\"!font-bold\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451 {{ options.perPage }} \u0442\u043E\u0432\u0430\u0440\u043E\u0432\n </button>\n }\n}\n", dependencies: [{ kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4582
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: ScPriceListPaginationComponent, isStandalone: true, selector: "sc-price-list-pagination", ngImport: i0, template: "@let meta = meta$ | async;\n@let disabled = disabled$ | async;\n\n@if (meta) {\n @let isLastPage = meta.currentPage === meta.lastPage;\n\n @if (!isLastPage) {\n <button\n tuiButton\n (click)=\"showMore()\"\n [disabled]=\"disabled\"\n appearance=\"secondary\"\n class=\"!font-bold\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451\n </button>\n }\n}\n", dependencies: [{ kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4476
4583
  }
4477
4584
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: ScPriceListPaginationComponent, decorators: [{
4478
4585
  type: Component,
4479
- args: [{ selector: 'sc-price-list-pagination', changeDetection: ChangeDetectionStrategy.OnPush, imports: [TuiTransitioned, TuiAppearance$1, TuiWithAppearance$1, TuiIcons, TuiWithIcons, TuiButton, AsyncPipe], template: "@if (meta$ | async; as meta) {\n @if (meta?.currentPage !== meta?.lastPage) {\n <button\n tuiButton\n (click)=\"showMore()\"\n [disabled]=\"!!(disabled$ | async)\"\n appearance=\"secondary\"\n class=\"!font-bold\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451 {{ options.perPage }} \u0442\u043E\u0432\u0430\u0440\u043E\u0432\n </button>\n }\n}\n" }]
4586
+ args: [{ selector: 'sc-price-list-pagination', changeDetection: ChangeDetectionStrategy.OnPush, imports: [TuiTransitioned, TuiAppearance$1, TuiWithAppearance$1, TuiIcons, TuiWithIcons, TuiButton, AsyncPipe], template: "@let meta = meta$ | async;\n@let disabled = disabled$ | async;\n\n@if (meta) {\n @let isLastPage = meta.currentPage === meta.lastPage;\n\n @if (!isLastPage) {\n <button\n tuiButton\n (click)=\"showMore()\"\n [disabled]=\"disabled\"\n appearance=\"secondary\"\n class=\"!font-bold\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451\n </button>\n }\n}\n" }]
4480
4587
  }] });
4481
4588
 
4482
4589
  /* eslint-disable no-restricted-syntax,@typescript-eslint/unbound-method */
@@ -7746,5 +7853,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
7746
7853
  * Generated bundle index. Do not edit.
7747
7854
  */
7748
7855
 
7749
- export { AbstractScPriceCard, AuthMethod, CURRENT_COUNTRY_ID, FilesAndDocumentsComponent, FinishDateTimeTransformerDirective, IS_DEFAULT_COUNTRY, MAX_FILES_IN_FORM_INPUT, SC_ALLOW_SELECT_TERMINATED, SC_BANNER_DURATION, SC_DATE_FORMATTER, SC_ERROR_CHANGE_HANDLER, SC_HELP_NOTIFICATION_CLOSE, SC_HELP_NOTIFICATION_LIMIT, SC_MANAGER_QR_HANDLER, SC_NOTIFY_WHEN_IN_STOCK_REQUIRED_FIELDS, SC_PAGE_SIZE_OPTIONS$1 as SC_PAGE_SIZE_OPTIONS, SC_PHONE_APPROVE_CODE_SENDER, SC_PHONE_APPROVE_CODE_SENDER_PROVIDER, SC_SHOW_HELP_NOTIFICATION_IN_PHONE_INPUT, SC_USER_CITY_INFO, SC_USER_INFO, SC_USER_PROVIDERS, SC_VERIFICATION_CODE_TIMEOUT, ScAccordionComponent, ScAccordionContentDirective, ScAddContactDialogComponent, ScAddContragentBankAccountsDialogComponent, ScAddContragentDialogComponent, ScAddDeliveryAddressDialogComponent, ScAddOrEditingCartItemDialogComponent, ScAddOrEditingCartItemFormComponent, ScAddressesSelectionFieldComponent, ScBannerComponent, ScBrandsListComponent, ScCartAddProductsFromCsvDialogComponent, ScCartItemComponent, ScCategoryCardComponent, ScContactsAccordionComponent, ScContragentsAccordionComponent, ScContragentsAccordionItemComponent, ScDeliveryAddressAccordionComponent, ScDeliveryAddressAccordionItemComponent, ScDownloadPriceListComponent, ScEmailLinkDirective, ScErrorBlockStatusComponent, ScErrorHandlerComponent, ScFavoriteButtonComponent, ScFeedbackFormComponent, ScFormatDatePipe, ScFrequentlyAskedQuestionsComponent, ScFrequentlyAskedQuestionsGroupSelectorComponent, ScFrequentlyAskedQuestionsWithGroupsComponent, ScGratitudeComponent, ScHelpNotificationService, ScHoverImageCarouselComponent, ScInputQuantityComponent, ScJsonLdCategoryComponent, ScLinks, ScManagerCardComponent, ScManagerCardPushComponent, ScNewContactFormComponent, ScNewContragentBankAccountsFormComponent, ScNewContragentFormComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNextInputFocusDirective, ScNotifyWhenInStockDialogComponent, ScOrderItemMobileComponent, ScPaymentStatusComponent, ScPersonalDataProcessingPolicyComponent, ScPhoneFormatPipe, ScPreviewSampleComponent, ScPreviewSamplesMosquitoComponent, ScPriceCardComponent, ScPriceCardInlineComponent, ScPriceHistoryComponent, ScPriceListPaginationComponent, ScPriceWarehouseStockComponent, ScPrivacyPolicyComponent, ScProductInAllWarehousesPipe, ScProfileAccordionsContentComponent, ScPublicOfferComponent, ScQRCodeDialogComponent, ScResetUserPasswordComponent, ScResourcePreviewComponent, ScSelectOnFocusinDirective, ScShareButtonComponent, ScSignInFormByEmailComponent, ScSignInFormByPhoneComponent, ScSignInFormComponent, ScSignUpFormComponent, ScSimpleSignUpFormComponent, ScSuggestionFieldComponent, ScTelLinkDirective, ScTerminalLinkDirective, ScUpdateUserInfoDialogComponent, ScUserManagersComponent, ScUserPhoneApproveDialogComponent, ScVerificationPhoneCheckFormComponent, TreeDirective, TreeIconService, TreeLoaderService, TreeTopDirective, phoneValidator, scAtLeastOneRequiredValidator, scBicValidator, scClientUiIconsName, scCorrespondentAccountValidator, scPasswordConfirmMatchingValidator, stepValidator, tuiDateValueTransformerDefaultProvider };
7856
+ export { AbstractScPriceCard, AuthMethod, CURRENT_COUNTRY_ID, FilesAndDocumentsComponent, FinishDateTimeTransformerDirective, IS_DEFAULT_COUNTRY, MAX_FILES_IN_FORM_INPUT, SC_ALLOW_SELECT_TERMINATED, SC_BANNER_DURATION, SC_DATE_FORMATTER, SC_ERROR_CHANGE_HANDLER, SC_HELP_NOTIFICATION_CLOSE, SC_HELP_NOTIFICATION_LIMIT, SC_MANAGER_QR_HANDLER, SC_NOTIFY_WHEN_IN_STOCK_REQUIRED_FIELDS, SC_PAGE_SIZE_OPTIONS$1 as SC_PAGE_SIZE_OPTIONS, SC_PHONE_APPROVE_CODE_SENDER, SC_PHONE_APPROVE_CODE_SENDER_PROVIDER, SC_SHOW_HELP_NOTIFICATION_IN_PHONE_INPUT, SC_USER_CITY_INFO, SC_USER_INFO, SC_USER_PROVIDERS, SC_VERIFICATION_CODE_TIMEOUT, ScAccordionComponent, ScAccordionContentDirective, ScAddContactDialogComponent, ScAddContragentBankAccountsDialogComponent, ScAddContragentDialogComponent, ScAddDeliveryAddressDialogComponent, ScAddOrEditingCartItemDialogComponent, ScAddOrEditingCartItemFormComponent, ScAddressesSelectionFieldComponent, ScBannerComponent, ScBrandsListComponent, ScCartAddProductsFromCsvDialogComponent, ScCartItemComponent, ScCategoryCardComponent, ScContactsAccordionComponent, ScContragentsAccordionComponent, ScContragentsAccordionItemComponent, ScDeliveryAddressAccordionComponent, ScDeliveryAddressAccordionItemComponent, ScDownloadPriceListComponent, ScEmailLinkDirective, ScErrorBlockStatusComponent, ScErrorHandlerComponent, ScFavoriteButtonComponent, ScFeedbackFormComponent, ScFocusFirstInvalidFieldDirective, ScFormatDatePipe, ScFrequentlyAskedQuestionsComponent, ScFrequentlyAskedQuestionsGroupSelectorComponent, ScFrequentlyAskedQuestionsWithGroupsComponent, ScGratitudeComponent, ScHelpNotificationService, ScHoverImageCarouselComponent, ScInputQuantityComponent, ScJsonLdCategoryComponent, ScLinks, ScManagerCardComponent, ScManagerCardPushComponent, ScNewContactFormComponent, ScNewContragentBankAccountsFormComponent, ScNewContragentFormComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNextInputFocusDirective, ScNotifyWhenInStockDialogComponent, ScOrderItemMobileComponent, ScPaymentStatusComponent, ScPersonalDataProcessingPolicyComponent, ScPhoneFormatPipe, ScPreviewSampleComponent, ScPreviewSamplesMosquitoComponent, ScPriceCardComponent, ScPriceCardInlineComponent, ScPriceHistoryComponent, ScPriceListPaginationComponent, ScPriceWarehouseStockComponent, ScPrivacyPolicyComponent, ScProductInAllWarehousesPipe, ScProfileAccordionsContentComponent, ScPublicOfferComponent, ScQRCodeDialogComponent, ScResetUserPasswordComponent, ScResourcePreviewComponent, ScSelectOnFocusinDirective, ScShareButtonComponent, ScSignInFormByEmailComponent, ScSignInFormByPhoneComponent, ScSignInFormComponent, ScSignUpFormComponent, ScSimpleSignUpFormComponent, ScSuggestionFieldComponent, ScTelLinkDirective, ScTerminalLinkDirective, ScUpdateUserInfoDialogComponent, ScUserManagersComponent, ScUserPhoneApproveDialogComponent, ScVerificationPhoneCheckFormComponent, TreeDirective, TreeIconService, TreeLoaderService, TreeTopDirective, phoneValidator, scAtLeastOneRequiredValidator, scBicValidator, scClientUiIconsName, scCorrespondentAccountValidator, scPasswordConfirmMatchingValidator, stepValidator, tuiDateValueTransformerDefaultProvider };
7750
7857
  //# sourceMappingURL=snabcentr-client-ui.mjs.map