@vunk/form 0.0.1-alpha.27 → 0.0.1-alpha.29
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/radio/index.js +6 -1
- package/components/radio/src/ctx.d.ts +4 -1
- package/components/radio/src/ctx.js +5 -1
- package/components/radio/src/index.vue.d.ts +9 -4
- package/components/upload/index.d.ts +1 -0
- package/components/upload/index.js +12 -1
- package/components/upload/src/ctx.d.ts +5 -0
- package/components/upload/src/ctx.js +4 -1
- package/package.json +1 -1
- package/shared/infer-prop/index.d.ts +1 -0
- package/shared/infer-prop/index.js +9 -4
- package/shared/types/renderer-source/compoent.d.ts +1 -0
|
@@ -32,7 +32,11 @@ const props = __spreadProps(__spreadValues(__spreadValues({}, _VkfFormItemCtx.pr
|
|
|
32
32
|
type: {
|
|
33
33
|
type: String,
|
|
34
34
|
default: "default"
|
|
35
|
-
}
|
|
35
|
+
},
|
|
36
|
+
modelValue: {
|
|
37
|
+
type: [String, Number]
|
|
38
|
+
},
|
|
39
|
+
defaultModelValue: null
|
|
36
40
|
});
|
|
37
41
|
const emits = __spreadValues({}, radioGroupEmits);
|
|
38
42
|
|
|
@@ -54,6 +58,7 @@ var script = defineComponent({
|
|
|
54
58
|
return props2.options.filter((item) => item.value !== void 0 && item.value !== null);
|
|
55
59
|
});
|
|
56
60
|
const readonly = useComputedReadonly(props2);
|
|
61
|
+
!props2.modelValue && props2.defaultModelValue && emit("update:modelValue", props2.defaultModelValue);
|
|
57
62
|
return {
|
|
58
63
|
formItemBindProps,
|
|
59
64
|
coreBindProps,
|
|
@@ -9,6 +9,10 @@ export declare const props: {
|
|
|
9
9
|
type: PropType<"default" | "button">;
|
|
10
10
|
default: string;
|
|
11
11
|
};
|
|
12
|
+
modelValue: {
|
|
13
|
+
type: PropType<string | number>;
|
|
14
|
+
};
|
|
15
|
+
defaultModelValue: null;
|
|
12
16
|
id: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
13
17
|
size: {
|
|
14
18
|
readonly type: PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
@@ -17,7 +21,6 @@ export declare const props: {
|
|
|
17
21
|
__epPropKey: true;
|
|
18
22
|
};
|
|
19
23
|
disabled: BooleanConstructor;
|
|
20
|
-
modelValue: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown, "", boolean>;
|
|
21
24
|
fill: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
22
25
|
label: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
23
26
|
textColor: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
@@ -28,7 +28,11 @@ const props = __spreadProps(__spreadValues(__spreadValues({}, _VkfFormItemCtx.pr
|
|
|
28
28
|
type: {
|
|
29
29
|
type: String,
|
|
30
30
|
default: "default"
|
|
31
|
-
}
|
|
31
|
+
},
|
|
32
|
+
modelValue: {
|
|
33
|
+
type: [String, Number]
|
|
34
|
+
},
|
|
35
|
+
defaultModelValue: null
|
|
32
36
|
});
|
|
33
37
|
const emits = __spreadValues({}, radioGroupEmits);
|
|
34
38
|
|
|
@@ -7,6 +7,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7
7
|
type: import("vue").PropType<"default" | "button">;
|
|
8
8
|
default: string;
|
|
9
9
|
};
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: import("vue").PropType<string | number>;
|
|
12
|
+
};
|
|
13
|
+
defaultModelValue: null;
|
|
10
14
|
id: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
11
15
|
size: {
|
|
12
16
|
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
@@ -15,7 +19,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
15
19
|
__epPropKey: true;
|
|
16
20
|
};
|
|
17
21
|
disabled: BooleanConstructor;
|
|
18
|
-
modelValue: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown, "", boolean>;
|
|
19
22
|
fill: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
20
23
|
label: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
21
24
|
textColor: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
@@ -90,7 +93,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
90
93
|
name: string | undefined;
|
|
91
94
|
id: string | undefined;
|
|
92
95
|
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
93
|
-
modelValue:
|
|
96
|
+
modelValue: string | number | undefined;
|
|
94
97
|
textColor: string;
|
|
95
98
|
}>;
|
|
96
99
|
coreOnEmits: {
|
|
@@ -115,6 +118,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
115
118
|
type: import("vue").PropType<"default" | "button">;
|
|
116
119
|
default: string;
|
|
117
120
|
};
|
|
121
|
+
modelValue: {
|
|
122
|
+
type: import("vue").PropType<string | number>;
|
|
123
|
+
};
|
|
124
|
+
defaultModelValue: null;
|
|
118
125
|
id: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
119
126
|
size: {
|
|
120
127
|
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
@@ -123,7 +130,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
123
130
|
__epPropKey: true;
|
|
124
131
|
};
|
|
125
132
|
disabled: BooleanConstructor;
|
|
126
|
-
modelValue: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown, "", boolean>;
|
|
127
133
|
fill: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
128
134
|
label: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
129
135
|
textColor: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
@@ -192,7 +198,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
192
198
|
disabled: boolean;
|
|
193
199
|
id: string;
|
|
194
200
|
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
195
|
-
modelValue: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown>;
|
|
196
201
|
options: import("../../../shared/types/form").RadioProps[];
|
|
197
202
|
textColor: string;
|
|
198
203
|
}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
|
|
2
|
+
import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
|
|
2
3
|
import { uploadProps, ElProgress, ElIcon, useNamespace, useLocale, ElUpload, ElLink } from 'element-plus';
|
|
3
4
|
import { openBlock, createElementBlock, createElementVNode, defineComponent, resolveComponent, Fragment, createCommentVNode, normalizeClass, createBlock, withModifiers, createVNode, withCtx, toDisplayString, normalizeStyle, shallowRef, normalizeProps, guardReactiveProps, mergeProps, createSlots, renderSlot, createTextVNode } from 'vue';
|
|
4
5
|
import { pickObject } from '@vunk/core/shared/utils-object';
|
|
@@ -36,10 +37,20 @@ const props = __spreadProps(__spreadValues(__spreadValues({}, _VkfFormItemCtx.pr
|
|
|
36
37
|
default: ""
|
|
37
38
|
}
|
|
38
39
|
});
|
|
40
|
+
const createBindProps = bindPropsFactory(props);
|
|
39
41
|
const emits = {
|
|
40
42
|
"update:fileList": null,
|
|
41
43
|
"remove": (e) => e
|
|
42
44
|
};
|
|
45
|
+
const createOnEmits = onEmitsFactory(emits);
|
|
46
|
+
|
|
47
|
+
var ctx = /*#__PURE__*/Object.freeze({
|
|
48
|
+
__proto__: null,
|
|
49
|
+
props: props,
|
|
50
|
+
createBindProps: createBindProps,
|
|
51
|
+
emits: emits,
|
|
52
|
+
createOnEmits: createOnEmits
|
|
53
|
+
});
|
|
43
54
|
|
|
44
55
|
/*! Element Plus Icons Vue v2.0.9 */
|
|
45
56
|
|
|
@@ -482,4 +493,4 @@ script.install = (app) => {
|
|
|
482
493
|
app.component(script.name, script);
|
|
483
494
|
};
|
|
484
495
|
|
|
485
|
-
export { script as VkfUpload, types as __VkfUpload, script as default };
|
|
496
|
+
export { script as VkfUpload, ctx as _VkfUploadCtx, types as __VkfUpload, script as default };
|
|
@@ -162,7 +162,12 @@ export declare const props: {
|
|
|
162
162
|
default: undefined;
|
|
163
163
|
};
|
|
164
164
|
};
|
|
165
|
+
export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"required", keyof T2> | Extract<"type", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"prop", 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<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"name", keyof T2> | Extract<"data", keyof T2> | Extract<"disabled", keyof T2> | Extract<"drag", keyof T2> | Extract<"multiple", keyof T2> | Extract<"onChange", keyof T2> | Extract<"onRemove", keyof T2> | Extract<"listType", keyof T2> | Extract<"onPreview", keyof T2> | Extract<"preview", keyof T2> | Extract<"method", keyof T2> | Extract<"beforeUpload", keyof T2> | Extract<"beforeRemove", keyof T2> | Extract<"onSuccess", keyof T2> | Extract<"onProgress", keyof T2> | Extract<"onError", keyof T2> | Extract<"onExceed", keyof T2> | Extract<"action", keyof T2> | Extract<"headers", keyof T2> | Extract<"withCredentials", keyof T2> | Extract<"showFileList", keyof T2> | Extract<"accept", keyof T2> | Extract<"fileList", keyof T2> | Extract<"autoUpload", keyof T2> | Extract<"httpRequest", keyof T2> | Extract<"limit", keyof T2> | Extract<"tip", keyof T2>)[] | undefined>(propsArg: T2, excludes?: EX | undefined) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"required", keyof T2>, KE> | Exclude<Extract<"type", keyof T2>, KE> | Exclude<Extract<"label", keyof T2>, KE> | Exclude<Extract<"labelWidth", keyof T2>, KE> | Exclude<Extract<"prop", 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<"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<"name", keyof T2>, KE> | Exclude<Extract<"data", keyof T2>, KE> | Exclude<Extract<"disabled", keyof T2>, KE> | Exclude<Extract<"drag", keyof T2>, KE> | Exclude<Extract<"multiple", keyof T2>, KE> | Exclude<Extract<"onChange", keyof T2>, KE> | Exclude<Extract<"onRemove", keyof T2>, KE> | Exclude<Extract<"listType", keyof T2>, KE> | Exclude<Extract<"onPreview", keyof T2>, KE> | Exclude<Extract<"preview", keyof T2>, KE> | Exclude<Extract<"method", keyof T2>, KE> | Exclude<Extract<"beforeUpload", keyof T2>, KE> | Exclude<Extract<"beforeRemove", keyof T2>, KE> | Exclude<Extract<"onSuccess", keyof T2>, KE> | Exclude<Extract<"onProgress", keyof T2>, KE> | Exclude<Extract<"onError", keyof T2>, KE> | Exclude<Extract<"onExceed", keyof T2>, KE> | Exclude<Extract<"action", keyof T2>, KE> | Exclude<Extract<"headers", keyof T2>, KE> | Exclude<Extract<"withCredentials", keyof T2>, KE> | Exclude<Extract<"showFileList", keyof T2>, KE> | Exclude<Extract<"accept", keyof T2>, KE> | Exclude<Extract<"fileList", keyof T2>, KE> | Exclude<Extract<"autoUpload", keyof T2>, KE> | Exclude<Extract<"httpRequest", keyof T2>, KE> | Exclude<Extract<"limit", keyof T2>, KE> | Exclude<Extract<"tip", keyof T2>, KE> : Extract<"required", keyof T2> | Extract<"type", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"prop", 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<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"name", keyof T2> | Extract<"data", keyof T2> | Extract<"disabled", keyof T2> | Extract<"drag", keyof T2> | Extract<"multiple", keyof T2> | Extract<"onChange", keyof T2> | Extract<"onRemove", keyof T2> | Extract<"listType", keyof T2> | Extract<"onPreview", keyof T2> | Extract<"preview", keyof T2> | Extract<"method", keyof T2> | Extract<"beforeUpload", keyof T2> | Extract<"beforeRemove", keyof T2> | Extract<"onSuccess", keyof T2> | Extract<"onProgress", keyof T2> | Extract<"onError", keyof T2> | Extract<"onExceed", keyof T2> | Extract<"action", keyof T2> | Extract<"headers", keyof T2> | Extract<"withCredentials", keyof T2> | Extract<"showFileList", keyof T2> | Extract<"accept", keyof T2> | Extract<"fileList", keyof T2> | Extract<"autoUpload", keyof T2> | Extract<"httpRequest", keyof T2> | Extract<"limit", keyof T2> | Extract<"tip", keyof T2>]: { [k in Extract<"required", keyof T2> | Extract<"type", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"prop", 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<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"name", keyof T2> | Extract<"data", keyof T2> | Extract<"disabled", keyof T2> | Extract<"drag", keyof T2> | Extract<"multiple", keyof T2> | Extract<"onChange", keyof T2> | Extract<"onRemove", keyof T2> | Extract<"listType", keyof T2> | Extract<"onPreview", keyof T2> | Extract<"preview", keyof T2> | Extract<"method", keyof T2> | Extract<"beforeUpload", keyof T2> | Extract<"beforeRemove", keyof T2> | Extract<"onSuccess", keyof T2> | Extract<"onProgress", keyof T2> | Extract<"onError", keyof T2> | Extract<"onExceed", keyof T2> | Extract<"action", keyof T2> | Extract<"headers", keyof T2> | Extract<"withCredentials", keyof T2> | Extract<"showFileList", keyof T2> | Extract<"accept", keyof T2> | Extract<"fileList", keyof T2> | Extract<"autoUpload", keyof T2> | Extract<"httpRequest", keyof T2> | Extract<"limit", keyof T2> | Extract<"tip", keyof T2>]: T2[k]; }[P]; }>;
|
|
165
166
|
export declare const emits: {
|
|
166
167
|
'update:fileList': null;
|
|
167
168
|
remove: (e: UploadFile) => UploadFile;
|
|
168
169
|
};
|
|
170
|
+
export declare const createOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("remove" | "update:fileList")[] | undefined>(emit: T2, excludes?: EX | undefined) => { [P in EX extends (infer KE)[] ? Exclude<"remove", KE> | Exclude<"update:fileList", KE> : "remove" | "update:fileList"]: {
|
|
171
|
+
'update:fileList': (...e: import("@vunk/core").RestParameters<T2>) => void;
|
|
172
|
+
remove: (...e: import("@vunk/core").RestParameters<T2>) => void;
|
|
173
|
+
}[P]; };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { _VkfFormItemCtx } from '@vunk/form/components/form-item';
|
|
2
|
+
import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
|
|
2
3
|
import { uploadProps } from 'element-plus';
|
|
3
4
|
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
@@ -30,9 +31,11 @@ const props = __spreadProps(__spreadValues(__spreadValues({}, _VkfFormItemCtx.pr
|
|
|
30
31
|
default: ""
|
|
31
32
|
}
|
|
32
33
|
});
|
|
34
|
+
const createBindProps = bindPropsFactory(props);
|
|
33
35
|
const emits = {
|
|
34
36
|
"update:fileList": null,
|
|
35
37
|
"remove": (e) => e
|
|
36
38
|
};
|
|
39
|
+
const createOnEmits = onEmitsFactory(emits);
|
|
37
40
|
|
|
38
|
-
export { emits, props };
|
|
41
|
+
export { createBindProps, createOnEmits, emits, props };
|
package/package.json
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
const inferString = (item) => ({
|
|
2
2
|
prop: item.prop,
|
|
3
|
-
type: "
|
|
3
|
+
type: "String"
|
|
4
4
|
});
|
|
5
5
|
const inferBoolean = (item) => ({
|
|
6
6
|
prop: item.prop,
|
|
7
|
-
type: "
|
|
7
|
+
type: "Boolean"
|
|
8
8
|
});
|
|
9
9
|
const inferNumber = (item) => {
|
|
10
10
|
const info = {
|
|
11
11
|
prop: item.prop,
|
|
12
|
-
type: "
|
|
12
|
+
type: "Number"
|
|
13
13
|
};
|
|
14
14
|
if (item.precision) {
|
|
15
15
|
info.precision = item.precision;
|
|
16
16
|
}
|
|
17
17
|
return info;
|
|
18
18
|
};
|
|
19
|
+
const inferDate = (item) => ({
|
|
20
|
+
prop: item.prop,
|
|
21
|
+
type: "Date"
|
|
22
|
+
});
|
|
19
23
|
const propInfoAction = {
|
|
20
24
|
VkfSelect: inferString,
|
|
21
25
|
VkfRadio: inferString,
|
|
@@ -23,7 +27,8 @@ const propInfoAction = {
|
|
|
23
27
|
VkfColorPicker: inferString,
|
|
24
28
|
VkfInputNumber: inferNumber,
|
|
25
29
|
VkfSwitch: inferBoolean,
|
|
26
|
-
VkfUpload: inferString
|
|
30
|
+
VkfUpload: inferString,
|
|
31
|
+
VkfDatePicker: inferDate
|
|
27
32
|
};
|
|
28
33
|
|
|
29
34
|
export { propInfoAction };
|