UNPKG

2.76 kBTypeScriptView Raw
1import * as React from 'react';
2import { CommandRegistry, DisposableCollection, MenuCommandExecutor, MenuModelRegistry, MenuPath } from '../../../common';
3import { Anchor, ContextMenuAccess, ContextMenuRenderer } from '../../context-menu-renderer';
4import { LabelParser } from '../../label-parser';
5import { ReactWidget, Widget } from '../../widgets';
6import { TabBarToolbarRegistry } from './tab-bar-toolbar-registry';
7import { AnyToolbarItem, ReactTabBarToolbarItem, TabBarToolbarItem } from './tab-bar-toolbar-types';
8/**
9 * Factory for instantiating tab-bar toolbars.
10 */
11export declare const TabBarToolbarFactory: unique symbol;
12export interface TabBarToolbarFactory {
13 (): TabBarToolbar;
14}
15/**
16 * Tab-bar toolbar widget representing the active [tab-bar toolbar items](TabBarToolbarItem).
17 */
18export declare class TabBarToolbar extends ReactWidget {
19 protected current: Widget | undefined;
20 protected inline: Map<string, TabBarToolbarItem | ReactTabBarToolbarItem>;
21 protected more: Map<string, TabBarToolbarItem>;
22 protected readonly commands: CommandRegistry;
23 protected readonly labelParser: LabelParser;
24 protected readonly menus: MenuModelRegistry;
25 protected readonly menuCommandExecutor: MenuCommandExecutor;
26 protected readonly contextMenuRenderer: ContextMenuRenderer;
27 protected readonly toolbarRegistry: TabBarToolbarRegistry;
28 constructor();
29 protected onRender: () => void;
30 updateItems(items: Array<TabBarToolbarItem | ReactTabBarToolbarItem>, current: Widget | undefined): void;
31 updateTarget(current?: Widget): void;
32 protected readonly toDisposeOnSetCurrent: DisposableCollection;
33 protected setCurrent(current: Widget | undefined): void;
34 protected render(): React.ReactNode;
35 protected renderItem(item: AnyToolbarItem): React.ReactNode;
36 protected getToolbarItemClassNames(commandId: string | undefined): string[];
37 protected renderMore(): React.ReactNode;
38 protected showMoreContextMenu: (event: React.MouseEvent) => void;
39 protected toAnchor(event: React.MouseEvent): Anchor;
40 renderMoreContextMenu(anchor: Anchor, subpath?: MenuPath): ContextMenuAccess;
41 shouldHandleMouseEvent(event: MouseEvent): boolean;
42 protected commandIsEnabled(command: string): boolean;
43 protected commandIsToggled(command: string): boolean;
44 protected executeCommand: (e: React.MouseEvent<HTMLElement>) => void;
45 protected onMouseDownEvent: (e: React.MouseEvent<HTMLElement>) => void;
46 protected onMouseUpEvent: (e: React.MouseEvent<HTMLElement>) => void;
47}
48export declare namespace TabBarToolbar {
49 namespace Styles {
50 const TAB_BAR_TOOLBAR = "p-TabBar-toolbar";
51 const TAB_BAR_TOOLBAR_ITEM = "item";
52 }
53}
54//# sourceMappingURL=tab-bar-toolbar.d.ts.map
\No newline at end of file