UNPKG

tdesign-mobile-vue

Version:
1 lines 65.8 kB
{"version":3,"file":"form-item.mjs","sources":["../../node_modules/lodash/assignInWith.js","../../node_modules/lodash/isError.js","../../node_modules/lodash/attempt.js","../../node_modules/lodash/_baseValues.js","../../node_modules/lodash/_customDefaultsAssignIn.js","../../node_modules/lodash/_escapeStringChar.js","../../node_modules/lodash/_reInterpolate.js","../../node_modules/lodash/_escapeHtmlChar.js","../../node_modules/lodash/escape.js","../../node_modules/lodash/_reEscape.js","../../node_modules/lodash/_reEvaluate.js","../../node_modules/lodash/templateSettings.js","../../node_modules/lodash/template.js","../../src/form/form-item.tsx"],"sourcesContent":["var copyObject = require('./_copyObject'),\n createAssigner = require('./_createAssigner'),\n keysIn = require('./keysIn');\n\n/**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n});\n\nmodule.exports = assignInWith;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike'),\n isPlainObject = require('./isPlainObject');\n\n/** `Object#toString` result references. */\nvar domExcTag = '[object DOMException]',\n errorTag = '[object Error]';\n\n/**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\nfunction isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n}\n\nmodule.exports = isError;\n","var apply = require('./_apply'),\n baseRest = require('./_baseRest'),\n isError = require('./isError');\n\n/**\n * Attempts to invoke `func`, returning either the result or the caught error\n * object. Any additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Function} func The function to attempt.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {*} Returns the `func` result or error object.\n * @example\n *\n * // Avoid throwing errors for invalid selectors.\n * var elements = _.attempt(function(selector) {\n * return document.querySelectorAll(selector);\n * }, '>_>');\n *\n * if (_.isError(elements)) {\n * elements = [];\n * }\n */\nvar attempt = baseRest(function(func, args) {\n try {\n return apply(func, undefined, args);\n } catch (e) {\n return isError(e) ? e : new Error(e);\n }\n});\n\nmodule.exports = attempt;\n","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nmodule.exports = baseValues;\n","var eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\nfunction customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n}\n\nmodule.exports = customDefaultsAssignIn;\n","/** Used to escape characters for inclusion in compiled string literals. */\nvar stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n};\n\n/**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\nfunction escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n}\n\nmodule.exports = escapeStringChar;\n","/** Used to match template delimiters. */\nvar reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\nmodule.exports = reInterpolate;\n","var basePropertyOf = require('./_basePropertyOf');\n\n/** Used to map characters to HTML entities. */\nvar htmlEscapes = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#39;'\n};\n\n/**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\nvar escapeHtmlChar = basePropertyOf(htmlEscapes);\n\nmodule.exports = escapeHtmlChar;\n","var escapeHtmlChar = require('./_escapeHtmlChar'),\n toString = require('./toString');\n\n/** Used to match HTML entities and HTML characters. */\nvar reUnescapedHtml = /[&<>\"']/g,\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n/**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, &amp; pebbles'\n */\nfunction escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n}\n\nmodule.exports = escape;\n","/** Used to match template delimiters. */\nvar reEscape = /<%-([\\s\\S]+?)%>/g;\n\nmodule.exports = reEscape;\n","/** Used to match template delimiters. */\nvar reEvaluate = /<%([\\s\\S]+?)%>/g;\n\nmodule.exports = reEvaluate;\n","var escape = require('./escape'),\n reEscape = require('./_reEscape'),\n reEvaluate = require('./_reEvaluate'),\n reInterpolate = require('./_reInterpolate');\n\n/**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\nvar templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': { 'escape': escape }\n }\n};\n\nmodule.exports = templateSettings;\n","var assignInWith = require('./assignInWith'),\n attempt = require('./attempt'),\n baseValues = require('./_baseValues'),\n customDefaultsAssignIn = require('./_customDefaultsAssignIn'),\n escapeStringChar = require('./_escapeStringChar'),\n isError = require('./isError'),\n isIterateeCall = require('./_isIterateeCall'),\n keys = require('./keys'),\n reInterpolate = require('./_reInterpolate'),\n templateSettings = require('./templateSettings'),\n toString = require('./toString');\n\n/** Error message constants. */\nvar INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n/** Used to match empty string literals in compiled template source. */\nvar reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n/**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\nvar reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n/**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\nvar reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n/** Used to ensure capturing order of template delimiters. */\nvar reNoMatch = /($^)/;\n\n/** Used to match unescaped characters in compiled string literals. */\nvar reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<b><%- value %></b>');\n * compiled({ 'value': '<script>' });\n * // => '<b>&lt;script&gt;</b>'\n *\n * // Use the \"evaluate\" delimiter to execute JavaScript and generate HTML.\n * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');\n * compiled({ 'users': ['fred', 'barney'] });\n * // => '<li>fred</li><li>barney</li>'\n *\n * // Use the internal `print` function in \"evaluate\" delimiters.\n * var compiled = _.template('<% print(\"hello \" + user); %>!');\n * compiled({ 'user': 'barney' });\n * // => 'hello barney!'\n *\n * // Use the ES template literal delimiter as an \"interpolate\" delimiter.\n * // Disable support by replacing the \"interpolate\" delimiter.\n * var compiled = _.template('hello ${ user }!');\n * compiled({ 'user': 'pebbles' });\n * // => 'hello pebbles!'\n *\n * // Use backslashes to treat delimiters as plain text.\n * var compiled = _.template('<%= \"\\\\<%- value %\\\\>\" %>');\n * compiled({ 'value': 'ignored' });\n * // => '<%- value %>'\n *\n * // Use the `imports` option to import `jQuery` as `jq`.\n * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';\n * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });\n * compiled({ 'users': ['fred', 'barney'] });\n * // => '<li>fred</li><li>barney</li>'\n *\n * // Use the `sourceURL` option to specify a custom sourceURL for the template.\n * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });\n * compiled(data);\n * // => Find the source of \"greeting.jst\" under the Sources tab or Resources panel of the web inspector.\n *\n * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.\n * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });\n * compiled.source;\n * // => function(data) {\n * // var __t, __p = '';\n * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';\n * // return __p;\n * // }\n *\n * // Use custom template delimiters.\n * _.templateSettings.interpolate = /{{([\\s\\S]+?)}}/g;\n * var compiled = _.template('hello {{ user }}!');\n * compiled({ 'user': 'mustache' });\n * // => 'hello mustache!'\n *\n * // Use the `source` property to inline compiled templates for meaningful\n * // line numbers in error messages and stack traces.\n * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\\\n * var JST = {\\\n * \"main\": ' + _.template(mainText).source + '\\\n * };\\\n * ');\n */\nfunction template(string, options, guard) {\n // Based on John Resig's `tmpl` implementation\n // (http://ejohn.org/blog/javascript-micro-templating/)\n // and Laura Doktorova's doT.js (https://github.com/olado/doT).\n var settings = templateSettings.imports._.templateSettings || templateSettings;\n\n if (guard && isIterateeCall(string, options, guard)) {\n options = undefined;\n }\n string = toString(string);\n options = assignInWith({}, options, settings, customDefaultsAssignIn);\n\n var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),\n importsKeys = keys(imports),\n importsValues = baseValues(imports, importsKeys);\n\n var isEscaping,\n isEvaluating,\n index = 0,\n interpolate = options.interpolate || reNoMatch,\n source = \"__p += '\";\n\n // Compile the regexp to match each delimiter.\n var reDelimiters = RegExp(\n (options.escape || reNoMatch).source + '|' +\n interpolate.source + '|' +\n (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +\n (options.evaluate || reNoMatch).source + '|$'\n , 'g');\n\n // Use a sourceURL for easier debugging.\n // The sourceURL gets injected into the source that's eval-ed, so be careful\n // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in\n // and escape the comment, thus injecting code that gets evaled.\n var sourceURL = hasOwnProperty.call(options, 'sourceURL')\n ? ('//# sourceURL=' +\n (options.sourceURL + '').replace(/\\s/g, ' ') +\n '\\n')\n : '';\n\n string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {\n interpolateValue || (interpolateValue = esTemplateValue);\n\n // Escape characters that can't be included in string literals.\n source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);\n\n // Replace delimiters with snippets.\n if (escapeValue) {\n isEscaping = true;\n source += \"' +\\n__e(\" + escapeValue + \") +\\n'\";\n }\n if (evaluateValue) {\n isEvaluating = true;\n source += \"';\\n\" + evaluateValue + \";\\n__p += '\";\n }\n if (interpolateValue) {\n source += \"' +\\n((__t = (\" + interpolateValue + \")) == null ? '' : __t) +\\n'\";\n }\n index = offset + match.length;\n\n // The JS engine embedded in Adobe products needs `match` returned in\n // order to produce the correct `offset` value.\n return match;\n });\n\n source += \"';\\n\";\n\n // If `variable` is not specified wrap a with-statement around the generated\n // code to add the data object to the top of the scope chain.\n var variable = hasOwnProperty.call(options, 'variable') && options.variable;\n if (!variable) {\n source = 'with (obj) {\\n' + source + '\\n}\\n';\n }\n // Throw an error if a forbidden character was found in `variable`, to prevent\n // potential command injection attacks.\n else if (reForbiddenIdentifierChars.test(variable)) {\n throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);\n }\n\n // Cleanup code by stripping empty strings.\n source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)\n .replace(reEmptyStringMiddle, '$1')\n .replace(reEmptyStringTrailing, '$1;');\n\n // Frame code as the function body.\n source = 'function(' + (variable || 'obj') + ') {\\n' +\n (variable\n ? ''\n : 'obj || (obj = {});\\n'\n ) +\n \"var __t, __p = ''\" +\n (isEscaping\n ? ', __e = _.escape'\n : ''\n ) +\n (isEvaluating\n ? ', __j = Array.prototype.join;\\n' +\n \"function print() { __p += __j.call(arguments, '') }\\n\"\n : ';\\n'\n ) +\n source +\n 'return __p\\n}';\n\n var result = attempt(function() {\n return Function(importsKeys, sourceURL + 'return ' + source)\n .apply(undefined, importsValues);\n });\n\n // Provide the compiled function's source by its `toString` method or\n // the `source` property as a convenience for inlining compiled templates.\n result.source = source;\n if (isError(result)) {\n throw result;\n }\n return result;\n}\n\nmodule.exports = template;\n","import {\n computed,\n defineComponent,\n inject,\n nextTick,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n watch,\n} from 'vue';\nimport isArray from 'lodash/isArray';\nimport isNumber from 'lodash/isNumber';\nimport isString from 'lodash/isString';\nimport isBoolean from 'lodash/isBoolean';\nimport cloneDeep from 'lodash/cloneDeep';\nimport lodashGet from 'lodash/get';\nimport lodashSet from 'lodash/set';\nimport isNil from 'lodash/isNil';\nimport lodashTemplate from 'lodash/template';\nimport { ChevronRightIcon } from 'tdesign-icons-vue-next';\nimport { validate } from './form-model';\n\nimport {\n AllValidateResult,\n Data,\n FormErrorMessage,\n FormItemValidateMessage,\n FormRule,\n ValidateTriggerType,\n ValueType,\n} from './type';\nimport props from './form-item-props';\nimport {\n AnalysisValidateResult,\n ErrorListType,\n FormInjectionKey,\n FormItemContext,\n FormItemInjectionKey,\n SuccessListType,\n ValidateStatus,\n} from './const';\nimport config from '../config';\nimport { useTNodeJSX } from '../hooks/tnode';\nimport { usePrefixClass } from '../hooks/useClass';\n\nconst { prefix } = config;\n\nexport type FormItemValidateResult<T extends Data = Data> = { [key in keyof T]: boolean | AllValidateResult[] };\n\nexport default defineComponent({\n name: `${prefix}-form-item`,\n props,\n setup(props, { slots }) {\n const renderTNodeJSX = useTNodeJSX();\n const formClass = usePrefixClass('form');\n const formItemClass = usePrefixClass('form__item');\n const { name } = toRefs(props);\n\n const form = inject(FormInjectionKey, undefined);\n\n const extraNode = computed(() => {\n const list = errorList.value;\n if (showErrorMessage.value && list[0]?.message) {\n return list[0]?.message;\n }\n if (successList.value.length) {\n return successList.value[0].message;\n }\n return null;\n });\n\n const formItemClasses = computed(() => [\n formItemClass.value,\n `${formItemClass.value}--bordered`,\n `${formClass.value}--${labelAlign.value}`,\n `${formClass.value}-item__${props.name}`,\n ]);\n\n const needRequiredMark = computed(() => {\n const requiredMark = props.requiredMark ?? form?.requiredMark;\n const isRequired = innerRules.value.filter((rule) => rule.required).length > 0;\n return requiredMark ?? isRequired;\n });\n\n const hasLabel = computed(() => slots.label || props.label);\n const hasColon = computed(() => !!(form?.colon && hasLabel.value));\n const labelClass = `${formClass.value}__label`;\n const labelAlign = computed(() => (isNil(props.labelAlign) ? form?.labelAlign : props.labelAlign));\n const labelWidth = computed(() => (isNil(props.labelWidth) ? form?.labelWidth : props.labelWidth));\n const contentAlign = computed(() => (isNil(props.contentAlign) ? form?.contentAlign : props.contentAlign));\n\n const labelClasses = computed(() => [\n labelClass,\n {\n [`${labelClass}--required`]: needRequiredMark.value,\n [`${labelClass}--colon`]: hasColon.value,\n [`${labelClass}--top`]: hasLabel.value && (labelAlign.value === 'top' || !labelWidth.value),\n [`${labelClass}--left`]: labelAlign.value === 'left' && labelWidth.value,\n [`${labelClass}--right`]: labelAlign.value === 'right' && labelWidth.value,\n },\n ]);\n\n const labelStyle = computed(() => {\n if (labelWidth.value && labelAlign.value !== 'top') {\n return isNumber(labelWidth.value) ? { width: `${labelWidth.value}px` } : { width: labelWidth.value };\n }\n return {};\n });\n\n const freeShowErrorMessage = ref<boolean | undefined>(false);\n const showErrorMessage = computed(() => {\n if (isBoolean(freeShowErrorMessage.value)) return freeShowErrorMessage.value;\n if (isBoolean(props.showErrorMessage)) return props.showErrorMessage;\n return form?.showErrorMessage;\n });\n\n const errorClasses = computed(() => {\n if (!showErrorMessage.value) return '';\n if (!errorList.value.length) return '';\n const type = errorList.value[0].type || 'error';\n return type === 'error' ? `${formItemClass.value}--error` : `${formItemClass.value}--warning`;\n });\n\n const contentClasses = computed(() => [`${formClass.value}__controls`, errorClasses.value]);\n const contentSlotClasses = computed(() => [\n `${formClass.value}__controls-content`,\n `${formClass.value}__controls--${contentAlign.value}`,\n ]);\n\n const contentStyle = computed(() => {\n let contentStyle = {};\n if (labelWidth.value && labelAlign.value !== 'top') {\n if (isNumber(labelWidth.value)) {\n contentStyle = { marginLeft: `${labelWidth.value}px` };\n } else {\n contentStyle = { marginLeft: labelWidth.value };\n }\n }\n\n return contentStyle;\n });\n\n const errorList = ref<ErrorListType[]>([]);\n const successList = ref<SuccessListType[]>([]);\n const verifyStatus = ref(ValidateStatus.TO_BE_VALIDATED);\n const resetValidating = ref(false);\n const needResetField = ref(false);\n\n const resetHandler = () => {\n needResetField.value = false;\n errorList.value = [];\n successList.value = [];\n verifyStatus.value = ValidateStatus.TO_BE_VALIDATED;\n };\n const getEmptyValue = (): ValueType => {\n const type = Object.prototype.toString.call(lodashGet(form?.data, `${props.name}`));\n let emptyValue: ValueType;\n if (type === '[object String]') {\n emptyValue = '';\n }\n if (type === '[object Array]') {\n emptyValue = [];\n }\n if (type === '[object Object]') {\n emptyValue = {};\n }\n return emptyValue;\n };\n const resetField = async (resetType: 'initial' | 'empty' | undefined = form?.resetType): Promise<any> => {\n if (!props.name) return null;\n\n if (resetType === 'empty') {\n // @ts-ignore\n lodashSet(form?.data, props.name, getEmptyValue());\n } else if (resetType === 'initial') {\n // @ts-ignore\n lodashSet(form?.data, props.name, initialValue.value);\n }\n\n await nextTick();\n if (resetValidating.value) {\n needResetField.value = true;\n } else {\n resetHandler();\n }\n };\n\n const errorMessages = computed<FormErrorMessage>(() => form?.errorMessage || {});\n const innerRules = computed<FormRule[]>(() => {\n if (props.rules?.length) return props.rules;\n if (!props.name) return [];\n const index = `${props.name}`.lastIndexOf('.') || -1;\n const pRuleName = `${props.name}`.slice(index + 1);\n return lodashGet(form?.rules, props.name) || lodashGet(form?.rules, pRuleName) || [];\n });\n\n const analysisValidateResult = async (trigger: ValidateTriggerType): Promise<AnalysisValidateResult> => {\n const result: AnalysisValidateResult = {\n successList: [],\n errorList: [],\n rules: [],\n resultList: [],\n allowSetValue: false,\n };\n result.rules =\n trigger === 'all'\n ? innerRules.value\n : innerRules.value.filter((item) => (item.trigger || 'change') === trigger);\n if (innerRules.value.length && !result.rules?.length) {\n return result;\n }\n result.allowSetValue = true;\n result.resultList = await validate(value.value, result.rules);\n result.errorList = result.resultList\n .filter((item) => item.result !== true)\n .map((item) => {\n Object.keys(item).forEach((key) => {\n if (!item.message && errorMessages.value[key]) {\n const compiled = lodashTemplate(errorMessages.value[key]);\n const name = isString(props.label) ? props.label : props.name;\n item.message = compiled({\n name,\n validate: item[key],\n });\n }\n });\n return item as ErrorListType;\n });\n // 仅有自定义校验方法才会存在 successList\n result.successList = result.resultList.filter(\n (item) => item.result === true && item.message && item.type === 'success',\n ) as SuccessListType[];\n return result;\n };\n const validateHandler = async <T extends Data = Data>(\n trigger: ValidateTriggerType,\n showErrorMessage?: boolean,\n ): Promise<FormItemValidateResult<T>> => {\n resetValidating.value = true;\n // undefined | boolean\n freeShowErrorMessage.value = showErrorMessage;\n const {\n successList: innerSuccessList,\n errorList: innerErrorList,\n rules,\n resultList,\n allowSetValue,\n } = await analysisValidateResult(trigger);\n\n if (allowSetValue) {\n successList.value = innerSuccessList || [];\n errorList.value = innerErrorList || [];\n }\n // 根据校验结果设置校验状态\n if (rules.length) {\n verifyStatus.value = innerErrorList?.length ? ValidateStatus.FAIL : ValidateStatus.SUCCESS;\n }\n // 重置处理\n if (needResetField.value) {\n resetHandler();\n }\n resetValidating.value = false;\n\n return {\n [`${name.value}`]: innerErrorList?.length === 0 ? true : resultList,\n } as FormItemValidateResult<T>;\n };\n\n const validateOnly = async <T extends Data>(trigger: ValidateTriggerType): Promise<FormItemValidateResult<T>> => {\n const { errorList: innerErrorList, resultList } = await analysisValidateResult(trigger);\n\n return {\n [props.name]: innerErrorList.length === 0 ? true : resultList,\n } as FormItemValidateResult<T>;\n };\n\n const setValidateMessage = (validateMessage: FormItemValidateMessage[]) => {\n if (!validateMessage && !isArray(validateMessage)) return;\n if (validateMessage.length === 0) {\n errorList.value = [];\n verifyStatus.value = ValidateStatus.SUCCESS;\n }\n errorList.value = validateMessage.map((item) => ({ ...item, result: false }));\n verifyStatus.value = ValidateStatus.FAIL;\n };\n\n const value = computed<ValueType>(() => form?.data && lodashGet(form?.data, `${name.value}`));\n const initialValue = ref<ValueType>(undefined);\n\n const context: FormItemContext = reactive({\n name,\n resetHandler,\n resetField,\n validate: validateHandler,\n validateOnly,\n setValidateMessage,\n });\n\n onMounted(() => {\n initialValue.value = cloneDeep(value.value);\n form?.children.push(context);\n });\n\n onBeforeUnmount(() => {\n if (form) form.children = form?.children.filter((ctx) => ctx !== context);\n });\n\n watch(\n value,\n async () => {\n await validateHandler('change');\n },\n { deep: true },\n );\n\n watch(\n () => [props.name, JSON.stringify(props.rules)].join(','),\n () => {\n validateHandler('change');\n },\n );\n\n const handleBlur = async () => {\n await validateHandler('blur');\n };\n\n provide(FormItemInjectionKey, {\n handleBlur,\n });\n\n return () => {\n const renderRightIconContent = () => {\n if (!props.arrow) {\n return null;\n }\n return <ChevronRightIcon size=\"24px\" style={{ color: 'rgba(0, 0, 0, .4)' }} />;\n };\n const renderLabelContent = () => {\n if (Number(labelWidth.value) === 0) {\n return null;\n }\n return renderTNodeJSX('label');\n };\n const renderHelpNode = () => {\n const helpNode = renderTNodeJSX('help');\n if (!helpNode) {\n return null;\n }\n return (\n <div class={[`${formItemClass.value}-help`, `${formClass.value}__controls--${contentAlign.value}`]}>\n {helpNode}\n </div>\n );\n };\n const renderExtraNode = () => {\n if (!extraNode.value) {\n return null;\n }\n return (\n <div class={[`${formItemClass.value}-extra`, `${formClass.value}__controls--${contentAlign.value}`]}>\n {extraNode.value}\n </div>\n );\n };\n\n return (\n <div class={[...formItemClasses.value, renderHelpNode() ? `${formClass.value}__item-with-help` : '']}>\n <div class={[`${formItemClass.value}-wrap`, `${formItemClass.value}--${labelAlign.value}`]}>\n <div class={labelClasses.value} style={labelStyle.value}>\n <label for={props.for}>{renderLabelContent()}</label>\n </div>\n <div class={contentClasses.value} style={contentStyle.value}>\n <div class={contentSlotClasses.value}>{renderTNodeJSX('default')}</div>\n {renderHelpNode()}\n {renderExtraNode()}\n </div>\n </div>\n {renderRightIconContent()}\n </div>\n );\n };\n },\n});\n"],"names":["copyObject","require$$0","createAssigner","require$$1","keysIn","require$$2","assignInWith","object","source","srcIndex","customizer","assignInWith_1","baseGetTag","isObjectLike","isPlainObject","domExcTag","errorTag","isError","value","tag","message","name","isError_1","apply","baseRest","attempt","func","args","undefined","e","Error","attempt_1","arrayMap","baseValues","props","key","_baseValues","eq","objectProto","Object","prototype","hasOwnProperty","customDefaultsAssignIn","objValue","srcValue","call","_customDefaultsAssignIn","stringEscapes","escapeStringChar","chr","_escapeStringChar","reInterpolate","_reInterpolate","basePropertyOf","htmlEscapes","escapeHtmlChar","_escapeHtmlChar","toString","reUnescapedHtml","reHasUnescapedHtml","RegExp","escape","string","test","replace","_escape","reEscape","_reEscape","reEvaluate","_reEvaluate","require$$3","templateSettings","templateSettings_1","require$$4","require$$5","isIterateeCall","require$$6","keys","require$$7","require$$8","require$$9","require$$10","INVALID_TEMPL_VAR_ERROR_TEXT","reEmptyStringLeading","reEmptyStringMiddle","reEmptyStringTrailing","reForbiddenIdentifierChars","reEsTemplate","reNoMatch","reUnescapedString","template","options","guard","settings","imports","_","importsKeys","importsValues","isEscaping","isEvaluating","index","interpolate","reDelimiters","evaluate","sourceURL","match","escapeValue","interpolateValue","esTemplateValue","evaluateValue","offset","slice","length","variable","result","Function","template_1","prefix","config","defineComponent","setup","slots","_ref","renderTNodeJSX","useTNodeJSX","formClass","usePrefixClass","formItemClass","_toRefs","toRefs","form","inject","FormInjectionKey","extraNode","computed","_list$","list","errorList","showErrorMessage","_list$2","successList","formItemClasses","concat","labelAlign","needRequiredMark","_props2$requiredMark","requiredMark","isRequired","innerRules","filter","rule","required","hasLabel","label","hasColon","colon","labelClass","isNil","labelWidth","contentAlign","labelClasses","_defineProperty","labelStyle","isNumber","width","freeShowErrorMessage","ref","isBoolean","errorClasses","type","contentClasses","contentSlotClasses","contentStyle","marginLeft","verifyStatus","ValidateStatus","TO_BE_VALIDATED","resetValidating","needResetField","resetHandler","getEmptyValue","lodashGet","data","emptyValue","resetField","_ref3","_asyncToGenerator","_regeneratorRuntime","mark","_callee","resetType","_args","arguments","wrap","_callee$","_context","prev","next","abrupt","lodashSet","initialValue","nextTick","stop","errorMessages","errorMessage","_props2$rules","rules","lastIndexOf","pRuleName","analysisValidateResult","_ref4","_callee2","trigger","_result$rules","_callee2$","_context2","resultList","allowSetValue","item","validate","map","forEach","compiled","lodashTemplate","isString","_x","validateHandler","_ref5","_callee3","_yield$analysisValida","innerSuccessList","innerErrorList","_callee3$","_context3","sent","FAIL","SUCCESS","_x2","_x3","validateOnly","_ref7","_callee4","_yield$analysisValida2","_callee4$","_context4","_x4","setValidateMessage","validateMessage","isArray","_objectSpread","context","reactive","onMounted","cloneDeep","children","push","onBeforeUnmount","ctx","watch","_callee5","_callee5$","_context5","deep","JSON","stringify","join","handleBlur","_callee6","_callee6$","_context6","provide","FormItemInjectionKey","renderRightIconContent","arrow","_createVNode","ChevronRightIcon","color","renderLabelContent","Number","renderHelpNode","helpNode","renderExtraNode","_toConsumableArray","for"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAIA,UAAU,GAAGC,WAAwB;AACrCC,EAAAA,cAAc,GAAGC,eAA4B;AAC7CC,EAAAA,MAAM,GAAGC,QAAmB,CAAA;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,cAAY,GAAGJ,cAAc,CAAC,UAASK,MAAM,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAE;EAC/EV,UAAU,CAACQ,MAAM,EAAEJ,MAAM,CAACI,MAAM,CAAC,EAAED,MAAM,EAAEG,UAAU,CAAC,CAAA;AACxD,CAAC,CAAC,CAAA;AAEF,IAAAC,cAAc,GAAGL,cAAY;;ACrC7B,IAAIM,UAAU,GAAGX,WAAwB;AACrCY,EAAAA,YAAY,GAAGV,cAAyB;AACxCW,EAAAA,aAAa,GAAGT,eAA0B,CAAA;;AAE9C;AACA,IAAIU,SAAS,GAAG,uBAAuB;AACnCC,EAAAA,QAAQ,GAAG,gBAAgB,CAAA;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,SAAOA,CAACC,KAAK,EAAE;AACtB,EAAA,IAAI,CAACL,YAAY,CAACK,KAAK,CAAC,EAAE;AACxB,IAAA,OAAO,KAAK,CAAA;AACb,GAAA;AACD,EAAA,IAAIC,GAAG,GAAGP,UAAU,CAACM,KAAK,CAAC,CAAA;EAC3B,OAAOC,GAAG,IAAIH,QAAQ,IAAIG,GAAG,IAAIJ,SAAS,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;AACA,IAAIC,cAAc,GAAGH,WAAW,CAACG,cAAc,CAAA;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASiD,QAAQA,CAAC5B,MAAM,EAAE6B,OAAO,EAAEC,KAAK,EAAE;AAC1C;AACA;AACA;EACE,IAAIC,QAAQ,GAAGtB,gBAAgB,CAACuB,OAAO,CAACC,CAAC,CAACxB,gBAAgB,IAAIA,gBAAgB,CAAA;EAE9E,IAAIqB,KAAK,IAAIjB,cAAc,CAACb,MAAM,EAAE6B,OAAO,EAAEC,KAAK,CAAC,EAAE;AACnDD,IAAAA,OAAO,GAAG/D,SAAS,CAAA;AACpB,GAAA;AACDkC,EAAAA,MAAM,GAAGL,QAAQ,CAACK,MAAM,CAAC,CAAA;EACzB6B,OAAO,GAAGrF,YAAY,CAAC,EAAE,EAAEqF,OAAO,EAAEE,QAAQ,EAAEnD,sBAAsB,CAAC,CAAA;AAErE,EAAA,IAAIoD,OAAO,GAAGxF,YAAY,CAAC,EAAE,EAAEqF,OAAO,CAACG,OAAO,EAAED,QAAQ,CAACC,OAAO,EAAEpD,sBAAsB,CAAC;AACrFsD,IAAAA,WAAW,GAAGnB,IAAI,CAACiB,OAAO,CAAC;AAC3BG,IAAA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