@cleavelandprice/ngx-lib 4.8.13 → 4.8.14

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,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, Optional, Inject, Injectable, signal, ChangeDetectionStrategy, Component, input, SkipSelf, NgModule } from '@angular/core';
2
+ import { InjectionToken, inject, Optional, Inject, Injectable, signal, computed, afterNextRender, ChangeDetectionStrategy, Component, input, SkipSelf, NgModule } from '@angular/core';
3
3
  import { JwtHelperService } from '@auth0/angular-jwt';
4
4
  import { SharePointService } from '@cleavelandprice/ngx-lib/sharepoint';
5
5
  import { AuthenticationTokenService } from '@cleavelandprice/ngx-lib/authentication/token';
@@ -16,6 +16,7 @@ import { MatProgressSpinner, MatProgressSpinnerModule } from '@angular/material/
16
16
  import { MatSlideToggle, MatSlideToggleModule } from '@angular/material/slide-toggle';
17
17
  import * as i4 from '@angular/material/tooltip';
18
18
  import { MatTooltipModule } from '@angular/material/tooltip';
19
+ import { ActiveDirectoryService } from '@cleavelandprice/ngx-lib/active-directory';
19
20
  import { ConfirmationComponent } from '@cleavelandprice/ngx-lib/dialog';
20
21
  import { CommonModule } from '@angular/common';
21
22
  import { ReactiveFormsModule } from '@angular/forms';
@@ -98,18 +99,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
98
99
  }] }] });
99
100
 
100
101
  class LoginFormComponent {
102
+ #data;
103
+ #credentialsModel;
104
+ #formSchema;
101
105
  constructor() {
102
106
  this.#data = inject(MAT_DIALOG_DATA);
103
107
  this.services = {
104
108
  dialogRef: inject((MatDialogRef)),
105
109
  authentication: inject(MatAuthenticationService),
110
+ activeDirectory: inject(ActiveDirectoryService),
106
111
  };
107
- /*form = new FormGroup({
108
- username: new FormControl(null, [Validators.required]),
109
- password: new FormControl(null, [Validators.required]),
110
- adminGroup: new FormControl(),
111
- additionalInfo: new FormControl(),
112
- });*/
113
112
  this.showPassword = signal(false, /* @ts-ignore */
114
113
  ...(ngDevMode ? [{ debugName: "showPassword" }] : /* istanbul ignore next */ []));
115
114
  this.#credentialsModel = signal({
@@ -140,21 +139,64 @@ class LoginFormComponent {
140
139
  message: 'Username cannot contain spaces'
141
140
  };
142
141
  }
143
- /*if (!this.#services.data.usernameExists(username)) {
144
- return {
145
- kind: 'invalidUsername',
146
- message: 'User not found'
147
- };
148
- }*/
142
+ if (!this.user()) {
143
+ return {
144
+ kind: 'invalidUsername',
145
+ message: 'User not found'
146
+ };
147
+ }
149
148
  return null; // valid
150
149
  });
151
150
  //#endregion
152
151
  });
