import {WidgetType, Vertical} from '@ui'; import Model from './left.model'; import {LinkType} from '@ui/type'; import {getLinks} from './left.service'; const className = 'fr.component.linkStatus.left'; let leftContent: any = null; const Widget: WidgetType = { _store() { return BI.Models.getModel(Model); }, watch: { linkList(linkList: LinkType[]) { const title = linkList.length > 0 ? linkList[0].connectionName : ''; this.store.setStatusSelected(title); }, statusSelected(title: string) { const linkList = this.model.linkList; leftContent.populate(BI.createItems(getLinks(linkList, title))); }, }, render() { return { type: Vertical, ref(_ref: any) { leftContent = _ref; }, }; }, }; BI.shortcut(className, BI.inherit(BI.Widget, Widget)); export default className;