@cleavelandprice/ngx-lib 4.8.3 → 4.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, EventEmitter, Output, Optional, Inject, Injectable, SkipSelf, NgModule } from '@angular/core';
2
+ import { InjectionToken, inject, signal, EventEmitter, Output, Optional, Inject, Injectable, SkipSelf, NgModule } from '@angular/core';
3
3
  import { HttpClient } from '@angular/common/http';
4
4
  import { JwtHelperService } from '@auth0/angular-jwt';
5
5
  import { NgxLibServiceBase } from '@cleavelandprice/ngx-lib';
@@ -27,8 +27,12 @@ class AuthenticationTokenService extends NgxLibServiceBase {
27
27
  this.options = options;
28
28
  //#region Fields
29
29
  this.#http = inject(HttpClient);
30
- this.authenticating = false; // Flag set to true while the service is attempting to authenticate the user
31
- this.authenticated = false; // Flag set to true when the user is successfully authenticated
30
+ this.authenticating = signal(false, /* @ts-ignore */
31
+ ...(ngDevMode ? [{ debugName: "authenticating" }] : /* istanbul ignore next */ [])); // Flag set to true while the service is attempting to authenticate the user
32
+ this.authenticated = signal(false, /* @ts-ignore */
33
+ ...(ngDevMode ? [{ debugName: "authenticated" }] : /* istanbul ignore next */ [])); // Flag set to true when the user is successfully authenticated
34
+ this.authenticatedUser = signal(undefined, /* @ts-ignore */
35
+ ...(ngDevMode ? [{ debugName: "authenticatedUser" }] : /* istanbul ignore next */ [])); // Object representing the authenticated user
32
36
  // error NG8110: Unsupported call to the output function. This function can only be used as the initializer of a property on a @Component or @Directive class.
33
37
  /*authenticatedChanged = output<boolean>();
34
38
  authenticatingChanged = output<boolean>();
@@ -57,8 +61,8 @@ class AuthenticationTokenService extends NgxLibServiceBase {
57
61
  additionalInfo,
58
62
  appName: this.options.appName
59
63
  };
60
- this.authenticating = true;
61
- this.authenticatingChanged.emit(this.authenticating);
64
+ this.authenticating.set(true);
65
+ this.authenticatingChanged.emit(this.authenticating());
62
66
  // Sending a 'raw' POST request so that we can tell HttpClient that we are expecting text instead of Json
63
67
  // Otherwise, it would throw an error trying to decode Json from the response
64
68
  this.#http.request('POST', `${this.apiUrl}${this.options.authenticationEndpoint}`, { body: request, responseType: 'text' })
@@ -72,8 +76,8 @@ class AuthenticationTokenService extends NgxLibServiceBase {
72
76
  }
73
77
  },
74
78
  error: (err) => {
75
- this.authenticating = false;
76
- this.authenticatingChanged.emit(this.authenticating);
79
+ this.authenticating.set(false);
80
+ this.authenticatingChanged.emit(this.authenticating());
77
81
  this.authenticationError.emit(err);
78
82
  }
79
83
  });
@@ -83,8 +87,8 @@ class AuthenticationTokenService extends NgxLibServiceBase {
83
87
  if (this.options.tokenName && this.storage.getItem(this.options.tokenName)) {
84
88
  this.storage.removeItem(this.options.tokenName);
85
89
  }
86
- this.authenticatedUser = undefined;
87
- this.authenticated = false;
90
+ this.authenticatedUser.set(undefined);
91
+ this.authenticated.set(false);
88
92
  this.authenticatedChanged.emit(false);
89
93
  }
90
94
  validateUser(token) {
@@ -94,7 +98,7 @@ class AuthenticationTokenService extends NgxLibServiceBase {
94
98
  this.logout();
95
99
  return;
96
100
  }
97
- this.authenticatedUser = {
101
+ this.authenticatedUser.set({
98
102
  admin: decoded.role === 'Admin',
99
103
  accountName: decoded.winaccountname,
100
104
  department: decoded.department,
@@ -110,14 +114,14 @@ class AuthenticationTokenService extends NgxLibServiceBase {
110
114
  sid: decoded.sid,
111
115
  title: decoded.title,
112
116
  workShift: decoded.workShift
113
- };
117
+ });
114
118
  if (this.options.tokenName) {
115
119
  this.storage.setItem(this.options.tokenName, token);
116
120
  }
117
- this.authenticated = true;
118
- this.authenticatedChanged.emit(this.authenticated);
119
- this.authenticating = false;
120
- this.authenticatingChanged.emit(this.authenticating);
121
+ this.authenticated.set(true);
122
+ this.authenticatedChanged.emit(this.authenticated());
123
+ this.authenticating.set(false);
124
+ this.authenticatingChanged.emit(this.authenticating());
121
125
  }
122
126
  checkForExistingToken() {
123
127
  if (this.options.tokenName) {
@@ -1 +1 @@
1
- {"version":3,"file":"cleavelandprice-ngx-lib-authentication-token.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/token/src/model/authentication-token-service-options-token.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/token/src/services/authentication-token.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/token/src/authetiction-token.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/token/src/cleavelandprice-ngx-lib-authentication-token.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { AuthenticationTokenServiceOptions } from \"./authentication-token-service-options\";\r\n\r\nexport const AuthenticationTokenServiceOptionsToken = new InjectionToken<AuthenticationTokenServiceOptions>('');","import { HttpClient } from '@angular/common/http';\r\nimport { EventEmitter, Inject, Injectable, Optional, Output, inject } from '@angular/core';\r\nimport { JwtHelperService } from '@auth0/angular-jwt';\r\n\r\nimport {\r\n AbstractAuthenticationService,\r\n AuthenticatedUser,\r\n AuthenticationRequest\r\n} from '@cleavelandprice/ngx-lib/authentication';\r\n\r\nimport { NgxLibServiceBase } from '@cleavelandprice/ngx-lib';\r\nimport { AuthenticationToken } from '../model/authentication-token';\r\nimport { AuthenticationTokenServiceOptions } from '../model/authentication-token-service-options';\r\nimport { AuthenticationTokenServiceOptionsToken } from '../model/authentication-token-service-options-token';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthenticationTokenService extends NgxLibServiceBase implements AbstractAuthenticationService {\r\n //#region Fields\r\n #http = inject(HttpClient);\r\n \r\n authenticating = false; // Flag set to true while the service is attempting to authenticate the user\r\n authenticated = false; // Flag set to true when the user is successfully authenticated\r\n authenticatedUser?: AuthenticatedUser; // Object representing the authenticated user\r\n\r\n // error NG8110: Unsupported call to the output function. This function can only be used as the initializer of a property on a @Component or @Directive class.\r\n /*authenticatedChanged = output<boolean>();\r\n authenticatingChanged = output<boolean>();\r\n authenticationError = output();*/\r\n @Output() authenticatedChanged = new EventEmitter<boolean>();\r\n @Output() authenticatingChanged = new EventEmitter<boolean>();\r\n @Output() authenticationError = new EventEmitter();\r\n\r\n //#endregion\r\n\r\n //#region Properties\r\n get useSessionStorage(): boolean {\r\n return !!localStorage.getItem('storeTokenInSession');\r\n }\r\n\r\n get storage(): Storage {\r\n return this.useSessionStorage ?\r\n sessionStorage:\r\n localStorage;\r\n }\r\n //#endregion\r\n\r\n //#region Lifecycle\r\n constructor(@Optional() @Inject(AuthenticationTokenServiceOptionsToken) protected options: AuthenticationTokenServiceOptions) {\r\n super(options);\r\n \r\n this.options = {\r\n ...options,\r\n\r\n tokenName: 'token',\r\n authenticationEndpoint: '/authenticate/token',\r\n deferTokenValidation: options?.deferTokenValidation ?? false\r\n };\r\n\r\n if (!this.options.deferTokenValidation) {\r\n this.checkForExistingToken();\r\n }\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n //Authenticate the user and store the token in Local Storage\r\n login(username: string, password: string, adminGroup?: string, additionalInfo?: string): void {\r\n const request: AuthenticationRequest = {\r\n username,\r\n password,\r\n adminGroup,\r\n additionalInfo,\r\n appName: this.options.appName\r\n };\r\n\r\n this.authenticating = true;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n\r\n // Sending a 'raw' POST request so that we can tell HttpClient that we are expecting text instead of Json\r\n // Otherwise, it would throw an error trying to decode Json from the response\r\n \r\n this.#http.request('POST', `${this.apiUrl}${this.options.authenticationEndpoint}`, { body: request, responseType: 'text' })\r\n .subscribe({\r\n next: (token) => {\r\n if (token) {\r\n this.validateUser(token);\r\n } else {\r\n this.logout();\r\n }\r\n },\r\n error: (err) => {\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n this.authenticationError.emit(err);\r\n }\r\n });\r\n }\r\n \r\n //Logout the user and delete the token from Local Storage\r\n logout(): void {\r\n if (this.options.tokenName && this.storage.getItem(this.options.tokenName)) {\r\n this.storage.removeItem(this.options.tokenName);\r\n }\r\n\r\n this.authenticatedUser = undefined;\r\n this.authenticated = false;\r\n this.authenticatedChanged.emit(false);\r\n }\r\n \r\n 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 = {\r\n admin: decoded.role === 'Admin',\r\n accountName: decoded.winaccountname,\r\n department: decoded.department,\r\n displayName: decoded.displayName,\r\n distinguishedName: decoded.distinguishedName,\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.manager,\r\n sid: decoded.sid,\r\n title: decoded.title,\r\n workShift: decoded.workShift\r\n };\r\n\r\n if (this.options.tokenName) {\r\n this.storage.setItem(this.options.tokenName, token);\r\n }\r\n \r\n this.authenticated = true;\r\n this.authenticatedChanged.emit(this.authenticated);\r\n\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n }\r\n\r\n checkForExistingToken(): void {\r\n if (this.options.tokenName) {\r\n const token = this.storage.getItem(this.options.tokenName!);\r\n if (token) {\r\n this.validateUser(token);\r\n }\r\n }\r\n }\r\n //#endregion\r\n}","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\n\r\nimport { AuthenticationTokenServiceOptions } from './model/authentication-token-service-options';\r\nimport { AuthenticationTokenServiceOptionsToken } from './model/authentication-token-service-options-token';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: []\r\n})\r\nexport class AuthenticationTokenModule {\r\n static forRoot(options: AuthenticationTokenServiceOptions): ModuleWithProviders<AuthenticationTokenModule> {\r\n return {\r\n ngModule: AuthenticationTokenModule,\r\n providers: [\r\n {\r\n provide: AuthenticationTokenServiceOptionsToken,\r\n useValue: options\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: AuthenticationTokenModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'AuthenticationTokenModule 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 './authentication-token.api';\n"],"names":[],"mappings":";;;;;;;MAGa,sCAAsC,GAAG,IAAI,cAAc,CAAoC,EAAE;;ACexG,MAAO,0BAA2B,SAAQ,iBAAiB,CAAA;;AAE/D,IAAA,KAAK;;;AAiBL,IAAA,IAAI,iBAAiB,GAAA;QACnB,OAAO,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,qBAAqB,CAAC;IACtD;AAEA,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,iBAAiB;AAC3B,YAAA,cAAc;AACd,YAAA,YAAY;IAChB;;;AAIA,IAAA,WAAA,CAAkF,OAA0C,EAAA;QAC1H,KAAK,CAAC,OAAO,CAAC;QADkE,IAAA,CAAA,OAAO,GAAP,OAAO;;AA7BzF,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC;AAE1B,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAC;AACvB,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC;;AAItB;;AAEiC;AACvB,QAAA,IAAA,CAAA,oBAAoB,GAAG,IAAI,YAAY,EAAW;AAClD,QAAA,IAAA,CAAA,qBAAqB,GAAG,IAAI,YAAY,EAAW;AACnD,QAAA,IAAA,CAAA,mBAAmB,GAAG,IAAI,YAAY,EAAE;QAoBhD,IAAI,CAAC,OAAO,GAAG;AACb,YAAA,GAAG,OAAO;AAEV,YAAA,SAAS,EAAE,OAAO;AAClB,YAAA,sBAAsB,EAAE,qBAAqB;AAC7C,YAAA,oBAAoB,EAAE,OAAO,EAAE,oBAAoB,IAAI;SACxD;AAED,QAAA,IAAI,CAAC,IAAI,CA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ACvD,OAAO;AACL,YAAA,QAAQ,EAAE,yBAAyB;AACnC,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,sCAAsC;AAC/C,oBAAA,QAAQ,EAAE;AACX;AACF;SACF;IACH;AAEA,IAAA,WAAA,CAAoC,YAAuC,EAAA;QACzE,IAAI,YAAY,EAAE;AAChB,YAAA,MAAM,IAAI,KAAK,CACb,8EAA8E,CAAC;QACnF;IACF;8GAlBW,yBAAyB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,yBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAzB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,YAJlC,YAAY,CAAA,EAAA,CAAA,CAAA;AAIH,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,YAJlC,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAIH,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAPrC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;AACV,iBAAA;;0BAcc;;0BAAY;;;AC1B3B;;AAEG;;;;"}
1
+ {"version":3,"file":"cleavelandprice-ngx-lib-authentication-token.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/token/src/model/authentication-token-service-options-token.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/token/src/services/authentication-token.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/token/src/authetiction-token.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/token/src/cleavelandprice-ngx-lib-authentication-token.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { AuthenticationTokenServiceOptions } from \"./authentication-token-service-options\";\r\n\r\nexport const AuthenticationTokenServiceOptionsToken = new InjectionToken<AuthenticationTokenServiceOptions>('');","import { HttpClient } from '@angular/common/http';\r\nimport { EventEmitter, Inject, Injectable, Optional, Output, inject, output, signal } from '@angular/core';\r\nimport { JwtHelperService } from '@auth0/angular-jwt';\r\n\r\nimport {\r\n AbstractAuthenticationService,\r\n AuthenticatedUser,\r\n AuthenticationRequest\r\n} from '@cleavelandprice/ngx-lib/authentication';\r\n\r\nimport { NgxLibServiceBase } from '@cleavelandprice/ngx-lib';\r\nimport { AuthenticationToken } from '../model/authentication-token';\r\nimport { AuthenticationTokenServiceOptions } from '../model/authentication-token-service-options';\r\nimport { AuthenticationTokenServiceOptionsToken } from '../model/authentication-token-service-options-token';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthenticationTokenService extends NgxLibServiceBase implements AbstractAuthenticationService {\r\n //#region Fields\r\n #http = inject(HttpClient);\r\n \r\n authenticating = signal(false); // Flag set to true while the service is attempting to authenticate the user\r\n authenticated = signal(false); // Flag set to true when the user is successfully authenticated\r\n authenticatedUser = signal<AuthenticatedUser|undefined>(undefined); // Object representing the authenticated user\r\n\r\n // error NG8110: Unsupported call to the output function. This function can only be used as the initializer of a property on a @Component or @Directive class.\r\n /*authenticatedChanged = output<boolean>();\r\n authenticatingChanged = output<boolean>();\r\n authenticationError = output();*/\r\n @Output() authenticatedChanged = new EventEmitter<boolean>();\r\n @Output() authenticatingChanged = new EventEmitter<boolean>();\r\n @Output() authenticationError = new EventEmitter();\r\n\r\n //#endregion\r\n\r\n //#region Properties\r\n get useSessionStorage(): boolean {\r\n return !!localStorage.getItem('storeTokenInSession');\r\n }\r\n\r\n get storage(): Storage {\r\n return this.useSessionStorage ?\r\n sessionStorage:\r\n localStorage;\r\n }\r\n //#endregion\r\n\r\n //#region Lifecycle\r\n constructor(@Optional() @Inject(AuthenticationTokenServiceOptionsToken) protected options: AuthenticationTokenServiceOptions) {\r\n super(options);\r\n \r\n this.options = {\r\n ...options,\r\n\r\n tokenName: 'token',\r\n authenticationEndpoint: '/authenticate/token',\r\n deferTokenValidation: options?.deferTokenValidation ?? false\r\n };\r\n\r\n if (!this.options.deferTokenValidation) {\r\n this.checkForExistingToken();\r\n }\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n //Authenticate the user and store the token in Local Storage\r\n login(username: string, password: string, adminGroup?: string, additionalInfo?: string): void {\r\n const request: AuthenticationRequest = {\r\n username,\r\n password,\r\n adminGroup,\r\n additionalInfo,\r\n appName: this.options.appName\r\n };\r\n\r\n this.authenticating.set(true);\r\n this.authenticatingChanged.emit(this.authenticating());\r\n\r\n // Sending a 'raw' POST request so that we can tell HttpClient that we are expecting text instead of Json\r\n // Otherwise, it would throw an error trying to decode Json from the response\r\n \r\n this.#http.request('POST', `${this.apiUrl}${this.options.authenticationEndpoint}`, { body: request, responseType: 'text' })\r\n .subscribe({\r\n next: (token) => {\r\n if (token) {\r\n this.validateUser(token);\r\n } else {\r\n this.logout();\r\n }\r\n },\r\n error: (err) => {\r\n this.authenticating.set(false);\r\n this.authenticatingChanged.emit(this.authenticating());\r\n this.authenticationError.emit(err);\r\n }\r\n });\r\n }\r\n \r\n //Logout the user and delete the token from Local Storage\r\n logout(): void {\r\n if (this.options.tokenName && this.storage.getItem(this.options.tokenName)) {\r\n this.storage.removeItem(this.options.tokenName);\r\n }\r\n\r\n this.authenticatedUser.set(undefined);\r\n this.authenticated.set(false);\r\n this.authenticatedChanged.emit(false);\r\n }\r\n \r\n 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 admin: decoded.role === 'Admin',\r\n accountName: decoded.winaccountname,\r\n department: decoded.department,\r\n displayName: decoded.displayName,\r\n distinguishedName: decoded.distinguishedName,\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.manager,\r\n sid: decoded.sid,\r\n title: decoded.title,\r\n workShift: decoded.workShift\r\n });\r\n\r\n if (this.options.tokenName) {\r\n this.storage.setItem(this.options.tokenName, token);\r\n }\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 checkForExistingToken(): void {\r\n if (this.options.tokenName) {\r\n const token = this.storage.getItem(this.options.tokenName!);\r\n if (token) {\r\n this.validateUser(token);\r\n }\r\n }\r\n }\r\n //#endregion\r\n}","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\n\r\nimport { AuthenticationTokenServiceOptions } from './model/authentication-token-service-options';\r\nimport { AuthenticationTokenServiceOptionsToken } from './model/authentication-token-service-options-token';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: []\r\n})\r\nexport class AuthenticationTokenModule {\r\n static forRoot(options: AuthenticationTokenServiceOptions): ModuleWithProviders<AuthenticationTokenModule> {\r\n return {\r\n ngModule: AuthenticationTokenModule,\r\n providers: [\r\n {\r\n provide: AuthenticationTokenServiceOptionsToken,\r\n useValue: options\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: AuthenticationTokenModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'AuthenticationTokenModule 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 './authentication-token.api';\n"],"names":[],"mappings":";;;;;;;MAGa,sCAAsC,GAAG,IAAI,cAAc,CAAoC,EAAE;;ACexG,MAAO,0BAA2B,SAAQ,iBAAiB,CAAA;;AAE/D,IAAA,KAAK;;;AAiBL,IAAA,IAAI,iBAAiB,GAAA;QACnB,OAAO,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,qBAAqB,CAAC;IACtD;AAEA,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,iBAAiB;AAC3B,YAAA,cAAc;AACd,YAAA,YAAY;IAChB;;;AAIA,IAAA,WAAA,CAAkF,OAA0C,EAAA;QAC1H,KAAK,CAAC,OAAO,CAAC;QADkE,IAAA,CAAA,OAAO,GAAP,OAAO;;AA7BzF,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC;QAE1B,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,KAAK;AAAC,QAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAA,CAAC;QAC/B,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,KAAK;AAAC,QAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,eAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAA,CAAC;QAC9B,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAA8B,SAAS;AAAC,QAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,mBAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAA,CAAC;;AAGnE;;AAEiC;AACvB,QAAA,IAAA,CAAA,oBAAoB,GAAG,IAAI,YAAY,EAAW;AAClD,QAAA,IAAA,CAAA,qBAAqB,GAAG,IAAI,YAAY,EAAW;AACn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AAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,YAJlC,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAIH,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAPrC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;AACV,iBAAA;;0BAcc;;0BAAY;;;AC1B3B;;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.3",
4
+ "version": "4.8.4",
5
5
  "description": "Angular library providing foundational functionality to Cleaveland-Price applications",
6
6
  "peerDependencies": {
7
7
  "@angular/common": "^22.1.1",
@@ -121,6 +121,7 @@ type UserChooserReturnValue = {
121
121
  declare class UserFieldComponent {
122
122
  #private;
123
123
  icons: {
124
+ close: _progress_kendo_svg_icons.SVGIcon;
124
125
  user: _progress_kendo_svg_icons.SVGIcon;
125
126
  group: _progress_kendo_svg_icons.SVGIcon;
126
127
  unknown: _progress_kendo_svg_icons.SVGIcon;
@@ -145,6 +146,7 @@ declare class UserFieldComponent {
145
146
  ignoreInvalidAccountNames: _angular_core.InputSignal<boolean>;
146
147
  displayType: _angular_core.InputSignal<UserFieldDisplayType>;
147
148
  emptyUserNameText: _angular_core.InputSignal<string>;
149
+ clearAllTooltip: _angular_core.InputSignal<string>;
148
150
  enableUserChooser: _angular_core.InputSignal<boolean>;
149
151
  userChooserSettings: _angular_core.InputSignal<IUserChooserSettings>;
150
152
  wrapperClass: _angular_core.InputSignal<string>;
@@ -162,8 +164,9 @@ declare class UserFieldComponent {
162
164
  displayPhoto: Signal<boolean>;
163
165
  displayName: Signal<boolean>;
164
166
  onUserChooserClosed(event: UserChooserReturnValue | any): void;
167
+ clearAll(): void;
165
168
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserFieldComponent, never>;
166
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserFieldComponent, "user-field", never, { "selectedUsers": { "alias": "selectedUsers"; "required": false; "isSignal": true; }; "selectedGroups": { "alias": "selectedGroups"; "required": false; "isSignal": true; }; "users": { "alias": "users"; "required": false; "isSignal": true; }; "groups": { "alias": "groups"; "required": false; "isSignal": true; }; "photos": { "alias": "photos"; "required": false; "isSignal": true; }; "maxItemsToDisplay": { "alias": "maxItemsToDisplay"; "required": false; "isSignal": true; }; "groupItemsOverMax": { "alias": "groupItemsOverMax"; "required": false; "isSignal": true; }; "groupItemsOverMaxText": { "alias": "groupItemsOverMaxText"; "required": false; "isSignal": true; }; "ignoreInvalidAccountNames": { "alias": "ignoreInvalidAccountNames"; "required": false; "isSignal": true; }; "displayType": { "alias": "displayType"; "required": false; "isSignal": true; }; "emptyUserNameText": { "alias": "emptyUserNameText"; "required": false; "isSignal": true; }; "enableUserChooser": { "alias": "enableUserChooser"; "required": false; "isSignal": true; }; "userChooserSettings": { "alias": "userChooserSettings"; "required": false; "isSignal": true; }; "wrapperClass": { "alias": "wrapperClass"; "required": false; "isSignal": true; }; "emptyUserNameClass": { "alias": "emptyUserNameClass"; "required": false; "isSignal": true; }; "validUserTextClass": { "alias": "validUserTextClass"; "required": false; "isSignal": true; }; "manySelectedClass": { "alias": "manySelectedClass"; "required": false; "isSignal": true; }; "invalidUserTextClass": { "alias": "invalidUserTextClass"; "required": false; "isSignal": true; }; "photoClass": { "alias": "photoClass"; "required": false; "isSignal": true; }; "userChooserPhotoClass": { "alias": "userChooserPhotoClass"; "required": false; "isSignal": true; }; "userChooserEnabledClass": { "alias": "userChooserEnabledClass"; "required": false; "isSignal": true; }; "userChooserDisabledClass": { "alias": "userChooserDisabledClass"; "required": false; "isSignal": true; }; }, { "rejectedInvalidAccountNames": "rejectedInvalidAccountNames"; "userChooserClosed": "userChooserClosed"; "selectedUsers": "selectedUsersChange"; "selectedGroups": "selectedGroupsChange"; }, never, never, true, never>;
169
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserFieldComponent, "user-field", never, { "selectedUsers": { "alias": "selectedUsers"; "required": false; "isSignal": true; }; "selectedGroups": { "alias": "selectedGroups"; "required": false; "isSignal": true; }; "users": { "alias": "users"; "required": false; "isSignal": true; }; "groups": { "alias": "groups"; "required": false; "isSignal": true; }; "photos": { "alias": "photos"; "required": false; "isSignal": true; }; "maxItemsToDisplay": { "alias": "maxItemsToDisplay"; "required": false; "isSignal": true; }; "groupItemsOverMax": { "alias": "groupItemsOverMax"; "required": false; "isSignal": true; }; "groupItemsOverMaxText": { "alias": "groupItemsOverMaxText"; "required": false; "isSignal": true; }; "ignoreInvalidAccountNames": { "alias": "ignoreInvalidAccountNames"; "required": false; "isSignal": true; }; "displayType": { "alias": "displayType"; "required": false; "isSignal": true; }; "emptyUserNameText": { "alias": "emptyUserNameText"; "required": false; "isSignal": true; }; "clearAllTooltip": { "alias": "clearAllTooltip"; "required": false; "isSignal": true; }; "enableUserChooser": { "alias": "enableUserChooser"; "required": false; "isSignal": true; }; "userChooserSettings": { "alias": "userChooserSettings"; "required": false; "isSignal": true; }; "wrapperClass": { "alias": "wrapperClass"; "required": false; "isSignal": true; }; "emptyUserNameClass": { "alias": "emptyUserNameClass"; "required": false; "isSignal": true; }; "validUserTextClass": { "alias": "validUserTextClass"; "required": false; "isSignal": true; }; "manySelectedClass": { "alias": "manySelectedClass"; "required": false; "isSignal": true; }; "invalidUserTextClass": { "alias": "invalidUserTextClass"; "required": false; "isSignal": true; }; "photoClass": { "alias": "photoClass"; "required": false; "isSignal": true; }; "userChooserPhotoClass": { "alias": "userChooserPhotoClass"; "required": false; "isSignal": true; }; "userChooserEnabledClass": { "alias": "userChooserEnabledClass"; "required": false; "isSignal": true; }; "userChooserDisabledClass": { "alias": "userChooserDisabledClass"; "required": false; "isSignal": true; }; }, { "rejectedInvalidAccountNames": "rejectedInvalidAccountNames"; "userChooserClosed": "userChooserClosed"; "selectedUsers": "selectedUsersChange"; "selectedGroups": "selectedGroupsChange"; }, never, never, true, never>;
167
170
  }
168
171
  type UserObject = {
169
172
  accountName: string;
@@ -2,7 +2,7 @@ import * as _cleavelandprice_ngx_lib_active_directory from '@cleavelandprice/ngx
2
2
  import { User, Group, UserOrGroup, ActiveDirectoryServiceOptions } from '@cleavelandprice/ngx-lib/active-directory';
3
3
  export * from '@cleavelandprice/ngx-lib/active-directory';
4
4
  import { PhotoItem } from '@cleavelandprice/ngx-lib/sharepoint';
5
- import * as i0 from '@angular/core';
5
+ import * as _angular_core from '@angular/core';
6
6
  import { OnInit, ElementRef, ModuleWithProviders } from '@angular/core';
7
7
  import * as _cleavelandprice_ngx_lib_active_directory_material from '@cleavelandprice/ngx-lib/active-directory/material';
8
8
  import * as i2 from '@angular/forms';
@@ -100,7 +100,7 @@ declare class UserChooserComponent implements OnInit {
100
100
  photos?: PhotoItem[];
101
101
  selectableGroupNames?: string[];
102
102
  };
103
- selectionList: i0.Signal<MatSelectionList | undefined>;
103
+ selectionList: _angular_core.Signal<MatSelectionList | undefined>;
104
104
  set filterInput(elRef: ElementRef<HTMLInputElement>);
105
105
  filterForm: FormGroup<{
106
106
  filter: FormControl<any>;
@@ -124,22 +124,22 @@ declare class UserChooserComponent implements OnInit {
124
124
  close(): void;
125
125
  getPhoto(user: SelectableUser | SelectableGroup): string | undefined;
126
126
  tooltip(user: SelectableUser | SelectableGroup): string;
127
- static ɵfac: i0.ɵɵFactoryDeclaration<UserChooserComponent, never>;
128
- static ɵcmp: i0.ɵɵComponentDeclaration<UserChooserComponent, "ng-component", never, {}, {}, never, never, true, never>;
127
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserChooserComponent, never>;
128
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserChooserComponent, "ng-component", never, {}, {}, never, never, true, never>;
129
129
  }
130
130
 
131
131
  declare class UserFormFieldComponent implements OnInit {
132
132
  #private;
133
- usersSelected: i0.OutputEmitterRef<string | string[] | UserOrGroup | UserOrGroup[]>;
134
- userUnSelected: i0.OutputEmitterRef<string>;
135
- placeholder: i0.InputSignal<string>;
136
- clickable: i0.InputSignal<boolean>;
137
- userChooserData: i0.InputSignal<UserChooserData>;
133
+ usersSelected: _angular_core.OutputEmitterRef<string | string[] | UserOrGroup | UserOrGroup[]>;
134
+ userUnSelected: _angular_core.OutputEmitterRef<string>;
135
+ placeholder: _angular_core.InputSignal<string>;
136
+ clickable: _angular_core.InputSignal<boolean>;
137
+ userChooserData: _angular_core.InputSignal<UserChooserData>;
138
138
  _userChooserData: UserChooserData;
139
139
  accountNames?: string[];
140
- users?: User[];
141
- groups?: UserOrGroup[];
142
- photos?: PhotoItem[];
140
+ users: _angular_core.WritableSignal<User[]>;
141
+ groups: _angular_core.WritableSignal<UserOrGroup[]>;
142
+ photos: _angular_core.WritableSignal<PhotoItem[]>;
143
143
  value: any;
144
144
  onChange: (_: any) => void;
145
145
  onTouched: () => void;
@@ -154,16 +154,16 @@ declare class UserFormFieldComponent implements OnInit {
154
154
  writeValue(value: any): void;
155
155
  registerOnChange(fn: any): void;
156
156
  registerOnTouched(fn: any): void;
157
- static ɵfac: i0.ɵɵFactoryDeclaration<UserFormFieldComponent, never>;
158
- static ɵcmp: i0.ɵɵComponentDeclaration<UserFormFieldComponent, "cp-user-field", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "clickable": { "alias": "clickable"; "required": false; "isSignal": true; }; "userChooserData": { "alias": "userChooserData"; "required": true; "isSignal": true; }; }, { "usersSelected": "usersSelected"; "userUnSelected": "userUnSelected"; }, never, never, true, never>;
157
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserFormFieldComponent, never>;
158
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserFormFieldComponent, "cp-user-field", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "clickable": { "alias": "clickable"; "required": false; "isSignal": true; }; "userChooserData": { "alias": "userChooserData"; "required": true; "isSignal": true; }; }, { "usersSelected": "usersSelected"; "userUnSelected": "userUnSelected"; }, never, never, true, never>;
159
159
  }
160
160
 
161
161
  declare class MatActiveDirectoryModule {
162
162
  static forRoot(config: ActiveDirectoryServiceOptions): ModuleWithProviders<MatActiveDirectoryModule>;
163
163
  constructor(parentModule: MatActiveDirectoryModule);
164
- static ɵfac: i0.ɵɵFactoryDeclaration<MatActiveDirectoryModule, [{ optional: true; skipSelf: true; }]>;
165
- static ɵmod: i0.ɵɵNgModuleDeclaration<MatActiveDirectoryModule, never, [typeof i1.CommonModule, typeof i2.ReactiveFormsModule, typeof i3.MatButtonModule, typeof i4.MatDialogModule, typeof i5.MatFormFieldModule, typeof i6.MatIconModule, typeof i7.MatInputModule, typeof i8.MatListModule, typeof i9.MatProgressBarModule, typeof i10.MatProgressSpinnerModule, typeof i11.MatSlideToggleModule, typeof i12.MatTableModule, typeof i13.MatTooltipModule, typeof UserChooserComponent, typeof UserFormFieldComponent], [typeof UserChooserComponent, typeof UserFormFieldComponent]>;
166
- static ɵinj: i0.ɵɵInjectorDeclaration<MatActiveDirectoryModule>;
164
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MatActiveDirectoryModule, [{ optional: true; skipSelf: true; }]>;
165
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<MatActiveDirectoryModule, never, [typeof i1.CommonModule, typeof i2.ReactiveFormsModule, typeof i3.MatButtonModule, typeof i4.MatDialogModule, typeof i5.MatFormFieldModule, typeof i6.MatIconModule, typeof i7.MatInputModule, typeof i8.MatListModule, typeof i9.MatProgressBarModule, typeof i10.MatProgressSpinnerModule, typeof i11.MatSlideToggleModule, typeof i12.MatTableModule, typeof i13.MatTooltipModule, typeof UserChooserComponent, typeof UserFormFieldComponent], [typeof UserChooserComponent, typeof UserFormFieldComponent]>;
166
+ static ɵinj: _angular_core.ɵɵInjectorDeclaration<MatActiveDirectoryModule>;
167
167
  }
168
168
 
169
169
  export { DefaultUserChooserData, DefaultUserChooserFilterOptions, MatActiveDirectoryModule, UserChooserComponent, UserChooserMode, UserFormFieldComponent };
@@ -9,9 +9,9 @@ import * as i1 from '@angular/common';
9
9
  declare class AuthenticationObjectService extends NgxLibServiceBase implements AbstractAuthenticationService {
10
10
  #private;
11
11
  private options;
12
- authenticating: boolean;
13
- authenticated: boolean;
14
- authenticatedUser?: AuthenticatedUser;
12
+ authenticating: i0.WritableSignal<boolean>;
13
+ authenticated: i0.WritableSignal<boolean>;
14
+ authenticatedUser: i0.WritableSignal<AuthenticatedUser | undefined>;
15
15
  authenticatedChanged: EventEmitter<boolean>;
16
16
  authenticatingChanged: EventEmitter<boolean>;
17
17
  authenticationError: EventEmitter<any>;
@@ -58,9 +58,9 @@ interface AuthenticationSSOClaims {
58
58
  declare class AuthenticationSSOService extends NgxLibServiceBase implements AbstractAuthenticationService {
59
59
  #private;
60
60
  protected options: AuthenticationSSOServiceOptions;
61
- authenticating: boolean;
62
- authenticated: boolean;
63
- authenticatedUser?: AuthenticatedUser;
61
+ authenticating: i0.WritableSignal<boolean>;
62
+ authenticated: i0.WritableSignal<boolean>;
63
+ authenticatedUser: i0.WritableSignal<AuthenticatedUser | undefined>;
64
64
  authenticatedChanged: EventEmitter<boolean>;
65
65
  authenticatingChanged: EventEmitter<boolean>;
66
66
  authenticationError: EventEmitter<any>;
@@ -36,9 +36,9 @@ declare const AuthenticationTokenServiceOptionsToken: InjectionToken<Authenticat
36
36
  declare class AuthenticationTokenService extends NgxLibServiceBase implements AbstractAuthenticationService {
37
37
  #private;
38
38
  protected options: AuthenticationTokenServiceOptions;
39
- authenticating: boolean;
40
- authenticated: boolean;
41
- authenticatedUser?: AuthenticatedUser;
39
+ authenticating: i0.WritableSignal<boolean>;
40
+ authenticated: i0.WritableSignal<boolean>;
41
+ authenticatedUser: i0.WritableSignal<AuthenticatedUser | undefined>;
42
42
  authenticatedChanged: EventEmitter<boolean>;
43
43
  authenticatingChanged: EventEmitter<boolean>;
44
44
  authenticationError: EventEmitter<any>;
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, InjectionToken, ModuleWithProviders } from '@angular/core';
2
+ import { EventEmitter, WritableSignal, InjectionToken, ModuleWithProviders } from '@angular/core';
3
3
  import { NgxLibServiceOptions } from '@cleavelandprice/ngx-lib';
4
4
  import * as i1 from '@angular/common';
5
5
 
@@ -27,9 +27,9 @@ interface AbstractAuthenticationService {
27
27
  authenticatedChanged: EventEmitter<boolean>;
28
28
  authenticatingChanged: EventEmitter<boolean>;
29
29
  authenticationError: EventEmitter<any>;
30
- authenticating: boolean;
31
- authenticated: boolean;
32
- authenticatedUser?: AuthenticatedUser;
30
+ authenticating: WritableSignal<boolean>;
31
+ authenticated: WritableSignal<boolean>;
32
+ authenticatedUser: WritableSignal<AuthenticatedUser | undefined>;
33
33
  useSessionStorage: boolean;
34
34
  storage: Storage;
35
35
  login: Function;