Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3 from jonsterling/ready/add-text-input-type
Browse files Browse the repository at this point in the history
Add the most important input type of all (text)
  • Loading branch information
jdegoes committed Sep 4, 2015
2 parents d0f8cc9 + dcec863 commit 56d327a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/Data/BrowserFeatures/InputType.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ data InputType
| Number
| Search
| Range
| Text
```

##### Instances
Expand Down
4 changes: 4 additions & 0 deletions src/Data/BrowserFeatures/InputType.purs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ data InputType
| Number
| Search
| Range
| Text

allInputTypes :: Array InputType
allInputTypes =
Expand All @@ -35,6 +36,7 @@ allInputTypes =
, Number
, Search
, Range
, Text
]

instance showInputType :: Show InputType where
Expand All @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 56d327a

Please sign in to comment.