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

View

Extends:

Renderable → View

A renderable that renders a component.

Static Method Summary

Static Public Methods
public static

configure(config: ViewConfig): ConfiguredRenderable<View>

Configures a view.

Constructor Summary

Public Constructor
public

constructor(_container: Renderable, _configuration: ViewConfig, _viewManager: ViewManager, _viewFactory: ViewFactory, _document: Document)

Creates an instance of View.

Member Summary

Public Members
public get

caching: *

public get

height: *

public get

Whether this view in configured to be cacheable.

public get

Whether this view is configured to be lazy.

public get

The 'ref' string this view is configured with.

public get

resolution: ResolverStrategy | null

The resolution strategy this view is configured with.

public

sizeChanges: Observable<{width: number, height: number}>

Notifies when the dimensions of this view changes.

public get

token: any | null

The token this view is using for registration.

public

Notifies when the view container is resolved.

public

Notifies when the visibility of this view changes.

public get

width: *

Method Summary

Public Methods
public

close(args: {silent?: boolean})

Closes this view.

public
public
public

Makes this view visible.

public

Minimizes this view if applicable.

public

render(): *

public

Resolves a views config property.

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: ViewConfig): ConfiguredRenderable<View> source

Configures a view.

Params:

NameTypeAttributeDescription
config ViewConfig

Public Constructors

public constructor(_container: Renderable, _configuration: ViewConfig, _viewManager: ViewManager, _viewFactory: ViewFactory, _document: Document) source

Creates an instance of View.

Override:

Renderable#constructor

Params:

NameTypeAttributeDescription
_container Renderable
_configuration ViewConfig
_viewManager ViewManager
_viewFactory ViewFactory
_document Document

Public Members

public get caching: * source

public get height: * source

This renderables height in pixels.

Override:

Renderable#height

public get isCacheable: boolean | null source

Whether this view in configured to be cacheable.

public get lazy: boolean | null source

Whether this view is configured to be lazy.

public get ref: string | null source

The 'ref' string this view is configured with.

public get resolution: ResolverStrategy | null source

The resolution strategy this view is configured with.

public sizeChanges: Observable<{width: number, height: number}> source

Notifies when the dimensions of this view changes.

public get token: any | null source

The token this view is using for registration.

public viewContainerCreated: Observable<ViewContainer<any>> source

Notifies when the view container is resolved.

public visibilityChanges: Observable<boolean> source

Notifies when the visibility of this view changes.

public get width: * source

This renderables width in pixels.

Override:

Renderable#width

Public Methods

public close(args: {silent?: boolean}) source

Closes this view.

Params:

NameTypeAttributeDescription
args {silent?: boolean}
  • optional
  • default: {}

Emit:

BeforeDestroyEvent

Fired when not silent.

public destroy() source

Destroys this renderable and all it's children.

Override:

Renderable#destroy

public initialize() source

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

Override:

Renderable#initialize

public makeVisible() source

Makes this view visible.

Emit:

MakeVisibileCommand

public minimize() source

Minimizes this view if applicable.

Emit:

MinimizeCommand

public render(): * source

Return:

*

public resolveConfigProperty(path: string): T | null source

Resolves a views config property. Checks the configuration given to the view renderable first then checks the component metadata.

Params:

NameTypeAttributeDescription
path string

Return:

T | null