Base class for all widgets, providing common functionality

Hierarchy (view full)

Constructors

Properties

config: OfcpConfig
el: HTMLElement
iframe: HTMLIFrameElement = null

The iframe element

uiPath: string = 'iframe'

The path to the iframe which will be appended to the uiBaseURL to get the full URL

Methods

  • Gets the iframe element

    Returns HTMLIFrameElement

    The iframe element or null if it doesn't exist currently

  • Returns whether the widget is open or not

    Returns boolean

    True if the widget is open, false otherwise

  • Lifecycle hooks for extending classes

    Parameters

    • event: MessageEvent<any>

      The message event

    Returns Promise<boolean>

    Promise Whether the message was handled

    BaseWidget.onMessage

  • Sends a message to the iframe

    Parameters

    • message: Message

      The message to send

    Returns void

    void