Options
All
  • Public
  • Public/Protected
  • All
Menu

Selective Validation Rules

Hierarchy

  • RuleComponent

Implemented by

Index

Properties

isRequired

isRequired: boolean

Does the rule make the value required?

The UI needs to be able to mark fields that are required without needing to show the entire error state.

If a validation rule makes it required, this allows the UI to flag the field for the user without a full error display.

level

level: ValidationLevel

Validation level used if the validation fails.

Methods

allowAdd

  • allowAdd(value: any): boolean
  • Given the value, should it be able to add new values?

    Used when dealing with a list to control if the user can add more items.

    Parameters

    • value: any

      Current value of the field.

    Returns boolean

allowRemove

  • allowRemove(value: any): boolean
  • Given the value, should it be able to remove new values?

    Used when dealing with a list to control if the user can remove more items.

    Parameters

    • value: any

      Current value of the field.

    Returns boolean

validate

  • validate(value: any): null | string
  • Validates the field using the current value.

    If there is an error with the validation, return an error message string to be displayed to the user.

    Parameters

    • value: any

      Current value of the field.

    Returns null | string

Generated using TypeDoc