chip.component.ts 718 B

12345678910111213141516171819202122
  1. import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
  2. /**
  3. * A chip component for displaying a label with an optional action icon.
  4. */
  5. @Component({
  6. selector: 'vdr-chip',
  7. templateUrl: './chip.component.html',
  8. styleUrls: ['./chip.component.scss'],
  9. changeDetection: ChangeDetectionStrategy.OnPush,
  10. })
  11. export class ChipComponent {
  12. @Input() icon: string;
  13. @Input() invert = false;
  14. /**
  15. * If set, the chip will have an auto-generated background
  16. * color based on the string value passed in.
  17. */
  18. @Input() colorFrom = '';
  19. @Input() colorType: 'error' | 'success' | 'warning';
  20. @Output() iconClick = new EventEmitter<MouseEvent>();
  21. }