fast-element-plus 2.0.27 → 2.0.29

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 (52) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +6 -6
  3. package/README.zh.md +6 -6
  4. package/dist/component.d.ts +46 -35
  5. package/dist/components/avatar/src/avatar.d.ts +4 -4
  6. package/dist/components/button/src/button.d.ts +3 -3
  7. package/dist/components/carNumber/src/carNumber.d.ts +17 -6
  8. package/dist/components/carNumber/src/carNumber.mjs +16 -1
  9. package/dist/components/carNumber/src/carNumber.mjs.map +1 -1
  10. package/dist/components/drawer/src/drawer.d.ts +4 -4
  11. package/dist/components/form/src/formItem.d.ts +9 -3
  12. package/dist/components/form/src/formItem.mjs +5 -3
  13. package/dist/components/form/src/formItem.mjs.map +1 -1
  14. package/dist/components/image/src/image.d.ts +6 -1
  15. package/dist/components/image/src/image.mjs +7 -2
  16. package/dist/components/image/src/image.mjs.map +1 -1
  17. package/dist/components/select/src/select.d.ts +13 -7
  18. package/dist/components/select/src/select.mjs +4 -6
  19. package/dist/components/select/src/select.mjs.map +1 -1
  20. package/dist/components/select/src/selectOption.d.ts +5 -0
  21. package/dist/components/select/src/selectOption.mjs +3 -0
  22. package/dist/components/select/src/selectOption.mjs.map +1 -1
  23. package/dist/components/selectPage/src/selectPage.d.ts +16 -10
  24. package/dist/components/selectPage/src/selectPage.mjs +6 -8
  25. package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
  26. package/dist/components/selectV2/src/selectV2.d.ts +7 -2
  27. package/dist/components/selectV2/src/selectV2.mjs +2 -5
  28. package/dist/components/selectV2/src/selectV2.mjs.map +1 -1
  29. package/dist/components/table/src/page.type.d.ts +4 -0
  30. package/dist/components/table/src/table.mjs +5 -4
  31. package/dist/components/table/src/table.mjs.map +1 -1
  32. package/dist/components/table/src/tableColumn.d.ts +1 -0
  33. package/dist/components/table/src/tableColumn.mjs +33 -19
  34. package/dist/components/table/src/tableColumn.mjs.map +1 -1
  35. package/dist/components/tree/src/tree.d.ts +1 -1
  36. package/dist/components/treeSelect/src/treeSelect.d.ts +33 -27
  37. package/dist/components/treeSelect/src/treeSelect.mjs +14 -12
  38. package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -1
  39. package/dist/components/uploadImage/src/uploadImage.d.ts +9 -0
  40. package/dist/components/uploadImage/src/uploadImage.mjs +13 -6
  41. package/dist/components/uploadImage/src/uploadImage.mjs.map +1 -1
  42. package/dist/components/uploadImages/src/uploadImages.d.ts +9 -0
  43. package/dist/components/uploadImages/src/uploadImages.mjs +7 -5
  44. package/dist/components/uploadImages/src/uploadImages.mjs.map +1 -1
  45. package/dist/index.css +1 -1
  46. package/dist/index.css.map +1 -1
  47. package/dist/index.global.min.js +3 -3
  48. package/dist/index.global.min.js.map +1 -1
  49. package/dist/version.d.ts +1 -1
  50. package/dist/version.mjs +1 -1
  51. package/dist/version.mjs.map +1 -1
  52. package/package.json +4 -4
@@ -1,3 +1,4 @@
1
+ import { useExpose } from "../../../utils/vue/expose.mjs";
1
2
  import { definePropType, useProps } from "../../../utils/vue/props.mjs";
2
3
  import { useRender } from "../../../utils/vue/render.mjs";
3
4
  import { RegExps } from "../../../constants/regex.mjs";
@@ -35,8 +36,9 @@ var carNumber_default = defineComponent({
35
36
  /** 改变 */
36
37
  change: (value) => typeof value === "string" || value === null
37
38
  },
38
- setup(props, { emit }) {
39
+ setup(props, { emit, expose }) {
39
40
  const modelValue = useModel(props, "modelValue");
41
+ const inputRef = shallowRef(null);
40
42
  const popoverRef = shallowRef(null);
41
43
  const formContext = inject(formContextKey, void 0);
42
44
  const formItemContext = inject(formItemContextKey, void 0);
@@ -98,6 +100,7 @@ var carNumber_default = defineComponent({
98
100
  "hideAfter": 0
99
101
  }, {
100
102
  reference: () => createVNode(ElInput, mergeProps(elInputProps.value, {
103
+ "ref": inputRef,
101
104
  "class": "fa-car-number__input",
102
105
  "modelValue": modelValue.value,
103
106
  "onUpdate:modelValue": ($event) => modelValue.value = $event,
@@ -138,6 +141,18 @@ var carNumber_default = defineComponent({
138
141
  ])
139
142
  ])
140
143
  }));
144
+ return useExpose(expose, {
145
+ /** 聚焦车牌输入框 */
146
+ focus: computed(() => inputRef.value?.focus),
147
+ /** 取消输入框焦点 */
148
+ blur: computed(() => inputRef.value?.blur),
149
+ /** 选中输入框中的文本 */
150
+ select: computed(() => inputRef.value?.select),
151
+ /** 清空车牌号并更新模型 */
152
+ clear: handleClearClick,
153
+ /** 重新计算多行输入框的高度 */
154
+ resizeTextarea: computed(() => inputRef.value?.resizeTextarea)
155
+ });
141
156
  }
142
157
  });
