50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
import { DOCUMENT } from '@angular/common';
|
|
import { Component, EventEmitter, Inject, Input, OnInit, Output, SimpleChanges } from '@angular/core';
|
|
import { BaseComponent } from '@common/base/base.component';
|
|
import { Foo, ToCEntry, ToCEntryType } from '../table-of-contents-entry';
|
|
|
|
@Component({
|
|
selector: 'app-dataset-profile-table-of-contents-internal-section',
|
|
styleUrls: ['./table-of-contents-internal-section.scss'],
|
|
templateUrl: './table-of-contents-internal-section.html'
|
|
})
|
|
export class DatasetProfileTableOfContentsInternalSection extends BaseComponent implements OnInit {
|
|
|
|
@Input() links: ToCEntry[];
|
|
@Output() itemClick = new EventEmitter<ToCEntry>();
|
|
@Output() newEntry = new EventEmitter<ToCEntry>();
|
|
@Output() removeEntry = new EventEmitter<ToCEntry>();
|
|
|
|
@Output() createFooEntry = new EventEmitter<Foo>();
|
|
|
|
@Input() parentLink: ToCEntry;
|
|
@Input() itemSelected: ToCEntry;
|
|
|
|
constructor(
|
|
@Inject(DOCUMENT) private _document: Document) {
|
|
super();
|
|
}
|
|
|
|
tocEntryType = ToCEntryType;
|
|
|
|
ngOnInit(): void {
|
|
|
|
}
|
|
|
|
ngOnChanges(changes: SimpleChanges) {
|
|
|
|
}
|
|
|
|
itemClicked(item: ToCEntry) {
|
|
//leaf node
|
|
this.itemClick.emit(item);
|
|
}
|
|
|
|
deleteEntry(currentLink: ToCEntry){
|
|
this.removeEntry.emit(currentLink);
|
|
}
|
|
|
|
createNewEntry(foo: Foo){
|
|
this.createFooEntry.emit(foo);
|
|
}
|
|
} |