]>
Commit | Line | Data |
---|---|---|
5b0ec7cd | 1 | import { Component, Input, OnChanges } from '@angular/core' |
67ed6552 | 2 | import { GlobalIconName } from '@app/shared/shared-icons' |
74d63469 GR |
3 | |
4 | @Component({ | |
5 | selector: 'my-button', | |
faf7eab7 | 6 | styleUrls: [ './button.component.scss' ], |
74d63469 GR |
7 | templateUrl: './button.component.html' |
8 | }) | |
9 | ||
5b0ec7cd | 10 | export class ButtonComponent implements OnChanges { |
74d63469 | 11 | @Input() label = '' |
b345a804 | 12 | @Input() className = 'grey-button' |
457bb213 | 13 | @Input() icon: GlobalIconName = undefined |
db66f391 | 14 | @Input() routerLink: string[] | string |
c199c427 | 15 | @Input() title: string = undefined |
b5f919ac | 16 | @Input() loading = false |
1fe1e14c | 17 | @Input() disabled = false |
faf7eab7 | 18 | @Input() responsiveLabel = false |
74d63469 | 19 | |
5b0ec7cd C |
20 | classes: { [id: string]: boolean } = {} |
21 | ||
22 | ngOnChanges () { | |
23 | this.classes = { | |
1fe1e14c | 24 | [this.className]: true, |
faf7eab7 | 25 | disabled: this.disabled, |
db129781 | 26 | 'icon-only': !this.label, |
db66f391 | 27 | 'has-icon': !!this.icon, |
faf7eab7 | 28 | 'responsive-label': this.responsiveLabel |
1fe1e14c RK |
29 | } |
30 | } | |
74d63469 | 31 | } |