@snabcentr/client-ui 3.44.3 → 3.44.5
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/cart-item/sc-cart-item.component.d.ts +1 -1
- package/catalog/price-card/sc-price-card.component.d.ts +2 -2
- package/catalog/sc-catalog.module.d.ts +14 -14
- package/esm2022/cart/cart-item/sc-cart-item.component.mjs +8 -10
- package/esm2022/catalog/category-card/sc-category-card.component.mjs +3 -3
- package/esm2022/catalog/cost-with-discount/cost-with-discount.component.mjs +5 -4
- package/esm2022/catalog/price-card/sc-price-card.component.mjs +30 -12
- package/esm2022/catalog/price-card-inline/sc-price-card-inline.component.mjs +8 -11
- package/esm2022/catalog/sc-catalog.module.mjs +7 -4
- package/esm2022/noindex-wrapper/directives/index.mjs +2 -0
- package/esm2022/noindex-wrapper/directives/sc-noindex.directive.mjs +58 -0
- package/esm2022/noindex-wrapper/index.mjs +3 -0
- package/esm2022/noindex-wrapper/sc-noindex-wrapper.component.mjs +16 -0
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/snabcentr-client-ui.mjs +492 -397
- package/fesm2022/snabcentr-client-ui.mjs.map +1 -1
- package/noindex-wrapper/directives/index.d.ts +1 -0
- package/noindex-wrapper/directives/sc-noindex.directive.d.ts +29 -0
- package/noindex-wrapper/index.d.ts +2 -0
- package/noindex-wrapper/sc-noindex-wrapper.component.d.ts +9 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/styles/tailwind/tailwind.scss +4 -172
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, Injectable, Directive, ContentChildren, HostListener, NgModule, EventEmitter, signal, ChangeDetectorRef, Input, Output, Component, ChangeDetectionStrategy, Inject, HostBinding, ElementRef, Pipe, Renderer2, input, model, output, SkipSelf, DestroyRef, effect, ContentChild, ViewChild, Optional, computed, viewChild, forwardRef } from '@angular/core';
|
|
3
3
|
import * as i1 from '@snabcentr/client-core';
|
|
4
|
-
import { ScContactsService, ScUserService, ScAuthService, SEARCH_TERM, ScUnitsHelper, ScImageHelper, SC_PATH_IMAGE_NOT_FOUND, ScImage, IS_RUNNING_ON_TERMINAL, ScPhoneService, ScUserMetrikaService, ScUserMetrikaGoalsEnum, ScVCardService, ScVerificationService, ScISuggestionType, SC_MIN_LENGTH_SEARCH_TERM, ScConvertersService, ScOpfList, ScLocationsService, ScMediaImageTransformerPipe,
|
|
4
|
+
import { ScContactsService, ScUserService, ScAuthService, SEARCH_TERM, ScUnitsHelper, ScImageHelper, SC_PATH_IMAGE_NOT_FOUND, ScImage, IS_RUNNING_ON_TERMINAL, ScPhoneService, ScUserMetrikaService, ScUserMetrikaGoalsEnum, ScVCardService, ScVerificationService, ScISuggestionType, SC_MIN_LENGTH_SEARCH_TERM, ScConvertersService, ScOpfList, ScLocationsService, ScMediaImageTransformerPipe, SEARCH_TERM_PROVIDERS, ScCartService, ScUploadedFile, ScMimeTypes, ScCatalogService, SC_URLS, ScWarehouseService, ScPaginationService, SC_NEXT_PAGE_PAGINATION_CLICK, SC_PRODUCT_PAGINATION_OPTIONS, IS_SERVER, RESPONSE, ScIconTypesEnum, ScDocumentInfoTypesEnum, ScFrequentlyAskedQuestionsService, SC_COMPANY_INFO, ScFeedbackService, ScIdOrSlugPipe, ScJsonLdModule } from '@snabcentr/client-core';
|
|
5
5
|
import * as i6 from 'rxjs';
|
|
6
6
|
import { EMPTY, BehaviorSubject, switchMap, of, shareReplay, Subject, map, filter, tap, catchError, finalize, startWith, share, timer, scan, takeWhile, endWith, distinctUntilChanged, debounceTime, throwError, combineLatest, Observable, pairwise, noop, first, merge, skip } from 'rxjs';
|
|
7
7
|
import * as i7 from '@taiga-ui/cdk';
|
|
@@ -11,7 +11,7 @@ import { toSignal, outputFromObservable, takeUntilDestroyed } from '@angular/cor
|
|
|
11
11
|
import * as i2$3 from '@angular/forms';
|
|
12
12
|
import { FormControl, FormGroupDirective, NgControl, FormGroup, Validators, FormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
13
13
|
import * as i1$1 from '@taiga-ui/core';
|
|
14
|
-
import { TuiButton, TuiDialog, TuiDialogService, TuiLink, TuiFallbackSrcPipe, TuiInitialsPipe, TuiIcon, TuiAppearance, TuiWithAppearance, TuiIcons, TuiWithIcons, TUI_DATA_LIST_HOST, tuiDropdownOptionsProvider, TuiLabel, TuiError, TuiLoader, TuiDataList, TuiNotification, TuiTextfield, TuiTitle,
|
|
14
|
+
import { TuiButton, TuiDialog, TuiDialogService, TuiLink, TuiFallbackSrcPipe, TuiInitialsPipe, TuiIcon, TuiAppearance, TuiWithAppearance, TuiIcons, TuiWithIcons, TUI_DATA_LIST_HOST, tuiDropdownOptionsProvider, TuiLabel, TuiError, TuiLoader, TuiDataList, TuiNotification, TuiTextfield, TuiTitle, TuiFormatNumberPipe, TuiHint, TuiNumberFormat, TUI_MONTHS, TUI_BUTTON_OPTIONS, TUI_BUTTON_DEFAULT_OPTIONS, TuiScrollbar, TuiSurface, tuiFadeIn } from '@taiga-ui/core';
|
|
15
15
|
import { isValidPhoneNumber } from 'libphonenumber-js/max';
|
|
16
16
|
import * as i4 from '@taiga-ui/legacy/components/primitive-textfield';
|
|
17
17
|
import * as i3 from '@taiga-ui/legacy';
|
|
@@ -24,7 +24,7 @@ import * as i5 from '@taiga-ui/core/components/label';
|
|
|
24
24
|
import * as i8 from '@maskito/angular';
|
|
25
25
|
import { MaskitoDirective } from '@maskito/angular';
|
|
26
26
|
import * as i2$1 from '@taiga-ui/kit';
|
|
27
|
-
import { TuiPreview, TUI_DATE_VALUE_TRANSFORMER, TuiAvatar, TuiAccordionItem, TuiElasticContainer, TuiAccordion, TuiFieldErrorPipe, TuiFilterByInputPipe, TuiStringifyContentPipe, TuiDataListWrapper, TuiButtonLoading, TuiSortCountriesPipe, TuiStepper, TuiCarousel, TuiPush, TuiCheckbox,
|
|
27
|
+
import { TuiPreview, TUI_DATE_VALUE_TRANSFORMER, TuiAvatar, TuiAccordionItem, TuiElasticContainer, TuiAccordion, TuiFieldErrorPipe, TuiFilterByInputPipe, TuiStringifyContentPipe, TuiDataListWrapper, TuiButtonLoading, TuiSortCountriesPipe, TuiStepper, TuiCarousel, TuiPush, TuiCheckbox, TuiPreviewDialogService, TuiHighlight, TuiFiles, TuiChip, TuiInputNumber, TuiTooltip, TuiBadge, TuiLineClamp, TuiTreeService, TuiTreeItemContent, TUI_TREE_START, TUI_TREE_CONTENT, TUI_TREE_LOADING, TUI_TREE_LOADER, TuiTree, tuiItemsHandlersProvider, TuiPagination, TuiAccordionDirective, TuiAccordionItemContent, tuiFilesAccepted } from '@taiga-ui/kit';
|
|
28
28
|
import * as i2$4 from '@taiga-ui/polymorpheus';
|
|
29
29
|
import { POLYMORPHEUS_CONTEXT, PolymorpheusComponent, PolymorpheusTemplate, PolymorpheusOutlet, injectContext } from '@taiga-ui/polymorpheus';
|
|
30
30
|
import * as i2 from 'angularx-qrcode';
|
|
@@ -37,17 +37,24 @@ import * as i3$2 from '@ng-web-apis/intersection-observer';
|
|
|
37
37
|
import { IntersectionObserverService, WaIntersectionObserver } from '@ng-web-apis/intersection-observer';
|
|
38
38
|
import * as i2$5 from '@angular/router';
|
|
39
39
|
import { RouterModule, ActivatedRoute, RouterLink, Router, NavigationStart } from '@angular/router';
|
|
40
|
+
import { ScHoverImageCarouselComponent as ScHoverImageCarouselComponent$1, ScPriceWarehouseStockComponent as ScPriceWarehouseStockComponent$1, ScInputQuantityComponent as ScInputQuantityComponent$1, ScFavoriteButtonComponent as ScFavoriteButtonComponent$1 } from '../catalog';
|
|
41
|
+
import { CostWithDiscountComponent as CostWithDiscountComponent$1 } from '../catalog/cost-with-discount/cost-with-discount.component';
|
|
42
|
+
import { AbstractScPriceCard as AbstractScPriceCard$1 } from '../directives';
|
|
43
|
+
import { ScNoindexWrapperComponent as ScNoindexWrapperComponent$1 } from '../noindex-wrapper';
|
|
40
44
|
import { TuiCurrencyPipe, TuiAmountPipe } from '@taiga-ui/addon-commerce';
|
|
41
45
|
import { WA_WINDOW } from '@ng-web-apis/common';
|
|
42
46
|
import { TuiAppearance as TuiAppearance$1, TuiWithAppearance as TuiWithAppearance$1 } from '@taiga-ui/core/directives/appearance';
|
|
43
47
|
import { TuiIcons as TuiIcons$1, TuiWithIcons as TuiWithIcons$1 } from '@taiga-ui/core/directives/icons';
|
|
44
48
|
import * as i1$4 from '@taiga-ui/layout';
|
|
45
49
|
import { TuiCardLarge, TuiBlockStatus, TuiHeader } from '@taiga-ui/layout';
|
|
50
|
+
import { ScNoindexWrapperComponent as ScNoindexWrapperComponent$2 } from '../noindex-wrapper/sc-noindex-wrapper.component';
|
|
46
51
|
import { __decorate } from 'tslib';
|
|
47
52
|
import * as i5$1 from '@taiga-ui/addon-charts';
|
|
48
53
|
import { TuiLineDaysChart, TuiLineDaysChartHint, TuiAxes } from '@taiga-ui/addon-charts';
|
|
54
|
+
import { ScFormatDatePipe as ScFormatDatePipe$1 } from '../pipes';
|
|
49
55
|
import * as i9 from 'angular8-yandex-maps';
|
|
50
56
|
import { AngularYandexMapsModule } from 'angular8-yandex-maps';
|
|
57
|
+
import { ScNoindexDirective as ScNoindexDirective$1 } from '../noindex-wrapper/directives';
|
|
51
58
|
import * as i2$6 from '@taiga-ui/experimental/components/expand';
|
|
52
59
|
import * as i3$3 from '@taiga-ui/kit/components/data-list-wrapper';
|
|
53
60
|
import { TuiGroup } from '@taiga-ui/core/directives/group';
|
|
@@ -3933,356 +3940,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
3933
3940
|
}]
|
|
3934
3941
|
}] });
|
|
3935
3942
|
|
|
3936
|
-
/**
|
|
3937
|
-
* Пайп для форматирования даты и времени.
|
|
3938
|
-
*/
|
|
3939
|
-
class ScFormatDatePipe {
|
|
3940
|
-
constructor() {
|
|
3941
|
-
/**
|
|
3942
|
-
* Функция форматирования даты и времени.
|
|
3943
|
-
*/
|
|
3944
|
-
this.formatter = inject(SC_DATE_FORMATTER);
|
|
3945
|
-
}
|
|
3946
|
-
/**
|
|
3947
|
-
* Форматирует строку даты через {@link SC_DATE_FORMATTER}.
|
|
3948
|
-
*
|
|
3949
|
-
* @param timeString - Строка времени.
|
|
3950
|
-
* @returns Форматированная дата и время.
|
|
3951
|
-
*/
|
|
3952
|
-
transform(timeString) {
|
|
3953
|
-
return timeString && this.formatter(timeString);
|
|
3954
|
-
}
|
|
3955
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScFormatDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
3956
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ScFormatDatePipe, isStandalone: true, name: "scFormatDate" }); }
|
|
3957
|
-
}
|
|
3958
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScFormatDatePipe, decorators: [{
|
|
3959
|
-
type: Pipe,
|
|
3960
|
-
args: [{
|
|
3961
|
-
standalone: true,
|
|
3962
|
-
name: 'scFormatDate',
|
|
3963
|
-
}]
|
|
3964
|
-
}] });
|
|
3965
|
-
|
|
3966
|
-
/**
|
|
3967
|
-
* Компонент центы товара с отображением скидки.
|
|
3968
|
-
*/
|
|
3969
|
-
class CostWithDiscountComponent {
|
|
3970
|
-
constructor() {
|
|
3971
|
-
/**
|
|
3972
|
-
* {@link Observable} изменения выбранного склада.
|
|
3973
|
-
*/
|
|
3974
|
-
this.warehouseSelect$ = inject(ScWarehouseService).getWarehouseSelectChange$();
|
|
3975
|
-
/**
|
|
3976
|
-
* Размер компонента.
|
|
3977
|
-
*/
|
|
3978
|
-
this.size = 'm';
|
|
3979
|
-
}
|
|
3980
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CostWithDiscountComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3981
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: CostWithDiscountComponent, isStandalone: true, selector: "sc-cost-with-discount", inputs: { product: "product", size: "size" }, host: { properties: { "attr.data-size": "this.size" } }, ngImport: i0, template: "@if (product) {\n <div\n *ngIf=\"warehouseSelect$ | async as warehouseSelect\"\n class=\"flex flex-wrap items-center gap-x-2 gap-y-1\"\n >\n <div class=\"flex flex-wrap items-center gap-x-2 gap-y-1\">\n <span\n [class.text-tui-text-02]=\"!product.isWarehouseStockExist(warehouseSelect.id)\"\n class=\"cost\"\n >{{ product.costRubString }}</span\n >\n <tui-badge\n *ngIf=\"product.discount as discount\"\n size=\"m\"\n [style.background]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"discountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xs\"\n >\n <tui-badge\n *ngIf=\"product.discount as discount\"\n size=\"s\"\n [style.background]=\"'var(--tui-background-base)'\"\n class=\"text-body-xs-bold text-tui-text-02\"\n >\n {{ discount.percent }}%\n </tui-badge>\n\n @let expiredAt = product.discount.expiredAt | scFormatDate;\n\n <div class=\"flex gap-0.5\">\n <p class=\"flex line-through\">{{ product.discountCostString }}</p>\n <div *ngIf=\"expiredAt\">\u0434\u043E {{ expiredAt.substring(0, 5) }}</div>\n </div>\n <ng-template #discountHint>\n <div class=\"font-bold\">{{ product.discount.name }}</div>\n <div *ngIf=\"expiredAt\">\u0414\u0430\u0442\u0430 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F: {{ expiredAt }}</div>\n </ng-template>\n </tui-badge>\n </div>\n <span\n *ngIf=\"!product.priceInRub\"\n class=\"font-extrabold text-tui-text-02\"\n >{{ product.costString }}</span\n >\n </div>\n}\n", styles: [":host tui-badge{--t-padding: .25rem !important}:host[data-size=s]{font-size:.6875rem;line-height:1rem;font-weight:500}:host[data-size=s] .cost{font-size:.8125rem;line-height:1.25rem;font-weight:800}:host[data-size=m],:host[data-size=l]{font-size:.8125rem;line-height:1.25rem;font-weight:500}:host[data-size=m] .cost,:host[data-size=l] .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: "directive", type: TuiBadge, selector: "tui-badge,[tuiBadge]", inputs: ["size"] }, { kind: "directive", type: i1$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"] }, { kind: "pipe", type: ScFormatDatePipe, name: "scFormatDate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3982
|
-
}
|
|
3983
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CostWithDiscountComponent, decorators: [{
|
|
3984
|
-
type: Component,
|
|
3985
|
-
args: [{ standalone: true, selector: 'sc-cost-with-discount', imports: [CommonModule, TuiBadge, ...TuiHint, ScFormatDatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (product) {\n <div\n *ngIf=\"warehouseSelect$ | async as warehouseSelect\"\n class=\"flex flex-wrap items-center gap-x-2 gap-y-1\"\n >\n <div class=\"flex flex-wrap items-center gap-x-2 gap-y-1\">\n <span\n [class.text-tui-text-02]=\"!product.isWarehouseStockExist(warehouseSelect.id)\"\n class=\"cost\"\n >{{ product.costRubString }}</span\n >\n <tui-badge\n *ngIf=\"product.discount as discount\"\n size=\"m\"\n [style.background]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"discountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xs\"\n >\n <tui-badge\n *ngIf=\"product.discount as discount\"\n size=\"s\"\n [style.background]=\"'var(--tui-background-base)'\"\n class=\"text-body-xs-bold text-tui-text-02\"\n >\n {{ discount.percent }}%\n </tui-badge>\n\n @let expiredAt = product.discount.expiredAt | scFormatDate;\n\n <div class=\"flex gap-0.5\">\n <p class=\"flex line-through\">{{ product.discountCostString }}</p>\n <div *ngIf=\"expiredAt\">\u0434\u043E {{ expiredAt.substring(0, 5) }}</div>\n </div>\n <ng-template #discountHint>\n <div class=\"font-bold\">{{ product.discount.name }}</div>\n <div *ngIf=\"expiredAt\">\u0414\u0430\u0442\u0430 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F: {{ expiredAt }}</div>\n </ng-template>\n </tui-badge>\n </div>\n <span\n *ngIf=\"!product.priceInRub\"\n class=\"font-extrabold text-tui-text-02\"\n >{{ product.costString }}</span\n >\n </div>\n}\n", styles: [":host tui-badge{--t-padding: .25rem !important}:host[data-size=s]{font-size:.6875rem;line-height:1rem;font-weight:500}:host[data-size=s] .cost{font-size:.8125rem;line-height:1.25rem;font-weight:800}:host[data-size=m],:host[data-size=l]{font-size:.8125rem;line-height:1.25rem;font-weight:500}:host[data-size=m] .cost,:host[data-size=l] .cost{font-size:.9375rem;line-height:1.5rem;font-weight:800}\n"] }]
|
|
3986
|
-
}], propDecorators: { product: [{
|
|
3987
|
-
type: Input
|
|
3988
|
-
}], size: [{
|
|
3989
|
-
type: Input
|
|
3990
|
-
}, {
|
|
3991
|
-
type: HostBinding,
|
|
3992
|
-
args: ['attr.data-size']
|
|
3993
|
-
}] } });
|
|
3994
|
-
|
|
3995
|
-
/**
|
|
3996
|
-
* Компонент просмотра изображений через событие наведения.
|
|
3997
|
-
*/
|
|
3998
|
-
class ScHoverImageCarouselComponent {
|
|
3999
|
-
constructor() {
|
|
4000
|
-
/**
|
|
4001
|
-
* Массив изображений.
|
|
4002
|
-
*/
|
|
4003
|
-
this.images = input.required();
|
|
4004
|
-
/**
|
|
4005
|
-
* Признак что необходимо отобразить элементы управления.
|
|
4006
|
-
*/
|
|
4007
|
-
this.isShowActions = input(true);
|
|
4008
|
-
/**
|
|
4009
|
-
* {@link WritableSignal} для отслеживания текущего индекса изображения.
|
|
4010
|
-
*/
|
|
4011
|
-
this.currentIndex = signal(0);
|
|
4012
|
-
/**
|
|
4013
|
-
* {@link WritableSignal} для отслеживания текущего индекса изображения.
|
|
4014
|
-
*/
|
|
4015
|
-
this.currentImage = computed(() => this.images()[this.currentIndex()]);
|
|
4016
|
-
/**
|
|
4017
|
-
* Название товара.
|
|
4018
|
-
*/
|
|
4019
|
-
this.productName = input();
|
|
4020
|
-
}
|
|
4021
|
-
/**
|
|
4022
|
-
* Обработчик события `mousemove.silent`.
|
|
4023
|
-
*
|
|
4024
|
-
* @param offsetX Отступ курсора мыши по оси X от края {@link HTMLElement}.
|
|
4025
|
-
* @param target Объект {@link HTMLElement} в котором лежат изображения
|
|
4026
|
-
*/
|
|
4027
|
-
onHover(offsetX, target) {
|
|
4028
|
-
if (this.images().length <= 1 || offsetX < 0) {
|
|
4029
|
-
return;
|
|
4030
|
-
}
|
|
4031
|
-
const elementWidth = target.offsetWidth;
|
|
4032
|
-
const hoverPercentage = Math.min(offsetX / elementWidth, 1);
|
|
4033
|
-
const newIndex = Math.min(Math.floor(hoverPercentage * this.images().length), this.images().length - 1);
|
|
4034
|
-
this.currentIndex.set(newIndex);
|
|
4035
|
-
}
|
|
4036
|
-
/**
|
|
4037
|
-
* Обработчик события `mouseleave.silent`.
|
|
4038
|
-
*/
|
|
4039
|
-
onLeave() {
|
|
4040
|
-
if (this.images().length <= 1) {
|
|
4041
|
-
return;
|
|
4042
|
-
}
|
|
4043
|
-
this.currentIndex.set(0);
|
|
4044
|
-
}
|
|
4045
|
-
/**
|
|
4046
|
-
* Обработчик события наведения указателя мыши на точку.
|
|
4047
|
-
*
|
|
4048
|
-
* @param hovered Признак что указатель мыши наведен на точку.
|
|
4049
|
-
* @param index Индекс изображения, который соответствует точке.
|
|
4050
|
-
*/
|
|
4051
|
-
onDotHovered(hovered, index) {
|
|
4052
|
-
if (hovered) {
|
|
4053
|
-
this.currentIndex.set(index);
|
|
4054
|
-
}
|
|
4055
|
-
}
|
|
4056
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScHoverImageCarouselComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4057
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: ScHoverImageCarouselComponent, isStandalone: true, selector: "sc-hover-image-carousel", inputs: { images: { classPropertyName: "images", publicName: "images", isSignal: true, isRequired: true, transformFunction: null }, isShowActions: { classPropertyName: "isShowActions", publicName: "isShowActions", isSignal: true, isRequired: false, transformFunction: null }, productName: { classPropertyName: "productName", publicName: "productName", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousemove.silent": "onHover($event.offsetX, $event.target)", "mouseleave.silent": "onLeave()" } }, ngImport: i0, template: "<div\n class=\"overflow-hidden rounded-xl\"\n [class.mb-2]=\"images().length <= 1 && isShowActions()\"\n [style.aspect-ratio]=\"'20/19'\"\n>\n @let image = currentImage();\n <picture>\n @if (image.imageWebp) {\n <source\n type=\"image/webp\"\n [srcset]=\"image.imageWebp\"\n />\n }\n\n @if (image.image) {\n <img\n [src]=\"image.image\"\n [alt]=\"image.alt\"\n class=\"size-full rounded-xl object-contain\"\n />\n }\n </picture>\n</div>\n@if (images().length > 1 && isShowActions()) {\n <div\n (mousemove.silent)=\"$event.stopPropagation()\"\n class=\"flex justify-center\"\n >\n <button\n *tuiRepeatTimes=\"let indexItem of images().length\"\n #element\n tuiButton\n type=\"button\"\n class=\"button button_small\"\n [appearance]=\"indexItem === currentIndex() ? 'primary' : 'secondary'\"\n (tuiHoveredChange)=\"onDotHovered($event, indexItem)\"\n ></button>\n </div>\n}\n", styles: [".button{flex-shrink:0}.button:first-child{margin-inline-start:0}.button:last-child{margin-inline-end:0}.button_small{inline-size:.5rem;block-size:.5rem;font-size:0;padding:0;margin:0}.button_small:not(:first-child){margin-left:.5rem}\n"], dependencies: [{ kind: "directive", type: TuiRepeatTimes, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiHovered, selector: "[tuiHoveredChange]", outputs: ["tuiHoveredChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4058
|
-
}
|
|
4059
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScHoverImageCarouselComponent, decorators: [{
|
|
4060
|
-
type: Component,
|
|
4061
|
-
args: [{ standalone: true, selector: 'sc-hover-image-carousel', imports: [TuiRepeatTimes, TuiButton, TuiHovered], host: {
|
|
4062
|
-
'(mousemove.silent)': 'onHover($event.offsetX, $event.target)',
|
|
4063
|
-
'(mouseleave.silent)': 'onLeave()',
|
|
4064
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"overflow-hidden rounded-xl\"\n [class.mb-2]=\"images().length <= 1 && isShowActions()\"\n [style.aspect-ratio]=\"'20/19'\"\n>\n @let image = currentImage();\n <picture>\n @if (image.imageWebp) {\n <source\n type=\"image/webp\"\n [srcset]=\"image.imageWebp\"\n />\n }\n\n @if (image.image) {\n <img\n [src]=\"image.image\"\n [alt]=\"image.alt\"\n class=\"size-full rounded-xl object-contain\"\n />\n }\n </picture>\n</div>\n@if (images().length > 1 && isShowActions()) {\n <div\n (mousemove.silent)=\"$event.stopPropagation()\"\n class=\"flex justify-center\"\n >\n <button\n *tuiRepeatTimes=\"let indexItem of images().length\"\n #element\n tuiButton\n type=\"button\"\n class=\"button button_small\"\n [appearance]=\"indexItem === currentIndex() ? 'primary' : 'secondary'\"\n (tuiHoveredChange)=\"onDotHovered($event, indexItem)\"\n ></button>\n </div>\n}\n", styles: [".button{flex-shrink:0}.button:first-child{margin-inline-start:0}.button:last-child{margin-inline-end:0}.button_small{inline-size:.5rem;block-size:.5rem;font-size:0;padding:0;margin:0}.button_small:not(:first-child){margin-left:.5rem}\n"] }]
|
|
4065
|
-
}] });
|
|
4066
|
-
|
|
4067
|
-
/* eslint-disable @typescript-eslint/dot-notation */
|
|
4068
|
-
/**
|
|
4069
|
-
* Компонент поля ввода количества.
|
|
4070
|
-
*/
|
|
4071
|
-
class ScInputQuantityComponent extends AbstractTuiNullableControl {
|
|
4072
|
-
constructor() {
|
|
4073
|
-
super(...arguments);
|
|
4074
|
-
/**
|
|
4075
|
-
* Шаг увеличения количества. Отвечает за проверку кратности ввода.
|
|
4076
|
-
*/
|
|
4077
|
-
this.step = 1;
|
|
4078
|
-
/**
|
|
4079
|
-
* Признак, что необходимо отобразить {@link TuiLoaderComponent} над компонентом.
|
|
4080
|
-
*/
|
|
4081
|
-
this.showLoader = false;
|
|
4082
|
-
/**
|
|
4083
|
-
* Признак, что необходимо отобразить кнопку очистки поля ввода.
|
|
4084
|
-
*/
|
|
4085
|
-
this.showCross = true;
|
|
4086
|
-
/**
|
|
4087
|
-
* Признак, что необходимо игнорировать валидацию кратности и минимального количества.
|
|
4088
|
-
*/
|
|
4089
|
-
this.ignoreStepValidators = false;
|
|
4090
|
-
/**
|
|
4091
|
-
* Формат внешнего вида компонента.
|
|
4092
|
-
*/
|
|
4093
|
-
this.appearance = 'primary';
|
|
4094
|
-
/**
|
|
4095
|
-
* Признак, что компонент деактивирован.
|
|
4096
|
-
*/
|
|
4097
|
-
this.isDisabled = false;
|
|
4098
|
-
/**
|
|
4099
|
-
* Размер компонента.
|
|
4100
|
-
*/
|
|
4101
|
-
this.size = 'm';
|
|
4102
|
-
/**
|
|
4103
|
-
* Событие нажатия на кнопку "Очистить".
|
|
4104
|
-
*/
|
|
4105
|
-
this.clickClearEvent = new EventEmitter();
|
|
4106
|
-
}
|
|
4107
|
-
/**
|
|
4108
|
-
* Возвращает элемент, который может быть сфокусирован.
|
|
4109
|
-
*/
|
|
4110
|
-
get nativeFocusableElement() {
|
|
4111
|
-
return this.numberInput?.nativeFocusableElement;
|
|
4112
|
-
}
|
|
4113
|
-
/** @inheritDoc */
|
|
4114
|
-
get focused() {
|
|
4115
|
-
return !!this.numberInput?.focused;
|
|
4116
|
-
}
|
|
4117
|
-
/**
|
|
4118
|
-
* Элемент формы ввода количества.
|
|
4119
|
-
*/
|
|
4120
|
-
get formControl() {
|
|
4121
|
-
return this.control;
|
|
4122
|
-
}
|
|
4123
|
-
/** @inheritDoc */
|
|
4124
|
-
ngOnInit() {
|
|
4125
|
-
if (this.control) {
|
|
4126
|
-
this.control.setValidators(stepValidator(this.ignoreStepValidators ? 1 : this.step));
|
|
4127
|
-
}
|
|
4128
|
-
}
|
|
4129
|
-
/**
|
|
4130
|
-
* Обработчик события нажатия стрелок клавиатуры.
|
|
4131
|
-
*
|
|
4132
|
-
* @param step Шаг изменения количества.
|
|
4133
|
-
*/
|
|
4134
|
-
onArrow(step) {
|
|
4135
|
-
if (!step) {
|
|
4136
|
-
return;
|
|
4137
|
-
}
|
|
4138
|
-
if (step > 0) {
|
|
4139
|
-
this.incident();
|
|
4140
|
-
}
|
|
4141
|
-
else {
|
|
4142
|
-
this.decrement();
|
|
4143
|
-
}
|
|
4144
|
-
}
|
|
4145
|
-
/**
|
|
4146
|
-
* Увеличивает значение в поле ввода на 1 шаг. Если число в поле ввода не кратно шагу, то увеличит до ближайшего кратного значения.
|
|
4147
|
-
*
|
|
4148
|
-
* @param checkUpdateOn Признак, что нужно проверить `updateOn` свойство `formControl`.
|
|
4149
|
-
*/
|
|
4150
|
-
incident(checkUpdateOn = false) {
|
|
4151
|
-
this.numberInput?.['onArrow'](this.step - ((this.numberInput.value ?? 0) % this.step));
|
|
4152
|
-
// eslint-disable-next-line no-underscore-dangle, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
|
|
4153
|
-
if (checkUpdateOn && this.formControl?._updateOn === 'blur') {
|
|
4154
|
-
this.control?.setValue(this.numberInput?.value);
|
|
4155
|
-
}
|
|
4156
|
-
}
|
|
4157
|
-
/**
|
|
4158
|
-
* Уменьшает значение в поле ввода на 1 шаг. Если число в поле ввода не кратно шагу, то уменьшит до ближайшего кратного значения.
|
|
4159
|
-
*
|
|
4160
|
-
* @param checkUpdateOn Признак, что нужно проверить `updateOn` свойство `formControl`.
|
|
4161
|
-
*/
|
|
4162
|
-
decrement(checkUpdateOn = false) {
|
|
4163
|
-
this.numberInput?.['onArrow'](-((this.numberInput.value ?? 0) % this.step) || -this.step);
|
|
4164
|
-
// eslint-disable-next-line no-underscore-dangle, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
|
|
4165
|
-
if (checkUpdateOn && this.formControl?._updateOn === 'blur') {
|
|
4166
|
-
this.control?.setValue(this.numberInput?.value);
|
|
4167
|
-
}
|
|
4168
|
-
}
|
|
4169
|
-
/**
|
|
4170
|
-
* Очищает поля ввода.
|
|
4171
|
-
*/
|
|
4172
|
-
clear() {
|
|
4173
|
-
this.control?.patchValue(null);
|
|
4174
|
-
this.clickClearEvent.emit();
|
|
4175
|
-
}
|
|
4176
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScInputQuantityComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
4177
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ScInputQuantityComponent, isStandalone: true, selector: "sc-input-quantity", inputs: { step: "step", showLoader: "showLoader", showCross: "showCross", ignoreStepValidators: "ignoreStepValidators", appearance: "appearance", isDisabled: "isDisabled", size: "size" }, outputs: { clickClearEvent: "clickClearEvent" }, host: { listeners: { "keydown.arrowDown": "onArrow(-step)", "keydown.arrowUp": "onArrow(step)" }, properties: { "attr.data-appearance": "this.appearance", "attr.data-disabled": "this.isDisabled", "attr.data-size": "this.size" } }, viewQueries: [{ propertyName: "numberInput", first: true, predicate: TuiInputNumberComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<tui-loader\n *ngIf=\"formControl\"\n class=\"w-full\"\n [overlay]=\"true\"\n [showLoader]=\"showLoader\"\n [size]=\"size\"\n>\n <div class=\"flex items-center gap-1 text-center\">\n <div class=\"field-with-button flex grow rounded-xl\">\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"!numberInput['canDecrement']\"\n (click.prevent)=\"decrement(true)\"\n >\n <tui-icon icon=\"@tui.minus\"></tui-icon>\n </button>\n <tui-input-number\n #numberInput\n [formControl]=\"formControl\"\n [tuiHint]=\"([] | tuiFieldError | async)?.message\"\n [tuiTextfieldLabelOutside]=\"true\"\n [min]=\"ignoreStepValidators ? 1 : step\"\n [tuiTextfieldSize]=\"size\"\n [required]=\"true\"\n [style.text-align]=\"'center'\"\n [style.font-weight]=\"700\"\n (focusin)=\"$any($event.target).select()\"\n oncontextmenu=\"return false;\"\n class=\"grow\"\n >\n </tui-input-number>\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"!numberInput['canIncrement']\"\n (click.prevent)=\"incident(true)\"\n >\n <tui-icon icon=\"@tui.plus\"></tui-icon>\n </button>\n </div>\n <button\n *ngIf=\"showCross\"\n tuiIconButton\n appearance=\"secondary\"\n [size]=\"size\"\n [disabled]=\"!numberInput['canIncrement']\"\n (click.prevent)=\"clear()\"\n >\n <tui-icon icon=\"@tui.x\"></tui-icon>\n </button>\n </div>\n</tui-loader>\n", styles: [":host [data-size=l]{--tui-height-l: var(--tui-height-m);--tui-font-text-m: bold .875rem/1.25rem var(--tui-font-text);--tui-padding-l: 0}:host [data-size=m]{--tui-height-m: var(--tui-height-s);--tui-font-text-s: bold .75rem/1rem var(--tui-font-text);--tui-padding-m: 0}:host [data-size=m] tui-svg{font-size:12px!important}:host [data-size=s]{--tui-height-s: var(--tui-height-xs);--tui-font-text-s: bold .75rem/1rem var(--tui-font-text);--tui-padding-s: 0}:host [data-size=s] tui-svg{font-size:12px!important}:host[data-disabled=true]{pointer-events:none;opacity:var(--tui-disabled-opacity)}:host[data-appearance=secondary] .field-with-button{background-color:var(--tui-background-base);box-shadow:inset 0 0 0 .0625rem var(--tui-background-neutral-1-hover)}:host[data-appearance=primary] .field-with-button{background-color:var(--tui-status-warning-pale)}:host .field-with-button:has(._invalid){background-color:var(--tui-status-negative-pale)}\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: TuiInputNumberModule }, { kind: "component", type: i3.TuiInputNumberComponent, selector: "tui-input-number", inputs: ["min", "max", "step"] }, { kind: "directive", type: i3.TuiInputNumberDirective, selector: "tui-input-number" }, { kind: "ngmodule", type: TuiTextfieldControllerModule }, { kind: "directive", type: i3.TuiTextfieldLabelOutsideDirective, selector: "[tuiTextfieldLabelOutside]", inputs: ["tuiTextfieldLabelOutside"] }, { kind: "directive", type: i3.TuiTextfieldSizeDirective, selector: "[tuiTextfieldSize]", inputs: ["tuiTextfieldSize"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"] }, { kind: "pipe", type: TuiFieldErrorPipe, name: "tuiFieldError" }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "showLoader"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4178
|
-
}
|
|
4179
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScInputQuantityComponent, decorators: [{
|
|
4180
|
-
type: Component,
|
|
4181
|
-
args: [{ standalone: true, selector: 'sc-input-quantity', imports: [
|
|
4182
|
-
CommonModule,
|
|
4183
|
-
RouterModule,
|
|
4184
|
-
TuiButton,
|
|
4185
|
-
TuiIcon,
|
|
4186
|
-
TuiIslandDirective,
|
|
4187
|
-
TuiInputNumberModule,
|
|
4188
|
-
TuiTextfieldControllerModule,
|
|
4189
|
-
FormsModule,
|
|
4190
|
-
ReactiveFormsModule,
|
|
4191
|
-
...TuiHint,
|
|
4192
|
-
TuiFieldErrorPipe,
|
|
4193
|
-
TuiLoader,
|
|
4194
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<tui-loader\n *ngIf=\"formControl\"\n class=\"w-full\"\n [overlay]=\"true\"\n [showLoader]=\"showLoader\"\n [size]=\"size\"\n>\n <div class=\"flex items-center gap-1 text-center\">\n <div class=\"field-with-button flex grow rounded-xl\">\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"!numberInput['canDecrement']\"\n (click.prevent)=\"decrement(true)\"\n >\n <tui-icon icon=\"@tui.minus\"></tui-icon>\n </button>\n <tui-input-number\n #numberInput\n [formControl]=\"formControl\"\n [tuiHint]=\"([] | tuiFieldError | async)?.message\"\n [tuiTextfieldLabelOutside]=\"true\"\n [min]=\"ignoreStepValidators ? 1 : step\"\n [tuiTextfieldSize]=\"size\"\n [required]=\"true\"\n [style.text-align]=\"'center'\"\n [style.font-weight]=\"700\"\n (focusin)=\"$any($event.target).select()\"\n oncontextmenu=\"return false;\"\n class=\"grow\"\n >\n </tui-input-number>\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"!numberInput['canIncrement']\"\n (click.prevent)=\"incident(true)\"\n >\n <tui-icon icon=\"@tui.plus\"></tui-icon>\n </button>\n </div>\n <button\n *ngIf=\"showCross\"\n tuiIconButton\n appearance=\"secondary\"\n [size]=\"size\"\n [disabled]=\"!numberInput['canIncrement']\"\n (click.prevent)=\"clear()\"\n >\n <tui-icon icon=\"@tui.x\"></tui-icon>\n </button>\n </div>\n</tui-loader>\n", styles: [":host [data-size=l]{--tui-height-l: var(--tui-height-m);--tui-font-text-m: bold .875rem/1.25rem var(--tui-font-text);--tui-padding-l: 0}:host [data-size=m]{--tui-height-m: var(--tui-height-s);--tui-font-text-s: bold .75rem/1rem var(--tui-font-text);--tui-padding-m: 0}:host [data-size=m] tui-svg{font-size:12px!important}:host [data-size=s]{--tui-height-s: var(--tui-height-xs);--tui-font-text-s: bold .75rem/1rem var(--tui-font-text);--tui-padding-s: 0}:host [data-size=s] tui-svg{font-size:12px!important}:host[data-disabled=true]{pointer-events:none;opacity:var(--tui-disabled-opacity)}:host[data-appearance=secondary] .field-with-button{background-color:var(--tui-background-base);box-shadow:inset 0 0 0 .0625rem var(--tui-background-neutral-1-hover)}:host[data-appearance=primary] .field-with-button{background-color:var(--tui-status-warning-pale)}:host .field-with-button:has(._invalid){background-color:var(--tui-status-negative-pale)}\n"] }]
|
|
4195
|
-
}], propDecorators: { numberInput: [{
|
|
4196
|
-
type: ViewChild,
|
|
4197
|
-
args: [TuiInputNumberComponent]
|
|
4198
|
-
}], step: [{
|
|
4199
|
-
type: Input
|
|
4200
|
-
}], showLoader: [{
|
|
4201
|
-
type: Input
|
|
4202
|
-
}], showCross: [{
|
|
4203
|
-
type: Input
|
|
4204
|
-
}], ignoreStepValidators: [{
|
|
4205
|
-
type: Input
|
|
4206
|
-
}], appearance: [{
|
|
4207
|
-
type: Input
|
|
4208
|
-
}, {
|
|
4209
|
-
type: HostBinding,
|
|
4210
|
-
args: ['attr.data-appearance']
|
|
4211
|
-
}], isDisabled: [{
|
|
4212
|
-
type: Input
|
|
4213
|
-
}, {
|
|
4214
|
-
type: HostBinding,
|
|
4215
|
-
args: ['attr.data-disabled']
|
|
4216
|
-
}], size: [{
|
|
4217
|
-
type: Input
|
|
4218
|
-
}, {
|
|
4219
|
-
type: HostBinding,
|
|
4220
|
-
args: ['attr.data-size']
|
|
4221
|
-
}], clickClearEvent: [{
|
|
4222
|
-
type: Output
|
|
4223
|
-
}], onArrow: [{
|
|
4224
|
-
type: HostListener,
|
|
4225
|
-
args: ['keydown.arrowDown', ['-step']]
|
|
4226
|
-
}, {
|
|
4227
|
-
type: HostListener,
|
|
4228
|
-
args: ['keydown.arrowUp', ['step']]
|
|
4229
|
-
}] } });
|
|
4230
|
-
|
|
4231
|
-
/**
|
|
4232
|
-
* Компонент данных о наличии товара на складе.
|
|
4233
|
-
*/
|
|
4234
|
-
class ScPriceWarehouseStockComponent {
|
|
4235
|
-
/**
|
|
4236
|
-
* Инициализирует экземпляр класса {@link ScPriceWarehouseStockComponent}.
|
|
4237
|
-
*
|
|
4238
|
-
* @param warehouseService Сервис для работы со складами.
|
|
4239
|
-
*/
|
|
4240
|
-
constructor(warehouseService) {
|
|
4241
|
-
this.warehouseService = warehouseService;
|
|
4242
|
-
/**
|
|
4243
|
-
* Признак, что необходимо отобразить подсказку по складам.
|
|
4244
|
-
*/
|
|
4245
|
-
this.withStockHint = true;
|
|
4246
|
-
/**
|
|
4247
|
-
* Признак, что необходимо отобразить список остатков по складам при выбранном основном складе.
|
|
4248
|
-
*/
|
|
4249
|
-
this.fromMain = true;
|
|
4250
|
-
}
|
|
4251
|
-
/** @inheritDoc */
|
|
4252
|
-
ngOnInit() {
|
|
4253
|
-
this.selectedWarehouse$ = this.fromMain ? this.warehouseService.getCatalogWarehouseChange$() : this.warehouseService.getWarehouseSelectChange$();
|
|
4254
|
-
this.warehousesList$ = this.selectedWarehouse$.pipe(switchMap((warehouse) => this.warehouseService.getWarehouses$().pipe(map((warehouses) => {
|
|
4255
|
-
const items = warehouses.map((w) => {
|
|
4256
|
-
const stockCount = this.product.stockCount?.find((sc) => sc.warehouseId === w.id);
|
|
4257
|
-
return {
|
|
4258
|
-
w: w,
|
|
4259
|
-
sc: stockCount ?? { warehouseId: w.id, count: 0 },
|
|
4260
|
-
};
|
|
4261
|
-
});
|
|
4262
|
-
return items.sort((item) => (item.w.id === warehouse?.id ? -1 : 1));
|
|
4263
|
-
}))));
|
|
4264
|
-
}
|
|
4265
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScPriceWarehouseStockComponent, deps: [{ token: i1.ScWarehouseService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4266
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ScPriceWarehouseStockComponent, isStandalone: true, selector: "sc-price-warehouse-stock", inputs: { classList: "classList", product: "product", withStockHint: "withStockHint", fromMain: "fromMain" }, ngImport: i0, template: "<ng-container *ngIf=\"product\">\n @let isDisabled = product.isHidden || product.isNull;\n\n <ng-container *ngIf=\"selectedWarehouse$ | async as warehouseSelect\">\n <span *tuiLet=\"withStockHint && !!(warehousesList$ | async)?.length as showStockHint\">\n <ng-container *ngIf=\"!product.stockCount?.length && product.getNotStockMessage(warehouseSelect) as message\">\n <a\n *tuiLet=\"!!(product.properties?.planingIncomingDate || product.properties?.planingProductionDate) as showPlaningHint\"\n tuiLink\n [pseudo]=\"showPlaningHint\"\n [tuiHint]=\"showPlaningHint && planingHint\"\n [class.disabled]=\"isDisabled\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [style.color]=\"'var(--tui-status-negative)'\"\n [style.cursor]=\"showPlaningHint && planingHint ? 'pointer' : 'default'\"\n [ngClass]=\"classList\"\n >\n {{ message }}\n </a>\n </ng-container>\n <ng-template #planingHint>\n <span *ngIf=\"product.properties?.planingIncomingDate\">\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u043F\u043E\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u044F <br />\n \u043D\u0430 \u041E\u0441\u043D\u043E\u0432\u043D\u043E\u0439 \u0441\u043A\u043B\u0430\u0434:\n <span class=\"font-bold\">{{ product.properties?.planingIncomingDate }}</span>\n </span>\n <span *ngIf=\"product.properties?.planingProductionDate\">\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u0430:\n <span class=\"font-bold\">{{ product.properties?.planingProductionDate }}</span>\n </span>\n </ng-template>\n <span *ngIf=\"product.stockCount && product.stockCount.length && !product.onOrder\">\n <span\n tuiLink\n [style.color]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"showStockHint && stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [ngClass]=\"classList\"\n [class.disabled]=\"isDisabled\"\n class=\"!underline\"\n >\n \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u043D\u0430\u043B\u0438\u0447\u0438\u0435\n </span>\n </span>\n\n <span\n *ngIf=\"product.onOrder\"\n [style.color]=\"'var(--tui-status-warning)'\"\n [ngClass]=\"classList\"\n >\n \u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437\n </span>\n </span>\n </ng-container>\n\n <ng-template #stockHint>\n <table\n *ngIf=\"selectedWarehouse$ | async as warehouseSelect\"\n class=\"stock-table table-auto text-body-s\"\n [ngClass]=\"classList\"\n >\n <tbody>\n <tr\n *ngFor=\"let item of warehousesList$ | async\"\n class=\"border-b\"\n >\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count !== undefined && item.sc.count !== null ? item.sc.count + ' ' + product.quantityUnit : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n </tbody>\n </table>\n </ng-template>\n</ng-container>\n", styles: ["::ng-deep tui-hint:has(.stock-table){max-inline-size:22rem}[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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: "ngmodule", type: TuiTextfieldControllerModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo"] }, { kind: "directive", type: TuiLet, selector: "[tuiLet]", inputs: ["tuiLet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4267
|
-
}
|
|
4268
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScPriceWarehouseStockComponent, decorators: [{
|
|
4269
|
-
type: Component,
|
|
4270
|
-
args: [{ standalone: true, selector: 'sc-price-warehouse-stock', imports: [CommonModule, RouterModule, TuiTextfieldControllerModule, FormsModule, ReactiveFormsModule, ...TuiHint, TuiLink, TuiLet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"product\">\n @let isDisabled = product.isHidden || product.isNull;\n\n <ng-container *ngIf=\"selectedWarehouse$ | async as warehouseSelect\">\n <span *tuiLet=\"withStockHint && !!(warehousesList$ | async)?.length as showStockHint\">\n <ng-container *ngIf=\"!product.stockCount?.length && product.getNotStockMessage(warehouseSelect) as message\">\n <a\n *tuiLet=\"!!(product.properties?.planingIncomingDate || product.properties?.planingProductionDate) as showPlaningHint\"\n tuiLink\n [pseudo]=\"showPlaningHint\"\n [tuiHint]=\"showPlaningHint && planingHint\"\n [class.disabled]=\"isDisabled\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [style.color]=\"'var(--tui-status-negative)'\"\n [style.cursor]=\"showPlaningHint && planingHint ? 'pointer' : 'default'\"\n [ngClass]=\"classList\"\n >\n {{ message }}\n </a>\n </ng-container>\n <ng-template #planingHint>\n <span *ngIf=\"product.properties?.planingIncomingDate\">\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u043F\u043E\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u044F <br />\n \u043D\u0430 \u041E\u0441\u043D\u043E\u0432\u043D\u043E\u0439 \u0441\u043A\u043B\u0430\u0434:\n <span class=\"font-bold\">{{ product.properties?.planingIncomingDate }}</span>\n </span>\n <span *ngIf=\"product.properties?.planingProductionDate\">\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u0430:\n <span class=\"font-bold\">{{ product.properties?.planingProductionDate }}</span>\n </span>\n </ng-template>\n <span *ngIf=\"product.stockCount && product.stockCount.length && !product.onOrder\">\n <span\n tuiLink\n [style.color]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"showStockHint && stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [ngClass]=\"classList\"\n [class.disabled]=\"isDisabled\"\n class=\"!underline\"\n >\n \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u043D\u0430\u043B\u0438\u0447\u0438\u0435\n </span>\n </span>\n\n <span\n *ngIf=\"product.onOrder\"\n [style.color]=\"'var(--tui-status-warning)'\"\n [ngClass]=\"classList\"\n >\n \u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437\n </span>\n </span>\n </ng-container>\n\n <ng-template #stockHint>\n <table\n *ngIf=\"selectedWarehouse$ | async as warehouseSelect\"\n class=\"stock-table table-auto text-body-s\"\n [ngClass]=\"classList\"\n >\n <tbody>\n <tr\n *ngFor=\"let item of warehousesList$ | async\"\n class=\"border-b\"\n >\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count !== undefined && item.sc.count !== null ? item.sc.count + ' ' + product.quantityUnit : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n </tbody>\n </table>\n </ng-template>\n</ng-container>\n", styles: ["::ng-deep tui-hint:has(.stock-table){max-inline-size:22rem}[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"] }]
|
|
4271
|
-
}], ctorParameters: () => [{ type: i1.ScWarehouseService }], propDecorators: { classList: [{
|
|
4272
|
-
type: Input
|
|
4273
|
-
}], product: [{
|
|
4274
|
-
type: Input
|
|
4275
|
-
}], withStockHint: [{
|
|
4276
|
-
type: Input
|
|
4277
|
-
}], fromMain: [{
|
|
4278
|
-
type: Input
|
|
4279
|
-
}] } });
|
|
4280
|
-
|
|
4281
3943
|
/* eslint-disable no-underscore-dangle */
|
|
4282
3944
|
/**
|
|
4283
3945
|
* Компонент карточки элемента корзины.
|
|
4284
3946
|
*/
|
|
4285
|
-
class ScCartItemComponent extends AbstractScPriceCard {
|
|
3947
|
+
class ScCartItemComponent extends AbstractScPriceCard$1 {
|
|
4286
3948
|
constructor() {
|
|
4287
3949
|
super(...arguments);
|
|
4288
3950
|
/**
|
|
@@ -4303,7 +3965,7 @@ class ScCartItemComponent extends AbstractScPriceCard {
|
|
|
4303
3965
|
this.previewDialogService.open(specificationPreviewReference).subscribe();
|
|
4304
3966
|
}
|
|
4305
3967
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScCartItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
4306
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: ScCartItemComponent, isStandalone: true, selector: "sc-cart-item", outputs: { clickSettings: "clickSettings" }, providers: [SEARCH_TERM_PROVIDERS], usesInheritance: true, ngImport: i0, template: "<div\n *ngIf=\"product && cartItem; else skeleton\"\n class=\"relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\"\n>\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 justify-between gap-4 md:flex-row md:items-center md:gap-5\">\n <div class=\"flex grow 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 <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 <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\n <sc-cost-with-discount [product]=\"product\" />\n </div>\n <a\n tuiLink\n *ngIf=\"cartItem.specificationImgUrl\"\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 <ng-template\n #specificationPreview\n let-preview\n >\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n >\n <img\n *polymorpheusOutlet=\"cartItem.specificationImgUrl as src\"\n alt=\"preview\"\n [src]=\"cartItem.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=\"flex shrink-0 flex-col gap-4 sm:flex-row md:w-1/2 lg:w-3/5 xl:w-1/2 xl:gap-8 2xl:w-2/5\">\n <div class=\"flex flex-wrap items-center gap-4 md:flex-col md:items-start lg:flex-row lg:items-center lg:gap-8\">\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n *ngIf=\"showQuantityControl\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [showCross]=\"false\"\n [isDisabled]=\"isDisabled\"\n [step]=\"unitsHelper.productMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"quantityShowLoader\"\n (clickClearEvent)=\"clickClearEvent.emit(cartItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-32 shrink-0\"\n />\n <div class=\"flex w-36 items-center gap-1\">\n @if (cartItem.height || cartItem.length || cartItem.width) {\n <button\n tuiIconButton\n iconStart=\"@tui.settings\"\n [disabled]=\"isDisabled\"\n (click)=\"clickSettings.emit()\"\n size=\"s\"\n appearance=\"secondary\"\n class=\"mr-2 !self-center\"\n ></button>\n <div class=\"flex flex-col gap-x-2 text-xs text-tui-base-07\">\n <p *ngIf=\"cartItem.marker\">\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430: {{ cartItem.marker }}</p>\n <p *ngIf=\"cartItem.width\">\u0428\u0438\u0440\u0438\u043D\u0430: {{ cartItem.width }} \u043C.</p>\n <ng-container *ngIf=\"cartItem.height; else length\">\n <p>\u0412\u044B\u0441\u043E\u0442\u0430: {{ cartItem.height }} \u043C.</p>\n </ng-container>\n <ng-template #length>\n <p *ngIf=\"cartItem.length\">\u0414\u043B\u0438\u043D\u0430: {{ cartItem.length }} \u043C.</p>\n </ng-template>\n </div>\n }\n </div>\n </div>\n\n <div class=\"flex flex-col\">\n <p class=\"whitespace-nowrap\">\n \u0421\u0443\u043C\u043C\u0430:\n <strong> {{ cartItem.costRub | tuiFormatNumber: { precision: 2, decimalSeparator: '.', rounding: 'ceil' } | async }} {{ 'RUB' | tuiCurrency }}</strong>\n </p>\n <sc-price-warehouse-stock [product]=\"product\" />\n </div>\n <button\n tuiIconButton\n iconStart=\"@tui.trash\"\n (click)=\"clickClearEvent.emit()\"\n size=\"s\"\n appearance=\"secondary\"\n class=\"!absolute left-1 top-1 lg:!relative lg:left-0 lg:top-0 lg:ml-auto\"\n ></button>\n </div>\n </div>\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", 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: "directive", type: i2$4.PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"] }, { 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"] }, { kind: "directive", type: i2$1.TuiPreviewAction, selector: "[tuiPreviewAction]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3968
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: ScCartItemComponent, isStandalone: true, selector: "sc-cart-item", outputs: { clickSettings: "clickSettings" }, providers: [SEARCH_TERM_PROVIDERS], usesInheritance: true, ngImport: i0, template: "<div\n *ngIf=\"product && cartItem; else skeleton\"\n class=\"relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\"\n>\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 justify-between gap-4 md:flex-row md:items-center md:gap-5\">\n <div class=\"flex grow 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 <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 <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\n <sc-cost-with-discount [product]=\"product\" />\n </div>\n <a\n tuiLink\n *ngIf=\"cartItem.specificationImgUrl\"\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 <ng-template\n #specificationPreview\n let-preview\n >\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n >\n <img\n *polymorpheusOutlet=\"cartItem.specificationImgUrl as src\"\n alt=\"preview\"\n [src]=\"cartItem.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=\"flex shrink-0 flex-col gap-4 sm:flex-row md:w-1/2 lg:w-3/5 xl:w-1/2 xl:gap-8 2xl:w-2/5\">\n <div class=\"flex flex-wrap items-center gap-4 md:flex-col md:items-start lg:flex-row lg:items-center lg:gap-8\">\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n *ngIf=\"showQuantityControl\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [showCross]=\"false\"\n [isDisabled]=\"isDisabled\"\n [step]=\"unitsHelper.productMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"quantityShowLoader\"\n (clickClearEvent)=\"clickClearEvent.emit(cartItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-32 shrink-0\"\n />\n <div class=\"flex w-36 items-center gap-1\">\n @if (cartItem.height || cartItem.length || cartItem.width) {\n <button\n tuiIconButton\n iconStart=\"@tui.settings\"\n [disabled]=\"isDisabled\"\n (click)=\"clickSettings.emit()\"\n size=\"s\"\n appearance=\"secondary\"\n class=\"mr-2 !self-center\"\n ></button>\n <div class=\"flex flex-col gap-x-2 text-xs text-tui-base-07\">\n <p *ngIf=\"cartItem.marker\">\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430: {{ cartItem.marker }}</p>\n <p *ngIf=\"cartItem.width\">\u0428\u0438\u0440\u0438\u043D\u0430: {{ cartItem.width }} \u043C.</p>\n <ng-container *ngIf=\"cartItem.height; else length\">\n <p>\u0412\u044B\u0441\u043E\u0442\u0430: {{ cartItem.height }} \u043C.</p>\n </ng-container>\n <ng-template #length>\n <p *ngIf=\"cartItem.length\">\u0414\u043B\u0438\u043D\u0430: {{ cartItem.length }} \u043C.</p>\n </ng-template>\n </div>\n }\n </div>\n </div>\n\n <div class=\"flex flex-col\">\n <p class=\"whitespace-nowrap\">\n \u0421\u0443\u043C\u043C\u0430:\n <strong> {{ cartItem.costRub | tuiFormatNumber: { precision: 2, decimalSeparator: '.', rounding: 'ceil' } | async }} {{ 'RUB' | tuiCurrency }}</strong>\n </p>\n <sc-price-warehouse-stock [product]=\"product\" />\n </div>\n <button\n tuiIconButton\n iconStart=\"@tui.trash\"\n (click)=\"clickClearEvent.emit()\"\n size=\"s\"\n appearance=\"secondary\"\n class=\"!absolute left-1 top-1 lg:!relative lg:left-0 lg:top-0 lg:ml-auto\"\n ></button>\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", 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: "directive", type: i2$4.PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"] }, { 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$1, selector: "sc-hover-image-carousel", inputs: ["images", "isShowActions", "productName"] }, { kind: "component", type: CostWithDiscountComponent$1, selector: "sc-cost-with-discount", inputs: ["product", "size"] }, { kind: "component", type: ScPriceWarehouseStockComponent$1, selector: "sc-price-warehouse-stock", inputs: ["classList", "product", "withStockHint", "fromMain"] }, { kind: "component", type: ScInputQuantityComponent$1, 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"] }, { kind: "directive", type: i2$1.TuiPreviewAction, selector: "[tuiPreviewAction]" }, { kind: "component", type: ScNoindexWrapperComponent$1, selector: "sc-noindex-wrapper" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4307
3969
|
}
|
|
4308
3970
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScCartItemComponent, decorators: [{
|
|
4309
3971
|
type: Component,
|
|
@@ -4319,15 +3981,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
4319
3981
|
TuiLink,
|
|
4320
3982
|
TuiHighlight,
|
|
4321
3983
|
TuiAutoFocus,
|
|
4322
|
-
ScHoverImageCarouselComponent,
|
|
4323
|
-
CostWithDiscountComponent,
|
|
4324
|
-
ScPriceWarehouseStockComponent,
|
|
4325
|
-
ScInputQuantityComponent,
|
|
3984
|
+
ScHoverImageCarouselComponent$1,
|
|
3985
|
+
CostWithDiscountComponent$1,
|
|
3986
|
+
ScPriceWarehouseStockComponent$1,
|
|
3987
|
+
ScInputQuantityComponent$1,
|
|
4326
3988
|
TuiCurrencyPipe,
|
|
4327
3989
|
TuiFormatNumberPipe,
|
|
4328
3990
|
TuiPreview,
|
|
4329
|
-
|
|
4330
|
-
], providers: [SEARCH_TERM_PROVIDERS], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngIf=\"product && cartItem; else skeleton\"\n class=\"relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\"\n>\n @let isDisabled = product.isHidden || product.isNull;\n
|
|
3991
|
+
ScNoindexWrapperComponent$1,
|
|
3992
|
+
], providers: [SEARCH_TERM_PROVIDERS], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngIf=\"product && cartItem; else skeleton\"\n class=\"relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\"\n>\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 justify-between gap-4 md:flex-row md:items-center md:gap-5\">\n <div class=\"flex grow 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 <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 <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\n <sc-cost-with-discount [product]=\"product\" />\n </div>\n <a\n tuiLink\n *ngIf=\"cartItem.specificationImgUrl\"\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 <ng-template\n #specificationPreview\n let-preview\n >\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n >\n <img\n *polymorpheusOutlet=\"cartItem.specificationImgUrl as src\"\n alt=\"preview\"\n [src]=\"cartItem.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=\"flex shrink-0 flex-col gap-4 sm:flex-row md:w-1/2 lg:w-3/5 xl:w-1/2 xl:gap-8 2xl:w-2/5\">\n <div class=\"flex flex-wrap items-center gap-4 md:flex-col md:items-start lg:flex-row lg:items-center lg:gap-8\">\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n *ngIf=\"showQuantityControl\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [showCross]=\"false\"\n [isDisabled]=\"isDisabled\"\n [step]=\"unitsHelper.productMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"quantityShowLoader\"\n (clickClearEvent)=\"clickClearEvent.emit(cartItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-32 shrink-0\"\n />\n <div class=\"flex w-36 items-center gap-1\">\n @if (cartItem.height || cartItem.length || cartItem.width) {\n <button\n tuiIconButton\n iconStart=\"@tui.settings\"\n [disabled]=\"isDisabled\"\n (click)=\"clickSettings.emit()\"\n size=\"s\"\n appearance=\"secondary\"\n class=\"mr-2 !self-center\"\n ></button>\n <div class=\"flex flex-col gap-x-2 text-xs text-tui-base-07\">\n <p *ngIf=\"cartItem.marker\">\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430: {{ cartItem.marker }}</p>\n <p *ngIf=\"cartItem.width\">\u0428\u0438\u0440\u0438\u043D\u0430: {{ cartItem.width }} \u043C.</p>\n <ng-container *ngIf=\"cartItem.height; else length\">\n <p>\u0412\u044B\u0441\u043E\u0442\u0430: {{ cartItem.height }} \u043C.</p>\n </ng-container>\n <ng-template #length>\n <p *ngIf=\"cartItem.length\">\u0414\u043B\u0438\u043D\u0430: {{ cartItem.length }} \u043C.</p>\n </ng-template>\n </div>\n }\n </div>\n </div>\n\n <div class=\"flex flex-col\">\n <p class=\"whitespace-nowrap\">\n \u0421\u0443\u043C\u043C\u0430:\n <strong> {{ cartItem.costRub | tuiFormatNumber: { precision: 2, decimalSeparator: '.', rounding: 'ceil' } | async }} {{ 'RUB' | tuiCurrency }}</strong>\n </p>\n <sc-price-warehouse-stock [product]=\"product\" />\n </div>\n <button\n tuiIconButton\n iconStart=\"@tui.trash\"\n (click)=\"clickClearEvent.emit()\"\n size=\"s\"\n appearance=\"secondary\"\n class=\"!absolute left-1 top-1 lg:!relative lg:left-0 lg:top-0 lg:ml-auto\"\n ></button>\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" }]
|
|
4331
3993
|
}] });
|
|
4332
3994
|
|
|
4333
3995
|
/**
|
|
@@ -4835,46 +4497,282 @@ class ScCategoryCardComponent {
|
|
|
4835
4497
|
this.clickOnFavoriteEvent = new EventEmitter();
|
|
4836
4498
|
}
|
|
4837
4499
|
/**
|
|
4838
|
-
* Обработчик события наведения.
|
|
4500
|
+
* Обработчик события наведения.
|
|
4501
|
+
*
|
|
4502
|
+
* @param isHover Признак наведения на карточку.
|
|
4503
|
+
*/
|
|
4504
|
+
onHovered(isHover) {
|
|
4505
|
+
this.isHover = isHover;
|
|
4506
|
+
}
|
|
4507
|
+
/**
|
|
4508
|
+
* Устанавливает компонент в очередь на обновление.
|
|
4509
|
+
*
|
|
4510
|
+
* @deprecated
|
|
4511
|
+
*/
|
|
4512
|
+
markForCheck() {
|
|
4513
|
+
this.cdr.markForCheck();
|
|
4514
|
+
}
|
|
4515
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScCategoryCardComponent, deps: [{ token: SC_URLS }, { token: SC_PATH_IMAGE_NOT_FOUND }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4516
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: ScCategoryCardComponent, selector: "sc-category-card", inputs: { category: { classPropertyName: "category", publicName: "category", isSignal: false, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: false, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, enableHover: { classPropertyName: "enableHover", publicName: "enableHover", isSignal: false, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { clickOnFavoriteEvent: "clickOnFavoriteEvent" }, host: { properties: { "attr.data-size": "this.size" } }, ngImport: i0, template: "<div class=\"relative\">\n <a\n (tuiHoveredChange)=\"onHovered($event)\"\n [routerLink]=\"href ?? null\"\n class=\"category-button flex flex-col overflow-hidden rounded-tui-radius-m border border-tui-base-04 text-center\"\n >\n <div class=\"img-wrapper w-full grow overflow-hidden\">\n <picture *ngIf=\"category\">\n @if (category.properties?.imageWebp) {\n <source\n type=\"image/webp\"\n [srcset]=\"category.properties?.imageWebp | scMediaImageTransformer\"\n />\n }\n <img\n [src]=\"category.properties?.image | scMediaImageTransformer: true\"\n [alt]=\"category.name\"\n [ngClass]=\"{ '!object-contain p-2': appearance() === 'normal' || !category.properties?.image }\"\n class=\"size-full rounded-xl object-cover\"\n />\n </picture>\n\n <!-- \u0411\u043B\u043E\u043A \u0434\u043B\u044F \u0441\u043A\u0435\u043B\u0435\u0442\u043E\u043D\u0430 \u043A\u0430\u0440\u0442\u043E\u0447\u043A\u0438. -->\n <div\n *ngIf=\"!category\"\n class=\"img-wrapper size-full bg-tui-base-02\"\n ></div>\n </div>\n\n <div class=\"name flex w-full items-center justify-center break-all\">\n @if (category) {\n @if (enableHover && !isMobile) {\n <tui-line-clamp\n [content]=\"category.name\"\n class=\"pointer-events-none\"\n [lineHeight]=\"size === 'm' ? 26 : 24\"\n [linesLimit]=\"isHover ? 4 : 2\"\n />\n } @else {\n {{ category.name }}\n }\n } @else {\n <div class=\"skeleton-name rounded-tui-radius-s bg-tui-base-02\"></div>\n }\n </div>\n </a>\n <sc-favorite-button\n *ngIf=\"category && (authStatus$ | async)\"\n [showLoader]=\"favoriteShowLoader\"\n [isFavorite]=\"category.isFavorite\"\n (clickEvent)=\"clickOnFavoriteEvent.emit()\"\n class=\"absolute left-1 top-1\"\n />\n</div>\n", styles: [":host{--tui-duration: .15s}:host[data-size=m] a.category-button{width:100%;height:12.5rem}:host[data-size=m] a.category-button .img-wrapper{max-height:8.75rem}:host[data-size=m] a.category-button .name{padding:.25rem 1rem;margin-block:auto;font-size:.9375rem;line-height:1.5rem;font-weight:800}:host[data-size=m] a.category-button .name .skeleton-name{width:10rem;height:1rem}:host[data-size=s] a.category-button{width:100%;height:10rem}:host[data-size=s] a.category-button .img-wrapper{max-height:7rem}:host[data-size=s] a.category-button .name{padding:.25rem .5rem;margin-block:auto;font-size:.8125rem;line-height:1.25rem;font-weight:800}:host[data-size=s] a.category-button .name .skeleton-name{width:7rem;height:.75rem}\n"], dependencies: [{ kind: "directive", type: i2$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$5.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i2$1.TuiLineClamp, selector: "tui-line-clamp", inputs: ["lineHeight", "content", "linesLimit"], outputs: ["overflownChange"] }, { kind: "directive", type: i7.TuiHovered, selector: "[tuiHoveredChange]", outputs: ["tuiHoveredChange"] }, { kind: "component", type: ScFavoriteButtonComponent, selector: "sc-favorite-button", inputs: ["isFavorite", "showLoader", "disabled"], outputs: ["clickEvent"] }, { kind: "pipe", type: i2$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.ScMediaImageTransformerPipe, name: "scMediaImageTransformer" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4517
|
+
}
|
|
4518
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScCategoryCardComponent, decorators: [{
|
|
4519
|
+
type: Component,
|
|
4520
|
+
args: [{ selector: 'sc-category-card', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"relative\">\n <a\n (tuiHoveredChange)=\"onHovered($event)\"\n [routerLink]=\"href ?? null\"\n class=\"category-button flex flex-col overflow-hidden rounded-tui-radius-m border border-tui-base-04 text-center\"\n >\n <div class=\"img-wrapper w-full grow overflow-hidden\">\n <picture *ngIf=\"category\">\n @if (category.properties?.imageWebp) {\n <source\n type=\"image/webp\"\n [srcset]=\"category.properties?.imageWebp | scMediaImageTransformer\"\n />\n }\n <img\n [src]=\"category.properties?.image | scMediaImageTransformer: true\"\n [alt]=\"category.name\"\n [ngClass]=\"{ '!object-contain p-2': appearance() === 'normal' || !category.properties?.image }\"\n class=\"size-full rounded-xl object-cover\"\n />\n </picture>\n\n <!-- \u0411\u043B\u043E\u043A \u0434\u043B\u044F \u0441\u043A\u0435\u043B\u0435\u0442\u043E\u043D\u0430 \u043A\u0430\u0440\u0442\u043E\u0447\u043A\u0438. -->\n <div\n *ngIf=\"!category\"\n class=\"img-wrapper size-full bg-tui-base-02\"\n ></div>\n </div>\n\n <div class=\"name flex w-full items-center justify-center break-all\">\n @if (category) {\n @if (enableHover && !isMobile) {\n <tui-line-clamp\n [content]=\"category.name\"\n class=\"pointer-events-none\"\n [lineHeight]=\"size === 'm' ? 26 : 24\"\n [linesLimit]=\"isHover ? 4 : 2\"\n />\n } @else {\n {{ category.name }}\n }\n } @else {\n <div class=\"skeleton-name rounded-tui-radius-s bg-tui-base-02\"></div>\n }\n </div>\n </a>\n <sc-favorite-button\n *ngIf=\"category && (authStatus$ | async)\"\n [showLoader]=\"favoriteShowLoader\"\n [isFavorite]=\"category.isFavorite\"\n (clickEvent)=\"clickOnFavoriteEvent.emit()\"\n class=\"absolute left-1 top-1\"\n />\n</div>\n", styles: [":host{--tui-duration: .15s}:host[data-size=m] a.category-button{width:100%;height:12.5rem}:host[data-size=m] a.category-button .img-wrapper{max-height:8.75rem}:host[data-size=m] a.category-button .name{padding:.25rem 1rem;margin-block:auto;font-size:.9375rem;line-height:1.5rem;font-weight:800}:host[data-size=m] a.category-button .name .skeleton-name{width:10rem;height:1rem}:host[data-size=s] a.category-button{width:100%;height:10rem}:host[data-size=s] a.category-button .img-wrapper{max-height:7rem}:host[data-size=s] a.category-button .name{padding:.25rem .5rem;margin-block:auto;font-size:.8125rem;line-height:1.25rem;font-weight:800}:host[data-size=s] a.category-button .name .skeleton-name{width:7rem;height:.75rem}\n"] }]
|
|
4521
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
4522
|
+
type: Inject,
|
|
4523
|
+
args: [SC_URLS]
|
|
4524
|
+
}] }, { type: undefined, decorators: [{
|
|
4525
|
+
type: Inject,
|
|
4526
|
+
args: [SC_PATH_IMAGE_NOT_FOUND]
|
|
4527
|
+
}] }, { type: i0.ChangeDetectorRef }], propDecorators: { category: [{
|
|
4528
|
+
type: Input
|
|
4529
|
+
}], size: [{
|
|
4530
|
+
type: Input
|
|
4531
|
+
}, {
|
|
4532
|
+
type: HostBinding,
|
|
4533
|
+
args: ['attr.data-size']
|
|
4534
|
+
}], enableHover: [{
|
|
4535
|
+
type: Input
|
|
4536
|
+
}], clickOnFavoriteEvent: [{
|
|
4537
|
+
type: Output
|
|
4538
|
+
}], href: [{
|
|
4539
|
+
type: Input
|
|
4540
|
+
}] } });
|
|
4541
|
+
|
|
4542
|
+
/**
|
|
4543
|
+
* Компонент просмотра изображений через событие наведения.
|
|
4544
|
+
*/
|
|
4545
|
+
class ScHoverImageCarouselComponent {
|
|
4546
|
+
constructor() {
|
|
4547
|
+
/**
|
|
4548
|
+
* Массив изображений.
|
|
4549
|
+
*/
|
|
4550
|
+
this.images = input.required();
|
|
4551
|
+
/**
|
|
4552
|
+
* Признак что необходимо отобразить элементы управления.
|
|
4553
|
+
*/
|
|
4554
|
+
this.isShowActions = input(true);
|
|
4555
|
+
/**
|
|
4556
|
+
* {@link WritableSignal} для отслеживания текущего индекса изображения.
|
|
4557
|
+
*/
|
|
4558
|
+
this.currentIndex = signal(0);
|
|
4559
|
+
/**
|
|
4560
|
+
* {@link WritableSignal} для отслеживания текущего индекса изображения.
|
|
4561
|
+
*/
|
|
4562
|
+
this.currentImage = computed(() => this.images()[this.currentIndex()]);
|
|
4563
|
+
/**
|
|
4564
|
+
* Название товара.
|
|
4565
|
+
*/
|
|
4566
|
+
this.productName = input();
|
|
4567
|
+
}
|
|
4568
|
+
/**
|
|
4569
|
+
* Обработчик события `mousemove.silent`.
|
|
4570
|
+
*
|
|
4571
|
+
* @param offsetX Отступ курсора мыши по оси X от края {@link HTMLElement}.
|
|
4572
|
+
* @param target Объект {@link HTMLElement} в котором лежат изображения
|
|
4573
|
+
*/
|
|
4574
|
+
onHover(offsetX, target) {
|
|
4575
|
+
if (this.images().length <= 1 || offsetX < 0) {
|
|
4576
|
+
return;
|
|
4577
|
+
}
|
|
4578
|
+
const elementWidth = target.offsetWidth;
|
|
4579
|
+
const hoverPercentage = Math.min(offsetX / elementWidth, 1);
|
|
4580
|
+
const newIndex = Math.min(Math.floor(hoverPercentage * this.images().length), this.images().length - 1);
|
|
4581
|
+
this.currentIndex.set(newIndex);
|
|
4582
|
+
}
|
|
4583
|
+
/**
|
|
4584
|
+
* Обработчик события `mouseleave.silent`.
|
|
4585
|
+
*/
|
|
4586
|
+
onLeave() {
|
|
4587
|
+
if (this.images().length <= 1) {
|
|
4588
|
+
return;
|
|
4589
|
+
}
|
|
4590
|
+
this.currentIndex.set(0);
|
|
4591
|
+
}
|
|
4592
|
+
/**
|
|
4593
|
+
* Обработчик события наведения указателя мыши на точку.
|
|
4594
|
+
*
|
|
4595
|
+
* @param hovered Признак что указатель мыши наведен на точку.
|
|
4596
|
+
* @param index Индекс изображения, который соответствует точке.
|
|
4597
|
+
*/
|
|
4598
|
+
onDotHovered(hovered, index) {
|
|
4599
|
+
if (hovered) {
|
|
4600
|
+
this.currentIndex.set(index);
|
|
4601
|
+
}
|
|
4602
|
+
}
|
|
4603
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScHoverImageCarouselComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4604
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: ScHoverImageCarouselComponent, isStandalone: true, selector: "sc-hover-image-carousel", inputs: { images: { classPropertyName: "images", publicName: "images", isSignal: true, isRequired: true, transformFunction: null }, isShowActions: { classPropertyName: "isShowActions", publicName: "isShowActions", isSignal: true, isRequired: false, transformFunction: null }, productName: { classPropertyName: "productName", publicName: "productName", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousemove.silent": "onHover($event.offsetX, $event.target)", "mouseleave.silent": "onLeave()" } }, ngImport: i0, template: "<div\n class=\"overflow-hidden rounded-xl\"\n [class.mb-2]=\"images().length <= 1 && isShowActions()\"\n [style.aspect-ratio]=\"'20/19'\"\n>\n @let image = currentImage();\n <picture>\n @if (image.imageWebp) {\n <source\n type=\"image/webp\"\n [srcset]=\"image.imageWebp\"\n />\n }\n\n @if (image.image) {\n <img\n [src]=\"image.image\"\n [alt]=\"image.alt\"\n class=\"size-full rounded-xl object-contain\"\n />\n }\n </picture>\n</div>\n@if (images().length > 1 && isShowActions()) {\n <div\n (mousemove.silent)=\"$event.stopPropagation()\"\n class=\"flex justify-center\"\n >\n <button\n *tuiRepeatTimes=\"let indexItem of images().length\"\n #element\n tuiButton\n type=\"button\"\n class=\"button button_small\"\n [appearance]=\"indexItem === currentIndex() ? 'primary' : 'secondary'\"\n (tuiHoveredChange)=\"onDotHovered($event, indexItem)\"\n ></button>\n </div>\n}\n", styles: [".button{flex-shrink:0}.button:first-child{margin-inline-start:0}.button:last-child{margin-inline-end:0}.button_small{inline-size:.5rem;block-size:.5rem;font-size:0;padding:0;margin:0}.button_small:not(:first-child){margin-left:.5rem}\n"], dependencies: [{ kind: "directive", type: TuiRepeatTimes, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiHovered, selector: "[tuiHoveredChange]", outputs: ["tuiHoveredChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4605
|
+
}
|
|
4606
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScHoverImageCarouselComponent, decorators: [{
|
|
4607
|
+
type: Component,
|
|
4608
|
+
args: [{ standalone: true, selector: 'sc-hover-image-carousel', imports: [TuiRepeatTimes, TuiButton, TuiHovered], host: {
|
|
4609
|
+
'(mousemove.silent)': 'onHover($event.offsetX, $event.target)',
|
|
4610
|
+
'(mouseleave.silent)': 'onLeave()',
|
|
4611
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"overflow-hidden rounded-xl\"\n [class.mb-2]=\"images().length <= 1 && isShowActions()\"\n [style.aspect-ratio]=\"'20/19'\"\n>\n @let image = currentImage();\n <picture>\n @if (image.imageWebp) {\n <source\n type=\"image/webp\"\n [srcset]=\"image.imageWebp\"\n />\n }\n\n @if (image.image) {\n <img\n [src]=\"image.image\"\n [alt]=\"image.alt\"\n class=\"size-full rounded-xl object-contain\"\n />\n }\n </picture>\n</div>\n@if (images().length > 1 && isShowActions()) {\n <div\n (mousemove.silent)=\"$event.stopPropagation()\"\n class=\"flex justify-center\"\n >\n <button\n *tuiRepeatTimes=\"let indexItem of images().length\"\n #element\n tuiButton\n type=\"button\"\n class=\"button button_small\"\n [appearance]=\"indexItem === currentIndex() ? 'primary' : 'secondary'\"\n (tuiHoveredChange)=\"onDotHovered($event, indexItem)\"\n ></button>\n </div>\n}\n", styles: [".button{flex-shrink:0}.button:first-child{margin-inline-start:0}.button:last-child{margin-inline-end:0}.button_small{inline-size:.5rem;block-size:.5rem;font-size:0;padding:0;margin:0}.button_small:not(:first-child){margin-left:.5rem}\n"] }]
|
|
4612
|
+
}] });
|
|
4613
|
+
|
|
4614
|
+
/* eslint-disable @typescript-eslint/dot-notation */
|
|
4615
|
+
/**
|
|
4616
|
+
* Компонент поля ввода количества.
|
|
4617
|
+
*/
|
|
4618
|
+
class ScInputQuantityComponent extends AbstractTuiNullableControl {
|
|
4619
|
+
constructor() {
|
|
4620
|
+
super(...arguments);
|
|
4621
|
+
/**
|
|
4622
|
+
* Шаг увеличения количества. Отвечает за проверку кратности ввода.
|
|
4623
|
+
*/
|
|
4624
|
+
this.step = 1;
|
|
4625
|
+
/**
|
|
4626
|
+
* Признак, что необходимо отобразить {@link TuiLoaderComponent} над компонентом.
|
|
4627
|
+
*/
|
|
4628
|
+
this.showLoader = false;
|
|
4629
|
+
/**
|
|
4630
|
+
* Признак, что необходимо отобразить кнопку очистки поля ввода.
|
|
4631
|
+
*/
|
|
4632
|
+
this.showCross = true;
|
|
4633
|
+
/**
|
|
4634
|
+
* Признак, что необходимо игнорировать валидацию кратности и минимального количества.
|
|
4635
|
+
*/
|
|
4636
|
+
this.ignoreStepValidators = false;
|
|
4637
|
+
/**
|
|
4638
|
+
* Формат внешнего вида компонента.
|
|
4639
|
+
*/
|
|
4640
|
+
this.appearance = 'primary';
|
|
4641
|
+
/**
|
|
4642
|
+
* Признак, что компонент деактивирован.
|
|
4643
|
+
*/
|
|
4644
|
+
this.isDisabled = false;
|
|
4645
|
+
/**
|
|
4646
|
+
* Размер компонента.
|
|
4647
|
+
*/
|
|
4648
|
+
this.size = 'm';
|
|
4649
|
+
/**
|
|
4650
|
+
* Событие нажатия на кнопку "Очистить".
|
|
4651
|
+
*/
|
|
4652
|
+
this.clickClearEvent = new EventEmitter();
|
|
4653
|
+
}
|
|
4654
|
+
/**
|
|
4655
|
+
* Возвращает элемент, который может быть сфокусирован.
|
|
4656
|
+
*/
|
|
4657
|
+
get nativeFocusableElement() {
|
|
4658
|
+
return this.numberInput?.nativeFocusableElement;
|
|
4659
|
+
}
|
|
4660
|
+
/** @inheritDoc */
|
|
4661
|
+
get focused() {
|
|
4662
|
+
return !!this.numberInput?.focused;
|
|
4663
|
+
}
|
|
4664
|
+
/**
|
|
4665
|
+
* Элемент формы ввода количества.
|
|
4666
|
+
*/
|
|
4667
|
+
get formControl() {
|
|
4668
|
+
return this.control;
|
|
4669
|
+
}
|
|
4670
|
+
/** @inheritDoc */
|
|
4671
|
+
ngOnInit() {
|
|
4672
|
+
if (this.control) {
|
|
4673
|
+
this.control.setValidators(stepValidator(this.ignoreStepValidators ? 1 : this.step));
|
|
4674
|
+
}
|
|
4675
|
+
}
|
|
4676
|
+
/**
|
|
4677
|
+
* Обработчик события нажатия стрелок клавиатуры.
|
|
4678
|
+
*
|
|
4679
|
+
* @param step Шаг изменения количества.
|
|
4680
|
+
*/
|
|
4681
|
+
onArrow(step) {
|
|
4682
|
+
if (!step) {
|
|
4683
|
+
return;
|
|
4684
|
+
}
|
|
4685
|
+
if (step > 0) {
|
|
4686
|
+
this.incident();
|
|
4687
|
+
}
|
|
4688
|
+
else {
|
|
4689
|
+
this.decrement();
|
|
4690
|
+
}
|
|
4691
|
+
}
|
|
4692
|
+
/**
|
|
4693
|
+
* Увеличивает значение в поле ввода на 1 шаг. Если число в поле ввода не кратно шагу, то увеличит до ближайшего кратного значения.
|
|
4839
4694
|
*
|
|
4840
|
-
* @param
|
|
4695
|
+
* @param checkUpdateOn Признак, что нужно проверить `updateOn` свойство `formControl`.
|
|
4841
4696
|
*/
|
|
4842
|
-
|
|
4843
|
-
this.
|
|
4697
|
+
incident(checkUpdateOn = false) {
|
|
4698
|
+
this.numberInput?.['onArrow'](this.step - ((this.numberInput.value ?? 0) % this.step));
|
|
4699
|
+
// eslint-disable-next-line no-underscore-dangle, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
|
|
4700
|
+
if (checkUpdateOn && this.formControl?._updateOn === 'blur') {
|
|
4701
|
+
this.control?.setValue(this.numberInput?.value);
|
|
4702
|
+
}
|
|
4844
4703
|
}
|
|
4845
4704
|
/**
|
|
4846
|
-
*
|
|
4705
|
+
* Уменьшает значение в поле ввода на 1 шаг. Если число в поле ввода не кратно шагу, то уменьшит до ближайшего кратного значения.
|
|
4847
4706
|
*
|
|
4848
|
-
* @
|
|
4707
|
+
* @param checkUpdateOn Признак, что нужно проверить `updateOn` свойство `formControl`.
|
|
4849
4708
|
*/
|
|
4850
|
-
|
|
4851
|
-
this.
|
|
4709
|
+
decrement(checkUpdateOn = false) {
|
|
4710
|
+
this.numberInput?.['onArrow'](-((this.numberInput.value ?? 0) % this.step) || -this.step);
|
|
4711
|
+
// eslint-disable-next-line no-underscore-dangle, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
|
|
4712
|
+
if (checkUpdateOn && this.formControl?._updateOn === 'blur') {
|
|
4713
|
+
this.control?.setValue(this.numberInput?.value);
|
|
4714
|
+
}
|
|
4852
4715
|
}
|
|
4853
|
-
|
|
4854
|
-
|
|
4716
|
+
/**
|
|
4717
|
+
* Очищает поля ввода.
|
|
4718
|
+
*/
|
|
4719
|
+
clear() {
|
|
4720
|
+
this.control?.patchValue(null);
|
|
4721
|
+
this.clickClearEvent.emit();
|
|
4722
|
+
}
|
|
4723
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScInputQuantityComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
4724
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ScInputQuantityComponent, isStandalone: true, selector: "sc-input-quantity", inputs: { step: "step", showLoader: "showLoader", showCross: "showCross", ignoreStepValidators: "ignoreStepValidators", appearance: "appearance", isDisabled: "isDisabled", size: "size" }, outputs: { clickClearEvent: "clickClearEvent" }, host: { listeners: { "keydown.arrowDown": "onArrow(-step)", "keydown.arrowUp": "onArrow(step)" }, properties: { "attr.data-appearance": "this.appearance", "attr.data-disabled": "this.isDisabled", "attr.data-size": "this.size" } }, viewQueries: [{ propertyName: "numberInput", first: true, predicate: TuiInputNumberComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<tui-loader\n *ngIf=\"formControl\"\n class=\"w-full\"\n [overlay]=\"true\"\n [showLoader]=\"showLoader\"\n [size]=\"size\"\n>\n <div class=\"flex items-center gap-1 text-center\">\n <div class=\"field-with-button flex grow rounded-xl\">\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"!numberInput['canDecrement']\"\n (click.prevent)=\"decrement(true)\"\n >\n <tui-icon icon=\"@tui.minus\"></tui-icon>\n </button>\n <tui-input-number\n #numberInput\n [formControl]=\"formControl\"\n [tuiHint]=\"([] | tuiFieldError | async)?.message\"\n [tuiTextfieldLabelOutside]=\"true\"\n [min]=\"ignoreStepValidators ? 1 : step\"\n [tuiTextfieldSize]=\"size\"\n [required]=\"true\"\n [style.text-align]=\"'center'\"\n [style.font-weight]=\"700\"\n (focusin)=\"$any($event.target).select()\"\n oncontextmenu=\"return false;\"\n class=\"grow\"\n >\n </tui-input-number>\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"!numberInput['canIncrement']\"\n (click.prevent)=\"incident(true)\"\n >\n <tui-icon icon=\"@tui.plus\"></tui-icon>\n </button>\n </div>\n <button\n *ngIf=\"showCross\"\n tuiIconButton\n appearance=\"secondary\"\n [size]=\"size\"\n [disabled]=\"!numberInput['canIncrement']\"\n (click.prevent)=\"clear()\"\n >\n <tui-icon icon=\"@tui.x\"></tui-icon>\n </button>\n </div>\n</tui-loader>\n", styles: [":host [data-size=l]{--tui-height-l: var(--tui-height-m);--tui-font-text-m: bold .875rem/1.25rem var(--tui-font-text);--tui-padding-l: 0}:host [data-size=m]{--tui-height-m: var(--tui-height-s);--tui-font-text-s: bold .75rem/1rem var(--tui-font-text);--tui-padding-m: 0}:host [data-size=m] tui-svg{font-size:12px!important}:host [data-size=s]{--tui-height-s: var(--tui-height-xs);--tui-font-text-s: bold .75rem/1rem var(--tui-font-text);--tui-padding-s: 0}:host [data-size=s] tui-svg{font-size:12px!important}:host[data-disabled=true]{pointer-events:none;opacity:var(--tui-disabled-opacity)}:host[data-appearance=secondary] .field-with-button{background-color:var(--tui-background-base);box-shadow:inset 0 0 0 .0625rem var(--tui-background-neutral-1-hover)}:host[data-appearance=primary] .field-with-button{background-color:var(--tui-status-warning-pale)}:host .field-with-button:has(._invalid){background-color:var(--tui-status-negative-pale)}\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: TuiInputNumberModule }, { kind: "component", type: i3.TuiInputNumberComponent, selector: "tui-input-number", inputs: ["min", "max", "step"] }, { kind: "directive", type: i3.TuiInputNumberDirective, selector: "tui-input-number" }, { kind: "ngmodule", type: TuiTextfieldControllerModule }, { kind: "directive", type: i3.TuiTextfieldLabelOutsideDirective, selector: "[tuiTextfieldLabelOutside]", inputs: ["tuiTextfieldLabelOutside"] }, { kind: "directive", type: i3.TuiTextfieldSizeDirective, selector: "[tuiTextfieldSize]", inputs: ["tuiTextfieldSize"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"] }, { kind: "pipe", type: TuiFieldErrorPipe, name: "tuiFieldError" }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "showLoader"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4855
4725
|
}
|
|
4856
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type:
|
|
4726
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScInputQuantityComponent, decorators: [{
|
|
4857
4727
|
type: Component,
|
|
4858
|
-
args: [{
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4728
|
+
args: [{ standalone: true, selector: 'sc-input-quantity', imports: [
|
|
4729
|
+
CommonModule,
|
|
4730
|
+
RouterModule,
|
|
4731
|
+
TuiButton,
|
|
4732
|
+
TuiIcon,
|
|
4733
|
+
TuiIslandDirective,
|
|
4734
|
+
TuiInputNumberModule,
|
|
4735
|
+
TuiTextfieldControllerModule,
|
|
4736
|
+
FormsModule,
|
|
4737
|
+
ReactiveFormsModule,
|
|
4738
|
+
...TuiHint,
|
|
4739
|
+
TuiFieldErrorPipe,
|
|
4740
|
+
TuiLoader,
|
|
4741
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<tui-loader\n *ngIf=\"formControl\"\n class=\"w-full\"\n [overlay]=\"true\"\n [showLoader]=\"showLoader\"\n [size]=\"size\"\n>\n <div class=\"flex items-center gap-1 text-center\">\n <div class=\"field-with-button flex grow rounded-xl\">\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"!numberInput['canDecrement']\"\n (click.prevent)=\"decrement(true)\"\n >\n <tui-icon icon=\"@tui.minus\"></tui-icon>\n </button>\n <tui-input-number\n #numberInput\n [formControl]=\"formControl\"\n [tuiHint]=\"([] | tuiFieldError | async)?.message\"\n [tuiTextfieldLabelOutside]=\"true\"\n [min]=\"ignoreStepValidators ? 1 : step\"\n [tuiTextfieldSize]=\"size\"\n [required]=\"true\"\n [style.text-align]=\"'center'\"\n [style.font-weight]=\"700\"\n (focusin)=\"$any($event.target).select()\"\n oncontextmenu=\"return false;\"\n class=\"grow\"\n >\n </tui-input-number>\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"!numberInput['canIncrement']\"\n (click.prevent)=\"incident(true)\"\n >\n <tui-icon icon=\"@tui.plus\"></tui-icon>\n </button>\n </div>\n <button\n *ngIf=\"showCross\"\n tuiIconButton\n appearance=\"secondary\"\n [size]=\"size\"\n [disabled]=\"!numberInput['canIncrement']\"\n (click.prevent)=\"clear()\"\n >\n <tui-icon icon=\"@tui.x\"></tui-icon>\n </button>\n </div>\n</tui-loader>\n", styles: [":host [data-size=l]{--tui-height-l: var(--tui-height-m);--tui-font-text-m: bold .875rem/1.25rem var(--tui-font-text);--tui-padding-l: 0}:host [data-size=m]{--tui-height-m: var(--tui-height-s);--tui-font-text-s: bold .75rem/1rem var(--tui-font-text);--tui-padding-m: 0}:host [data-size=m] tui-svg{font-size:12px!important}:host [data-size=s]{--tui-height-s: var(--tui-height-xs);--tui-font-text-s: bold .75rem/1rem var(--tui-font-text);--tui-padding-s: 0}:host [data-size=s] tui-svg{font-size:12px!important}:host[data-disabled=true]{pointer-events:none;opacity:var(--tui-disabled-opacity)}:host[data-appearance=secondary] .field-with-button{background-color:var(--tui-background-base);box-shadow:inset 0 0 0 .0625rem var(--tui-background-neutral-1-hover)}:host[data-appearance=primary] .field-with-button{background-color:var(--tui-status-warning-pale)}:host .field-with-button:has(._invalid){background-color:var(--tui-status-negative-pale)}\n"] }]
|
|
4742
|
+
}], propDecorators: { numberInput: [{
|
|
4743
|
+
type: ViewChild,
|
|
4744
|
+
args: [TuiInputNumberComponent]
|
|
4745
|
+
}], step: [{
|
|
4746
|
+
type: Input
|
|
4747
|
+
}], showLoader: [{
|
|
4748
|
+
type: Input
|
|
4749
|
+
}], showCross: [{
|
|
4750
|
+
type: Input
|
|
4751
|
+
}], ignoreStepValidators: [{
|
|
4866
4752
|
type: Input
|
|
4753
|
+
}], appearance: [{
|
|
4754
|
+
type: Input
|
|
4755
|
+
}, {
|
|
4756
|
+
type: HostBinding,
|
|
4757
|
+
args: ['attr.data-appearance']
|
|
4758
|
+
}], isDisabled: [{
|
|
4759
|
+
type: Input
|
|
4760
|
+
}, {
|
|
4761
|
+
type: HostBinding,
|
|
4762
|
+
args: ['attr.data-disabled']
|
|
4867
4763
|
}], size: [{
|
|
4868
4764
|
type: Input
|
|
4869
4765
|
}, {
|
|
4870
4766
|
type: HostBinding,
|
|
4871
4767
|
args: ['attr.data-size']
|
|
4872
|
-
}],
|
|
4873
|
-
type: Input
|
|
4874
|
-
}], clickOnFavoriteEvent: [{
|
|
4768
|
+
}], clickClearEvent: [{
|
|
4875
4769
|
type: Output
|
|
4876
|
-
}],
|
|
4877
|
-
type:
|
|
4770
|
+
}], onArrow: [{
|
|
4771
|
+
type: HostListener,
|
|
4772
|
+
args: ['keydown.arrowDown', ['-step']]
|
|
4773
|
+
}, {
|
|
4774
|
+
type: HostListener,
|
|
4775
|
+
args: ['keydown.arrowUp', ['step']]
|
|
4878
4776
|
}] } });
|
|
4879
4777
|
|
|
4880
4778
|
/* eslint-disable class-methods-use-this,unicorn/no-useless-undefined, @typescript-eslint/unbound-method */
|
|
@@ -5061,7 +4959,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
5061
4959
|
/**
|
|
5062
4960
|
* Компонент карточки товара.
|
|
5063
4961
|
*/
|
|
5064
|
-
class ScPriceCardComponent extends AbstractScPriceCard {
|
|
4962
|
+
class ScPriceCardComponent extends AbstractScPriceCard$1 {
|
|
5065
4963
|
constructor() {
|
|
5066
4964
|
super(...arguments);
|
|
5067
4965
|
/**
|
|
@@ -5085,11 +4983,28 @@ class ScPriceCardComponent extends AbstractScPriceCard {
|
|
|
5085
4983
|
}
|
|
5086
4984
|
}
|
|
5087
4985
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScPriceCardComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5088
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ScPriceCardComponent, 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 <div class=\"flex min-h-8 items-center justify-between\">\n
|
|
4986
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", 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 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]=\"quantityShowLoader\"\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]=\"unitsHelper.productMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"quantityShowLoader\"\n (clickClearEvent)=\"clickClearEvent.emit(cartItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-full\"\n />\n <tui-avatar\n *ngIf=\"product.cartItem && !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: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$3.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$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"] }, { 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$1, selector: "sc-hover-image-carousel", inputs: ["images", "isShowActions", "productName"] }, { kind: "component", type: CostWithDiscountComponent$1, selector: "sc-cost-with-discount", inputs: ["product", "size"] }, { kind: "component", type: ScPriceWarehouseStockComponent$1, selector: "sc-price-warehouse-stock", inputs: ["classList", "product", "withStockHint", "fromMain"] }, { kind: "component", type: ScFavoriteButtonComponent$1, selector: "sc-favorite-button", inputs: ["isFavorite", "showLoader", "disabled"], outputs: ["clickEvent"] }, { kind: "component", type: ScInputQuantityComponent$1, selector: "sc-input-quantity", inputs: ["step", "showLoader", "showCross", "ignoreStepValidators", "appearance", "isDisabled", "size"], outputs: ["clickClearEvent"] }, { kind: "component", type: ScNoindexWrapperComponent$2, selector: "sc-noindex-wrapper" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5089
4987
|
}
|
|
5090
4988
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScPriceCardComponent, decorators: [{
|
|
5091
4989
|
type: Component,
|
|
5092
|
-
args: [{ selector: 'sc-price-card', providers: [SEARCH_TERM_PROVIDERS], changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4990
|
+
args: [{ standalone: true, selector: 'sc-price-card', providers: [SEARCH_TERM_PROVIDERS], changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
4991
|
+
CommonModule,
|
|
4992
|
+
FormsModule,
|
|
4993
|
+
ReactiveFormsModule,
|
|
4994
|
+
TuiButton,
|
|
4995
|
+
TuiIcon,
|
|
4996
|
+
...TuiHint,
|
|
4997
|
+
TuiLink,
|
|
4998
|
+
TuiHighlight,
|
|
4999
|
+
TuiButtonLoading,
|
|
5000
|
+
TuiAvatar,
|
|
5001
|
+
ScHoverImageCarouselComponent$1,
|
|
5002
|
+
CostWithDiscountComponent$1,
|
|
5003
|
+
ScPriceWarehouseStockComponent$1,
|
|
5004
|
+
ScFavoriteButtonComponent$1,
|
|
5005
|
+
ScInputQuantityComponent$1,
|
|
5006
|
+
ScNoindexWrapperComponent$2,
|
|
5007
|
+
], 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 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]=\"quantityShowLoader\"\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]=\"unitsHelper.productMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"quantityShowLoader\"\n (clickClearEvent)=\"clickClearEvent.emit(cartItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-full\"\n />\n <tui-avatar\n *ngIf=\"product.cartItem && !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"] }]
|
|
5093
5008
|
}], propDecorators: { size: [{
|
|
5094
5009
|
type: Input
|
|
5095
5010
|
}, {
|
|
@@ -5100,13 +5015,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
5100
5015
|
/**
|
|
5101
5016
|
* Компонент карточки товара во всю строку.
|
|
5102
5017
|
*/
|
|
5103
|
-
class ScPriceCardInlineComponent extends AbstractScPriceCard {
|
|
5018
|
+
class ScPriceCardInlineComponent extends AbstractScPriceCard$1 {
|
|
5104
5019
|
constructor() {
|
|
5105
5020
|
super(...arguments);
|
|
5106
5021
|
this.type = input('catalogItem');
|
|
5107
5022
|
}
|
|
5108
5023
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScPriceCardInlineComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5109
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", 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 <div\n
|
|
5024
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", 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]=\"quantityShowLoader\"\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]=\"unitsHelper.productMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"quantityShowLoader\"\n (clickClearEvent)=\"clickClearEvent.emit(cartItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-full\"\n />\n <tui-avatar\n *ngIf=\"product.cartItem && !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: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"] }, { 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$1, selector: "sc-hover-image-carousel", inputs: ["images", "isShowActions", "productName"] }, { kind: "component", type: CostWithDiscountComponent$1, selector: "sc-cost-with-discount", inputs: ["product", "size"] }, { kind: "component", type: ScPriceWarehouseStockComponent$1, selector: "sc-price-warehouse-stock", inputs: ["classList", "product", "withStockHint", "fromMain"] }, { kind: "component", type: ScFavoriteButtonComponent$1, selector: "sc-favorite-button", inputs: ["isFavorite", "showLoader", "disabled"], outputs: ["clickEvent"] }, { kind: "component", type: ScInputQuantityComponent$1, selector: "sc-input-quantity", inputs: ["step", "showLoader", "showCross", "ignoreStepValidators", "appearance", "isDisabled", "size"], outputs: ["clickClearEvent"] }, { kind: "component", type: ScNoindexWrapperComponent$1, selector: "sc-noindex-wrapper" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5110
5025
|
}
|
|
5111
5026
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScPriceCardInlineComponent, decorators: [{
|
|
5112
5027
|
type: Component,
|
|
@@ -5124,13 +5039,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
5124
5039
|
TuiAutoFocus,
|
|
5125
5040
|
TuiButtonLoading,
|
|
5126
5041
|
TuiAvatar,
|
|
5127
|
-
ScHoverImageCarouselComponent,
|
|
5128
|
-
CostWithDiscountComponent,
|
|
5129
|
-
ScPriceWarehouseStockComponent,
|
|
5130
|
-
ScFavoriteButtonComponent,
|
|
5131
|
-
ScInputQuantityComponent,
|
|
5132
|
-
|
|
5133
|
-
], 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 <div\n
|
|
5042
|
+
ScHoverImageCarouselComponent$1,
|
|
5043
|
+
CostWithDiscountComponent$1,
|
|
5044
|
+
ScPriceWarehouseStockComponent$1,
|
|
5045
|
+
ScFavoriteButtonComponent$1,
|
|
5046
|
+
ScInputQuantityComponent$1,
|
|
5047
|
+
ScNoindexWrapperComponent$1,
|
|
5048
|
+
], 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]=\"quantityShowLoader\"\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]=\"unitsHelper.productMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"quantityShowLoader\"\n (clickClearEvent)=\"clickClearEvent.emit(cartItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-full\"\n />\n <tui-avatar\n *ngIf=\"product.cartItem && !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"] }]
|
|
5134
5049
|
}] });
|
|
5135
5050
|
|
|
5136
5051
|
/**
|
|
@@ -5316,12 +5231,91 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
5316
5231
|
args: [SC_PRODUCT_PAGINATION_OPTIONS]
|
|
5317
5232
|
}] }] });
|
|
5318
5233
|
|
|
5234
|
+
/**
|
|
5235
|
+
* Компонент данных о наличии товара на складе.
|
|
5236
|
+
*/
|
|
5237
|
+
class ScPriceWarehouseStockComponent {
|
|
5238
|
+
/**
|
|
5239
|
+
* Инициализирует экземпляр класса {@link ScPriceWarehouseStockComponent}.
|
|
5240
|
+
*
|
|
5241
|
+
* @param warehouseService Сервис для работы со складами.
|
|
5242
|
+
*/
|
|
5243
|
+
constructor(warehouseService) {
|
|
5244
|
+
this.warehouseService = warehouseService;
|
|
5245
|
+
/**
|
|
5246
|
+
* Признак, что необходимо отобразить подсказку по складам.
|
|
5247
|
+
*/
|
|
5248
|
+
this.withStockHint = true;
|
|
5249
|
+
/**
|
|
5250
|
+
* Признак, что необходимо отобразить список остатков по складам при выбранном основном складе.
|
|
5251
|
+
*/
|
|
5252
|
+
this.fromMain = true;
|
|
5253
|
+
}
|
|
5254
|
+
/** @inheritDoc */
|
|
5255
|
+
ngOnInit() {
|
|
5256
|
+
this.selectedWarehouse$ = this.fromMain ? this.warehouseService.getCatalogWarehouseChange$() : this.warehouseService.getWarehouseSelectChange$();
|
|
5257
|
+
this.warehousesList$ = this.selectedWarehouse$.pipe(switchMap((warehouse) => this.warehouseService.getWarehouses$().pipe(map((warehouses) => {
|
|
5258
|
+
const items = warehouses.map((w) => {
|
|
5259
|
+
const stockCount = this.product.stockCount?.find((sc) => sc.warehouseId === w.id);
|
|
5260
|
+
return {
|
|
5261
|
+
w: w,
|
|
5262
|
+
sc: stockCount ?? { warehouseId: w.id, count: 0 },
|
|
5263
|
+
};
|
|
5264
|
+
});
|
|
5265
|
+
return items.sort((item) => (item.w.id === warehouse?.id ? -1 : 1));
|
|
5266
|
+
}))));
|
|
5267
|
+
}
|
|
5268
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScPriceWarehouseStockComponent, deps: [{ token: i1.ScWarehouseService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5269
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ScPriceWarehouseStockComponent, isStandalone: true, selector: "sc-price-warehouse-stock", inputs: { classList: "classList", product: "product", withStockHint: "withStockHint", fromMain: "fromMain" }, ngImport: i0, template: "<ng-container *ngIf=\"product\">\n @let isDisabled = product.isHidden || product.isNull;\n\n <ng-container *ngIf=\"selectedWarehouse$ | async as warehouseSelect\">\n <span *tuiLet=\"withStockHint && !!(warehousesList$ | async)?.length as showStockHint\">\n <ng-container *ngIf=\"!product.stockCount?.length && product.getNotStockMessage(warehouseSelect) as message\">\n <a\n *tuiLet=\"!!(product.properties?.planingIncomingDate || product.properties?.planingProductionDate) as showPlaningHint\"\n tuiLink\n [pseudo]=\"showPlaningHint\"\n [tuiHint]=\"showPlaningHint && planingHint\"\n [class.disabled]=\"isDisabled\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [style.color]=\"'var(--tui-status-negative)'\"\n [style.cursor]=\"showPlaningHint && planingHint ? 'pointer' : 'default'\"\n [ngClass]=\"classList\"\n >\n {{ message }}\n </a>\n </ng-container>\n <ng-template #planingHint>\n <span *ngIf=\"product.properties?.planingIncomingDate\">\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u043F\u043E\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u044F <br />\n \u043D\u0430 \u041E\u0441\u043D\u043E\u0432\u043D\u043E\u0439 \u0441\u043A\u043B\u0430\u0434:\n <span class=\"font-bold\">{{ product.properties?.planingIncomingDate }}</span>\n </span>\n <span *ngIf=\"product.properties?.planingProductionDate\">\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u0430:\n <span class=\"font-bold\">{{ product.properties?.planingProductionDate }}</span>\n </span>\n </ng-template>\n <span *ngIf=\"product.stockCount && product.stockCount.length && !product.onOrder\">\n <span\n tuiLink\n [style.color]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"showStockHint && stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [ngClass]=\"classList\"\n [class.disabled]=\"isDisabled\"\n class=\"!underline\"\n >\n \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u043D\u0430\u043B\u0438\u0447\u0438\u0435\n </span>\n </span>\n\n <span\n *ngIf=\"product.onOrder\"\n [style.color]=\"'var(--tui-status-warning)'\"\n [ngClass]=\"classList\"\n >\n \u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437\n </span>\n </span>\n </ng-container>\n\n <ng-template #stockHint>\n <table\n *ngIf=\"selectedWarehouse$ | async as warehouseSelect\"\n class=\"stock-table table-auto text-body-s\"\n [ngClass]=\"classList\"\n >\n <tbody>\n <tr\n *ngFor=\"let item of warehousesList$ | async\"\n class=\"border-b\"\n >\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count !== undefined && item.sc.count !== null ? item.sc.count + ' ' + product.quantityUnit : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n </tbody>\n </table>\n </ng-template>\n</ng-container>\n", styles: ["::ng-deep tui-hint:has(.stock-table){max-inline-size:22rem}[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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: "ngmodule", type: TuiTextfieldControllerModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo"] }, { kind: "directive", type: TuiLet, selector: "[tuiLet]", inputs: ["tuiLet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5270
|
+
}
|
|
5271
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScPriceWarehouseStockComponent, decorators: [{
|
|
5272
|
+
type: Component,
|
|
5273
|
+
args: [{ standalone: true, selector: 'sc-price-warehouse-stock', imports: [CommonModule, RouterModule, TuiTextfieldControllerModule, FormsModule, ReactiveFormsModule, ...TuiHint, TuiLink, TuiLet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"product\">\n @let isDisabled = product.isHidden || product.isNull;\n\n <ng-container *ngIf=\"selectedWarehouse$ | async as warehouseSelect\">\n <span *tuiLet=\"withStockHint && !!(warehousesList$ | async)?.length as showStockHint\">\n <ng-container *ngIf=\"!product.stockCount?.length && product.getNotStockMessage(warehouseSelect) as message\">\n <a\n *tuiLet=\"!!(product.properties?.planingIncomingDate || product.properties?.planingProductionDate) as showPlaningHint\"\n tuiLink\n [pseudo]=\"showPlaningHint\"\n [tuiHint]=\"showPlaningHint && planingHint\"\n [class.disabled]=\"isDisabled\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [style.color]=\"'var(--tui-status-negative)'\"\n [style.cursor]=\"showPlaningHint && planingHint ? 'pointer' : 'default'\"\n [ngClass]=\"classList\"\n >\n {{ message }}\n </a>\n </ng-container>\n <ng-template #planingHint>\n <span *ngIf=\"product.properties?.planingIncomingDate\">\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u043F\u043E\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u044F <br />\n \u043D\u0430 \u041E\u0441\u043D\u043E\u0432\u043D\u043E\u0439 \u0441\u043A\u043B\u0430\u0434:\n <span class=\"font-bold\">{{ product.properties?.planingIncomingDate }}</span>\n </span>\n <span *ngIf=\"product.properties?.planingProductionDate\">\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u0430:\n <span class=\"font-bold\">{{ product.properties?.planingProductionDate }}</span>\n </span>\n </ng-template>\n <span *ngIf=\"product.stockCount && product.stockCount.length && !product.onOrder\">\n <span\n tuiLink\n [style.color]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"showStockHint && stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [ngClass]=\"classList\"\n [class.disabled]=\"isDisabled\"\n class=\"!underline\"\n >\n \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u043D\u0430\u043B\u0438\u0447\u0438\u0435\n </span>\n </span>\n\n <span\n *ngIf=\"product.onOrder\"\n [style.color]=\"'var(--tui-status-warning)'\"\n [ngClass]=\"classList\"\n >\n \u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437\n </span>\n </span>\n </ng-container>\n\n <ng-template #stockHint>\n <table\n *ngIf=\"selectedWarehouse$ | async as warehouseSelect\"\n class=\"stock-table table-auto text-body-s\"\n [ngClass]=\"classList\"\n >\n <tbody>\n <tr\n *ngFor=\"let item of warehousesList$ | async\"\n class=\"border-b\"\n >\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count !== undefined && item.sc.count !== null ? item.sc.count + ' ' + product.quantityUnit : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n </tbody>\n </table>\n </ng-template>\n</ng-container>\n", styles: ["::ng-deep tui-hint:has(.stock-table){max-inline-size:22rem}[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"] }]
|
|
5274
|
+
}], ctorParameters: () => [{ type: i1.ScWarehouseService }], propDecorators: { classList: [{
|
|
5275
|
+
type: Input
|
|
5276
|
+
}], product: [{
|
|
5277
|
+
type: Input
|
|
5278
|
+
}], withStockHint: [{
|
|
5279
|
+
type: Input
|
|
5280
|
+
}], fromMain: [{
|
|
5281
|
+
type: Input
|
|
5282
|
+
}] } });
|
|
5283
|
+
|
|
5284
|
+
/**
|
|
5285
|
+
* Компонент центы товара с отображением скидки.
|
|
5286
|
+
*/
|
|
5287
|
+
class CostWithDiscountComponent {
|
|
5288
|
+
constructor() {
|
|
5289
|
+
/**
|
|
5290
|
+
* {@link Observable} изменения выбранного склада.
|
|
5291
|
+
*/
|
|
5292
|
+
this.warehouseSelect$ = inject(ScWarehouseService).getWarehouseSelectChange$();
|
|
5293
|
+
/**
|
|
5294
|
+
* Размер компонента.
|
|
5295
|
+
*/
|
|
5296
|
+
this.size = 'm';
|
|
5297
|
+
}
|
|
5298
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CostWithDiscountComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5299
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: CostWithDiscountComponent, isStandalone: true, selector: "sc-cost-with-discount", inputs: { product: "product", size: "size" }, host: { properties: { "attr.data-size": "this.size" } }, ngImport: i0, template: "@if (product) {\n <div\n *ngIf=\"warehouseSelect$ | async as warehouseSelect\"\n class=\"flex flex-wrap items-center gap-x-2 gap-y-1\"\n >\n <div class=\"flex flex-wrap items-center gap-x-2 gap-y-1\">\n <span\n [class.text-tui-text-02]=\"!product.isWarehouseStockExist(warehouseSelect.id)\"\n class=\"cost\"\n >\n {{ product.costRubString }}\n </span>\n\n <sc-noindex-wrapper>\n <tui-badge\n *ngIf=\"product.discount as discount\"\n size=\"m\"\n [style.background]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"discountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xs\"\n >\n <tui-badge\n *ngIf=\"product.discount as discount\"\n size=\"s\"\n [style.background]=\"'var(--tui-background-base)'\"\n class=\"text-body-xs-bold text-tui-text-02\"\n >\n {{ discount.percent }}%\n </tui-badge>\n\n @let expiredAt = product.discount.expiredAt | scFormatDate;\n\n <div class=\"flex gap-0.5\">\n <p class=\"flex line-through\">{{ product.discountCostString }}</p>\n <div *ngIf=\"expiredAt\">\u0434\u043E {{ expiredAt.substring(0, 5) }}</div>\n </div>\n <ng-template #discountHint>\n <div class=\"font-bold\">{{ product.discount.name }}</div>\n <div *ngIf=\"expiredAt\">\u0414\u0430\u0442\u0430 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F: {{ expiredAt }}</div>\n </ng-template>\n </tui-badge>\n </sc-noindex-wrapper>\n </div>\n\n <span\n *ngIf=\"!product.priceInRub\"\n class=\"font-extrabold text-tui-text-02\"\n >\n {{ product.costString }}\n </span>\n </div>\n}\n", styles: [":host tui-badge{--t-padding: .25rem !important}:host[data-size=s]{font-size:.6875rem;line-height:1rem;font-weight:500}:host[data-size=s] .cost{font-size:.8125rem;line-height:1.25rem;font-weight:800}:host[data-size=m],:host[data-size=l]{font-size:.8125rem;line-height:1.25rem;font-weight:500}:host[data-size=m] .cost,:host[data-size=l] .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: "directive", type: TuiBadge, selector: "tui-badge,[tuiBadge]", inputs: ["size"] }, { kind: "directive", type: i1$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"] }, { kind: "pipe", type: ScFormatDatePipe$1, name: "scFormatDate" }, { kind: "component", type: ScNoindexWrapperComponent$2, selector: "sc-noindex-wrapper" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5300
|
+
}
|
|
5301
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CostWithDiscountComponent, decorators: [{
|
|
5302
|
+
type: Component,
|
|
5303
|
+
args: [{ standalone: true, selector: 'sc-cost-with-discount', imports: [CommonModule, TuiBadge, ...TuiHint, ScFormatDatePipe$1, ScNoindexWrapperComponent$2], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (product) {\n <div\n *ngIf=\"warehouseSelect$ | async as warehouseSelect\"\n class=\"flex flex-wrap items-center gap-x-2 gap-y-1\"\n >\n <div class=\"flex flex-wrap items-center gap-x-2 gap-y-1\">\n <span\n [class.text-tui-text-02]=\"!product.isWarehouseStockExist(warehouseSelect.id)\"\n class=\"cost\"\n >\n {{ product.costRubString }}\n </span>\n\n <sc-noindex-wrapper>\n <tui-badge\n *ngIf=\"product.discount as discount\"\n size=\"m\"\n [style.background]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"discountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xs\"\n >\n <tui-badge\n *ngIf=\"product.discount as discount\"\n size=\"s\"\n [style.background]=\"'var(--tui-background-base)'\"\n class=\"text-body-xs-bold text-tui-text-02\"\n >\n {{ discount.percent }}%\n </tui-badge>\n\n @let expiredAt = product.discount.expiredAt | scFormatDate;\n\n <div class=\"flex gap-0.5\">\n <p class=\"flex line-through\">{{ product.discountCostString }}</p>\n <div *ngIf=\"expiredAt\">\u0434\u043E {{ expiredAt.substring(0, 5) }}</div>\n </div>\n <ng-template #discountHint>\n <div class=\"font-bold\">{{ product.discount.name }}</div>\n <div *ngIf=\"expiredAt\">\u0414\u0430\u0442\u0430 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F: {{ expiredAt }}</div>\n </ng-template>\n </tui-badge>\n </sc-noindex-wrapper>\n </div>\n\n <span\n *ngIf=\"!product.priceInRub\"\n class=\"font-extrabold text-tui-text-02\"\n >\n {{ product.costString }}\n </span>\n </div>\n}\n", styles: [":host tui-badge{--t-padding: .25rem !important}:host[data-size=s]{font-size:.6875rem;line-height:1rem;font-weight:500}:host[data-size=s] .cost{font-size:.8125rem;line-height:1.25rem;font-weight:800}:host[data-size=m],:host[data-size=l]{font-size:.8125rem;line-height:1.25rem;font-weight:500}:host[data-size=m] .cost,:host[data-size=l] .cost{font-size:.9375rem;line-height:1.5rem;font-weight:800}\n"] }]
|
|
5304
|
+
}], propDecorators: { product: [{
|
|
5305
|
+
type: Input
|
|
5306
|
+
}], size: [{
|
|
5307
|
+
type: Input
|
|
5308
|
+
}, {
|
|
5309
|
+
type: HostBinding,
|
|
5310
|
+
args: ['attr.data-size']
|
|
5311
|
+
}] } });
|
|
5312
|
+
|
|
5319
5313
|
/**
|
|
5320
5314
|
* Модуль каталога.
|
|
5321
5315
|
*/
|
|
5322
5316
|
class ScCatalogModule {
|
|
5323
5317
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScCatalogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
5324
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ScCatalogModule, declarations: [ScPriceListPaginationComponent, ScCategoryCardComponent,
|
|
5318
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ScCatalogModule, declarations: [ScPriceListPaginationComponent, ScCategoryCardComponent, ScPriceHistoryComponent], imports: [CommonModule,
|
|
5325
5319
|
RouterModule,
|
|
5326
5320
|
TuiButton,
|
|
5327
5321
|
TuiIcon,
|
|
@@ -5348,11 +5342,12 @@ class ScCatalogModule {
|
|
|
5348
5342
|
TuiLineClamp,
|
|
5349
5343
|
TuiHovered,
|
|
5350
5344
|
CostWithDiscountComponent,
|
|
5345
|
+
ScPriceCardComponent,
|
|
5351
5346
|
ScPriceCardInlineComponent,
|
|
5352
5347
|
ScPriceWarehouseStockComponent,
|
|
5353
5348
|
ScFavoriteButtonComponent,
|
|
5354
5349
|
ScInputQuantityComponent,
|
|
5355
|
-
ScFormatDatePipe,
|
|
5350
|
+
ScFormatDatePipe$1,
|
|
5356
5351
|
ScMediaImageTransformerPipe], exports: [ScPriceListPaginationComponent, ScCategoryCardComponent, ScPriceCardComponent, ScPriceHistoryComponent] }); }
|
|
5357
5352
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScCatalogModule, imports: [CommonModule,
|
|
5358
5353
|
RouterModule,
|
|
@@ -5368,6 +5363,7 @@ class ScCatalogModule {
|
|
|
5368
5363
|
TuiAvatar,
|
|
5369
5364
|
TuiLineClamp,
|
|
5370
5365
|
CostWithDiscountComponent,
|
|
5366
|
+
ScPriceCardComponent,
|
|
5371
5367
|
ScPriceCardInlineComponent,
|
|
5372
5368
|
ScPriceWarehouseStockComponent,
|
|
5373
5369
|
ScFavoriteButtonComponent,
|
|
@@ -5376,7 +5372,7 @@ class ScCatalogModule {
|
|
|
5376
5372
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScCatalogModule, decorators: [{
|
|
5377
5373
|
type: NgModule,
|
|
5378
5374
|
args: [{
|
|
5379
|
-
declarations: [ScPriceListPaginationComponent, ScCategoryCardComponent,
|
|
5375
|
+
declarations: [ScPriceListPaginationComponent, ScCategoryCardComponent, ScPriceHistoryComponent],
|
|
5380
5376
|
exports: [ScPriceListPaginationComponent, ScCategoryCardComponent, ScPriceCardComponent, ScPriceHistoryComponent],
|
|
5381
5377
|
imports: [
|
|
5382
5378
|
CommonModule,
|
|
@@ -5408,11 +5404,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
5408
5404
|
TuiLineClamp,
|
|
5409
5405
|
TuiHovered,
|
|
5410
5406
|
CostWithDiscountComponent,
|
|
5407
|
+
ScPriceCardComponent,
|
|
5411
5408
|
ScPriceCardInlineComponent,
|
|
5412
5409
|
ScPriceWarehouseStockComponent,
|
|
5413
5410
|
ScFavoriteButtonComponent,
|
|
5414
5411
|
ScInputQuantityComponent,
|
|
5415
|
-
ScFormatDatePipe,
|
|
5412
|
+
ScFormatDatePipe$1,
|
|
5416
5413
|
ScMediaImageTransformerPipe,
|
|
5417
5414
|
],
|
|
5418
5415
|
}]
|
|
@@ -6271,6 +6268,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
6271
6268
|
args: ['scTopNodeDate']
|
|
6272
6269
|
}] } });
|
|
6273
6270
|
|
|
6271
|
+
/**
|
|
6272
|
+
* Пайп для форматирования даты и времени.
|
|
6273
|
+
*/
|
|
6274
|
+
class ScFormatDatePipe {
|
|
6275
|
+
constructor() {
|
|
6276
|
+
/**
|
|
6277
|
+
* Функция форматирования даты и времени.
|
|
6278
|
+
*/
|
|
6279
|
+
this.formatter = inject(SC_DATE_FORMATTER);
|
|
6280
|
+
}
|
|
6281
|
+
/**
|
|
6282
|
+
* Форматирует строку даты через {@link SC_DATE_FORMATTER}.
|
|
6283
|
+
*
|
|
6284
|
+
* @param timeString - Строка времени.
|
|
6285
|
+
* @returns Форматированная дата и время.
|
|
6286
|
+
*/
|
|
6287
|
+
transform(timeString) {
|
|
6288
|
+
return timeString && this.formatter(timeString);
|
|
6289
|
+
}
|
|
6290
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScFormatDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
6291
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ScFormatDatePipe, isStandalone: true, name: "scFormatDate" }); }
|
|
6292
|
+
}
|
|
6293
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScFormatDatePipe, decorators: [{
|
|
6294
|
+
type: Pipe,
|
|
6295
|
+
args: [{
|
|
6296
|
+
standalone: true,
|
|
6297
|
+
name: 'scFormatDate',
|
|
6298
|
+
}]
|
|
6299
|
+
}] });
|
|
6300
|
+
|
|
6274
6301
|
/**
|
|
6275
6302
|
* Компонент файлов и документов.
|
|
6276
6303
|
*/
|
|
@@ -6593,6 +6620,74 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
6593
6620
|
}]
|
|
6594
6621
|
}] });
|
|
6595
6622
|
|
|
6623
|
+
/**
|
|
6624
|
+
* Директива для замены элемента на HTML-комментарий `<!-- noindex -->` или `<!-- /noindex -->` в runtime.
|
|
6625
|
+
* Применяется к элементам с атрибутом `data-noindex="true"` или `data-noindex="false"`.
|
|
6626
|
+
* Выполняется только в браузере, не выполняется на сервере (SSR).
|
|
6627
|
+
* Используется для SEO оптимизации (преимущественно в Yandex).
|
|
6628
|
+
*/
|
|
6629
|
+
class ScNoindexDirective {
|
|
6630
|
+
constructor() {
|
|
6631
|
+
/**
|
|
6632
|
+
* Ссылка на HTML элемент.
|
|
6633
|
+
*/
|
|
6634
|
+
this.elementRef = inject(ElementRef);
|
|
6635
|
+
/**
|
|
6636
|
+
* Renderer для безопасной работы с DOM.
|
|
6637
|
+
*/
|
|
6638
|
+
this.renderer = inject(Renderer2);
|
|
6639
|
+
/**
|
|
6640
|
+
* Признак, что приложение запущено на сервере.
|
|
6641
|
+
*/
|
|
6642
|
+
this.isServer = inject(IS_SERVER);
|
|
6643
|
+
}
|
|
6644
|
+
/**
|
|
6645
|
+
* Инициализация директивы - замена элемента на комментарий.
|
|
6646
|
+
* Выполняется только в браузере.
|
|
6647
|
+
*/
|
|
6648
|
+
ngOnInit() {
|
|
6649
|
+
// Пропускаем выполнение на сервере (SSR).
|
|
6650
|
+
if (this.isServer) {
|
|
6651
|
+
return;
|
|
6652
|
+
}
|
|
6653
|
+
const element = this.elementRef.nativeElement;
|
|
6654
|
+
const parent = element.parentNode;
|
|
6655
|
+
if (!parent) {
|
|
6656
|
+
return;
|
|
6657
|
+
}
|
|
6658
|
+
// Получаем значение атрибута data-noindex.
|
|
6659
|
+
const noindexValue = element.dataset['noindex'];
|
|
6660
|
+
// Определяем текст комментария в зависимости от значения атрибута и создаем комментарий.
|
|
6661
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
6662
|
+
const comment = this.renderer.createComment(noindexValue === 'false' ? '/noindex' : 'noindex');
|
|
6663
|
+
// Заменяем элемент на комментарий используя нативный DOM API для гарантированной замены.
|
|
6664
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
6665
|
+
element.replaceWith(comment);
|
|
6666
|
+
}
|
|
6667
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScNoindexDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
6668
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ScNoindexDirective, isStandalone: true, selector: "[data-noindex]", ngImport: i0 }); }
|
|
6669
|
+
}
|
|
6670
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScNoindexDirective, decorators: [{
|
|
6671
|
+
type: Directive,
|
|
6672
|
+
args: [{
|
|
6673
|
+
standalone: true,
|
|
6674
|
+
selector: '[data-noindex]',
|
|
6675
|
+
}]
|
|
6676
|
+
}] });
|
|
6677
|
+
|
|
6678
|
+
/**
|
|
6679
|
+
* Компонент-обертка для автоматического добавления тегов noindex вокруг контента.
|
|
6680
|
+
* Автоматически добавляет открывающий `<!-- noindex -->` и закрывающий `<!-- /noindex -->` комментарии.
|
|
6681
|
+
*/
|
|
6682
|
+
class ScNoindexWrapperComponent {
|
|
6683
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScNoindexWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6684
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ScNoindexWrapperComponent, isStandalone: true, selector: "sc-noindex-wrapper", ngImport: i0, template: "<div\n style=\"display: none\"\n data-noindex=\"true\"\n></div>\n<ng-content />\n<div\n style=\"display: none\"\n data-noindex=\"false\"\n></div>\n", dependencies: [{ kind: "directive", type: ScNoindexDirective$1, selector: "[data-noindex]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6685
|
+
}
|
|
6686
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScNoindexWrapperComponent, decorators: [{
|
|
6687
|
+
type: Component,
|
|
6688
|
+
args: [{ standalone: true, selector: 'sc-noindex-wrapper', imports: [ScNoindexDirective$1], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n style=\"display: none\"\n data-noindex=\"true\"\n></div>\n<ng-content />\n<div\n style=\"display: none\"\n data-noindex=\"false\"\n></div>\n" }]
|
|
6689
|
+
}] });
|
|
6690
|
+
|
|
6596
6691
|
/**
|
|
6597
6692
|
* Компонент карточки элемента заказа.
|
|
6598
6693
|
*/
|
|
@@ -8243,5 +8338,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
8243
8338
|
* Generated bundle index. Do not edit.
|
|
8244
8339
|
*/
|
|
8245
8340
|
|
|
8246
|
-
export { AbstractScPriceCard, AuthMethod, CURRENT_COUNTRY_ID, FilesAndDocumentsComponent, FilesAndDocumentsModule, FinishDateTimeTransformerDirective, IS_DEFAULT_COUNTRY, MAX_FILES_IN_FORM_INPUT, SC_ALLOW_SELECT_TERMINATED, SC_BANNER_DURATION, SC_DATE_FORMATTER, SC_ERROR_CHANGE_HANDLER, SC_HELP_NOTIFICATION_CLOSE, SC_HELP_NOTIFICATION_LIMIT, SC_MANAGER_QR_HANDLER, SC_NOTIFY_WHEN_IN_STOCK_REQUIRED_FIELDS, SC_PAGE_SIZE_OPTIONS$1 as SC_PAGE_SIZE_OPTIONS, SC_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, ScCartItemComponent, ScCatalogModule, ScCategoryCardComponent, ScContactsAccordionComponent, ScContactsModule, ScContragentsAccordionComponent, ScContragentsAccordionItemComponent, ScContragentsModule, ScDeliveryAddressAccordionComponent, ScDeliveryAddressAccordionItemComponent, ScDeliveryAddressModule, ScDownloadPriceListComponent, ScEmailLinkDirective, ScErrorBlockStatusComponent, ScErrorHandlerComponent, ScFavoriteButtonComponent, ScFeedbackFormComponent, ScFocusFirstInvalidFieldDirective, ScFormFieldsModule, ScFormatDatePipe, ScFrequentlyAskedQuestionsComponent, ScFrequentlyAskedQuestionsGroupSelectorComponent, ScFrequentlyAskedQuestionsWithGroupsComponent, ScGratitudeComponent, ScHelpNotificationService, ScHoverImageCarouselComponent, ScInputQuantityComponent, ScJsonLdCategoryComponent, ScLinks, ScManagerCardComponent, ScManagerCardPushComponent, ScNewContactFormComponent, ScNewContragentBankAccountsFormComponent, ScNewContragentFormComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNewsModule, ScNextInputFocusDirective, ScNextInputFocusModule, ScNotifyWhenInStockDialogComponent, ScOrderItemMobileComponent, ScOrderModule, ScPaymentStatusComponent, ScPersonalDataProcessingPolicyComponent, ScPhoneFormatPipe, ScPreviewSampleComponent, ScPreviewSampleModule, ScPreviewSamplesMosquitoComponent, ScPriceCardComponent, ScPriceCardInlineComponent, ScPriceHistoryComponent, ScPriceListPaginationComponent, ScPriceWarehouseStockComponent, ScPrivacyPolicyComponent, ScProductInAllWarehousesPipe, ScProfileAccordionsContentComponent, ScProfileModule, ScPublicOfferComponent, ScQRCodeDialogComponent, ScQRCodeModule, ScResetUserPasswordComponent, ScResourcePreviewComponent, ScSelectOnFocusinDirective, 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, scPasswordConfirmMatchingValidator, stepValidator, tuiDateValueTransformerDefaultProvider };
|
|
8341
|
+
export { AbstractScPriceCard, AuthMethod, CURRENT_COUNTRY_ID, FilesAndDocumentsComponent, FilesAndDocumentsModule, FinishDateTimeTransformerDirective, IS_DEFAULT_COUNTRY, MAX_FILES_IN_FORM_INPUT, SC_ALLOW_SELECT_TERMINATED, SC_BANNER_DURATION, SC_DATE_FORMATTER, SC_ERROR_CHANGE_HANDLER, SC_HELP_NOTIFICATION_CLOSE, SC_HELP_NOTIFICATION_LIMIT, SC_MANAGER_QR_HANDLER, SC_NOTIFY_WHEN_IN_STOCK_REQUIRED_FIELDS, SC_PAGE_SIZE_OPTIONS$1 as SC_PAGE_SIZE_OPTIONS, SC_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, ScCartItemComponent, ScCatalogModule, ScCategoryCardComponent, ScContactsAccordionComponent, ScContactsModule, ScContragentsAccordionComponent, ScContragentsAccordionItemComponent, ScContragentsModule, ScDeliveryAddressAccordionComponent, ScDeliveryAddressAccordionItemComponent, ScDeliveryAddressModule, ScDownloadPriceListComponent, ScEmailLinkDirective, ScErrorBlockStatusComponent, ScErrorHandlerComponent, ScFavoriteButtonComponent, ScFeedbackFormComponent, ScFocusFirstInvalidFieldDirective, ScFormFieldsModule, ScFormatDatePipe, ScFrequentlyAskedQuestionsComponent, ScFrequentlyAskedQuestionsGroupSelectorComponent, ScFrequentlyAskedQuestionsWithGroupsComponent, ScGratitudeComponent, ScHelpNotificationService, ScHoverImageCarouselComponent, ScInputQuantityComponent, ScJsonLdCategoryComponent, ScLinks, ScManagerCardComponent, ScManagerCardPushComponent, ScNewContactFormComponent, ScNewContragentBankAccountsFormComponent, ScNewContragentFormComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNewsModule, ScNextInputFocusDirective, ScNextInputFocusModule, ScNoindexDirective, ScNoindexWrapperComponent, ScNotifyWhenInStockDialogComponent, ScOrderItemMobileComponent, ScOrderModule, ScPaymentStatusComponent, ScPersonalDataProcessingPolicyComponent, ScPhoneFormatPipe, ScPreviewSampleComponent, ScPreviewSampleModule, ScPreviewSamplesMosquitoComponent, ScPriceCardComponent, ScPriceCardInlineComponent, ScPriceHistoryComponent, ScPriceListPaginationComponent, ScPriceWarehouseStockComponent, ScPrivacyPolicyComponent, ScProductInAllWarehousesPipe, ScProfileAccordionsContentComponent, ScProfileModule, ScPublicOfferComponent, ScQRCodeDialogComponent, ScQRCodeModule, ScResetUserPasswordComponent, ScResourcePreviewComponent, ScSelectOnFocusinDirective, 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, scPasswordConfirmMatchingValidator, stepValidator, tuiDateValueTransformerDefaultProvider };
|
|
8247
8342
|
//# sourceMappingURL=snabcentr-client-ui.mjs.map
|