@tony.kay I would like to add support for toggle? and label-top? to boolean-field to be similar to boolean-control.
There is a PR but here I am posting visual differences, in case of label-top? there is better alignment.
I am not sure that fo/field-style-configs is best choice for options
fo/field-style-configs {
:client/scc {:toggle? true :label-top? true}
:client/avio {:toggle? false :label-top? true}}
So you’re talking about patching the SUI plugin?
I would consider :toggle to be a field style, on type boolean.
But, the label fix would be very nice indeed, and would apply probably to both renderings (toggle vs button vs whatever)
So, I’d say that the label position is a reasonable style config, but I’d probably call it :label-position and give it values like :inline and :above so that the concept could be used for later expansions, such as :below and :right or :left.
There is already label-top? https://github.com/fulcrologic/fulcro-rad-semantic-ui/blob/main/src/main/com/fulcrologic/rad/rendering/semantic_ui/controls/boolean_control.cljc#L13 This feature is hard to find and I am probably the only user. Can we unify field and control? Label above should be the default, but this is probably not allowed.
That’s for controls…what about form fields?
(and I did not remember that even existing :D)
well, it would be a very minor breaking change to make it the default, and I tend to agree with you. Controls are a bit more “loose” than the official options on forms and reports, so I’m not sure I would copy over a controls option to the form…The SUI plugin really isn’t meant to be the end-all for anyone, just really more of a placeholder until you write your own multimethod rendering for your stuff…so, I guess perhaps it’s ok
OK, so can we make it even simpler? Can we just silently change it to label-top without configuration options, because current misalignment is a bug. Toggle is not important for me, It might be interesting as app default. it is not RAD if you have to fine tune all checkboxes.
Sure
In RAD, if I have a standard defsc, what's the right way to render one of the prop values using the ao/style defined on the corresponding RAD model attribute?
This is my guess. I am not sure it is correct. If you look into renderers: https://github.com/fulcrologic/fulcro-rad-semantic-ui/tree/main/src/main/com/fulcrologic/rad/rendering/semantic_ui you will find form, report plumbing everywhere. So convert defsc into form to get attributes
;; bring exisitng props into form
fo/query-inclusion [{:gram (comp/get-query Pentagram)}]
fo/controls (merge {::hacker {:action (fn [this]
(gram-dlg/show-dlg (second (comp/get-ident this))))
:type :button
:label "Pentagram"}}
form/standard-controls)
fo/initialize-ui-props {:gram {}}}
And then you do a normal rendering of the defsh.
I guess you will be able to call com.fulcrologic.rad.rendering.semantic-ui.boolean-field/render-field.
(pr-str (comp/component-options this)) and (pr-str props)
could help you.Thank you for the tip, @jj974. I'll try this out shortly.