react-jsonschema-form-manager
Advanced tools
Comparing version 0.0.11 to 0.1.0
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.JSONSchemaForm=e(require("react")):t.JSONSchemaForm=e(t.React)}(this,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=2)}([function(t,e,r){"use strict";function n(t){return null===t||void 0===t}function o(t){return!(!t||"object"!==(void 0===t?"undefined":a(t))||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function i(t,e,r){var i,l;if(n(t)||n(e))return!1;if(t.prototype!==e.prototype)return!1;if(f(t))return!!f(e)&&(t=u.call(t),e=u.call(e),c(t,e,r));if(o(t)){if(!o(e))return!1;if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}try{var p=s(t),d=s(e)}catch(t){return!1}if(p.length!=d.length)return!1;for(p.sort(),d.sort(),i=p.length-1;i>=0;i--)if(p[i]!=d[i])return!1;for(i=p.length-1;i>=0;i--)if(l=p[i],!c(t[l],e[l],r))return!1;return(void 0===t?"undefined":a(t))===(void 0===e?"undefined":a(e))}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=Array.prototype.slice,s=r(5),f=r(6),c=t.exports=function(t,e,r){return r||(r={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=(void 0===t?"undefined":a(t))&&"object"!=(void 0===e?"undefined":a(e))?r.strict?t===e:t==e:i(t,e,r))}},function(t,e,r){"use strict";function n(){return{onChange:function(){},stop:function(){}}}function o(t){return{onChange:function(){return t.updateIfChanged()},stop:function(){}}}function i(t){return function(e){var r=setInterval(function(){return e.updateIfChanged()},t);return{onChange:function(){},stop:function(){return clearInterval(r)}}}}Object.defineProperty(e,"__esModule",{value:!0}),e.ignoreUpdateStrategy=n,e.instantUpdateStrategy=o,e.intervalUpdateStrategy=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);Object.keys(n).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})});var o=r(8);Object.keys(o).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}})});var i=r(1);Object.keys(i).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return i[t]}})});var a=r(10),u=function(t){return t&&t.__esModule?t:{default:t}}(a);e.default=u.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.RESTFormManager=e.LocalStorageFormManager=void 0;var u=r(4),s=n(u),f=r(0),c=n(f),l=r(7),p=function t(){a(this,t)},d="form";e.LocalStorageFormManager=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d;a(this,e);var r=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.doUpdate=function(){return localStorage.setItem(r.key,JSON.stringify(r.formData)),Promise.resolve(r.formData)},r.submit=function(t){return r.formData=t||r.formData,r.doUpdate()},r.onChange=function(t){var e=t.formData;r.formData=e},r.sameData=function(){if(null!==localStorage.getItem(r.key)){return localStorage.getItem(r.key)===JSON.stringify(r.formData)}return!1},r.updateIfChanged=function(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||!r.sameData())return r.doUpdate()},r.key=t,r.formData={},r}return i(e,t),e}(p),e.RESTFormManager=function(t){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];a(this,e);var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.toSubmitRequest=function(t){return new Request(i.url,{method:"POST",body:JSON.stringify(t)})},i.submit=function(t){var e=t||i.formData,r=i.toSubmitRequest(e);return i.formData=e,i.savedFormData=e,(0,l.doFetch)(r,i.credentials).then(function(t){return t.json()})},i.onChange=function(t){var e=t.formData;i.formData=e},i.toUpdateRequest=function(){return i.patch?new Request(i.url,{method:"PATCH",body:s.default.createPatch(i.savedFormData,i.formData)}):new Request(i.url,{method:"PUT",body:JSON.stringify(i.formData)})},i.updateIfChanged=function(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||!(0,c.default)(i.formData,i.savedFormData)){i.savedFormData=i.formData;var t=i.toUpdateRequest();return(0,l.doFetch)(t,i.credentials).then(function(t){return t.json()})}},i.url=t,i.patch=n,i.credentials=r,i.formData={},i.savedFormData={},(0,l.checkCredentials)(r),i}return i(e,t),e}(p)},function(t,e,r){"use strict";var n,o,i,a,a,u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(r){if("object"===u(e)&&void 0!==t)t.exports=r();else{o=[],n=r,void 0!==(i="function"==typeof n?n.apply(e,o):n)&&(t.exports=i)}}(function(){return function t(e,r,n){function o(u,s){if(!r[u]){if(!e[u]){var f="function"==typeof a&&a;if(!s&&f)return a(u,!0);if(i)return i(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[u]={exports:{}};e[u][0].call(l.exports,function(t){var r=e[u][1][t];return o(r||t)},l,l.exports,t,e,r,n)}return r[u].exports}for(var i="function"==typeof a&&a,u=0;u<n.length;u++)o(n[u]);return o}({1:[function(t,e,r){function n(t){var e=t.op;return"remove"===e||"replace"===e||"copy"===e||"move"===e}function o(t,e){var r={};for(var n in t)r[n]=1;for(var o in e)delete r[o];return Object.keys(r)}function i(t){var e={};t.forEach(function(t){for(var r in t)e[r]=(e[r]||0)+1});var r=t.length;for(var n in e)e[n]<r&&delete e[n];return Object.keys(e)}function a(t){return void 0===t?"undefined":null===t?"null":Array.isArray(t)?"array":void 0===t?"undefined":u(t)}function s(t){return"add"===t.op}function f(t){return"remove"===t.op}function c(t,e,r){function n(r,i){var a=o[r+","+i];if(void 0===a){if(v(t[r-1],e[i-1]))a=n(r-1,i-1);else{var u=[];if(r>0){var s=n(r-1,i);u.push({operations:s.operations.concat({op:"remove",index:r-1}),cost:s.cost+1})}if(i>0){var f=n(r,i-1);u.push({operations:f.operations.concat({op:"add",index:r-1,value:e[i-1]}),cost:f.cost+1})}if(r>0&&i>0){var c=n(r-1,i-1);u.push({operations:c.operations.concat({op:"replace",index:r-1,original:t[r-1],value:e[i-1]}),cost:c.cost+1})}a=u.sort(function(t,e){return t.cost-e.cost})[0]}o[r+","+i]=a}return a}var o={"0,0":{operations:[],cost:0}},i=isNaN(t.length)||t.length<=0?0:t.length,a=isNaN(e.length)||e.length<=0?0:e.length,u=n(i,a).operations,c=u.reduce(function(t,e){var n=h(t,2),o=n[0],a=n[1];if(s(e)){var u=e.index+1+a,c=u<i+a?String(u):"-",l={op:e.op,path:r.add(c).toString(),value:e.value};return[o.concat(l),a+1]}if(f(e)){var l={op:e.op,path:r.add(String(e.index+a)).toString()};return[o.concat(l),a-1]}var p=r.add(String(e.index+a)),v=d(e.original,e.value,p);return[o.concat.apply(o,y(v)),a]},[[],0]),l=h(c,2),p=l[0];l[1];return p}function l(t,e,r){var n=[];return o(t,e).forEach(function(t){n.push({op:"remove",path:r.add(t).toString()})}),o(e,t).forEach(function(t){n.push({op:"add",path:r.add(t).toString(),value:e[t]})}),i([t,e]).forEach(function(o){n.push.apply(n,y(d(t[o],e[o],r.add(o))))}),n}function p(t,e,r){return v(t,e)?[]:[{op:"replace",path:r.toString(),value:e}]}function d(t,e,r){var n=a(t),o=a(e);return"array"==n&&"array"==o?c(t,e,r):"object"==n&&"object"==o?l(t,e,r):p(t,e,r)}var h=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t)){for(var r,n=[],o=t[Symbol.iterator]();!(r=o.next()).done&&(n.push(r.value),!e||n.length!==e););return n}throw new TypeError("Invalid attempt to destructure non-iterable instance")},y=function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)};r.isDestructive=n,r.subtract=o,r.intersection=i,r.objectType=a,r.diffArrays=c,r.diffObjects=l,r.diffValues=p,r.diffAny=d,Object.defineProperty(r,"__esModule",{value:!0});var v=t("./equal").compare},{"./equal":2}],2:[function(t,e,r){function n(t,e){for(var r=[],n=0,o=t.length;n<o;n++)r.push([t[n],e[n]]);return r}function o(t,e){return t.length===e.length&&n(t,e).every(function(t){return a(t[0],t[1])})}function i(t,e){var r=Object.keys(t);return!!o(r,Object.keys(e))&&r.every(function(r){return a(t[r],e[r])})}function a(t,e){return t===e||(Array.isArray(t)&&Array.isArray(e)?o(t,e):Object(t)===t&&Object(e)===e&&i(t,e))}r.compare=a,Object.defineProperty(r,"__esModule",{value:!0})},{}],3:[function(t,e,r){var n=function t(e,r,n){var o=Object.getOwnPropertyDescriptor(e,r);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,r,n)}if("value"in o&&o.writable)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},o=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":u(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};Object.defineProperty(r,"__esModule",{value:!0});r.MissingError=function(t){function e(t){i(this,e),n(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,"Value required at path: "+t),this.path=t,this.name=this.constructor.name}return o(e,t),e}(Error),r.InvalidOperationError=function(t){function e(t){i(this,e),n(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,"Invalid operation: "+t),this.op=t,this.name=this.constructor.name}return o(e,t),e}(Error),r.TestError=function(t){function e(t,r){i(this,e),n(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,"Test failed: "+t+" != "+r),this.actual=t,this.expected=r,this.name=this.constructor.name,this.actual=t,this.expected=r}return o(e,t),e}(Error)},{}],4:[function(t,e,r){function n(t,e){return e.map(function(e){var r=f[e.op];return void 0===r?new u(e.op):r(t,e)})}function o(t,e){var r=new s;return l(t,e,r)}function i(t,e){var r=s.fromJSON(e).evaluate(t);if(void 0!==r)return{op:"test",path:e,value:r.value}}function a(t,e){var r=new Array;return e.filter(p).forEach(function(e){var n=i(t,e.path);if(n&&r.push(n),"from"in e){var o=i(t,e.from);o&&r.push(o)}}),r}r.applyPatch=n,r.createPatch=o,r.createTests=a,Object.defineProperty(r,"__esModule",{value:!0});var u=t("./errors").InvalidOperationError,s=t("./pointer").Pointer,f=function(t){return t&&t.__esModule?t:{default:t}}(t("./patch")),c=t("./diff"),l=c.diffAny,p=c.isDestructive},{"./diff":1,"./errors":3,"./patch":5,"./pointer":6}],5:[function(t,e,r){function n(t,e,r){Array.isArray(t)?"-"==e?t.push(r):t.splice(e,0,r):t[e]=r}function o(t,e){Array.isArray(t)?t.splice(e,1):delete t[e]}function i(t,e){var r=l.fromJSON(e.path).evaluate(t);return void 0===r.parent?new h(e.path):(n(r.parent,r.key,e.value),null)}function a(t,e){var r=l.fromJSON(e.path).evaluate(t);return void 0===r.value?new h(e.path):(o(r.parent,r.key),null)}function u(t,e){var r=l.fromJSON(e.path).evaluate(t);return void 0===r.value?new h(e.path):(r.parent[r.key]=e.value,null)}function s(t,e){var r=l.fromJSON(e.from).evaluate(t);if(void 0===r.value)return new h(e.from);var i=l.fromJSON(e.path).evaluate(t);return void 0===i.parent?new h(e.path):(o(r.parent,r.key),n(i.parent,i.key,r.value),null)}function f(t,e){var r=l.fromJSON(e.from).evaluate(t);if(void 0===r.value)return new h(e.from);var i=l.fromJSON(e.path).evaluate(t);return void 0===i.parent?new h(e.path):(o(r.parent,r.key),n(i.parent,i.key,r.value),null)}function c(t,e){var r=l.fromJSON(e.path).evaluate(t);return p(r.value,e.value)?null:new y(r.value,e.value)}r.add=i,r.remove=a,r.replace=u,r.move=s,r.copy=f,r.test=c,Object.defineProperty(r,"__esModule",{value:!0});var l=t("./pointer").Pointer,p=t("./equal").compare,d=t("./errors"),h=d.MissingError,y=d.TestError},{"./equal":2,"./errors":3,"./pointer":6}],6:[function(t,e,r){function n(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function o(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}var i=function(){function t(t,e){for(var r in e){var n=e[r];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};Object.defineProperty(r,"__esModule",{value:!0});r.Pointer=function(){function t(){var e=void 0===arguments[0]?[""]:arguments[0];a(this,t),this.tokens=e}return i(t,{toString:{value:function(){return this.tokens.map(o).join("/")}},evaluate:{value:function(t){for(var e=null,r=null,n=1,o=this.tokens.length;n<o;n++)e=t,r=this.tokens[n],t=(e||{})[r];return{parent:e,key:r,value:t}}},push:{value:function(t){this.tokens.push(t)}},add:{value:function(e){return new t(this.tokens.concat(String(e)))}}},{fromJSON:{value:function(e){var r=e.split("/").map(n);if(""!==r[0])throw new Error("Invalid JSON Pointer: "+e);return new t(r)}}}),t}()},{}]},{},[4])(4)})},function(t,e,r){"use strict";function n(t){var e=[];for(var r in t)e.push(r);return e}e=t.exports="function"==typeof Object.keys?Object.keys:n,e.shim=n},function(t,e,r){"use strict";function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function o(t){return t&&"object"==(void 0===t?"undefined":i(t))&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();e=t.exports=a?n:o,e.supported=n,e.unsupported=o},function(t,e,r){"use strict";function n(t){if(void 0!==t&&null!==t&&"object"!==i(this.credentials)&&"function"!=typeof this.credentials)throw new Error("Credentials can be object or function(req)")}function o(t,e){return void 0===e||null===e?fetch(t):"object"===(void 0===e?"undefined":i(e))?fetch(t,e):fetch(e(t))}Object.defineProperty(e,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.checkCredentials=n,e.doFetch=o},function(t,e,r){"use strict";function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.RESTConfigResolver=e.StaticConfigResolver=void 0;var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};r(9);var u=function t(){i(this,t)};e.StaticConfigResolver=function(t){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i(this,e);var o=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.resolve=function(){return new Promise(function(t){setTimeout(function(){return t(o.configs)},o.delay)})},o.configs=t,o.delay=r,o}return o(e,t),e}(u),e.RESTConfigResolver=function(t){function e(t,r,o){i(this,e);var u=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));if(u.processResponse=function(t){var e=u;return 200!=t.status?t.json().then(function(t){return Promise.reject(new Error(t))}):t.json().then(function(t){var r={};return Object.assign(r,e.defaults,t),r}).catch(function(t){return t})},u.resolve=function(){if(void 0===u.credentials||null===u.credentials)return fetch(u.url).then(u.processResponse);if("object"===a(u.credentials))return fetch(u.url,u.credentials).then(u.processResponse);var t=new Request(u.url);return fetch(u.credentials(t)).then(u.processResponse)},u.url=t,u.credentials=r,u.defaults=o||{},void 0!==r&&null!==r&&"object"!==a(u.credentials)&&"function"!=typeof u.credentials)throw new Error("Credentials can be object or function(req)");return u}return o(e,t),e}(u)},function(t,e,r){"use strict";!function(t){function e(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t=String(t)),t}function n(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return b.iterable&&(e[Symbol.iterator]=function(){return e}),e}function o(t){this.map={},t instanceof o?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function i(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function a(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function u(t){var e=new FileReader,r=a(e);return e.readAsArrayBuffer(t),r}function s(t){var e=new FileReader,r=a(e);return e.readAsText(t),r}function f(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}function c(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function l(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,t)if("string"==typeof t)this._bodyText=t;else if(b.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(b.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(b.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(b.arrayBuffer&&b.blob&&g(t))this._bodyArrayBuffer=c(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!b.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t)&&!O(t))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=c(t)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):b.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},b.blob&&(this.blob=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(u)}),this.text=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return s(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(f(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},b.formData&&(this.formData=function(){return this.text().then(h)}),this.json=function(){return this.text().then(JSON.parse)},this}function p(t){var e=t.toUpperCase();return _.indexOf(e)>-1?e:t}function d(t,e){e=e||{};var r=e.body;if(t instanceof d){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new o(t.headers)),this.method=t.method,this.mode=t.mode,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new o(e.headers)),this.method=p(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function h(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}}),e}function y(t){var e=new o;return t.split(/\r?\n/).forEach(function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();e.append(n,o)}}),e}function v(t,e){e||(e={}),this.type="default",this.status="status"in e?e.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new o(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var b={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(b.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],g=function(t){return t&&DataView.prototype.isPrototypeOf(t)},O=ArrayBuffer.isView||function(t){return t&&m.indexOf(Object.prototype.toString.call(t))>-1};o.prototype.append=function(t,n){t=e(t),n=r(n);var o=this.map[t];this.map[t]=o?o+","+n:n},o.prototype.delete=function(t){delete this.map[e(t)]},o.prototype.get=function(t){return t=e(t),this.has(t)?this.map[t]:null},o.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},o.prototype.set=function(t,n){this.map[e(t)]=r(n)},o.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},o.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),n(t)},o.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),n(t)},o.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),n(t)},b.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var _=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this,{body:this._bodyInit})},l.call(d.prototype),l.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},v.error=function(){var t=new v(null,{status:0,statusText:""});return t.type="error",t};var w=[301,302,303,307,308];v.redirect=function(t,e){if(-1===w.indexOf(e))throw new RangeError("Invalid status code");return new v(null,{status:e,headers:{location:t}})},t.Headers=o,t.Request=d,t.Response=v,t.fetch=function(t,e){return new Promise(function(r,n){var o=new d(t,e),i=new XMLHttpRequest;i.onload=function(){var t={status:i.status,statusText:i.statusText,headers:y(i.getAllResponseHeaders()||"")};t.url="responseURL"in i?i.responseURL:t.headers.get("X-Request-URL");var e="response"in i?i.response:i.responseText;r(new v(e,t))},i.onerror=function(){n(new TypeError("Network request failed"))},i.ontimeout=function(){n(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&b.blob&&(i.responseType="blob"),o.headers.forEach(function(t,e){i.setRequestHeader(e,t)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v.ignoreUpdateStrategy;r=r(e),d.default.checkPropTypes(g,{manager:e,configResolver:t,updateStrategy:r},"props","react-jsonschema-form-manager");var n=e.updateIfChanged;return e.updateIfChanged=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=n(t);return r&&r.then(function(t){return e.onUpdate(t)}),r},function(n){var u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b,p=arguments.length>2&&void 0!==arguments[2]?arguments[2]:m;return function(c){function d(n){o(this,d);var a=i(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,n));return a.updateExternal=function(t,e){a.formData=t.formData,a.setState({formData:t.formData}),e&&e(t)},a.handleChange=function(t){e.onChange(t),r.onChange(t),a.updateExternal(t,a.props.onChange)},a.handleSubmit=function(t){e.submit(t.formData).then(function(){a.updateExternal(t,a.props.onSubmit)})},a.handleUpdate=function(t){a.setState({formData:t}),a.props.onUpdate&&a.props.onUpdate(t)},a.state={isLoading:!0,isError:!1},e.onUpdate=a.handleUpdate,t.resolve().then(function(t){a.setState({isLoading:!1,isEqual:!1,config:t,formData:t.formData})}).catch(function(t){a.setState({isLoading:!1,isError:!0,error:t})}),a}return a(d,c),f(d,[{key:"componentWillUnmount",value:function(){e.stop()}},{key:"shouldComponentUpdate",value:function(t,e){var r=(0,y.default)(e.formData,this.formData),n=e.isLoading===this.state.isLoading&&e.isError===this.state.isError;return!(0,y.default)(this.props,t)||!r||!n}},{key:"render",value:function(){var t=this.state,e=t.isLoading,r=t.isError,o=t.error,i=t.config,a=t.formData;if(e)return l.default.createElement(u,null);if(r)return l.default.createElement(p,{error:o});var f=Object.assign({},this.props,i,{formData:a});return l.default.createElement(n,s({},f,{onSubmit:this.handleSubmit,onChange:this.handleChange}))}}]),d}(c.Component)}}Object.defineProperty(e,"__esModule",{value:!0});var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},f=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();e.default=u;var c=r(11),l=n(c),p=r(12),d=n(p),h=r(0),y=n(h),v=r(1),b=function(t){function e(){return o(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return a(e,t),f(e,[{key:"render",value:function(){return l.default.createElement("div",{className:"container"},l.default.createElement("h1",null,"Loading"))}}]),e}(c.Component),m=function(t){function e(){return o(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return a(e,t),f(e,[{key:"render",value:function(){return l.default.createElement("div",{className:"container"},l.default.createElement("h4",null,"Error"),l.default.createElement("h2",null,this.props.error.message))}}]),e}(c.Component),g={configResolver:d.default.shape({resolve:d.default.func.isRequired}).isRequired,manager:d.default.shape({onChange:d.default.func.isRequired,submit:d.default.func.isRequired,updateIfChanged:d.default.func.isRequired}).isRequired,updateStrategy:d.default.shape({onChange:d.default.func.isRequired,stop:d.default.func.isRequired}).isRequired}},function(e,r){e.exports=t},function(t,e,r){"use strict";"function"==typeof Symbol&&Symbol.iterator;t.exports=r(13)()},function(t,e,r){"use strict";var n=r(14),o=r(15),i=r(16);t.exports=function(){function t(t,e,r,n,a,u){u!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var r={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e};return r.checkPropTypes=n,r.PropTypes=r,r}},function(t,e,r){"use strict";function n(t){return function(){return t}}var o=function(){};o.thatReturns=n,o.thatReturnsFalse=n(!1),o.thatReturnsTrue=n(!0),o.thatReturnsNull=n(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},t.exports=o},function(t,e,r){"use strict";function n(t,e,r,n,i,a,u,s){if(o(e),!t){var f;if(void 0===e)f=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,i,a,u,s],l=0;f=new Error(e.replace(/%s/g,function(){return c[l++]})),f.name="Invariant Violation"}throw f.framesToPop=1,f}}var o=function(t){};t.exports=n},function(t,e,r){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.JSONSchemaForm=t(require("react")):e.JSONSchemaForm=t(e.React)}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=3)}([function(t,r){t.exports=e},function(e,t,r){"use strict";function n(e){return null===e||void 0===e}function o(e){return!(!e||"object"!==(void 0===e?"undefined":a(e))||"number"!=typeof e.length)&&("function"==typeof e.copy&&"function"==typeof e.slice&&!(e.length>0&&"number"!=typeof e[0]))}function i(e,t,r){var i,l;if(n(e)||n(t))return!1;if(e.prototype!==t.prototype)return!1;if(s(e))return!!s(t)&&(e=u.call(e),t=u.call(t),c(e,t,r));if(o(e)){if(!o(t))return!1;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}try{var p=f(e),d=f(t)}catch(e){return!1}if(p.length!=d.length)return!1;for(p.sort(),d.sort(),i=p.length-1;i>=0;i--)if(p[i]!=d[i])return!1;for(i=p.length-1;i>=0;i--)if(l=p[i],!c(e[l],t[l],r))return!1;return(void 0===e?"undefined":a(e))===(void 0===t?"undefined":a(t))}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=Array.prototype.slice,f=r(6),s=r(7),c=e.exports=function(e,t,r){return r||(r={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=(void 0===e?"undefined":a(e))&&"object"!=(void 0===t?"undefined":a(t))?r.strict?e===t:e==t:i(e,t,r))}},function(e,t,r){"use strict";function n(){return{onChange:function(){},stop:function(){}}}function o(e){return{onChange:function(){return e.updateIfChanged()},stop:function(){}}}function i(e){return function(t){var r=setInterval(function(){return t.updateIfChanged()},e);return{onChange:function(){},stop:function(){return clearInterval(r)}}}}Object.defineProperty(t,"__esModule",{value:!0}),t.ignoreUpdateStrategy=n,t.instantUpdateStrategy=o,t.intervalUpdateStrategy=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4);Object.keys(n).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})});var o=r(9);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var i=r(2);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(11);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var u=r(12),f=function(e){return e&&e.__esModule?e:{default:e}}(u);t.default=f.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.RESTFormManager=t.LocalStorageFormManager=void 0;var u=r(5),f=n(u),s=r(1),c=n(s),l=r(8),p=function e(){a(this,e)},d="form";t.LocalStorageFormManager=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d;a(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.doUpdate=function(){return localStorage.setItem(r.key,JSON.stringify(r.formData)),Promise.resolve(r.formData)},r.submit=function(e){return r.formData=e||r.formData,r.doUpdate()},r.onChange=function(e){var t=e.formData;r.formData=t},r.sameData=function(){if(null!==localStorage.getItem(r.key)){return localStorage.getItem(r.key)===JSON.stringify(r.formData)}return!1},r.updateIfChanged=function(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||!r.sameData())return r.doUpdate()},r.key=e,r.formData={},r}return i(t,e),t}(p),t.RESTFormManager=function(e){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];a(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i.toSubmitRequest=function(e){return new Request(i.url,{method:"POST",body:JSON.stringify(e)})},i.submit=function(e){var t=e||i.formData,r=i.toSubmitRequest(t);return i.formData=t,i.savedFormData=t,(0,l.doFetch)(r,i.credentials).then(function(e){return e.json()})},i.onChange=function(e){var t=e.formData;i.formData=t},i.toUpdateRequest=function(){return i.patch?new Request(i.url,{method:"PATCH",body:f.default.createPatch(i.savedFormData,i.formData)}):new Request(i.url,{method:"PUT",body:JSON.stringify(i.formData)})},i.updateIfChanged=function(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||!(0,c.default)(i.formData,i.savedFormData)){i.savedFormData=i.formData;var e=i.toUpdateRequest();return(0,l.doFetch)(e,i.credentials).then(function(e){return e.json()})}},i.url=e,i.patch=n,i.credentials=r,i.formData={},i.savedFormData={},(0,l.checkCredentials)(r),i}return i(t,e),t}(p)},function(e,t,r){"use strict";var n,o,i,a,a,u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(r){if("object"===u(t)&&void 0!==e)e.exports=r();else{o=[],n=r,void 0!==(i="function"==typeof n?n.apply(t,o):n)&&(e.exports=i)}}(function(){return function e(t,r,n){function o(u,f){if(!r[u]){if(!t[u]){var s="function"==typeof a&&a;if(!f&&s)return a(u,!0);if(i)return i(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[u]={exports:{}};t[u][0].call(l.exports,function(e){var r=t[u][1][e];return o(r||e)},l,l.exports,e,t,r,n)}return r[u].exports}for(var i="function"==typeof a&&a,u=0;u<n.length;u++)o(n[u]);return o}({1:[function(e,t,r){function n(e){var t=e.op;return"remove"===t||"replace"===t||"copy"===t||"move"===t}function o(e,t){var r={};for(var n in e)r[n]=1;for(var o in t)delete r[o];return Object.keys(r)}function i(e){var t={};e.forEach(function(e){for(var r in e)t[r]=(t[r]||0)+1});var r=e.length;for(var n in t)t[n]<r&&delete t[n];return Object.keys(t)}function a(e){return void 0===e?"undefined":null===e?"null":Array.isArray(e)?"array":void 0===e?"undefined":u(e)}function f(e){return"add"===e.op}function s(e){return"remove"===e.op}function c(e,t,r){function n(r,i){var a=o[r+","+i];if(void 0===a){if(b(e[r-1],t[i-1]))a=n(r-1,i-1);else{var u=[];if(r>0){var f=n(r-1,i);u.push({operations:f.operations.concat({op:"remove",index:r-1}),cost:f.cost+1})}if(i>0){var s=n(r,i-1);u.push({operations:s.operations.concat({op:"add",index:r-1,value:t[i-1]}),cost:s.cost+1})}if(r>0&&i>0){var c=n(r-1,i-1);u.push({operations:c.operations.concat({op:"replace",index:r-1,original:e[r-1],value:t[i-1]}),cost:c.cost+1})}a=u.sort(function(e,t){return e.cost-t.cost})[0]}o[r+","+i]=a}return a}var o={"0,0":{operations:[],cost:0}},i=isNaN(e.length)||e.length<=0?0:e.length,a=isNaN(t.length)||t.length<=0?0:t.length,u=n(i,a).operations,c=u.reduce(function(e,t){var n=h(e,2),o=n[0],a=n[1];if(f(t)){var u=t.index+1+a,c=u<i+a?String(u):"-",l={op:t.op,path:r.add(c).toString(),value:t.value};return[o.concat(l),a+1]}if(s(t)){var l={op:t.op,path:r.add(String(t.index+a)).toString()};return[o.concat(l),a-1]}var p=r.add(String(t.index+a)),b=d(t.original,t.value,p);return[o.concat.apply(o,y(b)),a]},[[],0]),l=h(c,2),p=l[0];l[1];return p}function l(e,t,r){var n=[];return o(e,t).forEach(function(e){n.push({op:"remove",path:r.add(e).toString()})}),o(t,e).forEach(function(e){n.push({op:"add",path:r.add(e).toString(),value:t[e]})}),i([e,t]).forEach(function(o){n.push.apply(n,y(d(e[o],t[o],r.add(o))))}),n}function p(e,t,r){return b(e,t)?[]:[{op:"replace",path:r.toString(),value:t}]}function d(e,t,r){var n=a(e),o=a(t);return"array"==n&&"array"==o?c(e,t,r):"object"==n&&"object"==o?l(e,t,r):p(e,t,r)}var h=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){for(var r,n=[],o=e[Symbol.iterator]();!(r=o.next()).done&&(n.push(r.value),!t||n.length!==t););return n}throw new TypeError("Invalid attempt to destructure non-iterable instance")},y=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)};r.isDestructive=n,r.subtract=o,r.intersection=i,r.objectType=a,r.diffArrays=c,r.diffObjects=l,r.diffValues=p,r.diffAny=d,Object.defineProperty(r,"__esModule",{value:!0});var b=e("./equal").compare},{"./equal":2}],2:[function(e,t,r){function n(e,t){for(var r=[],n=0,o=e.length;n<o;n++)r.push([e[n],t[n]]);return r}function o(e,t){return e.length===t.length&&n(e,t).every(function(e){return a(e[0],e[1])})}function i(e,t){var r=Object.keys(e);return!!o(r,Object.keys(t))&&r.every(function(r){return a(e[r],t[r])})}function a(e,t){return e===t||(Array.isArray(e)&&Array.isArray(t)?o(e,t):Object(e)===e&&Object(t)===t&&i(e,t))}r.compare=a,Object.defineProperty(r,"__esModule",{value:!0})},{}],3:[function(e,t,r){var n=function e(t,r,n){var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,r,n)}if("value"in o&&o.writable)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},o=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":u(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};Object.defineProperty(r,"__esModule",{value:!0});r.MissingError=function(e){function t(e){i(this,t),n(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,"Value required at path: "+e),this.path=e,this.name=this.constructor.name}return o(t,e),t}(Error),r.InvalidOperationError=function(e){function t(e){i(this,t),n(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,"Invalid operation: "+e),this.op=e,this.name=this.constructor.name}return o(t,e),t}(Error),r.TestError=function(e){function t(e,r){i(this,t),n(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,"Test failed: "+e+" != "+r),this.actual=e,this.expected=r,this.name=this.constructor.name,this.actual=e,this.expected=r}return o(t,e),t}(Error)},{}],4:[function(e,t,r){function n(e,t){return t.map(function(t){var r=s[t.op];return void 0===r?new u(t.op):r(e,t)})}function o(e,t){var r=new f;return l(e,t,r)}function i(e,t){var r=f.fromJSON(t).evaluate(e);if(void 0!==r)return{op:"test",path:t,value:r.value}}function a(e,t){var r=new Array;return t.filter(p).forEach(function(t){var n=i(e,t.path);if(n&&r.push(n),"from"in t){var o=i(e,t.from);o&&r.push(o)}}),r}r.applyPatch=n,r.createPatch=o,r.createTests=a,Object.defineProperty(r,"__esModule",{value:!0});var u=e("./errors").InvalidOperationError,f=e("./pointer").Pointer,s=function(e){return e&&e.__esModule?e:{default:e}}(e("./patch")),c=e("./diff"),l=c.diffAny,p=c.isDestructive},{"./diff":1,"./errors":3,"./patch":5,"./pointer":6}],5:[function(e,t,r){function n(e,t,r){Array.isArray(e)?"-"==t?e.push(r):e.splice(t,0,r):e[t]=r}function o(e,t){Array.isArray(e)?e.splice(t,1):delete e[t]}function i(e,t){var r=l.fromJSON(t.path).evaluate(e);return void 0===r.parent?new h(t.path):(n(r.parent,r.key,t.value),null)}function a(e,t){var r=l.fromJSON(t.path).evaluate(e);return void 0===r.value?new h(t.path):(o(r.parent,r.key),null)}function u(e,t){var r=l.fromJSON(t.path).evaluate(e);return void 0===r.value?new h(t.path):(r.parent[r.key]=t.value,null)}function f(e,t){var r=l.fromJSON(t.from).evaluate(e);if(void 0===r.value)return new h(t.from);var i=l.fromJSON(t.path).evaluate(e);return void 0===i.parent?new h(t.path):(o(r.parent,r.key),n(i.parent,i.key,r.value),null)}function s(e,t){var r=l.fromJSON(t.from).evaluate(e);if(void 0===r.value)return new h(t.from);var i=l.fromJSON(t.path).evaluate(e);return void 0===i.parent?new h(t.path):(o(r.parent,r.key),n(i.parent,i.key,r.value),null)}function c(e,t){var r=l.fromJSON(t.path).evaluate(e);return p(r.value,t.value)?null:new y(r.value,t.value)}r.add=i,r.remove=a,r.replace=u,r.move=f,r.copy=s,r.test=c,Object.defineProperty(r,"__esModule",{value:!0});var l=e("./pointer").Pointer,p=e("./equal").compare,d=e("./errors"),h=d.MissingError,y=d.TestError},{"./equal":2,"./errors":3,"./pointer":6}],6:[function(e,t,r){function n(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function o(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var i=function(){function e(e,t){for(var r in t){var n=t[r];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};Object.defineProperty(r,"__esModule",{value:!0});r.Pointer=function(){function e(){var t=void 0===arguments[0]?[""]:arguments[0];a(this,e),this.tokens=t}return i(e,{toString:{value:function(){return this.tokens.map(o).join("/")}},evaluate:{value:function(e){for(var t=null,r=null,n=1,o=this.tokens.length;n<o;n++)t=e,r=this.tokens[n],e=(t||{})[r];return{parent:t,key:r,value:e}}},push:{value:function(e){this.tokens.push(e)}},add:{value:function(t){return new e(this.tokens.concat(String(t)))}}},{fromJSON:{value:function(t){var r=t.split("/").map(n);if(""!==r[0])throw new Error("Invalid JSON Pointer: "+t);return new e(r)}}}),e}()},{}]},{},[4])(4)})},function(e,t,r){"use strict";function n(e){var t=[];for(var r in e)t.push(r);return t}t=e.exports="function"==typeof Object.keys?Object.keys:n,t.shim=n},function(e,t,r){"use strict";function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function o(e){return e&&"object"==(void 0===e?"undefined":i(e))&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();t=e.exports=a?n:o,t.supported=n,t.unsupported=o},function(e,t,r){"use strict";function n(e){if(void 0!==e&&null!==e&&"object"!==i(this.credentials)&&"function"!=typeof this.credentials)throw new Error("Credentials can be object or function(req)")}function o(e,t){return void 0===t||null===t?fetch(e):"object"===(void 0===t?"undefined":i(t))?fetch(e,t):fetch(t(e))}Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.checkCredentials=n,t.doFetch=o},function(e,t,r){"use strict";function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.RESTConfigResolver=t.StaticConfigResolver=void 0;var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};r(10);var u=function e(){i(this,e)};t.StaticConfigResolver=function(e){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i(this,t);var o=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o.resolve=function(){return new Promise(function(e){setTimeout(function(){return e(o.configs)},o.delay)})},o.configs=e,o.delay=r,o}return o(t,e),t}(u),t.RESTConfigResolver=function(e){function t(e,r,o){i(this,t);var u=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(u.processResponse=function(e){var t=u;return 200!=e.status?e.json().then(function(e){return Promise.reject(new Error(e))}):e.json().then(function(e){var r={};return Object.assign(r,t.defaults,e),r}).catch(function(e){return e})},u.resolve=function(){if(void 0===u.credentials||null===u.credentials)return fetch(u.url).then(u.processResponse);if("object"===a(u.credentials))return fetch(u.url,u.credentials).then(u.processResponse);var e=new Request(u.url);return fetch(u.credentials(e)).then(u.processResponse)},u.url=e,u.credentials=r,u.defaults=o||{},void 0!==r&&null!==r&&"object"!==a(u.credentials)&&"function"!=typeof u.credentials)throw new Error("Credentials can be object or function(req)");return u}return o(t,e),t}(u)},function(e,t,r){"use strict";!function(e){function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function r(e){return"string"!=typeof e&&(e=String(e)),e}function n(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return v.iterable&&(t[Symbol.iterator]=function(){return t}),t}function o(e){this.map={},e instanceof o?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function i(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function a(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function u(e){var t=new FileReader,r=a(t);return t.readAsArrayBuffer(e),r}function f(e){var t=new FileReader,r=a(t);return t.readAsText(e),r}function s(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function c(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function l(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(v.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(v.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(v.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(v.arrayBuffer&&v.blob&&g(e))this._bodyArrayBuffer=c(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!v.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!O(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=c(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):v.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},v.blob&&(this.blob=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(u)}),this.text=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return f(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(s(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},v.formData&&(this.formData=function(){return this.text().then(h)}),this.json=function(){return this.text().then(JSON.parse)},this}function p(e){var t=e.toUpperCase();return _.indexOf(t)>-1?t:e}function d(e,t){t=t||{};var r=t.body;if(e instanceof d){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new o(e.headers)),this.method=e.method,this.mode=e.mode,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new o(t.headers)),this.method=p(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function h(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}}),t}function y(e){var t=new o;return e.split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}}),t}function b(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new o(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var v={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(v.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],g=function(e){return e&&DataView.prototype.isPrototypeOf(e)},O=ArrayBuffer.isView||function(e){return e&&m.indexOf(Object.prototype.toString.call(e))>-1};o.prototype.append=function(e,n){e=t(e),n=r(n);var o=this.map[e];this.map[e]=o?o+","+n:n},o.prototype.delete=function(e){delete this.map[t(e)]},o.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},o.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},o.prototype.set=function(e,n){this.map[t(e)]=r(n)},o.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},o.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),n(e)},o.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),n(e)},o.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),n(e)},v.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var _=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this,{body:this._bodyInit})},l.call(d.prototype),l.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var w=[301,302,303,307,308];b.redirect=function(e,t){if(-1===w.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},e.Headers=o,e.Request=d,e.Response=b,e.fetch=function(e,t){return new Promise(function(r,n){var o=new d(e,t),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:y(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;r(new b(t,e))},i.onerror=function(){n(new TypeError("Network request failed"))},i.ontimeout=function(){n(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&v.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:void 0)},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){return function(t){function r(e){return n(this,r),o(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e))}return i(r,t),u(r,[{key:"componentWillMount",value:function(){this.props.onReady(e)}},{key:"render",value:function(){return s.default.createElement("div",{className:"container"},s.default.createElement("h1",null,"Loading"))}}]),r}(f.Component)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.singleSourceLoadingComponentFactory=a;var f=r(0),s=function(e){return e&&e.__esModule?e:{default:e}}(f)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O.default,t=arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:b.ignoreUpdateStrategy;r=r(t),d.default.checkPropTypes(_,{manager:t,updateStrategy:r},"props","react-jsonschema-form-manager");var n=t.updateIfChanged;return t.updateIfChanged=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=n(e);return r&&r.then(function(e){return t.onUpdate(e)}),r},function(n,u){var p=arguments.length>2&&void 0!==arguments[2]?arguments[2]:m.default;return function(c){function d(e){o(this,d);var n=i(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,e));return n.updateExternal=function(e,t){n.formData=e.formData,n.setState({formData:e.formData}),t&&t(e)},n.handleChange=function(e){t.onChange(e),r.onChange(e),n.updateExternal(e,n.props.onChange)},n.handleSubmit=function(e){t.submit(e.formData).then(function(){n.updateExternal(e,n.props.onSubmit)})},n.handleUpdate=function(e){n.setState({formData:e}),n.props.onUpdate&&n.props.onUpdate(e)},n.handleConfigChange=function(e){e.resolve().then(function(e){n.setState({isLoading:!1,isEqual:!1,config:e,formData:e.formData})}).catch(function(e){n.setState({isLoading:!1,isError:!0,error:e})})},n.handleLoadReady=function(e){if(e&&e.hasOwnProperty("resolve"))console.log("triggered"),n.handleConfigChange(e);else{var t=new Error("Cannot render form without a proper ConfigResolver instance.");n.setState({isLoading:!1,isError:!0,error:t})}},n.state={isLoading:!0,isError:!1},t.onUpdate=n.handleUpdate,n.handleConfigChange=n.handleConfigChange.bind(n),n.handleLoadReady=n.handleLoadReady.bind(n),n}return a(d,c),s(d,[{key:"componentWillUnmount",value:function(){t.stop()}},{key:"shouldComponentUpdate",value:function(e,t){var r=(0,y.default)(t.formData,this.formData),n=t.isLoading===this.state.isLoading&&t.isError===this.state.isError;return!(0,y.default)(this.props,e)||!r||!n}},{key:"render",value:function(){var t=this.state,r=t.isLoading,o=t.isError,i=t.error,a=t.config,s=t.formData;if(r)return l.default.createElement(u,{onReady:this.handleLoadReady});if(o)return l.default.createElement(p,{error:i});var c=Object.assign({},this.props,a,{formData:s});return l.default.createElement("div",null,l.default.createElement(e,{onConfigChange:this.handleConfigChange}),l.default.createElement(n,f({},c,{onSubmit:this.handleSubmit,onChange:this.handleChange})))}}]),d}(c.Component)}}Object.defineProperty(t,"__esModule",{value:!0});var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.default=u;var c=r(0),l=n(c),p=r(13),d=n(p),h=r(1),y=n(h),b=r(2),v=r(18),m=n(v),g=r(19),O=n(g),_={manager:d.default.shape({onChange:d.default.func.isRequired,submit:d.default.func.isRequired,updateIfChanged:d.default.func.isRequired}).isRequired,updateStrategy:d.default.shape({onChange:d.default.func.isRequired,stop:d.default.func.isRequired}).isRequired}},function(e,t,r){"use strict";"function"==typeof Symbol&&Symbol.iterator;e.exports=r(14)()},function(e,t,r){"use strict";var n=r(15),o=r(16),i=r(17);e.exports=function(){function e(e,t,r,n,a,u){u!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return r.checkPropTypes=n,r.PropTypes=r,r}},function(e,t,r){"use strict";function n(e){return function(){return e}}var o=function(){};o.thatReturns=n,o.thatReturnsFalse=n(!1),o.thatReturnsTrue=n(!0),o.thatReturnsNull=n(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,r){"use strict";function n(e,t,r,n,i,a,u,f){if(o(t),!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,i,a,u,f],l=0;s=new Error(t.replace(/%s/g,function(){return c[l++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var o=function(e){};e.exports=n},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r(0),f=function(e){return e&&e.__esModule?e:{default:e}}(u),s=function(e){function t(){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),a(t,[{key:"render",value:function(){return f.default.createElement("div",{className:"container"},f.default.createElement("h4",null,"Error"),f.default.createElement("h2",null,this.props.error.message))}}]),t}(u.Component);t.default=s},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=r(0),f=function(e){function t(){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),a(t,[{key:"render",value:function(){return null}}]),t}(u.Component);t.default=f}])}); | ||
//# sourceMappingURL=main.js.map |
@@ -43,2 +43,14 @@ "use strict"; | ||
var _singleSourceLoadingComponentFactory = require("./components/singleSourceLoadingComponentFactory"); | ||
Object.keys(_singleSourceLoadingComponentFactory).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _singleSourceLoadingComponentFactory[key]; | ||
} | ||
}); | ||
}); | ||
var _withManager = require("./withManager"); | ||
@@ -45,0 +57,0 @@ |
@@ -27,2 +27,10 @@ "use strict"; | ||
var _DefaultErrorScreen = require("./components/DefaultErrorScreen"); | ||
var _DefaultErrorScreen2 = _interopRequireDefault(_DefaultErrorScreen); | ||
var _DefaultConfigManagementComponent = require("./components/DefaultConfigManagementComponent"); | ||
var _DefaultConfigManagementComponent2 = _interopRequireDefault(_DefaultConfigManagementComponent); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -36,65 +44,3 @@ | ||
var DefaultLoadingScreen = function (_Component) { | ||
_inherits(DefaultLoadingScreen, _Component); | ||
function DefaultLoadingScreen() { | ||
_classCallCheck(this, DefaultLoadingScreen); | ||
return _possibleConstructorReturn(this, (DefaultLoadingScreen.__proto__ || Object.getPrototypeOf(DefaultLoadingScreen)).apply(this, arguments)); | ||
} | ||
_createClass(DefaultLoadingScreen, [{ | ||
key: "render", | ||
value: function render() { | ||
return _react2.default.createElement( | ||
"div", | ||
{ className: "container" }, | ||
_react2.default.createElement( | ||
"h1", | ||
null, | ||
"Loading" | ||
) | ||
); | ||
} | ||
}]); | ||
return DefaultLoadingScreen; | ||
}(_react.Component); | ||
var DefaultErrorScreen = function (_Component2) { | ||
_inherits(DefaultErrorScreen, _Component2); | ||
function DefaultErrorScreen() { | ||
_classCallCheck(this, DefaultErrorScreen); | ||
return _possibleConstructorReturn(this, (DefaultErrorScreen.__proto__ || Object.getPrototypeOf(DefaultErrorScreen)).apply(this, arguments)); | ||
} | ||
_createClass(DefaultErrorScreen, [{ | ||
key: "render", | ||
value: function render() { | ||
return _react2.default.createElement( | ||
"div", | ||
{ className: "container" }, | ||
_react2.default.createElement( | ||
"h4", | ||
null, | ||
"Error" | ||
), | ||
_react2.default.createElement( | ||
"h2", | ||
null, | ||
this.props.error.message | ||
) | ||
); | ||
} | ||
}]); | ||
return DefaultErrorScreen; | ||
}(_react.Component); | ||
var propTypes = { | ||
configResolver: _propTypes2.default.shape({ | ||
resolve: _propTypes2.default.func.isRequired | ||
}).isRequired, | ||
manager: _propTypes2.default.shape({ | ||
@@ -111,3 +57,5 @@ onChange: _propTypes2.default.func.isRequired, | ||
function withManager(configResolver, manager) { | ||
function withManager() { | ||
var ConfigManagementComponent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _DefaultConfigManagementComponent2.default; | ||
var manager = arguments[1]; | ||
var updateStrategy = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _UpdateStrategy.ignoreUpdateStrategy; | ||
@@ -117,3 +65,3 @@ | ||
_propTypes2.default.checkPropTypes(propTypes, { manager: manager, configResolver: configResolver, updateStrategy: updateStrategy }, "props", "react-jsonschema-form-manager"); | ||
_propTypes2.default.checkPropTypes(propTypes, { manager: manager, updateStrategy: updateStrategy }, "props", "react-jsonschema-form-manager"); | ||
@@ -133,8 +81,7 @@ var origUpdate = manager.updateIfChanged; | ||
return function (FormComponent) { | ||
var LoadingScreen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DefaultLoadingScreen; | ||
var ErrorScreen = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DefaultErrorScreen; | ||
return function (FormComponent, LoadingComponent) { | ||
var ErrorScreen = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _DefaultErrorScreen2.default; | ||
var FormWithManager = function (_Component3) { | ||
_inherits(FormWithManager, _Component3); | ||
var FormWithManager = function (_Component) { | ||
_inherits(FormWithManager, _Component); | ||
@@ -144,7 +91,7 @@ function FormWithManager(props) { | ||
var _this3 = _possibleConstructorReturn(this, (FormWithManager.__proto__ || Object.getPrototypeOf(FormWithManager)).call(this, props)); | ||
var _this = _possibleConstructorReturn(this, (FormWithManager.__proto__ || Object.getPrototypeOf(FormWithManager)).call(this, props)); | ||
_this3.updateExternal = function (state, callback) { | ||
_this3.formData = state.formData; | ||
_this3.setState({ formData: state.formData }); | ||
_this.updateExternal = function (state, callback) { | ||
_this.formData = state.formData; | ||
_this.setState({ formData: state.formData }); | ||
if (callback) { | ||
@@ -155,35 +102,50 @@ callback(state); | ||
_this3.handleChange = function (state) { | ||
_this.handleChange = function (state) { | ||
manager.onChange(state); | ||
updateStrategy.onChange(state); | ||
_this3.updateExternal(state, _this3.props.onChange); | ||
_this.updateExternal(state, _this.props.onChange); | ||
}; | ||
_this3.handleSubmit = function (state) { | ||
_this.handleSubmit = function (state) { | ||
manager.submit(state.formData).then(function () { | ||
_this3.updateExternal(state, _this3.props.onSubmit); | ||
_this.updateExternal(state, _this.props.onSubmit); | ||
}); | ||
}; | ||
_this3.handleUpdate = function (formData) { | ||
_this3.setState({ formData: formData }); | ||
if (_this3.props.onUpdate) { | ||
_this3.props.onUpdate(formData); | ||
_this.handleUpdate = function (formData) { | ||
_this.setState({ formData: formData }); | ||
if (_this.props.onUpdate) { | ||
_this.props.onUpdate(formData); | ||
} | ||
}; | ||
_this3.state = { isLoading: true, isError: false }; | ||
manager.onUpdate = _this3.handleUpdate; | ||
_this.handleConfigChange = function (configResolver) { | ||
configResolver.resolve().then(function (config) { | ||
_this.setState({ | ||
isLoading: false, | ||
isEqual: false, | ||
config: config, | ||
formData: config.formData | ||
}); | ||
}).catch(function (error) { | ||
_this.setState({ isLoading: false, isError: true, error: error }); | ||
}); | ||
}; | ||
configResolver.resolve().then(function (config) { | ||
_this3.setState({ | ||
isLoading: false, | ||
isEqual: false, | ||
config: config, | ||
formData: config.formData | ||
}); | ||
}).catch(function (error) { | ||
_this3.setState({ isLoading: false, isError: true, error: error }); | ||
}); | ||
return _this3; | ||
_this.handleLoadReady = function (configResolver) { | ||
if (configResolver && configResolver.hasOwnProperty("resolve")) { | ||
console.log("triggered"); | ||
_this.handleConfigChange(configResolver); | ||
} else { | ||
var error = new Error("Cannot render form without a proper ConfigResolver instance."); | ||
_this.setState({ isLoading: false, isError: true, error: error }); | ||
} | ||
}; | ||
_this.state = { isLoading: true, isError: false }; | ||
manager.onUpdate = _this.handleUpdate; | ||
_this.handleConfigChange = _this.handleConfigChange.bind(_this); | ||
_this.handleLoadReady = _this.handleLoadReady.bind(_this); | ||
return _this; | ||
} | ||
@@ -214,4 +176,5 @@ | ||
if (isLoading) { | ||
return _react2.default.createElement(LoadingScreen, null); | ||
return _react2.default.createElement(LoadingComponent, { onReady: this.handleLoadReady }); | ||
} else if (isError) { | ||
@@ -221,6 +184,13 @@ return _react2.default.createElement(ErrorScreen, { error: error }); | ||
var configs = Object.assign({}, this.props, config, { formData: formData }); | ||
return _react2.default.createElement(FormComponent, _extends({}, configs, { | ||
onSubmit: this.handleSubmit, | ||
onChange: this.handleChange | ||
})); | ||
return _react2.default.createElement( | ||
"div", | ||
null, | ||
_react2.default.createElement(ConfigManagementComponent, { | ||
onConfigChange: this.handleConfigChange | ||
}), | ||
_react2.default.createElement(FormComponent, _extends({}, configs, { | ||
onSubmit: this.handleSubmit, | ||
onChange: this.handleChange | ||
})) | ||
); | ||
} | ||
@@ -227,0 +197,0 @@ } |
@@ -6,3 +6,3 @@ { | ||
"author": "mavarazy@gmail.com", | ||
"version": "0.0.11", | ||
"version": "0.1.0", | ||
"scripts": { | ||
@@ -9,0 +9,0 @@ "build:lib": "rimraf lib && cross-env NODE_ENV=production babel -d lib/ src/", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
307209
14
682
12
1