@abp/ng.account 5.0.1 → 5.1.3

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.
Files changed (58) hide show
  1. package/config/package.json +5 -5
  2. package/{esm2015/abp-ng.account.js → esm2020/abp-ng.account.mjs} +0 -0
  3. package/{esm2015/config/abp-ng.account-config.js → esm2020/config/abp-ng.account-config.mjs} +0 -0
  4. package/{esm2015/config/account-config.module.js → esm2020/config/account-config.module.mjs} +5 -5
  5. package/{esm2015/config/enums/index.js → esm2020/config/enums/index.mjs} +0 -0
  6. package/{esm2015/config/enums/route-names.js → esm2020/config/enums/route-names.mjs} +0 -0
  7. package/{esm2015/config/providers/index.js → esm2020/config/providers/index.mjs} +0 -0
  8. package/{esm2015/config/providers/route.provider.js → esm2020/config/providers/route.provider.mjs} +0 -0
  9. package/{esm2015/config/public-api.js → esm2020/config/public-api.mjs} +0 -0
  10. package/{esm2015/config/utils/factories.js → esm2020/config/utils/factories.mjs} +0 -0
  11. package/{esm2015/lib/account-routing.module.js → esm2020/lib/account-routing.module.mjs} +5 -5
  12. package/{esm2015/lib/account.module.js → esm2020/lib/account.module.mjs} +5 -5
  13. package/esm2020/lib/components/change-password/change-password.component.mjs +87 -0
  14. package/esm2020/lib/components/forgot-password/forgot-password.component.mjs +43 -0
  15. package/{esm2015/lib/components/index.js → esm2020/lib/components/index.mjs} +0 -0
  16. package/esm2020/lib/components/login/login.component.mjs +64 -0
  17. package/esm2020/lib/components/manage-profile/manage-profile.component.mjs +45 -0
  18. package/esm2020/lib/components/personal-settings/personal-settings.component.mjs +55 -0
  19. package/esm2020/lib/components/register/register.component.mjs +83 -0
  20. package/esm2020/lib/components/reset-password/reset-password.component.mjs +68 -0
  21. package/{esm2015/lib/enums/components.js → esm2020/lib/enums/components.mjs} +0 -0
  22. package/{esm2015/lib/enums/index.js → esm2020/lib/enums/index.mjs} +0 -0
  23. package/{esm2015/lib/guards/authentication-flow.guard.js → esm2020/lib/guards/authentication-flow.guard.mjs} +4 -4
  24. package/{esm2015/lib/guards/index.js → esm2020/lib/guards/index.mjs} +0 -0
  25. package/{esm2015/lib/models/account.js → esm2020/lib/models/account.mjs} +0 -0
  26. package/{esm2015/lib/models/config-options.js → esm2020/lib/models/config-options.mjs} +0 -0
  27. package/{esm2015/lib/models/index.js → esm2020/lib/models/index.mjs} +0 -0
  28. package/{esm2015/lib/services/index.js → esm2020/lib/services/index.mjs} +0 -0
  29. package/{esm2015/lib/services/manage-profile.state.service.js → esm2020/lib/services/manage-profile.state.service.mjs} +4 -4
  30. package/{esm2015/lib/tokens/config-options.token.js → esm2020/lib/tokens/config-options.token.mjs} +0 -0
  31. package/{esm2015/lib/tokens/index.js → esm2020/lib/tokens/index.mjs} +0 -0
  32. package/{esm2015/lib/utils/auth-utils.js → esm2020/lib/utils/auth-utils.mjs} +0 -0
  33. package/esm2020/lib/utils/factory-utils.mjs +7 -0
  34. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  35. package/fesm2015/{abp-ng.account-config.js → abp-ng.account-config.mjs} +5 -5
  36. package/fesm2015/abp-ng.account-config.mjs.map +1 -0
  37. package/fesm2015/abp-ng.account.mjs +571 -0
  38. package/fesm2015/abp-ng.account.mjs.map +1 -0
  39. package/fesm2020/abp-ng.account-config.mjs +90 -0
  40. package/fesm2020/abp-ng.account-config.mjs.map +1 -0
  41. package/fesm2020/abp-ng.account.mjs +575 -0
  42. package/fesm2020/abp-ng.account.mjs.map +1 -0
  43. package/package.json +30 -9
  44. package/bundles/abp-ng.account-config.umd.js +0 -120
  45. package/bundles/abp-ng.account-config.umd.js.map +0 -1
  46. package/bundles/abp-ng.account.umd.js +0 -974
  47. package/bundles/abp-ng.account.umd.js.map +0 -1
  48. package/esm2015/lib/components/change-password/change-password.component.js +0 -90
  49. package/esm2015/lib/components/forgot-password/forgot-password.component.js +0 -46
  50. package/esm2015/lib/components/login/login.component.js +0 -68
  51. package/esm2015/lib/components/manage-profile/manage-profile.component.js +0 -50
  52. package/esm2015/lib/components/personal-settings/personal-settings.component.js +0 -59
  53. package/esm2015/lib/components/register/register.component.js +0 -87
  54. package/esm2015/lib/components/reset-password/reset-password.component.js +0 -71
  55. package/esm2015/lib/utils/factory-utils.js +0 -4
  56. package/fesm2015/abp-ng.account-config.js.map +0 -1
  57. package/fesm2015/abp-ng.account.js +0 -598
  58. package/fesm2015/abp-ng.account.js.map +0 -1