153
152
  this.form = form(this.#credentialsModel, (path) => apply(path, this.#formSchema));
153
+ this.users = signal([], /* @ts-ignore */
154
+ ...(ngDevMode ? [{ debugName: "users" }] : /* istanbul ignore next */ []));
155
+ this.gettingUsers = signal(false, /* @ts-ignore */
156
+ ...(ngDevMode ? [{ debugName: "gettingUsers" }] : /* istanbul ignore next */ []));
157
+ this.error = signal(null, /* @ts-ignore */
158
+ ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
159
+ this.user = computed(() => {
160
+ return this.form().value().username.trim() ?
161
+ this.users()
162
+ .find(u => u.sAMAccountName.toLowerCase() === this.form().value().username.toLowerCase() ||
163
+ u.employeeNumber === this.form().value().username ||
164
+ (u.mail &&
165
+ (u.mail.toLowerCase() ?? '') === this.form().value().username.toLowerCase())) :
166
+ undefined; // username is blank
167
+ }, /* @ts-ignore */
168
+ ...(ngDevMode ? [{ debugName: "user" }] : /* istanbul ignore next */ []));
169
+ this.userLabel = computed(() => {
170
+ const user = this.user();
171
+ return user?.department ?
172
+ // Valid user with a department
173
+ `<b>${user.displayName ?? user.sAMAccountName}</b>: ${user.department}` :
174
+ user ?
175
+ // Valid user, no department
176
+ (user.displayName ?? user.sAMAccountName) :
177
+ // No valid user
178
+ undefined;
179
+ }, /* @ts-ignore */
180
+ ...(ngDevMode ? [{ debugName: "userLabel" }] : /* istanbul ignore next */ []));
181
+ this.users.set(this.#data.users ?? []);
182
+ afterNextRender(() => {
183
+ if (!(this.users().length)) {
184
+ this.gettingUsers.set(true);
185
+ this.services.activeDirectory.getUsers(this.#data.additionalInfo ?? 'ngxLibLoginComponent')
186
+ .subscribe({
187
+ next: (users) => {
188
+ this.users.set(users);
189
+ this.gettingUsers.set(false);
190
+ },
191
+ error: (error) => {
192
+ console.log('Error while getting users', error);
193
+ this.error.set('Error while getting users');
194
+ this.gettingUsers.set(false);
195
+ }
196
+ });
197
+ }
198
+ });
154
199
  }
155
- #data;
156
- #credentialsModel;
157
- #formSchema;
158
200
  ngOnInit() {
159
201
  //this.form.get('adminGroup')?.setValue(this.#data.adminGroup);
160
202
  //this.form.get('additionalInfo')?.setValue(this.#data.additionalInfo);
@@ -168,7 +210,7 @@ class LoginFormComponent {
168
210
  this.authenticatedChangedSubscription.unsubscribe();
169
211
  }
170
212
  authenticate() {
171
- this.errorMessage = undefined;
213
+ this.error.set(null);
172
214
  //const { username, password, adminGroup, additionalInfo } = this.form.value;
173
215
  const { username, password } = this.form().value();
174
216
  this.services.authentication.login(username, password, this.#data.adminGroup, this.#data.additionalInfo);
@@ -180,7 +222,7 @@ class LoginFormComponent {
180
222
  }
181
223
  #errorHandler(err) {
182
224
  console.log('Authentication error', err);
183
- this.errorMessage = `${err.name}: ${err.statusText}`;
225
+ this.error.set(`${err.name}: ${err.statusText}`);
184
226
  }
185
227
  changeTokenStorageMode(checked) {
186
228
  const keyName = 'storeTokenInSession';
@@ -193,10 +235,13 @@ class LoginFormComponent {
193
235
  localStorage.setItem(keyName, 'true');
194
236
  }
195
237
  }
238
+ #usernameExists(username) {
239
+ return this.users()
240
+ .map(u => u.sAMAccountName.toLowerCase())
241
+ .some(u => u.toLowerCase() === username.toLowerCase());
242
+ }
196
243
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: LoginFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
197
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: LoginFormComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<h2 mat-dialog-title>\n @if (services.authentication.authenticating()) {\n <span>Authenticating...</span>\n } @else {\n <span>Login</span>\n }\n</h2>\n\n<mat-dialog-content>\n @if (services.authentication.authenticating()) {\n <div id=\"spinner\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\n </div>\n } @else if (errorMessage) {\n <div id=\"error\">\n {{ errorMessage }}\n </div>\n } @else {\n\n <form>\n <mat-form-field>\n <input matInput [formField]=\"form.username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\n </mat-form-field>\n\n <mat-form-field>\n <input matInput [formField]=\"form.password\"\n [type]=\"showPassword() ? 'text' : 'password'\"\n placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\n\n <mat-icon matSuffix \n [matTooltip]=\"showPassword() ? 'Hide password' : 'Show password'\"\n aria-label=\"Show password\"\n (pointerdown)=\"$event.preventDefault(); showPassword.set(true)\"\n (pointerup)=\"showPassword.set(false)\"\n (pointercancel)=\"showPassword.set(false)\"\n (pointerleave)=\"showPassword.set(false)\">\n {{ showPassword() ? 'visibility_off' : 'visibility' }}\n </mat-icon>\n </mat-form-field>\n\n @if (services.authentication.options.showRememberMeOption) {\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\n Remember me next time\n </mat-slide-toggle>\n }\n </form>\n }\n</mat-dialog-content>\n\n@if (!services.authentication.authenticating()) {\n <mat-dialog-actions>\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\n [disabled]=\"form().invalid()\">\n <mat-icon fontIcon=\"done\"/>\n <span>OK</span>\n </button>\n \n <button mat-raised-button (click)=\"services.dialogRef.close()\">\n <mat-icon fontIcon=\"close\"/>\n <span>Cancel</span>\n </button>\n </mat-dialog-actions>\n}", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}form{display:grid;gap:1rem}mat-dialog-actions{display:grid;justify-content:center;grid-template-columns:auto auto;gap:1rem}#error{color:red}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { 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", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "fullWidth", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type:
198
- //ReactiveFormsModule,
199
- FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
244
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: LoginFormComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<h2 mat-dialog-title>\n @if (services.authentication.authenticating()) {\n <span>Authenticating...</span>\n } @else {\n <span>Login</span>\n }\n</h2>\n\n<mat-dialog-content>\n @if (services.authentication.authenticating() || gettingUsers()) {\n <div id=\"spinner\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\n </div>\n } @else if (error()) {\n <div id=\"error\">\n {{ error() }}\n </div>\n } @else {\n\n <form>\n <mat-form-field>\n <input matInput [formField]=\"form.username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\n\n @if (form.username().value() && form.username().errors().length) {\n @for (error of form.username().errors(); track $index) {\n <mat-error>{{ error.message }}</mat-error>\n }\n }\n\n @if (userLabel()) {\n <mat-hint [innerHTML]=\"userLabel()\" />\n }\n </mat-form-field>\n\n <mat-form-field>\n <input matInput [formField]=\"form.password\"\n [type]=\"showPassword() ? 'text' : 'password'\"\n placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\n\n <mat-icon matSuffix \n [matTooltip]=\"showPassword() ? 'Hide password' : 'Show password'\"\n aria-label=\"Show password\"\n (pointerdown)=\"$event.preventDefault(); showPassword.set(true)\"\n (pointerup)=\"showPassword.set(false)\"\n (pointercancel)=\"showPassword.set(false)\"\n (pointerleave)=\"showPassword.set(false)\">\n {{ showPassword() ? 'visibility_off' : 'visibility' }}\n </mat-icon>\n </mat-form-field>\n\n @if (services.authentication.options.showRememberMeOption) {\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\n Remember me next time\n </mat-slide-toggle>\n }\n </form>\n }\n</mat-dialog-content>\n\n@if (!services.authentication.authenticating()) {\n <mat-dialog-actions>\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\n [disabled]=\"form().invalid()\">\n <mat-icon fontIcon=\"done\"/>\n <span>OK</span>\n </button>\n \n <button mat-raised-button (click)=\"services.dialogRef.close()\">\n <mat-icon fontIcon=\"close\"/>\n <span>Cancel</span>\n </button>\n </mat-dialog-actions>\n}", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}form{display:grid;gap:1rem}mat-form-field{width:500px}mat-dialog-actions{display:grid;justify-content:center;grid-template-columns:auto auto;gap:1rem}#error{color:red}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { 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", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "fullWidth", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
200
245
  }
201
246
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: LoginFormComponent, decorators: [{
202
247
  type: Component,
@@ -209,10 +254,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
209
254
  MatProgressSpinner,
210
255
  MatSlideToggle,
211
256
  MatTooltipModule,
212
- //ReactiveFormsModule,
213
257
  FormField
214
- ], standalone: true, changeDetection: ChangeDetectionStrategy.Eager, template: "<h2 mat-dialog-title>\n @if (services.authentication.authenticating()) {\n <span>Authenticating...</span>\n } @else {\n <span>Login</span>\n }\n</h2>\n\n<mat-dialog-content>\n @if (services.authentication.authenticating()) {\n <div id=\"spinner\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\n </div>\n } @else if (errorMessage) {\n <div id=\"error\">\n {{ errorMessage }}\n </div>\n } @else {\n\n <form>\n <mat-form-field>\n <input matInput [formField]=\"form.username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\n </mat-form-field>\n\n <mat-form-field>\n <input matInput [formField]=\"form.password\"\n [type]=\"showPassword() ? 'text' : 'password'\"\n placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\n\n <mat-icon matSuffix \n [matTooltip]=\"showPassword() ? 'Hide password' : 'Show password'\"\n aria-label=\"Show password\"\n (pointerdown)=\"$event.preventDefault(); showPassword.set(true)\"\n (pointerup)=\"showPassword.set(false)\"\n (pointercancel)=\"showPassword.set(false)\"\n (pointerleave)=\"showPassword.set(false)\">\n {{ showPassword() ? 'visibility_off' : 'visibility' }}\n </mat-icon>\n </mat-form-field>\n\n @if (services.authentication.options.showRememberMeOption) {\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\n Remember me next time\n </mat-slide-toggle>\n }\n </form>\n }\n</mat-dialog-content>\n\n@if (!services.authentication.authenticating()) {\n <mat-dialog-actions>\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\n [disabled]=\"form().invalid()\">\n <mat-icon fontIcon=\"done\"/>\n <span>OK</span>\n </button>\n \n <button mat-raised-button (click)=\"services.dialogRef.close()\">\n <mat-icon fontIcon=\"close\"/>\n <span>Cancel</span>\n </button>\n </mat-dialog-actions>\n}", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}form{display:grid;gap:1rem}mat-dialog-actions{display:grid;justify-content:center;grid-template-columns:auto auto;gap:1rem}#error{color:red}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"] }]
215
- }] });
258
+ ], standalone: true, changeDetection: ChangeDetectionStrategy.Eager, template: "<h2 mat-dialog-title>\n @if (services.authentication.authenticating()) {\n <span>Authenticating...</span>\n } @else {\n <span>Login</span>\n }\n</h2>\n\n<mat-dialog-content>\n @if (services.authentication.authenticating() || gettingUsers()) {\n <div id=\"spinner\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\n </div>\n } @else if (error()) {\n <div id=\"error\">\n {{ error() }}\n </div>\n } @else {\n\n <form>\n <mat-form-field>\n <input matInput [formField]=\"form.username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\n\n @if (form.username().value() && form.username().errors().length) {\n @for (error of form.username().errors(); track $index) {\n <mat-error>{{ error.message }}</mat-error>\n }\n }\n\n @if (userLabel()) {\n <mat-hint [innerHTML]=\"userLabel()\" />\n }\n </mat-form-field>\n\n <mat-form-field>\n <input matInput [formField]=\"form.password\"\n [type]=\"showPassword() ? 'text' : 'password'\"\n placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\n\n <mat-icon matSuffix \n [matTooltip]=\"showPassword() ? 'Hide password' : 'Show password'\"\n aria-label=\"Show password\"\n (pointerdown)=\"$event.preventDefault(); showPassword.set(true)\"\n (pointerup)=\"showPassword.set(false)\"\n (pointercancel)=\"showPassword.set(false)\"\n (pointerleave)=\"showPassword.set(false)\">\n {{ showPassword() ? 'visibility_off' : 'visibility' }}\n </mat-icon>\n </mat-form-field>\n\n @if (services.authentication.options.showRememberMeOption) {\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\n Remember me next time\n </mat-slide-toggle>\n }\n </form>\n }\n</mat-dialog-content>\n\n@if (!services.authentication.authenticating()) {\n <mat-dialog-actions>\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\n [disabled]=\"form().invalid()\">\n <mat-icon fontIcon=\"done\"/>\n <span>OK</span>\n </button>\n \n <button mat-raised-button (click)=\"services.dialogRef.close()\">\n <mat-icon fontIcon=\"close\"/>\n <span>Cancel</span>\n </button>\n </mat-dialog-actions>\n}", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}form{display:grid;gap:1rem}mat-form-field{width:500px}mat-dialog-actions{display:grid;justify-content:center;grid-template-columns:auto auto;gap:1rem}#error{color:red}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"] }]
259
+ }], ctorParameters: () => [] });
216
260
 
