]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/eg2/src/app/staff/share/marc-edit/flat-editor.component.ts
LP1825851 Server managed/processed print templates
[working/Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / share / marc-edit / flat-editor.component.ts
1 import {Component, Input, OnInit, Host} from '@angular/core';
2 import {IdlService} from '@eg/core/idl.service';
3 import {OrgService} from '@eg/core/org.service';
4 import {ServerStoreService} from '@eg/core/server-store.service';
5 import {MarcEditorComponent} from './editor.component';
6 import {MarcRecord} from './marcrecord';
7
8 /**
9  * MARC Record flat text (marc-breaker) editor.
10  */
11
12 @Component({
13   selector: 'eg-marc-flat-editor',
14   templateUrl: './flat-editor.component.html',
15   styleUrls: ['flat-editor.component.css']
16 })
17
18 export class MarcFlatEditorComponent implements OnInit {
19
20     get record(): MarcRecord {
21         return this.editor.record;
22     }
23
24     constructor(
25         private idl: IdlService,
26         private org: OrgService,
27         private store: ServerStoreService,
28         @Host() private editor: MarcEditorComponent
29     ) {
30     }
31
32     ngOnInit() {}
33
34     // When we have breaker text, limit the vertical expansion of the
35     // text area to the size of the data plus a little padding.
36     rowCount(): number {
37         if (this.record && this.record.breakerText) {
38             return this.record.breakerText.split(/\n/).length + 2;
39         }
40         return 40;
41     }
42 }
43
44
45