@@ -1,598 +0,0 @@
1
- import * as i3 from '@abp/ng.core';
2
- import { InternalStore, RouterOutletComponent, ReplaceableRouteContainerComponent, AuthGuard, LazyModuleFactory, CoreModule } from '@abp/ng.core';
3
- import * as i2$1 from '@abp/ng.theme.shared';
4
- import { getPasswordValidators, fadeIn, ThemeSharedModule } from '@abp/ng.theme.shared';
5
- import * as i0 from '@angular/core';
6
- import { Component, InjectionToken, Injectable, NgModule } from '@angular/core';
7
- import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
8
- import * as i6$1 from '@ngx-validate/core';
9
- import { comparePasswords, NgxValidateCoreModule } from '@ngx-validate/core';
10
- import * as i3$1 from '@angular/router';
11
- import { ActivatedRoute, RouterModule } from '@angular/router';
12
- import * as i2 from '@abp/ng.account.core/proxy';
13
- import * as i1 from '@angular/forms';
14
- import { Validators, FormControl } from '@angular/forms';
15
- import { finalize, catchError, switchMap } from 'rxjs/operators';
16
- import * as i6 from '@angular/common';
17
- import { throwError } from 'rxjs';
18
- import { trigger, transition, useAnimation } from '@angular/animations';
19
-
20
- class ForgotPasswordComponent {
21
- constructor(fb, accountService) {
22
- this.fb = fb;
23
- this.accountService = accountService;
24
- this.isEmailSent = false;
25
- this.form = this.fb.group({
26
- email: ['', [Validators.required, Validators.email]],
27
- });
28
- }
29
- onSubmit() {
30
- if (this.form.invalid)
31
- return;
32
- this.inProgress = true;
33
- this.accountService
34
- .sendPasswordResetCode({
35
- email: this.form.get('email').value,
36
- appName: 'Angular',
37
- })
38
- .pipe(finalize(() => (this.inProgress = false)))
39
- .subscribe(() => {
40
- this.isEmailSent = true;
41
- });
42
- }
43
- }
44
- ForgotPasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ForgotPasswordComponent, deps: [{ token: i1.FormBuilder }, { token: i2.AccountService }], target: i0.ɵɵFactoryTarget.Component });
45
- ForgotPasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: ForgotPasswordComponent, selector: "abp-forgot-password", ngImport: i0, template: "<h4>{{ 'AbpAccount::ForgotPassword' | abpLocalization }}</h4>\r\n\r\n<form\r\n *ngIf=\"!isEmailSent; else emailSentTemplate\"\r\n [formGroup]=\"form\"\r\n (ngSubmit)=\"onSubmit()\"\r\n validateOnSubmit\r\n>\r\n <p>{{ 'AbpAccount::SendPasswordResetLink_Information' | abpLocalization }}</p>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-email-address\" class=\"form-label\">{{\r\n 'AbpAccount::EmailAddress' | abpLocalization\r\n }}</label\r\n ><span> * </span>\r\n <input type=\"email\" id=\"input-email-address\" class=\"form-control\" formControlName=\"email\" />\r\n </div>\r\n <abp-button\r\n class=\"d-block\"\r\n buttonClass=\"mt-2 mb-3 btn btn-primary btn-block\"\r\n [loading]=\"inProgress\"\r\n buttonType=\"submit\"\r\n [disabled]=\"form?.invalid\"\r\n >\r\n {{ 'AbpAccount::Submit' | abpLocalization }}\r\n </abp-button>\r\n <a routerLink=\"/account/login\"\r\n ><i class=\"fa fa-long-arrow-left me-1\"></i>{{ 'AbpAccount::Login' | abpLocalization }}</a\r\n >\r\n</form>\r\n\r\n<ng-template #emailSentTemplate>\r\n <p>\r\n {{ 'AbpAccount::PasswordResetMailSentMessage' | abpLocalization }}\r\n </p>\r\n\r\n <a routerLink=\"/account/login\">\r\n <button class=\"d-block mt-2 mb-3 btn btn-primary btn-block\">\r\n <i class=\"fa fa-long-arrow-left me-1\"></i>\r\n {{ 'AbpAccount::BackToLogin' | abpLocalization }}\r\n </button>\r\n </a>\r\n</ng-template>\r\n", components: [{ type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { type: i3$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }], pipes: { "abpLocalization": i3.LocalizationPipe } });
46
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ForgotPasswordComponent, decorators: [{
47
- type: Component,
48
- args: [{
49
- selector: 'abp-forgot-password',
50
- templateUrl: 'forgot-password.component.html',
51
- }]
52
- }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i2.AccountService }]; } });
53
-
54
- const ACCOUNT_CONFIG_OPTIONS = new InjectionToken('ACCOUNT_CONFIG_OPTIONS');
55
-
56
- function getRedirectUrl(injector) {
57
- const route = injector.get(ActivatedRoute);
58
- const options = injector.get(ACCOUNT_CONFIG_OPTIONS);
59
- return route.snapshot.queryParams.returnUrl || options.redirectUrl || '/';
60
- }
61
-
62
- const { maxLength: maxLength$2, required: required$3 } = Validators;
63
- class LoginComponent {
64
- constructor(injector, fb, toasterService, authService, configState) {
65
- this.injector = injector;
66
- this.fb = fb;
67
- this.toasterService = toasterService;
68
- this.authService = authService;
69
- this.configState = configState;
70
- this.isSelfRegistrationEnabled = true;
71
- this.authWrapperKey = "Account.AuthWrapperComponent" /* AuthWrapper */;
72
- }
73
- ngOnInit() {
74
- this.init();
75
- this.buildForm();
76
- }
77
- init() {
78
- this.isSelfRegistrationEnabled =
79
- (this.configState.getSetting('Abp.Account.IsSelfRegistrationEnabled') || '').toLowerCase() !== 'false';
80
- }
81
- buildForm() {
82
- this.form = this.fb.group({
83
- username: ['', [required$3, maxLength$2(255)]],
84
- password: ['', [required$3, maxLength$2(128)]],
85
- rememberMe: [false],
86
- });
87
- }
88
- onSubmit() {
89
- if (this.form.invalid)
90
- return;
91
- this.inProgress = true;
92
- const { username, password, rememberMe } = this.form.value;
93
- const redirectUrl = getRedirectUrl(this.injector);
94
- this.authService
95
- .login({ username, password, rememberMe, redirectUrl })
96
- .pipe(catchError(err => {
97
- var _a, _b;
98
- this.toasterService.error(((_a = err.error) === null || _a === void 0 ? void 0 : _a.error_description) ||
99
- ((_b = err.error) === null || _b === void 0 ? void 0 : _b.error.message) ||
100
- 'AbpAccount::DefaultErrorMessage', null, { life: 7000 });
101
- return throwError(err);
102
- }), finalize(() => (this.inProgress = false)))
103
- .subscribe();
104
- }
105
- }
106
- LoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LoginComponent, deps: [{ token: i0.Injector }, { token: i1.FormBuilder }, { token: i2$1.ToasterService }, { token: i3.AuthService }, { token: i3.ConfigStateService }], target: i0.ɵɵFactoryTarget.Component });
107
- LoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: LoginComponent, selector: "abp-login", ngImport: i0, template: "<h4>{{ 'AbpAccount::Login' | abpLocalization }}</h4>\r\n<strong *ngIf=\"isSelfRegistrationEnabled\">\r\n {{ 'AbpAccount::AreYouANewUser' | abpLocalization }}\r\n <a class=\"text-decoration-none\" routerLink=\"/account/register\" queryParamsHandling=\"preserve\">{{\r\n 'AbpAccount::Register' | abpLocalization\r\n }}</a>\r\n</strong>\r\n<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\" validateOnSubmit class=\"mt-4\">\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"login-input-user-name-or-email-address\" class=\"form-label\">{{\r\n 'AbpAccount::UserNameOrEmailAddress' | abpLocalization\r\n }}</label>\r\n <input\r\n class=\"form-control\"\r\n type=\"text\"\r\n id=\"login-input-user-name-or-email-address\"\r\n formControlName=\"username\"\r\n autocomplete=\"username\"\r\n autofocus\r\n />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"login-input-password\" class=\"form-label\">{{ 'AbpAccount::Password' | abpLocalization }}</label>\r\n <input\r\n class=\"form-control\"\r\n type=\"password\"\r\n id=\"login-input-password\"\r\n formControlName=\"password\"\r\n autocomplete=\"current-password\"\r\n />\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col\">\r\n <div class=\"form-check\">\r\n <label class=\"form-check-label mb-2\" for=\"login-input-remember-me\">\r\n <input\r\n class=\"form-check-input\"\r\n type=\"checkbox\"\r\n id=\"login-input-remember-me\"\r\n formControlName=\"rememberMe\"\r\n />\r\n {{ 'AbpAccount::RememberMe' | abpLocalization }}\r\n </label>\r\n </div>\r\n </div>\r\n <div class=\"text-end col\">\r\n <a routerLink=\"/account/forgot-password\">{{\r\n 'AbpAccount::ForgotPassword' | abpLocalization\r\n }}</a>\r\n </div>\r\n </div>\r\n\r\n <abp-button\r\n [loading]=\"inProgress\"\r\n buttonType=\"submit\"\r\n name=\"Action\"\r\n buttonClass=\"btn-block btn-lg mt-3 btn btn-primary\"\r\n >\r\n {{ 'AbpAccount::Login' | abpLocalization }}\r\n </abp-button>\r\n</form>\r\n", components: [{ type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { type: i3.AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }, { type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }], pipes: { "abpLocalization": i3.LocalizationPipe } });
108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LoginComponent, decorators: [{
109
- type: Component,
110
- args: [{
111
- selector: 'abp-login',
112
- templateUrl: './login.component.html',
113
- }]
114
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1.FormBuilder }, { type: i2$1.ToasterService }, { type: i3.AuthService }, { type: i3.ConfigStateService }]; } });
115
-
116
- class ManageProfileStateService {
117
- constructor() {
118
- this.store = new InternalStore({});
119
- }
120
- get createOnUpdateStream() {
121
- return this.store.sliceUpdate;
122
- }
123
- getProfile$() {
124
- return this.store.sliceState(state => state.profile);
125
- }
126
- getProfile() {
127
- return this.store.state.profile;
128
- }
129
- setProfile(profile) {
130
- this.store.patch({ profile });
131
- }
132
- }
133
- ManageProfileStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ManageProfileStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
134
- ManageProfileStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ManageProfileStateService, providedIn: 'root' });
135
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ManageProfileStateService, decorators: [{
136
- type: Injectable,
137
- args: [{ providedIn: 'root' }]
138
- }] });
139
-
140
- const { required: required$2 } = Validators;
141
- const PASSWORD_FIELDS$1 = ['newPassword', 'repeatNewPassword'];
142
- class ChangePasswordComponent {
143
- constructor(fb, injector, toasterService, profileService, manageProfileState) {
144
- this.fb = fb;
145
- this.injector = injector;
146
- this.toasterService = toasterService;
147
- this.profileService = profileService;
148
- this.manageProfileState = manageProfileState;
149
- this.mapErrorsFn = (errors, groupErrors, control) => {
150
- if (PASSWORD_FIELDS$1.indexOf(String(control.name)) < 0)
151
- return errors;
152
- return errors.concat(groupErrors.filter(({ key }) => key === 'passwordMismatch'));
153
- };
154
- }
155
- ngOnInit() {
156
- var _a;
157
- this.hideCurrentPassword = !((_a = this.manageProfileState.getProfile()) === null || _a === void 0 ? void 0 : _a.hasPassword);
158
- const passwordValidations = getPasswordValidators(this.injector);
159
- this.form = this.fb.group({
160
- password: ['', required$2],
161
- newPassword: [
162
- '',
163
- {
164
- validators: [required$2, ...passwordValidations],
165
- },
166
- ],
167
- repeatNewPassword: [
168
- '',
169
- {
170
- validators: [required$2, ...passwordValidations],
171
- },
172
- ],
173
- }, {
174
- validators: [comparePasswords(PASSWORD_FIELDS$1)],
175
- });
176
- if (this.hideCurrentPassword)
177
- this.form.removeControl('password');
178
- }
179
- onSubmit() {
180
- if (this.form.invalid)
181
- return;
182
- this.inProgress = true;
183
- this.profileService
184
- .changePassword(Object.assign(Object.assign({}, (!this.hideCurrentPassword && { currentPassword: this.form.get('password').value })), { newPassword: this.form.get('newPassword').value }))
185
- .pipe(finalize(() => (this.inProgress = false)))
186
- .subscribe({
187
- next: () => {
188
- this.form.reset();
189
- this.toasterService.success('AbpAccount::PasswordChangedMessage', '', {
190
- life: 5000,
191
- });
192
- if (this.hideCurrentPassword) {
193
- this.hideCurrentPassword = false;
194
- this.form.addControl('password', new FormControl('', [required$2]));
195
- }
196
- },
197
- error: err => {
198
- var _a, _b;
199
- this.toasterService.error(((_b = (_a = err.error) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.message) || 'AbpAccount::DefaultErrorMessage');
200
- },
201
- });
202
- }
203
- }
204
- ChangePasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ChangePasswordComponent, deps: [{ token: i1.FormBuilder }, { token: i0.Injector }, { token: i2$1.ToasterService }, { token: i2.ProfileService }, { token: ManageProfileStateService }], target: i0.ɵɵFactoryTarget.Component });
205
- ChangePasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: ChangePasswordComponent, selector: "abp-change-password-form", exportAs: ["abpChangePasswordForm"], ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\" [mapErrorsFn]=\"mapErrorsFn\" validateOnSubmit>\r\n <div *ngIf=\"!hideCurrentPassword\" class=\"mb-3 form-group\">\r\n <label for=\"current-password\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:CurrentPassword' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"password\"\r\n id=\"current-password\"\r\n class=\"form-control\"\r\n formControlName=\"password\"\r\n autofocus\r\n autocomplete=\"current-password\"\r\n />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"new-password\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:NewPassword' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"password\"\r\n id=\"new-password\"\r\n class=\"form-control\"\r\n formControlName=\"newPassword\"\r\n autocomplete=\"new-password\"\r\n />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"confirm-new-password\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:NewPasswordConfirm' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"password\"\r\n id=\"confirm-new-password\"\r\n class=\"form-control\"\r\n formControlName=\"repeatNewPassword\"\r\n autocomplete=\"new-password\"\r\n />\r\n </div>\r\n <abp-button\r\n iconClass=\"fa fa-check\"\r\n buttonClass=\"btn btn-primary color-white\"\r\n buttonType=\"submit\"\r\n [loading]=\"inProgress\"\r\n [disabled]=\"form?.invalid\"\r\n >{{ 'AbpIdentity::Save' | abpLocalization }}</abp-button\r\n >\r\n</form>\r\n", components: [{ type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { type: i3.AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }], pipes: { "abpLocalization": i3.LocalizationPipe } });
206
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ChangePasswordComponent, decorators: [{
207
- type: Component,
208
- args: [{
209
- selector: 'abp-change-password-form',
210
- templateUrl: './change-password.component.html',
211
- exportAs: 'abpChangePasswordForm',
212
- }]
213
- }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i0.Injector }, { type: i2$1.ToasterService }, { type: i2.ProfileService }, { type: ManageProfileStateService }]; } });
214
-
215
- const { maxLength: maxLength$1, required: required$1, email: email$1 } = Validators;
216
- class PersonalSettingsComponent {
217
- constructor(fb, toasterService, profileService, manageProfileState) {
218
- this.fb = fb;
219
- this.toasterService = toasterService;
220
- this.profileService = profileService;
221
- this.manageProfileState = manageProfileState;
222
- }
223
- ngOnInit() {
224
- this.buildForm();
225
- }
226
- buildForm() {
227
- const profile = this.manageProfileState.getProfile();
228
- this.form = this.fb.group({
229
- userName: [profile.userName, [required$1, maxLength$1(256)]],
230
- email: [profile.email, [required$1, email$1, maxLength$1(256)]],
231
- name: [profile.name || '', [maxLength$1(64)]],
232
- surname: [profile.surname || '', [maxLength$1(64)]],
233
- phoneNumber: [profile.phoneNumber || '', [maxLength$1(16)]],
234
- });
235
- }
236
- submit() {
237
- if (this.form.invalid)
238
- return;
239
- this.inProgress = true;
240
- this.profileService
241
- .update(this.form.value)
242
- .pipe(finalize(() => (this.inProgress = false)))
243
- .subscribe(profile => {
244
- this.manageProfileState.setProfile(profile);
245
- this.toasterService.success('AbpAccount::PersonalSettingsSaved', 'Success', { life: 5000 });
246
- });
247
- }
248
- }
249
- PersonalSettingsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PersonalSettingsComponent, deps: [{ token: i1.FormBuilder }, { token: i2$1.ToasterService }, { token: i2.ProfileService }, { token: ManageProfileStateService }], target: i0.ɵɵFactoryTarget.Component });
250
- PersonalSettingsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: PersonalSettingsComponent, selector: "abp-personal-settings-form", exportAs: ["abpPersonalSettingsForm"], ngImport: i0, template: "<form validateOnSubmit *ngIf=\"form\" [formGroup]=\"form\" (ngSubmit)=\"submit()\">\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"username\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:UserName' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"text\"\r\n id=\"username\"\r\n class=\"form-control\"\r\n formControlName=\"userName\"\r\n autofocus\r\n (keydown.space)=\"$event.preventDefault()\"\r\n />\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col col-md-6\">\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"name\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Name' | abpLocalization\r\n }}</label\r\n ><input type=\"text\" id=\"name\" class=\"form-control\" formControlName=\"name\" />\r\n </div>\r\n </div>\r\n <div class=\"col col-md-6\">\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"surname\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Surname' | abpLocalization\r\n }}</label\r\n ><input type=\"text\" id=\"surname\" class=\"form-control\" formControlName=\"surname\" />\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"email-address\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:Email' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input type=\"text\" id=\"email-address\" class=\"form-control\" formControlName=\"email\" />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"phone-number\" class=\"form-label\">{{\r\n 'AbpIdentity::DisplayName:PhoneNumber' | abpLocalization\r\n }}</label\r\n ><input type=\"text\" id=\"phone-number\" class=\"form-control\" formControlName=\"phoneNumber\" />\r\n </div>\r\n <abp-button\r\n buttonType=\"submit\"\r\n iconClass=\"fa fa-check\"\r\n buttonClass=\"btn btn-primary color-white\"\r\n [loading]=\"inProgress\"\r\n [disabled]=\"form?.invalid\"\r\n >\r\n {{ 'AbpIdentity::Save' | abpLocalization }}</abp-button\r\n >\r\n</form>\r\n", components: [{ type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { type: i3.AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }], pipes: { "abpLocalization": i3.LocalizationPipe } });
251
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PersonalSettingsComponent, decorators: [{
252
- type: Component,
253
- args: [{
254
- selector: 'abp-personal-settings-form',
255
- templateUrl: './personal-settings.component.html',
256
- exportAs: 'abpPersonalSettingsForm',
257
- }]
258
- }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i2$1.ToasterService }, { type: i2.ProfileService }, { type: ManageProfileStateService }]; } });
259
-
260
- class ManageProfileComponent {
261
- constructor(profileService, manageProfileState) {
262
- this.profileService = profileService;
263
- this.manageProfileState = manageProfileState;
264
- this.selectedTab = 0;
265
- this.changePasswordKey = "Account.ChangePasswordComponent" /* ChangePassword */;
266
- this.personalSettingsKey = "Account.PersonalSettingsComponent" /* PersonalSettings */;
267
- this.profile$ = this.manageProfileState.getProfile$();
268
- }
269
- ngOnInit() {
270
- this.profileService.get().subscribe(profile => {
271
- this.manageProfileState.setProfile(profile);
272
- if (profile.isExternal) {
273
- this.hideChangePasswordTab = true;
274
- this.selectedTab = 1;
275
- }
276
- });
277
- }
278
- }
279
- ManageProfileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ManageProfileComponent, deps: [{ token: i2.ProfileService }, { token: ManageProfileStateService }], target: i0.ɵɵFactoryTarget.Component });
280
- ManageProfileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: ManageProfileComponent, selector: "abp-manage-profile", ngImport: i0, template: "<div id=\"AbpContentToolbar\"></div>\r\n\r\n<div class=\"card border-0 shadow-sm min-h-400\" [abpLoading]=\"!(profile$ | async)?.userName\">\r\n <div class=\"card-body\">\r\n <div class=\"row\">\r\n <div class=\"col-12 col-md-3\">\r\n <ul class=\"nav flex-column nav-pills\" id=\"nav-tab\" role=\"tablist\">\r\n <li\r\n *ngIf=\"!hideChangePasswordTab && (profile$ | async)\"\r\n class=\"nav-item\"\r\n (click)=\"selectedTab = 0\"\r\n >\r\n <a\r\n class=\"nav-link\"\r\n [ngClass]=\"{ active: selectedTab === 0 }\"\r\n role=\"tab\"\r\n href=\"javascript:void(0)\"\r\n >{{ 'AbpUi::ChangePassword' | abpLocalization }}</a\r\n >\r\n </li>\r\n <li class=\"nav-item mb-2\" (click)=\"selectedTab = 1\">\r\n <a\r\n class=\"nav-link\"\r\n [ngClass]=\"{ active: selectedTab === 1 }\"\r\n role=\"tab\"\r\n href=\"javascript:void(0)\"\r\n >{{ 'AbpAccount::PersonalSettings' | abpLocalization }}</a\r\n >\r\n </li>\r\n </ul>\r\n </div>\r\n <div *ngIf=\"profile$ | async\" class=\"col-12 col-md-9\">\r\n <div class=\"tab-content\" *ngIf=\"selectedTab === 0\" [@fadeIn]>\r\n <div class=\"tab-pane active\" role=\"tabpanel\">\r\n <h4>\r\n {{ 'AbpIdentity::ChangePassword' | abpLocalization }}\r\n <hr />\r\n </h4>\r\n <abp-change-password-form\r\n *abpReplaceableTemplate=\"{\r\n componentKey: changePasswordKey\r\n }\"\r\n ></abp-change-password-form>\r\n </div>\r\n </div>\r\n <div class=\"tab-content\" *ngIf=\"selectedTab === 1\" [@fadeIn]>\r\n <div class=\"tab-pane active\" role=\"tabpanel\">\r\n <h4>\r\n {{ 'AbpIdentity::PersonalSettings' | abpLocalization }}\r\n <hr />\r\n </h4>\r\n <abp-personal-settings-form\r\n *abpReplaceableTemplate=\"{\r\n componentKey: personalSettingsKey\r\n }\"\r\n ></abp-personal-settings-form>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["\n .min-h-400 {\n min-height: 400px;\n }\n "], components: [{ type: ChangePasswordComponent, selector: "abp-change-password-form", exportAs: ["abpChangePasswordForm"] }, { type: PersonalSettingsComponent, selector: "abp-personal-settings-form", exportAs: ["abpPersonalSettingsForm"] }], directives: [{ type: i2$1.LoadingDirective, selector: "[abpLoading]", inputs: ["abpLoading", "abpLoadingTargetElement", "abpLoadingDelay"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.ReplaceableTemplateDirective, selector: "[abpReplaceableTemplate]", inputs: ["abpReplaceableTemplate"] }], pipes: { "async": i6.AsyncPipe, "abpLocalization": i3.LocalizationPipe }, animations: [trigger('fadeIn', [transition(':enter', useAnimation(fadeIn))])] });
281
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ManageProfileComponent, decorators: [{
282
- type: Component,
283
- args: [{
284
- selector: 'abp-manage-profile',
285
- templateUrl: './manage-profile.component.html',
286
- animations: [trigger('fadeIn', [transition(':enter', useAnimation(fadeIn))])],
287
- styles: [
288
- `
289
- .min-h-400 {
290
- min-height: 400px;
291
- }
292
- `,
293
- ],
294
- }]
295
- }], ctorParameters: function () { return [{ type: i2.ProfileService }, { type: ManageProfileStateService }]; } });
296
-
297
- const { maxLength, required, email } = Validators;
298
- class RegisterComponent {
299
- constructor(fb, accountService, configState, toasterService, authService, injector) {
300
- this.fb = fb;
301
- this.accountService = accountService;
302
- this.configState = configState;
303
- this.toasterService = toasterService;
304
- this.authService = authService;
305
- this.injector = injector;
306
- this.isSelfRegistrationEnabled = true;
307
- this.authWrapperKey = "Account.AuthWrapperComponent" /* AuthWrapper */;
308
- }
309
- ngOnInit() {
310
- this.init();
311
- this.buildForm();
312
- }
313
- init() {
314
- this.isSelfRegistrationEnabled =
315
- (this.configState.getSetting('Abp.Account.IsSelfRegistrationEnabled') || '').toLowerCase() !==
316
- 'false';
317
- if (!this.isSelfRegistrationEnabled) {
318
- this.toasterService.warn({
319
- key: 'AbpAccount::SelfRegistrationDisabledMessage',
320
- defaultValue: 'Self registration is disabled.',
321
- }, null, { life: 10000 });
322
- return;
323
- }
324
- }
325
- buildForm() {
326
- this.form = this.fb.group({
327
- username: ['', [required, maxLength(255)]],
328
- password: ['', [required, ...getPasswordValidators(this.injector)]],
329
- email: ['', [required, email]],
330
- });
331
- }
332
- onSubmit() {
333
- if (this.form.invalid)
334
- return;
335
- this.inProgress = true;
336
- const newUser = {
337
- userName: this.form.get('username').value,
338
- password: this.form.get('password').value,
339
- emailAddress: this.form.get('email').value,
340
- appName: 'Angular',
341
- };
342
- this.accountService
343
- .register(newUser)
344
- .pipe(switchMap(() => this.authService.login({
345
- username: newUser.userName,
346
- password: newUser.password,
347
- redirectUrl: getRedirectUrl(this.injector),
348
- })), catchError(err => {
349
- var _a, _b;
350
- this.toasterService.error(((_a = err.error) === null || _a === void 0 ? void 0 : _a.error_description) ||
351
- ((_b = err.error) === null || _b === void 0 ? void 0 : _b.error.message) ||
352
- 'AbpAccount::DefaultErrorMessage', null, { life: 7000 });
353
- return throwError(err);
354
- }), finalize(() => (this.inProgress = false)))
355
- .subscribe();
356
- }
357
- }
358
- RegisterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: RegisterComponent, deps: [{ token: i1.FormBuilder }, { token: i2.AccountService }, { token: i3.ConfigStateService }, { token: i2$1.ToasterService }, { token: i3.AuthService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
359
- RegisterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: RegisterComponent, selector: "abp-register", ngImport: i0, template: "<h4>{{ 'AbpAccount::Register' | abpLocalization }}</h4>\r\n<strong>\r\n {{ 'AbpAccount::AlreadyRegistered' | abpLocalization }}\r\n <a class=\"text-decoration-none\" routerLink=\"/account/login\">{{\r\n 'AbpAccount::Login' | abpLocalization\r\n }}</a>\r\n</strong>\r\n<form\r\n *ngIf=\"isSelfRegistrationEnabled\"\r\n [formGroup]=\"form\"\r\n (ngSubmit)=\"onSubmit()\"\r\n validateOnSubmit\r\n class=\"mt-4\"\r\n>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-user-name\" class=\"form-label\">{{\r\n 'AbpAccount::UserName' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n autofocus\r\n type=\"text\"\r\n id=\"input-user-name\"\r\n class=\"form-control\"\r\n formControlName=\"username\"\r\n autocomplete=\"username\"\r\n />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-email-address\" class=\"form-label\">{{\r\n 'AbpAccount::EmailAddress' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input type=\"email\" id=\"input-email-address\" class=\"form-control\" formControlName=\"email\" />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-password\" class=\"form-label\">{{\r\n 'AbpAccount::Password' | abpLocalization\r\n }}</label\r\n ><span> * </span\r\n ><input\r\n type=\"password\"\r\n id=\"input-password\"\r\n class=\"form-control\"\r\n formControlName=\"password\"\r\n autocomplete=\"current-password\"\r\n />\r\n </div>\r\n <abp-button\r\n [loading]=\"inProgress\"\r\n buttonType=\"submit\"\r\n name=\"Action\"\r\n buttonClass=\"btn-block btn-lg mt-3 btn btn-primary\"\r\n >\r\n {{ 'AbpAccount::Register' | abpLocalization }}\r\n </abp-button>\r\n</form>\r\n", components: [{ type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i3$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3.AutofocusDirective, selector: "[autofocus]", inputs: ["autofocus"] }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }], pipes: { "abpLocalization": i3.LocalizationPipe } });
360
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: RegisterComponent, decorators: [{
361
- type: Component,
362
- args: [{
363
- selector: 'abp-register',
364
- templateUrl: './register.component.html',
365
- }]
366
- }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i2.AccountService }, { type: i3.ConfigStateService }, { type: i2$1.ToasterService }, { type: i3.AuthService }, { type: i0.Injector }]; } });
367
-
368
- const PASSWORD_FIELDS = ['password', 'confirmPassword'];
369
- class ResetPasswordComponent {
370
- constructor(fb, accountService, route, router, injector) {
371
- this.fb = fb;
372
- this.accountService = accountService;
373
- this.route = route;
374
- this.router = router;
375
- this.injector = injector;
376
- this.inProgress = false;
377
- this.isPasswordReset = false;
378
- this.mapErrorsFn = (errors, groupErrors, control) => {
379
- if (PASSWORD_FIELDS.indexOf(String(control.name)) < 0)
380
- return errors;
381
- return errors.concat(groupErrors.filter(({ key }) => key === 'passwordMismatch'));
382
- };
383
- }
384
- ngOnInit() {
385
- this.route.queryParams.subscribe(({ userId, resetToken }) => {
386
- if (!userId || !resetToken)
387
- this.router.navigateByUrl('/account/login');
388
- this.form = this.fb.group({
389
- userId: [userId, [Validators.required]],
390
- resetToken: [resetToken, [Validators.required]],
391
- password: ['', [Validators.required, ...getPasswordValidators(this.injector)]],
392
- confirmPassword: ['', [Validators.required, ...getPasswordValidators(this.injector)]],
393
- }, {
394
- validators: [comparePasswords(PASSWORD_FIELDS)],
395
- });
396
- });
397
- }
398
- onSubmit() {
399
- if (this.form.invalid || this.inProgress)
400
- return;
401
- this.inProgress = true;
402
- this.accountService
403
- .resetPassword({
404
- userId: this.form.get('userId').value,
405
- resetToken: this.form.get('resetToken').value,
406
- password: this.form.get('password').value,
407
- })
408
- .pipe(finalize(() => (this.inProgress = false)))
409
- .subscribe(() => {
410
- this.isPasswordReset = true;
411
- });
412
- }
413
- }
414
- ResetPasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ResetPasswordComponent, deps: [{ token: i1.FormBuilder }, { token: i2.AccountService }, { token: i3$1.ActivatedRoute }, { token: i3$1.Router }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
415
- ResetPasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: ResetPasswordComponent, selector: "abp-reset-password", ngImport: i0, template: "<h4>{{ 'AbpAccount::ResetPassword' | abpLocalization }}</h4>\r\n\r\n<form\r\n *ngIf=\"!isPasswordReset; else passwordResetTemplate\"\r\n [formGroup]=\"form\"\r\n [mapErrorsFn]=\"mapErrorsFn\"\r\n (ngSubmit)=\"onSubmit()\"\r\n validateOnSubmit\r\n>\r\n <p>{{ 'AbpAccount::ResetPassword_Information' | abpLocalization }}</p>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-password\" class=\"form-label\">{{\r\n 'AbpAccount::Password' | abpLocalization\r\n }}</label\r\n ><span> * </span>\r\n <input type=\"password\" id=\"input-password\" class=\"form-control\" formControlName=\"password\" />\r\n </div>\r\n <div class=\"mb-3 form-group\">\r\n <label for=\"input-confirm-password\" class=\"form-label\">{{\r\n 'AbpAccount::ConfirmPassword' | abpLocalization\r\n }}</label\r\n ><span> * </span>\r\n <input\r\n type=\"password\"\r\n id=\"input-confirm-password\"\r\n class=\"form-control\"\r\n formControlName=\"confirmPassword\"\r\n />\r\n </div>\r\n <button class=\"me-2 btn btn-secondary\" type=\"button\" routerLink=\"/account/login\">\r\n {{ 'AbpAccount::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button\r\n buttonType=\"submit\"\r\n buttonClass=\"me-2 btn btn-primary\"\r\n [loading]=\"inProgress\"\r\n (click)=\"onSubmit()\"\r\n >\r\n {{ 'AbpAccount::Submit' | abpLocalization }}\r\n </abp-button>\r\n</form>\r\n\r\n<ng-template #passwordResetTemplate>\r\n <p>\r\n {{ 'AbpAccount::YourPasswordIsSuccessfullyReset' | abpLocalization }}\r\n </p>\r\n\r\n <a routerLink=\"/account/login\">\r\n <button class=\"d-block mt-2 mb-3 btn btn-primary\">\r\n {{ 'AbpAccount::BackToLogin' | abpLocalization }}\r\n </button>\r\n </a>\r\n</ng-template>\r\n", components: [{ type: i2$1.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6$1.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i6$1.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { type: i3$1.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["routerLink", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }, { type: i3$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }], pipes: { "abpLocalization": i3.LocalizationPipe } });
416
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ResetPasswordComponent, decorators: [{
417
- type: Component,
418
- args: [{
419
- selector: 'abp-reset-password',
420
- templateUrl: './reset-password.component.html',
421
- }]
422
- }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i2.AccountService }, { type: i3$1.ActivatedRoute }, { type: i3$1.Router }, { type: i0.Injector }]; } });
423
-
424
- class AuthenticationFlowGuard {
425
- constructor(authService) {
426
- this.authService = authService;
427
- }
428
- canActivate() {
429
- if (this.authService.isInternalAuth)
430
- return true;
431
- this.authService.navigateToLogin();
432
- return false;
433
- }
434
- }
435
- AuthenticationFlowGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AuthenticationFlowGuard, deps: [{ token: i3.AuthService }], target: i0.ɵɵFactoryTarget.Injectable });
436
- AuthenticationFlowGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AuthenticationFlowGuard });
437
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AuthenticationFlowGuard, decorators: [{
438
- type: Injectable
439
- }], ctorParameters: function () { return [{ type: i3.AuthService }]; } });
440
-
441
- const routes = [
442
- { path: '', pathMatch: 'full', redirectTo: 'login' },
443
- {
444
- path: '',
445
- component: RouterOutletComponent,
446
- children: [
447
- {
448
- path: 'login',
449
- component: ReplaceableRouteContainerComponent,
450
- canActivate: [AuthenticationFlowGuard],
451
- data: {
452
- replaceableComponent: {
453
- key: "Account.LoginComponent" /* Login */,
454
- defaultComponent: LoginComponent,
455
- },
456
- },
457
- },
458
- {
459
- path: 'register',
460
- component: ReplaceableRouteContainerComponent,
461
- canActivate: [AuthenticationFlowGuard],
462
- data: {
463
- replaceableComponent: {
464
- key: "Account.RegisterComponent" /* Register */,
465
- defaultComponent: RegisterComponent,
466
- },
467
- },
468
- },
469
- {
470
- path: 'forgot-password',
471
- component: ReplaceableRouteContainerComponent,
472
- canActivate: [AuthenticationFlowGuard],
473
- data: {
474
- replaceableComponent: {
475
- key: "Account.ForgotPasswordComponent" /* ForgotPassword */,
476
- defaultComponent: ForgotPasswordComponent,
477
- },
478
- },
479
- },
480
- {
481
- path: 'reset-password',
482
- component: ReplaceableRouteContainerComponent,
483
- canActivate: [],
484
- data: {
485
- tenantBoxVisible: false,
486
- replaceableComponent: {
487
- key: "Account.ResetPasswordComponent" /* ResetPassword */,
488
- defaultComponent: ResetPasswordComponent,
489
- },
490
- },
491
- },
492
- {
493
- path: 'manage',
494
- component: ReplaceableRouteContainerComponent,
495
- canActivate: [AuthGuard],
496
- data: {
497
- replaceableComponent: {
498
- key: "Account.ManageProfileComponent" /* ManageProfile */,
499
- defaultComponent: ManageProfileComponent,
500
- },
501
- },
502
- },
503
- ],
504
- },
505
- ];
506
- class AccountRoutingModule {
507
- }
508
- AccountRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
509
- AccountRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountRoutingModule, imports: [i3$1.RouterModule], exports: [RouterModule] });
510
- AccountRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountRoutingModule, imports: [[RouterModule.forChild(routes)], RouterModule] });
511
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountRoutingModule, decorators: [{
512
- type: NgModule,
513
- args: [{
514
- imports: [RouterModule.forChild(routes)],
515
- exports: [RouterModule],
516
- }]
517
- }] });
518
-
519
- function accountConfigOptionsFactory(options) {
520
- return Object.assign({ redirectUrl: '/' }, options);
521
- }
522
-
523
- const declarations = [
524
- LoginComponent,
525
- RegisterComponent,
526
- ChangePasswordComponent,
527
- ManageProfileComponent,
528
- PersonalSettingsComponent,
529
- ForgotPasswordComponent,
530
- ResetPasswordComponent,
531
- ];
532
- class AccountModule {
533
- static forChild(options = {}) {
534
- return {
535
- ngModule: AccountModule,
536
- providers: [
537
- AuthenticationFlowGuard,
538
- { provide: ACCOUNT_CONFIG_OPTIONS, useValue: options },
539
- {
540
- provide: 'ACCOUNT_OPTIONS',
541
- useFactory: accountConfigOptionsFactory,
542
- deps: [ACCOUNT_CONFIG_OPTIONS],
543
- },
544
- ],
545
- };
546
- }
547
- static forLazy(options = {}) {
548
- return new LazyModuleFactory(AccountModule.forChild(options));
549
- }
550
- }
551
- AccountModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
552
- AccountModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountModule, declarations: [LoginComponent,
553
- RegisterComponent,
554
- ChangePasswordComponent,
555
- ManageProfileComponent,
556
- PersonalSettingsComponent,
557
- ForgotPasswordComponent,
558
- ResetPasswordComponent], imports: [CoreModule,
559
- AccountRoutingModule,
560
- ThemeSharedModule,
561
- NgbDropdownModule,
562
- NgxValidateCoreModule], exports: [LoginComponent,
563
- RegisterComponent,
564
- ChangePasswordComponent,
565
- ManageProfileComponent,
566
- PersonalSettingsComponent,
567
- ForgotPasswordComponent,
568
- ResetPasswordComponent] });
569
- AccountModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountModule, imports: [[
570
- CoreModule,
571
- AccountRoutingModule,
572
- ThemeSharedModule,
573
- NgbDropdownModule,
574
- NgxValidateCoreModule,
575
- ]] });
576
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountModule, decorators: [{
577
- type: NgModule,
578
- args: [{
579
- declarations: [...declarations],
580
- imports: [
581
- CoreModule,
582
- AccountRoutingModule,
583
- ThemeSharedModule,
584
- NgbDropdownModule,
585
- NgxValidateCoreModule,
586
- ],
587
- exports: [...declarations],
588
- }]
589
- }] });
590
-
591
- /* eslint-disable @typescript-eslint/no-empty-interface */
592
-
593
- /**
594
- * Generated bundle index. Do not edit.
595
- */
596
-
597
- export { ACCOUNT_CONFIG_OPTIONS, AccountModule, AuthenticationFlowGuard, ChangePasswordComponent, ForgotPasswordComponent, LoginComponent, ManageProfileComponent, ManageProfileStateService, PersonalSettingsComponent, RegisterComponent, ResetPasswordComponent };
598
- //# sourceMappingURL=abp-ng.account.js.map