You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

0 lines
6.2 KiB

1 month ago
  1. {"ast":null,"code":"import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';\nimport { componentSizes } from '../../../constants/size.mjs';\nimport { isArray, isString } from '@vue/shared';\nimport { isBoolean } from '../../../utils/types.mjs';\nconst formMetaProps = buildProps({\n size: {\n type: String,\n values: componentSizes\n },\n disabled: Boolean\n});\nconst formProps = buildProps({\n ...formMetaProps,\n model: Object,\n rules: {\n type: definePropType(Object)\n },\n labelPosition: {\n type: String,\n values: [\"left\", \"right\", \"top\"],\n default: \"right\"\n },\n requireAsteriskPosition: {\n type: String,\n values: [\"left\", \"right\"],\n default: \"left\"\n },\n labelWidth: {\n type: [String, Number],\n default: \"\"\n },\n labelSuffix: {\n type: String,\n default: \"\"\n },\n inline: Boolean,\n inlineMessage: Boolean,\n statusIcon: Boolean,\n showMessage: {\n type: Boolean,\n default: true\n },\n validateOnRuleChange: {\n type: Boolean,\n default: true\n },\n hideRequiredAsterisk: Boolean,\n scrollToError: Boolean,\n scrollIntoViewOptions: {\n type: [Object, Boolean]\n }\n});\nconst formEmits = {\n validate: (prop, isValid, message) => (isArray(prop) || isString(prop)) && isBoolean(isValid) && isString(message)\n};\nexport { formEmits, formMetaProps, formProps };","map":{"version":3,"names":["formMetaProps","buildProps","size","type","String","values","componentSizes","disabled","Boolean","formProps","model","Object","rules","definePropType","labelPosition","default","requireAsteriskPosition","labelWidth","Number","labelSuffix","inline","inlineMessage","statusIcon","showMessage","validateOnRuleChange","hideRequiredAsterisk","scrollToError","scrollIntoViewOptions","formEmits","validate","prop","isValid","message","isArray","isString","isBoolean"],"sources":["../../../../../../packages/components/form/src/form.ts"],"sourcesContent":["import { componentSizes } from '@element-plus/constants'\nimport {\n buildProps,\n definePropType,\n isArray,\n isBoolean,\n isString,\n} from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type { FormItemProp } from './form-item'\nimport type { FormRules } from './types'\n\nexport const formMetaProps = buildProps({\n /**\n * @description Control the size of components in this form.\n */\n size: {\n type: String,\n values: componentSizes,\n },\n /**\n * @description Whether to disable all components in this form. If set to `true`, it will override the `disabled` prop of the inner component.\n */\n disabled: Boolean,\n} as const)\n\nexport const formProps = buildProps({\n ...formMetaProps,\n /**\n * @description Data of form component.\n */\n model: Object,\n /**\n * @description Validation rules of form.\n */\n rules: {\n type: definePropType<FormRules>(Object),\n },\n /**\n * @description Position of label. If set to `'left'` or `'right'`, `label-width` prop is also required.\n */\n labelPosition: {\n type: String,\n values: ['left', 'right', 'top'],\n default: 'right',\n },\n /**\n * @description Position of asterisk.\n */\n requireAsteriskPosition: {\n type: String,\n values: ['left', 'right'],\n default: 'left',\n },\n /**\n * @description Width of label, e.g. `'50px'`. All its direct child form items will inherit this value. `auto` is supported.\n */\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description Suffix of the label.\n */\n labelSuffix: {\n type: String,\n default: '',\n },\n /**\n * @description Whether the form is inline.\n */\n inline: Boolean,\n /**\n * @description Whether to display the error message inline with the form item.\n */\n inlineMessage: Boolean,\n /**\n * @description Whether to display an icon indicating the validation result.\n */\n statusIcon: Boolean,\n /**\n * @description Whether to show the error message.\n */\n showMessage: {\n type: Boolean,\n def