fast-element-plus 2.0.7 → 2.0.8

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 (37) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/components/inputDialogPage/src/inputDialogPage.d.ts +3 -3
  3. package/dist/components/inputDialogPage/src/inputDialogPage.mjs +5 -2
  4. package/dist/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -1
  5. package/dist/components/select/src/select.d.ts +4 -4
  6. package/dist/components/select/src/select.mjs +53 -47
  7. package/dist/components/select/src/select.mjs.map +1 -1
  8. package/dist/components/selectPage/src/selectPage.d.ts +4 -4
  9. package/dist/components/selectPage/src/selectPage.mjs +65 -51
  10. package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
  11. package/dist/components/selectV2/src/selectV2.d.ts +4 -4
  12. package/dist/components/selectV2/src/selectV2.mjs +80 -48
  13. package/dist/components/selectV2/src/selectV2.mjs.map +1 -1
  14. package/dist/components/tree/src/tree.d.ts +5 -5
  15. package/dist/components/tree/src/tree.mjs +11 -7
  16. package/dist/components/tree/src/tree.mjs.map +1 -1
  17. package/dist/components/treeSelect/src/treeSelect.d.ts +10 -10
  18. package/dist/components/treeSelect/src/treeSelect.mjs +58 -53
  19. package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -1
  20. package/dist/components/upload/src/upload.d.ts +0 -5
  21. package/dist/components/upload/src/upload.mjs +6 -6
  22. package/dist/components/upload/src/upload.mjs.map +1 -1
  23. package/dist/components/upload/src/useUpload.d.ts +1 -1
  24. package/dist/components/upload/src/useUpload.mjs +4 -17
  25. package/dist/components/upload/src/useUpload.mjs.map +1 -1
  26. package/dist/components/uploadImage/src/uploadImage.d.ts +0 -5
  27. package/dist/components/uploadImage/src/uploadImage.mjs +1 -3
  28. package/dist/components/uploadImage/src/uploadImage.mjs.map +1 -1
  29. package/dist/components/uploadImages/src/uploadImages.d.ts +0 -5
  30. package/dist/components/uploadImages/src/uploadImages.mjs +3 -3
  31. package/dist/components/uploadImages/src/uploadImages.mjs.map +1 -1
  32. package/dist/index.global.min.js +4 -4
  33. package/dist/index.global.min.js.map +1 -1
  34. package/dist/version.d.ts +1 -1
  35. package/dist/version.mjs +1 -1
  36. package/dist/version.mjs.map +1 -1
  37. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"uploadImage.mjs","names":["update:modelValue","update:fileList"],"sources":["../../../../src/components/uploadImage/src/uploadImage.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, reactive, ref, withModifiers } from \"vue\";\nimport { Delete, Edit, UploadFilled, ZoomIn } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElImageViewer, ElUpload, uploadProps } from \"element-plus\";\nimport { isArray, isNull, isString } from \"lodash-unified\";\nimport { FaMimeType } from \"../../../constants\";\nimport { addCssUnit, definePropType, makeSlots, randomString, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport { useUpload } from \"../../upload/src/useUpload\";\nimport type { UploadFile, UploadInstance, UploadProps, UploadUserFile, uploadListTypes } from \"element-plus\";\n\n/** FaUploadImage 的运行时 Props 定义。 */\nexport const faUploadImageProps = {\n\t...uploadProps,\n\t/** @description whether to activate drag and drop mode */\n\tdrag: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description accepted [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept), will not work when `thumbnail-mode === true` */\n\taccept: {\n\t\ttype: String,\n\t\tdefault: (): string => FaMimeType.Image,\n\t},\n\t/** @description type of file list */\n\tlistType: {\n\t\ttype: definePropType<(typeof uploadListTypes)[number]>(String),\n\t\tdefault: \"picture\",\n\t},\n\t/** @description whether to show the uploaded file list */\n\tshowFileList: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: definePropType<string | string[] | null>([String, Array]),\n\t/** @description 大小限制,单位kb */\n\tmaxSize: {\n\t\ttype: [String, Number],\n\t\tdefault: 2048,\n\t},\n\t/** @description 图片上传接口,优先级最高 */\n\tuploadApi: {\n\t\ttype: definePropType<(formData: FormData) => Promise<string>>(Function),\n\t},\n\t/** @description 图片上传地址 */\n\tuploadUrl: String,\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: 150,\n\t},\n\t/** @description 高度 */\n\theight: {\n\t\ttype: [String, Number],\n\t\tdefault: 150,\n\t},\n};\n\n/** FaUploadImage 的运行时 Emits 定义。 */\nexport const faUploadImageEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n\t/** @description v-model:fileList 回调 */\n\t\"update:fileList\": (value: UploadUserFile[]): boolean => isArray(value),\n\t/** @description 改变 */\n\tchange: (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n};\n\n/** FaUploadImage 的插槽参数。 */\nexport interface FaUploadImageSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaUploadImage\",\n\tprops: faUploadImageProps,\n\temits: faUploadImageEmits,\n\tslots: makeSlots<FaUploadImageSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst {\n\t\t\tfileList,\n\t\t\tloading,\n\t\t\tformContext,\n\t\t\tmaxSizeMB,\n\t\t\thandleHttpRequest,\n\t\t\thandleOnSuccess,\n\t\t\thandleOnError,\n\t\t\thandleOnRemove,\n\t\t\thandleOnExceed,\n\t\t\thandleOnUpload,\n\t\t} = useUpload<string | string[]>(\"FaUploadImage\", \"图片\", props, emit, {\n\t\t\tget maxSize() {\n\t\t\t\treturn props.maxSize;\n\t\t\t},\n\t\t\tget uploadApi() {\n\t\t\t\treturn props.uploadApi;\n\t\t\t},\n\t\t\tget uploadUrl() {\n\t\t\t\treturn props.uploadUrl || (props.action === uploadProps.action.default ? undefined : props.action);\n\t\t\t},\n\t\t});\n\n\t\tconst disabled = computed(() => {\n\t\t\treturn props.disabled === true || formContext?.disabled === true;\n\t\t});\n\n\t\tconst state = reactive({\n\t\t\tuploadKey: `fa-upload-image__${randomString(8)}`,\n\t\t\tpreview: false,\n\t\t\tpreviewList: withDefineType<string[]>([]),\n\t\t});\n\n\t\tconst uploadRef = ref<UploadInstance>();\n\t\tconst httpRequest = computed(() => (props.httpRequest === uploadProps.httpRequest.default ? handleHttpRequest : props.httpRequest));\n\n\t\tconst handleEdit = (): void => {\n\t\t\tconst uploadInputEl = document.querySelector(`.${state.uploadKey} .el-upload__input`);\n\t\t\tuploadInputEl?.dispatchEvent(new MouseEvent(\"click\"));\n\t\t};\n\n\t\tconst handlePreview = (): void => {\n\t\t\tconst fileUrl = fileList.value[0]?.url;\n\t\t\tif (!fileUrl) return;\n\t\t\tstate.previewList = [fileUrl];\n\t\t\tstate.preview = true;\n\t\t};\n\n\t\tconst handleRemove = (): void => {\n\t\t\tconst file = fileList.value[0];\n\t\t\tif (file) uploadRef.value?.handleRemove(file as UploadFile);\n\t\t};\n\n\t\tconst handleBeforeUpload: UploadProps[\"beforeUpload\"] = (rawFile) => {\n\t\t\tif (!handleOnUpload(rawFile)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (props.beforeUpload) {\n\t\t\t\treturn props.beforeUpload(rawFile);\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\tconst elUploadProps = useProps(props, uploadProps, [\n\t\t\t\"fileList\",\n\t\t\t\"disabled\",\n\t\t\t\"httpRequest\",\n\t\t\t\"beforeUpload\",\n\t\t\t\"onExceed\",\n\t\t\t\"onSuccess\",\n\t\t\t\"onError\",\n\t\t\t\"onRemove\",\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<Fragment>\n\t\t\t\t<ElUpload\n\t\t\t\t\t{...elUploadProps.value}\n\t\t\t\t\tref={uploadRef}\n\t\t\t\t\tclass={[\"fa-upload-image\", state.uploadKey]}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\"--width\": addCssUnit(props.width),\n\t\t\t\t\t\t\"--height\": addCssUnit(props.height),\n\t\t\t\t\t}}\n\t\t\t\t\tvLoading={loading.value}\n\t\t\t\t\tvModel:fileList={fileList.value}\n\t\t\t\t\tdisabled={disabled.value}\n\t\t\t\t\thttpRequest={httpRequest.value}\n\t\t\t\t\tbeforeUpload={handleBeforeUpload}\n\t\t\t\t\tonExceed={handleOnExceed}\n\t\t\t\t\tonSuccess={handleOnSuccess}\n\t\t\t\t\tonError={handleOnError}\n\t\t\t\t\tonRemove={handleOnRemove}\n\t\t\t\t>\n\t\t\t\t\t{{\n\t\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\t\tfileList.value.length > 0 ? (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<img class=\"el-upload-list__item-thumbnail\" src={fileList.value[0]?.url} />\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass=\"el-upload-list__item-actions\"\n\t\t\t\t\t\t\t\t\t\tonClick={withModifiers(() => {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}, [\"stop\"])}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={() => handlePreview()} title=\"查看\">\n\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t<ZoomIn />\n\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t{!disabled.value && (\n\t\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={handleEdit} title=\"编辑\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Edit />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={() => handleRemove()} title=\"删除\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Delete />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t) : slots.default ? (\n\t\t\t\t\t\t\t\tslots.default()\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<ElIcon class=\"el-icon--upload\">\n\t\t\t\t\t\t\t\t\t\t<UploadFilled />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t<div class=\"el-upload__text\">\n\t\t\t\t\t\t\t\t\t\tDrop file here <br />\n\t\t\t\t\t\t\t\t\t\t<em>click to upload</em>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\ttip: () => <div class=\"el-upload__tip\">file with a size less than {maxSizeMB.value.toString()}MB</div>,\n\t\t\t\t\t}}\n\t\t\t\t</ElUpload>\n\t\t\t\t{state.preview && (\n\t\t\t\t\t<ElImageViewer\n\t\t\t\t\t\tcloseOnPressEscape\n\t\t\t\t\t\thideOnClickModal\n\t\t\t\t\t\tteleported\n\t\t\t\t\t\tonClose={() => (state.preview = false)}\n\t\t\t\t\t\turlList={state.previewList}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Fragment>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 取消上传请求 */\n\t\t\tabort: computed(() => uploadRef.value?.abort),\n\t\t\t/** @description 手动上传文件列表 */\n\t\t\tsubmit: computed(() => uploadRef.value?.submit),\n\t\t\t/** @description 清空已上传的文件列表(该方法不支持在 before-upload 中调用) */\n\t\t\tclearFiles: computed(() => uploadRef.value?.clearFiles),\n\t\t\t/** @description 手动选择文件 */\n\t\t\thandleStart: computed(() => uploadRef.value?.handleStart),\n\t\t\t/** @description 手动移除文件。file 和 rawFile 已被合并。 */\n\t\t\thandleRemove: computed(() => uploadRef.value?.handleRemove),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading,\n\t\t\t/** @description 文件集合 */\n\t\t\tfileList,\n\t\t\t/** @description 预览 */\n\t\t\tpreview: computed(() => state.preview),\n\t\t\t/** @description 预览集合 */\n\t\t\tpreviewList: computed(() => state.previewList),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAa,qBAAqB;CACjC,GAAG;;CAEH,MAAM;EACL,MAAM;EACN,SAAS;CACV;;CAEA,QAAQ;EACP,MAAM;EACN,eAAuB,WAAW;CACnC;;CAEA,UAAU;EACT,MAAM,eAAiD,MAAM;EAC7D,SAAS;CACV;;CAEA,cAAc;EACb,MAAM;EACN,SAAS;CACV;;CAEA,YAAY,eAAyC,CAAC,QAAQ,KAAK,CAAC;;CAEpE,SAAS;EACR,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,WAAW,EACV,MAAM,eAAwD,QAAQ,EACvE;;CAEA,WAAW;;CAEX,OAAO;EACN,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,QAAQ;EACP,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;AACD;;AAGA,MAAa,qBAAqB;;CAEjC,sBAAsB,UAA6C,SAAS,KAAK,KAAK,QAAQ,KAAK,KAAK,OAAO,KAAK;;CAEpH,oBAAoB,UAAqC,QAAQ,KAAK;;CAEtE,SAAS,UAA6C,SAAS,KAAK,KAAK,QAAQ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AAA,CAAA,CAMtE,CAAA,CAAA,CAAA,IAGA,MAAM,UACT,MAAM,QAAQ,IAAC,YAAA,UAAA,MAAA,CAAA,YAAA,QAAA,EAAA,SAAA,kBAAA,GAAA,EAAA,eAAA,CAAA,YAAA,cAAA,MAAA,IAAA,CAAA,EAAA,CAAA,GAAA,YAAA,OAAA,EAAA,SAAA,kBAAA,GAAA;IAAA,gBAAA,iBAAA;IAAA,YAAA,MAAA,MAAA,IAAA;IAAA,YAAA,MAAA,MAAA,CAAA,gBAAA,iBAAA,CAAA,CAAA;GAAA,CAAA,CAAA,CAAA;GAYjB,WAAK,YAAA,OAAA,EAAA,SAAA,iBAAA,GAAA;IAAA,gBAAA,6BAAA;IAA8D,UAAU,MAAM,SAAS;IAAC,gBAAA,IAAA;GAAA,CAAA;EAAS,CAAA,GAAA,CAAA,CAAA,iBAAA,SAAA,GAvD7F,QAAQ,KAAK,CAAA,CAAA,GA0DvB,MAAM,WAAO,YAAA,eAAA;GAAA,sBAAA;GAAA,oBAAA;GAAA,cAAA;GAAA,iBAKI,MAAM,UAAU;GAAM,WAC7B,MAAM;EAAW,GAAA,IAAA,CAE3B,CAAA,CAEF;EAED,OAAO,UAAU,QAAQ;;GAExB,OAAO,eAAe,UAAU,OAAO,KAAK;;GAE5C,QAAQ,eAAe,UAAU,OAAO,MAAM;;GAE9C,YAAY,eAAe,UAAU,OAAO,UAAU;;GAEtD,aAAa,eAAe,UAAU,OAAO,WAAW;;GAExD,cAAc,eAAe,UAAU,OAAO,YAAY;;GAE1D;;GAEA;;GAEA,SAAS,eAAe,MAAM,OAAO;;GAErC,aAAa,eAAe,MAAM,WAAW;EAC9C,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"uploadImage.mjs","names":["update:modelValue","update:fileList"],"sources":["../../../../src/components/uploadImage/src/uploadImage.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, reactive, ref, withModifiers } from \"vue\";\nimport { Delete, Edit, UploadFilled, ZoomIn } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElImageViewer, ElUpload, uploadProps } from \"element-plus\";\nimport { isArray, isNull, isString } from \"lodash-unified\";\nimport { FaMimeType } from \"../../../constants\";\nimport { addCssUnit, definePropType, makeSlots, randomString, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport { useUpload } from \"../../upload/src/useUpload\";\nimport type { UploadFile, UploadInstance, UploadProps, UploadUserFile, uploadListTypes } from \"element-plus\";\n\n/** FaUploadImage 的运行时 Props 定义。 */\nexport const faUploadImageProps = {\n\t...uploadProps,\n\t/** @description whether to activate drag and drop mode */\n\tdrag: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description accepted [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept), will not work when `thumbnail-mode === true` */\n\taccept: {\n\t\ttype: String,\n\t\tdefault: (): string => FaMimeType.Image,\n\t},\n\t/** @description type of file list */\n\tlistType: {\n\t\ttype: definePropType<(typeof uploadListTypes)[number]>(String),\n\t\tdefault: \"picture\",\n\t},\n\t/** @description whether to show the uploaded file list */\n\tshowFileList: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: definePropType<string | string[] | null>([String, Array]),\n\t/** @description 大小限制,单位kb */\n\tmaxSize: {\n\t\ttype: [String, Number],\n\t\tdefault: 2048,\n\t},\n\t/** @description 图片上传接口,优先级最高 */\n\tuploadApi: {\n\t\ttype: definePropType<(formData: FormData) => Promise<string>>(Function),\n\t},\n\t/** @description 图片上传地址 */\n\tuploadUrl: String,\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: 150,\n\t},\n\t/** @description 高度 */\n\theight: {\n\t\ttype: [String, Number],\n\t\tdefault: 150,\n\t},\n};\n\n/** FaUploadImage 的运行时 Emits 定义。 */\nexport const faUploadImageEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n\t/** @description v-model:fileList 回调 */\n\t\"update:fileList\": (value: UploadUserFile[]): boolean => isArray(value),\n};\n\n/** FaUploadImage 的插槽参数。 */\nexport interface FaUploadImageSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaUploadImage\",\n\tprops: faUploadImageProps,\n\temits: faUploadImageEmits,\n\tslots: makeSlots<FaUploadImageSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst {\n\t\t\tfileList,\n\t\t\tloading,\n\t\t\tformContext,\n\t\t\tmaxSizeMB,\n\t\t\thandleHttpRequest,\n\t\t\thandleOnSuccess,\n\t\t\thandleOnError,\n\t\t\thandleOnRemove,\n\t\t\thandleOnExceed,\n\t\t\thandleOnUpload,\n\t\t} = useUpload<string | string[]>(\"FaUploadImage\", \"图片\", props, emit, {\n\t\t\tget maxSize() {\n\t\t\t\treturn props.maxSize;\n\t\t\t},\n\t\t\tget uploadApi() {\n\t\t\t\treturn props.uploadApi;\n\t\t\t},\n\t\t\tget uploadUrl() {\n\t\t\t\treturn props.uploadUrl || (props.action === uploadProps.action.default ? undefined : props.action);\n\t\t\t},\n\t\t});\n\n\t\tconst disabled = computed(() => {\n\t\t\treturn props.disabled === true || formContext?.disabled === true;\n\t\t});\n\n\t\tconst state = reactive({\n\t\t\tuploadKey: `fa-upload-image__${randomString(8)}`,\n\t\t\tpreview: false,\n\t\t\tpreviewList: withDefineType<string[]>([]),\n\t\t});\n\n\t\tconst uploadRef = ref<UploadInstance>();\n\t\tconst httpRequest = computed(() => (props.httpRequest === uploadProps.httpRequest.default ? handleHttpRequest : props.httpRequest));\n\n\t\tconst handleEdit = (): void => {\n\t\t\tconst uploadInputEl = document.querySelector(`.${state.uploadKey} .el-upload__input`);\n\t\t\tuploadInputEl?.dispatchEvent(new MouseEvent(\"click\"));\n\t\t};\n\n\t\tconst handlePreview = (): void => {\n\t\t\tconst fileUrl = fileList.value[0]?.url;\n\t\t\tif (!fileUrl) return;\n\t\t\tstate.previewList = [fileUrl];\n\t\t\tstate.preview = true;\n\t\t};\n\n\t\tconst handleRemove = (): void => {\n\t\t\tconst file = fileList.value[0];\n\t\t\tif (file) uploadRef.value?.handleRemove(file as UploadFile);\n\t\t};\n\n\t\tconst handleBeforeUpload: UploadProps[\"beforeUpload\"] = (rawFile) => {\n\t\t\tif (!handleOnUpload(rawFile)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (props.beforeUpload) {\n\t\t\t\treturn props.beforeUpload(rawFile);\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\tconst elUploadProps = useProps(props, uploadProps, [\n\t\t\t\"fileList\",\n\t\t\t\"disabled\",\n\t\t\t\"httpRequest\",\n\t\t\t\"beforeUpload\",\n\t\t\t\"onExceed\",\n\t\t\t\"onSuccess\",\n\t\t\t\"onError\",\n\t\t\t\"onRemove\",\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<Fragment>\n\t\t\t\t<ElUpload\n\t\t\t\t\t{...elUploadProps.value}\n\t\t\t\t\tref={uploadRef}\n\t\t\t\t\tclass={[\"fa-upload-image\", state.uploadKey]}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\"--width\": addCssUnit(props.width),\n\t\t\t\t\t\t\"--height\": addCssUnit(props.height),\n\t\t\t\t\t}}\n\t\t\t\t\tvLoading={loading.value}\n\t\t\t\t\tvModel:fileList={fileList.value}\n\t\t\t\t\tdisabled={disabled.value}\n\t\t\t\t\thttpRequest={httpRequest.value}\n\t\t\t\t\tbeforeUpload={handleBeforeUpload}\n\t\t\t\t\tonExceed={handleOnExceed}\n\t\t\t\t\tonSuccess={handleOnSuccess}\n\t\t\t\t\tonError={handleOnError}\n\t\t\t\t\tonRemove={handleOnRemove}\n\t\t\t\t>\n\t\t\t\t\t{{\n\t\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\t\tfileList.value.length > 0 ? (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<img class=\"el-upload-list__item-thumbnail\" src={fileList.value[0]?.url} />\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass=\"el-upload-list__item-actions\"\n\t\t\t\t\t\t\t\t\t\tonClick={withModifiers(() => {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}, [\"stop\"])}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={() => handlePreview()} title=\"查看\">\n\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t<ZoomIn />\n\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t{!disabled.value && (\n\t\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={handleEdit} title=\"编辑\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Edit />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={() => handleRemove()} title=\"删除\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Delete />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t) : slots.default ? (\n\t\t\t\t\t\t\t\tslots.default()\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<ElIcon class=\"el-icon--upload\">\n\t\t\t\t\t\t\t\t\t\t<UploadFilled />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t<div class=\"el-upload__text\">\n\t\t\t\t\t\t\t\t\t\tDrop file here <br />\n\t\t\t\t\t\t\t\t\t\t<em>click to upload</em>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\ttip: () => <div class=\"el-upload__tip\">file with a size less than {maxSizeMB.value.toString()}MB</div>,\n\t\t\t\t\t}}\n\t\t\t\t</ElUpload>\n\t\t\t\t{state.preview && (\n\t\t\t\t\t<ElImageViewer\n\t\t\t\t\t\tcloseOnPressEscape\n\t\t\t\t\t\thideOnClickModal\n\t\t\t\t\t\tteleported\n\t\t\t\t\t\tonClose={() => (state.preview = false)}\n\t\t\t\t\t\turlList={state.previewList}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Fragment>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 取消上传请求 */\n\t\t\tabort: computed(() => uploadRef.value?.abort),\n\t\t\t/** @description 手动上传文件列表 */\n\t\t\tsubmit: computed(() => uploadRef.value?.submit),\n\t\t\t/** @description 清空已上传的文件列表(该方法不支持在 before-upload 中调用) */\n\t\t\tclearFiles: computed(() => uploadRef.value?.clearFiles),\n\t\t\t/** @description 手动选择文件 */\n\t\t\thandleStart: computed(() => uploadRef.value?.handleStart),\n\t\t\t/** @description 手动移除文件。file 和 rawFile 已被合并。 */\n\t\t\thandleRemove: computed(() => uploadRef.value?.handleRemove),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading,\n\t\t\t/** @description 文件集合 */\n\t\t\tfileList,\n\t\t\t/** @description 预览 */\n\t\t\tpreview: computed(() => state.preview),\n\t\t\t/** @description 预览集合 */\n\t\t\tpreviewList: computed(() => state.previewList),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAa,qBAAqB;CACjC,GAAG;;CAEH,MAAM;EACL,MAAM;EACN,SAAS;CACV;;CAEA,QAAQ;EACP,MAAM;EACN,eAAuB,WAAW;CACnC;;CAEA,UAAU;EACT,MAAM,eAAiD,MAAM;EAC7D,SAAS;CACV;;CAEA,cAAc;EACb,MAAM;EACN,SAAS;CACV;;CAEA,YAAY,eAAyC,CAAC,QAAQ,KAAK,CAAC;;CAEpE,SAAS;EACR,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,WAAW,EACV,MAAM,eAAwD,QAAQ,EACvE;;CAEA,WAAW;;CAEX,OAAO;EACN,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,QAAQ;EACP,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;AACD;;AAGA,MAAa,qBAAqB;;CAEjC,sBAAsB,UAA6C,SAAS,KAAK,KAAK,QAAQ,KAAK,KAAK,OAAO,KAAK;;CAEpH,oBAAoB,UAAqC,QAAQ,KAAK;AACvE;AAQA,IAAA,sBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO;CACP,OAAO,UAA8B;CACrC,MAAM,OAAO,EAAE,OAAO,MAAM,UAAU;EACrC,MAAM,EACL,UACA,SACA,aACA,WACA,mBACA,iBACA,eACA,gBACA,gBACA,mBACG,UAA6B,iBAAiB,MAAM,OAAO,MAAM;GACpE,IAAI,UAAU;IACb,OAAO,MAAM;GACd;GACA,IAAI,YAAY;IACf,OAAO,MAAM;GACd;GACA,IAAI,YAAY;IACf,OAAO,MAAM,cAAc,MAAM,WAAW,YAAY,OAAO,UAAU,KAAA,IAAY,MAAM;GAC5F;EACD,CAAC;EAED,MAAM,WAAW,eAAe;GAC/B,OAAO,MAAM,aAAa,QAAQ,aAAa,aAAa;EAC7D,CAAC;EAED,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AAA,SAAA,GAvD7F,QAAQ,KAAK,CAAA,CAAA,GA0DvB,MAAM,WAAO,YAAA,eAAA;GAAA,sBAAA;GAAA,oBAAA;GAAA,cAAA;GAAA,iBAKI,MAAM,UAAU;GAAM,WAC7B,MAAM;EAAW,GAAA,IAAA,CAE3B,CAAA,CAEF;EAED,OAAO,UAAU,QAAQ;;GAExB,OAAO,eAAe,UAAU,OAAO,KAAK;;GAE5C,QAAQ,eAAe,UAAU,OAAO,MAAM;;GAE9C,YAAY,eAAe,UAAU,OAAO,UAAU;;GAEtD,aAAa,eAAe,UAAU,OAAO,WAAW;;GAExD,cAAc,eAAe,UAAU,OAAO,YAAY;;GAE1D;;GAEA;;GAEA,SAAS,eAAe,MAAM,OAAO;;GAErC,aAAa,eAAe,MAAM,WAAW;EAC9C,CAAC;CACF;AACD,CAAC"}
