@arsedizioni/ars-utils 18.1.53 → 18.1.55

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 (44) hide show
  1. package/core/directives/autoFocusDirective.d.ts +2 -3
  2. package/core/directives/validators.d.ts +0 -8
  3. package/core/pipes/format.pipe.d.ts +0 -1
  4. package/core/pipes/replace.pipe.d.ts +0 -2
  5. package/core/pipes/safe-html.pipe.d.ts +1 -2
  6. package/core/pipes/safe-url.pipe.d.ts +1 -2
  7. package/esm2022/core/directives/autoFocusDirective.mjs +7 -7
  8. package/esm2022/core/directives/validators.mjs +9 -16
  9. package/esm2022/core/pipes/format.pipe.mjs +2 -3
  10. package/esm2022/core/pipes/replace.pipe.mjs +7 -7
  11. package/esm2022/core/pipes/safe-html.pipe.mjs +7 -7
  12. package/esm2022/core/pipes/safe-url.pipe.mjs +7 -7
  13. package/esm2022/core/system.mjs +2 -2
  14. package/esm2022/ui/ui/dialogs/confirm/confirm-dialog.component.mjs +3 -3
  15. package/esm2022/ui.application/ui/dialogs/prompt/prompt-dialog.component.mjs +3 -3
  16. package/esm2022/ui.application/ui/dialogs/prompt-date/prompt-date-dialog.component.mjs +3 -3
  17. package/esm2022/ui.application/ui/dialogs/prompt-time/prompt-time-dialog.component.mjs +3 -3
  18. package/esm2022/ui.application/ui/dialogs/select/select-dialog.component.mjs +4 -4
  19. package/esm2022/ui.application/ui/dialogs/select-file/select-file-dialog.component.mjs +18 -22
  20. package/esm2022/ui.application/ui/dialogs/select-picture/select-picture-dialog.component.mjs +18 -19
  21. package/esm2022/ui.application/ui/dialogs/select-tree/select-tree-dialog.component.mjs +60 -60
  22. package/esm2022/ui.application/ui/dialogs/send-to/send-to-dialog.component.mjs +30 -28
  23. package/esm2022/ui.application/ui/directives/resize-table-column.directive.mjs +8 -8
  24. package/esm2022/ui.oauth/public_api.mjs +2 -2
  25. package/esm2022/ui.oauth/ui/components/login/login-oauth.component.mjs +194 -0
  26. package/fesm2022/arsedizioni-ars-utils-core.mjs +29 -37
  27. package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
  28. package/fesm2022/arsedizioni-ars-utils-ui.application.mjs +122 -120
  29. package/fesm2022/arsedizioni-ars-utils-ui.application.mjs.map +1 -1
  30. package/fesm2022/arsedizioni-ars-utils-ui.mjs +2 -2
  31. package/fesm2022/arsedizioni-ars-utils-ui.mjs.map +1 -1
  32. package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs +36 -40
  33. package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs.map +1 -1
  34. package/package.json +13 -13
  35. package/ui.application/ui/components/file-input/file-input.component.d.ts +1 -1
  36. package/ui.application/ui/components/filter-bar/filter-bar.component.d.ts +1 -1
  37. package/ui.application/ui/dialogs/select/select-dialog.component.d.ts +6 -6
  38. package/ui.application/ui/dialogs/select-file/select-file-dialog.component.d.ts +3 -6
  39. package/ui.application/ui/dialogs/select-picture/select-picture-dialog.component.d.ts +4 -6
  40. package/ui.application/ui/dialogs/select-tree/select-tree-dialog.component.d.ts +23 -27
  41. package/ui.application/ui/dialogs/send-to/send-to-dialog.component.d.ts +7 -7
  42. package/ui.application/ui/directives/resize-table-column.directive.d.ts +3 -4
  43. package/ui.oauth/public_api.d.ts +1 -1
  44. package/ui.oauth/ui/components/login/login-oauth.component.d.ts +38 -0
@@ -1,12 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
- import { NgModule, EventEmitter, Component, Output, Input } from '@angular/core';
3
- import * as i1 from '@azure/msal-angular';
4
- import { MSAL_INSTANCE, MSAL_GUARD_CONFIG, MSAL_INTERCEPTOR_CONFIG, MsalService, MsalBroadcastService } from '@azure/msal-angular';
5
- import { PublicClientApplication, BrowserCacheLocation, InteractionType, EventType } from '@azure/msal-browser';
6
- import { Subject, filter, takeUntil } from 'rxjs';
7
- import * as i2 from '@angular/material/button';
2
+ import { NgModule, inject, NgZone, EventEmitter, input, signal, Component, ChangeDetectionStrategy, Output } from '@angular/core';
3
+ import * as i1 from '@angular/material/button';
8
4
  import { MatButtonModule } from '@angular/material/button';
9
5
  import { EnvironmentService } from '@arsedizioni/ars-utils/core';
6
+ import { MsalBroadcastService, MsalService, MSAL_INSTANCE, MSAL_GUARD_CONFIG, MSAL_INTERCEPTOR_CONFIG } from '@azure/msal-angular';
7
+ import { PublicClientApplication, BrowserCacheLocation, InteractionType, EventType } from '@azure/msal-browser';
8
+ import { Subject, filter, takeUntil } from 'rxjs';
10
9
 
11
10
  var LoginOAuthType;
