Interface: ICard

Card instance

Extended by

Properties

active

readonlyactive: boolean

Indicates whether the card is currently active. Cards in a dock will be active when the associated tab is active. Cards in a frame are always active.


activeFlag

activeFlag: boolean

Indicates whether card is currently active or not


applicationWindow

readonlyapplicationWindow: IApplicationWindow

Reference to the application window the card is currently in

Cards can be moved to layouts in various different browser windows, but the code defined in the card callback methods will often be executing in the context of the IWindowService.main window. This property should be used to determine which window the card is currently in. This is especially important when performing actions such as querying the DOM. Note that when a card has not been placed in a layout, the card framework cannot know which window it will be added to. In these situations, this property will be undefined.


autoRestore

readonlyautoRestore: boolean

Indicates whether card is set to auto restore or not


bottomToolbar?

readonlyoptionalbottomToolbar: IToolbar

The card's bottom toolbar, if it has one.


cardError

readonlycardError: ICardError

The card error of any error that occurred while handling the card


config

readonlyconfig: IReadonlyCardConfig

The card configuration


defaultHeight?

readonlyoptionaldefaultHeight: number

The default height for the card (as rem units)


defaultWidth?

readonlyoptionaldefaultWidth: number

The default width for the card (as rem units)


dockSkeletonClassName

readonlydockSkeletonClassName: string

Class name to be used to apply to the skeleton to the cards in this dock.


element?

readonlyoptionalelement: HTMLElement

The root HTML element of the card


enabled

readonlyenabled: boolean

Indicates whether the card is enabled.


errorString?

readonlyoptionalerrorString: string

A description of any error that occurred while handling the card


frame?

readonlyoptionalframe: HTMLIFrameElement

The HTML element containing the IFrame of the card


hasError

readonlyhasError: boolean

true if an error has occurred while handling the card


height?

readonlyoptionalheight: number

The current height for the card (as pixels)


icon

readonlyicon: IReadonlyCardIcon


id

readonlyid: string

The unique identifier from ICardConfig.id (must not be shared by any default or custom card)


instance?

readonlyoptionalinstance: ICardInstance

The instance data associated with the card


instanceId

readonlyinstanceId: string

A unique id for this card instance (combination of ICard.id and ICard.instance)


instanceIndex

readonlyinstanceIndex: number

The instance number of the card (generally 0 unless there are multiple instances of the same card)


leftToolbar?

readonlyoptionalleftToolbar: IToolbar

The card's left toolbar, if it has one.


loadDeferred

readonlyloadDeferred: Promise<void>

returned deferred to determine if the card has loaded


location?

readonlyoptionallocation: ICardLocation

Current location of the card. If the card has not been placed in a location yet, or has been removed from its location, this is undefined.


maximized

readonlymaximized: boolean

Indicates whether the card is currently maximized.


minHeight

readonlyminHeight: number

The minimum height of the card (as rem units)


minWidth

readonlyminWidth: number

The minimum width of the card (as rem units)


order

readonlyorder: number

The index to use when sorting the tabs for the cards in a dock.


overlay?

readonlyoptionaloverlay: ICard

The overlay card if showOverlay() was called, or undefined if no overlay is set.


parameters?

readonlyoptionalparameters: any[]

Additional parameters attached to the card during creation. The interpretation of these parameters is dependent on the card type.


popoutInProgress

popoutInProgress: boolean


poppedIn

readonlypoppedIn: boolean

Experimental

Indicates whether the card is currently popped in.

This flag is used by the experimental popout feature.


poppedOut

readonlypoppedOut: boolean

Experimental

Indicates whether the card is currently popped out.

This flag is used by the experimental popout feature.


rightToolbar?

readonlyoptionalrightToolbar: IToolbar

The card's right toolbar, if it has one.


skeletonVisible

readonlyskeletonVisible: boolean

True if the skeleton for this is currently visible


status

readonlystatus: CardStatus

The state (CardStatus) the card is in


title

readonlytitle: string

The human-readable card title


toolbars?

readonlyoptionaltoolbars: IToolbar[]

The card toolbar controls


topToolbar?

readonlyoptionaltopToolbar: IToolbar

The card's top toolbar, if it has one.


visible

visible: boolean

Controls whether the card is visible. Setting this property to false will hide the card, setting it to true will show the card. Hiding a card can result in other panes being hidden as well, e.g. hiding a card when it is the only card in the dock will result in the dock being hidden as well. Cards are visible by default.


width?

readonlyoptionalwidth: number

The current width for the card (as pixels)


window

readonlywindow: Window

Reference to the browser window the card is currently in

This property is the same as ICard.applicationWindow.window.

Methods

activate()

activate(): Promise<boolean>

Activate the card if it is in a dock. This results in the card content being displayed in the dock body. If the card is still in the process of loading, a skeleton will be displayed until the load completes. If the card is not in a dock, this method has no effect.

Returns

Promise<boolean>


bindInstance()

bindInstance(instance, layout?): void

Binds an ICardInstance to the card. Alternately, the ICardConfig.createInstance() function may be specified to have an ICardInstance created automatically for each card instance.

Parameters

instance: ICardInstance

The ICardInstance to bind to the card

layout?: any

Reserved for internal use

Returns

void


canDeactivate()

canDeactivate(): boolean

Check if card is currently able to be deactivated

Returns

boolean


completeFrameLoad()

completeFrameLoad(): void

Manually resolves the loading of the card for an IFrame or view model card loader.

Returns

void


createBanner()

createBanner(message, config?): IMessageCardBanner

