@arsedizioni/ars-utils 22.0.7 → 22.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, inject, Renderer2, ElementRef, afterNextRender, Directive, Service, makeEnvironmentProviders, NgModule, viewChild, output, signal, ChangeDetectionStrategy, Component, ChangeDetectorRef, Injectable, DestroyRef, computed, effect, Input, Optional, Self, booleanAttribute, model, NgZone } from '@angular/core';
2
+ import { input, inject, Renderer2, ElementRef, afterNextRender, Directive, Service, makeEnvironmentProviders, NgModule, viewChild, output, signal, ChangeDetectionStrategy, Component, ChangeDetectorRef, Injectable, DestroyRef, computed, effect, Input, Optional, Self, booleanAttribute, model } from '@angular/core';
3
3
  import * as i14 from '@angular/material/paginator';
4
4
  import { MatPaginatorIntl, MatPaginatorModule } from '@angular/material/paginator';
5
5
  import { DialogService, PaginatorIntl, OtpInputComponent, UIService } from '@arsedizioni/ars-utils/ui';
@@ -22,7 +22,7 @@ import { MatInputModule } from '@angular/material/input';
22
22
  import * as i8 from '@angular/material/select';
23
23
  import { MatSelectModule } from '@angular/material/select';
24
24
  import * as i4$1 from '@arsedizioni/ars-utils/core';
25
- import { SystemUtils, SafeHtmlPipe, DateInterval, DateIntervalChangeDirective, TimeValidatorDirective, SearchFilterPipe, ArsCoreModule, EmailsValidatorDirective, FileInfo, FileSizeValidatorDirective, SafeUrlPipe, EnvironmentService } from '@arsedizioni/ars-utils/core';
25
+ import { SystemUtils, SafeHtmlPipe, DateInterval, DateIntervalChangeDirective, TimeValidatorDirective, SearchFilterPipe, ArsCoreModule, EmailsValidatorDirective, FileInfo, FileSizeValidatorDirective, SafeUrlPipe } from '@arsedizioni/ars-utils/core';
26
26
  import * as i1$1 from '@ngbracket/ngx-layout/flex';
27
27
  import { FlexModule } from '@ngbracket/ngx-layout/flex';
28
28
  import * as i5$1 from '@angular/material/datepicker';
@@ -40,7 +40,7 @@ import * as i2 from '@ngbracket/ngx-layout/extended';
40
40
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
41
41
  import * as i9 from '@angular/material/tree';
42
42
  import { MatTree, MatTreeModule } from '@angular/material/tree';
43
- import { BehaviorSubject, Subject, auditTime, animationFrameScheduler, filter } from 'rxjs';
43
+ import { BehaviorSubject, Subject, auditTime, animationFrameScheduler } from 'rxjs';
44
44
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
45
45
  import * as i7$1 from '@angular/material/badge';
46
46
  import { MatBadgeModule } from '@angular/material/badge';
@@ -49,11 +49,6 @@ import { MatChipsModule } from '@angular/material/chips';
49
49
  import { HttpClient, HttpHeaders } from '@angular/common/http';
50
50
  import * as i4$2 from '@angular/material/tabs';
51
51
  import { MatTabsModule } from '@angular/material/tabs';
52
- import { MsalBroadcastService, MsalService, MSAL_INSTANCE, MSAL_GUARD_CONFIG, MSAL_INTERCEPTOR_CONFIG } from '@azure/msal-angular';
53
- import { PublicClientApplication, BrowserCacheLocation, InteractionType, EventType } from '@azure/msal-browser';
54
- import { broadcastResponseToMainFrame } from '@azure/msal-browser/redirect-bridge';
55
- import * as i2$1 from '@angular/material/progress-bar';
56
- import { MatProgressBarModule } from '@angular/material/progress-bar';
57
52
 
58
53
  class ResizeTableColumnDirective {
59
54
  constructor() {
@@ -160,12 +155,6 @@ var PromptDialogType;
160
155
  PromptDialogType[PromptDialogType["List"] = 5] = "List";
161
156
  PromptDialogType[PromptDialogType["Time"] = 6] = "Time";
162
157
  })(PromptDialogType || (PromptDialogType = {}));
163
- var LoginOAuthType;
164
- (function (LoginOAuthType) {
165
- LoginOAuthType[LoginOAuthType["None"] = 0] = "None";
166
- LoginOAuthType[LoginOAuthType["Microsoft"] = 1] = "Microsoft";
167
- LoginOAuthType[LoginOAuthType["Google"] = 2] = "Google";
168
- })(LoginOAuthType || (LoginOAuthType = {}));
169
158
 
