@vunk/form 1.1.76 → 1.1.79
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/components/_plugin-vue_export-helper.mjs +9 -0
- package/components/button/{index.js → index.mjs} +33 -29
- package/components/button/src/ctx.d.ts +30 -30
- package/components/button/src/index.vue.d.ts +69 -69
- package/components/cascader/index.css +0 -2
- package/components/cascader/{index.js → index.mjs} +22 -22
- package/components/cascader/src/ctx.d.ts +37 -45
- package/components/cascader/src/index.vue.d.ts +92 -92
- package/components/cascader/src/use.d.ts +1 -1
- package/components/checkbox/index.css +0 -9
- package/components/checkbox/{index.js → index.mjs} +45 -42
- package/components/checkbox/src/ctx.d.ts +29 -32
- package/components/checkbox/src/index.vue.d.ts +65 -65
- package/components/color-picker/{index.js → index.mjs} +24 -23
- package/components/color-picker/src/ctx.d.ts +29 -29
- package/components/color-picker/src/index.vue.d.ts +77 -64
- package/components/date-picker/{index.js → index.mjs} +28 -25
- package/components/date-picker/src/ctx.d.ts +49 -49
- package/components/date-picker/src/index.vue.d.ts +104 -104
- package/components/download-plus/index.css +0 -6
- package/components/download-plus/{index.js → index.mjs} +119 -147
- package/components/download-plus/src/api.d.ts +1 -1
- package/components/download-plus/src/ctx.d.ts +27 -26
- package/components/download-plus/src/index.vue.d.ts +59 -59
- package/components/esri-input-geojson/index.css +0 -10
- package/components/esri-input-geojson/index.mjs +1109 -0
- package/components/esri-input-geojson/src/append.vue.d.ts +1 -1
- package/components/esri-input-geojson/src/ctx.d.ts +49 -72
- package/components/esri-input-geojson/src/index.vue.d.ts +138 -158
- package/components/esri-input-geojson/src/types.d.ts +0 -1
- package/components/esri-input-geojson/src/viewer.vue.d.ts +18 -19
- package/components/form/{index.js → index.mjs} +31 -27
- package/components/form/src/ctx.d.ts +13 -297
- package/components/form/src/index.vue.d.ts +97 -659
- package/components/form-item/index.css +0 -8
- package/components/form-item/{index.js → index.mjs} +22 -19
- package/components/form-item/src/ctx.d.ts +13 -11
- package/components/form-item/src/index.vue.d.ts +20 -20
- package/components/form-item-renderer/{index.js → index.mjs} +9 -7
- package/components/form-item-renderer/src/index.vue.d.ts +1 -1
- package/components/form-item-renderer-template/{index.js → index.mjs} +7 -7
- package/components/geoinput/{index.js → index.mjs} +10 -17
- package/components/geoinput/src/ctx.d.ts +48 -60
- package/components/geoinput/src/index.vue.d.ts +114 -132
- package/components/geoinput-read/index.css +0 -2
- package/components/geoinput-read/{index.js → index.mjs} +101 -109
- package/components/geoinput-read/src/core.vue.d.ts +123 -142
- package/components/geoinput-read/src/ctx.d.ts +50 -74
- package/components/geoinput-read/src/index.vue.d.ts +102 -120
- package/components/geoinput-update/index.css +0 -6
- package/components/geoinput-update/index.mjs +399 -0
- package/components/geoinput-update/src/ctx.d.ts +49 -69
- package/components/geoinput-update/src/index.vue.d.ts +126 -141
- package/components/index.mjs +11 -0
- package/components/index2.mjs +306 -0
- package/components/index3.mjs +484 -0
- package/components/input/{index.js → index.mjs} +31 -27
- package/components/input/src/ctx.d.ts +47 -66
- package/components/input/src/index.vue.d.ts +101 -113
- package/components/input-link/index.css +0 -2
- package/components/input-link/index.mjs +151 -0
- package/components/input-link/src/ctx.d.ts +40 -56
- package/components/input-link/src/index.vue.d.ts +89 -101
- package/components/input-number/index.css +0 -2
- package/components/input-number/{index.js → index.mjs} +25 -25
- package/components/input-number/src/ctx.d.ts +31 -37
- package/components/input-number/src/index.vue.d.ts +71 -71
- package/components/radio/index.css +0 -6
- package/components/radio/{index.js → index.mjs} +50 -47
- package/components/radio/src/ctx.d.ts +29 -29
- package/components/radio/src/index.vue.d.ts +64 -64
- package/components/select/index.css +0 -2
- package/components/select/{index.js → index.mjs} +49 -48
- package/components/select/src/ctx.d.ts +31 -85
- package/components/select/src/index.vue.d.ts +121 -230
- package/components/slider/{index.js → index.mjs} +28 -24
- package/components/slider/src/ctx.d.ts +35 -35
- package/components/slider/src/index.vue.d.ts +93 -93
- package/components/switch/index.css +0 -2
- package/components/switch/{index.js → index.mjs} +29 -24
- package/components/switch/src/ctx.d.ts +40 -40
- package/components/switch/src/index.vue.d.ts +91 -91
- package/components/templates-default/index.mjs +302 -0
- package/components/templates-default/src/ctx.d.ts +2 -4
- package/components/templates-default/src/index.vue.d.ts +2 -8
- package/components/templates-element-plus/index.mjs +106 -0
- package/components/templates-esri/index.mjs +59 -0
- package/components/templates-layout/index.css +0 -3
- package/components/templates-layout/index.mjs +131 -0
- package/components/templates-mapbox/index.mjs +59 -0
- package/components/upload/index.css +0 -7
- package/components/upload/index.mjs +501 -0
- package/components/upload/src/ctx.d.ts +36 -38
- package/components/upload/src/file.vue.d.ts +22 -21
- package/components/upload/src/index.vue.d.ts +78 -78
- package/components/upload-plus/index.css +4 -8
- package/components/upload-plus/{index.js → index.mjs} +9497 -926
- package/components/upload-plus/src/api.d.ts +1 -1
- package/components/upload-plus/src/ctx.d.ts +25 -28
- package/components/upload-plus/src/index.vue.d.ts +58 -58
- package/components/van-cascader/index.css +0 -2
- package/components/van-cascader/{index.js → index.mjs} +41 -44
- package/components/van-cascader/src/ctx.d.ts +35 -35
- package/components/van-cascader/src/index.vue.d.ts +82 -82
- package/components/var-datetime-picker/index.css +0 -2
- package/components/var-datetime-picker/index.mjs +324 -0
- package/components/var-datetime-picker/src/ctx.d.ts +27 -26
- package/components/var-datetime-picker/src/index.vue.d.ts +57 -57
- package/components/vditor/{index.js → index.mjs} +9 -14
- package/components/vditor/src/ctx.d.ts +2 -1
- package/components/vditor/src/index.vue.d.ts +2 -3
- package/composables/index.mjs +85 -0
- package/composables/useSourceManager.d.ts +2 -2
- package/defaults.d.ts +1 -1
- package/index.css +4 -169
- package/index.d.ts +1 -1
- package/index.esm.js +44 -1
- package/package.json +246 -2
- package/shared/const/index.d.ts +1 -1
- package/shared/const/index.mjs +56 -0
- package/shared/element-plus/ctx.d.ts +26 -94
- package/shared/element-plus/index.mjs +285 -0
- package/shared/element-plus/instances.d.ts +29 -28
- package/shared/form/index.mjs +30 -0
- package/shared/helper/index.mjs +9 -0
- package/shared/index.mjs +1 -0
- package/shared/infer-prop/index.mjs +34 -0
- package/shared/progress-it/index.mjs +38 -0
- package/shared/rules/index.mjs +53 -0
- package/shared/upload/index.mjs +771 -0
- package/components/button/src/ctx.js +0 -1
- package/components/cascader/src/ctx.js +0 -1
- package/components/cascader/src/types.js +0 -1
- package/components/cascader/src/use.js +0 -1
- package/components/checkbox/src/ctx.js +0 -1
- package/components/checkbox/src/index.css +0 -1
- package/components/checkbox/src/types.js +0 -1
- package/components/color-picker/index.css +0 -1
- package/components/color-picker/src/ctx.js +0 -1
- package/components/color-picker/src/index.css +0 -1
- package/components/color-picker/src/types.js +0 -1
- package/components/date-picker/index.css +0 -1
- package/components/date-picker/src/ctx.js +0 -1
- package/components/date-picker/src/index.css +0 -1
- package/components/date-picker/src/types.js +0 -1
- package/components/download-plus/src/api.js +0 -1
- package/components/download-plus/src/const.js +0 -1
- package/components/download-plus/src/ctx.js +0 -1
- package/components/download-plus/src/index.css +0 -1
- package/components/download-plus/src/types.js +0 -1
- package/components/esri-input-geojson/index.js +0 -1563
- package/components/esri-input-geojson/src/const.js +0 -1
- package/components/esri-input-geojson/src/ctx.js +0 -1
- package/components/esri-input-geojson/src/index.css +0 -1
- package/components/esri-input-geojson/src/types.js +0 -1
- package/components/form/index.css +0 -1
- package/components/form/src/ctx.js +0 -1
- package/components/form/src/index.css +0 -1
- package/components/form/src/types.js +0 -1
- package/components/form/src/utils.js +0 -1
- package/components/form-item/src/ctx.js +0 -1
- package/components/form-item/src/index.css +0 -1
- package/components/form-item/src/types.js +0 -1
- package/components/form-item-renderer/index.css +0 -1
- package/components/form-item-renderer/src/ctx.js +0 -1
- package/components/form-item-renderer/src/index.css +0 -1
- package/components/form-item-renderer/src/symbols.js +0 -1
- package/components/form-item-renderer/src/types.js +0 -1
- package/components/form-item-renderer-template/index.css +0 -1
- package/components/form-item-renderer-template/src/ctx.js +0 -1
- package/components/form-item-renderer-template/src/index.css +0 -1
- package/components/form-item-renderer-template/src/types.js +0 -1
- package/components/geoinput/index.css +0 -1
- package/components/geoinput/src/ctx.js +0 -1
- package/components/geoinput/src/index.css +0 -1
- package/components/geoinput/src/types.js +0 -1
- package/components/geoinput-read/src/ctx.js +0 -1
- package/components/geoinput-read/src/index.css +0 -1
- package/components/geoinput-read/src/types.js +0 -1
- package/components/geoinput-update/index.js +0 -930
- package/components/geoinput-update/src/ctx.js +0 -1
- package/components/geoinput-update/src/index.css +0 -1
- package/components/geoinput-update/src/types.js +0 -1
- package/components/input/index.css +0 -1
- package/components/input/src/ctx.js +0 -1
- package/components/input/src/index.css +0 -1
- package/components/input/src/types.js +0 -1
- package/components/input-link/index.js +0 -163
- package/components/input-link/src/ctx.js +0 -1
- package/components/input-link/src/index.css +0 -1
- package/components/input-link/src/types.js +0 -1
- package/components/input-number/src/ctx.js +0 -1
- package/components/input-number/src/index.css +0 -1
- package/components/input-number/src/types.js +0 -1
- package/components/radio/src/ctx.js +0 -1
- package/components/radio/src/index.css +0 -1
- package/components/radio/src/types.js +0 -1
- package/components/select/src/ctx.js +0 -1
- package/components/select/src/index.css +0 -1
- package/components/select/src/types.js +0 -1
- package/components/slider/index.css +0 -1
- package/components/slider/src/ctx.js +0 -1
- package/components/slider/src/index.css +0 -1
- package/components/slider/src/types.js +0 -1
- package/components/switch/src/ctx.js +0 -1
- package/components/switch/src/index.css +0 -1
- package/components/switch/src/types.js +0 -1
- package/components/templates-default/index.css +0 -1
- package/components/templates-default/index.js +0 -347
- package/components/templates-default/src/ctx.js +0 -1
- package/components/templates-default/src/index.css +0 -1
- package/components/templates-default/src/types.js +0 -1
- package/components/templates-element-plus/index.css +0 -1
- package/components/templates-element-plus/index.js +0 -110
- package/components/templates-element-plus/src/ctx.js +0 -1
- package/components/templates-element-plus/src/index.css +0 -1
- package/components/templates-element-plus/src/types.js +0 -1
- package/components/templates-esri/index.css +0 -1
- package/components/templates-esri/index.js +0 -65
- package/components/templates-esri/src/ctx.js +0 -1
- package/components/templates-esri/src/index.css +0 -1
- package/components/templates-esri/src/types.js +0 -1
- package/components/templates-layout/index.js +0 -141
- package/components/templates-layout/src/ctx.js +0 -1
- package/components/templates-layout/src/index.css +0 -1
- package/components/templates-layout/src/types.js +0 -1
- package/components/templates-mapbox/index.css +0 -1
- package/components/templates-mapbox/index.js +0 -65
- package/components/templates-mapbox/src/ctx.js +0 -1
- package/components/templates-mapbox/src/index.css +0 -1
- package/components/templates-mapbox/src/types.js +0 -1
- package/components/upload/index.js +0 -565
- package/components/upload/src/ctx.js +0 -1
- package/components/upload/src/index.css +0 -1
- package/components/upload/src/types.js +0 -1
- package/components/upload-plus/src/api.js +0 -28
- package/components/upload-plus/src/const.js +0 -1
- package/components/upload-plus/src/ctx.js +0 -1
- package/components/upload-plus/src/index.css +0 -1
- package/components/upload-plus/src/types.js +0 -1
- package/components/van-cascader/src/ctx.js +0 -1
- package/components/van-cascader/src/index.css +0 -1
- package/components/van-cascader/src/types.js +0 -1
- package/components/var-datetime-picker/index.js +0 -299
- package/components/var-datetime-picker/src/const.js +0 -1
- package/components/var-datetime-picker/src/ctx.js +0 -1
- package/components/var-datetime-picker/src/index.css +0 -1
- package/components/var-datetime-picker/src/types.js +0 -1
- package/components/vditor/index.css +0 -1
- package/components/vditor/src/ctx.js +0 -1
- package/components/vditor/src/index.css +0 -1
- package/components/vditor/src/types.js +0 -1
- package/composables/index.css +0 -1
- package/composables/index.js +0 -1
- package/shared/const/index.css +0 -1
- package/shared/const/index.js +0 -1
- package/shared/element-plus/index.css +0 -1
- package/shared/element-plus/index.js +0 -1
- package/shared/form/index.css +0 -1
- package/shared/form/index.js +0 -1
- package/shared/helper/index.css +0 -1
- package/shared/helper/index.js +0 -1
- package/shared/index.css +0 -1
- package/shared/index.js +0 -1
- package/shared/infer-prop/index.css +0 -1
- package/shared/infer-prop/index.js +0 -1
- package/shared/progress-it/index.css +0 -1
- package/shared/progress-it/index.js +0 -1
- package/shared/rules/index.css +0 -1
- package/shared/rules/index.js +0 -1
- package/shared/types/form/index.css +0 -1
- package/shared/types/form/index.js +0 -1
- package/shared/types/index.css +0 -1
- package/shared/types/index.js +0 -1
- package/shared/types/source/index.css +0 -1
- package/shared/types/source/index.js +0 -1
- package/shared/types/source-manager/index.css +0 -1
- package/shared/types/source-manager/index.js +0 -1
- package/shared/upload/index.css +0 -1
- package/shared/upload/index.js +0 -1
- /package/{components/button/index.css → shared/types/form/index.mjs} +0 -0
- /package/{components/button/src/index.css → shared/types/index.mjs} +0 -0
- /package/{components/cascader/src/index.css → shared/types/source/index.mjs} +0 -0
- /package/{components/button/src/types.js → shared/types/source-manager/index.mjs} +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, mergeProps, createCommentVNode } from 'vue';
|
|
2
|
+
import { VkfGeoinput } from '@vunk/form/components/geoinput';
|
|
3
|
+
import { VkfFormItemRendererTemplate } from '@vunk/form/components/form-item-renderer-template';
|
|
4
|
+
import { getValue } from '@vunk/core';
|
|
5
|
+
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
6
|
+
|
|
7
|
+
const props = {
|
|
8
|
+
data: {
|
|
9
|
+
type: Object,
|
|
10
|
+
default: () => ({})
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const emits = {
|
|
14
|
+
setData: (data) => data
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var _sfc_main = defineComponent({
|
|
18
|
+
name: "VkfTemplatesMapbox",
|
|
19
|
+
components: {
|
|
20
|
+
VkfGeoinput,
|
|
21
|
+
VkfFormItemRendererTemplate
|
|
22
|
+
},
|
|
23
|
+
emits,
|
|
24
|
+
props,
|
|
25
|
+
setup() {
|
|
26
|
+
return {
|
|
27
|
+
getValue
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
33
|
+
const _component_VkfGeoinput = resolveComponent("VkfGeoinput");
|
|
34
|
+
const _component_VkfFormItemRendererTemplate = resolveComponent("VkfFormItemRendererTemplate");
|
|
35
|
+
return openBlock(), createBlock(_component_VkfFormItemRendererTemplate, { type: "VkfGeoinput" }, {
|
|
36
|
+
default: withCtx(({ data: props, templateIf }) => [
|
|
37
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfGeoinput, mergeProps({ key: 0 }, props, {
|
|
38
|
+
"model-value": _ctx.getValue(_ctx.data, props.prop),
|
|
39
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
40
|
+
k: props.prop,
|
|
41
|
+
v: $event
|
|
42
|
+
})
|
|
43
|
+
}), null, 16, ["model-value", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
44
|
+
]),
|
|
45
|
+
_: 1
|
|
46
|
+
/* STABLE */
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
var VkfTemplatesMapbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\templates-mapbox\\src\\index.vue"]]);
|
|
50
|
+
|
|
51
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
52
|
+
__proto__: null
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
VkfTemplatesMapbox.install = (app) => {
|
|
56
|
+
app.component(VkfTemplatesMapbox.name, VkfTemplatesMapbox);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export { VkfTemplatesMapbox, types as __VkfTemplatesMapbox, VkfTemplatesMapbox as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
.el-upload-list__item-status-label{
|
|
3
2
|
z-index: 1;
|
|
4
3
|
}
|
|
@@ -8,8 +7,6 @@
|
|
|
8
7
|
.el-upload-list__item-name .el-icon.el-icon--download-primary{
|
|
9
8
|
color: var(--el-color-primary);
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
10
|
.vkf-upload {
|
|
14
11
|
width: 100%;
|
|
15
12
|
}
|
|
@@ -19,7 +16,6 @@
|
|
|
19
16
|
.vkf-upload-empty-tip.is-readonly.is-empty{
|
|
20
17
|
display: block;
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
.vkf-upload.is-readonly .el-upload,
|
|
24
20
|
.vkf-upload.is-readonly .el-upload{
|
|
25
21
|
display: none;
|
|
@@ -30,9 +26,6 @@
|
|
|
30
26
|
.vkf-upload .el-upload-list{
|
|
31
27
|
min-width: 100px;
|
|
32
28
|
}
|
|
33
|
-
|
|
34
29
|
.vkf-upload.is-limit .el-upload{
|
|
35
30
|
display: none;
|
|
36
31
|
}
|
|
37
|
-
|
|
38
|
-
|
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
|
|
2
|
+
import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
|
|
3
|
+
import { uploadProps, ElProgress, ElIcon, useNamespace, useLocale, ElUpload, ElLink } from 'element-plus';
|
|
4
|
+
import { defineComponent, resolveComponent, openBlock, createElementBlock, Fragment, createCommentVNode, normalizeClass, createBlock, createElementVNode, withModifiers, createVNode, withCtx, toDisplayString, normalizeStyle, shallowRef, normalizeProps, guardReactiveProps, mergeProps, createSlots, renderSlot, createTextVNode } from 'vue';
|
|
5
|
+
import { pickObject } from '@vunk/core/shared/utils-object';
|
|
6
|
+
import { createUploadBindProps } from '@vunk/form/shared/element-plus';
|
|
7
|
+
import { f as check_default, z as zoom_in_default, g as delete_default, h as close_default, i as circle_check_default, j as document_default, d as download_default } from '../index2.mjs';
|
|
8
|
+
import { NOOP } from '@vunk/core/shared/utils-function';
|
|
9
|
+
import { RestFetch } from '@vunk/core/shared/utils-fetch';
|
|
10
|
+
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
11
|
+
import { useComputedReadonly } from '@vunk/form/composables';
|
|
12
|
+
import progress from '@vunk/form/shared/progress-it';
|
|
13
|
+
|
|
14
|
+
const props = {
|
|
15
|
+
..._VkfFormItemCtx.props,
|
|
16
|
+
...uploadProps,
|
|
17
|
+
tip: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
preview: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
beforeUpload: {
|
|
26
|
+
type: Function,
|
|
27
|
+
default: void 0
|
|
28
|
+
},
|
|
29
|
+
onDownload: {
|
|
30
|
+
type: Function,
|
|
31
|
+
default: void 0
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const createBindProps = bindPropsFactory(props);
|
|
35
|
+
const emits = {
|
|
36
|
+
"update:fileList": null,
|
|
37
|
+
"remove": (e) => e
|
|
38
|
+
};
|
|
39
|
+
const createOnEmits = onEmitsFactory(emits);
|
|
40
|
+
|
|
41
|
+
var ctx = /*#__PURE__*/Object.freeze({
|
|
42
|
+
__proto__: null,
|
|
43
|
+
createBindProps: createBindProps,
|
|
44
|
+
createOnEmits: createOnEmits,
|
|
45
|
+
emits: emits,
|
|
46
|
+
props: props
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const restFetch = new RestFetch({
|
|
50
|
+
baseURL: ""
|
|
51
|
+
});
|
|
52
|
+
var _sfc_main$1 = defineComponent({
|
|
53
|
+
components: {
|
|
54
|
+
ElProgress,
|
|
55
|
+
ElIcon,
|
|
56
|
+
Check: check_default,
|
|
57
|
+
ZoomIn: zoom_in_default,
|
|
58
|
+
Delete: delete_default,
|
|
59
|
+
Close: close_default,
|
|
60
|
+
CircleCheck: circle_check_default,
|
|
61
|
+
Document: document_default,
|
|
62
|
+
Download: download_default
|
|
63
|
+
},
|
|
64
|
+
props: {
|
|
65
|
+
listType: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: "text"
|
|
68
|
+
},
|
|
69
|
+
file: {
|
|
70
|
+
type: Object,
|
|
71
|
+
default: () => ({})
|
|
72
|
+
},
|
|
73
|
+
disabled: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false
|
|
76
|
+
},
|
|
77
|
+
onPreview: {
|
|
78
|
+
type: Function,
|
|
79
|
+
default: () => NOOP
|
|
80
|
+
},
|
|
81
|
+
onDownload: {
|
|
82
|
+
type: Function,
|
|
83
|
+
default: void 0
|
|
84
|
+
},
|
|
85
|
+
preview: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: false
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
emits: {
|
|
91
|
+
"remove": (e) => e
|
|
92
|
+
},
|
|
93
|
+
setup(props, { emit }) {
|
|
94
|
+
const nsUpload = useNamespace("upload");
|
|
95
|
+
const nsIcon = useNamespace("icon");
|
|
96
|
+
const { t } = useLocale();
|
|
97
|
+
const handleRemove = (file = props.file) => {
|
|
98
|
+
emit("remove", file);
|
|
99
|
+
};
|
|
100
|
+
const handleDownload = (file = props.file) => {
|
|
101
|
+
if (props.onDownload) {
|
|
102
|
+
props.onDownload(file);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
let url = "";
|
|
106
|
+
if (file.url) {
|
|
107
|
+
url = file.url;
|
|
108
|
+
} else if (file.raw) {
|
|
109
|
+
url = window.URL.createObjectURL(file.raw);
|
|
110
|
+
}
|
|
111
|
+
url && restFetch.download({
|
|
112
|
+
url,
|
|
113
|
+
fileName: file.name
|
|
114
|
+
}, {
|
|
115
|
+
method: "GET"
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
return {
|
|
119
|
+
handleRemove,
|
|
120
|
+
t,
|
|
121
|
+
nsIcon,
|
|
122
|
+
nsUpload,
|
|
123
|
+
handleDownload
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
const _hoisted_1$1 = ["src"];
|
|
129
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
130
|
+
const _component_Document = resolveComponent("Document");
|
|
131
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
132
|
+
const _component_Download = resolveComponent("Download");
|
|
133
|
+
const _component_el_progress = resolveComponent("el-progress");
|
|
134
|
+
const _component_circle_check = resolveComponent("circle-check");
|
|
135
|
+
const _component_Check = resolveComponent("Check");
|
|
136
|
+
const _component_Close = resolveComponent("Close");
|
|
137
|
+
const _component_zoom_in = resolveComponent("zoom-in");
|
|
138
|
+
const _component_Delete = resolveComponent("Delete");
|
|
139
|
+
return openBlock(), createElementBlock(
|
|
140
|
+
Fragment,
|
|
141
|
+
null,
|
|
142
|
+
[
|
|
143
|
+
createCommentVNode(" picture "),
|
|
144
|
+
_ctx.listType === "picture" || _ctx.file.status !== "uploading" && _ctx.listType === "picture-card" ? (openBlock(), createElementBlock(
|
|
145
|
+
Fragment,
|
|
146
|
+
{ key: 0 },
|
|
147
|
+
[
|
|
148
|
+
/\.(svg|png|jpg|jpeg)$/.test(_ctx.file.name) ? (openBlock(), createElementBlock("img", {
|
|
149
|
+
key: 0,
|
|
150
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-thumbnail")),
|
|
151
|
+
src: _ctx.file.url,
|
|
152
|
+
alt: ""
|
|
153
|
+
}, null, 10, _hoisted_1$1)) : (openBlock(), createBlock(_component_Document, { key: 1 }))
|
|
154
|
+
],
|
|
155
|
+
64
|
|
156
|
+
/* STABLE_FRAGMENT */
|
|
157
|
+
)) : createCommentVNode("v-if", true),
|
|
158
|
+
createCommentVNode(" text "),
|
|
159
|
+
_ctx.listType !== "picture" && (_ctx.file.status === "uploading" || _ctx.listType !== "picture-card") ? (openBlock(), createElementBlock(
|
|
160
|
+
"div",
|
|
161
|
+
{
|
|
162
|
+
key: 1,
|
|
163
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-info"))
|
|
164
|
+
},
|
|
165
|
+
[
|
|
166
|
+
createElementVNode(
|
|
167
|
+
"a",
|
|
168
|
+
{
|
|
169
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-name")),
|
|
170
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.onPreview(_ctx.file), ["prevent"]))
|
|
171
|
+
},
|
|
172
|
+
[
|
|
173
|
+
createVNode(_component_el_icon, {
|
|
174
|
+
class: normalizeClass(_ctx.nsIcon.m("document"))
|
|
175
|
+
}, {
|
|
176
|
+
default: withCtx(() => [
|
|
177
|
+
createVNode(_component_Document)
|
|
178
|
+
]),
|
|
179
|
+
_: 1
|
|
180
|
+
/* STABLE */
|
|
181
|
+
}, 8, ["class"]),
|
|
182
|
+
createVNode(_component_el_icon, {
|
|
183
|
+
class: normalizeClass([
|
|
184
|
+
_ctx.nsIcon.m("download"),
|
|
185
|
+
_ctx.nsIcon.m("download-primary")
|
|
186
|
+
]),
|
|
187
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handleDownload(_ctx.file))
|
|
188
|
+
}, {
|
|
189
|
+
default: withCtx(() => [
|
|
190
|
+
createVNode(_component_Download)
|
|
191
|
+
]),
|
|
192
|
+
_: 1
|
|
193
|
+
/* STABLE */
|
|
194
|
+
}, 8, ["class"]),
|
|
195
|
+
createElementVNode(
|
|
196
|
+
"span",
|
|
197
|
+
{
|
|
198
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-file-name"))
|
|
199
|
+
},
|
|
200
|
+
toDisplayString(_ctx.file.name),
|
|
201
|
+
3
|
|
202
|
+
/* TEXT, CLASS */
|
|
203
|
+
)
|
|
204
|
+
],
|
|
205
|
+
2
|
|
206
|
+
/* CLASS */
|
|
207
|
+
),
|
|
208
|
+
_ctx.file.status === "uploading" ? (openBlock(), createBlock(_component_el_progress, {
|
|
209
|
+
key: 0,
|
|
210
|
+
type: _ctx.listType === "picture-card" ? "circle" : "line",
|
|
211
|
+
"stroke-width": _ctx.listType === "picture-card" ? 6 : 2,
|
|
212
|
+
percentage: Number(_ctx.file.percentage),
|
|
213
|
+
style: normalizeStyle(_ctx.listType === "picture-card" ? "" : "margin-top: 0.5rem")
|
|
214
|
+
}, null, 8, ["type", "stroke-width", "percentage", "style"])) : createCommentVNode("v-if", true)
|
|
215
|
+
],
|
|
216
|
+
2
|
|
217
|
+
/* CLASS */
|
|
218
|
+
)) : createCommentVNode("v-if", true),
|
|
219
|
+
createElementVNode(
|
|
220
|
+
"label",
|
|
221
|
+
{
|
|
222
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-status-label"))
|
|
223
|
+
},
|
|
224
|
+
[
|
|
225
|
+
_ctx.listType === "text" ? (openBlock(), createBlock(_component_el_icon, {
|
|
226
|
+
key: 0,
|
|
227
|
+
class: normalizeClass([
|
|
228
|
+
_ctx.nsIcon.m("upload-success"),
|
|
229
|
+
_ctx.nsIcon.m("circle-check")
|
|
230
|
+
])
|
|
231
|
+
}, {
|
|
232
|
+
default: withCtx(() => [
|
|
233
|
+
createVNode(_component_circle_check)
|
|
234
|
+
]),
|
|
235
|
+
_: 1
|
|
236
|
+
/* STABLE */
|
|
237
|
+
}, 8, ["class"])) : ["picture-card", "picture"].includes(_ctx.listType) ? (openBlock(), createBlock(_component_el_icon, {
|
|
238
|
+
key: 1,
|
|
239
|
+
class: normalizeClass([_ctx.nsIcon.m("upload-success"), _ctx.nsIcon.m("check")])
|
|
240
|
+
}, {
|
|
241
|
+
default: withCtx(() => [
|
|
242
|
+
createVNode(_component_Check)
|
|
243
|
+
]),
|
|
244
|
+
_: 1
|
|
245
|
+
/* STABLE */
|
|
246
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
247
|
+
],
|
|
248
|
+
2
|
|
249
|
+
/* CLASS */
|
|
250
|
+
),
|
|
251
|
+
!_ctx.disabled ? (openBlock(), createBlock(_component_el_icon, {
|
|
252
|
+
key: 2,
|
|
253
|
+
class: normalizeClass(_ctx.nsIcon.m("close")),
|
|
254
|
+
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.handleRemove(_ctx.file))
|
|
255
|
+
}, {
|
|
256
|
+
default: withCtx(() => [
|
|
257
|
+
createVNode(_component_Close)
|
|
258
|
+
]),
|
|
259
|
+
_: 1
|
|
260
|
+
/* STABLE */
|
|
261
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true),
|
|
262
|
+
createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),
|
|
263
|
+
createCommentVNode(" This is a bug which needs to be fixed "),
|
|
264
|
+
createCommentVNode(" TODO: Fix the incorrect navigation interaction "),
|
|
265
|
+
createCommentVNode(` <i v-if="!disabled" :class="nsIcon.m('close-tip')">{{
|
|
266
|
+
t('el.upload.deleteTip')
|
|
267
|
+
}}</i> `),
|
|
268
|
+
createCommentVNode(" picture-card "),
|
|
269
|
+
_ctx.listType === "picture-card" ? (openBlock(), createElementBlock(
|
|
270
|
+
"span",
|
|
271
|
+
{
|
|
272
|
+
key: 3,
|
|
273
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-actions"))
|
|
274
|
+
},
|
|
275
|
+
[
|
|
276
|
+
_ctx.preview ? (openBlock(), createElementBlock(
|
|
277
|
+
"span",
|
|
278
|
+
{
|
|
279
|
+
key: 0,
|
|
280
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-preview")),
|
|
281
|
+
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.onPreview(_ctx.file))
|
|
282
|
+
},
|
|
283
|
+
[
|
|
284
|
+
createVNode(_component_el_icon, {
|
|
285
|
+
class: normalizeClass(_ctx.nsIcon.m("zoom-in"))
|
|
286
|
+
}, {
|
|
287
|
+
default: withCtx(() => [
|
|
288
|
+
createVNode(_component_zoom_in)
|
|
289
|
+
]),
|
|
290
|
+
_: 1
|
|
291
|
+
/* STABLE */
|
|
292
|
+
}, 8, ["class"])
|
|
293
|
+
],
|
|
294
|
+
2
|
|
295
|
+
/* CLASS */
|
|
296
|
+
)) : createCommentVNode("v-if", true),
|
|
297
|
+
createCommentVNode(" \u4E0B\u8F7D "),
|
|
298
|
+
createElementVNode(
|
|
299
|
+
"span",
|
|
300
|
+
{
|
|
301
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-download")),
|
|
302
|
+
onClick: _cache[4] || (_cache[4] = ($event) => _ctx.handleDownload(_ctx.file))
|
|
303
|
+
},
|
|
304
|
+
[
|
|
305
|
+
createVNode(_component_el_icon, {
|
|
306
|
+
class: normalizeClass(_ctx.nsIcon.m("download"))
|
|
307
|
+
}, {
|
|
308
|
+
default: withCtx(() => [
|
|
309
|
+
createVNode(_component_Download)
|
|
310
|
+
]),
|
|
311
|
+
_: 1
|
|
312
|
+
/* STABLE */
|
|
313
|
+
}, 8, ["class"])
|
|
314
|
+
],
|
|
315
|
+
2
|
|
316
|
+
/* CLASS */
|
|
317
|
+
),
|
|
318
|
+
!_ctx.disabled ? (openBlock(), createElementBlock(
|
|
319
|
+
"span",
|
|
320
|
+
{
|
|
321
|
+
key: 1,
|
|
322
|
+
class: normalizeClass(_ctx.nsUpload.be("list", "item-delete")),
|
|
323
|
+
onClick: _cache[5] || (_cache[5] = ($event) => _ctx.handleRemove(_ctx.file))
|
|
324
|
+
},
|
|
325
|
+
[
|
|
326
|
+
createVNode(_component_el_icon, {
|
|
327
|
+
class: normalizeClass(_ctx.nsIcon.m("delete"))
|
|
328
|
+
}, {
|
|
329
|
+
default: withCtx(() => [
|
|
330
|
+
createVNode(_component_Delete)
|
|
331
|
+
]),
|
|
332
|
+
_: 1
|
|
333
|
+
/* STABLE */
|
|
334
|
+
}, 8, ["class"])
|
|
335
|
+
],
|
|
336
|
+
2
|
|
337
|
+
/* CLASS */
|
|
338
|
+
)) : createCommentVNode("v-if", true)
|
|
339
|
+
],
|
|
340
|
+
2
|
|
341
|
+
/* CLASS */
|
|
342
|
+
)) : createCommentVNode("v-if", true)
|
|
343
|
+
],
|
|
344
|
+
64
|
|
345
|
+
/* STABLE_FRAGMENT */
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
var FileVue = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\upload\\src\\file.vue"]]);
|
|
349
|
+
|
|
350
|
+
var _sfc_main = defineComponent({
|
|
351
|
+
name: "VkfUpload",
|
|
352
|
+
components: {
|
|
353
|
+
VkfFormItem,
|
|
354
|
+
ElUpload,
|
|
355
|
+
FileVue,
|
|
356
|
+
ElLink
|
|
357
|
+
},
|
|
358
|
+
props,
|
|
359
|
+
emits,
|
|
360
|
+
setup(props2, { emit }) {
|
|
361
|
+
const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
|
|
362
|
+
const coreBindProps = createUploadBindProps(props2, ["disabled", "fileList", "beforeUpload", "onSuccess"]);
|
|
363
|
+
const uploadRef = shallowRef();
|
|
364
|
+
const handleRemove = (file) => {
|
|
365
|
+
uploadRef.value?.handleRemove(file);
|
|
366
|
+
uploadRef.value?.abort(file);
|
|
367
|
+
emit("update:fileList", props2.fileList);
|
|
368
|
+
};
|
|
369
|
+
const readonly = useComputedReadonly(props2);
|
|
370
|
+
const onSuccess = (response, uploadFile, uploadFiles) => {
|
|
371
|
+
const raw = uploadFile.raw;
|
|
372
|
+
raw.progress(true);
|
|
373
|
+
uploadFile.percentage = 100;
|
|
374
|
+
uploadFile.status = "success";
|
|
375
|
+
props2.onSuccess?.(response, uploadFile, uploadFiles);
|
|
376
|
+
};
|
|
377
|
+
const beforeUpload = async (rawFile) => {
|
|
378
|
+
const effect = (e, s) => {
|
|
379
|
+
const file = props2.fileList.find((item) => item.uid === rawFile.uid);
|
|
380
|
+
if (file) {
|
|
381
|
+
file.percentage = Number((e * 100).toFixed(2));
|
|
382
|
+
if (s === false) {
|
|
383
|
+
file.status = "uploading";
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
rawFile.progress = progress(effect)(false);
|
|
388
|
+
if (props2.beforeUpload) {
|
|
389
|
+
const res = await props2.beforeUpload?.(rawFile);
|
|
390
|
+
return res;
|
|
391
|
+
}
|
|
392
|
+
return true;
|
|
393
|
+
};
|
|
394
|
+
return {
|
|
395
|
+
formItemBindProps,
|
|
396
|
+
pickObject,
|
|
397
|
+
coreBindProps,
|
|
398
|
+
uploadRef,
|
|
399
|
+
handleRemove,
|
|
400
|
+
readonly,
|
|
401
|
+
onSuccess,
|
|
402
|
+
// onProgress,
|
|
403
|
+
beforeUpload
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
const _hoisted_1 = { class: "el-upload__tip" };
|
|
409
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
410
|
+
const _component_ElLink = resolveComponent("ElLink");
|
|
411
|
+
const _component_FileVue = resolveComponent("FileVue");
|
|
412
|
+
const _component_ElUpload = resolveComponent("ElUpload");
|
|
413
|
+
const _component_VkfFormItem = resolveComponent("VkfFormItem");
|
|
414
|
+
return openBlock(), createBlock(
|
|
415
|
+
_component_VkfFormItem,
|
|
416
|
+
normalizeProps(guardReactiveProps(_ctx.formItemBindProps)),
|
|
417
|
+
{
|
|
418
|
+
default: withCtx(() => [
|
|
419
|
+
createVNode(_component_ElUpload, mergeProps(_ctx.coreBindProps, {
|
|
420
|
+
ref: "uploadRef",
|
|
421
|
+
class: ["vkf-upload", {
|
|
422
|
+
"is-readonly": _ctx.readonly,
|
|
423
|
+
"is-empty": _ctx.fileList?.length === 0,
|
|
424
|
+
"is-limit": _ctx.limit && _ctx.fileList?.length >= _ctx.limit
|
|
425
|
+
}],
|
|
426
|
+
"file-list": _ctx.fileList ?? [],
|
|
427
|
+
"on-success": _ctx.onSuccess,
|
|
428
|
+
"before-upload": _ctx.beforeUpload,
|
|
429
|
+
disabled: _ctx.readonly || _ctx.disabled,
|
|
430
|
+
"onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:fileList", $event))
|
|
431
|
+
}), createSlots({
|
|
432
|
+
file: withCtx(({ file }) => [
|
|
433
|
+
createVNode(_component_FileVue, {
|
|
434
|
+
file,
|
|
435
|
+
"list-type": _ctx.listType,
|
|
436
|
+
disabled: _ctx.readonly || _ctx.disabled,
|
|
437
|
+
"on-preview": _ctx.onPreview,
|
|
438
|
+
preview: _ctx.preview,
|
|
439
|
+
"on-download": _ctx.onDownload,
|
|
440
|
+
onRemove: _ctx.handleRemove
|
|
441
|
+
}, null, 8, ["file", "list-type", "disabled", "on-preview", "preview", "on-download", "onRemove"])
|
|
442
|
+
]),
|
|
443
|
+
default: withCtx(() => [
|
|
444
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
445
|
+
createVNode(_component_ElLink, { type: "primary" }, {
|
|
446
|
+
default: withCtx(() => [
|
|
447
|
+
createTextVNode(" + \u9009\u62E9\u6587\u4EF6 ")
|
|
448
|
+
]),
|
|
449
|
+
_: 1
|
|
450
|
+
/* STABLE */
|
|
451
|
+
})
|
|
452
|
+
])
|
|
453
|
+
]),
|
|
454
|
+
_: 2
|
|
455
|
+
/* DYNAMIC */
|
|
456
|
+
}, [
|
|
457
|
+
_ctx.tip ? {
|
|
458
|
+
name: "tip",
|
|
459
|
+
fn: withCtx(() => [
|
|
460
|
+
createElementVNode(
|
|
461
|
+
"div",
|
|
462
|
+
_hoisted_1,
|
|
463
|
+
toDisplayString(_ctx.tip),
|
|
464
|
+
1
|
|
465
|
+
/* TEXT */
|
|
466
|
+
)
|
|
467
|
+
]),
|
|
468
|
+
key: "0"
|
|
469
|
+
} : void 0
|
|
470
|
+
]), 1040, ["class", "file-list", "on-success", "before-upload", "disabled"]),
|
|
471
|
+
createElementVNode(
|
|
472
|
+
"span",
|
|
473
|
+
{
|
|
474
|
+
class: normalizeClass(["vkf-upload-empty-tip", {
|
|
475
|
+
"is-readonly": _ctx.readonly,
|
|
476
|
+
"is-empty": _ctx.fileList?.length === 0
|
|
477
|
+
}])
|
|
478
|
+
},
|
|
479
|
+
"\u6682\u65E0",
|
|
480
|
+
2
|
|
481
|
+
/* CLASS */
|
|
482
|
+
)
|
|
483
|
+
]),
|
|
484
|
+
_: 3
|
|
485
|
+
/* FORWARDED */
|
|
486
|
+
},
|
|
487
|
+
16
|
|
488
|
+
/* FULL_PROPS */
|
|
489
|
+
);
|
|
490
|
+
}
|
|
491
|
+
var VkfUpload = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\upload\\src\\index.vue"]]);
|
|
492
|
+
|
|
493
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
494
|
+
__proto__: null
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
VkfUpload.install = (app) => {
|
|
498
|
+
app.component(VkfUpload.name, VkfUpload);
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
export { VkfUpload, ctx as _VkfUploadCtx, types as __VkfUpload, VkfUpload as default };
|