diff --git a/WebSharper.UI.Tests/Main.fs b/WebSharper.UI.Tests/Main.fs index b6e65fb..d39d294 100644 --- a/WebSharper.UI.Tests/Main.fs +++ b/WebSharper.UI.Tests/Main.fs @@ -693,6 +693,9 @@ module Main = p [] [text (" You typed: " + rv.V.y.z)] V(ul [] (rv.V.y.z |> Seq.map (fun c -> li [] [text (string c)]))).V p [Attr.ClassPred "is-green" (rv.V.y.z = "green")] [text "this should be bordered with green iff you typed \"green\"."] + + dialog [attr.id "my-popover"; attr.popover "manual"; attr.style "background-color: darkslategray; color:white;"] [text "Popover attempt"] + button [attr.popovertarget "my-popover"; attr.popovertargetaction "toggle"] [text "Open/Close dialog"] rd.V ] |> Doc.RunAppend JS.Document.Body diff --git a/WebSharper.UI/HTML.Client.fs b/WebSharper.UI/HTML.Client.fs index 49639e1..cf3cf75 100644 --- a/WebSharper.UI/HTML.Client.fs +++ b/WebSharper.UI/HTML.Client.fs @@ -1128,6 +1128,33 @@ module HtmlExtensions = /// Create an animated HTML attribute "poster" whose value is computed from the given reactive view. [] static member posterAnim view convert trans = Client.Attr.Animated "poster" trans view convert + /// Create an HTML attribute "popover" with the given reactive value. + [] + static member popoverDyn view = Client.Attr.Dynamic "popover" view + /// `popover v p` sets an HTML attribute "popover" with reactive value v when p is true, and unsets it when p is false. + [] + static member popoverDynPred view pred = Client.Attr.DynamicPred "popover" pred view + /// Create an animated HTML attribute "popover" whose value is computed from the given reactive view. + [] + static member popoverAnim view convert trans = Client.Attr.Animated "popover" trans view convert + /// Create an HTML attribute "popovertarget" with the given reactive value. + [] + static member popovertargetDyn view = Client.Attr.Dynamic "popovertarget" view + /// `popovertarget v p` sets an HTML attribute "popovertarget" with reactive value v when p is true, and unsets it when p is false. + [] + static member popovertargetDynPred view pred = Client.Attr.DynamicPred "popovertarget" pred view + /// Create an animated HTML attribute "popovertarget" whose value is computed from the given reactive view. + [] + static member popovertargetAnim view convert trans = Client.Attr.Animated "popovertarget" trans view convert + /// Create an HTML attribute "popovertargetaction" with the given reactive value. + [] + static member popovertargetactionDyn view = Client.Attr.Dynamic "popovertargetaction" view + /// `popovertargetaction v p` sets an HTML attribute "popovertargetaction" with reactive value v when p is true, and unsets it when p is false. + [] + static member popovertargetactionDynPred view pred = Client.Attr.DynamicPred "popovertargetaction" pred view + /// Create an animated HTML attribute "popovertargetaction" whose value is computed from the given reactive view. + [] + static member popovertargetactionAnim view convert trans = Client.Attr.Animated "popovertargetaction" trans view convert /// Create an HTML attribute "preload" with the given reactive value. [] static member preloadDyn view = Client.Attr.Dynamic "preload" view diff --git a/WebSharper.UI/HTML.fs b/WebSharper.UI/HTML.fs index 886c526..fc2d503 100644 --- a/WebSharper.UI/HTML.fs +++ b/WebSharper.UI/HTML.fs @@ -157,6 +157,9 @@ module Html = /// Create an HTML element
with attributes and children. [] let div ats ch = Doc.Element "div" ats ch + /// Create an HTML element with attributes and children. + [] + let dialog ats ch = Doc.Element "dialog" ats ch /// Create an HTML element
with attributes and children. [] let dl ats ch = Doc.Element "dl" ats ch @@ -523,6 +526,9 @@ module Html = /// Create an HTML element
with attributes and children. [] let div ats ch = Elt.div ats ch :> Doc + /// Create an HTML element with attributes and children. + [] + let dialog ats ch = Elt.dialog ats ch :> Doc /// Create an HTML element
with attributes and children. [] let dl ats ch = Elt.dl ats ch :> Doc @@ -1761,6 +1767,18 @@ module Html = /// The value can be reactive using `view.V`. [, "placeholder")>] static member placeholder value = Attr.Create "placeholder" value + /// Create an HTML attribute "popover" with the given value, which must be either "auto" or "manual". + /// The value can be reactive using `view.V`. + [, "popover")>] + static member popover value = Attr.Create "popover" value + /// Create an HTML attribute "popovertarget" with the given value, which must be an HTML id. + /// The value can be reactive using `view.V`. + [, "popovertarget")>] + static member popovertarget value = Attr.Create "popovertarget" value + /// Create an HTML attribute "popovertargetaction" with the given value, which must be either "show", "hide" or "toggle". + /// The value can be reactive using `view.V`. + [, "popovertargetaction")>] + static member popovertargetaction value = Attr.Create "popovertargetaction" value /// Create an HTML attribute "poster" with the given value. /// The value can be reactive using `view.V`. [, "poster")>]