@@ -28,9 +28,8 @@ import {
2828 InputEvent ,
2929} from ' @/core/models' ;
3030
31- import { values , isArray , isObject } from ' @/core/utils/helpers' ;
31+ import { isArray , isObject } from ' @/core/utils/helpers' ;
3232import { useInputEvents } from ' @/composables/input-events' ;
33- import { dynamicFormsSymbol } from ' @/useApi' ;
3433
3534const components = {
3635 TextInputComponent ,
@@ -46,9 +45,9 @@ const props = {
4645 type: Object as PropType <FormControl <InputType >>,
4746 required: true ,
4847 },
49- submited : {
48+ forceValidation : {
5049 type: Boolean ,
51- required: true ,
50+ default: false ,
5251 },
5352};
5453
@@ -65,7 +64,6 @@ export default defineComponent({
6564 props ,
6665 setup(props , { emit , slots }) {
6766 const { onFocus, onBlur } = useInputEvents (props ?.control , emit );
68- const { options } = inject (dynamicFormsSymbol );
6967
7068 let component;
7169
@@ -78,6 +76,7 @@ export default defineComponent({
7876 onFocus : (e : InputEvent ) => emit (' focus' , e ),
7977 onValidate : (validation : ValidationEvent ) =>
8078 emit (' validate' , validation ),
79+ forceValidation: props .forceValidation ,
8180 };
8281 });
8382
@@ -105,18 +104,6 @@ export default defineComponent({
105104 return [classes , props ?.control ?.customClass ];
106105 });
107106
108- const autoValidate = computed (
109- () => props ?.control ?.touched && options ?.autoValidate ,
110- );
111-
112- const errorMessages = computed (() => {
113- const errors = values (props ?.control ?.errors || {});
114- if (errors .length > 0 && (props .submited || autoValidate .value )) {
115- return errors .map (value => value .text );
116- }
117- return [];
118- });
119-
120107 function valueChange($event ) {
121108 emit (' change' , $event );
122109 }
0 commit comments