diff --git a/dist/react-json-form.js b/dist/react-json-form.js
index 7083fa5..67dddfe 100644
--- a/dist/react-json-form.js
+++ b/dist/react-json-form.js
@@ -821,11 +821,11 @@
if (coords.length) {
addDataUsingCoords(coords, data[coord], value);
} else {
- if (Array.isArray(data)) {
- data.push(value);
+ if (Array.isArray(data[coord])) {
+ data[coord].push(value);
} else {
- if (Array.isArray(data[coord])) {
- data[coord].push(value);
+ if (Array.isArray(data)) {
+ data.push(value);
} else {
data[coord] = value;
}
diff --git a/dist/react-json-form.js.map b/dist/react-json-form.js.map
index 109c337..92cca6c 100644
--- a/dist/react-json-form.js.map
+++ b/dist/react-json-form.js.map
@@ -1 +1 @@
-{"version":3,"file":"react-json-form.js","sources":["../src/data.js","../src/components/buttons.js","../src/components/loaders.js","../src/util.js","../src/components/form.js","../src/components/containers.js","../src/ui.js","../src/form.js","../src/renderer.js","../src/index.js"],"sourcesContent":["export function getBlankObject(schema) {\n let keys = {};\n\n let schema_keys = schema.keys || schema.properties;\n\n for (let key in schema_keys) {\n let value = schema_keys[key];\n let type = value.type;\n\n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array')\n keys[key] = getBlankArray(value);\n else if (type === 'object')\n keys[key] = getBlankObject(value);\n else if (type === 'string')\n keys[key] = '';\n else if (schema.type === 'number')\n return '';\n }\n\n return keys;\n}\n\n\nexport function getBlankArray(schema) {\n let items = [];\n let type = schema.items.type;\n\n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array')\n items.push(getBlankArray(schema.items))\n else if (type === 'object')\n items.push(getBlankObject(schema.items));\n else if (type === 'string')\n items.push('');\n else if (schema.type === 'number')\n items.push('');\n\n return items;\n}\n\n\nexport function getBlankData(schema) {\n let type = schema.type;\n\n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array') {\n return getBlankArray(schema);\n }\n else if (type === 'object') {\n return getBlankObject(schema);\n } else if (type === 'string') {\n return '';\n } else if (type === 'number') {\n return '';\n }\n}\n\n\n\nfunction getSyncedArray(data, schema) {\n let newData = JSON.parse(JSON.stringify(data));\n\n let type = schema.items.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n for (let i = 0; i < data.length; i++) {\n let item = data[i];\n\n if (type === 'array') {\n newData[i] = getSyncedArray(item, schema.items);\n } else if (type === 'object') {\n newData[i] = getSyncedObject(item, schema.items);\n }\n }\n\n return newData;\n}\n\n\nfunction getSyncedObject(data, schema) {\n let newData = JSON.parse(JSON.stringify(data));\n\n let schema_keys = schema.keys || schema.properties;\n\n let keys = [...Object.keys(schema_keys)];\n\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i];\n let schemaValue = schema_keys[key];\n let type = schemaValue.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n \n if (!data.hasOwnProperty(key)) {\n if (type === 'string')\n newData[key] = '';\n else if (type === 'array')\n newData[key] = getSyncedArray([], schemaValue);\n else if (type === 'object')\n newData[key] = getSyncedObject({}, schemaValue);\n } else {\n if (type === 'string')\n newData[key] = data[key];\n else if (type === 'array')\n newData[key] = getSyncedArray(data[key], schemaValue);\n else if (type === 'object')\n newData[key] = getSyncedObject(data[key], schemaValue);\n }\n \n }\n\n return newData;\n}\n\n\nexport function getSyncedData(data, schema) {\n // adds those keys to data which are in schema but not in data\n\n let type = schema.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array') {\n return getSyncedArray(data, schema);\n } else if (type === 'object') {\n return getSyncedObject(data, schema);\n }\n\n return data;\n}\n","export default function Button({className, ...props}) {\n if (!className)\n className = '';\n\n className = 'rjf-' + className + '-button';\n return (\n \n );\n}","export default function Loader (props) {\n return
;\n}\n","export const EditorContext = React.createContext();\n\n\nexport function capitalize(string) {\n if (!string)\n return '';\n \n return string.charAt(0).toUpperCase() + string.substr(1).toLowerCase();\n}\n\n\nexport function getVerboseName(name) {\n if (name === undefined || name === null)\n return '';\n\n name = name.replace(/_/g, ' ');\n return capitalize(name);\n}\n\n\nexport function getCsrfCookie() {\n if ((document.cookie.split(';').filter((item) => item.trim().indexOf('csrftoken=') === 0)).length) {\n return document.cookie.split(';').filter((item) => item.trim().indexOf('csrftoken=') === 0)[0].split('=')[1];\n }\n return null;\n}\n","import Button from './buttons';\nimport Loader from './loaders';\nimport {EditorContext, getCsrfCookie} from '../util';\n\n\nexport function FormInput({label, help_text, error, inputRef, ...props}) {\n\n if (props.type === 'string')\n props.type = 'text'\n\n if (inputRef)\n props.ref = inputRef;\n\n return (\n \n {label && }\n \n
\n );\n}\n\n\nexport function FormCheckInput({label, help_text, error, value, ...props}) {\n\n if (!label)\n label = props.name.toUpperCase();\n\n if (props.type === 'bool')\n props.type = 'checkbox';\n\n if (props.checked === undefined)\n props.checked = value;\n\n if (props.checked === '')\n props.checked = false\n\n return (\n \n \n
\n );\n}\n\n\nexport function FormRadioInput({label, help_text, error, value, options, ...props}) {\n return (\n \n \n {options.map((option, i) => {\n let label, inputValue;\n if (typeof option === 'object') {\n label = option.label;\n inputValue = option.value;\n } else {\n label = option;\n inputValue = option;\n }\n\n return (\n \n );\n })}\n
\n );\n}\n\n\nexport function FormSelectInput({label, help_text, error, value, options, ...props}) {\n return (\n \n {label && }\n \n
\n );\n}\n\nexport function dataURItoBlob(dataURI) {\n // Split metadata from data\n const splitted = dataURI.split(\",\");\n // Split params\n const params = splitted[0].split(\";\");\n // Get mime-type from params\n const type = params[0].replace(\"data:\", \"\");\n // Filter the name property from params\n const properties = params.filter(param => {\n return param.split(\"=\")[0] === \"name\";\n });\n // Look for the name and use unknown if no name property.\n let name;\n if (properties.length !== 1) {\n name = \"unknown\";\n } else {\n // Because we filtered out the other property,\n // we only have the name case here.\n name = properties[0].split(\"=\")[1];\n }\n\n // Built the Uint8Array Blob parameter from the base64 string.\n const binary = atob(splitted[1]);\n const array = [];\n for (let i = 0; i < binary.length; i++) {\n array.push(binary.charCodeAt(i));\n }\n // Create the blob object\n const blob = new window.Blob([new Uint8Array(array)], { type });\n\n return {blob, name};\n}\n\n\n\nexport class FormFileInput extends React.Component {\n static contextType = EditorContext;\n\n constructor(props) {\n super(props);\n\n this.state = {\n value: props.value,\n fileName: this.getFileName(),\n loading: false\n };\n\n this.inputRef = React.createRef();\n }\n\n componentDidUpdate(prevProps, prevState) {\n if (this.props.value !== prevProps.value) {\n this.setState({\n value: this.props.value, \n fileName: this.getFileName()\n });\n }\n }\n\n getFileName = () => {\n if (!this.props.value)\n return '';\n\n if (this.props.type === 'data-url') {\n return this.extractFileInfo(this.props.value).name;\n } else if (this.props.type === 'file-url') {\n return this.props.value;\n } else {\n return 'Unknown file';\n }\n }\n\n extractFileInfo = (dataURL) => {\n const {blob, name} = dataURItoBlob(dataURL);\n return {\n name: name,\n size: blob.size,\n type: blob.type\n }\n }\n\n addNameToDataURL = (dataURL, name) => {\n return dataURL.replace(';base64', ';name=' + encodeURIComponent(name) + ';base64');\n }\n\n handleChange = (e) => {\n if (this.props.type === 'data-url') {\n let file = e.target.files[0];\n let fileName = file.name\n\n let reader = new FileReader();\n\n reader.onload = () => {\n\n // this.setState({src: reader.result});\n\n // we create a fake event object\n let event = {\n target: {\n type: 'text',\n value: this.addNameToDataURL(reader.result, fileName),\n name: this.props.name\n }\n };\n\n this.props.onChange(event);\n\n }\n reader.readAsDataURL(file);\n } else if (this.props.type === 'file-url') {\n let endpoint = this.context.fileUploadEndpoint;\n if (!endpoint) {\n console.error(\n \"Error: fileUploadEndpoint option need to be passed \"\n + \"while initializing editor for enabling file uploads.\");\n alert(\"Files can't be uploaded.\");\n return;\n }\n\n this.setState({loading: true});\n\n let formData = new FormData();\n formData.append('field_name', this.context.fieldName);\n formData.append('model_name', this.context.modelName);\n formData.append('coordinates', JSON.stringify(this.props.name.split('-').slice(1)));\n formData.append('file', e.target.files[0]);\n\n fetch(endpoint, {\n method: 'POST',\n headers: {\n 'X-CSRFToken': getCsrfCookie(),\n },\n body: formData\n })\n .then((response) => response.json())\n .then((result) => {\n // we create a fake event object\n let event = {\n target: {\n type: 'text',\n value: result.file_path,\n name: this.props.name\n }\n };\n\n this.props.onChange(event);\n this.setState({loading: false});\n })\n .catch((error) => {\n alert('Something went wrong while uploading file');\n console.error('Error:', error);\n this.setState({loading: false});\n });\n\n }\n\n }\n\n showFileBrowser = () => {\n this.inputRef.current.click();\n }\n\n render() {\n let {label, value, ...props} = {value, ...this.props};\n props.type = 'file';\n props.onChange = this.handleChange;\n\n return (\n \n {label &&
}\n
\n {this.state.value && \n
Current file: {this.state.fileName}
\n }\n {this.state.value && !this.state.loading && 'Change:'}\n {this.state.loading ?\n
Uploading...
\n : \n
\n \n
\n }\n
\n
\n );\n }\n}\n","import Button from './buttons';\n\n\nexport function GroupTitle(props) {\n if (!props.children)\n return null;\n\n return (\n {props.children}
\n );\n}\n\n\nexport function FormRow(props) {\n return (\n \n {props.onRemove &&\n
\n }\n
\n {props.children}\n
\n
\n );\n}\n\n\nexport function FormGroup(props) {\n let hasChildren = React.Children.count(props.children);\n\n let innerClassName = props.level === 0 && !hasChildren\n ? \"\" \n : \"rjf-form-group-inner\";\n\n return (\n \n {props.level === 0 &&
{props.schema.title}}\n
\n {props.level > 0 && {props.schema.title}}\n {props.children}\n {props.addable && \n \n }\n
\n
\n );\n}\n","import {getBlankData} from './data';\nimport {Button, FormInput, FormCheckInput, FormRadioInput, FormSelectInput,\n FormFileInput, FormRow, FormGroup} from './components';\nimport {getVerboseName} from './util';\n\n\nfunction handleChange(e, valueType, callback) {\n let type = e.target.type\n let value;\n\n if (type === 'checkbox') {\n value = e.target.checked;\n } else {\n value = e.target.value;\n }\n\n if (valueType === 'number') {\n value = value.trim();\n if (value !== '' && !isNaN(Number(value)))\n value = Number(value);\n }\n\n callback(e.target.name, value);\n}\n\n\nfunction FormField(props) {\n let inputProps = {\n name: props.name,\n value: props.data,\n };\n\n let type = props.schema.type;\n if (props.schema.choices) {\n inputProps.options = props.schema.choices;\n type = 'select';\n }\n if (props.schema.widget)\n type = props.schema.widget;\n\n let InputField;\n\n switch (type) {\n case 'string':\n InputField = FormInput;\n\n if (props.schema.format) {\n if (props.schema.format === 'data-url' || props.schema.format === 'file-url') {\n InputField = FormFileInput;\n }\n inputProps.type = props.schema.format;\n }\n else {\n inputProps.type = 'text';\n }\n break;\n case 'number':\n inputProps.type = 'number';\n InputField = FormInput;\n break;\n case 'integer':\n inputProps.type = 'number';\n InputField = FormInput;\n break;\n case 'boolean':\n inputProps.type = 'checkbox';\n InputField = FormCheckInput;\n break;\n case 'checkbox':\n inputProps.type = 'checkbox';\n InputField = FormCheckInput;\n break;\n case 'radio':\n inputProps.type = 'radio';\n InputField = FormRadioInput;\n break;\n case 'select':\n InputField = FormSelectInput;\n break;\n default:\n inputProps.type = 'text';\n InputField = FormInput;\n }\n\n return (\n {props.schema.title} \n :\n props.schema.title\n }\n onChange={(e) => handleChange(e, props.schema.type, props.onChange)}\n />\n );\n}\n\n\nexport function getStringFormRow(data, schema, name, onChange, onRemove, removable, onEdit, editable) {\n\n return (\n onRemove(name) : null}\n >\n \n \n );\n}\n\nexport function getArrayFormRow(data, schema, name, onChange, onAdd, onRemove, level) {\n let rows = [];\n let groups = [];\n\n let removable = true;\n let min_items = schema.min_items || schema.minItems || 0;\n if (data.length <= min_items)\n removable = false;\n\n let addable = true;\n let max_items = schema.max_items || schema.maxItems || 100;\n if (data.length >= max_items)\n addable = false;\n\n let type = schema.items.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n for (let i = 0; i < data.length; i++) {\n let item = data[i];\n let childName = name + '-' + i;\n\n if (type === 'array') {\n groups.push(getArrayFormRow(item, schema.items, childName, onChange, onAdd, onRemove, level + 1));\n } else if (type === 'object') {\n groups.push(getObjectFormRow(item, schema.items, childName, onChange, onAdd, onRemove, level + 1));\n } else {\n rows.push(getStringFormRow(item, schema.items, childName, onChange, onRemove, removable));\n } \n }\n\n let coords = name; // coordinates for insertion and deletion\n\n if (rows.length || (!rows.length && !groups.length)) {\n rows = (\n onAdd(getBlankData(schema.items), coords)}\n key={'row_group_' + name}\n >\n {rows}\n \n );\n }\n\n if (groups.length) {\n let groupTitle = schema.title ? {schema.title}
: null;\n\n groups = (\n \n {groupTitle}\n {groups.map((i, index) => (\n
\n {removable && \n \n }\n {i}\n
\n )\n )}\n {addable && \n
\n }\n
\n )\n }\n\n return [...rows, ...groups];\n}\n\n\nexport function getObjectFormRow(data, schema, name, onChange, onAdd, onRemove, level) {\n let rows = [];\n\n schema_keys = schema.keys || schema.properties;\n\n let keys = [...Object.keys(schema_keys)];\n\n if (schema.additionalProperties)\n keys = [...keys, ...Object.keys(data).filter((k) => keys.indexOf(k) === -1)];\n\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i];\n let value = data[key];\n let childName = name + '-' + key;\n let schemaValue = schema_keys[key] || {type: 'string'};\n\n let type = schemaValue.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (!schemaValue.title)\n schemaValue.title = getVerboseName(key);\n\n let removable = false;\n if (schema_keys[key] === undefined)\n removable = true;\n\n if (type === 'array') {\n rows.push(getArrayFormRow(value, schemaValue, childName, onChange, onAdd, onRemove, level + 1));\n } else if (type === 'object') {\n rows.push(getObjectFormRow(value, schemaValue, childName, onChange, onAdd, onRemove, level + 1));\n } else {\n rows.push(getStringFormRow(\n value, schemaValue, childName, onChange, onRemove, removable, \n () => handleKeyEdit(data, key, value, childName, onAdd, onRemove),\n removable\n ));\n }\n }\n\n if (rows.length || schema.additionalProperties) {\n let className = \"rjf-form-group-inner\";\n if (level === 0 && !rows.length)\n className = \"\";\n \n let coords = name;\n\n rows = (\n handleKeyValueAdd(data, coords, onAdd)}\n key={'row_group_' + name}\n >\n {rows}\n \n );\n }\n\n return rows;\n}\n\n\nfunction handleKeyValueAdd(data, coords, onAdd) {\n let key = prompt(\"Add new key\");\n if (key === null) // clicked cancel\n return;\n\n key = key.trim();\n if (!key)\n alert(\"(!) Can't add empty key.\\r\\n\\r\\n\");\n else if (data.hasOwnProperty(key))\n alert(\"(!) Duplicate keys not allowed. This key already exists.\\r\\n\\r\\n\");\n else\n onAdd(\"\", coords + '-' + key); \n}\n\n\nfunction handleKeyEdit(data, key, value, coords, onAdd, onRemove) {\n let newKey = prompt(\"Rename key\", key);\n if (newKey === null) // clicked cancel\n return;\n\n newKey = newKey.trim();\n\n if (newKey === key) // same keys\n return;\n\n if (!newKey)\n return alert(\"(!) Key name can't be empty.\\r\\n\\r\\n\");\n else if (data.hasOwnProperty(newKey))\n return alert(\"(!) Duplicate keys not allowed. This key already exists.\\r\\n\\r\\n\");\n\n onAdd(value, name + '-' + newKey);\n onRemove(coords);\n}\n","import {getBlankData, getSyncedData} from './data';\nimport {getArrayFormRow, getObjectFormRow} from './ui';\nimport {EditorContext} from './util';\n\n\nexport default class Form extends React.Component {\n constructor(props) {\n super(props);\n\n this.dataInput = document.getElementById(this.props.dataInputId);\n this.schema = props.schema;\n\n let data = props.data;\n\n if (!data) {\n // create empty data from schema\n data = getBlankData(this.schema);\n } else {\n // data might be stale if schema has new keys, so add them to data\n try {\n data = getSyncedData(data, this.schema);\n } catch (error) {\n console.log(\"Error: Schema and data don't match\");\n console.log(error);\n }\n }\n\n this.state = {\n value: '',\n data: data\n };\n \n // update data in the input\n this.populateDataInput();\n }\n\n componentDidUpdate(prevProps, prevState) {\n if (this.state.data !== prevState.data) {\n this.populateDataInput();\n }\n }\n\n populateDataInput = () => {\n this.dataInput.value = JSON.stringify(this.state.data);\n }\n\n handleChange = (coords, value) => {\n /*\n e.target.name is a chain of indices and keys:\n xxx-0-key-1-key2 and so on.\n These can be used as coordinates to locate \n a particular deeply nested item.\n\n This first coordinate is not important and should be removed.\n */\n coords = coords.split('-');\n\n coords.shift(); // remove first coord\n\n function setDataUsingCoords(coords, data, value) {\n let coord = coords.shift();\n if (!isNaN(Number(coord)))\n coord = Number(coord);\n\n if (coords.length) {\n setDataUsingCoords(coords, data[coord], value);\n } else {\n data[coord] = value;\n }\n }\n\n let _data = JSON.parse(JSON.stringify(this.state.data));\n\n setDataUsingCoords(coords, _data, value);\n\n this.setState({data: _data});\n }\n\n getFields = () => {\n let data = this.state.data;\n let formGroups = [];\n\n try {\n let type = this.schema.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array') {\n return getArrayFormRow(\n data, this.schema, 'rjf',\n this.handleChange, this.addFieldset, this.removeFieldset,\n 0\n );\n } else if (type === 'object') {\n return getObjectFormRow(\n data, this.schema, 'rjf',\n this.handleChange, this.addFieldset, this.removeFieldset,\n 0\n );\n }\n } catch (error) {\n formGroups = (\n \n (!) Error: Schema and data do not match.\n
\n );\n }\n\n return formGroups;\n }\n\n addFieldset = (blankData, coords) => {\n coords = coords.split('-');\n coords.shift();\n\n this.setState((state) => {\n function addDataUsingCoords(coords, data, value) {\n let coord = coords.shift();\n if (!isNaN(Number(coord)))\n coord = Number(coord);\n\n if (coords.length) {\n addDataUsingCoords(coords, data[coord], value);\n } else {\n if (Array.isArray(data)) {\n data.push(value);\n }\n else {\n if (Array.isArray(data[coord])) {\n data[coord].push(value);\n } else {\n data[coord] = value;\n }\n }\n }\n }\n\n let _data = JSON.parse(JSON.stringify(state.data));\n\n addDataUsingCoords(coords, _data, blankData);\n\n return {data: _data};\n });\n }\n\n removeFieldset = (coords) => {\n coords = coords.split('-');\n coords.shift();\n\n this.setState((state) => {\n function removeDataUsingCoords(coords, data) {\n let coord = coords.shift();\n if (!isNaN(Number(coord)))\n coord = Number(coord);\n\n if (coords.length) {\n removeDataUsingCoords(coords, data[coord]);\n } else {\n if (Array.isArray(data))\n data = data.splice(coord, 1); // in-place mutation\n else\n delete data[coord];\n }\n }\n\n let _data = JSON.parse(JSON.stringify(state.data));\n\n removeDataUsingCoords(coords, _data);\n\n return {data: _data};\n });\n }\n\n render() {\n return (\n \n
\n \n );\n }\n}\n","import Form from './form';\n\n\nexport default function JSONForm(config) {\n this.containerId = config.containerId;\n this.dataInputId = config.dataInputId;\n this.schema = config.schema;\n this.data = config.data;\n this.fileUploadEndpoint = config.fileUploadEndpoint;\n this.fieldName = config.fieldName;\n this.modelName = config.modelName;\n\n this.render = function() {\n ReactDOM.render(\n ,\n document.getElementById(this.containerId)\n );\n }\n}","import JSONForm from './renderer';\n\n\nexport default {\n JSONForm,\n};"],"names":["getBlankObject","schema","keys","schema_keys","properties","key","value","type","getBlankArray","items","push","getBlankData","getSyncedArray","data","newData","JSON","parse","stringify","i","length","item","getSyncedObject","Object","schemaValue","hasOwnProperty","getSyncedData","Button","className","props","children","Loader","EditorContext","React","createContext","capitalize","string","charAt","toUpperCase","substr","toLowerCase","getVerboseName","name","undefined","replace","getCsrfCookie","document","cookie","split","filter","trim","indexOf","FormInput","label","inputRef","ref","FormCheckInput","checked","FormRadioInput","options","map","option","inputValue","FormSelectInput","dataURItoBlob","dataURI","splitted","params","param","binary","atob","array","charCodeAt","blob","window","Blob","Uint8Array","FormFileInput","getFileName","extractFileInfo","dataURL","size","addNameToDataURL","encodeURIComponent","handleChange","e","file","target","files","fileName","reader","FileReader","onload","event","result","onChange","readAsDataURL","endpoint","context","fileUploadEndpoint","console","error","alert","setState","loading","formData","FormData","append","fieldName","modelName","slice","fetch","method","headers","body","then","response","json","file_path","showFileBrowser","current","click","state","createRef","componentDidUpdate","prevProps","prevState","render","Component","contextType","GroupTitle","FormRow","onRemove","FormGroup","hasChildren","Children","count","innerClassName","level","title","addable","onAdd","valueType","callback","isNaN","Number","FormField","inputProps","choices","widget","InputField","format","editable","onEdit","getStringFormRow","removable","getArrayFormRow","rows","groups","min_items","minItems","max_items","maxItems","childName","getObjectFormRow","coords","groupTitle","index","additionalProperties","k","handleKeyEdit","handleKeyValueAdd","prompt","newKey","Form","populateDataInput","dataInput","shift","setDataUsingCoords","coord","_data","getFields","formGroups","addFieldset","removeFieldset","color","blankData","addDataUsingCoords","Array","isArray","removeDataUsingCoords","splice","getElementById","dataInputId","log","J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AAA,KAAK,EAAE;EACH5B,QAAAA,kBAAkB,EAAE,KAAKtE,KAAL,CAAWsE,kBAD5B;EAEHS,QAAAA,SAAS,EAAE,KAAK/E,KAAL,CAAW+E,SAFnB;EAGHC,QAAAA,SAAS,EAAE,KAAKhF,KAAL,CAAWgF;EAHnB;EADX,OAOC,KAAKwE,SAAL,EAPD,CADJ,CADJ,CADJ;EAeH;;;IA3L6BpJ,KAAK,CAAC+F;;ECFzB,SAASmE,QAAT,CAAkBC,MAAlB,EAA0B;EACrC,OAAKC,WAAL,GAAmBD,MAAM,CAACC,WAA1B;EACA,OAAKJ,WAAL,GAAmBG,MAAM,CAACH,WAA1B;EACA,OAAK/L,MAAL,GAAckM,MAAM,CAAClM,MAArB;EACA,OAAKY,IAAL,GAAYsL,MAAM,CAACtL,IAAnB;EACA,OAAKqF,kBAAL,GAA0BiG,MAAM,CAACjG,kBAAjC;EACA,OAAKS,SAAL,GAAiBwF,MAAM,CAACxF,SAAxB;EACA,OAAKC,SAAL,GAAiBuF,MAAM,CAACvF,SAAxB;;EAEA,OAAKkB,MAAL,GAAc,YAAW;EACrBuE,IAAAA,QAAQ,CAACvE,MAAT,eACI,oBAAC,IAAD;EACI,MAAA,MAAM,EAAE,KAAK7H,MADjB;EAEI,MAAA,WAAW,EAAE,KAAK+L,WAFtB;EAGI,MAAA,IAAI,EAAE,KAAKnL,IAHf;EAII,MAAA,kBAAkB,EAAE,KAAKqF,kBAJ7B;EAKI,MAAA,SAAS,EAAE,KAAKS,SALpB;EAMI,MAAA,SAAS,EAAE,KAAKC;EANpB,MADJ,EASI/D,QAAQ,CAACkJ,cAAT,CAAwB,KAAKK,WAA7B,CATJ;EAWH,GAZD;EAaH;;ACtBD,cAAe;EACbF,EAAAA,QAAQ,EAARA;EADa,CAAf;;;;;;;;"}
\ No newline at end of file
+{"version":3,"file":"react-json-form.js","sources":["../src/data.js","../src/components/buttons.js","../src/components/loaders.js","../src/util.js","../src/components/form.js","../src/components/containers.js","../src/ui.js","../src/form.js","../src/renderer.js","../src/index.js"],"sourcesContent":["export function getBlankObject(schema) {\n let keys = {};\n\n let schema_keys = schema.keys || schema.properties;\n\n for (let key in schema_keys) {\n let value = schema_keys[key];\n let type = value.type;\n\n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array')\n keys[key] = getBlankArray(value);\n else if (type === 'object')\n keys[key] = getBlankObject(value);\n else if (type === 'string')\n keys[key] = '';\n else if (schema.type === 'number')\n return '';\n }\n\n return keys;\n}\n\n\nexport function getBlankArray(schema) {\n let items = [];\n let type = schema.items.type;\n\n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array')\n items.push(getBlankArray(schema.items))\n else if (type === 'object')\n items.push(getBlankObject(schema.items));\n else if (type === 'string')\n items.push('');\n else if (schema.type === 'number')\n items.push('');\n\n return items;\n}\n\n\nexport function getBlankData(schema) {\n let type = schema.type;\n\n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array') {\n return getBlankArray(schema);\n }\n else if (type === 'object') {\n return getBlankObject(schema);\n } else if (type === 'string') {\n return '';\n } else if (type === 'number') {\n return '';\n }\n}\n\n\n\nfunction getSyncedArray(data, schema) {\n let newData = JSON.parse(JSON.stringify(data));\n\n let type = schema.items.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n for (let i = 0; i < data.length; i++) {\n let item = data[i];\n\n if (type === 'array') {\n newData[i] = getSyncedArray(item, schema.items);\n } else if (type === 'object') {\n newData[i] = getSyncedObject(item, schema.items);\n }\n }\n\n return newData;\n}\n\n\nfunction getSyncedObject(data, schema) {\n let newData = JSON.parse(JSON.stringify(data));\n\n let schema_keys = schema.keys || schema.properties;\n\n let keys = [...Object.keys(schema_keys)];\n\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i];\n let schemaValue = schema_keys[key];\n let type = schemaValue.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n \n if (!data.hasOwnProperty(key)) {\n if (type === 'string')\n newData[key] = '';\n else if (type === 'array')\n newData[key] = getSyncedArray([], schemaValue);\n else if (type === 'object')\n newData[key] = getSyncedObject({}, schemaValue);\n } else {\n if (type === 'string')\n newData[key] = data[key];\n else if (type === 'array')\n newData[key] = getSyncedArray(data[key], schemaValue);\n else if (type === 'object')\n newData[key] = getSyncedObject(data[key], schemaValue);\n }\n \n }\n\n return newData;\n}\n\n\nexport function getSyncedData(data, schema) {\n // adds those keys to data which are in schema but not in data\n\n let type = schema.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array') {\n return getSyncedArray(data, schema);\n } else if (type === 'object') {\n return getSyncedObject(data, schema);\n }\n\n return data;\n}\n","export default function Button({className, ...props}) {\n if (!className)\n className = '';\n\n className = 'rjf-' + className + '-button';\n return (\n \n );\n}","export default function Loader (props) {\n return ;\n}\n","export const EditorContext = React.createContext();\n\n\nexport function capitalize(string) {\n if (!string)\n return '';\n \n return string.charAt(0).toUpperCase() + string.substr(1).toLowerCase();\n}\n\n\nexport function getVerboseName(name) {\n if (name === undefined || name === null)\n return '';\n\n name = name.replace(/_/g, ' ');\n return capitalize(name);\n}\n\n\nexport function getCsrfCookie() {\n if ((document.cookie.split(';').filter((item) => item.trim().indexOf('csrftoken=') === 0)).length) {\n return document.cookie.split(';').filter((item) => item.trim().indexOf('csrftoken=') === 0)[0].split('=')[1];\n }\n return null;\n}\n","import Button from './buttons';\nimport Loader from './loaders';\nimport {EditorContext, getCsrfCookie} from '../util';\n\n\nexport function FormInput({label, help_text, error, inputRef, ...props}) {\n\n if (props.type === 'string')\n props.type = 'text'\n\n if (inputRef)\n props.ref = inputRef;\n\n return (\n \n {label && }\n \n
\n );\n}\n\n\nexport function FormCheckInput({label, help_text, error, value, ...props}) {\n\n if (!label)\n label = props.name.toUpperCase();\n\n if (props.type === 'bool')\n props.type = 'checkbox';\n\n if (props.checked === undefined)\n props.checked = value;\n\n if (props.checked === '')\n props.checked = false\n\n return (\n \n \n
\n );\n}\n\n\nexport function FormRadioInput({label, help_text, error, value, options, ...props}) {\n return (\n \n \n {options.map((option, i) => {\n let label, inputValue;\n if (typeof option === 'object') {\n label = option.label;\n inputValue = option.value;\n } else {\n label = option;\n inputValue = option;\n }\n\n return (\n \n );\n })}\n
\n );\n}\n\n\nexport function FormSelectInput({label, help_text, error, value, options, ...props}) {\n return (\n \n {label && }\n \n
\n );\n}\n\nexport function dataURItoBlob(dataURI) {\n // Split metadata from data\n const splitted = dataURI.split(\",\");\n // Split params\n const params = splitted[0].split(\";\");\n // Get mime-type from params\n const type = params[0].replace(\"data:\", \"\");\n // Filter the name property from params\n const properties = params.filter(param => {\n return param.split(\"=\")[0] === \"name\";\n });\n // Look for the name and use unknown if no name property.\n let name;\n if (properties.length !== 1) {\n name = \"unknown\";\n } else {\n // Because we filtered out the other property,\n // we only have the name case here.\n name = properties[0].split(\"=\")[1];\n }\n\n // Built the Uint8Array Blob parameter from the base64 string.\n const binary = atob(splitted[1]);\n const array = [];\n for (let i = 0; i < binary.length; i++) {\n array.push(binary.charCodeAt(i));\n }\n // Create the blob object\n const blob = new window.Blob([new Uint8Array(array)], { type });\n\n return {blob, name};\n}\n\n\n\nexport class FormFileInput extends React.Component {\n static contextType = EditorContext;\n\n constructor(props) {\n super(props);\n\n this.state = {\n value: props.value,\n fileName: this.getFileName(),\n loading: false\n };\n\n this.inputRef = React.createRef();\n }\n\n componentDidUpdate(prevProps, prevState) {\n if (this.props.value !== prevProps.value) {\n this.setState({\n value: this.props.value, \n fileName: this.getFileName()\n });\n }\n }\n\n getFileName = () => {\n if (!this.props.value)\n return '';\n\n if (this.props.type === 'data-url') {\n return this.extractFileInfo(this.props.value).name;\n } else if (this.props.type === 'file-url') {\n return this.props.value;\n } else {\n return 'Unknown file';\n }\n }\n\n extractFileInfo = (dataURL) => {\n const {blob, name} = dataURItoBlob(dataURL);\n return {\n name: name,\n size: blob.size,\n type: blob.type\n }\n }\n\n addNameToDataURL = (dataURL, name) => {\n return dataURL.replace(';base64', ';name=' + encodeURIComponent(name) + ';base64');\n }\n\n handleChange = (e) => {\n if (this.props.type === 'data-url') {\n let file = e.target.files[0];\n let fileName = file.name\n\n let reader = new FileReader();\n\n reader.onload = () => {\n\n // this.setState({src: reader.result});\n\n // we create a fake event object\n let event = {\n target: {\n type: 'text',\n value: this.addNameToDataURL(reader.result, fileName),\n name: this.props.name\n }\n };\n\n this.props.onChange(event);\n\n }\n reader.readAsDataURL(file);\n } else if (this.props.type === 'file-url') {\n let endpoint = this.context.fileUploadEndpoint;\n if (!endpoint) {\n console.error(\n \"Error: fileUploadEndpoint option need to be passed \"\n + \"while initializing editor for enabling file uploads.\");\n alert(\"Files can't be uploaded.\");\n return;\n }\n\n this.setState({loading: true});\n\n let formData = new FormData();\n formData.append('field_name', this.context.fieldName);\n formData.append('model_name', this.context.modelName);\n formData.append('coordinates', JSON.stringify(this.props.name.split('-').slice(1)));\n formData.append('file', e.target.files[0]);\n\n fetch(endpoint, {\n method: 'POST',\n headers: {\n 'X-CSRFToken': getCsrfCookie(),\n },\n body: formData\n })\n .then((response) => response.json())\n .then((result) => {\n // we create a fake event object\n let event = {\n target: {\n type: 'text',\n value: result.file_path,\n name: this.props.name\n }\n };\n\n this.props.onChange(event);\n this.setState({loading: false});\n })\n .catch((error) => {\n alert('Something went wrong while uploading file');\n console.error('Error:', error);\n this.setState({loading: false});\n });\n\n }\n\n }\n\n showFileBrowser = () => {\n this.inputRef.current.click();\n }\n\n render() {\n let {label, value, ...props} = {value, ...this.props};\n props.type = 'file';\n props.onChange = this.handleChange;\n\n return (\n \n {label &&
}\n
\n {this.state.value && \n
Current file: {this.state.fileName}
\n }\n {this.state.value && !this.state.loading && 'Change:'}\n {this.state.loading ?\n
Uploading...
\n : \n
\n \n
\n }\n
\n
\n );\n }\n}\n","import Button from './buttons';\n\n\nexport function GroupTitle(props) {\n if (!props.children)\n return null;\n\n return (\n {props.children}
\n );\n}\n\n\nexport function FormRow(props) {\n return (\n \n {props.onRemove &&\n
\n }\n
\n {props.children}\n
\n
\n );\n}\n\n\nexport function FormGroup(props) {\n let hasChildren = React.Children.count(props.children);\n\n let innerClassName = props.level === 0 && !hasChildren\n ? \"\" \n : \"rjf-form-group-inner\";\n\n return (\n \n {props.level === 0 &&
{props.schema.title}}\n
\n {props.level > 0 && {props.schema.title}}\n {props.children}\n {props.addable && \n \n }\n
\n
\n );\n}\n","import {getBlankData} from './data';\nimport {Button, FormInput, FormCheckInput, FormRadioInput, FormSelectInput,\n FormFileInput, FormRow, FormGroup} from './components';\nimport {getVerboseName} from './util';\n\n\nfunction handleChange(e, valueType, callback) {\n let type = e.target.type\n let value;\n\n if (type === 'checkbox') {\n value = e.target.checked;\n } else {\n value = e.target.value;\n }\n\n if (valueType === 'number') {\n value = value.trim();\n if (value !== '' && !isNaN(Number(value)))\n value = Number(value);\n }\n\n callback(e.target.name, value);\n}\n\n\nfunction FormField(props) {\n let inputProps = {\n name: props.name,\n value: props.data,\n };\n\n let type = props.schema.type;\n if (props.schema.choices) {\n inputProps.options = props.schema.choices;\n type = 'select';\n }\n if (props.schema.widget)\n type = props.schema.widget;\n\n let InputField;\n\n switch (type) {\n case 'string':\n InputField = FormInput;\n\n if (props.schema.format) {\n if (props.schema.format === 'data-url' || props.schema.format === 'file-url') {\n InputField = FormFileInput;\n }\n inputProps.type = props.schema.format;\n }\n else {\n inputProps.type = 'text';\n }\n break;\n case 'number':\n inputProps.type = 'number';\n InputField = FormInput;\n break;\n case 'integer':\n inputProps.type = 'number';\n InputField = FormInput;\n break;\n case 'boolean':\n inputProps.type = 'checkbox';\n InputField = FormCheckInput;\n break;\n case 'checkbox':\n inputProps.type = 'checkbox';\n InputField = FormCheckInput;\n break;\n case 'radio':\n inputProps.type = 'radio';\n InputField = FormRadioInput;\n break;\n case 'select':\n InputField = FormSelectInput;\n break;\n default:\n inputProps.type = 'text';\n InputField = FormInput;\n }\n\n return (\n {props.schema.title} \n :\n props.schema.title\n }\n onChange={(e) => handleChange(e, props.schema.type, props.onChange)}\n />\n );\n}\n\n\nexport function getStringFormRow(data, schema, name, onChange, onRemove, removable, onEdit, editable) {\n\n return (\n onRemove(name) : null}\n >\n \n \n );\n}\n\nexport function getArrayFormRow(data, schema, name, onChange, onAdd, onRemove, level) {\n let rows = [];\n let groups = [];\n\n let removable = true;\n let min_items = schema.min_items || schema.minItems || 0;\n if (data.length <= min_items)\n removable = false;\n\n let addable = true;\n let max_items = schema.max_items || schema.maxItems || 100;\n if (data.length >= max_items)\n addable = false;\n\n let type = schema.items.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n for (let i = 0; i < data.length; i++) {\n let item = data[i];\n let childName = name + '-' + i;\n\n if (type === 'array') {\n groups.push(getArrayFormRow(item, schema.items, childName, onChange, onAdd, onRemove, level + 1));\n } else if (type === 'object') {\n groups.push(getObjectFormRow(item, schema.items, childName, onChange, onAdd, onRemove, level + 1));\n } else {\n rows.push(getStringFormRow(item, schema.items, childName, onChange, onRemove, removable));\n } \n }\n\n let coords = name; // coordinates for insertion and deletion\n\n if (rows.length || (!rows.length && !groups.length)) {\n rows = (\n onAdd(getBlankData(schema.items), coords)}\n key={'row_group_' + name}\n >\n {rows}\n \n );\n }\n\n if (groups.length) {\n let groupTitle = schema.title ? {schema.title}
: null;\n\n groups = (\n \n {groupTitle}\n {groups.map((i, index) => (\n
\n {removable && \n \n }\n {i}\n
\n )\n )}\n {addable && \n
\n }\n
\n )\n }\n\n return [...rows, ...groups];\n}\n\n\nexport function getObjectFormRow(data, schema, name, onChange, onAdd, onRemove, level) {\n let rows = [];\n\n schema_keys = schema.keys || schema.properties;\n\n let keys = [...Object.keys(schema_keys)];\n\n if (schema.additionalProperties)\n keys = [...keys, ...Object.keys(data).filter((k) => keys.indexOf(k) === -1)];\n\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i];\n let value = data[key];\n let childName = name + '-' + key;\n let schemaValue = schema_keys[key] || {type: 'string'};\n\n let type = schemaValue.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (!schemaValue.title)\n schemaValue.title = getVerboseName(key);\n\n let removable = false;\n if (schema_keys[key] === undefined)\n removable = true;\n\n if (type === 'array') {\n rows.push(getArrayFormRow(value, schemaValue, childName, onChange, onAdd, onRemove, level + 1));\n } else if (type === 'object') {\n rows.push(getObjectFormRow(value, schemaValue, childName, onChange, onAdd, onRemove, level + 1));\n } else {\n rows.push(getStringFormRow(\n value, schemaValue, childName, onChange, onRemove, removable, \n () => handleKeyEdit(data, key, value, childName, onAdd, onRemove),\n removable\n ));\n }\n }\n\n if (rows.length || schema.additionalProperties) {\n let className = \"rjf-form-group-inner\";\n if (level === 0 && !rows.length)\n className = \"\";\n \n let coords = name;\n\n rows = (\n handleKeyValueAdd(data, coords, onAdd)}\n key={'row_group_' + name}\n >\n {rows}\n \n );\n }\n\n return rows;\n}\n\n\nfunction handleKeyValueAdd(data, coords, onAdd) {\n let key = prompt(\"Add new key\");\n if (key === null) // clicked cancel\n return;\n\n key = key.trim();\n if (!key)\n alert(\"(!) Can't add empty key.\\r\\n\\r\\n\");\n else if (data.hasOwnProperty(key))\n alert(\"(!) Duplicate keys not allowed. This key already exists.\\r\\n\\r\\n\");\n else\n onAdd(\"\", coords + '-' + key); \n}\n\n\nfunction handleKeyEdit(data, key, value, coords, onAdd, onRemove) {\n let newKey = prompt(\"Rename key\", key);\n if (newKey === null) // clicked cancel\n return;\n\n newKey = newKey.trim();\n\n if (newKey === key) // same keys\n return;\n\n if (!newKey)\n return alert(\"(!) Key name can't be empty.\\r\\n\\r\\n\");\n else if (data.hasOwnProperty(newKey))\n return alert(\"(!) Duplicate keys not allowed. This key already exists.\\r\\n\\r\\n\");\n\n onAdd(value, name + '-' + newKey);\n onRemove(coords);\n}\n","import {getBlankData, getSyncedData} from './data';\nimport {getArrayFormRow, getObjectFormRow} from './ui';\nimport {EditorContext} from './util';\n\n\nexport default class Form extends React.Component {\n constructor(props) {\n super(props);\n\n this.dataInput = document.getElementById(this.props.dataInputId);\n this.schema = props.schema;\n\n let data = props.data;\n\n if (!data) {\n // create empty data from schema\n data = getBlankData(this.schema);\n } else {\n // data might be stale if schema has new keys, so add them to data\n try {\n data = getSyncedData(data, this.schema);\n } catch (error) {\n console.log(\"Error: Schema and data don't match\");\n console.log(error);\n }\n }\n\n this.state = {\n value: '',\n data: data\n };\n \n // update data in the input\n this.populateDataInput();\n }\n\n componentDidUpdate(prevProps, prevState) {\n if (this.state.data !== prevState.data) {\n this.populateDataInput();\n }\n }\n\n populateDataInput = () => {\n this.dataInput.value = JSON.stringify(this.state.data);\n }\n\n handleChange = (coords, value) => {\n /*\n e.target.name is a chain of indices and keys:\n xxx-0-key-1-key2 and so on.\n These can be used as coordinates to locate \n a particular deeply nested item.\n\n This first coordinate is not important and should be removed.\n */\n coords = coords.split('-');\n\n coords.shift(); // remove first coord\n\n function setDataUsingCoords(coords, data, value) {\n let coord = coords.shift();\n if (!isNaN(Number(coord)))\n coord = Number(coord);\n\n if (coords.length) {\n setDataUsingCoords(coords, data[coord], value);\n } else {\n data[coord] = value;\n }\n }\n\n let _data = JSON.parse(JSON.stringify(this.state.data));\n\n setDataUsingCoords(coords, _data, value);\n\n this.setState({data: _data});\n }\n\n getFields = () => {\n let data = this.state.data;\n let formGroups = [];\n\n try {\n let type = this.schema.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array') {\n return getArrayFormRow(\n data, this.schema, 'rjf',\n this.handleChange, this.addFieldset, this.removeFieldset,\n 0\n );\n } else if (type === 'object') {\n return getObjectFormRow(\n data, this.schema, 'rjf',\n this.handleChange, this.addFieldset, this.removeFieldset,\n 0\n );\n }\n } catch (error) {\n formGroups = (\n \n (!) Error: Schema and data do not match.\n
\n );\n }\n\n return formGroups;\n }\n\n addFieldset = (blankData, coords) => {\n coords = coords.split('-');\n coords.shift();\n\n this.setState((state) => {\n function addDataUsingCoords(coords, data, value) {\n let coord = coords.shift();\n if (!isNaN(Number(coord)))\n coord = Number(coord);\n\n if (coords.length) {\n addDataUsingCoords(coords, data[coord], value);\n } else {\n if (Array.isArray(data[coord])) {\n data[coord].push(value);\n }\n else {\n if (Array.isArray(data)) {\n data.push(value);\n } else {\n data[coord] = value;\n }\n }\n }\n }\n\n let _data = JSON.parse(JSON.stringify(state.data));\n\n addDataUsingCoords(coords, _data, blankData);\n\n return {data: _data};\n });\n }\n\n removeFieldset = (coords) => {\n coords = coords.split('-');\n coords.shift();\n\n this.setState((state) => {\n function removeDataUsingCoords(coords, data) {\n let coord = coords.shift();\n if (!isNaN(Number(coord)))\n coord = Number(coord);\n\n if (coords.length) {\n removeDataUsingCoords(coords, data[coord]);\n } else {\n if (Array.isArray(data))\n data = data.splice(coord, 1); // in-place mutation\n else\n delete data[coord];\n }\n }\n\n let _data = JSON.parse(JSON.stringify(state.data));\n\n removeDataUsingCoords(coords, _data);\n\n return {data: _data};\n });\n }\n\n render() {\n return (\n \n
\n \n );\n }\n}\n","import Form from './form';\n\n\nexport default function JSONForm(config) {\n this.containerId = config.containerId;\n this.dataInputId = config.dataInputId;\n this.schema = config.schema;\n this.data = config.data;\n this.fileUploadEndpoint = config.fileUploadEndpoint;\n this.fieldName = config.fieldName;\n this.modelName = config.modelName;\n\n this.render = function() {\n ReactDOM.render(\n ,\n document.getElementById(this.containerId)\n );\n }\n}","import JSONForm from './renderer';\n\n\nexport default {\n JSONForm,\n};"],"names":["getBlankObject","schema","keys","schema_keys","properties","key","value","type","getBlankArray","items","push","getBlankData","getSyncedArray","data","newData","JSON","parse","stringify","i","length","item","getSyncedObject","Object","schemaValue","hasOwnProperty","getSyncedData","Button","className","props","children","Loader","EditorContext","React","createContext","capitalize","string","charAt","toUpperCase","substr","toLowerCase","getVerboseName","name","undefined","replace","getCsrfCookie","document","cookie","split","filter","trim","indexOf","FormInput","label","inputRef","ref","FormCheckInput","checked","FormRadioInput","options","map","option","inputValue","FormSelectInput","dataURItoBlob","dataURI","splitted","params","param","binary","atob","array","charCodeAt","blob","window","Blob","Uint8Array","FormFileInput","getFileName","extractFileInfo","dataURL","size","addNameToDataURL","encodeURIComponent","handleChange","e","file","target","files","fileName","reader","FileReader","onload","event","result","onChange","readAsDataURL","endpoint","context","fileUploadEndpoint","console","error","alert","setState","loading","formData","FormData","append","fieldName","modelName","slice","fetch","method","headers","body","then","response","json","file_path","showFileBrowser","current","click","state","createRef","componentDidUpdate","prevProps","prevState","render","Component","contextType","GroupTitle","FormRow","onRemove","FormGroup","hasChildren","Children","count","innerClassName","level","title","addable","onAdd","valueType","callback","isNaN","Number","FormField","inputProps","choices","widget","InputField","format","editable","onEdit","getStringFormRow","removable","getArrayFormRow","rows","groups","min_items","minItems","max_items","maxItems","childName","getObjectFormRow","coords","groupTitle","index","additionalProperties","k","handleKeyEdit","handleKeyValueAdd","prompt","newKey","Form","populateDataInput","dataInput","shift","setDataUsingCoords","coord","_data","getFields","formGroups","addFieldset","removeFieldset","color","blankData","addDataUsingCoords","Array","isArray","removeDataUsingCoords","splice","getElementById","dataInputId","log","JSONForm","config","containerId","ReactDOM"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAO,SAASA,cAAT,CAAwBC,MAAxB,EAAgC;EACnC,MAAIC,IAAI,GAAG,EAAX;EAEA,MAAIC,WAAW,GAAGF,MAAM,CAACC,IAAP,IAAeD,MAAM,CAACG,UAAxC;;EAEA,OAAK,IAAIC,GAAT,IAAgBF,WAAhB,EAA6B;EACzB,QAAIG,KAAK,GAAGH,WAAW,CAACE,GAAD,CAAvB;EACA,QAAIE,IAAI,GAAGD,KAAK,CAACC,IAAjB;EAEA,QAAIA,IAAI,KAAK,MAAb,EACIA,IAAI,GAAG,OAAP,CADJ,KAEK,IAAIA,IAAI,KAAK,MAAb,EACDA,IAAI,GAAG,QAAP;EAEJ,QAAIA,IAAI,K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AAL,GAA0BiG,MAAM,CAACjG,kBAAjC;EACA,OAAKS,SAAL,GAAiBwF,MAAM,CAACxF,SAAxB;EACA,OAAKC,SAAL,GAAiBuF,MAAM,CAACvF,SAAxB;;EAEA,OAAKkB,MAAL,GAAc,YAAW;EACrBuE,IAAAA,QAAQ,CAACvE,MAAT,eACI,oBAAC,IAAD;EACI,MAAA,MAAM,EAAE,KAAK7H,MADjB;EAEI,MAAA,WAAW,EAAE,KAAK+L,WAFtB;EAGI,MAAA,IAAI,EAAE,KAAKnL,IAHf;EAII,MAAA,kBAAkB,EAAE,KAAKqF,kBAJ7B;EAKI,MAAA,SAAS,EAAE,KAAKS,SALpB;EAMI,MAAA,SAAS,EAAE,KAAKC;EANpB,MADJ,EASI/D,QAAQ,CAACkJ,cAAT,CAAwB,KAAKK,WAA7B,CATJ;EAWH,GAZD;EAaH;;ACtBD,cAAe;EACbF,EAAAA,QAAQ,EAARA;EADa,CAAf;;;;;;;;"}
\ No newline at end of file
diff --git a/dist/react-json-form.min.js b/dist/react-json-form.min.js
index e6b1fe4..816f5a4 100644
--- a/dist/react-json-form.min.js
+++ b/dist/react-json-form.min.js
@@ -1,2 +1,2 @@
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).reactJsonForm=t()}(this,function(){function e(){return(e=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}function r(e){var t={},a=e.keys||e.properties;for(var n in a){var i=a[n],o=i.type;if("list"===o?o="array":"dict"===o&&(o="object"),"array"===o)t[n]=l(i);else if("object"===o)t[n]=r(i);else if("string"===o)t[n]="";else if("number"===e.type)return""}return t}function l(e){var t=[],a=e.items.type;return"list"===a?a="array":"dict"===a&&(a="object"),"array"===a?t.push(l(e.items)):"object"===a?t.push(r(e.items)):("string"===a||"number"===e.type)&&t.push(""),t}function i(e){var t=e.type;return"list"===t?t="array":"dict"===t&&(t="object"),"array"===t?l(e):"object"===t?r(e):"string"===t||"number"===t?"":void 0}function o(e,t){var a=JSON.parse(JSON.stringify(e)),n=t.items.type;"list"===n?n="array":"dict"===n&&(n="object");for(var r=0;r0&&React.createElement(k,null,e.schema.title),e.children,e.addable&&React.createElement(u,{className:"add",onClick:function(t){return e.onAdd()},title:"Add new"},t?"Add more":"Add")))}function O(t){var a,n={name:t.name,value:t.data},r=t.schema.type;switch(t.schema.choices&&(n.options=t.schema.choices,r="select"),t.schema.widget&&(r=t.schema.widget),r){case"string":a=b,t.schema.format?("data-url"!==t.schema.format&&"file-url"!==t.schema.format||(a=E),n.type=t.schema.format):n.type="text";break;case"number":case"integer":n.type="number",a=b;break;case"boolean":case"checkbox":n.type="checkbox",a=g;break;case"radio":n.type="radio",a=R;break;case"select":a=N;break;default:n.type="text",a=b}return React.createElement(a,e({},n,{label:t.editable?React.createElement("span",null,t.schema.title," ",React.createElement(u,{className:"edit",onClick:t.onEdit,title:"Edit"},"Edit")):t.schema.title,onChange:function(e){return function(e,t,a){var n;n="checkbox"===e.target.type?e.target.checked:e.target.value,"number"===t&&(""===(n=n.trim())||isNaN(Number(n))||(n=Number(n))),a(e.target.name,n)}(e,t.schema.type,t.onChange)}}))}function _(e,t,a,n,r,l,i,o){return React.createElement(j,{key:a,onRemove:l?function(e){return r(a)}:null},React.createElement(O,{data:e,schema:t,name:a,onChange:n,onEdit:i,editable:o}))}function x(e,t,a,n,r,l,o){var c=[],s=[],d=!0;e.length<=(t.min_items||t.minItems||0)&&(d=!1);var m=!0;e.length>=(t.max_items||t.maxItems||100)&&(m=!1);var p=t.items.type;"list"===p?p="array":"dict"===p&&(p="object");for(var f=0;f=0||(r[a]=e[a]);return r}function r(e){var t={},a=e.keys||e.properties;for(var n in a){var i=a[n],o=i.type;if("list"===o?o="array":"dict"===o&&(o="object"),"array"===o)t[n]=l(i);else if("object"===o)t[n]=r(i);else if("string"===o)t[n]="";else if("number"===e.type)return""}return t}function l(e){var t=[],a=e.items.type;return"list"===a?a="array":"dict"===a&&(a="object"),"array"===a?t.push(l(e.items)):"object"===a?t.push(r(e.items)):("string"===a||"number"===e.type)&&t.push(""),t}function i(e){var t=e.type;return"list"===t?t="array":"dict"===t&&(t="object"),"array"===t?l(e):"object"===t?r(e):"string"===t||"number"===t?"":void 0}function o(e,t){var a=JSON.parse(JSON.stringify(e)),n=t.items.type;"list"===n?n="array":"dict"===n&&(n="object");for(var r=0;r0&&React.createElement(k,null,e.schema.title),e.children,e.addable&&React.createElement(u,{className:"add",onClick:function(t){return e.onAdd()},title:"Add new"},t?"Add more":"Add")))}function O(t){var a,n={name:t.name,value:t.data},r=t.schema.type;switch(t.schema.choices&&(n.options=t.schema.choices,r="select"),t.schema.widget&&(r=t.schema.widget),r){case"string":a=b,t.schema.format?("data-url"!==t.schema.format&&"file-url"!==t.schema.format||(a=E),n.type=t.schema.format):n.type="text";break;case"number":case"integer":n.type="number",a=b;break;case"boolean":case"checkbox":n.type="checkbox",a=g;break;case"radio":n.type="radio",a=R;break;case"select":a=N;break;default:n.type="text",a=b}return React.createElement(a,e({},n,{label:t.editable?React.createElement("span",null,t.schema.title," ",React.createElement(u,{className:"edit",onClick:t.onEdit,title:"Edit"},"Edit")):t.schema.title,onChange:function(e){return function(e,t,a){var n;n="checkbox"===e.target.type?e.target.checked:e.target.value,"number"===t&&(""===(n=n.trim())||isNaN(Number(n))||(n=Number(n))),a(e.target.name,n)}(e,t.schema.type,t.onChange)}}))}function _(e,t,a,n,r,l,i,o){return React.createElement(j,{key:a,onRemove:l?function(e){return r(a)}:null},React.createElement(O,{data:e,schema:t,name:a,onChange:n,onEdit:i,editable:o}))}function x(e,t,a,n,r,l,o){var c=[],s=[],d=!0;e.length<=(t.min_items||t.minItems||0)&&(d=!1);var m=!0;e.length>=(t.max_items||t.maxItems||100)&&(m=!1);var p=t.items.type;"list"===p?p="array":"dict"===p&&(p="object");for(var f=0;f\n {props.children}\n \n );\n}","export default function Loader (props) {\n return ;\n}\n","export const EditorContext = React.createContext();\n\n\nexport function capitalize(string) {\n if (!string)\n return '';\n \n return string.charAt(0).toUpperCase() + string.substr(1).toLowerCase();\n}\n\n\nexport function getVerboseName(name) {\n if (name === undefined || name === null)\n return '';\n\n name = name.replace(/_/g, ' ');\n return capitalize(name);\n}\n\n\nexport function getCsrfCookie() {\n if ((document.cookie.split(';').filter((item) => item.trim().indexOf('csrftoken=') === 0)).length) {\n return document.cookie.split(';').filter((item) => item.trim().indexOf('csrftoken=') === 0)[0].split('=')[1];\n }\n return null;\n}\n","import Button from './buttons';\nimport Loader from './loaders';\nimport {EditorContext, getCsrfCookie} from '../util';\n\n\nexport function FormInput({label, help_text, error, inputRef, ...props}) {\n\n if (props.type === 'string')\n props.type = 'text'\n\n if (inputRef)\n props.ref = inputRef;\n\n return (\n \n {label && }\n \n
\n );\n}\n\n\nexport function FormCheckInput({label, help_text, error, value, ...props}) {\n\n if (!label)\n label = props.name.toUpperCase();\n\n if (props.type === 'bool')\n props.type = 'checkbox';\n\n if (props.checked === undefined)\n props.checked = value;\n\n if (props.checked === '')\n props.checked = false\n\n return (\n \n \n
\n );\n}\n\n\nexport function FormRadioInput({label, help_text, error, value, options, ...props}) {\n return (\n \n \n {options.map((option, i) => {\n let label, inputValue;\n if (typeof option === 'object') {\n label = option.label;\n inputValue = option.value;\n } else {\n label = option;\n inputValue = option;\n }\n\n return (\n \n );\n })}\n
\n );\n}\n\n\nexport function FormSelectInput({label, help_text, error, value, options, ...props}) {\n return (\n \n {label && }\n \n
\n );\n}\n\nexport function dataURItoBlob(dataURI) {\n // Split metadata from data\n const splitted = dataURI.split(\",\");\n // Split params\n const params = splitted[0].split(\";\");\n // Get mime-type from params\n const type = params[0].replace(\"data:\", \"\");\n // Filter the name property from params\n const properties = params.filter(param => {\n return param.split(\"=\")[0] === \"name\";\n });\n // Look for the name and use unknown if no name property.\n let name;\n if (properties.length !== 1) {\n name = \"unknown\";\n } else {\n // Because we filtered out the other property,\n // we only have the name case here.\n name = properties[0].split(\"=\")[1];\n }\n\n // Built the Uint8Array Blob parameter from the base64 string.\n const binary = atob(splitted[1]);\n const array = [];\n for (let i = 0; i < binary.length; i++) {\n array.push(binary.charCodeAt(i));\n }\n // Create the blob object\n const blob = new window.Blob([new Uint8Array(array)], { type });\n\n return {blob, name};\n}\n\n\n\nexport class FormFileInput extends React.Component {\n static contextType = EditorContext;\n\n constructor(props) {\n super(props);\n\n this.state = {\n value: props.value,\n fileName: this.getFileName(),\n loading: false\n };\n\n this.inputRef = React.createRef();\n }\n\n componentDidUpdate(prevProps, prevState) {\n if (this.props.value !== prevProps.value) {\n this.setState({\n value: this.props.value, \n fileName: this.getFileName()\n });\n }\n }\n\n getFileName = () => {\n if (!this.props.value)\n return '';\n\n if (this.props.type === 'data-url') {\n return this.extractFileInfo(this.props.value).name;\n } else if (this.props.type === 'file-url') {\n return this.props.value;\n } else {\n return 'Unknown file';\n }\n }\n\n extractFileInfo = (dataURL) => {\n const {blob, name} = dataURItoBlob(dataURL);\n return {\n name: name,\n size: blob.size,\n type: blob.type\n }\n }\n\n addNameToDataURL = (dataURL, name) => {\n return dataURL.replace(';base64', ';name=' + encodeURIComponent(name) + ';base64');\n }\n\n handleChange = (e) => {\n if (this.props.type === 'data-url') {\n let file = e.target.files[0];\n let fileName = file.name\n\n let reader = new FileReader();\n\n reader.onload = () => {\n\n // this.setState({src: reader.result});\n\n // we create a fake event object\n let event = {\n target: {\n type: 'text',\n value: this.addNameToDataURL(reader.result, fileName),\n name: this.props.name\n }\n };\n\n this.props.onChange(event);\n\n }\n reader.readAsDataURL(file);\n } else if (this.props.type === 'file-url') {\n let endpoint = this.context.fileUploadEndpoint;\n if (!endpoint) {\n console.error(\n \"Error: fileUploadEndpoint option need to be passed \"\n + \"while initializing editor for enabling file uploads.\");\n alert(\"Files can't be uploaded.\");\n return;\n }\n\n this.setState({loading: true});\n\n let formData = new FormData();\n formData.append('field_name', this.context.fieldName);\n formData.append('model_name', this.context.modelName);\n formData.append('coordinates', JSON.stringify(this.props.name.split('-').slice(1)));\n formData.append('file', e.target.files[0]);\n\n fetch(endpoint, {\n method: 'POST',\n headers: {\n 'X-CSRFToken': getCsrfCookie(),\n },\n body: formData\n })\n .then((response) => response.json())\n .then((result) => {\n // we create a fake event object\n let event = {\n target: {\n type: 'text',\n value: result.file_path,\n name: this.props.name\n }\n };\n\n this.props.onChange(event);\n this.setState({loading: false});\n })\n .catch((error) => {\n alert('Something went wrong while uploading file');\n console.error('Error:', error);\n this.setState({loading: false});\n });\n\n }\n\n }\n\n showFileBrowser = () => {\n this.inputRef.current.click();\n }\n\n render() {\n let {label, value, ...props} = {value, ...this.props};\n props.type = 'file';\n props.onChange = this.handleChange;\n\n return (\n \n {label &&
}\n
\n {this.state.value && \n
Current file: {this.state.fileName}
\n }\n {this.state.value && !this.state.loading && 'Change:'}\n {this.state.loading ?\n
Uploading...
\n : \n
\n \n
\n }\n
\n
\n );\n }\n}\n","import Button from './buttons';\n\n\nexport function GroupTitle(props) {\n if (!props.children)\n return null;\n\n return (\n {props.children}
\n );\n}\n\n\nexport function FormRow(props) {\n return (\n \n {props.onRemove &&\n
\n }\n
\n {props.children}\n
\n
\n );\n}\n\n\nexport function FormGroup(props) {\n let hasChildren = React.Children.count(props.children);\n\n let innerClassName = props.level === 0 && !hasChildren\n ? \"\" \n : \"rjf-form-group-inner\";\n\n return (\n \n {props.level === 0 &&
{props.schema.title}}\n
\n {props.level > 0 && {props.schema.title}}\n {props.children}\n {props.addable && \n \n }\n
\n
\n );\n}\n","import {getBlankData} from './data';\nimport {Button, FormInput, FormCheckInput, FormRadioInput, FormSelectInput,\n FormFileInput, FormRow, FormGroup} from './components';\nimport {getVerboseName} from './util';\n\n\nfunction handleChange(e, valueType, callback) {\n let type = e.target.type\n let value;\n\n if (type === 'checkbox') {\n value = e.target.checked;\n } else {\n value = e.target.value;\n }\n\n if (valueType === 'number') {\n value = value.trim();\n if (value !== '' && !isNaN(Number(value)))\n value = Number(value);\n }\n\n callback(e.target.name, value);\n}\n\n\nfunction FormField(props) {\n let inputProps = {\n name: props.name,\n value: props.data,\n };\n\n let type = props.schema.type;\n if (props.schema.choices) {\n inputProps.options = props.schema.choices;\n type = 'select';\n }\n if (props.schema.widget)\n type = props.schema.widget;\n\n let InputField;\n\n switch (type) {\n case 'string':\n InputField = FormInput;\n\n if (props.schema.format) {\n if (props.schema.format === 'data-url' || props.schema.format === 'file-url') {\n InputField = FormFileInput;\n }\n inputProps.type = props.schema.format;\n }\n else {\n inputProps.type = 'text';\n }\n break;\n case 'number':\n inputProps.type = 'number';\n InputField = FormInput;\n break;\n case 'integer':\n inputProps.type = 'number';\n InputField = FormInput;\n break;\n case 'boolean':\n inputProps.type = 'checkbox';\n InputField = FormCheckInput;\n break;\n case 'checkbox':\n inputProps.type = 'checkbox';\n InputField = FormCheckInput;\n break;\n case 'radio':\n inputProps.type = 'radio';\n InputField = FormRadioInput;\n break;\n case 'select':\n InputField = FormSelectInput;\n break;\n default:\n inputProps.type = 'text';\n InputField = FormInput;\n }\n\n return (\n {props.schema.title} \n :\n props.schema.title\n }\n onChange={(e) => handleChange(e, props.schema.type, props.onChange)}\n />\n );\n}\n\n\nexport function getStringFormRow(data, schema, name, onChange, onRemove, removable, onEdit, editable) {\n\n return (\n onRemove(name) : null}\n >\n \n \n );\n}\n\nexport function getArrayFormRow(data, schema, name, onChange, onAdd, onRemove, level) {\n let rows = [];\n let groups = [];\n\n let removable = true;\n let min_items = schema.min_items || schema.minItems || 0;\n if (data.length <= min_items)\n removable = false;\n\n let addable = true;\n let max_items = schema.max_items || schema.maxItems || 100;\n if (data.length >= max_items)\n addable = false;\n\n let type = schema.items.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n for (let i = 0; i < data.length; i++) {\n let item = data[i];\n let childName = name + '-' + i;\n\n if (type === 'array') {\n groups.push(getArrayFormRow(item, schema.items, childName, onChange, onAdd, onRemove, level + 1));\n } else if (type === 'object') {\n groups.push(getObjectFormRow(item, schema.items, childName, onChange, onAdd, onRemove, level + 1));\n } else {\n rows.push(getStringFormRow(item, schema.items, childName, onChange, onRemove, removable));\n } \n }\n\n let coords = name; // coordinates for insertion and deletion\n\n if (rows.length || (!rows.length && !groups.length)) {\n rows = (\n onAdd(getBlankData(schema.items), coords)}\n key={'row_group_' + name}\n >\n {rows}\n \n );\n }\n\n if (groups.length) {\n let groupTitle = schema.title ? {schema.title}
: null;\n\n groups = (\n \n {groupTitle}\n {groups.map((i, index) => (\n
\n {removable && \n \n }\n {i}\n
\n )\n )}\n {addable && \n
\n }\n
\n )\n }\n\n return [...rows, ...groups];\n}\n\n\nexport function getObjectFormRow(data, schema, name, onChange, onAdd, onRemove, level) {\n let rows = [];\n\n schema_keys = schema.keys || schema.properties;\n\n let keys = [...Object.keys(schema_keys)];\n\n if (schema.additionalProperties)\n keys = [...keys, ...Object.keys(data).filter((k) => keys.indexOf(k) === -1)];\n\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i];\n let value = data[key];\n let childName = name + '-' + key;\n let schemaValue = schema_keys[key] || {type: 'string'};\n\n let type = schemaValue.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (!schemaValue.title)\n schemaValue.title = getVerboseName(key);\n\n let removable = false;\n if (schema_keys[key] === undefined)\n removable = true;\n\n if (type === 'array') {\n rows.push(getArrayFormRow(value, schemaValue, childName, onChange, onAdd, onRemove, level + 1));\n } else if (type === 'object') {\n rows.push(getObjectFormRow(value, schemaValue, childName, onChange, onAdd, onRemove, level + 1));\n } else {\n rows.push(getStringFormRow(\n value, schemaValue, childName, onChange, onRemove, removable, \n () => handleKeyEdit(data, key, value, childName, onAdd, onRemove),\n removable\n ));\n }\n }\n\n if (rows.length || schema.additionalProperties) {\n let className = \"rjf-form-group-inner\";\n if (level === 0 && !rows.length)\n className = \"\";\n \n let coords = name;\n\n rows = (\n handleKeyValueAdd(data, coords, onAdd)}\n key={'row_group_' + name}\n >\n {rows}\n \n );\n }\n\n return rows;\n}\n\n\nfunction handleKeyValueAdd(data, coords, onAdd) {\n let key = prompt(\"Add new key\");\n if (key === null) // clicked cancel\n return;\n\n key = key.trim();\n if (!key)\n alert(\"(!) Can't add empty key.\\r\\n\\r\\n\");\n else if (data.hasOwnProperty(key))\n alert(\"(!) Duplicate keys not allowed. This key already exists.\\r\\n\\r\\n\");\n else\n onAdd(\"\", coords + '-' + key); \n}\n\n\nfunction handleKeyEdit(data, key, value, coords, onAdd, onRemove) {\n let newKey = prompt(\"Rename key\", key);\n if (newKey === null) // clicked cancel\n return;\n\n newKey = newKey.trim();\n\n if (newKey === key) // same keys\n return;\n\n if (!newKey)\n return alert(\"(!) Key name can't be empty.\\r\\n\\r\\n\");\n else if (data.hasOwnProperty(newKey))\n return alert(\"(!) Duplicate keys not allowed. This key already exists.\\r\\n\\r\\n\");\n\n onAdd(value, name + '-' + newKey);\n onRemove(coords);\n}\n","import {getBlankData, getSyncedData} from './data';\nimport {getArrayFormRow, getObjectFormRow} from './ui';\nimport {EditorContext} from './util';\n\n\nexport default class Form extends React.Component {\n constructor(props) {\n super(props);\n\n this.dataInput = document.getElementById(this.props.dataInputId);\n this.schema = props.schema;\n\n let data = props.data;\n\n if (!data) {\n // create empty data from schema\n data = getBlankData(this.schema);\n } else {\n // data might be stale if schema has new keys, so add them to data\n try {\n data = getSyncedData(data, this.schema);\n } catch (error) {\n console.log(\"Error: Schema and data don't match\");\n console.log(error);\n }\n }\n\n this.state = {\n value: '',\n data: data\n };\n \n // update data in the input\n this.populateDataInput();\n }\n\n componentDidUpdate(prevProps, prevState) {\n if (this.state.data !== prevState.data) {\n this.populateDataInput();\n }\n }\n\n populateDataInput = () => {\n this.dataInput.value = JSON.stringify(this.state.data);\n }\n\n handleChange = (coords, value) => {\n /*\n e.target.name is a chain of indices and keys:\n xxx-0-key-1-key2 and so on.\n These can be used as coordinates to locate \n a particular deeply nested item.\n\n This first coordinate is not important and should be removed.\n */\n coords = coords.split('-');\n\n coords.shift(); // remove first coord\n\n function setDataUsingCoords(coords, data, value) {\n let coord = coords.shift();\n if (!isNaN(Number(coord)))\n coord = Number(coord);\n\n if (coords.length) {\n setDataUsingCoords(coords, data[coord], value);\n } else {\n data[coord] = value;\n }\n }\n\n let _data = JSON.parse(JSON.stringify(this.state.data));\n\n setDataUsingCoords(coords, _data, value);\n\n this.setState({data: _data});\n }\n\n getFields = () => {\n let data = this.state.data;\n let formGroups = [];\n\n try {\n let type = this.schema.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array') {\n return getArrayFormRow(\n data, this.schema, 'rjf',\n this.handleChange, this.addFieldset, this.removeFieldset,\n 0\n );\n } else if (type === 'object') {\n return getObjectFormRow(\n data, this.schema, 'rjf',\n this.handleChange, this.addFieldset, this.removeFieldset,\n 0\n );\n }\n } catch (error) {\n formGroups = (\n \n (!) Error: Schema and data do not match.\n
\n );\n }\n\n return formGroups;\n }\n\n addFieldset = (blankData, coords) => {\n coords = coords.split('-');\n coords.shift();\n\n this.setState((state) => {\n function addDataUsingCoords(coords, data, value) {\n let coord = coords.shift();\n if (!isNaN(Number(coord)))\n coord = Number(coord);\n\n if (coords.length) {\n addDataUsingCoords(coords, data[coord], value);\n } else {\n if (Array.isArray(data)) {\n data.push(value);\n }\n else {\n if (Array.isArray(data[coord])) {\n data[coord].push(value);\n } else {\n data[coord] = value;\n }\n }\n }\n }\n\n let _data = JSON.parse(JSON.stringify(state.data));\n\n addDataUsingCoords(coords, _data, blankData);\n\n return {data: _data};\n });\n }\n\n removeFieldset = (coords) => {\n coords = coords.split('-');\n coords.shift();\n\n this.setState((state) => {\n function removeDataUsingCoords(coords, data) {\n let coord = coords.shift();\n if (!isNaN(Number(coord)))\n coord = Number(coord);\n\n if (coords.length) {\n removeDataUsingCoords(coords, data[coord]);\n } else {\n if (Array.isArray(data))\n data = data.splice(coord, 1); // in-place mutation\n else\n delete data[coord];\n }\n }\n\n let _data = JSON.parse(JSON.stringify(state.data));\n\n removeDataUsingCoords(coords, _data);\n\n return {data: _data};\n });\n }\n\n render() {\n return (\n \n
\n \n );\n }\n}\n","import JSONForm from './renderer';\n\n\nexport default {\n JSONForm,\n};","import Form from './form';\n\n\nexport default function JSONForm(config) {\n this.containerId = config.containerId;\n this.dataInputId = config.dataInputId;\n this.schema = config.schema;\n this.data = config.data;\n this.fileUploadEndpoint = config.fileUploadEndpoint;\n this.fieldName = config.fieldName;\n this.modelName = config.modelName;\n\n this.render = function() {\n ReactDOM.render(\n ,\n document.getElementById(this.containerId)\n );\n }\n}"],"names":["getBlankObject","schema","keys","schema_keys","properties","key","value","type","getBlankArray","items","push","getBlankData","getSyncedArray","data","newData","JSON","parse","stringify","i","length","item","getSyncedObject","Object","schemaValue","hasOwnProperty","Button","className","props","React","children","Loader","EditorContext","createContext","FormInput","label","inputRef","ref","FormCheckInput","name","toUpperCase","undefined","checked","FormRadioInput","options","map","option","inputValue","FormSelectInput","defaultValue","disabled","FormFileInput","_this","getFileName","extractFileInfo","dataURL","dataURI","splitted","split","params","replace","filter","param","binary","atob","array","charCodeAt","blob","window","Blob","Uint8Array","dataURItoBlob","size","addNameToDataURL","encodeURIComponent","handleChange","e","file","target","files","fileName","reader","FileReader","onload","event","result","onChange","readAsDataURL","endpoint","context","fileUploadEndpoint","console","error","alert","setState","loading","formData","FormData","append","fieldName","modelName","slice","fetch","method","headers","document","cookie","trim","indexOf","body","then","response","json","file_path","showFileBrowser","current","click","state","createRef","componentDidUpdate","prevProps","prevState","this","render","Component","GroupTitle","FormRow","onRemove","onClick","title","FormGroup","hasChildren","Children","count","innerClassName","level","addable","onAdd","FormField","InputField","inputProps","choices","widget","format","editable","onEdit","valueType","callback","isNaN","Number","getStringFormRow","removable","getArrayFormRow","rows","groups","min_items","minItems","max_items","maxItems","childName","getObjectFormRow","coords","index","additionalProperties","k","string","charAt","substr","toLowerCase","getVerboseName","handleKeyEdit","prompt","handleKeyValueAdd","newKey","contextType","Form","populateDataInput","dataInput","shift","_data","setDataUsingCoords","coord","getFields","formGroups","addFieldset","removeFieldset","style","color","blankData","addDataUsingCoords","Array","isArray","removeDataUsingCoords","splice","getElementById","dataInputId","log","Provider","JSONForm","config","containerId","ReactDOM"],"mappings":"gvBAAgBA,EAAeC,GAC3B,IAAIC,EAAO,GAEPC,EAAcF,EAAOC,MAAQD,EAAOG,WAExC,IAAK,IAAIC,KAAOF,EAAa,CACzB,IAAIG,EAAQH,EAAYE,GACpBE,EAAOD,EAAMC,KAOjB,GALa,SAATA,EACAA,EAAO,QACO,SAATA,IACLA,EAAO,UAEE,UAATA,EACAL,EAAKG,GAAOG,EAAcF,WACZ,WAATC,EACLL,EAAKG,GAAOL,EAAeM,WACb,WAATC,EACLL,EAAKG,GAAO,WACS,WAAhBJ,EAAOM,KACZ,MAAO,GAGf,OAAOL,WAIKM,EAAcP,GAC1B,IAAIQ,EAAQ,GACRF,EAAON,EAAOQ,MAAMF,KAgBxB,MAda,SAATA,EACAA,EAAO,QACO,SAATA,IACLA,EAAO,UAEE,UAATA,EACAE,EAAMC,KAAKF,EAAcP,EAAOQ,QAClB,WAATF,EACLE,EAAMC,KAAKV,EAAeC,EAAOQ,SACnB,WAATF,GAEgB,WAAhBN,EAAOM,OADZE,EAAMC,KAAK,IAIRD,WAIKE,EAAaV,GACzB,IAAIM,EAAON,EAAOM,KAOlB,MALa,SAATA,EACAA,EAAO,QACO,SAATA,IACLA,EAAO,UAEE,UAATA,EACOC,EAAcP,GAEP,WAATM,EACEP,EAAeC,GACN,WAATM,GAES,WAATA,EADA,UAQf,SAASK,EAAeC,EAAMZ,GAC1B,IAAIa,EAAUC,KAAKC,MAAMD,KAAKE,UAAUJ,IAEpCN,EAAON,EAAOQ,MAAMF,KAEX,SAATA,EACAA,EAAO,QACO,SAATA,IACLA,EAAO,UAEX,IAAK,IAAIW,EAAI,EAAGA,EAAIL,EAAKM,OAAQD,IAAK,CAClC,IAAIE,EAAOP,EAAKK,GAEH,UAATX,EACAO,EAAQI,GAAKN,EAAeQ,EAAMnB,EAAOQ,OACzB,WAAT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AU,oBACXE,gCAAUF,UAAU,kBAChBE,oBAACG,EAAcqK,UACX9L,MAAO,CACHmF,mBAAoBgC,KAAK9F,MAAM8D,mBAC/BS,UAAWuB,KAAK9F,MAAMuE,UACtBC,UAAWsB,KAAK9F,MAAMwE,YAG7BsB,KAAK4D,mBAtLQzJ,MAAM+F,iBCFzB,CACb0E,kBCD+BC,GAC7B7E,KAAK8E,YAAcD,EAAOC,YAC1B9E,KAAKyE,YAAcI,EAAOJ,YAC1BzE,KAAKxH,OAASqM,EAAOrM,OACrBwH,KAAK5G,KAAOyL,EAAOzL,KACnB4G,KAAKhC,mBAAqB6G,EAAO7G,mBACjCgC,KAAKvB,UAAYoG,EAAOpG,UACxBuB,KAAKtB,UAAYmG,EAAOnG,UAExBsB,KAAKC,OAAS,WACV8E,SAAS9E,OACL9F,oBAACkJ,GACG7K,OAAQwH,KAAKxH,OACbiM,YAAazE,KAAKyE,YAClBrL,KAAM4G,KAAK5G,KACX4E,mBAAoBgC,KAAKhC,mBACzBS,UAAWuB,KAAKvB,UAChBC,UAAWsB,KAAKtB,YAEpBK,SAASyF,eAAexE,KAAK8E"}
\ No newline at end of file
+{"version":3,"file":"react-json-form.min.js","sources":["../src/data.js","../src/components/buttons.js","../src/components/loaders.js","../src/util.js","../src/components/form.js","../src/components/containers.js","../src/ui.js","../src/form.js","../src/index.js","../src/renderer.js"],"sourcesContent":["export function getBlankObject(schema) {\n let keys = {};\n\n let schema_keys = schema.keys || schema.properties;\n\n for (let key in schema_keys) {\n let value = schema_keys[key];\n let type = value.type;\n\n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array')\n keys[key] = getBlankArray(value);\n else if (type === 'object')\n keys[key] = getBlankObject(value);\n else if (type === 'string')\n keys[key] = '';\n else if (schema.type === 'number')\n return '';\n }\n\n return keys;\n}\n\n\nexport function getBlankArray(schema) {\n let items = [];\n let type = schema.items.type;\n\n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array')\n items.push(getBlankArray(schema.items))\n else if (type === 'object')\n items.push(getBlankObject(schema.items));\n else if (type === 'string')\n items.push('');\n else if (schema.type === 'number')\n items.push('');\n\n return items;\n}\n\n\nexport function getBlankData(schema) {\n let type = schema.type;\n\n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array') {\n return getBlankArray(schema);\n }\n else if (type === 'object') {\n return getBlankObject(schema);\n } else if (type === 'string') {\n return '';\n } else if (type === 'number') {\n return '';\n }\n}\n\n\n\nfunction getSyncedArray(data, schema) {\n let newData = JSON.parse(JSON.stringify(data));\n\n let type = schema.items.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n for (let i = 0; i < data.length; i++) {\n let item = data[i];\n\n if (type === 'array') {\n newData[i] = getSyncedArray(item, schema.items);\n } else if (type === 'object') {\n newData[i] = getSyncedObject(item, schema.items);\n }\n }\n\n return newData;\n}\n\n\nfunction getSyncedObject(data, schema) {\n let newData = JSON.parse(JSON.stringify(data));\n\n let schema_keys = schema.keys || schema.properties;\n\n let keys = [...Object.keys(schema_keys)];\n\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i];\n let schemaValue = schema_keys[key];\n let type = schemaValue.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n \n if (!data.hasOwnProperty(key)) {\n if (type === 'string')\n newData[key] = '';\n else if (type === 'array')\n newData[key] = getSyncedArray([], schemaValue);\n else if (type === 'object')\n newData[key] = getSyncedObject({}, schemaValue);\n } else {\n if (type === 'string')\n newData[key] = data[key];\n else if (type === 'array')\n newData[key] = getSyncedArray(data[key], schemaValue);\n else if (type === 'object')\n newData[key] = getSyncedObject(data[key], schemaValue);\n }\n \n }\n\n return newData;\n}\n\n\nexport function getSyncedData(data, schema) {\n // adds those keys to data which are in schema but not in data\n\n let type = schema.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array') {\n return getSyncedArray(data, schema);\n } else if (type === 'object') {\n return getSyncedObject(data, schema);\n }\n\n return data;\n}\n","export default function Button({className, ...props}) {\n if (!className)\n className = '';\n\n className = 'rjf-' + className + '-button';\n return (\n \n );\n}","export default function Loader (props) {\n return ;\n}\n","export const EditorContext = React.createContext();\n\n\nexport function capitalize(string) {\n if (!string)\n return '';\n \n return string.charAt(0).toUpperCase() + string.substr(1).toLowerCase();\n}\n\n\nexport function getVerboseName(name) {\n if (name === undefined || name === null)\n return '';\n\n name = name.replace(/_/g, ' ');\n return capitalize(name);\n}\n\n\nexport function getCsrfCookie() {\n if ((document.cookie.split(';').filter((item) => item.trim().indexOf('csrftoken=') === 0)).length) {\n return document.cookie.split(';').filter((item) => item.trim().indexOf('csrftoken=') === 0)[0].split('=')[1];\n }\n return null;\n}\n","import Button from './buttons';\nimport Loader from './loaders';\nimport {EditorContext, getCsrfCookie} from '../util';\n\n\nexport function FormInput({label, help_text, error, inputRef, ...props}) {\n\n if (props.type === 'string')\n props.type = 'text'\n\n if (inputRef)\n props.ref = inputRef;\n\n return (\n \n {label && }\n \n
\n );\n}\n\n\nexport function FormCheckInput({label, help_text, error, value, ...props}) {\n\n if (!label)\n label = props.name.toUpperCase();\n\n if (props.type === 'bool')\n props.type = 'checkbox';\n\n if (props.checked === undefined)\n props.checked = value;\n\n if (props.checked === '')\n props.checked = false\n\n return (\n \n \n
\n );\n}\n\n\nexport function FormRadioInput({label, help_text, error, value, options, ...props}) {\n return (\n \n \n {options.map((option, i) => {\n let label, inputValue;\n if (typeof option === 'object') {\n label = option.label;\n inputValue = option.value;\n } else {\n label = option;\n inputValue = option;\n }\n\n return (\n \n );\n })}\n
\n );\n}\n\n\nexport function FormSelectInput({label, help_text, error, value, options, ...props}) {\n return (\n \n {label && }\n \n
\n );\n}\n\nexport function dataURItoBlob(dataURI) {\n // Split metadata from data\n const splitted = dataURI.split(\",\");\n // Split params\n const params = splitted[0].split(\";\");\n // Get mime-type from params\n const type = params[0].replace(\"data:\", \"\");\n // Filter the name property from params\n const properties = params.filter(param => {\n return param.split(\"=\")[0] === \"name\";\n });\n // Look for the name and use unknown if no name property.\n let name;\n if (properties.length !== 1) {\n name = \"unknown\";\n } else {\n // Because we filtered out the other property,\n // we only have the name case here.\n name = properties[0].split(\"=\")[1];\n }\n\n // Built the Uint8Array Blob parameter from the base64 string.\n const binary = atob(splitted[1]);\n const array = [];\n for (let i = 0; i < binary.length; i++) {\n array.push(binary.charCodeAt(i));\n }\n // Create the blob object\n const blob = new window.Blob([new Uint8Array(array)], { type });\n\n return {blob, name};\n}\n\n\n\nexport class FormFileInput extends React.Component {\n static contextType = EditorContext;\n\n constructor(props) {\n super(props);\n\n this.state = {\n value: props.value,\n fileName: this.getFileName(),\n loading: false\n };\n\n this.inputRef = React.createRef();\n }\n\n componentDidUpdate(prevProps, prevState) {\n if (this.props.value !== prevProps.value) {\n this.setState({\n value: this.props.value, \n fileName: this.getFileName()\n });\n }\n }\n\n getFileName = () => {\n if (!this.props.value)\n return '';\n\n if (this.props.type === 'data-url') {\n return this.extractFileInfo(this.props.value).name;\n } else if (this.props.type === 'file-url') {\n return this.props.value;\n } else {\n return 'Unknown file';\n }\n }\n\n extractFileInfo = (dataURL) => {\n const {blob, name} = dataURItoBlob(dataURL);\n return {\n name: name,\n size: blob.size,\n type: blob.type\n }\n }\n\n addNameToDataURL = (dataURL, name) => {\n return dataURL.replace(';base64', ';name=' + encodeURIComponent(name) + ';base64');\n }\n\n handleChange = (e) => {\n if (this.props.type === 'data-url') {\n let file = e.target.files[0];\n let fileName = file.name\n\n let reader = new FileReader();\n\n reader.onload = () => {\n\n // this.setState({src: reader.result});\n\n // we create a fake event object\n let event = {\n target: {\n type: 'text',\n value: this.addNameToDataURL(reader.result, fileName),\n name: this.props.name\n }\n };\n\n this.props.onChange(event);\n\n }\n reader.readAsDataURL(file);\n } else if (this.props.type === 'file-url') {\n let endpoint = this.context.fileUploadEndpoint;\n if (!endpoint) {\n console.error(\n \"Error: fileUploadEndpoint option need to be passed \"\n + \"while initializing editor for enabling file uploads.\");\n alert(\"Files can't be uploaded.\");\n return;\n }\n\n this.setState({loading: true});\n\n let formData = new FormData();\n formData.append('field_name', this.context.fieldName);\n formData.append('model_name', this.context.modelName);\n formData.append('coordinates', JSON.stringify(this.props.name.split('-').slice(1)));\n formData.append('file', e.target.files[0]);\n\n fetch(endpoint, {\n method: 'POST',\n headers: {\n 'X-CSRFToken': getCsrfCookie(),\n },\n body: formData\n })\n .then((response) => response.json())\n .then((result) => {\n // we create a fake event object\n let event = {\n target: {\n type: 'text',\n value: result.file_path,\n name: this.props.name\n }\n };\n\n this.props.onChange(event);\n this.setState({loading: false});\n })\n .catch((error) => {\n alert('Something went wrong while uploading file');\n console.error('Error:', error);\n this.setState({loading: false});\n });\n\n }\n\n }\n\n showFileBrowser = () => {\n this.inputRef.current.click();\n }\n\n render() {\n let {label, value, ...props} = {value, ...this.props};\n props.type = 'file';\n props.onChange = this.handleChange;\n\n return (\n \n {label &&
}\n
\n {this.state.value && \n
Current file: {this.state.fileName}
\n }\n {this.state.value && !this.state.loading && 'Change:'}\n {this.state.loading ?\n
Uploading...
\n : \n
\n \n
\n }\n
\n
\n );\n }\n}\n","import Button from './buttons';\n\n\nexport function GroupTitle(props) {\n if (!props.children)\n return null;\n\n return (\n {props.children}
\n );\n}\n\n\nexport function FormRow(props) {\n return (\n \n {props.onRemove &&\n
\n }\n
\n {props.children}\n
\n
\n );\n}\n\n\nexport function FormGroup(props) {\n let hasChildren = React.Children.count(props.children);\n\n let innerClassName = props.level === 0 && !hasChildren\n ? \"\" \n : \"rjf-form-group-inner\";\n\n return (\n \n {props.level === 0 &&
{props.schema.title}}\n
\n {props.level > 0 && {props.schema.title}}\n {props.children}\n {props.addable && \n \n }\n
\n
\n );\n}\n","import {getBlankData} from './data';\nimport {Button, FormInput, FormCheckInput, FormRadioInput, FormSelectInput,\n FormFileInput, FormRow, FormGroup} from './components';\nimport {getVerboseName} from './util';\n\n\nfunction handleChange(e, valueType, callback) {\n let type = e.target.type\n let value;\n\n if (type === 'checkbox') {\n value = e.target.checked;\n } else {\n value = e.target.value;\n }\n\n if (valueType === 'number') {\n value = value.trim();\n if (value !== '' && !isNaN(Number(value)))\n value = Number(value);\n }\n\n callback(e.target.name, value);\n}\n\n\nfunction FormField(props) {\n let inputProps = {\n name: props.name,\n value: props.data,\n };\n\n let type = props.schema.type;\n if (props.schema.choices) {\n inputProps.options = props.schema.choices;\n type = 'select';\n }\n if (props.schema.widget)\n type = props.schema.widget;\n\n let InputField;\n\n switch (type) {\n case 'string':\n InputField = FormInput;\n\n if (props.schema.format) {\n if (props.schema.format === 'data-url' || props.schema.format === 'file-url') {\n InputField = FormFileInput;\n }\n inputProps.type = props.schema.format;\n }\n else {\n inputProps.type = 'text';\n }\n break;\n case 'number':\n inputProps.type = 'number';\n InputField = FormInput;\n break;\n case 'integer':\n inputProps.type = 'number';\n InputField = FormInput;\n break;\n case 'boolean':\n inputProps.type = 'checkbox';\n InputField = FormCheckInput;\n break;\n case 'checkbox':\n inputProps.type = 'checkbox';\n InputField = FormCheckInput;\n break;\n case 'radio':\n inputProps.type = 'radio';\n InputField = FormRadioInput;\n break;\n case 'select':\n InputField = FormSelectInput;\n break;\n default:\n inputProps.type = 'text';\n InputField = FormInput;\n }\n\n return (\n {props.schema.title} \n :\n props.schema.title\n }\n onChange={(e) => handleChange(e, props.schema.type, props.onChange)}\n />\n );\n}\n\n\nexport function getStringFormRow(data, schema, name, onChange, onRemove, removable, onEdit, editable) {\n\n return (\n onRemove(name) : null}\n >\n \n \n );\n}\n\nexport function getArrayFormRow(data, schema, name, onChange, onAdd, onRemove, level) {\n let rows = [];\n let groups = [];\n\n let removable = true;\n let min_items = schema.min_items || schema.minItems || 0;\n if (data.length <= min_items)\n removable = false;\n\n let addable = true;\n let max_items = schema.max_items || schema.maxItems || 100;\n if (data.length >= max_items)\n addable = false;\n\n let type = schema.items.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n for (let i = 0; i < data.length; i++) {\n let item = data[i];\n let childName = name + '-' + i;\n\n if (type === 'array') {\n groups.push(getArrayFormRow(item, schema.items, childName, onChange, onAdd, onRemove, level + 1));\n } else if (type === 'object') {\n groups.push(getObjectFormRow(item, schema.items, childName, onChange, onAdd, onRemove, level + 1));\n } else {\n rows.push(getStringFormRow(item, schema.items, childName, onChange, onRemove, removable));\n } \n }\n\n let coords = name; // coordinates for insertion and deletion\n\n if (rows.length || (!rows.length && !groups.length)) {\n rows = (\n onAdd(getBlankData(schema.items), coords)}\n key={'row_group_' + name}\n >\n {rows}\n \n );\n }\n\n if (groups.length) {\n let groupTitle = schema.title ? {schema.title}
: null;\n\n groups = (\n \n {groupTitle}\n {groups.map((i, index) => (\n
\n {removable && \n \n }\n {i}\n
\n )\n )}\n {addable && \n
\n }\n
\n )\n }\n\n return [...rows, ...groups];\n}\n\n\nexport function getObjectFormRow(data, schema, name, onChange, onAdd, onRemove, level) {\n let rows = [];\n\n schema_keys = schema.keys || schema.properties;\n\n let keys = [...Object.keys(schema_keys)];\n\n if (schema.additionalProperties)\n keys = [...keys, ...Object.keys(data).filter((k) => keys.indexOf(k) === -1)];\n\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i];\n let value = data[key];\n let childName = name + '-' + key;\n let schemaValue = schema_keys[key] || {type: 'string'};\n\n let type = schemaValue.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (!schemaValue.title)\n schemaValue.title = getVerboseName(key);\n\n let removable = false;\n if (schema_keys[key] === undefined)\n removable = true;\n\n if (type === 'array') {\n rows.push(getArrayFormRow(value, schemaValue, childName, onChange, onAdd, onRemove, level + 1));\n } else if (type === 'object') {\n rows.push(getObjectFormRow(value, schemaValue, childName, onChange, onAdd, onRemove, level + 1));\n } else {\n rows.push(getStringFormRow(\n value, schemaValue, childName, onChange, onRemove, removable, \n () => handleKeyEdit(data, key, value, childName, onAdd, onRemove),\n removable\n ));\n }\n }\n\n if (rows.length || schema.additionalProperties) {\n let className = \"rjf-form-group-inner\";\n if (level === 0 && !rows.length)\n className = \"\";\n \n let coords = name;\n\n rows = (\n handleKeyValueAdd(data, coords, onAdd)}\n key={'row_group_' + name}\n >\n {rows}\n \n );\n }\n\n return rows;\n}\n\n\nfunction handleKeyValueAdd(data, coords, onAdd) {\n let key = prompt(\"Add new key\");\n if (key === null) // clicked cancel\n return;\n\n key = key.trim();\n if (!key)\n alert(\"(!) Can't add empty key.\\r\\n\\r\\n\");\n else if (data.hasOwnProperty(key))\n alert(\"(!) Duplicate keys not allowed. This key already exists.\\r\\n\\r\\n\");\n else\n onAdd(\"\", coords + '-' + key); \n}\n\n\nfunction handleKeyEdit(data, key, value, coords, onAdd, onRemove) {\n let newKey = prompt(\"Rename key\", key);\n if (newKey === null) // clicked cancel\n return;\n\n newKey = newKey.trim();\n\n if (newKey === key) // same keys\n return;\n\n if (!newKey)\n return alert(\"(!) Key name can't be empty.\\r\\n\\r\\n\");\n else if (data.hasOwnProperty(newKey))\n return alert(\"(!) Duplicate keys not allowed. This key already exists.\\r\\n\\r\\n\");\n\n onAdd(value, name + '-' + newKey);\n onRemove(coords);\n}\n","import {getBlankData, getSyncedData} from './data';\nimport {getArrayFormRow, getObjectFormRow} from './ui';\nimport {EditorContext} from './util';\n\n\nexport default class Form extends React.Component {\n constructor(props) {\n super(props);\n\n this.dataInput = document.getElementById(this.props.dataInputId);\n this.schema = props.schema;\n\n let data = props.data;\n\n if (!data) {\n // create empty data from schema\n data = getBlankData(this.schema);\n } else {\n // data might be stale if schema has new keys, so add them to data\n try {\n data = getSyncedData(data, this.schema);\n } catch (error) {\n console.log(\"Error: Schema and data don't match\");\n console.log(error);\n }\n }\n\n this.state = {\n value: '',\n data: data\n };\n \n // update data in the input\n this.populateDataInput();\n }\n\n componentDidUpdate(prevProps, prevState) {\n if (this.state.data !== prevState.data) {\n this.populateDataInput();\n }\n }\n\n populateDataInput = () => {\n this.dataInput.value = JSON.stringify(this.state.data);\n }\n\n handleChange = (coords, value) => {\n /*\n e.target.name is a chain of indices and keys:\n xxx-0-key-1-key2 and so on.\n These can be used as coordinates to locate \n a particular deeply nested item.\n\n This first coordinate is not important and should be removed.\n */\n coords = coords.split('-');\n\n coords.shift(); // remove first coord\n\n function setDataUsingCoords(coords, data, value) {\n let coord = coords.shift();\n if (!isNaN(Number(coord)))\n coord = Number(coord);\n\n if (coords.length) {\n setDataUsingCoords(coords, data[coord], value);\n } else {\n data[coord] = value;\n }\n }\n\n let _data = JSON.parse(JSON.stringify(this.state.data));\n\n setDataUsingCoords(coords, _data, value);\n\n this.setState({data: _data});\n }\n\n getFields = () => {\n let data = this.state.data;\n let formGroups = [];\n\n try {\n let type = this.schema.type;\n \n if (type === 'list')\n type = 'array';\n else if (type === 'dict')\n type = 'object';\n\n if (type === 'array') {\n return getArrayFormRow(\n data, this.schema, 'rjf',\n this.handleChange, this.addFieldset, this.removeFieldset,\n 0\n );\n } else if (type === 'object') {\n return getObjectFormRow(\n data, this.schema, 'rjf',\n this.handleChange, this.addFieldset, this.removeFieldset,\n 0\n );\n }\n } catch (error) {\n formGroups = (\n \n (!) Error: Schema and data do not match.\n
\n );\n }\n\n return formGroups;\n }\n\n addFieldset = (blankData, coords) => {\n coords = coords.split('-');\n coords.shift();\n\n this.setState((state) => {\n function addDataUsingCoords(coords, data, value) {\n let coord = coords.shift();\n if (!isNaN(Number(coord)))\n coord = Number(coord);\n\n if (coords.length) {\n addDataUsingCoords(coords, data[coord], value);\n } else {\n if (Array.isArray(data[coord])) {\n data[coord].push(value);\n }\n else {\n if (Array.isArray(data)) {\n data.push(value);\n } else {\n data[coord] = value;\n }\n }\n }\n }\n\n let _data = JSON.parse(JSON.stringify(state.data));\n\n addDataUsingCoords(coords, _data, blankData);\n\n return {data: _data};\n });\n }\n\n removeFieldset = (coords) => {\n coords = coords.split('-');\n coords.shift();\n\n this.setState((state) => {\n function removeDataUsingCoords(coords, data) {\n let coord = coords.shift();\n if (!isNaN(Number(coord)))\n coord = Number(coord);\n\n if (coords.length) {\n removeDataUsingCoords(coords, data[coord]);\n } else {\n if (Array.isArray(data))\n data = data.splice(coord, 1); // in-place mutation\n else\n delete data[coord];\n }\n }\n\n let _data = JSON.parse(JSON.stringify(state.data));\n\n removeDataUsingCoords(coords, _data);\n\n return {data: _data};\n });\n }\n\n render() {\n return (\n \n
\n \n );\n }\n}\n","import JSONForm from './renderer';\n\n\nexport default {\n JSONForm,\n};","import Form from './form';\n\n\nexport default function JSONForm(config) {\n this.containerId = config.containerId;\n this.dataInputId = config.dataInputId;\n this.schema = config.schema;\n this.data = config.data;\n this.fileUploadEndpoint = config.fileUploadEndpoint;\n this.fieldName = config.fieldName;\n this.modelName = config.modelName;\n\n this.render = function() {\n ReactDOM.render(\n ,\n document.getElementById(this.containerId)\n );\n }\n}"],"names":["getBlankObject","schema","keys","schema_keys","properties","key","value","type","getBlankArray","items","push","getBlankData","getSyncedArray","data","newData","JSON","parse","stringify","i","length","item","getSyncedObject","Object","schemaValue","hasOwnProperty","Button","className","props","React","children","Loader","EditorContext","createContext","FormInput","label","inputRef","ref","FormCheckInput","name","toUpperCase","undefined","checked","FormRadioInput","options","map","option","inputValue","FormSelectInput","defaultValue","disabled","FormFileInput","_this","getFileName","extractFileInfo","dataURL","dataURI","splitted","split","params","replace","filter","param","binary","atob","array","charCodeAt","blob","window","Blob","Uint8Array","dataURItoBlob","size","addNameToDataURL","encodeURIComponent","handleChange","e","file","target","files","fileName","reader","FileReader","onload","event","result","onChange","readAsDataURL","endpoint","context","fileUploadEndpoint","console","error","alert","setState","loading","formData","FormData","append","fieldName","modelName","slice","fetch","method","headers","document","cookie","trim","indexOf","body","then","response","json","file_path","showFileBrowser","current","click","state","createRef","componentDidUpdate","prevProps","prevState","this","render","Component","GroupTitle","FormRow","onRemove","onClick","title","FormGroup","hasChildren","Children","count","innerClassName","level","addable","onAdd","FormField","InputField","inputProps","choices","widget","format","editable","onEdit","valueType","callback","isNaN","Number","getStringFormRow","removable","getArrayFormRow","rows","groups","min_items","minItems","max_items","maxItems","childName","getObjectFormRow","coords","index","additionalProperties","k","string","charAt","substr","toLowerCase","getVerboseName","handleKeyEdit","prompt","handleKeyValueAdd","newKey","contextType","Form","populateDataInput","dataInput","shift","_data","setDataUsingCoords","coord","getFields","formGroups","addFieldset","removeFieldset","style","color","blankData","addDataUsingCoords","Array","isArray","removeDataUsingCoords","splice","getElementById","dataInputId","log","Provider","JSONForm","config","containerId","ReactDOM"],"mappings":"gvBAAgBA,EAAeC,GAC3B,IAAIC,EAAO,GAEPC,EAAcF,EAAOC,MAAQD,EAAOG,WAExC,IAAK,IAAIC,KAAOF,EAAa,CACzB,IAAIG,EAAQH,EAAYE,GACpBE,EAAOD,EAAMC,KAOjB,GALa,SAATA,EACAA,EAAO,QACO,SAATA,IACLA,EAAO,UAEE,UAATA,EACAL,EAAKG,GAAOG,EAAcF,WACZ,WAATC,EACLL,EAAKG,GAAOL,EAAeM,WACb,WAATC,EACLL,EAAKG,GAAO,WACS,WAAhBJ,EAAOM,KACZ,MAAO,GAGf,OAAOL,WAIKM,EAAcP,GAC1B,IAAIQ,EAAQ,GACRF,EAAON,EAAOQ,MAAMF,KAgBxB,MAda,SAATA,EACAA,EAAO,QACO,SAATA,IACLA,EAAO,UAEE,UAATA,EACAE,EAAMC,KAAKF,EAAcP,EAAOQ,QAClB,WAATF,EACLE,EAAMC,KAAKV,EAAeC,EAAOQ,SACnB,WAATF,GAEgB,WAAhBN,EAAOM,OADZE,EAAMC,KAAK,IAIRD,WAIKE,EAAaV,GACzB,IAAIM,EAAON,EAAOM,KAOlB,MALa,SAATA,EACAA,EAAO,QACO,SAATA,IACLA,EAAO,UAEE,UAATA,EACOC,EAAcP,GAEP,WAATM,EACEP,EAAeC,GACN,WAATM,GAES,WAATA,EADA,UAQf,SAASK,EAAeC,EAAMZ,GAC1B,IAAIa,EAAUC,KAAKC,MAAMD,KAAKE,UAAUJ,IAEpCN,EAAON,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awC,EAAKlD,QAVd,OAqBfkD,EAAKiE,MAAQ,CACT9G,MAAO,GACPO,KAAMA,GAIVsC,EAAK4H,wDAGTzD,mBAAA,SAAmBC,EAAWC,GACtBC,KAAKL,MAAMvG,OAAS2G,EAAU3G,MAC9B4G,KAAKsD,uBA0IbrD,OAAA,WACI,OACI9F,2BAAKF,UAAU,oBACXE,gCAAUF,UAAU,kBAChBE,oBAACG,EAAcqK,UACX9L,MAAO,CACHmF,mBAAoBgC,KAAK9F,MAAM8D,mBAC/BS,UAAWuB,KAAK9F,MAAMuE,UACtBC,UAAWsB,KAAK9F,MAAMwE,YAG7BsB,KAAK4D,mBAtLQzJ,MAAM+F,iBCFzB,CACb0E,kBCD+BC,GAC7B7E,KAAK8E,YAAcD,EAAOC,YAC1B9E,KAAKyE,YAAcI,EAAOJ,YAC1BzE,KAAKxH,OAASqM,EAAOrM,OACrBwH,KAAK5G,KAAOyL,EAAOzL,KACnB4G,KAAKhC,mBAAqB6G,EAAO7G,mBACjCgC,KAAKvB,UAAYoG,EAAOpG,UACxBuB,KAAKtB,UAAYmG,EAAOnG,UAExBsB,KAAKC,OAAS,WACV8E,SAAS9E,OACL9F,oBAACkJ,GACG7K,OAAQwH,KAAKxH,OACbiM,YAAazE,KAAKyE,YAClBrL,KAAM4G,KAAK5G,KACX4E,mBAAoBgC,KAAKhC,mBACzBS,UAAWuB,KAAKvB,UAChBC,UAAWsB,KAAKtB,YAEpBK,SAASyF,eAAexE,KAAK8E"}
\ No newline at end of file
diff --git a/package.json b/package.json
index e9d8c53..b21d251 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "react-json-form",
- "version": "1.3.0",
+ "version": "1.4.0",
"description": "",
"type": "module",
"source": "./src/index.js",