@vunk/form 0.0.1-alpha.13 → 0.0.1-alpha.16
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/checkbox/index.d.ts +4 -0
- package/components/checkbox/index.js +107 -0
- package/components/checkbox/src/ctx.d.ts +95 -0
- package/components/checkbox/src/ctx.js +35 -0
- package/components/checkbox/src/index.vue.d.ts +241 -0
- package/components/checkbox/src/types.d.ts +1 -0
- package/components/checkbox/src/types.js +1 -0
- package/components/date-picker/src/ctx.d.ts +1 -1
- package/components/date-picker/src/index.vue.d.ts +13 -13
- package/components/form-item-renderer/index.js +2 -2
- package/components/form-item-renderer-template-default/index.js +62 -14
- package/components/form-item-renderer-template-layout/index.js +6 -6
- package/components/input/src/ctx.d.ts +1 -1
- package/components/input/src/index.vue.d.ts +7 -7
- package/components/input-number/src/index.vue.d.ts +12 -12
- package/components/radio/index.d.ts +4 -0
- package/components/radio/index.js +107 -0
- package/components/radio/src/ctx.d.ts +66 -0
- package/components/radio/src/ctx.js +35 -0
- package/components/radio/src/index.vue.d.ts +179 -0
- package/components/radio/src/types.d.ts +1 -0
- package/components/radio/src/types.js +1 -0
- package/components/select/src/index.vue.d.ts +26 -26
- package/components/switch/src/index.vue.d.ts +5 -5
- package/components/upload/index.css +10 -0
- package/components/upload/index.d.ts +4 -0
- package/components/upload/index.js +473 -0
- package/components/upload/src/ctx.d.ts +160 -0
- package/components/upload/src/ctx.js +38 -0
- package/components/upload/src/file.vue.d.ts +96 -0
- package/components/upload/src/index.vue.d.ts +401 -0
- package/components/upload/src/types.d.ts +1 -0
- package/components/upload/src/types.js +1 -0
- package/index.css +11 -0
- package/package.json +4 -1
- package/shared/element-plus/ctx.d.ts +16 -5
- package/shared/element-plus/index.js +7 -2
- package/shared/types/form/checkbox.d.ts +13 -0
- package/shared/types/form/index.d.ts +2 -0
- package/shared/types/form/index.js +1 -0
- package/shared/types/form/radio.d.ts +8 -0
- package/shared/types/renderer-source/checkbox.d.ts +7 -0
- package/shared/types/renderer-source/index.d.ts +7 -1
- package/shared/types/renderer-source/radio.d.ts +7 -0
- package/shared/types/renderer-source/upload.d.ts +7 -0
|
@@ -7,6 +7,9 @@ import { VkfDatePicker } from '@vunk/form/components/date-picker';
|
|
|
7
7
|
import { getValue } from '@vunk/core/shared/helper';
|
|
8
8
|
import { pickObject } from '@vunk/core/shared/utils-object';
|
|
9
9
|
import { VkfInputNumber } from '@vunk/form/components/input-number';
|
|
10
|
+
import { VkfRadio } from '@vunk/form/components/radio';
|
|
11
|
+
import { VkfCheckbox } from '@vunk/form/components/checkbox';
|
|
12
|
+
import { VkfUpload } from '@vunk/form/components/upload';
|
|
10
13
|
|
|
11
14
|
const props = {
|
|
12
15
|
data: {
|
|
@@ -26,7 +29,10 @@ var script = defineComponent({
|
|
|
26
29
|
VkfSwitch,
|
|
27
30
|
VkfSelect,
|
|
28
31
|
VkfDatePicker,
|
|
29
|
-
VkfInputNumber
|
|
32
|
+
VkfInputNumber,
|
|
33
|
+
VkfRadio,
|
|
34
|
+
VkfCheckbox,
|
|
35
|
+
VkfUpload
|
|
30
36
|
},
|
|
31
37
|
emits,
|
|
32
38
|
props,
|
|
@@ -39,16 +45,58 @@ var script = defineComponent({
|
|
|
39
45
|
});
|
|
40
46
|
|
|
41
47
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
42
|
-
const
|
|
48
|
+
const _component_VkfUpload = resolveComponent("VkfUpload");
|
|
43
49
|
const _component_VkfFormItemRendererTemplate = resolveComponent("VkfFormItemRendererTemplate");
|
|
50
|
+
const _component_VkfCheckbox = resolveComponent("VkfCheckbox");
|
|
51
|
+
const _component_VkfRadio = resolveComponent("VkfRadio");
|
|
52
|
+
const _component_VkfInput = resolveComponent("VkfInput");
|
|
44
53
|
const _component_VkfSwitch = resolveComponent("VkfSwitch");
|
|
45
54
|
const _component_VkfSelect = resolveComponent("VkfSelect");
|
|
46
55
|
const _component_VkfDatePicker = resolveComponent("VkfDatePicker");
|
|
47
56
|
const _component_VkfInputNumber = resolveComponent("VkfInputNumber");
|
|
48
57
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
58
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfUpload" }, {
|
|
59
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
60
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfUpload, mergeProps({
|
|
61
|
+
key: 0,
|
|
62
|
+
fileList: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
63
|
+
"onUpdate:fileList": ($event) => _ctx.$emit("setData", {
|
|
64
|
+
k: sourceData.prop,
|
|
65
|
+
v: $event
|
|
66
|
+
})
|
|
67
|
+
}, sourceData), null, 16, ["fileList", "onUpdate:fileList"])) : createCommentVNode("v-if", true)
|
|
68
|
+
]),
|
|
69
|
+
_: 1
|
|
70
|
+
}),
|
|
71
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfCheckbox" }, {
|
|
72
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
73
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfCheckbox, mergeProps({
|
|
74
|
+
key: 0,
|
|
75
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
76
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
77
|
+
k: sourceData.prop,
|
|
78
|
+
v: $event
|
|
79
|
+
})
|
|
80
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
81
|
+
]),
|
|
82
|
+
_: 1
|
|
83
|
+
}),
|
|
84
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfRadio" }, {
|
|
85
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
86
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfRadio, mergeProps({
|
|
87
|
+
key: 0,
|
|
88
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
89
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
90
|
+
k: sourceData.prop,
|
|
91
|
+
v: $event
|
|
92
|
+
})
|
|
93
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
}),
|
|
49
97
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfInput" }, {
|
|
50
|
-
default: withCtx(({ data: sourceData,
|
|
51
|
-
|
|
98
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
99
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfInput, mergeProps({
|
|
52
100
|
key: 0,
|
|
53
101
|
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
54
102
|
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
@@ -60,8 +108,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
60
108
|
_: 1
|
|
61
109
|
}),
|
|
62
110
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfSwitch" }, {
|
|
63
|
-
default: withCtx(({ data: sourceData,
|
|
64
|
-
|
|
111
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
112
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfSwitch, mergeProps({
|
|
65
113
|
key: 0,
|
|
66
114
|
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
67
115
|
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
@@ -73,8 +121,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
73
121
|
_: 1
|
|
74
122
|
}),
|
|
75
123
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfSelect" }, {
|
|
76
|
-
default: withCtx(({ data: sourceData,
|
|
77
|
-
|
|
124
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
125
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfSelect, mergeProps({
|
|
78
126
|
key: 0,
|
|
79
127
|
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
80
128
|
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
@@ -86,8 +134,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
86
134
|
_: 1
|
|
87
135
|
}),
|
|
88
136
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfDatePicker" }, {
|
|
89
|
-
default: withCtx(({ data: sourceData,
|
|
90
|
-
|
|
137
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
138
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfDatePicker, mergeProps({
|
|
91
139
|
key: 0,
|
|
92
140
|
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
93
141
|
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
@@ -99,8 +147,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
99
147
|
_: 1
|
|
100
148
|
}),
|
|
101
149
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfInputNumber" }, {
|
|
102
|
-
default: withCtx(({ data: sourceData,
|
|
103
|
-
|
|
150
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
151
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfInputNumber, mergeProps({
|
|
104
152
|
key: 0,
|
|
105
153
|
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
106
154
|
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
@@ -112,8 +160,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
112
160
|
_: 1
|
|
113
161
|
}),
|
|
114
162
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "Component" }, {
|
|
115
|
-
default: withCtx(({ data, raw,
|
|
116
|
-
|
|
163
|
+
default: withCtx(({ data, raw, templateIf }) => [
|
|
164
|
+
templateIf(data) ? (openBlock(), createBlock(resolveDynamicComponent(typeof data.is === "function" ? data.is(raw) : data.is), normalizeProps(mergeProps({ key: 0 }, _ctx.pickObject(data, { excludes: ["is"] }))), null, 16)) : createCommentVNode("v-if", true)
|
|
117
165
|
]),
|
|
118
166
|
_: 1
|
|
119
167
|
})
|
|
@@ -31,8 +31,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
31
31
|
const _component_ElCol = resolveComponent("ElCol");
|
|
32
32
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
33
33
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "ElRow" }, {
|
|
34
|
-
default: withCtx(({ data: props, Renderer, raw, k,
|
|
35
|
-
|
|
34
|
+
default: withCtx(({ data: props, Renderer, raw, k, templateIf }) => [
|
|
35
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_ElRow, normalizeProps(mergeProps({ key: 0 }, props)), {
|
|
36
36
|
default: withCtx(() => [
|
|
37
37
|
(openBlock(), createBlock(resolveDynamicComponent(Renderer), {
|
|
38
38
|
source: raw.templateSlots,
|
|
@@ -45,8 +45,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
45
45
|
_: 1
|
|
46
46
|
}),
|
|
47
47
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "ElCol" }, {
|
|
48
|
-
default: withCtx(({ data, Renderer, raw, k,
|
|
49
|
-
|
|
48
|
+
default: withCtx(({ data, Renderer, raw, k, templateIf }) => [
|
|
49
|
+
templateIf(data) ? (openBlock(), createBlock(_component_ElCol, normalizeProps(mergeProps({ key: 0 }, data)), {
|
|
50
50
|
default: withCtx(() => [
|
|
51
51
|
(openBlock(), createBlock(resolveDynamicComponent(Renderer), {
|
|
52
52
|
source: raw.templateSlots,
|
|
@@ -59,8 +59,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
59
59
|
_: 1
|
|
60
60
|
}),
|
|
61
61
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfFlex" }, {
|
|
62
|
-
default: withCtx(({ data, Renderer, raw, k,
|
|
63
|
-
|
|
62
|
+
default: withCtx(({ data, Renderer, raw, k, templateIf }) => [
|
|
63
|
+
templateIf(data) ? (openBlock(), createElementBlock("div", mergeProps({
|
|
64
64
|
key: 0,
|
|
65
65
|
class: "vkf-flex",
|
|
66
66
|
style: {
|
|
@@ -102,7 +102,7 @@ export declare const props: {
|
|
|
102
102
|
required: boolean;
|
|
103
103
|
};
|
|
104
104
|
};
|
|
105
|
-
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<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"
|
|
105
|
+
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<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"tabindex", keyof T2> | Extract<"validateEvent", keyof T2> | Extract<"clearable", keyof T2> | Extract<"prefixIcon", keyof T2> | Extract<"readonly", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"resize", keyof T2> | Extract<"autosize", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"formatter", keyof T2> | Extract<"parser", keyof T2> | Extract<"form", keyof T2> | Extract<"showPassword", keyof T2> | Extract<"showWordLimit", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"containerRole", keyof T2> | Extract<"inputStyle", keyof T2> | Extract<"maxlength", keyof T2> | Extract<"minlength", keyof T2> | Extract<"inputSlots", keyof T2> | Extract<"rows", 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<"size", keyof T2>, KE> | Exclude<Extract<"formItemSize", keyof T2>, KE> | Exclude<Extract<"formItemSlots", keyof T2>, KE> | Exclude<Extract<"elRef", keyof T2>, KE> | Exclude<Extract<"modelValue", keyof T2>, KE> | Exclude<Extract<"disabled", keyof T2>, KE> | Exclude<Extract<"id", keyof T2>, KE> | Exclude<Extract<"tabindex", keyof T2>, KE> | Exclude<Extract<"validateEvent", keyof T2>, KE> | Exclude<Extract<"clearable", keyof T2>, KE> | Exclude<Extract<"prefixIcon", keyof T2>, KE> | Exclude<Extract<"readonly", keyof T2>, KE> | Exclude<Extract<"placeholder", keyof T2>, KE> | Exclude<Extract<"resize", keyof T2>, KE> | Exclude<Extract<"autosize", keyof T2>, KE> | Exclude<Extract<"autocomplete", keyof T2>, KE> | Exclude<Extract<"formatter", keyof T2>, KE> | Exclude<Extract<"parser", keyof T2>, KE> | Exclude<Extract<"form", keyof T2>, KE> | Exclude<Extract<"showPassword", keyof T2>, KE> | Exclude<Extract<"showWordLimit", keyof T2>, KE> | Exclude<Extract<"suffixIcon", keyof T2>, KE> | Exclude<Extract<"containerRole", keyof T2>, KE> | Exclude<Extract<"inputStyle", keyof T2>, KE> | Exclude<Extract<"maxlength", keyof T2>, KE> | Exclude<Extract<"minlength", keyof T2>, KE> | Exclude<Extract<"inputSlots", keyof T2>, KE> | Exclude<Extract<"rows", 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<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"tabindex", keyof T2> | Extract<"validateEvent", keyof T2> | Extract<"clearable", keyof T2> | Extract<"prefixIcon", keyof T2> | Extract<"readonly", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"resize", keyof T2> | Extract<"autosize", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"formatter", keyof T2> | Extract<"parser", keyof T2> | Extract<"form", keyof T2> | Extract<"showPassword", keyof T2> | Extract<"showWordLimit", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"containerRole", keyof T2> | Extract<"inputStyle", keyof T2> | Extract<"maxlength", keyof T2> | Extract<"minlength", keyof T2> | Extract<"inputSlots", keyof T2> | Extract<"rows", 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<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"tabindex", keyof T2> | Extract<"validateEvent", keyof T2> | Extract<"clearable", keyof T2> | Extract<"prefixIcon", keyof T2> | Extract<"readonly", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"resize", keyof T2> | Extract<"autosize", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"formatter", keyof T2> | Extract<"parser", keyof T2> | Extract<"form", keyof T2> | Extract<"showPassword", keyof T2> | Extract<"showWordLimit", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"containerRole", keyof T2> | Extract<"inputStyle", keyof T2> | Extract<"maxlength", keyof T2> | Extract<"minlength", keyof T2> | Extract<"inputSlots", keyof T2> | Extract<"rows", keyof T2>]: T2[k]; }[P]; }>;
|
|
106
106
|
export declare const emits: {
|
|
107
107
|
"update:modelValue": (value: string) => boolean;
|
|
108
108
|
input: (value: string) => boolean;
|
|
@@ -104,15 +104,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
104
104
|
type: string;
|
|
105
105
|
label: string | undefined;
|
|
106
106
|
size: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never> | undefined;
|
|
107
|
+
modelValue: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined) | ((new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined))[], unknown, unknown>;
|
|
108
|
+
disabled: boolean;
|
|
109
|
+
id: string | undefined;
|
|
107
110
|
tabindex: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
108
111
|
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
109
|
-
id: string | undefined;
|
|
110
112
|
clearable: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
111
113
|
prefixIcon: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>))[], unknown, unknown>;
|
|
112
114
|
readonly: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
113
|
-
disabled: boolean;
|
|
114
115
|
placeholder: string | undefined;
|
|
115
|
-
modelValue: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined) | ((new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined))[], unknown, unknown>;
|
|
116
116
|
resize: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "vertical" | "none" | "both" | "horizontal", unknown> | undefined;
|
|
117
117
|
autosize: import("element-plus").InputAutoSize;
|
|
118
118
|
autocomplete: string;
|
|
@@ -269,8 +269,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
269
269
|
required: boolean;
|
|
270
270
|
};
|
|
271
271
|
}>> & {
|
|
272
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
273
272
|
onChange?: ((value: string) => any) | undefined;
|
|
273
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
274
274
|
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
275
275
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
276
276
|
onKeydown?: ((evt: Event | KeyboardEvent) => any) | undefined;
|
|
@@ -290,14 +290,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
290
290
|
showMessage: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
291
291
|
formItemSize: "default" | "small" | "large";
|
|
292
292
|
formItemSlots: import("../../form-item/src/types").FormItemSlots;
|
|
293
|
+
modelValue: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined) | ((new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined))[], unknown, unknown>;
|
|
294
|
+
disabled: boolean;
|
|
295
|
+
id: string;
|
|
293
296
|
tabindex: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
294
297
|
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
295
|
-
id: string;
|
|
296
298
|
clearable: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
297
299
|
prefixIcon: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>))[], unknown, unknown>;
|
|
298
300
|
readonly: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
299
|
-
disabled: boolean;
|
|
300
|
-
modelValue: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined) | ((new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined))[], unknown, unknown>;
|
|
301
301
|
autosize: import("element-plus").InputAutoSize;
|
|
302
302
|
autocomplete: string;
|
|
303
303
|
form: string;
|
|
@@ -81,16 +81,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
81
81
|
label: string | undefined;
|
|
82
82
|
size: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never> | undefined;
|
|
83
83
|
name: string | undefined;
|
|
84
|
-
|
|
85
|
-
id: string | undefined;
|
|
84
|
+
modelValue: number | undefined;
|
|
86
85
|
disabled: boolean;
|
|
86
|
+
id: string | undefined;
|
|
87
|
+
controls: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
88
|
+
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
89
|
+
min: number;
|
|
90
|
+
max: number;
|
|
87
91
|
placeholder: string | undefined;
|
|
88
|
-
modelValue: number | undefined;
|
|
89
92
|
step: number;
|
|
90
93
|
stepStrictly: boolean;
|
|
91
|
-
max: number;
|
|
92
|
-
min: number;
|
|
93
|
-
controls: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
94
94
|
controlsPosition: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "right", unknown>;
|
|
95
95
|
valueOnClear: any;
|
|
96
96
|
precision: number | undefined;
|
|
@@ -172,8 +172,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
172
172
|
required: boolean;
|
|
173
173
|
};
|
|
174
174
|
}>> & {
|
|
175
|
-
"onUpdate:modelValue"?: ((val: number | undefined) => any) | undefined;
|
|
176
175
|
onChange?: ((prev: number | undefined, cur: number | undefined) => any) | undefined;
|
|
176
|
+
"onUpdate:modelValue"?: ((val: number | undefined) => any) | undefined;
|
|
177
177
|
onFocus?: ((e: FocusEvent) => any) | undefined;
|
|
178
178
|
onBlur?: ((e: FocusEvent) => any) | undefined;
|
|
179
179
|
onInput?: ((val: number | null | undefined) => any) | undefined;
|
|
@@ -184,14 +184,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
184
184
|
showMessage: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
185
185
|
formItemSize: "default" | "small" | "large";
|
|
186
186
|
formItemSlots: import("../../form-item/src/types").FormItemSlots;
|
|
187
|
-
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
188
|
-
id: string;
|
|
189
187
|
disabled: boolean;
|
|
188
|
+
id: string;
|
|
189
|
+
controls: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
190
|
+
validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
191
|
+
min: number;
|
|
192
|
+
max: number;
|
|
190
193
|
step: number;
|
|
191
194
|
stepStrictly: boolean;
|
|
192
|
-
max: number;
|
|
193
|
-
min: number;
|
|
194
|
-
controls: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
195
195
|
controlsPosition: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "right", unknown>;
|
|
196
196
|
valueOnClear: any;
|
|
197
197
|
}>;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
|
|
2
|
+
import { radioGroupProps, radioGroupEmits, ElRadio, ElRadioGroup, ElRadioButton } from 'element-plus';
|
|
3
|
+
import { defineComponent, computed, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, createVNode, mergeProps, toHandlers, createElementBlock, Fragment, renderList, resolveDynamicComponent, createTextVNode, toDisplayString } from 'vue';
|
|
4
|
+
import { createRadioGroupBindProps, createRadioGroupOnEmits } from '@vunk/form/shared/element-plus';
|
|
5
|
+
import { pickObject } from '@vunk/core/shared/utils-object';
|
|
6
|
+
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __defProps = Object.defineProperties;
|
|
9
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
10
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
13
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
14
|
+
var __spreadValues = (a, b) => {
|
|
15
|
+
for (var prop in b || (b = {}))
|
|
16
|
+
if (__hasOwnProp.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
if (__getOwnPropSymbols)
|
|
19
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
20
|
+
if (__propIsEnum.call(b, prop))
|
|
21
|
+
__defNormalProp(a, prop, b[prop]);
|
|
22
|
+
}
|
|
23
|
+
return a;
|
|
24
|
+
};
|
|
25
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
26
|
+
const props = __spreadProps(__spreadValues(__spreadValues({}, _VkfFormItemCtx.props), radioGroupProps), {
|
|
27
|
+
options: {
|
|
28
|
+
type: Array,
|
|
29
|
+
default: () => []
|
|
30
|
+
},
|
|
31
|
+
type: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "default"
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const emits = __spreadValues({}, radioGroupEmits);
|
|
37
|
+
|
|
38
|
+
var script = defineComponent({
|
|
39
|
+
name: "VkfRadio",
|
|
40
|
+
components: {
|
|
41
|
+
VkfFormItem,
|
|
42
|
+
ElRadio,
|
|
43
|
+
ElRadioGroup,
|
|
44
|
+
ElRadioButton
|
|
45
|
+
},
|
|
46
|
+
emits,
|
|
47
|
+
props,
|
|
48
|
+
setup(props2, { emit }) {
|
|
49
|
+
const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
|
|
50
|
+
const coreBindProps = createRadioGroupBindProps(props2);
|
|
51
|
+
const coreOnEmits = createRadioGroupOnEmits(emit);
|
|
52
|
+
const options = computed(() => {
|
|
53
|
+
return props2.options.filter((item) => item.value !== void 0 && item.value !== null);
|
|
54
|
+
});
|
|
55
|
+
return {
|
|
56
|
+
formItemBindProps,
|
|
57
|
+
coreBindProps,
|
|
58
|
+
coreOnEmits,
|
|
59
|
+
options,
|
|
60
|
+
pickObject
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
66
|
+
const _component_ElRadioGroup = resolveComponent("ElRadioGroup");
|
|
67
|
+
const _component_VkfFormItem = resolveComponent("VkfFormItem");
|
|
68
|
+
return openBlock(), createBlock(_component_VkfFormItem, normalizeProps(guardReactiveProps(_ctx.formItemBindProps)), {
|
|
69
|
+
default: withCtx(() => [
|
|
70
|
+
createVNode(_component_ElRadioGroup, mergeProps(_ctx.coreBindProps, toHandlers(_ctx.coreOnEmits)), {
|
|
71
|
+
default: withCtx(() => [
|
|
72
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item) => {
|
|
73
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.type === "button" ? "ElRadioButton" : "ElRadio"), mergeProps({
|
|
74
|
+
key: item.value,
|
|
75
|
+
label: item.value
|
|
76
|
+
}, _ctx.pickObject(item, {
|
|
77
|
+
excludes: ["label", "value"]
|
|
78
|
+
})), {
|
|
79
|
+
default: withCtx(() => {
|
|
80
|
+
var _a;
|
|
81
|
+
return [
|
|
82
|
+
createTextVNode(toDisplayString((_a = item.label) != null ? _a : item.value), 1)
|
|
83
|
+
];
|
|
84
|
+
}),
|
|
85
|
+
_: 2
|
|
86
|
+
}, 1040, ["label"]);
|
|
87
|
+
}), 128))
|
|
88
|
+
]),
|
|
89
|
+
_: 1
|
|
90
|
+
}, 16)
|
|
91
|
+
]),
|
|
92
|
+
_: 1
|
|
93
|
+
}, 16);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
script.render = render;
|
|
97
|
+
script.__file = "radio/src/index.vue";
|
|
98
|
+
|
|
99
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
100
|
+
__proto__: null
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
script.install = (app) => {
|
|
104
|
+
app.component(script.name, script);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export { script as VkfRadio, types as __VkfRadio, script as default };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { RadioProps } from '@vunk/form/shared/types/form';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
export declare const props: {
|
|
4
|
+
options: {
|
|
5
|
+
type: PropType<RadioProps[]>;
|
|
6
|
+
default: () => never[];
|
|
7
|
+
};
|
|
8
|
+
type: {
|
|
9
|
+
type: PropType<"default" | "button">;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
id: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
13
|
+
size: {
|
|
14
|
+
readonly type: PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
15
|
+
readonly required: false;
|
|
16
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
17
|
+
__epPropKey: true;
|
|
18
|
+
};
|
|
19
|
+
disabled: BooleanConstructor;
|
|
20
|
+
modelValue: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown, "", boolean>;
|
|
21
|
+
fill: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
22
|
+
label: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
23
|
+
textColor: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
24
|
+
name: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
25
|
+
validateEvent: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
26
|
+
required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
27
|
+
labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
|
|
28
|
+
prop: {
|
|
29
|
+
readonly type: PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemProp & {}) | (() => import("element-plus").FormItemProp) | ((new (...args: any[]) => import("element-plus").FormItemProp & {}) | (() => import("element-plus").FormItemProp))[], unknown, unknown>>;
|
|
30
|
+
readonly required: false;
|
|
31
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
32
|
+
__epPropKey: true;
|
|
33
|
+
};
|
|
34
|
+
rules: {
|
|
35
|
+
readonly type: PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").FormItemRule>) | ((new (...args: any[]) => import("element-plus").FormItemRule | import("element-plus").FormItemRule[]) | (() => import("element-plus/es/utils").Arrayable<import("element-plus").FormItemRule>))[], unknown, unknown>>;
|
|
36
|
+
readonly required: false;
|
|
37
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
38
|
+
__epPropKey: true;
|
|
39
|
+
};
|
|
40
|
+
error: StringConstructor;
|
|
41
|
+
validateStatus: {
|
|
42
|
+
readonly type: PropType<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown>>;
|
|
43
|
+
readonly required: false;
|
|
44
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
45
|
+
__epPropKey: true;
|
|
46
|
+
};
|
|
47
|
+
for: StringConstructor;
|
|
48
|
+
inlineMessage: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, BooleanConstructor], unknown, unknown, "", boolean>;
|
|
49
|
+
showMessage: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
50
|
+
formItemSize: {
|
|
51
|
+
type: PropType<"default" | "small" | "large">;
|
|
52
|
+
default: string;
|
|
53
|
+
};
|
|
54
|
+
formItemSlots: {
|
|
55
|
+
type: PropType<import("../../form-item/src/types").FormItemSlots>;
|
|
56
|
+
default: undefined;
|
|
57
|
+
};
|
|
58
|
+
elRef: {
|
|
59
|
+
type: PropType<any>;
|
|
60
|
+
required: boolean;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export declare const emits: {
|
|
64
|
+
"update:modelValue": (val: string | number | boolean) => boolean;
|
|
65
|
+
change: (val: string | number | boolean) => boolean;
|
|
66
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { _VkfFormItemCtx } from '@vunk/form/components/form-item';
|
|
2
|
+
import { radioGroupProps, radioGroupEmits } from 'element-plus';
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defProps = Object.defineProperties;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
const props = __spreadProps(__spreadValues(__spreadValues({}, _VkfFormItemCtx.props), radioGroupProps), {
|
|
24
|
+
options: {
|
|
25
|
+
type: Array,
|
|
26
|
+
default: () => []
|
|
27
|
+
},
|
|
28
|
+
type: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "default"
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const emits = __spreadValues({}, radioGroupEmits);
|
|
34
|
+
|
|
35
|
+
export { emits, props };
|