bitwarden-estensione-browser/src/popup/components/ciphers-list.component.ts

38 lines
856 B
TypeScript
Raw Normal View History

2018-04-05 23:27:31 +02:00
import {
Component,
EventEmitter,
Input,
Output,
} from '@angular/core';
import { CipherType } from 'jslib/enums/cipherType';
import { CipherView } from 'jslib/models/view/cipherView';
@Component({
selector: 'app-ciphers-list',
2018-04-06 17:48:45 +02:00
templateUrl: 'ciphers-list.component.html',
2018-04-05 23:27:31 +02:00
})
export class CiphersListComponent {
@Output() onSelected = new EventEmitter<CipherView>();
@Output() launchEvent = new EventEmitter<CipherView>();
2018-04-06 20:03:35 +02:00
@Output() onView = new EventEmitter<CipherView>();
2018-04-05 23:27:31 +02:00
@Input() ciphers: CipherView[];
2018-04-06 20:03:35 +02:00
@Input() showView = false;
2018-04-05 23:27:31 +02:00
@Input() title: string;
cipherType = CipherType;
selectCipher(c: CipherView) {
this.onSelected.emit(c);
}
2018-04-06 20:03:35 +02:00
launchCipher(c: CipherView) {
this.launchEvent.emit(c);
2018-04-11 05:28:50 +02:00
}
2018-04-06 20:03:35 +02:00
viewCipher(c: CipherView) {
this.onView.emit(c);
}
2018-04-05 23:27:31 +02:00
}