EngageSoftware/elm-engage-common/5.1.1

NOTE: the latest version is 8.2.10

Engage.Custom.Types

Custom.Types

type Answer
= Answer AnswerData
| MultipleAnswer (Set String)
| BoolAnswer Bool
| FileAnswer FileInfo
| MembershipTypeAnswer (Maybe MembershipType)

The Answer type

type alias AnswerData =
{ value : String }

The AnswerData type

type alias BoolEntryData =
{ value : Bool }

The BoolEntryData type

type alias ChangeArgs =
{ formId : Int
, sectionId : Int
, fieldGroupId : Int
, fieldId : Int
, fieldType : FieldType
, domId : String
, onlyStateChange : Bool
}

The ChargeArgs type

type alias Config msg =
{ onChange : ChangeArgs -> Answer -> msg
, onEnter : msg
, dateFormatter : Date -> String
, onGotoPage : { pageId : Int } -> msg
, localization : Localization
, countries : Countries
, regions : RegionsCountry
}

The Config type

type Disable
= None
| Disabled
| Hidden

The Disable type

type Entry
= Entry EntryData
| BoolEntry BoolEntryData
| FileEntry FileEntryData

The Entry type

type alias EntryData =
{ value : String }

The EntryData type

type alias Field =
{ fieldId : Int
, relativeOrder : Int
, label : String
, description : String
, fieldType : FieldType
, required : Bool
, errorMessage : String
, disable : Disable
, valueMin : String
, valueMax : String
, valueStep : String
, updateOptions : UpdateOptions
}

The Field type

type alias FieldChoice =
{ fieldChoiceId : Maybe Int
, name : String
, value : String
, relativeOrder : Int
}

The FieldChoice type

type alias FieldGroup =
{ fieldGroupId : Int
, fields : Dict Int Field
, relativeOrder : Int
}

The FieldGroup type

= TextBox
{ entry : EntryData
, state : State
}
| LargeTextBox
{ entry : EntryData
, state : State
}
| TextArea
{ entry : EntryData
, state : State
}
| CheckBox
{ entry : BoolEntryData
, state : State
}
| DropDown
{ entry : EntryData
, state : State
, fieldChoices : List FieldChoice
}
| RadioList
{ entry : EntryData
, state : State
, fieldChoices : List FieldChoice
}
| CheckBoxList
{ entry : MultipleEntryData
, state : State
, fieldChoices : List FieldChoice
}
| Quantity
{ entry : EntryData
, state : State
}
| Date
{ entry : EntryData
, state : State
}
| Email
| Phone
| ZipCode
| USState
| File
{ entry : FileEntryData
, state : State
}
| Region
{ entry : EntryData
, state : State
}
| Country
{ entry : EntryData
, state : State
}
| Text
| StaticForm StaticFormType

The FieldType type

type alias FileEntryData =
{ name : String
, fileType : String
, status : FileStatus
}

The FileEntryData type

= NoFile
| Uploading { progressPercentage : Float }
| Uploaded
| Error { message : String }

The FileStatus type

type alias FileUploadError =
{ formId : Int
, sectionId : Int
, fieldGroupId : Int
, fieldId : Int
, errorMessage : String
}

The FileUploadError type

type alias FileUploadProgress =
{ formId : Int
, sectionId : Int
, fieldGroupId : Int
, fieldId : Int
, progressPercentage : Float
}

The FileUploadProgress type

type alias FileUploadStatus =
{ formId : Int
, sectionId : Int
, fieldGroupId : Int
, fieldId : Int
, formFilloutId : Int
}

The FileUploadStatus type

type alias Form =
{ formId : Int
, formFilloutId : Maybe Int
, name : String
, sections : Dict Int Section
, formLevel : Level
, relativeOrder : Int
, validations : ValidationErrors { fieldId : Int }
}

The Form type

type Level
= Participant
| Registration
| Company
| Additional

The Level type

type alias MultipleEntryData =
{ values : Set String }

The MultipleEntryData type

type alias Section =
{ sectionId : Int
, name : String
, relativeOrder : Int
, optional : Bool
, optionalLabel : String
, adminOnly : Bool
, fieldGroups : Dict Int FieldGroup
}

The Section type

= ParticipantForm
| MembershipTypeList
{ state : State
, membershipTypeList : List MembershipType
, entry : Maybe MembershipType
}

The StaticFormType type

= AlwaysUpdate
| Update
| DontUpdate

The UpdateOptions type

Get the default Company Form

{ onChange : ChangeArgs -> Answer -> msg
, onEnter : msg
, onGotoPage : { pageId : Int } -> msg
, localization : Localization
}
-> Config msg

Get the default Config

Get the default Participant Form