fix(form-core): getMessage return type supports string and Element (#1756)
* fix: getMessage return type supports string and Element * Add changeset
This commit is contained in:
parent
eac75227ad
commit
0b97918d1e
2 changed files with 6 additions and 1 deletions
5
.changeset/mighty-frogs-wave.md
Normal file
5
.changeset/mighty-frogs-wave.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@lion/form-core': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Extend type of getMessage to allow it being implemented as a sync function.
|
||||||
|
|
@ -27,7 +27,7 @@ export type ValidatorParam = any;
|
||||||
* Will be stored on Validator instance and passed to `execute` function
|
* Will be stored on Validator instance and passed to `execute` function
|
||||||
*/
|
*/
|
||||||
export type ValidatorConfig = {
|
export type ValidatorConfig = {
|
||||||
getMessage?: (data: Partial<FeedbackMessageData>) => Promise<string | Element>;
|
getMessage?: (data: Partial<FeedbackMessageData>) => Promise<string | Element> | string | Element;
|
||||||
type?: ValidationType;
|
type?: ValidationType;
|
||||||
node?: FormControlHost;
|
node?: FormControlHost;
|
||||||
fieldName?: string | Promise<string>;
|
fieldName?: string | Promise<string>;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue