@cauca-911/management 21.3.0 → 21.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,1100 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Component, inject, Input, NgModule } from '@angular/core';
3
- import * as i1 from '@ngx-translate/core';
4
- import * as i1$1 from 'devextreme-angular/ui/check-box';
2
+ import { InjectionToken, inject, Injectable, computed, ChangeDetectionStrategy, Component, ViewChild, signal, viewChild, resource, effect, untracked, model, input, HostListener, Input, NgModule } from '@angular/core';
3
+ import { pendingChangesGuard, DialogService, PageTitleComponent, LoadingSpinnerIndicatorComponent, LoadingErrorComponent, StrokedButtonComponent, RaisedButtonComponent, ListPaginatorComponent, LoadingStateService, IconButtonComponent, GroupContainerComponent, ConfirmationResult, SavingErrorBoxComponent } from '@cauca-911/material';
4
+ import * as i1 from '@angular/material/card';
5
+ import { MatCardModule } from '@angular/material/card';
6
+ import * as i1$3 from '@ngx-translate/core';
7
+ import { TranslatePipe } from '@ngx-translate/core';
8
+ import { MatSort } from '@angular/material/sort';
9
+ import { Router } from '@angular/router';
10
+ import ODataFilterBuilder from 'odata-filter-builder';
11
+ import { OdataGridComponent, SortableDataGridColumnComponent, SortableDataGridCheckColumnComponent, DataGridCommandsColumnComponent } from '@cauca-911/datagrid';
12
+ import { HttpClient } from '@angular/common/http';
13
+ import { CaucaCoreService, toLowerCaseAndWithoutDiacritics, CaucaCoreForChildModule } from '@cauca-911/core';
14
+ import { firstValueFrom, startWith, debounceTime } from 'rxjs';
15
+ import * as i1$2 from '@angular/material/form-field';
16
+ import { MatFormFieldModule, MatFormField, MatLabel, MatSuffix } from '@angular/material/form-field';
17
+ import * as i5 from '@angular/forms';
18
+ import { Validators, FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
19
+ import * as i3$1 from '@angular/material/slide-toggle';
20
+ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
21
+ import { MatDividerModule } from '@angular/material/divider';
22
+ import * as i2 from '@angular/material/input';
23
+ import { MatInputModule, MatInput } from '@angular/material/input';
24
+ import * as i1$1 from '@angular/material/dialog';
25
+ import { MAT_DIALOG_DATA, MatDialogRef, MatDialogModule, MatDialog } from '@angular/material/dialog';
26
+ import * as i4 from '@angular/material/icon';
27
+ import { MatIconModule, MatIcon } from '@angular/material/icon';
28
+ import { toSignal, toObservable } from '@angular/core/rxjs-interop';
29
+ import { v4 } from 'uuid';
30
+ import * as i4$1 from '@angular/material/list';
31
+ import { MatListModule } from '@angular/material/list';
32
+ import * as i6 from '@angular/material/tooltip';
33
+ import { MatTooltipModule } from '@angular/material/tooltip';
34
+ import * as i3 from '@angular/material/checkbox';
35
+ import { MatCheckboxModule } from '@angular/material/checkbox';
36
+ import * as i1$4 from 'devextreme-angular/ui/check-box';
5
37
  import { DxCheckBoxModule } from 'devextreme-angular/ui/check-box';
6
- import * as i3 from 'devextreme-angular/ui/list';
38
+ import * as i3$2 from 'devextreme-angular/ui/list';
7
39
  import { DxListModule } from 'devextreme-angular/ui/list';
8
- import * as i5 from 'devextreme-angular/ui/tag-box';
40
+ import * as i5$1 from 'devextreme-angular/ui/tag-box';
9
41
  import { DxTagBoxModule } from 'devextreme-angular/ui/tag-box';
10
- import { CaucaCoreService, CaucaCoreForChildModule } from '@cauca-911/core';
11
- import * as i6 from '@cauca-911/devextreme';
42
+ import * as i6$1 from '@cauca-911/devextreme';
12
43
  import { CaucaDevextremeModule } from '@cauca-911/devextreme';
13
44
  import { BreakpointObserver } from '@angular/cdk/layout';
14
45
  import { map } from 'rxjs/operators';
15
- import { HttpClient } from '@angular/common/http';
16
- import * as i2 from 'devextreme-angular/core';
17
- import * as i4 from 'devextreme-angular/ui/nested';
46
+ import * as i2$1 from 'devextreme-angular/core';
47
+ import * as i4$2 from 'devextreme-angular/ui/nested';
18
48
  import { CommonModule } from '@angular/common';
19
49
 
50
+ const MANAGEMENT_URL_PREFIX = new InjectionToken('MANAGEMENT_URL_PREFIX');
51
+ const MANAGEMENT_ROUTE_SEGMENT = new InjectionToken('MANAGEMENT_ROUTE_SEGMENT');
52
+ function provideCaucaManagement(config) {
53
+ return [
54
+ ...(config?.managementUrlPrefix != null
55
+ ? [{ provide: MANAGEMENT_URL_PREFIX, useValue: config.managementUrlPrefix }]
56
+ : []),
57
+ ...(config?.managementRouteSegment != null
58
+ ? [{ provide: MANAGEMENT_ROUTE_SEGMENT, useValue: config.managementRouteSegment }]
59
+ : [])
60
+ ];
61
+ }
62
+
63
+ const managementGroupRoutes = [{
64
+ path: 'groups',
65
+ loadComponent: () => Promise.resolve().then(function () { return groupsPage_component; }).then(m => m.GroupsPageComponent),
66
+ }, {
67
+ path: 'groups/:id',
68
+ loadComponent: () => Promise.resolve().then(function () { return groupEditionPage_component; }).then(m => m.GroupEditionPageComponent),
69
+ canDeactivate: [pendingChangesGuard],
70
+ }];
71
+
72
+ const REFRESHABLE_PERMISSION_STATE_TOKEN = new InjectionToken('REFRESHABLE_PERMISSION_STATE_TOKEN');
73
+
74
+ class GroupManagementService {
75
+ constructor() {
76
+ this.client = inject(HttpClient);
77
+ this.baseUrl = inject(CaucaCoreService).getConfig().apiUrl;
78
+ this.urlPrefix = inject(MANAGEMENT_URL_PREFIX, { optional: true }) ?? '';
79
+ }
80
+ async deleteGroup(groupId) {
81
+ await firstValueFrom(this.client.delete(this.buildApiUrl(`GroupManagement/${groupId}`)));
82
+ }
83
+ async save(group) {
84
+ await firstValueFrom(this.client.post(this.buildApiUrl(`GroupManagement`), group));
85
+ }
86
+ async get(groupId) {
87
+ return await firstValueFrom(this.client.get(this.buildApiUrl(`GroupManagement/${groupId}`)));
88
+ }
89
+ buildApiUrl(path) {
90
+ const normalizedApiUrl = this.baseUrl.replace(/\/+$/, '');
91
+ const normalizedPrefix = this.urlPrefix.trim().replace(/^\/+|\/+$/g, '');
92
+ return normalizedPrefix
93
+ ? `${normalizedApiUrl}/${normalizedPrefix}/${path}`
94
+ : `${normalizedApiUrl}/${path}`;
95
+ }
96
+ static { this.ɵfac = function GroupManagementService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GroupManagementService)(); }; }
97
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: GroupManagementService, factory: GroupManagementService.ɵfac, providedIn: 'root' }); }
98
+ }
99
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GroupManagementService, [{
100
+ type: Injectable,
101
+ args: [{
102
+ providedIn: 'root'
103
+ }]
104
+ }], null, null); })();
105
+
106
+ const _c0$3 = () => ["name"];
107
+ class GroupListGridComponent {
108
+ constructor() {
109
+ this.columns = computed(() => this.getColumns(), ...(ngDevMode ? [{ debugName: "columns" }] : []));
110
+ this.router = inject(Router);
111
+ this.dialog = inject(DialogService);
112
+ this.service = inject(GroupManagementService);
113
+ this.filterPredicate = (filter) => {
114
+ let builder = new ODataFilterBuilder();
115
+ if (filter) {
116
+ builder = builder.and(ODataFilterBuilder('or')
117
+ .contains('searchableGroup', filter)
118
+ .contains('searchableUsers', filter));
119
+ }
120
+ return [{ getFilter: () => [builder.toString()] }];
121
+ };
122
+ }
123
+ ngOnInit() {
124
+ this.table.setUpSort(this.sort);
125
+ }
126
+ createGroup() {
127
+ this.router.navigate([this.router.url, 'new']);
128
+ }
129
+ async deleteGroup(group) {
130
+ if (await this.dialog.askForDeleteConfirmation(group.name, 'admin.group', true)) {
131
+ try {
132
+ await this.service.deleteGroup(group.id);
133
+ this.table.refreshData();
134
+ }
135
+ catch {
136
+ await this.dialog.showDeletionError(group.name);
137
+ }
138
+ }
139
+ }
140
+ getColumns() {
141
+ const baseColumns = ['name', 'assignableByAllUsers'];
142
+ return [...baseColumns, 'buttons'];
143
+ }
144
+ static { this.ɵfac = function GroupListGridComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GroupListGridComponent)(); }; }
145
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GroupListGridComponent, selectors: [["cauca-group-list-grid"]], viewQuery: function GroupListGridComponent_Query(rf, ctx) { if (rf & 1) {
146
+ i0.ɵɵviewQuery(OdataGridComponent, 7)(MatSort, 7);
147
+ } if (rf & 2) {
148
+ let _t;
149
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.table = _t.first);
150
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.sort = _t.first);
151
+ } }, decls: 7, vars: 17, consts: [["matSort", "", "aria-describedby", "Groups table", "resourceName", "GroupList", 1, "groups-datagrid", 3, "addButtonClick", "showTableOptions", "showAddButton", "addButtonLabel", "baseSort", "filterPredicate", "displayedColumns"], ["id", "name", "prop", "name", 3, "label"], ["id", "is-assignable-all-users", "prop", "assignableByAllUsers", "width", "200px", 3, "label"], ["id", "buttons", "prop", "buttons", "editLinkField", "id", 3, "deleteClick", "canDelete", "canEdit"]], template: function GroupListGridComponent_Template(rf, ctx) { if (rf & 1) {
152
+ i0.ɵɵelementStart(0, "cauca-odata-grid", 0);
153
+ i0.ɵɵpipe(1, "translate");
154
+ i0.ɵɵlistener("addButtonClick", function GroupListGridComponent_Template_cauca_odata_grid_addButtonClick_0_listener() { return ctx.createGroup(); });
155
+ i0.ɵɵelement(2, "cauca-sortable-data-grid-column", 1);
156
+ i0.ɵɵpipe(3, "translate");
157
+ i0.ɵɵelement(4, "cauca-sortable-data-grid-check-column", 2);
158
+ i0.ɵɵpipe(5, "translate");
159
+ i0.ɵɵelementStart(6, "cauca-data-grid-commands-column", 3);
160
+ i0.ɵɵlistener("deleteClick", function GroupListGridComponent_Template_cauca_data_grid_commands_column_deleteClick_6_listener($event) { return ctx.deleteGroup($event); });
161
+ i0.ɵɵelementEnd()();
162
+ } if (rf & 2) {
163
+ i0.ɵɵproperty("showTableOptions", true)("showAddButton", true)("addButtonLabel", i0.ɵɵpipeBind1(1, 10, "groups.addButtonLabel"))("baseSort", i0.ɵɵpureFunction0(16, _c0$3))("filterPredicate", ctx.filterPredicate)("displayedColumns", ctx.columns());
164
+ i0.ɵɵadvance(2);
165
+ i0.ɵɵproperty("label", i0.ɵɵpipeBind1(3, 12, "groups.groupNameColumnLabel"));
166
+ i0.ɵɵadvance(2);
167
+ i0.ɵɵproperty("label", i0.ɵɵpipeBind1(5, 14, "groups.assignableByAllUsersColumnLabel"));
168
+ i0.ɵɵadvance(2);
169
+ i0.ɵɵproperty("canDelete", true)("canEdit", true);
170
+ } }, dependencies: [MatSort, OdataGridComponent, SortableDataGridColumnComponent, SortableDataGridCheckColumnComponent, DataGridCommandsColumnComponent, TranslatePipe], encapsulation: 2, changeDetection: 0 }); }
171
+ }
172
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GroupListGridComponent, [{
173
+ type: Component,
174
+ args: [{ selector: 'cauca-group-list-grid', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatSort, OdataGridComponent, SortableDataGridColumnComponent, SortableDataGridCheckColumnComponent, DataGridCommandsColumnComponent, TranslatePipe], template: "<cauca-odata-grid matSort\n [showTableOptions]=\"true\"\n class=\"groups-datagrid\"\n aria-describedby=\"Groups table\"\n resourceName=\"GroupList\"\n [showAddButton]=\"true\"\n (addButtonClick)=\"createGroup()\"\n [addButtonLabel]=\"'groups.addButtonLabel'| translate\"\n [baseSort]=\"['name']\"\n [filterPredicate]=\"filterPredicate\"\n [displayedColumns]=\"columns()\">\n\n <cauca-sortable-data-grid-column id=\"name\" prop=\"name\" [label]=\"'groups.groupNameColumnLabel'|translate\"/>\n <cauca-sortable-data-grid-check-column id=\"is-assignable-all-users\" prop=\"assignableByAllUsers\" [label]=\"'groups.assignableByAllUsersColumnLabel'|translate\" width=\"200px\" />\n <cauca-data-grid-commands-column id=\"buttons\" prop=\"buttons\" [canDelete]=\"true\" [canEdit]=\"true\" editLinkField=\"id\" (deleteClick)=\"deleteGroup($event)\" />\n\n</cauca-odata-grid>\n" }]
175
+ }], null, { table: [{
176
+ type: ViewChild,
177
+ args: [OdataGridComponent, { static: true }]
178
+ }], sort: [{
179
+ type: ViewChild,
180
+ args: [MatSort, { static: true }]
181
+ }] }); })();
182
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(GroupListGridComponent, { className: "GroupListGridComponent", filePath: "lib/components/group-list-grid/group-list-grid.component.ts", lineNumber: 18 }); })();
183
+
184
+ class GroupsPageComponent {
185
+ static { this.ɵfac = function GroupsPageComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GroupsPageComponent)(); }; }
186
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GroupsPageComponent, selectors: [["cauca-groups-page"]], decls: 4, vars: 1, consts: [["caption", "menu.groups", "baseCrumb", "menu.management", "breadcrumb", "menu.groups", 3, "showBreadcrumb"], [1, "page-content"], [1, "page-content-grid"]], template: function GroupsPageComponent_Template(rf, ctx) { if (rf & 1) {
187
+ i0.ɵɵelement(0, "cauca-page-title", 0);
188
+ i0.ɵɵelementStart(1, "mat-card", 1)(2, "mat-card-content", 2);
189
+ i0.ɵɵelement(3, "cauca-group-list-grid");
190
+ i0.ɵɵelementEnd()();
191
+ } if (rf & 2) {
192
+ i0.ɵɵproperty("showBreadcrumb", true);
193
+ } }, dependencies: [MatCardModule, i1.MatCard, i1.MatCardContent, PageTitleComponent, GroupListGridComponent], encapsulation: 2, changeDetection: 0 }); }
194
+ }
195
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GroupsPageComponent, [{
196
+ type: Component,
197
+ args: [{ selector: 'cauca-groups-page', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatCardModule, PageTitleComponent, GroupListGridComponent], template: "<cauca-page-title\n [showBreadcrumb]=\"true\"\n caption=\"menu.groups\"\n baseCrumb=\"menu.management\"\n breadcrumb=\"menu.groups\" />\n\n<mat-card class=\"page-content\">\n\n <mat-card-content class=\"page-content-grid\">\n <cauca-group-list-grid />\n </mat-card-content>\n\n</mat-card>\n" }]
198
+ }], null, null); })();
199
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(GroupsPageComponent, { className: "GroupsPageComponent", filePath: "lib/pages/groups-page/groups-page.component.ts", lineNumber: 13 }); })();
200
+
201
+ var groupsPage_component = /*#__PURE__*/Object.freeze({
202
+ __proto__: null,
203
+ GroupsPageComponent: GroupsPageComponent
204
+ });
205
+
206
+ function generateGroup() {
207
+ return {
208
+ id: v4(),
209
+ name: '',
210
+ assignableByAllUsers: false,
211
+ permissions: [],
212
+ users: []
213
+ };
214
+ }
215
+
216
+ class GroupEditionStateService {
217
+ constructor() {
218
+ this.isEditionMode = true;
219
+ this.form = this.generateForm();
220
+ this.id = null;
221
+ this.users = toSignal(this.form.get('users').valueChanges.pipe(startWith(this.form.get('users').value)), { initialValue: [] });
222
+ this.usersControl = this.form.get('users');
223
+ this.currentGroup = null;
224
+ this.dataService = inject(GroupManagementService);
225
+ this.userPermissionStateService = inject(REFRESHABLE_PERMISSION_STATE_TOKEN);
226
+ }
227
+ async setGroup(id) {
228
+ if (id === 'new') {
229
+ this.isEditionMode = false;
230
+ this.generateNewGroup();
231
+ }
232
+ else {
233
+ this.setCurrentGroup(await this.dataService.get(id));
234
+ }
235
+ }
236
+ async saveData() {
237
+ const data = this.getUpdatedGroup();
238
+ if (this.form.valid) {
239
+ this.form.disable();
240
+ await this.dataService.save(data);
241
+ await this.refreshCurrentUserPermissions();
242
+ return true;
243
+ }
244
+ else {
245
+ return false;
246
+ }
247
+ }
248
+ generateNewGroup() {
249
+ this.currentGroup = generateGroup();
250
+ this.setCurrentGroup(this.currentGroup);
251
+ this.form.markAsPristine();
252
+ }
253
+ setCurrentGroup(group) {
254
+ this.id = group.id;
255
+ this.currentGroup = group;
256
+ if (!this.isEditionMode) {
257
+ this.form.get('name').setValidators(Validators.required);
258
+ }
259
+ this.form.patchValue(group);
260
+ this.form.get('users').setValue(group.users || []);
261
+ this.form.get('permissions').setValue(group.permissions || []);
262
+ this.form.markAsPristine();
263
+ }
264
+ getUpdatedGroup() {
265
+ const formValues = this.form.value;
266
+ return {
267
+ ...this.currentGroup,
268
+ ...formValues,
269
+ };
270
+ }
271
+ isDirty() {
272
+ return this.form.dirty;
273
+ }
274
+ isValid() {
275
+ this.form.updateValueAndValidity();
276
+ return this.form.valid;
277
+ }
278
+ showErrors() {
279
+ this.form.markAllAsTouched();
280
+ }
281
+ addUsers(users) {
282
+ const current = this.usersControl.value ?? [];
283
+ const existingIds = new Set(current.map(u => u.id));
284
+ const newUsers = users.filter(u => !existingIds.has(u.id));
285
+ this.usersControl.setValue([...current, ...newUsers]);
286
+ this.form.markAsDirty();
287
+ }
288
+ removeUser(userId) {
289
+ const current = this.usersControl.value ?? [];
290
+ this.usersControl.setValue(current.filter(u => u.id !== userId));
291
+ this.form.markAsDirty();
292
+ }
293
+ async refreshCurrentUserPermissions() {
294
+ try {
295
+ await this.userPermissionStateService.refresh();
296
+ }
297
+ catch (error) {
298
+ console.error('Error refreshing user permissions after group save', error);
299
+ }
300
+ }
301
+ generateForm() {
302
+ const formGroup = new FormGroup({
303
+ name: new FormControl('', [Validators.required]),
304
+ assignableByAllUsers: new FormControl(false),
305
+ users: new FormControl([]),
306
+ permissions: new FormControl([])
307
+ });
308
+ return formGroup;
309
+ }
310
+ static { this.ɵfac = function GroupEditionStateService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GroupEditionStateService)(); }; }
311
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: GroupEditionStateService, factory: GroupEditionStateService.ɵfac, providedIn: 'root' }); }
312
+ }
313
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GroupEditionStateService, [{
314
+ type: Injectable,
315
+ args: [{
316
+ providedIn: 'root'
317
+ }]
318
+ }], null, null); })();
319
+
320
+ class UserForGroup {
321
+ constructor(data) {
322
+ this.id = data.id;
323
+ this.firstName = data.firstName;
324
+ this.lastName = data.lastName;
325
+ this.fullName = `${data.firstName} ${data.lastName}`;
326
+ }
327
+ }
328
+
329
+ class UserSearchService {
330
+ constructor() {
331
+ this.client = inject(HttpClient);
332
+ this.baseUrl = inject(CaucaCoreService).getConfig().apiUrl;
333
+ this.urlPrefix = inject(MANAGEMENT_URL_PREFIX, { optional: true }) ?? '';
334
+ }
335
+ async search(query, excludedUserIds, skip, top) {
336
+ const url = this.buildApiUrl('UserSearch');
337
+ const body = {
338
+ query,
339
+ skip,
340
+ top,
341
+ excludedUserIds
342
+ };
343
+ const response = await firstValueFrom(this.client.post(url, body));
344
+ return {
345
+ items: response.items.map(u => new UserForGroup(u)),
346
+ totalCount: response.totalCount
347
+ };
348
+ }
349
+ buildApiUrl(path) {
350
+ const normalizedApiUrl = this.baseUrl.replace(/\/+$/, '');
351
+ const normalizedPrefix = this.urlPrefix.trim().replace(/^\/+|\/+$/g, '');
352
+ return normalizedPrefix
353
+ ? `${normalizedApiUrl}/${normalizedPrefix}/${path}`
354
+ : `${normalizedApiUrl}/${path}`;
355
+ }
356
+ static { this.ɵfac = function UserSearchService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || UserSearchService)(); }; }
357
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: UserSearchService, factory: UserSearchService.ɵfac, providedIn: 'root' }); }
358
+ }
359
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserSearchService, [{
360
+ type: Injectable,
361
+ args: [{
362
+ providedIn: 'root'
363
+ }]
364
+ }], null, null); })();
365
+
366
+ const _c0$2 = ["resultPaginator"];
367
+ const _forTrack0$2 = ($index, $item) => $item.id;
368
+ function GroupUserSelectionDialogComponent_Conditional_16_Template(rf, ctx) { if (rf & 1) {
369
+ i0.ɵɵelementStart(0, "div", 7);
370
+ i0.ɵɵtext(1);
371
+ i0.ɵɵpipe(2, "translate");
372
+ i0.ɵɵelementEnd();
373
+ } if (rf & 2) {
374
+ i0.ɵɵadvance();
375
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "groupEdition.searchMinChars"));
376
+ } }
377
+ function GroupUserSelectionDialogComponent_Conditional_19_Template(rf, ctx) { if (rf & 1) {
378
+ i0.ɵɵelement(0, "cauca-loading-spinner-indicator");
379
+ } }
380
+ function GroupUserSelectionDialogComponent_Conditional_20_For_2_Template(rf, ctx) { if (rf & 1) {
381
+ i0.ɵɵelementStart(0, "mat-list-option", 20);
382
+ i0.ɵɵtext(1);
383
+ i0.ɵɵelementEnd();
384
+ } if (rf & 2) {
385
+ const user_r3 = ctx.$implicit;
386
+ const ɵ$index_41_r4 = ctx.$index;
387
+ const ctx_r1 = i0.ɵɵnextContext(2);
388
+ i0.ɵɵclassProp("result-item--even", ɵ$index_41_r4 % 2 === 1);
389
+ i0.ɵɵproperty("value", user_r3)("selected", ctx_r1.selectedUserIds().has(user_r3.id));
390
+ i0.ɵɵadvance();
391
+ i0.ɵɵtextInterpolate1(" ", user_r3.fullName, " ");
392
+ } }
393
+ function GroupUserSelectionDialogComponent_Conditional_20_Conditional_3_Template(rf, ctx) { if (rf & 1) {
394
+ const _r5 = i0.ɵɵgetCurrentView();
395
+ i0.ɵɵelementStart(0, "cauca-list-paginator", 21, 0);
396
+ i0.ɵɵlistener("pageChange", function GroupUserSelectionDialogComponent_Conditional_20_Conditional_3_Template_cauca_list_paginator_pageChange_0_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onPageChange($event)); });
397
+ i0.ɵɵelementEnd();
398
+ } if (rf & 2) {
399
+ const ctx_r1 = i0.ɵɵnextContext(2);
400
+ i0.ɵɵproperty("itemsCount", ctx_r1.totalCount())("pageSize", ctx_r1.PAGE_SIZE);
401
+ } }
402
+ function GroupUserSelectionDialogComponent_Conditional_20_Template(rf, ctx) { if (rf & 1) {
403
+ const _r1 = i0.ɵɵgetCurrentView();
404
+ i0.ɵɵelementStart(0, "mat-selection-list", 17);
405
+ i0.ɵɵlistener("selectionChange", function GroupUserSelectionDialogComponent_Conditional_20_Template_mat_selection_list_selectionChange_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onSelectionChange($event)); });
406
+ i0.ɵɵrepeaterCreate(1, GroupUserSelectionDialogComponent_Conditional_20_For_2_Template, 2, 5, "mat-list-option", 18, _forTrack0$2);
407
+ i0.ɵɵelementEnd();
408
+ i0.ɵɵconditionalCreate(3, GroupUserSelectionDialogComponent_Conditional_20_Conditional_3_Template, 2, 2, "cauca-list-paginator", 19);
409
+ } if (rf & 2) {
410
+ const ctx_r1 = i0.ɵɵnextContext();
411
+ i0.ɵɵproperty("compareWith", ctx_r1.compareUserById);
412
+ i0.ɵɵadvance();
413
+ i0.ɵɵrepeater(ctx_r1.results());
414
+ i0.ɵɵadvance(2);
415
+ i0.ɵɵconditional(ctx_r1.totalCount() > ctx_r1.PAGE_SIZE ? 3 : -1);
416
+ } }
417
+ function GroupUserSelectionDialogComponent_Conditional_21_Template(rf, ctx) { if (rf & 1) {
418
+ i0.ɵɵelementStart(0, "div", 10);
419
+ i0.ɵɵtext(1);
420
+ i0.ɵɵpipe(2, "translate");
421
+ i0.ɵɵelementEnd();
422
+ } if (rf & 2) {
423
+ i0.ɵɵadvance();
424
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "noResult"));
425
+ } }
426
+ class GroupUserSelectionDialogComponent {
427
+ constructor() {
428
+ this.MIN_SEARCH_LENGTH = 3;
429
+ this.PAGE_SIZE = 10;
430
+ this.data = inject(MAT_DIALOG_DATA);
431
+ this.searchTerm = signal('', ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
432
+ this.selectedUsers = signal([], ...(ngDevMode ? [{ debugName: "selectedUsers" }] : []));
433
+ this.currentPage = signal(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
434
+ this.paginator = viewChild('resultPaginator', ...(ngDevMode ? [{ debugName: "paginator" }] : []));
435
+ this.selectedUserIds = computed(() => new Set(this.selectedUsers().map(u => u.id)), ...(ngDevMode ? [{ debugName: "selectedUserIds" }] : []));
436
+ this.selectedUsersLabel = computed(() => [...this.selectedUsers()]
437
+ .sort((a, b) => toLowerCaseAndWithoutDiacritics(a.fullName).localeCompare(toLowerCaseAndWithoutDiacritics(b.fullName)))
438
+ .map(u => u.fullName)
439
+ .join(', '), ...(ngDevMode ? [{ debugName: "selectedUsersLabel" }] : []));
440
+ this.debouncedSearch = toSignal(toObservable(this.searchTerm).pipe(debounceTime(300)), { initialValue: '' });
441
+ this.searchResource = resource({ ...(ngDevMode ? { debugName: "searchResource" } : {}), params: computed(() => ({ query: this.debouncedSearch(), page: this.currentPage() })),
442
+ loader: ({ params }) => {
443
+ if (params.query.length < this.MIN_SEARCH_LENGTH) {
444
+ return Promise.resolve({ items: [], totalCount: 0 });
445
+ }
446
+ const skip = (params.page - 1) * this.PAGE_SIZE;
447
+ return this.userSearchService.search(params.query, this.data.currentUserIds, skip, this.PAGE_SIZE);
448
+ } });
449
+ this.results = computed(() => this.lastResult().items, ...(ngDevMode ? [{ debugName: "results" }] : []));
450
+ this.totalCount = computed(() => this.lastResult().totalCount, ...(ngDevMode ? [{ debugName: "totalCount" }] : []));
451
+ this.lastResult = signal({ items: [], totalCount: 0 }, ...(ngDevMode ? [{ debugName: "lastResult" }] : []));
452
+ this.dialogRef = inject((MatDialogRef));
453
+ this.userSearchService = inject(UserSearchService);
454
+ this.compareUserById = (a, b) => a?.id === b?.id;
455
+ effect(() => {
456
+ const value = this.searchResource.value();
457
+ if (value) {
458
+ untracked(() => this.lastResult.set(value));
459
+ }
460
+ });
461
+ effect(() => {
462
+ this.debouncedSearch();
463
+ untracked(() => {
464
+ this.currentPage.set(1);
465
+ this.paginator()?.moveToFirst();
466
+ this.lastResult.set({ items: [], totalCount: 0 });
467
+ });
468
+ });
469
+ }
470
+ toggleUser(user) {
471
+ const groupUser = { id: user.id, fullName: user.fullName };
472
+ if (this.selectedUserIds().has(user.id)) {
473
+ this.selectedUsers.update(current => current.filter(u => u.id !== user.id));
474
+ }
475
+ else {
476
+ this.selectedUsers.update(current => [...current, groupUser]);
477
+ }
478
+ }
479
+ onPageChange(page) {
480
+ this.currentPage.set(page);
481
+ }
482
+ onSelectionChange(event) {
483
+ for (const option of event.options) {
484
+ this.toggleUser(option.value);
485
+ }
486
+ }
487
+ cancel() {
488
+ this.dialogRef.close();
489
+ }
490
+ confirm() {
491
+ this.dialogRef.close(this.selectedUsers());
492
+ }
493
+ static { this.ɵfac = function GroupUserSelectionDialogComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GroupUserSelectionDialogComponent)(); }; }
494
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GroupUserSelectionDialogComponent, selectors: [["cauca-group-user-selection-dialog"]], viewQuery: function GroupUserSelectionDialogComponent_Query(rf, ctx) { if (rf & 1) {
495
+ i0.ɵɵviewQuerySignal(ctx.paginator, _c0$2, 5);
496
+ } if (rf & 2) {
497
+ i0.ɵɵqueryAdvance();
498
+ } }, features: [i0.ɵɵProvidersFeature([UserSearchService, LoadingStateService])], decls: 31, vars: 18, consts: [["resultPaginator", ""], ["mat-dialog-title", ""], [1, "h6"], ["mat-icon-button", "", "mat-dialog-close", ""], ["subscriptSizing", "dynamic", 1, "search-field"], ["matInput", "", "type", "text", 3, "input", "value"], ["matSuffix", ""], [1, "search-hint", "body2"], [1, "results-region"], [3, "retryRequest"], [1, "no-results", "body2"], [1, "dialog-actions"], [1, "selected-users-panel"], [1, "selected-users-label", "caption"], [1, "selected-users-names", "body2", 3, "matTooltip"], ["color", "primary", "label", "cancel", 3, "buttonClick"], ["color", "primary", "label", "ok", 3, "buttonClick", "isDisabled"], [1, "results-list", 3, "selectionChange", "compareWith"], ["color", "primary", 1, "result-item", 3, "value", "selected", "result-item--even"], [3, "itemsCount", "pageSize"], ["color", "primary", 1, "result-item", 3, "value", "selected"], [3, "pageChange", "itemsCount", "pageSize"]], template: function GroupUserSelectionDialogComponent_Template(rf, ctx) { if (rf & 1) {
499
+ i0.ɵɵelementStart(0, "div", 1)(1, "div", 2);
500
+ i0.ɵɵtext(2);
501
+ i0.ɵɵpipe(3, "translate");
502
+ i0.ɵɵelementEnd();
503
+ i0.ɵɵelementStart(4, "button", 3);
504
+ i0.ɵɵpipe(5, "translate");
505
+ i0.ɵɵelementStart(6, "mat-icon");
506
+ i0.ɵɵtext(7, "close");
507
+ i0.ɵɵelementEnd()()();
508
+ i0.ɵɵelementStart(8, "mat-dialog-content")(9, "mat-form-field", 4)(10, "mat-label");
509
+ i0.ɵɵtext(11);
510
+ i0.ɵɵpipe(12, "translate");
511
+ i0.ɵɵelementEnd();
512
+ i0.ɵɵelementStart(13, "input", 5);
513
+ i0.ɵɵlistener("input", function GroupUserSelectionDialogComponent_Template_input_input_13_listener($event) { return ctx.searchTerm.set($event.target.value); });
514
+ i0.ɵɵelementEnd();
515
+ i0.ɵɵelementStart(14, "mat-icon", 6);
516
+ i0.ɵɵtext(15, "search");
517
+ i0.ɵɵelementEnd()();
518
+ i0.ɵɵconditionalCreate(16, GroupUserSelectionDialogComponent_Conditional_16_Template, 3, 3, "div", 7);
519
+ i0.ɵɵelementStart(17, "div", 8)(18, "cauca-loading-error", 9);
520
+ i0.ɵɵlistener("retryRequest", function GroupUserSelectionDialogComponent_Template_cauca_loading_error_retryRequest_18_listener() { return ctx.searchResource.reload(); });
521
+ i0.ɵɵelementEnd();
522
+ i0.ɵɵconditionalCreate(19, GroupUserSelectionDialogComponent_Conditional_19_Template, 1, 0, "cauca-loading-spinner-indicator")(20, GroupUserSelectionDialogComponent_Conditional_20_Template, 4, 2)(21, GroupUserSelectionDialogComponent_Conditional_21_Template, 3, 3, "div", 10);
523
+ i0.ɵɵelementEnd()();
524
+ i0.ɵɵelementStart(22, "mat-dialog-actions", 11)(23, "div", 12)(24, "span", 13);
525
+ i0.ɵɵtext(25);
526
+ i0.ɵɵpipe(26, "translate");
527
+ i0.ɵɵelementEnd();
528
+ i0.ɵɵelementStart(27, "div", 14);
529
+ i0.ɵɵtext(28);
530
+ i0.ɵɵelementEnd()();
531
+ i0.ɵɵelementStart(29, "cauca-stroked-button", 15);
532
+ i0.ɵɵlistener("buttonClick", function GroupUserSelectionDialogComponent_Template_cauca_stroked_button_buttonClick_29_listener() { return ctx.cancel(); });
533
+ i0.ɵɵelementEnd();
534
+ i0.ɵɵelementStart(30, "cauca-raised-button", 16);
535
+ i0.ɵɵlistener("buttonClick", function GroupUserSelectionDialogComponent_Template_cauca_raised_button_buttonClick_30_listener() { return ctx.confirm(); });
536
+ i0.ɵɵelementEnd()();
537
+ } if (rf & 2) {
538
+ i0.ɵɵadvance(2);
539
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 10, "groupEdition.userSelectionTitle"));
540
+ i0.ɵɵadvance(2);
541
+ i0.ɵɵattribute("aria-label", i0.ɵɵpipeBind1(5, 12, "close"));
542
+ i0.ɵɵadvance(7);
543
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(12, 14, "groupEdition.searchUserPlaceholder"));
544
+ i0.ɵɵadvance(2);
545
+ i0.ɵɵproperty("value", ctx.searchTerm());
546
+ i0.ɵɵadvance(3);
547
+ i0.ɵɵconditional(ctx.searchTerm().length > 0 && ctx.searchTerm().length < ctx.MIN_SEARCH_LENGTH ? 16 : -1);
548
+ i0.ɵɵadvance(3);
549
+ i0.ɵɵconditional(ctx.searchResource.isLoading() && !ctx.results().length ? 19 : ctx.results().length ? 20 : !ctx.searchResource.isLoading() && ctx.totalCount() === 0 && ctx.debouncedSearch().length >= ctx.MIN_SEARCH_LENGTH ? 21 : -1);
550
+ i0.ɵɵadvance(6);
551
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(26, 16, "groupEdition.selectedUsersLabel"));
552
+ i0.ɵɵadvance(2);
553
+ i0.ɵɵproperty("matTooltip", ctx.selectedUsersLabel());
554
+ i0.ɵɵadvance();
555
+ i0.ɵɵtextInterpolate(ctx.selectedUsersLabel());
556
+ i0.ɵɵadvance(2);
557
+ i0.ɵɵproperty("isDisabled", ctx.selectedUsers().length === 0);
558
+ } }, dependencies: [MatDialogModule, i1$1.MatDialogClose, i1$1.MatDialogTitle, i1$1.MatDialogActions, i1$1.MatDialogContent, MatFormFieldModule, i1$2.MatFormField, i1$2.MatLabel, i1$2.MatSuffix, MatInputModule, i2.MatInput, MatIconModule, i4.MatIcon, MatListModule, i4$1.MatSelectionList, i4$1.MatListOption, FormsModule,
559
+ LoadingSpinnerIndicatorComponent,
560
+ LoadingErrorComponent,
561
+ StrokedButtonComponent,
562
+ RaisedButtonComponent,
563
+ ListPaginatorComponent,
564
+ MatTooltipModule, i6.MatTooltip, TranslatePipe], styles: ["[mat-dialog-title][_ngcontent-%COMP%]{display:flex;align-items:center}[mat-dialog-title][_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child{flex:1}.search-field[_ngcontent-%COMP%]{margin-top:16px;width:100%;margin-bottom:8px}.search-hint[_ngcontent-%COMP%], .no-results[_ngcontent-%COMP%]{padding:8px 0;color:#0000008a}.results-region[_ngcontent-%COMP%]{height:360px;overflow:hidden;display:flex;flex-direction:column}.results-list[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;padding:0}.result-item[_ngcontent-%COMP%]{cursor:pointer}.result-item[_ngcontent-%COMP%]:hover{background-color:#0000000a}.result-item--even[_ngcontent-%COMP%]{background-color:#00000008}.result-item--even[_ngcontent-%COMP%]:hover{background-color:#0000000f}.dialog-actions[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap}.selected-users-panel[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.selected-users-label[_ngcontent-%COMP%]{color:#0000008a;font-weight:500}.selected-users-names[_ngcontent-%COMP%]{color:#000000de;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"], changeDetection: 0 }); }
565
+ }
566
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GroupUserSelectionDialogComponent, [{
567
+ type: Component,
568
+ args: [{ selector: 'cauca-group-user-selection-dialog', standalone: true, imports: [
569
+ MatDialogModule,
570
+ MatFormFieldModule,
571
+ MatInputModule,
572
+ MatIconModule,
573
+ MatListModule,
574
+ FormsModule,
575
+ TranslatePipe,
576
+ LoadingSpinnerIndicatorComponent,
577
+ LoadingErrorComponent,
578
+ StrokedButtonComponent,
579
+ RaisedButtonComponent,
580
+ ListPaginatorComponent,
581
+ MatTooltipModule
582
+ ], changeDetection: ChangeDetectionStrategy.OnPush, providers: [UserSearchService, LoadingStateService], template: "<div mat-dialog-title>\n <div class=\"h6\">{{ 'groupEdition.userSelectionTitle' | translate }}</div>\n <button mat-icon-button mat-dialog-close [attr.aria-label]=\"'close' | translate\">\n <mat-icon>close</mat-icon>\n </button>\n</div>\n\n<mat-dialog-content>\n <mat-form-field subscriptSizing=\"dynamic\" class=\"search-field\">\n <mat-label>{{ 'groupEdition.searchUserPlaceholder' | translate }}</mat-label>\n <input matInput type=\"text\" [value]=\"searchTerm()\" (input)=\"searchTerm.set($any($event.target).value)\" />\n <mat-icon matSuffix>search</mat-icon>\n </mat-form-field>\n\n @if (searchTerm().length > 0 && searchTerm().length < MIN_SEARCH_LENGTH) {\n <div class=\"search-hint body2\">{{ 'groupEdition.searchMinChars' | translate }}</div>\n }\n\n <div class=\"results-region\">\n <cauca-loading-error (retryRequest)=\"searchResource.reload()\" />\n\n @if (searchResource.isLoading() && !results().length) {\n <cauca-loading-spinner-indicator />\n } @else if (results().length) {\n <mat-selection-list class=\"results-list\" [compareWith]=\"compareUserById\" (selectionChange)=\"onSelectionChange($event)\">\n @for (user of results(); track user.id; let i = $index) {\n <mat-list-option\n [value]=\"user\"\n [selected]=\"selectedUserIds().has(user.id)\"\n color=\"primary\"\n class=\"result-item\"\n [class.result-item--even]=\"i % 2 === 1\">\n {{ user.fullName }}\n </mat-list-option>\n }\n </mat-selection-list>\n\n @if (totalCount() > PAGE_SIZE) {\n <cauca-list-paginator\n #resultPaginator\n [itemsCount]=\"totalCount()\"\n [pageSize]=\"PAGE_SIZE\"\n (pageChange)=\"onPageChange($event)\" />\n }\n } @else if (!searchResource.isLoading() && totalCount() === 0 && debouncedSearch().length >= MIN_SEARCH_LENGTH) {\n <div class=\"no-results body2\">{{ 'noResult' | translate }}</div>\n }\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions class=\"dialog-actions\">\n <div class=\"selected-users-panel\">\n <span class=\"selected-users-label caption\">{{ 'groupEdition.selectedUsersLabel' | translate }}</span>\n <div class=\"selected-users-names body2\" [matTooltip]=\"selectedUsersLabel()\">{{ selectedUsersLabel() }}</div>\n </div>\n <cauca-stroked-button color=\"primary\" label=\"cancel\" (buttonClick)=\"cancel()\" />\n <cauca-raised-button\n color=\"primary\"\n label=\"ok\"\n [isDisabled]=\"selectedUsers().length === 0\"\n (buttonClick)=\"confirm()\" />\n</mat-dialog-actions>\n", styles: ["[mat-dialog-title]{display:flex;align-items:center}[mat-dialog-title] div:first-child{flex:1}.search-field{margin-top:16px;width:100%;margin-bottom:8px}.search-hint,.no-results{padding:8px 0;color:#0000008a}.results-region{height:360px;overflow:hidden;display:flex;flex-direction:column}.results-list{flex:1 1 auto;min-height:0;overflow-y:auto;padding:0}.result-item{cursor:pointer}.result-item:hover{background-color:#0000000a}.result-item--even{background-color:#00000008}.result-item--even:hover{background-color:#0000000f}.dialog-actions{display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap}.selected-users-panel{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.selected-users-label{color:#0000008a;font-weight:500}.selected-users-names{color:#000000de;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"] }]
583
+ }], () => [], { paginator: [{ type: i0.ViewChild, args: ['resultPaginator', { isSignal: true }] }] }); })();
584
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(GroupUserSelectionDialogComponent, { className: "GroupUserSelectionDialogComponent", filePath: "lib/components/group-user-selection-dialog/group-user-selection-dialog.component.ts", lineNumber: 45 }); })();
585
+
586
+ const _c0$1 = ["paginator"];
587
+ const _forTrack0$1 = ($index, $item) => $item.id;
588
+ function GroupUserEditionListComponent_For_10_Template(rf, ctx) { if (rf & 1) {
589
+ const _r2 = i0.ɵɵgetCurrentView();
590
+ i0.ɵɵelementStart(0, "mat-list-item", 6)(1, "mat-icon", 9);
591
+ i0.ɵɵtext(2, "person");
592
+ i0.ɵɵelementEnd();
593
+ i0.ɵɵelementStart(3, "div", 10);
594
+ i0.ɵɵtext(4);
595
+ i0.ɵɵelementEnd();
596
+ i0.ɵɵelementStart(5, "cauca-icon-button", 11);
597
+ i0.ɵɵpipe(6, "translate");
598
+ i0.ɵɵlistener("buttonClick", function GroupUserEditionListComponent_For_10_Template_cauca_icon_button_buttonClick_5_listener() { const user_r3 = i0.ɵɵrestoreView(_r2).$implicit; const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.removeUser(user_r3)); });
599
+ i0.ɵɵelementEnd()();
600
+ } if (rf & 2) {
601
+ const user_r3 = ctx.$implicit;
602
+ i0.ɵɵadvance(4);
603
+ i0.ɵɵtextInterpolate(user_r3.fullName);
604
+ i0.ɵɵadvance();
605
+ i0.ɵɵattribute("aria-label", i0.ɵɵpipeBind1(6, 2, "departmentGroupRoleEdition.removeUserLabel"));
606
+ } }
607
+ function GroupUserEditionListComponent_ForEmpty_11_Conditional_0_Template(rf, ctx) { if (rf & 1) {
608
+ i0.ɵɵelementStart(0, "div", 12);
609
+ i0.ɵɵtext(1);
610
+ i0.ɵɵpipe(2, "translate");
611
+ i0.ɵɵelementEnd();
612
+ } if (rf & 2) {
613
+ i0.ɵɵadvance();
614
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "groupEdition.noFilteredUsers"));
615
+ } }
616
+ function GroupUserEditionListComponent_ForEmpty_11_Conditional_1_Template(rf, ctx) { if (rf & 1) {
617
+ i0.ɵɵelementStart(0, "div", 12);
618
+ i0.ɵɵtext(1);
619
+ i0.ɵɵpipe(2, "translate");
620
+ i0.ɵɵelementEnd();
621
+ } if (rf & 2) {
622
+ i0.ɵɵadvance();
623
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "groupEdition.noUsers"));
624
+ } }
625
+ function GroupUserEditionListComponent_ForEmpty_11_Template(rf, ctx) { if (rf & 1) {
626
+ i0.ɵɵconditionalCreate(0, GroupUserEditionListComponent_ForEmpty_11_Conditional_0_Template, 3, 3, "div", 12)(1, GroupUserEditionListComponent_ForEmpty_11_Conditional_1_Template, 3, 3, "div", 12);
627
+ } if (rf & 2) {
628
+ const ctx_r0 = i0.ɵɵnextContext();
629
+ i0.ɵɵconditional(ctx_r0.filterTerm() ? 0 : 1);
630
+ } }
631
+ function GroupUserEditionListComponent_Conditional_12_Template(rf, ctx) { if (rf & 1) {
632
+ const _r4 = i0.ɵɵgetCurrentView();
633
+ i0.ɵɵelementStart(0, "cauca-list-paginator", 13, 0);
634
+ i0.ɵɵlistener("pageChange", function GroupUserEditionListComponent_Conditional_12_Template_cauca_list_paginator_pageChange_0_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onPageChange($event)); });
635
+ i0.ɵɵelementEnd();
636
+ } if (rf & 2) {
637
+ const ctx_r0 = i0.ɵɵnextContext();
638
+ i0.ɵɵproperty("itemsCount", ctx_r0.filteredUsers().length)("pageSize", ctx_r0.PAGE_SIZE);
639
+ } }
640
+ class GroupUserEditionListComponent {
641
+ constructor() {
642
+ this.PAGE_SIZE = 10;
643
+ this.currentPage = signal(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
644
+ this.filterTerm = signal('', ...(ngDevMode ? [{ debugName: "filterTerm" }] : []));
645
+ this.paginator = viewChild('paginator', ...(ngDevMode ? [{ debugName: "paginator" }] : []));
646
+ this.sortedUsers = computed(() => [...this.state.users()].sort((a, b) => toLowerCaseAndWithoutDiacritics(a.fullName).localeCompare(toLowerCaseAndWithoutDiacritics(b.fullName))), ...(ngDevMode ? [{ debugName: "sortedUsers" }] : []));
647
+ this.filteredUsers = computed(() => {
648
+ const term = toLowerCaseAndWithoutDiacritics(this.filterTerm());
649
+ if (!term)
650
+ return this.sortedUsers();
651
+ return this.sortedUsers().filter(u => toLowerCaseAndWithoutDiacritics(u.fullName).includes(term));
652
+ }, ...(ngDevMode ? [{ debugName: "filteredUsers" }] : []));
653
+ this.pagedUsers = computed(() => {
654
+ const start = (this.currentPage() - 1) * this.PAGE_SIZE;
655
+ return this.filteredUsers().slice(start, start + this.PAGE_SIZE);
656
+ }, ...(ngDevMode ? [{ debugName: "pagedUsers" }] : []));
657
+ this.state = inject(GroupEditionStateService);
658
+ this.dialogService = inject(DialogService);
659
+ this.dialog = inject(MatDialog);
660
+ effect(() => {
661
+ this.filterTerm();
662
+ untracked(() => {
663
+ this.currentPage.set(1);
664
+ this.paginator()?.moveToFirst();
665
+ });
666
+ });
667
+ }
668
+ async removeUser(user) {
669
+ const confirmed = await this.dialogService.askForDeleteConfirmation(user.fullName, 'groupEdition.userEntityName', true);
670
+ if (confirmed) {
671
+ this.state.removeUser(user.id);
672
+ this.clampCurrentPage();
673
+ }
674
+ }
675
+ onPageChange(page) {
676
+ this.currentPage.set(page);
677
+ }
678
+ openAddUsersDialog() {
679
+ const currentUserIds = this.state.users().map((u) => u.id);
680
+ const dialogData = { currentUserIds };
681
+ this.dialog.open(GroupUserSelectionDialogComponent, {
682
+ width: '600px',
683
+ maxHeight: '80vh',
684
+ autoFocus: false,
685
+ data: dialogData
686
+ }).afterClosed().subscribe((selectedUsers) => {
687
+ if (selectedUsers?.length) {
688
+ this.state.addUsers(selectedUsers);
689
+ this.paginator()?.moveToFirst();
690
+ this.currentPage.set(1);
691
+ }
692
+ });
693
+ }
694
+ clampCurrentPage() {
695
+ const total = untracked(this.filteredUsers).length;
696
+ const maxPage = Math.ceil(total / this.PAGE_SIZE) || 1;
697
+ if (untracked(this.currentPage) > maxPage) {
698
+ this.currentPage.set(1);
699
+ this.paginator()?.moveToFirst();
700
+ }
701
+ }
702
+ static { this.ɵfac = function GroupUserEditionListComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GroupUserEditionListComponent)(); }; }
703
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GroupUserEditionListComponent, selectors: [["cauca-group-user-edition-list"]], viewQuery: function GroupUserEditionListComponent_Query(rf, ctx) { if (rf & 1) {
704
+ i0.ɵɵviewQuerySignal(ctx.paginator, _c0$1, 5);
705
+ } if (rf & 2) {
706
+ i0.ɵɵqueryAdvance();
707
+ } }, features: [i0.ɵɵProvidersFeature([DialogService])], decls: 14, vars: 6, consts: [["paginator", ""], [1, "user-edition-list"], ["subscriptSizing", "dynamic", 1, "filter-field"], ["matInput", "", "type", "text", 3, "input", "value"], ["matSuffix", ""], [1, "users-list"], [1, "user-item"], [3, "itemsCount", "pageSize"], ["color", "primary", "label", "groupEdition.addUsersButton", 1, "add-users-button", 3, "buttonClick"], ["matListItemIcon", ""], ["matListItemTitle", "", 1, "user-name"], ["matListItemMeta", "", "icon", "delete", "color", "error", 1, "delete-button", 3, "buttonClick"], [1, "no-users", "body2"], [3, "pageChange", "itemsCount", "pageSize"]], template: function GroupUserEditionListComponent_Template(rf, ctx) { if (rf & 1) {
708
+ i0.ɵɵelementStart(0, "div", 1)(1, "mat-form-field", 2)(2, "mat-label");
709
+ i0.ɵɵtext(3);
710
+ i0.ɵɵpipe(4, "translate");
711
+ i0.ɵɵelementEnd();
712
+ i0.ɵɵelementStart(5, "input", 3);
713
+ i0.ɵɵlistener("input", function GroupUserEditionListComponent_Template_input_input_5_listener($event) { return ctx.filterTerm.set($event.target.value); });
714
+ i0.ɵɵelementEnd();
715
+ i0.ɵɵelementStart(6, "mat-icon", 4);
716
+ i0.ɵɵtext(7, "search");
717
+ i0.ɵɵelementEnd()();
718
+ i0.ɵɵelementStart(8, "mat-list", 5);
719
+ i0.ɵɵrepeaterCreate(9, GroupUserEditionListComponent_For_10_Template, 7, 4, "mat-list-item", 6, _forTrack0$1, false, GroupUserEditionListComponent_ForEmpty_11_Template, 2, 1);
720
+ i0.ɵɵelementEnd();
721
+ i0.ɵɵconditionalCreate(12, GroupUserEditionListComponent_Conditional_12_Template, 2, 2, "cauca-list-paginator", 7);
722
+ i0.ɵɵelementStart(13, "cauca-raised-button", 8);
723
+ i0.ɵɵlistener("buttonClick", function GroupUserEditionListComponent_Template_cauca_raised_button_buttonClick_13_listener() { return ctx.openAddUsersDialog(); });
724
+ i0.ɵɵelementEnd()();
725
+ } if (rf & 2) {
726
+ i0.ɵɵadvance(3);
727
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 4, "groupEdition.filterUsersPlaceholder"));
728
+ i0.ɵɵadvance(2);
729
+ i0.ɵɵproperty("value", ctx.filterTerm());
730
+ i0.ɵɵadvance(4);
731
+ i0.ɵɵrepeater(ctx.pagedUsers());
732
+ i0.ɵɵadvance(3);
733
+ i0.ɵɵconditional(ctx.filteredUsers().length > ctx.PAGE_SIZE ? 12 : -1);
734
+ } }, dependencies: [IconButtonComponent, RaisedButtonComponent, ListPaginatorComponent, MatFormFieldModule, i1$2.MatFormField, i1$2.MatLabel, i1$2.MatSuffix, MatInputModule, i2.MatInput, MatIconModule, i4.MatIcon, FormsModule, MatListModule, i4$1.MatList, i4$1.MatListItem, i4$1.MatListItemIcon, i4$1.MatListItemTitle, i4$1.MatListItemMeta, TranslatePipe], styles: [".user-edition-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.add-users-button[_ngcontent-%COMP%]{align-self:flex-end}.users-list[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.23);border-radius:4px;padding:0;max-height:400px;overflow-y:auto}mat-list-item[_ngcontent-%COMP%]{margin-bottom:0}.filter-field[_ngcontent-%COMP%]{width:100%}.user-item[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.12)}.user-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding:32px 16px;text-align:center;color:#0009}.empty-state[_ngcontent-%COMP%] .empty-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px;margin-bottom:16px;opacity:.6}.empty-state[_ngcontent-%COMP%] .empty-message[_ngcontent-%COMP%]{margin:0;font-size:14px}.add-button-container[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;margin-top:16px}.no-users[_ngcontent-%COMP%]{padding:16px 0;color:#00000061;text-align:center}mat-list-item[_ngcontent-%COMP%]:nth-child(odd){background-color:#0000000d}mat-list-item[_ngcontent-%COMP%]:hover{transition:all ease-in-out .1s;background-color:#00000012}"], changeDetection: 0 }); }
735
+ }
736
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GroupUserEditionListComponent, [{
737
+ type: Component,
738
+ args: [{ selector: 'cauca-group-user-edition-list', standalone: true, imports: [TranslatePipe, IconButtonComponent, RaisedButtonComponent, ListPaginatorComponent, MatFormFieldModule, MatInputModule, MatIconModule, FormsModule, MatListModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [DialogService], template: "<div class=\"user-edition-list\">\n\n <mat-form-field subscriptSizing=\"dynamic\" class=\"filter-field\">\n <mat-label>{{ 'groupEdition.filterUsersPlaceholder' | translate }}</mat-label>\n <input matInput type=\"text\" [value]=\"filterTerm()\" (input)=\"filterTerm.set($any($event.target).value)\" />\n <mat-icon matSuffix>search</mat-icon>\n </mat-form-field>\n\n <mat-list class=\"users-list\">\n @for (user of pagedUsers(); track user.id) {\n <mat-list-item class=\"user-item\">\n <mat-icon matListItemIcon>person</mat-icon>\n <div matListItemTitle class=\"user-name\">{{ user.fullName }}</div>\n <cauca-icon-button\n matListItemMeta\n class=\"delete-button\"\n icon=\"delete\"\n color=\"error\"\n (buttonClick)=\"removeUser(user)\"\n [attr.aria-label]=\"'departmentGroupRoleEdition.removeUserLabel' | translate\" />\n </mat-list-item>\n } @empty {\n @if (filterTerm()) {\n <div class=\"no-users body2\">{{ 'groupEdition.noFilteredUsers' | translate }}</div>\n } @else {\n <div class=\"no-users body2\">{{ 'groupEdition.noUsers' | translate }}</div>\n }\n }\n </mat-list>\n\n @if (filteredUsers().length > PAGE_SIZE) {\n <cauca-list-paginator\n #paginator\n [itemsCount]=\"filteredUsers().length\"\n [pageSize]=\"PAGE_SIZE\"\n (pageChange)=\"onPageChange($event)\" />\n }\n\n <cauca-raised-button\n class=\"add-users-button\"\n color=\"primary\"\n label=\"groupEdition.addUsersButton\"\n (buttonClick)=\"openAddUsersDialog()\" />\n</div>\n", styles: [".user-edition-list{display:flex;flex-direction:column;gap:16px}.add-users-button{align-self:flex-end}.users-list{border:1px solid rgba(0,0,0,.23);border-radius:4px;padding:0;max-height:400px;overflow-y:auto}mat-list-item{margin-bottom:0}.filter-field{width:100%}.user-item{border-bottom:1px solid rgba(0,0,0,.12)}.user-item:last-child{border-bottom:none}.empty-state{display:flex;flex-direction:column;align-items:center;padding:32px 16px;text-align:center;color:#0009}.empty-state .empty-icon{font-size:48px;width:48px;height:48px;margin-bottom:16px;opacity:.6}.empty-state .empty-message{margin:0;font-size:14px}.add-button-container{display:flex;justify-content:flex-end;margin-top:16px}.no-users{padding:16px 0;color:#00000061;text-align:center}mat-list-item:nth-child(odd){background-color:#0000000d}mat-list-item:hover{transition:all ease-in-out .1s;background-color:#00000012}\n"] }]
739
+ }], () => [], { paginator: [{ type: i0.ViewChild, args: ['paginator', { isSignal: true }] }] }); })();
740
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(GroupUserEditionListComponent, { className: "GroupUserEditionListComponent", filePath: "lib/components/group-user-edition-list/group-user-edition-list.component.ts", lineNumber: 24 }); })();
741
+
742
+ class PermissionValue {
743
+ constructor(permission, groupPermission) {
744
+ this.id = permission.id;
745
+ this.permission = permission;
746
+ this.groupPermission = groupPermission;
747
+ this.name = permission.name;
748
+ this.allowed = groupPermission?.isAllowed ?? null;
749
+ }
750
+ toGroupPermission(idGroup) {
751
+ if (this.allowed === null) {
752
+ return null;
753
+ }
754
+ else if (this.groupPermission) {
755
+ return { ...this.groupPermission, isAllowed: this.allowed };
756
+ }
757
+ else {
758
+ return { id: v4(), idGroup, idModulePermission: this.permission.id, isAllowed: this.allowed };
759
+ }
760
+ }
761
+ }
762
+
763
+ class PermissionManagementService {
764
+ constructor() {
765
+ this.client = inject(HttpClient);
766
+ this.baseUrl = this.buildBaseUrl(inject(CaucaCoreService).getConfig().apiUrl, inject(MANAGEMENT_URL_PREFIX, { optional: true }));
767
+ }
768
+ async get() {
769
+ return await firstValueFrom(this.client.get(this.buildApiUrl(`PermissionManagement`)));
770
+ }
771
+ buildBaseUrl(apiUrl, urlPrefix) {
772
+ const normalizedApiUrl = apiUrl.replace(/\/+$/, '');
773
+ const normalizedPrefix = urlPrefix?.trim().replace(/^\/+|\/+$/g, '');
774
+ return normalizedPrefix
775
+ ? `${normalizedApiUrl}/${normalizedPrefix}`
776
+ : normalizedApiUrl;
777
+ }
778
+ buildApiUrl(path) {
779
+ const normalizedApiUrl = this.baseUrl.replace(/\/+$/, '');
780
+ return `${normalizedApiUrl}/${path}`;
781
+ }
782
+ static { this.ɵfac = function PermissionManagementService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PermissionManagementService)(); }; }
783
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: PermissionManagementService, factory: PermissionManagementService.ɵfac, providedIn: 'root' }); }
784
+ }
785
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PermissionManagementService, [{
786
+ type: Injectable,
787
+ args: [{
788
+ providedIn: 'root'
789
+ }]
790
+ }], null, null); })();
791
+
792
+ const _forTrack0 = ($index, $item) => $item.id;
793
+ function GroupPermissionListComponent_For_9_Template(rf, ctx) { if (rf & 1) {
794
+ const _r1 = i0.ɵɵgetCurrentView();
795
+ i0.ɵɵelementStart(0, "mat-list-item", 4)(1, "mat-checkbox", 6);
796
+ i0.ɵɵlistener("click", function GroupPermissionListComponent_For_9_Template_mat_checkbox_click_1_listener() { const permission_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onValueChange(permission_r2)); });
797
+ i0.ɵɵtext(2);
798
+ i0.ɵɵelementEnd()();
799
+ } if (rf & 2) {
800
+ const permission_r2 = ctx.$implicit;
801
+ i0.ɵɵadvance();
802
+ i0.ɵɵproperty("color", permission_r2.allowed === null ? undefined : "primary")("indeterminate", permission_r2.allowed === null)("checked", permission_r2.allowed);
803
+ i0.ɵɵadvance();
804
+ i0.ɵɵtextInterpolate1(" ", permission_r2.name, " ");
805
+ } }
806
+ function GroupPermissionListComponent_ForEmpty_10_Template(rf, ctx) { if (rf & 1) {
807
+ i0.ɵɵelementStart(0, "div", 5)(1, "mat-icon", 7);
808
+ i0.ɵɵtext(2, "grid_off");
809
+ i0.ɵɵelementEnd();
810
+ i0.ɵɵelementStart(3, "div", 8);
811
+ i0.ɵɵtext(4);
812
+ i0.ɵɵpipe(5, "translate");
813
+ i0.ɵɵelementEnd()();
814
+ } if (rf & 2) {
815
+ i0.ɵɵadvance(4);
816
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(5, 1, "noResult"));
817
+ } }
818
+ class GroupPermissionListComponent {
819
+ constructor() {
820
+ this.searchText = model('', ...(ngDevMode ? [{ debugName: "searchText" }] : []));
821
+ this.currentPermissions = signal([], ...(ngDevMode ? [{ debugName: "currentPermissions" }] : []));
822
+ this.filteredPermissionsValues = computed(() => this.currentPermissions()?.filter((permission) => toLowerCaseAndWithoutDiacritics(permission.name)
823
+ .includes(toLowerCaseAndWithoutDiacritics(this.searchText()))) || [], ...(ngDevMode ? [{ debugName: "filteredPermissionsValues" }] : []));
824
+ this.service = inject(PermissionManagementService);
825
+ this.state = inject(GroupEditionStateService);
826
+ }
827
+ async ngOnInit() {
828
+ await this.loadData();
829
+ }
830
+ onValueChange(value) {
831
+ if (value.allowed === null) {
832
+ value.allowed = true;
833
+ }
834
+ else if (value.allowed) {
835
+ value.allowed = false;
836
+ }
837
+ else {
838
+ value.allowed = null;
839
+ }
840
+ this.state.form.get('permissions').setValue(this.toGroupPermissions(this.state.id));
841
+ }
842
+ async loadData() {
843
+ try {
844
+ this.modulePermissions = await this.service.get();
845
+ const values = this.modulePermissions
846
+ .map((permission) => new PermissionValue(permission, this.getPermissions().find((groupPermission) => groupPermission.idModulePermission === permission.id)));
847
+ this.currentPermissions.set(values);
848
+ }
849
+ catch {
850
+ this.modulePermissions = [];
851
+ }
852
+ }
853
+ toGroupPermissions(idGroup) {
854
+ return this.currentPermissions().map((permissionValue) => permissionValue.toGroupPermission(idGroup))
855
+ .filter((groupPermission) => groupPermission !== null);
856
+ }
857
+ getPermissions() {
858
+ return this.state.form.get('permissions').value;
859
+ }
860
+ static { this.ɵfac = function GroupPermissionListComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GroupPermissionListComponent)(); }; }
861
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GroupPermissionListComponent, selectors: [["cauca-group-permission-list"]], inputs: { searchText: [1, "searchText"] }, outputs: { searchText: "searchTextChange" }, decls: 11, vars: 5, consts: [["subscriptSizing", "dynamic", "appearance", "outline", 1, "full-width-field", "grid-search-box"], ["matInput", "", 3, "ngModelChange", "ngModel"], ["matSuffix", ""], ["id", "permission-list"], [1, "permission-item"], [1, "no-result"], [3, "click", "color", "indeterminate", "checked"], [1, "no-result-icon"], [1, "no-result-text", "body2"]], template: function GroupPermissionListComponent_Template(rf, ctx) { if (rf & 1) {
862
+ i0.ɵɵelementStart(0, "mat-form-field", 0)(1, "mat-label");
863
+ i0.ɵɵtext(2);
864
+ i0.ɵɵpipe(3, "translate");
865
+ i0.ɵɵelementEnd();
866
+ i0.ɵɵelementStart(4, "input", 1);
867
+ i0.ɵɵtwoWayListener("ngModelChange", function GroupPermissionListComponent_Template_input_ngModelChange_4_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.searchText, $event) || (ctx.searchText = $event); return $event; });
868
+ i0.ɵɵelementEnd();
869
+ i0.ɵɵelementStart(5, "mat-icon", 2);
870
+ i0.ɵɵtext(6, "search");
871
+ i0.ɵɵelementEnd()();
872
+ i0.ɵɵelementStart(7, "mat-selection-list", 3);
873
+ i0.ɵɵrepeaterCreate(8, GroupPermissionListComponent_For_9_Template, 3, 4, "mat-list-item", 4, _forTrack0, false, GroupPermissionListComponent_ForEmpty_10_Template, 6, 3, "div", 5);
874
+ i0.ɵɵelementEnd();
875
+ } if (rf & 2) {
876
+ i0.ɵɵadvance(2);
877
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 3, "dataGrid.keywordsLabel"));
878
+ i0.ɵɵadvance(2);
879
+ i0.ɵɵtwoWayProperty("ngModel", ctx.searchText);
880
+ i0.ɵɵadvance(4);
881
+ i0.ɵɵrepeater(ctx.filteredPermissionsValues());
882
+ } }, dependencies: [MatListModule, i4$1.MatSelectionList, i4$1.MatListItem, MatFormField, MatLabel, MatInput, MatSuffix, FormsModule, i5.DefaultValueAccessor, i5.NgControlStatus, i5.NgModel, MatIcon, MatCheckboxModule, i3.MatCheckbox, TranslatePipe], styles: [".permission-list[_ngcontent-%COMP%]{max-height:400px;overflow-y:auto;border:1px solid rgba(0,0,0,.23);border-radius:4px;padding:0}.permission-item[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.12)}.permission-item[_ngcontent-%COMP%]:last-child{border-bottom:none}mat-list-item[_ngcontent-%COMP%]{margin-bottom:0}.permission-checkbox[_ngcontent-%COMP%], .filter-field[_ngcontent-%COMP%]{width:100%}.no-result[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding:24px 0;color:#00000061}.no-result-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px;margin-bottom:8px}.no-result-text[_ngcontent-%COMP%]{text-align:center}mat-list-item[_ngcontent-%COMP%]:nth-child(odd){background-color:#0000000d}mat-list-item[_ngcontent-%COMP%]:hover{transition:all ease-in-out .1s;background-color:#00000012}"], changeDetection: 0 }); }
883
+ }
884
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GroupPermissionListComponent, [{
885
+ type: Component,
886
+ args: [{ selector: 'cauca-group-permission-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatListModule, MatFormField, MatLabel, MatInput, MatSuffix, TranslatePipe, FormsModule, MatIcon, MatCheckboxModule], template: "<mat-form-field subscriptSizing=\"dynamic\" appearance=\"outline\" class=\"full-width-field grid-search-box\">\n <mat-label>{{ 'dataGrid.keywordsLabel' | translate }}</mat-label>\n <input matInput [(ngModel)]=\"searchText\">\n <mat-icon matSuffix>search</mat-icon>\n</mat-form-field>\n\n<mat-selection-list id=\"permission-list\">\n @for (permission of filteredPermissionsValues(); track permission.id) {\n <mat-list-item class=\"permission-item\">\n <mat-checkbox\n [color]=\"permission.allowed === null ? undefined : 'primary'\"\n [indeterminate]=\"permission.allowed === null\"\n [checked]=\"permission.allowed\"\n (click)=\"onValueChange(permission)\" >\n {{permission.name}}\n </mat-checkbox>\n </mat-list-item>\n } @empty {\n <div class=\"no-result\">\n <mat-icon class=\"no-result-icon\">grid_off</mat-icon>\n <div class=\"no-result-text body2\">{{ 'noResult' | translate }}</div>\n </div>\n }\n\n</mat-selection-list>\n", styles: [".permission-list{max-height:400px;overflow-y:auto;border:1px solid rgba(0,0,0,.23);border-radius:4px;padding:0}.permission-item{border-bottom:1px solid rgba(0,0,0,.12)}.permission-item:last-child{border-bottom:none}mat-list-item{margin-bottom:0}.permission-checkbox,.filter-field{width:100%}.no-result{display:flex;flex-direction:column;align-items:center;padding:24px 0;color:#00000061}.no-result-icon{font-size:48px;width:48px;height:48px;margin-bottom:8px}.no-result-text{text-align:center}mat-list-item:nth-child(odd){background-color:#0000000d}mat-list-item:hover{transition:all ease-in-out .1s;background-color:#00000012}\n"] }]
887
+ }], null, { searchText: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchText", required: false }] }, { type: i0.Output, args: ["searchTextChange"] }] }); })();
888
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(GroupPermissionListComponent, { className: "GroupPermissionListComponent", filePath: "lib/components/group-permission-list/group-permission-list.component.ts", lineNumber: 23 }); })();
889
+
890
+ function GroupEditionFormComponent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
891
+ i0.ɵɵelementStart(0, "mat-error");
892
+ i0.ɵɵtext(1);
893
+ i0.ɵɵpipe(2, "translate");
894
+ i0.ɵɵelementEnd();
895
+ } if (rf & 2) {
896
+ i0.ɵɵadvance();
897
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "error.requiredField"));
898
+ } }
899
+ class GroupEditionFormComponent {
900
+ constructor() {
901
+ this.state = inject(GroupEditionStateService);
902
+ }
903
+ static { this.ɵfac = function GroupEditionFormComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GroupEditionFormComponent)(); }; }
904
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GroupEditionFormComponent, selectors: [["cauca-group-edition-form"]], decls: 17, vars: 8, consts: [[3, "formGroup"], ["id", "group-options", "caption", "groupEdition.groupNameFieldLabel"], ["id", "group-name"], ["matInput", "", "type", "text", "formControlName", "name", "required", ""], ["id", "assignable-by-all-users", "formControlName", "assignableByAllUsers", "color", "primary"], ["id", "group-users", "caption", "groupEdition.groupUsersFieldLabel"], ["id", "group-permissions", "caption", "groupEdition.groupPermissionsFieldLabel"]], template: function GroupEditionFormComponent_Template(rf, ctx) { if (rf & 1) {
905
+ i0.ɵɵelementStart(0, "div", 0)(1, "cauca-group-container", 1)(2, "mat-form-field", 2)(3, "mat-label");
906
+ i0.ɵɵtext(4);
907
+ i0.ɵɵpipe(5, "translate");
908
+ i0.ɵɵelementEnd();
909
+ i0.ɵɵelement(6, "input", 3);
910
+ i0.ɵɵconditionalCreate(7, GroupEditionFormComponent_Conditional_7_Template, 3, 3, "mat-error");
911
+ i0.ɵɵelementEnd();
912
+ i0.ɵɵelementStart(8, "mat-slide-toggle", 4);
913
+ i0.ɵɵtext(9);
914
+ i0.ɵɵpipe(10, "translate");
915
+ i0.ɵɵelementEnd()();
916
+ i0.ɵɵelement(11, "mat-divider");
917
+ i0.ɵɵelementStart(12, "cauca-group-container", 5);
918
+ i0.ɵɵelement(13, "cauca-group-user-edition-list");
919
+ i0.ɵɵelementEnd();
920
+ i0.ɵɵelement(14, "mat-divider");
921
+ i0.ɵɵelementStart(15, "cauca-group-container", 6);
922
+ i0.ɵɵelement(16, "cauca-group-permission-list");
923
+ i0.ɵɵelementEnd()();
924
+ } if (rf & 2) {
925
+ i0.ɵɵproperty("formGroup", ctx.state.form);
926
+ i0.ɵɵadvance(4);
927
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(5, 4, "groupEdition.nameFieldLabel"));
928
+ i0.ɵɵadvance(3);
929
+ i0.ɵɵconditional(ctx.state.form.get("name").hasError("required") ? 7 : -1);
930
+ i0.ɵɵadvance(2);
931
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(10, 6, "groupEdition.assignableByAllUsersLabel"));
932
+ } }, dependencies: [MatFormFieldModule, i1$2.MatFormField, i1$2.MatLabel, i1$2.MatError, MatInputModule, i2.MatInput, MatSlideToggleModule, i3$1.MatSlideToggle, MatDividerModule, i4$1.MatDivider, ReactiveFormsModule, i5.DefaultValueAccessor, i5.NgControlStatus, i5.NgControlStatusGroup, i5.RequiredValidator, i5.FormGroupDirective, i5.FormControlName, GroupContainerComponent, GroupUserEditionListComponent, GroupPermissionListComponent, TranslatePipe], styles: [".form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.row[_ngcontent-%COMP%]{display:flex;align-items:stretch;gap:16px}.row[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1}"], changeDetection: 0 }); }
933
+ }
934
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GroupEditionFormComponent, [{
935
+ type: Component,
936
+ args: [{ selector: 'cauca-group-edition-form', changeDetection: ChangeDetectionStrategy.OnPush, imports: [TranslatePipe, MatFormFieldModule, MatInputModule, MatSlideToggleModule, MatDividerModule, ReactiveFormsModule, GroupContainerComponent, GroupUserEditionListComponent, GroupPermissionListComponent], template: "<div [formGroup]=\"state.form\">\n\n <cauca-group-container id=\"group-options\" caption=\"groupEdition.groupNameFieldLabel\">\n <mat-form-field id=\"group-name\">\n <mat-label>{{ 'groupEdition.nameFieldLabel' | translate }}</mat-label>\n <input matInput type=\"text\" formControlName=\"name\" required>\n @if (state.form.get(\"name\").hasError('required')) {<mat-error>{{'error.requiredField' | translate}}</mat-error>}\n </mat-form-field>\n <mat-slide-toggle id=\"assignable-by-all-users\" formControlName=\"assignableByAllUsers\" color=\"primary\">{{'groupEdition.assignableByAllUsersLabel' | translate}}</mat-slide-toggle>\n </cauca-group-container>\n\n <mat-divider />\n\n <cauca-group-container id=\"group-users\" caption=\"groupEdition.groupUsersFieldLabel\">\n <cauca-group-user-edition-list />\n </cauca-group-container>\n\n <mat-divider />\n\n <cauca-group-container id=\"group-permissions\" caption=\"groupEdition.groupPermissionsFieldLabel\">\n <cauca-group-permission-list />\n </cauca-group-container>\n\n</div>\n", styles: [".form{display:flex;flex-direction:column;gap:16px}.row{display:flex;align-items:stretch;gap:16px}.row>*{flex:1}\n"] }]
937
+ }], null, null); })();
938
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(GroupEditionFormComponent, { className: "GroupEditionFormComponent", filePath: "lib/components/group-edition-form/group-edition-form.component.ts", lineNumber: 20 }); })();
939
+
940
+ function GroupEditionPageComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
941
+ i0.ɵɵelement(0, "cauca-group-edition-form");
942
+ } }
943
+ function GroupEditionPageComponent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
944
+ i0.ɵɵelement(0, "div", 2)(1, "cauca-saving-error-box", 5);
945
+ } if (rf & 2) {
946
+ const ctx_r0 = i0.ɵɵnextContext();
947
+ i0.ɵɵadvance();
948
+ i0.ɵɵproperty("show", ctx_r0.showSavingError());
949
+ } }
950
+ class GroupEditionPageComponent {
951
+ constructor() {
952
+ this.id = input.required(...(ngDevMode ? [{ debugName: "id" }] : []));
953
+ this.isLoaded = signal(false, ...(ngDevMode ? [{ debugName: "isLoaded" }] : []));
954
+ this.isSaving = signal(false, ...(ngDevMode ? [{ debugName: "isSaving" }] : []));
955
+ this.showSavingError = signal(false, ...(ngDevMode ? [{ debugName: "showSavingError" }] : []));
956
+ this.title = computed(() => 'groupEdition.' + (this.id() === 'new' ? 'newGroupTitle' : 'editGroupTitle'), ...(ngDevMode ? [{ debugName: "title" }] : []));
957
+ this.currentLocation = computed(() => [{ link: this.groupsPath, title: 'menu.groups' }], ...(ngDevMode ? [{ debugName: "currentLocation" }] : []));
958
+ this.state = inject(GroupEditionStateService);
959
+ this.dialog = inject(DialogService);
960
+ this.router = inject(Router);
961
+ this.managementRouteSegment = inject(MANAGEMENT_ROUTE_SEGMENT, { optional: true });
962
+ this.groupsPath = this.buildGroupsPath();
963
+ this.isClosing = false;
964
+ }
965
+ ngOnInit() {
966
+ this.loadData();
967
+ }
968
+ async canDeactivate() {
969
+ return await this.canCancel();
970
+ }
971
+ async cancel() {
972
+ if (await this.canCancel()) {
973
+ this.isClosing = true;
974
+ await this.router.navigate([this.groupsPath]);
975
+ }
976
+ }
977
+ async save() {
978
+ try {
979
+ await this.tryToSave();
980
+ }
981
+ catch {
982
+ this.showSavingError.set(true);
983
+ }
984
+ finally {
985
+ this.resetSavingState();
986
+ }
987
+ }
988
+ async loadData() {
989
+ try {
990
+ await this.state.setGroup(this.id());
991
+ this.isLoaded.set(true);
992
+ }
993
+ catch (e) {
994
+ console.error(e);
995
+ this.isLoaded.set(false);
996
+ }
997
+ }
998
+ async onBeforeUnload(e) {
999
+ if (await this.canCancel()) {
1000
+ e.preventDefault();
1001
+ }
1002
+ }
1003
+ async tryToSave() {
1004
+ this.initializeSavingState();
1005
+ if (await this.state.saveData()) {
1006
+ this.isClosing = true;
1007
+ this.router.navigate([this.groupsPath]);
1008
+ }
1009
+ else {
1010
+ this.showValidationError();
1011
+ }
1012
+ }
1013
+ buildGroupsPath() {
1014
+ const defaultRouteSegment = 'management';
1015
+ const rawRouteSegment = this.managementRouteSegment?.trim();
1016
+ if (rawRouteSegment == null || rawRouteSegment === '') {
1017
+ return `/${defaultRouteSegment}/groups`;
1018
+ }
1019
+ const normalizedRouteSegment = rawRouteSegment
1020
+ .split('/')
1021
+ .map(segment => segment.trim())
1022
+ .find(segment => segment !== '') ?? defaultRouteSegment;
1023
+ return `/${normalizedRouteSegment}/groups`;
1024
+ }
1025
+ async canCancel() {
1026
+ return this.isClosing || !this.state.isDirty() || await this.askForCancelConfirmation() === ConfirmationResult.Yes;
1027
+ }
1028
+ initializeSavingState() {
1029
+ this.isSaving.set(true);
1030
+ this.showSavingError.set(false);
1031
+ }
1032
+ resetSavingState() {
1033
+ this.isSaving.set(false);
1034
+ this.state.form.enable();
1035
+ }
1036
+ async askForCancelConfirmation() {
1037
+ return await this.dialog.askForConfirmation('cancelEditionDialog.title', 'cancelEditionDialog.message');
1038
+ }
1039
+ showValidationError() {
1040
+ this.state.form.markAllAsTouched();
1041
+ this.dialog.showDialog('validationErrorDialog.title', 'validationErrorDialog.messageNext');
1042
+ }
1043
+ static { this.ɵfac = function GroupEditionPageComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GroupEditionPageComponent)(); }; }
1044
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GroupEditionPageComponent, selectors: [["cauca-group-edition-page"]], hostBindings: function GroupEditionPageComponent_HostBindings(rf, ctx) { if (rf & 1) {
1045
+ i0.ɵɵlistener("beforeunload", function GroupEditionPageComponent_beforeunload_HostBindingHandler($event) { return ctx.onBeforeUnload($event); }, i0.ɵɵresolveWindow);
1046
+ } }, inputs: { id: [1, "id"] }, features: [i0.ɵɵProvidersFeature([
1047
+ GroupEditionStateService,
1048
+ LoadingStateService,
1049
+ GroupManagementService,
1050
+ ])], decls: 11, vars: 8, consts: [["baseCrumb", "menu.management", 3, "caption", "breadcrumb", "location", "showBreadcrumb"], [3, "retryRequest"], [1, "spacer"], ["color", "primary", "label", "cancel", 1, "cancel-button", 3, "buttonClick", "isDisabled"], ["color", "primary", "label", "save", 1, "save-button", 3, "buttonClick", "isInProgress"], [3, "show"]], template: function GroupEditionPageComponent_Template(rf, ctx) { if (rf & 1) {
1051
+ i0.ɵɵelement(0, "cauca-page-title", 0);
1052
+ i0.ɵɵelementStart(1, "mat-card")(2, "mat-card-content");
1053
+ i0.ɵɵelement(3, "cauca-loading-spinner-indicator");
1054
+ i0.ɵɵelementStart(4, "cauca-loading-error", 1);
1055
+ i0.ɵɵlistener("retryRequest", function GroupEditionPageComponent_Template_cauca_loading_error_retryRequest_4_listener() { return ctx.loadData(); });
1056
+ i0.ɵɵelementEnd();
1057
+ i0.ɵɵconditionalCreate(5, GroupEditionPageComponent_Conditional_5_Template, 1, 0, "cauca-group-edition-form");
1058
+ i0.ɵɵconditionalCreate(6, GroupEditionPageComponent_Conditional_6_Template, 2, 1);
1059
+ i0.ɵɵelementEnd();
1060
+ i0.ɵɵelementStart(7, "mat-card-actions");
1061
+ i0.ɵɵelement(8, "div", 2);
1062
+ i0.ɵɵelementStart(9, "cauca-stroked-button", 3);
1063
+ i0.ɵɵlistener("buttonClick", function GroupEditionPageComponent_Template_cauca_stroked_button_buttonClick_9_listener() { return ctx.cancel(); });
1064
+ i0.ɵɵelementEnd();
1065
+ i0.ɵɵelementStart(10, "cauca-raised-button", 4);
1066
+ i0.ɵɵlistener("buttonClick", function GroupEditionPageComponent_Template_cauca_raised_button_buttonClick_10_listener() { return ctx.save(); });
1067
+ i0.ɵɵelementEnd()()();
1068
+ } if (rf & 2) {
1069
+ i0.ɵɵproperty("caption", ctx.title())("breadcrumb", ctx.title())("location", ctx.currentLocation())("showBreadcrumb", true);
1070
+ i0.ɵɵadvance(5);
1071
+ i0.ɵɵconditional(ctx.isLoaded() ? 5 : -1);
1072
+ i0.ɵɵadvance();
1073
+ i0.ɵɵconditional(ctx.showSavingError() ? 6 : -1);
1074
+ i0.ɵɵadvance(3);
1075
+ i0.ɵɵproperty("isDisabled", ctx.isSaving());
1076
+ i0.ɵɵadvance();
1077
+ i0.ɵɵproperty("isInProgress", ctx.isSaving());
1078
+ } }, dependencies: [PageTitleComponent, MatCardModule, i1.MatCard, i1.MatCardActions, i1.MatCardContent, LoadingSpinnerIndicatorComponent, LoadingErrorComponent, SavingErrorBoxComponent, StrokedButtonComponent, RaisedButtonComponent, GroupEditionFormComponent], styles: ["[_nghost-%COMP%]{width:100%}.spacer[_ngcontent-%COMP%]{flex:1 1 auto}mat-card-actions[_ngcontent-%COMP%]{gap:8px}"], changeDetection: 0 }); }
1079
+ }
1080
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GroupEditionPageComponent, [{
1081
+ type: Component,
1082
+ args: [{ selector: 'cauca-group-edition-page', changeDetection: ChangeDetectionStrategy.OnPush, imports: [PageTitleComponent, MatCardModule, LoadingSpinnerIndicatorComponent, LoadingErrorComponent, SavingErrorBoxComponent, StrokedButtonComponent, RaisedButtonComponent, GroupEditionFormComponent], providers: [
1083
+ GroupEditionStateService,
1084
+ LoadingStateService,
1085
+ GroupManagementService,
1086
+ ], template: "<cauca-page-title\n [caption]=\"title()\"\n baseCrumb=\"menu.management\"\n [breadcrumb]=\"title()\"\n [location]=\"currentLocation()\"\n [showBreadcrumb]=\"true\" />\n\n<mat-card>\n\n <mat-card-content>\n\n <cauca-loading-spinner-indicator />\n <cauca-loading-error (retryRequest)=\"loadData()\" />\n\n @if (isLoaded()) {\n <cauca-group-edition-form />\n }\n\n @if (showSavingError()) {\n <div class=\"spacer\"></div>\n <cauca-saving-error-box [show]=\"showSavingError()\" />\n }\n\n </mat-card-content>\n\n <mat-card-actions>\n <div class=\"spacer\"></div>\n <cauca-stroked-button class=\"cancel-button\" color=\"primary\" label=\"cancel\" [isDisabled]=\"isSaving()\" (buttonClick)=\"cancel()\" />\n <cauca-raised-button class=\"save-button\" color=\"primary\" label=\"save\" [isInProgress]=\"isSaving()\" (buttonClick)=\"save()\" />\n </mat-card-actions>\n\n</mat-card>\n", styles: [":host{width:100%}.spacer{flex:1 1 auto}mat-card-actions{gap:8px}\n"] }]
1087
+ }], null, { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], onBeforeUnload: [{
1088
+ type: HostListener,
1089
+ args: ['window:beforeunload', ['$event']]
1090
+ }] }); })();
1091
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(GroupEditionPageComponent, { className: "GroupEditionPageComponent", filePath: "lib/pages/group-edition-page/group-edition-page.component.ts", lineNumber: 22 }); })();
1092
+
1093
+ var groupEditionPage_component = /*#__PURE__*/Object.freeze({
1094
+ __proto__: null,
1095
+ GroupEditionPageComponent: GroupEditionPageComponent
1096
+ });
1097
+
20
1098
  class CaucaManagementService {
21
1099
  static { this.ɵfac = function CaucaManagementService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaucaManagementService)(); }; }
