# mfx-field-presence-matcher

> Simple condition matcher for mf-dynamic-form

Latest version **2.1.1** (published 2021-10-25) · 0 weekly downloads

## Install

```sh
npm install mfx-field-presence-matcher
pnpm add mfx-field-presence-matcher
yarn add mfx-field-presence-matcher
bun add mfx-field-presence-matcher
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2021-10-25 |
| First published | 2021-10-11 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | mbtw |

## Links

- npm: https://www.npmjs.com/package/mfx-field-presence-matcher
- npm.io page: https://npm.io/package/mfx-field-presence-matcher

## Dependencies (1)

- [mf-dynamic-form](https://npm.io/package/mf-dynamic-form.md) latest

## Recent versions

- 2.1.1 (latest) — 2021-10-25
- 2.1.0 — 2021-10-25
- 2.0.0 — 2021-10-11
- 1.0.0 — 2021-10-11
- 0.0.1 — 2021-10-11

## README

### Field value presence matcher
#### mf-dynamic-form plugin

#### Usage
Use it in your dynamic-form spec in `visibleWhen`, `requiredWhen`, `disabledWhen`

#### Example:
```javascript
   new TextboxFormControl({
              key: 'field1',
              label: 'Field 1'
            }), 
   new TextboxFormControl({
      key: 'field2',
      label: 'Field 2',
      visibleWhen: [new FieldValueNotEmptyMatcher("field1")]
    })
            
```

#### Example with external FormGroup:
```javascript

    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 mf-dynamic-form@2.3.0

---
_Source: https://npm.io/package/mfx-field-presence-matcher · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
