Class Specification

Encapsulates a DriveWorks Live Specification and enables the rendering and control of that specification via custom elements and callbacks.

Hierarchy

  • Specification

Index

Constructors

constructor

  • Creates a new Specification and registers all required delegates for rendering a fully interactive specification form.

    Parameters

    • client: DriveWorksLiveClient

      The DriveWorksLiveClient that will be used to send and receive data to and from the Integration Theme.

    • groupAlias: string

      The alias of the group the specification belongs to.

    • specificationId: string

      The unique identifier of this specification.

    Returns Specification

Accessors

id

  • get id(): number
  • Gets the unique identifier of the represented specification.

    Returns number

specificationFormElement

  • get specificationFormElement(): HTMLElement
  • Gets the HTML element for the specification form.

    Returns HTMLElement

Methods

cancel

  • cancel(): Promise<void>
  • Cancels the current specification and clears the the inner HTML of the provided HTMLElement that the specification was rendered to.

    Returns Promise<void>

getFormControlByName

  • getFormControlByName(controlName: string): ControlBase
  • Gets a form control of a supplied name.

    Parameters

    • controlName: string

      The name of the control you wish to access.

    Returns ControlBase

ping

  • ping(): void
  • Sends a signal to the server to restart the session, specification and group timeout timers.

    Returns void

registerCancelButton

  • registerCancelButton(element: HTMLElement, displayStyle?: string | null): void
  • Registers a chosen HTML element that when clicked will cancel the active dialog.

    Parameters

    • element: HTMLElement

      The element that will be registered as the cancel button.

    • Default value displayStyle: string | null = window.getComputedStyle(element).display

      The value to set the display property to when making the cancel button visible. By default the current value of the display property will be used.

    Returns void

registerConstantValueChangedDelegate

  • registerConstantValueChangedDelegate(constantValueChangedDelegate: function): void
  • Registers a function to execute when a project constant's value is changed.

    Parameters

    • constantValueChangedDelegate: function

      The function to be executed when a project constant's value is changed.

        • (data: object): void
        • Parameters

          • data: object
            • constantName: string
            • constantValue: string

          Returns void

    Returns void

registerNextButton

  • registerNextButton(element: HTMLElement, displayStyle?: string | null): void
  • Registers a chosen HTML element that when clicked will navigate the specification to the next form.

    Parameters

    • element: HTMLElement

      The element that will be registered as the next button.

    • Default value displayStyle: string | null = window.getComputedStyle(element).display

      The value to set the display property to when making the next button visible. By default the current value of the display property will be used.

    Returns void

registerOkButton

  • registerOkButton(element: HTMLElement, displayStyle?: string | null): void
  • Registers a chosen HTML element that when clicked will confirm and close the active dialog.

    Parameters

    • element: HTMLElement

      The element that will be registered as the confirmation button.

    • Default value displayStyle: string | null = window.getComputedStyle(element).display

      The value to set the display property to when making the ok button visible. By default the current value of the display property will be used.

    Returns void

registerPreviousButton

  • registerPreviousButton(element: HTMLElement, displayStyle?: string | null): void
  • Registers a chosen HTML element that when clicked will navigate the specification to the previous form.

    Parameters

    • element: HTMLElement

      The element that will be registered as the previous button.

    • Default value displayStyle: string | null = window.getComputedStyle(element).display

      The value to set the display property to when making the previous button visible. By default the current value of the display property will be used.

    Returns void

registerSpecificationCancelledDelegate

  • registerSpecificationCancelledDelegate(cancelledDelegate: function): void
  • Registers a function to execute when the specification is cancelled.

    Parameters

    • cancelledDelegate: function

      The function to be executed when the specification is cancelled.

        • (): void
        • Returns void

    Returns void

registerSpecificationClosedDelegate

  • registerSpecificationClosedDelegate(closedDelegate: function): void
  • Registers a function to execute when the specification is closed.

    Parameters

    • closedDelegate: function

      The function to be executed when the specification is closed.

        • (): void
        • Returns void

    Returns void

registerVariableValueChangedDelegate

  • registerVariableValueChangedDelegate(variableValueChangedDelegate: function): void
  • Registers a function to execute when a project variable's value is changed.

    Parameters

    • variableValueChangedDelegate: function

      The function to be executed when a project variable's value is changed.

        • (data: object): void
        • Parameters

          • data: object
            • variableName: string
            • variableValue: string

          Returns void

    Returns void

render

  • render(element: HTMLElement): Promise<void>
  • Renders the specification's active form to the supplied HTML element.

    Parameters

    • element: HTMLElement

      The element that you wish to render the specification form to.

    Returns Promise<void>