@cldemo/ui-kit 1.0.10 → 1.0.11
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.
- package/buildLibs/utils/Element/ClCheckboxOne.cjs +2 -0
- package/buildLibs/utils/Element/ClCheckboxOne.cjs.map +1 -0
- package/buildLibs/utils/Element/ClCheckboxOne.js +5 -0
- package/buildLibs/utils/Element/ClCheckboxOne.js.map +1 -0
- package/buildLibs/utils/Element/ClFormValidate.cjs +2 -0
- package/buildLibs/utils/Element/ClFormValidate.cjs.map +1 -0
- package/buildLibs/utils/Element/ClFormValidate.js +5 -0
- package/buildLibs/utils/Element/ClFormValidate.js.map +1 -0
- package/buildLibs/utils/Element/ClImage.cjs +1 -1
- package/buildLibs/utils/Element/ClImage.js +1 -1
- package/buildLibs/utils/Element/ClLoadFullCenter.cjs +2 -0
- package/buildLibs/utils/Element/ClLoadFullCenter.cjs.map +1 -0
- package/buildLibs/utils/Element/ClLoadFullCenter.css +1 -0
- package/buildLibs/utils/Element/ClLoadFullCenter.js +45 -0
- package/buildLibs/utils/Element/ClLoadFullCenter.js.map +1 -0
- package/buildLibs/utils/Element/ClLoadIng.cjs +2 -0
- package/buildLibs/utils/Element/ClLoadIng.cjs.map +1 -0
- package/buildLibs/utils/Element/ClLoadIng.js +5 -0
- package/buildLibs/utils/Element/ClLoadIng.js.map +1 -0
- package/buildLibs/utils/Element/ClLoadWarp.cjs +2 -0
- package/buildLibs/utils/Element/ClLoadWarp.cjs.map +1 -0
- package/buildLibs/utils/Element/ClLoadWarp.css +1 -0
- package/buildLibs/utils/Element/ClLoadWarp.js +53 -0
- package/buildLibs/utils/Element/ClLoadWarp.js.map +1 -0
- package/buildLibs/utils/Element/ClRadioOne.cjs +2 -0
- package/buildLibs/utils/Element/ClRadioOne.cjs.map +1 -0
- package/buildLibs/utils/Element/ClRadioOne.js +5 -0
- package/buildLibs/utils/Element/ClRadioOne.js.map +1 -0
- package/buildLibs/utils/Element/ClTransitionSlideupdown.cjs +2 -0
- package/buildLibs/utils/Element/ClTransitionSlideupdown.cjs.map +1 -0
- package/buildLibs/utils/Element/ClTransitionSlideupdown.js +5 -0
- package/buildLibs/utils/Element/ClTransitionSlideupdown.js.map +1 -0
- package/buildLibs/utils/Element/ClWaterfallImage.cjs +2 -0
- package/buildLibs/utils/Element/ClWaterfallImage.cjs.map +1 -0
- package/buildLibs/utils/Element/ClWaterfallImage.css +1 -0
- package/buildLibs/utils/Element/ClWaterfallImage.js +48 -0
- package/buildLibs/utils/Element/ClWaterfallImage.js.map +1 -0
- package/buildLibs/utils/Mobile/ClBanner.cjs +1 -1
- package/buildLibs/utils/Mobile/ClBanner.js +1 -1
- package/buildLibs/utils/Mobile/ClDropdownMenuM.cjs +1 -1
- package/buildLibs/utils/Mobile/ClDropdownMenuM.cjs.map +1 -1
- package/buildLibs/utils/Mobile/ClDropdownMenuM.js +13 -12
- package/buildLibs/utils/Mobile/ClDropdownMenuM.js.map +1 -1
- package/buildLibs/utils/Mobile/ClDropdownMenuMItem.cjs +2 -0
- package/buildLibs/utils/Mobile/ClDropdownMenuMItem.cjs.map +1 -0
- package/buildLibs/utils/Mobile/ClDropdownMenuMItem.js +160 -0
- package/buildLibs/utils/Mobile/ClDropdownMenuMItem.js.map +1 -0
- package/buildLibs/utils/Mobile/ClPicker.cjs +1 -1
- package/buildLibs/utils/Mobile/ClPicker.js +1 -1
- package/buildLibs/utils/Mobile/ClPickerDate.cjs +1 -1
- package/buildLibs/utils/Mobile/ClPickerDate.js +1 -1
- package/buildLibs/utils/Mobile/ClPickerTime.cjs +1 -1
- package/buildLibs/utils/Mobile/ClPickerTime.js +1 -1
- package/buildLibs/utils/Mobile/ClPullToRefresh.cjs +1 -1
- package/buildLibs/utils/Mobile/ClPullToRefresh.js +1 -1
- package/buildLibs/utils/Mobile/ClScrollCard.cjs +1 -1
- package/buildLibs/utils/Mobile/ClScrollCard.js +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BPgunUb2.js → Index.vue_vue_type_script_setup_true_lang-6KT1IHDu.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BPgunUb2.js.map → Index.vue_vue_type_script_setup_true_lang-6KT1IHDu.js.map} +1 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-B-yZtW91.js +71 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-B-yZtW91.js.map +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-gtDsWrhd.js → Index.vue_vue_type_script_setup_true_lang-BDPkmgGP.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-gtDsWrhd.js.map → Index.vue_vue_type_script_setup_true_lang-BDPkmgGP.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-D_IwyxiV.js → Index.vue_vue_type_script_setup_true_lang-Bnjm8vi-.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-D_IwyxiV.js.map → Index.vue_vue_type_script_setup_true_lang-Bnjm8vi-.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Cpb9rd-y.js → Index.vue_vue_type_script_setup_true_lang-Bs8FGIQa.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Cpb9rd-y.js.map → Index.vue_vue_type_script_setup_true_lang-Bs8FGIQa.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-hm75HKxP.js → Index.vue_vue_type_script_setup_true_lang-C7FRB7fV.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-hm75HKxP.js.map → Index.vue_vue_type_script_setup_true_lang-C7FRB7fV.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Xe4BacqD.js → Index.vue_vue_type_script_setup_true_lang-CFzimlB_.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Xe4BacqD.js.map → Index.vue_vue_type_script_setup_true_lang-CFzimlB_.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Bp39ENoP.js → Index.vue_vue_type_script_setup_true_lang-CGeXNRtY.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Bp39ENoP.js.map → Index.vue_vue_type_script_setup_true_lang-CGeXNRtY.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-4NloX3Qk.js → Index.vue_vue_type_script_setup_true_lang-CSV9UWJx.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-4NloX3Qk.js.map → Index.vue_vue_type_script_setup_true_lang-CSV9UWJx.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-CRJ3-pTH.js → Index.vue_vue_type_script_setup_true_lang-ChE1tZwr.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-CRJ3-pTH.js.map → Index.vue_vue_type_script_setup_true_lang-ChE1tZwr.js.map} +1 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CjgtxJ6a.js +2 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CjgtxJ6a.js.map +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-N1GhNa1r.js → Index.vue_vue_type_script_setup_true_lang-CpuYxzDD.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-N1GhNa1r.js.map → Index.vue_vue_type_script_setup_true_lang-CpuYxzDD.js.map} +1 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CumTbPny.js +2 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CumTbPny.js.map +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-NdqbsOrG.js → Index.vue_vue_type_script_setup_true_lang-CvF_iIQS.js} +2 -2
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-NdqbsOrG.js.map → Index.vue_vue_type_script_setup_true_lang-CvF_iIQS.js.map} +1 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CxVAWr6w.js +266 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CxVAWr6w.js.map +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-DgMvq-RQ.js → Index.vue_vue_type_script_setup_true_lang-DFKjhT_C.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-DgMvq-RQ.js.map → Index.vue_vue_type_script_setup_true_lang-DFKjhT_C.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-D22m4oiN.js → Index.vue_vue_type_script_setup_true_lang-DdWmaT86.js} +2 -2
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-D22m4oiN.js.map → Index.vue_vue_type_script_setup_true_lang-DdWmaT86.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BtoovAWs.js → Index.vue_vue_type_script_setup_true_lang-DxHfO8TH.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BtoovAWs.js.map → Index.vue_vue_type_script_setup_true_lang-DxHfO8TH.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-CW63TdvW.js → Index.vue_vue_type_script_setup_true_lang-HwprdMv4.js} +2 -2
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-CW63TdvW.js.map → Index.vue_vue_type_script_setup_true_lang-HwprdMv4.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BLp0owhs.js → Index.vue_vue_type_script_setup_true_lang-IGgTDykL.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BLp0owhs.js.map → Index.vue_vue_type_script_setup_true_lang-IGgTDykL.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BKr3_J68.js → Index.vue_vue_type_script_setup_true_lang-Lwl-M8kR.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BKr3_J68.js.map → Index.vue_vue_type_script_setup_true_lang-Lwl-M8kR.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Dxb_K2w0.js → Index.vue_vue_type_script_setup_true_lang-gsnpWNek.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Dxb_K2w0.js.map → Index.vue_vue_type_script_setup_true_lang-gsnpWNek.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-EGKo8cIw.js → Index.vue_vue_type_script_setup_true_lang-huUkL0wY.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-EGKo8cIw.js.map → Index.vue_vue_type_script_setup_true_lang-huUkL0wY.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BFSRH9yz.js → Index.vue_vue_type_script_setup_true_lang-in1ZSapu.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BFSRH9yz.js.map → Index.vue_vue_type_script_setup_true_lang-in1ZSapu.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-C8HQVerr.js → Index.vue_vue_type_script_setup_true_lang-r6RBdV4y.js} +2 -2
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-C8HQVerr.js.map → Index.vue_vue_type_script_setup_true_lang-r6RBdV4y.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-DvzXfKhj.js → Index.vue_vue_type_script_setup_true_lang-tTHdssVu.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-DvzXfKhj.js.map → Index.vue_vue_type_script_setup_true_lang-tTHdssVu.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BxxIDGfR.js → Index.vue_vue_type_script_setup_true_lang-tjRv0vNR.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BxxIDGfR.js.map → Index.vue_vue_type_script_setup_true_lang-tjRv0vNR.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Bk2WD0GS.js → Index.vue_vue_type_script_setup_true_lang-yahz6Ej5.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Bk2WD0GS.js.map → Index.vue_vue_type_script_setup_true_lang-yahz6Ej5.js.map} +1 -1
- package/buildLibs/utils/Shared/Index24.css +1 -1
- package/buildLibs/utils/Shared/Index25.css +1 -1
- package/buildLibs/utils/Shared/Index26.css +1 -1
- package/buildLibs/utils/Shared/Index27.css +1 -1
- package/buildLibs/utils/Shared/Index28.css +1 -1
- package/buildLibs/utils/Shared/Index29.css +1 -1
- package/buildLibs/utils/Shared/Index30.css +1 -1
- package/buildLibs/utils/Shared/Index31.css +1 -1
- package/buildLibs/utils/Shared/Index32.css +1 -1
- package/buildLibs/utils/Shared/Index33.css +1 -1
- package/buildLibs/utils/Shared/Index34.css +1 -1
- package/buildLibs/utils/Shared/Index35.css +1 -1
- package/buildLibs/utils/Shared/Index36.css +1 -1
- package/buildLibs/utils/Shared/Index37.css +1 -0
- package/buildLibs/utils/Shared/One.vue_vue_type_script_setup_true_lang-CR1t8XZl.js +2 -0
- package/buildLibs/utils/Shared/One.vue_vue_type_script_setup_true_lang-CR1t8XZl.js.map +1 -0
- package/buildLibs/utils/Shared/One.vue_vue_type_script_setup_true_lang-oBeFlRzi.js +148 -0
- package/buildLibs/utils/Shared/One.vue_vue_type_script_setup_true_lang-oBeFlRzi.js.map +1 -0
- package/buildLibs/utils/Shared/Validate.vue_vue_type_script_setup_true_lang-Bquk40ES.js +406 -0
- package/buildLibs/utils/Shared/Validate.vue_vue_type_script_setup_true_lang-Bquk40ES.js.map +1 -0
- package/buildLibs/utils/Shared/Validate.vue_vue_type_script_setup_true_lang-CAmKX5pn.js +2 -0
- package/buildLibs/utils/Shared/Validate.vue_vue_type_script_setup_true_lang-CAmKX5pn.js.map +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-C9mOHVoE.js → use-CKNkvmW4.js} +78 -141
- package/buildLibs/utils/Shared/use-CKNkvmW4.js.map +1 -0
- package/buildLibs/utils/Shared/use-D0Yu2Dbn.js +2 -0
- package/buildLibs/utils/Shared/use-D0Yu2Dbn.js.map +1 -0
- package/buildLibs/utils/Web/ClCropperPreview.cjs +1 -1
- package/buildLibs/utils/Web/ClCropperPreview.js +2 -2
- package/buildLibs/utils/Web/ClDatetime.cjs +1 -1
- package/buildLibs/utils/Web/ClDatetime.js +1 -1
- package/buildLibs/utils/Web/ClDropdownMenuItem.cjs +2 -0
- package/buildLibs/utils/Web/ClDropdownMenuItem.cjs.map +1 -0
- package/buildLibs/utils/Web/ClDropdownMenuItem.css +1 -0
- package/buildLibs/utils/Web/ClDropdownMenuItem.js +72 -0
- package/buildLibs/utils/Web/ClDropdownMenuItem.js.map +1 -0
- package/buildLibs/utils/Web/ClEcharts.cjs +1 -1
- package/buildLibs/utils/Web/ClEcharts.js +1 -1
- package/buildLibs/utils/Web/ClEchartsLineAxisTag.cjs +1 -1
- package/buildLibs/utils/Web/ClEchartsLineAxisTag.js +1 -1
- package/buildLibs/utils/Web/ClFileUpload.cjs +1 -1
- package/buildLibs/utils/Web/ClFileUpload.js +1 -1
- package/buildLibs/utils/Web/ClInputTag.cjs +1 -1
- package/buildLibs/utils/Web/ClInputTag.js +1 -1
- package/buildLibs/utils/Web/ClPaginate.cjs +1 -1
- package/buildLibs/utils/Web/ClPaginate.js +1 -1
- package/buildLibs/utils/Web/ClPreviewExample.cjs +1 -1
- package/buildLibs/utils/Web/ClPreviewExample.js +1 -1
- package/buildLibs/utils/Web/ClScrollXFence.cjs +1 -1
- package/buildLibs/utils/Web/ClScrollXFence.js +1 -1
- package/buildLibs/utils/Web/ClSelect.cjs +1 -1
- package/buildLibs/utils/Web/ClSelect.js +1 -1
- package/buildLibs/utils/Web/ClSelectCascade.cjs +1 -1
- package/buildLibs/utils/Web/ClSelectCascade.js +1 -1
- package/buildLibs/utils/Web/ClSelectTag.cjs +1 -1
- package/buildLibs/utils/Web/ClSelectTag.js +1 -1
- package/buildLibs/utils/Web/ClSelectTree.cjs +1 -1
- package/buildLibs/utils/Web/ClSelectTree.js +1 -1
- package/buildLibs/utils/Web/ClTable.cjs +1 -1
- package/buildLibs/utils/Web/ClTable.cjs.map +1 -1
- package/buildLibs/utils/Web/ClTable.js +1081 -1218
- package/buildLibs/utils/Web/ClTable.js.map +1 -1
- package/buildLibs/utils/Web/ClTabs.cjs +1 -1
- package/buildLibs/utils/Web/ClTabs.js +1 -1
- package/buildLibs/utils/Web/ClTree.cjs +1 -1
- package/buildLibs/utils/Web/ClTree.js +1 -1
- package/buildLibs/utils/Web/ClXeditable.cjs +1 -1
- package/buildLibs/utils/Web/ClXeditable.cjs.map +1 -1
- package/buildLibs/utils/Web/ClXeditable.js +33 -32
- package/buildLibs/utils/Web/ClXeditable.js.map +1 -1
- package/package.json +21 -8
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-B-yxIx8F.js +0 -663
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-B-yxIx8F.js.map +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-C9mOHVoE.js.map +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CcOk4kyd.js +0 -2
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CcOk4kyd.js.map +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DtZgYjSl.js +0 -2
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DtZgYjSl.js.map +0 -1
- package/buildLibs/utils/Shared/Video-BV0YLYT2.js +0 -114
- package/buildLibs/utils/Shared/Video-BV0YLYT2.js.map +0 -1
- package/buildLibs/utils/Shared/Video-c3jHJSxl.js +0 -2
- package/buildLibs/utils/Shared/Video-c3jHJSxl.js.map +0 -1
- package/buildLibs/utils/Shared/Video.css +0 -1
- package/buildLibs/utils/Web/ClDropdownMenuM.css +0 -1
- package/buildLibs/utils/Web/ClPreview.cjs +0 -2
- package/buildLibs/utils/Web/ClPreview.cjs.map +0 -1
- package/buildLibs/utils/Web/ClPreview.css +0 -1
- package/buildLibs/utils/Web/ClPreview.js +0 -353
- package/buildLibs/utils/Web/ClPreview.js.map +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineComponent as _, ref as m, computed as r, watch as N, openBlock as S, createElementBlock as I, normalizeStyle as g, normalizeClass as B, unref as v, createElementVNode as w } from "vue";
|
|
2
|
+
import { C as i } from "./base-DU7nGSf6.js";
|
|
3
|
+
import { C as x } from "./index-DvNmQjNH.js";
|
|
4
|
+
import { u as k } from "./use-CKNkvmW4.js";
|
|
5
|
+
const z = ["id"], O = ["alt"], A = /* @__PURE__ */ _({
|
|
6
|
+
name: "ClImage",
|
|
7
|
+
__name: "Index",
|
|
8
|
+
props: {
|
|
9
|
+
id: {},
|
|
10
|
+
className: {},
|
|
11
|
+
src: {},
|
|
12
|
+
alt: {},
|
|
13
|
+
height: {},
|
|
14
|
+
width: {},
|
|
15
|
+
isCircle: { type: Boolean },
|
|
16
|
+
fit: {},
|
|
17
|
+
isCrossOrigin: { type: Boolean }
|
|
18
|
+
},
|
|
19
|
+
emits: ["onInit"],
|
|
20
|
+
setup(p, { emit: f }) {
|
|
21
|
+
const e = p, d = f, l = m(i.isNonEmptyString(e.src) ? e.src : ""), a = m(null), h = r(() => i.isNonEmptyString(e.alt) ? e.alt : ""), y = e.id;
|
|
22
|
+
k(a, l, {
|
|
23
|
+
callback: {
|
|
24
|
+
loaded: () => {
|
|
25
|
+
c();
|
|
26
|
+
},
|
|
27
|
+
error: () => {
|
|
28
|
+
c();
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
isCrossOrigin: e.isCrossOrigin
|
|
32
|
+
});
|
|
33
|
+
const u = r(() => {
|
|
34
|
+
let t = {
|
|
35
|
+
"panel-imageBox": !0,
|
|
36
|
+
"imageBox-circle": e.isCircle
|
|
37
|
+
};
|
|
38
|
+
return t = i.getJsonMerge(t, x.getClassNameJson(e.className)), t;
|
|
39
|
+
}), C = r(() => {
|
|
40
|
+
const { width: t, height: s } = e, n = {};
|
|
41
|
+
return i.isNonEmptyString(t) && (n.width = t), i.isNonEmptyString(s) && (n.height = s), n;
|
|
42
|
+
}), E = r(() => {
|
|
43
|
+
const { width: t, height: s, fit: n } = e, o = {};
|
|
44
|
+
return i.isNonEmptyString(n) && (o["object-fit"] = n, i.isNonEmptyString(t) && (o.width = t), i.isNonEmptyString(s) && (o.height = s)), o;
|
|
45
|
+
});
|
|
46
|
+
function c() {
|
|
47
|
+
d("onInit");
|
|
48
|
+
}
|
|
49
|
+
return N(
|
|
50
|
+
() => e.src,
|
|
51
|
+
(t) => {
|
|
52
|
+
l.value = i.isNonEmptyString(t) ? t : "";
|
|
53
|
+
}
|
|
54
|
+
), (t, s) => (S(), I("div", {
|
|
55
|
+
id: v(y),
|
|
56
|
+
class: B(u.value),
|
|
57
|
+
style: g(C.value)
|
|
58
|
+
}, [
|
|
59
|
+
w("img", {
|
|
60
|
+
ref_key: "refElImage",
|
|
61
|
+
ref: a,
|
|
62
|
+
alt: h.value,
|
|
63
|
+
style: g(E.value)
|
|
64
|
+
}, null, 12, O)
|
|
65
|
+
], 14, z));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
export {
|
|
69
|
+
A as _
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=Index.vue_vue_type_script_setup_true_lang-B-yZtW91.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Index.vue_vue_type_script_setup_true_lang-B-yZtW91.js","sources":["../../../src/libs/Element/Image/Index.vue"],"sourcesContent":["<template>\n <div\n :id=\"elId\"\n :class=\"clsParent\"\n :style=\"styParent\"\n >\n <img\n ref=\"refElImage\"\n :alt=\"optAlt\"\n :style=\"styImg\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, watch } from 'vue';\nimport CommonBase from '../../Common/base';\nimport CommonElement from '../../Common/Element/index';\nimport { useLazyload } from '../LazyImage/use';\nimport './Index.css';\n\n// defineOptions\ndefineOptions({\n name: 'ClImage',\n});\n\n// props\nconst props = defineProps<{\n id?: string; // desc: 自定义id\n className?: string; // desc: 自定义CSS类名\n src: string; // desc: 图片地址\n alt?: string; // desc: 图片替代文本\n height?: string; // desc: 图片高度\n width?: string; // desc: 图片宽度\n isCircle?: boolean; // desc: 是否圆形展示\n fit?: string; // desc: 图片填充方式 | enum: fill, contain, cover, none, scale-down(可自定义)\n isCrossOrigin?: boolean; // desc: 是否跨域加载\n}>();\n\n// emit\nconst emit = defineEmits<{\n (e: 'onInit'): void; // desc: 图片加载完成时触发(成功或失败均触发)\n}>();\n\n// 常量 / 变量定义\nconst optSrcUrl = ref(CommonBase.isNonEmptyString(props.src) ? props.src : '');\nconst refElImage = ref<HTMLImageElement | null>(null);\n\nconst optAlt = computed(() => (CommonBase.isNonEmptyString(props.alt) ? props.alt : ''));\n\n// elId _elId_image\nconst elId = props.id; // || `_elId_image_${CommonBase.getRandom(5)}`;\n\nuseLazyload(refElImage, optSrcUrl, {\n callback: {\n loaded: () => {\n _emitInit();\n },\n error: () => {\n _emitInit();\n },\n },\n isCrossOrigin: props.isCrossOrigin,\n});\n\n// computed\nconst clsParent = computed(() => {\n let cls: Record<string, boolean> = {\n 'panel-imageBox': true,\n 'imageBox-circle': props.isCircle,\n };\n cls = CommonBase.getJsonMerge(cls, CommonElement.getClassNameJson(props.className));\n return cls;\n});\n\nconst styParent = computed(() => {\n const { width, height } = props;\n const sty: Record<string, string> = {};\n if (CommonBase.isNonEmptyString(width)) {\n sty.width = width;\n }\n if (CommonBase.isNonEmptyString(height)) {\n sty.height = height;\n }\n return sty;\n});\n\nconst styImg = computed(() => {\n const { width, height, fit } = props;\n const sty: Record<string, string> = {};\n if (CommonBase.isNonEmptyString(fit)) {\n sty['object-fit'] = fit;\n if (CommonBase.isNonEmptyString(width)) {\n sty.width = width;\n }\n if (CommonBase.isNonEmptyString(height)) {\n sty.height = height;\n }\n }\n return sty;\n});\n\n// emit包装\nfunction _emitInit() {\n emit('onInit');\n}\n\n// watch\nwatch(\n () => props.src,\n newValue => {\n optSrcUrl.value = CommonBase.isNonEmptyString(newValue) ? newValue : '';\n },\n);\n</script>\n"],"names":["props","__props","emit","__emit","optSrcUrl","ref","CommonBase","refElImage","optAlt","computed","elId","useLazyload","_emitInit","clsParent","cls","CommonElement","styParent","width","height","sty","styImg","fit","watch","newValue","_createElementBlock","_unref","_createElementVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,UAAMA,IAAQC,GAaRC,IAAOC,GAKPC,IAAYC,EAAIC,EAAW,iBAAiBN,EAAM,GAAG,IAAIA,EAAM,MAAM,EAAE,GACvEO,IAAaF,EAA6B,IAAI,GAE9CG,IAASC,EAAS,MAAOH,EAAW,iBAAiBN,EAAM,GAAG,IAAIA,EAAM,MAAM,EAAG,GAGjFU,IAAOV,EAAM;AAEnB,IAAAW,EAAYJ,GAAYH,GAAW;AAAA,MACjC,UAAU;AAAA,QACR,QAAQ,MAAM;AACZ,UAAAQ,EAAA;AAAA,QACF;AAAA,QACA,OAAO,MAAM;AACX,UAAAA,EAAA;AAAA,QACF;AAAA,MAAA;AAAA,MAEF,eAAeZ,EAAM;AAAA,IAAA,CACtB;AAGD,UAAMa,IAAYJ,EAAS,MAAM;AAC/B,UAAIK,IAA+B;AAAA,QACjC,kBAAkB;AAAA,QAClB,mBAAmBd,EAAM;AAAA,MAAA;AAE3B,aAAAc,IAAMR,EAAW,aAAaQ,GAAKC,EAAc,iBAAiBf,EAAM,SAAS,CAAC,GAC3Ec;AAAA,IACT,CAAC,GAEKE,IAAYP,EAAS,MAAM;AAC/B,YAAM,EAAE,OAAAQ,GAAO,QAAAC,EAAA,IAAWlB,GACpBmB,IAA8B,CAAA;AACpC,aAAIb,EAAW,iBAAiBW,CAAK,MACnCE,EAAI,QAAQF,IAEVX,EAAW,iBAAiBY,CAAM,MACpCC,EAAI,SAASD,IAERC;AAAA,IACT,CAAC,GAEKC,IAASX,EAAS,MAAM;AAC5B,YAAM,EAAE,OAAAQ,GAAO,QAAAC,GAAQ,KAAAG,EAAA,IAAQrB,GACzBmB,IAA8B,CAAA;AACpC,aAAIb,EAAW,iBAAiBe,CAAG,MACjCF,EAAI,YAAY,IAAIE,GAChBf,EAAW,iBAAiBW,CAAK,MACnCE,EAAI,QAAQF,IAEVX,EAAW,iBAAiBY,CAAM,MACpCC,EAAI,SAASD,KAGVC;AAAA,IACT,CAAC;AAGD,aAASP,IAAY;AACnB,MAAAV,EAAK,QAAQ;AAAA,IACf;AAGA,WAAAoB;AAAA,MACE,MAAMtB,EAAM;AAAA,MACZ,CAAAuB,MAAY;AACV,QAAAnB,EAAU,QAAQE,EAAW,iBAAiBiB,CAAQ,IAAIA,IAAW;AAAA,MACvE;AAAA,IAAA,mBA/GAC,EAUM,OAAA;AAAA,MATH,IAAIC,EAAAf,CAAA;AAAA,MACJ,SAAOG,EAAA,KAAS;AAAA,MAChB,SAAOG,EAAA,KAAS;AAAA,IAAA;MAEjBU,EAIE,OAAA;AAAA,iBAHI;AAAA,QAAJ,KAAInB;AAAA,QACH,KAAKC,EAAA;AAAA,QACL,SAAOY,EAAA,KAAM;AAAA,MAAA;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";const e=require("vue"),i=require("./base-C2QOJBgB.js"),ue=require("./index-DAgtltwJ.js"),Se=require("./Index.vue_vue_type_script_setup_true_lang-Dvy5B6_y.js"),P=require("./Index.vue_vue_type_script_setup_true_lang-g88DiQYZ.js"),he=require("./language-DNQZvFJT.js"),ye=require("./Index.vue_vue_type_script_setup_true_lang-BavQMSPb.js"),z={format:{img:["jpg","jpe","jpeg","png","gif","bmp","ico"],video:["mp4","rmvb","3gp","avi","asf","asf","dv","mov","mpg4","mpeg","mpg","wm","wmx","flv","mkv","mp4a","rm","wmv","swf","swfl"],audio:["mp3","ogg","wav","wma","mid","ra","ram"],zip:["rar","zip"],excel:["xls","xlsx","csv"],pdf:["pdf"],txt:["txt"],doc:["doc","docx"]},icon:{img:"image",video:"video",audio:"music",txt:"text",zip:"zip",excel:"excel",pdf:"pdf",doc:"word",default:"file"},suffix:{jpg:["jpg","jpe","jpeg"],jpe:["jpg","jpe","jpeg"],jpeg:["jpg","jpe","jpeg"],png:["png"],gif:["gif"],bmp:["bmp"],ico:["ico"],mp4:["mp4"],rmvb:["rmvb"],"3gp":["3gp"],avi:["avi"],asf:["asf"],dv:["dv"],mov:["mov"],mpg4:["mpg4"],mpeg:["mpeg"],mpg:["mpg"],wm:["wm"],wmx:["wmx"],flv:["flv"],mkv:["mkv"],mp4a:["mp4a"],rm:["rm"],wmv:["wmv"],swf:["swf"],swfl:["swfl"],mp3:["mp3"],ogg:["ogg"],wav:["wav"],wma:["wma"],mid:["mid"],ra:["ra"],ram:["ram"],rar:["rar"],zip:["zip"],txt:["txt"],xls:["xls","xlsx","csv"],xlsx:["xls","xlsx","csv"],csv:["xls","xlsx","csv"],pdf:["pdf"],doc:["doc","docx"]},mime:{jpg:["image/jpg","image/jpeg","image/pjpeg"],jpe:["image/jpg","image/jpeg","image/pjpeg"],jpeg:["image/jpg","image/jpeg","image/pjpeg"],png:["image/png","image/x-png"],gif:["image/gif"],bmp:["image/bmp"],ico:["ico"],mp4:["video/mp4"],rmvb:["audio/x-pn-realaudio"],"3gp":["video/3gpp"],avi:["video/x-msvideo"],asf:["video/x-ms-asf"],dv:["video/x-dv"],mov:["video/quicktime"],mpg4:["video/mp4"],mpeg:["video/mpeg"],mpg:["video/mpeg"],wm:["video/x-ms-wmv"],wmx:["video/x-ms-wmx"],flv:["video/x-flv"],mkv:["video/x-matroska"],mp4a:["audio/mp4"],rm:["audio/x-pn-realaudio"],wmv:["audio/x-ms-wmv"],swf:["application/x-shockwave-flash"],swfl:["application/x-shockwave-flash"],mp3:["audio/mpeg"],ogg:["audio/ogg"],wav:["audio/wav"],wma:["audio/x-ms-wma"],mid:["audio/midi"],ra:["audio/x-pn-realaudio"],ram:["audio/x-pn-realaudio"],rar:["application/x-rar-compressed"],zip:["application/zip","application/x-zip-compressed"],txt:["text/plain"],xls:["application/vnd.ms-excel","application/wps-office.xls"],xlsx:["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/wps-office.xlsx"],csv:["text/csv"],pdf:["application/pdf"],doc:["application/msword"],docx:["application/vnd.openxmlformats-officedocument.wordprocessingml.document"]},getFormatGroup:n=>{let m=[];return i.CommonBase.isNonEmptyString(n)&&(n.split(",").forEach(t=>{for(const[k,x]of Object.entries(z.format))i.CommonBase.isExistValue(x,t.toLocaleLowerCase())&&m.push(k)}),m=i.CommonBase.getArrUnique(m)),m},getIcon:n=>{let m="";return i.CommonBase.isEmpty(n)?m=z.icon.default:m=i.CommonBase.isExistJsonKey(z.icon,n)?z.icon[n]:z.icon.default,m},getSuffix:n=>{let m=[];return i.CommonBase.isEmpty(n)||(n.forEach(p=>{const t=z.suffix[p.toLocaleLowerCase()];i.CommonBase.isUndefined(t)||(m=m.concat(t))}),i.CommonBase.isEmpty(m)&&(m=n)),m=i.CommonBase.getArrUnique(m),m},getRegexBySuffix:n=>{if(i.CommonBase.isEmpty(n))return null;const m=`\\.(?:${n.join("|")})$`;return new RegExp(m,"i")},getMime:n=>{let m=[];return i.CommonBase.isEmpty(n)||n.forEach(p=>{const t=z.mime[p];i.CommonBase.isUndefined(t)||(m=m.concat(t))}),m=i.CommonBase.getArrUnique(m),m},getRegexByMime:n=>{if(i.CommonBase.isEmpty(n))return null;const m=`^(?:${n.join("|").replace(/\//g,"\\/")})$`;return new RegExp(m,"i")},getImageThumbnail:(n,m,p)=>{let t=null;try{const k=document.createElement("canvas");k.width=m,k.height=p,k.getContext("2d").drawImage(n,0,0,n.width,n.height,0,0,m,p),t=k.toDataURL("image/gif")}catch{t=null}return t}},ke=(n,m)=>{let p=n;const t=e.reactive({mime:[],suffix:[],isCheckImgWH:!1});let k=null;const x=d=>{p=i.CommonBase.getJsonMerge(p,d),U()},U=()=>{const d=i.CommonBase.isNonEmptyString(p.checkFormat)?z.getSuffix(p.checkFormat.split(",")):[],g=z.getMime(d),v=!i.CommonBase.isEmpty(p.checkWidth)&&!i.CommonBase.isEmpty(p.checkHeight);t.mime=g,t.suffix=d,t.isCheckImgWH=v},$=d=>{const g=z.getIcon(d);return{type:d,icon:g,isImage:d==="img",isVideo:d==="video",isAudio:d==="audio",isTxt:d==="txt",isZip:d==="zip"}},R=(d,g)=>{if(i.CommonBase.isUndefined(k)){k={};for(const[w,c]of Object.entries(z.format)){const s=z.getSuffix(c),u=z.getMime(s),I=z.getRegexBySuffix(s),F=z.getRegexByMime(u);k[w]={suffix:s,mime:u,regSuffix:I,regMime:F}}}let v="";return Object.keys(k).forEach(w=>{if(v.length===0){const c=k[w];(c.regSuffix&&c.regSuffix.test(d)||g&&c.regMime&&c.regMime.test(g))&&(v=w)}}),$(v)},W=d=>{const g=z.getFormatGroup(i.CommonBase.isEmpty(d)?p.checkFormat:d),v=g.length===1?g[0]:"";return $(v)},A=d=>{if(!i.CommonBase.isString(d))return R("");if(d.startsWith("data:")||d.startsWith("blob:")){const v=d.match(/^[a-z]+:([a-zA-Z0-9.+-]+\/[a-zA-Z0-9.+-]+)/);return R("",v?v[1]:"")}const g=d.substring(d.lastIndexOf("/")+1).split("?")[0].split("#")[0];return R(g)},L=(d,g)=>new Promise((v,w)=>{const c=document.createElement("img");c.onload=s=>{const u=s.target.width,I=s.target.height;let F=u,T=I;g&&g>0&&(F>g||T>g)&&(F>T?(T=parseInt((g/F*T).toString(),10),F=g):(F=parseInt((g/T*F).toString(),10),T=g));const f=s.target.src;v({src:f,w:u,h:I,tw:F,th:T,isImage:!0})},c.onerror=()=>{w(new Error("fail: temp create image"))},c.src=d}),D=(d,g)=>{const v=i.CommonBase.isEmpty(p.checkWidth)?0:parseInt(p.checkWidth,10),w=i.CommonBase.isEmpty(p.checkHeight)?0:parseInt(p.checkHeight,10);if(!i.CommonBase.isFinite(v)||!i.CommonBase.isFinite(w)||v===0||w===0)return!0;let c=!0;switch(p.checkWHType){case"greater":c=d>=v&&g>=w;break;case"less":c=d<=v&&g<=w;break;case"equal":c=d===v&&g===w;break;default:c=!0;break}return c},te=(d,g)=>new Promise((v,w)=>{if(d instanceof File){const c=new FileReader;c.onload=s=>{L(s.target.result,g.maxWidth).then(u=>{(t.isCheckImgWH?D(u.w,u.h):!0)?v(u):w(new Error(m.value.checkImageWHLabel))}).catch(u=>{w(u)})},c.onerror=()=>{w(new Error("fail: new FileReader image onload()"))},c.readAsDataURL(d)}else w(new Error("fail: file is not a File instance"))}),K=async(d,g)=>{let v=[];const w=[],c=[],s=z.getRegexBySuffix(t.suffix),u=z.getRegexByMime(t.mime),I=S=>{const b=i.CommonBase.isEmpty(S)?NaN:parseInt(S,10);return i.CommonBase.isFinite(b)?b*1024:null},F=I(p.checkMinSize),T=I(p.checkMaxSize),f=d.length;for(let S=0;S<f;S+=1){const b=[],H=d[S],_={suffix:!1,mime:!1,size:!1},E=H.name;s&&!s.test(E)&&(_.suffix=!0);const O=H.type;!i.CommonBase.isEmpty(O)&&u&&!u.test(O)&&(_.mime=!0),F&&H.size<F&&(_.size=!0),T&&H.size>T&&(_.size=!0),(_.suffix||_.mime)&&b.push(m.value.checkSuffixMimeLabel),_.size&&b.push(m.value.checkSizeLabel);const Z=R(E,O);let j=null;Z.isImage&&(j=await te(H,g).catch(V=>{b.push(V.message)})),i.CommonBase.isUndefined(j)&&(j={}),j=i.CommonBase.getJsonMerge(j,Z),j.fileName=E,j.file=H,b.length===0?(w.push(H),c.push(j)):f===1?v=b.map(V=>`${m.value.uploadFile} ${V}`):v.push(`${E}:${b.join(",")}`)}return new Promise(S=>{setTimeout(()=>{S({errorMsg:v,passFiles:w,passFilesInfo:c,original:d})},200)})};return U(),{optBase:t,getTypeByFormat:W,getTypeByUrl:A,createTempImg:L,checkFile:K,setBaseOptions:x}},ve=()=>({setFileInfo:(m,p)=>{const t=p&&p.fileUrl?p.fileUrl:"";if(!i.CommonBase.isString(t))return{name:"",url:"",imgSrc:"",imgWidth:0,imgHeight:0};const k=i.CommonBase.isEmpty(t);let x="";k||t.startsWith("blob:")?x=m.fileName:x=t.substr(t.lastIndexOf("/")+1);let U="",$=0,R=0;return m.isImage&&(U=k?m.src:t,$=m.tw||0,R=m.th||0),{name:x,url:t,imgSrc:U,imgWidth:$,imgHeight:R}}}),Be=()=>{const n=(p,t)=>{window.open(p)};return{downloadHref:n,downloadBlob:p=>{if(!i.CommonBase.isEmpty(p)){const t=p.lastIndexOf("/"),k=p.substring(t+1),x=p.replace(/\\/g,"/"),U=new XMLHttpRequest;U.open("GET",x,!0),U.responseType="blob",U.onload=()=>{if(U.status===200){const $=window.URL||window.webkitURL||window,R=new Blob([U.response]),W=document.createElementNS("http://www.w3.org/1999/xhtml","a");W.href=$.createObjectURL(R),W.download=k,W.click(),setTimeout(()=>URL.revokeObjectURL(W.href),1e3)}else n(p)},U.onerror=()=>{n(p)},U.send()}}}},Ce=["name","accept"],be=["name"],Ee={class:"fileUpload-label"},Fe={key:0,class:"fileUpload-img"},xe={class:"fileUpload-img-container"},Ue=["src","width","height"],Ie={key:0,class:"file-complete-img-msg"},Me=["title"],Te=["title"],_e={key:1,class:"fileUpload-video"},Ne=["src"],Re=["title"],He={key:2,class:"fileUpload-file"},ze=["title"],We={key:0,class:"fileUpload-load"},Oe=e.defineComponent({name:"ClFileUploadDefault",__name:"Default",props:{name:String,value:[String,Array,Object],className:String,disabled:{type:Boolean,default:!1},defaultHoverTitle:String,defaultIcon:String,checkFormat:String,checkMinSize:[String,Number],checkMaxSize:[String,Number],checkWidth:[String,Number],checkHeight:[String,Number],checkWHType:{type:String,default:"equal",validator:n=>["equal","greater","less"].includes(n)},isServerCallback:Boolean,isShowPreview:{type:Boolean,default:!0},isShowDownload:{type:Boolean,default:!0},isShowCompleteMsg:{type:Boolean,default:!0}},emits:["onChange","onError","onRemove","onPreview","onSaveFile"],setup(n,{expose:m,emit:p}){const t=n,k=p,{optPageLanguage:x,getPageLanguage:U}=he.useLanguage();U("fileUpload");const $=e.inject("$FileuploadTop",null);$||console.warn("[FileUpload] Default 主题缺少 $FileuploadTop 注入,使用空校验配置");const{setFileInfo:R}=ve(),W=()=>i.CommonBase.getJsonMerge($?.getFileCheckInfo()??{},{checkFormat:t.checkFormat,checkWidth:t.checkWidth,checkHeight:t.checkHeight,checkWHType:t.checkWHType,checkMinSize:t.checkMinSize,checkMaxSize:t.checkMaxSize}),{optBase:A,getTypeByFormat:L,getTypeByUrl:D,createTempImg:te,checkFile:K,setBaseOptions:d}=ke(W(),x),{downloadBlob:g,downloadHref:v}=Be(),w=e.ref(null),c=e.reactive({isImage:!1,isVideo:!1,icon:"",completeMsgTxt:"",isInitFileInput:!0,runOperateType:"init"}),s=e.reactive({name:"",url:"",imgSrc:"",imgWidth:0,imgHeight:0}),u={file:null};let I=0,F=null;const T=`fileUpload_${i.CommonBase.getRandom(8)}`,f=e.computed(()=>{let o=t.name;return i.CommonBase.isEmpty(o)&&(o=`fileUpload_${i.CommonBase.getRandom(8)}`),o}),S=e.computed(()=>{let o={"fileUpload-default":!0};return o=i.CommonBase.getJsonMerge(o,ue.CommonElement.getClassNameJson(t.className)),o}),b=e.computed(()=>({"fileUpload-wait":!0,"fileUpload-disabled":t.disabled})),H=e.computed(()=>({"fileUpload-complete":!0,"fileUpload-disabled":t.disabled})),_=o=>{k("onChange",o)},E=o=>{k("onError",o)},O=()=>{k("onRemove")},Z=(o,h)=>{k("onPreview",o,h)},j=(o,h)=>{k("onSaveFile",o,h)},V=o=>{c.isImage=o.isImage,c.isVideo=o.isVideo,c.icon=o.icon},Y=()=>{const o=L();i.CommonBase.isNonEmptyString(t.defaultIcon)&&(o.icon=t.defaultIcon),V(o)},y=o=>{o!=="load"&&(c.isInitFileInput=!0);let h="";switch(o){case"remove":case"clean":{h="init",Y();break}case"fail":{let M=!0;c.isImage?(!i.CommonBase.isEmpty(s.url)||!i.CommonBase.isEmpty(s.imgSrc))&&(M=!1):i.CommonBase.isEmpty(s.url)||(M=!1),h=M?"init":"complete";break}default:h=o}c.runOperateType=h},q=o=>{const h=s;for(const[M,G]of Object.entries(o))i.CommonBase.isUndefined(h[M])||(h[M]=G);u.file=o.file??u.file},ee=(o,h)=>{oe(),V(o);const M=R(o,h);q(M),y("complete")},ie=()=>{let o=null;return i.CommonBase.isString(s.url)&&s.url.startsWith("blob:")?o=u.file:i.CommonBase.isEmpty(s.url)?c.isImage&&!i.CommonBase.isEmpty(s.imgSrc)?o=s.imgSrc:o=u.file:o=s.url,i.CommonBase.isUndefined(o)&&(o=""),o},le=o=>{if(o.length>0&&c.runOperateType!=="load"){c.isInitFileInput=!1,y("load"),I+=1;const h={maxWidth:w.value?w.value.clientWidth-4:0};K(o,h).then(M=>{if(c.runOperateType==="load")if(M.passFiles.length>0){const G=M.passFiles[0],Q=M.passFilesInfo[0];if(Q.isImage)t.isServerCallback?(j(G,Q),ce()):(ee(Q,{}),u.file=G,_(Q.src));else if(t.isServerCallback)j(G,Q),ce();else{const me={};if(Q.isVideo){const we=URL.createObjectURL(G);me.fileUrl=we}ee(Q,me),u.file=G,_(G)}}else y("fail"),M.errorMsg.length>0&&E(M.errorMsg)}).catch(()=>{c.runOperateType==="load"&&(y("fail"),E(["文件校验失败,请重试"]))})}},ae=o=>{if(!i.CommonBase.isNonEmptyString(o)){(i.CommonBase.isString(o)||i.CommonBase.isUndefined(o))&&de();return}const h=++I,M=D(o);if(c.isImage&&M.isImage){const G=w.value?w.value.clientWidth-4:0;te(o,G).then(Q=>{if(h!==I)return;const me=i.CommonBase.getJsonMerge(Q,M);ee(me,{fileUrl:o})}).catch(()=>{h===I&&(y("fail"),E(["图片加载失败,请检查图片地址"]))})}else ee(M,{fileUrl:o})},oe=()=>{i.CommonBase.isString(s.url)&&s.url.startsWith("blob:")&&URL.revokeObjectURL(s.url)},X=()=>{F&&(clearTimeout(F),F=null)},ce=()=>{X(),F=setTimeout(()=>{c.runOperateType==="load"&&(y("fail"),E(["服务端保存超时,请重试"]))},6e4)},de=()=>{I+=1,u.file=null,q({name:"",url:"",imgSrc:"",imgWidth:0,imgHeight:0}),y("init")},se=()=>{if(i.CommonBase.isEmpty(t.value)){Y();return}V(D(t.value))},re=()=>{let o=t.defaultHoverTitle;c.isImage&&A.isCheckImgWH&&i.CommonBase.isEmpty(o)&&(o=`${t.checkWidth}x${t.checkHeight}`),c.completeMsgTxt=o},pe=()=>{se(),re(),ae(t.value)};e.onMounted(()=>{e.nextTick(()=>{pe()})}),e.watch(()=>t.value,(o,h)=>{if(o!==h){const M=ie();o!==M&&(X(),se(),ae(o))}}),e.watch([()=>t.checkFormat,()=>t.checkWidth,()=>t.checkHeight,()=>t.checkWHType,()=>t.checkMinSize,()=>t.checkMaxSize],()=>{if(X(),d(W()),se(),re(),c.runOperateType==="load")return;const o=ie();t.value===o&&ae(t.value)});const fe=o=>{o.preventDefault(),o.stopPropagation(),!t.disabled&&o.dataTransfer&&le(o.dataTransfer.files)},ge=o=>{t.disabled||le(o.currentTarget.files)},l=()=>{X(),I+=1,oe(),u.file=null,q({name:"",url:"",imgSrc:"",imgWidth:0,imgHeight:0}),y("remove");const o=document.getElementById(T);o&&(o.value=""),O()},a=o=>{const h=i.CommonBase.isEmpty(s.url)?s.imgSrc:s.url;Z(h,"image"),o.preventDefault(),o.stopPropagation()},r=o=>{i.CommonBase.isEmpty(s.url)||Z(s.url,"video"),o.preventDefault(),o.stopPropagation()},C=o=>{i.CommonBase.isEmpty(s.url)?v(s.imgSrc,s.name):g(s.url),o.preventDefault(),o.stopPropagation()},B=o=>{if(i.CommonBase.isString(s.url)&&s.url.startsWith("blob:")){const h=document.createElement("a");h.href=s.url,h.download=s.name,h.click()}else g(s.url);o.preventDefault(),o.stopPropagation()};return m({saveServerCallback:o=>{if(X(),c.runOperateType!=="load")return;if(!o||!o.res||!i.CommonBase.isBoolean(o.res.success)){y("fail"),E(["文件保存失败,请重试"]);return}if(!o.res.success){y("fail"),E(["文件保存失败,请重试"]);return}if(!o.req){y("fail"),E(["文件保存失败,请重试"]);return}let h="";if(i.CommonBase.isString(o.res.fileUrl)?h=o.res.fileUrl:i.CommonBase.isArray(o.res.fileUrl)&&o.res.fileUrl.length>0&&i.CommonBase.isString(o.res.fileUrl[0])&&(h=o.res.fileUrl[0]),i.CommonBase.isEmpty(h)){u.file=null,q({name:"",url:"",imgSrc:"",imgWidth:0,imgHeight:0}),y("init");return}ee(o.req,{fileUrl:h}),_(h)},getValue:()=>ie(),cleanReduction:()=>{X(),I+=1,oe(),u.file=null,q({name:"",url:"",imgSrc:"",imgWidth:0,imgHeight:0}),y("clean")}}),e.onBeforeUnmount(()=>{X(),oe()}),(o,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(S.value),ref_key:"refElTopParent",ref:w},[e.createElementVNode("div",{class:"fileUpload-default-container",onDrop:fe,onDragover:h[0]||(h[0]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("label",{for:T},[c.isInitFileInput&&!n.disabled?(e.openBlock(),e.createElementBlock("input",{key:0,type:"file",id:T,name:f.value,onChange:ge,accept:e.unref(A).mime.join(",")},null,40,Ce)):(e.openBlock(),e.createElementBlock("input",{key:1,id:T,name:f.value,style:{display:"none !important"}},null,8,be)),c.runOperateType==="init"?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(b.value)},[e.createVNode(P._sfc_main,{name:c.icon,class:"fileUpload-icon"},null,8,["name"]),e.createElementVNode("span",Ee,[e.renderSlot(o.$slots,"label")])],2)):c.runOperateType==="complete"?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(H.value)},[c.isImage?(e.openBlock(),e.createElementBlock("span",Fe,[e.createElementVNode("span",xe,[e.createElementVNode("img",{src:s.imgSrc,width:s.imgWidth,height:s.imgHeight},null,8,Ue)]),n.isShowCompleteMsg?(e.openBlock(),e.createElementBlock("span",Ie,e.toDisplayString(c.completeMsgTxt),1)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)),n.isShowPreview&&!n.disabled?(e.openBlock(),e.createElementBlock("i",{key:2,class:"preview-icon",title:e.unref(x).common.preview,onClick:e.withModifiers(a,["stop"])},[e.createVNode(P._sfc_main,{name:"search-plus"})],8,Me)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[],64)),n.isShowDownload&&!n.disabled?(e.openBlock(),e.createElementBlock("i",{key:4,class:"download-icon",title:e.unref(x).common.download,onClick:e.withModifiers(C,["stop"])},[e.createVNode(P._sfc_main,{name:"download"})],8,Te)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[],64))])):c.isVideo?(e.openBlock(),e.createElementBlock("span",_e,[e.createElementVNode("video",{src:s.url},null,8,Ne),n.isShowPreview&&!n.disabled?(e.openBlock(),e.createElementBlock("span",{key:0,class:"preview-icon",onClick:e.withModifiers(r,["stop"])},[e.createVNode(P._sfc_main,{name:"play"})])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)),n.isShowDownload&&!n.disabled?(e.openBlock(),e.createElementBlock("i",{key:2,class:"download-icon",title:e.unref(x).common.download,onClick:e.withModifiers(B,["stop"])},[e.createVNode(P._sfc_main,{name:"download"})],8,Re)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[],64))])):(e.openBlock(),e.createElementBlock("span",He,[e.createVNode(P._sfc_main,{name:c.icon,class:"fileUpload-icon"},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(s.name),1)])),n.disabled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[],64)):(e.openBlock(),e.createElementBlock("a",{key:3,class:"file-complete-remove",href:"javascript:",title:e.unref(x).common.delete,onClick:e.withModifiers(l,["stop"])},[e.createVNode(P._sfc_main,{name:"close"})],8,ze))],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[],64))])],32),c.runOperateType==="load"?(e.openBlock(),e.createElementBlock("div",We,[e.createVNode(Se._sfc_main,{theme:"circleBubble",size:"large"})])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))],2))}}),je=["id","name","multiple","accept"],Ve=["id","name","disabled","accept"],$e=["for"],Le={key:0,class:"fileUpload-list"},Pe={key:0,class:"fileUpload-item-icon fileUpload-item-img"},De=["src"],qe=["title","onClick"],Ae={key:1,class:"fileUpload-item-icon fileUpload-item-video"},Je=["src"],Ge=["onClick"],Ke={class:"fileUpload-item-name"},Ze={class:"fileUpload-item-operate"},Xe=["title","onClick"],Qe=["title","onClick"],Ye=e.defineComponent({name:"ClFileUploadButton",__name:"Button",props:{name:String,value:[String,Array,Object],className:String,disabled:{type:Boolean,default:!1},isMultiple:Boolean,buttonClass:String,buttonLabel:String,buttonIcon:{type:String,default:""},buttonColor:{type:String,default:"default"},checkFormat:String,checkMinSize:[String,Number],checkMaxSize:[String,Number],checkWidth:[String,Number],checkHeight:[String,Number],checkWHType:{type:String,default:"equal",validator:n=>["equal","greater","less"].includes(n)},isServerCallback:Boolean,isShowUploadResult:{type:Boolean,default:!0},isShowUploadIng:{type:Boolean,default:!0},isShowPreview:{type:Boolean,default:!0},isShowDownload:{type:Boolean,default:!0}},emits:["onChange","onError","onRemove","onPreview","onSaveFile"],setup(n,{expose:m,emit:p}){const t=n,k=p,x=`fileupload-${i.CommonBase.getRandom(5)}`,{optPageLanguage:U,getPageLanguage:$}=he.useLanguage();$("fileUpload");const R=e.inject("$FileuploadTop",null);R||console.warn("[FileUpload] Button 主题缺少 $FileuploadTop 注入,使用空校验配置");const W=()=>i.CommonBase.getJsonMerge(R?.getFileCheckInfo()??{},{checkFormat:t.checkFormat,checkWidth:t.checkWidth,checkHeight:t.checkHeight,checkWHType:t.checkWHType,checkMinSize:t.checkMinSize,checkMaxSize:t.checkMaxSize}),{setFileInfo:A}=ve(),{optBase:L,getTypeByUrl:D,checkFile:te,setBaseOptions:K}=ke(W(),U),{downloadBlob:d,downloadHref:g}=Be(),v=e.ref(null),w=e.ref(null),c=i.CommonBase.getRandom(8),s=e.reactive({elFileId:`btnFile${c}`,isInitFileInput:!0}),u=e.ref([]),I=e.ref([]);let F=null,T=null,f=null;const S=e.computed(()=>{let l=t.name;return i.CommonBase.isEmpty(l)&&(l=`fileUpload_${i.CommonBase.getRandom(8)}`),l}),b=e.computed(()=>{let l={"fileUpload-button":!0};return l=i.CommonBase.getJsonMerge(l,ue.CommonElement.getClassNameJson(t.className)),l}),H=(l,a)=>{k("onChange",l,a)},_=l=>{k("onError",l)},E=()=>{k("onRemove")},O=(l,a,r)=>{k("onPreview",l,a,r)},Z=(l,a)=>{k("onSaveFile",l,a)},j=()=>{V(),F=setTimeout(()=>{F=null,s.isInitFileInput||(y("fail"),_(["服务端保存超时,请重试"]))},6e4)},V=()=>{F&&(clearTimeout(F),F=null)},Y=()=>{u.value.forEach(l=>{i.CommonBase.isString(l.url)&&l.url.startsWith("blob:")&&URL.revokeObjectURL(l.url)})},y=l=>{switch(l){case"load":t.isShowUploadIng&&v.value?.loadStart();break;case"fail":case"complete":t.isShowUploadIng&&v.value?.loadStop();break}s.isInitFileInput=l!=="load"},q=(l,a)=>{t.isMultiple||(Y(),u.value=[]);const r=[],C=[];u.value.forEach(B=>{r.push(B),C.push(B.rId)});for(let B=0;B<l.length;B++){let N=a.length>B?{fileUrl:a[B]}:{};i.CommonBase.isEmpty(N.fileUrl)&&l[B].isVideo&&l[B].file&&(N={fileUrl:URL.createObjectURL(l[B].file)});let J=A(l[B],N);J.rId=i.CommonBase.getRandom(9),J=i.CommonBase.getJsonMerge(l[B],J),r.push(J),C.push(J.rId)}u.value=r,y("complete"),e.nextTick(()=>{I.value=C})},ee=()=>{const l=[];return u.value.forEach(a=>{let r=null;i.CommonBase.isString(a.url)&&a.url.startsWith("blob:")?r=a.file:i.CommonBase.isEmpty(a.url)?a.isImage&&!i.CommonBase.isEmpty(a.imgSrc)?r=a.imgSrc:r=a.file:r=a.url,i.CommonBase.isUndefined(r)||l.push(r)}),l.length===0?"":t.isMultiple?l:l[0]},ie=l=>{if(i.CommonBase.isArray(l)){Y(),u.value=[];const C=[],B=[];l.forEach(N=>{if(i.CommonBase.isNonEmptyString(N)){const J=D(N);C.push(J),B.push(N)}}),q(C,B);return}if(!i.CommonBase.isNonEmptyString(l)){i.CommonBase.isString(l)&&le();return}Y(),u.value=[];const a=[],r=[];l.split(",").filter(C=>i.CommonBase.isNonEmptyString(C)).forEach(C=>{const B=D(C);a.push(B),r.push(C)}),q(a,r)},le=()=>{Y(),y("init"),u.value=[]},ae=()=>{ie(t.value)};e.onMounted(()=>{e.nextTick(()=>{ae()})}),e.onBeforeUnmount(()=>{V(),T&&(clearTimeout(T),T=null),Y()}),e.watch(()=>t.value,(l,a)=>{if(l!==a){const r=ee();l!==r&&(V(),ie(l))}}),e.watch([()=>t.checkFormat,()=>t.checkWidth,()=>t.checkHeight,()=>t.checkWHType,()=>t.checkMinSize,()=>t.checkMaxSize],()=>{s.isInitFileInput&&V(),K(W())});const oe=l=>{t.disabled||s.isInitFileInput&&l.currentTarget.files.length>0&&(y("load"),te(l.currentTarget.files,{}).then(a=>{if(!s.isInitFileInput){if(a.passFiles.length>0)if(t.isServerCallback){const r=t.isMultiple?a.passFiles:a.passFiles[0],C=t.isMultiple?a.passFilesInfo:a.passFilesInfo[0];Z(r,C),j()}else t.isMultiple?(q(a.passFilesInfo,[]),H(a.passFiles,a.passFilesInfo)):(q(a.passFilesInfo,[]),H(a.passFiles[0],a.passFilesInfo[0]));else a.errorMsg.length===0&&(y("fail"),_(["文件校验失败,请重试"]));a.errorMsg.length>0&&(_(a.errorMsg),a.passFiles.length===0&&y("fail"))}}).catch(()=>{s.isInitFileInput||(y("fail"),_(["文件校验失败,请重试"]))}))},X=(l,a)=>{const r=i.CommonBase.isEmpty(l.url)?l.src:l.url;O(r,"image",a)},ce=(l,a)=>{i.CommonBase.isEmpty(l.url)||O(l.url,"video",a)},de=l=>{if(f===l)return;f=l,V(),s.isInitFileInput||y("complete");const a=u.value.find(N=>N.rId===l);a&&i.CommonBase.isString(a.url)&&a.url.startsWith("blob:")&&URL.revokeObjectURL(a.url);const r=[],C=[];u.value.forEach(N=>{N.rId!==l&&(r.push(N),C.push(N.rId))}),I.value=C;const B=document.getElementById(s.elFileId);B&&(B.value=""),e.nextTick(()=>{r.length>0?(u.value=r,f=null,E()):T=setTimeout(()=>{T=null,u.value=u.value.filter(N=>N.rId!==l),f=null,E()},500)})},se=l=>{if(l.isImage&&i.CommonBase.isEmpty(l.url))g(l.imgSrc,l.name);else if(i.CommonBase.isString(l.url)&&l.url.startsWith("blob:")){const a=document.createElement("a");a.href=l.url,a.download=l.name,a.click()}else if(i.CommonBase.isEmpty(l.url)&&l.file){const a=URL.createObjectURL(l.file),r=document.createElement("a");r.href=a,r.download=l.name,r.click(),setTimeout(()=>{URL.revokeObjectURL(a)},1e3)}else d(l.url)},re=()=>{w.value?.click()};return m({saveServerCallback:l=>{if(V(),!s.isInitFileInput){if(i.CommonBase.isUndefined(l)||i.CommonBase.isUndefined(l.res)||!i.CommonBase.isBoolean(l.res.success)||i.CommonBase.isUndefined(l.req)){y("fail"),_(["文件保存失败,请重试"]);return}if(l.res.success){let a=[];const r=[];if(i.CommonBase.isNonEmptyString(l.res.fileUrl)?(a.push(l.res.fileUrl),r.push(0)):i.CommonBase.isArray(l.res.fileUrl)&&l.res.fileUrl.forEach((ne,o)=>{i.CommonBase.isNonEmptyString(ne)&&(a.push(ne),r.push(o))}),a.length===0){y("complete");return}const C=t.isMultiple?l.req:[l.req];let B=[],N=[];if(!t.isMultiple)B=a,N=C;else{const ne=u.value.map(o=>o.url).filter(o=>i.CommonBase.isNonEmptyString(o));a.forEach((o,h)=>{const M=r[h];ne.indexOf(o)>-1||i.CommonBase.isUndefined(C[M])||(ne.push(o),B.push(o),N.push(C[M]))})}if(B.length===0){y("complete");return}q(N,B);const J=t.isMultiple?B:B[0];H(J)}else y("fail"),_(["文件保存失败,请重试"])}},getValue:()=>ee(),cleanReduction:()=>{V(),le()}}),(l,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(b.value)},[s.isInitFileInput&&!n.disabled?(e.openBlock(),e.createElementBlock("input",{key:0,type:"file",id:s.elFileId,name:S.value,multiple:n.isMultiple,accept:e.unref(L).mime.join(","),onChange:oe},null,40,je)):(e.openBlock(),e.createElementBlock("input",{key:1,id:s.elFileId,name:S.value,disabled:n.disabled,accept:e.unref(L).mime.join(","),style:{display:"none !important"},onChange:oe},null,40,Ve)),e.createElementVNode("label",{ref_key:"refElLabel",ref:w,for:s.elFileId},[e.createVNode(ye._sfc_main,{ref_key:"refElButton",ref:v,className:n.buttonClass,isShowBackDrop:!0,disabled:n.disabled,label:n.buttonLabel||e.unref(U).common.upload,icon:n.buttonIcon,color:n.buttonColor,onOnClick:re},null,8,["className","disabled","label","icon","color"])],8,$e)],2),e.renderSlot(l.$slots,"label"),u.value.length>0&&n.isShowUploadResult?(e.openBlock(),e.createElementBlock("ul",Le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(r,C)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fileUploadButton","enter-active-class":"fileupload-anim-in","leave-active-class":"fileupload-anim-out"},{default:e.withCtx(()=>[I.value.indexOf(r.rId)>-1?(e.openBlock(),e.createElementBlock("li",{key:`${x}-${r.rId}-${C}`,class:"fileUpload-item"},[r.isImage?(e.openBlock(),e.createElementBlock("span",Pe,[e.createElementVNode("img",{src:r.imgSrc},null,8,De),n.isShowPreview?(e.openBlock(),e.createElementBlock("i",{key:0,class:"preview-icon",title:e.unref(U).common.preview,onClick:e.withModifiers(B=>X(r,C),["stop"])},[e.createVNode(P._sfc_main,{name:"search-plus"})],8,qe)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))])):r.isVideo?(e.openBlock(),e.createElementBlock("span",Ae,[e.createElementVNode("video",{src:r.url},null,8,Je),n.isShowPreview?(e.openBlock(),e.createElementBlock("span",{key:0,class:"preview-icon",onClick:e.withModifiers(B=>ce(r,C),["stop"])},[e.createVNode(P._sfc_main,{name:"play"})],8,Ge)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))])):(e.openBlock(),e.createBlock(P._sfc_main,{key:2,name:r.icon,class:"fileUpload-item-icon"},null,8,["name"])),e.createElementVNode("span",Ke,e.toDisplayString(r.name),1),e.createElementVNode("span",Ze,[n.isShowDownload?(e.openBlock(),e.createElementBlock("i",{key:0,class:"download-icon",title:e.unref(U).common.download,onClick:e.withModifiers(B=>se(r),["stop"])},[e.createVNode(P._sfc_main,{name:"download"})],8,Xe)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64)),n.disabled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[],64)):(e.openBlock(),e.createElementBlock("a",{key:2,class:"file-complete-remove",href:"javascript:",title:e.unref(U).common.delete,onClick:e.withModifiers(B=>de(r.rId),["stop"])},[e.createVNode(P._sfc_main,{name:"close"})],8,Qe))])])):e.createCommentVNode("",!0)]),_:2},1024))),256))])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))],64))}}),et=["id"],tt=e.defineComponent({name:"ClFileUpload",__name:"Index",props:{id:String,name:String,value:[String,Array,Object],className:String,disabled:{type:Boolean,default:!1},theme:{type:String,default:"default",validator:n=>["default","button"].includes(n)},isMultiple:{type:Boolean,default:!1},defaultHoverTitle:String,defaultIcon:String,isShowCompleteMsg:{type:Boolean,default:!0},buttonClass:String,buttonLabel:String,buttonIcon:String,buttonColor:String,checkFormat:String,checkMinSize:[String,Number],checkMaxSize:[String,Number],checkWidth:[String,Number],checkHeight:[String,Number],checkWHType:{type:String,default:"equal"},isShowPreview:{type:Boolean,default:!0},isShowDownload:{type:Boolean,default:!0},isShowUploadResult:{type:Boolean,default:!0},isShowUploadIng:{type:Boolean,default:!0},serverFileCallback:Function},emits:["update:value","onChange","onRemove","onError"],setup(n,{expose:m,emit:p}){const t=n,k=p,x=e.inject("$ClGlobals",null),U=e.useAttrs(),$=t.id,R=e.ref(null),W=e.ref(null);let A=0,L=0;const D=e.computed(()=>i.CommonBase.isFunction(t.serverFileCallback)),te=e.computed(()=>{let f={"panel-fileupload":!0,"box-width":!0};return f=i.CommonBase.getJsonMerge(f,ue.CommonElement.getClassNameJson(t.className)),f}),K=(f,S,b)=>{k("update:value",f),k("onChange",S,b)},d=()=>{k("onRemove")},g=()=>{let f=null;switch(t.theme){case"default":f=R.value?.getValue();break;case"button":f=W.value?.getValue();break}return f},v=(f,S)=>{switch(f){case"default":R.value?.saveServerCallback(S);break;case"button":W.value?.saveServerCallback(S);break}},w=(f,S)=>{const b=g(),H=D.value?b:f;K(b,H,S)},c=f=>{i.CommonBase.isArray(f)&&(k("onError",f),x&&f.forEach(S=>x.notify.error(S)))},s=()=>{L+=1,d();const f=g();K(f,f)},u=async(f,S,b)=>{x&&await x.preview.show({type:S,src:f,showIndex:b??0})},I=async(f,S)=>{const b=t.theme,H=++A,_=L;let E=!0;if(t.serverFileCallback)try{const Z=!t.isMultiple&&i.CommonBase.isObject(S)&&i.CommonBase.isBoolean(S.isImage)?S.isImage:!1,j=ue.CommonElement.getElementData(U);E=await t.serverFileCallback(f,Z,j)}catch{H===A&&L===_&&t.theme===b&&v(b,{req:S,res:{success:!1}});return}let O={};if(i.CommonBase.isBoolean(E)?O.success=E:i.CommonBase.isUndefined(E)?O.success=!0:i.CommonBase.isString(E)||i.CommonBase.isArray(E)?(O.success=!0,O.fileUrl=E):i.CommonBase.isObject(E)?O=E:O.success=!1,t.theme!==b){k("onError",["保存期间主题已切换,本次保存结果未写入"]);return}H!==A||L!==_||v(b,{req:S,res:O})};return e.provide("$FileuploadTop",e.reactive({getFileCheckInfo:()=>({checkFormat:t.checkFormat,checkWidth:t.checkWidth,checkHeight:t.checkHeight,checkWHType:t.checkWHType,checkMinSize:t.checkMinSize,checkMaxSize:t.checkMaxSize})})),m({getValue:()=>g(),cleanReduction:()=>{switch(t.theme){case"default":R.value?.cleanReduction();break;case"button":W.value?.cleanReduction();break}K("","")}}),(f,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(te.value),id:e.unref($)},[n.theme==="button"?(e.openBlock(),e.createBlock(Ye,{key:0,ref_key:"refElFileButton",ref:W,value:n.value,name:n.name,disabled:n.disabled,isMultiple:n.isMultiple,buttonClass:n.buttonClass,buttonLabel:n.buttonLabel,buttonIcon:n.buttonIcon,buttonColor:n.buttonColor,checkFormat:n.checkFormat,checkMinSize:n.checkMinSize,checkMaxSize:n.checkMaxSize,checkWidth:n.checkWidth,checkHeight:n.checkHeight,checkWHType:n.checkWHType,isServerCallback:D.value,isShowUploadResult:n.isShowUploadResult,isShowUploadIng:n.isShowUploadIng,isShowPreview:n.isShowPreview,isShowDownload:n.isShowDownload,onOnChange:w,onOnError:c,onOnRemove:s,onOnPreview:u,onOnSaveFile:I},{label:e.withCtx(()=>[e.renderSlot(f.$slots,"label")]),_:3},8,["value","name","disabled","isMultiple","buttonClass","buttonLabel","buttonIcon","buttonColor","checkFormat","checkMinSize","checkMaxSize","checkWidth","checkHeight","checkWHType","isServerCallback","isShowUploadResult","isShowUploadIng","isShowPreview","isShowDownload"])):n.theme==="default"?(e.openBlock(),e.createBlock(Oe,{key:1,ref_key:"refElFileDefault",ref:R,value:n.value,name:n.name,disabled:n.disabled,defaultHoverTitle:n.defaultHoverTitle,defaultIcon:n.defaultIcon,isShowCompleteMsg:n.isShowCompleteMsg,checkFormat:n.checkFormat,checkMinSize:n.checkMinSize,checkMaxSize:n.checkMaxSize,checkWidth:n.checkWidth,checkHeight:n.checkHeight,checkWHType:n.checkWHType,isServerCallback:D.value,isShowPreview:n.isShowPreview,isShowDownload:n.isShowDownload,onOnChange:w,onOnError:c,onOnRemove:s,onOnPreview:u,onOnSaveFile:I},{label:e.withCtx(()=>[e.renderSlot(f.$slots,"label")]),_:3},8,["value","name","disabled","defaultHoverTitle","defaultIcon","isShowCompleteMsg","checkFormat","checkMinSize","checkMaxSize","checkWidth","checkHeight","checkWHType","isServerCallback","isShowPreview","isShowDownload"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[],64))],10,et))}});exports._sfc_main=tt;
|
|
2
|
-
//# sourceMappingURL=Index.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
//# sourceMappingURL=Index.vue_vue_type_script_setup_true_lang-BDPkmgGP.js.map
|