Shpadoinkle-widgets-0.0.0.1: A collection of common reusable types and components.

Safe HaskellNone
LanguageHaskell2010

Shpadoinkle.Widgets.Table

Documentation

data Sort Source #

Constructors

ASC 
DESC 
Instances
Bounded Sort Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Enum Sort Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Methods

succ :: Sort -> Sort #

pred :: Sort -> Sort #

toEnum :: Int -> Sort #

fromEnum :: Sort -> Int #

enumFrom :: Sort -> [Sort] #

enumFromThen :: Sort -> Sort -> [Sort] #

enumFromTo :: Sort -> Sort -> [Sort] #

enumFromThenTo :: Sort -> Sort -> Sort -> [Sort] #

Eq Sort Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Methods

(==) :: Sort -> Sort -> Bool #

(/=) :: Sort -> Sort -> Bool #

Ord Sort Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Methods

compare :: Sort -> Sort -> Ordering #

(<) :: Sort -> Sort -> Bool #

(<=) :: Sort -> Sort -> Bool #

(>) :: Sort -> Sort -> Bool #

(>=) :: Sort -> Sort -> Bool #

max :: Sort -> Sort -> Sort #

min :: Sort -> Sort -> Sort #

Show Sort Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Methods

showsPrec :: Int -> Sort -> ShowS #

show :: Sort -> String #

showList :: [Sort] -> ShowS #

Generic Sort Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Associated Types

type Rep Sort :: Type -> Type #

Methods

from :: Sort -> Rep Sort x #

to :: Rep Sort x -> Sort #

Semigroup Sort Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Methods

(<>) :: Sort -> Sort -> Sort #

sconcat :: NonEmpty Sort -> Sort #

stimes :: Integral b => b -> Sort -> Sort #

Monoid Sort Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Methods

mempty :: Sort #

mappend :: Sort -> Sort -> Sort #

mconcat :: [Sort] -> Sort #

ToJSON Sort Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

FromJSON Sort Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

type Rep Sort Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

type Rep Sort = D1 (MetaData "Sort" "Shpadoinkle.Widgets.Table" "Shpadoinkle-widgets-0.0.0.1-2e7ySQOzQveLMoCBVBP1hf" False) (C1 (MetaCons "ASC" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "DESC" PrefixI False) (U1 :: Type -> Type))

data SortCol a Source #

Constructors

SortCol (Column a) Sort 
Instances
Functor Column => Functor SortCol Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Methods

fmap :: (a -> b) -> SortCol a -> SortCol b #

(<$) :: a -> SortCol b -> SortCol a #

Eq (Column a) => Eq (SortCol a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Methods

(==) :: SortCol a -> SortCol a -> Bool #

(/=) :: SortCol a -> SortCol a -> Bool #

Ord (Column a) => Ord (SortCol a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Methods

compare :: SortCol a -> SortCol a -> Ordering #

(<) :: SortCol a -> SortCol a -> Bool #

(<=) :: SortCol a -> SortCol a -> Bool #

(>) :: SortCol a -> SortCol a -> Bool #

(>=) :: SortCol a -> SortCol a -> Bool #

max :: SortCol a -> SortCol a -> SortCol a #

min :: SortCol a -> SortCol a -> SortCol a #

Show (Column a) => Show (SortCol a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Methods

showsPrec :: Int -> SortCol a -> ShowS #

show :: SortCol a -> String #

showList :: [SortCol a] -> ShowS #

Generic (SortCol a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Associated Types

type Rep (SortCol a) :: Type -> Type #

Methods

from :: SortCol a -> Rep (SortCol a) x #

to :: Rep (SortCol a) x -> SortCol a #

Ord (Column a) => Semigroup (SortCol a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Methods

(<>) :: SortCol a -> SortCol a -> SortCol a #

sconcat :: NonEmpty (SortCol a) -> SortCol a #

stimes :: Integral b => b -> SortCol a -> SortCol a #

(Bounded (Column a), Ord (Column a), Enum (Column a)) => Monoid (SortCol a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Methods

mempty :: SortCol a #

mappend :: SortCol a -> SortCol a -> SortCol a #

mconcat :: [SortCol a] -> SortCol a #

ToJSON (Column a) => ToJSON (SortCol a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

FromJSON (Column a) => FromJSON (SortCol a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

type Rep (SortCol a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

type Rep (SortCol a) = D1 (MetaData "SortCol" "Shpadoinkle.Widgets.Table" "Shpadoinkle-widgets-0.0.0.1-2e7ySQOzQveLMoCBVBP1hf" False) (C1 (MetaCons "SortCol" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Column a)) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Sort)))

compareOn :: Ord a => Sort -> a -> a -> Ordering Source #

class Tabular a where Source #

Associated Types

type Effect a (m :: Type -> Type) :: Constraint Source #

Methods

toRows :: a -> [Row a] Source #

toCell :: Effect a m => a -> Row a -> Column a -> [Html m a] Source #

sortTable :: SortCol a -> Row a -> Row a -> Ordering Source #

data family Column (a :: Type) :: Type Source #

data family Row (a :: Type) :: Type Source #

data Theme m a Source #

Constructors

Theme 

Fields

Instances
Generic (Theme m a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Associated Types

type Rep (Theme m a) :: Type -> Type #

Methods

from :: Theme m a -> Rep (Theme m a) x #

to :: Rep (Theme m a) x -> Theme m a #

Semigroup (Theme m a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Methods

(<>) :: Theme m a -> Theme m a -> Theme m a #

sconcat :: NonEmpty (Theme m a) -> Theme m a #

stimes :: Integral b => b -> Theme m a -> Theme m a #

Monoid (Theme m a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

Methods

mempty :: Theme m a #

mappend :: Theme m a -> Theme m a -> Theme m a #

mconcat :: [Theme m a] -> Theme m a #

type Rep (Theme m a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Table

type Rep (Theme m a) = D1 (MetaData "Theme" "Shpadoinkle.Widgets.Table" "Shpadoinkle-widgets-0.0.0.1-2e7ySQOzQveLMoCBVBP1hf" False) (C1 (MetaCons "Theme" PrefixI True) ((S1 (MetaSel (Just "tableProps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(Text, Prop m (a, SortCol a))]) :*: S1 (MetaSel (Just "headProps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(Text, Prop m (a, SortCol a))])) :*: (S1 (MetaSel (Just "thProps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Column a -> [(Text, Prop m (a, SortCol a))])) :*: (S1 (MetaSel (Just "bodyProps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(Text, Prop m (a, SortCol a))]) :*: S1 (MetaSel (Just "tdProps") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Column a -> [(Text, Prop m a)]))))))

view :: forall m a. (Tabular a, Effect a m, Applicative m, Humanize (Column a), Bounded (Column a), Ord (Column a), Enum (Column a)) => a -> SortCol a -> Html m (a, SortCol a) Source #

viewWith :: forall m a. (Tabular a, Effect a m, Applicative m, Humanize (Column a), Bounded (Column a), Ord (Column a), Enum (Column a)) => Theme m a -> a -> SortCol a -> Html m (a, SortCol a) Source #