mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-02 14:12:19 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
9
web/node_modules/formik/dist/ErrorMessage.d.ts
generated
vendored
Normal file
9
web/node_modules/formik/dist/ErrorMessage.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
import * as React from 'react';
|
||||
export interface ErrorMessageProps {
|
||||
name: string;
|
||||
className?: string;
|
||||
component?: string | React.ComponentType;
|
||||
children?: (errorMessage: string) => React.ReactNode;
|
||||
render?: (errorMessage: string) => React.ReactNode;
|
||||
}
|
||||
export declare const ErrorMessage: React.ComponentType<ErrorMessageProps>;
|
14
web/node_modules/formik/dist/FastField.d.ts
generated
vendored
Normal file
14
web/node_modules/formik/dist/FastField.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
import * as React from 'react';
|
||||
import { FormikProps, GenericFieldHTMLAttributes, FieldMetaProps, FieldInputProps } from './types';
|
||||
import { FieldConfig } from './Field';
|
||||
export interface FastFieldProps<V = any> {
|
||||
field: FieldInputProps<V>;
|
||||
meta: FieldMetaProps<V>;
|
||||
form: FormikProps<V>;
|
||||
}
|
||||
export declare 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>;
|
47
web/node_modules/formik/dist/Field.d.ts
generated
vendored
Normal file
47
web/node_modules/formik/dist/Field.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
import * as React from 'react';
|
||||
import { FormikProps, GenericFieldHTMLAttributes, FieldMetaProps, FieldHelperProps, FieldInputProps, FieldValidator } from './types';
|
||||
export interface FieldProps<V = any, FormValues = any> {
|
||||
field: FieldInputProps<V>;
|
||||
form: FormikProps<FormValues>;
|
||||
meta: FieldMetaProps<V>;
|
||||
}
|
||||
export interface FieldConfig<V = any> {
|
||||
/**
|
||||
* Field component to render. Can either be a string like 'select' or a component.
|
||||
*/
|
||||
component?: string | React.ComponentType<FieldProps<V>> | React.ComponentType | React.ForwardRefExoticComponent<any>;
|
||||
/**
|
||||
* Component to render. Can either be a string e.g. 'select', 'input', or 'textarea', or a component.
|
||||
*/
|
||||
as?: React.ComponentType<FieldProps<V>['field']> | string | React.ComponentType | React.ForwardRefExoticComponent<any>;
|
||||
/**
|
||||
* Render prop (works like React router's <Route render={props =>} />)
|
||||
* @deprecated
|
||||
*/
|
||||
render?: (props: FieldProps<V>) => React.ReactNode;
|
||||
/**
|
||||
* Children render function <Field name>{props => ...}</Field>)
|
||||
*/
|
||||
children?: ((props: FieldProps<V>) => React.ReactNode) | React.ReactNode;
|
||||
/**
|
||||
* Validate a single field value independently
|
||||
*/
|
||||
validate?: FieldValidator;
|
||||
/**
|
||||
* Field name
|
||||
*/
|
||||
name: string;
|
||||
/** HTML input type */
|
||||
type?: string;
|
||||
/** Field value */
|
||||
value?: any;
|
||||
/** Inner ref */
|
||||
innerRef?: (instance: any) => void;
|
||||
}
|
||||
export declare type FieldAttributes<T> = GenericFieldHTMLAttributes & FieldConfig<T> & T & {
|
||||
name: string;
|
||||
};
|
||||
export declare 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;
|
54
web/node_modules/formik/dist/FieldArray.d.ts
generated
vendored
Normal file
54
web/node_modules/formik/dist/FieldArray.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
import * as React from 'react';
|
||||
import { SharedRenderProps, FormikProps } from './types';
|
||||
export declare type FieldArrayRenderProps = ArrayHelpers & {
|
||||
form: FormikProps<any>;
|
||||
name: string;
|
||||
};
|
||||
export declare type FieldArrayConfig = {
|
||||
/** Really the path to the array field to be updated */
|
||||
name: string;
|
||||
/** Should field array validate the form AFTER array updates/changes? */
|
||||
validateOnChange?: boolean;
|
||||
} & SharedRenderProps<FieldArrayRenderProps>;
|
||||
export interface ArrayHelpers {
|
||||
/** Imperatively add a value to the end of an array */
|
||||
push: (obj: any) => void;
|
||||
/** Curried fn to add a value to the end of an array */
|
||||
handlePush: (obj: any) => () => void;
|
||||
/** Imperatively swap two values in an array */
|
||||
swap: (indexA: number, indexB: number) => void;
|
||||
/** Curried fn to swap two values in an array */
|
||||
handleSwap: (indexA: number, indexB: number) => () => void;
|
||||
/** Imperatively move an element in an array to another index */
|
||||
move: (from: number, to: number) => void;
|
||||
/** Imperatively move an element in an array to another index */
|
||||
handleMove: (from: number, to: number) => () => void;
|
||||
/** Imperatively insert an element at a given index into the array */
|
||||
insert: (index: number, value: any) => void;
|
||||
/** Curried fn to insert an element at a given index into the array */
|
||||
handleInsert: (index: number, value: any) => () => void;
|
||||
/** Imperatively replace a value at an index of an array */
|
||||
replace: (index: number, value: any) => void;
|
||||
/** Curried fn to replace an element at a given index into the array */
|
||||
handleReplace: (index: number, value: any) => () => void;
|
||||
/** Imperatively add an element to the beginning of an array and return its length */
|
||||
unshift: (value: any) => number;
|
||||
/** Curried fn to add an element to the beginning of an array */
|
||||
handleUnshift: (value: any) => () => void;
|
||||
/** Curried fn to remove an element at an index of an array */
|
||||
handleRemove: (index: number) => () => void;
|
||||
/** Curried fn to remove a value from the end of the array */
|
||||
handlePop: () => () => void;
|
||||
/** Imperatively remove and element at an index of an array */
|
||||
remove<T>(index: number): T | undefined;
|
||||
/** Imperatively remove and return value from the end of the array */
|
||||
pop<T>(): T | undefined;
|
||||
}
|
||||
/**
|
||||
* Some array helpers!
|
||||
*/
|
||||
export declare const move: (array: any[], from: number, to: number) => unknown[];
|
||||
export declare const swap: (arrayLike: ArrayLike<any>, indexA: number, indexB: number) => unknown[];
|
||||
export declare const insert: (arrayLike: ArrayLike<any>, index: number, value: any) => unknown[];
|
||||
export declare const replace: (arrayLike: ArrayLike<any>, index: number, value: any) => unknown[];
|
||||
export declare const FieldArray: React.ComponentType<FieldArrayConfig>;
|
3
web/node_modules/formik/dist/Form.d.ts
generated
vendored
Normal file
3
web/node_modules/formik/dist/Form.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
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>>;
|
61
web/node_modules/formik/dist/Formik.d.ts
generated
vendored
Normal file
61
web/node_modules/formik/dist/Formik.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,61 @@
|
|||
import * as React from 'react';
|
||||
import { FormikConfig, FormikErrors, FormikState, FormikTouched, FormikValues, FieldMetaProps, FieldHelperProps, FieldInputProps } from './types';
|
||||
export declare function useFormik<Values extends FormikValues = FormikValues>({ validateOnChange, validateOnBlur, validateOnMount, isInitialValid, enableReinitialize, onSubmit, ...rest }: FormikConfig<Values>): {
|
||||
initialValues: Values;
|
||||
initialErrors: FormikErrors<unknown>;
|
||||
initialTouched: FormikTouched<unknown>;
|
||||
initialStatus: any;
|
||||
handleBlur: {
|
||||
(e: React.FocusEvent<any>): void;
|
||||
<T = any>(fieldOrEvent: T): T extends string ? (e: any) => void : void;
|
||||
};
|
||||
handleChange: {
|
||||
(e: React.ChangeEvent<any>): void;
|
||||
<T_1 = string | React.ChangeEvent<any>>(field: T_1): T_1 extends React.ChangeEvent<any> ? void : (e: string | React.ChangeEvent<any>) => void;
|
||||
};
|
||||
handleReset: (e: any) => void;
|
||||
handleSubmit: (e?: React.FormEvent<HTMLFormElement> | undefined) => void;
|
||||
resetForm: (nextState?: Partial<FormikState<Values>> | undefined) => 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>;
|
||||
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>;
|
||||
submitForm: () => Promise<any>;
|
||||
validateForm: (values?: Values) => Promise<FormikErrors<Values>>;
|
||||
validateField: (name: string) => Promise<void> | Promise<string | undefined>;
|
||||
isValid: boolean;
|
||||
dirty: boolean;
|
||||
unregisterField: (name: string) => void;
|
||||
registerField: (name: string, { validate }: any) => void;
|
||||
getFieldProps: (nameOrOptions: any) => FieldInputProps<any>;
|
||||
getFieldMeta: (name: string) => FieldMetaProps<any>;
|
||||
getFieldHelpers: (name: string) => FieldHelperProps<any>;
|
||||
validateOnBlur: boolean;
|
||||
validateOnChange: boolean;
|
||||
validateOnMount: boolean;
|
||||
values: Values;
|
||||
errors: FormikErrors<Values>;
|
||||
touched: FormikTouched<Values>;
|
||||
isSubmitting: boolean;
|
||||
isValidating: boolean;
|
||||
status?: any;
|
||||
submitCount: number;
|
||||
};
|
||||
export declare function Formik<Values extends FormikValues = FormikValues, ExtraProps = {}>(props: FormikConfig<Values> & ExtraProps): JSX.Element;
|
||||
/**
|
||||
* Transform Yup ValidationError to a more usable object
|
||||
*/
|
||||
export declare function yupToFormErrors<Values>(yupError: any): FormikErrors<Values>;
|
||||
/**
|
||||
* Validate a yup schema.
|
||||
*/
|
||||
export declare function validateYupSchema<T extends FormikValues>(values: T, schema: any, sync?: boolean, context?: any): Promise<Partial<T>>;
|
||||
/**
|
||||
* Recursively prepare values.
|
||||
*/
|
||||
export declare function prepareDataForValidation<T extends FormikValues>(values: T): FormikValues;
|
6
web/node_modules/formik/dist/FormikContext.d.ts
generated
vendored
Normal file
6
web/node_modules/formik/dist/FormikContext.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
import * as React from 'react';
|
||||
import { FormikContextType } from './types';
|
||||
export declare const FormikContext: React.Context<FormikContextType<any>>;
|
||||
export declare const FormikProvider: React.Provider<FormikContextType<any>>;
|
||||
export declare const FormikConsumer: React.Consumer<FormikContextType<any>>;
|
||||
export declare function useFormikContext<Values>(): FormikContextType<Values>;
|
9
web/node_modules/formik/dist/connect.d.ts
generated
vendored
Normal file
9
web/node_modules/formik/dist/connect.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
import * as React from 'react';
|
||||
import { FormikContextType } from './types';
|
||||
/**
|
||||
* Connect any component to Formik context, and inject as a prop called `formik`;
|
||||
* @param Comp React Component
|
||||
*/
|
||||
export declare function connect<OuterProps, Values = {}>(Comp: React.ComponentType<OuterProps & {
|
||||
formik: FormikContextType<Values>;
|
||||
}>): React.ComponentType<OuterProps>;
|
2022
web/node_modules/formik/dist/formik.cjs.development.js
generated
vendored
Normal file
2022
web/node_modules/formik/dist/formik.cjs.development.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
web/node_modules/formik/dist/formik.cjs.development.js.map
generated
vendored
Normal file
1
web/node_modules/formik/dist/formik.cjs.development.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
web/node_modules/formik/dist/formik.cjs.production.min.js
generated
vendored
Normal file
2
web/node_modules/formik/dist/formik.cjs.production.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
web/node_modules/formik/dist/formik.cjs.production.min.js.map
generated
vendored
Normal file
1
web/node_modules/formik/dist/formik.cjs.production.min.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1983
web/node_modules/formik/dist/formik.esm.js
generated
vendored
Normal file
1983
web/node_modules/formik/dist/formik.esm.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
web/node_modules/formik/dist/formik.esm.js.map
generated
vendored
Normal file
1
web/node_modules/formik/dist/formik.esm.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
11
web/node_modules/formik/dist/index.d.ts
generated
vendored
Normal file
11
web/node_modules/formik/dist/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
export * from './Formik';
|
||||
export * from './Field';
|
||||
export * from './Form';
|
||||
export * from './withFormik';
|
||||
export * from './FieldArray';
|
||||
export * from './utils';
|
||||
export * from './types';
|
||||
export * from './connect';
|
||||
export * from './ErrorMessage';
|
||||
export * from './FormikContext';
|
||||
export * from './FastField';
|
8
web/node_modules/formik/dist/index.js
generated
vendored
Normal file
8
web/node_modules/formik/dist/index.js
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
'use strict'
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./formik.cjs.production.min.js')
|
||||
} else {
|
||||
module.exports = require('./formik.cjs.development.js')
|
||||
}
|
248
web/node_modules/formik/dist/types.d.ts
generated
vendored
Normal file
248
web/node_modules/formik/dist/types.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,248 @@
|
|||
import * as React from 'react';
|
||||
/**
|
||||
* Values of fields in the form
|
||||
*/
|
||||
export interface FormikValues {
|
||||
[field: string]: any;
|
||||
}
|
||||
/**
|
||||
* An object containing error messages whose keys correspond to FormikValues.
|
||||
* Should always be an object of strings, but any is allowed to support i18n libraries.
|
||||
*/
|
||||
export declare 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;
|
||||
};
|
||||
/**
|
||||
* An object containing touched state of the form whose keys correspond to FormikValues.
|
||||
*/
|
||||
export declare 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;
|
||||
};
|
||||
/**
|
||||
* Formik state tree
|
||||
*/
|
||||
export interface FormikState<Values> {
|
||||
/** Form values */
|
||||
values: Values;
|
||||
/** map of field names to specific error for that field */
|
||||
errors: FormikErrors<Values>;
|
||||
/** map of field names to whether the field has been touched */
|
||||
touched: FormikTouched<Values>;
|
||||
/** whether the form is currently submitting */
|
||||
isSubmitting: boolean;
|
||||
/** whether the form is currently validating (prior to submission) */
|
||||
isValidating: boolean;
|
||||
/** Top level status state, in case you need it */
|
||||
status?: any;
|
||||
/** Number of times user tried to submit the form */
|
||||
submitCount: number;
|
||||
}
|
||||
/**
|
||||
* Formik computed properties. These are read-only.
|
||||
*/
|
||||
export interface FormikComputedProps<Values> {
|
||||
/** True if any input has been touched. False otherwise. */
|
||||
readonly dirty: boolean;
|
||||
/** True if state.errors is empty */
|
||||
readonly isValid: boolean;
|
||||
/** The initial values of the form */
|
||||
readonly initialValues: Values;
|
||||
/** The initial errors of the form */
|
||||
readonly initialErrors: FormikErrors<Values>;
|
||||
/** The initial visited fields of the form */
|
||||
readonly initialTouched: FormikTouched<Values>;
|
||||
/** The initial status of the form */
|
||||
readonly initialStatus?: any;
|
||||
}
|
||||
/**
|
||||
* Formik state helpers
|
||||
*/
|
||||
export interface FormikHelpers<Values> {
|
||||
/** Manually set top level status. */
|
||||
setStatus: (status?: any) => void;
|
||||
/** Manually set errors object */
|
||||
setErrors: (errors: FormikErrors<Values>) => void;
|
||||
/** Manually set isSubmitting */
|
||||
setSubmitting: (isSubmitting: boolean) => void;
|
||||
/** Manually set touched object */
|
||||
setTouched: (touched: FormikTouched<Values>, shouldValidate?: boolean) => void;
|
||||
/** Manually set values object */
|
||||
setValues: (values: React.SetStateAction<Values>, shouldValidate?: boolean) => void;
|
||||
/** Set value of form field directly */
|
||||
setFieldValue: (field: string, value: any, shouldValidate?: boolean) => void;
|
||||
/** Set error message of a form field directly */
|
||||
setFieldError: (field: string, message: string | undefined) => void;
|
||||
/** Set whether field has been touched directly */
|
||||
setFieldTouched: (field: string, isTouched?: boolean, shouldValidate?: boolean) => void;
|
||||
/** Validate form values */
|
||||
validateForm: (values?: any) => Promise<FormikErrors<Values>>;
|
||||
/** Validate field value */
|
||||
validateField: (field: string) => void;
|
||||
/** Reset form */
|
||||
resetForm: (nextState?: Partial<FormikState<Values>>) => void;
|
||||
/** Submit the form imperatively */
|
||||
submitForm: () => Promise<void>;
|
||||
/** Set Formik state, careful! */
|
||||
setFormikState: (f: FormikState<Values> | ((prevState: FormikState<Values>) => FormikState<Values>), cb?: () => void) => void;
|
||||
}
|
||||
/**
|
||||
* Formik form event handlers
|
||||
*/
|
||||
export interface FormikHandlers {
|
||||
/** Form submit handler */
|
||||
handleSubmit: (e?: React.FormEvent<HTMLFormElement>) => void;
|
||||
/** Reset form event handler */
|
||||
handleReset: (e?: React.SyntheticEvent<any>) => void;
|
||||
handleBlur: {
|
||||
/** Classic React blur handler, keyed by input name */
|
||||
(e: React.FocusEvent<any>): void;
|
||||
/** Preact-like linkState. Will return a handleBlur function. */
|
||||
<T = string | any>(fieldOrEvent: T): T extends string ? (e: any) => void : void;
|
||||
};
|
||||
handleChange: {
|
||||
/** Classic React change handler, keyed by input name */
|
||||
(e: React.ChangeEvent<any>): void;
|
||||
/** Preact-like linkState. Will return a handleChange function. */
|
||||
<T = string | React.ChangeEvent<any>>(field: T): T extends React.ChangeEvent<any> ? void : (e: string | React.ChangeEvent<any>) => void;
|
||||
};
|
||||
getFieldProps: <Value = any>(props: any) => FieldInputProps<Value>;
|
||||
getFieldMeta: <Value>(name: string) => FieldMetaProps<Value>;
|
||||
getFieldHelpers: <Value = any>(name: string) => FieldHelperProps<Value>;
|
||||
}
|
||||
/**
|
||||
* Base formik configuration/props shared between the HoC and Component.
|
||||
*/
|
||||
export interface FormikSharedConfig<Props = {}> {
|
||||
/** Tells Formik to validate the form on each input's onChange event */
|
||||
validateOnChange?: boolean;
|
||||
/** Tells Formik to validate the form on each input's onBlur event */
|
||||
validateOnBlur?: boolean;
|
||||
/** Tells Formik to validate upon mount */
|
||||
validateOnMount?: boolean;
|
||||
/** Tell Formik if initial form values are valid or not on first render */
|
||||
isInitialValid?: boolean | ((props: Props) => boolean);
|
||||
/** Should Formik reset the form when new initialValues change */
|
||||
enableReinitialize?: boolean;
|
||||
}
|
||||
/**
|
||||
* <Formik /> props
|
||||
*/
|
||||
export interface FormikConfig<Values> extends FormikSharedConfig {
|
||||
/**
|
||||
* Form component to render
|
||||
*/
|
||||
component?: React.ComponentType<FormikProps<Values>> | React.ReactNode;
|
||||
/**
|
||||
* Render prop (works like React router's <Route render={props =>} />)
|
||||
* @deprecated
|
||||
*/
|
||||
render?: (props: FormikProps<Values>) => React.ReactNode;
|
||||
/**
|
||||
* React children or child render callback
|
||||
*/
|
||||
children?: ((props: FormikProps<Values>) => React.ReactNode) | React.ReactNode;
|
||||
/**
|
||||
* Initial values of the form
|
||||
*/
|
||||
initialValues: Values;
|
||||
/**
|
||||
* Initial status
|
||||
*/
|
||||
initialStatus?: any;
|
||||
/** Initial object map of field names to specific error for that field */
|
||||
initialErrors?: FormikErrors<Values>;
|
||||
/** Initial object map of field names to whether the field has been touched */
|
||||
initialTouched?: FormikTouched<Values>;
|
||||
/**
|
||||
* Reset handler
|
||||
*/
|
||||
onReset?: (values: Values, formikHelpers: FormikHelpers<Values>) => void;
|
||||
/**
|
||||
* Submission handler
|
||||
*/
|
||||
onSubmit: (values: Values, formikHelpers: FormikHelpers<Values>) => void | Promise<any>;
|
||||
/**
|
||||
* A Yup Schema or a function that returns a Yup schema
|
||||
*/
|
||||
validationSchema?: any | (() => any);
|
||||
/**
|
||||
* Validation function. Must return an error object or promise that
|
||||
* throws an error object where that object keys map to corresponding value.
|
||||
*/
|
||||
validate?: (values: Values) => void | object | Promise<FormikErrors<Values>>;
|
||||
/** Inner ref */
|
||||
innerRef?: React.Ref<FormikProps<Values>>;
|
||||
}
|
||||
/**
|
||||
* State, handlers, and helpers made available to form component or render prop
|
||||
* of <Formik/>.
|
||||
*/
|
||||
export declare type FormikProps<Values> = FormikSharedConfig & FormikState<Values> & FormikHelpers<Values> & FormikHandlers & FormikComputedProps<Values> & FormikRegistration & {
|
||||
submitForm: () => Promise<any>;
|
||||
};
|
||||
/** Internal Formik registration methods that get passed down as props */
|
||||
export interface FormikRegistration {
|
||||
registerField: (name: string, fns: {
|
||||
validate?: FieldValidator;
|
||||
}) => void;
|
||||
unregisterField: (name: string) => void;
|
||||
}
|
||||
/**
|
||||
* State, handlers, and helpers made available to Formik's primitive components through context.
|
||||
*/
|
||||
export declare type FormikContextType<Values> = FormikProps<Values> & Pick<FormikConfig<Values>, 'validate' | 'validationSchema'>;
|
||||
export interface SharedRenderProps<T> {
|
||||
/**
|
||||
* Field component to render. Can either be a string like 'select' or a component.
|
||||
*/
|
||||
component?: string | React.ComponentType<T | void>;
|
||||
/**
|
||||
* Render prop (works like React router's <Route render={props =>} />)
|
||||
*/
|
||||
render?: (props: T) => React.ReactNode;
|
||||
/**
|
||||
* Children render function <Field name>{props => ...}</Field>)
|
||||
*/
|
||||
children?: (props: T) => React.ReactNode;
|
||||
}
|
||||
export declare type GenericFieldHTMLAttributes = JSX.IntrinsicElements['input'] | JSX.IntrinsicElements['select'] | JSX.IntrinsicElements['textarea'];
|
||||
/** Field metadata */
|
||||
export interface FieldMetaProps<Value> {
|
||||
/** Value of the field */
|
||||
value: Value;
|
||||
/** Error message of the field */
|
||||
error?: string;
|
||||
/** Has the field been visited? */
|
||||
touched: boolean;
|
||||
/** Initial value of the field */
|
||||
initialValue?: Value;
|
||||
/** Initial touched state of the field */
|
||||
initialTouched: boolean;
|
||||
/** Initial error message of the field */
|
||||
initialError?: string;
|
||||
}
|
||||
/** Imperative handles to change a field's value, error and touched */
|
||||
export interface FieldHelperProps<Value> {
|
||||
/** Set the field's value */
|
||||
setValue: (value: Value, shouldValidate?: boolean) => void;
|
||||
/** Set the field's touched value */
|
||||
setTouched: (value: boolean, shouldValidate?: boolean) => void;
|
||||
/** Set the field's error value */
|
||||
setError: (value: string | undefined) => void;
|
||||
}
|
||||
/** Field input value, name, and event handlers */
|
||||
export interface FieldInputProps<Value> {
|
||||
/** Value of the field */
|
||||
value: Value;
|
||||
/** Name of the field */
|
||||
name: string;
|
||||
/** Multiple select? */
|
||||
multiple?: boolean;
|
||||
/** Is the field checked? */
|
||||
checked?: boolean;
|
||||
/** Change event handler */
|
||||
onChange: FormikHandlers['handleChange'];
|
||||
/** Blur event handler */
|
||||
onBlur: FormikHandlers['handleBlur'];
|
||||
}
|
||||
export declare type FieldValidator = (value: any) => string | void | Promise<string | void>;
|
68
web/node_modules/formik/dist/utils.d.ts
generated
vendored
Normal file
68
web/node_modules/formik/dist/utils.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,68 @@
|
|||
import * as React from 'react';
|
||||
/** @private is the value an empty array? */
|
||||
export declare const isEmptyArray: (value?: any) => boolean;
|
||||
/** @private is the given object a Function? */
|
||||
export declare const isFunction: (obj: any) => obj is Function;
|
||||
/** @private is the given object an Object? */
|
||||
export declare const isObject: (obj: any) => obj is Object;
|
||||
/** @private is the given object an integer? */
|
||||
export declare const isInteger: (obj: any) => boolean;
|
||||
/** @private is the given object a string? */
|
||||
export declare const isString: (obj: any) => obj is string;
|
||||
/** @private is the given object a NaN? */
|
||||
export declare const isNaN: (obj: any) => boolean;
|
||||
/** @private Does a React component have exactly 0 children? */
|
||||
export declare const isEmptyChildren: (children: any) => boolean;
|
||||
/** @private is the given object/value a promise? */
|
||||
export declare const isPromise: (value: any) => value is PromiseLike<any>;
|
||||
/** @private is the given object/value a type of synthetic event? */
|
||||
export declare const isInputEvent: (value: any) => value is React.SyntheticEvent<any, Event>;
|
||||
/**
|
||||
* Same as document.activeElement but wraps in a try-catch block. In IE it is
|
||||
* not safe to call document.activeElement if there is nothing focused.
|
||||
*
|
||||
* The activeElement will be null only if the document or document body is not
|
||||
* yet defined.
|
||||
*
|
||||
* @param {?Document} doc Defaults to current document.
|
||||
* @return {Element | null}
|
||||
* @see https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/dom/getActiveElement.js
|
||||
*/
|
||||
export declare function getActiveElement(doc?: Document): Element | null;
|
||||
/**
|
||||
* Deeply get a value from an object via its path.
|
||||
*/
|
||||
export declare function getIn(obj: any, key: string | string[], def?: any, p?: number): any;
|
||||
/**
|
||||
* Deeply set a value from in object via it's path. If the value at `path`
|
||||
* has changed, return a shallow copy of obj with `value` set at `path`.
|
||||
* If `value` has not changed, return the original `obj`.
|
||||
*
|
||||
* Existing objects / arrays along `path` are also shallow copied. Sibling
|
||||
* objects along path retain the same internal js reference. Since new
|
||||
* objects / arrays are only created along `path`, we can test if anything
|
||||
* changed in a nested structure by comparing the object's reference in
|
||||
* the old and new object, similar to how russian doll cache invalidation
|
||||
* works.
|
||||
*
|
||||
* In earlier versions of this function, which used cloneDeep, there were
|
||||
* issues whereby settings a nested value would mutate the parent
|
||||
* instead of creating a new object. `clone` avoids that bug making a
|
||||
* shallow copy of the objects along the update path
|
||||
* so no object is mutated in place.
|
||||
*
|
||||
* Before changing this function, please read through the following
|
||||
* discussions.
|
||||
*
|
||||
* @see https://github.com/developit/linkstate
|
||||
* @see https://github.com/jaredpalmer/formik/pull/123
|
||||
*/
|
||||
export declare function setIn(obj: any, path: string, value: any): any;
|
||||
/**
|
||||
* Recursively a set the same value for all keys and arrays nested object, cloning
|
||||
* @param object
|
||||
* @param value
|
||||
* @param visited
|
||||
* @param response
|
||||
*/
|
||||
export declare function setNestedObjectValues<T>(object: any, value: any, visited?: any, response?: any): T;
|
68
web/node_modules/formik/dist/withFormik.d.ts
generated
vendored
Normal file
68
web/node_modules/formik/dist/withFormik.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,68 @@
|
|||
import * as React from 'react';
|
||||
import { FormikHelpers, FormikProps, FormikSharedConfig, FormikValues, FormikTouched, FormikErrors } from './types';
|
||||
/**
|
||||
* State, handlers, and helpers injected as props into the wrapped form component.
|
||||
* Used with withFormik()
|
||||
*
|
||||
* @deprecated Use `OuterProps & FormikProps<Values>` instead.
|
||||
*/
|
||||
export declare type InjectedFormikProps<Props, Values> = Props & FormikProps<Values>;
|
||||
/**
|
||||
* Formik helpers + { props }
|
||||
*/
|
||||
export declare type FormikBag<P, V> = {
|
||||
props: P;
|
||||
} & FormikHelpers<V>;
|
||||
/**
|
||||
* withFormik() configuration options. Backwards compatible.
|
||||
*/
|
||||
export interface WithFormikConfig<Props, Values extends FormikValues = FormikValues, DeprecatedPayload = Values> extends FormikSharedConfig<Props> {
|
||||
/**
|
||||
* Set the display name of the component. Useful for React DevTools.
|
||||
*/
|
||||
displayName?: string;
|
||||
/**
|
||||
* Submission handler
|
||||
*/
|
||||
handleSubmit: (values: Values, formikBag: FormikBag<Props, Values>) => void;
|
||||
/**
|
||||
* Map props to the form values
|
||||
*/
|
||||
mapPropsToValues?: (props: Props) => Values;
|
||||
/**
|
||||
* Map props to the form status
|
||||
*/
|
||||
mapPropsToStatus?: (props: Props) => any;
|
||||
/**
|
||||
* Map props to the form touched state
|
||||
*/
|
||||
mapPropsToTouched?: (props: Props) => FormikTouched<Values>;
|
||||
/**
|
||||
* Map props to the form errors state
|
||||
*/
|
||||
mapPropsToErrors?: (props: Props) => FormikErrors<Values>;
|
||||
/**
|
||||
* @deprecated in 0.9.0 (but needed to break TS types)
|
||||
*/
|
||||
mapValuesToPayload?: (values: Values) => DeprecatedPayload;
|
||||
/**
|
||||
* A Yup Schema or a function that returns a Yup schema
|
||||
*/
|
||||
validationSchema?: any | ((props: Props) => any);
|
||||
/**
|
||||
* Validation function. Must return an error object or promise that
|
||||
* throws an error object where that object keys map to corresponding value.
|
||||
*/
|
||||
validate?: (values: Values, props: Props) => void | object | Promise<any>;
|
||||
}
|
||||
export declare type CompositeComponent<P> = React.ComponentClass<P> | React.StatelessComponent<P>;
|
||||
export interface ComponentDecorator<TOwnProps, TMergedProps> {
|
||||
(component: CompositeComponent<TMergedProps>): React.ComponentType<TOwnProps>;
|
||||
}
|
||||
export interface InferableComponentDecorator<TOwnProps> {
|
||||
<T extends CompositeComponent<TOwnProps>>(component: T): T;
|
||||
}
|
||||
/**
|
||||
* A public higher-order component to access the imperative API
|
||||
*/
|
||||
export declare function withFormik<OuterProps extends object, Values extends FormikValues, Payload = Values>({ mapPropsToValues, ...config }: WithFormikConfig<OuterProps, Values, Payload>): ComponentDecorator<OuterProps, OuterProps & FormikProps<Values>>;
|
Loading…
Add table
Add a link
Reference in a new issue