Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

formik

Package Overview
Dependencies
11
Maintainers
1
Versions
212
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.4.1 to 2.4.2

5

dist/connect.d.ts
import * as React from 'react';
import hoistNonReactStatics from 'hoist-non-react-statics';
import { FormikContextType } from './types';

@@ -9,2 +10,4 @@ /**

formik: FormikContextType<Values>;
}>): React.ComponentType<OuterProps>;
}>): React.FC<OuterProps> & hoistNonReactStatics.NonReactStatics<React.ComponentClass<OuterProps & {
formik: FormikContextType<Values>;
}, any>, {}>;

8

dist/ErrorMessage.d.ts

@@ -0,2 +1,4 @@

/// <reference types="hoist-non-react-statics" />
import * as React from 'react';
import { FormikContextType } from './types';
export interface ErrorMessageProps {

@@ -9,2 +11,6 @@ name: string;

}
export declare const ErrorMessage: React.ComponentType<ErrorMessageProps>;
export declare const ErrorMessage: React.FC<ErrorMessageProps> & import("hoist-non-react-statics").NonReactStatics<React.ComponentClass<ErrorMessageProps & {
formik: FormikContextType<ErrorMessageProps & {
formik: FormikContextType<any>;
}>;
}, any>, {}>;

@@ -0,1 +1,2 @@

/// <reference types="hoist-non-react-statics" />
import * as React from 'react';

@@ -9,7 +10,7 @@ import { FormikProps, GenericFieldHTMLAttributes, FieldMetaProps, FieldInputProps } from './types';

}
export declare type FastFieldConfig<T> = FieldConfig & {
export type FastFieldConfig<T> = FieldConfig & {
/** Override FastField's default shouldComponentUpdate */
shouldUpdate?: (nextProps: T & GenericFieldHTMLAttributes, props: {}) => boolean;
};
export declare type FastFieldAttributes<T> = GenericFieldHTMLAttributes & FastFieldConfig<T> & T;
export declare const FastField: React.ComponentType<any>;
export type FastFieldAttributes<T> = GenericFieldHTMLAttributes & FastFieldConfig<T> & T;
export declare const FastField: React.FC<any> & import("hoist-non-react-statics").NonReactStatics<React.ComponentClass<any, any>, {}>;

@@ -31,2 +31,6 @@ import * as React from 'react';

/**
* Used for 'select' and related input types.
*/
multiple?: boolean;
/**
* Field name

@@ -42,8 +46,8 @@ */

}
export declare type FieldAttributes<T> = GenericFieldHTMLAttributes & FieldConfig<T> & T & {
export type FieldAttributes<T> = GenericFieldHTMLAttributes & FieldConfig<T> & T & {
name: string;
};
export declare type FieldHookConfig<T> = GenericFieldHTMLAttributes & FieldConfig<T>;
export type FieldHookConfig<T> = GenericFieldHTMLAttributes & FieldConfig<T>;
export declare function useField<Val = any>(propsOrFieldName: string | FieldHookConfig<Val>): [FieldInputProps<Val>, FieldMetaProps<Val>, FieldHelperProps<Val>];
export declare function Field({ validate, name, render, children, as: is, // `as` is reserved in typescript lol
component, ...props }: FieldAttributes<any>): any;

@@ -0,8 +1,9 @@

/// <reference types="hoist-non-react-statics" />
import * as React from 'react';
import { FormikProps, SharedRenderProps } from './types';
export declare type FieldArrayRenderProps = ArrayHelpers & {
import { FormikContextType, FormikProps, SharedRenderProps } from './types';
export type FieldArrayRenderProps = ArrayHelpers & {
form: FormikProps<any>;
name: string;
};
export declare type FieldArrayConfig = {
export type FieldArrayConfig = {
/** Really the path to the array field to be updated */

@@ -54,2 +55,9 @@ name: string;

export declare const replace: <T>(arrayLike: ArrayLike<T>, index: number, value: T) => unknown[];
export declare const FieldArray: React.ComponentType<FieldArrayConfig>;
export declare const FieldArray: React.FC<FieldArrayConfig> & import("hoist-non-react-statics").NonReactStatics<React.ComponentClass<{
/** Really the path to the array field to be updated */
name: string;
/** Should field array validate the form AFTER array updates/changes? */
validateOnChange?: boolean | undefined;
} & SharedRenderProps<FieldArrayRenderProps> & {
formik: FormikContextType<any>;
}, any>, {}>;
import * as React from 'react';
export declare type FormikFormProps = Pick<React.FormHTMLAttributes<HTMLFormElement>, Exclude<keyof React.FormHTMLAttributes<HTMLFormElement>, 'onReset' | 'onSubmit'>>;
export declare const Form: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "acceptCharset" | "action" | "autoComplete" | "encType" | "method" | "name" | "noValidate" | "target" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLFormElement>>;
export type FormikFormProps = Pick<React.FormHTMLAttributes<HTMLFormElement>, Exclude<keyof React.FormHTMLAttributes<HTMLFormElement>, 'onReset' | 'onSubmit'>>;
export declare const Form: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "ref"> & React.RefAttributes<HTMLFormElement>>;

@@ -1,2 +0,2 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("react"),t=e(require("react-fast-compare")),n=e(require("deepmerge")),i=e(require("lodash/isPlainObject")),a=e(require("lodash/clone")),o=e(require("lodash/toPath")),u=e(require("tiny-warning")),s=e(require("hoist-non-react-statics")),l=e(require("lodash/cloneDeep"));function c(){return(c=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function p(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r}function d(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r.indexOf(t=a[n])>=0||(i[t]=e[t]);return i}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 Array.isArray(e)&&0===e.length},h=function(e){return"function"==typeof e},m=function(e){return null!==e&&"object"==typeof e},y=function(e){return String(Math.floor(Number(e)))===e},E=function(e){return"[object String]"===Object.prototype.toString.call(e)},S=function(e){return 0===r.Children.count(e)},T=function(e){return m(e)&&h(e.then)};function g(e,r,t,n){void 0===n&&(n=0);for(var i=o(r);e&&n<i.length;)e=e[i[n++]];return n===i.length||e?void 0===e?t:e:t}function b(e,r,t){for(var n=a(e),i=n,u=0,s=o(r);u<s.length-1;u++){var l=s[u],c=g(e,s.slice(0,u+1));if(c&&(m(c)||Array.isArray(c)))i=i[l]=a(c);else{var p=s[u+1];i=i[l]=y(p)&&Number(p)>=0?[]:{}}}return(0===u?e:i)[s[u]]===t?e:(void 0===t?delete i[s[u]]:i[s[u]]=t,0===u&&void 0===t&&delete n[s[u]],n)}function F(e,r,t,n){void 0===t&&(t=new WeakMap),void 0===n&&(n={});for(var i=0,a=Object.keys(e);i<a.length;i++){var o=a[i],u=e[o];m(u)?t.get(u)||(t.set(u,!0),n[o]=Array.isArray(u)?[]:{},F(u,r,t,n[o])):n[o]=r}return n}var k=r.createContext(void 0);k.displayName="FormikContext";var O=k.Provider,_=k.Consumer;function A(){var e=r.useContext(k);return e||u(!1),e}function R(e,r){switch(r.type){case"SET_VALUES":return c({},e,{values:r.payload});case"SET_TOUCHED":return c({},e,{touched:r.payload});case"SET_ERRORS":return t(e.errors,r.payload)?e:c({},e,{errors:r.payload});case"SET_STATUS":return c({},e,{status:r.payload});case"SET_ISSUBMITTING":return c({},e,{isSubmitting:r.payload});case"SET_ISVALIDATING":return c({},e,{isValidating:r.payload});case"SET_FIELD_VALUE":return c({},e,{values:b(e.values,r.payload.field,r.payload.value)});case"SET_FIELD_TOUCHED":return c({},e,{touched:b(e.touched,r.payload.field,r.payload.value)});case"SET_FIELD_ERROR":return c({},e,{errors:b(e.errors,r.payload.field,r.payload.value)});case"RESET_FORM":return c({},e,r.payload);case"SET_FORMIK_STATE":return r.payload(e);case"SUBMIT_ATTEMPT":return c({},e,{touched:F(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return c({},e,{isSubmitting:!1});default:return e}}var C={},I={};function P(e){var i=e.validateOnChange,a=void 0===i||i,o=e.validateOnBlur,u=void 0===o||o,s=e.validateOnMount,l=void 0!==s&&s,p=e.isInitialValid,f=e.enableReinitialize,v=void 0!==f&&f,y=e.onSubmit,S=d(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),F=c({validateOnChange:a,validateOnBlur:u,validateOnMount:l,onSubmit:y},S),k=r.useRef(F.initialValues),O=r.useRef(F.initialErrors||C),_=r.useRef(F.initialTouched||I),A=r.useRef(F.initialStatus),P=r.useRef(!1),x=r.useRef({});r.useEffect((function(){return P.current=!0,function(){P.current=!1}}),[]);var D=r.useReducer(R,{values:F.initialValues,errors:F.initialErrors||C,touched:F.initialTouched||I,status:F.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),w=D[0],j=D[1],N=r.useCallback((function(e,r){return new Promise((function(t,n){var i=F.validate(e,r);null==i?t(C):T(i)?i.then((function(e){t(e||C)}),(function(e){n(e)})):t(i)}))}),[F.validate]),B=r.useCallback((function(e,r){var t=F.validationSchema,n=h(t)?t(r):t,i=r&&n.validateAt?n.validateAt(r,e):V(e,n);return new Promise((function(e,r){i.then((function(){e(C)}),(function(t){"ValidationError"===t.name?e(U(t)):r(t)}))}))}),[F.validationSchema]),q=r.useCallback((function(e,r){return new Promise((function(t){return t(x.current[e].validate(r))}))}),[]),G=r.useCallback((function(e){var r=Object.keys(x.current).filter((function(e){return h(x.current[e].validate)})),t=r.length>0?r.map((function(r){return q(r,g(e,r))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(t).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)}),{})}))}),[q]),H=r.useCallback((function(e){return Promise.all([G(e),F.validationSchema?B(e):{},F.validate?N(e):{}]).then((function(e){return n.all([e[0],e[1],e[2]],{arrayMerge:M})}))}),[F.validate,F.validationSchema,G,N,B]),W=L((function(e){return void 0===e&&(e=w.values),j({type:"SET_ISVALIDATING",payload:!0}),H(e).then((function(e){return P.current&&(j({type:"SET_ISVALIDATING",payload:!1}),j({type:"SET_ERRORS",payload:e})),e}))}));r.useEffect((function(){l&&!0===P.current&&t(k.current,F.initialValues)&&W(k.current)}),[l,W]);var K=r.useCallback((function(e){var r=e&&e.values?e.values:k.current,t=e&&e.errors?e.errors:O.current?O.current:F.initialErrors||{},n=e&&e.touched?e.touched:_.current?_.current:F.initialTouched||{},i=e&&e.status?e.status:A.current?A.current:F.initialStatus;k.current=r,O.current=t,_.current=n,A.current=i;var a=function(){j({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:t,touched:n,status:i,values:r,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(F.onReset){var o=F.onReset(w.values,pe);T(o)?o.then(a):a()}else a()}),[F.initialErrors,F.initialStatus,F.initialTouched]);r.useEffect((function(){!0!==P.current||t(k.current,F.initialValues)||v&&(k.current=F.initialValues,K(),l&&W(k.current))}),[v,F.initialValues,K,l,W]),r.useEffect((function(){v&&!0===P.current&&!t(O.current,F.initialErrors)&&(O.current=F.initialErrors||C,j({type:"SET_ERRORS",payload:F.initialErrors||C}))}),[v,F.initialErrors]),r.useEffect((function(){v&&!0===P.current&&!t(_.current,F.initialTouched)&&(_.current=F.initialTouched||I,j({type:"SET_TOUCHED",payload:F.initialTouched||I}))}),[v,F.initialTouched]),r.useEffect((function(){v&&!0===P.current&&!t(A.current,F.initialStatus)&&(A.current=F.initialStatus,j({type:"SET_STATUS",payload:F.initialStatus}))}),[v,F.initialStatus,F.initialTouched]);var Y=L((function(e){if(x.current[e]&&h(x.current[e].validate)){var r=g(w.values,e),t=x.current[e].validate(r);return T(t)?(j({type:"SET_ISVALIDATING",payload:!0}),t.then((function(e){return e})).then((function(r){j({type:"SET_FIELD_ERROR",payload:{field:e,value:r}}),j({type:"SET_ISVALIDATING",payload:!1})}))):(j({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),Promise.resolve(t))}return F.validationSchema?(j({type:"SET_ISVALIDATING",payload:!0}),B(w.values,e).then((function(e){return e})).then((function(r){j({type:"SET_FIELD_ERROR",payload:{field:e,value:g(r,e)}}),j({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),z=r.useCallback((function(e,r){x.current[e]={validate:r.validate}}),[]),J=r.useCallback((function(e){delete x.current[e]}),[]),Q=L((function(e,r){return j({type:"SET_TOUCHED",payload:e}),(void 0===r?u:r)?W(w.values):Promise.resolve()})),X=r.useCallback((function(e){j({type:"SET_ERRORS",payload:e})}),[]),Z=L((function(e,r){var t=h(e)?e(w.values):e;return j({type:"SET_VALUES",payload:t}),(void 0===r?a:r)?W(t):Promise.resolve()})),$=r.useCallback((function(e,r){j({type:"SET_FIELD_ERROR",payload:{field:e,value:r}})}),[]),ee=L((function(e,r,t){return j({type:"SET_FIELD_VALUE",payload:{field:e,value:r}}),(void 0===t?a:t)?W(b(w.values,e,r)):Promise.resolve()})),re=r.useCallback((function(e,r){var t,n=r,i=e;if(!E(e)){e.persist&&e.persist();var a=e.target?e.target:e.currentTarget,o=a.type,u=a.value,s=a.checked,l=a.options,c=a.multiple;n=r||a.name||a.id,i=/number|range/.test(o)?(t=parseFloat(u),isNaN(t)?"":t):/checkbox/.test(o)?function(e,r,t){if("boolean"==typeof e)return Boolean(r);var n=[],i=!1,a=-1;if(Array.isArray(e))n=e,i=(a=e.indexOf(t))>=0;else if(!t||"true"==t||"false"==t)return Boolean(r);return r&&t&&!i?n.concat(t):i?n.slice(0,a).concat(n.slice(a+1)):n}(g(w.values,n),s,u):l&&c?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(l):u}n&&ee(n,i)}),[ee,w.values]),te=L((function(e){if(E(e))return function(r){return re(r,e)};re(e)})),ne=L((function(e,r,t){return void 0===r&&(r=!0),j({type:"SET_FIELD_TOUCHED",payload:{field:e,value:r}}),(void 0===t?u:t)?W(w.values):Promise.resolve()})),ie=r.useCallback((function(e,r){e.persist&&e.persist();var t=e.target;ne(r||t.name||t.id,!0)}),[ne]),ae=L((function(e){if(E(e))return function(r){return ie(r,e)};ie(e)})),oe=r.useCallback((function(e){h(e)?j({type:"SET_FORMIK_STATE",payload:e}):j({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),ue=r.useCallback((function(e){j({type:"SET_STATUS",payload:e})}),[]),se=r.useCallback((function(e){j({type:"SET_ISSUBMITTING",payload:e})}),[]),le=L((function(){return j({type:"SUBMIT_ATTEMPT"}),W().then((function(e){var r=e instanceof Error;if(!r&&0===Object.keys(e).length){var t;try{if(void 0===(t=de()))return}catch(e){throw e}return Promise.resolve(t).then((function(e){return P.current&&j({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(P.current)throw j({type:"SUBMIT_FAILURE"}),e}))}if(P.current&&(j({type:"SUBMIT_FAILURE"}),r))throw e}))})),ce=L((function(e){e&&e.preventDefault&&h(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&h(e.stopPropagation)&&e.stopPropagation(),le().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),pe={resetForm:K,validateForm:W,validateField:Y,setErrors:X,setFieldError:$,setFieldTouched:ne,setFieldValue:ee,setStatus:ue,setSubmitting:se,setTouched:Q,setValues:Z,setFormikState:oe,submitForm:le},de=L((function(){return y(w.values,pe)})),fe=L((function(e){e&&e.preventDefault&&h(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&h(e.stopPropagation)&&e.stopPropagation(),K()})),ve=r.useCallback((function(e){return{value:g(w.values,e),error:g(w.errors,e),touched:!!g(w.touched,e),initialValue:g(k.current,e),initialTouched:!!g(_.current,e),initialError:g(O.current,e)}}),[w.errors,w.touched,w.values]),he=r.useCallback((function(e){return{setValue:function(r,t){return ee(e,r,t)},setTouched:function(r,t){return ne(e,r,t)},setError:function(r){return $(e,r)}}}),[ee,ne,$]),me=r.useCallback((function(e){var r=m(e),t=r?e.name:e,n=g(w.values,t),i={name:t,value:n,onChange:te,onBlur:ae};if(r){var a=e.type,o=e.value,u=e.as,s=e.multiple;"checkbox"===a?void 0===o?i.checked=!!n:(i.checked=!(!Array.isArray(n)||!~n.indexOf(o)),i.value=o):"radio"===a?(i.checked=n===o,i.value=o):"select"===u&&s&&(i.value=i.value||[],i.multiple=!0)}return i}),[ae,te,w.values]),ye=r.useMemo((function(){return!t(k.current,w.values)}),[k.current,w.values]),Ee=r.useMemo((function(){return void 0!==p?ye?w.errors&&0===Object.keys(w.errors).length:!1!==p&&h(p)?p(F):p:w.errors&&0===Object.keys(w.errors).length}),[p,ye,w.errors,F]);return c({},w,{initialValues:k.current,initialErrors:O.current,initialTouched:_.current,initialStatus:A.current,handleBlur:ae,handleChange:te,handleReset:fe,handleSubmit:ce,resetForm:K,setErrors:X,setFormikState:oe,setFieldTouched:ne,setFieldValue:ee,setFieldError:$,setStatus:ue,setSubmitting:se,setTouched:Q,setValues:Z,submitForm:le,validateForm:W,validateField:Y,isValid:Ee,dirty:ye,unregisterField:J,registerField:z,getFieldProps:me,getFieldMeta:ve,getFieldHelpers:he,validateOnBlur:u,validateOnChange:a,validateOnMount:l})}function x(e){var t=P(e),n=e.component,i=e.children,a=e.render;return r.useImperativeHandle(e.innerRef,(function(){return t})),r.createElement(O,{value:t},n?r.createElement(n,t):a?a(t):i?h(i)?i(t):S(i)?null:r.Children.only(i):null)}function U(e){var r={};if(e.inner){if(0===e.inner.length)return b(r,e.path,e.message);var t=e.inner,n=Array.isArray(t),i=0;for(t=n?t:t[Symbol.iterator]();;){var a;if(n){if(i>=t.length)break;a=t[i++]}else{if((i=t.next()).done)break;a=i.value}var o=a;g(r,o.path)||(r=b(r,o.path,o.message))}}return r}function V(e,r,t,n){void 0===t&&(t=!1);var i=D(e);return r[t?"validateSync":"validate"](i,{abortEarly:!1,context:n||i})}function D(e){var r=Array.isArray(e)?[]:{};for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=String(t);r[n]=!0===Array.isArray(e[n])?e[n].map((function(e){return!0===Array.isArray(e)||i(e)?D(e):""!==e?e:void 0})):i(e[n])?D(e[n]):""!==e[n]?e[n]:void 0}return r}function M(e,r,t){var i=e.slice();return r.forEach((function(r,a){if(void 0===i[a]){var o=!1!==t.clone&&t.isMergeableObject(r);i[a]=o?n(Array.isArray(r)?[]:{},r,t):r}else t.isMergeableObject(r)?i[a]=n(e[a],r,t):-1===e.indexOf(r)&&i.push(r)})),i}var w="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect;function L(e){var t=r.useRef(e);return w((function(){t.current=e})),r.useCallback((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.current.apply(void 0,r)}),[])}var j=r.forwardRef((function(e,t){var n=e.action,i=d(e,["action"]),a=null!=n?n:"#",o=A();return r.createElement("form",Object.assign({onSubmit:o.handleSubmit,ref:t,onReset:o.handleReset,action:a},i))}));function N(e){var t=function(t){return r.createElement(_,null,(function(n){return n||u(!1),r.createElement(e,Object.assign({},t,{formik:n}))}))},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return t.WrappedComponent=e,t.displayName="FormikConnect("+n+")",s(t,e)}j.displayName="Form";var B=function(e,r,t){var n=W(e),i=n[r];return n.splice(r,1),n.splice(t,0,i),n},q=function(e,r,t){var n=W(e),i=n[r];return n[r]=n[t],n[t]=i,n},G=function(e,r,t){var n=W(e);return n.splice(r,0,t),n},H=function(e,r,t){var n=W(e);return n[r]=t,n},W=function(e){if(e){if(Array.isArray(e))return[].concat(e);var r=Object.keys(e).map((function(e){return parseInt(e)})).reduce((function(e,r){return r>e?r:e}),0);return Array.from(c({},e,{length:r+1}))}return[]},K=function(e,r){var t="function"==typeof e?e:r;return function(e){if(Array.isArray(e)||m(e)){var r=W(e);return t(r)}return e}},Y=function(e){function n(r){var t;return(t=e.call(this,r)||this).updateArrayField=function(e,r,n){var i=t.props,a=i.name;(0,i.formik.setFormikState)((function(t){var i=K(n,e),o=K(r,e),u=b(t.values,a,e(g(t.values,a))),s=n?i(g(t.errors,a)):void 0,l=r?o(g(t.touched,a)):void 0;return v(s)&&(s=void 0),v(l)&&(l=void 0),c({},t,{values:u,errors:n?b(t.errors,a,s):t.errors,touched:r?b(t.touched,a,l):t.touched})}))},t.push=function(e){return t.updateArrayField((function(r){return[].concat(W(r),[l(e)])}),!1,!1)},t.handlePush=function(e){return function(){return t.push(e)}},t.swap=function(e,r){return t.updateArrayField((function(t){return q(t,e,r)}),!0,!0)},t.handleSwap=function(e,r){return function(){return t.swap(e,r)}},t.move=function(e,r){return t.updateArrayField((function(t){return B(t,e,r)}),!0,!0)},t.handleMove=function(e,r){return function(){return t.move(e,r)}},t.insert=function(e,r){return t.updateArrayField((function(t){return G(t,e,r)}),(function(r){return G(r,e,null)}),(function(r){return G(r,e,null)}))},t.handleInsert=function(e,r){return function(){return t.insert(e,r)}},t.replace=function(e,r){return t.updateArrayField((function(t){return H(t,e,r)}),!1,!1)},t.handleReplace=function(e,r){return function(){return t.replace(e,r)}},t.unshift=function(e){var r=-1;return t.updateArrayField((function(t){var n=t?[e].concat(t):[e];return r<0&&(r=n.length),n}),(function(e){var t=e?[null].concat(e):[null];return r<0&&(r=t.length),t}),(function(e){var t=e?[null].concat(e):[null];return r<0&&(r=t.length),t})),r},t.handleUnshift=function(e){return function(){return t.unshift(e)}},t.handleRemove=function(e){return function(){return t.remove(e)}},t.handlePop=function(){return function(){return t.pop()}},t.remove=t.remove.bind(f(t)),t.pop=t.pop.bind(f(t)),t}p(n,e);var i=n.prototype;return i.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!t(g(e.formik.values,e.name),g(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},i.remove=function(e){var r;return this.updateArrayField((function(t){var n=t?W(t):[];return r||(r=n[e]),h(n.splice)&&n.splice(e,1),h(n.every)&&n.every((function(e){return void 0===e}))?[]:n}),!0,!0),r},i.pop=function(){var e;return this.updateArrayField((function(r){var t=r.slice();return e||(e=t&&t.pop&&t.pop()),t}),!0,!0),e},i.render=function(){var e=this.props,t=e.component,n=e.render,i=e.children,a=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:a});return t?r.createElement(t,o):n?n(o):i?"function"==typeof i?i(o):S(i)?null:r.Children.only(i):null},n}(r.Component);Y.defaultProps={validateOnChange:!0};var z=N(Y),J=N(function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return g(this.props.formik.errors,this.props.name)!==g(e.formik.errors,this.props.name)||g(this.props.formik.touched,this.props.name)!==g(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,t=e.component,n=e.formik,i=e.render,a=e.children,o=e.name,u=d(e,["component","formik","render","children","name"]),s=g(n.touched,o),l=g(n.errors,o);return s&&l?i?h(i)?i(l):null:a?h(a)?a(l):null:t?r.createElement(t,u,l):l:null},t}(r.Component)),Q=N(function(e){function t(r){var t;t=e.call(this,r)||this;var n=r.render,i=r.children,a=r.component,o=r.as;return n&&u(!1),a&&n&&u(!1),o&&i&&h(i)&&u(!1),a&&i&&h(i)&&u(!1),n&&i&&!S(i)&&u(!1),t}p(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):e.name!==this.props.name||g(e.formik.values,this.props.name)!==g(this.props.formik.values,this.props.name)||g(e.formik.errors,this.props.name)!==g(this.props.formik.errors,this.props.name)||g(e.formik.touched,this.props.name)!==g(this.props.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length||e.formik.isSubmitting!==this.props.formik.isSubmitting},n.componentDidMount=function(){this.props.formik.registerField(this.props.name,{validate:this.props.validate})},n.componentDidUpdate=function(e){this.props.name!==e.name&&(this.props.formik.unregisterField(e.name),this.props.formik.registerField(this.props.name,{validate:this.props.validate})),this.props.validate!==e.validate&&this.props.formik.registerField(this.props.name,{validate:this.props.validate})},n.componentWillUnmount=function(){this.props.formik.unregisterField(this.props.name)},n.render=function(){var e=this.props,t=e.name,n=e.render,i=e.as,a=e.children,o=e.component,u=e.formik,s=d(e,["validate","name","render","as","children","component","shouldUpdate","formik"]),l=d(u,["validate","validationSchema"]),p=u.getFieldProps(c({name:t},s)),f={field:p,meta:{value:g(u.values,t),error:g(u.errors,t),touched:!!g(u.touched,t),initialValue:g(u.initialValues,t),initialTouched:!!g(u.initialTouched,t),initialError:g(u.initialErrors,t)},form:l};if(n)return n(f);if(h(a))return a(f);if(o){if("string"==typeof o){var v=s.innerRef,m=d(s,["innerRef"]);return r.createElement(o,c({ref:v},p,m),a)}return r.createElement(o,c({field:p,form:u},s),a)}var y=i||"input";if("string"==typeof y){var E=s.innerRef,S=d(s,["innerRef"]);return r.createElement(y,c({ref:E},p,S),a)}return r.createElement(y,c({},p,s),a)},t}(r.Component));exports.ErrorMessage=J,exports.FastField=Q,exports.Field=function(e){var t=e.validate,n=e.name,i=e.render,a=e.children,o=e.as,u=e.component,s=d(e,["validate","name","render","children","as","component"]),l=d(A(),["validate","validationSchema"]),p=l.registerField,f=l.unregisterField;r.useEffect((function(){return p(n,{validate:t}),function(){f(n)}}),[p,f,n,t]);var v=l.getFieldProps(c({name:n},s)),m=l.getFieldMeta(n),y={field:v,form:l};if(i)return i(c({},y,{meta:m}));if(h(a))return a(c({},y,{meta:m}));if(u){if("string"==typeof u){var E=s.innerRef,S=d(s,["innerRef"]);return r.createElement(u,c({ref:E},v,S),a)}return r.createElement(u,c({field:v,form:l},s),a)}var T=o||"input";if("string"==typeof T){var g=s.innerRef,b=d(s,["innerRef"]);return r.createElement(T,c({ref:g},v,b),a)}return r.createElement(T,c({},v,s),a)},exports.FieldArray=z,exports.Form=j,exports.Formik=x,exports.FormikConsumer=_,exports.FormikContext=k,exports.FormikProvider=O,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(r){return e.body}},exports.getIn=g,exports.insert=G,exports.isEmptyArray=v,exports.isEmptyChildren=S,exports.isFunction=h,exports.isInputEvent=function(e){return e&&m(e)&&m(e.target)},exports.isInteger=y,exports.isNaN=function(e){return e!=e},exports.isObject=m,exports.isPromise=T,exports.isString=E,exports.move=B,exports.prepareDataForValidation=D,exports.replace=H,exports.setIn=b,exports.setNestedObjectValues=F,exports.swap=q,exports.useField=function(e){var t=A(),n=t.getFieldProps,i=t.getFieldMeta,a=t.getFieldHelpers,o=t.registerField,s=t.unregisterField,l=m(e)?e:{name:e},c=l.name,p=l.validate;r.useEffect((function(){return c&&o(c,{validate:p}),function(){c&&s(c)}}),[o,s,c,p]),c||u(!1);var d=r.useMemo((function(){return a(c)}),[a,c]);return[n(l),i(c),d]},exports.useFormik=P,exports.useFormikContext=A,exports.validateYupSchema=V,exports.withFormik=function(e){var t=e.mapPropsToValues,n=void 0===t?function(e){var r={};for(var t in e)e.hasOwnProperty(t)&&"function"!=typeof e[t]&&(r[t]=e[t]);return r}:t,i=d(e,["mapPropsToValues"]);return function(e){var t=e.displayName||e.name||e.constructor&&e.constructor.name||"Component",a=function(t){function a(){var n;return(n=t.apply(this,arguments)||this).validate=function(e){return i.validate(e,n.props)},n.validationSchema=function(){return h(i.validationSchema)?i.validationSchema(n.props):i.validationSchema},n.handleSubmit=function(e,r){return i.handleSubmit(e,c({},r,{props:n.props}))},n.renderFormComponent=function(t){return r.createElement(e,Object.assign({},n.props,t))},n}return p(a,t),a.prototype.render=function(){var e=d(this.props,["children"]);return r.createElement(x,Object.assign({},e,i,{validate:i.validate&&this.validate,validationSchema:i.validationSchema&&this.validationSchema,initialValues:n(this.props),initialStatus:i.mapPropsToStatus&&i.mapPropsToStatus(this.props),initialErrors:i.mapPropsToErrors&&i.mapPropsToErrors(this.props),initialTouched:i.mapPropsToTouched&&i.mapPropsToTouched(this.props),onSubmit:this.handleSubmit,children:this.renderFormComponent}))},a}(r.Component);return a.displayName="WithFormik("+t+")",s(a,e)}},exports.yupToFormErrors=U;
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=e(require("deepmerge")),t=e(require("lodash/isPlainObject")),n=require("react"),i=e(require("react-fast-compare")),a=e(require("tiny-warning")),o=e(require("lodash/clone")),u=e(require("lodash/toPath")),s=e(require("hoist-non-react-statics")),l=e(require("lodash/cloneDeep"));function c(){return(c=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function p(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r}function d(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r.indexOf(t=a[n])>=0||(i[t]=e[t]);return i}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var v=n.createContext(void 0);v.displayName="FormikContext";var h=v.Provider,m=v.Consumer;function y(){var e=n.useContext(v);return e||a(!1),e}var E=function(e){return Array.isArray(e)&&0===e.length},S=function(e){return"function"==typeof e},T=function(e){return null!==e&&"object"==typeof e},g=function(e){return String(Math.floor(Number(e)))===e},b=function(e){return"[object String]"===Object.prototype.toString.call(e)},F=function(e){return 0===n.Children.count(e)},k=function(e){return T(e)&&S(e.then)};function A(e,r,t,n){void 0===n&&(n=0);for(var i=u(r);e&&n<i.length;)e=e[i[n++]];return n===i.length||e?void 0===e?t:e:t}function _(e,r,t){for(var n=o(e),i=n,a=0,s=u(r);a<s.length-1;a++){var l=s[a],c=A(e,s.slice(0,a+1));if(c&&(T(c)||Array.isArray(c)))i=i[l]=o(c);else{var p=s[a+1];i=i[l]=g(p)&&Number(p)>=0?[]:{}}}return(0===a?e:i)[s[a]]===t?e:(void 0===t?delete i[s[a]]:i[s[a]]=t,0===a&&void 0===t&&delete n[s[a]],n)}function R(e,r,t,n){void 0===t&&(t=new WeakMap),void 0===n&&(n={});for(var i=0,a=Object.keys(e);i<a.length;i++){var o=a[i],u=e[o];T(u)?t.get(u)||(t.set(u,!0),n[o]=Array.isArray(u)?[]:{},R(u,r,t,n[o])):n[o]=r}return n}var O={},C={};function I(e){var t=e.validateOnChange,a=void 0===t||t,o=e.validateOnBlur,u=void 0===o||o,s=e.validateOnMount,l=void 0!==s&&s,p=e.isInitialValid,f=e.enableReinitialize,v=void 0!==f&&f,h=e.onSubmit,m=d(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),y=c({validateOnChange:a,validateOnBlur:u,validateOnMount:l,onSubmit:h},m),E=n.useRef(y.initialValues),g=n.useRef(y.initialErrors||O),F=n.useRef(y.initialTouched||C),I=n.useRef(y.initialStatus),P=n.useRef(!1),V=n.useRef({});n.useEffect((function(){return P.current=!0,function(){P.current=!1}}),[]);var M=n.useState(0)[1],L=n.useRef({values:y.initialValues,errors:y.initialErrors||O,touched:y.initialTouched||C,status:y.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),j=L.current,N=n.useCallback((function(e){var r=L.current;L.current=function(e,r){switch(r.type){case"SET_VALUES":return c({},e,{values:r.payload});case"SET_TOUCHED":return c({},e,{touched:r.payload});case"SET_ERRORS":return i(e.errors,r.payload)?e:c({},e,{errors:r.payload});case"SET_STATUS":return c({},e,{status:r.payload});case"SET_ISSUBMITTING":return c({},e,{isSubmitting:r.payload});case"SET_ISVALIDATING":return c({},e,{isValidating:r.payload});case"SET_FIELD_VALUE":return c({},e,{values:_(e.values,r.payload.field,r.payload.value)});case"SET_FIELD_TOUCHED":return c({},e,{touched:_(e.touched,r.payload.field,r.payload.value)});case"SET_FIELD_ERROR":return c({},e,{errors:_(e.errors,r.payload.field,r.payload.value)});case"RESET_FORM":return c({},e,r.payload);case"SET_FORMIK_STATE":return r.payload(e);case"SUBMIT_ATTEMPT":return c({},e,{touched:R(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return c({},e,{isSubmitting:!1});default:return e}}(r,e),r!==L.current&&M((function(e){return e+1}))}),[]),B=n.useCallback((function(e,r){return new Promise((function(t,n){var i=y.validate(e,r);null==i?t(O):k(i)?i.then((function(e){t(e||O)}),(function(e){n(e)})):t(i)}))}),[y.validate]),q=n.useCallback((function(e,r){var t=y.validationSchema,n=S(t)?t(r):t,i=r&&n.validateAt?n.validateAt(r,e):U(e,n);return new Promise((function(e,r){i.then((function(){e(O)}),(function(t){"ValidationError"===t.name?e(x(t)):r(t)}))}))}),[y.validationSchema]),G=n.useCallback((function(e,r){return new Promise((function(t){return t(V.current[e].validate(r))}))}),[]),H=n.useCallback((function(e){var r=Object.keys(V.current).filter((function(e){return S(V.current[e].validate)})),t=r.length>0?r.map((function(r){return G(r,A(e,r))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(t).then((function(e){return e.reduce((function(e,t,n){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===t?e:(t&&(e=_(e,r[n],t)),e)}),{})}))}),[G]),W=n.useCallback((function(e){return Promise.all([H(e),y.validationSchema?q(e):{},y.validate?B(e):{}]).then((function(e){return r.all([e[0],e[1],e[2]],{arrayMerge:D})}))}),[y.validate,y.validationSchema,H,B,q]),K=w((function(e){return void 0===e&&(e=j.values),N({type:"SET_ISVALIDATING",payload:!0}),W(e).then((function(e){return P.current&&(N({type:"SET_ISVALIDATING",payload:!1}),N({type:"SET_ERRORS",payload:e})),e}))}));n.useEffect((function(){l&&!0===P.current&&i(E.current,y.initialValues)&&K(E.current)}),[l,K]);var Y=n.useCallback((function(e){var r=e&&e.values?e.values:E.current,t=e&&e.errors?e.errors:g.current?g.current:y.initialErrors||{},n=e&&e.touched?e.touched:F.current?F.current:y.initialTouched||{},i=e&&e.status?e.status:I.current?I.current:y.initialStatus;E.current=r,g.current=t,F.current=n,I.current=i;var a=function(){N({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:t,touched:n,status:i,values:r,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(y.onReset){var o=y.onReset(j.values,de);k(o)?o.then(a):a()}else a()}),[y.initialErrors,y.initialStatus,y.initialTouched]);n.useEffect((function(){!0!==P.current||i(E.current,y.initialValues)||v&&(E.current=y.initialValues,Y(),l&&K(E.current))}),[v,y.initialValues,Y,l,K]),n.useEffect((function(){v&&!0===P.current&&!i(g.current,y.initialErrors)&&(g.current=y.initialErrors||O,N({type:"SET_ERRORS",payload:y.initialErrors||O}))}),[v,y.initialErrors]),n.useEffect((function(){v&&!0===P.current&&!i(F.current,y.initialTouched)&&(F.current=y.initialTouched||C,N({type:"SET_TOUCHED",payload:y.initialTouched||C}))}),[v,y.initialTouched]),n.useEffect((function(){v&&!0===P.current&&!i(I.current,y.initialStatus)&&(I.current=y.initialStatus,N({type:"SET_STATUS",payload:y.initialStatus}))}),[v,y.initialStatus,y.initialTouched]);var z=w((function(e){if(V.current[e]&&S(V.current[e].validate)){var r=A(j.values,e),t=V.current[e].validate(r);return k(t)?(N({type:"SET_ISVALIDATING",payload:!0}),t.then((function(e){return e})).then((function(r){N({type:"SET_FIELD_ERROR",payload:{field:e,value:r}}),N({type:"SET_ISVALIDATING",payload:!1})}))):(N({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),Promise.resolve(t))}return y.validationSchema?(N({type:"SET_ISVALIDATING",payload:!0}),q(j.values,e).then((function(e){return e})).then((function(r){N({type:"SET_FIELD_ERROR",payload:{field:e,value:A(r,e)}}),N({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),J=n.useCallback((function(e,r){V.current[e]={validate:r.validate}}),[]),Q=n.useCallback((function(e){delete V.current[e]}),[]),X=w((function(e,r){return N({type:"SET_TOUCHED",payload:e}),(void 0===r?u:r)?K(j.values):Promise.resolve()})),Z=n.useCallback((function(e){N({type:"SET_ERRORS",payload:e})}),[]),$=w((function(e,r){var t=S(e)?e(j.values):e;return N({type:"SET_VALUES",payload:t}),(void 0===r?a:r)?K(t):Promise.resolve()})),ee=n.useCallback((function(e,r){N({type:"SET_FIELD_ERROR",payload:{field:e,value:r}})}),[]),re=w((function(e,r,t){return N({type:"SET_FIELD_VALUE",payload:{field:e,value:r}}),(void 0===t?a:t)?K(_(j.values,e,r)):Promise.resolve()})),te=n.useCallback((function(e,r){var t,n=r,i=e;if(!b(e)){e.persist&&e.persist();var a=e.target?e.target:e.currentTarget,o=a.type,u=a.value,s=a.checked,l=a.options,c=a.multiple;n=r||a.name||a.id,i=/number|range/.test(o)?(t=parseFloat(u),isNaN(t)?"":t):/checkbox/.test(o)?function(e,r,t){if("boolean"==typeof e)return Boolean(r);var n=[],i=!1,a=-1;if(Array.isArray(e))n=e,i=(a=e.indexOf(t))>=0;else if(!t||"true"==t||"false"==t)return Boolean(r);return r&&t&&!i?n.concat(t):i?n.slice(0,a).concat(n.slice(a+1)):n}(A(j.values,n),s,u):l&&c?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(l):u}n&&re(n,i)}),[re,j.values]),ne=w((function(e){if(b(e))return function(r){return te(r,e)};te(e)})),ie=w((function(e,r,t){return void 0===r&&(r=!0),N({type:"SET_FIELD_TOUCHED",payload:{field:e,value:r}}),(void 0===t?u:t)?K(j.values):Promise.resolve()})),ae=n.useCallback((function(e,r){e.persist&&e.persist();var t=e.target;ie(r||t.name||t.id,!0)}),[ie]),oe=w((function(e){if(b(e))return function(r){return ae(r,e)};ae(e)})),ue=n.useCallback((function(e){S(e)?N({type:"SET_FORMIK_STATE",payload:e}):N({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),se=n.useCallback((function(e){N({type:"SET_STATUS",payload:e})}),[]),le=n.useCallback((function(e){N({type:"SET_ISSUBMITTING",payload:e})}),[]),ce=w((function(){return N({type:"SUBMIT_ATTEMPT"}),K().then((function(e){var r=e instanceof Error;if(!r&&0===Object.keys(e).length){var t;try{if(void 0===(t=fe()))return}catch(e){throw e}return Promise.resolve(t).then((function(e){return P.current&&N({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(P.current)throw N({type:"SUBMIT_FAILURE"}),e}))}if(P.current&&(N({type:"SUBMIT_FAILURE"}),r))throw e}))})),pe=w((function(e){e&&e.preventDefault&&S(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&S(e.stopPropagation)&&e.stopPropagation(),ce().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),de={resetForm:Y,validateForm:K,validateField:z,setErrors:Z,setFieldError:ee,setFieldTouched:ie,setFieldValue:re,setStatus:se,setSubmitting:le,setTouched:X,setValues:$,setFormikState:ue,submitForm:ce},fe=w((function(){return h(j.values,de)})),ve=w((function(e){e&&e.preventDefault&&S(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&S(e.stopPropagation)&&e.stopPropagation(),Y()})),he=n.useCallback((function(e){return{value:A(j.values,e),error:A(j.errors,e),touched:!!A(j.touched,e),initialValue:A(E.current,e),initialTouched:!!A(F.current,e),initialError:A(g.current,e)}}),[j.errors,j.touched,j.values]),me=n.useCallback((function(e){return{setValue:function(r,t){return re(e,r,t)},setTouched:function(r,t){return ie(e,r,t)},setError:function(r){return ee(e,r)}}}),[re,ie,ee]),ye=n.useCallback((function(e){var r=T(e),t=r?e.name:e,n=A(j.values,t),i={name:t,value:n,onChange:ne,onBlur:oe};if(r){var a=e.type,o=e.value,u=e.as,s=e.multiple;"checkbox"===a?void 0===o?i.checked=!!n:(i.checked=!(!Array.isArray(n)||!~n.indexOf(o)),i.value=o):"radio"===a?(i.checked=n===o,i.value=o):"select"===u&&s&&(i.value=i.value||[],i.multiple=!0)}return i}),[oe,ne,j.values]),Ee=n.useMemo((function(){return!i(E.current,j.values)}),[E.current,j.values]),Se=n.useMemo((function(){return void 0!==p?Ee?j.errors&&0===Object.keys(j.errors).length:!1!==p&&S(p)?p(y):p:j.errors&&0===Object.keys(j.errors).length}),[p,Ee,j.errors,y]);return c({},j,{initialValues:E.current,initialErrors:g.current,initialTouched:F.current,initialStatus:I.current,handleBlur:oe,handleChange:ne,handleReset:ve,handleSubmit:pe,resetForm:Y,setErrors:Z,setFormikState:ue,setFieldTouched:ie,setFieldValue:re,setFieldError:ee,setStatus:se,setSubmitting:le,setTouched:X,setValues:$,submitForm:ce,validateForm:K,validateField:z,isValid:Se,dirty:Ee,unregisterField:Q,registerField:J,getFieldProps:ye,getFieldMeta:he,getFieldHelpers:me,validateOnBlur:u,validateOnChange:a,validateOnMount:l})}function P(e){var r=I(e),t=e.component,i=e.children,a=e.render;return n.useImperativeHandle(e.innerRef,(function(){return r})),n.createElement(h,{value:r},t?n.createElement(t,r):a?a(r):i?S(i)?i(r):F(i)?null:n.Children.only(i):null)}function x(e){var r={};if(e.inner){if(0===e.inner.length)return _(r,e.path,e.message);var t=e.inner,n=Array.isArray(t),i=0;for(t=n?t:t[Symbol.iterator]();;){var a;if(n){if(i>=t.length)break;a=t[i++]}else{if((i=t.next()).done)break;a=i.value}var o=a;A(r,o.path)||(r=_(r,o.path,o.message))}}return r}function U(e,r,t,n){void 0===t&&(t=!1);var i=V(e);return r[t?"validateSync":"validate"](i,{abortEarly:!1,context:n||i})}function V(e){var r=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=String(n);r[i]=!0===Array.isArray(e[i])?e[i].map((function(e){return!0===Array.isArray(e)||t(e)?V(e):""!==e?e:void 0})):t(e[i])?V(e[i]):""!==e[i]?e[i]:void 0}return r}function D(e,t,n){var i=e.slice();return t.forEach((function(t,a){if(void 0===i[a]){var o=!1!==n.clone&&n.isMergeableObject(t);i[a]=o?r(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?i[a]=r(e[a],t,n):-1===e.indexOf(t)&&i.push(t)})),i}var M="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n.useLayoutEffect:n.useEffect;function w(e){var r=n.useRef(e);return M((function(){r.current=e})),n.useCallback((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.current.apply(void 0,t)}),[])}var L=n.forwardRef((function(e,r){var t=e.action,i=d(e,["action"]),a=null!=t?t:"#",o=y();return n.createElement("form",c({onSubmit:o.handleSubmit,ref:r,onReset:o.handleReset,action:a},i))}));function j(e){var r=function(r){return n.createElement(m,null,(function(t){return t||a(!1),n.createElement(e,c({},r,{formik:t}))}))},t=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return r.WrappedComponent=e,r.displayName="FormikConnect("+t+")",s(r,e)}L.displayName="Form";var N=function(e,r,t){var n=H(e),i=n[r];return n.splice(r,1),n.splice(t,0,i),n},B=function(e,r,t){var n=H(e),i=n[r];return n[r]=n[t],n[t]=i,n},q=function(e,r,t){var n=H(e);return n.splice(r,0,t),n},G=function(e,r,t){var n=H(e);return n[r]=t,n},H=function(e){if(e){if(Array.isArray(e))return[].concat(e);var r=Object.keys(e).map((function(e){return parseInt(e)})).reduce((function(e,r){return r>e?r:e}),0);return Array.from(c({},e,{length:r+1}))}return[]},W=function(e,r){var t="function"==typeof e?e:r;return function(e){if(Array.isArray(e)||T(e)){var r=H(e);return t(r)}return e}},K=function(e){function r(r){var t;return(t=e.call(this,r)||this).updateArrayField=function(e,r,n){var i=t.props,a=i.name;(0,i.formik.setFormikState)((function(t){var i=W(n,e),o=W(r,e),u=_(t.values,a,e(A(t.values,a))),s=n?i(A(t.errors,a)):void 0,l=r?o(A(t.touched,a)):void 0;return E(s)&&(s=void 0),E(l)&&(l=void 0),c({},t,{values:u,errors:n?_(t.errors,a,s):t.errors,touched:r?_(t.touched,a,l):t.touched})}))},t.push=function(e){return t.updateArrayField((function(r){return[].concat(H(r),[l(e)])}),!1,!1)},t.handlePush=function(e){return function(){return t.push(e)}},t.swap=function(e,r){return t.updateArrayField((function(t){return B(t,e,r)}),!0,!0)},t.handleSwap=function(e,r){return function(){return t.swap(e,r)}},t.move=function(e,r){return t.updateArrayField((function(t){return N(t,e,r)}),!0,!0)},t.handleMove=function(e,r){return function(){return t.move(e,r)}},t.insert=function(e,r){return t.updateArrayField((function(t){return q(t,e,r)}),(function(r){return q(r,e,null)}),(function(r){return q(r,e,null)}))},t.handleInsert=function(e,r){return function(){return t.insert(e,r)}},t.replace=function(e,r){return t.updateArrayField((function(t){return G(t,e,r)}),!1,!1)},t.handleReplace=function(e,r){return function(){return t.replace(e,r)}},t.unshift=function(e){var r=-1;return t.updateArrayField((function(t){var n=t?[e].concat(t):[e];return r=n.length,n}),(function(e){return e?[null].concat(e):[null]}),(function(e){return e?[null].concat(e):[null]})),r},t.handleUnshift=function(e){return function(){return t.unshift(e)}},t.handleRemove=function(e){return function(){return t.remove(e)}},t.handlePop=function(){return function(){return t.pop()}},t.remove=t.remove.bind(f(t)),t.pop=t.pop.bind(f(t)),t}p(r,e);var t=r.prototype;return t.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!i(A(e.formik.values,e.name),A(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},t.remove=function(e){var r;return this.updateArrayField((function(t){var n=t?H(t):[];return r||(r=n[e]),S(n.splice)&&n.splice(e,1),S(n.every)&&n.every((function(e){return void 0===e}))?[]:n}),!0,!0),r},t.pop=function(){var e;return this.updateArrayField((function(r){var t=r.slice();return e||(e=t&&t.pop&&t.pop()),t}),!0,!0),e},t.render=function(){var e=this.props,r=e.component,t=e.render,i=e.children,a=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:a});return r?n.createElement(r,o):t?t(o):i?"function"==typeof i?i(o):F(i)?null:n.Children.only(i):null},r}(n.Component);K.defaultProps={validateOnChange:!0};var Y=j(K),z=j(function(e){function r(){return e.apply(this,arguments)||this}p(r,e);var t=r.prototype;return t.shouldComponentUpdate=function(e){return A(this.props.formik.errors,this.props.name)!==A(e.formik.errors,this.props.name)||A(this.props.formik.touched,this.props.name)!==A(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},t.render=function(){var e=this.props,r=e.component,t=e.formik,i=e.render,a=e.children,o=e.name,u=d(e,["component","formik","render","children","name"]),s=A(t.touched,o),l=A(t.errors,o);return s&&l?i?S(i)?i(l):null:a?S(a)?a(l):null:r?n.createElement(r,u,l):l:null},r}(n.Component)),J=j(function(e){function r(r){var t;t=e.call(this,r)||this;var n=r.render,i=r.children,o=r.component,u=r.as;return n&&a(!1),o&&n&&a(!1),u&&i&&S(i)&&a(!1),o&&i&&S(i)&&a(!1),n&&i&&!F(i)&&a(!1),t}p(r,e);var t=r.prototype;return t.shouldComponentUpdate=function(e){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):e.name!==this.props.name||A(e.formik.values,this.props.name)!==A(this.props.formik.values,this.props.name)||A(e.formik.errors,this.props.name)!==A(this.props.formik.errors,this.props.name)||A(e.formik.touched,this.props.name)!==A(this.props.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length||e.formik.isSubmitting!==this.props.formik.isSubmitting},t.componentDidMount=function(){this.props.formik.registerField(this.props.name,{validate:this.props.validate})},t.componentDidUpdate=function(e){this.props.name!==e.name&&(this.props.formik.unregisterField(e.name),this.props.formik.registerField(this.props.name,{validate:this.props.validate})),this.props.validate!==e.validate&&this.props.formik.registerField(this.props.name,{validate:this.props.validate})},t.componentWillUnmount=function(){this.props.formik.unregisterField(this.props.name)},t.render=function(){var e=this.props,r=e.name,t=e.render,i=e.as,a=e.children,o=e.component,u=e.formik,s=d(e,["validate","name","render","as","children","component","shouldUpdate","formik"]),l=d(u,["validate","validationSchema"]),p=u.getFieldProps(c({name:r},s)),f={field:p,meta:{value:A(u.values,r),error:A(u.errors,r),touched:!!A(u.touched,r),initialValue:A(u.initialValues,r),initialTouched:!!A(u.initialTouched,r),initialError:A(u.initialErrors,r)},form:l};if(t)return t(f);if(S(a))return a(f);if(o){if("string"==typeof o){var v=s.innerRef,h=d(s,["innerRef"]);return n.createElement(o,c({ref:v},p,h),a)}return n.createElement(o,c({field:p,form:u},s),a)}var m=i||"input";if("string"==typeof m){var y=s.innerRef,E=d(s,["innerRef"]);return n.createElement(m,c({ref:y},p,E),a)}return n.createElement(m,c({},p,s),a)},r}(n.Component));exports.ErrorMessage=z,exports.FastField=J,exports.Field=function(e){var r=e.validate,t=e.name,i=e.render,a=e.children,o=e.as,u=e.component,s=d(e,["validate","name","render","children","as","component"]),l=d(y(),["validate","validationSchema"]),p=l.registerField,f=l.unregisterField;n.useEffect((function(){return p(t,{validate:r}),function(){f(t)}}),[p,f,t,r]);var v=l.getFieldProps(c({name:t},s)),h=l.getFieldMeta(t),m={field:v,form:l};if(i)return i(c({},m,{meta:h}));if(S(a))return a(c({},m,{meta:h}));if(u){if("string"==typeof u){var E=s.innerRef,T=d(s,["innerRef"]);return n.createElement(u,c({ref:E},v,T),a)}return n.createElement(u,c({field:v,form:l},s),a)}var g=o||"input";if("string"==typeof g){var b=s.innerRef,F=d(s,["innerRef"]);return n.createElement(g,c({ref:b},v,F),a)}return n.createElement(g,c({},v,s),a)},exports.FieldArray=Y,exports.Form=L,exports.Formik=P,exports.FormikConsumer=m,exports.FormikContext=v,exports.FormikProvider=h,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(r){return e.body}},exports.getIn=A,exports.insert=q,exports.isEmptyArray=E,exports.isEmptyChildren=F,exports.isFunction=S,exports.isInputEvent=function(e){return e&&T(e)&&T(e.target)},exports.isInteger=g,exports.isNaN=function(e){return e!=e},exports.isObject=T,exports.isPromise=k,exports.isString=b,exports.move=N,exports.prepareDataForValidation=V,exports.replace=G,exports.setIn=_,exports.setNestedObjectValues=R,exports.swap=B,exports.useField=function(e){var r=y(),t=r.getFieldProps,i=r.getFieldMeta,o=r.getFieldHelpers,u=r.registerField,s=r.unregisterField,l=T(e)?e:{name:e},c=l.name,p=l.validate;n.useEffect((function(){return c&&u(c,{validate:p}),function(){c&&s(c)}}),[u,s,c,p]),c||a(!1);var d=n.useMemo((function(){return o(c)}),[o,c]);return[t(l),i(c),d]},exports.useFormik=I,exports.useFormikContext=y,exports.validateYupSchema=U,exports.withFormik=function(e){var r=e.mapPropsToValues,t=void 0===r?function(e){var r={};for(var t in e)e.hasOwnProperty(t)&&"function"!=typeof e[t]&&(r[t]=e[t]);return r}:r,i=d(e,["mapPropsToValues"]);return function(e){var r=e.displayName||e.name||e.constructor&&e.constructor.name||"Component",a=function(r){function a(){for(var t,a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];return(t=r.call.apply(r,[this].concat(o))||this).validate=function(e){return i.validate(e,t.props)},t.validationSchema=function(){return S(i.validationSchema)?i.validationSchema(t.props):i.validationSchema},t.handleSubmit=function(e,r){return i.handleSubmit(e,c({},r,{props:t.props}))},t.renderFormComponent=function(r){return n.createElement(e,c({},t.props,r))},t}return p(a,r),a.prototype.render=function(){var e=d(this.props,["children"]);return n.createElement(P,c({},e,i,{validate:i.validate&&this.validate,validationSchema:i.validationSchema&&this.validationSchema,initialValues:t(this.props),initialStatus:i.mapPropsToStatus&&i.mapPropsToStatus(this.props),initialErrors:i.mapPropsToErrors&&i.mapPropsToErrors(this.props),initialTouched:i.mapPropsToTouched&&i.mapPropsToTouched(this.props),onSubmit:this.handleSubmit,children:this.renderFormComponent}))},a}(n.Component);return a.displayName="WithFormik("+r+")",s(a,e)}},exports.yupToFormErrors=x;
//# sourceMappingURL=formik.cjs.production.min.js.map
import * as React from 'react';
import { FormikConfig, FormikErrors, FormikState, FormikTouched, FormikValues, FieldMetaProps, FieldHelperProps, FieldInputProps } from './types';
import { FieldConfig } from './Field';
import { FieldHelperProps, FieldInputProps, FieldMetaProps, FormikConfig, FormikErrors, FormikState, FormikTouched, FormikValues } from './types';
export declare function useFormik<Values extends FormikValues = FormikValues>({ validateOnChange, validateOnBlur, validateOnMount, isInitialValid, enableReinitialize, onSubmit, ...rest }: FormikConfig<Values>): {

@@ -9,3 +10,3 @@ initialValues: Values;

handleBlur: {
(e: React.FocusEvent<any>): void;
(e: React.FocusEvent<any, Element>): void;
<T = any>(fieldOrEvent: T): T extends string ? (e: any) => void : void;

@@ -18,13 +19,13 @@ };

handleReset: (e: any) => void;
handleSubmit: (e?: React.FormEvent<HTMLFormElement> | undefined) => void;
resetForm: (nextState?: Partial<FormikState<Values>> | undefined) => void;
handleSubmit: (e?: React.FormEvent<HTMLFormElement>) => void;
resetForm: (nextState?: Partial<FormikState<Values>>) => void;
setErrors: (errors: FormikErrors<Values>) => void;
setFormikState: (stateOrCb: FormikState<Values> | ((state: FormikState<Values>) => FormikState<Values>)) => void;
setFieldTouched: (field: string, touched?: boolean, shouldValidate?: boolean | undefined) => Promise<FormikErrors<Values>> | Promise<void>;
setFieldValue: (field: string, value: any, shouldValidate?: boolean | undefined) => Promise<FormikErrors<Values>> | Promise<void>;
setFieldTouched: (field: string, touched?: boolean, shouldValidate?: boolean) => Promise<FormikErrors<Values>> | Promise<void>;
setFieldValue: (field: string, value: any, shouldValidate?: boolean) => Promise<FormikErrors<Values>> | Promise<void>;
setFieldError: (field: string, value: string | undefined) => void;
setStatus: (status: any) => void;
setSubmitting: (isSubmitting: boolean) => void;
setTouched: (touched: FormikTouched<Values>, shouldValidate?: boolean | undefined) => Promise<FormikErrors<Values>> | Promise<void>;
setValues: (values: React.SetStateAction<Values>, shouldValidate?: boolean | undefined) => Promise<FormikErrors<Values>> | Promise<void>;
setTouched: (touched: FormikTouched<Values>, shouldValidate?: boolean) => Promise<FormikErrors<Values>> | Promise<void>;
setValues: (values: React.SetStateAction<Values>, shouldValidate?: boolean) => Promise<FormikErrors<Values>> | Promise<void>;
submitForm: () => Promise<any>;

@@ -37,3 +38,3 @@ validateForm: (values?: Values) => Promise<FormikErrors<Values>>;

registerField: (name: string, { validate }: any) => void;
getFieldProps: (nameOrOptions: any) => FieldInputProps<any>;
getFieldProps: (nameOrOptions: string | FieldConfig<any>) => FieldInputProps<any>;
getFieldMeta: (name: string) => FieldMetaProps<any>;

@@ -52,3 +53,3 @@ getFieldHelpers: (name: string) => FieldHelperProps<any>;

};
export declare function Formik<Values extends FormikValues = FormikValues, ExtraProps = {}>(props: FormikConfig<Values> & ExtraProps): JSX.Element;
export declare function Formik<Values extends FormikValues = FormikValues, ExtraProps = {}>(props: FormikConfig<Values> & ExtraProps): React.JSX.Element;
/**

@@ -55,0 +56,0 @@ * Transform Yup ValidationError to a more usable object

import * as React from 'react';
import { FieldConfig } from './Field';
/**

@@ -12,3 +13,3 @@ * Values of fields in the form

*/
export declare type FormikErrors<Values> = {
export type FormikErrors<Values> = {
[K in keyof Values]?: Values[K] extends any[] ? Values[K][number] extends object ? FormikErrors<Values[K][number]>[] | string | string[] : string | string[] : Values[K] extends object ? FormikErrors<Values[K]> : string;

@@ -19,3 +20,3 @@ };

*/
export declare type FormikTouched<Values> = {
export type FormikTouched<Values> = {
[K in keyof Values]?: Values[K] extends any[] ? Values[K][number] extends object ? FormikTouched<Values[K][number]>[] : boolean : Values[K] extends object ? FormikTouched<Values[K]> : boolean;

@@ -110,3 +111,3 @@ };

};
getFieldProps: <Value = any>(props: any) => FieldInputProps<Value>;
getFieldProps: <Value = any>(props: string | FieldConfig<Value>) => FieldInputProps<Value>;
getFieldMeta: <Value>(name: string) => FieldMetaProps<Value>;

@@ -137,3 +138,3 @@ getFieldHelpers: <Value = any>(name: string) => FieldHelperProps<Value>;

*/
component?: React.ComponentType<FormikProps<Values>> | React.ReactNode;
component?: React.ComponentType<FormikProps<Values>>;
/**

@@ -184,3 +185,3 @@ * Render prop (works like React router's <Route render={props =>} />)

*/
export declare type FormikProps<Values> = FormikSharedConfig & FormikState<Values> & FormikHelpers<Values> & FormikHandlers & FormikComputedProps<Values> & FormikRegistration & {
export type FormikProps<Values> = FormikSharedConfig & FormikState<Values> & FormikHelpers<Values> & FormikHandlers & FormikComputedProps<Values> & FormikRegistration & {
submitForm: () => Promise<any>;

@@ -198,3 +199,3 @@ };

*/
export declare type FormikContextType<Values> = FormikProps<Values> & Pick<FormikConfig<Values>, 'validate' | 'validationSchema'>;
export type FormikContextType<Values> = FormikProps<Values> & Pick<FormikConfig<Values>, 'validate' | 'validationSchema'>;
export interface SharedRenderProps<T> {

@@ -204,3 +205,3 @@ /**

*/
component?: string | React.ComponentType<T | void>;
component?: keyof JSX.IntrinsicElements | React.ComponentType<T | void>;
/**

@@ -215,3 +216,3 @@ * Render prop (works like React router's <Route render={props =>} />)

}
export declare type GenericFieldHTMLAttributes = JSX.IntrinsicElements['input'] | JSX.IntrinsicElements['select'] | JSX.IntrinsicElements['textarea'];
export type GenericFieldHTMLAttributes = JSX.IntrinsicElements['input'] | JSX.IntrinsicElements['select'] | JSX.IntrinsicElements['textarea'];
/** Field metadata */

@@ -256,2 +257,2 @@ export interface FieldMetaProps<Value> {

}
export declare type FieldValidator = (value: any) => string | void | Promise<string | void>;
export type FieldValidator = (value: any) => string | void | Promise<string | void>;

@@ -9,7 +9,7 @@ import * as React from 'react';

*/
export declare type InjectedFormikProps<Props, Values> = Props & FormikProps<Values>;
export type InjectedFormikProps<Props, Values> = Props & FormikProps<Values>;
/**
* Formik helpers + { props }
*/
export declare type FormikBag<P, V> = {
export type FormikBag<P, V> = {
props: P;

@@ -59,3 +59,3 @@ } & FormikHelpers<V>;

}
export declare type CompositeComponent<P> = React.ComponentClass<P> | React.StatelessComponent<P>;
export type CompositeComponent<P> = React.ComponentClass<P> | React.FunctionComponent<P>;
export interface ComponentDecorator<TOwnProps, TMergedProps> {

@@ -62,0 +62,0 @@ (component: CompositeComponent<TMergedProps>): React.ComponentType<TOwnProps>;

{
"name": "formik",
"description": "Build forms in React, without the tears",
"version": "2.4.1",
"version": "2.4.2",
"license": "Apache-2.0",

@@ -51,15 +51,15 @@ "author": "Jared Palmer <jared@palmer.net> (https://jaredpalmer.com)",

"tiny-warning": "^1.0.2",
"tslib": "^1.10.0"
"tslib": "^2.0.0"
},
"devDependencies": {
"@testing-library/react": "^11.1.0",
"@testing-library/react": "^14.0.0",
"@types/hoist-non-react-statics": "^3.3.1",
"@types/lodash": "^4.14.119",
"@types/react": "^16.9.55",
"@types/react-dom": "^16.9.9",
"@types/react": "^18.2.7",
"@types/react-dom": "^18.2.4",
"@types/warning": "^3.0.0",
"@types/yup": "^0.24.9",
"just-debounce-it": "^1.1.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tsdx": "^0.14.1",

@@ -66,0 +66,0 @@ "typescript": "^4.0.3",

Sorry, the diff of this file is too big to display

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 too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc