@main-class/componentes 1.19.1 → 1.19.3
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/bundles/main-class-componentes-dialog.umd.js +30 -22
- package/bundles/main-class-componentes-dialog.umd.js.map +1 -1
- package/bundles/main-class-componentes-dialog.umd.min.js +1 -1
- package/bundles/main-class-componentes-dialog.umd.min.js.map +1 -1
- package/bundles/main-class-componentes-input.umd.js +8 -1
- package/bundles/main-class-componentes-input.umd.js.map +1 -1
- package/bundles/main-class-componentes-input.umd.min.js +1 -1
- package/bundles/main-class-componentes-input.umd.min.js.map +1 -1
- package/bundles/main-class-componentes-loader.umd.js +28 -20
- package/bundles/main-class-componentes-loader.umd.js.map +1 -1
- package/bundles/main-class-componentes-loader.umd.min.js +1 -1
- package/bundles/main-class-componentes-loader.umd.min.js.map +1 -1
- package/bundles/main-class-componentes-pipe.umd.js +3 -0
- package/bundles/main-class-componentes-pipe.umd.js.map +1 -1
- package/bundles/main-class-componentes-pipe.umd.min.js +1 -1
- package/bundles/main-class-componentes-pipe.umd.min.js.map +1 -1
- package/dialog/main-class-componentes-dialog.metadata.json +1 -1
- package/dialog/src/dialog.module.d.ts +2 -0
- package/esm2015/dialog/src/dialog.module.js +10 -1
- package/esm2015/input/src/option-checkbox/option-checkbox.module.js +13 -6
- package/esm2015/loader/src/loader.module.js +10 -1
- package/esm2015/pipe/src/pipe.module.js +4 -1
- package/fesm2015/main-class-componentes-dialog.js +29 -21
- package/fesm2015/main-class-componentes-dialog.js.map +1 -1
- package/fesm2015/main-class-componentes-input.js +8 -1
- package/fesm2015/main-class-componentes-input.js.map +1 -1
- package/fesm2015/main-class-componentes-loader.js +26 -18
- package/fesm2015/main-class-componentes-loader.js.map +1 -1
- package/fesm2015/main-class-componentes-pipe.js +3 -0
- package/fesm2015/main-class-componentes-pipe.js.map +1 -1
- package/input/main-class-componentes-input.metadata.json +1 -1
- package/input/src/option-checkbox/option-checkbox.module.d.ts +2 -0
- package/loader/main-class-componentes-loader.metadata.json +1 -1
- package/loader/src/loader.module.d.ts +2 -0
- package/package.json +1 -1
- package/pipe/main-class-componentes-pipe.metadata.json +1 -1
|
@@ -117,28 +117,6 @@
|
|
|
117
117
|
window.parent.dispatchEvent(new Event('dialogIframeClosed'));
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
var DialogModule = /** @class */ (function () {
|
|
121
|
-
function DialogModule() {
|
|
122
|
-
}
|
|
123
|
-
return DialogModule;
|
|
124
|
-
}());
|
|
125
|
-
DialogModule.decorators = [
|
|
126
|
-
{ type: i0.NgModule, args: [{
|
|
127
|
-
declarations: [
|
|
128
|
-
DialogConfirmacaoComponent,
|
|
129
|
-
DialogIframeComponent,
|
|
130
|
-
],
|
|
131
|
-
imports: [
|
|
132
|
-
common.CommonModule,
|
|
133
|
-
core.TranslateModule,
|
|
134
|
-
button.MatButtonModule,
|
|
135
|
-
forms.FormsModule,
|
|
136
|
-
icon.MatIconModule,
|
|
137
|
-
i1.MatDialogModule,
|
|
138
|
-
]
|
|
139
|
-
},] }
|
|
140
|
-
];
|
|
141
|
-
|
|
142
120
|
var DialogService = /** @class */ (function () {
|
|
143
121
|
function DialogService(dialog) {
|
|
144
122
|
this.dialog = dialog;
|
|
@@ -190,6 +168,36 @@
|
|
|
190
168
|
{ type: i1.MatDialog }
|
|
191
169
|
]; };
|
|
192
170
|
|
|
171
|
+
var DialogModule = /** @class */ (function () {
|
|
172
|
+
function DialogModule() {
|
|
173
|
+
}
|
|
174
|
+
DialogModule.forRoot = function () {
|
|
175
|
+
return {
|
|
176
|
+
ngModule: DialogModule,
|
|
177
|
+
providers: [
|
|
178
|
+
DialogService
|
|
179
|
+
]
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
return DialogModule;
|
|
183
|
+
}());
|
|
184
|
+
DialogModule.decorators = [
|
|
185
|
+
{ type: i0.NgModule, args: [{
|
|
186
|
+
declarations: [
|
|
187
|
+
DialogConfirmacaoComponent,
|
|
188
|
+
DialogIframeComponent,
|
|
189
|
+
],
|
|
190
|
+
imports: [
|
|
191
|
+
common.CommonModule,
|
|
192
|
+
core.TranslateModule,
|
|
193
|
+
button.MatButtonModule,
|
|
194
|
+
forms.FormsModule,
|
|
195
|
+
icon.MatIconModule,
|
|
196
|
+
i1.MatDialogModule,
|
|
197
|
+
]
|
|
198
|
+
},] }
|
|
199
|
+
];
|
|
200
|
+
|
|
193
201
|
/**
|
|
194
202
|
* Generated bundle index. Do not edit.
|
|
195
203
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main-class-componentes-dialog.umd.js","sources":["../../../../projects/main-class/componentes/dialog/src/dialog-confirmacao/dialog-confirmacao.component.ts","../../../../projects/main-class/componentes/dialog/src/dialog-iframe/dialog-iframe.component.ts","../../../../projects/main-class/componentes/dialog/src/dialog.module.ts","../../../../projects/main-class/componentes/dialog/src/dialog.service.ts","../../../../projects/main-class/componentes/dialog/main-class-componentes-dialog.ts"],"sourcesContent":["import {Component, Inject, OnInit} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {NgForm} from '@angular/forms';\n\nexport interface DialogConfirmacaoData {\n titulo: string;\n mensagem: string;\n okLabel: string;\n cancelLabel?: string;\n}\n\n@Component({\n selector: 'mcl-dialog-confirmacao',\n templateUrl: './dialog-confirmacao.component.html',\n styleUrls: ['./dialog-confirmacao.component.scss']\n})\nexport class DialogConfirmacaoComponent implements OnInit {\n\n constructor(\n @Inject(MAT_DIALOG_DATA) private data: DialogConfirmacaoData,\n private dialogRef: MatDialogRef<any>,\n ) {\n }\n\n get titulo() {\n return this.data.titulo;\n }\n\n get mensagem() {\n return this.data.mensagem;\n }\n\n get okLabel() {\n return this.data.okLabel;\n }\n\n get cancelLabel() {\n return this.data.cancelLabel;\n }\n\n ngOnInit(): void {\n }\n\n confirma(form: NgForm) {\n if (!form.valid) {\n return;\n }\n\n this.dialogRef.close(true);\n }\n}\n","import {AfterViewInit, Component, ElementRef, Inject, ViewChild} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';\n\nexport interface DialogIframData {\n url: string;\n titulo: string;\n}\n\n@Component({\n selector: 'mcl-dialog-iframe',\n templateUrl: './dialog-iframe.component.html',\n styleUrls: ['./dialog-iframe.component.scss']\n})\nexport class DialogIframeComponent implements AfterViewInit {\n\n titulo: string;\n url: SafeResourceUrl;\n\n @ViewChild('iframe') iframe: ElementRef;\n\n constructor(\n @Inject(MAT_DIALOG_DATA) dados: DialogIframData,\n private dialogRef: MatDialogRef<any>,\n sanitizer: DomSanitizer,\n ) {\n this.titulo = dados.titulo;\n this.url = sanitizer.bypassSecurityTrustResourceUrl(dados.url);\n }\n\n ngAfterViewInit() {\n registerDialogOnIframe(this.iframe.nativeElement, () => this.close());\n }\n\n private returnValue() {\n const fraContent = this.iframe.nativeElement.contentDocument ||\n this.iframe.nativeElement.contentWindow?.document;\n\n if (fraContent) {\n const divRetornoValue = fraContent.getElementById('returnValue');\n\n if (divRetornoValue) {\n const returnValue = divRetornoValue.innerText;\n\n if (returnValue) {\n return JSON.parse(returnValue);\n }\n }\n }\n\n return undefined;\n }\n\n close() {\n this.dialogRef.close(this.returnValue());\n }\n}\n\nfunction registerDialogOnIframe(iframe, callback) {\n window.addEventListener('dialogIframeClosed', () => callback());\n}\n\nexport function closeDialogIframe(returnValue?: any) {\n if (returnValue) {\n const returnDiv = document.createElement('div');\n\n returnDiv.id = 'returnValue';\n returnDiv.innerText = JSON.stringify(returnValue);\n returnDiv.style.display = 'none';\n\n document.body.appendChild(returnDiv);\n }\n\n window.parent.dispatchEvent(new Event('dialogIframeClosed'));\n}\n","import {NgModule} from '@angular/core';\nimport {DialogConfirmacaoComponent} from './dialog-confirmacao/dialog-confirmacao.component';\nimport {DialogIframeComponent} from './dialog-iframe/dialog-iframe.component';\nimport {CommonModule} from '@angular/common';\nimport {TranslateModule} from '@ngx-translate/core';\nimport {MatButtonModule} from '@angular/material/button';\nimport {FormsModule} from '@angular/forms';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatDialogModule} from '@angular/material/dialog';\n\n\n@NgModule({\n declarations: [\n DialogConfirmacaoComponent,\n DialogIframeComponent,\n ],\n imports: [\n CommonModule,\n TranslateModule,\n MatButtonModule,\n FormsModule,\n MatIconModule,\n MatDialogModule,\n ]\n})\nexport class DialogModule {\n\n}\n","import {Injectable} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {MatDialog} from '@angular/material/dialog';\nimport {DialogConfirmacaoComponent, DialogConfirmacaoData} from './dialog-confirmacao/dialog-confirmacao.component';\nimport {map} from 'rxjs/operators';\nimport {DialogIframeComponent} from './dialog-iframe/dialog-iframe.component';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DialogService {\n\n constructor(\n private dialog: MatDialog\n ) {\n }\n\n confirma(mensagem: string, config: {\n icon?: string,\n titulo?: string,\n okLabel?: string,\n cancelLabel?: string\n } = {}): Observable<boolean> {\n return this.dialog.open<DialogConfirmacaoComponent, DialogConfirmacaoData, boolean>(DialogConfirmacaoComponent, {\n data: {\n titulo: config.titulo || 'mcl.dialog.confirmacao',\n mensagem,\n okLabel: config.okLabel || 'mcl.dialog.sim',\n cancelLabel: config.cancelLabel || 'mcl.dialog.nao'\n }\n }).afterClosed().pipe(map(result => !!result));\n }\n\n informa(mensagem: string, config: {\n icon?: string,\n titulo?: string,\n okLabel?: string\n } = {}): Observable<boolean> {\n return this.dialog.open<DialogConfirmacaoComponent, DialogConfirmacaoData, boolean>(DialogConfirmacaoComponent, {\n data: {\n titulo: config.titulo || 'mcl.dialog.informacao',\n mensagem,\n okLabel: config.okLabel || 'mcl.dialog.ok',\n }\n }).afterClosed().pipe(map(result => !!result));\n }\n\n iframe(url: string, titulo: string): Observable<any> {\n if (!!window.parent && window.parent !== window) {\n window.location.href = url;\n } else {\n return this.dialog.open(DialogIframeComponent, {\n data: {\n titulo,\n url,\n },\n panelClass: 'dialog-frame',\n }).afterClosed();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["Component","Inject","MAT_DIALOG_DATA","MatDialogRef","DomSanitizer","ViewChild","NgModule","CommonModule","TranslateModule","MatButtonModule","FormsModule","MatIconModule","MatDialogModule","map","Injectable","MatDialog"],"mappings":";;;;;;;QAkBE,oCACmC,IAA2B,EACpD,SAA4B;YADH,SAAI,GAAJ,IAAI,CAAuB;YACpD,cAAS,GAAT,SAAS,CAAmB;SAErC;QAED,sBAAI,8CAAM;iBAAV;gBACE,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;aACzB;;;WAAA;QAED,sBAAI,gDAAQ;iBAAZ;gBACE,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;aAC3B;;;WAAA;QAED,sBAAI,+CAAO;iBAAX;gBACE,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;aAC1B;;;WAAA;QAED,sBAAI,mDAAW;iBAAf;gBACE,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;aAC9B;;;WAAA;QAED,6CAAQ,GAAR;SACC;QAED,6CAAQ,GAAR,UAAS,IAAY;YACnB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;gBACf,OAAO;aACR;YAED,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC5B;;;;gBAtCFA,YAAS,SAAC;oBACT,QAAQ,EAAE,wBAAwB;oBAClC,kgBAAkD;;iBAEnD;;;gDAIIC,SAAM,SAACC,kBAAe;gBAlBFC,eAAY;;;;QCoBnC,+BAC2B,KAAsB,EACvC,SAA4B,EACpC,SAAuB;YADf,cAAS,GAAT,SAAS,CAAmB;YAGpC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;YAC3B,IAAI,CAAC,GAAG,GAAG,SAAS,CAAC,8BAA8B,CAAC,KAAK,C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AChD,QAAQ,UAAA;oBACR,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,eAAe;iBAC3C;aACF,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,CAACA,aAAG,CAAC,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,GAAA,CAAC,CAAC,CAAC;SAChD;QAED,8BAAM,GAAN,UAAO,GAAW,EAAE,MAAc;YAChC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,EAAE;gBAC/C,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAC;aAC5B;iBAAM;gBACL,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,EAAE;oBAC7C,IAAI,EAAE;wBACJ,MAAM,QAAA;wBACN,GAAG,KAAA;qBACJ;oBACD,UAAU,EAAE,cAAc;iBAC3B,CAAC,CAAC,WAAW,EAAE,CAAC;aAClB;SACF;;;;;gBApDFC,aAAU,SAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;gBAPOC,YAAS;;;ICFjB;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"main-class-componentes-dialog.umd.js","sources":["../../../../projects/main-class/componentes/dialog/src/dialog-confirmacao/dialog-confirmacao.component.ts","../../../../projects/main-class/componentes/dialog/src/dialog-iframe/dialog-iframe.component.ts","../../../../projects/main-class/componentes/dialog/src/dialog.service.ts","../../../../projects/main-class/componentes/dialog/src/dialog.module.ts","../../../../projects/main-class/componentes/dialog/main-class-componentes-dialog.ts"],"sourcesContent":["import {Component, Inject, OnInit} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {NgForm} from '@angular/forms';\n\nexport interface DialogConfirmacaoData {\n titulo: string;\n mensagem: string;\n okLabel: string;\n cancelLabel?: string;\n}\n\n@Component({\n selector: 'mcl-dialog-confirmacao',\n templateUrl: './dialog-confirmacao.component.html',\n styleUrls: ['./dialog-confirmacao.component.scss']\n})\nexport class DialogConfirmacaoComponent implements OnInit {\n\n constructor(\n @Inject(MAT_DIALOG_DATA) private data: DialogConfirmacaoData,\n private dialogRef: MatDialogRef<any>,\n ) {\n }\n\n get titulo() {\n return this.data.titulo;\n }\n\n get mensagem() {\n return this.data.mensagem;\n }\n\n get okLabel() {\n return this.data.okLabel;\n }\n\n get cancelLabel() {\n return this.data.cancelLabel;\n }\n\n ngOnInit(): void {\n }\n\n confirma(form: NgForm) {\n if (!form.valid) {\n return;\n }\n\n this.dialogRef.close(true);\n }\n}\n","import {AfterViewInit, Component, ElementRef, Inject, ViewChild} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';\n\nexport interface DialogIframData {\n url: string;\n titulo: string;\n}\n\n@Component({\n selector: 'mcl-dialog-iframe',\n templateUrl: './dialog-iframe.component.html',\n styleUrls: ['./dialog-iframe.component.scss']\n})\nexport class DialogIframeComponent implements AfterViewInit {\n\n titulo: string;\n url: SafeResourceUrl;\n\n @ViewChild('iframe') iframe: ElementRef;\n\n constructor(\n @Inject(MAT_DIALOG_DATA) dados: DialogIframData,\n private dialogRef: MatDialogRef<any>,\n sanitizer: DomSanitizer,\n ) {\n this.titulo = dados.titulo;\n this.url = sanitizer.bypassSecurityTrustResourceUrl(dados.url);\n }\n\n ngAfterViewInit() {\n registerDialogOnIframe(this.iframe.nativeElement, () => this.close());\n }\n\n private returnValue() {\n const fraContent = this.iframe.nativeElement.contentDocument ||\n this.iframe.nativeElement.contentWindow?.document;\n\n if (fraContent) {\n const divRetornoValue = fraContent.getElementById('returnValue');\n\n if (divRetornoValue) {\n const returnValue = divRetornoValue.innerText;\n\n if (returnValue) {\n return JSON.parse(returnValue);\n }\n }\n }\n\n return undefined;\n }\n\n close() {\n this.dialogRef.close(this.returnValue());\n }\n}\n\nfunction registerDialogOnIframe(iframe, callback) {\n window.addEventListener('dialogIframeClosed', () => callback());\n}\n\nexport function closeDialogIframe(returnValue?: any) {\n if (returnValue) {\n const returnDiv = document.createElement('div');\n\n returnDiv.id = 'returnValue';\n returnDiv.innerText = JSON.stringify(returnValue);\n returnDiv.style.display = 'none';\n\n document.body.appendChild(returnDiv);\n }\n\n window.parent.dispatchEvent(new Event('dialogIframeClosed'));\n}\n","import {Injectable} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {MatDialog} from '@angular/material/dialog';\nimport {DialogConfirmacaoComponent, DialogConfirmacaoData} from './dialog-confirmacao/dialog-confirmacao.component';\nimport {map} from 'rxjs/operators';\nimport {DialogIframeComponent} from './dialog-iframe/dialog-iframe.component';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DialogService {\n\n constructor(\n private dialog: MatDialog\n ) {\n }\n\n confirma(mensagem: string, config: {\n icon?: string,\n titulo?: string,\n okLabel?: string,\n cancelLabel?: string\n } = {}): Observable<boolean> {\n return this.dialog.open<DialogConfirmacaoComponent, DialogConfirmacaoData, boolean>(DialogConfirmacaoComponent, {\n data: {\n titulo: config.titulo || 'mcl.dialog.confirmacao',\n mensagem,\n okLabel: config.okLabel || 'mcl.dialog.sim',\n cancelLabel: config.cancelLabel || 'mcl.dialog.nao'\n }\n }).afterClosed().pipe(map(result => !!result));\n }\n\n informa(mensagem: string, config: {\n icon?: string,\n titulo?: string,\n okLabel?: string\n } = {}): Observable<boolean> {\n return this.dialog.open<DialogConfirmacaoComponent, DialogConfirmacaoData, boolean>(DialogConfirmacaoComponent, {\n data: {\n titulo: config.titulo || 'mcl.dialog.informacao',\n mensagem,\n okLabel: config.okLabel || 'mcl.dialog.ok',\n }\n }).afterClosed().pipe(map(result => !!result));\n }\n\n iframe(url: string, titulo: string): Observable<any> {\n if (!!window.parent && window.parent !== window) {\n window.location.href = url;\n } else {\n return this.dialog.open(DialogIframeComponent, {\n data: {\n titulo,\n url,\n },\n panelClass: 'dialog-frame',\n }).afterClosed();\n }\n }\n}\n","import {ModuleWithProviders, NgModule} from '@angular/core';\nimport {DialogConfirmacaoComponent} from './dialog-confirmacao/dialog-confirmacao.component';\nimport {DialogIframeComponent} from './dialog-iframe/dialog-iframe.component';\nimport {CommonModule} from '@angular/common';\nimport {TranslateModule} from '@ngx-translate/core';\nimport {MatButtonModule} from '@angular/material/button';\nimport {FormsModule} from '@angular/forms';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatDialogModule} from '@angular/material/dialog';\nimport {DialogService} from './dialog.service';\n\n\n@NgModule({\n declarations: [\n DialogConfirmacaoComponent,\n DialogIframeComponent,\n ],\n imports: [\n CommonModule,\n TranslateModule,\n MatButtonModule,\n FormsModule,\n MatIconModule,\n MatDialogModule,\n ]\n})\nexport class DialogModule {\n\n static forRoot(): ModuleWithProviders<DialogModule> {\n return {\n ngModule: DialogModule,\n providers: [\n DialogService\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["Component","Inject","MAT_DIALOG_DATA","MatDialogRef","DomSanitizer","ViewChild","map","Injectable","MatDialog","NgModule","CommonModule","TranslateModule","MatButtonModule","FormsModule","MatIconModule","MatDialogModule"],"mappings":";;;;;;;QAkBE,oCACmC,IAA2B,EACpD,SAA4B;YADH,SAAI,GAAJ,IAAI,CAAuB;YACpD,cAAS,GAAT,SAAS,CAAmB;SAErC;QAED,sBAAI,8CAAM;iBAAV;gBACE,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;aACzB;;;WAAA;QAED,sBAAI,gDAAQ;iBAAZ;gBACE,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;aAC3B;;;WAAA;QAED,sBAAI,+CAAO;iBAAX;gBACE,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;aAC1B;;;WAAA;QAED,sBAAI,mDAAW;iBAAf;gBACE,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;aAC9B;;;WAAA;QAED,6CAAQ,GAAR;SACC;QAED,6CAAQ,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a;wBACbC,kBAAe;qBAChB;iBACF;;;ICzBD;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/material/dialog"),require("@angular/platform-browser"),require("@angular/common"),require("@ngx-translate/core"),require("@angular/material/button"),require("@angular/forms"),require("@angular/material/icon"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@main-class/componentes/dialog",["exports","@angular/core","@angular/material/dialog","@angular/platform-browser","@angular/common","@ngx-translate/core","@angular/material/button","@angular/forms","@angular/material/icon","rxjs/operators"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self)["main-class"]=t["main-class"]||{},t["main-class"].componentes=t["main-class"].componentes||{},t["main-class"].componentes.dialog={}),t.ng.core,t.ng.material.dialog,t.ng.platformBrowser,t.ng.common,t.core,t.ng.material.button,t.ng.forms,t.ng.material.icon,t.rxjs.operators)}(this,(function(t,e,n,o,a,i,
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/material/dialog"),require("@angular/platform-browser"),require("@angular/common"),require("@ngx-translate/core"),require("@angular/material/button"),require("@angular/forms"),require("@angular/material/icon"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@main-class/componentes/dialog",["exports","@angular/core","@angular/material/dialog","@angular/platform-browser","@angular/common","@ngx-translate/core","@angular/material/button","@angular/forms","@angular/material/icon","rxjs/operators"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self)["main-class"]=t["main-class"]||{},t["main-class"].componentes=t["main-class"].componentes||{},t["main-class"].componentes.dialog={}),t.ng.core,t.ng.material.dialog,t.ng.platformBrowser,t.ng.common,t.core,t.ng.material.button,t.ng.forms,t.ng.material.icon,t.rxjs.operators)}(this,(function(t,e,n,o,a,r,i,l,c,u){"use strict";var d=function(){function t(t,e){this.data=t,this.dialogRef=e}return Object.defineProperty(t.prototype,"titulo",{get:function(){return this.data.titulo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mensagem",{get:function(){return this.data.mensagem},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"okLabel",{get:function(){return this.data.okLabel},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cancelLabel",{get:function(){return this.data.cancelLabel},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){},t.prototype.confirma=function(t){t.valid&&this.dialogRef.close(!0)},t}();d.decorators=[{type:e.Component,args:[{selector:"mcl-dialog-confirmacao",template:'<div mat-dialog-title>\n {{titulo | translate}}\n</div>\n\n<form (ngSubmit)="confirma(form)" #form="ngForm">\n <div mat-dialog-content>\n\n <p [innerHTML]="mensagem | translate"></p>\n\n </div>\n\n <div mat-dialog-actions>\n <button mat-stroked-button color="accent">\n {{okLabel | translate}}\n </button>\n <button mat-flat-button color="warn" type="button" mat-dialog-close *ngIf="cancelLabel">\n {{cancelLabel | translate}}\n </button>\n </div>\n</form>\n',styles:[".mat-dialog-content{width:95vw;max-width:280px;min-width:auto;margin:10px 60px;text-align:center;min-height:120px;display:flex;flex-direction:column;justify-content:center}[mat-dialog-title]{text-align:center;margin:40px 60px 20px}[mat-dialog-actions]{justify-content:center;margin:20px 60px 40px;flex-direction:row}@media (max-width:750px){.mat-dialog-content{margin:10px 20px}}"]}]}],d.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:n.MatDialogRef}]};var m=function(){function t(t,e,n){this.dialogRef=e,this.titulo=t.titulo,this.url=n.bypassSecurityTrustResourceUrl(t.url)}return t.prototype.ngAfterViewInit=function(){var t,e=this;this.iframe.nativeElement,t=function(){return e.close()},window.addEventListener("dialogIframeClosed",(function(){return t()}))},t.prototype.returnValue=function(){var t,e=this.iframe.nativeElement.contentDocument||(null===(t=this.iframe.nativeElement.contentWindow)||void 0===t?void 0:t.document);if(e){var n=e.getElementById("returnValue");if(n){var o=n.innerText;if(o)return JSON.parse(o)}}},t.prototype.close=function(){this.dialogRef.close(this.returnValue())},t}();m.decorators=[{type:e.Component,args:[{selector:"mcl-dialog-iframe",template:'<div mat-dialog-title >\n <h2>{{titulo}}</h2>\n <button mat-icon-button mat-dialog-close class="pull-right" tabindex="-1">\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div mat-dialog-content>\n <iframe #iframe width="560" height="315" [src]="url" (close)="close()" frameborder="0"\n ></iframe>\n</div>\n',styles:["[mat-dialog-title]{display:flex}[mat-dialog-title] h2{font-size:25px;flex:1 1 auto;margin:0 0 20px}[mat-dialog-title] mat-icon{vertical-align:middle}mat-dialog-content{margin:-24px;width:calc(100% + 48px);padding:0}mat-dialog-content iframe{width:100%;height:60vh;border:0}"]}]}],m.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[n.MAT_DIALOG_DATA]}]},{type:n.MatDialogRef},{type:o.DomSanitizer}]},m.propDecorators={iframe:[{type:e.ViewChild,args:["iframe"]}]};var s=function(){function t(t){this.dialog=t}return t.prototype.confirma=function(t,e){return void 0===e&&(e={}),this.dialog.open(d,{data:{titulo:e.titulo||"mcl.dialog.confirmacao",mensagem:t,okLabel:e.okLabel||"mcl.dialog.sim",cancelLabel:e.cancelLabel||"mcl.dialog.nao"}}).afterClosed().pipe(u.map((function(t){return!!t})))},t.prototype.informa=function(t,e){return void 0===e&&(e={}),this.dialog.open(d,{data:{titulo:e.titulo||"mcl.dialog.informacao",mensagem:t,okLabel:e.okLabel||"mcl.dialog.ok"}}).afterClosed().pipe(u.map((function(t){return!!t})))},t.prototype.iframe=function(t,e){if(!window.parent||window.parent===window)return this.dialog.open(m,{data:{titulo:e,url:t},panelClass:"dialog-frame"}).afterClosed();window.location.href=t},t}();s.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new s(e.ɵɵinject(n.MatDialog))},token:s,providedIn:"root"}),s.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],s.ctorParameters=function(){return[{type:n.MatDialog}]};var f=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[s]}},t}();f.decorators=[{type:e.NgModule,args:[{declarations:[d,m],imports:[a.CommonModule,r.TranslateModule,i.MatButtonModule,l.FormsModule,c.MatIconModule,n.MatDialogModule]}]}],t.DialogConfirmacaoComponent=d,t.DialogIframeComponent=m,t.DialogModule=f,t.DialogService=s,t.closeDialogIframe=function(t){if(t){var e=document.createElement("div");e.id="returnValue",e.innerText=JSON.stringify(t),e.style.display="none",document.body.appendChild(e)}window.parent.dispatchEvent(new Event("dialogIframeClosed"))},Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=main-class-componentes-dialog.umd.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../projects/main-class/componentes/dialog/src/dialog-confirmacao/dialog-confirmacao.component.ts","../../../../projects/main-class/componentes/dialog/src/dialog-iframe/dialog-iframe.component.ts","../../../../projects/main-class/componentes/dialog/src/dialog.
|
|
1
|
+
{"version":3,"sources":["../../../../projects/main-class/componentes/dialog/src/dialog-confirmacao/dialog-confirmacao.component.ts","../../../../projects/main-class/componentes/dialog/src/dialog-iframe/dialog-iframe.component.ts","../../../../projects/main-class/componentes/dialog/src/dialog.service.ts","../../../../projects/main-class/componentes/dialog/src/dialog.module.ts"],"names":["DialogConfirmacaoComponent","data","dialogRef","this","Object","defineProperty","prototype","titulo","mensagem","okLabel","cancelLabel","ngOnInit","confirma","form","valid","close","Component","args","selector","template","Inject","MAT_DIALOG_DATA","MatDialogRef","DialogIframeComponent","dados","sanitizer","url","bypassSecurityTrustResourceUrl","ngAfterViewInit","callback","_this","iframe","nativeElement","window","addEventListener","returnValue","fraContent","contentDocument","_a","contentWindow","document","divRetornoValue","getElementById","innerText","JSON","parse","DomSanitizer","ViewChild","DialogService","dialog","config","open","afterClosed","pipe","map","result","informa","parent","panelClass","location","href","Injectable","providedIn","MatDialog","DialogModule","forRoot","ngModule","providers","NgModule","declarations","imports","CommonModule","TranslateModule","MatButtonModule","FormsModule","MatIconModule","MatDialogModule","returnDiv","createElement","id","stringify","style","display","body","appendChild","dispatchEvent","Event"],"mappings":"ohCAkBE,SAAAA,EACmCC,EACzBC,GADyBC,KAAAF,KAAAA,EACzBE,KAAAD,UAAAA,SAIVE,OAAAC,eAAIL,EAAAM,UAAA,SAAM,KAAV,WACE,OAAOH,KAAKF,KAAKM,wCAGnBH,OAAAC,eAAIL,EAAAM,UAAA,WAAQ,KAAZ,WACE,OAAOH,KAAKF,KAAKO,0CAGnBJ,OAAAC,eAAIL,EAAAM,UAAA,UAAO,KAAX,WACE,OAAOH,KAAKF,KAAKQ,yCAGnBL,OAAAC,eAAIL,EAAAM,UAAA,cAAW,KAAf,WACE,OAAOH,KAAKF,KAAKS,6CAGnBV,EAAAM,UAAAK,SAAA,aAGAX,EAAAM,UAAAM,SAAA,SAASC,GACFA,EAAKC,OAIVX,KAAKD,UAAUa,OAAM,6BArCxBC,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,yBACVC,SAAA,w7BAMGC,EAAAA,OAAMH,KAAA,CAACI,EAAAA,0BAlBaC,EAAAA,iCCoBvB,SAAAC,EAC2BC,EACjBtB,EACRuB,GADQtB,KAAAD,UAAAA,EAGRC,KAAKI,OAASiB,EAAMjB,OACpBJ,KAAKuB,IAAMD,EAAUE,+BAA+BH,EAAME,YAG5DH,EAAAjB,UAAAsB,gBAAA,WAAA,IA4BsCC,EA5BtCC,EAAA3B,KACyBA,KAAK4B,OAAOC,cA2BCH,EA3Bc,WAAM,OAAAC,EAAKf,SA4B/DkB,OAAOC,iBAAiB,sBAAsB,WAAM,OAAAL,QAzB5CN,EAAAjB,UAAA6B,YAAA,iBACAC,EAAajC,KAAK4B,OAAOC,cAAcK,kBACJ,QADmBC,EAC1DnC,KAAK4B,OAAOC,cAAcO,qBAAa,IAAAD,OAAA,EAAAA,EAAEE,UAE3C,GAAIJ,EAAY,CACd,IAAMK,EAAkBL,EAAWM,eAAe,eAElD,GAAID,EA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,EAAAA,8BCwBR,SAAAC,YAESA,EAAAC,QAAP,WACE,MAAO,CACLC,SAAUF,EACVG,UAAW,CACTnB,8BApBPoB,EAAAA,SAAQnD,KAAA,CAAC,CACRoD,aAAc,CACZrE,EACAuB,GAEF+C,QAAS,CACPC,EAAAA,aACAC,EAAAA,gBACAC,EAAAA,gBACAC,EAAAA,YACAC,EAAAA,cACAC,EAAAA,8IFuC8BzC,GAChC,GAAIA,EAAa,CACf,IAAM0C,EAAYrC,SAASsC,cAAc,OAEzCD,EAAUE,GAAK,cACfF,EAAUlC,UAAYC,KAAKoC,UAAU7C,GACrC0C,EAAUI,MAAMC,QAAU,OAE1B1C,SAAS2C,KAAKC,YAAYP,GAG5B5C,OAAOwB,OAAO4B,cAAc,IAAIC,MAAM","sourcesContent":["import {Component, Inject, OnInit} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {NgForm} from '@angular/forms';\n\nexport interface DialogConfirmacaoData {\n titulo: string;\n mensagem: string;\n okLabel: string;\n cancelLabel?: string;\n}\n\n@Component({\n selector: 'mcl-dialog-confirmacao',\n templateUrl: './dialog-confirmacao.component.html',\n styleUrls: ['./dialog-confirmacao.component.scss']\n})\nexport class DialogConfirmacaoComponent implements OnInit {\n\n constructor(\n @Inject(MAT_DIALOG_DATA) private data: DialogConfirmacaoData,\n private dialogRef: MatDialogRef<any>,\n ) {\n }\n\n get titulo() {\n return this.data.titulo;\n }\n\n get mensagem() {\n return this.data.mensagem;\n }\n\n get okLabel() {\n return this.data.okLabel;\n }\n\n get cancelLabel() {\n return this.data.cancelLabel;\n }\n\n ngOnInit(): void {\n }\n\n confirma(form: NgForm) {\n if (!form.valid) {\n return;\n }\n\n this.dialogRef.close(true);\n }\n}\n","import {AfterViewInit, Component, ElementRef, Inject, ViewChild} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';\n\nexport interface DialogIframData {\n url: string;\n titulo: string;\n}\n\n@Component({\n selector: 'mcl-dialog-iframe',\n templateUrl: './dialog-iframe.component.html',\n styleUrls: ['./dialog-iframe.component.scss']\n})\nexport class DialogIframeComponent implements AfterViewInit {\n\n titulo: string;\n url: SafeResourceUrl;\n\n @ViewChild('iframe') iframe: ElementRef;\n\n constructor(\n @Inject(MAT_DIALOG_DATA) dados: DialogIframData,\n private dialogRef: MatDialogRef<any>,\n sanitizer: DomSanitizer,\n ) {\n this.titulo = dados.titulo;\n this.url = sanitizer.bypassSecurityTrustResourceUrl(dados.url);\n }\n\n ngAfterViewInit() {\n registerDialogOnIframe(this.iframe.nativeElement, () => this.close());\n }\n\n private returnValue() {\n const fraContent = this.iframe.nativeElement.contentDocument ||\n this.iframe.nativeElement.contentWindow?.document;\n\n if (fraContent) {\n const divRetornoValue = fraContent.getElementById('returnValue');\n\n if (divRetornoValue) {\n const returnValue = divRetornoValue.innerText;\n\n if (returnValue) {\n return JSON.parse(returnValue);\n }\n }\n }\n\n return undefined;\n }\n\n close() {\n this.dialogRef.close(this.returnValue());\n }\n}\n\nfunction registerDialogOnIframe(iframe, callback) {\n window.addEventListener('dialogIframeClosed', () => callback());\n}\n\nexport function closeDialogIframe(returnValue?: any) {\n if (returnValue) {\n const returnDiv = document.createElement('div');\n\n returnDiv.id = 'returnValue';\n returnDiv.innerText = JSON.stringify(returnValue);\n returnDiv.style.display = 'none';\n\n document.body.appendChild(returnDiv);\n }\n\n window.parent.dispatchEvent(new Event('dialogIframeClosed'));\n}\n","import {Injectable} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {MatDialog} from '@angular/material/dialog';\nimport {DialogConfirmacaoComponent, DialogConfirmacaoData} from './dialog-confirmacao/dialog-confirmacao.component';\nimport {map} from 'rxjs/operators';\nimport {DialogIframeComponent} from './dialog-iframe/dialog-iframe.component';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DialogService {\n\n constructor(\n private dialog: MatDialog\n ) {\n }\n\n confirma(mensagem: string, config: {\n icon?: string,\n titulo?: string,\n okLabel?: string,\n cancelLabel?: string\n } = {}): Observable<boolean> {\n return this.dialog.open<DialogConfirmacaoComponent, DialogConfirmacaoData, boolean>(DialogConfirmacaoComponent, {\n data: {\n titulo: config.titulo || 'mcl.dialog.confirmacao',\n mensagem,\n okLabel: config.okLabel || 'mcl.dialog.sim',\n cancelLabel: config.cancelLabel || 'mcl.dialog.nao'\n }\n }).afterClosed().pipe(map(result => !!result));\n }\n\n informa(mensagem: string, config: {\n icon?: string,\n titulo?: string,\n okLabel?: string\n } = {}): Observable<boolean> {\n return this.dialog.open<DialogConfirmacaoComponent, DialogConfirmacaoData, boolean>(DialogConfirmacaoComponent, {\n data: {\n titulo: config.titulo || 'mcl.dialog.informacao',\n mensagem,\n okLabel: config.okLabel || 'mcl.dialog.ok',\n }\n }).afterClosed().pipe(map(result => !!result));\n }\n\n iframe(url: string, titulo: string): Observable<any> {\n if (!!window.parent && window.parent !== window) {\n window.location.href = url;\n } else {\n return this.dialog.open(DialogIframeComponent, {\n data: {\n titulo,\n url,\n },\n panelClass: 'dialog-frame',\n }).afterClosed();\n }\n }\n}\n","import {ModuleWithProviders, NgModule} from '@angular/core';\nimport {DialogConfirmacaoComponent} from './dialog-confirmacao/dialog-confirmacao.component';\nimport {DialogIframeComponent} from './dialog-iframe/dialog-iframe.component';\nimport {CommonModule} from '@angular/common';\nimport {TranslateModule} from '@ngx-translate/core';\nimport {MatButtonModule} from '@angular/material/button';\nimport {FormsModule} from '@angular/forms';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatDialogModule} from '@angular/material/dialog';\nimport {DialogService} from './dialog.service';\n\n\n@NgModule({\n declarations: [\n DialogConfirmacaoComponent,\n DialogIframeComponent,\n ],\n imports: [\n CommonModule,\n TranslateModule,\n MatButtonModule,\n FormsModule,\n MatIconModule,\n MatDialogModule,\n ]\n})\nexport class DialogModule {\n\n static forRoot(): ModuleWithProviders<DialogModule> {\n return {\n ngModule: DialogModule,\n providers: [\n DialogService\n ]\n };\n }\n}\n"]}
|
|
@@ -1429,13 +1429,20 @@
|
|
|
1429
1429
|
var OptionCheckboxModule = /** @class */ (function () {
|
|
1430
1430
|
function OptionCheckboxModule() {
|
|
1431
1431
|
}
|
|
1432
|
+
OptionCheckboxModule.forRoot = function () {
|
|
1433
|
+
return {
|
|
1434
|
+
ngModule: OptionCheckboxModule,
|
|
1435
|
+
providers: [
|
|
1436
|
+
OptionCheckboxService
|
|
1437
|
+
]
|
|
1438
|
+
};
|
|
1439
|
+
};
|
|
1432
1440
|
return OptionCheckboxModule;
|
|
1433
1441
|
}());
|
|
1434
1442
|
OptionCheckboxModule.decorators = [
|
|
1435
1443
|
{ type: core.NgModule, args: [{
|
|
1436
1444
|
declarations: [OptionCheckboxComponent, AllOptionCheckboxComponent, OptionCheckboxGroupComponent],
|
|
1437
1445
|
exports: [OptionCheckboxComponent, AllOptionCheckboxComponent, OptionCheckboxGroupComponent],
|
|
1438
|
-
providers: [OptionCheckboxService],
|
|
1439
1446
|
imports: [
|
|
1440
1447
|
common.CommonModule,
|
|
1441
1448
|
forms.FormsModule,
|