# Introduction

The core module containing the model to interpret Adaptive Form JSON Definition and execute rules/expressions
specified in that.

## Usage

Save it as a dependency
```
npm i --save @aemforms/af-core
```

### Create a new Form from JSON
```
import {createFormInstance} from '@aemforms/af-core';
const formJson = {..}
const form = createFormInstance(formJson)

//import data in the form
form.importData({})

//export data after form is being filled by the user
const data = form.exportData()

```

### Validate form Data

```
import {validateFormInstance} from '@aemforms/af-core';
const formJson = {..}
const data = {...}
const valid = validateFormInstance(formJson, data)
```

## Testing Local Changes

```bash
# Login to download dependencies
npm login

# Build the package
npm run build

# Link it for local testing
npm link
```

In your project that uses this package:
```bash
npm link @aemforms/af-core
```

## License

Copyright 2022 Adobe
All Rights Reserved.

NOTICE: All information contained herein is, and remains
the property of Adobe and its suppliers, if any. The intellectual
and technical concepts contained herein are proprietary to Adobe
and its suppliers and are protected by all applicable intellectual
property laws, including trade secret and copyright laws.
Dissemination of this information or reproduction of this material
is strictly forbidden unless prior written permission is obtained
from Adobe.

Adobe permits you to use and modify this file solely in accordance with
the terms of the Adobe license agreement accompanying it.