217
261
  class LoginComponent {
218
262
  constructor() {
@@ -227,6 +271,8 @@ class LoginComponent {
227
271
  ...(ngDevMode ? [undefined, { debugName: "adminGroup" }] : /* istanbul ignore next */ []));
228
272
  this.additionalInfo = input(/* @ts-ignore */
229
273
  ...(ngDevMode ? [undefined, { debugName: "additionalInfo" }] : /* istanbul ignore next */ []));
274
+ this.users = input([], /* @ts-ignore */
275
+ ...(ngDevMode ? [{ debugName: "users" }] : /* istanbul ignore next */ []));
230
276
  }
231
277
  #services;
232
278
  login() {
@@ -234,6 +280,7 @@ class LoginComponent {
234
280
  data: {
235
281
  adminGroup: this.adminGroup(),
236
282
  additionalInfo: this.additionalInfo(),
283
+ users: this.users()
237
284
  },
238
285
  });
239
286
  }
@@ -250,12 +297,12 @@ class LoginComponent {
250
297
  });
251
298
  }
252
299
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: LoginComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
253
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: LoginComponent, isStandalone: true, selector: "cp-login", inputs: { adminGroup: { classPropertyName: "adminGroup", publicName: "adminGroup", isSignal: true, isRequired: false, transformFunction: null }, additionalInfo: { classPropertyName: "additionalInfo", publicName: "additionalInfo", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div id=\"user-id\">\n <!-- Logged out -->\n <!-- Logged in -->\n @if (services.authentication.authenticated()) {\n <!-- With photo -->\n @if (services.authentication.authenticatedUser()?.photoUrl) {\n <img\n id=\"authenticated-user-image\"\n [src]=\"\n $safeNavigationMigration(\n services.authentication.authenticatedUser()?.photoUrl\n )\n \"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n />\n } @else {\n <!-- Without photo -->\n <mat-icon\n fontIcon=\"account_circle\"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n >\n </mat-icon>\n }\n <!-- Name -->\n <div id=\"user-name\">\n {{ services.authentication.authenticatedUser()?.displayName }}\n </div>\n } @else {\n <mat-icon fontIcon=\"account_circle\" matTooltip=\"Login\" (click)=\"login()\">\n </mat-icon>\n }\n</div>\n", styles: ["#user-id{display:flex;height:2em;padding:.3em;font-family:Verdana,Geneva,Tahoma,sans-serif}#user-id>div{display:flex;align-items:center;height:100%;margin-left:.75em;font-size:1.15em}mat-icon{font-size:2em!important;height:2em!important;width:2em!important}img{border-radius:100%;width:2em;height:2em}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
300
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: LoginComponent, isStandalone: true, selector: "cp-login", inputs: { adminGroup: { classPropertyName: "adminGroup", publicName: "adminGroup", isSignal: true, isRequired: false, transformFunction: null }, additionalInfo: { classPropertyName: "additionalInfo", publicName: "additionalInfo", isSignal: true, isRequired: false, transformFunction: null }, users: { classPropertyName: "users", publicName: "users", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div id=\"user-id\">\n <!-- Logged out -->\n <!-- Logged in -->\n @if (services.authentication.authenticated()) {\n <!-- With photo -->\n @if (services.authentication.authenticatedUser()?.photoUrl) {\n <img\n id=\"authenticated-user-image\"\n [src]=\"\n $safeNavigationMigration(\n services.authentication.authenticatedUser()?.photoUrl\n )\n \"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n />\n } @else {\n <!-- Without photo -->\n <mat-icon\n fontIcon=\"account_circle\"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n >\n </mat-icon>\n }\n <!-- Name -->\n <div id=\"user-name\">\n {{ services.authentication.authenticatedUser()?.displayName }}\n </div>\n } @else {\n <mat-icon fontIcon=\"account_circle\" matTooltip=\"Login\" (click)=\"login()\">\n </mat-icon>\n }\n</div>\n", styles: ["#user-id{display:flex;height:2em;padding:.3em;font-family:Verdana,Geneva,Tahoma,sans-serif}#user-id>div{display:flex;align-items:center;height:100%;margin-left:.75em;font-size:1.15em}mat-icon{font-size:2em!important;height:2em!important;width:2em!important}img{border-radius:100%;width:2em;height:2em}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
254
301
  }
255
302
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: LoginComponent, decorators: [{
256
303
  type: Component,
257
304
  args: [{ selector: 'cp-login', imports: [MatIcon], standalone: true, changeDetection: ChangeDetectionStrategy.Eager, template: "<div id=\"user-id\">\n <!-- Logged out -->\n <!-- Logged in -->\n @if (services.authentication.authenticated()) {\n <!-- With photo -->\n @if (services.authentication.authenticatedUser()?.photoUrl) {\n <img\n id=\"authenticated-user-image\"\n [src]=\"\n $safeNavigationMigration(\n services.authentication.authenticatedUser()?.photoUrl\n )\n \"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n />\n } @else {\n <!-- Without photo -->\n <mat-icon\n fontIcon=\"account_circle\"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n >\n </mat-icon>\n }\n <!-- Name -->\n <div id=\"user-name\">\n {{ services.authentication.authenticatedUser()?.displayName }}\n </div>\n } @else {\n <mat-icon fontIcon=\"account_circle\" matTooltip=\"Login\" (click)=\"login()\">\n </mat-icon>\n }\n</div>\n", styles: ["#user-id{display:flex;height:2em;padding:.3em;font-family:Verdana,Geneva,Tahoma,sans-serif}#user-id>div{display:flex;align-items:center;height:100%;margin-left:.75em;font-size:1.15em}mat-icon{font-size:2em!important;height:2em!important;width:2em!important}img{border-radius:100%;width:2em;height:2em}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"] }]
258
- }], propDecorators: { adminGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "adminGroup", required: false }] }], additionalInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "additionalInfo", required: false }] }] } });
305
+ }], propDecorators: { adminGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "adminGroup", required: false }] }], additionalInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "additionalInfo", required: false }] }], users: [{ type: i0.Input, args: [{ isSignal: true, alias: "users", required: false }] }] } });
259
306
 
