Bulma: introduce some fields.
parent
4522c22c42
commit
b2caff5123
|
@ -300,6 +300,7 @@ btn title action1 action2 validity
|
||||||
true -> HE.onClick \_ -> action1
|
true -> HE.onClick \_ -> action1
|
||||||
_ -> HE.onClick \_ -> action2
|
_ -> HE.onClick \_ -> action2
|
||||||
|
|
||||||
|
|
||||||
render_input password placeholder action value validity cond
|
render_input password placeholder action value validity cond
|
||||||
= HH.input $
|
= HH.input $
|
||||||
[ HE.onValueInput action
|
[ HE.onValueInput action
|
||||||
|
@ -311,15 +312,36 @@ render_input password placeholder action value validity cond
|
||||||
false -> []
|
false -> []
|
||||||
true -> [ HP.type_ HP.InputPassword ]
|
true -> [ HP.type_ HP.InputPassword ]
|
||||||
|
|
||||||
box_inner ispassword title placeholder action value validity cond
|
class_horizontal :: Array (HH.ClassName)
|
||||||
= HH.label [ ]
|
class_horizontal = [HH.ClassName "is-horizontal" ]
|
||||||
[ HH.label [HP.classes class_label ] [ HH.text title ]
|
class_normal :: Array (HH.ClassName)
|
||||||
, HH.div [HP.classes class_control ]
|
class_normal = [HH.ClassName "is-normal" ]
|
||||||
[ render_input ispassword placeholder action value validity cond ]
|
class_field :: Array (HH.ClassName)
|
||||||
]
|
class_field = [HH.ClassName "field" ]
|
||||||
|
class_field_label :: Array (HH.ClassName)
|
||||||
|
class_field_label = [HH.ClassName "field-label" ]
|
||||||
|
class_field_body :: Array (HH.ClassName)
|
||||||
|
class_field_body = [HH.ClassName "field-body" ]
|
||||||
|
|
||||||
box_input = box_inner false
|
field_inner ispassword title placeholder action value validity cond
|
||||||
box_password = box_inner true
|
= div_field
|
||||||
|
[ div_field_label title
|
||||||
|
, div_field_content $ render_input ispassword placeholder action value validity cond
|
||||||
|
]
|
||||||
|
where
|
||||||
|
div_field = HH.div [ HP.classes (class_field <> class_horizontal) ]
|
||||||
|
div_field_label title
|
||||||
|
= HH.div [ HP.classes (class_field_label <> class_normal) ]
|
||||||
|
[HH.label [ HP.classes class_label ] [ HH.text title ]]
|
||||||
|
div_field_content content
|
||||||
|
= HH.div [HP.classes class_field_body]
|
||||||
|
[ HH.div [HP.classes class_field ]
|
||||||
|
[ HH.div [HP.classes class_control ] [ content ]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
box_input = field_inner false
|
||||||
|
box_password = field_inner true
|
||||||
|
|
||||||
--box_button action value validity cond
|
--box_button action value validity cond
|
||||||
-- = HH.label [ ]
|
-- = HH.label [ ]
|
||||||
|
|
Loading…
Reference in New Issue