@cleavelandprice/ngx-lib 4.7.14 → 4.7.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/fesm2022/cleavelandprice-ngx-lib-active-directory-material.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-material.mjs +4 -4
- package/fesm2022/cleavelandprice-ngx-lib-authentication-material.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-sso.mjs +18 -6
- package/fesm2022/cleavelandprice-ngx-lib-authentication-sso.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-dialog.mjs +10 -10
- package/fesm2022/cleavelandprice-ngx-lib-dialog.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-msgraph.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-quill-mention.mjs +2 -2
- package/fesm2022/cleavelandprice-ngx-lib-quill-mention.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-quill.mjs +4 -4
- package/fesm2022/cleavelandprice-ngx-lib-quill.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-sharepoint.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-table.mjs +9 -11
- package/fesm2022/cleavelandprice-ngx-lib-table.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-upload.mjs +2 -2
- package/fesm2022/cleavelandprice-ngx-lib-upload.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-url-utilities.mjs.map +1 -1
- package/package.json +1 -1
- package/types/cleavelandprice-ngx-lib-table.d.ts +1 -1
|
@@ -34,6 +34,8 @@ class AuthenticationSSOService extends NgxLibServiceBase {
|
|
|
34
34
|
#lastResumeCheckAt;
|
|
35
35
|
// Timer id used to refresh tokens before expiry.
|
|
36
36
|
#tokenRefreshTimeoutId;
|
|
37
|
+
// Treat near-expiry tokens as expired to avoid race conditions during downstream API calls.
|
|
38
|
+
#expirationSkewMilliseconds;
|
|
37
39
|
#expirationEpochSeconds;
|
|
38
40
|
//#endregion
|
|
39
41
|
//#region Properties
|
|
@@ -71,6 +73,8 @@ class AuthenticationSSOService extends NgxLibServiceBase {
|
|
|
71
73
|
// Coalescing flags used when syncing auth after tab visibility/focus resumes.
|
|
72
74
|
this.#resumeCheckInProgress = false;
|
|
73
75
|
this.#lastResumeCheckAt = 0;
|
|
76
|
+
// Treat near-expiry tokens as expired to avoid race conditions during downstream API calls.
|
|
77
|
+
this.#expirationSkewMilliseconds = 30000;
|
|
74
78
|
this.#expirationEpochSeconds = signal(undefined, /* @ts-ignore */
|
|
75
79
|
...(ngDevMode ? [{ debugName: "#expirationEpochSeconds" }] : /* istanbul ignore next */ []));
|
|
76
80
|
const authenticationEndpoint = options.authenticationEndpoint ?? `https://login.microsoftonline.com/${options.tenantId}`;
|
|
@@ -211,9 +215,10 @@ class AuthenticationSSOService extends NgxLibServiceBase {
|
|
|
211
215
|
title: claims.title,
|
|
212
216
|
workShift: claims.workShift
|
|
213
217
|
};
|
|
214
|
-
// Persist id token
|
|
218
|
+
// Persist the most recent id token from the auth result first.
|
|
219
|
+
// account.idToken can lag behind after silent refresh in some MSAL flows.
|
|
215
220
|
if (this.options.tokenName) {
|
|
216
|
-
const token = resolvedAccount
|
|
221
|
+
const token = this.#getLatestIdToken(resolvedResult, resolvedAccount);
|
|
217
222
|
if (token) {
|
|
218
223
|
this.storage.setItem(this.options.tokenName, token);
|
|
219
224
|
}
|
|
@@ -241,7 +246,8 @@ class AuthenticationSSOService extends NgxLibServiceBase {
|
|
|
241
246
|
const account = this.#msal.getActiveAccount() ?? this.#msal.getAllAccounts()[0];
|
|
242
247
|
if (account)
|
|
243
248
|
return this.validateUser(undefined, account);
|
|
244
|
-
|
|
249
|
+
// Ensure stale app token is removed when MSAL has no cached account.
|
|
250
|
+
return this.#logoutLocalOnly(false);
|
|
245
251
|
})
|
|
246
252
|
.catch((error) => {
|
|
247
253
|
console.log('ERROR: Failed to hydrate Microsoft auth state.', error);
|
|
@@ -305,8 +311,10 @@ class AuthenticationSSOService extends NgxLibServiceBase {
|
|
|
305
311
|
try {
|
|
306
312
|
await this.#initializeMsal();
|
|
307
313
|
const account = this.#msal.getActiveAccount() ?? this.#msal.getAllAccounts()[0];
|
|
308
|
-
if (!account)
|
|
314
|
+
if (!account) {
|
|
315
|
+
await this.#logoutLocalOnly(false);
|
|
309
316
|
return;
|
|
317
|
+
}
|
|
310
318
|
await this.validateUser(undefined, account);
|
|
311
319
|
}
|
|
312
320
|
catch (error) {
|
|
@@ -351,10 +359,10 @@ class AuthenticationSSOService extends NgxLibServiceBase {
|
|
|
351
359
|
}
|
|
352
360
|
// Returns true when token expiration is absent or in the past.
|
|
353
361
|
#isTokenExpired(expirationEpochSeconds) {
|
|
354
|
-
if (
|
|
362
|
+
if (expirationEpochSeconds == null || expirationEpochSeconds == undefined || expirationEpochSeconds <= 0) {
|
|
355
363
|
return true;
|
|
356
364
|
}
|
|
357
|
-
return Date.now() >= expirationEpochSeconds * 1000;
|
|
365
|
+
return Date.now() + this.#expirationSkewMilliseconds >= expirationEpochSeconds * 1000;
|
|
358
366
|
}
|
|
359
367
|
// Attempts silent token acquisition for the current account.
|
|
360
368
|
async #refreshToken(account) {
|
|
@@ -369,6 +377,10 @@ class AuthenticationSSOService extends NgxLibServiceBase {
|
|
|
369
377
|
return undefined;
|
|
370
378
|
}
|
|
371
379
|
}
|
|
380
|
+
// Prefers the token returned from the most recent auth result.
|
|
381
|
+
#getLatestIdToken(result, account) {
|
|
382
|
+
return result?.idToken ?? account?.idToken;
|
|
383
|
+
}
|
|
372
384
|
// Schedules token refresh shortly before expiration.
|
|
373
385
|
// If refresh fails, session is terminated to avoid inconsistent auth state.
|
|
374
386
|
#scheduleTokenRefresh(expirationEpochSeconds, account) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleavelandprice-ngx-lib-authentication-sso.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/model/authentication-sso-service-options-token.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/services/authentication-sso.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/components/redirect/authentication-sso-redirect.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/authentication-sso.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/guards/authentication-sso.guard.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/cleavelandprice-ngx-lib-authentication-sso.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { AuthenticationSSOServiceOptions } from \"./authentication-sso-service-options\";\r\n\r\n// What is a InjectionToken?\r\n// An InjectionToken is a way to create a token that can be used to inject a dependency into an Angular service or component.\r\n// It allows you to define a unique identifier for a dependency, which can then be used to retrieve the dependency from the Angular dependency injection system.\r\n// This is particularly useful when you want to inject a value that is not a class, such as a configuration object or a string.\r\n// Great explaination of InjectionToken: https://youtu.be/GvA7xnBmEto?si=_Nc2DTzdsb0jdvuk\r\nexport const AuthenticationSSOServiceOptionsToken = new InjectionToken<AuthenticationSSOServiceOptions>('AuthenticationSSOServiceOptions');\r\n","import { EventEmitter, Inject, Injectable, Optional, Output, signal } from '@angular/core';\r\n\r\nimport { AbstractAuthenticationService, AuthenticatedUser } from '@cleavelandprice/ngx-lib/authentication';\r\n\r\nimport { NgxLibServiceBase } from '@cleavelandprice/ngx-lib';\r\n\r\nimport { AuthenticationSSOServiceOptions } from '../model/authentication-sso-service-options';\r\nimport { AuthenticationSSOServiceOptionsToken } from './../model/authentication-sso-service-options-token';\r\nimport { AuthenticationSSOClaims } from '../model/authentication-sso-claims';\r\n\r\nimport {\r\n AccountInfo,\r\n AuthenticationResult,\r\n BrowserCacheLocation,\r\n PublicClientApplication,\r\n type Configuration\r\n} from '@azure/msal-browser';\r\n\r\n// This service implements authentication using Microsoft Entra ID (formerly Azure AD) via the Microsoft Authentication Library (MSAL).\r\n// It provides methods for logging in, logging out, and validating the authenticated user, while managing token storage and refresh.\r\n// It also supports cross-tab synchronization of authentication state using the BroadcastChannel API.\r\n// It also supports revalidating authentication state when the user returns to a tab after it has been backgrounded for a period of time.\r\n// It also supports storing the token in either localStorage or sessionStorage, based on the user's preference.\r\n// It also supports determining if the token is expired and refreshing it if necessary, or logging the user out if the token cannot be refreshed.\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthenticationSSOService extends NgxLibServiceBase implements AbstractAuthenticationService {\r\n //#region Fields\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 // Microsoft Authentication Library (MSAL) instance for handling authentication\r\n #msal: PublicClientApplication;\r\n // Tracks one-time MSAL initialize() completion.\r\n #initialized = false;\r\n\r\n // Cross-tab messaging channel (same-origin tabs only).\r\n #channel?: BroadcastChannel;\r\n // Broadcast payload sent between tabs to synchronize logout.\r\n #logoutMessage = 'logout';\r\n\r\n // Coalescing flags used when syncing auth after tab visibility/focus resumes.\r\n #resumeCheckInProgress = false;\r\n #lastResumeCheckAt = 0;\r\n\r\n // Timer id used to refresh tokens before expiry.\r\n #tokenRefreshTimeoutId?: ReturnType<typeof setTimeout>;\r\n\r\n #expirationEpochSeconds = signal<number | undefined>(undefined);\r\n //#endregion\r\n\r\n //#region Properties\r\n\r\n // I don't agree with these properties being required in the AbstractAuthenticationService interface\r\n // I think this should be set in the options passed to the service.\r\n // I know this is used in the login components under material but a developer who wants to use their own login with sessionStorage would need to know that they need to create a localStorage item called 'storeTokenInSession' and set it to true\r\n // I have added a cacheLocation option to the AuthenticationSSOServiceOptions interface but if the users don't set it, they can use these properties to set the storage location\r\n\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\r\n //#endregion\r\n\r\n //#region Lifecycle\r\n constructor(@Optional() @Inject(AuthenticationSSOServiceOptionsToken) protected options: AuthenticationSSOServiceOptions) {\r\n super(options);\r\n\r\n const authenticationEndpoint = options.authenticationEndpoint ?? `https://login.microsoftonline.com/${options.tenantId}`;\r\n\r\n this.options = {\r\n ...options,\r\n\r\n tokenName: options.tokenName ?? options.clientId + '-token',\r\n authenticationEndpoint\r\n };\r\n\r\n // if the user didn't set the cacheLocation in the options, we will set it to sessionStorage if useSessionStorage is true, otherwise we will set it to localStorage\r\n this.options.cacheLocation = this.options.cacheLocation ?? (this.useSessionStorage ? 'sessionStorage' : 'localStorage');\r\n\r\n // MSAL configuration for this SPA.\r\n // Cache remains in sessionStorage so each tab has isolated auth cache.\r\n const msalConfig: Configuration = {\r\n auth: {\r\n clientId: this.options.clientId,\r\n authority: this.options.authenticationEndpoint,\r\n redirectUri: this.options.redirectUri,\r\n postLogoutRedirectUri: this.options.postLogoutRedirectUri\r\n },\r\n cache: {\r\n cacheLocation: this.options.cacheLocation === 'sessionStorage' ? BrowserCacheLocation.SessionStorage : BrowserCacheLocation.LocalStorage\r\n }\r\n };\r\n\r\n // Create MSAL client based on the configuration.\r\n // We still need to call initialize() before using it, but this ensures that we only create one instance of the client.\r\n this.#msal = new PublicClientApplication(msalConfig);\r\n\r\n // Initialize the BroadcastChannel for cross-tab communication\r\n this.#initializeBroadcastChannel();\r\n\r\n // Register resume listeners so returning to a tab revalidates auth state.\r\n this.#registerResumeListeners();\r\n\r\n // Attempt to restore authenticated state from any existing Microsoft session.\r\n this.checkForExistingToken();\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n\r\n //Authenticate the user and store the token in Local Storage or Session Storage\r\n login(): void {\r\n // There are times this item is left in sessionStorage after logout, which can cause MSAL to think a login is in progress and block future logins.\r\n // This is a workaround to ensure that the item is removed after logout.\r\n if (typeof sessionStorage !== 'undefined' && sessionStorage.getItem(\"msal.interaction.status\"))\r\n sessionStorage.removeItem(\"msal.interaction.status\");\r\n\r\n this.authenticating = true;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n\r\n console.log('AuthenticationSSOService: login() called. Authenticating user...');\r\n\r\n // Initialize MSAL and then perform login via popup, followed by user validation.\r\n this.#initializeMsal()\r\n .then(() => this.#msal.loginPopup({\r\n scopes: this.options.scopes,\r\n authority: this.options.authenticationEndpoint,\r\n prompt: 'select_account'\r\n }))\r\n .then((result) => this.validateUser(result))\r\n .catch((error: unknown) => {\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n this.authenticationError.emit(error);\r\n });\r\n }\r\n\r\n // Primary logout flow:\r\n // 1) clear local state in this tab,\r\n // 2) notify other tabs to clear their local state,\r\n // 3) initiate Entra sign-out redirect from this initiating tab.\r\n logout(): void {\r\n this.#logoutLocalOnly(false);\r\n this.#publishLogout();\r\n\r\n // Only the initiating tab should call identity-provider logout.\r\n this.#clearTokenRefreshTimer();\r\n\r\n this.#initializeMsal()\r\n .then(() => this.#msal.logoutRedirect({\r\n postLogoutRedirectUri: this.options.postLogoutRedirectUri\r\n }))\r\n .catch((error) => {\r\n console.log('ERROR: Microsoft logout failed.', error);\r\n });\r\n }\r\n\r\n tokenExists(): boolean {\r\n const token = this.storage.getItem(this.options.tokenName ?? '');\r\n return !!token;\r\n }\r\n\r\n // validateUser() = setAuthenticatedUser()\r\n // Resolves current user and token claims into the app's authenticated model.\r\n // Also validates/refreshes token when needed and schedules proactive refresh.\r\n async validateUser(result?: AuthenticationResult, account?: AccountInfo): Promise<void> {\r\n // Resolve account from auth result or fallback account.\r\n let resolvedAccount = result?.account ?? account;\r\n\r\n console.log('AuthenticationSSOService: Validating user. Result:', result, 'Account:', account, 'ResolvedAccount:', resolvedAccount);\r\n\r\n // No account means app should be considered logged out.\r\n if (!resolvedAccount) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n // Keep MSAL active account in sync with resolved account context.\r\n this.#msal.setActiveAccount(resolvedAccount);\r\n\r\n let resolvedResult = result;\r\n let claims = (resolvedResult?.idTokenClaims ?? resolvedAccount.idTokenClaims ?? {}) as AuthenticationSSOClaims;\r\n\r\n // expiresOn comes over as a Date object if it exists, but exp is a number of seconds since epoch.\r\n // therefore, if expiresOn exists convert it to seconds since epoch, otherwise use exp if it exists, otherwise undefined.\r\n // expiresOn is only present when the token is acquired via acquireTokenSilent or acquireTokenPopup, but not when the token is acquired via loginPopup or loginRedirect.\r\n let expirationEpochSeconds = resolvedResult?.expiresOn ? Math.floor(resolvedResult.expiresOn.getTime() / 1000) : claims.exp ?? undefined;\r\n\r\n // If token appears expired, attempt silent refresh before setting user state.\r\n if (this.#isTokenExpired(expirationEpochSeconds)) {\r\n const refreshedResult = await this.#refreshToken(resolvedAccount);\r\n\r\n // Refresh failure means we should end the session.\r\n if (!refreshedResult?.account) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n resolvedResult = refreshedResult;\r\n resolvedAccount = refreshedResult.account;\r\n claims = (resolvedResult.idTokenClaims ?? resolvedAccount.idTokenClaims ?? {}) as AuthenticationSSOClaims;\r\n expirationEpochSeconds = resolvedResult?.expiresOn ? Math.floor(resolvedResult.expiresOn.getTime() / 1000) : claims.exp ?? undefined;\r\n\r\n // Still expired after refresh; terminate session to avoid stale auth.\r\n if (this.#isTokenExpired(expirationEpochSeconds)) {\r\n this.logout();\r\n return;\r\n }\r\n }\r\n\r\n // Derive a stable account name from available claims.\r\n const preferredUsername = String(claims.preferred_username ?? resolvedAccount.username ?? claims.upn ?? claims.email ?? '');\r\n const accountName = preferredUsername.includes('@') ? preferredUsername.split('@')[0] : preferredUsername;\r\n\r\n // Map Entra claims to the app's authenticated user shape.\r\n this.authenticatedUser = {\r\n admin: false,\r\n accountName: claims.accountName ?? accountName,\r\n department: claims.department ?? '',\r\n displayName: claims.displayName ?? '',\r\n distinguishedName: claims.distinguishedName ?? '',\r\n email: claims.mail,\r\n employeeNumber: claims.employeeNumber,\r\n firstName: claims.firstName ?? '',\r\n hireDate: claims.hireDate ?? '',\r\n lastName: claims.lastName ?? '',\r\n manager: claims.manager,\r\n memberOf: claims.memberOf,\r\n phone: claims.phone,\r\n photoUrl: claims.photoUrl,\r\n sid: claims.securityIdentifier ?? '',\r\n title: claims.title,\r\n workShift: claims.workShift\r\n } as AuthenticatedUser;\r\n\r\n // Persist id token into shared auth storage key when configured.\r\n if (this.options.tokenName) {\r\n const token = resolvedAccount?.idToken;\r\n if (token) {\r\n this.storage.setItem(this.options.tokenName, token);\r\n } else {\r\n this.storage.removeItem(this.options.tokenName);\r\n }\r\n }\r\n\r\n this.#expirationEpochSeconds.set(expirationEpochSeconds);\r\n\r\n // Schedule refresh before expiration to keep session uninterrupted.\r\n this.#scheduleTokenRefresh(expirationEpochSeconds, resolvedAccount);\r\n\r\n // Publish authenticated state only when it changes.\r\n const wasAuthenticated = this.authenticated;\r\n this.authenticated = true;\r\n if (wasAuthenticated !== this.authenticated) {\r\n this.authenticatedChanged.emit(this.authenticated);\r\n }\r\n\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n }\r\n\r\n // Rehydrates auth state from existing cached account on startup.\r\n // We intentionally avoid handleRedirectPromise() because this service uses popup login.\r\n checkForExistingToken(): void {\r\n this.#initializeMsal()\r\n .then(() => {\r\n const account = this.#msal.getActiveAccount() ?? this.#msal.getAllAccounts()[0];\r\n if (account)\r\n return this.validateUser(undefined, account);\r\n\r\n return undefined;\r\n })\r\n .catch((error: unknown) => {\r\n console.log('ERROR: Failed to hydrate Microsoft auth state.', error);\r\n });\r\n }\r\n\r\n // Initialize MSAL if it hasn't been initialized yet\r\n // This ensures that we only initialize MSAL once, even if multiple login attempts are made\r\n // This is important because there is startup work that must be completed by MSAL before it can be used, and we don't want to repeat that work unnecessarily\r\n async #initializeMsal(): Promise<void> {\r\n if (this.#initialized) {\r\n return;\r\n }\r\n\r\n\r\n await this.#msal.initialize();\r\n this.#initialized = true;\r\n }\r\n\r\n // Sets up same-origin cross-tab messaging used to fan out logout events.\r\n #initializeBroadcastChannel(): void {\r\n if (typeof BroadcastChannel === 'undefined') {\r\n // Some runtimes may not support BroadcastChannel.\r\n return;\r\n }\r\n\r\n // Create a new BroadcastChannel for cross-tab communication\r\n this.#channel = new BroadcastChannel('sso-authentication-channel');\r\n\r\n // Listen for messages from other tabs for logout events.\r\n // When a logout message is received, the current tab will clear its local state and reload the page.\r\n this.#channel.onmessage = (event) => {\r\n if (event.data === this.#logoutMessage) {\r\n console.log('Received logout message from another tab.');\r\n // Receiving tabs clear local state and reload so route guards re-evaluate immediately.\r\n this.#logoutLocalOnly(true);\r\n }\r\n };\r\n }\r\n\r\n // Registers visibility/focus listeners to re-check auth when user returns to the tab.\r\n // Tabs can be backgrounded for long periods, and the user may have logged out in another tab or session.\r\n #registerResumeListeners(): void {\r\n const handleResume = () => {\r\n void this.#syncAuthOnResume();\r\n };\r\n\r\n if (typeof document !== 'undefined') {\r\n document.addEventListener('visibilitychange', () => {\r\n if (document.visibilityState === 'visible') {\r\n handleResume();\r\n }\r\n });\r\n }\r\n\r\n if (typeof window !== 'undefined') {\r\n window.addEventListener('focus', handleResume);\r\n }\r\n }\r\n\r\n // Syncs auth state after resume while preventing duplicate checks from rapid events.\r\n async #syncAuthOnResume(): Promise<void> {\r\n const now = Date.now();\r\n\r\n // visibilitychange and focus often fire back-to-back; coalesce to one check.\r\n // if now was less than 1 second since last check, skip this one.\r\n if (this.#resumeCheckInProgress || now - this.#lastResumeCheckAt < 1000) {\r\n return;\r\n }\r\n\r\n this.#resumeCheckInProgress = true;\r\n this.#lastResumeCheckAt = now;\r\n\r\n try {\r\n await this.#initializeMsal();\r\n\r\n const account = this.#msal.getActiveAccount() ?? this.#msal.getAllAccounts()[0];\r\n\r\n if (!account)\r\n return;\r\n\r\n await this.validateUser(undefined, account);\r\n }\r\n catch (error) {\r\n console.log('Error: Resume auth sync failed.', error);\r\n }\r\n finally {\r\n this.#resumeCheckInProgress = false;\r\n }\r\n }\r\n\r\n // Sends logout signal to other open tabs.\r\n #publishLogout(): void {\r\n this.#channel?.postMessage(this.#logoutMessage);\r\n }\r\n\r\n // Clears app/MSAL state in current tab without invoking provider-side logout.\r\n // reloadAfterLogout is intended for non-initiating tabs to force UI reset to auth route.\r\n async #logoutLocalOnly(reloadAfterLogout: boolean): Promise<void> {\r\n this.#clearTokenRefreshTimer();\r\n\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 const wasAuthenticated = this.authenticated;\r\n this.authenticatedUser = undefined;\r\n this.authenticated = false;\r\n if (wasAuthenticated !== this.authenticated) {\r\n this.authenticatedChanged.emit(false);\r\n }\r\n\r\n try {\r\n await this.#initializeMsal();\r\n await this.#msal.clearCache();\r\n this.#msal.setActiveAccount(null);\r\n\r\n // There are times this item is left in sessionStorage after logout, which can cause MSAL to think a login is in progress and block future logins.\r\n // This is a workaround to ensure that the item is removed after logout.\r\n sessionStorage.removeItem(\"msal.interaction.status\");\r\n\r\n // Secondary tabs should hard-refresh to guarantee route guards and app state reset.\r\n if (reloadAfterLogout && typeof window !== 'undefined') {\r\n window.location.reload();\r\n }\r\n } catch (error) {\r\n console.log('WARN: Local MSAL cache clear failed.', error);\r\n }\r\n }\r\n\r\n // Returns true when token expiration is absent or in the past.\r\n #isTokenExpired(expirationEpochSeconds?: number): boolean {\r\n if (!expirationEpochSeconds) {\r\n return true;\r\n }\r\n\r\n return Date.now() >= expirationEpochSeconds * 1000;\r\n }\r\n\r\n // Attempts silent token acquisition for the current account.\r\n async #refreshToken(account: AccountInfo): Promise<AuthenticationResult | undefined> {\r\n try {\r\n return await this.#msal.acquireTokenSilent({\r\n account,\r\n scopes: this.options.scopes\r\n });\r\n }\r\n catch (error) {\r\n console.log('Error: Silent token refresh failed.', error);\r\n return undefined;\r\n }\r\n }\r\n\r\n // Schedules token refresh shortly before expiration.\r\n // If refresh fails, session is terminated to avoid inconsistent auth state.\r\n #scheduleTokenRefresh(expirationEpochSeconds: number | undefined, account: AccountInfo): void {\r\n this.#clearTokenRefreshTimer();\r\n\r\n if (!expirationEpochSeconds) {\r\n return;\r\n }\r\n\r\n // Convert Unix epoch seconds to milliseconds for Date.now() comparison\r\n const expirationEpochMilliseconds = expirationEpochSeconds * 1000;\r\n // Schedule refresh 1 minute before expiration\r\n const refreshLeadTimeMs = 60000;\r\n // Calculate the delay until the refresh should occur, ensuring it's not negative\r\n const millisecondsUntilRefresh = expirationEpochMilliseconds - Date.now() - refreshLeadTimeMs;\r\n const delay = Math.max(millisecondsUntilRefresh, 0);\r\n\r\n this.#tokenRefreshTimeoutId = setTimeout(() => {\r\n this.#refreshToken(account)\r\n .then((result) => {\r\n console.log('AuthenticationSSOService: Token refresh result.', result);\r\n if (result?.account) {\r\n return this.validateUser(result, result.account);\r\n }\r\n\r\n // No account after refresh implies invalid session.\r\n this.logout();\r\n return undefined;\r\n })\r\n .catch(() => {\r\n // Any refresh exception falls back to logout for safety.\r\n this.logout();\r\n });\r\n }, delay);\r\n }\r\n\r\n // Cancels any pending token refresh timer.\r\n #clearTokenRefreshTimer(): void {\r\n if (!this.#tokenRefreshTimeoutId) {\r\n return;\r\n }\r\n\r\n clearTimeout(this.#tokenRefreshTimeoutId);\r\n this.#tokenRefreshTimeoutId = undefined;\r\n }\r\n //#endregion\r\n}\r\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\nimport { broadcastResponseToMainFrame } from '@azure/msal-browser/redirect-bridge';\n\n@Component({\n selector: 'app-authentication-sso-redirect',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.Eager,\n template: '<p>Processing authentication...</p>',\n})\nexport class AuthenticationSSORedirectComponent implements OnInit {\n ngOnInit(): void {\n broadcastResponseToMainFrame().catch((error: Error) => {\n console.error('Error broadcasting response to main frame:', error);\n });\n }\n}\n","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\n\r\nimport { AuthenticationSSOServiceOptions } from './model/authentication-sso-service-options';\r\nimport { AuthenticationSSOServiceOptionsToken } from './model/authentication-sso-service-options-token';\r\nimport { AuthenticationSSORedirectComponent } from './components/redirect/authentication-sso-redirect.component';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule,\r\n AuthenticationSSORedirectComponent\r\n ],\r\n exports: [\r\n AuthenticationSSORedirectComponent\r\n ]\r\n})\r\nexport class AuthenticationSSOModule {\r\n static forRoot(options: AuthenticationSSOServiceOptions): ModuleWithProviders<AuthenticationSSOModule> {\r\n return {\r\n ngModule: AuthenticationSSOModule,\r\n providers: [\r\n {\r\n provide: AuthenticationSSOServiceOptionsToken,\r\n useValue: options\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: AuthenticationSSOModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'AuthenticationSSOModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}\r\n","import { inject } from '@angular/core';\r\nimport { CanActivateFn, Router } from '@angular/router';\r\nimport { map, take } from 'rxjs/operators';\r\nimport { AuthenticationSSOService } from '../authentication-sso.api';\r\n\r\nexport const authenticationSSOGuard: CanActivateFn = (_route, _state) => {\r\n const authenticationService = inject(AuthenticationSSOService);\r\n const router = inject(Router);\r\n\r\n // if the user is already authenticated, allow access to the route\r\n if (authenticationService.authenticated) {\r\n return true;\r\n }\r\n\r\n if (authenticationService.tokenExists()) {\r\n // we're doing this because we could've opened a new tab and the user is already logged in, so we need to check for an existing token\r\n authenticationService.checkForExistingToken();\r\n\r\n return authenticationService.authenticatedChanged.pipe(\r\n take(1),\r\n map(() => {\r\n if (!authenticationService.authenticated) {\r\n router.navigate(['']);\r\n return false;\r\n }\r\n\r\n return true;\r\n })\r\n );\r\n }\r\n else {\r\n router.navigate(['']);\r\n return false;\r\n }\r\n};\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './authentication-sso.api';\n"],"names":[],"mappings":";;;;;;;;;AAGA;AACA;AACA;AACA;AACA;MACa,oCAAoC,GAAG,IAAI,cAAc,CAAkC,iCAAiC;;ACUzI;AACA;AACA;AACA;AACA;AACA;AAIM,MAAO,wBAAyB,SAAQ,iBAAiB,CAAA;;AAe7D,IAAA,KAAK;;AAEL,IAAA,YAAY;;AAGZ,IAAA,QAAQ;;AAER,IAAA,cAAc;;AAGd,IAAA,sBAAsB;AACtB,IAAA,kBAAkB;;AAGlB,IAAA,sBAAsB;AAEtB,IAAA,uBAAuB;;;;;;;AAUvB,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;;;AAKA,IAAA,WAAA,CAAgF,OAAwC,EAAA;QACtH,KAAK,CAAC,OAAO,CAAC;QADgE,IAAA,CAAA,OAAO,GAAP,OAAO;;AApDvF,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;;QAKlD,IAAA,CAAA,YAAY,GAAG,KAAK;;QAKpB,IAAA,CAAA,cAAc,GAAG,QAAQ;;QAGzB,IAAA,CAAA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MAAM,CAAC,wBAAwB,CAAC;AAC9D,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;AAG7B,IAAA,IAAI,qBAAqB,CAAC,aAAa,EAAE;AACvC,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,IAAI,qBAAqB,CAAC,WAAW,EAAE,EAAE;;QAEvC,qBAAqB,CAAC,qBAAqB,EAAE;AAE7C,QAAA,OAAO,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CACpD,IAAI,CAAC,CAAC,CAAC,EACP,GAAG,CAAC,MAAK;AACP,YAAA,IAAI,CAAC,qBAAqB,CAAC,aAAa,EAAE;AACxC,gBAAA,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;AACrB,gBAAA,OAAO,KAAK;YACd;AAEA,YAAA,OAAO,IAAI;QACb,CAAC,CAAC,CACH;IACH;SACK;AACH,QAAA,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;AACrB,QAAA,OAAO,KAAK;IACd;AACF;;AClCA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cleavelandprice-ngx-lib-authentication-sso.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/model/authentication-sso-service-options-token.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/services/authentication-sso.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/components/redirect/authentication-sso-redirect.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/authentication-sso.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/guards/authentication-sso.guard.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/sso/src/cleavelandprice-ngx-lib-authentication-sso.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { AuthenticationSSOServiceOptions } from \"./authentication-sso-service-options\";\r\n\r\n// What is a InjectionToken?\r\n// An InjectionToken is a way to create a token that can be used to inject a dependency into an Angular service or component.\r\n// It allows you to define a unique identifier for a dependency, which can then be used to retrieve the dependency from the Angular dependency injection system.\r\n// This is particularly useful when you want to inject a value that is not a class, such as a configuration object or a string.\r\n// Great explaination of InjectionToken: https://youtu.be/GvA7xnBmEto?si=_Nc2DTzdsb0jdvuk\r\nexport const AuthenticationSSOServiceOptionsToken = new InjectionToken<AuthenticationSSOServiceOptions>('AuthenticationSSOServiceOptions');\r\n","import { EventEmitter, Inject, Injectable, Optional, Output, signal } from '@angular/core';\r\n\r\nimport { AbstractAuthenticationService, AuthenticatedUser } from '@cleavelandprice/ngx-lib/authentication';\r\n\r\nimport { NgxLibServiceBase } from '@cleavelandprice/ngx-lib';\r\n\r\nimport { AuthenticationSSOServiceOptions } from '../model/authentication-sso-service-options';\r\nimport { AuthenticationSSOServiceOptionsToken } from './../model/authentication-sso-service-options-token';\r\nimport { AuthenticationSSOClaims } from '../model/authentication-sso-claims';\r\n\r\nimport {\r\n AccountInfo,\r\n AuthenticationResult,\r\n BrowserCacheLocation,\r\n PublicClientApplication,\r\n type Configuration\r\n} from '@azure/msal-browser';\r\n\r\n// This service implements authentication using Microsoft Entra ID (formerly Azure AD) via the Microsoft Authentication Library (MSAL).\r\n// It provides methods for logging in, logging out, and validating the authenticated user, while managing token storage and refresh.\r\n// It also supports cross-tab synchronization of authentication state using the BroadcastChannel API.\r\n// It also supports revalidating authentication state when the user returns to a tab after it has been backgrounded for a period of time.\r\n// It also supports storing the token in either localStorage or sessionStorage, based on the user's preference.\r\n// It also supports determining if the token is expired and refreshing it if necessary, or logging the user out if the token cannot be refreshed.\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthenticationSSOService extends NgxLibServiceBase implements AbstractAuthenticationService {\r\n //#region Fields\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 // Microsoft Authentication Library (MSAL) instance for handling authentication\r\n #msal: PublicClientApplication;\r\n // Tracks one-time MSAL initialize() completion.\r\n #initialized = false;\r\n\r\n // Cross-tab messaging channel (same-origin tabs only).\r\n #channel?: BroadcastChannel;\r\n // Broadcast payload sent between tabs to synchronize logout.\r\n #logoutMessage = 'logout';\r\n\r\n // Coalescing flags used when syncing auth after tab visibility/focus resumes.\r\n #resumeCheckInProgress = false;\r\n #lastResumeCheckAt = 0;\r\n\r\n // Timer id used to refresh tokens before expiry.\r\n #tokenRefreshTimeoutId?: ReturnType<typeof setTimeout>;\r\n // Treat near-expiry tokens as expired to avoid race conditions during downstream API calls.\r\n #expirationSkewMilliseconds = 30000;\r\n\r\n #expirationEpochSeconds = signal<number | undefined>(undefined);\r\n //#endregion\r\n\r\n //#region Properties\r\n\r\n // I don't agree with these properties being required in the AbstractAuthenticationService interface\r\n // I think this should be set in the options passed to the service.\r\n // I know this is used in the login components under material but a developer who wants to use their own login with sessionStorage would need to know that they need to create a localStorage item called 'storeTokenInSession' and set it to true\r\n // I have added a cacheLocation option to the AuthenticationSSOServiceOptions interface but if the users don't set it, they can use these properties to set the storage location\r\n\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\r\n //#endregion\r\n\r\n //#region Lifecycle\r\n constructor(@Optional() @Inject(AuthenticationSSOServiceOptionsToken) protected options: AuthenticationSSOServiceOptions) {\r\n super(options);\r\n\r\n const authenticationEndpoint = options.authenticationEndpoint ?? `https://login.microsoftonline.com/${options.tenantId}`;\r\n\r\n this.options = {\r\n ...options,\r\n\r\n tokenName: options.tokenName ?? options.clientId + '-token',\r\n authenticationEndpoint\r\n };\r\n\r\n // if the user didn't set the cacheLocation in the options, we will set it to sessionStorage if useSessionStorage is true, otherwise we will set it to localStorage\r\n this.options.cacheLocation = this.options.cacheLocation ?? (this.useSessionStorage ? 'sessionStorage' : 'localStorage');\r\n\r\n // MSAL configuration for this SPA.\r\n // Cache remains in sessionStorage so each tab has isolated auth cache.\r\n const msalConfig: Configuration = {\r\n auth: {\r\n clientId: this.options.clientId,\r\n authority: this.options.authenticationEndpoint,\r\n redirectUri: this.options.redirectUri,\r\n postLogoutRedirectUri: this.options.postLogoutRedirectUri\r\n },\r\n cache: {\r\n cacheLocation: this.options.cacheLocation === 'sessionStorage' ? BrowserCacheLocation.SessionStorage : BrowserCacheLocation.LocalStorage\r\n }\r\n };\r\n\r\n // Create MSAL client based on the configuration.\r\n // We still need to call initialize() before using it, but this ensures that we only create one instance of the client.\r\n this.#msal = new PublicClientApplication(msalConfig);\r\n\r\n // Initialize the BroadcastChannel for cross-tab communication\r\n this.#initializeBroadcastChannel();\r\n\r\n // Register resume listeners so returning to a tab revalidates auth state.\r\n this.#registerResumeListeners();\r\n\r\n // Attempt to restore authenticated state from any existing Microsoft session.\r\n this.checkForExistingToken();\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n\r\n //Authenticate the user and store the token in Local Storage or Session Storage\r\n login(): void {\r\n // There are times this item is left in sessionStorage after logout, which can cause MSAL to think a login is in progress and block future logins.\r\n // This is a workaround to ensure that the item is removed after logout.\r\n if (typeof sessionStorage !== 'undefined' && sessionStorage.getItem(\"msal.interaction.status\"))\r\n sessionStorage.removeItem(\"msal.interaction.status\");\r\n\r\n this.authenticating = true;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n\r\n console.log('AuthenticationSSOService: login() called. Authenticating user...');\r\n\r\n // Initialize MSAL and then perform login via popup, followed by user validation.\r\n this.#initializeMsal()\r\n .then(() => this.#msal.loginPopup({\r\n scopes: this.options.scopes,\r\n authority: this.options.authenticationEndpoint,\r\n prompt: 'select_account'\r\n }))\r\n .then((result) => this.validateUser(result))\r\n .catch((error: unknown) => {\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n this.authenticationError.emit(error);\r\n });\r\n }\r\n\r\n // Primary logout flow:\r\n // 1) clear local state in this tab,\r\n // 2) notify other tabs to clear their local state,\r\n // 3) initiate Entra sign-out redirect from this initiating tab.\r\n logout(): void {\r\n this.#logoutLocalOnly(false);\r\n this.#publishLogout();\r\n\r\n // Only the initiating tab should call identity-provider logout.\r\n this.#clearTokenRefreshTimer();\r\n\r\n this.#initializeMsal()\r\n .then(() => this.#msal.logoutRedirect({\r\n postLogoutRedirectUri: this.options.postLogoutRedirectUri\r\n }))\r\n .catch((error) => {\r\n console.log('ERROR: Microsoft logout failed.', error);\r\n });\r\n }\r\n\r\n tokenExists(): boolean {\r\n const token = this.storage.getItem(this.options.tokenName ?? '');\r\n return !!token;\r\n }\r\n\r\n // validateUser() = setAuthenticatedUser()\r\n // Resolves current user and token claims into the app's authenticated model.\r\n // Also validates/refreshes token when needed and schedules proactive refresh.\r\n async validateUser(result?: AuthenticationResult, account?: AccountInfo): Promise<void> {\r\n // Resolve account from auth result or fallback account.\r\n let resolvedAccount = result?.account ?? account;\r\n\r\n console.log('AuthenticationSSOService: Validating user. Result:', result, 'Account:', account, 'ResolvedAccount:', resolvedAccount);\r\n\r\n // No account means app should be considered logged out.\r\n if (!resolvedAccount) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n // Keep MSAL active account in sync with resolved account context.\r\n this.#msal.setActiveAccount(resolvedAccount);\r\n\r\n let resolvedResult = result;\r\n let claims = (resolvedResult?.idTokenClaims ?? resolvedAccount.idTokenClaims ?? {}) as AuthenticationSSOClaims;\r\n\r\n // expiresOn comes over as a Date object if it exists, but exp is a number of seconds since epoch.\r\n // therefore, if expiresOn exists convert it to seconds since epoch, otherwise use exp if it exists, otherwise undefined.\r\n // expiresOn is only present when the token is acquired via acquireTokenSilent or acquireTokenPopup, but not when the token is acquired via loginPopup or loginRedirect.\r\n let expirationEpochSeconds = resolvedResult?.expiresOn ? Math.floor(resolvedResult.expiresOn.getTime() / 1000) : claims.exp ?? undefined;\r\n\r\n // If token appears expired, attempt silent refresh before setting user state.\r\n if (this.#isTokenExpired(expirationEpochSeconds)) {\r\n const refreshedResult = await this.#refreshToken(resolvedAccount);\r\n\r\n // Refresh failure means we should end the session.\r\n if (!refreshedResult?.account) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n resolvedResult = refreshedResult;\r\n resolvedAccount = refreshedResult.account;\r\n claims = (resolvedResult.idTokenClaims ?? resolvedAccount.idTokenClaims ?? {}) as AuthenticationSSOClaims;\r\n expirationEpochSeconds = resolvedResult?.expiresOn ? Math.floor(resolvedResult.expiresOn.getTime() / 1000) : claims.exp ?? undefined;\r\n\r\n // Still expired after refresh; terminate session to avoid stale auth.\r\n if (this.#isTokenExpired(expirationEpochSeconds)) {\r\n this.logout();\r\n return;\r\n }\r\n }\r\n\r\n // Derive a stable account name from available claims.\r\n const preferredUsername = String(claims.preferred_username ?? resolvedAccount.username ?? claims.upn ?? claims.email ?? '');\r\n const accountName = preferredUsername.includes('@') ? preferredUsername.split('@')[0] : preferredUsername;\r\n\r\n // Map Entra claims to the app's authenticated user shape.\r\n this.authenticatedUser = {\r\n admin: false,\r\n accountName: claims.accountName ?? accountName,\r\n department: claims.department ?? '',\r\n displayName: claims.displayName ?? '',\r\n distinguishedName: claims.distinguishedName ?? '',\r\n email: claims.mail,\r\n employeeNumber: claims.employeeNumber,\r\n firstName: claims.firstName ?? '',\r\n hireDate: claims.hireDate ?? '',\r\n lastName: claims.lastName ?? '',\r\n manager: claims.manager,\r\n memberOf: claims.memberOf,\r\n phone: claims.phone,\r\n photoUrl: claims.photoUrl,\r\n sid: claims.securityIdentifier ?? '',\r\n title: claims.title,\r\n workShift: claims.workShift\r\n } as AuthenticatedUser;\r\n\r\n // Persist the most recent id token from the auth result first.\r\n // account.idToken can lag behind after silent refresh in some MSAL flows.\r\n if (this.options.tokenName) {\r\n const token = this.#getLatestIdToken(resolvedResult, resolvedAccount);\r\n if (token) {\r\n this.storage.setItem(this.options.tokenName, token);\r\n } else {\r\n this.storage.removeItem(this.options.tokenName);\r\n }\r\n }\r\n\r\n this.#expirationEpochSeconds.set(expirationEpochSeconds);\r\n\r\n // Schedule refresh before expiration to keep session uninterrupted.\r\n this.#scheduleTokenRefresh(expirationEpochSeconds, resolvedAccount);\r\n\r\n // Publish authenticated state only when it changes.\r\n const wasAuthenticated = this.authenticated;\r\n this.authenticated = true;\r\n if (wasAuthenticated !== this.authenticated) {\r\n this.authenticatedChanged.emit(this.authenticated);\r\n }\r\n\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n }\r\n\r\n // Rehydrates auth state from existing cached account on startup.\r\n // We intentionally avoid handleRedirectPromise() because this service uses popup login.\r\n checkForExistingToken(): void {\r\n this.#initializeMsal()\r\n .then(() => {\r\n const account = this.#msal.getActiveAccount() ?? this.#msal.getAllAccounts()[0];\r\n if (account)\r\n return this.validateUser(undefined, account);\r\n\r\n // Ensure stale app token is removed when MSAL has no cached account.\r\n return this.#logoutLocalOnly(false);\r\n })\r\n .catch((error: unknown) => {\r\n console.log('ERROR: Failed to hydrate Microsoft auth state.', error);\r\n });\r\n }\r\n\r\n // Initialize MSAL if it hasn't been initialized yet\r\n // This ensures that we only initialize MSAL once, even if multiple login attempts are made\r\n // This is important because there is startup work that must be completed by MSAL before it can be used, and we don't want to repeat that work unnecessarily\r\n async #initializeMsal(): Promise<void> {\r\n if (this.#initialized) {\r\n return;\r\n }\r\n\r\n\r\n await this.#msal.initialize();\r\n this.#initialized = true;\r\n }\r\n\r\n // Sets up same-origin cross-tab messaging used to fan out logout events.\r\n #initializeBroadcastChannel(): void {\r\n if (typeof BroadcastChannel === 'undefined') {\r\n // Some runtimes may not support BroadcastChannel.\r\n return;\r\n }\r\n\r\n // Create a new BroadcastChannel for cross-tab communication\r\n this.#channel = new BroadcastChannel('sso-authentication-channel');\r\n\r\n // Listen for messages from other tabs for logout events.\r\n // When a logout message is received, the current tab will clear its local state and reload the page.\r\n this.#channel.onmessage = (event) => {\r\n if (event.data === this.#logoutMessage) {\r\n console.log('Received logout message from another tab.');\r\n // Receiving tabs clear local state and reload so route guards re-evaluate immediately.\r\n this.#logoutLocalOnly(true);\r\n }\r\n };\r\n }\r\n\r\n // Registers visibility/focus listeners to re-check auth when user returns to the tab.\r\n // Tabs can be backgrounded for long periods, and the user may have logged out in another tab or session.\r\n #registerResumeListeners(): void {\r\n const handleResume = () => {\r\n void this.#syncAuthOnResume();\r\n };\r\n\r\n if (typeof document !== 'undefined') {\r\n document.addEventListener('visibilitychange', () => {\r\n if (document.visibilityState === 'visible') {\r\n handleResume();\r\n }\r\n });\r\n }\r\n\r\n if (typeof window !== 'undefined') {\r\n window.addEventListener('focus', handleResume);\r\n }\r\n }\r\n\r\n // Syncs auth state after resume while preventing duplicate checks from rapid events.\r\n async #syncAuthOnResume(): Promise<void> {\r\n const now = Date.now();\r\n\r\n // visibilitychange and focus often fire back-to-back; coalesce to one check.\r\n // if now was less than 1 second since last check, skip this one.\r\n if (this.#resumeCheckInProgress || now - this.#lastResumeCheckAt < 1000) {\r\n return;\r\n }\r\n\r\n this.#resumeCheckInProgress = true;\r\n this.#lastResumeCheckAt = now;\r\n\r\n try {\r\n await this.#initializeMsal();\r\n\r\n const account = this.#msal.getActiveAccount() ?? this.#msal.getAllAccounts()[0];\r\n\r\n if (!account) {\r\n await this.#logoutLocalOnly(false);\r\n return;\r\n }\r\n\r\n await this.validateUser(undefined, account);\r\n }\r\n catch (error) {\r\n console.log('Error: Resume auth sync failed.', error);\r\n }\r\n finally {\r\n this.#resumeCheckInProgress = false;\r\n }\r\n }\r\n\r\n // Sends logout signal to other open tabs.\r\n #publishLogout(): void {\r\n this.#channel?.postMessage(this.#logoutMessage);\r\n }\r\n\r\n // Clears app/MSAL state in current tab without invoking provider-side logout.\r\n // reloadAfterLogout is intended for non-initiating tabs to force UI reset to auth route.\r\n async #logoutLocalOnly(reloadAfterLogout: boolean): Promise<void> {\r\n this.#clearTokenRefreshTimer();\r\n\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 const wasAuthenticated = this.authenticated;\r\n this.authenticatedUser = undefined;\r\n this.authenticated = false;\r\n if (wasAuthenticated !== this.authenticated) {\r\n this.authenticatedChanged.emit(false);\r\n }\r\n\r\n try {\r\n await this.#initializeMsal();\r\n await this.#msal.clearCache();\r\n this.#msal.setActiveAccount(null);\r\n\r\n // There are times this item is left in sessionStorage after logout, which can cause MSAL to think a login is in progress and block future logins.\r\n // This is a workaround to ensure that the item is removed after logout.\r\n sessionStorage.removeItem(\"msal.interaction.status\");\r\n\r\n // Secondary tabs should hard-refresh to guarantee route guards and app state reset.\r\n if (reloadAfterLogout && typeof window !== 'undefined') {\r\n window.location.reload();\r\n }\r\n } catch (error) {\r\n console.log('WARN: Local MSAL cache clear failed.', error);\r\n }\r\n }\r\n\r\n // Returns true when token expiration is absent or in the past.\r\n #isTokenExpired(expirationEpochSeconds?: number): boolean {\r\n if (expirationEpochSeconds == null || expirationEpochSeconds == undefined || expirationEpochSeconds <= 0) {\r\n return true;\r\n }\r\n\r\n return Date.now() + this.#expirationSkewMilliseconds >= expirationEpochSeconds * 1000;\r\n }\r\n\r\n // Attempts silent token acquisition for the current account.\r\n async #refreshToken(account: AccountInfo): Promise<AuthenticationResult | undefined> {\r\n try {\r\n return await this.#msal.acquireTokenSilent({\r\n account,\r\n scopes: this.options.scopes\r\n });\r\n }\r\n catch (error) {\r\n console.log('Error: Silent token refresh failed.', error);\r\n return undefined;\r\n }\r\n }\r\n\r\n // Prefers the token returned from the most recent auth result.\r\n #getLatestIdToken(result?: AuthenticationResult, account?: AccountInfo): string | undefined {\r\n return result?.idToken ?? account?.idToken;\r\n }\r\n\r\n // Schedules token refresh shortly before expiration.\r\n // If refresh fails, session is terminated to avoid inconsistent auth state.\r\n #scheduleTokenRefresh(expirationEpochSeconds: number | undefined, account: AccountInfo): void {\r\n this.#clearTokenRefreshTimer();\r\n\r\n if (!expirationEpochSeconds) {\r\n return;\r\n }\r\n\r\n // Convert Unix epoch seconds to milliseconds for Date.now() comparison\r\n const expirationEpochMilliseconds = expirationEpochSeconds * 1000;\r\n // Schedule refresh 1 minute before expiration\r\n const refreshLeadTimeMs = 60000;\r\n // Calculate the delay until the refresh should occur, ensuring it's not negative\r\n const millisecondsUntilRefresh = expirationEpochMilliseconds - Date.now() - refreshLeadTimeMs;\r\n const delay = Math.max(millisecondsUntilRefresh, 0);\r\n\r\n this.#tokenRefreshTimeoutId = setTimeout(() => {\r\n this.#refreshToken(account)\r\n .then((result) => {\r\n console.log('AuthenticationSSOService: Token refresh result.', result);\r\n if (result?.account) {\r\n return this.validateUser(result, result.account);\r\n }\r\n\r\n // No account after refresh implies invalid session.\r\n this.logout();\r\n return undefined;\r\n })\r\n .catch(() => {\r\n // Any refresh exception falls back to logout for safety.\r\n this.logout();\r\n });\r\n }, delay);\r\n }\r\n\r\n // Cancels any pending token refresh timer.\r\n #clearTokenRefreshTimer(): void {\r\n if (!this.#tokenRefreshTimeoutId) {\r\n return;\r\n }\r\n\r\n clearTimeout(this.#tokenRefreshTimeoutId);\r\n this.#tokenRefreshTimeoutId = undefined;\r\n }\r\n //#endregion\r\n}\r\n","import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';\r\nimport { broadcastResponseToMainFrame } from '@azure/msal-browser/redirect-bridge';\r\n\r\n@Component({\r\n selector: 'app-authentication-sso-redirect',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.Eager,\r\n template: '<p>Processing authentication...</p>',\r\n})\r\nexport class AuthenticationSSORedirectComponent implements OnInit {\r\n ngOnInit(): void {\r\n broadcastResponseToMainFrame().catch((error: Error) => {\r\n console.error('Error broadcasting response to main frame:', error);\r\n });\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\n\r\nimport { AuthenticationSSOServiceOptions } from './model/authentication-sso-service-options';\r\nimport { AuthenticationSSOServiceOptionsToken } from './model/authentication-sso-service-options-token';\r\nimport { AuthenticationSSORedirectComponent } from './components/redirect/authentication-sso-redirect.component';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule,\r\n AuthenticationSSORedirectComponent\r\n ],\r\n exports: [\r\n AuthenticationSSORedirectComponent\r\n ]\r\n})\r\nexport class AuthenticationSSOModule {\r\n static forRoot(options: AuthenticationSSOServiceOptions): ModuleWithProviders<AuthenticationSSOModule> {\r\n return {\r\n ngModule: AuthenticationSSOModule,\r\n providers: [\r\n {\r\n provide: AuthenticationSSOServiceOptionsToken,\r\n useValue: options\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: AuthenticationSSOModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'AuthenticationSSOModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}\r\n","import { inject } from '@angular/core';\r\nimport { CanActivateFn, Router } from '@angular/router';\r\nimport { map, take } from 'rxjs/operators';\r\nimport { AuthenticationSSOService } from '../authentication-sso.api';\r\n\r\nexport const authenticationSSOGuard: CanActivateFn = (_route, _state) => {\r\n const authenticationService = inject(AuthenticationSSOService);\r\n const router = inject(Router);\r\n\r\n // if the user is already authenticated, allow access to the route\r\n if (authenticationService.authenticated) {\r\n return true;\r\n }\r\n\r\n if (authenticationService.tokenExists()) {\r\n // we're doing this because we could've opened a new tab and the user is already logged in, so we need to check for an existing token\r\n authenticationService.checkForExistingToken();\r\n\r\n return authenticationService.authenticatedChanged.pipe(\r\n take(1),\r\n map(() => {\r\n if (!authenticationService.authenticated) {\r\n router.navigate(['']);\r\n return false;\r\n }\r\n\r\n return true;\r\n })\r\n );\r\n }\r\n else {\r\n router.navigate(['']);\r\n return false;\r\n }\r\n};\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './authentication-sso.api';\n"],"names":[],"mappings":";;;;;;;;;AAGA;AACA;AACA;AACA;AACA;MACa,oCAAoC,GAAG,IAAI,cAAc,CAAkC,iCAAiC;;ACUzI;AACA;AACA;AACA;AACA;AACA;AAIM,MAAO,wBAAyB,SAAQ,iBAAiB,CAAA;;AAe7D,IAAA,KAAK;;AAEL,IAAA,YAAY;;AAGZ,IAAA,QAAQ;;AAER,IAAA,cAAc;;AAGd,IAAA,sBAAsB;AACtB,IAAA,kBAAkB;;AAGlB,IAAA,sBAAsB;;AAEtB,IAAA,2BAA2B;AAE3B,IAAA,uBAAuB;;;;;;;AAUvB,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;;;AAKA,IAAA,WAAA,CAAgF,OAAwC,EAAA;QACtH,KAAK,CAAC,OAAO,CAAC;QADgE,IAAA,CAAA,OAAO,GAAP,OAAO;;AAtDvF,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;;QAKlD,IAAA,CAAA,YAAY,GAAG,KAAK;;QAKpB,IAAA,CAAA,cAAc,GAAG,QAAQ;;QAGzB,IAAA,CAAA,sBAAsB,GAAG,KAAK;QAC9B,IAAA,CAAA,kBAAkB,GAAG,CAAC;;QA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B,EAAA,UAAA,EAAA,CAAA;kBAVnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP;AACD;AACF,iBAAA;;0BAcc;;0BAAY;;;MCzBd,sBAAsB,GAAkB,CAAC,MAAM,EAAE,MAAM,KAAI;AACtE,IAAA,MAAM,qBAAqB,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAC9D,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;AAG7B,IAAA,IAAI,qBAAqB,CAAC,aAAa,EAAE;AACvC,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,IAAI,qBAAqB,CAAC,WAAW,EAAE,EAAE;;QAEvC,qBAAqB,CAAC,qBAAqB,EAAE;AAE7C,QAAA,OAAO,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CACpD,IAAI,CAAC,CAAC,CAAC,EACP,GAAG,CAAC,MAAK;AACP,YAAA,IAAI,CAAC,qBAAqB,CAAC,aAAa,EAAE;AACxC,gBAAA,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;AACrB,gBAAA,OAAO,KAAK;YACd;AAEA,YAAA,OAAO,IAAI;QACb,CAAC,CAAC,CACH;IACH;SACK;AACH,QAAA,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;AACrB,QAAA,OAAO,KAAK;IACd;AACF;;AClCA;;AAEG;;;;"}
|
|
@@ -104,7 +104,7 @@ class BaseComponent {
|
|
|
104
104
|
this.closed.emit(data);
|
|
105
105
|
}
|
|
106
106
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
107
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: BaseComponent, isStandalone: true, selector: "cp-dialog-base", inputs: { dialogType: { classPropertyName: "dialogType", publicName: "dialogType", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { closed: "closed" }, ngImport: i0, template: "@if (data().title) {\n <h2 mat-dialog-title [innerHTML]=\"data().title\"></h2>\n}\n\n<mat-dialog-content>\n @if (data().message) {\n <div [innerHTML]=\"data().message\"></div>\n }\n\n @if (dialogType() === DialogType.Input) {\n <mat-form-field>\n <textarea matInput [placeholder]=\"data().placeholder ?? ''\" [(ngModel)]=\"userInput\"></textarea>\n </mat-form-field>\n }\n\n @if (data().checkboxMessage) {\n <div id=\"checkbox\">\n <mat-checkbox [(ngModel)]=\"checkboxValue\">\n <span [innerHTML]=\"data().checkboxMessage\"></span>\n </mat-checkbox>\n </div>\n }\n</mat-dialog-content>\n\n<mat-dialog-actions>\n @if (dialogType() !== DialogType.Choice) {\n <button mat-raised-button (click)=\"close()\" [disabled]=\"dialogType() === DialogType.Input && !userInput\">\n <span>\n @switch (data().mode) {\n @case (ConfirmationDialogMode.YesNo) {\n <span>Yes</span>\n }\n @case (ConfirmationDialogMode.TrueFalse) {\n <span>True</span>\n }\n @case (ConfirmationDialogMode.Custom) {\n <span>{{ customTrueText }}</span>\n }\n @default {\n <span>OK</span>\n }\n }\n </span>\n </button>\n @if (dialogType() !== DialogType.Message) {\n <button mat-raised-button (click)=\"cancel()\">\n <span>\n @switch (data().mode) {\n @case (ConfirmationDialogMode.YesNo) {\n <span>No</span>\n }\n @case (ConfirmationDialogMode.TrueFalse) {\n <span>False</span>\n }\n @case (ConfirmationDialogMode.Custom) {\n <span>{{ customFalseText }}</span>\n }\n @default {\n <span>Cancel</span>\n }\n }\n </span>\n </button>\n }\n }\n\n @if (dialogType() === DialogType.Choice) {\n @for (choice of choices; track choice; let i = $index) {\n <button mat-raised-button [matDialogClose]=\"i\">\n <span>{{ choice }}</span>\n </button>\n }\n }\n</mat-dialog-actions>", styles: ["mat-form-field{margin-top:2em;width:100%}#checkbox{margin:2em 0}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.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: MatCheckboxModule }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.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: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
107
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: BaseComponent, isStandalone: true, selector: "cp-dialog-base", inputs: { dialogType: { classPropertyName: "dialogType", publicName: "dialogType", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { closed: "closed" }, ngImport: i0, template: "@if (data().title) {\r\n <h2 mat-dialog-title [innerHTML]=\"data().title\"></h2>\r\n}\r\n\r\n<mat-dialog-content>\r\n @if (data().message) {\r\n <div [innerHTML]=\"data().message\"></div>\r\n }\r\n\r\n @if (dialogType() === DialogType.Input) {\r\n <mat-form-field>\r\n <textarea matInput [placeholder]=\"data().placeholder ?? ''\" [(ngModel)]=\"userInput\"></textarea>\r\n </mat-form-field>\r\n }\r\n\r\n @if (data().checkboxMessage) {\r\n <div id=\"checkbox\">\r\n <mat-checkbox [(ngModel)]=\"checkboxValue\">\r\n <span [innerHTML]=\"data().checkboxMessage\"></span>\r\n </mat-checkbox>\r\n </div>\r\n }\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n @if (dialogType() !== DialogType.Choice) {\r\n <button mat-raised-button (click)=\"close()\" [disabled]=\"dialogType() === DialogType.Input && !userInput\">\r\n <span>\r\n @switch (data().mode) {\r\n @case (ConfirmationDialogMode.YesNo) {\r\n <span>Yes</span>\r\n }\r\n @case (ConfirmationDialogMode.TrueFalse) {\r\n <span>True</span>\r\n }\r\n @case (ConfirmationDialogMode.Custom) {\r\n <span>{{ customTrueText }}</span>\r\n }\r\n @default {\r\n <span>OK</span>\r\n }\r\n }\r\n </span>\r\n </button>\r\n @if (dialogType() !== DialogType.Message) {\r\n <button mat-raised-button (click)=\"cancel()\">\r\n <span>\r\n @switch (data().mode) {\r\n @case (ConfirmationDialogMode.YesNo) {\r\n <span>No</span>\r\n }\r\n @case (ConfirmationDialogMode.TrueFalse) {\r\n <span>False</span>\r\n }\r\n @case (ConfirmationDialogMode.Custom) {\r\n <span>{{ customFalseText }}</span>\r\n }\r\n @default {\r\n <span>Cancel</span>\r\n }\r\n }\r\n </span>\r\n </button>\r\n }\r\n }\r\n\r\n @if (dialogType() === DialogType.Choice) {\r\n @for (choice of choices; track choice; let i = $index) {\r\n <button mat-raised-button [matDialogClose]=\"i\">\r\n <span>{{ choice }}</span>\r\n </button>\r\n }\r\n }\r\n</mat-dialog-actions>", styles: ["mat-form-field{margin-top:2em;width:100%}#checkbox{margin:2em 0}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.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: MatCheckboxModule }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.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: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
108
108
|
}
|
|
109
109
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: BaseComponent, decorators: [{
|
|
110
110
|
type: Component,
|
|
@@ -115,7 +115,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
115
115
|
MatFormFieldModule,
|
|
116
116
|
MatInputModule,
|
|
117
117
|
FormsModule,
|
|
118
|
-
], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "@if (data().title) {\n <h2 mat-dialog-title [innerHTML]=\"data().title\"></h2>\n}\n\n<mat-dialog-content>\n @if (data().message) {\n <div [innerHTML]=\"data().message\"></div>\n }\n\n @if (dialogType() === DialogType.Input) {\n <mat-form-field>\n <textarea matInput [placeholder]=\"data().placeholder ?? ''\" [(ngModel)]=\"userInput\"></textarea>\n </mat-form-field>\n }\n\n @if (data().checkboxMessage) {\n <div id=\"checkbox\">\n <mat-checkbox [(ngModel)]=\"checkboxValue\">\n <span [innerHTML]=\"data().checkboxMessage\"></span>\n </mat-checkbox>\n </div>\n }\n</mat-dialog-content>\n\n<mat-dialog-actions>\n @if (dialogType() !== DialogType.Choice) {\n <button mat-raised-button (click)=\"close()\" [disabled]=\"dialogType() === DialogType.Input && !userInput\">\n <span>\n @switch (data().mode) {\n @case (ConfirmationDialogMode.YesNo) {\n <span>Yes</span>\n }\n @case (ConfirmationDialogMode.TrueFalse) {\n <span>True</span>\n }\n @case (ConfirmationDialogMode.Custom) {\n <span>{{ customTrueText }}</span>\n }\n @default {\n <span>OK</span>\n }\n }\n </span>\n </button>\n @if (dialogType() !== DialogType.Message) {\n <button mat-raised-button (click)=\"cancel()\">\n <span>\n @switch (data().mode) {\n @case (ConfirmationDialogMode.YesNo) {\n <span>No</span>\n }\n @case (ConfirmationDialogMode.TrueFalse) {\n <span>False</span>\n }\n @case (ConfirmationDialogMode.Custom) {\n <span>{{ customFalseText }}</span>\n }\n @default {\n <span>Cancel</span>\n }\n }\n </span>\n </button>\n }\n }\n\n @if (dialogType() === DialogType.Choice) {\n @for (choice of choices; track choice; let i = $index) {\n <button mat-raised-button [matDialogClose]=\"i\">\n <span>{{ choice }}</span>\n </button>\n }\n }\n</mat-dialog-actions>", styles: ["mat-form-field{margin-top:2em;width:100%}#checkbox{margin:2em 0}\n"] }]
|
|
118
|
+
], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "@if (data().title) {\r\n <h2 mat-dialog-title [innerHTML]=\"data().title\"></h2>\r\n}\r\n\r\n<mat-dialog-content>\r\n @if (data().message) {\r\n <div [innerHTML]=\"data().message\"></div>\r\n }\r\n\r\n @if (dialogType() === DialogType.Input) {\r\n <mat-form-field>\r\n <textarea matInput [placeholder]=\"data().placeholder ?? ''\" [(ngModel)]=\"userInput\"></textarea>\r\n </mat-form-field>\r\n }\r\n\r\n @if (data().checkboxMessage) {\r\n <div id=\"checkbox\">\r\n <mat-checkbox [(ngModel)]=\"checkboxValue\">\r\n <span [innerHTML]=\"data().checkboxMessage\"></span>\r\n </mat-checkbox>\r\n </div>\r\n }\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n @if (dialogType() !== DialogType.Choice) {\r\n <button mat-raised-button (click)=\"close()\" [disabled]=\"dialogType() === DialogType.Input && !userInput\">\r\n <span>\r\n @switch (data().mode) {\r\n @case (ConfirmationDialogMode.YesNo) {\r\n <span>Yes</span>\r\n }\r\n @case (ConfirmationDialogMode.TrueFalse) {\r\n <span>True</span>\r\n }\r\n @case (ConfirmationDialogMode.Custom) {\r\n <span>{{ customTrueText }}</span>\r\n }\r\n @default {\r\n <span>OK</span>\r\n }\r\n }\r\n </span>\r\n </button>\r\n @if (dialogType() !== DialogType.Message) {\r\n <button mat-raised-button (click)=\"cancel()\">\r\n <span>\r\n @switch (data().mode) {\r\n @case (ConfirmationDialogMode.YesNo) {\r\n <span>No</span>\r\n }\r\n @case (ConfirmationDialogMode.TrueFalse) {\r\n <span>False</span>\r\n }\r\n @case (ConfirmationDialogMode.Custom) {\r\n <span>{{ customFalseText }}</span>\r\n }\r\n @default {\r\n <span>Cancel</span>\r\n }\r\n }\r\n </span>\r\n </button>\r\n }\r\n }\r\n\r\n @if (dialogType() === DialogType.Choice) {\r\n @for (choice of choices; track choice; let i = $index) {\r\n <button mat-raised-button [matDialogClose]=\"i\">\r\n <span>{{ choice }}</span>\r\n </button>\r\n }\r\n }\r\n</mat-dialog-actions>", styles: ["mat-form-field{margin-top:2em;width:100%}#checkbox{margin:2em 0}\n"] }]
|
|
119
119
|
}], propDecorators: { dialogType: [{ type: i0.Input, args: [{ isSignal: true, alias: "dialogType", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
120
120
|
|
|
121
121
|
class ChoiceComponent {
|
|
@@ -127,11 +127,11 @@ class ChoiceComponent {
|
|
|
127
127
|
this.dialogType = DialogType.Choice;
|
|
128
128
|
}
|
|
129
129
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ChoiceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
130
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: ChoiceComponent, isStandalone: true, selector: "cp-dialog-choice", ngImport: i0, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
130
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: ChoiceComponent, isStandalone: true, selector: "cp-dialog-choice", ngImport: i0, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
131
131
|
}
|
|
132
132
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ChoiceComponent, decorators: [{
|
|
133
133
|
type: Component,
|
|
134
|
-
args: [{ selector: 'cp-dialog-choice', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>" }]
|
|
134
|
+
args: [{ selector: 'cp-dialog-choice', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>" }]
|
|
135
135
|
}] });
|
|
136
136
|
|
|
137
137
|
class ConfirmationComponent {
|
|
@@ -143,11 +143,11 @@ class ConfirmationComponent {
|
|
|
143
143
|
this.dialogType = DialogType.Confirmation;
|
|
144
144
|
}
|
|
145
145
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ConfirmationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
146
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: ConfirmationComponent, isStandalone: true, selector: "cp-dialog-confirmation", ngImport: i0, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
146
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: ConfirmationComponent, isStandalone: true, selector: "cp-dialog-confirmation", ngImport: i0, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
147
147
|
}
|
|
148
148
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ConfirmationComponent, decorators: [{
|
|
149
149
|
type: Component,
|
|
150
|
-
args: [{ selector: 'cp-dialog-confirmation', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>" }]
|
|
150
|
+
args: [{ selector: 'cp-dialog-confirmation', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>" }]
|
|
151
151
|
}] });
|
|
152
152
|
|
|
153
153
|
class InputComponent {
|
|
@@ -159,11 +159,11 @@ class InputComponent {
|
|
|
159
159
|
this.dialogType = DialogType.Input;
|
|
160
160
|
}
|
|
161
161
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
162
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: InputComponent, isStandalone: true, selector: "cp-dialog-input", ngImport: i0, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
162
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: InputComponent, isStandalone: true, selector: "cp-dialog-input", ngImport: i0, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
163
163
|
}
|
|
164
164
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: InputComponent, decorators: [{
|
|
165
165
|
type: Component,
|
|
166
|
-
args: [{ selector: 'cp-dialog-input', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>" }]
|
|
166
|
+
args: [{ selector: 'cp-dialog-input', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>" }]
|
|
167
167
|
}] });
|
|
168
168
|
|
|
169
169
|
class MessageComponent {
|
|
@@ -175,11 +175,11 @@ class MessageComponent {
|
|
|
175
175
|
this.dialogType = DialogType.Message;
|
|
176
176
|
}
|
|
177
177
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: MessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
178
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: MessageComponent, isStandalone: true, selector: "cp-dialog-message", ngImport: i0, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
178
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", type: MessageComponent, isStandalone: true, selector: "cp-dialog-message", ngImport: i0, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>", styles: [""], dependencies: [{ kind: "component", type: BaseComponent, selector: "cp-dialog-base", inputs: ["dialogType", "data"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
|
|
179
179
|
}
|
|
180
180
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: MessageComponent, decorators: [{
|
|
181
181
|
type: Component,
|
|
182
|
-
args: [{ selector: 'cp-dialog-message', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>" }]
|
|
182
|
+
args: [{ selector: 'cp-dialog-message', imports: [BaseComponent], changeDetection: ChangeDetectionStrategy.Eager, standalone: true, template: "<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>" }]
|
|
183
183
|
}] });
|
|
184
184
|
|
|
185
185
|
class DialogModule {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleavelandprice-ngx-lib-dialog.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/dialog/src/model/confirmation-dialog-mode.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/model/dialog-type.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/base/base.component.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/base/base.component.html","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/choice/choice.component.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/choice/choice.component.html","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/confirmation/confirmation.component.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/confirmation/confirmation.component.html","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/input/input.component.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/input/input.component.html","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/message/message.component.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/message/message.component.html","../../../../projects/cleavelandprice/ngx-lib/dialog/src/dialog.module.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/dialog.api.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/cleavelandprice-ngx-lib-dialog.ts"],"sourcesContent":["export enum ConfirmationDialogMode {\r\n OkCancel,\r\n YesNo,\r\n TrueFalse,\r\n Custom\r\n}","export enum DialogType {\r\n Choice,\r\n Confirmation,\r\n Input,\r\n Message\r\n}","import {\n Component,\n OnInit,\n input,\n output,\n ChangeDetectionStrategy,\n} from '@angular/core';\n\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { ConfirmationDialogMode } from '../../model/confirmation-dialog-mode';\nimport { DialogBaseData } from '../../model/dialog-base-data';\nimport { DialogChoiceData } from '../../model/dialog-choice-data';\nimport { DialogType } from '../../model/dialog-type';\n\n@Component({\n selector: 'cp-dialog-base',\n templateUrl: './base.component.html',\n styleUrl: './base.component.scss',\n imports: [\n MatButtonModule,\n MatCheckboxModule,\n MatDialogModule,\n MatFormFieldModule,\n MatInputModule,\n FormsModule,\n ],\n changeDetection: ChangeDetectionStrategy.Eager,\n standalone: true,\n})\nexport class BaseComponent implements OnInit {\n // This is so that DialogType can be accessible from the HTML template\n DialogType = DialogType;\n dialogType = input(DialogType.Message);\n data = input.required<DialogBaseData>();\n closed = output();\n\n ConfirmationDialogMode = ConfirmationDialogMode;\n\n // Form values\n userInput?: string;\n checkboxValue!: boolean;\n\n get #customTrueFalseTextValid(): boolean {\n return this.data().customTrueFalseText?.length === 2;\n }\n\n get customTrueText(): string | undefined {\n return this.#customTrueFalseTextValid\n ? this.data().customTrueFalseText![0]\n : undefined;\n }\n\n get customFalseText(): string | undefined {\n return this.#customTrueFalseTextValid\n ? this.data().customTrueFalseText![1]\n : undefined;\n }\n\n get choices(): string[] | null {\n return this.dialogType() === DialogType.Choice\n ? (this.data() as DialogChoiceData).choices\n : null;\n }\n\n ngOnInit(): void {\n this.userInput = this.data().value;\n }\n\n close(): void {\n let data: any;\n\n switch (this.dialogType()) {\n case DialogType.Message:\n data = this.data().checkboxMessage\n ? {\n checkbox: this.checkboxValue || false,\n }\n : null;\n break;\n case DialogType.Input:\n data = this.data().checkboxMessage\n ? {\n response: this.userInput,\n checkbox: this.checkboxValue || false,\n }\n : this.userInput;\n break;\n case DialogType.Confirmation:\n data = this.data().checkboxMessage\n ? {\n response: true,\n checkbox: this.checkboxValue || false,\n }\n : true;\n break;\n }\n\n this.closed.emit(data);\n }\n\n cancel(): void {\n let data: any;\n\n if (this.dialogType() === DialogType.Confirmation) {\n data = this.data().checkboxMessage\n ? {\n response: false,\n checkbox: this.checkboxValue || false,\n }\n : false;\n }\n\n this.closed.emit(data);\n }\n}\n","@if (data().title) {\n <h2 mat-dialog-title [innerHTML]=\"data().title\"></h2>\n}\n\n<mat-dialog-content>\n @if (data().message) {\n <div [innerHTML]=\"data().message\"></div>\n }\n\n @if (dialogType() === DialogType.Input) {\n <mat-form-field>\n <textarea matInput [placeholder]=\"data().placeholder ?? ''\" [(ngModel)]=\"userInput\"></textarea>\n </mat-form-field>\n }\n\n @if (data().checkboxMessage) {\n <div id=\"checkbox\">\n <mat-checkbox [(ngModel)]=\"checkboxValue\">\n <span [innerHTML]=\"data().checkboxMessage\"></span>\n </mat-checkbox>\n </div>\n }\n</mat-dialog-content>\n\n<mat-dialog-actions>\n @if (dialogType() !== DialogType.Choice) {\n <button mat-raised-button (click)=\"close()\" [disabled]=\"dialogType() === DialogType.Input && !userInput\">\n <span>\n @switch (data().mode) {\n @case (ConfirmationDialogMode.YesNo) {\n <span>Yes</span>\n }\n @case (ConfirmationDialogMode.TrueFalse) {\n <span>True</span>\n }\n @case (ConfirmationDialogMode.Custom) {\n <span>{{ customTrueText }}</span>\n }\n @default {\n <span>OK</span>\n }\n }\n </span>\n </button>\n @if (dialogType() !== DialogType.Message) {\n <button mat-raised-button (click)=\"cancel()\">\n <span>\n @switch (data().mode) {\n @case (ConfirmationDialogMode.YesNo) {\n <span>No</span>\n }\n @case (ConfirmationDialogMode.TrueFalse) {\n <span>False</span>\n }\n @case (ConfirmationDialogMode.Custom) {\n <span>{{ customFalseText }}</span>\n }\n @default {\n <span>Cancel</span>\n }\n }\n </span>\n </button>\n }\n }\n\n @if (dialogType() === DialogType.Choice) {\n @for (choice of choices; track choice; let i = $index) {\n <button mat-raised-button [matDialogClose]=\"i\">\n <span>{{ choice }}</span>\n </button>\n }\n }\n</mat-dialog-actions>","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\n\nimport { DialogChoiceData } from '../../model/dialog-choice-data';\nimport { DialogType } from '../../model/dialog-type';\nimport { BaseComponent } from '../base/base.component';\n\n@Component({\n selector: 'cp-dialog-choice',\n templateUrl: './choice.component.html',\n styleUrl: './choice.component.scss',\n imports: [BaseComponent],\n changeDetection: ChangeDetectionStrategy.Eager,\n standalone: true,\n})\nexport class ChoiceComponent {\n services = {\n data: inject<DialogChoiceData>(MAT_DIALOG_DATA),\n dialogRef: inject(MatDialogRef<ChoiceComponent>),\n };\n\n dialogType = DialogType.Choice;\n}\n","<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\n\nimport { DialogBaseData } from '../../model/dialog-base-data';\nimport { DialogType } from '../../model/dialog-type';\nimport { BaseComponent } from '../base/base.component';\n\n@Component({\n selector: 'cp-dialog-confirmation',\n templateUrl: './confirmation.component.html',\n styleUrl: './confirmation.component.scss',\n imports: [BaseComponent],\n changeDetection: ChangeDetectionStrategy.Eager,\n standalone: true,\n})\nexport class ConfirmationComponent {\n services = {\n data: inject<DialogBaseData>(MAT_DIALOG_DATA),\n dialogRef: inject(MatDialogRef<ConfirmationComponent>),\n };\n\n dialogType = DialogType.Confirmation;\n}\n","<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\n\nimport { DialogBaseData } from '../../model/dialog-base-data';\nimport { DialogType } from '../../model/dialog-type';\nimport { BaseComponent } from '../base/base.component';\n\n@Component({\n selector: 'cp-dialog-input',\n templateUrl: './input.component.html',\n styleUrl: './input.component.scss',\n imports: [BaseComponent],\n changeDetection: ChangeDetectionStrategy.Eager,\n standalone: true,\n})\nexport class InputComponent {\n services = {\n data: inject<DialogBaseData>(MAT_DIALOG_DATA),\n dialogRef: inject(MatDialogRef<InputComponent>),\n };\n\n dialogType = DialogType.Input;\n}\n","<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\n\nimport { DialogBaseData } from '../../model/dialog-base-data';\nimport { DialogType } from '../../model/dialog-type';\nimport { BaseComponent } from '../base/base.component';\n\n@Component({\n selector: 'cp-dialog-message',\n templateUrl: './message.component.html',\n styleUrl: './message.component.scss',\n imports: [BaseComponent],\n changeDetection: ChangeDetectionStrategy.Eager,\n standalone: true,\n})\nexport class MessageComponent {\n services = {\n data: inject<DialogBaseData>(MAT_DIALOG_DATA),\n dialogRef: inject(MatDialogRef<MessageComponent>),\n };\n\n dialogType = DialogType.Message;\n}\n","<cp-dialog-base\n [data]=\"services.data\"\n [dialogType]=\"dialogType\"\n (closed)=\"services.dialogRef.close($event)\">\n</cp-dialog-base>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { BaseComponent } from './components/base/base.component';\nimport { ChoiceComponent } from './components/choice/choice.component';\nimport { ConfirmationComponent } from './components/confirmation/confirmation.component';\nimport { InputComponent } from './components/input/input.component';\nimport { MessageComponent } from './components/message/message.component';\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule,\n FormsModule,\n\n MatButtonModule,\n MatCheckboxModule,\n MatDialogModule,\n MatFormFieldModule,\n MatInputModule,\n\n BaseComponent,\n ChoiceComponent,\n ConfirmationComponent,\n InputComponent,\n MessageComponent\n ],\n exports: [\n BaseComponent,\n ChoiceComponent,\n ConfirmationComponent,\n InputComponent,\n MessageComponent\n ]\n})\nexport class DialogModule { }\n","export * from './model/confirmation-dialog-mode';\r\nexport * from './model/dialog-base-data';\r\nexport * from './model/dialog-type';\r\n\r\nexport * from './components/base/base.component';\r\nexport * from './components/choice/choice.component';\r\nexport * from './components/confirmation/confirmation.component';\r\nexport * from './components/input/input.component';\r\nexport * from './components/message/message.component';\r\n\r\nexport * from './dialog.module';\r\n\r\n/*export const CP_DIALOG_COMPONENTS = [\r\n ChoiceComponent,\r\n ConfirmationComponent,\r\n InputComponent,\r\n MessageComponent\r\n] as const;*/\r\n\r\n/*export const CP_DIALOG_ENUMS = {\r\n ConfirmationDialogMode,\r\n DialogType\r\n } as const;*/","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './dialog.api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,sBAAsB,EAAA;AAC9B,IAAA,sBAAA,CAAA,sBAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAQ;AACR,IAAA,sBAAA,CAAA,sBAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAK;AACL,IAAA,sBAAA,CAAA,sBAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS;AACT,IAAA,sBAAA,CAAA,sBAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM;AACV,CAAC,EALW,sBAAsB,KAAtB,sBAAsB,GAAA,EAAA,CAAA,CAAA;;ICAtB;AAAZ,CAAA,UAAY,UAAU,EAAA;AAClB,IAAA,UAAA,CAAA,UAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM;AACN,IAAA,UAAA,CAAA,UAAA,CAAA,cAAA,CAAA,GAAA,CAAA,CAAA,GAAA,cAAY;AACZ,IAAA,UAAA,C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cAAc;YAEd,aAAa;YACb,eAAe;YACf,qBAAqB;YACrB,cAAc;AACd,YAAA,gBAAgB,aAGhB,aAAa;YACb,eAAe;YACf,qBAAqB;YACrB,cAAc;YACd,gBAAgB,CAAA,EAAA,CAAA,CAAA;AAGP,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,YAAY,YAvBrB,YAAY;YACZ,WAAW;YAEX,eAAe;YACf,iBAAiB;YACjB,eAAe;YACf,kBAAkB;YAClB,cAAc;YAEd,aAAa;YACb,eAAe;YACf,qBAAqB;YACrB,cAAc;YACd,gBAAgB,CAAA,EAAA,CAAA,CAAA;;2FAUP,YAAY,EAAA,UAAA,EAAA,CAAA;kBA1BxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBAEX,eAAe;wBACf,iBAAiB;wBACjB,eAAe;wBACf,kBAAkB;wBAClB,cAAc;wBAEd,aAAa;wBACb,eAAe;wBACf,qBAAqB;wBACrB,cAAc;wBACd;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,aAAa;wBACb,eAAe;wBACf,qBAAqB;wBACrB,cAAc;wBACd;AACD;AACF,iBAAA;;;AC7BD;;;;;AAKa;AAEb;;;AAGc;;ACtBd;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cleavelandprice-ngx-lib-dialog.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/dialog/src/model/confirmation-dialog-mode.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/model/dialog-type.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/base/base.component.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/base/base.component.html","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/choice/choice.component.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/choice/choice.component.html","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/confirmation/confirmation.component.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/confirmation/confirmation.component.html","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/input/input.component.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/input/input.component.html","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/message/message.component.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/message/message.component.html","../../../../projects/cleavelandprice/ngx-lib/dialog/src/dialog.module.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/dialog.api.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/cleavelandprice-ngx-lib-dialog.ts"],"sourcesContent":["export enum ConfirmationDialogMode {\r\n OkCancel,\r\n YesNo,\r\n TrueFalse,\r\n Custom\r\n}","export enum DialogType {\r\n Choice,\r\n Confirmation,\r\n Input,\r\n Message\r\n}","import {\r\n Component,\r\n OnInit,\r\n input,\r\n output,\r\n ChangeDetectionStrategy,\r\n} from '@angular/core';\r\n\r\nimport { FormsModule } from '@angular/forms';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatCheckboxModule } from '@angular/material/checkbox';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { ConfirmationDialogMode } from '../../model/confirmation-dialog-mode';\r\nimport { DialogBaseData } from '../../model/dialog-base-data';\r\nimport { DialogChoiceData } from '../../model/dialog-choice-data';\r\nimport { DialogType } from '../../model/dialog-type';\r\n\r\n@Component({\r\n selector: 'cp-dialog-base',\r\n templateUrl: './base.component.html',\r\n styleUrl: './base.component.scss',\r\n imports: [\r\n MatButtonModule,\r\n MatCheckboxModule,\r\n MatDialogModule,\r\n MatFormFieldModule,\r\n MatInputModule,\r\n FormsModule,\r\n ],\r\n changeDetection: ChangeDetectionStrategy.Eager,\r\n standalone: true,\r\n})\r\nexport class BaseComponent implements OnInit {\r\n // This is so that DialogType can be accessible from the HTML template\r\n DialogType = DialogType;\r\n dialogType = input(DialogType.Message);\r\n data = input.required<DialogBaseData>();\r\n closed = output();\r\n\r\n ConfirmationDialogMode = ConfirmationDialogMode;\r\n\r\n // Form values\r\n userInput?: string;\r\n checkboxValue!: boolean;\r\n\r\n get #customTrueFalseTextValid(): boolean {\r\n return this.data().customTrueFalseText?.length === 2;\r\n }\r\n\r\n get customTrueText(): string | undefined {\r\n return this.#customTrueFalseTextValid\r\n ? this.data().customTrueFalseText![0]\r\n : undefined;\r\n }\r\n\r\n get customFalseText(): string | undefined {\r\n return this.#customTrueFalseTextValid\r\n ? this.data().customTrueFalseText![1]\r\n : undefined;\r\n }\r\n\r\n get choices(): string[] | null {\r\n return this.dialogType() === DialogType.Choice\r\n ? (this.data() as DialogChoiceData).choices\r\n : null;\r\n }\r\n\r\n ngOnInit(): void {\r\n this.userInput = this.data().value;\r\n }\r\n\r\n close(): void {\r\n let data: any;\r\n\r\n switch (this.dialogType()) {\r\n case DialogType.Message:\r\n data = this.data().checkboxMessage\r\n ? {\r\n checkbox: this.checkboxValue || false,\r\n }\r\n : null;\r\n break;\r\n case DialogType.Input:\r\n data = this.data().checkboxMessage\r\n ? {\r\n response: this.userInput,\r\n checkbox: this.checkboxValue || false,\r\n }\r\n : this.userInput;\r\n break;\r\n case DialogType.Confirmation:\r\n data = this.data().checkboxMessage\r\n ? {\r\n response: true,\r\n checkbox: this.checkboxValue || false,\r\n }\r\n : true;\r\n break;\r\n }\r\n\r\n this.closed.emit(data);\r\n }\r\n\r\n cancel(): void {\r\n let data: any;\r\n\r\n if (this.dialogType() === DialogType.Confirmation) {\r\n data = this.data().checkboxMessage\r\n ? {\r\n response: false,\r\n checkbox: this.checkboxValue || false,\r\n }\r\n : false;\r\n }\r\n\r\n this.closed.emit(data);\r\n }\r\n}\r\n","@if (data().title) {\r\n <h2 mat-dialog-title [innerHTML]=\"data().title\"></h2>\r\n}\r\n\r\n<mat-dialog-content>\r\n @if (data().message) {\r\n <div [innerHTML]=\"data().message\"></div>\r\n }\r\n\r\n @if (dialogType() === DialogType.Input) {\r\n <mat-form-field>\r\n <textarea matInput [placeholder]=\"data().placeholder ?? ''\" [(ngModel)]=\"userInput\"></textarea>\r\n </mat-form-field>\r\n }\r\n\r\n @if (data().checkboxMessage) {\r\n <div id=\"checkbox\">\r\n <mat-checkbox [(ngModel)]=\"checkboxValue\">\r\n <span [innerHTML]=\"data().checkboxMessage\"></span>\r\n </mat-checkbox>\r\n </div>\r\n }\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n @if (dialogType() !== DialogType.Choice) {\r\n <button mat-raised-button (click)=\"close()\" [disabled]=\"dialogType() === DialogType.Input && !userInput\">\r\n <span>\r\n @switch (data().mode) {\r\n @case (ConfirmationDialogMode.YesNo) {\r\n <span>Yes</span>\r\n }\r\n @case (ConfirmationDialogMode.TrueFalse) {\r\n <span>True</span>\r\n }\r\n @case (ConfirmationDialogMode.Custom) {\r\n <span>{{ customTrueText }}</span>\r\n }\r\n @default {\r\n <span>OK</span>\r\n }\r\n }\r\n </span>\r\n </button>\r\n @if (dialogType() !== DialogType.Message) {\r\n <button mat-raised-button (click)=\"cancel()\">\r\n <span>\r\n @switch (data().mode) {\r\n @case (ConfirmationDialogMode.YesNo) {\r\n <span>No</span>\r\n }\r\n @case (ConfirmationDialogMode.TrueFalse) {\r\n <span>False</span>\r\n }\r\n @case (ConfirmationDialogMode.Custom) {\r\n <span>{{ customFalseText }}</span>\r\n }\r\n @default {\r\n <span>Cancel</span>\r\n }\r\n }\r\n </span>\r\n </button>\r\n }\r\n }\r\n\r\n @if (dialogType() === DialogType.Choice) {\r\n @for (choice of choices; track choice; let i = $index) {\r\n <button mat-raised-button [matDialogClose]=\"i\">\r\n <span>{{ choice }}</span>\r\n </button>\r\n }\r\n }\r\n</mat-dialog-actions>","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\r\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\r\n\r\nimport { DialogChoiceData } from '../../model/dialog-choice-data';\r\nimport { DialogType } from '../../model/dialog-type';\r\nimport { BaseComponent } from '../base/base.component';\r\n\r\n@Component({\r\n selector: 'cp-dialog-choice',\r\n templateUrl: './choice.component.html',\r\n styleUrl: './choice.component.scss',\r\n imports: [BaseComponent],\r\n changeDetection: ChangeDetectionStrategy.Eager,\r\n standalone: true,\r\n})\r\nexport class ChoiceComponent {\r\n services = {\r\n data: inject<DialogChoiceData>(MAT_DIALOG_DATA),\r\n dialogRef: inject(MatDialogRef<ChoiceComponent>),\r\n };\r\n\r\n dialogType = DialogType.Choice;\r\n}\r\n","<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\r\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\r\n\r\nimport { DialogBaseData } from '../../model/dialog-base-data';\r\nimport { DialogType } from '../../model/dialog-type';\r\nimport { BaseComponent } from '../base/base.component';\r\n\r\n@Component({\r\n selector: 'cp-dialog-confirmation',\r\n templateUrl: './confirmation.component.html',\r\n styleUrl: './confirmation.component.scss',\r\n imports: [BaseComponent],\r\n changeDetection: ChangeDetectionStrategy.Eager,\r\n standalone: true,\r\n})\r\nexport class ConfirmationComponent {\r\n services = {\r\n data: inject<DialogBaseData>(MAT_DIALOG_DATA),\r\n dialogRef: inject(MatDialogRef<ConfirmationComponent>),\r\n };\r\n\r\n dialogType = DialogType.Confirmation;\r\n}\r\n","<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\r\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\r\n\r\nimport { DialogBaseData } from '../../model/dialog-base-data';\r\nimport { DialogType } from '../../model/dialog-type';\r\nimport { BaseComponent } from '../base/base.component';\r\n\r\n@Component({\r\n selector: 'cp-dialog-input',\r\n templateUrl: './input.component.html',\r\n styleUrl: './input.component.scss',\r\n imports: [BaseComponent],\r\n changeDetection: ChangeDetectionStrategy.Eager,\r\n standalone: true,\r\n})\r\nexport class InputComponent {\r\n services = {\r\n data: inject<DialogBaseData>(MAT_DIALOG_DATA),\r\n dialogRef: inject(MatDialogRef<InputComponent>),\r\n };\r\n\r\n dialogType = DialogType.Input;\r\n}\r\n","<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>","import { Component, inject, ChangeDetectionStrategy } from '@angular/core';\r\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\r\n\r\nimport { DialogBaseData } from '../../model/dialog-base-data';\r\nimport { DialogType } from '../../model/dialog-type';\r\nimport { BaseComponent } from '../base/base.component';\r\n\r\n@Component({\r\n selector: 'cp-dialog-message',\r\n templateUrl: './message.component.html',\r\n styleUrl: './message.component.scss',\r\n imports: [BaseComponent],\r\n changeDetection: ChangeDetectionStrategy.Eager,\r\n standalone: true,\r\n})\r\nexport class MessageComponent {\r\n services = {\r\n data: inject<DialogBaseData>(MAT_DIALOG_DATA),\r\n dialogRef: inject(MatDialogRef<MessageComponent>),\r\n };\r\n\r\n dialogType = DialogType.Message;\r\n}\r\n","<cp-dialog-base\r\n [data]=\"services.data\"\r\n [dialogType]=\"dialogType\"\r\n (closed)=\"services.dialogRef.close($event)\">\r\n</cp-dialog-base>","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\n\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatCheckboxModule } from '@angular/material/checkbox';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatInputModule } from '@angular/material/input';\r\n\r\nimport { BaseComponent } from './components/base/base.component';\r\nimport { ChoiceComponent } from './components/choice/choice.component';\r\nimport { ConfirmationComponent } from './components/confirmation/confirmation.component';\r\nimport { InputComponent } from './components/input/input.component';\r\nimport { MessageComponent } from './components/message/message.component';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n\r\n MatButtonModule,\r\n MatCheckboxModule,\r\n MatDialogModule,\r\n MatFormFieldModule,\r\n MatInputModule,\r\n\r\n BaseComponent,\r\n ChoiceComponent,\r\n ConfirmationComponent,\r\n InputComponent,\r\n MessageComponent\r\n ],\r\n exports: [\r\n BaseComponent,\r\n ChoiceComponent,\r\n ConfirmationComponent,\r\n InputComponent,\r\n MessageComponent\r\n ]\r\n})\r\nexport class DialogModule { }\r\n","export * from './model/confirmation-dialog-mode';\r\nexport * from './model/dialog-base-data';\r\nexport * from './model/dialog-type';\r\n\r\nexport * from './components/base/base.component';\r\nexport * from './components/choice/choice.component';\r\nexport * from './components/confirmation/confirmation.component';\r\nexport * from './components/input/input.component';\r\nexport * from './components/message/message.component';\r\n\r\nexport * from './dialog.module';\r\n\r\n/*export const CP_DIALOG_COMPONENTS = [\r\n ChoiceComponent,\r\n ConfirmationComponent,\r\n InputComponent,\r\n MessageComponent\r\n] as const;*/\r\n\r\n/*export const CP_DIALOG_ENUMS = {\r\n ConfirmationDialogMode,\r\n DialogType\r\n } as const;*/","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './dialog.api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,sBAAsB,EAAA;AAC9B,IAAA,sBAAA,CAAA,sBAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAQ;AACR,IAAA,sBAAA,CAAA,sBAAA,CAAA,OA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e;wBACf,qBAAqB;wBACrB,cAAc;wBACd;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,aAAa;wBACb,eAAe;wBACf,qBAAqB;wBACrB,cAAc;wBACd;AACD;AACF,iBAAA;;;AC7BD;;;;;AAKa;AAEb;;;AAGc;;ACtBd;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleavelandprice-ngx-lib-msgraph.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/msgraph/src/model/room.ts","../../../../projects/cleavelandprice/ngx-lib/msgraph/src/model/user.ts","../../../../projects/cleavelandprice/ngx-lib/msgraph/src/msgraph.module.ts","../../../../projects/cleavelandprice/ngx-lib/msgraph/src/cleavelandprice-ngx-lib-msgraph.ts"],"sourcesContent":["import { Address } from \"./address\";\r\nimport { Coordinates } from \"./coordinates\";\r\n\r\nexport interface Room {\r\n address: Address;\r\n audioDeviceName: string;\r\n bookingType: number;\r\n building: string;\r\n capacity: number;\r\n displayDeviceName: string;\r\n emailAddress: string;\r\n floorLabel: string;\r\n floorNumber: number;\r\n geoCoordinates: Coordinates;\r\n isWheelChairAccessible: boolean;\r\n label: string;\r\n nickname: string;\r\n videoDeviceName: string;\r\n displayName: string;\r\n phone: string;\r\n id: string;\r\n oDataType: string;\r\n}\r\n\r\n/*\r\n additionalData :\r\n tags : {}\r\n*/","export interface User {\r\n city: string;\r\n createdDateTime: string; //Date;\r\n department: string;\r\n displayName: string;\r\n faxNumber: string;\r\n givenName: string;\r\n id: string;\r\n jobTitle: string;\r\n lastPasswordChangeDateTime: string; //Date;\r\n mail: string;\r\n mobilePhone: string;\r\n oDataType: string;\r\n onPremisesDistinguishedName: string;\r\n onPremisesDomainName: string;\r\n onPremisesImmutableId: string;\r\n onPremisesLastSyncDateTime: string; //Date;\r\n onPremisesSamAccountName: string;\r\n onPremisesSecurityIdentifier: string;\r\n onPremisesSyncEnabled: boolean;\r\n onPremisesUserPrincipalName: string;\r\n postalCode: string;\r\n securityIdentifier: string;\r\n state: string;\r\n streetAddress: string;\r\n surname: string;\r\n userPrincipalName: string;\r\n userType: string;\r\n}\r\n\r\n/*\r\naccountEnabled :\r\nageGroup :\r\nassignedLicenses :\r\nassignedPlans :\r\nauthorizationInfo :\r\nbusinessPhones :\r\ncompanyName :\r\nconsentProvidedForMinor :\r\ncountry :\r\ncreationType :\r\nemployeeHireDate :\r\nemployeeId :\r\nemployeeOrgData :\r\nemployeeType :\r\nexternalUserState :\r\nexternalUserStateChangeDateTime :\r\nidentities :\r\nimAddresses :\r\nisResourceAccount :\r\nlegalAgeGroupClassification :\r\nlicenseAssignmentStates :\r\nmailNickname :\r\nofficeLocation :\r\nonPremisesExtensionAttributes : @{extensionAttribute1=DBR; extensionAttribute10=; extensionAttribute11=; extensionAttribute12=; extensionAttribute13=; extensionAttribute14=; extensionAttribute15=; extensionAttribute2=; extensionAttribute3=; extensionAttribute4=;\r\n extensionAttribute5=; extensionAttribute6=; extensionAttribute7=; extensionAttribute8=; extensionAttribute9=; additionalData=; oDataType=}\r\nonPremisesProvisioningErrors :\r\notherMails :\r\npasswordPolicies : DisablePasswordExpiration\r\npasswordProfile :\r\npreferredDataLocation :\r\npreferredLanguage :\r\nprovisionedPlans :\r\nproxyAddresses :\r\nshowInAddressList :\r\nsignInSessionsValidFromDateTime :\r\nusageLocation :\r\nmailboxSettings :\r\ndeviceEnrollmentLimit :\r\naboutMe :\r\nbirthday :\r\nhireDate :\r\ninterests :\r\nmySite :\r\npastProjects :\r\npreferredName :\r\nresponsibilities :\r\nschools :\r\nskills :\r\nappRoleAssignments :\r\nappRoleAssignmentsNextLink :\r\ncreatedObjects :\r\ncreatedObjectsNextLink :\r\ndirectReports :\r\ndirectReportsNextLink :\r\nlicenseDetails :\r\nlicenseDetailsNextLink :\r\nmanager :\r\nmemberOf :\r\nmemberOfNextLink :\r\noauth2PermissionGrants :\r\noauth2PermissionGrantsNextLink :\r\nownedDevices :\r\nownedDevicesNextLink :\r\nownedObjects :\r\nownedObjectsNextLink :\r\nregisteredDevices :\r\nregisteredDevicesNextLink :\r\nscopedRoleMemberOf :\r\nscopedRoleMemberOfNextLink :\r\ntransitiveMemberOf :\r\ntransitiveMemberOfNextLink : \r\ncalendar :\r\ncalendarGroups :\r\ncalendarGroupsNextLink :\r\ncalendars :\r\ncalendarsNextLink :\r\ncalendarView :\r\ncalendarViewNextLink :\r\ncontactFolders :\r\ncontactFoldersNextLink :\r\ncontacts :\r\ncontactsNextLink :\r\nevents :\r\neventsNextLink :\r\ninferenceClassification :\r\nmailFolders :\r\nmailFoldersNextLink :\r\nmessages :\r\nmessagesNextLink :\r\noutlook :\r\npeople :\r\npeopleNextLink :\r\ndrive :\r\ndrives :\r\ndrivesNextLink :\r\nfollowedSites :\r\nfollowedSitesNextLink :\r\nextensions :\r\nextensionsNextLink :\r\nagreementAcceptances :\r\nagreementAcceptancesNextLink :\r\nmanagedDevices :\r\nmanagedDevicesNextLink :\r\nmanagedAppRegistrations :\r\nmanagedAppRegistrationsNextLink :\r\ndeviceManagementTroubleshootingEvents :\r\ndeviceManagementTroubleshootingEventsNextLink :\r\nplanner :\r\ninsights :\r\nsettings :\r\nonenote :\r\nphoto :\r\nphotos :\r\nphotosNextLink :\r\nactivities :\r\nactivitiesNextLink :\r\nonlineMeetings :\r\nonlineMeetingsNextLink :\r\npresence :\r\nauthentication :\r\nchats :\r\nchatsNextLink :\r\njoinedTeams :\r\njoinedTeamsNextLink :\r\nteamwork :\r\ntodo :\r\ndeletedDateTime :\r\nadditionalData :\r\n*/","import { CommonModule } from '@angular/common';\nimport { NgModule, Optional, SkipSelf } from '@angular/core';\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule\n ]\n})\nexport class MSGraphModule {\n constructor(@Optional() @SkipSelf() parentModule: MSGraphModule) {\n if (parentModule) {\n throw new Error(\n 'MSGraphModule is already loaded. Import it in the AppModule only');\n }\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './msgraph.api';\n"],"names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ts","../../../../projects/cleavelandprice/ngx-lib/msgraph/src/model/user.ts","../../../../projects/cleavelandprice/ngx-lib/msgraph/src/msgraph.module.ts","../../../../projects/cleavelandprice/ngx-lib/msgraph/src/cleavelandprice-ngx-lib-msgraph.ts"],"sourcesContent":["import { Address } from \"./address\";\r\nimport { Coordinates } from \"./coordinates\";\r\n\r\nexport interface Room {\r\n address: Address;\r\n audioDeviceName: string;\r\n bookingType: number;\r\n building: string;\r\n capacity: number;\r\n displayDeviceName: string;\r\n emailAddress: string;\r\n floorLabel: string;\r\n floorNumber: number;\r\n geoCoordinates: Coordinates;\r\n isWheelChairAccessible: boolean;\r\n label: string;\r\n nickname: string;\r\n videoDeviceName: string;\r\n displayName: string;\r\n phone: string;\r\n id: string;\r\n oDataType: string;\r\n}\r\n\r\n/*\r\n additionalData :\r\n tags : {}\r\n*/","export interface User {\r\n city: string;\r\n createdDateTime: string; //Date;\r\n department: string;\r\n displayName: string;\r\n faxNumber: string;\r\n givenName: string;\r\n id: string;\r\n jobTitle: string;\r\n lastPasswordChangeDateTime: string; //Date;\r\n mail: string;\r\n mobilePhone: string;\r\n oDataType: string;\r\n onPremisesDistinguishedName: string;\r\n onPremisesDomainName: string;\r\n onPremisesImmutableId: string;\r\n onPremisesLastSyncDateTime: string; //Date;\r\n onPremisesSamAccountName: string;\r\n onPremisesSecurityIdentifier: string;\r\n onPremisesSyncEnabled: boolean;\r\n onPremisesUserPrincipalName: string;\r\n postalCode: string;\r\n securityIdentifier: string;\r\n state: string;\r\n streetAddress: string;\r\n surname: string;\r\n userPrincipalName: string;\r\n userType: string;\r\n}\r\n\r\n/*\r\naccountEnabled :\r\nageGroup :\r\nassignedLicenses :\r\nassignedPlans :\r\nauthorizationInfo :\r\nbusinessPhones :\r\ncompanyName :\r\nconsentProvidedForMinor :\r\ncountry :\r\ncreationType :\r\nemployeeHireDate :\r\nemployeeId :\r\nemployeeOrgData :\r\nemployeeType :\r\nexternalUserState :\r\nexternalUserStateChangeDateTime :\r\nidentities :\r\nimAddresses :\r\nisResourceAccount :\r\nlegalAgeGroupClassification :\r\nlicenseAssignmentStates :\r\nmailNickname :\r\nofficeLocation :\r\nonPremisesExtensionAttributes : @{extensionAttribute1=DBR; extensionAttribute10=; extensionAttribute11=; extensionAttribute12=; extensionAttribute13=; extensionAttribute14=; extensionAttribute15=; extensionAttribute2=; extensionAttribute3=; extensionAttribute4=;\r\n extensionAttribute5=; extensionAttribute6=; extensionAttribute7=; extensionAttribute8=; extensionAttribute9=; additionalData=; oDataType=}\r\nonPremisesProvisioningErrors :\r\notherMails :\r\npasswordPolicies : DisablePasswordExpiration\r\npasswordProfile :\r\npreferredDataLocation :\r\npreferredLanguage :\r\nprovisionedPlans :\r\nproxyAddresses :\r\nshowInAddressList :\r\nsignInSessionsValidFromDateTime :\r\nusageLocation :\r\nmailboxSettings :\r\ndeviceEnrollmentLimit :\r\naboutMe :\r\nbirthday :\r\nhireDate :\r\ninterests :\r\nmySite :\r\npastProjects :\r\npreferredName :\r\nresponsibilities :\r\nschools :\r\nskills :\r\nappRoleAssignments :\r\nappRoleAssignmentsNextLink :\r\ncreatedObjects :\r\ncreatedObjectsNextLink :\r\ndirectReports :\r\ndirectReportsNextLink :\r\nlicenseDetails :\r\nlicenseDetailsNextLink :\r\nmanager :\r\nmemberOf :\r\nmemberOfNextLink :\r\noauth2PermissionGrants :\r\noauth2PermissionGrantsNextLink :\r\nownedDevices :\r\nownedDevicesNextLink :\r\nownedObjects :\r\nownedObjectsNextLink :\r\nregisteredDevices :\r\nregisteredDevicesNextLink :\r\nscopedRoleMemberOf :\r\nscopedRoleMemberOfNextLink :\r\ntransitiveMemberOf :\r\ntransitiveMemberOfNextLink : \r\ncalendar :\r\ncalendarGroups :\r\ncalendarGroupsNextLink :\r\ncalendars :\r\ncalendarsNextLink :\r\ncalendarView :\r\ncalendarViewNextLink :\r\ncontactFolders :\r\ncontactFoldersNextLink :\r\ncontacts :\r\ncontactsNextLink :\r\nevents :\r\neventsNextLink :\r\ninferenceClassification :\r\nmailFolders :\r\nmailFoldersNextLink :\r\nmessages :\r\nmessagesNextLink :\r\noutlook :\r\npeople :\r\npeopleNextLink :\r\ndrive :\r\ndrives :\r\ndrivesNextLink :\r\nfollowedSites :\r\nfollowedSitesNextLink :\r\nextensions :\r\nextensionsNextLink :\r\nagreementAcceptances :\r\nagreementAcceptancesNextLink :\r\nmanagedDevices :\r\nmanagedDevicesNextLink :\r\nmanagedAppRegistrations :\r\nmanagedAppRegistrationsNextLink :\r\ndeviceManagementTroubleshootingEvents :\r\ndeviceManagementTroubleshootingEventsNextLink :\r\nplanner :\r\ninsights :\r\nsettings :\r\nonenote :\r\nphoto :\r\nphotos :\r\nphotosNextLink :\r\nactivities :\r\nactivitiesNextLink :\r\nonlineMeetings :\r\nonlineMeetingsNextLink :\r\npresence :\r\nauthentication :\r\nchats :\r\nchatsNextLink :\r\njoinedTeams :\r\njoinedTeamsNextLink :\r\nteamwork :\r\ntodo :\r\ndeletedDateTime :\r\nadditionalData :\r\n*/","import { CommonModule } from '@angular/common';\r\nimport { NgModule, Optional, SkipSelf } from '@angular/core';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule\r\n ]\r\n})\r\nexport class MSGraphModule {\r\n constructor(@Optional() @SkipSelf() parentModule: MSGraphModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'MSGraphModule 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 './msgraph.api';\n"],"names":[],"mappings":";;;;AAwBA;;;AAGE;;ACGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiIE;;MCtJW,aAAa,CAAA;AACxB,IAAA,WAAA,CAAoC,YAA2B,EAAA;QAC7D,IAAI,YAAY,EAAE;AAChB,YAAA,MAAM,IAAI,KAAK,CACb,kEAAkE,CAAC;QACvE;IACF;8GANW,aAAa,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAb,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,aAAa,YAHtB,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,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,aAAa,YAHtB,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGH,aAAa,EAAA,UAAA,EAAA,CAAA;kBANzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP;AACD;AACF,iBAAA;;0BAEc;;0BAAY;;;ACV3B;;AAEG;;;;"}
|