Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DataField<T> Abstract

Holds the logic common to all data field Model objects.

Type Parameters

  • T

    type of the value property of the data field

Hierarchy

Index

Constructors

  • new DataField<T>(_stringId: string, _title: string, initialValue: T, _behavior: Behavior, _placeholder?: string, _description?: string, _layout?: Layout, validations?: Validation[], _component?: Component, _parentTaskId?: string, _parentCaseId?: string): DataField<T>
  • Type Parameters

    • T

    Parameters

    • _stringId: string

      ID of the data field from backend

    • _title: string

      displayed title of the data field from backend

    • initialValue: T

      initial value of the data field

    • _behavior: Behavior

      data field behavior

    • Optional _placeholder: string

      placeholder displayed in the datafield

    • Optional _description: string

      tooltip of the datafield

    • Optional _layout: Layout

      information regarding the component rendering

    • Optional validations: Validation[]
    • Optional _component: Component

      component data of datafield

    • Optional _parentTaskId: string

      stringId of parent task, only defined if field is loaded using TaskRefField

    • Optional _parentCaseId: string

      stringId of parent case, only defined if field is loaded using TaskRefField

    Returns DataField<T>

Properties

_blockSubscription: Subscription
_componentChange$: Subject<Component>

change of component

_formControlRef: FormControl

Reference to form control

_formControlValueSubscription: Subscription
_initializedSubscription: Subscription

Stores the last subscription to the [_initialized$]{@link AbstractDataField#_initialized$} Stream, to prevent multiple block events from executing at the same time

_input: ElementRef<any>

Reference to rendered element

_localLayout: Layout

Stores a copy of the fields layout, that can be modified by the layouting algorithm as needed without affecting the base configuration.

_myValueSubscription: Subscription
_reverting: boolean = false

Flag that is set during reverting

_sendInvalidValues: boolean = true

Whether invalid field values should be sent to backend.

_touchSubscription: Subscription
_updateSubscription: Subscription
_validators: ValidatorFn[]

Validators resolved from field validations

layoutSubject: BehaviorSubject<Layout>

Listens for layout changes

validations?: Validation[]

Accessors

  • get behavior(): Behavior
  • set behavior(behavior: Behavior): void
  • set block(set: boolean): void
  • get changed(): boolean
  • set changed(set: boolean): void
  • get description(): string
  • set description(desc: string): void
  • get disabled(): boolean
  • get formControlRef(): FormControl
  • set formControlRef(formControl: FormControl): void
  • get initialized(): boolean
  • get initialized$(): Observable<boolean>
  • get input(): ElementRef<any>
  • set input(value: ElementRef<any>): void
  • get parentCaseId(): string
  • get parentTaskId(): string
  • get placeholder(): string
  • set placeholder(placeholder: string): void
  • get previousValue(): T
  • set previousValue(value: T): void
  • get reverting(): boolean
  • set reverting(set: boolean): void
  • get sendInvalidValues(): boolean
  • set sendInvalidValues(value: boolean): void
  • get stringId(): string
  • get title(): string
  • set title(title: string): void
  • set touch(set: boolean): void
  • get touch$(): Observable<boolean>
  • get valid(): boolean
  • set valid(set: boolean): void
  • get validRequired(): boolean
  • set validRequired(set: boolean): void
  • get value(): T
  • set value(value: T): void
  • get waitingForResponse(): boolean
  • set waitingForResponse(value: boolean): void

Methods

  • _determineFormControlValidity(formControl: FormControl): boolean
  • applyChange(change: Change): void
  • calculateValidity(forValidRequired: boolean, formControl: FormControl): boolean
  • clearValidators(): void
  • destroy(): void
  • disconnectFormControl(): void
  • focus(): void
  • getComponentType(): string
  • getTypedComponentType(): string
  • getUpdateOnStrategy(): UpdateOnStrategy
  • isInvalid(formControl: FormControl): boolean
  • registerFormControl(formControl: FormControl): void
  • replaceValidations(validations: Validation[]): void
  • resetLocalLayout(): void
  • resolveFormControlValidators(): ValidatorFn[]
  • Creates Validator objects based on field behavior. Only the required behavior is resolved by default. Required is resolved as Validators.required. If you need to resolve additional Validators or need a different resolution for the required Validator override this method.

    See {@link Behavior} for information about data field behavior.

    See {@link ValidatorFn} and {@link Validators} for information about Validators.

    Alternatively see Form Validation guide from Angular.

    Returns ValidatorFn[]

  • resolvePrevValue(value: T): void
  • resolveValidations(): ValidatorFn[]
  • revertToPreviousValue(): void
  • subscribeToInnerSubjects(formControl: FormControl): void
  • update(): void
  • updateFormControlState(formControl: FormControl): void
  • valueChanges(): Observable<T>
  • valueEquality(a: T, b: T): boolean
  • valueWithoutChange(value: T): void

Generated using TypeDoc