@mcistudio/unoui-vue 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/README.md +95 -0
  2. package/dist/alert/Alert.vue.d.ts +67 -0
  3. package/dist/alert/index.d.ts +40 -0
  4. package/dist/alert/index.js +2 -0
  5. package/dist/attrs.d.ts +11 -0
  6. package/dist/attrs.js +16 -0
  7. package/dist/attrs.js.map +1 -0
  8. package/dist/badge/Badge.vue.d.ts +57 -0
  9. package/dist/badge/BadgeRibbon.vue.d.ts +34 -0
  10. package/dist/badge/index.d.ts +42 -0
  11. package/dist/badge/index.js +2 -0
  12. package/dist/build.d.ts +2 -0
  13. package/dist/button/Button.vue.d.ts +46 -0
  14. package/dist/button/ButtonGroup.vue.d.ts +13 -0
  15. package/dist/button/index.d.ts +13 -0
  16. package/dist/button/index.js +2 -0
  17. package/dist/checkbox/Checkbox.vue.d.ts +47 -0
  18. package/dist/checkbox/CheckboxGroup.vue.d.ts +38 -0
  19. package/dist/checkbox/index.d.ts +30 -0
  20. package/dist/checkbox/index.js +2 -0
  21. package/dist/chunks/Progress-BL4KZ3HE.js +271 -0
  22. package/dist/chunks/Progress-BL4KZ3HE.js.map +1 -0
  23. package/dist/chunks/Skeleton-ohStUD4M.js +153 -0
  24. package/dist/chunks/Skeleton-ohStUD4M.js.map +1 -0
  25. package/dist/chunks/Table-DhXmuKQd.js +330 -0
  26. package/dist/chunks/Table-DhXmuKQd.js.map +1 -0
  27. package/dist/chunks/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
  28. package/dist/chunks/alert-CczW_DKs.js +190 -0
  29. package/dist/chunks/alert-CczW_DKs.js.map +1 -0
  30. package/dist/chunks/badge-BHOZeImh.js +287 -0
  31. package/dist/chunks/badge-BHOZeImh.js.map +1 -0
  32. package/dist/chunks/button-pDObrN_X.js +168 -0
  33. package/dist/chunks/button-pDObrN_X.js.map +1 -0
  34. package/dist/chunks/checkbox-9_0oR4kg.js +260 -0
  35. package/dist/chunks/checkbox-9_0oR4kg.js.map +1 -0
  36. package/dist/chunks/colorpicker-CcizUCQv.js +594 -0
  37. package/dist/chunks/colorpicker-CcizUCQv.js.map +1 -0
  38. package/dist/chunks/datepicker-Cy808x7X.js +1414 -0
  39. package/dist/chunks/datepicker-Cy808x7X.js.map +1 -0
  40. package/dist/chunks/drawer-C3JZ28Xo.js +193 -0
  41. package/dist/chunks/drawer-C3JZ28Xo.js.map +1 -0
  42. package/dist/chunks/dropdown-0l967g7D.js +329 -0
  43. package/dist/chunks/dropdown-0l967g7D.js.map +1 -0
  44. package/dist/chunks/form-Qeqkd-HH.js +642 -0
  45. package/dist/chunks/form-Qeqkd-HH.js.map +1 -0
  46. package/dist/chunks/input-BDOXVCrK.js +1281 -0
  47. package/dist/chunks/input-BDOXVCrK.js.map +1 -0
  48. package/dist/chunks/inputOtp-Dyxj9lNj.js +261 -0
  49. package/dist/chunks/inputOtp-Dyxj9lNj.js.map +1 -0
  50. package/dist/chunks/message-xPfuG0EX.js +107 -0
  51. package/dist/chunks/message-xPfuG0EX.js.map +1 -0
  52. package/dist/chunks/millercolumns-Dp3fBrq6.js +426 -0
  53. package/dist/chunks/millercolumns-Dp3fBrq6.js.map +1 -0
  54. package/dist/chunks/modal-D6l1iIvE.js +81 -0
  55. package/dist/chunks/modal-D6l1iIvE.js.map +1 -0
  56. package/dist/chunks/pagination-Bc583AQX.js +265 -0
  57. package/dist/chunks/pagination-Bc583AQX.js.map +1 -0
  58. package/dist/chunks/popconfirm-D6lUfSxG.js +343 -0
  59. package/dist/chunks/popconfirm-D6lUfSxG.js.map +1 -0
  60. package/dist/chunks/qrcode-B0t_pZna.js +1099 -0
  61. package/dist/chunks/qrcode-B0t_pZna.js.map +1 -0
  62. package/dist/chunks/radio-DnYm59xH.js +477 -0
  63. package/dist/chunks/radio-DnYm59xH.js.map +1 -0
  64. package/dist/chunks/rate-0sme__Kb.js +309 -0
  65. package/dist/chunks/rate-0sme__Kb.js.map +1 -0
  66. package/dist/chunks/select-ChTfQM5u.js +417 -0
  67. package/dist/chunks/select-ChTfQM5u.js.map +1 -0
  68. package/dist/chunks/slider-C-W5GzTP.js +724 -0
  69. package/dist/chunks/slider-C-W5GzTP.js.map +1 -0
  70. package/dist/chunks/splitter-CgfiXY65.js +524 -0
  71. package/dist/chunks/splitter-CgfiXY65.js.map +1 -0
  72. package/dist/chunks/switch-BULGbODP.js +327 -0
  73. package/dist/chunks/switch-BULGbODP.js.map +1 -0
  74. package/dist/chunks/tab-Dxfg1_To.js +663 -0
  75. package/dist/chunks/tab-Dxfg1_To.js.map +1 -0
  76. package/dist/chunks/tag-BYmNsrZC.js +167 -0
  77. package/dist/chunks/tag-BYmNsrZC.js.map +1 -0
  78. package/dist/chunks/timepicker-DsGIdcf8.js +1059 -0
  79. package/dist/chunks/timepicker-DsGIdcf8.js.map +1 -0
  80. package/dist/chunks/tooltip-DMhiAqto.js +242 -0
  81. package/dist/chunks/tooltip-DMhiAqto.js.map +1 -0
  82. package/dist/colorpicker/ColorPicker.vue.d.ts +30 -0
  83. package/dist/colorpicker/color.d.ts +56 -0
  84. package/dist/colorpicker/color.js +99 -0
  85. package/dist/colorpicker/color.js.map +1 -0
  86. package/dist/colorpicker/index.d.ts +12 -0
  87. package/dist/colorpicker/index.js +2 -0
  88. package/dist/config.d.ts +55 -0
  89. package/dist/config.js +260 -0
  90. package/dist/config.js.map +1 -0
  91. package/dist/datepicker/DatePicker.vue.d.ts +82 -0
  92. package/dist/datepicker/RangePicker.vue.d.ts +87 -0
  93. package/dist/datepicker/index.d.ts +59 -0
  94. package/dist/datepicker/index.js +2 -0
  95. package/dist/drawer/Drawer.vue.d.ts +86 -0
  96. package/dist/drawer/index.d.ts +23 -0
  97. package/dist/drawer/index.js +2 -0
  98. package/dist/dropdown/Dropdown.vue.d.ts +118 -0
  99. package/dist/dropdown/index.d.ts +2 -0
  100. package/dist/dropdown/index.js +2 -0
  101. package/dist/form/Form.vue.d.ts +170 -0
  102. package/dist/form/FormItem.vue.d.ts +83 -0
  103. package/dist/form/index.d.ts +176 -0
  104. package/dist/form/index.js +2 -0
  105. package/dist/index.d.ts +31 -0
  106. package/dist/index.js +32 -0
  107. package/dist/input/Autocomplete.vue.d.ts +121 -0
  108. package/dist/input/Input.vue.d.ts +142 -0
  109. package/dist/input/InputI18n.vue.d.ts +80 -0
  110. package/dist/input/InputTag.vue.d.ts +114 -0
  111. package/dist/input/index.d.ts +41 -0
  112. package/dist/input/index.js +2 -0
  113. package/dist/inputOtp/InputOtp.vue.d.ts +60 -0
  114. package/dist/inputOtp/index.d.ts +21 -0
  115. package/dist/inputOtp/index.js +2 -0
  116. package/dist/message/MessageContainer.vue.d.ts +11 -0
  117. package/dist/message/index.d.ts +20 -0
  118. package/dist/message/index.js +2 -0
  119. package/dist/message/types.d.ts +25 -0
  120. package/dist/millercolumns/MillerColumns.vue.d.ts +88 -0
  121. package/dist/millercolumns/index.d.ts +39 -0
  122. package/dist/millercolumns/index.js +2 -0
  123. package/dist/modal/Modal.vue.d.ts +54 -0
  124. package/dist/modal/index.d.ts +2 -0
  125. package/dist/modal/index.js +2 -0
  126. package/dist/pagination/Pagination.vue.d.ts +70 -0
  127. package/dist/pagination/index.d.ts +12 -0
  128. package/dist/pagination/index.js +2 -0
  129. package/dist/popconfirm/Popconfirm.vue.d.ts +104 -0
  130. package/dist/popconfirm/index.d.ts +36 -0
  131. package/dist/popconfirm/index.js +2 -0
  132. package/dist/progress/Progress.vue.d.ts +64 -0
  133. package/dist/progress/index.d.ts +26 -0
  134. package/dist/progress/index.js +2 -0
  135. package/dist/qrcode/QRCode.vue.d.ts +87 -0
  136. package/dist/qrcode/index.d.ts +43 -0
  137. package/dist/qrcode/index.js +2 -0
  138. package/dist/qrcode/qr.d.ts +51 -0
  139. package/dist/qrcode/qrcodegen.d.ts +94 -0
  140. package/dist/radio/Radio.vue.d.ts +52 -0
  141. package/dist/radio/RadioGroup.vue.d.ts +44 -0
  142. package/dist/radio/index.d.ts +55 -0
  143. package/dist/radio/index.js +2 -0
  144. package/dist/rate/Rate.vue.d.ts +100 -0
  145. package/dist/rate/index.d.ts +38 -0
  146. package/dist/rate/index.js +2 -0
  147. package/dist/select/Select.vue.d.ts +129 -0
  148. package/dist/select/index.d.ts +33 -0
  149. package/dist/select/index.js +2 -0
  150. package/dist/skeleton/Skeleton.vue.d.ts +31 -0
  151. package/dist/skeleton/index.d.ts +2 -0
  152. package/dist/skeleton/index.js +2 -0
  153. package/dist/slider/Slider.vue.d.ts +81 -0
  154. package/dist/slider/index.d.ts +61 -0
  155. package/dist/slider/index.js +2 -0
  156. package/dist/splitter/Splitter.vue.d.ts +63 -0
  157. package/dist/splitter/SplitterPanel.vue.d.ts +53 -0
  158. package/dist/splitter/index.d.ts +39 -0
  159. package/dist/splitter/index.js +2 -0
  160. package/dist/style.css +2 -0
  161. package/dist/switch/Switch.vue.d.ts +97 -0
  162. package/dist/switch/index.d.ts +31 -0
  163. package/dist/switch/index.js +2 -0
  164. package/dist/tab/TabPane.vue.d.ts +32 -0
  165. package/dist/tab/Tabs.vue.d.ts +87 -0
  166. package/dist/tab/index.d.ts +78 -0
  167. package/dist/tab/index.js +2 -0
  168. package/dist/table/Table.vue.d.ts +96 -0
  169. package/dist/table/index.d.ts +3 -0
  170. package/dist/table/index.js +2 -0
  171. package/dist/table/types.d.ts +35 -0
  172. package/dist/table/types.js +0 -0
  173. package/dist/tag/Tag.vue.d.ts +46 -0
  174. package/dist/tag/index.d.ts +11 -0
  175. package/dist/tag/index.js +2 -0
  176. package/dist/timepicker/TimePicker.vue.d.ts +92 -0
  177. package/dist/timepicker/TimeRangePicker.vue.d.ts +90 -0
  178. package/dist/timepicker/index.d.ts +39 -0
  179. package/dist/timepicker/index.js +2 -0
  180. package/dist/tooltip/Tooltip.vue.d.ts +79 -0
  181. package/dist/tooltip/index.d.ts +14 -0
  182. package/dist/tooltip/index.js +2 -0
  183. package/dist/uno.d.ts +32 -0
  184. package/dist/uno.js +83 -0
  185. package/dist/uno.js.map +1 -0
  186. package/dist/utils/DnD.d.ts +38 -0
  187. package/package.json +115 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-Qeqkd-HH.js","names":["$slots"],"sources":["../../src/form/Form.vue","../../src/form/Form.vue","../../src/form/FormItem.vue","../../src/form/FormItem.vue","../../src/form/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ValidateFieldsError, Values } from 'async-validator'\nimport { clsx } from 'clsx'\nimport { computed, nextTick, provide, ref, shallowRef, toRef, useAttrs, watch } from 'vue'\nimport type { CSSProperties } from 'vue'\n\nimport { getUiExposeAttrs } from '../attrs'\nimport { defaultFormValidateMessages, formContextKey, formRoot, getValueByPath, normalizeFormProp, normalizeRules, setValueByPath, type FormContext, type FormItemContext, type FormItemRule, type FormLabelPosition, type FormProp, type FormRules, type FormSize, type FormValidateCallback, type FormValidateTrigger } from '.'\n\ndefineOptions({\n inheritAttrs: false\n})\n\nconst props = withDefaults(\n defineProps<{\n /** model 是表单数据对象,字段校验会按 prop 从该对象取值。 */\n model?: Values\n /** rules 是表单级校验规则,语法兼容 async-validator,并扩展 preset/trigger。 */\n rules?: FormRules\n /** inline 表示行内表单布局。 */\n inline?: boolean\n /** labelPosition 是标签位置,支持 left/right/top。 */\n labelPosition?: FormLabelPosition\n /** labelWidth 是非 top 布局下的标签列宽。 */\n labelWidth?: string | number\n /** reserveLabelSpace 控制无 label 的 FormItem 是否保留标签列。 */\n reserveLabelSpace?: boolean\n /** itemGap 是字段之间的纵向间距,支持数字像素值或 CSS 长度。 */\n itemGap?: string | number\n /** size 统一控制 FormItem 标签尺寸,默认 md。 */\n size?: FormSize\n /** disabled 统一设置表单禁用语义,具体控件仍需绑定自身 disabled。 */\n disabled?: boolean\n /** showMessage 是否显示 FormItem 错误消息。 */\n showMessage?: boolean\n /** validateTrigger 设置字段默认自动校验时机;空数组表示仅显式校验。 */\n validateTrigger?: FormValidateTrigger | FormValidateTrigger[]\n /** validateOnRuleChange 是否在 rules 变化时重新校验。 */\n validateOnRuleChange?: boolean\n /** requireAsteriskPosition 设置必填星号位置。 */\n requireAsteriskPosition?: 'left' | 'right'\n /** hideRequiredAsterisk 是否隐藏必填星号。 */\n hideRequiredAsterisk?: boolean\n }>(),\n {\n model: undefined,\n rules: undefined,\n inline: false,\n labelPosition: 'right',\n labelWidth: '96px',\n reserveLabelSpace: true,\n itemGap: '16px',\n size: 'md',\n disabled: false,\n showMessage: true,\n validateTrigger: () => ['change', 'blur'],\n validateOnRuleChange: true,\n requireAsteriskPosition: 'left',\n hideRequiredAsterisk: false\n }\n)\n\nconst emit = defineEmits<{\n (e: 'validate', prop: FormProp | undefined, valid: boolean, message: string): void\n (e: 'submit', event: SubmitEvent): void\n (e: 'reset', event: Event): void\n}>()\n\nconst attrs = useAttrs()\nconst fields = shallowRef<FormItemContext[]>([])\n\nconst rootClass = computed(() => clsx(attrs.class as string | undefined, formRoot({ inline: props.inline, size: props.size, disabled: props.disabled })))\nconst rootStyle = computed<CSSProperties>(() => ({\n ...(attrs.style as CSSProperties | undefined),\n '--ui-form-item-gap': typeof props.itemGap === 'number' ? `${props.itemGap}px` : props.itemGap\n}))\n\nfunction getLabelWidthValue() {\n if (props.labelPosition === 'top') return 'auto'\n return typeof props.labelWidth === 'number' ? `${props.labelWidth}px` : props.labelWidth\n}\n\nfunction getFieldRules(prop?: FormProp, localRules?: FormItemRule) {\n const normalizedProp = normalizeFormProp(prop)\n return [...normalizeRules(normalizedProp ? props.rules?.[normalizedProp] : undefined), ...normalizeRules(localRules)]\n}\n\nfunction getFieldValue(prop?: FormProp) {\n return getValueByPath(props.model, prop)\n}\n\nfunction setFieldValue(prop: FormProp | undefined, value: unknown) {\n setValueByPath(props.model, prop, value)\n}\n\nfunction getTargetFields(propsValue?: FormProp | FormProp[]) {\n if (!propsValue) return [...fields.value]\n const propList = (Array.isArray(propsValue) && typeof propsValue[0] !== 'string' ? propsValue : [propsValue]) as FormProp[]\n const propSet = new Set(propList.map((prop) => normalizeFormProp(prop)))\n return fields.value.filter((field) => field.prop && propSet.has(normalizeFormProp(field.prop)))\n}\n\nasync function validateField(propsValue?: FormProp | FormProp[], callback?: FormValidateCallback) {\n const targetFields = getTargetFields(propsValue)\n const invalidFields: ValidateFieldsError = {}\n let valid = true\n\n for (const field of targetFields) {\n const result = await field.validate()\n const prop = normalizeFormProp(field.prop)\n if (!result.valid && prop) {\n valid = false\n invalidFields[prop] = result.errors ?? []\n }\n }\n\n await callback?.(valid, valid ? undefined : invalidFields)\n return valid\n}\n\nfunction clearValidate(propsValue?: FormProp | FormProp[]) {\n getTargetFields(propsValue).forEach((field) => field.clearValidate())\n}\n\nfunction resetFields(propsValue?: FormProp | FormProp[]) {\n getTargetFields(propsValue).forEach((field) => field.resetField())\n}\n\nfunction registerField(field: FormItemContext) {\n fields.value = [...fields.value, field]\n}\n\nfunction unregisterField(field: FormItemContext) {\n fields.value = fields.value.filter((item) => item !== field)\n}\n\nfunction emitValidate(prop: FormProp | undefined, valid: boolean, message: string) {\n emit('validate', prop, valid, message)\n}\n\nfunction handleSubmit(event: SubmitEvent) {\n emit('submit', event)\n}\n\nfunction handleReset(event: Event) {\n resetFields()\n emit('reset', event)\n}\n\nwatch(\n () => props.rules,\n () => {\n if (props.validateOnRuleChange) void nextTick(() => validateField())\n },\n { deep: true }\n)\n\nprovide<FormContext>(formContextKey, {\n get model() {\n return props.model\n },\n get rules() {\n return props.rules\n },\n size: toRef(props, 'size'),\n disabled: toRef(props, 'disabled'),\n inline: toRef(props, 'inline'),\n labelPosition: toRef(props, 'labelPosition'),\n labelWidth: computed(getLabelWidthValue),\n reserveLabelSpace: toRef(props, 'reserveLabelSpace'),\n itemGap: toRef(props, 'itemGap'),\n showMessage: toRef(props, 'showMessage'),\n validateTrigger: toRef(props, 'validateTrigger'),\n requireAsteriskPosition: toRef(props, 'requireAsteriskPosition'),\n hideRequiredAsterisk: toRef(props, 'hideRequiredAsterisk'),\n validateOnRuleChange: toRef(props, 'validateOnRuleChange'),\n registerField,\n unregisterField,\n getFieldRules,\n getFieldValue,\n setFieldValue,\n validateField,\n clearValidate,\n resetFields,\n emitValidate\n})\n\ndefineExpose({\n validate: (callback?: FormValidateCallback) => validateField(undefined, callback),\n validateField,\n resetFields,\n clearValidate,\n fields,\n defaultValidateMessages: ref(defaultFormValidateMessages)\n})\n</script>\n\n<template>\n <form v-bind=\"getUiExposeAttrs(attrs)\" :class=\"rootClass\" :style=\"rootStyle\" :data-disabled=\"disabled || undefined\" @submit=\"handleSubmit\" @reset=\"handleReset\">\n <slot></slot>\n </form>\n</template>\n","<script setup lang=\"ts\">\nimport type { ValidateFieldsError, Values } from 'async-validator'\nimport { clsx } from 'clsx'\nimport { computed, nextTick, provide, ref, shallowRef, toRef, useAttrs, watch } from 'vue'\nimport type { CSSProperties } from 'vue'\n\nimport { getUiExposeAttrs } from '../attrs'\nimport { defaultFormValidateMessages, formContextKey, formRoot, getValueByPath, normalizeFormProp, normalizeRules, setValueByPath, type FormContext, type FormItemContext, type FormItemRule, type FormLabelPosition, type FormProp, type FormRules, type FormSize, type FormValidateCallback, type FormValidateTrigger } from '.'\n\ndefineOptions({\n inheritAttrs: false\n})\n\nconst props = withDefaults(\n defineProps<{\n /** model 是表单数据对象,字段校验会按 prop 从该对象取值。 */\n model?: Values\n /** rules 是表单级校验规则,语法兼容 async-validator,并扩展 preset/trigger。 */\n rules?: FormRules\n /** inline 表示行内表单布局。 */\n inline?: boolean\n /** labelPosition 是标签位置,支持 left/right/top。 */\n labelPosition?: FormLabelPosition\n /** labelWidth 是非 top 布局下的标签列宽。 */\n labelWidth?: string | number\n /** reserveLabelSpace 控制无 label 的 FormItem 是否保留标签列。 */\n reserveLabelSpace?: boolean\n /** itemGap 是字段之间的纵向间距,支持数字像素值或 CSS 长度。 */\n itemGap?: string | number\n /** size 统一控制 FormItem 标签尺寸,默认 md。 */\n size?: FormSize\n /** disabled 统一设置表单禁用语义,具体控件仍需绑定自身 disabled。 */\n disabled?: boolean\n /** showMessage 是否显示 FormItem 错误消息。 */\n showMessage?: boolean\n /** validateTrigger 设置字段默认自动校验时机;空数组表示仅显式校验。 */\n validateTrigger?: FormValidateTrigger | FormValidateTrigger[]\n /** validateOnRuleChange 是否在 rules 变化时重新校验。 */\n validateOnRuleChange?: boolean\n /** requireAsteriskPosition 设置必填星号位置。 */\n requireAsteriskPosition?: 'left' | 'right'\n /** hideRequiredAsterisk 是否隐藏必填星号。 */\n hideRequiredAsterisk?: boolean\n }>(),\n {\n model: undefined,\n rules: undefined,\n inline: false,\n labelPosition: 'right',\n labelWidth: '96px',\n reserveLabelSpace: true,\n itemGap: '16px',\n size: 'md',\n disabled: false,\n showMessage: true,\n validateTrigger: () => ['change', 'blur'],\n validateOnRuleChange: true,\n requireAsteriskPosition: 'left',\n hideRequiredAsterisk: false\n }\n)\n\nconst emit = defineEmits<{\n (e: 'validate', prop: FormProp | undefined, valid: boolean, message: string): void\n (e: 'submit', event: SubmitEvent): void\n (e: 'reset', event: Event): void\n}>()\n\nconst attrs = useAttrs()\nconst fields = shallowRef<FormItemContext[]>([])\n\nconst rootClass = computed(() => clsx(attrs.class as string | undefined, formRoot({ inline: props.inline, size: props.size, disabled: props.disabled })))\nconst rootStyle = computed<CSSProperties>(() => ({\n ...(attrs.style as CSSProperties | undefined),\n '--ui-form-item-gap': typeof props.itemGap === 'number' ? `${props.itemGap}px` : props.itemGap\n}))\n\nfunction getLabelWidthValue() {\n if (props.labelPosition === 'top') return 'auto'\n return typeof props.labelWidth === 'number' ? `${props.labelWidth}px` : props.labelWidth\n}\n\nfunction getFieldRules(prop?: FormProp, localRules?: FormItemRule) {\n const normalizedProp = normalizeFormProp(prop)\n return [...normalizeRules(normalizedProp ? props.rules?.[normalizedProp] : undefined), ...normalizeRules(localRules)]\n}\n\nfunction getFieldValue(prop?: FormProp) {\n return getValueByPath(props.model, prop)\n}\n\nfunction setFieldValue(prop: FormProp | undefined, value: unknown) {\n setValueByPath(props.model, prop, value)\n}\n\nfunction getTargetFields(propsValue?: FormProp | FormProp[]) {\n if (!propsValue) return [...fields.value]\n const propList = (Array.isArray(propsValue) && typeof propsValue[0] !== 'string' ? propsValue : [propsValue]) as FormProp[]\n const propSet = new Set(propList.map((prop) => normalizeFormProp(prop)))\n return fields.value.filter((field) => field.prop && propSet.has(normalizeFormProp(field.prop)))\n}\n\nasync function validateField(propsValue?: FormProp | FormProp[], callback?: FormValidateCallback) {\n const targetFields = getTargetFields(propsValue)\n const invalidFields: ValidateFieldsError = {}\n let valid = true\n\n for (const field of targetFields) {\n const result = await field.validate()\n const prop = normalizeFormProp(field.prop)\n if (!result.valid && prop) {\n valid = false\n invalidFields[prop] = result.errors ?? []\n }\n }\n\n await callback?.(valid, valid ? undefined : invalidFields)\n return valid\n}\n\nfunction clearValidate(propsValue?: FormProp | FormProp[]) {\n getTargetFields(propsValue).forEach((field) => field.clearValidate())\n}\n\nfunction resetFields(propsValue?: FormProp | FormProp[]) {\n getTargetFields(propsValue).forEach((field) => field.resetField())\n}\n\nfunction registerField(field: FormItemContext) {\n fields.value = [...fields.value, field]\n}\n\nfunction unregisterField(field: FormItemContext) {\n fields.value = fields.value.filter((item) => item !== field)\n}\n\nfunction emitValidate(prop: FormProp | undefined, valid: boolean, message: string) {\n emit('validate', prop, valid, message)\n}\n\nfunction handleSubmit(event: SubmitEvent) {\n emit('submit', event)\n}\n\nfunction handleReset(event: Event) {\n resetFields()\n emit('reset', event)\n}\n\nwatch(\n () => props.rules,\n () => {\n if (props.validateOnRuleChange) void nextTick(() => validateField())\n },\n { deep: true }\n)\n\nprovide<FormContext>(formContextKey, {\n get model() {\n return props.model\n },\n get rules() {\n return props.rules\n },\n size: toRef(props, 'size'),\n disabled: toRef(props, 'disabled'),\n inline: toRef(props, 'inline'),\n labelPosition: toRef(props, 'labelPosition'),\n labelWidth: computed(getLabelWidthValue),\n reserveLabelSpace: toRef(props, 'reserveLabelSpace'),\n itemGap: toRef(props, 'itemGap'),\n showMessage: toRef(props, 'showMessage'),\n validateTrigger: toRef(props, 'validateTrigger'),\n requireAsteriskPosition: toRef(props, 'requireAsteriskPosition'),\n hideRequiredAsterisk: toRef(props, 'hideRequiredAsterisk'),\n validateOnRuleChange: toRef(props, 'validateOnRuleChange'),\n registerField,\n unregisterField,\n getFieldRules,\n getFieldValue,\n setFieldValue,\n validateField,\n clearValidate,\n resetFields,\n emitValidate\n})\n\ndefineExpose({\n validate: (callback?: FormValidateCallback) => validateField(undefined, callback),\n validateField,\n resetFields,\n clearValidate,\n fields,\n defaultValidateMessages: ref(defaultFormValidateMessages)\n})\n</script>\n\n<template>\n <form v-bind=\"getUiExposeAttrs(attrs)\" :class=\"rootClass\" :style=\"rootStyle\" :data-disabled=\"disabled || undefined\" @submit=\"handleSubmit\" @reset=\"handleReset\">\n <slot></slot>\n </form>\n</template>\n","<script setup lang=\"ts\">\nimport type { ValidateOption } from 'async-validator'\nimport { clsx } from 'clsx'\nimport { cloneVNode, computed, defineComponent, getCurrentInstance, inject, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, toRaw, useAttrs, useSlots, watch } from 'vue'\nimport type { CSSProperties, VNode } from 'vue'\n\nimport { formContextKey, formItem, formItemContent, formItemLabel, formItemMessage, normalizeFormProp, validateFormValue, type FormItemContext, type FormItemRule, type FormLabelPosition, type FormProp, type FormSize, type FormValidateStatus, type FormValidateTrigger } from '.'\nimport { getUiExposeAttrs } from '../attrs'\nimport { Tooltip } from '../tooltip'\n\ndefineOptions({\n inheritAttrs: false\n})\n\nconst props = withDefaults(\n defineProps<{\n /** prop 是 model 字段路径,支持 a.b 或路径数组。 */\n prop?: FormProp\n /** label 是字段标签文本,可选。 */\n label?: string\n /** info 是显示在 label 旁的信息提示内容。 */\n info?: string\n /** rules 是字段局部规则,会与 Form.rules[prop] 合并。 */\n rules?: FormItemRule\n /** required 可单独控制必填星号;未设置时从规则推导。 */\n required?: boolean\n /** error 是外部传入的错误消息,会覆盖内部校验结果。 */\n error?: string\n /** validateStatus 是外部传入的校验状态。 */\n validateStatus?: FormValidateStatus\n /** showMessage 是否显示本字段错误消息,默认继承 Form。 */\n showMessage?: boolean\n /** validateTrigger 覆盖 Form 的自动校验时机;空数组表示仅显式校验。 */\n validateTrigger?: FormValidateTrigger | FormValidateTrigger[]\n /** labelWidth 覆盖 Form.labelWidth。 */\n labelWidth?: string | number\n /** reserveLabelSpace 控制无 label 时是否保留标签列,默认继承 Form。 */\n reserveLabelSpace?: boolean\n /** labelPosition 覆盖 Form.labelPosition。 */\n labelPosition?: FormLabelPosition\n /** size 覆盖 Form.size。 */\n size?: FormSize\n }>(),\n {\n prop: undefined,\n label: '',\n info: '',\n rules: undefined,\n required: undefined,\n error: '',\n validateStatus: '',\n showMessage: undefined,\n validateTrigger: undefined,\n labelWidth: undefined,\n reserveLabelSpace: undefined,\n labelPosition: undefined,\n size: undefined\n }\n)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\nconst instance = getCurrentInstance()\nconst form = inject(formContextKey, undefined)\nconst validateState = ref<FormValidateStatus>('')\nconst validateMessage = ref('')\nconst localInitialValue = shallowRef<unknown>()\nconst localInitialValueReady = ref(false)\n\nconst currentSize = computed(() => props.size ?? form?.size.value ?? 'md')\nconst currentLabelPosition = computed(() => props.labelPosition ?? form?.labelPosition.value ?? 'right')\nconst currentLabelWidth = computed(() => {\n if (currentLabelPosition.value === 'top') return 'auto'\n const width = props.labelWidth ?? form?.labelWidth.value ?? '96px'\n return typeof width === 'number' ? `${width}px` : width\n})\nconst currentShowMessage = computed(() => props.showMessage ?? form?.showMessage.value ?? true)\nconst currentValidateTriggers = computed<FormValidateTrigger[]>(() => {\n const triggers = props.validateTrigger ?? form?.validateTrigger.value ?? ['change', 'blur']\n return Array.isArray(triggers) ? triggers : [triggers]\n})\nconst fieldRules = computed(() => form?.getFieldRules(props.prop, props.rules) ?? [])\nconst isRequired = computed(() => props.required ?? fieldRules.value.some((rule) => rule.required))\nconst showRequiredAsterisk = computed(() => isRequired.value && !(form?.hideRequiredAsterisk.value ?? false))\nconst hasOwnReserveLabelSpace = computed(() => {\n const vnodeProps = instance?.vnode.props\n return !!vnodeProps && ('reserveLabelSpace' in vnodeProps || 'reserve-label-space' in vnodeProps)\n})\nconst currentReserveLabelSpace = computed(() => (hasOwnReserveLabelSpace.value ? props.reserveLabelSpace : (form?.reserveLabelSpace.value ?? true)))\nconst shouldReserveLabelSpace = computed(() => !props.label && currentReserveLabelSpace.value && (currentLabelPosition.value !== 'top' || (form?.inline.value ?? false)))\nconst shownValidateState = computed(() => props.validateStatus || (props.error ? 'error' : validateState.value))\nconst shownValidateMessage = computed(() => props.error || validateMessage.value)\nconst labelId = computed(() => (props.label ? `ui-form-item-${normalizeFormProp(props.prop) ?? Math.random().toString(36).slice(2)}-label` : undefined))\nconst contentId = computed(() => (props.prop ? `ui-form-item-${normalizeFormProp(props.prop)}-content` : undefined))\nconst itemClass = computed(() =>\n clsx(\n attrs.class as string | undefined,\n formItem({\n inline: form?.inline.value ?? false,\n labelPosition: currentLabelPosition.value,\n size: currentSize.value,\n error: shownValidateState.value === 'error'\n })\n )\n)\nconst itemStyle = computed<CSSProperties>(() => ({\n ...(attrs.style as CSSProperties | undefined),\n '--ui-form-item-gap': typeof form?.itemGap.value === 'number' ? `${form.itemGap.value}px` : form?.itemGap.value,\n '--ui-form-label-width': currentLabelWidth.value\n}))\nconst labelClass = computed(() =>\n formItemLabel({\n labelPosition: currentLabelPosition.value,\n size: currentSize.value,\n required: showRequiredAsterisk.value,\n requiredPosition: form?.requireAsteriskPosition.value ?? 'left'\n })\n)\nconst infoClass = computed(() => clsx('ml-1 inline-flex shrink-0 items-center', currentLabelPosition.value === 'top' && 'h-[1lh] self-start'))\nconst emptyLabelClass = computed(() => currentLabelPosition.value === 'top' && 'h-[1lh] shrink-0')\nconst contentClass = computed(() => clsx(formItemContent({ labelPosition: currentLabelPosition.value, size: currentSize.value }), !props.label && currentLabelPosition.value !== 'top' && (shouldReserveLabelSpace.value ? 'col-start-2' : 'col-span-full')))\nconst messageClass = computed(() => formItemMessage({ status: shownValidateState.value }))\n\nfunction isObjectValue(value: unknown): value is object {\n return value !== null && typeof value === 'object'\n}\n\nfunction cloneInitialFieldValue(value: unknown): unknown {\n const rawValue = toRaw(value)\n if (Array.isArray(rawValue)) return rawValue.map((item) => cloneInitialFieldValue(item))\n if (!isObjectValue(rawValue)) return rawValue\n if (rawValue instanceof Date) return new Date(rawValue)\n if (rawValue instanceof RegExp) {\n const clonedValue = new RegExp(rawValue.source, rawValue.flags)\n clonedValue.lastIndex = rawValue.lastIndex\n return clonedValue\n }\n if (rawValue instanceof ArrayBuffer || ArrayBuffer.isView(rawValue)) return structuredClone(rawValue)\n if (rawValue instanceof Map) return new Map(Array.from(rawValue.entries(), ([key, item]) => [cloneInitialFieldValue(key), cloneInitialFieldValue(item)]))\n if (rawValue instanceof Set) return new Set(Array.from(rawValue.values(), (item) => cloneInitialFieldValue(item)))\n\n const prototype = Object.getPrototypeOf(rawValue)\n if (prototype !== Object.prototype && prototype !== null) {\n try {\n return structuredClone(rawValue)\n } catch {\n return rawValue\n }\n }\n\n const cloneableValue: Record<PropertyKey, unknown> = {}\n Reflect.ownKeys(rawValue).forEach((key) => {\n cloneableValue[key] = cloneInitialFieldValue((rawValue as Record<PropertyKey, unknown>)[key])\n })\n return cloneableValue\n}\n\nfunction shouldValidateByTrigger(ruleTrigger: FormValidateTrigger | FormValidateTrigger[] | undefined, trigger?: FormValidateTrigger) {\n if (!trigger) return true\n if (!ruleTrigger) return true\n return Array.isArray(ruleTrigger) ? ruleTrigger.includes(trigger) : ruleTrigger === trigger\n}\n\nasync function validate(trigger?: FormValidateTrigger, options: ValidateOption = {}) {\n const rules = fieldRules.value.filter((rule) => shouldValidateByTrigger(rule.trigger, trigger))\n if (!props.prop || fieldRules.value.length === 0) {\n validateState.value = ''\n validateMessage.value = ''\n return { valid: true }\n }\n if (rules.length === 0) return { valid: true }\n\n validateState.value = 'validating'\n const result = await validateFormValue(props.prop, form?.getFieldValue(props.prop), rules, options)\n validateState.value = result.valid ? 'success' : 'error'\n validateMessage.value = result.errors?.[0]?.message ?? ''\n form?.emitValidate(props.prop, result.valid, validateMessage.value)\n return result\n}\n\nconst scheduledValidateTriggers = new Set<FormValidateTrigger>()\n\nfunction scheduleValidate(trigger: FormValidateTrigger) {\n if (!currentValidateTriggers.value.includes(trigger) || scheduledValidateTriggers.has(trigger)) return\n scheduledValidateTriggers.add(trigger)\n void nextTick(() => {\n scheduledValidateTriggers.delete(trigger)\n void validate(trigger)\n })\n}\n\nfunction cloneControlVNode(vnode: VNode) {\n if (typeof vnode.type === 'symbol') return vnode\n const listeners =\n typeof vnode.type === 'string'\n ? {\n onInput: () => scheduleValidate('change'),\n onChange: () => scheduleValidate('change'),\n onBlur: () => scheduleValidate('blur')\n }\n : {\n 'onUpdate:modelValue': () => scheduleValidate('change'),\n onBlur: () => scheduleValidate('blur')\n }\n return cloneVNode(vnode, listeners, true)\n}\n\nconst FormItemControl = defineComponent({\n name: 'UnoUIFormItemControl',\n setup() {\n return () =>\n slots\n .default?.({\n validate,\n validateState: shownValidateState.value,\n validateMessage: shownValidateMessage.value\n })\n ?.map(cloneControlVNode)\n }\n})\n\nfunction resetField() {\n if (props.prop && form && localInitialValueReady.value) form.setFieldValue(props.prop, cloneInitialFieldValue(localInitialValue.value))\n clearValidate()\n}\n\nfunction clearValidate() {\n validateState.value = ''\n validateMessage.value = ''\n}\n\nconst fieldContext: FormItemContext = {\n prop: props.prop,\n validateState,\n validateMessage,\n validate,\n resetField,\n clearValidate,\n isRequired\n}\n\nwatch(\n () => props.error,\n (error) => {\n if (error) {\n validateState.value = 'error'\n validateMessage.value = error\n }\n },\n { immediate: true }\n)\n\nonMounted(() => {\n if (props.prop && form) {\n const value = form.getFieldValue(props.prop)\n localInitialValue.value = cloneInitialFieldValue(value)\n localInitialValueReady.value = true\n form.registerField(fieldContext)\n }\n})\n\nonBeforeUnmount(() => {\n form?.unregisterField(fieldContext)\n})\n\ndefineExpose({\n validate,\n resetField,\n clearValidate,\n validateState,\n validateMessage\n})\n</script>\n\n<template>\n <div v-bind=\"getUiExposeAttrs(attrs)\" :class=\"itemClass\" :style=\"itemStyle\" :data-status=\"shownValidateState || undefined\">\n <slot name=\"label\" :label=\"label\">\n <label v-if=\"label\" :id=\"labelId\" :for=\"contentId\" :class=\"labelClass\">\n <span class=\"min-w-0 whitespace-normal break-words text-inherit\">{{ label }}</span>\n <span v-if=\"info || $slots.info\" :class=\"infoClass\" data-ui-form-item-info-wrapper=\"true\">\n <Tooltip :title=\"info\" :trigger=\"['hover', 'focus']\" :mouse-enter-delay=\"0\">\n <span\n class=\"i-lucide:info size-3.5 cursor-help rounded-sm text-tertiary outline-none transition-colors hover:text-secondary focus-visible:text-secondary focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-1\"\n data-ui-form-item-info=\"true\"\n role=\"img\"\n tabindex=\"0\"\n :aria-label=\"info || `${label}说明`\"\n ></span>\n <template #title>\n <slot name=\"info\">{{ info }}</slot>\n </template>\n </Tooltip>\n </span>\n </label>\n <div v-else-if=\"shouldReserveLabelSpace\" :class=\"emptyLabelClass\" aria-hidden=\"true\"></div>\n </slot>\n\n <div :id=\"contentId\" :class=\"contentClass\" :aria-labelledby=\"labelId\">\n <FormItemControl />\n <slot v-if=\"currentShowMessage && shownValidateMessage\" name=\"error\" :error=\"shownValidateMessage\" :validate-state=\"shownValidateState\">\n <div :class=\"messageClass\">{{ shownValidateMessage }}</div>\n </slot>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport type { ValidateOption } from 'async-validator'\nimport { clsx } from 'clsx'\nimport { cloneVNode, computed, defineComponent, getCurrentInstance, inject, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, toRaw, useAttrs, useSlots, watch } from 'vue'\nimport type { CSSProperties, VNode } from 'vue'\n\nimport { formContextKey, formItem, formItemContent, formItemLabel, formItemMessage, normalizeFormProp, validateFormValue, type FormItemContext, type FormItemRule, type FormLabelPosition, type FormProp, type FormSize, type FormValidateStatus, type FormValidateTrigger } from '.'\nimport { getUiExposeAttrs } from '../attrs'\nimport { Tooltip } from '../tooltip'\n\ndefineOptions({\n inheritAttrs: false\n})\n\nconst props = withDefaults(\n defineProps<{\n /** prop 是 model 字段路径,支持 a.b 或路径数组。 */\n prop?: FormProp\n /** label 是字段标签文本,可选。 */\n label?: string\n /** info 是显示在 label 旁的信息提示内容。 */\n info?: string\n /** rules 是字段局部规则,会与 Form.rules[prop] 合并。 */\n rules?: FormItemRule\n /** required 可单独控制必填星号;未设置时从规则推导。 */\n required?: boolean\n /** error 是外部传入的错误消息,会覆盖内部校验结果。 */\n error?: string\n /** validateStatus 是外部传入的校验状态。 */\n validateStatus?: FormValidateStatus\n /** showMessage 是否显示本字段错误消息,默认继承 Form。 */\n showMessage?: boolean\n /** validateTrigger 覆盖 Form 的自动校验时机;空数组表示仅显式校验。 */\n validateTrigger?: FormValidateTrigger | FormValidateTrigger[]\n /** labelWidth 覆盖 Form.labelWidth。 */\n labelWidth?: string | number\n /** reserveLabelSpace 控制无 label 时是否保留标签列,默认继承 Form。 */\n reserveLabelSpace?: boolean\n /** labelPosition 覆盖 Form.labelPosition。 */\n labelPosition?: FormLabelPosition\n /** size 覆盖 Form.size。 */\n size?: FormSize\n }>(),\n {\n prop: undefined,\n label: '',\n info: '',\n rules: undefined,\n required: undefined,\n error: '',\n validateStatus: '',\n showMessage: undefined,\n validateTrigger: undefined,\n labelWidth: undefined,\n reserveLabelSpace: undefined,\n labelPosition: undefined,\n size: undefined\n }\n)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\nconst instance = getCurrentInstance()\nconst form = inject(formContextKey, undefined)\nconst validateState = ref<FormValidateStatus>('')\nconst validateMessage = ref('')\nconst localInitialValue = shallowRef<unknown>()\nconst localInitialValueReady = ref(false)\n\nconst currentSize = computed(() => props.size ?? form?.size.value ?? 'md')\nconst currentLabelPosition = computed(() => props.labelPosition ?? form?.labelPosition.value ?? 'right')\nconst currentLabelWidth = computed(() => {\n if (currentLabelPosition.value === 'top') return 'auto'\n const width = props.labelWidth ?? form?.labelWidth.value ?? '96px'\n return typeof width === 'number' ? `${width}px` : width\n})\nconst currentShowMessage = computed(() => props.showMessage ?? form?.showMessage.value ?? true)\nconst currentValidateTriggers = computed<FormValidateTrigger[]>(() => {\n const triggers = props.validateTrigger ?? form?.validateTrigger.value ?? ['change', 'blur']\n return Array.isArray(triggers) ? triggers : [triggers]\n})\nconst fieldRules = computed(() => form?.getFieldRules(props.prop, props.rules) ?? [])\nconst isRequired = computed(() => props.required ?? fieldRules.value.some((rule) => rule.required))\nconst showRequiredAsterisk = computed(() => isRequired.value && !(form?.hideRequiredAsterisk.value ?? false))\nconst hasOwnReserveLabelSpace = computed(() => {\n const vnodeProps = instance?.vnode.props\n return !!vnodeProps && ('reserveLabelSpace' in vnodeProps || 'reserve-label-space' in vnodeProps)\n})\nconst currentReserveLabelSpace = computed(() => (hasOwnReserveLabelSpace.value ? props.reserveLabelSpace : (form?.reserveLabelSpace.value ?? true)))\nconst shouldReserveLabelSpace = computed(() => !props.label && currentReserveLabelSpace.value && (currentLabelPosition.value !== 'top' || (form?.inline.value ?? false)))\nconst shownValidateState = computed(() => props.validateStatus || (props.error ? 'error' : validateState.value))\nconst shownValidateMessage = computed(() => props.error || validateMessage.value)\nconst labelId = computed(() => (props.label ? `ui-form-item-${normalizeFormProp(props.prop) ?? Math.random().toString(36).slice(2)}-label` : undefined))\nconst contentId = computed(() => (props.prop ? `ui-form-item-${normalizeFormProp(props.prop)}-content` : undefined))\nconst itemClass = computed(() =>\n clsx(\n attrs.class as string | undefined,\n formItem({\n inline: form?.inline.value ?? false,\n labelPosition: currentLabelPosition.value,\n size: currentSize.value,\n error: shownValidateState.value === 'error'\n })\n )\n)\nconst itemStyle = computed<CSSProperties>(() => ({\n ...(attrs.style as CSSProperties | undefined),\n '--ui-form-item-gap': typeof form?.itemGap.value === 'number' ? `${form.itemGap.value}px` : form?.itemGap.value,\n '--ui-form-label-width': currentLabelWidth.value\n}))\nconst labelClass = computed(() =>\n formItemLabel({\n labelPosition: currentLabelPosition.value,\n size: currentSize.value,\n required: showRequiredAsterisk.value,\n requiredPosition: form?.requireAsteriskPosition.value ?? 'left'\n })\n)\nconst infoClass = computed(() => clsx('ml-1 inline-flex shrink-0 items-center', currentLabelPosition.value === 'top' && 'h-[1lh] self-start'))\nconst emptyLabelClass = computed(() => currentLabelPosition.value === 'top' && 'h-[1lh] shrink-0')\nconst contentClass = computed(() => clsx(formItemContent({ labelPosition: currentLabelPosition.value, size: currentSize.value }), !props.label && currentLabelPosition.value !== 'top' && (shouldReserveLabelSpace.value ? 'col-start-2' : 'col-span-full')))\nconst messageClass = computed(() => formItemMessage({ status: shownValidateState.value }))\n\nfunction isObjectValue(value: unknown): value is object {\n return value !== null && typeof value === 'object'\n}\n\nfunction cloneInitialFieldValue(value: unknown): unknown {\n const rawValue = toRaw(value)\n if (Array.isArray(rawValue)) return rawValue.map((item) => cloneInitialFieldValue(item))\n if (!isObjectValue(rawValue)) return rawValue\n if (rawValue instanceof Date) return new Date(rawValue)\n if (rawValue instanceof RegExp) {\n const clonedValue = new RegExp(rawValue.source, rawValue.flags)\n clonedValue.lastIndex = rawValue.lastIndex\n return clonedValue\n }\n if (rawValue instanceof ArrayBuffer || ArrayBuffer.isView(rawValue)) return structuredClone(rawValue)\n if (rawValue instanceof Map) return new Map(Array.from(rawValue.entries(), ([key, item]) => [cloneInitialFieldValue(key), cloneInitialFieldValue(item)]))\n if (rawValue instanceof Set) return new Set(Array.from(rawValue.values(), (item) => cloneInitialFieldValue(item)))\n\n const prototype = Object.getPrototypeOf(rawValue)\n if (prototype !== Object.prototype && prototype !== null) {\n try {\n return structuredClone(rawValue)\n } catch {\n return rawValue\n }\n }\n\n const cloneableValue: Record<PropertyKey, unknown> = {}\n Reflect.ownKeys(rawValue).forEach((key) => {\n cloneableValue[key] = cloneInitialFieldValue((rawValue as Record<PropertyKey, unknown>)[key])\n })\n return cloneableValue\n}\n\nfunction shouldValidateByTrigger(ruleTrigger: FormValidateTrigger | FormValidateTrigger[] | undefined, trigger?: FormValidateTrigger) {\n if (!trigger) return true\n if (!ruleTrigger) return true\n return Array.isArray(ruleTrigger) ? ruleTrigger.includes(trigger) : ruleTrigger === trigger\n}\n\nasync function validate(trigger?: FormValidateTrigger, options: ValidateOption = {}) {\n const rules = fieldRules.value.filter((rule) => shouldValidateByTrigger(rule.trigger, trigger))\n if (!props.prop || fieldRules.value.length === 0) {\n validateState.value = ''\n validateMessage.value = ''\n return { valid: true }\n }\n if (rules.length === 0) return { valid: true }\n\n validateState.value = 'validating'\n const result = await validateFormValue(props.prop, form?.getFieldValue(props.prop), rules, options)\n validateState.value = result.valid ? 'success' : 'error'\n validateMessage.value = result.errors?.[0]?.message ?? ''\n form?.emitValidate(props.prop, result.valid, validateMessage.value)\n return result\n}\n\nconst scheduledValidateTriggers = new Set<FormValidateTrigger>()\n\nfunction scheduleValidate(trigger: FormValidateTrigger) {\n if (!currentValidateTriggers.value.includes(trigger) || scheduledValidateTriggers.has(trigger)) return\n scheduledValidateTriggers.add(trigger)\n void nextTick(() => {\n scheduledValidateTriggers.delete(trigger)\n void validate(trigger)\n })\n}\n\nfunction cloneControlVNode(vnode: VNode) {\n if (typeof vnode.type === 'symbol') return vnode\n const listeners =\n typeof vnode.type === 'string'\n ? {\n onInput: () => scheduleValidate('change'),\n onChange: () => scheduleValidate('change'),\n onBlur: () => scheduleValidate('blur')\n }\n : {\n 'onUpdate:modelValue': () => scheduleValidate('change'),\n onBlur: () => scheduleValidate('blur')\n }\n return cloneVNode(vnode, listeners, true)\n}\n\nconst FormItemControl = defineComponent({\n name: 'UnoUIFormItemControl',\n setup() {\n return () =>\n slots\n .default?.({\n validate,\n validateState: shownValidateState.value,\n validateMessage: shownValidateMessage.value\n })\n ?.map(cloneControlVNode)\n }\n})\n\nfunction resetField() {\n if (props.prop && form && localInitialValueReady.value) form.setFieldValue(props.prop, cloneInitialFieldValue(localInitialValue.value))\n clearValidate()\n}\n\nfunction clearValidate() {\n validateState.value = ''\n validateMessage.value = ''\n}\n\nconst fieldContext: FormItemContext = {\n prop: props.prop,\n validateState,\n validateMessage,\n validate,\n resetField,\n clearValidate,\n isRequired\n}\n\nwatch(\n () => props.error,\n (error) => {\n if (error) {\n validateState.value = 'error'\n validateMessage.value = error\n }\n },\n { immediate: true }\n)\n\nonMounted(() => {\n if (props.prop && form) {\n const value = form.getFieldValue(props.prop)\n localInitialValue.value = cloneInitialFieldValue(value)\n localInitialValueReady.value = true\n form.registerField(fieldContext)\n }\n})\n\nonBeforeUnmount(() => {\n form?.unregisterField(fieldContext)\n})\n\ndefineExpose({\n validate,\n resetField,\n clearValidate,\n validateState,\n validateMessage\n})\n</script>\n\n<template>\n <div v-bind=\"getUiExposeAttrs(attrs)\" :class=\"itemClass\" :style=\"itemStyle\" :data-status=\"shownValidateState || undefined\">\n <slot name=\"label\" :label=\"label\">\n <label v-if=\"label\" :id=\"labelId\" :for=\"contentId\" :class=\"labelClass\">\n <span class=\"min-w-0 whitespace-normal break-words text-inherit\">{{ label }}</span>\n <span v-if=\"info || $slots.info\" :class=\"infoClass\" data-ui-form-item-info-wrapper=\"true\">\n <Tooltip :title=\"info\" :trigger=\"['hover', 'focus']\" :mouse-enter-delay=\"0\">\n <span\n class=\"i-lucide:info size-3.5 cursor-help rounded-sm text-tertiary outline-none transition-colors hover:text-secondary focus-visible:text-secondary focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-1\"\n data-ui-form-item-info=\"true\"\n role=\"img\"\n tabindex=\"0\"\n :aria-label=\"info || `${label}说明`\"\n ></span>\n <template #title>\n <slot name=\"info\">{{ info }}</slot>\n </template>\n </Tooltip>\n </span>\n </label>\n <div v-else-if=\"shouldReserveLabelSpace\" :class=\"emptyLabelClass\" aria-hidden=\"true\"></div>\n </slot>\n\n <div :id=\"contentId\" :class=\"contentClass\" :aria-labelledby=\"labelId\">\n <FormItemControl />\n <slot v-if=\"currentShowMessage && shownValidateMessage\" name=\"error\" :error=\"shownValidateMessage\" :validate-state=\"shownValidateState\">\n <div :class=\"messageClass\">{{ shownValidateMessage }}</div>\n </slot>\n </div>\n </div>\n</template>\n","import Schema from \"async-validator\";\nimport type { RuleItem, ValidateError, ValidateFieldsError, ValidateMessages, ValidateOption, Values } from \"async-validator\";\nimport { cva } from \"class-variance-authority\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport type { InjectionKey, Ref } from \"vue\";\n\nexport { default as Form } from \"./Form.vue\";\nexport { default as FormItem } from \"./FormItem.vue\";\n\nexport type FormLabelPosition = \"left\" | \"right\" | \"top\";\nexport type FormSize = \"sm\" | \"md\" | \"lg\";\nexport type FormValidateStatus = \"\" | \"validating\" | \"success\" | \"error\";\nexport type FormValidateTrigger = \"blur\" | \"change\" | (string & {});\nexport type FormProp = string | string[];\nexport type FormRulePreset = keyof typeof formValidatorPatterns;\n\nexport interface FormRule extends RuleItem {\n trigger?: FormValidateTrigger | FormValidateTrigger[];\n preset?: FormRulePreset;\n}\n\nexport type FormItemRule = FormRule | FormRule[];\nexport type FormRules<T extends Values = Values> = Partial<Record<keyof T | string, FormItemRule>>;\nexport type FormValidateCallback = (valid: boolean, invalidFields?: ValidateFieldsError) => void | Promise<void>;\n\nexport interface FormItemValidateResult {\n valid: boolean;\n errors?: ValidateError[];\n}\n\nexport interface FormItemContext {\n prop?: FormProp;\n validateState: Ref<FormValidateStatus>;\n validateMessage: Ref<string>;\n validate: (trigger?: FormValidateTrigger, options?: ValidateOption) => Promise<FormItemValidateResult>;\n resetField: () => void;\n clearValidate: () => void;\n isRequired: Ref<boolean>;\n}\n\nexport interface FormContext {\n model?: Values;\n rules?: FormRules;\n size: Ref<FormSize>;\n disabled: Ref<boolean>;\n inline: Ref<boolean>;\n labelPosition: Ref<FormLabelPosition>;\n labelWidth: Ref<string | number>;\n reserveLabelSpace: Ref<boolean>;\n itemGap: Ref<string | number>;\n showMessage: Ref<boolean>;\n validateTrigger: Ref<FormValidateTrigger | FormValidateTrigger[]>;\n requireAsteriskPosition: Ref<\"left\" | \"right\">;\n hideRequiredAsterisk: Ref<boolean>;\n validateOnRuleChange: Ref<boolean>;\n registerField: (field: FormItemContext) => void;\n unregisterField: (field: FormItemContext) => void;\n getFieldRules: (prop?: FormProp, localRules?: FormItemRule) => FormRule[];\n getFieldValue: (prop?: FormProp) => unknown;\n setFieldValue: (prop: FormProp | undefined, value: unknown) => void;\n validateField: (props?: FormProp | FormProp[], callback?: FormValidateCallback) => Promise<boolean>;\n clearValidate: (props?: FormProp | FormProp[]) => void;\n resetFields: (props?: FormProp | FormProp[]) => void;\n emitValidate: (prop: FormProp | undefined, valid: boolean, message: string) => void;\n}\n\nexport interface FormValidationPreset {\n pattern: RegExp;\n message: string;\n}\n\nexport const formContextKey: InjectionKey<FormContext> = Symbol(\"ui-form-context\");\n\n/** formValidatorPatterns 提供管理端表单常用正则,业务规则可通过 preset 直接复用。 */\nexport const formValidatorPatterns = {\n email: { pattern: /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/, message: \"请输入正确的邮箱地址\" },\n phoneCN: { pattern: /^1[3-9]\\d{9}$/, message: \"请输入正确的手机号\" },\n url: { pattern: /^(https?:\\/\\/)?([\\w-]+\\.)+[\\w-]+(\\/[\\w./?%&=+#:-]*)?$/i, message: \"请输入正确的 URL\" },\n ipv4: { pattern: /^(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}$/, message: \"请输入正确的 IPv4 地址\" },\n idCardCN: { pattern: /(^\\d{15}$)|(^\\d{17}[\\dXx]$)/, message: \"请输入正确的身份证号码\" },\n postalCodeCN: { pattern: /^\\d{6}$/, message: \"请输入正确的邮政编码\" },\n integer: { pattern: /^-?\\d+$/, message: \"请输入整数\" },\n positiveInteger: { pattern: /^[1-9]\\d*$/, message: \"请输入正整数\" },\n number: { pattern: /^-?(\\d+|\\d+\\.\\d+|\\.\\d+)$/, message: \"请输入数字\" },\n decimal2: { pattern: /^-?\\d+(\\.\\d{1,2})?$/, message: \"最多保留两位小数\" },\n alpha: { pattern: /^[A-Za-z]+$/, message: \"只能输入英文字母\" },\n alphaNum: { pattern: /^[A-Za-z0-9]+$/, message: \"只能输入英文字母和数字\" },\n projectId: { pattern: /^[A-Za-z0-9_-]+$/, message: \"只能输入字母、数字、下划线和短横线\" },\n slug: { pattern: /^[a-z0-9]+(?:-[a-z0-9]+)*$/, message: \"请输入小写字母、数字和短横线组成的标识\" },\n hexColor: { pattern: /^#(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/, message: \"请输入正确的十六进制颜色\" },\n chinese: { pattern: /^[\\u4e00-\\u9fa5]+$/, message: \"只能输入中文\" },\n password: { pattern: /^(?=.*[A-Za-z])(?=.*\\d).{8,32}$/, message: \"密码需包含字母和数字,长度 8-32 位\" },\n} satisfies Record<string, FormValidationPreset>;\n\n/** createFormRule 让调用方用内置 preset 快速构造 async-validator 规则。 */\nexport function createFormRule(preset: FormRulePreset, rule: Omit<FormRule, \"preset\" | \"pattern\"> = {}): FormRule {\n const validator = formValidatorPatterns[preset];\n return {\n pattern: validator.pattern,\n message: validator.message,\n ...rule,\n };\n}\n\nexport function normalizeFormProp(prop?: FormProp) {\n if (Array.isArray(prop)) return prop.join(\".\");\n return prop;\n}\n\nexport function getValueByPath(source: Values | undefined, prop?: FormProp) {\n if (!source || !prop) return undefined;\n const paths = Array.isArray(prop) ? prop : String(prop).split(\".\");\n return paths.reduce<unknown>((value, path) => (value !== null && typeof value === \"object\" ? (value as Values)[path] : undefined), source);\n}\n\nexport function setValueByPath(source: Values | undefined, prop: FormProp | undefined, value: unknown) {\n if (!source || !prop) return;\n const paths = Array.isArray(prop) ? prop : String(prop).split(\".\");\n const lastPath = paths.at(-1);\n if (!lastPath) return;\n\n let target: Values = source;\n for (const path of paths.slice(0, -1)) {\n const nextValue = target[path];\n if (nextValue === null || typeof nextValue !== \"object\") target[path] = {};\n target = target[path] as Values;\n }\n target[lastPath] = value;\n}\n\nexport function normalizeRules(rules?: FormItemRule): FormRule[] {\n if (!rules) return [];\n return (Array.isArray(rules) ? rules : [rules]).map((rule) => {\n if (!rule.preset) return { ...rule };\n const preset = formValidatorPatterns[rule.preset];\n return {\n pattern: preset.pattern,\n message: preset.message,\n ...rule,\n preset: undefined,\n };\n });\n}\n\nexport async function validateFormValue(prop: FormProp | undefined, value: unknown, rules: FormRule[], options: ValidateOption = {}) {\n const field = normalizeFormProp(prop);\n if (!field || rules.length === 0) return { valid: true } satisfies FormItemValidateResult;\n\n const descriptor = { [field]: rules.map(({ trigger: _trigger, preset: _preset, ...rule }) => rule) };\n const validator = new Schema(descriptor);\n try {\n await validator.validate({ [field]: value }, options);\n return { valid: true } satisfies FormItemValidateResult;\n } catch (error) {\n const validationError = error as { errors?: ValidateError[]; fields?: ValidateFieldsError };\n const errors = validationError.errors ?? validationError.fields?.[field] ?? [];\n return { valid: false, errors } satisfies FormItemValidateResult;\n }\n}\n\nexport const defaultFormValidateMessages: ValidateMessages = {\n default: \"字段验证错误\",\n required: \"%s 为必填项\",\n types: {\n email: \"%s 不是有效的邮箱地址\",\n url: \"%s 不是有效的 URL\",\n number: \"%s 不是有效的数字\",\n },\n string: {\n min: \"%s 至少 %s 个字符\",\n max: \"%s 最多 %s 个字符\",\n range: \"%s 长度需在 %s 到 %s 个字符之间\",\n },\n number: {\n min: \"%s 不能小于 %s\",\n max: \"%s 不能大于 %s\",\n range: \"%s 需在 %s 到 %s 之间\",\n },\n};\n\n/** formRoot 定义 Form 根布局,支持标准、inline 两种模式。 */\nexport const formRoot = cva(\"ui-form text-primary\", {\n variants: {\n inline: {\n true: \"flex flex-wrap items-start gap-x-4\",\n false: \"\",\n },\n size: {\n sm: \"text-sm\",\n md: \"text-sm\",\n lg: \"text-base\",\n },\n disabled: {\n true: \"opacity-70\",\n false: \"\",\n },\n },\n defaultVariants: {\n inline: false,\n size: \"md\",\n disabled: false,\n },\n});\n\n/** formItem 定义 FormItem 的整体排版和字段间距,确保嵌套网格内也有稳定行距。 */\nexport const formItem = cva(\"ui-form-item mb-[var(--ui-form-item-gap,16px)] min-w-0 self-start content-start last:mb-0\", {\n variants: {\n inline: {\n true: \"inline-flex w-auto items-start\",\n false: \"grid w-full\",\n },\n labelPosition: {\n left: \"grid-cols-[var(--ui-form-label-width)_minmax(0,1fr)] items-start gap-x-3\",\n right: \"grid-cols-[var(--ui-form-label-width)_minmax(0,1fr)] items-start gap-x-3\",\n top: \"gap-1\",\n },\n size: {\n sm: \"\",\n md: \"\",\n lg: \"\",\n },\n error: {\n true: \"\",\n false: \"\",\n },\n },\n compoundVariants: [\n { inline: true, labelPosition: \"top\", class: \"flex-col\" },\n ],\n defaultVariants: {\n inline: false,\n labelPosition: \"right\",\n size: \"md\",\n error: false,\n },\n});\n\n/** formItemLabel 定义 FormItem 标签对齐、尺寸和必填标识样式。 */\nexport const formItemLabel = cva(\"flex min-w-0 whitespace-normal break-words text-primary\", {\n variants: {\n labelPosition: {\n left: \"justify-start\",\n right: \"justify-end\",\n top: \"justify-start\",\n },\n size: {\n sm: \"text-xs/5\",\n md: \"text-sm/5\",\n lg: \"text-base/6\",\n },\n required: {\n true: \"\",\n false: \"\",\n },\n requiredPosition: {\n left: \"\",\n right: \"\",\n },\n },\n compoundVariants: [\n { required: true, requiredPosition: \"left\", class: \"before:mr-1 before:text-red-500 before:content-['*']\" },\n { required: true, requiredPosition: \"right\", class: \"after:ml-1 after:text-red-500 after:content-['*']\" },\n { labelPosition: [\"left\", \"right\"], size: \"sm\", class: \"min-h-[calc(1.75rem+7px)] items-center\" },\n { labelPosition: [\"left\", \"right\"], size: \"md\", class: \"min-h-[calc(2rem+3px)] items-center\" },\n { labelPosition: [\"left\", \"right\"], size: \"lg\", class: \"min-h-[calc(2.25rem)] items-center\" },\n ],\n defaultVariants: {\n labelPosition: \"right\",\n size: \"md\",\n required: false,\n requiredPosition: \"right\",\n },\n});\n\n/** formItemContent 定义控件区与错误提示布局。 */\nexport const formItemContent = cva(\"flex min-w-0 flex-col justify-center\", {\n variants: {\n labelPosition: {\n left: \"\",\n right: \"\",\n top: \"\",\n },\n size: {\n sm: \"text-sm\",\n md: \"text-sm\",\n lg: \"text-base\",\n },\n },\n compoundVariants: [\n { labelPosition: [\"left\", \"right\", \"top\"], size: \"sm\", class: \"min-h-[calc(1.75rem+7px)]\" },\n { labelPosition: [\"left\", \"right\", \"top\"], size: \"md\", class: \"min-h-[calc(2rem+3px)]\" },\n { labelPosition: [\"left\", \"right\", \"top\"], size: \"lg\", class: \"min-h-[calc(2.25rem)]\" },\n ],\n defaultVariants: {\n labelPosition: \"right\",\n size: \"md\",\n },\n});\n\n/** formItemMessage 定义 FormItem 校验提示视觉。 */\nexport const formItemMessage = cva(\"mt-1.5 min-h-4 text-xs/4\", {\n variants: {\n status: {\n \"\": \"text-tertiary\",\n validating: \"text-brand-500\",\n success: \"text-green-600 dark:text-green-400\",\n error: \"text-red-600 dark:text-red-400\",\n },\n },\n defaultVariants: {\n status: \"\",\n },\n});\n\nexport type FormProps = VariantProps<typeof formRoot>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaA,IAAM,IAAQ,GAiDR,IAAO,GAMP,IAAQ,EAAS,GACjB,IAAS,EAA8B,CAAC,CAAC,GAEzC,IAAY,QAAe,EAAK,EAAM,OAA6B,EAAS;GAAE,QAAQ,EAAM;GAAQ,MAAM,EAAM;GAAM,UAAU,EAAM;EAAS,CAAC,CAAC,CAAC,GAClJ,IAAY,SAA+B;GAC/C,GAAI,EAAM;GACV,sBAAsB,OAAO,EAAM,WAAY,WAAW,GAAG,EAAM,QAAQ,MAAM,EAAM;EACzF,EAAE;EAEF,SAAS,IAAqB;GAE5B,OADI,EAAM,kBAAkB,QAAc,SACnC,OAAO,EAAM,cAAe,WAAW,GAAG,EAAM,WAAW,MAAM,EAAM;EACh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