@snabcentr/client-ui 0.7.0 → 0.8.2

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.

Potentially problematic release.


This version of @snabcentr/client-ui might be problematic. Click here for more details.

@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, EventEmitter, Output, Input, NgModule, Directive, HostBinding, ContentChild, Injectable, ElementRef, Inject, ContentChildren, ViewChild, HostListener, ChangeDetectorRef, Optional, Self, inject, InjectionToken, forwardRef } from '@angular/core';
2
+ import { EventEmitter, Component, ChangeDetectionStrategy, Inject, Input, Output, NgModule, Directive, HostBinding, ContentChild, Injectable, ElementRef, ContentChildren, ViewChild, HostListener, ChangeDetectorRef, Optional, Self, inject, InjectionToken, forwardRef } from '@angular/core';
3
3
  import * as i12 from 'rxjs';
4
- import { Subject, filter, map, switchMap, catchError, of, startWith, share, tap, finalize, timer, scan, takeWhile, endWith, distinctUntilChanged, shareReplay, interval, takeUntil, skip, debounceTime, merge } from 'rxjs';
4
+ import { Subject, filter, map, switchMap, tap, catchError, of, finalize, startWith, share, timer, scan, takeWhile, endWith, distinctUntilChanged, shareReplay, interval, takeUntil, skip, debounceTime, merge } from 'rxjs';
5
5
  import * as i1 from '@snabcentr/client-core';
6
6
  import { SC_URLS, SC_PATH_IMAGE_NOT_FOUND, ScCatalogService, ScCartService, ScIconTypesEnum, ScUserService } from '@snabcentr/client-core';
7
7
  import * as i2 from '@angular/common';
@@ -9,9 +9,9 @@ import { CommonModule, formatDate } from '@angular/common';
9
9
  import * as i4 from '@taiga-ui/core';
10
10
  import { TuiTextfieldControllerModule, TuiLinkModule, TuiButtonModule, TuiLabelModule, TuiModeModule, TuiErrorModule, TuiLoaderModule, tuiFadeIn, tuiFormatNumber, TuiSvgModule, TuiHintModule, TuiFormatNumberPipeModule, TuiNotificationModule, TuiFormatPhonePipeModule } from '@taiga-ui/core';
11
11
  import * as i2$1 from '@angular/forms';
12
- import { FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule, NgControl } from '@angular/forms';
12
+ import { FormGroupDirective, FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule, NgControl } from '@angular/forms';
13
13
  import * as i6 from '@taiga-ui/cdk';
14
- import { tuiIsFalsy, TuiLetModule, tuiCreateToken, AbstractTuiNullableControl, TUI_IS_MOBILE, tuiIsPresent, TuiDestroyService, tuiPure } from '@taiga-ui/cdk';
14
+ import { tuiControlValue, tuiIsFalsy, TuiLetModule, tuiCreateToken, AbstractTuiNullableControl, TUI_IS_MOBILE, tuiIsPresent, TuiDestroyService, tuiPure } from '@taiga-ui/cdk';
15
15
  import * as i3 from '@taiga-ui/kit';
16
16
  import { TuiInputPasswordModule, TuiInputModule, TuiFieldErrorPipeModule, TuiInputPhoneModule, TuiAccordionModule, TuiElasticContainerModule, TuiCarouselModule, TUI_NUMBER_VALUE_TRANSFORMER, TuiInputNumberComponent, TuiIslandModule, TuiInputNumberModule, TuiTreeService, TuiTreeItemContentComponent, TUI_TREE_START, TUI_TREE_CONTENT, TUI_TREE_LOADING, TUI_TREE_LOADER, TuiTreeModule, TuiCheckboxLabeledModule } from '@taiga-ui/kit';
17
17
  import * as i7 from '@maskito/angular';
@@ -59,65 +59,34 @@ const phoneApproveCodeMask = {
59
59
  };
60
60
 
61
61
  /**
62
- * Компонент аутентификации по номеру телефона и коду подтверждения.
62
+ * Компонент формы проверки телефона и получения кода подтверждения.
63
63
  */
