Shpadoinkle-html-0.0.0.1: A typed, template generated Html DSL, and helpers.

Safe HaskellNone
LanguageHaskell2010

Shpadoinkle.Html.Property

Description

This module prives a DSL for HTML properties This DSL is entirely optional. You may use the Prop constructors provided by Shpadoinkle core and completely ignore this module. But for those who like a typed DSL with named functions for different properties, and nice overloading, this is for you.

Unlike Events and Elements, Properties come in one flavor. Vanilla.

Each named function documents the type of property it constructs whether it be Text or Bool. We also support other types such as Int, and Float, but via converting them to Text and letting JavaScript weirdness cast them to the correct underlying type.

Synopsis

Documentation

type TextProperty t = forall m a. ToPropText t => t -> (Text, Prop m a) Source #

class ToPropText a where Source #

How do we take a non-textual value, and make it text JavaScript will cast appropriately

Methods

toPropText :: a -> Text Source #

Instances
ToPropText Bool Source # 
Instance details

Defined in Shpadoinkle.Html.Property

Methods

toPropText :: Bool -> Text Source #

ToPropText Float Source # 
Instance details

Defined in Shpadoinkle.Html.Property

ToPropText Int Source # 
Instance details

Defined in Shpadoinkle.Html.Property

Methods

toPropText :: Int -> Text Source #

ToPropText Text Source # 
Instance details

Defined in Shpadoinkle.Html.Property

Methods

toPropText :: Text -> Text Source #

textProperty :: ToPropText a => Text -> a -> (Text, Prop m o) Source #

newtype ClassList Source #

Constructors

ClassList 

Fields

class ClassListRep a where Source #

Methods

asClass :: a -> ClassList Source #

Instances
ClassListRep Text Source # 
Instance details

Defined in Shpadoinkle.Html.Property

ClassListRep ClassList Source # 
Instance details

Defined in Shpadoinkle.Html.Property

ClassListRep [(Text, Bool)] Source # 
Instance details

Defined in Shpadoinkle.Html.Property

Methods

asClass :: [(Text, Bool)] -> ClassList Source #

ClassListRep [Text] Source # 
Instance details

Defined in Shpadoinkle.Html.Property

Methods

asClass :: [Text] -> ClassList Source #

ClassListRep (Text, Bool) Source # 
Instance details

Defined in Shpadoinkle.Html.Property

Methods

asClass :: (Text, Bool) -> ClassList Source #

className :: ClassListRep cl => cl -> (Text, Prop m a) Source #

for' :: Text -> (Text, Prop m a) Source #

reversed :: Bool -> (Text, Prop m a) Source #

default' :: Bool -> (Text, Prop m a) Source #

usemap :: Bool -> (Text, Prop m a) Source #

ismap :: Bool -> (Text, Prop m a) Source #

required :: Bool -> (Text, Prop m a) Source #

readonly :: Bool -> (Text, Prop m a) Source #

multiple :: Bool -> (Text, Prop m a) Source #

loop :: Bool -> (Text, Prop m a) Source #

controls :: Bool -> (Text, Prop m a) Source #

autoplay :: Bool -> (Text, Prop m a) Source #

disabled :: Bool -> (Text, Prop m a) Source #

hidden :: Bool -> (Text, Prop m a) Source #

selected :: Bool -> (Text, Prop m a) Source #

checked :: Bool -> (Text, Prop m a) Source #

property :: Text -> (Text, Prop m a) Source #

content :: Text -> (Text, Prop m a) Source #

charset :: Text -> (Text, Prop m a) Source #

itemprop :: Text -> (Text, Prop m a) Source #

dropzone :: Text -> (Text, Prop m a) Source #

manifest :: Text -> (Text, Prop m a) Source #

pubdate :: Text -> (Text, Prop m a) Source #

datetime :: Text -> (Text, Prop m a) Source #

scope :: Text -> (Text, Prop m a) Source #

headers :: Text -> (Text, Prop m a) Source #

align :: Text -> (Text, Prop m a) Source #

srcdoc :: Text -> (Text, Prop m a) Source #

sandbox :: Text -> (Text, Prop m a) Source #

srclang :: Text -> (Text, Prop m a) Source #

kind' :: Text -> (Text, Prop m a) Source #

name' :: Text -> (Text, Prop m a) Source #

poster :: Text -> (Text, Prop m a) Source #

preload :: Text -> (Text, Prop m a) Source #

alt :: Text -> (Text, Prop m a) Source #

coords :: Text -> (Text, Prop m a) Source #

shape :: Text -> (Text, Prop m a) Source #

ping :: Text -> (Text, Prop m a) Source #

media :: Text -> (Text, Prop m a) Source #

hreflang :: Text -> (Text, Prop m a) Source #

download :: Text -> (Text, Prop m a) Source #

target :: Text -> (Text, Prop m a) Source #

wrap :: Text -> (Text, Prop m a) Source #

step :: Text -> (Text, Prop m a) Source #

min :: Text -> (Text, Prop m a) Source #

max :: Text -> (Text, Prop m a) Source #

pattern :: Text -> (Text, Prop m a) Source #

method :: Text -> (Text, Prop m a) Source #

enctype :: Text -> (Text, Prop m a) Source #

action :: Text -> (Text, Prop m a) Source #

accept :: Text -> (Text, Prop m a) Source #

title :: Text -> (Text, Prop m a) Source #

src :: Text -> (Text, Prop m a) Source #

value :: Text -> (Text, Prop m a) Source #

href :: Text -> (Text, Prop m a) Source #

rel :: Text -> (Text, Prop m a) Source #

type' :: Text -> (Text, Prop m a) Source #

id' :: Text -> (Text, Prop m a) Source #

height :: Int -> (Text, Prop m a) Source #

width :: Int -> (Text, Prop m a) Source #

tabIndex :: Int -> (Text, Prop m a) Source #