260
307
  class MatAuthenticationModule {
261
308
  static forRoot(options) {
@@ -1 +1 @@
1
- {"version":3,"file":"cleavelandprice-ngx-lib-authentication-material.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/model/mat-authentication-service-options-token.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/services/mat-authentication.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login-form/login-form.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login-form/login-form.component.html","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login/login.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login/login.component.html","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/mat-authentication.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/cleavelandprice-ngx-lib-authentication-material.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { MatAuthenticationServiceOptions } from \"./mat-authentication-service-options\";\r\n\r\nexport const MatAuthenticationServiceOptionsToken = new InjectionToken<MatAuthenticationServiceOptions>('');","import { Inject, inject, Injectable, Optional } from '@angular/core';\r\nimport { JwtHelperService } from '@auth0/angular-jwt';\r\n\r\nimport { SharePointService } from '@cleavelandprice/ngx-lib/sharepoint';\r\n\r\nimport {\r\n AuthenticationToken,\r\n AuthenticationTokenService\r\n} from '@cleavelandprice/ngx-lib/authentication/token';\r\nimport { MatAuthenticationServiceOptions } from '../model/mat-authentication-service-options';\r\nimport { MatAuthenticationServiceOptionsToken } from '../model/mat-authentication-service-options-token';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class MatAuthenticationService extends AuthenticationTokenService {\r\n #sharePointService = inject(SharePointService);\r\n\r\n override options!: MatAuthenticationServiceOptions;\r\n\r\n //#region Lifecycle\r\n constructor(@Optional() @Inject(MatAuthenticationServiceOptionsToken) constructorOptions: MatAuthenticationServiceOptions) {\r\n super({...constructorOptions, deferTokenValidation: true});\r\n\r\n // When super() was called, the parent class defined the 'options' object with all of the other properties\r\n this.options = { ...this.options, ...constructorOptions };\r\n this.checkForExistingToken();\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n override validateUser(token: string): void {\r\n const jwtHelper = new JwtHelperService();\r\n const decoded = jwtHelper.decodeToken(token) as AuthenticationToken;\r\n\r\n if (jwtHelper.isTokenExpired(token)) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n this.authenticatedUser.set({\r\n accountName: decoded.winaccountname,\r\n admin: decoded.role === 'Admin',\r\n department: decoded.department,\r\n displayName: decoded.displayName,\r\n distinguishedName: decoded.distinguishedName,\r\n email: decoded.email,\r\n employeeNumber: decoded.employeeNumber,\r\n firstName: decoded.firstName,\r\n hireDate: decoded.hireDate,\r\n lastName: decoded.lastName,\r\n manager: decoded.manager,\r\n memberOf: decoded.memberOf,\r\n phone: decoded.phone,\r\n photoUrl: undefined,\r\n sid: decoded.sid,\r\n title: decoded.title,\r\n workShift: decoded.workShift\r\n });\r\n\r\n this.storage.setItem(this.options.tokenName!, token);\r\n\r\n this.#getPhoto();\r\n \r\n this.authenticated.set(true);\r\n this.authenticatedChanged.emit(this.authenticated());\r\n\r\n this.authenticating.set(false);\r\n this.authenticatingChanged.emit(this.authenticating());\r\n }\r\n\r\n #getPhoto(): void {\r\n this.#sharePointService.getPhotos()\r\n .subscribe(photos => {\r\n // The user may have been logged out by the time the photos came back\r\n if (!this.authenticatedUser()?.employeeNumber) {\r\n return;\r\n }\r\n\r\n const photo = this.authenticatedUser()!.employeeNumber && photos.find(pic => pic.employeeNumber === +this.authenticatedUser()!.employeeNumber!);\r\n\r\n if (photo) {\r\n this.authenticatedUser.update(current => ({\r\n ...current!,\r\n photoUrl: photo.encodedAbsUrl\r\n }));\r\n }\r\n });\r\n }\r\n //#endregion\r\n}","import { Component, inject, OnDestroy, OnInit, OutputRefSubscription, ChangeDetectionStrategy, signal } from '@angular/core';\n//import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';\nimport { apply, debounce, form, PathKind, required, schema, SchemaPathTree, validate, FormField } from '@angular/forms/signals';\nimport { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';\nimport { MatButton } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInput } from '@angular/material/input';\nimport { MatProgressSpinner } from '@angular/material/progress-spinner';\nimport { MatSlideToggle } from '@angular/material/slide-toggle';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { LoginFormData } from '../../model/login-form-data';\nimport { MatAuthenticationService } from '../../services/mat-authentication.service';\n\n@Component({\n templateUrl: './login-form.component.html',\n imports: [\n MatButton,\n MatDialogModule,\n MatFormFieldModule,\n MatIconModule,\n MatInput,\n MatProgressSpinner,\n MatSlideToggle,\n MatTooltipModule,\n //ReactiveFormsModule,\n FormField\n],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.Eager,\n styleUrls: [\n './login-form.component.scss',\n '../../../../../styles/mat-icon.scss',\n ],\n})\nexport class LoginFormComponent implements OnInit, OnDestroy {\n #data = inject<LoginFormData>(MAT_DIALOG_DATA);\n\n services = {\n dialogRef: inject(MatDialogRef<LoginFormComponent>),\n authentication: inject(MatAuthenticationService),\n };\n\n errorMessage?: string;\n authenticatedChangedSubscription!: OutputRefSubscription;\n authenticationErrorSubscription!: OutputRefSubscription;\n\n /*form = new FormGroup({\n username: new FormControl(null, [Validators.required]),\n password: new FormControl(null, [Validators.required]),\n adminGroup: new FormControl(),\n additionalInfo: new FormControl(),\n });*/\n\n showPassword = signal(false);\n\n #credentialsModel = signal<ICredentialsModel>({\n username: '',\n password: ''\n });\n\n #formSchema = schema((schemaPath: SchemaPathTree<ICredentialsModel, PathKind.Root>) => {\n required(schemaPath.username);\n required(schemaPath.password);\n\n debounce(schemaPath.username, 500);\n debounce(schemaPath.password, 500);\n\n //#region Custom Validation\n validate(schemaPath.username, ({ value, valueOf }) => {\n \n if (!this.form().dirty()) { return null; }\n\n const username = value();\n\n if (!username) {\n return { \n kind: 'required', \n message: 'Username is required' \n };\n }\n\n if (username.includes(' ')) {\n return { \n kind: 'noSpaces', \n message: 'Username cannot contain spaces' \n };\n }\n\n /*if (!this.#services.data.usernameExists(username)) {\n return { \n kind: 'invalidUsername', \n message: 'User not found' \n };\n }*/\n\n return null; // valid\n });\n //#endregion\n });\n\n form = form(this.#credentialsModel, (path) => apply(path, this.#formSchema));\n\n ngOnInit(): void {\n //this.form.get('adminGroup')?.setValue(this.#data.adminGroup);\n //this.form.get('additionalInfo')?.setValue(this.#data.additionalInfo);\n\n this.authenticatedChangedSubscription =\n this.services.authentication.authenticatedChanged.subscribe(\n this.#authChangedHandler.bind(this),\n );\n\n this.authenticationErrorSubscription =\n this.services.authentication.authenticationError.subscribe(\n this.#errorHandler.bind(this),\n );\n }\n\n ngOnDestroy(): void {\n this.authenticationErrorSubscription.unsubscribe();\n this.authenticatedChangedSubscription.unsubscribe();\n }\n\n authenticate() {\n this.errorMessage = undefined;\n \n //const { username, password, adminGroup, additionalInfo } = this.form.value;\n const { username, password } = this.form().value();\n\n this.services.authentication.login(\n username!,\n password!,\n this.#data.adminGroup,\n this.#data.additionalInfo,\n );\n }\n\n #authChangedHandler(authenticated: boolean): void {\n if (authenticated) {\n this.services.dialogRef.close();\n }\n }\n\n #errorHandler(err: any): void {\n console.log('Authentication error', err);\n this.errorMessage = `${err.name}: ${err.statusText}`;\n }\n\n changeTokenStorageMode(checked: boolean): void {\n const keyName = 'storeTokenInSession';\n\n if (checked) {\n if (localStorage.getItem(keyName)) {\n localStorage.removeItem(keyName);\n }\n } else {\n localStorage.setItem(keyName, 'true');\n }\n }\n}\n\ninterface ICredentialsModel {\n username: string;\n password: string;\n}","<h2 mat-dialog-title>\n @if (services.authentication.authenticating()) {\n <span>Authenticating...</span>\n } @else {\n <span>Login</span>\n }\n</h2>\n\n<mat-dialog-content>\n @if (services.authentication.authenticating()) {\n <div id=\"spinner\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\n </div>\n } @else if (errorMessage) {\n <div id=\"error\">\n {{ errorMessage }}\n </div>\n } @else {\n\n <form>\n <mat-form-field>\n <input matInput [formField]=\"form.username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\n </mat-form-field>\n\n <mat-form-field>\n <input matInput [formField]=\"form.password\"\n [type]=\"showPassword() ? 'text' : 'password'\"\n placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\n\n <mat-icon matSuffix \n [matTooltip]=\"showPassword() ? 'Hide password' : 'Show password'\"\n aria-label=\"Show password\"\n (pointerdown)=\"$event.preventDefault(); showPassword.set(true)\"\n (pointerup)=\"showPassword.set(false)\"\n (pointercancel)=\"showPassword.set(false)\"\n (pointerleave)=\"showPassword.set(false)\">\n {{ showPassword() ? 'visibility_off' : 'visibility' }}\n </mat-icon>\n </mat-form-field>\n\n @if (services.authentication.options.showRememberMeOption) {\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\n Remember me next time\n </mat-slide-toggle>\n }\n </form>\n }\n</mat-dialog-content>\n\n@if (!services.authentication.authenticating()) {\n <mat-dialog-actions>\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\n [disabled]=\"form().invalid()\">\n <mat-icon fontIcon=\"done\"/>\n <span>OK</span>\n </button>\n \n <button mat-raised-button (click)=\"services.dialogRef.close()\">\n <mat-icon fontIcon=\"close\"/>\n <span>Cancel</span>\n </button>\n </mat-dialog-actions>\n}","import {\n Component,\n inject,\n input,\n ChangeDetectionStrategy,\n} from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { ConfirmationComponent } from '@cleavelandprice/ngx-lib/dialog';\n\nimport { MatIcon } from '@angular/material/icon';\nimport { MatAuthenticationService } from '../../services/mat-authentication.service';\nimport { LoginFormComponent } from '../login-form/login-form.component';\n\n@Component({\n selector: 'cp-login',\n imports: [MatIcon],\n standalone: true,\n templateUrl: './login.component.html',\n changeDetection: ChangeDetectionStrategy.Eager,\n styleUrls: ['./login.component.scss', '../../../../../styles/mat-icon.scss'],\n})\nexport class LoginComponent {\n #services = {\n dialog: inject(MatDialog),\n };\n \n services = {\n authentication: inject(MatAuthenticationService),\n };\n //#endregion\n\n adminGroup = input<string>();\n additionalInfo = input<string>();\n\n login(): void {\n this.#services.dialog.open(LoginFormComponent, {\n data: {\n adminGroup: this.adminGroup(),\n additionalInfo: this.additionalInfo(),\n },\n });\n }\n\n confirmLogout(): void {\n this.#services.dialog\n .open(ConfirmationComponent, {\n data: { message: `Are you sure you want to logout?` },\n })\n .afterClosed()\n .subscribe((result) => {\n if (result) {\n this.services.authentication.logout();\n }\n });\n }\n}\n","<div id=\"user-id\">\n <!-- Logged out -->\n <!-- Logged in -->\n @if (services.authentication.authenticated()) {\n <!-- With photo -->\n @if (services.authentication.authenticatedUser()?.photoUrl) {\n <img\n id=\"authenticated-user-image\"\n [src]=\"\n $safeNavigationMigration(\n services.authentication.authenticatedUser()?.photoUrl\n )\n \"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n />\n } @else {\n <!-- Without photo -->\n <mat-icon\n fontIcon=\"account_circle\"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n >\n </mat-icon>\n }\n <!-- Name -->\n <div id=\"user-name\">\n {{ services.authentication.authenticatedUser()?.displayName }}\n </div>\n } @else {\n <mat-icon fontIcon=\"account_circle\" matTooltip=\"Login\" (click)=\"login()\">\n </mat-icon>\n }\n</div>\n","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { ReactiveFormsModule } from '@angular/forms';\r\n\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\r\n\r\nimport { MatAuthenticationServiceOptions } from './model/mat-authentication-service-options';\r\n\r\n\r\nimport { LoginFormComponent } from './components/login-form/login-form.component';\r\nimport { LoginComponent } from './components/login/login.component';\r\nimport { MatAuthenticationServiceOptionsToken } from './model/mat-authentication-service-options-token';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n \r\n MatButtonModule,\r\n MatDialogModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatProgressSpinnerModule,\r\n MatSlideToggleModule,\r\n\r\n LoginComponent,\r\n LoginFormComponent\r\n ],\r\n exports: [\r\n LoginComponent,\r\n LoginFormComponent\r\n ]\r\n})\r\nexport class MatAuthenticationModule {\r\n static forRoot(options: MatAuthenticationServiceOptions): ModuleWithProviders<MatAuthenticationModule> {\r\n return {\r\n ngModule: MatAuthenticationModule,\r\n providers: [\r\n {\r\n provide: MatAuthenticationServiceOptionsToken,\r\n useValue: options\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: MatAuthenticationModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'MatAuthenticationModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './mat-authentication.api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAGa,oCAAoC,GAAG,IAAI,cAAc,CAAkC,EAAE;;ACYpG,MAAO,wBAAyB,SAAQ,0BAA0B,CAAA;AACtE,IAAA,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,CAAC;;AAK9C,IAAA,WAAA,CAAsE,kBAAmD,EAAA;QACvH,KAAK,CAAC,EAAC,GAAG,kBAAkB,EAAE,oBAAoB,EAAE,IAAI,EAAC,CAAC;;AAG1D,QAAA,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,kBAAkB,EAAE;QACzD,IAAI,CAAC,qBAAqB,EAAE;IAC9B;;;AAIS,IAAA,YAAY,CAAC,KAAa,EAAA;AACjC,QAAA,MAAM,SAAS,GAAG,IAAI,gBAAgB,EAAE;QACxC,MAAM,OAAO,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAwB;AAEnE,QAAA,IAAI,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE;YACnC,IAAI,CAAC,MAAM,EAAE;YACb;QACF;AAEA,QAAA,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC;YACzB,W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A,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,YAnBhC,YAAY;YACZ,mBAAmB;YAEnB,eAAe;YACf,eAAe;YACf,kBAAkB;YAClB,aAAa;YACb,cAAc;YACd,wBAAwB;YACxB,oBAAoB;YAEpB,cAAc;YACd,kBAAkB,CAAA,EAAA,CAAA,CAAA;;2FAOT,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAtBnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBAEnB,eAAe;wBACf,eAAe;wBACf,kBAAkB;wBAClB,aAAa;wBACb,cAAc;wBACd,wBAAwB;wBACxB,oBAAoB;wBAEpB,cAAc;wBACd;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,cAAc;wBACd;AACD;AACF,iBAAA;;0BAcc;;0BAAY;;;ACtD3B;;AAEG;;;;"}
1
+ {"version":3,"file":"cleavelandprice-ngx-lib-authentication-material.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/model/mat-authentication-service-options-token.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/services/mat-authentication.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login-form/login-form.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login-form/login-form.component.html","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login/login.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login/login.component.html","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/mat-authentication.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/cleavelandprice-ngx-lib-authentication-material.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { MatAuthenticationServiceOptions } from \"./mat-authentication-service-options\";\r\n\r\nexport const MatAuthenticationServiceOptionsToken = new InjectionToken<MatAuthenticationServiceOptions>('');","import { Inject, inject, Injectable, Optional } from '@angular/core';\r\nimport { JwtHelperService } from '@auth0/angular-jwt';\r\n\r\nimport { SharePointService } from '@cleavelandprice/ngx-lib/sharepoint';\r\n\r\nimport {\r\n AuthenticationToken,\r\n AuthenticationTokenService\r\n} from '@cleavelandprice/ngx-lib/authentication/token';\r\nimport { MatAuthenticationServiceOptions } from '../model/mat-authentication-service-options';\r\nimport { MatAuthenticationServiceOptionsToken } from '../model/mat-authentication-service-options-token';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class MatAuthenticationService extends AuthenticationTokenService {\r\n #sharePointService = inject(SharePointService);\r\n\r\n override options!: MatAuthenticationServiceOptions;\r\n\r\n //#region Lifecycle\r\n constructor(@Optional() @Inject(MatAuthenticationServiceOptionsToken) constructorOptions: MatAuthenticationServiceOptions) {\r\n super({...constructorOptions, deferTokenValidation: true});\r\n\r\n // When super() was called, the parent class defined the 'options' object with all of the other properties\r\n this.options = { ...this.options, ...constructorOptions };\r\n this.checkForExistingToken();\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n override validateUser(token: string): void {\r\n const jwtHelper = new JwtHelperService();\r\n const decoded = jwtHelper.decodeToken(token) as AuthenticationToken;\r\n\r\n if (jwtHelper.isTokenExpired(token)) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n this.authenticatedUser.set({\r\n accountName: decoded.winaccountname,\r\n admin: decoded.role === 'Admin',\r\n department: decoded.department,\r\n displayName: decoded.displayName,\r\n distinguishedName: decoded.distinguishedName,\r\n email: decoded.email,\r\n employeeNumber: decoded.employeeNumber,\r\n firstName: decoded.firstName,\r\n hireDate: decoded.hireDate,\r\n lastName: decoded.lastName,\r\n manager: decoded.manager,\r\n memberOf: decoded.memberOf,\r\n phone: decoded.phone,\r\n photoUrl: undefined,\r\n sid: decoded.sid,\r\n title: decoded.title,\r\n workShift: decoded.workShift\r\n });\r\n\r\n this.storage.setItem(this.options.tokenName!, token);\r\n\r\n this.#getPhoto();\r\n \r\n this.authenticated.set(true);\r\n this.authenticatedChanged.emit(this.authenticated());\r\n\r\n this.authenticating.set(false);\r\n this.authenticatingChanged.emit(this.authenticating());\r\n }\r\n\r\n #getPhoto(): void {\r\n this.#sharePointService.getPhotos()\r\n .subscribe(photos => {\r\n // The user may have been logged out by the time the photos came back\r\n if (!this.authenticatedUser()?.employeeNumber) {\r\n return;\r\n }\r\n\r\n const photo = this.authenticatedUser()!.employeeNumber && photos.find(pic => pic.employeeNumber === +this.authenticatedUser()!.employeeNumber!);\r\n\r\n if (photo) {\r\n this.authenticatedUser.update(current => ({\r\n ...current!,\r\n photoUrl: photo.encodedAbsUrl\r\n }));\r\n }\r\n });\r\n }\r\n //#endregion\r\n}","import { Component, inject, OnDestroy, OnInit, OutputRefSubscription, ChangeDetectionStrategy, signal, afterNextRender, computed } from '@angular/core';\nimport { apply, debounce, form, PathKind, required, schema, SchemaPathTree, validate, FormField } from '@angular/forms/signals';\nimport { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';\nimport { MatButton } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInput } from '@angular/material/input';\nimport { MatProgressSpinner } from '@angular/material/progress-spinner';\nimport { MatSlideToggle } from '@angular/material/slide-toggle';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\nimport { CleavelandPriceUser, ActiveDirectoryService } from '@cleavelandprice/ngx-lib/active-directory';\n\nimport { LoginFormData } from '../../model/login-form-data';\nimport { MatAuthenticationService } from '../../services/mat-authentication.service';\n\n@Component({\n templateUrl: './login-form.component.html',\n imports: [\n MatButton,\n MatDialogModule,\n MatFormFieldModule,\n MatIconModule,\n MatInput,\n MatProgressSpinner,\n MatSlideToggle,\n MatTooltipModule,\n FormField\n],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.Eager,\n styleUrls: [\n './login-form.component.scss',\n '../../../../../styles/mat-icon.scss',\n ],\n})\nexport class LoginFormComponent implements OnInit, OnDestroy {\n #data = inject<LoginFormData>(MAT_DIALOG_DATA);\n\n services = {\n dialogRef: inject(MatDialogRef<LoginFormComponent>),\n authentication: inject(MatAuthenticationService),\n activeDirectory: inject(ActiveDirectoryService),\n };\n\n authenticatedChangedSubscription!: OutputRefSubscription;\n authenticationErrorSubscription!: OutputRefSubscription;\n\n showPassword = signal(false);\n\n #credentialsModel = signal<ICredentialsModel>({\n username: '',\n password: ''\n });\n\n #formSchema = schema((schemaPath: SchemaPathTree<ICredentialsModel, PathKind.Root>) => {\n required(schemaPath.username);\n required(schemaPath.password);\n\n debounce(schemaPath.username, 500);\n debounce(schemaPath.password, 500);\n\n //#region Custom Validation\n validate(schemaPath.username, ({ value, valueOf }) => {\n \n if (!this.form().dirty()) { return null; }\n\n const username = value();\n\n if (!username) {\n return { \n kind: 'required', \n message: 'Username is required' \n };\n }\n\n if (username.includes(' ')) {\n return { \n kind: 'noSpaces', \n message: 'Username cannot contain spaces' \n };\n }\n\n if (!this.user()) {\n return { \n kind: 'invalidUsername', \n message: 'User not found' \n };\n }\n\n return null; // valid\n });\n //#endregion\n });\n\n form = form(this.#credentialsModel, (path) => apply(path, this.#formSchema));\n\n users = signal<CleavelandPriceUser[]>([]);\n gettingUsers = signal(false);\n error = signal<string | null>(null);\n\n constructor() {\n this.users.set(this.#data.users ?? []);\n\n afterNextRender(() => {\n if (!(this.users().length)) {\n this.gettingUsers.set(true);\n\n this.services.activeDirectory.getUsers(this.#data.additionalInfo ?? 'ngxLibLoginComponent')\n .subscribe({\n next: (users) => {\n this.users.set(users);\n this.gettingUsers.set(false);\n },\n error: (error) => {\n console.log('Error while getting users', error);\n this.error.set('Error while getting users');\n this.gettingUsers.set(false);\n }\n });\n }\n });\n }\n\n ngOnInit(): void {\n //this.form.get('adminGroup')?.setValue(this.#data.adminGroup);\n //this.form.get('additionalInfo')?.setValue(this.#data.additionalInfo);\n\n this.authenticatedChangedSubscription =\n this.services.authentication.authenticatedChanged.subscribe(\n this.#authChangedHandler.bind(this),\n );\n\n this.authenticationErrorSubscription =\n this.services.authentication.authenticationError.subscribe(\n this.#errorHandler.bind(this),\n );\n }\n\n ngOnDestroy(): void {\n this.authenticationErrorSubscription.unsubscribe();\n this.authenticatedChangedSubscription.unsubscribe();\n }\n\n authenticate() {\n this.error.set(null);\n \n //const { username, password, adminGroup, additionalInfo } = this.form.value;\n const { username, password } = this.form().value();\n\n this.services.authentication.login(\n username!,\n password!,\n this.#data.adminGroup,\n this.#data.additionalInfo,\n );\n }\n\n #authChangedHandler(authenticated: boolean): void {\n if (authenticated) {\n this.services.dialogRef.close();\n }\n }\n\n #errorHandler(err: any): void {\n console.log('Authentication error', err);\n this.error.set(`${err.name}: ${err.statusText}`);\n }\n\n changeTokenStorageMode(checked: boolean): void {\n const keyName = 'storeTokenInSession';\n\n if (checked) {\n if (localStorage.getItem(keyName)) {\n localStorage.removeItem(keyName);\n }\n } else {\n localStorage.setItem(keyName, 'true');\n }\n }\n\n #usernameExists(username: string): boolean {\n return this.users()\n .map(u => u.sAMAccountName.toLowerCase())\n .some(u => u.toLowerCase() === username.toLowerCase());\n }\n\n user = computed<CleavelandPriceUser | undefined>(() => {\n return this.form().value().username.trim() ?\n this.users()\n .find(u =>\n u.sAMAccountName.toLowerCase() === this.form().value().username.toLowerCase() ||\n u.employeeNumber === this.form().value().username ||\n (\n u.mail &&\n (u.mail.toLowerCase() ?? '') === this.form().value().username.toLowerCase()\n )\n ) :\n undefined; // username is blank\n });\n\n userLabel = computed<string | undefined>(() => {\n const user = this.user();\n \n return user?.department ?\n // Valid user with a department\n `<b>${user.displayName ?? user.sAMAccountName}</b>: ${user.department}` :\n user ?\n // Valid user, no department\n (user.displayName ?? user.sAMAccountName) :\n // No valid user\n undefined;\n });\n}\n\ninterface ICredentialsModel {\n username: string;\n password: string;\n}","<h2 mat-dialog-title>\n @if (services.authentication.authenticating()) {\n <span>Authenticating...</span>\n } @else {\n <span>Login</span>\n }\n</h2>\n\n<mat-dialog-content>\n @if (services.authentication.authenticating() || gettingUsers()) {\n <div id=\"spinner\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\n </div>\n } @else if (error()) {\n <div id=\"error\">\n {{ error() }}\n </div>\n } @else {\n\n <form>\n <mat-form-field>\n <input matInput [formField]=\"form.username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\n\n @if (form.username().value() && form.username().errors().length) {\n @for (error of form.username().errors(); track $index) {\n <mat-error>{{ error.message }}</mat-error>\n }\n }\n\n @if (userLabel()) {\n <mat-hint [innerHTML]=\"userLabel()\" />\n }\n </mat-form-field>\n\n <mat-form-field>\n <input matInput [formField]=\"form.password\"\n [type]=\"showPassword() ? 'text' : 'password'\"\n placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\n\n <mat-icon matSuffix \n [matTooltip]=\"showPassword() ? 'Hide password' : 'Show password'\"\n aria-label=\"Show password\"\n (pointerdown)=\"$event.preventDefault(); showPassword.set(true)\"\n (pointerup)=\"showPassword.set(false)\"\n (pointercancel)=\"showPassword.set(false)\"\n (pointerleave)=\"showPassword.set(false)\">\n {{ showPassword() ? 'visibility_off' : 'visibility' }}\n </mat-icon>\n </mat-form-field>\n\n @if (services.authentication.options.showRememberMeOption) {\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\n Remember me next time\n </mat-slide-toggle>\n }\n </form>\n }\n</mat-dialog-content>\n\n@if (!services.authentication.authenticating()) {\n <mat-dialog-actions>\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\n [disabled]=\"form().invalid()\">\n <mat-icon fontIcon=\"done\"/>\n <span>OK</span>\n </button>\n \n <button mat-raised-button (click)=\"services.dialogRef.close()\">\n <mat-icon fontIcon=\"close\"/>\n <span>Cancel</span>\n </button>\n </mat-dialog-actions>\n}","import { Component, inject, input, ChangeDetectionStrategy } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { MatIcon } from '@angular/material/icon';\n\nimport { ConfirmationComponent } from '@cleavelandprice/ngx-lib/dialog';\nimport { CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\n\nimport { MatAuthenticationService } from '../../services/mat-authentication.service';\nimport { LoginFormComponent } from '../login-form/login-form.component';\n\n@Component({\n selector: 'cp-login',\n imports: [MatIcon],\n standalone: true,\n templateUrl: './login.component.html',\n changeDetection: ChangeDetectionStrategy.Eager,\n styleUrls: ['./login.component.scss', '../../../../../styles/mat-icon.scss'],\n})\nexport class LoginComponent {\n #services = {\n dialog: inject(MatDialog),\n };\n \n services = {\n authentication: inject(MatAuthenticationService),\n };\n //#endregion\n\n adminGroup = input<string>();\n additionalInfo = input<string>();\n\n users = input<CleavelandPriceUser[]>([]);\n \n login(): void {\n this.#services.dialog.open(LoginFormComponent, {\n data: {\n adminGroup: this.adminGroup(),\n additionalInfo: this.additionalInfo(),\n users: this.users()\n },\n });\n }\n\n confirmLogout(): void {\n this.#services.dialog\n .open(ConfirmationComponent, {\n data: { message: `Are you sure you want to logout?` },\n })\n .afterClosed()\n .subscribe((result) => {\n if (result) {\n this.services.authentication.logout();\n }\n });\n }\n}\n","<div id=\"user-id\">\n <!-- Logged out -->\n <!-- Logged in -->\n @if (services.authentication.authenticated()) {\n <!-- With photo -->\n @if (services.authentication.authenticatedUser()?.photoUrl) {\n <img\n id=\"authenticated-user-image\"\n [src]=\"\n $safeNavigationMigration(\n services.authentication.authenticatedUser()?.photoUrl\n )\n \"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n />\n } @else {\n <!-- Without photo -->\n <mat-icon\n fontIcon=\"account_circle\"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\"\n >\n </mat-icon>\n }\n <!-- Name -->\n <div id=\"user-name\">\n {{ services.authentication.authenticatedUser()?.displayName }}\n </div>\n } @else {\n <mat-icon fontIcon=\"account_circle\" matTooltip=\"Login\" (click)=\"login()\">\n </mat-icon>\n }\n</div>\n","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { ReactiveFormsModule } from '@angular/forms';\r\n\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\r\n\r\nimport { MatAuthenticationServiceOptions } from './model/mat-authentication-service-options';\r\n\r\n\r\nimport { LoginFormComponent } from './components/login-form/login-form.component';\r\nimport { LoginComponent } from './components/login/login.component';\r\nimport { MatAuthenticationServiceOptionsToken } from './model/mat-authentication-service-options-token';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n \r\n MatButtonModule,\r\n MatDialogModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatProgressSpinnerModule,\r\n MatSlideToggleModule,\r\n\r\n LoginComponent,\r\n LoginFormComponent\r\n ],\r\n exports: [\r\n LoginComponent,\r\n LoginFormComponent\r\n ]\r\n})\r\nexport class MatAuthenticationModule {\r\n static forRoot(options: MatAuthenticationServiceOptions): ModuleWithProviders<MatAuthenticationModule> {\r\n return {\r\n ngModule: MatAuthenticationModule,\r\n providers: [\r\n {\r\n provide: MatAuthenticationServiceOptionsToken,\r\n useValue: options\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: MatAuthenticationModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'MatAuthenticationModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './mat-authentication.api';\n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E;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBAEnB,eAAe;wBACf,eAAe;wBACf,kBAAkB;wBAClB,aAAa;wBACb,cAAc;wBACd,wBAAwB;wBACxB,oBAAoB;wBAEpB,cAAc;wBACd;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,cAAc;wBACd;AACD;AACF,iBAAA;;0BAcc;;0BAAY;;;ACtD3B;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "comment": "NGX-LIB primary entry point package.json",
3
3
  "name": "@cleavelandprice/ngx-lib",
4
- "version": "4.8.13",
4
+ "version": "4.8.14",
5
5
  "description": "Angular library providing foundational functionality to Cleaveland-Price applications",
6
6
  "peerDependencies": {
7
7
  "@angular/common": "^22.1.1",
@@ -1,5 +1,6 @@
1
+ import { CleavelandPriceUser, ActiveDirectoryService } from '@cleavelandprice/ngx-lib/active-directory';
1
2
  import { AuthenticationTokenServiceOptions, AuthenticationTokenService } from '@cleavelandprice/ngx-lib/authentication/token';
2
- import * as i0 from '@angular/core';
3
+ import * as _angular_core from '@angular/core';
3
4
  import { InjectionToken, OnInit, OnDestroy, OutputRefSubscription, ModuleWithProviders } from '@angular/core';
4
5
  import * as _angular_forms_signals from '@angular/forms/signals';
5
6
  import * as i4 from '@angular/material/dialog';
@@ -16,6 +17,7 @@ import * as i9 from '@angular/material/slide-toggle';
16
17
  interface LoginFormData {
17
18
  adminGroup: string;
18
19
  additionalInfo: string;
20
+ users?: CleavelandPriceUser[];
19
21
  }
20
22
 
21
23
  interface MatAuthenticationServiceOptions extends AuthenticationTokenServiceOptions {
@@ -29,8 +31,8 @@ declare class MatAuthenticationService extends AuthenticationTokenService {
29
31
  options: MatAuthenticationServiceOptions;
30
32
  constructor(constructorOptions: MatAuthenticationServiceOptions);
31
33
  validateUser(token: string): void;
32
- static ɵfac: i0.ɵɵFactoryDeclaration<MatAuthenticationService, [{ optional: true; }]>;
33
- static ɵprov: i0.ɵɵInjectableDeclaration<MatAuthenticationService>;
34
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MatAuthenticationService, [{ optional: true; }]>;
35
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<MatAuthenticationService>;
34
36
  }
35
37
 
36
38
  declare class LoginFormComponent implements OnInit, OnDestroy {
@@ -38,18 +40,24 @@ declare class LoginFormComponent implements OnInit, OnDestroy {
38
40
  services: {
39
41
  dialogRef: MatDialogRef<any, any>;
40
42
  authentication: MatAuthenticationService;
43
+ activeDirectory: ActiveDirectoryService;
41
44
  };
42
- errorMessage?: string;
43
45
  authenticatedChangedSubscription: OutputRefSubscription;
44
46
  authenticationErrorSubscription: OutputRefSubscription;
45
- showPassword: i0.WritableSignal<boolean>;
47
+ showPassword: _angular_core.WritableSignal<boolean>;
46
48
  form: _angular_forms_signals.FieldTree<ICredentialsModel, string | number, "writable">;
49
+ users: _angular_core.WritableSignal<CleavelandPriceUser[]>;
50
+ gettingUsers: _angular_core.WritableSignal<boolean>;
51
+ error: _angular_core.WritableSignal<string | null>;
52
+ constructor();
47
53
  ngOnInit(): void;
48
54
  ngOnDestroy(): void;
49
55
  authenticate(): void;
50
56
  changeTokenStorageMode(checked: boolean): void;
51
- static ɵfac: i0.ɵɵFactoryDeclaration<LoginFormComponent, never>;
52
- static ɵcmp: i0.ɵɵComponentDeclaration<LoginFormComponent, "ng-component", never, {}, {}, never, never, true, never>;
57
+ user: _angular_core.Signal<CleavelandPriceUser | undefined>;
58
+ userLabel: _angular_core.Signal<string | undefined>;
59
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<LoginFormComponent, never>;
60
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<LoginFormComponent, "ng-component", never, {}, {}, never, never, true, never>;
53
61
  }
54
62
  interface ICredentialsModel {
55
63
  username: string;
@@ -61,20 +69,21 @@ declare class LoginComponent {
61
69
  services: {
62
70
  authentication: MatAuthenticationService;
63
71
  };
64
- adminGroup: i0.InputSignal<string | undefined>;
65
- additionalInfo: i0.InputSignal<string | undefined>;
72
+ adminGroup: _angular_core.InputSignal<string | undefined>;
73
+ additionalInfo: _angular_core.InputSignal<string | undefined>;
74
+ users: _angular_core.InputSignal<CleavelandPriceUser[]>;
66
75
  login(): void;
67
76
  confirmLogout(): void;
68
- static ɵfac: i0.ɵɵFactoryDeclaration<LoginComponent, never>;
69
- static ɵcmp: i0.ɵɵComponentDeclaration<LoginComponent, "cp-login", never, { "adminGroup": { "alias": "adminGroup"; "required": false; "isSignal": true; }; "additionalInfo": { "alias": "additionalInfo"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
77
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<LoginComponent, never>;
78
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<LoginComponent, "cp-login", never, { "adminGroup": { "alias": "adminGroup"; "required": false; "isSignal": true; }; "additionalInfo": { "alias": "additionalInfo"; "required": false; "isSignal": true; }; "users": { "alias": "users"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
70
79
  }
71
80
 
72
81
  declare class MatAuthenticationModule {
73
82
  static forRoot(options: MatAuthenticationServiceOptions): ModuleWithProviders<MatAuthenticationModule>;
74
83
  constructor(parentModule: MatAuthenticationModule);
75
- static ɵfac: i0.ɵɵFactoryDeclaration<MatAuthenticationModule, [{ optional: true; skipSelf: true; }]>;
76
- static ɵmod: i0.ɵɵNgModuleDeclaration<MatAuthenticationModule, never, [typeof i1.CommonModule, typeof i2.ReactiveFormsModule, typeof i3.MatButtonModule, typeof i4.MatDialogModule, typeof i5.MatFormFieldModule, typeof i6.MatIconModule, typeof i7.MatInputModule, typeof i8.MatProgressSpinnerModule, typeof i9.MatSlideToggleModule, typeof LoginComponent, typeof LoginFormComponent], [typeof LoginComponent, typeof LoginFormComponent]>;
77
- static ɵinj: i0.ɵɵInjectorDeclaration<MatAuthenticationModule>;
84
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MatAuthenticationModule, [{ optional: true; skipSelf: true; }]>;
85
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<MatAuthenticationModule, never, [typeof i1.CommonModule, typeof i2.ReactiveFormsModule, typeof i3.MatButtonModule, typeof i4.MatDialogModule, typeof i5.MatFormFieldModule, typeof i6.MatIconModule, typeof i7.MatInputModule, typeof i8.MatProgressSpinnerModule, typeof i9.MatSlideToggleModule, typeof LoginComponent, typeof LoginFormComponent], [typeof LoginComponent, typeof LoginFormComponent]>;
86
+ static ɵinj: _angular_core.ɵɵInjectorDeclaration<MatAuthenticationModule>;
78
87
  }
79
88
 
80
89
  export { LoginComponent, LoginFormComponent, MatAuthenticationModule, MatAuthenticationService, MatAuthenticationServiceOptionsToken };