mathiajusth / intl-phone-input / IntlPhoneInput.Config

Contains types and helper functions for working with configuration of IntlPhoneInput

Config


type alias Config msg =
{ hash : String
, onChange : IntlPhoneInput.Internal.State -> IntlPhoneInput.Type.PhoneNumber -> Platform.Cmd.Cmd msg -> msg
, namespace : String
, countries : Dict String IntlPhoneInput.Type.CountryData
, countriesSorter : List ( String
, IntlPhoneInput.Type.CountryData ) -> List ( String
, IntlPhoneInput.Type.CountryData )
, dialCodeFormatter : String -> String 
}

This record type holds all configuration of IntlPhoneInput.

config : String -> (IntlPhoneInput.Internal.State -> IntlPhoneInput.Type.PhoneNumber -> Platform.Cmd.Cmd msg -> msg) -> Config msg

Create the Config using a unique id value. The id is necessary if you have more than one IntlPhoneInput on your page.

type Msg
    = PhoneUpdated State PhoneNumber (Cmd Msg)

homePhoneConfig =
    config "HomePhone" PhoneUpdated

Helper Functions

getPhoneNumberInputId : Config msg -> String

Helper function to get the DOM id of the phone number <input> element.