Comparing version 2.0.1-rc.9 to 2.0.1-rc.10
@@ -259,3 +259,2 @@ 'use strict'; | ||
var emptyTouched = {}; | ||
var emptyFieldRegistry = {}; | ||
function useFormik(_ref) { | ||
@@ -283,3 +282,3 @@ var _ref$validateOnChange = _ref.validateOnChange, | ||
var isMounted = React.useRef(false); | ||
var fieldRegistry = React.useRef(emptyFieldRegistry); | ||
var fieldRegistry = React.useRef({}); | ||
React.useEffect(function () { | ||
@@ -286,0 +285,0 @@ { |
@@ -1,2 +0,2 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),r=e(require("react-fast-compare")),n=e(require("deepmerge")),a=e(require("lodash/clone")),i=e(require("lodash/toPath")),o=e(require("tiny-warning")),u=require("scheduler"),l=e(require("hoist-non-react-statics")),s=e(require("lodash/cloneDeep"));function c(){return(c=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}).apply(this,arguments)}function p(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function d(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(a[r]=e[r]);return a}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var v=function(e){return"function"==typeof e},h=function(e){return null!==e&&"object"==typeof e},m=function(e){return String(Math.floor(Number(e)))===e},y=function(e){return"[object String]"===Object.prototype.toString.call(e)},E=function(e){return 0===t.Children.count(e)},S=function(e){return h(e)&&v(e.then)};function T(e,t,r,n){void 0===n&&(n=0);for(var a=i(t);e&&n<a.length;)e=e[a[n++]];return void 0===e?r:e}function b(e,t,r){for(var n=a(e),o=n,u=0,l=i(t);u<l.length-1;u++){var s=l[u],c=T(e,l.slice(0,u+1));if(c)o=o[s]=a(c);else{var p=l[u+1];o=o[s]=m(p)&&Number(p)>=0?[]:{}}}return(0===u?e:o)[l[u]]===r?e:(void 0===r?delete o[l[u]]:o[l[u]]=r,0===u&&void 0===r&&delete n[l[u]],n)}function g(e,t,r,n){void 0===r&&(r=new WeakMap),void 0===n&&(n={});for(var a=0,i=Object.keys(e);a<i.length;a++){var o=i[a],u=e[o];h(u)?r.get(u)||(r.set(u,!0),n[o]=Array.isArray(u)?[]:{},g(u,t,r,n[o])):n[o]=t}return n}var F=t.createContext({}),R=F.Provider,_=F.Consumer;function C(){var e=t.useContext(F);return e||o(!1),e}function O(e,t){switch(t.type){case"SET_VALUES":return c({},e,{values:t.payload});case"SET_TOUCHED":return c({},e,{touched:t.payload});case"SET_ERRORS":return c({},e,{errors:t.payload});case"SET_STATUS":return c({},e,{status:t.payload});case"SET_ISSUBMITTING":return c({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return c({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return c({},e,{values:b(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return c({},e,{touched:b(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return c({},e,{errors:b(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":case"SET_FORMIK_STATE":return c({},e,t.payload);case"SUBMIT_ATTEMPT":return c({},e,{touched:g(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return c({},e,{isSubmitting:!1});default:return e}}var I={},k={},P={};function A(e){var a=e.validateOnChange,i=void 0===a||a,o=e.validateOnBlur,l=void 0===o||o,s=e.isInitialValid,p=e.enableReinitialize,f=void 0!==p&&p,h=e.onSubmit,m=d(e,["validateOnChange","validateOnBlur","isInitialValid","enableReinitialize","onSubmit"]),E=c({validateOnChange:i,validateOnBlur:l,onSubmit:h},m),g=t.useRef(E.initialValues),F=t.useRef(E.initialErrors||I),R=t.useRef(E.initialTouched||k),_=t.useRef(E.initialStatus),C=t.useRef(!1),A=t.useRef(P);t.useEffect(function(){},[s]),t.useEffect(function(){return C.current=!0,function(){C.current=!1}},[]);var x=t.useReducer(O,{values:E.initialValues,errors:E.initialErrors||I,touched:E.initialTouched||k,status:E.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),M=x[0],w=x[1],j=t.useCallback(function(e,t){return new Promise(function(r,n){var a=E.validate(e,t);null==a?r(I):S(a)?a.then(function(e){r(e||I)},function(e){n(e)}):r(a)})},[E.validate]),N=t.useCallback(function(e,t){return new Promise(function(r,n){var a=E.validationSchema,i=v(a)?a(t):a;(t&&i.validateAt?i.validateAt(t,e):V(e,i)).then(function(){r(I)},function(e){"ValidationError"===e.name?r(D(e)):n(e)})})},[E.validationSchema]),B=t.useCallback(function(e,t){return new Promise(function(r){return r(A.current[e].validate(t))})},[]),q=t.useCallback(function(e,t){if(t)return A.current[t]&&v(A.current[t].validate)?B(t,T(e,t)).then(function(e){return b(I,t,e)}):Promise.resolve(I);var r=Object.keys(A.current).filter(function(e){return v(A.current[e].validate)}),n=r.length>0?r.map(function(t){return B(t,T(e,t))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then(function(e){return e.reduce(function(e,t,n){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===t?e:(t&&(e=b(e,r[n],t)),e)},{})})},[B]),G=t.useCallback(function(e,t){return Promise.all([q(e,t),E.validationSchema?N(e,t):{},E.validate?j(e,t):{}]).then(function(e){return n.all([e[0],e[1],e[2]],{arrayMerge:U})})},[E.validate,E.validationSchema,q,j,N]),W=L(function(e,t){return void 0===e&&(e=M.values),u.unstable_runWithPriority(u.LowPriority,function(){return G(e,t).then(function(e){return C.current&&w(t?{type:"SET_FIELD_ERROR",payload:{field:t,value:e&&e[t]}}:{type:"SET_ERRORS",payload:e}),e})})},[G,M.values]),H=L(function(e,t){return void 0===e&&(e=M.values),w({type:"SET_ISVALIDATING",payload:!0}),G(e,t).then(function(e){return C.current&&(w({type:"SET_ISVALIDATING",payload:!1}),w(t?{type:"SET_FIELD_ERROR",payload:{field:t,value:e&&e[t]}}:{type:"SET_ERRORS",payload:e})),e})},[M.values,M.errors,G]),K=t.useCallback(function(e){var t=e&&e.values?e.values:g.current,r=e&&e.errors?e.errors:F.current?F.current:E.initialErrors||{},n=e&&e.touched?e.touched:R.current?R.current:E.initialTouched||{},a=e&&e.status?e.status:_.current?_.current:E.initialStatus;g.current=t,F.current=r,R.current=n,_.current=a,w({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:r,touched:n,status:a,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})},[E.initialErrors,E.initialStatus,E.initialTouched]);t.useEffect(function(){f&&!0===C.current&&!r(g.current,E.initialValues)&&(g.current=E.initialValues,K())},[f,E.initialValues,K]);var Y=L(function(e){if(v(A.current[e].validate)){var t=T(M.values,e),r=A.current[e].validate(t);return S(r)?(w({type:"SET_ISVALIDATING",payload:!0}),r.then(function(e){return e}).then(function(t){w({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),w({type:"SET_ISVALIDATING",payload:!1})})):(w({type:"SET_FIELD_ERROR",payload:{field:e,value:r}}),Promise.resolve(r))}return Promise.resolve()},[M.values]),z=t.useCallback(function(e,t){A.current[e]={validate:t.validate}},[]),J=t.useCallback(function(e){delete A.current[e]},[]),Q=L(function(e){return w({type:"SET_TOUCHED",payload:e}),l?W(M.values):Promise.resolve()},[W,M.values,l]),X=t.useCallback(function(e){w({type:"SET_ERRORS",payload:e})},[]),Z=L(function(e){return w({type:"SET_VALUES",payload:e}),i?W(M.values):Promise.resolve()},[W,M.values,i]),$=t.useCallback(function(e,t){w({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})},[]),ee=L(function(e,t,r){return void 0===r&&(r=!0),w({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),i&&r?W(b(M.values,e,t),e):Promise.resolve()},[W,M.values,i]),te=t.useCallback(function(e,t){var r,n=t,a=e;if(!y(e)){e.persist&&e.persist();var i=e.target,o=i.type,u=i.value,l=i.checked,s=i.options,c=i.multiple;n=t||i.name||i.id,a=/number|range/.test(o)?(r=parseFloat(u),isNaN(r)?"":r):/checkbox/.test(o)?function(e,t,r){if("true"==r||"false"==r)return!!t;if(t)return Array.isArray(e)?e.concat(r):[r];if(!Array.isArray(e))return!!e;var n=e.indexOf(r);return n<0?e:e.slice(0,n).concat(e.slice(n+1))}(T(M.values,n),l,u):c?function(e){return e.filter(function(e){return e.selected}).map(function(e){return e.value})}(s):u}n&&ee(n,a)},[ee,M.values]),re=t.useCallback(function(e){if(y(e))return function(t){return te(t,e)};te(e)},[te]),ne=L(function(e,t,r){return void 0===t&&(t=!0),void 0===r&&(r=!0),w({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),l&&r?W(M.values,e):Promise.resolve()},[W,M.values,l]),ae=t.useCallback(function(e,t){e.persist&&e.persist();var r=e.target;ne(t||r.name||r.id,!0)},[ne]),ie=t.useCallback(function(e){if(y(e))return function(t){return ae(t,e)};ae(e)},[ae]);function oe(e){v(e)?w({type:"SET_FORMIK_STATE",payload:e(M)}):w({type:"SET_FORMIK_STATE",payload:e})}var ue=t.useCallback(function(e){w({type:"SET_STATUS",payload:e})},[]),le=t.useCallback(function(e){w({type:"SET_ISSUBMITTING",payload:e})},[]),se={resetForm:K,validateForm:H,validateField:Y,setErrors:X,setFieldError:$,setFieldTouched:ne,setFieldValue:ee,setStatus:ue,setSubmitting:le,setTouched:Q,setValues:Z,setFormikState:oe},ce=L(function(){return h(M.values,se)},[se,h,M.values]),pe=L(function(){return w({type:"SUBMIT_ATTEMPT"}),H().then(function(e){if(0===Object.keys(e).length)return Promise.resolve(ce()).then(function(){C.current&&w({type:"SUBMIT_SUCCESS"})}).catch(function(e){if(C.current)throw w({type:"SUBMIT_FAILURE"}),e});C.current&&w({type:"SUBMIT_FAILURE"})})},[ce,H]),de=L(function(e){e&&e.preventDefault&&v(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&v(e.stopPropagation)&&e.stopPropagation(),pe()},[pe]),fe=L(function(e){if(e&&e.preventDefault&&v(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&v(e.stopPropagation)&&e.stopPropagation(),E.onReset){var t=E.onReset(M.values,se);S(t)?t.then(K):K()}else K()},[se,E.onReset,K,M.values]),ve=t.useCallback(function(e){return{value:T(M.values,e),error:T(M.errors,e),touched:!!T(M.touched,e),initialValue:T(g.current,e),initialTouched:!!T(R.current,e),initialError:T(F.current,e)}},[M.errors,M.touched,M.values]),he=t.useCallback(function(e){var t=e.name,r=e.type,n=e.value,a=e.as,i=e.multiple,o=T(M.values,t),u={name:t,value:o,onChange:re,onBlur:ie};return"checkbox"===r?void 0===n?u.checked=!!o:(u.checked=!(!Array.isArray(o)||!~o.indexOf(n)),u.value=n):"radio"===r?(u.checked=o===n,u.value=n):"select"===a&&i&&(u.value=u.value||[],u.multiple=!0),[u,ve(t)]},[ve,ie,re,M.values]),me=t.useMemo(function(){return!r(g.current,M.values)},[M.values]),ye=t.useMemo(function(){return void 0!==s?me?M.errors&&0===Object.keys(M.errors).length:!1!==s&&v(s)?s(E):s:M.errors&&0===Object.keys(M.errors).length},[s,me,M.errors,E]);return c({},M,{initialValues:g.current,initialErrors:F.current,initialTouched:R.current,initialStatus:_.current,handleBlur:ie,handleChange:re,handleReset:fe,handleSubmit:de,resetForm:K,setErrors:X,setFormikState:oe,setFieldTouched:ne,setFieldValue:ee,setFieldError:$,setStatus:ue,setSubmitting:le,setTouched:Q,setValues:Z,submitForm:pe,validateForm:H,validateField:Y,isValid:ye,dirty:me,unregisterField:J,registerField:z,getFieldProps:he,validateOnBlur:l,validateOnChange:i})}function x(e){var r=A(e),n=e.component,a=e.children,i=e.render;return t.createElement(R,{value:r},n?t.createElement(n,r):i?i(r):a?v(a)?a(r):E(a)?null:t.Children.only(a):null)}function D(e){var t={};if(0===e.inner.length)return b(t,e.path,e.message);var r=e.inner,n=Array.isArray(r),a=0;for(r=n?r:r[Symbol.iterator]();;){var i;if(n){if(a>=r.length)break;i=r[a++]}else{if((a=r.next()).done)break;i=a.value}t[i.path]||(t=b(t,i.path,i.message))}return t}function V(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n={});var a={};for(var i in e)if(e.hasOwnProperty(i)){var o=String(i);a[o]=""!==e[o]?e[o]:void 0}return t[r?"validateSync":"validate"](a,{abortEarly:!1,context:n})}function U(e,t,r){var a=e.slice();return t.forEach(function(t,i){if(void 0===a[i]){var o=!1!==r.clone&&r.isMergeableObject(t);a[i]=o?n(Array.isArray(t)?[]:{},t,r):t}else r.isMergeableObject(t)?a[i]=n(e[i],t,r):-1===e.indexOf(t)&&a.push(t)}),a}function L(e,r){var n=t.useRef(function(){throw new Error("Cannot call an event handler while rendering.")});return t.useEffect(function(){n.current=e},[e].concat(r)),t.useCallback(function(){return n.current.apply(void 0,arguments)},[n])}function M(e){var r=e.validate,n=e.name,a=e.render,i=e.children,o=e.as,u=e.component,l=d(e,["validate","name","render","children","as","component"]),s=d(C(),["validate","validationSchema"]);t.useEffect(function(){},[]),t.useEffect(function(){return s.registerField(n,{validate:r}),function(){s.unregisterField(n)}},[s,n,r]);var p=s.getFieldProps(c({name:n},l)),f=p[0],h=p[1],m={field:f,form:s};if(a)return a(m);if(v(i))return i(c({},m,{meta:h}));if(u){if("string"==typeof u){var y=l.innerRef,E=d(l,["innerRef"]);return t.createElement(u,c({ref:y},f,E),i)}return t.createElement(u,c({field:f,form:s},l),i)}var S=o||"input";if("string"==typeof S){var T=l.innerRef,b=d(l,["innerRef"]);return t.createElement(S,c({ref:T},f,b),i)}return t.createElement(S,c({},f,l),i)}var w=M;function j(e){var r=C();return t.createElement("form",Object.assign({onSubmit:r.handleSubmit,onReset:r.handleReset},e))}function N(e){var r=function(r){return t.createElement(_,null,function(n){return n||o(!1),t.createElement(e,Object.assign({},r,{formik:n}))})},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return r.WrappedComponent=e,r.displayName="FormikConnect("+n+")",l(r,e)}j.displayName="Form";var B=function(e,t,r){var n=[].concat(e||[]),a=n[t];return n.splice(t,1),n.splice(r,0,a),n},q=function(e,t,r){var n=[].concat(e||[]),a=n[t];return n[t]=n[r],n[r]=a,n},G=function(e,t,r){var n=[].concat(e||[]);return n.splice(t,0,r),n},W=function(e,t,r){var n=[].concat(e||[]);return n[t]=r,n},H=function(e){function r(t){var r;return(r=e.call(this,t)||this).updateArrayField=function(e,t,n){var a=r.props,i=a.name,o=a.validateOnChange,u=a.formik,l=u.validateForm;(0,u.setFormikState)(function(r){var a="function"==typeof n?n:e,o="function"==typeof t?t:e;return c({},r,{values:b(r.values,i,e(T(r.values,i))),errors:n?b(r.errors,i,a(T(r.errors,i))):r.errors,touched:t?b(r.touched,i,o(T(r.touched,i))):r.touched})},function(){o&&l()})},r.push=function(e){return r.updateArrayField(function(t){return[].concat(t||[],[s(e)])},!1,!1)},r.handlePush=function(e){return function(){return r.push(e)}},r.swap=function(e,t){return r.updateArrayField(function(r){return q(r,e,t)},!0,!0)},r.handleSwap=function(e,t){return function(){return r.swap(e,t)}},r.move=function(e,t){return r.updateArrayField(function(r){return B(r,e,t)},!0,!0)},r.handleMove=function(e,t){return function(){return r.move(e,t)}},r.insert=function(e,t){return r.updateArrayField(function(r){return G(r,e,t)},function(t){return G(t,e,null)},function(t){return G(t,e,null)})},r.handleInsert=function(e,t){return function(){return r.insert(e,t)}},r.replace=function(e,t){return r.updateArrayField(function(r){return W(r,e,t)},!1,!1)},r.handleReplace=function(e,t){return function(){return r.replace(e,t)}},r.unshift=function(e){var t=-1;return r.updateArrayField(function(r){var n=r?[e].concat(r):[e];return t<0&&(t=n.length),n},function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r},function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r}),t},r.handleUnshift=function(e){return function(){return r.unshift(e)}},r.handleRemove=function(e){return function(){return r.remove(e)}},r.handlePop=function(){return function(){return r.pop()}},r.remove=r.remove.bind(f(r)),r.pop=r.pop.bind(f(r)),r}p(r,e);var n=r.prototype;return n.remove=function(e){var t;return this.updateArrayField(function(r){var n=r?[].concat(r):[];return t||(t=n[e]),v(n.splice)&&n.splice(e,1),n},!0,!0),t},n.pop=function(){var e;return this.updateArrayField(function(t){var r=t;return e||(e=r&&r.pop&&r.pop()),r},!0,!0),e},n.render=function(){var e=this.props,r=e.component,n=e.render,a=e.children,i=e.name,o=c({},{push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},{form:d(e.formik,["validate","validationSchema"]),name:i});return r?t.createElement(r,o):n?n(o):a?"function"==typeof a?a(o):E(a)?null:t.Children.only(a):null},r}(t.Component);H.defaultProps={validateOnChange:!0};var K=N(H);exports.ErrorMessage=N(function(e){function r(){return e.apply(this,arguments)||this}p(r,e);var n=r.prototype;return n.shouldComponentUpdate=function(e){return T(this.props.formik.errors,this.props.name)!==T(e.formik.errors,this.props.name)||T(this.props.formik.touched,this.props.name)!==T(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,r=e.component,n=e.formik,a=e.render,i=e.children,o=e.name,u=d(e,["component","formik","render","children","name"]),l=T(n.touched,o),s=T(n.errors,o);return l&&s?a?v(a)?a(s):null:i?v(i)?i(s):null:r?t.createElement(r,u,s):s:null},r}(t.Component)),exports.FastField=w,exports.Field=M,exports.FieldArray=K,exports.Form=j,exports.Formik=x,exports.FormikConsumer=_,exports.FormikProvider=R,exports.connect=N,exports.getActiveElement=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}},exports.getIn=T,exports.insert=G,exports.isEmptyChildren=E,exports.isFunction=v,exports.isInputEvent=function(e){return e&&h(e)&&h(e.target)},exports.isInteger=m,exports.isNaN=function(e){return e!=e},exports.isObject=h,exports.isPromise=S,exports.isString=y,exports.move=B,exports.replace=W,exports.setIn=b,exports.setNestedObjectValues=g,exports.swap=q,exports.useField=function(e){var t=C();return h(e)?t.getFieldProps(e):t.getFieldProps({name:e})},exports.useFormik=A,exports.useFormikContext=C,exports.validateYupSchema=V,exports.withFormik=function(e){var r=e.mapPropsToValues,n=void 0===r?function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&"function"!=typeof e[r]&&(t[r]=e[r]);return t}:r,a=d(e,["mapPropsToValues"]);return function(e){var r=e.displayName||e.name||e.constructor&&e.constructor.name||"Component",i=function(r){function i(){var n;return(n=r.apply(this,arguments)||this).validate=function(e){return a.validate(e,n.props)},n.validationSchema=function(){return v(a.validationSchema)?a.validationSchema(n.props):a.validationSchema},n.handleSubmit=function(e,t){return a.handleSubmit(e,c({},t,{props:n.props}))},n.renderFormComponent=function(r){return t.createElement(e,Object.assign({},n.props,r))},n}return p(i,r),i.prototype.render=function(){var e=d(this.props,["children"]);return t.createElement(x,Object.assign({},e,a,{validate:a.validate&&this.validate,validationSchema:a.validationSchema&&this.validationSchema,initialValues:n(this.props),initialStatus:a.mapPropsToStatus&&a.mapPropsToStatus(this.props),initialErrors:a.mapPropsToErrors&&a.mapPropsToErrors(this.props),initialTouched:a.mapPropsToTouched&&a.mapPropsToTouched(this.props),onSubmit:this.handleSubmit,render:this.renderFormComponent}))},i}(t.Component);return i.displayName="WithFormik("+r+")",l(i,e)}},exports.yupToFormErrors=D; | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),r=e(require("react-fast-compare")),n=e(require("deepmerge")),a=e(require("lodash/clone")),i=e(require("lodash/toPath")),o=e(require("tiny-warning")),u=require("scheduler"),l=e(require("hoist-non-react-statics")),s=e(require("lodash/cloneDeep"));function c(){return(c=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}).apply(this,arguments)}function p(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function d(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(a[r]=e[r]);return a}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var v=function(e){return"function"==typeof e},h=function(e){return null!==e&&"object"==typeof e},m=function(e){return String(Math.floor(Number(e)))===e},y=function(e){return"[object String]"===Object.prototype.toString.call(e)},E=function(e){return 0===t.Children.count(e)},S=function(e){return h(e)&&v(e.then)};function T(e,t,r,n){void 0===n&&(n=0);for(var a=i(t);e&&n<a.length;)e=e[a[n++]];return void 0===e?r:e}function b(e,t,r){for(var n=a(e),o=n,u=0,l=i(t);u<l.length-1;u++){var s=l[u],c=T(e,l.slice(0,u+1));if(c)o=o[s]=a(c);else{var p=l[u+1];o=o[s]=m(p)&&Number(p)>=0?[]:{}}}return(0===u?e:o)[l[u]]===r?e:(void 0===r?delete o[l[u]]:o[l[u]]=r,0===u&&void 0===r&&delete n[l[u]],n)}function g(e,t,r,n){void 0===r&&(r=new WeakMap),void 0===n&&(n={});for(var a=0,i=Object.keys(e);a<i.length;a++){var o=i[a],u=e[o];h(u)?r.get(u)||(r.set(u,!0),n[o]=Array.isArray(u)?[]:{},g(u,t,r,n[o])):n[o]=t}return n}var F=t.createContext({}),R=F.Provider,_=F.Consumer;function C(){var e=t.useContext(F);return e||o(!1),e}function O(e,t){switch(t.type){case"SET_VALUES":return c({},e,{values:t.payload});case"SET_TOUCHED":return c({},e,{touched:t.payload});case"SET_ERRORS":return c({},e,{errors:t.payload});case"SET_STATUS":return c({},e,{status:t.payload});case"SET_ISSUBMITTING":return c({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return c({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return c({},e,{values:b(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return c({},e,{touched:b(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return c({},e,{errors:b(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":case"SET_FORMIK_STATE":return c({},e,t.payload);case"SUBMIT_ATTEMPT":return c({},e,{touched:g(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return c({},e,{isSubmitting:!1});default:return e}}var I={},k={};function P(e){var a=e.validateOnChange,i=void 0===a||a,o=e.validateOnBlur,l=void 0===o||o,s=e.isInitialValid,p=e.enableReinitialize,f=void 0!==p&&p,h=e.onSubmit,m=d(e,["validateOnChange","validateOnBlur","isInitialValid","enableReinitialize","onSubmit"]),E=c({validateOnChange:i,validateOnBlur:l,onSubmit:h},m),g=t.useRef(E.initialValues),F=t.useRef(E.initialErrors||I),R=t.useRef(E.initialTouched||k),_=t.useRef(E.initialStatus),C=t.useRef(!1),P=t.useRef({});t.useEffect(function(){},[s]),t.useEffect(function(){return C.current=!0,function(){C.current=!1}},[]);var A=t.useReducer(O,{values:E.initialValues,errors:E.initialErrors||I,touched:E.initialTouched||k,status:E.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),L=A[0],M=A[1],w=t.useCallback(function(e,t){return new Promise(function(r,n){var a=E.validate(e,t);null==a?r(I):S(a)?a.then(function(e){r(e||I)},function(e){n(e)}):r(a)})},[E.validate]),j=t.useCallback(function(e,t){return new Promise(function(r,n){var a=E.validationSchema,i=v(a)?a(t):a;(t&&i.validateAt?i.validateAt(t,e):D(e,i)).then(function(){r(I)},function(e){"ValidationError"===e.name?r(x(e)):n(e)})})},[E.validationSchema]),N=t.useCallback(function(e,t){return new Promise(function(r){return r(P.current[e].validate(t))})},[]),B=t.useCallback(function(e,t){if(t)return P.current[t]&&v(P.current[t].validate)?N(t,T(e,t)).then(function(e){return b(I,t,e)}):Promise.resolve(I);var r=Object.keys(P.current).filter(function(e){return v(P.current[e].validate)}),n=r.length>0?r.map(function(t){return N(t,T(e,t))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then(function(e){return e.reduce(function(e,t,n){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===t?e:(t&&(e=b(e,r[n],t)),e)},{})})},[N]),q=t.useCallback(function(e,t){return Promise.all([B(e,t),E.validationSchema?j(e,t):{},E.validate?w(e,t):{}]).then(function(e){return n.all([e[0],e[1],e[2]],{arrayMerge:V})})},[E.validate,E.validationSchema,B,w,j]),G=U(function(e,t){return void 0===e&&(e=L.values),u.unstable_runWithPriority(u.LowPriority,function(){return q(e,t).then(function(e){return C.current&&M(t?{type:"SET_FIELD_ERROR",payload:{field:t,value:e&&e[t]}}:{type:"SET_ERRORS",payload:e}),e})})},[q,L.values]),W=U(function(e,t){return void 0===e&&(e=L.values),M({type:"SET_ISVALIDATING",payload:!0}),q(e,t).then(function(e){return C.current&&(M({type:"SET_ISVALIDATING",payload:!1}),M(t?{type:"SET_FIELD_ERROR",payload:{field:t,value:e&&e[t]}}:{type:"SET_ERRORS",payload:e})),e})},[L.values,L.errors,q]),H=t.useCallback(function(e){var t=e&&e.values?e.values:g.current,r=e&&e.errors?e.errors:F.current?F.current:E.initialErrors||{},n=e&&e.touched?e.touched:R.current?R.current:E.initialTouched||{},a=e&&e.status?e.status:_.current?_.current:E.initialStatus;g.current=t,F.current=r,R.current=n,_.current=a,M({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:r,touched:n,status:a,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})},[E.initialErrors,E.initialStatus,E.initialTouched]);t.useEffect(function(){f&&!0===C.current&&!r(g.current,E.initialValues)&&(g.current=E.initialValues,H())},[f,E.initialValues,H]);var K=U(function(e){if(v(P.current[e].validate)){var t=T(L.values,e),r=P.current[e].validate(t);return S(r)?(M({type:"SET_ISVALIDATING",payload:!0}),r.then(function(e){return e}).then(function(t){M({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),M({type:"SET_ISVALIDATING",payload:!1})})):(M({type:"SET_FIELD_ERROR",payload:{field:e,value:r}}),Promise.resolve(r))}return Promise.resolve()},[L.values]),Y=t.useCallback(function(e,t){P.current[e]={validate:t.validate}},[]),z=t.useCallback(function(e){delete P.current[e]},[]),J=U(function(e){return M({type:"SET_TOUCHED",payload:e}),l?G(L.values):Promise.resolve()},[G,L.values,l]),Q=t.useCallback(function(e){M({type:"SET_ERRORS",payload:e})},[]),X=U(function(e){return M({type:"SET_VALUES",payload:e}),i?G(L.values):Promise.resolve()},[G,L.values,i]),Z=t.useCallback(function(e,t){M({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})},[]),$=U(function(e,t,r){return void 0===r&&(r=!0),M({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),i&&r?G(b(L.values,e,t),e):Promise.resolve()},[G,L.values,i]),ee=t.useCallback(function(e,t){var r,n=t,a=e;if(!y(e)){e.persist&&e.persist();var i=e.target,o=i.type,u=i.value,l=i.checked,s=i.options,c=i.multiple;n=t||i.name||i.id,a=/number|range/.test(o)?(r=parseFloat(u),isNaN(r)?"":r):/checkbox/.test(o)?function(e,t,r){if("true"==r||"false"==r)return!!t;if(t)return Array.isArray(e)?e.concat(r):[r];if(!Array.isArray(e))return!!e;var n=e.indexOf(r);return n<0?e:e.slice(0,n).concat(e.slice(n+1))}(T(L.values,n),l,u):c?function(e){return e.filter(function(e){return e.selected}).map(function(e){return e.value})}(s):u}n&&$(n,a)},[$,L.values]),te=t.useCallback(function(e){if(y(e))return function(t){return ee(t,e)};ee(e)},[ee]),re=U(function(e,t,r){return void 0===t&&(t=!0),void 0===r&&(r=!0),M({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),l&&r?G(L.values,e):Promise.resolve()},[G,L.values,l]),ne=t.useCallback(function(e,t){e.persist&&e.persist();var r=e.target;re(t||r.name||r.id,!0)},[re]),ae=t.useCallback(function(e){if(y(e))return function(t){return ne(t,e)};ne(e)},[ne]);function ie(e){v(e)?M({type:"SET_FORMIK_STATE",payload:e(L)}):M({type:"SET_FORMIK_STATE",payload:e})}var oe=t.useCallback(function(e){M({type:"SET_STATUS",payload:e})},[]),ue=t.useCallback(function(e){M({type:"SET_ISSUBMITTING",payload:e})},[]),le={resetForm:H,validateForm:W,validateField:K,setErrors:Q,setFieldError:Z,setFieldTouched:re,setFieldValue:$,setStatus:oe,setSubmitting:ue,setTouched:J,setValues:X,setFormikState:ie},se=U(function(){return h(L.values,le)},[le,h,L.values]),ce=U(function(){return M({type:"SUBMIT_ATTEMPT"}),W().then(function(e){if(0===Object.keys(e).length)return Promise.resolve(se()).then(function(){C.current&&M({type:"SUBMIT_SUCCESS"})}).catch(function(e){if(C.current)throw M({type:"SUBMIT_FAILURE"}),e});C.current&&M({type:"SUBMIT_FAILURE"})})},[se,W]),pe=U(function(e){e&&e.preventDefault&&v(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&v(e.stopPropagation)&&e.stopPropagation(),ce()},[ce]),de=U(function(e){if(e&&e.preventDefault&&v(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&v(e.stopPropagation)&&e.stopPropagation(),E.onReset){var t=E.onReset(L.values,le);S(t)?t.then(H):H()}else H()},[le,E.onReset,H,L.values]),fe=t.useCallback(function(e){return{value:T(L.values,e),error:T(L.errors,e),touched:!!T(L.touched,e),initialValue:T(g.current,e),initialTouched:!!T(R.current,e),initialError:T(F.current,e)}},[L.errors,L.touched,L.values]),ve=t.useCallback(function(e){var t=e.name,r=e.type,n=e.value,a=e.as,i=e.multiple,o=T(L.values,t),u={name:t,value:o,onChange:te,onBlur:ae};return"checkbox"===r?void 0===n?u.checked=!!o:(u.checked=!(!Array.isArray(o)||!~o.indexOf(n)),u.value=n):"radio"===r?(u.checked=o===n,u.value=n):"select"===a&&i&&(u.value=u.value||[],u.multiple=!0),[u,fe(t)]},[fe,ae,te,L.values]),he=t.useMemo(function(){return!r(g.current,L.values)},[L.values]),me=t.useMemo(function(){return void 0!==s?he?L.errors&&0===Object.keys(L.errors).length:!1!==s&&v(s)?s(E):s:L.errors&&0===Object.keys(L.errors).length},[s,he,L.errors,E]);return c({},L,{initialValues:g.current,initialErrors:F.current,initialTouched:R.current,initialStatus:_.current,handleBlur:ae,handleChange:te,handleReset:de,handleSubmit:pe,resetForm:H,setErrors:Q,setFormikState:ie,setFieldTouched:re,setFieldValue:$,setFieldError:Z,setStatus:oe,setSubmitting:ue,setTouched:J,setValues:X,submitForm:ce,validateForm:W,validateField:K,isValid:me,dirty:he,unregisterField:z,registerField:Y,getFieldProps:ve,validateOnBlur:l,validateOnChange:i})}function A(e){var r=P(e),n=e.component,a=e.children,i=e.render;return t.createElement(R,{value:r},n?t.createElement(n,r):i?i(r):a?v(a)?a(r):E(a)?null:t.Children.only(a):null)}function x(e){var t={};if(0===e.inner.length)return b(t,e.path,e.message);var r=e.inner,n=Array.isArray(r),a=0;for(r=n?r:r[Symbol.iterator]();;){var i;if(n){if(a>=r.length)break;i=r[a++]}else{if((a=r.next()).done)break;i=a.value}t[i.path]||(t=b(t,i.path,i.message))}return t}function D(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n={});var a={};for(var i in e)if(e.hasOwnProperty(i)){var o=String(i);a[o]=""!==e[o]?e[o]:void 0}return t[r?"validateSync":"validate"](a,{abortEarly:!1,context:n})}function V(e,t,r){var a=e.slice();return t.forEach(function(t,i){if(void 0===a[i]){var o=!1!==r.clone&&r.isMergeableObject(t);a[i]=o?n(Array.isArray(t)?[]:{},t,r):t}else r.isMergeableObject(t)?a[i]=n(e[i],t,r):-1===e.indexOf(t)&&a.push(t)}),a}function U(e,r){var n=t.useRef(function(){throw new Error("Cannot call an event handler while rendering.")});return t.useEffect(function(){n.current=e},[e].concat(r)),t.useCallback(function(){return n.current.apply(void 0,arguments)},[n])}function L(e){var r=e.validate,n=e.name,a=e.render,i=e.children,o=e.as,u=e.component,l=d(e,["validate","name","render","children","as","component"]),s=d(C(),["validate","validationSchema"]);t.useEffect(function(){},[]),t.useEffect(function(){return s.registerField(n,{validate:r}),function(){s.unregisterField(n)}},[s,n,r]);var p=s.getFieldProps(c({name:n},l)),f=p[0],h=p[1],m={field:f,form:s};if(a)return a(m);if(v(i))return i(c({},m,{meta:h}));if(u){if("string"==typeof u){var y=l.innerRef,E=d(l,["innerRef"]);return t.createElement(u,c({ref:y},f,E),i)}return t.createElement(u,c({field:f,form:s},l),i)}var S=o||"input";if("string"==typeof S){var T=l.innerRef,b=d(l,["innerRef"]);return t.createElement(S,c({ref:T},f,b),i)}return t.createElement(S,c({},f,l),i)}var M=L;function w(e){var r=C();return t.createElement("form",Object.assign({onSubmit:r.handleSubmit,onReset:r.handleReset},e))}function j(e){var r=function(r){return t.createElement(_,null,function(n){return n||o(!1),t.createElement(e,Object.assign({},r,{formik:n}))})},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return r.WrappedComponent=e,r.displayName="FormikConnect("+n+")",l(r,e)}w.displayName="Form";var N=function(e,t,r){var n=[].concat(e||[]),a=n[t];return n.splice(t,1),n.splice(r,0,a),n},B=function(e,t,r){var n=[].concat(e||[]),a=n[t];return n[t]=n[r],n[r]=a,n},q=function(e,t,r){var n=[].concat(e||[]);return n.splice(t,0,r),n},G=function(e,t,r){var n=[].concat(e||[]);return n[t]=r,n},W=function(e){function r(t){var r;return(r=e.call(this,t)||this).updateArrayField=function(e,t,n){var a=r.props,i=a.name,o=a.validateOnChange,u=a.formik,l=u.validateForm;(0,u.setFormikState)(function(r){var a="function"==typeof n?n:e,o="function"==typeof t?t:e;return c({},r,{values:b(r.values,i,e(T(r.values,i))),errors:n?b(r.errors,i,a(T(r.errors,i))):r.errors,touched:t?b(r.touched,i,o(T(r.touched,i))):r.touched})},function(){o&&l()})},r.push=function(e){return r.updateArrayField(function(t){return[].concat(t||[],[s(e)])},!1,!1)},r.handlePush=function(e){return function(){return r.push(e)}},r.swap=function(e,t){return r.updateArrayField(function(r){return B(r,e,t)},!0,!0)},r.handleSwap=function(e,t){return function(){return r.swap(e,t)}},r.move=function(e,t){return r.updateArrayField(function(r){return N(r,e,t)},!0,!0)},r.handleMove=function(e,t){return function(){return r.move(e,t)}},r.insert=function(e,t){return r.updateArrayField(function(r){return q(r,e,t)},function(t){return q(t,e,null)},function(t){return q(t,e,null)})},r.handleInsert=function(e,t){return function(){return r.insert(e,t)}},r.replace=function(e,t){return r.updateArrayField(function(r){return G(r,e,t)},!1,!1)},r.handleReplace=function(e,t){return function(){return r.replace(e,t)}},r.unshift=function(e){var t=-1;return r.updateArrayField(function(r){var n=r?[e].concat(r):[e];return t<0&&(t=n.length),n},function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r},function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r}),t},r.handleUnshift=function(e){return function(){return r.unshift(e)}},r.handleRemove=function(e){return function(){return r.remove(e)}},r.handlePop=function(){return function(){return r.pop()}},r.remove=r.remove.bind(f(r)),r.pop=r.pop.bind(f(r)),r}p(r,e);var n=r.prototype;return n.remove=function(e){var t;return this.updateArrayField(function(r){var n=r?[].concat(r):[];return t||(t=n[e]),v(n.splice)&&n.splice(e,1),n},!0,!0),t},n.pop=function(){var e;return this.updateArrayField(function(t){var r=t;return e||(e=r&&r.pop&&r.pop()),r},!0,!0),e},n.render=function(){var e=this.props,r=e.component,n=e.render,a=e.children,i=e.name,o=c({},{push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},{form:d(e.formik,["validate","validationSchema"]),name:i});return r?t.createElement(r,o):n?n(o):a?"function"==typeof a?a(o):E(a)?null:t.Children.only(a):null},r}(t.Component);W.defaultProps={validateOnChange:!0};var H=j(W);exports.ErrorMessage=j(function(e){function r(){return e.apply(this,arguments)||this}p(r,e);var n=r.prototype;return n.shouldComponentUpdate=function(e){return T(this.props.formik.errors,this.props.name)!==T(e.formik.errors,this.props.name)||T(this.props.formik.touched,this.props.name)!==T(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,r=e.component,n=e.formik,a=e.render,i=e.children,o=e.name,u=d(e,["component","formik","render","children","name"]),l=T(n.touched,o),s=T(n.errors,o);return l&&s?a?v(a)?a(s):null:i?v(i)?i(s):null:r?t.createElement(r,u,s):s:null},r}(t.Component)),exports.FastField=M,exports.Field=L,exports.FieldArray=H,exports.Form=w,exports.Formik=A,exports.FormikConsumer=_,exports.FormikProvider=R,exports.connect=j,exports.getActiveElement=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}},exports.getIn=T,exports.insert=q,exports.isEmptyChildren=E,exports.isFunction=v,exports.isInputEvent=function(e){return e&&h(e)&&h(e.target)},exports.isInteger=m,exports.isNaN=function(e){return e!=e},exports.isObject=h,exports.isPromise=S,exports.isString=y,exports.move=N,exports.replace=G,exports.setIn=b,exports.setNestedObjectValues=g,exports.swap=B,exports.useField=function(e){var t=C();return h(e)?t.getFieldProps(e):t.getFieldProps({name:e})},exports.useFormik=P,exports.useFormikContext=C,exports.validateYupSchema=D,exports.withFormik=function(e){var r=e.mapPropsToValues,n=void 0===r?function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&"function"!=typeof e[r]&&(t[r]=e[r]);return t}:r,a=d(e,["mapPropsToValues"]);return function(e){var r=e.displayName||e.name||e.constructor&&e.constructor.name||"Component",i=function(r){function i(){var n;return(n=r.apply(this,arguments)||this).validate=function(e){return a.validate(e,n.props)},n.validationSchema=function(){return v(a.validationSchema)?a.validationSchema(n.props):a.validationSchema},n.handleSubmit=function(e,t){return a.handleSubmit(e,c({},t,{props:n.props}))},n.renderFormComponent=function(r){return t.createElement(e,Object.assign({},n.props,r))},n}return p(i,r),i.prototype.render=function(){var e=d(this.props,["children"]);return t.createElement(A,Object.assign({},e,a,{validate:a.validate&&this.validate,validationSchema:a.validationSchema&&this.validationSchema,initialValues:n(this.props),initialStatus:a.mapPropsToStatus&&a.mapPropsToStatus(this.props),initialErrors:a.mapPropsToErrors&&a.mapPropsToErrors(this.props),initialTouched:a.mapPropsToTouched&&a.mapPropsToTouched(this.props),onSubmit:this.handleSubmit,render:this.renderFormComponent}))},i}(t.Component);return i.displayName="WithFormik("+r+")",l(i,e)}},exports.yupToFormErrors=x; | ||
//# sourceMappingURL=formik.cjs.production.min.js.map |
@@ -256,3 +256,2 @@ import * as React from 'react'; | ||
var emptyTouched = {}; | ||
var emptyFieldRegistry = {}; | ||
function useFormik(_ref) { | ||
@@ -280,3 +279,3 @@ var _ref$validateOnChange = _ref.validateOnChange, | ||
var isMounted = useRef(false); | ||
var fieldRegistry = useRef(emptyFieldRegistry); | ||
var fieldRegistry = useRef({}); | ||
useEffect(function () { | ||
@@ -283,0 +282,0 @@ if (process.env.NODE_ENV !== "production") { |
@@ -259,3 +259,2 @@ (function (global, factory) { | ||
var emptyTouched = {}; | ||
var emptyFieldRegistry = {}; | ||
function useFormik(_ref) { | ||
@@ -283,3 +282,3 @@ var _ref$validateOnChange = _ref.validateOnChange, | ||
var isMounted = React.useRef(false); | ||
var fieldRegistry = React.useRef(emptyFieldRegistry); | ||
var fieldRegistry = React.useRef({}); | ||
React.useEffect(function () { | ||
@@ -286,0 +285,0 @@ { |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-fast-compare"),require("deepmerge"),require("lodash-es/clone"),require("lodash-es/toPath"),require("tiny-warning"),require("scheduler"),require("hoist-non-react-statics"),require("lodash-es/cloneDeep")):"function"==typeof define&&define.amd?define(["exports","react","react-fast-compare","deepmerge","lodash-es/clone","lodash-es/toPath","tiny-warning","scheduler","hoist-non-react-statics","lodash-es/cloneDeep"],t):t((e=e||self).formik={},e.React,e.isEqual,e.deepmerge,e.clone,e.toPath,e.invariant,e.scheduler,e.hoistNonReactStatics,e.cloneDeep)}(this,function(e,t,r,n,a,i,u,o,l,s){"use strict";function c(){return(c=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}).apply(this,arguments)}function d(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function f(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(a[r]=e[r]);return a}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r=r&&r.hasOwnProperty("default")?r.default:r,n=n&&n.hasOwnProperty("default")?n.default:n,a=a&&a.hasOwnProperty("default")?a.default:a,i=i&&i.hasOwnProperty("default")?i.default:i,u=u&&u.hasOwnProperty("default")?u.default:u,l=l&&l.hasOwnProperty("default")?l.default:l,s=s&&s.hasOwnProperty("default")?s.default:s;var v=function(e){return"function"==typeof e},h=function(e){return null!==e&&"object"==typeof e},m=function(e){return String(Math.floor(Number(e)))===e},y=function(e){return"[object String]"===Object.prototype.toString.call(e)},E=function(e){return 0===t.Children.count(e)},S=function(e){return h(e)&&v(e.then)};function T(e,t,r,n){void 0===n&&(n=0);for(var a=i(t);e&&n<a.length;)e=e[a[n++]];return void 0===e?r:e}function b(e,t,r){for(var n=a(e),u=n,o=0,l=i(t);o<l.length-1;o++){var s=l[o],c=T(e,l.slice(0,o+1));if(c)u=u[s]=a(c);else{var d=l[o+1];u=u[s]=m(d)&&Number(d)>=0?[]:{}}}return(0===o?e:u)[l[o]]===r?e:(void 0===r?delete u[l[o]]:u[l[o]]=r,0===o&&void 0===r&&delete n[l[o]],n)}function g(e,t,r,n){void 0===r&&(r=new WeakMap),void 0===n&&(n={});for(var a=0,i=Object.keys(e);a<i.length;a++){var u=i[a],o=e[u];h(o)?r.get(o)||(r.set(o,!0),n[u]=Array.isArray(o)?[]:{},g(o,t,r,n[u])):n[u]=t}return n}var F=t.createContext({}),R=F.Provider,O=F.Consumer;function _(){var e=t.useContext(F);return e||u(!1),e}function C(e,t){switch(t.type){case"SET_VALUES":return c({},e,{values:t.payload});case"SET_TOUCHED":return c({},e,{touched:t.payload});case"SET_ERRORS":return c({},e,{errors:t.payload});case"SET_STATUS":return c({},e,{status:t.payload});case"SET_ISSUBMITTING":return c({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return c({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return c({},e,{values:b(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return c({},e,{touched:b(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return c({},e,{errors:b(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":case"SET_FORMIK_STATE":return c({},e,t.payload);case"SUBMIT_ATTEMPT":return c({},e,{touched:g(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return c({},e,{isSubmitting:!1});default:return e}}var P={},k={},I={};function A(e){var a=e.validateOnChange,i=void 0===a||a,u=e.validateOnBlur,l=void 0===u||u,s=e.isInitialValid,d=e.enableReinitialize,p=void 0!==d&&d,h=e.onSubmit,m=f(e,["validateOnChange","validateOnBlur","isInitialValid","enableReinitialize","onSubmit"]),E=c({validateOnChange:i,validateOnBlur:l,onSubmit:h},m),g=t.useRef(E.initialValues),F=t.useRef(E.initialErrors||P),R=t.useRef(E.initialTouched||k),O=t.useRef(E.initialStatus),_=t.useRef(!1),A=t.useRef(I);t.useEffect(function(){},[s]),t.useEffect(function(){return _.current=!0,function(){_.current=!1}},[]);var D=t.useReducer(C,{values:E.initialValues,errors:E.initialErrors||P,touched:E.initialTouched||k,status:E.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),M=D[0],j=D[1],N=t.useCallback(function(e,t){return new Promise(function(r,n){var a=E.validate(e,t);null==a?r(P):S(a)?a.then(function(e){r(e||P)},function(e){n(e)}):r(a)})},[E.validate]),B=t.useCallback(function(e,t){return new Promise(function(r,n){var a=E.validationSchema,i=v(a)?a(t):a;(t&&i.validateAt?i.validateAt(t,e):V(e,i)).then(function(){r(P)},function(e){"ValidationError"===e.name?r(w(e)):n(e)})})},[E.validationSchema]),x=t.useCallback(function(e,t){return new Promise(function(r){return r(A.current[e].validate(t))})},[]),q=t.useCallback(function(e,t){if(t)return A.current[t]&&v(A.current[t].validate)?x(t,T(e,t)).then(function(e){return b(P,t,e)}):Promise.resolve(P);var r=Object.keys(A.current).filter(function(e){return v(A.current[e].validate)}),n=r.length>0?r.map(function(t){return x(t,T(e,t))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then(function(e){return e.reduce(function(e,t,n){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===t?e:(t&&(e=b(e,r[n],t)),e)},{})})},[x]),G=t.useCallback(function(e,t){return Promise.all([q(e,t),E.validationSchema?B(e,t):{},E.validate?N(e,t):{}]).then(function(e){return n.all([e[0],e[1],e[2]],{arrayMerge:U})})},[E.validate,E.validationSchema,q,N,B]),W=L(function(e,t){return void 0===e&&(e=M.values),o.unstable_runWithPriority(o.LowPriority,function(){return G(e,t).then(function(e){return _.current&&j(t?{type:"SET_FIELD_ERROR",payload:{field:t,value:e&&e[t]}}:{type:"SET_ERRORS",payload:e}),e})})},[G,M.values]),H=L(function(e,t){return void 0===e&&(e=M.values),j({type:"SET_ISVALIDATING",payload:!0}),G(e,t).then(function(e){return _.current&&(j({type:"SET_ISVALIDATING",payload:!1}),j(t?{type:"SET_FIELD_ERROR",payload:{field:t,value:e&&e[t]}}:{type:"SET_ERRORS",payload:e})),e})},[M.values,M.errors,G]),K=t.useCallback(function(e){var t=e&&e.values?e.values:g.current,r=e&&e.errors?e.errors:F.current?F.current:E.initialErrors||{},n=e&&e.touched?e.touched:R.current?R.current:E.initialTouched||{},a=e&&e.status?e.status:O.current?O.current:E.initialStatus;g.current=t,F.current=r,R.current=n,O.current=a,j({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:r,touched:n,status:a,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})},[E.initialErrors,E.initialStatus,E.initialTouched]);t.useEffect(function(){p&&!0===_.current&&!r(g.current,E.initialValues)&&(g.current=E.initialValues,K())},[p,E.initialValues,K]);var Y=L(function(e){if(v(A.current[e].validate)){var t=T(M.values,e),r=A.current[e].validate(t);return S(r)?(j({type:"SET_ISVALIDATING",payload:!0}),r.then(function(e){return e}).then(function(t){j({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),j({type:"SET_ISVALIDATING",payload:!1})})):(j({type:"SET_FIELD_ERROR",payload:{field:e,value:r}}),Promise.resolve(r))}return Promise.resolve()},[M.values]),z=t.useCallback(function(e,t){A.current[e]={validate:t.validate}},[]),J=t.useCallback(function(e){delete A.current[e]},[]),Q=L(function(e){return j({type:"SET_TOUCHED",payload:e}),l?W(M.values):Promise.resolve()},[W,M.values,l]),X=t.useCallback(function(e){j({type:"SET_ERRORS",payload:e})},[]),Z=L(function(e){return j({type:"SET_VALUES",payload:e}),i?W(M.values):Promise.resolve()},[W,M.values,i]),$=t.useCallback(function(e,t){j({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})},[]),ee=L(function(e,t,r){return void 0===r&&(r=!0),j({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),i&&r?W(b(M.values,e,t),e):Promise.resolve()},[W,M.values,i]),te=t.useCallback(function(e,t){var r,n=t,a=e;if(!y(e)){e.persist&&e.persist();var i=e.target,u=i.type,o=i.value,l=i.checked,s=i.options,c=i.multiple;n=t||i.name||i.id,a=/number|range/.test(u)?(r=parseFloat(o),isNaN(r)?"":r):/checkbox/.test(u)?function(e,t,r){if("true"==r||"false"==r)return!!t;if(t)return Array.isArray(e)?e.concat(r):[r];if(!Array.isArray(e))return!!e;var n=e.indexOf(r);return n<0?e:e.slice(0,n).concat(e.slice(n+1))}(T(M.values,n),l,o):c?function(e){return e.filter(function(e){return e.selected}).map(function(e){return e.value})}(s):o}n&&ee(n,a)},[ee,M.values]),re=t.useCallback(function(e){if(y(e))return function(t){return te(t,e)};te(e)},[te]),ne=L(function(e,t,r){return void 0===t&&(t=!0),void 0===r&&(r=!0),j({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),l&&r?W(M.values,e):Promise.resolve()},[W,M.values,l]),ae=t.useCallback(function(e,t){e.persist&&e.persist();var r=e.target;ne(t||r.name||r.id,!0)},[ne]),ie=t.useCallback(function(e){if(y(e))return function(t){return ae(t,e)};ae(e)},[ae]);function ue(e){v(e)?j({type:"SET_FORMIK_STATE",payload:e(M)}):j({type:"SET_FORMIK_STATE",payload:e})}var oe=t.useCallback(function(e){j({type:"SET_STATUS",payload:e})},[]),le=t.useCallback(function(e){j({type:"SET_ISSUBMITTING",payload:e})},[]),se={resetForm:K,validateForm:H,validateField:Y,setErrors:X,setFieldError:$,setFieldTouched:ne,setFieldValue:ee,setStatus:oe,setSubmitting:le,setTouched:Q,setValues:Z,setFormikState:ue},ce=L(function(){return h(M.values,se)},[se,h,M.values]),de=L(function(){return j({type:"SUBMIT_ATTEMPT"}),H().then(function(e){if(0===Object.keys(e).length)return Promise.resolve(ce()).then(function(){_.current&&j({type:"SUBMIT_SUCCESS"})}).catch(function(e){if(_.current)throw j({type:"SUBMIT_FAILURE"}),e});_.current&&j({type:"SUBMIT_FAILURE"})})},[ce,H]),fe=L(function(e){e&&e.preventDefault&&v(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&v(e.stopPropagation)&&e.stopPropagation(),de()},[de]),pe=L(function(e){if(e&&e.preventDefault&&v(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&v(e.stopPropagation)&&e.stopPropagation(),E.onReset){var t=E.onReset(M.values,se);S(t)?t.then(K):K()}else K()},[se,E.onReset,K,M.values]),ve=t.useCallback(function(e){return{value:T(M.values,e),error:T(M.errors,e),touched:!!T(M.touched,e),initialValue:T(g.current,e),initialTouched:!!T(R.current,e),initialError:T(F.current,e)}},[M.errors,M.touched,M.values]),he=t.useCallback(function(e){var t=e.name,r=e.type,n=e.value,a=e.as,i=e.multiple,u=T(M.values,t),o={name:t,value:u,onChange:re,onBlur:ie};return"checkbox"===r?void 0===n?o.checked=!!u:(o.checked=!(!Array.isArray(u)||!~u.indexOf(n)),o.value=n):"radio"===r?(o.checked=u===n,o.value=n):"select"===a&&i&&(o.value=o.value||[],o.multiple=!0),[o,ve(t)]},[ve,ie,re,M.values]),me=t.useMemo(function(){return!r(g.current,M.values)},[M.values]),ye=t.useMemo(function(){return void 0!==s?me?M.errors&&0===Object.keys(M.errors).length:!1!==s&&v(s)?s(E):s:M.errors&&0===Object.keys(M.errors).length},[s,me,M.errors,E]);return c({},M,{initialValues:g.current,initialErrors:F.current,initialTouched:R.current,initialStatus:O.current,handleBlur:ie,handleChange:re,handleReset:pe,handleSubmit:fe,resetForm:K,setErrors:X,setFormikState:ue,setFieldTouched:ne,setFieldValue:ee,setFieldError:$,setStatus:oe,setSubmitting:le,setTouched:Q,setValues:Z,submitForm:de,validateForm:H,validateField:Y,isValid:ye,dirty:me,unregisterField:J,registerField:z,getFieldProps:he,validateOnBlur:l,validateOnChange:i})}function D(e){var r=A(e),n=e.component,a=e.children,i=e.render;return t.createElement(R,{value:r},n?t.createElement(n,r):i?i(r):a?v(a)?a(r):E(a)?null:t.Children.only(a):null)}function w(e){var t={};if(0===e.inner.length)return b(t,e.path,e.message);var r=e.inner,n=Array.isArray(r),a=0;for(r=n?r:r[Symbol.iterator]();;){var i;if(n){if(a>=r.length)break;i=r[a++]}else{if((a=r.next()).done)break;i=a.value}t[i.path]||(t=b(t,i.path,i.message))}return t}function V(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n={});var a={};for(var i in e)if(e.hasOwnProperty(i)){var u=String(i);a[u]=""!==e[u]?e[u]:void 0}return t[r?"validateSync":"validate"](a,{abortEarly:!1,context:n})}function U(e,t,r){var a=e.slice();return t.forEach(function(t,i){if(void 0===a[i]){var u=!1!==r.clone&&r.isMergeableObject(t);a[i]=u?n(Array.isArray(t)?[]:{},t,r):t}else r.isMergeableObject(t)?a[i]=n(e[i],t,r):-1===e.indexOf(t)&&a.push(t)}),a}function L(e,r){var n=t.useRef(function(){throw new Error("Cannot call an event handler while rendering.")});return t.useEffect(function(){n.current=e},[e].concat(r)),t.useCallback(function(){return n.current.apply(void 0,arguments)},[n])}function M(e){var r=e.validate,n=e.name,a=e.render,i=e.children,u=e.as,o=e.component,l=f(e,["validate","name","render","children","as","component"]),s=f(_(),["validate","validationSchema"]);t.useEffect(function(){},[]),t.useEffect(function(){return s.registerField(n,{validate:r}),function(){s.unregisterField(n)}},[s,n,r]);var d=s.getFieldProps(c({name:n},l)),p=d[0],h=d[1],m={field:p,form:s};if(a)return a(m);if(v(i))return i(c({},m,{meta:h}));if(o){if("string"==typeof o){var y=l.innerRef,E=f(l,["innerRef"]);return t.createElement(o,c({ref:y},p,E),i)}return t.createElement(o,c({field:p,form:s},l),i)}var S=u||"input";if("string"==typeof S){var T=l.innerRef,b=f(l,["innerRef"]);return t.createElement(S,c({ref:T},p,b),i)}return t.createElement(S,c({},p,l),i)}var j=M;function N(e){var r=_();return t.createElement("form",Object.assign({onSubmit:r.handleSubmit,onReset:r.handleReset},e))}function B(e){var r=function(r){return t.createElement(O,null,function(n){return n||u(!1),t.createElement(e,Object.assign({},r,{formik:n}))})},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return r.WrappedComponent=e,r.displayName="FormikConnect("+n+")",l(r,e)}N.displayName="Form";var x=function(e,t,r){var n=[].concat(e||[]),a=n[t];return n.splice(t,1),n.splice(r,0,a),n},q=function(e,t,r){var n=[].concat(e||[]),a=n[t];return n[t]=n[r],n[r]=a,n},G=function(e,t,r){var n=[].concat(e||[]);return n.splice(t,0,r),n},W=function(e,t,r){var n=[].concat(e||[]);return n[t]=r,n},H=function(e){function r(t){var r;return(r=e.call(this,t)||this).updateArrayField=function(e,t,n){var a=r.props,i=a.name,u=a.validateOnChange,o=a.formik,l=o.validateForm;(0,o.setFormikState)(function(r){var a="function"==typeof n?n:e,u="function"==typeof t?t:e;return c({},r,{values:b(r.values,i,e(T(r.values,i))),errors:n?b(r.errors,i,a(T(r.errors,i))):r.errors,touched:t?b(r.touched,i,u(T(r.touched,i))):r.touched})},function(){u&&l()})},r.push=function(e){return r.updateArrayField(function(t){return[].concat(t||[],[s(e)])},!1,!1)},r.handlePush=function(e){return function(){return r.push(e)}},r.swap=function(e,t){return r.updateArrayField(function(r){return q(r,e,t)},!0,!0)},r.handleSwap=function(e,t){return function(){return r.swap(e,t)}},r.move=function(e,t){return r.updateArrayField(function(r){return x(r,e,t)},!0,!0)},r.handleMove=function(e,t){return function(){return r.move(e,t)}},r.insert=function(e,t){return r.updateArrayField(function(r){return G(r,e,t)},function(t){return G(t,e,null)},function(t){return G(t,e,null)})},r.handleInsert=function(e,t){return function(){return r.insert(e,t)}},r.replace=function(e,t){return r.updateArrayField(function(r){return W(r,e,t)},!1,!1)},r.handleReplace=function(e,t){return function(){return r.replace(e,t)}},r.unshift=function(e){var t=-1;return r.updateArrayField(function(r){var n=r?[e].concat(r):[e];return t<0&&(t=n.length),n},function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r},function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r}),t},r.handleUnshift=function(e){return function(){return r.unshift(e)}},r.handleRemove=function(e){return function(){return r.remove(e)}},r.handlePop=function(){return function(){return r.pop()}},r.remove=r.remove.bind(p(r)),r.pop=r.pop.bind(p(r)),r}d(r,e);var n=r.prototype;return n.remove=function(e){var t;return this.updateArrayField(function(r){var n=r?[].concat(r):[];return t||(t=n[e]),v(n.splice)&&n.splice(e,1),n},!0,!0),t},n.pop=function(){var e;return this.updateArrayField(function(t){var r=t;return e||(e=r&&r.pop&&r.pop()),r},!0,!0),e},n.render=function(){var e=this.props,r=e.component,n=e.render,a=e.children,i=e.name,u=c({},{push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},{form:f(e.formik,["validate","validationSchema"]),name:i});return r?t.createElement(r,u):n?n(u):a?"function"==typeof a?a(u):E(a)?null:t.Children.only(a):null},r}(t.Component);H.defaultProps={validateOnChange:!0};var K=B(H);e.ErrorMessage=B(function(e){function r(){return e.apply(this,arguments)||this}d(r,e);var n=r.prototype;return n.shouldComponentUpdate=function(e){return T(this.props.formik.errors,this.props.name)!==T(e.formik.errors,this.props.name)||T(this.props.formik.touched,this.props.name)!==T(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,r=e.component,n=e.formik,a=e.render,i=e.children,u=e.name,o=f(e,["component","formik","render","children","name"]),l=T(n.touched,u),s=T(n.errors,u);return l&&s?a?v(a)?a(s):null:i?v(i)?i(s):null:r?t.createElement(r,o,s):s:null},r}(t.Component)),e.FastField=j,e.Field=M,e.FieldArray=K,e.Form=N,e.Formik=D,e.FormikConsumer=O,e.FormikProvider=R,e.connect=B,e.getActiveElement=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}},e.getIn=T,e.insert=G,e.isEmptyChildren=E,e.isFunction=v,e.isInputEvent=function(e){return e&&h(e)&&h(e.target)},e.isInteger=m,e.isNaN=function(e){return e!=e},e.isObject=h,e.isPromise=S,e.isString=y,e.move=x,e.replace=W,e.setIn=b,e.setNestedObjectValues=g,e.swap=q,e.useField=function(e){var t=_();return h(e)?t.getFieldProps(e):t.getFieldProps({name:e})},e.useFormik=A,e.useFormikContext=_,e.validateYupSchema=V,e.withFormik=function(e){var r=e.mapPropsToValues,n=void 0===r?function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&"function"!=typeof e[r]&&(t[r]=e[r]);return t}:r,a=f(e,["mapPropsToValues"]);return function(e){var r=e.displayName||e.name||e.constructor&&e.constructor.name||"Component",i=function(r){function i(){var n;return(n=r.apply(this,arguments)||this).validate=function(e){return a.validate(e,n.props)},n.validationSchema=function(){return v(a.validationSchema)?a.validationSchema(n.props):a.validationSchema},n.handleSubmit=function(e,t){return a.handleSubmit(e,c({},t,{props:n.props}))},n.renderFormComponent=function(r){return t.createElement(e,Object.assign({},n.props,r))},n}return d(i,r),i.prototype.render=function(){var e=f(this.props,["children"]);return t.createElement(D,Object.assign({},e,a,{validate:a.validate&&this.validate,validationSchema:a.validationSchema&&this.validationSchema,initialValues:n(this.props),initialStatus:a.mapPropsToStatus&&a.mapPropsToStatus(this.props),initialErrors:a.mapPropsToErrors&&a.mapPropsToErrors(this.props),initialTouched:a.mapPropsToTouched&&a.mapPropsToTouched(this.props),onSubmit:this.handleSubmit,render:this.renderFormComponent}))},i}(t.Component);return i.displayName="WithFormik("+r+")",l(i,e)}},e.yupToFormErrors=w}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-fast-compare"),require("deepmerge"),require("lodash-es/clone"),require("lodash-es/toPath"),require("tiny-warning"),require("scheduler"),require("hoist-non-react-statics"),require("lodash-es/cloneDeep")):"function"==typeof define&&define.amd?define(["exports","react","react-fast-compare","deepmerge","lodash-es/clone","lodash-es/toPath","tiny-warning","scheduler","hoist-non-react-statics","lodash-es/cloneDeep"],t):t((e=e||self).formik={},e.React,e.isEqual,e.deepmerge,e.clone,e.toPath,e.invariant,e.scheduler,e.hoistNonReactStatics,e.cloneDeep)}(this,function(e,t,r,n,a,i,u,o,l,s){"use strict";function c(){return(c=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}).apply(this,arguments)}function d(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function f(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(a[r]=e[r]);return a}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r=r&&r.hasOwnProperty("default")?r.default:r,n=n&&n.hasOwnProperty("default")?n.default:n,a=a&&a.hasOwnProperty("default")?a.default:a,i=i&&i.hasOwnProperty("default")?i.default:i,u=u&&u.hasOwnProperty("default")?u.default:u,l=l&&l.hasOwnProperty("default")?l.default:l,s=s&&s.hasOwnProperty("default")?s.default:s;var v=function(e){return"function"==typeof e},h=function(e){return null!==e&&"object"==typeof e},m=function(e){return String(Math.floor(Number(e)))===e},y=function(e){return"[object String]"===Object.prototype.toString.call(e)},E=function(e){return 0===t.Children.count(e)},S=function(e){return h(e)&&v(e.then)};function T(e,t,r,n){void 0===n&&(n=0);for(var a=i(t);e&&n<a.length;)e=e[a[n++]];return void 0===e?r:e}function b(e,t,r){for(var n=a(e),u=n,o=0,l=i(t);o<l.length-1;o++){var s=l[o],c=T(e,l.slice(0,o+1));if(c)u=u[s]=a(c);else{var d=l[o+1];u=u[s]=m(d)&&Number(d)>=0?[]:{}}}return(0===o?e:u)[l[o]]===r?e:(void 0===r?delete u[l[o]]:u[l[o]]=r,0===o&&void 0===r&&delete n[l[o]],n)}function g(e,t,r,n){void 0===r&&(r=new WeakMap),void 0===n&&(n={});for(var a=0,i=Object.keys(e);a<i.length;a++){var u=i[a],o=e[u];h(o)?r.get(o)||(r.set(o,!0),n[u]=Array.isArray(o)?[]:{},g(o,t,r,n[u])):n[u]=t}return n}var F=t.createContext({}),R=F.Provider,O=F.Consumer;function _(){var e=t.useContext(F);return e||u(!1),e}function C(e,t){switch(t.type){case"SET_VALUES":return c({},e,{values:t.payload});case"SET_TOUCHED":return c({},e,{touched:t.payload});case"SET_ERRORS":return c({},e,{errors:t.payload});case"SET_STATUS":return c({},e,{status:t.payload});case"SET_ISSUBMITTING":return c({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return c({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return c({},e,{values:b(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return c({},e,{touched:b(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return c({},e,{errors:b(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":case"SET_FORMIK_STATE":return c({},e,t.payload);case"SUBMIT_ATTEMPT":return c({},e,{touched:g(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return c({},e,{isSubmitting:!1});default:return e}}var P={},k={};function I(e){var a=e.validateOnChange,i=void 0===a||a,u=e.validateOnBlur,l=void 0===u||u,s=e.isInitialValid,d=e.enableReinitialize,p=void 0!==d&&d,h=e.onSubmit,m=f(e,["validateOnChange","validateOnBlur","isInitialValid","enableReinitialize","onSubmit"]),E=c({validateOnChange:i,validateOnBlur:l,onSubmit:h},m),g=t.useRef(E.initialValues),F=t.useRef(E.initialErrors||P),R=t.useRef(E.initialTouched||k),O=t.useRef(E.initialStatus),_=t.useRef(!1),I=t.useRef({});t.useEffect(function(){},[s]),t.useEffect(function(){return _.current=!0,function(){_.current=!1}},[]);var A=t.useReducer(C,{values:E.initialValues,errors:E.initialErrors||P,touched:E.initialTouched||k,status:E.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),L=A[0],M=A[1],j=t.useCallback(function(e,t){return new Promise(function(r,n){var a=E.validate(e,t);null==a?r(P):S(a)?a.then(function(e){r(e||P)},function(e){n(e)}):r(a)})},[E.validate]),N=t.useCallback(function(e,t){return new Promise(function(r,n){var a=E.validationSchema,i=v(a)?a(t):a;(t&&i.validateAt?i.validateAt(t,e):w(e,i)).then(function(){r(P)},function(e){"ValidationError"===e.name?r(D(e)):n(e)})})},[E.validationSchema]),B=t.useCallback(function(e,t){return new Promise(function(r){return r(I.current[e].validate(t))})},[]),x=t.useCallback(function(e,t){if(t)return I.current[t]&&v(I.current[t].validate)?B(t,T(e,t)).then(function(e){return b(P,t,e)}):Promise.resolve(P);var r=Object.keys(I.current).filter(function(e){return v(I.current[e].validate)}),n=r.length>0?r.map(function(t){return B(t,T(e,t))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then(function(e){return e.reduce(function(e,t,n){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===t?e:(t&&(e=b(e,r[n],t)),e)},{})})},[B]),q=t.useCallback(function(e,t){return Promise.all([x(e,t),E.validationSchema?N(e,t):{},E.validate?j(e,t):{}]).then(function(e){return n.all([e[0],e[1],e[2]],{arrayMerge:V})})},[E.validate,E.validationSchema,x,j,N]),G=U(function(e,t){return void 0===e&&(e=L.values),o.unstable_runWithPriority(o.LowPriority,function(){return q(e,t).then(function(e){return _.current&&M(t?{type:"SET_FIELD_ERROR",payload:{field:t,value:e&&e[t]}}:{type:"SET_ERRORS",payload:e}),e})})},[q,L.values]),W=U(function(e,t){return void 0===e&&(e=L.values),M({type:"SET_ISVALIDATING",payload:!0}),q(e,t).then(function(e){return _.current&&(M({type:"SET_ISVALIDATING",payload:!1}),M(t?{type:"SET_FIELD_ERROR",payload:{field:t,value:e&&e[t]}}:{type:"SET_ERRORS",payload:e})),e})},[L.values,L.errors,q]),H=t.useCallback(function(e){var t=e&&e.values?e.values:g.current,r=e&&e.errors?e.errors:F.current?F.current:E.initialErrors||{},n=e&&e.touched?e.touched:R.current?R.current:E.initialTouched||{},a=e&&e.status?e.status:O.current?O.current:E.initialStatus;g.current=t,F.current=r,R.current=n,O.current=a,M({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:r,touched:n,status:a,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})},[E.initialErrors,E.initialStatus,E.initialTouched]);t.useEffect(function(){p&&!0===_.current&&!r(g.current,E.initialValues)&&(g.current=E.initialValues,H())},[p,E.initialValues,H]);var K=U(function(e){if(v(I.current[e].validate)){var t=T(L.values,e),r=I.current[e].validate(t);return S(r)?(M({type:"SET_ISVALIDATING",payload:!0}),r.then(function(e){return e}).then(function(t){M({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),M({type:"SET_ISVALIDATING",payload:!1})})):(M({type:"SET_FIELD_ERROR",payload:{field:e,value:r}}),Promise.resolve(r))}return Promise.resolve()},[L.values]),Y=t.useCallback(function(e,t){I.current[e]={validate:t.validate}},[]),z=t.useCallback(function(e){delete I.current[e]},[]),J=U(function(e){return M({type:"SET_TOUCHED",payload:e}),l?G(L.values):Promise.resolve()},[G,L.values,l]),Q=t.useCallback(function(e){M({type:"SET_ERRORS",payload:e})},[]),X=U(function(e){return M({type:"SET_VALUES",payload:e}),i?G(L.values):Promise.resolve()},[G,L.values,i]),Z=t.useCallback(function(e,t){M({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})},[]),$=U(function(e,t,r){return void 0===r&&(r=!0),M({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),i&&r?G(b(L.values,e,t),e):Promise.resolve()},[G,L.values,i]),ee=t.useCallback(function(e,t){var r,n=t,a=e;if(!y(e)){e.persist&&e.persist();var i=e.target,u=i.type,o=i.value,l=i.checked,s=i.options,c=i.multiple;n=t||i.name||i.id,a=/number|range/.test(u)?(r=parseFloat(o),isNaN(r)?"":r):/checkbox/.test(u)?function(e,t,r){if("true"==r||"false"==r)return!!t;if(t)return Array.isArray(e)?e.concat(r):[r];if(!Array.isArray(e))return!!e;var n=e.indexOf(r);return n<0?e:e.slice(0,n).concat(e.slice(n+1))}(T(L.values,n),l,o):c?function(e){return e.filter(function(e){return e.selected}).map(function(e){return e.value})}(s):o}n&&$(n,a)},[$,L.values]),te=t.useCallback(function(e){if(y(e))return function(t){return ee(t,e)};ee(e)},[ee]),re=U(function(e,t,r){return void 0===t&&(t=!0),void 0===r&&(r=!0),M({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),l&&r?G(L.values,e):Promise.resolve()},[G,L.values,l]),ne=t.useCallback(function(e,t){e.persist&&e.persist();var r=e.target;re(t||r.name||r.id,!0)},[re]),ae=t.useCallback(function(e){if(y(e))return function(t){return ne(t,e)};ne(e)},[ne]);function ie(e){v(e)?M({type:"SET_FORMIK_STATE",payload:e(L)}):M({type:"SET_FORMIK_STATE",payload:e})}var ue=t.useCallback(function(e){M({type:"SET_STATUS",payload:e})},[]),oe=t.useCallback(function(e){M({type:"SET_ISSUBMITTING",payload:e})},[]),le={resetForm:H,validateForm:W,validateField:K,setErrors:Q,setFieldError:Z,setFieldTouched:re,setFieldValue:$,setStatus:ue,setSubmitting:oe,setTouched:J,setValues:X,setFormikState:ie},se=U(function(){return h(L.values,le)},[le,h,L.values]),ce=U(function(){return M({type:"SUBMIT_ATTEMPT"}),W().then(function(e){if(0===Object.keys(e).length)return Promise.resolve(se()).then(function(){_.current&&M({type:"SUBMIT_SUCCESS"})}).catch(function(e){if(_.current)throw M({type:"SUBMIT_FAILURE"}),e});_.current&&M({type:"SUBMIT_FAILURE"})})},[se,W]),de=U(function(e){e&&e.preventDefault&&v(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&v(e.stopPropagation)&&e.stopPropagation(),ce()},[ce]),fe=U(function(e){if(e&&e.preventDefault&&v(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&v(e.stopPropagation)&&e.stopPropagation(),E.onReset){var t=E.onReset(L.values,le);S(t)?t.then(H):H()}else H()},[le,E.onReset,H,L.values]),pe=t.useCallback(function(e){return{value:T(L.values,e),error:T(L.errors,e),touched:!!T(L.touched,e),initialValue:T(g.current,e),initialTouched:!!T(R.current,e),initialError:T(F.current,e)}},[L.errors,L.touched,L.values]),ve=t.useCallback(function(e){var t=e.name,r=e.type,n=e.value,a=e.as,i=e.multiple,u=T(L.values,t),o={name:t,value:u,onChange:te,onBlur:ae};return"checkbox"===r?void 0===n?o.checked=!!u:(o.checked=!(!Array.isArray(u)||!~u.indexOf(n)),o.value=n):"radio"===r?(o.checked=u===n,o.value=n):"select"===a&&i&&(o.value=o.value||[],o.multiple=!0),[o,pe(t)]},[pe,ae,te,L.values]),he=t.useMemo(function(){return!r(g.current,L.values)},[L.values]),me=t.useMemo(function(){return void 0!==s?he?L.errors&&0===Object.keys(L.errors).length:!1!==s&&v(s)?s(E):s:L.errors&&0===Object.keys(L.errors).length},[s,he,L.errors,E]);return c({},L,{initialValues:g.current,initialErrors:F.current,initialTouched:R.current,initialStatus:O.current,handleBlur:ae,handleChange:te,handleReset:fe,handleSubmit:de,resetForm:H,setErrors:Q,setFormikState:ie,setFieldTouched:re,setFieldValue:$,setFieldError:Z,setStatus:ue,setSubmitting:oe,setTouched:J,setValues:X,submitForm:ce,validateForm:W,validateField:K,isValid:me,dirty:he,unregisterField:z,registerField:Y,getFieldProps:ve,validateOnBlur:l,validateOnChange:i})}function A(e){var r=I(e),n=e.component,a=e.children,i=e.render;return t.createElement(R,{value:r},n?t.createElement(n,r):i?i(r):a?v(a)?a(r):E(a)?null:t.Children.only(a):null)}function D(e){var t={};if(0===e.inner.length)return b(t,e.path,e.message);var r=e.inner,n=Array.isArray(r),a=0;for(r=n?r:r[Symbol.iterator]();;){var i;if(n){if(a>=r.length)break;i=r[a++]}else{if((a=r.next()).done)break;i=a.value}t[i.path]||(t=b(t,i.path,i.message))}return t}function w(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n={});var a={};for(var i in e)if(e.hasOwnProperty(i)){var u=String(i);a[u]=""!==e[u]?e[u]:void 0}return t[r?"validateSync":"validate"](a,{abortEarly:!1,context:n})}function V(e,t,r){var a=e.slice();return t.forEach(function(t,i){if(void 0===a[i]){var u=!1!==r.clone&&r.isMergeableObject(t);a[i]=u?n(Array.isArray(t)?[]:{},t,r):t}else r.isMergeableObject(t)?a[i]=n(e[i],t,r):-1===e.indexOf(t)&&a.push(t)}),a}function U(e,r){var n=t.useRef(function(){throw new Error("Cannot call an event handler while rendering.")});return t.useEffect(function(){n.current=e},[e].concat(r)),t.useCallback(function(){return n.current.apply(void 0,arguments)},[n])}function L(e){var r=e.validate,n=e.name,a=e.render,i=e.children,u=e.as,o=e.component,l=f(e,["validate","name","render","children","as","component"]),s=f(_(),["validate","validationSchema"]);t.useEffect(function(){},[]),t.useEffect(function(){return s.registerField(n,{validate:r}),function(){s.unregisterField(n)}},[s,n,r]);var d=s.getFieldProps(c({name:n},l)),p=d[0],h=d[1],m={field:p,form:s};if(a)return a(m);if(v(i))return i(c({},m,{meta:h}));if(o){if("string"==typeof o){var y=l.innerRef,E=f(l,["innerRef"]);return t.createElement(o,c({ref:y},p,E),i)}return t.createElement(o,c({field:p,form:s},l),i)}var S=u||"input";if("string"==typeof S){var T=l.innerRef,b=f(l,["innerRef"]);return t.createElement(S,c({ref:T},p,b),i)}return t.createElement(S,c({},p,l),i)}var M=L;function j(e){var r=_();return t.createElement("form",Object.assign({onSubmit:r.handleSubmit,onReset:r.handleReset},e))}function N(e){var r=function(r){return t.createElement(O,null,function(n){return n||u(!1),t.createElement(e,Object.assign({},r,{formik:n}))})},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return r.WrappedComponent=e,r.displayName="FormikConnect("+n+")",l(r,e)}j.displayName="Form";var B=function(e,t,r){var n=[].concat(e||[]),a=n[t];return n.splice(t,1),n.splice(r,0,a),n},x=function(e,t,r){var n=[].concat(e||[]),a=n[t];return n[t]=n[r],n[r]=a,n},q=function(e,t,r){var n=[].concat(e||[]);return n.splice(t,0,r),n},G=function(e,t,r){var n=[].concat(e||[]);return n[t]=r,n},W=function(e){function r(t){var r;return(r=e.call(this,t)||this).updateArrayField=function(e,t,n){var a=r.props,i=a.name,u=a.validateOnChange,o=a.formik,l=o.validateForm;(0,o.setFormikState)(function(r){var a="function"==typeof n?n:e,u="function"==typeof t?t:e;return c({},r,{values:b(r.values,i,e(T(r.values,i))),errors:n?b(r.errors,i,a(T(r.errors,i))):r.errors,touched:t?b(r.touched,i,u(T(r.touched,i))):r.touched})},function(){u&&l()})},r.push=function(e){return r.updateArrayField(function(t){return[].concat(t||[],[s(e)])},!1,!1)},r.handlePush=function(e){return function(){return r.push(e)}},r.swap=function(e,t){return r.updateArrayField(function(r){return x(r,e,t)},!0,!0)},r.handleSwap=function(e,t){return function(){return r.swap(e,t)}},r.move=function(e,t){return r.updateArrayField(function(r){return B(r,e,t)},!0,!0)},r.handleMove=function(e,t){return function(){return r.move(e,t)}},r.insert=function(e,t){return r.updateArrayField(function(r){return q(r,e,t)},function(t){return q(t,e,null)},function(t){return q(t,e,null)})},r.handleInsert=function(e,t){return function(){return r.insert(e,t)}},r.replace=function(e,t){return r.updateArrayField(function(r){return G(r,e,t)},!1,!1)},r.handleReplace=function(e,t){return function(){return r.replace(e,t)}},r.unshift=function(e){var t=-1;return r.updateArrayField(function(r){var n=r?[e].concat(r):[e];return t<0&&(t=n.length),n},function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r},function(e){var r=e?[null].concat(e):[null];return t<0&&(t=r.length),r}),t},r.handleUnshift=function(e){return function(){return r.unshift(e)}},r.handleRemove=function(e){return function(){return r.remove(e)}},r.handlePop=function(){return function(){return r.pop()}},r.remove=r.remove.bind(p(r)),r.pop=r.pop.bind(p(r)),r}d(r,e);var n=r.prototype;return n.remove=function(e){var t;return this.updateArrayField(function(r){var n=r?[].concat(r):[];return t||(t=n[e]),v(n.splice)&&n.splice(e,1),n},!0,!0),t},n.pop=function(){var e;return this.updateArrayField(function(t){var r=t;return e||(e=r&&r.pop&&r.pop()),r},!0,!0),e},n.render=function(){var e=this.props,r=e.component,n=e.render,a=e.children,i=e.name,u=c({},{push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},{form:f(e.formik,["validate","validationSchema"]),name:i});return r?t.createElement(r,u):n?n(u):a?"function"==typeof a?a(u):E(a)?null:t.Children.only(a):null},r}(t.Component);W.defaultProps={validateOnChange:!0};var H=N(W);e.ErrorMessage=N(function(e){function r(){return e.apply(this,arguments)||this}d(r,e);var n=r.prototype;return n.shouldComponentUpdate=function(e){return T(this.props.formik.errors,this.props.name)!==T(e.formik.errors,this.props.name)||T(this.props.formik.touched,this.props.name)!==T(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,r=e.component,n=e.formik,a=e.render,i=e.children,u=e.name,o=f(e,["component","formik","render","children","name"]),l=T(n.touched,u),s=T(n.errors,u);return l&&s?a?v(a)?a(s):null:i?v(i)?i(s):null:r?t.createElement(r,o,s):s:null},r}(t.Component)),e.FastField=M,e.Field=L,e.FieldArray=H,e.Form=j,e.Formik=A,e.FormikConsumer=O,e.FormikProvider=R,e.connect=N,e.getActiveElement=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}},e.getIn=T,e.insert=q,e.isEmptyChildren=E,e.isFunction=v,e.isInputEvent=function(e){return e&&h(e)&&h(e.target)},e.isInteger=m,e.isNaN=function(e){return e!=e},e.isObject=h,e.isPromise=S,e.isString=y,e.move=B,e.replace=G,e.setIn=b,e.setNestedObjectValues=g,e.swap=x,e.useField=function(e){var t=_();return h(e)?t.getFieldProps(e):t.getFieldProps({name:e})},e.useFormik=I,e.useFormikContext=_,e.validateYupSchema=w,e.withFormik=function(e){var r=e.mapPropsToValues,n=void 0===r?function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&"function"!=typeof e[r]&&(t[r]=e[r]);return t}:r,a=f(e,["mapPropsToValues"]);return function(e){var r=e.displayName||e.name||e.constructor&&e.constructor.name||"Component",i=function(r){function i(){var n;return(n=r.apply(this,arguments)||this).validate=function(e){return a.validate(e,n.props)},n.validationSchema=function(){return v(a.validationSchema)?a.validationSchema(n.props):a.validationSchema},n.handleSubmit=function(e,t){return a.handleSubmit(e,c({},t,{props:n.props}))},n.renderFormComponent=function(r){return t.createElement(e,Object.assign({},n.props,r))},n}return d(i,r),i.prototype.render=function(){var e=f(this.props,["children"]);return t.createElement(A,Object.assign({},e,a,{validate:a.validate&&this.validate,validationSchema:a.validationSchema&&this.validationSchema,initialValues:n(this.props),initialStatus:a.mapPropsToStatus&&a.mapPropsToStatus(this.props),initialErrors:a.mapPropsToErrors&&a.mapPropsToErrors(this.props),initialTouched:a.mapPropsToTouched&&a.mapPropsToTouched(this.props),onSubmit:this.handleSubmit,render:this.renderFormComponent}))},i}(t.Component);return i.displayName="WithFormik("+r+")",l(i,e)}},e.yupToFormErrors=D}); | ||
//# sourceMappingURL=formik.umd.production.min.js.map |
@@ -34,5 +34,5 @@ import * as React from 'react'; | ||
setValues(values: Values): void; | ||
setFieldValue(field: keyof Values & string, value: any): void; | ||
setFieldValue(field: keyof Values & string, value: any, shouldValidate?: boolean): void; | ||
setFieldError(field: keyof Values & string, message: string): void; | ||
setFieldTouched(field: keyof Values & string, isTouched?: boolean): void; | ||
setFieldTouched(field: keyof Values & string, isTouched?: boolean, shouldValidate?: boolean): void; | ||
validateForm(values?: any): Promise<FormikErrors<Values>>; | ||
@@ -39,0 +39,0 @@ validateField(field: string): void; |
{ | ||
"name": "formik", | ||
"description": "Forms in React, without tears", | ||
"version": "2.0.1-rc.9+7ba657c", | ||
"version": "2.0.1-rc.10", | ||
"license": "MIT", | ||
@@ -126,3 +126,4 @@ "author": "Jared Palmer <jared@palmer.net>", | ||
}, | ||
"size-limit": [{ | ||
"size-limit": [ | ||
{ | ||
"path": "./dist/index.js", | ||
@@ -140,2 +141,2 @@ "limit": "14 kB" | ||
] | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
0
700737
4410