From 2b7b59f3d510a82ff1b4c71223e88f9bb4b49a8b Mon Sep 17 00:00:00 2001 From: Moritz Poldrack Date: Fri, 22 Sep 2023 00:30:14 +0200 Subject: [PATCH] add new "dialog" element This commit adds the dialog element and the open-property that is used to indicate whether it should be visible to the user or not. Link: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog Signed-off-by: Moritz Poldrack --- src/Html.elm | 6 ++++++ src/Html/Attributes.elm | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/src/Html.elm b/src/Html.elm index 70b8645..50888d6 100644 --- a/src/Html.elm +++ b/src/Html.elm @@ -17,6 +17,7 @@ module Html exposing , small, cite, dfn, abbr, time, var, samp, kbd, s, q , mark, ruby, rt, rp, bdi, bdo, wbr , details, summary, menuitem, menu + , dialog ) {-| This file is organized roughly in order of popularity. The tags which you'd @@ -843,3 +844,8 @@ menu : List (Attribute msg) -> List (Html msg) -> Html msg menu = Elm.Kernel.VirtualDom.node "menu" + +{-| Represents a dialog that can be shown to the user. -} +dialog : List (Attribute msg) -> List (Html msg) -> Html msg +dialog = + Elm.Kernel.VirtualDom.node "dialog" diff --git a/src/Html/Attributes.elm b/src/Html/Attributes.elm index 652fc62..44a6c7b 100644 --- a/src/Html/Attributes.elm +++ b/src/Html/Attributes.elm @@ -17,6 +17,7 @@ module Html.Attributes exposing , accesskey, contenteditable, contextmenu, dir, draggable, dropzone , itemprop, lang, spellcheck, tabindex , cite, datetime, pubdate, manifest + , open ) {-| Helper functions for HTML attributes. They are organized roughly by @@ -901,6 +902,12 @@ manifest = Elm.Kernel.VirtualDom.attribute "manifest" +{-| Indicates whether a `dialog` element is visible or not. -} +open : Bool -> Attribute msg +open = + boolProperty "open" + + {-- TODO: maybe reintroduce once there's a better way to disambiguate imports {-| The number of columns a `col` or `colgroup` should span. -} span : Int -> Attribute msg