@vunk/form 0.0.1-alpha.4 → 0.0.1-alpha.41
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/button/index.d.ts +4 -0
- package/components/button/index.js +126 -0
- package/components/button/src/ctx.d.ts +91 -0
- package/components/button/src/ctx.js +39 -0
- package/components/button/src/index.vue.d.ts +241 -0
- package/components/button/src/types.d.ts +7 -0
- package/components/button/src/types.js +1 -0
- package/components/cascader/index.d.ts +4 -0
- package/components/cascader/index.js +108 -0
- package/components/cascader/src/ctx.d.ts +130 -0
- package/components/cascader/src/ctx.js +38 -0
- package/components/cascader/src/index.vue.d.ts +313 -0
- package/components/cascader/src/types.d.ts +1 -0
- package/components/cascader/src/types.js +1 -0
- package/components/checkbox/index.css +38 -0
- package/components/checkbox/index.d.ts +4 -0
- package/components/checkbox/index.js +127 -0
- package/components/checkbox/src/ctx.d.ts +82 -0
- package/components/checkbox/src/ctx.js +43 -0
- package/components/checkbox/src/index.vue.d.ts +213 -0
- package/components/checkbox/src/types.d.ts +1 -0
- package/components/checkbox/src/types.js +1 -0
- package/components/color-picker/index.d.ts +4 -0
- package/components/color-picker/index.js +77 -0
- package/components/color-picker/src/ctx.d.ts +74 -0
- package/components/color-picker/src/ctx.js +23 -0
- package/components/color-picker/src/index.vue.d.ts +196 -0
- package/components/color-picker/src/types.d.ts +1 -0
- package/components/color-picker/src/types.js +1 -0
- package/components/date-picker/index.js +26 -15
- package/components/date-picker/src/ctx.d.ts +64 -57
- package/components/date-picker/src/ctx.js +1 -1
- package/components/date-picker/src/index.vue.d.ts +183 -153
- package/components/date-picker/src/types.d.ts +7 -7
- package/components/firt-ep/index.d.ts +4 -0
- package/components/firt-ep/index.js +80 -0
- package/components/firt-ep/src/ctx.d.ts +9 -0
- package/components/firt-ep/src/ctx.js +9 -0
- package/components/firt-ep/src/index.vue.d.ts +19 -0
- package/components/firt-ep/src/types.d.ts +1 -0
- package/components/firt-ep/src/types.js +1 -0
- package/components/form/index.js +37 -16
- package/components/form/src/ctx.d.ts +95 -81
- package/components/form/src/ctx.js +5 -2
- package/components/form/src/index.vue.d.ts +284 -250
- package/components/form-item/index.css +4 -0
- package/components/form-item/index.js +34 -13
- package/components/form-item/src/ctx.d.ts +15 -7
- package/components/form-item/src/ctx.js +8 -0
- package/components/form-item/src/index.vue.d.ts +44 -14
- package/components/form-item-renderer/index.js +34 -30
- package/components/form-item-renderer/src/ctx.d.ts +3 -3
- package/components/form-item-renderer/src/index.vue.d.ts +8 -8
- package/components/form-item-renderer/src/types.d.ts +2 -0
- package/components/form-item-renderer-template/index.js +13 -6
- package/components/form-item-renderer-template/src/index.vue.d.ts +1 -1
- package/components/form-item-renderer-template-default/index.js +130 -31
- package/components/form-item-renderer-template-default/src/index.vue.d.ts +7 -7
- package/components/form-item-renderer-template-layout/index.js +41 -24
- package/components/form-item-renderer-template-layout/src/ctx.d.ts +3 -2
- package/components/form-item-renderer-template-layout/src/ctx.js +1 -1
- package/components/form-item-renderer-template-layout/src/index.vue.d.ts +18 -6
- package/components/input/index.js +39 -14
- package/components/input/src/ctx.d.ts +96 -49
- package/components/input/src/ctx.js +13 -1
- package/components/input/src/index.vue.d.ts +234 -128
- package/components/input-number/index.css +17 -0
- package/components/input-number/index.js +46 -14
- package/components/input-number/src/ctx.d.ts +28 -16
- package/components/input-number/src/ctx.js +13 -1
- package/components/input-number/src/index.vue.d.ts +104 -44
- package/components/radio/index.css +29 -0
- package/components/radio/index.d.ts +4 -0
- package/components/radio/index.js +123 -0
- package/components/radio/src/ctx.d.ts +77 -0
- package/components/radio/src/ctx.js +39 -0
- package/components/radio/src/index.vue.d.ts +204 -0
- package/components/radio/src/types.d.ts +1 -0
- package/components/radio/src/types.js +1 -0
- package/components/select/index.css +11 -0
- package/components/select/index.js +69 -49
- package/components/select/src/ctx.d.ts +48 -36
- package/components/select/src/ctx.js +4 -0
- package/components/select/src/index.vue.d.ts +206 -129
- package/components/switch/index.css +11 -0
- package/components/switch/index.js +44 -16
- package/components/switch/src/ctx.d.ts +46 -11
- package/components/switch/src/ctx.js +13 -2
- package/components/switch/src/index.vue.d.ts +147 -37
- package/components/upload/index.css +29 -0
- package/components/upload/index.d.ts +5 -0
- package/components/upload/index.js +522 -0
- package/components/upload/src/ctx.d.ts +173 -0
- package/components/upload/src/ctx.js +41 -0
- package/components/upload/src/file.vue.d.ts +96 -0
- package/components/upload/src/index.vue.d.ts +421 -0
- package/components/upload/src/types.d.ts +1 -0
- package/components/upload/src/types.js +1 -0
- package/composables/index.d.ts +1 -0
- package/composables/index.js +311 -7
- package/composables/useForm.d.ts +9 -0
- package/composables/useSourceManager.d.ts +2 -0
- package/index.css +146 -0
- package/index.d.ts +1 -0
- package/index.esm.js +4 -1
- package/package.json +4 -1
- package/shared/default-renderer-source/index.d.ts +12 -0
- package/shared/default-renderer-source/index.js +83 -0
- package/shared/element-plus/ctx.d.ts +86 -13
- package/shared/element-plus/index.js +18165 -32
- package/shared/element-plus/instances.d.ts +129 -27
- package/shared/infer-prop/index.d.ts +17 -0
- package/shared/infer-prop/index.js +34 -0
- package/shared/types/basic-source/index.d.ts +7 -0
- package/shared/types/basic-source/index.js +1 -0
- package/shared/types/ep-source/el-divider.d.ts +7 -0
- package/shared/types/ep-source/el-link.d.ts +8 -0
- package/shared/types/ep-source/index.d.ts +3 -0
- package/shared/types/ep-source/index.js +1 -0
- 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/index.d.ts +2 -0
- package/shared/types/layout-source/index.d.ts +6 -4
- package/shared/types/renderer-source/button.d.ts +7 -0
- package/shared/types/renderer-source/cascader.d.ts +7 -0
- package/shared/types/renderer-source/checkbox.d.ts +7 -0
- package/shared/types/renderer-source/color-picker.d.ts +7 -0
- package/shared/types/renderer-source/compoent.d.ts +3 -0
- package/shared/types/renderer-source/date-picker.d.ts +3 -2
- package/shared/types/renderer-source/index.d.ts +13 -1
- package/shared/types/renderer-source/input-number.d.ts +3 -2
- package/shared/types/renderer-source/input.d.ts +3 -2
- package/shared/types/renderer-source/radio.d.ts +7 -0
- package/shared/types/renderer-source/select.d.ts +3 -2
- package/shared/types/renderer-source/switch.d.ts +3 -2
- package/shared/types/renderer-source/upload.d.ts +7 -0
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import { defineComponent, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, withCtx,
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, withCtx, createBlock, normalizeProps, mergeProps, createCommentVNode, resolveDynamicComponent } from 'vue';
|
|
2
2
|
import { VkfFormItemRendererTemplate } from '@vunk/form/components/form-item-renderer-template';
|
|
3
3
|
import { VkfInput } from '@vunk/form/components/input';
|
|
4
4
|
import { VkfSwitch } from '@vunk/form/components/switch';
|
|
5
5
|
import { VkfSelect } from '@vunk/form/components/select';
|
|
6
6
|
import { VkfDatePicker } from '@vunk/form/components/date-picker';
|
|
7
7
|
import { getValue } from '@vunk/core/shared/helper';
|
|
8
|
-
import {
|
|
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';
|
|
13
|
+
import { VkfColorPicker } from '@vunk/form/components/color-picker';
|
|
14
|
+
import { VkfButton } from '@vunk/form/components/button';
|
|
15
|
+
import { VkfCascader } from '@vunk/form/components/cascader';
|
|
10
16
|
|
|
11
17
|
const props = {
|
|
12
18
|
data: {
|
|
@@ -18,7 +24,15 @@ const emits = {
|
|
|
18
24
|
setData: (e) => e
|
|
19
25
|
};
|
|
20
26
|
|
|
21
|
-
var
|
|
27
|
+
var _export_sfc = (sfc, props) => {
|
|
28
|
+
const target = sfc.__vccOpts || sfc;
|
|
29
|
+
for (const [key, val] of props) {
|
|
30
|
+
target[key] = val;
|
|
31
|
+
}
|
|
32
|
+
return target;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const _sfc_main = defineComponent({
|
|
22
36
|
name: "VkfFormItemRendererTemplateDefault",
|
|
23
37
|
components: {
|
|
24
38
|
VkfFormItemRendererTemplate,
|
|
@@ -26,104 +40,189 @@ var script = defineComponent({
|
|
|
26
40
|
VkfSwitch,
|
|
27
41
|
VkfSelect,
|
|
28
42
|
VkfDatePicker,
|
|
29
|
-
VkfInputNumber
|
|
43
|
+
VkfInputNumber,
|
|
44
|
+
VkfRadio,
|
|
45
|
+
VkfCheckbox,
|
|
46
|
+
VkfUpload,
|
|
47
|
+
VkfColorPicker,
|
|
48
|
+
VkfButton,
|
|
49
|
+
VkfCascader
|
|
30
50
|
},
|
|
31
51
|
emits,
|
|
32
52
|
props,
|
|
33
53
|
setup() {
|
|
34
54
|
return {
|
|
35
|
-
|
|
55
|
+
pickObject,
|
|
36
56
|
getValue
|
|
37
57
|
};
|
|
38
58
|
}
|
|
39
59
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const _component_VkfInput = resolveComponent("VkfInput");
|
|
60
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
61
|
+
const _component_VkfButton = resolveComponent("VkfButton");
|
|
43
62
|
const _component_VkfFormItemRendererTemplate = resolveComponent("VkfFormItemRendererTemplate");
|
|
63
|
+
const _component_VkfColorPicker = resolveComponent("VkfColorPicker");
|
|
64
|
+
const _component_VkfUpload = resolveComponent("VkfUpload");
|
|
65
|
+
const _component_VkfCheckbox = resolveComponent("VkfCheckbox");
|
|
66
|
+
const _component_VkfRadio = resolveComponent("VkfRadio");
|
|
67
|
+
const _component_VkfInput = resolveComponent("VkfInput");
|
|
44
68
|
const _component_VkfSwitch = resolveComponent("VkfSwitch");
|
|
45
69
|
const _component_VkfSelect = resolveComponent("VkfSelect");
|
|
46
70
|
const _component_VkfDatePicker = resolveComponent("VkfDatePicker");
|
|
47
71
|
const _component_VkfInputNumber = resolveComponent("VkfInputNumber");
|
|
72
|
+
const _component_VkfCascader = resolveComponent("VkfCascader");
|
|
48
73
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
74
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfButton" }, {
|
|
75
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
76
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfButton, normalizeProps(mergeProps({ key: 0 }, sourceData)), null, 16)) : createCommentVNode("v-if", true)
|
|
77
|
+
]),
|
|
78
|
+
_: 1
|
|
79
|
+
}),
|
|
80
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfColorPicker" }, {
|
|
81
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
82
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfColorPicker, mergeProps({
|
|
83
|
+
key: 0,
|
|
84
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
85
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
86
|
+
k: sourceData.prop,
|
|
87
|
+
v: $event
|
|
88
|
+
})
|
|
89
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
90
|
+
]),
|
|
91
|
+
_: 1
|
|
92
|
+
}),
|
|
93
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfUpload" }, {
|
|
94
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
95
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfUpload, mergeProps({
|
|
96
|
+
key: 0,
|
|
97
|
+
fileList: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
98
|
+
"onUpdate:fileList": ($event) => _ctx.$emit("setData", {
|
|
99
|
+
k: sourceData.prop,
|
|
100
|
+
v: $event
|
|
101
|
+
})
|
|
102
|
+
}, sourceData), null, 16, ["fileList", "onUpdate:fileList"])) : createCommentVNode("v-if", true)
|
|
103
|
+
]),
|
|
104
|
+
_: 1
|
|
105
|
+
}),
|
|
106
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfCheckbox" }, {
|
|
107
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
108
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfCheckbox, mergeProps({
|
|
109
|
+
key: 0,
|
|
110
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
111
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
112
|
+
k: sourceData.prop,
|
|
113
|
+
v: $event
|
|
114
|
+
})
|
|
115
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
116
|
+
]),
|
|
117
|
+
_: 1
|
|
118
|
+
}),
|
|
119
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfRadio" }, {
|
|
120
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
121
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfRadio, mergeProps({
|
|
122
|
+
key: 0,
|
|
123
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
124
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
125
|
+
k: sourceData.prop,
|
|
126
|
+
v: $event
|
|
127
|
+
})
|
|
128
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
129
|
+
]),
|
|
130
|
+
_: 1
|
|
131
|
+
}),
|
|
49
132
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfInput" }, {
|
|
50
|
-
default: withCtx(({ data: sourceData }) => [
|
|
51
|
-
|
|
133
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
134
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfInput, mergeProps({
|
|
135
|
+
key: 0,
|
|
52
136
|
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
53
137
|
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
54
138
|
k: sourceData.prop,
|
|
55
139
|
v: $event
|
|
56
140
|
})
|
|
57
|
-
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])
|
|
141
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
58
142
|
]),
|
|
59
143
|
_: 1
|
|
60
144
|
}),
|
|
61
145
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfSwitch" }, {
|
|
62
|
-
default: withCtx(({ data: sourceData }) => [
|
|
63
|
-
|
|
146
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
147
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfSwitch, mergeProps({
|
|
148
|
+
key: 0,
|
|
64
149
|
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
65
150
|
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
66
151
|
k: sourceData.prop,
|
|
67
152
|
v: $event
|
|
68
153
|
})
|
|
69
|
-
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])
|
|
154
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
70
155
|
]),
|
|
71
156
|
_: 1
|
|
72
157
|
}),
|
|
73
158
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfSelect" }, {
|
|
74
|
-
default: withCtx(({ data: sourceData }) => [
|
|
75
|
-
|
|
159
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
160
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfSelect, mergeProps({
|
|
161
|
+
key: 0,
|
|
76
162
|
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
77
163
|
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
78
164
|
k: sourceData.prop,
|
|
79
165
|
v: $event
|
|
80
166
|
})
|
|
81
|
-
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])
|
|
167
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
82
168
|
]),
|
|
83
169
|
_: 1
|
|
84
170
|
}),
|
|
85
171
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfDatePicker" }, {
|
|
86
|
-
default: withCtx(({ data: sourceData }) => [
|
|
87
|
-
|
|
172
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
173
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfDatePicker, mergeProps({
|
|
174
|
+
key: 0,
|
|
88
175
|
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
89
176
|
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
90
177
|
k: sourceData.prop,
|
|
91
178
|
v: $event
|
|
92
179
|
})
|
|
93
|
-
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])
|
|
180
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
94
181
|
]),
|
|
95
182
|
_: 1
|
|
96
183
|
}),
|
|
97
184
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfInputNumber" }, {
|
|
98
|
-
default: withCtx(({ data: sourceData }) => [
|
|
99
|
-
|
|
185
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
186
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfInputNumber, mergeProps({
|
|
187
|
+
key: 0,
|
|
188
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
189
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
190
|
+
k: sourceData.prop,
|
|
191
|
+
v: $event
|
|
192
|
+
})
|
|
193
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
194
|
+
]),
|
|
195
|
+
_: 1
|
|
196
|
+
}),
|
|
197
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfCascader" }, {
|
|
198
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
199
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfCascader, mergeProps({
|
|
200
|
+
key: 0,
|
|
100
201
|
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
101
202
|
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
102
203
|
k: sourceData.prop,
|
|
103
204
|
v: $event
|
|
104
205
|
})
|
|
105
|
-
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])
|
|
206
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
106
207
|
]),
|
|
107
208
|
_: 1
|
|
108
209
|
}),
|
|
109
210
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "Component" }, {
|
|
110
|
-
default: withCtx(({ data, raw }) => [
|
|
111
|
-
(openBlock(), createBlock(resolveDynamicComponent(typeof data.is === "function" ? data.is(raw) : data.is), normalizeProps(
|
|
211
|
+
default: withCtx(({ data, raw, templateIf }) => [
|
|
212
|
+
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)
|
|
112
213
|
]),
|
|
113
214
|
_: 1
|
|
114
215
|
})
|
|
115
216
|
], 64);
|
|
116
217
|
}
|
|
117
|
-
|
|
118
|
-
script.render = render;
|
|
119
|
-
script.__file = "form-item-renderer-template-default/src/index.vue";
|
|
218
|
+
var VkfFormItemRendererTemplateDefault = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "index.vue"]]);
|
|
120
219
|
|
|
121
220
|
var types = /*#__PURE__*/Object.freeze({
|
|
122
221
|
__proto__: null
|
|
123
222
|
});
|
|
124
223
|
|
|
125
|
-
|
|
126
|
-
app.component(
|
|
224
|
+
VkfFormItemRendererTemplateDefault.install = (app) => {
|
|
225
|
+
app.component(VkfFormItemRendererTemplateDefault.name, VkfFormItemRendererTemplateDefault);
|
|
127
226
|
};
|
|
128
227
|
|
|
129
|
-
export {
|
|
228
|
+
export { VkfFormItemRendererTemplateDefault, types as __VkfFormItemRendererTemplateDefault, VkfFormItemRendererTemplateDefault as default };
|
|
@@ -4,11 +4,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4
4
|
default: () => {};
|
|
5
5
|
};
|
|
6
6
|
}, {
|
|
7
|
-
|
|
8
|
-
excludes?: EX;
|
|
9
|
-
includes?: KI[];
|
|
10
|
-
}) => { [P in EX extends (infer KE)[] ? Exclude<KI, KE> : KI]: T[P]; };
|
|
11
|
-
getValue: (obj: any, k: string | number | any[]) => any;
|
|
7
|
+
pickObject: <T extends import("@vunk/core").NormalObject, EX extends (keyof T)[] | undefined, KI extends keyof T>(data: T, opts?: {
|
|
8
|
+
excludes?: EX | undefined;
|
|
9
|
+
includes?: KI[] | undefined;
|
|
10
|
+
} | undefined) => { [P in EX extends (infer KE)[] ? Exclude<KI, KE> : KI]: T[P]; };
|
|
11
|
+
getValue: (obj: any, k: string | number | any[], intoUndefined?: ((obj: any, k: string | number) => void) | undefined) => any;
|
|
12
12
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
13
|
setData: (e: import("@vunk/core").SetDataEvent<any>) => import("@vunk/core").SetDataEvent<any>;
|
|
14
14
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -17,8 +17,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
17
17
|
default: () => {};
|
|
18
18
|
};
|
|
19
19
|
}>> & {
|
|
20
|
-
onSetData?: (e: import("@vunk/core").SetDataEvent<any>) => any;
|
|
20
|
+
onSetData?: ((e: import("@vunk/core").SetDataEvent<any>) => any) | undefined;
|
|
21
21
|
}, {
|
|
22
|
-
data:
|
|
22
|
+
data: Record<string, any>;
|
|
23
23
|
}>;
|
|
24
24
|
export default _default;
|
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
import { defineComponent, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, withCtx,
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, withCtx, createBlock, normalizeProps, mergeProps, resolveDynamicComponent, createCommentVNode } from 'vue';
|
|
2
2
|
import { VkfFormItemRendererTemplate } from '@vunk/form/components/form-item-renderer-template';
|
|
3
3
|
import { ElRow, ElCol } from 'element-plus';
|
|
4
|
-
import {
|
|
4
|
+
import { pickObject } from '@vunk/core/shared/utils-object';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const props = {
|
|
7
|
+
data: {
|
|
8
|
+
type: Object,
|
|
9
|
+
default: () => ({})
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
var _export_sfc = (sfc, props) => {
|
|
14
|
+
const target = sfc.__vccOpts || sfc;
|
|
15
|
+
for (const [key, val] of props) {
|
|
16
|
+
target[key] = val;
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const _sfc_main = defineComponent({
|
|
7
22
|
name: "VkfFormItemRendererTemplateLayout",
|
|
23
|
+
props,
|
|
8
24
|
components: {
|
|
9
25
|
ElRow,
|
|
10
26
|
ElCol,
|
|
@@ -12,19 +28,18 @@ var script = defineComponent({
|
|
|
12
28
|
},
|
|
13
29
|
setup() {
|
|
14
30
|
return {
|
|
15
|
-
|
|
31
|
+
pickObject
|
|
16
32
|
};
|
|
17
33
|
}
|
|
18
34
|
});
|
|
19
|
-
|
|
20
|
-
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
35
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
21
36
|
const _component_ElRow = resolveComponent("ElRow");
|
|
22
37
|
const _component_VkfFormItemRendererTemplate = resolveComponent("VkfFormItemRendererTemplate");
|
|
23
38
|
const _component_ElCol = resolveComponent("ElCol");
|
|
24
39
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
25
40
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "ElRow" }, {
|
|
26
|
-
default: withCtx(({ data, Renderer, raw, k }) => [
|
|
27
|
-
|
|
41
|
+
default: withCtx(({ data: props2, Renderer, raw, k, templateIf }) => [
|
|
42
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_ElRow, normalizeProps(mergeProps({ key: 0 }, props2)), {
|
|
28
43
|
default: withCtx(() => [
|
|
29
44
|
(openBlock(), createBlock(resolveDynamicComponent(Renderer), {
|
|
30
45
|
source: raw.templateSlots,
|
|
@@ -32,13 +47,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
32
47
|
}, null, 8, ["source", "k"]))
|
|
33
48
|
]),
|
|
34
49
|
_: 2
|
|
35
|
-
}, 1040)
|
|
50
|
+
}, 1040)) : createCommentVNode("v-if", true)
|
|
36
51
|
]),
|
|
37
52
|
_: 1
|
|
38
53
|
}),
|
|
39
54
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "ElCol" }, {
|
|
40
|
-
default: withCtx(({ data, Renderer, raw, k }) => [
|
|
41
|
-
|
|
55
|
+
default: withCtx(({ data, Renderer, raw, k, templateIf }) => [
|
|
56
|
+
templateIf(data) ? (openBlock(), createBlock(_component_ElCol, normalizeProps(mergeProps({ key: 0 }, data)), {
|
|
42
57
|
default: withCtx(() => [
|
|
43
58
|
(openBlock(), createBlock(resolveDynamicComponent(Renderer), {
|
|
44
59
|
source: raw.templateSlots,
|
|
@@ -46,13 +61,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
46
61
|
}, null, 8, ["source", "k"]))
|
|
47
62
|
]),
|
|
48
63
|
_: 2
|
|
49
|
-
}, 1040)
|
|
64
|
+
}, 1040)) : createCommentVNode("v-if", true)
|
|
50
65
|
]),
|
|
51
66
|
_: 1
|
|
52
67
|
}),
|
|
53
68
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfFlex" }, {
|
|
54
|
-
default: withCtx(({ data, Renderer, raw, k }) => [
|
|
55
|
-
|
|
69
|
+
default: withCtx(({ data, Renderer, raw, k, templateIf }) => [
|
|
70
|
+
templateIf(data) ? (openBlock(), createElementBlock("div", mergeProps({
|
|
71
|
+
key: 0,
|
|
56
72
|
class: "vkf-flex",
|
|
57
73
|
style: {
|
|
58
74
|
"justify-content": data.justify,
|
|
@@ -63,29 +79,30 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
63
79
|
"flex-shrink": data.shrink,
|
|
64
80
|
"flex-basis": data.basis
|
|
65
81
|
}
|
|
66
|
-
}, _ctx.
|
|
67
|
-
|
|
68
|
-
|
|
82
|
+
}, _ctx.pickObject(
|
|
83
|
+
data,
|
|
84
|
+
{
|
|
85
|
+
excludes: ["justify", "direction", "align", "overflow", "grow", "shrink", "basis"]
|
|
86
|
+
}
|
|
87
|
+
)), [
|
|
69
88
|
(openBlock(), createBlock(resolveDynamicComponent(Renderer), {
|
|
70
89
|
source: raw.templateSlots,
|
|
71
90
|
k: [...k, "templateSlots"]
|
|
72
91
|
}, null, 8, ["source", "k"]))
|
|
73
|
-
], 16)
|
|
92
|
+
], 16)) : createCommentVNode("v-if", true)
|
|
74
93
|
]),
|
|
75
94
|
_: 1
|
|
76
95
|
})
|
|
77
96
|
], 64);
|
|
78
97
|
}
|
|
79
|
-
|
|
80
|
-
script.render = render;
|
|
81
|
-
script.__file = "form-item-renderer-template-layout/src/index.vue";
|
|
98
|
+
var VkfFormItemRendererTemplateLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "index.vue"]]);
|
|
82
99
|
|
|
83
100
|
var types = /*#__PURE__*/Object.freeze({
|
|
84
101
|
__proto__: null
|
|
85
102
|
});
|
|
86
103
|
|
|
87
|
-
|
|
88
|
-
app.component(
|
|
104
|
+
VkfFormItemRendererTemplateLayout.install = (app) => {
|
|
105
|
+
app.component(VkfFormItemRendererTemplateLayout.name, VkfFormItemRendererTemplateLayout);
|
|
89
106
|
};
|
|
90
107
|
|
|
91
|
-
export {
|
|
108
|
+
export { VkfFormItemRendererTemplateLayout, types as __VkfFormItemRendererTemplateLayout, VkfFormItemRendererTemplateLayout as default };
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
}, {
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
data: {
|
|
3
|
+
type: import("vue").PropType<import("@vunk/core").NormalObject>;
|
|
4
|
+
default: () => {};
|
|
5
|
+
};
|
|
6
|
+
}, {
|
|
7
|
+
pickObject: <T extends import("@vunk/core").NormalObject, EX extends (keyof T)[] | undefined, KI extends keyof T>(data: T, opts?: {
|
|
8
|
+
excludes?: EX | undefined;
|
|
9
|
+
includes?: KI[] | undefined;
|
|
10
|
+
} | undefined) => { [P in EX extends (infer KE)[] ? Exclude<KI, KE> : KI]: T[P]; };
|
|
11
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
12
|
+
data: {
|
|
13
|
+
type: import("vue").PropType<import("@vunk/core").NormalObject>;
|
|
14
|
+
default: () => {};
|
|
15
|
+
};
|
|
16
|
+
}>>, {
|
|
17
|
+
data: import("@vunk/core").NormalObject;
|
|
18
|
+
}>;
|
|
7
19
|
export default _default;
|
|
@@ -3,6 +3,7 @@ import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
|
|
|
3
3
|
import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
|
|
4
4
|
import { defineComponent, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, createVNode, mergeProps, toHandlers, createSlots, renderSlot, renderList, resolveDynamicComponent } from 'vue';
|
|
5
5
|
import { createInputBindProps, createInputOnEmits } from '@vunk/form/shared/element-plus';
|
|
6
|
+
import { useComputedReadonly } from '@vunk/form/composables';
|
|
6
7
|
|
|
7
8
|
var __defProp = Object.defineProperty;
|
|
8
9
|
var __defProps = Object.defineProperties;
|
|
@@ -23,10 +24,22 @@ var __spreadValues = (a, b) => {
|
|
|
23
24
|
return a;
|
|
24
25
|
};
|
|
25
26
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
26
|
-
const props = __spreadProps(__spreadValues(__spreadValues({}, _VkfFormItemCtx.props),
|
|
27
|
+
const props = __spreadProps(__spreadValues(__spreadValues({}, inputProps), _VkfFormItemCtx.props), {
|
|
28
|
+
maxlength: {
|
|
29
|
+
type: Number,
|
|
30
|
+
required: false
|
|
31
|
+
},
|
|
32
|
+
minlength: {
|
|
33
|
+
type: Number,
|
|
34
|
+
required: false
|
|
35
|
+
},
|
|
27
36
|
inputSlots: {
|
|
28
37
|
type: Object,
|
|
29
38
|
default: void 0
|
|
39
|
+
},
|
|
40
|
+
rows: {
|
|
41
|
+
type: Number,
|
|
42
|
+
default: void 0
|
|
30
43
|
}
|
|
31
44
|
});
|
|
32
45
|
const createBindProps = bindPropsFactory(props);
|
|
@@ -41,7 +54,15 @@ var ctx = /*#__PURE__*/Object.freeze({
|
|
|
41
54
|
createOnEmits: createOnEmits
|
|
42
55
|
});
|
|
43
56
|
|
|
44
|
-
var
|
|
57
|
+
var _export_sfc = (sfc, props) => {
|
|
58
|
+
const target = sfc.__vccOpts || sfc;
|
|
59
|
+
for (const [key, val] of props) {
|
|
60
|
+
target[key] = val;
|
|
61
|
+
}
|
|
62
|
+
return target;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const _sfc_main = defineComponent({
|
|
45
66
|
name: "VkfInput",
|
|
46
67
|
components: {
|
|
47
68
|
ElInput,
|
|
@@ -50,23 +71,28 @@ var script = defineComponent({
|
|
|
50
71
|
emits,
|
|
51
72
|
props,
|
|
52
73
|
setup(props2, { emit }) {
|
|
53
|
-
const inputBindProps = createInputBindProps(props2);
|
|
74
|
+
const inputBindProps = createInputBindProps(props2, ["readonly"]);
|
|
54
75
|
const inputOnEmits = createInputOnEmits(emit);
|
|
55
76
|
const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
|
|
77
|
+
const readonly = useComputedReadonly(props2);
|
|
56
78
|
return {
|
|
57
79
|
inputBindProps,
|
|
58
80
|
formItemBindProps,
|
|
81
|
+
readonly,
|
|
59
82
|
inputOnEmits
|
|
60
83
|
};
|
|
61
84
|
}
|
|
62
85
|
});
|
|
63
|
-
|
|
64
|
-
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
86
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
65
87
|
const _component_ElInput = resolveComponent("ElInput");
|
|
66
88
|
const _component_VkfFormItem = resolveComponent("VkfFormItem");
|
|
67
89
|
return openBlock(), createBlock(_component_VkfFormItem, normalizeProps(guardReactiveProps(_ctx.formItemBindProps)), {
|
|
68
90
|
default: withCtx(() => [
|
|
69
|
-
createVNode(_component_ElInput, mergeProps(
|
|
91
|
+
createVNode(_component_ElInput, mergeProps({
|
|
92
|
+
maxlength: _ctx.maxlength,
|
|
93
|
+
minlength: _ctx.minlength,
|
|
94
|
+
rows: _ctx.rows
|
|
95
|
+
}, _ctx.inputBindProps, toHandlers(_ctx.inputOnEmits), { readonly: _ctx.readonly }), createSlots({
|
|
70
96
|
default: withCtx(() => [
|
|
71
97
|
renderSlot(_ctx.$slots, "default")
|
|
72
98
|
]),
|
|
@@ -76,25 +102,24 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
76
102
|
return {
|
|
77
103
|
name: key,
|
|
78
104
|
fn: withCtx((e) => [
|
|
79
|
-
(openBlock(), createBlock(resolveDynamicComponent(item
|
|
105
|
+
(openBlock(), createBlock(resolveDynamicComponent(item?.(e))))
|
|
80
106
|
])
|
|
81
107
|
};
|
|
82
108
|
})
|
|
83
|
-
]), 1040)
|
|
109
|
+
]), 1040, ["maxlength", "minlength", "rows", "readonly"]),
|
|
110
|
+
renderSlot(_ctx.$slots, "formItem")
|
|
84
111
|
]),
|
|
85
112
|
_: 3
|
|
86
113
|
}, 16);
|
|
87
114
|
}
|
|
88
|
-
|
|
89
|
-
script.render = render;
|
|
90
|
-
script.__file = "input/src/index.vue";
|
|
115
|
+
var VkfInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "index.vue"]]);
|
|
91
116
|
|
|
92
117
|
var types = /*#__PURE__*/Object.freeze({
|
|
93
118
|
__proto__: null
|
|
94
119
|
});
|
|
95
120
|
|
|
96
|
-
|
|
97
|
-
app.component(
|
|
121
|
+
VkfInput.install = (app) => {
|
|
122
|
+
app.component(VkfInput.name, VkfInput);
|
|
98
123
|
};
|
|
99
124
|
|
|
100
|
-
export {
|
|
125
|
+
export { VkfInput, ctx as _VkfInputCtx, types as __VkfInput, VkfInput as default };
|