@snabcentr/client-ui 4.10.1 → 4.11.1
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/auth/sc-sign-in-form/sc-sign-in-form-by-phone/sc-sign-in-form-by-phone.component.d.ts +4 -0
- package/directives/index.d.ts +1 -0
- package/directives/sc-focus-first-invalid-field.directive.d.ts +30 -0
- package/esm2022/auth/sc-sign-in-form/sc-sign-in-form-by-email/sc-sign-in-form-by-email.component.mjs +8 -2
- package/esm2022/auth/sc-sign-in-form/sc-sign-in-form-by-phone/sc-sign-in-form-by-phone.component.mjs +13 -4
- package/esm2022/catalog/price-warehouse-stock/sc-price-warehouse-stock.component.mjs +13 -5
- package/esm2022/directives/index.mjs +2 -1
- package/esm2022/directives/sc-focus-first-invalid-field.directive.mjs +85 -0
- package/fesm2022/snabcentr-client-ui.mjs +112 -8
- package/fesm2022/snabcentr-client-ui.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ import { AbstractTuiControl, TuiInputModule, TuiTextfieldControllerModule, TuiCo
|
|
|
19
19
|
import { getCountries } from 'libphonenumber-js';
|
|
20
20
|
import { isNil, isUndefined, isObject } from 'lodash-es';
|
|
21
21
|
import * as i2$2 from '@angular/common';
|
|
22
|
-
import { CommonModule, NgIf, AsyncPipe, NgFor, NgClass } from '@angular/common';
|
|
22
|
+
import { CommonModule, DOCUMENT, NgIf, AsyncPipe, NgFor, NgClass } from '@angular/common';
|
|
23
23
|
import * as i5 from '@taiga-ui/core/components/label';
|
|
24
24
|
import * as i8 from '@maskito/angular';
|
|
25
25
|
import { MaskitoDirective } from '@maskito/angular';
|
|
@@ -852,6 +852,87 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
852
852
|
}]
|
|
853
853
|
}] });
|
|
854
854
|
|
|
855
|
+
/**
|
|
856
|
+
* Директива для автоматической установки фокуса на первое невалидное поле формы при submit.
|
|
857
|
+
*/
|
|
858
|
+
class ScFocusFirstInvalidFieldDirective {
|
|
859
|
+
constructor() {
|
|
860
|
+
/**
|
|
861
|
+
* Порядок проверки полей формы.
|
|
862
|
+
*/
|
|
863
|
+
this.fieldOrder = input([]);
|
|
864
|
+
/**
|
|
865
|
+
* Объект {@link Document}, предоставляющий доступ к DOM страницы.
|
|
866
|
+
*/
|
|
867
|
+
this.document = inject(DOCUMENT);
|
|
868
|
+
/**
|
|
869
|
+
* Директива формы.
|
|
870
|
+
*/
|
|
871
|
+
this.formGroupDirective = inject(FormGroupDirective);
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Обработчик события submit формы.
|
|
875
|
+
*/
|
|
876
|
+
onSubmit() {
|
|
877
|
+
const { form } = this.formGroupDirective;
|
|
878
|
+
if (this.fieldOrder().length === 0) {
|
|
879
|
+
return;
|
|
880
|
+
}
|
|
881
|
+
if (form.valid) {
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
const firstInvalidFieldName = this.fieldOrder().find((fieldName) => {
|
|
885
|
+
const control = form.get(fieldName);
|
|
886
|
+
return control && control.invalid && !control.disabled;
|
|
887
|
+
});
|
|
888
|
+
const firstInvalidField = firstInvalidFieldName ? form.get(firstInvalidFieldName) : null;
|
|
889
|
+
if (firstInvalidField) {
|
|
890
|
+
firstInvalidField.markAsTouched();
|
|
891
|
+
firstInvalidField.updateValueAndValidity();
|
|
892
|
+
}
|
|
893
|
+
setTimeout(() => {
|
|
894
|
+
this.focusFirstInvalidField(form);
|
|
895
|
+
}, 0);
|
|
896
|
+
}
|
|
897
|
+
/**
|
|
898
|
+
* Устанавливает фокус на первое поле формы с ошибкой.
|
|
899
|
+
*
|
|
900
|
+
* @param form Форма для проверки.
|
|
901
|
+
*/
|
|
902
|
+
focusFirstInvalidField(form) {
|
|
903
|
+
const firstInvalidField = this.fieldOrder().find((fieldName) => {
|
|
904
|
+
const control = form.get(fieldName);
|
|
905
|
+
return control && control.invalid && control.touched && !control.disabled;
|
|
906
|
+
});
|
|
907
|
+
if (!firstInvalidField) {
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
910
|
+
const element = this.document.querySelector(`[formControlName="${firstInvalidField}"]`);
|
|
911
|
+
if (!element) {
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
914
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
915
|
+
const queryResult = element.querySelector('input, select, textarea');
|
|
916
|
+
const nativeElement = element.nativeFocusableElement ?? (queryResult ? queryResult : null) ?? element;
|
|
917
|
+
if (nativeElement instanceof HTMLElement) {
|
|
918
|
+
nativeElement.focus();
|
|
919
|
+
nativeElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScFocusFirstInvalidFieldDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
923
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: ScFocusFirstInvalidFieldDirective, isStandalone: true, selector: "form[formGroup][scFocusFirstInvalidField]", inputs: { fieldOrder: { classPropertyName: "fieldOrder", publicName: "fieldOrder", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "ngSubmit": "onSubmit()" } }, ngImport: i0 }); }
|
|
924
|
+
}
|
|
925
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScFocusFirstInvalidFieldDirective, decorators: [{
|
|
926
|
+
type: Directive,
|
|
927
|
+
args: [{
|
|
928
|
+
standalone: true,
|
|
929
|
+
selector: 'form[formGroup][scFocusFirstInvalidField]',
|
|
930
|
+
host: {
|
|
931
|
+
'(ngSubmit)': 'onSubmit()',
|
|
932
|
+
},
|
|
933
|
+
}]
|
|
934
|
+
}] });
|
|
935
|
+
|
|
855
936
|
/**
|
|
856
937
|
* Директива для обработки события фокуса поля ввода, для последующего выделения содержимого поля ввода.
|
|
857
938
|
*/
|
|
@@ -1573,6 +1654,10 @@ class ScSignInFormByPhoneComponent {
|
|
|
1573
1654
|
* {@link Subject} события отправки формы.
|
|
1574
1655
|
*/
|
|
1575
1656
|
this.onSubmit = new Subject();
|
|
1657
|
+
/**
|
|
1658
|
+
* Сервис для отображения Push-уведомлений с контактами для помощи клиенту.
|
|
1659
|
+
*/
|
|
1660
|
+
this.helpNotificationService = inject(ScHelpNotificationService);
|
|
1576
1661
|
/**
|
|
1577
1662
|
* {@link Observable} запроса данных аутентификации.
|
|
1578
1663
|
*/
|
|
@@ -1582,8 +1667,12 @@ class ScSignInFormByPhoneComponent {
|
|
|
1582
1667
|
if (error instanceof HttpErrorResponse) {
|
|
1583
1668
|
if ('error' in error.error) {
|
|
1584
1669
|
const errorResponse = error.error;
|
|
1585
|
-
if (errorResponse.error.includes('invalid_credentials')) {
|
|
1586
|
-
this.form.setErrors({ serverResponse: ['Неверный
|
|
1670
|
+
if (errorResponse.error.includes('invalid_credentials') && errorResponse.errorDescription?.toLocaleLowerCase().includes('invalid')) {
|
|
1671
|
+
this.form.get('verificationCode')?.setErrors({ serverResponse: ['Неверный СМС-код подтверждения.'] });
|
|
1672
|
+
}
|
|
1673
|
+
else if (errorResponse.error.includes('invalid_grant') && errorResponse.errorDescription?.toLocaleLowerCase().includes('disabled')) {
|
|
1674
|
+
this.form.setErrors({ serverResponse: ['Учетная запись заблокирована, свяжитесь с администратором.'] });
|
|
1675
|
+
this.helpNotificationService.helpNotificationByPhone(value.phone);
|
|
1587
1676
|
}
|
|
1588
1677
|
else {
|
|
1589
1678
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
@@ -1648,10 +1737,16 @@ class ScSignInFormByEmailComponent {
|
|
|
1648
1737
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
1649
1738
|
catchError((error) => {
|
|
1650
1739
|
if (error instanceof HttpErrorResponse) {
|
|
1740
|
+
console.log(error);
|
|
1651
1741
|
if ('error' in error.error) {
|
|
1652
1742
|
const errorResponse = error.error;
|
|
1653
1743
|
if (errorResponse.error.includes('invalid_grant')) {
|
|
1654
|
-
|
|
1744
|
+
if (errorResponse.errorDescription?.toLocaleLowerCase().includes('invalid')) {
|
|
1745
|
+
this.formByEmail.setErrors({ serverResponse: ['Неверный адрес электронной почты или пароль. Проверьте правильность ввода.'] });
|
|
1746
|
+
}
|
|
1747
|
+
if (errorResponse.errorDescription?.toLocaleLowerCase().includes('disabled')) {
|
|
1748
|
+
this.formByEmail.setErrors({ serverResponse: ['Учетная запись заблокирована, свяжитесь с администратором.'] });
|
|
1749
|
+
}
|
|
1655
1750
|
}
|
|
1656
1751
|
else {
|
|
1657
1752
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
@@ -4205,14 +4300,23 @@ class ScPriceWarehouseStockComponent {
|
|
|
4205
4300
|
/** @inheritDoc */
|
|
4206
4301
|
ngOnInit() {
|
|
4207
4302
|
this.selectedWarehouse$ = this.fromMain ? this.warehouseService.getCatalogWarehouseChange$() : this.warehouseService.getWarehouseSelectChange$();
|
|
4208
|
-
this.warehousesList$ = this.selectedWarehouse$.pipe(switchMap((warehouse) => this.warehouseService.getWarehouses$().pipe(map((warehouses) =>
|
|
4303
|
+
this.warehousesList$ = this.selectedWarehouse$.pipe(switchMap((warehouse) => this.warehouseService.getWarehouses$().pipe(map((warehouses) => {
|
|
4304
|
+
const items = warehouses.map((w) => {
|
|
4305
|
+
const stockCount = this.product.stockCount?.find((sc) => sc.warehouseId === w.id);
|
|
4306
|
+
return {
|
|
4307
|
+
w: w,
|
|
4308
|
+
sc: stockCount ?? { warehouseId: w.id, count: 0 },
|
|
4309
|
+
};
|
|
4310
|
+
});
|
|
4311
|
+
return items.sort((item) => (item.w.id === warehouse?.id ? -1 : 1));
|
|
4312
|
+
}))));
|
|
4209
4313
|
}
|
|
4210
4314
|
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 }); }
|
|
4211
|
-
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 ? 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 }); }
|
|
4315
|
+
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 }); }
|
|
4212
4316
|
}
|
|
4213
4317
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScPriceWarehouseStockComponent, decorators: [{
|
|
4214
4318
|
type: Component,
|
|
4215
|
-
args: [{ standalone: true, selector: 'sc-price-warehouse-stock', imports: [CommonModule, RouterModule, TuiTextfieldControllerModule, FormsModule, ReactiveFormsModule, ...TuiHint, TuiLink, TuiLet
|
|
4319
|
+
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"] }]
|
|
4216
4320
|
}], ctorParameters: () => [{ type: i1.ScWarehouseService }], propDecorators: { classList: [{
|
|
4217
4321
|
type: Input
|
|
4218
4322
|
}], product: [{
|
|
@@ -8188,5 +8292,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
8188
8292
|
* Generated bundle index. Do not edit.
|
|
8189
8293
|
*/
|
|
8190
8294
|
|
|
8191
|
-
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_PHONE_APPROVE_CODE_SENDER, SC_PHONE_APPROVE_CODE_SENDER_PROVIDER, 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, 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 };
|
|
8295
|
+
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_PHONE_APPROVE_CODE_SENDER, SC_PHONE_APPROVE_CODE_SENDER_PROVIDER, 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 };
|
|
8192
8296
|
//# sourceMappingURL=snabcentr-client-ui.mjs.map
|