143
158
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"carNumber.mjs","names":["update:modelValue"],"sources":["../../../../src/components/carNumber/src/carNumber.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, inject, reactive, shallowRef, useModel } from \"vue\";\nimport { Back } from \"@element-plus/icons-vue\";\nimport { ElButton, ElInput, ElMessage, ElPopover, formContextKey, formItemContextKey, inputProps } from \"element-plus\";\nimport { RegExps } from \"../../../constants\";\nimport { definePropType, useProps, useRender } from \"../../../utils\";\nimport { CarNumberArea, CarNumberDigit, CarNumberLetter } from \"./common\";\nimport type { PopoverInstance } from \"element-plus\";\n\nexport default defineComponent({\n\tname: \"FaCarNumber\",\n\tprops: {\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- Element Plus 2.x 尚未提供可替代的公开运行时 props 定义。\n\t\t...inputProps,\n\t\t/** value conversion function */\n\t\tparser: {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 保留 Element Plus 2.x parser 的运行时约束。\n\t\t\t...inputProps.parser,\n\t\t\ttype: definePropType<(value: string) => string>(Function),\n\t\t},\n\t\t/** v-model 绑定值 */\n\t\tmodelValue: {\n\t\t\ttype: definePropType<string | null>(String),\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/** placeholder */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: \"请选择\",\n\t\t},\n\t},\n\temits: {\n\t\t/** v-model 回调 */\n\t\t\"update:modelValue\": (value: string | null) => typeof value === \"string\" || value === null,\n\t\t/** 改变 */\n\t\tchange: (value: string | null) => typeof value === \"string\" || value === null,\n\t},\n\tsetup(props, { emit }) {\n\t\tconst modelValue = useModel(props, \"modelValue\");\n\n\t\tconst popoverRef = shallowRef<PopoverInstance | null>(null);\n\t\t// 获取 el-form 组件上下文\n\t\tconst formContext = inject(formContextKey, undefined);\n\t\t// 获取 el-form-item 组件上下文\n\t\tconst formItemContext = inject(formItemContextKey, undefined);\n\n\t\tconst state = reactive({\n\t\t\tswitchLetter: computed(() => {\n\t\t\t\tif ((modelValue.value?.length ?? 0) >= 1) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}),\n\t\t\tdisabledButton: computed(() => {\n\t\t\t\tif ((modelValue.value?.length ?? 0) >= 8) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}),\n\t\t});\n\n\t\tconst handleInputFormatter = (value: string) => {\n\t\t\tif (value.length === 2) {\n\t\t\t\treturn `${value} ● `;\n\t\t\t} else if (value.length > 2) {\n\t\t\t\treturn `${value.slice(0, 2)} ● ${value.slice(2)}`;\n\t\t\t} else {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t};\n\n\t\tconst handleSelectCarNumber = (value: string) => {\n\t\t\tmodelValue.value ??= \"\";\n\t\t\tmodelValue.value += value;\n\t\t};\n\n\t\tconst handleBackClick = () => {\n\t\t\tconst value = modelValue.value ?? \"\";\n\t\t\tif (value.length === 0) return;\n\t\t\tmodelValue.value = value.substring(0, value.length - 1);\n\t\t};\n\n\t\tconst handleConfirmClick = () => {\n\t\t\tlet success = false;\n\t\t\tconst value = modelValue.value ?? \"\";\n\t\t\tif (value.length === 7) {\n\t\t\t\tsuccess = RegExps.CarNumber.test(value);\n\t\t\t} else if (value.length === 8) {\n\t\t\t\tsuccess = RegExps.NewEnergyCarNumber.test(value);\n\t\t\t}\n\t\t\tif (success) {\n\t\t\t\temit(\"change\", value);\n\t\t\t\t// 调用 el-form 内部的校验方法(可自动校验)\n\t\t\t\tif (formItemContext?.prop) formContext?.validateField([formItemContext.prop]);\n\t\t\t} else {\n\t\t\t\tif (formItemContext?.prop && formContext) {\n\t\t\t\t\temit(\"change\", value);\n\t\t\t\t\t// 调用 el-form 内部的校验方法(可自动校验)\n\t\t\t\t\tformContext.validateField([formItemContext.prop]);\n\t\t\t\t} else {\n\t\t\t\t\tElMessage.error(\"车牌号格式不正确\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tpopoverRef.value?.hide();\n\t\t};\n\n\t\tconst handleClearClick = () => {\n\t\t\tmodelValue.value = null;\n\t\t\temit(\"change\", null);\n\t\t\t// 调用 el-form 内部的校验方法(可自动校验)\n\t\t\tif (formItemContext?.prop) formContext?.validateField([formItemContext.prop]);\n\t\t};\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 透传范围必须与继承的 Element Plus 2.x 运行时 props 保持一致。\n\t\tconst elInputProps = useProps(props, inputProps, [\"modelValue\", \"readonly\", \"formatter\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElPopover\n\t\t\t\tref={popoverRef}\n\t\t\t\twidth=\"auto\"\n\t\t\t\tpopperClass=\"fa-car-number__popover\"\n\t\t\t\ttrigger=\"click\"\n\t\t\t\tshowArrow={false}\n\t\t\t\tshowAfter={0}\n\t\t\t\thideAfter={0}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\treference: () => (\n\t\t\t\t\t\t<ElInput\n\t\t\t\t\t\t\t{...elInputProps.value}\n\t\t\t\t\t\t\tclass=\"fa-car-number__input\"\n\t\t\t\t\t\t\tvModel={modelValue.value}\n\t\t\t\t\t\t\treadonly\n\t\t\t\t\t\t\tformatter={handleInputFormatter}\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tdefault: () => (\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<div class={[\"fa-car-number__popover__area\", state.switchLetter ? \"fa-car-number__popover__hide\" : \"\"]}>\n\t\t\t\t\t\t\t\t{CarNumberArea.map((area) => (\n\t\t\t\t\t\t\t\t\t<ElButton disabled={state.disabledButton} onClick={() => handleSelectCarNumber(area)}>\n\t\t\t\t\t\t\t\t\t\t{area}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class={[\"fa-car-number__popover__digit-letter\", state.switchLetter ? \"\" : \"fa-car-number__popover__hide\"]}>\n\t\t\t\t\t\t\t\t{CarNumberDigit.map((digit) => (\n\t\t\t\t\t\t\t\t\t<ElButton disabled={state.disabledButton} onClick={() => handleSelectCarNumber(digit)}>\n\t\t\t\t\t\t\t\t\t\t{digit}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t{CarNumberLetter.map((letter) => (\n\t\t\t\t\t\t\t\t\t<ElButton disabled={state.disabledButton} onClick={() => handleSelectCarNumber(letter)}>\n\t\t\t\t\t\t\t\t\t\t{letter}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"fa-car-number__popover__btn\">\n\t\t\t\t\t\t\t\t<ElButton class=\"fa-car-number__popover__btn__clear\" disabled={!modelValue.value} onClick={handleClearClick}>\n\t\t\t\t\t\t\t\t\t清除\n\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t<ElButton\n\t\t\t\t\t\t\t\t\tclass=\"fa-car-number__popover__btn__back\"\n\t\t\t\t\t\t\t\t\ttype=\"danger\"\n\t\t\t\t\t\t\t\t\ticon={Back}\n\t\t\t\t\t\t\t\t\tdisabled={!modelValue.value}\n\t\t\t\t\t\t\t\t\tonClick={handleBackClick}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<ElButton\n\t\t\t\t\t\t\t\t\tclass=\"fa-car-number__popover__btn__confirm\"\n\t\t\t\t\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t\t\t\t\tdisabled={!modelValue.value || modelValue.value.length < 7}\n\t\t\t\t\t\t\t\t\tonClick={handleConfirmClick}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t确认\n\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t),\n\t\t\t\t}}\n\t\t\t</ElPopover>\n\t\t));\n\t},\n});\n"],"mappings":";;;;;;;;AAMoD,SAAA,QAAA,GAAA;CAAA,OAAA,OAAA,MAAA,cAAA,OAAA,UAAA,SAAA,KAAA,CAAA,MAAA,qBAAA,CAAA,QAAA,CAAA;AAAA;AAEpD,IAAA,oBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;EAEN,GAAG;;EAEH,QAAQ;GAEP,GAAG,WAAW;GACd,MAAM,eAA0C,QAAQ;EACzD;;EAEA,YAAY;GACX,MAAM,eAA8B,MAAM;GAC1C,SAAS,KAAA;EACV;;EAEA,aAAa;GACZ,MAAM;GACN,SAAS;EACV;CACD;CACA,OAAO;;EAEN,sBAAsB,UAAyB,OAAO,UAAU,YAAY,UAAU;;EAEtF,SAAS,UAAyB,OAAO,UAAU,YAAY,UAAU;CAC1E;CACA,MAAM,OAAO,EAAE,QAAQ;EACtB,MAAM,aAAa,SAAS,OAAO,YAAY;EAE/C,MAAM,aAAa,WAAmC,IAAI;EAE1D,MAAM,cAAc,OAAO,gBAAgB,KAAA,CAAS;EAEpD,MAAM,kBAAkB,OAAO,oBAAoB,KAAA,CAAS;EAE5D,MAAM,QAAQ,SAAS;GACtB,cAAc,eAAe;IAC5B,KAAK,WAAW,OAAO,UAAU,MAAM,GACtC,OAAO;IAER,OAAO;GACR,CAAC;GACD,gBAAgB,eA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QAAA;MAAA,YAKd,CAAC,WAAW,SAAS,WAAW,MAAM,SAAS;MAAC,WACjD;KAAkB,GAAA,EAAA,eAAA,CAAA,gBAAA,IAAA,CAAA,EAAA,CAAA;IAAA,CAAA;GAAA,CAAA;EAM9B,CAAA,CAGH;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"carNumber.mjs","names":["update:modelValue"],"sources":["../../../../src/components/carNumber/src/carNumber.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, inject, reactive, shallowRef, useModel } from \"vue\";\nimport { Back } from \"@element-plus/icons-vue\";\nimport { ElButton, ElInput, ElMessage, ElPopover, formContextKey, formItemContextKey, inputProps } from \"element-plus\";\nimport { RegExps } from \"../../../constants\";\nimport { definePropType, useExpose, useProps, useRender } from \"../../../utils\";\nimport { CarNumberArea, CarNumberDigit, CarNumberLetter } from \"./common\";\nimport type { InputInstance, PopoverInstance } from \"element-plus\";\n\nexport default defineComponent({\n\tname: \"FaCarNumber\",\n\tprops: {\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- Element Plus 2.x 尚未提供可替代的公开运行时 props 定义。\n\t\t...inputProps,\n\t\t/** value conversion function */\n\t\tparser: {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 保留 Element Plus 2.x parser 的运行时约束。\n\t\t\t...inputProps.parser,\n\t\t\ttype: definePropType<(value: string) => string>(Function),\n\t\t},\n\t\t/** v-model 绑定值 */\n\t\tmodelValue: {\n\t\t\ttype: definePropType<string | null>(String),\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/** placeholder */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: \"请选择\",\n\t\t},\n\t},\n\temits: {\n\t\t/** v-model 回调 */\n\t\t\"update:modelValue\": (value: string | null) => typeof value === \"string\" || value === null,\n\t\t/** 改变 */\n\t\tchange: (value: string | null) => typeof value === \"string\" || value === null,\n\t},\n\tsetup(props, { emit, expose }) {\n\t\tconst modelValue = useModel(props, \"modelValue\");\n\n\t\tconst inputRef = shallowRef<InputInstance | null>(null);\n\t\tconst popoverRef = shallowRef<PopoverInstance | null>(null);\n\t\t// 获取 el-form 组件上下文\n\t\tconst formContext = inject(formContextKey, undefined);\n\t\t// 获取 el-form-item 组件上下文\n\t\tconst formItemContext = inject(formItemContextKey, undefined);\n\n\t\tconst state = reactive({\n\t\t\tswitchLetter: computed(() => {\n\t\t\t\tif ((modelValue.value?.length ?? 0) >= 1) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}),\n\t\t\tdisabledButton: computed(() => {\n\t\t\t\tif ((modelValue.value?.length ?? 0) >= 8) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}),\n\t\t});\n\n\t\tconst handleInputFormatter = (value: string) => {\n\t\t\tif (value.length === 2) {\n\t\t\t\treturn `${value} ● `;\n\t\t\t} else if (value.length > 2) {\n\t\t\t\treturn `${value.slice(0, 2)} ● ${value.slice(2)}`;\n\t\t\t} else {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t};\n\n\t\tconst handleSelectCarNumber = (value: string) => {\n\t\t\tmodelValue.value ??= \"\";\n\t\t\tmodelValue.value += value;\n\t\t};\n\n\t\tconst handleBackClick = () => {\n\t\t\tconst value = modelValue.value ?? \"\";\n\t\t\tif (value.length === 0) return;\n\t\t\tmodelValue.value = value.substring(0, value.length - 1);\n\t\t};\n\n\t\tconst handleConfirmClick = () => {\n\t\t\tlet success = false;\n\t\t\tconst value = modelValue.value ?? \"\";\n\t\t\tif (value.length === 7) {\n\t\t\t\tsuccess = RegExps.CarNumber.test(value);\n\t\t\t} else if (value.length === 8) {\n\t\t\t\tsuccess = RegExps.NewEnergyCarNumber.test(value);\n\t\t\t}\n\t\t\tif (success) {\n\t\t\t\temit(\"change\", value);\n\t\t\t\t// 调用 el-form 内部的校验方法(可自动校验)\n\t\t\t\tif (formItemContext?.prop) formContext?.validateField([formItemContext.prop]);\n\t\t\t} else {\n\t\t\t\tif (formItemContext?.prop && formContext) {\n\t\t\t\t\temit(\"change\", value);\n\t\t\t\t\t// 调用 el-form 内部的校验方法(可自动校验)\n\t\t\t\t\tformContext.validateField([formItemContext.prop]);\n\t\t\t\t} else {\n\t\t\t\t\tElMessage.error(\"车牌号格式不正确\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tpopoverRef.value?.hide();\n\t\t};\n\n\t\tconst handleClearClick = () => {\n\t\t\tmodelValue.value = null;\n\t\t\temit(\"change\", null);\n\t\t\t// 调用 el-form 内部的校验方法(可自动校验)\n\t\t\tif (formItemContext?.prop) formContext?.validateField([formItemContext.prop]);\n\t\t};\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 透传范围必须与继承的 Element Plus 2.x 运行时 props 保持一致。\n\t\tconst elInputProps = useProps(props, inputProps, [\"modelValue\", \"readonly\", \"formatter\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElPopover\n\t\t\t\tref={popoverRef}\n\t\t\t\twidth=\"auto\"\n\t\t\t\tpopperClass=\"fa-car-number__popover\"\n\t\t\t\ttrigger=\"click\"\n\t\t\t\tshowArrow={false}\n\t\t\t\tshowAfter={0}\n\t\t\t\thideAfter={0}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\treference: () => (\n\t\t\t\t\t\t<ElInput\n\t\t\t\t\t\t\t{...elInputProps.value}\n\t\t\t\t\t\t\tref={inputRef}\n\t\t\t\t\t\t\tclass=\"fa-car-number__input\"\n\t\t\t\t\t\t\tvModel={modelValue.value}\n\t\t\t\t\t\t\treadonly\n\t\t\t\t\t\t\tformatter={handleInputFormatter}\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tdefault: () => (\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<div class={[\"fa-car-number__popover__area\", state.switchLetter ? \"fa-car-number__popover__hide\" : \"\"]}>\n\t\t\t\t\t\t\t\t{CarNumberArea.map((area) => (\n\t\t\t\t\t\t\t\t\t<ElButton disabled={state.disabledButton} onClick={() => handleSelectCarNumber(area)}>\n\t\t\t\t\t\t\t\t\t\t{area}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class={[\"fa-car-number__popover__digit-letter\", state.switchLetter ? \"\" : \"fa-car-number__popover__hide\"]}>\n\t\t\t\t\t\t\t\t{CarNumberDigit.map((digit) => (\n\t\t\t\t\t\t\t\t\t<ElButton disabled={state.disabledButton} onClick={() => handleSelectCarNumber(digit)}>\n\t\t\t\t\t\t\t\t\t\t{digit}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t{CarNumberLetter.map((letter) => (\n\t\t\t\t\t\t\t\t\t<ElButton disabled={state.disabledButton} onClick={() => handleSelectCarNumber(letter)}>\n\t\t\t\t\t\t\t\t\t\t{letter}\n\t\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"fa-car-number__popover__btn\">\n\t\t\t\t\t\t\t\t<ElButton class=\"fa-car-number__popover__btn__clear\" disabled={!modelValue.value} onClick={handleClearClick}>\n\t\t\t\t\t\t\t\t\t清除\n\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t\t<ElButton\n\t\t\t\t\t\t\t\t\tclass=\"fa-car-number__popover__btn__back\"\n\t\t\t\t\t\t\t\t\ttype=\"danger\"\n\t\t\t\t\t\t\t\t\ticon={Back}\n\t\t\t\t\t\t\t\t\tdisabled={!modelValue.value}\n\t\t\t\t\t\t\t\t\tonClick={handleBackClick}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<ElButton\n\t\t\t\t\t\t\t\t\tclass=\"fa-car-number__popover__btn__confirm\"\n\t\t\t\t\t\t\t\t\ttype=\"primary\"\n\t\t\t\t\t\t\t\t\tdisabled={!modelValue.value || modelValue.value.length < 7}\n\t\t\t\t\t\t\t\t\tonClick={handleConfirmClick}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t确认\n\t\t\t\t\t\t\t\t</ElButton>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t),\n\t\t\t\t}}\n\t\t\t</ElPopover>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** 聚焦车牌输入框 */\n\t\t\tfocus: computed(() => inputRef.value?.focus),\n\t\t\t/** 取消输入框焦点 */\n\t\t\tblur: computed(() => inputRef.value?.blur),\n\t\t\t/** 选中输入框中的文本 */\n\t\t\tselect: computed(() => inputRef.value?.select),\n\t\t\t/** 清空车牌号并更新模型 */\n\t\t\tclear: handleClearClick,\n\t\t\t/** 重新计算多行输入框的高度 */\n\t\t\tresizeTextarea: computed(() => inputRef.value?.resizeTextarea),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;AAMmE,SAAA,QAAA,GAAA;CAAA,OAAA,OAAA,MAAA,cAAA,OAAA,UAAA,SAAA,KAAA,CAAA,MAAA,qBAAA,CAAA,QAAA,CAAA;AAAA;AAEnE,IAAA,oBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;EAEN,GAAG;;EAEH,QAAQ;GAEP,GAAG,WAAW;GACd,MAAM,eAA0C,QAAQ;EACzD;;EAEA,YAAY;GACX,MAAM,eAA8B,MAAM;GAC1C,SAAS,KAAA;EACV;;EAEA,aAAa;GACZ,MAAM;GACN,SAAS;EACV;CACD;CACA,OAAO;;EAEN,sBAAsB,UAAyB,OAAO,UAAU,YAAY,UAAU;;EAEtF,SAAS,UAAyB,OAAO,UAAU,YAAY,UAAU;CAC1E;CACA,MAAM,OAAO,EAAE,MAAM,UAAU;EAC9B,MAAM,aAAa,SAAS,OAAO,YAAY;EAE/C,MAAM,WAAW,WAAiC,IAAI;EACtD,MAAM,aAAa,WAAmC,IAAI;EAE1D,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CAAC,WAAW;MAAK,WAAW;KAAgB,GAAA,EAAA,eAAA,CAAA,gBAAA,IAAA,CAAA,EAAA,CAAA;KAAA,YAAA,UAAA;MAAA,SAAA;MAAA,QAAA;MAAA,QAMpG;MAAI,YACA,CAAC,WAAW;MAAK,WAClB;KAAe,GAAA,IAAA;KAAA,YAAA,UAAA;MAAA,SAAA;MAAA,QAAA;MAAA,YAKd,CAAC,WAAW,SAAS,WAAW,MAAM,SAAS;MAAC,WACjD;KAAkB,GAAA,EAAA,eAAA,CAAA,gBAAA,IAAA,CAAA,EAAA,CAAA;IAAA,CAAA;GAAA,CAAA;EAM9B,CAAA,CAGH;EAED,OAAO,UAAU,QAAQ;;GAExB,OAAO,eAAe,SAAS,OAAO,KAAK;;GAE3C,MAAM,eAAe,SAAS,OAAO,IAAI;;GAEzC,QAAQ,eAAe,SAAS,OAAO,MAAM;;GAE7C,OAAO;;GAEP,gBAAgB,eAAe,SAAS,OAAO,cAAc;EAC9D,CAAC;CACF;AACD,CAAC"}
@@ -56,7 +56,7 @@ export declare const faDrawerProps: {
56
56
  type: import("vue").PropType<() => void | Promise<void>>;
57
57
  };
58
58
  direction: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<StringConstructor, "ltr" | "rtl" | "ttb" | "btt", unknown, "rtl", boolean>;
59
- resizable: BooleanConstructor;
59
+ resizable: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => boolean | import("element-plus").DrawerResizableOptions) | (() => boolean | import("element-plus").DrawerResizableOptions) | (((new (...args: any[]) => boolean | import("element-plus").DrawerResizableOptions) | (() => boolean | import("element-plus").DrawerResizableOptions)) | null)[], unknown, unknown, false, boolean>;
60
60
  size: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "30%", boolean>;
61
61
  withHeader: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
