primait / pyxis-components / Prima.Pyxis.Form.Date

Configuration


type Date model msg

Represent the opaque Date configuration.

Configuration Methods

date : (model -> Prima.Pyxis.Form.DatePicker.Date) -> (Prima.Pyxis.Form.DatePicker.Date -> msg) -> Date model msg

Create an input[type="date"] with the default options.

Rendering

render : model -> Date model msg -> List (Html msg)

Renders the Date.

Options

withAttribute : Html.Attribute msg -> Date model msg -> Date model msg

Sets an attribute to the Date.

withClass : String -> Date model msg -> Date model msg

Sets a class to the Date.

withDefaultValue : Prima.Pyxis.Form.DatePicker.Date -> Date model msg -> Date model msg

Adds a default value to the Date. Useful to teach the component about it's pristine/touched state.

withDisabled : Basics.Bool -> Date model msg -> Date model msg

Sets a disabled to the Date.

withId : String -> Date model msg -> Date model msg

Sets an id to the Date.

withMediumSize : Date model msg -> Date model msg

Sets a size to the Date.

withSmallSize : Date model msg -> Date model msg

Sets a size to the Date.

withLargeSize : Date model msg -> Date model msg

Sets a size to the Date.

withName : String -> Date model msg -> Date model msg

Sets a name to the Date.

withPlaceholder : String -> Date model msg -> Date model msg

Sets a placeholder to the Date.

withIsSubmitted : (model -> Basics.Bool) -> Date model msg -> Date model msg

Adds an isSubmitted predicate to the Date.

DatePicker Options

withDatePicker : (model -> Maybe Prima.Pyxis.Form.DatePicker.Model) -> (Prima.Pyxis.Form.DatePicker.Msg -> msg) -> Date model msg -> Date model msg

Adds a DatePicker to the Date. Remember to add the visibility policy with withDatePickerVisibility.

withDatePickerVisibility : (model -> Basics.Bool) -> Date model msg -> Date model msg

Adds a visibility policy to the DatePicker built via withDatePicker.

Event Options

withOnBlur : msg -> Date model msg -> Date model msg

Sets an onBlur event to the Date.

withOnFocus : msg -> Date model msg -> Date model msg

Sets an onFocus event to the Date.

withOnIconClick : msg -> Date model msg -> Date model msg

Sets an onClick event to the Date icon.

Validation

withValidation : (model -> Maybe Prima.Pyxis.Form.Validation.Type) -> Date model msg -> Date model msg

Adds a Validation rule to the Date.