Nutrient Web SDK
    Preparing search index...

    Class FormOption

    A form option is used to identify all possible options for the following form field types:

    The index of the WidgetAnnotation#id in the FormField#annotationIds property is used to find the option for this widget annotation (the index is the same):

    const index = formField.annotationIds.findIndex(id => id === annotation.id);
    const option = formField.options.get(index);
    console.log(option.value);

    Hierarchy

    • Record<{ label: string; value: string }, this> & Readonly<
          { label: string; value: string },
      >
      • FormOption
    Index

    Constructors

    Properties

    label: string = ''
    value: string = ''

    Methods

    • Returns IterableIterator<["value" | "label", string]>

    • Returns this

      Map#asImmutable

    • Returns this

      Map#asMutable

    • Returns a new instance of this Record type with all values set to their default values.

      Returns this

    • Returns a new instance of this Record type with the value for the specific key set to its default value.

      Type Parameters

      • K extends "value" | "label"

      Parameters

      • key: K

      Returns this

      remove

    • Parameters

      Returns this

      removeIn

    • Parameters

      • other: any

      Returns boolean

    • Returns the value associated with the provided key, which may be the default value defined when creating the Record factory function.

      If the requested key is not defined by this Record type, then notSetValue will be returned if provided. Note that this scenario would produce an error when using Flow or TypeScript.

      Type Parameters

      • K extends "value" | "label"

      Parameters

      • key: K
      • OptionalnotSetValue: any

      Returns { label: string; value: string }[K]

    • Type Parameters

      • T

      Parameters

      • key: string
      • notSetValue: T

      Returns T

    • Parameters

      Returns any

    • Parameters

      • key: string

      Returns key is "value" | "label"

    • Returns number

    • Parameters

      Returns boolean

    • Parameters

      • ...collections: (Iterable<[string, any]> | Partial<{ label: string; value: string }>)[]

      Returns this

    • Parameters

      • ...collections: (Iterable<[string, any]> | Partial<{ label: string; value: string }>)[]

      Returns this

    • Parameters

      • keyPath: Iterable<any>
      • ...collections: any[]

      Returns this

    • Parameters

      • merger: (oldVal: any, newVal: any, key: any) => any
      • ...collections: (Iterable<[string, any]> | Partial<{ label: string; value: string }>)[]

      Returns this

    • Parameters

      • keyPath: Iterable<any>
      • ...collections: any[]

      Returns this

    • Parameters

      • merger: (oldVal: any, newVal: any, key: "value" | "label") => any
      • ...collections: (Iterable<[string, any]> | Partial<{ label: string; value: string }>)[]

      Returns this

    • Type Parameters

      • K extends "value" | "label"

      Parameters

      • key: K

      Returns this

    • Parameters

      Returns this

    • Type Parameters

      • K extends "value" | "label"

      Parameters

      • key: K
      • value: { label: string; value: string }[K]

      Returns this

    • Parameters

      Returns this

    • Deeply converts this Record to equivalent native JavaScript Object.

      Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead.

      Returns { label: any; value: any }

    • Shallowly converts this Record to equivalent native JavaScript Object.

      Returns { label: string; value: string }

    • Shallowly converts this Record to equivalent JavaScript Object.

      Returns { label: string; value: string }

    • Returns Keyed<"value" | "label", string>

    • Type Parameters

      • K extends "value" | "label"

      Parameters

      • key: K
      • updater: (
            value: { label: string; value: string }[K],
        ) => { label: string; value: string }[K]

      Returns this

    • Parameters

      • keyPath: Iterable<any>
      • updater: (value: any) => any

      Returns this

    • Returns boolean

      Map#wasAltered

    • Note: Not all methods can be used on a mutable collection or within withMutations! Only set may be used mutatively.

      Parameters

      • mutator: (mutable: this) => any

      Returns this

      Map#withMutations