Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IViewerCard

Card that is used for displaying queue items

Hierarchy

Index

Properties

active

active: 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.

applicationWindow

applicationWindow: IApplicationWindow | undefined

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.

Optional bottomToolbar

bottomToolbar: IToolbar

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

cardError

cardError: ICardError

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

config

The viewer card configuration

Optional defaultHeight

defaultHeight: number

The default height for the card (as rem units)

Optional defaultWidth

defaultWidth: number

The default width for the card (as rem units)

dockSkeletonClassName

dockSkeletonClassName: string

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

Optional element

element: HTMLElement

The root HTML element of the card

enabled

enabled: boolean

Indicates whether the card is enabled.

Optional errorString

errorString: string

A description of any error that occurred while handling the card

Optional frame

frame: HTMLIFrameElement

The HTML element containing the IFrame of the card

hasError

hasError: boolean

true if an error has occurred while handling the card

Optional height

height: number

The current height for the card (as pixels)

id

id: string

The unique identifier from ICardConfig.id

instance

The instance data associated with the viewer card

instanceId

instanceId: string

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

instanceIndex

instanceIndex: number

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

Optional leftToolbar

leftToolbar: IToolbar

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

Optional location

location: 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

maximized: boolean

Indicates whether the card is currently maximized.

minHeight

minHeight: number

The minimum height of the card (as rem units)

minWidth

minWidth: number

The minimum width of the card (as rem units)

order

order: number

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

Optional overlay

overlay: ICard

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

Optional parameters

parameters: any[]

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

poppedOut

poppedOut: boolean

Indicates whether the card is currently popped out.

This flag is used by the experimental popout feature.

experimental

Optional rightToolbar

rightToolbar: IToolbar

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

skeletonVisible

skeletonVisible: boolean

True if the skeleton for this is currently visible

status

status: CardStatus

The state (CardStatus) the card is in

title

title: string

The human-readable card title

Optional toolbars

toolbars: IToolbar[]

The card toolbar controls

Optional topToolbar

topToolbar: IToolbar

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

viewerCollection

viewerCollection: IViewerCollection

The viewer collection the viewer belongs to

Optional viewerToolbar

viewerToolbar: IToolbar

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

viewerType

viewerType: ViewerType

The viewer type identifier (i.e. "native" or "image")

This is used via the navigation API to specifiy which viewer type to load

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.

Optional width

width: number

The current width for the card (as pixels)

window

window: Window | undefined

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

  • 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

    • Optional layout: any

      Reserved for internal use

    Returns void

completeFrameLoad

  • completeFrameLoad(): void
  • Manually resolves the loading of the card for an IFrame or view model card loader.

    Returns void

createBanner

createToolbar

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

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

    Parameters

    Returns void

enable

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

    Returns void

failFrameLoad

  • failFrameLoad(error: 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?: boolean): void
  • Hides card skeleton without delay.

    Parameters

    • Optional 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: ICardLocation, force?: boolean): Promise<boolean>
  • Moves the card to the specified location.

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

    experimental

    Parameters

    • location: ICardLocation

      Location to move the card to

    • Optional 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?: boolean, ...rest: any[]): Promise<boolean>
  • 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.

    experimental

    Parameters

    • Optional force: boolean

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

    • Rest ...rest: any[]

    Returns Promise<boolean>

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

popout

  • popout(...rest: any[]): Promise<boolean>
  • 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.

    experimental

    Parameters

    • Rest ...rest: any[]

    Returns Promise<boolean>

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

reportError

  • reportError(displayString: string, error: ICardError, customProperties?: object): 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.

    • Optional customProperties: object

      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>

setStatus

showOverlay

  • showOverlay(overlay: ICard): 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

    Returns Promise<void>

showSkeleton

  • showSkeleton(immediately?: boolean): void
  • Shows card skeleton without delay.

    Parameters

    • Optional 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

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>