Nutrient Web SDK

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);
Class

Hierarchy

RecordFormOption

Constructors

  • Parameters

    valuesPartial<{ label: string; value: string }>
    Optional

Properties

label

Readonly
string

value

Readonly
string

Immutable Record API

31
string

The name provided to Record(values, name) can be accessed with displayName.

  • Returns

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

    this

    See Also

    • Map#asImmutable

  • Returns

    this

    See Also

    • 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

    Kextends "value" | "label"

    Parameters

    keyK

    Returns

    this
  • Parameters

    keyPathIterable<unknown>

    Returns

    this
  • Parameters

    otherunknown

    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

    Kextends "value" | "label"

    Parameters

    keyK
    notSetValueunknown
    Optional

    Returns

    { label: string; value: string }[K]
  • Type Parameters

    T

    Parameters

    keystring
    notSetValueT

    Returns

  • Parameters

    keyPathIterable<unknown>

    Returns

    unknown
  • Parameters

    keystring

    Returns

    key is "value" | "label"
  • Returns

    number
  • Parameters

    keyPathIterable<unknown>

    Returns

    boolean
  • Parameters

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

    Returns

    this
  • Parameters

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

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    ...collectionsunknown[]

    Returns

    this
  • Parameters

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

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    ...collectionsunknown[]

    Returns

    this
  • Parameters

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

    Returns

    this
  • Type Parameters

    Kextends "value" | "label"

    Parameters

    keyK

    Returns

    this
  • Parameters

    keyPathIterable<unknown>

    Returns

    this
  • Type Parameters

    Kextends "value" | "label"

    Parameters

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

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    valueunknown

    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: string; value: string }
  • 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

    Kextends "value" | "label"

    Parameters

    keyK
    updater(
    value: { label: string; value: string }[K]
    ) => { label: string; value: string }[K]

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    updater(value: unknown) => unknown

    Returns

    this
  • Returns

    boolean

    See Also

    • 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) => unknown

    Returns

    this

    See Also

    • Map#withMutations