@cleavelandprice/ngx-lib 4.1.1 → 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.
@@ -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
@@ -140,6 +113,12 @@ class UserChooserComponent {
140
113
  const user = this.dataSource?.data
141
114
  .find(u => u.sAMAccountName.toLocaleLowerCase() === option.value.sAMAccountName.toLowerCase());
142
115
  if (user) {
116
+ // If we are in single user selection mode, deselect any existing selections first
117
+ if (!this.isMultiMode && option.selected) {
118
+ this.dataSource?.data
119
+ .filter(u => u.sAMAccountName.toLowerCase() !== option.value.sAMAccountName.toLowerCase())
120
+ .forEach(u => u.selected = false);
121
+ }
143
122
  user.selected = option.selected;
144
123
  }
145
124
  }
@@ -203,6 +182,7 @@ class UserChooserComponent {
203
182
  users = this.#preSelectUsersByGroupName(users);
204
183
  users = this.#preSelectUsersByDepartment(users);
205
184
  users = this.#preSelectUsersByTitle(users);
185
+ this.#preSelectGroupsByAccountName();
206
186
  const usersAndGroups = [
207
187
  ...users
208
188
  ];
@@ -213,7 +193,7 @@ class UserChooserComponent {
213
193
  if (group) {
214
194
  usersAndGroups.push({
215
195
  ...group,
216
- selected: false
196
+ selected: group.selected
217
197
  });
218
198
  }
219
199
  });
@@ -245,8 +225,8 @@ class UserChooserComponent {
245
225
  }
246
226
  //#region Exclusions - won't be included in the dataSource at all
247
227
  #excludeUsersByAccountName(users) {