62
62
  modalFade: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
@@ -213,7 +213,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
213
213
  type: import("vue").PropType<() => void | Promise<void>>;
214
214
  };
215
215
  direction: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<StringConstructor, "ltr" | "rtl" | "ttb" | "btt", unknown, "rtl", boolean>;
216
- resizable: BooleanConstructor;
216
+ resizable: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => boolean | import("element-plus").DrawerResizableOptions) | (() => boolean | import("element-plus").DrawerResizableOptions) | (((new (...args: any[]) => boolean | import("element-plus").DrawerResizableOptions) | (() => boolean | import("element-plus").DrawerResizableOptions)) | null)[], unknown, unknown, false, boolean>;
217
217
  size: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "30%", boolean>;
218
218
  withHeader: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
219
219
  modalFade: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
@@ -356,7 +356,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
356
356
  type: import("vue").PropType<() => void | Promise<void>>;
357
357
  };
358
358
  direction: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<StringConstructor, "ltr" | "rtl" | "ttb" | "btt", unknown, "rtl", boolean>;
359
- resizable: BooleanConstructor;
359
+ resizable: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => boolean | import("element-plus").DrawerResizableOptions) | (() => boolean | import("element-plus").DrawerResizableOptions) | (((new (...args: any[]) => boolean | import("element-plus").DrawerResizableOptions) | (() => boolean | import("element-plus").DrawerResizableOptions)) | null)[], unknown, unknown, false, boolean>;
360
360
  size: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "30%", boolean>;
361
361
  withHeader: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
362
362
  modalFade: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
@@ -463,7 +463,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
463
463
  footerClass: import("element-plus/es/utils/typescript.mjs").ClassValue;
464
464
  ariaLevel: string;
465
465
  direction: import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "ltr" | "rtl" | "ttb" | "btt", unknown>;
466
- resizable: boolean;
466
+ resizable: import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (...args: any[]) => boolean | import("element-plus").DrawerResizableOptions) | (() => boolean | import("element-plus").DrawerResizableOptions) | ((new (...args: any[]) => boolean | import("element-plus").DrawerResizableOptions) | (() => boolean | import("element-plus").DrawerResizableOptions) | null)[], unknown, unknown>;
467
467
  withHeader: import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
468
468
  modalFade: import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
469
469
  }, import("../../../utils").TypedSlotsDeclaration<FaDrawerSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -18,6 +18,8 @@ export declare const faFormItemProps: {
18
18
  };
19
19
  /** 独占一行。如果设置 span 则无效 */
20
20
  row: BooleanConstructor;
21
+ /** 展示值,为 `null` 或 `undefined` 时使用默认插槽 */
22
+ value: (NumberConstructor | StringConstructor)[];
21
23
  label: StringConstructor;