Creates a message banner that will display within the card

Parameters

message: string

Banner message

config?: IMessageCardBannerConfig

Optional banner configuration

Returns

IMessageCardBanner


createHtmlBanner()

createHtmlBanner(contentHTML, config?): IHtmlCardBanner

Creates a custom HTML banner that will display within the card

Parameters

contentHTML: string

Custom HTML content of the banner

config?: IHtmlCardBannerConfig

Optional banner configuration

Returns

IHtmlCardBanner


createToolbar()

createToolbar(config): IToolbar

Creates a toolbar in the card. Toolbars may also be created via the ICardConfig.toolbarsConfig property.

Parameters

config: ICardToolbarConfig

Returns

IToolbar


deactivate()

deactivate(): Promise<boolean>

Deactivate the card if it is in a dock. This results in the card content being hidden. If the card is not in a dock, this method has no effect.

Returns

Promise<boolean>


disable()

disable(): void

Disables the card. When cards are disabled, they are automatically deactivated and the associated dock toolbar button (if any) is disabled, preventing activation.

Returns

void


dismissBanner()

dismissBanner(banner): void

Dismisses a banner and removes it from the card. Equivalent to calling ICardBanner.dismiss().

Parameters

banner: ICardBanner

Returns

void


dismissBannerByClass()

dismissBannerByClass(bannerClass): void

Method to dismiss the banner by class

Parameters

bannerClass: string

Returns

void


enable()

enable(): void

Enables the card if it has been disabled by a call to ICard.disable().

Returns

void


failFrameLoad()

failFrameLoad(error): void

Manually fails the loading of the card for an IFrame or view model card loader.

Parameters

error: Error

Error to pass to reject

Returns

void


hideOverlay()

hideOverlay(): Promise<void>

Hides any overlay that was shown via a call to showOverlay()

Returns

Promise<void>


hideSkeleton()

hideSkeleton(immediately?): void

Hides card skeleton without delay.

Parameters

immediately?: boolean

Returns

void


load()

load(): Promise<void>

Loads the card if it is not already loaded. Note that it is normally not necessary to call this method because cards are loaded automatically when they activated in the UI. Manual loads may be useful in certain circumstances, for instance if the loading process is lengthy.

Returns

Promise<void>


maximize()

maximize(): Promise<void>

Moves the card to cover the whole viewport.

Returns

Promise<void>


move()

move(location, force?): Promise<boolean>

Experimental

Moves the card to the specified location.

This is an experimental API. The application may not function properly when invoking this API.

Parameters

location: ICardLocation

Location to move the card to

force?: boolean

Optional boolean indicating whether or not the card should be forecefully moved, bypassing the standard cardCanDeactivate() checks. Defaults to false.

Returns

Promise<boolean>

Promise that resolves to a boolean indicating if the card was successfully moved


popin()

popin(force?, ...rest?): Promise<boolean>

Experimental

Docks the card and returns it to its original location after being popped out.

This is an experimental API. The application may not function properly when invoking this API.

Parameters

force?: boolean

Optional boolean indicating whether or not the card should be forcefully popped in, bypassing the standard cardCanDeactivate() checks. Defaults to false.

• ...rest?: any[]

Returns

Promise<boolean>

Promise that resolves to a boolean indicating whether or not the card could be popped out.


popout()

popout(...rest): Promise<boolean>

Experimental

Undocks the card and moves it to a new popout window.

This is an experimental API. The application may not function properly when invoking this API.

Parameters

• ...rest: any[]

Returns

Promise<boolean>

Promise that resolves to a boolean indicating whether or not the card could be popped out.


remove()

remove(): void

Removes the card from its current dock.

Returns

void


reportError()

reportError(displayString, error, customProperties?): void

Report that the card is in error state. This will display the passed in error message on the card if ICardError.isFatal is true and log it.

Parameters

displayString: string

Message to be displayed on the card.

error: ICardError

The ICardError instance containing information about the error.

customProperties?

Any other additional data related to the error.

Returns

void


restore()

restore(): Promise<void>

Un-maximizes the card so that it shows in its location instead over the whole viewport.

Returns

Promise<void>


resumeMinHeight()

resumeMinHeight(): void

Resumes the min height of the card

Returns

void


setActiveFlag()

setActiveFlag(flag): Promise<void>

Sets activeFlag to given value, if possible

Parameters

flag: boolean

Returns

Promise<void>


setStatus()

setStatus(status): void

Set the card's status to one of the CardStatus values.

Parameters

status: CardStatus

Returns

void


showOverlay()

showOverlay(overlay): Promise<void>

Temporarily replaces the card contents with another card, for instance to display an error message. Only the overlay contents are used - other properties from the overlay card, such as the title and minimum size are ignored.

Parameters

overlay: ICard

Returns

Promise<void>


showSkeleton()

showSkeleton(immediately?): void

Shows card skeleton without delay.

Parameters

immediately?: boolean

Returns

void


stateChanged()

stateChanged(): void

Called to notify the card system that the card's internal state (the data returned by ICardInstance.cardSaveState) has changed.

Returns

void


suspendMinHeight()

suspendMinHeight(): void

Temporarily suspends the min height of the card

Returns

void


unload()

unload(): Promise<void>

Unloads the card. Normally it is not necessary to call this method but it may be useful if the card is no longer needed.

Returns

Promise<void>


updateLayout()

updateLayout(): void

Called to notifiy the card system to update the layout.

Returns

void


waitForDetachment()

waitForDetachment(): Promise<void>

Wait for the card to be detached

Returns

Promise<void>