64
- class ScSignInFormByPhoneComponent {
64
+ class ScPhoneApproveFormComponent {
65
65
  /**
66
- * Инициализирует экземпляр класса {@link ScSignInFormByPhoneComponent}.
66
+ * Инициализирует экземпляр класса {@link ScPhoneApproveFormComponent}.
67
67
  *
68
- * @param authService Сервис аутентификации.
69
68
  * @param verificationService Сервис верификации.
69
+ * @param formGroupDirective Директива c `FormGroup` из DOM.
70
70
  */
71
- constructor(authService, verificationService) {
72
- this.authService = authService;
71
+ constructor(verificationService, formGroupDirective) {
73
72
  this.verificationService = verificationService;
73
+ this.formGroupDirective = formGroupDirective;
74
74
  /**
75
- * Этап процесса аутентификации.
75
+ * Признак, следует ли телефону быть в системе. От этого признака зависит в каких случаях выдавать ошибку при проверки занятости телефона.
76
76
  */
77
- this.haveCode = false;
77
+ this.shouldBeBusy = true;
78
78
  /**
79
- * Группа полей ввода для формы «Вход на сайт».
79
+ * Признак, следует ли проверять подтверждён ли телефона в системе. При `true` будет вызывать ошибку при наличие телефона в системе без подтверждения.
80
80
  */
81
- this.formByPhone = new FormGroup({
82
- phone: new FormControl(null, [Validators.required, Validators.minLength(12)]),
83
- phoneApproveCode: new FormControl(null, [Validators.required, Validators.minLength(6)]),
84
- });
81
+ this.shouldBeConfirmed = false;
85
82
  /**
86
- * {@link Subject} События отправки формы.
83
+ * Наличие кода подтверждения у пользователя.
87
84
  */
88
- this.onSubmit = new Subject();
89
- /**
90
- * {@link Observable} Запроса данных аутентификации.
91
- */
92
- this.phoneRequest$ = this.onSubmit.pipe(filter(() => this.formByPhone.valid), map(() => this.formByPhone.value), switchMap((value) => this.authService.getSignIn$(value).pipe(catchError((error) => {
93
- const errorResponse = error.error;
94
- for (const key in errorResponse.errors) {
95
- this.formByPhone.get(key)?.setErrors({ serverResponse: errorResponse.errors[`${key}`] });
96
- }
97
- if (!errorResponse.errors && errorResponse.message) {
98
- this.formByPhone.setErrors({ serverResponse: [errorResponse.message] });
99
- }
100
- return of({});
101
- }), startWith(null))), share());
85
+ this.haveCode = false;
102
86
  /**
103
- * {@link Observable} Запроса данных получения информации о том свободен ли номер телефона.
87
+ * Событие для обратной привязки наличия кода подтверждения
104
88
  */
105
- this.isPhoneNotBusy$ = this.phoneControl.valueChanges.pipe(tap(() => this.reloadTimer$.next(0)), switchMap((value) => {
106
- if (this.phoneControl.valid && !!value) {
107
- return this.verificationService.getPhoneCheck$(value).pipe(map((result) => result.isBusy), tap((isBusy) => {
108
- if (!isBusy) {
109
- this.phoneControl.setErrors({ serverResponse: ['Пользователя с таким номером телефона не существует'] });
110
- this.phoneControl.markAsTouched();
111
- }
112
- }), catchError((error) => {
113
- const errorResponse = error.error;
114
- this.phoneControl.setErrors({ serverResponse: errorResponse?.errors?.[`phone`] ?? [errorResponse.message] });
115
- return of(false);
116
- }), startWith(null));
117
- }
118
- this.setHaveCode(false);
119
- return of(false);
120
- }), share());
89
+ this.haveCodeChange = new EventEmitter();
121
90
  /**
122
91
  * {@link Subject} События отправки кода подтверждения.
123
92
  */
@@ -143,10 +112,6 @@ class ScSignInFormByPhoneComponent {
143
112
  * Маска поля ввода кода для подтверждения.
144
113
  */
145
114
  this.approveCodeMask = phoneApproveCodeMask;
146
- /**
147
- * {@link Observable} Изменения состояния загрузки данных аутентификации по номеру телефона.
148
- */
149
- this.loadingPhoneAuth$ = this.phoneRequest$.pipe(map(tuiIsFalsy));
150
115
  /**
151
116
  * {@link Subject} События запуска/остановки таймера.
152
117
  */
@@ -162,11 +127,49 @@ class ScSignInFormByPhoneComponent {
162
127
  return `${Math.round(minutes).toString().padStart(2, '0')}:${Math.round(seconds).toString().padStart(2, '0')}`;
163
128
  }), endWith(null), startWith(null), distinctUntilChanged())));
164
129
  }
130
+ /**
131
+ * Группа полей ввода для формы «Вход на сайт».
132
+ */
133
+ get form() {
134
+ return this.formGroupDirective?.form;
135
+ }
165
136
  /**
166
137
  * Поле ввода 'Номер телефона'.
167
138
  */
168
139
  get phoneControl() {
169
- return this.formByPhone.get('phone');
140
+ return this.form?.controls.phone;
141
+ }
142
+ /** @inheritDoc */
143
+ ngOnInit() {
144
+ this.phoneCheck$ = tuiControlValue(this.phoneControl).pipe(tap(() => this.reloadTimer$.next(0)), switchMap((value) => {
145
+ if (this.phoneControl.valid && !!value) {
146
+ return this.verificationService.getPhoneCheck$(value).pipe(map((result) => {
147
+ if (this.shouldBeBusy !== result.isBusy) {
148
+ this.phoneControl.setErrors({
149
+ serverResponse: [
150
+ this.shouldBeBusy ? 'Пользователя с таким номером телефона не существует' : 'Пользователь с таким номером телефона уже существует',
151
+ ],
152
+ });
153
+ this.phoneControl.markAsTouched();
154
+ return false;
155
+ }
156
+ if (this.shouldBeConfirmed && result.isConfirmed === false) {
157
+ this.phoneControl.setErrors({
158
+ serverResponse: ['Номер телефона не подтверждён. Обратитесь к вашему персональному менеджеру или войдите с использованием e-mail и пароля.'],
159
+ });
160
+ this.phoneControl.markAsTouched();
161
+ return false;
162
+ }
163
+ return true;
164
+ }), catchError((error) => {
165
+ const errorResponse = error.error;
166
+ this.phoneControl.setErrors({ serverResponse: errorResponse?.errors?.[`phone`] ?? [errorResponse.message] });
167
+ return of(false);
168
+ }), startWith(null));
169
+ }
170
+ this.setHaveCode(false);
171
+ return of(false);
172
+ }), share());
170
173
  }
171
174
  /**
172
175
  * Устанавливает состояние наличия кода подтверждения у пользователя.
@@ -175,14 +178,79 @@ class ScSignInFormByPhoneComponent {
175
178
  */
