mfx-key-value-matcher
v1.1.0
Published
Simple condition matcher for mf-dynamic-form
Downloads
3
Readme
Field key-value 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',
value: 'test'
}),
new TextboxFormControl({
key: 'field2',
label: 'Field 2',
visibleWhen: [new KeyValueConditionMatcher('field1', "test", "EQUALS")]
})
Example with external FormGroup:
externalFormGroup = new FormGroup({
firstName: new FormControl('Ahmed'),
lastName: new FormControl(''),
});
new TextboxFormControl({
key: 'field1',
label: 'Field 1',
value: 'test'
}),
new TextboxFormControl({
key: 'field2',
label: 'Field 2',
visibleWhen: [new KeyValueConditionMatcher('firstName', "Ahmed", "EQUALS", externalFormGroup)]
})
@Since [email protected]