@snabcentr/client-ui 0.9.0 → 0.10.0
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.
- package/auth/sc-sign-in-form/sc-sign-in-form-by-email/sc-sign-in-form-by-email.component.d.ts +3 -3
- package/auth/sc-sign-in-form/sc-sign-in-form-by-phone/sc-sign-in-form-by-phone.component.d.ts +6 -6
- package/banner/sc-banner.component.d.ts +1 -1
- package/esm2020/auth/sc-sign-in-form/sc-sign-in-form-by-email/sc-sign-in-form-by-email.component.mjs +6 -6
- package/esm2020/auth/sc-sign-in-form/sc-sign-in-form-by-phone/sc-sign-in-form-by-phone.component.mjs +13 -12
- package/esm2020/auth/sc-sign-in-form/sc-sign-in-form.component.mjs +3 -3
- package/esm2020/banner/sc-banner.component.mjs +2 -2
- package/esm2020/catalog/price-card/sc-price-card.component.mjs +4 -1
- package/esm2020/profile/sc-profile-accordions-content/sc-profile-accordions-content.component.mjs +29 -16
- package/esm2020/user/index.mjs +2 -1
- package/esm2020/user/reset-user-password/sc-reset-user-password.component.mjs +4 -4
- package/esm2020/user/sc-user.module.mjs +6 -5
- package/esm2020/user/update-user-info-form/sc-update-user-info-form.component.mjs +7 -7
- package/esm2020/user/user-phone-approve-dialog/sc-user-phone-approve-dialog.component.mjs +91 -0
- package/esm2020/verification/index.mjs +2 -2
- package/esm2020/verification/sc-verification.module.mjs +6 -6
- package/esm2020/verification/verification-phone-check-form/sc-verification-phone-check-form.component.mjs +184 -0
- package/fesm2015/snabcentr-client-ui.mjs +163 -63
- package/fesm2015/snabcentr-client-ui.mjs.map +1 -1
- package/fesm2020/snabcentr-client-ui.mjs +160 -63
- package/fesm2020/snabcentr-client-ui.mjs.map +1 -1
- package/package.json +2 -2
- package/profile/sc-profile-accordions-content/sc-profile-accordions-content.component.d.ts +24 -10
- package/styles/tailwind/tailwind.scss +4 -0
- package/user/index.d.ts +1 -0
- package/user/reset-user-password/sc-reset-user-password.component.d.ts +3 -3
- package/user/sc-user.module.d.ts +9 -8
- package/user/update-user-info-form/sc-update-user-info-form.component.d.ts +1 -1
- package/user/user-phone-approve-dialog/sc-user-phone-approve-dialog.component.d.ts +48 -0
- package/verification/index.d.ts +1 -1
- package/verification/sc-verification.module.d.ts +2 -2
- package/verification/{phone-approve-form/phone-approve-form.component.d.ts → verification-phone-check-form/sc-verification-phone-check-form.component.d.ts} +13 -9
- package/esm2020/verification/phone-approve-form/phone-approve-form.component.mjs +0 -176
@@ -11,13 +11,13 @@ import { TuiTextfieldControllerModule, TuiLinkModule, TuiButtonModule, TuiLabelM
|
|
11
11
|
import * as i3 from '@angular/forms';
|
12
12
|
import { FormGroupDirective, FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule, NgControl } from '@angular/forms';
|
13
13
|
import * as i5 from '@taiga-ui/cdk';
|
14
|
-
import { tuiControlValue, tuiIsFalsy, TuiLetModule, tuiCreateToken, AbstractTuiNullableControl, TUI_IS_MOBILE, tuiIsPresent, TuiDestroyService, TuiRepeatTimesModule, tuiMarkControlAsTouchedAndValidate, tuiPure } from '@taiga-ui/cdk';
|
14
|
+
import { tuiControlValue, tuiIsFalsy, TuiLetModule, tuiCreateToken, AbstractTuiNullableControl, TUI_IS_MOBILE, tuiIsPresent, TuiDestroyService, TuiRepeatTimesModule, tuiMarkControlAsTouchedAndValidate, ALWAYS_TRUE_HANDLER, tuiPure } from '@taiga-ui/cdk';
|
15
15
|
import * as i3$1 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, TuiComboBoxModule, TuiDataListWrapperModule, TuiFilterByInputPipeModule, TuiStringifyContentPipeModule, TuiCheckboxModule, TuiCheckboxLabeledModule, TuiSelectModule } from '@taiga-ui/kit';
|
17
17
|
import * as i7 from '@maskito/angular';
|
18
18
|
import { MaskitoModule } from '@maskito/angular';
|
19
19
|
import * as i2$1 from '@tinkoff/ng-polymorpheus';
|
20
|
-
import { PolymorpheusTemplate, PolymorpheusModule, PolymorpheusComponent } from '@tinkoff/ng-polymorpheus';
|
20
|
+
import { PolymorpheusTemplate, PolymorpheusModule, PolymorpheusComponent, POLYMORPHEUS_CONTEXT } from '@tinkoff/ng-polymorpheus';
|
21
21
|
import { __decorate } from 'tslib';
|
22
22
|
import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
|
23
23
|
import * as i8 from '@ng-web-apis/intersection-observer';
|
@@ -61,9 +61,9 @@ const verificationCodeMask = {
|
|
61
61
|
/**
|
62
62
|
* Компонент формы проверки телефона и получения кода подтверждения.
|
63
63
|
*/
|
64
|
-
class
|
64
|
+
class ScVerificationPhoneCheckFormComponent {
|
65
65
|
/**
|
66
|
-
* Инициализирует экземпляр класса {@link
|
66
|
+
* Инициализирует экземпляр класса {@link ScVerificationPhoneCheckFormComponent}.
|
67
67
|
*
|
68
68
|
* @param verificationService Сервис верификации.
|
69
69
|
* @param formGroupDirective Директива c `FormGroup` из DOM.
|
@@ -75,6 +75,10 @@ class ScPhoneApproveFormComponent {
|
|
75
75
|
* Признак, следует ли отображать функционал кода подтверждения.
|
76
76
|
*/
|
77
77
|
this._showCodeFields = true;
|
78
|
+
/**
|
79
|
+
* Признак, что поле ввода телефона только для чтения.
|
80
|
+
*/
|
81
|
+
this.readOnly = false;
|
78
82
|
/**
|
79
83
|
* Признак, следует ли телефону быть в системе. От этого признака зависит в каких случаях выдавать ошибку при проверки занятости телефона.
|
80
84
|
*/
|
@@ -82,7 +86,7 @@ class ScPhoneApproveFormComponent {
|
|
82
86
|
/**
|
83
87
|
* Признак, следует ли проверять подтверждён ли телефона в системе. При `true` будет вызывать ошибку при наличие телефона в системе без подтверждения.
|
84
88
|
*/
|
85
|
-
this.shouldBeConfirmed =
|
89
|
+
this.shouldBeConfirmed = undefined;
|
86
90
|
/**
|
87
91
|
* Наличие кода подтверждения у пользователя.
|
88
92
|
*/
|
@@ -92,11 +96,11 @@ class ScPhoneApproveFormComponent {
|
|
92
96
|
*/
|
93
97
|
this.haveCodeChange = new EventEmitter();
|
94
98
|
/**
|
95
|
-
* {@link Subject}
|
99
|
+
* {@link Subject} события отправки кода подтверждения.
|
96
100
|
*/
|
97
101
|
this.onSendCode = new Subject();
|
98
102
|
/**
|
99
|
-
* {@link Observable}
|
103
|
+
* {@link Observable} запроса данных получения кода подтверждения.
|
100
104
|
*/
|
101
105
|
this.loadingApproveCode$ = this.onSendCode.pipe(filter(() => this.phoneControl.valid), map(() => this.phoneControl.value), switchMap((value) => this.verificationService.sendPhoneApproveCode(value).pipe(tap(() => this.reloadTimer$.next(60)), map(() => false), catchError((error) => {
|
102
106
|
const errorResponse = error.error;
|
@@ -117,7 +121,7 @@ class ScPhoneApproveFormComponent {
|
|
117
121
|
*/
|
118
122
|
this.verificationCodeMask = verificationCodeMask;
|
119
123
|
/**
|
120
|
-
* {@link Subject}
|
124
|
+
* {@link Subject} события запуска/остановки таймера.
|
121
125
|
*/
|
122
126
|
this.reloadTimer$ = new Subject();
|
123
127
|
/**
|
@@ -164,16 +168,18 @@ class ScPhoneApproveFormComponent {
|
|
164
168
|
if (this.shouldBeBusy !== result.isBusy) {
|
165
169
|
this.phoneControl.setErrors({
|
166
170
|
serverResponse: [
|
167
|
-
|
171
|
+
result.isBusy ? 'Пользователь с таким номером телефона уже существует' : 'Пользователя с таким номером телефона не существует',
|
168
172
|
],
|
169
173
|
});
|
170
174
|
this.phoneControl.markAsTouched();
|
171
175
|
return false;
|
172
176
|
}
|
173
|
-
if (this.shouldBeConfirmed &&
|
177
|
+
if (this.shouldBeConfirmed !== undefined && this.shouldBeConfirmed !== result.isConfirmed) {
|
174
178
|
this.phoneControl.setErrors({
|
175
179
|
serverResponse: [
|
176
|
-
|
180
|
+
result.isConfirmed
|
181
|
+
? 'Телефон уже подтверждён'
|
182
|
+
: 'Номер телефона не подтверждён или вход по нему невозможен. Обратитесь к вашему персональному менеджеру или войдите с использованием e-mail и пароля.',
|
177
183
|
],
|
178
184
|
});
|
179
185
|
this.phoneControl.markAsTouched();
|
@@ -201,16 +207,18 @@ class ScPhoneApproveFormComponent {
|
|
201
207
|
this.haveCodeChange.emit(haveCode);
|
202
208
|
}
|
203
209
|
}
|
204
|
-
|
205
|
-
|
206
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type:
|
210
|
+
ScVerificationPhoneCheckFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScVerificationPhoneCheckFormComponent, deps: [{ token: i1.ScVerificationService }, { token: FormGroupDirective }], target: i0.ɵɵFactoryTarget.Component });
|
211
|
+
ScVerificationPhoneCheckFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScVerificationPhoneCheckFormComponent, selector: "sc-verification-phone-check-form", inputs: { showCodeFields: "showCodeFields", readOnly: "readOnly", 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\" [readOnly]=\"readOnly\" [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 <ng-container *ngIf=\"showCodeFields && form.enabled\">\n <label *ngIf=\"loadingApproveCode === false && haveCode\" tuiLabel=\"\u041A\u043E\u0434 \u0438\u0437 \u0421\u041C\u0421\">\n <tui-input formControlName=\"verificationCode\">\n \u041A\u043E\u0434 \u0438\u0437 \u0421\u041C\u0421\n <input tuiTextfield [maskito]=\"verificationCodeMask\" autocomplete=\"new-password\" />\n </tui-input>\n <tui-error formControlName=\"verificationCode\" [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 (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 </ng-container>\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: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.TuiTextfieldComponent, selector: "input[tuiTextfield], textarea[tuiTextfield]" }, { kind: "component", type: i3$1.TuiInputComponent, selector: "tui-input" }, { kind: "directive", type: i3$1.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: i5.TuiLetDirective, selector: "[tuiLet]", inputs: ["tuiLet"] }, { kind: "component", type: i4.TuiLoaderComponent, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "showLoader"] }, { kind: "component", type: i3$1.TuiInputPhoneComponent, selector: "tui-input-phone", inputs: ["countryCode", "phoneMaskAfterCountryCode", "allowText", "search"], outputs: ["searchChange"] }, { kind: "directive", type: i3$1.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$1.TuiFieldErrorPipe, name: "tuiFieldError" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
212
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScVerificationPhoneCheckFormComponent, decorators: [{
|
207
213
|
type: Component,
|
208
|
-
args: [{ selector: 'sc-phone-
|
214
|
+
args: [{ selector: 'sc-verification-phone-check-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\" [readOnly]=\"readOnly\" [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 <ng-container *ngIf=\"showCodeFields && form.enabled\">\n <label *ngIf=\"loadingApproveCode === false && haveCode\" tuiLabel=\"\u041A\u043E\u0434 \u0438\u0437 \u0421\u041C\u0421\">\n <tui-input formControlName=\"verificationCode\">\n \u041A\u043E\u0434 \u0438\u0437 \u0421\u041C\u0421\n <input tuiTextfield [maskito]=\"verificationCodeMask\" autocomplete=\"new-password\" />\n </tui-input>\n <tui-error formControlName=\"verificationCode\" [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 (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 </ng-container>\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" }]
|
209
215
|
}], ctorParameters: function () { return [{ type: i1.ScVerificationService }, { type: i3.FormGroupDirective, decorators: [{
|
210
216
|
type: Inject,
|
211
217
|
args: [FormGroupDirective]
|
212
218
|
}] }]; }, propDecorators: { showCodeFields: [{
|
213
219
|
type: Input
|
220
|
+
}], readOnly: [{
|
221
|
+
type: Input
|
214
222
|
}], shouldBeBusy: [{
|
215
223
|
type: Input
|
216
224
|
}], shouldBeConfirmed: [{
|
@@ -240,38 +248,38 @@ class ScSignInFormByPhoneComponent {
|
|
240
248
|
/**
|
241
249
|
* Группа полей ввода для формы «Вход на сайт».
|
242
250
|
*/
|
243
|
-
this.
|
251
|
+
this.form = new FormGroup({
|
244
252
|
phone: new FormControl(null, [Validators.required, Validators.minLength(12)]),
|
245
253
|
verificationCode: new FormControl(null, [Validators.required, Validators.minLength(6)]),
|
246
254
|
});
|
247
255
|
/**
|
248
|
-
* {@link Subject}
|
256
|
+
* {@link Subject} события отправки формы.
|
249
257
|
*/
|
250
258
|
this.onSubmit = new Subject();
|
251
259
|
/**
|
252
|
-
* {@link Observable}
|
260
|
+
* {@link Observable} запроса данных аутентификации.
|
253
261
|
*/
|
254
|
-
this.
|
262
|
+
this.request$ = this.onSubmit.pipe(map(() => this.form.value), filter((value) => this.form.valid), switchMap((value) => this.authService.getSignIn$(value).pipe(catchError((error) => {
|
255
263
|
const errorResponse = error.error;
|
256
264
|
for (const key in errorResponse.errors) {
|
257
|
-
this.
|
265
|
+
this.form.get(key)?.setErrors({ serverResponse: errorResponse.errors[`${key}`] });
|
258
266
|
}
|
259
267
|
if (!errorResponse.errors && errorResponse.message) {
|
260
|
-
this.
|
268
|
+
this.form.setErrors({ serverResponse: [errorResponse.message] });
|
261
269
|
}
|
262
270
|
return of({});
|
263
271
|
}), startWith(null))), share());
|
264
272
|
/**
|
265
|
-
* {@link Observable}
|
273
|
+
* {@link Observable} изменения состояния загрузки данных аутентификации по номеру телефона.
|
266
274
|
*/
|
267
|
-
this.
|
275
|
+
this.loading$ = this.request$.pipe(map(tuiIsFalsy));
|
268
276
|
}
|
269
277
|
}
|
270
278
|
ScSignInFormByPhoneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScSignInFormByPhoneComponent, deps: [{ token: i1.ScAuthService }], target: i0.ɵɵFactoryTarget.Component });
|
271
|
-
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]=\"
|
279
|
+
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]=\"form\" *tuiLet=\"!!(loading$ | async) as loading\" (ngSubmit)=\"onSubmit.next()\" class=\"flex flex-col gap-4 items-center mb-4\">\n <sc-verification-phone-check-form [(haveCode)]=\"haveCode\" [shouldBeBusy]=\"true\" [shouldBeConfirmed]=\"true\" class=\"w-full\"></sc-verification-phone-check-form>\n <button *ngIf=\"haveCode\" tuiButton type=\"submit\" [showLoader]=\"loading\" [disabled]=\"form.invalid || loading\" icon=\"scIconLogIn\">\u0412\u043E\u0439\u0442\u0438</button>\n</form>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.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: "directive", type: i5.TuiLetDirective, selector: "[tuiLet]", inputs: ["tuiLet"] }, { kind: "component", type: ScVerificationPhoneCheckFormComponent, selector: "sc-verification-phone-check-form", inputs: ["showCodeFields", "readOnly", "shouldBeBusy", "shouldBeConfirmed", "haveCode"], outputs: ["haveCodeChange"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
272
280
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScSignInFormByPhoneComponent, decorators: [{
|
273
281
|
type: Component,
|
274
|
-
args: [{ selector: 'sc-sign-in-form-by-phone', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"
|
282
|
+
args: [{ selector: 'sc-sign-in-form-by-phone', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"form\" *tuiLet=\"!!(loading$ | async) as loading\" (ngSubmit)=\"onSubmit.next()\" class=\"flex flex-col gap-4 items-center mb-4\">\n <sc-verification-phone-check-form [(haveCode)]=\"haveCode\" [shouldBeBusy]=\"true\" [shouldBeConfirmed]=\"true\" class=\"w-full\"></sc-verification-phone-check-form>\n <button *ngIf=\"haveCode\" tuiButton type=\"submit\" [showLoader]=\"loading\" [disabled]=\"form.invalid || loading\" icon=\"scIconLogIn\">\u0412\u043E\u0439\u0442\u0438</button>\n</form>\n" }]
|
275
283
|
}], ctorParameters: function () { return [{ type: i1.ScAuthService }]; } });
|
276
284
|
|
277
285
|
/**
|
@@ -293,11 +301,11 @@ class ScSignInFormByEmailComponent {
|
|
293
301
|
password: new FormControl(null, Validators.required),
|
294
302
|
});
|
295
303
|
/**
|
296
|
-
* {@link Subject}
|
304
|
+
* {@link Subject} события отправки формы.
|
297
305
|
*/
|
298
306
|
this.onSubmit = new Subject();
|
299
307
|
/**
|
300
|
-
* {@link Observable}
|
308
|
+
* {@link Observable} запроса данных аутентификации.
|
301
309
|
*/
|
302
310
|
this.emailRequest$ = this.onSubmit.pipe(filter(() => this.formByEmail.valid), map(() => this.formByEmail.value), switchMap((value) => this.authService.getSignIn$(value).pipe(catchError((error) => {
|
303
311
|
const errorResponse = error.error;
|
@@ -310,7 +318,7 @@ class ScSignInFormByEmailComponent {
|
|
310
318
|
return of({});
|
311
319
|
}), startWith(null))), share());
|
312
320
|
/**
|
313
|
-
* {@link Observable}
|
321
|
+
* {@link Observable} изменения состояния загрузки данных аутентификации по email.
|
314
322
|
*/
|
315
323
|
this.loadingEmailAuth$ = this.emailRequest$.pipe(map(tuiIsFalsy));
|
316
324
|
/**
|
@@ -320,10 +328,10 @@ class ScSignInFormByEmailComponent {
|
|
320
328
|
}
|
321
329
|
}
|
322
330
|
ScSignInFormByEmailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScSignInFormByEmailComponent, deps: [{ token: i1.ScAuthService }], target: i0.ɵɵFactoryTarget.Component });
|
323
|
-
ScSignInFormByEmailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScSignInFormByEmailComponent, selector: "sc-sign-in-form-by-email", outputs: { forgotPassword: "forgotPassword" }, ngImport: i0, template: "<form [formGroup]=\"formByEmail\" (ngSubmit)=\"onSubmit.next()\">\n <div class=\"flex flex-col gap-4 mb-8\">\n <label tuiLabel=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\">\n <tui-input formControlName=\"login\">\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <input tuiTextfield autocomplete=\"email\" />\n </tui-input>\n <tui-error formControlName=\"login\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <label tuiLabel=\"\u041F\u0430\u0440\u043E\u043B\u044C\">\n <tui-input-password formControlName=\"password\">\n \u041F\u0430\u0440\u043E\u043B\u044C\n <input tuiTextfield autocomplete=\"current-password\" />\n </tui-input-password>\n <tui-error formControlName=\"password\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <tui-error [error]=\"[] | tuiFieldError | async\"></tui-error>\n </div>\n <div class=\"flex flex-col gap-4 items-center mb-4\">\n <a tuiLink [pseudo]=\"true\" (click)=\"forgotPassword.emit()\" class=\"text-base\">\u0417\u0430\u0431\u044B\u043B\u0438 \u043F\u0430\u0440\u043E\u043B\u044C?</a>\n <button tuiButton type=\"submit\" [showLoader]=\"!!(loadingEmailAuth$ | async)\"
|
331
|
+
ScSignInFormByEmailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScSignInFormByEmailComponent, selector: "sc-sign-in-form-by-email", outputs: { forgotPassword: "forgotPassword" }, ngImport: i0, template: "<form [formGroup]=\"formByEmail\" (ngSubmit)=\"onSubmit.next()\">\n <div class=\"flex flex-col gap-4 mb-8\">\n <label tuiLabel=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\">\n <tui-input formControlName=\"login\">\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <input tuiTextfield autocomplete=\"email\" />\n </tui-input>\n <tui-error formControlName=\"login\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <label tuiLabel=\"\u041F\u0430\u0440\u043E\u043B\u044C\">\n <tui-input-password formControlName=\"password\">\n \u041F\u0430\u0440\u043E\u043B\u044C\n <input tuiTextfield autocomplete=\"current-password\" />\n </tui-input-password>\n <tui-error formControlName=\"password\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <tui-error [error]=\"[] | tuiFieldError | async\"></tui-error>\n </div>\n <div class=\"flex flex-col gap-4 items-center mb-4\">\n <a tuiLink [pseudo]=\"true\" (click)=\"forgotPassword.emit()\" class=\"text-base\">\u0417\u0430\u0431\u044B\u043B\u0438 \u043F\u0430\u0440\u043E\u043B\u044C?</a>\n <button tuiButton type=\"submit\" [showLoader]=\"!!(loadingEmailAuth$ | async)\" [disabled]=\"formByEmail.invalid || !!(loadingEmailAuth$ | async)\" icon=\"scIconLogIn\">\n \u0412\u043E\u0439\u0442\u0438\n </button>\n </div>\n</form>\n", dependencies: [{ kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$1.TuiInputPasswordComponent, selector: "tui-input-password" }, { kind: "directive", type: i3$1.TuiInputPasswordDirective, selector: "tui-input-password" }, { kind: "component", type: i4.TuiTextfieldComponent, selector: "input[tuiTextfield], textarea[tuiTextfield]" }, { kind: "component", type: i3$1.TuiInputComponent, selector: "tui-input" }, { kind: "directive", type: i3$1.TuiInputDirective, selector: "tui-input" }, { 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: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.TuiFieldErrorPipe, name: "tuiFieldError" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
324
332
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScSignInFormByEmailComponent, decorators: [{
|
325
333
|
type: Component,
|
326
|
-
args: [{ selector: 'sc-sign-in-form-by-email', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"formByEmail\" (ngSubmit)=\"onSubmit.next()\">\n <div class=\"flex flex-col gap-4 mb-8\">\n <label tuiLabel=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\">\n <tui-input formControlName=\"login\">\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <input tuiTextfield autocomplete=\"email\" />\n </tui-input>\n <tui-error formControlName=\"login\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <label tuiLabel=\"\u041F\u0430\u0440\u043E\u043B\u044C\">\n <tui-input-password formControlName=\"password\">\n \u041F\u0430\u0440\u043E\u043B\u044C\n <input tuiTextfield autocomplete=\"current-password\" />\n </tui-input-password>\n <tui-error formControlName=\"password\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <tui-error [error]=\"[] | tuiFieldError | async\"></tui-error>\n </div>\n <div class=\"flex flex-col gap-4 items-center mb-4\">\n <a tuiLink [pseudo]=\"true\" (click)=\"forgotPassword.emit()\" class=\"text-base\">\u0417\u0430\u0431\u044B\u043B\u0438 \u043F\u0430\u0440\u043E\u043B\u044C?</a>\n <button tuiButton type=\"submit\" [showLoader]=\"!!(loadingEmailAuth$ | async)\"
|
334
|
+
args: [{ selector: 'sc-sign-in-form-by-email', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"formByEmail\" (ngSubmit)=\"onSubmit.next()\">\n <div class=\"flex flex-col gap-4 mb-8\">\n <label tuiLabel=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\">\n <tui-input formControlName=\"login\">\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <input tuiTextfield autocomplete=\"email\" />\n </tui-input>\n <tui-error formControlName=\"login\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <label tuiLabel=\"\u041F\u0430\u0440\u043E\u043B\u044C\">\n <tui-input-password formControlName=\"password\">\n \u041F\u0430\u0440\u043E\u043B\u044C\n <input tuiTextfield autocomplete=\"current-password\" />\n </tui-input-password>\n <tui-error formControlName=\"password\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <tui-error [error]=\"[] | tuiFieldError | async\"></tui-error>\n </div>\n <div class=\"flex flex-col gap-4 items-center mb-4\">\n <a tuiLink [pseudo]=\"true\" (click)=\"forgotPassword.emit()\" class=\"text-base\">\u0417\u0430\u0431\u044B\u043B\u0438 \u043F\u0430\u0440\u043E\u043B\u044C?</a>\n <button tuiButton type=\"submit\" [showLoader]=\"!!(loadingEmailAuth$ | async)\" [disabled]=\"formByEmail.invalid || !!(loadingEmailAuth$ | async)\" icon=\"scIconLogIn\">\n \u0412\u043E\u0439\u0442\u0438\n </button>\n </div>\n</form>\n" }]
|
327
335
|
}], ctorParameters: function () { return [{ type: i1.ScAuthService }]; }, propDecorators: { forgotPassword: [{
|
328
336
|
type: Output
|
329
337
|
}] } });
|
@@ -376,10 +384,10 @@ class ScSignInFormComponent {
|
|
376
384
|
}
|
377
385
|
}
|
378
386
|
ScSignInFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScSignInFormComponent, deps: [{ token: i1.ScAuthService }], target: i0.ɵɵFactoryTarget.Component });
|
379
|
-
ScSignInFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScSignInFormComponent, selector: "sc-sign-in-form", inputs: { authMethod: "authMethod" }, outputs: { forgotPassword: "forgotPassword", signUp: "signUp", successAuth: "successAuth" }, ngImport: i0, template: "<div class=\"flex justify-center mb-4\">\n <button\n tuiButton\n [tuiMode]=\"authMethod === 'by_phone' ? null : 'onLight'\"\n [appearance]=\"authMethod === 'by_phone' ? 'primary' : 'secondary'\"\n
|
387
|
+
ScSignInFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScSignInFormComponent, selector: "sc-sign-in-form", inputs: { authMethod: "authMethod" }, outputs: { forgotPassword: "forgotPassword", signUp: "signUp", successAuth: "successAuth" }, ngImport: i0, template: "<div class=\"flex justify-center mb-4\">\n <button\n tuiButton\n [tuiMode]=\"authMethod === 'by_phone' ? null : 'onLight'\"\n [appearance]=\"authMethod === 'by_phone' ? 'primary' : 'secondary'\"\n (click)=\"switchAuth(method.byPhone)\"\n class=\"!w-36 !min-w-0 tui-space_right-3 tui-space_bottom-3 !font-bold\"\n >\n \u041F\u043E \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0443\n </button>\n\n <button\n tuiButton\n [tuiMode]=\"authMethod === 'by_email' ? null : 'onLight'\"\n [appearance]=\"authMethod === 'by_email' ? 'primary' : 'secondary'\"\n (click)=\"switchAuth(method.byEmail)\"\n class=\"!w-36 !min-w-0 tui-space_left-3 tui-space_bottom-3 !font-bold\"\n >\n \u041F\u043E e-mail\n </button>\n</div>\n\n<sc-sign-in-form-by-email *ngIf=\"authMethod === 'by_email'\" (forgotPassword)=\"onForgotPassword()\"></sc-sign-in-form-by-email>\n\n<sc-sign-in-form-by-phone [class.hidden]=\"authMethod !== 'by_phone'\"></sc-sign-in-form-by-phone>\n\n<div class=\"flex flex-col gap-4 items-center\">\n <span class=\"font-medium text-tui-text-02\">\u0415\u0449\u0435 \u043D\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u043D\u044B?</span>\n <button tuiButton tuiMode=\"onLight\" (click)=\"signUp.emit()\" type=\"button\" icon=\"scIconAddProfile\" appearance=\"secondary\">\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u044F</button>\n</div>\n", dependencies: [{ 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: "directive", type: i4.TuiModeDirective, selector: "[tuiMode]", inputs: ["tuiMode"] }, { kind: "component", type: ScSignInFormByPhoneComponent, selector: "sc-sign-in-form-by-phone" }, { kind: "component", type: ScSignInFormByEmailComponent, selector: "sc-sign-in-form-by-email", outputs: ["forgotPassword"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
380
388
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScSignInFormComponent, decorators: [{
|
381
389
|
type: Component,
|
382
|
-
args: [{ selector: 'sc-sign-in-form', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex justify-center mb-4\">\n <button\n tuiButton\n [tuiMode]=\"authMethod === 'by_phone' ? null : 'onLight'\"\n [appearance]=\"authMethod === 'by_phone' ? 'primary' : 'secondary'\"\n
|
390
|
+
args: [{ selector: 'sc-sign-in-form', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex justify-center mb-4\">\n <button\n tuiButton\n [tuiMode]=\"authMethod === 'by_phone' ? null : 'onLight'\"\n [appearance]=\"authMethod === 'by_phone' ? 'primary' : 'secondary'\"\n (click)=\"switchAuth(method.byPhone)\"\n class=\"!w-36 !min-w-0 tui-space_right-3 tui-space_bottom-3 !font-bold\"\n >\n \u041F\u043E \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0443\n </button>\n\n <button\n tuiButton\n [tuiMode]=\"authMethod === 'by_email' ? null : 'onLight'\"\n [appearance]=\"authMethod === 'by_email' ? 'primary' : 'secondary'\"\n (click)=\"switchAuth(method.byEmail)\"\n class=\"!w-36 !min-w-0 tui-space_left-3 tui-space_bottom-3 !font-bold\"\n >\n \u041F\u043E e-mail\n </button>\n</div>\n\n<sc-sign-in-form-by-email *ngIf=\"authMethod === 'by_email'\" (forgotPassword)=\"onForgotPassword()\"></sc-sign-in-form-by-email>\n\n<sc-sign-in-form-by-phone [class.hidden]=\"authMethod !== 'by_phone'\"></sc-sign-in-form-by-phone>\n\n<div class=\"flex flex-col gap-4 items-center\">\n <span class=\"font-medium text-tui-text-02\">\u0415\u0449\u0435 \u043D\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u043D\u044B?</span>\n <button tuiButton tuiMode=\"onLight\" (click)=\"signUp.emit()\" type=\"button\" icon=\"scIconAddProfile\" appearance=\"secondary\">\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u044F</button>\n</div>\n" }]
|
383
391
|
}], ctorParameters: function () { return [{ type: i1.ScAuthService }]; }, propDecorators: { authMethod: [{
|
384
392
|
type: Input
|
385
393
|
}], forgotPassword: [{
|
@@ -396,7 +404,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
396
404
|
class ScVerificationModule {
|
397
405
|
}
|
398
406
|
ScVerificationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScVerificationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
399
|
-
ScVerificationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: ScVerificationModule, declarations: [
|
407
|
+
ScVerificationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: ScVerificationModule, declarations: [ScVerificationPhoneCheckFormComponent], imports: [CommonModule,
|
400
408
|
FormsModule,
|
401
409
|
ReactiveFormsModule,
|
402
410
|
TuiInputPasswordModule,
|
@@ -411,7 +419,7 @@ ScVerificationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
|
|
411
419
|
TuiLetModule,
|
412
420
|
TuiLoaderModule,
|
413
421
|
TuiInputPhoneModule,
|
414
|
-
MaskitoModule], exports: [
|
422
|
+
MaskitoModule], exports: [ScVerificationPhoneCheckFormComponent] });
|
415
423
|
ScVerificationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScVerificationModule, imports: [CommonModule,
|
416
424
|
FormsModule,
|
417
425
|
ReactiveFormsModule,
|
@@ -449,8 +457,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
449
457
|
TuiInputPhoneModule,
|
450
458
|
MaskitoModule,
|
451
459
|
],
|
452
|
-
exports: [
|
453
|
-
declarations: [
|
460
|
+
exports: [ScVerificationPhoneCheckFormComponent],
|
461
|
+
declarations: [ScVerificationPhoneCheckFormComponent],
|
454
462
|
}]
|
455
463
|
}] });
|
456
464
|
|
@@ -702,7 +710,7 @@ let ScBannerComponent = class ScBannerComponent {
|
|
702
710
|
*/
|
703
711
|
this.showPlayBtn = false;
|
704
712
|
/**
|
705
|
-
* {@link Observable}
|
713
|
+
* {@link Observable} обновления списка баннеров.
|
706
714
|
*/
|
707
715
|
this.banners$ = this.bannerService.banners$.pipe(map((banners) => banners.filter((banner) => banner.location === this.bannerLocation).reverse()), tap((banners) => {
|
708
716
|
if (banners.length) {
|
@@ -1537,6 +1545,9 @@ class ScPriceCardComponent {
|
|
1537
1545
|
* Возвращает ссылку на preview-изображение карточки товара.
|
1538
1546
|
*/
|
1539
1547
|
getCardImagePreview() {
|
1548
|
+
if (this.product && this.product.images) {
|
1549
|
+
this.product.images.sort((img1, img2) => Number(img2.isDefault) - Number(img1.isDefault));
|
1550
|
+
}
|
1540
1551
|
return this.product ? this.imageHelper.getImagePreview(this.product) : this.pathImageNotFound;
|
1541
1552
|
}
|
1542
1553
|
/**
|
@@ -3023,11 +3034,11 @@ class ScResetUserPasswordComponent {
|
|
3023
3034
|
newPasswordConfirm: new FormControl(null, [Validators.required, Validators.minLength(8), scPasswordConfirmMatchingValidator('newPassword')]),
|
3024
3035
|
});
|
3025
3036
|
/**
|
3026
|
-
* {@link Subject}
|
3037
|
+
* {@link Subject} события отправки формы.
|
3027
3038
|
*/
|
3028
3039
|
this.onSubmit = new Subject();
|
3029
3040
|
/**
|
3030
|
-
* {@link Observable}
|
3041
|
+
* {@link Observable} запроса данных аутентификации.
|
3031
3042
|
*/
|
3032
3043
|
this.request$ = this.onSubmit.pipe(filter(() => this.form.valid), map(() => this.form.value), switchMap((value) => this.userService.updateUserInfo$(value).pipe(catchError((error) => {
|
3033
3044
|
const errorResponse = error.error;
|
@@ -3040,7 +3051,7 @@ class ScResetUserPasswordComponent {
|
|
3040
3051
|
return of(void {});
|
3041
3052
|
}), startWith(null))), share());
|
3042
3053
|
/**
|
3043
|
-
* {@link Observable}
|
3054
|
+
* {@link Observable} изменения состояния загрузки данных аутентификации по email.
|
3044
3055
|
*/
|
3045
3056
|
this.loading$ = this.request$.pipe(map(tuiIsFalsy));
|
3046
3057
|
}
|
@@ -3298,7 +3309,7 @@ class ScUpdateUserInfoFormComponent {
|
|
3298
3309
|
/**
|
3299
3310
|
* {@link Observable} запроса обновления данных пользователя.
|
3300
3311
|
*/
|
3301
|
-
this.request$ = this.onSubmit.pipe(filter(() => this.form.valid), map(() => this.form.value), switchMap((value) => this.userService.updateUserInfo$(value).pipe(switchMap(() => this.userService.updateUserChange$()),
|
3312
|
+
this.request$ = this.onSubmit.pipe(filter(() => this.form.valid), map(() => this.form.value), switchMap((value) => this.userService.updateUserInfo$(value).pipe(switchMap(() => this.userService.updateUserChange$()), catchError((error) => {
|
3302
3313
|
const errorResponse = error.error;
|
3303
3314
|
for (const key in errorResponse.errors) {
|
3304
3315
|
this.form.get(key)?.setErrors({ serverResponse: errorResponse.errors[`${key}`] });
|
@@ -3307,9 +3318,9 @@ class ScUpdateUserInfoFormComponent {
|
|
3307
3318
|
this.form.setErrors({ serverResponse: [errorResponse.message] });
|
3308
3319
|
}
|
3309
3320
|
return of({});
|
3310
|
-
}));
|
3321
|
+
}), startWith(null))));
|
3311
3322
|
/**
|
3312
|
-
* {@link Observable}
|
3323
|
+
* {@link Observable} изменения состояния загрузки данных аутентификации по email.
|
3313
3324
|
*/
|
3314
3325
|
this.loading$ = this.request$.pipe(map(tuiIsFalsy));
|
3315
3326
|
this.user$.subscribe((user) => this.form.patchValue({
|
@@ -3322,10 +3333,10 @@ class ScUpdateUserInfoFormComponent {
|
|
3322
3333
|
}
|
3323
3334
|
}
|
3324
3335
|
ScUpdateUserInfoFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScUpdateUserInfoFormComponent, deps: [{ token: SC_USER_INFO }, { token: i1.ScUserService }], target: i0.ɵɵFactoryTarget.Component });
|
3325
|
-
ScUpdateUserInfoFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScUpdateUserInfoFormComponent, selector: "sc-update-user-info-form", outputs: { cancelButtonClick: "cancelButtonClick", successUpdateDate: "successUpdateDate" }, providers: [SC_USER_PROVIDERS], ngImport: i0, template: "<form [formGroup]=\"form\" *ngIf=\"user$ | async as user\" (ngSubmit)=\"onSubmit.next()\" class=\"flex flex-col gap-4\">\n <label [tuiLabel]=\"user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.'\">\n <tui-input formControlName=\"name\">\n {{ user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.' }}\n <ng-container *ngIf=\"user.isOrg\">\n <sc-suggestion-field *tuiDataList [type]=\"suggestionType.organization\"></sc-suggestion-field>\n </ng-container>\n </tui-input>\n <tui-error formControlName=\"name\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <sc-phone-
|
3336
|
+
ScUpdateUserInfoFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScUpdateUserInfoFormComponent, selector: "sc-update-user-info-form", outputs: { cancelButtonClick: "cancelButtonClick", successUpdateDate: "successUpdateDate" }, providers: [SC_USER_PROVIDERS], ngImport: i0, template: "<form [formGroup]=\"form\" *ngIf=\"user$ | async as user\" (ngSubmit)=\"onSubmit.next()\" class=\"flex flex-col gap-4\">\n <label [tuiLabel]=\"user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.'\">\n <tui-input formControlName=\"name\">\n {{ user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.' }}\n <ng-container *ngIf=\"user.isOrg\">\n <sc-suggestion-field *tuiDataList [type]=\"suggestionType.organization\"></sc-suggestion-field>\n </ng-container>\n </tui-input>\n <tui-error formControlName=\"name\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <sc-verification-phone-check-form\n *tuiLet=\"user.contacts.phone.value === form.value.phone as phoneIsChange\"\n [showCodeFields]=\"!phoneIsChange\"\n [shouldBeBusy]=\"phoneIsChange\"\n class=\"w-full\"\n ></sc-verification-phone-check-form>\n <label tuiLabel=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\" class=\"w-full\">\n <tui-input formControlName=\"email\">\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <sc-suggestion-field *tuiDataList [type]=\"suggestionType.email\"></sc-suggestion-field>\n </tui-input>\n <tui-error formControlName=\"email\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <sc-addresses-selection-field></sc-addresses-selection-field>\n <tui-checkbox-labeled formControlName=\"getNews\" class=\"w-full\"> \u042F \u0445\u043E\u0447\u0443 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u0440\u0430\u0441\u0441\u044B\u043B\u043A\u0443 \u0421\u043D\u0430\u0431\u0446\u0435\u043D\u0442\u0440 \u043E \u0441\u043A\u0438\u0434\u043A\u0430\u0445 \u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u044F\u0445 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435. </tui-checkbox-labeled>\n <div class=\"flex gap-4 justify-center\">\n <button tuiButton (click)=\"cancelButtonClick.emit\" type=\"button\" icon=\"tuiIconXLarge\" appearance=\"secondary\">\u041E\u0442\u043C\u0435\u043D\u0430</button>\n <button tuiButton tuiMode=\"onLight\" [disabled]=\"form.invalid\" [showLoader]=\"!!(loading$ | async)\" type=\"submit\" icon=\"scIconSave\">\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C</button>\n </div>\n</form>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { 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.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "component", type: i4.TuiLabelComponent, selector: "label[tuiLabel]", inputs: ["tuiLabel", "context"] }, { kind: "directive", type: i5.TuiLetDirective, selector: "[tuiLet]", inputs: ["tuiLet"] }, { kind: "component", type: ScVerificationPhoneCheckFormComponent, selector: "sc-verification-phone-check-form", inputs: ["showCodeFields", "readOnly", "shouldBeBusy", "shouldBeConfirmed", "haveCode"], outputs: ["haveCodeChange"] }, { kind: "component", type: ScAddressesSelectionFieldComponent, selector: "sc-addresses-selection-field" }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"] }, { kind: "component", type: i3$1.TuiInputComponent, selector: "tui-input" }, { kind: "directive", type: i3$1.TuiInputDirective, selector: "tui-input" }, { kind: "component", type: i3$1.TuiCheckboxLabeledComponent, selector: "tui-checkbox-labeled", inputs: ["size"] }, { kind: "directive", type: i4.TuiDataListDirective, selector: "ng-template[tuiDataList]" }, { kind: "directive", type: i4.TuiModeDirective, selector: "[tuiMode]", inputs: ["tuiMode"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3$1.TuiFieldErrorPipe, name: "tuiFieldError" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
3326
3337
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScUpdateUserInfoFormComponent, decorators: [{
|
3327
3338
|
type: Component,
|
3328
|
-
args: [{ selector: 'sc-update-user-info-form', providers: [SC_USER_PROVIDERS], changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"form\" *ngIf=\"user$ | async as user\" (ngSubmit)=\"onSubmit.next()\" class=\"flex flex-col gap-4\">\n <label [tuiLabel]=\"user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.'\">\n <tui-input formControlName=\"name\">\n {{ user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.' }}\n <ng-container *ngIf=\"user.isOrg\">\n <sc-suggestion-field *tuiDataList [type]=\"suggestionType.organization\"></sc-suggestion-field>\n </ng-container>\n </tui-input>\n <tui-error formControlName=\"name\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <sc-phone-
|
3339
|
+
args: [{ selector: 'sc-update-user-info-form', providers: [SC_USER_PROVIDERS], changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"form\" *ngIf=\"user$ | async as user\" (ngSubmit)=\"onSubmit.next()\" class=\"flex flex-col gap-4\">\n <label [tuiLabel]=\"user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.'\">\n <tui-input formControlName=\"name\">\n {{ user.isOrg ? '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F' : '\u0424.\u0418.\u041E.' }}\n <ng-container *ngIf=\"user.isOrg\">\n <sc-suggestion-field *tuiDataList [type]=\"suggestionType.organization\"></sc-suggestion-field>\n </ng-container>\n </tui-input>\n <tui-error formControlName=\"name\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <sc-verification-phone-check-form\n *tuiLet=\"user.contacts.phone.value === form.value.phone as phoneIsChange\"\n [showCodeFields]=\"!phoneIsChange\"\n [shouldBeBusy]=\"phoneIsChange\"\n class=\"w-full\"\n ></sc-verification-phone-check-form>\n <label tuiLabel=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\" class=\"w-full\">\n <tui-input formControlName=\"email\">\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <sc-suggestion-field *tuiDataList [type]=\"suggestionType.email\"></sc-suggestion-field>\n </tui-input>\n <tui-error formControlName=\"email\" [error]=\"[] | tuiFieldError | async\"></tui-error>\n </label>\n <sc-addresses-selection-field></sc-addresses-selection-field>\n <tui-checkbox-labeled formControlName=\"getNews\" class=\"w-full\"> \u042F \u0445\u043E\u0447\u0443 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u0440\u0430\u0441\u0441\u044B\u043B\u043A\u0443 \u0421\u043D\u0430\u0431\u0446\u0435\u043D\u0442\u0440 \u043E \u0441\u043A\u0438\u0434\u043A\u0430\u0445 \u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u044F\u0445 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435. </tui-checkbox-labeled>\n <div class=\"flex gap-4 justify-center\">\n <button tuiButton (click)=\"cancelButtonClick.emit\" type=\"button\" icon=\"tuiIconXLarge\" appearance=\"secondary\">\u041E\u0442\u043C\u0435\u043D\u0430</button>\n <button tuiButton tuiMode=\"onLight\" [disabled]=\"form.invalid\" [showLoader]=\"!!(loading$ | async)\" type=\"submit\" icon=\"scIconSave\">\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C</button>\n </div>\n</form>\n" }]
|
3329
3340
|
}], ctorParameters: function () { return [{ type: i10.Observable, decorators: [{
|
3330
3341
|
type: Inject,
|
3331
3342
|
args: [SC_USER_INFO]
|
@@ -3335,6 +3346,80 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
3335
3346
|
type: Output
|
3336
3347
|
}] } });
|
3337
3348
|
|
3349
|
+
/**
|
3350
|
+
* Диалоговое окно подтверждения номера телефона.
|
3351
|
+
*/
|
3352
|
+
let ScUserPhoneApproveDialogComponent = class ScUserPhoneApproveDialogComponent {
|
3353
|
+
/**
|
3354
|
+
* Инициализирует экземпляр класса {@link ScUserPhoneApproveDialogComponent}.
|
3355
|
+
*
|
3356
|
+
* @param verificationService Сервис верификации.
|
3357
|
+
* @param user$ Поток информации о текущем пользователе.
|
3358
|
+
* @param userService Сервис информации о пользователе.
|
3359
|
+
* @param context Контекст диалогового окна, в котором открыт компонент.
|
3360
|
+
*/
|
3361
|
+
constructor(verificationService, user$, userService, context) {
|
3362
|
+
this.verificationService = verificationService;
|
3363
|
+
this.user$ = user$;
|
3364
|
+
this.userService = userService;
|
3365
|
+
this.context = context;
|
3366
|
+
/**
|
3367
|
+
* Наличие кода подтверждения у пользователя.
|
3368
|
+
*/
|
3369
|
+
this.haveCode = false;
|
3370
|
+
/**
|
3371
|
+
* Группа полей ввода для подтверждения номера телефона.
|
3372
|
+
*/
|
3373
|
+
this.form = new FormGroup({
|
3374
|
+
phone: new FormControl(null, [Validators.required, Validators.minLength(12)]),
|
3375
|
+
verificationCode: new FormControl(null, [Validators.required, Validators.minLength(6)]),
|
3376
|
+
});
|
3377
|
+
/**
|
3378
|
+
* {@link Subject} события отправки формы.
|
3379
|
+
*/
|
3380
|
+
this.onSubmit = new Subject();
|
3381
|
+
/**
|
3382
|
+
* {@link Observable} запроса подтверждения номера телефона.
|
3383
|
+
*/
|
3384
|
+
this.request$ = this.onSubmit.pipe(filter(() => this.form.valid), map(() => this.form.value), switchMap((value) => this.verificationService.approvePhone(value).pipe(switchMap(() => this.userService.updateUserChange$()), tap((user) => this.context?.completeWith(user.contacts.phone)), catchError((error) => {
|
3385
|
+
const errorResponse = error.error;
|
3386
|
+
for (const key in errorResponse.errors) {
|
3387
|
+
this.form.get(key)?.setErrors({ serverResponse: errorResponse.errors[`${key}`] });
|
3388
|
+
}
|
3389
|
+
if (!errorResponse.errors && errorResponse.message) {
|
3390
|
+
this.form.setErrors({ serverResponse: [errorResponse.message] });
|
3391
|
+
}
|
3392
|
+
return of({});
|
3393
|
+
}), startWith(null))), share());
|
3394
|
+
/**
|
3395
|
+
* {@link Observable} изменения состояния запроса подтверждения номера телефона..
|
3396
|
+
*/
|
3397
|
+
this.loading$ = this.request$.pipe(map(tuiIsFalsy));
|
3398
|
+
this.user$.pipe(untilDestroyed(this)).subscribe((user) => {
|
3399
|
+
this.form.patchValue({
|
3400
|
+
phone: user.contacts.phone.value,
|
3401
|
+
});
|
3402
|
+
});
|
3403
|
+
}
|
3404
|
+
};
|
3405
|
+
ScUserPhoneApproveDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScUserPhoneApproveDialogComponent, deps: [{ token: i1.ScVerificationService }, { token: SC_USER_INFO }, { token: i1.ScUserService }, { token: POLYMORPHEUS_CONTEXT, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
3406
|
+
ScUserPhoneApproveDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScUserPhoneApproveDialogComponent, selector: "sc-user-phone-approve-dialog", providers: [SC_USER_PROVIDERS], ngImport: i0, template: "<ng-container *ngIf=\"user$ | async as user\">\n <form [formGroup]=\"form\" *tuiLet=\"!!(loading$ | async) as loadingApproveCode\" (ngSubmit)=\"onSubmit.next()\" class=\"flex flex-col gap-3\">\n <sc-verification-phone-check-form\n [(haveCode)]=\"haveCode\"\n [shouldBeConfirmed]=\"false\"\n [showCodeFields]=\"!user.contacts.phone.isApproved\"\n [readOnly]=\"true\"\n class=\"w-full\"\n ></sc-verification-phone-check-form>\n <div *ngIf=\"user.contacts.phone.isApproved || haveCode\" class=\"flex gap-4 justify-center\">\n <button *ngIf=\"user.contacts.phone.isApproved && context\" tuiButton (click)=\"context.$implicit.complete()\" type=\"button\" appearance=\"secondary\">\u0417\u0430\u043A\u0440\u044B\u0442\u044C</button>\n <button *ngIf=\"haveCode\" tuiButton type=\"submit\" [showLoader]=\"loadingApproveCode\" [disabled]=\"form.invalid || loadingApproveCode\" icon=\"scIconLogIn\">\n \u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C\n </button>\n </div>\n </form>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.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: "directive", type: i5.TuiLetDirective, selector: "[tuiLet]", inputs: ["tuiLet"] }, { kind: "component", type: ScVerificationPhoneCheckFormComponent, selector: "sc-verification-phone-check-form", inputs: ["showCodeFields", "readOnly", "shouldBeBusy", "shouldBeConfirmed", "haveCode"], outputs: ["haveCodeChange"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
3407
|
+
ScUserPhoneApproveDialogComponent = __decorate([
|
3408
|
+
UntilDestroy({ checkProperties: true })
|
3409
|
+
], ScUserPhoneApproveDialogComponent);
|
3410
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScUserPhoneApproveDialogComponent, decorators: [{
|
3411
|
+
type: Component,
|
3412
|
+
args: [{ selector: 'sc-user-phone-approve-dialog', providers: [SC_USER_PROVIDERS], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"user$ | async as user\">\n <form [formGroup]=\"form\" *tuiLet=\"!!(loading$ | async) as loadingApproveCode\" (ngSubmit)=\"onSubmit.next()\" class=\"flex flex-col gap-3\">\n <sc-verification-phone-check-form\n [(haveCode)]=\"haveCode\"\n [shouldBeConfirmed]=\"false\"\n [showCodeFields]=\"!user.contacts.phone.isApproved\"\n [readOnly]=\"true\"\n class=\"w-full\"\n ></sc-verification-phone-check-form>\n <div *ngIf=\"user.contacts.phone.isApproved || haveCode\" class=\"flex gap-4 justify-center\">\n <button *ngIf=\"user.contacts.phone.isApproved && context\" tuiButton (click)=\"context.$implicit.complete()\" type=\"button\" appearance=\"secondary\">\u0417\u0430\u043A\u0440\u044B\u0442\u044C</button>\n <button *ngIf=\"haveCode\" tuiButton type=\"submit\" [showLoader]=\"loadingApproveCode\" [disabled]=\"form.invalid || loadingApproveCode\" icon=\"scIconLogIn\">\n \u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C\n </button>\n </div>\n </form>\n</ng-container>\n" }]
|
3413
|
+
}], ctorParameters: function () { return [{ type: i1.ScVerificationService }, { type: i10.Observable, decorators: [{
|
3414
|
+
type: Inject,
|
3415
|
+
args: [SC_USER_INFO]
|
3416
|
+
}] }, { type: i1.ScUserService }, { type: undefined, decorators: [{
|
3417
|
+
type: Optional
|
3418
|
+
}, {
|
3419
|
+
type: Inject,
|
3420
|
+
args: [POLYMORPHEUS_CONTEXT]
|
3421
|
+
}] }]; } });
|
3422
|
+
|
3338
3423
|
/**
|
3339
3424
|
* Модуль полей ввода.
|
3340
3425
|
*/
|
@@ -3411,7 +3496,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
3411
3496
|
class ScUserModule {
|
3412
3497
|
}
|
3413
3498
|
ScUserModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScUserModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
3414
|
-
ScUserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: ScUserModule, declarations: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent], imports: [CommonModule,
|
3499
|
+
ScUserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: ScUserModule, declarations: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent, ScUserPhoneApproveDialogComponent], imports: [CommonModule,
|
3415
3500
|
FormsModule,
|
3416
3501
|
ReactiveFormsModule,
|
3417
3502
|
TuiFieldErrorPipeModule,
|
@@ -3430,7 +3515,7 @@ ScUserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
3430
3515
|
TuiCheckboxLabeledModule,
|
3431
3516
|
TuiDataListModule,
|
3432
3517
|
TuiSelectModule,
|
3433
|
-
TuiModeModule], exports: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent] });
|
3518
|
+
TuiModeModule], exports: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent, ScUserPhoneApproveDialogComponent] });
|
3434
3519
|
ScUserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScUserModule, imports: [CommonModule,
|
3435
3520
|
FormsModule,
|
3436
3521
|
ReactiveFormsModule,
|
@@ -3454,7 +3539,7 @@ ScUserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
3454
3539
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScUserModule, decorators: [{
|
3455
3540
|
type: NgModule,
|
3456
3541
|
args: [{
|
3457
|
-
declarations: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent],
|
3542
|
+
declarations: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent, ScUserPhoneApproveDialogComponent],
|
3458
3543
|
imports: [
|
3459
3544
|
CommonModule,
|
3460
3545
|
FormsModule,
|
@@ -3477,7 +3562,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
3477
3562
|
TuiSelectModule,
|
3478
3563
|
TuiModeModule,
|
3479
3564
|
],
|
3480
|
-
exports: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent],
|
3565
|
+
exports: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent, ScUserPhoneApproveDialogComponent],
|
3481
3566
|
}]
|
3482
3567
|
}] });
|
3483
3568
|
|
@@ -3491,23 +3576,41 @@ class ScProfileAccordionsContentComponent {
|
|
3491
3576
|
* @param user$ Поток информации о текущем пользователе.
|
3492
3577
|
* @param locationsService Сервис для получения списков стран, регионов, городов.
|
3493
3578
|
* @param userService Сервис информации о пользователе.
|
3579
|
+
* @param verificationService Сервис верификации.
|
3494
3580
|
*/
|
3495
|
-
constructor(user$, locationsService, userService) {
|
3581
|
+
constructor(user$, locationsService, userService, verificationService) {
|
3496
3582
|
this.user$ = user$;
|
3497
3583
|
this.locationsService = locationsService;
|
3498
3584
|
this.userService = userService;
|
3585
|
+
this.verificationService = verificationService;
|
3499
3586
|
/**
|
3500
3587
|
* {@link FormControl} переключателя 'Я хочу получать рассылку'.
|
3501
3588
|
*/
|
3502
3589
|
this.getNewsControl = new FormControl(false, { nonNullable: true });
|
3503
3590
|
/**
|
3504
|
-
* {@link Observable}
|
3591
|
+
* {@link Observable} запроса изменения признака пользователя 'Я хочу получать рассылку'.
|
3505
3592
|
*/
|
3506
3593
|
this.getNewsRequest$ = this.getNewsControl.valueChanges.pipe(skip(1), switchMap((value) => this.userService.updateUserInfo$({ getNews: value }).pipe(switchMap(() => this.userService.updateUserChange$().pipe(tap((user) => this.getNewsControl.patchValue(user.getNews, { emitEvent: false })), startWith(null))), startWith(null))), share());
|
3507
3594
|
/**
|
3508
|
-
* {@link Observable}
|
3595
|
+
* {@link Observable} изменения состояния загрузки данных изменения признака пользователя 'Я хочу получать рассылку'.
|
3509
3596
|
*/
|
3510
3597
|
this.getNewsLoading$ = this.getNewsRequest$.pipe(map(tuiIsFalsy));
|
3598
|
+
/**
|
3599
|
+
* {@link Subject} события отправки сообщения для подтверждения адреса электронной почты.
|
3600
|
+
*/
|
3601
|
+
this.onSendApproveEmail = new Subject();
|
3602
|
+
/**
|
3603
|
+
* {@link Observable} запроса данных аутентификации.
|
3604
|
+
*/
|
3605
|
+
this.sendApproveEmailRequest$ = this.onSendApproveEmail.pipe(switchMap((value) => this.verificationService.sendEmailApproveCode(value).pipe(map(ALWAYS_TRUE_HANDLER), startWith(null))), startWith(false), share());
|
3606
|
+
/**
|
3607
|
+
* {@link Observable} изменения состояния загрузки данных отправки сообщения для подтверждения адреса электронной почты.
|
3608
|
+
*/
|
3609
|
+
this.approveEmailLoading$ = this.sendApproveEmailRequest$.pipe(map(tuiIsFalsy));
|
3610
|
+
/**
|
3611
|
+
* {@link Observable} изменения состояния признака, отправлено ли сообщение для подтверждения адреса электронной почты.
|
3612
|
+
*/
|
3613
|
+
this.isSendApproveEmail$ = this.sendApproveEmailRequest$.pipe(filter(tuiIsPresent));
|
3511
3614
|
/**
|
3512
3615
|
* Событие нажатия на кнопку редактирование контактного лица.
|
3513
3616
|
*/
|
@@ -3516,10 +3619,6 @@ class ScProfileAccordionsContentComponent {
|
|
3516
3619
|
* Событие нажатия на кнопку подтверждения телефона.
|
3517
3620
|
*/
|
3518
3621
|
this.approvePhoneClick = new EventEmitter();
|
3519
|
-
/**
|
3520
|
-
* Событие нажатия на кнопку подтверждения электронной почты.
|
3521
|
-
*/
|
3522
|
-
this.approveEmailClick = new EventEmitter();
|
3523
3622
|
/**
|
3524
3623
|
* Событие нажатия на кнопку добавления контрагента.
|
3525
3624
|
*/
|
@@ -3538,23 +3637,21 @@ class ScProfileAccordionsContentComponent {
|
|
3538
3637
|
return this.locationsService.getUserCity$(cityId);
|
3539
3638
|
}
|
3540
3639
|
}
|
3541
|
-
ScProfileAccordionsContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScProfileAccordionsContentComponent, deps: [{ token: SC_USER_INFO }, { token: i1.ScLocationsService }, { token: i1.ScUserService }], target: i0.ɵɵFactoryTarget.Component });
|
3542
|
-
ScProfileAccordionsContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScProfileAccordionsContentComponent, selector: "sc-profile-accordions-content", outputs: { editProfileClick: "editProfileClick", approvePhoneClick: "approvePhoneClick",
|
3640
|
+
ScProfileAccordionsContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScProfileAccordionsContentComponent, deps: [{ token: SC_USER_INFO }, { token: i1.ScLocationsService }, { token: i1.ScUserService }, { token: i1.ScVerificationService }], target: i0.ɵɵFactoryTarget.Component });
|
3641
|
+
ScProfileAccordionsContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScProfileAccordionsContentComponent, selector: "sc-profile-accordions-content", outputs: { editProfileClick: "editProfileClick", approvePhoneClick: "approvePhoneClick", addContragentClick: "addContragentClick", addDeliveryAddressClick: "addDeliveryAddressClick" }, providers: [SC_USER_PROVIDERS], ngImport: i0, template: "<div class=\"flex flex-col gap-4\">\n <sc-accordion [showArrow]=\"false\" [showAddButton]=\"false\" [open]=\"true\">\n \u041E\u0431\u0449\u0438\u0435 \u0434\u0430\u043D\u043D\u044B\u0435\n <ng-template scAccordionContent>\n <tui-loader *tuiLet=\"user$ | async as user\" [overlay]=\"true\" [showLoader]=\"user === null\">\n <div class=\"flex gap-2 pl-4\">\n <div *ngIf=\"user\" class=\"flex flex-col flex-grow gap-2\">\n {{ user.name }}\n <div *ngIf=\"user.city && (getUserCity$(user.city) | async) as city\" class=\"flex items-center gap-1\">\n <tui-svg src=\"tuiIconMapPin\"></tui-svg>\n <span>\u0433. {{ city.name }}, </span>\n <span *ngIf=\"city.region\">{{ city.region.name }}</span>\n </div>\n <div class=\"flex flex-wrap gap-2\">\n <a\n tuiLink\n tuiMode=\"onLight\"\n icon=\"tuiIconPhone\"\n iconAlign=\"left\"\n [pseudo]=\"true\"\n href=\"tel:{{ user.contacts.phone.value}}\"\n >{{ user.contacts.phone.value | tuiFormatPhone }}</a\n >\n <span *ngIf=\"!user.contacts.phone.isApproved\" class=\"text-tui-text-03\">\n (\u0422\u0435\u043B\u0435\u0444\u043E\u043D \u043D\u0435 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D. <button tuiLink [pseudo]=\"true\" (click)=\"approvePhoneClick.emit()\">\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C</button>)\n </span>\n </div>\n <div *tuiLet=\"!!(isSendApproveEmail$ | async) as isSendApproveEmail\" class=\"flex flex-wrap gap-x-2\">\n <a tuiLink tuiMode=\"onLight\" icon=\"tuiIconMail\" iconAlign=\"left\" [pseudo]=\"true\" href=\"mailto:{{ user.contacts.email.value }}\">\n {{ user.contacts.email.value }}\n </a>\n <span *ngIf=\"!isSendApproveEmail && !user.contacts.email.isApproved\" class=\"text-tui-text-03 inline-flex gap-1\">\n (E-mail \u043D\u0435 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D.\n <tui-loader [showLoader]=\"!!(approveEmailLoading$ | async)\" [overlay]=\"true\">\n <button tuiLink [pseudo]=\"true\" (click)=\"onSendApproveEmail.next(user.contacts.email.value)\">\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C</button>\n </tui-loader>\n )\n </span>\n <span *ngIf=\"isSendApproveEmail\" class=\"text-tui-success-fill\" @tuiFadeIn>\n \u041F\u0438\u0441\u044C\u043C\u043E \u0434\u043B\u044F \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E. \u041F\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043F\u043E \u0441\u0441\u044B\u043B\u043A\u0435 \u0432 \u043F\u0438\u0441\u044C\u043C\u0435 \u0438 \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u0435 \u044D\u0442\u0443 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443.\n </span>\n </div>\n <tui-loader [showLoader]=\"!!(getNewsLoading$ | async)\" [overlay]=\"true\">\n <tui-checkbox-labeled size=\"m\" class=\"w-full\" [formControl]=\"getNewsControl\" [ngModel]=\"user.getNews\">\n \u042F \u0445\u043E\u0447\u0443 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u0440\u0430\u0441\u0441\u044B\u043B\u043A\u0443 \u0421\u043D\u0430\u0431\u0446\u0435\u043D\u0442\u0440 \u043E \u0441\u043A\u0438\u0434\u043A\u0430\u0445 \u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u044F\u0445 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435.\n </tui-checkbox-labeled>\n </tui-loader>\n </div>\n\n <button tuiIconButton size=\"m\" type=\"button\" icon=\"tuiIconEdit3Large\" tuiMode=\"onLight\" appearance=\"flat\" (click)=\"editProfileClick.emit()\"></button>\n </div>\n </tui-loader>\n </ng-template>\n </sc-accordion>\n <sc-contragents-accordion (addContragentClick)=\"addContragentClick.emit()\"></sc-contragents-accordion>\n <sc-delivery-address-accordion (addDeliveryAddressClick)=\"addDeliveryAddressClick.emit()\"></sc-delivery-address-accordion>\n <sc-accordion [showArrow]=\"false\" [showAddButton]=\"false\">\n \u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u0430\u0440\u043E\u043B\u044C\n <ng-template scAccordionContent>\n <sc-reset-user-password></sc-reset-user-password>\n </ng-template>\n </sc-accordion>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ScResetUserPasswordComponent, selector: "sc-reset-user-password" }, { kind: "component", type: ScAccordionComponent, selector: "sc-accordion", inputs: ["showAddButton", "showDeleteButton", "showArrow", "open", "size"], outputs: ["addButtonClick", "deleteButtonClick"] }, { kind: "directive", type: ScAccordionContentDirective, selector: "ng-template[scAccordionContent]" }, { kind: "component", type: ScContragentsAccordionComponent, selector: "sc-contragents-accordion", outputs: ["addContragentClick", "editBankAccountsContragentClick", "addBankAccountsClick", "editContragentClick"] }, { kind: "component", type: ScDeliveryAddressAccordionComponent, selector: "sc-delivery-address-accordion", outputs: ["addDeliveryAddressClick"] }, { kind: "component", type: i4.TuiLoaderComponent, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "showLoader"] }, { kind: "directive", type: i5.TuiLetDirective, selector: "[tuiLet]", inputs: ["tuiLet"] }, { kind: "component", type: i4.TuiLinkComponent, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo", "icon", "iconAlign", "iconRotated", "mode"], exportAs: ["tuiLink"] }, { kind: "directive", type: i4.TuiModeDirective, selector: "[tuiMode]", inputs: ["tuiMode"] }, { kind: "component", type: i3$1.TuiCheckboxLabeledComponent, selector: "tui-checkbox-labeled", inputs: ["size"] }, { kind: "component", type: i4.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], 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: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TuiFormatPhonePipe, name: "tuiFormatPhone" }], animations: [tuiFadeIn], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
3543
3642
|
__decorate([
|
3544
3643
|
tuiPure // TODO: TASK[#7615] Удалить поле рефакторинга сервиса работы с пользователем.
|
3545
3644
|
], ScProfileAccordionsContentComponent.prototype, "getUserCity$", null);
|
3546
3645
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScProfileAccordionsContentComponent, decorators: [{
|
3547
3646
|
type: Component,
|
3548
|
-
args: [{ selector: 'sc-profile-accordions-content', providers: [SC_USER_PROVIDERS], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-4\">\n <sc-accordion [showArrow]=\"false\" [showAddButton]=\"false\" [open]=\"true\">\n \u041E\u0431\u0449\u0438\u0435 \u0434\u0430\u043D\u043D\u044B\u0435\n <ng-template scAccordionContent>\n <tui-loader *tuiLet=\"user$ | async as user\" [overlay]=\"true\" [showLoader]=\"user === null\">\n <div class=\"flex gap-2 pl-4\">\n <div *ngIf=\"user\" class=\"flex flex-col flex-grow gap-2\">\n {{ user.name }}\n <div *ngIf=\"user.city && (getUserCity$(user.city) | async) as city\" class=\"flex items-center gap-1\">\n <tui-svg src=\"tuiIconMapPin\"></tui-svg>\n <span>\u0433. {{ city.name }}, </span>\n <span *ngIf=\"city.region\">{{ city.region.name }}</span>\n </div>\n <div class=\"flex flex-wrap gap-2\">\n <a\n tuiLink\n tuiMode=\"onLight\"\n icon=\"tuiIconPhone\"\n iconAlign=\"left\"\n [pseudo]=\"true\"\n href=\"tel:{{ user.contacts.phone.value}}\"\n >{{ user.contacts.phone.value | tuiFormatPhone }}</a\n >\n <span *ngIf=\"!user.contacts.phone.isApproved\" class=\"text-tui-text-03\">\n (\u0422\u0435\u043B\u0435\u0444\u043E\u043D \u043D\u0435 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D. <button tuiLink [pseudo]=\"true\" (click)=\"approvePhoneClick.emit()\">\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C</button>)\n </span>\n </div>\n <div class=\"flex flex-wrap gap-2\">\n <a tuiLink tuiMode=\"onLight\" icon=\"tuiIconMail\" iconAlign=\"left\" [pseudo]=\"true\" href=\"mailto:{{ user.contacts.email.value }}\">\n {{ user.contacts.email.value }}\n </a>\n <span *ngIf=\"!user.contacts.email.isApproved\" class=\"text-tui-text-03\">\n (E-mail \u043D\u0435 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D
|
3647
|
+
args: [{ selector: 'sc-profile-accordions-content', providers: [SC_USER_PROVIDERS], animations: [tuiFadeIn], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-4\">\n <sc-accordion [showArrow]=\"false\" [showAddButton]=\"false\" [open]=\"true\">\n \u041E\u0431\u0449\u0438\u0435 \u0434\u0430\u043D\u043D\u044B\u0435\n <ng-template scAccordionContent>\n <tui-loader *tuiLet=\"user$ | async as user\" [overlay]=\"true\" [showLoader]=\"user === null\">\n <div class=\"flex gap-2 pl-4\">\n <div *ngIf=\"user\" class=\"flex flex-col flex-grow gap-2\">\n {{ user.name }}\n <div *ngIf=\"user.city && (getUserCity$(user.city) | async) as city\" class=\"flex items-center gap-1\">\n <tui-svg src=\"tuiIconMapPin\"></tui-svg>\n <span>\u0433. {{ city.name }}, </span>\n <span *ngIf=\"city.region\">{{ city.region.name }}</span>\n </div>\n <div class=\"flex flex-wrap gap-2\">\n <a\n tuiLink\n tuiMode=\"onLight\"\n icon=\"tuiIconPhone\"\n iconAlign=\"left\"\n [pseudo]=\"true\"\n href=\"tel:{{ user.contacts.phone.value}}\"\n >{{ user.contacts.phone.value | tuiFormatPhone }}</a\n >\n <span *ngIf=\"!user.contacts.phone.isApproved\" class=\"text-tui-text-03\">\n (\u0422\u0435\u043B\u0435\u0444\u043E\u043D \u043D\u0435 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D. <button tuiLink [pseudo]=\"true\" (click)=\"approvePhoneClick.emit()\">\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C</button>)\n </span>\n </div>\n <div *tuiLet=\"!!(isSendApproveEmail$ | async) as isSendApproveEmail\" class=\"flex flex-wrap gap-x-2\">\n <a tuiLink tuiMode=\"onLight\" icon=\"tuiIconMail\" iconAlign=\"left\" [pseudo]=\"true\" href=\"mailto:{{ user.contacts.email.value }}\">\n {{ user.contacts.email.value }}\n </a>\n <span *ngIf=\"!isSendApproveEmail && !user.contacts.email.isApproved\" class=\"text-tui-text-03 inline-flex gap-1\">\n (E-mail \u043D\u0435 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D.\n <tui-loader [showLoader]=\"!!(approveEmailLoading$ | async)\" [overlay]=\"true\">\n <button tuiLink [pseudo]=\"true\" (click)=\"onSendApproveEmail.next(user.contacts.email.value)\">\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C</button>\n </tui-loader>\n )\n </span>\n <span *ngIf=\"isSendApproveEmail\" class=\"text-tui-success-fill\" @tuiFadeIn>\n \u041F\u0438\u0441\u044C\u043C\u043E \u0434\u043B\u044F \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E. \u041F\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043F\u043E \u0441\u0441\u044B\u043B\u043A\u0435 \u0432 \u043F\u0438\u0441\u044C\u043C\u0435 \u0438 \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u0435 \u044D\u0442\u0443 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443.\n </span>\n </div>\n <tui-loader [showLoader]=\"!!(getNewsLoading$ | async)\" [overlay]=\"true\">\n <tui-checkbox-labeled size=\"m\" class=\"w-full\" [formControl]=\"getNewsControl\" [ngModel]=\"user.getNews\">\n \u042F \u0445\u043E\u0447\u0443 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u044C \u0440\u0430\u0441\u0441\u044B\u043B\u043A\u0443 \u0421\u043D\u0430\u0431\u0446\u0435\u043D\u0442\u0440 \u043E \u0441\u043A\u0438\u0434\u043A\u0430\u0445 \u0438 \u043D\u043E\u0432\u043E\u0441\u0442\u044F\u0445 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435.\n </tui-checkbox-labeled>\n </tui-loader>\n </div>\n\n <button tuiIconButton size=\"m\" type=\"button\" icon=\"tuiIconEdit3Large\" tuiMode=\"onLight\" appearance=\"flat\" (click)=\"editProfileClick.emit()\"></button>\n </div>\n </tui-loader>\n </ng-template>\n </sc-accordion>\n <sc-contragents-accordion (addContragentClick)=\"addContragentClick.emit()\"></sc-contragents-accordion>\n <sc-delivery-address-accordion (addDeliveryAddressClick)=\"addDeliveryAddressClick.emit()\"></sc-delivery-address-accordion>\n <sc-accordion [showArrow]=\"false\" [showAddButton]=\"false\">\n \u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u0430\u0440\u043E\u043B\u044C\n <ng-template scAccordionContent>\n <sc-reset-user-password></sc-reset-user-password>\n </ng-template>\n </sc-accordion>\n</div>\n" }]
|
3549
3648
|
}], ctorParameters: function () { return [{ type: i10.Observable, decorators: [{
|
3550
3649
|
type: Inject,
|
3551
3650
|
args: [SC_USER_INFO]
|
3552
|
-
}] }, { type: i1.ScLocationsService }, { type: i1.ScUserService }]; }, propDecorators: { editProfileClick: [{
|
3651
|
+
}] }, { type: i1.ScLocationsService }, { type: i1.ScUserService }, { type: i1.ScVerificationService }]; }, propDecorators: { editProfileClick: [{
|
3553
3652
|
type: Output
|
3554
3653
|
}], approvePhoneClick: [{
|
3555
3654
|
type: Output
|
3556
|
-
}], approveEmailClick: [{
|
3557
|
-
type: Output
|
3558
3655
|
}], addContragentClick: [{
|
3559
3656
|
type: Output
|
3560
3657
|
}], addDeliveryAddressClick: [{
|
@@ -3633,5 +3730,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
3633
3730
|
* Generated bundle index. Do not edit.
|
3634
3731
|
*/
|
3635
3732
|
|
3636
|
-
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,
|
3733
|
+
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, ScPriceCardComponent, ScPriceHistoryComponent, ScPriceListPaginationComponent, ScPriceWarehouseStockComponent, ScProfileAccordionsContentComponent, ScProfileModule, ScResetUserPasswordComponent, ScShareButtonComponent, ScShareButtonModule, ScSignInFormByEmailComponent, ScSignInFormByPhoneComponent, ScSignInFormComponent, ScUpdateUserInfoFormComponent, ScUserModule, ScUserPhoneApproveDialogComponent, ScVerificationModule, ScVerificationPhoneCheckFormComponent, TreeDirective, TreeIconService, TreeLoaderService, TreeTopDirective, nextPageClickEvent, paginationParams$, scClientUiIconsName, scPasswordConfirmMatchingValidator, scUserFactory, stepValidator, verificationCodeMask };
|
3637
3734
|
//# sourceMappingURL=snabcentr-client-ui.mjs.map
|