import { ICloseType } from "./ICloseType"; export type IBorderLocation = "top" | "bottom" | "left" | "right"; export type ITabLocation = "top" | "bottom"; export type IBorderTabDirection = "up" | "down"; export type ITabGroupType = "splitpill" | "underline"; export type ILayoutType = "window" | "float" | "tab"; export interface IJsonModel { global?: IGlobalAttributes; borders?: IJsonBorderNode[]; layout: IJsonRowNode; subLayouts?: Record; /** @deprecated Use `subLayouts` instead. */ popouts?: Record; } export interface IJsonRect { x: number; y: number; width: number; height: number; } export interface IJsonSubLayout extends ISubLayoutAttributes { layout: IJsonRowNode; rect?: IJsonRect; type?: ILayoutType; } /** @deprecated Use `IJsonSubLayout` instead. */ export type IJsonPopout = IJsonSubLayout; export interface IJsonBorderNode extends IBorderAttributes { location: IBorderLocation; children?: (IJsonTabNode | IJsonTabGroupNode)[]; } export interface IJsonRowNode extends IRowAttributes { children?: (IJsonRowNode | IJsonTabSetNode)[]; } export interface IJsonTabSetNode extends ITabSetAttributes { /** Marks this as the active tab set, read from initial json but * must subseqently be set on the model (only one tab set can be active)*/ active?: boolean; /** Marks this tab set as being maximized, read from initial json but * must subseqently be set on the model (only one tab set can be maximized) */ maximized?: boolean; children?: (IJsonTabNode | IJsonTabGroupNode)[]; } export interface IJsonTabGroupNode extends ITabGroupAttributes { children?: IJsonTabNode[]; } export type IJsonTabNode = ITabAttributes; export interface IGlobalAttributes { /** Value for BorderNode attribute autoSelectTabWhenClosed if not overridden whether to select new/moved tabs in border when the border is currently closed Default: false */ borderAutoSelectTabWhenClosed?: boolean; /** Value for BorderNode attribute autoSelectTabWhenOpen if not overridden whether to select new/moved tabs in border when the border is already open Default: true */ borderAutoSelectTabWhenOpen?: boolean; /** Value for BorderNode attribute className if not overridden class applied to the border container Default: undefined */ borderClassName?: string; /** Value for BorderNode attribute enableAutoHide if not overridden hide border if it has zero tabs; not related to the borderType 'overlay' mode (Visual Studio style auto hide), see the borderType attribute Default: false */ borderEnableAutoHide?: boolean; /** Value for BorderNode attribute enableDrop if not overridden whether tabs can be dropped into this border Default: true */ borderEnableDrop?: boolean; /** Value for BorderNode attribute enableTabScrollbar if not overridden whether to show a mini scrollbar for the tabs Default: false */ borderEnableTabScrollbar?: boolean; /** the direction the left border tabs read: 'up' (default, text reads bottom to top) or 'down' (text reads top to bottom like the right border) Default: "up" */ borderLeftTabDirection?: IBorderTabDirection; /** Value for BorderNode attribute maxSize if not overridden the maximum size of the tab area Default: 99999 */ borderMaxSize?: number; /** Value for BorderNode attribute minSize if not overridden the minimum size of the tab area Default: 1 */ borderMinSize?: number; /** Value for BorderNode attribute size if not overridden size of the tab area when selected Default: 200 */ borderSize?: number; /** enable docking to the edges of the layout Default: true */ enableEdgeDock?: boolean; /** show the edge indicators when dragging Default: true */ enableEdgeDockIndicators?: boolean; /** boolean indicating if tab icons should rotate with the text in the left and right borders Default: true */ enableRotateBorderIcons?: boolean; /** the top level 'row' will layout horizontally by default, set this option true to make it layout vertically Default: false */ rootOrientationVertical?: boolean; /** Value for TabNode attribute borderHeight if not overridden the height of this tab when shown in a border; -1 uses the border's default size Default: -1 */ tabBorderHeight?: number; /** Value for TabNode attribute borderWidth if not overridden the width of this tab when shown in a border; -1 uses the border's default size Default: -1 */ tabBorderWidth?: number; /** Value for TabNode attribute className if not overridden class applied to tab button Default: undefined */ tabClassName?: string; /** Value for TabNode attribute closeType if not overridden when the tab's close button is active: Visible (default) active if selected or hovered (note: mobile doesnt support hovered), Always: always active, Selected only active on selected tab (clicking on the x button on a non-selected tab will just select it) Default: 1 */ tabCloseType?: ICloseType; /** Value for TabNode attribute contentClassName if not overridden class applied to tab content Default: undefined */ tabContentClassName?: string; /** Value for TabNode attribute enableClose if not overridden whether the tab can be closed by the user via its close button Default: true */ tabEnableClose?: boolean; /** Value for TabNode attribute enableDrag if not overridden whether the user can drag the tab to a new location Default: true */ tabEnableDrag?: boolean; /** Value for TabNode attribute enableFloat if not overridden whether the user can move the tab to a floating window via the context menu Default: false */ tabEnableFloat?: boolean; /** Value for TabNode attribute enableFloatIcon if not overridden whether to show the float icon in the tabset header if this tab enables floating Default: false */ tabEnableFloatIcon?: boolean; /** Value for TabNode attribute enablePin if not overridden whether the user can pin/unpin the tab via the context menu Default: false */ tabEnablePin?: boolean; /** Value for TabNode attribute enablePopout if not overridden enable window popout (in popout capable browser), to show an icon in the tabset header also set the enablePopoutIcon attribute Default: false */ tabEnablePopout?: boolean; /** Value for TabNode attribute enablePopoutIcon if not overridden whether to show the popout icon in the tabset header if this tab enables popouts Default: false */ tabEnablePopoutIcon?: boolean; /** Value for TabNode attribute enablePopoutOverlay if not overridden if this tab will not work correctly in a popout window when the main window is backgrounded (inactive) then enabling this option will gray out this tab Default: false */ tabEnablePopoutOverlay?: boolean; /** Value for TabNode attribute enableRename if not overridden whether the user can rename the tab by double clicking Default: false */ tabEnableRename?: boolean; /** Value for TabNode attribute enableRenderOnDemand if not overridden whether to avoid rendering component until tab is visible Default: true */ tabEnableRenderOnDemand?: boolean; /** Value for TabNode attribute enableScrollbars if not overridden whether the tab will be hosted in a scrollable container Default: true */ tabEnableScrollbars?: boolean; /** how a tab group is visually indicated: 'splitpill' encloses the group's tabs in a pill (left/right caps), 'underline' draws a colored underline under each grouped tab Default: "splitpill" */ tabGroupType?: ITabGroupType; /** Value for TabNode attribute icon if not overridden the tab icon Default: undefined */ tabIcon?: string; /** Value for TabNode attribute maxHeight if not overridden the maximum height (in px) of this tab Default: 99999 */ tabMaxHeight?: number; /** Value for TabNode attribute maxWidth if not overridden the maximum width (in px) of this tab Default: 99999 */ tabMaxWidth?: number; /** Value for TabNode attribute minHeight if not overridden the minimum height (in px) of this tab Default: 1 */ tabMinHeight?: number; /** Value for TabNode attribute minWidth if not overridden the minimum width (in px) of this tab Default: 1 */ tabMinWidth?: number; /** Value for TabSetNode attribute autoSelectTab if not overridden whether to select new/moved tabs in tabset Default: true */ tabSetAutoSelectTab?: boolean; /** Value for TabSetNode attribute classNameTabStrip if not overridden a class name to apply to the tab strip Default: undefined */ tabSetClassNameTabStrip?: string; /** Value for TabSetNode attribute enableActiveIcon if not overridden whether the active icon (*) should be displayed when the tabset is active Default: false */ tabSetEnableActiveIcon?: boolean; /** Value for TabSetNode attribute enableClose if not overridden whether this tabset can be closed Default: true */ tabSetEnableClose?: boolean; /** Value for TabSetNode attribute enableCloseButton if not overridden if the tabset can be closed then show a close button Default: false */ tabSetEnableCloseButton?: boolean; /** Value for TabSetNode attribute enableDeleteWhenEmpty if not overridden whether to delete this tabset when it has no tabs Default: true */ tabSetEnableDeleteWhenEmpty?: boolean; /** Value for TabSetNode attribute enableDivide if not overridden whether dropping on an edge of this tabset splits it to create a new tabset Default: true */ tabSetEnableDivide?: boolean; /** Value for TabSetNode attribute enableDrag if not overridden whether the user can drag tabs out of this tabset Default: true */ tabSetEnableDrag?: boolean; /** Value for TabSetNode attribute enableDrop if not overridden whether tabs can be dropped into this tabset Default: true */ tabSetEnableDrop?: boolean; /** Value for TabSetNode attribute enableMaximize if not overridden whether the tabset can be maximized to fill the layout via the maximize button Default: true */ tabSetEnableMaximize?: boolean; /** Value for TabSetNode attribute enableSingleTabStretch if not overridden if the tabset has only a single tab then stretch the single tab to fill area and display in a header style Default: false */ tabSetEnableSingleTabStretch?: boolean; /** whether the tab group options are enabled in the context menu (default menus) Default: false */ tabSetEnableTabGroups?: boolean; /** Value for TabSetNode attribute enableTabScrollbar if not overridden whether to show a mini scrollbar for the tabs Default: false */ tabSetEnableTabScrollbar?: boolean; /** Value for TabSetNode attribute enableTabStrip if not overridden when enabled the tabset shows a tab strip and can host multiple tabs; when disabled the strip is hidden Default: true */ tabSetEnableTabStrip?: boolean; /** Value for TabSetNode attribute enableTabWrap if not overridden wrap tabs onto multiple lines Default: false */ tabSetEnableTabWrap?: boolean; /** Value for TabSetNode attribute maxHeight if not overridden maximum height (in px) for this tabset Default: 99999 */ tabSetMaxHeight?: number; /** Value for TabSetNode attribute maxWidth if not overridden maximum width (in px) for this tabset Default: 99999 */ tabSetMaxWidth?: number; /** Value for TabSetNode attribute minHeight if not overridden minimum height (in px) for this tabset Default: 1 */ tabSetMinHeight?: number; /** Value for TabSetNode attribute minWidth if not overridden minimum width (in px) for this tabset Default: 1 */ tabSetMinWidth?: number; /** Value for TabSetNode attribute tabLocation if not overridden the location of the tabs either top or bottom Default: "top" */ tabSetTabLocation?: ITabLocation; } export interface IRowAttributes { /** the unique id of the row, if left undefined a uuid will be assigned Default: undefined */ id?: string; /** Fixed value: "row" */ type?: string; /** relative weight for sizing of this row in parent row Default: 100 */ weight?: number; } export interface ITabSetAttributes { /** whether to select new/moved tabs in tabset Default: inherited from Global attribute tabSetAutoSelectTab (default true) */ autoSelectTab?: boolean; /** a class name to apply to the tab strip Default: inherited from Global attribute tabSetClassNameTabStrip (default undefined) */ classNameTabStrip?: string; /** a place to hold json config used in your own code Default: undefined */ config?: any; /** whether the active icon (*) should be displayed when the tabset is active Default: inherited from Global attribute tabSetEnableActiveIcon (default false) */ enableActiveIcon?: boolean; /** whether this tabset can be closed Default: inherited from Global attribute tabSetEnableClose (default true) */ enableClose?: boolean; /** if the tabset can be closed then show a close button Default: inherited from Global attribute tabSetEnableCloseButton (default false) */ enableCloseButton?: boolean; /** whether to delete this tabset when it has no tabs Default: inherited from Global attribute tabSetEnableDeleteWhenEmpty (default true) */ enableDeleteWhenEmpty?: boolean; /** whether dropping on an edge of this tabset splits it to create a new tabset Default: inherited from Global attribute tabSetEnableDivide (default true) */ enableDivide?: boolean; /** whether the user can drag tabs out of this tabset Default: inherited from Global attribute tabSetEnableDrag (default true) */ enableDrag?: boolean; /** whether tabs can be dropped into this tabset Default: inherited from Global attribute tabSetEnableDrop (default true) */ enableDrop?: boolean; /** whether the tabset can be maximized to fill the layout via the maximize button Default: inherited from Global attribute tabSetEnableMaximize (default true) */ enableMaximize?: boolean; /** if the tabset has only a single tab then stretch the single tab to fill area and display in a header style Default: inherited from Global attribute tabSetEnableSingleTabStretch (default false) */ enableSingleTabStretch?: boolean; /** whether the tab group options are enabled in the context menu (default menus) Default: inherited from Global attribute tabSetEnableTabGroups (default false) */ enableTabGroups?: boolean; /** whether to show a mini scrollbar for the tabs Default: inherited from Global attribute tabSetEnableTabScrollbar (default false) */ enableTabScrollbar?: boolean; /** when enabled the tabset shows a tab strip and can host multiple tabs; when disabled the strip is hidden Default: inherited from Global attribute tabSetEnableTabStrip (default true) */ enableTabStrip?: boolean; /** wrap tabs onto multiple lines Default: inherited from Global attribute tabSetEnableTabWrap (default false) */ enableTabWrap?: boolean; /** the unique id of the tab set, if left undefined a uuid will be assigned Default: undefined */ id?: string; /** maximum height (in px) for this tabset Default: inherited from Global attribute tabSetMaxHeight (default 99999) */ maxHeight?: number; /** maximum width (in px) for this tabset Default: inherited from Global attribute tabSetMaxWidth (default 99999) */ maxWidth?: number; /** minimum height (in px) for this tabset Default: inherited from Global attribute tabSetMinHeight (default 1) */ minHeight?: number; /** minimum width (in px) for this tabset Default: inherited from Global attribute tabSetMinWidth (default 1) */ minWidth?: number; /** an accessible label for the tab strip (used as the tablist's aria-label; not displayed visually) Default: undefined */ name?: string; /** index of selected/visible tab in tabset; -1 means no tab selected Default: 0 */ selected?: number; /** the location of the tabs either top or bottom Default: inherited from Global attribute tabSetTabLocation (default "top") */ tabLocation?: ITabLocation; /** Fixed value: "tabset" */ type?: string; /** relative weight for sizing of this tabset in parent row Default: 100 */ weight?: number; } export interface ITabAttributes { /** the name used in the overflow menu when the tab has no name (e.g. an icon-only tab) Default: undefined */ altName?: string; /** the height of this tab when shown in a border; -1 uses the border's default size Default: inherited from Global attribute tabBorderHeight (default -1) */ borderHeight?: number; /** the width of this tab when shown in a border; -1 uses the border's default size Default: inherited from Global attribute tabBorderWidth (default -1) */ borderWidth?: number; /** class applied to tab button Default: inherited from Global attribute tabClassName (default undefined) */ className?: string; /** when the tab's close button is active: Visible (default) active if selected or hovered (note: mobile doesnt support hovered), Always: always active, Selected only active on selected tab (clicking on the x button on a non-selected tab will just select it) Default: inherited from Global attribute tabCloseType (default 1) */ closeType?: ICloseType; /** string identifying which component to render in this tab (used in the layout factory function) Default: undefined */ component?: string; /** a place to hold json config for the hosted component Default: undefined */ config?: any; /** class applied to tab content Default: inherited from Global attribute tabContentClassName (default undefined) */ contentClassName?: string; /** whether the tab can be closed by the user via its close button Default: inherited from Global attribute tabEnableClose (default true) */ enableClose?: boolean; /** whether the user can drag the tab to a new location Default: inherited from Global attribute tabEnableDrag (default true) */ enableDrag?: boolean; /** whether the user can move the tab to a floating window via the context menu Default: inherited from Global attribute tabEnableFloat (default false) */ enableFloat?: boolean; /** whether to show the float icon in the tabset header if this tab enables floating Default: inherited from Global attribute tabEnableFloatIcon (default false) */ enableFloatIcon?: boolean; /** whether the user can pin/unpin the tab via the context menu Default: inherited from Global attribute tabEnablePin (default false) */ enablePin?: boolean; /** enable window popout (in popout capable browser), to show an icon in the tabset header also set the enablePopoutIcon attribute Default: inherited from Global attribute tabEnablePopout (default false) */ enablePopout?: boolean; /** whether to show the popout icon in the tabset header if this tab enables popouts Default: inherited from Global attribute tabEnablePopoutIcon (default false) */ enablePopoutIcon?: boolean; /** if this tab will not work correctly in a popout window when the main window is backgrounded (inactive) then enabling this option will gray out this tab Default: inherited from Global attribute tabEnablePopoutOverlay (default false) */ enablePopoutOverlay?: boolean; /** whether the user can rename the tab by double clicking Default: inherited from Global attribute tabEnableRename (default false) */ enableRename?: boolean; /** whether to avoid rendering component until tab is visible Default: inherited from Global attribute tabEnableRenderOnDemand (default true) */ enableRenderOnDemand?: boolean; /** whether the tab will be hosted in a scrollable container Default: inherited from Global attribute tabEnableScrollbars (default true) */ enableScrollbars?: boolean; /** if enabled the tab will re-mount when popped out/in Default: false */ enableWindowReMount?: boolean; /** help text for the tab to be displayed upon tab hover Default: undefined */ helpText?: string; /** the tab icon Default: inherited from Global attribute tabIcon (default undefined) */ icon?: string; /** the unique id of the tab, if left undefined a uuid will be assigned Default: undefined */ id?: string; /** the maximum height (in px) of this tab Default: inherited from Global attribute tabMaxHeight (default 99999) */ maxHeight?: number; /** the maximum width (in px) of this tab Default: inherited from Global attribute tabMaxWidth (default 99999) */ maxWidth?: number; /** the minimum height (in px) of this tab Default: inherited from Global attribute tabMinHeight (default 1) */ minHeight?: number; /** the minimum width (in px) of this tab Default: inherited from Global attribute tabMinWidth (default 1) */ minWidth?: number; /** name of tab to be displayed in the tab button Default: "[Unnamed Tab]" */ name?: string; /** whether the tab is pinned; pinned tabs are grouped at the start of the tabstrip, cannot be closed via the ui, and cannot be dragged out of their tabset (they can be reordered within the pinned group). Set via Actions.setTabPinned. Only applies to tabs in tabsets (not borders); pinned tabs should be listed first in the json Default: false */ pinned?: boolean; /** the Id of the sub layout to render in this tab, defined in the subLayouts section of the model json (if component is also defined then use the component in the factory to render the sublayout) Default: undefined */ subLayoutId?: string; /** class applied to parent tabset when this is the only tab and it is stretched to fill the tabset Default: undefined */ tabsetClassName?: string; /** Fixed value: "tab" */ type?: string; } export interface IBorderAttributes { /** whether to select new/moved tabs in border when the border is currently closed Default: inherited from Global attribute borderAutoSelectTabWhenClosed (default false) */ autoSelectTabWhenClosed?: boolean; /** whether to select new/moved tabs in border when the border is already open Default: inherited from Global attribute borderAutoSelectTabWhenOpen (default true) */ autoSelectTabWhenOpen?: boolean; /** the border display type: 'split' splits the main layout to make room when a tab is selected; 'overlay' shows the selected tab's panel as an overlay on top of the main layout area, and the tab is deselected by a pointer-down in the main layout area (Visual Studio style auto hide). Set via Actions.setBorderType. Not related to enableAutoHide (which hides the border strip when it has zero tabs) Default: "split" */ borderType?: string; /** class applied to the border container Default: inherited from Global attribute borderClassName (default undefined) */ className?: string; /** a place to hold json config used in your own code Default: undefined */ config?: any; /** hide border if it has zero tabs; not related to the borderType 'overlay' mode (Visual Studio style auto hide), see the borderType attribute Default: inherited from Global attribute borderEnableAutoHide (default false) */ enableAutoHide?: boolean; /** whether tabs can be dropped into this border Default: inherited from Global attribute borderEnableDrop (default true) */ enableDrop?: boolean; /** whether to show a mini scrollbar for the tabs Default: inherited from Global attribute borderEnableTabScrollbar (default false) */ enableTabScrollbar?: boolean; /** the maximum size of the tab area Default: inherited from Global attribute borderMaxSize (default 99999) */ maxSize?: number; /** the minimum size of the tab area Default: inherited from Global attribute borderMinSize (default 1) */ minSize?: number; /** index of selected/visible tab in border; -1 means no tab selected Default: -1 */ selected?: number; /** show/hide this border Default: true */ show?: boolean; /** size of the tab area when selected Default: inherited from Global attribute borderSize (default 200) */ size?: number; /** Fixed value: "border" */ type?: string; } export interface ITabGroupAttributes { /** the color of the group pill and the underline of its tabs (a css color) Default: "#9e9e9e" */ color?: string; /** a place to hold json config used in your own code Default: undefined */ config?: any; /** whether the user can drag the group pill to a new location Default: true */ enableDrag?: boolean; /** the unique id of the group, if left undefined a uuid will be assigned Default: undefined */ id?: string; /** the name of the group shown in its pill Default: "flexlayout.ui.group.default.name" */ name?: string; /** whether the group is expanded to show its tabs; when false only the pill is shown Default: true */ opened?: boolean; /** Fixed value: "tabgroup" */ type?: string; } export interface ISubLayoutAttributes { /** the name of the sub layout, e.g. as shown in the model explorer Default: undefined */ name?: string; }