-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(material/dialog): add the ability to control the animation durat…
…ion (#13466) Since the dialog animation is on the `MatDialogContainer`, consumers aren't able to disable the animation. These changes add properties to the dialog config that allow consumers to set the duration of the dialog's enter and exit animations. Fixes #3616.
- Loading branch information
Showing
13 changed files
with
136 additions
and
3 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
...mponents-examples/material/dialog/dialog-animations/dialog-animations-example-dialog.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<h1 mat-dialog-title>Delete file</h1> | ||
<div mat-dialog-content> | ||
Would you like to delete cat.jpeg? | ||
</div> | ||
<div mat-dialog-actions> | ||
<button mat-button mat-dialog-close>No</button> | ||
<button mat-button mat-dialog-close cdkFocusInitial>Ok</button> | ||
</div> |
3 changes: 3 additions & 0 deletions
3
src/components-examples/material/dialog/dialog-animations/dialog-animations-example.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
button { | ||
margin-right: 8px; | ||
} |
2 changes: 2 additions & 0 deletions
2
src/components-examples/material/dialog/dialog-animations/dialog-animations-example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<button mat-raised-button (click)="openDialog('0ms', '0ms')">Open dialog without animation</button> | ||
<button mat-raised-button (click)="openDialog('3000ms', '1500ms')">Open dialog slowly</button> |
30 changes: 30 additions & 0 deletions
30
src/components-examples/material/dialog/dialog-animations/dialog-animations-example.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import {Component} from '@angular/core'; | ||
import {MatDialog, MatDialogRef} from '@angular/material/dialog'; | ||
|
||
/** | ||
* @title Dialog Animations | ||
*/ | ||
@Component({ | ||
selector: 'dialog-animations-example', | ||
styleUrls: ['dialog-animations-example.css'], | ||
templateUrl: 'dialog-animations-example.html', | ||
}) | ||
export class DialogAnimationsExample { | ||
constructor(public dialog: MatDialog) {} | ||
|
||
openDialog(enterAnimationDuration: string, exitAnimationDuration: string): void { | ||
this.dialog.open(DialogAnimationsExampleDialog, { | ||
width: '250px', | ||
enterAnimationDuration, | ||
exitAnimationDuration, | ||
}); | ||
} | ||
} | ||
|
||
@Component({ | ||
selector: 'dialog-animations-example-dialog', | ||
templateUrl: 'dialog-animations-example-dialog.html', | ||
}) | ||
export class DialogAnimationsExampleDialog { | ||
constructor(public dialogRef: MatDialogRef<DialogAnimationsExampleDialog>) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters