EngageSoftware / elm-engage-common / Engage.Form.Contact

Form.Contact


type alias Attribute =
InternalAttribute -> InternalAttribute

The Attribute type


type Msg field

The Msg type


type State parentField

The State type


type ValidationField
    = Prefix
    | FirstName
    | MiddleName
    | LastName
    | Suffix
    | Email
    | AddressName
    | Address1
    | Address2
    | Country
    | Region
    | PostalCode
    | City
    | ContactType
    | Phone
    | PhoneIsoCode
    | MobilePhone
    | MobilePhoneIsoCode
    | Fax
    | FaxIsoCode
    | Notes
    | IsPrimaryContact
    | IsBillingContact

The ValidationField type

completedView : Engage.Namespace.Namespace -> Engage.Localization.Localization -> Engage.Entity.Contact.Contact -> Html msg

Get the completed view

completedViewWithAdditional : Engage.Namespace.Namespace -> Engage.Localization.Localization -> List String -> Engage.Entity.Contact.Contact -> Html msg

Get the completed view with additional data

contactTypes : Engage.Entity.Contact.ContactTypes -> Attribute

Get the contact types Attribute

countries : Engage.Entity.Address.Countries -> Attribute

Get the countries Attribute

countriesToItems : Engage.Entity.Address.Countries -> Dict String Engage.UI.Dropdown.Item

Convert Countries to an dropdown

form : Engage.Namespace.Namespace -> Engage.Localization.Localization -> (ValidationField -> parentField) -> String -> List Attribute -> State parentField -> Engage.Entity.Contact.Contact -> Html (Msg parentField)

Get the form view

initialState : State parentField

Get the initial state

isEmpty : Engage.Entity.Contact.Contact -> Basics.Bool

Check if the Contact is empty

isValid : State parentField -> Basics.Bool

Check if the State is valid

regions : Engage.Entity.Address.RegionsCountry -> Attribute

Get the regions Attribute

regionsToItems : Engage.Entity.Address.Regions -> Dict String Engage.UI.Dropdown.Item

Convert Regions to an dropdown

required : Basics.Bool -> Attribute

Get the required Attribute

update : Msg parentField -> State parentField -> Engage.Entity.Contact.Contact -> ( State parentField, Engage.Entity.Contact.Contact, Platform.Cmd.Cmd (Msg parentField) )

Update the Contact

validateAll : (ValidationField -> parentField) -> String -> State parentField -> Engage.Entity.Contact.Contact -> State parentField

Validate all of the fields

validateAllWith : List (Validate.Validator ( parentField, Engage.Validation.ValidationStatus ) Engage.Entity.Contact.Contact) -> (ValidationField -> parentField) -> String -> State parentField -> Engage.Entity.Contact.Contact -> State parentField

Validate all of the fields with a function

validateFieldWith : List (Validate.Validator ( parentField, Engage.Validation.ValidationStatus ) Engage.Entity.Contact.Contact) -> (ValidationField -> parentField) -> String -> Engage.Entity.Contact.Contact -> Engage.Validation.ValidationErrors parentField

Validate a field with a function

view : Engage.Namespace.Namespace -> Engage.Localization.Localization -> Engage.Entity.Address.Countries -> Engage.Entity.Address.RegionsCountry -> Engage.Entity.Contact.Contact -> Html msg

Get the view