@@ -151,8 +151,6 @@ export declare const faUploadImagesEmits: {
151
151
  "update:modelValue": (value: string[] | null) => boolean;
152
152
  /** @description v-model:fileList 回调 */
153
153
  "update:fileList": (value: UploadUserFile[]) => boolean;
154
- /** @description 改变 */
155
- change: (value: string[] | null) => boolean;
156
154
  };
157
155
  /** FaUploadImages 的插槽参数。 */
158
156
  export interface FaUploadImagesSlots extends Record<string, unknown> {
@@ -327,8 +325,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
327
325
  "update:modelValue": (value: string[] | null) => boolean;
328
326
  /** @description v-model:fileList 回调 */
329
327
  "update:fileList": (value: UploadUserFile[]) => boolean;
330
- /** @description 改变 */
331
- change: (value: string[] | null) => boolean;
332
328
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
333
329
  /** @description accepted [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept), will not work when `thumbnail-mode === true` */
334
330
  accept: {
@@ -474,7 +470,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
474
470
  disabled: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
475
471
  directory: BooleanConstructor;
476
472
  }>> & Readonly<{
477
- onChange?: ((value: string[] | null) => any) | undefined;
478
473
  "onUpdate:modelValue"?: ((value: string[] | null) => any) | undefined;
479
474
  "onUpdate:fileList"?: ((value: UploadUserFile[]) => any) | undefined;
480
475
  }>, {
@@ -51,9 +51,7 @@ const faUploadImagesEmits = {
51
51
  /** @description v-model 回调 */
52
52
  "update:modelValue": (value) => isArray(value) || isNull(value),
53
53
  /** @description v-model:fileList 回调 */
54
- "update:fileList": (value) => isArray(value),
55
- /** @description 改变 */
56
- change: (value) => isArray(value) || isNull(value)
54
+ "update:fileList": (value) => isArray(value)
57
55
  };
58
56
  var uploadImages_default = defineComponent({
59
57
  name: "FaUploadImages",
@@ -102,6 +100,7 @@ var uploadImages_default = defineComponent({
102
100
  };
103
101
  const elUploadProps = useProps(props, uploadProps, [
104
102
  "fileList",
103
+ "multiple",
105
104
  "disabled",
106
105
  "httpRequest",
107
106
  "beforeUpload",
@@ -119,6 +118,7 @@ var uploadImages_default = defineComponent({
119
118
  ],
120
119
  "fileList": fileList.value,
121
120
  "onUpdate:fileList": ($event) => fileList.value = $event,
121
+ "multiple": true,
122
122
  "disabled": disabled.value,
123
123
  "httpRequest": httpRequest.value,
124
124
  "beforeUpload": handleBeforeUpload,
@@ -1 +1 @@
1
- {"version":3,"file":"uploadImages.mjs","names":["update:modelValue","update:fileList"],"sources":["../../../../src/components/uploadImages/src/uploadImages.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, reactive, ref } from \"vue\";\nimport { Delete, Edit, Plus, ZoomIn } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElImageViewer, ElUpload, uploadProps } from \"element-plus\";\nimport { isArray, isNull } from \"lodash-unified\";\nimport { FaMimeType } from \"../../../constants\";\nimport { definePropType, makeSlots, randomString, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport { useUpload } from \"../../upload/src/useUpload\";\nimport type { UploadFile, UploadInstance, UploadProps, UploadUserFile, uploadListTypes } from \"element-plus\";\n\n/** FaUploadImages 的运行时 Props 定义。 */\nexport const faUploadImagesProps = {\n\t...uploadProps,\n\t/** @description accepted [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept), will not work when `thumbnail-mode === true` */\n\taccept: {\n\t\ttype: String,\n\t\tdefault: (): string => FaMimeType.Image,\n\t},\n\t/** @description type of file list */\n\tlistType: {\n\t\ttype: definePropType<(typeof uploadListTypes)[number]>(String),\n\t\tdefault: \"picture-card\",\n\t},\n\t/** @description whether uploading multiple files is permitted */\n\tmultiple: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description maximum number of uploads allowed */\n\tlimit: {\n\t\ttype: Number,\n\t\tdefault: 9,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: definePropType<string[] | null>([Array]),\n\t/** @description 大小限制,单位kb */\n\tmaxSize: {\n\t\ttype: [String, Number],\n\t\tdefault: 2048,\n\t},\n\t/** @description 图片上传接口,优先级最高 */\n\tuploadApi: {\n\t\ttype: definePropType<(formData: FormData) => Promise<string>>(Function),\n\t},\n\t/** @description 图片上传地址 */\n\tuploadUrl: String,\n};\n\n/** FaUploadImages 的运行时 Emits 定义。 */\nexport const faUploadImagesEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string[] | null): boolean => isArray(value) || isNull(value),\n\t/** @description v-model:fileList 回调 */\n\t\"update:fileList\": (value: UploadUserFile[]): boolean => isArray(value),\n\t/** @description 改变 */\n\tchange: (value: string[] | null): boolean => isArray(value) || isNull(value),\n};\n\n/** FaUploadImages 的插槽参数。 */\nexport interface FaUploadImagesSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaUploadImages\",\n\tprops: faUploadImagesProps,\n\temits: faUploadImagesEmits,\n\tslots: makeSlots<FaUploadImagesSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst {\n\t\t\tfileList,\n\t\t\tloading,\n\t\t\tformContext,\n\t\t\tmaxSizeMB,\n\t\t\thandleHttpRequest,\n\t\t\thandleOnSuccess,\n\t\t\thandleOnError,\n\t\t\thandleOnRemove,\n\t\t\thandleOnExceed,\n\t\t\thandleOnUpload,\n\t\t} = useUpload<string[]>(\"FaUploadImages\", \"图片\", props, emit, {\n\t\t\tget maxSize() {\n\t\t\t\treturn props.maxSize;\n\t\t\t},\n\t\t\tget uploadApi() {\n\t\t\t\treturn props.uploadApi;\n\t\t\t},\n\t\t\tget uploadUrl() {\n\t\t\t\treturn props.uploadUrl || (props.action === uploadProps.action.default ? undefined : props.action);\n\t\t\t},\n\t\t});\n\n\t\tconst disabled = computed(() => {\n\t\t\treturn props.disabled === true || formContext?.disabled === true;\n\t\t});\n\n\t\tconst state = reactive({\n\t\t\tuploadKey: `fa-upload-images__${randomString(8)}`,\n\t\t\tpreview: false,\n\t\t\tpreviewIndex: -1,\n\t\t\tpreviewList: withDefineType<string[]>([]),\n\t\t});\n\n\t\tconst uploadRef = ref<UploadInstance>();\n\t\tconst httpRequest = computed(() => (props.httpRequest === uploadProps.httpRequest.default ? handleHttpRequest : props.httpRequest));\n\n\t\tconst handleEdit = (): void => {\n\t\t\tconst uploadInputEl = document.querySelector(`.${state.uploadKey} .el-upload__input`);\n\t\t\tuploadInputEl?.dispatchEvent(new MouseEvent(\"click\"));\n\t\t};\n\n\t\tconst handlePreview = (uploadFile: UploadFile): void => {\n\t\t\tstate.previewIndex = fileList.value.findIndex((f) => f.url === uploadFile.url);\n\t\t\tstate.previewList = fileList.value.flatMap((item) => (item.url ? [item.url] : []));\n\t\t\tstate.preview = true;\n\t\t};\n\n\t\tconst handleRemove = (index: number): void => {\n\t\t\tconst file = fileList.value[index];\n\t\t\tif (file) uploadRef.value?.handleRemove(file as UploadFile);\n\t\t};\n\n\t\tconst handleBeforeUpload: UploadProps[\"beforeUpload\"] = (rawFile) => {\n\t\t\tif (!handleOnUpload(rawFile)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (props.beforeUpload) {\n\t\t\t\treturn props.beforeUpload(rawFile);\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\tconst elUploadProps = useProps(props, uploadProps, [\n\t\t\t\"fileList\",\n\t\t\t\"disabled\",\n\t\t\t\"httpRequest\",\n\t\t\t\"beforeUpload\",\n\t\t\t\"onExceed\",\n\t\t\t\"onSuccess\",\n\t\t\t\"onError\",\n\t\t\t\"onRemove\",\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<Fragment>\n\t\t\t\t<ElUpload\n\t\t\t\t\t{...elUploadProps.value}\n\t\t\t\t\tref={uploadRef}\n\t\t\t\t\tclass={[\"fa-upload-images\", state.uploadKey, { \"fa-upload-images__hidden-upload\": fileList.value.length >= props.limit }]}\n\t\t\t\t\tvLoading={loading.value}\n\t\t\t\t\tvModel:fileList={fileList.value}\n\t\t\t\t\tdisabled={disabled.value}\n\t\t\t\t\thttpRequest={httpRequest.value}\n\t\t\t\t\tbeforeUpload={handleBeforeUpload}\n\t\t\t\t\tonExceed={handleOnExceed}\n\t\t\t\t\tonSuccess={handleOnSuccess}\n\t\t\t\t\tonError={handleOnError}\n\t\t\t\t\tonRemove={handleOnRemove}\n\t\t\t\t>\n\t\t\t\t\t{{\n\t\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\t\tfileList.value.length < props.limit && slots.default ? (\n\t\t\t\t\t\t\t\tslots.default()\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t<Plus />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\ttip: () => <div class=\"el-upload__tip\">files with a size less than {maxSizeMB.value.toString()}MB</div>,\n\t\t\t\t\t\tfile: ({ file, index }: { file: UploadFile; index: number }) => (\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<img class=\"el-upload-list__item-thumbnail\" src={file.url} />\n\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-actions\">\n\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-preview\" onClick={() => handlePreview(file)} title=\"查看\">\n\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t<ZoomIn />\n\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{!disabled.value && (\n\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={handleEdit} title=\"编辑\">\n\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Edit />\n\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={() => handleRemove(index)} title=\"删除\">\n\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Delete />\n\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\t}}\n\t\t\t\t</ElUpload>\n\t\t\t\t{state.preview && (\n\t\t\t\t\t<ElImageViewer\n\t\t\t\t\t\tcloseOnPressEscape\n\t\t\t\t\t\thideOnClickModal\n\t\t\t\t\t\tteleported\n\t\t\t\t\t\tinitialIndex={Math.max(state.previewIndex, 0)}\n\t\t\t\t\t\tonClose={() => (state.preview = false)}\n\t\t\t\t\t\turlList={state.previewList}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Fragment>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 取消上传请求 */\n\t\t\tabort: computed(() => uploadRef.value?.abort),\n\t\t\t/** @description 手动上传文件列表 */\n\t\t\tsubmit: computed(() => uploadRef.value?.submit),\n\t\t\t/** @description 清空已上传的文件列表(该方法不支持在 before-upload 中调用) */\n\t\t\tclearFiles: computed(() => uploadRef.value?.clearFiles),\n\t\t\t/** @description 手动选择文件 */\n\t\t\thandleStart: computed(() => uploadRef.value?.handleStart),\n\t\t\t/** @description 手动移除文件。file 和 rawFile 已被合并。 */\n\t\t\thandleRemove: computed(() => uploadRef.value?.handleRemove),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading,\n\t\t\t/** @description 文件集合 */\n\t\t\tfileList,\n\t\t\t/** @description 预览 */\n\t\t\tpreview: computed(() => state.preview),\n\t\t\t/** @description 预览集合 */\n\t\t\tpreviewList: computed(() => state.previewList),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;AAUA,MAAa,sBAAsB;CAClC,GAAG;;CAEH,QAAQ;EACP,MAAM;EACN,eAAuB,WAAW;CACnC;;CAEA,UAAU;EACT,MAAM,eAAiD,MAAM;EAC7D,SAAS;CACV;;CAEA,UAAU;EACT,MAAM;EACN,SAAS;CACV;;CAEA,OAAO;EACN,MAAM;EACN,SAAS;CACV;;CAEA,YAAY,eAAgC,CAAC,KAAK,CAAC;;CAEnD,SAAS;EACR,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,WAAW,EACV,MAAM,eAAwD,QAAQ,EACvE;;CAEA,WAAW;AACZ;;AAGA,MAAa,sBAAsB;;CAElC,sBAAsB,UAAoC,QAAQ,KAAK,KAAK,OAAO,KAAK;;CAExF,oBAAoB,UAAqC,QAAQ,KAAK;;CAEtE,SAAS,UAAoC,QAAQ,KAAK,KAAK,OAAO,KAAK;AAC5E;AAQA,IAAA,uBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO;CACP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,GAAA,YAAA,QAAA;IAAA,SAAA;IAAA,iBAKJ,aAAa,KAAK;IAAC,SAAA;GAAA,GAAA,CAAA,YAAA,QAAA,MAAA,EAAA,eAAA,CAAA,YAAA,QAAA,MAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAM3E,CAAA,CAAA,CAAA;EAGH,CAAA,GAAA,CAAA,CAAA,iBAAA,SAAA,GA7CQ,QAAQ,KAAK,CAAA,CAAA,GAgDvB,MAAM,WAAO,YAAA,eAAA;GAAA,sBAAA;GAAA,oBAAA;GAAA,cAAA;GAAA,gBAKE,KAAK,IAAI,MAAM,cAAc,CAAC;GAAC,iBAC7B,MAAM,UAAU;GAAM,WAC7B,MAAM;EAAW,GAAA,IAAA,CAE3B,CAAA,CAEF;EAED,OAAO,UAAU,QAAQ;;GAExB,OAAO,eAAe,UAAU,OAAO,KAAK;;GAE5C,QAAQ,eAAe,UAAU,OAAO,MAAM;;GAE9C,YAAY,eAAe,UAAU,OAAO,UAAU;;GAEtD,aAAa,eAAe,UAAU,OAAO,WAAW;;GAExD,cAAc,eAAe,UAAU,OAAO,YAAY;;GAE1D;;GAEA;;GAEA,SAAS,eAAe,MAAM,OAAO;;GAErC,aAAa,eAAe,MAAM,WAAW;EAC9C,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"uploadImages.mjs","names":["update:modelValue","update:fileList"],"sources":["../../../../src/components/uploadImages/src/uploadImages.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, reactive, ref } from \"vue\";\nimport { Delete, Edit, Plus, ZoomIn } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElImageViewer, ElUpload, uploadProps } from \"element-plus\";\nimport { isArray, isNull } from \"lodash-unified\";\nimport { FaMimeType } from \"../../../constants\";\nimport { definePropType, makeSlots, randomString, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport { useUpload } from \"../../upload/src/useUpload\";\nimport type { UploadFile, UploadInstance, UploadProps, UploadUserFile, uploadListTypes } from \"element-plus\";\n\n/** FaUploadImages 的运行时 Props 定义。 */\nexport const faUploadImagesProps = {\n\t...uploadProps,\n\t/** @description accepted [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept), will not work when `thumbnail-mode === true` */\n\taccept: {\n\t\ttype: String,\n\t\tdefault: (): string => FaMimeType.Image,\n\t},\n\t/** @description type of file list */\n\tlistType: {\n\t\ttype: definePropType<(typeof uploadListTypes)[number]>(String),\n\t\tdefault: \"picture-card\",\n\t},\n\t/** @description whether uploading multiple files is permitted */\n\tmultiple: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description maximum number of uploads allowed */\n\tlimit: {\n\t\ttype: Number,\n\t\tdefault: 9,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: definePropType<string[] | null>([Array]),\n\t/** @description 大小限制,单位kb */\n\tmaxSize: {\n\t\ttype: [String, Number],\n\t\tdefault: 2048,\n\t},\n\t/** @description 图片上传接口,优先级最高 */\n\tuploadApi: {\n\t\ttype: definePropType<(formData: FormData) => Promise<string>>(Function),\n\t},\n\t/** @description 图片上传地址 */\n\tuploadUrl: String,\n};\n\n/** FaUploadImages 的运行时 Emits 定义。 */\nexport const faUploadImagesEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string[] | null): boolean => isArray(value) || isNull(value),\n\t/** @description v-model:fileList 回调 */\n\t\"update:fileList\": (value: UploadUserFile[]): boolean => isArray(value),\n};\n\n/** FaUploadImages 的插槽参数。 */\nexport interface FaUploadImagesSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaUploadImages\",\n\tprops: faUploadImagesProps,\n\temits: faUploadImagesEmits,\n\tslots: makeSlots<FaUploadImagesSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst {\n\t\t\tfileList,\n\t\t\tloading,\n\t\t\tformContext,\n\t\t\tmaxSizeMB,\n\t\t\thandleHttpRequest,\n\t\t\thandleOnSuccess,\n\t\t\thandleOnError,\n\t\t\thandleOnRemove,\n\t\t\thandleOnExceed,\n\t\t\thandleOnUpload,\n\t\t} = useUpload<string[]>(\"FaUploadImages\", \"图片\", props, emit, {\n\t\t\tget maxSize() {\n\t\t\t\treturn props.maxSize;\n\t\t\t},\n\t\t\tget uploadApi() {\n\t\t\t\treturn props.uploadApi;\n\t\t\t},\n\t\t\tget uploadUrl() {\n\t\t\t\treturn props.uploadUrl || (props.action === uploadProps.action.default ? undefined : props.action);\n\t\t\t},\n\t\t});\n\n\t\tconst disabled = computed(() => {\n\t\t\treturn props.disabled === true || formContext?.disabled === true;\n\t\t});\n\n\t\tconst state = reactive({\n\t\t\tuploadKey: `fa-upload-images__${randomString(8)}`,\n\t\t\tpreview: false,\n\t\t\tpreviewIndex: -1,\n\t\t\tpreviewList: withDefineType<string[]>([]),\n\t\t});\n\n\t\tconst uploadRef = ref<UploadInstance>();\n\t\tconst httpRequest = computed(() => (props.httpRequest === uploadProps.httpRequest.default ? handleHttpRequest : props.httpRequest));\n\n\t\tconst handleEdit = (): void => {\n\t\t\tconst uploadInputEl = document.querySelector(`.${state.uploadKey} .el-upload__input`);\n\t\t\tuploadInputEl?.dispatchEvent(new MouseEvent(\"click\"));\n\t\t};\n\n\t\tconst handlePreview = (uploadFile: UploadFile): void => {\n\t\t\tstate.previewIndex = fileList.value.findIndex((f) => f.url === uploadFile.url);\n\t\t\tstate.previewList = fileList.value.flatMap((item) => (item.url ? [item.url] : []));\n\t\t\tstate.preview = true;\n\t\t};\n\n\t\tconst handleRemove = (index: number): void => {\n\t\t\tconst file = fileList.value[index];\n\t\t\tif (file) uploadRef.value?.handleRemove(file as UploadFile);\n\t\t};\n\n\t\tconst handleBeforeUpload: UploadProps[\"beforeUpload\"] = (rawFile) => {\n\t\t\tif (!handleOnUpload(rawFile)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (props.beforeUpload) {\n\t\t\t\treturn props.beforeUpload(rawFile);\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\tconst elUploadProps = useProps(props, uploadProps, [\n\t\t\t\"fileList\",\n\t\t\t\"multiple\",\n\t\t\t\"disabled\",\n\t\t\t\"httpRequest\",\n\t\t\t\"beforeUpload\",\n\t\t\t\"onExceed\",\n\t\t\t\"onSuccess\",\n\t\t\t\"onError\",\n\t\t\t\"onRemove\",\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<Fragment>\n\t\t\t\t<ElUpload\n\t\t\t\t\t{...elUploadProps.value}\n\t\t\t\t\tref={uploadRef}\n\t\t\t\t\tclass={[\"fa-upload-images\", state.uploadKey, { \"fa-upload-images__hidden-upload\": fileList.value.length >= props.limit }]}\n\t\t\t\t\tvLoading={loading.value}\n\t\t\t\t\tvModel:fileList={fileList.value}\n\t\t\t\t\tmultiple={true}\n\t\t\t\t\tdisabled={disabled.value}\n\t\t\t\t\thttpRequest={httpRequest.value}\n\t\t\t\t\tbeforeUpload={handleBeforeUpload}\n\t\t\t\t\tonExceed={handleOnExceed}\n\t\t\t\t\tonSuccess={handleOnSuccess}\n\t\t\t\t\tonError={handleOnError}\n\t\t\t\t\tonRemove={handleOnRemove}\n\t\t\t\t>\n\t\t\t\t\t{{\n\t\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\t\tfileList.value.length < props.limit && slots.default ? (\n\t\t\t\t\t\t\t\tslots.default()\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t<Plus />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\ttip: () => <div class=\"el-upload__tip\">files with a size less than {maxSizeMB.value.toString()}MB</div>,\n\t\t\t\t\t\tfile: ({ file, index }: { file: UploadFile; index: number }) => (\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<img class=\"el-upload-list__item-thumbnail\" src={file.url} />\n\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-actions\">\n\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-preview\" onClick={() => handlePreview(file)} title=\"查看\">\n\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t<ZoomIn />\n\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{!disabled.value && (\n\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={handleEdit} title=\"编辑\">\n\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Edit />\n\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={() => handleRemove(index)} title=\"删除\">\n\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Delete />\n\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\t}}\n\t\t\t\t</ElUpload>\n\t\t\t\t{state.preview && (\n\t\t\t\t\t<ElImageViewer\n\t\t\t\t\t\tcloseOnPressEscape\n\t\t\t\t\t\thideOnClickModal\n\t\t\t\t\t\tteleported\n\t\t\t\t\t\tinitialIndex={Math.max(state.previewIndex, 0)}\n\t\t\t\t\t\tonClose={() => (state.preview = false)}\n\t\t\t\t\t\turlList={state.previewList}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Fragment>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 取消上传请求 */\n\t\t\tabort: computed(() => uploadRef.value?.abort),\n\t\t\t/** @description 手动上传文件列表 */\n\t\t\tsubmit: computed(() => uploadRef.value?.submit),\n\t\t\t/** @description 清空已上传的文件列表(该方法不支持在 before-upload 中调用) */\n\t\t\tclearFiles: computed(() => uploadRef.value?.clearFiles),\n\t\t\t/** @description 手动选择文件 */\n\t\t\thandleStart: computed(() => uploadRef.value?.handleStart),\n\t\t\t/** @description 手动移除文件。file 和 rawFile 已被合并。 */\n\t\t\thandleRemove: computed(() => uploadRef.value?.handleRemove),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading,\n\t\t\t/** @description 文件集合 */\n\t\t\tfileList,\n\t\t\t/** @description 预览 */\n\t\t\tpreview: computed(() => state.preview),\n\t\t\t/** @description 预览集合 */\n\t\t\tpreviewList: computed(() => state.previewList),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;AAUA,MAAa,sBAAsB;CAClC,GAAG;;CAEH,QAAQ;EACP,MAAM;EACN,eAAuB,WAAW;CACnC;;CAEA,UAAU;EACT,MAAM,eAAiD,MAAM;EAC7D,SAAS;CACV;;CAEA,UAAU;EACT,MAAM;EACN,SAAS;CACV;;CAEA,OAAO;EACN,MAAM;EACN,SAAS;CACV;;CAEA,YAAY,eAAgC,CAAC,KAAK,CAAC;;CAEnD,SAAS;EACR,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,WAAW,EACV,MAAM,eAAwD,QAAQ,EACvE;;CAEA,WAAW;AACZ;;AAGA,MAAa,sBAAsB;;CAElC,sBAAsB,UAAoC,QAAQ,KAAK,KAAK,OAAO,KAAK;;CAExF,oBAAoB,UAAqC,QAAQ,KAAK;AACvE;AAQA,IAAA,uBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO;CACP,OAAO,UAA+B;CACtC,MAAM,OAAO,EAAE,OAAO,MAAM,UAAU;EACrC,MAAM,EACL,UACA,SACA,aACA,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