mirror of
https://github.com/byteverse/colonnade.git
synced 2026-04-21 23:47:45 +02:00
attempt to fix paginatedExpandable
This commit is contained in:
parent
50ffb67738
commit
2d5ae3851a
@ -667,7 +667,7 @@ paginatedExpandable (Bureau tableAttrs theadAttrs bodyAttrs trAttrs) (Pagination
|
|||||||
ArrangementFooter tfootAttrs tfootTrAttrs tfootThAttrs -> mdo
|
ArrangementFooter tfootAttrs tfootTrAttrs tfootThAttrs -> mdo
|
||||||
tableHeader theadAttrs colLifted
|
tableHeader theadAttrs colLifted
|
||||||
let vals = makeVals page
|
let vals = makeVals page
|
||||||
tableBodyExpandable size expansionLifted bodyAttrs trAttrsLifted colLifted vals
|
tableBodyExpandable size expansionLifted bodyAttrs trAttrsLifted colLifted vals (Visible True aDef)
|
||||||
page <- elDynAttr "tfoot" (hideWhenUnipage tfootAttrs) $ do
|
page <- elDynAttr "tfoot" (hideWhenUnipage tfootAttrs) $ do
|
||||||
elDynAttr "tr" tfootTrAttrs $ do
|
elDynAttr "tr" tfootTrAttrs $ do
|
||||||
let attrs = zipDynWith insertSizeAttr size tfootThAttrs
|
let attrs = zipDynWith insertSizeAttr size tfootThAttrs
|
||||||
@ -719,12 +719,13 @@ tableBodyExpandable :: forall t m c b a h. (DomBuilder t m, MonadHold t m, PostB
|
|||||||
-> (a -> Dynamic t (M.Map T.Text T.Text))
|
-> (a -> Dynamic t (M.Map T.Text T.Text))
|
||||||
-> Colonnade h (Dynamic t a) (c (Dynamic t Bool))
|
-> Colonnade h (Dynamic t a) (c (Dynamic t Bool))
|
||||||
-> Vector (Dynamic t a)
|
-> Vector (Dynamic t a)
|
||||||
|
-> a -- ^ initial value, a hack
|
||||||
-> m ()
|
-> m ()
|
||||||
tableBodyExpandable colCount renderExpansion bodyAttrs trAttrs col collection =
|
tableBodyExpandable colCount renderExpansion bodyAttrs trAttrs col collection a0 =
|
||||||
elDynAttr "tbody" bodyAttrs $ mapM_ (\a -> do
|
elDynAttr "tbody" bodyAttrs $ mapM_ (\a -> do
|
||||||
let attrs = trAttrs =<< a
|
let attrs = trAttrs =<< a
|
||||||
expanded <- elDynAttr "tr" attrs (rowSizableReified (return False) (zipDynWith (||)) col a)
|
expanded <- elDynAttr "tr" attrs (rowSizableReified (return False) (zipDynWith (||)) col a)
|
||||||
visibleVal <- gateDynamic expanded a
|
visibleVal <- gateDynamic expanded a0 a
|
||||||
elDynAttr "tr" attrs $ do
|
elDynAttr "tr" attrs $ do
|
||||||
-- TODO: possibly provide a way to customize these attributes
|
-- TODO: possibly provide a way to customize these attributes
|
||||||
let expansionTdAttrs = pure M.empty
|
let expansionTdAttrs = pure M.empty
|
||||||
@ -734,9 +735,8 @@ tableBodyExpandable colCount renderExpansion bodyAttrs trAttrs col collection =
|
|||||||
-- | Create a dynamic whose value only updates when the gate is 'True'.
|
-- | Create a dynamic whose value only updates when the gate is 'True'.
|
||||||
-- This dynamic starts out with the original value of its input
|
-- This dynamic starts out with the original value of its input
|
||||||
-- regardless of whether the gate is true or false.
|
-- regardless of whether the gate is true or false.
|
||||||
gateDynamic :: (MonadHold t m, Reflex t) => Dynamic t Bool -> Dynamic t a -> m (Dynamic t a)
|
gateDynamic :: (MonadHold t m, Reflex t) => Dynamic t Bool -> a -> Dynamic t a -> m (Dynamic t a)
|
||||||
gateDynamic g a = do
|
gateDynamic g a0 a = do
|
||||||
a0 <- sample (current a)
|
|
||||||
-- TODO: throw a nubDynWith in here
|
-- TODO: throw a nubDynWith in here
|
||||||
let e = fmapMaybe id (updated (zipDynWith (\b v -> if b then Just v else Nothing) g a))
|
let e = fmapMaybe id (updated (zipDynWith (\b v -> if b then Just v else Nothing) g a))
|
||||||
holdDyn a0 e
|
holdDyn a0 e
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user