@cleavelandprice/ngx-lib 4.1.2 → 4.1.4

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.
@@ -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
- class UserChooserFilterOptions {
23
- constructor() {
24
- this.accountName = true;
25
- this.department = true;
26
- this.groupMembership = false;
27
- this.phoneNumber = true;
28
- this.title = true;
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
- class UserChooserPreProcessingGroup {
39
- constructor() {
40
- this.accountNames = [];
41
- this.departments = [];
42
- this.groups = [];
43
- this.titles = [];
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
- class UserChooserData {
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 = { ...new UserChooserData(), ...this.#services.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.groups.length > 0 ||
119
- this._data.inclusions.groups.length > 0 ||
120
- this._data.preSelections.groups.length > 0 ||
121
- this._data.filterOptions.groupMembership ||
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
@@ -194,7 +167,9 @@ class UserChooserComponent {
194
167
  //.subscribe(([users, photos]) => {
195
168
  .subscribe(data => {
196
169
  // Need groups in place before we handle exclusions/inclusions/pre-selections
197
- this.groups = this.adGroupsNeeded ? data[2] : null;
170
+ this.groups = this.adGroupsNeeded || this._data.groups?.length ?
171
+ data[2] :
172
+ null;
198
173
  let users = data[0];
199
174
  users.forEach(u => u.selected = false); // In case existing data was re-used
200
175
  users = this.#includeUsersByAccountName(users);
@@ -209,6 +184,7 @@ class UserChooserComponent {
209
184
  users = this.#preSelectUsersByGroupName(users);
210
185
  users = this.#preSelectUsersByDepartment(users);
211
186
  users = this.#preSelectUsersByTitle(users);
187
+ this.#preSelectGroupsByAccountName();
212
188
  const usersAndGroups = [
213
189
  ...users
214
190
  ];
@@ -219,7 +195,7 @@ class UserChooserComponent {
219
195
  if (group) {
220
196
  usersAndGroups.push({
221
197
  ...group,
222
- selected: false
198
+ selected: group.selected
223
199
  });
224
200
  }
225
201
  });
@@ -251,8 +227,8 @@ class UserChooserComponent {
251
227
  }
252
228
  //#region Exclusions - won't be included in the dataSource at all
253
229
  #excludeUsersByAccountName(users) {
254
- this._data.exclusions.accountNames
255
- .forEach(accountName => {
230
+ this._data.exclusions?.accountNames
231
+ ?.forEach(accountName => {
256
232
  const index = users.findIndex(u => u.sAMAccountName.toLowerCase() === accountName.toLowerCase());
257
233
  if (index === -1) {
258
234
  return;
@@ -262,8 +238,8 @@ class UserChooserComponent {
262
238
  return users;
263
239
  }
264
240
  #excludeUsersByGroupName(users) {
265
- this._data.exclusions.groups
266
- .forEach(groupName => {
241
+ this._data.exclusions?.groups
242
+ ?.forEach(groupName => {
267
243
  const group = this.groups?.find(g => g.name.toLowerCase() === groupName.toLowerCase());
268
244
  if (!group) {
269
245
  return;
@@ -279,8 +255,8 @@ class UserChooserComponent {
279
255
  return users;
280
256
  }
281
257
  #excludeUsersByDepartment(users) {
282
- this._data.exclusions.departments
283
- .forEach(department => {
258
+ this._data.exclusions?.departments
259
+ ?.forEach(department => {
284
260
  const excludedUsers = users.filter(u => u.department?.toLowerCase() === department.toLowerCase());
285
261
  excludedUsers.forEach(user => {
286
262
  const index = users.indexOf(user);
@@ -290,8 +266,8 @@ class UserChooserComponent {
290
266
  return users;
291
267
  }
292
268
  #excludeUsersByTitle(users) {
293
- this._data.exclusions.titles
294
- .forEach(title => {
269
+ this._data.exclusions?.titles
270
+ ?.forEach(title => {
295
271
  const excludedUsers = users.filter(u => u.title?.toLowerCase() === title.toLowerCase());
296
272
  excludedUsers.forEach(user => {
297
273
  const index = users.indexOf(user);
@@ -303,19 +279,19 @@ class UserChooserComponent {
303
279
  //#endregion
304
280
  //#region Inclusions - only these will be included in the dataSource
305
281
  #includeUsersByAccountName(users) {
306
- return users.filter(user => this._data.inclusions.accountNames.length === 0 || // No account inclusions specified
282
+ return users.filter(user => !this._data.inclusions?.accountNames?.length || // No account inclusions specified
307
283
  this._data.inclusions.accountNames.find(accountName => accountName.toLowerCase() === user.sAMAccountName.toLowerCase()));
308
284
  }
309
285
  #includeUsersByDepartment(users) {
310
- return users.filter(user => this._data.inclusions.departments.length === 0 || // No department inclusions specified
286
+ return users.filter(user => !this._data.inclusions?.departments?.length || // No department inclusions specified
311
287
  this._data.inclusions.departments.find(department => department.toLowerCase() === user.department?.toLowerCase()));
312
288
  }
313
289
  #includeUsersByTitle(users) {
314
- return users.filter(user => this._data.inclusions.titles.length === 0 || // No title inclusions specified
290
+ return users.filter(user => !this._data.inclusions?.titles?.length || // No title inclusions specified
315
291
  this._data.inclusions.titles.find(title => title.toLowerCase() === user.title?.toLowerCase()));
316
292
  }
317
293
  #includeUsersByGroupName(users) {
318
- if (!this._data.inclusions.groups.length) {
294
+ if (!this._data.inclusions?.groups?.length) {
319
295
  return users; // No group inclusions specified
320
296
  }
321
297
  // Cheating a bit and leveraging the 'selected' property to keep track of who should be included
@@ -339,8 +315,8 @@ class UserChooserComponent {
339
315
  //#endregion
340
316
  //#region Pre-Selections
341
317
  #preSelectUsersByAccountName(users) {
342
- this._data.preSelections.accountNames
343
- .forEach(accountName => {
318
+ this._data.preSelections?.accountNames
319
+ ?.forEach(accountName => {
344
320
  const user = users.find(u => u.sAMAccountName.toLowerCase() === accountName.toLowerCase());
345
321
  if (!user) {
346
322
  return;
@@ -349,23 +325,34 @@ class UserChooserComponent {
349
325
  });
350
326
  return users;
351
327
  }
328
+ #preSelectGroupsByAccountName() {
329
+ this._data.preSelections?.accountNames
330
+ ?.forEach(accountName => {
331
+ const group = this.groups?.find(g => g.sAMAccountName.toLowerCase() === accountName.toLowerCase());
332
+ if (!group) {
333
+ return;
334
+ }
335
+ group.selected = true;
336
+ });
337
+ ;
338
+ }
352
339
  #preSelectUsersByDepartment(users) {
353
- this._data.preSelections.departments
354
- .forEach(department => users
340
+ this._data.preSelections?.departments
341
+ ?.forEach(department => users
355
342
  .filter(u => u.department?.toLowerCase() === department.toLowerCase())
356
343
  .forEach(user => user.selected = true));
357
344
  return users;
358
345
  }
359
346
  #preSelectUsersByTitle(users) {
360
- this._data.preSelections.titles
361
- .forEach(title => users
347
+ this._data.preSelections?.titles
348
+ ?.forEach(title => users
362
349
  .filter(u => u.title?.toLowerCase() === title.toLowerCase())
363
350
  .forEach(user => user.selected = true));
364
351
  return users;
365
352
  }
366
353
  #preSelectUsersByGroupName(users) {
367
- this._data.preSelections.groups
368
- .forEach(groupName => {
354
+ this._data.preSelections?.groups
355
+ ?.forEach(groupName => {
369
356
  const group = this.groups?.find(g => g.name.toLowerCase() === groupName.toLowerCase());
370
357
  if (!group) {
371
358
  return;
@@ -393,16 +380,16 @@ class UserChooserComponent {
393
380
  const regex = new RegExp(filter, 'i'); // Case-insensitive
394
381
  let match = false; // The end result - whether or not a employee matches the filter
395
382
  const filterProperties = ['displayName'];
396
- if (this._data.filterOptions.accountName) {
383
+ if (this._data.filterOptions?.accountName) {
397
384
  filterProperties.push('sAMAccountName');
398
385
  }
399
- if (this._data.filterOptions.title) {
386
+ if (this._data.filterOptions?.title) {
400
387
  filterProperties.push('title');
401
388
  }
402
- if (this._data.filterOptions.department) {
389
+ if (this._data.filterOptions?.department) {
403
390
  filterProperties.push('department');
404
391
  }
405
- if (this._data.filterOptions.phoneNumber) {
392
+ if (this._data.filterOptions?.phoneNumber) {
406
393
  filterProperties.push('telephoneNumber');
407
394
  }
408
395
  // Match on the properties configured above
@@ -414,7 +401,7 @@ class UserChooserComponent {
414
401
  }
415
402
  });
416
403
  // Match on group membership (group name)
417
- if (this._data.filterOptions.groupMembership) {
404
+ if (this._data.filterOptions?.groupMembership) {
418
405
  user.memberOf.forEach(groupDn => {
419
406
  const group = this.groups?.find(group => group.distinguishedName === groupDn && group.name.match(regex));
420
407
  if (group) {
@@ -480,7 +467,6 @@ class UserFormFieldComponent {
480
467
  this.placeholder = input('Select User(s)');
481
468
  this.clickable = input(true);
482
469
  this.userChooserData = input.required();
483
- this.accountNames = [];
484
470
  }
485
471
  //#region Fields
486
472
  #services;
@@ -493,11 +479,11 @@ class UserFormFieldComponent {
493
479
  //#region Lifecycle
494
480
  ngOnInit() {
495
481
  this._userChooserData = {
496
- ...new UserChooserData(),
482
+ ...DefaultUserChooserData,
497
483
  ...this.userChooserData()
498
484
  };
499
485
  // 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.accountNames;
486
+ this.accountNames = this._userChooserData.preSelections?.accountNames;
501
487
  this.#getData();
502
488
  }
503
489
  //#endregion
@@ -520,17 +506,21 @@ class UserFormFieldComponent {
520
506
  return;
521
507
  }
522
508
  this.accountNames = Array.isArray(selected) ?
523
- selected :
524
- [selected];
509
+ selected.map(s => typeof (s) === 'string' ? s : s.sAMAccountName) :
510
+ [selected].map(s => typeof (s) === 'string' ? s : s.sAMAccountName);
525
511
  // Overwrite what may have been passed in, for subsequent launches of UserChooserComponent - otherwise it just keeps getting fed stale data
526
- this._userChooserData.preSelections.accountNames = this.accountNames;
512
+ if (this._userChooserData.preSelections) {
513
+ this._userChooserData.preSelections.accountNames = this.accountNames;
514
+ }
527
515
  this.usersSelected.emit(selected);
528
516
  });
529
517
  }
530
518
  unSelectUser(accountName) {
531
- const index = this.accountNames.findIndex(a => a === accountName);
532
- this.accountNames.splice(index, 1);
533
- this._userChooserData.preSelections.accountNames = this.accountNames;
519
+ const index = this.accountNames?.findIndex(a => a === accountName);
520
+ this.accountNames?.splice(index ?? -1, 1);
521
+ if (this._userChooserData.preSelections) {
522
+ this._userChooserData.preSelections.accountNames = this.accountNames;
523
+ }
534
524
  this.userUnSelected.emit(accountName);
535
525
  }
536
526
  //#endregion
@@ -559,11 +549,19 @@ class UserFormFieldComponent {
559
549
  this.photos = photos;
560
550
  });
561
551
  }
562
- getUser(accountName) {
563
- return this.users?.find(u => u.sAMAccountName.toLowerCase() === accountName.toLowerCase());
552
+ getUser(user) {
553
+ user = typeof (user) === 'string' ?
554
+ this.users?.find(u => u.sAMAccountName.toLowerCase() === user?.toString().toLowerCase()) :
555
+ user;
556
+ return !user ? undefined :
557
+ 'groupType' in user ? undefined : user;
564
558
  }
565
- getGroup(accountName) {
566
- return this.groups?.find(g => g.sAMAccountName.toLowerCase() === accountName.toLowerCase());
559
+ getGroup(group) {
560
+ group = typeof (group) === 'string' ?
561
+ this.groups?.find(g => g.sAMAccountName.toLowerCase() === group?.toString().toLowerCase()) :
562
+ group;
563
+ return !group ? undefined :
564
+ 'groupType' in group ? group : undefined;
567
565
  }
568
566
  getPhoto(accountName) {
569
567
  const user = this.getUser(accountName);
@@ -576,7 +574,7 @@ class UserFormFieldComponent {
576
574
  p.title?.toLowerCase() === user.displayName.toLowerCase())?.encodedAbsUrl;
577
575
  }
578
576
  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.length) {\n <div\n [class.grid]=\"accountNames.length > 1\"\n [class.three]=\"accountNames.length > 2\"\n [class.four]=\"accountNames.length > 3\"\n [class.five]=\"accountNames.length > 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) ? getUser(accountName)?.displayName : getGroup(accountName) ? 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"] }] }); }
577
+ 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
578
  }
581
579
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: UserFormFieldComponent, decorators: [{
582
580
  type: Component,
@@ -587,7 +585,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
587
585
  MatIconButton,
588
586
  MatInput,
589
587
  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.length) {\n <div\n [class.grid]=\"accountNames.length > 1\"\n [class.three]=\"accountNames.length > 2\"\n [class.four]=\"accountNames.length > 3\"\n [class.five]=\"accountNames.length > 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) ? getUser(accountName)?.displayName : getGroup(accountName) ? 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"] }]
588
+ ], 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
589
  }] });
592
590
 
593
591
  class MatActiveDirectoryModule {
@@ -676,5 +674,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
676
674
  * Generated bundle index. Do not edit.
677
675
  */
678
676
 
679
- export { MatActiveDirectoryModule, UserChooserComponent, UserChooserData, UserChooserFilterOptions, UserChooserMode, UserChooserPreProcessingGroup, UserFormFieldComponent };
677
+ export { DefaultUserChooserData, DefaultUserChooserFilterOptions, MatActiveDirectoryModule, UserChooserComponent, UserChooserMode, UserFormFieldComponent };
680
678
  //# sourceMappingURL=cleavelandprice-ngx-lib-active-directory-material.mjs.map