176
179
  setHaveCode(haveCode) {
177
180
  this.haveCode = haveCode;
181
+ this.haveCodeChange.emit(haveCode);
182
+ }
183
+ }
184
+ ScPhoneApproveFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScPhoneApproveFormComponent, deps: [{ token: i1.ScVerificationService }, { token: FormGroupDirective }], target: i0.ɵɵFactoryTarget.Component });
185
+ ScPhoneApproveFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScPhoneApproveFormComponent, selector: "sc-phone-approve-form", inputs: { shouldBeBusy: "shouldBeBusy", shouldBeConfirmed: "shouldBeConfirmed", haveCode: "haveCode" }, outputs: { haveCodeChange: "haveCodeChange" }, ngImport: i0, template: "<form [formGroup]=\"form\" *tuiLet=\"(loadingApproveCode$ | async) as loadingApproveCode\" class=\"flex flex-col gap-3\">\n <label tuiLabel=\"\u041D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430\">\n <tui-input-phone formControlName=\"phone\" [tuiTextfieldCustomContent]=\"checkingPhone\">\n \u041D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430\n <input tuiTextfield autocomplete=\"phone\" />\n </tui-input-phone>\n <tui-error formControlName=\"phone\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n\n <label *ngIf=\"loadingApproveCode === false && haveCode\" tuiLabel=\"\u041A\u043E\u0434 \u0438\u0437 \u0421\u041C\u0421\">\n <tui-input formControlName=\"phoneApproveCode\">\n \u041A\u043E\u0434 \u0438\u0437 \u0421\u041C\u0421\n <input tuiTextfield [maskito]=\"approveCodeMask\" autocomplete=\"new-password\" />\n </tui-input>\n <tui-error formControlName=\"phoneApproveCode\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n\n <div *tuiLet=\"!!loadingApproveCode as loadingApproveCode\" class=\"flex gap-4 justify-center\">\n <button\n *ngIf=\"!haveCode\"\n tuiButton\n size=\"s\"\n (click)=\"onSendCode.next()\"\n [disabled]=\"loadingApproveCode || !!!(phoneCheck$ | async) || phoneControl.invalid\"\n [showLoader]=\"loadingApproveCode\"\n icon=\"scIconLogIn\"\n >\n \u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043A\u043E\u0434\n </button>\n <button *ngIf=\"!loadingApproveCode && !haveCode\" tuiLink [pseudo]=\"true\" [disabled]=\"!!!(phoneCheck$ | async) || phoneControl.invalid\" (click)=\"setHaveCode(true)\">\n \u0423 \u043C\u0435\u043D\u044F \u0435\u0441\u0442\u044C \u043A\u043E\u0434\n </button>\n\n <ng-container *tuiLet=\"timer$ | async as timer\">\n <tui-loader *ngIf=\"haveCode\" [showLoader]=\"loadingApproveCode\">\n <button tuiLink [pseudo]=\"true\" [disabled]=\"loadingApproveCode || timer\" (click)=\"onSendCode.next()\">\n \u041F\u043E\u0432\u0442\u043E\u0440\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u0434\n <ng-container *ngIf=\"timer\" class=\"!text-tui-base-08\">(\u0447\u0435\u0440\u0435\u0437 {{ timer }})</ng-container>\n </button>\n </tui-loader>\n </ng-container>\n </div>\n</form>\n\n<ng-template #checkingPhone>\n <tui-loader *ngIf=\"!!!(phoneCheck$ | async) && phoneControl.valid\" class=\"w-4 h-4\"> </tui-loader>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.TuiTextfieldComponent, selector: "input[tuiTextfield], textarea[tuiTextfield]" }, { kind: "component", type: i3.TuiInputComponent, selector: "tui-input" }, { kind: "directive", type: i3.TuiInputDirective, selector: "tui-input" }, { kind: "directive", type: i4.TuiTextfieldCustomContentDirective, selector: "[tuiTextfieldCustomContent]", inputs: ["tuiTextfieldCustomContent"] }, { kind: "component", type: i4.TuiLinkComponent, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo", "icon", "iconAlign", "iconRotated", "mode"], exportAs: ["tuiLink"] }, { kind: "component", type: i4.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { kind: "component", type: i4.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { kind: "component", type: i4.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i6.TuiLetDirective, selector: "[tuiLet]", inputs: ["tuiLet"] }, { kind: "component", type: i4.TuiLoaderComponent, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "showLoader"] }, { kind: "component", type: i3.TuiInputPhoneComponent, selector: "tui-input-phone", inputs: ["countryCode", "phoneMaskAfterCountryCode", "allowText", "search"], outputs: ["searchChange"] }, { kind: "directive", type: i3.TuiInputPhoneDirective, selector: "tui-input-phone" }, { kind: "directive", type: i7.MaskitoDirective, selector: "[maskito]", inputs: ["maskito", "maskitoElement"] }, { kind: "directive", type: i7.MaskitoCva, selector: "input[maskito], textarea[maskito]", inputs: ["maskito"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.TuiFieldErrorPipe, name: "tuiFieldError" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScPhoneApproveFormComponent, decorators: [{
187
+ type: Component,
188
+ args: [{ selector: 'sc-phone-approve-form', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"form\" *tuiLet=\"(loadingApproveCode$ | async) as loadingApproveCode\" class=\"flex flex-col gap-3\">\n <label tuiLabel=\"\u041D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430\">\n <tui-input-phone formControlName=\"phone\" [tuiTextfieldCustomContent]=\"checkingPhone\">\n \u041D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430\n <input tuiTextfield autocomplete=\"phone\" />\n </tui-input-phone>\n <tui-error formControlName=\"phone\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n\n <label *ngIf=\"loadingApproveCode === false && haveCode\" tuiLabel=\"\u041A\u043E\u0434 \u0438\u0437 \u0421\u041C\u0421\">\n <tui-input formControlName=\"phoneApproveCode\">\n \u041A\u043E\u0434 \u0438\u0437 \u0421\u041C\u0421\n <input tuiTextfield [maskito]=\"approveCodeMask\" autocomplete=\"new-password\" />\n </tui-input>\n <tui-error formControlName=\"phoneApproveCode\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n\n <div *tuiLet=\"!!loadingApproveCode as loadingApproveCode\" class=\"flex gap-4 justify-center\">\n <button\n *ngIf=\"!haveCode\"\n tuiButton\n size=\"s\"\n (click)=\"onSendCode.next()\"\n [disabled]=\"loadingApproveCode || !!!(phoneCheck$ | async) || phoneControl.invalid\"\n [showLoader]=\"loadingApproveCode\"\n icon=\"scIconLogIn\"\n >\n \u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043A\u043E\u0434\n </button>\n <button *ngIf=\"!loadingApproveCode && !haveCode\" tuiLink [pseudo]=\"true\" [disabled]=\"!!!(phoneCheck$ | async) || phoneControl.invalid\" (click)=\"setHaveCode(true)\">\n \u0423 \u043C\u0435\u043D\u044F \u0435\u0441\u0442\u044C \u043A\u043E\u0434\n </button>\n\n <ng-container *tuiLet=\"timer$ | async as timer\">\n <tui-loader *ngIf=\"haveCode\" [showLoader]=\"loadingApproveCode\">\n <button tuiLink [pseudo]=\"true\" [disabled]=\"loadingApproveCode || timer\" (click)=\"onSendCode.next()\">\n \u041F\u043E\u0432\u0442\u043E\u0440\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u0434\n <ng-container *ngIf=\"timer\" class=\"!text-tui-base-08\">(\u0447\u0435\u0440\u0435\u0437 {{ timer }})</ng-container>\n </button>\n </tui-loader>\n </ng-container>\n </div>\n</form>\n\n<ng-template #checkingPhone>\n <tui-loader *ngIf=\"!!!(phoneCheck$ | async) && phoneControl.valid\" class=\"w-4 h-4\"> </tui-loader>\n</ng-template>\n" }]
189
+ }], ctorParameters: function () { return [{ type: i1.ScVerificationService }, { type: i2$1.FormGroupDirective, decorators: [{
190
+ type: Inject,
191
+ args: [FormGroupDirective]
192
+ }] }]; }, propDecorators: { shouldBeBusy: [{
193
+ type: Input
194
+ }], shouldBeConfirmed: [{
195
+ type: Input
196
+ }], haveCode: [{
197
+ type: Input
198
+ }], haveCodeChange: [{
199
+ type: Output
200
+ }] } });
201
+
202
+ /**
203
+ * Компонент аутентификации по номеру телефона и коду подтверждения.
204
+ */
205
+ class ScSignInFormByPhoneComponent {
206
+ /**
207
+ * Инициализирует экземпляр класса {@link ScSignInFormByPhoneComponent}.
208
+ *
209
+ * @param authService Сервис аутентификации.
210
+ * @param verificationService Сервис верификации.
211
+ */
212
+ constructor(authService) {
213
+ this.authService = authService;
214
+ /**
215
+ * Наличие кода подтверждения у пользователя.
216
+ */
217
+ this.haveCode = false;
218
+ /**
219
+ * Группа полей ввода для формы «Вход на сайт».
220
+ */
221
+ this.formByPhone = new FormGroup({
222
+ phone: new FormControl(null, [Validators.required, Validators.minLength(12)]),
223
+ phoneApproveCode: new FormControl(null, [Validators.required, Validators.minLength(6)]),
224
+ });
225
+ /**
226
+ * {@link Subject} События отправки формы.
227
+ */
228
+ this.onSubmit = new Subject();
229
+ /**
230
+ * {@link Observable} Запроса данных аутентификации.
231
+ */
232
+ this.phoneRequest$ = this.onSubmit.pipe(filter(() => this.formByPhone.valid), map(() => this.formByPhone.value), switchMap((value) => this.authService.getSignIn$(value).pipe(catchError((error) => {
233
+ const errorResponse = error.error;
234
+ for (const key in errorResponse.errors) {
235
+ this.formByPhone.get(key)?.setErrors({ serverResponse: errorResponse.errors[`${key}`] });
236
+ }
237
+ if (!errorResponse.errors && errorResponse.message) {
238
+ this.formByPhone.setErrors({ serverResponse: [errorResponse.message] });
239
+ }
240
+ return of({});
241
+ }), startWith(null))), share());
242
+ /**
243
+ * {@link Observable} Изменения состояния загрузки данных аутентификации по номеру телефона.
244
+ */
245
+ this.loadingPhoneAuth$ = this.phoneRequest$.pipe(map(tuiIsFalsy));
178
246
  }
179
247
  }
180
- ScSignInFormByPhoneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScSignInFormByPhoneComponent, deps: [{ token: i1.ScAuthService }, { token: i1.ScVerificationService }], target: i0.ɵɵFactoryTarget.Component });
181
- ScSignInFormByPhoneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScSignInFormByPhoneComponent, selector: "sc-sign-in-form-by-phone", ngImport: i0, template: "<form [formGroup]=\"formByPhone\" *tuiLet=\"(loadingApproveCode$ | async) as loadingApproveCode\" (ngSubmit)=\"onSubmit.next()\">\n <div class=\"flex flex-col gap-4 mb-8\">\n <label tuiLabel=\"\u041D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430\">\n <tui-input-phone formControlName=\"phone\" [tuiTextfieldCustomContent]=\"checkingPhone\">\n \u041D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430\n <input tuiTextfield autocomplete=\"phone\" />\n </tui-input-phone>\n <tui-error formControlName=\"phone\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <tui-error [error]=\"[] | tuiFieldError | async\"></tui-error>\n\n <label *ngIf=\"loadingApproveCode === false && haveCode\" tuiLabel=\"\u041A\u043E\u0434 \u0438\u0437 \u0421\u041C\u0421\">\n <tui-input formControlName=\"phoneApproveCode\">\n \u041A\u043E\u0434 \u0438\u0437 \u0421\u041C\u0421\n <input tuiTextfield [maskito]=\"approveCodeMask\" autocomplete=\"new-password\" />\n </tui-input>\n <tui-error formControlName=\"phoneApproveCode\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n </div>\n\n <div *tuiLet=\"!!loadingApproveCode as loadingApproveCode\" class=\"flex flex-col gap-4 items-center mb-4\">\n <button\n *ngIf=\"!haveCode\"\n tuiButton\n size=\"s\"\n (click)=\"onSendCode.next()\"\n [disabled]=\"loadingApproveCode || !!!(isPhoneNotBusy$ | async) || phoneControl.invalid\"\n [showLoader]=\"loadingApproveCode\"\n icon=\"scIconLogIn\"\n >\n \u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043A\u043E\u0434\n </button>\n <button *ngIf=\"!loadingApproveCode && !haveCode\" tuiLink [pseudo]=\"true\" [disabled]=\"!!!(isPhoneNotBusy$ | async) || phoneControl.invalid\" (click)=\"setHaveCode(true)\">\n \u0423 \u043C\u0435\u043D\u044F \u0435\u0441\u0442\u044C \u043A\u043E\u0434\n </button>\n\n <ng-container *tuiLet=\"timer$ | async as timer\">\n <tui-loader *ngIf=\"haveCode\" [showLoader]=\"loadingApproveCode\">\n <button tuiLink [pseudo]=\"true\" [disabled]=\"loadingApproveCode || timer\" (click)=\"onSendCode.next()\">\n \u041F\u043E\u0432\u0442\u043E\u0440\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u0434\n <ng-container *ngIf=\"timer\" class=\"!text-tui-base-08\">(\u0447\u0435\u0440\u0435\u0437 {{ timer }})</ng-container>\n </button>\n </tui-loader>\n </ng-container>\n <button\n *ngIf=\"haveCode\"\n tuiButton\n size=\"s\"\n type=\"submit\"\n [showLoader]=\"!!(loadingPhoneAuth$ | async)\"\n [disabled]=\"formByPhone.invalid || !!(loadingPhoneAuth$ | async)\"\n icon=\"scIconLogIn\"\n >\n \u0412\u043E\u0439\u0442\u0438\n </button>\n </div>\n</form>\n\n<ng-template #checkingPhone>\n <tui-loader *ngIf=\"!!!(isPhoneNotBusy$ | async) && phoneControl.valid\" class=\"w-4 h-4\"> </tui-loader>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.TuiTextfieldComponent, selector: "input[tuiTextfield], textarea[tuiTextfield]" }, { kind: "component", type: i3.TuiInputComponent, selector: "tui-input" }, { kind: "directive", type: i3.TuiInputDirective, selector: "tui-input" }, { kind: "directive", type: i4.TuiTextfieldCustomContentDirective, selector: "[tuiTextfieldCustomContent]", inputs: ["tuiTextfieldCustomContent"] }, { kind: "component", type: i4.TuiLinkComponent, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo", "icon", "iconAlign", "iconRotated", "mode"], exportAs: ["tuiLink"] }, { kind: "component", type: i4.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { kind: "component", type: i4.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { kind: "component", type: i4.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i6.TuiLetDirective, selector: "[tuiLet]", inputs: ["tuiLet"] }, { kind: "component", type: i4.TuiLoaderComponent, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "showLoader"] }, { kind: "component", type: i3.TuiInputPhoneComponent, selector: "tui-input-phone", inputs: ["countryCode", "phoneMaskAfterCountryCode", "allowText", "search"], outputs: ["searchChange"] }, { kind: "directive", type: i3.TuiInputPhoneDirective, selector: "tui-input-phone" }, { kind: "directive", type: i7.MaskitoDirective, selector: "[maskito]", inputs: ["maskito", "maskitoElement"] }, { kind: "directive", type: i7.MaskitoCva, selector: "input[maskito], textarea[maskito]", inputs: ["maskito"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.TuiFieldErrorPipe, name: "tuiFieldError" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
248
+ ScSignInFormByPhoneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScSignInFormByPhoneComponent, deps: [{ token: i1.ScAuthService }], target: i0.ɵɵFactoryTarget.Component });
249
+ ScSignInFormByPhoneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScSignInFormByPhoneComponent, selector: "sc-sign-in-form-by-phone", ngImport: i0, template: "<form [formGroup]=\"formByPhone\" (ngSubmit)=\"onSubmit.next()\" class=\"flex flex-col gap-4 items-center mb-4\">\n <sc-phone-approve-form [(haveCode)]=\"haveCode\" class=\"w-full\"></sc-phone-approve-form>\n <button\n *ngIf=\"haveCode\"\n tuiButton\n size=\"s\"\n type=\"submit\"\n [showLoader]=\"!!(loadingPhoneAuth$ | async)\"\n [disabled]=\"formByPhone.invalid || !!(loadingPhoneAuth$ | async)\"\n icon=\"scIconLogIn\"\n >\n \u0412\u043E\u0439\u0442\u0438\n </button>\n</form>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { kind: "component", type: ScPhoneApproveFormComponent, selector: "sc-phone-approve-form", inputs: ["shouldBeBusy", "shouldBeConfirmed", "haveCode"], outputs: ["haveCodeChange"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
182
250
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScSignInFormByPhoneComponent, decorators: [{
183
251
  type: Component,
184
- args: [{ selector: 'sc-sign-in-form-by-phone', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"formByPhone\" *tuiLet=\"(loadingApproveCode$ | async) as loadingApproveCode\" (ngSubmit)=\"onSubmit.next()\">\n <div class=\"flex flex-col gap-4 mb-8\">\n <label tuiLabel=\"\u041D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430\">\n <tui-input-phone formControlName=\"phone\" [tuiTextfieldCustomContent]=\"checkingPhone\">\n \u041D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430\n <input tuiTextfield autocomplete=\"phone\" />\n </tui-input-phone>\n <tui-error formControlName=\"phone\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <tui-error [error]=\"[] | tuiFieldError | async\"></tui-error>\n\n <label *ngIf=\"loadingApproveCode === false && haveCode\" tuiLabel=\"\u041A\u043E\u0434 \u0438\u0437 \u0421\u041C\u0421\">\n <tui-input formControlName=\"phoneApproveCode\">\n \u041A\u043E\u0434 \u0438\u0437 \u0421\u041C\u0421\n <input tuiTextfield [maskito]=\"approveCodeMask\" autocomplete=\"new-password\" />\n </tui-input>\n <tui-error formControlName=\"phoneApproveCode\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n </div>\n\n <div *tuiLet=\"!!loadingApproveCode as loadingApproveCode\" class=\"flex flex-col gap-4 items-center mb-4\">\n <button\n *ngIf=\"!haveCode\"\n tuiButton\n size=\"s\"\n (click)=\"onSendCode.next()\"\n [disabled]=\"loadingApproveCode || !!!(isPhoneNotBusy$ | async) || phoneControl.invalid\"\n [showLoader]=\"loadingApproveCode\"\n icon=\"scIconLogIn\"\n >\n \u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043A\u043E\u0434\n </button>\n <button *ngIf=\"!loadingApproveCode && !haveCode\" tuiLink [pseudo]=\"true\" [disabled]=\"!!!(isPhoneNotBusy$ | async) || phoneControl.invalid\" (click)=\"setHaveCode(true)\">\n \u0423 \u043C\u0435\u043D\u044F \u0435\u0441\u0442\u044C \u043A\u043E\u0434\n </button>\n\n <ng-container *tuiLet=\"timer$ | async as timer\">\n <tui-loader *ngIf=\"haveCode\" [showLoader]=\"loadingApproveCode\">\n <button tuiLink [pseudo]=\"true\" [disabled]=\"loadingApproveCode || timer\" (click)=\"onSendCode.next()\">\n \u041F\u043E\u0432\u0442\u043E\u0440\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u0434\n <ng-container *ngIf=\"timer\" class=\"!text-tui-base-08\">(\u0447\u0435\u0440\u0435\u0437 {{ timer }})</ng-container>\n </button>\n </tui-loader>\n </ng-container>\n <button\n *ngIf=\"haveCode\"\n tuiButton\n size=\"s\"\n type=\"submit\"\n [showLoader]=\"!!(loadingPhoneAuth$ | async)\"\n [disabled]=\"formByPhone.invalid || !!(loadingPhoneAuth$ | async)\"\n icon=\"scIconLogIn\"\n >\n \u0412\u043E\u0439\u0442\u0438\n </button>\n </div>\n</form>\n\n<ng-template #checkingPhone>\n <tui-loader *ngIf=\"!!!(isPhoneNotBusy$ | async) && phoneControl.valid\" class=\"w-4 h-4\"> </tui-loader>\n</ng-template>\n" }]
185
- }], ctorParameters: function () { return [{ type: i1.ScAuthService }, { type: i1.ScVerificationService }]; } });
252
+ args: [{ selector: 'sc-sign-in-form-by-phone', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"formByPhone\" (ngSubmit)=\"onSubmit.next()\" class=\"flex flex-col gap-4 items-center mb-4\">\n <sc-phone-approve-form [(haveCode)]=\"haveCode\" class=\"w-full\"></sc-phone-approve-form>\n <button\n *ngIf=\"haveCode\"\n tuiButton\n size=\"s\"\n type=\"submit\"\n [showLoader]=\"!!(loadingPhoneAuth$ | async)\"\n [disabled]=\"formByPhone.invalid || !!(loadingPhoneAuth$ | async)\"\n icon=\"scIconLogIn\"\n >\n \u0412\u043E\u0439\u0442\u0438\n </button>\n</form>\n" }]
253
+ }], ctorParameters: function () { return [{ type: i1.ScAuthService }]; } });
186
254
 
