UNPKG

xdesign-vue-next

Version:

XDesign Component for vue-next

1 lines 58.4 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 VNode,\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';\n\nimport { validate } from './form-model';\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 useCLASSNAMES,\n ValidateStatus,\n} from './const';\n\nimport { useConfig, usePrefixClass, useTNodeJSX } from '../hooks';\n\nexport type FormItemValidateResult<T extends Data = Data> = { [key in keyof T]: boolean | AllValidateResult[] };\n\nexport function getFormItemClassName(componentName: string, name?: string) {\n if (!name) return '';\n return `${componentName}__${name}`.replace(/(\\[|\\]\\.)/g, '_');\n}\n\nexport default defineComponent({\n name: 'XFormItem',\n\n props: { ...props },\n setup(props, { slots }) {\n const renderContent = useTNodeJSX();\n const CLASS_NAMES = useCLASSNAMES();\n const { globalConfig } = useConfig('form');\n const form = inject(FormInjectionKey, undefined);\n\n const classPrefix = usePrefixClass();\n const formItemClassPrefix = usePrefixClass('form-item');\n\n const needRequiredMark = computed(() => {\n const requiredMark = props.requiredMark ?? form?.requiredMark ?? globalConfig.value.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 FROM_LABEL = usePrefixClass('form__label');\n const labelAlign = computed(() => (isNil(props.labelAlign) ? form?.labelAlign : props.labelAlign));\n const labelWidth = computed(() => (isNil(props.labelWidth) ? form?.labelWidth : props.labelWidth));\n\n const labelClasses = computed(() => [\n CLASS_NAMES.value.label,\n {\n [`${FROM_LABEL.value}--required`]: needRequiredMark.value,\n [`${FROM_LABEL.value}--colon`]: hasColon.value,\n [`${FROM_LABEL.value}--top`]: hasLabel.value && (labelAlign.value === 'top' || !labelWidth.value),\n [`${FROM_LABEL.value}--left`]: labelAlign.value === 'left' && labelWidth.value,\n [`${FROM_LABEL.value}--right`]: labelAlign.value === 'right' && labelWidth.value,\n },\n ]);\n\n const renderLabel = () => {\n if (Number(labelWidth.value) === 0) return;\n\n let labelStyle = {};\n if (labelWidth.value && labelAlign.value !== 'top') {\n if (isNumber(labelWidth.value)) {\n labelStyle = { width: `${labelWidth.value}px` };\n } else {\n labelStyle = { width: labelWidth.value };\n }\n }\n\n return (\n <div class={labelClasses.value} style={labelStyle}>\n <label for={props.for}>{renderContent('label')}</label>\n </div>\n );\n };\n\n /** Suffix Icon */\n const getDefaultIcon = (): VNode => {\n const resultIcon = (Icon: any) => (\n <span class={CLASS_NAMES.value.status}>\n <Icon />\n </span>\n );\n const list = errorList.value;\n if (verifyStatus.value === ValidateStatus.SUCCESS) {\n return resultIcon(<icon-ri-checkbox-circle-fill />);\n }\n if (list?.[0]) {\n const type = list[0].type || 'error';\n const icon =\n {\n error: <icon-ri-close-circle-fill />,\n warning: <icon-ri-error-warning-fill />,\n }[type] || <icon-ri-checkbox-circle-fill />;\n return resultIcon(icon);\n }\n return null;\n };\n const renderSuffixIcon = () => {\n const { statusIcon } = props;\n if (statusIcon === false) return;\n\n let resultIcon = renderContent('statusIcon', { defaultNode: getDefaultIcon() });\n if (resultIcon) return <span class={CLASS_NAMES.value.status}>{resultIcon}</span>;\n if (resultIcon === false) return;\n\n resultIcon = form?.renderContent('statusIcon', { defaultNode: getDefaultIcon() });\n if (resultIcon) return resultIcon;\n };\n /** Suffix Icon END */\n\n /** Content Style */\n const errorClasses = computed(() => {\n if (!showErrorMessage.value) return '';\n if (verifyStatus.value === ValidateStatus.SUCCESS) {\n return props.successBorder\n ? [CLASS_NAMES.value.success, CLASS_NAMES.value.successBorder].join(' ')\n : CLASS_NAMES.value.success;\n }\n if (!errorList.value.length) return;\n const type = errorList.value[0].type || 'error';\n return type === 'error' ? CLASS_NAMES.value.error : CLASS_NAMES.value.warning;\n });\n const contentClasses = computed(() => [CLASS_NAMES.value.controls, errorClasses.value]);\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 /** Content Style END */\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) => {\n if (!props.name) return;\n\n if (resetType === 'empty') lodashSet(form?.data, props.name, getEmptyValue());\n else if (resetType === 'initial') lodashSet(form?.data, props.name, initialValue.value);\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 ?? globalConfig.value.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: ErrorListType) => {\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;\n });\n // 仅有自定义校验方法才会存在 successList\n result.successList = result.resultList.filter(\n (item) => item.result === true && item.message && item.type === 'success',\n ) as SuccessListType[];\n\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 [props.name]: innerErrorList.length === 0 ? true : resultList,\n } as FormItemValidateResult<T>;\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, props.name));\n const initialValue = ref<ValueType>(undefined);\n const { name } = toRefs(props);\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 freeShowErrorMessage = ref<boolean>(undefined);\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 classes = computed(() => [\n CLASS_NAMES.value.formItem,\n getFormItemClassName(formItemClassPrefix.value, props.name),\n {\n [CLASS_NAMES.value.formItemWithHelp]: helpNode.value,\n [CLASS_NAMES.value.formItemWithExtra]: extraNode.value,\n },\n ]);\n const helpNode = computed<VNode>(() => {\n const help = renderContent('help');\n if (help) return <div class={CLASS_NAMES.value.help}>{help}</div>;\n return null;\n });\n const extraNode = computed<VNode>(() => {\n const getExtraNode = (content: string) => <div class={CLASS_NAMES.value.extra}>{content}</div>;\n const list = errorList.value;\n if (showErrorMessage.value && list?.[0]?.message) {\n return getExtraNode(list[0].message);\n }\n if (successList.value.length) {\n return getExtraNode(successList.value[0].message);\n }\n return null;\n });\n\n const tipsNode = computed<VNode>(() => {\n const tmpTips = renderContent('tips');\n if (!tmpTips) return null;\n const tmpClasses = [\n `${formItemClassPrefix.value}-tips`,\n `${classPrefix.value}-tips`,\n `${classPrefix.value}-is-${props.status || 'default'}`,\n ];\n return <div class={tmpClasses}>{tmpTips}</div>;\n });\n\n const handleBlur = async () => {\n await validateHandler('blur');\n };\n provide(FormItemInjectionKey, {\n handleBlur,\n });\n\n return () => (\n <div class={classes.value}>\n {renderLabel()}\n <div class={contentClasses.value} style={contentStyle.value}>\n <div class={CLASS_NAMES.value.controlsContent}>\n {renderContent('default')}\n {renderSuffixIcon()}\n </div>\n {helpNode.value}\n {tipsNode.value}\n {extraNode.value}\n </div>\n </div>\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","setup","isNil","isNumber","labelStyle","width","_createVNode","_resolveComponent","error","contentStyle","marginLeft","verifyStatus","emptyValue","_args","_regeneratorRuntime","resetType","_context","resetHandler","lodashGet","successList","errorList","rules","resultList","allowSetValue","_context2","isString","item","showErrorMessage","_context4","resetField","validate","validateOnly","setValidateMessage","onMounted","onBeforeUnmount","_context5","deep","watch","_context6","handleBlur"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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