File tree Expand file tree Collapse file tree 6 files changed +79
-2
lines changed Expand file tree Collapse file tree 6 files changed +79
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @attus/elements" ,
3
- "version" : " 11.0.2 " ,
3
+ "version" : " 11.1.0 " ,
4
4
"peerDependencies" : {
5
5
"@angular/common" : " ^11.0" ,
6
6
"@angular/core" : " ^11.0"
Original file line number Diff line number Diff line change
1
+ < div mat-dialog-content >
2
+ < p class ="mat-title "> {{ data.question }}</ p >
3
+ < p class ="mat-subheading-2 " *ngIf ="data.hint !== undefined && data.hint !== '' ">
4
+ {{ data.hint }}
5
+ </ p >
6
+ </ div >
7
+ < div mat-dialog-actions >
8
+ < button mat-button mat-dialog-close ="0 ">
9
+ < mat-icon > close</ mat-icon >
10
+ {{ data.cancel }}
11
+ </ button >
12
+ < button mat-button mat-dialog-close ="1 ">
13
+ < mat-icon > check</ mat-icon >
14
+ {{ data.ok }}
15
+ </ button >
16
+ </ div >
Original file line number Diff line number Diff line change
1
+ import { ComponentFixture , TestBed } from '@angular/core/testing' ;
2
+
3
+ import { ConfirmComponent } from './confirm.component' ;
4
+
5
+ describe ( 'ConfirmComponent' , ( ) => {
6
+ let component : ConfirmComponent ;
7
+ let fixture : ComponentFixture < ConfirmComponent > ;
8
+
9
+ beforeEach ( async ( ) => {
10
+ await TestBed . configureTestingModule ( {
11
+ declarations : [ ConfirmComponent ]
12
+ } )
13
+ . compileComponents ( ) ;
14
+ } ) ;
15
+
16
+ beforeEach ( ( ) => {
17
+ fixture = TestBed . createComponent ( ConfirmComponent ) ;
18
+ component = fixture . componentInstance ;
19
+ fixture . detectChanges ( ) ;
20
+ } ) ;
21
+
22
+ it ( 'should create' , ( ) => {
23
+ expect ( component ) . toBeTruthy ( ) ;
24
+ } ) ;
25
+ } ) ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @file Confirm Component
3
+ *
4
+ * @author Attila Németh
5
+ * @date 11.06.2020
6
+ */
7
+
8
+ import { Component , Inject } from '@angular/core' ;
9
+ import { MatDialogRef , MAT_DIALOG_DATA } from '@angular/material/dialog' ;
10
+
11
+ export interface ConfirmQuestion {
12
+ question : string
13
+ hint ?: string
14
+ cancel ?: string
15
+ ok ?: string
16
+ }
17
+
18
+ @Component ( {
19
+ templateUrl : './confirm.component.html' ,
20
+ } )
21
+ export class AttusConfirmDialogComponent {
22
+
23
+ constructor ( public dialogRef : MatDialogRef < AttusConfirmDialogComponent > ,
24
+ @Inject ( MAT_DIALOG_DATA ) public data : ConfirmQuestion ) {
25
+ if ( data . cancel === undefined ) {
26
+ data . cancel = 'Cancel' ;
27
+ }
28
+ if ( data . ok === undefined ) {
29
+ data . ok = 'OK' ;
30
+ }
31
+ }
32
+
33
+ }
Original file line number Diff line number Diff line change @@ -8,10 +8,12 @@ import {MatDialogModule} from '@angular/material/dialog';
8
8
import { MatButtonModule } from '@angular/material/button' ;
9
9
10
10
import { AttusElementsLoginDialogComponent } from './components/login/login.component' ;
11
+ import { ConfirmComponent } from './components/confirm/confirm.component' ;
11
12
12
13
@NgModule ( {
13
14
declarations : [
14
- AttusElementsLoginDialogComponent
15
+ AttusElementsLoginDialogComponent ,
16
+ ConfirmComponent
15
17
] ,
16
18
imports : [
17
19
CommonModule ,
Original file line number Diff line number Diff line change 4
4
5
5
export * from './lib/elements.module' ;
6
6
export * from './lib/components/login/login.component' ;
7
+ export * from './lib/components/confirm/confirm.component' ;
You can’t perform that action at this time.
0 commit comments