187
255
  /**
188
256
  * Компонент аутентификации по адресу электронной почты и паролю.
@@ -300,6 +368,70 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
300
368
  type: Output
301
369
  }] } });
302
370
 
371
+ /**
372
+ * Модуль отправки кодов подтверждения (номера телефона, адреса эл. почты и т.д.).
373
+ */
374
+ class ScVerificationModule {
375
+ }
376
+ ScVerificationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScVerificationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
377
+ ScVerificationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: ScVerificationModule, declarations: [ScPhoneApproveFormComponent], imports: [CommonModule,
378
+ FormsModule,
379
+ ReactiveFormsModule,
380
+ TuiInputPasswordModule,
381
+ TuiInputModule,
382
+ TuiTextfieldControllerModule,
383
+ TuiLinkModule,
384
+ TuiButtonModule,
385
+ TuiLabelModule,
386
+ TuiModeModule,
387
+ TuiFieldErrorPipeModule,
388
+ TuiErrorModule,
389
+ TuiLetModule,
390
+ TuiLoaderModule,
391
+ TuiInputPhoneModule,
392
+ MaskitoModule], exports: [ScPhoneApproveFormComponent] });
393
+ ScVerificationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScVerificationModule, imports: [CommonModule,
394
+ FormsModule,
395
+ ReactiveFormsModule,
396
+ TuiInputPasswordModule,
397
+ TuiInputModule,
398
+ TuiTextfieldControllerModule,
399
+ TuiLinkModule,
400
+ TuiButtonModule,
401
+ TuiLabelModule,
402
+ TuiModeModule,
403
+ TuiFieldErrorPipeModule,
404
+ TuiErrorModule,
405
+ TuiLetModule,
406
+ TuiLoaderModule,
407
+ TuiInputPhoneModule,
408
+ MaskitoModule] });
409
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScVerificationModule, decorators: [{
410
+ type: NgModule,
411
+ args: [{
412
+ imports: [
413
+ CommonModule,
414
+ FormsModule,
415
+ ReactiveFormsModule,
416
+ TuiInputPasswordModule,
417
+ TuiInputModule,
418
+ TuiTextfieldControllerModule,
419
+ TuiLinkModule,
420
+ TuiButtonModule,
421
+ TuiLabelModule,
422
+ TuiModeModule,
423
+ TuiFieldErrorPipeModule,
424
+ TuiErrorModule,
425
+ TuiLetModule,
426
+ TuiLoaderModule,
427
+ TuiInputPhoneModule,
428
+ MaskitoModule,
429
+ ],
430
+ exports: [ScPhoneApproveFormComponent],
431
+ declarations: [ScPhoneApproveFormComponent],
432
+ }]
433
+ }] });
434
+
303
435
  /**
304
436
  * Модуль аутентификации.
305
437
  */