248
- this._data.exclusions.accountNames
249
- .forEach(accountName => {
228
+ this._data.exclusions?.accountNames
229
+ ?.forEach(accountName => {
250
230
  const index = users.findIndex(u => u.sAMAccountName.toLowerCase() === accountName.toLowerCase());
251
231
  if (index === -1) {
252
232
  return;
@@ -256,8 +236,8 @@ class UserChooserComponent {
256
236
  return users;
257
237
  }
258
238
  #excludeUsersByGroupName(users) {
259
- this._data.exclusions.groups
260
- .forEach(groupName => {
239
+ this._data.exclusions?.groups
240
+ ?.forEach(groupName => {
261
241
  const group = this.groups?.find(g => g.name.toLowerCase() === groupName.toLowerCase());
262
242
  if (!group) {
263
243
  return;
@@ -273,8 +253,8 @@ class UserChooserComponent {
273
253
  return users;
274
254
  }
275
255
  #excludeUsersByDepartment(users) {
276
- this._data.exclusions.departments
277
- .forEach(department => {
256
+ this._data.exclusions?.departments
257
+ ?.forEach(department => {
278
258
  const excludedUsers = users.filter(u => u.department?.toLowerCase() === department.toLowerCase());
279
259
  excludedUsers.forEach(user => {
280
260
  const index = users.indexOf(user);
@@ -284,8 +264,8 @@ class UserChooserComponent {
284
264
  return users;
285
265
  }
286
266
  #excludeUsersByTitle(users) {
287
- this._data.exclusions.titles
288
- .forEach(title => {
267
+ this._data.exclusions?.titles
268
+ ?.forEach(title => {
289
269
  const excludedUsers = users.filter(u => u.title?.toLowerCase() === title.toLowerCase());
290
270
  excludedUsers.forEach(user => {
291
271
  const index = users.indexOf(user);
@@ -297,19 +277,19 @@ class UserChooserComponent {
297
277
  //#endregion
298
278
  //#region Inclusions - only these will be included in the dataSource
299
279
  #includeUsersByAccountName(users) {
300
- return users.filter(user => this._data.inclusions.accountNames.length === 0 || // No account inclusions specified
280
+ return users.filter(user => !this._data.inclusions?.accountNames?.length || // No account inclusions specified
301
281
  this._data.inclusions.accountNames.find(accountName => accountName.toLowerCase() === user.sAMAccountName.toLowerCase()));
302
282
  }
303
283
  #includeUsersByDepartment(users) {
304
- return users.filter(user => this._data.inclusions.departments.length === 0 || // No department inclusions specified
284
+ return users.filter(user => !this._data.inclusions?.departments?.length || // No department inclusions specified
305
285
  this._data.inclusions.departments.find(department => department.toLowerCase() === user.department?.toLowerCase()));
306
286
  }
307
287
  #includeUsersByTitle(users) {
308
- return users.filter(user => this._data.inclusions.titles.length === 0 || // No title inclusions specified
288
+ return users.filter(user => !this._data.inclusions?.titles?.length || // No title inclusions specified
309
289
  this._data.inclusions.titles.find(title => title.toLowerCase() === user.title?.toLowerCase()));
310
290
  }
311
291
  #includeUsersByGroupName(users) {
312
- if (!this._data.inclusions.groups.length) {
292
+ if (!this._data.inclusions?.groups?.length) {
313
293
  return users; // No group inclusions specified
314
294
  }
315
295
  // Cheating a bit and leveraging the 'selected' property to keep track of who should be included
@@ -333,8 +313,8 @@ class UserChooserComponent {
333
313
  //#endregion
334
314
  //#region Pre-Selections
335
315
  #preSelectUsersByAccountName(users) {
336
- this._data.preSelections.accountNames
337
- .forEach(accountName => {
316
+ this._data.preSelections?.accountNames
317
+ ?.forEach(accountName => {
338
318
  const user = users.find(u => u.sAMAccountName.toLowerCase() === accountName.toLowerCase());
339
319
  if (!user) {
340
320
  return;
@@ -343,23 +323,34 @@ class UserChooserComponent {
343
323
  });
344
324
  return users;
345
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
+ }
346
337
  #preSelectUsersByDepartment(users) {
347
- this._data.preSelections.departments
348
- .forEach(department => users
338
+ this._data.preSelections?.departments
339
+ ?.forEach(department => users
349
340
  .filter(u => u.department?.toLowerCase() === department.toLowerCase())
350
341
  .forEach(user => user.selected = true));
351
342
  return users;
352
343
  }
353
344
  #preSelectUsersByTitle(users) {
354
- this._data.preSelections.titles
355
- .forEach(title => users
345
+ this._data.preSelections?.titles
346
+ ?.forEach(title => users
356
347
  .filter(u => u.title?.toLowerCase() === title.toLowerCase())
357
348
  .forEach(user => user.selected = true));
358
349
  return users;
359
350
  }
360
351
  #preSelectUsersByGroupName(users) {
361
- this._data.preSelections.groups
362
- .forEach(groupName => {
352
+ this._data.preSelections?.groups
353
+ ?.forEach(groupName => {
363
354
  const group = this.groups?.find(g => g.name.toLowerCase() === groupName.toLowerCase());
364
355
  if (!group) {
365
356
  return;
@@ -387,16 +378,16 @@ class UserChooserComponent {
387
378
  const regex = new RegExp(filter, 'i'); // Case-insensitive
388
379
  let match = false; // The end result - whether or not a employee matches the filter
389
380
  const filterProperties = ['displayName'];
390
- if (this._data.filterOptions.accountName) {
381
+ if (this._data.filterOptions?.accountName) {
391
382
  filterProperties.push('sAMAccountName');
392
383
  }
393
- if (this._data.filterOptions.title) {
384
+ if (this._data.filterOptions?.title) {
394
385
  filterProperties.push('title');
395
386
  }
396
- if (this._data.filterOptions.department) {
387
+ if (this._data.filterOptions?.department) {
397
388
  filterProperties.push('department');
398
389
  }
399
- if (this._data.filterOptions.phoneNumber) {
390
+ if (this._data.filterOptions?.phoneNumber) {
400
391
  filterProperties.push('telephoneNumber');
401
392
  }
402
393
  // Match on the properties configured above
@@ -408,7 +399,7 @@ class UserChooserComponent {
408
399
  }
409
400
  });
410
401
  // Match on group membership (group name)
411
- if (this._data.filterOptions.groupMembership) {
402
+ if (this._data.filterOptions?.groupMembership) {
412
403
  user.memberOf.forEach(groupDn => {
413
404
  const group = this.groups?.find(group => group.distinguishedName === groupDn && group.name.match(regex));
414
405
  if (group) {
@@ -474,7 +465,6 @@ class UserFormFieldComponent {
474
465
  this.placeholder = input('Select User(s)');
475
466
  this.clickable = input(true);
476
467
  this.userChooserData = input.required();
477
- this.accountNames = [];
478
468
  }
479
469
  //#region Fields
480
470
  #services;
@@ -487,11 +477,11 @@ class UserFormFieldComponent {
487
477
  //#region Lifecycle
488
478
  ngOnInit() {
489
479
  this._userChooserData = {
490
- ...new UserChooserData(),
480
+ ...DefaultUserChooserData,
491
481
  ...this.userChooserData()
492
482
  };
493
483
  // If users have been pre-selected in the config, store those in accountNames, which drives the UI of this component
494
- this.accountNames = this._userChooserData.preSelections.accountNames;
484
+ this.accountNames = this._userChooserData.preSelections?.accountNames;
495
485
  this.#getData();
496
486
  }
497
487
  //#endregion
@@ -514,17 +504,21 @@ class UserFormFieldComponent {
514
504
  return;
515
505
  }
516
506
  this.accountNames = Array.isArray(selected) ?
517
- selected :
518
- [selected];
507
+ selected.map(s => typeof (s) === 'string' ? s : s.sAMAccountName) :
508
+ [selected].map(s => typeof (s) === 'string' ? s : s.sAMAccountName);
519
509
  // Overwrite what may have been passed in, for subsequent launches of UserChooserComponent - otherwise it just keeps getting fed stale data
520
- this._userChooserData.preSelections.accountNames = this.accountNames;
510
+ if (this._userChooserData.preSelections) {
511
+ this._userChooserData.preSelections.accountNames = this.accountNames;
512
+ }
521
513
  this.usersSelected.emit(selected);
522
514
  });
523
515
  }
524
516
  unSelectUser(accountName) {
525
- const index = this.accountNames.findIndex(a => a === accountName);
526
- this.accountNames.splice(index, 1);
527
- this._userChooserData.preSelections.accountNames = this.accountNames;
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
+ }
528
522
  this.userUnSelected.emit(accountName);
529
523
  }
530
524
  //#endregion
@@ -553,11 +547,19 @@ class UserFormFieldComponent {
553
547
  this.photos = photos;
554
548
  });
555
549
  }
556
- getUser(accountName) {
557
- return this.users?.find(u => u.sAMAccountName.toLowerCase() === accountName.toLowerCase());
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;
558
556
  }
559
- getGroup(accountName) {
560
- return this.groups?.find(g => g.sAMAccountName.toLowerCase() === accountName.toLowerCase());
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;
561
563
  }
562
564
  getPhoto(accountName) {
563
565
  const user = this.getUser(accountName);
@@ -570,7 +572,7 @@ class UserFormFieldComponent {
570
572
  p.title?.toLowerCase() === user.displayName.toLowerCase())?.encodedAbsUrl;
571
573
  }
572
574
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: UserFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
573
- 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"] }] }); }
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"] }] }); }
574
576
  }
575
577
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: UserFormFieldComponent, decorators: [{
576
578
  type: Component,
@@ -581,7 +583,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
581
583
  MatIconButton,
582
584
  MatInput,
583
585
  MatProgressBar,
584
- ], 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"] }]
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"] }]
585
587
  }] });
586
588
 
587
589
  class MatActiveDirectoryModule {
@@ -670,5 +672,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
670
672
  * Generated bundle index. Do not edit.
671
673
  */
672
674
 
673
- export { MatActiveDirectoryModule, UserChooserComponent, UserChooserData, UserChooserFilterOptions, UserChooserMode, UserChooserPreProcessingGroup, UserFormFieldComponent };
675
+ export { DefaultUserChooserData, DefaultUserChooserFilterOptions, MatActiveDirectoryModule, UserChooserComponent, UserChooserMode, UserFormFieldComponent };
674
676
  //# sourceMappingURL=cleavelandprice-ngx-lib-active-directory-material.mjs.map