170
159
  /** Constants identifying each filter group slot and text filter channels. */
171
160
  const Filters = {
@@ -3422,251 +3411,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
3422
3411
  MatButtonModule, MatTooltipModule, MatFormFieldModule, MatInputModule, FormsModule, FlexLayoutModule, SafeHtmlPipe], template: "<mat-tab-group class=\"taxonomy-picker-tabs\" style=\"height:100%\">\r\n <mat-tab style=\"overflow-x: hidden !important; height: 100%\">\r\n <ng-template mat-tab-label>\r\n Seleziona\r\n <mat-icon\r\n style=\"font-size:16px;height:16px;width:16px;margin-left:4px;vertical-align:middle;color:var(--mat-sys-primary)\"\r\n [matTooltip]=\"'Nessuna selezione = tutti gli argomenti inclusi;\\r\\nOgni elemento selezionato include sempre tutti i suoi sottoelementi'\"\r\n matTooltipPosition=\"above\">\r\n info\r\n </mat-icon>\r\n </ng-template>\r\n <div fxLayout=\"column\" fxFill style=\"overflow: hidden; height: 100%;\">\r\n <div fxFlex>\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxLayoutAlign=\"start center\" fxFill>\r\n <div fxFlex fxHide.xs>\r\n <mat-form-field style=\"width:200px; padding: 8px 0px\" appearance=\"outline\"\r\n subscriptSizing=\"dynamic\">\r\n <mat-label>Cerca...</mat-label>\r\n <input type=\"text\" (keyup)=\"doFilter()\" matInput [ngModel]=\"filterText()\"\r\n (ngModelChange)=\"filterText.set($event)\"\r\n (keydown.enter)=\"$event.preventDefault(); $event.stopPropagation(); nextFiltered()\"\r\n (keydown.arrowDown)=\"$event.preventDefault(); $event.stopPropagation(); nextFiltered()\">\r\n @if (filterText()) {\r\n <button type=\"button\" type=\"button\" tabindex=\"-1\" matSuffix mat-icon-button\r\n aria-label=\"Clear\" (click)=\"clearFilter()\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n </mat-form-field>\r\n </div>\r\n @if (filteredItems().length > 0) {\r\n <div fxFlex=\"50px\" fxHide.xs fxLayoutAlign=\"end center\">\r\n <div class=\"small\">{{filterIndex() + 1}} / {{filteredItems().length}}</div>\r\n </div>\r\n <div fxFlex=\"48px\" fxHide.xs fxLayoutAlign=\"end center\">\r\n <button mat-icon-button (click)=\"nextFiltered()\">\r\n <mat-icon aria-label=\"Vai al prossimo\"\r\n matTooltip=\"Vai al prossimo\">arrow_downward</mat-icon>\r\n </button>\r\n </div>\r\n }\r\n <div fxFlex=\"*\" fxLayoutAlign=\"end center\">\r\n <button mat-icon-button [matTooltip]=\"'Espandi tutto'\" (click)=\"expandAll()\">\r\n <mat-icon>unfold_more</mat-icon>\r\n </button>\r\n <button mat-icon-button [matTooltip]=\"'Comprimi tutto'\" (click)=\"collapseAll()\">\r\n <mat-icon>unfold_less</mat-icon>\r\n </button>\r\n <button mat-icon-button [matTooltip]=\"'Azzera selezione'\" [disabled]=\"!hasSelection()\"\r\n (click)=\"clearAll()\">\r\n <mat-icon>deselect</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div fxFlex=\"*\" style=\"overflow-y: auto;\">\r\n <mat-tree [dataSource]=\"tree()\" [childrenAccessor]=\"treeChildrenAccessor\" class=\"tree\">\r\n <!-- Leaf node -->\r\n <mat-tree-node *matTreeNodeDef=\"let node\" matTreeNodePadding [matTreeNodePaddingIndent]=\"20\"\r\n class=\"tree-node\" [class.tree-node-filtered]=\"filteredNode()?.id === node.id\"\r\n [class.tree-node-no-select]=\"!isSelectable(node)\"\r\n [attr.data-node-id]=\"node.id\">\r\n <button mat-icon-button disabled style=\"visibility: hidden\"></button>\r\n @if (isSelectable(node)) {\r\n <mat-checkbox [checked]=\"isSelected(node)\" [disabled]=\"disabled()\" (change)=\"toggleNode(node)\">\r\n <span class=\"small\">{{node.name}}</span>\r\n </mat-checkbox>\r\n } @else {\r\n <div class=\"tree-node-label-only\">\r\n <span class=\"small\">{{node.name}}</span>\r\n </div>\r\n }\r\n </mat-tree-node>\r\n <!-- Expandable node with children -->\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding\r\n [matTreeNodePaddingIndent]=\"20\" #treeNode=\"matTreeNode\" class=\"tree-node\"\r\n [class.tree-node-filtered]=\"filteredNode()?.id === node.id\"\r\n [class.tree-node-no-select]=\"!isSelectable(node)\"\r\n [attr.data-node-id]=\"node.id\">\r\n <button mat-icon-button matTreeNodeToggle>\r\n <mat-icon>{{treeNode.isExpanded ? 'expand_more' : 'chevron_right'}}</mat-icon>\r\n </button>\r\n @if (isSelectable(node)) {\r\n <mat-checkbox [checked]=\"isSelected(node)\" [indeterminate]=\"isIndeterminate(node)\"\r\n [disabled]=\"disabled()\" (change)=\"toggleNode(node)\">\r\n <span class=\"small\">{{node.name}}</span>\r\n </mat-checkbox>\r\n } @else {\r\n <div class=\"tree-node-label-only\">\r\n <span class=\"small\">{{node.name}}</span>\r\n </div>\r\n }\r\n </mat-tree-node>\r\n </mat-tree>\r\n </div>\r\n </div>\r\n </mat-tab>\r\n <mat-tab [label]=\"hasSelection() ? 'Selezionati (' + selectedVisibleCount() + ')' : 'Selezionati (tutti)'\"\r\n style=\"height: 100%;\">\r\n <div fxLayout=\"column\" fxFill style=\"overflow: hidden; height: 100%;\">\r\n <div fxFlex>\r\n <div fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"8px\" style=\"padding:12px\">\r\n @if (!hasSelection()) {\r\n <mat-icon>info</mat-icon>\r\n <span [innerHTML]=\"descriptionEmpty() | safeHtml\"></span>\r\n } @else {\r\n <div fxFlex=\"*\" fxLayoutAlign=\"end\">\r\n <button mat-button color=\"warn\" style=\"margin-left:auto\" (click)=\"clearAll()\">\r\n <mat-icon>deselect</mat-icon> Azzera tutto\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n <div fxFlex=\"*\" style=\"overflow-y: auto; padding-bottom: 12px;\">\r\n <mat-chip-set>\r\n @for (id of selection(); track id) {\r\n @let node = nodeById(id);\r\n @if (node && isChipVisible(id)) {\r\n <mat-chip (removed)=\"removeNode(node)\" style=\"max-width: 280px;\" [matTooltip]=\"node.name\">\r\n {{node.name}}\r\n @if (!disabled()) {\r\n <button matChipRemove matTooltip=\"Elimina\"><mat-icon>cancel</mat-icon></button>\r\n }\r\n </mat-chip>\r\n }\r\n }\r\n </mat-chip-set>\r\n </div>\r\n </div>\r\n </mat-tab>\r\n</mat-tab-group>", styles: [".tree-picker-tabs ::ng-deep .mat-mdc-tab-body-wrapper{flex:1 1 auto;height:100%}.tree{padding:8px 0 16px;background-color:transparent!important}.tree-node{min-height:36px!important;padding-right:12px;margin-right:0}.tree-node .small-icon-button{width:2rem!important;height:2rem!important;padding:0!important;display:inline-flex!important;align-items:center;justify-content:center}.tree-node .small-icon-button .mat-mdc-button-touch-target{width:2rem!important;height:2rem!important}.tree-node:not(.tree-node-no-select):hover{cursor:pointer;background-color:var(--mat-menu-item-hover-state-layer-color, transparent);border-radius:24px}.tree-node-filtered ::ng-deep .mdc-label,.tree-node-filtered ::ng-deep .mat-mdc-checkbox label{font-weight:700;color:var(--ars-color-accent, #7894ae)!important}.tree-node-filtered .tree-node-label-only{font-weight:700;color:var(--ars-color-accent, #7894ae);opacity:1}.tree-node-activated ::ng-deep .mdc-label,.tree-node-activated ::ng-deep .mat-mdc-checkbox label{font-weight:700;color:var(--ars-color-secondary, #4a635f)!important}.tree-node-label-only{display:flex;flex-direction:column;justify-content:center;padding-left:30px;opacity:.7}\n"] }]
