From c101f7ff75acdd624e1e599f1f33a67252e36558 Mon Sep 17 00:00:00 2001
From: Jean-Philippe Green
Date: Fri, 25 Dec 2020 16:15:01 +0100
Subject: [PATCH] fix(material/dialog): make align attribute into an input of
dialog actions directive instead of css
Fixes multiple issues, such as self-documentation of the align attribute, type checking, better
bindings, and IDE support. Because align is not standard for HTMLDivElement, it doesn't make much
sense to assume end users to know they can use the align attribute.
Fixes #18479
---
src/dev-app/dialog/dialog-demo.ts | 18 +++++++--------
.../dialog/dialog-content-directives.ts | 22 ++++++++++++-------
src/material/dialog/dialog.scss | 11 +++++-----
src/material/dialog/dialog.spec.ts | 12 ++++++++--
4 files changed, 39 insertions(+), 24 deletions(-)
diff --git a/src/dev-app/dialog/dialog-demo.ts b/src/dev-app/dialog/dialog-demo.ts
index 5223f841c918..7a28213edfad 100644
--- a/src/dev-app/dialog/dialog-demo.ts
+++ b/src/dev-app/dialog/dialog-demo.ts
@@ -22,7 +22,7 @@ export class DialogDemo {
dialogRef: MatDialogRef | null;
lastAfterClosedResult: string;
lastBeforeCloseResult: string;
- actionsAlignment: string;
+ actionsAlignment: 'end' | 'center' | undefined;
config = {
disableClose: false,
panelClass: 'custom-overlay-pane-class',
@@ -110,20 +110,20 @@ export class JazzDialog {
private _dimesionToggle = false;
constructor(
- public dialogRef: MatDialogRef,
- @Inject(MAT_DIALOG_DATA) public data: any) { }
+ public dialogRef: MatDialogRef,
+ @Inject(MAT_DIALOG_DATA) public data: any) { }
togglePosition(): void {
this._dimesionToggle = !this._dimesionToggle;
if (this._dimesionToggle) {
this.dialogRef
- .updateSize('500px', '500px')
- .updatePosition({ top: '25px', left: '25px' });
+ .updateSize('500px', '500px')
+ .updatePosition({ top: '25px', left: '25px' });
} else {
this.dialogRef
- .updateSize()
- .updatePosition();
+ .updateSize()
+ .updatePosition();
}
}
@@ -160,7 +160,7 @@ export class JazzDialog {
-
+