@@ -321,7 +453,8 @@ ScAuthModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
321
453
  TuiLetModule,
322
454
  TuiLoaderModule,
323
455
  TuiInputPhoneModule,
324
- MaskitoModule], exports: [ScSignInFormComponent, ScSignInFormByPhoneComponent, ScSignInFormByEmailComponent] });
456
+ MaskitoModule,
457
+ ScVerificationModule], exports: [ScSignInFormComponent, ScSignInFormByPhoneComponent, ScSignInFormByEmailComponent] });
325
458
  ScAuthModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScAuthModule, imports: [CommonModule,
326
459
  FormsModule,
327
460
  ReactiveFormsModule,
@@ -337,7 +470,8 @@ ScAuthModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
337
470
  TuiLetModule,
338
471
  TuiLoaderModule,
339
472
  TuiInputPhoneModule,
340
- MaskitoModule] });
473
+ MaskitoModule,
474
+ ScVerificationModule] });
341
475
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScAuthModule, decorators: [{
342
476
  type: NgModule,
343
477
  args: [{
@@ -359,6 +493,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
359
493
  TuiLoaderModule,
360
494
  TuiInputPhoneModule,
361
495
  MaskitoModule,
496
+ ScVerificationModule,
362
497
  ],
363
498
  exports: [ScSignInFormComponent, ScSignInFormByPhoneComponent, ScSignInFormByEmailComponent],
364
499
  }]
@@ -1077,6 +1212,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
1077
1212
  type: Output
1078
1213
  }] } });
