@abp/ng.identity 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 (70) hide show
  1. package/config/package.json +5 -5
  2. package/{esm2015/abp-ng.identity.js → esm2020/abp-ng.identity.mjs} +0 -0
  3. package/{esm2015/config/abp-ng.identity-config.js → esm2020/config/abp-ng.identity-config.mjs} +0 -0
  4. package/{esm2015/config/enums/index.js → esm2020/config/enums/index.mjs} +0 -0
  5. package/{esm2015/config/enums/policy-names.js → esm2020/config/enums/policy-names.mjs} +0 -0
  6. package/{esm2015/config/enums/route-names.js → esm2020/config/enums/route-names.mjs} +0 -0
  7. package/{esm2015/config/identity-config.module.js → esm2020/config/identity-config.module.mjs} +5 -5
  8. package/{esm2015/config/providers/index.js → esm2020/config/providers/index.mjs} +0 -0
  9. package/{esm2015/config/providers/route.provider.js → esm2020/config/providers/route.provider.mjs} +0 -0
  10. package/{esm2015/config/public-api.js → esm2020/config/public-api.mjs} +0 -0
  11. package/{esm2015/lib/components/index.js → esm2020/lib/components/index.mjs} +0 -0
  12. package/esm2020/lib/components/roles/roles.component.mjs +108 -0
  13. package/esm2020/lib/components/users/users.component.mjs +140 -0
  14. package/{esm2015/lib/defaults/default-roles-entity-actions.js → esm2020/lib/defaults/default-roles-entity-actions.mjs} +0 -0
  15. package/esm2020/lib/defaults/default-roles-entity-props.mjs +24 -0
  16. package/{esm2015/lib/defaults/default-roles-form-props.js → esm2020/lib/defaults/default-roles-form-props.mjs} +0 -0
  17. package/{esm2015/lib/defaults/default-roles-toolbar-actions.js → esm2020/lib/defaults/default-roles-toolbar-actions.mjs} +0 -0
  18. package/{esm2015/lib/defaults/default-users-entity-actions.js → esm2020/lib/defaults/default-users-entity-actions.mjs} +0 -0
  19. package/esm2020/lib/defaults/default-users-entity-props.mjs +35 -0
  20. package/{esm2015/lib/defaults/default-users-form-props.js → esm2020/lib/defaults/default-users-form-props.mjs} +0 -0
  21. package/{esm2015/lib/defaults/default-users-toolbar-actions.js → esm2020/lib/defaults/default-users-toolbar-actions.mjs} +0 -0
  22. package/{esm2015/lib/enums/components.js → esm2020/lib/enums/components.mjs} +0 -0
  23. package/{esm2015/lib/enums/index.js → esm2020/lib/enums/index.mjs} +0 -0
  24. package/{esm2015/lib/guards/extensions.guard.js → esm2020/lib/guards/extensions.guard.mjs} +4 -4
  25. package/{esm2015/lib/guards/index.js → esm2020/lib/guards/index.mjs} +0 -0
  26. package/{esm2015/lib/identity-routing.module.js → esm2020/lib/identity-routing.module.mjs} +5 -5
  27. package/{esm2015/lib/identity.module.js → esm2020/lib/identity.module.mjs} +5 -5
  28. package/{esm2015/lib/models/config-options.js → esm2020/lib/models/config-options.mjs} +0 -0
  29. package/{esm2015/lib/models/index.js → esm2020/lib/models/index.mjs} +0 -0
  30. package/{esm2015/lib/tokens/extensions.token.js → esm2020/lib/tokens/extensions.token.mjs} +0 -0
  31. package/{esm2015/lib/tokens/index.js → esm2020/lib/tokens/index.mjs} +0 -0
  32. package/{esm2015/proxy/abp-ng.identity-proxy.js → esm2020/proxy/abp-ng.identity-proxy.mjs} +0 -0
  33. package/{esm2015/proxy/lib/index.js → esm2020/proxy/lib/index.mjs} +0 -0
  34. package/{esm2015/proxy/lib/proxy/identity/identity-role.service.js → esm2020/proxy/lib/proxy/identity/identity-role.service.mjs} +4 -4
  35. package/{esm2015/proxy/lib/proxy/identity/identity-user-lookup.service.js → esm2020/proxy/lib/proxy/identity/identity-user-lookup.service.mjs} +4 -4
  36. package/{esm2015/proxy/lib/proxy/identity/identity-user.service.js → esm2020/proxy/lib/proxy/identity/identity-user.service.mjs} +4 -4
  37. package/{esm2015/proxy/lib/proxy/identity/index.js → esm2020/proxy/lib/proxy/identity/index.mjs} +0 -0
  38. package/{esm2015/proxy/lib/proxy/identity/models.js → esm2020/proxy/lib/proxy/identity/models.mjs} +0 -0
  39. package/{esm2015/proxy/lib/proxy/users/index.js → esm2020/proxy/lib/proxy/users/index.mjs} +0 -0
  40. package/{esm2015/proxy/lib/proxy/users/models.js → esm2020/proxy/lib/proxy/users/models.mjs} +0 -0
  41. package/{esm2015/proxy/public-api.js → esm2020/proxy/public-api.mjs} +0 -0
  42. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  43. package/fesm2015/{abp-ng.identity-config.js → abp-ng.identity-config.mjs} +5 -5
  44. package/fesm2015/abp-ng.identity-config.mjs.map +1 -0
  45. package/fesm2015/{abp-ng.identity-proxy.js → abp-ng.identity-proxy.mjs} +11 -11
  46. package/fesm2015/abp-ng.identity-proxy.mjs.map +1 -0
  47. package/fesm2015/{abp-ng.identity.js → abp-ng.identity.mjs} +27 -35
  48. package/fesm2015/abp-ng.identity.mjs.map +1 -0
  49. package/fesm2020/abp-ng.identity-config.mjs +58 -0
  50. package/fesm2020/abp-ng.identity-config.mjs.map +1 -0
  51. package/fesm2020/abp-ng.identity-proxy.mjs +144 -0
  52. package/fesm2020/abp-ng.identity-proxy.mjs.map +1 -0
  53. package/fesm2020/abp-ng.identity.mjs +636 -0
  54. package/fesm2020/abp-ng.identity.mjs.map +1 -0
  55. package/package.json +38 -9
  56. package/proxy/package.json +5 -5
  57. package/proxy/src/lib/proxy/README.md +17 -0
  58. package/bundles/abp-ng.identity-config.umd.js +0 -89
  59. package/bundles/abp-ng.identity-config.umd.js.map +0 -1
  60. package/bundles/abp-ng.identity-proxy.umd.js +0 -179
  61. package/bundles/abp-ng.identity-proxy.umd.js.map +0 -1
  62. package/bundles/abp-ng.identity.umd.js +0 -1024
  63. package/bundles/abp-ng.identity.umd.js.map +0 -1
  64. package/esm2015/lib/components/roles/roles.component.js +0 -112
  65. package/esm2015/lib/components/users/users.component.js +0 -144
  66. package/esm2015/lib/defaults/default-roles-entity-props.js +0 -24
  67. package/esm2015/lib/defaults/default-users-entity-props.js +0 -35
  68. package/fesm2015/abp-ng.identity-config.js.map +0 -1
  69. package/fesm2015/abp-ng.identity-proxy.js.map +0 -1
  70. package/fesm2015/abp-ng.identity.js.map +0 -1
