From dcec86353cb6d717bece358a511787e792c86488 Mon Sep 17 00:00:00 2001 From: Jonathan Sterling Date: Fri, 4 Sep 2015 12:59:41 -0700 Subject: [PATCH] Add the most important input type of all (text) Can't believe I forgot this one. --- docs/Data/BrowserFeatures/InputType.md | 1 + src/Data/BrowserFeatures/InputType.purs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docs/Data/BrowserFeatures/InputType.md b/docs/Data/BrowserFeatures/InputType.md index 1fb8443..b738676 100644 --- a/docs/Data/BrowserFeatures/InputType.md +++ b/docs/Data/BrowserFeatures/InputType.md @@ -16,6 +16,7 @@ data InputType | Number | Search | Range + | Text ``` ##### Instances diff --git a/src/Data/BrowserFeatures/InputType.purs b/src/Data/BrowserFeatures/InputType.purs index 31a2438..70336c1 100644 --- a/src/Data/BrowserFeatures/InputType.purs +++ b/src/Data/BrowserFeatures/InputType.purs @@ -20,6 +20,7 @@ data InputType | Number | Search | Range + | Text allInputTypes :: Array InputType allInputTypes = @@ -35,6 +36,7 @@ allInputTypes = , Number , Search , Range + , Text ] instance showInputType :: Show InputType where @@ -50,6 +52,7 @@ instance showInputType :: Show InputType where show Number = "Number" show Search = "Search" show Range = "Range" + show Text = "Text" -- | Render an `InputType` into the corresponding value of the `type` attribute -- | on an `input` element. @@ -66,6 +69,7 @@ renderInputType Url = "url" renderInputType Number = "number" renderInputType Search = "search" renderInputType Range = "range" +renderInputType Text = "text" instance eqInputType :: Eq InputType where eq x y = renderInputType x == renderInputType y