1079
1214
 
1215
+ /**
1216
+ * Компонент списка категорий.
1217
+ */
1218
+ class ScCategoriesListComponent {
1219
+ /**
1220
+ * Инициализирует экземпляр класса {@link ScCategoriesListComponent}.
1221
+ *
1222
+ * @param urls объект информации о базовом списке ссылок приложения.
1223
+ */
1224
+ constructor(urls) {
1225
+ this.urls = urls;
1226
+ /**
1227
+ * Событие нажатия на категорию.
1228
+ */
1229
+ this.clickCategoryEvent = new EventEmitter();
1230
+ }
1231
+ /**
1232
+ * Возвращает путь до изображения на сервере.
1233
+ *
1234
+ * @param imgPath путь, где хранится изображение.
1235
+ */
1236
+ getCategoryImage(imgPath) {
1237
+ return this.urls.imgServerUrl + '/' + imgPath;
1238
+ }
1239
+ }
1240
+ ScCategoriesListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScCategoriesListComponent, deps: [{ token: SC_URLS }], target: i0.ɵɵFactoryTarget.Component });
1241
+ 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=\"flex flex-col\">\n <ng-container *ngIf=\"categories; else categoriesSkeleton\">\n <button *ngFor=\"let item of $any(categories)\" class=\"flex flex-row h-11 w-full border-b justify-between items-center py-7\" (click)=\"clickCategoryEvent.emit(item)\">\n <p class=\"truncate mr-0 text-left font-bold max-w-[85%]\">{{ item.name }}</p>\n <tui-svg *ngIf=\"item.isFavorite\" src=\"scIconFavoriteFill\" class=\"text-tui-primary !text-xs mr-auto\"></tui-svg>\n <img *ngIf=\"item.properties?.image\" [src]=\"getCategoryImage(item.properties?.image)\" [alt]=\"item.name\" class=\"w-6 h-6 ml-auto\" />\n <i *ngIf=\"item.properties?.['icon'] && !item.properties?.image\" class=\"{{ item.properties?.['icon'] }} w-6 h-6 ml-auto\"></i>\n </button>\n </ng-container>\n</div>\n\n<ng-template #categoriesSkeleton>\n <button\n *ngFor=\"let _ of [].constructor(10); let index = index\"\n tuiButton\n size=\"m\"\n appearance=\"secondary\"\n tuiMode=\"onLight\"\n style.width=\"{{ ((index % 3) + 3) * 20 }}%\"\n class=\"!flex-shrink tui-skeleton my-4\"\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.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }, { kind: "component", type: i4.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { kind: "directive", type: i4.TuiModeDirective, selector: "[tuiMode]", inputs: ["tuiMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScCategoriesListComponent, decorators: [{
1243
+ type: Component,
1244
+ args: [{ selector: 'sc-categories-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col\">\n <ng-container *ngIf=\"categories; else categoriesSkeleton\">\n <button *ngFor=\"let item of $any(categories)\" class=\"flex flex-row h-11 w-full border-b justify-between items-center py-7\" (click)=\"clickCategoryEvent.emit(item)\">\n <p class=\"truncate mr-0 text-left font-bold max-w-[85%]\">{{ item.name }}</p>\n <tui-svg *ngIf=\"item.isFavorite\" src=\"scIconFavoriteFill\" class=\"text-tui-primary !text-xs mr-auto\"></tui-svg>\n <img *ngIf=\"item.properties?.image\" [src]=\"getCategoryImage(item.properties?.image)\" [alt]=\"item.name\" class=\"w-6 h-6 ml-auto\" />\n <i *ngIf=\"item.properties?.['icon'] && !item.properties?.image\" class=\"{{ item.properties?.['icon'] }} w-6 h-6 ml-auto\"></i>\n </button>\n </ng-container>\n</div>\n\n<ng-template #categoriesSkeleton>\n <button\n *ngFor=\"let _ of [].constructor(10); let index = index\"\n tuiButton\n size=\"m\"\n appearance=\"secondary\"\n tuiMode=\"onLight\"\n style.width=\"{{ ((index % 3) + 3) * 20 }}%\"\n class=\"!flex-shrink tui-skeleton my-4\"\n ></button>\n</ng-template>\n" }]
1245
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1246
+ type: Inject,
1247
+ args: [SC_URLS]
1248
+ }] }]; }, propDecorators: { categories: [{
1249
+ type: Input
1250
+ }], clickCategoryEvent: [{
1251
+ type: Output
1252
+ }] } });
1253
+
1080
1254
  /**
1081
1255
  * Компонент кнопки избранных товаров и категорий.
1082
1256
  */