@@ -0,0 +1,636 @@
1
+ import * as i1 from '@abp/ng.core';
2
+ import { ListService, LocalizationService, escapeHtmlChars, ConfigStateService, RouterOutletComponent, AuthGuard, PermissionGuard, ReplaceableRouteContainerComponent, LazyModuleFactory, CoreModule } from '@abp/ng.core';
3
+ import * as i3 from '@abp/ng.identity/proxy';
4
+ import * as i2 from '@abp/ng.theme.shared';
5
+ import { Confirmation, getPasswordValidators, ThemeSharedModule } from '@abp/ng.theme.shared';
6
+ import * as i4 from '@abp/ng.theme.shared/extensions';
7
+ import { FormPropData, generateFormFromProps, EXTENSIONS_IDENTIFIER, EntityAction, EntityProp, FormProp, ToolbarAction, ExtensionsService, getObjectExtensionEntitiesFromStore, mapEntitiesToContributors, mergeWithDefaultActions, mergeWithDefaultProps, UiExtensionsModule } from '@abp/ng.theme.shared/extensions';
8
+ import * as i0 from '@angular/core';
9
+ import { Component, ViewChild, InjectionToken, Injectable, NgModule } from '@angular/core';
10
+ import { finalize, tap, switchMap, map, mapTo } from 'rxjs/operators';
11
+ import * as i5 from '@abp/ng.permission-management';
12
+ import { PermissionManagementModule } from '@abp/ng.permission-management';
13
+ import * as i4$1 from '@angular/forms';
14
+ import { Validators } from '@angular/forms';
15
+ import * as i9 from '@ngx-validate/core';
16
+ import { NgxValidateCoreModule } from '@ngx-validate/core';
17
+ import * as i6 from '@ng-bootstrap/ng-bootstrap';
18
+ import { NgbNavModule, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
19
+ import * as i8 from '@angular/common';
20
+ import { of } from 'rxjs';
21
+ import * as i1$1 from '@angular/router';
22
+ import { RouterModule } from '@angular/router';
23
+
24
+ class RolesComponent {
25
+ constructor(list, confirmationService, injector, service) {
26
+ this.list = list;
27
+ this.confirmationService = confirmationService;
28
+ this.injector = injector;
29
+ this.service = service;
30
+ this.data = { items: [], totalCount: 0 };
31
+ this.visiblePermissions = false;
32
+ this.modalBusy = false;
33
+ this.permissionManagementKey = "PermissionManagement.PermissionManagementComponent" /* PermissionManagement */;
34
+ this.onVisiblePermissionChange = event => {
35
+ this.visiblePermissions = event;
36
+ };
37
+ }
38
+ ngOnInit() {
39
+ this.hookToQuery();
40
+ }
41
+ buildForm() {
42
+ const data = new FormPropData(this.injector, this.selected);
43
+ this.form = generateFormFromProps(data);
44
+ }
45
+ openModal() {
46
+ this.buildForm();
47
+ this.isModalVisible = true;
48
+ }
49
+ add() {
50
+ this.selected = {};
51
+ this.openModal();
52
+ }
53
+ edit(id) {
54
+ this.service.get(id).subscribe(res => {
55
+ this.selected = res;
56
+ this.openModal();
57
+ });
58
+ }
59
+ save() {
60
+ if (!this.form.valid)
61
+ return;
62
+ this.modalBusy = true;
63
+ const { id } = this.selected;
64
+ (id
65
+ ? this.service.update(id, { ...this.selected, ...this.form.value })
66
+ : this.service.create(this.form.value))
67
+ .pipe(finalize(() => (this.modalBusy = false)))
68
+ .subscribe(() => {
69
+ this.isModalVisible = false;
70
+ this.list.get();
71
+ });
72
+ }
73
+ delete(id, name) {
74
+ this.confirmationService
75
+ .warn('AbpIdentity::RoleDeletionConfirmationMessage', 'AbpIdentity::AreYouSure', {
76
+ messageLocalizationParams: [name],
77
+ })
78
+ .subscribe((status) => {
79
+ if (status === Confirmation.Status.confirm) {
80
+ this.service.delete(id).subscribe(() => this.list.get());
81
+ }
82
+ });
83
+ }
84
+ hookToQuery() {
85
+ this.list.hookToQuery(query => this.service.getList(query)).subscribe(res => (this.data = res));
86
+ }
87
+ openPermissionsModal(providerKey) {
88
+ this.providerKey = providerKey;
89
+ setTimeout(() => {
90
+ this.visiblePermissions = true;
91
+ }, 0);
92
+ }
93
+ sort(data) {
94
+ const { prop, dir } = data.sorts[0];
95
+ this.list.sortKey = prop;
96
+ this.list.sortOrder = dir;
97
+ }
98
+ }
99
+ RolesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: RolesComponent, deps: [{ token: i1.ListService }, { token: i2.ConfirmationService }, { token: i0.Injector }, { token: i3.IdentityRoleService }], target: i0.ɵɵFactoryTarget.Component });
100
+ RolesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: RolesComponent, selector: "abp-roles", providers: [
101
+ ListService,
102
+ {
103
+ provide: EXTENSIONS_IDENTIFIER,
104
+ useValue: "Identity.RolesComponent" /* Roles */,
105
+ },
106
+ ], ngImport: i0, template: "<div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-header\">\r\n <div class=\"row\">\r\n <div class=\"col col-md-6\">\r\n <h5 class=\"card-title\">{{ 'AbpIdentity::Roles' | abpLocalization }}</h5>\r\n </div>\r\n <div class=\"text-end col col-md-6\">\r\n <abp-page-toolbar [record]=\"data.items\"></abp-page-toolbar>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"card-body\">\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n</div>\r\n\r\n<abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewRole') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n\r\n<abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'R' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true },\r\n hideBadges: { value: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n>\r\n</abp-permission-management>\r\n", components: [{ type: i4.PageToolbarComponent, selector: "abp-page-toolbar", exportAs: ["abpPageToolbar"] }, { type: i4.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], exportAs: ["abpExtensibleTable"] }, { type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { type: i4.ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { type: i5.PermissionManagementComponent, selector: "abp-permission-management", inputs: ["providerName", "providerKey", "hideBadges", "visible"], outputs: ["visibleChange"], exportAs: ["abpPermissionManagement"] }], directives: [{ type: i4$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i4$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i2.ModalCloseDirective, selector: "[abpClose]" }, { type: i1.ReplaceableTemplateDirective, selector: "[abpReplaceableTemplate]", inputs: ["abpReplaceableTemplate"] }, { type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }], pipes: { "abpLocalization": i1.LocalizationPipe } });
107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: RolesComponent, decorators: [{
108
+ type: Component,
109
+ args: [{ selector: 'abp-roles', providers: [
110
+ ListService,
111
+ {
112
+ provide: EXTENSIONS_IDENTIFIER,
113
+ useValue: "Identity.RolesComponent" /* Roles */,
114
+ },
115
+ ], template: "<div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-header\">\r\n <div class=\"row\">\r\n <div class=\"col col-md-6\">\r\n <h5 class=\"card-title\">{{ 'AbpIdentity::Roles' | abpLocalization }}</h5>\r\n </div>\r\n <div class=\"text-end col col-md-6\">\r\n <abp-page-toolbar [record]=\"data.items\"></abp-page-toolbar>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"card-body\">\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n</div>\r\n\r\n<abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewRole') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <form [formGroup]=\"form\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n\r\n<abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'R' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true },\r\n hideBadges: { value: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n>\r\n</abp-permission-management>\r\n" }]
116
+ }], ctorParameters: function () { return [{ type: i1.ListService }, { type: i2.ConfirmationService }, { type: i0.Injector }, { type: i3.IdentityRoleService }]; } });
117
+
118
+ class UsersComponent {
119
+ constructor(list, confirmationService, service, fb, injector) {
120
+ this.list = list;
121
+ this.confirmationService = confirmationService;
122
+ this.service = service;
123
+ this.fb = fb;
124
+ this.injector = injector;
125
+ this.data = { items: [], totalCount: 0 };
126
+ this.visiblePermissions = false;
127
+ this.modalBusy = false;
128
+ this.permissionManagementKey = "PermissionManagement.PermissionManagementComponent" /* PermissionManagement */;
129
+ this.trackByFn = (index, item) => Object.keys(item)[0] || index;
130
+ this.onVisiblePermissionChange = event => {
131
+ this.visiblePermissions = event;
132
+ };
133
+ }
134
+ get roleGroups() {
135
+ return this.form.get('roleNames')?.controls || [];
136
+ }
137
+ ngOnInit() {
138
+ this.hookToQuery();
139
+ }
140
+ buildForm() {
141
+ const data = new FormPropData(this.injector, this.selected);
142
+ this.form = generateFormFromProps(data);
143
+ this.service.getAssignableRoles().subscribe(({ items }) => {
144
+ this.roles = items;
145
+ this.form.addControl('roleNames', this.fb.array(this.roles.map(role => this.fb.group({
146
+ [role.name]: [
147
+ this.selected.id
148
+ ? !!this.selectedUserRoles?.find(userRole => userRole.id === role.id)
149
+ : role.isDefault,
150
+ ],
151
+ }))));
152
+ });
153
+ }
154
+ openModal() {
155
+ this.buildForm();
156
+ this.isModalVisible = true;
157
+ }
158
+ add() {
159
+ this.selected = {};
160
+ this.selectedUserRoles = [];
161
+ this.openModal();
162
+ }
163
+ edit(id) {
164
+ this.service
165
+ .get(id)
166
+ .pipe(tap(user => (this.selected = user)), switchMap(() => this.service.getRoles(id)))
167
+ .subscribe(userRole => {
168
+ this.selectedUserRoles = userRole.items || [];
169
+ this.openModal();
170
+ });
171
+ }
172
+ save() {
173
+ if (!this.form.valid || this.modalBusy)
174
+ return;
175
+ this.modalBusy = true;
176
+ const { roleNames = [] } = this.form.value;
177
+ const mappedRoleNames = roleNames.filter(role => !!role[Object.keys(role)[0]]).map(role => Object.keys(role)[0]) ||
178
+ [];
179
+ const { id } = this.selected;
180
+ (id
181
+ ? this.service.update(id, {
182
+ ...this.selected,
183
+ ...this.form.value,
184
+ roleNames: mappedRoleNames,
185
+ })
186
+ : this.service.create({ ...this.form.value, roleNames: mappedRoleNames }))
187
+ .pipe(finalize(() => (this.modalBusy = false)))
188
+ .subscribe(() => {
189
+ this.isModalVisible = false;
190
+ this.list.get();
191
+ });
192
+ }
193
+ delete(id, userName) {
194
+ this.confirmationService
195
+ .warn('AbpIdentity::UserDeletionConfirmationMessage', 'AbpIdentity::AreYouSure', {
196
+ messageLocalizationParams: [userName],
197
+ })
198
+ .subscribe((status) => {
199
+ if (status === Confirmation.Status.confirm) {
200
+ this.service.delete(id).subscribe(() => this.list.get());
201
+ }
202
+ });
203
+ }
204
+ sort(data) {
205
+ const { prop, dir } = data.sorts[0];
206
+ this.list.sortKey = prop;
207
+ this.list.sortOrder = dir;
208
+ }
209
+ hookToQuery() {
210
+ this.list.hookToQuery(query => this.service.getList(query)).subscribe(res => (this.data = res));
211
+ }
212
+ openPermissionsModal(providerKey) {
213
+ this.providerKey = providerKey;
214
+ setTimeout(() => {
215
+ this.visiblePermissions = true;
216
+ }, 0);
217
+ }
218
+ }
219
+ UsersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: UsersComponent, deps: [{ token: i1.ListService }, { token: i2.ConfirmationService }, { token: i3.IdentityUserService }, { token: i4$1.FormBuilder }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
220
+ UsersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: UsersComponent, selector: "abp-users", providers: [
221
+ ListService,
222
+ {
223
+ provide: EXTENSIONS_IDENTIFIER,
224
+ useValue: "Identity.UsersComponent" /* Users */,
225
+ },
226
+ ], viewQueries: [{ propertyName: "modalContent", first: true, predicate: ["modalContent"], descendants: true }], ngImport: i0, template: "<div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-header\">\r\n <div class=\"row\">\r\n <div class=\"col col-md-6\">\r\n <h5 class=\"card-title\">{{ 'AbpIdentity::Users' | abpLocalization }}</h5>\r\n </div>\r\n <div class=\"text-end col col-md-6\">\r\n <abp-page-toolbar [record]=\"data.items\"></abp-page-toolbar>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"card-body\">\r\n <div id=\"data-tables-table-filter\" class=\"data-tables-filter\">\r\n <div class=\"input-group\">\r\n <input\r\n type=\"search\"\r\n class=\"form-control\"\r\n [placeholder]=\"'AbpUi::PagerSearch' | abpLocalization\"\r\n [(ngModel)]=\"list.filter\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n</div>\r\n\r\n<abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewUser') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <ng-template #loaderRef\r\n ><div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\"></i></div\r\n ></ng-template>\r\n\r\n <form *ngIf=\"form; else loaderRef\" [formGroup]=\"form\" (ngSubmit)=\"save()\">\r\n <ul ngbNav #nav=\"ngbNav\" class=\"nav-tabs\">\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::UserInformations' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </ng-template>\r\n </li>\r\n\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::Roles' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <div\r\n *ngFor=\"let roleGroup of roleGroups; let i = index; trackBy: trackByFn\"\r\n class=\"form-check mb-2\"\r\n >\r\n <input\r\n type=\"checkbox\"\r\n class=\"form-check-input\"\r\n [attr.id]=\"'roles-' + i\"\r\n [formControl]=\"roleGroup.controls[roles[i].name]\"\r\n />\r\n <label class=\"form-check-label\" [attr.for]=\"'roles-' + i\">{{ roles[i].name }}</label>\r\n </div>\r\n </ng-template>\r\n </li>\r\n </ul>\r\n\r\n <div class=\"mt-2 fade-in-top\" [ngbNavOutlet]=\"nav\"></div>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n\r\n<abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'U' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n>\r\n</abp-permission-management>\r\n", components: [{ type: i4.PageToolbarComponent, selector: "abp-page-toolbar", exportAs: ["abpPageToolbar"] }, { type: i4.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], exportAs: ["abpExtensibleTable"] }, { type: i2.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { type: i4.ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { type: i6.NgbNavOutlet, selector: "[ngbNavOutlet]", inputs: ["paneRole", "ngbNavOutlet"] }, { type: i2.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { type: i5.PermissionManagementComponent, selector: "abp-permission-management", inputs: ["providerName", "providerKey", "hideBadges", "visible"], outputs: ["visibleChange"], exportAs: ["abpPermissionManagement"] }], directives: [{ type: i4$1.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: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit"], outputs: ["ngSubmit"] }, { type: i4$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i6.NgbNav, selector: "[ngbNav]", inputs: ["activeId", "animation", "destroyOnHide", "orientation", "roles", "keyboard"], outputs: ["activeIdChange", "shown", "hidden", "navChange"], exportAs: ["ngbNav"] }, { type: i6.NgbNavItem, selector: "[ngbNavItem]", inputs: ["destroyOnHide", "disabled", "domId", "ngbNavItem"], outputs: ["shown", "hidden"], exportAs: ["ngbNavItem"] }, { type: i6.NgbNavLink, selector: "a[ngbNavLink]" }, { type: i6.NgbNavContent, selector: "ng-template[ngbNavContent]" }, { type: i8.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i4$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { type: i2.ModalCloseDirective, selector: "[abpClose]" }, { type: i1.ReplaceableTemplateDirective, selector: "[abpReplaceableTemplate]", inputs: ["abpReplaceableTemplate"] }, { type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }], pipes: { "abpLocalization": i1.LocalizationPipe } });
227
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: UsersComponent, decorators: [{
228
+ type: Component,
229
+ args: [{ selector: 'abp-users', providers: [
230
+ ListService,
231
+ {
232
+ provide: EXTENSIONS_IDENTIFIER,
233
+ useValue: "Identity.UsersComponent" /* Users */,
234
+ },
235
+ ], template: "<div id=\"identity-roles-wrapper\" class=\"card\">\r\n <div class=\"card-header\">\r\n <div class=\"row\">\r\n <div class=\"col col-md-6\">\r\n <h5 class=\"card-title\">{{ 'AbpIdentity::Users' | abpLocalization }}</h5>\r\n </div>\r\n <div class=\"text-end col col-md-6\">\r\n <abp-page-toolbar [record]=\"data.items\"></abp-page-toolbar>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"card-body\">\r\n <div id=\"data-tables-table-filter\" class=\"data-tables-filter\">\r\n <div class=\"input-group\">\r\n <input\r\n type=\"search\"\r\n class=\"form-control\"\r\n [placeholder]=\"'AbpUi::PagerSearch' | abpLocalization\"\r\n [(ngModel)]=\"list.filter\"\r\n />\r\n </div>\r\n </div>\r\n\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n</div>\r\n\r\n<abp-modal [(visible)]=\"isModalVisible\" [busy]=\"modalBusy\">\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpIdentity::Edit' : 'AbpIdentity::NewUser') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <ng-template #loaderRef\r\n ><div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\"></i></div\r\n ></ng-template>\r\n\r\n <form *ngIf=\"form; else loaderRef\" [formGroup]=\"form\" (ngSubmit)=\"save()\">\r\n <ul ngbNav #nav=\"ngbNav\" class=\"nav-tabs\">\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::UserInformations' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </ng-template>\r\n </li>\r\n\r\n <li ngbNavItem>\r\n <a ngbNavLink>{{ 'AbpIdentity::Roles' | abpLocalization }}</a>\r\n <ng-template ngbNavContent>\r\n <div\r\n *ngFor=\"let roleGroup of roleGroups; let i = index; trackBy: trackByFn\"\r\n class=\"form-check mb-2\"\r\n >\r\n <input\r\n type=\"checkbox\"\r\n class=\"form-check-input\"\r\n [attr.id]=\"'roles-' + i\"\r\n [formControl]=\"roleGroup.controls[roles[i].name]\"\r\n />\r\n <label class=\"form-check-label\" [attr.for]=\"'roles-' + i\">{{ roles[i].name }}</label>\r\n </div>\r\n </ng-template>\r\n </li>\r\n </ul>\r\n\r\n <div class=\"mt-2 fade-in-top\" [ngbNavOutlet]=\"nav\"></div>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpIdentity::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"form?.invalid\" (click)=\"save()\">{{\r\n 'AbpIdentity::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n\r\n<abp-permission-management\r\n #abpPermissionManagement=\"abpPermissionManagement\"\r\n *abpReplaceableTemplate=\"\r\n {\r\n inputs: {\r\n providerName: { value: 'U' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: permissionManagementKey\r\n };\r\n let init = initTemplate\r\n \"\r\n (abpInit)=\"init(abpPermissionManagement)\"\r\n>\r\n</abp-permission-management>\r\n" }]
236
+ }], ctorParameters: function () { return [{ type: i1.ListService }, { type: i2.ConfirmationService }, { type: i3.IdentityUserService }, { type: i4$1.FormBuilder }, { type: i0.Injector }]; }, propDecorators: { modalContent: [{
237
+ type: ViewChild,
238
+ args: ['modalContent', { static: false }]
239
+ }] } });
240
+
241
+ const DEFAULT_ROLES_ENTITY_ACTIONS = EntityAction.createMany([
242
+ {
243
+ text: 'AbpIdentity::Edit',
244
+ action: data => {
245
+ const component = data.getInjected(RolesComponent);
246
+ component.edit(data.record.id);
247
+ },
248
+ permission: 'AbpIdentity.Roles.Update',
249
+ },
250
+ {
251
+ text: 'AbpIdentity::Permissions',
252
+ action: data => {
253
+ const component = data.getInjected(RolesComponent);
254
+ component.openPermissionsModal(data.record.name);
255
+ },
256
+ permission: 'AbpIdentity.Roles.ManagePermissions',
257
+ },
258
+ {
259
+ text: 'AbpIdentity::Delete',
260
+ action: data => {
261
+ const component = data.getInjected(RolesComponent);
262
+ component.delete(data.record.id, data.record.name);
263
+ },
264
+ permission: 'AbpIdentity.Roles.Delete',
265
+ visible: data => !data.record.isStatic,
266
+ },
267
+ ]);
268
+
269
+ const DEFAULT_ROLES_ENTITY_PROPS = EntityProp.createMany([
270
+ {
271
+ type: "string" /* String */,
272
+ name: 'name',
273
+ displayName: 'AbpIdentity::RoleName',
274
+ sortable: true,
275
+ valueResolver: data => {
276
+ const l10n = data.getInjected(LocalizationService);
277
+ const t = l10n.instant.bind(l10n);
278
+ const { isDefault, isPublic, name } = data.record;
279
+ return of(escapeHtmlChars(name) +
280
+ (isDefault
281
+ ? `<span class="badge rounded-pill bg-success ms-1">${t('AbpIdentity::DisplayName:IsDefault')}</span>`
282
+ : '') +
283
+ (isPublic
284
+ ? `<span class="badge rounded-pill bg-info ms-1">${t('AbpIdentity::DisplayName:IsPublic')}</span>`
285
+ : ''));
286
+ },
287
+ },
288
+ ]);
289
+
290
+ const DEFAULT_ROLES_CREATE_FORM_PROPS = FormProp.createMany([
291
+ {
292
+ type: "string" /* String */,
293
+ name: 'name',
294
+ displayName: 'AbpIdentity::RoleName',
295
+ id: 'role-name',
296
+ disabled: (data) => data.record && data.record.isStatic,
297
+ validators: () => [Validators.required],
298
+ },
299
+ {
300
+ type: "boolean" /* Boolean */,
301
+ name: 'isDefault',
302
+ displayName: 'AbpIdentity::DisplayName:IsDefault',
303
+ id: 'role-is-default',
304
+ defaultValue: false,
305
+ },
306
+ {
307
+ type: "boolean" /* Boolean */,
308
+ name: 'isPublic',
309
+ displayName: 'AbpIdentity::DisplayName:IsPublic',
310
+ id: 'role-is-public',
311
+ defaultValue: false,
312
+ },
313
+ ]);
314
+ const DEFAULT_ROLES_EDIT_FORM_PROPS = DEFAULT_ROLES_CREATE_FORM_PROPS;
315
+
316
+ const DEFAULT_ROLES_TOOLBAR_ACTIONS = ToolbarAction.createMany([
317
+ {
318
+ text: 'AbpIdentity::NewRole',
319
+ action: data => {
320
+ const component = data.getInjected(RolesComponent);
321
+ component.add();
322
+ },
323
+ permission: 'AbpIdentity.Roles.Create',
324
+ icon: 'fa fa-plus',
325
+ },
326
+ ]);
327
+
328
+ const DEFAULT_USERS_ENTITY_ACTIONS = EntityAction.createMany([
329
+ {
330
+ text: 'AbpIdentity::Edit',
331
+ action: data => {
332
+ const component = data.getInjected(UsersComponent);
333
+ component.edit(data.record.id);
334
+ },
335
+ permission: 'AbpIdentity.Users.Update',
336
+ },
337
+ {
338
+ text: 'AbpIdentity::Permissions',
339
+ action: data => {
340
+ const component = data.getInjected(UsersComponent);
341
+ component.openPermissionsModal(data.record.id);
342
+ },
343
+ permission: 'AbpIdentity.Users.ManagePermissions',
344
+ },
345
+ {
346
+ text: 'AbpIdentity::Delete',
347
+ action: data => {
348
+ const component = data.getInjected(UsersComponent);
349
+ component.delete(data.record.id, data.record.name || data.record.userName);
350
+ },
351
+ permission: 'AbpIdentity.Users.Delete',
352
+ },
353
+ ]);
354
+
355
+ const DEFAULT_USERS_ENTITY_PROPS = EntityProp.createMany([
356
+ {
357
+ type: "string" /* String */,
358
+ name: 'userName',
359
+ displayName: 'AbpIdentity::UserName',
360
+ sortable: true,
361
+ columnWidth: 250,
362
+ valueResolver: data => {
363
+ const l10n = data.getInjected(LocalizationService);
364
+ const t = l10n.instant.bind(l10n);
365
+ const inactiveIcon = `<i title="${t('AbpIdentity::ThisUserIsNotActiveMessage')}" class="fas fa-ban text-danger me-1"></i>`;
366
+ return of(`
367
+ ${!data.record.isActive ? inactiveIcon : ''}
368
+ <span class="${!data.record.isActive ? 'text-muted' : ''}">${escapeHtmlChars(data.record.userName)}</span>`);
369
+ },
370
+ },
371
+ {
372
+ type: "string" /* String */,
373
+ name: 'email',
374
+ displayName: 'AbpIdentity::EmailAddress',
375
+ sortable: true,
376
+ columnWidth: 250,
377
+ },
378
+ {
379
+ type: "string" /* String */,
380
+ name: 'phoneNumber',
381
+ displayName: 'AbpIdentity::PhoneNumber',
382
+ sortable: true,
383
+ columnWidth: 250,
384
+ },
385
+ ]);
386
+
387
+ const DEFAULT_USERS_CREATE_FORM_PROPS = FormProp.createMany([
388
+ {
389
+ type: "string" /* String */,
390
+ name: 'userName',
391
+ displayName: 'AbpIdentity::UserName',
392
+ id: 'user-name',
393
+ validators: () => [Validators.required, Validators.maxLength(256)],
394
+ },
395
+ {
396
+ type: "password" /* Password */,
397
+ name: 'password',
398
+ displayName: 'AbpIdentity::Password',
399
+ id: 'password',
400
+ autocomplete: 'new-password',
401
+ validators: data => [Validators.required, ...getPasswordValidators({ get: data.getInjected })],
402
+ },
403
+ {
404
+ type: "string" /* String */,
405
+ name: 'name',
406
+ displayName: 'AbpIdentity::DisplayName:Name',
407
+ id: 'name',
408
+ validators: () => [Validators.maxLength(64)],
409
+ },
410
+ {
411
+ type: "string" /* String */,
412
+ name: 'surname',
413
+ displayName: 'AbpIdentity::DisplayName:Surname',
414
+ id: 'surname',
415
+ validators: () => [Validators.maxLength(64)],
416
+ },
417
+ {
418
+ type: "email" /* Email */,
419
+ name: 'email',
420
+ displayName: 'AbpIdentity::EmailAddress',
421
+ id: 'email',
422
+ validators: () => [Validators.required, Validators.maxLength(256), Validators.email],
423
+ },
424
+ {
425
+ type: "string" /* String */,
426
+ name: 'phoneNumber',
427
+ displayName: 'AbpIdentity::PhoneNumber',
428
+ id: 'phone-number',
429
+ validators: () => [Validators.maxLength(16)],
430
+ },
431
+ {
432
+ type: "boolean" /* Boolean */,
433
+ name: 'isActive',
434
+ displayName: 'AbpIdentity::DisplayName:IsActive',
435
+ id: 'active-checkbox',
436
+ defaultValue: true,
437
+ },
438
+ {
439
+ type: "boolean" /* Boolean */,
440
+ name: 'lockoutEnabled',
441
+ displayName: 'AbpIdentity::DisplayName:LockoutEnabled',
442
+ id: 'lockout-checkbox',
443
+ defaultValue: true,
444
+ },
445
+ ]);
446
+ const DEFAULT_USERS_EDIT_FORM_PROPS = DEFAULT_USERS_CREATE_FORM_PROPS.filter(prop => prop.name !== 'password');
447
+
448
+ const DEFAULT_USERS_TOOLBAR_ACTIONS = ToolbarAction.createMany([
449
+ {
450
+ text: 'AbpIdentity::NewUser',
451
+ action: data => {
452
+ const component = data.getInjected(UsersComponent);
453
+ component.add();
454
+ },
455
+ permission: 'AbpIdentity.Users.Create',
456
+ icon: 'fa fa-plus',
457
+ },
458
+ ]);
459
+
460
+ const DEFAULT_IDENTITY_ENTITY_ACTIONS = {
461
+ ["Identity.RolesComponent" /* Roles */]: DEFAULT_ROLES_ENTITY_ACTIONS,
462
+ ["Identity.UsersComponent" /* Users */]: DEFAULT_USERS_ENTITY_ACTIONS,
463
+ };
464
+ const DEFAULT_IDENTITY_TOOLBAR_ACTIONS = {
465
+ ["Identity.RolesComponent" /* Roles */]: DEFAULT_ROLES_TOOLBAR_ACTIONS,
466
+ ["Identity.UsersComponent" /* Users */]: DEFAULT_USERS_TOOLBAR_ACTIONS,
467
+ };
468
+ const DEFAULT_IDENTITY_ENTITY_PROPS = {
469
+ ["Identity.RolesComponent" /* Roles */]: DEFAULT_ROLES_ENTITY_PROPS,
470
+ ["Identity.UsersComponent" /* Users */]: DEFAULT_USERS_ENTITY_PROPS,
471
+ };
472
+ const DEFAULT_IDENTITY_CREATE_FORM_PROPS = {
473
+ ["Identity.RolesComponent" /* Roles */]: DEFAULT_ROLES_CREATE_FORM_PROPS,
474
+ ["Identity.UsersComponent" /* Users */]: DEFAULT_USERS_CREATE_FORM_PROPS,
475
+ };
476
+ const DEFAULT_IDENTITY_EDIT_FORM_PROPS = {
477
+ ["Identity.RolesComponent" /* Roles */]: DEFAULT_ROLES_EDIT_FORM_PROPS,
478
+ ["Identity.UsersComponent" /* Users */]: DEFAULT_USERS_EDIT_FORM_PROPS,
479
+ };
480
+ const IDENTITY_ENTITY_ACTION_CONTRIBUTORS = new InjectionToken('IDENTITY_ENTITY_ACTION_CONTRIBUTORS');
481
+ const IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS = new InjectionToken('IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS');
482
+ const IDENTITY_ENTITY_PROP_CONTRIBUTORS = new InjectionToken('IDENTITY_ENTITY_PROP_CONTRIBUTORS');
483
+ const IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS = new InjectionToken('IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS');
484
+ const IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS = new InjectionToken('IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS');
485
+
486
+ class IdentityExtensionsGuard {
487
+ constructor(injector) {
488
+ this.injector = injector;
489
+ }
490
+ canActivate() {
491
+ const extensions = this.injector.get(ExtensionsService);
492
+ const actionContributors = this.injector.get(IDENTITY_ENTITY_ACTION_CONTRIBUTORS, null) || {};
493
+ const toolbarContributors = this.injector.get(IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS, null) || {};
494
+ const propContributors = this.injector.get(IDENTITY_ENTITY_PROP_CONTRIBUTORS, null) || {};
495
+ const createFormContributors = this.injector.get(IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS, null) || {};
496
+ const editFormContributors = this.injector.get(IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS, null) || {};
497
+ const configState = this.injector.get(ConfigStateService);
498
+ return getObjectExtensionEntitiesFromStore(configState, 'Identity').pipe(map(entities => ({
499
+ ["Identity.RolesComponent" /* Roles */]: entities.Role,
500
+ ["Identity.UsersComponent" /* Users */]: entities.User,
501
+ })), mapEntitiesToContributors(configState, 'AbpIdentity'), tap(objectExtensionContributors => {
502
+ mergeWithDefaultActions(extensions.entityActions, DEFAULT_IDENTITY_ENTITY_ACTIONS, actionContributors);
503
+ mergeWithDefaultActions(extensions.toolbarActions, DEFAULT_IDENTITY_TOOLBAR_ACTIONS, toolbarContributors);
504
+ mergeWithDefaultProps(extensions.entityProps, DEFAULT_IDENTITY_ENTITY_PROPS, objectExtensionContributors.prop, propContributors);
505
+ mergeWithDefaultProps(extensions.createFormProps, DEFAULT_IDENTITY_CREATE_FORM_PROPS, objectExtensionContributors.createForm, createFormContributors);
506
+ mergeWithDefaultProps(extensions.editFormProps, DEFAULT_IDENTITY_EDIT_FORM_PROPS, objectExtensionContributors.editForm, editFormContributors);
507
+ }), mapTo(true));
508
+ }
509
+ }
510
+ IdentityExtensionsGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IdentityExtensionsGuard, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
511
+ IdentityExtensionsGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IdentityExtensionsGuard });
512
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IdentityExtensionsGuard, decorators: [{
513
+ type: Injectable
514
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
515
+
516
+ const routes = [
517
+ { path: '', redirectTo: 'roles', pathMatch: 'full' },
518
+ {
519
+ path: '',
520
+ component: RouterOutletComponent,
521
+ canActivate: [AuthGuard, PermissionGuard, IdentityExtensionsGuard],
522
+ children: [
523
+ {
524
+ path: 'roles',
525
+ component: ReplaceableRouteContainerComponent,
526
+ data: {
527
+ requiredPolicy: 'AbpIdentity.Roles',
528
+ replaceableComponent: {
529
+ key: "Identity.RolesComponent" /* Roles */,
530
+ defaultComponent: RolesComponent,
531
+ },
532
+ },
533
+ },
534
+ {
535
+ path: 'users',
536
+ component: ReplaceableRouteContainerComponent,
537
+ data: {
538
+ requiredPolicy: 'AbpIdentity.Users',
539
+ replaceableComponent: {
540
+ key: "Identity.UsersComponent" /* Users */,
541
+ defaultComponent: UsersComponent,
542
+ },
543
+ },
544
+ },
545
+ ],
546
+ },
547
+ ];
548
+ class IdentityRoutingModule {
549
+ }
550
+ IdentityRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IdentityRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
551
+ IdentityRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IdentityRoutingModule, imports: [i1$1.RouterModule], exports: [RouterModule] });
552
+ IdentityRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IdentityRoutingModule, imports: [[RouterModule.forChild(routes)], RouterModule] });
553
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IdentityRoutingModule, decorators: [{
554
+ type: NgModule,
555
+ args: [{
556
+ imports: [RouterModule.forChild(routes)],
557
+ exports: [RouterModule],
558
+ }]
559
+ }] });
560
+
561
+ class IdentityModule {
562
+ static forChild(options = {}) {
563
+ return {
564
+ ngModule: IdentityModule,
565
+ providers: [
566
+ {
567
+ provide: IDENTITY_ENTITY_ACTION_CONTRIBUTORS,
568
+ useValue: options.entityActionContributors,
569
+ },
570
+ {
571
+ provide: IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS,
572
+ useValue: options.toolbarActionContributors,
573
+ },
574
+ {
575
+ provide: IDENTITY_ENTITY_PROP_CONTRIBUTORS,
576
+ useValue: options.entityPropContributors,
577
+ },
578
+ {
579
+ provide: IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS,
580
+ useValue: options.createFormPropContributors,
581
+ },
582
+ {
583
+ provide: IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS,
584
+ useValue: options.editFormPropContributors,
585
+ },
586
+ IdentityExtensionsGuard,
587
+ ],
588
+ };
589
+ }
590
+ static forLazy(options = {}) {
591
+ return new LazyModuleFactory(IdentityModule.forChild(options));
592
+ }
593
+ }
594
+ IdentityModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IdentityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
595
+ IdentityModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IdentityModule, declarations: [RolesComponent, UsersComponent], imports: [CoreModule,
596
+ IdentityRoutingModule,
597
+ NgbNavModule,
598
+ ThemeSharedModule,
599
+ UiExtensionsModule,
600
+ NgbDropdownModule,
601
+ PermissionManagementModule,
602
+ NgxValidateCoreModule], exports: [RolesComponent, UsersComponent] });
603
+ IdentityModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IdentityModule, imports: [[
604
+ CoreModule,
605
+ IdentityRoutingModule,
606
+ NgbNavModule,
607
+ ThemeSharedModule,
608
+ UiExtensionsModule,
609
+ NgbDropdownModule,
610
+ PermissionManagementModule,
611
+ NgxValidateCoreModule,
612
+ ]] });
613
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: IdentityModule, decorators: [{
614
+ type: NgModule,
615
+ args: [{
616
+ declarations: [RolesComponent, UsersComponent],
617
+ exports: [RolesComponent, UsersComponent],
618
+ imports: [
619
+ CoreModule,
620
+ IdentityRoutingModule,
621
+ NgbNavModule,
622
+ ThemeSharedModule,
623
+ UiExtensionsModule,
624
+ NgbDropdownModule,
625
+ PermissionManagementModule,
626
+ NgxValidateCoreModule,
627
+ ],
628
+ }]
629
+ }] });
630
+
631
+ /**
632
+ * Generated bundle index. Do not edit.
633
+ */
634
+
635
+ export { DEFAULT_IDENTITY_CREATE_FORM_PROPS, DEFAULT_IDENTITY_EDIT_FORM_PROPS, DEFAULT_IDENTITY_ENTITY_ACTIONS, DEFAULT_IDENTITY_ENTITY_PROPS, DEFAULT_IDENTITY_TOOLBAR_ACTIONS, IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS, IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS, IDENTITY_ENTITY_ACTION_CONTRIBUTORS, IDENTITY_ENTITY_PROP_CONTRIBUTORS, IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS, IdentityExtensionsGuard, IdentityModule, RolesComponent, UsersComponent };
636
+ //# sourceMappingURL=abp-ng.identity.mjs.map