3423
3412
  }], ctorParameters: () => [], propDecorators: { tree: [{ type: i0.Input, args: [{ isSignal: true, alias: "tree", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], descriptionEmpty: [{ type: i0.Input, args: [{ isSignal: true, alias: "descriptionEmpty", required: false }] }], maxDepth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDepth", required: false }] }], maxDepthOverrides: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDepthOverrides", required: false }] }], minDepth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDepth", required: false }] }], selectionCount: [{ type: i0.Output, args: ["selectionCount"] }], changed: [{ type: i0.Output, args: ["changed"] }], _treeRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatTree), { isSignal: true }] }] } });
3424
3413
 
3425
- function MSALInstanceFactory(environment) {
3426
- return new PublicClientApplication({
3427
- auth: {
3428
- clientId: "6b2c080f-6ab0-4511-a9df-0bce69db5833",
3429
- authority: "https://login.microsoftonline.com/common",
3430
- redirectUri: environment.appLoginRedirectUri,
3431
- },
3432
- cache: {
3433
- cacheLocation: BrowserCacheLocation.LocalStorage
3434
- }
3435
- });
3436
- }
3437
- function MSALInterceptorConfigFactory(environment) {
3438
- return {
3439
- interactionType: InteractionType.Popup,
3440
- protectedResourceMap: new Map([
3441
- [environment.appServiceLoginUri, ["api://6b2c080f-6ab0-4511-a9df-0bce69db5833/AngularSPAAuthScope"]],
3442
- ["https://graph.microsoft.com/v2.0/me", ["user.read"]],
3443
- ])
3444
- };
3445
- }
3446
- function MSALGuardConfigFactory() {
3447
- return {
3448
- interactionType: InteractionType.Popup,
3449
- authRequest: {
3450
- scopes: ["user.read"]
3451
- }
3452
- };
3453
- }
3454
- class LoginOAuthComponent {
3455
- constructor() {
3456
- this.destroyRef = inject(DestroyRef);
3457
- this.msalBroadcastService = inject(MsalBroadcastService);
3458
- this.msaLService = inject(MsalService);
3459
- this.dialogService = inject(DialogService);
3460
- this.ngZone = inject(NgZone);
3461
- /** Emitted when OAuth authentication succeeds. */
3462
- this.success = output();
3463
- /** Whether to show the introductory info panel. */
3464
- this.showInfo = input(true, /* @ts-ignore */
3465
- ...(ngDevMode ? [{ debugName: "showInfo" }] : /* istanbul ignore next */ []));
3466
- /** Application name displayed in the info panel. */
3467
- this.applicationName = input(/* @ts-ignore */
3468
- ...(ngDevMode ? [undefined, { debugName: "applicationName" }] : /* istanbul ignore next */ []));
3469
- /** Whether to trigger `initialize()` automatically on mount. */
3470
- this.autoInitialize = input(false, /* @ts-ignore */
3471
- ...(ngDevMode ? [{ debugName: "autoInitialize" }] : /* istanbul ignore next */ []));
3472
- /** Whether the Microsoft login button is shown. */
3473
- this.allowMicrosoft = input(true, /* @ts-ignore */
3474
- ...(ngDevMode ? [{ debugName: "allowMicrosoft" }] : /* istanbul ignore next */ []));
3475
- /** Whether the Google login button is shown. */
3476
- this.allowGoogle = input(true, /* @ts-ignore */
3477
- ...(ngDevMode ? [{ debugName: "allowGoogle" }] : /* istanbul ignore next */ []));
3478
- this.oauthReady = signal(false, /* @ts-ignore */
3479
- ...(ngDevMode ? [{ debugName: "oauthReady" }] : /* istanbul ignore next */ []));
3480
- this.oauthMicrosoftReady = signal(false, /* @ts-ignore */
3481
- ...(ngDevMode ? [{ debugName: "oauthMicrosoftReady" }] : /* istanbul ignore next */ []));
3482
- this.oauthGoogleReady = signal(false, /* @ts-ignore */
3483
- ...(ngDevMode ? [{ debugName: "oauthGoogleReady" }] : /* istanbul ignore next */ []));
3484
- this.msalBroadcastService.msalSubject$
3485
- .pipe(filter((msg) => msg.eventType === EventType.LOGOUT_FAILURE ||
3486
- msg.eventType === EventType.ACQUIRE_TOKEN_FAILURE), takeUntilDestroyed(this.destroyRef))
3487
- .subscribe((r) => {
3488
- if (r?.payload) {
3489
- const error = r.payload;
3490
- this.dialogService.error(error?.message ?? 'Errore di autenticazione Microsoft');
3491
- }
3492
- });
3493
- afterNextRender(() => {
3494
- if (this.autoInitialize()) {
3495
- this.initialize();
3496
- }
3497
- });
3498
- }
3499
- /**
3500
- * Initialize OAuth providers (Microsoft MSAL and Google GSI).
3501
- * Safe to call multiple times — already-initialized providers are skipped.
3502
- * Must be public so the host component can trigger it manually when `autoInitialize` is false.
3503
- */
3504
- initialize() {
3505
- if (this.oauthMicrosoftReady() && this.oauthGoogleReady()) {
3506
- return; // Both already loaded
3507
- }
3508
- this.oauthReady.set(true);
3509
- // Load MS stack only if not already initialized
3510
- if (!this.oauthMicrosoftReady()) {
3511
- this.msaLService.initialize()
3512
- .pipe(takeUntilDestroyed(this.destroyRef))
3513
- .subscribe(() => {
3514
- this.oauthMicrosoftReady.set(true);
3515
- });
3516
- }
3517
- // Load Google script only if not already initialized
3518
- if (!this.oauthGoogleReady()) {
3519
- const DSLScript = document.createElement('script');
3520
- DSLScript.src = 'https://accounts.google.com/gsi/client';
3521
- DSLScript.type = 'text/javascript';
3522
- document.body.appendChild(DSLScript);
3523
- document.body.removeChild(DSLScript);
3524
- // @ts-ignore
3525
- window.onGoogleLibraryLoad = () => {
3526
- // initialize google account
3527
- // @ts-ignore
3528
- google.accounts.id.initialize({
3529
- client_id: '71204983077-ag31h3bgt2udcbfr9nn84r9rni2k3snp.apps.googleusercontent.com',
3530
- cancel_on_tap_outside: true,
3531
- auto_select: false,
3532
- callback: (r) => {
3533
- this.ngZone.run(() => {
3534
- this.success.emit({ type: LoginOAuthType.Google, token: r.credential });
3535
- });
3536
- }
3537
- });
3538
- googleButtonWrapper = createFakeGoogleWrapper();
3539
- this.oauthGoogleReady.set(true);
3540
- };
3541
- }
3542
- }
3543
- /**
3544
- * Trigger a Microsoft (MSAL) login popup and acquire an access token on success.
3545
- */
3546
- loginMSAL() {
3547
- // Clear any in-progress interaction flag that may have been left by a previous incomplete popup
3548
- sessionStorage.removeItem('msal.interaction.status');
3549
- this.msaLService.loginPopup()
3550
- .pipe(takeUntilDestroyed(this.destroyRef))
3551
- .subscribe({
3552
- next: (r) => {
3553
- try {
3554
- this.msaLService.instance.setActiveAccount(r.account);
3555
- this.msaLService.acquireTokenSilent({
3556
- scopes: [
3557
- "api://6b2c080f-6ab0-4511-a9df-0bce69db5833/AngularSPAAuthScope"
3558
- ],
3559
- account: r.account
3560
- }).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
3561
- next: (tokenResult) => {
3562
- console.log("Token acquired!");
3563
- this.success.emit({ type: LoginOAuthType.Microsoft, token: tokenResult.accessToken });
3564
- },
3565
- error: (error) => {
3566
- this.dialogService.error(error.message);
3567
- }
3568
- });
3569
- }
3570
- catch (error) {
3571
- this.dialogService.error(error.message);
3572
- }
3573
- },
3574
- error: (error) => {
3575
- this.dialogService.error(error.message);
3576
- }
3577
- });
3578
- }
3579
- /**
3580
- * Trigger the hidden Google GSI button to open the Google sign-in flow.
3581
- */
3582
- loginGoogle() {
3583
- // Use wrapper click to prevent Illegal invocation exception
3584
- googleButtonWrapper.click();
3585
- }
3586
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: LoginOAuthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3587
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: LoginOAuthComponent, isStandalone: true, selector: "login-oauth", inputs: { showInfo: { classPropertyName: "showInfo", publicName: "showInfo", isSignal: true, isRequired: false, transformFunction: null }, applicationName: { classPropertyName: "applicationName", publicName: "applicationName", isSignal: true, isRequired: false, transformFunction: null }, autoInitialize: { classPropertyName: "autoInitialize", publicName: "autoInitialize", isSignal: true, isRequired: false, transformFunction: null }, allowMicrosoft: { classPropertyName: "allowMicrosoft", publicName: "allowMicrosoft", isSignal: true, isRequired: false, transformFunction: null }, allowGoogle: { classPropertyName: "allowGoogle", publicName: "allowGoogle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { success: "success" }, providers: [
3588
- {
3589
- provide: MSAL_INSTANCE,
3590
- deps: [EnvironmentService],
3591
- useFactory: MSALInstanceFactory
3592
- },
3593
- {
3594
- provide: MSAL_GUARD_CONFIG,
3595
- useFactory: MSALGuardConfigFactory
3596
- },
3597
- {
3598
- provide: MSAL_INTERCEPTOR_CONFIG,
3599
- deps: [EnvironmentService],
3600
- useFactory: MSALInterceptorConfigFactory
3601
- },
3602
- MsalService,
3603
- MsalBroadcastService
3604
- ], ngImport: i0, template: "<div class=\"login-oauth\">\r\n @if(showInfo()) {\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n @if(applicationName()) {\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{applicationName()}} e dei servizi ad esso\r\n connessi.</p>\r\n }\r\n </div>\r\n }\r\n @if (allowMicrosoft()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginMSAL()\" aria-label=\"Effettua accesso\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n }\r\n @if (allowGoogle()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n aria-label=\"Effettua accesso\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".login-oauth{text-align:center}.login-oauth .button{padding:10px 0;width:100%}.login-oauth .message{padding:0 0 10px!important;font-size:small}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i6.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3605
- }
3606
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: LoginOAuthComponent, decorators: [{
3607
- type: Component,
3608
- args: [{ selector: 'login-oauth', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
3609
- {
3610
- provide: MSAL_INSTANCE,
3611
- deps: [EnvironmentService],
3612
- useFactory: MSALInstanceFactory
3613
- },
3614
- {
3615
- provide: MSAL_GUARD_CONFIG,
3616
- useFactory: MSALGuardConfigFactory
3617
- },
3618
- {
3619
- provide: MSAL_INTERCEPTOR_CONFIG,
3620
- deps: [EnvironmentService],
3621
- useFactory: MSALInterceptorConfigFactory
3622
- },
3623
- MsalService,
3624
- MsalBroadcastService
3625
- ], imports: [
3626
- MatButtonModule
3627
- ], template: "<div class=\"login-oauth\">\r\n @if(showInfo()) {\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n @if(applicationName()) {\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{applicationName()}} e dei servizi ad esso\r\n connessi.</p>\r\n }\r\n </div>\r\n }\r\n @if (allowMicrosoft()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginMSAL()\" aria-label=\"Effettua accesso\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n }\r\n @if (allowGoogle()) {\r\n <div class=\"button\">\r\n <button mat-flat-button (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n aria-label=\"Effettua accesso\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".login-oauth{text-align:center}.login-oauth .button{padding:10px 0;width:100%}.login-oauth .message{padding:0 0 10px!important;font-size:small}\n"] }]
3628
- }], ctorParameters: () => [], propDecorators: { success: [{ type: i0.Output, args: ["success"] }], showInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "showInfo", required: false }] }], applicationName: [{ type: i0.Input, args: [{ isSignal: true, alias: "applicationName", required: false }] }], autoInitialize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoInitialize", required: false }] }], allowMicrosoft: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowMicrosoft", required: false }] }], allowGoogle: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowGoogle", required: false }] }] } });
3629
- const createFakeGoogleWrapper = () => {
3630
- const googleLoginWrapper = document.createElement("div");
3631
- // Or you can simple hide it in CSS rule for custom-google-button
3632
- googleLoginWrapper.style.display = "none";
3633
- googleLoginWrapper.classList.add("custom-google-button");
3634
- // Add the wrapper to body
3635
- document.body.appendChild(googleLoginWrapper);
3636
- // Use GSI javascript api to render the button inside our wrapper
3637
- // You can ignore the properties because this button will not appear
3638
- // @ts-ignore
3639
- window.google.accounts.id.renderButton(googleLoginWrapper, {
3640
- type: "icon",
3641
- width: "200",
3642
- });
3643
- const googleLoginWrapperButton = googleLoginWrapper.querySelector("div[role=button]");
3644
- return {
3645
- click: () => {
3646
- // @ts-ignore
3647
- googleLoginWrapperButton.click();
3648
- },
3649
- };
3650
- };
3651
- var googleButtonWrapper;
3652
-
3653
- class LoginOAuthOkMSComponent {
3654
- constructor() {
3655
- /** Message displayed while the popup is completing authentication. */
3656
- this.message = input('Accesso in corso...', /* @ts-ignore */
3657
- ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
3658
- // MSAL v5 popup flow: parse the auth response from the URL and send
3659
- // it back to the opener window via BroadcastChannel, then close the popup.
3660
- broadcastResponseToMainFrame();
3661
- }
3662
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: LoginOAuthOkMSComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3663
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.0", type: LoginOAuthOkMSComponent, isStandalone: true, selector: "app-login-oauth-ok-ms", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" color=\"primary\"></mat-progress-bar>\r\n </div>\r\n</div>\r\n", styles: [".login-auto{padding:20px 0}.login-auto .message{font-size:large;font-weight:700;color:var(--ars-color-primary);max-width:300px;text-align:center;width:100%;padding:40px 0}\n"], dependencies: [{ kind: "ngmodule", type: FlexModule }, { kind: "directive", type: i1$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i1$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i1$1.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i2$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3664
- }
3665
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: LoginOAuthOkMSComponent, decorators: [{
3666
- type: Component,
3667
- args: [{ selector: 'app-login-oauth-ok-ms', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FlexModule, MatProgressBarModule], template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" fxFill>\r\n <div class=\"login-auto fade-in\">\r\n <div class=\"message\">\r\n Autenticazione in corso...\r\n </div>\r\n <mat-progress-bar mode=\"indeterminate\" color=\"primary\"></mat-progress-bar>\r\n </div>\r\n</div>\r\n", styles: [".login-auto{padding:20px 0}.login-auto .message{font-size:large;font-weight:700;color:var(--ars-color-primary);max-width:300px;text-align:center;width:100%;padding:40px 0}\n"] }]
3668
- }], ctorParameters: () => [], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }] } });
3669
-
3670
3414
  /*
3671
3415
  * Public API Surface of ars-utils
3672
3416
  */
