@cleavelandprice/ngx-lib 4.1.2 → 4.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.
- package/active-directory/material/components/user-chooser/user-chooser.component.d.ts +13 -14
- package/active-directory/material/components/user-form-field/user-form-field.component.d.ts +4 -4
- package/active-directory/material/model/selectable-group.d.ts +2 -2
- package/active-directory/material/model/user-chooser-data.d.ts +13 -12
- package/active-directory/material/model/user-chooser-filter-options.d.ts +7 -6
- package/active-directory/material/model/user-chooser-pre-processing-group.d.ts +5 -5
- package/esm2022/active-directory/material/components/user-chooser/user-chooser.component.mjs +45 -33
- package/esm2022/active-directory/material/components/user-form-field/user-form-field.component.mjs +28 -17
- package/esm2022/active-directory/material/model/selectable-group.mjs +1 -1
- package/esm2022/active-directory/material/model/user-chooser-data.mjs +12 -32
- package/esm2022/active-directory/material/model/user-chooser-filter-options.mjs +9 -10
- package/esm2022/active-directory/material/model/user-chooser-pre-processing-group.mjs +3 -9
- package/fesm2022/cleavelandprice-ngx-lib-active-directory-material.mjs +89 -93
- package/fesm2022/cleavelandprice-ngx-lib-active-directory-material.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -19,15 +19,14 @@ import { MatTooltip, MatTooltipModule } from '@angular/material/tooltip';
|
|
|
19
19
|
import { MatProgressBar, MatProgressBarModule } from '@angular/material/progress-bar';
|
|
20
20
|
import { CommonModule } from '@angular/common';
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
22
|
+
;
|
|
23
|
+
const DefaultUserChooserFilterOptions = {
|
|
24
|
+
accountName: true,
|
|
25
|
+
department: true,
|
|
26
|
+
groupMembership: false,
|
|
27
|
+
phoneNumber: true,
|
|
28
|
+
title: true
|
|
29
|
+
};
|
|
31
30
|
|
|
32
31
|
var UserChooserMode;
|
|
33
32
|
(function (UserChooserMode) {
|
|
@@ -35,44 +34,18 @@ var UserChooserMode;
|
|
|
35
34
|
UserChooserMode[UserChooserMode["Multiple"] = 1] = "Multiple";
|
|
36
35
|
})(UserChooserMode || (UserChooserMode = {}));
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
const DefaultUserChooserData = {
|
|
38
|
+
closeWhenSelectionMade: false,
|
|
39
|
+
includeDisabledUsers: false,
|
|
40
|
+
returnUserObjects: false,
|
|
41
|
+
showGroupMembershipTooltips: false,
|
|
42
|
+
showPhone: true,
|
|
43
|
+
title: 'Select User(s)',
|
|
44
|
+
mode: UserChooserMode.Single,
|
|
45
|
+
filterOptions: DefaultUserChooserFilterOptions
|
|
46
|
+
};
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
constructor() {
|
|
49
|
-
// Should the dialog close automatically when the user chooses an item?
|
|
50
|
-
// Applies to single-user mode only
|
|
51
|
-
this.closeWhenSelectionMade = false;
|
|
52
|
-
// If the component is tasked with pulling Active Directory users (default setting),
|
|
53
|
-
// should that include disabled users?
|
|
54
|
-
this.includeDisabledUsers = false;
|
|
55
|
-
// If true, the component will return an array of Active Directory User objects.
|
|
56
|
-
// If false (default), the component will return an array of user account names.
|
|
57
|
-
this.returnUserObjects = false;
|
|
58
|
-
// Should the dialog include hover tooptips for each user that displays their group membership
|
|
59
|
-
// You probably don't want this, which is why the default is false
|
|
60
|
-
this.showGroupMembershipTooltips = false;
|
|
61
|
-
// Should the user phone number be displayed next to their name in the dialog
|
|
62
|
-
this.showPhone = true;
|
|
63
|
-
// Title displayed in the dialog
|
|
64
|
-
this.title = 'Select User(s)';
|
|
65
|
-
// Single or Multi mode
|
|
66
|
-
this.mode = UserChooserMode.Single;
|
|
67
|
-
// As the user types into the filter field, the list of users is filtered.
|
|
68
|
-
// The filterOptions determine which user properties are taken into consideration for that filter.
|
|
69
|
-
// Note, displayName is always included (hard-coded), and is therefore not a filter option.
|
|
70
|
-
this.filterOptions = new UserChooserFilterOptions();
|
|
71
|
-
this.exclusions = new UserChooserPreProcessingGroup();
|
|
72
|
-
this.inclusions = new UserChooserPreProcessingGroup();
|
|
73
|
-
this.preSelections = new UserChooserPreProcessingGroup();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
48
|
+
;
|
|
76
49
|
|
|
77
50
|
class UserChooserComponent {
|
|
78
51
|
constructor() {
|
|
@@ -82,7 +55,7 @@ class UserChooserComponent {
|
|
|
82
55
|
sharePoint: inject(SharePointService),
|
|
83
56
|
data: inject(MAT_DIALOG_DATA)
|
|
84
57
|
};
|
|
85
|
-
this._data = { ...
|
|
58
|
+
this._data = { ...DefaultUserChooserData, ...this.#services.data };
|
|
86
59
|
//#region Fields
|
|
87
60
|
//@ViewChild(MatSelectionList) selectionList?: MatSelectionList;
|
|
88
61
|
this.selectionList = viewChild(MatSelectionList);
|
|
@@ -115,10 +88,10 @@ class UserChooserComponent {
|
|
|
115
88
|
get adGroupsNeeded() {
|
|
116
89
|
// If any are these are true, then we need to pull AD groups for use later
|
|
117
90
|
return this._data.showGroupMembershipTooltips ||
|
|
118
|
-
this._data.exclusions
|
|
119
|
-
this._data.inclusions
|
|
120
|
-
this._data.preSelections
|
|
121
|
-
this._data.filterOptions
|
|
91
|
+
(this._data.exclusions?.groups?.length ?? 0) > 0 ||
|
|
92
|
+
(this._data.inclusions?.groups?.length ?? 0) > 0 ||
|
|
93
|
+
(this._data.preSelections?.groups?.length ?? 0) > 0 ||
|
|
94
|
+
this._data.filterOptions?.groupMembership ||
|
|
122
95
|
(this._data.selectableGroupNames?.length ?? 0) > 0;
|
|
123
96
|
}
|
|
124
97
|
//#endregion
|
|
@@ -209,6 +182,7 @@ class UserChooserComponent {
|
|
|
209
182
|
users = this.#preSelectUsersByGroupName(users);
|
|
210
183
|
users = this.#preSelectUsersByDepartment(users);
|
|
211
184
|
users = this.#preSelectUsersByTitle(users);
|
|
185
|
+
this.#preSelectGroupsByAccountName();
|
|
212
186
|
const usersAndGroups = [
|
|
213
187
|
...users
|
|
214
188
|
];
|
|
@@ -219,7 +193,7 @@ class UserChooserComponent {
|
|
|
219
193
|
if (group) {
|
|
220
194
|
usersAndGroups.push({
|
|
221
195
|
...group,
|
|
222
|
-
selected:
|
|
196
|
+
selected: group.selected
|
|
223
197
|
});
|
|
224
198
|
}
|
|
225
199
|
});
|
|
@@ -251,8 +225,8 @@ class UserChooserComponent {
|
|
|
251
225
|
}
|
|
252
226
|
//#region Exclusions - won't be included in the dataSource at all
|
|
253
227
|
#excludeUsersByAccountName(users) {
|
|
254
|
-
this._data.exclusions
|
|
255
|
-
|
|
228
|
+
this._data.exclusions?.accountNames
|
|
229
|
+
?.forEach(accountName => {
|
|
256
230
|
const index = users.findIndex(u => u.sAMAccountName.toLowerCase() === accountName.toLowerCase());
|
|
257
231
|
if (index === -1) {
|
|
258
232
|
return;
|
|
@@ -262,8 +236,8 @@ class UserChooserComponent {
|
|
|
262
236
|
return users;
|
|
263
237
|
}
|
|
264
238
|
#excludeUsersByGroupName(users) {
|
|
265
|
-
this._data.exclusions
|
|
266
|
-
|
|
239
|
+
this._data.exclusions?.groups
|
|
240
|
+
?.forEach(groupName => {
|
|
267
241
|
const group = this.groups?.find(g => g.name.toLowerCase() === groupName.toLowerCase());
|
|
268
242
|
if (!group) {
|
|
269
243
|
return;
|
|
@@ -279,8 +253,8 @@ class UserChooserComponent {
|
|
|
279
253
|
return users;
|
|
280
254
|
}
|
|
281
255
|
#excludeUsersByDepartment(users) {
|
|
282
|
-
this._data.exclusions
|
|
283
|
-
|
|
256
|
+
this._data.exclusions?.departments
|
|
257
|
+
?.forEach(department => {
|
|
284
258
|
const excludedUsers = users.filter(u => u.department?.toLowerCase() === department.toLowerCase());
|
|
285
259
|
excludedUsers.forEach(user => {
|
|
286
260
|
const index = users.indexOf(user);
|
|
@@ -290,8 +264,8 @@ class UserChooserComponent {
|
|
|
290
264
|
return users;
|
|
291
265
|
}
|
|
292
266
|
#excludeUsersByTitle(users) {
|
|
293
|
-
this._data.exclusions
|
|
294
|
-
|
|
267
|
+
this._data.exclusions?.titles
|
|
268
|
+
?.forEach(title => {
|
|
295
269
|
const excludedUsers = users.filter(u => u.title?.toLowerCase() === title.toLowerCase());
|
|
296
270
|
excludedUsers.forEach(user => {
|
|
297
271
|
const index = users.indexOf(user);
|
|
@@ -303,19 +277,19 @@ class UserChooserComponent {
|
|
|
303
277
|
//#endregion
|
|
304
278
|
//#region Inclusions - only these will be included in the dataSource
|
|
305
279
|
#includeUsersByAccountName(users) {
|
|
306
|
-
return users.filter(user => this._data.inclusions
|
|
280
|
+
return users.filter(user => !this._data.inclusions?.accountNames?.length || // No account inclusions specified
|
|
307
281
|
this._data.inclusions.accountNames.find(accountName => accountName.toLowerCase() === user.sAMAccountName.toLowerCase()));
|
|
308
282
|
}
|
|
309
283
|
#includeUsersByDepartment(users) {
|
|
310
|
-
return users.filter(user => this._data.inclusions
|
|
284
|
+
return users.filter(user => !this._data.inclusions?.departments?.length || // No department inclusions specified
|
|
311
285
|
this._data.inclusions.departments.find(department => department.toLowerCase() === user.department?.toLowerCase()));
|
|
312
286
|
}
|
|
313
287
|
#includeUsersByTitle(users) {
|
|
314
|
-
return users.filter(user => this._data.inclusions
|
|
288
|
+
return users.filter(user => !this._data.inclusions?.titles?.length || // No title inclusions specified
|
|
315
289
|
this._data.inclusions.titles.find(title => title.toLowerCase() === user.title?.toLowerCase()));
|
|
316
290
|
}
|
|
317
291
|
#includeUsersByGroupName(users) {
|
|
318
|
-
if (!this._data.inclusions
|
|
292
|
+
if (!this._data.inclusions?.groups?.length) {
|
|
319
293
|
return users; // No group inclusions specified
|
|
320
294
|
}
|
|
321
295
|
// Cheating a bit and leveraging the 'selected' property to keep track of who should be included
|
|
@@ -339,8 +313,8 @@ class UserChooserComponent {
|
|
|
339
313
|
//#endregion
|
|
340
314
|
//#region Pre-Selections
|
|
341
315
|
#preSelectUsersByAccountName(users) {
|
|
342
|
-
this._data.preSelections
|
|
343
|
-
|
|
316
|
+
this._data.preSelections?.accountNames
|
|
317
|
+
?.forEach(accountName => {
|
|
344
318
|
const user = users.find(u => u.sAMAccountName.toLowerCase() === accountName.toLowerCase());
|
|
345
319
|
if (!user) {
|
|
346
320
|
return;
|
|
@@ -349,23 +323,34 @@ class UserChooserComponent {
|
|
|
349
323
|
});
|
|
350
324
|
return users;
|
|
351
325
|
}
|
|
326
|
+
#preSelectGroupsByAccountName() {
|
|
327
|
+
this._data.preSelections?.accountNames
|
|
328
|
+
?.forEach(accountName => {
|
|
329
|
+
const group = this.groups?.find(g => g.sAMAccountName.toLowerCase() === accountName.toLowerCase());
|
|
330
|
+
if (!group) {
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
group.selected = true;
|
|
334
|
+
});
|
|
335
|
+
;
|
|
336
|
+
}
|
|
352
337
|
#preSelectUsersByDepartment(users) {
|
|
353
|
-
this._data.preSelections
|
|
354
|
-
|
|
338
|
+
this._data.preSelections?.departments
|
|
339
|
+
?.forEach(department => users
|
|
355
340
|
.filter(u => u.department?.toLowerCase() === department.toLowerCase())
|
|
356
341
|
.forEach(user => user.selected = true));
|
|
357
342
|
return users;
|
|
358
343
|
}
|
|
359
344
|
#preSelectUsersByTitle(users) {
|
|
360
|
-
this._data.preSelections
|
|
361
|
-
|
|
345
|
+
this._data.preSelections?.titles
|
|
346
|
+
?.forEach(title => users
|
|
362
347
|
.filter(u => u.title?.toLowerCase() === title.toLowerCase())
|
|
363
348
|
.forEach(user => user.selected = true));
|
|
364
349
|
return users;
|
|
365
350
|
}
|
|
366
351
|
#preSelectUsersByGroupName(users) {
|
|
367
|
-
this._data.preSelections
|
|
368
|
-
|
|
352
|
+
this._data.preSelections?.groups
|
|
353
|
+
?.forEach(groupName => {
|
|
369
354
|
const group = this.groups?.find(g => g.name.toLowerCase() === groupName.toLowerCase());
|
|
370
355
|
if (!group) {
|
|
371
356
|
return;
|
|
@@ -393,16 +378,16 @@ class UserChooserComponent {
|
|
|
393
378
|
const regex = new RegExp(filter, 'i'); // Case-insensitive
|
|
394
379
|
let match = false; // The end result - whether or not a employee matches the filter
|
|
395
380
|
const filterProperties = ['displayName'];
|
|
396
|
-
if (this._data.filterOptions
|
|
381
|
+
if (this._data.filterOptions?.accountName) {
|
|
397
382
|
filterProperties.push('sAMAccountName');
|
|
398
383
|
}
|
|
399
|
-
if (this._data.filterOptions
|
|
384
|
+
if (this._data.filterOptions?.title) {
|
|
400
385
|
filterProperties.push('title');
|
|
401
386
|
}
|
|
402
|
-
if (this._data.filterOptions
|
|
387
|
+
if (this._data.filterOptions?.department) {
|
|
403
388
|
filterProperties.push('department');
|
|
404
389
|
}
|
|
405
|
-
if (this._data.filterOptions
|
|
390
|
+
if (this._data.filterOptions?.phoneNumber) {
|
|
406
391
|
filterProperties.push('telephoneNumber');
|
|
407
392
|
}
|
|
408
393
|
// Match on the properties configured above
|
|
@@ -414,7 +399,7 @@ class UserChooserComponent {
|
|
|
414
399
|
}
|
|
415
400
|
});
|
|
416
401
|
// Match on group membership (group name)
|
|
417
|
-
if (this._data.filterOptions
|
|
402
|
+
if (this._data.filterOptions?.groupMembership) {
|
|
418
403
|
user.memberOf.forEach(groupDn => {
|
|
419
404
|
const group = this.groups?.find(group => group.distinguishedName === groupDn && group.name.match(regex));
|
|
420
405
|
if (group) {
|
|
@@ -480,7 +465,6 @@ class UserFormFieldComponent {
|
|
|
480
465
|
this.placeholder = input('Select User(s)');
|
|
481
466
|
this.clickable = input(true);
|
|
482
467
|
this.userChooserData = input.required();
|
|
483
|
-
this.accountNames = [];
|
|
484
468
|
}
|
|
485
469
|
//#region Fields
|
|
486
470
|
#services;
|
|
@@ -493,11 +477,11 @@ class UserFormFieldComponent {
|
|
|
493
477
|
//#region Lifecycle
|
|
494
478
|
ngOnInit() {
|
|
495
479
|
this._userChooserData = {
|
|
496
|
-
...
|
|
480
|
+
...DefaultUserChooserData,
|
|
497
481
|
...this.userChooserData()
|
|
498
482
|
};
|
|
499
483
|
// If users have been pre-selected in the config, store those in accountNames, which drives the UI of this component
|
|
500
|
-
this.accountNames = this._userChooserData.preSelections
|
|
484
|
+
this.accountNames = this._userChooserData.preSelections?.accountNames;
|
|
501
485
|
this.#getData();
|
|
502
486
|
}
|
|
503
487
|
//#endregion
|
|
@@ -520,17 +504,21 @@ class UserFormFieldComponent {
|
|
|
520
504
|
return;
|
|
521
505
|
}
|
|
522
506
|
this.accountNames = Array.isArray(selected) ?
|
|
523
|
-
selected :
|
|
524
|
-
[selected];
|
|
507
|
+
selected.map(s => typeof (s) === 'string' ? s : s.sAMAccountName) :
|
|
508
|
+
[selected].map(s => typeof (s) === 'string' ? s : s.sAMAccountName);
|
|
525
509
|
// Overwrite what may have been passed in, for subsequent launches of UserChooserComponent - otherwise it just keeps getting fed stale data
|
|
526
|
-
this._userChooserData.preSelections
|
|
510
|
+
if (this._userChooserData.preSelections) {
|
|
511
|
+
this._userChooserData.preSelections.accountNames = this.accountNames;
|
|
512
|
+
}
|
|
527
513
|
this.usersSelected.emit(selected);
|
|
528
514
|
});
|
|
529
515
|
}
|
|
530
516
|
unSelectUser(accountName) {
|
|
531
|
-
const index = this.accountNames
|
|
532
|
-
this.accountNames
|
|
533
|
-
this._userChooserData.preSelections
|
|
517
|
+
const index = this.accountNames?.findIndex(a => a === accountName);
|
|
518
|
+
this.accountNames?.splice(index ?? -1, 1);
|
|
519
|
+
if (this._userChooserData.preSelections) {
|
|
520
|
+
this._userChooserData.preSelections.accountNames = this.accountNames;
|
|
521
|
+
}
|
|
534
522
|
this.userUnSelected.emit(accountName);
|
|
535
523
|
}
|
|
536
524
|
//#endregion
|
|
@@ -559,11 +547,19 @@ class UserFormFieldComponent {
|
|
|
559
547
|
this.photos = photos;
|
|
560
548
|
});
|
|
561
549
|
}
|
|
562
|
-
getUser(
|
|
563
|
-
|
|
550
|
+
getUser(user) {
|
|
551
|
+
user = typeof (user) === 'string' ?
|
|
552
|
+
this.users?.find(u => u.sAMAccountName.toLowerCase() === user?.toString().toLowerCase()) :
|
|
553
|
+
user;
|
|
554
|
+
return !user ? undefined :
|
|
555
|
+
'groupType' in user ? undefined : user;
|
|
564
556
|
}
|
|
565
|
-
getGroup(
|
|
566
|
-
|
|
557
|
+
getGroup(group) {
|
|
558
|
+
group = typeof (group) === 'string' ?
|
|
559
|
+
this.groups?.find(g => g.sAMAccountName.toLowerCase() === group?.toString().toLowerCase()) :
|
|
560
|
+
group;
|
|
561
|
+
return !group ? undefined :
|
|
562
|
+
'groupType' in group ? group : undefined;
|
|
567
563
|
}
|
|
568
564
|
getPhoto(accountName) {
|
|
569
565
|
const user = this.getUser(accountName);
|
|
@@ -576,7 +572,7 @@ class UserFormFieldComponent {
|
|
|
576
572
|
p.title?.toLowerCase() === user.displayName.toLowerCase())?.encodedAbsUrl;
|
|
577
573
|
}
|
|
578
574
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: UserFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
579
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.5", type: UserFormFieldComponent, isStandalone: true, selector: "cp-user-field", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, userChooserData: { classPropertyName: "userChooserData", publicName: "userChooserData", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { usersSelected: "usersSelected", userUnSelected: "userUnSelected" }, ngImport: i0, template: "\n<!-- In Microsoft Edge, selectUser() never gets called if the input fields are disabled\nSo... I'm dynamically setting the disabled property based on whether or not the browser is Edge.\nIt's definitely a better experience if the field IS disabled.\nOtherwise, it's confusing - especially because Edge is SO SLOW to display the resulting dialog window.\n-->\n<!-- Update 8/24/2023:\nThe above problem also exists in Chrome now.\nSo instead of dynamically setting [disabled] based on browser type,\nI'm applying CSS to suppress mouse events on the input - thus making it bubble up to the parent control, which responds the way we want/\n-->\n\n@if (users && photos) {\n <div (click)=\"selectUser()\" [class.clickable]=\"clickable()\">\n @if (accountNames
|
|
575
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.5", type: UserFormFieldComponent, isStandalone: true, selector: "cp-user-field", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, userChooserData: { classPropertyName: "userChooserData", publicName: "userChooserData", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { usersSelected: "usersSelected", userUnSelected: "userUnSelected" }, ngImport: i0, template: "\n<!-- In Microsoft Edge, selectUser() never gets called if the input fields are disabled\nSo... I'm dynamically setting the disabled property based on whether or not the browser is Edge.\nIt's definitely a better experience if the field IS disabled.\nOtherwise, it's confusing - especially because Edge is SO SLOW to display the resulting dialog window.\n-->\n<!-- Update 8/24/2023:\nThe above problem also exists in Chrome now.\nSo instead of dynamically setting [disabled] based on browser type,\nI'm applying CSS to suppress mouse events on the input - thus making it bubble up to the parent control, which responds the way we want/\n-->\n\n@if (users && photos) {\n <div (click)=\"selectUser()\" [class.clickable]=\"clickable()\">\n @if (accountNames?.length) {\n <div\n [class.grid]=\"accountNames?.length ?? 0 > 1\"\n [class.three]=\"accountNames?.length ?? 0 > 2\"\n [class.four]=\"accountNames?.length ?? 0 > 3\"\n [class.five]=\"accountNames?.length ?? 0 > 4\">\n @for (accountName of accountNames; track accountName; let i = $index) {\n <div class=\"user\">\n <!--<img *ngIf=\"accountName && empUtils.getEmployee(accountName)\" alt=\"\" [src]=\"empUtils.getEmployee(accountName) | employeePhotoUrl:cacheService.photos\">-->\n @if (getPhoto(accountName)) {\n <img matListItemAvatar alt=\"\" [src]=\"getPhoto(accountName)\">\n }\n @if (getGroup(accountName)) {\n <mat-icon>group</mat-icon>\n }\n <mat-form-field>\n <!-- [disabled]=\"!isEdge\" -->\n <input matInput disabled [placeholder]=\"i === 0 ? placeholder() : ''\"\n [value]=\"getUser(accountName)?.displayName ?? getGroup(accountName)?.displayName ?? accountName\">\n <button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"$event.stopPropagation(); unSelectUser(accountName)\">\n <mat-icon fontIcon=\"close\"/>\n </button>\n </mat-form-field>\n </div>\n }\n </div>\n } @else {\n <mat-form-field>\n <input matInput disabled [placeholder]=\"placeholder()\"> <!-- [disabled]=\"!isEdge\" -->\n </mat-form-field>\n }\n </div>\n} @else {\n <mat-progress-bar mode=\"indeterminate\"/>\n}", styles: [".user{display:grid;grid-template-columns:auto 1fr;grid-gap:.5em;align-items:center}.clickable,.clickable input{cursor:pointer!important}img{width:2em;height:2em;border-radius:100%}@media (min-width: 801px){.grid{display:grid;grid-template-columns:repeat(2,1fr);grid-gap:1em}.three{grid-template-columns:repeat(3,1fr)}.four{grid-template-columns:repeat(4,1fr)}.five{grid-template-columns:repeat(5,1fr)}::ng-deep .grid mat-form-field{width:15vw}}input[disabled]{pointer-events:none}\n"], dependencies: [{ kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] }); }
|
|
580
576
|
}
|
|
581
577
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: UserFormFieldComponent, decorators: [{
|
|
582
578
|
type: Component,
|
|
@@ -587,7 +583,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
|
|
|
587
583
|
MatIconButton,
|
|
588
584
|
MatInput,
|
|
589
585
|
MatProgressBar,
|
|
590
|
-
], template: "\n<!-- In Microsoft Edge, selectUser() never gets called if the input fields are disabled\nSo... I'm dynamically setting the disabled property based on whether or not the browser is Edge.\nIt's definitely a better experience if the field IS disabled.\nOtherwise, it's confusing - especially because Edge is SO SLOW to display the resulting dialog window.\n-->\n<!-- Update 8/24/2023:\nThe above problem also exists in Chrome now.\nSo instead of dynamically setting [disabled] based on browser type,\nI'm applying CSS to suppress mouse events on the input - thus making it bubble up to the parent control, which responds the way we want/\n-->\n\n@if (users && photos) {\n <div (click)=\"selectUser()\" [class.clickable]=\"clickable()\">\n @if (accountNames
|
|
586
|
+
], template: "\n<!-- In Microsoft Edge, selectUser() never gets called if the input fields are disabled\nSo... I'm dynamically setting the disabled property based on whether or not the browser is Edge.\nIt's definitely a better experience if the field IS disabled.\nOtherwise, it's confusing - especially because Edge is SO SLOW to display the resulting dialog window.\n-->\n<!-- Update 8/24/2023:\nThe above problem also exists in Chrome now.\nSo instead of dynamically setting [disabled] based on browser type,\nI'm applying CSS to suppress mouse events on the input - thus making it bubble up to the parent control, which responds the way we want/\n-->\n\n@if (users && photos) {\n <div (click)=\"selectUser()\" [class.clickable]=\"clickable()\">\n @if (accountNames?.length) {\n <div\n [class.grid]=\"accountNames?.length ?? 0 > 1\"\n [class.three]=\"accountNames?.length ?? 0 > 2\"\n [class.four]=\"accountNames?.length ?? 0 > 3\"\n [class.five]=\"accountNames?.length ?? 0 > 4\">\n @for (accountName of accountNames; track accountName; let i = $index) {\n <div class=\"user\">\n <!--<img *ngIf=\"accountName && empUtils.getEmployee(accountName)\" alt=\"\" [src]=\"empUtils.getEmployee(accountName) | employeePhotoUrl:cacheService.photos\">-->\n @if (getPhoto(accountName)) {\n <img matListItemAvatar alt=\"\" [src]=\"getPhoto(accountName)\">\n }\n @if (getGroup(accountName)) {\n <mat-icon>group</mat-icon>\n }\n <mat-form-field>\n <!-- [disabled]=\"!isEdge\" -->\n <input matInput disabled [placeholder]=\"i === 0 ? placeholder() : ''\"\n [value]=\"getUser(accountName)?.displayName ?? getGroup(accountName)?.displayName ?? accountName\">\n <button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"$event.stopPropagation(); unSelectUser(accountName)\">\n <mat-icon fontIcon=\"close\"/>\n </button>\n </mat-form-field>\n </div>\n }\n </div>\n } @else {\n <mat-form-field>\n <input matInput disabled [placeholder]=\"placeholder()\"> <!-- [disabled]=\"!isEdge\" -->\n </mat-form-field>\n }\n </div>\n} @else {\n <mat-progress-bar mode=\"indeterminate\"/>\n}", styles: [".user{display:grid;grid-template-columns:auto 1fr;grid-gap:.5em;align-items:center}.clickable,.clickable input{cursor:pointer!important}img{width:2em;height:2em;border-radius:100%}@media (min-width: 801px){.grid{display:grid;grid-template-columns:repeat(2,1fr);grid-gap:1em}.three{grid-template-columns:repeat(3,1fr)}.four{grid-template-columns:repeat(4,1fr)}.five{grid-template-columns:repeat(5,1fr)}::ng-deep .grid mat-form-field{width:15vw}}input[disabled]{pointer-events:none}\n"] }]
|
|
591
587
|
}] });
|
|
592
588
|
|
|
593
589
|
class MatActiveDirectoryModule {
|
|
@@ -676,5 +672,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
|
|
|
676
672
|
* Generated bundle index. Do not edit.
|
|
677
673
|
*/
|
|
678
674
|
|
|
679
|
-
export {
|
|
675
|
+
export { DefaultUserChooserData, DefaultUserChooserFilterOptions, MatActiveDirectoryModule, UserChooserComponent, UserChooserMode, UserFormFieldComponent };
|
|
680
676
|
//# sourceMappingURL=cleavelandprice-ngx-lib-active-directory-material.mjs.map
|