@ngx-smz/core 21.9.0-next.19 → 21.9.0-next.21
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.
|
@@ -8318,6 +8318,7 @@ class DynamicDialogComponent {
|
|
|
8318
8318
|
}
|
|
8319
8319
|
maximize() {
|
|
8320
8320
|
this.maximized = !this.maximized;
|
|
8321
|
+
this.syncSizeAroundMaximize();
|
|
8321
8322
|
if (!this.config.modal) {
|
|
8322
8323
|
if (this.maximized) {
|
|
8323
8324
|
SmzDomHandler.addClass(document.body, 'p-overflow-hidden');
|
|
@@ -8328,6 +8329,32 @@ class DynamicDialogComponent {
|
|
|
8328
8329
|
}
|
|
8329
8330
|
this.onMaximize.emit({ maximized: this.maximized });
|
|
8330
8331
|
}
|
|
8332
|
+
/**
|
|
8333
|
+
* O dialog tem tamanho automatico (segue o conteudo). Conteudo que fixa tamanho em px enquanto o dialog esta
|
|
8334
|
+
* maximizado (tabelas, graficos, componentes que medem o contentor) o deixaria maior ao restaurar. Guarda o
|
|
8335
|
+
* tamanho de antes de maximizar e, ao restaurar, o usa como teto (max-width/max-height): o dialog volta ao
|
|
8336
|
+
* tamanho original e ainda pode encolher se o conteudo encolher. Tamanhos definidos pelo consumidor (`width`,
|
|
8337
|
+
* `height`, `style`) sao respeitados e nao sao tocados.
|
|
8338
|
+
*/
|
|
8339
|
+
syncSizeAroundMaximize() {
|
|
8340
|
+
const container = this.container;
|
|
8341
|
+
if (!container)
|
|
8342
|
+
return;
|
|
8343
|
+
container.style.removeProperty('max-width');
|
|
8344
|
+
container.style.removeProperty('max-height');
|
|
8345
|
+
if (this.maximized) {
|
|
8346
|
+
this.preMaximizeContainerWidth = container.offsetWidth;
|
|
8347
|
+
this.preMaximizeContainerHeight = container.offsetHeight;
|
|
8348
|
+
return;
|
|
8349
|
+
}
|
|
8350
|
+
const style = (this.config.style ?? {});
|
|
8351
|
+
if (this.preMaximizeContainerWidth > 0 && !this.config.width && style['width'] == null && style['maxWidth'] == null) {
|
|
8352
|
+
container.style.maxWidth = `${this.preMaximizeContainerWidth}px`;
|
|
8353
|
+
}
|
|
8354
|
+
if (this.preMaximizeContainerHeight > 0 && !this.config.height && style['height'] == null && style['maxHeight'] == null) {
|
|
8355
|
+
container.style.maxHeight = `${this.preMaximizeContainerHeight}px`;
|
|
8356
|
+
}
|
|
8357
|
+
}
|
|
8331
8358
|
enableModality() {
|
|
8332
8359
|
if (this.config.closable !== false && this.config.dismissableMask) {
|
|
8333
8360
|
this.maskClickListener = this.renderer.listen(this.wrapper, 'mousedown', (event) => {
|