EngageSoftware / elm-engage-common / Engage.Custom.Types

Custom.Types


type Answer
    = Answer AnswerData
    | MultipleAnswer (Set String)
    | BoolAnswer Basics.Bool
    | FileAnswer Engage.UI.Input.FileInfo
    | MembershipTypeAnswer (Maybe Engage.Form.MembershipTypeList.MembershipType)

The Answer type


type alias AnswerData =
{ value : String }

The AnswerData type


type alias BoolEntryData =
{ value : Basics.Bool }

The BoolEntryData type


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

The ChargeArgs type


type alias Config msg =
{ onChange : ChangeArgs -> Answer -> msg
, onEnter : msg
, dateFormatter : Date -> String
, onGotoPage : { pageId : Basics.Int } -> msg
, localization : Engage.Localization.Localization
, countries : Engage.Entity.Address.Countries
, regions : Engage.Entity.Address.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 : Basics.Int
, relativeOrder : Basics.Int
, label : String
, description : String
, fieldType : FieldType
, required : Basics.Bool
, errorMessage : String
, disable : Disable
, valueMin : String
, valueMax : String
, valueStep : String
, updateOptions : UpdateOptions 
}

The Field type


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

The FieldChoice type


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

The FieldGroup type


type FieldType
    = TextBox ({ entry : EntryData, state : Engage.UI.Input.State })
    | LargeTextBox ({ entry : EntryData, state : Engage.UI.Input.State })
    | TextArea ({ entry : EntryData, state : Engage.UI.Input.State })
    | CheckBox ({ entry : BoolEntryData, state : Engage.UI.Input.State })
    | DropDown ({ entry : EntryData, state : Engage.UI.Dropdown.State, fieldChoices : List FieldChoice })
    | RadioList ({ entry : EntryData, state : Engage.UI.Input.State, fieldChoices : List FieldChoice })
    | CheckBoxList ({ entry : MultipleEntryData, state : Engage.UI.Input.State, fieldChoices : List FieldChoice })
    | Quantity ({ entry : EntryData, state : Engage.UI.Input.State })
    | Date ({ entry : EntryData, state : Engage.UI.Input.State })
    | Email
    | Phone
    | ZipCode
    | USState
    | File ({ entry : FileEntryData, state : Engage.UI.Input.State })
    | Region ({ entry : EntryData, state : Engage.UI.Dropdown.State })
    | Country ({ entry : EntryData, state : Engage.UI.Dropdown.State })
    | Text
    | StaticForm StaticFormType

The FieldType type


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

The FileEntryData type


type FileStatus
    = NoFile
    | Uploading ({ progressPercentage : Basics.Float })
    | Uploaded
    | Error ({ message : String })

The FileStatus type


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

The FileUploadError type


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

The FileUploadProgress type


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

The FileUploadStatus type


type alias Form =
{ formId : Basics.Int
, formFilloutId : Maybe Basics.Int
, name : String
, sections : Dict Basics.Int Section
, formLevel : Level
, relativeOrder : Basics.Int
, validations : Engage.Validation.ValidationErrors { fieldId : Basics.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 : Basics.Int
, name : String
, relativeOrder : Basics.Int
, optional : Basics.Bool
, optionalLabel : String
, adminOnly : Basics.Bool
, fieldGroups : Dict Basics.Int FieldGroup 
}

The Section type


type StaticFormType
    = ParticipantForm
    | MembershipTypeList ({ state : Engage.UI.Accordion.State, membershipTypeList : List Engage.Form.MembershipTypeList.MembershipType, entry : Maybe Engage.Form.MembershipTypeList.MembershipType })

The StaticFormType type


type UpdateOptions
    = AlwaysUpdate
    | Update
    | DontUpdate

The UpdateOptions type

defaultCompanyForm : Form

Get the default Company Form

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

Get the default Config

defaultParticipantForm : Form

Get the default Participant Form