diff --git a/README.md b/README.md index 9bea6e8..1dafa0c 100644 --- a/README.md +++ b/README.md @@ -195,7 +195,7 @@ containers and keys or use the ones that come with the module. | | showWhen | String | Check [when-condition](https://github.com/flipbyte/when-condition) | | | | enabledWhen | String | Check [when-condition](https://github.com/flipbyte/when-condition) | | | | fieldClass | String | html class for the main html/3-rd party form field | | -| | template | React Component | String | define your custom template for the field (check `src/FieldTemplate.js`) or set the template in the template registry using `registerTemplate` and pass the string key here | +| | template | React Component | String | define your custom template for the field (check `src/Template/Default.js`) or set the template in the template registry using `registerTemplate` and pass the string key here | #### Field specific properties diff --git a/demo/src/index.js b/demo/src/index.js index 17a1c5a..0857ffa 100644 --- a/demo/src/index.js +++ b/demo/src/index.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React from 'react'; import { render } from 'react-dom'; import forms from './schema'; import ExampleFormContainer from './ExampleFormContainer'; diff --git a/demo/src/schema/basic.js b/demo/src/schema/basic.js index e66dfe5..02c5c1e 100644 --- a/demo/src/schema/basic.js +++ b/demo/src/schema/basic.js @@ -12,7 +12,14 @@ export default { renderer: "form", configSource: (formik, config) => { return new Promise((resolve, reject) => { - fetch('http://google.com') // Call the fetch function passing the url of the API as a parameter + fetch('https://jsonplaceholder.typicode.com/todos/1', + { + mode: 'cors', + headers: { + 'Access-Control-Allow-Origin': '*' + } + } + ) // Call the fetch function passing the url of the API as a parameter .then(function(data) { // Your code for handling the data you get from the API console.log(data); diff --git a/package.json b/package.json index 7d02540..7c3f8db 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,14 @@ "dependencies": { "@flipbyte/when-condition": "^0.6.0", "@flipbyte/yup-schema": "^0.1.5", + "babel": "^6.23.0", + "babel-generator": "^6.26.1", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0", "codemirror": "^5.41.0", "formik": "^1.5.2", + "jquery": "^3.4.1", + "popper.js": "^1.16.1", "react-autosuggest": "^9.4.3", "react-codemirror2": "^6.0.0", "react-dropzone": "^10.0.0", @@ -40,11 +46,11 @@ "shallowequal": "^1.1.0" }, "peerDependencies": { + "@fortawesome/fontawesome-free": "^5.6.3", "lodash": "^4.17.13", - "react": "^16.8.6", - "react-dom": "^16.8.6", "prop-types": "^15.6.2", - "@fortawesome/fontawesome-free": "^5.6.3" + "react": "^16.8.6", + "react-dom": "^16.8.6" }, "devDependencies": { "@fortawesome/fontawesome-free": "^5.6.3", diff --git a/src/Container/EditableGrid.js b/src/Container/EditableGrid.js index 29336f5..03de901 100644 --- a/src/Container/EditableGrid.js +++ b/src/Container/EditableGrid.js @@ -115,7 +115,7 @@ const EditableGrid = ({ { isObject === false && !!buttons && !!buttons.add && { _.isFunction(buttons.add) - ? buttons.add(arrayActions, arrayFields, rowIndex) + ? buttons.add(arrayActions, arrayFields) // FIXME: rowIndex error: rowIndex is not defined : (