package bonsai
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=1d68aab713659951eba5b85f21d6f9382e0efa8579a02c3be65d9071c6e86303
doc/bonsai.web_ui_auto_generated/Bonsai_web_ui_auto_generated/Customization/index.html
Module Bonsai_web_ui_auto_generated.CustomizationSource
Customizations allow you to use custom logic for leaves of your view/form generation. When a tagged sexp_grammar is encountered, apply_to_tag will be invoked on the tag's key and value. If apply_to_tag returns true, then the custom logic will be used in place of the default auto-generated logic.
Customizations based on individual fields within a record are not yet supported, only tags applied to entire types will match.
WARNING: Customization of auto-generated UIs/Forms is currently under development. Please do not take a dependency on customization logic if you are not ok with the API changing under your feet.
val create_for_view :
apply_to_tag:(key:string -> value:Core.Sexp.t -> bool) ->
(Core.Sexp.t Bonsai_web.Value.t ->
Bonsai_web.Vdom.Node.t Bonsai_web.Computation.t) ->
(Core.Sexp.t Bonsai_web.Value.t ->
Bonsai_web.Vdom.Node.t Bonsai_web.Computation.t)
tcreate_for_view allows you to specify a custom rendering function for a sexp value whose grammar includes the provided tag name.
val constant_form :
(module Core.Sexpable with type t = 'a) ->
apply_to_tag:(key:string -> value:Core.Sexp.t -> bool) ->
'a Form.t Bonsai_web.Computation.t ->
form_transformer tconstant allows you to specify a form for the 'a that you're providing custom logic for. This form will be projected to Sexp.t, so that it can be used in the logic for form generation.
val transform_form :
apply_to_tag:(key:string -> value:Core.Sexp.t -> bool) ->
form_transformer ->
form_transformer tval transform_form' :
(module Core.Sexpable with type t = 'a) ->
apply_to_tag:(key:string -> value:Core.Sexp.t -> bool) ->
(Sexp_grammar.grammar Sexp_grammar.with_tag Bonsai_web.Value.t ->
recurse:
(Sexp_grammar.grammar Bonsai_web.Value.t ->
Core.Sexp.t Form.t Bonsai_web.Computation.t) ->
'a Form.t Bonsai_web.Computation.t) ->
form_transformer t