1 import {Component, Input, OnInit} 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 {MarcRecord} from './marcrecord';
6 import {MarcEditContext} from './editor-context';
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 @Input() context: MarcEditContext;
21 get record(): MarcRecord {
22 return this.context.record;
26 private idl: IdlService,
27 private org: OrgService,
28 private store: ServerStoreService
32 // Be sure changes made in the enriched editor are
34 this.record.breakerText = this.record.toBreaker();
37 // When we have breaker text, limit the vertical expansion of the
38 // text area to the size of the data plus a little padding.
40 if (this.record && this.record.breakerText) {
41 return this.record.breakerText.split(/\n/).length + 2;