@snabcentr/client-ui 0.0.19 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- package/catalog/price-card/sc-price-card.component.d.ts +40 -12
- package/esm2020/catalog/price-card/sc-price-card.component.mjs +48 -11
- package/esm2020/icons/sc-client-ui-icons-name.mjs +11 -1
- package/esm2020/news/news-card/sc-news-card.component.mjs +9 -3
- package/esm2020/share-button/sc-share-button.component.mjs +26 -6
- package/esm2020/share-button/sc-share-button.module.mjs +5 -4
- package/fesm2015/snabcentr-client-ui.mjs +92 -20
- package/fesm2015/snabcentr-client-ui.mjs.map +1 -1
- package/fesm2020/snabcentr-client-ui.mjs +91 -19
- package/fesm2020/snabcentr-client-ui.mjs.map +1 -1
- package/icons/sc-client-ui-icons-name.d.ts +1 -0
- package/icons/svg-pack/scIconAddProfile.svg +1 -1
- package/icons/svg-pack/scIconApplication.svg +1 -1
- package/icons/svg-pack/scIconArrowDown.svg +1 -1
- package/icons/svg-pack/scIconArrowDownLarge.svg +1 -1
- package/icons/svg-pack/scIconArrowDownLargeEnd.svg +1 -1
- package/icons/svg-pack/scIconArrowLeft.svg +1 -1
- package/icons/svg-pack/scIconArrowReturn.svg +1 -1
- package/icons/svg-pack/scIconArrowRight.svg +1 -1
- package/icons/svg-pack/scIconArrowUp.svg +1 -1
- package/icons/svg-pack/scIconAttention.svg +1 -1
- package/icons/svg-pack/scIconBag.svg +1 -1
- package/icons/svg-pack/scIconBasket.svg +1 -1
- package/icons/svg-pack/scIconBell.svg +1 -1
- package/icons/svg-pack/scIconBook.svg +1 -1
- package/icons/svg-pack/scIconBubble.svg +1 -1
- package/icons/svg-pack/scIconCalendar.svg +1 -1
- package/icons/svg-pack/scIconCancel.svg +1 -1
- package/icons/svg-pack/scIconCart.svg +1 -1
- package/icons/svg-pack/scIconCatalog.svg +1 -1
- package/icons/svg-pack/scIconClients.svg +1 -1
- package/icons/svg-pack/scIconClip.svg +1 -1
- package/icons/svg-pack/scIconClock.svg +1 -1
- package/icons/svg-pack/scIconConfigurator.svg +1 -1
- package/icons/svg-pack/scIconContacts.svg +1 -1
- package/icons/svg-pack/scIconCross.svg +1 -1
- package/icons/svg-pack/scIconDeleteProfile.svg +1 -1
- package/icons/svg-pack/scIconDone.svg +1 -1
- package/icons/svg-pack/scIconDownloading.svg +1 -1
- package/icons/svg-pack/scIconEdit.svg +1 -1
- package/icons/svg-pack/scIconError.svg +1 -1
- package/icons/svg-pack/scIconExcelFile.svg +1 -1
- package/icons/svg-pack/scIconEye.svg +1 -1
- package/icons/svg-pack/scIconFavorite.svg +1 -1
- package/icons/svg-pack/scIconFavoriteFill.svg +1 -1
- package/icons/svg-pack/scIconFile.svg +1 -1
- package/icons/svg-pack/scIconFilter.svg +1 -1
- package/icons/svg-pack/scIconFolder.svg +1 -1
- package/icons/svg-pack/scIconFolderOpen.svg +1 -1
- package/icons/svg-pack/scIconFolderPlus.svg +1 -1
- package/icons/svg-pack/scIconGraph.svg +1 -1
- package/icons/svg-pack/scIconHamburger.svg +1 -1
- package/icons/svg-pack/scIconHeart.svg +1 -1
- package/icons/svg-pack/scIconHeartFill.svg +1 -1
- package/icons/svg-pack/scIconHistory.svg +1 -1
- package/icons/svg-pack/scIconHome.svg +1 -1
- package/icons/svg-pack/scIconImage.svg +1 -1
- package/icons/svg-pack/scIconLike.svg +1 -1
- package/icons/svg-pack/scIconList.svg +1 -1
- package/icons/svg-pack/scIconLocation.svg +1 -1
- package/icons/svg-pack/scIconLock.svg +1 -1
- package/icons/svg-pack/scIconLockOpen.svg +1 -1
- package/icons/svg-pack/scIconLogIn.svg +1 -1
- package/icons/svg-pack/scIconLogOut.svg +1 -1
- package/icons/svg-pack/scIconLogOut2.svg +1 -1
- package/icons/svg-pack/scIconMail.svg +1 -1
- package/icons/svg-pack/scIconMinus.svg +1 -1
- package/icons/svg-pack/scIconMoney.svg +1 -1
- package/icons/svg-pack/scIconMoney2.svg +1 -1
- package/icons/svg-pack/scIconNews.svg +1 -1
- package/icons/svg-pack/scIconOffer.svg +1 -1
- package/icons/svg-pack/scIconPalette.svg +1 -1
- package/icons/svg-pack/scIconPdfFile.svg +1 -1
- package/icons/svg-pack/scIconPercentage.svg +1 -1
- package/icons/svg-pack/scIconPhone.svg +1 -1
- package/icons/svg-pack/scIconPlus.svg +1 -1
- package/icons/svg-pack/scIconPrice.svg +1 -1
- package/icons/svg-pack/scIconProfile.svg +1 -1
- package/icons/svg-pack/scIconQRCodeScan.svg +1 -1
- package/icons/svg-pack/scIconQuestion.svg +1 -1
- package/icons/svg-pack/scIconReclamation.svg +1 -1
- package/icons/svg-pack/scIconRefresh.svg +1 -1
- package/icons/svg-pack/scIconRepeat.svg +1 -1
- package/icons/svg-pack/scIconRequisites.svg +1 -1
- package/icons/svg-pack/scIconRocket.svg +1 -1
- package/icons/svg-pack/scIconSave.svg +1 -1
- package/icons/svg-pack/scIconSearch.svg +1 -1
- package/icons/svg-pack/scIconSend.svg +1 -1
- package/icons/svg-pack/scIconSettings.svg +1 -1
- package/icons/svg-pack/scIconShare.svg +1 -1
- package/icons/svg-pack/scIconSocialCopy.svg +13 -0
- package/icons/svg-pack/scIconSocialEmail.svg +13 -0
- package/icons/svg-pack/scIconSocialFacebook.svg +12 -0
- package/icons/svg-pack/scIconSocialInstagram.svg +33 -0
- package/icons/svg-pack/scIconSocialQR.svg +12 -0
- package/icons/svg-pack/scIconSocialTelegram.svg +20 -0
- package/icons/svg-pack/scIconSocialViber.svg +16 -0
- package/icons/svg-pack/scIconSocialVk.svg +12 -0
- package/icons/svg-pack/scIconSocialWhatsapp.svg +12 -0
- package/icons/svg-pack/scIconStar.svg +1 -1
- package/icons/svg-pack/scIconSuitcase.svg +1 -1
- package/icons/svg-pack/scIconTasks.svg +1 -1
- package/icons/svg-pack/scIconTick.svg +1 -1
- package/icons/svg-pack/scIconTop.svg +1 -1
- package/icons/svg-pack/scIconVerticalThreeDots.svg +1 -1
- package/icons/svg-pack/scIconViewGrid.svg +1 -1
- package/icons/svg-pack/scIconViewInline.svg +1 -1
- package/icons/svg-pack/scIconViewTree.svg +1 -1
- package/icons/svg-pack/scIconWallet.svg +1 -1
- package/icons/svg-pack/scIconWarning.svg +1 -1
- package/icons/svg-pack/scIconWordFile.svg +1 -1
- package/news/news-card/sc-news-card.component.d.ts +5 -1
- package/package.json +1 -1
- package/share-button/sc-share-button.component.d.ts +15 -1
- package/share-button/sc-share-button.module.d.ts +2 -1
- package/styles/tailwind/tailwind.scss +1 -1
@@ -736,6 +736,14 @@ class ScPriceCardComponent {
|
|
736
736
|
this.warehouseService = warehouseService;
|
737
737
|
this.urls = urls;
|
738
738
|
this.pathImageNotFound = pathImageNotFound;
|
739
|
+
/**
|
740
|
+
* Признак, что необходимо отобразить лоадер для поля ввода количества товара.
|
741
|
+
*/
|
742
|
+
this.quantityShowLoader = false;
|
743
|
+
/**
|
744
|
+
* Признак, что необходимо отобразить поле ввода количества товара.
|
745
|
+
*/
|
746
|
+
this.showQuantityControl = false;
|
739
747
|
/**
|
740
748
|
* Событие нажатия на кнопку "В избранное".
|
741
749
|
*/
|
@@ -744,6 +752,10 @@ class ScPriceCardComponent {
|
|
744
752
|
* Событие нажатия на кнопку "В корзину".
|
745
753
|
*/
|
746
754
|
this.clickAddToCartEvent = new EventEmitter();
|
755
|
+
/**
|
756
|
+
* Событие нажатия на кнопку очистки количества товара.
|
757
|
+
*/
|
758
|
+
this.clickClearEvent = new EventEmitter();
|
747
759
|
/**
|
748
760
|
* Событие нажатия на карточку товара.
|
749
761
|
*/
|
@@ -752,6 +764,14 @@ class ScPriceCardComponent {
|
|
752
764
|
* {@link Observable} изменения выбранного склада.
|
753
765
|
*/
|
754
766
|
this.warehouseSelect$ = this.warehouseService.getWarehouseSelectChange$();
|
767
|
+
/**
|
768
|
+
* {@link FormControl} поля ввода количества товара в корзине.
|
769
|
+
*/
|
770
|
+
this.quantityControl = new FormControl(null);
|
771
|
+
/**
|
772
|
+
* {@link Observable} изменения количества товара в корзине.
|
773
|
+
*/
|
774
|
+
this.quantityValueChanges = this.quantityControl.valueChanges;
|
755
775
|
/**
|
756
776
|
* {@link Observable} изменения статуса авторизации.
|
757
777
|
*/
|
@@ -761,19 +781,30 @@ class ScPriceCardComponent {
|
|
761
781
|
*/
|
762
782
|
this.size = 'm';
|
763
783
|
}
|
784
|
+
/**
|
785
|
+
* Позиция товара в корзине.
|
786
|
+
*
|
787
|
+
* TODO: Сделать товар в корзине наблюдаемой переменной после реализации TASK:[#7144].
|
788
|
+
*/
|
789
|
+
get cartItem() {
|
790
|
+
return this._cartItem;
|
791
|
+
}
|
792
|
+
/**
|
793
|
+
* Позиция товара в корзине
|
794
|
+
*
|
795
|
+
* TODO: Сделать товар в корзине наблюдаемой переменной после реализации TASK:[#7144].
|
796
|
+
*/
|
797
|
+
set cartItem(value) {
|
798
|
+
this._cartItem = value;
|
799
|
+
this.quantityControl.patchValue(this._cartItem?.quantity ?? null, { emitEvent: false });
|
800
|
+
this.quantityShowLoader = false;
|
801
|
+
}
|
764
802
|
/**
|
765
803
|
* Признак, что нужно показать скелетон.
|
766
804
|
*/
|
767
805
|
get skeletonVisible() {
|
768
806
|
return !this.product;
|
769
807
|
}
|
770
|
-
/** @inheritDoc */
|
771
|
-
ngOnInit() {
|
772
|
-
if (this.product?.cartItem) {
|
773
|
-
this.quantityControl = new FormControl(this.product.cartItem.quantity);
|
774
|
-
this.quantityValueChanges = this.quantityControl.valueChanges;
|
775
|
-
}
|
776
|
-
}
|
777
808
|
/**
|
778
809
|
* Возвращает ссылку на изображение карточки товара.
|
779
810
|
*/
|
@@ -782,22 +813,28 @@ class ScPriceCardComponent {
|
|
782
813
|
}
|
783
814
|
}
|
784
815
|
ScPriceCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScPriceCardComponent, deps: [{ token: i1.ScAuthService }, { token: i1.ScWarehouseService }, { token: SC_URLS }, { token: SC_PATH_IMAGE_NOT_FOUND }], target: i0.ɵɵFactoryTarget.Component });
|
785
|
-
ScPriceCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScPriceCardComponent, selector: "sc-price-card", inputs: { product: "product", size: "size" }, outputs: { clickFavoriteEvent: "clickFavoriteEvent", clickAddToCartEvent: "clickAddToCartEvent", clickCardEvent: "clickCardEvent", quantityValueChanges: "quantityValueChanges" }, host: { properties: { "attr.data-size": "this.size" } }, ngImport: i0, template: "<div *ngIf=\"product; else skeleton\" class=\"card-wrapper flex flex-col w-40 h-64 bg-tui-base-03 rounded-xl shadow-sc-2 overflow-hidden text-xs\">\n <!-- \u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0442\u043E\u0432\u0430\u0440\u0430 -->\n <div class=\"flex flex-col grow overflow-hidden\">\n <div class=\"flex justify-center items-center grow overflow-hidden relative\">\n <img (click)=\"clickCardEvent.emit()\" [src]=\"getCardImage()\" [alt]=\"product.name\" [class.p-12]=\"!product.images?.length\" class=\"cursor-pointer\" />\n <tui-svg *ngIf=\"
|
816
|
+
ScPriceCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScPriceCardComponent, selector: "sc-price-card", inputs: { showQuantityControl: "showQuantityControl", cartItem: "cartItem", product: "product", size: "size" }, outputs: { clickFavoriteEvent: "clickFavoriteEvent", clickAddToCartEvent: "clickAddToCartEvent", clickClearEvent: "clickClearEvent", clickCardEvent: "clickCardEvent", quantityValueChanges: "quantityValueChanges" }, host: { properties: { "attr.data-size": "this.size" } }, ngImport: i0, template: "<div *ngIf=\"product; else skeleton\" class=\"card-wrapper flex flex-col w-40 h-64 bg-tui-base-03 rounded-xl shadow-sc-2 overflow-hidden text-xs\">\n <!-- \u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0442\u043E\u0432\u0430\u0440\u0430 -->\n <div class=\"flex flex-col grow overflow-hidden\">\n <div class=\"flex justify-center items-center grow overflow-hidden relative\">\n <img (click)=\"clickCardEvent.emit()\" [src]=\"getCardImage()\" [alt]=\"product.name\" [class.p-12]=\"!product.images?.length\" class=\"cursor-pointer\" />\n <tui-svg *ngIf=\"cartItem\" src=\"tuiIconCheck\" class=\"!h-5 !w-5 bg-tui-primary text-white rounded-md absolute right-2 top-2\"></tui-svg>\n <sc-favorite-btn *ngIf=\"authStatus$ | async\" [class.!block]=\"product.isFavorite\" class=\"top-1 left-1 absolute hidden group-hover:block\"></sc-favorite-btn>\n </div>\n </div>\n\n <!-- \u041A\u0440\u0430\u0442\u043A\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435 -->\n <div class=\"bg-white relative shrink-0\">\n <div class=\"wrapper-info flex flex-col content-between flex-auto justify-between\">\n <a class=\"name !transition-all !duration-500\" tuiLink iconAlign=\"left\" (click)=\"clickCardEvent.emit()\">\n <span class=\"font-bold\">{{ product.name }}</span>\n </a>\n <div class=\"info text-tui-text-02 overflow-hidden duration-500\">\n <p *ngIf=\"product.pack\">\u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}</p>\n <div class=\"sub-info\">\n <p>\u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}</p>\n <p *ngIf=\"(authStatus$ | async) && product.costDate\" class=\"text-tui-link hover:text-tui-link-hover cursor-pointer\">\u0414\u0430\u0442\u0430: {{ product.costDate }}</p>\n </div>\n </div>\n <div *ngIf=\"warehouseSelect$ | async as warehouseSelect\" class=\"flex flex-col\">\n <span *ngIf=\"product.discount\" class=\"flex items-center text-tui-text-02\">\n <span class=\"line-through\">{{ product.discountCostString }}</span> \n <span class=\"text-tui-success-fill font-bold\"> -{{ product.discount.percent }}% </span>\n <tui-svg src=\"tuiIconInfoLarge\" [tuiHint]=\"discountHint\" [tuiHintShowDelay]=\"100\" tuiHintDirection=\"top\" class=\"text-black !text-xs !h-4\"></tui-svg>\n <ng-template #discountHint>\n <div class=\"font-bold\">{{ product.discount.name }}</div>\n <div *ngIf=\"product.discount.expiredAt as expiredAt\">\u0414\u0430\u0442\u0430 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F: {{ expiredAt }}</div>\n </ng-template>\n </span>\n <span [class.text-tui-text-02]=\"!product.isWarehouseStockExist(warehouseSelect.id)\" class=\"cost font-bold\">{{ product.costRubString }}</span>\n <span *ngIf=\"!product.priceInRub\" class=\"text-xs font-bold text-tui-text-02 hidden group-hover:block\">{{ product.costString }}</span>\n <sc-price-warehouse-stock [product]=\"product\"></sc-price-warehouse-stock>\n </div>\n </div>\n <div class=\"button-wrapper overflow-hidden duration-500\">\n <button *ngIf=\"!showQuantityControl\" tuiButton (click)=\"clickAddToCartEvent.emit(product)\" [showLoader]=\"quantityShowLoader\" [size]=\"size\" class=\"w-full\">\n <span class=\"font-bold\"> <tui-svg src=\"scIconCart\"></tui-svg> \u0412 \u043A\u043E\u0440\u0437\u0438\u043D\u0443</span>\n </button>\n <sc-input-quantity\n *ngIf=\"showQuantityControl\"\n [formControl]=\"quantityControl\"\n [quantityUnit]=\"product.quantityUnit\"\n [size]=\"size === 'm' ? 'l' : 'm'\"\n [step]=\"product.minCount || 1\"\n [showLoader]=\"quantityShowLoader\"\n (clickClearEvent)=\"clickClearEvent.emit(cartItem)\"\n ></sc-input-quantity>\n </div>\n <div *ngIf=\"product.isPreviouslyOrdered\" matTooltip=\"\u0422\u043E\u0432\u0430\u0440 \u0438\u0437 \u0438\u0441\u0442\u043E\u0440\u0438\u0438 \u043F\u043E\u043A\u0443\u043F\u043E\u043A\" class=\"rotate-45 z-10 absolute bg-tui-error-fill -bottom-4 -right-4 h-8 w-8\"></div>\n </div>\n</div>\n\n<ng-template #skeleton>\n <div class=\"flex flex-col card-wrapper bg-white rounded-xl overflow-hidden shadow-sc-1\">\n <!-- \u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0442\u043E\u0432\u0430\u0440\u0430 -->\n <div class=\"w-full h-3/5 rounded-t bg-tui-base-02\"></div>\n <!-- \u041A\u0440\u0430\u0442\u043A\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435 -->\n <div class=\"flex flex-col grow gap-2.5 bg-white rounded-b p-5\">\n <div class=\"w-full h-4 rounded bg-tui-base-02\"></div>\n <div class=\"w-3/5 h-4 rounded bg-tui-base-02\"></div>\n <div class=\"w-full h-4 rounded bg-tui-base-02\"></div>\n </div>\n </div>\n</ng-template>\n", styles: [":host[data-size=s] .card-wrapper{width:10rem;height:16rem}:host[data-size=s] .card-wrapper .wrapper-info{padding:8px}:host[data-size=s] .card-wrapper .wrapper-info .cost{font-size:.875rem;line-height:1.25rem}:host[data-size=s] .card-wrapper .button-wrapper tui-svg{font-size:.75rem;line-height:1rem;width:1rem}:host[data-size=m] .card-wrapper{width:12.5rem;height:20rem}:host[data-size=m] .card-wrapper .wrapper-info{padding-inline:16px;padding-block:8px}:host[data-size=m] .card-wrapper .name{font-size:.875rem;line-height:1.25rem;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;max-height:3rem}:host[data-size=m] .card-wrapper .info{max-height:1rem}:host[data-size=m] .card-wrapper .cost{font-size:1.125rem;line-height:1.75rem}:host[data-size=m] .card-wrapper .button-wrapper{max-height:0px;font-size:.75rem;line-height:1rem}:host[data-size=m] .card-wrapper:hover .name{-webkit-line-clamp:unset;max-height:6rem}:host[data-size=m] .card-wrapper:hover .info{max-height:3rem}:host[data-size=m] .card-wrapper:hover .button-wrapper{max-height:3rem}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { kind: "component", type: i3.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.TuiHintDirective, selector: "[tuiHint]:not(ng-container)", inputs: ["tuiHint", "tuiHintContext", "tuiHintAppearance"] }, { kind: "directive", type: i3.TuiHintDriverDirective, selector: "[tuiHint]" }, { kind: "directive", type: i3.TuiHintHoverDirective, selector: "[tuiHint]:not(ng-container)", inputs: ["tuiHintShowDelay", "tuiHintHideDelay"], exportAs: ["tuiHintHover"] }, { kind: "directive", type: i3.TuiHintPositionDirective, selector: "[tuiHint]:not([tuiHintCustomPosition])", inputs: ["tuiHintDirection"] }, { kind: "component", type: i3.TuiLinkComponent, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo", "icon", "iconAlign", "iconRotated", "mode"], exportAs: ["tuiLink"] }, { kind: "component", type: ScFavoriteBtnComponent, selector: "sc-favorite-btn", outputs: ["clickEvent"] }, { kind: "component", type: ScInputQuantityComponent, selector: "sc-input-quantity", inputs: ["step", "quantityUnit", "showLoader", "showCross", "appearance", "isDisabled", "size"], outputs: ["clickClearEvent"] }, { kind: "component", type: ScPriceWarehouseStockComponent, selector: "sc-price-warehouse-stock", inputs: ["classList", "product", "withStockHint"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
786
817
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScPriceCardComponent, decorators: [{
|
787
818
|
type: Component,
|
788
|
-
args: [{ selector: 'sc-price-card', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"product; else skeleton\" class=\"card-wrapper flex flex-col w-40 h-64 bg-tui-base-03 rounded-xl shadow-sc-2 overflow-hidden text-xs\">\n <!-- \u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0442\u043E\u0432\u0430\u0440\u0430 -->\n <div class=\"flex flex-col grow overflow-hidden\">\n <div class=\"flex justify-center items-center grow overflow-hidden relative\">\n <img (click)=\"clickCardEvent.emit()\" [src]=\"getCardImage()\" [alt]=\"product.name\" [class.p-12]=\"!product.images?.length\" class=\"cursor-pointer\" />\n <tui-svg *ngIf=\"
|
819
|
+
args: [{ selector: 'sc-price-card', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"product; else skeleton\" class=\"card-wrapper flex flex-col w-40 h-64 bg-tui-base-03 rounded-xl shadow-sc-2 overflow-hidden text-xs\">\n <!-- \u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0442\u043E\u0432\u0430\u0440\u0430 -->\n <div class=\"flex flex-col grow overflow-hidden\">\n <div class=\"flex justify-center items-center grow overflow-hidden relative\">\n <img (click)=\"clickCardEvent.emit()\" [src]=\"getCardImage()\" [alt]=\"product.name\" [class.p-12]=\"!product.images?.length\" class=\"cursor-pointer\" />\n <tui-svg *ngIf=\"cartItem\" src=\"tuiIconCheck\" class=\"!h-5 !w-5 bg-tui-primary text-white rounded-md absolute right-2 top-2\"></tui-svg>\n <sc-favorite-btn *ngIf=\"authStatus$ | async\" [class.!block]=\"product.isFavorite\" class=\"top-1 left-1 absolute hidden group-hover:block\"></sc-favorite-btn>\n </div>\n </div>\n\n <!-- \u041A\u0440\u0430\u0442\u043A\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435 -->\n <div class=\"bg-white relative shrink-0\">\n <div class=\"wrapper-info flex flex-col content-between flex-auto justify-between\">\n <a class=\"name !transition-all !duration-500\" tuiLink iconAlign=\"left\" (click)=\"clickCardEvent.emit()\">\n <span class=\"font-bold\">{{ product.name }}</span>\n </a>\n <div class=\"info text-tui-text-02 overflow-hidden duration-500\">\n <p *ngIf=\"product.pack\">\u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}</p>\n <div class=\"sub-info\">\n <p>\u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}</p>\n <p *ngIf=\"(authStatus$ | async) && product.costDate\" class=\"text-tui-link hover:text-tui-link-hover cursor-pointer\">\u0414\u0430\u0442\u0430: {{ product.costDate }}</p>\n </div>\n </div>\n <div *ngIf=\"warehouseSelect$ | async as warehouseSelect\" class=\"flex flex-col\">\n <span *ngIf=\"product.discount\" class=\"flex items-center text-tui-text-02\">\n <span class=\"line-through\">{{ product.discountCostString }}</span> \n <span class=\"text-tui-success-fill font-bold\"> -{{ product.discount.percent }}% </span>\n <tui-svg src=\"tuiIconInfoLarge\" [tuiHint]=\"discountHint\" [tuiHintShowDelay]=\"100\" tuiHintDirection=\"top\" class=\"text-black !text-xs !h-4\"></tui-svg>\n <ng-template #discountHint>\n <div class=\"font-bold\">{{ product.discount.name }}</div>\n <div *ngIf=\"product.discount.expiredAt as expiredAt\">\u0414\u0430\u0442\u0430 \u043E\u043A\u043E\u043D\u0447\u0430\u043D\u0438\u044F: {{ expiredAt }}</div>\n </ng-template>\n </span>\n <span [class.text-tui-text-02]=\"!product.isWarehouseStockExist(warehouseSelect.id)\" class=\"cost font-bold\">{{ product.costRubString }}</span>\n <span *ngIf=\"!product.priceInRub\" class=\"text-xs font-bold text-tui-text-02 hidden group-hover:block\">{{ product.costString }}</span>\n <sc-price-warehouse-stock [product]=\"product\"></sc-price-warehouse-stock>\n </div>\n </div>\n <div class=\"button-wrapper overflow-hidden duration-500\">\n <button *ngIf=\"!showQuantityControl\" tuiButton (click)=\"clickAddToCartEvent.emit(product)\" [showLoader]=\"quantityShowLoader\" [size]=\"size\" class=\"w-full\">\n <span class=\"font-bold\"> <tui-svg src=\"scIconCart\"></tui-svg> \u0412 \u043A\u043E\u0440\u0437\u0438\u043D\u0443</span>\n </button>\n <sc-input-quantity\n *ngIf=\"showQuantityControl\"\n [formControl]=\"quantityControl\"\n [quantityUnit]=\"product.quantityUnit\"\n [size]=\"size === 'm' ? 'l' : 'm'\"\n [step]=\"product.minCount || 1\"\n [showLoader]=\"quantityShowLoader\"\n (clickClearEvent)=\"clickClearEvent.emit(cartItem)\"\n ></sc-input-quantity>\n </div>\n <div *ngIf=\"product.isPreviouslyOrdered\" matTooltip=\"\u0422\u043E\u0432\u0430\u0440 \u0438\u0437 \u0438\u0441\u0442\u043E\u0440\u0438\u0438 \u043F\u043E\u043A\u0443\u043F\u043E\u043A\" class=\"rotate-45 z-10 absolute bg-tui-error-fill -bottom-4 -right-4 h-8 w-8\"></div>\n </div>\n</div>\n\n<ng-template #skeleton>\n <div class=\"flex flex-col card-wrapper bg-white rounded-xl overflow-hidden shadow-sc-1\">\n <!-- \u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0442\u043E\u0432\u0430\u0440\u0430 -->\n <div class=\"w-full h-3/5 rounded-t bg-tui-base-02\"></div>\n <!-- \u041A\u0440\u0430\u0442\u043A\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435 -->\n <div class=\"flex flex-col grow gap-2.5 bg-white rounded-b p-5\">\n <div class=\"w-full h-4 rounded bg-tui-base-02\"></div>\n <div class=\"w-3/5 h-4 rounded bg-tui-base-02\"></div>\n <div class=\"w-full h-4 rounded bg-tui-base-02\"></div>\n </div>\n </div>\n</ng-template>\n", styles: [":host[data-size=s] .card-wrapper{width:10rem;height:16rem}:host[data-size=s] .card-wrapper .wrapper-info{padding:8px}:host[data-size=s] .card-wrapper .wrapper-info .cost{font-size:.875rem;line-height:1.25rem}:host[data-size=s] .card-wrapper .button-wrapper tui-svg{font-size:.75rem;line-height:1rem;width:1rem}:host[data-size=m] .card-wrapper{width:12.5rem;height:20rem}:host[data-size=m] .card-wrapper .wrapper-info{padding-inline:16px;padding-block:8px}:host[data-size=m] .card-wrapper .name{font-size:.875rem;line-height:1.25rem;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;max-height:3rem}:host[data-size=m] .card-wrapper .info{max-height:1rem}:host[data-size=m] .card-wrapper .cost{font-size:1.125rem;line-height:1.75rem}:host[data-size=m] .card-wrapper .button-wrapper{max-height:0px;font-size:.75rem;line-height:1rem}:host[data-size=m] .card-wrapper:hover .name{-webkit-line-clamp:unset;max-height:6rem}:host[data-size=m] .card-wrapper:hover .info{max-height:3rem}:host[data-size=m] .card-wrapper:hover .button-wrapper{max-height:3rem}\n"] }]
|
789
820
|
}], ctorParameters: function () { return [{ type: i1.ScAuthService }, { type: i1.ScWarehouseService }, { type: undefined, decorators: [{
|
790
821
|
type: Inject,
|
791
822
|
args: [SC_URLS]
|
792
823
|
}] }, { type: undefined, decorators: [{
|
793
824
|
type: Inject,
|
794
825
|
args: [SC_PATH_IMAGE_NOT_FOUND]
|
795
|
-
}] }]; }, propDecorators: {
|
826
|
+
}] }]; }, propDecorators: { showQuantityControl: [{
|
827
|
+
type: Input
|
828
|
+
}], cartItem: [{
|
829
|
+
type: Input
|
830
|
+
}], product: [{
|
796
831
|
type: Input
|
797
832
|
}], clickFavoriteEvent: [{
|
798
833
|
type: Output
|
799
834
|
}], clickAddToCartEvent: [{
|
800
835
|
type: Output
|
836
|
+
}], clickClearEvent: [{
|
837
|
+
type: Output
|
801
838
|
}], clickCardEvent: [{
|
802
839
|
type: Output
|
803
840
|
}], quantityValueChanges: [{
|
@@ -1208,6 +1245,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
1208
1245
|
|
1209
1246
|
/**
|
1210
1247
|
* Список иконок.
|
1248
|
+
* TODO: TASK[#7779] Добавить иконки отдельных значков для соц. сетей после добавления их в кит дизайна.
|
1211
1249
|
*/
|
1212
1250
|
const scClientUiIconsName = [
|
1213
1251
|
'scIconCalendar',
|
@@ -1301,20 +1339,48 @@ const scClientUiIconsName = [
|
|
1301
1339
|
'scIconArrowDown',
|
1302
1340
|
'scIconApplication',
|
1303
1341
|
'scIconAddProfile',
|
1342
|
+
'scIconSocialCopy',
|
1343
|
+
'scIconSocialEmail',
|
1344
|
+
'scIconSocialFacebook',
|
1345
|
+
'scIconSocialInstagram',
|
1346
|
+
'scIconSocialQR',
|
1347
|
+
'scIconSocialTelegram',
|
1348
|
+
'scIconSocialViber',
|
1349
|
+
'scIconSocialVk',
|
1350
|
+
'scIconSocialWhatsapp',
|
1304
1351
|
];
|
1305
1352
|
|
1306
1353
|
/**
|
1307
1354
|
* Компонент кнопки "Поделиться".
|
1308
1355
|
*/
|
1309
|
-
/* TODO: TASK[#6895] Реализовать логику компонента кнопки "Поделиться".*/
|
1310
1356
|
class ScShareButtonComponent {
|
1357
|
+
constructor() {
|
1358
|
+
/**
|
1359
|
+
* Формат внешнего вида кнопки.
|
1360
|
+
*/
|
1361
|
+
this.appearance = 'secondary';
|
1362
|
+
/**
|
1363
|
+
* Размер кнопки.
|
1364
|
+
*/
|
1365
|
+
this.size = 'm';
|
1366
|
+
/**
|
1367
|
+
* Событие клика по кнопке "Поделиться".
|
1368
|
+
*/
|
1369
|
+
this.clickShareEvent = new EventEmitter();
|
1370
|
+
}
|
1311
1371
|
}
|
1312
1372
|
ScShareButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScShareButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
1313
|
-
ScShareButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScShareButtonComponent, selector: "sc-share-button",
|
1373
|
+
ScShareButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScShareButtonComponent, selector: "sc-share-button", inputs: { appearance: "appearance", size: "size" }, outputs: { clickShareEvent: "clickShareEvent" }, ngImport: i0, template: "<button tuiIconButton icon=\"scIconShare\" [appearance]=\"appearance\" [size]=\"size\" (click)=\"clickShareEvent.emit()\"></button>\n", dependencies: [{ kind: "component", type: i3.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1314
1374
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScShareButtonComponent, decorators: [{
|
1315
1375
|
type: Component,
|
1316
|
-
args: [{ selector: 'sc-share-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "
|
1317
|
-
}]
|
1376
|
+
args: [{ selector: 'sc-share-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button tuiIconButton icon=\"scIconShare\" [appearance]=\"appearance\" [size]=\"size\" (click)=\"clickShareEvent.emit()\"></button>\n" }]
|
1377
|
+
}], propDecorators: { appearance: [{
|
1378
|
+
type: Input
|
1379
|
+
}], size: [{
|
1380
|
+
type: Input
|
1381
|
+
}], clickShareEvent: [{
|
1382
|
+
type: Output
|
1383
|
+
}] } });
|
1318
1384
|
|
1319
1385
|
/**
|
1320
1386
|
* Компонент карточки новости.
|
@@ -1325,17 +1391,23 @@ class ScNewsCardComponent {
|
|
1325
1391
|
* Событие клика по карточке новости.
|
1326
1392
|
*/
|
1327
1393
|
this.clickCardEvent = new EventEmitter();
|
1394
|
+
/**
|
1395
|
+
* Событие клика по кнопке "Поделиться" карточки новости.
|
1396
|
+
*/
|
1397
|
+
this.clickShareEvent = new EventEmitter();
|
1328
1398
|
}
|
1329
1399
|
}
|
1330
1400
|
ScNewsCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScNewsCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
1331
|
-
ScNewsCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScNewsCardComponent, selector: "sc-news-card", inputs: { news: "news" }, outputs: { clickCardEvent: "clickCardEvent" }, ngImport: i0, template: "<div (click)=\"clickCardEvent.emit(news)\" class=\"block relative h-82 w-70 cursor-pointer shadow-sc-2 rounded-lg overflow-hidden bg-white\">\n <div [style.background-image]=\"'url(' + news.image + ')'\" class=\"bg-no-repeat bg-center bg-cover bg-tui-base-02 w-full h-50\"></div>\n <div class=\"px-6 py-4.5 h-32 w-full bg-white overflow-hidden\">\n <div class=\"w-full flex justify-between align-baseline mb-2.5\">\n <p class=\"text-sm text-tui-text-02\">{{ news.created_at }}</p>\n <sc-share-button></sc-share-button>\n </div>\n <p>\n <a class=\"text-sm font-bold text-black line-clamp-3\">{{ news.subject }}</a>\n </p>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ScShareButtonComponent, selector: "sc-share-button" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1401
|
+
ScNewsCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScNewsCardComponent, selector: "sc-news-card", inputs: { news: "news" }, outputs: { clickCardEvent: "clickCardEvent", clickShareEvent: "clickShareEvent" }, ngImport: i0, template: "<div (click)=\"clickCardEvent.emit(news)\" class=\"block relative h-82 w-70 cursor-pointer shadow-sc-2 rounded-lg overflow-hidden bg-white\">\n <div [style.background-image]=\"'url(' + news.image + ')'\" class=\"bg-no-repeat bg-center bg-cover bg-tui-base-02 w-full h-50\"></div>\n <div class=\"px-6 py-4.5 h-32 w-full bg-white overflow-hidden\">\n <div class=\"w-full flex justify-between align-baseline mb-2.5\">\n <p class=\"text-sm text-tui-text-02\">{{ news.created_at }}</p>\n <sc-share-button (clickShareEvent)=\"clickShareEvent.emit()\"></sc-share-button>\n </div>\n <p>\n <a class=\"text-sm font-bold text-black line-clamp-3\">{{ news.subject }}</a>\n </p>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ScShareButtonComponent, selector: "sc-share-button", inputs: ["appearance", "size"], outputs: ["clickShareEvent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1332
1402
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScNewsCardComponent, decorators: [{
|
1333
1403
|
type: Component,
|
1334
|
-
args: [{ selector: 'sc-news-card', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div (click)=\"clickCardEvent.emit(news)\" class=\"block relative h-82 w-70 cursor-pointer shadow-sc-2 rounded-lg overflow-hidden bg-white\">\n <div [style.background-image]=\"'url(' + news.image + ')'\" class=\"bg-no-repeat bg-center bg-cover bg-tui-base-02 w-full h-50\"></div>\n <div class=\"px-6 py-4.5 h-32 w-full bg-white overflow-hidden\">\n <div class=\"w-full flex justify-between align-baseline mb-2.5\">\n <p class=\"text-sm text-tui-text-02\">{{ news.created_at }}</p>\n <sc-share-button></sc-share-button>\n </div>\n <p>\n <a class=\"text-sm font-bold text-black line-clamp-3\">{{ news.subject }}</a>\n </p>\n </div>\n</div>\n" }]
|
1404
|
+
args: [{ selector: 'sc-news-card', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div (click)=\"clickCardEvent.emit(news)\" class=\"block relative h-82 w-70 cursor-pointer shadow-sc-2 rounded-lg overflow-hidden bg-white\">\n <div [style.background-image]=\"'url(' + news.image + ')'\" class=\"bg-no-repeat bg-center bg-cover bg-tui-base-02 w-full h-50\"></div>\n <div class=\"px-6 py-4.5 h-32 w-full bg-white overflow-hidden\">\n <div class=\"w-full flex justify-between align-baseline mb-2.5\">\n <p class=\"text-sm text-tui-text-02\">{{ news.created_at }}</p>\n <sc-share-button (clickShareEvent)=\"clickShareEvent.emit()\"></sc-share-button>\n </div>\n <p>\n <a class=\"text-sm font-bold text-black line-clamp-3\">{{ news.subject }}</a>\n </p>\n </div>\n</div>\n" }]
|
1335
1405
|
}], propDecorators: { news: [{
|
1336
1406
|
type: Input
|
1337
1407
|
}], clickCardEvent: [{
|
1338
1408
|
type: Output
|
1409
|
+
}], clickShareEvent: [{
|
1410
|
+
type: Output
|
1339
1411
|
}] } });
|
1340
1412
|
|
1341
1413
|
/**
|
@@ -1364,13 +1436,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
1364
1436
|
class ScShareButtonModule {
|
1365
1437
|
}
|
1366
1438
|
ScShareButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScShareButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1367
|
-
ScShareButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: ScShareButtonModule, declarations: [ScShareButtonComponent], imports: [CommonModule], exports: [ScShareButtonComponent] });
|
1368
|
-
ScShareButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScShareButtonModule, imports: [CommonModule] });
|
1439
|
+
ScShareButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: ScShareButtonModule, declarations: [ScShareButtonComponent], imports: [CommonModule, TuiButtonModule], exports: [ScShareButtonComponent] });
|
1440
|
+
ScShareButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScShareButtonModule, imports: [CommonModule, TuiButtonModule] });
|
1369
1441
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScShareButtonModule, decorators: [{
|
1370
1442
|
type: NgModule,
|
1371
1443
|
args: [{
|
1372
1444
|
declarations: [ScShareButtonComponent],
|
1373
|
-
imports: [CommonModule],
|
1445
|
+
imports: [CommonModule, TuiButtonModule],
|
1374
1446
|
exports: [ScShareButtonComponent],
|
1375
1447
|
}]
|
1376
1448
|
}] });
|