mercurymedia/elm-smart-select/6.0.0

NOTE: the latest version is 8.0.0

SmartSelect.Settings

The settings module for all smart select variants

Architecture

type alias Settings msg =
{ theme : Theme
, isDisabled : Bool
, optionsContainerMaxHeight : Float
, placeholder : String
, noResultsForMsg : String -> String
, noOptionsMsg : String
, icon : Maybe (Html msg)
, id : String
}

The type representing the select's general settings to be passed to all view functions

type alias RemoteSettings msg a =
{ settings : Settings msg
, spinnerColor : Color
, characterThresholdPrompt : Int -> String
, characterSearchThreshold : Int
, debounceDuration : Float
, queryErrorMsg : String
, queryAttrs : RemoteQueryAttrs a
}

The type representing the select's remote settings (including the general settings) to be passed to all view & update functions of the remote variants

type alias RemoteQueryAttrs a =
{ headers : List Header
, url : String -> String
, optionDecoder : Decoder a
}

Fields to be provided to facilitate the external request. The function provided to url takes in searchText in the event it is necessary for the query.

type alias Theme =
{ fontSize :
{ base : Px
, sm : Px
, xs : Px
, xxs : Px
}
, color :
{ text :
{ primary : Color
, secondary : Color
, disabled : Color
}
, primary :
{ main : Color
, contrastText : Color
, light : Color
}
, error :
{ main : Color
, contrastText : Color
, light : Color
}
, background :
{ input : Color
, optionsContainer : Color
}
, action : { hover : Color }
, border : Color
}
, size :
{ iconButton : Px
, inputElement : Px
}
, borderWidth : Px
, borderRadius :
{ base : Px
, lg : Px
}
, boxShadow :
{ offsetX : Px
, offsetY : Px
, blurRadius : Px
, spreadRadius : Px
, color : Color
}
, transition : { duration : Float }
, zIndex : Int
, className : String
, classNamePrefix : String
}

The type facilitating the Theme with the most important design tokens

defaultRemoteSettings : RemoteQueryAttrs a -> RemoteSettings msg a

A record of default settings for the remote select variants. Extend this if you want to further customize.

Requires the RemoteQueryAttrs.

defaultSettings : Settings msg

A record of default settings for all the select variants. Extend this if you want to further customize.

defaultTheme : Theme

The default theme that is included in the defaultSettings