Bulma: better documentation and fix some CSS.

caa
Philippe Pittoli 2024-11-09 16:34:13 +01:00
parent d876531d23
commit 1cc6d57728
1 changed files with 40 additions and 12 deletions

View File

@ -319,6 +319,16 @@ div_field_content content
[ HH.div [HP.classes C.field ] [ HH.div [HP.classes C.control ] [ content ] ] ] [ HH.div [HP.classes C.field ] [ HH.div [HP.classes C.control ] [ content ] ] ]
-- | Basic field entry with a title and a field content. -- | Basic field entry with a title and a field content.
-- |
-- |```
-- |div [field is-horizontal]
-- | div [field-label is-normal]
-- | label [for-id]
-- | text
-- | div [field-body]
-- | div [field]
-- | div [control]
-- |```
field_entry :: forall w i. String -> String -> HH.HTML w i -> HH.HTML w i field_entry :: forall w i. String -> String -> HH.HTML w i -> HH.HTML w i
field_entry id title entry field_entry id title entry
= div_field [] = div_field []
@ -507,25 +517,43 @@ article head body = article_ [] head body
error_message :: forall w i. HH.HTML w i -> HH.HTML w i -> HH.HTML w i error_message :: forall w i. HH.HTML w i -> HH.HTML w i -> HH.HTML w i
error_message head body = article_ C.is_danger head body error_message head body = article_ C.is_danger head body
-- | Basic input field with a read-only side text.
-- |
-- |```
-- |div [field is-horizontal]
-- | div [field-label normal]
-- | label [label for-id]
-- | text
-- | div [field-body]
-- | div [has-addons field]
-- | p [control]
-- | input
-- | p [control]
-- | a [button is-small is-static]
-- | text
-- |```
input_with_side_text :: forall w i. input_with_side_text :: forall w i.
String -> String -> String -> (String -> i) -> String -> String -> HH.HTML w i String -> String -> String -> (String -> i) -> String -> String -> HH.HTML w i
input_with_side_text id title placeholder action value sidetext input_with_side_text id title placeholder action value sidetext
= HH.div [HP.classes $ C.has_addons <> C.field <> C.is_horizontal] = HH.div [HP.classes $ C.field <> C.is_horizontal]
[ HH.div [ HP.classes (C.field_label <> C.normal) ] [ HH.div [ HP.classes (C.field_label <> C.normal) ]
[HH.label [ HP.classes C.label, HP.for id ] [ HH.text title ]] [HH.label [ HP.classes C.label, HP.for id ] [ HH.text title ]]
, HH.div [ HP.classes C.field_body ] , HH.div [ HP.classes C.field_body ]
[ HH.p [HP.classes C.control] [ HH.div [ HP.classes $ C.has_addons <> C.field ]
[ HH.input $ [ HH.p [HP.classes C.control]
[ HE.onValueInput action [ HH.input $
, HP.value value [ HE.onValueInput action
, HP.placeholder placeholder , HP.value value
, HP.classes $ input_classes , HP.placeholder placeholder
, HP.id id , HP.classes $ input_classes
] , HP.id id
]
]
, HH.p [HP.classes C.control]
[ HH.a [HP.classes $ C.button <> C.is_small <> C.is_static]
[HH.text sidetext] ]
] ]
, HH.p [HP.classes C.control]
[ HH.a [HP.classes $ C.button <> C.is_small <> C.is_static]
[HH.text sidetext] ]
] ]
] ]