@@ -5,6 +5,7 @@ import { defineComponent, PropType, computed, h } from 'vue';
55import TextInput from ' ../text-input/TextInput.vue' ;
66import SelectInput from ' ../select-input/SelectInput.vue' ;
77import TextAreaInput from ' ../text-area-input/TextAreaInput.vue' ;
8+ import CheckboxInput from ' ../checkbox-input/CheckboxInput.vue' ;
89
910import { FormControl } from ' ../../core/models' ;
1011import { isEmpty , entries , values , keys } from ' ../../core/utils/helpers' ;
@@ -13,6 +14,7 @@ const components = {
1314 TextInput ,
1415 SelectInput ,
1516 TextAreaInput ,
17+ CheckboxInput ,
1618};
1719
1820const props = {
@@ -32,6 +34,9 @@ export default defineComponent({
3234 return [
3335 ' dynamic-input' ,
3436 ' form-group' ,
37+ {
38+ ' form-group--inline' : props ?.control ?.type === ' checkbox' ,
39+ },
3540 {
3641 ' form-group--error' : showErrors .value ,
3742 },
@@ -103,6 +108,8 @@ export default defineComponent({
103108 };
104109 });
105110
111+ const hasLabel = computed (() => props ?.control ?.type !== ' checkbox' );
112+
106113 return () => {
107114 switch (props ?.control ?.type ) {
108115 case ' text' :
@@ -117,24 +124,29 @@ export default defineComponent({
117124 case ' textarea' :
118125 component = h (TextAreaInput , attributes .value );
119126 break ;
120-
127+ case ' checkbox' :
128+ component = h (CheckboxInput , attributes .value );
129+ break ;
121130 default :
122131 break ;
123132 }
124133 return h (
125134 ' div' ,
126135 {
127136 class: getClasses .value ,
137+ role: ' group' ,
128138 },
129139 [
130- h (
131- ' label' ,
132- {
133- class: ' form-label' ,
134- for: props ?.control ?.label ,
135- },
136- props ?.control ?.label ,
137- ),
140+ hasLabel .value
141+ ? h (
142+ ' label' ,
143+ {
144+ class: ' form-label' ,
145+ for: props ?.control ?.label ,
146+ },
147+ props ?.control ?.label ,
148+ )
149+ : null ,
138150 component ,
139151 h (
140152 ' div' ,
0 commit comments