This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d3d789
commit 37e5729
Showing
8 changed files
with
61 additions
and
43 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
src/app/design/styled-button/styled-button.component.spec.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 (click)="onClick.emit($event)" [class]="flavor" [disabled]="disabled"> | ||
<ng-content></ng-content> | ||
</button> |
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 |
---|---|---|
|
@@ -37,6 +37,7 @@ button { | |
border: none; | ||
font-size: 16px; | ||
margin-right: 10px; | ||
|
||
&:last-child { | ||
margin-right: 0; | ||
} | ||
|
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,23 @@ | ||
import {ComponentFixture, TestBed} from '@angular/core/testing'; | ||
import {ButtonComponent} from './button.component'; | ||
|
||
describe('ButtonComponent', () => { | ||
let component: ButtonComponent; | ||
let fixture: ComponentFixture<ButtonComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ButtonComponent] | ||
}).compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ButtonComponent); | ||
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,17 @@ | ||
import {Component, EventEmitter, Input, Output} from '@angular/core'; | ||
|
||
export type ButtonFlavor = 'primary' | 'success' | 'warning' | 'danger' | 'info'; | ||
|
||
@Component({ | ||
selector: 'app-button', | ||
templateUrl: './button.component.html', | ||
styleUrls: ['./button.component.scss'] | ||
}) | ||
export class ButtonComponent { | ||
|
||
@Input() public disabled = false; | ||
@Input() public flavor: ButtonFlavor = 'primary'; | ||
|
||
// eslint-disable-next-line @angular-eslint/no-output-on-prefix | ||
@Output() public onClick = new EventEmitter<MouseEvent>(); | ||
} |
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,17 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {CommonModule} from '@angular/common'; | ||
import {ButtonComponent} from './button.component'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
ButtonComponent | ||
], | ||
exports: [ | ||
ButtonComponent | ||
], | ||
imports: [ | ||
CommonModule | ||
] | ||
}) | ||
export class ButtonModule { | ||
} |