diff --git a/dist/react-formutil.cjs.development.js b/dist/react-formutil.cjs.development.js index 86f68dc..a59fca8 100644 --- a/dist/react-formutil.cjs.development.js +++ b/dist/react-formutil.cjs.development.js @@ -388,6 +388,27 @@ function parsePath() { return target; } } +function pathExist(scope, path) { + var pathWords = path.split(PATH_REGEXP).map(function (s) { + return s.trim(); + }).filter(function (item) { + return item !== ''; + }); + + for (var index = 0, len = pathWords.length; index < len; index++) { + var word = executeWord(pathWords[index]); + + if (word in scope) { + if (index + 1 === len) { + return { + data: scope[word] + }; + } + + scope = scope[word]; + } + } +} function createRef(ref, value) { if (ref) { if (isFunction(ref)) { @@ -738,10 +759,10 @@ function (_Component) { var $parsedTree = _this.$$deepParseObject($stateTree); objectEach(_this.$$registers, function (handler, name) { - var data = name in $stateTree ? $stateTree[name] : parsePath($parsedTree, name); + var pathData; - if (!isUndefined(data) || force) { - var $newState = processer(data, handler); + if (force || (pathData = pathExist($parsedTree, name))) { + var $newState = processer(pathData && pathData.data, handler); if ($newState) { var $prevValue = _this.$formutil.$weakParams[name]; diff --git a/dist/react-formutil.cjs.development.js.map b/dist/react-formutil.cjs.development.js.map index 4fe18a0..9a6b2e0 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 'react';\n\nexport default createContext({});\n","import { isValidElementType } from 'react-is';\nimport 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\nexport function isComponent(obj) {\n return isValidElementType(obj) && typeof obj !== 'string';\n}\n\nexport function checkComponentPropType(props, propName, componentName) {\n if (props[propName] && !isComponent(props[propName])) {\n return new Error(\n `Invalid prop 'component' supplied to '${componentName}': the prop is not a valid React component`\n );\n }\n}\n\n// quick clone deeply\nexport function deepClone(obj) {\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 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 (isComponent(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;\nexport function CLEAR(obj, pkey, pobj) {\n objectEach(obj, (value, key) => {\n if (value === TODO_DELETE) {\n delete obj[key];\n } else if (isPlainObj(value) || Array.isArray(value)) {\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: utils.checkComponentPropType,\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\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 }\n });\n\n return this.$render(callback);\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 utils.CLEAR(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.isComponent(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, { forwardRef } from 'react';\nimport Form from './Form';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withForm(WrappedComponent, config = {}) {\n const FormEnhanced = forwardRef((props, ref) => {\n const { ...others } = props;\n const { component, ...formProps } = 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 FormEnhanced.displayName =\n 'React.Formutil.withForm.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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: utils.checkComponentPropType,\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.isComponent(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, { forwardRef } from 'react';\nimport Field from './Field';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withField(WrappedComponent, config = {}) {\n const FieldEnhanced = forwardRef((props, ref) => {\n const { ...others } = props;\n const { component, ...fieldProps } = 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 FieldEnhanced.displayName =\n 'React.Formutil.withField.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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, checkComponentPropType } 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: checkComponentPropType,\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 checked,\n unchecked,\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, { forwardRef } from 'react';\nimport FormContext from './context';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction connect(WrappedComponent) {\n const Connect = forwardRef((props, ref) => {\n return (\n \n {context => }\n \n );\n });\n\n Connect.displayName =\n 'React.Formutil.connect.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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","isComponent","isValidElementType","checkComponentPropType","props","propName","componentName","Error","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","$$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","$$setStates","$error","$getField","$new","$$onChange","$state","$setStates","$stateTree","processer","force","$parsedTree","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","forwardRef","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","$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;;ACCA,IAAMC,YAAY,GAAGC,MAAM,CAACC,cAAP,CAAsB,EAAtB,CAArB;AACA,IAAMC,WAAW,GAAG,qCAApB;AACA,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HtB;MAGf8S,UAHe,eAGfA,UAHe;MAGH6F,UAHG,eAGHA,UAHG;;MAIjB/K,UAAU,GAAGiM,QAAQ,CAAC/G,UAAD,CAA3B;SAEOpC,eAAa,CAAC9C,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 { isValidElementType } from 'react-is';\nimport 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\nexport function isComponent(obj) {\n return isValidElementType(obj) && typeof obj !== 'string';\n}\n\nexport function checkComponentPropType(props, propName, componentName) {\n if (props[propName] && !isComponent(props[propName])) {\n return new Error(\n `Invalid prop 'component' supplied to '${componentName}': the prop is not a valid React component`\n );\n }\n}\n\n// quick clone deeply\nexport function deepClone(obj) {\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 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 (isComponent(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 pathExist(scope, path) {\n const pathWords = path\n .split(PATH_REGEXP)\n .map(s => s.trim())\n .filter(item => item !== '');\n\n for (let index = 0, len = pathWords.length; index < len; index++) {\n const word = executeWord(pathWords[index]);\n\n if (word in scope) {\n if (index + 1 === len) {\n return {\n data: scope[word]\n };\n }\n\n scope = scope[word];\n }\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;\nexport function CLEAR(obj, pkey, pobj) {\n objectEach(obj, (value, key) => {\n if (value === TODO_DELETE) {\n delete obj[key];\n } else if (isPlainObj(value) || Array.isArray(value)) {\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: utils.checkComponentPropType,\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\n utils.objectEach(this.$$registers, (handler, name) => {\n let pathData;\n\n if (force || (pathData = utils.pathExist($parsedTree, name))) {\n const $newState = processer(pathData && pathData.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 }\n });\n\n return this.$render(callback);\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 utils.CLEAR(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.isComponent(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, { forwardRef } from 'react';\nimport Form from './Form';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withForm(WrappedComponent, config = {}) {\n const FormEnhanced = forwardRef((props, ref) => {\n const { ...others } = props;\n const { component, ...formProps } = 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 FormEnhanced.displayName =\n 'React.Formutil.withForm.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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: utils.checkComponentPropType,\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.isComponent(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, { forwardRef } from 'react';\nimport Field from './Field';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withField(WrappedComponent, config = {}) {\n const FieldEnhanced = forwardRef((props, ref) => {\n const { ...others } = props;\n const { component, ...fieldProps } = 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 FieldEnhanced.displayName =\n 'React.Formutil.withField.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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, checkComponentPropType } 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: checkComponentPropType,\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 checked,\n unchecked,\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, { forwardRef } from 'react';\nimport FormContext from './context';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction connect(WrappedComponent) {\n const Connect = forwardRef((props, ref) => {\n return (\n \n {context => }\n \n );\n });\n\n Connect.displayName =\n 'React.Formutil.connect.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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","isComponent","isValidElementType","checkComponentPropType","props","propName","componentName","Error","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","pathExist","data","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","$$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","$$setStates","$error","$getField","$new","$$onChange","$state","$setStates","$stateTree","processer","force","$parsedTree","pathData","$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","forwardRef","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","$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;;ACCA,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,KAAK,IAA5B,IAAoCA,GAAG,GAAG,EAAN,KAAa,EAAxD;;A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B;wBACOT,cAAc,EADrB;MACP7R,SADO,mBACPA,SADO;;SAGRA,SAAP;;;ACFJ,SAASuS,UAAT,CAAoBra,KAApB,EAA2B;EACvBA,KAAK,qBAAQmP,YAAR,EAAyBnP,KAAzB;IAAgCoM,QAAQ,EAAE;IAA/C;;oBAEmC6M,UAAU,CAACjZ,KAAD,CAHtB;MAGfgT,UAHe,eAGfA,UAHe;MAGH6F,UAHG,eAGHA,UAHG;;MAIjB/K,UAAU,GAAGiM,QAAQ,CAAC/G,UAAD,CAA3B;SAEOpC,eAAa,CAAC9C,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 e9090c7..650cb6c 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=require("react-is");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 q=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 B(){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 Y(e,t){if(e){if(D(e)){e(t)}else if("current"in e){e.current=t}}}var Q=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 W=undefined;function J(e,t,r){z(e,function(t,r){if(t===W){delete e[r]}else if(T(t)||Array.isArray(t)){J(t,r,e)}});if(r&&Object.keys(e).every(function(t){return e[t]===W})){r[t]=W;J(r)}}var X=function e(t,r){if(!x(B(t,r))){B(t,r,W);J(t)}};var Z="FORM_VALIDATE_RESULT";var ee,te;if(typeof requestAnimationFrame==="function"){ee=requestAnimationFrame;te=cancelAnimationFrame}else{ee=setTimeout;te=clearTimeout}var re=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;z(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){te(t.$$duplicateTimer);t.$$regDuplications[e]=[i,r];t.$$duplicateTimer=ee(t.$$checkDuplication)}else{t.$$fieldChangedQueue.push({name:e,$newValue:r.$getState().$value});X(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});X(t.$$defaultValues,e)}}t.createDeepRegisters();t.$render()}};t.$$defaultInitialize=function(){var e=t.props,r=e.$defaultValues,n=e.$defaultStates;t.$$defaultValues=t.$$deepParseObject(U(D(r)?r(t.props)||{}:r));t.$$defaultStates=t.$$deepParseObject(U(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&&B(r,e.name,e.$newValue);"$prevValue"in e&&B(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]||B(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(I(e,I(u,n)))};if(A(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,$({},Z,e))}}if(i[Z]){delete i[Z];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);z(t.$$registers,function(n,u){var o=u in e?e[u]:B(a,u);if(!x(o)||i){var s=r(o,n);if(s){var l=t.$formutil.$weakParams[u];var $=n.$$merge(s),f=$.$value;n.$$detectChange(s);if("$value"in s||"$viewValue"in s){var c=Q(t.$$fieldChangedQueue,function(e){return e.name===u});if(c){if(!("$prevValue"in c)){c.$prevValue=c.$newValue}c.$newValue=f}else{t.$$fieldChangedQueue.push({name:u,$newValue:f,$prevValue:l})}}}}});return t.$render(n)};t.$render=function(e){return new Promise(function(r){return t.forceUpdate(function(){return r(I(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]:{};z(t,function(e,t){return B(r,t,e)});return r}},{key:"componentDidMount",value:function e(){Y(this.props.$ref,this.$formutil)}},{key:"componentDidUpdate",value:function e(t){var r=this;Y(this.props.$ref,this.$formutil);te(this.$$triggerChangeTimer);this.$$triggerChangeTimer=ee(function(){r.$$triggerFormChange()})}},{key:"componentWillUnmount",value:function e(){Y(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&&R(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=K(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=K(i,function(e,t){var r=t.path,n=t.$state;return r in a&&B(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:K(i,function(e,t){var r=t.path,n=t.$state;return B(e,r,n)}),$params:f({},this.$$defaultValues,u),$errors:K(i,function(e,t){var r=t.path,n=t.$state;if(n.$invalid){B(e,r,n.$error)}}),$dirts:K(i,function(e,t){var r=t.path,n=t.$state;return B(e,r,n.$dirty)}),$touches:K(i,function(e,t){var r=t.path,n=t.$state;return B(e,r,n.$touched)}),$focuses:K(i,function(e,t){var r=t.path,n=t.$state;return B(e,r,n.$focused)}),$pendings:K(i,function(e,t){var r=t.path,n=t.$state;return B(e,r,n.$pending)}),$weakStates:K(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n}),$weakParams:a,$weakErrors:K(i,function(e,t){var r=t.path,n=t.$state;if(n.$invalid){e[r]=n.$error}}),$weakDirts:K(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$dirty}),$weakTouches:K(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$touched}),$weakFocuses:K(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$focused}),$weakPendings:K(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);re.displayName="React.Formutil.Form";re.defaultProps={$defaultValues:{},$defaultStates:{}};function ne(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=t.forwardRef(function(t,i){var a=Object.assign({},t);var u=t.component,o=h(t,["component"]);["$defaultStates","$defaultValues","$onFormChange","$validator","$processer","$ref"].forEach(function(e){if(e in a){if(e==="$defaultStates"||e==="$defaultValues"){o[e]=f({},n[e],a[e])}delete a[e]}});return r.createElement(re,Object.assign({},n,o,{render:function t(n){return r.createElement(e,Object.assign({},a,{$formutil:n,ref:i}))}}))});i.displayName="React.Formutil.withForm."+(e.displayName||e.name||"Anonymous");return a(i,e)}var ie=H(ne);var ae=0;var ue={$valid:true,$invalid:false,$dirty:false,$pristine:true,$touched:false,$untouched:true,$focused:false,$pending:false,$error:{}};function oe(e){return e!==true}function se(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 le="React.Formutil.Field";function $e(){return ae++}function fe(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&&R(r.type)?t.cloneElement(r,{$fieldutil:e}):r})}function ce(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=B(s,a);r=B(o,a)||{};if(!x(l)){r.$value=l}}}var $=n.$defaultValue,c=n.$defaultState;return b(f({},ue,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[Z];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(A(i)){t.push(i["catch"](function(e){if(!v){m(r,e||r)}}))}else if(oe(i)){c[r]=i||r;se(i,r,n.name);if(n.$validateLazy){d=true}}}return t},[]);var w=function e(n){return r(I(t,I(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(oe(r)){i[t]=r||t;se(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 de=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;Y(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;Y(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)}}Y(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 fe(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=ce(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);de.displayName=le;function ve(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=t.forwardRef(function(t,i){var a=Object.assign({},t);var u=t.component,o=h(t,["component"]);["$validators","$asyncValidators","$validateLazy","$reserveOnUnmount","$defaultValue","$defaultState","$onFieldChange","$parser","$formatter","$ref","name"].concat(Object.keys(f({},n.$validators,n.$asyncValidators,a.$validators,a.$asyncValidators))).forEach(function(e){if(e in a){if(e==="$validators"||e==="$asyncValidators"||e==="$defaultState"){o[e]=f({},n[e],a[e])}delete a[e]}});return r.createElement(de,Object.assign({},n,o,{render:function t(n){return r.createElement(e,Object.assign({},a,{$fieldutil:n,ref:i}))}}))});i.displayName="React.Formutil.withField."+(e.displayName||e.name||"Anonymous");return a(i,e)}var pe=H(ve);var he=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);he.displayName="React.Formutil.EasyField.Native";he.defaultProps={value:"",type:"text",checked:true,unchecked:false};var me=t.createContext({}),ge=me.Provider,ye=me.Consumer;var be=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:Ve,Field:we};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(ge,{value:this.getGroupContext()},this._render())}}]);return n}(t.Component);be.displayName="React.Formutil.EasyField.Group";be.defaultProps={type:"checkbox",groupNode:"div"};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("$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(ye,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);Ve.displayName="React.Formutil.EasyField.Group.Option";var we=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(Ve,this.props)}}]);return t}(t.Component);we.displayName="React.Formutil.EasyField.Group.Option.Deprecated";var Ce=r.Frament||"div";var Fe=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 Ee="React.Formutil.EasyField";var Oe={validMessage:{},valuePropName:"value",changePropName:"onChange",focusPropName:"onFocus",blurPropName:"onBlur",$parser:function e(t){return typeof t==="string"?t.trim():t}};function Se(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=Ae();var l=u({}).current;var $=u([]);var c;l.$formContext=s;l.props=t;l.$setState=h;var d=n(function(){l.$$FIELD_UUID=$e();l.$fieldHandler=c=ce(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;Y(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(){Y(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(I(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 Te(){var e=Ae(),t=e.$formutil;return t}function Re(e){e=f({},Oe,e,{children:null});var t=je(e),r=t.fieldProps,n=t.childProps;var i=Ne(r);return Se(i,r,n)}exports.EasyField=De;exports.Field=de;exports.Form=re;exports.connect=_e;exports.useField=Ne;exports.useForm=Te;exports.useHandler=Re;exports.withField=pe;exports.withForm=ie; +"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=require("react-is");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 q=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 B(){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 Y(e,t){var r=t.split(S).map(function(e){return e.trim()}).filter(function(e){return e!==""});for(var n=0,i=r.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(t)||Array.isArray(t)){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(!x(B(t,r))){B(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(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;K(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){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=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});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(U(D(r)?r(t.props)||{}:r));t.$$defaultStates=t.$$deepParseObject(U(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&&B(r,e.name,e.$newValue);"$prevValue"in e&&B(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]||B(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(I(e,I(u,n)))};if(A(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,$({},ee,e))}}if(i[ee]){delete i[ee];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);K(t.$$registers,function(e,n){var u;if(i||(u=Y(a,n))){var o=r(u&&u.data,e);if(o){var s=t.$formutil.$weakParams[n];var l=e.$$merge(o),$=l.$value;e.$$detectChange(o);if("$value"in o||"$viewValue"in o){var f=G(t.$$fieldChangedQueue,function(e){return e.name===n});if(f){if(!("$prevValue"in f)){f.$prevValue=f.$newValue}f.$newValue=$}else{t.$$fieldChangedQueue.push({name:n,$newValue:$,$prevValue:s})}}}}});return t.$render(n)};t.$render=function(e){return new Promise(function(r){return t.forceUpdate(function(){return r(I(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 B(r,t,e)});return r}},{key:"componentDidMount",value:function e(){Q(this.props.$ref,this.$formutil)}},{key:"componentDidUpdate",value:function e(t){var r=this;Q(this.props.$ref,this.$formutil);re(this.$$triggerChangeTimer);this.$$triggerChangeTimer=te(function(){r.$$triggerFormChange()})}},{key:"componentWillUnmount",value:function e(){Q(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&&R(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=W(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=W(i,function(e,t){var r=t.path,n=t.$state;return r in a&&B(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:W(i,function(e,t){var r=t.path,n=t.$state;return B(e,r,n)}),$params:f({},this.$$defaultValues,u),$errors:W(i,function(e,t){var r=t.path,n=t.$state;if(n.$invalid){B(e,r,n.$error)}}),$dirts:W(i,function(e,t){var r=t.path,n=t.$state;return B(e,r,n.$dirty)}),$touches:W(i,function(e,t){var r=t.path,n=t.$state;return B(e,r,n.$touched)}),$focuses:W(i,function(e,t){var r=t.path,n=t.$state;return B(e,r,n.$focused)}),$pendings:W(i,function(e,t){var r=t.path,n=t.$state;return B(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=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);ne.displayName="React.Formutil.Form";ne.defaultProps={$defaultValues:{},$defaultStates:{}};function ie(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=t.forwardRef(function(t,i){var a=Object.assign({},t);var u=t.component,o=h(t,["component"]);["$defaultStates","$defaultValues","$onFormChange","$validator","$processer","$ref"].forEach(function(e){if(e in a){if(e==="$defaultStates"||e==="$defaultValues"){o[e]=f({},n[e],a[e])}delete a[e]}});return r.createElement(ne,Object.assign({},n,o,{render:function t(n){return r.createElement(e,Object.assign({},a,{$formutil:n,ref:i}))}}))});i.displayName="React.Formutil.withForm."+(e.displayName||e.name||"Anonymous");return a(i,e)}var ae=H(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){i(!x(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,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&&R(r.type)?t.cloneElement(r,{$fieldutil:e}):r})}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: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=B(s,a);r=B(o,a)||{};if(!x(l)){r.$value=l}}}var $=n.$defaultValue,c=n.$defaultState;return b(f({},oe,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[ee];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(A(i)){t.push(i["catch"](function(e){if(!v){m(r,e||r)}}))}else if(se(i)){c[r]=i||r;le(i,r,n.name);if(n.$validateLazy){d=true}}}return t},[]);var w=function e(n){return r(I(t,I(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(se(r)){i[t]=r||t;le(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 ve=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;Q(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;Q(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)}}Q(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 ce(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=de(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);ve.displayName=$e;function pe(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=t.forwardRef(function(t,i){var a=Object.assign({},t);var u=t.component,o=h(t,["component"]);["$validators","$asyncValidators","$validateLazy","$reserveOnUnmount","$defaultValue","$defaultState","$onFieldChange","$parser","$formatter","$ref","name"].concat(Object.keys(f({},n.$validators,n.$asyncValidators,a.$validators,a.$asyncValidators))).forEach(function(e){if(e in a){if(e==="$validators"||e==="$asyncValidators"||e==="$defaultState"){o[e]=f({},n[e],a[e])}delete a[e]}});return r.createElement(ve,Object.assign({},n,o,{render:function t(n){return r.createElement(e,Object.assign({},a,{$fieldutil:n,ref:i}))}}))});i.displayName="React.Formutil.withField."+(e.displayName||e.name||"Anonymous");return a(i,e)}var he=H(pe);var me=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);me.displayName="React.Formutil.EasyField.Native";me.defaultProps={value:"",type:"text",checked:true,unchecked:false};var ge=t.createContext({}),ye=ge.Provider,be=ge.Consumer;var Ve=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:we,Field:Ce};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(ye,{value:this.getGroupContext()},this._render())}}]);return n}(t.Component);Ve.displayName="React.Formutil.EasyField.Group";Ve.defaultProps={type:"checkbox",groupNode:"div"};var we=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(be,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);we.displayName="React.Formutil.EasyField.Group.Option";var Ce=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(we,this.props)}}]);return t}(t.Component);Ce.displayName="React.Formutil.EasyField.Group.Option.Deprecated";var Fe=r.Frament||"div";var ke=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 Oe="React.Formutil.EasyField";var Se={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 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 Te(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=Ne();var l=u({}).current;var $=u([]);var c;l.$formContext=s;l.props=t;l.$setState=h;var d=n(function(){l.$$FIELD_UUID=fe();l.$fieldHandler=c=de(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;Q(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(){Q(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(I(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 Re(){var e=Ne(),t=e.$formutil;return t}function Ue(e){e=f({},Se,e,{children:null});var t=xe(e),r=t.fieldProps,n=t.childProps;var i=Te(r);return je(i,r,n)}exports.EasyField=_e;exports.Field=ve;exports.Form=ne;exports.connect=Ae;exports.useField=Te;exports.useForm=Re;exports.useHandler=Ue;exports.withField=he;exports.withForm=ae; diff --git a/dist/react-formutil.esm.development.js b/dist/react-formutil.esm.development.js index 9f48a91..dde809d 100644 --- a/dist/react-formutil.esm.development.js +++ b/dist/react-formutil.esm.development.js @@ -381,6 +381,27 @@ function parsePath() { return target; } } +function pathExist(scope, path) { + var pathWords = path.split(PATH_REGEXP).map(function (s) { + return s.trim(); + }).filter(function (item) { + return item !== ''; + }); + + for (var index = 0, len = pathWords.length; index < len; index++) { + var word = executeWord(pathWords[index]); + + if (word in scope) { + if (index + 1 === len) { + return { + data: scope[word] + }; + } + + scope = scope[word]; + } + } +} function createRef(ref, value) { if (ref) { if (isFunction(ref)) { @@ -731,10 +752,10 @@ function (_Component) { var $parsedTree = _this.$$deepParseObject($stateTree); objectEach(_this.$$registers, function (handler, name) { - var data = name in $stateTree ? $stateTree[name] : parsePath($parsedTree, name); + var pathData; - if (!isUndefined(data) || force) { - var $newState = processer(data, handler); + if (force || (pathData = pathExist($parsedTree, name))) { + var $newState = processer(pathData && pathData.data, handler); if ($newState) { var $prevValue = _this.$formutil.$weakParams[name]; diff --git a/dist/react-formutil.esm.development.js.map b/dist/react-formutil.esm.development.js.map index 0ab9b09..35dd35d 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 'react';\n\nexport default createContext({});\n","import { isValidElementType } from 'react-is';\nimport 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\nexport function isComponent(obj) {\n return isValidElementType(obj) && typeof obj !== 'string';\n}\n\nexport function checkComponentPropType(props, propName, componentName) {\n if (props[propName] && !isComponent(props[propName])) {\n return new Error(\n `Invalid prop 'component' supplied to '${componentName}': the prop is not a valid React component`\n );\n }\n}\n\n// quick clone deeply\nexport function deepClone(obj) {\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 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 (isComponent(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;\nexport function CLEAR(obj, pkey, pobj) {\n objectEach(obj, (value, key) => {\n if (value === TODO_DELETE) {\n delete obj[key];\n } else if (isPlainObj(value) || Array.isArray(value)) {\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: utils.checkComponentPropType,\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\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 }\n });\n\n return this.$render(callback);\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 utils.CLEAR(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.isComponent(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, { forwardRef } from 'react';\nimport Form from './Form';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withForm(WrappedComponent, config = {}) {\n const FormEnhanced = forwardRef((props, ref) => {\n const { ...others } = props;\n const { component, ...formProps } = 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 FormEnhanced.displayName =\n 'React.Formutil.withForm.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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: utils.checkComponentPropType,\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.isComponent(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, { forwardRef } from 'react';\nimport Field from './Field';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withField(WrappedComponent, config = {}) {\n const FieldEnhanced = forwardRef((props, ref) => {\n const { ...others } = props;\n const { component, ...fieldProps } = 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 FieldEnhanced.displayName =\n 'React.Formutil.withField.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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, checkComponentPropType } 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: checkComponentPropType,\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 checked,\n unchecked,\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, { forwardRef } from 'react';\nimport FormContext from './context';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction connect(WrappedComponent) {\n const Connect = forwardRef((props, ref) => {\n return (\n \n {context => }\n \n );\n });\n\n Connect.displayName =\n 'React.Formutil.connect.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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","isComponent","isValidElementType","checkComponentPropType","props","propName","componentName","Error","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","$$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","$$setStates","$error","$getField","$new","$$onChange","$state","$setStates","$stateTree","processer","force","$parsedTree","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","forwardRef","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","$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;;ACCA,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,KAAK,IAA5B,IAAoCA,GAAG,GAAG,EAAN,KAAa,EAAxD;;AAGJ,AAAO,SAASG,SAAT,CAAmBC,OAAnB,EAA4B;SACxB,CAAC,CAACA,OAAF,IAAaH,UAAU,CAACG,OAAO,CAACC,IAAT,CAA9B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J,MAEO;UACHiE,QAAQ,CAAC/D,WAAW,CAAC7I,OAAZ,CAAoBF,SAApB,CAAD,CAAR;UAEA+I,WAAW,CAAC5I,cAAZ,CAA2BH,SAA3B;UAEAwQ,WAAW,CAAC3W,OAAZ,CAAoBiD,IAApB,CAAyB+L,OAAzB;;OARR,MAUO;QACHE,WAAW,CAAC7I,OAAZ,CAAoBF,SAApB;QACA6I,OAAO;;KAfR,CAAP;;;SAoBI3B,KAAK,CAAC9C,UAAN;IACJlH,KAAK,EAALA;KACG6L,WAAW,CAACxM,SAAZ,EAFC,EAGDwM,WAHC;IAIJC,UAAU,EAAEf,YAAY,CAAC7J;IAJ7B;;;ACjJJ,SAASsS,OAAT,GAAmB;wBACOT,cAAc,EADrB;MACP7R,SADO,mBACPA,SADO;;SAGRA,SAAP;;;ACFJ,SAASuS,UAAT,CAAoBna,KAApB,EAA2B;EACvBA,KAAK,qBAAQgP,YAAR,EAAyBhP,KAAzB;IAAgCkM,QAAQ,EAAE;IAA/C;;oBAEmC6M,UAAU,CAAC/Y,KAAD,CAHtB;MAGf6S,UAHe,eAGfA,UAHe;MAGH8F,UAHG,eAGHA,UAHG;;MAIjB/K,UAAU,GAAGiM,QAAQ,CAAChH,UAAD,CAA3B;SAEOpC,eAAa,CAAC7C,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 { isValidElementType } from 'react-is';\nimport 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\nexport function isComponent(obj) {\n return isValidElementType(obj) && typeof obj !== 'string';\n}\n\nexport function checkComponentPropType(props, propName, componentName) {\n if (props[propName] && !isComponent(props[propName])) {\n return new Error(\n `Invalid prop 'component' supplied to '${componentName}': the prop is not a valid React component`\n );\n }\n}\n\n// quick clone deeply\nexport function deepClone(obj) {\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 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 (isComponent(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 pathExist(scope, path) {\n const pathWords = path\n .split(PATH_REGEXP)\n .map(s => s.trim())\n .filter(item => item !== '');\n\n for (let index = 0, len = pathWords.length; index < len; index++) {\n const word = executeWord(pathWords[index]);\n\n if (word in scope) {\n if (index + 1 === len) {\n return {\n data: scope[word]\n };\n }\n\n scope = scope[word];\n }\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;\nexport function CLEAR(obj, pkey, pobj) {\n objectEach(obj, (value, key) => {\n if (value === TODO_DELETE) {\n delete obj[key];\n } else if (isPlainObj(value) || Array.isArray(value)) {\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: utils.checkComponentPropType,\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\n utils.objectEach(this.$$registers, (handler, name) => {\n let pathData;\n\n if (force || (pathData = utils.pathExist($parsedTree, name))) {\n const $newState = processer(pathData && pathData.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 }\n });\n\n return this.$render(callback);\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 utils.CLEAR(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.isComponent(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, { forwardRef } from 'react';\nimport Form from './Form';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withForm(WrappedComponent, config = {}) {\n const FormEnhanced = forwardRef((props, ref) => {\n const { ...others } = props;\n const { component, ...formProps } = 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 FormEnhanced.displayName =\n 'React.Formutil.withForm.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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: utils.checkComponentPropType,\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.isComponent(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, { forwardRef } from 'react';\nimport Field from './Field';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withField(WrappedComponent, config = {}) {\n const FieldEnhanced = forwardRef((props, ref) => {\n const { ...others } = props;\n const { component, ...fieldProps } = 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 FieldEnhanced.displayName =\n 'React.Formutil.withField.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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, checkComponentPropType } 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: checkComponentPropType,\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 checked,\n unchecked,\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, { forwardRef } from 'react';\nimport FormContext from './context';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction connect(WrappedComponent) {\n const Connect = forwardRef((props, ref) => {\n return (\n \n {context => }\n \n );\n });\n\n Connect.displayName =\n 'React.Formutil.connect.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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","isComponent","isValidElementType","checkComponentPropType","props","propName","componentName","Error","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","pathExist","data","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","$$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","$$setStates","$error","$getField","$new","$$onChange","$state","$setStates","$stateTree","processer","force","$parsedTree","pathData","$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","forwardRef","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","$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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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WAAb,IAA4B,EAAjC,CAAT,EAA+C;UAC3CqM,YAAY,CAACzI,UAAb,CAAwBtC,KAAxB,EAA+B8C,SAA/B,EAA0C6I,OAA1C;SADJ,MAEO;UACHiE,QAAQ,CAAC/D,WAAW,CAAC7I,OAAZ,CAAoBF,SAApB,CAAD,CAAR;UAEA+I,WAAW,CAAC5I,cAAZ,CAA2BH,SAA3B;UAEAwQ,WAAW,CAAC3W,OAAZ,CAAoBiD,IAApB,CAAyB+L,OAAzB;;OARR,MAUO;QACHE,WAAW,CAAC7I,OAAZ,CAAoBF,SAApB;QACA6I,OAAO;;KAfR,CAAP;;;SAoBI3B,KAAK,CAAC9C,UAAN;IACJlH,KAAK,EAALA;KACG6L,WAAW,CAACxM,SAAZ,EAFC,EAGDwM,WAHC;IAIJC,UAAU,EAAEf,YAAY,CAAC7J;IAJ7B;;;ACjJJ,SAASsS,OAAT,GAAmB;wBACOT,cAAc,EADrB;MACP7R,SADO,mBACPA,SADO;;SAGRA,SAAP;;;ACFJ,SAASuS,UAAT,CAAoBra,KAApB,EAA2B;EACvBA,KAAK,qBAAQkP,YAAR,EAAyBlP,KAAzB;IAAgCoM,QAAQ,EAAE;IAA/C;;oBAEmC6M,UAAU,CAACjZ,KAAD,CAHtB;MAGf+S,UAHe,eAGfA,UAHe;MAGH8F,UAHG,eAGHA,UAHG;;MAIjB/K,UAAU,GAAGiM,QAAQ,CAAChH,UAAD,CAA3B;SAEOpC,eAAa,CAAC7C,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 a5bc36b..da4ad9b 100644 --- a/dist/react-formutil.esm.production.js +++ b/dist/react-formutil.esm.production.js @@ -1 +1 @@ -import e,{createContext as t,createElement as r,Children as n,cloneElement as i,Component as a,forwardRef as u}from"react";import{isValidElementType as o}from"react-is";import s from"warning";import l from"hoist-non-react-statics";import $ from"react-fast-compare";function f(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var r=0;r=0)continue;r[i]=e[i]}return r}function b(e,t){if(e==null)return{};var r=y(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 V(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function w(e,t){if(t&&(typeof t==="object"||typeof t==="function")){return t}return V(e)}function F(e,t){return P(e)||O(e,t)||j()}function k(e){return C(e)||S(e)||E()}function C(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t1?r-1:0),i=1;i-1}var z=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,N)}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){s(false,"The name '%s' of Field seems is not a legal expression.",i)}if(t.length>2){return n}}function K(e,t){if(e){if(T(e)){e(t)}else if("current"in e){e.current=t}}}var W=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 ee=undefined;function te(e,t,r){X(e,function(t,r){if(t===ee){delete e[r]}else if(H(t)||Array.isArray(t)){te(t,r,e)}});if(r&&Object.keys(e).every(function(t){return e[t]===ee})){r[t]=ee;te(r)}}var re=function e(t,r){if(!_(q(t,r))){q(t,r,ee);te(t)}};var ne="FORM_VALIDATE_RESULT";var ie,ae;if(typeof requestAnimationFrame==="function"){ie=requestAnimationFrame;ae=cancelAnimationFrame}else{ie=setTimeout;ae=clearTimeout}var ue=function(t){p(a,t);function a(e){var t;f(this,a);t=w(this,m(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=V(t),r=e.$$regDuplications;var n;X(r,function(e,t){var i=F(e,2),a=i[0],u=i[1];s(a.$$reserved,"The Field with a name '".concat(t,"' has been registered!"));u.$$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){ae(t.$$duplicateTimer);t.$$regDuplications[e]=[i,r];t.$$duplicateTimer=ie(t.$$checkDuplication)}else{t.$$fieldChangedQueue.push({name:e,$newValue:r.$getState().$value});re(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=F(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});re(t.$$defaultValues,e)}}t.createDeepRegisters();t.$render()}};t.$$defaultInitialize=function(){var e=t.props,r=e.$defaultValues,n=e.$defaultStates;t.$$defaultValues=t.$$deepParseObject(L(T(r)?r(t.props)||{}:r));t.$$defaultStates=t.$$deepParseObject(L(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=k(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(t.props.$validator)){t.$$formValidate()}if(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]||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(B(e,B(u,n)))};if(U(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")){s(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:h({},i,v({},ne,e))}}if(i[ne]){delete i[ne];return{$error:i}}return},r,true)};t.$getField=function(e){var r=t.$$getRegister(e);s(!e||r,"$getField('".concat(e,"') fail to find the matched Field. Maybe it has been unmounted."));s(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(v({},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);X(t.$$registers,function(n,u){var o=u in e?e[u]:q(a,u);if(!_(o)||i){var s=r(o,n);if(s){var l=t.$formutil.$weakParams[u];var $=n.$$merge(s),f=$.$value;n.$$detectChange(s);if("$value"in s||"$viewValue"in s){var c=W(t.$$fieldChangedQueue,function(e){return e.name===u});if(c){if(!("$prevValue"in c)){c.$prevValue=c.$newValue}c.$newValue=f}else{t.$$fieldChangedQueue.push({name:u,$newValue:f,$prevValue:l})}}}}});return t.$render(n)};t.$render=function(e){return new Promise(function(r){return t.forceUpdate(function(){return r(B(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]:{};X(t,function(e,t){return q(r,t,e)});return r}},{key:"componentDidMount",value:function e(){K(this.props.$ref,this.$formutil)}},{key:"componentDidUpdate",value:function e(t){var r=this;K(this.props.$ref,this.$formutil);ae(this.$$triggerChangeTimer);this.$$triggerChangeTimer=ie(function(){r.$$triggerFormChange()})}},{key:"componentWillUnmount",value:function e(){K(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(T(o)){return o(t)}if(T(u)){return u(t)}return n.map(u,function(e){return e&&M(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=Z(i,function(e,t){var r=t.path,i=t.$state;if(n){n(i,r)}if("$value"in i&&(i.$dirty||!_(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 f=this.$$formPending||i.some(function(e){var t=e.$state;return t.$pending});var c=this.$formutil={$$registers:h({},this.$$registers),$$deepRegisters:this.$$deepRegisters,$states:Z(i,function(e,t){var r=t.path,n=t.$state;return q(e,r,n)}),$params:h({},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=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(x.Provider,{value:this.getFormContext()},this._render())}}]);return a}(a);ue.displayName="React.Formutil.Form";ue.defaultProps={$defaultValues:{},$defaultStates:{}};function oe(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=u(function(n,i){var a=Object.assign({},n);var u=n.component,o=b(n,["component"]);["$defaultStates","$defaultValues","$onFormChange","$validator","$processer","$ref"].forEach(function(e){if(e in a){if(e==="$defaultStates"||e==="$defaultValues"){o[e]=h({},r[e],a[e])}delete a[e]}});return e.createElement(ue,Object.assign({},r,o,{render:function r(n){return e.createElement(t,Object.assign({},a,{$formutil:n,ref:i}))}}))});n.displayName="React.Formutil.withForm."+(t.displayName||t.name||"Anonymous");return l(n,t)}var se=Y(oe);var le=0;var $e={$valid:true,$invalid:false,$dirty:false,$pristine:true,$touched:false,$untouched:true,$focused:false,$pending:false,$error:{}};function fe(e){return e!==true}function ce(e,t,r){s(!_(e),"You should return a string or Error when the validation('".concat(r&&r+": ").concat(t,"') failed, otherwise return true."))}var de="React.Formutil.Field";function ve(){return le++}function he(e,t){var a=t.children,u=t.render,o=t.component;if(o){return r(o,{$fieldutil:e})}if(T(u)){return u(e)}if(T(a)){return a(e)}return n.map(a,function(t){return t&&M(t.type)?i(t,{$fieldutil:e}):t})}function pe(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:d,$setFocused:v,$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(T(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(!_(l)){r.$value=l}}}var $=n.$defaultValue,f=n.$defaultState;return b(h({},$e,T(f)?f(n):f,{$value:T($)?$(n):"$defaultValue"in n?$:""},r,t))}function s(){return h({},e.$state)}function l(t){return n=new Promise(function(r){var n=e.props,i=e.$formContext;var a=h({},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 d;var v;var y;var b;delete l[ne];var V=Object.keys(a).reduce(function(t,r){delete l[r];if(!c&&n[r]!=null){var i=a[r](o,n[r],h({},n,{$formutil:$,$fieldutil:e.$fieldutil,$validError:f}));if(U(i)){t.push(i["catch"](function(e){if(!d){m(r,e||r)}}))}else if(fe(i)){f[r]=i||r;ce(i,r,n.name);if(n.$validateLazy){c=true}}}return t},[]);var w=function e(n){return r(B(t,B(y,n)))};if(V.length){if(!s){g(true)}v=function e(t){return d=t(w)};V.push(p(h({},l,f)));b=Promise.all(V).then(function(){if(d){return d}e.$shouldCancelPrevAsyncValidate=null;return g(false,w)})}else{if(s){g(false)}b=p(h({},l,f),w)}if(e.$shouldCancelPrevAsyncValidate){e.$shouldCancelPrevAsyncValidate(function(e){y=e;return b})}e.$shouldCancelPrevAsyncValidate=v})}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 d(t,r){return e.$setState({$dirty:t},r)}function v(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(fe(r)){i[t]=r||t;ce(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=h({},e.$state,r);return s()}return r}var me=function(t){p(r,t);function r(){var e;var t;f(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."));s(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;K(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;K(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)}}K(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=h({$name:this.props.name},this.$registered.$getState(),this.$registered,{$$formutil:this.$formContext.$formutil});return he(t,this.props)}},{key:"render",value:function t(){var r=this;var n=!this.$formContext;return e.createElement(x.Consumer,null,function(e){r.$formContext=e;if(!r.$fieldHandler){r.$fieldHandler=pe(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);me.displayName=de;function ge(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=u(function(n,i){var a=Object.assign({},n);var u=n.component,o=b(n,["component"]);["$validators","$asyncValidators","$validateLazy","$reserveOnUnmount","$defaultValue","$defaultState","$onFieldChange","$parser","$formatter","$ref","name"].concat(Object.keys(h({},r.$validators,r.$asyncValidators,a.$validators,a.$asyncValidators))).forEach(function(e){if(e in a){if(e==="$validators"||e==="$asyncValidators"||e==="$defaultState"){o[e]=h({},r[e],a[e])}delete a[e]}});return e.createElement(me,Object.assign({},r,o,{render:function r(n){return e.createElement(t,Object.assign({},a,{$fieldutil:n,ref:i}))}}))});n.displayName="React.Formutil.withField."+(t.displayName||t.name||"Anonymous");return l(n,t)}var ye=Y(ge);var be=function(t){p(r,t);function r(){f(this,r);return w(this,m(r).apply(this,arguments))}d(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=b(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);be.displayName="React.Formutil.EasyField.Native";be.defaultProps={value:"",type:"text",checked:true,unchecked:false};var Ve=t({}),we=Ve.Provider,Fe=Ve.Consumer;var ke=function(t){p(r,t);function r(){f(this,r);return w(this,m(r).apply(this,arguments))}d(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:Ce,Field:Pe};var l=T(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(we,{value:this.getGroupContext()},this._render())}}]);return r}(a);ke.displayName="React.Formutil.EasyField.Group";ke.defaultProps={type:"checkbox",groupNode:"div"};var Ce=function(t){p(r,t);function r(){f(this,r);return w(this,m(r).apply(this,arguments))}d(r,[{key:"componentDidMount",value:function e(){s("$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=b(r,["$value","onChange","onFocus","onBlur"]);return e.createElement(Fe,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);Ce.displayName="React.Formutil.EasyField.Group.Option";var Pe=function(t){p(r,t);function r(){f(this,r);return w(this,m(r).apply(this,arguments))}d(r,[{key:"componentDidMount",value:function e(){s(false,'The "Field" property in EasyField\'s children-props has been deprecated. Please use "GroupOption" instead.')}},{key:"render",value:function t(){return e.createElement(Ce,this.props)}}]);return r}(a);Pe.displayName="React.Formutil.EasyField.Group.Option.Deprecated";var Se=e.Frament||"div";var Oe=function(t){p(r,t);function r(e){var t;f(this,r);t=w(this,m(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(!$(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 R(e)||e*1<=t}],["min",function(e,t){return R(e)||e*1>=t}],["pattern",function(e,t){return R(e)||t.test(e)}],["enum",function(e,t){return R(e)||t.indexOf(e)>-1}],["checker",function(e,t,r){return t(e,r)}]].reduce(function(e,t){var r=F(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 xe="React.Formutil.EasyField";var De={validMessage:{},valuePropName:"value",changePropName:"onChange",focusPropName:"onFocus",blurPropName:"onBlur",$parser:function e(t){return typeof t==="string"?t.trim():t}};function Ae(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 $=h({},r,(n={},v(n,i,e.$viewValue),v(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(x);return r}function Ie(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 u;if(t){if(typeof t==="string"){u=t;r.name=u}else{r=t;u=r.name}}var o=Ue();var l=a({}).current;var $=a([]);var f;l.$formContext=o;l.props=r;l.$setState=p;var c=n(function(){l.$$FIELD_UUID=ve();l.$fieldHandler=f=pe(l);var e=l.$fieldHandler.$$reset();l.$fieldHandler.$validate();return e}),d=F(c,2),v=d[1];if(!f){f=(o.$$registers||{})[l.$fieldHandler.$name]||l.$fieldHandler}i(function(){var e=l.$state;if(l.isMounting){if(!(u in(o.$$registers||{}))){var t=l.$prevValue;f.$$triggerChange({$newValue:e.$value,$prevValue:t})}}l.$prevValue=e.$value},[l.$state.$value]);i(function(){l.isMounting=true;s(!u||o.$formutil,"You should enusre that the useField() with the name '".concat(u,"' must be used underneath a component or withForm() HOC, otherwise it's isolated."));s(u,"You should pass a name argument to useField(), otherwise it will be isolated!");return function(){l.isMounting=false;K(r.$ref,null)}},[]);i(function(){if(o.$$register){o.$$register(u,l.$fieldHandler)}return function(){if(o.$$unregister){o.$$unregister(u,l.$fieldHandler,!l.isMounting&&r.$reserveOnUnmount)}}},[u]);i(function(){K(r.$ref,l.$fieldutil)});i(function(){if($.current.length>0){var e=k($.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(B(t,l.$fieldutil))};if(l.isMounting){if(u in(o.$$registers||{})){o.$$onChange(u,e,n)}else{v(f.$$merge(e));f.$$detectChange(e);$.current.push(n)}}else{f.$$merge(e);n()}})}return l.$fieldutil=h({$name:u},f.$getState(),f,{$$formutil:o.$formutil})}function He(){var e=Ue(),t=e.$formutil;return t}function Me(e){e=h({},De,e,{children:null});var t=Ne(e),r=t.fieldProps,n=t.childProps;var i=Ie(r);return Ae(i,r,n)}export{Te as EasyField,me as Field,ue as Form,Re as connect,Ie as useField,He as useForm,Me as useHandler,ye as withField,se as withForm}; +import e,{createContext as t,createElement as r,Children as n,cloneElement as i,Component as a,forwardRef as u}from"react";import{isValidElementType as o}from"react-is";import s from"warning";import l from"hoist-non-react-statics";import $ from"react-fast-compare";function f(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var r=0;r=0)continue;r[i]=e[i]}return r}function b(e,t){if(e==null)return{};var r=y(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 V(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function w(e,t){if(t&&(typeof t==="object"||typeof t==="function")){return t}return V(e)}function F(e,t){return P(e)||O(e,t)||j()}function k(e){return C(e)||S(e)||E()}function C(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t1?r-1:0),i=1;i-1}var z=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,N)}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){s(false,"The name '%s' of Field seems is not a legal expression.",i)}if(t.length>2){return n}}function K(e,t){var r=t.split(A).map(function(e){return e.trim()}).filter(function(e){return e!==""});for(var n=0,i=r.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 te=undefined;function re(e,t,r){Z(e,function(t,r){if(t===te){delete e[r]}else if(H(t)||Array.isArray(t)){re(t,r,e)}});if(r&&Object.keys(e).every(function(t){return e[t]===te})){r[t]=te;re(r)}}var ne=function e(t,r){if(!_(q(t,r))){q(t,r,te);re(t)}};var ie="FORM_VALIDATE_RESULT";var ae,ue;if(typeof requestAnimationFrame==="function"){ae=requestAnimationFrame;ue=cancelAnimationFrame}else{ae=setTimeout;ue=clearTimeout}var oe=function(t){p(a,t);function a(e){var t;f(this,a);t=w(this,m(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=V(t),r=e.$$regDuplications;var n;Z(r,function(e,t){var i=F(e,2),a=i[0],u=i[1];s(a.$$reserved,"The Field with a name '".concat(t,"' has been registered!"));u.$$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){ue(t.$$duplicateTimer);t.$$regDuplications[e]=[i,r];t.$$duplicateTimer=ae(t.$$checkDuplication)}else{t.$$fieldChangedQueue.push({name:e,$newValue:r.$getState().$value});ne(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=F(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});ne(t.$$defaultValues,e)}}t.createDeepRegisters();t.$render()}};t.$$defaultInitialize=function(){var e=t.props,r=e.$defaultValues,n=e.$defaultStates;t.$$defaultValues=t.$$deepParseObject(L(T(r)?r(t.props)||{}:r));t.$$defaultStates=t.$$deepParseObject(L(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=k(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(t.props.$validator)){t.$$formValidate()}if(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]||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(B(e,B(u,n)))};if(U(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")){s(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:h({},i,v({},ie,e))}}if(i[ie]){delete i[ie];return{$error:i}}return},r,true)};t.$getField=function(e){var r=t.$$getRegister(e);s(!e||r,"$getField('".concat(e,"') fail to find the matched Field. Maybe it has been unmounted."));s(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(v({},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);Z(t.$$registers,function(e,n){var u;if(i||(u=K(a,n))){var o=r(u&&u.data,e);if(o){var s=t.$formutil.$weakParams[n];var l=e.$$merge(o),$=l.$value;e.$$detectChange(o);if("$value"in o||"$viewValue"in o){var f=J(t.$$fieldChangedQueue,function(e){return e.name===n});if(f){if(!("$prevValue"in f)){f.$prevValue=f.$newValue}f.$newValue=$}else{t.$$fieldChangedQueue.push({name:n,$newValue:$,$prevValue:s})}}}}});return t.$render(n)};t.$render=function(e){return new Promise(function(r){return t.forceUpdate(function(){return r(B(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]:{};Z(t,function(e,t){return q(r,t,e)});return r}},{key:"componentDidMount",value:function e(){W(this.props.$ref,this.$formutil)}},{key:"componentDidUpdate",value:function e(t){var r=this;W(this.props.$ref,this.$formutil);ue(this.$$triggerChangeTimer);this.$$triggerChangeTimer=ae(function(){r.$$triggerFormChange()})}},{key:"componentWillUnmount",value:function e(){W(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(T(o)){return o(t)}if(T(u)){return u(t)}return n.map(u,function(e){return e&&M(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=ee(i,function(e,t){var r=t.path,i=t.$state;if(n){n(i,r)}if("$value"in i&&(i.$dirty||!_(i.$value))){e[r]=i.$value}});var u=ee(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:h({},this.$$registers),$$deepRegisters:this.$$deepRegisters,$states:ee(i,function(e,t){var r=t.path,n=t.$state;return q(e,r,n)}),$params:h({},this.$$defaultValues,u),$errors:ee(i,function(e,t){var r=t.path,n=t.$state;if(n.$invalid){q(e,r,n.$error)}}),$dirts:ee(i,function(e,t){var r=t.path,n=t.$state;return q(e,r,n.$dirty)}),$touches:ee(i,function(e,t){var r=t.path,n=t.$state;return q(e,r,n.$touched)}),$focuses:ee(i,function(e,t){var r=t.path,n=t.$state;return q(e,r,n.$focused)}),$pendings:ee(i,function(e,t){var r=t.path,n=t.$state;return q(e,r,n.$pending)}),$weakStates:ee(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n}),$weakParams:a,$weakErrors:ee(i,function(e,t){var r=t.path,n=t.$state;if(n.$invalid){e[r]=n.$error}}),$weakDirts:ee(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$dirty}),$weakTouches:ee(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$touched}),$weakFocuses:ee(i,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$focused}),$weakPendings:ee(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(x.Provider,{value:this.getFormContext()},this._render())}}]);return a}(a);oe.displayName="React.Formutil.Form";oe.defaultProps={$defaultValues:{},$defaultStates:{}};function se(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=u(function(n,i){var a=Object.assign({},n);var u=n.component,o=b(n,["component"]);["$defaultStates","$defaultValues","$onFormChange","$validator","$processer","$ref"].forEach(function(e){if(e in a){if(e==="$defaultStates"||e==="$defaultValues"){o[e]=h({},r[e],a[e])}delete a[e]}});return e.createElement(oe,Object.assign({},r,o,{render:function r(n){return e.createElement(t,Object.assign({},a,{$formutil:n,ref:i}))}}))});n.displayName="React.Formutil.withForm."+(t.displayName||t.name||"Anonymous");return l(n,t)}var le=Y(se);var $e=0;var fe={$valid:true,$invalid:false,$dirty:false,$pristine:true,$touched:false,$untouched:true,$focused:false,$pending:false,$error:{}};function ce(e){return e!==true}function de(e,t,r){s(!_(e),"You should return a string or Error when the validation('".concat(r&&r+": ").concat(t,"') failed, otherwise return true."))}var ve="React.Formutil.Field";function he(){return $e++}function pe(e,t){var a=t.children,u=t.render,o=t.component;if(o){return r(o,{$fieldutil:e})}if(T(u)){return u(e)}if(T(a)){return a(e)}return n.map(a,function(t){return t&&M(t.type)?i(t,{$fieldutil:e}):t})}function me(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:d,$setFocused:v,$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(T(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(!_(l)){r.$value=l}}}var $=n.$defaultValue,f=n.$defaultState;return b(h({},fe,T(f)?f(n):f,{$value:T($)?$(n):"$defaultValue"in n?$:""},r,t))}function s(){return h({},e.$state)}function l(t){return n=new Promise(function(r){var n=e.props,i=e.$formContext;var a=h({},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 d;var v;var y;var b;delete l[ie];var V=Object.keys(a).reduce(function(t,r){delete l[r];if(!c&&n[r]!=null){var i=a[r](o,n[r],h({},n,{$formutil:$,$fieldutil:e.$fieldutil,$validError:f}));if(U(i)){t.push(i["catch"](function(e){if(!d){m(r,e||r)}}))}else if(ce(i)){f[r]=i||r;de(i,r,n.name);if(n.$validateLazy){c=true}}}return t},[]);var w=function e(n){return r(B(t,B(y,n)))};if(V.length){if(!s){g(true)}v=function e(t){return d=t(w)};V.push(p(h({},l,f)));b=Promise.all(V).then(function(){if(d){return d}e.$shouldCancelPrevAsyncValidate=null;return g(false,w)})}else{if(s){g(false)}b=p(h({},l,f),w)}if(e.$shouldCancelPrevAsyncValidate){e.$shouldCancelPrevAsyncValidate(function(e){y=e;return b})}e.$shouldCancelPrevAsyncValidate=v})}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 d(t,r){return e.$setState({$dirty:t},r)}function v(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(ce(r)){i[t]=r||t;de(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=h({},e.$state,r);return s()}return r}var ge=function(t){p(r,t);function r(){var e;var t;f(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."));s(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;W(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;W(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)}}W(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=h({$name:this.props.name},this.$registered.$getState(),this.$registered,{$$formutil:this.$formContext.$formutil});return pe(t,this.props)}},{key:"render",value:function t(){var r=this;var n=!this.$formContext;return e.createElement(x.Consumer,null,function(e){r.$formContext=e;if(!r.$fieldHandler){r.$fieldHandler=me(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);ge.displayName=ve;function ye(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=u(function(n,i){var a=Object.assign({},n);var u=n.component,o=b(n,["component"]);["$validators","$asyncValidators","$validateLazy","$reserveOnUnmount","$defaultValue","$defaultState","$onFieldChange","$parser","$formatter","$ref","name"].concat(Object.keys(h({},r.$validators,r.$asyncValidators,a.$validators,a.$asyncValidators))).forEach(function(e){if(e in a){if(e==="$validators"||e==="$asyncValidators"||e==="$defaultState"){o[e]=h({},r[e],a[e])}delete a[e]}});return e.createElement(ge,Object.assign({},r,o,{render:function r(n){return e.createElement(t,Object.assign({},a,{$fieldutil:n,ref:i}))}}))});n.displayName="React.Formutil.withField."+(t.displayName||t.name||"Anonymous");return l(n,t)}var be=Y(ye);var Ve=function(t){p(r,t);function r(){f(this,r);return w(this,m(r).apply(this,arguments))}d(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=b(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);Ve.displayName="React.Formutil.EasyField.Native";Ve.defaultProps={value:"",type:"text",checked:true,unchecked:false};var we=t({}),Fe=we.Provider,ke=we.Consumer;var Ce=function(t){p(r,t);function r(){f(this,r);return w(this,m(r).apply(this,arguments))}d(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:Pe,Field:Se};var l=T(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(Fe,{value:this.getGroupContext()},this._render())}}]);return r}(a);Ce.displayName="React.Formutil.EasyField.Group";Ce.defaultProps={type:"checkbox",groupNode:"div"};var Pe=function(t){p(r,t);function r(){f(this,r);return w(this,m(r).apply(this,arguments))}d(r,[{key:"componentDidMount",value:function e(){s("$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=b(r,["$value","onChange","onFocus","onBlur"]);return e.createElement(ke,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);Pe.displayName="React.Formutil.EasyField.Group.Option";var Se=function(t){p(r,t);function r(){f(this,r);return w(this,m(r).apply(this,arguments))}d(r,[{key:"componentDidMount",value:function e(){s(false,'The "Field" property in EasyField\'s children-props has been deprecated. Please use "GroupOption" instead.')}},{key:"render",value:function t(){return e.createElement(Pe,this.props)}}]);return r}(a);Se.displayName="React.Formutil.EasyField.Group.Option.Deprecated";var Oe=e.Frament||"div";var Ee=function(t){p(r,t);function r(e){var t;f(this,r);t=w(this,m(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(!$(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 R(e)||e*1<=t}],["min",function(e,t){return R(e)||e*1>=t}],["pattern",function(e,t){return R(e)||t.test(e)}],["enum",function(e,t){return R(e)||t.indexOf(e)>-1}],["checker",function(e,t,r){return t(e,r)}]].reduce(function(e,t){var r=F(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 De="React.Formutil.EasyField";var Ae={validMessage:{},valuePropName:"value",changePropName:"onChange",focusPropName:"onFocus",blurPropName:"onBlur",$parser:function e(t){return typeof t==="string"?t.trim():t}};function Ne(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 $=h({},r,(n={},v(n,i,e.$viewValue),v(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(x);return r}function He(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 u;if(t){if(typeof t==="string"){u=t;r.name=u}else{r=t;u=r.name}}var o=Ie();var l=a({}).current;var $=a([]);var f;l.$formContext=o;l.props=r;l.$setState=p;var c=n(function(){l.$$FIELD_UUID=he();l.$fieldHandler=f=me(l);var e=l.$fieldHandler.$$reset();l.$fieldHandler.$validate();return e}),d=F(c,2),v=d[1];if(!f){f=(o.$$registers||{})[l.$fieldHandler.$name]||l.$fieldHandler}i(function(){var e=l.$state;if(l.isMounting){if(!(u in(o.$$registers||{}))){var t=l.$prevValue;f.$$triggerChange({$newValue:e.$value,$prevValue:t})}}l.$prevValue=e.$value},[l.$state.$value]);i(function(){l.isMounting=true;s(!u||o.$formutil,"You should enusre that the useField() with the name '".concat(u,"' must be used underneath a component or withForm() HOC, otherwise it's isolated."));s(u,"You should pass a name argument to useField(), otherwise it will be isolated!");return function(){l.isMounting=false;W(r.$ref,null)}},[]);i(function(){if(o.$$register){o.$$register(u,l.$fieldHandler)}return function(){if(o.$$unregister){o.$$unregister(u,l.$fieldHandler,!l.isMounting&&r.$reserveOnUnmount)}}},[u]);i(function(){W(r.$ref,l.$fieldutil)});i(function(){if($.current.length>0){var e=k($.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(B(t,l.$fieldutil))};if(l.isMounting){if(u in(o.$$registers||{})){o.$$onChange(u,e,n)}else{v(f.$$merge(e));f.$$detectChange(e);$.current.push(n)}}else{f.$$merge(e);n()}})}return l.$fieldutil=h({$name:u},f.$getState(),f,{$$formutil:o.$formutil})}function Me(){var e=Ie(),t=e.$formutil;return t}function Le(e){e=h({},Ae,e,{children:null});var t=_e(e),r=t.fieldProps,n=t.childProps;var i=He(r);return Ne(i,r,n)}export{Re as EasyField,ge as Field,oe as Form,Ue as connect,He as useField,Me as useForm,Le as useHandler,be as withField,le as withForm}; diff --git a/dist/react-formutil.umd.development.js b/dist/react-formutil.umd.development.js index 73d1c19..bf225d4 100644 --- a/dist/react-formutil.umd.development.js +++ b/dist/react-formutil.umd.development.js @@ -700,6 +700,27 @@ return target; } } + function pathExist(scope, path) { + var pathWords = path.split(PATH_REGEXP).map(function (s) { + return s.trim(); + }).filter(function (item) { + return item !== ''; + }); + + for (var index = 0, len = pathWords.length; index < len; index++) { + var word = executeWord(pathWords[index]); + + if (word in scope) { + if (index + 1 === len) { + return { + data: scope[word] + }; + } + + scope = scope[word]; + } + } + } function createRef(ref, value) { if (ref) { if (isFunction(ref)) { @@ -1050,10 +1071,10 @@ var $parsedTree = _this.$$deepParseObject($stateTree); objectEach(_this.$$registers, function (handler, name) { - var data = name in $stateTree ? $stateTree[name] : parsePath($parsedTree, name); + var pathData; - if (!isUndefined(data) || force) { - var $newState = processer(data, handler); + if (force || (pathData = pathExist($parsedTree, name))) { + var $newState = processer(pathData && pathData.data, handler); if ($newState) { var $prevValue = _this.$formutil.$weakParams[name]; diff --git a/dist/react-formutil.umd.development.js.map b/dist/react-formutil.umd.development.js.map index 1e6b22c..ad60e91 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":["../src/context.js","../node_modules/react-is/cjs/react-is.development.js","../node_modules/react-is/index.js","../node_modules/warning/warning.js","../src/utils.js","../src/Form.js","../node_modules/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/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","/** @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","/**\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 { isValidElementType } from 'react-is';\nimport 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\nexport function isComponent(obj) {\n return isValidElementType(obj) && typeof obj !== 'string';\n}\n\nexport function checkComponentPropType(props, propName, componentName) {\n if (props[propName] && !isComponent(props[propName])) {\n return new Error(\n `Invalid prop 'component' supplied to '${componentName}': the prop is not a valid React component`\n );\n }\n}\n\n// quick clone deeply\nexport function deepClone(obj) {\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 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 (isComponent(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;\nexport function CLEAR(obj, pkey, pobj) {\n objectEach(obj, (value, key) => {\n if (value === TODO_DELETE) {\n delete obj[key];\n } else if (isPlainObj(value) || Array.isArray(value)) {\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: utils.checkComponentPropType,\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\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 }\n });\n\n return this.$render(callback);\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 utils.CLEAR(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.isComponent(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","'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, { forwardRef } from 'react';\nimport Form from './Form';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withForm(WrappedComponent, config = {}) {\n const FormEnhanced = forwardRef((props, ref) => {\n const { ...others } = props;\n const { component, ...formProps } = 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 FormEnhanced.displayName =\n 'React.Formutil.withForm.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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: utils.checkComponentPropType,\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.isComponent(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, { forwardRef } from 'react';\nimport Field from './Field';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withField(WrappedComponent, config = {}) {\n const FieldEnhanced = forwardRef((props, ref) => {\n const { ...others } = props;\n const { component, ...fieldProps } = 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 FieldEnhanced.displayName =\n 'React.Formutil.withField.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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, checkComponentPropType } 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: checkComponentPropType,\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 checked,\n unchecked,\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, { forwardRef } from 'react';\nimport FormContext from './context';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction connect(WrappedComponent) {\n const Connect = forwardRef((props, ref) => {\n return (\n \n {context => }\n \n );\n });\n\n Connect.displayName =\n 'React.Formutil.connect.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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","require$$0","OBJECT_PROTO","Object","getPrototypeOf","PATH_REGEXP","Root","isUndefined","window","global","arg","isFunction","isEmpty","isPromise","promise","then","isObject","obj","prototype","toString","call","isPlainObj","constructor","isComponent","isValidElementType","checkComponentPropType","props","propName","componentName","Error","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","$$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","$$setStates","$error","$getField","$new","$$onChange","$state","$setStates","$stateTree","processer","force","$parsedTree","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","ReactIs","withForm","config","FormEnhanced","forwardRef","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","$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;;;;;;;;;;;ACFA;;;AAaA,EAA2C;IACzC,CAAC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EAALA;EADI,KAED+L,WAAW,CAAC1M,SAAZ,EAFC,EAGD0M,WAHC;EAIJC,IAAAA,UAAU,EAAEf,YAAY,CAAC/J;EAJrB,IAAR;EAMH;;ECvJD,SAASuS,OAAT,GAAmB;EAAA,wBACOT,cAAc,EADrB;EAAA,MACP9R,SADO,mBACPA,SADO;;EAGf,SAAOA,SAAP;EACH;;ECHD,SAASwS,UAAT,CAAoBpa,KAApB,EAA2B;EACvBA,EAAAA,KAAK,qBAAQiP,YAAR,EAAyBjP,KAAzB;EAAgCkM,IAAAA,QAAQ,EAAE;EAA1C,IAAL;;EADuB,oBAGY8M,UAAU,CAAChZ,KAAD,CAHtB;EAAA,MAGf+S,UAHe,eAGfA,UAHe;EAAA,MAGH6F,UAHG,eAGHA,UAHG;;EAIvB,MAAMhL,UAAU,GAAGkM,QAAQ,CAAC/G,UAAD,CAA3B;EAEA,SAAOpC,eAAa,CAAC/C,UAAD,EAAamF,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/react-is/cjs/react-is.development.js","../node_modules/react-is/index.js","../node_modules/warning/warning.js","../src/utils.js","../src/Form.js","../node_modules/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/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","/** @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","/**\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 { isValidElementType } from 'react-is';\nimport 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\nexport function isComponent(obj) {\n return isValidElementType(obj) && typeof obj !== 'string';\n}\n\nexport function checkComponentPropType(props, propName, componentName) {\n if (props[propName] && !isComponent(props[propName])) {\n return new Error(\n `Invalid prop 'component' supplied to '${componentName}': the prop is not a valid React component`\n );\n }\n}\n\n// quick clone deeply\nexport function deepClone(obj) {\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 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 (isComponent(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 pathExist(scope, path) {\n const pathWords = path\n .split(PATH_REGEXP)\n .map(s => s.trim())\n .filter(item => item !== '');\n\n for (let index = 0, len = pathWords.length; index < len; index++) {\n const word = executeWord(pathWords[index]);\n\n if (word in scope) {\n if (index + 1 === len) {\n return {\n data: scope[word]\n };\n }\n\n scope = scope[word];\n }\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;\nexport function CLEAR(obj, pkey, pobj) {\n objectEach(obj, (value, key) => {\n if (value === TODO_DELETE) {\n delete obj[key];\n } else if (isPlainObj(value) || Array.isArray(value)) {\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: utils.checkComponentPropType,\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\n utils.objectEach(this.$$registers, (handler, name) => {\n let pathData;\n\n if (force || (pathData = utils.pathExist($parsedTree, name))) {\n const $newState = processer(pathData && pathData.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 }\n });\n\n return this.$render(callback);\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 utils.CLEAR(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.isComponent(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","'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, { forwardRef } from 'react';\nimport Form from './Form';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withForm(WrappedComponent, config = {}) {\n const FormEnhanced = forwardRef((props, ref) => {\n const { ...others } = props;\n const { component, ...formProps } = 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 FormEnhanced.displayName =\n 'React.Formutil.withForm.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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: utils.checkComponentPropType,\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.isComponent(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, { forwardRef } from 'react';\nimport Field from './Field';\nimport { createHOC } from './utils';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction withField(WrappedComponent, config = {}) {\n const FieldEnhanced = forwardRef((props, ref) => {\n const { ...others } = props;\n const { component, ...fieldProps } = 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 FieldEnhanced.displayName =\n 'React.Formutil.withField.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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, checkComponentPropType } 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: checkComponentPropType,\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 checked,\n unchecked,\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, { forwardRef } from 'react';\nimport FormContext from './context';\nimport hoistStatics from 'hoist-non-react-statics';\n\nfunction connect(WrappedComponent) {\n const Connect = forwardRef((props, ref) => {\n return (\n \n {context => }\n \n );\n });\n\n Connect.displayName =\n 'React.Formutil.connect.' + (WrappedComponent.displayName || WrappedComponent.name || 'Anonymous');\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","require$$0","OBJECT_PROTO","Object","getPrototypeOf","PATH_REGEXP","Root","isUndefined","window","global","arg","isFunction","isEmpty","isPromise","promise","then","isObject","obj","prototype","toString","call","isPlainObj","constructor","isComponent","isValidElementType","checkComponentPropType","props","propName","componentName","Error","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","pathExist","data","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","$$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","$$setStates","$error","$getField","$new","$$onChange","$state","$setStates","$stateTree","processer","force","$parsedTree","pathData","$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","ReactIs","withForm","config","FormEnhanced","forwardRef","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","$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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,YAAR,EAAyBnP,KAAzB;EAAgCoM,IAAAA,QAAQ,EAAE;EAA1C,IAAL;;EADuB,oBAGY8M,UAAU,CAAClZ,KAAD,CAHtB;EAAA,MAGfiT,UAHe,eAGfA,UAHe;EAAA,MAGH6F,UAHG,eAGHA,UAHG;;EAIvB,MAAMhL,UAAU,GAAGkM,QAAQ,CAAC/G,UAAD,CAA3B;EAEA,SAAOpC,eAAa,CAAC/C,UAAD,EAAamF,UAAb,EAAyB6F,UAAzB,CAApB;EACH;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/react-formutil.umd.production.js b/dist/react-formutil.umd.production.js index 9c58122..9ba295e 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")):"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){C(!1,"The name '%s' of Field seems is not a legal expression.",i)}if(t.length>2)return n}function M(e,t){e&&(O(e)?e(t):"current"in e&&(e.current=t))}var U=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)},z=void 0;function B(e,t,r){H(e,function(t,r){t===z?delete e[r]:(j(t)||Array.isArray(t))&&B(t,r,e)}),r&&Object.keys(e).every(function(t){return e[t]===z})&&(r[t]=z,B(r))}var Y,Q,G=function(e,t){S(R(e,t))||(R(e,t,z),B(e))},q="FORM_VALIDATE_RESULT";"function"===typeof requestAnimationFrame?(Y=requestAnimationFrame,Q=cancelAnimationFrame):(Y=setTimeout,Q=clearTimeout);var K=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;H(r,function(t,n){var i=p(t,2),o=i[0],a=i[1];C(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?(Q(t.$$duplicateTimer),t.$$regDuplications[e]=[i,r],t.$$duplicateTimer=Y(t.$$checkDuplication)):(t.$$fieldChangedQueue.push({name:e,$newValue:r.$getState().$value}),G(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}),G(t.$$defaultValues,e)));t.createDeepRegisters(),t.$render()}},t.$$defaultInitialize=function(){var e=t.props,r=e.$defaultValues,n=e.$defaultStates;t.$$defaultValues=t.$$deepParseObject(D(O(r)?r(t.props)||{}:r)),t.$$defaultStates=t.$$deepParseObject(D(O(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&&R(r,e.name,e.$newValue),"$prevValue"in e&&R(n,e.name,e.$prevValue),o=!0}}),o&&(O(t.props.$validator)&&t.$$formValidate(),O(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]||R(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(_(e,_(o,t)))};k(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)?(C(!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({},q,e))}:n[q]?(delete n[q],{$error:n}):void 0},r,!0)},t.$getField=function(e){var r=t.$$getRegister(e);if(C(!e||r,"$getField('".concat(e,"') fail to find the matched Field. Maybe it has been unmounted.")),C(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);return H(t.$$registers,function(n,a){var u=a in e?e[a]:R(o,a);if(!S(u)||i){var s=r(u,n);if(s){var l=t.$formutil.$weakParams[a],c=n.$$merge(s).$value;if(n.$$detectChange(s),"$value"in s||"$viewValue"in s){var $=U(t.$$fieldChangedQueue,function(e){return e.name===a});$?("$prevValue"in $||($.$prevValue=$.$newValue),$.$newValue=c):t.$$fieldChangedQueue.push({name:a,$newValue:c,$prevValue:l})}}}}),t.$render(n)},t.$render=function(e){return new Promise(function(r){return t.forceUpdate(function(){return r(_(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 H(e,function(e,r){return R(t,r,e)}),t}},{key:"componentDidMount",value:function(){M(this.props.$ref,this.$formutil)}},{key:"componentDidUpdate",value:function(e){var t=this;M(this.props.$ref,this.$formutil),Q(this.$$triggerChangeTimer),this.$$triggerChangeTimer=Y(function(){t.$$triggerFormChange()})}},{key:"componentWillUnmount",value:function(){M(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}):O(i)?i(e):O(n)?n(e):t.Children.map(n,function(r){return r&&x(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=L(n,function(e,r){var n=r.path,i=r.$state;t&&t(i,n),"$value"in i&&(i.$dirty||!S(i.$value))&&(e[n]=i.$value)}),o=L(n,function(e,t){var r=t.path;t.$state;return r in i&&R(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:L(n,function(e,t){return R(e,t.path,t.$state)}),$params:u({},this.$$defaultValues,o),$errors:L(n,function(e,t){var r=t.path,n=t.$state;n.$invalid&&R(e,r,n.$error)}),$dirts:L(n,function(e,t){return R(e,t.path,t.$state.$dirty)}),$touches:L(n,function(e,t){return R(e,t.path,t.$state.$touched)}),$focuses:L(n,function(e,t){return R(e,t.path,t.$state.$focused)}),$pendings:L(n,function(e,t){return R(e,t.path,t.$state.$pending)}),$weakStates:L(n,function(e,t){var r=t.path,n=t.$state;return e[r]=n}),$weakParams:i,$weakErrors:L(n,function(e,t){var r=t.path,n=t.$state;n.$invalid&&(e[r]=n.$error)}),$weakDirts:L(n,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$dirty}),$weakTouches:L(n,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$touched}),$weakFocuses:L(n,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$focused}),$weakPendings:L(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}();K.displayName="React.Formutil.Form",K.defaultProps={$defaultValues:{},$defaultStates:{}};var W={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},J={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},X={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Z={};function ee(e){return b.isMemo(e)?X:Z[e.$$typeof]||W}Z[b.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var te=Object.defineProperty,re=Object.getOwnPropertyNames,ne=Object.getOwnPropertySymbols,ie=Object.getOwnPropertyDescriptor,oe=Object.getPrototypeOf,ae=Object.prototype;var ue=function e(t,r,n){if("string"!==typeof r){if(ae){var i=oe(r);i&&i!==ae&&e(t,i,n)}var o=re(r);ne&&(o=o.concat(ne(r)));for(var a=ee(t),u=ee(r),s=0;s1&&void 0!==arguments[1]?arguments[1]:{},i=t.forwardRef(function(t,i){var o=Object.assign({},t),a=(t.component,$(t,["component"]));return["$defaultStates","$defaultValues","$onFormChange","$validator","$processer","$ref"].forEach(function(e){e in o&&("$defaultStates"!==e&&"$defaultValues"!==e||(a[e]=u({},n[e],o[e])),delete o[e])}),r.createElement(K,Object.assign({},n,a,{render:function(t){return r.createElement(e,Object.assign({},o,{$formutil:t,ref:i}))}}))});return i.displayName="React.Formutil.withForm."+(e.displayName||e.name||"Anonymous"),ue(i,e)}),le=0,ce={$valid:!0,$invalid:!1,$dirty:!1,$pristine:!0,$touched:!1,$untouched:!0,$focused:!1,$pending:!1,$error:{}};function $e(e){return!0!==e}function fe(e,t,r){C(!S(e),"You should return a string or Error when the validation('".concat(r&&r+": ").concat(t,"') failed, otherwise return true."))}function de(){return le++}function pe(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 $=R(l,o);r=R(s,o)||{},S($)||(r.$value=$)}}var f=n.$defaultValue,d=n.$defaultState;return c(u({},ce,O(d)?d(n):d,{$value:O(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[q];var w=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}));k(i)?t.push(i.catch(function(e){n||s(r,e||r)})):$e(i)&&(y[r]=i||r,fe(i,r,$.name),$.$validateLazy&&(b=!0))}return t},[]),C=function(e){return r(_(t,_(o,e)))};w.length?(m||l(!0),i=function(e){return n=e(C)},w.push(a(u({},v,y))),c=Promise.all(w).then(function(){return n||(e.$shouldCancelPrevAsyncValidate=null,l(!1,C))})):(m&&l(!1),c=a(u({},v,y),C)),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 $e(r)?(i[t]=r||t,fe(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;O(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 he=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.")),C(e,"You should assign a name to , otherwise it will be isolated!"),t.$$register&&t.$$register(e,this.$fieldHandler),this.$prevValue=this.$state.$value,M(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,M(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),M(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}):O(i)?i(e):O(n)?n(e):t.Children.map(n,function(r){return r&&x(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=pe(e,e)),e.$registered=(r.$$registers||{})[e.$fieldHandler.$name]||e.$fieldHandler,t&&(e.$fieldHandler.$$reset(),e.$fieldHandler.$validate()),e._render()})}}]),i}();he.displayName="React.Formutil.Field";var me=A(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.forwardRef(function(t,i){var o=Object.assign({},t),a=(t.component,$(t,["component"]));return["$validators","$asyncValidators","$validateLazy","$reserveOnUnmount","$defaultValue","$defaultState","$onFieldChange","$parser","$formatter","$ref","name"].concat(Object.keys(u({},n.$validators,n.$asyncValidators,o.$validators,o.$asyncValidators))).forEach(function(e){e in o&&("$validators"!==e&&"$asyncValidators"!==e&&"$defaultState"!==e||(a[e]=u({},n[e],o[e])),delete o[e])}),r.createElement(he,Object.assign({},n,a,{render:function(t){return r.createElement(e,Object.assign({},o,{$fieldutil:t,ref:i}))}}))});return i.displayName="React.Formutil.withField."+(e.displayName||e.name||"Anonymous"),ue(i,e)}),ve=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}();ve.displayName="React.Formutil.EasyField.Native",ve.defaultProps={value:"",type:"text",checked:!0,unchecked:!1};var ge=t.createContext({}),ye=ge.Provider,be=ge.Consumer,we=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:Ce,Field:Ve},u=O(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(ye,{value:this.getGroupContext()},this._render())}}]),i}();we.displayName="React.Formutil.EasyField.Group",we.defaultProps={type:"checkbox",groupNode:"div"};var Ce=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(){C("$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(be,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}();Ce.displayName="React.Formutil.EasyField.Group.Option";var Ve=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(){C(!1,'The "Field" property in EasyField\'s children-props has been deprecated. Please use "GroupOption" instead.')}},{key:"render",value:function(){return r.createElement(Ce,this.props)}}]),i}();Ve.displayName="React.Formutil.EasyField.Group.Option.Deprecated";var Fe=Array.isArray,Pe=Object.keys,Se=Object.prototype.hasOwnProperty,Oe="undefined"!==typeof Element;var Ee=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=Fe(t),u=Fe(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=Pe(t);if((i=f.length)!==Pe(r).length)return!1;for(n=i;0!==n--;)if(!Se.call(r,f[n]))return!1;if(Oe&&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}},ke=r.Frament||"div",je=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=[]):Ee(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 E(e)||1*e<=t}],["min",function(e,t){return E(e)||1*e>=t}],["pattern",function(e,t){return E(e)||t.test(e)}],["enum",function(e,t){return E(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},{}),_e={validMessage:{},valuePropName:"value",changePropName:"onChange",focusPropName:"onFocus",blurPropName:"onBlur",$parser:function(e){return"string"===typeof e?e.trim():e}};function Ae(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?we:"list"===m?je:ve,o&&(l.name=o),a&&(l.type=m),t&&(l.children=t),m){case"select":case"textarea":e.multiple&&(i[xe]="array");break;case"group":"checkbox"===v&&(i[xe]="array"),l.type=v;break;case"checkbox":case"radio":i[xe]="checked";break;case"list":i[xe]="array"}}if(!("$defaultValue"in i)&&"defaultValue"in e&&(i.$defaultValue=s),!("$defaultValue"in i)&&xe in i){var g;switch(i[xe]){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 Ne=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=Te(this.props),n=e.fieldProps,i=e.childProps,o=e.renderProps;return r.createElement(he,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):O(i)?i(e):O(o)?o(e):t.Children.map(o,function(r){return t.cloneElement(r,e)})}(Ae(e,n,i),o)}}))}}]),i}();function Re(){if(!r.useState)throw new Error("Hooks api need react@>=16.8, Please upgrade your reactjs.");return(0,r.useContext)(m)}function Me(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=Re(),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(_(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=de(),c.$fieldHandler=s=pe(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,C(!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.")),C(n,"You should pass a name argument to useField(), otherwise it will be isolated!"),function(){c.isMounting=!1,M(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(){M(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})}Ne.displayName="React.Formutil.EasyField",Ne.defaultProps=_e,e.EasyField=Ne,e.Field=he,e.Form=K,e.connect=function(e){var n=t.forwardRef(function(t,n){return r.createElement(m.Consumer,null,function(i){return r.createElement(e,Object.assign({},t,{$formutil:i.$formutil,ref:n}))})});return n.displayName="React.Formutil.connect."+(e.displayName||e.name||"Anonymous"),ue(n,e)},e.useField=Me,e.useForm=function(){return Re().$formutil},e.useHandler=function(e){var t=Te(e=u({},_e,e,{children:null})),r=t.fieldProps,n=t.childProps;return Ae(Me(r),r,n)},e.withField=me,e.withForm=se,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){C(!1,"The name '%s' of Field seems is not a legal expression.",i)}if(t.length>2)return n}function M(e,t){e&&(O(e)?e(t):"current"in e&&(e.current=t))}var U=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)},z=void 0;function B(e,t,r){H(e,function(t,r){t===z?delete e[r]:(j(t)||Array.isArray(t))&&B(t,r,e)}),r&&Object.keys(e).every(function(t){return e[t]===z})&&(r[t]=z,B(r))}var Y,Q,G=function(e,t){S(R(e,t))||(R(e,t,z),B(e))},q="FORM_VALIDATE_RESULT";"function"===typeof requestAnimationFrame?(Y=requestAnimationFrame,Q=cancelAnimationFrame):(Y=setTimeout,Q=clearTimeout);var K=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;H(r,function(t,n){var i=p(t,2),o=i[0],a=i[1];C(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?(Q(t.$$duplicateTimer),t.$$regDuplications[e]=[i,r],t.$$duplicateTimer=Y(t.$$checkDuplication)):(t.$$fieldChangedQueue.push({name:e,$newValue:r.$getState().$value}),G(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}),G(t.$$defaultValues,e)));t.createDeepRegisters(),t.$render()}},t.$$defaultInitialize=function(){var e=t.props,r=e.$defaultValues,n=e.$defaultStates;t.$$defaultValues=t.$$deepParseObject(D(O(r)?r(t.props)||{}:r)),t.$$defaultStates=t.$$deepParseObject(D(O(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&&R(r,e.name,e.$newValue),"$prevValue"in e&&R(n,e.name,e.$prevValue),o=!0}}),o&&(O(t.props.$validator)&&t.$$formValidate(),O(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]||R(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(_(e,_(o,t)))};k(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)?(C(!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({},q,e))}:n[q]?(delete n[q],{$error:n}):void 0},r,!0)},t.$getField=function(e){var r=t.$$getRegister(e);if(C(!e||r,"$getField('".concat(e,"') fail to find the matched Field. Maybe it has been unmounted.")),C(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);return H(t.$$registers,function(e,n){var a;if(i||(a=function(e,t){for(var r=t.split(F).map(function(e){return e.trim()}).filter(function(e){return""!==e}),n=0,i=r.length;n1&&void 0!==arguments[1]?arguments[1]:{};return H(e,function(e,r){return R(t,r,e)}),t}},{key:"componentDidMount",value:function(){M(this.props.$ref,this.$formutil)}},{key:"componentDidUpdate",value:function(e){var t=this;M(this.props.$ref,this.$formutil),Q(this.$$triggerChangeTimer),this.$$triggerChangeTimer=Y(function(){t.$$triggerFormChange()})}},{key:"componentWillUnmount",value:function(){M(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}):O(i)?i(e):O(n)?n(e):t.Children.map(n,function(r){return r&&x(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=L(n,function(e,r){var n=r.path,i=r.$state;t&&t(i,n),"$value"in i&&(i.$dirty||!S(i.$value))&&(e[n]=i.$value)}),o=L(n,function(e,t){var r=t.path;t.$state;return r in i&&R(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:L(n,function(e,t){return R(e,t.path,t.$state)}),$params:u({},this.$$defaultValues,o),$errors:L(n,function(e,t){var r=t.path,n=t.$state;n.$invalid&&R(e,r,n.$error)}),$dirts:L(n,function(e,t){return R(e,t.path,t.$state.$dirty)}),$touches:L(n,function(e,t){return R(e,t.path,t.$state.$touched)}),$focuses:L(n,function(e,t){return R(e,t.path,t.$state.$focused)}),$pendings:L(n,function(e,t){return R(e,t.path,t.$state.$pending)}),$weakStates:L(n,function(e,t){var r=t.path,n=t.$state;return e[r]=n}),$weakParams:i,$weakErrors:L(n,function(e,t){var r=t.path,n=t.$state;n.$invalid&&(e[r]=n.$error)}),$weakDirts:L(n,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$dirty}),$weakTouches:L(n,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$touched}),$weakFocuses:L(n,function(e,t){var r=t.path,n=t.$state;return e[r]=n.$focused}),$weakPendings:L(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}();K.displayName="React.Formutil.Form",K.defaultProps={$defaultValues:{},$defaultStates:{}};var W={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},J={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},X={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Z={};function ee(e){return b.isMemo(e)?X:Z[e.$$typeof]||W}Z[b.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var te=Object.defineProperty,re=Object.getOwnPropertyNames,ne=Object.getOwnPropertySymbols,ie=Object.getOwnPropertyDescriptor,oe=Object.getPrototypeOf,ae=Object.prototype;var ue=function e(t,r,n){if("string"!==typeof r){if(ae){var i=oe(r);i&&i!==ae&&e(t,i,n)}var o=re(r);ne&&(o=o.concat(ne(r)));for(var a=ee(t),u=ee(r),s=0;s1&&void 0!==arguments[1]?arguments[1]:{},i=t.forwardRef(function(t,i){var o=Object.assign({},t),a=(t.component,$(t,["component"]));return["$defaultStates","$defaultValues","$onFormChange","$validator","$processer","$ref"].forEach(function(e){e in o&&("$defaultStates"!==e&&"$defaultValues"!==e||(a[e]=u({},n[e],o[e])),delete o[e])}),r.createElement(K,Object.assign({},n,a,{render:function(t){return r.createElement(e,Object.assign({},o,{$formutil:t,ref:i}))}}))});return i.displayName="React.Formutil.withForm."+(e.displayName||e.name||"Anonymous"),ue(i,e)}),le=0,ce={$valid:!0,$invalid:!1,$dirty:!1,$pristine:!0,$touched:!1,$untouched:!0,$focused:!1,$pending:!1,$error:{}};function $e(e){return!0!==e}function fe(e,t,r){C(!S(e),"You should return a string or Error when the validation('".concat(r&&r+": ").concat(t,"') failed, otherwise return true."))}function de(){return le++}function pe(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 $=R(l,o);r=R(s,o)||{},S($)||(r.$value=$)}}var f=n.$defaultValue,d=n.$defaultState;return c(u({},ce,O(d)?d(n):d,{$value:O(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[q];var w=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}));k(i)?t.push(i.catch(function(e){n||s(r,e||r)})):$e(i)&&(y[r]=i||r,fe(i,r,$.name),$.$validateLazy&&(b=!0))}return t},[]),C=function(e){return r(_(t,_(o,e)))};w.length?(m||l(!0),i=function(e){return n=e(C)},w.push(a(u({},v,y))),c=Promise.all(w).then(function(){return n||(e.$shouldCancelPrevAsyncValidate=null,l(!1,C))})):(m&&l(!1),c=a(u({},v,y),C)),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 $e(r)?(i[t]=r||t,fe(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;O(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 he=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.")),C(e,"You should assign a name to , otherwise it will be isolated!"),t.$$register&&t.$$register(e,this.$fieldHandler),this.$prevValue=this.$state.$value,M(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,M(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),M(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}):O(i)?i(e):O(n)?n(e):t.Children.map(n,function(r){return r&&x(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=pe(e,e)),e.$registered=(r.$$registers||{})[e.$fieldHandler.$name]||e.$fieldHandler,t&&(e.$fieldHandler.$$reset(),e.$fieldHandler.$validate()),e._render()})}}]),i}();he.displayName="React.Formutil.Field";var me=A(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.forwardRef(function(t,i){var o=Object.assign({},t),a=(t.component,$(t,["component"]));return["$validators","$asyncValidators","$validateLazy","$reserveOnUnmount","$defaultValue","$defaultState","$onFieldChange","$parser","$formatter","$ref","name"].concat(Object.keys(u({},n.$validators,n.$asyncValidators,o.$validators,o.$asyncValidators))).forEach(function(e){e in o&&("$validators"!==e&&"$asyncValidators"!==e&&"$defaultState"!==e||(a[e]=u({},n[e],o[e])),delete o[e])}),r.createElement(he,Object.assign({},n,a,{render:function(t){return r.createElement(e,Object.assign({},o,{$fieldutil:t,ref:i}))}}))});return i.displayName="React.Formutil.withField."+(e.displayName||e.name||"Anonymous"),ue(i,e)}),ve=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}();ve.displayName="React.Formutil.EasyField.Native",ve.defaultProps={value:"",type:"text",checked:!0,unchecked:!1};var ge=t.createContext({}),ye=ge.Provider,be=ge.Consumer,we=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:Ce,Field:Ve},u=O(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(ye,{value:this.getGroupContext()},this._render())}}]),i}();we.displayName="React.Formutil.EasyField.Group",we.defaultProps={type:"checkbox",groupNode:"div"};var Ce=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(){C("$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(be,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}();Ce.displayName="React.Formutil.EasyField.Group.Option";var Ve=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(){C(!1,'The "Field" property in EasyField\'s children-props has been deprecated. Please use "GroupOption" instead.')}},{key:"render",value:function(){return r.createElement(Ce,this.props)}}]),i}();Ve.displayName="React.Formutil.EasyField.Group.Option.Deprecated";var Fe=Array.isArray,Pe=Object.keys,Se=Object.prototype.hasOwnProperty,Oe="undefined"!==typeof Element;var Ee=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=Fe(t),u=Fe(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=Pe(t);if((i=f.length)!==Pe(r).length)return!1;for(n=i;0!==n--;)if(!Se.call(r,f[n]))return!1;if(Oe&&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}},ke=r.Frament||"div",je=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=[]):Ee(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 E(e)||1*e<=t}],["min",function(e,t){return E(e)||1*e>=t}],["pattern",function(e,t){return E(e)||t.test(e)}],["enum",function(e,t){return E(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},{}),_e={validMessage:{},valuePropName:"value",changePropName:"onChange",focusPropName:"onFocus",blurPropName:"onBlur",$parser:function(e){return"string"===typeof e?e.trim():e}};function Ae(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?we:"list"===m?je:ve,o&&(l.name=o),a&&(l.type=m),t&&(l.children=t),m){case"select":case"textarea":e.multiple&&(i[xe]="array");break;case"group":"checkbox"===v&&(i[xe]="array"),l.type=v;break;case"checkbox":case"radio":i[xe]="checked";break;case"list":i[xe]="array"}}if(!("$defaultValue"in i)&&"defaultValue"in e&&(i.$defaultValue=s),!("$defaultValue"in i)&&xe in i){var g;switch(i[xe]){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 Ne=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=Te(this.props),n=e.fieldProps,i=e.childProps,o=e.renderProps;return r.createElement(he,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):O(i)?i(e):O(o)?o(e):t.Children.map(o,function(r){return t.cloneElement(r,e)})}(Ae(e,n,i),o)}}))}}]),i}();function Re(){if(!r.useState)throw new Error("Hooks api need react@>=16.8, Please upgrade your reactjs.");return(0,r.useContext)(m)}function Me(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=Re(),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(_(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=de(),c.$fieldHandler=s=pe(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,C(!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.")),C(n,"You should pass a name argument to useField(), otherwise it will be isolated!"),function(){c.isMounting=!1,M(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(){M(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})}Ne.displayName="React.Formutil.EasyField",Ne.defaultProps=_e,e.EasyField=Ne,e.Field=he,e.Form=K,e.connect=function(e){var n=t.forwardRef(function(t,n){return r.createElement(m.Consumer,null,function(i){return r.createElement(e,Object.assign({},t,{$formutil:i.$formutil,ref:n}))})});return n.displayName="React.Formutil.connect."+(e.displayName||e.name||"Anonymous"),ue(n,e)},e.useField=Me,e.useForm=function(){return Re().$formutil},e.useHandler=function(e){var t=Te(e=u({},_e,e,{children:null})),r=t.fieldProps,n=t.childProps;return Ae(Me(r),r,n)},e.withField=me,e.withForm=se,Object.defineProperty(e,"__esModule",{value:!0})}); diff --git a/package.json b/package.json index 6a653a5..74395a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-formutil", - "version": "0.6.6", + "version": "0.6.7", "description": "Happy to build the forms in React ^_^", "main": "dist/index.cjs.js", "module": "dist/index.esm.js", diff --git a/src/Form.js b/src/Form.js index c2ad16d..66f6356 100644 --- a/src/Form.js +++ b/src/Form.js @@ -349,10 +349,10 @@ class Form extends Component { const $parsedTree = this.$$deepParseObject($stateTree); utils.objectEach(this.$$registers, (handler, name) => { - const data = name in $stateTree ? $stateTree[name] : utils.parsePath($parsedTree, name); + let pathData; - if (!utils.isUndefined(data) || force) { - const $newState = processer(data, handler); + if (force || (pathData = utils.pathExist($parsedTree, name))) { + const $newState = processer(pathData && pathData.data, handler); if ($newState) { const $prevValue = this.$formutil.$weakParams[name]; diff --git a/src/utils.js b/src/utils.js index bdcd7b2..e524d6e 100644 --- a/src/utils.js +++ b/src/utils.js @@ -184,6 +184,27 @@ export function parsePath(...args) { } } +export function pathExist(scope, path) { + const pathWords = path + .split(PATH_REGEXP) + .map(s => s.trim()) + .filter(item => item !== ''); + + for (let index = 0, len = pathWords.length; index < len; index++) { + const word = executeWord(pathWords[index]); + + if (word in scope) { + if (index + 1 === len) { + return { + data: scope[word] + }; + } + + scope = scope[word]; + } + } +} + export function createRef(ref, value) { if (ref) { if (isFunction(ref)) {