@snabcentr/client-ui 4.6.1 → 4.7.0
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.
- package/cart/add-or-editing-cart-item-dialog/add-or-editing-cart-item-form/sc-add-or-editing-cart-item-form.component.d.ts +1 -5
- package/catalog/catalog-filters/collapsible/sc-catalog-filter-collapsible.component.d.ts +47 -0
- package/catalog/catalog-filters/index.d.ts +1 -0
- package/catalog/catalog-filters/sc-catalog-filters.component.d.ts +97 -19
- package/directives/abstract-price-card/abstract-sc-price-card.directive.d.ts +2 -2
- package/esm2022/cart/add-or-editing-cart-item-dialog/add-or-editing-cart-item-form/sc-add-or-editing-cart-item-form.component.mjs +7 -11
- package/esm2022/cart/add-or-editing-cart-item-dialog/sc-add-or-editing-cart-item-dialog.component.mjs +4 -5
- package/esm2022/catalog/catalog-filters/collapsible/sc-catalog-filter-collapsible.component.mjs +59 -0
- package/esm2022/catalog/catalog-filters/index.mjs +2 -1
- package/esm2022/catalog/catalog-filters/sc-catalog-filters.component.mjs +247 -58
- package/esm2022/catalog/price-card/sc-price-card.component.mjs +3 -3
- package/esm2022/catalog/price-card-inline/sc-price-card-inline.component.mjs +3 -3
- package/esm2022/dialogs/sc-resource-preview/sc-resource-preview.component.mjs +6 -1
- package/esm2022/directives/abstract-price-card/abstract-sc-price-card.directive.mjs +3 -3
- package/esm2022/order/index.mjs +5 -1
- package/esm2022/order/models/i-new-order-form.mjs +2 -0
- package/esm2022/order/order-direction-items/sc-order-direction-items.component.mjs +39 -0
- package/esm2022/order/order-form/sc-order-form.component.mjs +545 -0
- package/esm2022/order/order-form/sc-order-form.config.mjs +7 -0
- package/esm2022/order/order-item/sc-order-item.component.mjs +3 -3
- package/esm2022/order/order-items-list/sc-order-items-list.component.mjs +3 -4
- package/esm2022/providers/cleanup-recaptcha-artifacts.mjs +30 -0
- package/esm2022/providers/index.mjs +2 -1
- package/fesm2022/snabcentr-client-ui.mjs +916 -81
- package/fesm2022/snabcentr-client-ui.mjs.map +1 -1
- package/order/index.d.ts +4 -0
- package/order/models/i-new-order-form.d.ts +39 -0
- package/order/order-direction-items/sc-order-direction-items.component.d.ts +29 -0
- package/order/order-form/sc-order-form.component.d.ts +264 -0
- package/order/order-form/sc-order-form.config.d.ts +20 -0
- package/package.json +3 -2
- package/providers/cleanup-recaptcha-artifacts.d.ts +7 -0
- package/providers/index.d.ts +1 -0
- package/release_notes.tmp +2 -4
- package/styles/tailwind/tailwind.scss +26 -4
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, Injectable, NgZone, signal, EventEmitter, ChangeDetectorRef, Directive, Input, Output, Pipe, ElementRef, HostListener, Renderer2, ContentChildren, NgModule, input, computed, Component, ChangeDetectionStrategy, Inject, HostBinding, model, output, SkipSelf, DestroyRef, effect, ContentChild, ViewChild, viewChild, Optional, forwardRef } from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, Injectable, NgZone, signal, EventEmitter, ChangeDetectorRef, Directive, Input, Output, Pipe, ElementRef, HostListener, Renderer2, ContentChildren, NgModule, input, computed, Component, ChangeDetectionStrategy, Inject, HostBinding, model, output, SkipSelf, DestroyRef, effect, ContentChild, ViewChild, viewChild, Optional, contentChild, TemplateRef, forwardRef } from '@angular/core';
|
|
3
3
|
import * as i1 from '@snabcentr/client-core';
|
|
4
|
-
import { ScContactsService, ScUserService, ScLocationsService, ScAuthService, SEARCH_TERM, ScUnitsHelper, ScImageHelper, SC_PATH_IMAGE_NOT_FOUND, ScImage, ScPhoneService, ScUserMetrikaService, ScUserMetrikaGoalsEnum, IS_RUNNING_ON_TERMINAL, ScVCardService, ScVerificationService, ScISuggestionType, SC_MIN_LENGTH_SEARCH_TERM, ScConvertersService, ScOpfList, ScReferencesService, ScContragentService, ScBannerService, ScMediaImageTransformerPipe, ScCartService, ScUploadedFile, SC_ORDER_LOADER, ScMimeTypes, ScCatalogService, SC_URLS, IS_SERVER, ScWarehouseService, SEARCH_TERM_PROVIDERS, ScPaginationService, SC_NEXT_PAGE_PAGINATION_CLICK, SC_PRODUCT_PAGINATION_OPTIONS, ScCatalogFilterService, ScIdOrSlugPipe, SC_CATEGORY_INFO, ScConfiguratorService, RESPONSE, ScIconTypesEnum, ScDocumentInfoTypesEnum, ScOrderDraftsService, ScRouteKeys, ScSeoService, scOrderIsLoaded, ScFrequentlyAskedQuestionsService, SC_COMPANY_INFO, ScFeedbackService } from '@snabcentr/client-core';
|
|
4
|
+
import { ScContactsService, ScUserService, ScLocationsService, ScAuthService, SEARCH_TERM, ScUnitsHelper, ScImageHelper, SC_PATH_IMAGE_NOT_FOUND, ScImage, ScPhoneService, ScUserMetrikaService, ScUserMetrikaGoalsEnum, IS_RUNNING_ON_TERMINAL, ScVCardService, ScVerificationService, ScISuggestionType, SC_MIN_LENGTH_SEARCH_TERM, ScConvertersService, ScOpfList, ScReferencesService, ScContragentService, ScBannerService, ScMediaImageTransformerPipe, ScCartService, ScUploadedFile, loadingPlaceholder, SC_ORDER_LOADER, ScMimeTypes, ScCatalogService, SC_URLS, IS_SERVER, ScWarehouseService, SEARCH_TERM_PROVIDERS, ScPaginationService, SC_NEXT_PAGE_PAGINATION_CLICK, SC_PRODUCT_PAGINATION_OPTIONS, ScCatalogFilterService, ScIdOrSlugPipe, SC_CATEGORY_INFO, ScConfiguratorService, RESPONSE, ScIconTypesEnum, ScDocumentInfoTypesEnum, ScDeliveryAddressService, ScOrdersService, ScUIService, SC_USER_INFO as SC_USER_INFO$1, ScPaymentType, ScDeliveryType, TERMINAL_PROVIDERS, ScOrderDraftsService, ScRouteKeys, ScSeoService, scOrderIsLoaded, ScFrequentlyAskedQuestionsService, SC_COMPANY_INFO, ScFeedbackService } from '@snabcentr/client-core';
|
|
5
5
|
import * as i5$1 from 'rxjs';
|
|
6
|
-
import { EMPTY, BehaviorSubject, switchMap, of, shareReplay, map, Subject, filter, tap, catchError, finalize, startWith, share, timer, scan, takeWhile, endWith, distinctUntilChanged, debounceTime, throwError, combineLatest, Observable, pairwise, merge, skip, from, concatMap, noop, first } from 'rxjs';
|
|
6
|
+
import { EMPTY, BehaviorSubject, switchMap, of, shareReplay, map, Subject, filter, tap, catchError, finalize, startWith, share, timer, scan, takeWhile, endWith, distinctUntilChanged, debounceTime, throwError, combineLatest, Observable, pairwise, Subscription, merge, skip, from, concatMap, noop, first, retry } from 'rxjs';
|
|
7
7
|
import { WA_WINDOW } from '@ng-web-apis/common';
|
|
8
8
|
import { takeUntilDestroyed, toSignal, outputFromObservable, toObservable } from '@angular/core/rxjs-interop';
|
|
9
9
|
import * as i4$1 from '@taiga-ui/cdk';
|
|
10
|
-
import { TuiDay, TuiTime, TuiValueTransformer, TUI_IS_MOBILE, tuiControlValue, tuiIsPresent, tuiMarkControlAsTouchedAndValidate, tuiIsFalsy, TuiAutoFocus, TuiRepeatTimes, TuiHovered, TuiDayRange, TuiMonth, tuiPure, tuiProvide,
|
|
10
|
+
import { TuiDay, TuiTime, TuiValueTransformer, TUI_IS_MOBILE, tuiControlValue, tuiIsPresent, tuiMarkControlAsTouchedAndValidate, tuiIsFalsy, TuiAutoFocus, TuiRepeatTimes, TuiHovered, TuiDayRange, TuiMonth, tuiPure, tuiProvide, TuiValidationError, TUI_WINDOW_SIZE, TUI_TRUE_HANDLER } from '@taiga-ui/cdk';
|
|
11
11
|
import * as i2$1 from '@taiga-ui/kit';
|
|
12
|
-
import { TUI_DATE_VALUE_TRANSFORMER, TuiPreview, TuiAvatar, TuiAccordionItem, TuiElasticContainer, TuiAccordion, TuiFieldErrorPipe, TuiFilterByInputPipe, TuiStringifyContentPipe, TuiDataListWrapper, TuiButtonLoading, TuiSortCountriesPipe, TuiStepper, TuiCarousel, TuiPush, TuiCheckbox, TuiFiles, TuiChip, TuiInputNumber, TuiBadge, TuiTooltip, TuiHighlight, TuiLineClamp,
|
|
12
|
+
import { TUI_DATE_VALUE_TRANSFORMER, TuiPreview, TuiAvatar, TuiAccordionItem, TuiElasticContainer, TuiAccordion, TuiFieldErrorPipe, TuiFilterByInputPipe, TuiStringifyContentPipe, TuiDataListWrapper, TuiButtonLoading, TuiSortCountriesPipe, TuiStepper, TuiCarousel, TuiPush, TuiCheckbox, TuiFiles, TuiChip, TuiInputNumber, TuiBadge, TuiTooltip, TuiHighlight, TuiLineClamp, TuiFade, TuiRange, tuiInputNumberOptionsProvider, TuiDataListWrapperComponent, TuiChevron, TuiSelect, TuiInputSlider, TuiTreeService, TuiTreeItemContent, TUI_TREE_START, TUI_TREE_CONTENT, TUI_TREE_LOADING, TUI_TREE_LOADER, TuiTree, TuiPreviewDialogService, tuiFilesAccepted, TuiInputFiles, TuiInputFilesDirective, TuiFilesComponent, TuiFile, TuiFileRejectedPipe, TUI_CONFIRM, tuiItemsHandlersProvider as tuiItemsHandlersProvider$1, TuiPagination, TuiAccordionDirective, TuiAccordionItemContent } from '@taiga-ui/kit';
|
|
13
13
|
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
|
|
14
14
|
import * as i1$1 from '@angular/forms';
|
|
15
15
|
import { FormControl, FormGroupDirective, NgControl, FormGroup, Validators, FormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
16
16
|
import * as i1$2 from '@taiga-ui/core';
|
|
17
|
-
import { TuiButton, TuiDialog, TuiDialogService, TuiLink, TuiFallbackSrcPipe, TuiInitialsPipe, TuiIcon, TuiAppearance, TuiWithAppearance, TuiIcons, TuiWithIcons, TUI_DATA_LIST_HOST, tuiDropdownOptionsProvider, TuiLabel, TuiError, TuiLoader, TuiDataList, TuiNotification, TuiTextfield, TuiTitle, TuiNumberFormat, TuiHint, TUI_MONTHS, tuiNumberFormatProvider, tuiItemsHandlersProvider, tuiTextfieldOptionsProvider, tuiHintOptionsProvider, TuiFormatNumberPipe, TuiHintDriver, TuiHintHover, TuiHintPosition, TuiHintDirective, TUI_BUTTON_OPTIONS, TUI_BUTTON_DEFAULT_OPTIONS,
|
|
17
|
+
import { TuiButton, TuiDialog, TuiDialogService, TuiLink, TuiFallbackSrcPipe, TuiInitialsPipe, TuiIcon, TuiAppearance, TuiWithAppearance, TuiIcons, TuiWithIcons, TUI_DATA_LIST_HOST, tuiDropdownOptionsProvider, TuiLabel, TuiError, TuiLoader, TuiDataList, TuiNotification, TuiTextfield, TuiTitle, TuiNumberFormat, TuiHint, TUI_MONTHS, TuiScrollbar, tuiNumberFormatProvider, tuiItemsHandlersProvider, tuiTextfieldOptionsProvider, tuiHintOptionsProvider, TuiFormatNumberPipe, TuiHintDriver, TuiHintHover, TuiHintPosition, TuiHintDirective, TuiDataListComponent, TuiOption, TUI_BUTTON_OPTIONS, TUI_BUTTON_DEFAULT_OPTIONS, TuiSurface, tuiFadeIn } from '@taiga-ui/core';
|
|
18
18
|
import { isValidPhoneNumber } from 'libphonenumber-js/max';
|
|
19
19
|
import * as i4 from '@taiga-ui/legacy/components/primitive-textfield';
|
|
20
20
|
import * as i3 from '@taiga-ui/legacy';
|
|
21
|
-
import { AbstractTuiControl, TuiInputModule, TuiTextfieldControllerModule, TuiComboBoxModule, TuiInputPhoneModule, TuiSelectModule, TuiInputPasswordModule, AbstractTuiNullableControl, TuiInputNumberComponent, TuiInputNumberModule, TuiIslandDirective, TuiTextareaModule } from '@taiga-ui/legacy';
|
|
21
|
+
import { AbstractTuiControl, TuiInputModule, TuiTextfieldControllerModule, TuiComboBoxModule, TuiInputPhoneModule, TuiSelectModule, TuiInputPasswordModule, AbstractTuiNullableControl, TuiInputNumberComponent, TuiInputNumberModule, TuiIslandDirective, TuiInputDateModule, TuiTextareaModule } from '@taiga-ui/legacy';
|
|
22
22
|
import { getCountries } from 'libphonenumber-js';
|
|
23
|
-
import { isNil, isUndefined, isObject } from 'lodash-es';
|
|
23
|
+
import { isNil, isUndefined, isObject, isArray, isString } from 'lodash-es';
|
|
24
24
|
import * as i5 from '@taiga-ui/core/components/label';
|
|
25
25
|
import * as i8 from '@maskito/angular';
|
|
26
26
|
import { MaskitoDirective } from '@maskito/angular';
|
|
27
27
|
import * as i2$2 from '@angular/common';
|
|
28
|
-
import { DOCUMENT, CommonModule, NgIf, AsyncPipe, DecimalPipe, NgFor, NgClass } from '@angular/common';
|
|
28
|
+
import { DOCUMENT, CommonModule, NgIf, AsyncPipe, NgTemplateOutlet, DecimalPipe, NgFor, NgClass } from '@angular/common';
|
|
29
29
|
import * as i2$3 from '@taiga-ui/polymorpheus';
|
|
30
30
|
import { POLYMORPHEUS_CONTEXT, PolymorpheusComponent, PolymorpheusTemplate, PolymorpheusOutlet, injectContext } from '@taiga-ui/polymorpheus';
|
|
31
31
|
import * as i2 from 'angularx-qrcode';
|
|
@@ -33,6 +33,7 @@ import { QRCodeModule } from 'angularx-qrcode';
|
|
|
33
33
|
import * as i1$3 from '@taiga-ui/experimental';
|
|
34
34
|
import { TuiInputPhoneInternational, TuiAccordion as TuiAccordion$1 } from '@taiga-ui/experimental';
|
|
35
35
|
import * as i3$1 from '@taiga-ui/core/components/data-list';
|
|
36
|
+
import { TuiDataListDirective } from '@taiga-ui/core/components/data-list';
|
|
36
37
|
import * as i1$4 from '@taiga-ui/cdk/directives/item';
|
|
37
38
|
import * as i3$2 from '@ng-web-apis/intersection-observer';
|
|
38
39
|
import { IntersectionObserverService, WaIntersectionObserver } from '@ng-web-apis/intersection-observer';
|
|
@@ -46,10 +47,11 @@ import { TuiCardLarge, TuiBlockStatus, TuiHeader } from '@taiga-ui/layout';
|
|
|
46
47
|
import { __decorate } from 'tslib';
|
|
47
48
|
import * as i4$2 from '@taiga-ui/addon-charts';
|
|
48
49
|
import { TuiLineDaysChart, TuiLineDaysChartHint, TuiAxes } from '@taiga-ui/addon-charts';
|
|
49
|
-
import * as i2$5 from '@taiga-ui/experimental/components/expand';
|
|
50
50
|
import * as i5$2 from '@taiga-ui/kit/components/slider';
|
|
51
51
|
import * as i9 from 'angular8-yandex-maps';
|
|
52
52
|
import { AngularYandexMapsModule } from 'angular8-yandex-maps';
|
|
53
|
+
import { isValid, parse, format } from 'date-fns';
|
|
54
|
+
import * as i2$5 from '@taiga-ui/experimental/components/expand';
|
|
53
55
|
import * as i3$3 from '@taiga-ui/kit/components/data-list-wrapper';
|
|
54
56
|
import { TuiGroup } from '@taiga-ui/core/directives/group';
|
|
55
57
|
import * as i4$3 from 'ng-recaptcha-2';
|
|
@@ -346,6 +348,36 @@ const SC_HIDDEN_PRINT_ELEMENTS = new InjectionToken('SC_HIDDEN_PRINT_ELEMENTS',
|
|
|
346
348
|
providedIn: 'root',
|
|
347
349
|
});
|
|
348
350
|
|
|
351
|
+
/**
|
|
352
|
+
* Селектор iframe reCAPTCHA.
|
|
353
|
+
*/
|
|
354
|
+
const RECAPTCHA_IFRAME_SELECTOR = 'iframe[src*="recaptcha"]';
|
|
355
|
+
/**
|
|
356
|
+
* Селектор хоста reCAPTCHA.
|
|
357
|
+
*/
|
|
358
|
+
const RECAPTCHA_HOST_SELECTOR = 're-captcha';
|
|
359
|
+
/**
|
|
360
|
+
* Освобождает ресурсы reCAPTCHA и удаляет осиротевшие iframe после смены маршрута.
|
|
361
|
+
*
|
|
362
|
+
* @param documentReference Объект документа.
|
|
363
|
+
* @param windowReference Объект окна браузера.
|
|
364
|
+
*/
|
|
365
|
+
function cleanupRecaptchaArtifacts(documentReference, windowReference) {
|
|
366
|
+
const windowWithRecaptcha = windowReference;
|
|
367
|
+
try {
|
|
368
|
+
windowWithRecaptcha.grecaptcha?.reset();
|
|
369
|
+
}
|
|
370
|
+
catch {
|
|
371
|
+
// Ошибки reCAPTCHA не должны блокировать навигацию.
|
|
372
|
+
}
|
|
373
|
+
documentReference.querySelectorAll(RECAPTCHA_IFRAME_SELECTOR).forEach((iframe) => {
|
|
374
|
+
if (iframe.closest(RECAPTCHA_HOST_SELECTOR)) {
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
iframe.remove();
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
|
|
349
381
|
/**
|
|
350
382
|
* Сервис по работе с печатью страницы.
|
|
351
383
|
*/
|
|
@@ -535,9 +567,9 @@ class AbstractScPriceCard {
|
|
|
535
567
|
*/
|
|
536
568
|
this.autoFocuseQuantityInput = signal(false);
|
|
537
569
|
/**
|
|
538
|
-
*
|
|
570
|
+
* Класс-помощник для работы со значениями единиц измерения товара.
|
|
539
571
|
*/
|
|
540
|
-
this.
|
|
572
|
+
this.ScUnitsHelper = ScUnitsHelper;
|
|
541
573
|
/**
|
|
542
574
|
* Хелпер для работы с изображениями товара.
|
|
543
575
|
*/
|
|
@@ -4214,11 +4246,11 @@ class ScAddOrEditingCartItemFormComponent {
|
|
|
4214
4246
|
/**
|
|
4215
4247
|
* Признак возможности продажи товара на метраж.
|
|
4216
4248
|
*/
|
|
4217
|
-
this.productIsMeasurable = computed(() =>
|
|
4249
|
+
this.productIsMeasurable = computed(() => ScUnitsHelper.productIsMeasurable(this.product()));
|
|
4218
4250
|
/**
|
|
4219
4251
|
* Кратность количества для товара.
|
|
4220
4252
|
*/
|
|
4221
|
-
this.productMultiplicity = computed(() =>
|
|
4253
|
+
this.productMultiplicity = computed(() => ScUnitsHelper.getProductMultiplicity(this.product()));
|
|
4222
4254
|
/**
|
|
4223
4255
|
* Минимальный метраж для товара.
|
|
4224
4256
|
*/
|
|
@@ -4230,7 +4262,7 @@ class ScAddOrEditingCartItemFormComponent {
|
|
|
4230
4262
|
/**
|
|
4231
4263
|
* Шаг изменения метража.
|
|
4232
4264
|
*/
|
|
4233
|
-
this.lengthStep = computed(() =>
|
|
4265
|
+
this.lengthStep = computed(() => ScUnitsHelper.getProductLengthMultiplicity(this.product()));
|
|
4234
4266
|
/**
|
|
4235
4267
|
* Подсказка по минимальному и максимальному метражу товара.
|
|
4236
4268
|
*/
|
|
@@ -4248,10 +4280,6 @@ class ScAddOrEditingCartItemFormComponent {
|
|
|
4248
4280
|
* {@link Output} события редактирования товара в корзине.
|
|
4249
4281
|
*/
|
|
4250
4282
|
this.editCartItem = output();
|
|
4251
|
-
/**
|
|
4252
|
-
* Объект-помощник для работы со значениями единиц измерения товара.
|
|
4253
|
-
*/
|
|
4254
|
-
this.unitsHelper = inject(ScUnitsHelper);
|
|
4255
4283
|
/**
|
|
4256
4284
|
* Сервис для сбора метрик о действиях пользователей.
|
|
4257
4285
|
*/
|
|
@@ -4273,7 +4301,7 @@ class ScAddOrEditingCartItemFormComponent {
|
|
|
4273
4301
|
}
|
|
4274
4302
|
// Устанавливаем количество из корзины или кратности товара.
|
|
4275
4303
|
this.form.patchValue({
|
|
4276
|
-
quantity: this.orderItem()?.quantity ??
|
|
4304
|
+
quantity: this.orderItem()?.quantity ?? ScUnitsHelper.getProductMultiplicity(this.product()),
|
|
4277
4305
|
marker: this.orderItem()?.marker ?? '',
|
|
4278
4306
|
});
|
|
4279
4307
|
const step = this.lengthStep();
|
|
@@ -4282,9 +4310,9 @@ class ScAddOrEditingCartItemFormComponent {
|
|
|
4282
4310
|
this.form.controls.length?.patchValue(this.form.controls.quantity.value * step);
|
|
4283
4311
|
}
|
|
4284
4312
|
// Добавляем валидацию шага для количества.
|
|
4285
|
-
this.form.controls.quantity.addValidators(stepValidator(
|
|
4313
|
+
this.form.controls.quantity.addValidators(stepValidator(ScUnitsHelper.getProductMultiplicity(this.product())));
|
|
4286
4314
|
// Добавляем валидацию шага для длины.
|
|
4287
|
-
this.form.get('length')?.addValidators(stepValidator(
|
|
4315
|
+
this.form.get('length')?.addValidators(stepValidator(ScUnitsHelper.getProductLengthMultiplicity(this.product())));
|
|
4288
4316
|
// Считаем итоговую стоимость заказа.
|
|
4289
4317
|
this.totalCost$ = tuiControlValue(this.form).pipe(debounceTime(0), // Исправляем ошибку NG0950.
|
|
4290
4318
|
filter(() => this.form.valid), distinctUntilChanged((previous, current) => previous.length === current.length && previous.quantity === current.quantity), // Только при изменении значений
|
|
@@ -4428,11 +4456,11 @@ class ScAddOrEditingCartItemDialogComponent {
|
|
|
4428
4456
|
this.formComponent().form.markAsDirty();
|
|
4429
4457
|
}
|
|
4430
4458
|
return of();
|
|
4431
|
-
})
|
|
4459
|
+
}), startWith(loadingPlaceholder))), share());
|
|
4432
4460
|
/**
|
|
4433
4461
|
* {@link Observable} изменения состояния загрузки данных.
|
|
4434
4462
|
*/
|
|
4435
|
-
this.loading = toSignal(this.submit$.pipe(map(
|
|
4463
|
+
this.loading = toSignal(this.submit$.pipe(map((data) => data === loadingPlaceholder)), { initialValue: false });
|
|
4436
4464
|
/**
|
|
4437
4465
|
* Контекст диалогового окна.
|
|
4438
4466
|
*/
|
|
@@ -5262,7 +5290,7 @@ class ScPriceCardComponent extends AbstractScPriceCard {
|
|
|
5262
5290
|
}
|
|
5263
5291
|
}
|
|
5264
5292
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScPriceCardComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5265
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ScPriceCardComponent, isStandalone: true, selector: "sc-price-card", inputs: { size: "size" }, host: { properties: { "attr.data-size": "this.size" } }, providers: [SEARCH_TERM_PROVIDERS], usesInheritance: true, ngImport: i0, template: "<div\n *ngIf=\"product; else skeleton\"\n class=\"card-wrapper relative flex h-full w-auto flex-col rounded-xl p-1\"\n>\n <sc-noindex-wrapper>\n <div class=\"flex min-h-8 items-center justify-between\">\n <span\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"code text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </span>\n\n <div class=\"flex items-center\">\n <tui-icon\n *ngIf=\"product.isPreviouslyOrdered\"\n icon=\"@tui.history\"\n class=\"text-lg\"\n [style.color]=\"'var(--tui-text-action)'\"\n />\n <sc-favorite-button\n *ngIf=\"authStatus$ | async\"\n (clickEvent)=\"clickFavoriteEvent.emit()\"\n [showLoader]=\"favoriteShowLoader()\"\n [isFavorite]=\"product.isFavorite\"\n [disabled]=\"!!product.primaryCategory?.isFavorite\"\n />\n </div>\n </div>\n </sc-noindex-wrapper>\n\n <sc-hover-image-carousel\n (click)=\"clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n class=\"cursor-pointer\"\n />\n\n <div\n class=\"flex grow flex-col justify-end\"\n [class.gap-1]=\"size === 'm'\"\n >\n <div\n class=\"flex grow flex-col\"\n [class.gap-1]=\"size === 'm'\"\n >\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n class=\"name mb-auto\"\n >\n {{ product.name }}\n </a>\n\n <sc-noindex-wrapper>\n <span\n *ngIf=\"product.supplierSku\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }}\n </span>\n\n <div\n *ngIf=\"product?.pack\"\n class=\"flex items-center gap-1 text-tui-text-02\"\n >\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n <tui-icon\n *ngIf=\"product.ignoreMinCountCheck\"\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n tuiHintDirection=\"top\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n </div>\n </sc-noindex-wrapper>\n\n <sc-cost-with-discount\n [product]=\"product\"\n [size]=\"size\"\n />\n\n <sc-noindex-wrapper>\n <sc-price-warehouse-stock [product]=\"product\" />\n </sc-noindex-wrapper>\n </div>\n\n <sc-noindex-wrapper>\n <div class=\"mt-2 flex gap-2\">\n <button\n *ngIf=\"!showQuantityControl\"\n tuiButton\n (click)=\"clickAddToCartEvent.emit(product)\"\n [loading]=\"showLoader()\"\n [size]=\"getToCartButtonSize()\"\n class=\"grow !font-extrabold\"\n iconStart=\"@tui.shopping-cart\"\n >\n \u0412 \u043A\u043E\u0440\u0437\u0438\u043D\u0443\n </button>\n <sc-input-quantity\n #inputQuantity\n *ngIf=\"showQuantityControl\"\n [formControl]=\"quantityControl\"\n [size]=\"size\"\n [step]=\"
|
|
5293
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ScPriceCardComponent, isStandalone: true, selector: "sc-price-card", inputs: { size: "size" }, host: { properties: { "attr.data-size": "this.size" } }, providers: [SEARCH_TERM_PROVIDERS], usesInheritance: true, ngImport: i0, template: "<div\n *ngIf=\"product; else skeleton\"\n class=\"card-wrapper relative flex h-full w-auto flex-col rounded-xl p-1\"\n>\n <sc-noindex-wrapper>\n <div class=\"flex min-h-8 items-center justify-between\">\n <span\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"code text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </span>\n\n <div class=\"flex items-center\">\n <tui-icon\n *ngIf=\"product.isPreviouslyOrdered\"\n icon=\"@tui.history\"\n class=\"text-lg\"\n [style.color]=\"'var(--tui-text-action)'\"\n />\n <sc-favorite-button\n *ngIf=\"authStatus$ | async\"\n (clickEvent)=\"clickFavoriteEvent.emit()\"\n [showLoader]=\"favoriteShowLoader()\"\n [isFavorite]=\"product.isFavorite\"\n [disabled]=\"!!product.primaryCategory?.isFavorite\"\n />\n </div>\n </div>\n </sc-noindex-wrapper>\n\n <sc-hover-image-carousel\n (click)=\"clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n class=\"cursor-pointer\"\n />\n\n <div\n class=\"flex grow flex-col justify-end\"\n [class.gap-1]=\"size === 'm'\"\n >\n <div\n class=\"flex grow flex-col\"\n [class.gap-1]=\"size === 'm'\"\n >\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n class=\"name mb-auto\"\n >\n {{ product.name }}\n </a>\n\n <sc-noindex-wrapper>\n <span\n *ngIf=\"product.supplierSku\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }}\n </span>\n\n <div\n *ngIf=\"product?.pack\"\n class=\"flex items-center gap-1 text-tui-text-02\"\n >\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n <tui-icon\n *ngIf=\"product.ignoreMinCountCheck\"\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n tuiHintDirection=\"top\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n </div>\n </sc-noindex-wrapper>\n\n <sc-cost-with-discount\n [product]=\"product\"\n [size]=\"size\"\n />\n\n <sc-noindex-wrapper>\n <sc-price-warehouse-stock [product]=\"product\" />\n </sc-noindex-wrapper>\n </div>\n\n <sc-noindex-wrapper>\n <div class=\"mt-2 flex gap-2\">\n <button\n *ngIf=\"!showQuantityControl\"\n tuiButton\n (click)=\"clickAddToCartEvent.emit(product)\"\n [loading]=\"showLoader()\"\n [size]=\"getToCartButtonSize()\"\n class=\"grow !font-extrabold\"\n iconStart=\"@tui.shopping-cart\"\n >\n \u0412 \u043A\u043E\u0440\u0437\u0438\u043D\u0443\n </button>\n <sc-input-quantity\n #inputQuantity\n *ngIf=\"showQuantityControl\"\n [formControl]=\"quantityControl\"\n [size]=\"size\"\n [step]=\"ScUnitsHelper.getProductMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"showLoader()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-full\"\n />\n <tui-avatar\n *ngIf=\"orderItem && !showQuantityControl\"\n src=\"@tui.check\"\n size=\"s\"\n [style.background]=\"'var(--tui-status-warning-pale)'\"\n [style.color]=\"'var(--tui-background-accent-1)'\"\n />\n </div>\n </sc-noindex-wrapper>\n </div>\n</div>\n\n<ng-template #skeleton>\n <div class=\"card-wrapper relative flex h-full w-auto flex-col rounded-xl p-1\"></div>\n</ng-template>\n", styles: [":host tui-badge{--t-padding: .25rem !important}:host .name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}:host[data-size=s] .card-wrapper{font-size:.6875rem;line-height:1rem;font-weight:500}:host[data-size=s] .card-wrapper .name,:host[data-size=s] .card-wrapper .cost{font-size:.8125rem;line-height:1.25rem;font-weight:800}:host[data-size=m] .card-wrapper{font-size:.8125rem;line-height:1.25rem;font-weight:500}:host[data-size=m] .card-wrapper .name,:host[data-size=m] .card-wrapper .cost{font-size:.9375rem;line-height:1.5rem;font-weight:800}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2$2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon", inputs: ["icon", "background"] }, { kind: "directive", type: i1$2.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: TuiHighlight, selector: "[tuiHighlight]", inputs: ["tuiHighlight", "tuiHighlightColor"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: TuiAvatar, selector: "tui-avatar,button[tuiAvatar],a[tuiAvatar]", inputs: ["size", "round", "src"] }, { kind: "component", type: ScHoverImageCarouselComponent, selector: "sc-hover-image-carousel", inputs: ["images", "isShowActions", "productName"] }, { kind: "component", type: CostWithDiscountComponent, selector: "sc-cost-with-discount", inputs: ["product", "size"] }, { kind: "component", type: ScPriceWarehouseStockComponent, selector: "sc-price-warehouse-stock", inputs: ["classList", "product", "withStockHint", "fromMain"] }, { kind: "component", type: ScFavoriteButtonComponent, selector: "sc-favorite-button", inputs: ["isFavorite", "showLoader", "disabled"], outputs: ["clickEvent"] }, { kind: "component", type: ScInputQuantityComponent, selector: "sc-input-quantity", inputs: ["step", "showLoader", "showCross", "ignoreStepValidators", "appearance", "isDisabled", "size"], outputs: ["clickClearEvent"] }, { kind: "component", type: ScNoindexWrapperComponent, selector: "sc-noindex-wrapper" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5266
5294
|
}
|
|
5267
5295
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScPriceCardComponent, decorators: [{
|
|
5268
5296
|
type: Component,
|
|
@@ -5283,7 +5311,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
5283
5311
|
ScFavoriteButtonComponent,
|
|
5284
5312
|
ScInputQuantityComponent,
|
|
5285
5313
|
ScNoindexWrapperComponent,
|
|
5286
|
-
], template: "<div\n *ngIf=\"product; else skeleton\"\n class=\"card-wrapper relative flex h-full w-auto flex-col rounded-xl p-1\"\n>\n <sc-noindex-wrapper>\n <div class=\"flex min-h-8 items-center justify-between\">\n <span\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"code text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </span>\n\n <div class=\"flex items-center\">\n <tui-icon\n *ngIf=\"product.isPreviouslyOrdered\"\n icon=\"@tui.history\"\n class=\"text-lg\"\n [style.color]=\"'var(--tui-text-action)'\"\n />\n <sc-favorite-button\n *ngIf=\"authStatus$ | async\"\n (clickEvent)=\"clickFavoriteEvent.emit()\"\n [showLoader]=\"favoriteShowLoader()\"\n [isFavorite]=\"product.isFavorite\"\n [disabled]=\"!!product.primaryCategory?.isFavorite\"\n />\n </div>\n </div>\n </sc-noindex-wrapper>\n\n <sc-hover-image-carousel\n (click)=\"clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n class=\"cursor-pointer\"\n />\n\n <div\n class=\"flex grow flex-col justify-end\"\n [class.gap-1]=\"size === 'm'\"\n >\n <div\n class=\"flex grow flex-col\"\n [class.gap-1]=\"size === 'm'\"\n >\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n class=\"name mb-auto\"\n >\n {{ product.name }}\n </a>\n\n <sc-noindex-wrapper>\n <span\n *ngIf=\"product.supplierSku\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }}\n </span>\n\n <div\n *ngIf=\"product?.pack\"\n class=\"flex items-center gap-1 text-tui-text-02\"\n >\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n <tui-icon\n *ngIf=\"product.ignoreMinCountCheck\"\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n tuiHintDirection=\"top\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n </div>\n </sc-noindex-wrapper>\n\n <sc-cost-with-discount\n [product]=\"product\"\n [size]=\"size\"\n />\n\n <sc-noindex-wrapper>\n <sc-price-warehouse-stock [product]=\"product\" />\n </sc-noindex-wrapper>\n </div>\n\n <sc-noindex-wrapper>\n <div class=\"mt-2 flex gap-2\">\n <button\n *ngIf=\"!showQuantityControl\"\n tuiButton\n (click)=\"clickAddToCartEvent.emit(product)\"\n [loading]=\"showLoader()\"\n [size]=\"getToCartButtonSize()\"\n class=\"grow !font-extrabold\"\n iconStart=\"@tui.shopping-cart\"\n >\n \u0412 \u043A\u043E\u0440\u0437\u0438\u043D\u0443\n </button>\n <sc-input-quantity\n #inputQuantity\n *ngIf=\"showQuantityControl\"\n [formControl]=\"quantityControl\"\n [size]=\"size\"\n [step]=\"
|
|
5314
|
+
], template: "<div\n *ngIf=\"product; else skeleton\"\n class=\"card-wrapper relative flex h-full w-auto flex-col rounded-xl p-1\"\n>\n <sc-noindex-wrapper>\n <div class=\"flex min-h-8 items-center justify-between\">\n <span\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"code text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </span>\n\n <div class=\"flex items-center\">\n <tui-icon\n *ngIf=\"product.isPreviouslyOrdered\"\n icon=\"@tui.history\"\n class=\"text-lg\"\n [style.color]=\"'var(--tui-text-action)'\"\n />\n <sc-favorite-button\n *ngIf=\"authStatus$ | async\"\n (clickEvent)=\"clickFavoriteEvent.emit()\"\n [showLoader]=\"favoriteShowLoader()\"\n [isFavorite]=\"product.isFavorite\"\n [disabled]=\"!!product.primaryCategory?.isFavorite\"\n />\n </div>\n </div>\n </sc-noindex-wrapper>\n\n <sc-hover-image-carousel\n (click)=\"clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n class=\"cursor-pointer\"\n />\n\n <div\n class=\"flex grow flex-col justify-end\"\n [class.gap-1]=\"size === 'm'\"\n >\n <div\n class=\"flex grow flex-col\"\n [class.gap-1]=\"size === 'm'\"\n >\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n class=\"name mb-auto\"\n >\n {{ product.name }}\n </a>\n\n <sc-noindex-wrapper>\n <span\n *ngIf=\"product.supplierSku\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }}\n </span>\n\n <div\n *ngIf=\"product?.pack\"\n class=\"flex items-center gap-1 text-tui-text-02\"\n >\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n <tui-icon\n *ngIf=\"product.ignoreMinCountCheck\"\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n tuiHintDirection=\"top\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n </div>\n </sc-noindex-wrapper>\n\n <sc-cost-with-discount\n [product]=\"product\"\n [size]=\"size\"\n />\n\n <sc-noindex-wrapper>\n <sc-price-warehouse-stock [product]=\"product\" />\n </sc-noindex-wrapper>\n </div>\n\n <sc-noindex-wrapper>\n <div class=\"mt-2 flex gap-2\">\n <button\n *ngIf=\"!showQuantityControl\"\n tuiButton\n (click)=\"clickAddToCartEvent.emit(product)\"\n [loading]=\"showLoader()\"\n [size]=\"getToCartButtonSize()\"\n class=\"grow !font-extrabold\"\n iconStart=\"@tui.shopping-cart\"\n >\n \u0412 \u043A\u043E\u0440\u0437\u0438\u043D\u0443\n </button>\n <sc-input-quantity\n #inputQuantity\n *ngIf=\"showQuantityControl\"\n [formControl]=\"quantityControl\"\n [size]=\"size\"\n [step]=\"ScUnitsHelper.getProductMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"showLoader()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-full\"\n />\n <tui-avatar\n *ngIf=\"orderItem && !showQuantityControl\"\n src=\"@tui.check\"\n size=\"s\"\n [style.background]=\"'var(--tui-status-warning-pale)'\"\n [style.color]=\"'var(--tui-background-accent-1)'\"\n />\n </div>\n </sc-noindex-wrapper>\n </div>\n</div>\n\n<ng-template #skeleton>\n <div class=\"card-wrapper relative flex h-full w-auto flex-col rounded-xl p-1\"></div>\n</ng-template>\n", styles: [":host tui-badge{--t-padding: .25rem !important}:host .name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}:host[data-size=s] .card-wrapper{font-size:.6875rem;line-height:1rem;font-weight:500}:host[data-size=s] .card-wrapper .name,:host[data-size=s] .card-wrapper .cost{font-size:.8125rem;line-height:1.25rem;font-weight:800}:host[data-size=m] .card-wrapper{font-size:.8125rem;line-height:1.25rem;font-weight:500}:host[data-size=m] .card-wrapper .name,:host[data-size=m] .card-wrapper .cost{font-size:.9375rem;line-height:1.5rem;font-weight:800}\n"] }]
|
|
5287
5315
|
}], propDecorators: { size: [{
|
|
5288
5316
|
type: Input
|
|
5289
5317
|
}, {
|
|
@@ -5300,7 +5328,7 @@ class ScPriceCardInlineComponent extends AbstractScPriceCard {
|
|
|
5300
5328
|
this.type = input('catalogItem');
|
|
5301
5329
|
}
|
|
5302
5330
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScPriceCardInlineComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5303
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: ScPriceCardInlineComponent, isStandalone: true, selector: "sc-price-card-inline", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, providers: [SEARCH_TERM_PROVIDERS], usesInheritance: true, ngImport: i0, template: "<div\n *ngIf=\"product; else skeleton\"\n class=\"card-wrapper relative flex w-full gap-4 rounded-xl p-1 hover:bg-tui-background-neutral-1\"\n>\n <sc-hover-image-carousel\n (click)=\"clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"size-24 shrink-0 cursor-pointer self-center\"\n />\n <div class=\"flex grow flex-col gap-1\">\n <sc-noindex-wrapper>\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n </sc-noindex-wrapper>\n\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n\n <sc-noindex-wrapper>\n <span\n *ngIf=\"product.supplierSku\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }}\n </span>\n\n <div\n *ngIf=\"product?.pack\"\n class=\"flex items-center gap-1 text-tui-text-02\"\n >\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n <tui-icon\n *ngIf=\"product.ignoreMinCountCheck\"\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n </div>\n </sc-noindex-wrapper>\n\n <sc-cost-with-discount [product]=\"product\" />\n\n <sc-noindex-wrapper>\n <sc-price-warehouse-stock [product]=\"product\" />\n </sc-noindex-wrapper>\n </div>\n </div>\n\n <sc-noindex-wrapper>\n <div class=\"flex w-40 shrink-0 flex-col justify-between\">\n <div class=\"flex justify-end\">\n <tui-avatar\n *ngIf=\"product.isPreviouslyOrdered\"\n src=\"@tui.history\"\n size=\"s\"\n [style.background]=\"'none'\"\n [style.color]=\"'var(--tui-text-action)'\"\n />\n <sc-favorite-button\n *ngIf=\"authStatus$ | async\"\n (clickEvent)=\"clickFavoriteEvent.emit()\"\n [showLoader]=\"favoriteShowLoader()\"\n [isFavorite]=\"product.isFavorite\"\n [disabled]=\"!!product.primaryCategory?.isFavorite\"\n />\n </div>\n <div class=\"flex gap-2\">\n <button\n *ngIf=\"!showQuantityControl\"\n tuiButton\n (click)=\"clickAddToCartEvent.emit(product)\"\n [loading]=\"showLoader()\"\n size=\"s\"\n iconStart=\"@tui.shopping-cart\"\n class=\"grow !font-extrabold\"\n >\n \u0412 \u043A\u043E\u0440\u0437\u0438\u043D\u0443\n </button>\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n *ngIf=\"showQuantityControl\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [step]=\"
|
|
5331
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: ScPriceCardInlineComponent, isStandalone: true, selector: "sc-price-card-inline", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, providers: [SEARCH_TERM_PROVIDERS], usesInheritance: true, ngImport: i0, template: "<div\n *ngIf=\"product; else skeleton\"\n class=\"card-wrapper relative flex w-full gap-4 rounded-xl p-1 hover:bg-tui-background-neutral-1\"\n>\n <sc-hover-image-carousel\n (click)=\"clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"size-24 shrink-0 cursor-pointer self-center\"\n />\n <div class=\"flex grow flex-col gap-1\">\n <sc-noindex-wrapper>\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n </sc-noindex-wrapper>\n\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n\n <sc-noindex-wrapper>\n <span\n *ngIf=\"product.supplierSku\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }}\n </span>\n\n <div\n *ngIf=\"product?.pack\"\n class=\"flex items-center gap-1 text-tui-text-02\"\n >\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n <tui-icon\n *ngIf=\"product.ignoreMinCountCheck\"\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n </div>\n </sc-noindex-wrapper>\n\n <sc-cost-with-discount [product]=\"product\" />\n\n <sc-noindex-wrapper>\n <sc-price-warehouse-stock [product]=\"product\" />\n </sc-noindex-wrapper>\n </div>\n </div>\n\n <sc-noindex-wrapper>\n <div class=\"flex w-40 shrink-0 flex-col justify-between\">\n <div class=\"flex justify-end\">\n <tui-avatar\n *ngIf=\"product.isPreviouslyOrdered\"\n src=\"@tui.history\"\n size=\"s\"\n [style.background]=\"'none'\"\n [style.color]=\"'var(--tui-text-action)'\"\n />\n <sc-favorite-button\n *ngIf=\"authStatus$ | async\"\n (clickEvent)=\"clickFavoriteEvent.emit()\"\n [showLoader]=\"favoriteShowLoader()\"\n [isFavorite]=\"product.isFavorite\"\n [disabled]=\"!!product.primaryCategory?.isFavorite\"\n />\n </div>\n <div class=\"flex gap-2\">\n <button\n *ngIf=\"!showQuantityControl\"\n tuiButton\n (click)=\"clickAddToCartEvent.emit(product)\"\n [loading]=\"showLoader()\"\n size=\"s\"\n iconStart=\"@tui.shopping-cart\"\n class=\"grow !font-extrabold\"\n >\n \u0412 \u043A\u043E\u0440\u0437\u0438\u043D\u0443\n </button>\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n *ngIf=\"showQuantityControl\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [step]=\"ScUnitsHelper.getProductMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"showLoader()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-full\"\n />\n <tui-avatar\n *ngIf=\"orderItem && !showQuantityControl\"\n src=\"@tui.check\"\n size=\"s\"\n [style.background]=\"'var(--tui-status-warning-pale)'\"\n [style.color]=\"'var(--tui-background-accent-1)'\"\n />\n </div>\n </div>\n </sc-noindex-wrapper>\n</div>\n\n<ng-template #skeleton>\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n</ng-template>\n", styles: [":host tui-badge{--t-padding: .25rem !important}:host .name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}:host .card-wrapper{font-size:.8125rem;line-height:1.25rem;font-weight:500}:host .card-wrapper .name,:host .card-wrapper .cost{font-size:.9375rem;line-height:1.5rem;font-weight:800}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2$2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon", inputs: ["icon", "background"] }, { kind: "ngmodule", type: TuiTextfieldControllerModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.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: TuiHighlight, selector: "[tuiHighlight]", inputs: ["tuiHighlight", "tuiHighlightColor"] }, { kind: "directive", type: TuiAutoFocus, selector: "[tuiAutoFocus]", inputs: ["tuiAutoFocus"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: TuiAvatar, selector: "tui-avatar,button[tuiAvatar],a[tuiAvatar]", inputs: ["size", "round", "src"] }, { kind: "component", type: ScHoverImageCarouselComponent, selector: "sc-hover-image-carousel", inputs: ["images", "isShowActions", "productName"] }, { kind: "component", type: CostWithDiscountComponent, selector: "sc-cost-with-discount", inputs: ["product", "size"] }, { kind: "component", type: ScPriceWarehouseStockComponent, selector: "sc-price-warehouse-stock", inputs: ["classList", "product", "withStockHint", "fromMain"] }, { kind: "component", type: ScFavoriteButtonComponent, selector: "sc-favorite-button", inputs: ["isFavorite", "showLoader", "disabled"], outputs: ["clickEvent"] }, { kind: "component", type: ScInputQuantityComponent, selector: "sc-input-quantity", inputs: ["step", "showLoader", "showCross", "ignoreStepValidators", "appearance", "isDisabled", "size"], outputs: ["clickClearEvent"] }, { kind: "component", type: ScNoindexWrapperComponent, selector: "sc-noindex-wrapper" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5304
5332
|
}
|
|
5305
5333
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScPriceCardInlineComponent, decorators: [{
|
|
5306
5334
|
type: Component,
|
|
@@ -5324,7 +5352,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
5324
5352
|
ScFavoriteButtonComponent,
|
|
5325
5353
|
ScInputQuantityComponent,
|
|
5326
5354
|
ScNoindexWrapperComponent,
|
|
5327
|
-
], template: "<div\n *ngIf=\"product; else skeleton\"\n class=\"card-wrapper relative flex w-full gap-4 rounded-xl p-1 hover:bg-tui-background-neutral-1\"\n>\n <sc-hover-image-carousel\n (click)=\"clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"size-24 shrink-0 cursor-pointer self-center\"\n />\n <div class=\"flex grow flex-col gap-1\">\n <sc-noindex-wrapper>\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n </sc-noindex-wrapper>\n\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n\n <sc-noindex-wrapper>\n <span\n *ngIf=\"product.supplierSku\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }}\n </span>\n\n <div\n *ngIf=\"product?.pack\"\n class=\"flex items-center gap-1 text-tui-text-02\"\n >\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n <tui-icon\n *ngIf=\"product.ignoreMinCountCheck\"\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n </div>\n </sc-noindex-wrapper>\n\n <sc-cost-with-discount [product]=\"product\" />\n\n <sc-noindex-wrapper>\n <sc-price-warehouse-stock [product]=\"product\" />\n </sc-noindex-wrapper>\n </div>\n </div>\n\n <sc-noindex-wrapper>\n <div class=\"flex w-40 shrink-0 flex-col justify-between\">\n <div class=\"flex justify-end\">\n <tui-avatar\n *ngIf=\"product.isPreviouslyOrdered\"\n src=\"@tui.history\"\n size=\"s\"\n [style.background]=\"'none'\"\n [style.color]=\"'var(--tui-text-action)'\"\n />\n <sc-favorite-button\n *ngIf=\"authStatus$ | async\"\n (clickEvent)=\"clickFavoriteEvent.emit()\"\n [showLoader]=\"favoriteShowLoader()\"\n [isFavorite]=\"product.isFavorite\"\n [disabled]=\"!!product.primaryCategory?.isFavorite\"\n />\n </div>\n <div class=\"flex gap-2\">\n <button\n *ngIf=\"!showQuantityControl\"\n tuiButton\n (click)=\"clickAddToCartEvent.emit(product)\"\n [loading]=\"showLoader()\"\n size=\"s\"\n iconStart=\"@tui.shopping-cart\"\n class=\"grow !font-extrabold\"\n >\n \u0412 \u043A\u043E\u0440\u0437\u0438\u043D\u0443\n </button>\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n *ngIf=\"showQuantityControl\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [step]=\"
|
|
5355
|
+
], template: "<div\n *ngIf=\"product; else skeleton\"\n class=\"card-wrapper relative flex w-full gap-4 rounded-xl p-1 hover:bg-tui-background-neutral-1\"\n>\n <sc-hover-image-carousel\n (click)=\"clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"size-24 shrink-0 cursor-pointer self-center\"\n />\n <div class=\"flex grow flex-col gap-1\">\n <sc-noindex-wrapper>\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n </sc-noindex-wrapper>\n\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n\n <sc-noindex-wrapper>\n <span\n *ngIf=\"product.supplierSku\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }}\n </span>\n\n <div\n *ngIf=\"product?.pack\"\n class=\"flex items-center gap-1 text-tui-text-02\"\n >\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n <tui-icon\n *ngIf=\"product.ignoreMinCountCheck\"\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n </div>\n </sc-noindex-wrapper>\n\n <sc-cost-with-discount [product]=\"product\" />\n\n <sc-noindex-wrapper>\n <sc-price-warehouse-stock [product]=\"product\" />\n </sc-noindex-wrapper>\n </div>\n </div>\n\n <sc-noindex-wrapper>\n <div class=\"flex w-40 shrink-0 flex-col justify-between\">\n <div class=\"flex justify-end\">\n <tui-avatar\n *ngIf=\"product.isPreviouslyOrdered\"\n src=\"@tui.history\"\n size=\"s\"\n [style.background]=\"'none'\"\n [style.color]=\"'var(--tui-text-action)'\"\n />\n <sc-favorite-button\n *ngIf=\"authStatus$ | async\"\n (clickEvent)=\"clickFavoriteEvent.emit()\"\n [showLoader]=\"favoriteShowLoader()\"\n [isFavorite]=\"product.isFavorite\"\n [disabled]=\"!!product.primaryCategory?.isFavorite\"\n />\n </div>\n <div class=\"flex gap-2\">\n <button\n *ngIf=\"!showQuantityControl\"\n tuiButton\n (click)=\"clickAddToCartEvent.emit(product)\"\n [loading]=\"showLoader()\"\n size=\"s\"\n iconStart=\"@tui.shopping-cart\"\n class=\"grow !font-extrabold\"\n >\n \u0412 \u043A\u043E\u0440\u0437\u0438\u043D\u0443\n </button>\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n *ngIf=\"showQuantityControl\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [step]=\"ScUnitsHelper.getProductMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"showLoader()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-full\"\n />\n <tui-avatar\n *ngIf=\"orderItem && !showQuantityControl\"\n src=\"@tui.check\"\n size=\"s\"\n [style.background]=\"'var(--tui-status-warning-pale)'\"\n [style.color]=\"'var(--tui-background-accent-1)'\"\n />\n </div>\n </div>\n </sc-noindex-wrapper>\n</div>\n\n<ng-template #skeleton>\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n</ng-template>\n", styles: [":host tui-badge{--t-padding: .25rem !important}:host .name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4}:host .card-wrapper{font-size:.8125rem;line-height:1.25rem;font-weight:500}:host .card-wrapper .name,:host .card-wrapper .cost{font-size:.9375rem;line-height:1.5rem;font-weight:800}\n"] }]
|
|
5328
5356
|
}] });
|
|
5329
5357
|
|
|
5330
5358
|
/**
|
|
@@ -5627,6 +5655,60 @@ const SC_CATALOG_PRODUCTS_FILTERS = new InjectionToken('SC_CATALOG_PRODUCTS_FILT
|
|
|
5627
5655
|
*/
|
|
5628
5656
|
const SC_CATALOG_SHOW_PRODUCTS_RECURSIVELY = new InjectionToken('SC_CATALOG_SHOW_PRODUCTS_RECURSIVELY');
|
|
5629
5657
|
|
|
5658
|
+
/**
|
|
5659
|
+
* Контейнер сворачивания для длинного списка вариантов фильтра.
|
|
5660
|
+
*
|
|
5661
|
+
* Когда число элементов превышает порог: свёрнут — fade с обрезкой, развёрнут — scrollbar.
|
|
5662
|
+
* Иначе рендерит контент без обёртки и кнопки переключения.
|
|
5663
|
+
*
|
|
5664
|
+
* Контент проецируется как `<ng-template>` — это сохраняет инжектор `ControlContainer`
|
|
5665
|
+
* родителя для `formControlName`/`formGroupName` внутри проецируемого фрагмента.
|
|
5666
|
+
*/
|
|
5667
|
+
class ScCatalogFilterCollapsibleComponent {
|
|
5668
|
+
constructor() {
|
|
5669
|
+
/**
|
|
5670
|
+
* Число элементов содержимого, по которому решается необходимость сворачивания.
|
|
5671
|
+
*/
|
|
5672
|
+
this.itemsCount = input.required();
|
|
5673
|
+
/**
|
|
5674
|
+
* Показывать ли кнопку сброса значений группы.
|
|
5675
|
+
*/
|
|
5676
|
+
this.showReset = input(false);
|
|
5677
|
+
/**
|
|
5678
|
+
* Событие нажатия на кнопку сброса группы.
|
|
5679
|
+
*/
|
|
5680
|
+
this.resetGroup = output();
|
|
5681
|
+
/**
|
|
5682
|
+
* Проецируемое содержимое (объявляется в шаблоне родителя как `<ng-template>`).
|
|
5683
|
+
*/
|
|
5684
|
+
this.contentTpl = contentChild.required(TemplateRef);
|
|
5685
|
+
/**
|
|
5686
|
+
* Развёрнут ли список.
|
|
5687
|
+
*/
|
|
5688
|
+
this.isExpanded = signal(false);
|
|
5689
|
+
/**
|
|
5690
|
+
* Нужно ли сворачивание для текущего числа элементов.
|
|
5691
|
+
*/
|
|
5692
|
+
this.isCollapsible = computed(() => this.itemsCount() > ScCatalogFilterCollapsibleComponent.COLLAPSE_THRESHOLD);
|
|
5693
|
+
}
|
|
5694
|
+
/**
|
|
5695
|
+
* Порог числа вариантов, после которого включается сворачивание с {@link TuiFade}.
|
|
5696
|
+
*/
|
|
5697
|
+
static { this.COLLAPSE_THRESHOLD = 5; }
|
|
5698
|
+
/**
|
|
5699
|
+
* Переключает развёрнутость списка.
|
|
5700
|
+
*/
|
|
5701
|
+
toggle() {
|
|
5702
|
+
this.isExpanded.update((value) => !value);
|
|
5703
|
+
}
|
|
5704
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScCatalogFilterCollapsibleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5705
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ScCatalogFilterCollapsibleComponent, isStandalone: true, selector: "sc-catalog-filter-collapsible", inputs: { itemsCount: { classPropertyName: "itemsCount", publicName: "itemsCount", isSignal: true, isRequired: true, transformFunction: null }, showReset: { classPropertyName: "showReset", publicName: "showReset", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { resetGroup: "resetGroup" }, queries: [{ propertyName: "contentTpl", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\n @if (isCollapsible()) {\n @if (isExpanded()) {\n <tui-scrollbar [style.max-block-size]=\"'11rem'\">\n <ng-container *ngTemplateOutlet=\"contentTpl()\" />\n </tui-scrollbar>\n } @else {\n <div\n class=\"filter-group-fade\"\n tuiFade=\"vertical\"\n tuiFadeHeight=\"0.25rem\"\n tuiFadeOffset=\"0.25rem\"\n >\n <ng-container *ngTemplateOutlet=\"contentTpl()\" />\n </div>\n }\n\n <div class=\"flex items-center justify-between\">\n <button\n tuiLink\n type=\"button\"\n class=\"text-start !text-body-s\"\n [style.text-decoration-line]=\"'underline'\"\n (click)=\"toggle()\"\n >\n @if (isExpanded()) {\n \u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C\n } @else {\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451\n }\n </button>\n @if (showReset()) {\n <button\n tuiLink\n appearance=\"\"\n [style.color]=\"'var(--tui-status-negative)'\"\n [style.text-decoration-line]=\"'underline'\"\n type=\"button\"\n class=\"!text-body-s\"\n (click)=\"resetGroup.emit()\"\n >\n \u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C\n </button>\n }\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"contentTpl()\" />\n @if (showReset()) {\n <button\n tuiLink\n type=\"button\"\n class=\"text-start !text-body-s\"\n (click)=\"resetGroup.emit()\"\n >\n \u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C\n </button>\n }\n }\n</div>\n", styles: [".filter-group-fade{box-sizing:border-box;max-block-size:9rem;overflow:hidden!important;transition:none!important}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TuiFade, selector: "[tuiFade]", inputs: ["tuiFadeHeight", "tuiFadeSize", "tuiFadeOffset", "tuiFade"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo"] }, { kind: "component", type: TuiScrollbar, selector: "tui-scrollbar", inputs: ["hidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5706
|
+
}
|
|
5707
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScCatalogFilterCollapsibleComponent, decorators: [{
|
|
5708
|
+
type: Component,
|
|
5709
|
+
args: [{ standalone: true, selector: 'sc-catalog-filter-collapsible', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, TuiFade, TuiLink, TuiScrollbar], template: "<div class=\"flex flex-col gap-2\">\n @if (isCollapsible()) {\n @if (isExpanded()) {\n <tui-scrollbar [style.max-block-size]=\"'11rem'\">\n <ng-container *ngTemplateOutlet=\"contentTpl()\" />\n </tui-scrollbar>\n } @else {\n <div\n class=\"filter-group-fade\"\n tuiFade=\"vertical\"\n tuiFadeHeight=\"0.25rem\"\n tuiFadeOffset=\"0.25rem\"\n >\n <ng-container *ngTemplateOutlet=\"contentTpl()\" />\n </div>\n }\n\n <div class=\"flex items-center justify-between\">\n <button\n tuiLink\n type=\"button\"\n class=\"text-start !text-body-s\"\n [style.text-decoration-line]=\"'underline'\"\n (click)=\"toggle()\"\n >\n @if (isExpanded()) {\n \u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C\n } @else {\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451\n }\n </button>\n @if (showReset()) {\n <button\n tuiLink\n appearance=\"\"\n [style.color]=\"'var(--tui-status-negative)'\"\n [style.text-decoration-line]=\"'underline'\"\n type=\"button\"\n class=\"!text-body-s\"\n (click)=\"resetGroup.emit()\"\n >\n \u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C\n </button>\n }\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"contentTpl()\" />\n @if (showReset()) {\n <button\n tuiLink\n type=\"button\"\n class=\"text-start !text-body-s\"\n (click)=\"resetGroup.emit()\"\n >\n \u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C\n </button>\n }\n }\n</div>\n", styles: [".filter-group-fade{box-sizing:border-box;max-block-size:9rem;overflow:hidden!important;transition:none!important}\n"] }]
|
|
5710
|
+
}] });
|
|
5711
|
+
|
|
5630
5712
|
/* eslint-disable class-methods-use-this */
|
|
5631
5713
|
/**
|
|
5632
5714
|
* Компонент вывода фильтров каталога.
|
|
@@ -5637,9 +5719,9 @@ class ScCatalogFiltersComponent {
|
|
|
5637
5719
|
*/
|
|
5638
5720
|
constructor() {
|
|
5639
5721
|
/**
|
|
5640
|
-
*
|
|
5722
|
+
* Подписки синхронизации контролов формы (range slider, single-select checkbox).
|
|
5641
5723
|
*/
|
|
5642
|
-
this.
|
|
5724
|
+
this.formSyncs = new Subscription();
|
|
5643
5725
|
/**
|
|
5644
5726
|
* Сервис для работы с фильтрами каталога.
|
|
5645
5727
|
*/
|
|
@@ -5657,16 +5739,33 @@ class ScCatalogFiltersComponent {
|
|
|
5657
5739
|
*/
|
|
5658
5740
|
this.isRecursively = inject(SC_CATALOG_SHOW_PRODUCTS_RECURSIVELY);
|
|
5659
5741
|
/**
|
|
5660
|
-
*
|
|
5742
|
+
* Показывать ли кнопку «Показать результаты».
|
|
5661
5743
|
*/
|
|
5662
|
-
this.
|
|
5663
|
-
|
|
5664
|
-
|
|
5744
|
+
this.showResultsButton = input(false);
|
|
5745
|
+
/**
|
|
5746
|
+
* Событие нажатия на кнопку сброса всех фильтров.
|
|
5747
|
+
*/
|
|
5748
|
+
this.resetFilters = output();
|
|
5749
|
+
/**
|
|
5750
|
+
* Событие нажатия на кнопку показа результатов.
|
|
5751
|
+
*/
|
|
5752
|
+
this.showResults = output();
|
|
5665
5753
|
/**
|
|
5666
5754
|
* FormGroup для фильтров.
|
|
5667
5755
|
*/
|
|
5668
5756
|
this.form = new FormGroup({});
|
|
5669
|
-
|
|
5757
|
+
/**
|
|
5758
|
+
* {@link Observable} фильтров категории.
|
|
5759
|
+
*/
|
|
5760
|
+
this.filters = toSignal(inject(SC_CATEGORY_INFO).pipe(catchError(() => EMPTY), filter(tuiIsPresent), switchMap((category) => this.catalogFilterService.getFilters$(this.idOrSlugPipe.transform(category), this.isRecursively)), filter(tuiIsPresent), map((filters) => filters
|
|
5761
|
+
.filter((item) => item.type !== 'range' || item.min !== item.max)
|
|
5762
|
+
.map((item) => (item.type === 'checkbox' ? { ...item, values: [...item.values].sort((a, b) => a.label.localeCompare(b.label)) } : item))), tap((filters) => {
|
|
5763
|
+
this.updateFormControls(filters);
|
|
5764
|
+
}), share()));
|
|
5765
|
+
inject(DestroyRef).onDestroy(() => {
|
|
5766
|
+
this.formSyncs.unsubscribe();
|
|
5767
|
+
});
|
|
5768
|
+
this.form.valueChanges.pipe(debounceTime(0), takeUntilDestroyed()).subscribe((filters) => {
|
|
5670
5769
|
this.catalogProductsFilters$.next(this.buildPropertyFilters(filters));
|
|
5671
5770
|
});
|
|
5672
5771
|
}
|
|
@@ -5676,17 +5775,28 @@ class ScCatalogFiltersComponent {
|
|
|
5676
5775
|
* @param filters Массив фильтров для создания контролов.
|
|
5677
5776
|
*/
|
|
5678
5777
|
updateFormControls(filters) {
|
|
5778
|
+
this.formSyncs.unsubscribe();
|
|
5779
|
+
this.formSyncs = new Subscription();
|
|
5679
5780
|
Object.keys(this.form.controls).forEach((key) => {
|
|
5680
5781
|
this.form.removeControl(key, { emitEvent: false });
|
|
5681
5782
|
});
|
|
5682
5783
|
filters.forEach((item) => {
|
|
5683
5784
|
switch (item.type) {
|
|
5684
|
-
case 'checkbox':
|
|
5685
|
-
|
|
5785
|
+
case 'checkbox': {
|
|
5786
|
+
const checkboxControl = this.createCheckboxFormControl(item);
|
|
5787
|
+
this.form.addControl(item.id, checkboxControl, { emitEvent: false });
|
|
5788
|
+
// Single-select для !isMultiple: при выборе одного остальные снимаются.
|
|
5789
|
+
if (!item.isMultiple && item.values.length > 1) {
|
|
5790
|
+
this.formSyncs.add(this.syncSingleSelectCheckbox(checkboxControl));
|
|
5791
|
+
}
|
|
5686
5792
|
break;
|
|
5687
|
-
|
|
5688
|
-
|
|
5793
|
+
}
|
|
5794
|
+
case 'range': {
|
|
5795
|
+
const rangeControl = this.createRangeFormControl(item);
|
|
5796
|
+
this.form.addControl(item.id, rangeControl, { emitEvent: false });
|
|
5797
|
+
this.formSyncs.add(this.syncRangeFromToAndSlider(rangeControl));
|
|
5689
5798
|
break;
|
|
5799
|
+
}
|
|
5690
5800
|
case 'toggle':
|
|
5691
5801
|
this.form.addControl(item.id, this.createToggleFormControl(item), { emitEvent: false });
|
|
5692
5802
|
break;
|
|
@@ -5710,7 +5820,7 @@ class ScCatalogFiltersComponent {
|
|
|
5710
5820
|
}
|
|
5711
5821
|
switch (filterItem.type) {
|
|
5712
5822
|
case 'checkbox':
|
|
5713
|
-
this.processCheckboxFilter(result, filterItem
|
|
5823
|
+
this.processCheckboxFilter(result, filterItem, controlValue);
|
|
5714
5824
|
break;
|
|
5715
5825
|
case 'range':
|
|
5716
5826
|
this.processRangeFilter(result, filterItem.id, controlValue);
|
|
@@ -5725,31 +5835,107 @@ class ScCatalogFiltersComponent {
|
|
|
5725
5835
|
return result;
|
|
5726
5836
|
}
|
|
5727
5837
|
/**
|
|
5728
|
-
*
|
|
5838
|
+
* Создаёт FormGroup для checkbox: на каждый {@code value.id} — булевый контрол.
|
|
5729
5839
|
*
|
|
5730
|
-
*
|
|
5731
|
-
*
|
|
5840
|
+
* Единый формат и для одного, и для множества значений: шаблон рендерит их одинаково.
|
|
5841
|
+
* Различие в API-выводе для одиночного значения (boolean вместо массива) обрабатывается в {@link processCheckboxFilter}.
|
|
5732
5842
|
*
|
|
5733
5843
|
* @param checkboxFilter Фильтр типа checkbox.
|
|
5734
5844
|
*/
|
|
5735
5845
|
createCheckboxFormControl(checkboxFilter) {
|
|
5736
|
-
|
|
5737
|
-
return new FormControl(null);
|
|
5738
|
-
}
|
|
5846
|
+
const isSelected = (id) => checkboxFilter.selectedValues?.includes(id) ?? false;
|
|
5739
5847
|
const controls = {};
|
|
5740
5848
|
checkboxFilter.values.forEach((value) => {
|
|
5741
|
-
controls[value.id] = new FormControl(
|
|
5849
|
+
controls[value.id] = new FormControl(isSelected(value.id), { nonNullable: true });
|
|
5742
5850
|
});
|
|
5743
5851
|
return new FormGroup(controls);
|
|
5744
5852
|
}
|
|
5745
5853
|
/**
|
|
5746
|
-
*
|
|
5854
|
+
* Создаёт {@link FormGroup} для range: {@code from}, {@code to}, {@code slider} (кортеж для {@link TuiRange}).
|
|
5747
5855
|
*
|
|
5748
5856
|
* @param rangeFilter Фильтр типа range.
|
|
5749
5857
|
*/
|
|
5750
5858
|
createRangeFormControl(rangeFilter) {
|
|
5751
|
-
|
|
5752
|
-
|
|
5859
|
+
const fromValue = Number(rangeFilter.selectedMin ?? rangeFilter.min);
|
|
5860
|
+
const toValue = Number(rangeFilter.selectedMax ?? rangeFilter.max);
|
|
5861
|
+
return new FormGroup({
|
|
5862
|
+
from: new FormControl(fromValue, { nonNullable: true }),
|
|
5863
|
+
to: new FormControl(toValue, { nonNullable: true }),
|
|
5864
|
+
slider: new FormControl([fromValue, toValue], { nonNullable: true }),
|
|
5865
|
+
});
|
|
5866
|
+
}
|
|
5867
|
+
/**
|
|
5868
|
+
* Реализует single-select поведение для FormGroup с булевыми контролами:
|
|
5869
|
+
* при появлении нового true остальные контролы группы сбрасываются в false.
|
|
5870
|
+
*
|
|
5871
|
+
* Сохраняет последнее «стабильное» состояние и сравнивает следующее значение с ним —
|
|
5872
|
+
* новый true (отсутствовал в prev) считается выбранным, остальные сбрасываются через setValue.
|
|
5873
|
+
*
|
|
5874
|
+
* @param group FormGroup checkbox-фильтра (id → boolean).
|
|
5875
|
+
*/
|
|
5876
|
+
syncSingleSelectCheckbox(group) {
|
|
5877
|
+
let previousState = group.getRawValue();
|
|
5878
|
+
return group.valueChanges.subscribe((value) => {
|
|
5879
|
+
const current = value;
|
|
5880
|
+
const newlyChecked = Object.entries(current).find(([id, isChecked]) => {
|
|
5881
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
5882
|
+
return isChecked && !previousState[id];
|
|
5883
|
+
})?.[0];
|
|
5884
|
+
if (!newlyChecked) {
|
|
5885
|
+
previousState = { ...current };
|
|
5886
|
+
return;
|
|
5887
|
+
}
|
|
5888
|
+
const next = {};
|
|
5889
|
+
Object.keys(group.controls).forEach((id) => {
|
|
5890
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
5891
|
+
next[id] = id === newlyChecked;
|
|
5892
|
+
});
|
|
5893
|
+
previousState = next;
|
|
5894
|
+
group.setValue(next);
|
|
5895
|
+
});
|
|
5896
|
+
}
|
|
5897
|
+
/**
|
|
5898
|
+
* Связывает поля «от»/«до» с контролом слайдера.
|
|
5899
|
+
*
|
|
5900
|
+
* @param group FormGroup range-фильтра.
|
|
5901
|
+
*/
|
|
5902
|
+
syncRangeFromToAndSlider(group) {
|
|
5903
|
+
const from = group.get('from');
|
|
5904
|
+
const to = group.get('to');
|
|
5905
|
+
const slider = group.get('slider');
|
|
5906
|
+
if (!from || !to || !slider) {
|
|
5907
|
+
return new Subscription();
|
|
5908
|
+
}
|
|
5909
|
+
const sub = new Subscription();
|
|
5910
|
+
// Инпуты → слайдер; если «от» > «до», поднимаем «до» до «от».
|
|
5911
|
+
const applySliderFromInputs = () => {
|
|
5912
|
+
const low = Number(from.value);
|
|
5913
|
+
let high = Number(to.value);
|
|
5914
|
+
if (low > high) {
|
|
5915
|
+
high = low;
|
|
5916
|
+
to.setValue(high, { emitEvent: false });
|
|
5917
|
+
}
|
|
5918
|
+
const currentPair = slider.value;
|
|
5919
|
+
if (currentPair[0] !== low || currentPair[1] !== high) {
|
|
5920
|
+
slider.setValue([low, high], { emitEvent: false });
|
|
5921
|
+
slider.markAsDirty();
|
|
5922
|
+
}
|
|
5923
|
+
};
|
|
5924
|
+
sub.add(merge(from.valueChanges, to.valueChanges).subscribe(applySliderFromInputs));
|
|
5925
|
+
sub.add(slider.valueChanges.subscribe((value) => {
|
|
5926
|
+
const [low, high] = value;
|
|
5927
|
+
if (from.value !== low) {
|
|
5928
|
+
from.setValue(low, { emitEvent: false });
|
|
5929
|
+
from.markAsDirty();
|
|
5930
|
+
}
|
|
5931
|
+
if (to.value !== high) {
|
|
5932
|
+
to.setValue(high, { emitEvent: false });
|
|
5933
|
+
to.markAsDirty();
|
|
5934
|
+
}
|
|
5935
|
+
}));
|
|
5936
|
+
// Совпасть с полями при первом показе (уже совпадает при создании, но на всякий случай).
|
|
5937
|
+
applySliderFromInputs();
|
|
5938
|
+
return sub;
|
|
5753
5939
|
}
|
|
5754
5940
|
/**
|
|
5755
5941
|
* Создает FormControl для toggle.
|
|
@@ -5760,45 +5946,36 @@ class ScCatalogFiltersComponent {
|
|
|
5760
5946
|
return new FormControl(toggleFilter.selectedValue ?? false, { nonNullable: true });
|
|
5761
5947
|
}
|
|
5762
5948
|
/**
|
|
5763
|
-
* Обрабатывает checkbox
|
|
5949
|
+
* Обрабатывает checkbox: FormGroup → string[] выбранных id; для единственного значения — boolean (как toggle).
|
|
5764
5950
|
*
|
|
5765
5951
|
* @param result Объект результата для заполнения.
|
|
5766
|
-
* @param
|
|
5767
|
-
* @param controlValue Значение контрола
|
|
5952
|
+
* @param checkboxFilter Метафильтр checkbox.
|
|
5953
|
+
* @param controlValue Значение контрола формы (запись id → boolean).
|
|
5768
5954
|
*/
|
|
5769
|
-
processCheckboxFilter(result,
|
|
5770
|
-
// Для isMultiple === false: FormControl<string | null> -> string[] из одного выбранного ID.
|
|
5771
|
-
if (typeof controlValue === 'string') {
|
|
5772
|
-
if (controlValue) {
|
|
5773
|
-
// eslint-disable-next-line security/detect-object-injection, no-param-reassign
|
|
5774
|
-
result[filterId] = [controlValue];
|
|
5775
|
-
}
|
|
5776
|
-
return;
|
|
5777
|
-
}
|
|
5778
|
-
// Для checkbox: FormGroup с FormControl<boolean> -> string[] (массив ID выбранных значений).
|
|
5955
|
+
processCheckboxFilter(result, checkboxFilter, controlValue) {
|
|
5779
5956
|
const selectedIds = Object.entries(controlValue)
|
|
5780
5957
|
.filter(([, isSelected]) => isSelected)
|
|
5781
5958
|
.map(([id]) => id);
|
|
5782
|
-
if (selectedIds.length
|
|
5783
|
-
|
|
5784
|
-
result[filterId] = selectedIds;
|
|
5959
|
+
if (selectedIds.length === 0) {
|
|
5960
|
+
return;
|
|
5785
5961
|
}
|
|
5962
|
+
// eslint-disable-next-line security/detect-object-injection, no-param-reassign
|
|
5963
|
+
result[checkboxFilter.id] = selectedIds;
|
|
5786
5964
|
}
|
|
5787
5965
|
/**
|
|
5788
5966
|
* Обрабатывает range фильтр.
|
|
5789
5967
|
*
|
|
5790
5968
|
* @param result Объект результата для заполнения.
|
|
5791
5969
|
* @param filterId Идентификатор фильтра.
|
|
5792
|
-
* @param
|
|
5793
|
-
* @param
|
|
5794
|
-
* @param
|
|
5970
|
+
* @param range Значение контрола формы (объект с границами).
|
|
5971
|
+
* @param range.from Начальное значение диапазона.
|
|
5972
|
+
* @param range.to Конечное значение диапазона.
|
|
5795
5973
|
*/
|
|
5796
|
-
processRangeFilter(result, filterId,
|
|
5797
|
-
// Для range: FormControl<[number, number]> -> { from?: string; to?: string; }
|
|
5974
|
+
processRangeFilter(result, filterId, range) {
|
|
5798
5975
|
// eslint-disable-next-line security/detect-object-injection, no-param-reassign
|
|
5799
5976
|
result[filterId] = {
|
|
5800
|
-
from: String(from),
|
|
5801
|
-
to: String(to),
|
|
5977
|
+
from: String(range.from),
|
|
5978
|
+
to: String(range.to),
|
|
5802
5979
|
};
|
|
5803
5980
|
}
|
|
5804
5981
|
/**
|
|
@@ -5809,18 +5986,111 @@ class ScCatalogFiltersComponent {
|
|
|
5809
5986
|
* @param controlValue Значение контрола формы.
|
|
5810
5987
|
*/
|
|
5811
5988
|
processToggleFilter(result, filterId, controlValue) {
|
|
5812
|
-
// Для toggle: FormControl<boolean> -> boolean
|
|
5813
5989
|
if (controlValue) {
|
|
5814
5990
|
// eslint-disable-next-line security/detect-object-injection, no-param-reassign
|
|
5815
5991
|
result[filterId] = controlValue;
|
|
5816
5992
|
}
|
|
5817
5993
|
}
|
|
5994
|
+
/**
|
|
5995
|
+
* Сбрасывает поле «от» диапазона к минимальному значению фильтра.
|
|
5996
|
+
*
|
|
5997
|
+
* @param filterId Идентификатор фильтра.
|
|
5998
|
+
* @param min Минимальное значение диапазона.
|
|
5999
|
+
*/
|
|
6000
|
+
resetRangeFrom(filterId, min) {
|
|
6001
|
+
this.form.get(filterId)?.get('from')?.reset(+min);
|
|
6002
|
+
}
|
|
6003
|
+
/**
|
|
6004
|
+
* Сбрасывает поле «до» диапазона к максимальному значению фильтра.
|
|
6005
|
+
*
|
|
6006
|
+
* @param filterId Идентификатор фильтра.
|
|
6007
|
+
* @param max Максимальное значение диапазона.
|
|
6008
|
+
*/
|
|
6009
|
+
resetRangeTo(filterId, max) {
|
|
6010
|
+
this.form.get(filterId)?.get('to')?.reset(+max);
|
|
6011
|
+
}
|
|
6012
|
+
/**
|
|
6013
|
+
* Сбрасывает все чекбоксы группы в `false`.
|
|
6014
|
+
*
|
|
6015
|
+
* @param filterId Идентификатор фильтра (ключ FormGroup в форме).
|
|
6016
|
+
*/
|
|
6017
|
+
resetCheckboxGroup(filterId) {
|
|
6018
|
+
const group = this.form.get(filterId);
|
|
6019
|
+
if (!group) {
|
|
6020
|
+
return;
|
|
6021
|
+
}
|
|
6022
|
+
const resetValue = {};
|
|
6023
|
+
Object.keys(group.controls).forEach((id) => {
|
|
6024
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
6025
|
+
resetValue[id] = false;
|
|
6026
|
+
});
|
|
6027
|
+
group.reset(resetValue);
|
|
6028
|
+
}
|
|
6029
|
+
/**
|
|
6030
|
+
* Сбрасывает все фильтры и оповещает родителя о нажатии кнопки сброса.
|
|
6031
|
+
*/
|
|
6032
|
+
onResetFiltersClick() {
|
|
6033
|
+
this.resetAllFilters();
|
|
6034
|
+
this.resetFilters.emit();
|
|
6035
|
+
}
|
|
6036
|
+
/**
|
|
6037
|
+
* Оповещает родителя о нажатии кнопки показа результатов.
|
|
6038
|
+
*/
|
|
6039
|
+
onShowResultsClick() {
|
|
6040
|
+
this.showResults.emit();
|
|
6041
|
+
}
|
|
6042
|
+
/**
|
|
6043
|
+
* Сбрасывает все фильтры к исходным значениям.
|
|
6044
|
+
*/
|
|
6045
|
+
resetAllFilters() {
|
|
6046
|
+
this.filters()?.forEach((filterItem) => {
|
|
6047
|
+
const control = this.form.get(filterItem.id);
|
|
6048
|
+
if (!control) {
|
|
6049
|
+
return;
|
|
6050
|
+
}
|
|
6051
|
+
switch (filterItem.type) {
|
|
6052
|
+
case 'checkbox': {
|
|
6053
|
+
const group = control;
|
|
6054
|
+
const resetValue = {};
|
|
6055
|
+
Object.keys(group.controls).forEach((id) => {
|
|
6056
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
6057
|
+
resetValue[id] = false;
|
|
6058
|
+
});
|
|
6059
|
+
group.reset(resetValue);
|
|
6060
|
+
break;
|
|
6061
|
+
}
|
|
6062
|
+
case 'toggle':
|
|
6063
|
+
control.reset(false);
|
|
6064
|
+
break;
|
|
6065
|
+
case 'range': {
|
|
6066
|
+
const group = control;
|
|
6067
|
+
const min = +filterItem.min;
|
|
6068
|
+
const max = +filterItem.max;
|
|
6069
|
+
group.reset({ from: min, to: max, slider: [min, max] });
|
|
6070
|
+
break;
|
|
6071
|
+
}
|
|
6072
|
+
default:
|
|
6073
|
+
break;
|
|
6074
|
+
}
|
|
6075
|
+
});
|
|
6076
|
+
}
|
|
5818
6077
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScCatalogFiltersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5819
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ScCatalogFiltersComponent, isStandalone: true, selector: "sc-catalog-filters", inputs: { isOpenAccordion: { classPropertyName: "isOpenAccordion", publicName: "isOpenAccordion", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (filters()?.length) {\n <div class=\"bg-tui-base-01 shadow-sc flex flex-col items-center gap-3 rounded-xl\">\n <tui-accordion class=\"accordion\">\n <button\n [tuiAccordion]=\"isOpenAccordion()\"\n appearance=\"primary\"\n >\n \u0424\u0438\u043B\u044C\u0442\u0440\u044B\n </button>\n <tui-expand>\n <form\n [formGroup]=\"form\"\n class=\"flex flex-col gap-4 pb-1\"\n >\n @for (filter of filters(); track filter.id) {\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-body-s font-medium\">{{ filter.label }}</label>\n\n @if (filter.type === 'checkbox') {\n @if (filter.isMultiple === false) {\n <div class=\"flex flex-col gap-2\">\n @for (value of filter.values; track value.id) {\n @let formControl = form.get(filter.id);\n <label class=\"flex items-center gap-2\">\n <input\n [formControlName]=\"filter.id\"\n [value]=\"value.id\"\n tuiRadio\n (click)=\"formControl?.setValue(formControl?.value === value.id ? null : value.id)\"\n type=\"radio\"\n />\n <span class=\"text-body-s\">{{ value.label }}</span>\n </label>\n }\n </div>\n } @else {\n <div\n [formGroupName]=\"filter.id\"\n class=\"flex flex-col gap-2\"\n >\n @for (value of filter.values; track value.id) {\n <label class=\"flex items-center gap-2\">\n <input\n [formControlName]=\"value.id\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span class=\"text-body-s\">{{ value.label }}</span>\n </label>\n }\n </div>\n }\n }\n\n @if (filter.type === 'range') {\n <tui-input-range\n [formControlName]=\"filter.id\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n />\n }\n\n @if (filter.type === 'toggle') {\n <label class=\"flex items-center gap-2\">\n <input\n [formControlName]=\"filter.id\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span class=\"text-body-s\">\u0414\u0430</span>\n </label>\n }\n </div>\n }\n </form>\n </tui-expand>\n </tui-accordion>\n </div>\n}\n", styles: [".accordion [tuiAccordion]{border:none;mask:none}.accordion tui-expand{box-shadow:none}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]", inputs: ["size"] }, { kind: "component", type: i2$1.TuiRadioComponent, selector: "input[type=\"radio\"][tuiRadio]", inputs: ["size"] }, { kind: "component", type: i2$1.TuiInputRangeComponent, selector: "tui-input-range", inputs: ["min", "max", "step", "segments", "keySteps", "prefix", "postfix", "quantum", "content"] }, { kind: "component", type: i1$3.TuiAccordionComponent, selector: "tui-accordion", inputs: ["closeOthers", "size"] }, { kind: "directive", type: i1$3.TuiAccordionDirective, selector: "button[tuiAccordion]", inputs: ["tuiAccordion"], outputs: ["tuiAccordionChange"] }, { kind: "component", type: i2$5.TuiExpand, selector: "tui-expand", inputs: ["expanded"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6078
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ScCatalogFiltersComponent, isStandalone: true, selector: "sc-catalog-filters", inputs: { showResultsButton: { classPropertyName: "showResultsButton", publicName: "showResultsButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { resetFilters: "resetFilters", showResults: "showResults" }, ngImport: i0, template: "@if (filters()?.length) {\n <form\n [formGroup]=\"form\"\n class=\"flex flex-col pb-1\"\n >\n @for (filter of filters(); track filter.id; let isFirst = $first) {\n @if (!isFirst) {\n <hr class=\"my-3 w-full h-px\" />\n }\n\n <div class=\"flex flex-col gap-2\">\n <!-- \u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0433\u0440\u0443\u043F\u043F\u044B. \u0414\u043B\u044F toggle \u043F\u043E\u0434\u043F\u0438\u0441\u0438 \u043D\u0435\u0442: \u043C\u0435\u0442\u043A\u0430 \u0438\u0434\u0451\u0442 \u043F\u0440\u044F\u043C\u043E \u0440\u044F\u0434\u043E\u043C \u0441 \u0441\u0430\u043C\u0438\u043C checkbox. -->\n @if (filter.type !== 'toggle') {\n <label class=\"text-body-s-bold\">{{ filter.label }}</label>\n }\n\n <!-- Checkbox: FormGroup(value.id \u2192 boolean) \u0434\u043B\u044F \u043B\u044E\u0431\u043E\u0433\u043E \u0447\u0438\u0441\u043B\u0430 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439.\n \u0420\u0430\u0437\u0432\u0438\u043B\u043A\u0430 \u043E\u0434\u043D\u043E/\u043C\u043D\u043E\u0433\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u0432\u044B\u043D\u0435\u0441\u0435\u043D\u0430 \u0432 TS (\u0441\u043C. processCheckboxFilter).\n ng-template \u0432\u043D\u0443\u0442\u0440\u0438 formGroupName: \u0438\u043D\u0430\u0447\u0435 reactive forms \u043D\u0435 \u043D\u0430\u0439\u0434\u0451\u0442 ControlContainer \u043F\u0440\u0438 \u043F\u0440\u043E\u0435\u043A\u0446\u0438\u0438 \u0432 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0439 \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442. -->\n @if (filter.type === 'checkbox') {\n <div\n class=\"flex flex-col gap-2\"\n [formGroupName]=\"filter.id\"\n >\n <sc-catalog-filter-collapsible\n [itemsCount]=\"filter.values.length\"\n [showReset]=\"form.get(filter.id)?.dirty ?? false\"\n (resetGroup)=\"resetCheckboxGroup(filter.id)\"\n >\n <ng-template>\n <div class=\"flex flex-col gap-2\">\n @for (value of filter.values; track value.id) {\n <label class=\"flex items-center gap-2\">\n <input\n [formControlName]=\"value.id\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span class=\"text-body-s\">{{ value.label }}</span>\n </label>\n }\n </div>\n </ng-template>\n </sc-catalog-filter-collapsible>\n </div>\n\n <!-- Toggle: \u043E\u0434\u0438\u043D boolean \u043D\u0430 \u043A\u043E\u0440\u043D\u0435 \u0444\u043E\u0440\u043C\u044B, \u043F\u043E\u0434\u043F\u0438\u0441\u044C = filter.label -->\n } @else if (filter.type === 'toggle') {\n <label class=\"flex items-center gap-2\">\n <input\n [formControlName]=\"filter.id\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span class=\"text-body-s-bold\">{{ filter.label }}</span>\n </label>\n\n <!-- Range: FormGroup(from, to, slider) \u0441 \u0434\u0432\u0443\u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0435\u0439 \u0441\u0438\u043D\u0445\u0440\u043E\u043D\u0438\u0437\u0430\u0446\u0438\u0435\u0439 -->\n } @else if (filter.type === 'range') {\n <div\n [formGroupName]=\"filter.id\"\n class=\"flex flex-col gap-3\"\n >\n <div class=\"flex gap-3 px-1\">\n <label\n tuiLabel\n class=\"min-w-0 flex-1\"\n >\n \u041E\u0442\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n scSelectOnFocusin\n tuiInputNumber\n formControlName=\"from\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n autocomplete=\"off\"\n />\n @if (form.get(filter.id)?.get('from')?.dirty) {\n <button\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n appearance=\"icon\"\n iconStart=\"@tui.x\"\n (click)=\"resetRangeFrom(filter.id, filter.min)\"\n ></button>\n }\n </tui-textfield>\n </label>\n <label\n tuiLabel\n class=\"min-w-0 flex-1\"\n >\n \u0414\u043E\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n scSelectOnFocusin\n tuiInputNumber\n formControlName=\"to\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n autocomplete=\"off\"\n />\n @if (form.get(filter.id)?.get('to')?.dirty) {\n <button\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n appearance=\"icon\"\n iconStart=\"@tui.x\"\n (click)=\"resetRangeTo(filter.id, filter.max)\"\n ></button>\n }\n </tui-textfield>\n </label>\n </div>\n\n <tui-range\n size=\"m\"\n formControlName=\"slider\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n [style.--tui-thickness.rem]=\"0.25\"\n />\n </div>\n }\n </div>\n }\n <button\n tuiButton\n appearance=\"secondary\"\n type=\"button\"\n class=\"mt-2\"\n (click)=\"onResetFiltersClick()\"\n >\n \u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B\n </button>\n @if (showResultsButton()) {\n <button\n tuiButton\n appearance=\"primary\"\n type=\"button\"\n class=\"mt-2\"\n (click)=\"onShowResultsClick()\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B\n </button>\n }\n </form>\n}\n", styles: [".accordion [tuiAccordion]{border:none;mask:none}.accordion tui-expand{box-shadow:none}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i5.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i1$2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])" }, { kind: "directive", type: i1$2.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: ScSelectOnFocusinDirective, selector: "tui-input-number, tui-input, tui-input-phone, tui-input-date, tui-input-password, input[tuiInputNumber], input[tuiTextfield], input[tuiInputSlider]" }, { kind: "component", type: ScCatalogFilterCollapsibleComponent, selector: "sc-catalog-filter-collapsible", inputs: ["itemsCount", "showReset"], outputs: ["resetGroup"] }, { kind: "directive", type: TuiNumberFormat, selector: "[tuiNumberFormat]", inputs: ["tuiNumberFormat"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]", inputs: ["size"] }, { kind: "directive", type: i2$1.TuiInputNumberDirective, selector: "input[tuiInputNumber]", inputs: ["min", "max", "prefix", "postfix"] }, { kind: "component", type: TuiRange, selector: "tui-range", inputs: ["min", "max", "step", "size", "segments", "keySteps", "focusable", "margin", "limit"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5820
6079
|
}
|
|
5821
6080
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScCatalogFiltersComponent, decorators: [{
|
|
5822
6081
|
type: Component,
|
|
5823
|
-
args: [{ standalone: true, selector: 'sc-catalog-filters', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
6082
|
+
args: [{ standalone: true, selector: 'sc-catalog-filters', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
6083
|
+
ReactiveFormsModule,
|
|
6084
|
+
TuiTextfield,
|
|
6085
|
+
ScSelectOnFocusinDirective,
|
|
6086
|
+
ScCatalogFilterCollapsibleComponent,
|
|
6087
|
+
TuiLabel,
|
|
6088
|
+
TuiNumberFormat,
|
|
6089
|
+
TuiCheckbox,
|
|
6090
|
+
TuiInputNumber,
|
|
6091
|
+
TuiRange,
|
|
6092
|
+
TuiButton,
|
|
6093
|
+
], template: "@if (filters()?.length) {\n <form\n [formGroup]=\"form\"\n class=\"flex flex-col pb-1\"\n >\n @for (filter of filters(); track filter.id; let isFirst = $first) {\n @if (!isFirst) {\n <hr class=\"my-3 w-full h-px\" />\n }\n\n <div class=\"flex flex-col gap-2\">\n <!-- \u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0433\u0440\u0443\u043F\u043F\u044B. \u0414\u043B\u044F toggle \u043F\u043E\u0434\u043F\u0438\u0441\u0438 \u043D\u0435\u0442: \u043C\u0435\u0442\u043A\u0430 \u0438\u0434\u0451\u0442 \u043F\u0440\u044F\u043C\u043E \u0440\u044F\u0434\u043E\u043C \u0441 \u0441\u0430\u043C\u0438\u043C checkbox. -->\n @if (filter.type !== 'toggle') {\n <label class=\"text-body-s-bold\">{{ filter.label }}</label>\n }\n\n <!-- Checkbox: FormGroup(value.id \u2192 boolean) \u0434\u043B\u044F \u043B\u044E\u0431\u043E\u0433\u043E \u0447\u0438\u0441\u043B\u0430 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439.\n \u0420\u0430\u0437\u0432\u0438\u043B\u043A\u0430 \u043E\u0434\u043D\u043E/\u043C\u043D\u043E\u0433\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u0432\u044B\u043D\u0435\u0441\u0435\u043D\u0430 \u0432 TS (\u0441\u043C. processCheckboxFilter).\n ng-template \u0432\u043D\u0443\u0442\u0440\u0438 formGroupName: \u0438\u043D\u0430\u0447\u0435 reactive forms \u043D\u0435 \u043D\u0430\u0439\u0434\u0451\u0442 ControlContainer \u043F\u0440\u0438 \u043F\u0440\u043E\u0435\u043A\u0446\u0438\u0438 \u0432 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0439 \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442. -->\n @if (filter.type === 'checkbox') {\n <div\n class=\"flex flex-col gap-2\"\n [formGroupName]=\"filter.id\"\n >\n <sc-catalog-filter-collapsible\n [itemsCount]=\"filter.values.length\"\n [showReset]=\"form.get(filter.id)?.dirty ?? false\"\n (resetGroup)=\"resetCheckboxGroup(filter.id)\"\n >\n <ng-template>\n <div class=\"flex flex-col gap-2\">\n @for (value of filter.values; track value.id) {\n <label class=\"flex items-center gap-2\">\n <input\n [formControlName]=\"value.id\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span class=\"text-body-s\">{{ value.label }}</span>\n </label>\n }\n </div>\n </ng-template>\n </sc-catalog-filter-collapsible>\n </div>\n\n <!-- Toggle: \u043E\u0434\u0438\u043D boolean \u043D\u0430 \u043A\u043E\u0440\u043D\u0435 \u0444\u043E\u0440\u043C\u044B, \u043F\u043E\u0434\u043F\u0438\u0441\u044C = filter.label -->\n } @else if (filter.type === 'toggle') {\n <label class=\"flex items-center gap-2\">\n <input\n [formControlName]=\"filter.id\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span class=\"text-body-s-bold\">{{ filter.label }}</span>\n </label>\n\n <!-- Range: FormGroup(from, to, slider) \u0441 \u0434\u0432\u0443\u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0435\u0439 \u0441\u0438\u043D\u0445\u0440\u043E\u043D\u0438\u0437\u0430\u0446\u0438\u0435\u0439 -->\n } @else if (filter.type === 'range') {\n <div\n [formGroupName]=\"filter.id\"\n class=\"flex flex-col gap-3\"\n >\n <div class=\"flex gap-3 px-1\">\n <label\n tuiLabel\n class=\"min-w-0 flex-1\"\n >\n \u041E\u0442\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n scSelectOnFocusin\n tuiInputNumber\n formControlName=\"from\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n autocomplete=\"off\"\n />\n @if (form.get(filter.id)?.get('from')?.dirty) {\n <button\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n appearance=\"icon\"\n iconStart=\"@tui.x\"\n (click)=\"resetRangeFrom(filter.id, filter.min)\"\n ></button>\n }\n </tui-textfield>\n </label>\n <label\n tuiLabel\n class=\"min-w-0 flex-1\"\n >\n \u0414\u043E\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n scSelectOnFocusin\n tuiInputNumber\n formControlName=\"to\"\n [tuiNumberFormat]=\"{ precision: 0 }\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n autocomplete=\"off\"\n />\n @if (form.get(filter.id)?.get('to')?.dirty) {\n <button\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n appearance=\"icon\"\n iconStart=\"@tui.x\"\n (click)=\"resetRangeTo(filter.id, filter.max)\"\n ></button>\n }\n </tui-textfield>\n </label>\n </div>\n\n <tui-range\n size=\"m\"\n formControlName=\"slider\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n [style.--tui-thickness.rem]=\"0.25\"\n />\n </div>\n }\n </div>\n }\n <button\n tuiButton\n appearance=\"secondary\"\n type=\"button\"\n class=\"mt-2\"\n (click)=\"onResetFiltersClick()\"\n >\n \u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B\n </button>\n @if (showResultsButton()) {\n <button\n tuiButton\n appearance=\"primary\"\n type=\"button\"\n class=\"mt-2\"\n (click)=\"onShowResultsClick()\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B\n </button>\n }\n </form>\n}\n", styles: [".accordion [tuiAccordion]{border:none;mask:none}.accordion tui-expand{box-shadow:none}\n"] }]
|
|
5824
6094
|
}], ctorParameters: () => [] });
|
|
5825
6095
|
|
|
5826
6096
|
/* eslint-disable @typescript-eslint/unbound-method */
|
|
@@ -7215,12 +7485,16 @@ class ScResourcePreviewComponent {
|
|
|
7215
7485
|
* @param videoElement HTML элемент видео.
|
|
7216
7486
|
*/
|
|
7217
7487
|
onCanPlay(videoElement) {
|
|
7488
|
+
if (this.playAttempt) {
|
|
7489
|
+
clearInterval(this.playAttempt);
|
|
7490
|
+
}
|
|
7218
7491
|
this.playAttempt = setInterval(() => {
|
|
7219
7492
|
videoElement
|
|
7220
7493
|
.play()
|
|
7221
7494
|
.then(() => {
|
|
7222
7495
|
if (this.playAttempt) {
|
|
7223
7496
|
clearInterval(this.playAttempt);
|
|
7497
|
+
this.playAttempt = undefined;
|
|
7224
7498
|
}
|
|
7225
7499
|
})
|
|
7226
7500
|
// eslint-disable-next-line lodash/prefer-noop
|
|
@@ -7234,6 +7508,7 @@ class ScResourcePreviewComponent {
|
|
|
7234
7508
|
// Исправляет ошибку фонового воспроизведения после закрытия диалога.
|
|
7235
7509
|
if (this.playAttempt) {
|
|
7236
7510
|
clearInterval(this.playAttempt);
|
|
7511
|
+
this.playAttempt = undefined;
|
|
7237
7512
|
}
|
|
7238
7513
|
}
|
|
7239
7514
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScResourcePreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -8030,7 +8305,7 @@ class ScOrderItemComponent extends AbstractScPriceCard {
|
|
|
8030
8305
|
appearance: signal('textfield'),
|
|
8031
8306
|
}),
|
|
8032
8307
|
tuiHintOptionsProvider({ direction: 'top', showDelay: 100, hideDelay: 100 }),
|
|
8033
|
-
], usesInheritance: true, ngImport: i0, template: "@if (product && orderItem) {\n <div class=\"@container relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\">\n <sc-noindex-wrapper>\n @let isDisabled = product.isHidden || product.isNull;\n <sc-hover-image-carousel\n (click)=\"isDisabled ? null : clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"aspect-square w-24 shrink-0 cursor-pointer self-start\"\n />\n <div class=\"flex w-full flex-col gap-y-1 gap-x-4 @5xl:flex-row @5xl:items-center @5xl:gap-5\">\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n [class.disabled]=\"isDisabled\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n @if (product.supplierSku) {\n <span class=\"text-tui-text-02\"> \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }} </span>\n }\n @if (product.pack) {\n <div class=\"flex items-center gap-1 text-tui-text-02\">\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n @if (product.ignoreMinCountCheck) {\n <tui-icon\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n }\n </div>\n }\n\n <sc-cost-with-discount\n scPrint=\"cost\"\n [product]=\"product\"\n />\n </div>\n @if (orderItem.specificationImgUrl) {\n <a\n tuiLink\n (click)=\"showSpecification(specificationPreview)\"\n [class.disabled]=\"isDisabled\"\n >\n \u0421\u043F\u0435\u0446\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F\n </a>\n }\n <ng-template\n #specificationPreview\n let-preview\n >\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n >\n <img\n *polymorpheusOutlet=\"orderItem.specificationImgUrl as src\"\n alt=\"preview\"\n [src]=\"orderItem.specificationImgUrl\"\n />\n <button\n iconStart=\"@tui.x\"\n title=\"Close\"\n tuiIconButton\n tuiPreviewAction\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n </ng-template>\n </div>\n <div class=\"grid grid-cols-1 @lg:grid-cols-3 gap-2 @2xl:gap-4 @2xl:grid-rows-1\">\n <div class=\"grid grid-cols-1 items-center @lg:gap-2 @2xl:grid-cols-2 @lg:col-span-2\">\n <!-- \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls() && showQuantityControl) {\n <!-- \u041F\u043E\u043B\u0435 \u0432\u0432\u043E\u0434\u0430 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [showCross]=\"false\"\n [isDisabled]=\"isDisabled\"\n [step]=\"unitsHelper.productMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"showLoader()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-32 shrink-0\"\n />\n } @else {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n >\n <div class=\"!text-body-m text-start\">\n \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E:\n <strong> {{ orderItem.quantity }} \u0448\u0442.</strong>\n </div>\n </button>\n }\n\n @let showAdditionalInfo = orderItem.configurator || orderItem.height || orderItem.length || orderItem.width || orderItem.marker;\n @if (showAdditionalInfo) {\n <div class=\"flex items-center gap-2 @lg:gap-3 max-w-min\">\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls()) {\n <button\n tuiIconButton\n iconStart=\"@tui.settings\"\n [disabled]=\"isDisabled\"\n [loading]=\"showLoader()\"\n (click)=\"clickSettings.emit()\"\n size=\"s\"\n [appearance]=\"isConfiguratorHintVisible() ? 'primary' : 'secondary'\"\n class=\"shrink-0\"\n ></button>\n }\n\n <!-- \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435. -->\n <div\n class=\"flex flex-col gap-x-1 text-tui-base-07\"\n [class.text-body-m]=\"!isShowEditControls()\"\n >\n @if (orderItem.marker) {\n <p>\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430: {{ orderItem.marker }}</p>\n }\n @if (orderItem.width) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0448\u0438\u0440\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0428\u0438\u0440\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.width }} \u043C.</span>\n </button>\n }\n @if (orderItem.height) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432\u044B\u0441\u043E\u0442\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0412\u044B\u0441\u043E\u0442\u0430: <span class=\"text-body-s-bold\">{{ orderItem.height }} \u043C.</span>\n </button>\n } @else if (orderItem.length) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0434\u043B\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0414\u043B\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.length }} \u043C.</span>\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <!-- \u0421\u0443\u043C\u043C\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 \u0438 \u0441\u043A\u043B\u0430\u0434\u0441\u043A\u043E\u0435 \u043D\u0430\u043B\u0438\u0447\u0438\u0435. -->\n <div\n scPrint=\"cost\"\n class=\"flex min-w-[11rem] flex-col @lg:justify-end @2xl:!justify-center text-body-m\"\n >\n <p class=\"whitespace-nowrap\">\n \u0421\u0443\u043C\u043C\u0430:\n <strong> {{ orderItem.costRub | tuiFormatNumber: { precision: 2, decimalSeparator: '.', rounding: 'ceil' } | async }} {{ 'RUB' | tuiCurrency }}</strong>\n </p>\n <sc-price-warehouse-stock\n scPrint=\"defaultNoPrint\"\n [product]=\"product\"\n />\n </div>\n </div>\n </div>\n </sc-noindex-wrapper>\n </div>\n} @else {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i2$2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon", inputs: ["icon", "background"] }, { kind: "ngmodule", type: TuiTextfieldControllerModule }, { kind: "directive", type: i2$3.PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.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: TuiHighlight, selector: "[tuiHighlight]", inputs: ["tuiHighlight", "tuiHighlightColor"] }, { kind: "directive", type: TuiAutoFocus, selector: "[tuiAutoFocus]", inputs: ["tuiAutoFocus"] }, { kind: "component", type: ScHoverImageCarouselComponent, selector: "sc-hover-image-carousel", inputs: ["images", "isShowActions", "productName"] }, { kind: "component", type: CostWithDiscountComponent, selector: "sc-cost-with-discount", inputs: ["product", "size"] }, { kind: "component", type: ScPriceWarehouseStockComponent, selector: "sc-price-warehouse-stock", inputs: ["classList", "product", "withStockHint", "fromMain"] }, { kind: "component", type: ScInputQuantityComponent, selector: "sc-input-quantity", inputs: ["step", "showLoader", "showCross", "ignoreStepValidators", "appearance", "isDisabled", "size"], outputs: ["clickClearEvent"] }, { kind: "pipe", type: TuiCurrencyPipe, name: "tuiCurrency" }, { kind: "pipe", type: TuiFormatNumberPipe, name: "tuiFormatNumber" }, { kind: "component", type: i2$1.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable", "initialScale"] }, { kind: "directive", type: i2$1.TuiPreviewAction, selector: "[tuiPreviewAction]" }, { kind: "component", type: ScNoindexWrapperComponent, selector: "sc-noindex-wrapper" }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "directive", type: ScPrintDirective, selector: "[scPrint]", inputs: ["scPrint"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8308
|
+
], usesInheritance: true, ngImport: i0, template: "@if (product && orderItem) {\n <div class=\"@container relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\">\n <sc-noindex-wrapper>\n @let isDisabled = product.isHidden || product.isNull;\n <sc-hover-image-carousel\n (click)=\"isDisabled ? null : clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"aspect-square w-24 shrink-0 cursor-pointer self-start\"\n />\n <div class=\"flex w-full flex-col gap-y-1 gap-x-4 @5xl:flex-row @5xl:items-center @5xl:gap-5\">\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n [class.disabled]=\"isDisabled\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n @if (product.supplierSku) {\n <span class=\"text-tui-text-02\"> \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }} </span>\n }\n @if (product.pack) {\n <div class=\"flex items-center gap-1 text-tui-text-02\">\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n @if (product.ignoreMinCountCheck) {\n <tui-icon\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n }\n </div>\n }\n\n <sc-cost-with-discount\n scPrint=\"cost\"\n [product]=\"product\"\n />\n </div>\n @if (orderItem.specificationImgUrl) {\n <a\n tuiLink\n (click)=\"showSpecification(specificationPreview)\"\n [class.disabled]=\"isDisabled\"\n >\n \u0421\u043F\u0435\u0446\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F\n </a>\n }\n <ng-template\n #specificationPreview\n let-preview\n >\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n >\n <img\n *polymorpheusOutlet=\"orderItem.specificationImgUrl as src\"\n alt=\"preview\"\n [src]=\"orderItem.specificationImgUrl\"\n />\n <button\n iconStart=\"@tui.x\"\n title=\"Close\"\n tuiIconButton\n tuiPreviewAction\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n </ng-template>\n </div>\n <div class=\"grid grid-cols-1 @lg:grid-cols-3 gap-2 @2xl:gap-4 @2xl:grid-rows-1\">\n <div class=\"grid grid-cols-1 items-center @lg:gap-2 @2xl:grid-cols-2 @lg:col-span-2\">\n <!-- \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls() && showQuantityControl) {\n <!-- \u041F\u043E\u043B\u0435 \u0432\u0432\u043E\u0434\u0430 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [showCross]=\"false\"\n [isDisabled]=\"isDisabled\"\n [step]=\"ScUnitsHelper.getProductMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"showLoader()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-32 shrink-0\"\n />\n } @else {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n >\n <div class=\"!text-body-m text-start\">\n \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E:\n <strong> {{ orderItem.quantity }} \u0448\u0442.</strong>\n </div>\n </button>\n }\n\n @let showAdditionalInfo = orderItem.configurator || orderItem.height || orderItem.length || orderItem.width || orderItem.marker;\n @if (showAdditionalInfo) {\n <div class=\"flex items-center gap-2 @lg:gap-3 max-w-min\">\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls()) {\n <button\n tuiIconButton\n iconStart=\"@tui.settings\"\n [disabled]=\"isDisabled\"\n [loading]=\"showLoader()\"\n (click)=\"clickSettings.emit()\"\n size=\"s\"\n [appearance]=\"isConfiguratorHintVisible() ? 'primary' : 'secondary'\"\n class=\"shrink-0\"\n ></button>\n }\n\n <!-- \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435. -->\n <div\n class=\"flex flex-col gap-x-1 text-tui-base-07\"\n [class.text-body-m]=\"!isShowEditControls()\"\n >\n @if (orderItem.marker) {\n <p>\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430: {{ orderItem.marker }}</p>\n }\n @if (orderItem.width) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0448\u0438\u0440\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0428\u0438\u0440\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.width }} \u043C.</span>\n </button>\n }\n @if (orderItem.height) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432\u044B\u0441\u043E\u0442\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0412\u044B\u0441\u043E\u0442\u0430: <span class=\"text-body-s-bold\">{{ orderItem.height }} \u043C.</span>\n </button>\n } @else if (orderItem.length) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0434\u043B\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0414\u043B\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.length }} \u043C.</span>\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <!-- \u0421\u0443\u043C\u043C\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 \u0438 \u0441\u043A\u043B\u0430\u0434\u0441\u043A\u043E\u0435 \u043D\u0430\u043B\u0438\u0447\u0438\u0435. -->\n <div\n scPrint=\"cost\"\n class=\"flex min-w-[11rem] flex-col @lg:justify-end @2xl:!justify-center text-body-m\"\n >\n <p class=\"whitespace-nowrap\">\n \u0421\u0443\u043C\u043C\u0430:\n <strong> {{ orderItem.costRub | tuiFormatNumber: { precision: 2, decimalSeparator: '.', rounding: 'ceil' } | async }} {{ 'RUB' | tuiCurrency }}</strong>\n </p>\n <sc-price-warehouse-stock\n scPrint=\"defaultNoPrint\"\n [product]=\"product\"\n />\n </div>\n </div>\n </div>\n </sc-noindex-wrapper>\n </div>\n} @else {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i2$2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon", inputs: ["icon", "background"] }, { kind: "ngmodule", type: TuiTextfieldControllerModule }, { kind: "directive", type: i2$3.PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.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: TuiHighlight, selector: "[tuiHighlight]", inputs: ["tuiHighlight", "tuiHighlightColor"] }, { kind: "directive", type: TuiAutoFocus, selector: "[tuiAutoFocus]", inputs: ["tuiAutoFocus"] }, { kind: "component", type: ScHoverImageCarouselComponent, selector: "sc-hover-image-carousel", inputs: ["images", "isShowActions", "productName"] }, { kind: "component", type: CostWithDiscountComponent, selector: "sc-cost-with-discount", inputs: ["product", "size"] }, { kind: "component", type: ScPriceWarehouseStockComponent, selector: "sc-price-warehouse-stock", inputs: ["classList", "product", "withStockHint", "fromMain"] }, { kind: "component", type: ScInputQuantityComponent, selector: "sc-input-quantity", inputs: ["step", "showLoader", "showCross", "ignoreStepValidators", "appearance", "isDisabled", "size"], outputs: ["clickClearEvent"] }, { kind: "pipe", type: TuiCurrencyPipe, name: "tuiCurrency" }, { kind: "pipe", type: TuiFormatNumberPipe, name: "tuiFormatNumber" }, { kind: "component", type: i2$1.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable", "initialScale"] }, { kind: "directive", type: i2$1.TuiPreviewAction, selector: "[tuiPreviewAction]" }, { kind: "component", type: ScNoindexWrapperComponent, selector: "sc-noindex-wrapper" }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "directive", type: ScPrintDirective, selector: "[scPrint]", inputs: ["scPrint"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8034
8309
|
}
|
|
8035
8310
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScOrderItemComponent, decorators: [{
|
|
8036
8311
|
type: Component,
|
|
@@ -8067,7 +8342,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
8067
8342
|
appearance: signal('textfield'),
|
|
8068
8343
|
}),
|
|
8069
8344
|
tuiHintOptionsProvider({ direction: 'top', showDelay: 100, hideDelay: 100 }),
|
|
8070
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (product && orderItem) {\n <div class=\"@container relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\">\n <sc-noindex-wrapper>\n @let isDisabled = product.isHidden || product.isNull;\n <sc-hover-image-carousel\n (click)=\"isDisabled ? null : clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"aspect-square w-24 shrink-0 cursor-pointer self-start\"\n />\n <div class=\"flex w-full flex-col gap-y-1 gap-x-4 @5xl:flex-row @5xl:items-center @5xl:gap-5\">\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n [class.disabled]=\"isDisabled\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n @if (product.supplierSku) {\n <span class=\"text-tui-text-02\"> \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }} </span>\n }\n @if (product.pack) {\n <div class=\"flex items-center gap-1 text-tui-text-02\">\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n @if (product.ignoreMinCountCheck) {\n <tui-icon\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n }\n </div>\n }\n\n <sc-cost-with-discount\n scPrint=\"cost\"\n [product]=\"product\"\n />\n </div>\n @if (orderItem.specificationImgUrl) {\n <a\n tuiLink\n (click)=\"showSpecification(specificationPreview)\"\n [class.disabled]=\"isDisabled\"\n >\n \u0421\u043F\u0435\u0446\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F\n </a>\n }\n <ng-template\n #specificationPreview\n let-preview\n >\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n >\n <img\n *polymorpheusOutlet=\"orderItem.specificationImgUrl as src\"\n alt=\"preview\"\n [src]=\"orderItem.specificationImgUrl\"\n />\n <button\n iconStart=\"@tui.x\"\n title=\"Close\"\n tuiIconButton\n tuiPreviewAction\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n </ng-template>\n </div>\n <div class=\"grid grid-cols-1 @lg:grid-cols-3 gap-2 @2xl:gap-4 @2xl:grid-rows-1\">\n <div class=\"grid grid-cols-1 items-center @lg:gap-2 @2xl:grid-cols-2 @lg:col-span-2\">\n <!-- \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls() && showQuantityControl) {\n <!-- \u041F\u043E\u043B\u0435 \u0432\u0432\u043E\u0434\u0430 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [showCross]=\"false\"\n [isDisabled]=\"isDisabled\"\n [step]=\"unitsHelper.productMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"showLoader()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-32 shrink-0\"\n />\n } @else {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n >\n <div class=\"!text-body-m text-start\">\n \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E:\n <strong> {{ orderItem.quantity }} \u0448\u0442.</strong>\n </div>\n </button>\n }\n\n @let showAdditionalInfo = orderItem.configurator || orderItem.height || orderItem.length || orderItem.width || orderItem.marker;\n @if (showAdditionalInfo) {\n <div class=\"flex items-center gap-2 @lg:gap-3 max-w-min\">\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls()) {\n <button\n tuiIconButton\n iconStart=\"@tui.settings\"\n [disabled]=\"isDisabled\"\n [loading]=\"showLoader()\"\n (click)=\"clickSettings.emit()\"\n size=\"s\"\n [appearance]=\"isConfiguratorHintVisible() ? 'primary' : 'secondary'\"\n class=\"shrink-0\"\n ></button>\n }\n\n <!-- \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435. -->\n <div\n class=\"flex flex-col gap-x-1 text-tui-base-07\"\n [class.text-body-m]=\"!isShowEditControls()\"\n >\n @if (orderItem.marker) {\n <p>\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430: {{ orderItem.marker }}</p>\n }\n @if (orderItem.width) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0448\u0438\u0440\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0428\u0438\u0440\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.width }} \u043C.</span>\n </button>\n }\n @if (orderItem.height) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432\u044B\u0441\u043E\u0442\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0412\u044B\u0441\u043E\u0442\u0430: <span class=\"text-body-s-bold\">{{ orderItem.height }} \u043C.</span>\n </button>\n } @else if (orderItem.length) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0434\u043B\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0414\u043B\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.length }} \u043C.</span>\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <!-- \u0421\u0443\u043C\u043C\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 \u0438 \u0441\u043A\u043B\u0430\u0434\u0441\u043A\u043E\u0435 \u043D\u0430\u043B\u0438\u0447\u0438\u0435. -->\n <div\n scPrint=\"cost\"\n class=\"flex min-w-[11rem] flex-col @lg:justify-end @2xl:!justify-center text-body-m\"\n >\n <p class=\"whitespace-nowrap\">\n \u0421\u0443\u043C\u043C\u0430:\n <strong> {{ orderItem.costRub | tuiFormatNumber: { precision: 2, decimalSeparator: '.', rounding: 'ceil' } | async }} {{ 'RUB' | tuiCurrency }}</strong>\n </p>\n <sc-price-warehouse-stock\n scPrint=\"defaultNoPrint\"\n [product]=\"product\"\n />\n </div>\n </div>\n </div>\n </sc-noindex-wrapper>\n </div>\n} @else {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n}\n" }]
|
|
8345
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (product && orderItem) {\n <div class=\"@container relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\">\n <sc-noindex-wrapper>\n @let isDisabled = product.isHidden || product.isNull;\n <sc-hover-image-carousel\n (click)=\"isDisabled ? null : clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"aspect-square w-24 shrink-0 cursor-pointer self-start\"\n />\n <div class=\"flex w-full flex-col gap-y-1 gap-x-4 @5xl:flex-row @5xl:items-center @5xl:gap-5\">\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n [class.disabled]=\"isDisabled\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n @if (product.supplierSku) {\n <span class=\"text-tui-text-02\"> \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }} </span>\n }\n @if (product.pack) {\n <div class=\"flex items-center gap-1 text-tui-text-02\">\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n @if (product.ignoreMinCountCheck) {\n <tui-icon\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n }\n </div>\n }\n\n <sc-cost-with-discount\n scPrint=\"cost\"\n [product]=\"product\"\n />\n </div>\n @if (orderItem.specificationImgUrl) {\n <a\n tuiLink\n (click)=\"showSpecification(specificationPreview)\"\n [class.disabled]=\"isDisabled\"\n >\n \u0421\u043F\u0435\u0446\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F\n </a>\n }\n <ng-template\n #specificationPreview\n let-preview\n >\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n >\n <img\n *polymorpheusOutlet=\"orderItem.specificationImgUrl as src\"\n alt=\"preview\"\n [src]=\"orderItem.specificationImgUrl\"\n />\n <button\n iconStart=\"@tui.x\"\n title=\"Close\"\n tuiIconButton\n tuiPreviewAction\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n </ng-template>\n </div>\n <div class=\"grid grid-cols-1 @lg:grid-cols-3 gap-2 @2xl:gap-4 @2xl:grid-rows-1\">\n <div class=\"grid grid-cols-1 items-center @lg:gap-2 @2xl:grid-cols-2 @lg:col-span-2\">\n <!-- \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls() && showQuantityControl) {\n <!-- \u041F\u043E\u043B\u0435 \u0432\u0432\u043E\u0434\u0430 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [showCross]=\"false\"\n [isDisabled]=\"isDisabled\"\n [step]=\"ScUnitsHelper.getProductMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"showLoader()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-32 shrink-0\"\n />\n } @else {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n >\n <div class=\"!text-body-m text-start\">\n \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E:\n <strong> {{ orderItem.quantity }} \u0448\u0442.</strong>\n </div>\n </button>\n }\n\n @let showAdditionalInfo = orderItem.configurator || orderItem.height || orderItem.length || orderItem.width || orderItem.marker;\n @if (showAdditionalInfo) {\n <div class=\"flex items-center gap-2 @lg:gap-3 max-w-min\">\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls()) {\n <button\n tuiIconButton\n iconStart=\"@tui.settings\"\n [disabled]=\"isDisabled\"\n [loading]=\"showLoader()\"\n (click)=\"clickSettings.emit()\"\n size=\"s\"\n [appearance]=\"isConfiguratorHintVisible() ? 'primary' : 'secondary'\"\n class=\"shrink-0\"\n ></button>\n }\n\n <!-- \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435. -->\n <div\n class=\"flex flex-col gap-x-1 text-tui-base-07\"\n [class.text-body-m]=\"!isShowEditControls()\"\n >\n @if (orderItem.marker) {\n <p>\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430: {{ orderItem.marker }}</p>\n }\n @if (orderItem.width) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0448\u0438\u0440\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0428\u0438\u0440\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.width }} \u043C.</span>\n </button>\n }\n @if (orderItem.height) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432\u044B\u0441\u043E\u0442\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0412\u044B\u0441\u043E\u0442\u0430: <span class=\"text-body-s-bold\">{{ orderItem.height }} \u043C.</span>\n </button>\n } @else if (orderItem.length) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0434\u043B\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0414\u043B\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.length }} \u043C.</span>\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <!-- \u0421\u0443\u043C\u043C\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 \u0438 \u0441\u043A\u043B\u0430\u0434\u0441\u043A\u043E\u0435 \u043D\u0430\u043B\u0438\u0447\u0438\u0435. -->\n <div\n scPrint=\"cost\"\n class=\"flex min-w-[11rem] flex-col @lg:justify-end @2xl:!justify-center text-body-m\"\n >\n <p class=\"whitespace-nowrap\">\n \u0421\u0443\u043C\u043C\u0430:\n <strong> {{ orderItem.costRub | tuiFormatNumber: { precision: 2, decimalSeparator: '.', rounding: 'ceil' } | async }} {{ 'RUB' | tuiCurrency }}</strong>\n </p>\n <sc-price-warehouse-stock\n scPrint=\"defaultNoPrint\"\n [product]=\"product\"\n />\n </div>\n </div>\n </div>\n </sc-noindex-wrapper>\n </div>\n} @else {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n}\n" }]
|
|
8071
8346
|
}] });
|
|
8072
8347
|
|
|
8073
8348
|
/* eslint-disable no-param-reassign */
|
|
@@ -8237,11 +8512,10 @@ class ScOrderItemsListComponent {
|
|
|
8237
8512
|
*/
|
|
8238
8513
|
openSettingsDialog(item) {
|
|
8239
8514
|
const isConfigurator = Boolean(item.configurator);
|
|
8240
|
-
const { isLinear } = item.product.unit;
|
|
8241
8515
|
if (isConfigurator) {
|
|
8242
8516
|
this.scDialogService.openConfiguratorDialog(item.product, item, this.orderOptions?.orderId());
|
|
8243
8517
|
}
|
|
8244
|
-
else if (
|
|
8518
|
+
else if (ScUnitsHelper.productIsMeasurable(item.product)) {
|
|
8245
8519
|
this.scDialogService.openAddOrEditingCartItemDialog(item.product, item, this.orderOptions?.orderId(), true);
|
|
8246
8520
|
}
|
|
8247
8521
|
}
|
|
@@ -8332,6 +8606,567 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
8332
8606
|
args: [{ standalone: true, selector: 'sc-order-items-list-by-directions', imports: [ScOrderItemsListComponent, TuiButton], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-5\">\n <!-- \u0413\u0440\u0443\u043F\u043F\u044B \u0442\u043E\u0432\u0430\u0440\u043E\u0432 \u043F\u043E \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F\u043C \u043F\u0440\u043E\u0434\u0430\u0436. -->\n @for (direction of itemsByDirections(); track direction.direction?.id; let groupIndex = $index) {\n <div class=\"flex flex-col gap-2.5\">\n @if (direction.direction && itemsByDirections().length > 1) {\n <div class=\"text-base font-bold\">\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043F\u0440\u043E\u0434\u0430\u0436: {{ direction.direction.description }}</div>\n }\n\n <sc-order-items-list\n [items]=\"direction.items\"\n [selectable]=\"selectable()\"\n [editable]=\"editable()\"\n (selectedItemsIdsChange)=\"selectedItemsHandler($event, direction)\"\n />\n\n <!-- \u0424\u0443\u0442\u0435\u0440 \u0433\u0440\u0443\u043F\u043F\u044B \u0442\u043E\u0432\u0430\u0440\u043E\u0432. -->\n <div class=\"flex flex-col items-center sm:flex-row sm:items-start sm:flex-wrap-reverse grow gap-x-2.5 gap-y-4\">\n <ng-content select=\"[footerActions]\" />\n\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0435\u043D\u0438\u044F. -->\n @if (showContinueButton()) {\n <button\n tuiButton\n type=\"button\"\n [disabled]=\"direction.getItemsByIds(selectedItemsIds()).length === 0\"\n [iconStart]=\"continueButtonText().iconStart\"\n class=\"sm:ml-auto\"\n (click)=\"continueClick.emit(direction)\"\n >\n {{ continueButtonText().title }}\n </button>\n }\n </div>\n </div>\n }\n\n @if (nullItems().length) {\n <div class=\"flex flex-col gap-2.5\">\n <div class=\"text-base font-bold\">\u0422\u043E\u0432\u0430\u0440\u044B \u0438 \u0443\u0441\u043B\u0443\u0433\u0438, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F.</div>\n\n <sc-order-items-list\n [items]=\"nullItems()\"\n [selectable]=\"false\"\n [editable]=\"editable()\"\n />\n </div>\n }\n</div>\n" }]
|
|
8333
8607
|
}] });
|
|
8334
8608
|
|
|
8609
|
+
/**
|
|
8610
|
+
* Список товаров заказа по направлению продаж с выбором позиций для оформления.
|
|
8611
|
+
*/
|
|
8612
|
+
class ScOrderDirectionItemsComponent {
|
|
8613
|
+
constructor() {
|
|
8614
|
+
/**
|
|
8615
|
+
* Товары направления.
|
|
8616
|
+
*/
|
|
8617
|
+
this.items = input.required();
|
|
8618
|
+
/**
|
|
8619
|
+
* Разрешить редактирование позиций (количество, удаление).
|
|
8620
|
+
*/
|
|
8621
|
+
this.editable = input(false);
|
|
8622
|
+
/**
|
|
8623
|
+
* Включить выбор позиций чекбоксами.
|
|
8624
|
+
*/
|
|
8625
|
+
this.selectable = input(true);
|
|
8626
|
+
/**
|
|
8627
|
+
* Время обработки и принятия заказов (из настроек окружения приложения).
|
|
8628
|
+
*/
|
|
8629
|
+
this.orderProcessingAcceptanceTime = input('');
|
|
8630
|
+
/**
|
|
8631
|
+
* Изменение выбора позиций для оформления.
|
|
8632
|
+
*/
|
|
8633
|
+
this.selectedItemsIdsChange = output();
|
|
8634
|
+
}
|
|
8635
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScOrderDirectionItemsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8636
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: ScOrderDirectionItemsComponent, isStandalone: true, selector: "sc-order-direction-items", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, orderProcessingAcceptanceTime: { classPropertyName: "orderProcessingAcceptanceTime", publicName: "orderProcessingAcceptanceTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedItemsIdsChange: "selectedItemsIdsChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-5\">\n <ul class=\"ml-4 list-disc text-tui-success-fill\">\n <li>\u0417\u0430\u044F\u0432\u043A\u0438 \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u043D\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u043E\u0433\u043E \u0434\u043D\u044F \u043F\u043E\u0441\u0442\u0430\u0432\u043A\u0438.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B \u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u043E\u0439 \u043D\u0430 \u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u0434\u043E {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B, \u0441\u043E\u0437\u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B \u0438\u043B\u0438 \u0432 \u0441\u0443\u0431\u0431\u043E\u0442\u0443/\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435 \u0431\u0443\u0434\u0443\u0442 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u044B \u0432 \u0431\u0443\u0434\u043D\u0438\u0435 \u0434\u043D\u0438.</li>\n <li>\n \u0423\u043F\u0440\u0430\u0432\u043B\u044F\u0442\u044C \u0441\u043F\u0438\u0441\u043A\u043E\u043C \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u043E\u0432 \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0432\n <a\n tuiLink\n routerLink=\"/profile\"\n >\n \u043B\u0438\u0447\u043D\u043E\u043C \u043A\u0430\u0431\u0438\u043D\u0435\u0442\u0435\n </a>\n .\n </li>\n </ul>\n\n <div class=\"sub-title\">\u0421\u043E\u0441\u0442\u0430\u0432 \u0437\u0430\u043A\u0430\u0437\u0430</div>\n\n <sc-order-items-list-by-directions\n [items]=\"items()\"\n [editable]=\"editable()\"\n [selectable]=\"selectable()\"\n [showContinueButton]=\"false\"\n (selectedItemsIdsChange)=\"selectedItemsIdsChange.emit($event)\"\n >\n <ng-content\n select=\"[footerActions]\"\n ngProjectAs=\"[footerActions]\"\n />\n </sc-order-items-list-by-directions>\n</div>\n", dependencies: [{ kind: "component", type: ScOrderItemsListByDirectionsComponent, selector: "sc-order-items-list-by-directions", inputs: ["items", "selectable", "editable", "showContinueButton", "continueButtonText", "selectedItemsIds"], outputs: ["continueClick", "selectedItemsIdsChange"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8637
|
+
}
|
|
8638
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScOrderDirectionItemsComponent, decorators: [{
|
|
8639
|
+
type: Component,
|
|
8640
|
+
args: [{ standalone: true, selector: 'sc-order-direction-items', imports: [ScOrderItemsListByDirectionsComponent, RouterLink, TuiLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-5\">\n <ul class=\"ml-4 list-disc text-tui-success-fill\">\n <li>\u0417\u0430\u044F\u0432\u043A\u0438 \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u043D\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u043E\u0433\u043E \u0434\u043D\u044F \u043F\u043E\u0441\u0442\u0430\u0432\u043A\u0438.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B \u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u043E\u0439 \u043D\u0430 \u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u0434\u043E {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B, \u0441\u043E\u0437\u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B \u0438\u043B\u0438 \u0432 \u0441\u0443\u0431\u0431\u043E\u0442\u0443/\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435 \u0431\u0443\u0434\u0443\u0442 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u044B \u0432 \u0431\u0443\u0434\u043D\u0438\u0435 \u0434\u043D\u0438.</li>\n <li>\n \u0423\u043F\u0440\u0430\u0432\u043B\u044F\u0442\u044C \u0441\u043F\u0438\u0441\u043A\u043E\u043C \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u043E\u0432 \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0432\n <a\n tuiLink\n routerLink=\"/profile\"\n >\n \u043B\u0438\u0447\u043D\u043E\u043C \u043A\u0430\u0431\u0438\u043D\u0435\u0442\u0435\n </a>\n .\n </li>\n </ul>\n\n <div class=\"sub-title\">\u0421\u043E\u0441\u0442\u0430\u0432 \u0437\u0430\u043A\u0430\u0437\u0430</div>\n\n <sc-order-items-list-by-directions\n [items]=\"items()\"\n [editable]=\"editable()\"\n [selectable]=\"selectable()\"\n [showContinueButton]=\"false\"\n (selectedItemsIdsChange)=\"selectedItemsIdsChange.emit($event)\"\n >\n <ng-content\n select=\"[footerActions]\"\n ngProjectAs=\"[footerActions]\"\n />\n </sc-order-items-list-by-directions>\n</div>\n" }]
|
|
8641
|
+
}] });
|
|
8642
|
+
|
|
8643
|
+
/**
|
|
8644
|
+
* Токен настроек {@link ScOrderFormComponent}.
|
|
8645
|
+
* Если не предоставлен, сохранение и восстановление метаданных формы отключены.
|
|
8646
|
+
*/
|
|
8647
|
+
const SC_ORDER_FORM_CONFIG = new InjectionToken('SC_ORDER_FORM_CONFIG');
|
|
8648
|
+
|
|
8649
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion,rxjs/no-sharereplay,@typescript-eslint/no-unsafe-enum-comparison,@typescript-eslint/unbound-method,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-argument,security/detect-object-injection */
|
|
8650
|
+
/**
|
|
8651
|
+
* Форма оформления заказа.
|
|
8652
|
+
*/
|
|
8653
|
+
class ScOrderFormComponent {
|
|
8654
|
+
/**
|
|
8655
|
+
* Инициализирует экземпляр класса {@link ScOrderFormComponent}.
|
|
8656
|
+
*/
|
|
8657
|
+
constructor() {
|
|
8658
|
+
/**
|
|
8659
|
+
* Идентификатор направления продаж заказа.
|
|
8660
|
+
*/
|
|
8661
|
+
this.directionId = input.required();
|
|
8662
|
+
/**
|
|
8663
|
+
* Требовать подтверждённые контактные данные для оформления. Для черновика — `false`.
|
|
8664
|
+
*/
|
|
8665
|
+
this.enforceApprovedContacts = input(true);
|
|
8666
|
+
/**
|
|
8667
|
+
* Сохранять и восстанавливать черновые данные формы по направлению (метаданные). Для черновика — `false`.
|
|
8668
|
+
* Работает только если предоставлен токен {@link SC_ORDER_FORM_CONFIG}.
|
|
8669
|
+
*/
|
|
8670
|
+
this.persistMetadata = input(true);
|
|
8671
|
+
/**
|
|
8672
|
+
* Событие отправки валидной формы оформления. Полезная нагрузка — сырые значения формы.
|
|
8673
|
+
*/
|
|
8674
|
+
this.orderSubmit = output();
|
|
8675
|
+
/**
|
|
8676
|
+
* Сервис справочников.
|
|
8677
|
+
*/
|
|
8678
|
+
this.referencesService = inject(ScReferencesService);
|
|
8679
|
+
/**
|
|
8680
|
+
* Сервис работы с контрагентами.
|
|
8681
|
+
*/
|
|
8682
|
+
this.contragentService = inject(ScContragentService);
|
|
8683
|
+
/**
|
|
8684
|
+
* Сервис работы с адресами доставки.
|
|
8685
|
+
*/
|
|
8686
|
+
this.deliveryAddressService = inject(ScDeliveryAddressService);
|
|
8687
|
+
/**
|
|
8688
|
+
* Сервис для работы со складами.
|
|
8689
|
+
*/
|
|
8690
|
+
this.warehouseService = inject(ScWarehouseService);
|
|
8691
|
+
/**
|
|
8692
|
+
* Сервис для работы с заказами (загрузка дат доставки/самовывоза).
|
|
8693
|
+
*/
|
|
8694
|
+
this.ordersService = inject(ScOrdersService);
|
|
8695
|
+
/**
|
|
8696
|
+
* Сервис для работы с UI.
|
|
8697
|
+
*/
|
|
8698
|
+
this.uiService = inject(ScUIService);
|
|
8699
|
+
/**
|
|
8700
|
+
* Сервис конвертации данных.
|
|
8701
|
+
*/
|
|
8702
|
+
this.convertersService = inject(ScConvertersService);
|
|
8703
|
+
/**
|
|
8704
|
+
* Сервис работы с диалоговым окном.
|
|
8705
|
+
*/
|
|
8706
|
+
this.dialog = inject(TuiDialogService);
|
|
8707
|
+
/**
|
|
8708
|
+
* Провайдер данных о терминале.
|
|
8709
|
+
*/
|
|
8710
|
+
this.terminal = inject(IS_RUNNING_ON_TERMINAL);
|
|
8711
|
+
/**
|
|
8712
|
+
* Поток данных о текущем пользователе.
|
|
8713
|
+
*/
|
|
8714
|
+
this.user$ = inject(SC_USER_INFO$1);
|
|
8715
|
+
/**
|
|
8716
|
+
* Настройки формы оформления заказа. Если не предоставлены, метаданные формы не сохраняются.
|
|
8717
|
+
*/
|
|
8718
|
+
this.config = inject(SC_ORDER_FORM_CONFIG, { optional: true });
|
|
8719
|
+
/**
|
|
8720
|
+
* Признак выполнения скрипта на сервере.
|
|
8721
|
+
*/
|
|
8722
|
+
this.isServer = inject(IS_SERVER);
|
|
8723
|
+
/**
|
|
8724
|
+
* Ссылка для автоматического управления уничтожением зависимостей.
|
|
8725
|
+
*/
|
|
8726
|
+
this.destroyRef = inject(DestroyRef);
|
|
8727
|
+
/**
|
|
8728
|
+
* Задержка считывания сигналов формы, для избежания лишних обработок при смене значений.
|
|
8729
|
+
*/
|
|
8730
|
+
this.debounceTimeFormChange = 50;
|
|
8731
|
+
/**
|
|
8732
|
+
* Форма создания заказа.
|
|
8733
|
+
*/
|
|
8734
|
+
this.form = new FormGroup({
|
|
8735
|
+
contragentId: new FormControl(null, Validators.required),
|
|
8736
|
+
paymentType: new FormControl({ value: null, disabled: true }, Validators.required),
|
|
8737
|
+
deliveryType: new FormControl({ value: null, disabled: true }, Validators.required),
|
|
8738
|
+
deliveryDate: new FormControl({ value: null, disabled: true }, [
|
|
8739
|
+
Validators.required,
|
|
8740
|
+
({ value }) => {
|
|
8741
|
+
if (!value || this.deliveryDates().length === 0) {
|
|
8742
|
+
return null;
|
|
8743
|
+
}
|
|
8744
|
+
if (value && !this.deliveryDates().includes(value)) {
|
|
8745
|
+
return { serverResponse: 'Укажите корректную дату, или выберите из активных дат календаря' };
|
|
8746
|
+
}
|
|
8747
|
+
return null;
|
|
8748
|
+
},
|
|
8749
|
+
]),
|
|
8750
|
+
warehouseId: new FormControl({ value: null, disabled: true }, Validators.required),
|
|
8751
|
+
addressId: new FormControl({ value: null, disabled: true }, Validators.required),
|
|
8752
|
+
comment: new FormControl(null),
|
|
8753
|
+
image: new FormControl(null),
|
|
8754
|
+
});
|
|
8755
|
+
/**
|
|
8756
|
+
* Поле файла.
|
|
8757
|
+
*/
|
|
8758
|
+
this.controlFile = new FormControl(null);
|
|
8759
|
+
/**
|
|
8760
|
+
* {@link Observable} списка подтверждённых файлов.
|
|
8761
|
+
*/
|
|
8762
|
+
this.accepted$ = this.controlFile.valueChanges.pipe(map(() => tuiFilesAccepted(this.controlFile)));
|
|
8763
|
+
/**
|
|
8764
|
+
* Признак, что включён режим анимации предупреждения о неподтверждённых данных.
|
|
8765
|
+
*/
|
|
8766
|
+
this.warningShake = signal(false);
|
|
8767
|
+
/**
|
|
8768
|
+
* Признак, что контрагент является физическим лицом.
|
|
8769
|
+
*/
|
|
8770
|
+
this.isIndividual = signal(true);
|
|
8771
|
+
/**
|
|
8772
|
+
* Список возможных дат самовывоза со склада.
|
|
8773
|
+
*/
|
|
8774
|
+
this.warehouseDeliveryDates = signal([]);
|
|
8775
|
+
/**
|
|
8776
|
+
* Список возможных дат доставки.
|
|
8777
|
+
*/
|
|
8778
|
+
this.addressDeliveryDates = signal([]);
|
|
8779
|
+
/**
|
|
8780
|
+
* {@link Observable} списка контрагентов пользователя.
|
|
8781
|
+
*/
|
|
8782
|
+
this.contragents$ = this.contragentService.contragents$;
|
|
8783
|
+
/**
|
|
8784
|
+
* {@link Observable} списка адресов контрагента.
|
|
8785
|
+
*/
|
|
8786
|
+
this.addresses$ = this.deliveryAddressService.deliveryAddresses$.pipe(tap((deliveryAddresses) => {
|
|
8787
|
+
if (deliveryAddresses && this.form.controls.addressId.value && !deliveryAddresses.some((delivery) => delivery.id === this.form.controls.addressId.value)) {
|
|
8788
|
+
this.form.controls.addressId.reset();
|
|
8789
|
+
}
|
|
8790
|
+
}));
|
|
8791
|
+
/**
|
|
8792
|
+
* {@link Observable} списка складов.
|
|
8793
|
+
*/
|
|
8794
|
+
this.warehouses$ = this.warehouseService.getWarehouses$();
|
|
8795
|
+
/**
|
|
8796
|
+
* {@link Observable} ОПФ выбранного контрагента.
|
|
8797
|
+
*/
|
|
8798
|
+
this.opf$ = tuiControlValue(this.form.controls.contragentId).pipe(filter(tuiIsPresent), tap(() => {
|
|
8799
|
+
this.form.controls.paymentType.enable();
|
|
8800
|
+
this.form.controls.deliveryType.enable();
|
|
8801
|
+
}), switchMap((selectContragentId) => this.contragents$.pipe(filter(tuiIsPresent), map((contragents) => contragents.find((contragent) => contragent.id === selectContragentId)), map((contragent) => contragent?.opf), tap((opf) => {
|
|
8802
|
+
this.isIndividual.set(opf?.id === ScOpfList.individual.valueOf());
|
|
8803
|
+
}))), shareReplay(1), takeUntilDestroyed(this.destroyRef));
|
|
8804
|
+
/**
|
|
8805
|
+
* {@link Observable} типов оплаты заказа.
|
|
8806
|
+
*/
|
|
8807
|
+
this.paymentTypes$ = this.opf$.pipe(map((opf) => opf && (opf.id === ScOpfList.individual ? ScPaymentType.beznal2 : ScPaymentType.online)), switchMap((paymentTypeFilter) => this.referencesService.paymentTypes$.pipe(map((paymentTypes) => (paymentTypeFilter ? paymentTypes : [])), map((paymentTypes) => paymentTypes.filter((type) => type.id !== paymentTypeFilter)), tap((paymentTypes) => {
|
|
8808
|
+
if (this.form.controls.paymentType.value && !paymentTypes.some((payment) => payment.id === this.form.controls.paymentType.value)) {
|
|
8809
|
+
this.form.controls.paymentType.reset();
|
|
8810
|
+
}
|
|
8811
|
+
if (!this.form.controls.paymentType.value && paymentTypes.length === 1) {
|
|
8812
|
+
this.form.controls.paymentType.patchValue(paymentTypes[0].id);
|
|
8813
|
+
}
|
|
8814
|
+
}))));
|
|
8815
|
+
/**
|
|
8816
|
+
* {@link Observable} типов доставки заказа.
|
|
8817
|
+
*/
|
|
8818
|
+
this.deliveryTypes$ = this.opf$.pipe(switchMap((opf) => this.referencesService.deliveryTypes$.pipe(map((deliveryTypes) => (opf ? deliveryTypes : [])), switchMap((deliveryTypes) => this.deliveryAddressService.deliveryAddresses$.pipe(map((deliveryAddresses) => opf?.id === ScOpfList.individual && !(deliveryAddresses && deliveryAddresses.length > 0)
|
|
8819
|
+
? deliveryTypes.filter((type) => type.id !== ScDeliveryType.delivery)
|
|
8820
|
+
: deliveryTypes))), tap((deliveryTypes) => {
|
|
8821
|
+
if (this.form.controls.deliveryType.value && !deliveryTypes.some((delivery) => delivery.id === this.form.controls.deliveryType.value)) {
|
|
8822
|
+
this.form.controls.deliveryType.reset();
|
|
8823
|
+
}
|
|
8824
|
+
if (!this.form.controls.deliveryType.value && deliveryTypes.length === 1) {
|
|
8825
|
+
this.form.controls.deliveryType.patchValue(deliveryTypes[0].id);
|
|
8826
|
+
}
|
|
8827
|
+
}))));
|
|
8828
|
+
/**
|
|
8829
|
+
* Признак, что выбран тип оплаты наличными.
|
|
8830
|
+
*/
|
|
8831
|
+
this.isCashPaymentSelected = toSignal(tuiControlValue(this.form.controls.paymentType).pipe(map((paymentType) => paymentType === ScPaymentType.nal)), { initialValue: false });
|
|
8832
|
+
/**
|
|
8833
|
+
* Признак, что номер телефона подтверждён.
|
|
8834
|
+
*/
|
|
8835
|
+
this.isPhoneApproved = toSignal(this.user$.pipe(filter((user) => !user.isGuest), map((user) => user.contacts.phone.isApproved)), { initialValue: true });
|
|
8836
|
+
/**
|
|
8837
|
+
* Признак, что адрес электронной почты подтверждён пользователем.
|
|
8838
|
+
*/
|
|
8839
|
+
this.isEmailApprovedUser = toSignal(this.user$.pipe(filter((user) => !user.isGuest), map((user) => user.contacts.email.isApproved)), { initialValue: true });
|
|
8840
|
+
/**
|
|
8841
|
+
* Признак, что адрес электронной почты подтверждён или контрагент является физическим лицом.
|
|
8842
|
+
*/
|
|
8843
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping
|
|
8844
|
+
this.isEmailApproved = computed(() => this.isEmailApprovedUser() || this.isIndividual());
|
|
8845
|
+
/**
|
|
8846
|
+
* Значение выбранного типа доставки.
|
|
8847
|
+
*/
|
|
8848
|
+
this.deliveryTypeValue = toSignal(tuiControlValue(this.form.controls.deliveryType), { initialValue: null });
|
|
8849
|
+
/**
|
|
8850
|
+
* Признак, что выбран тип доставки "Доставка".
|
|
8851
|
+
*/
|
|
8852
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping
|
|
8853
|
+
this.isDelivery = computed(() => this.deliveryTypeValue() === ScDeliveryType.delivery);
|
|
8854
|
+
/**
|
|
8855
|
+
* Набор доступных дат в зависимости от типа доставки.
|
|
8856
|
+
*/
|
|
8857
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping
|
|
8858
|
+
this.deliveryDates = computed(() => this.deliveryTypeValue() === ScDeliveryType.self_delivery ? this.warehouseDeliveryDates() : this.addressDeliveryDates());
|
|
8859
|
+
/**
|
|
8860
|
+
* Ссылка на элемент с предупреждением о неподтверждённых данных.
|
|
8861
|
+
*/
|
|
8862
|
+
this.unconfirmedDataWarning = viewChild('unconfirmedDataWarning');
|
|
8863
|
+
/**
|
|
8864
|
+
* Возвращает признак, что указанная дата недоступна для выбора.
|
|
8865
|
+
*
|
|
8866
|
+
* @param date Дата.
|
|
8867
|
+
*/
|
|
8868
|
+
this.deliveryDateFilter = (date) => !this.deliveryDates().includes(`${date.toString('YMD', '-')} 00:00:00`);
|
|
8869
|
+
// Автоматически выбираем единственного контрагента-физлицо.
|
|
8870
|
+
this.contragents$
|
|
8871
|
+
.pipe(filter((contragents) => !!contragents && contragents.length === 1), first(), filter(([contragent]) => contragent.opf.id === ScOpfList.individual.valueOf()), takeUntilDestroyed(this.destroyRef))
|
|
8872
|
+
.subscribe(([contragent]) => {
|
|
8873
|
+
this.form.controls.contragentId?.patchValue(contragent.id);
|
|
8874
|
+
});
|
|
8875
|
+
this.initFormChanges();
|
|
8876
|
+
}
|
|
8877
|
+
/** @inheritdoc */
|
|
8878
|
+
ngOnInit() {
|
|
8879
|
+
// Восстанавливаем и сохраняем черновые данные формы по направлению.
|
|
8880
|
+
if (this.persistMetadata()) {
|
|
8881
|
+
this.initMetadata();
|
|
8882
|
+
}
|
|
8883
|
+
}
|
|
8884
|
+
/**
|
|
8885
|
+
* Преобразует объекты в значения, отображаемое в поле ввода.
|
|
8886
|
+
*
|
|
8887
|
+
* @param items Выбранные объекты выпадающего списка.
|
|
8888
|
+
*/
|
|
8889
|
+
// eslint-disable-next-line class-methods-use-this
|
|
8890
|
+
stringify(items) {
|
|
8891
|
+
const itemsMap = new Map(items.map((item) => {
|
|
8892
|
+
// eslint-disable-next-line unicorn/no-nested-ternary,sonarjs/no-nested-conditional
|
|
8893
|
+
const name = 'name' in item ? item.name : 'address' in item ? item.address : '';
|
|
8894
|
+
return [item.id, name];
|
|
8895
|
+
}));
|
|
8896
|
+
return ({ $implicit }) => itemsMap.get($implicit) ?? '';
|
|
8897
|
+
}
|
|
8898
|
+
/**
|
|
8899
|
+
* Обрабатывает отправку формы: валидирует и эмитит данные заказа родителю.
|
|
8900
|
+
*/
|
|
8901
|
+
submit() {
|
|
8902
|
+
this.form.markAllAsTouched();
|
|
8903
|
+
if (!this.form.valid) {
|
|
8904
|
+
return;
|
|
8905
|
+
}
|
|
8906
|
+
const contactsApproved = !this.enforceApprovedContacts() || (this.isPhoneApproved() && this.isEmailApproved());
|
|
8907
|
+
if (!contactsApproved) {
|
|
8908
|
+
this.triggerUnconfirmedWarning();
|
|
8909
|
+
return;
|
|
8910
|
+
}
|
|
8911
|
+
this.orderSubmit.emit(this.form.getRawValue());
|
|
8912
|
+
}
|
|
8913
|
+
/**
|
|
8914
|
+
* Применяет к полям формы ошибки, пришедшие от сервера.
|
|
8915
|
+
*
|
|
8916
|
+
* @param error Ответ сервера с ошибками.
|
|
8917
|
+
*/
|
|
8918
|
+
applyServerErrors(error) {
|
|
8919
|
+
const { errors, message } = error.error;
|
|
8920
|
+
if (errors) {
|
|
8921
|
+
Object.keys(errors).forEach((key) => {
|
|
8922
|
+
if (key === 'deliveryDate' && isArray(errors[key])) {
|
|
8923
|
+
this.form.get(key)?.setErrors({ serverResponse: new TuiValidationError(errors[key].at(1) ?? errors[key].at(0)) });
|
|
8924
|
+
}
|
|
8925
|
+
else {
|
|
8926
|
+
this.form.get(key)?.setErrors({ serverResponse: new TuiValidationError(errors[key]) });
|
|
8927
|
+
}
|
|
8928
|
+
this.form.get(key)?.markAsTouched();
|
|
8929
|
+
});
|
|
8930
|
+
}
|
|
8931
|
+
else if (message) {
|
|
8932
|
+
this.form.setErrors({ serverResponse: new TuiValidationError(message) });
|
|
8933
|
+
}
|
|
8934
|
+
}
|
|
8935
|
+
/**
|
|
8936
|
+
* Удаляет файл из формы заказа.
|
|
8937
|
+
*/
|
|
8938
|
+
removeFile() {
|
|
8939
|
+
this.controlFile.reset();
|
|
8940
|
+
}
|
|
8941
|
+
/**
|
|
8942
|
+
* Открывает диалоговое окно добавления адреса доставки.
|
|
8943
|
+
*/
|
|
8944
|
+
addDeliveryAddress() {
|
|
8945
|
+
this.dialog
|
|
8946
|
+
.open(new PolymorpheusComponent(ScAddDeliveryAddressDialogComponent), {
|
|
8947
|
+
size: 'l',
|
|
8948
|
+
label: 'Добавление адреса доставки',
|
|
8949
|
+
})
|
|
8950
|
+
.subscribe();
|
|
8951
|
+
}
|
|
8952
|
+
/**
|
|
8953
|
+
* Открывает диалоговое окно добавления контрагента.
|
|
8954
|
+
*/
|
|
8955
|
+
addContragent() {
|
|
8956
|
+
this.dialog
|
|
8957
|
+
.open(new PolymorpheusComponent(ScAddContragentDialogComponent), {
|
|
8958
|
+
size: 'm',
|
|
8959
|
+
label: 'Добавление контрагента',
|
|
8960
|
+
})
|
|
8961
|
+
.subscribe();
|
|
8962
|
+
}
|
|
8963
|
+
/**
|
|
8964
|
+
* Запускает анимацию предупреждения о неподтверждённых данных и прокручивает к нему.
|
|
8965
|
+
*/
|
|
8966
|
+
triggerUnconfirmedWarning() {
|
|
8967
|
+
const element = this.unconfirmedDataWarning()?.nativeElement;
|
|
8968
|
+
if (!this.isServer && element) {
|
|
8969
|
+
element.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
8970
|
+
}
|
|
8971
|
+
this.warningShake.set(false);
|
|
8972
|
+
setTimeout(() => {
|
|
8973
|
+
this.warningShake.set(true);
|
|
8974
|
+
});
|
|
8975
|
+
}
|
|
8976
|
+
/**
|
|
8977
|
+
* Восстанавливает черновые данные формы из метаданных и инициализирует их сохранение.
|
|
8978
|
+
*/
|
|
8979
|
+
initMetadata() {
|
|
8980
|
+
const { config } = this;
|
|
8981
|
+
if (!config) {
|
|
8982
|
+
return;
|
|
8983
|
+
}
|
|
8984
|
+
combineLatest({
|
|
8985
|
+
orderMetadata: this.uiService.getNewOrderMetadata$(this.directionId()),
|
|
8986
|
+
user: this.user$.pipe(filter((user) => !user.isGuest)),
|
|
8987
|
+
})
|
|
8988
|
+
.pipe(first(), takeUntilDestroyed(this.destroyRef))
|
|
8989
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
8990
|
+
.subscribe(({ orderMetadata }) => {
|
|
8991
|
+
let deliveryDate = orderMetadata?.deliveryDate && isValid(parse(orderMetadata.deliveryDate, config.dateFormats.api, new Date())) ? orderMetadata.deliveryDate : null;
|
|
8992
|
+
// Если дата старого формата, то преобразуем её в новый формат.
|
|
8993
|
+
// TODO: Убрать этот блок когда все даты у клиентов встанут в нормальном формате.
|
|
8994
|
+
if (orderMetadata?.deliveryDate && !deliveryDate && isValid(parse(orderMetadata.deliveryDate, config.dateFormats.uiDate, new Date()))) {
|
|
8995
|
+
deliveryDate = format(parse(orderMetadata.deliveryDate, config.dateFormats.uiDate, new Date()), config.dateFormats.api);
|
|
8996
|
+
}
|
|
8997
|
+
if (tuiIsPresent(orderMetadata)) {
|
|
8998
|
+
this.form.patchValue({
|
|
8999
|
+
contragentId: orderMetadata.contragentId,
|
|
9000
|
+
paymentType: orderMetadata.contragentId ? orderMetadata.paymentType : null,
|
|
9001
|
+
deliveryType: orderMetadata.contragentId ? orderMetadata.deliveryType : null,
|
|
9002
|
+
deliveryDate: orderMetadata.contragentId && Boolean(orderMetadata.deliveryType) && deliveryDate ? deliveryDate : null,
|
|
9003
|
+
addressId: orderMetadata.deliveryType === ScDeliveryType.delivery && orderMetadata.addressId ? orderMetadata.addressId : null,
|
|
9004
|
+
warehouseId: orderMetadata.contragentId && Boolean(orderMetadata.deliveryType) ? orderMetadata.warehouseId : null,
|
|
9005
|
+
comment: orderMetadata.comment,
|
|
9006
|
+
});
|
|
9007
|
+
}
|
|
9008
|
+
});
|
|
9009
|
+
this.form.valueChanges.pipe(debounceTime(config.debounceTime), takeUntilDestroyed(this.destroyRef)).subscribe((newOrder) => {
|
|
9010
|
+
this.uiService.setNewOrderMetadata(this.directionId(), this.convertersService.removeNull(newOrder));
|
|
9011
|
+
});
|
|
9012
|
+
}
|
|
9013
|
+
/**
|
|
9014
|
+
* Инициализирует подписки на изменения полей формы.
|
|
9015
|
+
*/
|
|
9016
|
+
initFormChanges() {
|
|
9017
|
+
this.initFileChange();
|
|
9018
|
+
this.initWarehouseChange();
|
|
9019
|
+
this.initDeliveryDatesChange();
|
|
9020
|
+
this.initDateFieldActivationChange();
|
|
9021
|
+
}
|
|
9022
|
+
/**
|
|
9023
|
+
* Инициализирует подписку на изменение поля прикрепления файла.
|
|
9024
|
+
*/
|
|
9025
|
+
initFileChange() {
|
|
9026
|
+
this.controlFile.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((file) => {
|
|
9027
|
+
if (file && this.form.controls.image) {
|
|
9028
|
+
this.onUploadFile(file, this.form.controls.image);
|
|
9029
|
+
}
|
|
9030
|
+
else {
|
|
9031
|
+
this.form.controls.image?.reset();
|
|
9032
|
+
}
|
|
9033
|
+
});
|
|
9034
|
+
}
|
|
9035
|
+
/**
|
|
9036
|
+
* Инициализирует подписку на изменение выбранного склада.
|
|
9037
|
+
*/
|
|
9038
|
+
initWarehouseChange() {
|
|
9039
|
+
this.form.controls.warehouseId.valueChanges
|
|
9040
|
+
.pipe(filter((warehouseId) => tuiIsPresent(warehouseId) && this.warehouseService.getCurrentWarehouseIdSelect() !== warehouseId), debounceTime(0), takeUntilDestroyed(this.destroyRef))
|
|
9041
|
+
.subscribe((id) => {
|
|
9042
|
+
this.warehouseService.setWarehouseIdSelectChange(id);
|
|
9043
|
+
});
|
|
9044
|
+
}
|
|
9045
|
+
/**
|
|
9046
|
+
* Инициализирует подписку на изменение адреса доставки и выбранного склада для получения списка доступных дат доставки.
|
|
9047
|
+
*/
|
|
9048
|
+
initDeliveryDatesChange() {
|
|
9049
|
+
merge(tuiControlValue(this.form.controls.addressId).pipe(filter(tuiIsPresent), debounceTime(this.debounceTimeFormChange), switchMap((addressId) => this.deliveriesByAddress(addressId))), tuiControlValue(this.form.controls.warehouseId).pipe(filter(tuiIsPresent), debounceTime(this.debounceTimeFormChange), filter(() => this.form.controls.deliveryType.value === ScDeliveryType.self_delivery), switchMap((warehouseId) => this.deliveriesByWarehouse(warehouseId))))
|
|
9050
|
+
.pipe(catchError((error) => {
|
|
9051
|
+
this.form.controls.deliveryDate.disable();
|
|
9052
|
+
return throwError(() => error);
|
|
9053
|
+
}), retry(), takeUntilDestroyed(this.destroyRef))
|
|
9054
|
+
.subscribe((deliveryDates) => {
|
|
9055
|
+
const deliveryDateValue = this.form.controls.deliveryDate.value;
|
|
9056
|
+
if (deliveryDateValue && !deliveryDates.includes(deliveryDateValue)) {
|
|
9057
|
+
this.form.controls.deliveryDate.reset();
|
|
9058
|
+
}
|
|
9059
|
+
});
|
|
9060
|
+
}
|
|
9061
|
+
/**
|
|
9062
|
+
* Инициализирует подписку на изменение полей формы для блокирования/активации поля выбора даты.
|
|
9063
|
+
*/
|
|
9064
|
+
initDateFieldActivationChange() {
|
|
9065
|
+
merge(tuiControlValue(this.form.controls.deliveryType), this.form.controls.contragentId?.valueChanges.pipe(filter(() => this.form.controls.deliveryType.value === ScDeliveryType.delivery)) ?? of())
|
|
9066
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
9067
|
+
.subscribe(() => {
|
|
9068
|
+
this.form.controls.deliveryDate.disable();
|
|
9069
|
+
this.form.controls.warehouseId.disable();
|
|
9070
|
+
this.addressDeliveryDates.set([]);
|
|
9071
|
+
if (this.form.controls.deliveryType.value === ScDeliveryType.delivery) {
|
|
9072
|
+
this.form.controls.addressId.enable();
|
|
9073
|
+
this.warehouseService
|
|
9074
|
+
.getDeliveryWarehouse$()
|
|
9075
|
+
.pipe(first(), takeUntilDestroyed(this.destroyRef))
|
|
9076
|
+
// eslint-disable-next-line rxjs/no-nested-subscribe
|
|
9077
|
+
.subscribe((warehouse) => {
|
|
9078
|
+
this.form.controls.warehouseId.patchValue(warehouse.id);
|
|
9079
|
+
});
|
|
9080
|
+
}
|
|
9081
|
+
if (this.form.controls.deliveryType.value === ScDeliveryType.self_delivery) {
|
|
9082
|
+
this.form.controls.addressId.disable();
|
|
9083
|
+
this.form.controls.warehouseId.enable();
|
|
9084
|
+
}
|
|
9085
|
+
});
|
|
9086
|
+
}
|
|
9087
|
+
/**
|
|
9088
|
+
* Запрашивает даты доставки по адресу.
|
|
9089
|
+
*
|
|
9090
|
+
* @param addressId Идентификатор адреса доставки.
|
|
9091
|
+
*/
|
|
9092
|
+
deliveriesByAddress(addressId) {
|
|
9093
|
+
return this.ordersService.getDeliveriesData$(addressId).pipe(catchError((error) => {
|
|
9094
|
+
const message = error instanceof HttpErrorResponse ? error.error.message : undefined;
|
|
9095
|
+
this.form.controls.addressId.setErrors({
|
|
9096
|
+
serverResponse: message ?? `Ошибка сервера: пожалуйста, перезагрузите страницу и/или выполните запрос позже.`,
|
|
9097
|
+
});
|
|
9098
|
+
this.addressDeliveryDates.set([]);
|
|
9099
|
+
return throwError(() => error);
|
|
9100
|
+
}), tap((deliveryDates) => {
|
|
9101
|
+
this.addressDeliveryDates.set(deliveryDates);
|
|
9102
|
+
this.form.controls.deliveryDate.enable();
|
|
9103
|
+
}));
|
|
9104
|
+
}
|
|
9105
|
+
/**
|
|
9106
|
+
* Запрашивает даты самовывоза по складу.
|
|
9107
|
+
*
|
|
9108
|
+
* @param warehouseId Идентификатор склада.
|
|
9109
|
+
*/
|
|
9110
|
+
deliveriesByWarehouse(warehouseId) {
|
|
9111
|
+
return this.ordersService.getSelfDeliveriesData$(warehouseId).pipe(catchError((error) => {
|
|
9112
|
+
const message = error instanceof HttpErrorResponse ? error.error.message : undefined;
|
|
9113
|
+
this.form.controls.warehouseId.setErrors({
|
|
9114
|
+
serverResponse: message ?? `Ошибка сервера: пожалуйста, перезагрузите страницу и/или выполните запрос позже.`,
|
|
9115
|
+
});
|
|
9116
|
+
this.warehouseDeliveryDates.set([]);
|
|
9117
|
+
return throwError(() => error);
|
|
9118
|
+
}), tap((deliveryDates) => {
|
|
9119
|
+
this.warehouseDeliveryDates.set(deliveryDates);
|
|
9120
|
+
this.form.controls.deliveryDate.enable();
|
|
9121
|
+
}));
|
|
9122
|
+
}
|
|
9123
|
+
/**
|
|
9124
|
+
* Загружает файл в форму.
|
|
9125
|
+
*
|
|
9126
|
+
* @param file Файл.
|
|
9127
|
+
* @param filesControl Поле файла заказа.
|
|
9128
|
+
*/
|
|
9129
|
+
// eslint-disable-next-line class-methods-use-this
|
|
9130
|
+
onUploadFile(file, filesControl) {
|
|
9131
|
+
const reader = new FileReader();
|
|
9132
|
+
reader.addEventListener('load', () => {
|
|
9133
|
+
const { result } = reader;
|
|
9134
|
+
if (isString(result)) {
|
|
9135
|
+
filesControl.setValue(new ScUploadedFile(file.name, result));
|
|
9136
|
+
}
|
|
9137
|
+
});
|
|
9138
|
+
reader.readAsDataURL(file);
|
|
9139
|
+
}
|
|
9140
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScOrderFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9141
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ScOrderFormComponent, isStandalone: true, selector: "sc-order-form", inputs: { directionId: { classPropertyName: "directionId", publicName: "directionId", isSignal: true, isRequired: true, transformFunction: null }, enforceApprovedContacts: { classPropertyName: "enforceApprovedContacts", publicName: "enforceApprovedContacts", isSignal: true, isRequired: false, transformFunction: null }, persistMetadata: { classPropertyName: "persistMetadata", publicName: "persistMetadata", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { orderSubmit: "orderSubmit" }, providers: [TERMINAL_PROVIDERS], viewQueries: [{ propertyName: "unconfirmedDataWarning", first: true, predicate: ["unconfirmedDataWarning"], descendants: true, isSignal: true }], ngImport: i0, template: "@let user = user$ | async;\n\n<form\n [formGroup]=\"form\"\n scFocusFirstInvalidField\n [fieldOrder]=\"['contragentId', 'paymentType', 'deliveryType', 'warehouseId', 'addressId', 'deliveryDate', 'comment']\"\n (ngSubmit)=\"submit()\"\n class=\"flex flex-col gap-4\"\n>\n <ng-template #selectLoading> <tui-loader /> </ng-template>\n\n <!-- \u041A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442. -->\n @if (contragents$ | async; as contragents) {\n @if (contragents.length > 1 || user?.isOrg) {\n <label tuiLabel>\n \u041A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\n <tui-select\n formControlName=\"contragentId\"\n [valueContent]=\"contragents ? stringify(contragents) : selectLoading\"\n >\n \u041A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\n <tui-data-list *tuiDataList>\n @for (contragent of contragents; track contragent.id) {\n <button\n tuiOption\n [value]=\"contragent.id\"\n >\n {{ contragent.name }}\n </button>\n }\n </tui-data-list>\n </tui-select>\n <tui-error\n formControlName=\"contragentId\"\n [error]=\"[] | tuiFieldError | async\"\n />\n <a\n tuiLink\n iconStart=\"@tui.plus\"\n (click)=\"addContragent()\"\n class=\"mt-2 block\"\n >\n \u041D\u043E\u0432\u044B\u0439\n </a>\n </label>\n }\n }\n\n <!-- \u0422\u0438\u043F \u043E\u043F\u043B\u0430\u0442\u044B. -->\n <label tuiLabel>\n \u0422\u0438\u043F \u043E\u043F\u043B\u0430\u0442\u044B\n @let paymentTypes = paymentTypes$ | async;\n <tui-select\n formControlName=\"paymentType\"\n [valueContent]=\"paymentTypes ? stringify(paymentTypes) : selectLoading\"\n >\n \u0422\u0438\u043F \u043E\u043F\u043B\u0430\u0442\u044B\n <tui-data-list *tuiDataList>\n @for (type of paymentTypes; track type.id) {\n <button\n tuiOption\n [value]=\"type.id\"\n >\n {{ type.name }}\n </button>\n }\n </tui-data-list>\n </tui-select>\n <tui-error\n formControlName=\"paymentType\"\n [error]=\"[] | tuiFieldError | async\"\n />\n @if (isCashPaymentSelected()) {\n <p class=\"text-xs text-tui-status-positive\">\u0417\u0430\u043A\u0430\u0437\u044B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u044F\u0442\u0441\u044F \u043F\u043E \u043F\u0440\u0435\u0434\u043E\u043F\u043B\u0430\u0442\u0435</p>\n }\n </label>\n\n <!-- \u041F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0435 \u043E \u043D\u0435\u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0451\u043D\u043D\u044B\u0445 \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445. -->\n @if (!isPhoneApproved() || !isEmailApproved()) {\n <div\n #unconfirmedDataWarning\n class=\"text-tui-text-negative\"\n [class.warning-shake]=\"warningShake()\"\n >\n \u0412\u043D\u0438\u043C\u0430\u043D\u0438\u0435! \u0414\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u043A\u0430\u0437\u0430 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C\n @if (!isPhoneApproved()) {\n <span class=\"font-bold\"> \u043D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 </span>\n }\n @if (!isPhoneApproved() && !isEmailApproved()) {\n <span> \u0438 </span>\n }\n @if (!isEmailApproved()) {\n <span class=\"font-bold\"> \u0430\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B </span>\n }\n <a\n tuiLink\n routerLink=\"/profile\"\n >\n \u0432 \u0432\u0430\u0448\u0435\u043C \u043F\u0440\u043E\u0444\u0438\u043B\u0435\n </a>\n </div>\n }\n\n <!-- \u0421\u043F\u043E\u0441\u043E\u0431 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438. -->\n <label tuiLabel>\n \u0421\u043F\u043E\u0441\u043E\u0431 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n @let deliveryTypes = deliveryTypes$ | async;\n <tui-select\n formControlName=\"deliveryType\"\n [valueContent]=\"deliveryTypes ? stringify(deliveryTypes) : selectLoading\"\n >\n \u0421\u043F\u043E\u0441\u043E\u0431 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-data-list *tuiDataList>\n @for (delivery of deliveryTypes; track delivery.id) {\n <button\n tuiOption\n [value]=\"delivery.id\"\n >\n {{ delivery.name }}\n </button>\n }\n </tui-data-list>\n </tui-select>\n <tui-error\n formControlName=\"deliveryType\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </label>\n\n <!-- \u0421\u043A\u043B\u0430\u0434. -->\n <label tuiLabel>\n \u0421\u043A\u043B\u0430\u0434\n @let warehouses = warehouses$ | async;\n <tui-select\n formControlName=\"warehouseId\"\n [valueContent]=\"warehouses ? stringify(warehouses) : selectLoading\"\n >\n \u0421\u043A\u043B\u0430\u0434\n <tui-data-list *tuiDataList>\n @if (!terminal.isRunningOnTerminal) {\n @for (warehouse of warehouses; track warehouse.id) {\n <button\n tuiOption\n [value]=\"warehouse.id\"\n >\n {{ warehouse.name }}\n </button>\n }\n } @else {\n @if (warehouseService.getCatalogWarehouseChange$() | async; as terminalWarehouse) {\n <button\n tuiOption\n [value]=\"terminalWarehouse.id\"\n >\n {{ terminalWarehouse.name }}\n </button>\n }\n }\n </tui-data-list>\n </tui-select>\n <tui-error\n formControlName=\"warehouseId\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </label>\n\n <!-- \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438. -->\n @if (isDelivery()) {\n @let addresses = addresses$ | async;\n <div>\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-select\n formControlName=\"addressId\"\n [valueContent]=\"addresses ? stringify(addresses) : selectLoading\"\n >\n \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-data-list *tuiDataList>\n @for (address of addresses; track address.id) {\n <button\n tuiOption\n [value]=\"address.id\"\n >\n {{ address.address }}\n </button>\n }\n </tui-data-list>\n </tui-select>\n @if (addresses && addresses.length === 0) {\n <tui-error error=\"\u0423 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 \u043D\u0435\u0442 \u0430\u0434\u0440\u0435\u0441\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\" />\n }\n <tui-error\n formControlName=\"addressId\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </label>\n <a\n tuiLink\n iconStart=\"@tui.plus\"\n (click)=\"addDeliveryAddress()\"\n class=\"mt-2 block\"\n >\n \u041D\u043E\u0432\u044B\u0439\n </a>\n </div>\n }\n\n <!-- \u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438/\u0441\u0430\u043C\u043E\u0432\u044B\u0432\u043E\u0437\u0430. -->\n <label tuiLabel>\n \u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 {{ isDelivery() ? '\u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438' : '\u0441\u0430\u043C\u043E\u0432\u044B\u0432\u043E\u0437\u0430' }}\n <tui-input-date\n formControlName=\"deliveryDate\"\n [disabledItemHandler]=\"deliveryDateFilter\"\n >\n \u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 {{ isDelivery() ? '\u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438' : '\u0441\u0430\u043C\u043E\u0432\u044B\u0432\u043E\u0437\u0430' }}\n </tui-input-date>\n <tui-error\n formControlName=\"deliveryDate\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </label>\n\n <!-- \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 \u043A\u043B\u0438\u0435\u043D\u0442\u0430. -->\n <label tuiLabel>\n \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 \u043A\u043B\u0438\u0435\u043D\u0442\u0430 \u043A \u0437\u0430\u043A\u0430\u0437\u0443\n <tui-textarea\n formControlName=\"comment\"\n [expandable]=\"true\"\n [rows]=\"15\"\n >\n \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043A\u0441\u0442\n </tui-textarea>\n <tui-error\n formControlName=\"comment\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </label>\n\n <!-- \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u043B\u0435\u043D\u0438\u0435 \u0444\u0430\u0439\u043B\u0430 \u043A \u0437\u0430\u043A\u0430\u0437\u0443. -->\n <div>\n @if (!controlFile.value) {\n <label tuiInputFiles>\n <input\n accept=\"image/*\"\n tuiInputFiles\n [formControl]=\"controlFile\"\n />\n </label>\n }\n\n <tui-files class=\"tui-space_top-1\">\n @if (controlFile.value | tuiFileRejected: { accept: 'image/*' } | async; as file) {\n <tui-file\n state=\"error\"\n [file]=\"file\"\n (remove)=\"removeFile()\"\n />\n }\n\n @for (file of accepted$ | async; track file.name) {\n <tui-file\n [file]=\"file\"\n (remove)=\"removeFile()\"\n />\n }\n </tui-files>\n\n <tui-error\n [error]=\"['maxLength'] | tuiFieldError | async\"\n [formControl]=\"controlFile\"\n />\n <p class=\"tui-form__field-note\">\u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u044E \u043F\u043E\u0432\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0439 \u0438 \u0434\u0435\u0444\u0444\u0435\u043A\u0442\u043E\u0432, \u0447\u0442\u043E \u043F\u043E\u0441\u043B\u0443\u0436\u0438\u0442 \u0434\u043E\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u043E\u043C \u043D\u0435\u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044F \u0437\u0430\u044F\u0432\u043B\u0435\u043D\u043D\u043E\u0433\u043E \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430.</p>\n </div>\n</form>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "showLoader"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "ngmodule", type: TuiSelectModule }, { kind: "component", type: i3.TuiSelectComponent, selector: "tui-select", inputs: ["stringify", "identityMatcher", "valueContent"] }, { kind: "directive", type: i3.TuiSelectDirective, selector: "tui-select" }, { kind: "component", type: i3$1.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i3$1.TuiDataListDirective, selector: "ng-template[tuiDataList]" }, { kind: "component", type: i3$1.TuiOption, selector: "button[tuiOption]:not([new]), a[tuiOption]:not([new]), label[tuiOption]:not([new])", inputs: ["disabled", "value"] }, { kind: "component", type: TuiError, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo"] }, { kind: "ngmodule", type: TuiInputDateModule }, { kind: "component", type: i3.TuiInputDateComponent, selector: "tui-input-date:not([multiple])", inputs: ["min", "max", "disabledItemHandler", "markerHandler", "items", "defaultActiveYearMonth"] }, { kind: "directive", type: i3.TuiInputDateDirective, selector: "tui-input-date:not([multiple])" }, { kind: "ngmodule", type: TuiTextareaModule }, { kind: "component", type: i3.TuiTextareaComponent, selector: "tui-textarea", inputs: ["rows", "maxLength", "expandable"] }, { kind: "directive", type: i3.TuiTextareaDirective, selector: "tui-textarea" }, { kind: "component", type: TuiInputFiles, selector: "label[tuiInputFiles]" }, { kind: "directive", type: TuiInputFilesDirective, selector: "input[tuiInputFiles]", outputs: ["reject"] }, { kind: "component", type: TuiFilesComponent, selector: "tui-files", inputs: ["max", "expanded"], outputs: ["expandedChange"] }, { kind: "component", type: TuiFile, selector: "tui-file,a[tuiFile],button[tuiFile]", inputs: ["file", "state", "size", "showDelete", "showSize", "leftContent"], outputs: ["remove"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TuiFieldErrorPipe, name: "tuiFieldError" }, { kind: "pipe", type: TuiFileRejectedPipe, name: "tuiFileRejected" }, { kind: "directive", type: ScFocusFirstInvalidFieldDirective, selector: "form[formGroup][scFocusFirstInvalidField]", inputs: ["fieldOrder"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
9142
|
+
}
|
|
9143
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScOrderFormComponent, decorators: [{
|
|
9144
|
+
type: Component,
|
|
9145
|
+
args: [{ standalone: true, selector: 'sc-order-form', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
9146
|
+
FormsModule,
|
|
9147
|
+
ReactiveFormsModule,
|
|
9148
|
+
RouterLink,
|
|
9149
|
+
TuiLoader,
|
|
9150
|
+
TuiLabel,
|
|
9151
|
+
TuiSelectModule,
|
|
9152
|
+
TuiDataListDirective,
|
|
9153
|
+
TuiDataListComponent,
|
|
9154
|
+
TuiOption,
|
|
9155
|
+
TuiError,
|
|
9156
|
+
TuiLink,
|
|
9157
|
+
TuiInputDateModule,
|
|
9158
|
+
TuiTextareaModule,
|
|
9159
|
+
TuiInputFiles,
|
|
9160
|
+
TuiInputFilesDirective,
|
|
9161
|
+
TuiFilesComponent,
|
|
9162
|
+
TuiFile,
|
|
9163
|
+
AsyncPipe,
|
|
9164
|
+
TuiFieldErrorPipe,
|
|
9165
|
+
TuiFileRejectedPipe,
|
|
9166
|
+
ScFocusFirstInvalidFieldDirective,
|
|
9167
|
+
], providers: [TERMINAL_PROVIDERS], template: "@let user = user$ | async;\n\n<form\n [formGroup]=\"form\"\n scFocusFirstInvalidField\n [fieldOrder]=\"['contragentId', 'paymentType', 'deliveryType', 'warehouseId', 'addressId', 'deliveryDate', 'comment']\"\n (ngSubmit)=\"submit()\"\n class=\"flex flex-col gap-4\"\n>\n <ng-template #selectLoading> <tui-loader /> </ng-template>\n\n <!-- \u041A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442. -->\n @if (contragents$ | async; as contragents) {\n @if (contragents.length > 1 || user?.isOrg) {\n <label tuiLabel>\n \u041A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\n <tui-select\n formControlName=\"contragentId\"\n [valueContent]=\"contragents ? stringify(contragents) : selectLoading\"\n >\n \u041A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\n <tui-data-list *tuiDataList>\n @for (contragent of contragents; track contragent.id) {\n <button\n tuiOption\n [value]=\"contragent.id\"\n >\n {{ contragent.name }}\n </button>\n }\n </tui-data-list>\n </tui-select>\n <tui-error\n formControlName=\"contragentId\"\n [error]=\"[] | tuiFieldError | async\"\n />\n <a\n tuiLink\n iconStart=\"@tui.plus\"\n (click)=\"addContragent()\"\n class=\"mt-2 block\"\n >\n \u041D\u043E\u0432\u044B\u0439\n </a>\n </label>\n }\n }\n\n <!-- \u0422\u0438\u043F \u043E\u043F\u043B\u0430\u0442\u044B. -->\n <label tuiLabel>\n \u0422\u0438\u043F \u043E\u043F\u043B\u0430\u0442\u044B\n @let paymentTypes = paymentTypes$ | async;\n <tui-select\n formControlName=\"paymentType\"\n [valueContent]=\"paymentTypes ? stringify(paymentTypes) : selectLoading\"\n >\n \u0422\u0438\u043F \u043E\u043F\u043B\u0430\u0442\u044B\n <tui-data-list *tuiDataList>\n @for (type of paymentTypes; track type.id) {\n <button\n tuiOption\n [value]=\"type.id\"\n >\n {{ type.name }}\n </button>\n }\n </tui-data-list>\n </tui-select>\n <tui-error\n formControlName=\"paymentType\"\n [error]=\"[] | tuiFieldError | async\"\n />\n @if (isCashPaymentSelected()) {\n <p class=\"text-xs text-tui-status-positive\">\u0417\u0430\u043A\u0430\u0437\u044B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u044F\u0442\u0441\u044F \u043F\u043E \u043F\u0440\u0435\u0434\u043E\u043F\u043B\u0430\u0442\u0435</p>\n }\n </label>\n\n <!-- \u041F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0435 \u043E \u043D\u0435\u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0451\u043D\u043D\u044B\u0445 \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445. -->\n @if (!isPhoneApproved() || !isEmailApproved()) {\n <div\n #unconfirmedDataWarning\n class=\"text-tui-text-negative\"\n [class.warning-shake]=\"warningShake()\"\n >\n \u0412\u043D\u0438\u043C\u0430\u043D\u0438\u0435! \u0414\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u043A\u0430\u0437\u0430 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C\n @if (!isPhoneApproved()) {\n <span class=\"font-bold\"> \u043D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 </span>\n }\n @if (!isPhoneApproved() && !isEmailApproved()) {\n <span> \u0438 </span>\n }\n @if (!isEmailApproved()) {\n <span class=\"font-bold\"> \u0430\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B </span>\n }\n <a\n tuiLink\n routerLink=\"/profile\"\n >\n \u0432 \u0432\u0430\u0448\u0435\u043C \u043F\u0440\u043E\u0444\u0438\u043B\u0435\n </a>\n </div>\n }\n\n <!-- \u0421\u043F\u043E\u0441\u043E\u0431 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438. -->\n <label tuiLabel>\n \u0421\u043F\u043E\u0441\u043E\u0431 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n @let deliveryTypes = deliveryTypes$ | async;\n <tui-select\n formControlName=\"deliveryType\"\n [valueContent]=\"deliveryTypes ? stringify(deliveryTypes) : selectLoading\"\n >\n \u0421\u043F\u043E\u0441\u043E\u0431 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-data-list *tuiDataList>\n @for (delivery of deliveryTypes; track delivery.id) {\n <button\n tuiOption\n [value]=\"delivery.id\"\n >\n {{ delivery.name }}\n </button>\n }\n </tui-data-list>\n </tui-select>\n <tui-error\n formControlName=\"deliveryType\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </label>\n\n <!-- \u0421\u043A\u043B\u0430\u0434. -->\n <label tuiLabel>\n \u0421\u043A\u043B\u0430\u0434\n @let warehouses = warehouses$ | async;\n <tui-select\n formControlName=\"warehouseId\"\n [valueContent]=\"warehouses ? stringify(warehouses) : selectLoading\"\n >\n \u0421\u043A\u043B\u0430\u0434\n <tui-data-list *tuiDataList>\n @if (!terminal.isRunningOnTerminal) {\n @for (warehouse of warehouses; track warehouse.id) {\n <button\n tuiOption\n [value]=\"warehouse.id\"\n >\n {{ warehouse.name }}\n </button>\n }\n } @else {\n @if (warehouseService.getCatalogWarehouseChange$() | async; as terminalWarehouse) {\n <button\n tuiOption\n [value]=\"terminalWarehouse.id\"\n >\n {{ terminalWarehouse.name }}\n </button>\n }\n }\n </tui-data-list>\n </tui-select>\n <tui-error\n formControlName=\"warehouseId\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </label>\n\n <!-- \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438. -->\n @if (isDelivery()) {\n @let addresses = addresses$ | async;\n <div>\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-select\n formControlName=\"addressId\"\n [valueContent]=\"addresses ? stringify(addresses) : selectLoading\"\n >\n \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-data-list *tuiDataList>\n @for (address of addresses; track address.id) {\n <button\n tuiOption\n [value]=\"address.id\"\n >\n {{ address.address }}\n </button>\n }\n </tui-data-list>\n </tui-select>\n @if (addresses && addresses.length === 0) {\n <tui-error error=\"\u0423 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 \u043D\u0435\u0442 \u0430\u0434\u0440\u0435\u0441\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\" />\n }\n <tui-error\n formControlName=\"addressId\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </label>\n <a\n tuiLink\n iconStart=\"@tui.plus\"\n (click)=\"addDeliveryAddress()\"\n class=\"mt-2 block\"\n >\n \u041D\u043E\u0432\u044B\u0439\n </a>\n </div>\n }\n\n <!-- \u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438/\u0441\u0430\u043C\u043E\u0432\u044B\u0432\u043E\u0437\u0430. -->\n <label tuiLabel>\n \u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 {{ isDelivery() ? '\u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438' : '\u0441\u0430\u043C\u043E\u0432\u044B\u0432\u043E\u0437\u0430' }}\n <tui-input-date\n formControlName=\"deliveryDate\"\n [disabledItemHandler]=\"deliveryDateFilter\"\n >\n \u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 {{ isDelivery() ? '\u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438' : '\u0441\u0430\u043C\u043E\u0432\u044B\u0432\u043E\u0437\u0430' }}\n </tui-input-date>\n <tui-error\n formControlName=\"deliveryDate\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </label>\n\n <!-- \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 \u043A\u043B\u0438\u0435\u043D\u0442\u0430. -->\n <label tuiLabel>\n \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 \u043A\u043B\u0438\u0435\u043D\u0442\u0430 \u043A \u0437\u0430\u043A\u0430\u0437\u0443\n <tui-textarea\n formControlName=\"comment\"\n [expandable]=\"true\"\n [rows]=\"15\"\n >\n \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043A\u0441\u0442\n </tui-textarea>\n <tui-error\n formControlName=\"comment\"\n [error]=\"[] | tuiFieldError | async\"\n />\n </label>\n\n <!-- \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u043B\u0435\u043D\u0438\u0435 \u0444\u0430\u0439\u043B\u0430 \u043A \u0437\u0430\u043A\u0430\u0437\u0443. -->\n <div>\n @if (!controlFile.value) {\n <label tuiInputFiles>\n <input\n accept=\"image/*\"\n tuiInputFiles\n [formControl]=\"controlFile\"\n />\n </label>\n }\n\n <tui-files class=\"tui-space_top-1\">\n @if (controlFile.value | tuiFileRejected: { accept: 'image/*' } | async; as file) {\n <tui-file\n state=\"error\"\n [file]=\"file\"\n (remove)=\"removeFile()\"\n />\n }\n\n @for (file of accepted$ | async; track file.name) {\n <tui-file\n [file]=\"file\"\n (remove)=\"removeFile()\"\n />\n }\n </tui-files>\n\n <tui-error\n [error]=\"['maxLength'] | tuiFieldError | async\"\n [formControl]=\"controlFile\"\n />\n <p class=\"tui-form__field-note\">\u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u044E \u043F\u043E\u0432\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0439 \u0438 \u0434\u0435\u0444\u0444\u0435\u043A\u0442\u043E\u0432, \u0447\u0442\u043E \u043F\u043E\u0441\u043B\u0443\u0436\u0438\u0442 \u0434\u043E\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u043E\u043C \u043D\u0435\u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044F \u0437\u0430\u044F\u0432\u043B\u0435\u043D\u043D\u043E\u0433\u043E \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430.</p>\n </div>\n</form>\n" }]
|
|
9168
|
+
}], ctorParameters: () => [] });
|
|
9169
|
+
|
|
8335
9170
|
/**
|
|
8336
9171
|
* Компонент списка товаров, разбитых по наличию на складе:
|
|
8337
9172
|
* - в наличии на складе;
|
|
@@ -9929,5 +10764,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
9929
10764
|
* Generated bundle index. Do not edit.
|
|
9930
10765
|
*/
|
|
9931
10766
|
|
|
9932
|
-
export { AbstractScPriceCard, AuthMethod, CURRENT_COUNTRY_ID, CostWithDiscountComponent, FilesAndDocumentsComponent, FilesAndDocumentsModule, FinishDateTimeTransformerDirective, IDLE_ITEM_STATE, IS_DEFAULT_COUNTRY, MAX_FILES_IN_FORM_INPUT, SC_ALLOW_SELECT_TERMINATED, SC_BANNER_DURATION, SC_CATALOG_PRODUCTS_FILTERS, SC_CATALOG_SHOW_PRODUCTS_RECURSIVELY, SC_DATE_FORMATTER, SC_DEBOUNCE_TIME_DEFAULT, SC_DIALOG_SERVICE_TOKEN, SC_ERROR_CHANGE_HANDLER, SC_HELP_NOTIFICATION_CLOSE, SC_HELP_NOTIFICATION_LIMIT, SC_HIDDEN_PRINT_ELEMENTS, SC_MANAGER_QR_HANDLER, SC_NOTIFY_WHEN_IN_STOCK_REQUIRED_FIELDS, SC_ORDER_OPTIONS, SC_PAGE_SIZE_OPTIONS$1 as SC_PAGE_SIZE_OPTIONS, SC_SHOW_HELP_NOTIFICATION_IN_PHONE_INPUT, SC_USER_CITY_INFO, SC_USER_INFO, SC_USER_PROVIDERS, SC_VERIFICATION_CODE_TIMEOUT, ScAccordionComponent, ScAccordionContentDirective, ScAccordionModule, ScAddContactDialogComponent, ScAddContragentBankAccountsDialogComponent, ScAddContragentDialogComponent, ScAddDeliveryAddressDialogComponent, ScAddOrEditingCartItemDialogComponent, ScAddOrEditingCartItemFormComponent, ScAddressesSelectionFieldComponent, ScAuthModule, ScBannerComponent, ScBannerModule, ScBrandsListComponent, ScBrandsListModule, ScCartAddProductsFromCsvDialogComponent, ScCatalogFiltersComponent, ScCatalogModule, ScCategoryCardComponent, ScContactsAccordionComponent, ScContactsModule, ScContragentsAccordionComponent, ScContragentsAccordionItemComponent, ScContragentsModule, ScDeliveryAddressAccordionComponent, ScDeliveryAddressAccordionItemComponent, ScDeliveryAddressModule, ScDownloadPriceListComponent, ScDraftComponent, ScEmailLinkDirective, ScErrorBlockStatusComponent, ScErrorHandlerComponent, ScFavoriteButtonComponent, ScFeedbackFormComponent, ScFocusFirstInvalidFieldDirective, ScFormFieldsModule, ScFormatDatePipe, ScFrequentlyAskedQuestionsComponent, ScFrequentlyAskedQuestionsGroupSelectorComponent, ScFrequentlyAskedQuestionsWithGroupsComponent, ScGratitudeComponent, ScHelpNotificationService, ScHoverImageCarouselComponent, ScInputQuantityComponent, ScLinks, ScManagerCardComponent, ScManagerCardPushComponent, ScNewContactFormComponent, ScNewContragentBankAccountsFormComponent, ScNewContragentFormComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNewsModule, ScNextInputFocusDirective, ScNextInputFocusModule, ScNoindexDirective, ScNoindexWrapperComponent, ScNotifyWhenInStockDialogComponent, ScOrderAccessorDirective, ScOrderItemComponent, ScOrderItemsByDirection, ScOrderItemsListByDirectionsComponent, ScOrderItemsListByStockComponent, ScOrderItemsListComponent, ScOrderModule, ScPaymentStatusComponent, ScPersonalDataProcessingPolicyComponent, ScPhoneFormatPipe, ScPreviewSampleComponent, ScPreviewSampleModule, ScPreviewSamplesMosquitoComponent, ScPriceCardComponent, ScPriceCardInlineComponent, ScPriceHistoryComponent, ScPriceListPaginationComponent, ScPriceWarehouseStockComponent, ScPrintDirective, ScPrintService, ScPrivacyPolicyComponent, ScProductInAllWarehousesPipe, ScProfileAccordionsContentComponent, ScProfileModule, ScPublicOfferComponent, ScQRCodeDialogComponent, ScQRCodeModule, ScResetUserPasswordComponent, ScResourcePreviewComponent, ScSandwichComponent, ScSandwichM2Component, ScSandwichM2SkeletonComponent, ScSandwichSkeletonComponent, ScSelectOnFocusinDirective, ScSeoTagsComponent, ScShareButtonComponent, ScShareButtonModule, ScSignInFormByEmailComponent, ScSignInFormByPhoneComponent, ScSignInFormComponent, ScSignUpFormComponent, ScSimpleSignUpFormComponent, ScSuggestionFieldComponent, ScTelLinkDirective, ScTerminalLinkDirective, ScUpdateUserInfoDialogComponent, ScUserManagersComponent, ScUserModule, ScUserPhoneApproveDialogComponent, ScVerificationModule, ScVerificationPhoneCheckFormComponent, TreeDirective, TreeIconService, TreeLoaderService, TreeTopDirective, phoneValidator, scAtLeastOneRequiredValidator, scBicValidator, scClientUiIconsName, scCorrespondentAccountValidator, scGetCurrentRoute, scPasswordConfirmMatchingValidator, stepValidator, tuiDateValueTransformerDefaultProvider };
|
|
10767
|
+
export { AbstractScPriceCard, AuthMethod, CURRENT_COUNTRY_ID, CostWithDiscountComponent, FilesAndDocumentsComponent, FilesAndDocumentsModule, FinishDateTimeTransformerDirective, IDLE_ITEM_STATE, IS_DEFAULT_COUNTRY, MAX_FILES_IN_FORM_INPUT, SC_ALLOW_SELECT_TERMINATED, SC_BANNER_DURATION, SC_CATALOG_PRODUCTS_FILTERS, SC_CATALOG_SHOW_PRODUCTS_RECURSIVELY, SC_DATE_FORMATTER, SC_DEBOUNCE_TIME_DEFAULT, SC_DIALOG_SERVICE_TOKEN, SC_ERROR_CHANGE_HANDLER, SC_HELP_NOTIFICATION_CLOSE, SC_HELP_NOTIFICATION_LIMIT, SC_HIDDEN_PRINT_ELEMENTS, SC_MANAGER_QR_HANDLER, SC_NOTIFY_WHEN_IN_STOCK_REQUIRED_FIELDS, SC_ORDER_FORM_CONFIG, SC_ORDER_OPTIONS, SC_PAGE_SIZE_OPTIONS$1 as SC_PAGE_SIZE_OPTIONS, SC_SHOW_HELP_NOTIFICATION_IN_PHONE_INPUT, SC_USER_CITY_INFO, SC_USER_INFO, SC_USER_PROVIDERS, SC_VERIFICATION_CODE_TIMEOUT, ScAccordionComponent, ScAccordionContentDirective, ScAccordionModule, ScAddContactDialogComponent, ScAddContragentBankAccountsDialogComponent, ScAddContragentDialogComponent, ScAddDeliveryAddressDialogComponent, ScAddOrEditingCartItemDialogComponent, ScAddOrEditingCartItemFormComponent, ScAddressesSelectionFieldComponent, ScAuthModule, ScBannerComponent, ScBannerModule, ScBrandsListComponent, ScBrandsListModule, ScCartAddProductsFromCsvDialogComponent, ScCatalogFilterCollapsibleComponent, ScCatalogFiltersComponent, ScCatalogModule, ScCategoryCardComponent, ScContactsAccordionComponent, ScContactsModule, ScContragentsAccordionComponent, ScContragentsAccordionItemComponent, ScContragentsModule, ScDeliveryAddressAccordionComponent, ScDeliveryAddressAccordionItemComponent, ScDeliveryAddressModule, ScDownloadPriceListComponent, ScDraftComponent, ScEmailLinkDirective, ScErrorBlockStatusComponent, ScErrorHandlerComponent, ScFavoriteButtonComponent, ScFeedbackFormComponent, ScFocusFirstInvalidFieldDirective, ScFormFieldsModule, ScFormatDatePipe, ScFrequentlyAskedQuestionsComponent, ScFrequentlyAskedQuestionsGroupSelectorComponent, ScFrequentlyAskedQuestionsWithGroupsComponent, ScGratitudeComponent, ScHelpNotificationService, ScHoverImageCarouselComponent, ScInputQuantityComponent, ScLinks, ScManagerCardComponent, ScManagerCardPushComponent, ScNewContactFormComponent, ScNewContragentBankAccountsFormComponent, ScNewContragentFormComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNewsModule, ScNextInputFocusDirective, ScNextInputFocusModule, ScNoindexDirective, ScNoindexWrapperComponent, ScNotifyWhenInStockDialogComponent, ScOrderAccessorDirective, ScOrderDirectionItemsComponent, ScOrderFormComponent, ScOrderItemComponent, ScOrderItemsByDirection, ScOrderItemsListByDirectionsComponent, ScOrderItemsListByStockComponent, ScOrderItemsListComponent, ScOrderModule, ScPaymentStatusComponent, ScPersonalDataProcessingPolicyComponent, ScPhoneFormatPipe, ScPreviewSampleComponent, ScPreviewSampleModule, ScPreviewSamplesMosquitoComponent, ScPriceCardComponent, ScPriceCardInlineComponent, ScPriceHistoryComponent, ScPriceListPaginationComponent, ScPriceWarehouseStockComponent, ScPrintDirective, ScPrintService, ScPrivacyPolicyComponent, ScProductInAllWarehousesPipe, ScProfileAccordionsContentComponent, ScProfileModule, ScPublicOfferComponent, ScQRCodeDialogComponent, ScQRCodeModule, ScResetUserPasswordComponent, ScResourcePreviewComponent, ScSandwichComponent, ScSandwichM2Component, ScSandwichM2SkeletonComponent, ScSandwichSkeletonComponent, ScSelectOnFocusinDirective, ScSeoTagsComponent, ScShareButtonComponent, ScShareButtonModule, ScSignInFormByEmailComponent, ScSignInFormByPhoneComponent, ScSignInFormComponent, ScSignUpFormComponent, ScSimpleSignUpFormComponent, ScSuggestionFieldComponent, ScTelLinkDirective, ScTerminalLinkDirective, ScUpdateUserInfoDialogComponent, ScUserManagersComponent, ScUserModule, ScUserPhoneApproveDialogComponent, ScVerificationModule, ScVerificationPhoneCheckFormComponent, TreeDirective, TreeIconService, TreeLoaderService, TreeTopDirective, cleanupRecaptchaArtifacts, phoneValidator, scAtLeastOneRequiredValidator, scBicValidator, scClientUiIconsName, scCorrespondentAccountValidator, scGetCurrentRoute, scPasswordConfirmMatchingValidator, stepValidator, tuiDateValueTransformerDefaultProvider };
|
|
9933
10768
|
//# sourceMappingURL=snabcentr-client-ui.mjs.map
|