@arsedizioni/ars-utils 18.1.17 → 18.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/clipper.common/common/interceptors/auth.interceptor.mjs +1 -2
- package/esm2022/clipper.ui/ui/document/document.component.mjs +2 -3
- package/esm2022/support.common/common/interceptors/auth.interceptor.mjs +1 -2
- package/esm2022/ui/ui/dialogs/info/info-dialog.component.mjs +3 -3
- package/esm2022/ui/ui/services/dialog.service.mjs +10 -8
- package/esm2022/ui.application/ui/services/applicationDialog.service.mjs +1 -1
- package/esm2022/ui.oauth/ui/components/login/loginOAuth.component.mjs +2 -3
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +0 -1
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +1 -2
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-support.common.mjs +0 -1
- package/fesm2022/arsedizioni-ars-utils-support.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.application.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.mjs +11 -9
- package/fesm2022/arsedizioni-ars-utils-ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs +1 -2
- package/fesm2022/arsedizioni-ars-utils-ui.oauth.mjs.map +1 -1
- package/package.json +7 -7
- package/ui/ui/dialogs/info/info-dialog.component.d.ts +1 -1
- package/ui/ui/services/dialog.service.d.ts +13 -12
- package/ui.application/ui/services/applicationDialog.service.d.ts +5 -5
|
@@ -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 error: (error: string) => console.log(error)\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 align=\"center\">\r\n <div class=\"spaced-bottom-20\" style=\"line-height:150%\">\r\n <p>Questa sezione consente di accedere<br>al servizio utilizzando un provider OAuth2.</p>\r\n <p>La email utilizzata deve essere collegata<br>ad un utente valido di {{appName}} e dei servizi ad esso connessi.\r\n </p>\r\n </div>\r\n <div class=\"spaced-bottom-20\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginMSAL()\" style=\"width:80%\"\r\n [attr.aria-label]=\"'Effettua accesso'\" [disabled]=\"!OAUTHMicrosoftReady\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n <div class=\"spaced-bottom-20\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginGoogle()\" style=\"width:80%\"\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,CA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CAAA;sBAAf,KAAK;gBACG,cAAc,EAAA,CAAA;sBAAtB,KAAK;;AA+GR,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;;AElNnC;;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/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 align=\"center\">\r\n <div class=\"spaced-bottom-20\" style=\"line-height:150%\">\r\n <p>Questa sezione consente di accedere<br>al servizio utilizzando un provider OAuth2.</p>\r\n <p>La email utilizzata deve essere collegata<br>ad un utente valido di {{appName}} e dei servizi ad esso connessi.\r\n </p>\r\n </div>\r\n <div class=\"spaced-bottom-20\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginMSAL()\" style=\"width:80%\"\r\n [attr.aria-label]=\"'Effettua accesso'\" [disabled]=\"!OAUTHMicrosoftReady\">\r\n Accedi con Microsoft</button>\r\n </div>\r\n <div class=\"spaced-bottom-20\">\r\n <button mat-flat-button color=\"primary\" (click)=\"loginGoogle()\" style=\"width:80%\"\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,gBAA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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;;AEjNnC;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arsedizioni/ars-utils",
|
|
3
|
-
"version": "18.1.
|
|
3
|
+
"version": "18.1.19",
|
|
4
4
|
"author": {
|
|
5
5
|
"email": "software@arsedizioni.it",
|
|
6
6
|
"name": "Fabio Buscaroli, Alberto Doria"
|
|
@@ -47,18 +47,18 @@
|
|
|
47
47
|
"esm": "./esm2022/clipper.ui/arsedizioni-ars-utils-clipper.ui.mjs",
|
|
48
48
|
"default": "./fesm2022/arsedizioni-ars-utils-clipper.ui.mjs"
|
|
49
49
|
},
|
|
50
|
-
"./help": {
|
|
51
|
-
"types": "./help/index.d.ts",
|
|
52
|
-
"esm2022": "./esm2022/help/arsedizioni-ars-utils-help.mjs",
|
|
53
|
-
"esm": "./esm2022/help/arsedizioni-ars-utils-help.mjs",
|
|
54
|
-
"default": "./fesm2022/arsedizioni-ars-utils-help.mjs"
|
|
55
|
-
},
|
|
56
50
|
"./core": {
|
|
57
51
|
"types": "./core/index.d.ts",
|
|
58
52
|
"esm2022": "./esm2022/core/arsedizioni-ars-utils-core.mjs",
|
|
59
53
|
"esm": "./esm2022/core/arsedizioni-ars-utils-core.mjs",
|
|
60
54
|
"default": "./fesm2022/arsedizioni-ars-utils-core.mjs"
|
|
61
55
|
},
|
|
56
|
+
"./help": {
|
|
57
|
+
"types": "./help/index.d.ts",
|
|
58
|
+
"esm2022": "./esm2022/help/arsedizioni-ars-utils-help.mjs",
|
|
59
|
+
"esm": "./esm2022/help/arsedizioni-ars-utils-help.mjs",
|
|
60
|
+
"default": "./fesm2022/arsedizioni-ars-utils-help.mjs"
|
|
61
|
+
},
|
|
62
62
|
"./support.common": {
|
|
63
63
|
"types": "./support.common/index.d.ts",
|
|
64
64
|
"esm2022": "./esm2022/support.common/arsedizioni-ars-utils-support.common.mjs",
|
|
@@ -83,7 +83,7 @@ export declare class DialogService extends UIService {
|
|
|
83
83
|
* @param action : action to do during the execution (optional)
|
|
84
84
|
* @returns true if a new popup has been opened
|
|
85
85
|
*/
|
|
86
|
-
setBusy(message: string, progress?: number, progressMode?: 'determinate' | 'indeterminate', type?: 'bar' | 'spinner' | 'wait', action?: Observable<Object>): boolean;
|
|
86
|
+
setBusy(message: string, progress?: number, progressMode?: 'determinate' | 'indeterminate', type?: 'bar' | 'spinner' | 'wait', action?: Observable<Object> | null): boolean;
|
|
87
87
|
/**
|
|
88
88
|
* Display a busy dialog
|
|
89
89
|
* @param message : new message
|
|
@@ -92,7 +92,7 @@ export declare class DialogService extends UIService {
|
|
|
92
92
|
* @param action : action to do during the execution (optional)
|
|
93
93
|
* @returns true if a new popup has been opened
|
|
94
94
|
*/
|
|
95
|
-
busy(message: string, progress?: number, progressMode?: 'determinate' | 'indeterminate', action?: Observable<Object>): boolean;
|
|
95
|
+
busy(message: string, progress?: number, progressMode?: 'determinate' | 'indeterminate', action?: Observable<Object> | null): boolean;
|
|
96
96
|
/**
|
|
97
97
|
* Display a busy spinner dialog
|
|
98
98
|
* @param message : new message
|
|
@@ -101,32 +101,33 @@ export declare class DialogService extends UIService {
|
|
|
101
101
|
* @param action : action to do during the execution (optional)
|
|
102
102
|
* @returns true if a new popup has been opened
|
|
103
103
|
*/
|
|
104
|
-
busySpinner(message: string, progress?: number, progressMode?: 'determinate' | 'indeterminate', action?: Observable<Object>): boolean;
|
|
104
|
+
busySpinner(message: string, progress?: number, progressMode?: 'determinate' | 'indeterminate', action?: Observable<Object> | null): boolean;
|
|
105
105
|
/**
|
|
106
106
|
* Display a wait spinner
|
|
107
107
|
* @param action : action to do during the execution (optional)
|
|
108
108
|
* @returns true if a new popup has been opened
|
|
109
109
|
*/
|
|
110
|
-
wait(action?: Observable<Object>): boolean;
|
|
110
|
+
wait(action?: Observable<Object> | null): boolean;
|
|
111
111
|
/**
|
|
112
112
|
* Display an information dialog
|
|
113
113
|
* @param message : message
|
|
114
|
-
* @param title :
|
|
114
|
+
* @param title : dialog title
|
|
115
115
|
* @param okCaption : ok button caption
|
|
116
116
|
* @param width: the preferred width
|
|
117
|
-
* @param dismissAfter:
|
|
117
|
+
* @param dismissAfter: if specified, the dialog will be closed after dismissAfter milliseconds
|
|
118
|
+
* @param details: if specified, the details info
|
|
118
119
|
*/
|
|
119
|
-
info(message: string, title?: string, okCaption?: string, width?: number, dismissAfter?: number): MatDialogRef<InfoDialogComponent>;
|
|
120
|
+
info(message: string, title?: string, okCaption?: string, width?: number, dismissAfter?: number | null, details?: string | null): MatDialogRef<InfoDialogComponent>;
|
|
120
121
|
/**
|
|
121
122
|
* Display an error dialog
|
|
122
123
|
* @param message : message
|
|
123
124
|
* @param log : the error log
|
|
124
|
-
* @param title :
|
|
125
|
+
* @param title : dialog title
|
|
125
126
|
* @param okCaption : ok button caption
|
|
126
127
|
* @param width: the preferred width
|
|
127
|
-
* @param dismissAfter:
|
|
128
|
+
* @param dismissAfter: if specified, the dialog will be closed after dismissAfter milliseconds
|
|
128
129
|
*/
|
|
129
|
-
error(message: string, log?: string, title?: string, okCaption?: string, width?: number, dismissAfter?: number): MatDialogRef<InfoDialogComponent>;
|
|
130
|
+
error(message: string, log?: string | null, title?: string, okCaption?: string, width?: number, dismissAfter?: number | null): MatDialogRef<InfoDialogComponent>;
|
|
130
131
|
/**
|
|
131
132
|
* Display toast
|
|
132
133
|
* @param message : message to display
|
|
@@ -134,7 +135,7 @@ export declare class DialogService extends UIService {
|
|
|
134
135
|
* @param icon : the mat-icon to display
|
|
135
136
|
* @param actionCaption action button caption
|
|
136
137
|
*/
|
|
137
|
-
toast(message: string, duration?: number, icon?: string, actionCaption?: string): MatSnackBarRef<ToastComponent>;
|
|
138
|
+
toast(message: string, duration?: number, icon?: string, actionCaption?: string | null): MatSnackBarRef<ToastComponent>;
|
|
138
139
|
/**
|
|
139
140
|
* Display a confirm dialog
|
|
140
141
|
* @param message : html message
|
|
@@ -145,7 +146,7 @@ export declare class DialogService extends UIService {
|
|
|
145
146
|
* @param options: check box options
|
|
146
147
|
* @param width: the preferred width
|
|
147
148
|
*/
|
|
148
|
-
confirm(message: string, title?: string, okCaption?: string, cancelCaption?: string, otherCaption?: string, options?: any, width?: number): MatDialogRef<any, any>;
|
|
149
|
+
confirm(message: string, title?: string, okCaption?: string, cancelCaption?: string, otherCaption?: string | null, options?: any | null, width?: number): MatDialogRef<any, any>;
|
|
149
150
|
static ɵfac: i0.ɵɵFactoryDeclaration<DialogService, never>;
|
|
150
151
|
static ɵprov: i0.ɵɵInjectableDeclaration<DialogService>;
|
|
151
152
|
}
|
|
@@ -25,7 +25,7 @@ export declare class ApplicationDialogService extends DialogService {
|
|
|
25
25
|
* @param options : checkable option list
|
|
26
26
|
* @param width: the preferred width
|
|
27
27
|
*/
|
|
28
|
-
sendTo(title?: string, allowPopulate?: boolean, count?: number, options?: any, width?: number): MatDialogRef<SendToDialogComponent, any>;
|
|
28
|
+
sendTo(title?: string, allowPopulate?: boolean, count?: number | null, options?: any | null, width?: number): MatDialogRef<SendToDialogComponent, any>;
|
|
29
29
|
/**
|
|
30
30
|
* Select a tree node
|
|
31
31
|
* @param nodes : tree nodes
|
|
@@ -35,7 +35,7 @@ export declare class ApplicationDialogService extends DialogService {
|
|
|
35
35
|
* @param width: the preferred width
|
|
36
36
|
* @param okCaption : ok catpion button
|
|
37
37
|
*/
|
|
38
|
-
selectTree(nodes: any, title?: string, description?: string, initialFilter?: string, width?: number, okCaption?: string): MatDialogRef<SelectTreeDialogComponent, any>;
|
|
38
|
+
selectTree(nodes: any, title?: string, description?: string | null, initialFilter?: string | null, width?: number, okCaption?: string): MatDialogRef<SelectTreeDialogComponent, any>;
|
|
39
39
|
/**
|
|
40
40
|
* Display a select a picture dialog
|
|
41
41
|
* @param title : dialog title
|
|
@@ -44,7 +44,7 @@ export declare class ApplicationDialogService extends DialogService {
|
|
|
44
44
|
* @param options : checkable option list
|
|
45
45
|
* @param width: the preferred width
|
|
46
46
|
*/
|
|
47
|
-
selectPicture(title?: string, descritpion?: string, okCaption?: string, options?: any, width?: number): MatDialogRef<SelectPictureDialogComponent, any>;
|
|
47
|
+
selectPicture(title?: string, descritpion?: string | null, okCaption?: string, options?: any | null, width?: number): MatDialogRef<SelectPictureDialogComponent, any>;
|
|
48
48
|
/**
|
|
49
49
|
* Display a select a file dialog
|
|
50
50
|
* @param title : dialog title
|
|
@@ -55,7 +55,7 @@ export declare class ApplicationDialogService extends DialogService {
|
|
|
55
55
|
* @param options : checkable option list
|
|
56
56
|
* @param width: the preferred width
|
|
57
57
|
*/
|
|
58
|
-
selectFile(title?: string, descritpion?: string, okCaption?: string, helpLink?: string, helpCaption?: string, options?: any, width?: number): MatDialogRef<SelectFileDialogComponent, any>;
|
|
58
|
+
selectFile(title?: string, descritpion?: string | null, okCaption?: string, helpLink?: string | null, helpCaption?: string | null, options?: any | null, width?: number): MatDialogRef<SelectFileDialogComponent, any>;
|
|
59
59
|
/**
|
|
60
60
|
* Display a multipourpose selection and CRUD dialog
|
|
61
61
|
* @param data : the dialog configuration model
|
|
@@ -72,7 +72,7 @@ export declare class ApplicationDialogService extends DialogService {
|
|
|
72
72
|
* @param options : checkable option list
|
|
73
73
|
* @param width: the preferred width
|
|
74
74
|
*/
|
|
75
|
-
prompt(title: string, type: number, description: string, initialValue?: any, okCaption?: string, cancelCaption?: string, options?: any, width?: number): MatDialogRef<PromptDialogComponent>;
|
|
75
|
+
prompt(title: string, type: number, description: string, initialValue?: any | null, okCaption?: string, cancelCaption?: string, options?: any | null, width?: number): MatDialogRef<PromptDialogComponent>;
|
|
76
76
|
static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationDialogService, never>;
|
|
77
77
|
static ɵprov: i0.ɵɵInjectableDeclaration<ApplicationDialogService>;
|
|
78
78
|
}
|