@vunk/form 2.15.0 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/input-file/index.cjs +144 -0
- package/components/input-file/index.d.ts +5 -0
- package/components/input-file/index.mjs +137 -0
- package/components/input-file/src/ctx.d.ts +45 -0
- package/components/input-file/src/index.vue.d.ts +190 -0
- package/components/input-file/src/template.vue.d.ts +202 -0
- package/components/input-file/src/types.d.ts +8 -0
- package/index.d.ts +1 -0
- package/index.esm.js +1 -0
- package/package.json +6 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var elementPlus = require('element-plus');
|
|
6
|
+
var vue = require('vue');
|
|
7
|
+
var upload = require('@vunk/form/components/upload');
|
|
8
|
+
var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
|
|
9
|
+
var formItemRendererTemplate = require('@vunk/form/components/form-item-renderer-template');
|
|
10
|
+
|
|
11
|
+
const props = {
|
|
12
|
+
modelValue: {
|
|
13
|
+
type: [Object, Array],
|
|
14
|
+
default: void 0
|
|
15
|
+
},
|
|
16
|
+
multiple: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
accept: elementPlus.uploadProps.accept,
|
|
21
|
+
disabled: elementPlus.uploadProps.disabled,
|
|
22
|
+
limit: elementPlus.uploadProps.limit,
|
|
23
|
+
listType: elementPlus.uploadProps.listType,
|
|
24
|
+
tip: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ""
|
|
27
|
+
},
|
|
28
|
+
// 复用 upload 的其他展示相关属性
|
|
29
|
+
showFileList: elementPlus.uploadProps.showFileList,
|
|
30
|
+
drag: elementPlus.uploadProps.drag
|
|
31
|
+
};
|
|
32
|
+
const emits = {
|
|
33
|
+
"update:modelValue": null
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var _sfc_main$1 = vue.defineComponent({
|
|
37
|
+
name: "VkfInputFile",
|
|
38
|
+
components: {
|
|
39
|
+
VkfUpload: upload.VkfUpload
|
|
40
|
+
},
|
|
41
|
+
props,
|
|
42
|
+
emits,
|
|
43
|
+
setup(props2, { emit }) {
|
|
44
|
+
const fileList = vue.ref([]);
|
|
45
|
+
const fileToUploadFile = (file) => {
|
|
46
|
+
const uid = elementPlus.genFileId();
|
|
47
|
+
const rawFile = file;
|
|
48
|
+
rawFile.uid = uid;
|
|
49
|
+
return {
|
|
50
|
+
name: file.name,
|
|
51
|
+
size: file.size,
|
|
52
|
+
uid,
|
|
53
|
+
status: "success",
|
|
54
|
+
raw: rawFile,
|
|
55
|
+
url: URL.createObjectURL(file)
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
const initFileList = () => {
|
|
59
|
+
if (!props2.modelValue) {
|
|
60
|
+
fileList.value = [];
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const files = Array.isArray(props2.modelValue) ? props2.modelValue : [props2.modelValue];
|
|
64
|
+
fileList.value = files.filter(Boolean).map(fileToUploadFile);
|
|
65
|
+
};
|
|
66
|
+
vue.watch(() => props2.modelValue, initFileList, { immediate: true });
|
|
67
|
+
const handleFileListChange = (newFileList) => {
|
|
68
|
+
fileList.value = newFileList;
|
|
69
|
+
const files = newFileList.map((item) => item.raw).filter((raw) => raw !== void 0);
|
|
70
|
+
if (props2.multiple) {
|
|
71
|
+
emit("update:modelValue", files);
|
|
72
|
+
} else {
|
|
73
|
+
emit("update:modelValue", files[0] || void 0);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const uploadProps = vue.computed(() => ({
|
|
77
|
+
fileList: fileList.value,
|
|
78
|
+
multiple: props2.multiple,
|
|
79
|
+
accept: props2.accept,
|
|
80
|
+
disabled: props2.disabled,
|
|
81
|
+
limit: props2.limit,
|
|
82
|
+
listType: props2.listType,
|
|
83
|
+
tip: props2.tip,
|
|
84
|
+
showFileList: props2.showFileList,
|
|
85
|
+
drag: props2.drag,
|
|
86
|
+
autoUpload: false,
|
|
87
|
+
action: "#"
|
|
88
|
+
// 占位符,不会实际触发
|
|
89
|
+
}));
|
|
90
|
+
return {
|
|
91
|
+
fileList,
|
|
92
|
+
uploadProps,
|
|
93
|
+
handleFileListChange
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
99
|
+
const _component_VkfUpload = vue.resolveComponent("VkfUpload");
|
|
100
|
+
return vue.openBlock(), vue.createBlock(_component_VkfUpload, vue.mergeProps(_ctx.uploadProps, { "onUpdate:fileList": _ctx.handleFileListChange }), {
|
|
101
|
+
default: vue.withCtx(() => [
|
|
102
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
103
|
+
]),
|
|
104
|
+
_: 3
|
|
105
|
+
/* FORWARDED */
|
|
106
|
+
}, 16, ["onUpdate:fileList"]);
|
|
107
|
+
}
|
|
108
|
+
var VkfInputFile = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/input-file/src/index.vue"]]);
|
|
109
|
+
|
|
110
|
+
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
111
|
+
__name: "template",
|
|
112
|
+
setup(__props, { expose: __expose }) {
|
|
113
|
+
__expose();
|
|
114
|
+
const __returned__ = { get VkfFormItemRendererTemplate() {
|
|
115
|
+
return formItemRendererTemplate.VkfFormItemRendererTemplate;
|
|
116
|
+
}, CoreIndex: VkfInputFile };
|
|
117
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
118
|
+
return __returned__;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
123
|
+
return vue.openBlock(), vue.createBlock($setup["VkfFormItemRendererTemplate"], { type: "VkfInputFile" }, {
|
|
124
|
+
default: vue.withCtx(({ props, value, input }) => [
|
|
125
|
+
vue.createVNode($setup["CoreIndex"], vue.mergeProps({ "model-value": value }, props, { "onUpdate:modelValue": input }), null, 16, ["model-value", "onUpdate:modelValue"])
|
|
126
|
+
]),
|
|
127
|
+
_: 1
|
|
128
|
+
/* STABLE */
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
var template = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/input-file/src/template.vue"]]);
|
|
132
|
+
|
|
133
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
134
|
+
__proto__: null
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
VkfInputFile.install = (app) => {
|
|
138
|
+
app.component(VkfInputFile.name || "VkfInputFile", VkfInputFile);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
exports.VkfInputFile = VkfInputFile;
|
|
142
|
+
exports.VkfInputFileTemplate = template;
|
|
143
|
+
exports.__VkfInputFile = types;
|
|
144
|
+
exports.default = VkfInputFile;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { uploadProps, genFileId } from 'element-plus';
|
|
2
|
+
import { defineComponent, ref, watch, computed, resolveComponent, openBlock, createBlock, mergeProps, withCtx, renderSlot, createVNode } from 'vue';
|
|
3
|
+
import { VkfUpload } from '@vunk/form/components/upload';
|
|
4
|
+
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
5
|
+
import { VkfFormItemRendererTemplate } from '@vunk/form/components/form-item-renderer-template';
|
|
6
|
+
|
|
7
|
+
const props = {
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: [Object, Array],
|
|
10
|
+
default: void 0
|
|
11
|
+
},
|
|
12
|
+
multiple: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: false
|
|
15
|
+
},
|
|
16
|
+
accept: uploadProps.accept,
|
|
17
|
+
disabled: uploadProps.disabled,
|
|
18
|
+
limit: uploadProps.limit,
|
|
19
|
+
listType: uploadProps.listType,
|
|
20
|
+
tip: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: ""
|
|
23
|
+
},
|
|
24
|
+
// 复用 upload 的其他展示相关属性
|
|
25
|
+
showFileList: uploadProps.showFileList,
|
|
26
|
+
drag: uploadProps.drag
|
|
27
|
+
};
|
|
28
|
+
const emits = {
|
|
29
|
+
"update:modelValue": null
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var _sfc_main$1 = defineComponent({
|
|
33
|
+
name: "VkfInputFile",
|
|
34
|
+
components: {
|
|
35
|
+
VkfUpload
|
|
36
|
+
},
|
|
37
|
+
props,
|
|
38
|
+
emits,
|
|
39
|
+
setup(props2, { emit }) {
|
|
40
|
+
const fileList = ref([]);
|
|
41
|
+
const fileToUploadFile = (file) => {
|
|
42
|
+
const uid = genFileId();
|
|
43
|
+
const rawFile = file;
|
|
44
|
+
rawFile.uid = uid;
|
|
45
|
+
return {
|
|
46
|
+
name: file.name,
|
|
47
|
+
size: file.size,
|
|
48
|
+
uid,
|
|
49
|
+
status: "success",
|
|
50
|
+
raw: rawFile,
|
|
51
|
+
url: URL.createObjectURL(file)
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
const initFileList = () => {
|
|
55
|
+
if (!props2.modelValue) {
|
|
56
|
+
fileList.value = [];
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const files = Array.isArray(props2.modelValue) ? props2.modelValue : [props2.modelValue];
|
|
60
|
+
fileList.value = files.filter(Boolean).map(fileToUploadFile);
|
|
61
|
+
};
|
|
62
|
+
watch(() => props2.modelValue, initFileList, { immediate: true });
|
|
63
|
+
const handleFileListChange = (newFileList) => {
|
|
64
|
+
fileList.value = newFileList;
|
|
65
|
+
const files = newFileList.map((item) => item.raw).filter((raw) => raw !== void 0);
|
|
66
|
+
if (props2.multiple) {
|
|
67
|
+
emit("update:modelValue", files);
|
|
68
|
+
} else {
|
|
69
|
+
emit("update:modelValue", files[0] || void 0);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const uploadProps = computed(() => ({
|
|
73
|
+
fileList: fileList.value,
|
|
74
|
+
multiple: props2.multiple,
|
|
75
|
+
accept: props2.accept,
|
|
76
|
+
disabled: props2.disabled,
|
|
77
|
+
limit: props2.limit,
|
|
78
|
+
listType: props2.listType,
|
|
79
|
+
tip: props2.tip,
|
|
80
|
+
showFileList: props2.showFileList,
|
|
81
|
+
drag: props2.drag,
|
|
82
|
+
autoUpload: false,
|
|
83
|
+
action: "#"
|
|
84
|
+
// 占位符,不会实际触发
|
|
85
|
+
}));
|
|
86
|
+
return {
|
|
87
|
+
fileList,
|
|
88
|
+
uploadProps,
|
|
89
|
+
handleFileListChange
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
95
|
+
const _component_VkfUpload = resolveComponent("VkfUpload");
|
|
96
|
+
return openBlock(), createBlock(_component_VkfUpload, mergeProps(_ctx.uploadProps, { "onUpdate:fileList": _ctx.handleFileListChange }), {
|
|
97
|
+
default: withCtx(() => [
|
|
98
|
+
renderSlot(_ctx.$slots, "default")
|
|
99
|
+
]),
|
|
100
|
+
_: 3
|
|
101
|
+
/* FORWARDED */
|
|
102
|
+
}, 16, ["onUpdate:fileList"]);
|
|
103
|
+
}
|
|
104
|
+
var VkfInputFile = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/input-file/src/index.vue"]]);
|
|
105
|
+
|
|
106
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
107
|
+
__name: "template",
|
|
108
|
+
setup(__props, { expose: __expose }) {
|
|
109
|
+
__expose();
|
|
110
|
+
const __returned__ = { get VkfFormItemRendererTemplate() {
|
|
111
|
+
return VkfFormItemRendererTemplate;
|
|
112
|
+
}, CoreIndex: VkfInputFile };
|
|
113
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
114
|
+
return __returned__;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
119
|
+
return openBlock(), createBlock($setup["VkfFormItemRendererTemplate"], { type: "VkfInputFile" }, {
|
|
120
|
+
default: withCtx(({ props, value, input }) => [
|
|
121
|
+
createVNode($setup["CoreIndex"], mergeProps({ "model-value": value }, props, { "onUpdate:modelValue": input }), null, 16, ["model-value", "onUpdate:modelValue"])
|
|
122
|
+
]),
|
|
123
|
+
_: 1
|
|
124
|
+
/* STABLE */
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
var template = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/input-file/src/template.vue"]]);
|
|
128
|
+
|
|
129
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
130
|
+
__proto__: null
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
VkfInputFile.install = (app) => {
|
|
134
|
+
app.component(VkfInputFile.name || "VkfInputFile", VkfInputFile);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export { VkfInputFile, template as VkfInputFileTemplate, types as __VkfInputFile, VkfInputFile as default };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
export declare const props: {
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: PropType<File | File[] | undefined>;
|
|
5
|
+
default: any;
|
|
6
|
+
};
|
|
7
|
+
multiple: {
|
|
8
|
+
type: BooleanConstructor;
|
|
9
|
+
default: boolean;
|
|
10
|
+
};
|
|
11
|
+
accept: {
|
|
12
|
+
readonly type: PropType<string>;
|
|
13
|
+
readonly required: false;
|
|
14
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
15
|
+
__epPropKey: true;
|
|
16
|
+
} & {
|
|
17
|
+
readonly default: "";
|
|
18
|
+
};
|
|
19
|
+
disabled: BooleanConstructor;
|
|
20
|
+
limit: NumberConstructor;
|
|
21
|
+
listType: {
|
|
22
|
+
readonly type: PropType<"text" | "picture" | "picture-card">;
|
|
23
|
+
readonly required: false;
|
|
24
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
25
|
+
__epPropKey: true;
|
|
26
|
+
} & {
|
|
27
|
+
readonly default: "text";
|
|
28
|
+
};
|
|
29
|
+
tip: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
33
|
+
showFileList: {
|
|
34
|
+
readonly type: PropType<boolean>;
|
|
35
|
+
readonly required: false;
|
|
36
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
37
|
+
__epPropKey: true;
|
|
38
|
+
} & {
|
|
39
|
+
readonly default: true;
|
|
40
|
+
};
|
|
41
|
+
drag: BooleanConstructor;
|
|
42
|
+
};
|
|
43
|
+
export declare const emits: {
|
|
44
|
+
'update:modelValue': any;
|
|
45
|
+
};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { UploadFile } from 'element-plus';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: import("vue").PropType<File | File[] | undefined>;
|
|
5
|
+
default: any;
|
|
6
|
+
};
|
|
7
|
+
multiple: {
|
|
8
|
+
type: BooleanConstructor;
|
|
9
|
+
default: boolean;
|
|
10
|
+
};
|
|
11
|
+
accept: {
|
|
12
|
+
readonly type: import("vue").PropType<string>;
|
|
13
|
+
readonly required: false;
|
|
14
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
15
|
+
__epPropKey: true;
|
|
16
|
+
} & {
|
|
17
|
+
readonly default: "";
|
|
18
|
+
};
|
|
19
|
+
disabled: BooleanConstructor;
|
|
20
|
+
limit: NumberConstructor;
|
|
21
|
+
listType: {
|
|
22
|
+
readonly type: import("vue").PropType<"text" | "picture" | "picture-card">;
|
|
23
|
+
readonly required: false;
|
|
24
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
25
|
+
__epPropKey: true;
|
|
26
|
+
} & {
|
|
27
|
+
readonly default: "text";
|
|
28
|
+
};
|
|
29
|
+
tip: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
33
|
+
showFileList: {
|
|
34
|
+
readonly type: import("vue").PropType<boolean>;
|
|
35
|
+
readonly required: false;
|
|
36
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
37
|
+
__epPropKey: true;
|
|
38
|
+
} & {
|
|
39
|
+
readonly default: true;
|
|
40
|
+
};
|
|
41
|
+
drag: BooleanConstructor;
|
|
42
|
+
}>, {
|
|
43
|
+
fileList: import("vue").Ref<{
|
|
44
|
+
name: string;
|
|
45
|
+
percentage?: number;
|
|
46
|
+
status: import("element-plus").UploadStatus;
|
|
47
|
+
size?: number;
|
|
48
|
+
response?: unknown;
|
|
49
|
+
uid: number;
|
|
50
|
+
url?: string;
|
|
51
|
+
raw?: {
|
|
52
|
+
uid: number;
|
|
53
|
+
isDirectory?: boolean;
|
|
54
|
+
readonly lastModified: number;
|
|
55
|
+
readonly name: string;
|
|
56
|
+
readonly webkitRelativePath: string;
|
|
57
|
+
readonly size: number;
|
|
58
|
+
readonly type: string;
|
|
59
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
60
|
+
bytes: () => Promise<Uint8Array>;
|
|
61
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
62
|
+
stream: () => ReadableStream<Uint8Array>;
|
|
63
|
+
text: () => Promise<string>;
|
|
64
|
+
};
|
|
65
|
+
}[], UploadFile[] | {
|
|
66
|
+
name: string;
|
|
67
|
+
percentage?: number;
|
|
68
|
+
status: import("element-plus").UploadStatus;
|
|
69
|
+
size?: number;
|
|
70
|
+
response?: unknown;
|
|
71
|
+
uid: number;
|
|
72
|
+
url?: string;
|
|
73
|
+
raw?: {
|
|
74
|
+
uid: number;
|
|
75
|
+
isDirectory?: boolean;
|
|
76
|
+
readonly lastModified: number;
|
|
77
|
+
readonly name: string;
|
|
78
|
+
readonly webkitRelativePath: string;
|
|
79
|
+
readonly size: number;
|
|
80
|
+
readonly type: string;
|
|
81
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
82
|
+
bytes: () => Promise<Uint8Array>;
|
|
83
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
84
|
+
stream: () => ReadableStream<Uint8Array>;
|
|
85
|
+
text: () => Promise<string>;
|
|
86
|
+
};
|
|
87
|
+
}[]>;
|
|
88
|
+
uploadProps: import("vue").ComputedRef<{
|
|
89
|
+
fileList: {
|
|
90
|
+
name: string;
|
|
91
|
+
percentage?: number;
|
|
92
|
+
status: import("element-plus").UploadStatus;
|
|
93
|
+
size?: number;
|
|
94
|
+
response?: unknown;
|
|
95
|
+
uid: number;
|
|
96
|
+
url?: string;
|
|
97
|
+
raw?: {
|
|
98
|
+
uid: number;
|
|
99
|
+
isDirectory?: boolean;
|
|
100
|
+
readonly lastModified: number;
|
|
101
|
+
readonly name: string;
|
|
102
|
+
readonly webkitRelativePath: string;
|
|
103
|
+
readonly size: number;
|
|
104
|
+
readonly type: string;
|
|
105
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
106
|
+
bytes: () => Promise<Uint8Array>;
|
|
107
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
108
|
+
stream: () => ReadableStream<Uint8Array>;
|
|
109
|
+
text: () => Promise<string>;
|
|
110
|
+
};
|
|
111
|
+
}[];
|
|
112
|
+
multiple: boolean;
|
|
113
|
+
accept: string;
|
|
114
|
+
disabled: boolean;
|
|
115
|
+
limit: number;
|
|
116
|
+
listType: "text" | "picture" | "picture-card";
|
|
117
|
+
tip: string;
|
|
118
|
+
showFileList: boolean;
|
|
119
|
+
drag: boolean;
|
|
120
|
+
autoUpload: boolean;
|
|
121
|
+
action: string;
|
|
122
|
+
}>;
|
|
123
|
+
handleFileListChange: (newFileList: UploadFile[]) => void;
|
|
124
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
125
|
+
'update:modelValue': any;
|
|
126
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
127
|
+
modelValue: {
|
|
128
|
+
type: import("vue").PropType<File | File[] | undefined>;
|
|
129
|
+
default: any;
|
|
130
|
+
};
|
|
131
|
+
multiple: {
|
|
132
|
+
type: BooleanConstructor;
|
|
133
|
+
default: boolean;
|
|
134
|
+
};
|
|
135
|
+
accept: {
|
|
136
|
+
readonly type: import("vue").PropType<string>;
|
|
137
|
+
readonly required: false;
|
|
138
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
139
|
+
__epPropKey: true;
|
|
140
|
+
} & {
|
|
141
|
+
readonly default: "";
|
|
142
|
+
};
|
|
143
|
+
disabled: BooleanConstructor;
|
|
144
|
+
limit: NumberConstructor;
|
|
145
|
+
listType: {
|
|
146
|
+
readonly type: import("vue").PropType<"text" | "picture" | "picture-card">;
|
|
147
|
+
readonly required: false;
|
|
148
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
149
|
+
__epPropKey: true;
|
|
150
|
+
} & {
|
|
151
|
+
readonly default: "text";
|
|
152
|
+
};
|
|
153
|
+
tip: {
|
|
154
|
+
type: StringConstructor;
|
|
155
|
+
default: string;
|
|
156
|
+
};
|
|
157
|
+
showFileList: {
|
|
158
|
+
readonly type: import("vue").PropType<boolean>;
|
|
159
|
+
readonly required: false;
|
|
160
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
161
|
+
__epPropKey: true;
|
|
162
|
+
} & {
|
|
163
|
+
readonly default: true;
|
|
164
|
+
};
|
|
165
|
+
drag: BooleanConstructor;
|
|
166
|
+
}>> & Readonly<{
|
|
167
|
+
"onUpdate:modelValue"?: (...args: any[] | unknown[]) => any;
|
|
168
|
+
}>, {
|
|
169
|
+
disabled: boolean;
|
|
170
|
+
modelValue: File | File[];
|
|
171
|
+
multiple: boolean;
|
|
172
|
+
drag: boolean;
|
|
173
|
+
showFileList: boolean;
|
|
174
|
+
accept: string;
|
|
175
|
+
listType: "text" | "picture" | "picture-card";
|
|
176
|
+
tip: string;
|
|
177
|
+
}, {}, {
|
|
178
|
+
VkfUpload: {
|
|
179
|
+
new (...args: any[]): any;
|
|
180
|
+
__isFragment?: never;
|
|
181
|
+
__isTeleport?: never;
|
|
182
|
+
__isSuspense?: never;
|
|
183
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<Record<string | symbol, any>>>, Record<string | symbol, any>, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
184
|
+
[x: string]: any;
|
|
185
|
+
[x: symbol]: any;
|
|
186
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
187
|
+
install(app: import("vue").App): void;
|
|
188
|
+
};
|
|
189
|
+
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
190
|
+
export default _default;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
+
readonly VkfFormItemRendererTemplate: {
|
|
3
|
+
new (...args: any[]): any;
|
|
4
|
+
__isFragment?: never;
|
|
5
|
+
__isTeleport?: never;
|
|
6
|
+
__isSuspense?: never;
|
|
7
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<Record<string | symbol, any>>>, Record<string | symbol, any>, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
8
|
+
[x: string]: any;
|
|
9
|
+
[x: symbol]: any;
|
|
10
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
11
|
+
install(app: import("vue").App): void;
|
|
12
|
+
};
|
|
13
|
+
CoreIndex: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: import("vue").PropType<File | File[] | undefined>;
|
|
16
|
+
default: any;
|
|
17
|
+
};
|
|
18
|
+
multiple: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
accept: {
|
|
23
|
+
readonly type: import("vue").PropType<string>;
|
|
24
|
+
readonly required: false;
|
|
25
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
26
|
+
__epPropKey: true;
|
|
27
|
+
} & {
|
|
28
|
+
readonly default: "";
|
|
29
|
+
};
|
|
30
|
+
disabled: BooleanConstructor;
|
|
31
|
+
limit: NumberConstructor;
|
|
32
|
+
listType: {
|
|
33
|
+
readonly type: import("vue").PropType<"text" | "picture" | "picture-card">;
|
|
34
|
+
readonly required: false;
|
|
35
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
36
|
+
__epPropKey: true;
|
|
37
|
+
} & {
|
|
38
|
+
readonly default: "text";
|
|
39
|
+
};
|
|
40
|
+
tip: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
default: string;
|
|
43
|
+
};
|
|
44
|
+
showFileList: {
|
|
45
|
+
readonly type: import("vue").PropType<boolean>;
|
|
46
|
+
readonly required: false;
|
|
47
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
48
|
+
__epPropKey: true;
|
|
49
|
+
} & {
|
|
50
|
+
readonly default: true;
|
|
51
|
+
};
|
|
52
|
+
drag: BooleanConstructor;
|
|
53
|
+
}>, {
|
|
54
|
+
fileList: import("vue").Ref<{
|
|
55
|
+
name: string;
|
|
56
|
+
percentage?: number;
|
|
57
|
+
status: import("element-plus").UploadStatus;
|
|
58
|
+
size?: number;
|
|
59
|
+
response?: unknown;
|
|
60
|
+
uid: number;
|
|
61
|
+
url?: string;
|
|
62
|
+
raw?: {
|
|
63
|
+
uid: number;
|
|
64
|
+
isDirectory?: boolean;
|
|
65
|
+
readonly lastModified: number;
|
|
66
|
+
readonly name: string;
|
|
67
|
+
readonly webkitRelativePath: string;
|
|
68
|
+
readonly size: number;
|
|
69
|
+
readonly type: string;
|
|
70
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
71
|
+
bytes: () => Promise<Uint8Array>;
|
|
72
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
73
|
+
stream: () => ReadableStream<Uint8Array>;
|
|
74
|
+
text: () => Promise<string>;
|
|
75
|
+
};
|
|
76
|
+
}[], import("element-plus").UploadFile[] | {
|
|
77
|
+
name: string;
|
|
78
|
+
percentage?: number;
|
|
79
|
+
status: import("element-plus").UploadStatus;
|
|
80
|
+
size?: number;
|
|
81
|
+
response?: unknown;
|
|
82
|
+
uid: number;
|
|
83
|
+
url?: string;
|
|
84
|
+
raw?: {
|
|
85
|
+
uid: number;
|
|
86
|
+
isDirectory?: boolean;
|
|
87
|
+
readonly lastModified: number;
|
|
88
|
+
readonly name: string;
|
|
89
|
+
readonly webkitRelativePath: string;
|
|
90
|
+
readonly size: number;
|
|
91
|
+
readonly type: string;
|
|
92
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
93
|
+
bytes: () => Promise<Uint8Array>;
|
|
94
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
95
|
+
stream: () => ReadableStream<Uint8Array>;
|
|
96
|
+
text: () => Promise<string>;
|
|
97
|
+
};
|
|
98
|
+
}[]>;
|
|
99
|
+
uploadProps: import("vue").ComputedRef<{
|
|
100
|
+
fileList: {
|
|
101
|
+
name: string;
|
|
102
|
+
percentage?: number;
|
|
103
|
+
status: import("element-plus").UploadStatus;
|
|
104
|
+
size?: number;
|
|
105
|
+
response?: unknown;
|
|
106
|
+
uid: number;
|
|
107
|
+
url?: string;
|
|
108
|
+
raw?: {
|
|
109
|
+
uid: number;
|
|
110
|
+
isDirectory?: boolean;
|
|
111
|
+
readonly lastModified: number;
|
|
112
|
+
readonly name: string;
|
|
113
|
+
readonly webkitRelativePath: string;
|
|
114
|
+
readonly size: number;
|
|
115
|
+
readonly type: string;
|
|
116
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
117
|
+
bytes: () => Promise<Uint8Array>;
|
|
118
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
119
|
+
stream: () => ReadableStream<Uint8Array>;
|
|
120
|
+
text: () => Promise<string>;
|
|
121
|
+
};
|
|
122
|
+
}[];
|
|
123
|
+
multiple: boolean;
|
|
124
|
+
accept: string;
|
|
125
|
+
disabled: boolean;
|
|
126
|
+
limit: number;
|
|
127
|
+
listType: "text" | "picture" | "picture-card";
|
|
128
|
+
tip: string;
|
|
129
|
+
showFileList: boolean;
|
|
130
|
+
drag: boolean;
|
|
131
|
+
autoUpload: boolean;
|
|
132
|
+
action: string;
|
|
133
|
+
}>;
|
|
134
|
+
handleFileListChange: (newFileList: import("element-plus").UploadFile[]) => void;
|
|
135
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
136
|
+
'update:modelValue': any;
|
|
137
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
138
|
+
modelValue: {
|
|
139
|
+
type: import("vue").PropType<File | File[] | undefined>;
|
|
140
|
+
default: any;
|
|
141
|
+
};
|
|
142
|
+
multiple: {
|
|
143
|
+
type: BooleanConstructor;
|
|
144
|
+
default: boolean;
|
|
145
|
+
};
|
|
146
|
+
accept: {
|
|
147
|
+
readonly type: import("vue").PropType<string>;
|
|
148
|
+
readonly required: false;
|
|
149
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
150
|
+
__epPropKey: true;
|
|
151
|
+
} & {
|
|
152
|
+
readonly default: "";
|
|
153
|
+
};
|
|
154
|
+
disabled: BooleanConstructor;
|
|
155
|
+
limit: NumberConstructor;
|
|
156
|
+
listType: {
|
|
157
|
+
readonly type: import("vue").PropType<"text" | "picture" | "picture-card">;
|
|
158
|
+
readonly required: false;
|
|
159
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
160
|
+
__epPropKey: true;
|
|
161
|
+
} & {
|
|
162
|
+
readonly default: "text";
|
|
163
|
+
};
|
|
164
|
+
tip: {
|
|
165
|
+
type: StringConstructor;
|
|
166
|
+
default: string;
|
|
167
|
+
};
|
|
168
|
+
showFileList: {
|
|
169
|
+
readonly type: import("vue").PropType<boolean>;
|
|
170
|
+
readonly required: false;
|
|
171
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
172
|
+
__epPropKey: true;
|
|
173
|
+
} & {
|
|
174
|
+
readonly default: true;
|
|
175
|
+
};
|
|
176
|
+
drag: BooleanConstructor;
|
|
177
|
+
}>> & Readonly<{
|
|
178
|
+
"onUpdate:modelValue"?: (...args: any[] | unknown[]) => any;
|
|
179
|
+
}>, {
|
|
180
|
+
disabled: boolean;
|
|
181
|
+
modelValue: File | File[];
|
|
182
|
+
multiple: boolean;
|
|
183
|
+
drag: boolean;
|
|
184
|
+
showFileList: boolean;
|
|
185
|
+
accept: string;
|
|
186
|
+
listType: "text" | "picture" | "picture-card";
|
|
187
|
+
tip: string;
|
|
188
|
+
}, {}, {
|
|
189
|
+
VkfUpload: {
|
|
190
|
+
new (...args: any[]): any;
|
|
191
|
+
__isFragment?: never;
|
|
192
|
+
__isTeleport?: never;
|
|
193
|
+
__isSuspense?: never;
|
|
194
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<Record<string | symbol, any>>>, Record<string | symbol, any>, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
195
|
+
[x: string]: any;
|
|
196
|
+
[x: symbol]: any;
|
|
197
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
198
|
+
install(app: import("vue").App): void;
|
|
199
|
+
};
|
|
200
|
+
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
201
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
202
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { VkfInputFile } from '@vunk/form/components/input-file';
|
|
2
|
+
import { VueComponentPropsType } from '@vunk/core';
|
|
3
|
+
import { BasicSource } from '@vunk/form/shared';
|
|
4
|
+
import { VkfUpload } from '@vunk/form';
|
|
5
|
+
export interface Source<P = string> extends VueComponentPropsType<typeof VkfInputFile>, BasicSource, VueComponentPropsType<typeof VkfUpload> {
|
|
6
|
+
prop: P;
|
|
7
|
+
templateType: 'VkfInputFile';
|
|
8
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from '@vunk/form/components/form-item-renderer-template';
|
|
|
8
8
|
export * from '@vunk/form/components/templates-default';
|
|
9
9
|
export * from '@vunk/form/components/templates-layout';
|
|
10
10
|
export * from '@vunk/form/components/form';
|
|
11
|
+
export * from '@vunk/form/components/form-item';
|
|
11
12
|
export * from '@vunk/form/components/input';
|
|
12
13
|
export * from '@vunk/form/components/input-number';
|
|
13
14
|
export * from '@vunk/form/components/select';
|
package/index.esm.js
CHANGED
|
@@ -9,6 +9,7 @@ export * from '@vunk/form/components/templates-layout';
|
|
|
9
9
|
export * from '@vunk/form/shared';
|
|
10
10
|
export * from '@vunk/form/composables';
|
|
11
11
|
export * from '@vunk/form/components/templates-default';
|
|
12
|
+
export * from '@vunk/form/components/form-item';
|
|
12
13
|
export * from '@vunk/form/components/input';
|
|
13
14
|
export * from '@vunk/form/components/input-number';
|
|
14
15
|
export * from '@vunk/form/components/select';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vunk/form",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.esm.js",
|
|
6
6
|
"scripts": {
|
|
@@ -195,6 +195,11 @@
|
|
|
195
195
|
"types": "./components/input-link/index.d.ts",
|
|
196
196
|
"require": "./components/input-link/index.cjs"
|
|
197
197
|
},
|
|
198
|
+
"./components/input-file": {
|
|
199
|
+
"import": "./components/input-file/index.mjs",
|
|
200
|
+
"types": "./components/input-file/index.d.ts",
|
|
201
|
+
"require": "./components/input-file/index.cjs"
|
|
202
|
+
},
|
|
198
203
|
"./components/input-collection": {
|
|
199
204
|
"import": "./components/input-collection/index.mjs",
|
|
200
205
|
"types": "./components/input-collection/index.d.ts",
|