]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor-action.component.ts
LP1840050 Modularize various standalone components + more.
[working/Evergreen.git] / Open-ILS / src / eg2 / src / app / share / fm-editor / fm-editor-action.component.ts
1 import {Component, Input, Output, EventEmitter, Host, OnInit} from '@angular/core';
2 import {FmRecordEditorComponent} from './fm-editor.component';
3
4 @Component({
5   selector: 'eg-fm-record-editor-action',
6   template: '<ng-template></ng-template>' // no-op
7 })
8
9 export class FmRecordEditorActionComponent implements OnInit {
10
11     // unique identifier
12     @Input() key: string;
13
14     @Input() label: string;
15
16     @Input() buttonCss = 'btn-outline-dark';
17
18     // Emits the 'key' of the clicked action.
19     @Output() actionClick: EventEmitter<string>;
20
21     @Input() disabled: boolean;
22
23     constructor(@Host() private editor: FmRecordEditorComponent) {
24         this.actionClick = new EventEmitter<string>();
25     }
26
27     ngOnInit() {
28         this.editor.actions.push(this);
29     }
30 }
31