1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
module Gargantext.Utils.ReactBootstrap where
import Effect (Effect)
import Reactix as R
import Gargantext.Prelude
import Gargantext.Utils.Reactix as R2
type OverlayTriggerProps =
(
overlay :: R.Element
, placement :: String
, trigger :: String
)
type Props =
(
)
type AlertProps =
( dismissible :: Boolean
, onClose :: Effect Unit
, variant :: String
)
type ContentProps =
(
)
type TitleProps =
(
"as" :: String
)
foreign import alertCpt :: R.Component AlertProps
foreign import overlayTriggerCpt :: R.Component OverlayTriggerProps
foreign import popoverCpt :: R.Component Props
foreign import popoverContentCpt :: R.Component ContentProps
foreign import popoverTitleCpt :: R.Component TitleProps
alert :: R2.Component AlertProps
alert = R.rawCreateElement alertCpt
overlayTrigger :: R2.Component OverlayTriggerProps
overlayTrigger = R.rawCreateElement overlayTriggerCpt
popover :: R2.Component Props
popover = R.rawCreateElement popoverCpt
popoverContent :: R2.Component ContentProps
popoverContent = R.rawCreateElement popoverContentCpt
popoverTitle :: R2.Component TitleProps
popoverTitle = R.rawCreateElement popoverTitleCpt
-- example
-- example =
-- let popover = GUB.popover {} [
-- GUB.popoverTitle { "as": "h3" } [ H.text "hello title" ]
-- , GUB.popoverContent {} [ H.div {} [ H.text "content" ] ]
-- ]
-- in GUB.overlayTrigger { overlay: popover
-- , placement: "right"
-- , trigger: "click" } [
-- H.button { className: "btn btn-default" } [ H.text "Click me" ]
-- ]