@snabcentr/client-ui 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- package/catalog/price-warehouse-stock/sc-price-warehouse-stock.component.d.ts +5 -2
- package/esm2020/catalog/price-warehouse-stock/sc-price-warehouse-stock.component.mjs +5 -5
- package/fesm2015/snabcentr-client-ui.mjs +4 -4
- package/fesm2015/snabcentr-client-ui.mjs.map +1 -1
- package/fesm2020/snabcentr-client-ui.mjs +4 -4
- package/fesm2020/snabcentr-client-ui.mjs.map +1 -1
- package/package.json +2 -2
@@ -21,11 +21,14 @@ export declare class ScPriceWarehouseStockComponent {
|
|
21
21
|
/**
|
22
22
|
* {@link Observable} изменения выбранного склада.
|
23
23
|
*/
|
24
|
-
|
24
|
+
selectedWarehouse$: Observable<ScIWarehouse | null>;
|
25
25
|
/**
|
26
26
|
* {@link Observable} изменения списка складов.
|
27
27
|
*/
|
28
|
-
|
28
|
+
warehousesList$?: Observable<{
|
29
|
+
sc: ScIWarehouseStockCount;
|
30
|
+
w: ScIWarehouse | undefined;
|
31
|
+
}[] | undefined>;
|
29
32
|
/**
|
30
33
|
* Инициализирует экземпляр класса {@link ScPriceWarehouseStockComponent}.
|
31
34
|
*
|
@@ -22,18 +22,18 @@ export class ScPriceWarehouseStockComponent {
|
|
22
22
|
/**
|
23
23
|
* {@link Observable} изменения выбранного склада.
|
24
24
|
*/
|
25
|
-
this.
|
25
|
+
this.selectedWarehouse$ = this.warehouseService.getWarehouseSelectChange$();
|
26
26
|
/**
|
27
27
|
* {@link Observable} изменения списка складов.
|
28
28
|
*/
|
29
|
-
this.
|
29
|
+
this.warehousesList$ = this.selectedWarehouse$.pipe(switchMap((warehouse) => this.warehouseService.getWarehouses$().pipe(map((warehouses) => this.product.stockCount?.map((sc) => ({ w: warehouses.find((w) => w.id === sc.warehouseId), sc: sc }))), map((items) => items?.sort((item) => (item.w?.id === warehouse?.id ? -1 : 1))))));
|
30
30
|
}
|
31
31
|
}
|
32
32
|
ScPriceWarehouseStockComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScPriceWarehouseStockComponent, deps: [{ token: i1.ScWarehouseService }], target: i0.ɵɵFactoryTarget.Component });
|
33
|
-
ScPriceWarehouseStockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScPriceWarehouseStockComponent, selector: "sc-price-warehouse-stock", inputs: { classList: "classList", product: "product", withStockHint: "withStockHint" }, ngImport: i0, template: "<ng-container *ngIf=\"product\">\n <ng-container>\n <div *ngIf=\"
|
33
|
+
ScPriceWarehouseStockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScPriceWarehouseStockComponent, selector: "sc-price-warehouse-stock", inputs: { classList: "classList", product: "product", withStockHint: "withStockHint" }, ngImport: i0, template: "<ng-container *ngIf=\"product\">\n <ng-container>\n <div *ngIf=\"selectedWarehouse$ | async as warehouseSelect\" class=\"flex items-center gap-1\">\n <span *ngIf=\"product.getNotStockMessage(warehouseSelect) as message\" class=\"text-xs min-w-2/5 text-tui-error-fill\" [ngClass]=\"classList\"> {{ message }} </span>\n <span *ngIf=\"product.isWarehouseStockExist(warehouseSelect.id)\" class=\"text-xs min-w-2/5 text-tui-success-fill\" [ngClass]=\"classList\">\n \u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438<ng-container *ngIf=\"product.getWarehouseStockCount(warehouseSelect.id) as count\"\n >:\n <span class=\"whitespace-nowrap\">{{ count }} {{ product.quantityUnit }}</span>\n </ng-container>\n </span>\n <span *ngIf=\"product.onOrder\" class=\"text-xs min-w-2/5 text-sc-yellow\" [ngClass]=\"classList\">\u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437</span>\n\n <tui-svg\n *ngIf=\"withStockHint && (warehousesList$ | async)?.length\"\n src=\"tuiIconInfoLarge\"\n [tuiHint]=\"stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"!text-xs !h-3\"\n ></tui-svg>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-template #stockHint>\n <table *ngIf=\"selectedWarehouse$ | async as warehouseSelect\" class=\"text-xs table-auto\" [ngClass]=\"classList\">\n <tbody>\n <tr *ngFor=\"let item of warehousesList$ | async\" class=\"border-b\">\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count ? item.sc.count + ' ' + product.quantityUnit : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n </tbody>\n </table>\n</ng-template>\n", styles: ["[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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: i3.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { 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: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
34
34
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScPriceWarehouseStockComponent, decorators: [{
|
35
35
|
type: Component,
|
36
|
-
args: [{ selector: 'sc-price-warehouse-stock', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"product\">\n <ng-container>\n <div *ngIf=\"
|
36
|
+
args: [{ selector: 'sc-price-warehouse-stock', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"product\">\n <ng-container>\n <div *ngIf=\"selectedWarehouse$ | async as warehouseSelect\" class=\"flex items-center gap-1\">\n <span *ngIf=\"product.getNotStockMessage(warehouseSelect) as message\" class=\"text-xs min-w-2/5 text-tui-error-fill\" [ngClass]=\"classList\"> {{ message }} </span>\n <span *ngIf=\"product.isWarehouseStockExist(warehouseSelect.id)\" class=\"text-xs min-w-2/5 text-tui-success-fill\" [ngClass]=\"classList\">\n \u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438<ng-container *ngIf=\"product.getWarehouseStockCount(warehouseSelect.id) as count\"\n >:\n <span class=\"whitespace-nowrap\">{{ count }} {{ product.quantityUnit }}</span>\n </ng-container>\n </span>\n <span *ngIf=\"product.onOrder\" class=\"text-xs min-w-2/5 text-sc-yellow\" [ngClass]=\"classList\">\u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437</span>\n\n <tui-svg\n *ngIf=\"withStockHint && (warehousesList$ | async)?.length\"\n src=\"tuiIconInfoLarge\"\n [tuiHint]=\"stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"!text-xs !h-3\"\n ></tui-svg>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-template #stockHint>\n <table *ngIf=\"selectedWarehouse$ | async as warehouseSelect\" class=\"text-xs table-auto\" [ngClass]=\"classList\">\n <tbody>\n <tr *ngFor=\"let item of warehousesList$ | async\" class=\"border-b\">\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count ? item.sc.count + ' ' + product.quantityUnit : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n </tbody>\n </table>\n</ng-template>\n", styles: ["[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"] }]
|
37
37
|
}], ctorParameters: function () { return [{ type: i1.ScWarehouseService }]; }, propDecorators: { classList: [{
|
38
38
|
type: Input
|
39
39
|
}], product: [{
|
@@ -41,4 +41,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
41
41
|
}], withStockHint: [{
|
42
42
|
type: Input
|
43
43
|
}] } });
|
44
|
-
//# sourceMappingURL=data:application/json;base64,
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2MtcHJpY2Utd2FyZWhvdXNlLXN0b2NrLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NsaWVudC11aS9jYXRhbG9nL3ByaWNlLXdhcmVob3VzZS1zdG9jay9zYy1wcmljZS13YXJlaG91c2Utc3RvY2suY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2xpZW50LXVpL2NhdGFsb2cvcHJpY2Utd2FyZWhvdXNlLXN0b2NrL3NjLXByaWNlLXdhcmVob3VzZS1zdG9jay5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUUxRSxPQUFPLEVBQWMsR0FBRyxFQUFFLFNBQVMsRUFBRSxNQUFNLE1BQU0sQ0FBQzs7Ozs7QUFFbEQ7O0dBRUc7QUFPSCxNQUFNLE9BQU8sOEJBQThCO0lBaUN2Qzs7OztPQUlHO0lBQ0gsWUFBb0MsZ0JBQW9DO1FBQXBDLHFCQUFnQixHQUFoQixnQkFB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INC30LDQutCw0Lc8L3NwYW4+XG5cbiAgICAgICAgICAgIDx0dWktc3ZnXG4gICAgICAgICAgICAgICAgKm5nSWY9XCJ3aXRoU3RvY2tIaW50ICYmICh3YXJlaG91c2VzTGlzdCQgfCBhc3luYyk/Lmxlbmd0aFwiXG4gICAgICAgICAgICAgICAgc3JjPVwidHVpSWNvbkluZm9MYXJnZVwiXG4gICAgICAgICAgICAgICAgW3R1aUhpbnRdPVwic3RvY2tIaW50XCJcbiAgICAgICAgICAgICAgICBbdHVpSGludFNob3dEZWxheV09XCIxMDBcIlxuICAgICAgICAgICAgICAgIHR1aUhpbnREaXJlY3Rpb249XCJ0b3BcIlxuICAgICAgICAgICAgICAgIGNsYXNzPVwiIXRleHQteHMgIWgtM1wiXG4gICAgICAgICAgICA+PC90dWktc3ZnPlxuICAgICAgICA8L2Rpdj5cbiAgICA8L25nLWNvbnRhaW5lcj5cbjwvbmctY29udGFpbmVyPlxuXG48bmctdGVtcGxhdGUgI3N0b2NrSGludD5cbiAgICA8dGFibGUgKm5nSWY9XCJzZWxlY3RlZFdhcmVob3VzZSQgfCBhc3luYyBhcyB3YXJlaG91c2VTZWxlY3RcIiBjbGFzcz1cInRleHQteHMgdGFibGUtYXV0b1wiIFtuZ0NsYXNzXT1cImNsYXNzTGlzdFwiPlxuICAgICAgICA8dGJvZHk+XG4gICAgICAgICAgICA8dHIgKm5nRm9yPVwibGV0IGl0ZW0gb2Ygd2FyZWhvdXNlc0xpc3QkIHwgYXN5bmNcIiBjbGFzcz1cImJvcmRlci1iXCI+XG4gICAgICAgICAgICAgICAgPG5nLWNvbnRhaW5lcj5cbiAgICAgICAgICAgICAgICAgICAgPHRkIGNsYXNzPVwicHgtMVwiPnt7IGl0ZW0udz8ubmFtZSB9fTo8L3RkPlxuICAgICAgICAgICAgICAgICAgICA8dGQgY2xhc3M9XCJweC0xXCI+e3sgaXRlbS5zYy5jb3VudCA/IGl0ZW0uc2MuY291bnQgKyAnICcgKyBwcm9kdWN0LnF1YW50aXR5VW5pdCA6ICfQkiDQvdCw0LvQuNGH0LjQuCcgfX08L3RkPlxuICAgICAgICAgICAgICAgIDwvbmctY29udGFpbmVyPlxuICAgICAgICAgICAgPC90cj5cbiAgICAgICAgPC90Ym9keT5cbiAgICA8L3RhYmxlPlxuPC9uZy10ZW1wbGF0ZT5cbiJdfQ==
|
@@ -523,18 +523,18 @@ class ScPriceWarehouseStockComponent {
|
|
523
523
|
/**
|
524
524
|
* {@link Observable} изменения выбранного склада.
|
525
525
|
*/
|
526
|
-
this.
|
526
|
+
this.selectedWarehouse$ = this.warehouseService.getWarehouseSelectChange$();
|
527
527
|
/**
|
528
528
|
* {@link Observable} изменения списка складов.
|
529
529
|
*/
|
530
|
-
this.
|
530
|
+
this.warehousesList$ = this.selectedWarehouse$.pipe(switchMap((warehouse) => this.warehouseService.getWarehouses$().pipe(map((warehouses) => { var _a; return (_a = this.product.stockCount) === null || _a === void 0 ? void 0 : _a.map((sc) => ({ w: warehouses.find((w) => w.id === sc.warehouseId), sc: sc })); }), map((items) => items === null || items === void 0 ? void 0 : items.sort((item) => { var _a; return (((_a = item.w) === null || _a === void 0 ? void 0 : _a.id) === (warehouse === null || warehouse === void 0 ? void 0 : warehouse.id) ? -1 : 1); })))));
|
531
531
|
}
|
532
532
|
}
|
533
533
|
ScPriceWarehouseStockComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScPriceWarehouseStockComponent, deps: [{ token: i1.ScWarehouseService }], target: i0.ɵɵFactoryTarget.Component });
|
534
|
-
ScPriceWarehouseStockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScPriceWarehouseStockComponent, selector: "sc-price-warehouse-stock", inputs: { classList: "classList", product: "product", withStockHint: "withStockHint" }, ngImport: i0, template: "<ng-container *ngIf=\"product\">\n <ng-container>\n <div *ngIf=\"
|
534
|
+
ScPriceWarehouseStockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScPriceWarehouseStockComponent, selector: "sc-price-warehouse-stock", inputs: { classList: "classList", product: "product", withStockHint: "withStockHint" }, ngImport: i0, template: "<ng-container *ngIf=\"product\">\n <ng-container>\n <div *ngIf=\"selectedWarehouse$ | async as warehouseSelect\" class=\"flex items-center gap-1\">\n <span *ngIf=\"product.getNotStockMessage(warehouseSelect) as message\" class=\"text-xs min-w-2/5 text-tui-error-fill\" [ngClass]=\"classList\"> {{ message }} </span>\n <span *ngIf=\"product.isWarehouseStockExist(warehouseSelect.id)\" class=\"text-xs min-w-2/5 text-tui-success-fill\" [ngClass]=\"classList\">\n \u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438<ng-container *ngIf=\"product.getWarehouseStockCount(warehouseSelect.id) as count\"\n >:\n <span class=\"whitespace-nowrap\">{{ count }} {{ product.quantityUnit }}</span>\n </ng-container>\n </span>\n <span *ngIf=\"product.onOrder\" class=\"text-xs min-w-2/5 text-sc-yellow\" [ngClass]=\"classList\">\u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437</span>\n\n <tui-svg\n *ngIf=\"withStockHint && (warehousesList$ | async)?.length\"\n src=\"tuiIconInfoLarge\"\n [tuiHint]=\"stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"!text-xs !h-3\"\n ></tui-svg>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-template #stockHint>\n <table *ngIf=\"selectedWarehouse$ | async as warehouseSelect\" class=\"text-xs table-auto\" [ngClass]=\"classList\">\n <tbody>\n <tr *ngFor=\"let item of warehousesList$ | async\" class=\"border-b\">\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count ? item.sc.count + ' ' + product.quantityUnit : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n </tbody>\n </table>\n</ng-template>\n", styles: ["[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { kind: "directive", type: i3$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container)", inputs: ["tuiHint", "tuiHintContext", "tuiHintAppearance"] }, { kind: "directive", type: i3$1.TuiHintDriverDirective, selector: "[tuiHint]" }, { kind: "directive", type: i3$1.TuiHintHoverDirective, selector: "[tuiHint]:not(ng-container)", inputs: ["tuiHintShowDelay", "tuiHintHideDelay"], exportAs: ["tuiHintHover"] }, { kind: "directive", type: i3$1.TuiHintPositionDirective, selector: "[tuiHint]:not([tuiHintCustomPosition])", inputs: ["tuiHintDirection"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
535
535
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScPriceWarehouseStockComponent, decorators: [{
|
536
536
|
type: Component,
|
537
|
-
args: [{ selector: 'sc-price-warehouse-stock', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"product\">\n <ng-container>\n <div *ngIf=\"
|
537
|
+
args: [{ selector: 'sc-price-warehouse-stock', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"product\">\n <ng-container>\n <div *ngIf=\"selectedWarehouse$ | async as warehouseSelect\" class=\"flex items-center gap-1\">\n <span *ngIf=\"product.getNotStockMessage(warehouseSelect) as message\" class=\"text-xs min-w-2/5 text-tui-error-fill\" [ngClass]=\"classList\"> {{ message }} </span>\n <span *ngIf=\"product.isWarehouseStockExist(warehouseSelect.id)\" class=\"text-xs min-w-2/5 text-tui-success-fill\" [ngClass]=\"classList\">\n \u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438<ng-container *ngIf=\"product.getWarehouseStockCount(warehouseSelect.id) as count\"\n >:\n <span class=\"whitespace-nowrap\">{{ count }} {{ product.quantityUnit }}</span>\n </ng-container>\n </span>\n <span *ngIf=\"product.onOrder\" class=\"text-xs min-w-2/5 text-sc-yellow\" [ngClass]=\"classList\">\u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437</span>\n\n <tui-svg\n *ngIf=\"withStockHint && (warehousesList$ | async)?.length\"\n src=\"tuiIconInfoLarge\"\n [tuiHint]=\"stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"!text-xs !h-3\"\n ></tui-svg>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-template #stockHint>\n <table *ngIf=\"selectedWarehouse$ | async as warehouseSelect\" class=\"text-xs table-auto\" [ngClass]=\"classList\">\n <tbody>\n <tr *ngFor=\"let item of warehousesList$ | async\" class=\"border-b\">\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count ? item.sc.count + ' ' + product.quantityUnit : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n </tbody>\n </table>\n</ng-template>\n", styles: ["[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"] }]
|
538
538
|
}], ctorParameters: function () { return [{ type: i1.ScWarehouseService }]; }, propDecorators: { classList: [{
|
539
539
|
type: Input
|
540
540
|
}], product: [{
|