22
1100
  static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaucaManagementService, factory: CaucaManagementService.ɵfac, providedIn: 'root' }); }
@@ -38,7 +1116,7 @@ class CaucaManagementComponent {
38
1116
  } if (rf & 2) {
39
1117
  i0.ɵɵadvance();
40
1118
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "core.noGenericComponentOnThisLibrary"));
41
- } }, dependencies: [i1.TranslatePipe], encapsulation: 2 }); }
1119
+ } }, dependencies: [i1$3.TranslatePipe], encapsulation: 2 }); }
42
1120
  }
43
1121
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaManagementComponent, [{
44
1122
  type: Component,
@@ -46,6 +1124,9 @@ class CaucaManagementComponent {
46
1124
  }], null, null); })();
47
1125
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaucaManagementComponent, { className: "CaucaManagementComponent", filePath: "lib/cauca-management.component.ts", lineNumber: 9 }); })();
48
1126
 
1127
+ /**
1128
+ * @deprecated This service is obsolete and should not be used.
1129
+ */
49
1130
  class ManagementGroupService {
50
1131
  constructor() {
51
1132
  this.http = inject(HttpClient);
@@ -77,6 +1158,9 @@ class ManagementGroupService {
77
1158
  }]
78
1159
  }], null, null); })();
79
1160
 