@@ -1809,7 +1983,8 @@ ScCatalogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
1809
1983
  ScInputQuantityComponent,
1810
1984
  ScPriceCardComponent,
1811
1985
  ScPriceWarehouseStockComponent,
1812
- ScPriceHistoryComponent], imports: [CommonModule,
1986
+ ScPriceHistoryComponent,
1987
+ ScCategoriesListComponent], imports: [CommonModule,
1813
1988
  RouterModule,
1814
1989
  TuiButtonModule,
1815
1990
  TuiSvgModule,
@@ -1830,7 +2005,8 @@ ScCatalogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
1830
2005
  ScInputQuantityComponent,
1831
2006
  ScPriceCardComponent,
1832
2007
  ScPriceWarehouseStockComponent,
1833
- ScPriceHistoryComponent] });
2008
+ ScPriceHistoryComponent,
2009
+ ScCategoriesListComponent] });
1834
2010
  ScCatalogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScCatalogModule, imports: [CommonModule,
1835
2011
  RouterModule,
1836
2012
  TuiButtonModule,
@@ -1860,6 +2036,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
1860
2036
  ScPriceCardComponent,
1861
2037
  ScPriceWarehouseStockComponent,
1862
2038
  ScPriceHistoryComponent,
2039
+ ScCategoriesListComponent,
1863
2040
  ],
