@@ -34,7 +34,7 @@ class Bootstrap5HorizontalRenderer extends AbstractBootstrapHorizontalRenderer
3434 '.odd ' => null ,
3535 ],
3636 'control ' => [
37- 'container ' => 'div class="col col -%colsControl%" ' ,
37+ 'container ' => 'div class="col-sm -%colsControl%" ' ,
3838 '.odd ' => null ,
3939 'description ' => 'span class="form-text" ' ,
4040 'requiredsuffix ' => '' ,
@@ -74,7 +74,7 @@ public function render(Form $form, $mode = null): string
7474 && !($ control instanceof Controls \Checkbox)
7575 && !($ control instanceof Controls \CheckboxList)
7676 && !($ control instanceof Controls \RadioList)) {
77- $ control ->getLabelPrototype ()->addClass ($ this ->replacePlaceholders ('col-form-label col col -%colsLabel% ' ));
77+ $ control ->getLabelPrototype ()->addClass ($ this ->replacePlaceholders ('col-form-label col-sm -%colsLabel% ' ));
7878 }
7979
8080 switch (true ) {
@@ -92,9 +92,13 @@ public function render(Form $form, $mode = null): string
9292 break ;
9393
9494 case $ control instanceof Controls \Checkbox:
95+ $ control ->getControlPrototype ()->addClass ('form-check-input ' );
96+ $ control ->getLabelPrototype ()->addClass ('form-check-label ' );
97+ $ control ->getLabelPrototype ()->addWrapper ('div ' )->addClass ('form-check ' );
98+ break ;
9599 case $ control instanceof Controls \CheckboxList:
96100 case $ control instanceof Controls \RadioList:
97- $ control ->getSeparatorPrototype ()->setName ('div ' )->addClass ('form-check ' );
101+ $ control ->getSeparatorPrototype ()->setName ('div ' )->addClass ('form-check pt-2 ' );
98102 $ control ->getControlPrototype ()->addClass ('form-check-input ' );
99103 $ control ->getLabelPrototype ()->addClass ('form-check-label ' );
100104 break ;
@@ -107,8 +111,15 @@ public function render(Form $form, $mode = null): string
107111 public function renderLabel (IControl $ control ): Html
108112 {
109113 $ label = parent ::renderLabel ($ control );
114+
115+ if ($ control instanceof Controls \Button) {
116+ $ label ->addHtml ($ this ->replacePlaceholders ('<div class="col-sm-%colsLabel%"></div> ' ));
117+ }
118+
110119 if ($ control instanceof Controls \Checkbox || $ control instanceof Controls \CheckboxList || $ control instanceof Controls \RadioList) {
111- $ label ->addHtml ($ this ->replacePlaceholders ('<div class="col col-%colsLabel%"></div> ' ));
120+ return Html::el ('div ' )
121+ ->addClass ($ this ->replacePlaceholders ('col-form-label col-sm-%colsLabel% ' ))
122+ ->addHtml ($ label );
112123 }
113124
114125 return $ label ;
0 commit comments