import SlotView, { ISlot, InitialSettings as IBaseSettings } from '../../slot-view'; import { SLOT_ELEMENT_TYPE, SLOT_ELEMENT_NAME } from '../constants'; import { SLOT_TYPE } from '../../constants'; export interface IDagSlot extends ISlot { elementType: SLOT_ELEMENT_TYPE; } export interface InitialSettings extends IBaseSettings { slotConfig: IDagSlot; } export default class DagSlotView extends SlotView { private title: string; constructor (settings: InitialSettings) { super(settings); this.title = SLOT_ELEMENT_TYPE[settings.slotConfig.elementType]; } public getTitle () { return this.title; } /** * For dag editor, only allows output slot connect to input slot. */ public get editable() { return !(this.type === SLOT_TYPE.INPUT_SLOT); } }