@tinacms/forms
Advanced tools
Comparing version 0.1.0-alpha.0 to 0.1.0-alpha.1
@@ -59,2 +59,5 @@ /** | ||
submit: FormApi<S>['submit']; | ||
readonly mutators: { | ||
[key: string]: (...args: any[]) => any; | ||
}; | ||
readonly values: S; | ||
@@ -61,0 +64,0 @@ readonly name: any; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("final-form-arrays"),require("final-form")):"function"==typeof define&&define.amd?define(["exports","final-form-arrays","final-form"],e):e((t=t||self)["@tinacms/forms"]={},t.arrayMutators,t.finalForm)}(this,function(t,f,s){"use strict";f=f&&f.hasOwnProperty("default")?f.default:f;var c=function(){return(c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function p(n,r){var i,o,a,t,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(a=2&e[0]?o.return:e[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,e[1])).done)return a;switch(o=0,a&&(e=[2&e[0],a.value]),e[0]){case 0:case 1:a=e;break;case 4:return u.label++,{value:e[1],done:!1};case 5:u.label++,o=e[1],e=[0];continue;case 7:e=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){u=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){u.label=e[1];break}if(6===e[0]&&u.label<a[1]){u.label=a[1],a=e;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(e);break}a[2]&&u.ops.pop(),u.trys.pop();continue}e=r.call(n,u)}catch(t){e=[6,t],o=0}finally{i=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var e=(n.prototype.updateFields=function(t){this.fields=t},Object.defineProperty(n.prototype,"values",{get:function(){return this.finalForm.getState().values},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"name",{get:function(){return this.id},enumerable:!0,configurable:!0}),n.prototype.updateValues=function(t){var e=this;this.finalForm.batch(function(){e.finalForm.getState().active?function i(o,t,a){var u=o.getState().active;Object.entries(t).forEach(function(t){var e=t[0],n=t[1],r=a?a+"."+e:e;"object"==typeof n?u.startsWith(r)?i(o,n,r):o.change(r,n):r!==u&&o.change(r,n)})}(e.finalForm,t):function(r,t){Object.entries(t).forEach(function(t){var e=t[0],n=t[1];r.change(e,n)})}(e.finalForm,t)})},n);function n(t){var n=this,e=t.id,r=t.label,i=t.fields,o=t.actions,a=t.reset,u=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["id","label","fields","actions","reset"]);this.subscribe=function(t,e){return n.finalForm.subscribe(t,e)},this.submit=function(){return n.finalForm.submit()};var l=u.initialValues||{};this.__type=u.__type||"form",this.id=e,this.label=r,this.fields=i,this.finalForm=s.createForm(c({},u,{initialValues:l,onSubmit:function(n,r,i){return function(o,a,u,l){return new(u=u||Promise)(function(t,e){function n(t){try{i(l.next(t))}catch(t){e(t)}}function r(t){try{i(l.throw(t))}catch(t){e(t)}}function i(e){e.done?t(e.value):new u(function(t){t(e.value)}).then(n,r)}i((l=l.apply(o,a||[])).next())})}(this,void 0,void 0,function(){var e;return p(this,function(t){switch(t.label){case 0:return[4,u.onSubmit(n,r,i)];case 1:return e=t.sent(),r.initialize(n),[2,e]}})})},mutators:c({},f,u.mutators)})),this.meta=u.meta||{},this.reset=a,this.actions=o||[],this.initialValues=l,this.updateFields(this.fields)}t.Form=e,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("final-form-arrays"),require("final-form")):"function"==typeof define&&define.amd?define(["exports","final-form-arrays","final-form"],e):e((t=t||self)["@tinacms/forms"]={},t.arrayMutators,t.finalForm)}(this,function(t,l,s){"use strict";l=l&&l.hasOwnProperty("default")?l.default:l;var c=function(){return(c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function p(n,r){var i,o,a,t,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(a=2&e[0]?o.return:e[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,e[1])).done)return a;switch(o=0,a&&(e=[2&e[0],a.value]),e[0]){case 0:case 1:a=e;break;case 4:return u.label++,{value:e[1],done:!1};case 5:u.label++,o=e[1],e=[0];continue;case 7:e=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){u=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){u.label=e[1];break}if(6===e[0]&&u.label<a[1]){u.label=a[1],a=e;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(e);break}a[2]&&u.ops.pop(),u.trys.pop();continue}e=r.call(n,u)}catch(t){e=[6,t],o=0}finally{i=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var e=(n.prototype.updateFields=function(t){this.fields=t},Object.defineProperty(n.prototype,"mutators",{get:function(){return this.finalForm.mutators},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.finalForm.getState().values},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"name",{get:function(){return this.id},enumerable:!0,configurable:!0}),n.prototype.updateValues=function(t){var e=this;this.finalForm.batch(function(){e.finalForm.getState().active?function i(o,t,a){var u=o.getState().active;Object.entries(t).forEach(function(t){var e=t[0],n=t[1],r=a?a+"."+e:e;"object"==typeof n?u.startsWith(r)?i(o,n,r):o.change(r,n):r!==u&&o.change(r,n)})}(e.finalForm,t):function(r,t){Object.entries(t).forEach(function(t){var e=t[0],n=t[1];r.change(e,n)})}(e.finalForm,t)})},n);function n(t){var n=this,e=t.id,r=t.label,i=t.fields,o=t.actions,a=t.reset,u=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,["id","label","fields","actions","reset"]);this.subscribe=function(t,e){return n.finalForm.subscribe(t,e)},this.submit=function(){return n.finalForm.submit()};var f=u.initialValues||{};this.__type=u.__type||"form",this.id=e,this.label=r,this.fields=i,this.finalForm=s.createForm(c({},u,{initialValues:f,onSubmit:function(n,r,i){return function(o,a,u,f){return new(u=u||Promise)(function(t,e){function n(t){try{i(f.next(t))}catch(t){e(t)}}function r(t){try{i(f.throw(t))}catch(t){e(t)}}function i(e){e.done?t(e.value):new u(function(t){t(e.value)}).then(n,r)}i((f=f.apply(o,a||[])).next())})}(this,void 0,void 0,function(){var e;return p(this,function(t){switch(t.label){case 0:return[4,u.onSubmit(n,r,i)];case 1:return e=t.sent(),r.initialize(n),[2,e]}})})},mutators:c({},l,u.mutators)})),this.meta=u.meta||{},this.reset=a,this.actions=o||[],this.initialValues=f,this.updateFields(this.fields)}t.Form=e,Object.defineProperty(t,"__esModule",{value:!0})}); |
{ | ||
"name": "@tinacms/forms", | ||
"version": "0.1.0-alpha.0", | ||
"version": "0.1.0-alpha.1", | ||
"main": "build/index.js", | ||
@@ -44,3 +44,3 @@ "types": "build/index.d.ts", | ||
}, | ||
"gitHead": "d4f7387e59fcdb53e0bd0cbb835d5626fdd56a7f" | ||
"gitHead": "29e8e602729fa52cff5c2dd42e50bdcfd71e120a" | ||
} |
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
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
19398
9
114