text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <base data-ice="baseUrl" href="../../../../">
  <title data-ice="title">ImmutableListOrMapType | formatron</title>
  <link type="text/css" rel="stylesheet" href="css/style.css">
  <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">

<meta name="description" content="A library that generates forms based on JSON schema."><meta property="twitter:card" content="summary"><meta property="twitter:title" content="formatron"><meta property="twitter:description" content="A library that generates forms based on JSON schema.">

  Home

  Reference
  Source

    <input class="search-input">

CImmutableListFilterRef

CImmutableListFindRef

CImmutableListMapRef

CImmutableListRef

CImmutableRef

CImmutableViewRef

CRef

FparseRef

FparseTemplate

FconvertDate

VFormatron

react/componentsCTetheredSelect

renderersCRenderers

CRenderData

CRenderer

VvalueRenderers

typesCType

FparseField

FregisterType

FregisterDataTypes

FregisterViewTypes

VDATA

VVIEW

Vdata

Vview

ToneOrManyParser

types/dataCBoolType

CDateType

CImmutableDictType

CEnumType

CDataType

CImmutableDataType

CImmutableListType

CImmutableListOrMapType

CImmutableMapType

CNumberType

CTextType

CValidationError

VvalidationErrors

types/viewCButtonType

CViewType

FcompareAll

FnumericalDisplay

FtextDisplay

FtruthyDisplay

types/view/dataCCalendarType

CCheckboxType

CCurrencyType

CDropDownType

CDataType

CLinkType

CNumberType

CPercentType

CTableType

CTextType

types/view/displayCGridType

CHeaderType

CDisplayType

CStaticType

CTabsType

types/view/valueCComputedType

CConditionType

CFunctionType

CValueType

CMethodType

CPropertyType

CSwitchType

CTemplateType

CVariableType

import ImmutableListOrMapType from 'formatron/src/types/data/listOrMap.js'

  public
  class

  | source

ImmutableListOrMapType

Extends:

Type → DataType → ImmutableDataType → ImmutableListOrMapType

A data type that can handle a specified type of value, or a list of that
same type of value. Eg, a single / multi file upload data type could be
extended from this type.

Note: This class cannot be parsed into directly, and must be inherited from to use.

Allowed options:

Name
Type
Attribute
Description

multi
boolean

optional

default: false

Specifies whether this data type holds one or multiple values.

TODO:

See if this is really the best method. Possible alternative is just using single / list types.

Static Member Summary

Static Public Members

      public
      static

          typeName: *

Constructor Summary

Public Constructor

      public

          constructor()

Member Summary

Public Members

      public

          itemType: *

      public

          listType: *

      public

          type: *

Method Summary

Public Methods

      public

          getDefaultValue(): *

      public

          getDisplay(model: *, renderOptions: *): *

      public

          getField(refs: *, renderOptions: *): *

      public

          getFieldAndValue(model: *, refs: *, renderOptions: *): *

      public

          getMapDisplay(model: *, renderOptions: *): *

      public

          getValue(model: *, ref: *, renderOptions: *): *

      public

          hasValue(model: *, checkDefault: *): *

      public

          initialize(value: *, renderOptions: *): *

      public

          isMulti(): *

      public

          setValue(model: *, refs: *, newValue: *, renderOptions: *): *

      public

          validate(model: *): *

Inherited Summary

 From class Type

      public
      static

          typeName: *

The type name.

      public
      static

          parse(field: object | Immutable.Map, parseField: function): Type

Parses a JS or Immutable.js object into a type.

      public
      static

          parseOneOrMany(parseField: func): oneOrManyParser

Creates a one or many parser with the passed in field parser.

      public
      static

          parseOptions(field: Immutable.Map, parseField: function): Immutable.Map

Override this function if you want the type to reference other types.

 From class DataType

      public
      static

          typeName: *

The data type name.

      public
      static

          parse(field: *, parseField: *): *

      public

          name: *

      public

          options: *

      public

          exclude(model: *, deep: boolean): *

      public

          filter(filterValue: *, rowValue: *): *

      public

          getDefaultValue(defaultValue: undefined): *

      public

          getDisplay(value: *): string