1864
2041
  exports: [
1865
2042
  ScPriceListPaginationComponent,
@@ -1869,6 +2046,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
1869
2046
  ScPriceCardComponent,
1870
2047
  ScPriceWarehouseStockComponent,
1871
2048
  ScPriceHistoryComponent,
2049
+ ScCategoriesListComponent,
1872
2050
  ],
1873
2051
  imports: [
1874
2052
  CommonModule,
@@ -3045,5 +3223,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
3045
3223
  * Generated bundle index. Do not edit.
3046
3224
  */
3047
3225
 
3048
- export { AuthMethod, FilesAndDocumentsComponent, FilesAndDocumentsModule, SC_LINEAR_VALUES, SC_LINEAR_VALUES_TOKEN, SC_LOADING_PAGINATION_CHANGE_INFO, SC_NEXT_PAGE_PAGINATION_CHANGE_INFO, SC_NEXT_PAGE_PAGINATION_CLICK, SC_PRODUCT_PAGINATION_CHANGE_INFO, SC_PRODUCT_PAGINATION_CHANGE_PROVIDERS, SC_PRODUCT_PAGINATION_DEFAULT_OPTIONS, SC_PRODUCT_PAGINATION_OPTIONS, SC_PRODUCT_PAGINATION_PARAMS, SC_USER_INFO, SC_USER_PROVIDERS, ScAccordionComponent, ScAccordionContentDirective, ScAccordionModule, ScAuthModule, ScBannerComponent, ScBannerModule, ScCartItemMobileComponent, ScCartModule, ScCatalogModule, ScCategoryCardComponent, ScContactsAccordionComponent, ScContactsModule, ScContragentsAccordionComponent, ScContragentsAccordionItemComponent, ScContragentsModule, ScDeliveryAddressAccordionComponent, ScDeliveryAddressAccordionItemComponent, ScDeliveryAddressModule, ScFavoriteBtnComponent, ScInputQuantityComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNewsModule, ScOrderItemMobileComponent, ScOrderModule, ScPriceCardComponent, ScPriceHistoryComponent, ScPriceListPaginationComponent, ScPriceWarehouseStockComponent, ScProfileAccordionsContentComponent, ScProfileModule, ScResetUserPasswordComponent, ScShareButtonComponent, ScShareButtonModule, ScSignInFormByEmailComponent, ScSignInFormByPhoneComponent, ScSignInFormComponent, ScUserModule, TreeDirective, TreeIconService, TreeLoaderService, TreeTopDirective, nextPageClickEvent, paginationParams$, phoneApproveCodeMask, scClientUiIconsName, scPasswordConfirmMatchingValidator, scUserFactory, stepValidator };
3226
+ export { AuthMethod, FilesAndDocumentsComponent, FilesAndDocumentsModule, SC_LINEAR_VALUES, SC_LINEAR_VALUES_TOKEN, SC_LOADING_PAGINATION_CHANGE_INFO, SC_NEXT_PAGE_PAGINATION_CHANGE_INFO, SC_NEXT_PAGE_PAGINATION_CLICK, SC_PRODUCT_PAGINATION_CHANGE_INFO, SC_PRODUCT_PAGINATION_CHANGE_PROVIDERS, SC_PRODUCT_PAGINATION_DEFAULT_OPTIONS, SC_PRODUCT_PAGINATION_OPTIONS, SC_PRODUCT_PAGINATION_PARAMS, SC_USER_INFO, SC_USER_PROVIDERS, ScAccordionComponent, ScAccordionContentDirective, ScAccordionModule, ScAuthModule, ScBannerComponent, ScBannerModule, ScCartItemMobileComponent, ScCartModule, ScCatalogModule, ScCategoriesListComponent, ScCategoryCardComponent, ScContactsAccordionComponent, ScContactsModule, ScContragentsAccordionComponent, ScContragentsAccordionItemComponent, ScContragentsModule, ScDeliveryAddressAccordionComponent, ScDeliveryAddressAccordionItemComponent, ScDeliveryAddressModule, ScFavoriteBtnComponent, ScInputQuantityComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNewsModule, ScOrderItemMobileComponent, ScOrderModule, ScPhoneApproveFormComponent, ScPriceCardComponent, ScPriceHistoryComponent, ScPriceListPaginationComponent, ScPriceWarehouseStockComponent, ScProfileAccordionsContentComponent, ScProfileModule, ScResetUserPasswordComponent, ScShareButtonComponent, ScShareButtonModule, ScSignInFormByEmailComponent, ScSignInFormByPhoneComponent, ScSignInFormComponent, ScUserModule, ScVerificationModule, TreeDirective, TreeIconService, TreeLoaderService, TreeTopDirective, nextPageClickEvent, paginationParams$, phoneApproveCodeMask, scClientUiIconsName, scPasswordConfirmMatchingValidator, scUserFactory, stepValidator };
3049
3227
  //# sourceMappingURL=snabcentr-client-ui.mjs.map