Member Junction
    Preparing search index...

    Implements

    • ControlValueAccessor
    • OnInit
    Index

    Constructors

    Properties

    Control: FormControl

    The reactive FormControl bound to this field. Used for validation state display and dropdown binding.

    Disabled: boolean = false

    Whether this field is disabled

    MarkdownEditing: boolean = false

    Markdown textareas start in preview; the user toggles into the raw editor as needed.

    Question: FormQuestion

    The question definition that drives this field's rendering. Determines the input type, label, validation, options, and layout.

    Value:
        | string
        | number
        | boolean
        | Date
        | Record<string, Date>
        | (string | number | boolean)[]
        | null = null

    Current field value (managed by ControlValueAccessor)

    Accessors

    • get IsMarkdown(): boolean

      Textarea only: whether the value renders as formatted Markdown with an Edit toggle (question.type.markdown === true). Used for rich agent-authored content the human reviews more than types — e.g. the Plan Mode approval form.

      Returns boolean

    • get WidthClass(): string

      CSS class controlling the field width based on widthHint or intelligent defaults.

      Width mapping:

      • 'narrow' (~200px): numbers, dates, times
      • 'medium' (~450px): text inputs (default)
      • 'wide' (100%): emails, buttongroup, radio, checkbox
      • 'full' (100%): textarea
      • 'auto' (150–350px): dropdowns

      Returns string

    Methods

    • A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated.

      Returns void

    • Handle value changes from any input type

      Parameters

      • newValue:
            | string
            | number
            | boolean
            | Date
            | Record<string, Date>
            | (string | number | boolean)[]
            | null

      Returns void

    • Parameters

      • fn: (
            value:
                | string
                | number
                | boolean
                | Date
                | Record<string, Date>
                | (string | number | boolean)[]
                | null,
        ) => void

        The callback function to register

      Returns void

      Registers a callback function that is called when the control's value changes in the UI.

      This method is called by the forms API on initialization to update the form model when values propagate from the view to the model.

      When implementing the registerOnChange method in your own value accessor, save the given function so your class calls it at the appropriate time.

      The following example stores the provided function as an internal method.

      registerOnChange(fn: (_: any) => void): void {
      this._onChange = fn;
      }

      When the value changes in the UI, call the registered function to allow the forms API to update itself:

      host: {
      '(change)': '_onChange($event.target.value)'
      }
    • Parameters

      • fn: () => void

        The callback function to register

      Returns void

      Registers a callback function that is called by the forms API on initialization to update the form model on blur.

      When implementing registerOnTouched in your own value accessor, save the given function so your class calls it when the control should be considered blurred or "touched".

      The following example stores the provided function as an internal method.

      registerOnTouched(fn: any): void {
      this._onTouched = fn;
      }

      On blur (or equivalent), your class should call the registered function to allow the forms API to update itself:

      host: {
      '(blur)': '_onTouched()'
      }
    • Parameters

      • isDisabled: boolean

        The disabled status to set on the element

      Returns void

      Function that is called by the forms API when the control status changes to or from 'DISABLED'. Depending on the status, it enables or disables the appropriate DOM element.

      The following is an example of writing the disabled property to a native DOM element:

      setDisabledState(isDisabled: boolean): void {
      this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
      }
    • Parameters

      • value:
            | string
            | number
            | boolean
            | Date
            | Record<string, Date>
            | (string | number | boolean)[]
            | null

      Returns void

      Writes a new value to the element.

      This method is called by the forms API to write to the view when programmatic changes from model to view are requested.

      The following example writes a value to the native DOM element.

      writeValue(value: any): void {
      this._renderer.setProperty(this._elementRef.nativeElement, 'value', value);
      }