import { BaseWidget } from "./widegt"; import { IIterator } from '@phosphor/algorithm'; import { Message } from "@phosphor/messaging"; import { Widget, SplitPanel, PanelLayout, SplitLayout, LayoutItem } from "@phosphor/widgets"; import { SplitPositionHandler } from "./split-panels"; import { Emitter, Event as CommonEvent } from './event'; import { DisposableCollection, Disposable } from "./disposable"; import { TabBarToolbar } from '../nav-panel/tool-bar/tool-bar'; export interface ViewContainerTitleOptions { label: string; caption?: string; iconClass?: string; closeable?: boolean; } export declare class ViewContainerIdentifier { id: string; progressLocationId?: string; } /** 收折面板配置 */ export interface ViewContainerPartConfig { /** 是否隐藏标题栏 */ hideTitleBar?: boolean; /** 指定滚动条容器 */ customScrollContainerEl?: HTMLElement; } export declare class ViewContainer extends BaseWidget { protected panel: SplitPanel; protected currentPart: ViewContainerPart | undefined; protected splitPositionHandler: SplitPositionHandler; readonly containerLayout: ViewContainerLayout; getParts(): ViewContainerPart[]; /** 更新各个面板的滚动条大小 */ updateAllScrollbar(): void; protected getPartIndex(partId: string | undefined): number; protected readonly enableAnimation: boolean; constructor(); private init; protected configureLayout(layout: PanelLayout): void; protected toRemoveWidgets: Map; protected createPartId(widget: Widget): string; protected createPart(widget: Widget, toolbar?: TabBarToolbar, config?: ViewContainerPartConfig): ViewContainerPart; addWidget(widget: Widget, toolbar?: TabBarToolbar, config?: ViewContainerPartConfig): Disposable; protected attachNewPart(newPart: ViewContainerPart): Disposable; protected registerDND(part: ViewContainerPart): Disposable; removeWidget(widget: Widget): boolean; protected updateCurrentPart(part?: ViewContainerPart): void; getPartFor(widget: Widget): ViewContainerPart | undefined; protected readonly orientation: SplitLayout.Orientation; protected moveBefore(toMovedId: string, moveBeforeThisId: string): void; getTrackableWidgets(): Widget[]; activateWidget(id: string): Widget | undefined; revealWidget(id: string): Widget | undefined; protected revealPart(id: string): ViewContainerPart | undefined; protected onActivateRequest(msg: Message): void; protected onAfterAttach(msg: Message): void; protected onBeforeHide(msg: Message): void; protected onAfterShow(msg: Message): void; protected onBeforeAttach(msg: Message): void; protected onAfterDetach(msg: Message): void; } export declare namespace ViewContainer { interface State { title?: ViewContainerTitleOptions; parts: ViewContainerPart.State[]; } function getOrientation(): 'horizontal' | 'vertical'; /** * 整体上调整拖拽条显隐状态 * @remarks * 1. 当该面板及其后续面板均收折时,隐藏该面板的拖拽条 * 2. 当该面板上方的面板收折时,隐藏该面板的拖拽条 * 3. 其余情况下显示该面板的拖拽条 * @param layout 面板布局 */ function updateSashStateOverall(layout: ViewContainerLayout): void; } export declare class ViewContainerPart extends BaseWidget { protected readonly header: HTMLElement; protected toggleIconBtn: HTMLElement; protected readonly body: HTMLElement; protected readonly collapsedEmitter: Emitter; protected _collapsed: boolean; uncollapsedSize: number | undefined; animatedSize: number | undefined; wrapped: Widget; toolbar: TabBarToolbar; config?: ViewContainerPartConfig; constructor(wrapped: Widget, toolbar: TabBarToolbar, config?: ViewContainerPartConfig); protected getScrollContainer(): HTMLElement; protected createContent(): { header: HTMLElement; body: HTMLElement; disposable: Disposable; }; protected createHeader(): { header: HTMLElement; disposable: Disposable; }; readonly viewContainer: ViewContainer | undefined; readonly headerElement: HTMLElement; collapsed: boolean; setHidden(hidden: boolean): void; readonly canHide: boolean; readonly onCollapsed: CommonEvent; readonly minSize: number; protected onResize(msg: Widget.ResizeMessage): void; protected onUpdateRequest(msg: Message): void; protected onAfterAttach(msg: Message): void; protected onBeforeDetach(msg: Message): void; protected onBeforeShow(msg: Message): void; protected onAfterShow(msg: Message): void; protected onBeforeHide(msg: Message): void; protected onAfterHide(msg: Message): void; protected onChildRemoved(msg: Widget.ChildMessage): void; protected onActivateRequest(msg: Message): void; } export declare namespace ViewContainerPart { /** * Make sure to adjust the `line-height` of the `.farris-view-container .part > .header` CSS class when modifying this, and vice versa. */ const HEADER_HEIGHT = 44; interface State { widget?: Widget; partId: string; collapsed: boolean; hidden: boolean; relativeSize?: number; description?: string; } function closestPart(element: Element | EventTarget | null, selector?: string): Element | undefined; } export declare class ViewContainerLayout extends SplitLayout { protected options: ViewContainerLayout.Options; protected readonly splitPositionHandler: SplitPositionHandler; constructor(options: ViewContainerLayout.Options, splitPositionHandler: SplitPositionHandler); protected readonly items: ReadonlyArray; iter(): IIterator; readonly widgets: ViewContainerPart[]; attachWidget(index: number, widget: ViewContainerPart): void; moveWidget(fromIndex: number, toIndex: number, widget: Widget): void; getPartSize(part: ViewContainerPart): number | undefined; setPartSizes(weights: (number | undefined)[]): void; /** * Determine the size of the split panel area that is available for widget content, * i.e. excluding part headers and split handles. */ getAvailableSize(): number; /** * Update a view container part that has been collapsed or expanded. The transition * to the new state is animated. */ updateCollapsed(part: ViewContainerPart, enableAnimation: boolean): void; protected onFitRequest(msg: Message): void; /** * Sinusoidal tween function for smooth animation. */ protected tween(t: number): number; setHandlePosition(index: number, position: number): Promise; } export declare namespace ViewContainerLayout { interface Options extends SplitLayout.IOptions { headerSize: number; animationDuration: number; } interface Item { readonly widget: ViewContainerPart; } }