diff --git a/reflex-dom-colonnade/src/Reflex/Dom/Colonnade.hs b/reflex-dom-colonnade/src/Reflex/Dom/Colonnade.hs index db7af79..0256ef2 100644 --- a/reflex-dom-colonnade/src/Reflex/Dom/Colonnade.hs +++ b/reflex-dom-colonnade/src/Reflex/Dom/Colonnade.hs @@ -19,6 +19,7 @@ module Reflex.Dom.Colonnade , dynamic , dynamicCapped , expandable + , sectioned -- * Cell Functions , cell , charCell @@ -102,7 +103,15 @@ body :: (DomBuilder t m, PostBuild t m, Foldable f, Monoid e) -> f a -> m e body bodyAttrs trAttrs colonnade collection = - elAttr "tbody" bodyAttrs . unWrappedApplicative . flip foldMap collection $ \a -> + elAttr "tbody" bodyAttrs (bodyRows trAttrs colonnade collection) + +bodyRows :: (DomBuilder t m, PostBuild t m, Foldable f, Monoid e) + => (a -> M.Map T.Text T.Text) + -> Colonnade p a (Cell t m e) + -> f a + -> m e +bodyRows trAttrs colonnade collection = + unWrappedApplicative . flip foldMap collection $ \a -> WrappedApplicative . elAttr "tr" (trAttrs a) . unWrappedApplicative $ @@ -125,6 +134,30 @@ static tableAttrs mheadAttrs bodyAttrs trAttrs colonnade collection = E.headerMonadicGeneral_ colonnade (elFromCell "th") body bodyAttrs trAttrs colonnade collection +sectioned :: + (DomBuilder t m, PostBuild t m, Foldable f, Foldable h, Foldable g) + => M.Map T.Text T.Text -- ^ @\