-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(modal): allow dynamic dir switching (#128)
- Loading branch information
1 parent
b7ac7ef
commit a8c1616
Showing
8 changed files
with
74 additions
and
9 deletions.
There are no files selected for viewing
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
4 changes: 4 additions & 0 deletions
4
...aquila/documentation/examples/modal/modal-with-direction/modal-with-direction-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,4 @@ | ||
.centered-content { | ||
display: flex; | ||
flex-direction: column; | ||
} |
9 changes: 9 additions & 0 deletions
9
...quila/documentation/examples/modal/modal-with-direction/modal-with-direction-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,9 @@ | ||
<button nxButton (click)="openFromTemplate()">Open modal with direction</button> | ||
|
||
<ng-template #template> | ||
<div class="centered-content"> | ||
<h3 nxHeadline="subsection-medium">Modal with configured locale direction</h3> | ||
<p nxCopytext="small">This content is placed within the <code>nx-modal-container</code></p> | ||
<button nxButton (click)="closeTemplateDialog()">Close Modal</button> | ||
</div> | ||
</ng-template> |
29 changes: 29 additions & 0 deletions
29
...-aquila/documentation/examples/modal/modal-with-direction/modal-with-direction-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,29 @@ | ||
import { Directionality } from '@angular/cdk/bidi'; | ||
import { Component, ViewChild, TemplateRef } from '@angular/core'; | ||
import { NxDialogService, NxModalRef } from '@aposin/ng-aquila/modal'; | ||
|
||
/** | ||
* @title Modal with direction example | ||
*/ | ||
@Component({ | ||
templateUrl: './modal-with-direction-example.html', | ||
styleUrls: ['./modal-with-direction-example.css'] | ||
}) | ||
export class ModalWithDirectionExampleComponent { | ||
@ViewChild('template') templateRef: TemplateRef<any>; | ||
|
||
templateDialogRef: NxModalRef<any>; | ||
|
||
constructor( | ||
public dialogService: NxDialogService, | ||
private dir: Directionality, | ||
) {} | ||
|
||
openFromTemplate(): void { | ||
this.templateDialogRef = this.dialogService.open(this.templateRef, {ariaLabel: 'Dialog with direction', direction: this.dir.value} ); | ||
} | ||
|
||
closeTemplateDialog() { | ||
this.templateDialogRef.close(); | ||
} | ||
} |
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