{"dependencies":[{"name":"react","loc":{"line":11,"column":20}},{"name":"../../src/index","loc":{"line":12,"column":22}},{"name":"material-ui/TextField","loc":{"line":13,"column":26}},{"name":"material-ui/Checkbox","loc":{"line":14,"column":25}},{"name":"material-ui/Toggle","loc":{"line":15,"column":23}},{"name":"material-ui/RadioButton","loc":{"line":16,"column":28}}],"generated":{"js":"\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n    for (var s, i = 1, n = arguments.length; i < n; i++) {\n        s = arguments[i];\n        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n            t[p] = s[p];\n    }\n    return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar React = require(\"react\");\nvar index_1 = require(\"../../src/index\");\nvar TextField_1 = require(\"material-ui/TextField\");\nvar Checkbox_1 = require(\"material-ui/Checkbox\");\nvar Toggle_1 = require(\"material-ui/Toggle\");\nvar RadioButton_1 = require(\"material-ui/RadioButton\");\n/*\nWe have to teach formable how to serialize custom inputs. We do this by\nproviding a `configureForm` function. This function recives the type of\nthe input along with the inputs props. Returning a configuration object\nlets us specify how each field is serialized. If we return undefined\nat the end, any unkown inputs are handeled as normal.\n*/\nvar configureForm = function (type, props) {\n    if (type === TextField_1.default) {\n        return {\n            eventName: 'onChange',\n            getValueFromEvent: function (e, val) { return val; },\n            defaultProp: 'defaultValue',\n            valueProp: 'value',\n            fieldErrorsToProps: function (errors) { return ({ errorText: errors.join(' ') }); },\n        };\n    }\n    if (type === Checkbox_1.default) {\n        return {\n            eventName: 'onCheck',\n            getValueFromEvent: function (e, val) { return val; },\n            defaultProp: 'defaultChecked',\n            valueProp: 'checked',\n        };\n    }\n    if (type === Toggle_1.default) {\n        return {\n            eventName: 'onToggle',\n            getValueFromEvent: function (e, val) { return val; },\n            defaultProp: 'defaultToggled',\n            valueProp: 'toggled',\n        };\n    }\n    if (type === RadioButton_1.RadioButtonGroup) {\n        return {\n            eventName: 'onChange',\n            getValueFromEvent: function (e, val) { return val; },\n            defaultProp: 'defaultSelected',\n            valueProp: 'valueSelected',\n        };\n    }\n};\nvar MaterialUiForm = function (props) { return (React.createElement(index_1.Form, __assign({}, props, { configureForm: configureForm }))); };\nexports.default = MaterialUiForm;\n//# sourceMappingURL=form.js.map"},"hash":"aae6319b41b2ab43eab7483236c7a06d"}