@@ -3675,5 +3419,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
3675
3419
  * Generated bundle index. Do not edit.
3676
3420
  */
3677
3421
 
3678
- export { ApplicationDialogService, ArsUIApplicationModule, ButtonSelectorComponent, ButtonToggleComponent, CalendarEmptyHeader, ChipsSelectorComponent, CurrentFilter, CurrentFilterChanged, CurrentFilterItem, FileInputComponent, FilePreviewComponent, FilterBarComponent, Filters, ItemNode, LoginOAuthComponent, LoginOAuthOkMSComponent, LoginOAuthType, MSALGuardConfigFactory, MSALInstanceFactory, MSALInterceptorConfigFactory, PromptDateDialogComponent, PromptDialogComponent, PromptDialogType, PromptOtpDialogComponent, PromptTimeDialogComponent, ResizeTableColumnDirective, SelectDialogComponent, SelectFileDialogComponent, SelectPictureDialogComponent, SelectTreeDialogComponent, SelectableItem, SelectableNode, SendToDialogComponent, TreeDataSource, TreePickerComponent, provideArsUIApplication };
3422
+ export { ApplicationDialogService, ArsUIApplicationModule, ButtonSelectorComponent, ButtonToggleComponent, CalendarEmptyHeader, ChipsSelectorComponent, CurrentFilter, CurrentFilterChanged, CurrentFilterItem, FileInputComponent, FilePreviewComponent, FilterBarComponent, Filters, ItemNode, PromptDateDialogComponent, PromptDialogComponent, PromptDialogType, PromptOtpDialogComponent, PromptTimeDialogComponent, ResizeTableColumnDirective, SelectDialogComponent, SelectFileDialogComponent, SelectPictureDialogComponent, SelectTreeDialogComponent, SelectableItem, SelectableNode, SendToDialogComponent, TreeDataSource, TreePickerComponent, provideArsUIApplication };
3679
3423
  //# sourceMappingURL=arsedizioni-ars-utils-ui.application.mjs.map