module IHP.Pagination.Types where
import IHP.Prelude
data =
{
Pagination -> Int
pageSize :: Int
, Pagination -> Int
totalItems :: Int
, Pagination -> Int
currentPage :: Int
, Pagination -> Int
window :: Int
}
deriving(Int -> Pagination -> ShowS
[Pagination] -> ShowS
Pagination -> String
(Int -> Pagination -> ShowS)
-> (Pagination -> String)
-> ([Pagination] -> ShowS)
-> Show Pagination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Pagination -> ShowS
showsPrec :: Int -> Pagination -> ShowS
$cshow :: Pagination -> String
show :: Pagination -> String
$cshowList :: [Pagination] -> ShowS
showList :: [Pagination] -> ShowS
Show)
data Options =
Options
{
Options -> Int
maxItems :: Int
, Options -> Int
windowSize :: Int
}
instance SetField "maxItems" Options Int where
setField :: Int -> Options -> Options
setField Int
value Options
options =
Options
options { maxItems = value }
instance SetField "windowSize" Options Int where
setField :: Int -> Options -> Options
setField Int
value Options
options =
Options
options { windowSize = value }
data PageDotDot =
Page Int
| DotDot Int