Idris2Doc : Web.Async.Widget

Web.Async.Widget

(source)

Definitions

dataEditRes : Type->Type
  Result of editing some kind of input element.

Input is either missing, invalid, or valid.

Totality: total
Visibility: public export
Constructors:
Missing : EditRest
Invalid : String->EditRest
Valid : t->EditRest

Hints:
ApplicativeEditRes
Eq{arg:3573}=>Eq (EditRes{arg:3573})
FunctorEditRes
MonadEditRes
Show{arg:3573}=>Show (EditRes{arg:3573})
toEither : EditRest->EitherString ()
Totality: total
Visibility: export
toMaybe : EditRest->Maybet
Totality: total
Visibility: export
isValid : EditRest->Bool
Totality: total
Visibility: export
recordWidget : Type->Type
  A `Widget e` is an interactive UI element that emits
events of type `e`.

Totality: total
Visibility: public export
Constructor: 
W : HTMLNode->JSStreame->Widgete

Projections:
.events : Widgete->JSStreame
.node : Widgete->HTMLNode

Hint: 
FunctorWidget
.node : Widgete->HTMLNode
Totality: total
Visibility: public export
node : Widgete->HTMLNode
Totality: total
Visibility: public export
.events : Widgete->JSStreame
Totality: total
Visibility: public export
events : Widgete->JSStreame
Totality: total
Visibility: public export
adjNode : (HTMLNode->HTMLNode) ->Widgete->Widgete
Totality: total
Visibility: export
constant : t->Widgett
  A dummy widget without a node representation that keeps
producing the given value.

Totality: total
Visibility: export
empty : Widgett
  A dummy widget without a node representation that
never fires an event.

Totality: total
Visibility: export
once : t->Widgett
  A dummy widget without a node representation that
fires the given event exactly once.

Totality: total
Visibility: export
endOnRemove : Widgett->JSes (Widgett)
  Adjusts a widget in such a way that its input streams ends
as soon as its node is removed from the DOM.

This is used in utilities such as `bindEd` or `Web.Async.List`, where
external events decide when a node is removed from the UI.

Totality: total
Visibility: export
disabledEdit : HasJSErres=>Reft->EditResa->JSes ()
  Sets the `disabled` attribute of the given element
if the given values is not a `Valid`.

This is useful for disabling components such as buttons
in the UI in case of invalid user input.

Totality: total
Visibility: export
voidRef : Reft->RefVoid
Totality: total
Visibility: export
attributesWithID : LIOio=> (0t : HTMLTags) ->List (Attributet) ->io (Reft, List (Attributet))
  Adds a unique ID to the given list of attributes if it does not yet
already have an ID attribute, and returns the updated list plus the ID.

Totality: total
Visibility: export
nodeWithID : LIOio=>HTMLNode->io (Maybe (RefVoid, HTMLNode))
  Adds a unique ID to the given HTML node if it does not yet
already have an ID and returns the updated node plus its ID.

Returns `Nothing` in case the node in question is a `Raw` node
or a `Text` node.

Totality: total
Visibility: export
textIn : InputType->List (AttributeInput) ->String->JSes (WidgetString)
  An input element that emits `String` events.

Totality: total
Visibility: export
valIn : InputType->List (AttributeInput) ->String-> (String->EditRese) ->JSes (Widget (EditRese))
  A validated input element that emits events of type
`EditRes e`.

A custom validity message is set in case of invalid input.

Totality: total
Visibility: export
recordFileEv : Type
Totality: total
Visibility: public export
Constructor: 
FE : File->String->FileEv

Projections:
.file : FileEv->File
.name : FileEv->String
.file : FileEv->File
Totality: total
Visibility: public export
file : FileEv->File
Totality: total
Visibility: public export
.name : FileEv->String
Totality: total
Visibility: public export
name : FileEv->String
Totality: total
Visibility: public export
onFileIn : Sinke=> (FileEv->e) ->AttributeInput
Totality: total
Visibility: export
fileIn : AttributesInput->JSes (Widget (EditResFileEv))
Totality: total
Visibility: export
sel : Eqt=> (v->t) -> (v->String) ->Listv->List (AttributeSelect) ->Maybet->JSes (Widget (EditRest))
  A select element displaying the values of type `v`
shown in the given list.

It fires events of type `t`, and uses two functions, one for
converting elements to events and one for displaying elements.

Totality: total
Visibility: export
selEntries : Eqt=>List (SelectEntryt) ->List (AttributeSelect) ->Maybet->JSes (Widget (EditRest))
  A select element displaying the values of type `v`
shown in the given list.

It fires events of type `t`, and uses two functions, one for
converting elements to events and one for displaying elements.

Totality: total
Visibility: export
map2 : Functorf=>Functorg=> (x->y) ->f (gx) ->f (gy)
Totality: total
Visibility: export
map3 : Functorf=>Functorg=>Functorh=> (x->y) ->f (g (hx)) ->f (g (hy))
Totality: total
Visibility: export
recordEditor : Type->Type
  An `Editor` describes how to create new interactive DOM elements that
typically serve as a form of (validated) user input. It consists of an
`HTMLNode` for displaying the editing form plus a stream of validated
input data.

An editor and its corresponding widgets can be something simple like a
text input field or a `<select>` element, or it can be highly complex
like a canvas and a group of DOM elements for editing molecules.

A couple of notes about how an editor is supposed to behave:
* If the initial value used for creating the widget is a `Nothing`,
the stream of values produced by the widget *may* already hold
a valid default value. In case no sensible default is available,
the stream's initial value *should* be `Missing`.
* If the initial value used for creating the widget is a `Just`,
the stream of values produced by the widget *must* emit a `Valid`
wrapping the provided initial value as its first output.

The above two rules make sure an editor behaves as expected, especially
when combining several editors in a form, or using the experimental
`bindEd` combinator.

Totality: total
Visibility: public export
Constructor: 
E : (Maybet->Act (Widget (EditRest))) ->Editort

Projection: 
.widget : Editort->Maybet->Act (Widget (EditRest))
  Create a node and stream of values from an optional initial value.
.widget : Editort->Maybet->Act (Widget (EditRest))
  Create a node and stream of values from an optional initial value.

Totality: total
Visibility: public export
widget : Editort->Maybet->Act (Widget (EditRest))
  Create a node and stream of values from an optional initial value.

Totality: total
Visibility: public export
adjEditor : (Maybea->Maybeb) -> (EditResb->EditResa) ->Editorb->Editora
Totality: total
Visibility: export
editI : Iso't1t2->Editort1->Editort2
  Views an editor through an isomorphism.

Totality: total
Visibility: export
editP : Prism't2t1->Editort1->Editort2
  Views the `new` values of an editor through a prism.

Totality: total
Visibility: export
refineEdit : (t2->Maybet1) -> (t1->EditRest2) ->Editort1->Editort2
  Refines an editor to produce values of a more restricted type.

Totality: total
Visibility: export
mapEvents : (JSStream (EditRest) ->JSStream (EditRest)) ->Editort->Editort
Totality: total
Visibility: export
dummy : t->Editort
  A dummy `Editor` for uneditable values.

The given value is fired exactly once.

Totality: total
Visibility: public export
txtEdit : (String->EditRest) ->InputType-> (Maybet->String) ->List (AttributeInput) ->Editort
Totality: total
Visibility: export
selEdit : Interpolationt=>Eqt=>Listt->List (AttributeSelect) ->Editort
Totality: total
Visibility: export
bindEd : Class-> (HTMLNode->HTMLNode->HTMLNode) -> (a->Editorb) -> (Maybeb->a) ->Editora->Editorb
Totality: total
Visibility: export