UNPKG

pdbe-molstar

Version:
36 lines (35 loc) 1.94 kB
import { PluginContext } from 'molstar/lib/mol-plugin/context'; import { BehaviorSubject, Subject } from 'rxjs'; /** Specification of one tab in a tabbed panel */ export interface TabSpec { /** Unique identifier of the tab */ id: string; /** Tab title (shown in header and as tooltip on the icon) */ title: string; /** Tab icon (shown in icon bar and in tab header), either a React component or a string with icon path (in 24x24 viewBox) */ icon: React.JSXElementConstructor<{}> | string; /** Custom tab header (default is icon + title) */ header?: React.JSXElementConstructor<{}>; /** Tab body (main content in the tab) */ body: React.JSXElementConstructor<{}>; /** Limit tab visibility to when `showWhen` returns true (default: always visible) */ showWhen?: (plugin: PluginContext) => boolean; /** The tab icon will show a marker whenever `dirtyOn` Subject fires a truthy value and the tab is not currently open. * The marker will disappear when the tab is opened or when `dirtyOn` fires a falsey value. */ dirtyOn?: (plugin: PluginContext) => Subject<any> | undefined; } /** Return a React component showing a panel with tab icons on the left and tab content of the open tab on the right */ export declare function VerticalTabbedPanel(options: { tabsTop?: TabSpec[]; tabsBottom?: TabSpec[]; defaultTab?: string; boundBehavior?: (plugin: PluginContext) => BehaviorSubject<string>; onTabChange?: (plugin: PluginContext, tab: string) => any; }): React.ComponentClass<{}>; /** Like `VerticalTabbedPanel` but is bound to plugin.behaviors.layout.leftPanelTabName and plugin.layout.state.regionState (ensures left panel collapsing/expanding) */ export declare function LeftPanel(options: { tabsTop?: TabSpec[]; tabsBottom?: TabSpec[]; defaultTab?: string; onTabChange?: (plugin: PluginContext, tab: string) => any; }): React.ComponentClass<{}>;