quang 21.0.1 → 21.1.1

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.
Files changed (35) hide show
  1. package/components/tabs/README.md +399 -0
  2. package/fesm2022/quang-auth.mjs.map +1 -1
  3. package/fesm2022/quang-components-date.mjs +49 -2
  4. package/fesm2022/quang-components-date.mjs.map +1 -1
  5. package/fesm2022/quang-components-paginator.mjs +13 -10
  6. package/fesm2022/quang-components-paginator.mjs.map +1 -1
  7. package/fesm2022/quang-components-shared.mjs +2 -1
  8. package/fesm2022/quang-components-shared.mjs.map +1 -1
  9. package/fesm2022/quang-components-table.mjs.map +1 -1
  10. package/fesm2022/quang-components-tabs.mjs +61 -0
  11. package/fesm2022/quang-components-tabs.mjs.map +1 -0
  12. package/fesm2022/quang-components-wysiwyg.mjs.map +1 -1
  13. package/fesm2022/quang-forms.mjs +1 -1
  14. package/fesm2022/quang-forms.mjs.map +1 -1
  15. package/fesm2022/quang-overlay-modal.mjs +7 -8
  16. package/fesm2022/quang-overlay-modal.mjs.map +1 -1
  17. package/fesm2022/quang-overlay-popover.mjs.map +1 -1
  18. package/fesm2022/quang-overlay-shared.mjs.map +1 -1
  19. package/fesm2022/quang-overlay-toast.mjs +4 -1
  20. package/fesm2022/quang-overlay-toast.mjs.map +1 -1
  21. package/fesm2022/quang-overlay-tooltip.mjs.map +1 -1
  22. package/package.json +5 -1
  23. package/types/quang-auth.d.ts +4 -4
  24. package/types/quang-components-date.d.ts +2 -0
  25. package/types/quang-components-paginator.d.ts +4 -5
  26. package/types/quang-components-shared.d.ts +4 -5
  27. package/types/quang-components-table.d.ts +6 -6
  28. package/types/quang-components-tabs.d.ts +29 -0
  29. package/types/quang-components-wysiwyg.d.ts +2 -2
  30. package/types/quang-forms.d.ts +10 -10
  31. package/types/quang-overlay-modal.d.ts +1 -3
  32. package/types/quang-overlay-popover.d.ts +5 -5
  33. package/types/quang-overlay-shared.d.ts +10 -10
  34. package/types/quang-overlay-toast.d.ts +1 -1
  35. package/types/quang-overlay-tooltip.d.ts +2 -2
@@ -0,0 +1,399 @@
1
+ # QuangTabsComponent
2
+
3
+ The `QuangTabsComponent` is a flexible tabs navigation component that provides seamless tab switching, support for disabled states, custom templates, and full integration with Angular reactive forms. It supports both standard tabs and custom-rendered tabs with extensive customization options.
4
+
5
+ ## Inputs
6
+
7
+ - `tabs`: `TabConfiguration[]` — Array of tab configurations. Each tab must have an `id` and `label`, and can optionally include `disabled` state or a custom `renderer`. **(Required)**
8
+ - `tabsOrientation`: `TabsOrientation` — Controls tab alignment. `TabsOrientation.Horizontal` (default) renders tabs in a row, while `TabsOrientation.Vertical` stacks tabs in a column
9
+ - `isReadonly`: `boolean` — Set component to read-only mode. When true, all tabs become non-interactive. Inherited from `QuangBaseComponent`
10
+ - `componentTabIndex`: `number` — Tab index for accessibility. Inherited from `QuangBaseComponent`
11
+ - `componentClass`: `string | string[]` — Additional CSS classes. Inherited from `QuangBaseComponent`
12
+ - `formControl`: `FormControl` — Form control for reactive forms. Inherited from `QuangBaseComponent`
13
+
14
+ ## Outputs
15
+
16
+ - `tabChange`: `EventEmitter<string>` — Emitted when the selected tab changes. Provides the `id` of the newly selected tab
17
+ - `componentBlur`: `EventEmitter<void>` — Emitted when component loses focus. Inherited from `QuangBaseComponent`
18
+
19
+ ## TabConfiguration Interface
20
+
21
+ ```typescript
22
+ interface TabConfiguration {
23
+ id: string // Unique identifier for the tab
24
+ label: string // Translation key or label text
25
+ disabled?: boolean // If true, tab is disabled and non-interactive
26
+ renderer?: TemplateRef<any> // Optional custom template for tab rendering
27
+ }
28
+ ```
29
+
30
+ ## TabsOrientation Enum
31
+
32
+ ```typescript
33
+ enum TabsOrientation {
34
+ Horizontal = 'horizontal',
35
+ Vertical = 'vertical',
36
+ }
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ ### Basic Tabs
42
+
43
+ ```html
44
+ <quang-tabs
45
+ [formControl]="selectedTab"
46
+ [tabs]="tabs"
47
+ />
48
+ ```
49
+
50
+ ```typescript
51
+ export class MyComponent {
52
+ selectedTab = new FormControl<string>('home')
53
+
54
+ tabs: TabConfiguration[] = [
55
+ { id: 'home', label: 'navigation.home' },
56
+ { id: 'profile', label: 'navigation.profile' },
57
+ { id: 'settings', label: 'navigation.settings' },
58
+ ]
59
+ }
60
+ ```
61
+
62
+ ### Tabs with Disabled State
63
+
64
+ ```html
65
+ <quang-tabs
66
+ [formControl]="selectedTab"
67
+ [tabs]="tabs"
68
+ />
69
+ ```
70
+
71
+ ```typescript
72
+ export class MyComponent {
73
+ selectedTab = new FormControl<string>('tab1')
74
+
75
+ tabs: TabConfiguration[] = [
76
+ { id: 'tab1', label: 'Enabled Tab' },
77
+ { id: 'tab2', label: 'Disabled Tab', disabled: true },
78
+ { id: 'tab3', label: 'Another Tab' },
79
+ ]
80
+ }
81
+ ```
82
+
83
+ ### Event Handling
84
+
85
+ ```html
86
+ <quang-tabs
87
+ [formControl]="selectedTab"
88
+ [tabs]="tabs"
89
+ (tabChange)="onTabChange($event)"
90
+ />
91
+ ```
92
+
93
+ ```typescript
94
+ export class MyComponent {
95
+ selectedTab = new FormControl<string>('overview')
96
+
97
+ tabs: TabConfiguration[] = [
98
+ { id: 'overview', label: 'Overview' },
99
+ { id: 'details', label: 'Details' },
100
+ { id: 'analytics', label: 'Analytics' },
101
+ ]
102
+
103
+ onTabChange(tabId: string): void {
104
+ console.log('Selected tab:', tabId)
105
+ // Handle tab change logic
106
+ }
107
+ }
108
+ ```
109
+
110
+ ### Tab Content Switching
111
+
112
+ Display different content based on the selected tab using Angular's `@switch` control flow:
113
+
114
+ ```html
115
+ <quang-tabs
116
+ [formControl]="selectedTab"
117
+ [tabs]="tabs"
118
+ />
119
+
120
+ <!-- Content changes based on selected tab -->
121
+ <div class="mt-4">
122
+ @switch (selectedTab.value) { @case ('overview') {
123
+ <div class="card">
124
+ <div class="card-header">
125
+ <h5>Overview</h5>
126
+ </div>
127
+ <div class="card-body">
128
+ <p>Welcome to the overview section!</p>
129
+ <ul>
130
+ <li>Quick statistics</li>
131
+ <li>Recent activity</li>
132
+ </ul>
133
+ </div>
134
+ </div>
135
+ } @case ('details') {
136
+ <div class="card">
137
+ <div class="card-header">
138
+ <h5>Details</h5>
139
+ </div>
140
+ <div class="card-body">
141
+ <table class="table">
142
+ <tbody>
143
+ <tr>
144
+ <td><strong>Name:</strong></td>
145
+ <td>John Doe</td>
146
+ </tr>
147
+ </tbody>
148
+ </table>
149
+ </div>
150
+ </div>
151
+ } @case ('settings') {
152
+ <div class="card">
153
+ <div class="card-header">
154
+ <h5>Settings</h5>
155
+ </div>
156
+ <div class="card-body">
157
+ <form>
158
+ <div class="mb-3">
159
+ <label>Theme</label>
160
+ <select class="form-select">
161
+ <option>Light</option>
162
+ <option>Dark</option>
163
+ </select>
164
+ </div>
165
+ <button
166
+ class="btn btn-primary"
167
+ type="submit"
168
+ >
169
+ Save
170
+ </button>
171
+ </form>
172
+ </div>
173
+ </div>
174
+ } }
175
+ </div>
176
+ ```
177
+
178
+ ```typescript
179
+ export class MyComponent {
180
+ selectedTab = new FormControl<string>('overview')
181
+
182
+ tabs: TabConfiguration[] = [
183
+ { id: 'overview', label: 'Overview' },
184
+ { id: 'details', label: 'Details' },
185
+ { id: 'settings', label: 'Settings' },
186
+ ]
187
+ }
188
+ ```
189
+
190
+ ### Content + Orientation Toggle
191
+
192
+ Use `tabsOrientation` to switch between horizontal and vertical tabs at runtime:
193
+
194
+ ```html
195
+ <div class="form-check form-switch mb-3">
196
+ <input
197
+ [checked]="verticalOrientationEnabled()"
198
+ (change)="toggleOrientation()"
199
+ class="form-check-input"
200
+ id="verticalOrientationToggle"
201
+ type="checkbox"
202
+ />
203
+ <label
204
+ class="form-check-label"
205
+ for="verticalOrientationToggle"
206
+ >
207
+ Vertical alignment
208
+ </label>
209
+ </div>
210
+
211
+ <quang-tabs
212
+ [formControl]="selectedTab"
213
+ [tabs]="tabs"
214
+ [tabsOrientation]="tabsOrientation()"
215
+ />
216
+ ```
217
+
218
+ ```typescript
219
+ export class MyComponent {
220
+ selectedTab = new FormControl<string>('overview')
221
+ verticalOrientationEnabled = signal<boolean>(false)
222
+
223
+ tabsOrientation = computed(() =>
224
+ this.verticalOrientationEnabled() ? TabsOrientation.Vertical : TabsOrientation.Horizontal
225
+ )
226
+
227
+ tabs: TabConfiguration[] = [
228
+ { id: 'overview', label: 'Overview' },
229
+ { id: 'details', label: 'Details' },
230
+ { id: 'settings', label: 'Settings' },
231
+ ]
232
+
233
+ toggleOrientation(): void {
234
+ this.verticalOrientationEnabled.set(!this.verticalOrientationEnabled())
235
+ }
236
+ }
237
+ ```
238
+
239
+ ### Custom Tab Templates
240
+
241
+ ```html
242
+ <ng-template
243
+ #customTabTpl
244
+ let-selected="selected"
245
+ let-tab
246
+ >
247
+ <button
248
+ [class.selected]="selected"
249
+ class="flex-grow-1 btn btn-only-text custom-tab"
250
+ type="button"
251
+ >
252
+ <span class="d-flex gap-2 align-items-center justify-content-center">
253
+ <span>{{ tab.icon }}</span>
254
+ <strong>{{ tab.label | transloco }}</strong>
255
+ @if(selected) {
256
+ <small class="badge bg-primary">Active</small>
257
+ }
258
+ </span>
259
+ </button>
260
+ </ng-template>
261
+
262
+ <quang-tabs
263
+ [formControl]="selectedTab"
264
+ [tabs]="tabs"
265
+ />
266
+ ```
267
+
268
+ ```typescript
269
+ export class MyComponent {
270
+ private readonly customTabTpl = viewChild<TemplateRef<any>>('customTabTpl')
271
+ selectedTab = new FormControl<string>('dashboard')
272
+
273
+ get tabs(): TabConfiguration[] {
274
+ return [
275
+ {
276
+ id: 'dashboard',
277
+ label: 'Dashboard',
278
+ renderer: this.customTabTpl(),
279
+ },
280
+ {
281
+ id: 'messages',
282
+ label: 'Messages',
283
+ renderer: this.customTabTpl(),
284
+ },
285
+ ]
286
+ }
287
+ }
288
+ ```
289
+
290
+ ### Form Integration with Validation
291
+
292
+ ```html
293
+ <form [formGroup]="form">
294
+ <quang-tabs
295
+ [tabs]="tabs"
296
+ formControlName="selectedSection"
297
+ />
298
+ </form>
299
+ ```
300
+
301
+ ```typescript
302
+ export class MyComponent {
303
+ form = this.fb.group({
304
+ selectedSection: [null, Validators.required],
305
+ })
306
+
307
+ tabs: TabConfiguration[] = [
308
+ { id: 'section1', label: 'Section 1' },
309
+ { id: 'section2', label: 'Section 2' },
310
+ { id: 'section3', label: 'Section 3' },
311
+ ]
312
+ }
313
+ ```
314
+
315
+ ### Readonly Mode
316
+
317
+ ```html
318
+ <quang-tabs
319
+ [formControl]="selectedTab"
320
+ [isReadonly]="isReadonly()"
321
+ [tabs]="tabs"
322
+ />
323
+
324
+ <button (click)="toggleReadonly()">Toggle Readonly</button>
325
+ ```
326
+
327
+ ```typescript
328
+ export class MyComponent {
329
+ selectedTab = new FormControl<string>('tab1')
330
+ isReadonly = signal<boolean>(false)
331
+
332
+ tabs: TabConfiguration[] = [
333
+ { id: 'tab1', label: 'Tab 1' },
334
+ { id: 'tab2', label: 'Tab 2' },
335
+ { id: 'tab3', label: 'Tab 3' },
336
+ ]
337
+
338
+ toggleReadonly(): void {
339
+ this.isReadonly.set(!this.isReadonly())
340
+ }
341
+ }
342
+ ```
343
+
344
+ ## Translation Integration
345
+
346
+ The component uses QuangTranslationService for all text content:
347
+
348
+ - **Automatic Translation**: All tab labels and messages are automatically translated using Transloco
349
+ - **Key Support**: Use translation keys for tab labels for multi-language support
350
+ - **Fallback Handling**: Provides graceful fallback when translations are unavailable
351
+ - **Dynamic Language**: Responds to language changes without component reload
352
+
353
+ ## Custom Template Context
354
+
355
+ When using custom templates, the following context is available:
356
+
357
+ ```typescript
358
+ interface QuangTabTemplateContext {
359
+ $implicit: TabConfiguration // The tab configuration object
360
+ selected: boolean // Whether this tab is currently selected
361
+ index: number // The index of the tab in the array
362
+ }
363
+ ```
364
+
365
+ Example usage in template:
366
+
367
+ ```html
368
+ <ng-template
369
+ #tabTpl
370
+ let-index="index"
371
+ let-selected="selected"
372
+ let-tab
373
+ >
374
+ <!-- tab: TabConfiguration -->
375
+ <!-- selected: boolean -->
376
+ <!-- index: number -->
377
+ <div>{{ tab.label }} - Position {{ index + 1 }}</div>
378
+ </ng-template>
379
+ ```
380
+
381
+ ## Styling
382
+
383
+ The component uses Bootstrap 5.3 classes for styling. The default tabs have:
384
+
385
+ - Bottom border that becomes thicker (4px) when selected
386
+ - Smooth transitions on state changes
387
+ - Disabled state with reduced opacity
388
+ - Hover effects on interactive tabs
389
+
390
+ You can customize styling using the `componentClass` input or by targeting the component's CSS classes.
391
+
392
+ ## Notes
393
+
394
+ - Extends `QuangBaseComponent` for consistent behavior across all Quang components
395
+ - Supports Angular reactive forms with `ControlValueAccessor`
396
+ - Fully compatible with Angular's form validation
397
+ - Styled based on Bootstrap v5.3
398
+ - Supports both translation keys and direct text for labels
399
+ - Individual tabs can be disabled independently of the form control state
@@ -1 +1 @@
1
- {"version":3,"file":"quang-auth.mjs","sources":["../../../projects/quang/auth/auth.service.ts","../../../projects/quang/auth/auth-providers.ts","../../../projects/quang/auth/directives/has-at-least-one-role.directive.ts","../../../projects/quang/auth/directives/has-every-role.directive.ts","../../../projects/quang/auth/directives/is-authenticated.directive.ts","../../../projects/quang/auth/directives/is-not-authenticated.directive.ts","../../../projects/quang/auth/guards/is-allowed.guard.ts","../../../projects/quang/auth/guards/is-authenticated.guard.ts","../../../projects/quang/auth/logout-on-error.interceptor.ts","../../../projects/quang/auth/token-storage/local-storage-feature.ts","../../../projects/quang/auth/token-storage/memory-storage-feature.ts","../../../projects/quang/auth/token-storage/session-storage-feature.ts","../../../projects/quang/auth/quang-auth.ts"],"sourcesContent":["import {\n EnvironmentProviders,\n Injectable,\n InjectionToken,\n computed,\n inject,\n makeEnvironmentProviders,\n} from '@angular/core'\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop'\n\nimport { patchState, signalState } from '@ngrx/signals'\n\nimport { AuthConfig, OAuthErrorEvent, OAuthEvent, OAuthService } from 'angular-oauth2-oidc'\nimport { QUANG_LOGGING_BEHAVIOR } from 'quang'\nimport { filter, firstValueFrom } from 'rxjs'\n\nexport const AUTH_CONFIG = new InjectionToken<QuangAuthConfig | undefined>('AUTH_CONFIG')\n\nexport interface QuangAuthConfig extends AuthConfig {\n autoLogin: boolean\n sendAccessToken: boolean\n urlsToSendToken: string[]\n revokeTokensOnLogout?: boolean\n getUserProfileOnLoginSuccess?: boolean\n useSilentRefresh: boolean\n}\n\nexport function provideQuangAuthConfig(authConfig?: QuangAuthConfig): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: AUTH_CONFIG, useValue: authConfig }])\n}\n\nexport const OPEN_URI = new InjectionToken<(uri: string) => void | undefined>('OPEN_URI')\n\nexport function provideOpenURI(openURI: (uri: string) => void | undefined): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: OPEN_URI, deps: [], useFactory: openURI }])\n}\n\ninterface LoginStatus {\n checked: boolean\n authenticationError: boolean\n}\n\ninterface TokenStatus {\n accessToken: string | null\n accessTokenExpiresAt: number | null\n idToken: string | null\n idTokenExpiresAt: number | null\n refreshToken: string | null\n}\n\ninterface AuthState {\n loginStatus: LoginStatus\n tokenStatus: TokenStatus\n roles: Set<string>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n user: Record<string, any> | null\n}\n\nconst initialState: AuthState = {\n loginStatus: {\n checked: false,\n authenticationError: false,\n },\n tokenStatus: {\n accessToken: null,\n accessTokenExpiresAt: null,\n idToken: null,\n idTokenExpiresAt: null,\n refreshToken: null,\n },\n roles: new Set<string>(),\n user: null,\n}\n\n// Subset of situations from https://openid.net/specs/openid-connect-core-1_0.html#AuthError\n// Only the ones where it's reasonably sure that sending the user to the IdServer will help.\nconst errorResponsesRequiringUserInteraction = [\n 'interaction_required',\n 'login_required',\n 'account_selection_required',\n 'consent_required',\n]\n\n@Injectable({\n providedIn: 'root',\n})\nexport class QuangAuthService {\n private config: QuangAuthConfig\n\n logLevel = inject(QUANG_LOGGING_BEHAVIOR, { optional: true })\n\n private oAuthService = inject(OAuthService, { optional: true })\n\n private state = signalState<AuthState>(initialState)\n\n loginChecked = this.state.loginStatus.checked\n\n isAuthenticated = computed(() => !!this.state.tokenStatus.accessToken())\n\n authenticationError = this.state.loginStatus.authenticationError\n\n tokenStatus = this.state.tokenStatus\n\n roles = this.state.roles\n\n user = this.state.user\n\n constructor() {\n const authConfig = inject(AUTH_CONFIG)\n if (!authConfig) throw new Error('Missing auth config')\n\n const openUri = inject(OPEN_URI, { optional: true })\n if (openUri) authConfig.openUri = openUri\n\n this.config = authConfig\n\n this.oAuthService?.events.pipe(takeUntilDestroyed()).subscribe((event: OAuthEvent) => {\n if (this.logLevel === 'verbose') console.debug('Auth service event', event)\n if (event instanceof OAuthErrorEvent && this.loginChecked()) this.loginError()\n if (event.type === 'token_received') this.setTokens()\n })\n this.oAuthService?.configure(this.config)\n }\n\n public async init() {\n this.oAuthService?.setupAutomaticSilentRefresh()\n\n await this.oAuthService?.loadDiscoveryDocumentAndTryLogin()\n\n await this.checkForAuthentication()\n\n if (this.config.autoLogin && !this.isAuthenticated()) this.login()\n }\n\n public async checkForAuthentication(forceRefresh = false) {\n let hasValidToken = this.oAuthService?.hasValidAccessToken()\n\n try {\n if (forceRefresh) hasValidToken = await this.refreshAuth()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n const reason = error?.reason\n if (this.config.autoLogin && reason && errorResponsesRequiringUserInteraction.includes(reason)) this.login()\n hasValidToken = false\n }\n\n this.setTokens()\n patchState(this.state, {\n loginStatus: {\n ...this.state().loginStatus,\n checked: true,\n },\n })\n\n if (hasValidToken && this.config.getUserProfileOnLoginSuccess) await this.getUserProfile()\n\n return hasValidToken\n }\n\n private async refreshAuth() {\n if (this.config.responseType === 'code') await this.oAuthService?.refreshToken()\n else await this.oAuthService?.silentRefresh()\n return this.oAuthService?.hasValidAccessToken()\n }\n\n public login() {\n this.oAuthService?.initLoginFlow()\n }\n\n public async logout() {\n if (!this.isAuthenticated()) return\n if (this.config.revokeTokensOnLogout) await this.oAuthService?.revokeTokenAndLogout()\n else this.oAuthService?.logOut()\n patchState(this.state, { ...initialState })\n }\n\n private loginError() {\n patchState(this.state, {\n loginStatus: {\n ...this.state().loginStatus,\n authenticationError: true,\n },\n })\n this.logout()\n }\n\n public async getUserProfile() {\n const user = await this.oAuthService?.loadUserProfile()\n if (user) patchState(this.state, { user })\n }\n\n private setTokens() {\n const tokenStatus = {\n accessToken: this.oAuthService?.getAccessToken() ?? null,\n accessTokenExpiresAt: this.oAuthService?.getAccessTokenExpiration() ?? null,\n idToken: this.oAuthService?.getIdToken() ?? null,\n idTokenExpiresAt: this.oAuthService?.getIdTokenExpiration() ?? null,\n refreshToken: this.oAuthService?.getRefreshToken() ?? null,\n }\n if (this.logLevel === 'verbose') {\n const now = new Date()\n const accessTokenDate = new Date(tokenStatus.accessTokenExpiresAt ?? '')\n const idTokenDate = new Date(tokenStatus.idTokenExpiresAt ?? '')\n console.table(tokenStatus)\n console.debug(\n `Id token expires at ${idTokenDate} in ${Math.abs(idTokenDate.valueOf() - now.valueOf()) / 1000 / 60} minutes`\n )\n console.debug(\n `Access token expires at ${accessTokenDate} in ${Math.abs(accessTokenDate.valueOf() - now.valueOf()) / 1000 / 60} minutes`\n )\n }\n patchState(this.state, {\n tokenStatus,\n })\n }\n\n async waitForLoginCheck(): Promise<void> {\n await firstValueFrom(toObservable(this.loginChecked).pipe(filter((checked) => checked)))\n }\n\n async getAuthResult(): Promise<boolean> {\n await this.waitForLoginCheck()\n return this.isAuthenticated()\n }\n\n addRoles(rolesToAdd: string[]) {\n patchState(this.state, { roles: new Set([...this.state.roles().values(), ...rolesToAdd]) })\n }\n\n removeRoles(rolesToRemove: string[]) {\n const newRoles = new Set(this.roles().values())\n for (const roleToRemove of rolesToRemove) {\n newRoles.delete(roleToRemove)\n }\n patchState(this.state, { roles: newRoles })\n }\n\n hasEveryRole(roles: string[]) {\n return roles.every((role) => this.roles().has(role))\n }\n\n hasAtLeastOneRole(roles: string[]) {\n return roles.some((role) => this.roles().has(role))\n }\n}\n","import { EnvironmentProviders, Provider, inject, makeEnvironmentProviders, provideAppInitializer } from '@angular/core'\n\nimport { provideOAuthClient } from 'angular-oauth2-oidc'\nimport { type QuangFeature, QuangFeatureKind, quangFeature } from 'quang'\n\nimport { type QuangAuthConfig, QuangAuthService, provideQuangAuthConfig } from './auth.service'\n\nfunction initializeAuthService(authService: QuangAuthService) {\n return () => authService.init()\n}\n\nexport function provideAuth(authConfig?: QuangAuthConfig, ...features: QuangAuthFeatures[]): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideQuangAuthConfig(authConfig),\n provideOAuthClient({\n resourceServer: {\n sendAccessToken: authConfig?.sendAccessToken ?? true,\n allowedUrls: authConfig?.urlsToSendToken ?? [],\n },\n }),\n ...features.map((feature) => feature.ɵproviders),\n provideAppInitializer(() => {\n const initializerFn = initializeAuthService(inject(QuangAuthService))\n return initializerFn()\n }),\n ])\n}\n\nexport function withAuth(\n authConfig?: QuangAuthConfig,\n ...features: QuangAuthFeatures[]\n): QuangFeature<QuangFeatureKind.LoaderFeature> {\n return quangFeature(QuangFeatureKind.LoaderFeature, [provideAuth(authConfig, ...features)])\n}\n\n/**\n * Helper type to represent a QuangAuth feature.\n *\n * @publicApi\n */\nexport interface QuangAuthFeature<FeatureKind extends QuangAuthFeatureKind> {\n ɵkind: FeatureKind\n ɵproviders: (Provider | EnvironmentProviders)[]\n}\n\n/**\n * Helper function to create an object that represents a QuangAuth feature.\n */\nexport function quangAuthFeature<FeatureKind extends QuangAuthFeatureKind>(\n kind: FeatureKind,\n providers: (Provider | EnvironmentProviders)[]\n): QuangAuthFeature<FeatureKind> {\n return { ɵkind: kind, ɵproviders: providers }\n}\n\n/**\n * A type alias that represents all QuangAuth features available for use with `provideAuth`.\n * Features can be enabled by adding special functions to the `provideAuth` call.\n * See documentation for each symbol to find corresponding function name. See also `provideAuth`\n * documentation on how to use those functions.\n *\n * @see {@link provideAuth}\n *\n * @publicApi\n */\nexport type QuangAuthFeatures = QuangAuthFeature<QuangAuthFeatureKind>\n\n/**\n * The list of features as an enum to uniquely type each feature.\n */\nexport const enum QuangAuthFeatureKind {\n MobileAuthFeature,\n SessionStorageFeature,\n LocalStorageFeature,\n MemoryStorageFeature,\n LogoutOnErrorFeature,\n}\n","import {\n ChangeDetectorRef,\n Directive,\n EmbeddedViewRef,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n input,\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\n\nimport { QUANG_LOGGING_BEHAVIOR } from 'quang'\n\nimport { QuangAuthService } from '../auth.service'\n\n/**\n * This directive conditionally renders the associated template if the authenticated user\n * has at least one of the specified roles. By using the `QuangAuthService.hasAtLeastOneRole()` method it checks the user's roles against\n * the required roles provided through the `quangHasAtLeastOneRole` directive.\n *\n * @example\n * <div *quangHasAtLeastOneRole=\"['admin', 'editor']\">\n * This content will only be visible to users with 'admin' or 'editor' roles.\n * </div>\n */\n@Directive({\n selector: '[quangHasAtLeastOneRole]',\n})\nexport class QuangHasAtLeastOneRoleDirective {\n logLevel = inject(QUANG_LOGGING_BEHAVIOR, { optional: true })\n\n targetRoles = input.required<string[]>({ alias: 'quangHasAtLeastOneRole' })\n\n viewContainerRef = inject(ViewContainerRef)\n\n embeddedViewRef: EmbeddedViewRef<unknown> | null = null\n\n templateRef = inject(TemplateRef)\n\n authService = inject(QuangAuthService)\n\n takeUntilDestroyed = takeUntilDestroyed()\n\n changeDetectorRef = inject(ChangeDetectorRef)\n\n hideViewIfNotAllowed = effect(() => {\n if (this.logLevel === 'verbose')\n console.debug({ userRoles: this.authService.roles(), rolesToCheck: this.targetRoles() })\n const isAllowed = this.authService.hasAtLeastOneRole(this.targetRoles())\n if (isAllowed) {\n if (!this.embeddedViewRef) this.embeddedViewRef = this.viewContainerRef.createEmbeddedView(this.templateRef)\n } else {\n this.viewContainerRef.clear()\n this.embeddedViewRef = null\n }\n this.changeDetectorRef.markForCheck()\n })\n}\n","import {\n ChangeDetectorRef,\n Directive,\n EmbeddedViewRef,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n input,\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\n\nimport { QUANG_LOGGING_BEHAVIOR } from 'quang'\n\nimport { QuangAuthService } from '../auth.service'\n\n/**\n * This directive conditionally renders the associated template if the authenticated user\n * has every of the specified roles. By using the `QuangAuthService.hasEveryRole()` method it checks the user's roles against\n * the required roles provided through the `quangHasEveryRole` required input.\n *\n * @example\n * <div *quangHasEveryRole=\"['admin', 'editor']\">\n * This content will only be visible to users with 'admin' and 'editor' roles.\n * </div>\n */\n@Directive({\n selector: '[quangHasEveryRole]',\n})\nexport class QuangHasEveryRoleDirective {\n logLevel = inject(QUANG_LOGGING_BEHAVIOR, { optional: true })\n\n targetRoles = input.required<string[]>({ alias: 'quangHasEveryRole' })\n\n viewContainerRef = inject(ViewContainerRef)\n\n embeddedViewRef: EmbeddedViewRef<unknown> | null = null\n\n templateRef = inject(TemplateRef)\n\n authService = inject(QuangAuthService)\n\n takeUntilDestroyed = takeUntilDestroyed()\n\n changeDetectorRef = inject(ChangeDetectorRef)\n\n hideViewIfNotAllowed = effect(() => {\n if (this.logLevel === 'verbose')\n console.debug({ userRoles: this.authService.roles(), rolesToCheck: this.targetRoles() })\n const isAllowed = this.authService.hasEveryRole(this.targetRoles())\n if (isAllowed) {\n if (!this.embeddedViewRef) this.embeddedViewRef = this.viewContainerRef.createEmbeddedView(this.templateRef)\n } else {\n this.viewContainerRef.clear()\n this.embeddedViewRef = null\n }\n this.changeDetectorRef.markForCheck()\n })\n}\n","import {\n ChangeDetectorRef,\n Directive,\n EmbeddedViewRef,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\n\nimport { QuangAuthService } from '../auth.service'\n\n@Directive({\n selector: '[quangIsAuthenticated]',\n})\nexport class QuangIsAuthenticatedDirective {\n viewContainerRef = inject(ViewContainerRef)\n\n templateRef = inject(TemplateRef)\n\n embeddedViewRef: EmbeddedViewRef<any> | null = null\n\n authService = inject(QuangAuthService)\n\n takeUntilDestroyed = takeUntilDestroyed()\n\n changeDetectorRef = inject(ChangeDetectorRef)\n\n hideViewIfNotAuthenticated = effect(() => {\n if (this.authService.isAuthenticated()) {\n if (!this.embeddedViewRef) this.viewContainerRef.createEmbeddedView(this.templateRef)\n } else {\n this.viewContainerRef.clear()\n this.embeddedViewRef = null\n }\n this.changeDetectorRef.markForCheck()\n })\n}\n","import {\n ChangeDetectorRef,\n Directive,\n EmbeddedViewRef,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\n\nimport { QuangAuthService } from '../auth.service'\n\n@Directive({\n selector: '[quangIsNotAuthenticated]',\n})\nexport class QuangIsNotAuthenticatedDirective {\n viewContainerRef = inject(ViewContainerRef)\n\n templateRef = inject(TemplateRef)\n\n embeddedViewRef: EmbeddedViewRef<any> | null = null\n\n authService = inject(QuangAuthService)\n\n takeUntilDestroyed = takeUntilDestroyed()\n\n changeDetectorRef = inject(ChangeDetectorRef)\n\n showViewIfNotAuthenticated = effect(() => {\n if (this.authService.isAuthenticated()) {\n this.viewContainerRef.clear()\n this.embeddedViewRef = null\n } else if (!this.embeddedViewRef) {\n this.embeddedViewRef = this.viewContainerRef.createEmbeddedView(this.templateRef)\n }\n this.changeDetectorRef.markForCheck()\n })\n}\n","import { inject } from '@angular/core'\nimport type { CanActivateFn } from '@angular/router'\n\nimport { QuangAuthService } from '../auth.service'\n\nexport const quangIsAllowedGuardFactory =\n (roles: string[], behavior: 'every' | 'atLeastOne'): CanActivateFn =>\n async () => {\n const authService = inject(QuangAuthService)\n const isAuthenticated = await authService.getAuthResult()\n if (!isAuthenticated) return false\n const isAllowedFunction = behavior === 'every' ? authService.hasEveryRole : authService.hasAtLeastOneRole\n return isAllowedFunction.call(authService, roles)\n }\n","import { inject } from '@angular/core'\nimport type { CanActivateFn } from '@angular/router'\n\nimport { QuangAuthService } from '../auth.service'\n\nexport const quangIsAuthenticatedGuard: CanActivateFn = async () => {\n const authService = inject(QuangAuthService)\n return authService.getAuthResult()\n}\n","import { HttpErrorResponse, HttpInterceptorFn } from '@angular/common/http'\nimport { InjectionToken, Provider, inject } from '@angular/core'\n\nimport { UrlData, getExcludedUrlsByMethod, isHttpMethod } from 'quang/shared'\nimport { catchError, from, retry, switchMap, tap, throwError } from 'rxjs'\n\nimport { QuangAuthService } from './auth.service'\n\nimport { QuangAuthFeature, QuangAuthFeatureKind, quangAuthFeature } from './auth-providers'\n\nexport const LOGOUT_RETRIES = new InjectionToken<number>('LOGOUT_RETRIES')\nexport const LOGOUT_STATUSES = new InjectionToken<number[]>('LOGOUT_STATUSES')\nexport const LOGOUT_EXCLUDED_URLS = new InjectionToken<UrlData[]>('LOGOUT_EXCLUDED_URLS')\n\nexport const logoutOnErrorInterceptor: HttpInterceptorFn = (request, next) => {\n const quangAuthService = inject(QuangAuthService)\n const logoutStatuses = inject(LOGOUT_STATUSES, { optional: true }) ?? [401]\n const excludedUrlsByMethod = getExcludedUrlsByMethod(inject(LOGOUT_EXCLUDED_URLS, { optional: true }) ?? [])\n const retries = inject(LOGOUT_RETRIES, { optional: true }) ?? 4\n\n if (!isHttpMethod(request.method)) {\n return next(request)\n }\n\n if (\n Array.from(excludedUrlsByMethod.get(request.method) ?? []).some((excludedUrl) =>\n request.url.match(excludedUrl.replace(/\\//g, '\\\\/'))\n )\n ) {\n return next(request)\n }\n\n return next(request).pipe(\n retry({ count: retries, delay: 300 }),\n catchError((error: HttpErrorResponse) => {\n if (logoutStatuses.includes(error?.status))\n return from(quangAuthService.checkForAuthentication(true)).pipe(\n tap((isAuthenticated) => {\n if (!isAuthenticated) quangAuthService.logout()\n }),\n switchMap(() => throwError(() => error))\n )\n return throwError(() => error)\n }),\n retry({ count: 1, delay: 500 })\n )\n}\n\nexport function withLogoutOnError(\n excludedUrls: UrlData[] = [],\n statuses = [401],\n retries = 4\n): QuangAuthFeature<QuangAuthFeatureKind.LogoutOnErrorFeature> {\n const providers: Provider[] = [\n {\n provide: LOGOUT_STATUSES,\n useValue: statuses,\n },\n {\n provide: LOGOUT_EXCLUDED_URLS,\n useValue: excludedUrls,\n },\n {\n provide: LOGOUT_RETRIES,\n useValue: retries,\n },\n ]\n return quangAuthFeature(QuangAuthFeatureKind.LogoutOnErrorFeature, providers)\n}\n","import { Provider } from '@angular/core'\n\nimport { OAuthStorage } from 'angular-oauth2-oidc'\n\nimport { QuangAuthFeature, QuangAuthFeatureKind, quangAuthFeature } from '../auth-providers'\n\nexport function withLocalStorage(): QuangAuthFeature<QuangAuthFeatureKind.LocalStorageFeature> {\n const providers: Provider[] = [\n {\n provide: OAuthStorage,\n useValue: localStorage,\n },\n ]\n return quangAuthFeature(QuangAuthFeatureKind.LocalStorageFeature, providers)\n}\n","import { Injectable, Provider } from '@angular/core'\n\nimport { OAuthStorage } from 'angular-oauth2-oidc'\n\nimport { QuangAuthFeature, QuangAuthFeatureKind, quangAuthFeature } from '../auth-providers'\n\n@Injectable()\nexport class MemoryStorage implements OAuthStorage {\n private data = new Map<string, string>()\n\n getItem(key: string): string {\n return this.data.get(key) ?? ''\n }\n\n removeItem(key: string): void {\n this.data.delete(key)\n }\n\n setItem(key: string, data: string): void {\n this.data.set(key, data)\n }\n}\n\nexport function withMemoryStorage(): QuangAuthFeature<QuangAuthFeatureKind.MemoryStorageFeature> {\n const providers: Provider[] = [\n {\n provide: OAuthStorage,\n useFactory: () => new MemoryStorage(),\n },\n ]\n return quangAuthFeature(QuangAuthFeatureKind.MemoryStorageFeature, providers)\n}\n","import { Provider } from '@angular/core'\n\nimport { OAuthStorage } from 'angular-oauth2-oidc'\n\nimport { QuangAuthFeature, QuangAuthFeatureKind, quangAuthFeature } from '../auth-providers'\n\nexport function withSessionStorage(): QuangAuthFeature<QuangAuthFeatureKind.SessionStorageFeature> {\n const providers: Provider[] = [\n {\n provide: OAuthStorage,\n useValue: sessionStorage,\n },\n ]\n return quangAuthFeature(QuangAuthFeatureKind.SessionStorageFeature, providers)\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAgBa,WAAW,GAAG,IAAI,cAAc,CAA8B,aAAa;AAWlF,SAAU,sBAAsB,CAAC,UAA4B,EAAA;AACjE,IAAA,OAAO,wBAAwB,CAAC,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;AACnF;MAEa,QAAQ,GAAG,IAAI,cAAc,CAAoC,UAAU;AAElF,SAAU,cAAc,CAAC,OAA0C,EAAA;AACvE,IAAA,OAAO,wBAAwB,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;AACzF;AAuBA,MAAM,YAAY,GAAc;AAC9B,IAAA,WAAW,EAAE;AACX,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,mBAAmB,EAAE,KAAK;AAC3B,KAAA;AACD,IAAA,WAAW,EAAE;AACX,QAAA,WAAW,EAAE,IAAI;AACjB,QAAA,oBAAoB,EAAE,IAAI;AAC1B,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,gBAAgB,EAAE,IAAI;AACtB,QAAA,YAAY,EAAE,IAAI;AACnB,KAAA;IACD,KAAK,EAAE,IAAI,GAAG,EAAU;AACxB,IAAA,IAAI,EAAE,IAAI;CACX;AAED;AACA;AACA,MAAM,sCAAsC,GAAG;IAC7C,sBAAsB;IACtB,gBAAgB;IAChB,4BAA4B;IAC5B,kBAAkB;CACnB;MAKY,gBAAgB,CAAA;AAqB3B,IAAA,WAAA,GAAA;QAlBA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,sBAAsB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAErD,IAAA,CAAA,YAAY,G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AAC/E;;SCzBgB,kBAAkB,GAAA;AAChC,IAAA,MAAM,SAAS,GAAe;AAC5B,QAAA;AACE,YAAA,OAAO,EAAE,YAAY;AACrB,YAAA,QAAQ,EAAE,cAAc;AACzB,SAAA;KACF;AACD,IAAA,OAAO,gBAAgB,CAAA,CAAA,mDAA6C,SAAS,CAAC;AAChF;;ACdA;;AAEG;;;;"}
1
+ {"version":3,"file":"quang-auth.mjs","sources":["../../../projects/quang/auth/auth.service.ts","../../../projects/quang/auth/auth-providers.ts","../../../projects/quang/auth/directives/has-at-least-one-role.directive.ts","../../../projects/quang/auth/directives/has-every-role.directive.ts","../../../projects/quang/auth/directives/is-authenticated.directive.ts","../../../projects/quang/auth/directives/is-not-authenticated.directive.ts","../../../projects/quang/auth/guards/is-allowed.guard.ts","../../../projects/quang/auth/guards/is-authenticated.guard.ts","../../../projects/quang/auth/logout-on-error.interceptor.ts","../../../projects/quang/auth/token-storage/local-storage-feature.ts","../../../projects/quang/auth/token-storage/memory-storage-feature.ts","../../../projects/quang/auth/token-storage/session-storage-feature.ts","../../../projects/quang/auth/quang-auth.ts"],"sourcesContent":["import {\n EnvironmentProviders,\n Injectable,\n InjectionToken,\n computed,\n inject,\n makeEnvironmentProviders,\n} from '@angular/core'\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop'\n\nimport { patchState, signalState } from '@ngrx/signals'\n\nimport { AuthConfig, OAuthErrorEvent, OAuthEvent, OAuthService } from 'angular-oauth2-oidc'\nimport { QUANG_LOGGING_BEHAVIOR } from 'quang'\nimport { filter, firstValueFrom } from 'rxjs'\n\nexport const AUTH_CONFIG = new InjectionToken<QuangAuthConfig | undefined>('AUTH_CONFIG')\n\nexport interface QuangAuthConfig extends AuthConfig {\n autoLogin: boolean\n sendAccessToken: boolean\n urlsToSendToken: string[]\n revokeTokensOnLogout?: boolean\n getUserProfileOnLoginSuccess?: boolean\n useSilentRefresh: boolean\n}\n\nexport function provideQuangAuthConfig(authConfig?: QuangAuthConfig): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: AUTH_CONFIG, useValue: authConfig }])\n}\n\nexport const OPEN_URI = new InjectionToken<(uri: string) => void | undefined>('OPEN_URI')\n\nexport function provideOpenURI(openURI: (uri: string) => void | undefined): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: OPEN_URI, deps: [], useFactory: openURI }])\n}\n\ninterface LoginStatus {\n checked: boolean\n authenticationError: boolean\n}\n\ninterface TokenStatus {\n accessToken: string | null\n accessTokenExpiresAt: number | null\n idToken: string | null\n idTokenExpiresAt: number | null\n refreshToken: string | null\n}\n\ninterface AuthState {\n loginStatus: LoginStatus\n tokenStatus: TokenStatus\n roles: Set<string>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n user: Record<string, any> | null\n}\n\nconst initialState: AuthState = {\n loginStatus: {\n checked: false,\n authenticationError: false,\n },\n tokenStatus: {\n accessToken: null,\n accessTokenExpiresAt: null,\n idToken: null,\n idTokenExpiresAt: null,\n refreshToken: null,\n },\n roles: new Set<string>(),\n user: null,\n}\n\n// Subset of situations from https://openid.net/specs/openid-connect-core-1_0.html#AuthError\n// Only the ones where it's reasonably sure that sending the user to the IdServer will help.\nconst errorResponsesRequiringUserInteraction = [\n 'interaction_required',\n 'login_required',\n 'account_selection_required',\n 'consent_required',\n]\n\n@Injectable({\n providedIn: 'root',\n})\nexport class QuangAuthService {\n private config: QuangAuthConfig\n\n logLevel = inject(QUANG_LOGGING_BEHAVIOR, { optional: true })\n\n private oAuthService = inject(OAuthService, { optional: true })\n\n private state = signalState<AuthState>(initialState)\n\n loginChecked = this.state.loginStatus.checked\n\n isAuthenticated = computed(() => !!this.state.tokenStatus.accessToken())\n\n authenticationError = this.state.loginStatus.authenticationError\n\n tokenStatus = this.state.tokenStatus\n\n roles = this.state.roles\n\n user = this.state.user\n\n constructor() {\n const authConfig = inject(AUTH_CONFIG)\n if (!authConfig) throw new Error('Missing auth config')\n\n const openUri = inject(OPEN_URI, { optional: true })\n if (openUri) authConfig.openUri = openUri\n\n this.config = authConfig\n\n this.oAuthService?.events.pipe(takeUntilDestroyed()).subscribe((event: OAuthEvent) => {\n if (this.logLevel === 'verbose') console.debug('Auth service event', event)\n if (event instanceof OAuthErrorEvent && this.loginChecked()) this.loginError()\n if (event.type === 'token_received') this.setTokens()\n })\n this.oAuthService?.configure(this.config)\n }\n\n public async init() {\n this.oAuthService?.setupAutomaticSilentRefresh()\n\n await this.oAuthService?.loadDiscoveryDocumentAndTryLogin()\n\n await this.checkForAuthentication()\n\n if (this.config.autoLogin && !this.isAuthenticated()) this.login()\n }\n\n public async checkForAuthentication(forceRefresh = false) {\n let hasValidToken = this.oAuthService?.hasValidAccessToken()\n\n try {\n if (forceRefresh) hasValidToken = await this.refreshAuth()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n const reason = error?.reason\n if (this.config.autoLogin && reason && errorResponsesRequiringUserInteraction.includes(reason)) this.login()\n hasValidToken = false\n }\n\n this.setTokens()\n patchState(this.state, {\n loginStatus: {\n ...this.state().loginStatus,\n checked: true,\n },\n })\n\n if (hasValidToken && this.config.getUserProfileOnLoginSuccess) await this.getUserProfile()\n\n return hasValidToken\n }\n\n private async refreshAuth() {\n if (this.config.responseType === 'code') await this.oAuthService?.refreshToken()\n else await this.oAuthService?.silentRefresh()\n return this.oAuthService?.hasValidAccessToken()\n }\n\n public login() {\n this.oAuthService?.initLoginFlow()\n }\n\n public async logout() {\n if (!this.isAuthenticated()) return\n if (this.config.revokeTokensOnLogout) await this.oAuthService?.revokeTokenAndLogout()\n else this.oAuthService?.logOut()\n patchState(this.state, { ...initialState })\n }\n\n private loginError() {\n patchState(this.state, {\n loginStatus: {\n ...this.state().loginStatus,\n authenticationError: true,\n },\n })\n this.logout()\n }\n\n public async getUserProfile() {\n const user = await this.oAuthService?.loadUserProfile()\n if (user) patchState(this.state, { user })\n }\n\n private setTokens() {\n const tokenStatus = {\n accessToken: this.oAuthService?.getAccessToken() ?? null,\n accessTokenExpiresAt: this.oAuthService?.getAccessTokenExpiration() ?? null,\n idToken: this.oAuthService?.getIdToken() ?? null,\n idTokenExpiresAt: this.oAuthService?.getIdTokenExpiration() ?? null,\n refreshToken: this.oAuthService?.getRefreshToken() ?? null,\n }\n if (this.logLevel === 'verbose') {\n const now = new Date()\n const accessTokenDate = new Date(tokenStatus.accessTokenExpiresAt ?? '')\n const idTokenDate = new Date(tokenStatus.idTokenExpiresAt ?? '')\n console.table(tokenStatus)\n console.debug(\n `Id token expires at ${idTokenDate} in ${Math.abs(idTokenDate.valueOf() - now.valueOf()) / 1000 / 60} minutes`\n )\n console.debug(\n `Access token expires at ${accessTokenDate} in ${Math.abs(accessTokenDate.valueOf() - now.valueOf()) / 1000 / 60} minutes`\n )\n }\n patchState(this.state, {\n tokenStatus,\n })\n }\n\n async waitForLoginCheck(): Promise<void> {\n await firstValueFrom(toObservable(this.loginChecked).pipe(filter((checked) => checked)))\n }\n\n async getAuthResult(): Promise<boolean> {\n await this.waitForLoginCheck()\n return this.isAuthenticated()\n }\n\n addRoles(rolesToAdd: string[]) {\n patchState(this.state, { roles: new Set([...this.state.roles().values(), ...rolesToAdd]) })\n }\n\n removeRoles(rolesToRemove: string[]) {\n const newRoles = new Set(this.roles().values())\n for (const roleToRemove of rolesToRemove) {\n newRoles.delete(roleToRemove)\n }\n patchState(this.state, { roles: newRoles })\n }\n\n hasEveryRole(roles: string[]) {\n return roles.every((role) => this.roles().has(role))\n }\n\n hasAtLeastOneRole(roles: string[]) {\n return roles.some((role) => this.roles().has(role))\n }\n}\n","import { EnvironmentProviders, Provider, inject, makeEnvironmentProviders, provideAppInitializer } from '@angular/core'\n\nimport { provideOAuthClient } from 'angular-oauth2-oidc'\nimport { type QuangFeature, QuangFeatureKind, quangFeature } from 'quang'\n\nimport { type QuangAuthConfig, QuangAuthService, provideQuangAuthConfig } from './auth.service'\n\nfunction initializeAuthService(authService: QuangAuthService) {\n return () => authService.init()\n}\n\nexport function provideAuth(authConfig?: QuangAuthConfig, ...features: QuangAuthFeatures[]): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideQuangAuthConfig(authConfig),\n provideOAuthClient({\n resourceServer: {\n sendAccessToken: authConfig?.sendAccessToken ?? true,\n allowedUrls: authConfig?.urlsToSendToken ?? [],\n },\n }),\n ...features.map((feature) => feature.ɵproviders),\n provideAppInitializer(() => {\n const initializerFn = initializeAuthService(inject(QuangAuthService))\n return initializerFn()\n }),\n ])\n}\n\nexport function withAuth(\n authConfig?: QuangAuthConfig,\n ...features: QuangAuthFeatures[]\n): QuangFeature<QuangFeatureKind.LoaderFeature> {\n return quangFeature(QuangFeatureKind.LoaderFeature, [provideAuth(authConfig, ...features)])\n}\n\n/**\n * Helper type to represent a QuangAuth feature.\n *\n * @publicApi\n */\nexport interface QuangAuthFeature<FeatureKind extends QuangAuthFeatureKind> {\n ɵkind: FeatureKind\n ɵproviders: (Provider | EnvironmentProviders)[]\n}\n\n/**\n * Helper function to create an object that represents a QuangAuth feature.\n */\nexport function quangAuthFeature<FeatureKind extends QuangAuthFeatureKind>(\n kind: FeatureKind,\n providers: (Provider | EnvironmentProviders)[]\n): QuangAuthFeature<FeatureKind> {\n return { ɵkind: kind, ɵproviders: providers }\n}\n\n/**\n * A type alias that represents all QuangAuth features available for use with `provideAuth`.\n * Features can be enabled by adding special functions to the `provideAuth` call.\n * See documentation for each symbol to find corresponding function name. See also `provideAuth`\n * documentation on how to use those functions.\n *\n * @see {@link provideAuth}\n *\n * @publicApi\n */\nexport type QuangAuthFeatures = QuangAuthFeature<QuangAuthFeatureKind>\n\n/**\n * The list of features as an enum to uniquely type each feature.\n */\nexport const enum QuangAuthFeatureKind {\n MobileAuthFeature,\n SessionStorageFeature,\n LocalStorageFeature,\n MemoryStorageFeature,\n LogoutOnErrorFeature,\n}\n","import {\n ChangeDetectorRef,\n Directive,\n EmbeddedViewRef,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n input,\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\n\nimport { QUANG_LOGGING_BEHAVIOR } from 'quang'\n\nimport { QuangAuthService } from '../auth.service'\n\n/**\n * This directive conditionally renders the associated template if the authenticated user\n * has at least one of the specified roles. By using the `QuangAuthService.hasAtLeastOneRole()` method it checks the user's roles against\n * the required roles provided through the `quangHasAtLeastOneRole` directive.\n *\n * @example\n * <div *quangHasAtLeastOneRole=\"['admin', 'editor']\">\n * This content will only be visible to users with 'admin' or 'editor' roles.\n * </div>\n */\n@Directive({\n selector: '[quangHasAtLeastOneRole]',\n})\nexport class QuangHasAtLeastOneRoleDirective {\n logLevel = inject(QUANG_LOGGING_BEHAVIOR, { optional: true })\n\n targetRoles = input.required<string[]>({ alias: 'quangHasAtLeastOneRole' })\n\n viewContainerRef = inject(ViewContainerRef)\n\n embeddedViewRef: EmbeddedViewRef<unknown> | null = null\n\n templateRef = inject(TemplateRef)\n\n authService = inject(QuangAuthService)\n\n takeUntilDestroyed = takeUntilDestroyed()\n\n changeDetectorRef = inject(ChangeDetectorRef)\n\n hideViewIfNotAllowed = effect(() => {\n if (this.logLevel === 'verbose')\n console.debug({ userRoles: this.authService.roles(), rolesToCheck: this.targetRoles() })\n const isAllowed = this.authService.hasAtLeastOneRole(this.targetRoles())\n if (isAllowed) {\n if (!this.embeddedViewRef) this.embeddedViewRef = this.viewContainerRef.createEmbeddedView(this.templateRef)\n } else {\n this.viewContainerRef.clear()\n this.embeddedViewRef = null\n }\n this.changeDetectorRef.markForCheck()\n })\n}\n","import {\n ChangeDetectorRef,\n Directive,\n EmbeddedViewRef,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n input,\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\n\nimport { QUANG_LOGGING_BEHAVIOR } from 'quang'\n\nimport { QuangAuthService } from '../auth.service'\n\n/**\n * This directive conditionally renders the associated template if the authenticated user\n * has every of the specified roles. By using the `QuangAuthService.hasEveryRole()` method it checks the user's roles against\n * the required roles provided through the `quangHasEveryRole` required input.\n *\n * @example\n * <div *quangHasEveryRole=\"['admin', 'editor']\">\n * This content will only be visible to users with 'admin' and 'editor' roles.\n * </div>\n */\n@Directive({\n selector: '[quangHasEveryRole]',\n})\nexport class QuangHasEveryRoleDirective {\n logLevel = inject(QUANG_LOGGING_BEHAVIOR, { optional: true })\n\n targetRoles = input.required<string[]>({ alias: 'quangHasEveryRole' })\n\n viewContainerRef = inject(ViewContainerRef)\n\n embeddedViewRef: EmbeddedViewRef<unknown> | null = null\n\n templateRef = inject(TemplateRef)\n\n authService = inject(QuangAuthService)\n\n takeUntilDestroyed = takeUntilDestroyed()\n\n changeDetectorRef = inject(ChangeDetectorRef)\n\n hideViewIfNotAllowed = effect(() => {\n if (this.logLevel === 'verbose')\n console.debug({ userRoles: this.authService.roles(), rolesToCheck: this.targetRoles() })\n const isAllowed = this.authService.hasEveryRole(this.targetRoles())\n if (isAllowed) {\n if (!this.embeddedViewRef) this.embeddedViewRef = this.viewContainerRef.createEmbeddedView(this.templateRef)\n } else {\n this.viewContainerRef.clear()\n this.embeddedViewRef = null\n }\n this.changeDetectorRef.markForCheck()\n })\n}\n","import {\n ChangeDetectorRef,\n Directive,\n EmbeddedViewRef,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\n\nimport { QuangAuthService } from '../auth.service'\n\n@Directive({\n selector: '[quangIsAuthenticated]',\n})\nexport class QuangIsAuthenticatedDirective {\n viewContainerRef = inject(ViewContainerRef)\n\n templateRef = inject<TemplateRef<unknown>>(TemplateRef)\n\n embeddedViewRef: EmbeddedViewRef<unknown> | null = null\n\n authService = inject(QuangAuthService)\n\n takeUntilDestroyed = takeUntilDestroyed()\n\n changeDetectorRef = inject(ChangeDetectorRef)\n\n hideViewIfNotAuthenticated = effect(() => {\n if (this.authService.isAuthenticated()) {\n if (!this.embeddedViewRef) this.viewContainerRef.createEmbeddedView(this.templateRef)\n } else {\n this.viewContainerRef.clear()\n this.embeddedViewRef = null\n }\n this.changeDetectorRef.markForCheck()\n })\n}\n","import {\n ChangeDetectorRef,\n Directive,\n EmbeddedViewRef,\n TemplateRef,\n ViewContainerRef,\n effect,\n inject,\n} from '@angular/core'\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop'\n\nimport { QuangAuthService } from '../auth.service'\n\n@Directive({\n selector: '[quangIsNotAuthenticated]',\n})\nexport class QuangIsNotAuthenticatedDirective {\n viewContainerRef = inject(ViewContainerRef)\n\n templateRef = inject<TemplateRef<unknown>>(TemplateRef)\n\n embeddedViewRef: EmbeddedViewRef<unknown> | null = null\n\n authService = inject(QuangAuthService)\n\n takeUntilDestroyed = takeUntilDestroyed()\n\n changeDetectorRef = inject(ChangeDetectorRef)\n\n showViewIfNotAuthenticated = effect(() => {\n if (this.authService.isAuthenticated()) {\n this.viewContainerRef.clear()\n this.embeddedViewRef = null\n } else if (!this.embeddedViewRef) {\n this.embeddedViewRef = this.viewContainerRef.createEmbeddedView(this.templateRef)\n }\n this.changeDetectorRef.markForCheck()\n })\n}\n","import { inject } from '@angular/core'\nimport type { CanActivateFn } from '@angular/router'\n\nimport { QuangAuthService } from '../auth.service'\n\nexport const quangIsAllowedGuardFactory =\n (roles: string[], behavior: 'every' | 'atLeastOne'): CanActivateFn =>\n async () => {\n const authService = inject(QuangAuthService)\n const isAuthenticated = await authService.getAuthResult()\n if (!isAuthenticated) return false\n const isAllowedFunction = behavior === 'every' ? authService.hasEveryRole : authService.hasAtLeastOneRole\n return isAllowedFunction.call(authService, roles)\n }\n","import { inject } from '@angular/core'\nimport type { CanActivateFn } from '@angular/router'\n\nimport { QuangAuthService } from '../auth.service'\n\nexport const quangIsAuthenticatedGuard: CanActivateFn = async () => {\n const authService = inject(QuangAuthService)\n return authService.getAuthResult()\n}\n","import { HttpErrorResponse, HttpInterceptorFn } from '@angular/common/http'\nimport { InjectionToken, Provider, inject } from '@angular/core'\n\nimport { UrlData, getExcludedUrlsByMethod, isHttpMethod } from 'quang/shared'\nimport { catchError, from, retry, switchMap, tap, throwError } from 'rxjs'\n\nimport { QuangAuthService } from './auth.service'\n\nimport { QuangAuthFeature, QuangAuthFeatureKind, quangAuthFeature } from './auth-providers'\n\nexport const LOGOUT_RETRIES = new InjectionToken<number>('LOGOUT_RETRIES')\nexport const LOGOUT_STATUSES = new InjectionToken<number[]>('LOGOUT_STATUSES')\nexport const LOGOUT_EXCLUDED_URLS = new InjectionToken<UrlData[]>('LOGOUT_EXCLUDED_URLS')\n\nexport const logoutOnErrorInterceptor: HttpInterceptorFn = (request, next) => {\n const quangAuthService = inject(QuangAuthService)\n const logoutStatuses = inject(LOGOUT_STATUSES, { optional: true }) ?? [401]\n const excludedUrlsByMethod = getExcludedUrlsByMethod(inject(LOGOUT_EXCLUDED_URLS, { optional: true }) ?? [])\n const retries = inject(LOGOUT_RETRIES, { optional: true }) ?? 4\n\n if (!isHttpMethod(request.method)) {\n return next(request)\n }\n\n if (\n Array.from(excludedUrlsByMethod.get(request.method) ?? []).some((excludedUrl) =>\n request.url.match(excludedUrl.replace(/\\//g, '\\\\/'))\n )\n ) {\n return next(request)\n }\n\n return next(request).pipe(\n retry({ count: retries, delay: 300 }),\n catchError((error: HttpErrorResponse) => {\n if (logoutStatuses.includes(error?.status))\n return from(quangAuthService.checkForAuthentication(true)).pipe(\n tap((isAuthenticated) => {\n if (!isAuthenticated) quangAuthService.logout()\n }),\n switchMap(() => throwError(() => error))\n )\n return throwError(() => error)\n }),\n retry({ count: 1, delay: 500 })\n )\n}\n\nexport function withLogoutOnError(\n excludedUrls: UrlData[] = [],\n statuses = [401],\n retries = 4\n): QuangAuthFeature<QuangAuthFeatureKind.LogoutOnErrorFeature> {\n const providers: Provider[] = [\n {\n provide: LOGOUT_STATUSES,\n useValue: statuses,\n },\n {\n provide: LOGOUT_EXCLUDED_URLS,\n useValue: excludedUrls,\n },\n {\n provide: LOGOUT_RETRIES,\n useValue: retries,\n },\n ]\n return quangAuthFeature(QuangAuthFeatureKind.LogoutOnErrorFeature, providers)\n}\n","import { Provider } from '@angular/core'\n\nimport { OAuthStorage } from 'angular-oauth2-oidc'\n\nimport { QuangAuthFeature, QuangAuthFeatureKind, quangAuthFeature } from '../auth-providers'\n\nexport function withLocalStorage(): QuangAuthFeature<QuangAuthFeatureKind.LocalStorageFeature> {\n const providers: Provider[] = [\n {\n provide: OAuthStorage,\n useValue: localStorage,\n },\n ]\n return quangAuthFeature(QuangAuthFeatureKind.LocalStorageFeature, providers)\n}\n","import { Injectable, Provider } from '@angular/core'\n\nimport { OAuthStorage } from 'angular-oauth2-oidc'\n\nimport { QuangAuthFeature, QuangAuthFeatureKind, quangAuthFeature } from '../auth-providers'\n\n@Injectable()\nexport class MemoryStorage implements OAuthStorage {\n private data = new Map<string, string>()\n\n getItem(key: string): string {\n return this.data.get(key) ?? ''\n }\n\n removeItem(key: string): void {\n this.data.delete(key)\n }\n\n setItem(key: string, data: string): void {\n this.data.set(key, data)\n }\n}\n\nexport function withMemoryStorage(): QuangAuthFeature<QuangAuthFeatureKind.MemoryStorageFeature> {\n const providers: Provider[] = [\n {\n provide: OAuthStorage,\n useFactory: () => new MemoryStorage(),\n },\n ]\n return quangAuthFeature(QuangAuthFeatureKind.MemoryStorageFeature, providers)\n}\n","import { Provider } from '@angular/core'\n\nimport { OAuthStorage } from 'angular-oauth2-oidc'\n\nimport { QuangAuthFeature, QuangAuthFeatureKind, quangAuthFeature } from '../auth-providers'\n\nexport function withSessionStorage(): QuangAuthFeature<QuangAuthFeatureKind.SessionStorageFeature> {\n const providers: Provider[] = [\n {\n provide: OAuthStorage,\n useValue: sessionStorage,\n },\n ]\n return quangAuthFeature(QuangAuthFeatureKind.SessionStorageFeature, providers)\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAgBa,WAAW,GAAG,IAAI,cAAc,CAA8B,aAAa;AAWlF,SAAU,sBAAsB,CAAC,UAA4B,EAAA;AACjE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