1161
+ /**
1162
+ * @deprecated This service is obsolete and should not be used.
1163
+ */
80
1164
  class ManagementUserService {
81
1165
  constructor() {
82
1166
  this.http = inject(HttpClient);
@@ -123,6 +1207,9 @@ class ManagementUserService {
123
1207
  }]
124
1208
  }], null, null); })();
125
1209
 
1210
+ /**
1211
+ * @deprecated This service is obsolete and should not be used.
1212
+ */
126
1213
  class ManagementPermissionService {
127
1214
  constructor() {
128
1215
  this.http = inject(HttpClient);
@@ -183,6 +1270,9 @@ function CaucaManagementGroupComponent_div_21_Template(rf, ctx) { if (rf & 1) {
183
1270
  i0.ɵɵadvance();
184
1271
  i0.ɵɵproperty("dxTemplateOf", "rowTemplate");
185
1272
  } }
1273
+ /**
1274
+ * @deprecated This component is obsolete and should not be used.
1275
+ */
186
1276
  class CaucaManagementGroupComponent {
187
1277
  constructor() {
188
1278
  this.showPrintButton = true;
@@ -418,7 +1508,7 @@ class CaucaManagementGroupComponent {
418
1508
  i0.ɵɵproperty("dxTemplateOf", "usersEditTemplate");
419
1509
  i0.ɵɵadvance();
420
1510
  i0.ɵɵproperty("dxTemplateOf", "permissionsEditTemplate");
421
- } }, dependencies: [i1$1.DxCheckBoxComponent, i2.DxTemplateDirective, i3.DxListComponent, i4.DxiItemComponent, i5.DxTagBoxComponent, i6.CaucaDataGridComponent, i4.DxiColumnComponent, i4.DxiValidationRuleComponent, i4.DxoEditingComponent, i4.DxoFormComponent, i4.DxoPopupComponent, i4.DxoExportComponent, i1.TranslatePipe], encapsulation: 2 }); }
1511
+ } }, dependencies: [i1$4.DxCheckBoxComponent, i2$1.DxTemplateDirective, i3$2.DxListComponent, i4$2.DxiItemComponent, i5$1.DxTagBoxComponent, i6$1.CaucaDataGridComponent, i4$2.DxiColumnComponent, i4$2.DxiValidationRuleComponent, i4$2.DxoEditingComponent, i4$2.DxoFormComponent, i4$2.DxoPopupComponent, i4$2.DxoExportComponent, i1$3.TranslatePipe], encapsulation: 2 }); }
422
1512
  }