22
24
  labelWidth: {
23
25
  readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
@@ -41,7 +43,7 @@ export declare const faFormItemProps: {
41
43
  };
42
44
  error: StringConstructor;
43
45
  validateStatus: {
44
- readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown>>;
46
+ readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "" | "success" | "error" | "validating", unknown>>;
45
47
  readonly required: false;
46
48
  readonly validator: ((val: unknown) => boolean) | undefined;
47
49
  __epPropKey: true;
@@ -88,6 +90,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
88
90
  };
89
91
  /** 独占一行。如果设置 span 则无效 */
90
92
  row: BooleanConstructor;
93
+ /** 展示值,为 `null` 或 `undefined` 时使用默认插槽 */
94
+ value: (NumberConstructor | StringConstructor)[];
91
95
  label: StringConstructor;
92
96
  labelWidth: {
93
97
  readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
@@ -111,7 +115,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
111
115
  };
112
116
  error: StringConstructor;
113
117
  validateStatus: {
114
- readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown>>;
118
+ readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "" | "success" | "error" | "validating", unknown>>;
115
119
  readonly required: false;
116
120
  readonly validator: ((val: unknown) => boolean) | undefined;
117
121
  __epPropKey: true;
@@ -159,6 +163,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
159
163
  };
160
164
  /** 独占一行。如果设置 span 则无效 */
161
165
  row: BooleanConstructor;
166
+ /** 展示值,为 `null` 或 `undefined` 时使用默认插槽 */
167
+ value: (NumberConstructor | StringConstructor)[];
162
168
  label: StringConstructor;
163
169
  labelWidth: {
164
170
  readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
@@ -182,7 +188,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
182
188
  };
183
189
  error: StringConstructor;
184
190
  validateStatus: {
185
- readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown>>;
191
+ readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "" | "success" | "error" | "validating", unknown>>;
186
192
  readonly required: false;
187
193
  readonly validator: ((val: unknown) => boolean) | undefined;
188
194
  __epPropKey: true;
@@ -25,7 +25,9 @@ const faFormItemProps = {
25
25
  /** 栅格跨度 */
26
26
  span: { type: [String, Number] },
27
27
  /** 独占一行。如果设置 span 则无效 */
28
- row: Boolean
28
+ row: Boolean,
29
+ /** 展示值,为 `null` 或 `undefined` 时使用默认插槽 */
30
+ value: [String, Number]
29
31
  };
30
32
  var formItem_default = defineComponent({
31
33
  name: "FaFormItem",
@@ -53,9 +55,9 @@ var formItem_default = defineComponent({
53
55
  useRender(() => {
54
56
  const FormItemWrapper = props.grid ? FaLayoutGridItem : Fragment;
55
57
  return createVNode(FormItemWrapper, getResponsive(), { default: () => [createVNode(ElFormItem, mergeProps({ "ref": formItemRef }, elFormItemProps.value), {
56
- default: () => slots.default?.() ?? [],
58
+ default: () => props.value ?? slots.default?.() ?? [],
57
59
  ...slots.label && !props.tips && { label: ({ label }) => slots.label?.({ label }) ?? [] },
58
- ...slots.label && props.tips && { label: ({ label }) => [createVNode(FaFormItemTip, null, { label: () => slots.label?.({ label }) ?? [] })] },
60
+ ...slots.label && props.tips && { label: ({ label }) => [createVNode(FaFormItemTip, { "tips": props.tips }, { label: () => slots.label?.({ label }) ?? [] })] },
59
61
  ...!slots.label && props.tips && { label: ({ label }) => [createVNode(FaFormItemTip, {
60
62
  "label": label ?? props.label,
61
63
  "tips": props.tips
@@ -1 +1 @@
1
- {"version":3,"file":"formItem.mjs","names":[],"sources":["../../../../src/components/form/src/formItem.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, inject, ref, shallowRef } from \"vue\";\nimport { ElFormItem, formItemProps } from \"element-plus\";\nimport { makeSlots, useExpose, useProps, useRender } from \"../../../utils\";\nimport { FaFormItemTip } from \"../../formItemTip\";\nimport { FaLayoutGridItem } from \"../../layoutGrid\";\nimport type { FormItemInstance } from \"element-plus\";\nimport type { Ref } from \"vue\";\n\n/** FaFormItem 的运行时 Props 定义 */\nexport const faFormItemProps = {\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- Element Plus 2.x 尚未提供可替代的公开运行时 props 定义。\n\t...formItemProps,\n\t/** Label tips 提示 */\n\ttips: String,\n\t/** Grid 布局 */\n\tgrid: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 偏移量 */\n\toffset: {\n\t\ttype: [String, Number],\n\t\tdefault: 0,\n\t},\n\t/** 栅格跨度 */\n\tspan: {\n\t\ttype: [String, Number],\n\t},\n\t/** 独占一行。如果设置 span 则无效 */\n\trow: Boolean,\n};\n\n/** FaFormItem 的插槽参数 */\nexport interface FaFormItemSlots extends Record<string, unknown> {\n\t/** 默认内容插槽 */\n\tdefault: never;\n\t/** 标签位置显示的内容 */\n\tlabel: { label: string };\n\t/** 验证错误信息的显示内容 */\n\terror: { error: string };\n}\n\nexport default defineComponent({\n\tname: \"FaFormItem\",\n\tprops: faFormItemProps,\n\tslots: makeSlots<FaFormItemSlots>(),\n\tsetup(props, { slots, expose }) {\n\t\tconst formItemRef = shallowRef<FormItemInstance | null>(null);\n\n\t\tconst cols = inject<Ref<number>>(\"cols\", ref(4));\n\n\t\t// 获取响应式设置\n\t\tconst getResponsive = () => {\n\t\t\tif (!props.grid) return {};\n\t\t\tif (props.span) {\n\t\t\t\treturn {\n\t\t\t\t\tspan: typeof props.span === \"number\" ? props.span : Number(props.span),\n\t\t\t\t\toffset: typeof props.offset === \"number\" ? props.offset : Number(props.offset),\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst result = {\n\t\t\t\t\tspan: 1,\n\t\t\t\t\toffset: typeof props.offset === \"number\" ? props.offset : Number(props.offset),\n\t\t\t\t};\n\t\t\t\tif (props.row) {\n\t\t\t\t\tresult.span = cols.value;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 透传范围必须与继承的 Element Plus 2.x 运行时 props 保持一致。\n\t\tconst elFormItemProps = useProps(props, formItemProps);\n\n\t\tuseRender(() => {\n\t\t\tconst FormItemWrapper = props.grid ? FaLayoutGridItem : Fragment;\n\t\t\treturn (\n\t\t\t\t<FormItemWrapper {...getResponsive()}>\n\t\t\t\t\t<ElFormItem ref={formItemRef} {...elFormItemProps.value}>\n\t\t\t\t\t\t{{\n\t\t\t\t\t\t\tdefault: () => slots.default?.() ?? [],\n\t\t\t\t\t\t\t...(slots.label && !props.tips && { label: ({ label }: { label: string }) => slots.label?.({ label }) ?? [] }),\n\t\t\t\t\t\t\t...(slots.label &&\n\t\t\t\t\t\t\t\tprops.tips && {\n\t\t\t\t\t\t\t\t\tlabel: ({ label }: { label: string }) => [\n\t\t\t\t\t\t\t\t\t\t<FaFormItemTip>\n\t\t\t\t\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: () => slots.label?.({ label }) ?? [],\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t</FaFormItemTip>,\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t...(!slots.label &&\n\t\t\t\t\t\t\t\tprops.tips && {\n\t\t\t\t\t\t\t\t\tlabel: ({ label }: { label?: string }) => [<FaFormItemTip label={label ?? props.label} tips={props.tips} />],\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t...(slots.error && { error: ({ error }: { error: string }) => slots.error?.({ error }) ?? [] }),\n\t\t\t\t\t\t}}\n\t\t\t\t\t</ElFormItem>\n\t\t\t\t</FormItemWrapper>\n\t\t\t);\n\t\t});\n\n\t\treturn useExpose(expose, {\n\t\t\t/** 表单项大小 */\n\t\t\tsize: computed(() => formItemRef.value?.size),\n\t\t\t/** 校验消息 */\n\t\t\tvalidateMessage: computed(() => formItemRef.value?.validateMessage),\n\t\t\t/** 校验状态 */\n\t\t\tvalidateState: computed(() => formItemRef.value?.validateState),\n\t\t\t/** 验证表单项 */\n\t\t\tvalidate: computed(() => formItemRef.value?.validate),\n\t\t\t/** 移除该表单项的校验结果 */\n\t\t\tclearValidate: computed(() => formItemRef.value?.clearValidate),\n\t\t\t/** 对该表单项进行重置,将其值重置为初始值并移除校验结果 */\n\t\t\tresetField: computed(() => formItemRef.value?.resetField),\n\t\t\t/** 设置该表单项的初始值。 */\n\t\t\tsetInitialValue: computed(() => formItemRef.value?.setInitialValue),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;AASA,MAAa,kBAAkB;CAE9B,GAAG;;CAEH,MAAM;;CAEN,MAAM;EACL,MAAM;EACN,SAAS;CACV;;CAEA,QAAQ;EACP,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,MAAM,EACL,MAAM,CAAC,QAAQ,MAAM,EACtB;;CAEA,KAAK;AACN;AAYA,IAAA,mBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO,UAA2B;CAClC,MAAM,OAAO,EAAE,OAAO,UAAU;EAC/B,MAAM,cAAc,WAAoC,IAAI;EAE5D,MAAM,OAAO,OAAoB,QAAQ,IAAI,CAAC,CAAC;EAG/C,MAAM,sBAAsB;GAC3B,IAAI,CAAC,MAAM,MAAM,OAAO,CAAC;GACzB,IAAI,MAAM,MACT,OAAO;IACN,MAAM,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO,OAAO,MAAM,IAAI;IACrE,QAAQ,OAAO,MAAM,WAAW,WA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eAAe,eAAe,YAAY,OAAO,aAAa;;GAE9D,YAAY,eAAe,YAAY,OAAO,UAAU;;GAExD,iBAAiB,eAAe,YAAY,OAAO,eAAe;EACnE,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"formItem.mjs","names":[],"sources":["../../../../src/components/form/src/formItem.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, inject, ref, shallowRef } from \"vue\";\nimport { ElFormItem, formItemProps } from \"element-plus\";\nimport { makeSlots, useExpose, useProps, useRender } from \"../../../utils\";\nimport { FaFormItemTip } from \"../../formItemTip\";\nimport { FaLayoutGridItem } from \"../../layoutGrid\";\nimport type { FormItemInstance } from \"element-plus\";\nimport type { Ref } from \"vue\";\n\n/** FaFormItem 的运行时 Props 定义 */\nexport const faFormItemProps = {\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- Element Plus 2.x 尚未提供可替代的公开运行时 props 定义。\n\t...formItemProps,\n\t/** Label tips 提示 */\n\ttips: String,\n\t/** Grid 布局 */\n\tgrid: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 偏移量 */\n\toffset: {\n\t\ttype: [String, Number],\n\t\tdefault: 0,\n\t},\n\t/** 栅格跨度 */\n\tspan: {\n\t\ttype: [String, Number],\n\t},\n\t/** 独占一行。如果设置 span 则无效 */\n\trow: Boolean,\n\t/** 展示值,为 `null` 或 `undefined` 时使用默认插槽 */\n\tvalue: [String, Number],\n};\n\n/** FaFormItem 的插槽参数 */\nexport interface FaFormItemSlots extends Record<string, unknown> {\n\t/** 默认内容插槽 */\n\tdefault: never;\n\t/** 标签位置显示的内容 */\n\tlabel: { label: string };\n\t/** 验证错误信息的显示内容 */\n\terror: { error: string };\n}\n\nexport default defineComponent({\n\tname: \"FaFormItem\",\n\tprops: faFormItemProps,\n\tslots: makeSlots<FaFormItemSlots>(),\n\tsetup(props, { slots, expose }) {\n\t\tconst formItemRef = shallowRef<FormItemInstance | null>(null);\n\n\t\tconst cols = inject<Ref<number>>(\"cols\", ref(4));\n\n\t\t// 获取响应式设置\n\t\tconst getResponsive = () => {\n\t\t\tif (!props.grid) return {};\n\t\t\tif (props.span) {\n\t\t\t\treturn {\n\t\t\t\t\tspan: typeof props.span === \"number\" ? props.span : Number(props.span),\n\t\t\t\t\toffset: typeof props.offset === \"number\" ? props.offset : Number(props.offset),\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst result = {\n\t\t\t\t\tspan: 1,\n\t\t\t\t\toffset: typeof props.offset === \"number\" ? props.offset : Number(props.offset),\n\t\t\t\t};\n\t\t\t\tif (props.row) {\n\t\t\t\t\tresult.span = cols.value;\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 透传范围必须与继承的 Element Plus 2.x 运行时 props 保持一致。\n\t\tconst elFormItemProps = useProps(props, formItemProps);\n\n\t\tuseRender(() => {\n\t\t\tconst FormItemWrapper = props.grid ? FaLayoutGridItem : Fragment;\n\t\t\treturn (\n\t\t\t\t<FormItemWrapper {...getResponsive()}>\n\t\t\t\t\t<ElFormItem ref={formItemRef} {...elFormItemProps.value}>\n\t\t\t\t\t\t{{\n\t\t\t\t\t\t\tdefault: () => props.value ?? slots.default?.() ?? [],\n\t\t\t\t\t\t\t...(slots.label && !props.tips && { label: ({ label }: { label: string }) => slots.label?.({ label }) ?? [] }),\n\t\t\t\t\t\t\t...(slots.label &&\n\t\t\t\t\t\t\t\tprops.tips && {\n\t\t\t\t\t\t\t\t\tlabel: ({ label }: { label: string }) => [\n\t\t\t\t\t\t\t\t\t\t<FaFormItemTip tips={props.tips}>\n\t\t\t\t\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\t\t\t\t\tlabel: () => slots.label?.({ label }) ?? [],\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t</FaFormItemTip>,\n\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t...(!slots.label &&\n\t\t\t\t\t\t\t\tprops.tips && {\n\t\t\t\t\t\t\t\t\tlabel: ({ label }: { label?: string }) => [<FaFormItemTip label={label ?? props.label} tips={props.tips} />],\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t...(slots.error && { error: ({ error }: { error: string }) => slots.error?.({ error }) ?? [] }),\n\t\t\t\t\t\t}}\n\t\t\t\t\t</ElFormItem>\n\t\t\t\t</FormItemWrapper>\n\t\t\t);\n\t\t});\n\n\t\treturn useExpose(expose, {\n\t\t\t/** 表单项大小 */\n\t\t\tsize: computed(() => formItemRef.value?.size),\n\t\t\t/** 校验消息 */\n\t\t\tvalidateMessage: computed(() => formItemRef.value?.validateMessage),\n\t\t\t/** 校验状态 */\n\t\t\tvalidateState: computed(() => formItemRef.value?.validateState),\n\t\t\t/** 验证表单项 */\n\t\t\tvalidate: computed(() => formItemRef.value?.validate),\n\t\t\t/** 移除该表单项的校验结果 */\n\t\t\tclearValidate: computed(() => formItemRef.value?.clearValidate),\n\t\t\t/** 对该表单项进行重置,将其值重置为初始值并移除校验结果 */\n\t\t\tresetField: computed(() => formItemRef.value?.resetField),\n\t\t\t/** 设置该表单项的初始值。 */\n\t\t\tsetInitialValue: computed(() => formItemRef.value?.setInitialValue),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;AASA,MAAa,kBAAkB;CAE9B,GAAG;;CAEH,MAAM;;CAEN,MAAM;EACL,MAAM;EACN,SAAS;CACV;;CAEA,QAAQ;EACP,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,MAAM,EACL,MAAM,CAAC,QAAQ,MAAM,EACtB;;CAEA,KAAK;;CAEL,OAAO,CAAC,QAAQ,MAAM;AACvB;AAYA,IAAA,mBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO,UAA2B;CAClC,MAAM,OAAO,EAAE,OAAO,UAAU;EAC/B,MAAM,cAAc,WAAoC,IAAI;EAE5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,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAA,EAAG;GAAE,CAAA,CAAA,EAAA,CAAA;EAKpG,CAAC;EAED,OAAO,UAAU,QAAQ;;GAExB,MAAM,eAAe,YAAY,OAAO,IAAI;;GAE5C,iBAAiB,eAAe,YAAY,OAAO,eAAe;;GAElE,eAAe,eAAe,YAAY,OAAO,aAAa;;GAE9D,UAAU,eAAe,YAAY,OAAO,QAAQ;;GAEpD,eAAe,eAAe,YAAY,OAAO,aAAa;;GAE9D,YAAY,eAAe,YAAY,OAAO,UAAU;;GAExD,iBAAiB,eAAe,YAAY,OAAO,eAAe;EACnE,CAAC;CACF;AACD,CAAC"}
@@ -100,7 +100,12 @@ export interface FaImageSlots extends Record<string, unknown> {
100
100
  setActiveItem: (index: number) => void;
101
101
  };
102
102
  /** 图片预览加载失败内容 */
103
- "viewer-error": {
103
+ viewerError: {
104
+ activeIndex: number;
105
+ src: string;
106
+ };
107
+ /** 图片预览加载时的占位内容 */
108
+ viewerPlaceholder: {
104
109
  activeIndex: number;
105
110
  src: string;
106
111
  };
@@ -62,7 +62,11 @@ var image_default = defineComponent({
62
62
  else if (props.thumb) return `${props.src}@!thumb`;
63
63
  else return `${props.src}@!thumb`;
64
64
  }),
65
- previewList: computed(() => props.preview && props.src ? [props.base64 ? `data:image/png;base64,${props.src}` : props.src] : [])
65
+ previewList: computed(() => {
66
+ if (!props.preview) return [];
67
+ if (props.previewSrcList.length > 0) return props.previewSrcList;
68
+ return props.src ? [props.base64 ? `data:image/png;base64,${props.src}` : props.src] : [];
69
+ })
66
70
  });
67
71
  watch(() => props.src, () => {
68
72
  state.loadError = false;
@@ -84,7 +88,8 @@ var image_default = defineComponent({
84
88
  ...slots.viewer && { viewer: () => slots.viewer?.({ src: state.src }) ?? [] },
85
89
  ...slots.progress && { progress: (scope) => slots.progress?.(scope) ?? [] },
86
90
  ...slots.toolbar && { toolbar: (scope) => slots.toolbar?.(scope) ?? [] },
87
- ...slots["viewer-error"] && { "viewer-error": (scope) => slots["viewer-error"]?.(scope) ?? [] }
91
+ ...slots.viewerError && { "viewer-error": slots.viewerError },
92
+ ...slots.viewerPlaceholder && { "viewer-placeholder": slots.viewerPlaceholder }
88
93
  }));
89
94
  return useExpose(expose, {
90
95
  /** 手动打开图片预览。 */
@@ -1 +1 @@
1
- {"version":3,"file":"image.mjs","names":["viewer-error"],"sources":["../../../../src/components/image/src/image.tsx"],"sourcesContent":["import { computed, defineComponent, reactive, shallowRef, watch } from \"vue\";\nimport { Picture as ElIconPicture } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElImage, imageEmits, imageProps } from \"element-plus\";\nimport { makeSlots, useEmits, useExpose, useProps, useRender } from \"../../../utils\";\nimport type { ImageInstance, ImageViewerAction } from \"element-plus\";\n\n/** FaImage 的运行时 Props 定义 */\nexport const faImageProps = {\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- Element Plus 2.x 尚未提供可替代的公开运行时 props 定义。\n\t...imageProps,\n\t/** when enabling preview, use this flag to control whether clicking on backdrop can exit preview mode. */\n\thideOnClickModal: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** whether to append image-viewer to body. A nested parent element attribute transform should have this attribute set to `true`. */\n\tpreviewTeleported: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** whether to use lazy load. */\n\tlazy: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** Base64图片 */\n\tbase64: Boolean,\n\t/** 原图 */\n\toriginal: Boolean,\n\t/** 标准 */\n\tnormal: Boolean,\n\t/** 小图 */\n\tsmall: Boolean,\n\t/** 缩略图 */\n\tthumb: Boolean,\n\t/** 是否可以预览图片 */\n\tpreview: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n};\n\n/** FaImage 的运行时事件定义。 */\nexport const faImageEmits = {\n\t...imageEmits,\n};\n\n/** FaImage 的插槽参数 */\nexport interface FaImageSlots extends Record<string, unknown> {\n\t/** 当图像尚未加载时,自定义的占位符内容 */\n\tplaceholder: never;\n\t/** 自定义图像加载失败的内容 */\n\terror: never;\n\t/** 当图像预览时自定义内容 */\n\tviewer: { src?: string };\n\t/** 图片预览进度内容 */\n\tprogress: { activeIndex: number; total: number };\n\t/** 图片预览工具栏内容 */\n\ttoolbar: {\n\t\tactions: (action: ImageViewerAction, options?: Record<string, never>) => void;\n\t\tprev: () => void;\n\t\tnext: () => void;\n\t\treset: () => void;\n\t\tactiveIndex: number;\n\t\tsetActiveItem: (index: number) => void;\n\t};\n\t/** 图片预览加载失败内容 */\n\t\"viewer-error\": { activeIndex: number; src: string };\n}\n\nexport default defineComponent({\n\tname: \"FaImage\",\n\tprops: faImageProps,\n\temits: faImageEmits,\n\tslots: makeSlots<FaImageSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst imageRef = shallowRef<ImageInstance | null>(null);\n\n\t\tconst state = reactive({\n\t\t\t/** 图片加载错误 */\n\t\t\tloadError: false,\n\t\t\tsrc: computed(() => {\n\t\t\t\tif (!props.src) return undefined;\n\t\t\t\tif (props.base64) {\n\t\t\t\t\treturn `data:image/png;base64,${props.src}`;\n\t\t\t\t} else if (props.original || state.loadError) {\n\t\t\t\t\treturn props.src;\n\t\t\t\t} else if (props.normal) {\n\t\t\t\t\treturn `${props.src}@!normal`;\n\t\t\t\t} else if (props.small) {\n\t\t\t\t\treturn `${props.src}@!small`;\n\t\t\t\t} else if (props.thumb) {\n\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t} else {\n\t\t\t\t\t// 默认使用缩略图\n\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t}\n\t\t\t}),\n\t\t\tpreviewList: computed(() => (props.preview && props.src ? [props.base64 ? `data:image/png;base64,${props.src}` : props.src] : [])),\n\t\t});\n\n\t\twatch(\n\t\t\t() => props.src,\n\t\t\t() => {\n\t\t\t\tstate.loadError = false;\n\t\t\t}\n\t\t);\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 透传范围必须与继承的 Element Plus 2.x 运行时 props 保持一致。\n\t\tconst bindProps = useProps(props, imageProps, [\"src\", \"previewSrcList\"]);\n\t\tconst bindEmits = useEmits(imageEmits, emit, [\"error\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElImage\n\t\t\t\t{...bindProps.value}\n\t\t\t\t{...bindEmits.value}\n\t\t\t\tclass=\"fa-image\"\n\t\t\t\tref={imageRef}\n\t\t\t\tsrc={state.src}\n\t\t\t\tpreviewSrcList={state.previewList}\n\t\t\t\tonError={(event) => {\n\t\t\t\t\tstate.loadError ||= true;\n\t\t\t\t\temit(\"error\", event);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\terror: () =>\n\t\t\t\t\t\tslots.error ? (\n\t\t\t\t\t\t\tslots.error()\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div class=\"fa-image__error-image\">\n\t\t\t\t\t\t\t\t<ElIcon class=\"icon\">\n\t\t\t\t\t\t\t\t\t<ElIconPicture />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\t...(slots.placeholder && { placeholder: () => slots.placeholder?.() ?? [] }),\n\t\t\t\t\t...(slots.viewer && { viewer: () => slots.viewer?.({ src: state.src }) ?? [] }),\n\t\t\t\t\t...(slots.progress && {\n\t\t\t\t\t\tprogress: (scope: { activeIndex: number; total: number }) => slots.progress?.(scope) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t\t...(slots.toolbar && {\n\t\t\t\t\t\ttoolbar: (scope: FaImageSlots[\"toolbar\"]) => slots.toolbar?.(scope) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t\t...(slots[\"viewer-error\"] && {\n\t\t\t\t\t\t\"viewer-error\": (scope: { activeIndex: number; src: string }) => slots[\"viewer-error\"]?.(scope) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElImage>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** 手动打开图片预览。 */\n\t\t\tshowPreview: computed(() => imageRef.value?.showPreview),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;AAOA,MAAa,eAAe;CAE3B,GAAG;;CAEH,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,mBAAmB;EAClB,MAAM;EACN,SAAS;CACV;;CAEA,MAAM;EACL,MAAM;EACN,SAAS;CACV;;CAEA,QAAQ;;CAER,UAAU;;CAEV,QAAQ;;CAER,OAAO;;CAEP,OAAO;;CAEP,SAAS;EACR,MAAM;EACN,SAAS;CACV;AACD;;AAGA,MAAa,eAAe,EAC3B,GAAG,WACJ;AAyBA,IAAA,gBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO;CACP,OAAO,UAAwB;CAC/B,MAAM,OAAO,EAAE,OAAO,MAAM,UAAU;EACrC,MAAM,WAAW,WAAiC,IAAI;EAEtD,MAAM,QAAQ,SAAS;;GAEtB,WAAW;GACX,KAAK,eAAe;IACnB,IAAI,CAAC,MAAM,KAAK,OAAO,KAAA;IACvB,IAAI,MAAM,QACT,OAAO,yBAAyB,MAAM;SAChC,IAAI,MAAM,YAAY,MAAM,WAClC,OAAO,MAAM;SACP,IAAI,MAAM,QAChB,OAAO,GAAG,MAAM,IAAG;SACb,IAAI,MAAM,OAChB,OAAO,GAAG,MAAM,IAAG;SACb,IAAI,MAAM,OAChB,OAAO,GAAG,MAAM,IAAG;SAGnB,OAAO,GAAG,MAAM,IAAG;GAErB,CAAC;GACD,aAAa,eAAgB,MAAM,WAAW,MAAM,MAAM,CAAC,MAAM,SAAS,yBAAyB,MAAM,QAAQ,MAAM,GAAG,IAAI,CAAA,CAAG;EAClI,CAAC;EAED,YACO,MAAM,WACN;GACL,MAAM,YAAY;EACnB,CACD;EAGA,MAAM,YAAY,SAAS,OAAO,YAAY,CAAC,OAAO,gBAAgB,CAAC;EACvE,MAAM,YAAY,SAAS,YAAY,MAAM,CAAC,OAAO,CAAC;EAEtD,gBAAU,YAAA,SAAA,WAEJ,UAAU,OACV,UAAU,OAAK;GAAA,SAAA;GAAA,OAEd;GAAQ,OACR,MAAM;GAAG,kBACE,MAAM;GAAW,YACvB,UAAU;IACnB,MAAM,cAAc;IACpB,KAAK,SAAS,KAAK;GACpB;EAAC,CAAA,GAAA;GAGA,aACC,MAAM,QACL,MAAM,MAAM,IAAC,YAAA,OAAA,EAAA,SAAA,wBAAA,GAAA,CAAA,YAAA,QAAA,EAAA,SAAA,OAAA,GAAA,EAAA,eAAA,CAAA,YAAA,SAAA,MAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA;GAQf,GAAI,MAAM,eAAe,EAAE,mBAAmB,MAAM,cAAc,KAAK,CAAA,EAAG;GAC1E,GAAI,MAAM,UAAU,EAAE,cAAc,MAAM,SAAS,EAAE,KAAK,MAAM,IAAI,CAAC,KAAK,CAAA,EAAG;GAC7E,GAAI,MAAM,YAAY,EACrB,WAAW,UAAkD,MAAM,WAAW,KAAK,KAAK,CAAA,EACzF;GACA,GAAI,MAAM,WAAW,EACpB,UAAU,UAAmC,MAAM,UAAU,KAAK,KAAK,CAAA,EACxE;GACA,GAAI,MAAM,mBAAmB,EAC5B,iBAAiB,UAAgD,MAAM,eAAe,GAAG,KAAK,KAAK,CAAA,EACpG;EAAE,CAAA,CAGJ;EAED,OAAO,UAAU,QAAQ;;AAExB,aAAa,eAAe,SAAS,OAAO,WAAW,EACxD,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"image.mjs","names":[],"sources":["../../../../src/components/image/src/image.tsx"],"sourcesContent":["import { computed, defineComponent, reactive, shallowRef, watch } from \"vue\";\nimport { Picture as ElIconPicture } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElImage, imageEmits, imageProps } from \"element-plus\";\nimport { makeSlots, useEmits, useExpose, useProps, useRender } from \"../../../utils\";\nimport type { ImageInstance, ImageViewerAction } from \"element-plus\";\n\n/** FaImage 的运行时 Props 定义 */\nexport const faImageProps = {\n\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- Element Plus 2.x 尚未提供可替代的公开运行时 props 定义。\n\t...imageProps,\n\t/** when enabling preview, use this flag to control whether clicking on backdrop can exit preview mode. */\n\thideOnClickModal: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** whether to append image-viewer to body. A nested parent element attribute transform should have this attribute set to `true`. */\n\tpreviewTeleported: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** whether to use lazy load. */\n\tlazy: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** Base64图片 */\n\tbase64: Boolean,\n\t/** 原图 */\n\toriginal: Boolean,\n\t/** 标准 */\n\tnormal: Boolean,\n\t/** 小图 */\n\tsmall: Boolean,\n\t/** 缩略图 */\n\tthumb: Boolean,\n\t/** 是否可以预览图片 */\n\tpreview: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n};\n\n/** FaImage 的运行时事件定义。 */\nexport const faImageEmits = {\n\t...imageEmits,\n};\n\n/** FaImage 的插槽参数 */\nexport interface FaImageSlots extends Record<string, unknown> {\n\t/** 当图像尚未加载时,自定义的占位符内容 */\n\tplaceholder: never;\n\t/** 自定义图像加载失败的内容 */\n\terror: never;\n\t/** 当图像预览时自定义内容 */\n\tviewer: { src?: string };\n\t/** 图片预览进度内容 */\n\tprogress: { activeIndex: number; total: number };\n\t/** 图片预览工具栏内容 */\n\ttoolbar: {\n\t\tactions: (action: ImageViewerAction, options?: Record<string, never>) => void;\n\t\tprev: () => void;\n\t\tnext: () => void;\n\t\treset: () => void;\n\t\tactiveIndex: number;\n\t\tsetActiveItem: (index: number) => void;\n\t};\n\t/** 图片预览加载失败内容 */\n\tviewerError: { activeIndex: number; src: string };\n\t/** 图片预览加载时的占位内容 */\n\tviewerPlaceholder: { activeIndex: number; src: string };\n}\n\nexport default defineComponent({\n\tname: \"FaImage\",\n\tprops: faImageProps,\n\temits: faImageEmits,\n\tslots: makeSlots<FaImageSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst imageRef = shallowRef<ImageInstance | null>(null);\n\n\t\tconst state = reactive({\n\t\t\t/** 图片加载错误 */\n\t\t\tloadError: false,\n\t\t\tsrc: computed(() => {\n\t\t\t\tif (!props.src) return undefined;\n\t\t\t\tif (props.base64) {\n\t\t\t\t\treturn `data:image/png;base64,${props.src}`;\n\t\t\t\t} else if (props.original || state.loadError) {\n\t\t\t\t\treturn props.src;\n\t\t\t\t} else if (props.normal) {\n\t\t\t\t\treturn `${props.src}@!normal`;\n\t\t\t\t} else if (props.small) {\n\t\t\t\t\treturn `${props.src}@!small`;\n\t\t\t\t} else if (props.thumb) {\n\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t} else {\n\t\t\t\t\t// 默认使用缩略图\n\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t}\n\t\t\t}),\n\t\t\tpreviewList: computed(() => {\n\t\t\t\tif (!props.preview) return [];\n\t\t\t\tif (props.previewSrcList.length > 0) return props.previewSrcList;\n\t\t\t\treturn props.src ? [props.base64 ? `data:image/png;base64,${props.src}` : props.src] : [];\n\t\t\t}),\n\t\t});\n\n\t\twatch(\n\t\t\t() => props.src,\n\t\t\t() => {\n\t\t\t\tstate.loadError = false;\n\t\t\t}\n\t\t);\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated -- 透传范围必须与继承的 Element Plus 2.x 运行时 props 保持一致。\n\t\tconst bindProps = useProps(props, imageProps, [\"src\", \"previewSrcList\"]);\n\t\tconst bindEmits = useEmits(imageEmits, emit, [\"error\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElImage\n\t\t\t\t{...bindProps.value}\n\t\t\t\t{...bindEmits.value}\n\t\t\t\tclass=\"fa-image\"\n\t\t\t\tref={imageRef}\n\t\t\t\tsrc={state.src}\n\t\t\t\tpreviewSrcList={state.previewList}\n\t\t\t\tonError={(event) => {\n\t\t\t\t\tstate.loadError ||= true;\n\t\t\t\t\temit(\"error\", event);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\terror: () =>\n\t\t\t\t\t\tslots.error ? (\n\t\t\t\t\t\t\tslots.error()\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div class=\"fa-image__error-image\">\n\t\t\t\t\t\t\t\t<ElIcon class=\"icon\">\n\t\t\t\t\t\t\t\t\t<ElIconPicture />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\t...(slots.placeholder && { placeholder: () => slots.placeholder?.() ?? [] }),\n\t\t\t\t\t...(slots.viewer && { viewer: () => slots.viewer?.({ src: state.src }) ?? [] }),\n\t\t\t\t\t...(slots.progress && {\n\t\t\t\t\t\tprogress: (scope: { activeIndex: number; total: number }) => slots.progress?.(scope) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t\t...(slots.toolbar && {\n\t\t\t\t\t\ttoolbar: (scope: FaImageSlots[\"toolbar\"]) => slots.toolbar?.(scope) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t\t...(slots.viewerError && { \"viewer-error\": slots.viewerError }),\n\t\t\t\t\t...(slots.viewerPlaceholder && { \"viewer-placeholder\": slots.viewerPlaceholder }),\n\t\t\t\t}}\n\t\t\t</ElImage>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** 手动打开图片预览。 */\n\t\t\tshowPreview: computed(() => imageRef.value?.showPreview),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;AAOA,MAAa,eAAe;CAE3B,GAAG;;CAEH,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,mBAAmB;EAClB,MAAM;EACN,SAAS;CACV;;CAEA,MAAM;EACL,MAAM;EACN,SAAS;CACV;;CAEA,QAAQ;;CAER,UAAU;;CAEV,QAAQ;;CAER,OAAO;;CAEP,OAAO;;CAEP,SAAS;EACR,MAAM;EACN,SAAS;CACV;AACD;;AAGA,MAAa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,QAAA,EAAA,SAAA,OAAA,GAAA,EAAA,eAAA,CAAA,YAAA,SAAA,MAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA;GAQf,GAAI,MAAM,eAAe,EAAE,mBAAmB,MAAM,cAAc,KAAK,CAAA,EAAG;GAC1E,GAAI,MAAM,UAAU,EAAE,cAAc,MAAM,SAAS,EAAE,KAAK,MAAM,IAAI,CAAC,KAAK,CAAA,EAAG;GAC7E,GAAI,MAAM,YAAY,EACrB,WAAW,UAAkD,MAAM,WAAW,KAAK,KAAK,CAAA,EACzF;GACA,GAAI,MAAM,WAAW,EACpB,UAAU,UAAmC,MAAM,UAAU,KAAK,KAAK,CAAA,EACxE;GACA,GAAI,MAAM,eAAe,EAAE,gBAAgB,MAAM,YAAY;GAC7D,GAAI,MAAM,qBAAqB,EAAE,sBAAsB,MAAM,kBAAkB;EAAE,CAAA,CAGnF;EAED,OAAO,UAAU,QAAQ;;AAExB,aAAa,eAAe,SAAS,OAAO,WAAW,EACxD,CAAC;CACF;AACD,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { SelectInstance } from "element-plus";
1
2
  import type { PagedInput } from "../../table";
2
3
  import type { ElSelectorModelValue, ElSelectorOutput, ElSelectorValue } from "./select.type";
3
4
  /** 传递给底层 Element Plus 选择器的扩展 Props。 */
@@ -140,7 +141,7 @@ export declare const faSelectProps: {
140
141
  suffixIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
141
142
  tagType: {
142
143
  default: string;
143
- type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "info" | "primary" | "success" | "warning" | "danger", unknown>>;
144
+ type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown>>;
144
145
  required: false;
145
146
  validator: ((val: unknown) => boolean) | undefined;
146
147
  __epPropKey: true;
@@ -158,7 +159,7 @@ export declare const faSelectProps: {
158
159
  offset: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
159
160
  placement: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => "auto" | "left" | "right" | "bottom" | "top" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement) | (((new (...args: any[]) => "auto" | "left" | "right" | "bottom" | "top" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement)) | null)[], import("element-plus").Placement, unknown, string, boolean>;
160
161
  fallbackPlacements: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]) | (((new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[])) | null)[], unknown, unknown, string[], boolean>;
161
- tabindex: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(StringConstructor | NumberConstructor)[], unknown, unknown, number, boolean>;
162
+ tabindex: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(NumberConstructor | StringConstructor)[], unknown, unknown, number, boolean>;
162
163
  appendTo: {
163
164
  readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement)) | null)[], unknown, unknown>>;
164
165
  readonly required: false;
@@ -206,13 +207,18 @@ export interface FaSelectSlots extends Record<string, unknown> {
206
207
  /** 无选项时的列表 */
207
208
  empty: never;
208
209
  /** select 组件自定义标签内容 */
209
- tag: never;
210
+ tag: {
211
+ data: SelectInstance["states"]["selected"];
212
+ deleteTag: SelectInstance["deleteTag"];
213
+ selectDisabled: boolean;
214
+ };
210
215
  /** Select 组件自定义加载内容 */
211
216
  loading: never;
212
217
  /** select 组件自定义标签内容 */
213
218
  label: {
214
219
  label: string;
215
220
  value: string | number | boolean | object;
221
+ index?: number;
216
222
  };
217
223
  }
218
224
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -343,7 +349,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
343
349
  suffixIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
344
350
  tagType: {
345
351
  default: string;
346
- type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "info" | "primary" | "success" | "warning" | "danger", unknown>>;
352
+ type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown>>;
347
353
  required: false;
348
354
  validator: ((val: unknown) => boolean) | undefined;
349
355
  __epPropKey: true;
@@ -361,7 +367,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
361
367
  offset: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
362
368
  placement: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => "auto" | "left" | "right" | "bottom" | "top" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement) | (((new (...args: any[]) => "auto" | "left" | "right" | "bottom" | "top" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement)) | null)[], import("element-plus").Placement, unknown, string, boolean>;
363
369
  fallbackPlacements: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]) | (((new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[])) | null)[], unknown, unknown, string[], boolean>;
364
- tabindex: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(StringConstructor | NumberConstructor)[], unknown, unknown, number, boolean>;
370
+ tabindex: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(NumberConstructor | StringConstructor)[], unknown, unknown, number, boolean>;
365
371
  appendTo: {
366
372
  readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement)) | null)[], unknown, unknown>>;
367
373
  readonly required: false;
@@ -536,7 +542,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
536
542
  suffixIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
537
543
  tagType: {
538
544
  default: string;
539
- type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "info" | "primary" | "success" | "warning" | "danger", unknown>>;
545
+ type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown>>;
540
546
  required: false;
541
547
  validator: ((val: unknown) => boolean) | undefined;
542
548
  __epPropKey: true;
@@ -554,7 +560,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
554
560
  offset: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
555
561
  placement: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => "auto" | "left" | "right" | "bottom" | "top" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement) | (((new (...args: any[]) => "auto" | "left" | "right" | "bottom" | "top" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement)) | null)[], import("element-plus").Placement, unknown, string, boolean>;
556
562
  fallbackPlacements: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[]) | (((new (...args: any[]) => import("element-plus").Placement[]) | (() => import("element-plus").Placement[])) | null)[], unknown, unknown, string[], boolean>;
557
- tabindex: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(StringConstructor | NumberConstructor)[], unknown, unknown, number, boolean>;
563
+ tabindex: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(NumberConstructor | StringConstructor)[], unknown, unknown, number, boolean>;
558
564
  appendTo: {
559
565
  readonly type: import("vue").PropType<import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement)) | null)[], unknown, unknown>>;
560
566
  readonly required: false;
@@ -288,7 +288,8 @@ var select_default = defineComponent({
288
288
  "modelValue",
289
289
  "popperClass",
290
290
  "loading",
291
- "props"
291
+ "props",
292
+ "options"
292
293
  ]);
293
294
  const elSelectEmits = useEmits(selectEmits, emit, [
294
295
  "update:modelValue",
@@ -319,12 +320,9 @@ var select_default = defineComponent({
319
320
  ...slots.footer && { footer: () => slots.footer?.() ?? [] },
320
321
  ...slots.prefix && { prefix: () => slots.prefix?.() ?? [] },
321
322
  ...slots.empty && { empty: () => slots.empty?.() ?? [] },
322
- ...slots.tag && { tag: () => slots.tag?.() ?? [] },
323
+ ...slots.tag && { tag: slots.tag },
323
324
  ...slots.loading && { loading: () => slots.loading?.() ?? [] },
324
- ...slots.label && { label: ({ label, value }) => slots.label?.({
325
- label,
326
- value
327
- }) ?? [] }
325
+ ...slots.label && { label: slots.label }
328
326
  }));
329
327
  return useExpose(expose, {
330
328
  /** 使选择器的输入框获取焦点 */
@@ -1 +1 @@
1
- {"version":3,"file":"select.mjs","names":["update:modelValue","update:label"],"sources":["../../../../src/components/select/src/select.tsx"],"sourcesContent":["import { computed, defineComponent, onMounted, reactive, shallowRef, toRef, useModel, watch } from \"vue\";\nimport { ElSelect, selectEmits, selectProps, useGlobalSize } from \"element-plus\";\nimport { addCssUnit, definePropType, isEqual, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport FaSelectOption from \"./selectOption\";\nimport type { PagedInput } from \"../../table\";\nimport type { ElSelectorModelValue, ElSelectorOutput, ElSelectorValue } from \"./select.type\";\n\n/** 传递给底层 Element Plus 选择器的扩展 Props。 */\nexport interface SelectComponentProps {\n\t/** 指定标签为节点的某个属性值 */\n\tlabel?: string | ((data: ElSelectorOutput) => string);\n\t/** 指定是否隐藏为节点的某个属性值 */\n\thide?: string | ((data: ElSelectorOutput) => boolean);\n\t/** 指定是否禁用为节点的某个属性值 */\n\tdisabled?: string | ((data: ElSelectorOutput) => boolean);\n\t/** 指定子节点对象为节点的某个属性值 */\n\tchildren?: string;\n}\n\n/** FaSelect 的运行时 Props 定义 */\nexport const faSelectProps = {\n\t...selectProps,\n\t/** 是否禁用选择器;未指定时继承 ElForm 的禁用状态。 */\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** 远程数据加载时显示的文本;默认显示“加载中...”。 */\n\tloadingText: {\n\t\ttype: String,\n\t\tdefault: \"加载中...\",\n\t},\n\t/** 筛选结果为空时显示的文本,也可通过 empty 插槽替换。 */\n\tnoMatchText: {\n\t\ttype: String,\n\t\tdefault: \"暂无匹配的数据\",\n\t},\n\t/** 没有可选数据时显示的文本,也可通过 empty 插槽替换。 */\n\tnoDataText: {\n\t\ttype: String,\n\t\tdefault: \"暂无数据\",\n\t},\n\t/** 多选时是否折叠已选标签 */\n\tcollapseTags: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 悬停折叠标签时是否显示全部选项;仅在 collapse-tags 开启时有效。 */\n\tcollapseTagsTooltip: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** v-model 绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<ElSelectorModelValue>([String, Number, Boolean, Object, Array]),\n\t\tdefault: undefined,\n\t},\n\t/** v-model:label 绑定值 */\n\tlabel: definePropType<string | string[] | null>([String, Array]),\n\t/** 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"100%\",\n\t},\n\t/** 插槽使用的附加状态 */\n\tmoreDetail: Boolean,\n\t/** 是否延迟加载远程数据;开启后在首次打开下拉框时请求。 */\n\tlazy: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 是否默认选中;不能与懒加载同时使用。 */\n\tdefaultSelected: Boolean,\n\t/** 配置选项 */\n\tprops: {\n\t\ttype: definePropType<SelectComponentProps>(Object),\n\t\tdefault: () => ({\n\t\t\tlabel: \"label\",\n\t\t\thide: \"hide\",\n\t\t\tdisabled: \"disabled\",\n\t\t\tchildren: \"children\",\n\t\t}),\n\t},\n\t/** 下拉框数据 */\n\tdata: {\n\t\ttype: definePropType<ElSelectorOutput[]>(Array),\n\t\tdefault: () => [],\n\t},\n\t/** 请求数据的函数 */\n\trequestApi: {\n\t\ttype: definePropType<(params?: string | number | PagedInput) => Promise<ElSelectorOutput[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | PagedInput>([String, Number, Object]),\n};\n\n/** FaSelect 的运行时 Emits 定义 */\nexport const faSelectEmits = {\n\t...selectEmits,\n\t/** v-model 回调 */\n\t\"update:modelValue\": (value: ElSelectorModelValue) =>\n\t\ttypeof value === \"string\" ||\n\t\ttypeof value === \"number\" ||\n\t\ttypeof value === \"boolean\" ||\n\t\t(typeof value === \"object\" && value !== null) ||\n\t\tvalue == null,\n\t/** 选中数据改变 */\n\tchange: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue) => true,\n\t/** v-model:label 回调 */\n\t\"update:label\": (value: string | string[] | null) => typeof value === \"string\" || Array.isArray(value) || value === null,\n\t/** 数据改变 */\n\tdataChange: (data: ElSelectorOutput[]) => Array.isArray(data),\n};\n\n/** FaSelect 的插槽参数 */\nexport interface FaSelectSlots extends Record<string, unknown> {\n\t/** FaSelectOption 默认内容插槽 */\n\tdefault: ElSelectorOutput;\n\t/** 下拉列表顶部的内容 */\n\theader: never;\n\t/** 下拉列表底部的内容 */\n\tfooter: never;\n\t/** Select 组件头部内容 */\n\tprefix: never;\n\t/** 无选项时的列表 */\n\tempty: never;\n\t/** select 组件自定义标签内容 */\n\ttag: never;\n\t/** Select 组件自定义加载内容 */\n\tloading: never;\n\t/** select 组件自定义标签内容 */\n\tlabel: { label: string; value: string | number | boolean | object };\n}\n\nexport default defineComponent({\n\tname: \"FaSelect\",\n\tprops: faSelectProps,\n\temits: faSelectEmits,\n\tslots: makeSlots<FaSelectSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst selectedLabel = useModel(props, \"label\");\n\n\t\tconst globalSize = useGlobalSize();\n\t\tconst selectRef = shallowRef<InstanceType<typeof ElSelect> | null>(null);\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<ElSelectorModelValue>(),\n\t\t\tloading: false,\n\t\t\tselectorData: withDefineType<ElSelectorOutput[]>([]),\n\t\t\t/** 首次出现 */\n\t\t\tdebut: true,\n\t\t\t/** 回显 */\n\t\t\techo: true,\n\t\t\t/** 下次刷新 */\n\t\t\tnextRefresh: false,\n\t\t});\n\n\t\tlet requestVersion = 0;\n\n\t\tconst handleData = (data: ElSelectorOutput[]): ElSelectorOutput[] => {\n\t\t\treturn data\n\t\t\t\t.map((item) => {\n\t\t\t\t\tconst value: unknown = item[props.valueKey];\n\t\t\t\t\tconst label: unknown = typeof props.props.label === \"function\" ? props.props.label(item) : item[props.props.label ?? \"label\"];\n\t\t\t\t\tconst hide: unknown = typeof props.props.hide === \"function\" ? props.props.hide(item) : item[props.props.hide ?? \"hide\"];\n\t\t\t\t\tconst disabled: unknown =\n\t\t\t\t\t\ttypeof props.props.disabled === \"function\" ? props.props.disabled(item) : item[props.props.disabled ?? \"disabled\"];\n\t\t\t\t\tconst children: unknown = item[props.props.children ?? \"children\"];\n\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t(typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"object\")\n\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...item,\n\t\t\t\t\t\tchildren: Array.isArray(children) ? handleData(children as ElSelectorOutput[]) : [],\n\t\t\t\t\t\tdisabled: typeof disabled === \"boolean\" ? disabled : undefined,\n\t\t\t\t\t\thide: typeof hide === \"boolean\" ? hide : undefined,\n\t\t\t\t\t\tlabel: typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.filter((item) => item.hide !== true);\n\t\t};\n\n\t\tconst loadData = async () => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = props.initParam ?? {};\n\t\t\t\ttry {\n\t\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\t// 这里不允许回显了\n\t\t\t\t\tstate.echo = false;\n\t\t\t\t\tstate.selectorData = handleData(resData);\n\t\t\t\t\temit(\"dataChange\", state.selectorData);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\tstate.selectorData = [];\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t// 这里不允许回显了\n\t\t\t\tstate.echo = false;\n\t\t\t\tstate.selectorData = handleData(props.data);\n\t\t\t}\n\t\t};\n\n\t\tconst handleModelValueUpdate = (value: ElSelectorModelValue) => {\n\t\t\tstate.value = value;\n\t\t\temit(\"update:modelValue\", value);\n\t\t};\n\n\t\tconst handleVisibleChange = async (visible: boolean) => {\n\t\t\tif (visible) {\n\t\t\t\tif (state.debut) {\n\t\t\t\t\t// 首次出现\n\t\t\t\t\tstate.debut = false;\n\t\t\t\t\t// 懒加载\n\t\t\t\t\t!props.defaultSelected && props.lazy && (await loadData());\n\t\t\t\t} else {\n\t\t\t\t\t// 判断再次出现是否需要刷新数据\n\t\t\t\t\tif (state.nextRefresh) {\n\t\t\t\t\t\tstate.nextRefresh = false;\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// eslint-disable-next-line vue/custom-event-name-casing -- Element Plus 的公开事件名为 visible-change,需要保持原始名称透传。\n\t\t\temit(\"visible-change\", visible);\n\t\t};\n\n\t\tconst flattenOptions = (data: ElSelectorOutput[]): ElSelectorOutput[] =>\n\t\t\tdata.flatMap((item) => [item, ...flattenOptions(item.children ?? [])]);\n\n\t\tconst handleChange = (value?: ElSelectorModelValue) => {\n\t\t\tif (props.multiple) {\n\t\t\t\tconst valueList = Array.isArray(value) ? value : [];\n\t\t\t\tif (valueList.length === 0) {\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst selectorData = flattenOptions(state.selectorData);\n\t\t\t\tconst dataList = valueList\n\t\t\t\t\t.map((item) => selectorData.find((option) => option.value !== undefined && isEqual(option.value, item)))\n\t\t\t\t\t.filter((item) => item !== undefined);\n\t\t\t\temit(\"change\", dataList, value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (value == null || Array.isArray(value)) {\n\t\t\t\temit(\"change\", null, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst data = flattenOptions(state.selectorData).find((item) => item.value !== undefined && isEqual(item.value, value));\n\t\t\temit(\"change\", data ?? null, value);\n\t\t};\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tif (state.echo && newValue != null) {\n\t\t\t\t\tconst hasLabel = props.label != null;\n\t\t\t\t\t// 判断是否为多选\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\t// 判断是否为数组\n\t\t\t\t\t\tif (!Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelect]\", \"当启用 multiple 时,传入的 modelValue 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && !Array.isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelect]\", \"当启用 multiple 时,传入的 modelValue:label 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = newValue\n\t\t\t\t\t\t\t// 最大选项截取\n\t\t\t\t\t\t\t.slice(0, props.multipleLimit > 0 ? props.multipleLimit : newValue.length)\n\t\t\t\t\t\t\t.map((item, index) => {\n\t\t\t\t\t\t\t\tconst value: unknown = item;\n\t\t\t\t\t\t\t\tconst label: unknown = Array.isArray(props.label) ? props.label[index] : undefined;\n\t\t\t\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t\t\t\t(typeof value === \"string\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"number\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"boolean\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"object\")\n\t\t\t\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t\t\t\t\tlabel: hasLabel && typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelect]\", \"当禁用 multiple 时,传入的 modelValue 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && Array.isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelect]\", \"当禁用 multiple 时,传入的 modelValue:label 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\t\tlabel: typeof props.label === \"string\" ? props.label : undefined,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstate.value = newValue;\n\t\t\t},\n\t\t\t{\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\twatch(\n\t\t\t[() => state.value, () => state.selectorData],\n\t\t\t([value]) => {\n\t\t\t\tconst selectorData = flattenOptions(state.selectorData);\n\n\t\t\t\tif (props.multiple) {\n\t\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tselectedLabel.value = value.map((item, index) => {\n\t\t\t\t\t\tconst data = selectorData.find((option) => option.value !== undefined && isEqual(option.value, item));\n\n\t\t\t\t\t\treturn data?.label ?? (Array.isArray(props.label) ? (props.label[index] ?? \"\") : \"\");\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (value == null || Array.isArray(value)) {\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselectedLabel.value =\n\t\t\t\t\tselectorData.find((item) => item.value !== undefined && isEqual(item.value, value))?.label ??\n\t\t\t\t\t(typeof props.label === \"string\" ? props.label : null);\n\t\t\t},\n\t\t\t{\n\t\t\t\tdeep: true,\n\t\t\t\tflush: \"sync\",\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.initParam,\n\t\t\t(newValue, oldValue) => {\n\t\t\t\tif (!isEqual(newValue, oldValue)) {\n\t\t\t\t\tstate.nextRefresh = true;\n\t\t\t\t\tif (state.value != null) {\n\t\t\t\t\t\thandleModelValueUpdate(props.multiple ? [] : undefined);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.data,\n\t\t\t() => {\n\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\treturn loadData();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ deep: true }\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.data.length,\n\t\t\t(length) => {\n\t\t\t\tif (state.debut) state.echo = length === 0;\n\t\t\t},\n\t\t\t{ immediate: true }\n\t\t);\n\n\t\tonMounted(async () => {\n\t\t\tif (props.defaultSelected) {\n\t\t\t\tawait loadData();\n\t\t\t\tconst firstItem = state.selectorData[0];\n\t\t\t\tif (firstItem?.value !== undefined) {\n\t\t\t\t\thandleModelValueUpdate(props.multiple ? [firstItem.value] : firstItem.value);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 判断是否为本地数据\n\t\t\telse if (!props.requestApi && props.data.length > 0) {\n\t\t\t\tstate.debut = false;\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\t// 判断是否非默认选中,且未启用懒加载\n\t\t\telse if (!props.lazy) {\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t});\n\n\t\tconst elSelectProps = useProps(props, selectProps, [\"modelValue\", \"popperClass\", \"loading\", \"props\"]);\n\t\tconst elSelectEmits = useEmits(selectEmits, emit, [\"update:modelValue\", \"change\", \"visible-change\"]);\n\t\tconst elPopperClass = computed(() => [\n\t\t\t\"fa-select-dropdown\",\n\t\t\tprops.popperClass,\n\t\t\tprops.moreDetail && `fa-select-dropdown__more-detail fa-select-dropdown__more-detail-${globalSize.value}`,\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<ElSelect\n\t\t\t\t{...elSelectProps.value}\n\t\t\t\t{...elSelectEmits.value}\n\t\t\t\tref={selectRef}\n\t\t\t\tclass=\"fa-select\"\n\t\t\t\tpopperClass={elPopperClass.value}\n\t\t\t\tstyle={{ width: addCssUnit(props.width) }}\n\t\t\t\tmodelValue={state.value}\n\t\t\t\tonUpdate:modelValue={handleModelValueUpdate}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tloading={state.loading}\n\t\t\t\tonVisible-change={handleVisibleChange}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\tstate.selectorData.map((item) => (\n\t\t\t\t\t\t\t<FaSelectOption vSlots={{ default: slots.default }} data={item} moreDetail={props.moreDetail} />\n\t\t\t\t\t\t)),\n\t\t\t\t\t...(slots.header && { header: () => slots.header?.() ?? [] }),\n\t\t\t\t\t...(slots.footer && { footer: () => slots.footer?.() ?? [] }),\n\t\t\t\t\t...(slots.prefix && { prefix: () => slots.prefix?.() ?? [] }),\n\t\t\t\t\t...(slots.empty && { empty: () => slots.empty?.() ?? [] }),\n\t\t\t\t\t...(slots.tag && { tag: () => slots.tag?.() ?? [] }),\n\t\t\t\t\t...(slots.loading && { loading: () => slots.loading?.() ?? [] }),\n\t\t\t\t\t...(slots.label && {\n\t\t\t\t\t\tlabel: ({ label, value }: { label: string; value: string | number | boolean | object }) =>\n\t\t\t\t\t\t\tslots.label?.({ label, value }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElSelect>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** 使选择器的输入框获取焦点 */\n\t\t\tfocus: computed(() => selectRef.value?.focus),\n\t\t\t/** 使选择器的输入框失去焦点,并隐藏下拉框 */\n\t\t\tblur: computed(() => selectRef.value?.blur),\n\t\t\t/** 获取当前选中的标签 */\n\t\t\tselectedLabel: computed(() => selectRef.value?.selectedLabel),\n\t\t\t/** 加载状态 */\n\t\t\tloading: toRef(state, \"loading\"),\n\t\t\t/** 刷新 */\n\t\t\trefresh: loadData,\n\t\t\t/** 设置选择 */\n\t\t\tsetSelection: (value: Exclude<ElSelectorModelValue, null | undefined>) => handleModelValueUpdate(value),\n\t\t\t/** 清除选择 */\n\t\t\tclearSelection: () => handleModelValueUpdate(props.multiple ? [] : undefined),\n\t\t});\n\t},\n});\n"],"mappings":";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AAA,EAAG;GAClD,GAAI,MAAM,WAAW,EAAE,eAAe,MAAM,UAAU,KAAK,CAAA,EAAG;GAC9D,GAAI,MAAM,SAAS,EAClB,QAAQ,EAAE,OAAO,YAChB,MAAM,QAAQ;IAAE;IAAO;GAAM,CAAC,KAAK,CAAA,EACrC;EAAE,CAAA,CAGJ;EAED,OAAO,UAAU,QAAQ;;GAExB,OAAO,eAAe,UAAU,OAAO,KAAK;;GAE5C,MAAM,eAAe,UAAU,OAAO,IAAI;;GAE1C,eAAe,eAAe,UAAU,OAAO,aAAa;;GAE5D,SAAS,MAAM,OAAO,SAAS;;GAE/B,SAAS;;GAET,eAAe,UAA2D,uBAAuB,KAAK;;GAEtG,sBAAsB,uBAAuB,MAAM,WAAW,CAAA,IAAK,KAAA,CAAS;EAC7E,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"select.mjs","names":["update:modelValue","update:label"],"sources":["../../../../src/components/select/src/select.tsx"],"sourcesContent":["import { computed, defineComponent, onMounted, reactive, shallowRef, toRef, useModel, watch } from \"vue\";\nimport { ElSelect, selectEmits, selectProps, useGlobalSize } from \"element-plus\";\nimport { addCssUnit, definePropType, isEqual, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport FaSelectOption from \"./selectOption\";\nimport type { SelectInstance } from \"element-plus\";\nimport type { PagedInput } from \"../../table\";\nimport type { ElSelectorModelValue, ElSelectorOutput, ElSelectorValue } from \"./select.type\";\n\n/** 传递给底层 Element Plus 选择器的扩展 Props。 */\nexport interface SelectComponentProps {\n\t/** 指定标签为节点的某个属性值 */\n\tlabel?: string | ((data: ElSelectorOutput) => string);\n\t/** 指定是否隐藏为节点的某个属性值 */\n\thide?: string | ((data: ElSelectorOutput) => boolean);\n\t/** 指定是否禁用为节点的某个属性值 */\n\tdisabled?: string | ((data: ElSelectorOutput) => boolean);\n\t/** 指定子节点对象为节点的某个属性值 */\n\tchildren?: string;\n}\n\n/** FaSelect 的运行时 Props 定义 */\nexport const faSelectProps = {\n\t...selectProps,\n\t/** 是否禁用选择器;未指定时继承 ElForm 的禁用状态。 */\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** 远程数据加载时显示的文本;默认显示“加载中...”。 */\n\tloadingText: {\n\t\ttype: String,\n\t\tdefault: \"加载中...\",\n\t},\n\t/** 筛选结果为空时显示的文本,也可通过 empty 插槽替换。 */\n\tnoMatchText: {\n\t\ttype: String,\n\t\tdefault: \"暂无匹配的数据\",\n\t},\n\t/** 没有可选数据时显示的文本,也可通过 empty 插槽替换。 */\n\tnoDataText: {\n\t\ttype: String,\n\t\tdefault: \"暂无数据\",\n\t},\n\t/** 多选时是否折叠已选标签 */\n\tcollapseTags: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 悬停折叠标签时是否显示全部选项;仅在 collapse-tags 开启时有效。 */\n\tcollapseTagsTooltip: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** v-model 绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<ElSelectorModelValue>([String, Number, Boolean, Object, Array]),\n\t\tdefault: undefined,\n\t},\n\t/** v-model:label 绑定值 */\n\tlabel: definePropType<string | string[] | null>([String, Array]),\n\t/** 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"100%\",\n\t},\n\t/** 插槽使用的附加状态 */\n\tmoreDetail: Boolean,\n\t/** 是否延迟加载远程数据;开启后在首次打开下拉框时请求。 */\n\tlazy: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** 是否默认选中;不能与懒加载同时使用。 */\n\tdefaultSelected: Boolean,\n\t/** 配置选项 */\n\tprops: {\n\t\ttype: definePropType<SelectComponentProps>(Object),\n\t\tdefault: () => ({\n\t\t\tlabel: \"label\",\n\t\t\thide: \"hide\",\n\t\t\tdisabled: \"disabled\",\n\t\t\tchildren: \"children\",\n\t\t}),\n\t},\n\t/** 下拉框数据 */\n\tdata: {\n\t\ttype: definePropType<ElSelectorOutput[]>(Array),\n\t\tdefault: () => [],\n\t},\n\t/** 请求数据的函数 */\n\trequestApi: {\n\t\ttype: definePropType<(params?: string | number | PagedInput) => Promise<ElSelectorOutput[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | PagedInput>([String, Number, Object]),\n};\n\n/** FaSelect 的运行时 Emits 定义 */\nexport const faSelectEmits = {\n\t...selectEmits,\n\t/** v-model 回调 */\n\t\"update:modelValue\": (value: ElSelectorModelValue) =>\n\t\ttypeof value === \"string\" ||\n\t\ttypeof value === \"number\" ||\n\t\ttypeof value === \"boolean\" ||\n\t\t(typeof value === \"object\" && value !== null) ||\n\t\tvalue == null,\n\t/** 选中数据改变 */\n\tchange: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue) => true,\n\t/** v-model:label 回调 */\n\t\"update:label\": (value: string | string[] | null) => typeof value === \"string\" || Array.isArray(value) || value === null,\n\t/** 数据改变 */\n\tdataChange: (data: ElSelectorOutput[]) => Array.isArray(data),\n};\n\n/** FaSelect 的插槽参数 */\nexport interface FaSelectSlots extends Record<string, unknown> {\n\t/** FaSelectOption 默认内容插槽 */\n\tdefault: ElSelectorOutput;\n\t/** 下拉列表顶部的内容 */\n\theader: never;\n\t/** 下拉列表底部的内容 */\n\tfooter: never;\n\t/** Select 组件头部内容 */\n\tprefix: never;\n\t/** 无选项时的列表 */\n\tempty: never;\n\t/** select 组件自定义标签内容 */\n\ttag: { data: SelectInstance[\"states\"][\"selected\"]; deleteTag: SelectInstance[\"deleteTag\"]; selectDisabled: boolean };\n\t/** Select 组件自定义加载内容 */\n\tloading: never;\n\t/** select 组件自定义标签内容 */\n\tlabel: { label: string; value: string | number | boolean | object; index?: number };\n}\n\nexport default defineComponent({\n\tname: \"FaSelect\",\n\tprops: faSelectProps,\n\temits: faSelectEmits,\n\tslots: makeSlots<FaSelectSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst selectedLabel = useModel(props, \"label\");\n\n\t\tconst globalSize = useGlobalSize();\n\t\tconst selectRef = shallowRef<InstanceType<typeof ElSelect> | null>(null);\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<ElSelectorModelValue>(),\n\t\t\tloading: false,\n\t\t\tselectorData: withDefineType<ElSelectorOutput[]>([]),\n\t\t\t/** 首次出现 */\n\t\t\tdebut: true,\n\t\t\t/** 回显 */\n\t\t\techo: true,\n\t\t\t/** 下次刷新 */\n\t\t\tnextRefresh: false,\n\t\t});\n\n\t\tlet requestVersion = 0;\n\n\t\tconst handleData = (data: ElSelectorOutput[]): ElSelectorOutput[] => {\n\t\t\treturn data\n\t\t\t\t.map((item) => {\n\t\t\t\t\tconst value: unknown = item[props.valueKey];\n\t\t\t\t\tconst label: unknown = typeof props.props.label === \"function\" ? props.props.label(item) : item[props.props.label ?? \"label\"];\n\t\t\t\t\tconst hide: unknown = typeof props.props.hide === \"function\" ? props.props.hide(item) : item[props.props.hide ?? \"hide\"];\n\t\t\t\t\tconst disabled: unknown =\n\t\t\t\t\t\ttypeof props.props.disabled === \"function\" ? props.props.disabled(item) : item[props.props.disabled ?? \"disabled\"];\n\t\t\t\t\tconst children: unknown = item[props.props.children ?? \"children\"];\n\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t(typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"object\")\n\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...item,\n\t\t\t\t\t\tchildren: Array.isArray(children) ? handleData(children as ElSelectorOutput[]) : [],\n\t\t\t\t\t\tdisabled: typeof disabled === \"boolean\" ? disabled : undefined,\n\t\t\t\t\t\thide: typeof hide === \"boolean\" ? hide : undefined,\n\t\t\t\t\t\tlabel: typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.filter((item) => item.hide !== true);\n\t\t};\n\n\t\tconst loadData = async () => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = props.initParam ?? {};\n\t\t\t\ttry {\n\t\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\t// 这里不允许回显了\n\t\t\t\t\tstate.echo = false;\n\t\t\t\t\tstate.selectorData = handleData(resData);\n\t\t\t\t\temit(\"dataChange\", state.selectorData);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\tstate.selectorData = [];\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t// 这里不允许回显了\n\t\t\t\tstate.echo = false;\n\t\t\t\tstate.selectorData = handleData(props.data);\n\t\t\t}\n\t\t};\n\n\t\tconst handleModelValueUpdate = (value: ElSelectorModelValue) => {\n\t\t\tstate.value = value;\n\t\t\temit(\"update:modelValue\", value);\n\t\t};\n\n\t\tconst handleVisibleChange = async (visible: boolean) => {\n\t\t\tif (visible) {\n\t\t\t\tif (state.debut) {\n\t\t\t\t\t// 首次出现\n\t\t\t\t\tstate.debut = false;\n\t\t\t\t\t// 懒加载\n\t\t\t\t\t!props.defaultSelected && props.lazy && (await loadData());\n\t\t\t\t} else {\n\t\t\t\t\t// 判断再次出现是否需要刷新数据\n\t\t\t\t\tif (state.nextRefresh) {\n\t\t\t\t\t\tstate.nextRefresh = false;\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// eslint-disable-next-line vue/custom-event-name-casing -- Element Plus 的公开事件名为 visible-change,需要保持原始名称透传。\n\t\t\temit(\"visible-change\", visible);\n\t\t};\n\n\t\tconst flattenOptions = (data: ElSelectorOutput[]): ElSelectorOutput[] =>\n\t\t\tdata.flatMap((item) => [item, ...flattenOptions(item.children ?? [])]);\n\n\t\tconst handleChange = (value?: ElSelectorModelValue) => {\n\t\t\tif (props.multiple) {\n\t\t\t\tconst valueList = Array.isArray(value) ? value : [];\n\t\t\t\tif (valueList.length === 0) {\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst selectorData = flattenOptions(state.selectorData);\n\t\t\t\tconst dataList = valueList\n\t\t\t\t\t.map((item) => selectorData.find((option) => option.value !== undefined && isEqual(option.value, item)))\n\t\t\t\t\t.filter((item) => item !== undefined);\n\t\t\t\temit(\"change\", dataList, value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (value == null || Array.isArray(value)) {\n\t\t\t\temit(\"change\", null, null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst data = flattenOptions(state.selectorData).find((item) => item.value !== undefined && isEqual(item.value, value));\n\t\t\temit(\"change\", data ?? null, value);\n\t\t};\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tif (state.echo && newValue != null) {\n\t\t\t\t\tconst hasLabel = props.label != null;\n\t\t\t\t\t// 判断是否为多选\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\t// 判断是否为数组\n\t\t\t\t\t\tif (!Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelect]\", \"当启用 multiple 时,传入的 modelValue 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && !Array.isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelect]\", \"当启用 multiple 时,传入的 modelValue:label 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = newValue\n\t\t\t\t\t\t\t// 最大选项截取\n\t\t\t\t\t\t\t.slice(0, props.multipleLimit > 0 ? props.multipleLimit : newValue.length)\n\t\t\t\t\t\t\t.map((item, index) => {\n\t\t\t\t\t\t\t\tconst value: unknown = item;\n\t\t\t\t\t\t\t\tconst label: unknown = Array.isArray(props.label) ? props.label[index] : undefined;\n\t\t\t\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t\t\t\t(typeof value === \"string\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"number\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"boolean\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"object\")\n\t\t\t\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t\t\t\t\tlabel: hasLabel && typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelect]\", \"当禁用 multiple 时,传入的 modelValue 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && Array.isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelect]\", \"当禁用 multiple 时,传入的 modelValue:label 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectorData = [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\t\tlabel: typeof props.label === \"string\" ? props.label : undefined,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstate.value = newValue;\n\t\t\t},\n\t\t\t{\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\twatch(\n\t\t\t[() => state.value, () => state.selectorData],\n\t\t\t([value]) => {\n\t\t\t\tconst selectorData = flattenOptions(state.selectorData);\n\n\t\t\t\tif (props.multiple) {\n\t\t\t\t\tif (!Array.isArray(value)) {\n\t\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tselectedLabel.value = value.map((item, index) => {\n\t\t\t\t\t\tconst data = selectorData.find((option) => option.value !== undefined && isEqual(option.value, item));\n\n\t\t\t\t\t\treturn data?.label ?? (Array.isArray(props.label) ? (props.label[index] ?? \"\") : \"\");\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (value == null || Array.isArray(value)) {\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselectedLabel.value =\n\t\t\t\t\tselectorData.find((item) => item.value !== undefined && isEqual(item.value, value))?.label ??\n\t\t\t\t\t(typeof props.label === \"string\" ? props.label : null);\n\t\t\t},\n\t\t\t{\n\t\t\t\tdeep: true,\n\t\t\t\tflush: \"sync\",\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.initParam,\n\t\t\t(newValue, oldValue) => {\n\t\t\t\tif (!isEqual(newValue, oldValue)) {\n\t\t\t\t\tstate.nextRefresh = true;\n\t\t\t\t\tif (state.value != null) {\n\t\t\t\t\t\thandleModelValueUpdate(props.multiple ? [] : undefined);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.data,\n\t\t\t() => {\n\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\treturn loadData();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ deep: true }\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.data.length,\n\t\t\t(length) => {\n\t\t\t\tif (state.debut) state.echo = length === 0;\n\t\t\t},\n\t\t\t{ immediate: true }\n\t\t);\n\n\t\tonMounted(async () => {\n\t\t\tif (props.defaultSelected) {\n\t\t\t\tawait loadData();\n\t\t\t\tconst firstItem = state.selectorData[0];\n\t\t\t\tif (firstItem?.value !== undefined) {\n\t\t\t\t\thandleModelValueUpdate(props.multiple ? [firstItem.value] : firstItem.value);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 判断是否为本地数据\n\t\t\telse if (!props.requestApi && props.data.length > 0) {\n\t\t\t\tstate.debut = false;\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t\t// 判断是否非默认选中,且未启用懒加载\n\t\t\telse if (!props.lazy) {\n\t\t\t\tawait loadData();\n\t\t\t}\n\t\t});\n\n\t\tconst elSelectProps = useProps(props, selectProps, [\"modelValue\", \"popperClass\", \"loading\", \"props\", \"options\"]);\n\t\tconst elSelectEmits = useEmits(selectEmits, emit, [\"update:modelValue\", \"change\", \"visible-change\"]);\n\t\tconst elPopperClass = computed(() => [\n\t\t\t\"fa-select-dropdown\",\n\t\t\tprops.popperClass,\n\t\t\tprops.moreDetail && `fa-select-dropdown__more-detail fa-select-dropdown__more-detail-${globalSize.value}`,\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<ElSelect\n\t\t\t\t{...elSelectProps.value}\n\t\t\t\t{...elSelectEmits.value}\n\t\t\t\tref={selectRef}\n\t\t\t\tclass=\"fa-select\"\n\t\t\t\tpopperClass={elPopperClass.value}\n\t\t\t\tstyle={{ width: addCssUnit(props.width) }}\n\t\t\t\tmodelValue={state.value}\n\t\t\t\tonUpdate:modelValue={handleModelValueUpdate}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tloading={state.loading}\n\t\t\t\tonVisible-change={handleVisibleChange}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\tstate.selectorData.map((item) => (\n\t\t\t\t\t\t\t<FaSelectOption vSlots={{ default: slots.default }} data={item} moreDetail={props.moreDetail} />\n\t\t\t\t\t\t)),\n\t\t\t\t\t...(slots.header && { header: () => slots.header?.() ?? [] }),\n\t\t\t\t\t...(slots.footer && { footer: () => slots.footer?.() ?? [] }),\n\t\t\t\t\t...(slots.prefix && { prefix: () => slots.prefix?.() ?? [] }),\n\t\t\t\t\t...(slots.empty && { empty: () => slots.empty?.() ?? [] }),\n\t\t\t\t\t...(slots.tag && { tag: slots.tag }),\n\t\t\t\t\t...(slots.loading && { loading: () => slots.loading?.() ?? [] }),\n\t\t\t\t\t...(slots.label && { label: slots.label }),\n\t\t\t\t}}\n\t\t\t</ElSelect>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** 使选择器的输入框获取焦点 */\n\t\t\tfocus: computed(() => selectRef.value?.focus),\n\t\t\t/** 使选择器的输入框失去焦点,并隐藏下拉框 */\n\t\t\tblur: computed(() => selectRef.value?.blur),\n\t\t\t/** 获取当前选中的标签 */\n\t\t\tselectedLabel: computed(() => selectRef.value?.selectedLabel),\n\t\t\t/** 加载状态 */\n\t\t\tloading: toRef(state, \"loading\"),\n\t\t\t/** 刷新 */\n\t\t\trefresh: loadData,\n\t\t\t/** 设置选择 */\n\t\t\tsetSelection: (value: Exclude<ElSelectorModelValue, null | undefined>) => handleModelValueUpdate(value),\n\t\t\t/** 清除选择 */\n\t\t\tclearSelection: () => handleModelValueUpdate(props.multiple ? [] : undefined),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;AAqBA,MAAa,gBAAgB;CAC5B,GAAG;;CAEH,UAAU;EACT,MAAM;EACN,SAAS,KAAA;CACV;;CAEA,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,YAAY;EACX,MAAM;EACN,SAAS;CACV;;CAEA,cAAc;EACb,M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GAE1C,eAAe,eAAe,UAAU,OAAO,aAAa;;GAE5D,SAAS,MAAM,OAAO,SAAS;;GAE/B,SAAS;;GAET,eAAe,UAA2D,uBAAuB,KAAK;;GAEtG,sBAAsB,uBAAuB,MAAM,WAAW,CAAA,IAAK,KAAA,CAAS;EAC7E,CAAC;CACF;AACD,CAAC"}
@@ -7,6 +7,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
7
7
  };
8
8
  /** 显示值,优先级比 data 高 */
9
9
  label: StringConstructor;
10
+ /** 是否为创建的选项 */
11
+ created: BooleanConstructor;
10
12
  /** 禁用值,优先级比 data 高 */
11
13
  disabled: {
12
14
  type: BooleanConstructor;
@@ -31,6 +33,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
31
33
  };
32
34
  /** 显示值,优先级比 data 高 */
33
35
  label: StringConstructor;
36
+ /** 是否为创建的选项 */
37
+ created: BooleanConstructor;
34
38
  /** 禁用值,优先级比 data 高 */
35
39
  disabled: {
36
40
  type: BooleanConstructor;
@@ -49,6 +53,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
49
53
  moreDetail: BooleanConstructor;
50
54
  }>> & Readonly<{}>, {
51
55
  data: ElSelectorOutput<ElSelectorValue, any>;
56
+ created: boolean;
52
57
  disabled: boolean;
53
58
  value: string | number | boolean | object;
54
59
  moreDetail: boolean;