@vunk/form 2.15.0 → 2.16.1
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/components/select/index.cjs +74 -26
- package/components/select/index.mjs +76 -28
- package/components/select/src/core.vue.d.ts +30 -0
- package/components/select/src/ctx.d.ts +17 -1
- package/components/select/src/index.vue.d.ts +9 -0
- package/components/select/src/options.vue.d.ts +24 -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
|
+
}
|
|
@@ -22,7 +22,13 @@ const props = {
|
|
|
22
22
|
type: Object,
|
|
23
23
|
default: void 0
|
|
24
24
|
},
|
|
25
|
+
/**
|
|
26
|
+
* @description el组件实例ref
|
|
27
|
+
*/
|
|
25
28
|
selectRef: null,
|
|
29
|
+
/**
|
|
30
|
+
* @description a url which's response is options
|
|
31
|
+
*/
|
|
26
32
|
optionsUrl: {
|
|
27
33
|
type: String,
|
|
28
34
|
default: ""
|
|
@@ -34,7 +40,17 @@ const props = {
|
|
|
34
40
|
type: Boolean,
|
|
35
41
|
default: false
|
|
36
42
|
},
|
|
37
|
-
|
|
43
|
+
/**
|
|
44
|
+
* @description 同插槽
|
|
45
|
+
*/
|
|
46
|
+
slots: null,
|
|
47
|
+
/**
|
|
48
|
+
* @description 若 option中含有该字段内容,则渲染为 Group
|
|
49
|
+
*/
|
|
50
|
+
optionChildrenProp: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: ""
|
|
53
|
+
}
|
|
38
54
|
};
|
|
39
55
|
const createBindProps = utilsVue.bindPropsFactory(props);
|
|
40
56
|
const emits = {
|
|
@@ -50,12 +66,56 @@ var ctx = /*#__PURE__*/Object.freeze({
|
|
|
50
66
|
props: props
|
|
51
67
|
});
|
|
52
68
|
|
|
69
|
+
function _isSlot(s) {
|
|
70
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
71
|
+
}
|
|
72
|
+
var _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
73
|
+
props: {
|
|
74
|
+
data: {
|
|
75
|
+
type: Array,
|
|
76
|
+
required: true
|
|
77
|
+
},
|
|
78
|
+
optionChildrenProp: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: ""
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
setup(props, {
|
|
84
|
+
slots
|
|
85
|
+
}) {
|
|
86
|
+
const ItemView = item => {
|
|
87
|
+
let _slot;
|
|
88
|
+
const isGroup = props.optionChildrenProp && Array.isArray(item[props.optionChildrenProp]) && item[props.optionChildrenProp].length > 0;
|
|
89
|
+
return isGroup ? vue.createVNode(elementPlus$1.ElOptionGroup, {
|
|
90
|
+
"label": item.label,
|
|
91
|
+
"key": item.value || item.label,
|
|
92
|
+
"disabled": item.disabled
|
|
93
|
+
}, _isSlot(_slot = item[props.optionChildrenProp].map(childOption => vue.createVNode(ItemView, vue.mergeProps({
|
|
94
|
+
"key": childOption.value
|
|
95
|
+
}, childOption), null))) ? _slot : {
|
|
96
|
+
default: () => [_slot]
|
|
97
|
+
}) : vue.createVNode(elementPlus$1.ElOption, vue.mergeProps({
|
|
98
|
+
"key": item.value,
|
|
99
|
+
"value": item.value
|
|
100
|
+
}, item), {
|
|
101
|
+
default: () => slots.option ? slots.option(item) : item.label
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
return () => {
|
|
105
|
+
return props.data.map(item => ItemView(item));
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
var Options = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$2, [["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/select/src/options.vue"]]);
|
|
111
|
+
|
|
53
112
|
var _sfc_main$1 = vue.defineComponent({
|
|
54
113
|
name: "VkfSelect",
|
|
55
114
|
components: {
|
|
56
115
|
VkfFormItem: formItem.VkfFormItem,
|
|
57
116
|
ElSelect: elementPlus$1.ElSelect,
|
|
58
|
-
ElOption: elementPlus$1.ElOption
|
|
117
|
+
ElOption: elementPlus$1.ElOption,
|
|
118
|
+
Options
|
|
59
119
|
},
|
|
60
120
|
props,
|
|
61
121
|
emits,
|
|
@@ -138,7 +198,7 @@ var _sfc_main$1 = vue.defineComponent({
|
|
|
138
198
|
});
|
|
139
199
|
|
|
140
200
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
141
|
-
const
|
|
201
|
+
const _component_Options = vue.resolveComponent("Options");
|
|
142
202
|
const _component_ElSelect = vue.resolveComponent("ElSelect");
|
|
143
203
|
const _component_VkfFormItem = vue.resolveComponent("VkfFormItem");
|
|
144
204
|
return vue.openBlock(), vue.createBlock(
|
|
@@ -156,29 +216,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
156
216
|
}
|
|
157
217
|
}, vue.toHandlers(_ctx.selectOnEmits)), vue.createSlots({
|
|
158
218
|
default: vue.withCtx(() => [
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
vue.renderSlot(_ctx.$slots, "option", vue.mergeProps({ ref_for: true }, item))
|
|
171
|
-
]),
|
|
172
|
-
_: 2
|
|
173
|
-
/* DYNAMIC */
|
|
174
|
-
},
|
|
175
|
-
1040
|
|
176
|
-
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
177
|
-
);
|
|
178
|
-
}),
|
|
179
|
-
128
|
|
180
|
-
/* KEYED_FRAGMENT */
|
|
181
|
-
))
|
|
219
|
+
vue.createVNode(_component_Options, {
|
|
220
|
+
data: _ctx.selectOptions,
|
|
221
|
+
"option-children-prop": _ctx.optionChildrenProp
|
|
222
|
+
}, {
|
|
223
|
+
option: vue.withCtx((e) => [
|
|
224
|
+
vue.renderSlot(_ctx.$slots, "option", vue.normalizeProps(vue.guardReactiveProps(e)))
|
|
225
|
+
]),
|
|
226
|
+
_: 3
|
|
227
|
+
/* FORWARDED */
|
|
228
|
+
}, 8, ["data", "option-children-prop"]),
|
|
229
|
+
vue.renderSlot(_ctx.$slots, "footer")
|
|
182
230
|
]),
|
|
183
231
|
_: 2
|
|
184
232
|
/* DYNAMIC */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, watch, nextTick, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx,
|
|
1
|
+
import { defineComponent, createVNode, mergeProps, isVNode, computed, ref, watch, nextTick, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, toHandlers, createSlots, renderSlot, renderList, resolveDynamicComponent, createCommentVNode, h } from 'vue';
|
|
2
2
|
import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
|
|
3
3
|
import { selectProps, selectEmits, createSelectBindProps, createSelectOnEmits } from '@vunk/form/shared/element-plus';
|
|
4
4
|
import { bindPropsFactory, onEmitsFactory, vOn } from '@vunk/core/shared/utils-vue';
|
|
5
|
-
import {
|
|
5
|
+
import { ElOptionGroup, ElOption, ElSelect } from 'element-plus';
|
|
6
6
|
import { isNotEmptyObject, isPlainObject } from '@vunk/core/shared/utils-object';
|
|
7
7
|
import { useComputedReadonly } from '@vunk/form/composables';
|
|
8
8
|
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
@@ -18,7 +18,13 @@ const props = {
|
|
|
18
18
|
type: Object,
|
|
19
19
|
default: void 0
|
|
20
20
|
},
|
|
21
|
+
/**
|
|
22
|
+
* @description el组件实例ref
|
|
23
|
+
*/
|
|
21
24
|
selectRef: null,
|
|
25
|
+
/**
|
|
26
|
+
* @description a url which's response is options
|
|
27
|
+
*/
|
|
22
28
|
optionsUrl: {
|
|
23
29
|
type: String,
|
|
24
30
|
default: ""
|
|
@@ -30,7 +36,17 @@ const props = {
|
|
|
30
36
|
type: Boolean,
|
|
31
37
|
default: false
|
|
32
38
|
},
|
|
33
|
-
|
|
39
|
+
/**
|
|
40
|
+
* @description 同插槽
|
|
41
|
+
*/
|
|
42
|
+
slots: null,
|
|
43
|
+
/**
|
|
44
|
+
* @description 若 option中含有该字段内容,则渲染为 Group
|
|
45
|
+
*/
|
|
46
|
+
optionChildrenProp: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: ""
|
|
49
|
+
}
|
|
34
50
|
};
|
|
35
51
|
const createBindProps = bindPropsFactory(props);
|
|
36
52
|
const emits = {
|
|
@@ -46,12 +62,56 @@ var ctx = /*#__PURE__*/Object.freeze({
|
|
|
46
62
|
props: props
|
|
47
63
|
});
|
|
48
64
|
|
|
65
|
+
function _isSlot(s) {
|
|
66
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
67
|
+
}
|
|
68
|
+
var _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
69
|
+
props: {
|
|
70
|
+
data: {
|
|
71
|
+
type: Array,
|
|
72
|
+
required: true
|
|
73
|
+
},
|
|
74
|
+
optionChildrenProp: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: ""
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
setup(props, {
|
|
80
|
+
slots
|
|
81
|
+
}) {
|
|
82
|
+
const ItemView = item => {
|
|
83
|
+
let _slot;
|
|
84
|
+
const isGroup = props.optionChildrenProp && Array.isArray(item[props.optionChildrenProp]) && item[props.optionChildrenProp].length > 0;
|
|
85
|
+
return isGroup ? createVNode(ElOptionGroup, {
|
|
86
|
+
"label": item.label,
|
|
87
|
+
"key": item.value || item.label,
|
|
88
|
+
"disabled": item.disabled
|
|
89
|
+
}, _isSlot(_slot = item[props.optionChildrenProp].map(childOption => createVNode(ItemView, mergeProps({
|
|
90
|
+
"key": childOption.value
|
|
91
|
+
}, childOption), null))) ? _slot : {
|
|
92
|
+
default: () => [_slot]
|
|
93
|
+
}) : createVNode(ElOption, mergeProps({
|
|
94
|
+
"key": item.value,
|
|
95
|
+
"value": item.value
|
|
96
|
+
}, item), {
|
|
97
|
+
default: () => slots.option ? slots.option(item) : item.label
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
return () => {
|
|
101
|
+
return props.data.map(item => ItemView(item));
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
var Options = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/select/src/options.vue"]]);
|
|
107
|
+
|
|
49
108
|
var _sfc_main$1 = defineComponent({
|
|
50
109
|
name: "VkfSelect",
|
|
51
110
|
components: {
|
|
52
111
|
VkfFormItem,
|
|
53
112
|
ElSelect,
|
|
54
|
-
ElOption
|
|
113
|
+
ElOption,
|
|
114
|
+
Options
|
|
55
115
|
},
|
|
56
116
|
props,
|
|
57
117
|
emits,
|
|
@@ -134,7 +194,7 @@ var _sfc_main$1 = defineComponent({
|
|
|
134
194
|
});
|
|
135
195
|
|
|
136
196
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
137
|
-
const
|
|
197
|
+
const _component_Options = resolveComponent("Options");
|
|
138
198
|
const _component_ElSelect = resolveComponent("ElSelect");
|
|
139
199
|
const _component_VkfFormItem = resolveComponent("VkfFormItem");
|
|
140
200
|
return openBlock(), createBlock(
|
|
@@ -152,29 +212,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
152
212
|
}
|
|
153
213
|
}, toHandlers(_ctx.selectOnEmits)), createSlots({
|
|
154
214
|
default: withCtx(() => [
|
|
155
|
-
(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
renderSlot(_ctx.$slots, "option", mergeProps({ ref_for: true }, item))
|
|
167
|
-
]),
|
|
168
|
-
_: 2
|
|
169
|
-
/* DYNAMIC */
|
|
170
|
-
},
|
|
171
|
-
1040
|
|
172
|
-
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
173
|
-
);
|
|
174
|
-
}),
|
|
175
|
-
128
|
|
176
|
-
/* KEYED_FRAGMENT */
|
|
177
|
-
))
|
|
215
|
+
createVNode(_component_Options, {
|
|
216
|
+
data: _ctx.selectOptions,
|
|
217
|
+
"option-children-prop": _ctx.optionChildrenProp
|
|
218
|
+
}, {
|
|
219
|
+
option: withCtx((e) => [
|
|
220
|
+
renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps(e)))
|
|
221
|
+
]),
|
|
222
|
+
_: 3
|
|
223
|
+
/* FORWARDED */
|
|
224
|
+
}, 8, ["data", "option-children-prop"]),
|
|
225
|
+
renderSlot(_ctx.$slots, "footer")
|
|
178
226
|
]),
|
|
179
227
|
_: 2
|
|
180
228
|
/* DYNAMIC */
|
|
@@ -18,6 +18,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
18
18
|
default: boolean;
|
|
19
19
|
};
|
|
20
20
|
slots: any;
|
|
21
|
+
optionChildrenProp: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
21
25
|
name: StringConstructor;
|
|
22
26
|
id: StringConstructor;
|
|
23
27
|
modelValue: {
|
|
@@ -444,6 +448,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
444
448
|
default: boolean;
|
|
445
449
|
};
|
|
446
450
|
slots: any;
|
|
451
|
+
optionChildrenProp: {
|
|
452
|
+
type: StringConstructor;
|
|
453
|
+
default: string;
|
|
454
|
+
};
|
|
447
455
|
name: StringConstructor;
|
|
448
456
|
id: StringConstructor;
|
|
449
457
|
modelValue: {
|
|
@@ -848,6 +856,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
848
856
|
selectSlots: import("./types").SelectSlots;
|
|
849
857
|
selectRef: any;
|
|
850
858
|
optionsUrl: string;
|
|
859
|
+
optionChildrenProp: string;
|
|
851
860
|
}, {}, {
|
|
852
861
|
VkfFormItem: {
|
|
853
862
|
new (...args: any[]): any;
|
|
@@ -1036,5 +1045,26 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1036
1045
|
disabled: boolean;
|
|
1037
1046
|
created: boolean;
|
|
1038
1047
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
|
|
1048
|
+
Options: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
1049
|
+
data: {
|
|
1050
|
+
type: import("vue").PropType<import("@vunk/shared").NormalObject[]>;
|
|
1051
|
+
required: true;
|
|
1052
|
+
};
|
|
1053
|
+
optionChildrenProp: {
|
|
1054
|
+
type: StringConstructor;
|
|
1055
|
+
default: string;
|
|
1056
|
+
};
|
|
1057
|
+
}>, () => JSX.Element[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1058
|
+
data: {
|
|
1059
|
+
type: import("vue").PropType<import("@vunk/shared").NormalObject[]>;
|
|
1060
|
+
required: true;
|
|
1061
|
+
};
|
|
1062
|
+
optionChildrenProp: {
|
|
1063
|
+
type: StringConstructor;
|
|
1064
|
+
default: string;
|
|
1065
|
+
};
|
|
1066
|
+
}>> & Readonly<{}>, {
|
|
1067
|
+
optionChildrenProp: string;
|
|
1068
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
1039
1069
|
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
1040
1070
|
export default _default;
|
|
@@ -11,7 +11,13 @@ export declare const props: {
|
|
|
11
11
|
type: PropType<SelectSlots>;
|
|
12
12
|
default: any;
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* @description el组件实例ref
|
|
16
|
+
*/
|
|
14
17
|
selectRef: any;
|
|
18
|
+
/**
|
|
19
|
+
* @description a url which's response is options
|
|
20
|
+
*/
|
|
15
21
|
optionsUrl: {
|
|
16
22
|
type: StringConstructor;
|
|
17
23
|
default: string;
|
|
@@ -23,7 +29,17 @@ export declare const props: {
|
|
|
23
29
|
type: BooleanConstructor;
|
|
24
30
|
default: boolean;
|
|
25
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* @description 同插槽
|
|
34
|
+
*/
|
|
26
35
|
slots: any;
|
|
36
|
+
/**
|
|
37
|
+
* @description 若 option中含有该字段内容,则渲染为 Group
|
|
38
|
+
*/
|
|
39
|
+
optionChildrenProp: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
27
43
|
name: StringConstructor;
|
|
28
44
|
id: StringConstructor;
|
|
29
45
|
modelValue: {
|
|
@@ -201,7 +217,7 @@ export declare const props: {
|
|
|
201
217
|
readonly default: true;
|
|
202
218
|
};
|
|
203
219
|
};
|
|
204
|
-
export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"required", keyof T2> | Extract<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"information", keyof T2> | Extract<"prop", keyof T2> | Extract<"defaultModelValue", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"rules", keyof T2> | Extract<"error", keyof T2> | Extract<"validateStatus", keyof T2> | Extract<"for", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"persistent", keyof T2> | Extract<"teleported", keyof T2> | Extract<"effect", keyof T2> | Extract<"popperClass", keyof T2> | Extract<"name", keyof T2> | Extract<"slots", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"clearable", keyof T2> | Extract<"multiple", keyof T2> | Extract<"stringify", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"filterMethod", keyof T2> | Extract<"loading", keyof T2> | Extract<"options", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"clearIcon", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"automaticDropdown", keyof T2> | Extract<"filterable", keyof T2> | Extract<"allowCreate", keyof T2> | Extract<"remote", keyof T2> | Extract<"loadingText", keyof T2> | Extract<"noMatchText", keyof T2> | Extract<"noDataText", keyof T2> | Extract<"remoteMethod", keyof T2> | Extract<"multipleLimit", keyof T2> | Extract<"defaultFirstOption", keyof T2> | Extract<"reserveKeyword", keyof T2> | Extract<"valueKey", keyof T2> | Extract<"collapseTags", keyof T2> | Extract<"collapseTagsTooltip", keyof T2> | Extract<"fitInputWidth", keyof T2> | Extract<"tagType", keyof T2> | Extract<"selectSlots", keyof T2> | Extract<"selectRef", keyof T2> | Extract<"optionsUrl", keyof T2>)[]>(propsArg: T2, excludes?: EX) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"required", keyof T2>, KE> | Exclude<Extract<"size", keyof T2>, KE> | Exclude<Extract<"formItemSize", keyof T2>, KE> | Exclude<Extract<"formItemSlots", keyof T2>, KE> | Exclude<Extract<"elRef", keyof T2>, KE> | Exclude<Extract<"inline", keyof T2>, KE> | Exclude<Extract<"readonly", keyof T2>, KE> | Exclude<Extract<"formItemTip", keyof T2>, KE> | Exclude<Extract<"formItemTipClass", keyof T2>, KE> | Exclude<Extract<"labelTip", keyof T2>, KE> | Exclude<Extract<"information", keyof T2>, KE> | Exclude<Extract<"prop", keyof T2>, KE> | Exclude<Extract<"defaultModelValue", keyof T2>, KE> | Exclude<Extract<"label", keyof T2>, KE> | Exclude<Extract<"labelWidth", keyof T2>, KE> | Exclude<Extract<"labelPosition", keyof T2>, KE> | Exclude<Extract<"rules", keyof T2>, KE> | Exclude<Extract<"error", keyof T2>, KE> | Exclude<Extract<"validateStatus", keyof T2>, KE> | Exclude<Extract<"for", keyof T2>, KE> | Exclude<Extract<"inlineMessage", keyof T2>, KE> | Exclude<Extract<"showMessage", keyof T2>, KE> | Exclude<Extract<"disabled", keyof T2>, KE> | Exclude<Extract<"id", keyof T2>, KE> | Exclude<Extract<"persistent", keyof T2>, KE> | Exclude<Extract<"teleported", keyof T2>, KE> | Exclude<Extract<"effect", keyof T2>, KE> | Exclude<Extract<"popperClass", keyof T2>, KE> | Exclude<Extract<"name", keyof T2>, KE> | Exclude<Extract<"slots", keyof T2>, KE> | Exclude<Extract<"modelValue", keyof T2>, KE> | Exclude<Extract<"clearable", keyof T2>, KE> | Exclude<Extract<"multiple", keyof T2>, KE> | Exclude<Extract<"stringify", keyof T2>, KE> | Exclude<Extract<"placeholder", keyof T2>, KE> | Exclude<Extract<"filterMethod", keyof T2>, KE> | Exclude<Extract<"loading", keyof T2>, KE> | Exclude<Extract<"options", keyof T2>, KE> | Exclude<Extract<"autocomplete", keyof T2>, KE> | Exclude<Extract<"clearIcon", keyof T2>, KE> | Exclude<Extract<"suffixIcon", keyof T2>, KE> | Exclude<Extract<"automaticDropdown", keyof T2>, KE> | Exclude<Extract<"filterable", keyof T2>, KE> | Exclude<Extract<"allowCreate", keyof T2>, KE> | Exclude<Extract<"remote", keyof T2>, KE> | Exclude<Extract<"loadingText", keyof T2>, KE> | Exclude<Extract<"noMatchText", keyof T2>, KE> | Exclude<Extract<"noDataText", keyof T2>, KE> | Exclude<Extract<"remoteMethod", keyof T2>, KE> | Exclude<Extract<"multipleLimit", keyof T2>, KE> | Exclude<Extract<"defaultFirstOption", keyof T2>, KE> | Exclude<Extract<"reserveKeyword", keyof T2>, KE> | Exclude<Extract<"valueKey", keyof T2>, KE> | Exclude<Extract<"collapseTags", keyof T2>, KE> | Exclude<Extract<"collapseTagsTooltip", keyof T2>, KE> | Exclude<Extract<"fitInputWidth", keyof T2>, KE> | Exclude<Extract<"tagType", keyof T2>, KE> | Exclude<Extract<"selectSlots", keyof T2>, KE> | Exclude<Extract<"selectRef", keyof T2>, KE> | Exclude<Extract<"optionsUrl", keyof T2>, KE> : Extract<"required", keyof T2> | Extract<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"information", keyof T2> | Extract<"prop", keyof T2> | Extract<"defaultModelValue", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"rules", keyof T2> | Extract<"error", keyof T2> | Extract<"validateStatus", keyof T2> | Extract<"for", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"persistent", keyof T2> | Extract<"teleported", keyof T2> | Extract<"effect", keyof T2> | Extract<"popperClass", keyof T2> | Extract<"name", keyof T2> | Extract<"slots", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"clearable", keyof T2> | Extract<"multiple", keyof T2> | Extract<"stringify", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"filterMethod", keyof T2> | Extract<"loading", keyof T2> | Extract<"options", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"clearIcon", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"automaticDropdown", keyof T2> | Extract<"filterable", keyof T2> | Extract<"allowCreate", keyof T2> | Extract<"remote", keyof T2> | Extract<"loadingText", keyof T2> | Extract<"noMatchText", keyof T2> | Extract<"noDataText", keyof T2> | Extract<"remoteMethod", keyof T2> | Extract<"multipleLimit", keyof T2> | Extract<"defaultFirstOption", keyof T2> | Extract<"reserveKeyword", keyof T2> | Extract<"valueKey", keyof T2> | Extract<"collapseTags", keyof T2> | Extract<"collapseTagsTooltip", keyof T2> | Extract<"fitInputWidth", keyof T2> | Extract<"tagType", keyof T2> | Extract<"selectSlots", keyof T2> | Extract<"selectRef", keyof T2> | Extract<"optionsUrl", keyof T2>]: { [k in Extract<"required", keyof T2> | Extract<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"information", keyof T2> | Extract<"prop", keyof T2> | Extract<"defaultModelValue", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"rules", keyof T2> | Extract<"error", keyof T2> | Extract<"validateStatus", keyof T2> | Extract<"for", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"persistent", keyof T2> | Extract<"teleported", keyof T2> | Extract<"effect", keyof T2> | Extract<"popperClass", keyof T2> | Extract<"name", keyof T2> | Extract<"slots", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"clearable", keyof T2> | Extract<"multiple", keyof T2> | Extract<"stringify", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"filterMethod", keyof T2> | Extract<"loading", keyof T2> | Extract<"options", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"clearIcon", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"automaticDropdown", keyof T2> | Extract<"filterable", keyof T2> | Extract<"allowCreate", keyof T2> | Extract<"remote", keyof T2> | Extract<"loadingText", keyof T2> | Extract<"noMatchText", keyof T2> | Extract<"noDataText", keyof T2> | Extract<"remoteMethod", keyof T2> | Extract<"multipleLimit", keyof T2> | Extract<"defaultFirstOption", keyof T2> | Extract<"reserveKeyword", keyof T2> | Extract<"valueKey", keyof T2> | Extract<"collapseTags", keyof T2> | Extract<"collapseTagsTooltip", keyof T2> | Extract<"fitInputWidth", keyof T2> | Extract<"tagType", keyof T2> | Extract<"selectSlots", keyof T2> | Extract<"selectRef", keyof T2> | Extract<"optionsUrl", keyof T2>]: T2[k]; }[P]; }>;
|
|
220
|
+
export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"required", keyof T2> | Extract<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"information", keyof T2> | Extract<"prop", keyof T2> | Extract<"defaultModelValue", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"rules", keyof T2> | Extract<"error", keyof T2> | Extract<"validateStatus", keyof T2> | Extract<"for", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"persistent", keyof T2> | Extract<"teleported", keyof T2> | Extract<"effect", keyof T2> | Extract<"popperClass", keyof T2> | Extract<"name", keyof T2> | Extract<"slots", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"clearable", keyof T2> | Extract<"multiple", keyof T2> | Extract<"stringify", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"filterMethod", keyof T2> | Extract<"loading", keyof T2> | Extract<"options", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"clearIcon", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"automaticDropdown", keyof T2> | Extract<"filterable", keyof T2> | Extract<"allowCreate", keyof T2> | Extract<"remote", keyof T2> | Extract<"loadingText", keyof T2> | Extract<"noMatchText", keyof T2> | Extract<"noDataText", keyof T2> | Extract<"remoteMethod", keyof T2> | Extract<"multipleLimit", keyof T2> | Extract<"defaultFirstOption", keyof T2> | Extract<"reserveKeyword", keyof T2> | Extract<"valueKey", keyof T2> | Extract<"collapseTags", keyof T2> | Extract<"collapseTagsTooltip", keyof T2> | Extract<"fitInputWidth", keyof T2> | Extract<"tagType", keyof T2> | Extract<"selectSlots", keyof T2> | Extract<"selectRef", keyof T2> | Extract<"optionsUrl", keyof T2> | Extract<"optionChildrenProp", keyof T2>)[]>(propsArg: T2, excludes?: EX) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"required", keyof T2>, KE> | Exclude<Extract<"size", keyof T2>, KE> | Exclude<Extract<"formItemSize", keyof T2>, KE> | Exclude<Extract<"formItemSlots", keyof T2>, KE> | Exclude<Extract<"elRef", keyof T2>, KE> | Exclude<Extract<"inline", keyof T2>, KE> | Exclude<Extract<"readonly", keyof T2>, KE> | Exclude<Extract<"formItemTip", keyof T2>, KE> | Exclude<Extract<"formItemTipClass", keyof T2>, KE> | Exclude<Extract<"labelTip", keyof T2>, KE> | Exclude<Extract<"information", keyof T2>, KE> | Exclude<Extract<"prop", keyof T2>, KE> | Exclude<Extract<"defaultModelValue", keyof T2>, KE> | Exclude<Extract<"label", keyof T2>, KE> | Exclude<Extract<"labelWidth", keyof T2>, KE> | Exclude<Extract<"labelPosition", keyof T2>, KE> | Exclude<Extract<"rules", keyof T2>, KE> | Exclude<Extract<"error", keyof T2>, KE> | Exclude<Extract<"validateStatus", keyof T2>, KE> | Exclude<Extract<"for", keyof T2>, KE> | Exclude<Extract<"inlineMessage", keyof T2>, KE> | Exclude<Extract<"showMessage", keyof T2>, KE> | Exclude<Extract<"disabled", keyof T2>, KE> | Exclude<Extract<"id", keyof T2>, KE> | Exclude<Extract<"persistent", keyof T2>, KE> | Exclude<Extract<"teleported", keyof T2>, KE> | Exclude<Extract<"effect", keyof T2>, KE> | Exclude<Extract<"popperClass", keyof T2>, KE> | Exclude<Extract<"name", keyof T2>, KE> | Exclude<Extract<"slots", keyof T2>, KE> | Exclude<Extract<"modelValue", keyof T2>, KE> | Exclude<Extract<"clearable", keyof T2>, KE> | Exclude<Extract<"multiple", keyof T2>, KE> | Exclude<Extract<"stringify", keyof T2>, KE> | Exclude<Extract<"placeholder", keyof T2>, KE> | Exclude<Extract<"filterMethod", keyof T2>, KE> | Exclude<Extract<"loading", keyof T2>, KE> | Exclude<Extract<"options", keyof T2>, KE> | Exclude<Extract<"autocomplete", keyof T2>, KE> | Exclude<Extract<"clearIcon", keyof T2>, KE> | Exclude<Extract<"suffixIcon", keyof T2>, KE> | Exclude<Extract<"automaticDropdown", keyof T2>, KE> | Exclude<Extract<"filterable", keyof T2>, KE> | Exclude<Extract<"allowCreate", keyof T2>, KE> | Exclude<Extract<"remote", keyof T2>, KE> | Exclude<Extract<"loadingText", keyof T2>, KE> | Exclude<Extract<"noMatchText", keyof T2>, KE> | Exclude<Extract<"noDataText", keyof T2>, KE> | Exclude<Extract<"remoteMethod", keyof T2>, KE> | Exclude<Extract<"multipleLimit", keyof T2>, KE> | Exclude<Extract<"defaultFirstOption", keyof T2>, KE> | Exclude<Extract<"reserveKeyword", keyof T2>, KE> | Exclude<Extract<"valueKey", keyof T2>, KE> | Exclude<Extract<"collapseTags", keyof T2>, KE> | Exclude<Extract<"collapseTagsTooltip", keyof T2>, KE> | Exclude<Extract<"fitInputWidth", keyof T2>, KE> | Exclude<Extract<"tagType", keyof T2>, KE> | Exclude<Extract<"selectSlots", keyof T2>, KE> | Exclude<Extract<"selectRef", keyof T2>, KE> | Exclude<Extract<"optionsUrl", keyof T2>, KE> | Exclude<Extract<"optionChildrenProp", keyof T2>, KE> : Extract<"required", keyof T2> | Extract<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"information", keyof T2> | Extract<"prop", keyof T2> | Extract<"defaultModelValue", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"rules", keyof T2> | Extract<"error", keyof T2> | Extract<"validateStatus", keyof T2> | Extract<"for", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"persistent", keyof T2> | Extract<"teleported", keyof T2> | Extract<"effect", keyof T2> | Extract<"popperClass", keyof T2> | Extract<"name", keyof T2> | Extract<"slots", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"clearable", keyof T2> | Extract<"multiple", keyof T2> | Extract<"stringify", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"filterMethod", keyof T2> | Extract<"loading", keyof T2> | Extract<"options", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"clearIcon", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"automaticDropdown", keyof T2> | Extract<"filterable", keyof T2> | Extract<"allowCreate", keyof T2> | Extract<"remote", keyof T2> | Extract<"loadingText", keyof T2> | Extract<"noMatchText", keyof T2> | Extract<"noDataText", keyof T2> | Extract<"remoteMethod", keyof T2> | Extract<"multipleLimit", keyof T2> | Extract<"defaultFirstOption", keyof T2> | Extract<"reserveKeyword", keyof T2> | Extract<"valueKey", keyof T2> | Extract<"collapseTags", keyof T2> | Extract<"collapseTagsTooltip", keyof T2> | Extract<"fitInputWidth", keyof T2> | Extract<"tagType", keyof T2> | Extract<"selectSlots", keyof T2> | Extract<"selectRef", keyof T2> | Extract<"optionsUrl", keyof T2> | Extract<"optionChildrenProp", keyof T2>]: { [k in Extract<"required", keyof T2> | Extract<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"information", keyof T2> | Extract<"prop", keyof T2> | Extract<"defaultModelValue", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"rules", keyof T2> | Extract<"error", keyof T2> | Extract<"validateStatus", keyof T2> | Extract<"for", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"persistent", keyof T2> | Extract<"teleported", keyof T2> | Extract<"effect", keyof T2> | Extract<"popperClass", keyof T2> | Extract<"name", keyof T2> | Extract<"slots", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"clearable", keyof T2> | Extract<"multiple", keyof T2> | Extract<"stringify", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"filterMethod", keyof T2> | Extract<"loading", keyof T2> | Extract<"options", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"clearIcon", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"automaticDropdown", keyof T2> | Extract<"filterable", keyof T2> | Extract<"allowCreate", keyof T2> | Extract<"remote", keyof T2> | Extract<"loadingText", keyof T2> | Extract<"noMatchText", keyof T2> | Extract<"noDataText", keyof T2> | Extract<"remoteMethod", keyof T2> | Extract<"multipleLimit", keyof T2> | Extract<"defaultFirstOption", keyof T2> | Extract<"reserveKeyword", keyof T2> | Extract<"valueKey", keyof T2> | Extract<"collapseTags", keyof T2> | Extract<"collapseTagsTooltip", keyof T2> | Extract<"fitInputWidth", keyof T2> | Extract<"tagType", keyof T2> | Extract<"selectSlots", keyof T2> | Extract<"selectRef", keyof T2> | Extract<"optionsUrl", keyof T2> | Extract<"optionChildrenProp", keyof T2>]: T2[k]; }[P]; }>;
|
|
205
221
|
export declare const emits: {
|
|
206
222
|
'update:modelValue': any;
|
|
207
223
|
change: any;
|
|
@@ -17,6 +17,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
17
17
|
default: boolean;
|
|
18
18
|
};
|
|
19
19
|
slots: any;
|
|
20
|
+
optionChildrenProp: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
20
24
|
name: StringConstructor;
|
|
21
25
|
id: StringConstructor;
|
|
22
26
|
modelValue: {
|
|
@@ -222,6 +226,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
222
226
|
default: boolean;
|
|
223
227
|
};
|
|
224
228
|
slots: any;
|
|
229
|
+
optionChildrenProp: {
|
|
230
|
+
type: StringConstructor;
|
|
231
|
+
default: string;
|
|
232
|
+
};
|
|
225
233
|
name: StringConstructor;
|
|
226
234
|
id: StringConstructor;
|
|
227
235
|
modelValue: {
|
|
@@ -626,5 +634,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
626
634
|
selectSlots: import("./types").SelectSlots;
|
|
627
635
|
selectRef: any;
|
|
628
636
|
optionsUrl: string;
|
|
637
|
+
optionChildrenProp: string;
|
|
629
638
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
630
639
|
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NormalObject } from '@vunk/shared';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
data: {
|
|
5
|
+
type: PropType<NormalObject[]>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
optionChildrenProp: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
}>, () => JSX.Element[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
data: {
|
|
14
|
+
type: PropType<NormalObject[]>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
optionChildrenProp: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
}>> & Readonly<{}>, {
|
|
22
|
+
optionChildrenProp: string;
|
|
23
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
export default _default;
|
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.1",
|
|
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",
|