Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "validation"

Index

Functions

Const addNotification

  • addNotification(flowKey: string): void
  • Add an invalid notification populated with the message from the localization.validation.notification setting

    Parameters

    • flowKey: string

    Returns void

Const scrollToInvalidElement

  • scrollToInvalidElement(flowKey: string): void
  • Scroll to the first invalid element based on the selector in the validation.scroll.selector setting. Defaults to .has-error

    Parameters

    • flowKey: string

    Returns void

Const validate

  • Validate the ContentValue or ObjectData for a given models local state. Custom regex validation will be taken from the models validation attribute, and a custom message from the validationMessage attribute

    Parameters

    • model: any

      The model that will be validated

    • state: any

      The matching local state for the model that will be validated

    • flowKey: string

    Returns IValidationResult

Const validateBoolean

  • validateBoolean(value: boolean, message: string, isRequired: boolean, flowKey: string): IValidationResult
  • Validate a boolean

    Parameters

    • value: boolean

      The boolean to validate

    • message: string

      Custom validation message to be returned in an invalid response

    • isRequired: boolean

      Set to true to return an invalid response if the the value false

    • flowKey: string

    Returns IValidationResult

Const validateList

  • validateList(value: object[], message: string, isRequired: boolean, flowKey: string): IValidationResult
  • Only isRequired validation is currently supported for lists

    Parameters

    • value: object[]

      The array to validate

    • message: string

      Custom validation message to be returned in an invalid response

    • isRequired: boolean

      Set to true to return an invalid response if the the value is null or empty

    • flowKey: string

    Returns IValidationResult

Const validateNumber

  • validateNumber(value: any, regex: string, message: string, isRequired: boolean, flowKey: string): IValidationResult
  • Validate a number against a regex and / or null check if required

    Parameters

    • value: any

      The number to validate

    • regex: string

      Regex to validate the number with. toString() will be called on the number first

    • message: string

      Custom validation message to be returned in an invalid response

    • isRequired: boolean

      Set to true to return an invalid response if the the value is null or empty

    • flowKey: string

    Returns IValidationResult

Const validateObject

  • validateObject(value: object, message: string, isRequired: boolean, flowKey: string): IValidationResult
  • Only isRequired validation is currently supported for objects

    Parameters

    • value: object

      The object to validate

    • message: string

      Custom validation message to be returned in an invalid response

    • isRequired: boolean

      Set to true to return an invalid response if the the value is null or empty

    • flowKey: string

    Returns IValidationResult

Const validateString

  • validateString(value: string, regex: string | null, message: string, isRequired: boolean, flowKey: string): IValidationResult
  • Validate a string against a regex and / or null check if required

    Parameters

    • value: string

      The string to validate

    • regex: string | null

      Regex to validate the string with.

    • message: string

      Custom validation message to be returned in an invalid response

    • isRequired: boolean

      Set to true to return an invalid response if the the value is null or empty

    • flowKey: string

    Returns IValidationResult

Generated using TypeDoc