Fable.Modulo


FormSelectModel Module

Functions related to the FormSelectModel type

Functions and values

Function or value Description

create initialValue availableValues labelForValue updater

Full Usage: create initialValue availableValues labelForValue updater

Parameters:
    initialValue : Result<'t, string>
    availableValues : seq<'t>
    labelForValue : 't -> string
    updater : FormSelectModel<'f, 't> -> 'f -> 'f

Returns: FormSelectModel<'f, 't>
Modifiers: inline
Type parameters: 'f, 't

Create a FormSelectModel object.

If the backing type is not an option, an empty choice is inserted at the beginning of the list.The default KeyFunction is JSON.stringify.

initialValue : Result<'t, string>
availableValues : seq<'t>
labelForValue : 't -> string
updater : FormSelectModel<'f, 't> -> 'f -> 'f
Returns: FormSelectModel<'f, 't>

createOfDU initialValue duType updater

Full Usage: createOfDU initialValue duType updater

Parameters:
Returns: FormSelectModel<'f, 't>
Modifiers: inline
Type parameters: 'f, 't

Create a FormSelectModel object using the cases from the given discriminated union. Currently only simple discriminated unions are supported (e.g. plain cases without data)

initialValue : Result<'t, string>
duType : Type
updater : FormSelectModel<'f, 't> -> 'f -> 'f
Returns: FormSelectModel<'f, 't>

update value item

Full Usage: update value item

Parameters:
Returns: FormSelectModel<'f, 't>
Modifiers: inline
Type parameters: 'f, 't

Update the field's value

value : Result<'t, string>
item : FormSelectModel<'f, 't>
Returns: FormSelectModel<'f, 't>

withDisabled x item

Full Usage: withDisabled x item

Parameters:
Returns: FormSelectModel<'a, 'b>

Disable the field

x : bool
item : FormSelectModel<'a, 'b>
Returns: FormSelectModel<'a, 'b>

withEmptyErrorMessage error item

Full Usage: withEmptyErrorMessage error item

Parameters:
Returns: FormSelectModel<'a, 'b>

Set the error message in case of no choice

error : string
item : FormSelectModel<'a, 'b>
Returns: FormSelectModel<'a, 'b>

withEmptySelection add item

Full Usage: withEmptySelection add item

Parameters:
Returns: FormSelectModel<'a, 'b>

If called with 'true' an empty, invalid choice is added at the start of the list

add : bool
item : FormSelectModel<'a, 'b>
Returns: FormSelectModel<'a, 'b>

withKeyFunction f item

Full Usage: withKeyFunction f item

Parameters:
Returns: FormSelectModel<'b, 'a>

Set the key generator function

f : 'a -> string
item : FormSelectModel<'b, 'a>
Returns: FormSelectModel<'b, 'a>

withLabel label item

Full Usage: withLabel label item

Parameters:
Returns: FormSelectModel<'a, 'b>

Set the label

label : string
item : FormSelectModel<'a, 'b>
Returns: FormSelectModel<'a, 'b>

withPlaceholder placeholder item

Full Usage: withPlaceholder placeholder item

Parameters:
Returns: FormSelectModel<'a, 'b>

Set the placeholder

placeholder : string
item : FormSelectModel<'a, 'b>
Returns: FormSelectModel<'a, 'b>

withRelativeSize s item

Full Usage: withRelativeSize s item

Parameters:
Returns: FormSelectModel<'a, 'b>

Set the relative size

s : int
item : FormSelectModel<'a, 'b>
Returns: FormSelectModel<'a, 'b>

withTooltip v item

Full Usage: withTooltip v item

Parameters:
Returns: FormSelectModel<'a, 'b>

Set the tooltip

v : TooltipKind
item : FormSelectModel<'a, 'b>
Returns: FormSelectModel<'a, 'b>

withTooltipText text item

Full Usage: withTooltipText text item

Parameters:
Returns: FormSelectModel<'a, 'b>

Set the tooltip text

text : string
item : FormSelectModel<'a, 'b>
Returns: FormSelectModel<'a, 'b>

withValidator validator item

Full Usage: withValidator validator item

Parameters:
Returns: FormSelectModel<'a, 'b>

Set the validator

validator : 'a -> 'b -> Result<'b, string>
item : FormSelectModel<'a, 'b>
Returns: FormSelectModel<'a, 'b>

withValueLabel f item

Full Usage: withValueLabel f item

Parameters:
Returns: FormSelectModel<'b, 'a>

Set the function to generate value labels

f : 'a -> string
item : FormSelectModel<'b, 'a>
Returns: FormSelectModel<'b, 'a>

withValues values item

Full Usage: withValues values item

Parameters:
Returns: FormSelectModel<'b, 'a>

Replace the available values

values : seq<'a>
item : FormSelectModel<'b, 'a>
Returns: FormSelectModel<'b, 'a>