package bonsai
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=1d68aab713659951eba5b85f21d6f9382e0efa8579a02c3be65d9071c6e86303
doc/bonsai.web_ui_form/Bonsai_web_ui_form/View/index.html
Module Bonsai_web_ui_form.ViewSource
include module type of struct include Bonsai_web_ui_form_view end
type context = Bonsai_web_ui_form_view.context = {tooltip : Virtual_dom.Vdom.Node.t option;error : Core.Error.t option;label : Virtual_dom.Vdom.Node.t option;
}type append_item = Bonsai_web_ui_form_view.append_item = | Append_info of {append : unit Virtual_dom.Vdom.Effect.t;text : string option;
}| Append_view of Virtual_dom.Vdom.Node.t
type remove_item = Bonsai_web_ui_form_view.remove_item = | Remove_info of {remove : unit Virtual_dom.Vdom.Effect.t;element_label : (delete_button:Virtual_dom.Vdom.Node.t -> int -> Virtual_dom.Vdom.Node.t) option;
}| Remove_view of Virtual_dom.Vdom.Node.t
and view = Bonsai_web_ui_form_view.view = | Empty| Collapsible of collapsible| Raw of raw| Record of field list| Variant of variant| List of list_view| Tuple of t list| Option of option_view
and raw = Bonsai_web_ui_form_view.raw = {id : string;raw_view : context -> editable:editable -> Virtual_dom.Vdom.Node.t;
}and collapsible = Bonsai_web_ui_form_view.collapsible = {collapse_label : Virtual_dom.Vdom.Node.t;state : collapsed_state;
}and option_view = Bonsai_web_ui_form_view.option_view = {toggle : Virtual_dom.Vdom.Node.t;status : option_status;
}and list_view = Bonsai_web_ui_form_view.list_view = {list_items : list_item list;append_item : append_item;
}and list_item = Bonsai_web_ui_form_view.list_item = {item_view : t;remove_item : remove_item;
}and variant = Bonsai_web_ui_form_view.variant = {clause_selector : Virtual_dom.Vdom.Node.t;selected_clause : clause option;
}of_vdom' is like of_vdom, but allows access to some extra metadata that is stored in the form's view.
record combines a list of fields (field names and their corresponding views) into a view representing a record with those fields.
variant takes a selector for selecting which variant case, as well as an optional selected_clause which contains the name of the currently selected clause and the t representing that clause's arguments.
option takes a toggle for switching between None and Some _, as well as a status for the form. status can be:
Currently_some viewif toggle is set toSome _andviewrepresents the form for the type in the option.Currently_none Noneif the toggle is set toNoneand we shouldn't show any view for theNonecaseCurrently_none (Some view)if the toggle is set toNoneand we want to displayviewwhen the toggle is set toNone(e.g. displaying a greyed out textbox)
collapsible represents a collapsible subform. The supplied label can be used to toggle open/closed the collapsible t.
collapsible_state can be:
Collapsed Noneif the view is collapsed and we shouldn't render any subformCollapsed (Some view)if the view is collapsed but we want to render a subform in this case (e.g. displaying...in a code editor when folded)Expanded viewif the view is expanded andviewis the subform to show
list_item represents a single form in an extendable list.
remove_item can either be:
Remove_info { remove; element_label }in which case the rendering function will decide how to render a remove button for this item withremovebeing scheduled on click andelement_labelbeing called to generate the label for this element.Remove_view viewin which caseviewwill be used as the remove button
val list :
append_item:append_item ->
legacy_button_position:[ `Inline | `Indented ] ->
list_item list ->
tlist represents a form for an extendable list.
append_item can either be:
Append_info { append; text }in which case the rendering function will decide how to render an append button withappendbeing scheduled on click andtextbeing the text for the buttonAppend_view viewin which caseviewwill be used as the append button
val with_fieldset :
currently_editable:bool ->
Virtual_dom.Vdom.Node.t ->
Virtual_dom.Vdom.Node.tval to_vdom :
?theme:Bonsai_web.View.Theme.t ->
?on_submit:submission_options ->
?editable:editable ->
t ->
Bonsai_web.Vdom.Node.tval to_vdom_plain :
?theme:Bonsai_web.View.Theme.t ->
?editable:editable ->
t ->
Bonsai_web.Vdom.Node.t list