423
1513
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaManagementGroupComponent, [{
424
1514
  type: Component,
@@ -430,8 +1520,11 @@ class CaucaManagementGroupComponent {
430
1520
  }], showAssignableByAllUsers: [{
431
1521
  type: Input
432
1522
  }] }); })();
433
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaucaManagementGroupComponent, { className: "CaucaManagementGroupComponent", filePath: "lib/cauca-management-group/cauca-management-group.component.ts", lineNumber: 19 }); })();
1523
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaucaManagementGroupComponent, { className: "CaucaManagementGroupComponent", filePath: "lib/cauca-management-group/cauca-management-group.component.ts", lineNumber: 22 }); })();
434
1524
 
1525
+ /**
1526
+ * @deprecated This model is obsolete and should not be used.
1527
+ */
435
1528
  class UserModel {
436
1529
  constructor() {
437
1530
  this.userName = '';
@@ -444,6 +1537,9 @@ class UserModel {
444
1537
  }
445
1538
  }
446
1539
 
1540
+ /**
1541
+ * @deprecated This component is obsolete and should not be used.
1542
+ */
447
1543
  class CaucaManagementUserComponent {
448
1544
  constructor() {
449
1545
  this.users = [
@@ -525,13 +1621,13 @@ class CaucaManagementUserComponent {
525
1621
  i0.ɵɵproperty("labelLocation", ctx.showColumnXS ? "left" : "top");
526
1622
  i0.ɵɵadvance();
527
1623
  i0.ɵɵproperty("isRequired", true);
528
- } }, dependencies: [i4.DxiItemComponent, i6.CaucaDataGridComponent, i4.DxiColumnComponent, i4.DxiValidationRuleComponent, i4.DxoEditingComponent, i4.DxoFormComponent, i4.DxoPopupComponent, i1.TranslatePipe], encapsulation: 2 }); }
1624
+ } }, dependencies: [i4$2.DxiItemComponent, i6$1.CaucaDataGridComponent, i4$2.DxiColumnComponent, i4$2.DxiValidationRuleComponent, i4$2.DxoEditingComponent, i4$2.DxoFormComponent, i4$2.DxoPopupComponent, i1$3.TranslatePipe], encapsulation: 2 }); }
529
1625
  }