Returns the value parsed for human consumption.

      public

          getField(ref: *): *

      public

          getFieldAndValue(value: *, ref: *): {"field": *, "value": *}

      public

          getName(): *

      public

          getOptions(): *

      public

          getValidationLinks(): *

      public

          getValidator(): *

      public

          getValue(value: *, defaultValue: *): *

Returns a parsed value.

      public

          hasValue(value: object, checkDefault: boolean): boolean

Checks if the passed in value is "not empty".

      public

          isExcluded(): *

      public

          isGenerated(): *

      public

          isRequired(): *

      public

          isUnique(): *

      public

          validate(value: *, callback: *): *

Validates that the given value follows the rules of the data type.

 From class ImmutableDataType

      public
      static

          typeName: *

      public

          getField(ref: *, renderOptions: *)

      public

          getFieldAndValue(value: *, ref: *, renderOptions: *)

      public

          getNextField(field: *, refs: *, renderOptions: *): *

      public

          getNextFieldAndValue(field: *, value: *, refs: *, renderOptions: *): *

      public

          getValue(value: *, ref: *, renderOptions: *): *

      public

          hasValue(value: *, checkDefault: *): *

      public

          setNextValue(field: *, oldValue: *, newValue: *, refs: *, renderOptions: *): *

      public

          setValue(value: *, ref: *, newValue: *)

Static Public Members

    public
    static

    typeName: *

      source

The data type name. This must be overridden.

Override:
ImmutableDataType#typeName

Public Constructors

    public

    constructor()

      source

Creates a new instance of a data type.

Override:
DataType#constructor

Public Members

    public

    itemType: *

      source

    public

    listType: *

      source

    public

    type: *

      source

Public Methods

    public

    getDefaultValue(): *

      source

Override:
DataType#getDefaultValue

Return:

          *

    public

    getDisplay(model: *, renderOptions: *): *

      source

Returns the value parsed for human consumption.

Override:
DataType#getDisplay

Params:

Name	Type	Attribute	Description

      model
      *

      renderOptions
      *

Return:

          *

    public

    getField(refs: *, renderOptions: *): *

      source

Override:
ImmutableDataType#getField

Params:

Name	Type	Attribute	Description

      refs
      *

      renderOptions
      *

Return:

          *

    public

    getFieldAndValue(model: *, refs: *, renderOptions: *): *

      source

Override:
ImmutableDataType#getFieldAndValue

Params:

Name	Type	Attribute	Description

      model
      *

      refs
      *

      renderOptions
      *

Return:

          *

    public

    getMapDisplay(model: *, renderOptions: *): *

      source

Params:

Name	Type	Attribute	Description

      model
      *

      renderOptions
      *

Return:

          *

    public

    getValue(model: *, ref: *, renderOptions: *): *

      source

Returns a parsed value. A value of undefined implies that the value is
missing and should be filled in by a default value, first supplied in the
options, and if not, the one supplied by the type.

Override:
ImmutableDataType#getValue

Params:

Name	Type	Attribute	Description

      model
      *

      ref
      *

      renderOptions
      *

Return:

          *

    public

    hasValue(model: *, checkDefault: *): *

      source

Checks if the passed in value is "not empty".

Override:
ImmutableDataType#hasValue

Params:

Name	Type	Attribute	Description

      model
      *

      checkDefault
      *

Return:

          *

    public

    initialize(value: *, renderOptions: *): *

      source

Params:

Name	Type	Attribute	Description

      value
      *

      renderOptions
      *

Return:

          *

    public

    isMulti(): *

      source

Return:

          *

    public

    setValue(model: *, refs: *, newValue: *, renderOptions: *): *

      source

Override:
ImmutableDataType#setValue

Params:

Name	Type	Attribute	Description

      model
      *

      refs
      *

      newValue
      *

      renderOptions
      *

Return:

          *

    public

    validate(model: *): *

      source

Validates that the given value follows the rules of the data type.

Override:
DataType#validate

Params:

Name	Type	Attribute	Description

      model
      *

Return:

          *

  Generated by ESDoc(1.1.0)


text:
<?php
class TechTree_Exception extends Exception
{
}

redpajama_set_name: RedPajamaGithub