]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/blob
5affcc192323abb414276d41fa13a7956308c6ea
[ceph-ci.git] /
1 import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
2 import { ValidatorFn } from '@angular/forms';
3
4 import { I18n } from '@ngx-translate/i18n-polyfill';
5 import * as _ from 'lodash';
6
7 import { Icons } from '../../../shared/enum/icons.enum';
8 import { SelectMessages } from '../select/select-messages.model';
9 import { SelectOption } from '../select/select-option.model';
10
11 @Component({
12   selector: 'cd-select-badges',
13   templateUrl: './select-badges.component.html',
14   styleUrls: ['./select-badges.component.scss']
15 })
16 export class SelectBadgesComponent {
17   @Input()
18   data: Array<string> = [];
19   @Input()
20   options: Array<SelectOption> = [];
21   @Input()
22   messages = new SelectMessages({}, this.i18n);
23   @Input()
24   selectionLimit: number;
25   @Input()
26   customBadges = false;
27   @Input()
28   customBadgeValidators: ValidatorFn[] = [];
29
30   @Output()
31   selection = new EventEmitter();
32
33   @ViewChild('cdSelect')
34   cdSelect;
35
36   icons = Icons;
37
38   constructor(private i18n: I18n) {}
39 }