@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
|
var _a, _b;
|
@@ -118,7 +122,7 @@ class ScPhoneApproveFormComponent {
|
|
118
122
|
*/
|
119
123
|
this.verificationCodeMask = verificationCodeMask;
|
120
124
|
/**
|
121
|
-
* {@link Subject}
|
125
|
+
* {@link Subject} события запуска/остановки таймера.
|
122
126
|
*/
|
123
127
|
this.reloadTimer$ = new Subject();
|
124
128
|
/**
|
@@ -167,16 +171,18 @@ class ScPhoneApproveFormComponent {
|
|
167
171
|
if (this.shouldBeBusy !== result.isBusy) {
|
168
172
|
this.phoneControl.setErrors({
|
169
173
|
serverResponse: [
|
170
|
-
|
174
|
+
result.isBusy ? 'Пользователь с таким номером телефона уже существует' : 'Пользователя с таким номером телефона не существует',
|
171
175
|
],
|
172
176
|
});
|
173
177
|
this.phoneControl.markAsTouched();
|
174
178
|
return false;
|
175
179
|
}
|
176
|
-
if (this.shouldBeConfirmed &&
|
180
|
+
if (this.shouldBeConfirmed !== undefined && this.shouldBeConfirmed !== result.isConfirmed) {
|
177
181
|
this.phoneControl.setErrors({
|
178
182
|
serverResponse: [
|
179
|
-
|
183
|
+
result.isConfirmed
|
184
|
+
? 'Телефон уже подтверждён'
|
185
|
+
: 'Номер телефона не подтверждён или вход по нему невозможен. Обратитесь к вашему персональному менеджеру или войдите с использованием e-mail и пароля.',
|
180
186
|
],
|
181
187
|
});
|
182
188
|
this.phoneControl.markAsTouched();
|
@@ -205,11 +211,11 @@ class ScPhoneApproveFormComponent {
|
|
205
211
|
this.haveCodeChange.emit(haveCode);
|
206
212
|
}
|
207
213
|
}
|
208
|
-
|
209
|
-
|
210
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type:
|
214
|
+
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 });
|
215
|
+
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 });
|
216
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScVerificationPhoneCheckFormComponent, decorators: [{
|
211
217
|
type: Component,
|
212
|
-
args: [{ selector: 'sc-phone-
|
218
|
+
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" }]
|
213
219
|
}], ctorParameters: function () {
|
214
220
|
return [{ type: i1.ScVerificationService }, { type: i3.FormGroupDirective, decorators: [{
|
215
221
|
type: Inject,
|
@@ -217,6 +223,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
217
223
|
}] }];
|
218
224
|
}, propDecorators: { showCodeFields: [{
|
219
225
|
type: Input
|
226
|
+
}], readOnly: [{
|
227
|
+
type: Input
|
220
228
|
}], shouldBeBusy: [{
|
221
229
|
type: Input
|
222
230
|
}], shouldBeConfirmed: [{
|
@@ -246,39 +254,39 @@ class ScSignInFormByPhoneComponent {
|
|
246
254
|
/**
|
247
255
|
* Группа полей ввода для формы «Вход на сайт».
|
248
256
|
*/
|
249
|
-
this.
|
257
|
+
this.form = new FormGroup({
|
250
258
|
phone: new FormControl(null, [Validators.required, Validators.minLength(12)]),
|
251
259
|
verificationCode: new FormControl(null, [Validators.required, Validators.minLength(6)]),
|
252
260
|
});
|
253
261
|
/**
|
254
|
-
* {@link Subject}
|
262
|
+
* {@link Subject} события отправки формы.
|
255
263
|
*/
|
256
264
|
this.onSubmit = new Subject();
|
257
265
|
/**
|
258
|
-
* {@link Observable}
|
266
|
+
* {@link Observable} запроса данных аутентификации.
|
259
267
|
*/
|
260
|
-
this.
|
268
|
+
this.request$ = this.onSubmit.pipe(map(() => this.form.value), filter((value) => this.form.valid), switchMap((value) => this.authService.getSignIn$(value).pipe(catchError((error) => {
|
261
269
|
var _a;
|
262
270
|
const errorResponse = error.error;
|
263
271
|
for (const key in errorResponse.errors) {
|
264
|
-
(_a = this.
|
272
|
+
(_a = this.form.get(key)) === null || _a === void 0 ? void 0 : _a.setErrors({ serverResponse: errorResponse.errors[`${key}`] });
|
265
273
|
}
|
266
274
|
if (!errorResponse.errors && errorResponse.message) {
|
267
|
-
this.
|
275
|
+
this.form.setErrors({ serverResponse: [errorResponse.message] });
|
268
276
|
}
|
269
277
|
return of({});
|
270
278
|
}), startWith(null))), share());
|
271
279
|
/**
|
272
|
-
* {@link Observable}
|
280
|
+
* {@link Observable} изменения состояния загрузки данных аутентификации по номеру телефона.
|
273
281
|
*/
|
274
|
-
this.
|
282
|
+
this.loading$ = this.request$.pipe(map(tuiIsFalsy));
|
275
283
|
}
|
276
284
|
}
|
277
285
|
ScSignInFormByPhoneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScSignInFormByPhoneComponent, deps: [{ token: i1.ScAuthService }], target: i0.ɵɵFactoryTarget.Component });
|
278
|
-
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]=\"
|
286
|
+
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 });
|
279
287
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScSignInFormByPhoneComponent, decorators: [{
|
280
288
|
type: Component,
|
281
|
-
args: [{ selector: 'sc-sign-in-form-by-phone', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"
|
289
|
+
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" }]
|
282
290
|
}], ctorParameters: function () { return [{ type: i1.ScAuthService }]; } });
|
283
291
|
|
284
292
|
/**
|
@@ -300,11 +308,11 @@ class ScSignInFormByEmailComponent {
|
|
300
308
|
password: new FormControl(null, Validators.required),
|
301
309
|
});
|
302
310
|
/**
|
303
|
-
* {@link Subject}
|
311
|
+
* {@link Subject} события отправки формы.
|
304
312
|
*/
|
305
313
|
this.onSubmit = new Subject();
|
306
314
|
/**
|
307
|
-
* {@link Observable}
|
315
|
+
* {@link Observable} запроса данных аутентификации.
|
308
316
|
*/
|
309
317
|
this.emailRequest$ = this.onSubmit.pipe(filter(() => this.formByEmail.valid), map(() => this.formByEmail.value), switchMap((value) => this.authService.getSignIn$(value).pipe(catchError((error) => {
|
310
318
|
var _a;
|
@@ -318,7 +326,7 @@ class ScSignInFormByEmailComponent {
|
|
318
326
|
return of({});
|
319
327
|
}), startWith(null))), share());
|
320
328
|
/**
|
321
|
-
* {@link Observable}
|
329
|
+
* {@link Observable} изменения состояния загрузки данных аутентификации по email.
|
322
330
|
*/
|
323
331
|
this.loadingEmailAuth$ = this.emailRequest$.pipe(map(tuiIsFalsy));
|
324
332
|
/**
|
@@ -328,10 +336,10 @@ class ScSignInFormByEmailComponent {
|
|
328
336
|
}
|
329
337
|
}
|
330
338
|
ScSignInFormByEmailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScSignInFormByEmailComponent, deps: [{ token: i1.ScAuthService }], target: i0.ɵɵFactoryTarget.Component });
|
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)\"
|
339
|
+
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 });
|
332
340
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScSignInFormByEmailComponent, decorators: [{
|
333
341
|
type: Component,
|
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)\"
|
342
|
+
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" }]
|
335
343
|
}], ctorParameters: function () { return [{ type: i1.ScAuthService }]; }, propDecorators: { forgotPassword: [{
|
336
344
|
type: Output
|
337
345
|
}] } });
|
@@ -384,10 +392,10 @@ class ScSignInFormComponent {
|
|
384
392
|
}
|
385
393
|
}
|
386
394
|
ScSignInFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScSignInFormComponent, deps: [{ token: i1.ScAuthService }], target: i0.ɵɵFactoryTarget.Component });
|
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
|
395
|
+
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 });
|
388
396
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScSignInFormComponent, decorators: [{
|
389
397
|
type: Component,
|
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
|
398
|
+
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" }]
|
391
399
|
}], ctorParameters: function () { return [{ type: i1.ScAuthService }]; }, propDecorators: { authMethod: [{
|
392
400
|
type: Input
|
393
401
|
}], forgotPassword: [{
|
@@ -404,7 +412,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
404
412
|
class ScVerificationModule {
|
405
413
|
}
|
406
414
|
ScVerificationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScVerificationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
407
|
-
ScVerificationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: ScVerificationModule, declarations: [
|
415
|
+
ScVerificationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: ScVerificationModule, declarations: [ScVerificationPhoneCheckFormComponent], imports: [CommonModule,
|
408
416
|
FormsModule,
|
409
417
|
ReactiveFormsModule,
|
410
418
|
TuiInputPasswordModule,
|
@@ -419,7 +427,7 @@ ScVerificationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
|
|
419
427
|
TuiLetModule,
|
420
428
|
TuiLoaderModule,
|
421
429
|
TuiInputPhoneModule,
|
422
|
-
MaskitoModule], exports: [
|
430
|
+
MaskitoModule], exports: [ScVerificationPhoneCheckFormComponent] });
|
423
431
|
ScVerificationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScVerificationModule, imports: [CommonModule,
|
424
432
|
FormsModule,
|
425
433
|
ReactiveFormsModule,
|
@@ -457,8 +465,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
457
465
|
TuiInputPhoneModule,
|
458
466
|
MaskitoModule,
|
459
467
|
],
|
460
|
-
exports: [
|
461
|
-
declarations: [
|
468
|
+
exports: [ScVerificationPhoneCheckFormComponent],
|
469
|
+
declarations: [ScVerificationPhoneCheckFormComponent],
|
462
470
|
}]
|
463
471
|
}] });
|
464
472
|
|
@@ -710,7 +718,7 @@ let ScBannerComponent = class ScBannerComponent {
|
|
710
718
|
*/
|
711
719
|
this.showPlayBtn = false;
|
712
720
|
/**
|
713
|
-
* {@link Observable}
|
721
|
+
* {@link Observable} обновления списка баннеров.
|
714
722
|
*/
|
715
723
|
this.banners$ = this.bannerService.banners$.pipe(map((banners) => banners.filter((banner) => banner.location === this.bannerLocation).reverse()), tap((banners) => {
|
716
724
|
if (banners.length) {
|
@@ -1565,6 +1573,9 @@ class ScPriceCardComponent {
|
|
1565
1573
|
* Возвращает ссылку на preview-изображение карточки товара.
|
1566
1574
|
*/
|
1567
1575
|
getCardImagePreview() {
|
1576
|
+
if (this.product && this.product.images) {
|
1577
|
+
this.product.images.sort((img1, img2) => Number(img2.isDefault) - Number(img1.isDefault));
|
1578
|
+
}
|
1568
1579
|
return this.product ? this.imageHelper.getImagePreview(this.product) : this.pathImageNotFound;
|
1569
1580
|
}
|
1570
1581
|
/**
|
@@ -3062,11 +3073,11 @@ class ScResetUserPasswordComponent {
|
|
3062
3073
|
newPasswordConfirm: new FormControl(null, [Validators.required, Validators.minLength(8), scPasswordConfirmMatchingValidator('newPassword')]),
|
3063
3074
|
});
|
3064
3075
|
/**
|
3065
|
-
* {@link Subject}
|
3076
|
+
* {@link Subject} события отправки формы.
|
3066
3077
|
*/
|
3067
3078
|
this.onSubmit = new Subject();
|
3068
3079
|
/**
|
3069
|
-
* {@link Observable}
|
3080
|
+
* {@link Observable} запроса данных аутентификации.
|
3070
3081
|
*/
|
3071
3082
|
this.request$ = this.onSubmit.pipe(filter(() => this.form.valid), map(() => this.form.value), switchMap((value) => this.userService.updateUserInfo$(value).pipe(catchError((error) => {
|
3072
3083
|
var _a;
|
@@ -3080,7 +3091,7 @@ class ScResetUserPasswordComponent {
|
|
3080
3091
|
return of(void {});
|
3081
3092
|
}), startWith(null))), share());
|
3082
3093
|
/**
|
3083
|
-
* {@link Observable}
|
3094
|
+
* {@link Observable} изменения состояния загрузки данных аутентификации по email.
|
3084
3095
|
*/
|
3085
3096
|
this.loading$ = this.request$.pipe(map(tuiIsFalsy));
|
3086
3097
|
}
|
@@ -3346,7 +3357,7 @@ class ScUpdateUserInfoFormComponent {
|
|
3346
3357
|
/**
|
3347
3358
|
* {@link Observable} запроса обновления данных пользователя.
|
3348
3359
|
*/
|
3349
|
-
this.request$ = this.onSubmit.pipe(filter(() => this.form.valid), map(() => this.form.value), switchMap((value) => this.userService.updateUserInfo$(value).pipe(switchMap(() => this.userService.updateUserChange$()),
|
3360
|
+
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) => {
|
3350
3361
|
var _a;
|
3351
3362
|
const errorResponse = error.error;
|
3352
3363
|
for (const key in errorResponse.errors) {
|
@@ -3356,9 +3367,9 @@ class ScUpdateUserInfoFormComponent {
|
|
3356
3367
|
this.form.setErrors({ serverResponse: [errorResponse.message] });
|
3357
3368
|
}
|
3358
3369
|
return of({});
|
3359
|
-
}));
|
3370
|
+
}), startWith(null))));
|
3360
3371
|
/**
|
3361
|
-
* {@link Observable}
|
3372
|
+
* {@link Observable} изменения состояния загрузки данных аутентификации по email.
|
3362
3373
|
*/
|
3363
3374
|
this.loading$ = this.request$.pipe(map(tuiIsFalsy));
|
3364
3375
|
this.user$.subscribe((user) => this.form.patchValue({
|
@@ -3371,10 +3382,10 @@ class ScUpdateUserInfoFormComponent {
|
|
3371
3382
|
}
|
3372
3383
|
}
|
3373
3384
|
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 });
|
3374
|
-
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-
|
3385
|
+
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 });
|
3375
3386
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScUpdateUserInfoFormComponent, decorators: [{
|
3376
3387
|
type: Component,
|
3377
|
-
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-
|
3388
|
+
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" }]
|
3378
3389
|
}], ctorParameters: function () {
|
3379
3390
|
return [{ type: i10.Observable, decorators: [{
|
3380
3391
|
type: Inject,
|
@@ -3386,6 +3397,83 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
3386
3397
|
type: Output
|
3387
3398
|
}] } });
|
3388
3399
|
|
3400
|
+
/**
|
3401
|
+
* Диалоговое окно подтверждения номера телефона.
|
3402
|
+
*/
|
3403
|
+
let ScUserPhoneApproveDialogComponent = class ScUserPhoneApproveDialogComponent {
|
3404
|
+
/**
|
3405
|
+
* Инициализирует экземпляр класса {@link ScUserPhoneApproveDialogComponent}.
|
3406
|
+
*
|
3407
|
+
* @param verificationService Сервис верификации.
|
3408
|
+
* @param user$ Поток информации о текущем пользователе.
|
3409
|
+
* @param userService Сервис информации о пользователе.
|
3410
|
+
* @param context Контекст диалогового окна, в котором открыт компонент.
|
3411
|
+
*/
|
3412
|
+
constructor(verificationService, user$, userService, context) {
|
3413
|
+
this.verificationService = verificationService;
|
3414
|
+
this.user$ = user$;
|
3415
|
+
this.userService = userService;
|
3416
|
+
this.context = context;
|
3417
|
+
/**
|
3418
|
+
* Наличие кода подтверждения у пользователя.
|
3419
|
+
*/
|
3420
|
+
this.haveCode = false;
|
3421
|
+
/**
|
3422
|
+
* Группа полей ввода для подтверждения номера телефона.
|
3423
|
+
*/
|
3424
|
+
this.form = new FormGroup({
|
3425
|
+
phone: new FormControl(null, [Validators.required, Validators.minLength(12)]),
|
3426
|
+
verificationCode: new FormControl(null, [Validators.required, Validators.minLength(6)]),
|
3427
|
+
});
|
3428
|
+
/**
|
3429
|
+
* {@link Subject} события отправки формы.
|
3430
|
+
*/
|
3431
|
+
this.onSubmit = new Subject();
|
3432
|
+
/**
|
3433
|
+
* {@link Observable} запроса подтверждения номера телефона.
|
3434
|
+
*/
|
3435
|
+
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) => { var _a; return (_a = this.context) === null || _a === void 0 ? void 0 : _a.completeWith(user.contacts.phone); }), catchError((error) => {
|
3436
|
+
var _a;
|
3437
|
+
const errorResponse = error.error;
|
3438
|
+
for (const key in errorResponse.errors) {
|
3439
|
+
(_a = this.form.get(key)) === null || _a === void 0 ? void 0 : _a.setErrors({ serverResponse: errorResponse.errors[`${key}`] });
|
3440
|
+
}
|
3441
|
+
if (!errorResponse.errors && errorResponse.message) {
|
3442
|
+
this.form.setErrors({ serverResponse: [errorResponse.message] });
|
3443
|
+
}
|
3444
|
+
return of({});
|
3445
|
+
}), startWith(null))), share());
|
3446
|
+
/**
|
3447
|
+
* {@link Observable} изменения состояния запроса подтверждения номера телефона..
|
3448
|
+
*/
|
3449
|
+
this.loading$ = this.request$.pipe(map(tuiIsFalsy));
|
3450
|
+
this.user$.pipe(untilDestroyed(this)).subscribe((user) => {
|
3451
|
+
this.form.patchValue({
|
3452
|
+
phone: user.contacts.phone.value,
|
3453
|
+
});
|
3454
|
+
});
|
3455
|
+
}
|
3456
|
+
};
|
3457
|
+
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 });
|
3458
|
+
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 });
|
3459
|
+
ScUserPhoneApproveDialogComponent = __decorate([
|
3460
|
+
UntilDestroy({ checkProperties: true })
|
3461
|
+
], ScUserPhoneApproveDialogComponent);
|
3462
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScUserPhoneApproveDialogComponent, decorators: [{
|
3463
|
+
type: Component,
|
3464
|
+
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" }]
|
3465
|
+
}], ctorParameters: function () {
|
3466
|
+
return [{ type: i1.ScVerificationService }, { type: i10.Observable, decorators: [{
|
3467
|
+
type: Inject,
|
3468
|
+
args: [SC_USER_INFO]
|
3469
|
+
}] }, { type: i1.ScUserService }, { type: undefined, decorators: [{
|
3470
|
+
type: Optional
|
3471
|
+
}, {
|
3472
|
+
type: Inject,
|
3473
|
+
args: [POLYMORPHEUS_CONTEXT]
|
3474
|
+
}] }];
|
3475
|
+
} });
|
3476
|
+
|
3389
3477
|
/**
|
3390
3478
|
* Модуль полей ввода.
|
3391
3479
|
*/
|
@@ -3462,7 +3550,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
3462
3550
|
class ScUserModule {
|
3463
3551
|
}
|
3464
3552
|
ScUserModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScUserModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
3465
|
-
ScUserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: ScUserModule, declarations: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent], imports: [CommonModule,
|
3553
|
+
ScUserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: ScUserModule, declarations: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent, ScUserPhoneApproveDialogComponent], imports: [CommonModule,
|
3466
3554
|
FormsModule,
|
3467
3555
|
ReactiveFormsModule,
|
3468
3556
|
TuiFieldErrorPipeModule,
|
@@ -3481,7 +3569,7 @@ ScUserModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
3481
3569
|
TuiCheckboxLabeledModule,
|
3482
3570
|
TuiDataListModule,
|
3483
3571
|
TuiSelectModule,
|
3484
|
-
TuiModeModule], exports: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent] });
|
3572
|
+
TuiModeModule], exports: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent, ScUserPhoneApproveDialogComponent] });
|
3485
3573
|
ScUserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScUserModule, imports: [CommonModule,
|
3486
3574
|
FormsModule,
|
3487
3575
|
ReactiveFormsModule,
|
@@ -3505,7 +3593,7 @@ ScUserModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
3505
3593
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScUserModule, decorators: [{
|
3506
3594
|
type: NgModule,
|
3507
3595
|
args: [{
|
3508
|
-
declarations: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent],
|
3596
|
+
declarations: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent, ScUserPhoneApproveDialogComponent],
|
3509
3597
|
imports: [
|
3510
3598
|
CommonModule,
|
3511
3599
|
FormsModule,
|
@@ -3528,7 +3616,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
3528
3616
|
TuiSelectModule,
|
3529
3617
|
TuiModeModule,
|
3530
3618
|
],
|
3531
|
-
exports: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent],
|
3619
|
+
exports: [ScResetUserPasswordComponent, ScUpdateUserInfoFormComponent, ScUserPhoneApproveDialogComponent],
|
3532
3620
|
}]
|
3533
3621
|
}] });
|
3534
3622
|
|
@@ -3542,23 +3630,41 @@ class ScProfileAccordionsContentComponent {
|
|
3542
3630
|
* @param user$ Поток информации о текущем пользователе.
|
3543
3631
|
* @param locationsService Сервис для получения списков стран, регионов, городов.
|
3544
3632
|
* @param userService Сервис информации о пользователе.
|
3633
|
+
* @param verificationService Сервис верификации.
|
3545
3634
|
*/
|
3546
|
-
constructor(user$, locationsService, userService) {
|
3635
|
+
constructor(user$, locationsService, userService, verificationService) {
|
3547
3636
|
this.user$ = user$;
|
3548
3637
|
this.locationsService = locationsService;
|
3549
3638
|
this.userService = userService;
|
3639
|
+
this.verificationService = verificationService;
|
3550
3640
|
/**
|
3551
3641
|
* {@link FormControl} переключателя 'Я хочу получать рассылку'.
|
3552
3642
|
*/
|
3553
3643
|
this.getNewsControl = new FormControl(false, { nonNullable: true });
|
3554
3644
|
/**
|
3555
|
-
* {@link Observable}
|
3645
|
+
* {@link Observable} запроса изменения признака пользователя 'Я хочу получать рассылку'.
|
3556
3646
|
*/
|
3557
3647
|
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());
|
3558
3648
|
/**
|
3559
|
-
* {@link Observable}
|
3649
|
+
* {@link Observable} изменения состояния загрузки данных изменения признака пользователя 'Я хочу получать рассылку'.
|
3560
3650
|
*/
|
3561
3651
|
this.getNewsLoading$ = this.getNewsRequest$.pipe(map(tuiIsFalsy));
|
3652
|
+
/**
|
3653
|
+
* {@link Subject} события отправки сообщения для подтверждения адреса электронной почты.
|
3654
|
+
*/
|
3655
|
+
this.onSendApproveEmail = new Subject();
|
3656
|
+
/**
|
3657
|
+
* {@link Observable} запроса данных аутентификации.
|
3658
|
+
*/
|
3659
|
+
this.sendApproveEmailRequest$ = this.onSendApproveEmail.pipe(switchMap((value) => this.verificationService.sendEmailApproveCode(value).pipe(map(ALWAYS_TRUE_HANDLER), startWith(null))), startWith(false), share());
|
3660
|
+
/**
|
3661
|
+
* {@link Observable} изменения состояния загрузки данных отправки сообщения для подтверждения адреса электронной почты.
|
3662
|
+
*/
|
3663
|
+
this.approveEmailLoading$ = this.sendApproveEmailRequest$.pipe(map(tuiIsFalsy));
|
3664
|
+
/**
|
3665
|
+
* {@link Observable} изменения состояния признака, отправлено ли сообщение для подтверждения адреса электронной почты.
|
3666
|
+
*/
|
3667
|
+
this.isSendApproveEmail$ = this.sendApproveEmailRequest$.pipe(filter(tuiIsPresent));
|
3562
3668
|
/**
|
3563
3669
|
* Событие нажатия на кнопку редактирование контактного лица.
|
3564
3670
|
*/
|
@@ -3567,10 +3673,6 @@ class ScProfileAccordionsContentComponent {
|
|
3567
3673
|
* Событие нажатия на кнопку подтверждения телефона.
|
3568
3674
|
*/
|
3569
3675
|
this.approvePhoneClick = new EventEmitter();
|
3570
|
-
/**
|
3571
|
-
* Событие нажатия на кнопку подтверждения электронной почты.
|
3572
|
-
*/
|
3573
|
-
this.approveEmailClick = new EventEmitter();
|
3574
3676
|
/**
|
3575
3677
|
* Событие нажатия на кнопку добавления контрагента.
|
3576
3678
|
*/
|
@@ -3589,25 +3691,23 @@ class ScProfileAccordionsContentComponent {
|
|
3589
3691
|
return this.locationsService.getUserCity$(cityId);
|
3590
3692
|
}
|
3591
3693
|
}
|
3592
|
-
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 });
|
3593
|
-
ScProfileAccordionsContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ScProfileAccordionsContentComponent, selector: "sc-profile-accordions-content", outputs: { editProfileClick: "editProfileClick", approvePhoneClick: "approvePhoneClick",
|
3694
|
+
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 });
|
3695
|
+
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 });
|
3594
3696
|
__decorate([
|
3595
3697
|
tuiPure // TODO: TASK[#7615] Удалить поле рефакторинга сервиса работы с пользователем.
|
3596
3698
|
], ScProfileAccordionsContentComponent.prototype, "getUserCity$", null);
|
3597
3699
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ScProfileAccordionsContentComponent, decorators: [{
|
3598
3700
|
type: Component,
|
3599
|
-
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
|
3701
|
+
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" }]
|
3600
3702
|
}], ctorParameters: function () {
|
3601
3703
|
return [{ type: i10.Observable, decorators: [{
|
3602
3704
|
type: Inject,
|
3603
3705
|
args: [SC_USER_INFO]
|
3604
|
-
}] }, { type: i1.ScLocationsService }, { type: i1.ScUserService }];
|
3706
|
+
}] }, { type: i1.ScLocationsService }, { type: i1.ScUserService }, { type: i1.ScVerificationService }];
|
3605
3707
|
}, propDecorators: { editProfileClick: [{
|
3606
3708
|
type: Output
|
3607
3709
|
}], approvePhoneClick: [{
|
3608
3710
|
type: Output
|
3609
|
-
}], approveEmailClick: [{
|
3610
|
-
type: Output
|
3611
3711
|
}], addContragentClick: [{
|
3612
3712
|
type: Output
|
3613
3713
|
}], addDeliveryAddressClick: [{
|
@@ -3686,5 +3786,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
3686
3786
|
* Generated bundle index. Do not edit.
|
3687
3787
|
*/
|
3688
3788
|
|
3689
|
-
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,
|
3789
|
+
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 };
|
3690
3790
|
//# sourceMappingURL=snabcentr-client-ui.mjs.map
|