mfx-field-presence-matcher
v2.1.1
Published
Simple condition matcher for mf-dynamic-form
Downloads
4
Readme
Field value presence matcher
mf-dynamic-form plugin
Usage
Use it in your dynamic-form spec in visibleWhen
, requiredWhen
, disabledWhen
Example:
new TextboxFormControl({
key: 'field1',
label: 'Field 1'
}),
new TextboxFormControl({
key: 'field2',
label: 'Field 2',
visibleWhen: [new FieldValueNotEmptyMatcher("field1")]
})
Example with external FormGroup:
externalFormGroup = new FormGroup({
firstName: new FormControl('Ahmed')
});
new TextboxFormControl({
key: 'field1',
label: 'Field 1'
}),
new TextboxFormControl({
key: 'field2',
label: 'Field 2',
visibleWhen: [new FieldValueNotEmptyMatcher("firstName", externalFormGroup)]
})
@Since [email protected]