diff --git a/dist/Formsy.d.ts b/dist/Formsy.d.ts index 1f6251be..f7ce2610 100644 --- a/dist/Formsy.d.ts +++ b/dist/Formsy.d.ts @@ -3,7 +3,7 @@ import React from 'react'; import { FormsyContextInterface, IModel, InputComponent, IResetModel, IUpdateInputsWithError, IUpdateInputsWithValue, ValidationError } from './interfaces'; import { PassDownProps } from './withFormsy'; declare type FormHTMLAttributesCleaned = Omit, 'onChange' | 'onSubmit'>; -declare type OnSubmitCallback = (model: IModel, resetModel: IResetModel, updateInputsWithError: IUpdateInputsWithError, event: React.SyntheticEvent>) => void; +declare type OnSubmitCallback = (model: IModel, resetModel: IResetModel, updateInputsWithError: IUpdateInputsWithError, event: React.SyntheticEvent) => void; declare type FormElementType = string | React.ComponentType<{ onReset?: (e: React.SyntheticEvent) => void; onSubmit?: (e: React.SyntheticEvent) => void; @@ -78,7 +78,7 @@ export declare class Formsy extends React.Component { attachToForm: (component: any) => void; detachFromForm: (component: InputComponent) => void; isChanged: () => boolean; - submit: (event?: React.SyntheticEvent) => void; + submit: (event?: React.SyntheticEvent) => void; updateInputsWithError: IUpdateInputsWithError; updateInputsWithValue: IUpdateInputsWithValue; validate: (component: InputComponent) => void; diff --git a/dist/formsy-react.cjs.development.js.map b/dist/formsy-react.cjs.development.js.map index f7c89395..20948b2b 100644 --- a/dist/formsy-react.cjs.development.js.map +++ b/dist/formsy-react.cjs.development.js.map @@ -1 +1 @@ -{"version":3,"file":"formsy-react.cjs.development.js","sources":["../src/utils.ts","../src/validationRules.ts","../src/FormsyContext.ts","../src/withFormsy.ts","../src/Formsy.ts"],"sourcesContent":["import { isPlainObject } from 'lodash';\n\nimport { ValidationError, Validations, Values } from './interfaces';\n\nexport function isArray(value: unknown): value is unknown[] {\n return Array.isArray(value);\n}\n\nexport function isObject(value: unknown): value is object {\n return isPlainObject(value);\n}\n\nexport function isTypeUndefined(value: unknown): value is undefined {\n return typeof value === 'undefined';\n}\n\nexport function isDate(value: unknown): value is Date {\n return value instanceof Date;\n}\n\nexport function isFunction(value: unknown): value is Function {\n return value !== null && typeof value === 'function';\n}\n\nexport function isString(value: unknown): value is string {\n return typeof value === 'string';\n}\n\nexport function isNumber(value: unknown): value is number {\n return typeof value === 'number';\n}\n\nexport function isRegex(value: unknown): value is RegExp {\n return value instanceof RegExp;\n}\n\nexport function isValueStringEmpty(value: string): boolean {\n return value === '';\n}\n\nexport function isValueNullOrUndefined(value: unknown): boolean {\n return value === null || value === undefined;\n}\n\nexport function isValueUndefined(value: unknown): boolean {\n return value === undefined;\n}\n\nexport function noop() {\n // do nothing.\n}\n\nexport function protectAgainstParamReassignment(value: unknown) {\n // Clone objects to avoid accidental param reassignment\n if (isObject(value)) return { ...value };\n if (isArray(value)) return [...value];\n return value;\n}\n\nexport function isSame(a: unknown, b: unknown) {\n if (typeof a !== typeof b) {\n return false;\n }\n\n if (isArray(a) && isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n\n return a.every((item, index) => isSame(item, b[index]));\n }\n\n if (isFunction(a) && isFunction(b)) {\n return a.toString() === b.toString();\n }\n\n if (isDate(a) && isDate(b)) {\n return a.toString() === b.toString();\n }\n\n if (isObject(a) && isObject(b)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n return Object.keys(a).every((key) => isSame(a[key], b[key]));\n }\n\n if (isRegex(a) && isRegex(b)) {\n return a.toString() === b.toString();\n }\n\n return a === b;\n}\n\ninterface RulesResult {\n errors: ValidationError[];\n failed: string[];\n success: string[];\n}\n\nexport function runRules(\n value: V,\n currentValues: Values,\n validations: Validations,\n validationRules: Validations,\n) {\n const results: RulesResult = {\n errors: [],\n failed: [],\n success: [],\n };\n\n Object.keys(validations).forEach((validationName) => {\n const validationsVal = validations[validationName];\n const validationRulesVal = validationRules[validationName];\n const addToResults = (validation) => {\n if (isString(validation)) {\n results.errors.push(validation);\n results.failed.push(validationName);\n } else if (!validation) {\n results.failed.push(validationName);\n } else {\n results.success.push(validationName);\n }\n };\n\n if (validationRulesVal && isFunction(validationsVal)) {\n throw new Error(`Formsy does not allow you to override default validations: ${validationName}`);\n }\n\n if (!validationRulesVal && !isFunction(validationsVal)) {\n throw new Error(`Formsy does not have the validation rule: ${validationName}`);\n }\n\n if (isFunction(validationsVal)) {\n return addToResults(validationsVal(currentValues, value));\n }\n\n return addToResults(validationRulesVal(currentValues, value, validationsVal));\n });\n\n return results;\n}\n\nexport function throttle(callback, interval) {\n let enableCall = true;\n\n return function (...args) {\n if (!enableCall) return;\n\n enableCall = false;\n callback.apply(this, args);\n setTimeout(() => (enableCall = true), interval);\n };\n}\n","import { ValidationFunction, Values } from './interfaces';\nimport {\n isNumber,\n isString,\n isTypeUndefined,\n isValueNullOrUndefined,\n isValueStringEmpty,\n isValueUndefined,\n} from './utils';\n\nexport function isExisty(value: V) {\n return !isValueNullOrUndefined(value);\n}\n\nexport function isEmpty(value: V) {\n if (isString(value)) {\n return isValueStringEmpty(value);\n }\n if (isTypeUndefined(value)) {\n return false;\n }\n return isValueUndefined(value);\n}\n\nexport function isDefaultRequiredValue(value: unknown) {\n return isString(value) ? isValueStringEmpty(value) : isValueNullOrUndefined(value);\n}\n\nexport function matchRegexp(_values: Values, value: V, regexp: RegExp) {\n return !isExisty(value) || isEmpty(value) || regexp.test(`${value}`);\n}\n\ninterface Validations {\n [key: string]: ValidationFunction;\n}\n\nconst REGEX_PATTERNS = {\n ALPHA: /^[A-Z]+$/i,\n ALPHANUMERIC: /^[0-9A-Z]+$/i,\n EMAIL:\n /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/i, // from http://emailregex.com/\n FLOAT: /^(?:[-+]?(?:\\d+))?(?:\\.\\d*)?(?:[eE][+-]?(?:\\d+))?$/,\n INT: /^(?:[-+]?(?:0|[1-9]\\d*))$/,\n NUMERIC: /^[-+]?(?:\\d*[.])?\\d+$/,\n SPECIAL_WORDS: /^[\\sA-ZÀ-ÖØ-öø-ÿ]+$/i,\n URL: /^(?:\\w+:)?\\/\\/([^\\s.]+\\.\\S{2}|localhost[:?\\d]*)\\S*$/i,\n WORDS: /^[A-Z\\s]+$/i,\n};\n\nconst validations: Validations = {\n equals: (_values, value: V, eql: V) => !isExisty(value) || isEmpty(value) || value === eql,\n equalsField: (values, value: V, field: string) => value === values[field],\n isAlpha: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.ALPHA),\n isAlphanumeric: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.ALPHANUMERIC),\n isDefaultRequiredValue: (_values, value: V) => isDefaultRequiredValue(value),\n isEmail: (values, value: string) => matchRegexp(values, value, REGEX_PATTERNS.EMAIL),\n isEmptyString: (_values, value: string) => isEmpty(value),\n isExisty: (_values, value: V) => isExisty(value),\n isFalse: (_values, value: boolean | string) => value === false,\n isFloat: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.FLOAT),\n isInt: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.INT),\n isLength: (_values, value: string, length: number) => !isExisty(value) || isEmpty(value) || value.length === length,\n isNumeric: (values, value: V) => isNumber(value) || matchRegexp(values, value, REGEX_PATTERNS.NUMERIC),\n isSpecialWords: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.SPECIAL_WORDS),\n isTrue: (_values, value: boolean | string) => value === true,\n isUndefined: (_values, value: V) => isValueUndefined(value),\n isUrl: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.URL),\n isWords: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.WORDS),\n matchRegexp,\n maxLength: (_values, value: string, length: number) => !isExisty(value) || value.length <= length,\n minLength: (_values, value: string, length: number) => !isExisty(value) || isEmpty(value) || value.length >= length,\n};\n\nexport const addValidationRule = (name: string, func: ValidationFunction) => {\n validations[name] = func;\n};\n\nexport default validations;\n","import React from 'react';\nimport { FormsyContextInterface } from './interfaces';\n\nconst noFormsyErrorMessage = 'Could not find Formsy Context Provider. Did you use withFormsy outside ?';\n\nconst throwNoFormsyProvider = () => {\n // istanbul ignore next\n throw new Error(noFormsyErrorMessage);\n};\n\nconst defaultValue = {\n attachToForm: throwNoFormsyProvider,\n detachFromForm: throwNoFormsyProvider,\n isFormDisabled: true,\n isValidValue: throwNoFormsyProvider,\n validate: throwNoFormsyProvider,\n runValidation: throwNoFormsyProvider,\n};\n\nexport default React.createContext(defaultValue);\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport FormsyContext from './FormsyContext';\nimport {\n ComponentWithStaticAttributes,\n FormsyContextInterface,\n RequiredValidation,\n ValidationError,\n Validations,\n WrappedComponentClass,\n} from './interfaces';\n\nimport * as utils from './utils';\nimport { isString } from './utils';\nimport { isDefaultRequiredValue } from './validationRules';\n\n/* eslint-disable react/default-props-match-prop-types */\n\nconst convertValidationsToObject = (validations: false | Validations): Validations => {\n if (isString(validations)) {\n return validations.split(/,(?![^{[]*[}\\]])/g).reduce((validationsAccumulator, validation) => {\n let args: string[] = validation.split(':');\n const validateMethod: string = args.shift();\n\n args = args.map((arg) => {\n try {\n return JSON.parse(arg);\n } catch (e) {\n return arg; // It is a string if it can not parse it\n }\n });\n\n if (args.length > 1) {\n throw new Error(\n 'Formsy does not support multiple args on string validations. Use object format of validations instead.',\n );\n }\n\n // Avoid parameter reassignment\n const validationsAccumulatorCopy: Validations = { ...validationsAccumulator };\n validationsAccumulatorCopy[validateMethod] = args.length ? args[0] : true;\n return validationsAccumulatorCopy;\n }, {});\n }\n\n return validations || {};\n};\n\nexport const propTypes = {\n innerRef: PropTypes.func,\n name: PropTypes.string.isRequired,\n required: PropTypes.oneOfType([PropTypes.bool, PropTypes.object, PropTypes.string]),\n validations: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n value: PropTypes.any, // eslint-disable-line react/forbid-prop-types\n};\n\nexport interface WrapperProps {\n innerRef?: (ref: React.Ref) => void;\n name: string;\n required?: RequiredValidation;\n validationError?: ValidationError;\n validationErrors?: { [key: string]: ValidationError };\n validations?: Validations;\n value?: V;\n}\n\nexport interface WrapperState {\n [key: string]: unknown;\n\n formSubmitted: boolean;\n isPristine: boolean;\n isRequired: boolean;\n isValid: boolean;\n pristineValue: V;\n validationError: ValidationError[];\n value: V;\n}\n\nexport interface InjectedProps {\n errorMessage: ValidationError;\n errorMessages: ValidationError[];\n hasValue: boolean;\n isFormDisabled: boolean;\n isFormSubmitted: boolean;\n isPristine: boolean;\n isRequired: boolean;\n isValid: boolean;\n isValidValue: (value: V) => boolean;\n ref?: React.Ref;\n resetValue: () => void;\n setValidations: (validations: Validations, required: RequiredValidation) => void;\n setValue: (value: V, validate?: boolean) => void;\n showError: boolean;\n showRequired: boolean;\n}\n\nexport interface WrapperInstanceMethods {\n getErrorMessage: () => null | ValidationError;\n getErrorMessages: () => ValidationError[];\n getValue: () => V;\n isFormDisabled: () => boolean;\n isFormSubmitted: () => boolean;\n isValid: () => boolean;\n isValidValue: (value: V) => boolean;\n setValue: (value: V, validate?: boolean) => void;\n}\n\nexport type PassDownProps = WrapperProps & InjectedProps;\n\nfunction getDisplayName(component: WrappedComponentClass) {\n return component.displayName || component.name || (utils.isString(component) ? component : 'Component');\n}\n\nexport default function withFormsy(\n WrappedComponent: React.ComponentType>,\n): React.ComponentType, keyof InjectedProps>> {\n class WithFormsyWrapper\n extends React.Component & FormsyContextInterface, WrapperState>\n implements WrapperInstanceMethods\n {\n public validations?: Validations;\n\n public requiredValidations?: Validations;\n\n public static displayName = `Formsy(${getDisplayName(WrappedComponent)})`;\n\n public static propTypes: any = propTypes;\n\n public static defaultProps: any = {\n innerRef: null,\n required: false,\n validationError: '',\n validationErrors: {},\n validations: null,\n value: (WrappedComponent as ComponentWithStaticAttributes).defaultValue,\n };\n\n public constructor(props) {\n super(props);\n const { runValidation, validations, required, value } = props;\n\n this.state = { value } as any;\n\n this.setValidations(validations, required);\n\n this.state = {\n formSubmitted: false,\n isPristine: true,\n pristineValue: props.value,\n value: props.value,\n ...runValidation(this, props.value),\n };\n }\n\n public componentDidMount() {\n const { name, attachToForm } = this.props;\n\n if (!name) {\n throw new Error('Form Input requires a name property when used');\n }\n\n attachToForm(this);\n }\n\n public shouldComponentUpdate(nextProps, nextState) {\n const { props, state } = this;\n const isChanged = (a: object, b: object): boolean => Object.keys(a).some((k) => a[k] !== b[k]);\n const isPropsChanged = isChanged(props, nextProps);\n const isStateChanged = isChanged(state, nextState);\n\n return isPropsChanged || isStateChanged;\n }\n\n public componentDidUpdate(prevProps) {\n const { value, validations, required, validate } = this.props;\n\n // If the value passed has changed, set it. If value is not passed it will\n // internally update, and this will never run\n if (!utils.isSame(value, prevProps.value)) {\n this.setValue(value);\n }\n\n // If validations or required is changed, run a new validation\n if (!utils.isSame(validations, prevProps.validations) || !utils.isSame(required, prevProps.required)) {\n this.setValidations(validations, required);\n validate(this);\n }\n }\n\n // Detach it when component unmounts\n public componentWillUnmount() {\n const { detachFromForm } = this.props;\n detachFromForm(this);\n }\n\n public getErrorMessage = (): ValidationError | null => {\n const messages = this.getErrorMessages();\n return messages.length ? messages[0] : null;\n };\n\n public getErrorMessages = (): ValidationError[] => {\n const { validationError } = this.state;\n\n if (!this.isValid() || this.showRequired()) {\n return validationError || [];\n }\n return [];\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public getValue = (): V => this.state.value;\n\n public setValidations = (validations: Validations, required: RequiredValidation): void => {\n // Add validations to the store itself as the props object can not be modified\n this.validations = convertValidationsToObject(validations) || {};\n this.requiredValidations =\n required === true ? { isDefaultRequiredValue: required } : convertValidationsToObject(required);\n };\n\n // By default, we validate after the value has been set.\n // A user can override this and pass a second parameter of `false` to skip validation.\n public setValue = (value: V, validate = true): void => {\n const { validate: validateForm } = this.props;\n\n if (!validate) {\n this.setState({ value });\n } else {\n this.setState(\n {\n value,\n isPristine: false,\n },\n () => {\n validateForm(this);\n },\n );\n }\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public hasValue = () => {\n const { value } = this.state;\n return isDefaultRequiredValue(value);\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormDisabled = (): boolean => this.props.isFormDisabled;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormSubmitted = (): boolean => this.state.formSubmitted;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isPristine = (): boolean => this.state.isPristine;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isRequired = (): boolean => !!this.props.required;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isValid = (): boolean => this.state.isValid;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isValidValue = (value: V) => this.props.isValidValue(this, value);\n\n public resetValue = () => {\n const { pristineValue } = this.state;\n const { validate } = this.props;\n\n this.setState(\n {\n value: pristineValue,\n isPristine: true,\n },\n () => {\n validate(this);\n },\n );\n };\n\n public showError = (): boolean => !this.showRequired() && !this.isValid();\n\n // eslint-disable-next-line react/destructuring-assignment\n public showRequired = (): boolean => this.state.isRequired;\n\n public render() {\n const { innerRef } = this.props;\n const propsForElement: T & PassDownProps = {\n ...this.props,\n errorMessage: this.getErrorMessage(),\n errorMessages: this.getErrorMessages(),\n hasValue: this.hasValue(),\n isFormDisabled: this.isFormDisabled(),\n isFormSubmitted: this.isFormSubmitted(),\n isPristine: this.isPristine(),\n isRequired: this.isRequired(),\n isValid: this.isValid(),\n isValidValue: this.isValidValue,\n resetValue: this.resetValue,\n setValidations: this.setValidations,\n setValue: this.setValue,\n showError: this.showError(),\n showRequired: this.showRequired(),\n value: this.getValue(),\n };\n\n if (innerRef) {\n propsForElement.ref = innerRef;\n }\n\n return React.createElement(WrappedComponent, propsForElement);\n }\n }\n\n // eslint-disable-next-line react/display-name\n return (props) =>\n React.createElement(FormsyContext.Consumer, null, (contextValue) => {\n return React.createElement(WithFormsyWrapper, { ...props, ...contextValue });\n });\n}\n","/* eslint-disable react/no-unused-state, react/default-props-match-prop-types */\nimport { get, has, set } from 'lodash';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport FormsyContext from './FormsyContext';\nimport {\n FormsyContextInterface,\n IModel,\n InputComponent,\n IResetModel,\n IUpdateInputsWithError,\n IUpdateInputsWithValue,\n ValidationError,\n} from './interfaces';\nimport { throttle, isObject, isString } from './utils';\nimport * as utils from './utils';\nimport validationRules from './validationRules';\nimport { PassDownProps } from './withFormsy';\n\ntype FormHTMLAttributesCleaned = Omit, 'onChange' | 'onSubmit'>;\n\ntype OnSubmitCallback = (\n model: IModel,\n resetModel: IResetModel,\n updateInputsWithError: IUpdateInputsWithError,\n event: React.SyntheticEvent>,\n) => void;\n\ntype FormElementType =\n | string\n | React.ComponentType<{\n onReset?: (e: React.SyntheticEvent) => void;\n onSubmit?: (e: React.SyntheticEvent) => void;\n disabled?: boolean;\n children?: React.ReactChildren;\n }>;\n\nexport interface FormsyProps extends FormHTMLAttributesCleaned {\n disabled: boolean;\n mapping: null | ((model: IModel) => IModel);\n onChange: (model: IModel, isChanged: boolean) => void;\n onInvalid: () => void;\n onReset?: () => void;\n onSubmit?: OnSubmitCallback;\n onValidSubmit?: OnSubmitCallback;\n onInvalidSubmit: OnSubmitCallback;\n onValid: () => void;\n preventDefaultSubmit?: boolean;\n preventExternalInvalidation?: boolean;\n validationErrors?: null | object;\n formElement?: FormElementType;\n}\n\nexport interface FormsyState {\n canChange: boolean;\n contextValue: FormsyContextInterface;\n formSubmitted?: boolean;\n isPristine?: boolean;\n isSubmitting: boolean;\n isValid: boolean;\n}\n\nconst ONE_RENDER_FRAME = 66;\n\nexport class Formsy extends React.Component {\n public inputs: InstanceType>[];\n\n public emptyArray: any[];\n\n public prevInputNames: any[] | null = null;\n\n public static displayName = 'Formsy';\n\n public static propTypes = {\n disabled: PropTypes.bool,\n mapping: PropTypes.func,\n formElement: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]),\n onChange: PropTypes.func,\n onInvalid: PropTypes.func,\n onInvalidSubmit: PropTypes.func,\n onReset: PropTypes.func,\n onSubmit: PropTypes.func,\n onValid: PropTypes.func,\n onValidSubmit: PropTypes.func,\n preventDefaultSubmit: PropTypes.bool,\n preventExternalInvalidation: PropTypes.bool,\n validationErrors: PropTypes.object, // eslint-disable-line\n };\n\n public static defaultProps: Partial = {\n disabled: false,\n mapping: null,\n onChange: utils.noop,\n onInvalid: utils.noop,\n onInvalidSubmit: utils.noop,\n onReset: utils.noop,\n onSubmit: utils.noop,\n onValid: utils.noop,\n onValidSubmit: utils.noop,\n preventDefaultSubmit: true,\n preventExternalInvalidation: false,\n validationErrors: {},\n formElement: 'form',\n };\n\n private readonly throttledValidateForm: () => void;\n\n public constructor(props: FormsyProps) {\n super(props);\n this.state = {\n canChange: false,\n isSubmitting: false,\n isValid: true,\n contextValue: {\n attachToForm: this.attachToForm,\n detachFromForm: this.detachFromForm,\n isFormDisabled: props.disabled,\n isValidValue: this.isValidValue,\n validate: this.validate,\n runValidation: this.runValidation,\n },\n };\n this.inputs = [];\n this.emptyArray = [];\n this.throttledValidateForm = throttle(this.validateForm, ONE_RENDER_FRAME);\n }\n\n public componentDidMount = () => {\n this.prevInputNames = this.inputs.map((component) => component.props.name);\n this.validateForm();\n };\n\n public componentDidUpdate = (prevProps: FormsyProps) => {\n const { validationErrors, disabled } = this.props;\n\n if (validationErrors && isObject(validationErrors) && Object.keys(validationErrors).length > 0) {\n this.setInputValidationErrors(validationErrors);\n }\n\n const newInputNames = this.inputs.map((component) => component.props.name);\n if (this.prevInputNames && !utils.isSame(this.prevInputNames, newInputNames)) {\n this.prevInputNames = newInputNames;\n this.validateForm();\n }\n\n // Keep the disabled value in state/context the same as from props\n if (disabled !== prevProps.disabled) {\n // eslint-disable-next-line\n this.setState((state) => ({\n ...state,\n contextValue: {\n ...state.contextValue,\n isFormDisabled: disabled,\n },\n }));\n }\n };\n\n public getCurrentValues = () =>\n this.inputs.reduce((valueAccumulator, component) => {\n const {\n props: { name },\n state: { value },\n } = component;\n // eslint-disable-next-line no-param-reassign\n valueAccumulator[name] = utils.protectAgainstParamReassignment(value);\n return valueAccumulator;\n }, {});\n\n public getModel = () => {\n const currentValues = this.getCurrentValues();\n return this.mapModel(currentValues);\n };\n\n public getPristineValues = () =>\n this.inputs.reduce((valueAccumulator, component) => {\n const {\n props: { name, value },\n } = component;\n // eslint-disable-next-line no-param-reassign\n valueAccumulator[name] = utils.protectAgainstParamReassignment(value);\n return valueAccumulator;\n }, {});\n\n public setFormPristine = (isPristine: boolean) => {\n this.setState({\n formSubmitted: !isPristine,\n });\n\n // Iterate through each component and set it as pristine\n // or \"dirty\".\n this.inputs.forEach((component) => {\n component.setState({\n formSubmitted: !isPristine,\n isPristine,\n });\n });\n };\n\n public setInputValidationErrors = (errors) => {\n const { preventExternalInvalidation } = this.props;\n const { isValid } = this.state;\n\n this.inputs.forEach((component) => {\n const { name } = component.props;\n component.setState({\n isValid: !(name in errors),\n validationError: isString(errors[name]) ? [errors[name]] : errors[name],\n });\n });\n if (!preventExternalInvalidation && isValid) {\n this.setFormValidState(false);\n }\n };\n\n public setFormValidState = (allIsValid: boolean) => {\n const { onValid, onInvalid } = this.props;\n\n this.setState({\n isValid: allIsValid,\n });\n\n if (allIsValid) {\n onValid();\n } else {\n onInvalid();\n }\n };\n\n public isValidValue = (component, value) => this.runValidation(component, value).isValid;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormDisabled = () => this.props.disabled;\n\n public mapModel = (model: IModel): IModel => {\n const { mapping } = this.props;\n\n if (mapping) {\n return mapping(model);\n }\n\n const returnModel = {};\n Object.keys(model).forEach((key) => {\n set(returnModel, key, model[key]);\n });\n return returnModel;\n };\n\n public reset = (model?: IModel) => {\n this.setFormPristine(true);\n this.resetModel(model);\n };\n\n private resetInternal = (event) => {\n const { onReset } = this.props;\n\n event.preventDefault();\n this.reset();\n if (onReset) {\n onReset();\n }\n };\n\n // Reset each key in the model to the original / initial / specified value\n private resetModel: IResetModel = (data) => {\n this.inputs.forEach((component) => {\n const { name } = component.props;\n if (data && has(data, name)) {\n component.setValue(get(data, name));\n } else {\n component.resetValue();\n }\n });\n this.validateForm();\n };\n\n // Checks validation on current value or a passed value\n public runValidation = (\n component: InputComponent,\n value = component.state.value,\n ): { isRequired: boolean; isValid: boolean; validationError: ValidationError[] } => {\n const { validationErrors } = this.props;\n const { validationError, validationErrors: componentValidationErrors, name } = component.props;\n const currentValues = this.getCurrentValues();\n const validationResults = utils.runRules(value, currentValues, component.validations, validationRules);\n const requiredResults = utils.runRules(value, currentValues, component.requiredValidations, validationRules);\n const isRequired = Object.keys(component.requiredValidations).length ? !!requiredResults.success.length : false;\n const isValid = !validationResults.failed.length && !(validationErrors && validationErrors[component.props.name]);\n\n return {\n isRequired,\n isValid: isRequired ? false : isValid,\n validationError: (() => {\n if (isValid && !isRequired) {\n return this.emptyArray;\n }\n\n if (validationResults.errors.length) {\n return validationResults.errors;\n }\n\n if (validationErrors && validationErrors[name]) {\n return isString(validationErrors[name]) ? [validationErrors[name]] : validationErrors[name];\n }\n\n if (isRequired) {\n const error = componentValidationErrors[requiredResults.success[0]] || validationError;\n return error ? [error] : null;\n }\n\n if (validationResults.failed.length) {\n return validationResults.failed\n .map((failed) => (componentValidationErrors[failed] ? componentValidationErrors[failed] : validationError))\n .filter((x, pos, arr) => arr.indexOf(x) === pos); // remove duplicates\n }\n\n // This line is not reachable\n // istanbul ignore next\n return undefined;\n })(),\n };\n };\n\n // Method put on each input component to register\n // itself to the form\n public attachToForm = (component) => {\n if (this.inputs.indexOf(component) === -1) {\n this.inputs.push(component);\n }\n\n const { onChange } = this.props;\n const { canChange } = this.state;\n\n // Trigger onChange\n if (canChange) {\n onChange(this.getModel(), this.isChanged());\n }\n\n // Will be triggered immediately & every one frame rate\n this.throttledValidateForm();\n };\n\n // Method put on each input component to unregister\n // itself from the form\n public detachFromForm = (component: InputComponent) => {\n const componentPos = this.inputs.indexOf(component);\n\n if (componentPos !== -1) {\n this.inputs = this.inputs.slice(0, componentPos).concat(this.inputs.slice(componentPos + 1));\n }\n\n this.validateForm();\n };\n\n // Checks if the values have changed from their initial value\n public isChanged = () => !utils.isSame(this.getPristineValues(), this.getCurrentValues());\n\n // Update model, submit to url prop and send the model\n public submit = (event?: React.SyntheticEvent) => {\n const { onSubmit, onValidSubmit, onInvalidSubmit, preventDefaultSubmit } = this.props;\n const { isValid } = this.state;\n\n if (preventDefaultSubmit && event && event.preventDefault) {\n event.preventDefault();\n }\n\n // Trigger form as not pristine.\n // If any inputs have not been touched yet this will make them dirty\n // so validation becomes visible (if based on isPristine)\n this.setFormPristine(false);\n const model = this.getModel();\n onSubmit(model, this.resetModel, this.updateInputsWithError, event);\n\n if (isValid) {\n onValidSubmit(model, this.resetModel, this.updateInputsWithError, event);\n } else {\n onInvalidSubmit(model, this.resetModel, this.updateInputsWithError, event);\n }\n };\n\n // Go through errors from server and grab the components\n // stored in the inputs map. Change their state to invalid\n // and set the serverError message\n public updateInputsWithError: IUpdateInputsWithError = (errors, invalidate) => {\n const { preventExternalInvalidation } = this.props;\n const { isValid } = this.state;\n\n Object.entries(errors).forEach(([name, error]) => {\n const component = this.inputs.find((input) => input.props.name === name);\n if (!component) {\n throw new Error(\n `You are trying to update an input that does not exist. Verify errors object with input names. ${JSON.stringify(\n errors,\n )}`,\n );\n }\n component.setState({\n isValid: preventExternalInvalidation,\n validationError: utils.isString(error) ? [error] : error,\n });\n });\n\n if (invalidate && isValid) {\n this.setFormValidState(false);\n }\n };\n\n // Set the value of components\n public updateInputsWithValue: IUpdateInputsWithValue = (data, validate) => {\n this.inputs.forEach((component) => {\n const { name } = component.props;\n if (data && has(data, name)) {\n component.setValue(get(data, name), validate);\n }\n });\n };\n\n // Use the binded values and the actual input value to\n // validate the input and set its state. Then check the\n // state of the form itself\n public validate = (component: InputComponent) => {\n const { onChange } = this.props;\n const { canChange } = this.state;\n\n // Trigger onChange\n if (canChange) {\n onChange(this.getModel(), this.isChanged());\n }\n\n const validationState = this.runValidation(component);\n // Run through the validations, split them up and call\n // the validator IF there is a value or it is required\n component.setState(validationState, this.validateForm);\n };\n\n // Validate the form by going through all child input components\n // and check their state\n public validateForm = () => {\n // We need a callback as we are validating all inputs again. This will\n // run when the last component has set its state\n const onValidationComplete = () => {\n const allIsValid = this.inputs.every((component) => component.state.isValid);\n\n this.setFormValidState(allIsValid);\n\n // Tell the form that it can start to trigger change events\n this.setState({\n canChange: true,\n });\n };\n\n // Run validation again in case affected by other inputs. The\n // last component validated will run the onValidationComplete callback\n this.inputs.forEach((component, index) => {\n const validationState = this.runValidation(component);\n const isFinalInput = index === this.inputs.length - 1;\n const callback = isFinalInput ? onValidationComplete : null;\n component.setState(validationState, callback);\n });\n\n // If there are no inputs, set state where form is ready to trigger\n // change event. New inputs might be added later\n if (!this.inputs.length) {\n this.setState(\n {\n canChange: true,\n },\n onValidationComplete,\n );\n }\n };\n\n public render() {\n const {\n /* eslint-disable @typescript-eslint/no-unused-vars */\n children,\n mapping,\n onChange,\n onInvalid,\n onInvalidSubmit,\n onReset,\n onSubmit,\n onValid,\n onValidSubmit,\n preventDefaultSubmit,\n preventExternalInvalidation,\n validationErrors,\n disabled,\n formElement,\n ...nonFormsyProps\n } = this.props;\n const { contextValue } = this.state;\n\n return React.createElement(\n FormsyContext.Provider,\n {\n value: contextValue,\n },\n React.createElement(\n formElement,\n {\n onReset: this.resetInternal,\n onSubmit: this.submit,\n ...nonFormsyProps,\n disabled,\n },\n children,\n ),\n );\n }\n}\n"],"names":["isArray","value","Array","isObject","isPlainObject","isTypeUndefined","isDate","Date","isFunction","isString","isNumber","isRegex","RegExp","isValueStringEmpty","isValueNullOrUndefined","undefined","isValueUndefined","noop","protectAgainstParamReassignment","isSame","a","b","length","every","item","index","toString","Object","keys","key","runRules","currentValues","validations","validationRules","results","errors","failed","success","forEach","validationName","validationsVal","validationRulesVal","addToResults","validation","push","Error","throttle","callback","interval","enableCall","args","apply","setTimeout","isExisty","isEmpty","isDefaultRequiredValue","matchRegexp","_values","regexp","test","REGEX_PATTERNS","ALPHA","ALPHANUMERIC","EMAIL","FLOAT","INT","NUMERIC","SPECIAL_WORDS","URL","WORDS","equals","eql","equalsField","values","field","isAlpha","isAlphanumeric","isEmail","isEmptyString","isFalse","isFloat","isInt","isLength","isNumeric","isSpecialWords","isTrue","isUndefined","isUrl","isWords","maxLength","minLength","addValidationRule","name","func","noFormsyErrorMessage","throwNoFormsyProvider","defaultValue","attachToForm","detachFromForm","isFormDisabled","isValidValue","validate","runValidation","React","createContext","convertValidationsToObject","split","reduce","validationsAccumulator","validateMethod","shift","map","arg","JSON","parse","e","validationsAccumulatorCopy","propTypes","innerRef","PropTypes","string","isRequired","required","oneOfType","bool","object","any","getDisplayName","component","displayName","utils","withFormsy","WrappedComponent","WithFormsyWrapper","props","messages","getErrorMessages","validationError","state","isValid","showRequired","requiredValidations","validateForm","setState","isPristine","formSubmitted","pristineValue","setValidations","componentDidMount","shouldComponentUpdate","nextProps","nextState","isChanged","some","k","isPropsChanged","isStateChanged","componentDidUpdate","prevProps","setValue","componentWillUnmount","render","propsForElement","errorMessage","getErrorMessage","errorMessages","hasValue","isFormSubmitted","resetValue","showError","getValue","ref","createElement","Component","validationErrors","FormsyContext","Consumer","contextValue","ONE_RENDER_FRAME","Formsy","prevInputNames","inputs","disabled","setInputValidationErrors","newInputNames","valueAccumulator","getCurrentValues","mapModel","preventExternalInvalidation","setFormValidState","allIsValid","onValid","onInvalid","model","mapping","returnModel","set","setFormPristine","resetModel","event","onReset","preventDefault","reset","data","has","get","componentValidationErrors","validationResults","requiredResults","emptyArray","error","filter","x","pos","arr","indexOf","onChange","canChange","getModel","throttledValidateForm","componentPos","slice","concat","getPristineValues","onSubmit","onValidSubmit","onInvalidSubmit","preventDefaultSubmit","updateInputsWithError","invalidate","entries","find","input","stringify","validationState","onValidationComplete","isFinalInput","isSubmitting","children","formElement","nonFormsyProps","Provider","resetInternal","submit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAIgBA,Q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AW,EAAE;AAboC,CAArC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"formsy-react.cjs.development.js","sources":["../src/utils.ts","../src/validationRules.ts","../src/FormsyContext.ts","../src/withFormsy.ts","../src/Formsy.ts"],"sourcesContent":["import { isPlainObject } from 'lodash';\n\nimport { ValidationError, Validations, Values } from './interfaces';\n\nexport function isArray(value: unknown): value is unknown[] {\n return Array.isArray(value);\n}\n\nexport function isObject(value: unknown): value is object {\n return isPlainObject(value);\n}\n\nexport function isTypeUndefined(value: unknown): value is undefined {\n return typeof value === 'undefined';\n}\n\nexport function isDate(value: unknown): value is Date {\n return value instanceof Date;\n}\n\nexport function isFunction(value: unknown): value is Function {\n return value !== null && typeof value === 'function';\n}\n\nexport function isString(value: unknown): value is string {\n return typeof value === 'string';\n}\n\nexport function isNumber(value: unknown): value is number {\n return typeof value === 'number';\n}\n\nexport function isRegex(value: unknown): value is RegExp {\n return value instanceof RegExp;\n}\n\nexport function isValueStringEmpty(value: string): boolean {\n return value === '';\n}\n\nexport function isValueNullOrUndefined(value: unknown): boolean {\n return value === null || value === undefined;\n}\n\nexport function isValueUndefined(value: unknown): boolean {\n return value === undefined;\n}\n\nexport function noop() {\n // do nothing.\n}\n\nexport function protectAgainstParamReassignment(value: unknown) {\n // Clone objects to avoid accidental param reassignment\n if (isObject(value)) return { ...value };\n if (isArray(value)) return [...value];\n return value;\n}\n\nexport function isSame(a: unknown, b: unknown) {\n if (typeof a !== typeof b) {\n return false;\n }\n\n if (isArray(a) && isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n\n return a.every((item, index) => isSame(item, b[index]));\n }\n\n if (isFunction(a) && isFunction(b)) {\n return a.toString() === b.toString();\n }\n\n if (isDate(a) && isDate(b)) {\n return a.toString() === b.toString();\n }\n\n if (isObject(a) && isObject(b)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n return Object.keys(a).every((key) => isSame(a[key], b[key]));\n }\n\n if (isRegex(a) && isRegex(b)) {\n return a.toString() === b.toString();\n }\n\n return a === b;\n}\n\ninterface RulesResult {\n errors: ValidationError[];\n failed: string[];\n success: string[];\n}\n\nexport function runRules(\n value: V,\n currentValues: Values,\n validations: Validations,\n validationRules: Validations,\n) {\n const results: RulesResult = {\n errors: [],\n failed: [],\n success: [],\n };\n\n Object.keys(validations).forEach((validationName) => {\n const validationsVal = validations[validationName];\n const validationRulesVal = validationRules[validationName];\n const addToResults = (validation) => {\n if (isString(validation)) {\n results.errors.push(validation);\n results.failed.push(validationName);\n } else if (!validation) {\n results.failed.push(validationName);\n } else {\n results.success.push(validationName);\n }\n };\n\n if (validationRulesVal && isFunction(validationsVal)) {\n throw new Error(`Formsy does not allow you to override default validations: ${validationName}`);\n }\n\n if (!validationRulesVal && !isFunction(validationsVal)) {\n throw new Error(`Formsy does not have the validation rule: ${validationName}`);\n }\n\n if (isFunction(validationsVal)) {\n return addToResults(validationsVal(currentValues, value));\n }\n\n return addToResults(validationRulesVal(currentValues, value, validationsVal));\n });\n\n return results;\n}\n\nexport function throttle(callback, interval) {\n let enableCall = true;\n\n return function (...args) {\n if (!enableCall) return;\n\n enableCall = false;\n callback.apply(this, args);\n setTimeout(() => (enableCall = true), interval);\n };\n}\n","import { ValidationFunction, Values } from './interfaces';\nimport {\n isNumber,\n isString,\n isTypeUndefined,\n isValueNullOrUndefined,\n isValueStringEmpty,\n isValueUndefined,\n} from './utils';\n\nexport function isExisty(value: V) {\n return !isValueNullOrUndefined(value);\n}\n\nexport function isEmpty(value: V) {\n if (isString(value)) {\n return isValueStringEmpty(value);\n }\n if (isTypeUndefined(value)) {\n return false;\n }\n return isValueUndefined(value);\n}\n\nexport function isDefaultRequiredValue(value: unknown) {\n return isString(value) ? isValueStringEmpty(value) : isValueNullOrUndefined(value);\n}\n\nexport function matchRegexp(_values: Values, value: V, regexp: RegExp) {\n return !isExisty(value) || isEmpty(value) || regexp.test(`${value}`);\n}\n\ninterface Validations {\n [key: string]: ValidationFunction;\n}\n\nconst REGEX_PATTERNS = {\n ALPHA: /^[A-Z]+$/i,\n ALPHANUMERIC: /^[0-9A-Z]+$/i,\n EMAIL:\n /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/i, // from http://emailregex.com/\n FLOAT: /^(?:[-+]?(?:\\d+))?(?:\\.\\d*)?(?:[eE][+-]?(?:\\d+))?$/,\n INT: /^(?:[-+]?(?:0|[1-9]\\d*))$/,\n NUMERIC: /^[-+]?(?:\\d*[.])?\\d+$/,\n SPECIAL_WORDS: /^[\\sA-ZÀ-ÖØ-öø-ÿ]+$/i,\n URL: /^(?:\\w+:)?\\/\\/([^\\s.]+\\.\\S{2}|localhost[:?\\d]*)\\S*$/i,\n WORDS: /^[A-Z\\s]+$/i,\n};\n\nconst validations: Validations = {\n equals: (_values, value: V, eql: V) => !isExisty(value) || isEmpty(value) || value === eql,\n equalsField: (values, value: V, field: string) => value === values[field],\n isAlpha: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.ALPHA),\n isAlphanumeric: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.ALPHANUMERIC),\n isDefaultRequiredValue: (_values, value: V) => isDefaultRequiredValue(value),\n isEmail: (values, value: string) => matchRegexp(values, value, REGEX_PATTERNS.EMAIL),\n isEmptyString: (_values, value: string) => isEmpty(value),\n isExisty: (_values, value: V) => isExisty(value),\n isFalse: (_values, value: boolean | string) => value === false,\n isFloat: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.FLOAT),\n isInt: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.INT),\n isLength: (_values, value: string, length: number) => !isExisty(value) || isEmpty(value) || value.length === length,\n isNumeric: (values, value: V) => isNumber(value) || matchRegexp(values, value, REGEX_PATTERNS.NUMERIC),\n isSpecialWords: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.SPECIAL_WORDS),\n isTrue: (_values, value: boolean | string) => value === true,\n isUndefined: (_values, value: V) => isValueUndefined(value),\n isUrl: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.URL),\n isWords: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.WORDS),\n matchRegexp,\n maxLength: (_values, value: string, length: number) => !isExisty(value) || value.length <= length,\n minLength: (_values, value: string, length: number) => !isExisty(value) || isEmpty(value) || value.length >= length,\n};\n\nexport const addValidationRule = (name: string, func: ValidationFunction) => {\n validations[name] = func;\n};\n\nexport default validations;\n","import React from 'react';\nimport { FormsyContextInterface } from './interfaces';\n\nconst noFormsyErrorMessage = 'Could not find Formsy Context Provider. Did you use withFormsy outside ?';\n\nconst throwNoFormsyProvider = () => {\n // istanbul ignore next\n throw new Error(noFormsyErrorMessage);\n};\n\nconst defaultValue = {\n attachToForm: throwNoFormsyProvider,\n detachFromForm: throwNoFormsyProvider,\n isFormDisabled: true,\n isValidValue: throwNoFormsyProvider,\n validate: throwNoFormsyProvider,\n runValidation: throwNoFormsyProvider,\n};\n\nexport default React.createContext(defaultValue);\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport FormsyContext from './FormsyContext';\nimport {\n ComponentWithStaticAttributes,\n FormsyContextInterface,\n RequiredValidation,\n ValidationError,\n Validations,\n WrappedComponentClass,\n} from './interfaces';\n\nimport * as utils from './utils';\nimport { isString } from './utils';\nimport { isDefaultRequiredValue } from './validationRules';\n\n/* eslint-disable react/default-props-match-prop-types */\n\nconst convertValidationsToObject = (validations: false | Validations): Validations => {\n if (isString(validations)) {\n return validations.split(/,(?![^{[]*[}\\]])/g).reduce((validationsAccumulator, validation) => {\n let args: string[] = validation.split(':');\n const validateMethod: string = args.shift();\n\n args = args.map((arg) => {\n try {\n return JSON.parse(arg);\n } catch (e) {\n return arg; // It is a string if it can not parse it\n }\n });\n\n if (args.length > 1) {\n throw new Error(\n 'Formsy does not support multiple args on string validations. Use object format of validations instead.',\n );\n }\n\n // Avoid parameter reassignment\n const validationsAccumulatorCopy: Validations = { ...validationsAccumulator };\n validationsAccumulatorCopy[validateMethod] = args.length ? args[0] : true;\n return validationsAccumulatorCopy;\n }, {});\n }\n\n return validations || {};\n};\n\nexport const propTypes = {\n innerRef: PropTypes.func,\n name: PropTypes.string.isRequired,\n required: PropTypes.oneOfType([PropTypes.bool, PropTypes.object, PropTypes.string]),\n validations: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n value: PropTypes.any, // eslint-disable-line react/forbid-prop-types\n};\n\nexport interface WrapperProps {\n innerRef?: (ref: React.Ref) => void;\n name: string;\n required?: RequiredValidation;\n validationError?: ValidationError;\n validationErrors?: { [key: string]: ValidationError };\n validations?: Validations;\n value?: V;\n}\n\nexport interface WrapperState {\n [key: string]: unknown;\n\n formSubmitted: boolean;\n isPristine: boolean;\n isRequired: boolean;\n isValid: boolean;\n pristineValue: V;\n validationError: ValidationError[];\n value: V;\n}\n\nexport interface InjectedProps {\n errorMessage: ValidationError;\n errorMessages: ValidationError[];\n hasValue: boolean;\n isFormDisabled: boolean;\n isFormSubmitted: boolean;\n isPristine: boolean;\n isRequired: boolean;\n isValid: boolean;\n isValidValue: (value: V) => boolean;\n ref?: React.Ref;\n resetValue: () => void;\n setValidations: (validations: Validations, required: RequiredValidation) => void;\n setValue: (value: V, validate?: boolean) => void;\n showError: boolean;\n showRequired: boolean;\n}\n\nexport interface WrapperInstanceMethods {\n getErrorMessage: () => null | ValidationError;\n getErrorMessages: () => ValidationError[];\n getValue: () => V;\n isFormDisabled: () => boolean;\n isFormSubmitted: () => boolean;\n isValid: () => boolean;\n isValidValue: (value: V) => boolean;\n setValue: (value: V, validate?: boolean) => void;\n}\n\nexport type PassDownProps = WrapperProps & InjectedProps;\n\nfunction getDisplayName(component: WrappedComponentClass) {\n return component.displayName || component.name || (utils.isString(component) ? component : 'Component');\n}\n\nexport default function withFormsy(\n WrappedComponent: React.ComponentType>,\n): React.ComponentType, keyof InjectedProps>> {\n class WithFormsyWrapper\n extends React.Component & FormsyContextInterface, WrapperState>\n implements WrapperInstanceMethods\n {\n public validations?: Validations;\n\n public requiredValidations?: Validations;\n\n public static displayName = `Formsy(${getDisplayName(WrappedComponent)})`;\n\n public static propTypes: any = propTypes;\n\n public static defaultProps: any = {\n innerRef: null,\n required: false,\n validationError: '',\n validationErrors: {},\n validations: null,\n value: (WrappedComponent as ComponentWithStaticAttributes).defaultValue,\n };\n\n public constructor(props) {\n super(props);\n const { runValidation, validations, required, value } = props;\n\n this.state = { value } as any;\n\n this.setValidations(validations, required);\n\n this.state = {\n formSubmitted: false,\n isPristine: true,\n pristineValue: props.value,\n value: props.value,\n ...runValidation(this, props.value),\n };\n }\n\n public componentDidMount() {\n const { name, attachToForm } = this.props;\n\n if (!name) {\n throw new Error('Form Input requires a name property when used');\n }\n\n attachToForm(this);\n }\n\n public shouldComponentUpdate(nextProps, nextState) {\n const { props, state } = this;\n const isChanged = (a: object, b: object): boolean => Object.keys(a).some((k) => a[k] !== b[k]);\n const isPropsChanged = isChanged(props, nextProps);\n const isStateChanged = isChanged(state, nextState);\n\n return isPropsChanged || isStateChanged;\n }\n\n public componentDidUpdate(prevProps) {\n const { value, validations, required, validate } = this.props;\n\n // If the value passed has changed, set it. If value is not passed it will\n // internally update, and this will never run\n if (!utils.isSame(value, prevProps.value)) {\n this.setValue(value);\n }\n\n // If validations or required is changed, run a new validation\n if (!utils.isSame(validations, prevProps.validations) || !utils.isSame(required, prevProps.required)) {\n this.setValidations(validations, required);\n validate(this);\n }\n }\n\n // Detach it when component unmounts\n public componentWillUnmount() {\n const { detachFromForm } = this.props;\n detachFromForm(this);\n }\n\n public getErrorMessage = (): ValidationError | null => {\n const messages = this.getErrorMessages();\n return messages.length ? messages[0] : null;\n };\n\n public getErrorMessages = (): ValidationError[] => {\n const { validationError } = this.state;\n\n if (!this.isValid() || this.showRequired()) {\n return validationError || [];\n }\n return [];\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public getValue = (): V => this.state.value;\n\n public setValidations = (validations: Validations, required: RequiredValidation): void => {\n // Add validations to the store itself as the props object can not be modified\n this.validations = convertValidationsToObject(validations) || {};\n this.requiredValidations =\n required === true ? { isDefaultRequiredValue: required } : convertValidationsToObject(required);\n };\n\n // By default, we validate after the value has been set.\n // A user can override this and pass a second parameter of `false` to skip validation.\n public setValue = (value: V, validate = true): void => {\n const { validate: validateForm } = this.props;\n\n if (!validate) {\n this.setState({ value });\n } else {\n this.setState(\n {\n value,\n isPristine: false,\n },\n () => {\n validateForm(this);\n },\n );\n }\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public hasValue = () => {\n const { value } = this.state;\n return isDefaultRequiredValue(value);\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormDisabled = (): boolean => this.props.isFormDisabled;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormSubmitted = (): boolean => this.state.formSubmitted;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isPristine = (): boolean => this.state.isPristine;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isRequired = (): boolean => !!this.props.required;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isValid = (): boolean => this.state.isValid;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isValidValue = (value: V) => this.props.isValidValue(this, value);\n\n public resetValue = () => {\n const { pristineValue } = this.state;\n const { validate } = this.props;\n\n this.setState(\n {\n value: pristineValue,\n isPristine: true,\n },\n () => {\n validate(this);\n },\n );\n };\n\n public showError = (): boolean => !this.showRequired() && !this.isValid();\n\n // eslint-disable-next-line react/destructuring-assignment\n public showRequired = (): boolean => this.state.isRequired;\n\n public render() {\n const { innerRef } = this.props;\n const propsForElement: T & PassDownProps = {\n ...this.props,\n errorMessage: this.getErrorMessage(),\n errorMessages: this.getErrorMessages(),\n hasValue: this.hasValue(),\n isFormDisabled: this.isFormDisabled(),\n isFormSubmitted: this.isFormSubmitted(),\n isPristine: this.isPristine(),\n isRequired: this.isRequired(),\n isValid: this.isValid(),\n isValidValue: this.isValidValue,\n resetValue: this.resetValue,\n setValidations: this.setValidations,\n setValue: this.setValue,\n showError: this.showError(),\n showRequired: this.showRequired(),\n value: this.getValue(),\n };\n\n if (innerRef) {\n propsForElement.ref = innerRef;\n }\n\n return React.createElement(WrappedComponent, propsForElement);\n }\n }\n\n // eslint-disable-next-line react/display-name\n return (props) =>\n React.createElement(FormsyContext.Consumer, null, (contextValue) => {\n return React.createElement(WithFormsyWrapper, { ...props, ...contextValue });\n });\n}\n","/* eslint-disable react/no-unused-state, react/default-props-match-prop-types */\nimport { get, has, set } from 'lodash';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport FormsyContext from './FormsyContext';\nimport {\n FormsyContextInterface,\n IModel,\n InputComponent,\n IResetModel,\n IUpdateInputsWithError,\n IUpdateInputsWithValue,\n ValidationError,\n} from './interfaces';\nimport { throttle, isObject, isString } from './utils';\nimport * as utils from './utils';\nimport validationRules from './validationRules';\nimport { PassDownProps } from './withFormsy';\n\ntype FormHTMLAttributesCleaned = Omit, 'onChange' | 'onSubmit'>;\n\ntype OnSubmitCallback = (\n model: IModel,\n resetModel: IResetModel,\n updateInputsWithError: IUpdateInputsWithError,\n event: React.SyntheticEvent,\n) => void;\n\ntype FormElementType =\n | string\n | React.ComponentType<{\n onReset?: (e: React.SyntheticEvent) => void;\n onSubmit?: (e: React.SyntheticEvent) => void;\n disabled?: boolean;\n children?: React.ReactChildren;\n }>;\n\nexport interface FormsyProps extends FormHTMLAttributesCleaned {\n disabled: boolean;\n mapping: null | ((model: IModel) => IModel);\n onChange: (model: IModel, isChanged: boolean) => void;\n onInvalid: () => void;\n onReset?: () => void;\n onSubmit?: OnSubmitCallback;\n onValidSubmit?: OnSubmitCallback;\n onInvalidSubmit: OnSubmitCallback;\n onValid: () => void;\n preventDefaultSubmit?: boolean;\n preventExternalInvalidation?: boolean;\n validationErrors?: null | object;\n formElement?: FormElementType;\n}\n\nexport interface FormsyState {\n canChange: boolean;\n contextValue: FormsyContextInterface;\n formSubmitted?: boolean;\n isPristine?: boolean;\n isSubmitting: boolean;\n isValid: boolean;\n}\n\nconst ONE_RENDER_FRAME = 66;\n\nexport class Formsy extends React.Component {\n public inputs: InstanceType>[];\n\n public emptyArray: any[];\n\n public prevInputNames: any[] | null = null;\n\n public static displayName = 'Formsy';\n\n public static propTypes = {\n disabled: PropTypes.bool,\n mapping: PropTypes.func,\n formElement: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]),\n onChange: PropTypes.func,\n onInvalid: PropTypes.func,\n onInvalidSubmit: PropTypes.func,\n onReset: PropTypes.func,\n onSubmit: PropTypes.func,\n onValid: PropTypes.func,\n onValidSubmit: PropTypes.func,\n preventDefaultSubmit: PropTypes.bool,\n preventExternalInvalidation: PropTypes.bool,\n validationErrors: PropTypes.object, // eslint-disable-line\n };\n\n public static defaultProps: Partial = {\n disabled: false,\n mapping: null,\n onChange: utils.noop,\n onInvalid: utils.noop,\n onInvalidSubmit: utils.noop,\n onReset: utils.noop,\n onSubmit: utils.noop,\n onValid: utils.noop,\n onValidSubmit: utils.noop,\n preventDefaultSubmit: true,\n preventExternalInvalidation: false,\n validationErrors: {},\n formElement: 'form',\n };\n\n private readonly throttledValidateForm: () => void;\n\n public constructor(props: FormsyProps) {\n super(props);\n this.state = {\n canChange: false,\n isSubmitting: false,\n isValid: true,\n contextValue: {\n attachToForm: this.attachToForm,\n detachFromForm: this.detachFromForm,\n isFormDisabled: props.disabled,\n isValidValue: this.isValidValue,\n validate: this.validate,\n runValidation: this.runValidation,\n },\n };\n this.inputs = [];\n this.emptyArray = [];\n this.throttledValidateForm = throttle(this.validateForm, ONE_RENDER_FRAME);\n }\n\n public componentDidMount = () => {\n this.prevInputNames = this.inputs.map((component) => component.props.name);\n this.validateForm();\n };\n\n public componentDidUpdate = (prevProps: FormsyProps) => {\n const { validationErrors, disabled } = this.props;\n\n if (validationErrors && isObject(validationErrors) && Object.keys(validationErrors).length > 0) {\n this.setInputValidationErrors(validationErrors);\n }\n\n const newInputNames = this.inputs.map((component) => component.props.name);\n if (this.prevInputNames && !utils.isSame(this.prevInputNames, newInputNames)) {\n this.prevInputNames = newInputNames;\n this.validateForm();\n }\n\n // Keep the disabled value in state/context the same as from props\n if (disabled !== prevProps.disabled) {\n // eslint-disable-next-line\n this.setState((state) => ({\n ...state,\n contextValue: {\n ...state.contextValue,\n isFormDisabled: disabled,\n },\n }));\n }\n };\n\n public getCurrentValues = () =>\n this.inputs.reduce((valueAccumulator, component) => {\n const {\n props: { name },\n state: { value },\n } = component;\n // eslint-disable-next-line no-param-reassign\n valueAccumulator[name] = utils.protectAgainstParamReassignment(value);\n return valueAccumulator;\n }, {});\n\n public getModel = () => {\n const currentValues = this.getCurrentValues();\n return this.mapModel(currentValues);\n };\n\n public getPristineValues = () =>\n this.inputs.reduce((valueAccumulator, component) => {\n const {\n props: { name, value },\n } = component;\n // eslint-disable-next-line no-param-reassign\n valueAccumulator[name] = utils.protectAgainstParamReassignment(value);\n return valueAccumulator;\n }, {});\n\n public setFormPristine = (isPristine: boolean) => {\n this.setState({\n formSubmitted: !isPristine,\n });\n\n // Iterate through each component and set it as pristine\n // or \"dirty\".\n this.inputs.forEach((component) => {\n component.setState({\n formSubmitted: !isPristine,\n isPristine,\n });\n });\n };\n\n public setInputValidationErrors = (errors) => {\n const { preventExternalInvalidation } = this.props;\n const { isValid } = this.state;\n\n this.inputs.forEach((component) => {\n const { name } = component.props;\n component.setState({\n isValid: !(name in errors),\n validationError: isString(errors[name]) ? [errors[name]] : errors[name],\n });\n });\n if (!preventExternalInvalidation && isValid) {\n this.setFormValidState(false);\n }\n };\n\n public setFormValidState = (allIsValid: boolean) => {\n const { onValid, onInvalid } = this.props;\n\n this.setState({\n isValid: allIsValid,\n });\n\n if (allIsValid) {\n onValid();\n } else {\n onInvalid();\n }\n };\n\n public isValidValue = (component, value) => this.runValidation(component, value).isValid;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormDisabled = () => this.props.disabled;\n\n public mapModel = (model: IModel): IModel => {\n const { mapping } = this.props;\n\n if (mapping) {\n return mapping(model);\n }\n\n const returnModel = {};\n Object.keys(model).forEach((key) => {\n set(returnModel, key, model[key]);\n });\n return returnModel;\n };\n\n public reset = (model?: IModel) => {\n this.setFormPristine(true);\n this.resetModel(model);\n };\n\n private resetInternal = (event) => {\n const { onReset } = this.props;\n\n event.preventDefault();\n this.reset();\n if (onReset) {\n onReset();\n }\n };\n\n // Reset each key in the model to the original / initial / specified value\n private resetModel: IResetModel = (data) => {\n this.inputs.forEach((component) => {\n const { name } = component.props;\n if (data && has(data, name)) {\n component.setValue(get(data, name));\n } else {\n component.resetValue();\n }\n });\n this.validateForm();\n };\n\n // Checks validation on current value or a passed value\n public runValidation = (\n component: InputComponent,\n value = component.state.value,\n ): { isRequired: boolean; isValid: boolean; validationError: ValidationError[] } => {\n const { validationErrors } = this.props;\n const { validationError, validationErrors: componentValidationErrors, name } = component.props;\n const currentValues = this.getCurrentValues();\n const validationResults = utils.runRules(value, currentValues, component.validations, validationRules);\n const requiredResults = utils.runRules(value, currentValues, component.requiredValidations, validationRules);\n const isRequired = Object.keys(component.requiredValidations).length ? !!requiredResults.success.length : false;\n const isValid = !validationResults.failed.length && !(validationErrors && validationErrors[component.props.name]);\n\n return {\n isRequired,\n isValid: isRequired ? false : isValid,\n validationError: (() => {\n if (isValid && !isRequired) {\n return this.emptyArray;\n }\n\n if (validationResults.errors.length) {\n return validationResults.errors;\n }\n\n if (validationErrors && validationErrors[name]) {\n return isString(validationErrors[name]) ? [validationErrors[name]] : validationErrors[name];\n }\n\n if (isRequired) {\n const error = componentValidationErrors[requiredResults.success[0]] || validationError;\n return error ? [error] : null;\n }\n\n if (validationResults.failed.length) {\n return validationResults.failed\n .map((failed) => (componentValidationErrors[failed] ? componentValidationErrors[failed] : validationError))\n .filter((x, pos, arr) => arr.indexOf(x) === pos); // remove duplicates\n }\n\n // This line is not reachable\n // istanbul ignore next\n return undefined;\n })(),\n };\n };\n\n // Method put on each input component to register\n // itself to the form\n public attachToForm = (component) => {\n if (this.inputs.indexOf(component) === -1) {\n this.inputs.push(component);\n }\n\n const { onChange } = this.props;\n const { canChange } = this.state;\n\n // Trigger onChange\n if (canChange) {\n onChange(this.getModel(), this.isChanged());\n }\n\n // Will be triggered immediately & every one frame rate\n this.throttledValidateForm();\n };\n\n // Method put on each input component to unregister\n // itself from the form\n public detachFromForm = (component: InputComponent) => {\n const componentPos = this.inputs.indexOf(component);\n\n if (componentPos !== -1) {\n this.inputs = this.inputs.slice(0, componentPos).concat(this.inputs.slice(componentPos + 1));\n }\n\n this.validateForm();\n };\n\n // Checks if the values have changed from their initial value\n public isChanged = () => !utils.isSame(this.getPristineValues(), this.getCurrentValues());\n\n // Update model, submit to url prop and send the model\n public submit = (event?: React.SyntheticEvent) => {\n const { onSubmit, onValidSubmit, onInvalidSubmit, preventDefaultSubmit } = this.props;\n const { isValid } = this.state;\n\n if (preventDefaultSubmit && event && event.preventDefault) {\n event.preventDefault();\n }\n\n // Trigger form as not pristine.\n // If any inputs have not been touched yet this will make them dirty\n // so validation becomes visible (if based on isPristine)\n this.setFormPristine(false);\n const model = this.getModel();\n onSubmit(model, this.resetModel, this.updateInputsWithError, event);\n\n if (isValid) {\n onValidSubmit(model, this.resetModel, this.updateInputsWithError, event);\n } else {\n onInvalidSubmit(model, this.resetModel, this.updateInputsWithError, event);\n }\n };\n\n // Go through errors from server and grab the components\n // stored in the inputs map. Change their state to invalid\n // and set the serverError message\n public updateInputsWithError: IUpdateInputsWithError = (errors, invalidate) => {\n const { preventExternalInvalidation } = this.props;\n const { isValid } = this.state;\n\n Object.entries(errors).forEach(([name, error]) => {\n const component = this.inputs.find((input) => input.props.name === name);\n if (!component) {\n throw new Error(\n `You are trying to update an input that does not exist. Verify errors object with input names. ${JSON.stringify(\n errors,\n )}`,\n );\n }\n component.setState({\n isValid: preventExternalInvalidation,\n validationError: utils.isString(error) ? [error] : error,\n });\n });\n\n if (invalidate && isValid) {\n this.setFormValidState(false);\n }\n };\n\n // Set the value of components\n public updateInputsWithValue: IUpdateInputsWithValue = (data, validate) => {\n this.inputs.forEach((component) => {\n const { name } = component.props;\n if (data && has(data, name)) {\n component.setValue(get(data, name), validate);\n }\n });\n };\n\n // Use the binded values and the actual input value to\n // validate the input and set its state. Then check the\n // state of the form itself\n public validate = (component: InputComponent) => {\n const { onChange } = this.props;\n const { canChange } = this.state;\n\n // Trigger onChange\n if (canChange) {\n onChange(this.getModel(), this.isChanged());\n }\n\n const validationState = this.runValidation(component);\n // Run through the validations, split them up and call\n // the validator IF there is a value or it is required\n component.setState(validationState, this.validateForm);\n };\n\n // Validate the form by going through all child input components\n // and check their state\n public validateForm = () => {\n // We need a callback as we are validating all inputs again. This will\n // run when the last component has set its state\n const onValidationComplete = () => {\n const allIsValid = this.inputs.every((component) => component.state.isValid);\n\n this.setFormValidState(allIsValid);\n\n // Tell the form that it can start to trigger change events\n this.setState({\n canChange: true,\n });\n };\n\n // Run validation again in case affected by other inputs. The\n // last component validated will run the onValidationComplete callback\n this.inputs.forEach((component, index) => {\n const validationState = this.runValidation(component);\n const isFinalInput = index === this.inputs.length - 1;\n const callback = isFinalInput ? onValidationComplete : null;\n component.setState(validationState, callback);\n });\n\n // If there are no inputs, set state where form is ready to trigger\n // change event. New inputs might be added later\n if (!this.inputs.length) {\n this.setState(\n {\n canChange: true,\n },\n onValidationComplete,\n );\n }\n };\n\n public render() {\n const {\n /* eslint-disable @typescript-eslint/no-unused-vars */\n children,\n mapping,\n onChange,\n onInvalid,\n onInvalidSubmit,\n onReset,\n onSubmit,\n onValid,\n onValidSubmit,\n preventDefaultSubmit,\n preventExternalInvalidation,\n validationErrors,\n disabled,\n formElement,\n ...nonFormsyProps\n } = this.props;\n const { contextValue } = this.state;\n\n return React.createElement(\n FormsyContext.Provider,\n {\n value: contextValue,\n },\n React.createElement(\n formElement,\n {\n onReset: this.resetInternal,\n onSubmit: this.submit,\n ...nonFormsyProps,\n disabled,\n },\n children,\n ),\n );\n }\n}\n"],"names":["isArray","value","Array","isObject","isPlainObject","isTypeUndefined","isDate","Date","isFunction","isString","isNumber","isRegex","RegExp","isValueStringEmpty","isValueNullOrUndefined","undefined","isValueUndefined","noop","protectAgainstParamReassignment","isSame","a","b","length","every","item","index","toString","Object","keys","key","runRules","currentValues","validations","validationRules","results","errors","failed","success","forEach","validationName","validationsVal","validationRulesVal","addToResults","validation","push","Error","throttle","callback","interval","enableCall","args","apply","setTimeout","isExisty","isEmpty","isDefaultRequiredValue","matchRegexp","_values","regexp","test","REGEX_PATTERNS","ALPHA","ALPHANUMERIC","EMAIL","FLOAT","INT","NUMERIC","SPECIAL_WORDS","URL","WORDS","equals","eql","equalsField","values","field","isAlpha","isAlphanumeric","isEmail","isEmptyString","isFalse","isFloat","isInt","isLength","isNumeric","isSpecialWords","isTrue","isUndefined","isUrl","isWords","maxLength","minLength","addValidationRule","name","func","noFormsyErrorMessage","throwNoFormsyProvider","defaultValue","attachToForm","detachFromForm","isFormDisabled","isValidValue","validate","runValidation","React","createContext","convertValidationsToObject","split","reduce","validationsAccumulator","validateMethod","shift","map","arg","JSON","parse","e","validationsAccumulatorCopy","propTypes","innerRef","PropTypes","string","isRequired","required","oneOfType","bool","object","any","getDisplayName","component","displayName","utils","withFormsy","WrappedComponent","WithFormsyWrapper","props","messages","getErrorMessages","validationError","state","isValid","showRequired","requiredValidations","validateForm","setState","isPristine","formSubmitted","pristineValue","setValidations","componentDidMount","shouldComponentUpdate","nextProps","nextState","isChanged","some","k","isPropsChanged","isStateChanged","componentDidUpdate","prevProps","setValue","componentWillUnmount","render","propsForElement","errorMessage","getErrorMessage","errorMessages","hasValue","isFormSubmitted","resetValue","showError","getValue","ref","createElement","Component","validationErrors","FormsyContext","Consumer","contextValue","ONE_RENDER_FRAME","Formsy","prevInputNames","inputs","disabled","setInputValidationErrors","newInputNames","valueAccumulator","getCurrentValues","mapModel","preventExternalInvalidation","setFormValidState","allIsValid","onValid","onInvalid","model","mapping","returnModel","set","setFormPristine","resetModel","event","onReset","preventDefault","reset","data","has","get","componentValidationErrors","validationResults","requiredResults","emptyArray","error","filter","x","pos","arr","indexOf","onChange","canChange","getModel","throttledValidateForm","componentPos","slice","concat","getPristineValues","onSubmit","onValidSubmit","onInvalidSubmit","preventDefaultSubmit","updateInputsWithError","invalidate","entries","find","input","stringify","validationState","onValidationComplete","isFinalInput","isSubmitting","children","formElement","nonFormsyProps","Provider","resetInternal","submit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAIgBA,QAAQC;AACtB,SAAOC,KAAK,CAACF,OAAN,CAAcC,KAAd,CAAP;AACD;SAEeE,SAASF;AACvB,SAAOG,oBAAa,CAACH,KAAD,CAApB;AACD;SAEeI,gBAAgBJ;AAC9B,SAAO,OAAOA,KAAP,KAAiB,WAAxB;AACD;SAEeK,OAAOL;AACrB,SAAOA,KAAK,YAAYM,IAAxB;AACD;SAEeC,WAAWP;AACzB,SAAOA,KAAK,KAAK,IAAV,IAAkB,OAAOA,KAAP,KAAiB,UAA1C;AACD;SAEeQ,SAASR;AACvB,SAAO,OAAOA,KAAP,KAAiB,QAAxB;AACD;SAEeS,SAAST;AACvB,SAAO,OAAOA,KAAP,KAAiB,QAAxB;AACD;SAEeU,QAAQV;AACtB,SAAOA,KAAK,YAAYW,MAAxB;AACD;SAEeC,mBAAmBZ;AACjC,SAAOA,KAAK,KAAK,EAAjB;AACD;SAEea,uBAAuBb;AACrC,SAAOA,KAAK,KAAK,IAAV,IAAkBA,KAAK,KAAKc,SAAnC;AACD;SAEeC,iBAAiBf;AAC/B,SAAOA,KAAK,KAAKc,SAAjB;AACD;SAEeE;AAEf;SAEeC,gCAAgCjB;AAC9C;AACA,MAAIE,QAAQ,CAACF,KAAD,CAAZ,EAAqB,oBAAYA,KAAZ;AACrB,MAAID,OAAO,CAACC,KAAD,CAAX,EAAoB,iBAAWA,KAAX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sB,EAAAA,QAAQ,EAAEtF,IAHuC;AAIjD8D,EAAAA,SAAS,EAAE9D,IAJsC;AAKjDgG,EAAAA,eAAe,EAAEhG,IALgC;AAMjDsE,EAAAA,OAAO,EAAEtE,IANwC;AAOjD8F,EAAAA,QAAQ,EAAE9F,IAPuC;AAQjD6D,EAAAA,OAAO,EAAE7D,IARwC;AASjD+F,EAAAA,aAAa,EAAE/F,IATkC;AAUjDiG,EAAAA,oBAAoB,EAAE,IAV2B;AAWjDvC,EAAAA,2BAA2B,EAAE,KAXoB;AAYjDd,EAAAA,gBAAgB,EAAE,EAZ+B;AAajDiE,EAAAA,WAAW,EAAE;AAboC,CAArC;;;;;;;;"} \ No newline at end of file diff --git a/dist/formsy-react.cjs.production.min.js.map b/dist/formsy-react.cjs.production.min.js.map index 3a5aa306..b0998014 100644 --- a/dist/formsy-react.cjs.production.min.js.map +++ b/dist/formsy-react.cjs.production.min.js.map @@ -1 +1 @@ -{"version":3,"file":"formsy-react.cjs.production.min.js","sources":["../src/utils.ts","../src/validationRules.ts","../src/FormsyContext.ts","../src/withFormsy.ts","../src/Formsy.ts"],"sourcesContent":["import { isPlainObject } from 'lodash';\n\nimport { ValidationError, Validations, Values } from './interfaces';\n\nexport function isArray(value: unknown): value is unknown[] {\n return Array.isArray(value);\n}\n\nexport function isObject(value: unknown): value is object {\n return isPlainObject(value);\n}\n\nexport function isTypeUndefined(value: unknown): value is undefined {\n return typeof value === 'undefined';\n}\n\nexport function isDate(value: unknown): value is Date {\n return value instanceof Date;\n}\n\nexport function isFunction(value: unknown): value is Function {\n return value !== null && typeof value === 'function';\n}\n\nexport function isString(value: unknown): value is string {\n return typeof value === 'string';\n}\n\nexport function isNumber(value: unknown): value is number {\n return typeof value === 'number';\n}\n\nexport function isRegex(value: unknown): value is RegExp {\n return value instanceof RegExp;\n}\n\nexport function isValueStringEmpty(value: string): boolean {\n return value === '';\n}\n\nexport function isValueNullOrUndefined(value: unknown): boolean {\n return value === null || value === undefined;\n}\n\nexport function isValueUndefined(value: unknown): boolean {\n return value === undefined;\n}\n\nexport function noop() {\n // do nothing.\n}\n\nexport function protectAgainstParamReassignment(value: unknown) {\n // Clone objects to avoid accidental param reassignment\n if (isObject(value)) return { ...value };\n if (isArray(value)) return [...value];\n return value;\n}\n\nexport function isSame(a: unknown, b: unknown) {\n if (typeof a !== typeof b) {\n return false;\n }\n\n if (isArray(a) && isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n\n return a.every((item, index) => isSame(item, b[index]));\n }\n\n if (isFunction(a) && isFunction(b)) {\n return a.toString() === b.toString();\n }\n\n if (isDate(a) && isDate(b)) {\n return a.toString() === b.toString();\n }\n\n if (isObject(a) && isObject(b)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n return Object.keys(a).every((key) => isSame(a[key], b[key]));\n }\n\n if (isRegex(a) && isRegex(b)) {\n return a.toString() === b.toString();\n }\n\n return a === b;\n}\n\ninterface RulesResult {\n errors: ValidationError[];\n failed: string[];\n success: string[];\n}\n\nexport function runRules(\n value: V,\n currentValues: Values,\n validations: Validations,\n validationRules: Validations,\n) {\n const results: RulesResult = {\n errors: [],\n failed: [],\n success: [],\n };\n\n Object.keys(validations).forEach((validationName) => {\n const validationsVal = validations[validationName];\n const validationRulesVal = validationRules[validationName];\n const addToResults = (validation) => {\n if (isString(validation)) {\n results.errors.push(validation);\n results.failed.push(validationName);\n } else if (!validation) {\n results.failed.push(validationName);\n } else {\n results.success.push(validationName);\n }\n };\n\n if (validationRulesVal && isFunction(validationsVal)) {\n throw new Error(`Formsy does not allow you to override default validations: ${validationName}`);\n }\n\n if (!validationRulesVal && !isFunction(validationsVal)) {\n throw new Error(`Formsy does not have the validation rule: ${validationName}`);\n }\n\n if (isFunction(validationsVal)) {\n return addToResults(validationsVal(currentValues, value));\n }\n\n return addToResults(validationRulesVal(currentValues, value, validationsVal));\n });\n\n return results;\n}\n\nexport function throttle(callback, interval) {\n let enableCall = true;\n\n return function (...args) {\n if (!enableCall) return;\n\n enableCall = false;\n callback.apply(this, args);\n setTimeout(() => (enableCall = true), interval);\n };\n}\n","import { ValidationFunction, Values } from './interfaces';\nimport {\n isNumber,\n isString,\n isTypeUndefined,\n isValueNullOrUndefined,\n isValueStringEmpty,\n isValueUndefined,\n} from './utils';\n\nexport function isExisty(value: V) {\n return !isValueNullOrUndefined(value);\n}\n\nexport function isEmpty(value: V) {\n if (isString(value)) {\n return isValueStringEmpty(value);\n }\n if (isTypeUndefined(value)) {\n return false;\n }\n return isValueUndefined(value);\n}\n\nexport function isDefaultRequiredValue(value: unknown) {\n return isString(value) ? isValueStringEmpty(value) : isValueNullOrUndefined(value);\n}\n\nexport function matchRegexp(_values: Values, value: V, regexp: RegExp) {\n return !isExisty(value) || isEmpty(value) || regexp.test(`${value}`);\n}\n\ninterface Validations {\n [key: string]: ValidationFunction;\n}\n\nconst REGEX_PATTERNS = {\n ALPHA: /^[A-Z]+$/i,\n ALPHANUMERIC: /^[0-9A-Z]+$/i,\n EMAIL:\n /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/i, // from http://emailregex.com/\n FLOAT: /^(?:[-+]?(?:\\d+))?(?:\\.\\d*)?(?:[eE][+-]?(?:\\d+))?$/,\n INT: /^(?:[-+]?(?:0|[1-9]\\d*))$/,\n NUMERIC: /^[-+]?(?:\\d*[.])?\\d+$/,\n SPECIAL_WORDS: /^[\\sA-ZÀ-ÖØ-öø-ÿ]+$/i,\n URL: /^(?:\\w+:)?\\/\\/([^\\s.]+\\.\\S{2}|localhost[:?\\d]*)\\S*$/i,\n WORDS: /^[A-Z\\s]+$/i,\n};\n\nconst validations: Validations = {\n equals: (_values, value: V, eql: V) => !isExisty(value) || isEmpty(value) || value === eql,\n equalsField: (values, value: V, field: string) => value === values[field],\n isAlpha: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.ALPHA),\n isAlphanumeric: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.ALPHANUMERIC),\n isDefaultRequiredValue: (_values, value: V) => isDefaultRequiredValue(value),\n isEmail: (values, value: string) => matchRegexp(values, value, REGEX_PATTERNS.EMAIL),\n isEmptyString: (_values, value: string) => isEmpty(value),\n isExisty: (_values, value: V) => isExisty(value),\n isFalse: (_values, value: boolean | string) => value === false,\n isFloat: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.FLOAT),\n isInt: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.INT),\n isLength: (_values, value: string, length: number) => !isExisty(value) || isEmpty(value) || value.length === length,\n isNumeric: (values, value: V) => isNumber(value) || matchRegexp(values, value, REGEX_PATTERNS.NUMERIC),\n isSpecialWords: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.SPECIAL_WORDS),\n isTrue: (_values, value: boolean | string) => value === true,\n isUndefined: (_values, value: V) => isValueUndefined(value),\n isUrl: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.URL),\n isWords: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.WORDS),\n matchRegexp,\n maxLength: (_values, value: string, length: number) => !isExisty(value) || value.length <= length,\n minLength: (_values, value: string, length: number) => !isExisty(value) || isEmpty(value) || value.length >= length,\n};\n\nexport const addValidationRule = (name: string, func: ValidationFunction) => {\n validations[name] = func;\n};\n\nexport default validations;\n","import React from 'react';\nimport { FormsyContextInterface } from './interfaces';\n\nconst noFormsyErrorMessage = 'Could not find Formsy Context Provider. Did you use withFormsy outside ?';\n\nconst throwNoFormsyProvider = () => {\n // istanbul ignore next\n throw new Error(noFormsyErrorMessage);\n};\n\nconst defaultValue = {\n attachToForm: throwNoFormsyProvider,\n detachFromForm: throwNoFormsyProvider,\n isFormDisabled: true,\n isValidValue: throwNoFormsyProvider,\n validate: throwNoFormsyProvider,\n runValidation: throwNoFormsyProvider,\n};\n\nexport default React.createContext(defaultValue);\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport FormsyContext from './FormsyContext';\nimport {\n ComponentWithStaticAttributes,\n FormsyContextInterface,\n RequiredValidation,\n ValidationError,\n Validations,\n WrappedComponentClass,\n} from './interfaces';\n\nimport * as utils from './utils';\nimport { isString } from './utils';\nimport { isDefaultRequiredValue } from './validationRules';\n\n/* eslint-disable react/default-props-match-prop-types */\n\nconst convertValidationsToObject = (validations: false | Validations): Validations => {\n if (isString(validations)) {\n return validations.split(/,(?![^{[]*[}\\]])/g).reduce((validationsAccumulator, validation) => {\n let args: string[] = validation.split(':');\n const validateMethod: string = args.shift();\n\n args = args.map((arg) => {\n try {\n return JSON.parse(arg);\n } catch (e) {\n return arg; // It is a string if it can not parse it\n }\n });\n\n if (args.length > 1) {\n throw new Error(\n 'Formsy does not support multiple args on string validations. Use object format of validations instead.',\n );\n }\n\n // Avoid parameter reassignment\n const validationsAccumulatorCopy: Validations = { ...validationsAccumulator };\n validationsAccumulatorCopy[validateMethod] = args.length ? args[0] : true;\n return validationsAccumulatorCopy;\n }, {});\n }\n\n return validations || {};\n};\n\nexport const propTypes = {\n innerRef: PropTypes.func,\n name: PropTypes.string.isRequired,\n required: PropTypes.oneOfType([PropTypes.bool, PropTypes.object, PropTypes.string]),\n validations: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n value: PropTypes.any, // eslint-disable-line react/forbid-prop-types\n};\n\nexport interface WrapperProps {\n innerRef?: (ref: React.Ref) => void;\n name: string;\n required?: RequiredValidation;\n validationError?: ValidationError;\n validationErrors?: { [key: string]: ValidationError };\n validations?: Validations;\n value?: V;\n}\n\nexport interface WrapperState {\n [key: string]: unknown;\n\n formSubmitted: boolean;\n isPristine: boolean;\n isRequired: boolean;\n isValid: boolean;\n pristineValue: V;\n validationError: ValidationError[];\n value: V;\n}\n\nexport interface InjectedProps {\n errorMessage: ValidationError;\n errorMessages: ValidationError[];\n hasValue: boolean;\n isFormDisabled: boolean;\n isFormSubmitted: boolean;\n isPristine: boolean;\n isRequired: boolean;\n isValid: boolean;\n isValidValue: (value: V) => boolean;\n ref?: React.Ref;\n resetValue: () => void;\n setValidations: (validations: Validations, required: RequiredValidation) => void;\n setValue: (value: V, validate?: boolean) => void;\n showError: boolean;\n showRequired: boolean;\n}\n\nexport interface WrapperInstanceMethods {\n getErrorMessage: () => null | ValidationError;\n getErrorMessages: () => ValidationError[];\n getValue: () => V;\n isFormDisabled: () => boolean;\n isFormSubmitted: () => boolean;\n isValid: () => boolean;\n isValidValue: (value: V) => boolean;\n setValue: (value: V, validate?: boolean) => void;\n}\n\nexport type PassDownProps = WrapperProps & InjectedProps;\n\nfunction getDisplayName(component: WrappedComponentClass) {\n return component.displayName || component.name || (utils.isString(component) ? component : 'Component');\n}\n\nexport default function withFormsy(\n WrappedComponent: React.ComponentType>,\n): React.ComponentType, keyof InjectedProps>> {\n class WithFormsyWrapper\n extends React.Component & FormsyContextInterface, WrapperState>\n implements WrapperInstanceMethods\n {\n public validations?: Validations;\n\n public requiredValidations?: Validations;\n\n public static displayName = `Formsy(${getDisplayName(WrappedComponent)})`;\n\n public static propTypes: any = propTypes;\n\n public static defaultProps: any = {\n innerRef: null,\n required: false,\n validationError: '',\n validationErrors: {},\n validations: null,\n value: (WrappedComponent as ComponentWithStaticAttributes).defaultValue,\n };\n\n public constructor(props) {\n super(props);\n const { runValidation, validations, required, value } = props;\n\n this.state = { value } as any;\n\n this.setValidations(validations, required);\n\n this.state = {\n formSubmitted: false,\n isPristine: true,\n pristineValue: props.value,\n value: props.value,\n ...runValidation(this, props.value),\n };\n }\n\n public componentDidMount() {\n const { name, attachToForm } = this.props;\n\n if (!name) {\n throw new Error('Form Input requires a name property when used');\n }\n\n attachToForm(this);\n }\n\n public shouldComponentUpdate(nextProps, nextState) {\n const { props, state } = this;\n const isChanged = (a: object, b: object): boolean => Object.keys(a).some((k) => a[k] !== b[k]);\n const isPropsChanged = isChanged(props, nextProps);\n const isStateChanged = isChanged(state, nextState);\n\n return isPropsChanged || isStateChanged;\n }\n\n public componentDidUpdate(prevProps) {\n const { value, validations, required, validate } = this.props;\n\n // If the value passed has changed, set it. If value is not passed it will\n // internally update, and this will never run\n if (!utils.isSame(value, prevProps.value)) {\n this.setValue(value);\n }\n\n // If validations or required is changed, run a new validation\n if (!utils.isSame(validations, prevProps.validations) || !utils.isSame(required, prevProps.required)) {\n this.setValidations(validations, required);\n validate(this);\n }\n }\n\n // Detach it when component unmounts\n public componentWillUnmount() {\n const { detachFromForm } = this.props;\n detachFromForm(this);\n }\n\n public getErrorMessage = (): ValidationError | null => {\n const messages = this.getErrorMessages();\n return messages.length ? messages[0] : null;\n };\n\n public getErrorMessages = (): ValidationError[] => {\n const { validationError } = this.state;\n\n if (!this.isValid() || this.showRequired()) {\n return validationError || [];\n }\n return [];\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public getValue = (): V => this.state.value;\n\n public setValidations = (validations: Validations, required: RequiredValidation): void => {\n // Add validations to the store itself as the props object can not be modified\n this.validations = convertValidationsToObject(validations) || {};\n this.requiredValidations =\n required === true ? { isDefaultRequiredValue: required } : convertValidationsToObject(required);\n };\n\n // By default, we validate after the value has been set.\n // A user can override this and pass a second parameter of `false` to skip validation.\n public setValue = (value: V, validate = true): void => {\n const { validate: validateForm } = this.props;\n\n if (!validate) {\n this.setState({ value });\n } else {\n this.setState(\n {\n value,\n isPristine: false,\n },\n () => {\n validateForm(this);\n },\n );\n }\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public hasValue = () => {\n const { value } = this.state;\n return isDefaultRequiredValue(value);\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormDisabled = (): boolean => this.props.isFormDisabled;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormSubmitted = (): boolean => this.state.formSubmitted;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isPristine = (): boolean => this.state.isPristine;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isRequired = (): boolean => !!this.props.required;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isValid = (): boolean => this.state.isValid;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isValidValue = (value: V) => this.props.isValidValue(this, value);\n\n public resetValue = () => {\n const { pristineValue } = this.state;\n const { validate } = this.props;\n\n this.setState(\n {\n value: pristineValue,\n isPristine: true,\n },\n () => {\n validate(this);\n },\n );\n };\n\n public showError = (): boolean => !this.showRequired() && !this.isValid();\n\n // eslint-disable-next-line react/destructuring-assignment\n public showRequired = (): boolean => this.state.isRequired;\n\n public render() {\n const { innerRef } = this.props;\n const propsForElement: T & PassDownProps = {\n ...this.props,\n errorMessage: this.getErrorMessage(),\n errorMessages: this.getErrorMessages(),\n hasValue: this.hasValue(),\n isFormDisabled: this.isFormDisabled(),\n isFormSubmitted: this.isFormSubmitted(),\n isPristine: this.isPristine(),\n isRequired: this.isRequired(),\n isValid: this.isValid(),\n isValidValue: this.isValidValue,\n resetValue: this.resetValue,\n setValidations: this.setValidations,\n setValue: this.setValue,\n showError: this.showError(),\n showRequired: this.showRequired(),\n value: this.getValue(),\n };\n\n if (innerRef) {\n propsForElement.ref = innerRef;\n }\n\n return React.createElement(WrappedComponent, propsForElement);\n }\n }\n\n // eslint-disable-next-line react/display-name\n return (props) =>\n React.createElement(FormsyContext.Consumer, null, (contextValue) => {\n return React.createElement(WithFormsyWrapper, { ...props, ...contextValue });\n });\n}\n","/* eslint-disable react/no-unused-state, react/default-props-match-prop-types */\nimport { get, has, set } from 'lodash';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport FormsyContext from './FormsyContext';\nimport {\n FormsyContextInterface,\n IModel,\n InputComponent,\n IResetModel,\n IUpdateInputsWithError,\n IUpdateInputsWithValue,\n ValidationError,\n} from './interfaces';\nimport { throttle, isObject, isString } from './utils';\nimport * as utils from './utils';\nimport validationRules from './validationRules';\nimport { PassDownProps } from './withFormsy';\n\ntype FormHTMLAttributesCleaned = Omit, 'onChange' | 'onSubmit'>;\n\ntype OnSubmitCallback = (\n model: IModel,\n resetModel: IResetModel,\n updateInputsWithError: IUpdateInputsWithError,\n event: React.SyntheticEvent>,\n) => void;\n\ntype FormElementType =\n | string\n | React.ComponentType<{\n onReset?: (e: React.SyntheticEvent) => void;\n onSubmit?: (e: React.SyntheticEvent) => void;\n disabled?: boolean;\n children?: React.ReactChildren;\n }>;\n\nexport interface FormsyProps extends FormHTMLAttributesCleaned {\n disabled: boolean;\n mapping: null | ((model: IModel) => IModel);\n onChange: (model: IModel, isChanged: boolean) => void;\n onInvalid: () => void;\n onReset?: () => void;\n onSubmit?: OnSubmitCallback;\n onValidSubmit?: OnSubmitCallback;\n onInvalidSubmit: OnSubmitCallback;\n onValid: () => void;\n preventDefaultSubmit?: boolean;\n preventExternalInvalidation?: boolean;\n validationErrors?: null | object;\n formElement?: FormElementType;\n}\n\nexport interface FormsyState {\n canChange: boolean;\n contextValue: FormsyContextInterface;\n formSubmitted?: boolean;\n isPristine?: boolean;\n isSubmitting: boolean;\n isValid: boolean;\n}\n\nconst ONE_RENDER_FRAME = 66;\n\nexport class Formsy extends React.Component {\n public inputs: InstanceType>[];\n\n public emptyArray: any[];\n\n public prevInputNames: any[] | null = null;\n\n public static displayName = 'Formsy';\n\n public static propTypes = {\n disabled: PropTypes.bool,\n mapping: PropTypes.func,\n formElement: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]),\n onChange: PropTypes.func,\n onInvalid: PropTypes.func,\n onInvalidSubmit: PropTypes.func,\n onReset: PropTypes.func,\n onSubmit: PropTypes.func,\n onValid: PropTypes.func,\n onValidSubmit: PropTypes.func,\n preventDefaultSubmit: PropTypes.bool,\n preventExternalInvalidation: PropTypes.bool,\n validationErrors: PropTypes.object, // eslint-disable-line\n };\n\n public static defaultProps: Partial = {\n disabled: false,\n mapping: null,\n onChange: utils.noop,\n onInvalid: utils.noop,\n onInvalidSubmit: utils.noop,\n onReset: utils.noop,\n onSubmit: utils.noop,\n onValid: utils.noop,\n onValidSubmit: utils.noop,\n preventDefaultSubmit: true,\n preventExternalInvalidation: false,\n validationErrors: {},\n formElement: 'form',\n };\n\n private readonly throttledValidateForm: () => void;\n\n public constructor(props: FormsyProps) {\n super(props);\n this.state = {\n canChange: false,\n isSubmitting: false,\n isValid: true,\n contextValue: {\n attachToForm: this.attachToForm,\n detachFromForm: this.detachFromForm,\n isFormDisabled: props.disabled,\n isValidValue: this.isValidValue,\n validate: this.validate,\n runValidation: this.runValidation,\n },\n };\n this.inputs = [];\n this.emptyArray = [];\n this.throttledValidateForm = throttle(this.validateForm, ONE_RENDER_FRAME);\n }\n\n public componentDidMount = () => {\n this.prevInputNames = this.inputs.map((component) => component.props.name);\n this.validateForm();\n };\n\n public componentDidUpdate = (prevProps: FormsyProps) => {\n const { validationErrors, disabled } = this.props;\n\n if (validationErrors && isObject(validationErrors) && Object.keys(validationErrors).length > 0) {\n this.setInputValidationErrors(validationErrors);\n }\n\n const newInputNames = this.inputs.map((component) => component.props.name);\n if (this.prevInputNames && !utils.isSame(this.prevInputNames, newInputNames)) {\n this.prevInputNames = newInputNames;\n this.validateForm();\n }\n\n // Keep the disabled value in state/context the same as from props\n if (disabled !== prevProps.disabled) {\n // eslint-disable-next-line\n this.setState((state) => ({\n ...state,\n contextValue: {\n ...state.contextValue,\n isFormDisabled: disabled,\n },\n }));\n }\n };\n\n public getCurrentValues = () =>\n this.inputs.reduce((valueAccumulator, component) => {\n const {\n props: { name },\n state: { value },\n } = component;\n // eslint-disable-next-line no-param-reassign\n valueAccumulator[name] = utils.protectAgainstParamReassignment(value);\n return valueAccumulator;\n }, {});\n\n public getModel = () => {\n const currentValues = this.getCurrentValues();\n return this.mapModel(currentValues);\n };\n\n public getPristineValues = () =>\n this.inputs.reduce((valueAccumulator, component) => {\n const {\n props: { name, value },\n } = component;\n // eslint-disable-next-line no-param-reassign\n valueAccumulator[name] = utils.protectAgainstParamReassignment(value);\n return valueAccumulator;\n }, {});\n\n public setFormPristine = (isPristine: boolean) => {\n this.setState({\n formSubmitted: !isPristine,\n });\n\n // Iterate through each component and set it as pristine\n // or \"dirty\".\n this.inputs.forEach((component) => {\n component.setState({\n formSubmitted: !isPristine,\n isPristine,\n });\n });\n };\n\n public setInputValidationErrors = (errors) => {\n const { preventExternalInvalidation } = this.props;\n const { isValid } = this.state;\n\n this.inputs.forEach((component) => {\n const { name } = component.props;\n component.setState({\n isValid: !(name in errors),\n validationError: isString(errors[name]) ? [errors[name]] : errors[name],\n });\n });\n if (!preventExternalInvalidation && isValid) {\n this.setFormValidState(false);\n }\n };\n\n public setFormValidState = (allIsValid: boolean) => {\n const { onValid, onInvalid } = this.props;\n\n this.setState({\n isValid: allIsValid,\n });\n\n if (allIsValid) {\n onValid();\n } else {\n onInvalid();\n }\n };\n\n public isValidValue = (component, value) => this.runValidation(component, value).isValid;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormDisabled = () => this.props.disabled;\n\n public mapModel = (model: IModel): IModel => {\n const { mapping } = this.props;\n\n if (mapping) {\n return mapping(model);\n }\n\n const returnModel = {};\n Object.keys(model).forEach((key) => {\n set(returnModel, key, model[key]);\n });\n return returnModel;\n };\n\n public reset = (model?: IModel) => {\n this.setFormPristine(true);\n this.resetModel(model);\n };\n\n private resetInternal = (event) => {\n const { onReset } = this.props;\n\n event.preventDefault();\n this.reset();\n if (onReset) {\n onReset();\n }\n };\n\n // Reset each key in the model to the original / initial / specified value\n private resetModel: IResetModel = (data) => {\n this.inputs.forEach((component) => {\n const { name } = component.props;\n if (data && has(data, name)) {\n component.setValue(get(data, name));\n } else {\n component.resetValue();\n }\n });\n this.validateForm();\n };\n\n // Checks validation on current value or a passed value\n public runValidation = (\n component: InputComponent,\n value = component.state.value,\n ): { isRequired: boolean; isValid: boolean; validationError: ValidationError[] } => {\n const { validationErrors } = this.props;\n const { validationError, validationErrors: componentValidationErrors, name } = component.props;\n const currentValues = this.getCurrentValues();\n const validationResults = utils.runRules(value, currentValues, component.validations, validationRules);\n const requiredResults = utils.runRules(value, currentValues, component.requiredValidations, validationRules);\n const isRequired = Object.keys(component.requiredValidations).length ? !!requiredResults.success.length : false;\n const isValid = !validationResults.failed.length && !(validationErrors && validationErrors[component.props.name]);\n\n return {\n isRequired,\n isValid: isRequired ? false : isValid,\n validationError: (() => {\n if (isValid && !isRequired) {\n return this.emptyArray;\n }\n\n if (validationResults.errors.length) {\n return validationResults.errors;\n }\n\n if (validationErrors && validationErrors[name]) {\n return isString(validationErrors[name]) ? [validationErrors[name]] : validationErrors[name];\n }\n\n if (isRequired) {\n const error = componentValidationErrors[requiredResults.success[0]] || validationError;\n return error ? [error] : null;\n }\n\n if (validationResults.failed.length) {\n return validationResults.failed\n .map((failed) => (componentValidationErrors[failed] ? componentValidationErrors[failed] : validationError))\n .filter((x, pos, arr) => arr.indexOf(x) === pos); // remove duplicates\n }\n\n // This line is not reachable\n // istanbul ignore next\n return undefined;\n })(),\n };\n };\n\n // Method put on each input component to register\n // itself to the form\n public attachToForm = (component) => {\n if (this.inputs.indexOf(component) === -1) {\n this.inputs.push(component);\n }\n\n const { onChange } = this.props;\n const { canChange } = this.state;\n\n // Trigger onChange\n if (canChange) {\n onChange(this.getModel(), this.isChanged());\n }\n\n // Will be triggered immediately & every one frame rate\n this.throttledValidateForm();\n };\n\n // Method put on each input component to unregister\n // itself from the form\n public detachFromForm = (component: InputComponent) => {\n const componentPos = this.inputs.indexOf(component);\n\n if (componentPos !== -1) {\n this.inputs = this.inputs.slice(0, componentPos).concat(this.inputs.slice(componentPos + 1));\n }\n\n this.validateForm();\n };\n\n // Checks if the values have changed from their initial value\n public isChanged = () => !utils.isSame(this.getPristineValues(), this.getCurrentValues());\n\n // Update model, submit to url prop and send the model\n public submit = (event?: React.SyntheticEvent) => {\n const { onSubmit, onValidSubmit, onInvalidSubmit, preventDefaultSubmit } = this.props;\n const { isValid } = this.state;\n\n if (preventDefaultSubmit && event && event.preventDefault) {\n event.preventDefault();\n }\n\n // Trigger form as not pristine.\n // If any inputs have not been touched yet this will make them dirty\n // so validation becomes visible (if based on isPristine)\n this.setFormPristine(false);\n const model = this.getModel();\n onSubmit(model, this.resetModel, this.updateInputsWithError, event);\n\n if (isValid) {\n onValidSubmit(model, this.resetModel, this.updateInputsWithError, event);\n } else {\n onInvalidSubmit(model, this.resetModel, this.updateInputsWithError, event);\n }\n };\n\n // Go through errors from server and grab the components\n // stored in the inputs map. Change their state to invalid\n // and set the serverError message\n public updateInputsWithError: IUpdateInputsWithError = (errors, invalidate) => {\n const { preventExternalInvalidation } = this.props;\n const { isValid } = this.state;\n\n Object.entries(errors).forEach(([name, error]) => {\n const component = this.inputs.find((input) => input.props.name === name);\n if (!component) {\n throw new Error(\n `You are trying to update an input that does not exist. Verify errors object with input names. ${JSON.stringify(\n errors,\n )}`,\n );\n }\n component.setState({\n isValid: preventExternalInvalidation,\n validationError: utils.isString(error) ? [error] : error,\n });\n });\n\n if (invalidate && isValid) {\n this.setFormValidState(false);\n }\n };\n\n // Set the value of components\n public updateInputsWithValue: IUpdateInputsWithValue = (data, validate) => {\n this.inputs.forEach((component) => {\n const { name } = component.props;\n if (data && has(data, name)) {\n component.setValue(get(data, name), validate);\n }\n });\n };\n\n // Use the binded values and the actual input value to\n // validate the input and set its state. Then check the\n // state of the form itself\n public validate = (component: InputComponent) => {\n const { onChange } = this.props;\n const { canChange } = this.state;\n\n // Trigger onChange\n if (canChange) {\n onChange(this.getModel(), this.isChanged());\n }\n\n const validationState = this.runValidation(component);\n // Run through the validations, split them up and call\n // the validator IF there is a value or it is required\n component.setState(validationState, this.validateForm);\n };\n\n // Validate the form by going through all child input components\n // and check their state\n public validateForm = () => {\n // We need a callback as we are validating all inputs again. This will\n // run when the last component has set its state\n const onValidationComplete = () => {\n const allIsValid = this.inputs.every((component) => component.state.isValid);\n\n this.setFormValidState(allIsValid);\n\n // Tell the form that it can start to trigger change events\n this.setState({\n canChange: true,\n });\n };\n\n // Run validation again in case affected by other inputs. The\n // last component validated will run the onValidationComplete callback\n this.inputs.forEach((component, index) => {\n const validationState = this.runValidation(component);\n const isFinalInput = index === this.inputs.length - 1;\n const callback = isFinalInput ? onValidationComplete : null;\n component.setState(validationState, callback);\n });\n\n // If there are no inputs, set state where form is ready to trigger\n // change event. New inputs might be added later\n if (!this.inputs.length) {\n this.setState(\n {\n canChange: true,\n },\n onValidationComplete,\n );\n }\n };\n\n public render() {\n const {\n /* eslint-disable @typescript-eslint/no-unused-vars */\n children,\n mapping,\n onChange,\n onInvalid,\n onInvalidSubmit,\n onReset,\n onSubmit,\n onValid,\n onValidSubmit,\n preventDefaultSubmit,\n preventExternalInvalidation,\n validationErrors,\n disabled,\n formElement,\n ...nonFormsyProps\n } = this.props;\n const { contextValue } = this.state;\n\n return React.createElement(\n FormsyContext.Provider,\n {\n value: contextValue,\n },\n React.createElement(\n formElement,\n {\n onReset: this.resetInternal,\n onSubmit: this.submit,\n ...nonFormsyProps,\n disabled,\n },\n children,\n ),\n );\n }\n}\n"],"names":["isArray","value","Array","isObject","isPlainObject","isDate","Date","isFunction","isString","isRegex","RegExp","isValueStringEmpty","isValueNullOrUndefined","isValueUndefined","undefined","noop","protectAgainstParamReassignment","isSame","a","b","length","every","item","index","toString","Object","keys","key","runRules","currentValues","validations","validationRules","results","errors","failed","success","forEach","validationName","validationsVal","validationRulesVal","addToResults","validation","push","Error","isExisty","isEmpty","isTypeUndefined","isDefaultRequiredValue","matchRegexp","_values","regexp","test","REGEX_PATTERNS","equals","eql","equalsField","values","field","isAlpha","isAlphanumeric","isEmail","isEmptyString","isFalse","isFloat","isInt","isLength","isNumeric","isNumber","isSpecialWords","isTrue","isUndefined","isUrl","isWords","maxLength","minLength","throwNoFormsyProvider","React","createContext","attachToForm","detachFromForm","isFormDisabled","isValidValue","validate","runValidation","convertValidationsToObject","split","reduce","validationsAccumulator","args","validateMethod","shift","map","arg","JSON","parse","e","validationsAccumulatorCopy","propTypes","innerRef","PropTypes","func","name","string","isRequired","required","oneOfType","bool","object","any","Formsy","props","callback","enableCall","prevInputNames","_this","inputs","component","validateForm","prevProps","validationErrors","disabled","setInputValidationErrors","newInputNames","utils","setState","state","contextValue","valueAccumulator","getCurrentValues","mapModel","isPristine","formSubmitted","preventExternalInvalidation","isValid","validationError","setFormValidState","allIsValid","onValid","onInvalid","model","mapping","returnModel","set","setFormPristine","resetModel","event","onReset","preventDefault","reset","data","has","setValue","get","resetValue","componentValidationErrors","validationResults","requiredResults","requiredValidations","emptyArray","error","filter","x","pos","arr","indexOf","canChange","onChange","getModel","isChanged","throttledValidateForm","componentPos","slice","concat","getPristineValues","onSubmit","onValidSubmit","onInvalidSubmit","preventDefaultSubmit","updateInputsWithError","invalidate","entries","find","input","stringify","validationState","onValidationComplete","isSubmitting","apply","this","setTimeout","render","children","formElement","nonFormsyProps","createElement","FormsyContext","Provider","resetInternal","submit","Component","WrappedComponent","WithFormsyWrapper","messages","getErrorMessages","showRequired","pristineValue","setValidations","componentDidMount","shouldComponentUpdate","nextProps","nextState","some","k","isPropsChanged","isStateChanged","componentDidUpdate","componentWillUnmount","propsForElement","errorMessage","getErrorMessage","errorMessages","hasValue","isFormSubmitted","showError","getValue","ref","displayName","defaultValue","Consumer"],"mappings":"qoBAIgBA,EAAQC,UACfC,MAAMF,QAAQC,YAGPE,EAASF,UAChBG,gBAAcH,YAOPI,EAAOJ,UACdA,aAAiBK,cAGVC,EAAWN,UACR,OAAVA,GAAmC,mBAAVA,WAGlBO,EAASP,SACC,iBAAVA,WAOAQ,EAAQR,UACfA,aAAiBS,gBAGVC,EAAmBV,SAChB,KAAVA,WAGOW,EAAuBX,UAC9BA,MAAAA,WAGOY,EAAiBZ,eACda,IAAVb,WAGOc,cAIAC,EAAgCf,UAE1CE,EAASF,QAAoBA,GAC7BD,EAAQC,aAAmBA,GACxBA,WAGOgB,EAAOC,EAAYC,iBACtBD,UAAaC,IAIpBnB,EAAQkB,IAAMlB,EAAQmB,GACpBD,EAAEE,SAAWD,EAAEC,QAIZF,EAAEG,OAAM,SAACC,EAAMC,UAA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YAAa0E,IAAAA,SAAUtB,IAAAA,SAIjCyC,EAAa1H,EAAOqH,EAAUrH,aAC5BsJ,SAAStJ,GAIX0H,EAAa7F,EAAawF,EAAUxF,cAAiB6F,EAAanB,EAAUc,EAAUd,iBACpFsG,eAAehL,EAAa0E,GACjCtB,EAAS0G,UAKN4B,qBAAA,YAELzI,EAD2B6G,KAAK9E,MAAxB/B,gBACO6G,SA2FVE,OAAA,eACG5F,EAAa0F,KAAK9E,MAAlBZ,SACFuH,OACD7B,KAAK9E,OACR4G,aAAc9B,KAAK+B,kBACnBC,cAAehC,KAAKe,mBACpBkB,SAAUjC,KAAKiC,WACf7I,eAAgB4G,KAAK5G,iBACrB8I,gBAAiBlC,KAAKkC,kBACtB5F,WAAY0D,KAAK1D,aACjB3B,WAAYqF,KAAKrF,aACjB8B,QAASuD,KAAKvD,UACdpD,aAAc2G,KAAK3G,aACnBwE,WAAYmC,KAAKnC,WACjBqD,eAAgBlB,KAAKkB,eACrBvD,SAAUqC,KAAKrC,SACfwE,UAAWnC,KAAKmC,YAChBnB,aAAchB,KAAKgB,eACnB3M,MAAO2L,KAAKoC,oBAGV9H,IACFuH,EAAgBQ,IAAM/H,GAGjBtB,EAAMsH,cAAcM,EAAkBiB,OA/LvC7I,EAAM2H,kBAOAE,0BAfMrF,EAeiCoF,GAdtC0B,aAAe9G,EAAUf,OAASsB,EAAeP,GAAaA,EAAY,kBAgB3EqF,YAAiBxG,EAEjBwG,eAAoB,CAChCvG,SAAU,KACVM,UAAU,EACV8B,gBAAiB,GACjBf,iBAAkB,GAClBzF,YAAa,KACb7B,MAAQuM,EAAmD2B,cAmLxD,SAACrH,UACNlC,EAAMsH,cAAcC,EAAciC,SAAU,MAAM,SAACtG,UAC1ClD,EAAMsH,cAAcO,OAAwB3F,EAAUgB"} \ No newline at end of file +{"version":3,"file":"formsy-react.cjs.production.min.js","sources":["../src/utils.ts","../src/validationRules.ts","../src/FormsyContext.ts","../src/withFormsy.ts","../src/Formsy.ts"],"sourcesContent":["import { isPlainObject } from 'lodash';\n\nimport { ValidationError, Validations, Values } from './interfaces';\n\nexport function isArray(value: unknown): value is unknown[] {\n return Array.isArray(value);\n}\n\nexport function isObject(value: unknown): value is object {\n return isPlainObject(value);\n}\n\nexport function isTypeUndefined(value: unknown): value is undefined {\n return typeof value === 'undefined';\n}\n\nexport function isDate(value: unknown): value is Date {\n return value instanceof Date;\n}\n\nexport function isFunction(value: unknown): value is Function {\n return value !== null && typeof value === 'function';\n}\n\nexport function isString(value: unknown): value is string {\n return typeof value === 'string';\n}\n\nexport function isNumber(value: unknown): value is number {\n return typeof value === 'number';\n}\n\nexport function isRegex(value: unknown): value is RegExp {\n return value instanceof RegExp;\n}\n\nexport function isValueStringEmpty(value: string): boolean {\n return value === '';\n}\n\nexport function isValueNullOrUndefined(value: unknown): boolean {\n return value === null || value === undefined;\n}\n\nexport function isValueUndefined(value: unknown): boolean {\n return value === undefined;\n}\n\nexport function noop() {\n // do nothing.\n}\n\nexport function protectAgainstParamReassignment(value: unknown) {\n // Clone objects to avoid accidental param reassignment\n if (isObject(value)) return { ...value };\n if (isArray(value)) return [...value];\n return value;\n}\n\nexport function isSame(a: unknown, b: unknown) {\n if (typeof a !== typeof b) {\n return false;\n }\n\n if (isArray(a) && isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n\n return a.every((item, index) => isSame(item, b[index]));\n }\n\n if (isFunction(a) && isFunction(b)) {\n return a.toString() === b.toString();\n }\n\n if (isDate(a) && isDate(b)) {\n return a.toString() === b.toString();\n }\n\n if (isObject(a) && isObject(b)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n return Object.keys(a).every((key) => isSame(a[key], b[key]));\n }\n\n if (isRegex(a) && isRegex(b)) {\n return a.toString() === b.toString();\n }\n\n return a === b;\n}\n\ninterface RulesResult {\n errors: ValidationError[];\n failed: string[];\n success: string[];\n}\n\nexport function runRules(\n value: V,\n currentValues: Values,\n validations: Validations,\n validationRules: Validations,\n) {\n const results: RulesResult = {\n errors: [],\n failed: [],\n success: [],\n };\n\n Object.keys(validations).forEach((validationName) => {\n const validationsVal = validations[validationName];\n const validationRulesVal = validationRules[validationName];\n const addToResults = (validation) => {\n if (isString(validation)) {\n results.errors.push(validation);\n results.failed.push(validationName);\n } else if (!validation) {\n results.failed.push(validationName);\n } else {\n results.success.push(validationName);\n }\n };\n\n if (validationRulesVal && isFunction(validationsVal)) {\n throw new Error(`Formsy does not allow you to override default validations: ${validationName}`);\n }\n\n if (!validationRulesVal && !isFunction(validationsVal)) {\n throw new Error(`Formsy does not have the validation rule: ${validationName}`);\n }\n\n if (isFunction(validationsVal)) {\n return addToResults(validationsVal(currentValues, value));\n }\n\n return addToResults(validationRulesVal(currentValues, value, validationsVal));\n });\n\n return results;\n}\n\nexport function throttle(callback, interval) {\n let enableCall = true;\n\n return function (...args) {\n if (!enableCall) return;\n\n enableCall = false;\n callback.apply(this, args);\n setTimeout(() => (enableCall = true), interval);\n };\n}\n","import { ValidationFunction, Values } from './interfaces';\nimport {\n isNumber,\n isString,\n isTypeUndefined,\n isValueNullOrUndefined,\n isValueStringEmpty,\n isValueUndefined,\n} from './utils';\n\nexport function isExisty(value: V) {\n return !isValueNullOrUndefined(value);\n}\n\nexport function isEmpty(value: V) {\n if (isString(value)) {\n return isValueStringEmpty(value);\n }\n if (isTypeUndefined(value)) {\n return false;\n }\n return isValueUndefined(value);\n}\n\nexport function isDefaultRequiredValue(value: unknown) {\n return isString(value) ? isValueStringEmpty(value) : isValueNullOrUndefined(value);\n}\n\nexport function matchRegexp(_values: Values, value: V, regexp: RegExp) {\n return !isExisty(value) || isEmpty(value) || regexp.test(`${value}`);\n}\n\ninterface Validations {\n [key: string]: ValidationFunction;\n}\n\nconst REGEX_PATTERNS = {\n ALPHA: /^[A-Z]+$/i,\n ALPHANUMERIC: /^[0-9A-Z]+$/i,\n EMAIL:\n /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/i, // from http://emailregex.com/\n FLOAT: /^(?:[-+]?(?:\\d+))?(?:\\.\\d*)?(?:[eE][+-]?(?:\\d+))?$/,\n INT: /^(?:[-+]?(?:0|[1-9]\\d*))$/,\n NUMERIC: /^[-+]?(?:\\d*[.])?\\d+$/,\n SPECIAL_WORDS: /^[\\sA-ZÀ-ÖØ-öø-ÿ]+$/i,\n URL: /^(?:\\w+:)?\\/\\/([^\\s.]+\\.\\S{2}|localhost[:?\\d]*)\\S*$/i,\n WORDS: /^[A-Z\\s]+$/i,\n};\n\nconst validations: Validations = {\n equals: (_values, value: V, eql: V) => !isExisty(value) || isEmpty(value) || value === eql,\n equalsField: (values, value: V, field: string) => value === values[field],\n isAlpha: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.ALPHA),\n isAlphanumeric: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.ALPHANUMERIC),\n isDefaultRequiredValue: (_values, value: V) => isDefaultRequiredValue(value),\n isEmail: (values, value: string) => matchRegexp(values, value, REGEX_PATTERNS.EMAIL),\n isEmptyString: (_values, value: string) => isEmpty(value),\n isExisty: (_values, value: V) => isExisty(value),\n isFalse: (_values, value: boolean | string) => value === false,\n isFloat: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.FLOAT),\n isInt: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.INT),\n isLength: (_values, value: string, length: number) => !isExisty(value) || isEmpty(value) || value.length === length,\n isNumeric: (values, value: V) => isNumber(value) || matchRegexp(values, value, REGEX_PATTERNS.NUMERIC),\n isSpecialWords: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.SPECIAL_WORDS),\n isTrue: (_values, value: boolean | string) => value === true,\n isUndefined: (_values, value: V) => isValueUndefined(value),\n isUrl: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.URL),\n isWords: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.WORDS),\n matchRegexp,\n maxLength: (_values, value: string, length: number) => !isExisty(value) || value.length <= length,\n minLength: (_values, value: string, length: number) => !isExisty(value) || isEmpty(value) || value.length >= length,\n};\n\nexport const addValidationRule = (name: string, func: ValidationFunction) => {\n validations[name] = func;\n};\n\nexport default validations;\n","import React from 'react';\nimport { FormsyContextInterface } from './interfaces';\n\nconst noFormsyErrorMessage = 'Could not find Formsy Context Provider. Did you use withFormsy outside ?';\n\nconst throwNoFormsyProvider = () => {\n // istanbul ignore next\n throw new Error(noFormsyErrorMessage);\n};\n\nconst defaultValue = {\n attachToForm: throwNoFormsyProvider,\n detachFromForm: throwNoFormsyProvider,\n isFormDisabled: true,\n isValidValue: throwNoFormsyProvider,\n validate: throwNoFormsyProvider,\n runValidation: throwNoFormsyProvider,\n};\n\nexport default React.createContext(defaultValue);\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport FormsyContext from './FormsyContext';\nimport {\n ComponentWithStaticAttributes,\n FormsyContextInterface,\n RequiredValidation,\n ValidationError,\n Validations,\n WrappedComponentClass,\n} from './interfaces';\n\nimport * as utils from './utils';\nimport { isString } from './utils';\nimport { isDefaultRequiredValue } from './validationRules';\n\n/* eslint-disable react/default-props-match-prop-types */\n\nconst convertValidationsToObject = (validations: false | Validations): Validations => {\n if (isString(validations)) {\n return validations.split(/,(?![^{[]*[}\\]])/g).reduce((validationsAccumulator, validation) => {\n let args: string[] = validation.split(':');\n const validateMethod: string = args.shift();\n\n args = args.map((arg) => {\n try {\n return JSON.parse(arg);\n } catch (e) {\n return arg; // It is a string if it can not parse it\n }\n });\n\n if (args.length > 1) {\n throw new Error(\n 'Formsy does not support multiple args on string validations. Use object format of validations instead.',\n );\n }\n\n // Avoid parameter reassignment\n const validationsAccumulatorCopy: Validations = { ...validationsAccumulator };\n validationsAccumulatorCopy[validateMethod] = args.length ? args[0] : true;\n return validationsAccumulatorCopy;\n }, {});\n }\n\n return validations || {};\n};\n\nexport const propTypes = {\n innerRef: PropTypes.func,\n name: PropTypes.string.isRequired,\n required: PropTypes.oneOfType([PropTypes.bool, PropTypes.object, PropTypes.string]),\n validations: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n value: PropTypes.any, // eslint-disable-line react/forbid-prop-types\n};\n\nexport interface WrapperProps {\n innerRef?: (ref: React.Ref) => void;\n name: string;\n required?: RequiredValidation;\n validationError?: ValidationError;\n validationErrors?: { [key: string]: ValidationError };\n validations?: Validations;\n value?: V;\n}\n\nexport interface WrapperState {\n [key: string]: unknown;\n\n formSubmitted: boolean;\n isPristine: boolean;\n isRequired: boolean;\n isValid: boolean;\n pristineValue: V;\n validationError: ValidationError[];\n value: V;\n}\n\nexport interface InjectedProps {\n errorMessage: ValidationError;\n errorMessages: ValidationError[];\n hasValue: boolean;\n isFormDisabled: boolean;\n isFormSubmitted: boolean;\n isPristine: boolean;\n isRequired: boolean;\n isValid: boolean;\n isValidValue: (value: V) => boolean;\n ref?: React.Ref;\n resetValue: () => void;\n setValidations: (validations: Validations, required: RequiredValidation) => void;\n setValue: (value: V, validate?: boolean) => void;\n showError: boolean;\n showRequired: boolean;\n}\n\nexport interface WrapperInstanceMethods {\n getErrorMessage: () => null | ValidationError;\n getErrorMessages: () => ValidationError[];\n getValue: () => V;\n isFormDisabled: () => boolean;\n isFormSubmitted: () => boolean;\n isValid: () => boolean;\n isValidValue: (value: V) => boolean;\n setValue: (value: V, validate?: boolean) => void;\n}\n\nexport type PassDownProps = WrapperProps & InjectedProps;\n\nfunction getDisplayName(component: WrappedComponentClass) {\n return component.displayName || component.name || (utils.isString(component) ? component : 'Component');\n}\n\nexport default function withFormsy(\n WrappedComponent: React.ComponentType>,\n): React.ComponentType, keyof InjectedProps>> {\n class WithFormsyWrapper\n extends React.Component & FormsyContextInterface, WrapperState>\n implements WrapperInstanceMethods\n {\n public validations?: Validations;\n\n public requiredValidations?: Validations;\n\n public static displayName = `Formsy(${getDisplayName(WrappedComponent)})`;\n\n public static propTypes: any = propTypes;\n\n public static defaultProps: any = {\n innerRef: null,\n required: false,\n validationError: '',\n validationErrors: {},\n validations: null,\n value: (WrappedComponent as ComponentWithStaticAttributes).defaultValue,\n };\n\n public constructor(props) {\n super(props);\n const { runValidation, validations, required, value } = props;\n\n this.state = { value } as any;\n\n this.setValidations(validations, required);\n\n this.state = {\n formSubmitted: false,\n isPristine: true,\n pristineValue: props.value,\n value: props.value,\n ...runValidation(this, props.value),\n };\n }\n\n public componentDidMount() {\n const { name, attachToForm } = this.props;\n\n if (!name) {\n throw new Error('Form Input requires a name property when used');\n }\n\n attachToForm(this);\n }\n\n public shouldComponentUpdate(nextProps, nextState) {\n const { props, state } = this;\n const isChanged = (a: object, b: object): boolean => Object.keys(a).some((k) => a[k] !== b[k]);\n const isPropsChanged = isChanged(props, nextProps);\n const isStateChanged = isChanged(state, nextState);\n\n return isPropsChanged || isStateChanged;\n }\n\n public componentDidUpdate(prevProps) {\n const { value, validations, required, validate } = this.props;\n\n // If the value passed has changed, set it. If value is not passed it will\n // internally update, and this will never run\n if (!utils.isSame(value, prevProps.value)) {\n this.setValue(value);\n }\n\n // If validations or required is changed, run a new validation\n if (!utils.isSame(validations, prevProps.validations) || !utils.isSame(required, prevProps.required)) {\n this.setValidations(validations, required);\n validate(this);\n }\n }\n\n // Detach it when component unmounts\n public componentWillUnmount() {\n const { detachFromForm } = this.props;\n detachFromForm(this);\n }\n\n public getErrorMessage = (): ValidationError | null => {\n const messages = this.getErrorMessages();\n return messages.length ? messages[0] : null;\n };\n\n public getErrorMessages = (): ValidationError[] => {\n const { validationError } = this.state;\n\n if (!this.isValid() || this.showRequired()) {\n return validationError || [];\n }\n return [];\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public getValue = (): V => this.state.value;\n\n public setValidations = (validations: Validations, required: RequiredValidation): void => {\n // Add validations to the store itself as the props object can not be modified\n this.validations = convertValidationsToObject(validations) || {};\n this.requiredValidations =\n required === true ? { isDefaultRequiredValue: required } : convertValidationsToObject(required);\n };\n\n // By default, we validate after the value has been set.\n // A user can override this and pass a second parameter of `false` to skip validation.\n public setValue = (value: V, validate = true): void => {\n const { validate: validateForm } = this.props;\n\n if (!validate) {\n this.setState({ value });\n } else {\n this.setState(\n {\n value,\n isPristine: false,\n },\n () => {\n validateForm(this);\n },\n );\n }\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public hasValue = () => {\n const { value } = this.state;\n return isDefaultRequiredValue(value);\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormDisabled = (): boolean => this.props.isFormDisabled;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormSubmitted = (): boolean => this.state.formSubmitted;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isPristine = (): boolean => this.state.isPristine;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isRequired = (): boolean => !!this.props.required;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isValid = (): boolean => this.state.isValid;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isValidValue = (value: V) => this.props.isValidValue(this, value);\n\n public resetValue = () => {\n const { pristineValue } = this.state;\n const { validate } = this.props;\n\n this.setState(\n {\n value: pristineValue,\n isPristine: true,\n },\n () => {\n validate(this);\n },\n );\n };\n\n public showError = (): boolean => !this.showRequired() && !this.isValid();\n\n // eslint-disable-next-line react/destructuring-assignment\n public showRequired = (): boolean => this.state.isRequired;\n\n public render() {\n const { innerRef } = this.props;\n const propsForElement: T & PassDownProps = {\n ...this.props,\n errorMessage: this.getErrorMessage(),\n errorMessages: this.getErrorMessages(),\n hasValue: this.hasValue(),\n isFormDisabled: this.isFormDisabled(),\n isFormSubmitted: this.isFormSubmitted(),\n isPristine: this.isPristine(),\n isRequired: this.isRequired(),\n isValid: this.isValid(),\n isValidValue: this.isValidValue,\n resetValue: this.resetValue,\n setValidations: this.setValidations,\n setValue: this.setValue,\n showError: this.showError(),\n showRequired: this.showRequired(),\n value: this.getValue(),\n };\n\n if (innerRef) {\n propsForElement.ref = innerRef;\n }\n\n return React.createElement(WrappedComponent, propsForElement);\n }\n }\n\n // eslint-disable-next-line react/display-name\n return (props) =>\n React.createElement(FormsyContext.Consumer, null, (contextValue) => {\n return React.createElement(WithFormsyWrapper, { ...props, ...contextValue });\n });\n}\n","/* eslint-disable react/no-unused-state, react/default-props-match-prop-types */\nimport { get, has, set } from 'lodash';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport FormsyContext from './FormsyContext';\nimport {\n FormsyContextInterface,\n IModel,\n InputComponent,\n IResetModel,\n IUpdateInputsWithError,\n IUpdateInputsWithValue,\n ValidationError,\n} from './interfaces';\nimport { throttle, isObject, isString } from './utils';\nimport * as utils from './utils';\nimport validationRules from './validationRules';\nimport { PassDownProps } from './withFormsy';\n\ntype FormHTMLAttributesCleaned = Omit, 'onChange' | 'onSubmit'>;\n\ntype OnSubmitCallback = (\n model: IModel,\n resetModel: IResetModel,\n updateInputsWithError: IUpdateInputsWithError,\n event: React.SyntheticEvent,\n) => void;\n\ntype FormElementType =\n | string\n | React.ComponentType<{\n onReset?: (e: React.SyntheticEvent) => void;\n onSubmit?: (e: React.SyntheticEvent) => void;\n disabled?: boolean;\n children?: React.ReactChildren;\n }>;\n\nexport interface FormsyProps extends FormHTMLAttributesCleaned {\n disabled: boolean;\n mapping: null | ((model: IModel) => IModel);\n onChange: (model: IModel, isChanged: boolean) => void;\n onInvalid: () => void;\n onReset?: () => void;\n onSubmit?: OnSubmitCallback;\n onValidSubmit?: OnSubmitCallback;\n onInvalidSubmit: OnSubmitCallback;\n onValid: () => void;\n preventDefaultSubmit?: boolean;\n preventExternalInvalidation?: boolean;\n validationErrors?: null | object;\n formElement?: FormElementType;\n}\n\nexport interface FormsyState {\n canChange: boolean;\n contextValue: FormsyContextInterface;\n formSubmitted?: boolean;\n isPristine?: boolean;\n isSubmitting: boolean;\n isValid: boolean;\n}\n\nconst ONE_RENDER_FRAME = 66;\n\nexport class Formsy extends React.Component {\n public inputs: InstanceType>[];\n\n public emptyArray: any[];\n\n public prevInputNames: any[] | null = null;\n\n public static displayName = 'Formsy';\n\n public static propTypes = {\n disabled: PropTypes.bool,\n mapping: PropTypes.func,\n formElement: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]),\n onChange: PropTypes.func,\n onInvalid: PropTypes.func,\n onInvalidSubmit: PropTypes.func,\n onReset: PropTypes.func,\n onSubmit: PropTypes.func,\n onValid: PropTypes.func,\n onValidSubmit: PropTypes.func,\n preventDefaultSubmit: PropTypes.bool,\n preventExternalInvalidation: PropTypes.bool,\n validationErrors: PropTypes.object, // eslint-disable-line\n };\n\n public static defaultProps: Partial = {\n disabled: false,\n mapping: null,\n onChange: utils.noop,\n onInvalid: utils.noop,\n onInvalidSubmit: utils.noop,\n onReset: utils.noop,\n onSubmit: utils.noop,\n onValid: utils.noop,\n onValidSubmit: utils.noop,\n preventDefaultSubmit: true,\n preventExternalInvalidation: false,\n validationErrors: {},\n formElement: 'form',\n };\n\n private readonly throttledValidateForm: () => void;\n\n public constructor(props: FormsyProps) {\n super(props);\n this.state = {\n canChange: false,\n isSubmitting: false,\n isValid: true,\n contextValue: {\n attachToForm: this.attachToForm,\n detachFromForm: this.detachFromForm,\n isFormDisabled: props.disabled,\n isValidValue: this.isValidValue,\n validate: this.validate,\n runValidation: this.runValidation,\n },\n };\n this.inputs = [];\n this.emptyArray = [];\n this.throttledValidateForm = throttle(this.validateForm, ONE_RENDER_FRAME);\n }\n\n public componentDidMount = () => {\n this.prevInputNames = this.inputs.map((component) => component.props.name);\n this.validateForm();\n };\n\n public componentDidUpdate = (prevProps: FormsyProps) => {\n const { validationErrors, disabled } = this.props;\n\n if (validationErrors && isObject(validationErrors) && Object.keys(validationErrors).length > 0) {\n this.setInputValidationErrors(validationErrors);\n }\n\n const newInputNames = this.inputs.map((component) => component.props.name);\n if (this.prevInputNames && !utils.isSame(this.prevInputNames, newInputNames)) {\n this.prevInputNames = newInputNames;\n this.validateForm();\n }\n\n // Keep the disabled value in state/context the same as from props\n if (disabled !== prevProps.disabled) {\n // eslint-disable-next-line\n this.setState((state) => ({\n ...state,\n contextValue: {\n ...state.contextValue,\n isFormDisabled: disabled,\n },\n }));\n }\n };\n\n public getCurrentValues = () =>\n this.inputs.reduce((valueAccumulator, component) => {\n const {\n props: { name },\n state: { value },\n } = component;\n // eslint-disable-next-line no-param-reassign\n valueAccumulator[name] = utils.protectAgainstParamReassignment(value);\n return valueAccumulator;\n }, {});\n\n public getModel = () => {\n const currentValues = this.getCurrentValues();\n return this.mapModel(currentValues);\n };\n\n public getPristineValues = () =>\n this.inputs.reduce((valueAccumulator, component) => {\n const {\n props: { name, value },\n } = component;\n // eslint-disable-next-line no-param-reassign\n valueAccumulator[name] = utils.protectAgainstParamReassignment(value);\n return valueAccumulator;\n }, {});\n\n public setFormPristine = (isPristine: boolean) => {\n this.setState({\n formSubmitted: !isPristine,\n });\n\n // Iterate through each component and set it as pristine\n // or \"dirty\".\n this.inputs.forEach((component) => {\n component.setState({\n formSubmitted: !isPristine,\n isPristine,\n });\n });\n };\n\n public setInputValidationErrors = (errors) => {\n const { preventExternalInvalidation } = this.props;\n const { isValid } = this.state;\n\n this.inputs.forEach((component) => {\n const { name } = component.props;\n component.setState({\n isValid: !(name in errors),\n validationError: isString(errors[name]) ? [errors[name]] : errors[name],\n });\n });\n if (!preventExternalInvalidation && isValid) {\n this.setFormValidState(false);\n }\n };\n\n public setFormValidState = (allIsValid: boolean) => {\n const { onValid, onInvalid } = this.props;\n\n this.setState({\n isValid: allIsValid,\n });\n\n if (allIsValid) {\n onValid();\n } else {\n onInvalid();\n }\n };\n\n public isValidValue = (component, value) => this.runValidation(component, value).isValid;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormDisabled = () => this.props.disabled;\n\n public mapModel = (model: IModel): IModel => {\n const { mapping } = this.props;\n\n if (mapping) {\n return mapping(model);\n }\n\n const returnModel = {};\n Object.keys(model).forEach((key) => {\n set(returnModel, key, model[key]);\n });\n return returnModel;\n };\n\n public reset = (model?: IModel) => {\n this.setFormPristine(true);\n this.resetModel(model);\n };\n\n private resetInternal = (event) => {\n const { onReset } = this.props;\n\n event.preventDefault();\n this.reset();\n if (onReset) {\n onReset();\n }\n };\n\n // Reset each key in the model to the original / initial / specified value\n private resetModel: IResetModel = (data) => {\n this.inputs.forEach((component) => {\n const { name } = component.props;\n if (data && has(data, name)) {\n component.setValue(get(data, name));\n } else {\n component.resetValue();\n }\n });\n this.validateForm();\n };\n\n // Checks validation on current value or a passed value\n public runValidation = (\n component: InputComponent,\n value = component.state.value,\n ): { isRequired: boolean; isValid: boolean; validationError: ValidationError[] } => {\n const { validationErrors } = this.props;\n const { validationError, validationErrors: componentValidationErrors, name } = component.props;\n const currentValues = this.getCurrentValues();\n const validationResults = utils.runRules(value, currentValues, component.validations, validationRules);\n const requiredResults = utils.runRules(value, currentValues, component.requiredValidations, validationRules);\n const isRequired = Object.keys(component.requiredValidations).length ? !!requiredResults.success.length : false;\n const isValid = !validationResults.failed.length && !(validationErrors && validationErrors[component.props.name]);\n\n return {\n isRequired,\n isValid: isRequired ? false : isValid,\n validationError: (() => {\n if (isValid && !isRequired) {\n return this.emptyArray;\n }\n\n if (validationResults.errors.length) {\n return validationResults.errors;\n }\n\n if (validationErrors && validationErrors[name]) {\n return isString(validationErrors[name]) ? [validationErrors[name]] : validationErrors[name];\n }\n\n if (isRequired) {\n const error = componentValidationErrors[requiredResults.success[0]] || validationError;\n return error ? [error] : null;\n }\n\n if (validationResults.failed.length) {\n return validationResults.failed\n .map((failed) => (componentValidationErrors[failed] ? componentValidationErrors[failed] : validationError))\n .filter((x, pos, arr) => arr.indexOf(x) === pos); // remove duplicates\n }\n\n // This line is not reachable\n // istanbul ignore next\n return undefined;\n })(),\n };\n };\n\n // Method put on each input component to register\n // itself to the form\n public attachToForm = (component) => {\n if (this.inputs.indexOf(component) === -1) {\n this.inputs.push(component);\n }\n\n const { onChange } = this.props;\n const { canChange } = this.state;\n\n // Trigger onChange\n if (canChange) {\n onChange(this.getModel(), this.isChanged());\n }\n\n // Will be triggered immediately & every one frame rate\n this.throttledValidateForm();\n };\n\n // Method put on each input component to unregister\n // itself from the form\n public detachFromForm = (component: InputComponent) => {\n const componentPos = this.inputs.indexOf(component);\n\n if (componentPos !== -1) {\n this.inputs = this.inputs.slice(0, componentPos).concat(this.inputs.slice(componentPos + 1));\n }\n\n this.validateForm();\n };\n\n // Checks if the values have changed from their initial value\n public isChanged = () => !utils.isSame(this.getPristineValues(), this.getCurrentValues());\n\n // Update model, submit to url prop and send the model\n public submit = (event?: React.SyntheticEvent) => {\n const { onSubmit, onValidSubmit, onInvalidSubmit, preventDefaultSubmit } = this.props;\n const { isValid } = this.state;\n\n if (preventDefaultSubmit && event && event.preventDefault) {\n event.preventDefault();\n }\n\n // Trigger form as not pristine.\n // If any inputs have not been touched yet this will make them dirty\n // so validation becomes visible (if based on isPristine)\n this.setFormPristine(false);\n const model = this.getModel();\n onSubmit(model, this.resetModel, this.updateInputsWithError, event);\n\n if (isValid) {\n onValidSubmit(model, this.resetModel, this.updateInputsWithError, event);\n } else {\n onInvalidSubmit(model, this.resetModel, this.updateInputsWithError, event);\n }\n };\n\n // Go through errors from server and grab the components\n // stored in the inputs map. Change their state to invalid\n // and set the serverError message\n public updateInputsWithError: IUpdateInputsWithError = (errors, invalidate) => {\n const { preventExternalInvalidation } = this.props;\n const { isValid } = this.state;\n\n Object.entries(errors).forEach(([name, error]) => {\n const component = this.inputs.find((input) => input.props.name === name);\n if (!component) {\n throw new Error(\n `You are trying to update an input that does not exist. Verify errors object with input names. ${JSON.stringify(\n errors,\n )}`,\n );\n }\n component.setState({\n isValid: preventExternalInvalidation,\n validationError: utils.isString(error) ? [error] : error,\n });\n });\n\n if (invalidate && isValid) {\n this.setFormValidState(false);\n }\n };\n\n // Set the value of components\n public updateInputsWithValue: IUpdateInputsWithValue = (data, validate) => {\n this.inputs.forEach((component) => {\n const { name } = component.props;\n if (data && has(data, name)) {\n component.setValue(get(data, name), validate);\n }\n });\n };\n\n // Use the binded values and the actual input value to\n // validate the input and set its state. Then check the\n // state of the form itself\n public validate = (component: InputComponent) => {\n const { onChange } = this.props;\n const { canChange } = this.state;\n\n // Trigger onChange\n if (canChange) {\n onChange(this.getModel(), this.isChanged());\n }\n\n const validationState = this.runValidation(component);\n // Run through the validations, split them up and call\n // the validator IF there is a value or it is required\n component.setState(validationState, this.validateForm);\n };\n\n // Validate the form by going through all child input components\n // and check their state\n public validateForm = () => {\n // We need a callback as we are validating all inputs again. This will\n // run when the last component has set its state\n const onValidationComplete = () => {\n const allIsValid = this.inputs.every((component) => component.state.isValid);\n\n this.setFormValidState(allIsValid);\n\n // Tell the form that it can start to trigger change events\n this.setState({\n canChange: true,\n });\n };\n\n // Run validation again in case affected by other inputs. The\n // last component validated will run the onValidationComplete callback\n this.inputs.forEach((component, index) => {\n const validationState = this.runValidation(component);\n const isFinalInput = index === this.inputs.length - 1;\n const callback = isFinalInput ? onValidationComplete : null;\n component.setState(validationState, callback);\n });\n\n // If there are no inputs, set state where form is ready to trigger\n // change event. New inputs might be added later\n if (!this.inputs.length) {\n this.setState(\n {\n canChange: true,\n },\n onValidationComplete,\n );\n }\n };\n\n public render() {\n const {\n /* eslint-disable @typescript-eslint/no-unused-vars */\n children,\n mapping,\n onChange,\n onInvalid,\n onInvalidSubmit,\n onReset,\n onSubmit,\n onValid,\n onValidSubmit,\n preventDefaultSubmit,\n preventExternalInvalidation,\n validationErrors,\n disabled,\n formElement,\n ...nonFormsyProps\n } = this.props;\n const { contextValue } = this.state;\n\n return React.createElement(\n FormsyContext.Provider,\n {\n value: contextValue,\n },\n React.createElement(\n formElement,\n {\n onReset: this.resetInternal,\n onSubmit: this.submit,\n ...nonFormsyProps,\n disabled,\n },\n children,\n ),\n );\n }\n}\n"],"names":["isArray","value","Array","isObject","isPlainObject","isDate","Date","isFunction","isString","isRegex","RegExp","isValueStringEmpty","isValueNullOrUndefined","isValueUndefined","undefined","noop","protectAgainstParamReassignment","isSame","a","b","length","every","item","index","toString","Object","keys","key","runRules","currentValues","validations","validationRules","results","errors","failed","success","forEach","validationName","validationsVal","validationRulesVal","addToResults","validation","push","Error","isExisty","isEmpty","isTypeUndefined","isDefaultRequiredValue","matchRegexp","_values","regexp","test","REGEX_PATTERNS","equals","eql","equalsField","values","field","isAlpha","isAlphanumeric","isEmail","isEmptyString","isFalse","isFloat","isInt","isLength","isNumeric","isNumber","isSpecialWords","isTrue","isUndefined","isUrl","isWords","maxLength","minLength","throwNoFormsyProvider","React","createContext","attachToForm","detachFromForm","isFormDisabled","isValidValue","validate","runValidation","convertValidationsToObject","split","reduce","validationsAccumulator","args","validateMethod","shift","map","arg","JSON","parse","e","validationsAccumulatorCopy","propTypes","innerRef","PropTypes","func","name","string","isRequired","required","oneOfType","bool","object","any","Formsy","props","callback","enableCall","prevInputNames","_this","inputs","component","validateForm","prevProps","validationErrors","disabled","setInputValidationErrors","newInputNames","utils","setState","state","contextValue","valueAccumulator","getCurrentValues","mapModel","isPristine","formSubmitted","preventExternalInvalidation","isValid","validationError","setFormValidState","allIsValid","onValid","onInvalid","model","mapping","returnModel","set","setFormPristine","resetModel","event","onReset","preventDefault","reset","data","has","setValue","get","resetValue","componentValidationErrors","validationResults","requiredResults","requiredValidations","emptyArray","error","filter","x","pos","arr","indexOf","canChange","onChange","getModel","isChanged","throttledValidateForm","componentPos","slice","concat","getPristineValues","onSubmit","onValidSubmit","onInvalidSubmit","preventDefaultSubmit","updateInputsWithError","invalidate","entries","find","input","stringify","validationState","onValidationComplete","isSubmitting","apply","this","setTimeout","render","children","formElement","nonFormsyProps","createElement","FormsyContext","Provider","resetInternal","submit","Component","WrappedComponent","WithFormsyWrapper","messages","getErrorMessages","showRequired","pristineValue","setValidations","componentDidMount","shouldComponentUpdate","nextProps","nextState","some","k","isPropsChanged","isStateChanged","componentDidUpdate","componentWillUnmount","propsForElement","errorMessage","getErrorMessage","errorMessages","hasValue","isFormSubmitted","showError","getValue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C,oBAGV9H,IACFuH,EAAgBQ,IAAM/H,GAGjBtB,EAAMsH,cAAcM,EAAkBiB,OA/LvC7I,EAAM2H,kBAOAE,0BAfMrF,EAeiCoF,GAdtC0B,aAAe9G,EAAUf,OAASsB,EAAeP,GAAaA,EAAY,kBAgB3EqF,YAAiBxG,EAEjBwG,eAAoB,CAChCvG,SAAU,KACVM,UAAU,EACV8B,gBAAiB,GACjBf,iBAAkB,GAClBzF,YAAa,KACb7B,MAAQuM,EAAmD2B,cAmLxD,SAACrH,UACNlC,EAAMsH,cAAcC,EAAciC,SAAU,MAAM,SAACtG,UAC1ClD,EAAMsH,cAAcO,OAAwB3F,EAAUgB"} \ No newline at end of file diff --git a/dist/formsy-react.esm.js.map b/dist/formsy-react.esm.js.map index 78cbe2fc..8d1bc092 100644 --- a/dist/formsy-react.esm.js.map +++ b/dist/formsy-react.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"formsy-react.esm.js","sources":["../src/utils.ts","../src/validationRules.ts","../src/FormsyContext.ts","../src/withFormsy.ts","../src/Formsy.ts"],"sourcesContent":["import { isPlainObject } from 'lodash';\n\nimport { ValidationError, Validations, Values } from './interfaces';\n\nexport function isArray(value: unknown): value is unknown[] {\n return Array.isArray(value);\n}\n\nexport function isObject(value: unknown): value is object {\n return isPlainObject(value);\n}\n\nexport function isTypeUndefined(value: unknown): value is undefined {\n return typeof value === 'undefined';\n}\n\nexport function isDate(value: unknown): value is Date {\n return value instanceof Date;\n}\n\nexport function isFunction(value: unknown): value is Function {\n return value !== null && typeof value === 'function';\n}\n\nexport function isString(value: unknown): value is string {\n return typeof value === 'string';\n}\n\nexport function isNumber(value: unknown): value is number {\n return typeof value === 'number';\n}\n\nexport function isRegex(value: unknown): value is RegExp {\n return value instanceof RegExp;\n}\n\nexport function isValueStringEmpty(value: string): boolean {\n return value === '';\n}\n\nexport function isValueNullOrUndefined(value: unknown): boolean {\n return value === null || value === undefined;\n}\n\nexport function isValueUndefined(value: unknown): boolean {\n return value === undefined;\n}\n\nexport function noop() {\n // do nothing.\n}\n\nexport function protectAgainstParamReassignment(value: unknown) {\n // Clone objects to avoid accidental param reassignment\n if (isObject(value)) return { ...value };\n if (isArray(value)) return [...value];\n return value;\n}\n\nexport function isSame(a: unknown, b: unknown) {\n if (typeof a !== typeof b) {\n return false;\n }\n\n if (isArray(a) && isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n\n return a.every((item, index) => isSame(item, b[index]));\n }\n\n if (isFunction(a) && isFunction(b)) {\n return a.toString() === b.toString();\n }\n\n if (isDate(a) && isDate(b)) {\n return a.toString() === b.toString();\n }\n\n if (isObject(a) && isObject(b)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n return Object.keys(a).every((key) => isSame(a[key], b[key]));\n }\n\n if (isRegex(a) && isRegex(b)) {\n return a.toString() === b.toString();\n }\n\n return a === b;\n}\n\ninterface RulesResult {\n errors: ValidationError[];\n failed: string[];\n success: string[];\n}\n\nexport function runRules(\n value: V,\n currentValues: Values,\n validations: Validations,\n validationRules: Validations,\n) {\n const results: RulesResult = {\n errors: [],\n failed: [],\n success: [],\n };\n\n Object.keys(validations).forEach((validationName) => {\n const validationsVal = validations[validationName];\n const validationRulesVal = validationRules[validationName];\n const addToResults = (validation) => {\n if (isString(validation)) {\n results.errors.push(validation);\n results.failed.push(validationName);\n } else if (!validation) {\n results.failed.push(validationName);\n } else {\n results.success.push(validationName);\n }\n };\n\n if (validationRulesVal && isFunction(validationsVal)) {\n throw new Error(`Formsy does not allow you to override default validations: ${validationName}`);\n }\n\n if (!validationRulesVal && !isFunction(validationsVal)) {\n throw new Error(`Formsy does not have the validation rule: ${validationName}`);\n }\n\n if (isFunction(validationsVal)) {\n return addToResults(validationsVal(currentValues, value));\n }\n\n return addToResults(validationRulesVal(currentValues, value, validationsVal));\n });\n\n return results;\n}\n\nexport function throttle(callback, interval) {\n let enableCall = true;\n\n return function (...args) {\n if (!enableCall) return;\n\n enableCall = false;\n callback.apply(this, args);\n setTimeout(() => (enableCall = true), interval);\n };\n}\n","import { ValidationFunction, Values } from './interfaces';\nimport {\n isNumber,\n isString,\n isTypeUndefined,\n isValueNullOrUndefined,\n isValueStringEmpty,\n isValueUndefined,\n} from './utils';\n\nexport function isExisty(value: V) {\n return !isValueNullOrUndefined(value);\n}\n\nexport function isEmpty(value: V) {\n if (isString(value)) {\n return isValueStringEmpty(value);\n }\n if (isTypeUndefined(value)) {\n return false;\n }\n return isValueUndefined(value);\n}\n\nexport function isDefaultRequiredValue(value: unknown) {\n return isString(value) ? isValueStringEmpty(value) : isValueNullOrUndefined(value);\n}\n\nexport function matchRegexp(_values: Values, value: V, regexp: RegExp) {\n return !isExisty(value) || isEmpty(value) || regexp.test(`${value}`);\n}\n\ninterface Validations {\n [key: string]: ValidationFunction;\n}\n\nconst REGEX_PATTERNS = {\n ALPHA: /^[A-Z]+$/i,\n ALPHANUMERIC: /^[0-9A-Z]+$/i,\n EMAIL:\n /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/i, // from http://emailregex.com/\n FLOAT: /^(?:[-+]?(?:\\d+))?(?:\\.\\d*)?(?:[eE][+-]?(?:\\d+))?$/,\n INT: /^(?:[-+]?(?:0|[1-9]\\d*))$/,\n NUMERIC: /^[-+]?(?:\\d*[.])?\\d+$/,\n SPECIAL_WORDS: /^[\\sA-ZÀ-ÖØ-öø-ÿ]+$/i,\n URL: /^(?:\\w+:)?\\/\\/([^\\s.]+\\.\\S{2}|localhost[:?\\d]*)\\S*$/i,\n WORDS: /^[A-Z\\s]+$/i,\n};\n\nconst validations: Validations = {\n equals: (_values, value: V, eql: V) => !isExisty(value) || isEmpty(value) || value === eql,\n equalsField: (values, value: V, field: string) => value === values[field],\n isAlpha: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.ALPHA),\n isAlphanumeric: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.ALPHANUMERIC),\n isDefaultRequiredValue: (_values, value: V) => isDefaultRequiredValue(value),\n isEmail: (values, value: string) => matchRegexp(values, value, REGEX_PATTERNS.EMAIL),\n isEmptyString: (_values, value: string) => isEmpty(value),\n isExisty: (_values, value: V) => isExisty(value),\n isFalse: (_values, value: boolean | string) => value === false,\n isFloat: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.FLOAT),\n isInt: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.INT),\n isLength: (_values, value: string, length: number) => !isExisty(value) || isEmpty(value) || value.length === length,\n isNumeric: (values, value: V) => isNumber(value) || matchRegexp(values, value, REGEX_PATTERNS.NUMERIC),\n isSpecialWords: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.SPECIAL_WORDS),\n isTrue: (_values, value: boolean | string) => value === true,\n isUndefined: (_values, value: V) => isValueUndefined(value),\n isUrl: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.URL),\n isWords: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.WORDS),\n matchRegexp,\n maxLength: (_values, value: string, length: number) => !isExisty(value) || value.length <= length,\n minLength: (_values, value: string, length: number) => !isExisty(value) || isEmpty(value) || value.length >= length,\n};\n\nexport const addValidationRule = (name: string, func: ValidationFunction) => {\n validations[name] = func;\n};\n\nexport default validations;\n","import React from 'react';\nimport { FormsyContextInterface } from './interfaces';\n\nconst noFormsyErrorMessage = 'Could not find Formsy Context Provider. Did you use withFormsy outside ?';\n\nconst throwNoFormsyProvider = () => {\n // istanbul ignore next\n throw new Error(noFormsyErrorMessage);\n};\n\nconst defaultValue = {\n attachToForm: throwNoFormsyProvider,\n detachFromForm: throwNoFormsyProvider,\n isFormDisabled: true,\n isValidValue: throwNoFormsyProvider,\n validate: throwNoFormsyProvider,\n runValidation: throwNoFormsyProvider,\n};\n\nexport default React.createContext(defaultValue);\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport FormsyContext from './FormsyContext';\nimport {\n ComponentWithStaticAttributes,\n FormsyContextInterface,\n RequiredValidation,\n ValidationError,\n Validations,\n WrappedComponentClass,\n} from './interfaces';\n\nimport * as utils from './utils';\nimport { isString } from './utils';\nimport { isDefaultRequiredValue } from './validationRules';\n\n/* eslint-disable react/default-props-match-prop-types */\n\nconst convertValidationsToObject = (validations: false | Validations): Validations => {\n if (isString(validations)) {\n return validations.split(/,(?![^{[]*[}\\]])/g).reduce((validationsAccumulator, validation) => {\n let args: string[] = validation.split(':');\n const validateMethod: string = args.shift();\n\n args = args.map((arg) => {\n try {\n return JSON.parse(arg);\n } catch (e) {\n return arg; // It is a string if it can not parse it\n }\n });\n\n if (args.length > 1) {\n throw new Error(\n 'Formsy does not support multiple args on string validations. Use object format of validations instead.',\n );\n }\n\n // Avoid parameter reassignment\n const validationsAccumulatorCopy: Validations = { ...validationsAccumulator };\n validationsAccumulatorCopy[validateMethod] = args.length ? args[0] : true;\n return validationsAccumulatorCopy;\n }, {});\n }\n\n return validations || {};\n};\n\nexport const propTypes = {\n innerRef: PropTypes.func,\n name: PropTypes.string.isRequired,\n required: PropTypes.oneOfType([PropTypes.bool, PropTypes.object, PropTypes.string]),\n validations: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n value: PropTypes.any, // eslint-disable-line react/forbid-prop-types\n};\n\nexport interface WrapperProps {\n innerRef?: (ref: React.Ref) => void;\n name: string;\n required?: RequiredValidation;\n validationError?: ValidationError;\n validationErrors?: { [key: string]: ValidationError };\n validations?: Validations;\n value?: V;\n}\n\nexport interface WrapperState {\n [key: string]: unknown;\n\n formSubmitted: boolean;\n isPristine: boolean;\n isRequired: boolean;\n isValid: boolean;\n pristineValue: V;\n validationError: ValidationError[];\n value: V;\n}\n\nexport interface InjectedProps {\n errorMessage: ValidationError;\n errorMessages: ValidationError[];\n hasValue: boolean;\n isFormDisabled: boolean;\n isFormSubmitted: boolean;\n isPristine: boolean;\n isRequired: boolean;\n isValid: boolean;\n isValidValue: (value: V) => boolean;\n ref?: React.Ref;\n resetValue: () => void;\n setValidations: (validations: Validations, required: RequiredValidation) => void;\n setValue: (value: V, validate?: boolean) => void;\n showError: boolean;\n showRequired: boolean;\n}\n\nexport interface WrapperInstanceMethods {\n getErrorMessage: () => null | ValidationError;\n getErrorMessages: () => ValidationError[];\n getValue: () => V;\n isFormDisabled: () => boolean;\n isFormSubmitted: () => boolean;\n isValid: () => boolean;\n isValidValue: (value: V) => boolean;\n setValue: (value: V, validate?: boolean) => void;\n}\n\nexport type PassDownProps = WrapperProps & InjectedProps;\n\nfunction getDisplayName(component: WrappedComponentClass) {\n return component.displayName || component.name || (utils.isString(component) ? component : 'Component');\n}\n\nexport default function withFormsy(\n WrappedComponent: React.ComponentType>,\n): React.ComponentType, keyof InjectedProps>> {\n class WithFormsyWrapper\n extends React.Component & FormsyContextInterface, WrapperState>\n implements WrapperInstanceMethods\n {\n public validations?: Validations;\n\n public requiredValidations?: Validations;\n\n public static displayName = `Formsy(${getDisplayName(WrappedComponent)})`;\n\n public static propTypes: any = propTypes;\n\n public static defaultProps: any = {\n innerRef: null,\n required: false,\n validationError: '',\n validationErrors: {},\n validations: null,\n value: (WrappedComponent as ComponentWithStaticAttributes).defaultValue,\n };\n\n public constructor(props) {\n super(props);\n const { runValidation, validations, required, value } = props;\n\n this.state = { value } as any;\n\n this.setValidations(validations, required);\n\n this.state = {\n formSubmitted: false,\n isPristine: true,\n pristineValue: props.value,\n value: props.value,\n ...runValidation(this, props.value),\n };\n }\n\n public componentDidMount() {\n const { name, attachToForm } = this.props;\n\n if (!name) {\n throw new Error('Form Input requires a name property when used');\n }\n\n attachToForm(this);\n }\n\n public shouldComponentUpdate(nextProps, nextState) {\n const { props, state } = this;\n const isChanged = (a: object, b: object): boolean => Object.keys(a).some((k) => a[k] !== b[k]);\n const isPropsChanged = isChanged(props, nextProps);\n const isStateChanged = isChanged(state, nextState);\n\n return isPropsChanged || isStateChanged;\n }\n\n public componentDidUpdate(prevProps) {\n const { value, validations, required, validate } = this.props;\n\n // If the value passed has changed, set it. If value is not passed it will\n // internally update, and this will never run\n if (!utils.isSame(value, prevProps.value)) {\n this.setValue(value);\n }\n\n // If validations or required is changed, run a new validation\n if (!utils.isSame(validations, prevProps.validations) || !utils.isSame(required, prevProps.required)) {\n this.setValidations(validations, required);\n validate(this);\n }\n }\n\n // Detach it when component unmounts\n public componentWillUnmount() {\n const { detachFromForm } = this.props;\n detachFromForm(this);\n }\n\n public getErrorMessage = (): ValidationError | null => {\n const messages = this.getErrorMessages();\n return messages.length ? messages[0] : null;\n };\n\n public getErrorMessages = (): ValidationError[] => {\n const { validationError } = this.state;\n\n if (!this.isValid() || this.showRequired()) {\n return validationError || [];\n }\n return [];\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public getValue = (): V => this.state.value;\n\n public setValidations = (validations: Validations, required: RequiredValidation): void => {\n // Add validations to the store itself as the props object can not be modified\n this.validations = convertValidationsToObject(validations) || {};\n this.requiredValidations =\n required === true ? { isDefaultRequiredValue: required } : convertValidationsToObject(required);\n };\n\n // By default, we validate after the value has been set.\n // A user can override this and pass a second parameter of `false` to skip validation.\n public setValue = (value: V, validate = true): void => {\n const { validate: validateForm } = this.props;\n\n if (!validate) {\n this.setState({ value });\n } else {\n this.setState(\n {\n value,\n isPristine: false,\n },\n () => {\n validateForm(this);\n },\n );\n }\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public hasValue = () => {\n const { value } = this.state;\n return isDefaultRequiredValue(value);\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormDisabled = (): boolean => this.props.isFormDisabled;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormSubmitted = (): boolean => this.state.formSubmitted;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isPristine = (): boolean => this.state.isPristine;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isRequired = (): boolean => !!this.props.required;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isValid = (): boolean => this.state.isValid;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isValidValue = (value: V) => this.props.isValidValue(this, value);\n\n public resetValue = () => {\n const { pristineValue } = this.state;\n const { validate } = this.props;\n\n this.setState(\n {\n value: pristineValue,\n isPristine: true,\n },\n () => {\n validate(this);\n },\n );\n };\n\n public showError = (): boolean => !this.showRequired() && !this.isValid();\n\n // eslint-disable-next-line react/destructuring-assignment\n public showRequired = (): boolean => this.state.isRequired;\n\n public render() {\n const { innerRef } = this.props;\n const propsForElement: T & PassDownProps = {\n ...this.props,\n errorMessage: this.getErrorMessage(),\n errorMessages: this.getErrorMessages(),\n hasValue: this.hasValue(),\n isFormDisabled: this.isFormDisabled(),\n isFormSubmitted: this.isFormSubmitted(),\n isPristine: this.isPristine(),\n isRequired: this.isRequired(),\n isValid: this.isValid(),\n isValidValue: this.isValidValue,\n resetValue: this.resetValue,\n setValidations: this.setValidations,\n setValue: this.setValue,\n showError: this.showError(),\n showRequired: this.showRequired(),\n value: this.getValue(),\n };\n\n if (innerRef) {\n propsForElement.ref = innerRef;\n }\n\n return React.createElement(WrappedComponent, propsForElement);\n }\n }\n\n // eslint-disable-next-line react/display-name\n return (props) =>\n React.createElement(FormsyContext.Consumer, null, (contextValue) => {\n return React.createElement(WithFormsyWrapper, { ...props, ...contextValue });\n });\n}\n","/* eslint-disable react/no-unused-state, react/default-props-match-prop-types */\nimport { get, has, set } from 'lodash';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport FormsyContext from './FormsyContext';\nimport {\n FormsyContextInterface,\n IModel,\n InputComponent,\n IResetModel,\n IUpdateInputsWithError,\n IUpdateInputsWithValue,\n ValidationError,\n} from './interfaces';\nimport { throttle, isObject, isString } from './utils';\nimport * as utils from './utils';\nimport validationRules from './validationRules';\nimport { PassDownProps } from './withFormsy';\n\ntype FormHTMLAttributesCleaned = Omit, 'onChange' | 'onSubmit'>;\n\ntype OnSubmitCallback = (\n model: IModel,\n resetModel: IResetModel,\n updateInputsWithError: IUpdateInputsWithError,\n event: React.SyntheticEvent>,\n) => void;\n\ntype FormElementType =\n | string\n | React.ComponentType<{\n onReset?: (e: React.SyntheticEvent) => void;\n onSubmit?: (e: React.SyntheticEvent) => void;\n disabled?: boolean;\n children?: React.ReactChildren;\n }>;\n\nexport interface FormsyProps extends FormHTMLAttributesCleaned {\n disabled: boolean;\n mapping: null | ((model: IModel) => IModel);\n onChange: (model: IModel, isChanged: boolean) => void;\n onInvalid: () => void;\n onReset?: () => void;\n onSubmit?: OnSubmitCallback;\n onValidSubmit?: OnSubmitCallback;\n onInvalidSubmit: OnSubmitCallback;\n onValid: () => void;\n preventDefaultSubmit?: boolean;\n preventExternalInvalidation?: boolean;\n validationErrors?: null | object;\n formElement?: FormElementType;\n}\n\nexport interface FormsyState {\n canChange: boolean;\n contextValue: FormsyContextInterface;\n formSubmitted?: boolean;\n isPristine?: boolean;\n isSubmitting: boolean;\n isValid: boolean;\n}\n\nconst ONE_RENDER_FRAME = 66;\n\nexport class Formsy extends React.Component {\n public inputs: InstanceType>[];\n\n public emptyArray: any[];\n\n public prevInputNames: any[] | null = null;\n\n public static displayName = 'Formsy';\n\n public static propTypes = {\n disabled: PropTypes.bool,\n mapping: PropTypes.func,\n formElement: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]),\n onChange: PropTypes.func,\n onInvalid: PropTypes.func,\n onInvalidSubmit: PropTypes.func,\n onReset: PropTypes.func,\n onSubmit: PropTypes.func,\n onValid: PropTypes.func,\n onValidSubmit: PropTypes.func,\n preventDefaultSubmit: PropTypes.bool,\n preventExternalInvalidation: PropTypes.bool,\n validationErrors: PropTypes.object, // eslint-disable-line\n };\n\n public static defaultProps: Partial = {\n disabled: false,\n mapping: null,\n onChange: utils.noop,\n onInvalid: utils.noop,\n onInvalidSubmit: utils.noop,\n onReset: utils.noop,\n onSubmit: utils.noop,\n onValid: utils.noop,\n onValidSubmit: utils.noop,\n preventDefaultSubmit: true,\n preventExternalInvalidation: false,\n validationErrors: {},\n formElement: 'form',\n };\n\n private readonly throttledValidateForm: () => void;\n\n public constructor(props: FormsyProps) {\n super(props);\n this.state = {\n canChange: false,\n isSubmitting: false,\n isValid: true,\n contextValue: {\n attachToForm: this.attachToForm,\n detachFromForm: this.detachFromForm,\n isFormDisabled: props.disabled,\n isValidValue: this.isValidValue,\n validate: this.validate,\n runValidation: this.runValidation,\n },\n };\n this.inputs = [];\n this.emptyArray = [];\n this.throttledValidateForm = throttle(this.validateForm, ONE_RENDER_FRAME);\n }\n\n public componentDidMount = () => {\n this.prevInputNames = this.inputs.map((component) => component.props.name);\n this.validateForm();\n };\n\n public componentDidUpdate = (prevProps: FormsyProps) => {\n const { validationErrors, disabled } = this.props;\n\n if (validationErrors && isObject(validationErrors) && Object.keys(validationErrors).length > 0) {\n this.setInputValidationErrors(validationErrors);\n }\n\n const newInputNames = this.inputs.map((component) => component.props.name);\n if (this.prevInputNames && !utils.isSame(this.prevInputNames, newInputNames)) {\n this.prevInputNames = newInputNames;\n this.validateForm();\n }\n\n // Keep the disabled value in state/context the same as from props\n if (disabled !== prevProps.disabled) {\n // eslint-disable-next-line\n this.setState((state) => ({\n ...state,\n contextValue: {\n ...state.contextValue,\n isFormDisabled: disabled,\n },\n }));\n }\n };\n\n public getCurrentValues = () =>\n this.inputs.reduce((valueAccumulator, component) => {\n const {\n props: { name },\n state: { value },\n } = component;\n // eslint-disable-next-line no-param-reassign\n valueAccumulator[name] = utils.protectAgainstParamReassignment(value);\n return valueAccumulator;\n }, {});\n\n public getModel = () => {\n const currentValues = this.getCurrentValues();\n return this.mapModel(currentValues);\n };\n\n public getPristineValues = () =>\n this.inputs.reduce((valueAccumulator, component) => {\n const {\n props: { name, value },\n } = component;\n // eslint-disable-next-line no-param-reassign\n valueAccumulator[name] = utils.protectAgainstParamReassignment(value);\n return valueAccumulator;\n }, {});\n\n public setFormPristine = (isPristine: boolean) => {\n this.setState({\n formSubmitted: !isPristine,\n });\n\n // Iterate through each component and set it as pristine\n // or \"dirty\".\n this.inputs.forEach((component) => {\n component.setState({\n formSubmitted: !isPristine,\n isPristine,\n });\n });\n };\n\n public setInputValidationErrors = (errors) => {\n const { preventExternalInvalidation } = this.props;\n const { isValid } = this.state;\n\n this.inputs.forEach((component) => {\n const { name } = component.props;\n component.setState({\n isValid: !(name in errors),\n validationError: isString(errors[name]) ? [errors[name]] : errors[name],\n });\n });\n if (!preventExternalInvalidation && isValid) {\n this.setFormValidState(false);\n }\n };\n\n public setFormValidState = (allIsValid: boolean) => {\n const { onValid, onInvalid } = this.props;\n\n this.setState({\n isValid: allIsValid,\n });\n\n if (allIsValid) {\n onValid();\n } else {\n onInvalid();\n }\n };\n\n public isValidValue = (component, value) => this.runValidation(component, value).isValid;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormDisabled = () => this.props.disabled;\n\n public mapModel = (model: IModel): IModel => {\n const { mapping } = this.props;\n\n if (mapping) {\n return mapping(model);\n }\n\n const returnModel = {};\n Object.keys(model).forEach((key) => {\n set(returnModel, key, model[key]);\n });\n return returnModel;\n };\n\n public reset = (model?: IModel) => {\n this.setFormPristine(true);\n this.resetModel(model);\n };\n\n private resetInternal = (event) => {\n const { onReset } = this.props;\n\n event.preventDefault();\n this.reset();\n if (onReset) {\n onReset();\n }\n };\n\n // Reset each key in the model to the original / initial / specified value\n private resetModel: IResetModel = (data) => {\n this.inputs.forEach((component) => {\n const { name } = component.props;\n if (data && has(data, name)) {\n component.setValue(get(data, name));\n } else {\n component.resetValue();\n }\n });\n this.validateForm();\n };\n\n // Checks validation on current value or a passed value\n public runValidation = (\n component: InputComponent,\n value = component.state.value,\n ): { isRequired: boolean; isValid: boolean; validationError: ValidationError[] } => {\n const { validationErrors } = this.props;\n const { validationError, validationErrors: componentValidationErrors, name } = component.props;\n const currentValues = this.getCurrentValues();\n const validationResults = utils.runRules(value, currentValues, component.validations, validationRules);\n const requiredResults = utils.runRules(value, currentValues, component.requiredValidations, validationRules);\n const isRequired = Object.keys(component.requiredValidations).length ? !!requiredResults.success.length : false;\n const isValid = !validationResults.failed.length && !(validationErrors && validationErrors[component.props.name]);\n\n return {\n isRequired,\n isValid: isRequired ? false : isValid,\n validationError: (() => {\n if (isValid && !isRequired) {\n return this.emptyArray;\n }\n\n if (validationResults.errors.length) {\n return validationResults.errors;\n }\n\n if (validationErrors && validationErrors[name]) {\n return isString(validationErrors[name]) ? [validationErrors[name]] : validationErrors[name];\n }\n\n if (isRequired) {\n const error = componentValidationErrors[requiredResults.success[0]] || validationError;\n return error ? [error] : null;\n }\n\n if (validationResults.failed.length) {\n return validationResults.failed\n .map((failed) => (componentValidationErrors[failed] ? componentValidationErrors[failed] : validationError))\n .filter((x, pos, arr) => arr.indexOf(x) === pos); // remove duplicates\n }\n\n // This line is not reachable\n // istanbul ignore next\n return undefined;\n })(),\n };\n };\n\n // Method put on each input component to register\n // itself to the form\n public attachToForm = (component) => {\n if (this.inputs.indexOf(component) === -1) {\n this.inputs.push(component);\n }\n\n const { onChange } = this.props;\n const { canChange } = this.state;\n\n // Trigger onChange\n if (canChange) {\n onChange(this.getModel(), this.isChanged());\n }\n\n // Will be triggered immediately & every one frame rate\n this.throttledValidateForm();\n };\n\n // Method put on each input component to unregister\n // itself from the form\n public detachFromForm = (component: InputComponent) => {\n const componentPos = this.inputs.indexOf(component);\n\n if (componentPos !== -1) {\n this.inputs = this.inputs.slice(0, componentPos).concat(this.inputs.slice(componentPos + 1));\n }\n\n this.validateForm();\n };\n\n // Checks if the values have changed from their initial value\n public isChanged = () => !utils.isSame(this.getPristineValues(), this.getCurrentValues());\n\n // Update model, submit to url prop and send the model\n public submit = (event?: React.SyntheticEvent) => {\n const { onSubmit, onValidSubmit, onInvalidSubmit, preventDefaultSubmit } = this.props;\n const { isValid } = this.state;\n\n if (preventDefaultSubmit && event && event.preventDefault) {\n event.preventDefault();\n }\n\n // Trigger form as not pristine.\n // If any inputs have not been touched yet this will make them dirty\n // so validation becomes visible (if based on isPristine)\n this.setFormPristine(false);\n const model = this.getModel();\n onSubmit(model, this.resetModel, this.updateInputsWithError, event);\n\n if (isValid) {\n onValidSubmit(model, this.resetModel, this.updateInputsWithError, event);\n } else {\n onInvalidSubmit(model, this.resetModel, this.updateInputsWithError, event);\n }\n };\n\n // Go through errors from server and grab the components\n // stored in the inputs map. Change their state to invalid\n // and set the serverError message\n public updateInputsWithError: IUpdateInputsWithError = (errors, invalidate) => {\n const { preventExternalInvalidation } = this.props;\n const { isValid } = this.state;\n\n Object.entries(errors).forEach(([name, error]) => {\n const component = this.inputs.find((input) => input.props.name === name);\n if (!component) {\n throw new Error(\n `You are trying to update an input that does not exist. Verify errors object with input names. ${JSON.stringify(\n errors,\n )}`,\n );\n }\n component.setState({\n isValid: preventExternalInvalidation,\n validationError: utils.isString(error) ? [error] : error,\n });\n });\n\n if (invalidate && isValid) {\n this.setFormValidState(false);\n }\n };\n\n // Set the value of components\n public updateInputsWithValue: IUpdateInputsWithValue = (data, validate) => {\n this.inputs.forEach((component) => {\n const { name } = component.props;\n if (data && has(data, name)) {\n component.setValue(get(data, name), validate);\n }\n });\n };\n\n // Use the binded values and the actual input value to\n // validate the input and set its state. Then check the\n // state of the form itself\n public validate = (component: InputComponent) => {\n const { onChange } = this.props;\n const { canChange } = this.state;\n\n // Trigger onChange\n if (canChange) {\n onChange(this.getModel(), this.isChanged());\n }\n\n const validationState = this.runValidation(component);\n // Run through the validations, split them up and call\n // the validator IF there is a value or it is required\n component.setState(validationState, this.validateForm);\n };\n\n // Validate the form by going through all child input components\n // and check their state\n public validateForm = () => {\n // We need a callback as we are validating all inputs again. This will\n // run when the last component has set its state\n const onValidationComplete = () => {\n const allIsValid = this.inputs.every((component) => component.state.isValid);\n\n this.setFormValidState(allIsValid);\n\n // Tell the form that it can start to trigger change events\n this.setState({\n canChange: true,\n });\n };\n\n // Run validation again in case affected by other inputs. The\n // last component validated will run the onValidationComplete callback\n this.inputs.forEach((component, index) => {\n const validationState = this.runValidation(component);\n const isFinalInput = index === this.inputs.length - 1;\n const callback = isFinalInput ? onValidationComplete : null;\n component.setState(validationState, callback);\n });\n\n // If there are no inputs, set state where form is ready to trigger\n // change event. New inputs might be added later\n if (!this.inputs.length) {\n this.setState(\n {\n canChange: true,\n },\n onValidationComplete,\n );\n }\n };\n\n public render() {\n const {\n /* eslint-disable @typescript-eslint/no-unused-vars */\n children,\n mapping,\n onChange,\n onInvalid,\n onInvalidSubmit,\n onReset,\n onSubmit,\n onValid,\n onValidSubmit,\n preventDefaultSubmit,\n preventExternalInvalidation,\n validationErrors,\n disabled,\n formElement,\n ...nonFormsyProps\n } = this.props;\n const { contextValue } = this.state;\n\n return React.createElement(\n FormsyContext.Provider,\n {\n value: contextValue,\n },\n React.createElement(\n formElement,\n {\n onReset: this.resetInternal,\n onSubmit: this.submit,\n ...nonFormsyProps,\n disabled,\n },\n children,\n ),\n );\n }\n}\n"],"names":["isArray","value","Array","isObject","isPlainObject","isTypeUndefined","isDate","Date","isFunction","isString","isNumber","isRegex","RegExp","isValueStringEmpty","isValueNullOrUndefined","undefined","isValueUndefined","noop","protectAgainstParamReassignment","isSame","a","b","length","every","item","index","toString","Object","keys","key","runRules","currentValues","validations","validationRules","results","errors","failed","success","forEach","validationName","validationsVal","validationRulesVal","addToResults","validation","push","Error","throttle","callback","interval","enableCall","args","apply","setTimeout","isExisty","isEmpty","isDefaultRequiredValue","matchRegexp","_values","regexp","test","REGEX_PATTERNS","ALPHA","ALPHANUMERIC","EMAIL","FLOAT","INT","NUMERIC","SPECIAL_WORDS","URL","WORDS","equals","eql","equalsField","values","field","isAlpha","isAlphanumeric","isEmail","isEmptyString","isFalse","isFloat","isInt","isLength","isNumeric","isSpecialWords","isTrue","isUndefined","isUrl","isWords","maxLength","minLength","addValidationRule","name","func","noFormsyErrorMessage","throwNoFormsyProvider","defaultValue","attachToForm","detachFromForm","isFormDisabled","isValidValue","validate","runValidation","React","createContext","convertValidationsToObject","split","reduce","validationsAccumulator","validateMethod","shift","map","arg","JSON","parse","e","validationsAccumulatorCopy","propTypes","innerRef","PropTypes","string","isRequired","required","oneOfType","bool","object","any","getDisplayName","component","displayName","utils","withFormsy","WrappedComponent","WithFormsyWrapper","props","messages","getErrorMessages","validationError","state","isValid","showRequired","requiredValidations","validateForm","setState","isPristine","formSubmitted","pristineValue","setValidations","componentDidMount","shouldComponentUpdate","nextProps","nextState","isChanged","some","k","isPropsChanged","isStateChanged","componentDidUpdate","prevProps","setValue","componentWillUnmount","render","propsForElement","errorMessage","getErrorMessage","errorMessages","hasValue","isFormSubmitted","resetValue","showError","getValue","ref","createElement","Component","validationErrors","FormsyContext","Consumer","contextValue","ONE_RENDER_FRAME","Formsy","prevInputNames","inputs","disabled","setInputValidationErrors","newInputNames","valueAccumulator","getCurrentValues","mapModel","preventExternalInvalidation","setFormValidState","allIsValid","onValid","onInvalid","model","mapping","returnModel","set","setFormPristine","resetModel","event","onReset","preventDefault","reset","data","has","get","componentValidationErrors","validationResults","requiredResults","emptyArray","error","filter","x","pos","arr","indexOf","onChange","canChange","getModel","throttledValidateForm","componentPos","slice","concat","getPristineValues","onSubmit","onValidSubmit","onInvalidSubmit","preventDefaultSubmit","updateInputsWithError","invalidate","entries","find","input","stringify","validationState","onValidationComplete","isFinalInput","isSubmitting","children","formElement","nonFormsyProps","Provider","resetInternal","submit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAIgBA,QAAQC;AACtB,SAAOC,KAAK,CAACF,OAAN,CAAcC,KAAd,CAAP;AACD;SAEeE,SAASF;AACvB,SAAOG,aAAa,CAACH,KAAD,CAApB;AACD;SAEeI,gBAAgBJ;AAC9B,SAAO,OAAOA,KAAP,KAAiB,WAAxB;AACD;SAEeK,OAAOL;AACrB,SAAOA,KAAK,YAAYM,IAAxB;AACD;SAEeC,WAAWP;AACzB,SAAOA,KAAK,KAAK,IAAV,IAAkB,OAAOA,KAAP,KAAiB,UAA1C;AACD;SAEeQ,SAASR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EAAAA,eAAe,EAAE3G,SAAS,CAAC1B,IANH;AAOxB2G,EAAAA,OAAO,EAAEjF,SAAS,CAAC1B,IAPK;AAQxBmI,EAAAA,QAAQ,EAAEzG,SAAS,CAAC1B,IARI;AASxBkG,EAAAA,OAAO,EAAExE,SAAS,CAAC1B,IATK;AAUxBoI,EAAAA,aAAa,EAAE1G,SAAS,CAAC1B,IAVD;AAWxBsI,EAAAA,oBAAoB,EAAE5G,SAAS,CAACK,IAXR;AAYxBgE,EAAAA,2BAA2B,EAAErE,SAAS,CAACK,IAZf;AAaxBkD,EAAAA,gBAAgB,EAAEvD,SAAS,CAACM;AAbJ,CAAZ;AAgBAsD,mBAAA,GAAqC;AACjDG,EAAAA,QAAQ,EAAE,KADuC;AAEjDY,EAAAA,OAAO,EAAE,IAFwC;AAGjDsB,EAAAA,QAAQ,EAAEtF,IAHuC;AAIjD8D,EAAAA,SAAS,EAAE9D,IAJsC;AAKjDgG,EAAAA,eAAe,EAAEhG,IALgC;AAMjDsE,EAAAA,OAAO,EAAEtE,IANwC;AAOjD8F,EAAAA,QAAQ,EAAE9F,IAPuC;AAQjD6D,EAAAA,OAAO,EAAE7D,IARwC;AASjD+F,EAAAA,aAAa,EAAE/F,IATkC;AAUjDiG,EAAAA,oBAAoB,EAAE,IAV2B;AAWjDvC,EAAAA,2BAA2B,EAAE,KAXoB;AAYjDd,EAAAA,gBAAgB,EAAE,EAZ+B;AAajDiE,EAAAA,WAAW,EAAE;AAboC,CAArC;;;;;"} \ No newline at end of file +{"version":3,"file":"formsy-react.esm.js","sources":["../src/utils.ts","../src/validationRules.ts","../src/FormsyContext.ts","../src/withFormsy.ts","../src/Formsy.ts"],"sourcesContent":["import { isPlainObject } from 'lodash';\n\nimport { ValidationError, Validations, Values } from './interfaces';\n\nexport function isArray(value: unknown): value is unknown[] {\n return Array.isArray(value);\n}\n\nexport function isObject(value: unknown): value is object {\n return isPlainObject(value);\n}\n\nexport function isTypeUndefined(value: unknown): value is undefined {\n return typeof value === 'undefined';\n}\n\nexport function isDate(value: unknown): value is Date {\n return value instanceof Date;\n}\n\nexport function isFunction(value: unknown): value is Function {\n return value !== null && typeof value === 'function';\n}\n\nexport function isString(value: unknown): value is string {\n return typeof value === 'string';\n}\n\nexport function isNumber(value: unknown): value is number {\n return typeof value === 'number';\n}\n\nexport function isRegex(value: unknown): value is RegExp {\n return value instanceof RegExp;\n}\n\nexport function isValueStringEmpty(value: string): boolean {\n return value === '';\n}\n\nexport function isValueNullOrUndefined(value: unknown): boolean {\n return value === null || value === undefined;\n}\n\nexport function isValueUndefined(value: unknown): boolean {\n return value === undefined;\n}\n\nexport function noop() {\n // do nothing.\n}\n\nexport function protectAgainstParamReassignment(value: unknown) {\n // Clone objects to avoid accidental param reassignment\n if (isObject(value)) return { ...value };\n if (isArray(value)) return [...value];\n return value;\n}\n\nexport function isSame(a: unknown, b: unknown) {\n if (typeof a !== typeof b) {\n return false;\n }\n\n if (isArray(a) && isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n\n return a.every((item, index) => isSame(item, b[index]));\n }\n\n if (isFunction(a) && isFunction(b)) {\n return a.toString() === b.toString();\n }\n\n if (isDate(a) && isDate(b)) {\n return a.toString() === b.toString();\n }\n\n if (isObject(a) && isObject(b)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n return Object.keys(a).every((key) => isSame(a[key], b[key]));\n }\n\n if (isRegex(a) && isRegex(b)) {\n return a.toString() === b.toString();\n }\n\n return a === b;\n}\n\ninterface RulesResult {\n errors: ValidationError[];\n failed: string[];\n success: string[];\n}\n\nexport function runRules(\n value: V,\n currentValues: Values,\n validations: Validations,\n validationRules: Validations,\n) {\n const results: RulesResult = {\n errors: [],\n failed: [],\n success: [],\n };\n\n Object.keys(validations).forEach((validationName) => {\n const validationsVal = validations[validationName];\n const validationRulesVal = validationRules[validationName];\n const addToResults = (validation) => {\n if (isString(validation)) {\n results.errors.push(validation);\n results.failed.push(validationName);\n } else if (!validation) {\n results.failed.push(validationName);\n } else {\n results.success.push(validationName);\n }\n };\n\n if (validationRulesVal && isFunction(validationsVal)) {\n throw new Error(`Formsy does not allow you to override default validations: ${validationName}`);\n }\n\n if (!validationRulesVal && !isFunction(validationsVal)) {\n throw new Error(`Formsy does not have the validation rule: ${validationName}`);\n }\n\n if (isFunction(validationsVal)) {\n return addToResults(validationsVal(currentValues, value));\n }\n\n return addToResults(validationRulesVal(currentValues, value, validationsVal));\n });\n\n return results;\n}\n\nexport function throttle(callback, interval) {\n let enableCall = true;\n\n return function (...args) {\n if (!enableCall) return;\n\n enableCall = false;\n callback.apply(this, args);\n setTimeout(() => (enableCall = true), interval);\n };\n}\n","import { ValidationFunction, Values } from './interfaces';\nimport {\n isNumber,\n isString,\n isTypeUndefined,\n isValueNullOrUndefined,\n isValueStringEmpty,\n isValueUndefined,\n} from './utils';\n\nexport function isExisty(value: V) {\n return !isValueNullOrUndefined(value);\n}\n\nexport function isEmpty(value: V) {\n if (isString(value)) {\n return isValueStringEmpty(value);\n }\n if (isTypeUndefined(value)) {\n return false;\n }\n return isValueUndefined(value);\n}\n\nexport function isDefaultRequiredValue(value: unknown) {\n return isString(value) ? isValueStringEmpty(value) : isValueNullOrUndefined(value);\n}\n\nexport function matchRegexp(_values: Values, value: V, regexp: RegExp) {\n return !isExisty(value) || isEmpty(value) || regexp.test(`${value}`);\n}\n\ninterface Validations {\n [key: string]: ValidationFunction;\n}\n\nconst REGEX_PATTERNS = {\n ALPHA: /^[A-Z]+$/i,\n ALPHANUMERIC: /^[0-9A-Z]+$/i,\n EMAIL:\n /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/i, // from http://emailregex.com/\n FLOAT: /^(?:[-+]?(?:\\d+))?(?:\\.\\d*)?(?:[eE][+-]?(?:\\d+))?$/,\n INT: /^(?:[-+]?(?:0|[1-9]\\d*))$/,\n NUMERIC: /^[-+]?(?:\\d*[.])?\\d+$/,\n SPECIAL_WORDS: /^[\\sA-ZÀ-ÖØ-öø-ÿ]+$/i,\n URL: /^(?:\\w+:)?\\/\\/([^\\s.]+\\.\\S{2}|localhost[:?\\d]*)\\S*$/i,\n WORDS: /^[A-Z\\s]+$/i,\n};\n\nconst validations: Validations = {\n equals: (_values, value: V, eql: V) => !isExisty(value) || isEmpty(value) || value === eql,\n equalsField: (values, value: V, field: string) => value === values[field],\n isAlpha: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.ALPHA),\n isAlphanumeric: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.ALPHANUMERIC),\n isDefaultRequiredValue: (_values, value: V) => isDefaultRequiredValue(value),\n isEmail: (values, value: string) => matchRegexp(values, value, REGEX_PATTERNS.EMAIL),\n isEmptyString: (_values, value: string) => isEmpty(value),\n isExisty: (_values, value: V) => isExisty(value),\n isFalse: (_values, value: boolean | string) => value === false,\n isFloat: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.FLOAT),\n isInt: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.INT),\n isLength: (_values, value: string, length: number) => !isExisty(value) || isEmpty(value) || value.length === length,\n isNumeric: (values, value: V) => isNumber(value) || matchRegexp(values, value, REGEX_PATTERNS.NUMERIC),\n isSpecialWords: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.SPECIAL_WORDS),\n isTrue: (_values, value: boolean | string) => value === true,\n isUndefined: (_values, value: V) => isValueUndefined(value),\n isUrl: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.URL),\n isWords: (values, value: V) => matchRegexp(values, value, REGEX_PATTERNS.WORDS),\n matchRegexp,\n maxLength: (_values, value: string, length: number) => !isExisty(value) || value.length <= length,\n minLength: (_values, value: string, length: number) => !isExisty(value) || isEmpty(value) || value.length >= length,\n};\n\nexport const addValidationRule = (name: string, func: ValidationFunction) => {\n validations[name] = func;\n};\n\nexport default validations;\n","import React from 'react';\nimport { FormsyContextInterface } from './interfaces';\n\nconst noFormsyErrorMessage = 'Could not find Formsy Context Provider. Did you use withFormsy outside ?';\n\nconst throwNoFormsyProvider = () => {\n // istanbul ignore next\n throw new Error(noFormsyErrorMessage);\n};\n\nconst defaultValue = {\n attachToForm: throwNoFormsyProvider,\n detachFromForm: throwNoFormsyProvider,\n isFormDisabled: true,\n isValidValue: throwNoFormsyProvider,\n validate: throwNoFormsyProvider,\n runValidation: throwNoFormsyProvider,\n};\n\nexport default React.createContext(defaultValue);\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport FormsyContext from './FormsyContext';\nimport {\n ComponentWithStaticAttributes,\n FormsyContextInterface,\n RequiredValidation,\n ValidationError,\n Validations,\n WrappedComponentClass,\n} from './interfaces';\n\nimport * as utils from './utils';\nimport { isString } from './utils';\nimport { isDefaultRequiredValue } from './validationRules';\n\n/* eslint-disable react/default-props-match-prop-types */\n\nconst convertValidationsToObject = (validations: false | Validations): Validations => {\n if (isString(validations)) {\n return validations.split(/,(?![^{[]*[}\\]])/g).reduce((validationsAccumulator, validation) => {\n let args: string[] = validation.split(':');\n const validateMethod: string = args.shift();\n\n args = args.map((arg) => {\n try {\n return JSON.parse(arg);\n } catch (e) {\n return arg; // It is a string if it can not parse it\n }\n });\n\n if (args.length > 1) {\n throw new Error(\n 'Formsy does not support multiple args on string validations. Use object format of validations instead.',\n );\n }\n\n // Avoid parameter reassignment\n const validationsAccumulatorCopy: Validations = { ...validationsAccumulator };\n validationsAccumulatorCopy[validateMethod] = args.length ? args[0] : true;\n return validationsAccumulatorCopy;\n }, {});\n }\n\n return validations || {};\n};\n\nexport const propTypes = {\n innerRef: PropTypes.func,\n name: PropTypes.string.isRequired,\n required: PropTypes.oneOfType([PropTypes.bool, PropTypes.object, PropTypes.string]),\n validations: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n value: PropTypes.any, // eslint-disable-line react/forbid-prop-types\n};\n\nexport interface WrapperProps {\n innerRef?: (ref: React.Ref) => void;\n name: string;\n required?: RequiredValidation;\n validationError?: ValidationError;\n validationErrors?: { [key: string]: ValidationError };\n validations?: Validations;\n value?: V;\n}\n\nexport interface WrapperState {\n [key: string]: unknown;\n\n formSubmitted: boolean;\n isPristine: boolean;\n isRequired: boolean;\n isValid: boolean;\n pristineValue: V;\n validationError: ValidationError[];\n value: V;\n}\n\nexport interface InjectedProps {\n errorMessage: ValidationError;\n errorMessages: ValidationError[];\n hasValue: boolean;\n isFormDisabled: boolean;\n isFormSubmitted: boolean;\n isPristine: boolean;\n isRequired: boolean;\n isValid: boolean;\n isValidValue: (value: V) => boolean;\n ref?: React.Ref;\n resetValue: () => void;\n setValidations: (validations: Validations, required: RequiredValidation) => void;\n setValue: (value: V, validate?: boolean) => void;\n showError: boolean;\n showRequired: boolean;\n}\n\nexport interface WrapperInstanceMethods {\n getErrorMessage: () => null | ValidationError;\n getErrorMessages: () => ValidationError[];\n getValue: () => V;\n isFormDisabled: () => boolean;\n isFormSubmitted: () => boolean;\n isValid: () => boolean;\n isValidValue: (value: V) => boolean;\n setValue: (value: V, validate?: boolean) => void;\n}\n\nexport type PassDownProps = WrapperProps & InjectedProps;\n\nfunction getDisplayName(component: WrappedComponentClass) {\n return component.displayName || component.name || (utils.isString(component) ? component : 'Component');\n}\n\nexport default function withFormsy(\n WrappedComponent: React.ComponentType>,\n): React.ComponentType, keyof InjectedProps>> {\n class WithFormsyWrapper\n extends React.Component & FormsyContextInterface, WrapperState>\n implements WrapperInstanceMethods\n {\n public validations?: Validations;\n\n public requiredValidations?: Validations;\n\n public static displayName = `Formsy(${getDisplayName(WrappedComponent)})`;\n\n public static propTypes: any = propTypes;\n\n public static defaultProps: any = {\n innerRef: null,\n required: false,\n validationError: '',\n validationErrors: {},\n validations: null,\n value: (WrappedComponent as ComponentWithStaticAttributes).defaultValue,\n };\n\n public constructor(props) {\n super(props);\n const { runValidation, validations, required, value } = props;\n\n this.state = { value } as any;\n\n this.setValidations(validations, required);\n\n this.state = {\n formSubmitted: false,\n isPristine: true,\n pristineValue: props.value,\n value: props.value,\n ...runValidation(this, props.value),\n };\n }\n\n public componentDidMount() {\n const { name, attachToForm } = this.props;\n\n if (!name) {\n throw new Error('Form Input requires a name property when used');\n }\n\n attachToForm(this);\n }\n\n public shouldComponentUpdate(nextProps, nextState) {\n const { props, state } = this;\n const isChanged = (a: object, b: object): boolean => Object.keys(a).some((k) => a[k] !== b[k]);\n const isPropsChanged = isChanged(props, nextProps);\n const isStateChanged = isChanged(state, nextState);\n\n return isPropsChanged || isStateChanged;\n }\n\n public componentDidUpdate(prevProps) {\n const { value, validations, required, validate } = this.props;\n\n // If the value passed has changed, set it. If value is not passed it will\n // internally update, and this will never run\n if (!utils.isSame(value, prevProps.value)) {\n this.setValue(value);\n }\n\n // If validations or required is changed, run a new validation\n if (!utils.isSame(validations, prevProps.validations) || !utils.isSame(required, prevProps.required)) {\n this.setValidations(validations, required);\n validate(this);\n }\n }\n\n // Detach it when component unmounts\n public componentWillUnmount() {\n const { detachFromForm } = this.props;\n detachFromForm(this);\n }\n\n public getErrorMessage = (): ValidationError | null => {\n const messages = this.getErrorMessages();\n return messages.length ? messages[0] : null;\n };\n\n public getErrorMessages = (): ValidationError[] => {\n const { validationError } = this.state;\n\n if (!this.isValid() || this.showRequired()) {\n return validationError || [];\n }\n return [];\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public getValue = (): V => this.state.value;\n\n public setValidations = (validations: Validations, required: RequiredValidation): void => {\n // Add validations to the store itself as the props object can not be modified\n this.validations = convertValidationsToObject(validations) || {};\n this.requiredValidations =\n required === true ? { isDefaultRequiredValue: required } : convertValidationsToObject(required);\n };\n\n // By default, we validate after the value has been set.\n // A user can override this and pass a second parameter of `false` to skip validation.\n public setValue = (value: V, validate = true): void => {\n const { validate: validateForm } = this.props;\n\n if (!validate) {\n this.setState({ value });\n } else {\n this.setState(\n {\n value,\n isPristine: false,\n },\n () => {\n validateForm(this);\n },\n );\n }\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public hasValue = () => {\n const { value } = this.state;\n return isDefaultRequiredValue(value);\n };\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormDisabled = (): boolean => this.props.isFormDisabled;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormSubmitted = (): boolean => this.state.formSubmitted;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isPristine = (): boolean => this.state.isPristine;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isRequired = (): boolean => !!this.props.required;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isValid = (): boolean => this.state.isValid;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isValidValue = (value: V) => this.props.isValidValue(this, value);\n\n public resetValue = () => {\n const { pristineValue } = this.state;\n const { validate } = this.props;\n\n this.setState(\n {\n value: pristineValue,\n isPristine: true,\n },\n () => {\n validate(this);\n },\n );\n };\n\n public showError = (): boolean => !this.showRequired() && !this.isValid();\n\n // eslint-disable-next-line react/destructuring-assignment\n public showRequired = (): boolean => this.state.isRequired;\n\n public render() {\n const { innerRef } = this.props;\n const propsForElement: T & PassDownProps = {\n ...this.props,\n errorMessage: this.getErrorMessage(),\n errorMessages: this.getErrorMessages(),\n hasValue: this.hasValue(),\n isFormDisabled: this.isFormDisabled(),\n isFormSubmitted: this.isFormSubmitted(),\n isPristine: this.isPristine(),\n isRequired: this.isRequired(),\n isValid: this.isValid(),\n isValidValue: this.isValidValue,\n resetValue: this.resetValue,\n setValidations: this.setValidations,\n setValue: this.setValue,\n showError: this.showError(),\n showRequired: this.showRequired(),\n value: this.getValue(),\n };\n\n if (innerRef) {\n propsForElement.ref = innerRef;\n }\n\n return React.createElement(WrappedComponent, propsForElement);\n }\n }\n\n // eslint-disable-next-line react/display-name\n return (props) =>\n React.createElement(FormsyContext.Consumer, null, (contextValue) => {\n return React.createElement(WithFormsyWrapper, { ...props, ...contextValue });\n });\n}\n","/* eslint-disable react/no-unused-state, react/default-props-match-prop-types */\nimport { get, has, set } from 'lodash';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport FormsyContext from './FormsyContext';\nimport {\n FormsyContextInterface,\n IModel,\n InputComponent,\n IResetModel,\n IUpdateInputsWithError,\n IUpdateInputsWithValue,\n ValidationError,\n} from './interfaces';\nimport { throttle, isObject, isString } from './utils';\nimport * as utils from './utils';\nimport validationRules from './validationRules';\nimport { PassDownProps } from './withFormsy';\n\ntype FormHTMLAttributesCleaned = Omit, 'onChange' | 'onSubmit'>;\n\ntype OnSubmitCallback = (\n model: IModel,\n resetModel: IResetModel,\n updateInputsWithError: IUpdateInputsWithError,\n event: React.SyntheticEvent,\n) => void;\n\ntype FormElementType =\n | string\n | React.ComponentType<{\n onReset?: (e: React.SyntheticEvent) => void;\n onSubmit?: (e: React.SyntheticEvent) => void;\n disabled?: boolean;\n children?: React.ReactChildren;\n }>;\n\nexport interface FormsyProps extends FormHTMLAttributesCleaned {\n disabled: boolean;\n mapping: null | ((model: IModel) => IModel);\n onChange: (model: IModel, isChanged: boolean) => void;\n onInvalid: () => void;\n onReset?: () => void;\n onSubmit?: OnSubmitCallback;\n onValidSubmit?: OnSubmitCallback;\n onInvalidSubmit: OnSubmitCallback;\n onValid: () => void;\n preventDefaultSubmit?: boolean;\n preventExternalInvalidation?: boolean;\n validationErrors?: null | object;\n formElement?: FormElementType;\n}\n\nexport interface FormsyState {\n canChange: boolean;\n contextValue: FormsyContextInterface;\n formSubmitted?: boolean;\n isPristine?: boolean;\n isSubmitting: boolean;\n isValid: boolean;\n}\n\nconst ONE_RENDER_FRAME = 66;\n\nexport class Formsy extends React.Component {\n public inputs: InstanceType>[];\n\n public emptyArray: any[];\n\n public prevInputNames: any[] | null = null;\n\n public static displayName = 'Formsy';\n\n public static propTypes = {\n disabled: PropTypes.bool,\n mapping: PropTypes.func,\n formElement: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]),\n onChange: PropTypes.func,\n onInvalid: PropTypes.func,\n onInvalidSubmit: PropTypes.func,\n onReset: PropTypes.func,\n onSubmit: PropTypes.func,\n onValid: PropTypes.func,\n onValidSubmit: PropTypes.func,\n preventDefaultSubmit: PropTypes.bool,\n preventExternalInvalidation: PropTypes.bool,\n validationErrors: PropTypes.object, // eslint-disable-line\n };\n\n public static defaultProps: Partial = {\n disabled: false,\n mapping: null,\n onChange: utils.noop,\n onInvalid: utils.noop,\n onInvalidSubmit: utils.noop,\n onReset: utils.noop,\n onSubmit: utils.noop,\n onValid: utils.noop,\n onValidSubmit: utils.noop,\n preventDefaultSubmit: true,\n preventExternalInvalidation: false,\n validationErrors: {},\n formElement: 'form',\n };\n\n private readonly throttledValidateForm: () => void;\n\n public constructor(props: FormsyProps) {\n super(props);\n this.state = {\n canChange: false,\n isSubmitting: false,\n isValid: true,\n contextValue: {\n attachToForm: this.attachToForm,\n detachFromForm: this.detachFromForm,\n isFormDisabled: props.disabled,\n isValidValue: this.isValidValue,\n validate: this.validate,\n runValidation: this.runValidation,\n },\n };\n this.inputs = [];\n this.emptyArray = [];\n this.throttledValidateForm = throttle(this.validateForm, ONE_RENDER_FRAME);\n }\n\n public componentDidMount = () => {\n this.prevInputNames = this.inputs.map((component) => component.props.name);\n this.validateForm();\n };\n\n public componentDidUpdate = (prevProps: FormsyProps) => {\n const { validationErrors, disabled } = this.props;\n\n if (validationErrors && isObject(validationErrors) && Object.keys(validationErrors).length > 0) {\n this.setInputValidationErrors(validationErrors);\n }\n\n const newInputNames = this.inputs.map((component) => component.props.name);\n if (this.prevInputNames && !utils.isSame(this.prevInputNames, newInputNames)) {\n this.prevInputNames = newInputNames;\n this.validateForm();\n }\n\n // Keep the disabled value in state/context the same as from props\n if (disabled !== prevProps.disabled) {\n // eslint-disable-next-line\n this.setState((state) => ({\n ...state,\n contextValue: {\n ...state.contextValue,\n isFormDisabled: disabled,\n },\n }));\n }\n };\n\n public getCurrentValues = () =>\n this.inputs.reduce((valueAccumulator, component) => {\n const {\n props: { name },\n state: { value },\n } = component;\n // eslint-disable-next-line no-param-reassign\n valueAccumulator[name] = utils.protectAgainstParamReassignment(value);\n return valueAccumulator;\n }, {});\n\n public getModel = () => {\n const currentValues = this.getCurrentValues();\n return this.mapModel(currentValues);\n };\n\n public getPristineValues = () =>\n this.inputs.reduce((valueAccumulator, component) => {\n const {\n props: { name, value },\n } = component;\n // eslint-disable-next-line no-param-reassign\n valueAccumulator[name] = utils.protectAgainstParamReassignment(value);\n return valueAccumulator;\n }, {});\n\n public setFormPristine = (isPristine: boolean) => {\n this.setState({\n formSubmitted: !isPristine,\n });\n\n // Iterate through each component and set it as pristine\n // or \"dirty\".\n this.inputs.forEach((component) => {\n component.setState({\n formSubmitted: !isPristine,\n isPristine,\n });\n });\n };\n\n public setInputValidationErrors = (errors) => {\n const { preventExternalInvalidation } = this.props;\n const { isValid } = this.state;\n\n this.inputs.forEach((component) => {\n const { name } = component.props;\n component.setState({\n isValid: !(name in errors),\n validationError: isString(errors[name]) ? [errors[name]] : errors[name],\n });\n });\n if (!preventExternalInvalidation && isValid) {\n this.setFormValidState(false);\n }\n };\n\n public setFormValidState = (allIsValid: boolean) => {\n const { onValid, onInvalid } = this.props;\n\n this.setState({\n isValid: allIsValid,\n });\n\n if (allIsValid) {\n onValid();\n } else {\n onInvalid();\n }\n };\n\n public isValidValue = (component, value) => this.runValidation(component, value).isValid;\n\n // eslint-disable-next-line react/destructuring-assignment\n public isFormDisabled = () => this.props.disabled;\n\n public mapModel = (model: IModel): IModel => {\n const { mapping } = this.props;\n\n if (mapping) {\n return mapping(model);\n }\n\n const returnModel = {};\n Object.keys(model).forEach((key) => {\n set(returnModel, key, model[key]);\n });\n return returnModel;\n };\n\n public reset = (model?: IModel) => {\n this.setFormPristine(true);\n this.resetModel(model);\n };\n\n private resetInternal = (event) => {\n const { onReset } = this.props;\n\n event.preventDefault();\n this.reset();\n if (onReset) {\n onReset();\n }\n };\n\n // Reset each key in the model to the original / initial / specified value\n private resetModel: IResetModel = (data) => {\n this.inputs.forEach((component) => {\n const { name } = component.props;\n if (data && has(data, name)) {\n component.setValue(get(data, name));\n } else {\n component.resetValue();\n }\n });\n this.validateForm();\n };\n\n // Checks validation on current value or a passed value\n public runValidation = (\n component: InputComponent,\n value = component.state.value,\n ): { isRequired: boolean; isValid: boolean; validationError: ValidationError[] } => {\n const { validationErrors } = this.props;\n const { validationError, validationErrors: componentValidationErrors, name } = component.props;\n const currentValues = this.getCurrentValues();\n const validationResults = utils.runRules(value, currentValues, component.validations, validationRules);\n const requiredResults = utils.runRules(value, currentValues, component.requiredValidations, validationRules);\n const isRequired = Object.keys(component.requiredValidations).length ? !!requiredResults.success.length : false;\n const isValid = !validationResults.failed.length && !(validationErrors && validationErrors[component.props.name]);\n\n return {\n isRequired,\n isValid: isRequired ? false : isValid,\n validationError: (() => {\n if (isValid && !isRequired) {\n return this.emptyArray;\n }\n\n if (validationResults.errors.length) {\n return validationResults.errors;\n }\n\n if (validationErrors && validationErrors[name]) {\n return isString(validationErrors[name]) ? [validationErrors[name]] : validationErrors[name];\n }\n\n if (isRequired) {\n const error = componentValidationErrors[requiredResults.success[0]] || validationError;\n return error ? [error] : null;\n }\n\n if (validationResults.failed.length) {\n return validationResults.failed\n .map((failed) => (componentValidationErrors[failed] ? componentValidationErrors[failed] : validationError))\n .filter((x, pos, arr) => arr.indexOf(x) === pos); // remove duplicates\n }\n\n // This line is not reachable\n // istanbul ignore next\n return undefined;\n })(),\n };\n };\n\n // Method put on each input component to register\n // itself to the form\n public attachToForm = (component) => {\n if (this.inputs.indexOf(component) === -1) {\n this.inputs.push(component);\n }\n\n const { onChange } = this.props;\n const { canChange } = this.state;\n\n // Trigger onChange\n if (canChange) {\n onChange(this.getModel(), this.isChanged());\n }\n\n // Will be triggered immediately & every one frame rate\n this.throttledValidateForm();\n };\n\n // Method put on each input component to unregister\n // itself from the form\n public detachFromForm = (component: InputComponent) => {\n const componentPos = this.inputs.indexOf(component);\n\n if (componentPos !== -1) {\n this.inputs = this.inputs.slice(0, componentPos).concat(this.inputs.slice(componentPos + 1));\n }\n\n this.validateForm();\n };\n\n // Checks if the values have changed from their initial value\n public isChanged = () => !utils.isSame(this.getPristineValues(), this.getCurrentValues());\n\n // Update model, submit to url prop and send the model\n public submit = (event?: React.SyntheticEvent) => {\n const { onSubmit, onValidSubmit, onInvalidSubmit, preventDefaultSubmit } = this.props;\n const { isValid } = this.state;\n\n if (preventDefaultSubmit && event && event.preventDefault) {\n event.preventDefault();\n }\n\n // Trigger form as not pristine.\n // If any inputs have not been touched yet this will make them dirty\n // so validation becomes visible (if based on isPristine)\n this.setFormPristine(false);\n const model = this.getModel();\n onSubmit(model, this.resetModel, this.updateInputsWithError, event);\n\n if (isValid) {\n onValidSubmit(model, this.resetModel, this.updateInputsWithError, event);\n } else {\n onInvalidSubmit(model, this.resetModel, this.updateInputsWithError, event);\n }\n };\n\n // Go through errors from server and grab the components\n // stored in the inputs map. Change their state to invalid\n // and set the serverError message\n public updateInputsWithError: IUpdateInputsWithError = (errors, invalidate) => {\n const { preventExternalInvalidation } = this.props;\n const { isValid } = this.state;\n\n Object.entries(errors).forEach(([name, error]) => {\n const component = this.inputs.find((input) => input.props.name === name);\n if (!component) {\n throw new Error(\n `You are trying to update an input that does not exist. Verify errors object with input names. ${JSON.stringify(\n errors,\n )}`,\n );\n }\n component.setState({\n isValid: preventExternalInvalidation,\n validationError: utils.isString(error) ? [error] : error,\n });\n });\n\n if (invalidate && isValid) {\n this.setFormValidState(false);\n }\n };\n\n // Set the value of components\n public updateInputsWithValue: IUpdateInputsWithValue = (data, validate) => {\n this.inputs.forEach((component) => {\n const { name } = component.props;\n if (data && has(data, name)) {\n component.setValue(get(data, name), validate);\n }\n });\n };\n\n // Use the binded values and the actual input value to\n // validate the input and set its state. Then check the\n // state of the form itself\n public validate = (component: InputComponent) => {\n const { onChange } = this.props;\n const { canChange } = this.state;\n\n // Trigger onChange\n if (canChange) {\n onChange(this.getModel(), this.isChanged());\n }\n\n const validationState = this.runValidation(component);\n // Run through the validations, split them up and call\n // the validator IF there is a value or it is required\n component.setState(validationState, this.validateForm);\n };\n\n // Validate the form by going through all child input components\n // and check their state\n public validateForm = () => {\n // We need a callback as we are validating all inputs again. This will\n // run when the last component has set its state\n const onValidationComplete = () => {\n const allIsValid = this.inputs.every((component) => component.state.isValid);\n\n this.setFormValidState(allIsValid);\n\n // Tell the form that it can start to trigger change events\n this.setState({\n canChange: true,\n });\n };\n\n // Run validation again in case affected by other inputs. The\n // last component validated will run the onValidationComplete callback\n this.inputs.forEach((component, index) => {\n const validationState = this.runValidation(component);\n const isFinalInput = index === this.inputs.length - 1;\n const callback = isFinalInput ? onValidationComplete : null;\n component.setState(validationState, callback);\n });\n\n // If there are no inputs, set state where form is ready to trigger\n // change event. New inputs might be added later\n if (!this.inputs.length) {\n this.setState(\n {\n canChange: true,\n },\n onValidationComplete,\n );\n }\n };\n\n public render() {\n const {\n /* eslint-disable @typescript-eslint/no-unused-vars */\n children,\n mapping,\n onChange,\n onInvalid,\n onInvalidSubmit,\n onReset,\n onSubmit,\n onValid,\n onValidSubmit,\n preventDefaultSubmit,\n preventExternalInvalidation,\n validationErrors,\n disabled,\n formElement,\n ...nonFormsyProps\n } = this.props;\n const { contextValue } = this.state;\n\n return React.createElement(\n FormsyContext.Provider,\n {\n value: contextValue,\n },\n React.createElement(\n formElement,\n {\n onReset: this.resetInternal,\n onSubmit: this.submit,\n ...nonFormsyProps,\n disabled,\n },\n children,\n ),\n );\n }\n}\n"],"names":["isArray","value","Array","isObject","isPlainObject","isTypeUndefined","isDate","Date","isFunction","isString","isNumber","isRegex","RegExp","isValueStringEmpty","isValueNullOrUndefined","undefined","isValueUndefined","noop","protectAgainstParamReassignment","isSame","a","b","length","every","item","index","toString","Object","keys","key","runRules","currentValues","validations","validationRules","results","errors","failed","success","forEach","validationName","validationsVal","validationRulesVal","addToResults","validation","push","Error","throttle","callback","interval","enableCall","args","apply","setTimeout","isExisty","isEmpty","isDefaultRequiredValue","matchRegexp","_values","regexp","test","REGEX_PATTERNS","ALPHA","ALPHANUMERIC","EMAIL","FLOAT","INT","NUMERIC","SPECIAL_WORDS","URL","WORDS","equals","eql","equalsField","values","field","isAlpha","isAlphanumeric","isEmail","isEmptyString","isFalse","isFloat","isInt","isLength","isNumeric","isSpecialWords","isTrue","isUndefined","isUrl","isWords","maxLength","minLength","addValidationRule","name","func","noFormsyErrorMessage","throwNoFormsyProvider","defaultValue","attachToForm","detachFromForm","isFormDisabled","isValidValue","validate","runValidation","React","createContext","convertValidationsToObject","split","reduce","validationsAccumulator","validateMethod","shift","map","arg","JSON","parse","e","validationsAccumulatorCopy","propTypes","innerRef","PropTypes","string","isRequired","required","oneOfType","bool","object","any","getDisplayName","component","displayName","utils","withFormsy","WrappedComponent","WithFormsyWrapper","props","messages","getErrorMessages","validationError","state","isValid","showRequired","requiredValidations","validateForm","setState","isPristine","formSubmitted","pristineValue","setValidations","componentDidMount","shouldComponentUpdate","nextProps","nextState","isChanged","some","k","isPropsChanged","isStateChanged","componentDidUpdate","prevProps","setValue","componentWillUnmount","render","propsForElement","errorMessage","getErrorMessage","errorMessages","hasValue","isFormSubmitted","resetValue","showError","getValue","ref","createElement","Component","validationErrors","FormsyContext","Consumer","contextValue","ONE_RENDER_FRAME","Formsy","prevInputNames","inputs","disabled","setInputValidationErrors","newInputNames","valueAccumulator","getCurrentValues","mapModel","preventExternalInvalidation","setFormValidState","allIsValid","onValid","onInvalid","model","mapping","returnModel","set","setFormPristine","resetModel","event","onReset","preventDefault","reset","data","has","get","componentValidationErrors","validationResults","requiredResults","emptyArray","error","filter","x","pos","arr","indexOf","onChange","canChange","getModel","throttledValidateForm","componentPos","slice","concat","getPristineValues","onSubmit","onValidSubmit","onInvalidSubmit","preventDefaultSubmit","updateInputsWithError","invalidate","entries","find","input","stringify","validationState","onValidationComplete","isFinalInput","isSubmitting","children","formElement","nonFormsyProps","Provider","resetInternal","submit"],"mappings":";;;;;;;;;;;;;;;;;;;;;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AA,gBAAgB,EAAE,EAZ+B;AAajDiE,EAAAA,WAAW,EAAE;AAboC,CAArC;;;;;"} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 6ddea74a..a1b9205b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@adobe/css-tools@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.0.1.tgz#b38b444ad3aa5fedbb15f2f746dcd934226a12dd" + integrity sha512-+u76oB43nOHrF4DDWRLWDCtci7f3QJoEBigemIdIeTi1ODqjx6Tad9NCVnPRwewWlKkVab5PlK8DCtPTyX7S8g== + "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.11", "@babel/code-frame@^7.5.5": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" @@ -9,6 +14,13 @@ dependencies: "@babel/highlight" "^7.10.4" +"@babel/code-frame@^7.12.13": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" + integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== + dependencies: + "@babel/highlight" "^7.18.6" + "@babel/compat-data@^7.12.5", "@babel/compat-data@^7.12.7": version "7.12.7" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.12.7.tgz#9329b4782a7d6bbd7eef57e11addf91ee3ef1e41" @@ -227,6 +239,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== +"@babel/helper-validator-identifier@^7.18.6": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" + integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== + "@babel/helper-validator-option@^7.12.1", "@babel/helper-validator-option@^7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.11.tgz#d66cb8b7a3e7fe4c6962b32020a131ecf0847f4f" @@ -260,6 +277,15 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/highlight@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" + integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== + dependencies: + "@babel/helper-validator-identifier" "^7.18.6" + chalk "^2.0.0" + js-tokens "^4.0.0" + "@babel/parser@^7.1.0", "@babel/parser@^7.11.5", "@babel/parser@^7.12.10", "@babel/parser@^7.12.11", "@babel/parser@^7.12.7", "@babel/parser@^7.7.0": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.11.tgz#9ce3595bcd74bc5c466905e86c535b8b25011e79" @@ -817,13 +843,20 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.12.5", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.12.5": version "7.18.9" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== dependencies: regenerator-runtime "^0.13.4" +"@babel/runtime@^7.9.2": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.1.tgz#1148bb33ab252b165a06698fde7576092a78b4a9" + integrity sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg== + dependencies: + regenerator-runtime "^0.13.10" + "@babel/template@^7.10.4", "@babel/template@^7.12.7", "@babel/template@^7.3.3": version "7.12.7" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.7.tgz#c817233696018e39fbb6c491d2fb684e05ed43bc" @@ -940,6 +973,13 @@ "@jest/types" "^25.5.0" jest-mock "^25.5.0" +"@jest/expect-utils@^29.2.2": + version "29.2.2" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.2.2.tgz#460a5b5a3caf84d4feb2668677393dd66ff98665" + integrity sha512-vwnVmrVhTmGgQzyvcpze08br91OL61t9O0lJMDyb6Y/D8EKQ9V7rGUb/p7PDt0GPzK0zFYqXWFo4EO2legXmkg== + dependencies: + jest-get-type "^29.2.0" + "@jest/fake-timers@^25.5.0": version "25.5.0" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-25.5.0.tgz#46352e00533c024c90c2bc2ad9f2959f7f114185" @@ -992,10 +1032,10 @@ optionalDependencies: node-notifier "^6.0.0" -"@jest/schemas@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-28.1.3.tgz#ad8b86a66f11f33619e3d7e1dcddd7f2d40ff905" - integrity sha512-/l/VWsdt/aBXgjshLWOFyFt3IVdYypu5y2Wn2rOO1un6nkqIn8SLXzgIMYXFyYsRWDyF5EthmKJMIdJvk08grg== +"@jest/schemas@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.0.0.tgz#5f47f5994dd4ef067fb7b4188ceac45f77fe952a" + integrity sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA== dependencies: "@sinclair/typebox" "^0.24.1" @@ -1072,6 +1112,18 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" +"@jest/types@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.2.1.tgz#ec9c683094d4eb754e41e2119d8bdaef01cf6da0" + integrity sha512-O/QNDQODLnINEPAI0cl9U6zUIDXEWXt6IC1o2N2QENuos7hlGUIthlKyV4p6ki3TvXFX071blj8HUhgLGquPjw== + dependencies: + "@jest/schemas" "^29.0.0" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + "@rollup/plugin-babel@^5.1.0": version "5.2.2" resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.2.2.tgz#e5623a01dd8e37e004ba87f2de218c611727d9b2" @@ -1137,9 +1189,9 @@ any-observable "^0.3.0" "@sinclair/typebox@^0.24.1": - version "0.24.20" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.20.tgz#11a657875de6008622d53f56e063a6347c51a6dd" - integrity sha512-kVaO5aEFZb33nPMTZBxiPEkY+slxiPtqC7QX8f9B3eGOMBvEfuMfxp9DSTTCsRJPumPKjrge4yagyssO4q6qzQ== + version "0.24.51" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f" + integrity sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA== "@sindresorhus/is@^0.14.0": version "0.14.0" @@ -1175,15 +1227,15 @@ pretty-format "^27.0.2" "@testing-library/jest-dom@^5.16.4": - version "5.16.4" - resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-5.16.4.tgz#938302d7b8b483963a3ae821f1c0808f872245cd" - integrity sha512-Gy+IoFutbMQcky0k+bqqumXZ1cTGswLsFqmNLzNdSKkU9KGV2u9oXhukCbbJ9/LRPKiqwxEE8VpV/+YZlfkPUA== + version "5.16.5" + resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-5.16.5.tgz#3912846af19a29b2dbf32a6ae9c31ef52580074e" + integrity sha512-N5ixQ2qKpi5OLYfwQmUb/5mSV9LneAcaUfp32pn4yCnpb8r/Yz0pXFPck21dIicKmi+ta5WRAknkZCfA8refMA== dependencies: + "@adobe/css-tools" "^4.0.1" "@babel/runtime" "^7.9.2" "@types/testing-library__jest-dom" "^5.9.1" aria-query "^5.0.0" chalk "^3.0.0" - css "^3.0.0" css.escape "^1.5.1" dom-accessibility-api "^0.5.6" lodash "^4.17.15" @@ -1266,7 +1318,12 @@ dependencies: "@types/node" "*" -"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" + integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== + +"@types/istanbul-lib-coverage@^2.0.1": version "2.0.3" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" integrity sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw== @@ -1287,19 +1344,19 @@ "@types/istanbul-lib-report" "*" "@types/istanbul-reports@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz#508b13aa344fa4976234e75dddcc34925737d821" - integrity sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA== + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" + integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== dependencies: "@types/istanbul-lib-report" "*" "@types/jest@*": - version "28.1.6" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-28.1.6.tgz#d6a9cdd38967d2d746861fb5be6b120e38284dd4" - integrity sha512-0RbGAFMfcBJKOmqRazM8L98uokwuwD5F8rHrv/ZMbrZBwVOWZUyPG6VFNscjYr/vjM3Vu4fRrCPbOs42AfemaQ== + version "29.2.2" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.2.2.tgz#874e7dc6702fa6a3fe6107792aa98636dcc480b4" + integrity sha512-og1wAmdxKoS71K2ZwSVqWPX6OVn3ihZ6ZT2qvZvZQm90lJVDyXIjYcu4Khx2CNIeaFv12rOU/YObOsI3VOkzog== dependencies: - jest-matcher-utils "^28.0.0" - pretty-format "^28.0.0" + expect "^29.0.0" + pretty-format "^29.0.0" "@types/jest@^25.2.1": version "25.2.3" @@ -1310,9 +1367,9 @@ pretty-format "^25.2.1" "@types/jest@^26.0.13": - version "26.0.20" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.20.tgz#cd2f2702ecf69e86b586e1f5223a60e454056307" - integrity sha512-9zi2Y+5USJRxd0FsahERhBwlcvFh6D2GLQnY2FH2BzK8J9s9omvNHIbvABwIluXa0fD8XVKMLTO0aOEuUfACAA== + version "26.0.24" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.24.tgz#943d11976b16739185913a1936e0de0c4a7d595a" + integrity sha512-E/X5Vib8BWqZNRlDxj9vYXhsDwPYbPINqKF9BsnSoon4RQ0D9moEuLD8txgyypFLH7J4+Lho9Nr/c8H0Fi+17w== dependencies: jest-diff "^26.0.0" pretty-format "^26.0.0" @@ -1328,9 +1385,9 @@ integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= "@types/lodash@^4.14.168": - version "4.14.168" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.168.tgz#fe24632e79b7ade3f132891afff86caa5e5ce008" - integrity sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q== + version "4.14.188" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.188.tgz#e4990c4c81f7c9b00c5ff8eae389c10f27980da5" + integrity sha512-zmEmF5OIM3rb7SbLCFYoQhO4dGt2FRM9AMkxvA3LaADOF1n8in/zGJlWji9fmafLoNyz+FoL6FE0SLtGIArD7w== "@types/minimatch@*": version "3.0.3" @@ -1338,9 +1395,9 @@ integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== "@types/node@*": - version "14.14.22" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.22.tgz#0d29f382472c4ccf3bd96ff0ce47daf5b7b84b18" - integrity sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw== + version "18.11.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4" + integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -1358,9 +1415,9 @@ integrity sha512-5qOlnZscTn4xxM5MeGXAMOsIOIKIbh9e85zJWfBRVPlRMEVawzoPhINYbRGkBZCI8LxvBe7tJCdWiarA99OZfQ== "@types/prop-types@*", "@types/prop-types@^15.7.1": - version "15.7.3" - resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" - integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== + version "15.7.5" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" + integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w== "@types/react-dom@<18.0.0": version "17.0.17" @@ -1370,19 +1427,11 @@ "@types/react" "^17" "@types/react-dom@^17.0.0": - version "17.0.0" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.0.tgz#b3b691eb956c4b3401777ee67b900cb28415d95a" - integrity sha512-lUqY7OlkF/RbNtD5nIq7ot8NquXrdFrjSOR6+w9a9RFQevGi1oZO1dcJbXMeONAPKtZ2UrZOEJ5UOCVsxbLk/g== + version "17.0.18" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.18.tgz#8f7af38f5d9b42f79162eea7492e5a1caff70dc2" + integrity sha512-rLVtIfbwyur2iFKykP2w0pl/1unw26b5td16d5xMgp7/yjTHomkyxPYChFoCr/FtEX1lN9wY6lFj1qvKdS5kDw== dependencies: - "@types/react" "*" - -"@types/react@*", "@types/react@^17.0.0": - version "17.0.0" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.0.tgz#5af3eb7fad2807092f0046a1302b7823e27919b8" - integrity sha512-aj/L7RIMsRlWML3YB6KZiXB3fV2t41+5RBGYF8z+tAKU43Px8C3cYUZsDvf1/+Bm4FK21QWBrDutu8ZJ/70qOw== - dependencies: - "@types/prop-types" "*" - csstype "^3.0.2" + "@types/react" "^17" "@types/react@^17": version "17.0.47" @@ -1393,6 +1442,15 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/react@^17.0.0": + version "17.0.52" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.52.tgz#10d8b907b5c563ac014a541f289ae8eaa9bf2e9b" + integrity sha512-vwk8QqVODi0VaZZpDXQCmEmiOuyjEFPY7Ttaw5vjM112LOq37yz1CDJGrRJwA1fYEq4Iitd5rnjd1yWAc/bT+A== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + "@types/resolve@1.17.1": version "1.17.1" resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" @@ -1410,6 +1468,11 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== +"@types/stack-utils@^2.0.0": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" + integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== + "@types/testing-library__jest-dom@^5.9.1": version "5.14.5" resolved "https://registry.yarnpkg.com/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.14.5.tgz#d113709c90b3c75fdb127ec338dad7d5f86c974f" @@ -1418,14 +1481,21 @@ "@types/jest" "*" "@types/yargs-parser@*": - version "20.2.0" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.0.tgz#dd3e6699ba3237f0348cd085e4698780204842f9" - integrity sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA== + version "21.0.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" + integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== "@types/yargs@^15.0.0": - version "15.0.12" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.12.tgz#6234ce3e3e3fa32c5db301a170f96a599c960d74" - integrity sha512-f+fD/fQAo3BCbCDlrUpznF1A5Zp9rB0noS5vnoormHSIPFKL0Z2DcUJ3Gxp5ytH4uLRNxy7AwYUC9exZzqGMAw== + version "15.0.14" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.14.tgz#26d821ddb89e70492160b66d10a0eb6df8f6fb06" + integrity sha512-yEJzHoxf6SyQGhBhIYGXQDSCkJjB6HohDShto7m8vaKg9Yp0Yn8+71J9eakh2bnPg6BfsH9PRMhiRTZnd4eXGQ== + dependencies: + "@types/yargs-parser" "*" + +"@types/yargs@^17.0.8": + version "17.0.13" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.13.tgz#34cced675ca1b1d51fcf4d34c3c6f0fa142a5c76" + integrity sha512-9sWaruZk2JGxIQU+IhI1fhPYRcQ0UuTNuKuCW9bR5fp7qi2Llf7WDzNa17Cy7TKnh3cdxDOiyTu6gaLS0eDatg== dependencies: "@types/yargs-parser" "*" @@ -1554,12 +1624,7 @@ ansi-regex@^4.1.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== - -ansi-regex@^5.0.1: +ansi-regex@^5.0.0, ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== @@ -1630,9 +1695,11 @@ aria-query@^4.2.2: "@babel/runtime-corejs3" "^7.10.2" aria-query@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.0.0.tgz#210c21aaf469613ee8c9a62c7f86525e058db52c" - integrity sha512-V+SM7AbUwJ+EBnB8+DXs0hPZHO0W6pqBcc0dW90OwtVG02PswOu/teuARoLQjdDOH+t9pJgGnW5/Qmouf3gPJg== + version "5.1.3" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.1.3.tgz#19db27cd101152773631396f7a95a3b58c22c35e" + integrity sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ== + dependencies: + deep-equal "^2.0.5" arr-diff@^4.0.0: version "4.0.0" @@ -1774,6 +1841,11 @@ auto-changelog@^2.4.0: parse-github-url "^1.0.2" semver "^7.3.5" +available-typed-arrays@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" + integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== + aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" @@ -1966,7 +2038,7 @@ braces@^2.3.1: split-string "^3.0.2" to-regex "^3.0.1" -braces@^3.0.1: +braces@^3.0.1, braces@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -2159,7 +2231,15 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^4.0.0, chalk@^4.1.0: +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chalk@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== @@ -2177,6 +2257,11 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== +ci-info@^3.2.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.5.0.tgz#bfac2a29263de4c829d806b1ab478e35091e171f" + integrity sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw== + class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" @@ -2478,15 +2563,6 @@ css.escape@^1.5.1: resolved "https://registry.yarnpkg.com/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb" integrity sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg== -css@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/css/-/css-3.0.0.tgz#4447a4d58fdd03367c516ca9f64ae365cee4aa5d" - integrity sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ== - dependencies: - inherits "^2.0.4" - source-map "^0.6.1" - source-map-resolve "^0.6.0" - cssom@^0.4.1: version "0.4.4" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" @@ -2505,9 +2581,9 @@ cssstyle@^2.0.0: cssom "~0.3.6" csstype@^3.0.2: - version "3.0.6" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.6.tgz#865d0b5833d7d8d40f4e5b8a6d76aea3de4725ef" - integrity sha512-+ZAmfyWMT7TiIlzdqJgjMb7S4f1beorDbWbsocyK4RaiqA5RTX3K14bnBWmmA9QEM0gRdsjyyrEmcyga8Zsxmw== + version "3.1.1" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9" + integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw== currently-unhandled@^0.4.1: version "0.4.1" @@ -2572,7 +2648,7 @@ decamelize@^1.1.0, decamelize@^1.2.0: decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og== decompress-response@^3.3.0: version "3.3.0" @@ -2581,6 +2657,27 @@ decompress-response@^3.3.0: dependencies: mimic-response "^1.0.0" +deep-equal@^2.0.5: + version "2.1.0" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.1.0.tgz#5ba60402cf44ab92c2c07f3f3312c3d857a0e1dd" + integrity sha512-2pxgvWu3Alv1PoWEyVg7HS8YhGlUFUV7N5oOvfL6d+7xAmLSemMwv/c8Zv/i9KFzxV5Kt5CAvQc70fLwVuf4UA== + dependencies: + call-bind "^1.0.2" + es-get-iterator "^1.1.2" + get-intrinsic "^1.1.3" + is-arguments "^1.1.1" + is-date-object "^1.0.5" + is-regex "^1.1.4" + isarray "^2.0.5" + object-is "^1.1.5" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.4.3" + side-channel "^1.0.4" + which-boxed-primitive "^1.0.2" + which-collection "^1.0.1" + which-typed-array "^1.1.8" + deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" @@ -2615,6 +2712,14 @@ define-properties@^1.1.3: dependencies: object-keys "^1.0.12" +define-properties@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" + integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== + dependencies: + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" @@ -2670,10 +2775,10 @@ diff-sequences@^26.6.2: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q== -diff-sequences@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.1.1.tgz#9989dc731266dc2903457a70e996f3a041913ac6" - integrity sha512-FU0iFaH/E23a+a718l8Qa/19bF9p06kgE0KipMOMadwa3SjnaElKzPaUC0vnibs6/B/9ni97s61mcejk8W1fQw== +diff-sequences@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.2.0.tgz#4c55b5b40706c7b5d2c5c75999a50c56d214e8f6" + integrity sha512-413SY5JpYeSBZxmenGEmCVQ8mCgtFJF0w9PROdaS6z987XC2Pd2GOKqOITLtMftmyFZqgtCOb/QA7/Z3ZXfzIw== doctrine@1.5.0: version "1.5.0" @@ -2812,6 +2917,20 @@ es-abstract@^1.18.0-next.1: string.prototype.trimend "^1.0.3" string.prototype.trimstart "^1.0.3" +es-get-iterator@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.2.tgz#9234c54aba713486d7ebde0220864af5e2b283f7" + integrity sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.0" + has-symbols "^1.0.1" + is-arguments "^1.1.0" + is-map "^2.0.2" + is-set "^2.0.2" + is-string "^1.0.5" + isarray "^2.0.5" + es-to-primitive@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" @@ -3172,6 +3291,17 @@ expect@^25.5.0: jest-message-util "^25.5.0" jest-regex-util "^25.2.6" +expect@^29.0.0: + version "29.3.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.3.0.tgz#2dad3a73ac837dd8074ff91d25cf1614c3e91504" + integrity sha512-bms139btnQNZh4uxCPmzbWz46YOjtEpYIZ847OfY9GCeSBEfzedHWH0CkdR20Sy+XBs8/FI2lFJPZiuH0NGv+w== + dependencies: + "@jest/expect-utils" "^29.2.2" + jest-get-type "^29.2.0" + jest-matcher-utils "^29.2.2" + jest-message-util "^29.2.1" + jest-util "^29.2.1" + extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" @@ -3351,6 +3481,13 @@ flatted@^2.0.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== +for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -3416,6 +3553,11 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= +functions-have-names@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== + gensync@^1.0.0-beta.1: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -3435,6 +3577,15 @@ get-intrinsic@^1.0.1, get-intrinsic@^1.0.2: has "^1.0.3" has-symbols "^1.0.1" +get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" + integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" @@ -3547,6 +3698,13 @@ globrex@^0.1.2: resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098" integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg== +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + got@^9.6.0: version "9.6.0" resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" @@ -3569,6 +3727,11 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== +graceful-fs@^4.2.9: + version "4.2.10" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" + integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== + growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" @@ -3606,6 +3769,11 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" +has-bigints@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" + integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -3616,11 +3784,30 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-property-descriptors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" + integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== + dependencies: + get-intrinsic "^1.1.1" + has-symbols@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== +has-symbols@^1.0.2, has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" @@ -3792,7 +3979,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.4: +inherits@2: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -3892,16 +4079,44 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" +is-arguments@^1.1.0, is-arguments@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" + integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= +is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" + +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== +is-callable@^1.1.3: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== + is-callable@^1.1.4, is-callable@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" @@ -3947,6 +4162,13 @@ is-date-object@^1.0.1: resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== +is-date-object@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" @@ -4042,6 +4264,11 @@ is-interactive@^1.0.0: resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== +is-map@^2.0.1, is-map@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127" + integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg== + is-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" @@ -4057,6 +4284,13 @@ is-npm@^3.0.0: resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-3.0.0.tgz#ec9147bfb629c43f494cf67936a961edec7e8053" integrity sha512-wsigDr1Kkschp2opC4G3yA6r9EgVA6NjRpWzIi9axXqeIaAATPRJc4uLujXe3Nd9uO8KoDyA4MD6aZSeXTADhA== +is-number-object@^1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" + integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== + dependencies: + has-tostringtag "^1.0.0" + is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" @@ -4143,6 +4377,14 @@ is-regex@^1.1.1: dependencies: has-symbols "^1.0.1" +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + is-scoped@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-scoped/-/is-scoped-2.1.0.tgz#fef0713772658bdf5bee418608267ddae6d3566d" @@ -4150,6 +4392,11 @@ is-scoped@^2.1.0: dependencies: scoped-regex "^2.0.0" +is-set@^2.0.1, is-set@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.2.tgz#90755fa4c2562dc1c5d4024760d6119b94ca18ec" + integrity sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g== + is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -4172,6 +4419,24 @@ is-symbol@^1.0.2: dependencies: has-symbols "^1.0.1" +is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + +is-typed-array@^1.1.10: + version "1.1.10" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.10.tgz#36a5b5cb4189b575d1a3e4b08536bfb485801e3f" + integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -4184,6 +4449,19 @@ is-url-superb@^3.0.0: dependencies: url-regex "^5.0.0" +is-weakmap@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2" + integrity sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA== + +is-weakset@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.2.tgz#4569d67a747a1ce5a994dfd4ef6dcea76e7c0a1d" + integrity sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -4206,6 +4484,11 @@ isarray@1.0.0, isarray@^1.0.0: resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -4348,15 +4631,15 @@ jest-diff@^26.0.0: jest-get-type "^26.3.0" pretty-format "^26.6.2" -jest-diff@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.1.3.tgz#948a192d86f4e7a64c5264ad4da4877133d8792f" - integrity sha512-8RqP1B/OXzjjTWkqMX67iqgwBVJRgCyKD3L9nq+6ZqJMdvjE8RgHktqZ6jNrkdMT+dJuYNI3rhQpxaz7drJHfw== +jest-diff@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.2.1.tgz#027e42f5a18b693fb2e88f81b0ccab533c08faee" + integrity sha512-gfh/SMNlQmP3MOUgdzxPOd4XETDJifADpT937fN1iUGz+9DgOu2eUPHH25JDkLVcLwwqxv3GzVyK4VBUr9fjfA== dependencies: chalk "^4.0.0" - diff-sequences "^28.1.1" - jest-get-type "^28.0.2" - pretty-format "^28.1.3" + diff-sequences "^29.2.0" + jest-get-type "^29.2.0" + pretty-format "^29.2.1" jest-docblock@^25.3.0: version "25.3.0" @@ -4410,10 +4693,10 @@ jest-get-type@^26.3.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== -jest-get-type@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-28.0.2.tgz#34622e628e4fdcd793d46db8a242227901fcf203" - integrity sha512-ioj2w9/DxSYHfOm5lJKCdcAmPJzQXmbM/Url3rhlghrPvT3tt+7a/+oXc9azkKmLvoiXjtV83bEWqi+vs5nlPA== +jest-get-type@^29.2.0: + version "29.2.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.2.0.tgz#726646f927ef61d583a3b3adb1ab13f3a5036408" + integrity sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA== jest-haste-map@^25.5.1: version "25.5.1" @@ -4476,15 +4759,15 @@ jest-matcher-utils@^25.5.0: jest-get-type "^25.2.6" pretty-format "^25.5.0" -jest-matcher-utils@^28.0.0: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.3.tgz#5a77f1c129dd5ba3b4d7fc20728806c78893146e" - integrity sha512-kQeJ7qHemKfbzKoGjHHrRKH6atgxMk8Enkk2iPQ3XwO6oE/KYD8lMYOziCkeSB9G4adPM4nR1DE8Tf5JeWH6Bw== +jest-matcher-utils@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.2.2.tgz#9202f8e8d3a54733266784ce7763e9a08688269c" + integrity sha512-4DkJ1sDPT+UX2MR7Y3od6KtvRi9Im1ZGLGgdLFLm4lPexbTaCgJW5NN3IOXlQHF7NSHY/VHhflQ+WoKtD/vyCw== dependencies: chalk "^4.0.0" - jest-diff "^28.1.3" - jest-get-type "^28.0.2" - pretty-format "^28.1.3" + jest-diff "^29.2.1" + jest-get-type "^29.2.0" + pretty-format "^29.2.1" jest-message-util@^25.5.0: version "25.5.0" @@ -4500,6 +4783,21 @@ jest-message-util@^25.5.0: slash "^3.0.0" stack-utils "^1.0.1" +jest-message-util@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.2.1.tgz#3a51357fbbe0cc34236f17a90d772746cf8d9193" + integrity sha512-Dx5nEjw9V8C1/Yj10S/8ivA8F439VS8vTq1L7hEgwHFn9ovSKNpYW/kwNh7UglaEgXO42XxzKJB+2x0nSglFVw== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^29.2.1" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + micromatch "^4.0.4" + pretty-format "^29.2.1" + slash "^3.0.0" + stack-utils "^2.0.3" + jest-mock@^25.5.0: version "25.5.0" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-25.5.0.tgz#a91a54dabd14e37ecd61665d6b6e06360a55387a" @@ -4637,6 +4935,18 @@ jest-util@^25.5.0: is-ci "^2.0.0" make-dir "^3.0.0" +jest-util@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.2.1.tgz#f26872ba0dc8cbefaba32c34f98935f6cf5fc747" + integrity sha512-P5VWDj25r7kj7kl4pN2rG/RN2c1TLfYYYZYULnS/35nFDjBai+hBeo3MDrYZS7p6IoY3YHZnt2vq4L6mKnLk0g== + dependencies: + "@jest/types" "^29.2.1" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + jest-validate@^25.5.0: version "25.5.0" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-25.5.0.tgz#fb4c93f332c2e4cf70151a628e58a35e459a413a" @@ -5051,12 +5361,12 @@ lodash.zip@^4.2.0: resolved "https://registry.yarnpkg.com/lodash.zip/-/lodash.zip-4.2.0.tgz#ec6662e4896408ed4ab6c542a3990b72cc080020" integrity sha1-7GZi5IlkCO1KtsVCo5kLcswIACA= -lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19: +lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.19: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== -lodash@^4.17.21: +lodash@^4.17.15, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -5266,6 +5576,14 @@ micromatch@^3.1.4: snapdragon "^0.8.1" to-regex "^3.0.2" +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + mime-db@1.45.0: version "1.45.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.45.0.tgz#cceeda21ccd7c3a745eba2decd55d4b73e7879ea" @@ -5558,6 +5876,14 @@ object-inspect@^1.8.0, object-inspect@^1.9.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.9.0.tgz#c90521d74e1127b67266ded3394ad6116986533a" integrity sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw== +object-is@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" + integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" @@ -5580,6 +5906,16 @@ object.assign@^4.1.0, object.assign@^4.1.1, object.assign@^4.1.2: has-symbols "^1.0.1" object-keys "^1.1.1" +object.assign@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" + integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + has-symbols "^1.0.3" + object-keys "^1.1.1" + object.entries@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.3.tgz#c601c7f168b62374541a07ddbd3e2d5e4f7711a6" @@ -5920,6 +6256,11 @@ picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.2: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== +picomatch@^2.2.3, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -6048,13 +6389,12 @@ pretty-format@^27.0.2: ansi-styles "^5.0.0" react-is "^17.0.1" -pretty-format@^28.0.0, pretty-format@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.3.tgz#c9fba8cedf99ce50963a11b27d982a9ae90970d5" - integrity sha512-8gFb/To0OmxHR9+ZTb14Df2vNxdGCX8g1xWGUTqUw5TiZvcQf5sHKObd5UcPyLLyowNwDAMTF3XWOG1B6mxl1Q== +pretty-format@^29.0.0, pretty-format@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.2.1.tgz#86e7748fe8bbc96a6a4e04fa99172630907a9611" + integrity sha512-Y41Sa4aLCtKAXvwuIpTvcFBkyeYp2gdFWzXGA+ZNES3VwURIB165XO/z7CjETwzCCS53MjW/rLMyyqEnTtaOfA== dependencies: - "@jest/schemas" "^28.1.3" - ansi-regex "^5.0.1" + "@jest/schemas" "^29.0.0" ansi-styles "^5.0.0" react-is "^18.0.0" @@ -6165,9 +6505,9 @@ react-is@^16.12.0, react-is@^16.13.1, react-is@^16.8.1: integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== react-is@^17.0.1: - version "17.0.1" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.1.tgz#5b3531bd76a645a4c9fb6e693ed36419e3301339" - integrity sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA== + version "17.0.2" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" + integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== react-is@^18.0.0: version "18.2.0" @@ -6276,7 +6616,12 @@ regenerate@^1.4.0: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== -regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.7: +regenerator-runtime@^0.13.10, regenerator-runtime@^0.13.4: + version "0.13.10" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz#ed07b19616bcbec5da6274ebc75ae95634bfc2ee" + integrity sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw== + +regenerator-runtime@^0.13.7: version "0.13.7" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== @@ -6304,6 +6649,15 @@ regexp.prototype.flags@^1.3.0: call-bind "^1.0.2" define-properties "^1.1.3" +regexp.prototype.flags@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" + integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + functions-have-names "^1.2.2" + regexpp@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" @@ -6757,7 +7111,7 @@ shellwords@^0.1.1: resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== -side-channel@^1.0.2, side-channel@^1.0.3: +side-channel@^1.0.2, side-channel@^1.0.3, side-channel@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== @@ -6944,6 +7298,13 @@ stack-utils@^1.0.1: dependencies: escape-string-regexp "^2.0.0" +stack-utils@^2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" + integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== + dependencies: + escape-string-regexp "^2.0.0" + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -7411,9 +7772,9 @@ tslib@^2.0.3: integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== tslib@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" - integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== + version "2.4.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" + integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== tsutils@^3.17.1: version "3.19.1" @@ -7479,9 +7840,9 @@ typescript@^3.7.3: integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw== typescript@^4.7.4: - version "4.7.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" - integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== + version "4.8.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" + integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== uglify-js@^3.1.4: version "3.12.5" @@ -7708,6 +8069,27 @@ whatwg-url@^7.0.0: tr46 "^1.0.1" webidl-conversions "^4.0.2" +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + +which-collection@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.1.tgz#70eab71ebbbd2aefaf32f917082fc62cdcb70906" + integrity sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A== + dependencies: + is-map "^2.0.1" + is-set "^2.0.1" + is-weakmap "^2.0.1" + is-weakset "^2.0.1" + which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" @@ -7718,6 +8100,18 @@ which-pm-runs@^1.0.0: resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= +which-typed-array@^1.1.8: + version "1.1.9" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" + integrity sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + is-typed-array "^1.1.10" + which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"