Home Manual Reference Source Repository
import {Stack} from 'ug-layout/stack/Stack'
public class | source

Stack

Extends:

Renderable → Stack

A Renderable that renders the Renderable items in a tabbable format.

Static Method Summary

Static Public Methods
public static

configure(config: *): *

Constructor Summary

Public Constructor
public

constructor(_config: StackConfigArgs, _container: Renderable)

Creates an instance of Stack.

Member Summary

Public Members
public get

The active content item index.

public get

direction: XYDirection

The direction of the stack.

public get

The header associated with this stack.

public get

height: *

public get

Whether this stack is considered closable.

public get

Whether the stack is horizontal.

public get

Whether the stack is reversed

public get

Gets the content items.

public get

width: *

Method Summary

Public Methods
public

addChild(item: Renderable, options: AddChildArgs)

Adds a child renderable.

public

addControl(control: RenderableArg<StackControl>)

Adds a header control to this stack.

public

close(): void

Closes the stack if all items are closeable.

public

Creates a child StackItemContainer.

public
public
public

Gets the index of a tab.

public

Gets a tab at a specified index.

public

handleItemDrop(region: StackRegion, item: Renderable)

Handles a renderable being dropped on the stack within a certain region.

public
public

Determines whether an item is the action item container.

public

Determines whether a tab is the active tab.

public

Removes an item a specified index.

public

Removes a child item along with the tab associated with.

public

render(): *

public

Sets the given container as the active item.

public

Sets the active item at a specific index.

public

Sets the active item from the given tab.

Inherited Summary

From class Renderable
public get

This renderables container or null if none.

public get
public get

This renderables height in pixels.

public get

The injector used to create this renderable.

public get

Whether this renderable is destroyed.

public get

The amount of content items belonging to this renderable.

public get

This renderables page offset x.

public get

This renderables page offset y.

public get

A unique identifier for this renderable.

public get

This renderables width in pixels.

public
public
public

tags: *

public

addChild(item: Renderable, options: AddChildArgs)

Adds a child item to this renderable.

public

Whether a renderable is a descendant of this renderable.

public

createChild(renderable: RenderableArg<T>, providers: ProviderArg[]): T

Creates a child renderable using this renderable as it's container.

public

destroy(): void

Destroys this renderable and all it's children.

public

emit(event: T)

Emits a BusEvent on this renderable.

public

emitDown(event: T)

Emits a BusEvent down to all descendants recursively.

public

emitUp(event: T)

Emits a BusEvent up to all parents recursively.

public

Gets the renderable area of this renderable.

public

Gets a content renderable at an index.

public

Returns this renderables children renderables.

public

Gets all descendants of this renderable recursively.

public

Gets the index of a content renderable.

public

getParent(Ctor: Type<T>): T | null

Gets this renderables parent or any parent that is an instance of the passed in constructor.

public

getParents(Ctor: Type<T>): T | null

Gets this renderables parents or any parents that are an instance of the passed in constructor.

public

Handles any cleanup from a drop.

public

Invoked when the Injector has been assigned and ready for use.

public

Whether this renderable is a descendant of another renderable.

public

Whether this renderable can be dropped on.

public

Determines whether this renderable is visible.

public

remove()

Removes this item from it's parent. If there is no parent then this renderable will just be destroyed.

public

Removes a content item from this renderable.

public

replaceChild(item: Renderable, withItem: Renderable, options: RemoveChildArgs)

Replaces a content item on this renderable with another content item.

public

resize()

Sets this components size and triggers it's childrens sizing.

public

scope(Event: Type<T>): Observable<T>

Creates an Observable scoped to a specific event type.

public

setContainer(container: Renderable | null)

Sets the container of this renderable.

public

subscribe(Event: Type<T>, observer: PartialObserver<T> | function(event: T)): Subscription

Subscribes to a BusEvent.

Static Public Methods

public static configure(config: *): * source

Params:

NameTypeAttributeDescription
config *

Return:

*

Public Constructors

public constructor(_config: StackConfigArgs, _container: Renderable) source

Creates an instance of Stack.

Override:

Renderable#constructor

Params:

NameTypeAttributeDescription
_config StackConfigArgs
_container Renderable

Public Members

public get activeIndex: number source

The active content item index.

public get direction: XYDirection source

The direction of the stack.

public get header: StackHeader source

The header associated with this stack.

public get height: * source

This renderables height in pixels.

Override:

Renderable#height

public get isCloseable: boolean source

Whether this stack is considered closable.

public get isHorizontal: boolean source

Whether the stack is horizontal.

public get isReversed: boolean source

Whether the stack is reversed

public get items: StackItemContainer[] source

Gets the content items.

public get width: * source

This renderables width in pixels.

Override:

Renderable#width

Public Methods

public addChild(item: Renderable, options: AddChildArgs) source

Adds a child renderable. If the renderable being added is not a StackItemContainer then one is created and the item is wrapped in it.

Override:

Renderable#addChild

Params:

NameTypeAttributeDescription
item Renderable
options AddChildArgs
  • optional
  • default: {}

public addControl(control: RenderableArg<StackControl>) source

Adds a header control to this stack.

Params:

NameTypeAttributeDescription
control RenderableArg<StackControl>

public close(): void source

Closes the stack if all items are closeable.

Return:

void

Emit:

BeforeDestroyEvent

Event that can prevent this action.

public createChildItem(config: StackItemContainerConfig): StackItemContainer source

Creates a child StackItemContainer.

Params:

NameTypeAttributeDescription
config StackItemContainerConfig

public destroy() source

Destroys this renderable and all it's children.

Override:

Renderable#destroy

public getChildren(): undefined[] source

Returns this renderables children renderables. This differs from content items as children should contain all renderables we want as part of the render cycle.

Override:

Renderable#getChildren

Return:

undefined[]

public getIndexOfTab(tab: StackTab): number source

Gets the index of a tab.

Params:

NameTypeAttributeDescription
tab StackTab

Return:

number

public getTabAtIndex(index: number): StackTab | null source

Gets a tab at a specified index.

Params:

NameTypeAttributeDescription
index number

Return:

StackTab | null

public handleItemDrop(region: StackRegion, item: Renderable) source

Handles a renderable being dropped on the stack within a certain region.

Params:

NameTypeAttributeDescription
region StackRegion

The region the item was dropped in.

item Renderable

The item being dropped.

public initialize() source

Invoked when the Injector has been assigned and ready for use.

Override:

Renderable#initialize

Listen:

TabCloseEvent

TabSelectionEvent

TabDragEvent

public isActiveContainer(container: StackItemContainer): boolean source

Determines whether an item is the action item container.

Params:

NameTypeAttributeDescription
container StackItemContainer

Return:

boolean

public isActiveTab(tab: StackTab): boolean source

Determines whether a tab is the active tab.

Params:

NameTypeAttributeDescription
tab StackTab

Return:

boolean

public removeAtIndex(index: number, options: RemoveChildArgs) source

Removes an item a specified index.

Params:

NameTypeAttributeDescription
index number
options RemoveChildArgs
  • optional
  • default: {}

public removeChild(item: StackItemContainer, options: RemoveChildArgs): void source

Removes a child item along with the tab associated with.

Override:

Renderable#removeChild

Params:

NameTypeAttributeDescription
item StackItemContainer
options RemoveChildArgs
  • optional
  • default: {}

Return:

void

public render(): * source

Return:

*

public setActiveContainer(container: StackItemContainer) source

Sets the given container as the active item.

Params:

NameTypeAttributeDescription
container StackItemContainer

public setActiveIndex(index: number, args: BaseModificationArgs) source

Sets the active item at a specific index.

Params:

NameTypeAttributeDescription
index number
  • optional
args BaseModificationArgs
  • optional
  • default: {}

public setActiveTab(tab: StackTab) source

Sets the active item from the given tab.

Params:

NameTypeAttributeDescription
tab StackTab