-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dialog): initial commit for
dialog
(#74)
* feat(dialog): initial commit for `dialog`
- Loading branch information
Showing
62 changed files
with
1,409 additions
and
277 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
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
1 change: 1 addition & 0 deletions
1
src/app/docs/components/dialog-demo/basic-dialog/basic-dialog.component.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 @@ | ||
<button ly-button (click)="open()">open</button> |
25 changes: 25 additions & 0 deletions
25
src/app/docs/components/dialog-demo/basic-dialog/basic-dialog.component.spec.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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { BasicDialogComponent } from './basic-dialog.component'; | ||
|
||
describe('BasicDialogComponent', () => { | ||
let component: BasicDialogComponent; | ||
let fixture: ComponentFixture<BasicDialogComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ BasicDialogComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(BasicDialogComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
32 changes: 32 additions & 0 deletions
32
src/app/docs/components/dialog-demo/basic-dialog/basic-dialog.component.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,32 @@ | ||
import { Component, ChangeDetectionStrategy } from '@angular/core'; | ||
import { LyDialog, LyDialogRef } from '@alyle/ui/dialog'; | ||
|
||
@Component({ | ||
selector: 'aui-basic-dialog', | ||
templateUrl: './basic-dialog.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class BasicDialogComponent { | ||
|
||
constructor( | ||
private _dialog: LyDialog | ||
) { } | ||
|
||
open() { | ||
const dialogRef = this._dialog.open<DialogDemo>(DialogDemo, { | ||
width: 320 | ||
}); | ||
dialogRef.afterClosed.subscribe((result) => console.log(result)); | ||
} | ||
|
||
} | ||
|
||
@Component({ | ||
templateUrl: './dialog-demo.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class DialogDemo { | ||
constructor( | ||
public dialogRef: LyDialogRef | ||
) { } | ||
} |
22 changes: 22 additions & 0 deletions
22
src/app/docs/components/dialog-demo/basic-dialog/basic-dialog.module.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,22 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { LyDialogModule } from '@alyle/ui/dialog'; | ||
import { LyGridModule } from '@alyle/ui/grid'; | ||
import { LyButtonModule } from '@alyle/ui/button'; | ||
import { LyTypographyModule } from '@alyle/ui/typography'; | ||
|
||
import { BasicDialogComponent, DialogDemo } from './basic-dialog.component'; | ||
|
||
@NgModule({ | ||
declarations: [BasicDialogComponent, DialogDemo], | ||
entryComponents: [DialogDemo], | ||
imports: [ | ||
CommonModule, | ||
LyDialogModule, | ||
LyGridModule, | ||
LyButtonModule, | ||
LyTypographyModule | ||
], | ||
exports: [BasicDialogComponent] | ||
}) | ||
export class BasicDialogModule { } |
10 changes: 10 additions & 0 deletions
10
src/app/docs/components/dialog-demo/basic-dialog/dialog-demo.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,10 @@ | ||
<h4 ly-dialog-title gutterBottom>Use location service?</h4> | ||
<div ly-dialog-content> | ||
<p lyTyp="body2" color="text:secondary"> | ||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Totam earum dolor, iusto fugit in dolore. | ||
</p> | ||
</div> | ||
<ly-grid container justify="end" ly-dialog-actions> | ||
<button ly-button color="primary" (click)="dialogRef.close()">DISAGREE</button> | ||
<button ly-button color="primary" (click)="dialogRef.close(true)">AGREE</button> | ||
</ly-grid> |
38 changes: 38 additions & 0 deletions
38
src/app/docs/components/dialog-demo/dialog-demo.component.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,38 @@ | ||
<p> | ||
The <span prism code="LyDialog" language="ts"></span> service can be used to open modal dialogs. | ||
</p> | ||
|
||
<h2 [lyTyp]="'display1'" gutter>Basic Dialog</h2> | ||
<demo-view | ||
path="docs/components/dialog-demo/basic-dialog" | ||
[extraPaths]="['dialog-demo.html']" | ||
> | ||
<aui-basic-dialog></aui-basic-dialog> | ||
</demo-view> | ||
|
||
<h2 [lyTyp]="'display1'" gutter>Full-screen dialog</h2> | ||
<demo-view | ||
path="docs/components/dialog-demo/full-screen-dialog" | ||
[extraPaths]="['full-screen-dialog.html']" | ||
> | ||
<aui-full-screen-dialog></aui-full-screen-dialog> | ||
</demo-view> | ||
|
||
<h2 [lyTyp]="'display1'" gutter>Responsive full-screen</h2> | ||
<p> | ||
Resize the screen to see changes. | ||
</p> | ||
<demo-view | ||
path="docs/components/dialog-demo/dialog-responsive" | ||
[extraPaths]="['dialog-responsive-dialog.html']" | ||
> | ||
<aui-dialog-responsive></aui-dialog-responsive> | ||
</demo-view> | ||
|
||
<h2 [lyTyp]="'display1'" gutter>Prompt</h2> | ||
<demo-view | ||
path="docs/components/dialog-demo/dialog-prompt" | ||
[extraPaths]="['dialog-prompt-dialog.html']" | ||
> | ||
<aui-dialog-prompt></aui-dialog-prompt> | ||
</demo-view> |
25 changes: 25 additions & 0 deletions
25
src/app/docs/components/dialog-demo/dialog-demo.component.spec.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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { DialogDemoComponent } from './dialog-demo.component'; | ||
|
||
describe('DialogDemoComponent', () => { | ||
let component: DialogDemoComponent; | ||
let fixture: ComponentFixture<DialogDemoComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ DialogDemoComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DialogDemoComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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 @@ | ||
import { Component, ChangeDetectionStrategy } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'aui-dialog-demo', | ||
templateUrl: './dialog-demo.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class DialogDemoComponent { } |
13 changes: 13 additions & 0 deletions
13
src/app/docs/components/dialog-demo/dialog-prompt/dialog-prompt-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,13 @@ | ||
<h4 ly-dialog-title gutterBottom>What's your name?</h4> | ||
<div ly-dialog-content> | ||
<ly-field> | ||
<input lyNativeControl | ||
placeholder="Type you name" | ||
[(ngModel)]="data.name" | ||
> | ||
</ly-field> | ||
</div> | ||
<ly-grid container justify="end" ly-dialog-actions> | ||
<button ly-button color="primary" (click)="dialogRef.close()">CANCEL</button> | ||
<button ly-button color="primary" (click)="dialogRef.close(data.name)">DONE</button> | ||
</ly-grid> |
4 changes: 4 additions & 0 deletions
4
src/app/docs/components/dialog-demo/dialog-prompt/dialog-prompt.component.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,4 @@ | ||
<button ly-button (click)="open()">open</button> | ||
<pre *ngIf="name"> | ||
name: {{ name }} | ||
</pre> |
25 changes: 25 additions & 0 deletions
25
src/app/docs/components/dialog-demo/dialog-prompt/dialog-prompt.component.spec.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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { DialogPromptComponent } from './dialog-prompt.component'; | ||
|
||
describe('DialogPromptComponent', () => { | ||
let component: DialogPromptComponent; | ||
let fixture: ComponentFixture<DialogPromptComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ DialogPromptComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DialogPromptComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.