530
1626
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaucaManagementUserComponent, [{
531
1627
  type: Component,
532
1628
  args: [{ selector: 'cauca-management-user', standalone: false, template: "<cauca-dx-data-grid\n keyExpr=\"id\"\n [dataSource]=\"users\"\n (onRowInserted)=\"onRowInserted($event)\"\n (onRowUpdated)=\"onRowUpdated($event)\"\n (onRowRemoved)=\"onRowRemoved($event)\">\n\n <dxi-column dataField=\"userName\" [caption]=\"'management.userName' | translate\">\n <dxi-validation-rule type=\"async\" [message]=\"'management.userNameAlreadyUsed' | translate\" [validationCallback]=\"userNameAlreadyUsedValidation\"></dxi-validation-rule>\n </dxi-column>\n <dxi-column dataField=\"isActive\" [caption]=\"'management.isActive' | translate\" [visible]=\"false\"></dxi-column>\n <dxi-column dataField=\"firstName\" [caption]=\"'management.firstName' | translate\"></dxi-column>\n <dxi-column dataField=\"lastName\" [caption]=\"'management.lastName' | translate\"></dxi-column>\n <dxi-column dataField=\"groups\" [caption]=\"'management.group' | translate\"></dxi-column>\n\n <dxo-editing mode=\"popup\" [allowAdding]=\"true\" [allowUpdating]=\"true\" [allowDeleting]=\"true\" [useIcons]=\"true\">\n <dxo-popup [showTitle]=\"true\" [title]=\"'management.group' | translate\"></dxo-popup>\n <dxo-form colCount=\"2\" [labelLocation]=\"showColumnXS ? 'left' : 'top'\">\n <dxi-item dataField=\"userName\" [isRequired]=\"true\"></dxi-item>\n <dxi-item dataField=\"isActive\"></dxi-item>\n <dxi-item dataField=\"firstName\"></dxi-item>\n <dxi-item dataField=\"lastName\"></dxi-item>\n <dxi-item dataField=\"group\"></dxi-item>\n </dxo-form>\n </dxo-editing>\n</cauca-dx-data-grid>\n" }]
533
1629
  }], () => [], null); })();
534
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaucaManagementUserComponent, { className: "CaucaManagementUserComponent", filePath: "lib/cauca-management-user/cauca-management-user.component.ts", lineNumber: 13 }); })();
1630
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaucaManagementUserComponent, { className: "CaucaManagementUserComponent", filePath: "lib/cauca-management-user/cauca-management-user.component.ts", lineNumber: 17 }); })();
535
1631
 
536
1632
  class CaucaManagementModule {
537
1633
  static { this.ɵfac = function CaucaManagementModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaucaManagementModule)(); }; }
@@ -577,6 +1673,9 @@ class CaucaManagementModule {
577
1673
  CaucaManagementUserComponent,
578
1674
  CaucaManagementGroupComponent] }); })();
579
1675
 
1676
+ /**
1677
+ * @deprecated This model is obsolete and should not be used.
1678
+ */
580
1679
  class UserGroupModel {
581
1680
  constructor() {
582
1681
  this.idUserGroup = '';
@@ -585,6 +1684,9 @@ class UserGroupModel {
585
1684
  }
586
1685
  }
587
1686
 
1687
+ /**
1688
+ * @deprecated This model is obsolete and should not be used.
1689
+ */
588
1690
  class UserPermissionModel {
589
1691
  constructor() {
590
1692
  this.idUserPermission = '';
@@ -594,6 +1696,9 @@ class UserPermissionModel {
594
1696
  }
595
1697
  }
596
1698
 
1699
+ /**
1700
+ * @deprecated This model is obsolete and should not be used.
1701
+ */
597
1702
  class GroupModel {
598
1703
  constructor() {
599
1704
  this.name = '';
@@ -602,6 +1707,9 @@ class GroupModel {
602
1707
  }
603
1708
  }
604
1709
 
1710
+ /**
1711
+ * @deprecated This model is obsolete and should not be used.
1712
+ */
605
1713
  class GroupPermissionModel {
606
1714
  constructor() {
607
1715
  this.idGroupPermission = '';
@@ -619,5 +1727,5 @@ class GroupPermissionModel {
619
1727
  * Generated bundle index. Do not edit.
620
1728
  */
621
1729
 
622
- export { CaucaManagementComponent, CaucaManagementGroupComponent, CaucaManagementModule, CaucaManagementService, CaucaManagementUserComponent, GroupModel, GroupPermissionModel, ManagementGroupService, ManagementUserService, UserGroupModel, UserModel, UserPermissionModel };
1730
+ export { CaucaManagementComponent, CaucaManagementGroupComponent, CaucaManagementModule, CaucaManagementService, CaucaManagementUserComponent, GroupEditionPageComponent, GroupModel, GroupPermissionModel, GroupsPageComponent, MANAGEMENT_ROUTE_SEGMENT, MANAGEMENT_URL_PREFIX, ManagementGroupService, ManagementUserService, REFRESHABLE_PERMISSION_STATE_TOKEN, UserGroupModel, UserModel, UserPermissionModel, managementGroupRoutes, provideCaucaManagement };
623
1731
  //# sourceMappingURL=cauca-911-management.mjs.map