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';
9 * MARC Record flat text (marc-breaker) editor.
13 selector: 'eg-marc-flat-editor',
14 templateUrl: './flat-editor.component.html',
15 styleUrls: ['flat-editor.component.css']
18 export class MarcFlatEditorComponent implements OnInit {
20 get record(): MarcRecord {
21 return this.editor.record;
25 private idl: IdlService,
26 private org: OrgService,
27 private store: ServerStoreService,
28 @Host() private editor: MarcEditorComponent
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.
37 if (this.record && this.record.breakerText) {
38 return this.record.breakerText.split(/\n/).length + 2;