Ejemplo n.º 1
0
        static public IControlBody Main()
        {
            var rvInput   = Var.Create(new JobSearchCriteria());
            var submit    = Submitter.CreateOption(rvInput.View);
            var vReversed =
                submit.View.MapAsync(input =>
            {
                if (input == null)
                {
                    return(Task.FromResult(""));
                }
                return(Task.FromResult("perd"));
            });

            return(Html.div(
                       Html.input(rvInput),
                       Html.button("Send", submit.Trigger),
                       Html.hr(),
                       Html.h4(
                           Html.attr.@class("text-muted"),
                           "The server responded:",
                           Html.div(
                               Html.attr.@class("jumbotron"),
                               Html.h1(vReversed)
                               )
                           )
                       ));
        }
Ejemplo n.º 2
0
 public static Elt CheckableNumberInput(string name, Var <bool> useInput, Var <int> valueLens,
                                        int defaultValue)
 {
     return(Html.span(Html.checkbox(useInput), name,
                      Html.input(Html.attr.type("number"), valueLens, Html.attr.placeholder(defaultValue.ToString()))));
 }
Ejemplo n.º 3
0
 public static Elt CheckableTextInput(string name, Var <bool> useInput, Var <string> valueLens, string defaultValue)
 {
     return(Html.span(Html.checkbox(useInput), name, Html.input(valueLens, Html.attr.placeholder(defaultValue))));
 }
Ejemplo n.º 4
0
 public static Elt CheckableTextInput(string name, Var <bool> useInput, Var <string> valueLens)
 {
     return(Html.span(Html.checkbox(useInput), name, Html.input(valueLens)));
 }
Ejemplo n.º 5
0
 public static Elt ClearableTimeInput(Var <string> timeLens)
 {
     return(Html.span(Html.input(timeLens, Html.attr.type("time"), Html.style("line-height", "unset")), Html.button("Clear", () => timeLens.Value = "")));
 }
Ejemplo n.º 6
0
 public static Elt DateRangeSearch(string name, Var <bool> useCriteriaLens, Var <string> beforeLens, Var <string> afterLens)
 {
     return(Html.span(Html.checkbox(useCriteriaLens), name + ": ", Html.input(beforeLens, Html.attr.type("date")), Html.input(afterLens, Html.attr.type("date"))));
 }
Ejemplo n.º 7
0
 public static Elt TextSearch(string name, Var <string> criteriaLens, Var <bool> useCriteriaLens)
 {
     return(Html.span(Html.checkbox(useCriteriaLens), name, Html.input(criteriaLens)));
 }