@snabcentr/client-ui 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- package/catalog/categories-list/sc-categories-list.component.d.ts +6 -0
- package/esm2020/catalog/categories-list/sc-categories-list.component.mjs +18 -5
- package/fesm2015/snabcentr-client-ui.mjs +16 -4
- package/fesm2015/snabcentr-client-ui.mjs.map +1 -1
- package/fesm2020/snabcentr-client-ui.mjs +16 -4
- package/fesm2020/snabcentr-client-ui.mjs.map +1 -1
- package/package.json +1 -1
@@ -30,6 +30,12 @@ export declare class ScCategoriesListComponent<T> {
|
|
30
30
|
* @param imgPath путь, где хранится изображение.
|
31
31
|
*/
|
32
32
|
getCategoryImage(imgPath: string): string;
|
33
|
+
/**
|
34
|
+
* Проверяет наличие хотя бы одного изображения.
|
35
|
+
*
|
36
|
+
* @param categories Список категорий.
|
37
|
+
*/
|
38
|
+
checkImagesExists(categories: any[]): boolean;
|
33
39
|
static ɵfac: i0.ɵɵFactoryDeclaration<ScCategoriesListComponent<any>, never>;
|
34
40
|
static ɵcmp: i0.ɵɵComponentDeclaration<ScCategoriesListComponent<any>, "sc-categories-list", never, { "categories": "categories"; }, { "clickCategoryEvent": "clickCategoryEvent"; }, never, never, false>;
|
35
41
|
}
|
@@ -1,6 +1,7 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
1
2
|
import { ChangeDetectionStrategy, Component, EventEmitter, Inject, Input, Output, inject } from '@angular/core';
|
2
3
|
import { SC_URLS } from '@snabcentr/client-core';
|
3
|
-
import { TUI_IS_MOBILE } from '@taiga-ui/cdk';
|
4
|
+
import { TUI_IS_MOBILE, tuiPure } from '@taiga-ui/cdk';
|
4
5
|
import * as i0 from "@angular/core";
|
5
6
|
import * as i1 from "@angular/common";
|
6
7
|
import * as i2 from "@taiga-ui/core";
|
@@ -33,12 +34,24 @@ export class ScCategoriesListComponent {
|
|
33
34
|
getCategoryImage(imgPath) {
|
34
35
|
return this.urls.imgServerUrl + '/' + imgPath;
|
35
36
|
}
|
37
|
+
/**
|
38
|
+
* Проверяет наличие хотя бы одного изображения.
|
39
|
+
*
|
40
|
+
* @param categories Список категорий.
|
41
|
+
*/
|
42
|
+
checkImagesExists(categories) {
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
44
|
+
return categories.some(item => item.properties?.image);
|
45
|
+
}
|
36
46
|
}
|
37
47
|
ScCategoriesListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScCategoriesListComponent, deps: [{ token: SC_URLS }], target: i0.ɵɵFactoryTarget.Component });
|
38
|
-
ScCategoriesListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScCategoriesListComponent, selector: "sc-categories-list", inputs: { categories: "categories" }, outputs: { clickCategoryEvent: "clickCategoryEvent" }, ngImport: i0, template: "<div class=\"grid grid-cols-[repeat(auto-fill,minmax(21rem,1fr))] gap-x-8 gap-y-2\">\n <ng-container *ngIf=\"categories; else categoriesSkeleton\">\n <button\n *ngFor=\"let item of $any(categories)\"\n class=\"group flex gap-2 py-1.5 px-3 bg-tui-base-02 rounded-xl h-11 items-center text-left hover-hover:hover:ring-2 hover-none:active:ring-2 ring-tui-primary duration-150\"\n (click)=\"clickCategoryEvent.emit(item)\"\n >\n <img *ngIf=\"item.properties?.image\" [src]=\"getCategoryImage(
|
48
|
+
ScCategoriesListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScCategoriesListComponent, selector: "sc-categories-list", inputs: { categories: "categories" }, outputs: { clickCategoryEvent: "clickCategoryEvent" }, ngImport: i0, template: "<div class=\"grid grid-cols-[repeat(auto-fill,minmax(21rem,1fr))] gap-x-8 gap-y-2\">\n <ng-container *ngIf=\"categories; else categoriesSkeleton\">\n <button\n *ngFor=\"let item of $any(categories)\"\n class=\"group flex gap-2 py-1.5 px-3 bg-tui-base-02 rounded-xl h-11 items-center text-left hover-hover:hover:ring-2 hover-none:active:ring-2 ring-tui-primary duration-150\"\n (click)=\"clickCategoryEvent.emit(item)\"\n >\n <img *ngIf=\"item.properties?.image as image\" [src]=\"getCategoryImage(image)\" [alt]=\"item.name\" class=\"w-8 h-8 object-cover rounded bg-tui-base-03\" />\n <tui-svg *ngIf=\"!item.properties?.image && checkImagesExists(categories)\" src=\"tuiIconCameraOffLarge\" class=\"bg-tui-base-03 !w-8 !h-8 rounded text-tui-base-05\"></tui-svg>\n <div class=\"flex grow truncate\">\n <p class=\"text-base font-bold truncate\">{{ item.name }}</p>\n <tui-svg *ngIf=\"item.isFavorite\" src=\"scIconFavoriteFill\" class=\"text-tui-primary !text-sm mr-auto\"></tui-svg>\n </div>\n <tui-svg src=\"tuiIconChevronRightLarge\" class=\"hover-hover:group-hover:text-tui-primary hover-none:group-active:text-tui-primary duration-150\"></tui-svg>\n </button>\n </ng-container>\n</div>\n\n<ng-template #categoriesSkeleton>\n <button\n *tuiRepeatTimes=\"let index of isMobile ? 3 : 6\"\n class=\"group flex gap-2 py-1.5 px-3 bg-tui-base-02 rounded-xl h-11 items-center text-left hover-hover:hover:ring-2 hover-none:active:ring-2 ring-tui-base-05 duration-150\"\n >\n <div class=\"w-8 h-8 tui-skeleton\"></div>\n <div class=\"h-4 grow tui-skeleton\"></div>\n <tui-svg src=\"tuiIconChevronRightLarge\" class=\"hover-hover:group-hover:text-tui-primary hover-none:group-active:text-tui-primary duration-150 tui-skeleton\"></tui-svg>\n </button>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { kind: "directive", type: i3.TuiRepeatTimesDirective, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
49
|
+
__decorate([
|
50
|
+
tuiPure
|
51
|
+
], ScCategoriesListComponent.prototype, "checkImagesExists", null);
|
39
52
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScCategoriesListComponent, decorators: [{
|
40
53
|
type: Component,
|
41
|
-
args: [{ selector: 'sc-categories-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"grid grid-cols-[repeat(auto-fill,minmax(21rem,1fr))] gap-x-8 gap-y-2\">\n <ng-container *ngIf=\"categories; else categoriesSkeleton\">\n <button\n *ngFor=\"let item of $any(categories)\"\n class=\"group flex gap-2 py-1.5 px-3 bg-tui-base-02 rounded-xl h-11 items-center text-left hover-hover:hover:ring-2 hover-none:active:ring-2 ring-tui-primary duration-150\"\n (click)=\"clickCategoryEvent.emit(item)\"\n >\n <img *ngIf=\"item.properties?.image\" [src]=\"getCategoryImage(
|
54
|
+
args: [{ selector: 'sc-categories-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"grid grid-cols-[repeat(auto-fill,minmax(21rem,1fr))] gap-x-8 gap-y-2\">\n <ng-container *ngIf=\"categories; else categoriesSkeleton\">\n <button\n *ngFor=\"let item of $any(categories)\"\n class=\"group flex gap-2 py-1.5 px-3 bg-tui-base-02 rounded-xl h-11 items-center text-left hover-hover:hover:ring-2 hover-none:active:ring-2 ring-tui-primary duration-150\"\n (click)=\"clickCategoryEvent.emit(item)\"\n >\n <img *ngIf=\"item.properties?.image as image\" [src]=\"getCategoryImage(image)\" [alt]=\"item.name\" class=\"w-8 h-8 object-cover rounded bg-tui-base-03\" />\n <tui-svg *ngIf=\"!item.properties?.image && checkImagesExists(categories)\" src=\"tuiIconCameraOffLarge\" class=\"bg-tui-base-03 !w-8 !h-8 rounded text-tui-base-05\"></tui-svg>\n <div class=\"flex grow truncate\">\n <p class=\"text-base font-bold truncate\">{{ item.name }}</p>\n <tui-svg *ngIf=\"item.isFavorite\" src=\"scIconFavoriteFill\" class=\"text-tui-primary !text-sm mr-auto\"></tui-svg>\n </div>\n <tui-svg src=\"tuiIconChevronRightLarge\" class=\"hover-hover:group-hover:text-tui-primary hover-none:group-active:text-tui-primary duration-150\"></tui-svg>\n </button>\n </ng-container>\n</div>\n\n<ng-template #categoriesSkeleton>\n <button\n *tuiRepeatTimes=\"let index of isMobile ? 3 : 6\"\n class=\"group flex gap-2 py-1.5 px-3 bg-tui-base-02 rounded-xl h-11 items-center text-left hover-hover:hover:ring-2 hover-none:active:ring-2 ring-tui-base-05 duration-150\"\n >\n <div class=\"w-8 h-8 tui-skeleton\"></div>\n <div class=\"h-4 grow tui-skeleton\"></div>\n <tui-svg src=\"tuiIconChevronRightLarge\" class=\"hover-hover:group-hover:text-tui-primary hover-none:group-active:text-tui-primary duration-150 tui-skeleton\"></tui-svg>\n </button>\n</ng-template>\n" }]
|
42
55
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
43
56
|
type: Inject,
|
44
57
|
args: [SC_URLS]
|
@@ -46,5 +59,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
46
59
|
type: Input
|
47
60
|
}], clickCategoryEvent: [{
|
48
61
|
type: Output
|
49
|
-
}] } });
|
50
|
-
//# sourceMappingURL=data:application/json;base64,
|
62
|
+
}], checkImagesExists: [] } });
|
63
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2MtY2F0ZWdvcmllcy1saXN0LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NsaWVudC11aS9jYXRhbG9nL2NhdGVnb3JpZXMtbGlzdC9zYy1jYXRlZ29yaWVzLWxpc3QuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2xpZW50LXVpL2NhdGF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ob3Zlci1ob3Zlcjpncm91cC1ob3Zlcjp0ZXh0LXR1aS1wcmltYXJ5IGhvdmVyLW5vbmU6Z3JvdXAtYWN0aXZlOnRleHQtdHVpLXByaW1hcnkgZHVyYXRpb24tMTUwICB0dWktc2tlbGV0b25cIj48L3R1aS1zdmc+XG4gICAgPC9idXR0b24+XG48L25nLXRlbXBsYXRlPlxuIl19
|
@@ -11,7 +11,7 @@ import { TuiTextfieldControllerModule, TuiLinkModule, TuiButtonModule, TuiLabelM
|
|
11
11
|
import * as i3 from '@angular/forms';
|
12
12
|
import { FormGroupDirective, FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule, NgControl } from '@angular/forms';
|
13
13
|
import * as i5 from '@taiga-ui/cdk';
|
14
|
-
import { tuiControlValue, tuiIsFalsy, TuiLetModule, tuiCreateToken, AbstractTuiNullableControl, TUI_IS_MOBILE, tuiIsPresent, TuiDestroyService, TuiRepeatTimesModule, tuiMarkControlAsTouchedAndValidate, ALWAYS_TRUE_HANDLER
|
14
|
+
import { tuiControlValue, tuiIsFalsy, TuiLetModule, tuiCreateToken, AbstractTuiNullableControl, TUI_IS_MOBILE, tuiPure, tuiIsPresent, TuiDestroyService, TuiRepeatTimesModule, tuiMarkControlAsTouchedAndValidate, ALWAYS_TRUE_HANDLER } from '@taiga-ui/cdk';
|
15
15
|
import * as i6 from '@taiga-ui/kit';
|
16
16
|
import { TuiInputPasswordModule, TuiInputModule, TuiFieldErrorPipeModule, TuiInputPhoneModule, TuiAccordionModule, TuiElasticContainerModule, TuiCarouselModule, TUI_NUMBER_VALUE_TRANSFORMER, TuiInputNumberComponent, TuiIslandModule, TuiInputNumberModule, TuiComboBoxModule, TuiDataListWrapperModule, TuiFilterByInputPipeModule, TuiStringifyContentPipeModule, TuiSelectModule, TuiTreeService, TuiTreeItemContentComponent, TUI_TREE_START, TUI_TREE_CONTENT, TUI_TREE_LOADING, TUI_TREE_LOADER, TuiTreeModule, TuiCheckboxModule, TuiCheckboxLabeledModule } from '@taiga-ui/kit';
|
17
17
|
import * as i7 from '@maskito/angular';
|
@@ -1339,12 +1339,24 @@ class ScCategoriesListComponent {
|
|
1339
1339
|
getCategoryImage(imgPath) {
|
1340
1340
|
return this.urls.imgServerUrl + '/' + imgPath;
|
1341
1341
|
}
|
1342
|
+
/**
|
1343
|
+
* Проверяет наличие хотя бы одного изображения.
|
1344
|
+
*
|
1345
|
+
* @param categories Список категорий.
|
1346
|
+
*/
|
1347
|
+
checkImagesExists(categories) {
|
1348
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
1349
|
+
return categories.some(item => { var _a; return (_a = item.properties) === null || _a === void 0 ? void 0 : _a.image; });
|
1350
|
+
}
|
1342
1351
|
}
|
1343
1352
|
ScCategoriesListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScCategoriesListComponent, deps: [{ token: SC_URLS }], target: i0.ɵɵFactoryTarget.Component });
|
1344
|
-
ScCategoriesListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScCategoriesListComponent, selector: "sc-categories-list", inputs: { categories: "categories" }, outputs: { clickCategoryEvent: "clickCategoryEvent" }, ngImport: i0, template: "<div class=\"grid grid-cols-[repeat(auto-fill,minmax(21rem,1fr))] gap-x-8 gap-y-2\">\n <ng-container *ngIf=\"categories; else categoriesSkeleton\">\n <button\n *ngFor=\"let item of $any(categories)\"\n class=\"group flex gap-2 py-1.5 px-3 bg-tui-base-02 rounded-xl h-11 items-center text-left hover-hover:hover:ring-2 hover-none:active:ring-2 ring-tui-primary duration-150\"\n (click)=\"clickCategoryEvent.emit(item)\"\n >\n <img *ngIf=\"item.properties?.image\" [src]=\"getCategoryImage(
|
1353
|
+
ScCategoriesListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScCategoriesListComponent, selector: "sc-categories-list", inputs: { categories: "categories" }, outputs: { clickCategoryEvent: "clickCategoryEvent" }, ngImport: i0, template: "<div class=\"grid grid-cols-[repeat(auto-fill,minmax(21rem,1fr))] gap-x-8 gap-y-2\">\n <ng-container *ngIf=\"categories; else categoriesSkeleton\">\n <button\n *ngFor=\"let item of $any(categories)\"\n class=\"group flex gap-2 py-1.5 px-3 bg-tui-base-02 rounded-xl h-11 items-center text-left hover-hover:hover:ring-2 hover-none:active:ring-2 ring-tui-primary duration-150\"\n (click)=\"clickCategoryEvent.emit(item)\"\n >\n <img *ngIf=\"item.properties?.image as image\" [src]=\"getCategoryImage(image)\" [alt]=\"item.name\" class=\"w-8 h-8 object-cover rounded bg-tui-base-03\" />\n <tui-svg *ngIf=\"!item.properties?.image && checkImagesExists(categories)\" src=\"tuiIconCameraOffLarge\" class=\"bg-tui-base-03 !w-8 !h-8 rounded text-tui-base-05\"></tui-svg>\n <div class=\"flex grow truncate\">\n <p class=\"text-base font-bold truncate\">{{ item.name }}</p>\n <tui-svg *ngIf=\"item.isFavorite\" src=\"scIconFavoriteFill\" class=\"text-tui-primary !text-sm mr-auto\"></tui-svg>\n </div>\n <tui-svg src=\"tuiIconChevronRightLarge\" class=\"hover-hover:group-hover:text-tui-primary hover-none:group-active:text-tui-primary duration-150\"></tui-svg>\n </button>\n </ng-container>\n</div>\n\n<ng-template #categoriesSkeleton>\n <button\n *tuiRepeatTimes=\"let index of isMobile ? 3 : 6\"\n class=\"group flex gap-2 py-1.5 px-3 bg-tui-base-02 rounded-xl h-11 items-center text-left hover-hover:hover:ring-2 hover-none:active:ring-2 ring-tui-base-05 duration-150\"\n >\n <div class=\"w-8 h-8 tui-skeleton\"></div>\n <div class=\"h-4 grow tui-skeleton\"></div>\n <tui-svg src=\"tuiIconChevronRightLarge\" class=\"hover-hover:group-hover:text-tui-primary hover-none:group-active:text-tui-primary duration-150 tui-skeleton\"></tui-svg>\n </button>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { kind: "directive", type: i5.TuiRepeatTimesDirective, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: ["tuiRepeatTimesOf"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1354
|
+
__decorate([
|
1355
|
+
tuiPure
|
1356
|
+
], ScCategoriesListComponent.prototype, "checkImagesExists", null);
|
1345
1357
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScCategoriesListComponent, decorators: [{
|
1346
1358
|
type: Component,
|
1347
|
-
args: [{ selector: 'sc-categories-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"grid grid-cols-[repeat(auto-fill,minmax(21rem,1fr))] gap-x-8 gap-y-2\">\n <ng-container *ngIf=\"categories; else categoriesSkeleton\">\n <button\n *ngFor=\"let item of $any(categories)\"\n class=\"group flex gap-2 py-1.5 px-3 bg-tui-base-02 rounded-xl h-11 items-center text-left hover-hover:hover:ring-2 hover-none:active:ring-2 ring-tui-primary duration-150\"\n (click)=\"clickCategoryEvent.emit(item)\"\n >\n <img *ngIf=\"item.properties?.image\" [src]=\"getCategoryImage(
|
1359
|
+
args: [{ selector: 'sc-categories-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"grid grid-cols-[repeat(auto-fill,minmax(21rem,1fr))] gap-x-8 gap-y-2\">\n <ng-container *ngIf=\"categories; else categoriesSkeleton\">\n <button\n *ngFor=\"let item of $any(categories)\"\n class=\"group flex gap-2 py-1.5 px-3 bg-tui-base-02 rounded-xl h-11 items-center text-left hover-hover:hover:ring-2 hover-none:active:ring-2 ring-tui-primary duration-150\"\n (click)=\"clickCategoryEvent.emit(item)\"\n >\n <img *ngIf=\"item.properties?.image as image\" [src]=\"getCategoryImage(image)\" [alt]=\"item.name\" class=\"w-8 h-8 object-cover rounded bg-tui-base-03\" />\n <tui-svg *ngIf=\"!item.properties?.image && checkImagesExists(categories)\" src=\"tuiIconCameraOffLarge\" class=\"bg-tui-base-03 !w-8 !h-8 rounded text-tui-base-05\"></tui-svg>\n <div class=\"flex grow truncate\">\n <p class=\"text-base font-bold truncate\">{{ item.name }}</p>\n <tui-svg *ngIf=\"item.isFavorite\" src=\"scIconFavoriteFill\" class=\"text-tui-primary !text-sm mr-auto\"></tui-svg>\n </div>\n <tui-svg src=\"tuiIconChevronRightLarge\" class=\"hover-hover:group-hover:text-tui-primary hover-none:group-active:text-tui-primary duration-150\"></tui-svg>\n </button>\n </ng-container>\n</div>\n\n<ng-template #categoriesSkeleton>\n <button\n *tuiRepeatTimes=\"let index of isMobile ? 3 : 6\"\n class=\"group flex gap-2 py-1.5 px-3 bg-tui-base-02 rounded-xl h-11 items-center text-left hover-hover:hover:ring-2 hover-none:active:ring-2 ring-tui-base-05 duration-150\"\n >\n <div class=\"w-8 h-8 tui-skeleton\"></div>\n <div class=\"h-4 grow tui-skeleton\"></div>\n <tui-svg src=\"tuiIconChevronRightLarge\" class=\"hover-hover:group-hover:text-tui-primary hover-none:group-active:text-tui-primary duration-150 tui-skeleton\"></tui-svg>\n </button>\n</ng-template>\n" }]
|
1348
1360
|
}], ctorParameters: function () {
|
1349
1361
|
return [{ type: undefined, decorators: [{
|
1350
1362
|
type: Inject,
|
@@ -1354,7 +1366,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
1354
1366
|
type: Input
|
1355
1367
|
}], clickCategoryEvent: [{
|
1356
1368
|
type: Output
|
1357
|
-
}] } });
|
1369
|
+
}], checkImagesExists: [] } });
|
1358
1370
|
|
1359
1371
|
/**
|
1360
1372
|
* Компонент кнопки избранных товаров и категорий.
|