1.1.0 • Published 3 years ago

mfx-key-value-matcher v1.1.0

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

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 mf-dynamic-form@2.3.0