Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • CmpUtils

Index

Methods

Static getCmpValue

  • getCmpValue<T>(cmpName: string): undefined | T

Static getLogicCmpValue

  • getLogicCmpValue(cmpName: string): undefined | boolean
  • Receive value from a logic component

    Parameters

    • cmpName: string

    Returns undefined | boolean

Static getNumberCmpValue

  • getNumberCmpValue(cmpName: string): undefined | number
  • Receive value from a number component

    Parameters

    • cmpName: string

    Returns undefined | number

Static getRecordCmpKeyValue

  • getRecordCmpKeyValue(cmpName: string): undefined | string | number | boolean
  • Parameters

    • cmpName: string

    Returns undefined | string | number | boolean

    The value of the selected records key column

Static getRecordCmpRecord

  • getRecordCmpRecord(cmpName: string, key: string | number | boolean): undefined | RecordValue
  • Returns the data of a specific record

    Parameters

    • cmpName: string
    • key: string | number | boolean

      The key value of the wanted record

    Returns undefined | RecordValue

    The record (key-value-pair) or undefined if no record with the given key was found

Static getRecordCmpRecords

  • getRecordCmpRecords<T>(cmpName: string): undefined | T
  • Returns the data of all records

    Type parameters

    Parameters

    • cmpName: string

    Returns undefined | T

    All records as key-value-pairs or undefined if the cmp doesn't exist or is no record cmp

Static getRecordCmpValue

  • getRecordCmpValue<T>(cmpName: string): undefined | T
  • Returns the value of an record cmp in form of key-value-pairs instead of an plain array without column names like getCmpValue

    Type parameters

    Parameters

    • cmpName: string

    Returns undefined | T

    Key-value-pairs where key = column name, value = column value.
    Undefined if the given cmp is not found or no record cmp.

Static getRecordColDefs

Static getTextCmpValue

  • getTextCmpValue(cmpName: string): undefined | string
  • Receive value from a text component

    Parameters

    • cmpName: string

    Returns undefined | string

Static getUploadMgr

Static onAnyCmpValueChanged

  • Parameters

    • listener: CmpValuesChangedListener

      Called whenever the value of at least 1 component has changed

    • Optional cmpNames: string[]

      Only call the listener if one of the given cmps have changed

    Returns void

Static onCmpRecordsChanged

  • With this function a listener can be assigned which is executed whenever the data of a record component changes

    Type parameters

    Parameters

    • cmpName: string

      Name of record component for which the listener should be assigned

    • listener: CmpRecordsChangedListener<T>

      Called whenever the records of the given record cmp has changed

    • callImmediately: boolean = false

      True: The listener is immediately called with the current records of the record cmp at the time, the listener is added
      False: The listener will be called for the first time when the records of the cmp actually change

    Returns void

Static onCmpSelectedKeyChanged

  • With this function a listener can be assigned which is executed whenever the selected key of a record component changes

    Type parameters

    Parameters

    • cmpName: string

      Name of record component for which the listener should be assigned

    • listener: CmpRecordKeyChangedListener<T>

      Called whenever the selected key of the given record component has changed

    • callImmediately: boolean = false

      True: The listener is immediately called with the current key and value of the cmp at the time, the listener is added
      False: The listener will be called for the first time when the key of the cmp actually changes

    • Optional condition: CmpRecordKeyChangedCondition<T>

      A predicate function which is given the new cmp key and value.
      The function can decide on whether the listener is called or not by returning true or false.

    Returns void

Static onCmpValueChanged

  • Type parameters

    Parameters

    • cmpName: string
    • listener: CmpValueChangedListener<T>

      Called whenever the value of the given cmp has changed

    • callImmediately: boolean = false

      True: The listener is immediately called with the current value of the cmp at the time, the listener is added
      False: The listener will be called for the first time when the value of the cmp actually changes

    • Optional condition: CmpValueChangedCondition<T>

      A predicate function which is given the new cmp value.
      The function can decide on whether the listener is called or not by returning true or false.

    Returns void

Static registerInterfaceSuite

  • Register a whole 'interface suite' which is generated from a typings-file (*.hive.d.ts) If no options are given, the Interface-Name must match exactly with the Component-Name

    Additional mappings (options.mappings) are registered as given without any modification, only the interface must be part of the same suite

    example
    import MyItfSuite from './runtime-typings/xxxxx.hive.d-ti'
    CmpUtils.registerInterfaceSuite(MyItfSuite, {
      namePostfix: 'Record',
      mappings: { [CmpNames.SecondaryColor]: MyItfSuite.ColorsRecord },
    });
    

    Parameters

    • suite: CmpInterfaceCollection

      Default object from auto-generated file in ./runtime-typings/

    • Optional options: CmpInterfaceSuiteOptions

      Optional properties which allow fine tuning of the internal mapping if component and interface names aren't matching exactly

    Returns void

Static setCmpInput

  • setCmpInput(cmpName: string, value: undefined | string | number | boolean | object | HiveImage | (string | number | boolean)[], defer?: boolean): void
  • Sends the ChangeConfigurationValue request to the server

    Parameters

    • cmpName: string
    • value: undefined | string | number | boolean | object | HiveImage | (string | number | boolean)[]
    • defer: boolean = true

      Defers the actual request after the current execution context.
      All values from subsequent calls to setCmpInput within the same execution context will be sent as 1 batch request if defer = true.

    Returns void

Static setCmpInputs

  • Sends the ChangeConfigurationValue request to the server

    Parameters

    • values: CfgnValue | CfgnValue[]
    • defer: boolean = true

      Defers the actual request after the current execution context.
      All values from subsequent calls to setCmpInputs within the same execution context will be sent as 1 batch request if defer = true.

    Returns void

Static setCmpSelectedKey

  • setCmpSelectedKey(cmpName: string, value: string | number | boolean, defer?: boolean): void
  • Sends the ChangeConfigurationValue request to the server which sets the input for the "Selected key" property for the given component

    Parameters

    • cmpName: string
    • value: string | number | boolean
    • defer: boolean = true

      Defers the actual request after the current execution context.
      All values from subsequent calls to setCmpSelectedKey within the same execution context will be sent as 1 batch request if defer = true.

    Returns void

Static waitCmpValueChanged

  • waitCmpValueChanged(cmpName: string): Promise<undefined | string | number | boolean | object | HiveImage | (string | number | boolean)[]>
  • Signalizes that the value of the dedicated component has been changed.
    This function is typically used with an await instruction => await waitCmpValueChanged(cmpName);.
    Keep in mind that there is no guarantee that this function ever resolves.
    Consider creating your own error handling (eg: abort after timeout) around this function.

    Parameters

    • cmpName: string

    Returns Promise<undefined | string | number | boolean | object | HiveImage | (string | number | boolean)[]>

Generated using TypeDoc