diff --git a/dist/react-formutil.cjs.development.js b/dist/react-formutil.cjs.development.js index b4b8b13..1572251 100644 --- a/dist/react-formutil.cjs.development.js +++ b/dist/react-formutil.cjs.development.js @@ -7,7 +7,6 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau var React = require('react'); var React__default = _interopDefault(React); var PropTypes = _interopDefault(require('prop-types')); -var createContext = _interopDefault(require('create-react-context')); var warning = _interopDefault(require('warning')); var hoistStatics = _interopDefault(require('hoist-non-react-statics')); var isEqual = _interopDefault(require('react-fast-compare')); @@ -209,7 +208,7 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } -var FormContext = createContext({}); +var FormContext = React.createContext({}); var OBJECT_PROTO = Object.getPrototypeOf({}); var PATH_REGEXP = /\s*(?:\]\s*\.|\]\s*\[|\.|\[|\])\s*/g; @@ -1984,7 +1983,7 @@ EasyFieldNative.defaultProps = { /** @type {any} */ -var _createContext = createContext({}), +var _createContext = React.createContext({}), Provider = _createContext.Provider, Consumer = _createContext.Consumer; diff --git a/dist/react-formutil.cjs.development.js.map b/dist/react-formutil.cjs.development.js.map index e0c2601..a2fe7eb 100644 --- a/dist/react-formutil.cjs.development.js.map +++ b/dist/react-formutil.cjs.development.js.map @@ -1 +1 @@ -{"version":3,"file":"react-formutil.cjs.development.js","sources":["../src/context.js","../src/utils.js","../src/Form.js","../src/withForm.js","../src/fieldHelper.js","../src/Field.js","../src/withField.js","../src/EasyField/Native.js","../src/EasyField/Group.js","../src/EasyField/List.js","../src/EasyField/easyFieldHandler.js","../src/EasyField/index.js","../src/connect.js","../src/hooks/useFormContext.js","../src/hooks/useField.js","../src/hooks/useForm.js","../src/hooks/useHandler.js"],"sourcesContent":["import createContext from 'create-react-context';\n\nexport default createContext({});\n","import warning from 'warning';\n\nconst OBJECT_PROTO = Object.getPrototypeOf({});\nconst PATH_REGEXP = /\\s*(?:\\]\\s*\\.|\\]\\s*\\[|\\.|\\[|\\])\\s*/g;\nconst Root = isUndefined(window) ? global : window;\n\nexport function isUndefined(arg) {\n return typeof arg === 'undefined';\n}\n\nexport function isFunction(arg) {\n return typeof arg === 'function';\n}\n\nexport function isEmpty(arg) {\n return isUndefined(arg) || arg === null || arg + '' === '';\n}\n\nexport function isPromise(promise) {\n return !!promise && isFunction(promise.then);\n}\n\nexport function isObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n\nexport function isPlainObj(obj) {\n if (!isObject(obj)) return false;\n if (null === Object.getPrototypeOf(obj)) return true;\n if (!isFunction(obj.constructor)) return false;\n\n return obj.constructor.prototype === OBJECT_PROTO;\n}\n\n// quick clone deeply\nexport function deepClone(obj) {\n if (obj && typeof obj === 'object') {\n if (Array.isArray(obj)) {\n const newObj = [];\n\n for (let i = 0, j = obj.length; i < j; i++) {\n newObj[i] = deepClone(obj[i]);\n }\n\n return newObj;\n } else if (isPlainObj(obj)) {\n const newObj = {};\n\n for (let i in obj) {\n newObj[i] = deepClone(obj[i]);\n }\n\n return newObj;\n }\n }\n\n return obj;\n}\n\nexport const runCallback = function(callback, ...args) {\n if (isFunction(callback)) {\n callback(...args);\n }\n\n return args[0];\n};\n\nexport function createHOC(withHOC) {\n return function(...args) {\n if (isFunction(args[0])) {\n return withHOC(...args);\n }\n\n return function(WrappedComponent) {\n return withHOC(WrappedComponent, args[0]);\n };\n };\n}\n\nconst VALID_PROPS = ['minlength', 'maxlength', 'max', 'min', 'required', 'pattern', 'step'];\nexport function isValidProp(prop) {\n return VALID_PROPS.indexOf(prop.toLowerCase()) > -1;\n}\n\n/* eslint-disable */\nconst executeWord = function(word) {\n try {\n const exec = new Function(\n 'origin',\n 'global',\n `return typeof ${word} === 'number' || (typeof ${word} !== 'undefined' && !(origin in global)) ? ${word} : origin`\n );\n return exec(word, Root);\n } catch (err) {\n return word;\n }\n};\n\n/**\n * @desc 解析表达式中赋值深路径对象\n *\n * @param {object} target 要赋值的对象\n * @param {string} path 赋值路径,eg:list[0].title\n * @param {any} [value] 要赋过去的值,如过不传,则返回解析路径后的值\n *\n * 使用示例:parsePath({}, 'list[0].authors[1].name', 'Lucy');\n */\nexport function parsePath(...args) {\n const [target, path, value] = args;\n\n warning(typeof path === 'string', `The second parameter(${JSON.stringify(path)}) of parsePath() must be a string.`);\n\n const pathSymbols = (path.match(PATH_REGEXP) || []).map(s => s.replace(/\\s/g, ''));\n const pathWords = path\n .split(PATH_REGEXP)\n .map(s => s.trim())\n .filter(item => item !== '');\n let scope = target;\n\n try {\n if (args.length < 3) {\n for (let index = 0, len = pathWords.length; index < len; index++) {\n const word = executeWord(pathWords[index]);\n\n if (index + 1 === len) {\n return scope[word];\n }\n\n if (isUndefined(scope[word])) {\n break;\n }\n\n scope = scope[word];\n }\n } else {\n for (let index = 0, length = pathWords.length; index < length; index++) {\n const word = executeWord(pathWords[index]);\n const nextWord = pathWords[index + 1];\n const symbol = pathSymbols[index];\n\n if (isUndefined(nextWord)) {\n scope[word] = value;\n break;\n }\n\n switch (symbol) {\n case '].':\n case '.':\n scope = isUndefined(scope[word]) ? (scope[word] = {}) : scope[word];\n break;\n\n case '][':\n case '[':\n const nextVarWord = executeWord(nextWord);\n\n scope = isUndefined(scope[word])\n ? (scope[word] = typeof nextVarWord === 'number' && nextVarWord >= 0 ? [] : {})\n : scope[word];\n break;\n\n default:\n scope[word] = value;\n break;\n }\n }\n }\n } catch (error) {\n warning(false, `The name '%s' of Field seems is not a legal expression.`, path);\n }\n\n if (args.length > 2) {\n return target;\n }\n}\n\nexport function createRef(ref, value) {\n if (ref) {\n if (isFunction(ref)) {\n ref(value);\n } else if ('current' in ref) {\n ref.current = value;\n }\n }\n}\n\nexport const arrayFind = (array, process) => {\n for (let i = 0, j = array.length; i < j; i++) {\n if (process(array[i]) === true) {\n return array[i];\n }\n }\n};\n\nexport const objectMap = (obj, handler) =>\n Object.keys(obj).reduce((newObj, key) => {\n newObj[key] = handler(obj[key], key, obj);\n return newObj;\n }, {});\n\nexport const objectEach = (obj, handler) => Object.keys(obj).forEach(key => handler(obj[key], key, obj));\n\nexport const toObject = (arr, handler, obj = {}) =>\n arr.reduce((...args) => {\n handler(...args);\n\n return args[0];\n }, obj);\n\nconst TODO_DELETE = undefined;\nfunction CLEAR(obj, pkey, pobj) {\n objectEach(obj, (value, key) => {\n if (value === TODO_DELETE) {\n delete obj[key];\n } else if (value && typeof value === 'object') {\n CLEAR(value, key, obj);\n }\n });\n\n if (pobj && Object.keys(obj).every(key => obj[key] === TODO_DELETE)) {\n pobj[pkey] = TODO_DELETE;\n CLEAR(pobj);\n }\n}\nexport const objectClear = (obj, name) => {\n if (!isUndefined(parsePath(obj, name))) {\n parsePath(obj, name, TODO_DELETE);\n\n CLEAR(obj);\n }\n};\n","import React, { Component, Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport FormContext from './context';\nimport * as utils from './utils';\nimport warning from 'warning';\n\nexport const FORM_VALIDATE_RESULT = 'FORM_VALIDATE_RESULT';\n\nlet requestFrame, cancelFrame;\n\nif (typeof requestAnimationFrame === 'function') {\n requestFrame = requestAnimationFrame;\n cancelFrame = cancelAnimationFrame;\n} else {\n requestFrame = setTimeout;\n cancelFrame = clearTimeout;\n}\n\nclass Form extends Component {\n static displayName = 'React.Formutil.Form';\n\n static propTypes = {\n render: PropTypes.func,\n component: PropTypes.func,\n children(props, ...args) {\n let pt = PropTypes.oneOfType([PropTypes.func, PropTypes.node]);\n\n if (!props.render && !props.component) {\n pt = pt.isRequired;\n }\n\n return pt(props, ...args);\n },\n $defaultValues: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $defaultStates: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $onFormChange: PropTypes.func,\n $validator: PropTypes.func,\n $processer: PropTypes.func,\n $ref: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n current: PropTypes.any\n })\n ])\n };\n\n static defaultProps = {\n $defaultValues: {},\n $defaultStates: {}\n };\n\n $$formPending;\n $$formValidatePromise;\n\n $$registers = {};\n $$deepRegisters = {};\n\n constructor(props) {\n super(props);\n\n this.$$defaultInitialize();\n }\n\n getFormContext() {\n return {\n $$registers: this.$$registers,\n $$register: this.$$register,\n $$unregister: this.$$unregister,\n $$onChange: this.$$onChange,\n $$getDefault: this.$$getDefault,\n $formutil: this.$formutil\n };\n }\n\n $$regDuplications = {};\n $$duplicateTimer;\n $$checkDuplication = () => {\n const { $$regDuplications } = this;\n let hasDup;\n\n utils.objectEach($$regDuplications, ([$curRegistered, $handler], name) => {\n warning($curRegistered.$$reserved, `The Field with a name '${name}' has been registered!`);\n\n $handler.$$reset($curRegistered.$getState());\n\n hasDup = delete $$regDuplications[name];\n });\n\n if (hasDup) {\n this.$render();\n }\n };\n\n /*\n * @desc 注册或者替换(preName)Field\n */\n $$register = (name, $handler, prevName) => {\n this.$$unregister(prevName, $handler);\n\n if (name) {\n const $curRegistered = this.$$getRegister(name);\n\n if ($curRegistered) {\n cancelFrame(this.$$duplicateTimer);\n\n this.$$regDuplications[name] = [$curRegistered, $handler];\n this.$$duplicateTimer = requestFrame(this.$$checkDuplication);\n } else {\n this.$$fieldChangedQueue.push({\n name,\n $newValue: $handler.$getState().$value\n });\n\n utils.objectClear(this.$$defaultValues, name);\n }\n\n this.$$registers[($handler.$name = name)] = $handler;\n\n this.createDeepRegisters();\n this.$render();\n }\n };\n\n $$unregister = (name, $handler, $$reserved) => {\n if (name) {\n if (name in this.$$regDuplications) {\n const [$curRegistered, $handler] = this.$$regDuplications[name];\n\n this.$$fieldChangedQueue.push({\n name,\n $newValue: $handler.$getState().$value,\n $prevValue: $curRegistered.$getState().$value\n });\n\n delete this.$$regDuplications[name];\n } else if (this.$$registers[name] === $handler) {\n if ($$reserved) {\n $handler.$$reserved = true;\n } else {\n delete this.$$registers[name];\n\n this.$$fieldChangedQueue.push({\n name,\n $prevValue: $handler.$getState().$value\n });\n\n utils.objectClear(this.$$defaultValues, name);\n }\n }\n\n this.createDeepRegisters();\n this.$render();\n }\n };\n\n $$defaultInitialize = () => {\n const { $defaultValues, $defaultStates } = this.props;\n\n this.$$defaultValues = this.$$deepParseObject(\n utils.deepClone(utils.isFunction($defaultValues) ? $defaultValues(this.props) || {} : $defaultValues)\n );\n this.$$defaultStates = this.$$deepParseObject(\n utils.deepClone(utils.isFunction($defaultStates) ? $defaultStates(this.props) || {} : $defaultStates)\n );\n };\n\n $$getDefault = () => ({\n $$defaultStates: this.$$defaultStates,\n $$defaultValues: this.$$defaultValues\n });\n\n $$deepParseObject(mayWeakObj, deepObj = {}) {\n utils.objectEach(mayWeakObj, (data, name) => utils.parsePath(deepObj, name, data));\n\n return deepObj;\n }\n\n $$triggerChangeTimer;\n $$fieldChangedQueue = [];\n $$triggerFormChange = () => {\n if (this.$$fieldChangedQueue.length) {\n const $$fieldChangedQueue = [...this.$$fieldChangedQueue];\n\n this.$$fieldChangedQueue.length = 0;\n\n const $newValues = {};\n const $prevValues = {};\n const $$registers = this.$$registers;\n let hasFormChanged = false;\n\n $$fieldChangedQueue.forEach(item => {\n if (!(item.name in $$registers)) {\n delete item.$newValue;\n }\n\n if (item.$newValue !== item.$prevValue) {\n if ('$newValue' in item && '$prevValue' in item) {\n const $handler = this.$$getRegister(item.name);\n\n if ($handler) {\n $handler.$$triggerChange(item);\n }\n }\n\n '$newValue' in item && utils.parsePath($newValues, item.name, item.$newValue);\n '$prevValue' in item && utils.parsePath($prevValues, item.name, item.$prevValue);\n\n hasFormChanged = true;\n }\n });\n\n if (hasFormChanged) {\n if (utils.isFunction(this.props.$validator)) {\n this.$$formValidate();\n }\n\n if (utils.isFunction(this.props.$onFormChange)) {\n this.props.$onFormChange(this.$formutil, $newValues, $prevValues);\n }\n }\n }\n };\n\n createDeepRegisters = () => (this.$$deepRegisters = this.$$deepParseObject(this.$$registers));\n\n $$getRegister = name => {\n if (name) {\n const field = this.$$registers[name] || utils.parsePath(this.$$deepRegisters, name);\n\n if (field) {\n return field;\n }\n }\n };\n\n $$formValidate = callback =>\n (this.$$formValidatePromise = new Promise(resolve => {\n const { $validator } = this.props;\n\n let $breakAsyncHandler;\n let $shouldCancelPrevAsyncValidate;\n let prevCallback;\n let validation;\n\n const result = $validator(this.$formutil.$params, this.formtutil);\n const execCallback = $formutil =>\n resolve(utils.runCallback(callback, utils.runCallback(prevCallback, $formutil)));\n\n if (utils.isPromise(result)) {\n if (!this.$$formPending) {\n this.$$formPending = true;\n\n this.$render();\n }\n\n $shouldCancelPrevAsyncValidate = setCallback => ($breakAsyncHandler = setCallback(execCallback));\n\n validation = result\n .then(() => void 0, reason => reason)\n .then(reason => {\n if ($breakAsyncHandler) {\n return $breakAsyncHandler;\n }\n\n this.$shouldCancelPrevAsyncValidate = null;\n\n this.$$formPending = false;\n\n return this.$$setFormErrors(reason, execCallback);\n });\n } else {\n if (this.$$formPending) {\n this.$$formPending = false;\n }\n\n validation = this.$$setFormErrors(result, execCallback);\n }\n\n if (this.$shouldCancelPrevAsyncValidate) {\n this.$shouldCancelPrevAsyncValidate(callback => {\n prevCallback = callback;\n\n return validation;\n });\n }\n\n this.$shouldCancelPrevAsyncValidate = $shouldCancelPrevAsyncValidate;\n }));\n\n $$setFormErrors = (validResults, callback) => {\n if (validResults && (validResults instanceof Error || typeof validResults !== 'object')) {\n warning(\n false,\n `The result of $validator in
should always return None(null,undefined) or an object contains error message of Field.`\n );\n\n return this.$render(callback);\n }\n\n return this.$$setStates(\n validResults || {},\n (result, handler) => {\n const { $error = {} } = handler.$getState();\n\n if (result) {\n return {\n $error: {\n ...$error,\n [FORM_VALIDATE_RESULT]: result\n }\n };\n }\n\n if ($error[FORM_VALIDATE_RESULT]) {\n delete $error[FORM_VALIDATE_RESULT];\n\n return {\n $error\n };\n }\n\n return;\n },\n callback,\n true\n );\n };\n\n $getField = name => {\n const field = this.$$getRegister(name);\n\n warning(!name || field, `$getField('${name}') fail to find the matched Field. Maybe it has been unmounted.`);\n warning(name, `You should pass a name of the mounted Field to $getField().`);\n\n if (field) {\n return field.$new();\n }\n };\n\n $$onChange = (name, $state, callback) =>\n this.$setStates(\n {\n [name]: $state\n },\n callback\n );\n\n $$setStates = ($stateTree = {}, processer, callback, force) => {\n const $parsedTree = this.$$deepParseObject($stateTree);\n let hasStateChange = false;\n\n utils.objectEach(this.$$registers, (handler, name) => {\n const data = name in $stateTree ? $stateTree[name] : utils.parsePath($parsedTree, name);\n\n if (!utils.isUndefined(data) || force) {\n const $newState = processer(data, handler);\n\n if ($newState) {\n const $prevValue = this.$formutil.$weakParams[name];\n const { $value: $newValue } = handler.$$merge($newState);\n\n handler.$$detectChange($newState);\n\n if ('$value' in $newState || '$viewValue' in $newState) {\n const findItem = utils.arrayFind(this.$$fieldChangedQueue, item => item.name === name);\n\n if (findItem) {\n if (!('$prevValue' in findItem)) {\n findItem.$prevValue = findItem.$newValue;\n }\n\n findItem.$newValue = $newValue;\n } else {\n this.$$fieldChangedQueue.push({\n name,\n $newValue,\n $prevValue\n });\n }\n }\n\n hasStateChange = true;\n }\n }\n });\n\n if (hasStateChange) {\n return this.$render(callback);\n }\n\n return Promise.resolve(utils.runCallback(callback, this.$formutil));\n };\n\n componentDidMount() {\n utils.createRef(this.props.$ref, this.$formutil);\n }\n\n componentDidUpdate(prevProps) {\n utils.createRef(this.props.$ref, this.$formutil);\n\n cancelFrame(this.$$triggerChangeTimer);\n\n // ensure this calls to access the newest $formutil\n this.$$triggerChangeTimer = requestFrame(() => {\n this.$$triggerFormChange();\n });\n }\n\n componentWillUnmount() {\n utils.createRef(this.props.$ref, null);\n }\n\n $render = callback =>\n new Promise(resolve => this.forceUpdate(() => resolve(utils.runCallback(callback, this.$formutil))));\n\n $validates = (...args) => {\n let callback;\n\n if (utils.isFunction(args[args.length - 1])) {\n callback = args.pop();\n }\n\n if (args.length) {\n const flatter = names => {\n names.forEach(name => {\n if (Array.isArray(name)) {\n flatter(name);\n } else {\n const handler = this.$getField(name);\n\n if (handler) {\n handler.$validate();\n }\n }\n });\n };\n\n flatter(args);\n } else {\n utils.objectEach(this.$$registers, handler => handler.$validate());\n\n if (utils.isFunction(this.props.$validator)) {\n this.$$formValidate();\n }\n }\n\n return this.$onValidates(callback);\n };\n\n $onValidates = callback => {\n const filedValidatePromises = Object.keys(this.$$registers).map(name => this.$$registers[name].$onValidate());\n\n filedValidatePromises.push(this.$$formValidatePromise);\n\n return Promise.all(filedValidatePromises).then(() => utils.runCallback(callback, this.$formutil));\n };\n\n $validate = (name, callback) => {\n const handler = this.$getField(name);\n\n if (handler) {\n return handler.$validate(callback);\n }\n\n return utils.runCallback(callback);\n };\n\n $reset = ($stateTree, callback) => {\n this.$$defaultInitialize();\n\n if (utils.isFunction($stateTree)) {\n callback = $stateTree;\n $stateTree = {};\n }\n\n return this.$$setStates($stateTree, ($state, handler) => handler.$$reset($state), callback, true);\n };\n\n $setStates = ($stateTree, callback) => this.$$setStates($stateTree, $state => $state, callback);\n\n $setValues = ($valueTree, callback) => {\n this.$$deepParseObject(utils.deepClone($valueTree), this.$$defaultValues);\n\n return this.$$setStates($valueTree, $value => ({ $value }), callback);\n };\n\n $setFocuses = ($focusedTree, callback) => this.$$setStates($focusedTree, $focused => ({ $focused }), callback);\n $setDirts = ($dirtyTree, callback) => this.$$setStates($dirtyTree, $dirty => ({ $dirty }), callback);\n $setTouches = ($touchedTree, callback) => this.$$setStates($touchedTree, $touched => ({ $touched }), callback);\n $setPendings = ($pendingTree, callback) => this.$$setStates($pendingTree, $pending => ({ $pending }), callback);\n $setErrors = ($errorTree, callback) => this.$$setStates($errorTree, $error => ({ $error }), callback);\n\n $batchState = ($state, callback) => this.$setStates(utils.objectMap(this.$$registers, () => $state), callback);\n $batchDirty = ($dirty, callback) =>\n this.$batchState(\n {\n $dirty\n },\n callback\n );\n\n $batchTouched = ($touched, callback) =>\n this.$batchState(\n {\n $touched\n },\n callback\n );\n\n $batchFocused = ($focused, callback) =>\n this.$batchState(\n {\n $focused\n },\n callback\n );\n\n $batchPending = ($pending, callback) =>\n this.$batchState(\n {\n $pending\n },\n callback\n );\n\n $batchError = ($error, callback) =>\n this.$batchState(\n {\n $error\n },\n callback\n );\n\n _render() {\n const $formutil = this.$formutil;\n let { children, render, component } = this.props;\n\n if (component) {\n return createElement(component, { $formutil });\n }\n\n if (utils.isFunction(render)) {\n return render($formutil);\n }\n\n if (utils.isFunction(children)) {\n return children($formutil);\n }\n\n return Children.map(children, child =>\n child && utils.isFunction(child.type)\n ? cloneElement(child, {\n $formutil\n })\n : child\n );\n }\n\n render() {\n const { $processer } = this.props;\n const $stateArray = Object.keys(this.$$registers).map(path => ({\n path,\n $state: this.$$registers[path].$getState()\n }));\n\n const $weakParams = utils.toObject($stateArray, ($params, { path, $state }) => {\n if ($processer) {\n $processer($state, path);\n }\n\n if ('$value' in $state && ($state.$dirty || !utils.isUndefined($state.$value))) {\n $params[path] = $state.$value;\n }\n });\n\n const $pureParams = utils.toObject(\n $stateArray,\n ($params, { path, $state }) => path in $weakParams && utils.parsePath($params, path, $weakParams[path])\n );\n\n const $invalid = $stateArray.some(({ $state }) => $state.$invalid);\n const $dirty = $stateArray.some(({ $state }) => $state.$dirty);\n const $touched = $stateArray.some(({ $state }) => $state.$touched);\n const $focused = $stateArray.some(({ $state }) => $state.$focused);\n const $pending = this.$$formPending || $stateArray.some(({ $state }) => $state.$pending);\n\n const $formutil = (this.$formutil = {\n $$registers: { ...this.$$registers },\n $$deepRegisters: this.$$deepRegisters,\n $states: utils.toObject($stateArray, ($states, { path, $state }) => utils.parsePath($states, path, $state)),\n $params: {\n ...this.$$defaultValues,\n ...$pureParams\n },\n $errors: utils.toObject($stateArray, ($errors, { path, $state }) => {\n if ($state.$invalid) {\n utils.parsePath($errors, path, $state.$error);\n }\n }),\n $dirts: utils.toObject($stateArray, ($dirts, { path, $state }) =>\n utils.parsePath($dirts, path, $state.$dirty)\n ),\n $touches: utils.toObject($stateArray, ($touches, { path, $state }) =>\n utils.parsePath($touches, path, $state.$touched)\n ),\n $focuses: utils.toObject($stateArray, ($focuses, { path, $state }) =>\n utils.parsePath($focuses, path, $state.$focused)\n ),\n $pendings: utils.toObject($stateArray, ($pendings, { path, $state }) =>\n utils.parsePath($pendings, path, $state.$pending)\n ),\n\n $weakStates: utils.toObject($stateArray, ($states, { path, $state }) => ($states[path] = $state)),\n $weakParams,\n $weakErrors: utils.toObject($stateArray, ($errors, { path, $state }) => {\n if ($state.$invalid) {\n $errors[path] = $state.$error;\n }\n }),\n $weakDirts: utils.toObject($stateArray, ($dirts, { path, $state }) => ($dirts[path] = $state.$dirty)),\n $weakTouches: utils.toObject(\n $stateArray,\n ($touches, { path, $state }) => ($touches[path] = $state.$touched)\n ),\n $weakFocuses: utils.toObject(\n $stateArray,\n ($focuses, { path, $state }) => ($focuses[path] = $state.$focused)\n ),\n $weakPendings: utils.toObject(\n $stateArray,\n ($weakPendings, { path, $state }) => ($weakPendings[path] = $state.$pending)\n ),\n\n $getFirstError(name) {\n if (name) {\n const $fieldutil = $formutil.$getField(name);\n\n return $fieldutil && $fieldutil.$getFirstError();\n }\n\n for (let name in $formutil.$weakErrors) {\n const $fieldError = $formutil.$weakErrors[name];\n\n for (let key in $fieldError) {\n return $fieldError[key] instanceof Error ? $fieldError[key].message : $fieldError[key];\n }\n }\n },\n\n $render: this.$render,\n\n $getField: this.$getField,\n $onValidates: this.$onValidates,\n\n // get the newest $formutil\n $new: () => this.$formutil,\n\n $setStates: this.$setStates,\n $setValues: this.$setValues,\n $setErrors: this.$setErrors,\n $setTouches: this.$setTouches,\n $setDirts: this.$setDirts,\n $setFocuses: this.$setFocuses,\n\n $batchState: this.$batchState,\n $batchTouched: this.$batchTouched,\n $batchDirty: this.$batchDirty,\n $batchFocused: this.$batchFocused,\n\n $reset: this.$reset,\n $validates: this.$validates,\n $validate: this.$validate,\n\n $valid: !$invalid,\n $invalid,\n $dirty,\n $pristine: !$dirty,\n $touched,\n $untouched: !$touched,\n $focused,\n $pending\n });\n\n return {this._render()};\n }\n}\n\nexport default Form;\n","import React, { Component } from 'react';\nimport Form from './Form';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withForm(WrappedComponent, config = {}) {\n class FormEnhanced extends Component {\n static displayName =\n 'React.Formutil.withForm.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n const { ...others } = this.props;\n const { component, ...formProps } = this.props;\n\n ['$defaultStates', '$defaultValues', '$onFormChange', '$validator', '$processer', '$ref'].forEach(prop => {\n if (prop in others) {\n if (prop === '$defaultStates' || prop === '$defaultValues') {\n formProps[prop] = { ...config[prop], ...others[prop] };\n }\n delete others[prop];\n }\n });\n\n return (\n }\n />\n );\n }\n }\n\n return hoistStatics(FormEnhanced, WrappedComponent);\n}\n\nexport default createHOC(withForm);\n","import { Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport * as utils from './utils';\nimport warning from 'warning';\nimport { FORM_VALIDATE_RESULT } from './Form';\n\nlet FIELD_UUID = 0;\nconst $baseState = {\n $valid: true,\n $invalid: false,\n\n $dirty: false,\n $pristine: true,\n\n $touched: false,\n $untouched: true,\n\n $focused: false,\n\n $pending: false,\n\n $error: {}\n};\n\nfunction isError(result) {\n return /*!utils.isUndefined(result) && */ result !== true;\n}\n\nfunction warningValidatorReturn(result, key, name) {\n warning(\n !utils.isUndefined(result),\n `You should return a string or Error when the validation('${name &&\n name + ': '}${key}') failed, otherwise return true.`\n );\n}\n\nexport const propTypes =\n process.env.NODE_ENV !== 'production'\n ? {\n name: PropTypes.string,\n\n $defaultValue: PropTypes.any,\n $defaultState: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $onFieldChange: PropTypes.func,\n $validators: PropTypes.object,\n $asyncValidators: PropTypes.object,\n $validateLazy: PropTypes.bool,\n $reserveOnUnmount: PropTypes.bool,\n $ref: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n current: PropTypes.any\n })\n ]),\n $parser: PropTypes.func,\n $formatter: PropTypes.func,\n\n render: PropTypes.func,\n component: PropTypes.func,\n children(props, ...args) {\n let pt = PropTypes.oneOfType([PropTypes.func, PropTypes.node]);\n\n if (!props.render && !props.component && props.children !== null) {\n pt = pt.isRequired;\n }\n\n return pt(props, ...args);\n }\n }\n : undefined;\n\nexport const displayName = 'React.Formutil.Field';\n\nexport function GET_FIELD_UUID() {\n return FIELD_UUID++;\n}\n\nexport function renderField($fieldutil, props) {\n let { children, render, component } = props;\n\n if (component) {\n return createElement(component, { $fieldutil });\n }\n\n if (utils.isFunction(render)) {\n return render($fieldutil);\n }\n\n if (utils.isFunction(children)) {\n return children($fieldutil);\n }\n\n return Children.map(children, child =>\n child && utils.isFunction(child.type)\n ? cloneElement(child, {\n $fieldutil\n })\n : child\n );\n}\n\nexport function createHandler($this, owner) {\n const $fieldHandler = {\n $$FIELD_UUID: $this.$$FIELD_UUID,\n\n $$reset,\n $$merge,\n $$detectChange,\n $$triggerChange,\n $onValidate,\n\n $new() {\n return $this.$fieldutil;\n },\n $picker: $getState,\n $getState,\n // not support in Hooks\n $getComponent() {\n return owner;\n },\n\n $reset($state, callback) {\n return $this.$setState($$reset($state), callback);\n },\n $getFirstError,\n $validate,\n $setState: $this.$setState,\n $render,\n $setValue,\n $setTouched,\n $setDirty,\n $setFocused,\n $setValidity,\n $setError,\n $setPending\n };\n\n let $$validatePromise;\n\n function $$detectChange($newState) {\n if ('$value' in $newState || '$viewValue' in $newState) {\n $validate();\n }\n }\n\n function $$triggerChange({ $newValue, $prevValue }) {\n const { $onFieldChange } = $this.props;\n\n if (utils.isFunction($onFieldChange)) {\n $onFieldChange($newValue, $prevValue, $this.$formContext.$formutil);\n }\n }\n\n function $onValidate(callback) {\n $$validatePromise.then(callback);\n\n return $$validatePromise;\n }\n\n function $$reset($newState) {\n let $initialState;\n\n const { props, $formContext } = $this;\n\n if ($formContext.$$getDefault) {\n const $name = props.name;\n const { $$defaultStates, $$defaultValues } = $formContext.$$getDefault();\n\n if ($name && $$defaultValues) {\n const $initialValue = utils.parsePath($$defaultValues, $name);\n\n $initialState = utils.parsePath($$defaultStates, $name) || {};\n\n if (!utils.isUndefined($initialValue)) {\n $initialState.$value = $initialValue;\n }\n }\n }\n\n const { $defaultValue, $defaultState } = props;\n\n return $$merge({\n ...$baseState, // the base state\n ...(utils.isFunction($defaultState) ? $defaultState(props) : $defaultState), // self default state\n $value: utils.isFunction($defaultValue)\n ? $defaultValue(props)\n : '$defaultValue' in props\n ? $defaultValue\n : '',\n ...$initialState, // the default state from Form\n ...$newState\n });\n }\n\n function $getState() {\n return { ...$this.$state };\n }\n\n function $validate(callback) {\n return ($$validatePromise = new Promise(resolve => {\n const { props, $formContext } = $this;\n const $validators = { ...props.$validators, ...props.$asyncValidators };\n const {\n $value,\n $pending,\n $error: { ...$newError }\n } = $this.$state;\n const { $formutil } = $formContext;\n const $validError = {};\n let $skipRestValidate = false;\n let $breakAsyncHandler;\n let $shouldCancelPrevAsyncValidate;\n let prevCallback;\n let validation;\n\n delete $newError[FORM_VALIDATE_RESULT];\n\n const $validatePromises = Object.keys($validators).reduce((promises, key) => {\n delete $newError[key];\n\n if (!$skipRestValidate && props[key] != null) {\n const result = $validators[key]($value, props[key], {\n ...props,\n $formutil,\n $fieldutil: $this.$fieldutil,\n $validError\n });\n\n if (utils.isPromise(result)) {\n promises.push(\n // @ts-ignore\n result.catch(reason => {\n if (!$breakAsyncHandler) {\n $setValidity(key, reason || key);\n }\n })\n );\n } else if (isError(result)) {\n $validError[key] = result || key;\n\n warningValidatorReturn(result, key, props.name);\n\n if (props.$validateLazy) {\n $skipRestValidate = true;\n }\n }\n }\n\n return promises;\n }, []);\n const execCallback = $fieldutil =>\n resolve(utils.runCallback(callback, utils.runCallback(prevCallback, $fieldutil)));\n\n if ($validatePromises.length) {\n if (!$pending) {\n $setPending(true);\n }\n\n $shouldCancelPrevAsyncValidate = setCallback => ($breakAsyncHandler = setCallback(execCallback));\n\n $validatePromises.push(\n $setError({\n ...$newError,\n ...$validError\n })\n );\n\n validation = Promise.all($validatePromises).then(() => {\n if ($breakAsyncHandler) {\n return $breakAsyncHandler;\n }\n\n $this.$shouldCancelPrevAsyncValidate = null;\n\n return $setPending(false, execCallback);\n });\n } else {\n if ($pending) {\n $setPending(false);\n }\n\n validation = $setError(\n {\n ...$newError,\n ...$validError\n },\n execCallback\n );\n }\n\n if ($this.$shouldCancelPrevAsyncValidate) {\n $this.$shouldCancelPrevAsyncValidate(callback => {\n prevCallback = callback;\n\n return validation;\n });\n }\n\n $this.$shouldCancelPrevAsyncValidate = $shouldCancelPrevAsyncValidate;\n }));\n }\n\n function $render($viewValue, callback) {\n return $this.$setState(\n {\n $viewValue,\n $dirty: true\n },\n callback\n );\n }\n\n function $setValue($value, callback) {\n return $this.$setState(\n {\n $value\n },\n callback\n );\n }\n\n function $setTouched($touched, callback) {\n return $this.$setState(\n {\n $touched\n },\n callback\n );\n }\n\n function $setDirty($dirty, callback) {\n return $this.$setState(\n {\n $dirty\n },\n callback\n );\n }\n\n function $setFocused($focused, callback) {\n return $this.$setState(\n {\n $focused\n },\n callback\n );\n }\n\n function $setError($error, callback) {\n return $this.$setState(\n {\n $error\n },\n callback\n );\n }\n\n function $setValidity(key, result = true, callback) {\n const {\n $error: { ...$newError }\n } = $this.$state;\n\n if (isError(result)) {\n $newError[key] = result || key;\n\n warningValidatorReturn(result, key, $this.props.name);\n } else {\n delete $newError[key];\n }\n\n return $setError($newError, callback);\n }\n\n function $setPending($pending, callback) {\n return $this.$setState(\n {\n $pending\n },\n callback\n );\n }\n\n function $getFirstError() {\n const { $error = {} } = $this.$state;\n\n for (let name in $error) {\n return $error[name] instanceof Error ? $error[name].message : $error[name];\n }\n }\n\n function $$merge({ ...$newState }) {\n if ('$error' in $newState) {\n if (!$newState.$error) {\n $newState.$error = {};\n }\n\n $newState.$valid = Object.keys($newState.$error).length === 0;\n }\n\n // process $value\n const { $parser, $formatter } = $this.props;\n\n if ('$viewValue' in $newState && !('$value' in $newState)) {\n const $setViewValue = $value => ($newState.$viewValue = $value);\n\n $newState.$value = $parser ? $parser($newState.$viewValue, $setViewValue) : $newState.$viewValue;\n } else if ('$value' in $newState && !('$viewValue' in $newState)) {\n const $setModelValue = $value => ($newState.$value = $value);\n\n $newState.$viewValue = $formatter ? $formatter($newState.$value, $setModelValue) : $newState.$value;\n }\n\n // process $valid/$invalid\n if ('$valid' in $newState) {\n $newState.$invalid = !$newState.$valid;\n } else if ('$invalid' in $newState) {\n $newState.$dirty = !$newState.$invalid;\n }\n\n // process $dirty/$pristine\n if ('$dirty' in $newState) {\n $newState.$pristine = !$newState.$dirty;\n } else if ('$pristine' in $newState) {\n $newState.$dirty = !$newState.$pristine;\n }\n\n // process $touched/$untouched\n if ('$touched' in $newState) {\n $newState.$untouched = !$newState.$touched;\n } else if ('$untouched' in $newState) {\n $newState.$touched = !$newState.$untouched;\n }\n\n $this.$state = { ...$this.$state, ...$newState };\n\n return $getState();\n }\n\n return $fieldHandler;\n}\n","import React, { Component } from 'react';\nimport { createHandler, GET_FIELD_UUID, propTypes, displayName, renderField } from './fieldHelper';\nimport FormContext from './context';\nimport warning from 'warning';\nimport { runCallback, createRef } from './utils';\n\nclass Field extends Component {\n static displayName = displayName;\n static propTypes = propTypes;\n\n $$FIELD_UUID = GET_FIELD_UUID();\n\n /** @type { any } */\n $formContext;\n /** @type { any } */\n $state;\n\n componentDidMount() {\n this.isMounting = true;\n\n const {\n props: { name: $name },\n $formContext\n } = this;\n\n warning(\n !$name || $formContext.$formutil,\n `You should enusre that the with the name '${$name}' must be used underneath a component or withForm() HOC, otherwise it's isolated.`\n );\n\n warning($name, `You should assign a name to , otherwise it will be isolated!`);\n\n if ($formContext.$$register) {\n $formContext.$$register($name, this.$fieldHandler);\n }\n\n this.$prevValue = this.$state.$value;\n\n createRef(this.props.$ref, this.$fieldutil);\n }\n\n componentWillUnmount() {\n if (this.$formContext.$$unregister) {\n this.$formContext.$$unregister(this.props.name, this.$fieldHandler, this.props.$reserveOnUnmount);\n }\n\n this.isMounting = false;\n\n createRef(this.props.$ref, null);\n }\n\n componentDidUpdate(prevProps) {\n const $name = this.props.name;\n\n if ($name !== prevProps.name) {\n if (this.$formContext.$$register) {\n this.$formContext.$$register($name, this.$fieldHandler, prevProps.name);\n }\n }\n\n createRef(this.props.$ref, this.$fieldutil);\n\n if (this.$state.$value !== this.$prevValue) {\n if (!($name in (this.$formContext.$$registers || {}))) {\n this.$registered.$$triggerChange({\n $newValue: this.$state.$value,\n $prevValue: this.$prevValue\n });\n }\n\n this.$prevValue = this.$state.$value;\n }\n }\n\n $setState = ($newState, callback) =>\n new Promise(resolve => {\n const execute = () => resolve(runCallback(callback, this.$fieldutil));\n\n if (this.isMounting) {\n const $name = this.props.name;\n\n if ($name in (this.$formContext.$$registers || {})) {\n this.$formContext.$$onChange($name, $newState, execute);\n } else {\n this.$registered.$$merge($newState);\n\n this.$registered.$$detectChange($newState);\n\n this.forceUpdate(execute);\n }\n } else {\n this.$registered.$$merge($newState);\n execute();\n }\n });\n\n _render() {\n const $fieldutil = (this.$fieldutil = {\n $name: this.props.name,\n ...this.$registered.$getState(),\n ...this.$registered,\n $$formutil: this.$formContext.$formutil\n });\n\n return renderField($fieldutil, this.props);\n }\n\n render() {\n const shouldInitial = !this.$formContext;\n\n return (\n \n {context => {\n this.$formContext = context;\n\n if (!this.$fieldHandler) {\n this.$fieldHandler = createHandler(this, this);\n }\n\n this.$registered = (context.$$registers || {})[this.$fieldHandler.$name] || this.$fieldHandler;\n\n if (shouldInitial) {\n this.$fieldHandler.$$reset();\n this.$fieldHandler.$validate();\n }\n\n return this._render();\n }}\n \n );\n }\n}\n\nexport default Field;\n","import React, { Component } from 'react';\nimport Field from './Field';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withField(WrappedComponent, config = {}) {\n class FieldEnhanced extends Component {\n static displayName =\n 'React.Formutil.withField.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n const { ...others } = this.props;\n const { component, ...fieldProps } = this.props;\n\n [\n '$validators',\n '$asyncValidators',\n '$validateLazy',\n '$reserveOnUnmount',\n '$defaultValue',\n '$defaultState',\n '$onFieldChange',\n '$parser',\n '$formatter',\n '$ref',\n 'name'\n ]\n .concat(\n Object.keys({\n ...config.$validators,\n ...config.$asyncValidators,\n ...others.$validators,\n ...others.$asyncValidators\n })\n )\n .forEach(prop => {\n if (prop in others) {\n if (prop === '$validators' || prop === '$asyncValidators' || prop === '$defaultState') {\n fieldProps[prop] = { ...config[prop], ...others[prop] };\n }\n delete others[prop];\n }\n });\n\n return (\n }\n />\n );\n }\n }\n\n return hoistStatics(FieldEnhanced, WrappedComponent);\n}\n\nexport default createHOC(withField);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nclass EasyFieldNative extends Component {\n static displayName = 'React.Formutil.EasyField.Native';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n\n value: PropTypes.any,\n name: PropTypes.string,\n type: PropTypes.string,\n\n checked: PropTypes.any,\n unchekced: PropTypes.any\n };\n\n static defaultProps = {\n value: '',\n type: 'text',\n checked: true,\n unchecked: false\n };\n\n render() {\n const { $fieldutil, value: htmlValue, onChange, onFocus, onBlur, checked, unchecked, ...others } = this.props;\n const htmlType = this.props.type;\n\n let htmlProps = {\n value: 'compositionValue' in this ? this.compositionValue : htmlValue,\n onCompositionEnd: ev => {\n this.composition = false;\n delete this.compositionValue;\n htmlProps.onChange(ev);\n },\n onCompositionStart: () => (this.composition = true),\n onChange: ev => {\n const { value } = ev.target;\n\n if (this.composition) {\n this.compositionValue = value;\n this.forceUpdate();\n } else {\n onChange(value, ev);\n }\n },\n onFocus,\n onBlur\n };\n let Element = 'input';\n\n switch (htmlType) {\n case 'select':\n Element = htmlType;\n htmlProps.onChange = ev => {\n const node = ev.target;\n const value = node.multiple\n ? [].slice\n .call(node.options)\n .filter(option => option.selected)\n .map(option => option.value)\n : node.value;\n\n onChange(value, ev);\n };\n\n delete others.type;\n\n break;\n case 'textarea':\n Element = htmlType;\n delete others.type;\n break;\n\n case 'checkbox':\n case 'radio':\n htmlProps = {\n checked: htmlValue === checked,\n onChange: ev => {\n onChange(ev.target.checked ? checked : unchecked, ev);\n },\n onFocus,\n onBlur\n };\n break;\n\n default:\n break;\n }\n\n return ;\n }\n}\n\nexport default EasyFieldNative;\n","import React, { Component, Children, cloneElement } from 'react';\nimport PropTypes from 'prop-types';\nimport createContext from 'create-react-context';\nimport { isFunction } from '../utils';\nimport warning from 'warning';\n\n/** @type {any} */\nconst { Provider, Consumer } = createContext({});\n\nclass EasyFieldGroup extends Component {\n static displayName = 'React.Formutil.EasyField.Group';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n\n value: PropTypes.any,\n name: PropTypes.string,\n type: PropTypes.string.isRequired,\n groupNode: PropTypes.any,\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).isRequired\n };\n\n static defaultProps = {\n type: 'checkbox',\n groupNode: 'div'\n };\n\n getGroupContext() {\n return this.props;\n }\n\n _render() {\n const { className, groupNode: Element, children } = this.props;\n\n const GroupOptionProps = {\n GroupOption: EasyFieldGroupOption,\n Field: DeprecatedEasyFieldGroupOption\n };\n\n const childNodes = isFunction(children)\n ? children(GroupOptionProps)\n : Children.map(children, child => cloneElement(child, GroupOptionProps));\n\n if (Element === null) {\n return childNodes;\n }\n\n return {childNodes};\n }\n\n render() {\n return {this._render()};\n }\n}\n\nclass EasyFieldGroupOption extends Component {\n static displayName = 'React.Formutil.EasyField.Group.Option';\n\n static propTypes = {\n $value: PropTypes.any.isRequired\n };\n\n componentDidMount() {\n warning('$value' in this.props, `You should pass a $value to .`);\n }\n\n render() {\n const { $value, onChange, onFocus, onBlur, ...others } = this.props;\n\n return (\n \n {$groupHander => {\n const { type, name } = $groupHander;\n\n const elemProps =\n type === 'radio'\n ? {\n checked: $groupHander.value === $value,\n onChange: ev => {\n $groupHander.onChange($value, ev);\n\n onChange && onChange(ev);\n }\n }\n : type === 'checkbox'\n ? {\n checked: $groupHander.value.indexOf($value) > -1,\n onChange: ev => {\n $groupHander.onChange(\n ev.target.checked\n ? $groupHander.value.concat($value)\n : $groupHander.value.filter(value => value !== $value),\n ev\n );\n\n onChange && onChange(ev);\n }\n }\n : {\n value: $groupHander.value,\n onChange: ev => {\n $groupHander.onChange(ev);\n\n onChange && onChange(ev);\n }\n };\n\n return (\n {\n $groupHander.onFocus(ev);\n onFocus && onFocus(ev);\n }}\n onBlur={ev => {\n $groupHander.onBlur(ev);\n onBlur && onBlur(ev);\n }}\n />\n );\n }}\n \n );\n }\n}\n\nclass DeprecatedEasyFieldGroupOption extends Component {\n static displayName = 'React.Formutil.EasyField.Group.Option.Deprecated';\n\n componentDidMount() {\n warning(\n false,\n `The \"Field\" property in EasyField's children-props has been deprecated. Please use \"GroupOption\" instead.`\n );\n }\n\n render() {\n return ;\n }\n}\n\nexport default EasyFieldGroup;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport isEqual from 'react-fast-compare';\nimport Form from '../Form';\nimport Field from '../Field';\nimport { isUndefined, isFunction, runCallback } from '../utils';\n\nconst Wrapper = React.Frament || 'div';\n\nclass EasyFieldList extends Component {\n static displayName = 'React.Formutil.EasyField.List';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n value: PropTypes.array,\n\n children: PropTypes.func.isRequired\n };\n\n id = 0;\n latestValue = this.props.value;\n $formutil;\n\n constructor(props) {\n super(props);\n\n this.state = {\n items: props.value.length ? props.value.map(() => this.getId()) : [this.getId()],\n formKey: 0\n };\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.value !== this.latestValue) {\n this.setState({\n items: this.props.value.length ? this.props.value.map(() => this.getId()) : [this.getId()],\n formKey: this.state.formKey + 1\n });\n\n this.latestValue = this.props.value;\n }\n }\n\n getId(values) {\n return {\n id: this.id++,\n values\n };\n }\n\n FieldValidators = {\n required(value) {\n return value !== null;\n }\n };\n\n $onFormChange = $formutil => {\n $formutil.$onValidates($formutil => {\n const { $invalid, $params } = $formutil;\n\n if ($invalid) {\n if (this.props.value.length) {\n this.props.onChange((this.latestValue = []));\n }\n } else if (!isEqual(this.props.value, $params.list)) {\n this.props.onChange((this.latestValue = $params.list));\n }\n });\n };\n\n swap = (m, n, callback) =>\n this.$setState(({ items }) => {\n [items[n], items[m]] = [items[m], items[n]];\n\n return items;\n }, callback);\n\n insert = (...args) => {\n let m, values, callback;\n\n args.forEach(arg => {\n if (isFunction(arg)) {\n callback = arg;\n } else if (typeof arg === 'number') {\n m = arg;\n } else if (typeof arg === 'object') {\n values = arg;\n }\n });\n\n return this.$setState(({ items }) => {\n if (isUndefined(m)) {\n items.push(this.getId(values));\n } else {\n items.splice(m, 0, this.getId(values));\n }\n\n return { items };\n }, callback);\n };\n\n remove = (...args) => {\n let m, callback;\n\n args.forEach(arg => {\n if (isFunction(arg)) {\n callback = arg;\n } else if (typeof arg === 'number') {\n m = arg;\n }\n });\n\n return this.$setState(({ items }) => {\n if (isUndefined(m)) {\n items.pop();\n } else {\n items.splice(m, 1);\n }\n\n if (!items.length) {\n items = [this.getId()];\n }\n\n return { items };\n }, callback);\n };\n\n $setState = (updater, callback) =>\n new Promise(resolve =>\n this.setState(updater, () =>\n this.$formutil.$onValidates($formutil => resolve(runCallback(callback, $formutil)))\n )\n );\n\n render() {\n const { children, onFocus, onBlur, value } = this.props;\n\n if (!isFunction(children)) {\n return null;\n }\n\n const $baseutil = {\n $length: this.state.items.length,\n $insert: this.insert,\n $remove: this.remove,\n $swap: this.swap,\n $push: (values, callback) => this.insert(values, callback),\n $pop: callback => this.remove(callback),\n $shift: callback => this.remove(0, callback),\n $unshift: (values, callback) => this.insert(0, values, callback),\n onFocus,\n onBlur\n };\n\n return (\n {\n this.$formutil = $formutil;\n\n return (\n \n {this.state.items.map(({ id, values }, index) => (\n {\n return (\n \n $formutil.$onValidates($formutil => {\n const { $invalid, $params } = $formutil;\n\n if ($invalid) {\n if ($fieldutil.$viewValue !== null) {\n $fieldutil.$render(null);\n }\n } else if (!isEqual($fieldutil.$viewValue, $params)) {\n $fieldutil.$render($params);\n }\n })\n }\n children={$innerFormutil =>\n children(\n {\n ...$baseutil,\n ...$innerFormutil,\n $index: index,\n $isLast: () => index === this.state.items.length - 1,\n $isFirst: () => index === 0\n },\n $formutil\n )\n }\n />\n );\n }}\n />\n ))}\n \n );\n }}\n />\n );\n }\n}\n\nexport default EasyFieldList;\n","import { Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport Native from './Native';\nimport Group from './Group';\nimport List from './List';\nimport { isEmpty, isUndefined, isFunction, isValidProp } from '../utils';\n\nexport const TYPE = '__TYPE__';\nexport const defaultValidators = [\n [\n 'required',\n ($value, check, { __TYPE__, checked = true }) =>\n __TYPE__ === 'checked' ? $value === checked : !isEmpty($value)\n ],\n ['maxLength', ($value, len) => isEmpty($value) || $value.length <= len],\n ['minLength', ($value, len) => isEmpty($value) || $value.length >= len],\n ['max', ($value, limit) => isEmpty($value) || $value * 1 <= limit],\n ['min', ($value, limit) => isEmpty($value) || $value * 1 >= limit],\n ['pattern', ($value, regexp) => isEmpty($value) || regexp.test($value)],\n ['enum', ($value, enumeration) => isEmpty($value) || enumeration.indexOf($value) > -1],\n ['checker', ($value, checker, props) => checker($value, props)]\n].reduce(($validators, item) => {\n const [validKey, validate] = item;\n $validators[validKey] = function validator($value, propValue, { validMessage = {} }) {\n return validate(...arguments) || validMessage[validKey] || `Error input: ${validKey}`;\n };\n return $validators;\n}, {});\n\nexport const propTypes =\n process.env.NODE_ENV !== 'production'\n ? {\n type: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n component: PropTypes.func,\n render: PropTypes.func,\n\n defaultValue: PropTypes.any,\n validMessage: PropTypes.object,\n\n valuePropName: PropTypes.string,\n changePropName: PropTypes.string,\n focusPropName: PropTypes.string,\n blurPropName: PropTypes.string,\n\n passUtil: PropTypes.string\n }\n : undefined;\n\nexport const displayName = 'React.Formutil.EasyField';\n\nexport const defaultProps = {\n validMessage: {},\n valuePropName: 'value',\n changePropName: 'onChange',\n focusPropName: 'onFocus',\n blurPropName: 'onBlur',\n $parser: value => (typeof value === 'string' ? value.trim() : value)\n};\n\nexport function createHandler($fieldutil, fieldProps, childProps) {\n const { valuePropName, changePropName, focusPropName, blurPropName, passUtil } = fieldProps;\n\n const fetchValueFromEvent = function(ev) {\n return ev && ev.target ? ev.target[valuePropName] : ev;\n };\n\n const $handleProps = {\n ...childProps,\n\n [valuePropName]: $fieldutil.$viewValue,\n [changePropName]: (...args) => {\n let value = args[0];\n let ev = args[args.length - 1];\n\n if (!ev || !ev.target) {\n ev = args;\n } else {\n ev = [ev];\n }\n\n const onChange = fieldProps[changePropName];\n onChange && onChange(...ev);\n\n const newValue = fetchValueFromEvent(value);\n $fieldutil.$render(newValue);\n },\n [focusPropName]: (...args) => {\n const onFocus = fieldProps[focusPropName];\n onFocus && onFocus(...args);\n\n $fieldutil.$setFocused(true);\n },\n [blurPropName]: (...args) => {\n const onBlur = fieldProps[blurPropName];\n onBlur && onBlur(...args);\n\n if ($fieldutil.$untouched) {\n $fieldutil.$setTouched(true);\n }\n\n $fieldutil.$setFocused(false);\n }\n };\n\n if (passUtil) {\n $handleProps[passUtil === true ? '$fieldutil' : passUtil] = $fieldutil;\n }\n\n return $handleProps;\n}\n\nexport function parseProps(props) {\n const {\n children,\n component,\n render,\n\n ...fieldProps\n } = props;\n\n const {\n // filter all the props that accept by EasyField\n name,\n type,\n defaultValue,\n valuePropName,\n changePropName,\n focusPropName,\n blurPropName,\n validMessage,\n __TYPE__,\n passUtil,\n\n // filter all the props that accept by Field\n $defaultValue,\n $defaultState,\n $onFieldChange,\n $validators,\n $asyncValidators,\n $validateLazy,\n $reserveOnUnmount,\n $parser,\n $formatter,\n $ref,\n\n ...childProps\n } = fieldProps;\n\n const renderProps = {\n children,\n component,\n render\n };\n\n const isNative = !isUndefined(type) || (isUndefined(children) && isUndefined(component) && isUndefined(render));\n\n Object.keys({\n ...(fieldProps.$validators = {\n ...defaultValidators,\n ...fieldProps.$validators\n }),\n ...fieldProps.$asyncValidators\n }).forEach(prop => {\n if (prop in childProps) {\n if (!isNative || !isValidProp(prop)) {\n delete childProps[prop];\n }\n }\n });\n\n if (isNative) {\n const [htmlType = 'text', groupType] = (type || '').split('.');\n\n renderProps.component = htmlType === 'group' ? Group : htmlType === 'list' ? List : Native;\n\n // Native or Group need to pass 'name' | 'type' | 'children'\n if (name) {\n childProps.name = name;\n }\n\n if (type) {\n childProps.type = htmlType;\n }\n\n if (children) {\n childProps.children = children;\n }\n\n switch (htmlType) {\n case 'select':\n case 'textarea':\n if (props.multiple) {\n fieldProps[TYPE] = 'array';\n }\n break;\n\n case 'group':\n if (groupType === 'checkbox') {\n fieldProps[TYPE] = 'array';\n }\n\n childProps.type = groupType;\n break;\n\n case 'checkbox':\n case 'radio':\n fieldProps[TYPE] = 'checked';\n break;\n\n case 'list':\n fieldProps[TYPE] = 'array';\n break;\n\n default:\n break;\n }\n }\n\n if (!('$defaultValue' in fieldProps) && 'defaultValue' in props) {\n fieldProps.$defaultValue = defaultValue;\n }\n\n if (!('$defaultValue' in fieldProps) && TYPE in fieldProps) {\n let defaultValue;\n\n switch (fieldProps[TYPE]) {\n case 'checked':\n const { unchecked = false } = fieldProps;\n\n defaultValue = unchecked;\n break;\n\n case 'array':\n defaultValue = [];\n break;\n\n case 'object':\n defaultValue = {};\n break;\n\n case 'number':\n defaultValue = 0;\n break;\n\n case 'empty':\n default:\n break;\n }\n\n fieldProps.$defaultValue = defaultValue;\n }\n\n return {\n fieldProps,\n childProps,\n renderProps\n };\n}\n\nexport function renderField($handleProps, props) {\n let { component, render, children } = props;\n\n if (component) {\n return createElement(component, $handleProps);\n }\n\n if (isFunction(render)) {\n return render($handleProps);\n }\n\n if (isFunction(children)) {\n return children($handleProps);\n }\n\n return Children.map(children, child => cloneElement(child, $handleProps));\n}\n","import React, { Component } from 'react';\nimport Field from '../Field';\nimport { renderField, createHandler, parseProps, displayName, propTypes, defaultProps } from './easyFieldHandler';\n\n/**\n * 提供对浏览器原生表单控件的封装\n * 支持以下类型表单元素:\n * - input[type=xx]\n * - textarea\n * - select\n */\nclass EasyField extends Component {\n static displayName = displayName;\n static propTypes = propTypes;\n static defaultProps = defaultProps;\n\n render() {\n const { fieldProps, childProps, renderProps } = parseProps(this.props);\n\n return (\n renderField(createHandler($fieldutil, fieldProps, childProps), renderProps)}\n />\n );\n }\n}\n\nexport default EasyField;\n","import React, { Component } from 'react';\nimport FormContext from './context';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction connect(WrappedComponent) {\n class Connect extends Component {\n static displayName =\n 'React.Formutil.connect.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n return (\n \n {context => }\n \n );\n }\n }\n\n return hoistStatics(Connect, WrappedComponent);\n}\n\nexport default connect;\n","import React from 'react';\nimport FormContext from '../context';\n\nfunction useFormContext() {\n if (!React.useState) {\n throw new Error(`Hooks api need react@>=16.8, Please upgrade your reactjs.`);\n }\n\n const { useContext } = React;\n const $formContext = useContext(FormContext);\n\n return $formContext;\n}\n\nexport default useFormContext;\n","import React from 'react';\nimport useFormContext from './useFormContext';\nimport { runCallback, createRef } from '../utils';\nimport { createHandler, GET_FIELD_UUID } from '../fieldHelper';\nimport warning from 'warning';\n\n/**\n * @description\n * The custom hook for Field\n *\n * @param {string | object} [name]\n * @param {object} [props]\n *\n * @return {object} $Fieldutil\n */\nfunction useField(name, props = {}) {\n if (!React.useState) {\n throw new Error(`Hooks api need react@>=16.8, Please upgrade your reactjs.`);\n }\n\n const { useState, useLayoutEffect, useRef } = React;\n\n let $name;\n\n if (name) {\n if (typeof name === 'string') {\n $name = name;\n\n props.name = $name;\n } else {\n props = name;\n\n $name = props.name;\n }\n }\n\n const $formContext = useFormContext();\n /** @type {any} */\n const $this = useRef({}).current;\n /** @type {React.MutableRefObject} */\n const callbackRef = useRef([]);\n\n let $registered;\n\n $this.$formContext = $formContext;\n $this.props = props;\n $this.$setState = $setState;\n // we not directly use this $state, just from $this.$state\n const [, setState] = useState(() => {\n $this.$$FIELD_UUID = GET_FIELD_UUID();\n $this.$fieldHandler = $registered = createHandler($this);\n\n const $state = $this.$fieldHandler.$$reset();\n\n $this.$fieldHandler.$validate();\n\n return $state;\n });\n\n if (!$registered) {\n $registered = ($formContext.$$registers || {})[$this.$fieldHandler.$name] || $this.$fieldHandler;\n }\n\n useLayoutEffect(() => {\n const { $state } = $this;\n\n if ($this.isMounting) {\n if (!($name in ($formContext.$$registers || {}))) {\n const { $prevValue } = $this;\n\n $registered.$$triggerChange({\n $newValue: $state.$value,\n $prevValue\n });\n }\n }\n\n $this.$prevValue = $state.$value;\n }, [$this.$state.$value]);\n\n useLayoutEffect(() => {\n $this.isMounting = true;\n\n warning(\n !$name || $formContext.$formutil,\n `You should enusre that the useField() with the name '${$name}' must be used underneath a component or withForm() HOC, otherwise it's isolated.`\n );\n\n warning($name, `You should pass a name argument to useField(), otherwise it will be isolated!`);\n\n return () => {\n $this.isMounting = false;\n\n createRef(props.$ref, null);\n };\n }, []);\n\n useLayoutEffect(() => {\n if ($formContext.$$register) {\n $formContext.$$register($name, $this.$fieldHandler);\n }\n\n return () => {\n if ($formContext.$$unregister) {\n $formContext.$$unregister($name, $this.$fieldHandler, !$this.isMounting && props.$reserveOnUnmount);\n }\n };\n }, [$name]);\n\n // trigger ref callback\n useLayoutEffect(() => {\n createRef(props.$ref, $this.$fieldutil);\n });\n\n useLayoutEffect(() => {\n if (callbackRef.current.length > 0) {\n const callbackQueue = [...callbackRef.current];\n\n callbackRef.current.length = 0;\n\n while (callbackQueue.length) {\n callbackQueue.pop()($this.$fieldutil);\n }\n }\n });\n\n function $setState($newState, callback) {\n return new Promise(resolve => {\n const execute = () => resolve(runCallback(callback, $this.$fieldutil));\n\n if ($this.isMounting) {\n if ($name in ($formContext.$$registers || {})) {\n $formContext.$$onChange($name, $newState, execute);\n } else {\n setState($registered.$$merge($newState));\n\n $registered.$$detectChange($newState);\n\n callbackRef.current.push(execute);\n }\n } else {\n $registered.$$merge($newState);\n execute();\n }\n });\n }\n\n return ($this.$fieldutil = {\n $name,\n ...$registered.$getState(),\n ...$registered,\n $$formutil: $formContext.$formutil\n });\n}\n\nexport default useField;\n","import useFormContext from './useFormContext';\n\nfunction useForm() {\n const { $formutil } = useFormContext();\n\n return $formutil;\n}\n\nexport default useForm;\n","import { createHandler, parseProps, defaultProps } from '../EasyField/easyFieldHandler';\nimport useField from './useField';\n\nfunction useHandler(props) {\n props = { ...defaultProps, ...props, children: null };\n\n const { fieldProps, childProps } = parseProps(props);\n const $fieldutil = useField(fieldProps);\n\n return createHandler($fieldutil, fieldProps, childProps);\n}\n\nexport default useHandler;\n"],"names":["createContext","OBJECT_PROTO","Object","getPrototypeOf","PATH_REGEXP","Root","isUndefined","window","global","arg","isFunction","isEmpty","isPromise","promise","then","isObject","obj","prototype","toString","call","isPlainObj","constructor","deepClone","Array","isArray","newObj","i","j","length","runCallback","callback","args","createHOC","withHOC","WrappedComponent","VALID_PROPS","isValidProp","prop","indexOf","toLowerCase","executeWord","word","exec","Function","err","parsePath","target","path","value","warning","JSON","stringify","pathSymbols","match","map","s","replace","pathWords","split","trim","filter","item","scope","index","len","nextWord","symbol","nextVarWord","error","createRef","ref","current","arrayFind","array","process","objectMap","handler","keys","reduce","key","objectEach","forEach","toObject","arr","TODO_DELETE","undefined","CLEAR","pkey","pobj","every","objectClear","name","FORM_VALIDATE_RESULT","requestFrame","cancelFrame","requestAnimationFrame","cancelAnimationFrame","setTimeout","clearTimeout","Form","props","$$formPending","$$formValidatePromise","$$registers","$$deepRegisters","$$regDuplications","$$duplicateTimer","$$checkDuplication","hasDup","utils","$curRegistered","$handler","$$reserved","$$reset","$getState","$render","$$register","prevName","$$unregister","$$getRegister","$$fieldChangedQueue","push","$newValue","$value","$$defaultValues","$name","createDeepRegisters","$prevValue","$$defaultInitialize","$defaultValues","$defaultStates","$$deepParseObject","$$defaultStates","$$getDefault","$$triggerChangeTimer","$$triggerFormChange","$newValues","$prevValues","hasFormChanged","$$triggerChange","$validator","$$formValidate","$onFormChange","$formutil","field","Promise","resolve","$breakAsyncHandler","$shouldCancelPrevAsyncValidate","prevCallback","validation","result","$params","formtutil","execCallback","setCallback","reason","$$setFormErrors","validResults","Error","$$setStates","$error","$getField","$new","$$onChange","$state","$setStates","$stateTree","processer","force","$parsedTree","hasStateChange","data","$newState","$weakParams","$$merge","$$detectChange","findItem","forceUpdate","$validates","pop","flatter","names","$validate","$onValidates","filedValidatePromises","$onValidate","all","$reset","$setValues","$valueTree","$setFocuses","$focusedTree","$focused","$setDirts","$dirtyTree","$dirty","$setTouches","$touchedTree","$touched","$setPendings","$pendingTree","$pending","$setErrors","$errorTree","$batchState","$batchDirty","$batchTouched","$batchFocused","$batchPending","$batchError","mayWeakObj","deepObj","$ref","prevProps","children","render","component","createElement","Children","child","type","cloneElement","$processer","$stateArray","$pureParams","$invalid","some","$states","$errors","$dirts","$touches","$focuses","$pendings","$weakStates","$weakErrors","$weakDirts","$weakTouches","$weakFocuses","$weakPendings","$getFirstError","$fieldutil","$fieldError","message","$valid","$pristine","$untouched","React","getFormContext","_render","Component","displayName","propTypes","PropTypes","func","pt","oneOfType","node","isRequired","object","shape","any","defaultProps","withForm","config","FormEnhanced","others","formProps","hoistStatics","FIELD_UUID","$baseState","isError","warningValidatorReturn","string","$defaultValue","$defaultState","$onFieldChange","$validators","$asyncValidators","$validateLazy","bool","$reserveOnUnmount","$parser","$formatter","GET_FIELD_UUID","renderField","createHandler","$this","owner","$fieldHandler","$$FIELD_UUID","$picker","$getComponent","$setState","$setValue","$setTouched","$setDirty","$setFocused","$setValidity","$setError","$setPending","$$validatePromise","$formContext","$initialState","$initialValue","$newError","$validError","$skipRestValidate","$validatePromises","promises","catch","$viewValue","$setViewValue","$setModelValue","Field","execute","isMounting","$registered","$$formutil","shouldInitial","context","withField","FieldEnhanced","fieldProps","concat","EasyFieldNative","htmlValue","onChange","onFocus","onBlur","checked","unchecked","htmlType","htmlProps","compositionValue","onCompositionEnd","ev","composition","onCompositionStart","Element","multiple","slice","options","option","selected","unchekced","Provider","Consumer","EasyFieldGroup","className","groupNode","GroupOptionProps","GroupOption","EasyFieldGroupOption","DeprecatedEasyFieldGroupOption","childNodes","getGroupContext","element","$groupHander","elemProps","Wrapper","Frament","EasyFieldList","id","latestValue","FieldValidators","required","isEqual","list","swap","m","n","items","insert","values","getId","splice","remove","updater","setState","state","formKey","$baseutil","$length","$insert","$remove","$swap","$push","$pop","$shift","$unshift","$innerFormutil","$index","$isLast","$isFirst","TYPE","defaultValidators","check","__TYPE__","limit","regexp","test","enumeration","checker","validKey","validate","validator","propValue","validMessage","arguments","defaultValue","valuePropName","changePropName","focusPropName","blurPropName","passUtil","childProps","fetchValueFromEvent","$handleProps","newValue","parseProps","renderProps","isNative","groupType","Group","List","Native","EasyField","connect","Connect","useFormContext","useState","useContext","FormContext","useField","useLayoutEffect","useRef","callbackRef","callbackQueue","useForm","useHandler"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAAeA,aAAa,CAAC,EAAD,CAA5B;;ACAA,IAAMC,YAAY,GAAGC,MAAM,CAACC,cAAP,CAAsB,EAAtB,CAArB;AACA,IAAMC,WAAW,GAAG,qCAApB;AACA,IAAMC,IAAI,GAAGC,WAAW,CAACC,MAAD,CAAX,GAAsBC,MAAtB,GAA+BD,MAA5C;AAEA,AAAO,SAASD,WAAT,CAAqBG,GAArB,EAA0B;SACtB,OAAOA,GAAP,KAAe,WAAtB;;AAGJ,AAAO,SAASC,UAAT,CAAoBD,GAApB,EAAyB;SACrB,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9D,WAAW,CAAC9I,OAAZ,CAAoBF,SAApB,CAAD,CAAR;UAEAgJ,WAAW,CAAC7I,cAAZ,CAA2BH,SAA3B;UAEAwQ,WAAW,CAAC9W,OAAZ,CAAoBkD,IAApB,CAAyBkM,OAAzB;;OARR,MAUO;QACHE,WAAW,CAAC9I,OAAZ,CAAoBF,SAApB;QACA8I,OAAO;;KAfR,CAAP;;;SAoBI5B,KAAK,CAAC9C,UAAN;IACJpH,KAAK,EAALA;KACGgM,WAAW,CAAC3M,SAAZ,EAFC,EAGD2M,WAHC;IAIJC,UAAU,EAAEhB,YAAY,CAAC/J;IAJ7B;;;ACjJJ,SAASwS,OAAT,GAAmB;wBACOT,cAAc,EADrB;MACP/R,SADO,mBACPA,SADO;;SAGRA,SAAP;;;ACFJ,SAASyS,UAAT,CAAoBpV,KAApB,EAA2B;EACvBA,KAAK,qBAAQkK,YAAR,EAAyBlK,KAAzB;IAAgCmH,QAAQ,EAAE;IAA/C;;oBAEmC6M,UAAU,CAAChU,KAAD,CAHtB;MAGf+N,UAHe,eAGfA,UAHe;MAGH6F,UAHG,eAGHA,UAHG;;MAIjB/K,UAAU,GAAGiM,QAAQ,CAAC/G,UAAD,CAA3B;SAEOrC,eAAa,CAAC7C,UAAD,EAAakF,UAAb,EAAyB6F,UAAzB,CAApB;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"react-formutil.cjs.development.js","sources":["../src/context.js","../src/utils.js","../src/Form.js","../src/withForm.js","../src/fieldHelper.js","../src/Field.js","../src/withField.js","../src/EasyField/Native.js","../src/EasyField/Group.js","../src/EasyField/List.js","../src/EasyField/easyFieldHandler.js","../src/EasyField/index.js","../src/connect.js","../src/hooks/useFormContext.js","../src/hooks/useField.js","../src/hooks/useForm.js","../src/hooks/useHandler.js"],"sourcesContent":["import { createContext } from 'react';\n\nexport default createContext({});\n","import warning from 'warning';\n\nconst OBJECT_PROTO = Object.getPrototypeOf({});\nconst PATH_REGEXP = /\\s*(?:\\]\\s*\\.|\\]\\s*\\[|\\.|\\[|\\])\\s*/g;\nconst Root = isUndefined(window) ? global : window;\n\nexport function isUndefined(arg) {\n return typeof arg === 'undefined';\n}\n\nexport function isFunction(arg) {\n return typeof arg === 'function';\n}\n\nexport function isEmpty(arg) {\n return isUndefined(arg) || arg === null || arg + '' === '';\n}\n\nexport function isPromise(promise) {\n return !!promise && isFunction(promise.then);\n}\n\nexport function isObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n\nexport function isPlainObj(obj) {\n if (!isObject(obj)) return false;\n if (null === Object.getPrototypeOf(obj)) return true;\n if (!isFunction(obj.constructor)) return false;\n\n return obj.constructor.prototype === OBJECT_PROTO;\n}\n\n// quick clone deeply\nexport function deepClone(obj) {\n if (obj && typeof obj === 'object') {\n if (Array.isArray(obj)) {\n const newObj = [];\n\n for (let i = 0, j = obj.length; i < j; i++) {\n newObj[i] = deepClone(obj[i]);\n }\n\n return newObj;\n } else if (isPlainObj(obj)) {\n const newObj = {};\n\n for (let i in obj) {\n newObj[i] = deepClone(obj[i]);\n }\n\n return newObj;\n }\n }\n\n return obj;\n}\n\nexport const runCallback = function(callback, ...args) {\n if (isFunction(callback)) {\n callback(...args);\n }\n\n return args[0];\n};\n\nexport function createHOC(withHOC) {\n return function(...args) {\n if (isFunction(args[0])) {\n return withHOC(...args);\n }\n\n return function(WrappedComponent) {\n return withHOC(WrappedComponent, args[0]);\n };\n };\n}\n\nconst VALID_PROPS = ['minlength', 'maxlength', 'max', 'min', 'required', 'pattern', 'step'];\nexport function isValidProp(prop) {\n return VALID_PROPS.indexOf(prop.toLowerCase()) > -1;\n}\n\n/* eslint-disable */\nconst executeWord = function(word) {\n try {\n const exec = new Function(\n 'origin',\n 'global',\n `return typeof ${word} === 'number' || (typeof ${word} !== 'undefined' && !(origin in global)) ? ${word} : origin`\n );\n return exec(word, Root);\n } catch (err) {\n return word;\n }\n};\n\n/**\n * @desc 解析表达式中赋值深路径对象\n *\n * @param {object} target 要赋值的对象\n * @param {string} path 赋值路径,eg:list[0].title\n * @param {any} [value] 要赋过去的值,如过不传,则返回解析路径后的值\n *\n * 使用示例:parsePath({}, 'list[0].authors[1].name', 'Lucy');\n */\nexport function parsePath(...args) {\n const [target, path, value] = args;\n\n warning(typeof path === 'string', `The second parameter(${JSON.stringify(path)}) of parsePath() must be a string.`);\n\n const pathSymbols = (path.match(PATH_REGEXP) || []).map(s => s.replace(/\\s/g, ''));\n const pathWords = path\n .split(PATH_REGEXP)\n .map(s => s.trim())\n .filter(item => item !== '');\n let scope = target;\n\n try {\n if (args.length < 3) {\n for (let index = 0, len = pathWords.length; index < len; index++) {\n const word = executeWord(pathWords[index]);\n\n if (index + 1 === len) {\n return scope[word];\n }\n\n if (isUndefined(scope[word])) {\n break;\n }\n\n scope = scope[word];\n }\n } else {\n for (let index = 0, length = pathWords.length; index < length; index++) {\n const word = executeWord(pathWords[index]);\n const nextWord = pathWords[index + 1];\n const symbol = pathSymbols[index];\n\n if (isUndefined(nextWord)) {\n scope[word] = value;\n break;\n }\n\n switch (symbol) {\n case '].':\n case '.':\n scope = isUndefined(scope[word]) ? (scope[word] = {}) : scope[word];\n break;\n\n case '][':\n case '[':\n const nextVarWord = executeWord(nextWord);\n\n scope = isUndefined(scope[word])\n ? (scope[word] = typeof nextVarWord === 'number' && nextVarWord >= 0 ? [] : {})\n : scope[word];\n break;\n\n default:\n scope[word] = value;\n break;\n }\n }\n }\n } catch (error) {\n warning(false, `The name '%s' of Field seems is not a legal expression.`, path);\n }\n\n if (args.length > 2) {\n return target;\n }\n}\n\nexport function createRef(ref, value) {\n if (ref) {\n if (isFunction(ref)) {\n ref(value);\n } else if ('current' in ref) {\n ref.current = value;\n }\n }\n}\n\nexport const arrayFind = (array, process) => {\n for (let i = 0, j = array.length; i < j; i++) {\n if (process(array[i]) === true) {\n return array[i];\n }\n }\n};\n\nexport const objectMap = (obj, handler) =>\n Object.keys(obj).reduce((newObj, key) => {\n newObj[key] = handler(obj[key], key, obj);\n return newObj;\n }, {});\n\nexport const objectEach = (obj, handler) => Object.keys(obj).forEach(key => handler(obj[key], key, obj));\n\nexport const toObject = (arr, handler, obj = {}) =>\n arr.reduce((...args) => {\n handler(...args);\n\n return args[0];\n }, obj);\n\nconst TODO_DELETE = undefined;\nfunction CLEAR(obj, pkey, pobj) {\n objectEach(obj, (value, key) => {\n if (value === TODO_DELETE) {\n delete obj[key];\n } else if (value && typeof value === 'object') {\n CLEAR(value, key, obj);\n }\n });\n\n if (pobj && Object.keys(obj).every(key => obj[key] === TODO_DELETE)) {\n pobj[pkey] = TODO_DELETE;\n CLEAR(pobj);\n }\n}\nexport const objectClear = (obj, name) => {\n if (!isUndefined(parsePath(obj, name))) {\n parsePath(obj, name, TODO_DELETE);\n\n CLEAR(obj);\n }\n};\n","import React, { Component, Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport FormContext from './context';\nimport * as utils from './utils';\nimport warning from 'warning';\n\nexport const FORM_VALIDATE_RESULT = 'FORM_VALIDATE_RESULT';\n\nlet requestFrame, cancelFrame;\n\nif (typeof requestAnimationFrame === 'function') {\n requestFrame = requestAnimationFrame;\n cancelFrame = cancelAnimationFrame;\n} else {\n requestFrame = setTimeout;\n cancelFrame = clearTimeout;\n}\n\nclass Form extends Component {\n static displayName = 'React.Formutil.Form';\n\n static propTypes = {\n render: PropTypes.func,\n component: PropTypes.func,\n children(props, ...args) {\n let pt = PropTypes.oneOfType([PropTypes.func, PropTypes.node]);\n\n if (!props.render && !props.component) {\n pt = pt.isRequired;\n }\n\n return pt(props, ...args);\n },\n $defaultValues: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $defaultStates: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $onFormChange: PropTypes.func,\n $validator: PropTypes.func,\n $processer: PropTypes.func,\n $ref: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n current: PropTypes.any\n })\n ])\n };\n\n static defaultProps = {\n $defaultValues: {},\n $defaultStates: {}\n };\n\n $$formPending;\n $$formValidatePromise;\n\n $$registers = {};\n $$deepRegisters = {};\n\n constructor(props) {\n super(props);\n\n this.$$defaultInitialize();\n }\n\n getFormContext() {\n return {\n $$registers: this.$$registers,\n $$register: this.$$register,\n $$unregister: this.$$unregister,\n $$onChange: this.$$onChange,\n $$getDefault: this.$$getDefault,\n $formutil: this.$formutil\n };\n }\n\n $$regDuplications = {};\n $$duplicateTimer;\n $$checkDuplication = () => {\n const { $$regDuplications } = this;\n let hasDup;\n\n utils.objectEach($$regDuplications, ([$curRegistered, $handler], name) => {\n warning($curRegistered.$$reserved, `The Field with a name '${name}' has been registered!`);\n\n $handler.$$reset($curRegistered.$getState());\n\n hasDup = delete $$regDuplications[name];\n });\n\n if (hasDup) {\n this.$render();\n }\n };\n\n /*\n * @desc 注册或者替换(preName)Field\n */\n $$register = (name, $handler, prevName) => {\n this.$$unregister(prevName, $handler);\n\n if (name) {\n const $curRegistered = this.$$getRegister(name);\n\n if ($curRegistered) {\n cancelFrame(this.$$duplicateTimer);\n\n this.$$regDuplications[name] = [$curRegistered, $handler];\n this.$$duplicateTimer = requestFrame(this.$$checkDuplication);\n } else {\n this.$$fieldChangedQueue.push({\n name,\n $newValue: $handler.$getState().$value\n });\n\n utils.objectClear(this.$$defaultValues, name);\n }\n\n this.$$registers[($handler.$name = name)] = $handler;\n\n this.createDeepRegisters();\n this.$render();\n }\n };\n\n $$unregister = (name, $handler, $$reserved) => {\n if (name) {\n if (name in this.$$regDuplications) {\n const [$curRegistered, $handler] = this.$$regDuplications[name];\n\n this.$$fieldChangedQueue.push({\n name,\n $newValue: $handler.$getState().$value,\n $prevValue: $curRegistered.$getState().$value\n });\n\n delete this.$$regDuplications[name];\n } else if (this.$$registers[name] === $handler) {\n if ($$reserved) {\n $handler.$$reserved = true;\n } else {\n delete this.$$registers[name];\n\n this.$$fieldChangedQueue.push({\n name,\n $prevValue: $handler.$getState().$value\n });\n\n utils.objectClear(this.$$defaultValues, name);\n }\n }\n\n this.createDeepRegisters();\n this.$render();\n }\n };\n\n $$defaultInitialize = () => {\n const { $defaultValues, $defaultStates } = this.props;\n\n this.$$defaultValues = this.$$deepParseObject(\n utils.deepClone(utils.isFunction($defaultValues) ? $defaultValues(this.props) || {} : $defaultValues)\n );\n this.$$defaultStates = this.$$deepParseObject(\n utils.deepClone(utils.isFunction($defaultStates) ? $defaultStates(this.props) || {} : $defaultStates)\n );\n };\n\n $$getDefault = () => ({\n $$defaultStates: this.$$defaultStates,\n $$defaultValues: this.$$defaultValues\n });\n\n $$deepParseObject(mayWeakObj, deepObj = {}) {\n utils.objectEach(mayWeakObj, (data, name) => utils.parsePath(deepObj, name, data));\n\n return deepObj;\n }\n\n $$triggerChangeTimer;\n $$fieldChangedQueue = [];\n $$triggerFormChange = () => {\n if (this.$$fieldChangedQueue.length) {\n const $$fieldChangedQueue = [...this.$$fieldChangedQueue];\n\n this.$$fieldChangedQueue.length = 0;\n\n const $newValues = {};\n const $prevValues = {};\n const $$registers = this.$$registers;\n let hasFormChanged = false;\n\n $$fieldChangedQueue.forEach(item => {\n if (!(item.name in $$registers)) {\n delete item.$newValue;\n }\n\n if (item.$newValue !== item.$prevValue) {\n if ('$newValue' in item && '$prevValue' in item) {\n const $handler = this.$$getRegister(item.name);\n\n if ($handler) {\n $handler.$$triggerChange(item);\n }\n }\n\n '$newValue' in item && utils.parsePath($newValues, item.name, item.$newValue);\n '$prevValue' in item && utils.parsePath($prevValues, item.name, item.$prevValue);\n\n hasFormChanged = true;\n }\n });\n\n if (hasFormChanged) {\n if (utils.isFunction(this.props.$validator)) {\n this.$$formValidate();\n }\n\n if (utils.isFunction(this.props.$onFormChange)) {\n this.props.$onFormChange(this.$formutil, $newValues, $prevValues);\n }\n }\n }\n };\n\n createDeepRegisters = () => (this.$$deepRegisters = this.$$deepParseObject(this.$$registers));\n\n $$getRegister = name => {\n if (name) {\n const field = this.$$registers[name] || utils.parsePath(this.$$deepRegisters, name);\n\n if (field) {\n return field;\n }\n }\n };\n\n $$formValidate = callback =>\n (this.$$formValidatePromise = new Promise(resolve => {\n const { $validator } = this.props;\n\n let $breakAsyncHandler;\n let $shouldCancelPrevAsyncValidate;\n let prevCallback;\n let validation;\n\n const result = $validator(this.$formutil.$params, this.formtutil);\n const execCallback = $formutil =>\n resolve(utils.runCallback(callback, utils.runCallback(prevCallback, $formutil)));\n\n if (utils.isPromise(result)) {\n if (!this.$$formPending) {\n this.$$formPending = true;\n\n this.$render();\n }\n\n $shouldCancelPrevAsyncValidate = setCallback => ($breakAsyncHandler = setCallback(execCallback));\n\n validation = result\n .then(() => void 0, reason => reason)\n .then(reason => {\n if ($breakAsyncHandler) {\n return $breakAsyncHandler;\n }\n\n this.$shouldCancelPrevAsyncValidate = null;\n\n this.$$formPending = false;\n\n return this.$$setFormErrors(reason, execCallback);\n });\n } else {\n if (this.$$formPending) {\n this.$$formPending = false;\n }\n\n validation = this.$$setFormErrors(result, execCallback);\n }\n\n if (this.$shouldCancelPrevAsyncValidate) {\n this.$shouldCancelPrevAsyncValidate(callback => {\n prevCallback = callback;\n\n return validation;\n });\n }\n\n this.$shouldCancelPrevAsyncValidate = $shouldCancelPrevAsyncValidate;\n }));\n\n $$setFormErrors = (validResults, callback) => {\n if (validResults && (validResults instanceof Error || typeof validResults !== 'object')) {\n warning(\n false,\n `The result of $validator in should always return None(null,undefined) or an object contains error message of Field.`\n );\n\n return this.$render(callback);\n }\n\n return this.$$setStates(\n validResults || {},\n (result, handler) => {\n const { $error = {} } = handler.$getState();\n\n if (result) {\n return {\n $error: {\n ...$error,\n [FORM_VALIDATE_RESULT]: result\n }\n };\n }\n\n if ($error[FORM_VALIDATE_RESULT]) {\n delete $error[FORM_VALIDATE_RESULT];\n\n return {\n $error\n };\n }\n\n return;\n },\n callback,\n true\n );\n };\n\n $getField = name => {\n const field = this.$$getRegister(name);\n\n warning(!name || field, `$getField('${name}') fail to find the matched Field. Maybe it has been unmounted.`);\n warning(name, `You should pass a name of the mounted Field to $getField().`);\n\n if (field) {\n return field.$new();\n }\n };\n\n $$onChange = (name, $state, callback) =>\n this.$setStates(\n {\n [name]: $state\n },\n callback\n );\n\n $$setStates = ($stateTree = {}, processer, callback, force) => {\n const $parsedTree = this.$$deepParseObject($stateTree);\n let hasStateChange = false;\n\n utils.objectEach(this.$$registers, (handler, name) => {\n const data = name in $stateTree ? $stateTree[name] : utils.parsePath($parsedTree, name);\n\n if (!utils.isUndefined(data) || force) {\n const $newState = processer(data, handler);\n\n if ($newState) {\n const $prevValue = this.$formutil.$weakParams[name];\n const { $value: $newValue } = handler.$$merge($newState);\n\n handler.$$detectChange($newState);\n\n if ('$value' in $newState || '$viewValue' in $newState) {\n const findItem = utils.arrayFind(this.$$fieldChangedQueue, item => item.name === name);\n\n if (findItem) {\n if (!('$prevValue' in findItem)) {\n findItem.$prevValue = findItem.$newValue;\n }\n\n findItem.$newValue = $newValue;\n } else {\n this.$$fieldChangedQueue.push({\n name,\n $newValue,\n $prevValue\n });\n }\n }\n\n hasStateChange = true;\n }\n }\n });\n\n if (hasStateChange) {\n return this.$render(callback);\n }\n\n return Promise.resolve(utils.runCallback(callback, this.$formutil));\n };\n\n componentDidMount() {\n utils.createRef(this.props.$ref, this.$formutil);\n }\n\n componentDidUpdate(prevProps) {\n utils.createRef(this.props.$ref, this.$formutil);\n\n cancelFrame(this.$$triggerChangeTimer);\n\n // ensure this calls to access the newest $formutil\n this.$$triggerChangeTimer = requestFrame(() => {\n this.$$triggerFormChange();\n });\n }\n\n componentWillUnmount() {\n utils.createRef(this.props.$ref, null);\n }\n\n $render = callback =>\n new Promise(resolve => this.forceUpdate(() => resolve(utils.runCallback(callback, this.$formutil))));\n\n $validates = (...args) => {\n let callback;\n\n if (utils.isFunction(args[args.length - 1])) {\n callback = args.pop();\n }\n\n if (args.length) {\n const flatter = names => {\n names.forEach(name => {\n if (Array.isArray(name)) {\n flatter(name);\n } else {\n const handler = this.$getField(name);\n\n if (handler) {\n handler.$validate();\n }\n }\n });\n };\n\n flatter(args);\n } else {\n utils.objectEach(this.$$registers, handler => handler.$validate());\n\n if (utils.isFunction(this.props.$validator)) {\n this.$$formValidate();\n }\n }\n\n return this.$onValidates(callback);\n };\n\n $onValidates = callback => {\n const filedValidatePromises = Object.keys(this.$$registers).map(name => this.$$registers[name].$onValidate());\n\n filedValidatePromises.push(this.$$formValidatePromise);\n\n return Promise.all(filedValidatePromises).then(() => utils.runCallback(callback, this.$formutil));\n };\n\n $validate = (name, callback) => {\n const handler = this.$getField(name);\n\n if (handler) {\n return handler.$validate(callback);\n }\n\n return utils.runCallback(callback);\n };\n\n $reset = ($stateTree, callback) => {\n this.$$defaultInitialize();\n\n if (utils.isFunction($stateTree)) {\n callback = $stateTree;\n $stateTree = {};\n }\n\n return this.$$setStates($stateTree, ($state, handler) => handler.$$reset($state), callback, true);\n };\n\n $setStates = ($stateTree, callback) => this.$$setStates($stateTree, $state => $state, callback);\n\n $setValues = ($valueTree, callback) => {\n this.$$deepParseObject(utils.deepClone($valueTree), this.$$defaultValues);\n\n return this.$$setStates($valueTree, $value => ({ $value }), callback);\n };\n\n $setFocuses = ($focusedTree, callback) => this.$$setStates($focusedTree, $focused => ({ $focused }), callback);\n $setDirts = ($dirtyTree, callback) => this.$$setStates($dirtyTree, $dirty => ({ $dirty }), callback);\n $setTouches = ($touchedTree, callback) => this.$$setStates($touchedTree, $touched => ({ $touched }), callback);\n $setPendings = ($pendingTree, callback) => this.$$setStates($pendingTree, $pending => ({ $pending }), callback);\n $setErrors = ($errorTree, callback) => this.$$setStates($errorTree, $error => ({ $error }), callback);\n\n $batchState = ($state, callback) => this.$setStates(utils.objectMap(this.$$registers, () => $state), callback);\n $batchDirty = ($dirty, callback) =>\n this.$batchState(\n {\n $dirty\n },\n callback\n );\n\n $batchTouched = ($touched, callback) =>\n this.$batchState(\n {\n $touched\n },\n callback\n );\n\n $batchFocused = ($focused, callback) =>\n this.$batchState(\n {\n $focused\n },\n callback\n );\n\n $batchPending = ($pending, callback) =>\n this.$batchState(\n {\n $pending\n },\n callback\n );\n\n $batchError = ($error, callback) =>\n this.$batchState(\n {\n $error\n },\n callback\n );\n\n _render() {\n const $formutil = this.$formutil;\n let { children, render, component } = this.props;\n\n if (component) {\n return createElement(component, { $formutil });\n }\n\n if (utils.isFunction(render)) {\n return render($formutil);\n }\n\n if (utils.isFunction(children)) {\n return children($formutil);\n }\n\n return Children.map(children, child =>\n child && utils.isFunction(child.type)\n ? cloneElement(child, {\n $formutil\n })\n : child\n );\n }\n\n render() {\n const { $processer } = this.props;\n const $stateArray = Object.keys(this.$$registers).map(path => ({\n path,\n $state: this.$$registers[path].$getState()\n }));\n\n const $weakParams = utils.toObject($stateArray, ($params, { path, $state }) => {\n if ($processer) {\n $processer($state, path);\n }\n\n if ('$value' in $state && ($state.$dirty || !utils.isUndefined($state.$value))) {\n $params[path] = $state.$value;\n }\n });\n\n const $pureParams = utils.toObject(\n $stateArray,\n ($params, { path, $state }) => path in $weakParams && utils.parsePath($params, path, $weakParams[path])\n );\n\n const $invalid = $stateArray.some(({ $state }) => $state.$invalid);\n const $dirty = $stateArray.some(({ $state }) => $state.$dirty);\n const $touched = $stateArray.some(({ $state }) => $state.$touched);\n const $focused = $stateArray.some(({ $state }) => $state.$focused);\n const $pending = this.$$formPending || $stateArray.some(({ $state }) => $state.$pending);\n\n const $formutil = (this.$formutil = {\n $$registers: { ...this.$$registers },\n $$deepRegisters: this.$$deepRegisters,\n $states: utils.toObject($stateArray, ($states, { path, $state }) => utils.parsePath($states, path, $state)),\n $params: {\n ...this.$$defaultValues,\n ...$pureParams\n },\n $errors: utils.toObject($stateArray, ($errors, { path, $state }) => {\n if ($state.$invalid) {\n utils.parsePath($errors, path, $state.$error);\n }\n }),\n $dirts: utils.toObject($stateArray, ($dirts, { path, $state }) =>\n utils.parsePath($dirts, path, $state.$dirty)\n ),\n $touches: utils.toObject($stateArray, ($touches, { path, $state }) =>\n utils.parsePath($touches, path, $state.$touched)\n ),\n $focuses: utils.toObject($stateArray, ($focuses, { path, $state }) =>\n utils.parsePath($focuses, path, $state.$focused)\n ),\n $pendings: utils.toObject($stateArray, ($pendings, { path, $state }) =>\n utils.parsePath($pendings, path, $state.$pending)\n ),\n\n $weakStates: utils.toObject($stateArray, ($states, { path, $state }) => ($states[path] = $state)),\n $weakParams,\n $weakErrors: utils.toObject($stateArray, ($errors, { path, $state }) => {\n if ($state.$invalid) {\n $errors[path] = $state.$error;\n }\n }),\n $weakDirts: utils.toObject($stateArray, ($dirts, { path, $state }) => ($dirts[path] = $state.$dirty)),\n $weakTouches: utils.toObject(\n $stateArray,\n ($touches, { path, $state }) => ($touches[path] = $state.$touched)\n ),\n $weakFocuses: utils.toObject(\n $stateArray,\n ($focuses, { path, $state }) => ($focuses[path] = $state.$focused)\n ),\n $weakPendings: utils.toObject(\n $stateArray,\n ($weakPendings, { path, $state }) => ($weakPendings[path] = $state.$pending)\n ),\n\n $getFirstError(name) {\n if (name) {\n const $fieldutil = $formutil.$getField(name);\n\n return $fieldutil && $fieldutil.$getFirstError();\n }\n\n for (let name in $formutil.$weakErrors) {\n const $fieldError = $formutil.$weakErrors[name];\n\n for (let key in $fieldError) {\n return $fieldError[key] instanceof Error ? $fieldError[key].message : $fieldError[key];\n }\n }\n },\n\n $render: this.$render,\n\n $getField: this.$getField,\n $onValidates: this.$onValidates,\n\n // get the newest $formutil\n $new: () => this.$formutil,\n\n $setStates: this.$setStates,\n $setValues: this.$setValues,\n $setErrors: this.$setErrors,\n $setTouches: this.$setTouches,\n $setDirts: this.$setDirts,\n $setFocuses: this.$setFocuses,\n\n $batchState: this.$batchState,\n $batchTouched: this.$batchTouched,\n $batchDirty: this.$batchDirty,\n $batchFocused: this.$batchFocused,\n\n $reset: this.$reset,\n $validates: this.$validates,\n $validate: this.$validate,\n\n $valid: !$invalid,\n $invalid,\n $dirty,\n $pristine: !$dirty,\n $touched,\n $untouched: !$touched,\n $focused,\n $pending\n });\n\n return {this._render()};\n }\n}\n\nexport default Form;\n","import React, { Component } from 'react';\nimport Form from './Form';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withForm(WrappedComponent, config = {}) {\n class FormEnhanced extends Component {\n static displayName =\n 'React.Formutil.withForm.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n const { ...others } = this.props;\n const { component, ...formProps } = this.props;\n\n ['$defaultStates', '$defaultValues', '$onFormChange', '$validator', '$processer', '$ref'].forEach(prop => {\n if (prop in others) {\n if (prop === '$defaultStates' || prop === '$defaultValues') {\n formProps[prop] = { ...config[prop], ...others[prop] };\n }\n delete others[prop];\n }\n });\n\n return (\n }\n />\n );\n }\n }\n\n return hoistStatics(FormEnhanced, WrappedComponent);\n}\n\nexport default createHOC(withForm);\n","import { Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport * as utils from './utils';\nimport warning from 'warning';\nimport { FORM_VALIDATE_RESULT } from './Form';\n\nlet FIELD_UUID = 0;\nconst $baseState = {\n $valid: true,\n $invalid: false,\n\n $dirty: false,\n $pristine: true,\n\n $touched: false,\n $untouched: true,\n\n $focused: false,\n\n $pending: false,\n\n $error: {}\n};\n\nfunction isError(result) {\n return /*!utils.isUndefined(result) && */ result !== true;\n}\n\nfunction warningValidatorReturn(result, key, name) {\n warning(\n !utils.isUndefined(result),\n `You should return a string or Error when the validation('${name &&\n name + ': '}${key}') failed, otherwise return true.`\n );\n}\n\nexport const propTypes =\n process.env.NODE_ENV !== 'production'\n ? {\n name: PropTypes.string,\n\n $defaultValue: PropTypes.any,\n $defaultState: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $onFieldChange: PropTypes.func,\n $validators: PropTypes.object,\n $asyncValidators: PropTypes.object,\n $validateLazy: PropTypes.bool,\n $reserveOnUnmount: PropTypes.bool,\n $ref: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n current: PropTypes.any\n })\n ]),\n $parser: PropTypes.func,\n $formatter: PropTypes.func,\n\n render: PropTypes.func,\n component: PropTypes.func,\n children(props, ...args) {\n let pt = PropTypes.oneOfType([PropTypes.func, PropTypes.node]);\n\n if (!props.render && !props.component && props.children !== null) {\n pt = pt.isRequired;\n }\n\n return pt(props, ...args);\n }\n }\n : undefined;\n\nexport const displayName = 'React.Formutil.Field';\n\nexport function GET_FIELD_UUID() {\n return FIELD_UUID++;\n}\n\nexport function renderField($fieldutil, props) {\n let { children, render, component } = props;\n\n if (component) {\n return createElement(component, { $fieldutil });\n }\n\n if (utils.isFunction(render)) {\n return render($fieldutil);\n }\n\n if (utils.isFunction(children)) {\n return children($fieldutil);\n }\n\n return Children.map(children, child =>\n child && utils.isFunction(child.type)\n ? cloneElement(child, {\n $fieldutil\n })\n : child\n );\n}\n\nexport function createHandler($this, owner) {\n const $fieldHandler = {\n $$FIELD_UUID: $this.$$FIELD_UUID,\n\n $$reset,\n $$merge,\n $$detectChange,\n $$triggerChange,\n $onValidate,\n\n $new() {\n return $this.$fieldutil;\n },\n $picker: $getState,\n $getState,\n // not support in Hooks\n $getComponent() {\n return owner;\n },\n\n $reset($state, callback) {\n return $this.$setState($$reset($state), callback);\n },\n $getFirstError,\n $validate,\n $setState: $this.$setState,\n $render,\n $setValue,\n $setTouched,\n $setDirty,\n $setFocused,\n $setValidity,\n $setError,\n $setPending\n };\n\n let $$validatePromise;\n\n function $$detectChange($newState) {\n if ('$value' in $newState || '$viewValue' in $newState) {\n $validate();\n }\n }\n\n function $$triggerChange({ $newValue, $prevValue }) {\n const { $onFieldChange } = $this.props;\n\n if (utils.isFunction($onFieldChange)) {\n $onFieldChange($newValue, $prevValue, $this.$formContext.$formutil);\n }\n }\n\n function $onValidate(callback) {\n $$validatePromise.then(callback);\n\n return $$validatePromise;\n }\n\n function $$reset($newState) {\n let $initialState;\n\n const { props, $formContext } = $this;\n\n if ($formContext.$$getDefault) {\n const $name = props.name;\n const { $$defaultStates, $$defaultValues } = $formContext.$$getDefault();\n\n if ($name && $$defaultValues) {\n const $initialValue = utils.parsePath($$defaultValues, $name);\n\n $initialState = utils.parsePath($$defaultStates, $name) || {};\n\n if (!utils.isUndefined($initialValue)) {\n $initialState.$value = $initialValue;\n }\n }\n }\n\n const { $defaultValue, $defaultState } = props;\n\n return $$merge({\n ...$baseState, // the base state\n ...(utils.isFunction($defaultState) ? $defaultState(props) : $defaultState), // self default state\n $value: utils.isFunction($defaultValue)\n ? $defaultValue(props)\n : '$defaultValue' in props\n ? $defaultValue\n : '',\n ...$initialState, // the default state from Form\n ...$newState\n });\n }\n\n function $getState() {\n return { ...$this.$state };\n }\n\n function $validate(callback) {\n return ($$validatePromise = new Promise(resolve => {\n const { props, $formContext } = $this;\n const $validators = { ...props.$validators, ...props.$asyncValidators };\n const {\n $value,\n $pending,\n $error: { ...$newError }\n } = $this.$state;\n const { $formutil } = $formContext;\n const $validError = {};\n let $skipRestValidate = false;\n let $breakAsyncHandler;\n let $shouldCancelPrevAsyncValidate;\n let prevCallback;\n let validation;\n\n delete $newError[FORM_VALIDATE_RESULT];\n\n const $validatePromises = Object.keys($validators).reduce((promises, key) => {\n delete $newError[key];\n\n if (!$skipRestValidate && props[key] != null) {\n const result = $validators[key]($value, props[key], {\n ...props,\n $formutil,\n $fieldutil: $this.$fieldutil,\n $validError\n });\n\n if (utils.isPromise(result)) {\n promises.push(\n // @ts-ignore\n result.catch(reason => {\n if (!$breakAsyncHandler) {\n $setValidity(key, reason || key);\n }\n })\n );\n } else if (isError(result)) {\n $validError[key] = result || key;\n\n warningValidatorReturn(result, key, props.name);\n\n if (props.$validateLazy) {\n $skipRestValidate = true;\n }\n }\n }\n\n return promises;\n }, []);\n const execCallback = $fieldutil =>\n resolve(utils.runCallback(callback, utils.runCallback(prevCallback, $fieldutil)));\n\n if ($validatePromises.length) {\n if (!$pending) {\n $setPending(true);\n }\n\n $shouldCancelPrevAsyncValidate = setCallback => ($breakAsyncHandler = setCallback(execCallback));\n\n $validatePromises.push(\n $setError({\n ...$newError,\n ...$validError\n })\n );\n\n validation = Promise.all($validatePromises).then(() => {\n if ($breakAsyncHandler) {\n return $breakAsyncHandler;\n }\n\n $this.$shouldCancelPrevAsyncValidate = null;\n\n return $setPending(false, execCallback);\n });\n } else {\n if ($pending) {\n $setPending(false);\n }\n\n validation = $setError(\n {\n ...$newError,\n ...$validError\n },\n execCallback\n );\n }\n\n if ($this.$shouldCancelPrevAsyncValidate) {\n $this.$shouldCancelPrevAsyncValidate(callback => {\n prevCallback = callback;\n\n return validation;\n });\n }\n\n $this.$shouldCancelPrevAsyncValidate = $shouldCancelPrevAsyncValidate;\n }));\n }\n\n function $render($viewValue, callback) {\n return $this.$setState(\n {\n $viewValue,\n $dirty: true\n },\n callback\n );\n }\n\n function $setValue($value, callback) {\n return $this.$setState(\n {\n $value\n },\n callback\n );\n }\n\n function $setTouched($touched, callback) {\n return $this.$setState(\n {\n $touched\n },\n callback\n );\n }\n\n function $setDirty($dirty, callback) {\n return $this.$setState(\n {\n $dirty\n },\n callback\n );\n }\n\n function $setFocused($focused, callback) {\n return $this.$setState(\n {\n $focused\n },\n callback\n );\n }\n\n function $setError($error, callback) {\n return $this.$setState(\n {\n $error\n },\n callback\n );\n }\n\n function $setValidity(key, result = true, callback) {\n const {\n $error: { ...$newError }\n } = $this.$state;\n\n if (isError(result)) {\n $newError[key] = result || key;\n\n warningValidatorReturn(result, key, $this.props.name);\n } else {\n delete $newError[key];\n }\n\n return $setError($newError, callback);\n }\n\n function $setPending($pending, callback) {\n return $this.$setState(\n {\n $pending\n },\n callback\n );\n }\n\n function $getFirstError() {\n const { $error = {} } = $this.$state;\n\n for (let name in $error) {\n return $error[name] instanceof Error ? $error[name].message : $error[name];\n }\n }\n\n function $$merge({ ...$newState }) {\n if ('$error' in $newState) {\n if (!$newState.$error) {\n $newState.$error = {};\n }\n\n $newState.$valid = Object.keys($newState.$error).length === 0;\n }\n\n // process $value\n const { $parser, $formatter } = $this.props;\n\n if ('$viewValue' in $newState && !('$value' in $newState)) {\n const $setViewValue = $value => ($newState.$viewValue = $value);\n\n $newState.$value = $parser ? $parser($newState.$viewValue, $setViewValue) : $newState.$viewValue;\n } else if ('$value' in $newState && !('$viewValue' in $newState)) {\n const $setModelValue = $value => ($newState.$value = $value);\n\n $newState.$viewValue = $formatter ? $formatter($newState.$value, $setModelValue) : $newState.$value;\n }\n\n // process $valid/$invalid\n if ('$valid' in $newState) {\n $newState.$invalid = !$newState.$valid;\n } else if ('$invalid' in $newState) {\n $newState.$dirty = !$newState.$invalid;\n }\n\n // process $dirty/$pristine\n if ('$dirty' in $newState) {\n $newState.$pristine = !$newState.$dirty;\n } else if ('$pristine' in $newState) {\n $newState.$dirty = !$newState.$pristine;\n }\n\n // process $touched/$untouched\n if ('$touched' in $newState) {\n $newState.$untouched = !$newState.$touched;\n } else if ('$untouched' in $newState) {\n $newState.$touched = !$newState.$untouched;\n }\n\n $this.$state = { ...$this.$state, ...$newState };\n\n return $getState();\n }\n\n return $fieldHandler;\n}\n","import React, { Component } from 'react';\nimport { createHandler, GET_FIELD_UUID, propTypes, displayName, renderField } from './fieldHelper';\nimport FormContext from './context';\nimport warning from 'warning';\nimport { runCallback, createRef } from './utils';\n\nclass Field extends Component {\n static displayName = displayName;\n static propTypes = propTypes;\n\n $$FIELD_UUID = GET_FIELD_UUID();\n\n /** @type { any } */\n $formContext;\n /** @type { any } */\n $state;\n\n componentDidMount() {\n this.isMounting = true;\n\n const {\n props: { name: $name },\n $formContext\n } = this;\n\n warning(\n !$name || $formContext.$formutil,\n `You should enusre that the with the name '${$name}' must be used underneath a component or withForm() HOC, otherwise it's isolated.`\n );\n\n warning($name, `You should assign a name to , otherwise it will be isolated!`);\n\n if ($formContext.$$register) {\n $formContext.$$register($name, this.$fieldHandler);\n }\n\n this.$prevValue = this.$state.$value;\n\n createRef(this.props.$ref, this.$fieldutil);\n }\n\n componentWillUnmount() {\n if (this.$formContext.$$unregister) {\n this.$formContext.$$unregister(this.props.name, this.$fieldHandler, this.props.$reserveOnUnmount);\n }\n\n this.isMounting = false;\n\n createRef(this.props.$ref, null);\n }\n\n componentDidUpdate(prevProps) {\n const $name = this.props.name;\n\n if ($name !== prevProps.name) {\n if (this.$formContext.$$register) {\n this.$formContext.$$register($name, this.$fieldHandler, prevProps.name);\n }\n }\n\n createRef(this.props.$ref, this.$fieldutil);\n\n if (this.$state.$value !== this.$prevValue) {\n if (!($name in (this.$formContext.$$registers || {}))) {\n this.$registered.$$triggerChange({\n $newValue: this.$state.$value,\n $prevValue: this.$prevValue\n });\n }\n\n this.$prevValue = this.$state.$value;\n }\n }\n\n $setState = ($newState, callback) =>\n new Promise(resolve => {\n const execute = () => resolve(runCallback(callback, this.$fieldutil));\n\n if (this.isMounting) {\n const $name = this.props.name;\n\n if ($name in (this.$formContext.$$registers || {})) {\n this.$formContext.$$onChange($name, $newState, execute);\n } else {\n this.$registered.$$merge($newState);\n\n this.$registered.$$detectChange($newState);\n\n this.forceUpdate(execute);\n }\n } else {\n this.$registered.$$merge($newState);\n execute();\n }\n });\n\n _render() {\n const $fieldutil = (this.$fieldutil = {\n $name: this.props.name,\n ...this.$registered.$getState(),\n ...this.$registered,\n $$formutil: this.$formContext.$formutil\n });\n\n return renderField($fieldutil, this.props);\n }\n\n render() {\n const shouldInitial = !this.$formContext;\n\n return (\n \n {context => {\n this.$formContext = context;\n\n if (!this.$fieldHandler) {\n this.$fieldHandler = createHandler(this, this);\n }\n\n this.$registered = (context.$$registers || {})[this.$fieldHandler.$name] || this.$fieldHandler;\n\n if (shouldInitial) {\n this.$fieldHandler.$$reset();\n this.$fieldHandler.$validate();\n }\n\n return this._render();\n }}\n \n );\n }\n}\n\nexport default Field;\n","import React, { Component } from 'react';\nimport Field from './Field';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withField(WrappedComponent, config = {}) {\n class FieldEnhanced extends Component {\n static displayName =\n 'React.Formutil.withField.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n const { ...others } = this.props;\n const { component, ...fieldProps } = this.props;\n\n [\n '$validators',\n '$asyncValidators',\n '$validateLazy',\n '$reserveOnUnmount',\n '$defaultValue',\n '$defaultState',\n '$onFieldChange',\n '$parser',\n '$formatter',\n '$ref',\n 'name'\n ]\n .concat(\n Object.keys({\n ...config.$validators,\n ...config.$asyncValidators,\n ...others.$validators,\n ...others.$asyncValidators\n })\n )\n .forEach(prop => {\n if (prop in others) {\n if (prop === '$validators' || prop === '$asyncValidators' || prop === '$defaultState') {\n fieldProps[prop] = { ...config[prop], ...others[prop] };\n }\n delete others[prop];\n }\n });\n\n return (\n }\n />\n );\n }\n }\n\n return hoistStatics(FieldEnhanced, WrappedComponent);\n}\n\nexport default createHOC(withField);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nclass EasyFieldNative extends Component {\n static displayName = 'React.Formutil.EasyField.Native';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n\n value: PropTypes.any,\n name: PropTypes.string,\n type: PropTypes.string,\n\n checked: PropTypes.any,\n unchekced: PropTypes.any\n };\n\n static defaultProps = {\n value: '',\n type: 'text',\n checked: true,\n unchecked: false\n };\n\n render() {\n const { $fieldutil, value: htmlValue, onChange, onFocus, onBlur, checked, unchecked, ...others } = this.props;\n const htmlType = this.props.type;\n\n let htmlProps = {\n value: 'compositionValue' in this ? this.compositionValue : htmlValue,\n onCompositionEnd: ev => {\n this.composition = false;\n delete this.compositionValue;\n htmlProps.onChange(ev);\n },\n onCompositionStart: () => (this.composition = true),\n onChange: ev => {\n const { value } = ev.target;\n\n if (this.composition) {\n this.compositionValue = value;\n this.forceUpdate();\n } else {\n onChange(value, ev);\n }\n },\n onFocus,\n onBlur\n };\n let Element = 'input';\n\n switch (htmlType) {\n case 'select':\n Element = htmlType;\n htmlProps.onChange = ev => {\n const node = ev.target;\n const value = node.multiple\n ? [].slice\n .call(node.options)\n .filter(option => option.selected)\n .map(option => option.value)\n : node.value;\n\n onChange(value, ev);\n };\n\n delete others.type;\n\n break;\n case 'textarea':\n Element = htmlType;\n delete others.type;\n break;\n\n case 'checkbox':\n case 'radio':\n htmlProps = {\n checked: htmlValue === checked,\n onChange: ev => {\n onChange(ev.target.checked ? checked : unchecked, ev);\n },\n onFocus,\n onBlur\n };\n break;\n\n default:\n break;\n }\n\n return ;\n }\n}\n\nexport default EasyFieldNative;\n","import React, { Component, Children, cloneElement, createContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { isFunction } from '../utils';\nimport warning from 'warning';\n\n/** @type {any} */\nconst { Provider, Consumer } = createContext({});\n\nclass EasyFieldGroup extends Component {\n static displayName = 'React.Formutil.EasyField.Group';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n\n value: PropTypes.any,\n name: PropTypes.string,\n type: PropTypes.string.isRequired,\n groupNode: PropTypes.any,\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).isRequired\n };\n\n static defaultProps = {\n type: 'checkbox',\n groupNode: 'div'\n };\n\n getGroupContext() {\n return this.props;\n }\n\n _render() {\n const { className, groupNode: Element, children } = this.props;\n\n const GroupOptionProps = {\n GroupOption: EasyFieldGroupOption,\n Field: DeprecatedEasyFieldGroupOption\n };\n\n const childNodes = isFunction(children)\n ? children(GroupOptionProps)\n : Children.map(children, child => cloneElement(child, GroupOptionProps));\n\n if (Element === null) {\n return childNodes;\n }\n\n return {childNodes};\n }\n\n render() {\n return {this._render()};\n }\n}\n\nclass EasyFieldGroupOption extends Component {\n static displayName = 'React.Formutil.EasyField.Group.Option';\n\n static propTypes = {\n $value: PropTypes.any.isRequired\n };\n\n componentDidMount() {\n warning('$value' in this.props, `You should pass a $value to .`);\n }\n\n render() {\n const { $value, onChange, onFocus, onBlur, ...others } = this.props;\n\n return (\n \n {$groupHander => {\n const { type, name } = $groupHander;\n\n const elemProps =\n type === 'radio'\n ? {\n checked: $groupHander.value === $value,\n onChange: ev => {\n $groupHander.onChange($value, ev);\n\n onChange && onChange(ev);\n }\n }\n : type === 'checkbox'\n ? {\n checked: $groupHander.value.indexOf($value) > -1,\n onChange: ev => {\n $groupHander.onChange(\n ev.target.checked\n ? $groupHander.value.concat($value)\n : $groupHander.value.filter(value => value !== $value),\n ev\n );\n\n onChange && onChange(ev);\n }\n }\n : {\n value: $groupHander.value,\n onChange: ev => {\n $groupHander.onChange(ev);\n\n onChange && onChange(ev);\n }\n };\n\n return (\n {\n $groupHander.onFocus(ev);\n onFocus && onFocus(ev);\n }}\n onBlur={ev => {\n $groupHander.onBlur(ev);\n onBlur && onBlur(ev);\n }}\n />\n );\n }}\n \n );\n }\n}\n\nclass DeprecatedEasyFieldGroupOption extends Component {\n static displayName = 'React.Formutil.EasyField.Group.Option.Deprecated';\n\n componentDidMount() {\n warning(\n false,\n `The \"Field\" property in EasyField's children-props has been deprecated. Please use \"GroupOption\" instead.`\n );\n }\n\n render() {\n return ;\n }\n}\n\nexport default EasyFieldGroup;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport isEqual from 'react-fast-compare';\nimport Form from '../Form';\nimport Field from '../Field';\nimport { isUndefined, isFunction, runCallback } from '../utils';\n\nconst Wrapper = React.Frament || 'div';\n\nclass EasyFieldList extends Component {\n static displayName = 'React.Formutil.EasyField.List';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n value: PropTypes.array,\n\n children: PropTypes.func.isRequired\n };\n\n id = 0;\n latestValue = this.props.value;\n $formutil;\n\n constructor(props) {\n super(props);\n\n this.state = {\n items: props.value.length ? props.value.map(() => this.getId()) : [this.getId()],\n formKey: 0\n };\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.value !== this.latestValue) {\n this.setState({\n items: this.props.value.length ? this.props.value.map(() => this.getId()) : [this.getId()],\n formKey: this.state.formKey + 1\n });\n\n this.latestValue = this.props.value;\n }\n }\n\n getId(values) {\n return {\n id: this.id++,\n values\n };\n }\n\n FieldValidators = {\n required(value) {\n return value !== null;\n }\n };\n\n $onFormChange = $formutil => {\n $formutil.$onValidates($formutil => {\n const { $invalid, $params } = $formutil;\n\n if ($invalid) {\n if (this.props.value.length) {\n this.props.onChange((this.latestValue = []));\n }\n } else if (!isEqual(this.props.value, $params.list)) {\n this.props.onChange((this.latestValue = $params.list));\n }\n });\n };\n\n swap = (m, n, callback) =>\n this.$setState(({ items }) => {\n [items[n], items[m]] = [items[m], items[n]];\n\n return items;\n }, callback);\n\n insert = (...args) => {\n let m, values, callback;\n\n args.forEach(arg => {\n if (isFunction(arg)) {\n callback = arg;\n } else if (typeof arg === 'number') {\n m = arg;\n } else if (typeof arg === 'object') {\n values = arg;\n }\n });\n\n return this.$setState(({ items }) => {\n if (isUndefined(m)) {\n items.push(this.getId(values));\n } else {\n items.splice(m, 0, this.getId(values));\n }\n\n return { items };\n }, callback);\n };\n\n remove = (...args) => {\n let m, callback;\n\n args.forEach(arg => {\n if (isFunction(arg)) {\n callback = arg;\n } else if (typeof arg === 'number') {\n m = arg;\n }\n });\n\n return this.$setState(({ items }) => {\n if (isUndefined(m)) {\n items.pop();\n } else {\n items.splice(m, 1);\n }\n\n if (!items.length) {\n items = [this.getId()];\n }\n\n return { items };\n }, callback);\n };\n\n $setState = (updater, callback) =>\n new Promise(resolve =>\n this.setState(updater, () =>\n this.$formutil.$onValidates($formutil => resolve(runCallback(callback, $formutil)))\n )\n );\n\n render() {\n const { children, onFocus, onBlur, value } = this.props;\n\n if (!isFunction(children)) {\n return null;\n }\n\n const $baseutil = {\n $length: this.state.items.length,\n $insert: this.insert,\n $remove: this.remove,\n $swap: this.swap,\n $push: (values, callback) => this.insert(values, callback),\n $pop: callback => this.remove(callback),\n $shift: callback => this.remove(0, callback),\n $unshift: (values, callback) => this.insert(0, values, callback),\n onFocus,\n onBlur\n };\n\n return (\n {\n this.$formutil = $formutil;\n\n return (\n \n {this.state.items.map(({ id, values }, index) => (\n {\n return (\n \n $formutil.$onValidates($formutil => {\n const { $invalid, $params } = $formutil;\n\n if ($invalid) {\n if ($fieldutil.$viewValue !== null) {\n $fieldutil.$render(null);\n }\n } else if (!isEqual($fieldutil.$viewValue, $params)) {\n $fieldutil.$render($params);\n }\n })\n }\n children={$innerFormutil =>\n children(\n {\n ...$baseutil,\n ...$innerFormutil,\n $index: index,\n $isLast: () => index === this.state.items.length - 1,\n $isFirst: () => index === 0\n },\n $formutil\n )\n }\n />\n );\n }}\n />\n ))}\n \n );\n }}\n />\n );\n }\n}\n\nexport default EasyFieldList;\n","import { Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport Native from './Native';\nimport Group from './Group';\nimport List from './List';\nimport { isEmpty, isUndefined, isFunction, isValidProp } from '../utils';\n\nexport const TYPE = '__TYPE__';\nexport const defaultValidators = [\n [\n 'required',\n ($value, check, { __TYPE__, checked = true }) =>\n __TYPE__ === 'checked' ? $value === checked : !isEmpty($value)\n ],\n ['maxLength', ($value, len) => isEmpty($value) || $value.length <= len],\n ['minLength', ($value, len) => isEmpty($value) || $value.length >= len],\n ['max', ($value, limit) => isEmpty($value) || $value * 1 <= limit],\n ['min', ($value, limit) => isEmpty($value) || $value * 1 >= limit],\n ['pattern', ($value, regexp) => isEmpty($value) || regexp.test($value)],\n ['enum', ($value, enumeration) => isEmpty($value) || enumeration.indexOf($value) > -1],\n ['checker', ($value, checker, props) => checker($value, props)]\n].reduce(($validators, item) => {\n const [validKey, validate] = item;\n $validators[validKey] = function validator($value, propValue, { validMessage = {} }) {\n return validate(...arguments) || validMessage[validKey] || `Error input: ${validKey}`;\n };\n return $validators;\n}, {});\n\nexport const propTypes =\n process.env.NODE_ENV !== 'production'\n ? {\n type: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n component: PropTypes.func,\n render: PropTypes.func,\n\n defaultValue: PropTypes.any,\n validMessage: PropTypes.object,\n\n valuePropName: PropTypes.string,\n changePropName: PropTypes.string,\n focusPropName: PropTypes.string,\n blurPropName: PropTypes.string,\n\n passUtil: PropTypes.string\n }\n : undefined;\n\nexport const displayName = 'React.Formutil.EasyField';\n\nexport const defaultProps = {\n validMessage: {},\n valuePropName: 'value',\n changePropName: 'onChange',\n focusPropName: 'onFocus',\n blurPropName: 'onBlur',\n $parser: value => (typeof value === 'string' ? value.trim() : value)\n};\n\nexport function createHandler($fieldutil, fieldProps, childProps) {\n const { valuePropName, changePropName, focusPropName, blurPropName, passUtil } = fieldProps;\n\n const fetchValueFromEvent = function(ev) {\n return ev && ev.target ? ev.target[valuePropName] : ev;\n };\n\n const $handleProps = {\n ...childProps,\n\n [valuePropName]: $fieldutil.$viewValue,\n [changePropName]: (...args) => {\n let value = args[0];\n let ev = args[args.length - 1];\n\n if (!ev || !ev.target) {\n ev = args;\n } else {\n ev = [ev];\n }\n\n const onChange = fieldProps[changePropName];\n onChange && onChange(...ev);\n\n const newValue = fetchValueFromEvent(value);\n $fieldutil.$render(newValue);\n },\n [focusPropName]: (...args) => {\n const onFocus = fieldProps[focusPropName];\n onFocus && onFocus(...args);\n\n $fieldutil.$setFocused(true);\n },\n [blurPropName]: (...args) => {\n const onBlur = fieldProps[blurPropName];\n onBlur && onBlur(...args);\n\n if ($fieldutil.$untouched) {\n $fieldutil.$setTouched(true);\n }\n\n $fieldutil.$setFocused(false);\n }\n };\n\n if (passUtil) {\n $handleProps[passUtil === true ? '$fieldutil' : passUtil] = $fieldutil;\n }\n\n return $handleProps;\n}\n\nexport function parseProps(props) {\n const {\n children,\n component,\n render,\n\n ...fieldProps\n } = props;\n\n const {\n // filter all the props that accept by EasyField\n name,\n type,\n defaultValue,\n valuePropName,\n changePropName,\n focusPropName,\n blurPropName,\n validMessage,\n __TYPE__,\n passUtil,\n\n // filter all the props that accept by Field\n $defaultValue,\n $defaultState,\n $onFieldChange,\n $validators,\n $asyncValidators,\n $validateLazy,\n $reserveOnUnmount,\n $parser,\n $formatter,\n $ref,\n\n ...childProps\n } = fieldProps;\n\n const renderProps = {\n children,\n component,\n render\n };\n\n const isNative = !isUndefined(type) || (isUndefined(children) && isUndefined(component) && isUndefined(render));\n\n Object.keys({\n ...(fieldProps.$validators = {\n ...defaultValidators,\n ...fieldProps.$validators\n }),\n ...fieldProps.$asyncValidators\n }).forEach(prop => {\n if (prop in childProps) {\n if (!isNative || !isValidProp(prop)) {\n delete childProps[prop];\n }\n }\n });\n\n if (isNative) {\n const [htmlType = 'text', groupType] = (type || '').split('.');\n\n renderProps.component = htmlType === 'group' ? Group : htmlType === 'list' ? List : Native;\n\n // Native or Group need to pass 'name' | 'type' | 'children'\n if (name) {\n childProps.name = name;\n }\n\n if (type) {\n childProps.type = htmlType;\n }\n\n if (children) {\n childProps.children = children;\n }\n\n switch (htmlType) {\n case 'select':\n case 'textarea':\n if (props.multiple) {\n fieldProps[TYPE] = 'array';\n }\n break;\n\n case 'group':\n if (groupType === 'checkbox') {\n fieldProps[TYPE] = 'array';\n }\n\n childProps.type = groupType;\n break;\n\n case 'checkbox':\n case 'radio':\n fieldProps[TYPE] = 'checked';\n break;\n\n case 'list':\n fieldProps[TYPE] = 'array';\n break;\n\n default:\n break;\n }\n }\n\n if (!('$defaultValue' in fieldProps) && 'defaultValue' in props) {\n fieldProps.$defaultValue = defaultValue;\n }\n\n if (!('$defaultValue' in fieldProps) && TYPE in fieldProps) {\n let defaultValue;\n\n switch (fieldProps[TYPE]) {\n case 'checked':\n const { unchecked = false } = fieldProps;\n\n defaultValue = unchecked;\n break;\n\n case 'array':\n defaultValue = [];\n break;\n\n case 'object':\n defaultValue = {};\n break;\n\n case 'number':\n defaultValue = 0;\n break;\n\n case 'empty':\n default:\n break;\n }\n\n fieldProps.$defaultValue = defaultValue;\n }\n\n return {\n fieldProps,\n childProps,\n renderProps\n };\n}\n\nexport function renderField($handleProps, props) {\n let { component, render, children } = props;\n\n if (component) {\n return createElement(component, $handleProps);\n }\n\n if (isFunction(render)) {\n return render($handleProps);\n }\n\n if (isFunction(children)) {\n return children($handleProps);\n }\n\n return Children.map(children, child => cloneElement(child, $handleProps));\n}\n","import React, { Component } from 'react';\nimport Field from '../Field';\nimport { renderField, createHandler, parseProps, displayName, propTypes, defaultProps } from './easyFieldHandler';\n\n/**\n * 提供对浏览器原生表单控件的封装\n * 支持以下类型表单元素:\n * - input[type=xx]\n * - textarea\n * - select\n */\nclass EasyField extends Component {\n static displayName = displayName;\n static propTypes = propTypes;\n static defaultProps = defaultProps;\n\n render() {\n const { fieldProps, childProps, renderProps } = parseProps(this.props);\n\n return (\n renderField(createHandler($fieldutil, fieldProps, childProps), renderProps)}\n />\n );\n }\n}\n\nexport default EasyField;\n","import React, { Component } from 'react';\nimport FormContext from './context';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction connect(WrappedComponent) {\n class Connect extends Component {\n static displayName =\n 'React.Formutil.connect.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n return (\n \n {context => }\n \n );\n }\n }\n\n return hoistStatics(Connect, WrappedComponent);\n}\n\nexport default connect;\n","import React from 'react';\nimport FormContext from '../context';\n\nfunction useFormContext() {\n if (!React.useState) {\n throw new Error(`Hooks api need react@>=16.8, Please upgrade your reactjs.`);\n }\n\n const { useContext } = React;\n const $formContext = useContext(FormContext);\n\n return $formContext;\n}\n\nexport default useFormContext;\n","import React from 'react';\nimport useFormContext from './useFormContext';\nimport { runCallback, createRef } from '../utils';\nimport { createHandler, GET_FIELD_UUID } from '../fieldHelper';\nimport warning from 'warning';\n\n/**\n * @description\n * The custom hook for Field\n *\n * @param {string | object} [name]\n * @param {object} [props]\n *\n * @return {object} $Fieldutil\n */\nfunction useField(name, props = {}) {\n if (!React.useState) {\n throw new Error(`Hooks api need react@>=16.8, Please upgrade your reactjs.`);\n }\n\n const { useState, useLayoutEffect, useRef } = React;\n\n let $name;\n\n if (name) {\n if (typeof name === 'string') {\n $name = name;\n\n props.name = $name;\n } else {\n props = name;\n\n $name = props.name;\n }\n }\n\n const $formContext = useFormContext();\n /** @type {any} */\n const $this = useRef({}).current;\n /** @type {React.MutableRefObject} */\n const callbackRef = useRef([]);\n\n let $registered;\n\n $this.$formContext = $formContext;\n $this.props = props;\n $this.$setState = $setState;\n // we not directly use this $state, just from $this.$state\n const [, setState] = useState(() => {\n $this.$$FIELD_UUID = GET_FIELD_UUID();\n $this.$fieldHandler = $registered = createHandler($this);\n\n const $state = $this.$fieldHandler.$$reset();\n\n $this.$fieldHandler.$validate();\n\n return $state;\n });\n\n if (!$registered) {\n $registered = ($formContext.$$registers || {})[$this.$fieldHandler.$name] || $this.$fieldHandler;\n }\n\n useLayoutEffect(() => {\n const { $state } = $this;\n\n if ($this.isMounting) {\n if (!($name in ($formContext.$$registers || {}))) {\n const { $prevValue } = $this;\n\n $registered.$$triggerChange({\n $newValue: $state.$value,\n $prevValue\n });\n }\n }\n\n $this.$prevValue = $state.$value;\n }, [$this.$state.$value]);\n\n useLayoutEffect(() => {\n $this.isMounting = true;\n\n warning(\n !$name || $formContext.$formutil,\n `You should enusre that the useField() with the name '${$name}' must be used underneath a component or withForm() HOC, otherwise it's isolated.`\n );\n\n warning($name, `You should pass a name argument to useField(), otherwise it will be isolated!`);\n\n return () => {\n $this.isMounting = false;\n\n createRef(props.$ref, null);\n };\n }, []);\n\n useLayoutEffect(() => {\n if ($formContext.$$register) {\n $formContext.$$register($name, $this.$fieldHandler);\n }\n\n return () => {\n if ($formContext.$$unregister) {\n $formContext.$$unregister($name, $this.$fieldHandler, !$this.isMounting && props.$reserveOnUnmount);\n }\n };\n }, [$name]);\n\n // trigger ref callback\n useLayoutEffect(() => {\n createRef(props.$ref, $this.$fieldutil);\n });\n\n useLayoutEffect(() => {\n if (callbackRef.current.length > 0) {\n const callbackQueue = [...callbackRef.current];\n\n callbackRef.current.length = 0;\n\n while (callbackQueue.length) {\n callbackQueue.pop()($this.$fieldutil);\n }\n }\n });\n\n function $setState($newState, callback) {\n return new Promise(resolve => {\n const execute = () => resolve(runCallback(callback, $this.$fieldutil));\n\n if ($this.isMounting) {\n if ($name in ($formContext.$$registers || {})) {\n $formContext.$$onChange($name, $newState, execute);\n } else {\n setState($registered.$$merge($newState));\n\n $registered.$$detectChange($newState);\n\n callbackRef.current.push(execute);\n }\n } else {\n $registered.$$merge($newState);\n execute();\n }\n });\n }\n\n return ($this.$fieldutil = {\n $name,\n ...$registered.$getState(),\n ...$registered,\n $$formutil: $formContext.$formutil\n });\n}\n\nexport default useField;\n","import useFormContext from './useFormContext';\n\nfunction useForm() {\n const { $formutil } = useFormContext();\n\n return $formutil;\n}\n\nexport default useForm;\n","import { createHandler, parseProps, defaultProps } from '../EasyField/easyFieldHandler';\nimport useField from './useField';\n\nfunction useHandler(props) {\n props = { ...defaultProps, ...props, children: null };\n\n const { fieldProps, childProps } = parseProps(props);\n const $fieldutil = useField(fieldProps);\n\n return createHandler($fieldutil, fieldProps, childProps);\n}\n\nexport default useHandler;\n"],"names":["createContext","OBJECT_PROTO","Object","getPrototypeOf","PATH_REGEXP","Root","isUndefined","window","global","arg","isFunction","isEmpty","isPromise","promise","then","isObject","obj","prototype","toString","call","isPlainObj","constructor","deepClone","Array","isArray","newObj","i","j","length","runCallback","callback","args","createHOC","withHOC","WrappedComponent","VALID_PROPS","isValidProp","prop","indexOf","toLowerCase","executeWord","word","exec","Function","err","parsePath","target","path","value","warning","JSON","stringify","pathSymbols","match","map","s","replace","pathWords","split","trim","filter","item","scope","index","len","nextWord","symbol","nextVarWord","error","createRef","ref","current","arrayFind","array","process","objectMap","handler","keys","reduce","key","objectEach","forEach","toObject","arr","TODO_DELETE","undefined","CLEAR","pkey","pobj","every","objectClear","name","FORM_VALIDATE_RESULT","requestFrame","cancelFrame","requestAnimationFrame","cancelAnimationFrame","setTimeout","clearTimeout","Form","props","$$formPending","$$formValidatePromise","$$registers","$$deepRegisters","$$regDuplications","$$duplicateTimer","$$checkDuplication","hasDup","utils","$curRegistered","$handler","$$reserved","$$reset","$getState","$render","$$register","prevName","$$unregister","$$getRegister","$$fieldChangedQueue","push","$newValue","$value","$$defaultValues","$name","createDeepRegisters","$prevValue","$$defaultInitialize","$defaultValues","$defaultStates","$$deepParseObject","$$defaultStates","$$getDefault","$$triggerChangeTimer","$$triggerFormChange","$newValues","$prevValues","hasFormChanged","$$triggerChange","$validator","$$formValidate","$onFormChange","$formutil","field","Promise","resolve","$breakAsyncHandler","$shouldCancelPrevAsyncValidate","prevCallback","validation","result","$params","formtutil","execCallback","setCallback","reason","$$setFormErrors","validResults","Error","$$setStates","$error","$getField","$new","$$onChange","$state","$setStates","$stateTree","processer","force","$parsedTree","hasStateChange","data","$newState","$weakParams","$$merge","$$detectChange","findItem","forceUpdate","$validates","pop","flatter","names","$validate","$onValidates","filedValidatePromises","$onValidate","all","$reset","$setValues","$valueTree","$setFocuses","$focusedTree","$focused","$setDirts","$dirtyTree","$dirty","$setTouches","$touchedTree","$touched","$setPendings","$pendingTree","$pending","$setErrors","$errorTree","$batchState","$batchDirty","$batchTouched","$batchFocused","$batchPending","$batchError","mayWeakObj","deepObj","$ref","prevProps","children","render","component","createElement","Children","child","type","cloneElement","$processer","$stateArray","$pureParams","$invalid","some","$states","$errors","$dirts","$touches","$focuses","$pendings","$weakStates","$weakErrors","$weakDirts","$weakTouches","$weakFocuses","$weakPendings","$getFirstError","$fieldutil","$fieldError","message","$valid","$pristine","$untouched","React","getFormContext","_render","Component","displayName","propTypes","PropTypes","func","pt","oneOfType","node","isRequired","object","shape","any","defaultProps","withForm","config","FormEnhanced","others","formProps","hoistStatics","FIELD_UUID","$baseState","isError","warningValidatorReturn","string","$defaultValue","$defaultState","$onFieldChange","$validators","$asyncValidators","$validateLazy","bool","$reserveOnUnmount","$parser","$formatter","GET_FIELD_UUID","renderField","createHandler","$this","owner","$fieldHandler","$$FIELD_UUID","$picker","$getComponent","$setState","$setValue","$setTouched","$setDirty","$setFocused","$setValidity","$setError","$setPending","$$validatePromise","$formContext","$initialState","$initialValue","$newError","$validError","$skipRestValidate","$validatePromises","promises","catch","$viewValue","$setViewValue","$setModelValue","Field","execute","isMounting","$registered","$$formutil","shouldInitial","context","withField","FieldEnhanced","fieldProps","concat","EasyFieldNative","htmlValue","onChange","onFocus","onBlur","checked","unchecked","htmlType","htmlProps","compositionValue","onCompositionEnd","ev","composition","onCompositionStart","Element","multiple","slice","options","option","selected","unchekced","Provider","Consumer","EasyFieldGroup","className","groupNode","GroupOptionProps","GroupOption","EasyFieldGroupOption","DeprecatedEasyFieldGroupOption","childNodes","getGroupContext","element","$groupHander","elemProps","Wrapper","Frament","EasyFieldList","id","latestValue","FieldValidators","required","isEqual","list","swap","m","n","items","insert","values","getId","splice","remove","updater","setState","state","formKey","$baseutil","$length","$insert","$remove","$swap","$push","$pop","$shift","$unshift","$innerFormutil","$index","$isLast","$isFirst","TYPE","defaultValidators","check","__TYPE__","limit","regexp","test","enumeration","checker","validKey","validate","validator","propValue","validMessage","arguments","defaultValue","valuePropName","changePropName","focusPropName","blurPropName","passUtil","childProps","fetchValueFromEvent","$handleProps","newValue","parseProps","renderProps","isNative","groupType","Group","List","Native","EasyField","connect","Connect","useFormContext","useState","useContext","FormContext","useField","useLayoutEffect","useRef","callbackRef","callbackQueue","useForm","useHandler"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAAeA,mBAAa,CAAC,EAAD,CAA5B;;ACAA,IAAMC,YAAY,GAAGC,MAAM,CAACC,cAAP,CAAsB,EAAtB,CAArB;AACA,IAAMC,WAAW,GAAG,qCAApB;AACA,IAAMC,IAAI,GAAGC,WAAW,CAACC,MAAD,CAAX,GAAsBC,MAAtB,GAA+BD,MAA5C;AAEA,AAAO,SAASD,WAAT,CAAqBG,GAArB,EAA0B;SACtB,OAAOA,GAAP,KAAe,WAAtB;;AAGJ,AAAO,SAASC,UA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SADJ,MAEO;UACHgE,QAAQ,CAAC9D,WAAW,CAAC9I,OAAZ,CAAoBF,SAApB,CAAD,CAAR;UAEAgJ,WAAW,CAAC7I,cAAZ,CAA2BH,SAA3B;UAEAwQ,WAAW,CAAC9W,OAAZ,CAAoBkD,IAApB,CAAyBkM,OAAzB;;OARR,MAUO;QACHE,WAAW,CAAC9I,OAAZ,CAAoBF,SAApB;QACA8I,OAAO;;KAfR,CAAP;;;SAoBI5B,KAAK,CAAC9C,UAAN;IACJpH,KAAK,EAALA;KACGgM,WAAW,CAAC3M,SAAZ,EAFC,EAGD2M,WAHC;IAIJC,UAAU,EAAEhB,YAAY,CAAC/J;IAJ7B;;;ACjJJ,SAASwS,OAAT,GAAmB;wBACOT,cAAc,EADrB;MACP/R,SADO,mBACPA,SADO;;SAGRA,SAAP;;;ACFJ,SAASyS,UAAT,CAAoBpV,KAApB,EAA2B;EACvBA,KAAK,qBAAQkK,YAAR,EAAyBlK,KAAzB;IAAgCmH,QAAQ,EAAE;IAA/C;;oBAEmC6M,UAAU,CAAChU,KAAD,CAHtB;MAGf+N,UAHe,eAGfA,UAHe;MAGH6F,UAHG,eAGHA,UAHG;;MAIjB/K,UAAU,GAAGiM,QAAQ,CAAC/G,UAAD,CAA3B;SAEOrC,eAAa,CAAC7C,UAAD,EAAakF,UAAb,EAAyB6F,UAAzB,CAApB;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/react-formutil.cjs.production.js b/dist/react-formutil.cjs.production.js index e59ac5e..99919c4 100644 --- a/dist/react-formutil.cjs.production.js +++ b/dist/react-formutil.cjs.production.js @@ -1 +1 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:true});function e(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var t=require("react");var r=e(t);var n=e(require("create-react-context"));var i=e(require("warning"));var a=e(require("hoist-non-react-statics"));var u=e(require("react-fast-compare"));function o(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function s(e,t){for(var r=0;r=0)continue;r[i]=e[i]}return r}function h(e,t){if(e==null)return{};var r=p(e,t);var n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function m(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function g(e,t){if(t&&(typeof t==="object"||typeof t==="function")){return t}return m(e)}function y(e,t){return w(e)||F(e,t)||P()}function b(e){return V(e)||C(e)||k()}function V(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t1?r-1:0),i=1;i-1}var L=function e(t){try{var r=new Function("origin","global","return typeof ".concat(t," === 'number' || (typeof ").concat(t," !== 'undefined' && !(origin in global)) ? ").concat(t," : origin"));return r(t,j)}catch(e){return t}};function q(){for(var e=arguments.length,t=new Array(e),r=0;r=0?[]:{}:l[p];break;default:l[p]=u;break}}}}catch(e){i(false,"The name '%s' of Field seems is not a legal expression.",a)}if(t.length>2){return n}}function B(e,t){if(e){if(D(e)){e(t)}else if("current"in e){e.current=t}}}var Y=function e(t,r){for(var n=0,i=t.length;n2&&arguments[2]!==undefined?arguments[2]:{};return t.reduce(function(){r.apply(void 0,arguments);return arguments.length<=0?undefined:arguments[0]},n)};var K=undefined;function W(e,t,r){G(e,function(t,r){if(t===K){delete e[r]}else if(t&&typeof t==="object"){W(t,r,e)}});if(r&&Object.keys(e).every(function(t){return e[t]===K})){r[t]=K;W(r)}}var J=function e(t,r){if(!x(q(t,r))){q(t,r,K);W(t)}};var X="FORM_VALIDATE_RESULT";var Z,ee;if(typeof requestAnimationFrame==="function"){Z=requestAnimationFrame;ee=cancelAnimationFrame}else{Z=setTimeout;ee=clearTimeout}var te=function(e){c(n,e);function n(e){var t;o(this,n);t=g(this,d(n).call(this,e));t.$$formPending=void 0;t.$$formValidatePromise=void 0;t.$$registers={};t.$$deepRegisters={};t.$$regDuplications={};t.$$duplicateTimer=void 0;t.$$checkDuplication=function(){var e=m(t),r=e.$$regDuplications;var n;G(r,function(e,t){var a=y(e,2),u=a[0],o=a[1];i(u.$$reserved,"The Field with a name '".concat(t,"' has been registered!"));o.$$reset(u.$getState());n=delete r[t]});if(n){t.$render()}};t.$$register=function(e,r,n){t.$$unregister(n,r);if(e){var i=t.$$getRegister(e);if(i){ee(t.$$duplicateTimer);t.$$regDuplications[e]=[i,r];t.$$duplicateTimer=Z(t.$$checkDuplication)}else{t.$$fieldChangedQueue.push({name:e,$newValue:r.$getState().$value});J(t.$$defaultValues,e)}t.$$registers[r.$name=e]=r;t.createDeepRegisters();t.$render()}};t.$$unregister=function(e,r,n){if(e){if(e in t.$$regDuplications){var i=y(t.$$regDuplications[e],2),a=i[0],u=i[1];t.$$fieldChangedQueue.push({name:e,$newValue:u.$getState().$value,$prevValue:a.$getState().$value});delete t.$$regDuplications[e]}else if(t.$$registers[e]===r){if(n){r.$$reserved=true}else{delete t.$$registers[e];t.$$fieldChangedQueue.push({name:e,$prevValue:r.$getState().$value});J(t.$$defaultValues,e)}}t.createDeepRegisters();t.$render()}};t.$$defaultInitialize=function(){var e=t.props,r=e.$defaultValues,n=e.$defaultStates;t.$$defaultValues=t.$$deepParseObject(R(D(r)?r(t.props)||{}:r));t.$$defaultStates=t.$$deepParseObject(R(D(n)?n(t.props)||{}:n))};t.$$getDefault=function(){return{$$defaultStates:t.$$defaultStates,$$defaultValues:t.$$defaultValues}};t.$$triggerChangeTimer=void 0;t.$$fieldChangedQueue=[];t.$$triggerFormChange=function(){if(t.$$fieldChangedQueue.length){var e=b(t.$$fieldChangedQueue);t.$$fieldChangedQueue.length=0;var r={};var n={};var i=t.$$registers;var a=false;e.forEach(function(e){if(!(e.name in i)){delete e.$newValue}if(e.$newValue!==e.$prevValue){if("$newValue"in e&&"$prevValue"in e){var u=t.$$getRegister(e.name);if(u){u.$$triggerChange(e)}}"$newValue"in e&&q(r,e.name,e.$newValue);"$prevValue"in e&&q(n,e.name,e.$prevValue);a=true}});if(a){if(D(t.props.$validator)){t.$$formValidate()}if(D(t.props.$onFormChange)){t.props.$onFormChange(t.$formutil,r,n)}}}};t.createDeepRegisters=function(){return t.$$deepRegisters=t.$$deepParseObject(t.$$registers)};t.$$getRegister=function(e){if(e){var r=t.$$registers[e]||q(t.$$deepRegisters,e);if(r){return r}}};t.$$formValidate=function(e){return t.$$formValidatePromise=new Promise(function(r){var n=t.props.$validator;var i;var a;var u;var o;var s=n(t.$formutil.$params,t.formtutil);var l=function t(n){return r(U(e,U(u,n)))};if(N(s)){if(!t.$$formPending){t.$$formPending=true;t.$render()}a=function e(t){return i=t(l)};o=s.then(function(){return void 0},function(e){return e}).then(function(e){if(i){return i}t.$shouldCancelPrevAsyncValidate=null;t.$$formPending=false;return t.$$setFormErrors(e,l)})}else{if(t.$$formPending){t.$$formPending=false}o=t.$$setFormErrors(s,l)}if(t.$shouldCancelPrevAsyncValidate){t.$shouldCancelPrevAsyncValidate(function(e){u=e;return o})}t.$shouldCancelPrevAsyncValidate=a})};t.$$setFormErrors=function(e,r){if(e&&(e instanceof Error||typeof e!=="object")){i(false,"The result of $validator in should always return None(null,undefined) or an object contains error message of Field.");return t.$render(r)}return t.$$setStates(e||{},function(e,t){var r=t.$getState(),n=r.$error,i=n===void 0?{}:n;if(e){return{$error:f({},i,$({},X,e))}}if(i[X]){delete i[X];return{$error:i}}return},r,true)};t.$getField=function(e){var r=t.$$getRegister(e);i(!e||r,"$getField('".concat(e,"') fail to find the matched Field. Maybe it has been unmounted."));i(e,"You should pass a name of the mounted Field to $getField().");if(r){return r.$new()}};t.$$onChange=function(e,r,n){return t.$setStates($({},e,r),n)};t.$$setStates=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=arguments.length>1?arguments[1]:undefined;var n=arguments.length>2?arguments[2]:undefined;var i=arguments.length>3?arguments[3]:undefined;var a=t.$$deepParseObject(e);var u=false;G(t.$$registers,function(n,o){var s=o in e?e[o]:q(a,o);if(!x(s)||i){var l=r(s,n);if(l){var $=t.$formutil.$weakParams[o];var f=n.$$merge(l),c=f.$value;n.$$detectChange(l);if("$value"in l||"$viewValue"in l){var d=Y(t.$$fieldChangedQueue,function(e){return e.name===o});if(d){if(!("$prevValue"in d)){d.$prevValue=d.$newValue}d.$newValue=c}else{t.$$fieldChangedQueue.push({name:o,$newValue:c,$prevValue:$})}}u=true}}});if(u){return t.$render(n)}return Promise.resolve(U(n,t.$formutil))};t.$render=function(e){return new Promise(function(r){return t.forceUpdate(function(){return r(U(e,t.$formutil))})})};t.$validates=function(){var e;for(var r=arguments.length,n=new Array(r),i=0;i1&&arguments[1]!==undefined?arguments[1]:{};G(t,function(e,t){return q(r,t,e)});return r}},{key:"componentDidMount",value:function e(){B(this.props.$ref,this.$formutil)}},{key:"componentDidUpdate",value:function e(t){var r=this;B(this.props.$ref,this.$formutil);ee(this.$$triggerChangeTimer);this.$$triggerChangeTimer=Z(function(){r.$$triggerFormChange()})}},{key:"componentWillUnmount",value:function e(){B(this.props.$ref,null)}},{key:"_render",value:function e(){var r=this.$formutil;var n=this.props,i=n.children,a=n.render,u=n.component;if(u){return t.createElement(u,{$formutil:r})}if(D(a)){return a(r)}if(D(i)){return i(r)}return t.Children.map(i,function(e){return e&&D(e.type)?t.cloneElement(e,{$formutil:r}):e})}},{key:"render",value:function e(){var t=this;var n=this.props.$processer;var i=Object.keys(this.$$registers).map(function(e){return{path:e,$state:t.$$registers[e].$getState()}});var a=z(i,function(e,t){var r=t.path,i=t.$state;if(n){n(i,r)}if("$value"in i&&(i.$dirty||!x(i.$value))){e[r]=i.$value}});var u=z(i,function(e,t){var r=t.path,n=t.$state;return r in a&&q(e,r,a[r])});var o=i.some(function(e){var t=e.$state;return t.$invalid});var s=i.some(function(e){var t=e.$state;return t.$dirty});var l=i.some(function(e){var t=e.$state;return t.$touched});var $=i.some(function(e){var t=e.$state;return t.$focused});var c=this.$$formPending||i.some(function(e){var t=e.$state;return t.$pending});var d=this.$formutil={$$registers:f({},this.$$registers),$$deepRegisters:this.$$deepRegisters,$states:z(i,function(e,t){var r=t.path,n=t.$state;return q(e,r,n)}),$params:f({},this.$$defaultValues,u),$errors:z(i,function(e,t){var r=t.path,n=t.$state;if(n.$invalid){q(e,r,n.$error)}}),$dirts:z(i,function(e,t){var r=t.path,n=t.$state;return q(e,r,n.$dirty)}),$touches:z(i,function(e,t){var r=t.path,n=t.$state;return q(e,r,n.$touched)}),$focuses:z(i,function(e,t){var r=t.path,n=t.$state;return q(e,r,n.$focused)}),$pendings:z(i,function(e,t){var r=t.path,n=t.$state;return q(e,r,n.$pending)}),$weakStates:z(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n}),$weakParams:a,$weakErrors:z(i,function(e,t){var r=t.path,n=t.$state;if(n.$invalid){e[r]=n.$error}}),$weakDirts:z(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$dirty}),$weakTouches:z(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$touched}),$weakFocuses:z(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$focused}),$weakPendings:z(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$pending}),$getFirstError:function e(t){if(t){var r=d.$getField(t);return r&&r.$getFirstError()}for(var n in d.$weakErrors){var i=d.$weakErrors[n];for(var a in i){return i[a]instanceof Error?i[a].message:i[a]}}},$render:this.$render,$getField:this.$getField,$onValidates:this.$onValidates,$new:function e(){return t.$formutil},$setStates:this.$setStates,$setValues:this.$setValues,$setErrors:this.$setErrors,$setTouches:this.$setTouches,$setDirts:this.$setDirts,$setFocuses:this.$setFocuses,$batchState:this.$batchState,$batchTouched:this.$batchTouched,$batchDirty:this.$batchDirty,$batchFocused:this.$batchFocused,$reset:this.$reset,$validates:this.$validates,$validate:this.$validate,$valid:!o,$invalid:o,$dirty:s,$pristine:!s,$touched:l,$untouched:!l,$focused:$,$pending:c};return r.createElement(E.Provider,{value:this.getFormContext()},this._render())}}]);return n}(t.Component);te.displayName="React.Formutil.Form";te.defaultProps={$defaultValues:{},$defaultStates:{}};function re(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=function(t){c(i,t);function i(){o(this,i);return g(this,d(i).apply(this,arguments))}l(i,[{key:"render",value:function t(){var i=Object.assign({},this.props);var a=this.props,u=a.component,o=h(a,["component"]);["$defaultStates","$defaultValues","$onFormChange","$validator","$processer","$ref"].forEach(function(e){if(e in i){if(e==="$defaultStates"||e==="$defaultValues"){o[e]=f({},n[e],i[e])}delete i[e]}});return r.createElement(te,Object.assign({},n,o,{render:function t(n){return r.createElement(e,Object.assign({},i,{$formutil:n}))}}))}}]);return i}(t.Component);i.displayName="React.Formutil.withForm."+(e.displayName||e.name||"Anonymous");return a(i,e)}var ne=I(re);var ie=0;var ae={$valid:true,$invalid:false,$dirty:false,$pristine:true,$touched:false,$untouched:true,$focused:false,$pending:false,$error:{}};function ue(e){return e!==true}function oe(e,t,r){i(!x(e),"You should return a string or Error when the validation('".concat(r&&r+": ").concat(t,"') failed, otherwise return true."))}var se="React.Formutil.Field";function le(){return ie++}function $e(e,r){var n=r.children,i=r.render,a=r.component;if(a){return t.createElement(a,{$fieldutil:e})}if(D(i)){return i(e)}if(D(n)){return n(e)}return t.Children.map(n,function(r){return r&&D(r.type)?t.cloneElement(r,{$fieldutil:e}):r})}function fe(e,t){var r={$$FIELD_UUID:e.$$FIELD_UUID,$$reset:o,$$merge:b,$$detectChange:i,$$triggerChange:a,$onValidate:u,$new:function t(){return e.$fieldutil},$picker:s,$getState:s,$getComponent:function e(){return t},$reset:function t(r,n){return e.$setState(o(r),n)},$getFirstError:y,$validate:l,$setState:e.$setState,$render:$,$setValue:c,$setTouched:d,$setDirty:v,$setFocused:p,$setValidity:m,$setError:h,$setPending:g};var n;function i(e){if("$value"in e||"$viewValue"in e){l()}}function a(t){var r=t.$newValue,n=t.$prevValue;var i=e.props.$onFieldChange;if(D(i)){i(r,n,e.$formContext.$formutil)}}function u(e){n.then(e);return n}function o(t){var r;var n=e.props,i=e.$formContext;if(i.$$getDefault){var a=n.name;var u=i.$$getDefault(),o=u.$$defaultStates,s=u.$$defaultValues;if(a&&s){var l=q(s,a);r=q(o,a)||{};if(!x(l)){r.$value=l}}}var $=n.$defaultValue,c=n.$defaultState;return b(f({},ae,D(c)?c(n):c,{$value:D($)?$(n):"$defaultValue"in n?$:""},r,t))}function s(){return f({},e.$state)}function l(t){return n=new Promise(function(r){var n=e.props,i=e.$formContext;var a=f({},n.$validators,n.$asyncValidators);var u=e.$state,o=u.$value,s=u.$pending,l=Object.assign({},u.$error);var $=i.$formutil;var c={};var d=false;var v;var p;var y;var b;delete l[X];var V=Object.keys(a).reduce(function(t,r){delete l[r];if(!d&&n[r]!=null){var i=a[r](o,n[r],f({},n,{$formutil:$,$fieldutil:e.$fieldutil,$validError:c}));if(N(i)){t.push(i.catch(function(e){if(!v){m(r,e||r)}}))}else if(ue(i)){c[r]=i||r;oe(i,r,n.name);if(n.$validateLazy){d=true}}}return t},[]);var w=function e(n){return r(U(t,U(y,n)))};if(V.length){if(!s){g(true)}p=function e(t){return v=t(w)};V.push(h(f({},l,c)));b=Promise.all(V).then(function(){if(v){return v}e.$shouldCancelPrevAsyncValidate=null;return g(false,w)})}else{if(s){g(false)}b=h(f({},l,c),w)}if(e.$shouldCancelPrevAsyncValidate){e.$shouldCancelPrevAsyncValidate(function(e){y=e;return b})}e.$shouldCancelPrevAsyncValidate=p})}function $(t,r){return e.$setState({$viewValue:t,$dirty:true},r)}function c(t,r){return e.$setState({$value:t},r)}function d(t,r){return e.$setState({$touched:t},r)}function v(t,r){return e.$setState({$dirty:t},r)}function p(t,r){return e.$setState({$focused:t},r)}function h(t,r){return e.$setState({$error:t},r)}function m(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var n=arguments.length>2?arguments[2]:undefined;var i=Object.assign({},e.$state.$error);if(ue(r)){i[t]=r||t;oe(r,t,e.props.name)}else{delete i[t]}return h(i,n)}function g(t,r){return e.$setState({$pending:t},r)}function y(){var t=e.$state.$error,r=t===void 0?{}:t;for(var n in r){return r[n]instanceof Error?r[n].message:r[n]}}function b(t){var r=Object.assign({},t);if("$error"in r){if(!r.$error){r.$error={}}r.$valid=Object.keys(r.$error).length===0}var n=e.props,i=n.$parser,a=n.$formatter;if("$viewValue"in r&&!("$value"in r)){var u=function e(t){return r.$viewValue=t};r.$value=i?i(r.$viewValue,u):r.$viewValue}else if("$value"in r&&!("$viewValue"in r)){var o=function e(t){return r.$value=t};r.$viewValue=a?a(r.$value,o):r.$value}if("$valid"in r){r.$invalid=!r.$valid}else if("$invalid"in r){r.$dirty=!r.$invalid}if("$dirty"in r){r.$pristine=!r.$dirty}else if("$pristine"in r){r.$dirty=!r.$pristine}if("$touched"in r){r.$untouched=!r.$touched}else if("$untouched"in r){r.$touched=!r.$untouched}e.$state=f({},e.$state,r);return s()}return r}var ce=function(e){c(t,e);function t(){var e;var r;o(this,t);for(var n=arguments.length,i=new Array(n),a=0;a with the name '".concat(t,"' must be used underneath a component or withForm() HOC, otherwise it's isolated."));i(t,"You should assign a name to , otherwise it will be isolated!");if(r.$$register){r.$$register(t,this.$fieldHandler)}this.$prevValue=this.$state.$value;B(this.props.$ref,this.$fieldutil)}},{key:"componentWillUnmount",value:function e(){if(this.$formContext.$$unregister){this.$formContext.$$unregister(this.props.name,this.$fieldHandler,this.props.$reserveOnUnmount)}this.isMounting=false;B(this.props.$ref,null)}},{key:"componentDidUpdate",value:function e(t){var r=this.props.name;if(r!==t.name){if(this.$formContext.$$register){this.$formContext.$$register(r,this.$fieldHandler,t.name)}}B(this.props.$ref,this.$fieldutil);if(this.$state.$value!==this.$prevValue){if(!(r in(this.$formContext.$$registers||{}))){this.$registered.$$triggerChange({$newValue:this.$state.$value,$prevValue:this.$prevValue})}this.$prevValue=this.$state.$value}}},{key:"_render",value:function e(){var t=this.$fieldutil=f({$name:this.props.name},this.$registered.$getState(),this.$registered,{$$formutil:this.$formContext.$formutil});return $e(t,this.props)}},{key:"render",value:function e(){var t=this;var n=!this.$formContext;return r.createElement(E.Consumer,null,function(e){t.$formContext=e;if(!t.$fieldHandler){t.$fieldHandler=fe(t,t)}t.$registered=(e.$$registers||{})[t.$fieldHandler.$name]||t.$fieldHandler;if(n){t.$fieldHandler.$$reset();t.$fieldHandler.$validate()}return t._render()})}}]);return t}(t.Component);ce.displayName=se;function de(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=function(t){c(i,t);function i(){o(this,i);return g(this,d(i).apply(this,arguments))}l(i,[{key:"render",value:function t(){var i=Object.assign({},this.props);var a=this.props,u=a.component,o=h(a,["component"]);["$validators","$asyncValidators","$validateLazy","$reserveOnUnmount","$defaultValue","$defaultState","$onFieldChange","$parser","$formatter","$ref","name"].concat(Object.keys(f({},n.$validators,n.$asyncValidators,i.$validators,i.$asyncValidators))).forEach(function(e){if(e in i){if(e==="$validators"||e==="$asyncValidators"||e==="$defaultState"){o[e]=f({},n[e],i[e])}delete i[e]}});return r.createElement(ce,Object.assign({},n,o,{render:function t(n){return r.createElement(e,Object.assign({},i,{$fieldutil:n}))}}))}}]);return i}(t.Component);i.displayName="React.Formutil.withField."+(e.displayName||e.name||"Anonymous");return a(i,e)}var ve=I(de);var pe=function(e){c(t,e);function t(){o(this,t);return g(this,d(t).apply(this,arguments))}l(t,[{key:"render",value:function e(){var t=this;var n=this.props,i=n.$fieldutil,a=n.value,u=n.onChange,o=n.onFocus,s=n.onBlur,l=n.checked,$=n.unchecked,f=h(n,["$fieldutil","value","onChange","onFocus","onBlur","checked","unchecked"]);var c=this.props.type;var d={value:"compositionValue"in this?this.compositionValue:a,onCompositionEnd:function e(r){t.composition=false;delete t.compositionValue;d.onChange(r)},onCompositionStart:function e(){return t.composition=true},onChange:function e(r){var n=r.target.value;if(t.composition){t.compositionValue=n;t.forceUpdate()}else{u(n,r)}},onFocus:o,onBlur:s};var v="input";switch(c){case"select":v=c;d.onChange=function(e){var t=e.target;var r=t.multiple?[].slice.call(t.options).filter(function(e){return e.selected}).map(function(e){return e.value}):t.value;u(r,e)};delete f.type;break;case"textarea":v=c;delete f.type;break;case"checkbox":case"radio":d={checked:a===l,onChange:function e(t){u(t.target.checked?l:$,t)},onFocus:o,onBlur:s};break;default:break}return r.createElement(v,Object.assign({},f,d))}}]);return t}(t.Component);pe.displayName="React.Formutil.EasyField.Native";pe.defaultProps={value:"",type:"text",checked:true,unchecked:false};var he=n({}),me=he.Provider,ge=he.Consumer;var ye=function(e){c(n,e);function n(){o(this,n);return g(this,d(n).apply(this,arguments))}l(n,[{key:"getGroupContext",value:function e(){return this.props}},{key:"_render",value:function e(){var n=this.props,i=n.className,a=n.groupNode,u=n.children;var o={GroupOption:be,Field:Ve};var s=D(u)?u(o):t.Children.map(u,function(e){return t.cloneElement(e,o)});if(a===null){return s}return r.createElement(a,{className:i},s)}},{key:"render",value:function e(){return r.createElement(me,{value:this.getGroupContext()},this._render())}}]);return n}(t.Component);ye.displayName="React.Formutil.EasyField.Group";ye.defaultProps={type:"checkbox",groupNode:"div"};var be=function(e){c(t,e);function t(){o(this,t);return g(this,d(t).apply(this,arguments))}l(t,[{key:"componentDidMount",value:function e(){i("$value"in this.props,"You should pass a $value to .")}},{key:"render",value:function e(){var t=this.props,n=t.$value,i=t.onChange,a=t.onFocus,u=t.onBlur,o=h(t,["$value","onChange","onFocus","onBlur"]);return r.createElement(ge,null,function(e){var t=e.type,s=e.name;var l=t==="radio"?{checked:e.value===n,onChange:function t(r){e.onChange(n,r);i&&i(r)}}:t==="checkbox"?{checked:e.value.indexOf(n)>-1,onChange:function t(r){e.onChange(r.target.checked?e.value.concat(n):e.value.filter(function(e){return e!==n}),r);i&&i(r)}}:{value:e.value,onChange:function t(r){e.onChange(r);i&&i(r)}};return r.createElement("input",Object.assign({name:s},o,l,{type:t,onFocus:function t(r){e.onFocus(r);a&&a(r)},onBlur:function t(r){e.onBlur(r);u&&u(r)}}))})}}]);return t}(t.Component);be.displayName="React.Formutil.EasyField.Group.Option";var Ve=function(e){c(t,e);function t(){o(this,t);return g(this,d(t).apply(this,arguments))}l(t,[{key:"componentDidMount",value:function e(){i(false,'The "Field" property in EasyField\'s children-props has been deprecated. Please use "GroupOption" instead.')}},{key:"render",value:function e(){return r.createElement(be,this.props)}}]);return t}(t.Component);Ve.displayName="React.Formutil.EasyField.Group.Option.Deprecated";var we=r.Frament||"div";var Ce=function(e){c(t,e);function t(e){var r;o(this,t);r=g(this,d(t).call(this,e));r.id=0;r.latestValue=r.props.value;r.$formutil=void 0;r.FieldValidators={required:function e(t){return t!==null}};r.$onFormChange=function(e){e.$onValidates(function(e){var t=e.$invalid,n=e.$params;if(t){if(r.props.value.length){r.props.onChange(r.latestValue=[])}}else if(!u(r.props.value,n.list)){r.props.onChange(r.latestValue=n.list)}})};r.swap=function(e,t,n){return r.$setState(function(r){var n=r.items;var i=[n[e],n[t]];n[t]=i[0];n[e]=i[1];return n},n)};r.insert=function(){var e,t,n;for(var i=arguments.length,a=new Array(i),u=0;u=t}],["max",function(e,t){return _(e)||e*1<=t}],["min",function(e,t){return _(e)||e*1>=t}],["pattern",function(e,t){return _(e)||t.test(e)}],["enum",function(e,t){return _(e)||t.indexOf(e)>-1}],["checker",function(e,t,r){return t(e,r)}]].reduce(function(e,t){var r=y(t,2),n=r[0],i=r[1];e[n]=function e(t,r,a){var u=a.validMessage,o=u===void 0?{}:u;return i.apply(void 0,arguments)||o[n]||"Error input: ".concat(n)};return e},{});var Pe="React.Formutil.EasyField";var Ee={validMessage:{},valuePropName:"value",changePropName:"onChange",focusPropName:"onFocus",blurPropName:"onBlur",$parser:function e(t){return typeof t==="string"?t.trim():t}};function Oe(e,t,r){var n;var i=t.valuePropName,a=t.changePropName,u=t.focusPropName,o=t.blurPropName,s=t.passUtil;var l=function e(t){return t&&t.target?t.target[i]:t};var c=f({},r,(n={},$(n,i,e.$viewValue),$(n,a,function(){for(var r=arguments.length,n=new Array(r),i=0;i=16.8, Please upgrade your reactjs.")}var e=r.useContext;var t=e(E);return t}function Ne(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!r.useState){throw new Error("Hooks api need react@>=16.8, Please upgrade your reactjs.")}var n=r.useState,a=r.useLayoutEffect,u=r.useRef;var o;if(e){if(typeof e==="string"){o=e;t.name=o}else{t=e;o=t.name}}var s=_e();var l=u({}).current;var $=u([]);var c;l.$formContext=s;l.props=t;l.$setState=h;var d=n(function(){l.$$FIELD_UUID=le();l.$fieldHandler=c=fe(l);var e=l.$fieldHandler.$$reset();l.$fieldHandler.$validate();return e}),v=y(d,2),p=v[1];if(!c){c=(s.$$registers||{})[l.$fieldHandler.$name]||l.$fieldHandler}a(function(){var e=l.$state;if(l.isMounting){if(!(o in(s.$$registers||{}))){var t=l.$prevValue;c.$$triggerChange({$newValue:e.$value,$prevValue:t})}}l.$prevValue=e.$value},[l.$state.$value]);a(function(){l.isMounting=true;i(!o||s.$formutil,"You should enusre that the useField() with the name '".concat(o,"' must be used underneath a component or withForm() HOC, otherwise it's isolated."));i(o,"You should pass a name argument to useField(), otherwise it will be isolated!");return function(){l.isMounting=false;B(t.$ref,null)}},[]);a(function(){if(s.$$register){s.$$register(o,l.$fieldHandler)}return function(){if(s.$$unregister){s.$$unregister(o,l.$fieldHandler,!l.isMounting&&t.$reserveOnUnmount)}}},[o]);a(function(){B(t.$ref,l.$fieldutil)});a(function(){if($.current.length>0){var e=b($.current);$.current.length=0;while(e.length){e.pop()(l.$fieldutil)}}});function h(e,t){return new Promise(function(r){var n=function e(){return r(U(t,l.$fieldutil))};if(l.isMounting){if(o in(s.$$registers||{})){s.$$onChange(o,e,n)}else{p(c.$$merge(e));c.$$detectChange(e);$.current.push(n)}}else{c.$$merge(e);n()}})}return l.$fieldutil=f({$name:o},c.$getState(),c,{$$formutil:s.$formutil})}function Ae(){var e=_e(),t=e.$formutil;return t}function Te(e){e=f({},Ee,e,{children:null});var t=Se(e),r=t.fieldProps,n=t.childProps;var i=Ne(r);return Oe(i,r,n)}exports.EasyField=xe;exports.Field=ce;exports.Form=te;exports.connect=De;exports.useField=Ne;exports.useForm=Ae;exports.useHandler=Te;exports.withField=ve;exports.withForm=ne; +"use strict";Object.defineProperty(exports,"__esModule",{value:true});function e(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var t=require("react");var r=e(t);var n=e(require("warning"));var i=e(require("hoist-non-react-statics"));var a=e(require("react-fast-compare"));function u(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function o(e,t){for(var r=0;r=0)continue;r[i]=e[i]}return r}function p(e,t){if(e==null)return{};var r=v(e,t);var n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function h(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function m(e,t){if(t&&(typeof t==="object"||typeof t==="function")){return t}return h(e)}function g(e,t){return V(e)||w(e,t)||k()}function y(e){return b(e)||C(e)||F()}function b(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t1?r-1:0),i=1;i-1}var M=function e(t){try{var r=new Function("origin","global","return typeof ".concat(t," === 'number' || (typeof ").concat(t," !== 'undefined' && !(origin in global)) ? ").concat(t," : origin"));return r(t,S)}catch(e){return t}};function L(){for(var e=arguments.length,t=new Array(e),r=0;r=0?[]:{}:l[p];break;default:l[p]=u;break}}}}catch(e){n(false,"The name '%s' of Field seems is not a legal expression.",a)}if(t.length>2){return i}}function B(e,t){if(e){if(x(e)){e(t)}else if("current"in e){e.current=t}}}var Y=function e(t,r){for(var n=0,i=t.length;n2&&arguments[2]!==undefined?arguments[2]:{};return t.reduce(function(){r.apply(void 0,arguments);return arguments.length<=0?undefined:arguments[0]},n)};var z=undefined;function K(e,t,r){Q(e,function(t,r){if(t===z){delete e[r]}else if(t&&typeof t==="object"){K(t,r,e)}});if(r&&Object.keys(e).every(function(t){return e[t]===z})){r[t]=z;K(r)}}var W=function e(t,r){if(!j(L(t,r))){L(t,r,z);K(t)}};var J="FORM_VALIDATE_RESULT";var X,Z;if(typeof requestAnimationFrame==="function"){X=requestAnimationFrame;Z=cancelAnimationFrame}else{X=setTimeout;Z=clearTimeout}var ee=function(e){f(i,e);function i(e){var t;u(this,i);t=m(this,c(i).call(this,e));t.$$formPending=void 0;t.$$formValidatePromise=void 0;t.$$registers={};t.$$deepRegisters={};t.$$regDuplications={};t.$$duplicateTimer=void 0;t.$$checkDuplication=function(){var e=h(t),r=e.$$regDuplications;var i;Q(r,function(e,t){var a=g(e,2),u=a[0],o=a[1];n(u.$$reserved,"The Field with a name '".concat(t,"' has been registered!"));o.$$reset(u.$getState());i=delete r[t]});if(i){t.$render()}};t.$$register=function(e,r,n){t.$$unregister(n,r);if(e){var i=t.$$getRegister(e);if(i){Z(t.$$duplicateTimer);t.$$regDuplications[e]=[i,r];t.$$duplicateTimer=X(t.$$checkDuplication)}else{t.$$fieldChangedQueue.push({name:e,$newValue:r.$getState().$value});W(t.$$defaultValues,e)}t.$$registers[r.$name=e]=r;t.createDeepRegisters();t.$render()}};t.$$unregister=function(e,r,n){if(e){if(e in t.$$regDuplications){var i=g(t.$$regDuplications[e],2),a=i[0],u=i[1];t.$$fieldChangedQueue.push({name:e,$newValue:u.$getState().$value,$prevValue:a.$getState().$value});delete t.$$regDuplications[e]}else if(t.$$registers[e]===r){if(n){r.$$reserved=true}else{delete t.$$registers[e];t.$$fieldChangedQueue.push({name:e,$prevValue:r.$getState().$value});W(t.$$defaultValues,e)}}t.createDeepRegisters();t.$render()}};t.$$defaultInitialize=function(){var e=t.props,r=e.$defaultValues,n=e.$defaultStates;t.$$defaultValues=t.$$deepParseObject(T(x(r)?r(t.props)||{}:r));t.$$defaultStates=t.$$deepParseObject(T(x(n)?n(t.props)||{}:n))};t.$$getDefault=function(){return{$$defaultStates:t.$$defaultStates,$$defaultValues:t.$$defaultValues}};t.$$triggerChangeTimer=void 0;t.$$fieldChangedQueue=[];t.$$triggerFormChange=function(){if(t.$$fieldChangedQueue.length){var e=y(t.$$fieldChangedQueue);t.$$fieldChangedQueue.length=0;var r={};var n={};var i=t.$$registers;var a=false;e.forEach(function(e){if(!(e.name in i)){delete e.$newValue}if(e.$newValue!==e.$prevValue){if("$newValue"in e&&"$prevValue"in e){var u=t.$$getRegister(e.name);if(u){u.$$triggerChange(e)}}"$newValue"in e&&L(r,e.name,e.$newValue);"$prevValue"in e&&L(n,e.name,e.$prevValue);a=true}});if(a){if(x(t.props.$validator)){t.$$formValidate()}if(x(t.props.$onFormChange)){t.props.$onFormChange(t.$formutil,r,n)}}}};t.createDeepRegisters=function(){return t.$$deepRegisters=t.$$deepParseObject(t.$$registers)};t.$$getRegister=function(e){if(e){var r=t.$$registers[e]||L(t.$$deepRegisters,e);if(r){return r}}};t.$$formValidate=function(e){return t.$$formValidatePromise=new Promise(function(r){var n=t.props.$validator;var i;var a;var u;var o;var s=n(t.$formutil.$params,t.formtutil);var l=function t(n){return r(R(e,R(u,n)))};if(_(s)){if(!t.$$formPending){t.$$formPending=true;t.$render()}a=function e(t){return i=t(l)};o=s.then(function(){return void 0},function(e){return e}).then(function(e){if(i){return i}t.$shouldCancelPrevAsyncValidate=null;t.$$formPending=false;return t.$$setFormErrors(e,l)})}else{if(t.$$formPending){t.$$formPending=false}o=t.$$setFormErrors(s,l)}if(t.$shouldCancelPrevAsyncValidate){t.$shouldCancelPrevAsyncValidate(function(e){u=e;return o})}t.$shouldCancelPrevAsyncValidate=a})};t.$$setFormErrors=function(e,r){if(e&&(e instanceof Error||typeof e!=="object")){n(false,"The result of $validator in should always return None(null,undefined) or an object contains error message of Field.");return t.$render(r)}return t.$$setStates(e||{},function(e,t){var r=t.$getState(),n=r.$error,i=n===void 0?{}:n;if(e){return{$error:$({},i,l({},J,e))}}if(i[J]){delete i[J];return{$error:i}}return},r,true)};t.$getField=function(e){var r=t.$$getRegister(e);n(!e||r,"$getField('".concat(e,"') fail to find the matched Field. Maybe it has been unmounted."));n(e,"You should pass a name of the mounted Field to $getField().");if(r){return r.$new()}};t.$$onChange=function(e,r,n){return t.$setStates(l({},e,r),n)};t.$$setStates=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=arguments.length>1?arguments[1]:undefined;var n=arguments.length>2?arguments[2]:undefined;var i=arguments.length>3?arguments[3]:undefined;var a=t.$$deepParseObject(e);var u=false;Q(t.$$registers,function(n,o){var s=o in e?e[o]:L(a,o);if(!j(s)||i){var l=r(s,n);if(l){var $=t.$formutil.$weakParams[o];var f=n.$$merge(l),c=f.$value;n.$$detectChange(l);if("$value"in l||"$viewValue"in l){var d=Y(t.$$fieldChangedQueue,function(e){return e.name===o});if(d){if(!("$prevValue"in d)){d.$prevValue=d.$newValue}d.$newValue=c}else{t.$$fieldChangedQueue.push({name:o,$newValue:c,$prevValue:$})}}u=true}}});if(u){return t.$render(n)}return Promise.resolve(R(n,t.$formutil))};t.$render=function(e){return new Promise(function(r){return t.forceUpdate(function(){return r(R(e,t.$formutil))})})};t.$validates=function(){var e;for(var r=arguments.length,n=new Array(r),i=0;i1&&arguments[1]!==undefined?arguments[1]:{};Q(t,function(e,t){return L(r,t,e)});return r}},{key:"componentDidMount",value:function e(){B(this.props.$ref,this.$formutil)}},{key:"componentDidUpdate",value:function e(t){var r=this;B(this.props.$ref,this.$formutil);Z(this.$$triggerChangeTimer);this.$$triggerChangeTimer=X(function(){r.$$triggerFormChange()})}},{key:"componentWillUnmount",value:function e(){B(this.props.$ref,null)}},{key:"_render",value:function e(){var r=this.$formutil;var n=this.props,i=n.children,a=n.render,u=n.component;if(u){return t.createElement(u,{$formutil:r})}if(x(a)){return a(r)}if(x(i)){return i(r)}return t.Children.map(i,function(e){return e&&x(e.type)?t.cloneElement(e,{$formutil:r}):e})}},{key:"render",value:function e(){var t=this;var n=this.props.$processer;var i=Object.keys(this.$$registers).map(function(e){return{path:e,$state:t.$$registers[e].$getState()}});var a=G(i,function(e,t){var r=t.path,i=t.$state;if(n){n(i,r)}if("$value"in i&&(i.$dirty||!j(i.$value))){e[r]=i.$value}});var u=G(i,function(e,t){var r=t.path,n=t.$state;return r in a&&L(e,r,a[r])});var o=i.some(function(e){var t=e.$state;return t.$invalid});var s=i.some(function(e){var t=e.$state;return t.$dirty});var l=i.some(function(e){var t=e.$state;return t.$touched});var f=i.some(function(e){var t=e.$state;return t.$focused});var c=this.$$formPending||i.some(function(e){var t=e.$state;return t.$pending});var d=this.$formutil={$$registers:$({},this.$$registers),$$deepRegisters:this.$$deepRegisters,$states:G(i,function(e,t){var r=t.path,n=t.$state;return L(e,r,n)}),$params:$({},this.$$defaultValues,u),$errors:G(i,function(e,t){var r=t.path,n=t.$state;if(n.$invalid){L(e,r,n.$error)}}),$dirts:G(i,function(e,t){var r=t.path,n=t.$state;return L(e,r,n.$dirty)}),$touches:G(i,function(e,t){var r=t.path,n=t.$state;return L(e,r,n.$touched)}),$focuses:G(i,function(e,t){var r=t.path,n=t.$state;return L(e,r,n.$focused)}),$pendings:G(i,function(e,t){var r=t.path,n=t.$state;return L(e,r,n.$pending)}),$weakStates:G(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n}),$weakParams:a,$weakErrors:G(i,function(e,t){var r=t.path,n=t.$state;if(n.$invalid){e[r]=n.$error}}),$weakDirts:G(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$dirty}),$weakTouches:G(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$touched}),$weakFocuses:G(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$focused}),$weakPendings:G(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$pending}),$getFirstError:function e(t){if(t){var r=d.$getField(t);return r&&r.$getFirstError()}for(var n in d.$weakErrors){var i=d.$weakErrors[n];for(var a in i){return i[a]instanceof Error?i[a].message:i[a]}}},$render:this.$render,$getField:this.$getField,$onValidates:this.$onValidates,$new:function e(){return t.$formutil},$setStates:this.$setStates,$setValues:this.$setValues,$setErrors:this.$setErrors,$setTouches:this.$setTouches,$setDirts:this.$setDirts,$setFocuses:this.$setFocuses,$batchState:this.$batchState,$batchTouched:this.$batchTouched,$batchDirty:this.$batchDirty,$batchFocused:this.$batchFocused,$reset:this.$reset,$validates:this.$validates,$validate:this.$validate,$valid:!o,$invalid:o,$dirty:s,$pristine:!s,$touched:l,$untouched:!l,$focused:f,$pending:c};return r.createElement(P.Provider,{value:this.getFormContext()},this._render())}}]);return i}(t.Component);ee.displayName="React.Formutil.Form";ee.defaultProps={$defaultValues:{},$defaultStates:{}};function te(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var a=function(t){f(i,t);function i(){u(this,i);return m(this,c(i).apply(this,arguments))}s(i,[{key:"render",value:function t(){var i=Object.assign({},this.props);var a=this.props,u=a.component,o=p(a,["component"]);["$defaultStates","$defaultValues","$onFormChange","$validator","$processer","$ref"].forEach(function(e){if(e in i){if(e==="$defaultStates"||e==="$defaultValues"){o[e]=$({},n[e],i[e])}delete i[e]}});return r.createElement(ee,Object.assign({},n,o,{render:function t(n){return r.createElement(e,Object.assign({},i,{$formutil:n}))}}))}}]);return i}(t.Component);a.displayName="React.Formutil.withForm."+(e.displayName||e.name||"Anonymous");return i(a,e)}var re=U(te);var ne=0;var ie={$valid:true,$invalid:false,$dirty:false,$pristine:true,$touched:false,$untouched:true,$focused:false,$pending:false,$error:{}};function ae(e){return e!==true}function ue(e,t,r){n(!j(e),"You should return a string or Error when the validation('".concat(r&&r+": ").concat(t,"') failed, otherwise return true."))}var oe="React.Formutil.Field";function se(){return ne++}function le(e,r){var n=r.children,i=r.render,a=r.component;if(a){return t.createElement(a,{$fieldutil:e})}if(x(i)){return i(e)}if(x(n)){return n(e)}return t.Children.map(n,function(r){return r&&x(r.type)?t.cloneElement(r,{$fieldutil:e}):r})}function $e(e,t){var r={$$FIELD_UUID:e.$$FIELD_UUID,$$reset:o,$$merge:b,$$detectChange:i,$$triggerChange:a,$onValidate:u,$new:function t(){return e.$fieldutil},$picker:s,$getState:s,$getComponent:function e(){return t},$reset:function t(r,n){return e.$setState(o(r),n)},$getFirstError:y,$validate:l,$setState:e.$setState,$render:f,$setValue:c,$setTouched:d,$setDirty:v,$setFocused:p,$setValidity:m,$setError:h,$setPending:g};var n;function i(e){if("$value"in e||"$viewValue"in e){l()}}function a(t){var r=t.$newValue,n=t.$prevValue;var i=e.props.$onFieldChange;if(x(i)){i(r,n,e.$formContext.$formutil)}}function u(e){n.then(e);return n}function o(t){var r;var n=e.props,i=e.$formContext;if(i.$$getDefault){var a=n.name;var u=i.$$getDefault(),o=u.$$defaultStates,s=u.$$defaultValues;if(a&&s){var l=L(s,a);r=L(o,a)||{};if(!j(l)){r.$value=l}}}var f=n.$defaultValue,c=n.$defaultState;return b($({},ie,x(c)?c(n):c,{$value:x(f)?f(n):"$defaultValue"in n?f:""},r,t))}function s(){return $({},e.$state)}function l(t){return n=new Promise(function(r){var n=e.props,i=e.$formContext;var a=$({},n.$validators,n.$asyncValidators);var u=e.$state,o=u.$value,s=u.$pending,l=Object.assign({},u.$error);var f=i.$formutil;var c={};var d=false;var v;var p;var y;var b;delete l[J];var V=Object.keys(a).reduce(function(t,r){delete l[r];if(!d&&n[r]!=null){var i=a[r](o,n[r],$({},n,{$formutil:f,$fieldutil:e.$fieldutil,$validError:c}));if(_(i)){t.push(i.catch(function(e){if(!v){m(r,e||r)}}))}else if(ae(i)){c[r]=i||r;ue(i,r,n.name);if(n.$validateLazy){d=true}}}return t},[]);var C=function e(n){return r(R(t,R(y,n)))};if(V.length){if(!s){g(true)}p=function e(t){return v=t(C)};V.push(h($({},l,c)));b=Promise.all(V).then(function(){if(v){return v}e.$shouldCancelPrevAsyncValidate=null;return g(false,C)})}else{if(s){g(false)}b=h($({},l,c),C)}if(e.$shouldCancelPrevAsyncValidate){e.$shouldCancelPrevAsyncValidate(function(e){y=e;return b})}e.$shouldCancelPrevAsyncValidate=p})}function f(t,r){return e.$setState({$viewValue:t,$dirty:true},r)}function c(t,r){return e.$setState({$value:t},r)}function d(t,r){return e.$setState({$touched:t},r)}function v(t,r){return e.$setState({$dirty:t},r)}function p(t,r){return e.$setState({$focused:t},r)}function h(t,r){return e.$setState({$error:t},r)}function m(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var n=arguments.length>2?arguments[2]:undefined;var i=Object.assign({},e.$state.$error);if(ae(r)){i[t]=r||t;ue(r,t,e.props.name)}else{delete i[t]}return h(i,n)}function g(t,r){return e.$setState({$pending:t},r)}function y(){var t=e.$state.$error,r=t===void 0?{}:t;for(var n in r){return r[n]instanceof Error?r[n].message:r[n]}}function b(t){var r=Object.assign({},t);if("$error"in r){if(!r.$error){r.$error={}}r.$valid=Object.keys(r.$error).length===0}var n=e.props,i=n.$parser,a=n.$formatter;if("$viewValue"in r&&!("$value"in r)){var u=function e(t){return r.$viewValue=t};r.$value=i?i(r.$viewValue,u):r.$viewValue}else if("$value"in r&&!("$viewValue"in r)){var o=function e(t){return r.$value=t};r.$viewValue=a?a(r.$value,o):r.$value}if("$valid"in r){r.$invalid=!r.$valid}else if("$invalid"in r){r.$dirty=!r.$invalid}if("$dirty"in r){r.$pristine=!r.$dirty}else if("$pristine"in r){r.$dirty=!r.$pristine}if("$touched"in r){r.$untouched=!r.$touched}else if("$untouched"in r){r.$touched=!r.$untouched}e.$state=$({},e.$state,r);return s()}return r}var fe=function(e){f(t,e);function t(){var e;var r;u(this,t);for(var n=arguments.length,i=new Array(n),a=0;a with the name '".concat(t,"' must be used underneath a component or withForm() HOC, otherwise it's isolated."));n(t,"You should assign a name to , otherwise it will be isolated!");if(r.$$register){r.$$register(t,this.$fieldHandler)}this.$prevValue=this.$state.$value;B(this.props.$ref,this.$fieldutil)}},{key:"componentWillUnmount",value:function e(){if(this.$formContext.$$unregister){this.$formContext.$$unregister(this.props.name,this.$fieldHandler,this.props.$reserveOnUnmount)}this.isMounting=false;B(this.props.$ref,null)}},{key:"componentDidUpdate",value:function e(t){var r=this.props.name;if(r!==t.name){if(this.$formContext.$$register){this.$formContext.$$register(r,this.$fieldHandler,t.name)}}B(this.props.$ref,this.$fieldutil);if(this.$state.$value!==this.$prevValue){if(!(r in(this.$formContext.$$registers||{}))){this.$registered.$$triggerChange({$newValue:this.$state.$value,$prevValue:this.$prevValue})}this.$prevValue=this.$state.$value}}},{key:"_render",value:function e(){var t=this.$fieldutil=$({$name:this.props.name},this.$registered.$getState(),this.$registered,{$$formutil:this.$formContext.$formutil});return le(t,this.props)}},{key:"render",value:function e(){var t=this;var n=!this.$formContext;return r.createElement(P.Consumer,null,function(e){t.$formContext=e;if(!t.$fieldHandler){t.$fieldHandler=$e(t,t)}t.$registered=(e.$$registers||{})[t.$fieldHandler.$name]||t.$fieldHandler;if(n){t.$fieldHandler.$$reset();t.$fieldHandler.$validate()}return t._render()})}}]);return t}(t.Component);fe.displayName=oe;function ce(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var a=function(t){f(i,t);function i(){u(this,i);return m(this,c(i).apply(this,arguments))}s(i,[{key:"render",value:function t(){var i=Object.assign({},this.props);var a=this.props,u=a.component,o=p(a,["component"]);["$validators","$asyncValidators","$validateLazy","$reserveOnUnmount","$defaultValue","$defaultState","$onFieldChange","$parser","$formatter","$ref","name"].concat(Object.keys($({},n.$validators,n.$asyncValidators,i.$validators,i.$asyncValidators))).forEach(function(e){if(e in i){if(e==="$validators"||e==="$asyncValidators"||e==="$defaultState"){o[e]=$({},n[e],i[e])}delete i[e]}});return r.createElement(fe,Object.assign({},n,o,{render:function t(n){return r.createElement(e,Object.assign({},i,{$fieldutil:n}))}}))}}]);return i}(t.Component);a.displayName="React.Formutil.withField."+(e.displayName||e.name||"Anonymous");return i(a,e)}var de=U(ce);var ve=function(e){f(t,e);function t(){u(this,t);return m(this,c(t).apply(this,arguments))}s(t,[{key:"render",value:function e(){var t=this;var n=this.props,i=n.$fieldutil,a=n.value,u=n.onChange,o=n.onFocus,s=n.onBlur,l=n.checked,$=n.unchecked,f=p(n,["$fieldutil","value","onChange","onFocus","onBlur","checked","unchecked"]);var c=this.props.type;var d={value:"compositionValue"in this?this.compositionValue:a,onCompositionEnd:function e(r){t.composition=false;delete t.compositionValue;d.onChange(r)},onCompositionStart:function e(){return t.composition=true},onChange:function e(r){var n=r.target.value;if(t.composition){t.compositionValue=n;t.forceUpdate()}else{u(n,r)}},onFocus:o,onBlur:s};var v="input";switch(c){case"select":v=c;d.onChange=function(e){var t=e.target;var r=t.multiple?[].slice.call(t.options).filter(function(e){return e.selected}).map(function(e){return e.value}):t.value;u(r,e)};delete f.type;break;case"textarea":v=c;delete f.type;break;case"checkbox":case"radio":d={checked:a===l,onChange:function e(t){u(t.target.checked?l:$,t)},onFocus:o,onBlur:s};break;default:break}return r.createElement(v,Object.assign({},f,d))}}]);return t}(t.Component);ve.displayName="React.Formutil.EasyField.Native";ve.defaultProps={value:"",type:"text",checked:true,unchecked:false};var pe=t.createContext({}),he=pe.Provider,me=pe.Consumer;var ge=function(e){f(n,e);function n(){u(this,n);return m(this,c(n).apply(this,arguments))}s(n,[{key:"getGroupContext",value:function e(){return this.props}},{key:"_render",value:function e(){var n=this.props,i=n.className,a=n.groupNode,u=n.children;var o={GroupOption:ye,Field:be};var s=x(u)?u(o):t.Children.map(u,function(e){return t.cloneElement(e,o)});if(a===null){return s}return r.createElement(a,{className:i},s)}},{key:"render",value:function e(){return r.createElement(he,{value:this.getGroupContext()},this._render())}}]);return n}(t.Component);ge.displayName="React.Formutil.EasyField.Group";ge.defaultProps={type:"checkbox",groupNode:"div"};var ye=function(e){f(t,e);function t(){u(this,t);return m(this,c(t).apply(this,arguments))}s(t,[{key:"componentDidMount",value:function e(){n("$value"in this.props,"You should pass a $value to .")}},{key:"render",value:function e(){var t=this.props,n=t.$value,i=t.onChange,a=t.onFocus,u=t.onBlur,o=p(t,["$value","onChange","onFocus","onBlur"]);return r.createElement(me,null,function(e){var t=e.type,s=e.name;var l=t==="radio"?{checked:e.value===n,onChange:function t(r){e.onChange(n,r);i&&i(r)}}:t==="checkbox"?{checked:e.value.indexOf(n)>-1,onChange:function t(r){e.onChange(r.target.checked?e.value.concat(n):e.value.filter(function(e){return e!==n}),r);i&&i(r)}}:{value:e.value,onChange:function t(r){e.onChange(r);i&&i(r)}};return r.createElement("input",Object.assign({name:s},o,l,{type:t,onFocus:function t(r){e.onFocus(r);a&&a(r)},onBlur:function t(r){e.onBlur(r);u&&u(r)}}))})}}]);return t}(t.Component);ye.displayName="React.Formutil.EasyField.Group.Option";var be=function(e){f(t,e);function t(){u(this,t);return m(this,c(t).apply(this,arguments))}s(t,[{key:"componentDidMount",value:function e(){n(false,'The "Field" property in EasyField\'s children-props has been deprecated. Please use "GroupOption" instead.')}},{key:"render",value:function e(){return r.createElement(ye,this.props)}}]);return t}(t.Component);be.displayName="React.Formutil.EasyField.Group.Option.Deprecated";var Ve=r.Frament||"div";var Ce=function(e){f(t,e);function t(e){var r;u(this,t);r=m(this,c(t).call(this,e));r.id=0;r.latestValue=r.props.value;r.$formutil=void 0;r.FieldValidators={required:function e(t){return t!==null}};r.$onFormChange=function(e){e.$onValidates(function(e){var t=e.$invalid,n=e.$params;if(t){if(r.props.value.length){r.props.onChange(r.latestValue=[])}}else if(!a(r.props.value,n.list)){r.props.onChange(r.latestValue=n.list)}})};r.swap=function(e,t,n){return r.$setState(function(r){var n=r.items;var i=[n[e],n[t]];n[t]=i[0];n[e]=i[1];return n},n)};r.insert=function(){var e,t,n;for(var i=arguments.length,a=new Array(i),u=0;u=t}],["max",function(e,t){return D(e)||e*1<=t}],["min",function(e,t){return D(e)||e*1>=t}],["pattern",function(e,t){return D(e)||t.test(e)}],["enum",function(e,t){return D(e)||t.indexOf(e)>-1}],["checker",function(e,t,r){return t(e,r)}]].reduce(function(e,t){var r=g(t,2),n=r[0],i=r[1];e[n]=function e(t,r,a){var u=a.validMessage,o=u===void 0?{}:u;return i.apply(void 0,arguments)||o[n]||"Error input: ".concat(n)};return e},{});var ke="React.Formutil.EasyField";var Pe={validMessage:{},valuePropName:"value",changePropName:"onChange",focusPropName:"onFocus",blurPropName:"onBlur",$parser:function e(t){return typeof t==="string"?t.trim():t}};function Ee(e,t,r){var n;var i=t.valuePropName,a=t.changePropName,u=t.focusPropName,o=t.blurPropName,s=t.passUtil;var f=function e(t){return t&&t.target?t.target[i]:t};var c=$({},r,(n={},l(n,i,e.$viewValue),l(n,a,function(){for(var r=arguments.length,n=new Array(r),i=0;i=16.8, Please upgrade your reactjs.")}var e=r.useContext;var t=e(P);return t}function _e(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!r.useState){throw new Error("Hooks api need react@>=16.8, Please upgrade your reactjs.")}var i=r.useState,a=r.useLayoutEffect,u=r.useRef;var o;if(e){if(typeof e==="string"){o=e;t.name=o}else{t=e;o=t.name}}var s=De();var l=u({}).current;var f=u([]);var c;l.$formContext=s;l.props=t;l.$setState=h;var d=i(function(){l.$$FIELD_UUID=se();l.$fieldHandler=c=$e(l);var e=l.$fieldHandler.$$reset();l.$fieldHandler.$validate();return e}),v=g(d,2),p=v[1];if(!c){c=(s.$$registers||{})[l.$fieldHandler.$name]||l.$fieldHandler}a(function(){var e=l.$state;if(l.isMounting){if(!(o in(s.$$registers||{}))){var t=l.$prevValue;c.$$triggerChange({$newValue:e.$value,$prevValue:t})}}l.$prevValue=e.$value},[l.$state.$value]);a(function(){l.isMounting=true;n(!o||s.$formutil,"You should enusre that the useField() with the name '".concat(o,"' must be used underneath a component or withForm() HOC, otherwise it's isolated."));n(o,"You should pass a name argument to useField(), otherwise it will be isolated!");return function(){l.isMounting=false;B(t.$ref,null)}},[]);a(function(){if(s.$$register){s.$$register(o,l.$fieldHandler)}return function(){if(s.$$unregister){s.$$unregister(o,l.$fieldHandler,!l.isMounting&&t.$reserveOnUnmount)}}},[o]);a(function(){B(t.$ref,l.$fieldutil)});a(function(){if(f.current.length>0){var e=y(f.current);f.current.length=0;while(e.length){e.pop()(l.$fieldutil)}}});function h(e,t){return new Promise(function(r){var n=function e(){return r(R(t,l.$fieldutil))};if(l.isMounting){if(o in(s.$$registers||{})){s.$$onChange(o,e,n)}else{p(c.$$merge(e));c.$$detectChange(e);f.current.push(n)}}else{c.$$merge(e);n()}})}return l.$fieldutil=$({$name:o},c.$getState(),c,{$$formutil:s.$formutil})}function Ne(){var e=De(),t=e.$formutil;return t}function Ae(e){e=$({},Pe,e,{children:null});var t=Oe(e),r=t.fieldProps,n=t.childProps;var i=_e(r);return Ee(i,r,n)}exports.EasyField=je;exports.Field=fe;exports.Form=ee;exports.connect=xe;exports.useField=_e;exports.useForm=Ne;exports.useHandler=Ae;exports.withField=de;exports.withForm=re; diff --git a/dist/react-formutil.esm.development.js b/dist/react-formutil.esm.development.js index dad9e42..bf00b0a 100644 --- a/dist/react-formutil.esm.development.js +++ b/dist/react-formutil.esm.development.js @@ -1,6 +1,5 @@ -import React, { createElement, Children, cloneElement, Component } from 'react'; +import React, { createContext, createElement, Children, cloneElement, Component } from 'react'; import PropTypes from 'prop-types'; -import createContext from 'create-react-context'; import warning from 'warning'; import hoistStatics from 'hoist-non-react-statics'; import isEqual from 'react-fast-compare'; diff --git a/dist/react-formutil.esm.development.js.map b/dist/react-formutil.esm.development.js.map index c47f899..1939ead 100644 --- a/dist/react-formutil.esm.development.js.map +++ b/dist/react-formutil.esm.development.js.map @@ -1 +1 @@ -{"version":3,"file":"react-formutil.esm.development.js","sources":["../src/context.js","../src/utils.js","../src/Form.js","../src/withForm.js","../src/fieldHelper.js","../src/Field.js","../src/withField.js","../src/EasyField/Native.js","../src/EasyField/Group.js","../src/EasyField/List.js","../src/EasyField/easyFieldHandler.js","../src/EasyField/index.js","../src/connect.js","../src/hooks/useFormContext.js","../src/hooks/useField.js","../src/hooks/useForm.js","../src/hooks/useHandler.js"],"sourcesContent":["import createContext from 'create-react-context';\n\nexport default createContext({});\n","import warning from 'warning';\n\nconst OBJECT_PROTO = Object.getPrototypeOf({});\nconst PATH_REGEXP = /\\s*(?:\\]\\s*\\.|\\]\\s*\\[|\\.|\\[|\\])\\s*/g;\nconst Root = isUndefined(window) ? global : window;\n\nexport function isUndefined(arg) {\n return typeof arg === 'undefined';\n}\n\nexport function isFunction(arg) {\n return typeof arg === 'function';\n}\n\nexport function isEmpty(arg) {\n return isUndefined(arg) || arg === null || arg + '' === '';\n}\n\nexport function isPromise(promise) {\n return !!promise && isFunction(promise.then);\n}\n\nexport function isObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n\nexport function isPlainObj(obj) {\n if (!isObject(obj)) return false;\n if (null === Object.getPrototypeOf(obj)) return true;\n if (!isFunction(obj.constructor)) return false;\n\n return obj.constructor.prototype === OBJECT_PROTO;\n}\n\n// quick clone deeply\nexport function deepClone(obj) {\n if (obj && typeof obj === 'object') {\n if (Array.isArray(obj)) {\n const newObj = [];\n\n for (let i = 0, j = obj.length; i < j; i++) {\n newObj[i] = deepClone(obj[i]);\n }\n\n return newObj;\n } else if (isPlainObj(obj)) {\n const newObj = {};\n\n for (let i in obj) {\n newObj[i] = deepClone(obj[i]);\n }\n\n return newObj;\n }\n }\n\n return obj;\n}\n\nexport const runCallback = function(callback, ...args) {\n if (isFunction(callback)) {\n callback(...args);\n }\n\n return args[0];\n};\n\nexport function createHOC(withHOC) {\n return function(...args) {\n if (isFunction(args[0])) {\n return withHOC(...args);\n }\n\n return function(WrappedComponent) {\n return withHOC(WrappedComponent, args[0]);\n };\n };\n}\n\nconst VALID_PROPS = ['minlength', 'maxlength', 'max', 'min', 'required', 'pattern', 'step'];\nexport function isValidProp(prop) {\n return VALID_PROPS.indexOf(prop.toLowerCase()) > -1;\n}\n\n/* eslint-disable */\nconst executeWord = function(word) {\n try {\n const exec = new Function(\n 'origin',\n 'global',\n `return typeof ${word} === 'number' || (typeof ${word} !== 'undefined' && !(origin in global)) ? ${word} : origin`\n );\n return exec(word, Root);\n } catch (err) {\n return word;\n }\n};\n\n/**\n * @desc 解析表达式中赋值深路径对象\n *\n * @param {object} target 要赋值的对象\n * @param {string} path 赋值路径,eg:list[0].title\n * @param {any} [value] 要赋过去的值,如过不传,则返回解析路径后的值\n *\n * 使用示例:parsePath({}, 'list[0].authors[1].name', 'Lucy');\n */\nexport function parsePath(...args) {\n const [target, path, value] = args;\n\n warning(typeof path === 'string', `The second parameter(${JSON.stringify(path)}) of parsePath() must be a string.`);\n\n const pathSymbols = (path.match(PATH_REGEXP) || []).map(s => s.replace(/\\s/g, ''));\n const pathWords = path\n .split(PATH_REGEXP)\n .map(s => s.trim())\n .filter(item => item !== '');\n let scope = target;\n\n try {\n if (args.length < 3) {\n for (let index = 0, len = pathWords.length; index < len; index++) {\n const word = executeWord(pathWords[index]);\n\n if (index + 1 === len) {\n return scope[word];\n }\n\n if (isUndefined(scope[word])) {\n break;\n }\n\n scope = scope[word];\n }\n } else {\n for (let index = 0, length = pathWords.length; index < length; index++) {\n const word = executeWord(pathWords[index]);\n const nextWord = pathWords[index + 1];\n const symbol = pathSymbols[index];\n\n if (isUndefined(nextWord)) {\n scope[word] = value;\n break;\n }\n\n switch (symbol) {\n case '].':\n case '.':\n scope = isUndefined(scope[word]) ? (scope[word] = {}) : scope[word];\n break;\n\n case '][':\n case '[':\n const nextVarWord = executeWord(nextWord);\n\n scope = isUndefined(scope[word])\n ? (scope[word] = typeof nextVarWord === 'number' && nextVarWord >= 0 ? [] : {})\n : scope[word];\n break;\n\n default:\n scope[word] = value;\n break;\n }\n }\n }\n } catch (error) {\n warning(false, `The name '%s' of Field seems is not a legal expression.`, path);\n }\n\n if (args.length > 2) {\n return target;\n }\n}\n\nexport function createRef(ref, value) {\n if (ref) {\n if (isFunction(ref)) {\n ref(value);\n } else if ('current' in ref) {\n ref.current = value;\n }\n }\n}\n\nexport const arrayFind = (array, process) => {\n for (let i = 0, j = array.length; i < j; i++) {\n if (process(array[i]) === true) {\n return array[i];\n }\n }\n};\n\nexport const objectMap = (obj, handler) =>\n Object.keys(obj).reduce((newObj, key) => {\n newObj[key] = handler(obj[key], key, obj);\n return newObj;\n }, {});\n\nexport const objectEach = (obj, handler) => Object.keys(obj).forEach(key => handler(obj[key], key, obj));\n\nexport const toObject = (arr, handler, obj = {}) =>\n arr.reduce((...args) => {\n handler(...args);\n\n return args[0];\n }, obj);\n\nconst TODO_DELETE = undefined;\nfunction CLEAR(obj, pkey, pobj) {\n objectEach(obj, (value, key) => {\n if (value === TODO_DELETE) {\n delete obj[key];\n } else if (value && typeof value === 'object') {\n CLEAR(value, key, obj);\n }\n });\n\n if (pobj && Object.keys(obj).every(key => obj[key] === TODO_DELETE)) {\n pobj[pkey] = TODO_DELETE;\n CLEAR(pobj);\n }\n}\nexport const objectClear = (obj, name) => {\n if (!isUndefined(parsePath(obj, name))) {\n parsePath(obj, name, TODO_DELETE);\n\n CLEAR(obj);\n }\n};\n","import React, { Component, Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport FormContext from './context';\nimport * as utils from './utils';\nimport warning from 'warning';\n\nexport const FORM_VALIDATE_RESULT = 'FORM_VALIDATE_RESULT';\n\nlet requestFrame, cancelFrame;\n\nif (typeof requestAnimationFrame === 'function') {\n requestFrame = requestAnimationFrame;\n cancelFrame = cancelAnimationFrame;\n} else {\n requestFrame = setTimeout;\n cancelFrame = clearTimeout;\n}\n\nclass Form extends Component {\n static displayName = 'React.Formutil.Form';\n\n static propTypes = {\n render: PropTypes.func,\n component: PropTypes.func,\n children(props, ...args) {\n let pt = PropTypes.oneOfType([PropTypes.func, PropTypes.node]);\n\n if (!props.render && !props.component) {\n pt = pt.isRequired;\n }\n\n return pt(props, ...args);\n },\n $defaultValues: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $defaultStates: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $onFormChange: PropTypes.func,\n $validator: PropTypes.func,\n $processer: PropTypes.func,\n $ref: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n current: PropTypes.any\n })\n ])\n };\n\n static defaultProps = {\n $defaultValues: {},\n $defaultStates: {}\n };\n\n $$formPending;\n $$formValidatePromise;\n\n $$registers = {};\n $$deepRegisters = {};\n\n constructor(props) {\n super(props);\n\n this.$$defaultInitialize();\n }\n\n getFormContext() {\n return {\n $$registers: this.$$registers,\n $$register: this.$$register,\n $$unregister: this.$$unregister,\n $$onChange: this.$$onChange,\n $$getDefault: this.$$getDefault,\n $formutil: this.$formutil\n };\n }\n\n $$regDuplications = {};\n $$duplicateTimer;\n $$checkDuplication = () => {\n const { $$regDuplications } = this;\n let hasDup;\n\n utils.objectEach($$regDuplications, ([$curRegistered, $handler], name) => {\n warning($curRegistered.$$reserved, `The Field with a name '${name}' has been registered!`);\n\n $handler.$$reset($curRegistered.$getState());\n\n hasDup = delete $$regDuplications[name];\n });\n\n if (hasDup) {\n this.$render();\n }\n };\n\n /*\n * @desc 注册或者替换(preName)Field\n */\n $$register = (name, $handler, prevName) => {\n this.$$unregister(prevName, $handler);\n\n if (name) {\n const $curRegistered = this.$$getRegister(name);\n\n if ($curRegistered) {\n cancelFrame(this.$$duplicateTimer);\n\n this.$$regDuplications[name] = [$curRegistered, $handler];\n this.$$duplicateTimer = requestFrame(this.$$checkDuplication);\n } else {\n this.$$fieldChangedQueue.push({\n name,\n $newValue: $handler.$getState().$value\n });\n\n utils.objectClear(this.$$defaultValues, name);\n }\n\n this.$$registers[($handler.$name = name)] = $handler;\n\n this.createDeepRegisters();\n this.$render();\n }\n };\n\n $$unregister = (name, $handler, $$reserved) => {\n if (name) {\n if (name in this.$$regDuplications) {\n const [$curRegistered, $handler] = this.$$regDuplications[name];\n\n this.$$fieldChangedQueue.push({\n name,\n $newValue: $handler.$getState().$value,\n $prevValue: $curRegistered.$getState().$value\n });\n\n delete this.$$regDuplications[name];\n } else if (this.$$registers[name] === $handler) {\n if ($$reserved) {\n $handler.$$reserved = true;\n } else {\n delete this.$$registers[name];\n\n this.$$fieldChangedQueue.push({\n name,\n $prevValue: $handler.$getState().$value\n });\n\n utils.objectClear(this.$$defaultValues, name);\n }\n }\n\n this.createDeepRegisters();\n this.$render();\n }\n };\n\n $$defaultInitialize = () => {\n const { $defaultValues, $defaultStates } = this.props;\n\n this.$$defaultValues = this.$$deepParseObject(\n utils.deepClone(utils.isFunction($defaultValues) ? $defaultValues(this.props) || {} : $defaultValues)\n );\n this.$$defaultStates = this.$$deepParseObject(\n utils.deepClone(utils.isFunction($defaultStates) ? $defaultStates(this.props) || {} : $defaultStates)\n );\n };\n\n $$getDefault = () => ({\n $$defaultStates: this.$$defaultStates,\n $$defaultValues: this.$$defaultValues\n });\n\n $$deepParseObject(mayWeakObj, deepObj = {}) {\n utils.objectEach(mayWeakObj, (data, name) => utils.parsePath(deepObj, name, data));\n\n return deepObj;\n }\n\n $$triggerChangeTimer;\n $$fieldChangedQueue = [];\n $$triggerFormChange = () => {\n if (this.$$fieldChangedQueue.length) {\n const $$fieldChangedQueue = [...this.$$fieldChangedQueue];\n\n this.$$fieldChangedQueue.length = 0;\n\n const $newValues = {};\n const $prevValues = {};\n const $$registers = this.$$registers;\n let hasFormChanged = false;\n\n $$fieldChangedQueue.forEach(item => {\n if (!(item.name in $$registers)) {\n delete item.$newValue;\n }\n\n if (item.$newValue !== item.$prevValue) {\n if ('$newValue' in item && '$prevValue' in item) {\n const $handler = this.$$getRegister(item.name);\n\n if ($handler) {\n $handler.$$triggerChange(item);\n }\n }\n\n '$newValue' in item && utils.parsePath($newValues, item.name, item.$newValue);\n '$prevValue' in item && utils.parsePath($prevValues, item.name, item.$prevValue);\n\n hasFormChanged = true;\n }\n });\n\n if (hasFormChanged) {\n if (utils.isFunction(this.props.$validator)) {\n this.$$formValidate();\n }\n\n if (utils.isFunction(this.props.$onFormChange)) {\n this.props.$onFormChange(this.$formutil, $newValues, $prevValues);\n }\n }\n }\n };\n\n createDeepRegisters = () => (this.$$deepRegisters = this.$$deepParseObject(this.$$registers));\n\n $$getRegister = name => {\n if (name) {\n const field = this.$$registers[name] || utils.parsePath(this.$$deepRegisters, name);\n\n if (field) {\n return field;\n }\n }\n };\n\n $$formValidate = callback =>\n (this.$$formValidatePromise = new Promise(resolve => {\n const { $validator } = this.props;\n\n let $breakAsyncHandler;\n let $shouldCancelPrevAsyncValidate;\n let prevCallback;\n let validation;\n\n const result = $validator(this.$formutil.$params, this.formtutil);\n const execCallback = $formutil =>\n resolve(utils.runCallback(callback, utils.runCallback(prevCallback, $formutil)));\n\n if (utils.isPromise(result)) {\n if (!this.$$formPending) {\n this.$$formPending = true;\n\n this.$render();\n }\n\n $shouldCancelPrevAsyncValidate = setCallback => ($breakAsyncHandler = setCallback(execCallback));\n\n validation = result\n .then(() => void 0, reason => reason)\n .then(reason => {\n if ($breakAsyncHandler) {\n return $breakAsyncHandler;\n }\n\n this.$shouldCancelPrevAsyncValidate = null;\n\n this.$$formPending = false;\n\n return this.$$setFormErrors(reason, execCallback);\n });\n } else {\n if (this.$$formPending) {\n this.$$formPending = false;\n }\n\n validation = this.$$setFormErrors(result, execCallback);\n }\n\n if (this.$shouldCancelPrevAsyncValidate) {\n this.$shouldCancelPrevAsyncValidate(callback => {\n prevCallback = callback;\n\n return validation;\n });\n }\n\n this.$shouldCancelPrevAsyncValidate = $shouldCancelPrevAsyncValidate;\n }));\n\n $$setFormErrors = (validResults, callback) => {\n if (validResults && (validResults instanceof Error || typeof validResults !== 'object')) {\n warning(\n false,\n `The result of $validator in should always return None(null,undefined) or an object contains error message of Field.`\n );\n\n return this.$render(callback);\n }\n\n return this.$$setStates(\n validResults || {},\n (result, handler) => {\n const { $error = {} } = handler.$getState();\n\n if (result) {\n return {\n $error: {\n ...$error,\n [FORM_VALIDATE_RESULT]: result\n }\n };\n }\n\n if ($error[FORM_VALIDATE_RESULT]) {\n delete $error[FORM_VALIDATE_RESULT];\n\n return {\n $error\n };\n }\n\n return;\n },\n callback,\n true\n );\n };\n\n $getField = name => {\n const field = this.$$getRegister(name);\n\n warning(!name || field, `$getField('${name}') fail to find the matched Field. Maybe it has been unmounted.`);\n warning(name, `You should pass a name of the mounted Field to $getField().`);\n\n if (field) {\n return field.$new();\n }\n };\n\n $$onChange = (name, $state, callback) =>\n this.$setStates(\n {\n [name]: $state\n },\n callback\n );\n\n $$setStates = ($stateTree = {}, processer, callback, force) => {\n const $parsedTree = this.$$deepParseObject($stateTree);\n let hasStateChange = false;\n\n utils.objectEach(this.$$registers, (handler, name) => {\n const data = name in $stateTree ? $stateTree[name] : utils.parsePath($parsedTree, name);\n\n if (!utils.isUndefined(data) || force) {\n const $newState = processer(data, handler);\n\n if ($newState) {\n const $prevValue = this.$formutil.$weakParams[name];\n const { $value: $newValue } = handler.$$merge($newState);\n\n handler.$$detectChange($newState);\n\n if ('$value' in $newState || '$viewValue' in $newState) {\n const findItem = utils.arrayFind(this.$$fieldChangedQueue, item => item.name === name);\n\n if (findItem) {\n if (!('$prevValue' in findItem)) {\n findItem.$prevValue = findItem.$newValue;\n }\n\n findItem.$newValue = $newValue;\n } else {\n this.$$fieldChangedQueue.push({\n name,\n $newValue,\n $prevValue\n });\n }\n }\n\n hasStateChange = true;\n }\n }\n });\n\n if (hasStateChange) {\n return this.$render(callback);\n }\n\n return Promise.resolve(utils.runCallback(callback, this.$formutil));\n };\n\n componentDidMount() {\n utils.createRef(this.props.$ref, this.$formutil);\n }\n\n componentDidUpdate(prevProps) {\n utils.createRef(this.props.$ref, this.$formutil);\n\n cancelFrame(this.$$triggerChangeTimer);\n\n // ensure this calls to access the newest $formutil\n this.$$triggerChangeTimer = requestFrame(() => {\n this.$$triggerFormChange();\n });\n }\n\n componentWillUnmount() {\n utils.createRef(this.props.$ref, null);\n }\n\n $render = callback =>\n new Promise(resolve => this.forceUpdate(() => resolve(utils.runCallback(callback, this.$formutil))));\n\n $validates = (...args) => {\n let callback;\n\n if (utils.isFunction(args[args.length - 1])) {\n callback = args.pop();\n }\n\n if (args.length) {\n const flatter = names => {\n names.forEach(name => {\n if (Array.isArray(name)) {\n flatter(name);\n } else {\n const handler = this.$getField(name);\n\n if (handler) {\n handler.$validate();\n }\n }\n });\n };\n\n flatter(args);\n } else {\n utils.objectEach(this.$$registers, handler => handler.$validate());\n\n if (utils.isFunction(this.props.$validator)) {\n this.$$formValidate();\n }\n }\n\n return this.$onValidates(callback);\n };\n\n $onValidates = callback => {\n const filedValidatePromises = Object.keys(this.$$registers).map(name => this.$$registers[name].$onValidate());\n\n filedValidatePromises.push(this.$$formValidatePromise);\n\n return Promise.all(filedValidatePromises).then(() => utils.runCallback(callback, this.$formutil));\n };\n\n $validate = (name, callback) => {\n const handler = this.$getField(name);\n\n if (handler) {\n return handler.$validate(callback);\n }\n\n return utils.runCallback(callback);\n };\n\n $reset = ($stateTree, callback) => {\n this.$$defaultInitialize();\n\n if (utils.isFunction($stateTree)) {\n callback = $stateTree;\n $stateTree = {};\n }\n\n return this.$$setStates($stateTree, ($state, handler) => handler.$$reset($state), callback, true);\n };\n\n $setStates = ($stateTree, callback) => this.$$setStates($stateTree, $state => $state, callback);\n\n $setValues = ($valueTree, callback) => {\n this.$$deepParseObject(utils.deepClone($valueTree), this.$$defaultValues);\n\n return this.$$setStates($valueTree, $value => ({ $value }), callback);\n };\n\n $setFocuses = ($focusedTree, callback) => this.$$setStates($focusedTree, $focused => ({ $focused }), callback);\n $setDirts = ($dirtyTree, callback) => this.$$setStates($dirtyTree, $dirty => ({ $dirty }), callback);\n $setTouches = ($touchedTree, callback) => this.$$setStates($touchedTree, $touched => ({ $touched }), callback);\n $setPendings = ($pendingTree, callback) => this.$$setStates($pendingTree, $pending => ({ $pending }), callback);\n $setErrors = ($errorTree, callback) => this.$$setStates($errorTree, $error => ({ $error }), callback);\n\n $batchState = ($state, callback) => this.$setStates(utils.objectMap(this.$$registers, () => $state), callback);\n $batchDirty = ($dirty, callback) =>\n this.$batchState(\n {\n $dirty\n },\n callback\n );\n\n $batchTouched = ($touched, callback) =>\n this.$batchState(\n {\n $touched\n },\n callback\n );\n\n $batchFocused = ($focused, callback) =>\n this.$batchState(\n {\n $focused\n },\n callback\n );\n\n $batchPending = ($pending, callback) =>\n this.$batchState(\n {\n $pending\n },\n callback\n );\n\n $batchError = ($error, callback) =>\n this.$batchState(\n {\n $error\n },\n callback\n );\n\n _render() {\n const $formutil = this.$formutil;\n let { children, render, component } = this.props;\n\n if (component) {\n return createElement(component, { $formutil });\n }\n\n if (utils.isFunction(render)) {\n return render($formutil);\n }\n\n if (utils.isFunction(children)) {\n return children($formutil);\n }\n\n return Children.map(children, child =>\n child && utils.isFunction(child.type)\n ? cloneElement(child, {\n $formutil\n })\n : child\n );\n }\n\n render() {\n const { $processer } = this.props;\n const $stateArray = Object.keys(this.$$registers).map(path => ({\n path,\n $state: this.$$registers[path].$getState()\n }));\n\n const $weakParams = utils.toObject($stateArray, ($params, { path, $state }) => {\n if ($processer) {\n $processer($state, path);\n }\n\n if ('$value' in $state && ($state.$dirty || !utils.isUndefined($state.$value))) {\n $params[path] = $state.$value;\n }\n });\n\n const $pureParams = utils.toObject(\n $stateArray,\n ($params, { path, $state }) => path in $weakParams && utils.parsePath($params, path, $weakParams[path])\n );\n\n const $invalid = $stateArray.some(({ $state }) => $state.$invalid);\n const $dirty = $stateArray.some(({ $state }) => $state.$dirty);\n const $touched = $stateArray.some(({ $state }) => $state.$touched);\n const $focused = $stateArray.some(({ $state }) => $state.$focused);\n const $pending = this.$$formPending || $stateArray.some(({ $state }) => $state.$pending);\n\n const $formutil = (this.$formutil = {\n $$registers: { ...this.$$registers },\n $$deepRegisters: this.$$deepRegisters,\n $states: utils.toObject($stateArray, ($states, { path, $state }) => utils.parsePath($states, path, $state)),\n $params: {\n ...this.$$defaultValues,\n ...$pureParams\n },\n $errors: utils.toObject($stateArray, ($errors, { path, $state }) => {\n if ($state.$invalid) {\n utils.parsePath($errors, path, $state.$error);\n }\n }),\n $dirts: utils.toObject($stateArray, ($dirts, { path, $state }) =>\n utils.parsePath($dirts, path, $state.$dirty)\n ),\n $touches: utils.toObject($stateArray, ($touches, { path, $state }) =>\n utils.parsePath($touches, path, $state.$touched)\n ),\n $focuses: utils.toObject($stateArray, ($focuses, { path, $state }) =>\n utils.parsePath($focuses, path, $state.$focused)\n ),\n $pendings: utils.toObject($stateArray, ($pendings, { path, $state }) =>\n utils.parsePath($pendings, path, $state.$pending)\n ),\n\n $weakStates: utils.toObject($stateArray, ($states, { path, $state }) => ($states[path] = $state)),\n $weakParams,\n $weakErrors: utils.toObject($stateArray, ($errors, { path, $state }) => {\n if ($state.$invalid) {\n $errors[path] = $state.$error;\n }\n }),\n $weakDirts: utils.toObject($stateArray, ($dirts, { path, $state }) => ($dirts[path] = $state.$dirty)),\n $weakTouches: utils.toObject(\n $stateArray,\n ($touches, { path, $state }) => ($touches[path] = $state.$touched)\n ),\n $weakFocuses: utils.toObject(\n $stateArray,\n ($focuses, { path, $state }) => ($focuses[path] = $state.$focused)\n ),\n $weakPendings: utils.toObject(\n $stateArray,\n ($weakPendings, { path, $state }) => ($weakPendings[path] = $state.$pending)\n ),\n\n $getFirstError(name) {\n if (name) {\n const $fieldutil = $formutil.$getField(name);\n\n return $fieldutil && $fieldutil.$getFirstError();\n }\n\n for (let name in $formutil.$weakErrors) {\n const $fieldError = $formutil.$weakErrors[name];\n\n for (let key in $fieldError) {\n return $fieldError[key] instanceof Error ? $fieldError[key].message : $fieldError[key];\n }\n }\n },\n\n $render: this.$render,\n\n $getField: this.$getField,\n $onValidates: this.$onValidates,\n\n // get the newest $formutil\n $new: () => this.$formutil,\n\n $setStates: this.$setStates,\n $setValues: this.$setValues,\n $setErrors: this.$setErrors,\n $setTouches: this.$setTouches,\n $setDirts: this.$setDirts,\n $setFocuses: this.$setFocuses,\n\n $batchState: this.$batchState,\n $batchTouched: this.$batchTouched,\n $batchDirty: this.$batchDirty,\n $batchFocused: this.$batchFocused,\n\n $reset: this.$reset,\n $validates: this.$validates,\n $validate: this.$validate,\n\n $valid: !$invalid,\n $invalid,\n $dirty,\n $pristine: !$dirty,\n $touched,\n $untouched: !$touched,\n $focused,\n $pending\n });\n\n return {this._render()};\n }\n}\n\nexport default Form;\n","import React, { Component } from 'react';\nimport Form from './Form';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withForm(WrappedComponent, config = {}) {\n class FormEnhanced extends Component {\n static displayName =\n 'React.Formutil.withForm.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n const { ...others } = this.props;\n const { component, ...formProps } = this.props;\n\n ['$defaultStates', '$defaultValues', '$onFormChange', '$validator', '$processer', '$ref'].forEach(prop => {\n if (prop in others) {\n if (prop === '$defaultStates' || prop === '$defaultValues') {\n formProps[prop] = { ...config[prop], ...others[prop] };\n }\n delete others[prop];\n }\n });\n\n return (\n }\n />\n );\n }\n }\n\n return hoistStatics(FormEnhanced, WrappedComponent);\n}\n\nexport default createHOC(withForm);\n","import { Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport * as utils from './utils';\nimport warning from 'warning';\nimport { FORM_VALIDATE_RESULT } from './Form';\n\nlet FIELD_UUID = 0;\nconst $baseState = {\n $valid: true,\n $invalid: false,\n\n $dirty: false,\n $pristine: true,\n\n $touched: false,\n $untouched: true,\n\n $focused: false,\n\n $pending: false,\n\n $error: {}\n};\n\nfunction isError(result) {\n return /*!utils.isUndefined(result) && */ result !== true;\n}\n\nfunction warningValidatorReturn(result, key, name) {\n warning(\n !utils.isUndefined(result),\n `You should return a string or Error when the validation('${name &&\n name + ': '}${key}') failed, otherwise return true.`\n );\n}\n\nexport const propTypes =\n process.env.NODE_ENV !== 'production'\n ? {\n name: PropTypes.string,\n\n $defaultValue: PropTypes.any,\n $defaultState: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $onFieldChange: PropTypes.func,\n $validators: PropTypes.object,\n $asyncValidators: PropTypes.object,\n $validateLazy: PropTypes.bool,\n $reserveOnUnmount: PropTypes.bool,\n $ref: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n current: PropTypes.any\n })\n ]),\n $parser: PropTypes.func,\n $formatter: PropTypes.func,\n\n render: PropTypes.func,\n component: PropTypes.func,\n children(props, ...args) {\n let pt = PropTypes.oneOfType([PropTypes.func, PropTypes.node]);\n\n if (!props.render && !props.component && props.children !== null) {\n pt = pt.isRequired;\n }\n\n return pt(props, ...args);\n }\n }\n : undefined;\n\nexport const displayName = 'React.Formutil.Field';\n\nexport function GET_FIELD_UUID() {\n return FIELD_UUID++;\n}\n\nexport function renderField($fieldutil, props) {\n let { children, render, component } = props;\n\n if (component) {\n return createElement(component, { $fieldutil });\n }\n\n if (utils.isFunction(render)) {\n return render($fieldutil);\n }\n\n if (utils.isFunction(children)) {\n return children($fieldutil);\n }\n\n return Children.map(children, child =>\n child && utils.isFunction(child.type)\n ? cloneElement(child, {\n $fieldutil\n })\n : child\n );\n}\n\nexport function createHandler($this, owner) {\n const $fieldHandler = {\n $$FIELD_UUID: $this.$$FIELD_UUID,\n\n $$reset,\n $$merge,\n $$detectChange,\n $$triggerChange,\n $onValidate,\n\n $new() {\n return $this.$fieldutil;\n },\n $picker: $getState,\n $getState,\n // not support in Hooks\n $getComponent() {\n return owner;\n },\n\n $reset($state, callback) {\n return $this.$setState($$reset($state), callback);\n },\n $getFirstError,\n $validate,\n $setState: $this.$setState,\n $render,\n $setValue,\n $setTouched,\n $setDirty,\n $setFocused,\n $setValidity,\n $setError,\n $setPending\n };\n\n let $$validatePromise;\n\n function $$detectChange($newState) {\n if ('$value' in $newState || '$viewValue' in $newState) {\n $validate();\n }\n }\n\n function $$triggerChange({ $newValue, $prevValue }) {\n const { $onFieldChange } = $this.props;\n\n if (utils.isFunction($onFieldChange)) {\n $onFieldChange($newValue, $prevValue, $this.$formContext.$formutil);\n }\n }\n\n function $onValidate(callback) {\n $$validatePromise.then(callback);\n\n return $$validatePromise;\n }\n\n function $$reset($newState) {\n let $initialState;\n\n const { props, $formContext } = $this;\n\n if ($formContext.$$getDefault) {\n const $name = props.name;\n const { $$defaultStates, $$defaultValues } = $formContext.$$getDefault();\n\n if ($name && $$defaultValues) {\n const $initialValue = utils.parsePath($$defaultValues, $name);\n\n $initialState = utils.parsePath($$defaultStates, $name) || {};\n\n if (!utils.isUndefined($initialValue)) {\n $initialState.$value = $initialValue;\n }\n }\n }\n\n const { $defaultValue, $defaultState } = props;\n\n return $$merge({\n ...$baseState, // the base state\n ...(utils.isFunction($defaultState) ? $defaultState(props) : $defaultState), // self default state\n $value: utils.isFunction($defaultValue)\n ? $defaultValue(props)\n : '$defaultValue' in props\n ? $defaultValue\n : '',\n ...$initialState, // the default state from Form\n ...$newState\n });\n }\n\n function $getState() {\n return { ...$this.$state };\n }\n\n function $validate(callback) {\n return ($$validatePromise = new Promise(resolve => {\n const { props, $formContext } = $this;\n const $validators = { ...props.$validators, ...props.$asyncValidators };\n const {\n $value,\n $pending,\n $error: { ...$newError }\n } = $this.$state;\n const { $formutil } = $formContext;\n const $validError = {};\n let $skipRestValidate = false;\n let $breakAsyncHandler;\n let $shouldCancelPrevAsyncValidate;\n let prevCallback;\n let validation;\n\n delete $newError[FORM_VALIDATE_RESULT];\n\n const $validatePromises = Object.keys($validators).reduce((promises, key) => {\n delete $newError[key];\n\n if (!$skipRestValidate && props[key] != null) {\n const result = $validators[key]($value, props[key], {\n ...props,\n $formutil,\n $fieldutil: $this.$fieldutil,\n $validError\n });\n\n if (utils.isPromise(result)) {\n promises.push(\n // @ts-ignore\n result.catch(reason => {\n if (!$breakAsyncHandler) {\n $setValidity(key, reason || key);\n }\n })\n );\n } else if (isError(result)) {\n $validError[key] = result || key;\n\n warningValidatorReturn(result, key, props.name);\n\n if (props.$validateLazy) {\n $skipRestValidate = true;\n }\n }\n }\n\n return promises;\n }, []);\n const execCallback = $fieldutil =>\n resolve(utils.runCallback(callback, utils.runCallback(prevCallback, $fieldutil)));\n\n if ($validatePromises.length) {\n if (!$pending) {\n $setPending(true);\n }\n\n $shouldCancelPrevAsyncValidate = setCallback => ($breakAsyncHandler = setCallback(execCallback));\n\n $validatePromises.push(\n $setError({\n ...$newError,\n ...$validError\n })\n );\n\n validation = Promise.all($validatePromises).then(() => {\n if ($breakAsyncHandler) {\n return $breakAsyncHandler;\n }\n\n $this.$shouldCancelPrevAsyncValidate = null;\n\n return $setPending(false, execCallback);\n });\n } else {\n if ($pending) {\n $setPending(false);\n }\n\n validation = $setError(\n {\n ...$newError,\n ...$validError\n },\n execCallback\n );\n }\n\n if ($this.$shouldCancelPrevAsyncValidate) {\n $this.$shouldCancelPrevAsyncValidate(callback => {\n prevCallback = callback;\n\n return validation;\n });\n }\n\n $this.$shouldCancelPrevAsyncValidate = $shouldCancelPrevAsyncValidate;\n }));\n }\n\n function $render($viewValue, callback) {\n return $this.$setState(\n {\n $viewValue,\n $dirty: true\n },\n callback\n );\n }\n\n function $setValue($value, callback) {\n return $this.$setState(\n {\n $value\n },\n callback\n );\n }\n\n function $setTouched($touched, callback) {\n return $this.$setState(\n {\n $touched\n },\n callback\n );\n }\n\n function $setDirty($dirty, callback) {\n return $this.$setState(\n {\n $dirty\n },\n callback\n );\n }\n\n function $setFocused($focused, callback) {\n return $this.$setState(\n {\n $focused\n },\n callback\n );\n }\n\n function $setError($error, callback) {\n return $this.$setState(\n {\n $error\n },\n callback\n );\n }\n\n function $setValidity(key, result = true, callback) {\n const {\n $error: { ...$newError }\n } = $this.$state;\n\n if (isError(result)) {\n $newError[key] = result || key;\n\n warningValidatorReturn(result, key, $this.props.name);\n } else {\n delete $newError[key];\n }\n\n return $setError($newError, callback);\n }\n\n function $setPending($pending, callback) {\n return $this.$setState(\n {\n $pending\n },\n callback\n );\n }\n\n function $getFirstError() {\n const { $error = {} } = $this.$state;\n\n for (let name in $error) {\n return $error[name] instanceof Error ? $error[name].message : $error[name];\n }\n }\n\n function $$merge({ ...$newState }) {\n if ('$error' in $newState) {\n if (!$newState.$error) {\n $newState.$error = {};\n }\n\n $newState.$valid = Object.keys($newState.$error).length === 0;\n }\n\n // process $value\n const { $parser, $formatter } = $this.props;\n\n if ('$viewValue' in $newState && !('$value' in $newState)) {\n const $setViewValue = $value => ($newState.$viewValue = $value);\n\n $newState.$value = $parser ? $parser($newState.$viewValue, $setViewValue) : $newState.$viewValue;\n } else if ('$value' in $newState && !('$viewValue' in $newState)) {\n const $setModelValue = $value => ($newState.$value = $value);\n\n $newState.$viewValue = $formatter ? $formatter($newState.$value, $setModelValue) : $newState.$value;\n }\n\n // process $valid/$invalid\n if ('$valid' in $newState) {\n $newState.$invalid = !$newState.$valid;\n } else if ('$invalid' in $newState) {\n $newState.$dirty = !$newState.$invalid;\n }\n\n // process $dirty/$pristine\n if ('$dirty' in $newState) {\n $newState.$pristine = !$newState.$dirty;\n } else if ('$pristine' in $newState) {\n $newState.$dirty = !$newState.$pristine;\n }\n\n // process $touched/$untouched\n if ('$touched' in $newState) {\n $newState.$untouched = !$newState.$touched;\n } else if ('$untouched' in $newState) {\n $newState.$touched = !$newState.$untouched;\n }\n\n $this.$state = { ...$this.$state, ...$newState };\n\n return $getState();\n }\n\n return $fieldHandler;\n}\n","import React, { Component } from 'react';\nimport { createHandler, GET_FIELD_UUID, propTypes, displayName, renderField } from './fieldHelper';\nimport FormContext from './context';\nimport warning from 'warning';\nimport { runCallback, createRef } from './utils';\n\nclass Field extends Component {\n static displayName = displayName;\n static propTypes = propTypes;\n\n $$FIELD_UUID = GET_FIELD_UUID();\n\n /** @type { any } */\n $formContext;\n /** @type { any } */\n $state;\n\n componentDidMount() {\n this.isMounting = true;\n\n const {\n props: { name: $name },\n $formContext\n } = this;\n\n warning(\n !$name || $formContext.$formutil,\n `You should enusre that the with the name '${$name}' must be used underneath a component or withForm() HOC, otherwise it's isolated.`\n );\n\n warning($name, `You should assign a name to , otherwise it will be isolated!`);\n\n if ($formContext.$$register) {\n $formContext.$$register($name, this.$fieldHandler);\n }\n\n this.$prevValue = this.$state.$value;\n\n createRef(this.props.$ref, this.$fieldutil);\n }\n\n componentWillUnmount() {\n if (this.$formContext.$$unregister) {\n this.$formContext.$$unregister(this.props.name, this.$fieldHandler, this.props.$reserveOnUnmount);\n }\n\n this.isMounting = false;\n\n createRef(this.props.$ref, null);\n }\n\n componentDidUpdate(prevProps) {\n const $name = this.props.name;\n\n if ($name !== prevProps.name) {\n if (this.$formContext.$$register) {\n this.$formContext.$$register($name, this.$fieldHandler, prevProps.name);\n }\n }\n\n createRef(this.props.$ref, this.$fieldutil);\n\n if (this.$state.$value !== this.$prevValue) {\n if (!($name in (this.$formContext.$$registers || {}))) {\n this.$registered.$$triggerChange({\n $newValue: this.$state.$value,\n $prevValue: this.$prevValue\n });\n }\n\n this.$prevValue = this.$state.$value;\n }\n }\n\n $setState = ($newState, callback) =>\n new Promise(resolve => {\n const execute = () => resolve(runCallback(callback, this.$fieldutil));\n\n if (this.isMounting) {\n const $name = this.props.name;\n\n if ($name in (this.$formContext.$$registers || {})) {\n this.$formContext.$$onChange($name, $newState, execute);\n } else {\n this.$registered.$$merge($newState);\n\n this.$registered.$$detectChange($newState);\n\n this.forceUpdate(execute);\n }\n } else {\n this.$registered.$$merge($newState);\n execute();\n }\n });\n\n _render() {\n const $fieldutil = (this.$fieldutil = {\n $name: this.props.name,\n ...this.$registered.$getState(),\n ...this.$registered,\n $$formutil: this.$formContext.$formutil\n });\n\n return renderField($fieldutil, this.props);\n }\n\n render() {\n const shouldInitial = !this.$formContext;\n\n return (\n \n {context => {\n this.$formContext = context;\n\n if (!this.$fieldHandler) {\n this.$fieldHandler = createHandler(this, this);\n }\n\n this.$registered = (context.$$registers || {})[this.$fieldHandler.$name] || this.$fieldHandler;\n\n if (shouldInitial) {\n this.$fieldHandler.$$reset();\n this.$fieldHandler.$validate();\n }\n\n return this._render();\n }}\n \n );\n }\n}\n\nexport default Field;\n","import React, { Component } from 'react';\nimport Field from './Field';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withField(WrappedComponent, config = {}) {\n class FieldEnhanced extends Component {\n static displayName =\n 'React.Formutil.withField.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n const { ...others } = this.props;\n const { component, ...fieldProps } = this.props;\n\n [\n '$validators',\n '$asyncValidators',\n '$validateLazy',\n '$reserveOnUnmount',\n '$defaultValue',\n '$defaultState',\n '$onFieldChange',\n '$parser',\n '$formatter',\n '$ref',\n 'name'\n ]\n .concat(\n Object.keys({\n ...config.$validators,\n ...config.$asyncValidators,\n ...others.$validators,\n ...others.$asyncValidators\n })\n )\n .forEach(prop => {\n if (prop in others) {\n if (prop === '$validators' || prop === '$asyncValidators' || prop === '$defaultState') {\n fieldProps[prop] = { ...config[prop], ...others[prop] };\n }\n delete others[prop];\n }\n });\n\n return (\n }\n />\n );\n }\n }\n\n return hoistStatics(FieldEnhanced, WrappedComponent);\n}\n\nexport default createHOC(withField);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nclass EasyFieldNative extends Component {\n static displayName = 'React.Formutil.EasyField.Native';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n\n value: PropTypes.any,\n name: PropTypes.string,\n type: PropTypes.string,\n\n checked: PropTypes.any,\n unchekced: PropTypes.any\n };\n\n static defaultProps = {\n value: '',\n type: 'text',\n checked: true,\n unchecked: false\n };\n\n render() {\n const { $fieldutil, value: htmlValue, onChange, onFocus, onBlur, checked, unchecked, ...others } = this.props;\n const htmlType = this.props.type;\n\n let htmlProps = {\n value: 'compositionValue' in this ? this.compositionValue : htmlValue,\n onCompositionEnd: ev => {\n this.composition = false;\n delete this.compositionValue;\n htmlProps.onChange(ev);\n },\n onCompositionStart: () => (this.composition = true),\n onChange: ev => {\n const { value } = ev.target;\n\n if (this.composition) {\n this.compositionValue = value;\n this.forceUpdate();\n } else {\n onChange(value, ev);\n }\n },\n onFocus,\n onBlur\n };\n let Element = 'input';\n\n switch (htmlType) {\n case 'select':\n Element = htmlType;\n htmlProps.onChange = ev => {\n const node = ev.target;\n const value = node.multiple\n ? [].slice\n .call(node.options)\n .filter(option => option.selected)\n .map(option => option.value)\n : node.value;\n\n onChange(value, ev);\n };\n\n delete others.type;\n\n break;\n case 'textarea':\n Element = htmlType;\n delete others.type;\n break;\n\n case 'checkbox':\n case 'radio':\n htmlProps = {\n checked: htmlValue === checked,\n onChange: ev => {\n onChange(ev.target.checked ? checked : unchecked, ev);\n },\n onFocus,\n onBlur\n };\n break;\n\n default:\n break;\n }\n\n return ;\n }\n}\n\nexport default EasyFieldNative;\n","import React, { Component, Children, cloneElement } from 'react';\nimport PropTypes from 'prop-types';\nimport createContext from 'create-react-context';\nimport { isFunction } from '../utils';\nimport warning from 'warning';\n\n/** @type {any} */\nconst { Provider, Consumer } = createContext({});\n\nclass EasyFieldGroup extends Component {\n static displayName = 'React.Formutil.EasyField.Group';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n\n value: PropTypes.any,\n name: PropTypes.string,\n type: PropTypes.string.isRequired,\n groupNode: PropTypes.any,\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).isRequired\n };\n\n static defaultProps = {\n type: 'checkbox',\n groupNode: 'div'\n };\n\n getGroupContext() {\n return this.props;\n }\n\n _render() {\n const { className, groupNode: Element, children } = this.props;\n\n const GroupOptionProps = {\n GroupOption: EasyFieldGroupOption,\n Field: DeprecatedEasyFieldGroupOption\n };\n\n const childNodes = isFunction(children)\n ? children(GroupOptionProps)\n : Children.map(children, child => cloneElement(child, GroupOptionProps));\n\n if (Element === null) {\n return childNodes;\n }\n\n return {childNodes};\n }\n\n render() {\n return {this._render()};\n }\n}\n\nclass EasyFieldGroupOption extends Component {\n static displayName = 'React.Formutil.EasyField.Group.Option';\n\n static propTypes = {\n $value: PropTypes.any.isRequired\n };\n\n componentDidMount() {\n warning('$value' in this.props, `You should pass a $value to .`);\n }\n\n render() {\n const { $value, onChange, onFocus, onBlur, ...others } = this.props;\n\n return (\n \n {$groupHander => {\n const { type, name } = $groupHander;\n\n const elemProps =\n type === 'radio'\n ? {\n checked: $groupHander.value === $value,\n onChange: ev => {\n $groupHander.onChange($value, ev);\n\n onChange && onChange(ev);\n }\n }\n : type === 'checkbox'\n ? {\n checked: $groupHander.value.indexOf($value) > -1,\n onChange: ev => {\n $groupHander.onChange(\n ev.target.checked\n ? $groupHander.value.concat($value)\n : $groupHander.value.filter(value => value !== $value),\n ev\n );\n\n onChange && onChange(ev);\n }\n }\n : {\n value: $groupHander.value,\n onChange: ev => {\n $groupHander.onChange(ev);\n\n onChange && onChange(ev);\n }\n };\n\n return (\n {\n $groupHander.onFocus(ev);\n onFocus && onFocus(ev);\n }}\n onBlur={ev => {\n $groupHander.onBlur(ev);\n onBlur && onBlur(ev);\n }}\n />\n );\n }}\n \n );\n }\n}\n\nclass DeprecatedEasyFieldGroupOption extends Component {\n static displayName = 'React.Formutil.EasyField.Group.Option.Deprecated';\n\n componentDidMount() {\n warning(\n false,\n `The \"Field\" property in EasyField's children-props has been deprecated. Please use \"GroupOption\" instead.`\n );\n }\n\n render() {\n return ;\n }\n}\n\nexport default EasyFieldGroup;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport isEqual from 'react-fast-compare';\nimport Form from '../Form';\nimport Field from '../Field';\nimport { isUndefined, isFunction, runCallback } from '../utils';\n\nconst Wrapper = React.Frament || 'div';\n\nclass EasyFieldList extends Component {\n static displayName = 'React.Formutil.EasyField.List';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n value: PropTypes.array,\n\n children: PropTypes.func.isRequired\n };\n\n id = 0;\n latestValue = this.props.value;\n $formutil;\n\n constructor(props) {\n super(props);\n\n this.state = {\n items: props.value.length ? props.value.map(() => this.getId()) : [this.getId()],\n formKey: 0\n };\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.value !== this.latestValue) {\n this.setState({\n items: this.props.value.length ? this.props.value.map(() => this.getId()) : [this.getId()],\n formKey: this.state.formKey + 1\n });\n\n this.latestValue = this.props.value;\n }\n }\n\n getId(values) {\n return {\n id: this.id++,\n values\n };\n }\n\n FieldValidators = {\n required(value) {\n return value !== null;\n }\n };\n\n $onFormChange = $formutil => {\n $formutil.$onValidates($formutil => {\n const { $invalid, $params } = $formutil;\n\n if ($invalid) {\n if (this.props.value.length) {\n this.props.onChange((this.latestValue = []));\n }\n } else if (!isEqual(this.props.value, $params.list)) {\n this.props.onChange((this.latestValue = $params.list));\n }\n });\n };\n\n swap = (m, n, callback) =>\n this.$setState(({ items }) => {\n [items[n], items[m]] = [items[m], items[n]];\n\n return items;\n }, callback);\n\n insert = (...args) => {\n let m, values, callback;\n\n args.forEach(arg => {\n if (isFunction(arg)) {\n callback = arg;\n } else if (typeof arg === 'number') {\n m = arg;\n } else if (typeof arg === 'object') {\n values = arg;\n }\n });\n\n return this.$setState(({ items }) => {\n if (isUndefined(m)) {\n items.push(this.getId(values));\n } else {\n items.splice(m, 0, this.getId(values));\n }\n\n return { items };\n }, callback);\n };\n\n remove = (...args) => {\n let m, callback;\n\n args.forEach(arg => {\n if (isFunction(arg)) {\n callback = arg;\n } else if (typeof arg === 'number') {\n m = arg;\n }\n });\n\n return this.$setState(({ items }) => {\n if (isUndefined(m)) {\n items.pop();\n } else {\n items.splice(m, 1);\n }\n\n if (!items.length) {\n items = [this.getId()];\n }\n\n return { items };\n }, callback);\n };\n\n $setState = (updater, callback) =>\n new Promise(resolve =>\n this.setState(updater, () =>\n this.$formutil.$onValidates($formutil => resolve(runCallback(callback, $formutil)))\n )\n );\n\n render() {\n const { children, onFocus, onBlur, value } = this.props;\n\n if (!isFunction(children)) {\n return null;\n }\n\n const $baseutil = {\n $length: this.state.items.length,\n $insert: this.insert,\n $remove: this.remove,\n $swap: this.swap,\n $push: (values, callback) => this.insert(values, callback),\n $pop: callback => this.remove(callback),\n $shift: callback => this.remove(0, callback),\n $unshift: (values, callback) => this.insert(0, values, callback),\n onFocus,\n onBlur\n };\n\n return (\n {\n this.$formutil = $formutil;\n\n return (\n \n {this.state.items.map(({ id, values }, index) => (\n {\n return (\n \n $formutil.$onValidates($formutil => {\n const { $invalid, $params } = $formutil;\n\n if ($invalid) {\n if ($fieldutil.$viewValue !== null) {\n $fieldutil.$render(null);\n }\n } else if (!isEqual($fieldutil.$viewValue, $params)) {\n $fieldutil.$render($params);\n }\n })\n }\n children={$innerFormutil =>\n children(\n {\n ...$baseutil,\n ...$innerFormutil,\n $index: index,\n $isLast: () => index === this.state.items.length - 1,\n $isFirst: () => index === 0\n },\n $formutil\n )\n }\n />\n );\n }}\n />\n ))}\n \n );\n }}\n />\n );\n }\n}\n\nexport default EasyFieldList;\n","import { Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport Native from './Native';\nimport Group from './Group';\nimport List from './List';\nimport { isEmpty, isUndefined, isFunction, isValidProp } from '../utils';\n\nexport const TYPE = '__TYPE__';\nexport const defaultValidators = [\n [\n 'required',\n ($value, check, { __TYPE__, checked = true }) =>\n __TYPE__ === 'checked' ? $value === checked : !isEmpty($value)\n ],\n ['maxLength', ($value, len) => isEmpty($value) || $value.length <= len],\n ['minLength', ($value, len) => isEmpty($value) || $value.length >= len],\n ['max', ($value, limit) => isEmpty($value) || $value * 1 <= limit],\n ['min', ($value, limit) => isEmpty($value) || $value * 1 >= limit],\n ['pattern', ($value, regexp) => isEmpty($value) || regexp.test($value)],\n ['enum', ($value, enumeration) => isEmpty($value) || enumeration.indexOf($value) > -1],\n ['checker', ($value, checker, props) => checker($value, props)]\n].reduce(($validators, item) => {\n const [validKey, validate] = item;\n $validators[validKey] = function validator($value, propValue, { validMessage = {} }) {\n return validate(...arguments) || validMessage[validKey] || `Error input: ${validKey}`;\n };\n return $validators;\n}, {});\n\nexport const propTypes =\n process.env.NODE_ENV !== 'production'\n ? {\n type: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n component: PropTypes.func,\n render: PropTypes.func,\n\n defaultValue: PropTypes.any,\n validMessage: PropTypes.object,\n\n valuePropName: PropTypes.string,\n changePropName: PropTypes.string,\n focusPropName: PropTypes.string,\n blurPropName: PropTypes.string,\n\n passUtil: PropTypes.string\n }\n : undefined;\n\nexport const displayName = 'React.Formutil.EasyField';\n\nexport const defaultProps = {\n validMessage: {},\n valuePropName: 'value',\n changePropName: 'onChange',\n focusPropName: 'onFocus',\n blurPropName: 'onBlur',\n $parser: value => (typeof value === 'string' ? value.trim() : value)\n};\n\nexport function createHandler($fieldutil, fieldProps, childProps) {\n const { valuePropName, changePropName, focusPropName, blurPropName, passUtil } = fieldProps;\n\n const fetchValueFromEvent = function(ev) {\n return ev && ev.target ? ev.target[valuePropName] : ev;\n };\n\n const $handleProps = {\n ...childProps,\n\n [valuePropName]: $fieldutil.$viewValue,\n [changePropName]: (...args) => {\n let value = args[0];\n let ev = args[args.length - 1];\n\n if (!ev || !ev.target) {\n ev = args;\n } else {\n ev = [ev];\n }\n\n const onChange = fieldProps[changePropName];\n onChange && onChange(...ev);\n\n const newValue = fetchValueFromEvent(value);\n $fieldutil.$render(newValue);\n },\n [focusPropName]: (...args) => {\n const onFocus = fieldProps[focusPropName];\n onFocus && onFocus(...args);\n\n $fieldutil.$setFocused(true);\n },\n [blurPropName]: (...args) => {\n const onBlur = fieldProps[blurPropName];\n onBlur && onBlur(...args);\n\n if ($fieldutil.$untouched) {\n $fieldutil.$setTouched(true);\n }\n\n $fieldutil.$setFocused(false);\n }\n };\n\n if (passUtil) {\n $handleProps[passUtil === true ? '$fieldutil' : passUtil] = $fieldutil;\n }\n\n return $handleProps;\n}\n\nexport function parseProps(props) {\n const {\n children,\n component,\n render,\n\n ...fieldProps\n } = props;\n\n const {\n // filter all the props that accept by EasyField\n name,\n type,\n defaultValue,\n valuePropName,\n changePropName,\n focusPropName,\n blurPropName,\n validMessage,\n __TYPE__,\n passUtil,\n\n // filter all the props that accept by Field\n $defaultValue,\n $defaultState,\n $onFieldChange,\n $validators,\n $asyncValidators,\n $validateLazy,\n $reserveOnUnmount,\n $parser,\n $formatter,\n $ref,\n\n ...childProps\n } = fieldProps;\n\n const renderProps = {\n children,\n component,\n render\n };\n\n const isNative = !isUndefined(type) || (isUndefined(children) && isUndefined(component) && isUndefined(render));\n\n Object.keys({\n ...(fieldProps.$validators = {\n ...defaultValidators,\n ...fieldProps.$validators\n }),\n ...fieldProps.$asyncValidators\n }).forEach(prop => {\n if (prop in childProps) {\n if (!isNative || !isValidProp(prop)) {\n delete childProps[prop];\n }\n }\n });\n\n if (isNative) {\n const [htmlType = 'text', groupType] = (type || '').split('.');\n\n renderProps.component = htmlType === 'group' ? Group : htmlType === 'list' ? List : Native;\n\n // Native or Group need to pass 'name' | 'type' | 'children'\n if (name) {\n childProps.name = name;\n }\n\n if (type) {\n childProps.type = htmlType;\n }\n\n if (children) {\n childProps.children = children;\n }\n\n switch (htmlType) {\n case 'select':\n case 'textarea':\n if (props.multiple) {\n fieldProps[TYPE] = 'array';\n }\n break;\n\n case 'group':\n if (groupType === 'checkbox') {\n fieldProps[TYPE] = 'array';\n }\n\n childProps.type = groupType;\n break;\n\n case 'checkbox':\n case 'radio':\n fieldProps[TYPE] = 'checked';\n break;\n\n case 'list':\n fieldProps[TYPE] = 'array';\n break;\n\n default:\n break;\n }\n }\n\n if (!('$defaultValue' in fieldProps) && 'defaultValue' in props) {\n fieldProps.$defaultValue = defaultValue;\n }\n\n if (!('$defaultValue' in fieldProps) && TYPE in fieldProps) {\n let defaultValue;\n\n switch (fieldProps[TYPE]) {\n case 'checked':\n const { unchecked = false } = fieldProps;\n\n defaultValue = unchecked;\n break;\n\n case 'array':\n defaultValue = [];\n break;\n\n case 'object':\n defaultValue = {};\n break;\n\n case 'number':\n defaultValue = 0;\n break;\n\n case 'empty':\n default:\n break;\n }\n\n fieldProps.$defaultValue = defaultValue;\n }\n\n return {\n fieldProps,\n childProps,\n renderProps\n };\n}\n\nexport function renderField($handleProps, props) {\n let { component, render, children } = props;\n\n if (component) {\n return createElement(component, $handleProps);\n }\n\n if (isFunction(render)) {\n return render($handleProps);\n }\n\n if (isFunction(children)) {\n return children($handleProps);\n }\n\n return Children.map(children, child => cloneElement(child, $handleProps));\n}\n","import React, { Component } from 'react';\nimport Field from '../Field';\nimport { renderField, createHandler, parseProps, displayName, propTypes, defaultProps } from './easyFieldHandler';\n\n/**\n * 提供对浏览器原生表单控件的封装\n * 支持以下类型表单元素:\n * - input[type=xx]\n * - textarea\n * - select\n */\nclass EasyField extends Component {\n static displayName = displayName;\n static propTypes = propTypes;\n static defaultProps = defaultProps;\n\n render() {\n const { fieldProps, childProps, renderProps } = parseProps(this.props);\n\n return (\n renderField(createHandler($fieldutil, fieldProps, childProps), renderProps)}\n />\n );\n }\n}\n\nexport default EasyField;\n","import React, { Component } from 'react';\nimport FormContext from './context';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction connect(WrappedComponent) {\n class Connect extends Component {\n static displayName =\n 'React.Formutil.connect.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n return (\n \n {context => }\n \n );\n }\n }\n\n return hoistStatics(Connect, WrappedComponent);\n}\n\nexport default connect;\n","import React from 'react';\nimport FormContext from '../context';\n\nfunction useFormContext() {\n if (!React.useState) {\n throw new Error(`Hooks api need react@>=16.8, Please upgrade your reactjs.`);\n }\n\n const { useContext } = React;\n const $formContext = useContext(FormContext);\n\n return $formContext;\n}\n\nexport default useFormContext;\n","import React from 'react';\nimport useFormContext from './useFormContext';\nimport { runCallback, createRef } from '../utils';\nimport { createHandler, GET_FIELD_UUID } from '../fieldHelper';\nimport warning from 'warning';\n\n/**\n * @description\n * The custom hook for Field\n *\n * @param {string | object} [name]\n * @param {object} [props]\n *\n * @return {object} $Fieldutil\n */\nfunction useField(name, props = {}) {\n if (!React.useState) {\n throw new Error(`Hooks api need react@>=16.8, Please upgrade your reactjs.`);\n }\n\n const { useState, useLayoutEffect, useRef } = React;\n\n let $name;\n\n if (name) {\n if (typeof name === 'string') {\n $name = name;\n\n props.name = $name;\n } else {\n props = name;\n\n $name = props.name;\n }\n }\n\n const $formContext = useFormContext();\n /** @type {any} */\n const $this = useRef({}).current;\n /** @type {React.MutableRefObject} */\n const callbackRef = useRef([]);\n\n let $registered;\n\n $this.$formContext = $formContext;\n $this.props = props;\n $this.$setState = $setState;\n // we not directly use this $state, just from $this.$state\n const [, setState] = useState(() => {\n $this.$$FIELD_UUID = GET_FIELD_UUID();\n $this.$fieldHandler = $registered = createHandler($this);\n\n const $state = $this.$fieldHandler.$$reset();\n\n $this.$fieldHandler.$validate();\n\n return $state;\n });\n\n if (!$registered) {\n $registered = ($formContext.$$registers || {})[$this.$fieldHandler.$name] || $this.$fieldHandler;\n }\n\n useLayoutEffect(() => {\n const { $state } = $this;\n\n if ($this.isMounting) {\n if (!($name in ($formContext.$$registers || {}))) {\n const { $prevValue } = $this;\n\n $registered.$$triggerChange({\n $newValue: $state.$value,\n $prevValue\n });\n }\n }\n\n $this.$prevValue = $state.$value;\n }, [$this.$state.$value]);\n\n useLayoutEffect(() => {\n $this.isMounting = true;\n\n warning(\n !$name || $formContext.$formutil,\n `You should enusre that the useField() with the name '${$name}' must be used underneath a component or withForm() HOC, otherwise it's isolated.`\n );\n\n warning($name, `You should pass a name argument to useField(), otherwise it will be isolated!`);\n\n return () => {\n $this.isMounting = false;\n\n createRef(props.$ref, null);\n };\n }, []);\n\n useLayoutEffect(() => {\n if ($formContext.$$register) {\n $formContext.$$register($name, $this.$fieldHandler);\n }\n\n return () => {\n if ($formContext.$$unregister) {\n $formContext.$$unregister($name, $this.$fieldHandler, !$this.isMounting && props.$reserveOnUnmount);\n }\n };\n }, [$name]);\n\n // trigger ref callback\n useLayoutEffect(() => {\n createRef(props.$ref, $this.$fieldutil);\n });\n\n useLayoutEffect(() => {\n if (callbackRef.current.length > 0) {\n const callbackQueue = [...callbackRef.current];\n\n callbackRef.current.length = 0;\n\n while (callbackQueue.length) {\n callbackQueue.pop()($this.$fieldutil);\n }\n }\n });\n\n function $setState($newState, callback) {\n return new Promise(resolve => {\n const execute = () => resolve(runCallback(callback, $this.$fieldutil));\n\n if ($this.isMounting) {\n if ($name in ($formContext.$$registers || {})) {\n $formContext.$$onChange($name, $newState, execute);\n } else {\n setState($registered.$$merge($newState));\n\n $registered.$$detectChange($newState);\n\n callbackRef.current.push(execute);\n }\n } else {\n $registered.$$merge($newState);\n execute();\n }\n });\n }\n\n return ($this.$fieldutil = {\n $name,\n ...$registered.$getState(),\n ...$registered,\n $$formutil: $formContext.$formutil\n });\n}\n\nexport default useField;\n","import useFormContext from './useFormContext';\n\nfunction useForm() {\n const { $formutil } = useFormContext();\n\n return $formutil;\n}\n\nexport default useForm;\n","import { createHandler, parseProps, defaultProps } from '../EasyField/easyFieldHandler';\nimport useField from './useField';\n\nfunction useHandler(props) {\n props = { ...defaultProps, ...props, children: null };\n\n const { fieldProps, childProps } = parseProps(props);\n const $fieldutil = useField(fieldProps);\n\n return createHandler($fieldutil, fieldProps, childProps);\n}\n\nexport default useHandler;\n"],"names":["createContext","OBJECT_PROTO","Object","getPrototypeOf","PATH_REGEXP","Root","isUndefined","window","global","arg","isFunction","isEmpty","isPromise","promise","then","isObject","obj","prototype","toString","call","isPlainObj","constructor","deepClone","Array","isArray","newObj","i","j","length","runCallback","callback","args","createHOC","withHOC","WrappedComponent","VALID_PROPS","isValidProp","prop","indexOf","toLowerCase","executeWord","word","exec","Function","err","parsePath","target","path","value","warning","JSON","stringify","pathSymbols","match","map","s","replace","pathWords","split","trim","filter","item","scope","index","len","nextWord","symbol","nextVarWord","error","createRef","ref","current","arrayFind","array","process","objectMap","handler","keys","reduce","key","objectEach","forEach","toObject","arr","TODO_DELETE","undefined","CLEAR","pkey","pobj","every","objectClear","name","FORM_VALIDATE_RESULT","requestFrame","cancelFrame","requestAnimationFrame","cancelAnimationFrame","setTimeout","clearTimeout","Form","props","$$formPending","$$formValidatePromise","$$registers","$$deepRegisters","$$regDuplications","$$duplicateTimer","$$checkDuplication","hasDup","utils","$curRegistered","$handler","$$reserved","$$reset","$getState","$render","$$register","prevName","$$unregister","$$getRegister","$$fieldChangedQueue","push","$newValue","$value","$$defaultValues","$name","createDeepRegisters","$prevValue","$$defaultInitialize","$defaultValues","$defaultStates","$$deepParseObject","$$defaultStates","$$getDefault","$$triggerChangeTimer","$$triggerFormChange","$newValues","$prevValues","hasFormChanged","$$triggerChange","$validator","$$formValidate","$onFormChange","$formutil","field","Promise","resolve","$breakAsyncHandler","$shouldCancelPrevAsyncValidate","prevCallback","validation","result","$params","formtutil","execCallback","setCallback","reason","$$setFormErrors","validResults","Error","$$setStates","$error","$getField","$new","$$onChange","$state","$setStates","$stateTree","processer","force","$parsedTree","hasStateChange","data","$newState","$weakParams","$$merge","$$detectChange","findItem","forceUpdate","$validates","pop","flatter","names","$validate","$onValidates","filedValidatePromises","$onValidate","all","$reset","$setValues","$valueTree","$setFocuses","$focusedTree","$focused","$setDirts","$dirtyTree","$dirty","$setTouches","$touchedTree","$touched","$setPendings","$pendingTree","$pending","$setErrors","$errorTree","$batchState","$batchDirty","$batchTouched","$batchFocused","$batchPending","$batchError","mayWeakObj","deepObj","$ref","prevProps","children","render","component","createElement","Children","child","type","cloneElement","$processer","$stateArray","$pureParams","$invalid","some","$states","$errors","$dirts","$touches","$focuses","$pendings","$weakStates","$weakErrors","$weakDirts","$weakTouches","$weakFocuses","$weakPendings","$getFirstError","$fieldutil","$fieldError","message","$valid","$pristine","$untouched","getFormContext","_render","Component","displayName","propTypes","PropTypes","func","pt","oneOfType","node","isRequired","object","shape","any","defaultProps","withForm","config","FormEnhanced","others","formProps","hoistStatics","FIELD_UUID","$baseState","isError","warningValidatorReturn","string","$defaultValue","$defaultState","$onFieldChange","$validators","$asyncValidators","$validateLazy","bool","$reserveOnUnmount","$parser","$formatter","GET_FIELD_UUID","renderField","createHandler","$this","owner","$fieldHandler","$$FIELD_UUID","$picker","$getComponent","$setState","$setValue","$setTouched","$setDirty","$setFocused","$setValidity","$setError","$setPending","$$validatePromise","$formContext","$initialState","$initialValue","$newError","$validError","$skipRestValidate","$validatePromises","promises","catch","$viewValue","$setViewValue","$setModelValue","Field","execute","isMounting","$registered","$$formutil","shouldInitial","context","withField","FieldEnhanced","fieldProps","concat","EasyFieldNative","htmlValue","onChange","onFocus","onBlur","checked","unchecked","htmlType","htmlProps","compositionValue","onCompositionEnd","ev","composition","onCompositionStart","Element","multiple","slice","options","option","selected","unchekced","Provider","Consumer","EasyFieldGroup","className","groupNode","GroupOptionProps","GroupOption","EasyFieldGroupOption","DeprecatedEasyFieldGroupOption","childNodes","getGroupContext","element","$groupHander","elemProps","Wrapper","React","Frament","EasyFieldList","id","latestValue","FieldValidators","required","isEqual","list","swap","m","n","items","insert","values","getId","splice","remove","updater","setState","state","formKey","$baseutil","$length","$insert","$remove","$swap","$push","$pop","$shift","$unshift","$innerFormutil","$index","$isLast","$isFirst","TYPE","defaultValidators","check","__TYPE__","limit","regexp","test","enumeration","checker","validKey","validate","validator","propValue","validMessage","arguments","defaultValue","valuePropName","changePropName","focusPropName","blurPropName","passUtil","childProps","fetchValueFromEvent","$handleProps","newValue","parseProps","renderProps","isNative","groupType","Group","List","Native","EasyField","connect","Connect","useFormContext","useState","useContext","FormContext","useField","useLayoutEffect","useRef","callbackRef","callbackQueue","useForm","useHandler"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAAeA,aAAa,CAAC,EAAD,CAA5B;;ACAA,IAAMC,YAAY,GAAGC,MAAM,CAACC,cAAP,CAAsB,EAAtB,CAArB;AACA,IAAMC,WAAW,GAAG,qCAApB;AACA,IAAMC,IAAI,GAAGC,WAAW,CAACC,MAAD,CAAX,GAAsBC,MAAtB,GAA+BD,MAA5C;AAEA,AAAO,SAASD,WAAT,CAAqBG,GAArB,EAA0B;SACtB,OAAOA,GAAP,KAAe,WAAtB;;AAGJ,AAAO,SAASC,UAAT,CAAoBD,GAApB,EAAyB;SACrB,OAAOA,GAAP,KAAe,UAAtB;;AAGJ,AAAO,SAASE,OAAT,CAAiBF,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AoBkD,IAApB,CAAyBiM,OAAzB;;OARR,MAUO;QACHE,WAAW,CAAC7I,OAAZ,CAAoBF,SAApB;QACA6I,OAAO;;KAfR,CAAP;;;SAoBI5B,KAAK,CAAC7C,UAAN;IACJpH,KAAK,EAALA;KACG+L,WAAW,CAAC1M,SAAZ,EAFC,EAGD0M,WAHC;IAIJC,UAAU,EAAEhB,YAAY,CAAC9J;IAJ7B;;;ACjJJ,SAASwS,OAAT,GAAmB;wBACOT,cAAc,EADrB;MACP/R,SADO,mBACPA,SADO;;SAGRA,SAAP;;;ACFJ,SAASyS,UAAT,CAAoBpV,KAApB,EAA2B;EACvBA,KAAK,qBAAQiK,YAAR,EAAyBjK,KAAzB;IAAgCmH,QAAQ,EAAE;IAA/C;;oBAEmC6M,UAAU,CAAChU,KAAD,CAHtB;MAGf8N,UAHe,eAGfA,UAHe;MAGH8F,UAHG,eAGHA,UAHG;;MAIjB/K,UAAU,GAAGiM,QAAQ,CAAChH,UAAD,CAA3B;SAEOrC,eAAa,CAAC5C,UAAD,EAAaiF,UAAb,EAAyB8F,UAAzB,CAApB;;;;;"} \ No newline at end of file +{"version":3,"file":"react-formutil.esm.development.js","sources":["../src/context.js","../src/utils.js","../src/Form.js","../src/withForm.js","../src/fieldHelper.js","../src/Field.js","../src/withField.js","../src/EasyField/Native.js","../src/EasyField/Group.js","../src/EasyField/List.js","../src/EasyField/easyFieldHandler.js","../src/EasyField/index.js","../src/connect.js","../src/hooks/useFormContext.js","../src/hooks/useField.js","../src/hooks/useForm.js","../src/hooks/useHandler.js"],"sourcesContent":["import { createContext } from 'react';\n\nexport default createContext({});\n","import warning from 'warning';\n\nconst OBJECT_PROTO = Object.getPrototypeOf({});\nconst PATH_REGEXP = /\\s*(?:\\]\\s*\\.|\\]\\s*\\[|\\.|\\[|\\])\\s*/g;\nconst Root = isUndefined(window) ? global : window;\n\nexport function isUndefined(arg) {\n return typeof arg === 'undefined';\n}\n\nexport function isFunction(arg) {\n return typeof arg === 'function';\n}\n\nexport function isEmpty(arg) {\n return isUndefined(arg) || arg === null || arg + '' === '';\n}\n\nexport function isPromise(promise) {\n return !!promise && isFunction(promise.then);\n}\n\nexport function isObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n\nexport function isPlainObj(obj) {\n if (!isObject(obj)) return false;\n if (null === Object.getPrototypeOf(obj)) return true;\n if (!isFunction(obj.constructor)) return false;\n\n return obj.constructor.prototype === OBJECT_PROTO;\n}\n\n// quick clone deeply\nexport function deepClone(obj) {\n if (obj && typeof obj === 'object') {\n if (Array.isArray(obj)) {\n const newObj = [];\n\n for (let i = 0, j = obj.length; i < j; i++) {\n newObj[i] = deepClone(obj[i]);\n }\n\n return newObj;\n } else if (isPlainObj(obj)) {\n const newObj = {};\n\n for (let i in obj) {\n newObj[i] = deepClone(obj[i]);\n }\n\n return newObj;\n }\n }\n\n return obj;\n}\n\nexport const runCallback = function(callback, ...args) {\n if (isFunction(callback)) {\n callback(...args);\n }\n\n return args[0];\n};\n\nexport function createHOC(withHOC) {\n return function(...args) {\n if (isFunction(args[0])) {\n return withHOC(...args);\n }\n\n return function(WrappedComponent) {\n return withHOC(WrappedComponent, args[0]);\n };\n };\n}\n\nconst VALID_PROPS = ['minlength', 'maxlength', 'max', 'min', 'required', 'pattern', 'step'];\nexport function isValidProp(prop) {\n return VALID_PROPS.indexOf(prop.toLowerCase()) > -1;\n}\n\n/* eslint-disable */\nconst executeWord = function(word) {\n try {\n const exec = new Function(\n 'origin',\n 'global',\n `return typeof ${word} === 'number' || (typeof ${word} !== 'undefined' && !(origin in global)) ? ${word} : origin`\n );\n return exec(word, Root);\n } catch (err) {\n return word;\n }\n};\n\n/**\n * @desc 解析表达式中赋值深路径对象\n *\n * @param {object} target 要赋值的对象\n * @param {string} path 赋值路径,eg:list[0].title\n * @param {any} [value] 要赋过去的值,如过不传,则返回解析路径后的值\n *\n * 使用示例:parsePath({}, 'list[0].authors[1].name', 'Lucy');\n */\nexport function parsePath(...args) {\n const [target, path, value] = args;\n\n warning(typeof path === 'string', `The second parameter(${JSON.stringify(path)}) of parsePath() must be a string.`);\n\n const pathSymbols = (path.match(PATH_REGEXP) || []).map(s => s.replace(/\\s/g, ''));\n const pathWords = path\n .split(PATH_REGEXP)\n .map(s => s.trim())\n .filter(item => item !== '');\n let scope = target;\n\n try {\n if (args.length < 3) {\n for (let index = 0, len = pathWords.length; index < len; index++) {\n const word = executeWord(pathWords[index]);\n\n if (index + 1 === len) {\n return scope[word];\n }\n\n if (isUndefined(scope[word])) {\n break;\n }\n\n scope = scope[word];\n }\n } else {\n for (let index = 0, length = pathWords.length; index < length; index++) {\n const word = executeWord(pathWords[index]);\n const nextWord = pathWords[index + 1];\n const symbol = pathSymbols[index];\n\n if (isUndefined(nextWord)) {\n scope[word] = value;\n break;\n }\n\n switch (symbol) {\n case '].':\n case '.':\n scope = isUndefined(scope[word]) ? (scope[word] = {}) : scope[word];\n break;\n\n case '][':\n case '[':\n const nextVarWord = executeWord(nextWord);\n\n scope = isUndefined(scope[word])\n ? (scope[word] = typeof nextVarWord === 'number' && nextVarWord >= 0 ? [] : {})\n : scope[word];\n break;\n\n default:\n scope[word] = value;\n break;\n }\n }\n }\n } catch (error) {\n warning(false, `The name '%s' of Field seems is not a legal expression.`, path);\n }\n\n if (args.length > 2) {\n return target;\n }\n}\n\nexport function createRef(ref, value) {\n if (ref) {\n if (isFunction(ref)) {\n ref(value);\n } else if ('current' in ref) {\n ref.current = value;\n }\n }\n}\n\nexport const arrayFind = (array, process) => {\n for (let i = 0, j = array.length; i < j; i++) {\n if (process(array[i]) === true) {\n return array[i];\n }\n }\n};\n\nexport const objectMap = (obj, handler) =>\n Object.keys(obj).reduce((newObj, key) => {\n newObj[key] = handler(obj[key], key, obj);\n return newObj;\n }, {});\n\nexport const objectEach = (obj, handler) => Object.keys(obj).forEach(key => handler(obj[key], key, obj));\n\nexport const toObject = (arr, handler, obj = {}) =>\n arr.reduce((...args) => {\n handler(...args);\n\n return args[0];\n }, obj);\n\nconst TODO_DELETE = undefined;\nfunction CLEAR(obj, pkey, pobj) {\n objectEach(obj, (value, key) => {\n if (value === TODO_DELETE) {\n delete obj[key];\n } else if (value && typeof value === 'object') {\n CLEAR(value, key, obj);\n }\n });\n\n if (pobj && Object.keys(obj).every(key => obj[key] === TODO_DELETE)) {\n pobj[pkey] = TODO_DELETE;\n CLEAR(pobj);\n }\n}\nexport const objectClear = (obj, name) => {\n if (!isUndefined(parsePath(obj, name))) {\n parsePath(obj, name, TODO_DELETE);\n\n CLEAR(obj);\n }\n};\n","import React, { Component, Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport FormContext from './context';\nimport * as utils from './utils';\nimport warning from 'warning';\n\nexport const FORM_VALIDATE_RESULT = 'FORM_VALIDATE_RESULT';\n\nlet requestFrame, cancelFrame;\n\nif (typeof requestAnimationFrame === 'function') {\n requestFrame = requestAnimationFrame;\n cancelFrame = cancelAnimationFrame;\n} else {\n requestFrame = setTimeout;\n cancelFrame = clearTimeout;\n}\n\nclass Form extends Component {\n static displayName = 'React.Formutil.Form';\n\n static propTypes = {\n render: PropTypes.func,\n component: PropTypes.func,\n children(props, ...args) {\n let pt = PropTypes.oneOfType([PropTypes.func, PropTypes.node]);\n\n if (!props.render && !props.component) {\n pt = pt.isRequired;\n }\n\n return pt(props, ...args);\n },\n $defaultValues: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $defaultStates: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $onFormChange: PropTypes.func,\n $validator: PropTypes.func,\n $processer: PropTypes.func,\n $ref: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n current: PropTypes.any\n })\n ])\n };\n\n static defaultProps = {\n $defaultValues: {},\n $defaultStates: {}\n };\n\n $$formPending;\n $$formValidatePromise;\n\n $$registers = {};\n $$deepRegisters = {};\n\n constructor(props) {\n super(props);\n\n this.$$defaultInitialize();\n }\n\n getFormContext() {\n return {\n $$registers: this.$$registers,\n $$register: this.$$register,\n $$unregister: this.$$unregister,\n $$onChange: this.$$onChange,\n $$getDefault: this.$$getDefault,\n $formutil: this.$formutil\n };\n }\n\n $$regDuplications = {};\n $$duplicateTimer;\n $$checkDuplication = () => {\n const { $$regDuplications } = this;\n let hasDup;\n\n utils.objectEach($$regDuplications, ([$curRegistered, $handler], name) => {\n warning($curRegistered.$$reserved, `The Field with a name '${name}' has been registered!`);\n\n $handler.$$reset($curRegistered.$getState());\n\n hasDup = delete $$regDuplications[name];\n });\n\n if (hasDup) {\n this.$render();\n }\n };\n\n /*\n * @desc 注册或者替换(preName)Field\n */\n $$register = (name, $handler, prevName) => {\n this.$$unregister(prevName, $handler);\n\n if (name) {\n const $curRegistered = this.$$getRegister(name);\n\n if ($curRegistered) {\n cancelFrame(this.$$duplicateTimer);\n\n this.$$regDuplications[name] = [$curRegistered, $handler];\n this.$$duplicateTimer = requestFrame(this.$$checkDuplication);\n } else {\n this.$$fieldChangedQueue.push({\n name,\n $newValue: $handler.$getState().$value\n });\n\n utils.objectClear(this.$$defaultValues, name);\n }\n\n this.$$registers[($handler.$name = name)] = $handler;\n\n this.createDeepRegisters();\n this.$render();\n }\n };\n\n $$unregister = (name, $handler, $$reserved) => {\n if (name) {\n if (name in this.$$regDuplications) {\n const [$curRegistered, $handler] = this.$$regDuplications[name];\n\n this.$$fieldChangedQueue.push({\n name,\n $newValue: $handler.$getState().$value,\n $prevValue: $curRegistered.$getState().$value\n });\n\n delete this.$$regDuplications[name];\n } else if (this.$$registers[name] === $handler) {\n if ($$reserved) {\n $handler.$$reserved = true;\n } else {\n delete this.$$registers[name];\n\n this.$$fieldChangedQueue.push({\n name,\n $prevValue: $handler.$getState().$value\n });\n\n utils.objectClear(this.$$defaultValues, name);\n }\n }\n\n this.createDeepRegisters();\n this.$render();\n }\n };\n\n $$defaultInitialize = () => {\n const { $defaultValues, $defaultStates } = this.props;\n\n this.$$defaultValues = this.$$deepParseObject(\n utils.deepClone(utils.isFunction($defaultValues) ? $defaultValues(this.props) || {} : $defaultValues)\n );\n this.$$defaultStates = this.$$deepParseObject(\n utils.deepClone(utils.isFunction($defaultStates) ? $defaultStates(this.props) || {} : $defaultStates)\n );\n };\n\n $$getDefault = () => ({\n $$defaultStates: this.$$defaultStates,\n $$defaultValues: this.$$defaultValues\n });\n\n $$deepParseObject(mayWeakObj, deepObj = {}) {\n utils.objectEach(mayWeakObj, (data, name) => utils.parsePath(deepObj, name, data));\n\n return deepObj;\n }\n\n $$triggerChangeTimer;\n $$fieldChangedQueue = [];\n $$triggerFormChange = () => {\n if (this.$$fieldChangedQueue.length) {\n const $$fieldChangedQueue = [...this.$$fieldChangedQueue];\n\n this.$$fieldChangedQueue.length = 0;\n\n const $newValues = {};\n const $prevValues = {};\n const $$registers = this.$$registers;\n let hasFormChanged = false;\n\n $$fieldChangedQueue.forEach(item => {\n if (!(item.name in $$registers)) {\n delete item.$newValue;\n }\n\n if (item.$newValue !== item.$prevValue) {\n if ('$newValue' in item && '$prevValue' in item) {\n const $handler = this.$$getRegister(item.name);\n\n if ($handler) {\n $handler.$$triggerChange(item);\n }\n }\n\n '$newValue' in item && utils.parsePath($newValues, item.name, item.$newValue);\n '$prevValue' in item && utils.parsePath($prevValues, item.name, item.$prevValue);\n\n hasFormChanged = true;\n }\n });\n\n if (hasFormChanged) {\n if (utils.isFunction(this.props.$validator)) {\n this.$$formValidate();\n }\n\n if (utils.isFunction(this.props.$onFormChange)) {\n this.props.$onFormChange(this.$formutil, $newValues, $prevValues);\n }\n }\n }\n };\n\n createDeepRegisters = () => (this.$$deepRegisters = this.$$deepParseObject(this.$$registers));\n\n $$getRegister = name => {\n if (name) {\n const field = this.$$registers[name] || utils.parsePath(this.$$deepRegisters, name);\n\n if (field) {\n return field;\n }\n }\n };\n\n $$formValidate = callback =>\n (this.$$formValidatePromise = new Promise(resolve => {\n const { $validator } = this.props;\n\n let $breakAsyncHandler;\n let $shouldCancelPrevAsyncValidate;\n let prevCallback;\n let validation;\n\n const result = $validator(this.$formutil.$params, this.formtutil);\n const execCallback = $formutil =>\n resolve(utils.runCallback(callback, utils.runCallback(prevCallback, $formutil)));\n\n if (utils.isPromise(result)) {\n if (!this.$$formPending) {\n this.$$formPending = true;\n\n this.$render();\n }\n\n $shouldCancelPrevAsyncValidate = setCallback => ($breakAsyncHandler = setCallback(execCallback));\n\n validation = result\n .then(() => void 0, reason => reason)\n .then(reason => {\n if ($breakAsyncHandler) {\n return $breakAsyncHandler;\n }\n\n this.$shouldCancelPrevAsyncValidate = null;\n\n this.$$formPending = false;\n\n return this.$$setFormErrors(reason, execCallback);\n });\n } else {\n if (this.$$formPending) {\n this.$$formPending = false;\n }\n\n validation = this.$$setFormErrors(result, execCallback);\n }\n\n if (this.$shouldCancelPrevAsyncValidate) {\n this.$shouldCancelPrevAsyncValidate(callback => {\n prevCallback = callback;\n\n return validation;\n });\n }\n\n this.$shouldCancelPrevAsyncValidate = $shouldCancelPrevAsyncValidate;\n }));\n\n $$setFormErrors = (validResults, callback) => {\n if (validResults && (validResults instanceof Error || typeof validResults !== 'object')) {\n warning(\n false,\n `The result of $validator in should always return None(null,undefined) or an object contains error message of Field.`\n );\n\n return this.$render(callback);\n }\n\n return this.$$setStates(\n validResults || {},\n (result, handler) => {\n const { $error = {} } = handler.$getState();\n\n if (result) {\n return {\n $error: {\n ...$error,\n [FORM_VALIDATE_RESULT]: result\n }\n };\n }\n\n if ($error[FORM_VALIDATE_RESULT]) {\n delete $error[FORM_VALIDATE_RESULT];\n\n return {\n $error\n };\n }\n\n return;\n },\n callback,\n true\n );\n };\n\n $getField = name => {\n const field = this.$$getRegister(name);\n\n warning(!name || field, `$getField('${name}') fail to find the matched Field. Maybe it has been unmounted.`);\n warning(name, `You should pass a name of the mounted Field to $getField().`);\n\n if (field) {\n return field.$new();\n }\n };\n\n $$onChange = (name, $state, callback) =>\n this.$setStates(\n {\n [name]: $state\n },\n callback\n );\n\n $$setStates = ($stateTree = {}, processer, callback, force) => {\n const $parsedTree = this.$$deepParseObject($stateTree);\n let hasStateChange = false;\n\n utils.objectEach(this.$$registers, (handler, name) => {\n const data = name in $stateTree ? $stateTree[name] : utils.parsePath($parsedTree, name);\n\n if (!utils.isUndefined(data) || force) {\n const $newState = processer(data, handler);\n\n if ($newState) {\n const $prevValue = this.$formutil.$weakParams[name];\n const { $value: $newValue } = handler.$$merge($newState);\n\n handler.$$detectChange($newState);\n\n if ('$value' in $newState || '$viewValue' in $newState) {\n const findItem = utils.arrayFind(this.$$fieldChangedQueue, item => item.name === name);\n\n if (findItem) {\n if (!('$prevValue' in findItem)) {\n findItem.$prevValue = findItem.$newValue;\n }\n\n findItem.$newValue = $newValue;\n } else {\n this.$$fieldChangedQueue.push({\n name,\n $newValue,\n $prevValue\n });\n }\n }\n\n hasStateChange = true;\n }\n }\n });\n\n if (hasStateChange) {\n return this.$render(callback);\n }\n\n return Promise.resolve(utils.runCallback(callback, this.$formutil));\n };\n\n componentDidMount() {\n utils.createRef(this.props.$ref, this.$formutil);\n }\n\n componentDidUpdate(prevProps) {\n utils.createRef(this.props.$ref, this.$formutil);\n\n cancelFrame(this.$$triggerChangeTimer);\n\n // ensure this calls to access the newest $formutil\n this.$$triggerChangeTimer = requestFrame(() => {\n this.$$triggerFormChange();\n });\n }\n\n componentWillUnmount() {\n utils.createRef(this.props.$ref, null);\n }\n\n $render = callback =>\n new Promise(resolve => this.forceUpdate(() => resolve(utils.runCallback(callback, this.$formutil))));\n\n $validates = (...args) => {\n let callback;\n\n if (utils.isFunction(args[args.length - 1])) {\n callback = args.pop();\n }\n\n if (args.length) {\n const flatter = names => {\n names.forEach(name => {\n if (Array.isArray(name)) {\n flatter(name);\n } else {\n const handler = this.$getField(name);\n\n if (handler) {\n handler.$validate();\n }\n }\n });\n };\n\n flatter(args);\n } else {\n utils.objectEach(this.$$registers, handler => handler.$validate());\n\n if (utils.isFunction(this.props.$validator)) {\n this.$$formValidate();\n }\n }\n\n return this.$onValidates(callback);\n };\n\n $onValidates = callback => {\n const filedValidatePromises = Object.keys(this.$$registers).map(name => this.$$registers[name].$onValidate());\n\n filedValidatePromises.push(this.$$formValidatePromise);\n\n return Promise.all(filedValidatePromises).then(() => utils.runCallback(callback, this.$formutil));\n };\n\n $validate = (name, callback) => {\n const handler = this.$getField(name);\n\n if (handler) {\n return handler.$validate(callback);\n }\n\n return utils.runCallback(callback);\n };\n\n $reset = ($stateTree, callback) => {\n this.$$defaultInitialize();\n\n if (utils.isFunction($stateTree)) {\n callback = $stateTree;\n $stateTree = {};\n }\n\n return this.$$setStates($stateTree, ($state, handler) => handler.$$reset($state), callback, true);\n };\n\n $setStates = ($stateTree, callback) => this.$$setStates($stateTree, $state => $state, callback);\n\n $setValues = ($valueTree, callback) => {\n this.$$deepParseObject(utils.deepClone($valueTree), this.$$defaultValues);\n\n return this.$$setStates($valueTree, $value => ({ $value }), callback);\n };\n\n $setFocuses = ($focusedTree, callback) => this.$$setStates($focusedTree, $focused => ({ $focused }), callback);\n $setDirts = ($dirtyTree, callback) => this.$$setStates($dirtyTree, $dirty => ({ $dirty }), callback);\n $setTouches = ($touchedTree, callback) => this.$$setStates($touchedTree, $touched => ({ $touched }), callback);\n $setPendings = ($pendingTree, callback) => this.$$setStates($pendingTree, $pending => ({ $pending }), callback);\n $setErrors = ($errorTree, callback) => this.$$setStates($errorTree, $error => ({ $error }), callback);\n\n $batchState = ($state, callback) => this.$setStates(utils.objectMap(this.$$registers, () => $state), callback);\n $batchDirty = ($dirty, callback) =>\n this.$batchState(\n {\n $dirty\n },\n callback\n );\n\n $batchTouched = ($touched, callback) =>\n this.$batchState(\n {\n $touched\n },\n callback\n );\n\n $batchFocused = ($focused, callback) =>\n this.$batchState(\n {\n $focused\n },\n callback\n );\n\n $batchPending = ($pending, callback) =>\n this.$batchState(\n {\n $pending\n },\n callback\n );\n\n $batchError = ($error, callback) =>\n this.$batchState(\n {\n $error\n },\n callback\n );\n\n _render() {\n const $formutil = this.$formutil;\n let { children, render, component } = this.props;\n\n if (component) {\n return createElement(component, { $formutil });\n }\n\n if (utils.isFunction(render)) {\n return render($formutil);\n }\n\n if (utils.isFunction(children)) {\n return children($formutil);\n }\n\n return Children.map(children, child =>\n child && utils.isFunction(child.type)\n ? cloneElement(child, {\n $formutil\n })\n : child\n );\n }\n\n render() {\n const { $processer } = this.props;\n const $stateArray = Object.keys(this.$$registers).map(path => ({\n path,\n $state: this.$$registers[path].$getState()\n }));\n\n const $weakParams = utils.toObject($stateArray, ($params, { path, $state }) => {\n if ($processer) {\n $processer($state, path);\n }\n\n if ('$value' in $state && ($state.$dirty || !utils.isUndefined($state.$value))) {\n $params[path] = $state.$value;\n }\n });\n\n const $pureParams = utils.toObject(\n $stateArray,\n ($params, { path, $state }) => path in $weakParams && utils.parsePath($params, path, $weakParams[path])\n );\n\n const $invalid = $stateArray.some(({ $state }) => $state.$invalid);\n const $dirty = $stateArray.some(({ $state }) => $state.$dirty);\n const $touched = $stateArray.some(({ $state }) => $state.$touched);\n const $focused = $stateArray.some(({ $state }) => $state.$focused);\n const $pending = this.$$formPending || $stateArray.some(({ $state }) => $state.$pending);\n\n const $formutil = (this.$formutil = {\n $$registers: { ...this.$$registers },\n $$deepRegisters: this.$$deepRegisters,\n $states: utils.toObject($stateArray, ($states, { path, $state }) => utils.parsePath($states, path, $state)),\n $params: {\n ...this.$$defaultValues,\n ...$pureParams\n },\n $errors: utils.toObject($stateArray, ($errors, { path, $state }) => {\n if ($state.$invalid) {\n utils.parsePath($errors, path, $state.$error);\n }\n }),\n $dirts: utils.toObject($stateArray, ($dirts, { path, $state }) =>\n utils.parsePath($dirts, path, $state.$dirty)\n ),\n $touches: utils.toObject($stateArray, ($touches, { path, $state }) =>\n utils.parsePath($touches, path, $state.$touched)\n ),\n $focuses: utils.toObject($stateArray, ($focuses, { path, $state }) =>\n utils.parsePath($focuses, path, $state.$focused)\n ),\n $pendings: utils.toObject($stateArray, ($pendings, { path, $state }) =>\n utils.parsePath($pendings, path, $state.$pending)\n ),\n\n $weakStates: utils.toObject($stateArray, ($states, { path, $state }) => ($states[path] = $state)),\n $weakParams,\n $weakErrors: utils.toObject($stateArray, ($errors, { path, $state }) => {\n if ($state.$invalid) {\n $errors[path] = $state.$error;\n }\n }),\n $weakDirts: utils.toObject($stateArray, ($dirts, { path, $state }) => ($dirts[path] = $state.$dirty)),\n $weakTouches: utils.toObject(\n $stateArray,\n ($touches, { path, $state }) => ($touches[path] = $state.$touched)\n ),\n $weakFocuses: utils.toObject(\n $stateArray,\n ($focuses, { path, $state }) => ($focuses[path] = $state.$focused)\n ),\n $weakPendings: utils.toObject(\n $stateArray,\n ($weakPendings, { path, $state }) => ($weakPendings[path] = $state.$pending)\n ),\n\n $getFirstError(name) {\n if (name) {\n const $fieldutil = $formutil.$getField(name);\n\n return $fieldutil && $fieldutil.$getFirstError();\n }\n\n for (let name in $formutil.$weakErrors) {\n const $fieldError = $formutil.$weakErrors[name];\n\n for (let key in $fieldError) {\n return $fieldError[key] instanceof Error ? $fieldError[key].message : $fieldError[key];\n }\n }\n },\n\n $render: this.$render,\n\n $getField: this.$getField,\n $onValidates: this.$onValidates,\n\n // get the newest $formutil\n $new: () => this.$formutil,\n\n $setStates: this.$setStates,\n $setValues: this.$setValues,\n $setErrors: this.$setErrors,\n $setTouches: this.$setTouches,\n $setDirts: this.$setDirts,\n $setFocuses: this.$setFocuses,\n\n $batchState: this.$batchState,\n $batchTouched: this.$batchTouched,\n $batchDirty: this.$batchDirty,\n $batchFocused: this.$batchFocused,\n\n $reset: this.$reset,\n $validates: this.$validates,\n $validate: this.$validate,\n\n $valid: !$invalid,\n $invalid,\n $dirty,\n $pristine: !$dirty,\n $touched,\n $untouched: !$touched,\n $focused,\n $pending\n });\n\n return {this._render()};\n }\n}\n\nexport default Form;\n","import React, { Component } from 'react';\nimport Form from './Form';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withForm(WrappedComponent, config = {}) {\n class FormEnhanced extends Component {\n static displayName =\n 'React.Formutil.withForm.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n const { ...others } = this.props;\n const { component, ...formProps } = this.props;\n\n ['$defaultStates', '$defaultValues', '$onFormChange', '$validator', '$processer', '$ref'].forEach(prop => {\n if (prop in others) {\n if (prop === '$defaultStates' || prop === '$defaultValues') {\n formProps[prop] = { ...config[prop], ...others[prop] };\n }\n delete others[prop];\n }\n });\n\n return (\n }\n />\n );\n }\n }\n\n return hoistStatics(FormEnhanced, WrappedComponent);\n}\n\nexport default createHOC(withForm);\n","import { Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport * as utils from './utils';\nimport warning from 'warning';\nimport { FORM_VALIDATE_RESULT } from './Form';\n\nlet FIELD_UUID = 0;\nconst $baseState = {\n $valid: true,\n $invalid: false,\n\n $dirty: false,\n $pristine: true,\n\n $touched: false,\n $untouched: true,\n\n $focused: false,\n\n $pending: false,\n\n $error: {}\n};\n\nfunction isError(result) {\n return /*!utils.isUndefined(result) && */ result !== true;\n}\n\nfunction warningValidatorReturn(result, key, name) {\n warning(\n !utils.isUndefined(result),\n `You should return a string or Error when the validation('${name &&\n name + ': '}${key}') failed, otherwise return true.`\n );\n}\n\nexport const propTypes =\n process.env.NODE_ENV !== 'production'\n ? {\n name: PropTypes.string,\n\n $defaultValue: PropTypes.any,\n $defaultState: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $onFieldChange: PropTypes.func,\n $validators: PropTypes.object,\n $asyncValidators: PropTypes.object,\n $validateLazy: PropTypes.bool,\n $reserveOnUnmount: PropTypes.bool,\n $ref: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n current: PropTypes.any\n })\n ]),\n $parser: PropTypes.func,\n $formatter: PropTypes.func,\n\n render: PropTypes.func,\n component: PropTypes.func,\n children(props, ...args) {\n let pt = PropTypes.oneOfType([PropTypes.func, PropTypes.node]);\n\n if (!props.render && !props.component && props.children !== null) {\n pt = pt.isRequired;\n }\n\n return pt(props, ...args);\n }\n }\n : undefined;\n\nexport const displayName = 'React.Formutil.Field';\n\nexport function GET_FIELD_UUID() {\n return FIELD_UUID++;\n}\n\nexport function renderField($fieldutil, props) {\n let { children, render, component } = props;\n\n if (component) {\n return createElement(component, { $fieldutil });\n }\n\n if (utils.isFunction(render)) {\n return render($fieldutil);\n }\n\n if (utils.isFunction(children)) {\n return children($fieldutil);\n }\n\n return Children.map(children, child =>\n child && utils.isFunction(child.type)\n ? cloneElement(child, {\n $fieldutil\n })\n : child\n );\n}\n\nexport function createHandler($this, owner) {\n const $fieldHandler = {\n $$FIELD_UUID: $this.$$FIELD_UUID,\n\n $$reset,\n $$merge,\n $$detectChange,\n $$triggerChange,\n $onValidate,\n\n $new() {\n return $this.$fieldutil;\n },\n $picker: $getState,\n $getState,\n // not support in Hooks\n $getComponent() {\n return owner;\n },\n\n $reset($state, callback) {\n return $this.$setState($$reset($state), callback);\n },\n $getFirstError,\n $validate,\n $setState: $this.$setState,\n $render,\n $setValue,\n $setTouched,\n $setDirty,\n $setFocused,\n $setValidity,\n $setError,\n $setPending\n };\n\n let $$validatePromise;\n\n function $$detectChange($newState) {\n if ('$value' in $newState || '$viewValue' in $newState) {\n $validate();\n }\n }\n\n function $$triggerChange({ $newValue, $prevValue }) {\n const { $onFieldChange } = $this.props;\n\n if (utils.isFunction($onFieldChange)) {\n $onFieldChange($newValue, $prevValue, $this.$formContext.$formutil);\n }\n }\n\n function $onValidate(callback) {\n $$validatePromise.then(callback);\n\n return $$validatePromise;\n }\n\n function $$reset($newState) {\n let $initialState;\n\n const { props, $formContext } = $this;\n\n if ($formContext.$$getDefault) {\n const $name = props.name;\n const { $$defaultStates, $$defaultValues } = $formContext.$$getDefault();\n\n if ($name && $$defaultValues) {\n const $initialValue = utils.parsePath($$defaultValues, $name);\n\n $initialState = utils.parsePath($$defaultStates, $name) || {};\n\n if (!utils.isUndefined($initialValue)) {\n $initialState.$value = $initialValue;\n }\n }\n }\n\n const { $defaultValue, $defaultState } = props;\n\n return $$merge({\n ...$baseState, // the base state\n ...(utils.isFunction($defaultState) ? $defaultState(props) : $defaultState), // self default state\n $value: utils.isFunction($defaultValue)\n ? $defaultValue(props)\n : '$defaultValue' in props\n ? $defaultValue\n : '',\n ...$initialState, // the default state from Form\n ...$newState\n });\n }\n\n function $getState() {\n return { ...$this.$state };\n }\n\n function $validate(callback) {\n return ($$validatePromise = new Promise(resolve => {\n const { props, $formContext } = $this;\n const $validators = { ...props.$validators, ...props.$asyncValidators };\n const {\n $value,\n $pending,\n $error: { ...$newError }\n } = $this.$state;\n const { $formutil } = $formContext;\n const $validError = {};\n let $skipRestValidate = false;\n let $breakAsyncHandler;\n let $shouldCancelPrevAsyncValidate;\n let prevCallback;\n let validation;\n\n delete $newError[FORM_VALIDATE_RESULT];\n\n const $validatePromises = Object.keys($validators).reduce((promises, key) => {\n delete $newError[key];\n\n if (!$skipRestValidate && props[key] != null) {\n const result = $validators[key]($value, props[key], {\n ...props,\n $formutil,\n $fieldutil: $this.$fieldutil,\n $validError\n });\n\n if (utils.isPromise(result)) {\n promises.push(\n // @ts-ignore\n result.catch(reason => {\n if (!$breakAsyncHandler) {\n $setValidity(key, reason || key);\n }\n })\n );\n } else if (isError(result)) {\n $validError[key] = result || key;\n\n warningValidatorReturn(result, key, props.name);\n\n if (props.$validateLazy) {\n $skipRestValidate = true;\n }\n }\n }\n\n return promises;\n }, []);\n const execCallback = $fieldutil =>\n resolve(utils.runCallback(callback, utils.runCallback(prevCallback, $fieldutil)));\n\n if ($validatePromises.length) {\n if (!$pending) {\n $setPending(true);\n }\n\n $shouldCancelPrevAsyncValidate = setCallback => ($breakAsyncHandler = setCallback(execCallback));\n\n $validatePromises.push(\n $setError({\n ...$newError,\n ...$validError\n })\n );\n\n validation = Promise.all($validatePromises).then(() => {\n if ($breakAsyncHandler) {\n return $breakAsyncHandler;\n }\n\n $this.$shouldCancelPrevAsyncValidate = null;\n\n return $setPending(false, execCallback);\n });\n } else {\n if ($pending) {\n $setPending(false);\n }\n\n validation = $setError(\n {\n ...$newError,\n ...$validError\n },\n execCallback\n );\n }\n\n if ($this.$shouldCancelPrevAsyncValidate) {\n $this.$shouldCancelPrevAsyncValidate(callback => {\n prevCallback = callback;\n\n return validation;\n });\n }\n\n $this.$shouldCancelPrevAsyncValidate = $shouldCancelPrevAsyncValidate;\n }));\n }\n\n function $render($viewValue, callback) {\n return $this.$setState(\n {\n $viewValue,\n $dirty: true\n },\n callback\n );\n }\n\n function $setValue($value, callback) {\n return $this.$setState(\n {\n $value\n },\n callback\n );\n }\n\n function $setTouched($touched, callback) {\n return $this.$setState(\n {\n $touched\n },\n callback\n );\n }\n\n function $setDirty($dirty, callback) {\n return $this.$setState(\n {\n $dirty\n },\n callback\n );\n }\n\n function $setFocused($focused, callback) {\n return $this.$setState(\n {\n $focused\n },\n callback\n );\n }\n\n function $setError($error, callback) {\n return $this.$setState(\n {\n $error\n },\n callback\n );\n }\n\n function $setValidity(key, result = true, callback) {\n const {\n $error: { ...$newError }\n } = $this.$state;\n\n if (isError(result)) {\n $newError[key] = result || key;\n\n warningValidatorReturn(result, key, $this.props.name);\n } else {\n delete $newError[key];\n }\n\n return $setError($newError, callback);\n }\n\n function $setPending($pending, callback) {\n return $this.$setState(\n {\n $pending\n },\n callback\n );\n }\n\n function $getFirstError() {\n const { $error = {} } = $this.$state;\n\n for (let name in $error) {\n return $error[name] instanceof Error ? $error[name].message : $error[name];\n }\n }\n\n function $$merge({ ...$newState }) {\n if ('$error' in $newState) {\n if (!$newState.$error) {\n $newState.$error = {};\n }\n\n $newState.$valid = Object.keys($newState.$error).length === 0;\n }\n\n // process $value\n const { $parser, $formatter } = $this.props;\n\n if ('$viewValue' in $newState && !('$value' in $newState)) {\n const $setViewValue = $value => ($newState.$viewValue = $value);\n\n $newState.$value = $parser ? $parser($newState.$viewValue, $setViewValue) : $newState.$viewValue;\n } else if ('$value' in $newState && !('$viewValue' in $newState)) {\n const $setModelValue = $value => ($newState.$value = $value);\n\n $newState.$viewValue = $formatter ? $formatter($newState.$value, $setModelValue) : $newState.$value;\n }\n\n // process $valid/$invalid\n if ('$valid' in $newState) {\n $newState.$invalid = !$newState.$valid;\n } else if ('$invalid' in $newState) {\n $newState.$dirty = !$newState.$invalid;\n }\n\n // process $dirty/$pristine\n if ('$dirty' in $newState) {\n $newState.$pristine = !$newState.$dirty;\n } else if ('$pristine' in $newState) {\n $newState.$dirty = !$newState.$pristine;\n }\n\n // process $touched/$untouched\n if ('$touched' in $newState) {\n $newState.$untouched = !$newState.$touched;\n } else if ('$untouched' in $newState) {\n $newState.$touched = !$newState.$untouched;\n }\n\n $this.$state = { ...$this.$state, ...$newState };\n\n return $getState();\n }\n\n return $fieldHandler;\n}\n","import React, { Component } from 'react';\nimport { createHandler, GET_FIELD_UUID, propTypes, displayName, renderField } from './fieldHelper';\nimport FormContext from './context';\nimport warning from 'warning';\nimport { runCallback, createRef } from './utils';\n\nclass Field extends Component {\n static displayName = displayName;\n static propTypes = propTypes;\n\n $$FIELD_UUID = GET_FIELD_UUID();\n\n /** @type { any } */\n $formContext;\n /** @type { any } */\n $state;\n\n componentDidMount() {\n this.isMounting = true;\n\n const {\n props: { name: $name },\n $formContext\n } = this;\n\n warning(\n !$name || $formContext.$formutil,\n `You should enusre that the with the name '${$name}' must be used underneath a component or withForm() HOC, otherwise it's isolated.`\n );\n\n warning($name, `You should assign a name to , otherwise it will be isolated!`);\n\n if ($formContext.$$register) {\n $formContext.$$register($name, this.$fieldHandler);\n }\n\n this.$prevValue = this.$state.$value;\n\n createRef(this.props.$ref, this.$fieldutil);\n }\n\n componentWillUnmount() {\n if (this.$formContext.$$unregister) {\n this.$formContext.$$unregister(this.props.name, this.$fieldHandler, this.props.$reserveOnUnmount);\n }\n\n this.isMounting = false;\n\n createRef(this.props.$ref, null);\n }\n\n componentDidUpdate(prevProps) {\n const $name = this.props.name;\n\n if ($name !== prevProps.name) {\n if (this.$formContext.$$register) {\n this.$formContext.$$register($name, this.$fieldHandler, prevProps.name);\n }\n }\n\n createRef(this.props.$ref, this.$fieldutil);\n\n if (this.$state.$value !== this.$prevValue) {\n if (!($name in (this.$formContext.$$registers || {}))) {\n this.$registered.$$triggerChange({\n $newValue: this.$state.$value,\n $prevValue: this.$prevValue\n });\n }\n\n this.$prevValue = this.$state.$value;\n }\n }\n\n $setState = ($newState, callback) =>\n new Promise(resolve => {\n const execute = () => resolve(runCallback(callback, this.$fieldutil));\n\n if (this.isMounting) {\n const $name = this.props.name;\n\n if ($name in (this.$formContext.$$registers || {})) {\n this.$formContext.$$onChange($name, $newState, execute);\n } else {\n this.$registered.$$merge($newState);\n\n this.$registered.$$detectChange($newState);\n\n this.forceUpdate(execute);\n }\n } else {\n this.$registered.$$merge($newState);\n execute();\n }\n });\n\n _render() {\n const $fieldutil = (this.$fieldutil = {\n $name: this.props.name,\n ...this.$registered.$getState(),\n ...this.$registered,\n $$formutil: this.$formContext.$formutil\n });\n\n return renderField($fieldutil, this.props);\n }\n\n render() {\n const shouldInitial = !this.$formContext;\n\n return (\n \n {context => {\n this.$formContext = context;\n\n if (!this.$fieldHandler) {\n this.$fieldHandler = createHandler(this, this);\n }\n\n this.$registered = (context.$$registers || {})[this.$fieldHandler.$name] || this.$fieldHandler;\n\n if (shouldInitial) {\n this.$fieldHandler.$$reset();\n this.$fieldHandler.$validate();\n }\n\n return this._render();\n }}\n \n );\n }\n}\n\nexport default Field;\n","import React, { Component } from 'react';\nimport Field from './Field';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withField(WrappedComponent, config = {}) {\n class FieldEnhanced extends Component {\n static displayName =\n 'React.Formutil.withField.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n const { ...others } = this.props;\n const { component, ...fieldProps } = this.props;\n\n [\n '$validators',\n '$asyncValidators',\n '$validateLazy',\n '$reserveOnUnmount',\n '$defaultValue',\n '$defaultState',\n '$onFieldChange',\n '$parser',\n '$formatter',\n '$ref',\n 'name'\n ]\n .concat(\n Object.keys({\n ...config.$validators,\n ...config.$asyncValidators,\n ...others.$validators,\n ...others.$asyncValidators\n })\n )\n .forEach(prop => {\n if (prop in others) {\n if (prop === '$validators' || prop === '$asyncValidators' || prop === '$defaultState') {\n fieldProps[prop] = { ...config[prop], ...others[prop] };\n }\n delete others[prop];\n }\n });\n\n return (\n }\n />\n );\n }\n }\n\n return hoistStatics(FieldEnhanced, WrappedComponent);\n}\n\nexport default createHOC(withField);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nclass EasyFieldNative extends Component {\n static displayName = 'React.Formutil.EasyField.Native';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n\n value: PropTypes.any,\n name: PropTypes.string,\n type: PropTypes.string,\n\n checked: PropTypes.any,\n unchekced: PropTypes.any\n };\n\n static defaultProps = {\n value: '',\n type: 'text',\n checked: true,\n unchecked: false\n };\n\n render() {\n const { $fieldutil, value: htmlValue, onChange, onFocus, onBlur, checked, unchecked, ...others } = this.props;\n const htmlType = this.props.type;\n\n let htmlProps = {\n value: 'compositionValue' in this ? this.compositionValue : htmlValue,\n onCompositionEnd: ev => {\n this.composition = false;\n delete this.compositionValue;\n htmlProps.onChange(ev);\n },\n onCompositionStart: () => (this.composition = true),\n onChange: ev => {\n const { value } = ev.target;\n\n if (this.composition) {\n this.compositionValue = value;\n this.forceUpdate();\n } else {\n onChange(value, ev);\n }\n },\n onFocus,\n onBlur\n };\n let Element = 'input';\n\n switch (htmlType) {\n case 'select':\n Element = htmlType;\n htmlProps.onChange = ev => {\n const node = ev.target;\n const value = node.multiple\n ? [].slice\n .call(node.options)\n .filter(option => option.selected)\n .map(option => option.value)\n : node.value;\n\n onChange(value, ev);\n };\n\n delete others.type;\n\n break;\n case 'textarea':\n Element = htmlType;\n delete others.type;\n break;\n\n case 'checkbox':\n case 'radio':\n htmlProps = {\n checked: htmlValue === checked,\n onChange: ev => {\n onChange(ev.target.checked ? checked : unchecked, ev);\n },\n onFocus,\n onBlur\n };\n break;\n\n default:\n break;\n }\n\n return ;\n }\n}\n\nexport default EasyFieldNative;\n","import React, { Component, Children, cloneElement, createContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { isFunction } from '../utils';\nimport warning from 'warning';\n\n/** @type {any} */\nconst { Provider, Consumer } = createContext({});\n\nclass EasyFieldGroup extends Component {\n static displayName = 'React.Formutil.EasyField.Group';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n\n value: PropTypes.any,\n name: PropTypes.string,\n type: PropTypes.string.isRequired,\n groupNode: PropTypes.any,\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).isRequired\n };\n\n static defaultProps = {\n type: 'checkbox',\n groupNode: 'div'\n };\n\n getGroupContext() {\n return this.props;\n }\n\n _render() {\n const { className, groupNode: Element, children } = this.props;\n\n const GroupOptionProps = {\n GroupOption: EasyFieldGroupOption,\n Field: DeprecatedEasyFieldGroupOption\n };\n\n const childNodes = isFunction(children)\n ? children(GroupOptionProps)\n : Children.map(children, child => cloneElement(child, GroupOptionProps));\n\n if (Element === null) {\n return childNodes;\n }\n\n return {childNodes};\n }\n\n render() {\n return {this._render()};\n }\n}\n\nclass EasyFieldGroupOption extends Component {\n static displayName = 'React.Formutil.EasyField.Group.Option';\n\n static propTypes = {\n $value: PropTypes.any.isRequired\n };\n\n componentDidMount() {\n warning('$value' in this.props, `You should pass a $value to .`);\n }\n\n render() {\n const { $value, onChange, onFocus, onBlur, ...others } = this.props;\n\n return (\n \n {$groupHander => {\n const { type, name } = $groupHander;\n\n const elemProps =\n type === 'radio'\n ? {\n checked: $groupHander.value === $value,\n onChange: ev => {\n $groupHander.onChange($value, ev);\n\n onChange && onChange(ev);\n }\n }\n : type === 'checkbox'\n ? {\n checked: $groupHander.value.indexOf($value) > -1,\n onChange: ev => {\n $groupHander.onChange(\n ev.target.checked\n ? $groupHander.value.concat($value)\n : $groupHander.value.filter(value => value !== $value),\n ev\n );\n\n onChange && onChange(ev);\n }\n }\n : {\n value: $groupHander.value,\n onChange: ev => {\n $groupHander.onChange(ev);\n\n onChange && onChange(ev);\n }\n };\n\n return (\n {\n $groupHander.onFocus(ev);\n onFocus && onFocus(ev);\n }}\n onBlur={ev => {\n $groupHander.onBlur(ev);\n onBlur && onBlur(ev);\n }}\n />\n );\n }}\n \n );\n }\n}\n\nclass DeprecatedEasyFieldGroupOption extends Component {\n static displayName = 'React.Formutil.EasyField.Group.Option.Deprecated';\n\n componentDidMount() {\n warning(\n false,\n `The \"Field\" property in EasyField's children-props has been deprecated. Please use \"GroupOption\" instead.`\n );\n }\n\n render() {\n return ;\n }\n}\n\nexport default EasyFieldGroup;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport isEqual from 'react-fast-compare';\nimport Form from '../Form';\nimport Field from '../Field';\nimport { isUndefined, isFunction, runCallback } from '../utils';\n\nconst Wrapper = React.Frament || 'div';\n\nclass EasyFieldList extends Component {\n static displayName = 'React.Formutil.EasyField.List';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n value: PropTypes.array,\n\n children: PropTypes.func.isRequired\n };\n\n id = 0;\n latestValue = this.props.value;\n $formutil;\n\n constructor(props) {\n super(props);\n\n this.state = {\n items: props.value.length ? props.value.map(() => this.getId()) : [this.getId()],\n formKey: 0\n };\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.value !== this.latestValue) {\n this.setState({\n items: this.props.value.length ? this.props.value.map(() => this.getId()) : [this.getId()],\n formKey: this.state.formKey + 1\n });\n\n this.latestValue = this.props.value;\n }\n }\n\n getId(values) {\n return {\n id: this.id++,\n values\n };\n }\n\n FieldValidators = {\n required(value) {\n return value !== null;\n }\n };\n\n $onFormChange = $formutil => {\n $formutil.$onValidates($formutil => {\n const { $invalid, $params } = $formutil;\n\n if ($invalid) {\n if (this.props.value.length) {\n this.props.onChange((this.latestValue = []));\n }\n } else if (!isEqual(this.props.value, $params.list)) {\n this.props.onChange((this.latestValue = $params.list));\n }\n });\n };\n\n swap = (m, n, callback) =>\n this.$setState(({ items }) => {\n [items[n], items[m]] = [items[m], items[n]];\n\n return items;\n }, callback);\n\n insert = (...args) => {\n let m, values, callback;\n\n args.forEach(arg => {\n if (isFunction(arg)) {\n callback = arg;\n } else if (typeof arg === 'number') {\n m = arg;\n } else if (typeof arg === 'object') {\n values = arg;\n }\n });\n\n return this.$setState(({ items }) => {\n if (isUndefined(m)) {\n items.push(this.getId(values));\n } else {\n items.splice(m, 0, this.getId(values));\n }\n\n return { items };\n }, callback);\n };\n\n remove = (...args) => {\n let m, callback;\n\n args.forEach(arg => {\n if (isFunction(arg)) {\n callback = arg;\n } else if (typeof arg === 'number') {\n m = arg;\n }\n });\n\n return this.$setState(({ items }) => {\n if (isUndefined(m)) {\n items.pop();\n } else {\n items.splice(m, 1);\n }\n\n if (!items.length) {\n items = [this.getId()];\n }\n\n return { items };\n }, callback);\n };\n\n $setState = (updater, callback) =>\n new Promise(resolve =>\n this.setState(updater, () =>\n this.$formutil.$onValidates($formutil => resolve(runCallback(callback, $formutil)))\n )\n );\n\n render() {\n const { children, onFocus, onBlur, value } = this.props;\n\n if (!isFunction(children)) {\n return null;\n }\n\n const $baseutil = {\n $length: this.state.items.length,\n $insert: this.insert,\n $remove: this.remove,\n $swap: this.swap,\n $push: (values, callback) => this.insert(values, callback),\n $pop: callback => this.remove(callback),\n $shift: callback => this.remove(0, callback),\n $unshift: (values, callback) => this.insert(0, values, callback),\n onFocus,\n onBlur\n };\n\n return (\n {\n this.$formutil = $formutil;\n\n return (\n \n {this.state.items.map(({ id, values }, index) => (\n {\n return (\n \n $formutil.$onValidates($formutil => {\n const { $invalid, $params } = $formutil;\n\n if ($invalid) {\n if ($fieldutil.$viewValue !== null) {\n $fieldutil.$render(null);\n }\n } else if (!isEqual($fieldutil.$viewValue, $params)) {\n $fieldutil.$render($params);\n }\n })\n }\n children={$innerFormutil =>\n children(\n {\n ...$baseutil,\n ...$innerFormutil,\n $index: index,\n $isLast: () => index === this.state.items.length - 1,\n $isFirst: () => index === 0\n },\n $formutil\n )\n }\n />\n );\n }}\n />\n ))}\n \n );\n }}\n />\n );\n }\n}\n\nexport default EasyFieldList;\n","import { Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport Native from './Native';\nimport Group from './Group';\nimport List from './List';\nimport { isEmpty, isUndefined, isFunction, isValidProp } from '../utils';\n\nexport const TYPE = '__TYPE__';\nexport const defaultValidators = [\n [\n 'required',\n ($value, check, { __TYPE__, checked = true }) =>\n __TYPE__ === 'checked' ? $value === checked : !isEmpty($value)\n ],\n ['maxLength', ($value, len) => isEmpty($value) || $value.length <= len],\n ['minLength', ($value, len) => isEmpty($value) || $value.length >= len],\n ['max', ($value, limit) => isEmpty($value) || $value * 1 <= limit],\n ['min', ($value, limit) => isEmpty($value) || $value * 1 >= limit],\n ['pattern', ($value, regexp) => isEmpty($value) || regexp.test($value)],\n ['enum', ($value, enumeration) => isEmpty($value) || enumeration.indexOf($value) > -1],\n ['checker', ($value, checker, props) => checker($value, props)]\n].reduce(($validators, item) => {\n const [validKey, validate] = item;\n $validators[validKey] = function validator($value, propValue, { validMessage = {} }) {\n return validate(...arguments) || validMessage[validKey] || `Error input: ${validKey}`;\n };\n return $validators;\n}, {});\n\nexport const propTypes =\n process.env.NODE_ENV !== 'production'\n ? {\n type: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n component: PropTypes.func,\n render: PropTypes.func,\n\n defaultValue: PropTypes.any,\n validMessage: PropTypes.object,\n\n valuePropName: PropTypes.string,\n changePropName: PropTypes.string,\n focusPropName: PropTypes.string,\n blurPropName: PropTypes.string,\n\n passUtil: PropTypes.string\n }\n : undefined;\n\nexport const displayName = 'React.Formutil.EasyField';\n\nexport const defaultProps = {\n validMessage: {},\n valuePropName: 'value',\n changePropName: 'onChange',\n focusPropName: 'onFocus',\n blurPropName: 'onBlur',\n $parser: value => (typeof value === 'string' ? value.trim() : value)\n};\n\nexport function createHandler($fieldutil, fieldProps, childProps) {\n const { valuePropName, changePropName, focusPropName, blurPropName, passUtil } = fieldProps;\n\n const fetchValueFromEvent = function(ev) {\n return ev && ev.target ? ev.target[valuePropName] : ev;\n };\n\n const $handleProps = {\n ...childProps,\n\n [valuePropName]: $fieldutil.$viewValue,\n [changePropName]: (...args) => {\n let value = args[0];\n let ev = args[args.length - 1];\n\n if (!ev || !ev.target) {\n ev = args;\n } else {\n ev = [ev];\n }\n\n const onChange = fieldProps[changePropName];\n onChange && onChange(...ev);\n\n const newValue = fetchValueFromEvent(value);\n $fieldutil.$render(newValue);\n },\n [focusPropName]: (...args) => {\n const onFocus = fieldProps[focusPropName];\n onFocus && onFocus(...args);\n\n $fieldutil.$setFocused(true);\n },\n [blurPropName]: (...args) => {\n const onBlur = fieldProps[blurPropName];\n onBlur && onBlur(...args);\n\n if ($fieldutil.$untouched) {\n $fieldutil.$setTouched(true);\n }\n\n $fieldutil.$setFocused(false);\n }\n };\n\n if (passUtil) {\n $handleProps[passUtil === true ? '$fieldutil' : passUtil] = $fieldutil;\n }\n\n return $handleProps;\n}\n\nexport function parseProps(props) {\n const {\n children,\n component,\n render,\n\n ...fieldProps\n } = props;\n\n const {\n // filter all the props that accept by EasyField\n name,\n type,\n defaultValue,\n valuePropName,\n changePropName,\n focusPropName,\n blurPropName,\n validMessage,\n __TYPE__,\n passUtil,\n\n // filter all the props that accept by Field\n $defaultValue,\n $defaultState,\n $onFieldChange,\n $validators,\n $asyncValidators,\n $validateLazy,\n $reserveOnUnmount,\n $parser,\n $formatter,\n $ref,\n\n ...childProps\n } = fieldProps;\n\n const renderProps = {\n children,\n component,\n render\n };\n\n const isNative = !isUndefined(type) || (isUndefined(children) && isUndefined(component) && isUndefined(render));\n\n Object.keys({\n ...(fieldProps.$validators = {\n ...defaultValidators,\n ...fieldProps.$validators\n }),\n ...fieldProps.$asyncValidators\n }).forEach(prop => {\n if (prop in childProps) {\n if (!isNative || !isValidProp(prop)) {\n delete childProps[prop];\n }\n }\n });\n\n if (isNative) {\n const [htmlType = 'text', groupType] = (type || '').split('.');\n\n renderProps.component = htmlType === 'group' ? Group : htmlType === 'list' ? List : Native;\n\n // Native or Group need to pass 'name' | 'type' | 'children'\n if (name) {\n childProps.name = name;\n }\n\n if (type) {\n childProps.type = htmlType;\n }\n\n if (children) {\n childProps.children = children;\n }\n\n switch (htmlType) {\n case 'select':\n case 'textarea':\n if (props.multiple) {\n fieldProps[TYPE] = 'array';\n }\n break;\n\n case 'group':\n if (groupType === 'checkbox') {\n fieldProps[TYPE] = 'array';\n }\n\n childProps.type = groupType;\n break;\n\n case 'checkbox':\n case 'radio':\n fieldProps[TYPE] = 'checked';\n break;\n\n case 'list':\n fieldProps[TYPE] = 'array';\n break;\n\n default:\n break;\n }\n }\n\n if (!('$defaultValue' in fieldProps) && 'defaultValue' in props) {\n fieldProps.$defaultValue = defaultValue;\n }\n\n if (!('$defaultValue' in fieldProps) && TYPE in fieldProps) {\n let defaultValue;\n\n switch (fieldProps[TYPE]) {\n case 'checked':\n const { unchecked = false } = fieldProps;\n\n defaultValue = unchecked;\n break;\n\n case 'array':\n defaultValue = [];\n break;\n\n case 'object':\n defaultValue = {};\n break;\n\n case 'number':\n defaultValue = 0;\n break;\n\n case 'empty':\n default:\n break;\n }\n\n fieldProps.$defaultValue = defaultValue;\n }\n\n return {\n fieldProps,\n childProps,\n renderProps\n };\n}\n\nexport function renderField($handleProps, props) {\n let { component, render, children } = props;\n\n if (component) {\n return createElement(component, $handleProps);\n }\n\n if (isFunction(render)) {\n return render($handleProps);\n }\n\n if (isFunction(children)) {\n return children($handleProps);\n }\n\n return Children.map(children, child => cloneElement(child, $handleProps));\n}\n","import React, { Component } from 'react';\nimport Field from '../Field';\nimport { renderField, createHandler, parseProps, displayName, propTypes, defaultProps } from './easyFieldHandler';\n\n/**\n * 提供对浏览器原生表单控件的封装\n * 支持以下类型表单元素:\n * - input[type=xx]\n * - textarea\n * - select\n */\nclass EasyField extends Component {\n static displayName = displayName;\n static propTypes = propTypes;\n static defaultProps = defaultProps;\n\n render() {\n const { fieldProps, childProps, renderProps } = parseProps(this.props);\n\n return (\n renderField(createHandler($fieldutil, fieldProps, childProps), renderProps)}\n />\n );\n }\n}\n\nexport default EasyField;\n","import React, { Component } from 'react';\nimport FormContext from './context';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction connect(WrappedComponent) {\n class Connect extends Component {\n static displayName =\n 'React.Formutil.connect.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n return (\n \n {context => }\n \n );\n }\n }\n\n return hoistStatics(Connect, WrappedComponent);\n}\n\nexport default connect;\n","import React from 'react';\nimport FormContext from '../context';\n\nfunction useFormContext() {\n if (!React.useState) {\n throw new Error(`Hooks api need react@>=16.8, Please upgrade your reactjs.`);\n }\n\n const { useContext } = React;\n const $formContext = useContext(FormContext);\n\n return $formContext;\n}\n\nexport default useFormContext;\n","import React from 'react';\nimport useFormContext from './useFormContext';\nimport { runCallback, createRef } from '../utils';\nimport { createHandler, GET_FIELD_UUID } from '../fieldHelper';\nimport warning from 'warning';\n\n/**\n * @description\n * The custom hook for Field\n *\n * @param {string | object} [name]\n * @param {object} [props]\n *\n * @return {object} $Fieldutil\n */\nfunction useField(name, props = {}) {\n if (!React.useState) {\n throw new Error(`Hooks api need react@>=16.8, Please upgrade your reactjs.`);\n }\n\n const { useState, useLayoutEffect, useRef } = React;\n\n let $name;\n\n if (name) {\n if (typeof name === 'string') {\n $name = name;\n\n props.name = $name;\n } else {\n props = name;\n\n $name = props.name;\n }\n }\n\n const $formContext = useFormContext();\n /** @type {any} */\n const $this = useRef({}).current;\n /** @type {React.MutableRefObject} */\n const callbackRef = useRef([]);\n\n let $registered;\n\n $this.$formContext = $formContext;\n $this.props = props;\n $this.$setState = $setState;\n // we not directly use this $state, just from $this.$state\n const [, setState] = useState(() => {\n $this.$$FIELD_UUID = GET_FIELD_UUID();\n $this.$fieldHandler = $registered = createHandler($this);\n\n const $state = $this.$fieldHandler.$$reset();\n\n $this.$fieldHandler.$validate();\n\n return $state;\n });\n\n if (!$registered) {\n $registered = ($formContext.$$registers || {})[$this.$fieldHandler.$name] || $this.$fieldHandler;\n }\n\n useLayoutEffect(() => {\n const { $state } = $this;\n\n if ($this.isMounting) {\n if (!($name in ($formContext.$$registers || {}))) {\n const { $prevValue } = $this;\n\n $registered.$$triggerChange({\n $newValue: $state.$value,\n $prevValue\n });\n }\n }\n\n $this.$prevValue = $state.$value;\n }, [$this.$state.$value]);\n\n useLayoutEffect(() => {\n $this.isMounting = true;\n\n warning(\n !$name || $formContext.$formutil,\n `You should enusre that the useField() with the name '${$name}' must be used underneath a component or withForm() HOC, otherwise it's isolated.`\n );\n\n warning($name, `You should pass a name argument to useField(), otherwise it will be isolated!`);\n\n return () => {\n $this.isMounting = false;\n\n createRef(props.$ref, null);\n };\n }, []);\n\n useLayoutEffect(() => {\n if ($formContext.$$register) {\n $formContext.$$register($name, $this.$fieldHandler);\n }\n\n return () => {\n if ($formContext.$$unregister) {\n $formContext.$$unregister($name, $this.$fieldHandler, !$this.isMounting && props.$reserveOnUnmount);\n }\n };\n }, [$name]);\n\n // trigger ref callback\n useLayoutEffect(() => {\n createRef(props.$ref, $this.$fieldutil);\n });\n\n useLayoutEffect(() => {\n if (callbackRef.current.length > 0) {\n const callbackQueue = [...callbackRef.current];\n\n callbackRef.current.length = 0;\n\n while (callbackQueue.length) {\n callbackQueue.pop()($this.$fieldutil);\n }\n }\n });\n\n function $setState($newState, callback) {\n return new Promise(resolve => {\n const execute = () => resolve(runCallback(callback, $this.$fieldutil));\n\n if ($this.isMounting) {\n if ($name in ($formContext.$$registers || {})) {\n $formContext.$$onChange($name, $newState, execute);\n } else {\n setState($registered.$$merge($newState));\n\n $registered.$$detectChange($newState);\n\n callbackRef.current.push(execute);\n }\n } else {\n $registered.$$merge($newState);\n execute();\n }\n });\n }\n\n return ($this.$fieldutil = {\n $name,\n ...$registered.$getState(),\n ...$registered,\n $$formutil: $formContext.$formutil\n });\n}\n\nexport default useField;\n","import useFormContext from './useFormContext';\n\nfunction useForm() {\n const { $formutil } = useFormContext();\n\n return $formutil;\n}\n\nexport default useForm;\n","import { createHandler, parseProps, defaultProps } from '../EasyField/easyFieldHandler';\nimport useField from './useField';\n\nfunction useHandler(props) {\n props = { ...defaultProps, ...props, children: null };\n\n const { fieldProps, childProps } = parseProps(props);\n const $fieldutil = useField(fieldProps);\n\n return createHandler($fieldutil, fieldProps, childProps);\n}\n\nexport default useHandler;\n"],"names":["createContext","OBJECT_PROTO","Object","getPrototypeOf","PATH_REGEXP","Root","isUndefined","window","global","arg","isFunction","isEmpty","isPromise","promise","then","isObject","obj","prototype","toString","call","isPlainObj","constructor","deepClone","Array","isArray","newObj","i","j","length","runCallback","callback","args","createHOC","withHOC","WrappedComponent","VALID_PROPS","isValidProp","prop","indexOf","toLowerCase","executeWord","word","exec","Function","err","parsePath","target","path","value","warning","JSON","stringify","pathSymbols","match","map","s","replace","pathWords","split","trim","filter","item","scope","index","len","nextWord","symbol","nextVarWord","error","createRef","ref","current","arrayFind","array","process","objectMap","handler","keys","reduce","key","objectEach","forEach","toObject","arr","TODO_DELETE","undefined","CLEAR","pkey","pobj","every","objectClear","name","FORM_VALIDATE_RESULT","requestFrame","cancelFrame","requestAnimationFrame","cancelAnimationFrame","setTimeout","clearTimeout","Form","props","$$formPending","$$formValidatePromise","$$registers","$$deepRegisters","$$regDuplications","$$duplicateTimer","$$checkDuplication","hasDup","utils","$curRegistered","$handler","$$reserved","$$reset","$getState","$render","$$register","prevName","$$unregister","$$getRegister","$$fieldChangedQueue","push","$newValue","$value","$$defaultValues","$name","createDeepRegisters","$prevValue","$$defaultInitialize","$defaultValues","$defaultStates","$$deepParseObject","$$defaultStates","$$getDefault","$$triggerChangeTimer","$$triggerFormChange","$newValues","$prevValues","hasFormChanged","$$triggerChange","$validator","$$formValidate","$onFormChange","$formutil","field","Promise","resolve","$breakAsyncHandler","$shouldCancelPrevAsyncValidate","prevCallback","validation","result","$params","formtutil","execCallback","setCallback","reason","$$setFormErrors","validResults","Error","$$setStates","$error","$getField","$new","$$onChange","$state","$setStates","$stateTree","processer","force","$parsedTree","hasStateChange","data","$newState","$weakParams","$$merge","$$detectChange","findItem","forceUpdate","$validates","pop","flatter","names","$validate","$onValidates","filedValidatePromises","$onValidate","all","$reset","$setValues","$valueTree","$setFocuses","$focusedTree","$focused","$setDirts","$dirtyTree","$dirty","$setTouches","$touchedTree","$touched","$setPendings","$pendingTree","$pending","$setErrors","$errorTree","$batchState","$batchDirty","$batchTouched","$batchFocused","$batchPending","$batchError","mayWeakObj","deepObj","$ref","prevProps","children","render","component","createElement","Children","child","type","cloneElement","$processer","$stateArray","$pureParams","$invalid","some","$states","$errors","$dirts","$touches","$focuses","$pendings","$weakStates","$weakErrors","$weakDirts","$weakTouches","$weakFocuses","$weakPendings","$getFirstError","$fieldutil","$fieldError","message","$valid","$pristine","$untouched","getFormContext","_render","Component","displayName","propTypes","PropTypes","func","pt","oneOfType","node","isRequired","object","shape","any","defaultProps","withForm","config","FormEnhanced","others","formProps","hoistStatics","FIELD_UUID","$baseState","isError","warningValidatorReturn","string","$defaultValue","$defaultState","$onFieldChange","$validators","$asyncValidators","$validateLazy","bool","$reserveOnUnmount","$parser","$formatter","GET_FIELD_UUID","renderField","createHandler","$this","owner","$fieldHandler","$$FIELD_UUID","$picker","$getComponent","$setState","$setValue","$setTouched","$setDirty","$setFocused","$setValidity","$setError","$setPending","$$validatePromise","$formContext","$initialState","$initialValue","$newError","$validError","$skipRestValidate","$validatePromises","promises","catch","$viewValue","$setViewValue","$setModelValue","Field","execute","isMounting","$registered","$$formutil","shouldInitial","context","withField","FieldEnhanced","fieldProps","concat","EasyFieldNative","htmlValue","onChange","onFocus","onBlur","checked","unchecked","htmlType","htmlProps","compositionValue","onCompositionEnd","ev","composition","onCompositionStart","Element","multiple","slice","options","option","selected","unchekced","Provider","Consumer","EasyFieldGroup","className","groupNode","GroupOptionProps","GroupOption","EasyFieldGroupOption","DeprecatedEasyFieldGroupOption","childNodes","getGroupContext","element","$groupHander","elemProps","Wrapper","React","Frament","EasyFieldList","id","latestValue","FieldValidators","required","isEqual","list","swap","m","n","items","insert","values","getId","splice","remove","updater","setState","state","formKey","$baseutil","$length","$insert","$remove","$swap","$push","$pop","$shift","$unshift","$innerFormutil","$index","$isLast","$isFirst","TYPE","defaultValidators","check","__TYPE__","limit","regexp","test","enumeration","checker","validKey","validate","validator","propValue","validMessage","arguments","defaultValue","valuePropName","changePropName","focusPropName","blurPropName","passUtil","childProps","fetchValueFromEvent","$handleProps","newValue","parseProps","renderProps","isNative","groupType","Group","List","Native","EasyField","connect","Connect","useFormContext","useState","useContext","FormContext","useField","useLayoutEffect","useRef","callbackRef","callbackQueue","useForm","useHandler"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kBAAeA,aAAa,CAAC,EAAD,CAA5B;;ACAA,IAAMC,YAAY,GAAGC,MAAM,CAACC,cAAP,CAAsB,EAAtB,CAArB;AACA,IAAMC,WAAW,GAAG,qCAApB;AACA,IAAMC,IAAI,GAAGC,WAAW,CAACC,MAAD,CAAX,GAAsBC,MAAtB,GAA+BD,MAA5C;AAEA,AAAO,SAASD,WAAT,CAAqBG,GAArB,EAA0B;SACtB,OAAOA,GAAP,KAAe,WAAtB;;AAGJ,AAAO,SAASC,UAAT,CAAoBD,GAApB,EAAyB;SACrB,OAAOA,GAAP,KAAe,UAAtB;;AAGJ,AAAO,SAASE,OAAT,CAAiBF,GAAjB,EAAsB;SAClBH,WAAW,CAACG,GAAD,CAAX,IAAoBA,GAAG,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,OAAZ,CAAoBF,SAApB;QACA6I,OAAO;;KAfR,CAAP;;;SAoBI5B,KAAK,CAAC7C,UAAN;IACJpH,KAAK,EAALA;KACG+L,WAAW,CAAC1M,SAAZ,EAFC,EAGD0M,WAHC;IAIJC,UAAU,EAAEhB,YAAY,CAAC9J;IAJ7B;;;ACjJJ,SAASwS,OAAT,GAAmB;wBACOT,cAAc,EADrB;MACP/R,SADO,mBACPA,SADO;;SAGRA,SAAP;;;ACFJ,SAASyS,UAAT,CAAoBpV,KAApB,EAA2B;EACvBA,KAAK,qBAAQiK,YAAR,EAAyBjK,KAAzB;IAAgCmH,QAAQ,EAAE;IAA/C;;oBAEmC6M,UAAU,CAAChU,KAAD,CAHtB;MAGf8N,UAHe,eAGfA,UAHe;MAGH8F,UAHG,eAGHA,UAHG;;MAIjB/K,UAAU,GAAGiM,QAAQ,CAAChH,UAAD,CAA3B;SAEOrC,eAAa,CAAC5C,UAAD,EAAaiF,UAAb,EAAyB8F,UAAzB,CAApB;;;;;"} \ No newline at end of file diff --git a/dist/react-formutil.esm.production.js b/dist/react-formutil.esm.production.js index 29ea759..9217afe 100644 --- a/dist/react-formutil.esm.production.js +++ b/dist/react-formutil.esm.production.js @@ -1 +1 @@ -import e,{createElement as t,Children as r,cloneElement as n,Component as i}from"react";import a from"create-react-context";import u from"warning";import o from"hoist-non-react-statics";import s from"react-fast-compare";function l(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function $(e,t){for(var r=0;r=0)continue;r[i]=e[i]}return r}function g(e,t){if(e==null)return{};var r=m(e,t);var n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function y(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function b(e,t){if(t&&(typeof t==="object"||typeof t==="function")){return t}return y(e)}function V(e,t){return k(e)||P(e,t)||O()}function w(e){return F(e)||C(e)||S()}function F(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t1?r-1:0),i=1;i-1}var Y=function e(t){try{var r=new Function("origin","global","return typeof ".concat(t," === 'number' || (typeof ").concat(t," !== 'undefined' && !(origin in global)) ? ").concat(t," : origin"));return r(t,D)}catch(e){return t}};function Q(){for(var e=arguments.length,t=new Array(e),r=0;r=0?[]:{}:l[h];break;default:l[h]=a;break}}}}catch(e){u(false,"The name '%s' of Field seems is not a legal expression.",i)}if(t.length>2){return n}}function G(e,t){if(e){if(_(e)){e(t)}else if("current"in e){e.current=t}}}var z=function e(t,r){for(var n=0,i=t.length;n2&&arguments[2]!==undefined?arguments[2]:{};return t.reduce(function(){r.apply(void 0,arguments);return arguments.length<=0?undefined:arguments[0]},n)};var J=undefined;function X(e,t,r){K(e,function(t,r){if(t===J){delete e[r]}else if(t&&typeof t==="object"){X(t,r,e)}});if(r&&Object.keys(e).every(function(t){return e[t]===J})){r[t]=J;X(r)}}var Z=function e(t,r){if(!N(Q(t,r))){Q(t,r,J);X(t)}};var ee="FORM_VALIDATE_RESULT";var te,re;if(typeof requestAnimationFrame==="function"){te=requestAnimationFrame;re=cancelAnimationFrame}else{te=setTimeout;re=clearTimeout}var ne=function(i){v(a,i);function a(e){var t;l(this,a);t=b(this,h(a).call(this,e));t.$$formPending=void 0;t.$$formValidatePromise=void 0;t.$$registers={};t.$$deepRegisters={};t.$$regDuplications={};t.$$duplicateTimer=void 0;t.$$checkDuplication=function(){var e=y(t),r=e.$$regDuplications;var n;K(r,function(e,t){var i=V(e,2),a=i[0],o=i[1];u(a.$$reserved,"The Field with a name '".concat(t,"' has been registered!"));o.$$reset(a.$getState());n=delete r[t]});if(n){t.$render()}};t.$$register=function(e,r,n){t.$$unregister(n,r);if(e){var i=t.$$getRegister(e);if(i){re(t.$$duplicateTimer);t.$$regDuplications[e]=[i,r];t.$$duplicateTimer=te(t.$$checkDuplication)}else{t.$$fieldChangedQueue.push({name:e,$newValue:r.$getState().$value});Z(t.$$defaultValues,e)}t.$$registers[r.$name=e]=r;t.createDeepRegisters();t.$render()}};t.$$unregister=function(e,r,n){if(e){if(e in t.$$regDuplications){var i=V(t.$$regDuplications[e],2),a=i[0],u=i[1];t.$$fieldChangedQueue.push({name:e,$newValue:u.$getState().$value,$prevValue:a.$getState().$value});delete t.$$regDuplications[e]}else if(t.$$registers[e]===r){if(n){r.$$reserved=true}else{delete t.$$registers[e];t.$$fieldChangedQueue.push({name:e,$prevValue:r.$getState().$value});Z(t.$$defaultValues,e)}}t.createDeepRegisters();t.$render()}};t.$$defaultInitialize=function(){var e=t.props,r=e.$defaultValues,n=e.$defaultStates;t.$$defaultValues=t.$$deepParseObject(I(_(r)?r(t.props)||{}:r));t.$$defaultStates=t.$$deepParseObject(I(_(n)?n(t.props)||{}:n))};t.$$getDefault=function(){return{$$defaultStates:t.$$defaultStates,$$defaultValues:t.$$defaultValues}};t.$$triggerChangeTimer=void 0;t.$$fieldChangedQueue=[];t.$$triggerFormChange=function(){if(t.$$fieldChangedQueue.length){var e=w(t.$$fieldChangedQueue);t.$$fieldChangedQueue.length=0;var r={};var n={};var i=t.$$registers;var a=false;e.forEach(function(e){if(!(e.name in i)){delete e.$newValue}if(e.$newValue!==e.$prevValue){if("$newValue"in e&&"$prevValue"in e){var u=t.$$getRegister(e.name);if(u){u.$$triggerChange(e)}}"$newValue"in e&&Q(r,e.name,e.$newValue);"$prevValue"in e&&Q(n,e.name,e.$prevValue);a=true}});if(a){if(_(t.props.$validator)){t.$$formValidate()}if(_(t.props.$onFormChange)){t.props.$onFormChange(t.$formutil,r,n)}}}};t.createDeepRegisters=function(){return t.$$deepRegisters=t.$$deepParseObject(t.$$registers)};t.$$getRegister=function(e){if(e){var r=t.$$registers[e]||Q(t.$$deepRegisters,e);if(r){return r}}};t.$$formValidate=function(e){return t.$$formValidatePromise=new Promise(function(r){var n=t.props.$validator;var i;var a;var u;var o;var s=n(t.$formutil.$params,t.formtutil);var l=function t(n){return r(H(e,H(u,n)))};if(T(s)){if(!t.$$formPending){t.$$formPending=true;t.$render()}a=function e(t){return i=t(l)};o=s.then(function(){return void 0},function(e){return e}).then(function(e){if(i){return i}t.$shouldCancelPrevAsyncValidate=null;t.$$formPending=false;return t.$$setFormErrors(e,l)})}else{if(t.$$formPending){t.$$formPending=false}o=t.$$setFormErrors(s,l)}if(t.$shouldCancelPrevAsyncValidate){t.$shouldCancelPrevAsyncValidate(function(e){u=e;return o})}t.$shouldCancelPrevAsyncValidate=a})};t.$$setFormErrors=function(e,r){if(e&&(e instanceof Error||typeof e!=="object")){u(false,"The result of $validator in should always return None(null,undefined) or an object contains error message of Field.");return t.$render(r)}return t.$$setStates(e||{},function(e,t){var r=t.$getState(),n=r.$error,i=n===void 0?{}:n;if(e){return{$error:d({},i,c({},ee,e))}}if(i[ee]){delete i[ee];return{$error:i}}return},r,true)};t.$getField=function(e){var r=t.$$getRegister(e);u(!e||r,"$getField('".concat(e,"') fail to find the matched Field. Maybe it has been unmounted."));u(e,"You should pass a name of the mounted Field to $getField().");if(r){return r.$new()}};t.$$onChange=function(e,r,n){return t.$setStates(c({},e,r),n)};t.$$setStates=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=arguments.length>1?arguments[1]:undefined;var n=arguments.length>2?arguments[2]:undefined;var i=arguments.length>3?arguments[3]:undefined;var a=t.$$deepParseObject(e);var u=false;K(t.$$registers,function(n,o){var s=o in e?e[o]:Q(a,o);if(!N(s)||i){var l=r(s,n);if(l){var $=t.$formutil.$weakParams[o];var f=n.$$merge(l),c=f.$value;n.$$detectChange(l);if("$value"in l||"$viewValue"in l){var d=z(t.$$fieldChangedQueue,function(e){return e.name===o});if(d){if(!("$prevValue"in d)){d.$prevValue=d.$newValue}d.$newValue=c}else{t.$$fieldChangedQueue.push({name:o,$newValue:c,$prevValue:$})}}u=true}}});if(u){return t.$render(n)}return Promise.resolve(H(n,t.$formutil))};t.$render=function(e){return new Promise(function(r){return t.forceUpdate(function(){return r(H(e,t.$formutil))})})};t.$validates=function(){var e;for(var r=arguments.length,n=new Array(r),i=0;i1&&arguments[1]!==undefined?arguments[1]:{};K(t,function(e,t){return Q(r,t,e)});return r}},{key:"componentDidMount",value:function e(){G(this.props.$ref,this.$formutil)}},{key:"componentDidUpdate",value:function e(t){var r=this;G(this.props.$ref,this.$formutil);re(this.$$triggerChangeTimer);this.$$triggerChangeTimer=te(function(){r.$$triggerFormChange()})}},{key:"componentWillUnmount",value:function e(){G(this.props.$ref,null)}},{key:"_render",value:function e(){var i=this.$formutil;var a=this.props,u=a.children,o=a.render,s=a.component;if(s){return t(s,{$formutil:i})}if(_(o)){return o(i)}if(_(u)){return u(i)}return r.map(u,function(e){return e&&_(e.type)?n(e,{$formutil:i}):e})}},{key:"render",value:function t(){var r=this;var n=this.props.$processer;var i=Object.keys(this.$$registers).map(function(e){return{path:e,$state:r.$$registers[e].$getState()}});var a=W(i,function(e,t){var r=t.path,i=t.$state;if(n){n(i,r)}if("$value"in i&&(i.$dirty||!N(i.$value))){e[r]=i.$value}});var u=W(i,function(e,t){var r=t.path,n=t.$state;return r in a&&Q(e,r,a[r])});var o=i.some(function(e){var t=e.$state;return t.$invalid});var s=i.some(function(e){var t=e.$state;return t.$dirty});var l=i.some(function(e){var t=e.$state;return t.$touched});var $=i.some(function(e){var t=e.$state;return t.$focused});var f=this.$$formPending||i.some(function(e){var t=e.$state;return t.$pending});var c=this.$formutil={$$registers:d({},this.$$registers),$$deepRegisters:this.$$deepRegisters,$states:W(i,function(e,t){var r=t.path,n=t.$state;return Q(e,r,n)}),$params:d({},this.$$defaultValues,u),$errors:W(i,function(e,t){var r=t.path,n=t.$state;if(n.$invalid){Q(e,r,n.$error)}}),$dirts:W(i,function(e,t){var r=t.path,n=t.$state;return Q(e,r,n.$dirty)}),$touches:W(i,function(e,t){var r=t.path,n=t.$state;return Q(e,r,n.$touched)}),$focuses:W(i,function(e,t){var r=t.path,n=t.$state;return Q(e,r,n.$focused)}),$pendings:W(i,function(e,t){var r=t.path,n=t.$state;return Q(e,r,n.$pending)}),$weakStates:W(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n}),$weakParams:a,$weakErrors:W(i,function(e,t){var r=t.path,n=t.$state;if(n.$invalid){e[r]=n.$error}}),$weakDirts:W(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$dirty}),$weakTouches:W(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$touched}),$weakFocuses:W(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$focused}),$weakPendings:W(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$pending}),$getFirstError:function e(t){if(t){var r=c.$getField(t);return r&&r.$getFirstError()}for(var n in c.$weakErrors){var i=c.$weakErrors[n];for(var a in i){return i[a]instanceof Error?i[a].message:i[a]}}},$render:this.$render,$getField:this.$getField,$onValidates:this.$onValidates,$new:function e(){return r.$formutil},$setStates:this.$setStates,$setValues:this.$setValues,$setErrors:this.$setErrors,$setTouches:this.$setTouches,$setDirts:this.$setDirts,$setFocuses:this.$setFocuses,$batchState:this.$batchState,$batchTouched:this.$batchTouched,$batchDirty:this.$batchDirty,$batchFocused:this.$batchFocused,$reset:this.$reset,$validates:this.$validates,$validate:this.$validate,$valid:!o,$invalid:o,$dirty:s,$pristine:!s,$touched:l,$untouched:!l,$focused:$,$pending:f};return e.createElement(E.Provider,{value:this.getFormContext()},this._render())}}]);return a}(i);ne.displayName="React.Formutil.Form";ne.defaultProps={$defaultValues:{},$defaultStates:{}};function ie(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=function(n){v(i,n);function i(){l(this,i);return b(this,h(i).apply(this,arguments))}f(i,[{key:"render",value:function n(){var i=Object.assign({},this.props);var a=this.props,u=a.component,o=g(a,["component"]);["$defaultStates","$defaultValues","$onFormChange","$validator","$processer","$ref"].forEach(function(e){if(e in i){if(e==="$defaultStates"||e==="$defaultValues"){o[e]=d({},r[e],i[e])}delete i[e]}});return e.createElement(ne,Object.assign({},r,o,{render:function r(n){return e.createElement(t,Object.assign({},i,{$formutil:n}))}}))}}]);return i}(i);n.displayName="React.Formutil.withForm."+(t.displayName||t.name||"Anonymous");return o(n,t)}var ae=M(ie);var ue=0;var oe={$valid:true,$invalid:false,$dirty:false,$pristine:true,$touched:false,$untouched:true,$focused:false,$pending:false,$error:{}};function se(e){return e!==true}function le(e,t,r){u(!N(e),"You should return a string or Error when the validation('".concat(r&&r+": ").concat(t,"') failed, otherwise return true."))}var $e="React.Formutil.Field";function fe(){return ue++}function ce(e,i){var a=i.children,u=i.render,o=i.component;if(o){return t(o,{$fieldutil:e})}if(_(u)){return u(e)}if(_(a)){return a(e)}return r.map(a,function(t){return t&&_(t.type)?n(t,{$fieldutil:e}):t})}function de(e,t){var r={$$FIELD_UUID:e.$$FIELD_UUID,$$reset:o,$$merge:b,$$detectChange:i,$$triggerChange:a,$onValidate:u,$new:function t(){return e.$fieldutil},$picker:s,$getState:s,$getComponent:function e(){return t},$reset:function t(r,n){return e.$setState(o(r),n)},$getFirstError:y,$validate:l,$setState:e.$setState,$render:$,$setValue:f,$setTouched:c,$setDirty:v,$setFocused:h,$setValidity:m,$setError:p,$setPending:g};var n;function i(e){if("$value"in e||"$viewValue"in e){l()}}function a(t){var r=t.$newValue,n=t.$prevValue;var i=e.props.$onFieldChange;if(_(i)){i(r,n,e.$formContext.$formutil)}}function u(e){n.then(e);return n}function o(t){var r;var n=e.props,i=e.$formContext;if(i.$$getDefault){var a=n.name;var u=i.$$getDefault(),o=u.$$defaultStates,s=u.$$defaultValues;if(a&&s){var l=Q(s,a);r=Q(o,a)||{};if(!N(l)){r.$value=l}}}var $=n.$defaultValue,f=n.$defaultState;return b(d({},oe,_(f)?f(n):f,{$value:_($)?$(n):"$defaultValue"in n?$:""},r,t))}function s(){return d({},e.$state)}function l(t){return n=new Promise(function(r){var n=e.props,i=e.$formContext;var a=d({},n.$validators,n.$asyncValidators);var u=e.$state,o=u.$value,s=u.$pending,l=Object.assign({},u.$error);var $=i.$formutil;var f={};var c=false;var v;var h;var y;var b;delete l[ee];var V=Object.keys(a).reduce(function(t,r){delete l[r];if(!c&&n[r]!=null){var i=a[r](o,n[r],d({},n,{$formutil:$,$fieldutil:e.$fieldutil,$validError:f}));if(T(i)){t.push(i.catch(function(e){if(!v){m(r,e||r)}}))}else if(se(i)){f[r]=i||r;le(i,r,n.name);if(n.$validateLazy){c=true}}}return t},[]);var w=function e(n){return r(H(t,H(y,n)))};if(V.length){if(!s){g(true)}h=function e(t){return v=t(w)};V.push(p(d({},l,f)));b=Promise.all(V).then(function(){if(v){return v}e.$shouldCancelPrevAsyncValidate=null;return g(false,w)})}else{if(s){g(false)}b=p(d({},l,f),w)}if(e.$shouldCancelPrevAsyncValidate){e.$shouldCancelPrevAsyncValidate(function(e){y=e;return b})}e.$shouldCancelPrevAsyncValidate=h})}function $(t,r){return e.$setState({$viewValue:t,$dirty:true},r)}function f(t,r){return e.$setState({$value:t},r)}function c(t,r){return e.$setState({$touched:t},r)}function v(t,r){return e.$setState({$dirty:t},r)}function h(t,r){return e.$setState({$focused:t},r)}function p(t,r){return e.$setState({$error:t},r)}function m(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var n=arguments.length>2?arguments[2]:undefined;var i=Object.assign({},e.$state.$error);if(se(r)){i[t]=r||t;le(r,t,e.props.name)}else{delete i[t]}return p(i,n)}function g(t,r){return e.$setState({$pending:t},r)}function y(){var t=e.$state.$error,r=t===void 0?{}:t;for(var n in r){return r[n]instanceof Error?r[n].message:r[n]}}function b(t){var r=Object.assign({},t);if("$error"in r){if(!r.$error){r.$error={}}r.$valid=Object.keys(r.$error).length===0}var n=e.props,i=n.$parser,a=n.$formatter;if("$viewValue"in r&&!("$value"in r)){var u=function e(t){return r.$viewValue=t};r.$value=i?i(r.$viewValue,u):r.$viewValue}else if("$value"in r&&!("$viewValue"in r)){var o=function e(t){return r.$value=t};r.$viewValue=a?a(r.$value,o):r.$value}if("$valid"in r){r.$invalid=!r.$valid}else if("$invalid"in r){r.$dirty=!r.$invalid}if("$dirty"in r){r.$pristine=!r.$dirty}else if("$pristine"in r){r.$dirty=!r.$pristine}if("$touched"in r){r.$untouched=!r.$touched}else if("$untouched"in r){r.$touched=!r.$untouched}e.$state=d({},e.$state,r);return s()}return r}var ve=function(t){v(r,t);function r(){var e;var t;l(this,r);for(var n=arguments.length,i=new Array(n),a=0;a with the name '".concat(t,"' must be used underneath a component or withForm() HOC, otherwise it's isolated."));u(t,"You should assign a name to , otherwise it will be isolated!");if(r.$$register){r.$$register(t,this.$fieldHandler)}this.$prevValue=this.$state.$value;G(this.props.$ref,this.$fieldutil)}},{key:"componentWillUnmount",value:function e(){if(this.$formContext.$$unregister){this.$formContext.$$unregister(this.props.name,this.$fieldHandler,this.props.$reserveOnUnmount)}this.isMounting=false;G(this.props.$ref,null)}},{key:"componentDidUpdate",value:function e(t){var r=this.props.name;if(r!==t.name){if(this.$formContext.$$register){this.$formContext.$$register(r,this.$fieldHandler,t.name)}}G(this.props.$ref,this.$fieldutil);if(this.$state.$value!==this.$prevValue){if(!(r in(this.$formContext.$$registers||{}))){this.$registered.$$triggerChange({$newValue:this.$state.$value,$prevValue:this.$prevValue})}this.$prevValue=this.$state.$value}}},{key:"_render",value:function e(){var t=this.$fieldutil=d({$name:this.props.name},this.$registered.$getState(),this.$registered,{$$formutil:this.$formContext.$formutil});return ce(t,this.props)}},{key:"render",value:function t(){var r=this;var n=!this.$formContext;return e.createElement(E.Consumer,null,function(e){r.$formContext=e;if(!r.$fieldHandler){r.$fieldHandler=de(r,r)}r.$registered=(e.$$registers||{})[r.$fieldHandler.$name]||r.$fieldHandler;if(n){r.$fieldHandler.$$reset();r.$fieldHandler.$validate()}return r._render()})}}]);return r}(i);ve.displayName=$e;function he(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=function(n){v(i,n);function i(){l(this,i);return b(this,h(i).apply(this,arguments))}f(i,[{key:"render",value:function n(){var i=Object.assign({},this.props);var a=this.props,u=a.component,o=g(a,["component"]);["$validators","$asyncValidators","$validateLazy","$reserveOnUnmount","$defaultValue","$defaultState","$onFieldChange","$parser","$formatter","$ref","name"].concat(Object.keys(d({},r.$validators,r.$asyncValidators,i.$validators,i.$asyncValidators))).forEach(function(e){if(e in i){if(e==="$validators"||e==="$asyncValidators"||e==="$defaultState"){o[e]=d({},r[e],i[e])}delete i[e]}});return e.createElement(ve,Object.assign({},r,o,{render:function r(n){return e.createElement(t,Object.assign({},i,{$fieldutil:n}))}}))}}]);return i}(i);n.displayName="React.Formutil.withField."+(t.displayName||t.name||"Anonymous");return o(n,t)}var pe=M(he);var me=function(t){v(r,t);function r(){l(this,r);return b(this,h(r).apply(this,arguments))}f(r,[{key:"render",value:function t(){var r=this;var n=this.props,i=n.$fieldutil,a=n.value,u=n.onChange,o=n.onFocus,s=n.onBlur,l=n.checked,$=n.unchecked,f=g(n,["$fieldutil","value","onChange","onFocus","onBlur","checked","unchecked"]);var c=this.props.type;var d={value:"compositionValue"in this?this.compositionValue:a,onCompositionEnd:function e(t){r.composition=false;delete r.compositionValue;d.onChange(t)},onCompositionStart:function e(){return r.composition=true},onChange:function e(t){var n=t.target.value;if(r.composition){r.compositionValue=n;r.forceUpdate()}else{u(n,t)}},onFocus:o,onBlur:s};var v="input";switch(c){case"select":v=c;d.onChange=function(e){var t=e.target;var r=t.multiple?[].slice.call(t.options).filter(function(e){return e.selected}).map(function(e){return e.value}):t.value;u(r,e)};delete f.type;break;case"textarea":v=c;delete f.type;break;case"checkbox":case"radio":d={checked:a===l,onChange:function e(t){u(t.target.checked?l:$,t)},onFocus:o,onBlur:s};break;default:break}return e.createElement(v,Object.assign({},f,d))}}]);return r}(i);me.displayName="React.Formutil.EasyField.Native";me.defaultProps={value:"",type:"text",checked:true,unchecked:false};var ge=a({}),ye=ge.Provider,be=ge.Consumer;var Ve=function(t){v(i,t);function i(){l(this,i);return b(this,h(i).apply(this,arguments))}f(i,[{key:"getGroupContext",value:function e(){return this.props}},{key:"_render",value:function t(){var i=this.props,a=i.className,u=i.groupNode,o=i.children;var s={GroupOption:we,Field:Fe};var l=_(o)?o(s):r.map(o,function(e){return n(e,s)});if(u===null){return l}return e.createElement(u,{className:a},l)}},{key:"render",value:function t(){return e.createElement(ye,{value:this.getGroupContext()},this._render())}}]);return i}(i);Ve.displayName="React.Formutil.EasyField.Group";Ve.defaultProps={type:"checkbox",groupNode:"div"};var we=function(t){v(r,t);function r(){l(this,r);return b(this,h(r).apply(this,arguments))}f(r,[{key:"componentDidMount",value:function e(){u("$value"in this.props,"You should pass a $value to .")}},{key:"render",value:function t(){var r=this.props,n=r.$value,i=r.onChange,a=r.onFocus,u=r.onBlur,o=g(r,["$value","onChange","onFocus","onBlur"]);return e.createElement(be,null,function(t){var r=t.type,s=t.name;var l=r==="radio"?{checked:t.value===n,onChange:function e(r){t.onChange(n,r);i&&i(r)}}:r==="checkbox"?{checked:t.value.indexOf(n)>-1,onChange:function e(r){t.onChange(r.target.checked?t.value.concat(n):t.value.filter(function(e){return e!==n}),r);i&&i(r)}}:{value:t.value,onChange:function e(r){t.onChange(r);i&&i(r)}};return e.createElement("input",Object.assign({name:s},o,l,{type:r,onFocus:function e(r){t.onFocus(r);a&&a(r)},onBlur:function e(r){t.onBlur(r);u&&u(r)}}))})}}]);return r}(i);we.displayName="React.Formutil.EasyField.Group.Option";var Fe=function(t){v(r,t);function r(){l(this,r);return b(this,h(r).apply(this,arguments))}f(r,[{key:"componentDidMount",value:function e(){u(false,'The "Field" property in EasyField\'s children-props has been deprecated. Please use "GroupOption" instead.')}},{key:"render",value:function t(){return e.createElement(we,this.props)}}]);return r}(i);Fe.displayName="React.Formutil.EasyField.Group.Option.Deprecated";var ke=e.Frament||"div";var Ce=function(t){v(r,t);function r(e){var t;l(this,r);t=b(this,h(r).call(this,e));t.id=0;t.latestValue=t.props.value;t.$formutil=void 0;t.FieldValidators={required:function e(t){return t!==null}};t.$onFormChange=function(e){e.$onValidates(function(e){var r=e.$invalid,n=e.$params;if(r){if(t.props.value.length){t.props.onChange(t.latestValue=[])}}else if(!s(t.props.value,n.list)){t.props.onChange(t.latestValue=n.list)}})};t.swap=function(e,r,n){return t.$setState(function(t){var n=t.items;var i=[n[e],n[r]];n[r]=i[0];n[e]=i[1];return n},n)};t.insert=function(){var e,r,n;for(var i=arguments.length,a=new Array(i),u=0;u=t}],["max",function(e,t){return A(e)||e*1<=t}],["min",function(e,t){return A(e)||e*1>=t}],["pattern",function(e,t){return A(e)||t.test(e)}],["enum",function(e,t){return A(e)||t.indexOf(e)>-1}],["checker",function(e,t,r){return t(e,r)}]].reduce(function(e,t){var r=V(t,2),n=r[0],i=r[1];e[n]=function e(t,r,a){var u=a.validMessage,o=u===void 0?{}:u;return i.apply(void 0,arguments)||o[n]||"Error input: ".concat(n)};return e},{});var Oe="React.Formutil.EasyField";var Ee={validMessage:{},valuePropName:"value",changePropName:"onChange",focusPropName:"onFocus",blurPropName:"onBlur",$parser:function e(t){return typeof t==="string"?t.trim():t}};function je(e,t,r){var n;var i=t.valuePropName,a=t.changePropName,u=t.focusPropName,o=t.blurPropName,s=t.passUtil;var l=function e(t){return t&&t.target?t.target[i]:t};var $=d({},r,(n={},c(n,i,e.$viewValue),c(n,a,function(){for(var r=arguments.length,n=new Array(r),i=0;i=16.8, Please upgrade your reactjs.")}var t=e.useContext;var r=t(E);return r}function Te(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!e.useState){throw new Error("Hooks api need react@>=16.8, Please upgrade your reactjs.")}var n=e.useState,i=e.useLayoutEffect,a=e.useRef;var o;if(t){if(typeof t==="string"){o=t;r.name=o}else{r=t;o=r.name}}var s=Ae();var l=a({}).current;var $=a([]);var f;l.$formContext=s;l.props=r;l.$setState=p;var c=n(function(){l.$$FIELD_UUID=fe();l.$fieldHandler=f=de(l);var e=l.$fieldHandler.$$reset();l.$fieldHandler.$validate();return e}),v=V(c,2),h=v[1];if(!f){f=(s.$$registers||{})[l.$fieldHandler.$name]||l.$fieldHandler}i(function(){var e=l.$state;if(l.isMounting){if(!(o in(s.$$registers||{}))){var t=l.$prevValue;f.$$triggerChange({$newValue:e.$value,$prevValue:t})}}l.$prevValue=e.$value},[l.$state.$value]);i(function(){l.isMounting=true;u(!o||s.$formutil,"You should enusre that the useField() with the name '".concat(o,"' must be used underneath a component or withForm() HOC, otherwise it's isolated."));u(o,"You should pass a name argument to useField(), otherwise it will be isolated!");return function(){l.isMounting=false;G(r.$ref,null)}},[]);i(function(){if(s.$$register){s.$$register(o,l.$fieldHandler)}return function(){if(s.$$unregister){s.$$unregister(o,l.$fieldHandler,!l.isMounting&&r.$reserveOnUnmount)}}},[o]);i(function(){G(r.$ref,l.$fieldutil)});i(function(){if($.current.length>0){var e=w($.current);$.current.length=0;while(e.length){e.pop()(l.$fieldutil)}}});function p(e,t){return new Promise(function(r){var n=function e(){return r(H(t,l.$fieldutil))};if(l.isMounting){if(o in(s.$$registers||{})){s.$$onChange(o,e,n)}else{h(f.$$merge(e));f.$$detectChange(e);$.current.push(n)}}else{f.$$merge(e);n()}})}return l.$fieldutil=d({$name:o},f.$getState(),f,{$$formutil:s.$formutil})}function Re(){var e=Ae(),t=e.$formutil;return t}function Ue(e){e=d({},Ee,e,{children:null});var t=xe(e),r=t.fieldProps,n=t.childProps;var i=Te(r);return je(i,r,n)}export{Ne as EasyField,ve as Field,ne as Form,_e as connect,Te as useField,Re as useForm,Ue as useHandler,pe as withField,ae as withForm}; +import e,{createContext as t,createElement as r,Children as n,cloneElement as i,Component as a}from"react";import u from"warning";import o from"hoist-non-react-statics";import s from"react-fast-compare";function l(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function $(e,t){for(var r=0;r=0)continue;r[i]=e[i]}return r}function g(e,t){if(e==null)return{};var r=m(e,t);var n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function y(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function b(e,t){if(t&&(typeof t==="object"||typeof t==="function")){return t}return y(e)}function V(e,t){return k(e)||P(e,t)||O()}function w(e){return F(e)||C(e)||S()}function F(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t1?r-1:0),i=1;i-1}var Y=function e(t){try{var r=new Function("origin","global","return typeof ".concat(t," === 'number' || (typeof ").concat(t," !== 'undefined' && !(origin in global)) ? ").concat(t," : origin"));return r(t,D)}catch(e){return t}};function Q(){for(var e=arguments.length,t=new Array(e),r=0;r=0?[]:{}:l[h];break;default:l[h]=a;break}}}}catch(e){u(false,"The name '%s' of Field seems is not a legal expression.",i)}if(t.length>2){return n}}function G(e,t){if(e){if(_(e)){e(t)}else if("current"in e){e.current=t}}}var z=function e(t,r){for(var n=0,i=t.length;n2&&arguments[2]!==undefined?arguments[2]:{};return t.reduce(function(){r.apply(void 0,arguments);return arguments.length<=0?undefined:arguments[0]},n)};var J=undefined;function X(e,t,r){K(e,function(t,r){if(t===J){delete e[r]}else if(t&&typeof t==="object"){X(t,r,e)}});if(r&&Object.keys(e).every(function(t){return e[t]===J})){r[t]=J;X(r)}}var Z=function e(t,r){if(!N(Q(t,r))){Q(t,r,J);X(t)}};var ee="FORM_VALIDATE_RESULT";var te,re;if(typeof requestAnimationFrame==="function"){te=requestAnimationFrame;re=cancelAnimationFrame}else{te=setTimeout;re=clearTimeout}var ne=function(t){v(a,t);function a(e){var t;l(this,a);t=b(this,h(a).call(this,e));t.$$formPending=void 0;t.$$formValidatePromise=void 0;t.$$registers={};t.$$deepRegisters={};t.$$regDuplications={};t.$$duplicateTimer=void 0;t.$$checkDuplication=function(){var e=y(t),r=e.$$regDuplications;var n;K(r,function(e,t){var i=V(e,2),a=i[0],o=i[1];u(a.$$reserved,"The Field with a name '".concat(t,"' has been registered!"));o.$$reset(a.$getState());n=delete r[t]});if(n){t.$render()}};t.$$register=function(e,r,n){t.$$unregister(n,r);if(e){var i=t.$$getRegister(e);if(i){re(t.$$duplicateTimer);t.$$regDuplications[e]=[i,r];t.$$duplicateTimer=te(t.$$checkDuplication)}else{t.$$fieldChangedQueue.push({name:e,$newValue:r.$getState().$value});Z(t.$$defaultValues,e)}t.$$registers[r.$name=e]=r;t.createDeepRegisters();t.$render()}};t.$$unregister=function(e,r,n){if(e){if(e in t.$$regDuplications){var i=V(t.$$regDuplications[e],2),a=i[0],u=i[1];t.$$fieldChangedQueue.push({name:e,$newValue:u.$getState().$value,$prevValue:a.$getState().$value});delete t.$$regDuplications[e]}else if(t.$$registers[e]===r){if(n){r.$$reserved=true}else{delete t.$$registers[e];t.$$fieldChangedQueue.push({name:e,$prevValue:r.$getState().$value});Z(t.$$defaultValues,e)}}t.createDeepRegisters();t.$render()}};t.$$defaultInitialize=function(){var e=t.props,r=e.$defaultValues,n=e.$defaultStates;t.$$defaultValues=t.$$deepParseObject(I(_(r)?r(t.props)||{}:r));t.$$defaultStates=t.$$deepParseObject(I(_(n)?n(t.props)||{}:n))};t.$$getDefault=function(){return{$$defaultStates:t.$$defaultStates,$$defaultValues:t.$$defaultValues}};t.$$triggerChangeTimer=void 0;t.$$fieldChangedQueue=[];t.$$triggerFormChange=function(){if(t.$$fieldChangedQueue.length){var e=w(t.$$fieldChangedQueue);t.$$fieldChangedQueue.length=0;var r={};var n={};var i=t.$$registers;var a=false;e.forEach(function(e){if(!(e.name in i)){delete e.$newValue}if(e.$newValue!==e.$prevValue){if("$newValue"in e&&"$prevValue"in e){var u=t.$$getRegister(e.name);if(u){u.$$triggerChange(e)}}"$newValue"in e&&Q(r,e.name,e.$newValue);"$prevValue"in e&&Q(n,e.name,e.$prevValue);a=true}});if(a){if(_(t.props.$validator)){t.$$formValidate()}if(_(t.props.$onFormChange)){t.props.$onFormChange(t.$formutil,r,n)}}}};t.createDeepRegisters=function(){return t.$$deepRegisters=t.$$deepParseObject(t.$$registers)};t.$$getRegister=function(e){if(e){var r=t.$$registers[e]||Q(t.$$deepRegisters,e);if(r){return r}}};t.$$formValidate=function(e){return t.$$formValidatePromise=new Promise(function(r){var n=t.props.$validator;var i;var a;var u;var o;var s=n(t.$formutil.$params,t.formtutil);var l=function t(n){return r(H(e,H(u,n)))};if(T(s)){if(!t.$$formPending){t.$$formPending=true;t.$render()}a=function e(t){return i=t(l)};o=s.then(function(){return void 0},function(e){return e}).then(function(e){if(i){return i}t.$shouldCancelPrevAsyncValidate=null;t.$$formPending=false;return t.$$setFormErrors(e,l)})}else{if(t.$$formPending){t.$$formPending=false}o=t.$$setFormErrors(s,l)}if(t.$shouldCancelPrevAsyncValidate){t.$shouldCancelPrevAsyncValidate(function(e){u=e;return o})}t.$shouldCancelPrevAsyncValidate=a})};t.$$setFormErrors=function(e,r){if(e&&(e instanceof Error||typeof e!=="object")){u(false,"The result of $validator in should always return None(null,undefined) or an object contains error message of Field.");return t.$render(r)}return t.$$setStates(e||{},function(e,t){var r=t.$getState(),n=r.$error,i=n===void 0?{}:n;if(e){return{$error:d({},i,c({},ee,e))}}if(i[ee]){delete i[ee];return{$error:i}}return},r,true)};t.$getField=function(e){var r=t.$$getRegister(e);u(!e||r,"$getField('".concat(e,"') fail to find the matched Field. Maybe it has been unmounted."));u(e,"You should pass a name of the mounted Field to $getField().");if(r){return r.$new()}};t.$$onChange=function(e,r,n){return t.$setStates(c({},e,r),n)};t.$$setStates=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var r=arguments.length>1?arguments[1]:undefined;var n=arguments.length>2?arguments[2]:undefined;var i=arguments.length>3?arguments[3]:undefined;var a=t.$$deepParseObject(e);var u=false;K(t.$$registers,function(n,o){var s=o in e?e[o]:Q(a,o);if(!N(s)||i){var l=r(s,n);if(l){var $=t.$formutil.$weakParams[o];var f=n.$$merge(l),c=f.$value;n.$$detectChange(l);if("$value"in l||"$viewValue"in l){var d=z(t.$$fieldChangedQueue,function(e){return e.name===o});if(d){if(!("$prevValue"in d)){d.$prevValue=d.$newValue}d.$newValue=c}else{t.$$fieldChangedQueue.push({name:o,$newValue:c,$prevValue:$})}}u=true}}});if(u){return t.$render(n)}return Promise.resolve(H(n,t.$formutil))};t.$render=function(e){return new Promise(function(r){return t.forceUpdate(function(){return r(H(e,t.$formutil))})})};t.$validates=function(){var e;for(var r=arguments.length,n=new Array(r),i=0;i1&&arguments[1]!==undefined?arguments[1]:{};K(t,function(e,t){return Q(r,t,e)});return r}},{key:"componentDidMount",value:function e(){G(this.props.$ref,this.$formutil)}},{key:"componentDidUpdate",value:function e(t){var r=this;G(this.props.$ref,this.$formutil);re(this.$$triggerChangeTimer);this.$$triggerChangeTimer=te(function(){r.$$triggerFormChange()})}},{key:"componentWillUnmount",value:function e(){G(this.props.$ref,null)}},{key:"_render",value:function e(){var t=this.$formutil;var a=this.props,u=a.children,o=a.render,s=a.component;if(s){return r(s,{$formutil:t})}if(_(o)){return o(t)}if(_(u)){return u(t)}return n.map(u,function(e){return e&&_(e.type)?i(e,{$formutil:t}):e})}},{key:"render",value:function t(){var r=this;var n=this.props.$processer;var i=Object.keys(this.$$registers).map(function(e){return{path:e,$state:r.$$registers[e].$getState()}});var a=W(i,function(e,t){var r=t.path,i=t.$state;if(n){n(i,r)}if("$value"in i&&(i.$dirty||!N(i.$value))){e[r]=i.$value}});var u=W(i,function(e,t){var r=t.path,n=t.$state;return r in a&&Q(e,r,a[r])});var o=i.some(function(e){var t=e.$state;return t.$invalid});var s=i.some(function(e){var t=e.$state;return t.$dirty});var l=i.some(function(e){var t=e.$state;return t.$touched});var $=i.some(function(e){var t=e.$state;return t.$focused});var f=this.$$formPending||i.some(function(e){var t=e.$state;return t.$pending});var c=this.$formutil={$$registers:d({},this.$$registers),$$deepRegisters:this.$$deepRegisters,$states:W(i,function(e,t){var r=t.path,n=t.$state;return Q(e,r,n)}),$params:d({},this.$$defaultValues,u),$errors:W(i,function(e,t){var r=t.path,n=t.$state;if(n.$invalid){Q(e,r,n.$error)}}),$dirts:W(i,function(e,t){var r=t.path,n=t.$state;return Q(e,r,n.$dirty)}),$touches:W(i,function(e,t){var r=t.path,n=t.$state;return Q(e,r,n.$touched)}),$focuses:W(i,function(e,t){var r=t.path,n=t.$state;return Q(e,r,n.$focused)}),$pendings:W(i,function(e,t){var r=t.path,n=t.$state;return Q(e,r,n.$pending)}),$weakStates:W(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n}),$weakParams:a,$weakErrors:W(i,function(e,t){var r=t.path,n=t.$state;if(n.$invalid){e[r]=n.$error}}),$weakDirts:W(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$dirty}),$weakTouches:W(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$touched}),$weakFocuses:W(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$focused}),$weakPendings:W(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$pending}),$getFirstError:function e(t){if(t){var r=c.$getField(t);return r&&r.$getFirstError()}for(var n in c.$weakErrors){var i=c.$weakErrors[n];for(var a in i){return i[a]instanceof Error?i[a].message:i[a]}}},$render:this.$render,$getField:this.$getField,$onValidates:this.$onValidates,$new:function e(){return r.$formutil},$setStates:this.$setStates,$setValues:this.$setValues,$setErrors:this.$setErrors,$setTouches:this.$setTouches,$setDirts:this.$setDirts,$setFocuses:this.$setFocuses,$batchState:this.$batchState,$batchTouched:this.$batchTouched,$batchDirty:this.$batchDirty,$batchFocused:this.$batchFocused,$reset:this.$reset,$validates:this.$validates,$validate:this.$validate,$valid:!o,$invalid:o,$dirty:s,$pristine:!s,$touched:l,$untouched:!l,$focused:$,$pending:f};return e.createElement(E.Provider,{value:this.getFormContext()},this._render())}}]);return a}(a);ne.displayName="React.Formutil.Form";ne.defaultProps={$defaultValues:{},$defaultStates:{}};function ie(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=function(n){v(i,n);function i(){l(this,i);return b(this,h(i).apply(this,arguments))}f(i,[{key:"render",value:function n(){var i=Object.assign({},this.props);var a=this.props,u=a.component,o=g(a,["component"]);["$defaultStates","$defaultValues","$onFormChange","$validator","$processer","$ref"].forEach(function(e){if(e in i){if(e==="$defaultStates"||e==="$defaultValues"){o[e]=d({},r[e],i[e])}delete i[e]}});return e.createElement(ne,Object.assign({},r,o,{render:function r(n){return e.createElement(t,Object.assign({},i,{$formutil:n}))}}))}}]);return i}(a);n.displayName="React.Formutil.withForm."+(t.displayName||t.name||"Anonymous");return o(n,t)}var ae=M(ie);var ue=0;var oe={$valid:true,$invalid:false,$dirty:false,$pristine:true,$touched:false,$untouched:true,$focused:false,$pending:false,$error:{}};function se(e){return e!==true}function le(e,t,r){u(!N(e),"You should return a string or Error when the validation('".concat(r&&r+": ").concat(t,"') failed, otherwise return true."))}var $e="React.Formutil.Field";function fe(){return ue++}function ce(e,t){var a=t.children,u=t.render,o=t.component;if(o){return r(o,{$fieldutil:e})}if(_(u)){return u(e)}if(_(a)){return a(e)}return n.map(a,function(t){return t&&_(t.type)?i(t,{$fieldutil:e}):t})}function de(e,t){var r={$$FIELD_UUID:e.$$FIELD_UUID,$$reset:o,$$merge:b,$$detectChange:i,$$triggerChange:a,$onValidate:u,$new:function t(){return e.$fieldutil},$picker:s,$getState:s,$getComponent:function e(){return t},$reset:function t(r,n){return e.$setState(o(r),n)},$getFirstError:y,$validate:l,$setState:e.$setState,$render:$,$setValue:f,$setTouched:c,$setDirty:v,$setFocused:h,$setValidity:m,$setError:p,$setPending:g};var n;function i(e){if("$value"in e||"$viewValue"in e){l()}}function a(t){var r=t.$newValue,n=t.$prevValue;var i=e.props.$onFieldChange;if(_(i)){i(r,n,e.$formContext.$formutil)}}function u(e){n.then(e);return n}function o(t){var r;var n=e.props,i=e.$formContext;if(i.$$getDefault){var a=n.name;var u=i.$$getDefault(),o=u.$$defaultStates,s=u.$$defaultValues;if(a&&s){var l=Q(s,a);r=Q(o,a)||{};if(!N(l)){r.$value=l}}}var $=n.$defaultValue,f=n.$defaultState;return b(d({},oe,_(f)?f(n):f,{$value:_($)?$(n):"$defaultValue"in n?$:""},r,t))}function s(){return d({},e.$state)}function l(t){return n=new Promise(function(r){var n=e.props,i=e.$formContext;var a=d({},n.$validators,n.$asyncValidators);var u=e.$state,o=u.$value,s=u.$pending,l=Object.assign({},u.$error);var $=i.$formutil;var f={};var c=false;var v;var h;var y;var b;delete l[ee];var V=Object.keys(a).reduce(function(t,r){delete l[r];if(!c&&n[r]!=null){var i=a[r](o,n[r],d({},n,{$formutil:$,$fieldutil:e.$fieldutil,$validError:f}));if(T(i)){t.push(i.catch(function(e){if(!v){m(r,e||r)}}))}else if(se(i)){f[r]=i||r;le(i,r,n.name);if(n.$validateLazy){c=true}}}return t},[]);var w=function e(n){return r(H(t,H(y,n)))};if(V.length){if(!s){g(true)}h=function e(t){return v=t(w)};V.push(p(d({},l,f)));b=Promise.all(V).then(function(){if(v){return v}e.$shouldCancelPrevAsyncValidate=null;return g(false,w)})}else{if(s){g(false)}b=p(d({},l,f),w)}if(e.$shouldCancelPrevAsyncValidate){e.$shouldCancelPrevAsyncValidate(function(e){y=e;return b})}e.$shouldCancelPrevAsyncValidate=h})}function $(t,r){return e.$setState({$viewValue:t,$dirty:true},r)}function f(t,r){return e.$setState({$value:t},r)}function c(t,r){return e.$setState({$touched:t},r)}function v(t,r){return e.$setState({$dirty:t},r)}function h(t,r){return e.$setState({$focused:t},r)}function p(t,r){return e.$setState({$error:t},r)}function m(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var n=arguments.length>2?arguments[2]:undefined;var i=Object.assign({},e.$state.$error);if(se(r)){i[t]=r||t;le(r,t,e.props.name)}else{delete i[t]}return p(i,n)}function g(t,r){return e.$setState({$pending:t},r)}function y(){var t=e.$state.$error,r=t===void 0?{}:t;for(var n in r){return r[n]instanceof Error?r[n].message:r[n]}}function b(t){var r=Object.assign({},t);if("$error"in r){if(!r.$error){r.$error={}}r.$valid=Object.keys(r.$error).length===0}var n=e.props,i=n.$parser,a=n.$formatter;if("$viewValue"in r&&!("$value"in r)){var u=function e(t){return r.$viewValue=t};r.$value=i?i(r.$viewValue,u):r.$viewValue}else if("$value"in r&&!("$viewValue"in r)){var o=function e(t){return r.$value=t};r.$viewValue=a?a(r.$value,o):r.$value}if("$valid"in r){r.$invalid=!r.$valid}else if("$invalid"in r){r.$dirty=!r.$invalid}if("$dirty"in r){r.$pristine=!r.$dirty}else if("$pristine"in r){r.$dirty=!r.$pristine}if("$touched"in r){r.$untouched=!r.$touched}else if("$untouched"in r){r.$touched=!r.$untouched}e.$state=d({},e.$state,r);return s()}return r}var ve=function(t){v(r,t);function r(){var e;var t;l(this,r);for(var n=arguments.length,i=new Array(n),a=0;a with the name '".concat(t,"' must be used underneath a component or withForm() HOC, otherwise it's isolated."));u(t,"You should assign a name to , otherwise it will be isolated!");if(r.$$register){r.$$register(t,this.$fieldHandler)}this.$prevValue=this.$state.$value;G(this.props.$ref,this.$fieldutil)}},{key:"componentWillUnmount",value:function e(){if(this.$formContext.$$unregister){this.$formContext.$$unregister(this.props.name,this.$fieldHandler,this.props.$reserveOnUnmount)}this.isMounting=false;G(this.props.$ref,null)}},{key:"componentDidUpdate",value:function e(t){var r=this.props.name;if(r!==t.name){if(this.$formContext.$$register){this.$formContext.$$register(r,this.$fieldHandler,t.name)}}G(this.props.$ref,this.$fieldutil);if(this.$state.$value!==this.$prevValue){if(!(r in(this.$formContext.$$registers||{}))){this.$registered.$$triggerChange({$newValue:this.$state.$value,$prevValue:this.$prevValue})}this.$prevValue=this.$state.$value}}},{key:"_render",value:function e(){var t=this.$fieldutil=d({$name:this.props.name},this.$registered.$getState(),this.$registered,{$$formutil:this.$formContext.$formutil});return ce(t,this.props)}},{key:"render",value:function t(){var r=this;var n=!this.$formContext;return e.createElement(E.Consumer,null,function(e){r.$formContext=e;if(!r.$fieldHandler){r.$fieldHandler=de(r,r)}r.$registered=(e.$$registers||{})[r.$fieldHandler.$name]||r.$fieldHandler;if(n){r.$fieldHandler.$$reset();r.$fieldHandler.$validate()}return r._render()})}}]);return r}(a);ve.displayName=$e;function he(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=function(n){v(i,n);function i(){l(this,i);return b(this,h(i).apply(this,arguments))}f(i,[{key:"render",value:function n(){var i=Object.assign({},this.props);var a=this.props,u=a.component,o=g(a,["component"]);["$validators","$asyncValidators","$validateLazy","$reserveOnUnmount","$defaultValue","$defaultState","$onFieldChange","$parser","$formatter","$ref","name"].concat(Object.keys(d({},r.$validators,r.$asyncValidators,i.$validators,i.$asyncValidators))).forEach(function(e){if(e in i){if(e==="$validators"||e==="$asyncValidators"||e==="$defaultState"){o[e]=d({},r[e],i[e])}delete i[e]}});return e.createElement(ve,Object.assign({},r,o,{render:function r(n){return e.createElement(t,Object.assign({},i,{$fieldutil:n}))}}))}}]);return i}(a);n.displayName="React.Formutil.withField."+(t.displayName||t.name||"Anonymous");return o(n,t)}var pe=M(he);var me=function(t){v(r,t);function r(){l(this,r);return b(this,h(r).apply(this,arguments))}f(r,[{key:"render",value:function t(){var r=this;var n=this.props,i=n.$fieldutil,a=n.value,u=n.onChange,o=n.onFocus,s=n.onBlur,l=n.checked,$=n.unchecked,f=g(n,["$fieldutil","value","onChange","onFocus","onBlur","checked","unchecked"]);var c=this.props.type;var d={value:"compositionValue"in this?this.compositionValue:a,onCompositionEnd:function e(t){r.composition=false;delete r.compositionValue;d.onChange(t)},onCompositionStart:function e(){return r.composition=true},onChange:function e(t){var n=t.target.value;if(r.composition){r.compositionValue=n;r.forceUpdate()}else{u(n,t)}},onFocus:o,onBlur:s};var v="input";switch(c){case"select":v=c;d.onChange=function(e){var t=e.target;var r=t.multiple?[].slice.call(t.options).filter(function(e){return e.selected}).map(function(e){return e.value}):t.value;u(r,e)};delete f.type;break;case"textarea":v=c;delete f.type;break;case"checkbox":case"radio":d={checked:a===l,onChange:function e(t){u(t.target.checked?l:$,t)},onFocus:o,onBlur:s};break;default:break}return e.createElement(v,Object.assign({},f,d))}}]);return r}(a);me.displayName="React.Formutil.EasyField.Native";me.defaultProps={value:"",type:"text",checked:true,unchecked:false};var ge=t({}),ye=ge.Provider,be=ge.Consumer;var Ve=function(t){v(r,t);function r(){l(this,r);return b(this,h(r).apply(this,arguments))}f(r,[{key:"getGroupContext",value:function e(){return this.props}},{key:"_render",value:function t(){var r=this.props,a=r.className,u=r.groupNode,o=r.children;var s={GroupOption:we,Field:Fe};var l=_(o)?o(s):n.map(o,function(e){return i(e,s)});if(u===null){return l}return e.createElement(u,{className:a},l)}},{key:"render",value:function t(){return e.createElement(ye,{value:this.getGroupContext()},this._render())}}]);return r}(a);Ve.displayName="React.Formutil.EasyField.Group";Ve.defaultProps={type:"checkbox",groupNode:"div"};var we=function(t){v(r,t);function r(){l(this,r);return b(this,h(r).apply(this,arguments))}f(r,[{key:"componentDidMount",value:function e(){u("$value"in this.props,"You should pass a $value to .")}},{key:"render",value:function t(){var r=this.props,n=r.$value,i=r.onChange,a=r.onFocus,u=r.onBlur,o=g(r,["$value","onChange","onFocus","onBlur"]);return e.createElement(be,null,function(t){var r=t.type,s=t.name;var l=r==="radio"?{checked:t.value===n,onChange:function e(r){t.onChange(n,r);i&&i(r)}}:r==="checkbox"?{checked:t.value.indexOf(n)>-1,onChange:function e(r){t.onChange(r.target.checked?t.value.concat(n):t.value.filter(function(e){return e!==n}),r);i&&i(r)}}:{value:t.value,onChange:function e(r){t.onChange(r);i&&i(r)}};return e.createElement("input",Object.assign({name:s},o,l,{type:r,onFocus:function e(r){t.onFocus(r);a&&a(r)},onBlur:function e(r){t.onBlur(r);u&&u(r)}}))})}}]);return r}(a);we.displayName="React.Formutil.EasyField.Group.Option";var Fe=function(t){v(r,t);function r(){l(this,r);return b(this,h(r).apply(this,arguments))}f(r,[{key:"componentDidMount",value:function e(){u(false,'The "Field" property in EasyField\'s children-props has been deprecated. Please use "GroupOption" instead.')}},{key:"render",value:function t(){return e.createElement(we,this.props)}}]);return r}(a);Fe.displayName="React.Formutil.EasyField.Group.Option.Deprecated";var ke=e.Frament||"div";var Ce=function(t){v(r,t);function r(e){var t;l(this,r);t=b(this,h(r).call(this,e));t.id=0;t.latestValue=t.props.value;t.$formutil=void 0;t.FieldValidators={required:function e(t){return t!==null}};t.$onFormChange=function(e){e.$onValidates(function(e){var r=e.$invalid,n=e.$params;if(r){if(t.props.value.length){t.props.onChange(t.latestValue=[])}}else if(!s(t.props.value,n.list)){t.props.onChange(t.latestValue=n.list)}})};t.swap=function(e,r,n){return t.$setState(function(t){var n=t.items;var i=[n[e],n[r]];n[r]=i[0];n[e]=i[1];return n},n)};t.insert=function(){var e,r,n;for(var i=arguments.length,a=new Array(i),u=0;u=t}],["max",function(e,t){return A(e)||e*1<=t}],["min",function(e,t){return A(e)||e*1>=t}],["pattern",function(e,t){return A(e)||t.test(e)}],["enum",function(e,t){return A(e)||t.indexOf(e)>-1}],["checker",function(e,t,r){return t(e,r)}]].reduce(function(e,t){var r=V(t,2),n=r[0],i=r[1];e[n]=function e(t,r,a){var u=a.validMessage,o=u===void 0?{}:u;return i.apply(void 0,arguments)||o[n]||"Error input: ".concat(n)};return e},{});var Oe="React.Formutil.EasyField";var Ee={validMessage:{},valuePropName:"value",changePropName:"onChange",focusPropName:"onFocus",blurPropName:"onBlur",$parser:function e(t){return typeof t==="string"?t.trim():t}};function je(e,t,r){var n;var i=t.valuePropName,a=t.changePropName,u=t.focusPropName,o=t.blurPropName,s=t.passUtil;var l=function e(t){return t&&t.target?t.target[i]:t};var $=d({},r,(n={},c(n,i,e.$viewValue),c(n,a,function(){for(var r=arguments.length,n=new Array(r),i=0;i=16.8, Please upgrade your reactjs.")}var t=e.useContext;var r=t(E);return r}function Te(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!e.useState){throw new Error("Hooks api need react@>=16.8, Please upgrade your reactjs.")}var n=e.useState,i=e.useLayoutEffect,a=e.useRef;var o;if(t){if(typeof t==="string"){o=t;r.name=o}else{r=t;o=r.name}}var s=Ae();var l=a({}).current;var $=a([]);var f;l.$formContext=s;l.props=r;l.$setState=p;var c=n(function(){l.$$FIELD_UUID=fe();l.$fieldHandler=f=de(l);var e=l.$fieldHandler.$$reset();l.$fieldHandler.$validate();return e}),v=V(c,2),h=v[1];if(!f){f=(s.$$registers||{})[l.$fieldHandler.$name]||l.$fieldHandler}i(function(){var e=l.$state;if(l.isMounting){if(!(o in(s.$$registers||{}))){var t=l.$prevValue;f.$$triggerChange({$newValue:e.$value,$prevValue:t})}}l.$prevValue=e.$value},[l.$state.$value]);i(function(){l.isMounting=true;u(!o||s.$formutil,"You should enusre that the useField() with the name '".concat(o,"' must be used underneath a component or withForm() HOC, otherwise it's isolated."));u(o,"You should pass a name argument to useField(), otherwise it will be isolated!");return function(){l.isMounting=false;G(r.$ref,null)}},[]);i(function(){if(s.$$register){s.$$register(o,l.$fieldHandler)}return function(){if(s.$$unregister){s.$$unregister(o,l.$fieldHandler,!l.isMounting&&r.$reserveOnUnmount)}}},[o]);i(function(){G(r.$ref,l.$fieldutil)});i(function(){if($.current.length>0){var e=w($.current);$.current.length=0;while(e.length){e.pop()(l.$fieldutil)}}});function p(e,t){return new Promise(function(r){var n=function e(){return r(H(t,l.$fieldutil))};if(l.isMounting){if(o in(s.$$registers||{})){s.$$onChange(o,e,n)}else{h(f.$$merge(e));f.$$detectChange(e);$.current.push(n)}}else{f.$$merge(e);n()}})}return l.$fieldutil=d({$name:o},f.$getState(),f,{$$formutil:s.$formutil})}function Re(){var e=Ae(),t=e.$formutil;return t}function Ue(e){e=d({},Ee,e,{children:null});var t=xe(e),r=t.fieldProps,n=t.childProps;var i=Te(r);return je(i,r,n)}export{Ne as EasyField,ve as Field,ne as Form,_e as connect,Te as useField,Re as useForm,Ue as useHandler,pe as withField,ae as withForm}; diff --git a/dist/react-formutil.umd.development.js b/dist/react-formutil.umd.development.js index 16acffa..ec98901 100644 --- a/dist/react-formutil.umd.development.js +++ b/dist/react-formutil.umd.development.js @@ -204,329 +204,7 @@ throw new TypeError("Invalid attempt to destructure non-iterable instance"); } - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - function unwrapExports (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; - } - - function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; - } - - var key = '__global_unique_id__'; - - var _gud_1_0_0_gud = function() { - return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1; - }; - - /** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - function makeEmptyFunction(arg) { - return function () { - return arg; - }; - } - - /** - * This function accepts and discards inputs; it has no side effects. This is - * primarily useful idiomatically for overridable function endpoints which - * always need to be callable, since JS lacks a null-call idiom ala Cocoa. - */ - var emptyFunction = function emptyFunction() {}; - - emptyFunction.thatReturns = makeEmptyFunction; - emptyFunction.thatReturnsFalse = makeEmptyFunction(false); - emptyFunction.thatReturnsTrue = makeEmptyFunction(true); - emptyFunction.thatReturnsNull = makeEmptyFunction(null); - emptyFunction.thatReturnsThis = function () { - return this; - }; - emptyFunction.thatReturnsArgument = function (arg) { - return arg; - }; - - var emptyFunction_1 = emptyFunction; - - /** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - - var warning = emptyFunction_1; - - { - var printWarning = function printWarning(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; - - warning = function warning(condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - - if (format.indexOf('Failed Composite propType: ') === 0) { - return; // Ignore CompositeComponent proptype check. - } - - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - - printWarning.apply(undefined, [format].concat(args)); - } - }; - } - - var warning_1 = warning; - - var implementation = createCommonjsModule(function (module, exports) { - - exports.__esModule = true; - - - - var _react2 = _interopRequireDefault(React__default); - - - - var _propTypes2 = _interopRequireDefault(PropTypes); - - - - var _gud2 = _interopRequireDefault(_gud_1_0_0_gud); - - - - var _warning2 = _interopRequireDefault(warning_1); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - var MAX_SIGNED_31_BIT_INT = 1073741823; - - // Inlined Object.is polyfill. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - function objectIs(x, y) { - if (x === y) { - return x !== 0 || 1 / x === 1 / y; - } else { - return x !== x && y !== y; - } - } - - function createEventEmitter(value) { - var handlers = []; - return { - on: function on(handler) { - handlers.push(handler); - }, - off: function off(handler) { - handlers = handlers.filter(function (h) { - return h !== handler; - }); - }, - get: function get() { - return value; - }, - set: function set(newValue, changedBits) { - value = newValue; - handlers.forEach(function (handler) { - return handler(value, changedBits); - }); - } - }; - } - - function onlyChild(children) { - return Array.isArray(children) ? children[0] : children; - } - - function createReactContext(defaultValue, calculateChangedBits) { - var _Provider$childContex, _Consumer$contextType; - - var contextProp = '__create-react-context-' + (0, _gud2.default)() + '__'; - - var Provider = function (_Component) { - _inherits(Provider, _Component); - - function Provider() { - var _temp, _this, _ret; - - _classCallCheck(this, Provider); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.emitter = createEventEmitter(_this.props.value), _temp), _possibleConstructorReturn(_this, _ret); - } - - Provider.prototype.getChildContext = function getChildContext() { - var _ref; - - return _ref = {}, _ref[contextProp] = this.emitter, _ref; - }; - - Provider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { - if (this.props.value !== nextProps.value) { - var oldValue = this.props.value; - var newValue = nextProps.value; - var changedBits = void 0; - - if (objectIs(oldValue, newValue)) { - changedBits = 0; // No change - } else { - changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT; - { - (0, _warning2.default)((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits); - } - - changedBits |= 0; - - if (changedBits !== 0) { - this.emitter.set(nextProps.value, changedBits); - } - } - } - }; - - Provider.prototype.render = function render() { - return this.props.children; - }; - - return Provider; - }(React__default.Component); - - Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = _propTypes2.default.object.isRequired, _Provider$childContex); - - var Consumer = function (_Component2) { - _inherits(Consumer, _Component2); - - function Consumer() { - var _temp2, _this2, _ret2; - - _classCallCheck(this, Consumer); - - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - return _ret2 = (_temp2 = (_this2 = _possibleConstructorReturn(this, _Component2.call.apply(_Component2, [this].concat(args))), _this2), _this2.state = { - value: _this2.getValue() - }, _this2.onUpdate = function (newValue, changedBits) { - var observedBits = _this2.observedBits | 0; - if ((observedBits & changedBits) !== 0) { - _this2.setState({ value: _this2.getValue() }); - } - }, _temp2), _possibleConstructorReturn(_this2, _ret2); - } - - Consumer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { - var observedBits = nextProps.observedBits; - - this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default - : observedBits; - }; - - Consumer.prototype.componentDidMount = function componentDidMount() { - if (this.context[contextProp]) { - this.context[contextProp].on(this.onUpdate); - } - var observedBits = this.props.observedBits; - - this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default - : observedBits; - }; - - Consumer.prototype.componentWillUnmount = function componentWillUnmount() { - if (this.context[contextProp]) { - this.context[contextProp].off(this.onUpdate); - } - }; - - Consumer.prototype.getValue = function getValue() { - if (this.context[contextProp]) { - return this.context[contextProp].get(); - } else { - return defaultValue; - } - }; - - Consumer.prototype.render = function render() { - return onlyChild(this.props.children)(this.state.value); - }; - - return Consumer; - }(React__default.Component); - - Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = _propTypes2.default.object, _Consumer$contextType); - - - return { - Provider: Provider, - Consumer: Consumer - }; - } - - exports.default = createReactContext; - module.exports = exports['default']; - }); - - unwrapExports(implementation); - - var lib = createCommonjsModule(function (module, exports) { - - exports.__esModule = true; - - - - var _react2 = _interopRequireDefault(React__default); - - - - var _implementation2 = _interopRequireDefault(implementation); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.default = _react2.default.createContext || _implementation2.default; - module.exports = exports['default']; - }); - - var createContext = unwrapExports(lib); - - var FormContext = createContext({}); + var FormContext = React.createContext({}); /** * Copyright (c) 2014-present, Facebook, Inc. @@ -535,10 +213,10 @@ * LICENSE file in the root directory of this source tree. */ - var warning$1 = function() {}; + var warning = function() {}; { - var printWarning$1 = function printWarning(format, args) { + var printWarning = function printWarning(format, args) { var len = arguments.length; args = new Array(len > 1 ? len - 1 : 0); for (var key = 1; key < len; key++) { @@ -560,7 +238,7 @@ } catch (x) {} }; - warning$1 = function(condition, format, args) { + warning = function(condition, format, args) { var len = arguments.length; args = new Array(len > 2 ? len - 2 : 0); for (var key = 2; key < len; key++) { @@ -573,12 +251,12 @@ ); } if (!condition) { - printWarning$1.apply(null, [format].concat(args)); + printWarning.apply(null, [format].concat(args)); } }; } - var warning_1$1 = warning$1; + var warning_1 = warning; var OBJECT_PROTO = Object.getPrototypeOf({}); var PATH_REGEXP = /\s*(?:\]\s*\.|\]\s*\[|\.|\[|\])\s*/g; @@ -687,7 +365,7 @@ var target = args[0], path = args[1], value = args[2]; - warning_1$1(typeof path === 'string', "The second parameter(".concat(JSON.stringify(path), ") of parsePath() must be a string.")); + warning_1(typeof path === 'string', "The second parameter(".concat(JSON.stringify(path), ") of parsePath() must be a string.")); var pathSymbols = (path.match(PATH_REGEXP) || []).map(function (s) { return s.replace(/\s/g, ''); }); @@ -744,7 +422,7 @@ } } } catch (error) { - warning_1$1(false, "The name '%s' of Field seems is not a legal expression.", path); + warning_1(false, "The name '%s' of Field seems is not a legal expression.", path); } if (args.length > 2) { @@ -850,7 +528,7 @@ $curRegistered = _ref2[0], $handler = _ref2[1]; - warning_1$1($curRegistered.$$reserved, "The Field with a name '".concat(name, "' has been registered!")); + warning_1($curRegistered.$$reserved, "The Field with a name '".concat(name, "' has been registered!")); $handler.$$reset($curRegistered.$getState()); hasDup = delete $$regDuplications[name]; }); @@ -1053,7 +731,7 @@ _this.$$setFormErrors = function (validResults, callback) { if (validResults && (validResults instanceof Error || typeof validResults !== 'object')) { - warning_1$1(false, "The result of $validator in should always return None(null,undefined) or an object contains error message of Field."); + warning_1(false, "The result of $validator in should always return None(null,undefined) or an object contains error message of Field."); return _this.$render(callback); } @@ -1082,8 +760,8 @@ _this.$getField = function (name) { var field = _this.$$getRegister(name); - warning_1$1(!name || field, "$getField('".concat(name, "') fail to find the matched Field. Maybe it has been unmounted.")); - warning_1$1(name, "You should pass a name of the mounted Field to $getField()."); + warning_1(!name || field, "$getField('".concat(name, "') fail to find the matched Field. Maybe it has been unmounted.")); + warning_1(name, "You should pass a name of the mounted Field to $getField()."); if (field) { return field.$new(); @@ -1602,6 +1280,14 @@ $defaultStates: {} }; + function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; + } + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + var reactIs_development = createCommonjsModule(function (module, exports) { @@ -2032,7 +1718,7 @@ } function warningValidatorReturn(result, key, name) { - warning_1$1(!isUndefined(result), "You should return a string or Error when the validation('".concat(name && name + ': ').concat(key, "') failed, otherwise return true.")); + warning_1(!isUndefined(result), "You should return a string or Error when the validation('".concat(name && name + ': ').concat(key, "') failed, otherwise return true.")); } var propTypes = { @@ -2454,8 +2140,8 @@ this.isMounting = true; var $name = this.props.name, $formContext = this.$formContext; - warning_1$1(!$name || $formContext.$formutil, "You should enusre that the with the name '".concat($name, "' must be used underneath a component or withForm() HOC, otherwise it's isolated.")); - warning_1$1($name, "You should assign a name to , otherwise it will be isolated!"); + warning_1(!$name || $formContext.$formutil, "You should enusre that the with the name '".concat($name, "' must be used underneath a component or withForm() HOC, otherwise it's isolated.")); + warning_1($name, "You should assign a name to , otherwise it will be isolated!"); if ($formContext.$$register) { $formContext.$$register($name, this.$fieldHandler); @@ -2711,7 +2397,7 @@ /** @type {any} */ - var _createContext = createContext({}), + var _createContext = React.createContext({}), Provider = _createContext.Provider, Consumer = _createContext.Consumer; @@ -2796,7 +2482,7 @@ _createClass(EasyFieldGroupOption, [{ key: "componentDidMount", value: function componentDidMount() { - warning_1$1('$value' in this.props, "You should pass a $value to ."); + warning_1('$value' in this.props, "You should pass a $value to ."); } }, { key: "render", @@ -2871,7 +2557,7 @@ _createClass(DeprecatedEasyFieldGroupOption, [{ key: "componentDidMount", value: function componentDidMount() { - warning_1$1(false, "The \"Field\" property in EasyField's children-props has been deprecated. Please use \"GroupOption\" instead."); + warning_1(false, "The \"Field\" property in EasyField's children-props has been deprecated. Please use \"GroupOption\" instead."); } }, { key: "render", @@ -3656,8 +3342,8 @@ }, [$this.$state.$value]); useLayoutEffect(function () { $this.isMounting = true; - warning_1$1(!$name || $formContext.$formutil, "You should enusre that the useField() with the name '".concat($name, "' must be used underneath a component or withForm() HOC, otherwise it's isolated.")); - warning_1$1($name, "You should pass a name argument to useField(), otherwise it will be isolated!"); + warning_1(!$name || $formContext.$formutil, "You should enusre that the useField() with the name '".concat($name, "' must be used underneath a component or withForm() HOC, otherwise it's isolated.")); + warning_1($name, "You should pass a name argument to useField(), otherwise it will be isolated!"); return function () { $this.isMounting = false; createRef(props.$ref, null); diff --git a/dist/react-formutil.umd.development.js.map b/dist/react-formutil.umd.development.js.map index 78bc3c8..9c71688 100644 --- a/dist/react-formutil.umd.development.js.map +++ b/dist/react-formutil.umd.development.js.map @@ -1 +1 @@ -{"version":3,"file":"react-formutil.umd.development.js","sources":["../node_modules/_gud@1.0.0@gud/index.js","../node_modules/_fbjs@0.8.17@fbjs/lib/emptyFunction.js","../node_modules/_fbjs@0.8.17@fbjs/lib/warning.js","../node_modules/_create-react-context@0.2.3@create-react-context/lib/implementation.js","../node_modules/_create-react-context@0.2.3@create-react-context/lib/index.js","../src/context.js","../node_modules/_warning@4.0.3@warning/warning.js","../src/utils.js","../src/Form.js","../node_modules/_react-is@16.8.6@react-is/cjs/react-is.development.js","../node_modules/_react-is@16.8.6@react-is/index.js","../node_modules/_hoist-non-react-statics@3.3.0@hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../src/withForm.js","../src/fieldHelper.js","../src/Field.js","../src/withField.js","../src/EasyField/Native.js","../src/EasyField/Group.js","../node_modules/_react-fast-compare@2.0.4@react-fast-compare/index.js","../src/EasyField/List.js","../src/EasyField/easyFieldHandler.js","../src/EasyField/index.js","../src/connect.js","../src/hooks/useFormContext.js","../src/hooks/useField.js","../src/hooks/useForm.js","../src/hooks/useHandler.js"],"sourcesContent":["// @flow\n'use strict';\n\nvar key = '__global_unique_id__';\n\nmodule.exports = function() {\n return global[key] = (global[key] || 0) + 1;\n};\n","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar emptyFunction = require('./emptyFunction');\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (process.env.NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;","'use strict';\n\nexports.__esModule = true;\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _gud = require('gud');\n\nvar _gud2 = _interopRequireDefault(_gud);\n\nvar _warning = require('fbjs/lib/warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar MAX_SIGNED_31_BIT_INT = 1073741823;\n\n// Inlined Object.is polyfill.\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\nfunction objectIs(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\n\nfunction createEventEmitter(value) {\n var handlers = [];\n return {\n on: function on(handler) {\n handlers.push(handler);\n },\n off: function off(handler) {\n handlers = handlers.filter(function (h) {\n return h !== handler;\n });\n },\n get: function get() {\n return value;\n },\n set: function set(newValue, changedBits) {\n value = newValue;\n handlers.forEach(function (handler) {\n return handler(value, changedBits);\n });\n }\n };\n}\n\nfunction onlyChild(children) {\n return Array.isArray(children) ? children[0] : children;\n}\n\nfunction createReactContext(defaultValue, calculateChangedBits) {\n var _Provider$childContex, _Consumer$contextType;\n\n var contextProp = '__create-react-context-' + (0, _gud2.default)() + '__';\n\n var Provider = function (_Component) {\n _inherits(Provider, _Component);\n\n function Provider() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, Provider);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.emitter = createEventEmitter(_this.props.value), _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n Provider.prototype.getChildContext = function getChildContext() {\n var _ref;\n\n return _ref = {}, _ref[contextProp] = this.emitter, _ref;\n };\n\n Provider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n if (this.props.value !== nextProps.value) {\n var oldValue = this.props.value;\n var newValue = nextProps.value;\n var changedBits = void 0;\n\n if (objectIs(oldValue, newValue)) {\n changedBits = 0; // No change\n } else {\n changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;\n if (process.env.NODE_ENV !== 'production') {\n (0, _warning2.default)((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);\n }\n\n changedBits |= 0;\n\n if (changedBits !== 0) {\n this.emitter.set(nextProps.value, changedBits);\n }\n }\n }\n };\n\n Provider.prototype.render = function render() {\n return this.props.children;\n };\n\n return Provider;\n }(_react.Component);\n\n Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = _propTypes2.default.object.isRequired, _Provider$childContex);\n\n var Consumer = function (_Component2) {\n _inherits(Consumer, _Component2);\n\n function Consumer() {\n var _temp2, _this2, _ret2;\n\n _classCallCheck(this, Consumer);\n\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return _ret2 = (_temp2 = (_this2 = _possibleConstructorReturn(this, _Component2.call.apply(_Component2, [this].concat(args))), _this2), _this2.state = {\n value: _this2.getValue()\n }, _this2.onUpdate = function (newValue, changedBits) {\n var observedBits = _this2.observedBits | 0;\n if ((observedBits & changedBits) !== 0) {\n _this2.setState({ value: _this2.getValue() });\n }\n }, _temp2), _possibleConstructorReturn(_this2, _ret2);\n }\n\n Consumer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {\n var observedBits = nextProps.observedBits;\n\n this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default\n : observedBits;\n };\n\n Consumer.prototype.componentDidMount = function componentDidMount() {\n if (this.context[contextProp]) {\n this.context[contextProp].on(this.onUpdate);\n }\n var observedBits = this.props.observedBits;\n\n this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default\n : observedBits;\n };\n\n Consumer.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.context[contextProp]) {\n this.context[contextProp].off(this.onUpdate);\n }\n };\n\n Consumer.prototype.getValue = function getValue() {\n if (this.context[contextProp]) {\n return this.context[contextProp].get();\n } else {\n return defaultValue;\n }\n };\n\n Consumer.prototype.render = function render() {\n return onlyChild(this.props.children)(this.state.value);\n };\n\n return Consumer;\n }(_react.Component);\n\n Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = _propTypes2.default.object, _Consumer$contextType);\n\n\n return {\n Provider: Provider,\n Consumer: Consumer\n };\n}\n\nexports.default = createReactContext;\nmodule.exports = exports['default'];","'use strict';\n\nexports.__esModule = true;\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _implementation = require('./implementation');\n\nvar _implementation2 = _interopRequireDefault(_implementation);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _react2.default.createContext || _implementation2.default;\nmodule.exports = exports['default'];","import createContext from 'create-react-context';\n\nexport default createContext({});\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","import warning from 'warning';\n\nconst OBJECT_PROTO = Object.getPrototypeOf({});\nconst PATH_REGEXP = /\\s*(?:\\]\\s*\\.|\\]\\s*\\[|\\.|\\[|\\])\\s*/g;\nconst Root = isUndefined(window) ? global : window;\n\nexport function isUndefined(arg) {\n return typeof arg === 'undefined';\n}\n\nexport function isFunction(arg) {\n return typeof arg === 'function';\n}\n\nexport function isEmpty(arg) {\n return isUndefined(arg) || arg === null || arg + '' === '';\n}\n\nexport function isPromise(promise) {\n return !!promise && isFunction(promise.then);\n}\n\nexport function isObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n\nexport function isPlainObj(obj) {\n if (!isObject(obj)) return false;\n if (null === Object.getPrototypeOf(obj)) return true;\n if (!isFunction(obj.constructor)) return false;\n\n return obj.constructor.prototype === OBJECT_PROTO;\n}\n\n// quick clone deeply\nexport function deepClone(obj) {\n if (obj && typeof obj === 'object') {\n if (Array.isArray(obj)) {\n const newObj = [];\n\n for (let i = 0, j = obj.length; i < j; i++) {\n newObj[i] = deepClone(obj[i]);\n }\n\n return newObj;\n } else if (isPlainObj(obj)) {\n const newObj = {};\n\n for (let i in obj) {\n newObj[i] = deepClone(obj[i]);\n }\n\n return newObj;\n }\n }\n\n return obj;\n}\n\nexport const runCallback = function(callback, ...args) {\n if (isFunction(callback)) {\n callback(...args);\n }\n\n return args[0];\n};\n\nexport function createHOC(withHOC) {\n return function(...args) {\n if (isFunction(args[0])) {\n return withHOC(...args);\n }\n\n return function(WrappedComponent) {\n return withHOC(WrappedComponent, args[0]);\n };\n };\n}\n\nconst VALID_PROPS = ['minlength', 'maxlength', 'max', 'min', 'required', 'pattern', 'step'];\nexport function isValidProp(prop) {\n return VALID_PROPS.indexOf(prop.toLowerCase()) > -1;\n}\n\n/* eslint-disable */\nconst executeWord = function(word) {\n try {\n const exec = new Function(\n 'origin',\n 'global',\n `return typeof ${word} === 'number' || (typeof ${word} !== 'undefined' && !(origin in global)) ? ${word} : origin`\n );\n return exec(word, Root);\n } catch (err) {\n return word;\n }\n};\n\n/**\n * @desc 解析表达式中赋值深路径对象\n *\n * @param {object} target 要赋值的对象\n * @param {string} path 赋值路径,eg:list[0].title\n * @param {any} [value] 要赋过去的值,如过不传,则返回解析路径后的值\n *\n * 使用示例:parsePath({}, 'list[0].authors[1].name', 'Lucy');\n */\nexport function parsePath(...args) {\n const [target, path, value] = args;\n\n warning(typeof path === 'string', `The second parameter(${JSON.stringify(path)}) of parsePath() must be a string.`);\n\n const pathSymbols = (path.match(PATH_REGEXP) || []).map(s => s.replace(/\\s/g, ''));\n const pathWords = path\n .split(PATH_REGEXP)\n .map(s => s.trim())\n .filter(item => item !== '');\n let scope = target;\n\n try {\n if (args.length < 3) {\n for (let index = 0, len = pathWords.length; index < len; index++) {\n const word = executeWord(pathWords[index]);\n\n if (index + 1 === len) {\n return scope[word];\n }\n\n if (isUndefined(scope[word])) {\n break;\n }\n\n scope = scope[word];\n }\n } else {\n for (let index = 0, length = pathWords.length; index < length; index++) {\n const word = executeWord(pathWords[index]);\n const nextWord = pathWords[index + 1];\n const symbol = pathSymbols[index];\n\n if (isUndefined(nextWord)) {\n scope[word] = value;\n break;\n }\n\n switch (symbol) {\n case '].':\n case '.':\n scope = isUndefined(scope[word]) ? (scope[word] = {}) : scope[word];\n break;\n\n case '][':\n case '[':\n const nextVarWord = executeWord(nextWord);\n\n scope = isUndefined(scope[word])\n ? (scope[word] = typeof nextVarWord === 'number' && nextVarWord >= 0 ? [] : {})\n : scope[word];\n break;\n\n default:\n scope[word] = value;\n break;\n }\n }\n }\n } catch (error) {\n warning(false, `The name '%s' of Field seems is not a legal expression.`, path);\n }\n\n if (args.length > 2) {\n return target;\n }\n}\n\nexport function createRef(ref, value) {\n if (ref) {\n if (isFunction(ref)) {\n ref(value);\n } else if ('current' in ref) {\n ref.current = value;\n }\n }\n}\n\nexport const arrayFind = (array, process) => {\n for (let i = 0, j = array.length; i < j; i++) {\n if (process(array[i]) === true) {\n return array[i];\n }\n }\n};\n\nexport const objectMap = (obj, handler) =>\n Object.keys(obj).reduce((newObj, key) => {\n newObj[key] = handler(obj[key], key, obj);\n return newObj;\n }, {});\n\nexport const objectEach = (obj, handler) => Object.keys(obj).forEach(key => handler(obj[key], key, obj));\n\nexport const toObject = (arr, handler, obj = {}) =>\n arr.reduce((...args) => {\n handler(...args);\n\n return args[0];\n }, obj);\n\nconst TODO_DELETE = undefined;\nfunction CLEAR(obj, pkey, pobj) {\n objectEach(obj, (value, key) => {\n if (value === TODO_DELETE) {\n delete obj[key];\n } else if (value && typeof value === 'object') {\n CLEAR(value, key, obj);\n }\n });\n\n if (pobj && Object.keys(obj).every(key => obj[key] === TODO_DELETE)) {\n pobj[pkey] = TODO_DELETE;\n CLEAR(pobj);\n }\n}\nexport const objectClear = (obj, name) => {\n if (!isUndefined(parsePath(obj, name))) {\n parsePath(obj, name, TODO_DELETE);\n\n CLEAR(obj);\n }\n};\n","import React, { Component, Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport FormContext from './context';\nimport * as utils from './utils';\nimport warning from 'warning';\n\nexport const FORM_VALIDATE_RESULT = 'FORM_VALIDATE_RESULT';\n\nlet requestFrame, cancelFrame;\n\nif (typeof requestAnimationFrame === 'function') {\n requestFrame = requestAnimationFrame;\n cancelFrame = cancelAnimationFrame;\n} else {\n requestFrame = setTimeout;\n cancelFrame = clearTimeout;\n}\n\nclass Form extends Component {\n static displayName = 'React.Formutil.Form';\n\n static propTypes = {\n render: PropTypes.func,\n component: PropTypes.func,\n children(props, ...args) {\n let pt = PropTypes.oneOfType([PropTypes.func, PropTypes.node]);\n\n if (!props.render && !props.component) {\n pt = pt.isRequired;\n }\n\n return pt(props, ...args);\n },\n $defaultValues: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $defaultStates: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $onFormChange: PropTypes.func,\n $validator: PropTypes.func,\n $processer: PropTypes.func,\n $ref: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n current: PropTypes.any\n })\n ])\n };\n\n static defaultProps = {\n $defaultValues: {},\n $defaultStates: {}\n };\n\n $$formPending;\n $$formValidatePromise;\n\n $$registers = {};\n $$deepRegisters = {};\n\n constructor(props) {\n super(props);\n\n this.$$defaultInitialize();\n }\n\n getFormContext() {\n return {\n $$registers: this.$$registers,\n $$register: this.$$register,\n $$unregister: this.$$unregister,\n $$onChange: this.$$onChange,\n $$getDefault: this.$$getDefault,\n $formutil: this.$formutil\n };\n }\n\n $$regDuplications = {};\n $$duplicateTimer;\n $$checkDuplication = () => {\n const { $$regDuplications } = this;\n let hasDup;\n\n utils.objectEach($$regDuplications, ([$curRegistered, $handler], name) => {\n warning($curRegistered.$$reserved, `The Field with a name '${name}' has been registered!`);\n\n $handler.$$reset($curRegistered.$getState());\n\n hasDup = delete $$regDuplications[name];\n });\n\n if (hasDup) {\n this.$render();\n }\n };\n\n /*\n * @desc 注册或者替换(preName)Field\n */\n $$register = (name, $handler, prevName) => {\n this.$$unregister(prevName, $handler);\n\n if (name) {\n const $curRegistered = this.$$getRegister(name);\n\n if ($curRegistered) {\n cancelFrame(this.$$duplicateTimer);\n\n this.$$regDuplications[name] = [$curRegistered, $handler];\n this.$$duplicateTimer = requestFrame(this.$$checkDuplication);\n } else {\n this.$$fieldChangedQueue.push({\n name,\n $newValue: $handler.$getState().$value\n });\n\n utils.objectClear(this.$$defaultValues, name);\n }\n\n this.$$registers[($handler.$name = name)] = $handler;\n\n this.createDeepRegisters();\n this.$render();\n }\n };\n\n $$unregister = (name, $handler, $$reserved) => {\n if (name) {\n if (name in this.$$regDuplications) {\n const [$curRegistered, $handler] = this.$$regDuplications[name];\n\n this.$$fieldChangedQueue.push({\n name,\n $newValue: $handler.$getState().$value,\n $prevValue: $curRegistered.$getState().$value\n });\n\n delete this.$$regDuplications[name];\n } else if (this.$$registers[name] === $handler) {\n if ($$reserved) {\n $handler.$$reserved = true;\n } else {\n delete this.$$registers[name];\n\n this.$$fieldChangedQueue.push({\n name,\n $prevValue: $handler.$getState().$value\n });\n\n utils.objectClear(this.$$defaultValues, name);\n }\n }\n\n this.createDeepRegisters();\n this.$render();\n }\n };\n\n $$defaultInitialize = () => {\n const { $defaultValues, $defaultStates } = this.props;\n\n this.$$defaultValues = this.$$deepParseObject(\n utils.deepClone(utils.isFunction($defaultValues) ? $defaultValues(this.props) || {} : $defaultValues)\n );\n this.$$defaultStates = this.$$deepParseObject(\n utils.deepClone(utils.isFunction($defaultStates) ? $defaultStates(this.props) || {} : $defaultStates)\n );\n };\n\n $$getDefault = () => ({\n $$defaultStates: this.$$defaultStates,\n $$defaultValues: this.$$defaultValues\n });\n\n $$deepParseObject(mayWeakObj, deepObj = {}) {\n utils.objectEach(mayWeakObj, (data, name) => utils.parsePath(deepObj, name, data));\n\n return deepObj;\n }\n\n $$triggerChangeTimer;\n $$fieldChangedQueue = [];\n $$triggerFormChange = () => {\n if (this.$$fieldChangedQueue.length) {\n const $$fieldChangedQueue = [...this.$$fieldChangedQueue];\n\n this.$$fieldChangedQueue.length = 0;\n\n const $newValues = {};\n const $prevValues = {};\n const $$registers = this.$$registers;\n let hasFormChanged = false;\n\n $$fieldChangedQueue.forEach(item => {\n if (!(item.name in $$registers)) {\n delete item.$newValue;\n }\n\n if (item.$newValue !== item.$prevValue) {\n if ('$newValue' in item && '$prevValue' in item) {\n const $handler = this.$$getRegister(item.name);\n\n if ($handler) {\n $handler.$$triggerChange(item);\n }\n }\n\n '$newValue' in item && utils.parsePath($newValues, item.name, item.$newValue);\n '$prevValue' in item && utils.parsePath($prevValues, item.name, item.$prevValue);\n\n hasFormChanged = true;\n }\n });\n\n if (hasFormChanged) {\n if (utils.isFunction(this.props.$validator)) {\n this.$$formValidate();\n }\n\n if (utils.isFunction(this.props.$onFormChange)) {\n this.props.$onFormChange(this.$formutil, $newValues, $prevValues);\n }\n }\n }\n };\n\n createDeepRegisters = () => (this.$$deepRegisters = this.$$deepParseObject(this.$$registers));\n\n $$getRegister = name => {\n if (name) {\n const field = this.$$registers[name] || utils.parsePath(this.$$deepRegisters, name);\n\n if (field) {\n return field;\n }\n }\n };\n\n $$formValidate = callback =>\n (this.$$formValidatePromise = new Promise(resolve => {\n const { $validator } = this.props;\n\n let $breakAsyncHandler;\n let $shouldCancelPrevAsyncValidate;\n let prevCallback;\n let validation;\n\n const result = $validator(this.$formutil.$params, this.formtutil);\n const execCallback = $formutil =>\n resolve(utils.runCallback(callback, utils.runCallback(prevCallback, $formutil)));\n\n if (utils.isPromise(result)) {\n if (!this.$$formPending) {\n this.$$formPending = true;\n\n this.$render();\n }\n\n $shouldCancelPrevAsyncValidate = setCallback => ($breakAsyncHandler = setCallback(execCallback));\n\n validation = result\n .then(() => void 0, reason => reason)\n .then(reason => {\n if ($breakAsyncHandler) {\n return $breakAsyncHandler;\n }\n\n this.$shouldCancelPrevAsyncValidate = null;\n\n this.$$formPending = false;\n\n return this.$$setFormErrors(reason, execCallback);\n });\n } else {\n if (this.$$formPending) {\n this.$$formPending = false;\n }\n\n validation = this.$$setFormErrors(result, execCallback);\n }\n\n if (this.$shouldCancelPrevAsyncValidate) {\n this.$shouldCancelPrevAsyncValidate(callback => {\n prevCallback = callback;\n\n return validation;\n });\n }\n\n this.$shouldCancelPrevAsyncValidate = $shouldCancelPrevAsyncValidate;\n }));\n\n $$setFormErrors = (validResults, callback) => {\n if (validResults && (validResults instanceof Error || typeof validResults !== 'object')) {\n warning(\n false,\n `The result of $validator in should always return None(null,undefined) or an object contains error message of Field.`\n );\n\n return this.$render(callback);\n }\n\n return this.$$setStates(\n validResults || {},\n (result, handler) => {\n const { $error = {} } = handler.$getState();\n\n if (result) {\n return {\n $error: {\n ...$error,\n [FORM_VALIDATE_RESULT]: result\n }\n };\n }\n\n if ($error[FORM_VALIDATE_RESULT]) {\n delete $error[FORM_VALIDATE_RESULT];\n\n return {\n $error\n };\n }\n\n return;\n },\n callback,\n true\n );\n };\n\n $getField = name => {\n const field = this.$$getRegister(name);\n\n warning(!name || field, `$getField('${name}') fail to find the matched Field. Maybe it has been unmounted.`);\n warning(name, `You should pass a name of the mounted Field to $getField().`);\n\n if (field) {\n return field.$new();\n }\n };\n\n $$onChange = (name, $state, callback) =>\n this.$setStates(\n {\n [name]: $state\n },\n callback\n );\n\n $$setStates = ($stateTree = {}, processer, callback, force) => {\n const $parsedTree = this.$$deepParseObject($stateTree);\n let hasStateChange = false;\n\n utils.objectEach(this.$$registers, (handler, name) => {\n const data = name in $stateTree ? $stateTree[name] : utils.parsePath($parsedTree, name);\n\n if (!utils.isUndefined(data) || force) {\n const $newState = processer(data, handler);\n\n if ($newState) {\n const $prevValue = this.$formutil.$weakParams[name];\n const { $value: $newValue } = handler.$$merge($newState);\n\n handler.$$detectChange($newState);\n\n if ('$value' in $newState || '$viewValue' in $newState) {\n const findItem = utils.arrayFind(this.$$fieldChangedQueue, item => item.name === name);\n\n if (findItem) {\n if (!('$prevValue' in findItem)) {\n findItem.$prevValue = findItem.$newValue;\n }\n\n findItem.$newValue = $newValue;\n } else {\n this.$$fieldChangedQueue.push({\n name,\n $newValue,\n $prevValue\n });\n }\n }\n\n hasStateChange = true;\n }\n }\n });\n\n if (hasStateChange) {\n return this.$render(callback);\n }\n\n return Promise.resolve(utils.runCallback(callback, this.$formutil));\n };\n\n componentDidMount() {\n utils.createRef(this.props.$ref, this.$formutil);\n }\n\n componentDidUpdate(prevProps) {\n utils.createRef(this.props.$ref, this.$formutil);\n\n cancelFrame(this.$$triggerChangeTimer);\n\n // ensure this calls to access the newest $formutil\n this.$$triggerChangeTimer = requestFrame(() => {\n this.$$triggerFormChange();\n });\n }\n\n componentWillUnmount() {\n utils.createRef(this.props.$ref, null);\n }\n\n $render = callback =>\n new Promise(resolve => this.forceUpdate(() => resolve(utils.runCallback(callback, this.$formutil))));\n\n $validates = (...args) => {\n let callback;\n\n if (utils.isFunction(args[args.length - 1])) {\n callback = args.pop();\n }\n\n if (args.length) {\n const flatter = names => {\n names.forEach(name => {\n if (Array.isArray(name)) {\n flatter(name);\n } else {\n const handler = this.$getField(name);\n\n if (handler) {\n handler.$validate();\n }\n }\n });\n };\n\n flatter(args);\n } else {\n utils.objectEach(this.$$registers, handler => handler.$validate());\n\n if (utils.isFunction(this.props.$validator)) {\n this.$$formValidate();\n }\n }\n\n return this.$onValidates(callback);\n };\n\n $onValidates = callback => {\n const filedValidatePromises = Object.keys(this.$$registers).map(name => this.$$registers[name].$onValidate());\n\n filedValidatePromises.push(this.$$formValidatePromise);\n\n return Promise.all(filedValidatePromises).then(() => utils.runCallback(callback, this.$formutil));\n };\n\n $validate = (name, callback) => {\n const handler = this.$getField(name);\n\n if (handler) {\n return handler.$validate(callback);\n }\n\n return utils.runCallback(callback);\n };\n\n $reset = ($stateTree, callback) => {\n this.$$defaultInitialize();\n\n if (utils.isFunction($stateTree)) {\n callback = $stateTree;\n $stateTree = {};\n }\n\n return this.$$setStates($stateTree, ($state, handler) => handler.$$reset($state), callback, true);\n };\n\n $setStates = ($stateTree, callback) => this.$$setStates($stateTree, $state => $state, callback);\n\n $setValues = ($valueTree, callback) => {\n this.$$deepParseObject(utils.deepClone($valueTree), this.$$defaultValues);\n\n return this.$$setStates($valueTree, $value => ({ $value }), callback);\n };\n\n $setFocuses = ($focusedTree, callback) => this.$$setStates($focusedTree, $focused => ({ $focused }), callback);\n $setDirts = ($dirtyTree, callback) => this.$$setStates($dirtyTree, $dirty => ({ $dirty }), callback);\n $setTouches = ($touchedTree, callback) => this.$$setStates($touchedTree, $touched => ({ $touched }), callback);\n $setPendings = ($pendingTree, callback) => this.$$setStates($pendingTree, $pending => ({ $pending }), callback);\n $setErrors = ($errorTree, callback) => this.$$setStates($errorTree, $error => ({ $error }), callback);\n\n $batchState = ($state, callback) => this.$setStates(utils.objectMap(this.$$registers, () => $state), callback);\n $batchDirty = ($dirty, callback) =>\n this.$batchState(\n {\n $dirty\n },\n callback\n );\n\n $batchTouched = ($touched, callback) =>\n this.$batchState(\n {\n $touched\n },\n callback\n );\n\n $batchFocused = ($focused, callback) =>\n this.$batchState(\n {\n $focused\n },\n callback\n );\n\n $batchPending = ($pending, callback) =>\n this.$batchState(\n {\n $pending\n },\n callback\n );\n\n $batchError = ($error, callback) =>\n this.$batchState(\n {\n $error\n },\n callback\n );\n\n _render() {\n const $formutil = this.$formutil;\n let { children, render, component } = this.props;\n\n if (component) {\n return createElement(component, { $formutil });\n }\n\n if (utils.isFunction(render)) {\n return render($formutil);\n }\n\n if (utils.isFunction(children)) {\n return children($formutil);\n }\n\n return Children.map(children, child =>\n child && utils.isFunction(child.type)\n ? cloneElement(child, {\n $formutil\n })\n : child\n );\n }\n\n render() {\n const { $processer } = this.props;\n const $stateArray = Object.keys(this.$$registers).map(path => ({\n path,\n $state: this.$$registers[path].$getState()\n }));\n\n const $weakParams = utils.toObject($stateArray, ($params, { path, $state }) => {\n if ($processer) {\n $processer($state, path);\n }\n\n if ('$value' in $state && ($state.$dirty || !utils.isUndefined($state.$value))) {\n $params[path] = $state.$value;\n }\n });\n\n const $pureParams = utils.toObject(\n $stateArray,\n ($params, { path, $state }) => path in $weakParams && utils.parsePath($params, path, $weakParams[path])\n );\n\n const $invalid = $stateArray.some(({ $state }) => $state.$invalid);\n const $dirty = $stateArray.some(({ $state }) => $state.$dirty);\n const $touched = $stateArray.some(({ $state }) => $state.$touched);\n const $focused = $stateArray.some(({ $state }) => $state.$focused);\n const $pending = this.$$formPending || $stateArray.some(({ $state }) => $state.$pending);\n\n const $formutil = (this.$formutil = {\n $$registers: { ...this.$$registers },\n $$deepRegisters: this.$$deepRegisters,\n $states: utils.toObject($stateArray, ($states, { path, $state }) => utils.parsePath($states, path, $state)),\n $params: {\n ...this.$$defaultValues,\n ...$pureParams\n },\n $errors: utils.toObject($stateArray, ($errors, { path, $state }) => {\n if ($state.$invalid) {\n utils.parsePath($errors, path, $state.$error);\n }\n }),\n $dirts: utils.toObject($stateArray, ($dirts, { path, $state }) =>\n utils.parsePath($dirts, path, $state.$dirty)\n ),\n $touches: utils.toObject($stateArray, ($touches, { path, $state }) =>\n utils.parsePath($touches, path, $state.$touched)\n ),\n $focuses: utils.toObject($stateArray, ($focuses, { path, $state }) =>\n utils.parsePath($focuses, path, $state.$focused)\n ),\n $pendings: utils.toObject($stateArray, ($pendings, { path, $state }) =>\n utils.parsePath($pendings, path, $state.$pending)\n ),\n\n $weakStates: utils.toObject($stateArray, ($states, { path, $state }) => ($states[path] = $state)),\n $weakParams,\n $weakErrors: utils.toObject($stateArray, ($errors, { path, $state }) => {\n if ($state.$invalid) {\n $errors[path] = $state.$error;\n }\n }),\n $weakDirts: utils.toObject($stateArray, ($dirts, { path, $state }) => ($dirts[path] = $state.$dirty)),\n $weakTouches: utils.toObject(\n $stateArray,\n ($touches, { path, $state }) => ($touches[path] = $state.$touched)\n ),\n $weakFocuses: utils.toObject(\n $stateArray,\n ($focuses, { path, $state }) => ($focuses[path] = $state.$focused)\n ),\n $weakPendings: utils.toObject(\n $stateArray,\n ($weakPendings, { path, $state }) => ($weakPendings[path] = $state.$pending)\n ),\n\n $getFirstError(name) {\n if (name) {\n const $fieldutil = $formutil.$getField(name);\n\n return $fieldutil && $fieldutil.$getFirstError();\n }\n\n for (let name in $formutil.$weakErrors) {\n const $fieldError = $formutil.$weakErrors[name];\n\n for (let key in $fieldError) {\n return $fieldError[key] instanceof Error ? $fieldError[key].message : $fieldError[key];\n }\n }\n },\n\n $render: this.$render,\n\n $getField: this.$getField,\n $onValidates: this.$onValidates,\n\n // get the newest $formutil\n $new: () => this.$formutil,\n\n $setStates: this.$setStates,\n $setValues: this.$setValues,\n $setErrors: this.$setErrors,\n $setTouches: this.$setTouches,\n $setDirts: this.$setDirts,\n $setFocuses: this.$setFocuses,\n\n $batchState: this.$batchState,\n $batchTouched: this.$batchTouched,\n $batchDirty: this.$batchDirty,\n $batchFocused: this.$batchFocused,\n\n $reset: this.$reset,\n $validates: this.$validates,\n $validate: this.$validate,\n\n $valid: !$invalid,\n $invalid,\n $dirty,\n $pristine: !$dirty,\n $touched,\n $untouched: !$touched,\n $focused,\n $pending\n });\n\n return {this._render()};\n }\n}\n\nexport default Form;\n","/** @license React v16.8.6\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\n\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;\nvar REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' ||\n // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);\n}\n\n/**\n * Forked from fbjs/warning:\n * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js\n *\n * Only change is we use console.warn instead of console.error,\n * and do nothing when 'console' is not supported.\n * This really simplifies the code.\n * ---\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar lowPriorityWarning = function () {};\n\n{\n var printWarning = function (format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.warn(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n lowPriorityWarning = function (condition, format) {\n if (format === undefined) {\n throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\nvar lowPriorityWarning$1 = lowPriorityWarning;\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_ASYNC_MODE_TYPE:\n case REACT_CONCURRENT_MODE_TYPE:\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n return type;\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n default:\n return $$typeof;\n }\n }\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n}\n\n// AsyncMode is deprecated along with isAsyncMode\nvar AsyncMode = REACT_ASYNC_MODE_TYPE;\nvar ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\n\nvar hasWarnedAboutDeprecatedIsAsyncMode = false;\n\n// AsyncMode should be deprecated\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}\nfunction isConcurrentMode(object) {\n return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.typeOf = typeOf;\nexports.AsyncMode = AsyncMode;\nexports.ConcurrentMode = ConcurrentMode;\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isValidElementType = isValidElementType;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict';\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar ReactIs = require('react-is');\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\n\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\n\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\n\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\n\nvar TYPE_STATICS = {};\nTYPE_STATICS[ReactIs.ForwardRef] = FORWARD_REF_STATICS;\n\nfunction getStatics(component) {\n if (ReactIs.isMemo(component)) {\n return MEMO_STATICS;\n }\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\n\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n\n return targetComponent;\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","import React, { Component } from 'react';\nimport Form from './Form';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withForm(WrappedComponent, config = {}) {\n class FormEnhanced extends Component {\n static displayName =\n 'React.Formutil.withForm.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n const { ...others } = this.props;\n const { component, ...formProps } = this.props;\n\n ['$defaultStates', '$defaultValues', '$onFormChange', '$validator', '$processer', '$ref'].forEach(prop => {\n if (prop in others) {\n if (prop === '$defaultStates' || prop === '$defaultValues') {\n formProps[prop] = { ...config[prop], ...others[prop] };\n }\n delete others[prop];\n }\n });\n\n return (\n }\n />\n );\n }\n }\n\n return hoistStatics(FormEnhanced, WrappedComponent);\n}\n\nexport default createHOC(withForm);\n","import { Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport * as utils from './utils';\nimport warning from 'warning';\nimport { FORM_VALIDATE_RESULT } from './Form';\n\nlet FIELD_UUID = 0;\nconst $baseState = {\n $valid: true,\n $invalid: false,\n\n $dirty: false,\n $pristine: true,\n\n $touched: false,\n $untouched: true,\n\n $focused: false,\n\n $pending: false,\n\n $error: {}\n};\n\nfunction isError(result) {\n return /*!utils.isUndefined(result) && */ result !== true;\n}\n\nfunction warningValidatorReturn(result, key, name) {\n warning(\n !utils.isUndefined(result),\n `You should return a string or Error when the validation('${name &&\n name + ': '}${key}') failed, otherwise return true.`\n );\n}\n\nexport const propTypes =\n process.env.NODE_ENV !== 'production'\n ? {\n name: PropTypes.string,\n\n $defaultValue: PropTypes.any,\n $defaultState: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $onFieldChange: PropTypes.func,\n $validators: PropTypes.object,\n $asyncValidators: PropTypes.object,\n $validateLazy: PropTypes.bool,\n $reserveOnUnmount: PropTypes.bool,\n $ref: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n current: PropTypes.any\n })\n ]),\n $parser: PropTypes.func,\n $formatter: PropTypes.func,\n\n render: PropTypes.func,\n component: PropTypes.func,\n children(props, ...args) {\n let pt = PropTypes.oneOfType([PropTypes.func, PropTypes.node]);\n\n if (!props.render && !props.component && props.children !== null) {\n pt = pt.isRequired;\n }\n\n return pt(props, ...args);\n }\n }\n : undefined;\n\nexport const displayName = 'React.Formutil.Field';\n\nexport function GET_FIELD_UUID() {\n return FIELD_UUID++;\n}\n\nexport function renderField($fieldutil, props) {\n let { children, render, component } = props;\n\n if (component) {\n return createElement(component, { $fieldutil });\n }\n\n if (utils.isFunction(render)) {\n return render($fieldutil);\n }\n\n if (utils.isFunction(children)) {\n return children($fieldutil);\n }\n\n return Children.map(children, child =>\n child && utils.isFunction(child.type)\n ? cloneElement(child, {\n $fieldutil\n })\n : child\n );\n}\n\nexport function createHandler($this, owner) {\n const $fieldHandler = {\n $$FIELD_UUID: $this.$$FIELD_UUID,\n\n $$reset,\n $$merge,\n $$detectChange,\n $$triggerChange,\n $onValidate,\n\n $new() {\n return $this.$fieldutil;\n },\n $picker: $getState,\n $getState,\n // not support in Hooks\n $getComponent() {\n return owner;\n },\n\n $reset($state, callback) {\n return $this.$setState($$reset($state), callback);\n },\n $getFirstError,\n $validate,\n $setState: $this.$setState,\n $render,\n $setValue,\n $setTouched,\n $setDirty,\n $setFocused,\n $setValidity,\n $setError,\n $setPending\n };\n\n let $$validatePromise;\n\n function $$detectChange($newState) {\n if ('$value' in $newState || '$viewValue' in $newState) {\n $validate();\n }\n }\n\n function $$triggerChange({ $newValue, $prevValue }) {\n const { $onFieldChange } = $this.props;\n\n if (utils.isFunction($onFieldChange)) {\n $onFieldChange($newValue, $prevValue, $this.$formContext.$formutil);\n }\n }\n\n function $onValidate(callback) {\n $$validatePromise.then(callback);\n\n return $$validatePromise;\n }\n\n function $$reset($newState) {\n let $initialState;\n\n const { props, $formContext } = $this;\n\n if ($formContext.$$getDefault) {\n const $name = props.name;\n const { $$defaultStates, $$defaultValues } = $formContext.$$getDefault();\n\n if ($name && $$defaultValues) {\n const $initialValue = utils.parsePath($$defaultValues, $name);\n\n $initialState = utils.parsePath($$defaultStates, $name) || {};\n\n if (!utils.isUndefined($initialValue)) {\n $initialState.$value = $initialValue;\n }\n }\n }\n\n const { $defaultValue, $defaultState } = props;\n\n return $$merge({\n ...$baseState, // the base state\n ...(utils.isFunction($defaultState) ? $defaultState(props) : $defaultState), // self default state\n $value: utils.isFunction($defaultValue)\n ? $defaultValue(props)\n : '$defaultValue' in props\n ? $defaultValue\n : '',\n ...$initialState, // the default state from Form\n ...$newState\n });\n }\n\n function $getState() {\n return { ...$this.$state };\n }\n\n function $validate(callback) {\n return ($$validatePromise = new Promise(resolve => {\n const { props, $formContext } = $this;\n const $validators = { ...props.$validators, ...props.$asyncValidators };\n const {\n $value,\n $pending,\n $error: { ...$newError }\n } = $this.$state;\n const { $formutil } = $formContext;\n const $validError = {};\n let $skipRestValidate = false;\n let $breakAsyncHandler;\n let $shouldCancelPrevAsyncValidate;\n let prevCallback;\n let validation;\n\n delete $newError[FORM_VALIDATE_RESULT];\n\n const $validatePromises = Object.keys($validators).reduce((promises, key) => {\n delete $newError[key];\n\n if (!$skipRestValidate && props[key] != null) {\n const result = $validators[key]($value, props[key], {\n ...props,\n $formutil,\n $fieldutil: $this.$fieldutil,\n $validError\n });\n\n if (utils.isPromise(result)) {\n promises.push(\n // @ts-ignore\n result.catch(reason => {\n if (!$breakAsyncHandler) {\n $setValidity(key, reason || key);\n }\n })\n );\n } else if (isError(result)) {\n $validError[key] = result || key;\n\n warningValidatorReturn(result, key, props.name);\n\n if (props.$validateLazy) {\n $skipRestValidate = true;\n }\n }\n }\n\n return promises;\n }, []);\n const execCallback = $fieldutil =>\n resolve(utils.runCallback(callback, utils.runCallback(prevCallback, $fieldutil)));\n\n if ($validatePromises.length) {\n if (!$pending) {\n $setPending(true);\n }\n\n $shouldCancelPrevAsyncValidate = setCallback => ($breakAsyncHandler = setCallback(execCallback));\n\n $validatePromises.push(\n $setError({\n ...$newError,\n ...$validError\n })\n );\n\n validation = Promise.all($validatePromises).then(() => {\n if ($breakAsyncHandler) {\n return $breakAsyncHandler;\n }\n\n $this.$shouldCancelPrevAsyncValidate = null;\n\n return $setPending(false, execCallback);\n });\n } else {\n if ($pending) {\n $setPending(false);\n }\n\n validation = $setError(\n {\n ...$newError,\n ...$validError\n },\n execCallback\n );\n }\n\n if ($this.$shouldCancelPrevAsyncValidate) {\n $this.$shouldCancelPrevAsyncValidate(callback => {\n prevCallback = callback;\n\n return validation;\n });\n }\n\n $this.$shouldCancelPrevAsyncValidate = $shouldCancelPrevAsyncValidate;\n }));\n }\n\n function $render($viewValue, callback) {\n return $this.$setState(\n {\n $viewValue,\n $dirty: true\n },\n callback\n );\n }\n\n function $setValue($value, callback) {\n return $this.$setState(\n {\n $value\n },\n callback\n );\n }\n\n function $setTouched($touched, callback) {\n return $this.$setState(\n {\n $touched\n },\n callback\n );\n }\n\n function $setDirty($dirty, callback) {\n return $this.$setState(\n {\n $dirty\n },\n callback\n );\n }\n\n function $setFocused($focused, callback) {\n return $this.$setState(\n {\n $focused\n },\n callback\n );\n }\n\n function $setError($error, callback) {\n return $this.$setState(\n {\n $error\n },\n callback\n );\n }\n\n function $setValidity(key, result = true, callback) {\n const {\n $error: { ...$newError }\n } = $this.$state;\n\n if (isError(result)) {\n $newError[key] = result || key;\n\n warningValidatorReturn(result, key, $this.props.name);\n } else {\n delete $newError[key];\n }\n\n return $setError($newError, callback);\n }\n\n function $setPending($pending, callback) {\n return $this.$setState(\n {\n $pending\n },\n callback\n );\n }\n\n function $getFirstError() {\n const { $error = {} } = $this.$state;\n\n for (let name in $error) {\n return $error[name] instanceof Error ? $error[name].message : $error[name];\n }\n }\n\n function $$merge({ ...$newState }) {\n if ('$error' in $newState) {\n if (!$newState.$error) {\n $newState.$error = {};\n }\n\n $newState.$valid = Object.keys($newState.$error).length === 0;\n }\n\n // process $value\n const { $parser, $formatter } = $this.props;\n\n if ('$viewValue' in $newState && !('$value' in $newState)) {\n const $setViewValue = $value => ($newState.$viewValue = $value);\n\n $newState.$value = $parser ? $parser($newState.$viewValue, $setViewValue) : $newState.$viewValue;\n } else if ('$value' in $newState && !('$viewValue' in $newState)) {\n const $setModelValue = $value => ($newState.$value = $value);\n\n $newState.$viewValue = $formatter ? $formatter($newState.$value, $setModelValue) : $newState.$value;\n }\n\n // process $valid/$invalid\n if ('$valid' in $newState) {\n $newState.$invalid = !$newState.$valid;\n } else if ('$invalid' in $newState) {\n $newState.$dirty = !$newState.$invalid;\n }\n\n // process $dirty/$pristine\n if ('$dirty' in $newState) {\n $newState.$pristine = !$newState.$dirty;\n } else if ('$pristine' in $newState) {\n $newState.$dirty = !$newState.$pristine;\n }\n\n // process $touched/$untouched\n if ('$touched' in $newState) {\n $newState.$untouched = !$newState.$touched;\n } else if ('$untouched' in $newState) {\n $newState.$touched = !$newState.$untouched;\n }\n\n $this.$state = { ...$this.$state, ...$newState };\n\n return $getState();\n }\n\n return $fieldHandler;\n}\n","import React, { Component } from 'react';\nimport { createHandler, GET_FIELD_UUID, propTypes, displayName, renderField } from './fieldHelper';\nimport FormContext from './context';\nimport warning from 'warning';\nimport { runCallback, createRef } from './utils';\n\nclass Field extends Component {\n static displayName = displayName;\n static propTypes = propTypes;\n\n $$FIELD_UUID = GET_FIELD_UUID();\n\n /** @type { any } */\n $formContext;\n /** @type { any } */\n $state;\n\n componentDidMount() {\n this.isMounting = true;\n\n const {\n props: { name: $name },\n $formContext\n } = this;\n\n warning(\n !$name || $formContext.$formutil,\n `You should enusre that the with the name '${$name}' must be used underneath a component or withForm() HOC, otherwise it's isolated.`\n );\n\n warning($name, `You should assign a name to , otherwise it will be isolated!`);\n\n if ($formContext.$$register) {\n $formContext.$$register($name, this.$fieldHandler);\n }\n\n this.$prevValue = this.$state.$value;\n\n createRef(this.props.$ref, this.$fieldutil);\n }\n\n componentWillUnmount() {\n if (this.$formContext.$$unregister) {\n this.$formContext.$$unregister(this.props.name, this.$fieldHandler, this.props.$reserveOnUnmount);\n }\n\n this.isMounting = false;\n\n createRef(this.props.$ref, null);\n }\n\n componentDidUpdate(prevProps) {\n const $name = this.props.name;\n\n if ($name !== prevProps.name) {\n if (this.$formContext.$$register) {\n this.$formContext.$$register($name, this.$fieldHandler, prevProps.name);\n }\n }\n\n createRef(this.props.$ref, this.$fieldutil);\n\n if (this.$state.$value !== this.$prevValue) {\n if (!($name in (this.$formContext.$$registers || {}))) {\n this.$registered.$$triggerChange({\n $newValue: this.$state.$value,\n $prevValue: this.$prevValue\n });\n }\n\n this.$prevValue = this.$state.$value;\n }\n }\n\n $setState = ($newState, callback) =>\n new Promise(resolve => {\n const execute = () => resolve(runCallback(callback, this.$fieldutil));\n\n if (this.isMounting) {\n const $name = this.props.name;\n\n if ($name in (this.$formContext.$$registers || {})) {\n this.$formContext.$$onChange($name, $newState, execute);\n } else {\n this.$registered.$$merge($newState);\n\n this.$registered.$$detectChange($newState);\n\n this.forceUpdate(execute);\n }\n } else {\n this.$registered.$$merge($newState);\n execute();\n }\n });\n\n _render() {\n const $fieldutil = (this.$fieldutil = {\n $name: this.props.name,\n ...this.$registered.$getState(),\n ...this.$registered,\n $$formutil: this.$formContext.$formutil\n });\n\n return renderField($fieldutil, this.props);\n }\n\n render() {\n const shouldInitial = !this.$formContext;\n\n return (\n \n {context => {\n this.$formContext = context;\n\n if (!this.$fieldHandler) {\n this.$fieldHandler = createHandler(this, this);\n }\n\n this.$registered = (context.$$registers || {})[this.$fieldHandler.$name] || this.$fieldHandler;\n\n if (shouldInitial) {\n this.$fieldHandler.$$reset();\n this.$fieldHandler.$validate();\n }\n\n return this._render();\n }}\n \n );\n }\n}\n\nexport default Field;\n","import React, { Component } from 'react';\nimport Field from './Field';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withField(WrappedComponent, config = {}) {\n class FieldEnhanced extends Component {\n static displayName =\n 'React.Formutil.withField.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n const { ...others } = this.props;\n const { component, ...fieldProps } = this.props;\n\n [\n '$validators',\n '$asyncValidators',\n '$validateLazy',\n '$reserveOnUnmount',\n '$defaultValue',\n '$defaultState',\n '$onFieldChange',\n '$parser',\n '$formatter',\n '$ref',\n 'name'\n ]\n .concat(\n Object.keys({\n ...config.$validators,\n ...config.$asyncValidators,\n ...others.$validators,\n ...others.$asyncValidators\n })\n )\n .forEach(prop => {\n if (prop in others) {\n if (prop === '$validators' || prop === '$asyncValidators' || prop === '$defaultState') {\n fieldProps[prop] = { ...config[prop], ...others[prop] };\n }\n delete others[prop];\n }\n });\n\n return (\n }\n />\n );\n }\n }\n\n return hoistStatics(FieldEnhanced, WrappedComponent);\n}\n\nexport default createHOC(withField);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nclass EasyFieldNative extends Component {\n static displayName = 'React.Formutil.EasyField.Native';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n\n value: PropTypes.any,\n name: PropTypes.string,\n type: PropTypes.string,\n\n checked: PropTypes.any,\n unchekced: PropTypes.any\n };\n\n static defaultProps = {\n value: '',\n type: 'text',\n checked: true,\n unchecked: false\n };\n\n render() {\n const { $fieldutil, value: htmlValue, onChange, onFocus, onBlur, checked, unchecked, ...others } = this.props;\n const htmlType = this.props.type;\n\n let htmlProps = {\n value: 'compositionValue' in this ? this.compositionValue : htmlValue,\n onCompositionEnd: ev => {\n this.composition = false;\n delete this.compositionValue;\n htmlProps.onChange(ev);\n },\n onCompositionStart: () => (this.composition = true),\n onChange: ev => {\n const { value } = ev.target;\n\n if (this.composition) {\n this.compositionValue = value;\n this.forceUpdate();\n } else {\n onChange(value, ev);\n }\n },\n onFocus,\n onBlur\n };\n let Element = 'input';\n\n switch (htmlType) {\n case 'select':\n Element = htmlType;\n htmlProps.onChange = ev => {\n const node = ev.target;\n const value = node.multiple\n ? [].slice\n .call(node.options)\n .filter(option => option.selected)\n .map(option => option.value)\n : node.value;\n\n onChange(value, ev);\n };\n\n delete others.type;\n\n break;\n case 'textarea':\n Element = htmlType;\n delete others.type;\n break;\n\n case 'checkbox':\n case 'radio':\n htmlProps = {\n checked: htmlValue === checked,\n onChange: ev => {\n onChange(ev.target.checked ? checked : unchecked, ev);\n },\n onFocus,\n onBlur\n };\n break;\n\n default:\n break;\n }\n\n return ;\n }\n}\n\nexport default EasyFieldNative;\n","import React, { Component, Children, cloneElement } from 'react';\nimport PropTypes from 'prop-types';\nimport createContext from 'create-react-context';\nimport { isFunction } from '../utils';\nimport warning from 'warning';\n\n/** @type {any} */\nconst { Provider, Consumer } = createContext({});\n\nclass EasyFieldGroup extends Component {\n static displayName = 'React.Formutil.EasyField.Group';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n\n value: PropTypes.any,\n name: PropTypes.string,\n type: PropTypes.string.isRequired,\n groupNode: PropTypes.any,\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).isRequired\n };\n\n static defaultProps = {\n type: 'checkbox',\n groupNode: 'div'\n };\n\n getGroupContext() {\n return this.props;\n }\n\n _render() {\n const { className, groupNode: Element, children } = this.props;\n\n const GroupOptionProps = {\n GroupOption: EasyFieldGroupOption,\n Field: DeprecatedEasyFieldGroupOption\n };\n\n const childNodes = isFunction(children)\n ? children(GroupOptionProps)\n : Children.map(children, child => cloneElement(child, GroupOptionProps));\n\n if (Element === null) {\n return childNodes;\n }\n\n return {childNodes};\n }\n\n render() {\n return {this._render()};\n }\n}\n\nclass EasyFieldGroupOption extends Component {\n static displayName = 'React.Formutil.EasyField.Group.Option';\n\n static propTypes = {\n $value: PropTypes.any.isRequired\n };\n\n componentDidMount() {\n warning('$value' in this.props, `You should pass a $value to .`);\n }\n\n render() {\n const { $value, onChange, onFocus, onBlur, ...others } = this.props;\n\n return (\n \n {$groupHander => {\n const { type, name } = $groupHander;\n\n const elemProps =\n type === 'radio'\n ? {\n checked: $groupHander.value === $value,\n onChange: ev => {\n $groupHander.onChange($value, ev);\n\n onChange && onChange(ev);\n }\n }\n : type === 'checkbox'\n ? {\n checked: $groupHander.value.indexOf($value) > -1,\n onChange: ev => {\n $groupHander.onChange(\n ev.target.checked\n ? $groupHander.value.concat($value)\n : $groupHander.value.filter(value => value !== $value),\n ev\n );\n\n onChange && onChange(ev);\n }\n }\n : {\n value: $groupHander.value,\n onChange: ev => {\n $groupHander.onChange(ev);\n\n onChange && onChange(ev);\n }\n };\n\n return (\n {\n $groupHander.onFocus(ev);\n onFocus && onFocus(ev);\n }}\n onBlur={ev => {\n $groupHander.onBlur(ev);\n onBlur && onBlur(ev);\n }}\n />\n );\n }}\n \n );\n }\n}\n\nclass DeprecatedEasyFieldGroupOption extends Component {\n static displayName = 'React.Formutil.EasyField.Group.Option.Deprecated';\n\n componentDidMount() {\n warning(\n false,\n `The \"Field\" property in EasyField's children-props has been deprecated. Please use \"GroupOption\" instead.`\n );\n }\n\n render() {\n return ;\n }\n}\n\nexport default EasyFieldGroup;\n","'use strict';\n\nvar isArray = Array.isArray;\nvar keyList = Object.keys;\nvar hasProp = Object.prototype.hasOwnProperty;\nvar hasElementType = typeof Element !== 'undefined';\n\nfunction equal(a, b) {\n // fast-deep-equal index.js 2.0.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = isArray(a)\n , arrB = isArray(b)\n , i\n , length\n , key;\n\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n if (arrA != arrB) return false;\n\n var dateA = a instanceof Date\n , dateB = b instanceof Date;\n if (dateA != dateB) return false;\n if (dateA && dateB) return a.getTime() == b.getTime();\n\n var regexpA = a instanceof RegExp\n , regexpB = b instanceof RegExp;\n if (regexpA != regexpB) return false;\n if (regexpA && regexpB) return a.toString() == b.toString();\n\n var keys = keyList(a);\n length = keys.length;\n\n if (length !== keyList(b).length)\n return false;\n\n for (i = length; i-- !== 0;)\n if (!hasProp.call(b, keys[i])) return false;\n // end fast-deep-equal\n\n // start react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element && b instanceof Element)\n return a === b;\n\n // custom handling for React\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (key === '_owner' && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner.\n // _owner contains circular references\n // and is not needed when comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of a react element\n continue;\n } else {\n // all other properties should be traversed as usual\n if (!equal(a[key], b[key])) return false;\n }\n }\n // end react-fast-compare\n\n // fast-deep-equal index.js 2.0.1\n return true;\n }\n\n return a !== a && b !== b;\n}\n// end fast-deep-equal\n\nmodule.exports = function exportedEqual(a, b) {\n try {\n return equal(a, b);\n } catch (error) {\n if ((error.message && error.message.match(/stack|recursion/i)) || (error.number === -2146828260)) {\n // warn on circular references, don't crash\n // browsers give this different errors name and messages:\n // chrome/safari: \"RangeError\", \"Maximum call stack size exceeded\"\n // firefox: \"InternalError\", too much recursion\"\n // edge: \"Error\", \"Out of stack space\"\n console.warn('Warning: react-fast-compare does not handle circular references.', error.name, error.message);\n return false;\n }\n // some other error. we should definitely know about these\n throw error;\n }\n};\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport isEqual from 'react-fast-compare';\nimport Form from '../Form';\nimport Field from '../Field';\nimport { isUndefined, isFunction, runCallback } from '../utils';\n\nconst Wrapper = React.Frament || 'div';\n\nclass EasyFieldList extends Component {\n static displayName = 'React.Formutil.EasyField.List';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n value: PropTypes.array,\n\n children: PropTypes.func.isRequired\n };\n\n id = 0;\n latestValue = this.props.value;\n $formutil;\n\n constructor(props) {\n super(props);\n\n this.state = {\n items: props.value.length ? props.value.map(() => this.getId()) : [this.getId()],\n formKey: 0\n };\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.value !== this.latestValue) {\n this.setState({\n items: this.props.value.length ? this.props.value.map(() => this.getId()) : [this.getId()],\n formKey: this.state.formKey + 1\n });\n\n this.latestValue = this.props.value;\n }\n }\n\n getId(values) {\n return {\n id: this.id++,\n values\n };\n }\n\n FieldValidators = {\n required(value) {\n return value !== null;\n }\n };\n\n $onFormChange = $formutil => {\n $formutil.$onValidates($formutil => {\n const { $invalid, $params } = $formutil;\n\n if ($invalid) {\n if (this.props.value.length) {\n this.props.onChange((this.latestValue = []));\n }\n } else if (!isEqual(this.props.value, $params.list)) {\n this.props.onChange((this.latestValue = $params.list));\n }\n });\n };\n\n swap = (m, n, callback) =>\n this.$setState(({ items }) => {\n [items[n], items[m]] = [items[m], items[n]];\n\n return items;\n }, callback);\n\n insert = (...args) => {\n let m, values, callback;\n\n args.forEach(arg => {\n if (isFunction(arg)) {\n callback = arg;\n } else if (typeof arg === 'number') {\n m = arg;\n } else if (typeof arg === 'object') {\n values = arg;\n }\n });\n\n return this.$setState(({ items }) => {\n if (isUndefined(m)) {\n items.push(this.getId(values));\n } else {\n items.splice(m, 0, this.getId(values));\n }\n\n return { items };\n }, callback);\n };\n\n remove = (...args) => {\n let m, callback;\n\n args.forEach(arg => {\n if (isFunction(arg)) {\n callback = arg;\n } else if (typeof arg === 'number') {\n m = arg;\n }\n });\n\n return this.$setState(({ items }) => {\n if (isUndefined(m)) {\n items.pop();\n } else {\n items.splice(m, 1);\n }\n\n if (!items.length) {\n items = [this.getId()];\n }\n\n return { items };\n }, callback);\n };\n\n $setState = (updater, callback) =>\n new Promise(resolve =>\n this.setState(updater, () =>\n this.$formutil.$onValidates($formutil => resolve(runCallback(callback, $formutil)))\n )\n );\n\n render() {\n const { children, onFocus, onBlur, value } = this.props;\n\n if (!isFunction(children)) {\n return null;\n }\n\n const $baseutil = {\n $length: this.state.items.length,\n $insert: this.insert,\n $remove: this.remove,\n $swap: this.swap,\n $push: (values, callback) => this.insert(values, callback),\n $pop: callback => this.remove(callback),\n $shift: callback => this.remove(0, callback),\n $unshift: (values, callback) => this.insert(0, values, callback),\n onFocus,\n onBlur\n };\n\n return (\n {\n this.$formutil = $formutil;\n\n return (\n \n {this.state.items.map(({ id, values }, index) => (\n {\n return (\n \n $formutil.$onValidates($formutil => {\n const { $invalid, $params } = $formutil;\n\n if ($invalid) {\n if ($fieldutil.$viewValue !== null) {\n $fieldutil.$render(null);\n }\n } else if (!isEqual($fieldutil.$viewValue, $params)) {\n $fieldutil.$render($params);\n }\n })\n }\n children={$innerFormutil =>\n children(\n {\n ...$baseutil,\n ...$innerFormutil,\n $index: index,\n $isLast: () => index === this.state.items.length - 1,\n $isFirst: () => index === 0\n },\n $formutil\n )\n }\n />\n );\n }}\n />\n ))}\n \n );\n }}\n />\n );\n }\n}\n\nexport default EasyFieldList;\n","import { Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport Native from './Native';\nimport Group from './Group';\nimport List from './List';\nimport { isEmpty, isUndefined, isFunction, isValidProp } from '../utils';\n\nexport const TYPE = '__TYPE__';\nexport const defaultValidators = [\n [\n 'required',\n ($value, check, { __TYPE__, checked = true }) =>\n __TYPE__ === 'checked' ? $value === checked : !isEmpty($value)\n ],\n ['maxLength', ($value, len) => isEmpty($value) || $value.length <= len],\n ['minLength', ($value, len) => isEmpty($value) || $value.length >= len],\n ['max', ($value, limit) => isEmpty($value) || $value * 1 <= limit],\n ['min', ($value, limit) => isEmpty($value) || $value * 1 >= limit],\n ['pattern', ($value, regexp) => isEmpty($value) || regexp.test($value)],\n ['enum', ($value, enumeration) => isEmpty($value) || enumeration.indexOf($value) > -1],\n ['checker', ($value, checker, props) => checker($value, props)]\n].reduce(($validators, item) => {\n const [validKey, validate] = item;\n $validators[validKey] = function validator($value, propValue, { validMessage = {} }) {\n return validate(...arguments) || validMessage[validKey] || `Error input: ${validKey}`;\n };\n return $validators;\n}, {});\n\nexport const propTypes =\n process.env.NODE_ENV !== 'production'\n ? {\n type: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n component: PropTypes.func,\n render: PropTypes.func,\n\n defaultValue: PropTypes.any,\n validMessage: PropTypes.object,\n\n valuePropName: PropTypes.string,\n changePropName: PropTypes.string,\n focusPropName: PropTypes.string,\n blurPropName: PropTypes.string,\n\n passUtil: PropTypes.string\n }\n : undefined;\n\nexport const displayName = 'React.Formutil.EasyField';\n\nexport const defaultProps = {\n validMessage: {},\n valuePropName: 'value',\n changePropName: 'onChange',\n focusPropName: 'onFocus',\n blurPropName: 'onBlur',\n $parser: value => (typeof value === 'string' ? value.trim() : value)\n};\n\nexport function createHandler($fieldutil, fieldProps, childProps) {\n const { valuePropName, changePropName, focusPropName, blurPropName, passUtil } = fieldProps;\n\n const fetchValueFromEvent = function(ev) {\n return ev && ev.target ? ev.target[valuePropName] : ev;\n };\n\n const $handleProps = {\n ...childProps,\n\n [valuePropName]: $fieldutil.$viewValue,\n [changePropName]: (...args) => {\n let value = args[0];\n let ev = args[args.length - 1];\n\n if (!ev || !ev.target) {\n ev = args;\n } else {\n ev = [ev];\n }\n\n const onChange = fieldProps[changePropName];\n onChange && onChange(...ev);\n\n const newValue = fetchValueFromEvent(value);\n $fieldutil.$render(newValue);\n },\n [focusPropName]: (...args) => {\n const onFocus = fieldProps[focusPropName];\n onFocus && onFocus(...args);\n\n $fieldutil.$setFocused(true);\n },\n [blurPropName]: (...args) => {\n const onBlur = fieldProps[blurPropName];\n onBlur && onBlur(...args);\n\n if ($fieldutil.$untouched) {\n $fieldutil.$setTouched(true);\n }\n\n $fieldutil.$setFocused(false);\n }\n };\n\n if (passUtil) {\n $handleProps[passUtil === true ? '$fieldutil' : passUtil] = $fieldutil;\n }\n\n return $handleProps;\n}\n\nexport function parseProps(props) {\n const {\n children,\n component,\n render,\n\n ...fieldProps\n } = props;\n\n const {\n // filter all the props that accept by EasyField\n name,\n type,\n defaultValue,\n valuePropName,\n changePropName,\n focusPropName,\n blurPropName,\n validMessage,\n __TYPE__,\n passUtil,\n\n // filter all the props that accept by Field\n $defaultValue,\n $defaultState,\n $onFieldChange,\n $validators,\n $asyncValidators,\n $validateLazy,\n $reserveOnUnmount,\n $parser,\n $formatter,\n $ref,\n\n ...childProps\n } = fieldProps;\n\n const renderProps = {\n children,\n component,\n render\n };\n\n const isNative = !isUndefined(type) || (isUndefined(children) && isUndefined(component) && isUndefined(render));\n\n Object.keys({\n ...(fieldProps.$validators = {\n ...defaultValidators,\n ...fieldProps.$validators\n }),\n ...fieldProps.$asyncValidators\n }).forEach(prop => {\n if (prop in childProps) {\n if (!isNative || !isValidProp(prop)) {\n delete childProps[prop];\n }\n }\n });\n\n if (isNative) {\n const [htmlType = 'text', groupType] = (type || '').split('.');\n\n renderProps.component = htmlType === 'group' ? Group : htmlType === 'list' ? List : Native;\n\n // Native or Group need to pass 'name' | 'type' | 'children'\n if (name) {\n childProps.name = name;\n }\n\n if (type) {\n childProps.type = htmlType;\n }\n\n if (children) {\n childProps.children = children;\n }\n\n switch (htmlType) {\n case 'select':\n case 'textarea':\n if (props.multiple) {\n fieldProps[TYPE] = 'array';\n }\n break;\n\n case 'group':\n if (groupType === 'checkbox') {\n fieldProps[TYPE] = 'array';\n }\n\n childProps.type = groupType;\n break;\n\n case 'checkbox':\n case 'radio':\n fieldProps[TYPE] = 'checked';\n break;\n\n case 'list':\n fieldProps[TYPE] = 'array';\n break;\n\n default:\n break;\n }\n }\n\n if (!('$defaultValue' in fieldProps) && 'defaultValue' in props) {\n fieldProps.$defaultValue = defaultValue;\n }\n\n if (!('$defaultValue' in fieldProps) && TYPE in fieldProps) {\n let defaultValue;\n\n switch (fieldProps[TYPE]) {\n case 'checked':\n const { unchecked = false } = fieldProps;\n\n defaultValue = unchecked;\n break;\n\n case 'array':\n defaultValue = [];\n break;\n\n case 'object':\n defaultValue = {};\n break;\n\n case 'number':\n defaultValue = 0;\n break;\n\n case 'empty':\n default:\n break;\n }\n\n fieldProps.$defaultValue = defaultValue;\n }\n\n return {\n fieldProps,\n childProps,\n renderProps\n };\n}\n\nexport function renderField($handleProps, props) {\n let { component, render, children } = props;\n\n if (component) {\n return createElement(component, $handleProps);\n }\n\n if (isFunction(render)) {\n return render($handleProps);\n }\n\n if (isFunction(children)) {\n return children($handleProps);\n }\n\n return Children.map(children, child => cloneElement(child, $handleProps));\n}\n","import React, { Component } from 'react';\nimport Field from '../Field';\nimport { renderField, createHandler, parseProps, displayName, propTypes, defaultProps } from './easyFieldHandler';\n\n/**\n * 提供对浏览器原生表单控件的封装\n * 支持以下类型表单元素:\n * - input[type=xx]\n * - textarea\n * - select\n */\nclass EasyField extends Component {\n static displayName = displayName;\n static propTypes = propTypes;\n static defaultProps = defaultProps;\n\n render() {\n const { fieldProps, childProps, renderProps } = parseProps(this.props);\n\n return (\n renderField(createHandler($fieldutil, fieldProps, childProps), renderProps)}\n />\n );\n }\n}\n\nexport default EasyField;\n","import React, { Component } from 'react';\nimport FormContext from './context';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction connect(WrappedComponent) {\n class Connect extends Component {\n static displayName =\n 'React.Formutil.connect.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n return (\n \n {context => }\n \n );\n }\n }\n\n return hoistStatics(Connect, WrappedComponent);\n}\n\nexport default connect;\n","import React from 'react';\nimport FormContext from '../context';\n\nfunction useFormContext() {\n if (!React.useState) {\n throw new Error(`Hooks api need react@>=16.8, Please upgrade your reactjs.`);\n }\n\n const { useContext } = React;\n const $formContext = useContext(FormContext);\n\n return $formContext;\n}\n\nexport default useFormContext;\n","import React from 'react';\nimport useFormContext from './useFormContext';\nimport { runCallback, createRef } from '../utils';\nimport { createHandler, GET_FIELD_UUID } from '../fieldHelper';\nimport warning from 'warning';\n\n/**\n * @description\n * The custom hook for Field\n *\n * @param {string | object} [name]\n * @param {object} [props]\n *\n * @return {object} $Fieldutil\n */\nfunction useField(name, props = {}) {\n if (!React.useState) {\n throw new Error(`Hooks api need react@>=16.8, Please upgrade your reactjs.`);\n }\n\n const { useState, useLayoutEffect, useRef } = React;\n\n let $name;\n\n if (name) {\n if (typeof name === 'string') {\n $name = name;\n\n props.name = $name;\n } else {\n props = name;\n\n $name = props.name;\n }\n }\n\n const $formContext = useFormContext();\n /** @type {any} */\n const $this = useRef({}).current;\n /** @type {React.MutableRefObject} */\n const callbackRef = useRef([]);\n\n let $registered;\n\n $this.$formContext = $formContext;\n $this.props = props;\n $this.$setState = $setState;\n // we not directly use this $state, just from $this.$state\n const [, setState] = useState(() => {\n $this.$$FIELD_UUID = GET_FIELD_UUID();\n $this.$fieldHandler = $registered = createHandler($this);\n\n const $state = $this.$fieldHandler.$$reset();\n\n $this.$fieldHandler.$validate();\n\n return $state;\n });\n\n if (!$registered) {\n $registered = ($formContext.$$registers || {})[$this.$fieldHandler.$name] || $this.$fieldHandler;\n }\n\n useLayoutEffect(() => {\n const { $state } = $this;\n\n if ($this.isMounting) {\n if (!($name in ($formContext.$$registers || {}))) {\n const { $prevValue } = $this;\n\n $registered.$$triggerChange({\n $newValue: $state.$value,\n $prevValue\n });\n }\n }\n\n $this.$prevValue = $state.$value;\n }, [$this.$state.$value]);\n\n useLayoutEffect(() => {\n $this.isMounting = true;\n\n warning(\n !$name || $formContext.$formutil,\n `You should enusre that the useField() with the name '${$name}' must be used underneath a component or withForm() HOC, otherwise it's isolated.`\n );\n\n warning($name, `You should pass a name argument to useField(), otherwise it will be isolated!`);\n\n return () => {\n $this.isMounting = false;\n\n createRef(props.$ref, null);\n };\n }, []);\n\n useLayoutEffect(() => {\n if ($formContext.$$register) {\n $formContext.$$register($name, $this.$fieldHandler);\n }\n\n return () => {\n if ($formContext.$$unregister) {\n $formContext.$$unregister($name, $this.$fieldHandler, !$this.isMounting && props.$reserveOnUnmount);\n }\n };\n }, [$name]);\n\n // trigger ref callback\n useLayoutEffect(() => {\n createRef(props.$ref, $this.$fieldutil);\n });\n\n useLayoutEffect(() => {\n if (callbackRef.current.length > 0) {\n const callbackQueue = [...callbackRef.current];\n\n callbackRef.current.length = 0;\n\n while (callbackQueue.length) {\n callbackQueue.pop()($this.$fieldutil);\n }\n }\n });\n\n function $setState($newState, callback) {\n return new Promise(resolve => {\n const execute = () => resolve(runCallback(callback, $this.$fieldutil));\n\n if ($this.isMounting) {\n if ($name in ($formContext.$$registers || {})) {\n $formContext.$$onChange($name, $newState, execute);\n } else {\n setState($registered.$$merge($newState));\n\n $registered.$$detectChange($newState);\n\n callbackRef.current.push(execute);\n }\n } else {\n $registered.$$merge($newState);\n execute();\n }\n });\n }\n\n return ($this.$fieldutil = {\n $name,\n ...$registered.$getState(),\n ...$registered,\n $$formutil: $formContext.$formutil\n });\n}\n\nexport default useField;\n","import useFormContext from './useFormContext';\n\nfunction useForm() {\n const { $formutil } = useFormContext();\n\n return $formutil;\n}\n\nexport default useForm;\n","import { createHandler, parseProps, defaultProps } from '../EasyField/easyFieldHandler';\nimport useField from './useField';\n\nfunction useHandler(props) {\n props = { ...defaultProps, ...props, children: null };\n\n const { fieldProps, childProps } = parseProps(props);\n const $fieldutil = useField(fieldProps);\n\n return createHandler($fieldutil, fieldProps, childProps);\n}\n\nexport default useHandler;\n"],"names":["global","emptyFunction","_react","_propTypes","_gud","_warning","_implementation","createContext","warning","printWarning","OBJECT_PROTO","Object","getPrototypeOf","PATH_REGEXP","Root","isUndefined","window","arg","isFunction","isEmpty","isPromise","promise","then","isObject","obj","prototype","toString","call","isPlainObj","constructor","deepClone","Array","isArray","newObj","i","j","length","runCallback","callback","args","createHOC","withHOC","WrappedComponent","VALID_PROPS","isValidProp","prop","indexOf","toLowerCase","executeWord","word","exec","Function","err","parsePath","target","path","value","JSON","stringify","pathSymbols","match","map","s","replace","pathWords","split","trim","filter","item","scope","index","len","nextWord","symbol","nextVarWord","error","createRef","ref","current","arrayFind","array","process","objectMap","handler","keys","reduce","key","objectEach","forEach","toObject","arr","TODO_DELETE","undefined","CLEAR","pkey","pobj","every","objectClear","name","FORM_VALIDATE_RESULT","requestFrame","cancelFrame","requestAnimationFrame","cancelAnimationFrame","setTimeout","clearTimeout","Form","props","$$formPending","$$formValidatePromise","$$registers","$$deepRegisters","$$regDuplications","$$duplicateTimer","$$checkDuplication","hasDup","utils","$curRegistered","$handler","$$reserved","$$reset","$getState","$render","$$register","prevName","$$unregister","$$getRegister","$$fieldChangedQueue","push","$newValue","$value","$$defaultValues","$name","createDeepRegisters","$prevValue","$$defaultInitialize","$defaultValues","$defaultStates","$$deepParseObject","$$defaultStates","$$getDefault","$$triggerChangeTimer","$$triggerFormChange","$newValues","$prevValues","hasFormChanged","$$triggerChange","$validator","$$formValidate","$onFormChange","$formutil","field","Promise","resolve","$breakAsyncHandler","$shouldCancelPrevAsyncValidate","prevCallback","validation","result","$params","formtutil","execCallback","setCallback","reason","$$setFormErrors","validResults","Error","$$setStates","$error","$getField","$new","$$onChange","$state","$setStates","$stateTree","processer","force","$parsedTree","hasStateChange","data","$newState","$weakParams","$$merge","$$detectChange","findItem","forceUpdate","$validates","pop","flatter","names","$validate","$onValidates","filedValidatePromises","$onValidate","all","$reset","$setValues","$valueTree","$setFocuses","$focusedTree","$focused","$setDirts","$dirtyTree","$dirty","$setTouches","$touchedTree","$touched","$setPendings","$pendingTree","$pending","$setErrors","$errorTree","$batchState","$batchDirty","$batchTouched","$batchFocused","$batchPending","$batchError","mayWeakObj","deepObj","$ref","prevProps","children","render","component","createElement","Children","child","type","cloneElement","$processer","$stateArray","$pureParams","$invalid","some","$states","$errors","$dirts","$touches","$focuses","$pendings","$weakStates","$weakErrors","$weakDirts","$weakTouches","$weakFocuses","$weakPendings","$getFirstError","$fieldutil","$fieldError","message","$valid","$pristine","$untouched","React","getFormContext","_render","Component","displayName","propTypes","PropTypes","func","pt","oneOfType","node","isRequired","object","shape","any","defaultProps","require$$0","ReactIs","withForm","config","FormEnhanced","others","formProps","hoistStatics","FIELD_UUID","$baseState","isError","warningValidatorReturn","string","$defaultValue","$defaultState","$onFieldChange","$validators","$asyncValidators","$validateLazy","bool","$reserveOnUnmount","$parser","$formatter","GET_FIELD_UUID","renderField","createHandler","$this","owner","$fieldHandler","$$FIELD_UUID","$picker","$getComponent","$setState","$setValue","$setTouched","$setDirty","$setFocused","$setValidity","$setError","$setPending","$$validatePromise","$formContext","$initialState","$initialValue","$newError","$validError","$skipRestValidate","$validatePromises","promises","catch","$viewValue","$setViewValue","$setModelValue","Field","execute","isMounting","$registered","$$formutil","shouldInitial","context","withField","FieldEnhanced","fieldProps","concat","EasyFieldNative","htmlValue","onChange","onFocus","onBlur","checked","unchecked","htmlType","htmlProps","compositionValue","onCompositionEnd","ev","composition","onCompositionStart","Element","multiple","slice","options","option","selected","unchekced","Provider","Consumer","EasyFieldGroup","className","groupNode","GroupOptionProps","GroupOption","EasyFieldGroupOption","DeprecatedEasyFieldGroupOption","childNodes","getGroupContext","element","$groupHander","elemProps","Wrapper","Frament","EasyFieldList","id","latestValue","FieldValidators","required","isEqual","list","swap","m","n","items","insert","values","getId","splice","remove","updater","setState","state","formKey","$baseutil","$length","$insert","$remove","$swap","$push","$pop","$shift","$unshift","$innerFormutil","$index","$isLast","$isFirst","TYPE","defaultValidators","check","__TYPE__","limit","regexp","test","enumeration","checker","validKey","validate","validator","propValue","validMessage","arguments","defaultValue","valuePropName","changePropName","focusPropName","blurPropName","passUtil","childProps","fetchValueFromEvent","$handleProps","newValue","parseProps","renderProps","isNative","groupType","Group","List","Native","EasyField","connect","Connect","useFormContext","useState","useContext","FormContext","useField","useLayoutEffect","useRef","callbackRef","callbackQueue","useForm","useHandler"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA,IAAI,GAAG,GAAG,sBAAsB,CAAC;;EAEjC,kBAAc,GAAG,WAAW;IAC1B,OAAOA,cAAM,CAAC,GAAG,CAAC,GAAG,CAACA,cAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GAC7C,CAAC;;;;;;;;;;;ECIF,SAAS,iBAAiB,CAAC,GAAG,EAAE;IAC9B,OAAO,YAAY;MACjB,OAAO,GAAG,CAAC;KACZ,CAAC;GACH;;;;;;;EAOD,IAAI,aAAa,GAAG,SAAS,aAAa,GAAG,EAAE,CAAC;;EAEhD,aAAa,CAAC,WAAW,GAAG,iBAAiB,CAAC;EAC9C,aAAa,CAAC,gBAAgB,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;EAC1D,aAAa,CAAC,eAAe,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;EACxD,aAAa,CAAC,eAAe,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;EACxD,aAAa,CAAC,eAAe,GAAG,YAAY;IAC1C,OAAO,IAAI,CAAC;GACb,CAAC;EACF,aAAa,CAAC,mBAAmB,GAAG,UAAU,GAAG,EAAE;IACjD,OAAO,GAAG,CAAC;GACZ,CAAC;;EAEF,mBAAc,GAAG,aAAa;;;;;;;;;EChB9B,IAAI,OAAO,GAAGC,eAAa,CAAC;;AAE5B,EAA2C;IACzC,IAAI,YAAY,GA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AE;EAA1C,IAAL;;EADuB,oBAGY+M,UAAU,CAAClU,KAAD,CAHtB;EAAA,MAGfiO,UAHe,eAGfA,UAHe;EAAA,MAGH6F,UAHG,eAGHA,UAHG;;EAIvB,MAAMjL,UAAU,GAAGmM,QAAQ,CAAC/G,UAAD,CAA3B;EAEA,SAAOrC,eAAa,CAAC/C,UAAD,EAAaoF,UAAb,EAAyB6F,UAAzB,CAApB;EACH;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"react-formutil.umd.development.js","sources":["../src/context.js","../node_modules/_warning@4.0.3@warning/warning.js","../src/utils.js","../src/Form.js","../node_modules/_react-is@16.8.6@react-is/cjs/react-is.development.js","../node_modules/_react-is@16.8.6@react-is/index.js","../node_modules/_hoist-non-react-statics@3.3.0@hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../src/withForm.js","../src/fieldHelper.js","../src/Field.js","../src/withField.js","../src/EasyField/Native.js","../src/EasyField/Group.js","../node_modules/_react-fast-compare@2.0.4@react-fast-compare/index.js","../src/EasyField/List.js","../src/EasyField/easyFieldHandler.js","../src/EasyField/index.js","../src/connect.js","../src/hooks/useFormContext.js","../src/hooks/useField.js","../src/hooks/useForm.js","../src/hooks/useHandler.js"],"sourcesContent":["import { createContext } from 'react';\n\nexport default createContext({});\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","import warning from 'warning';\n\nconst OBJECT_PROTO = Object.getPrototypeOf({});\nconst PATH_REGEXP = /\\s*(?:\\]\\s*\\.|\\]\\s*\\[|\\.|\\[|\\])\\s*/g;\nconst Root = isUndefined(window) ? global : window;\n\nexport function isUndefined(arg) {\n return typeof arg === 'undefined';\n}\n\nexport function isFunction(arg) {\n return typeof arg === 'function';\n}\n\nexport function isEmpty(arg) {\n return isUndefined(arg) || arg === null || arg + '' === '';\n}\n\nexport function isPromise(promise) {\n return !!promise && isFunction(promise.then);\n}\n\nexport function isObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n\nexport function isPlainObj(obj) {\n if (!isObject(obj)) return false;\n if (null === Object.getPrototypeOf(obj)) return true;\n if (!isFunction(obj.constructor)) return false;\n\n return obj.constructor.prototype === OBJECT_PROTO;\n}\n\n// quick clone deeply\nexport function deepClone(obj) {\n if (obj && typeof obj === 'object') {\n if (Array.isArray(obj)) {\n const newObj = [];\n\n for (let i = 0, j = obj.length; i < j; i++) {\n newObj[i] = deepClone(obj[i]);\n }\n\n return newObj;\n } else if (isPlainObj(obj)) {\n const newObj = {};\n\n for (let i in obj) {\n newObj[i] = deepClone(obj[i]);\n }\n\n return newObj;\n }\n }\n\n return obj;\n}\n\nexport const runCallback = function(callback, ...args) {\n if (isFunction(callback)) {\n callback(...args);\n }\n\n return args[0];\n};\n\nexport function createHOC(withHOC) {\n return function(...args) {\n if (isFunction(args[0])) {\n return withHOC(...args);\n }\n\n return function(WrappedComponent) {\n return withHOC(WrappedComponent, args[0]);\n };\n };\n}\n\nconst VALID_PROPS = ['minlength', 'maxlength', 'max', 'min', 'required', 'pattern', 'step'];\nexport function isValidProp(prop) {\n return VALID_PROPS.indexOf(prop.toLowerCase()) > -1;\n}\n\n/* eslint-disable */\nconst executeWord = function(word) {\n try {\n const exec = new Function(\n 'origin',\n 'global',\n `return typeof ${word} === 'number' || (typeof ${word} !== 'undefined' && !(origin in global)) ? ${word} : origin`\n );\n return exec(word, Root);\n } catch (err) {\n return word;\n }\n};\n\n/**\n * @desc 解析表达式中赋值深路径对象\n *\n * @param {object} target 要赋值的对象\n * @param {string} path 赋值路径,eg:list[0].title\n * @param {any} [value] 要赋过去的值,如过不传,则返回解析路径后的值\n *\n * 使用示例:parsePath({}, 'list[0].authors[1].name', 'Lucy');\n */\nexport function parsePath(...args) {\n const [target, path, value] = args;\n\n warning(typeof path === 'string', `The second parameter(${JSON.stringify(path)}) of parsePath() must be a string.`);\n\n const pathSymbols = (path.match(PATH_REGEXP) || []).map(s => s.replace(/\\s/g, ''));\n const pathWords = path\n .split(PATH_REGEXP)\n .map(s => s.trim())\n .filter(item => item !== '');\n let scope = target;\n\n try {\n if (args.length < 3) {\n for (let index = 0, len = pathWords.length; index < len; index++) {\n const word = executeWord(pathWords[index]);\n\n if (index + 1 === len) {\n return scope[word];\n }\n\n if (isUndefined(scope[word])) {\n break;\n }\n\n scope = scope[word];\n }\n } else {\n for (let index = 0, length = pathWords.length; index < length; index++) {\n const word = executeWord(pathWords[index]);\n const nextWord = pathWords[index + 1];\n const symbol = pathSymbols[index];\n\n if (isUndefined(nextWord)) {\n scope[word] = value;\n break;\n }\n\n switch (symbol) {\n case '].':\n case '.':\n scope = isUndefined(scope[word]) ? (scope[word] = {}) : scope[word];\n break;\n\n case '][':\n case '[':\n const nextVarWord = executeWord(nextWord);\n\n scope = isUndefined(scope[word])\n ? (scope[word] = typeof nextVarWord === 'number' && nextVarWord >= 0 ? [] : {})\n : scope[word];\n break;\n\n default:\n scope[word] = value;\n break;\n }\n }\n }\n } catch (error) {\n warning(false, `The name '%s' of Field seems is not a legal expression.`, path);\n }\n\n if (args.length > 2) {\n return target;\n }\n}\n\nexport function createRef(ref, value) {\n if (ref) {\n if (isFunction(ref)) {\n ref(value);\n } else if ('current' in ref) {\n ref.current = value;\n }\n }\n}\n\nexport const arrayFind = (array, process) => {\n for (let i = 0, j = array.length; i < j; i++) {\n if (process(array[i]) === true) {\n return array[i];\n }\n }\n};\n\nexport const objectMap = (obj, handler) =>\n Object.keys(obj).reduce((newObj, key) => {\n newObj[key] = handler(obj[key], key, obj);\n return newObj;\n }, {});\n\nexport const objectEach = (obj, handler) => Object.keys(obj).forEach(key => handler(obj[key], key, obj));\n\nexport const toObject = (arr, handler, obj = {}) =>\n arr.reduce((...args) => {\n handler(...args);\n\n return args[0];\n }, obj);\n\nconst TODO_DELETE = undefined;\nfunction CLEAR(obj, pkey, pobj) {\n objectEach(obj, (value, key) => {\n if (value === TODO_DELETE) {\n delete obj[key];\n } else if (value && typeof value === 'object') {\n CLEAR(value, key, obj);\n }\n });\n\n if (pobj && Object.keys(obj).every(key => obj[key] === TODO_DELETE)) {\n pobj[pkey] = TODO_DELETE;\n CLEAR(pobj);\n }\n}\nexport const objectClear = (obj, name) => {\n if (!isUndefined(parsePath(obj, name))) {\n parsePath(obj, name, TODO_DELETE);\n\n CLEAR(obj);\n }\n};\n","import React, { Component, Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport FormContext from './context';\nimport * as utils from './utils';\nimport warning from 'warning';\n\nexport const FORM_VALIDATE_RESULT = 'FORM_VALIDATE_RESULT';\n\nlet requestFrame, cancelFrame;\n\nif (typeof requestAnimationFrame === 'function') {\n requestFrame = requestAnimationFrame;\n cancelFrame = cancelAnimationFrame;\n} else {\n requestFrame = setTimeout;\n cancelFrame = clearTimeout;\n}\n\nclass Form extends Component {\n static displayName = 'React.Formutil.Form';\n\n static propTypes = {\n render: PropTypes.func,\n component: PropTypes.func,\n children(props, ...args) {\n let pt = PropTypes.oneOfType([PropTypes.func, PropTypes.node]);\n\n if (!props.render && !props.component) {\n pt = pt.isRequired;\n }\n\n return pt(props, ...args);\n },\n $defaultValues: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $defaultStates: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $onFormChange: PropTypes.func,\n $validator: PropTypes.func,\n $processer: PropTypes.func,\n $ref: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n current: PropTypes.any\n })\n ])\n };\n\n static defaultProps = {\n $defaultValues: {},\n $defaultStates: {}\n };\n\n $$formPending;\n $$formValidatePromise;\n\n $$registers = {};\n $$deepRegisters = {};\n\n constructor(props) {\n super(props);\n\n this.$$defaultInitialize();\n }\n\n getFormContext() {\n return {\n $$registers: this.$$registers,\n $$register: this.$$register,\n $$unregister: this.$$unregister,\n $$onChange: this.$$onChange,\n $$getDefault: this.$$getDefault,\n $formutil: this.$formutil\n };\n }\n\n $$regDuplications = {};\n $$duplicateTimer;\n $$checkDuplication = () => {\n const { $$regDuplications } = this;\n let hasDup;\n\n utils.objectEach($$regDuplications, ([$curRegistered, $handler], name) => {\n warning($curRegistered.$$reserved, `The Field with a name '${name}' has been registered!`);\n\n $handler.$$reset($curRegistered.$getState());\n\n hasDup = delete $$regDuplications[name];\n });\n\n if (hasDup) {\n this.$render();\n }\n };\n\n /*\n * @desc 注册或者替换(preName)Field\n */\n $$register = (name, $handler, prevName) => {\n this.$$unregister(prevName, $handler);\n\n if (name) {\n const $curRegistered = this.$$getRegister(name);\n\n if ($curRegistered) {\n cancelFrame(this.$$duplicateTimer);\n\n this.$$regDuplications[name] = [$curRegistered, $handler];\n this.$$duplicateTimer = requestFrame(this.$$checkDuplication);\n } else {\n this.$$fieldChangedQueue.push({\n name,\n $newValue: $handler.$getState().$value\n });\n\n utils.objectClear(this.$$defaultValues, name);\n }\n\n this.$$registers[($handler.$name = name)] = $handler;\n\n this.createDeepRegisters();\n this.$render();\n }\n };\n\n $$unregister = (name, $handler, $$reserved) => {\n if (name) {\n if (name in this.$$regDuplications) {\n const [$curRegistered, $handler] = this.$$regDuplications[name];\n\n this.$$fieldChangedQueue.push({\n name,\n $newValue: $handler.$getState().$value,\n $prevValue: $curRegistered.$getState().$value\n });\n\n delete this.$$regDuplications[name];\n } else if (this.$$registers[name] === $handler) {\n if ($$reserved) {\n $handler.$$reserved = true;\n } else {\n delete this.$$registers[name];\n\n this.$$fieldChangedQueue.push({\n name,\n $prevValue: $handler.$getState().$value\n });\n\n utils.objectClear(this.$$defaultValues, name);\n }\n }\n\n this.createDeepRegisters();\n this.$render();\n }\n };\n\n $$defaultInitialize = () => {\n const { $defaultValues, $defaultStates } = this.props;\n\n this.$$defaultValues = this.$$deepParseObject(\n utils.deepClone(utils.isFunction($defaultValues) ? $defaultValues(this.props) || {} : $defaultValues)\n );\n this.$$defaultStates = this.$$deepParseObject(\n utils.deepClone(utils.isFunction($defaultStates) ? $defaultStates(this.props) || {} : $defaultStates)\n );\n };\n\n $$getDefault = () => ({\n $$defaultStates: this.$$defaultStates,\n $$defaultValues: this.$$defaultValues\n });\n\n $$deepParseObject(mayWeakObj, deepObj = {}) {\n utils.objectEach(mayWeakObj, (data, name) => utils.parsePath(deepObj, name, data));\n\n return deepObj;\n }\n\n $$triggerChangeTimer;\n $$fieldChangedQueue = [];\n $$triggerFormChange = () => {\n if (this.$$fieldChangedQueue.length) {\n const $$fieldChangedQueue = [...this.$$fieldChangedQueue];\n\n this.$$fieldChangedQueue.length = 0;\n\n const $newValues = {};\n const $prevValues = {};\n const $$registers = this.$$registers;\n let hasFormChanged = false;\n\n $$fieldChangedQueue.forEach(item => {\n if (!(item.name in $$registers)) {\n delete item.$newValue;\n }\n\n if (item.$newValue !== item.$prevValue) {\n if ('$newValue' in item && '$prevValue' in item) {\n const $handler = this.$$getRegister(item.name);\n\n if ($handler) {\n $handler.$$triggerChange(item);\n }\n }\n\n '$newValue' in item && utils.parsePath($newValues, item.name, item.$newValue);\n '$prevValue' in item && utils.parsePath($prevValues, item.name, item.$prevValue);\n\n hasFormChanged = true;\n }\n });\n\n if (hasFormChanged) {\n if (utils.isFunction(this.props.$validator)) {\n this.$$formValidate();\n }\n\n if (utils.isFunction(this.props.$onFormChange)) {\n this.props.$onFormChange(this.$formutil, $newValues, $prevValues);\n }\n }\n }\n };\n\n createDeepRegisters = () => (this.$$deepRegisters = this.$$deepParseObject(this.$$registers));\n\n $$getRegister = name => {\n if (name) {\n const field = this.$$registers[name] || utils.parsePath(this.$$deepRegisters, name);\n\n if (field) {\n return field;\n }\n }\n };\n\n $$formValidate = callback =>\n (this.$$formValidatePromise = new Promise(resolve => {\n const { $validator } = this.props;\n\n let $breakAsyncHandler;\n let $shouldCancelPrevAsyncValidate;\n let prevCallback;\n let validation;\n\n const result = $validator(this.$formutil.$params, this.formtutil);\n const execCallback = $formutil =>\n resolve(utils.runCallback(callback, utils.runCallback(prevCallback, $formutil)));\n\n if (utils.isPromise(result)) {\n if (!this.$$formPending) {\n this.$$formPending = true;\n\n this.$render();\n }\n\n $shouldCancelPrevAsyncValidate = setCallback => ($breakAsyncHandler = setCallback(execCallback));\n\n validation = result\n .then(() => void 0, reason => reason)\n .then(reason => {\n if ($breakAsyncHandler) {\n return $breakAsyncHandler;\n }\n\n this.$shouldCancelPrevAsyncValidate = null;\n\n this.$$formPending = false;\n\n return this.$$setFormErrors(reason, execCallback);\n });\n } else {\n if (this.$$formPending) {\n this.$$formPending = false;\n }\n\n validation = this.$$setFormErrors(result, execCallback);\n }\n\n if (this.$shouldCancelPrevAsyncValidate) {\n this.$shouldCancelPrevAsyncValidate(callback => {\n prevCallback = callback;\n\n return validation;\n });\n }\n\n this.$shouldCancelPrevAsyncValidate = $shouldCancelPrevAsyncValidate;\n }));\n\n $$setFormErrors = (validResults, callback) => {\n if (validResults && (validResults instanceof Error || typeof validResults !== 'object')) {\n warning(\n false,\n `The result of $validator in should always return None(null,undefined) or an object contains error message of Field.`\n );\n\n return this.$render(callback);\n }\n\n return this.$$setStates(\n validResults || {},\n (result, handler) => {\n const { $error = {} } = handler.$getState();\n\n if (result) {\n return {\n $error: {\n ...$error,\n [FORM_VALIDATE_RESULT]: result\n }\n };\n }\n\n if ($error[FORM_VALIDATE_RESULT]) {\n delete $error[FORM_VALIDATE_RESULT];\n\n return {\n $error\n };\n }\n\n return;\n },\n callback,\n true\n );\n };\n\n $getField = name => {\n const field = this.$$getRegister(name);\n\n warning(!name || field, `$getField('${name}') fail to find the matched Field. Maybe it has been unmounted.`);\n warning(name, `You should pass a name of the mounted Field to $getField().`);\n\n if (field) {\n return field.$new();\n }\n };\n\n $$onChange = (name, $state, callback) =>\n this.$setStates(\n {\n [name]: $state\n },\n callback\n );\n\n $$setStates = ($stateTree = {}, processer, callback, force) => {\n const $parsedTree = this.$$deepParseObject($stateTree);\n let hasStateChange = false;\n\n utils.objectEach(this.$$registers, (handler, name) => {\n const data = name in $stateTree ? $stateTree[name] : utils.parsePath($parsedTree, name);\n\n if (!utils.isUndefined(data) || force) {\n const $newState = processer(data, handler);\n\n if ($newState) {\n const $prevValue = this.$formutil.$weakParams[name];\n const { $value: $newValue } = handler.$$merge($newState);\n\n handler.$$detectChange($newState);\n\n if ('$value' in $newState || '$viewValue' in $newState) {\n const findItem = utils.arrayFind(this.$$fieldChangedQueue, item => item.name === name);\n\n if (findItem) {\n if (!('$prevValue' in findItem)) {\n findItem.$prevValue = findItem.$newValue;\n }\n\n findItem.$newValue = $newValue;\n } else {\n this.$$fieldChangedQueue.push({\n name,\n $newValue,\n $prevValue\n });\n }\n }\n\n hasStateChange = true;\n }\n }\n });\n\n if (hasStateChange) {\n return this.$render(callback);\n }\n\n return Promise.resolve(utils.runCallback(callback, this.$formutil));\n };\n\n componentDidMount() {\n utils.createRef(this.props.$ref, this.$formutil);\n }\n\n componentDidUpdate(prevProps) {\n utils.createRef(this.props.$ref, this.$formutil);\n\n cancelFrame(this.$$triggerChangeTimer);\n\n // ensure this calls to access the newest $formutil\n this.$$triggerChangeTimer = requestFrame(() => {\n this.$$triggerFormChange();\n });\n }\n\n componentWillUnmount() {\n utils.createRef(this.props.$ref, null);\n }\n\n $render = callback =>\n new Promise(resolve => this.forceUpdate(() => resolve(utils.runCallback(callback, this.$formutil))));\n\n $validates = (...args) => {\n let callback;\n\n if (utils.isFunction(args[args.length - 1])) {\n callback = args.pop();\n }\n\n if (args.length) {\n const flatter = names => {\n names.forEach(name => {\n if (Array.isArray(name)) {\n flatter(name);\n } else {\n const handler = this.$getField(name);\n\n if (handler) {\n handler.$validate();\n }\n }\n });\n };\n\n flatter(args);\n } else {\n utils.objectEach(this.$$registers, handler => handler.$validate());\n\n if (utils.isFunction(this.props.$validator)) {\n this.$$formValidate();\n }\n }\n\n return this.$onValidates(callback);\n };\n\n $onValidates = callback => {\n const filedValidatePromises = Object.keys(this.$$registers).map(name => this.$$registers[name].$onValidate());\n\n filedValidatePromises.push(this.$$formValidatePromise);\n\n return Promise.all(filedValidatePromises).then(() => utils.runCallback(callback, this.$formutil));\n };\n\n $validate = (name, callback) => {\n const handler = this.$getField(name);\n\n if (handler) {\n return handler.$validate(callback);\n }\n\n return utils.runCallback(callback);\n };\n\n $reset = ($stateTree, callback) => {\n this.$$defaultInitialize();\n\n if (utils.isFunction($stateTree)) {\n callback = $stateTree;\n $stateTree = {};\n }\n\n return this.$$setStates($stateTree, ($state, handler) => handler.$$reset($state), callback, true);\n };\n\n $setStates = ($stateTree, callback) => this.$$setStates($stateTree, $state => $state, callback);\n\n $setValues = ($valueTree, callback) => {\n this.$$deepParseObject(utils.deepClone($valueTree), this.$$defaultValues);\n\n return this.$$setStates($valueTree, $value => ({ $value }), callback);\n };\n\n $setFocuses = ($focusedTree, callback) => this.$$setStates($focusedTree, $focused => ({ $focused }), callback);\n $setDirts = ($dirtyTree, callback) => this.$$setStates($dirtyTree, $dirty => ({ $dirty }), callback);\n $setTouches = ($touchedTree, callback) => this.$$setStates($touchedTree, $touched => ({ $touched }), callback);\n $setPendings = ($pendingTree, callback) => this.$$setStates($pendingTree, $pending => ({ $pending }), callback);\n $setErrors = ($errorTree, callback) => this.$$setStates($errorTree, $error => ({ $error }), callback);\n\n $batchState = ($state, callback) => this.$setStates(utils.objectMap(this.$$registers, () => $state), callback);\n $batchDirty = ($dirty, callback) =>\n this.$batchState(\n {\n $dirty\n },\n callback\n );\n\n $batchTouched = ($touched, callback) =>\n this.$batchState(\n {\n $touched\n },\n callback\n );\n\n $batchFocused = ($focused, callback) =>\n this.$batchState(\n {\n $focused\n },\n callback\n );\n\n $batchPending = ($pending, callback) =>\n this.$batchState(\n {\n $pending\n },\n callback\n );\n\n $batchError = ($error, callback) =>\n this.$batchState(\n {\n $error\n },\n callback\n );\n\n _render() {\n const $formutil = this.$formutil;\n let { children, render, component } = this.props;\n\n if (component) {\n return createElement(component, { $formutil });\n }\n\n if (utils.isFunction(render)) {\n return render($formutil);\n }\n\n if (utils.isFunction(children)) {\n return children($formutil);\n }\n\n return Children.map(children, child =>\n child && utils.isFunction(child.type)\n ? cloneElement(child, {\n $formutil\n })\n : child\n );\n }\n\n render() {\n const { $processer } = this.props;\n const $stateArray = Object.keys(this.$$registers).map(path => ({\n path,\n $state: this.$$registers[path].$getState()\n }));\n\n const $weakParams = utils.toObject($stateArray, ($params, { path, $state }) => {\n if ($processer) {\n $processer($state, path);\n }\n\n if ('$value' in $state && ($state.$dirty || !utils.isUndefined($state.$value))) {\n $params[path] = $state.$value;\n }\n });\n\n const $pureParams = utils.toObject(\n $stateArray,\n ($params, { path, $state }) => path in $weakParams && utils.parsePath($params, path, $weakParams[path])\n );\n\n const $invalid = $stateArray.some(({ $state }) => $state.$invalid);\n const $dirty = $stateArray.some(({ $state }) => $state.$dirty);\n const $touched = $stateArray.some(({ $state }) => $state.$touched);\n const $focused = $stateArray.some(({ $state }) => $state.$focused);\n const $pending = this.$$formPending || $stateArray.some(({ $state }) => $state.$pending);\n\n const $formutil = (this.$formutil = {\n $$registers: { ...this.$$registers },\n $$deepRegisters: this.$$deepRegisters,\n $states: utils.toObject($stateArray, ($states, { path, $state }) => utils.parsePath($states, path, $state)),\n $params: {\n ...this.$$defaultValues,\n ...$pureParams\n },\n $errors: utils.toObject($stateArray, ($errors, { path, $state }) => {\n if ($state.$invalid) {\n utils.parsePath($errors, path, $state.$error);\n }\n }),\n $dirts: utils.toObject($stateArray, ($dirts, { path, $state }) =>\n utils.parsePath($dirts, path, $state.$dirty)\n ),\n $touches: utils.toObject($stateArray, ($touches, { path, $state }) =>\n utils.parsePath($touches, path, $state.$touched)\n ),\n $focuses: utils.toObject($stateArray, ($focuses, { path, $state }) =>\n utils.parsePath($focuses, path, $state.$focused)\n ),\n $pendings: utils.toObject($stateArray, ($pendings, { path, $state }) =>\n utils.parsePath($pendings, path, $state.$pending)\n ),\n\n $weakStates: utils.toObject($stateArray, ($states, { path, $state }) => ($states[path] = $state)),\n $weakParams,\n $weakErrors: utils.toObject($stateArray, ($errors, { path, $state }) => {\n if ($state.$invalid) {\n $errors[path] = $state.$error;\n }\n }),\n $weakDirts: utils.toObject($stateArray, ($dirts, { path, $state }) => ($dirts[path] = $state.$dirty)),\n $weakTouches: utils.toObject(\n $stateArray,\n ($touches, { path, $state }) => ($touches[path] = $state.$touched)\n ),\n $weakFocuses: utils.toObject(\n $stateArray,\n ($focuses, { path, $state }) => ($focuses[path] = $state.$focused)\n ),\n $weakPendings: utils.toObject(\n $stateArray,\n ($weakPendings, { path, $state }) => ($weakPendings[path] = $state.$pending)\n ),\n\n $getFirstError(name) {\n if (name) {\n const $fieldutil = $formutil.$getField(name);\n\n return $fieldutil && $fieldutil.$getFirstError();\n }\n\n for (let name in $formutil.$weakErrors) {\n const $fieldError = $formutil.$weakErrors[name];\n\n for (let key in $fieldError) {\n return $fieldError[key] instanceof Error ? $fieldError[key].message : $fieldError[key];\n }\n }\n },\n\n $render: this.$render,\n\n $getField: this.$getField,\n $onValidates: this.$onValidates,\n\n // get the newest $formutil\n $new: () => this.$formutil,\n\n $setStates: this.$setStates,\n $setValues: this.$setValues,\n $setErrors: this.$setErrors,\n $setTouches: this.$setTouches,\n $setDirts: this.$setDirts,\n $setFocuses: this.$setFocuses,\n\n $batchState: this.$batchState,\n $batchTouched: this.$batchTouched,\n $batchDirty: this.$batchDirty,\n $batchFocused: this.$batchFocused,\n\n $reset: this.$reset,\n $validates: this.$validates,\n $validate: this.$validate,\n\n $valid: !$invalid,\n $invalid,\n $dirty,\n $pristine: !$dirty,\n $touched,\n $untouched: !$touched,\n $focused,\n $pending\n });\n\n return {this._render()};\n }\n}\n\nexport default Form;\n","/** @license React v16.8.6\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\n\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;\nvar REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' ||\n // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);\n}\n\n/**\n * Forked from fbjs/warning:\n * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js\n *\n * Only change is we use console.warn instead of console.error,\n * and do nothing when 'console' is not supported.\n * This really simplifies the code.\n * ---\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar lowPriorityWarning = function () {};\n\n{\n var printWarning = function (format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.warn(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n lowPriorityWarning = function (condition, format) {\n if (format === undefined) {\n throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\nvar lowPriorityWarning$1 = lowPriorityWarning;\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_ASYNC_MODE_TYPE:\n case REACT_CONCURRENT_MODE_TYPE:\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n return type;\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n default:\n return $$typeof;\n }\n }\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n}\n\n// AsyncMode is deprecated along with isAsyncMode\nvar AsyncMode = REACT_ASYNC_MODE_TYPE;\nvar ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\n\nvar hasWarnedAboutDeprecatedIsAsyncMode = false;\n\n// AsyncMode should be deprecated\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true;\n lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}\nfunction isConcurrentMode(object) {\n return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.typeOf = typeOf;\nexports.AsyncMode = AsyncMode;\nexports.ConcurrentMode = ConcurrentMode;\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isValidElementType = isValidElementType;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict';\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar ReactIs = require('react-is');\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\n\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\n\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\n\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\n\nvar TYPE_STATICS = {};\nTYPE_STATICS[ReactIs.ForwardRef] = FORWARD_REF_STATICS;\n\nfunction getStatics(component) {\n if (ReactIs.isMemo(component)) {\n return MEMO_STATICS;\n }\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\n\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n\n return targetComponent;\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","import React, { Component } from 'react';\nimport Form from './Form';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withForm(WrappedComponent, config = {}) {\n class FormEnhanced extends Component {\n static displayName =\n 'React.Formutil.withForm.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n const { ...others } = this.props;\n const { component, ...formProps } = this.props;\n\n ['$defaultStates', '$defaultValues', '$onFormChange', '$validator', '$processer', '$ref'].forEach(prop => {\n if (prop in others) {\n if (prop === '$defaultStates' || prop === '$defaultValues') {\n formProps[prop] = { ...config[prop], ...others[prop] };\n }\n delete others[prop];\n }\n });\n\n return (\n }\n />\n );\n }\n }\n\n return hoistStatics(FormEnhanced, WrappedComponent);\n}\n\nexport default createHOC(withForm);\n","import { Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport * as utils from './utils';\nimport warning from 'warning';\nimport { FORM_VALIDATE_RESULT } from './Form';\n\nlet FIELD_UUID = 0;\nconst $baseState = {\n $valid: true,\n $invalid: false,\n\n $dirty: false,\n $pristine: true,\n\n $touched: false,\n $untouched: true,\n\n $focused: false,\n\n $pending: false,\n\n $error: {}\n};\n\nfunction isError(result) {\n return /*!utils.isUndefined(result) && */ result !== true;\n}\n\nfunction warningValidatorReturn(result, key, name) {\n warning(\n !utils.isUndefined(result),\n `You should return a string or Error when the validation('${name &&\n name + ': '}${key}') failed, otherwise return true.`\n );\n}\n\nexport const propTypes =\n process.env.NODE_ENV !== 'production'\n ? {\n name: PropTypes.string,\n\n $defaultValue: PropTypes.any,\n $defaultState: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n $onFieldChange: PropTypes.func,\n $validators: PropTypes.object,\n $asyncValidators: PropTypes.object,\n $validateLazy: PropTypes.bool,\n $reserveOnUnmount: PropTypes.bool,\n $ref: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n current: PropTypes.any\n })\n ]),\n $parser: PropTypes.func,\n $formatter: PropTypes.func,\n\n render: PropTypes.func,\n component: PropTypes.func,\n children(props, ...args) {\n let pt = PropTypes.oneOfType([PropTypes.func, PropTypes.node]);\n\n if (!props.render && !props.component && props.children !== null) {\n pt = pt.isRequired;\n }\n\n return pt(props, ...args);\n }\n }\n : undefined;\n\nexport const displayName = 'React.Formutil.Field';\n\nexport function GET_FIELD_UUID() {\n return FIELD_UUID++;\n}\n\nexport function renderField($fieldutil, props) {\n let { children, render, component } = props;\n\n if (component) {\n return createElement(component, { $fieldutil });\n }\n\n if (utils.isFunction(render)) {\n return render($fieldutil);\n }\n\n if (utils.isFunction(children)) {\n return children($fieldutil);\n }\n\n return Children.map(children, child =>\n child && utils.isFunction(child.type)\n ? cloneElement(child, {\n $fieldutil\n })\n : child\n );\n}\n\nexport function createHandler($this, owner) {\n const $fieldHandler = {\n $$FIELD_UUID: $this.$$FIELD_UUID,\n\n $$reset,\n $$merge,\n $$detectChange,\n $$triggerChange,\n $onValidate,\n\n $new() {\n return $this.$fieldutil;\n },\n $picker: $getState,\n $getState,\n // not support in Hooks\n $getComponent() {\n return owner;\n },\n\n $reset($state, callback) {\n return $this.$setState($$reset($state), callback);\n },\n $getFirstError,\n $validate,\n $setState: $this.$setState,\n $render,\n $setValue,\n $setTouched,\n $setDirty,\n $setFocused,\n $setValidity,\n $setError,\n $setPending\n };\n\n let $$validatePromise;\n\n function $$detectChange($newState) {\n if ('$value' in $newState || '$viewValue' in $newState) {\n $validate();\n }\n }\n\n function $$triggerChange({ $newValue, $prevValue }) {\n const { $onFieldChange } = $this.props;\n\n if (utils.isFunction($onFieldChange)) {\n $onFieldChange($newValue, $prevValue, $this.$formContext.$formutil);\n }\n }\n\n function $onValidate(callback) {\n $$validatePromise.then(callback);\n\n return $$validatePromise;\n }\n\n function $$reset($newState) {\n let $initialState;\n\n const { props, $formContext } = $this;\n\n if ($formContext.$$getDefault) {\n const $name = props.name;\n const { $$defaultStates, $$defaultValues } = $formContext.$$getDefault();\n\n if ($name && $$defaultValues) {\n const $initialValue = utils.parsePath($$defaultValues, $name);\n\n $initialState = utils.parsePath($$defaultStates, $name) || {};\n\n if (!utils.isUndefined($initialValue)) {\n $initialState.$value = $initialValue;\n }\n }\n }\n\n const { $defaultValue, $defaultState } = props;\n\n return $$merge({\n ...$baseState, // the base state\n ...(utils.isFunction($defaultState) ? $defaultState(props) : $defaultState), // self default state\n $value: utils.isFunction($defaultValue)\n ? $defaultValue(props)\n : '$defaultValue' in props\n ? $defaultValue\n : '',\n ...$initialState, // the default state from Form\n ...$newState\n });\n }\n\n function $getState() {\n return { ...$this.$state };\n }\n\n function $validate(callback) {\n return ($$validatePromise = new Promise(resolve => {\n const { props, $formContext } = $this;\n const $validators = { ...props.$validators, ...props.$asyncValidators };\n const {\n $value,\n $pending,\n $error: { ...$newError }\n } = $this.$state;\n const { $formutil } = $formContext;\n const $validError = {};\n let $skipRestValidate = false;\n let $breakAsyncHandler;\n let $shouldCancelPrevAsyncValidate;\n let prevCallback;\n let validation;\n\n delete $newError[FORM_VALIDATE_RESULT];\n\n const $validatePromises = Object.keys($validators).reduce((promises, key) => {\n delete $newError[key];\n\n if (!$skipRestValidate && props[key] != null) {\n const result = $validators[key]($value, props[key], {\n ...props,\n $formutil,\n $fieldutil: $this.$fieldutil,\n $validError\n });\n\n if (utils.isPromise(result)) {\n promises.push(\n // @ts-ignore\n result.catch(reason => {\n if (!$breakAsyncHandler) {\n $setValidity(key, reason || key);\n }\n })\n );\n } else if (isError(result)) {\n $validError[key] = result || key;\n\n warningValidatorReturn(result, key, props.name);\n\n if (props.$validateLazy) {\n $skipRestValidate = true;\n }\n }\n }\n\n return promises;\n }, []);\n const execCallback = $fieldutil =>\n resolve(utils.runCallback(callback, utils.runCallback(prevCallback, $fieldutil)));\n\n if ($validatePromises.length) {\n if (!$pending) {\n $setPending(true);\n }\n\n $shouldCancelPrevAsyncValidate = setCallback => ($breakAsyncHandler = setCallback(execCallback));\n\n $validatePromises.push(\n $setError({\n ...$newError,\n ...$validError\n })\n );\n\n validation = Promise.all($validatePromises).then(() => {\n if ($breakAsyncHandler) {\n return $breakAsyncHandler;\n }\n\n $this.$shouldCancelPrevAsyncValidate = null;\n\n return $setPending(false, execCallback);\n });\n } else {\n if ($pending) {\n $setPending(false);\n }\n\n validation = $setError(\n {\n ...$newError,\n ...$validError\n },\n execCallback\n );\n }\n\n if ($this.$shouldCancelPrevAsyncValidate) {\n $this.$shouldCancelPrevAsyncValidate(callback => {\n prevCallback = callback;\n\n return validation;\n });\n }\n\n $this.$shouldCancelPrevAsyncValidate = $shouldCancelPrevAsyncValidate;\n }));\n }\n\n function $render($viewValue, callback) {\n return $this.$setState(\n {\n $viewValue,\n $dirty: true\n },\n callback\n );\n }\n\n function $setValue($value, callback) {\n return $this.$setState(\n {\n $value\n },\n callback\n );\n }\n\n function $setTouched($touched, callback) {\n return $this.$setState(\n {\n $touched\n },\n callback\n );\n }\n\n function $setDirty($dirty, callback) {\n return $this.$setState(\n {\n $dirty\n },\n callback\n );\n }\n\n function $setFocused($focused, callback) {\n return $this.$setState(\n {\n $focused\n },\n callback\n );\n }\n\n function $setError($error, callback) {\n return $this.$setState(\n {\n $error\n },\n callback\n );\n }\n\n function $setValidity(key, result = true, callback) {\n const {\n $error: { ...$newError }\n } = $this.$state;\n\n if (isError(result)) {\n $newError[key] = result || key;\n\n warningValidatorReturn(result, key, $this.props.name);\n } else {\n delete $newError[key];\n }\n\n return $setError($newError, callback);\n }\n\n function $setPending($pending, callback) {\n return $this.$setState(\n {\n $pending\n },\n callback\n );\n }\n\n function $getFirstError() {\n const { $error = {} } = $this.$state;\n\n for (let name in $error) {\n return $error[name] instanceof Error ? $error[name].message : $error[name];\n }\n }\n\n function $$merge({ ...$newState }) {\n if ('$error' in $newState) {\n if (!$newState.$error) {\n $newState.$error = {};\n }\n\n $newState.$valid = Object.keys($newState.$error).length === 0;\n }\n\n // process $value\n const { $parser, $formatter } = $this.props;\n\n if ('$viewValue' in $newState && !('$value' in $newState)) {\n const $setViewValue = $value => ($newState.$viewValue = $value);\n\n $newState.$value = $parser ? $parser($newState.$viewValue, $setViewValue) : $newState.$viewValue;\n } else if ('$value' in $newState && !('$viewValue' in $newState)) {\n const $setModelValue = $value => ($newState.$value = $value);\n\n $newState.$viewValue = $formatter ? $formatter($newState.$value, $setModelValue) : $newState.$value;\n }\n\n // process $valid/$invalid\n if ('$valid' in $newState) {\n $newState.$invalid = !$newState.$valid;\n } else if ('$invalid' in $newState) {\n $newState.$dirty = !$newState.$invalid;\n }\n\n // process $dirty/$pristine\n if ('$dirty' in $newState) {\n $newState.$pristine = !$newState.$dirty;\n } else if ('$pristine' in $newState) {\n $newState.$dirty = !$newState.$pristine;\n }\n\n // process $touched/$untouched\n if ('$touched' in $newState) {\n $newState.$untouched = !$newState.$touched;\n } else if ('$untouched' in $newState) {\n $newState.$touched = !$newState.$untouched;\n }\n\n $this.$state = { ...$this.$state, ...$newState };\n\n return $getState();\n }\n\n return $fieldHandler;\n}\n","import React, { Component } from 'react';\nimport { createHandler, GET_FIELD_UUID, propTypes, displayName, renderField } from './fieldHelper';\nimport FormContext from './context';\nimport warning from 'warning';\nimport { runCallback, createRef } from './utils';\n\nclass Field extends Component {\n static displayName = displayName;\n static propTypes = propTypes;\n\n $$FIELD_UUID = GET_FIELD_UUID();\n\n /** @type { any } */\n $formContext;\n /** @type { any } */\n $state;\n\n componentDidMount() {\n this.isMounting = true;\n\n const {\n props: { name: $name },\n $formContext\n } = this;\n\n warning(\n !$name || $formContext.$formutil,\n `You should enusre that the with the name '${$name}' must be used underneath a component or withForm() HOC, otherwise it's isolated.`\n );\n\n warning($name, `You should assign a name to , otherwise it will be isolated!`);\n\n if ($formContext.$$register) {\n $formContext.$$register($name, this.$fieldHandler);\n }\n\n this.$prevValue = this.$state.$value;\n\n createRef(this.props.$ref, this.$fieldutil);\n }\n\n componentWillUnmount() {\n if (this.$formContext.$$unregister) {\n this.$formContext.$$unregister(this.props.name, this.$fieldHandler, this.props.$reserveOnUnmount);\n }\n\n this.isMounting = false;\n\n createRef(this.props.$ref, null);\n }\n\n componentDidUpdate(prevProps) {\n const $name = this.props.name;\n\n if ($name !== prevProps.name) {\n if (this.$formContext.$$register) {\n this.$formContext.$$register($name, this.$fieldHandler, prevProps.name);\n }\n }\n\n createRef(this.props.$ref, this.$fieldutil);\n\n if (this.$state.$value !== this.$prevValue) {\n if (!($name in (this.$formContext.$$registers || {}))) {\n this.$registered.$$triggerChange({\n $newValue: this.$state.$value,\n $prevValue: this.$prevValue\n });\n }\n\n this.$prevValue = this.$state.$value;\n }\n }\n\n $setState = ($newState, callback) =>\n new Promise(resolve => {\n const execute = () => resolve(runCallback(callback, this.$fieldutil));\n\n if (this.isMounting) {\n const $name = this.props.name;\n\n if ($name in (this.$formContext.$$registers || {})) {\n this.$formContext.$$onChange($name, $newState, execute);\n } else {\n this.$registered.$$merge($newState);\n\n this.$registered.$$detectChange($newState);\n\n this.forceUpdate(execute);\n }\n } else {\n this.$registered.$$merge($newState);\n execute();\n }\n });\n\n _render() {\n const $fieldutil = (this.$fieldutil = {\n $name: this.props.name,\n ...this.$registered.$getState(),\n ...this.$registered,\n $$formutil: this.$formContext.$formutil\n });\n\n return renderField($fieldutil, this.props);\n }\n\n render() {\n const shouldInitial = !this.$formContext;\n\n return (\n \n {context => {\n this.$formContext = context;\n\n if (!this.$fieldHandler) {\n this.$fieldHandler = createHandler(this, this);\n }\n\n this.$registered = (context.$$registers || {})[this.$fieldHandler.$name] || this.$fieldHandler;\n\n if (shouldInitial) {\n this.$fieldHandler.$$reset();\n this.$fieldHandler.$validate();\n }\n\n return this._render();\n }}\n \n );\n }\n}\n\nexport default Field;\n","import React, { Component } from 'react';\nimport Field from './Field';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withField(WrappedComponent, config = {}) {\n class FieldEnhanced extends Component {\n static displayName =\n 'React.Formutil.withField.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n const { ...others } = this.props;\n const { component, ...fieldProps } = this.props;\n\n [\n '$validators',\n '$asyncValidators',\n '$validateLazy',\n '$reserveOnUnmount',\n '$defaultValue',\n '$defaultState',\n '$onFieldChange',\n '$parser',\n '$formatter',\n '$ref',\n 'name'\n ]\n .concat(\n Object.keys({\n ...config.$validators,\n ...config.$asyncValidators,\n ...others.$validators,\n ...others.$asyncValidators\n })\n )\n .forEach(prop => {\n if (prop in others) {\n if (prop === '$validators' || prop === '$asyncValidators' || prop === '$defaultState') {\n fieldProps[prop] = { ...config[prop], ...others[prop] };\n }\n delete others[prop];\n }\n });\n\n return (\n }\n />\n );\n }\n }\n\n return hoistStatics(FieldEnhanced, WrappedComponent);\n}\n\nexport default createHOC(withField);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nclass EasyFieldNative extends Component {\n static displayName = 'React.Formutil.EasyField.Native';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n\n value: PropTypes.any,\n name: PropTypes.string,\n type: PropTypes.string,\n\n checked: PropTypes.any,\n unchekced: PropTypes.any\n };\n\n static defaultProps = {\n value: '',\n type: 'text',\n checked: true,\n unchecked: false\n };\n\n render() {\n const { $fieldutil, value: htmlValue, onChange, onFocus, onBlur, checked, unchecked, ...others } = this.props;\n const htmlType = this.props.type;\n\n let htmlProps = {\n value: 'compositionValue' in this ? this.compositionValue : htmlValue,\n onCompositionEnd: ev => {\n this.composition = false;\n delete this.compositionValue;\n htmlProps.onChange(ev);\n },\n onCompositionStart: () => (this.composition = true),\n onChange: ev => {\n const { value } = ev.target;\n\n if (this.composition) {\n this.compositionValue = value;\n this.forceUpdate();\n } else {\n onChange(value, ev);\n }\n },\n onFocus,\n onBlur\n };\n let Element = 'input';\n\n switch (htmlType) {\n case 'select':\n Element = htmlType;\n htmlProps.onChange = ev => {\n const node = ev.target;\n const value = node.multiple\n ? [].slice\n .call(node.options)\n .filter(option => option.selected)\n .map(option => option.value)\n : node.value;\n\n onChange(value, ev);\n };\n\n delete others.type;\n\n break;\n case 'textarea':\n Element = htmlType;\n delete others.type;\n break;\n\n case 'checkbox':\n case 'radio':\n htmlProps = {\n checked: htmlValue === checked,\n onChange: ev => {\n onChange(ev.target.checked ? checked : unchecked, ev);\n },\n onFocus,\n onBlur\n };\n break;\n\n default:\n break;\n }\n\n return ;\n }\n}\n\nexport default EasyFieldNative;\n","import React, { Component, Children, cloneElement, createContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { isFunction } from '../utils';\nimport warning from 'warning';\n\n/** @type {any} */\nconst { Provider, Consumer } = createContext({});\n\nclass EasyFieldGroup extends Component {\n static displayName = 'React.Formutil.EasyField.Group';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n\n value: PropTypes.any,\n name: PropTypes.string,\n type: PropTypes.string.isRequired,\n groupNode: PropTypes.any,\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.element]).isRequired\n };\n\n static defaultProps = {\n type: 'checkbox',\n groupNode: 'div'\n };\n\n getGroupContext() {\n return this.props;\n }\n\n _render() {\n const { className, groupNode: Element, children } = this.props;\n\n const GroupOptionProps = {\n GroupOption: EasyFieldGroupOption,\n Field: DeprecatedEasyFieldGroupOption\n };\n\n const childNodes = isFunction(children)\n ? children(GroupOptionProps)\n : Children.map(children, child => cloneElement(child, GroupOptionProps));\n\n if (Element === null) {\n return childNodes;\n }\n\n return {childNodes};\n }\n\n render() {\n return {this._render()};\n }\n}\n\nclass EasyFieldGroupOption extends Component {\n static displayName = 'React.Formutil.EasyField.Group.Option';\n\n static propTypes = {\n $value: PropTypes.any.isRequired\n };\n\n componentDidMount() {\n warning('$value' in this.props, `You should pass a $value to .`);\n }\n\n render() {\n const { $value, onChange, onFocus, onBlur, ...others } = this.props;\n\n return (\n \n {$groupHander => {\n const { type, name } = $groupHander;\n\n const elemProps =\n type === 'radio'\n ? {\n checked: $groupHander.value === $value,\n onChange: ev => {\n $groupHander.onChange($value, ev);\n\n onChange && onChange(ev);\n }\n }\n : type === 'checkbox'\n ? {\n checked: $groupHander.value.indexOf($value) > -1,\n onChange: ev => {\n $groupHander.onChange(\n ev.target.checked\n ? $groupHander.value.concat($value)\n : $groupHander.value.filter(value => value !== $value),\n ev\n );\n\n onChange && onChange(ev);\n }\n }\n : {\n value: $groupHander.value,\n onChange: ev => {\n $groupHander.onChange(ev);\n\n onChange && onChange(ev);\n }\n };\n\n return (\n {\n $groupHander.onFocus(ev);\n onFocus && onFocus(ev);\n }}\n onBlur={ev => {\n $groupHander.onBlur(ev);\n onBlur && onBlur(ev);\n }}\n />\n );\n }}\n \n );\n }\n}\n\nclass DeprecatedEasyFieldGroupOption extends Component {\n static displayName = 'React.Formutil.EasyField.Group.Option.Deprecated';\n\n componentDidMount() {\n warning(\n false,\n `The \"Field\" property in EasyField's children-props has been deprecated. Please use \"GroupOption\" instead.`\n );\n }\n\n render() {\n return ;\n }\n}\n\nexport default EasyFieldGroup;\n","'use strict';\n\nvar isArray = Array.isArray;\nvar keyList = Object.keys;\nvar hasProp = Object.prototype.hasOwnProperty;\nvar hasElementType = typeof Element !== 'undefined';\n\nfunction equal(a, b) {\n // fast-deep-equal index.js 2.0.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = isArray(a)\n , arrB = isArray(b)\n , i\n , length\n , key;\n\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n if (arrA != arrB) return false;\n\n var dateA = a instanceof Date\n , dateB = b instanceof Date;\n if (dateA != dateB) return false;\n if (dateA && dateB) return a.getTime() == b.getTime();\n\n var regexpA = a instanceof RegExp\n , regexpB = b instanceof RegExp;\n if (regexpA != regexpB) return false;\n if (regexpA && regexpB) return a.toString() == b.toString();\n\n var keys = keyList(a);\n length = keys.length;\n\n if (length !== keyList(b).length)\n return false;\n\n for (i = length; i-- !== 0;)\n if (!hasProp.call(b, keys[i])) return false;\n // end fast-deep-equal\n\n // start react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element && b instanceof Element)\n return a === b;\n\n // custom handling for React\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (key === '_owner' && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner.\n // _owner contains circular references\n // and is not needed when comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of a react element\n continue;\n } else {\n // all other properties should be traversed as usual\n if (!equal(a[key], b[key])) return false;\n }\n }\n // end react-fast-compare\n\n // fast-deep-equal index.js 2.0.1\n return true;\n }\n\n return a !== a && b !== b;\n}\n// end fast-deep-equal\n\nmodule.exports = function exportedEqual(a, b) {\n try {\n return equal(a, b);\n } catch (error) {\n if ((error.message && error.message.match(/stack|recursion/i)) || (error.number === -2146828260)) {\n // warn on circular references, don't crash\n // browsers give this different errors name and messages:\n // chrome/safari: \"RangeError\", \"Maximum call stack size exceeded\"\n // firefox: \"InternalError\", too much recursion\"\n // edge: \"Error\", \"Out of stack space\"\n console.warn('Warning: react-fast-compare does not handle circular references.', error.name, error.message);\n return false;\n }\n // some other error. we should definitely know about these\n throw error;\n }\n};\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport isEqual from 'react-fast-compare';\nimport Form from '../Form';\nimport Field from '../Field';\nimport { isUndefined, isFunction, runCallback } from '../utils';\n\nconst Wrapper = React.Frament || 'div';\n\nclass EasyFieldList extends Component {\n static displayName = 'React.Formutil.EasyField.List';\n\n static propTypes = {\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n value: PropTypes.array,\n\n children: PropTypes.func.isRequired\n };\n\n id = 0;\n latestValue = this.props.value;\n $formutil;\n\n constructor(props) {\n super(props);\n\n this.state = {\n items: props.value.length ? props.value.map(() => this.getId()) : [this.getId()],\n formKey: 0\n };\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.value !== this.latestValue) {\n this.setState({\n items: this.props.value.length ? this.props.value.map(() => this.getId()) : [this.getId()],\n formKey: this.state.formKey + 1\n });\n\n this.latestValue = this.props.value;\n }\n }\n\n getId(values) {\n return {\n id: this.id++,\n values\n };\n }\n\n FieldValidators = {\n required(value) {\n return value !== null;\n }\n };\n\n $onFormChange = $formutil => {\n $formutil.$onValidates($formutil => {\n const { $invalid, $params } = $formutil;\n\n if ($invalid) {\n if (this.props.value.length) {\n this.props.onChange((this.latestValue = []));\n }\n } else if (!isEqual(this.props.value, $params.list)) {\n this.props.onChange((this.latestValue = $params.list));\n }\n });\n };\n\n swap = (m, n, callback) =>\n this.$setState(({ items }) => {\n [items[n], items[m]] = [items[m], items[n]];\n\n return items;\n }, callback);\n\n insert = (...args) => {\n let m, values, callback;\n\n args.forEach(arg => {\n if (isFunction(arg)) {\n callback = arg;\n } else if (typeof arg === 'number') {\n m = arg;\n } else if (typeof arg === 'object') {\n values = arg;\n }\n });\n\n return this.$setState(({ items }) => {\n if (isUndefined(m)) {\n items.push(this.getId(values));\n } else {\n items.splice(m, 0, this.getId(values));\n }\n\n return { items };\n }, callback);\n };\n\n remove = (...args) => {\n let m, callback;\n\n args.forEach(arg => {\n if (isFunction(arg)) {\n callback = arg;\n } else if (typeof arg === 'number') {\n m = arg;\n }\n });\n\n return this.$setState(({ items }) => {\n if (isUndefined(m)) {\n items.pop();\n } else {\n items.splice(m, 1);\n }\n\n if (!items.length) {\n items = [this.getId()];\n }\n\n return { items };\n }, callback);\n };\n\n $setState = (updater, callback) =>\n new Promise(resolve =>\n this.setState(updater, () =>\n this.$formutil.$onValidates($formutil => resolve(runCallback(callback, $formutil)))\n )\n );\n\n render() {\n const { children, onFocus, onBlur, value } = this.props;\n\n if (!isFunction(children)) {\n return null;\n }\n\n const $baseutil = {\n $length: this.state.items.length,\n $insert: this.insert,\n $remove: this.remove,\n $swap: this.swap,\n $push: (values, callback) => this.insert(values, callback),\n $pop: callback => this.remove(callback),\n $shift: callback => this.remove(0, callback),\n $unshift: (values, callback) => this.insert(0, values, callback),\n onFocus,\n onBlur\n };\n\n return (\n {\n this.$formutil = $formutil;\n\n return (\n \n {this.state.items.map(({ id, values }, index) => (\n {\n return (\n \n $formutil.$onValidates($formutil => {\n const { $invalid, $params } = $formutil;\n\n if ($invalid) {\n if ($fieldutil.$viewValue !== null) {\n $fieldutil.$render(null);\n }\n } else if (!isEqual($fieldutil.$viewValue, $params)) {\n $fieldutil.$render($params);\n }\n })\n }\n children={$innerFormutil =>\n children(\n {\n ...$baseutil,\n ...$innerFormutil,\n $index: index,\n $isLast: () => index === this.state.items.length - 1,\n $isFirst: () => index === 0\n },\n $formutil\n )\n }\n />\n );\n }}\n />\n ))}\n \n );\n }}\n />\n );\n }\n}\n\nexport default EasyFieldList;\n","import { Children, cloneElement, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport Native from './Native';\nimport Group from './Group';\nimport List from './List';\nimport { isEmpty, isUndefined, isFunction, isValidProp } from '../utils';\n\nexport const TYPE = '__TYPE__';\nexport const defaultValidators = [\n [\n 'required',\n ($value, check, { __TYPE__, checked = true }) =>\n __TYPE__ === 'checked' ? $value === checked : !isEmpty($value)\n ],\n ['maxLength', ($value, len) => isEmpty($value) || $value.length <= len],\n ['minLength', ($value, len) => isEmpty($value) || $value.length >= len],\n ['max', ($value, limit) => isEmpty($value) || $value * 1 <= limit],\n ['min', ($value, limit) => isEmpty($value) || $value * 1 >= limit],\n ['pattern', ($value, regexp) => isEmpty($value) || regexp.test($value)],\n ['enum', ($value, enumeration) => isEmpty($value) || enumeration.indexOf($value) > -1],\n ['checker', ($value, checker, props) => checker($value, props)]\n].reduce(($validators, item) => {\n const [validKey, validate] = item;\n $validators[validKey] = function validator($value, propValue, { validMessage = {} }) {\n return validate(...arguments) || validMessage[validKey] || `Error input: ${validKey}`;\n };\n return $validators;\n}, {});\n\nexport const propTypes =\n process.env.NODE_ENV !== 'production'\n ? {\n type: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),\n component: PropTypes.func,\n render: PropTypes.func,\n\n defaultValue: PropTypes.any,\n validMessage: PropTypes.object,\n\n valuePropName: PropTypes.string,\n changePropName: PropTypes.string,\n focusPropName: PropTypes.string,\n blurPropName: PropTypes.string,\n\n passUtil: PropTypes.string\n }\n : undefined;\n\nexport const displayName = 'React.Formutil.EasyField';\n\nexport const defaultProps = {\n validMessage: {},\n valuePropName: 'value',\n changePropName: 'onChange',\n focusPropName: 'onFocus',\n blurPropName: 'onBlur',\n $parser: value => (typeof value === 'string' ? value.trim() : value)\n};\n\nexport function createHandler($fieldutil, fieldProps, childProps) {\n const { valuePropName, changePropName, focusPropName, blurPropName, passUtil } = fieldProps;\n\n const fetchValueFromEvent = function(ev) {\n return ev && ev.target ? ev.target[valuePropName] : ev;\n };\n\n const $handleProps = {\n ...childProps,\n\n [valuePropName]: $fieldutil.$viewValue,\n [changePropName]: (...args) => {\n let value = args[0];\n let ev = args[args.length - 1];\n\n if (!ev || !ev.target) {\n ev = args;\n } else {\n ev = [ev];\n }\n\n const onChange = fieldProps[changePropName];\n onChange && onChange(...ev);\n\n const newValue = fetchValueFromEvent(value);\n $fieldutil.$render(newValue);\n },\n [focusPropName]: (...args) => {\n const onFocus = fieldProps[focusPropName];\n onFocus && onFocus(...args);\n\n $fieldutil.$setFocused(true);\n },\n [blurPropName]: (...args) => {\n const onBlur = fieldProps[blurPropName];\n onBlur && onBlur(...args);\n\n if ($fieldutil.$untouched) {\n $fieldutil.$setTouched(true);\n }\n\n $fieldutil.$setFocused(false);\n }\n };\n\n if (passUtil) {\n $handleProps[passUtil === true ? '$fieldutil' : passUtil] = $fieldutil;\n }\n\n return $handleProps;\n}\n\nexport function parseProps(props) {\n const {\n children,\n component,\n render,\n\n ...fieldProps\n } = props;\n\n const {\n // filter all the props that accept by EasyField\n name,\n type,\n defaultValue,\n valuePropName,\n changePropName,\n focusPropName,\n blurPropName,\n validMessage,\n __TYPE__,\n passUtil,\n\n // filter all the props that accept by Field\n $defaultValue,\n $defaultState,\n $onFieldChange,\n $validators,\n $asyncValidators,\n $validateLazy,\n $reserveOnUnmount,\n $parser,\n $formatter,\n $ref,\n\n ...childProps\n } = fieldProps;\n\n const renderProps = {\n children,\n component,\n render\n };\n\n const isNative = !isUndefined(type) || (isUndefined(children) && isUndefined(component) && isUndefined(render));\n\n Object.keys({\n ...(fieldProps.$validators = {\n ...defaultValidators,\n ...fieldProps.$validators\n }),\n ...fieldProps.$asyncValidators\n }).forEach(prop => {\n if (prop in childProps) {\n if (!isNative || !isValidProp(prop)) {\n delete childProps[prop];\n }\n }\n });\n\n if (isNative) {\n const [htmlType = 'text', groupType] = (type || '').split('.');\n\n renderProps.component = htmlType === 'group' ? Group : htmlType === 'list' ? List : Native;\n\n // Native or Group need to pass 'name' | 'type' | 'children'\n if (name) {\n childProps.name = name;\n }\n\n if (type) {\n childProps.type = htmlType;\n }\n\n if (children) {\n childProps.children = children;\n }\n\n switch (htmlType) {\n case 'select':\n case 'textarea':\n if (props.multiple) {\n fieldProps[TYPE] = 'array';\n }\n break;\n\n case 'group':\n if (groupType === 'checkbox') {\n fieldProps[TYPE] = 'array';\n }\n\n childProps.type = groupType;\n break;\n\n case 'checkbox':\n case 'radio':\n fieldProps[TYPE] = 'checked';\n break;\n\n case 'list':\n fieldProps[TYPE] = 'array';\n break;\n\n default:\n break;\n }\n }\n\n if (!('$defaultValue' in fieldProps) && 'defaultValue' in props) {\n fieldProps.$defaultValue = defaultValue;\n }\n\n if (!('$defaultValue' in fieldProps) && TYPE in fieldProps) {\n let defaultValue;\n\n switch (fieldProps[TYPE]) {\n case 'checked':\n const { unchecked = false } = fieldProps;\n\n defaultValue = unchecked;\n break;\n\n case 'array':\n defaultValue = [];\n break;\n\n case 'object':\n defaultValue = {};\n break;\n\n case 'number':\n defaultValue = 0;\n break;\n\n case 'empty':\n default:\n break;\n }\n\n fieldProps.$defaultValue = defaultValue;\n }\n\n return {\n fieldProps,\n childProps,\n renderProps\n };\n}\n\nexport function renderField($handleProps, props) {\n let { component, render, children } = props;\n\n if (component) {\n return createElement(component, $handleProps);\n }\n\n if (isFunction(render)) {\n return render($handleProps);\n }\n\n if (isFunction(children)) {\n return children($handleProps);\n }\n\n return Children.map(children, child => cloneElement(child, $handleProps));\n}\n","import React, { Component } from 'react';\nimport Field from '../Field';\nimport { renderField, createHandler, parseProps, displayName, propTypes, defaultProps } from './easyFieldHandler';\n\n/**\n * 提供对浏览器原生表单控件的封装\n * 支持以下类型表单元素:\n * - input[type=xx]\n * - textarea\n * - select\n */\nclass EasyField extends Component {\n static displayName = displayName;\n static propTypes = propTypes;\n static defaultProps = defaultProps;\n\n render() {\n const { fieldProps, childProps, renderProps } = parseProps(this.props);\n\n return (\n renderField(createHandler($fieldutil, fieldProps, childProps), renderProps)}\n />\n );\n }\n}\n\nexport default EasyField;\n","import React, { Component } from 'react';\nimport FormContext from './context';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction connect(WrappedComponent) {\n class Connect extends Component {\n static displayName =\n 'React.Formutil.connect.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\n\n render() {\n return (\n \n {context => }\n \n );\n }\n }\n\n return hoistStatics(Connect, WrappedComponent);\n}\n\nexport default connect;\n","import React from 'react';\nimport FormContext from '../context';\n\nfunction useFormContext() {\n if (!React.useState) {\n throw new Error(`Hooks api need react@>=16.8, Please upgrade your reactjs.`);\n }\n\n const { useContext } = React;\n const $formContext = useContext(FormContext);\n\n return $formContext;\n}\n\nexport default useFormContext;\n","import React from 'react';\nimport useFormContext from './useFormContext';\nimport { runCallback, createRef } from '../utils';\nimport { createHandler, GET_FIELD_UUID } from '../fieldHelper';\nimport warning from 'warning';\n\n/**\n * @description\n * The custom hook for Field\n *\n * @param {string | object} [name]\n * @param {object} [props]\n *\n * @return {object} $Fieldutil\n */\nfunction useField(name, props = {}) {\n if (!React.useState) {\n throw new Error(`Hooks api need react@>=16.8, Please upgrade your reactjs.`);\n }\n\n const { useState, useLayoutEffect, useRef } = React;\n\n let $name;\n\n if (name) {\n if (typeof name === 'string') {\n $name = name;\n\n props.name = $name;\n } else {\n props = name;\n\n $name = props.name;\n }\n }\n\n const $formContext = useFormContext();\n /** @type {any} */\n const $this = useRef({}).current;\n /** @type {React.MutableRefObject} */\n const callbackRef = useRef([]);\n\n let $registered;\n\n $this.$formContext = $formContext;\n $this.props = props;\n $this.$setState = $setState;\n // we not directly use this $state, just from $this.$state\n const [, setState] = useState(() => {\n $this.$$FIELD_UUID = GET_FIELD_UUID();\n $this.$fieldHandler = $registered = createHandler($this);\n\n const $state = $this.$fieldHandler.$$reset();\n\n $this.$fieldHandler.$validate();\n\n return $state;\n });\n\n if (!$registered) {\n $registered = ($formContext.$$registers || {})[$this.$fieldHandler.$name] || $this.$fieldHandler;\n }\n\n useLayoutEffect(() => {\n const { $state } = $this;\n\n if ($this.isMounting) {\n if (!($name in ($formContext.$$registers || {}))) {\n const { $prevValue } = $this;\n\n $registered.$$triggerChange({\n $newValue: $state.$value,\n $prevValue\n });\n }\n }\n\n $this.$prevValue = $state.$value;\n }, [$this.$state.$value]);\n\n useLayoutEffect(() => {\n $this.isMounting = true;\n\n warning(\n !$name || $formContext.$formutil,\n `You should enusre that the useField() with the name '${$name}' must be used underneath a component or withForm() HOC, otherwise it's isolated.`\n );\n\n warning($name, `You should pass a name argument to useField(), otherwise it will be isolated!`);\n\n return () => {\n $this.isMounting = false;\n\n createRef(props.$ref, null);\n };\n }, []);\n\n useLayoutEffect(() => {\n if ($formContext.$$register) {\n $formContext.$$register($name, $this.$fieldHandler);\n }\n\n return () => {\n if ($formContext.$$unregister) {\n $formContext.$$unregister($name, $this.$fieldHandler, !$this.isMounting && props.$reserveOnUnmount);\n }\n };\n }, [$name]);\n\n // trigger ref callback\n useLayoutEffect(() => {\n createRef(props.$ref, $this.$fieldutil);\n });\n\n useLayoutEffect(() => {\n if (callbackRef.current.length > 0) {\n const callbackQueue = [...callbackRef.current];\n\n callbackRef.current.length = 0;\n\n while (callbackQueue.length) {\n callbackQueue.pop()($this.$fieldutil);\n }\n }\n });\n\n function $setState($newState, callback) {\n return new Promise(resolve => {\n const execute = () => resolve(runCallback(callback, $this.$fieldutil));\n\n if ($this.isMounting) {\n if ($name in ($formContext.$$registers || {})) {\n $formContext.$$onChange($name, $newState, execute);\n } else {\n setState($registered.$$merge($newState));\n\n $registered.$$detectChange($newState);\n\n callbackRef.current.push(execute);\n }\n } else {\n $registered.$$merge($newState);\n execute();\n }\n });\n }\n\n return ($this.$fieldutil = {\n $name,\n ...$registered.$getState(),\n ...$registered,\n $$formutil: $formContext.$formutil\n });\n}\n\nexport default useField;\n","import useFormContext from './useFormContext';\n\nfunction useForm() {\n const { $formutil } = useFormContext();\n\n return $formutil;\n}\n\nexport default useForm;\n","import { createHandler, parseProps, defaultProps } from '../EasyField/easyFieldHandler';\nimport useField from './useField';\n\nfunction useHandler(props) {\n props = { ...defaultProps, ...props, children: null };\n\n const { fieldProps, childProps } = parseProps(props);\n const $fieldutil = useField(fieldProps);\n\n return createHandler($fieldutil, fieldProps, childProps);\n}\n\nexport default useHandler;\n"],"names":["createContext","OBJECT_PROTO","Object","getPrototypeOf","PATH_REGEXP","Root","isUndefined","window","global","arg","isFunction","isEmpty","isPromise","promise","then","isObject","obj","prototype","toString","call","isPlainObj","constructor","deepClone","Array","isArray","newObj","i","j","length","runCallback","callback","args","createHOC","withHOC","WrappedComponent","VALID_PROPS","isValidProp","prop","indexOf","toLowerCase","executeWord","word","exec","Function","err","parsePath","target","path","value","warning","JSON","stringify","pathSymbols","match","map","s","replace","pathWords","split","trim","filter","item","scope","index","len","nextWord","symbol","nextVarWord","error","createRef","ref","current","arrayFind","array","process","objectMap","handler","keys","reduce","key","objectEach","forEach","toObject","arr","TODO_DELETE","undefined","CLEAR","pkey","pobj","every","objectClear","name","FORM_VALIDATE_RESULT","requestFrame","cancelFrame","requestAnimationFrame","cancelAnimationFrame","setTimeout","clearTimeout","Form","props","$$formPending","$$formValidatePromise","$$registers","$$deepRegisters","$$regDuplications","$$duplicateTimer","$$checkDuplication","hasDup","utils","$curRegistered","$handler","$$reserved","$$reset","$getState","$render","$$register","prevName","$$unregister","$$getRegister","$$fieldChangedQueue","push","$newValue","$value","$$defaultValues","$name","createDeepRegisters","$prevValue","$$defaultInitialize","$defaultValues","$defaultStates","$$deepParseObject","$$defaultStates","$$getDefault","$$triggerChangeTimer","$$triggerFormChange","$newValues","$prevValues","hasFormChanged","$$triggerChange","$validator","$$formValidate","$onFormChange","$formutil","field","Promise","resolve","$breakAsyncHandler","$shouldCancelPrevAsyncValidate","prevCallback","validation","result","$params","formtutil","execCallback","setCallback","reason","$$setFormErrors","validResults","Error","$$setStates","$error","$getField","$new","$$onChange","$state","$setStates","$stateTree","processer","force","$parsedTree","hasStateChange","data","$newState","$weakParams","$$merge","$$detectChange","findItem","forceUpdate","$validates","pop","flatter","names","$validate","$onValidates","filedValidatePromises","$onValidate","all","$reset","$setValues","$valueTree","$setFocuses","$focusedTree","$focused","$setDirts","$dirtyTree","$dirty","$setTouches","$touchedTree","$touched","$setPendings","$pendingTree","$pending","$setErrors","$errorTree","$batchState","$batchDirty","$batchTouched","$batchFocused","$batchPending","$batchError","mayWeakObj","deepObj","$ref","prevProps","children","render","component","createElement","Children","child","type","cloneElement","$processer","$stateArray","$pureParams","$invalid","some","$states","$errors","$dirts","$touches","$focuses","$pendings","$weakStates","$weakErrors","$weakDirts","$weakTouches","$weakFocuses","$weakPendings","$getFirstError","$fieldutil","$fieldError","message","$valid","$pristine","$untouched","React","getFormContext","_render","Component","displayName","propTypes","PropTypes","func","pt","oneOfType","node","isRequired","object","shape","any","defaultProps","require$$0","ReactIs","withForm","config","FormEnhanced","others","formProps","hoistStatics","FIELD_UUID","$baseState","isError","warningValidatorReturn","string","$defaultValue","$defaultState","$onFieldChange","$validators","$asyncValidators","$validateLazy","bool","$reserveOnUnmount","$parser","$formatter","GET_FIELD_UUID","renderField","createHandler","$this","owner","$fieldHandler","$$FIELD_UUID","$picker","$getComponent","$setState","$setValue","$setTouched","$setDirty","$setFocused","$setValidity","$setError","$setPending","$$validatePromise","$formContext","$initialState","$initialValue","$newError","$validError","$skipRestValidate","$validatePromises","promises","catch","$viewValue","$setViewValue","$setModelValue","Field","execute","isMounting","$registered","$$formutil","shouldInitial","context","withField","FieldEnhanced","fieldProps","concat","EasyFieldNative","htmlValue","onChange","onFocus","onBlur","checked","unchecked","htmlType","htmlProps","compositionValue","onCompositionEnd","ev","composition","onCompositionStart","Element","multiple","slice","options","option","selected","unchekced","Provider","Consumer","EasyFieldGroup","className","groupNode","GroupOptionProps","GroupOption","EasyFieldGroupOption","DeprecatedEasyFieldGroupOption","childNodes","getGroupContext","element","$groupHander","elemProps","Wrapper","Frament","EasyFieldList","id","latestValue","FieldValidators","required","isEqual","list","swap","m","n","items","insert","values","getId","splice","remove","updater","setState","state","formKey","$baseutil","$length","$insert","$remove","$swap","$push","$pop","$shift","$unshift","$innerFormutil","$index","$isLast","$isFirst","TYPE","defaultValidators","check","__TYPE__","limit","regexp","test","enumeration","checker","validKey","validate","validator","propValue","validMessage","arguments","defaultValue","valuePropName","changePropName","focusPropName","blurPropName","passUtil","childProps","fetchValueFromEvent","$handleProps","newValue","parseProps","renderProps","isNative","groupType","Group","List","Native","EasyField","connect","Connect","useFormContext","useState","useContext","FormContext","useField","useLayoutEffect","useRef","callbackRef","callbackQueue","useForm","useHandler"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,oBAAeA,mBAAa,CAAC,EAAD,CAA5B;;ECFA;;;;;;;EAkBA,IAAI,OAAO,GAAG,WAAW,EAAE,CAAC;;AAE5B,EAAa;IACX,IAAI,YAAY,GAAG,SAAS,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE;MACrD,IAAI,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC;MAC3B,IAAI,GAAG,IAAI,KAAK,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;MACxC,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,EAAE,EAAE;QAClC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;OAChC;MACD,IAAI,QAAQ,GAAG,CAAC,CAAC;MACj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umd.production.js b/dist/react-formutil.umd.production.js index acb04a0..c18e65b 100644 --- a/dist/react-formutil.umd.production.js +++ b/dist/react-formutil.umd.production.js @@ -1 +1 @@ -!function(e,t){"object"===typeof exports&&"undefined"!==typeof module?t(exports,require("react"),require("prop-types")):"function"===typeof define&&define.amd?define(["exports","react","prop-types"],t):t((e=e||self).ReactFormutil={},e.React,e.PropTypes)}(this,function(e,t,r){"use strict";var n="default"in t?t.default:t;function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){return!t||"object"!==typeof t&&"function"!==typeof t?d(e):t}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function v(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t1?t-1:0),n=1;n=0?[]:{}:s[p];break;default:s[p]=i}}}catch(e){E(!1,"The name '%s' of Field seems is not a legal expression.",o)}if(t.length>2)return n}function B(e,t){e&&(T(e)?e(t):"current"in e&&(e.current=t))}var z=function(e,t){for(var r=0,n=e.length;r2&&void 0!==arguments[2]?arguments[2]:{};return e.reduce(function(){return t.apply(void 0,arguments),arguments.length<=0?void 0:arguments[0]},r)},G=void 0;var W,K,J=function(e,t){_(L(e,t))||(L(e,t,G),function e(t,r,n){q(t,function(r,n){r===G?delete t[n]:r&&"object"===typeof r&&e(r,n,t)}),n&&Object.keys(t).every(function(e){return t[e]===G})&&(n[r]=G,e(n))}(e))},X="FORM_VALIDATE_RESULT";"function"===typeof requestAnimationFrame?(W=requestAnimationFrame,K=cancelAnimationFrame):(W=setTimeout,K=clearTimeout);var Z=function(e){function r(e){var t;return o(this,r),(t=p(this,c(r).call(this,e))).$$formPending=void 0,t.$$formValidatePromise=void 0,t.$$registers={},t.$$deepRegisters={},t.$$regDuplications={},t.$$duplicateTimer=void 0,t.$$checkDuplication=function(){var e,r=d(t).$$regDuplications;q(r,function(t,n){var o=h(t,2),i=o[0],a=o[1];E(i.$$reserved,"The Field with a name '".concat(n,"' has been registered!")),a.$$reset(i.$getState()),e=delete r[n]}),e&&t.$render()},t.$$register=function(e,r,n){if(t.$$unregister(n,r),e){var o=t.$$getRegister(e);o?(K(t.$$duplicateTimer),t.$$regDuplications[e]=[o,r],t.$$duplicateTimer=W(t.$$checkDuplication)):(t.$$fieldChangedQueue.push({name:e,$newValue:r.$getState().$value}),J(t.$$defaultValues,e)),t.$$registers[r.$name=e]=r,t.createDeepRegisters(),t.$render()}},t.$$unregister=function(e,r,n){if(e){if(e in t.$$regDuplications){var o=h(t.$$regDuplications[e],2),i=o[0],a=o[1];t.$$fieldChangedQueue.push({name:e,$newValue:a.$getState().$value,$prevValue:i.$getState().$value}),delete t.$$regDuplications[e]}else t.$$registers[e]===r&&(n?r.$$reserved=!0:(delete t.$$registers[e],t.$$fieldChangedQueue.push({name:e,$prevValue:r.$getState().$value}),J(t.$$defaultValues,e)));t.createDeepRegisters(),t.$render()}},t.$$defaultInitialize=function(){var e=t.props,r=e.$defaultValues,n=e.$defaultStates;t.$$defaultValues=t.$$deepParseObject(M(T(r)?r(t.props)||{}:r)),t.$$defaultStates=t.$$deepParseObject(M(T(n)?n(t.props)||{}:n))},t.$$getDefault=function(){return{$$defaultStates:t.$$defaultStates,$$defaultValues:t.$$defaultValues}},t.$$triggerChangeTimer=void 0,t.$$fieldChangedQueue=[],t.$$triggerFormChange=function(){if(t.$$fieldChangedQueue.length){var e=v(t.$$fieldChangedQueue);t.$$fieldChangedQueue.length=0;var r={},n={},o=t.$$registers,i=!1;e.forEach(function(e){if(e.name in o||delete e.$newValue,e.$newValue!==e.$prevValue){if("$newValue"in e&&"$prevValue"in e){var a=t.$$getRegister(e.name);a&&a.$$triggerChange(e)}"$newValue"in e&&L(r,e.name,e.$newValue),"$prevValue"in e&&L(n,e.name,e.$prevValue),i=!0}}),i&&(T(t.props.$validator)&&t.$$formValidate(),T(t.props.$onFormChange)&&t.props.$onFormChange(t.$formutil,r,n))}},t.createDeepRegisters=function(){return t.$$deepRegisters=t.$$deepParseObject(t.$$registers)},t.$$getRegister=function(e){if(e){var r=t.$$registers[e]||L(t.$$deepRegisters,e);if(r)return r}},t.$$formValidate=function(e){return t.$$formValidatePromise=new Promise(function(r){var n,o,i,a,u=(0,t.props.$validator)(t.$formutil.$params,t.formtutil),s=function(t){return r(N(e,N(i,t)))};A(u)?(t.$$formPending||(t.$$formPending=!0,t.$render()),o=function(e){return n=e(s)},a=u.then(function(){},function(e){return e}).then(function(e){return n||(t.$shouldCancelPrevAsyncValidate=null,t.$$formPending=!1,t.$$setFormErrors(e,s))})):(t.$$formPending&&(t.$$formPending=!1),a=t.$$setFormErrors(u,s)),t.$shouldCancelPrevAsyncValidate&&t.$shouldCancelPrevAsyncValidate(function(e){return i=e,a}),t.$shouldCancelPrevAsyncValidate=o})},t.$$setFormErrors=function(e,r){return e&&(e instanceof Error||"object"!==typeof e)?(E(!1,"The result of $validator in should always return None(null,undefined) or an object contains error message of Field."),t.$render(r)):t.$$setStates(e||{},function(e,t){var r=t.$getState().$error,n=void 0===r?{}:r;return e?{$error:s({},n,u({},X,e))}:n[X]?(delete n[X],{$error:n}):void 0},r,!0)},t.$getField=function(e){var r=t.$$getRegister(e);if(E(!e||r,"$getField('".concat(e,"') fail to find the matched Field. Maybe it has been unmounted.")),E(e,"You should pass a name of the mounted Field to $getField()."),r)return r.$new()},t.$$onChange=function(e,r,n){return t.$setStates(u({},e,r),n)},t.$$setStates=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=t.$$deepParseObject(e),a=!1;return q(t.$$registers,function(n,u){var s=u in e?e[u]:L(i,u);if(!_(s)||o){var l=r(s,n);if(l){var c=t.$formutil.$weakParams[u],$=n.$$merge(l).$value;if(n.$$detectChange(l),"$value"in l||"$viewValue"in l){var f=z(t.$$fieldChangedQueue,function(e){return e.name===u});f?("$prevValue"in f||(f.$prevValue=f.$newValue),f.$newValue=$):t.$$fieldChangedQueue.push({name:u,$newValue:$,$prevValue:c})}a=!0}}}),a?t.$render(n):Promise.resolve(N(n,t.$formutil))},t.$render=function(e){return new Promise(function(r){return t.forceUpdate(function(){return r(N(e,t.$formutil))})})},t.$validates=function(){for(var e,r=arguments.length,n=new Array(r),o=0;o1&&void 0!==arguments[1]?arguments[1]:{};return q(e,function(e,r){return L(t,r,e)}),t}},{key:"componentDidMount",value:function(){B(this.props.$ref,this.$formutil)}},{key:"componentDidUpdate",value:function(e){var t=this;B(this.props.$ref,this.$formutil),K(this.$$triggerChangeTimer),this.$$triggerChangeTimer=W(function(){t.$$triggerFormChange()})}},{key:"componentWillUnmount",value:function(){B(this.props.$ref,null)}},{key:"_render",value:function(){var e=this.$formutil,r=this.props,n=r.children,o=r.render,i=r.component;return i?t.createElement(i,{$formutil:e}):T(o)?o(e):T(n)?n(e):t.Children.map(n,function(r){return r&&T(r.type)?t.cloneElement(r,{$formutil:e}):r})}},{key:"render",value:function(){var e=this,t=this.props.$processer,r=Object.keys(this.$$registers).map(function(t){return{path:t,$state:e.$$registers[t].$getState()}}),o=Q(r,function(e,r){var n=r.path,o=r.$state;t&&t(o,n),"$value"in o&&(o.$dirty||!_(o.$value))&&(e[n]=o.$value)}),i=Q(r,function(e,t){var r=t.path;t.$state;return r in o&&L(e,r,o[r])}),a=r.some(function(e){return e.$state.$invalid}),u=r.some(function(e){return e.$state.$dirty}),l=r.some(function(e){return e.$state.$touched}),c=r.some(function(e){return e.$state.$focused}),$=this.$$formPending||r.some(function(e){return e.$state.$pending}),f=this.$formutil={$$registers:s({},this.$$registers),$$deepRegisters:this.$$deepRegisters,$states:Q(r,function(e,t){return L(e,t.path,t.$state)}),$params:s({},this.$$defaultValues,i),$errors:Q(r,function(e,t){var r=t.path,n=t.$state;n.$invalid&&L(e,r,n.$error)}),$dirts:Q(r,function(e,t){return L(e,t.path,t.$state.$dirty)}),$touches:Q(r,function(e,t){return L(e,t.path,t.$state.$touched)}),$focuses:Q(r,function(e,t){return L(e,t.path,t.$state.$focused)}),$pendings:Q(r,function(e,t){return L(e,t.path,t.$state.$pending)}),$weakStates:Q(r,function(e,t){var r=t.path,n=t.$state;return e[r]=n}),$weakParams:o,$weakErrors:Q(r,function(e,t){var r=t.path,n=t.$state;n.$invalid&&(e[r]=n.$error)}),$weakDirts:Q(r,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$dirty}),$weakTouches:Q(r,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$touched}),$weakFocuses:Q(r,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$focused}),$weakPendings:Q(r,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$pending}),$getFirstError:function(e){if(e){var t=f.$getField(e);return t&&t.$getFirstError()}for(var r in f.$weakErrors){var n=f.$weakErrors[r];for(var o in n)return n[o]instanceof Error?n[o].message:n[o]}},$render:this.$render,$getField:this.$getField,$onValidates:this.$onValidates,$new:function(){return e.$formutil},$setStates:this.$setStates,$setValues:this.$setValues,$setErrors:this.$setErrors,$setTouches:this.$setTouches,$setDirts:this.$setDirts,$setFocuses:this.$setFocuses,$batchState:this.$batchState,$batchTouched:this.$batchTouched,$batchDirty:this.$batchDirty,$batchFocused:this.$batchFocused,$reset:this.$reset,$validates:this.$validates,$validate:this.$validate,$valid:!a,$invalid:a,$dirty:u,$pristine:!u,$touched:l,$untouched:!l,$focused:c,$pending:$};return n.createElement(O.Provider,{value:this.getFormContext()},this._render())}}]),r}();Z.displayName="React.Formutil.Form",Z.defaultProps={$defaultValues:{},$defaultStates:{}};var ee=y(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"===typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,$=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116;function v(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case c:case $:case i:case u:case a:case d:return e;default:switch(e=e&&e.$$typeof){case l:case f:case s:return e;default:return t}}case h:case p:case o:return t}}}function m(e){return v(e)===$}t.typeOf=v,t.AsyncMode=c,t.ConcurrentMode=$,t.ContextConsumer=l,t.ContextProvider=s,t.Element=n,t.ForwardRef=f,t.Fragment=i,t.Lazy=h,t.Memo=p,t.Portal=o,t.Profiler=u,t.StrictMode=a,t.Suspense=d,t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===i||e===$||e===u||e===a||e===d||"object"===typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===s||e.$$typeof===l||e.$$typeof===f)},t.isAsyncMode=function(e){return m(e)||v(e)===c},t.isConcurrentMode=m,t.isContextConsumer=function(e){return v(e)===l},t.isContextProvider=function(e){return v(e)===s},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return v(e)===f},t.isFragment=function(e){return v(e)===i},t.isLazy=function(e){return v(e)===h},t.isMemo=function(e){return v(e)===p},t.isPortal=function(e){return v(e)===o},t.isProfiler=function(e){return v(e)===u},t.isStrictMode=function(e){return v(e)===a},t.isSuspense=function(e){return v(e)===d}});g(ee);ee.typeOf,ee.AsyncMode,ee.ConcurrentMode,ee.ContextConsumer,ee.ContextProvider,ee.Element,ee.ForwardRef,ee.Fragment,ee.Lazy,ee.Memo,ee.Portal,ee.Profiler,ee.StrictMode,ee.Suspense,ee.isValidElementType,ee.isAsyncMode,ee.isConcurrentMode,ee.isContextConsumer,ee.isContextProvider,ee.isElement,ee.isForwardRef,ee.isFragment,ee.isLazy,ee.isMemo,ee.isPortal,ee.isProfiler,ee.isStrictMode,ee.isSuspense;var te=y(function(e){e.exports=ee}),re={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},ne={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},oe={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ie={};function ae(e){return te.isMemo(e)?oe:ie[e.$$typeof]||re}ie[te.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var ue=Object.defineProperty,se=Object.getOwnPropertyNames,le=Object.getOwnPropertySymbols,ce=Object.getOwnPropertyDescriptor,$e=Object.getPrototypeOf,fe=Object.prototype;var de=function e(t,r,n){if("string"!==typeof r){if(fe){var o=$e(r);o&&o!==fe&&e(t,o,n)}var i=se(r);le&&(i=i.concat(le(r)));for(var a=ae(t),u=ae(r),s=0;s1&&void 0!==arguments[1]?arguments[1]:{},i=function(i){function u(){return o(this,u),p(this,c(u).apply(this,arguments))}return l(u,t.Component),a(u,[{key:"render",value:function(){var t=Object.assign({},this.props),o=this.props,i=(o.component,f(o,["component"]));return["$defaultStates","$defaultValues","$onFormChange","$validator","$processer","$ref"].forEach(function(e){e in t&&("$defaultStates"!==e&&"$defaultValues"!==e||(i[e]=s({},r[e],t[e])),delete t[e])}),n.createElement(Z,Object.assign({},r,i,{render:function(r){return n.createElement(e,Object.assign({},t,{$formutil:r}))}}))}}]),u}();return i.displayName="React.Formutil.withForm."+(e.displayName||e.name||"Anonymous"),de(i,e)}),he=0,ve={$valid:!0,$invalid:!1,$dirty:!1,$pristine:!0,$touched:!1,$untouched:!0,$focused:!1,$pending:!1,$error:{}};function me(e){return!0!==e}function ge(e,t,r){E(!_(e),"You should return a string or Error when the validation('".concat(r&&r+": ").concat(t,"') failed, otherwise return true."))}function ye(){return he++}function be(e,t){var r;function n(t){var r,n=e.props,o=e.$formContext;if(o.$$getDefault){var i=n.name,a=o.$$getDefault(),u=a.$$defaultStates,l=a.$$defaultValues;if(i&&l){var $=L(l,i);r=L(u,i)||{},_($)||(r.$value=$)}}var f=n.$defaultValue,d=n.$defaultState;return c(s({},ve,T(d)?d(n):d,{$value:T(f)?f(n):"$defaultValue"in n?f:""},r,t))}function o(){return s({},e.$state)}function i(t){return r=new Promise(function(r){var n,o,i,c,$=e.props,f=e.$formContext,d=s({},$.$validators,$.$asyncValidators),p=e.$state,h=p.$value,v=p.$pending,m=Object.assign({},p.$error),g=f.$formutil,y={},b=!1;delete m[X];var w=Object.keys(d).reduce(function(t,r){if(delete m[r],!b&&null!=$[r]){var o=d[r](h,$[r],s({},$,{$formutil:g,$fieldutil:e.$fieldutil,$validError:y}));A(o)?t.push(o.catch(function(e){n||u(r,e||r)})):me(o)&&(y[r]=o||r,ge(o,r,$.name),$.$validateLazy&&(b=!0))}return t},[]),C=function(e){return r(N(t,N(i,e)))};w.length?(v||l(!0),o=function(e){return n=e(C)},w.push(a(s({},m,y))),c=Promise.all(w).then(function(){return n||(e.$shouldCancelPrevAsyncValidate=null,l(!1,C))})):(v&&l(!1),c=a(s({},m,y),C)),e.$shouldCancelPrevAsyncValidate&&e.$shouldCancelPrevAsyncValidate(function(e){return i=e,c}),e.$shouldCancelPrevAsyncValidate=o})}function a(t,r){return e.$setState({$error:t},r)}function u(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,o=Object.assign({},e.$state.$error);return me(r)?(o[t]=r||t,ge(r,t,e.props.name)):delete o[t],a(o,n)}function l(t,r){return e.$setState({$pending:t},r)}function c(t){var r=Object.assign({},t);"$error"in r&&(r.$error||(r.$error={}),r.$valid=0===Object.keys(r.$error).length);var n=e.props,i=n.$parser,a=n.$formatter;if("$viewValue"in r&&!("$value"in r)){r.$value=i?i(r.$viewValue,function(e){return r.$viewValue=e}):r.$viewValue}else if("$value"in r&&!("$viewValue"in r)){r.$viewValue=a?a(r.$value,function(e){return r.$value=e}):r.$value}return"$valid"in r?r.$invalid=!r.$valid:"$invalid"in r&&(r.$dirty=!r.$invalid),"$dirty"in r?r.$pristine=!r.$dirty:"$pristine"in r&&(r.$dirty=!r.$pristine),"$touched"in r?r.$untouched=!r.$touched:"$untouched"in r&&(r.$touched=!r.$untouched),e.$state=s({},e.$state,r),o()}return{$$FIELD_UUID:e.$$FIELD_UUID,$$reset:n,$$merge:c,$$detectChange:function(e){("$value"in e||"$viewValue"in e)&&i()},$$triggerChange:function(t){var r=t.$newValue,n=t.$prevValue,o=e.props.$onFieldChange;T(o)&&o(r,n,e.$formContext.$formutil)},$onValidate:function(e){return r.then(e),r},$new:function(){return e.$fieldutil},$picker:o,$getState:o,$getComponent:function(){return t},$reset:function(t,r){return e.$setState(n(t),r)},$getFirstError:function(){var t=e.$state.$error,r=void 0===t?{}:t;for(var n in r)return r[n]instanceof Error?r[n].message:r[n]},$validate:i,$setState:e.$setState,$render:function(t,r){return e.$setState({$viewValue:t,$dirty:!0},r)},$setValue:function(t,r){return e.$setState({$value:t},r)},$setTouched:function(t,r){return e.$setState({$touched:t},r)},$setDirty:function(t,r){return e.$setState({$dirty:t},r)},$setFocused:function(t,r){return e.$setState({$focused:t},r)},$setValidity:u,$setError:a,$setPending:l}}var we=function(e){function r(){var e,t;o(this,r);for(var n=arguments.length,i=new Array(n),a=0;a with the name '".concat(e,"' must be used underneath a component or withForm() HOC, otherwise it's isolated.")),E(e,"You should assign a name to , otherwise it will be isolated!"),t.$$register&&t.$$register(e,this.$fieldHandler),this.$prevValue=this.$state.$value,B(this.props.$ref,this.$fieldutil)}},{key:"componentWillUnmount",value:function(){this.$formContext.$$unregister&&this.$formContext.$$unregister(this.props.name,this.$fieldHandler,this.props.$reserveOnUnmount),this.isMounting=!1,B(this.props.$ref,null)}},{key:"componentDidUpdate",value:function(e){var t=this.props.name;t!==e.name&&this.$formContext.$$register&&this.$formContext.$$register(t,this.$fieldHandler,e.name),B(this.props.$ref,this.$fieldutil),this.$state.$value!==this.$prevValue&&(t in(this.$formContext.$$registers||{})||this.$registered.$$triggerChange({$newValue:this.$state.$value,$prevValue:this.$prevValue}),this.$prevValue=this.$state.$value)}},{key:"_render",value:function(){return function(e,r){var n=r.children,o=r.render,i=r.component;return i?t.createElement(i,{$fieldutil:e}):T(o)?o(e):T(n)?n(e):t.Children.map(n,function(r){return r&&T(r.type)?t.cloneElement(r,{$fieldutil:e}):r})}(this.$fieldutil=s({$name:this.props.name},this.$registered.$getState(),this.$registered,{$$formutil:this.$formContext.$formutil}),this.props)}},{key:"render",value:function(){var e=this,t=!this.$formContext;return n.createElement(O.Consumer,null,function(r){return e.$formContext=r,e.$fieldHandler||(e.$fieldHandler=be(e,e)),e.$registered=(r.$$registers||{})[e.$fieldHandler.$name]||e.$fieldHandler,t&&(e.$fieldHandler.$$reset(),e.$fieldHandler.$validate()),e._render()})}}]),r}();we.displayName="React.Formutil.Field";var Ce=U(function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=function(i){function u(){return o(this,u),p(this,c(u).apply(this,arguments))}return l(u,t.Component),a(u,[{key:"render",value:function(){var t=Object.assign({},this.props),o=this.props,i=(o.component,f(o,["component"]));return["$validators","$asyncValidators","$validateLazy","$reserveOnUnmount","$defaultValue","$defaultState","$onFieldChange","$parser","$formatter","$ref","name"].concat(Object.keys(s({},r.$validators,r.$asyncValidators,t.$validators,t.$asyncValidators))).forEach(function(e){e in t&&("$validators"!==e&&"$asyncValidators"!==e&&"$defaultState"!==e||(i[e]=s({},r[e],t[e])),delete t[e])}),n.createElement(we,Object.assign({},r,i,{render:function(r){return n.createElement(e,Object.assign({},t,{$fieldutil:r}))}}))}}]),u}();return i.displayName="React.Formutil.withField."+(e.displayName||e.name||"Anonymous"),de(i,e)}),Pe=function(e){function r(){return o(this,r),p(this,c(r).apply(this,arguments))}return l(r,t.Component),a(r,[{key:"render",value:function(){var e=this,t=this.props,r=(t.$fieldutil,t.value),o=t.onChange,i=t.onFocus,a=t.onBlur,u=t.checked,s=t.unchecked,l=f(t,["$fieldutil","value","onChange","onFocus","onBlur","checked","unchecked"]),c=this.props.type,$={value:"compositionValue"in this?this.compositionValue:r,onCompositionEnd:function(t){e.composition=!1,delete e.compositionValue,$.onChange(t)},onCompositionStart:function(){return e.composition=!0},onChange:function(t){var r=t.target.value;e.composition?(e.compositionValue=r,e.forceUpdate()):o(r,t)},onFocus:i,onBlur:a},d="input";switch(c){case"select":d=c,$.onChange=function(e){var t=e.target,r=t.multiple?[].slice.call(t.options).filter(function(e){return e.selected}).map(function(e){return e.value}):t.value;o(r,e)},delete l.type;break;case"textarea":d=c,delete l.type;break;case"checkbox":case"radio":$={checked:r===u,onChange:function(e){o(e.target.checked?u:s,e)},onFocus:i,onBlur:a}}return n.createElement(d,Object.assign({},l,$))}}]),r}();Pe.displayName="React.Formutil.EasyField.Native",Pe.defaultProps={value:"",type:"text",checked:!0,unchecked:!1};var Ve=S({}),Fe=Ve.Provider,Se=Ve.Consumer,Oe=function(e){function r(){return o(this,r),p(this,c(r).apply(this,arguments))}return l(r,t.Component),a(r,[{key:"getGroupContext",value:function(){return this.props}},{key:"_render",value:function(){var e=this.props,r=e.className,o=e.groupNode,i=e.children,a={GroupOption:Ee,Field:ke},u=T(i)?i(a):t.Children.map(i,function(e){return t.cloneElement(e,a)});return null===o?u:n.createElement(o,{className:r},u)}},{key:"render",value:function(){return n.createElement(Fe,{value:this.getGroupContext()},this._render())}}]),r}();Oe.displayName="React.Formutil.EasyField.Group",Oe.defaultProps={type:"checkbox",groupNode:"div"};var Ee=function(e){function r(){return o(this,r),p(this,c(r).apply(this,arguments))}return l(r,t.Component),a(r,[{key:"componentDidMount",value:function(){E("$value"in this.props,"You should pass a $value to .")}},{key:"render",value:function(){var e=this.props,t=e.$value,r=e.onChange,o=e.onFocus,i=e.onBlur,a=f(e,["$value","onChange","onFocus","onBlur"]);return n.createElement(Se,null,function(e){var u=e.type,s=e.name,l="radio"===u?{checked:e.value===t,onChange:function(n){e.onChange(t,n),r&&r(n)}}:"checkbox"===u?{checked:e.value.indexOf(t)>-1,onChange:function(n){e.onChange(n.target.checked?e.value.concat(t):e.value.filter(function(e){return e!==t}),n),r&&r(n)}}:{value:e.value,onChange:function(t){e.onChange(t),r&&r(t)}};return n.createElement("input",Object.assign({name:s},a,l,{type:u,onFocus:function(t){e.onFocus(t),o&&o(t)},onBlur:function(t){e.onBlur(t),i&&i(t)}}))})}}]),r}();Ee.displayName="React.Formutil.EasyField.Group.Option";var ke=function(e){function r(){return o(this,r),p(this,c(r).apply(this,arguments))}return l(r,t.Component),a(r,[{key:"componentDidMount",value:function(){E(!1,'The "Field" property in EasyField\'s children-props has been deprecated. Please use "GroupOption" instead.')}},{key:"render",value:function(){return n.createElement(Ee,this.props)}}]),r}();ke.displayName="React.Formutil.EasyField.Group.Option.Deprecated";var je=Array.isArray,xe=Object.keys,_e=Object.prototype.hasOwnProperty,Te="undefined"!==typeof Element;var De=function(e,t){try{return function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){var n,o,i,a=je(t),u=je(r);if(a&&u){if((o=t.length)!=r.length)return!1;for(n=o;0!==n--;)if(!e(t[n],r[n]))return!1;return!0}if(a!=u)return!1;var s=t instanceof Date,l=r instanceof Date;if(s!=l)return!1;if(s&&l)return t.getTime()==r.getTime();var c=t instanceof RegExp,$=r instanceof RegExp;if(c!=$)return!1;if(c&&$)return t.toString()==r.toString();var f=xe(t);if((o=f.length)!==xe(r).length)return!1;for(n=o;0!==n--;)if(!_e.call(r,f[n]))return!1;if(Te&&t instanceof Element&&r instanceof Element)return t===r;for(n=o;0!==n--;)if(("_owner"!==(i=f[n])||!t.$$typeof)&&!e(t[i],r[i]))return!1;return!0}return t!==t&&r!==r}(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}},Ae=n.Frament||"div",Re=function(e){function r(e){var t;return o(this,r),(t=p(this,c(r).call(this,e))).id=0,t.latestValue=t.props.value,t.$formutil=void 0,t.FieldValidators={required:function(e){return null!==e}},t.$onFormChange=function(e){e.$onValidates(function(e){var r=e.$invalid,n=e.$params;r?t.props.value.length&&t.props.onChange(t.latestValue=[]):De(t.props.value,n.list)||t.props.onChange(t.latestValue=n.list)})},t.swap=function(e,r,n){return t.$setState(function(t){var n=t.items,o=[n[e],n[r]];return n[r]=o[0],n[e]=o[1],n},n)},t.insert=function(){for(var e,r,n,o=arguments.length,i=new Array(o),a=0;a=t}],["max",function(e,t){return D(e)||1*e<=t}],["min",function(e,t){return D(e)||1*e>=t}],["pattern",function(e,t){return D(e)||t.test(e)}],["enum",function(e,t){return D(e)||t.indexOf(e)>-1}],["checker",function(e,t,r){return t(e,r)}]].reduce(function(e,t){var r=h(t,2),n=r[0],o=r[1];return e[n]=function(e,t,r){var i=r.validMessage,a=void 0===i?{}:i;return o.apply(void 0,arguments)||a[n]||"Error input: ".concat(n)},e},{}),Ue={validMessage:{},valuePropName:"value",changePropName:"onChange",focusPropName:"onFocus",blurPropName:"onBlur",$parser:function(e){return"string"===typeof e?e.trim():e}};function Ie(e,t,r){var n,o=t.valuePropName,i=t.changePropName,a=t.focusPropName,l=t.blurPropName,c=t.passUtil,$=s({},r,(u(n={},o,e.$viewValue),u(n,i,function(){for(var r=arguments.length,n=new Array(r),a=0;a-1}(e)||delete l[e])}),$){var d=h((a||"").split("."),2),p=d[0],v=void 0===p?"text":p,m=d[1];switch(c.component="group"===v?Oe:"list"===v?Re:Pe,i&&(l.name=i),a&&(l.type=v),t&&(l.children=t),v){case"select":case"textarea":e.multiple&&(o[Me]="array");break;case"group":"checkbox"===m&&(o[Me]="array"),l.type=m;break;case"checkbox":case"radio":o[Me]="checked";break;case"list":o[Me]="array"}}if(!("$defaultValue"in o)&&"defaultValue"in e&&(o.$defaultValue=u),!("$defaultValue"in o)&&Me in o){var g;switch(o[Me]){case"checked":var y=o.unchecked;g=void 0!==y&&y;break;case"array":g=[];break;case"object":g={};break;case"number":g=0}o.$defaultValue=g}return{fieldProps:o,childProps:l,renderProps:c}}var Le=function(e){function r(){return o(this,r),p(this,c(r).apply(this,arguments))}return l(r,t.Component),a(r,[{key:"render",value:function(){var e=He(this.props),r=e.fieldProps,o=e.childProps,i=e.renderProps;return n.createElement(we,Object.assign({},r,{children:function(e){return function(e,r){var n=r.component,o=r.render,i=r.children;return n?t.createElement(n,e):T(o)?o(e):T(i)?i(e):t.Children.map(i,function(r){return t.cloneElement(r,e)})}(Ie(e,r,o),i)}}))}}]),r}();function Be(){if(!n.useState)throw new Error("Hooks api need react@>=16.8, Please upgrade your reactjs.");return(0,n.useContext)(O)}function ze(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n.useState)throw new Error("Hooks api need react@>=16.8, Please upgrade your reactjs.");var r,o=n.useState,i=n.useLayoutEffect,a=n.useRef;e&&("string"===typeof e?(r=e,t.name=r):r=(t=e).name);var u,l=Be(),c=a({}).current,$=a([]);c.$formContext=l,c.props=t,c.$setState=function(e,t){return new Promise(function(n){var o=function(){return n(N(t,c.$fieldutil))};c.isMounting?r in(l.$$registers||{})?l.$$onChange(r,e,o):(f(u.$$merge(e)),u.$$detectChange(e),$.current.push(o)):(u.$$merge(e),o())})};var f=h(o(function(){c.$$FIELD_UUID=ye(),c.$fieldHandler=u=be(c);var e=c.$fieldHandler.$$reset();return c.$fieldHandler.$validate(),e}),2)[1];return u||(u=(l.$$registers||{})[c.$fieldHandler.$name]||c.$fieldHandler),i(function(){var e=c.$state;if(c.isMounting&&!(r in(l.$$registers||{}))){var t=c.$prevValue;u.$$triggerChange({$newValue:e.$value,$prevValue:t})}c.$prevValue=e.$value},[c.$state.$value]),i(function(){return c.isMounting=!0,E(!r||l.$formutil,"You should enusre that the useField() with the name '".concat(r,"' must be used underneath a component or withForm() HOC, otherwise it's isolated.")),E(r,"You should pass a name argument to useField(), otherwise it will be isolated!"),function(){c.isMounting=!1,B(t.$ref,null)}},[]),i(function(){return l.$$register&&l.$$register(r,c.$fieldHandler),function(){l.$$unregister&&l.$$unregister(r,c.$fieldHandler,!c.isMounting&&t.$reserveOnUnmount)}},[r]),i(function(){B(t.$ref,c.$fieldutil)}),i(function(){if($.current.length>0){var e=v($.current);for($.current.length=0;e.length;)e.pop()(c.$fieldutil)}}),c.$fieldutil=s({$name:r},u.$getState(),u,{$$formutil:l.$formutil})}Le.displayName="React.Formutil.EasyField",Le.defaultProps=Ue,e.EasyField=Le,e.Field=we,e.Form=Z,e.connect=function(e){var r=function(r){function i(){return o(this,i),p(this,c(i).apply(this,arguments))}return l(i,t.Component),a(i,[{key:"render",value:function(){var t=this;return n.createElement(O.Consumer,null,function(r){return n.createElement(e,Object.assign({},t.props,{$formutil:r.$formutil}))})}}]),i}();return r.displayName="React.Formutil.connect."+(e.displayName||e.name||"Anonymous"),de(r,e)},e.useField=ze,e.useForm=function(){return Be().$formutil},e.useHandler=function(e){var t=He(e=s({},Ue,e,{children:null})),r=t.fieldProps,n=t.childProps;return Ie(ze(r),r,n)},e.withField=Ce,e.withForm=pe,Object.defineProperty(e,"__esModule",{value:!0})}); +!function(e,t){"object"===typeof exports&&"undefined"!==typeof module?t(exports,require("react")):"function"===typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactFormutil={},e.React)}(this,function(e,t){"use strict";var r="default"in t?t.default:t;function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t){return!t||"object"!==typeof t&&"function"!==typeof t?f(e):t}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==u.return||u.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function h(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t1?t-1:0),n=1;n=0?[]:{}:s[p];break;default:s[p]=o}}}catch(e){v(!1,"The name '%s' of Field seems is not a legal expression.",i)}if(t.length>2)return n}function D(e,t){e&&(w(e)?e(t):"current"in e&&(e.current=t))}var _=function(e,t){for(var r=0,n=e.length;r2&&void 0!==arguments[2]?arguments[2]:{};return e.reduce(function(){return t.apply(void 0,arguments),arguments.length<=0?void 0:arguments[0]},r)},M=void 0;var R,U,I=function(e,t){C(x(e,t))||(x(e,t,M),function e(t,r,n){A(t,function(r,n){r===M?delete t[n]:r&&"object"===typeof r&&e(r,n,t)}),n&&Object.keys(t).every(function(e){return t[e]===M})&&(n[r]=M,e(n))}(e))},H="FORM_VALIDATE_RESULT";"function"===typeof requestAnimationFrame?(R=requestAnimationFrame,U=cancelAnimationFrame):(R=setTimeout,U=clearTimeout);var L=function(e){function i(e){var t;return n(this,i),(t=d(this,l(i).call(this,e))).$$formPending=void 0,t.$$formValidatePromise=void 0,t.$$registers={},t.$$deepRegisters={},t.$$regDuplications={},t.$$duplicateTimer=void 0,t.$$checkDuplication=function(){var e,r=f(t).$$regDuplications;A(r,function(t,n){var i=p(t,2),o=i[0],a=i[1];v(o.$$reserved,"The Field with a name '".concat(n,"' has been registered!")),a.$$reset(o.$getState()),e=delete r[n]}),e&&t.$render()},t.$$register=function(e,r,n){if(t.$$unregister(n,r),e){var i=t.$$getRegister(e);i?(U(t.$$duplicateTimer),t.$$regDuplications[e]=[i,r],t.$$duplicateTimer=R(t.$$checkDuplication)):(t.$$fieldChangedQueue.push({name:e,$newValue:r.$getState().$value}),I(t.$$defaultValues,e)),t.$$registers[r.$name=e]=r,t.createDeepRegisters(),t.$render()}},t.$$unregister=function(e,r,n){if(e){if(e in t.$$regDuplications){var i=p(t.$$regDuplications[e],2),o=i[0],a=i[1];t.$$fieldChangedQueue.push({name:e,$newValue:a.$getState().$value,$prevValue:o.$getState().$value}),delete t.$$regDuplications[e]}else t.$$registers[e]===r&&(n?r.$$reserved=!0:(delete t.$$registers[e],t.$$fieldChangedQueue.push({name:e,$prevValue:r.$getState().$value}),I(t.$$defaultValues,e)));t.createDeepRegisters(),t.$render()}},t.$$defaultInitialize=function(){var e=t.props,r=e.$defaultValues,n=e.$defaultStates;t.$$defaultValues=t.$$deepParseObject(S(w(r)?r(t.props)||{}:r)),t.$$defaultStates=t.$$deepParseObject(S(w(n)?n(t.props)||{}:n))},t.$$getDefault=function(){return{$$defaultStates:t.$$defaultStates,$$defaultValues:t.$$defaultValues}},t.$$triggerChangeTimer=void 0,t.$$fieldChangedQueue=[],t.$$triggerFormChange=function(){if(t.$$fieldChangedQueue.length){var e=h(t.$$fieldChangedQueue);t.$$fieldChangedQueue.length=0;var r={},n={},i=t.$$registers,o=!1;e.forEach(function(e){if(e.name in i||delete e.$newValue,e.$newValue!==e.$prevValue){if("$newValue"in e&&"$prevValue"in e){var a=t.$$getRegister(e.name);a&&a.$$triggerChange(e)}"$newValue"in e&&x(r,e.name,e.$newValue),"$prevValue"in e&&x(n,e.name,e.$prevValue),o=!0}}),o&&(w(t.props.$validator)&&t.$$formValidate(),w(t.props.$onFormChange)&&t.props.$onFormChange(t.$formutil,r,n))}},t.createDeepRegisters=function(){return t.$$deepRegisters=t.$$deepParseObject(t.$$registers)},t.$$getRegister=function(e){if(e){var r=t.$$registers[e]||x(t.$$deepRegisters,e);if(r)return r}},t.$$formValidate=function(e){return t.$$formValidatePromise=new Promise(function(r){var n,i,o,a,u=(0,t.props.$validator)(t.$formutil.$params,t.formtutil),s=function(t){return r(O(e,O(o,t)))};V(u)?(t.$$formPending||(t.$$formPending=!0,t.$render()),i=function(e){return n=e(s)},a=u.then(function(){},function(e){return e}).then(function(e){return n||(t.$shouldCancelPrevAsyncValidate=null,t.$$formPending=!1,t.$$setFormErrors(e,s))})):(t.$$formPending&&(t.$$formPending=!1),a=t.$$setFormErrors(u,s)),t.$shouldCancelPrevAsyncValidate&&t.$shouldCancelPrevAsyncValidate(function(e){return o=e,a}),t.$shouldCancelPrevAsyncValidate=i})},t.$$setFormErrors=function(e,r){return e&&(e instanceof Error||"object"!==typeof e)?(v(!1,"The result of $validator in should always return None(null,undefined) or an object contains error message of Field."),t.$render(r)):t.$$setStates(e||{},function(e,t){var r=t.$getState().$error,n=void 0===r?{}:r;return e?{$error:u({},n,a({},H,e))}:n[H]?(delete n[H],{$error:n}):void 0},r,!0)},t.$getField=function(e){var r=t.$$getRegister(e);if(v(!e||r,"$getField('".concat(e,"') fail to find the matched Field. Maybe it has been unmounted.")),v(e,"You should pass a name of the mounted Field to $getField()."),r)return r.$new()},t.$$onChange=function(e,r,n){return t.$setStates(a({},e,r),n)},t.$$setStates=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=t.$$deepParseObject(e),a=!1;return A(t.$$registers,function(n,u){var s=u in e?e[u]:x(o,u);if(!C(s)||i){var l=r(s,n);if(l){var c=t.$formutil.$weakParams[u],$=n.$$merge(l).$value;if(n.$$detectChange(l),"$value"in l||"$viewValue"in l){var f=_(t.$$fieldChangedQueue,function(e){return e.name===u});f?("$prevValue"in f||(f.$prevValue=f.$newValue),f.$newValue=$):t.$$fieldChangedQueue.push({name:u,$newValue:$,$prevValue:c})}a=!0}}}),a?t.$render(n):Promise.resolve(O(n,t.$formutil))},t.$render=function(e){return new Promise(function(r){return t.forceUpdate(function(){return r(O(e,t.$formutil))})})},t.$validates=function(){for(var e,r=arguments.length,n=new Array(r),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return A(e,function(e,r){return x(t,r,e)}),t}},{key:"componentDidMount",value:function(){D(this.props.$ref,this.$formutil)}},{key:"componentDidUpdate",value:function(e){var t=this;D(this.props.$ref,this.$formutil),U(this.$$triggerChangeTimer),this.$$triggerChangeTimer=R(function(){t.$$triggerFormChange()})}},{key:"componentWillUnmount",value:function(){D(this.props.$ref,null)}},{key:"_render",value:function(){var e=this.$formutil,r=this.props,n=r.children,i=r.render,o=r.component;return o?t.createElement(o,{$formutil:e}):w(i)?i(e):w(n)?n(e):t.Children.map(n,function(r){return r&&w(r.type)?t.cloneElement(r,{$formutil:e}):r})}},{key:"render",value:function(){var e=this,t=this.props.$processer,n=Object.keys(this.$$registers).map(function(t){return{path:t,$state:e.$$registers[t].$getState()}}),i=N(n,function(e,r){var n=r.path,i=r.$state;t&&t(i,n),"$value"in i&&(i.$dirty||!C(i.$value))&&(e[n]=i.$value)}),o=N(n,function(e,t){var r=t.path;t.$state;return r in i&&x(e,r,i[r])}),a=n.some(function(e){return e.$state.$invalid}),s=n.some(function(e){return e.$state.$dirty}),l=n.some(function(e){return e.$state.$touched}),c=n.some(function(e){return e.$state.$focused}),$=this.$$formPending||n.some(function(e){return e.$state.$pending}),f=this.$formutil={$$registers:u({},this.$$registers),$$deepRegisters:this.$$deepRegisters,$states:N(n,function(e,t){return x(e,t.path,t.$state)}),$params:u({},this.$$defaultValues,o),$errors:N(n,function(e,t){var r=t.path,n=t.$state;n.$invalid&&x(e,r,n.$error)}),$dirts:N(n,function(e,t){return x(e,t.path,t.$state.$dirty)}),$touches:N(n,function(e,t){return x(e,t.path,t.$state.$touched)}),$focuses:N(n,function(e,t){return x(e,t.path,t.$state.$focused)}),$pendings:N(n,function(e,t){return x(e,t.path,t.$state.$pending)}),$weakStates:N(n,function(e,t){var r=t.path,n=t.$state;return e[r]=n}),$weakParams:i,$weakErrors:N(n,function(e,t){var r=t.path,n=t.$state;n.$invalid&&(e[r]=n.$error)}),$weakDirts:N(n,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$dirty}),$weakTouches:N(n,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$touched}),$weakFocuses:N(n,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$focused}),$weakPendings:N(n,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$pending}),$getFirstError:function(e){if(e){var t=f.$getField(e);return t&&t.$getFirstError()}for(var r in f.$weakErrors){var n=f.$weakErrors[r];for(var i in n)return n[i]instanceof Error?n[i].message:n[i]}},$render:this.$render,$getField:this.$getField,$onValidates:this.$onValidates,$new:function(){return e.$formutil},$setStates:this.$setStates,$setValues:this.$setValues,$setErrors:this.$setErrors,$setTouches:this.$setTouches,$setDirts:this.$setDirts,$setFocuses:this.$setFocuses,$batchState:this.$batchState,$batchTouched:this.$batchTouched,$batchDirty:this.$batchDirty,$batchFocused:this.$batchFocused,$reset:this.$reset,$validates:this.$validates,$validate:this.$validate,$valid:!a,$invalid:a,$dirty:s,$pristine:!s,$touched:l,$untouched:!l,$focused:c,$pending:$};return r.createElement(m.Provider,{value:this.getFormContext()},this._render())}}]),i}();function z(e,t){return e(t={exports:{}},t.exports),t.exports}L.displayName="React.Formutil.Form",L.defaultProps={$defaultValues:{},$defaultStates:{}};var B,Y=z(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"===typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,$=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116;function m(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case c:case $:case o:case u:case a:case d:return e;default:switch(e=e&&e.$$typeof){case l:case f:case s:return e;default:return t}}case h:case p:case i:return t}}}function v(e){return m(e)===$}t.typeOf=m,t.AsyncMode=c,t.ConcurrentMode=$,t.ContextConsumer=l,t.ContextProvider=s,t.Element=n,t.ForwardRef=f,t.Fragment=o,t.Lazy=h,t.Memo=p,t.Portal=i,t.Profiler=u,t.StrictMode=a,t.Suspense=d,t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===o||e===$||e===u||e===a||e===d||"object"===typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===s||e.$$typeof===l||e.$$typeof===f)},t.isAsyncMode=function(e){return v(e)||m(e)===c},t.isConcurrentMode=v,t.isContextConsumer=function(e){return m(e)===l},t.isContextProvider=function(e){return m(e)===s},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return m(e)===f},t.isFragment=function(e){return m(e)===o},t.isLazy=function(e){return m(e)===h},t.isMemo=function(e){return m(e)===p},t.isPortal=function(e){return m(e)===i},t.isProfiler=function(e){return m(e)===u},t.isStrictMode=function(e){return m(e)===a},t.isSuspense=function(e){return m(e)===d}});(B=Y)&&B.__esModule&&Object.prototype.hasOwnProperty.call(B,"default")&&B.default;Y.typeOf,Y.AsyncMode,Y.ConcurrentMode,Y.ContextConsumer,Y.ContextProvider,Y.Element,Y.ForwardRef,Y.Fragment,Y.Lazy,Y.Memo,Y.Portal,Y.Profiler,Y.StrictMode,Y.Suspense,Y.isValidElementType,Y.isAsyncMode,Y.isConcurrentMode,Y.isContextConsumer,Y.isContextProvider,Y.isElement,Y.isForwardRef,Y.isFragment,Y.isLazy,Y.isMemo,Y.isPortal,Y.isProfiler,Y.isStrictMode,Y.isSuspense;var Q=z(function(e){e.exports=Y}),G={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},q={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},K={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},W={};function J(e){return Q.isMemo(e)?K:W[e.$$typeof]||G}W[Q.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var X=Object.defineProperty,Z=Object.getOwnPropertyNames,ee=Object.getOwnPropertySymbols,te=Object.getOwnPropertyDescriptor,re=Object.getPrototypeOf,ne=Object.prototype;var ie=function e(t,r,n){if("string"!==typeof r){if(ne){var i=re(r);i&&i!==ne&&e(t,i,n)}var o=Z(r);ee&&(o=o.concat(ee(r)));for(var a=J(t),u=J(r),s=0;s1&&void 0!==arguments[1]?arguments[1]:{},a=function(a){function c(){return n(this,c),d(this,l(c).apply(this,arguments))}return s(c,t.Component),o(c,[{key:"render",value:function(){var t=Object.assign({},this.props),n=this.props,o=(n.component,$(n,["component"]));return["$defaultStates","$defaultValues","$onFormChange","$validator","$processer","$ref"].forEach(function(e){e in t&&("$defaultStates"!==e&&"$defaultValues"!==e||(o[e]=u({},i[e],t[e])),delete t[e])}),r.createElement(L,Object.assign({},i,o,{render:function(n){return r.createElement(e,Object.assign({},t,{$formutil:n}))}}))}}]),c}();return a.displayName="React.Formutil.withForm."+(e.displayName||e.name||"Anonymous"),ie(a,e)}),ae=0,ue={$valid:!0,$invalid:!1,$dirty:!1,$pristine:!0,$touched:!1,$untouched:!0,$focused:!1,$pending:!1,$error:{}};function se(e){return!0!==e}function le(e,t,r){v(!C(e),"You should return a string or Error when the validation('".concat(r&&r+": ").concat(t,"') failed, otherwise return true."))}function ce(){return ae++}function $e(e,t){var r;function n(t){var r,n=e.props,i=e.$formContext;if(i.$$getDefault){var o=n.name,a=i.$$getDefault(),s=a.$$defaultStates,l=a.$$defaultValues;if(o&&l){var $=x(l,o);r=x(s,o)||{},C($)||(r.$value=$)}}var f=n.$defaultValue,d=n.$defaultState;return c(u({},ue,w(d)?d(n):d,{$value:w(f)?f(n):"$defaultValue"in n?f:""},r,t))}function i(){return u({},e.$state)}function o(t){return r=new Promise(function(r){var n,i,o,c,$=e.props,f=e.$formContext,d=u({},$.$validators,$.$asyncValidators),p=e.$state,h=p.$value,m=p.$pending,v=Object.assign({},p.$error),g=f.$formutil,y={},b=!1;delete v[H];var C=Object.keys(d).reduce(function(t,r){if(delete v[r],!b&&null!=$[r]){var i=d[r](h,$[r],u({},$,{$formutil:g,$fieldutil:e.$fieldutil,$validError:y}));V(i)?t.push(i.catch(function(e){n||s(r,e||r)})):se(i)&&(y[r]=i||r,le(i,r,$.name),$.$validateLazy&&(b=!0))}return t},[]),w=function(e){return r(O(t,O(o,e)))};C.length?(m||l(!0),i=function(e){return n=e(w)},C.push(a(u({},v,y))),c=Promise.all(C).then(function(){return n||(e.$shouldCancelPrevAsyncValidate=null,l(!1,w))})):(m&&l(!1),c=a(u({},v,y),w)),e.$shouldCancelPrevAsyncValidate&&e.$shouldCancelPrevAsyncValidate(function(e){return o=e,c}),e.$shouldCancelPrevAsyncValidate=i})}function a(t,r){return e.$setState({$error:t},r)}function s(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,i=Object.assign({},e.$state.$error);return se(r)?(i[t]=r||t,le(r,t,e.props.name)):delete i[t],a(i,n)}function l(t,r){return e.$setState({$pending:t},r)}function c(t){var r=Object.assign({},t);"$error"in r&&(r.$error||(r.$error={}),r.$valid=0===Object.keys(r.$error).length);var n=e.props,o=n.$parser,a=n.$formatter;if("$viewValue"in r&&!("$value"in r)){r.$value=o?o(r.$viewValue,function(e){return r.$viewValue=e}):r.$viewValue}else if("$value"in r&&!("$viewValue"in r)){r.$viewValue=a?a(r.$value,function(e){return r.$value=e}):r.$value}return"$valid"in r?r.$invalid=!r.$valid:"$invalid"in r&&(r.$dirty=!r.$invalid),"$dirty"in r?r.$pristine=!r.$dirty:"$pristine"in r&&(r.$dirty=!r.$pristine),"$touched"in r?r.$untouched=!r.$touched:"$untouched"in r&&(r.$touched=!r.$untouched),e.$state=u({},e.$state,r),i()}return{$$FIELD_UUID:e.$$FIELD_UUID,$$reset:n,$$merge:c,$$detectChange:function(e){("$value"in e||"$viewValue"in e)&&o()},$$triggerChange:function(t){var r=t.$newValue,n=t.$prevValue,i=e.props.$onFieldChange;w(i)&&i(r,n,e.$formContext.$formutil)},$onValidate:function(e){return r.then(e),r},$new:function(){return e.$fieldutil},$picker:i,$getState:i,$getComponent:function(){return t},$reset:function(t,r){return e.$setState(n(t),r)},$getFirstError:function(){var t=e.$state.$error,r=void 0===t?{}:t;for(var n in r)return r[n]instanceof Error?r[n].message:r[n]},$validate:o,$setState:e.$setState,$render:function(t,r){return e.$setState({$viewValue:t,$dirty:!0},r)},$setValue:function(t,r){return e.$setState({$value:t},r)},$setTouched:function(t,r){return e.$setState({$touched:t},r)},$setDirty:function(t,r){return e.$setState({$dirty:t},r)},$setFocused:function(t,r){return e.$setState({$focused:t},r)},$setValidity:s,$setError:a,$setPending:l}}var fe=function(e){function i(){var e,t;n(this,i);for(var r=arguments.length,o=new Array(r),a=0;a with the name '".concat(e,"' must be used underneath a component or withForm() HOC, otherwise it's isolated.")),v(e,"You should assign a name to , otherwise it will be isolated!"),t.$$register&&t.$$register(e,this.$fieldHandler),this.$prevValue=this.$state.$value,D(this.props.$ref,this.$fieldutil)}},{key:"componentWillUnmount",value:function(){this.$formContext.$$unregister&&this.$formContext.$$unregister(this.props.name,this.$fieldHandler,this.props.$reserveOnUnmount),this.isMounting=!1,D(this.props.$ref,null)}},{key:"componentDidUpdate",value:function(e){var t=this.props.name;t!==e.name&&this.$formContext.$$register&&this.$formContext.$$register(t,this.$fieldHandler,e.name),D(this.props.$ref,this.$fieldutil),this.$state.$value!==this.$prevValue&&(t in(this.$formContext.$$registers||{})||this.$registered.$$triggerChange({$newValue:this.$state.$value,$prevValue:this.$prevValue}),this.$prevValue=this.$state.$value)}},{key:"_render",value:function(){return function(e,r){var n=r.children,i=r.render,o=r.component;return o?t.createElement(o,{$fieldutil:e}):w(i)?i(e):w(n)?n(e):t.Children.map(n,function(r){return r&&w(r.type)?t.cloneElement(r,{$fieldutil:e}):r})}(this.$fieldutil=u({$name:this.props.name},this.$registered.$getState(),this.$registered,{$$formutil:this.$formContext.$formutil}),this.props)}},{key:"render",value:function(){var e=this,t=!this.$formContext;return r.createElement(m.Consumer,null,function(r){return e.$formContext=r,e.$fieldHandler||(e.$fieldHandler=$e(e,e)),e.$registered=(r.$$registers||{})[e.$fieldHandler.$name]||e.$fieldHandler,t&&(e.$fieldHandler.$$reset(),e.$fieldHandler.$validate()),e._render()})}}]),i}();fe.displayName="React.Formutil.Field";var de=E(function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=function(a){function c(){return n(this,c),d(this,l(c).apply(this,arguments))}return s(c,t.Component),o(c,[{key:"render",value:function(){var t=Object.assign({},this.props),n=this.props,o=(n.component,$(n,["component"]));return["$validators","$asyncValidators","$validateLazy","$reserveOnUnmount","$defaultValue","$defaultState","$onFieldChange","$parser","$formatter","$ref","name"].concat(Object.keys(u({},i.$validators,i.$asyncValidators,t.$validators,t.$asyncValidators))).forEach(function(e){e in t&&("$validators"!==e&&"$asyncValidators"!==e&&"$defaultState"!==e||(o[e]=u({},i[e],t[e])),delete t[e])}),r.createElement(fe,Object.assign({},i,o,{render:function(n){return r.createElement(e,Object.assign({},t,{$fieldutil:n}))}}))}}]),c}();return a.displayName="React.Formutil.withField."+(e.displayName||e.name||"Anonymous"),ie(a,e)}),pe=function(e){function i(){return n(this,i),d(this,l(i).apply(this,arguments))}return s(i,t.Component),o(i,[{key:"render",value:function(){var e=this,t=this.props,n=(t.$fieldutil,t.value),i=t.onChange,o=t.onFocus,a=t.onBlur,u=t.checked,s=t.unchecked,l=$(t,["$fieldutil","value","onChange","onFocus","onBlur","checked","unchecked"]),c=this.props.type,f={value:"compositionValue"in this?this.compositionValue:n,onCompositionEnd:function(t){e.composition=!1,delete e.compositionValue,f.onChange(t)},onCompositionStart:function(){return e.composition=!0},onChange:function(t){var r=t.target.value;e.composition?(e.compositionValue=r,e.forceUpdate()):i(r,t)},onFocus:o,onBlur:a},d="input";switch(c){case"select":d=c,f.onChange=function(e){var t=e.target,r=t.multiple?[].slice.call(t.options).filter(function(e){return e.selected}).map(function(e){return e.value}):t.value;i(r,e)},delete l.type;break;case"textarea":d=c,delete l.type;break;case"checkbox":case"radio":f={checked:n===u,onChange:function(e){i(e.target.checked?u:s,e)},onFocus:o,onBlur:a}}return r.createElement(d,Object.assign({},l,f))}}]),i}();pe.displayName="React.Formutil.EasyField.Native",pe.defaultProps={value:"",type:"text",checked:!0,unchecked:!1};var he=t.createContext({}),me=he.Provider,ve=he.Consumer,ge=function(e){function i(){return n(this,i),d(this,l(i).apply(this,arguments))}return s(i,t.Component),o(i,[{key:"getGroupContext",value:function(){return this.props}},{key:"_render",value:function(){var e=this.props,n=e.className,i=e.groupNode,o=e.children,a={GroupOption:ye,Field:be},u=w(o)?o(a):t.Children.map(o,function(e){return t.cloneElement(e,a)});return null===i?u:r.createElement(i,{className:n},u)}},{key:"render",value:function(){return r.createElement(me,{value:this.getGroupContext()},this._render())}}]),i}();ge.displayName="React.Formutil.EasyField.Group",ge.defaultProps={type:"checkbox",groupNode:"div"};var ye=function(e){function i(){return n(this,i),d(this,l(i).apply(this,arguments))}return s(i,t.Component),o(i,[{key:"componentDidMount",value:function(){v("$value"in this.props,"You should pass a $value to .")}},{key:"render",value:function(){var e=this.props,t=e.$value,n=e.onChange,i=e.onFocus,o=e.onBlur,a=$(e,["$value","onChange","onFocus","onBlur"]);return r.createElement(ve,null,function(e){var u=e.type,s=e.name,l="radio"===u?{checked:e.value===t,onChange:function(r){e.onChange(t,r),n&&n(r)}}:"checkbox"===u?{checked:e.value.indexOf(t)>-1,onChange:function(r){e.onChange(r.target.checked?e.value.concat(t):e.value.filter(function(e){return e!==t}),r),n&&n(r)}}:{value:e.value,onChange:function(t){e.onChange(t),n&&n(t)}};return r.createElement("input",Object.assign({name:s},a,l,{type:u,onFocus:function(t){e.onFocus(t),i&&i(t)},onBlur:function(t){e.onBlur(t),o&&o(t)}}))})}}]),i}();ye.displayName="React.Formutil.EasyField.Group.Option";var be=function(e){function i(){return n(this,i),d(this,l(i).apply(this,arguments))}return s(i,t.Component),o(i,[{key:"componentDidMount",value:function(){v(!1,'The "Field" property in EasyField\'s children-props has been deprecated. Please use "GroupOption" instead.')}},{key:"render",value:function(){return r.createElement(ye,this.props)}}]),i}();be.displayName="React.Formutil.EasyField.Group.Option.Deprecated";var Ce=Array.isArray,we=Object.keys,Fe=Object.prototype.hasOwnProperty,Ve="undefined"!==typeof Element;var Pe=function(e,t){try{return function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){var n,i,o,a=Ce(t),u=Ce(r);if(a&&u){if((i=t.length)!=r.length)return!1;for(n=i;0!==n--;)if(!e(t[n],r[n]))return!1;return!0}if(a!=u)return!1;var s=t instanceof Date,l=r instanceof Date;if(s!=l)return!1;if(s&&l)return t.getTime()==r.getTime();var c=t instanceof RegExp,$=r instanceof RegExp;if(c!=$)return!1;if(c&&$)return t.toString()==r.toString();var f=we(t);if((i=f.length)!==we(r).length)return!1;for(n=i;0!==n--;)if(!Fe.call(r,f[n]))return!1;if(Ve&&t instanceof Element&&r instanceof Element)return t===r;for(n=i;0!==n--;)if(("_owner"!==(o=f[n])||!t.$$typeof)&&!e(t[o],r[o]))return!1;return!0}return t!==t&&r!==r}(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}},Se=r.Frament||"div",Oe=function(e){function i(e){var t;return n(this,i),(t=d(this,l(i).call(this,e))).id=0,t.latestValue=t.props.value,t.$formutil=void 0,t.FieldValidators={required:function(e){return null!==e}},t.$onFormChange=function(e){e.$onValidates(function(e){var r=e.$invalid,n=e.$params;r?t.props.value.length&&t.props.onChange(t.latestValue=[]):Pe(t.props.value,n.list)||t.props.onChange(t.latestValue=n.list)})},t.swap=function(e,r,n){return t.$setState(function(t){var n=t.items,i=[n[e],n[r]];return n[r]=i[0],n[e]=i[1],n},n)},t.insert=function(){for(var e,r,n,i=arguments.length,o=new Array(i),a=0;a=t}],["max",function(e,t){return F(e)||1*e<=t}],["min",function(e,t){return F(e)||1*e>=t}],["pattern",function(e,t){return F(e)||t.test(e)}],["enum",function(e,t){return F(e)||t.indexOf(e)>-1}],["checker",function(e,t,r){return t(e,r)}]].reduce(function(e,t){var r=p(t,2),n=r[0],i=r[1];return e[n]=function(e,t,r){var o=r.validMessage,a=void 0===o?{}:o;return i.apply(void 0,arguments)||a[n]||"Error input: ".concat(n)},e},{}),je={validMessage:{},valuePropName:"value",changePropName:"onChange",focusPropName:"onFocus",blurPropName:"onBlur",$parser:function(e){return"string"===typeof e?e.trim():e}};function xe(e,t,r){var n,i=t.valuePropName,o=t.changePropName,s=t.focusPropName,l=t.blurPropName,c=t.passUtil,$=u({},r,(a(n={},i,e.$viewValue),a(n,o,function(){for(var r=arguments.length,n=new Array(r),a=0;a-1}(e)||delete l[e])}),f){var d=p((a||"").split("."),2),h=d[0],m=void 0===h?"text":h,v=d[1];switch(c.component="group"===m?ge:"list"===m?Oe:pe,o&&(l.name=o),a&&(l.type=m),t&&(l.children=t),m){case"select":case"textarea":e.multiple&&(i[Ee]="array");break;case"group":"checkbox"===v&&(i[Ee]="array"),l.type=v;break;case"checkbox":case"radio":i[Ee]="checked";break;case"list":i[Ee]="array"}}if(!("$defaultValue"in i)&&"defaultValue"in e&&(i.$defaultValue=s),!("$defaultValue"in i)&&Ee in i){var g;switch(i[Ee]){case"checked":var y=i.unchecked;g=void 0!==y&&y;break;case"array":g=[];break;case"object":g={};break;case"number":g=0}i.$defaultValue=g}return{fieldProps:i,childProps:l,renderProps:c}}var _e=function(e){function i(){return n(this,i),d(this,l(i).apply(this,arguments))}return s(i,t.Component),o(i,[{key:"render",value:function(){var e=De(this.props),n=e.fieldProps,i=e.childProps,o=e.renderProps;return r.createElement(fe,Object.assign({},n,{children:function(e){return function(e,r){var n=r.component,i=r.render,o=r.children;return n?t.createElement(n,e):w(i)?i(e):w(o)?o(e):t.Children.map(o,function(r){return t.cloneElement(r,e)})}(xe(e,n,i),o)}}))}}]),i}();function Te(){if(!r.useState)throw new Error("Hooks api need react@>=16.8, Please upgrade your reactjs.");return(0,r.useContext)(m)}function Ae(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!r.useState)throw new Error("Hooks api need react@>=16.8, Please upgrade your reactjs.");var n,i=r.useState,o=r.useLayoutEffect,a=r.useRef;e&&("string"===typeof e?(n=e,t.name=n):n=(t=e).name);var s,l=Te(),c=a({}).current,$=a([]);c.$formContext=l,c.props=t,c.$setState=function(e,t){return new Promise(function(r){var i=function(){return r(O(t,c.$fieldutil))};c.isMounting?n in(l.$$registers||{})?l.$$onChange(n,e,i):(f(s.$$merge(e)),s.$$detectChange(e),$.current.push(i)):(s.$$merge(e),i())})};var f=p(i(function(){c.$$FIELD_UUID=ce(),c.$fieldHandler=s=$e(c);var e=c.$fieldHandler.$$reset();return c.$fieldHandler.$validate(),e}),2)[1];return s||(s=(l.$$registers||{})[c.$fieldHandler.$name]||c.$fieldHandler),o(function(){var e=c.$state;if(c.isMounting&&!(n in(l.$$registers||{}))){var t=c.$prevValue;s.$$triggerChange({$newValue:e.$value,$prevValue:t})}c.$prevValue=e.$value},[c.$state.$value]),o(function(){return c.isMounting=!0,v(!n||l.$formutil,"You should enusre that the useField() with the name '".concat(n,"' must be used underneath a component or withForm() HOC, otherwise it's isolated.")),v(n,"You should pass a name argument to useField(), otherwise it will be isolated!"),function(){c.isMounting=!1,D(t.$ref,null)}},[]),o(function(){return l.$$register&&l.$$register(n,c.$fieldHandler),function(){l.$$unregister&&l.$$unregister(n,c.$fieldHandler,!c.isMounting&&t.$reserveOnUnmount)}},[n]),o(function(){D(t.$ref,c.$fieldutil)}),o(function(){if($.current.length>0){var e=h($.current);for($.current.length=0;e.length;)e.pop()(c.$fieldutil)}}),c.$fieldutil=u({$name:n},s.$getState(),s,{$$formutil:l.$formutil})}_e.displayName="React.Formutil.EasyField",_e.defaultProps=je,e.EasyField=_e,e.Field=fe,e.Form=L,e.connect=function(e){var i=function(i){function a(){return n(this,a),d(this,l(a).apply(this,arguments))}return s(a,t.Component),o(a,[{key:"render",value:function(){var t=this;return r.createElement(m.Consumer,null,function(n){return r.createElement(e,Object.assign({},t.props,{$formutil:n.$formutil}))})}}]),a}();return i.displayName="React.Formutil.connect."+(e.displayName||e.name||"Anonymous"),ie(i,e)},e.useField=Ae,e.useForm=function(){return Te().$formutil},e.useHandler=function(e){var t=De(e=u({},je,e,{children:null})),r=t.fieldProps,n=t.childProps;return xe(Ae(r),r,n)},e.withField=de,e.withForm=oe,Object.defineProperty(e,"__esModule",{value:!0})}); diff --git a/package.json b/package.json index 9fc813d..e679fc1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-formutil", - "version": "0.5.11", + "version": "0.6.0", "description": "Happy to build the forms in React ^_^", "main": "dist/index.cjs.js", "module": "dist/index.esm.js", @@ -35,7 +35,7 @@ }, "homepage": "https://github.com/qiqiboy/react-formutil#readme", "peerDependencies": { - "react": ">15.0.0", + "react": ">16.0.0", "prop-types": ">15.0.0" }, "types": "./index.d.ts", @@ -57,8 +57,7 @@ "rollup-plugin-terser": "^4.0.4" }, "dependencies": { - "create-react-context": "^0.2.3", - "hoist-non-react-statics": "^3.2.1", + "hoist-non-react-statics": "^3.3.0", "react-fast-compare": "^2.0.4", "warning": "^4.0.2" } diff --git a/src/EasyField/Group.js b/src/EasyField/Group.js index b2475c4..962653a 100644 --- a/src/EasyField/Group.js +++ b/src/EasyField/Group.js @@ -1,6 +1,5 @@ -import React, { Component, Children, cloneElement } from 'react'; +import React, { Component, Children, cloneElement, createContext } from 'react'; import PropTypes from 'prop-types'; -import createContext from 'create-react-context'; import { isFunction } from '../utils'; import warning from 'warning'; diff --git a/src/context.js b/src/context.js index 77a65ce..7c0127f 100644 --- a/src/context.js +++ b/src/context.js @@ -1,3 +1,3 @@ -import createContext from 'create-react-context'; +import { createContext } from 'react'; export default createContext({});