npm package: @methodexists/me-schema-form
Description: me-schema-form description
Latest version: 0.3.1

# me-schema-form

Pack of components to represent data provided by [me-core](https://github.com/MethodExists/me-core).

## Usage

Describe usage.

## Examples

Provide examples.

## API

### `<Field />` props

| Prop     | Type   | Default     | Description
| -------- | ------ | ----------- | ------------
| isEnum   | bool   | `false`     | If field’s schema has `enum` property then Field will use Select component with enum values as options
| getValue | func   | `undefined` | Allows to use custom value getter. Accepts `record`, `pathPrefix`, `path`.
| * | * | * | TODO: describe the rest of the props

### Field components
#### RichEditor

```
<Field path="..." component="richEditor" />
```
Will use `me-rich-editor` to render the field.   
You may provide [`me-rich-editor` props](https://github.com/MethodExists/me-rich-editor#api) into `<Field />`:   

```
<Field path="bio" component="richEditor" onImageUpload={handleImageUpload} />
```



### `<SchemaForm />` props

| Prop                   | Type | Default | Description
|------------------------|------|---------|------------
| showSpinnerWhenLoading | bool | `true`  | Set this to false to turn off spinner on form. It’s usefult when you have a spinner on parent component
| * | * | * | TODO: describe the rest of the props

### `<AddItemModal />` props

| Prop               | Type     | Default     | Description
| ------------------ | -------- | ----------- | -------------
| `*`namespace       | string   |             |
| `*`table           | string   |             |
| primaryKey         | string   | `'id'`      |
| defaultValues      | object   | `{}`        | To prefill the record
| addItemTitle       | string   | undefined   | Text to show in button and modal titles. If undefined then 'App.generic.new' message from locales is used.
| addItemButtonProps | object   | undefined   | Override any prop in add button
| onSubmit           | func     | undefined   | Called after succesful result from the server. Provides server response as an argument
 
### `<FormFooter />` props

| Prop            | Type   | Default   | Description
|-----------------|--------|-----------|-------------
| saveButtonProps | object | undefined | Override any prop in save button
| onSubmit        | func   | undefined | Called after succesful result from the server. Provides server response as an argument
| * | * | * | TODO: describe the rest of the props

### `<Multiple />` props

| Prop       | Type     | Default     | Description
| ---------  | -------- | ----------- | -----------
| getNewItem | func     | undefined   | Recevies `record` and `path` and should return item to add into array. If undefined `{}` will be added
| * | * | * | TODO: describe the rest of the props

### `<MultipleTable />` props

| Prop       | Type     | Default     | Description
| ---------- | -------- | ----------- | -----------
| tableTitle | string   | undefined   | Set to override table title which will be read from schema by default
| getNewItem | func     | undefined   | Recevies `record` and `path` and should return item to add into array. If undefined `{}` will be added
| tableProps | object   | undefined   | Props to pass into underlying [Ant Table component](https://ant.design/components/table/#Table)
| * | * | * | TODO: describe the rest of the props

### `<ReferenceSelect />` props

| Prop          | Type   | Default  | Description
| ------------- | ------ | -------- | ------------
| filterByField | string | 'name'   | The value of that field of option will be used for filter
| * | * | * | TODO: describe the rest of the props

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for how to develop a component.