import { ITabInfo , ITabInfoOptions , TabsContainer } from '@cloudbeaver/core-ui' ; import { injectable } from '@cloudbeaver/core-di' ; import type { ResultDataFormat } from '@cloudbeaver/core-sdk' ; import type { IDatabaseDataModel } from '../../DatabaseDataModel/IDatabaseDataModel' ; import type { IDatabaseDataResult } from '../../DatabaseDataModel/IDatabaseDataResult' ; export interface IDataValuePanelOptions { dataFormat : ResultDataFormat [ ] ; } export interface IDataValuePanelProps < TOptions , TResult extends IDatabaseDataResult = IDatabaseDataResult > { dataFormat : ResultDataFormat | null ; model : IDatabaseDataModel < TOptions , TResult > ; resultIndex : number ; } @ injectable ( ) export class DataValuePanelService { readonly tabs : TabsContainer < IDataValuePanelProps < any > , IDataValuePanelOptions > ; constructor ( ) { this . tabs = new TabsContainer ( ) ; } get ( tabId ) { return this . tabs . getTabInfo ( tabId ) ; } getDisplayed ( props ? ) { return this . tabs . tabInfoList . filter ( info => ( ( ( props ?. dataFormat === undefined || props . dataFormat === null ) || info . options ?. dataFormat . includes ( props . dataFormat ) ) && ! info . isHidden ?. ( info . key , props ) ) ) ; } add ( tabInfo ) { this . tabs . add ( tabInfo ) ; } }