12
11
  (function (LoginOAuthType) {
@@ -55,24 +54,24 @@ function MSALGuardConfigFactory() {
55
54
  };
56
55
  }
57
56
  class LoginOAuthComponent {
58
- constructor($broadcastMSAL, $loginMSAL, ngZone) {
59
- this.$broadcastMSAL = $broadcastMSAL;
60
- this.$loginMSAL = $loginMSAL;
61
- this.ngZone = ngZone;
62
- this.__d$ = new Subject();
57
+ constructor() {
58
+ this.unsubscribe = new Subject();
59
+ this.msalBroadcastService = inject(MsalBroadcastService);
60
+ this.msaLService = inject(MsalService);
61
+ this.ngZone = inject(NgZone);
63
62
  this.success = new EventEmitter();
64
- this.appName = null;
65
- this.autoInitialize = false;
66
- this.OAUTHReady = false;
67
- this.OAUTHMicrosoftReady = false;
68
- this.OAUTHGoogleReady = false;
63
+ this.appName = input();
64
+ this.autoInitialize = input(false);
65
+ this.oauthReady = signal(false);
66
+ this.oauthMicrosoftReady = signal(false);
67
+ this.oauthGoogleReady = signal(false);
69
68
  }
70
69
  ngOnInit() {
71
- if (this.autoInitialize) {
70
+ if (this.autoInitialize()) {
72
71
  this.initialize();
73
72
  }
74
- this.$broadcastMSAL.msalSubject$
75
- .pipe(filter((msg) => msg.eventType === EventType.ACQUIRE_TOKEN_SUCCESS), takeUntil(this.__d$))
73
+ this.msalBroadcastService.msalSubject$
74
+ .pipe(filter((msg) => msg.eventType === EventType.ACQUIRE_TOKEN_SUCCESS), takeUntil(this.unsubscribe))
76
75
  .subscribe((r) => {
77
76
  if (r) {
78
77
  this.success.emit({ type: 1, token: r.payload.accessToken });
@@ -80,22 +79,23 @@ class LoginOAuthComponent {
80
79
  });
81
80
  }
82
81
  ngOnDestroy() {
83
- this.__d$.next();
84
- this.__d$.complete();
82
+ this.unsubscribe.next();
83
+ this.unsubscribe.complete();
85
84
  }
86
85
  /**
87
86
  * Initialize open authentication
87
+ * Must be a public method
88
88
  */
89
89
  initialize() {
90
- if (this.OAUTHReady) {
90
+ if (this.oauthReady()) {
91
91
  return; // Already done
92
92
  }
93
- this.OAUTHReady = true;
93
+ this.oauthReady.set(true);
94
94
  // Load MS stack
95
- this.$loginMSAL.initialize()
96
- .pipe(takeUntil(this.__d$))
95
+ this.msaLService.initialize()
96
+ .pipe(takeUntil(this.unsubscribe))
97
97
  .subscribe(() => {
98
- this.OAUTHMicrosoftReady = true;
98
+ this.oauthMicrosoftReady.set(true);
99
99
  });
100
100
  // Load google maps script after view init
101
101
  const DSLScript = document.createElement('script');
@@ -118,18 +118,18 @@ class LoginOAuthComponent {
118
118
  }
119
119
  });
120
120
  googleButtonWrapper = createFakeGoogleWrapper();
121
- this.OAUTHGoogleReady = true;
121
+ this.oauthGoogleReady.set(true);
122
122
  };
123
123
  }
124
124
  /**
125
125
  * Perform login using MSAL
126
126
  */
127
127
  loginMSAL() {
128
- this.$loginMSAL.loginPopup()
128
+ this.msaLService.loginPopup()
129
129
  .subscribe({
130
130
  next: (r) => {
131
- this.$loginMSAL.instance.setActiveAccount(r.account);
132
- this.$loginMSAL.acquireTokenSilent({
131
+ this.msaLService.instance.setActiveAccount(r.account);
132
+ this.msaLService.acquireTokenSilent({
133
133
  scopes: [
134
134
  "api://6b2c080f-6ab0-4511-a9df-0bce69db5833/AngularSPAAuthScope"
135
135
  ],
@@ -145,8 +145,8 @@ class LoginOAuthComponent {
145
145
  // Use wrapper click to prevent Illegal invocation exception
146
146
  googleButtonWrapper.click();
147
147
  }
148
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: LoginOAuthComponent, deps: [{ token: i1.MsalBroadcastService }, { token: i1.MsalService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
149
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: LoginOAuthComponent, isStandalone: true, selector: "login-oauth", inputs: { appName: "appName", autoInitialize: "autoInitialize" }, outputs: { success: "success" }, providers: [{
148
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: LoginOAuthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
149
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.0.3", type: LoginOAuthComponent, isStandalone: true, selector: "login-oauth", inputs: { appName: { classPropertyName: "appName", publicName: "appName", isSignal: true, isRequired: false, transformFunction: null }, autoInitialize: { classPropertyName: "autoInitialize", publicName: "autoInitialize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { success: "success" }, providers: [{
150
150
  provide: MSAL_INSTANCE,
151
151
  deps: [EnvironmentService],
152
152
  useFactory: MSALInstanceFactory
@@ -161,11 +161,11 @@ class LoginOAuthComponent {
161
161
  useFactory: MSALInterceptorConfigFactory
162
162
  },
163
163
  MsalService,
164
- MsalBroadcastService], ngImport: i0, template: "<div class=\"login-oauth\">\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{appName}} e dei servizi ad esso connessi.</p>\r\n </div>\r\n <div class=\"button\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginMSAL()\" [attr.aria-label]=\"'Effettua accesso'\"\r\n [disabled]=\"!OAUTHMicrosoftReady\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n <div class=\"button\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n [attr.aria-label]=\"'Effettua accesso'\" [disabled]=\"!OAUTHGoogleReady\">\r\n Accedi con Google</button>\r\n </div>\r\n</div>", styles: [".login-oauth{text-align:center}.login-oauth .button{padding:10px 0;width:100%}.login-oauth .message{padding-bottom:10px;font-size:small}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] }); }
164
+ MsalBroadcastService], ngImport: i0, template: "<div class=\"login-oauth\">\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{appName()}} e dei servizi ad esso connessi.</p>\r\n </div>\r\n <div class=\"button\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginMSAL()\" [attr.aria-label]=\"'Effettua accesso'\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n <div class=\"button\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n [attr.aria-label]=\"'Effettua accesso'\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n</div>", styles: [".login-oauth{text-align:center}.login-oauth .button{padding:10px 0;width:100%}.login-oauth .message{padding-bottom:10px;font-size:small}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
165
165
  }
166
166
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: LoginOAuthComponent, decorators: [{
167
167
  type: Component,
168
- args: [{ selector: 'login-oauth', standalone: true, providers: [{
168
+ args: [{ selector: 'login-oauth', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{
169
169
  provide: MSAL_INSTANCE,
170
170
  deps: [EnvironmentService],
171
171
  useFactory: MSALInstanceFactory
@@ -182,13 +182,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
182
182
  MsalService,
183
183
  MsalBroadcastService], imports: [
184
184
  MatButtonModule
185
- ], template: "<div class=\"login-oauth\">\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{appName}} e dei servizi ad esso connessi.</p>\r\n </div>\r\n <div class=\"button\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginMSAL()\" [attr.aria-label]=\"'Effettua accesso'\"\r\n [disabled]=\"!OAUTHMicrosoftReady\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n <div class=\"button\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n [attr.aria-label]=\"'Effettua accesso'\" [disabled]=\"!OAUTHGoogleReady\">\r\n Accedi con Google</button>\r\n </div>\r\n</div>", styles: [".login-oauth{text-align:center}.login-oauth .button{padding:10px 0;width:100%}.login-oauth .message{padding-bottom:10px;font-size:small}\n"] }]
186
- }], ctorParameters: () => [{ type: i1.MsalBroadcastService }, { type: i1.MsalService }, { type: i0.NgZone }], propDecorators: { success: [{
185
+ ], template: "<div class=\"login-oauth\">\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{appName()}} e dei servizi ad esso connessi.</p>\r\n </div>\r\n <div class=\"button\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginMSAL()\" [attr.aria-label]=\"'Effettua accesso'\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n <div class=\"button\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n [attr.aria-label]=\"'Effettua accesso'\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n</div>", styles: [".login-oauth{text-align:center}.login-oauth .button{padding:10px 0;width:100%}.login-oauth .message{padding-bottom:10px;font-size:small}\n"] }]
186
+ }], propDecorators: { success: [{
187
187
  type: Output
188
- }], appName: [{
189
- type: Input
190
- }], autoInitialize: [{
191
- type: Input
192
188
  }] } });
193
189
  const createFakeGoogleWrapper = () => {
194
190
  const googleLoginWrapper = document.createElement("div");
@@ -1 +1 @@
1
- {"version":3,"file":"arsedizioni-ars-utils-ui.oauth.mjs","sources":["../../../projects/ars-utils/ui.oauth/ui/definitions.ts","../../../projects/ars-utils/ui.oauth/ui/ui.module.ts","../../../projects/ars-utils/ui.oauth/ui/components/login/loginOAuth.component.ts","../../../projects/ars-utils/ui.oauth/ui/components/login/loginOAuth.component.html","../../../projects/ars-utils/ui.oauth/public_api.ts","../../../projects/ars-utils/ui.oauth/arsedizioni-ars-utils-ui.oauth.ts"],"sourcesContent":["export enum LoginOAuthType {\r\n None = 0,\r\n Microsoft = 1,\r\n Google = 2\r\n}\r\n\r\nexport interface LoginOAuthResult {\r\n type: number,\r\n token: string\r\n}","import { NgModule } from \"@angular/core\";\r\n\r\n// Material\r\n\r\n@NgModule()\r\nexport class ArsUIOAuthModule { }\r\n\r\nexport * from \"./definitions\";\r\n\r\n\r\n","import { Component, EventEmitter, Input, NgZone, OnDestroy, OnInit, Output } from '@angular/core';\r\nimport { MSAL_GUARD_CONFIG, MSAL_INSTANCE, MSAL_INTERCEPTOR_CONFIG, MsalBroadcastService, MsalGuardConfiguration, MsalInterceptorConfiguration, MsalService } from '@azure/msal-angular';\r\nimport { AuthenticationResult, BrowserCacheLocation, EventMessage, EventType, IPublicClientApplication, InteractionType, PublicClientApplication } from '@azure/msal-browser';\r\nimport { Subject, filter, takeUntil } from 'rxjs';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { LoginOAuthResult } from '../../definitions';\r\nimport { EnvironmentService } from '@arsedizioni/ars-utils/core';\r\n\r\nexport function MSALInstanceFactory(environment: EnvironmentService): IPublicClientApplication {\r\n return new PublicClientApplication({\r\n auth: {\r\n clientId: \"6b2c080f-6ab0-4511-a9df-0bce69db5833\",\r\n authority: \"https://login.microsoftonline.com/common\",\r\n redirectUri: environment.appUri, // This is your redir\r\n },\r\n cache: {\r\n cacheLocation: BrowserCacheLocation.LocalStorage\r\n }\r\n });\r\n}\r\n\r\nexport function MSALInterceptorConfigFactory(environment: EnvironmentService): MsalInterceptorConfiguration {\r\n \r\n return {\r\n interactionType: InteractionType.Popup,\r\n protectedResourceMap: new Map([\r\n [environment.appServiceUri + '/login', [\"api://6b2c080f-6ab0-4511-a9df-0bce69db5833/AngularSPAAuthScope\"]],\r\n [\"https://graph.microsoft.com/v2.0/me\", [\"user.read\"]],\r\n ])\r\n };\r\n}\r\n\r\nexport function MSALGuardConfigFactory(): MsalGuardConfiguration {\r\n return {\r\n interactionType: InteractionType.Popup,\r\n authRequest: {\r\n scopes: [\"user.read\"]\r\n }\r\n };\r\n}\r\n\r\n@Component({\r\n selector: 'login-oauth',\r\n templateUrl: './loginOAuth.component.html',\r\n styleUrls: ['./loginOAuth.component.scss'],\r\n standalone: true,\r\n providers: [{\r\n provide: MSAL_INSTANCE,\r\n deps:[EnvironmentService],\r\n useFactory: MSALInstanceFactory\r\n },\r\n {\r\n provide: MSAL_GUARD_CONFIG,\r\n useFactory: MSALGuardConfigFactory\r\n },\r\n {\r\n provide: MSAL_INTERCEPTOR_CONFIG,\r\n deps:[EnvironmentService],\r\n useFactory: MSALInterceptorConfigFactory\r\n },\r\n MsalService,\r\n MsalBroadcastService],\r\n imports: [\r\n MatButtonModule\r\n ]\r\n})\r\nexport class LoginOAuthComponent implements OnInit, OnDestroy {\r\n private __d$: Subject<void> = new Subject<void>();\r\n\r\n @Output() success = new EventEmitter<LoginOAuthResult>();\r\n\r\n @Input() appName: string | null = null;\r\n @Input() autoInitialize: boolean | null = false;\r\n\r\n\r\n OAUTHReady: boolean = false;\r\n OAUTHMicrosoftReady: boolean = false;\r\n OAUTHGoogleReady: boolean = false;\r\n\r\n\r\n constructor(\r\n private $broadcastMSAL: MsalBroadcastService,\r\n private $loginMSAL: MsalService,\r\n private ngZone: NgZone\r\n ) {\r\n }\r\n\r\n ngOnInit() {\r\n if (this.autoInitialize) {\r\n this.initialize();\r\n }\r\n\r\n this.$broadcastMSAL.msalSubject$\r\n .pipe(\r\n filter((msg: EventMessage) => msg.eventType === EventType.ACQUIRE_TOKEN_SUCCESS),\r\n takeUntil(this.__d$)\r\n )\r\n .subscribe((r: any) => { \r\n if (r) {\r\n this.success.emit({ type: 1, token: r.payload.accessToken });\r\n }\r\n });\r\n\r\n }\r\n\r\n ngOnDestroy() {\r\n this.__d$.next();\r\n this.__d$.complete();\r\n }\r\n\r\n /**\r\n * Initialize open authentication \r\n */\r\n initialize() {\r\n if (this.OAUTHReady) {\r\n return; // Already done\r\n }\r\n this.OAUTHReady = true;\r\n\r\n // Load MS stack\r\n this.$loginMSAL.initialize()\r\n .pipe(takeUntil(this.__d$))\r\n .subscribe(() => {\r\n this.OAUTHMicrosoftReady = true;\r\n });\r\n\r\n // Load google maps script after view init\r\n const DSLScript = document.createElement('script');\r\n DSLScript.src = 'https://accounts.google.com/gsi/client';\r\n DSLScript.type = 'text/javascript';\r\n document.body.appendChild(DSLScript);\r\n document.body.removeChild(DSLScript);\r\n\r\n // @ts-ignore\r\n window.onGoogleLibraryLoad = () => {\r\n // initialize google account\r\n // @ts-ignore\r\n google.accounts.id.initialize({\r\n client_id: '71204983077-ag31h3bgt2udcbfr9nn84r9rni2k3snp.apps.googleusercontent.com',\r\n cancel_on_tap_outside: true,\r\n auto_select: false,\r\n callback: (r: any) => {\r\n this.ngZone.run(() => {\r\n this.success.emit({ type: 2, token: r.credential });\r\n });\r\n }\r\n });\r\n\r\n googleButtonWrapper = createFakeGoogleWrapper();\r\n\r\n this.OAUTHGoogleReady = true;\r\n };\r\n\r\n }\r\n\r\n /**\r\n * Perform login using MSAL\r\n */\r\n loginMSAL() {\r\n this.$loginMSAL.loginPopup()\r\n .subscribe({\r\n next: (r: AuthenticationResult) => {\r\n this.$loginMSAL.instance.setActiveAccount(r.account);\r\n this.$loginMSAL.acquireTokenSilent({\r\n scopes: [\r\n \"api://6b2c080f-6ab0-4511-a9df-0bce69db5833/AngularSPAAuthScope\"\r\n ],\r\n account: r.account\r\n })\r\n }\r\n });\r\n }\r\n\r\n /**\r\n* Perform login using Google\r\n*/\r\n loginGoogle() {\r\n // Use wrapper click to prevent Illegal invocation exception\r\n googleButtonWrapper.click();\r\n }\r\n}\r\n\r\nconst createFakeGoogleWrapper = () => {\r\n const googleLoginWrapper = document.createElement(\"div\");\r\n // Or you can simple hide it in CSS rule for custom-google-button\r\n googleLoginWrapper.style.display = \"none\";\r\n googleLoginWrapper.classList.add(\"custom-google-button\");\r\n\r\n // Add the wrapper to body\r\n document.body.appendChild(googleLoginWrapper);\r\n\r\n // Use GSI javascript api to render the button inside our wrapper\r\n // You can ignore the properties because this button will not appear\r\n // @ts-ignore\r\n window.google.accounts.id.renderButton(googleLoginWrapper, {\r\n type: \"icon\",\r\n width: \"200\",\r\n });\r\n\r\n const googleLoginWrapperButton =\r\n googleLoginWrapper.querySelector(\"div[role=button]\");\r\n\r\n return {\r\n click: () => {\r\n // @ts-ignore\r\n googleLoginWrapperButton.click();\r\n },\r\n };\r\n};\r\nvar googleButtonWrapper: any = null;\r\n\r\n","<div class=\"login-oauth\">\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{appName}} e dei servizi ad esso connessi.</p>\r\n </div>\r\n <div class=\"button\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginMSAL()\" [attr.aria-label]=\"'Effettua accesso'\"\r\n [disabled]=\"!OAUTHMicrosoftReady\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n <div class=\"button\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n [attr.aria-label]=\"'Effettua accesso'\" [disabled]=\"!OAUTHGoogleReady\">\r\n Accedi con Google</button>\r\n </div>\r\n</div>","/*\r\n * Public API Surface of ars-utils\r\n */\r\nexport * from './ui/ui.module';\r\nexport * from './ui/components/login/loginOAuth.component';\r\n\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;IAAY,eAIX;AAJD,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,cAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ,CAAA;AACR,IAAA,cAAA,CAAA,cAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAa,CAAA;AACb,IAAA,cAAA,CAAA,cAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAU,CAAA;AACZ,CAAC,EAJW,cAAc,KAAd,cAAc,GAIzB,EAAA,CAAA,CAAA;;ACFD;MAGa,gBAAgB,CAAA;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;+GAAhB,gBAAgB,EAAA,CAAA,CAAA,EAAA;+GAAhB,gBAAgB,EAAA,CAAA,CAAA,EAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B,QAAQ;;;ACIH,SAAU,mBAAmB,CAAC,WAA+B,EAAA;IACjE,OAAO,IAAI,uBAAuB,CAAC;AACjC,QAAA,IAAI,EAAE;AACJ,YAAA,QAAQ,EAAE,sCAAsC;AAChD,YAAA,SAAS,EAAE,0CAA0C;AACrD,YAAA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AEjNnC;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"arsedizioni-ars-utils-ui.oauth.mjs","sources":["../../../projects/ars-utils/ui.oauth/ui/definitions.ts","../../../projects/ars-utils/ui.oauth/ui/ui.module.ts","../../../projects/ars-utils/ui.oauth/ui/components/login/login-oauth.component.ts","../../../projects/ars-utils/ui.oauth/ui/components/login/login-oauth.component.html","../../../projects/ars-utils/ui.oauth/public_api.ts","../../../projects/ars-utils/ui.oauth/arsedizioni-ars-utils-ui.oauth.ts"],"sourcesContent":["export enum LoginOAuthType {\r\n None = 0,\r\n Microsoft = 1,\r\n Google = 2\r\n}\r\n\r\nexport interface LoginOAuthResult {\r\n type: number,\r\n token: string\r\n}","import { NgModule } from \"@angular/core\";\r\n\r\n// Material\r\n\r\n@NgModule()\r\nexport class ArsUIOAuthModule { }\r\n\r\nexport * from \"./definitions\";\r\n\r\n\r\n","import { ChangeDetectionStrategy, Component, EventEmitter, NgZone, OnDestroy, OnInit, Output, inject, input, signal } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { EnvironmentService } from '@arsedizioni/ars-utils/core';\r\nimport { MSAL_GUARD_CONFIG, MSAL_INSTANCE, MSAL_INTERCEPTOR_CONFIG, MsalBroadcastService, MsalGuardConfiguration, MsalInterceptorConfiguration, MsalService } from '@azure/msal-angular';\r\nimport { AuthenticationResult, BrowserCacheLocation, EventMessage, EventType, IPublicClientApplication, InteractionType, PublicClientApplication } from '@azure/msal-browser';\r\nimport { Subject, filter, takeUntil } from 'rxjs';\r\nimport { LoginOAuthResult } from '../../definitions';\r\n\r\nexport function MSALInstanceFactory(environment: EnvironmentService): IPublicClientApplication {\r\n return new PublicClientApplication({\r\n auth: {\r\n clientId: \"6b2c080f-6ab0-4511-a9df-0bce69db5833\",\r\n authority: \"https://login.microsoftonline.com/common\",\r\n redirectUri: environment.appUri, // This is your redir\r\n },\r\n cache: {\r\n cacheLocation: BrowserCacheLocation.LocalStorage\r\n }\r\n });\r\n}\r\n\r\nexport function MSALInterceptorConfigFactory(environment: EnvironmentService): MsalInterceptorConfiguration {\r\n \r\n return {\r\n interactionType: InteractionType.Popup,\r\n protectedResourceMap: new Map([\r\n [environment.appServiceUri + '/login', [\"api://6b2c080f-6ab0-4511-a9df-0bce69db5833/AngularSPAAuthScope\"]],\r\n [\"https://graph.microsoft.com/v2.0/me\", [\"user.read\"]],\r\n ])\r\n };\r\n}\r\n\r\nexport function MSALGuardConfigFactory(): MsalGuardConfiguration {\r\n return {\r\n interactionType: InteractionType.Popup,\r\n authRequest: {\r\n scopes: [\"user.read\"]\r\n }\r\n };\r\n}\r\n\r\n@Component({\r\n selector: 'login-oauth',\r\n templateUrl: './login-oauth.component.html',\r\n styleUrls: ['./login-oauth.component.scss'],\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [{\r\n provide: MSAL_INSTANCE,\r\n deps:[EnvironmentService],\r\n useFactory: MSALInstanceFactory\r\n },\r\n {\r\n provide: MSAL_GUARD_CONFIG,\r\n useFactory: MSALGuardConfigFactory\r\n },\r\n {\r\n provide: MSAL_INTERCEPTOR_CONFIG,\r\n deps:[EnvironmentService],\r\n useFactory: MSALInterceptorConfigFactory\r\n },\r\n MsalService,\r\n MsalBroadcastService],\r\n imports: [\r\n MatButtonModule\r\n ]\r\n})\r\nexport class LoginOAuthComponent implements OnInit, OnDestroy {\r\n private unsubscribe: Subject<void> = new Subject<void>();\r\n private msalBroadcastService = inject(MsalBroadcastService);\r\n private msaLService = inject(MsalService);\r\n private ngZone = inject(NgZone);\r\n\r\n @Output() success = new EventEmitter<LoginOAuthResult>();\r\n\r\n appName = input<string | null>();\r\n autoInitialize = input<boolean | null>(false);\r\n\r\n\r\n protected oauthReady = signal<boolean>(false);\r\n protected oauthMicrosoftReady = signal<boolean>(false);\r\n protected oauthGoogleReady = signal<boolean>(false);\r\n\r\n\r\n ngOnInit() {\r\n if (this.autoInitialize()) {\r\n this.initialize();\r\n }\r\n this.msalBroadcastService.msalSubject$\r\n .pipe(\r\n filter((msg: EventMessage) => msg.eventType === EventType.ACQUIRE_TOKEN_SUCCESS),\r\n takeUntil(this.unsubscribe)\r\n )\r\n .subscribe((r: any) => { \r\n if (r) {\r\n this.success.emit({ type: 1, token: r.payload.accessToken });\r\n }\r\n });\r\n\r\n }\r\n\r\n ngOnDestroy() {\r\n this.unsubscribe.next();\r\n this.unsubscribe.complete();\r\n }\r\n\r\n /**\r\n * Initialize open authentication \r\n * Must be a public method \r\n */\r\n initialize() {\r\n if (this.oauthReady()) {\r\n return; // Already done\r\n }\r\n this.oauthReady.set(true);\r\n\r\n // Load MS stack\r\n this.msaLService.initialize()\r\n .pipe(takeUntil(this.unsubscribe))\r\n .subscribe(() => {\r\n this.oauthMicrosoftReady.set(true);\r\n });\r\n\r\n // Load google maps script after view init\r\n const DSLScript = document.createElement('script');\r\n DSLScript.src = 'https://accounts.google.com/gsi/client';\r\n DSLScript.type = 'text/javascript';\r\n document.body.appendChild(DSLScript);\r\n document.body.removeChild(DSLScript);\r\n\r\n // @ts-ignore\r\n window.onGoogleLibraryLoad = () => {\r\n // initialize google account\r\n // @ts-ignore\r\n google.accounts.id.initialize({\r\n client_id: '71204983077-ag31h3bgt2udcbfr9nn84r9rni2k3snp.apps.googleusercontent.com',\r\n cancel_on_tap_outside: true,\r\n auto_select: false,\r\n callback: (r: any) => {\r\n this.ngZone.run(() => {\r\n this.success.emit({ type: 2, token: r.credential });\r\n });\r\n }\r\n });\r\n\r\n googleButtonWrapper = createFakeGoogleWrapper();\r\n\r\n this.oauthGoogleReady.set(true);\r\n };\r\n\r\n }\r\n\r\n /**\r\n * Perform login using MSAL\r\n */\r\n protected loginMSAL() {\r\n this.msaLService.loginPopup()\r\n .subscribe({\r\n next: (r: AuthenticationResult) => {\r\n this.msaLService.instance.setActiveAccount(r.account);\r\n this.msaLService.acquireTokenSilent({\r\n scopes: [\r\n \"api://6b2c080f-6ab0-4511-a9df-0bce69db5833/AngularSPAAuthScope\"\r\n ],\r\n account: r.account\r\n })\r\n }\r\n });\r\n }\r\n\r\n /**\r\n* Perform login using Google\r\n*/\r\n protected loginGoogle() {\r\n // Use wrapper click to prevent Illegal invocation exception\r\n googleButtonWrapper.click();\r\n }\r\n}\r\n\r\nconst createFakeGoogleWrapper = () => {\r\n const googleLoginWrapper = document.createElement(\"div\");\r\n // Or you can simple hide it in CSS rule for custom-google-button\r\n googleLoginWrapper.style.display = \"none\";\r\n googleLoginWrapper.classList.add(\"custom-google-button\");\r\n\r\n // Add the wrapper to body\r\n document.body.appendChild(googleLoginWrapper);\r\n\r\n // Use GSI javascript api to render the button inside our wrapper\r\n // You can ignore the properties because this button will not appear\r\n // @ts-ignore\r\n window.google.accounts.id.renderButton(googleLoginWrapper, {\r\n type: \"icon\",\r\n width: \"200\",\r\n });\r\n\r\n const googleLoginWrapperButton =\r\n googleLoginWrapper.querySelector(\"div[role=button]\");\r\n\r\n return {\r\n click: () => {\r\n // @ts-ignore\r\n googleLoginWrapperButton.click();\r\n },\r\n };\r\n};\r\nvar googleButtonWrapper: any = null;\r\n\r\n","<div class=\"login-oauth\">\r\n <div class=\"message\">\r\n <p>Questa sezione consente di accedere al servizio utilizzando un provider OAuth2.</p>\r\n <p>La email utilizzata deve essere collegata ad un utente valido di {{appName()}} e dei servizi ad esso connessi.</p>\r\n </div>\r\n <div class=\"button\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginMSAL()\" [attr.aria-label]=\"'Effettua accesso'\"\r\n [disabled]=\"!oauthMicrosoftReady()\" style=\"width: 100%;\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n <div class=\"button\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginGoogle()\" style=\"width: 100%;\"\r\n [attr.aria-label]=\"'Effettua accesso'\" [disabled]=\"!oauthGoogleReady()\">\r\n Accedi con Google</button>\r\n </div>\r\n</div>","/*\r\n * Public API Surface of ars-utils\r\n */\r\nexport * from './ui/ui.module';\r\nexport * from './ui/components/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E,4BAAA,OAAO,EAAE,uBAAuB;4BAChC,IAAI,EAAC,CAAC,kBAAkB,CAAC;AACzB,4BAAA,UAAU,EAAE,4BAA4B;AACzC,yBAAA;wBACC,WAAW;AACX,wBAAA,oBAAoB,CAAC,EACd,OAAA,EAAA;wBACP,eAAe;AAChB,qBAAA,EAAA,QAAA,EAAA,wzBAAA,EAAA,MAAA,EAAA,CAAA,4IAAA,CAAA,EAAA,CAAA;8BAQS,OAAO,EAAA,CAAA;sBAAhB,MAAM;;AA0GT,MAAM,uBAAuB,GAAG,MAAK;IACnC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;;AAEzD,IAAA,kBAAkB,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;AAC1C,IAAA,kBAAkB,CAAC,SAAS,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;;AAGzD,IAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;;;;IAK9C,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,YAAY,CAAC,kBAAkB,EAAE;AACzD,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,KAAK,EAAE,KAAK;AACb,KAAA,CAAC,CAAC;IAEH,MAAM,wBAAwB,GAC5B,kBAAkB,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAEvD,OAAO;QACL,KAAK,EAAE,MAAK;;YAEV,wBAAwB,CAAC,KAAK,EAAE,CAAC;SAClC;KACF,CAAC;AACJ,CAAC,CAAC;AACF,IAAI,mBAAmB,GAAQ,IAAI;;AE9MnC;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arsedizioni/ars-utils",
3
- "version": "18.1.53",
3
+ "version": "18.1.55",
4
4
  "author": {
5
5
  "email": "software@arsedizioni.it",
6
6
  "name": "Fabio Buscaroli, Alberto Doria"
@@ -59,18 +59,18 @@
59
59
  "esm": "./esm2022/help/arsedizioni-ars-utils-help.mjs",
60
60
  "default": "./fesm2022/arsedizioni-ars-utils-help.mjs"
61
61
  },
62
- "./support.common": {
63
- "types": "./support.common/index.d.ts",
64
- "esm2022": "./esm2022/support.common/arsedizioni-ars-utils-support.common.mjs",
65
- "esm": "./esm2022/support.common/arsedizioni-ars-utils-support.common.mjs",
66
- "default": "./fesm2022/arsedizioni-ars-utils-support.common.mjs"
67
- },
68
62
  "./support.ui": {
69
63
  "types": "./support.ui/index.d.ts",
70
64
  "esm2022": "./esm2022/support.ui/arsedizioni-ars-utils-support.ui.mjs",
71
65
  "esm": "./esm2022/support.ui/arsedizioni-ars-utils-support.ui.mjs",
72
66
  "default": "./fesm2022/arsedizioni-ars-utils-support.ui.mjs"
73
67
  },
68
+ "./support.common": {
69
+ "types": "./support.common/index.d.ts",
70
+ "esm2022": "./esm2022/support.common/arsedizioni-ars-utils-support.common.mjs",
71
+ "esm": "./esm2022/support.common/arsedizioni-ars-utils-support.common.mjs",
72
+ "default": "./fesm2022/arsedizioni-ars-utils-support.common.mjs"
73
+ },
74
74
  "./tinymce": {
75
75
  "types": "./tinymce/index.d.ts",
76
76
  "esm2022": "./esm2022/tinymce/arsedizioni-ars-utils-tinymce.mjs",
@@ -83,17 +83,17 @@
83
83
  "esm": "./esm2022/ui/arsedizioni-ars-utils-ui.mjs",
84
84
  "default": "./fesm2022/arsedizioni-ars-utils-ui.mjs"
85
85
  },
86
- "./ui.oauth": {
87
- "types": "./ui.oauth/index.d.ts",
88
- "esm2022": "./esm2022/ui.oauth/arsedizioni-ars-utils-ui.oauth.mjs",
89
- "esm": "./esm2022/ui.oauth/arsedizioni-ars-utils-ui.oauth.mjs",
90
- "default": "./fesm2022/arsedizioni-ars-utils-ui.oauth.mjs"
91
- },
92
86
  "./ui.application": {
93
87
  "types": "./ui.application/index.d.ts",
94
88
  "esm2022": "./esm2022/ui.application/arsedizioni-ars-utils-ui.application.mjs",
95
89
  "esm": "./esm2022/ui.application/arsedizioni-ars-utils-ui.application.mjs",
96
90
  "default": "./fesm2022/arsedizioni-ars-utils-ui.application.mjs"
91
+ },
92
+ "./ui.oauth": {
93
+ "types": "./ui.oauth/index.d.ts",
94
+ "esm2022": "./esm2022/ui.oauth/arsedizioni-ars-utils-ui.oauth.mjs",
95
+ "esm": "./esm2022/ui.oauth/arsedizioni-ars-utils-ui.oauth.mjs",
96
+ "default": "./fesm2022/arsedizioni-ars-utils-ui.oauth.mjs"
97
97
  }
98
98
  },
99
99
  "sideEffects": false
@@ -34,7 +34,7 @@ export declare class FileInputComponent implements OnDestroy, AfterViewInit, DoC
34
34
  minSizeMb: import("@angular/core").InputSignal<number>;
35
35
  isNew: import("@angular/core").InputSignal<boolean>;
36
36
  canPreview: import("@angular/core").InputSignal<boolean>;
37
- appearance: import("@angular/core").InputSignal<"outline" | "fill">;
37
+ appearance: import("@angular/core").InputSignal<"fill" | "outline">;
38
38
  accept: import("@angular/core").InputSignal<string>;
39
39
  get empty(): boolean;
40
40
  get errorState(): boolean;
@@ -19,7 +19,7 @@ export declare class FilterBarComponent implements OnInit {
19
19
  text2Length: import("@angular/core").InputSignal<string>;
20
20
  text3Length: import("@angular/core").InputSignal<string>;
21
21
  showTextSearchButton: import("@angular/core").InputSignal<boolean>;
22
- appearance: import("@angular/core").InputSignal<"outline" | "fill">;
22
+ appearance: import("@angular/core").InputSignal<"fill" | "outline">;
23
23
  text: string;
24
24
  text2: string;
25
25
  text3: string;
@@ -78,7 +78,7 @@ export declare class SelectDialogComponent implements OnInit {
78
78
  */
79
79
  protected doFilterByOptions(filterOption: any): void;
80
80
  /**
81
- * Apply filter
81
+ * Apply filter. This is accessible from public
82
82
  * @param params : the object with current parameters
83
83
  */
84
84
  doLookup(params: any): void;
@@ -91,23 +91,23 @@ export declare class SelectDialogComponent implements OnInit {
91
91
  * Apply filter
92
92
  * @param e : the MatPaginator PageEvent data
93
93
  */
94
- doLookupPage(e: any): void;
94
+ protected doLookupPage(e: any): void;
95
95
  /**
96
96
  * Append
97
97
  */
98
- doAppend(): void;
98
+ protected doAppend(): void;
99
99
  /**
100
100
  * Edit
101
101
  */
102
- doEdit(): void;
102
+ protected doEdit(): void;
103
103
  /**
104
104
  * View
105
105
  */
106
- doView(): void;
106
+ protected doView(): void;
107
107
  /**
108
108
  * Delete
109
109
  */
110
- doDelete(): void;
110
+ protected doDelete(): void;
111
111
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectDialogComponent, never>;
112
112
  static ɵcmp: i0.ɵɵComponentDeclaration<SelectDialogComponent, "ng-component", never, {}, { "done": "done"; "edit": "edit"; "view": "view"; "append": "append"; "delete": "delete"; "lookup": "lookup"; "lookupOptions": "lookupOptions"; "filter": "filter"; }, never, never, true, never>;
113
113
  }
@@ -1,14 +1,11 @@
1
1
  import { EventEmitter } from '@angular/core';
2
- import { MatDialogRef } from '@angular/material/dialog';
3
2
  import { SelectFile, SelectFileDialogData } from '../../definitions';
4
3
  import * as i0 from "@angular/core";
5
4
  export declare class SelectFileDialogComponent {
6
- private dialogRef;
7
5
  done: EventEmitter<SelectFile>;
8
- data: SelectFileDialogData;
9
- file: any;
10
- filePreview: any;
11
- constructor(dialogRef: MatDialogRef<SelectFileDialogComponent>, _data: SelectFileDialogData);
6
+ private dialogRef;
7
+ protected dialogData: SelectFileDialogData;
8
+ protected file: File | null;
12
9
  /**
13
10
  * Update preview
14
11
  * @param e : the event
@@ -1,14 +1,12 @@
1
1
  import { EventEmitter } from '@angular/core';
2
- import { MatDialogRef } from '@angular/material/dialog';
3
2
  import { SelectFile, SelectFileDialogData } from '../../definitions';
4
3
  import * as i0 from "@angular/core";
5
4
  export declare class SelectPictureDialogComponent {
6
- private dialogRef;
7
5
  done: EventEmitter<SelectFile>;
8
- data: SelectFileDialogData;
9
- file: any;
10
- filePreview: any;
11
- constructor(dialogRef: MatDialogRef<SelectPictureDialogComponent>, _data: SelectFileDialogData);
6
+ private dialogRef;
7
+ protected dialogData: SelectFileDialogData;
8
+ protected file: File | null;
9
+ protected filePreview: string | ArrayBuffer | null;
12
10
  /**
13
11
  * Update preview
14
12
  * @param e : the event
@@ -1,14 +1,12 @@
1
1
  import { FlatTreeControl } from '@angular/cdk/tree';
2
2
  import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
3
- import { MatDialogRef } from '@angular/material/dialog';
4
- import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
3
+ import { MatTreeFlatDataSource } from '@angular/material/tree';
5
4
  import { BehaviorSubject } from 'rxjs';
6
- import { ItemNode, SelectableNode, SelectDialogResult, SelectTreeDialogData } from '../../definitions';
5
+ import { ItemNode, SelectDialogResult, SelectTreeDialogData, SelectableNode } from '../../definitions';
7
6
  import * as i0 from "@angular/core";
8
7
  export declare class TreeDataSource {
9
8
  dataChange: BehaviorSubject<ItemNode[]>;
10
9
  get data(): ItemNode[];
11
- constructor();
12
10
  /**
13
11
  * Initialzie the data source
14
12
  * @param data : data
@@ -44,28 +42,26 @@ export declare class TreeDataSource {
44
42
  static ɵprov: i0.ɵɵInjectableDeclaration<TreeDataSource>;
45
43
  }
46
44
  export declare class SelectTreeDialogComponent implements OnInit, OnDestroy {
47
- private dialogRef;
48
- private tree;
49
45
  done: EventEmitter<SelectDialogResult>;
50
- private __d$;
51
- data: SelectTreeDialogData;
52
- treeControl: FlatTreeControl<SelectableNode>;
53
- treeFlattener: MatTreeFlattener<ItemNode, SelectableNode>;
54
- treeData: MatTreeFlatDataSource<ItemNode, SelectableNode>;
55
- currentNode: ItemNode;
56
- busy: boolean;
57
- filterText: string;
58
- filteredItems: SelectableNode[];
59
- filterIndex: number;
46
+ private unsubscribe;
47
+ private tree;
48
+ private treeFlattener;
49
+ private dialogRef;
50
+ protected dialogData: SelectTreeDialogData;
51
+ protected treeControl: FlatTreeControl<SelectableNode>;
52
+ protected treeData: MatTreeFlatDataSource<ItemNode, SelectableNode>;
53
+ protected currentNode: ItemNode;
54
+ protected filterText: string;
55
+ protected filteredItems: SelectableNode[];
56
+ protected filterIndex: number;
60
57
  /**
61
58
  * Manage flat tree view
62
59
  */
63
- private _getChildren;
64
- private _getLevel;
65
- private _isExpandable;
66
- hasChild: (_: number, _node: SelectableNode) => boolean;
67
- transformer: (item: ItemNode, level: number) => SelectableNode;
68
- constructor(dialogRef: MatDialogRef<SelectTreeDialogComponent>, tree: TreeDataSource, _data: SelectTreeDialogData);
60
+ private getChildren;
61
+ private getLevel;
62
+ private isExpandable;
63
+ protected hasChild: (_: number, _node: SelectableNode) => boolean;
64
+ protected transformer: (item: ItemNode, level: number) => SelectableNode;
69
65
  ngOnInit(): void;
70
66
  ngOnDestroy(): void;
71
67
  /**
@@ -77,25 +73,25 @@ export declare class SelectTreeDialogComponent implements OnInit, OnDestroy {
77
73
  * @param e : the event
78
74
  * @param node : the
79
75
  */
80
- select(e: any, node: SelectableNode): void;
76
+ protected select(e: any, node: SelectableNode): void;
81
77
  /**
82
78
  * Clear filter
83
79
  */
84
- clearFilter(): void;
80
+ protected clearFilter(): void;
85
81
  /**
86
82
  * Apply filter
87
83
  * @param text : the text to filter
88
84
  */
89
- doFilter(text?: string): void;
85
+ protected doFilter(text?: string): void;
90
86
  /**
91
87
  * Goto next filtered item
92
88
  */
93
- nextFiltered(): void;
89
+ protected nextFiltered(): void;
94
90
  /**
95
91
  * Expand a node and all its parents
96
92
  * @param node : the selectable node to expand
97
93
  */
98
- expand(node: SelectableNode): boolean;
94
+ protected expand(node: SelectableNode): boolean;
99
95
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectTreeDialogComponent, never>;
100
96
  static ɵcmp: i0.ɵɵComponentDeclaration<SelectTreeDialogComponent, "ng-component", never, {}, { "done": "done"; }, never, never, true, never>;
101
97
  }
@@ -1,4 +1,4 @@
1
- import { EventEmitter } from "@angular/core";
1
+ import { EventEmitter, OnInit } from "@angular/core";
2
2
  import { SendToDialogResult } from "../../definitions";
3
3
  import * as i0 from "@angular/core";
4
4
  export interface SendToDialogData {
@@ -9,20 +9,20 @@ export interface SendToDialogData {
9
9
  allowPopulate?: boolean;
10
10
  options?: any;
11
11
  }
12
- export declare class SendToDialogComponent {
12
+ export declare class SendToDialogComponent implements OnInit {
13
13
  done: EventEmitter<SendToDialogResult>;
14
14
  populate: EventEmitter<SendToDialogResult>;
15
- data: SendToDialogData;
16
- item: SendToDialogResult;
17
- constructor(_data: SendToDialogData);
15
+ protected dialogData: SendToDialogData;
16
+ protected item: SendToDialogResult;
17
+ ngOnInit(): void;
18
18
  /**
19
19
  * Submit
20
20
  */
21
- ok(): void;
21
+ protected ok(): void;
22
22
  /**
23
23
  * Populate recipients
24
24
  */
25
- populateRecipients(): void;
25
+ protected populateRecipients(): void;
26
26
  static ɵfac: i0.ɵɵFactoryDeclaration<SendToDialogComponent, never>;
27
27
  static ɵcmp: i0.ɵɵComponentDeclaration<SendToDialogComponent, "ng-component", never, {}, { "done": "done"; "populate": "populate"; }, never, never, true, never>;
28
28
  }
@@ -1,16 +1,15 @@
1
- import { OnInit, Renderer2, ElementRef } from "@angular/core";
1
+ import { OnInit } from "@angular/core";
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class ResizeTableColumnDirective implements OnInit {
4
- private renderer;
5
- private el;
6
4
  resizable: boolean;
7
5
  index: number;
6
+ private renderer;
7
+ private elementRef;
8
8
  private startX;
9
9
  private startWidth;
10
10
  private column;
11
11
  private table;
12
12
  private pressed;
13
- constructor(renderer: Renderer2, el: ElementRef);
14
13
  ngOnInit(): void;
15
14
  onMouseDown: (event: MouseEvent) => void;
16
15
  onMouseMove: (event: MouseEvent) => void;
@@ -1,2 +1,2 @@
1
1
  export * from './ui/ui.module';
2
- export * from './ui/components/login/loginOAuth.component';
2
+ export * from './ui/components/login/login-oauth.component';
@@ -0,0 +1,38 @@
1
+ import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
+ import { EnvironmentService } from '@arsedizioni/ars-utils/core';
3
+ import { MsalGuardConfiguration, MsalInterceptorConfiguration } from '@azure/msal-angular';
4
+ import { IPublicClientApplication } from '@azure/msal-browser';
5
+ import { LoginOAuthResult } from '../../definitions';
6
+ import * as i0 from "@angular/core";
7
+ export declare function MSALInstanceFactory(environment: EnvironmentService): IPublicClientApplication;
8
+ export declare function MSALInterceptorConfigFactory(environment: EnvironmentService): MsalInterceptorConfiguration;
9
+ export declare function MSALGuardConfigFactory(): MsalGuardConfiguration;
10
+ export declare class LoginOAuthComponent implements OnInit, OnDestroy {
11
+ private unsubscribe;
12
+ private msalBroadcastService;
13
+ private msaLService;
14
+ private ngZone;
15
+ success: EventEmitter<LoginOAuthResult>;
16
+ appName: import("@angular/core").InputSignal<string>;
17
+ autoInitialize: import("@angular/core").InputSignal<boolean>;
18
+ protected oauthReady: import("@angular/core").WritableSignal<boolean>;
19
+ protected oauthMicrosoftReady: import("@angular/core").WritableSignal<boolean>;
20
+ protected oauthGoogleReady: import("@angular/core").WritableSignal<boolean>;
21
+ ngOnInit(): void;
22
+ ngOnDestroy(): void;
23
+ /**
24
+ * Initialize open authentication
25
+ * Must be a public method
26
+ */
27
+ initialize(): void;
28
+ /**
29
+ * Perform login using MSAL
30
+ */
31
+ protected loginMSAL(): void;
32
+ /**
33
+ * Perform login using Google
34
+ */
35
+ protected loginGoogle(): void;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<LoginOAuthComponent, never>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<LoginOAuthComponent, "login-oauth", never, { "appName": { "alias": "appName"; "required": false; "isSignal": true; }; "autoInitialize": { "alias": "autoInitialize"; "required": false; "isSignal": true; }; }, { "success": "success"; }, never, never, true, never>;
38
+ }