@@ -60,6 +60,7 @@ import { messageInstance } from "lowcoder-design/src/components/GlobalInstances"
60
60
import { styled } from "styled-components" ;
61
61
import { styleControl } from "@lowcoder-ee/comps/controls/styleControl" ;
62
62
import { AnimationStyle } from "@lowcoder-ee/comps/controls/styleControlConstants" ;
63
+ import { StringControl } from "comps/controls/codeControl" ;
63
64
64
65
const FormWrapper = styled . div `
65
66
height: 100%;
@@ -80,7 +81,8 @@ const childrenMap = {
80
81
disableSubmit : BoolCodeControl ,
81
82
loading : BoolCodeControl ,
82
83
onEvent : eventHandlerControl ( eventOptions ) ,
83
- animationStyle : styleControl ( AnimationStyle )
84
+ animationStyle : styleControl ( AnimationStyle ) ,
85
+ invalidFormMessage : StringControl
84
86
} ;
85
87
86
88
type FormProps = TriContainerViewProps &
@@ -230,6 +232,7 @@ const FormBaseComp = (function () {
230
232
{ ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
231
233
< Section name = { sectionNames . advanced } >
232
234
{ children . initialData . propertyView ( { label : trans ( "formComp.initialData" ) } ) }
235
+ { children . invalidFormMessage . propertyView ( { label : trans ( "formComp.invalidFormMessage" ) } ) }
233
236
</ Section >
234
237
) }
235
238
@@ -363,7 +366,8 @@ let FormTmpComp = class extends FormBaseComp implements IForm {
363
366
return Promise . resolve ( ) ;
364
367
} ) ;
365
368
} else {
366
- messageInstance . error ( trans ( "formComp.notValidForm" ) ) ;
369
+ const customMessage = this . children . invalidFormMessage . getView ( ) ;
370
+ messageInstance . error ( customMessage || trans ( "formComp.notValidForm" ) ) ;
367
371
return Promise . reject ( "formComp.notValidForm" ) ;
368
372
}
369
373
}
0 commit comments