@vunk/form 0.0.1-alpha.8 → 1.0.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/component.d.ts +1 -1
- package/components/button/index.d.ts +4 -0
- package/components/button/index.js +126 -0
- package/components/button/src/ctx.d.ts +92 -0
- package/components/button/src/ctx.js +39 -0
- package/components/button/src/index.vue.d.ts +245 -0
- package/components/button/src/types.d.ts +13 -0
- package/components/cascader/index.d.ts +4 -0
- package/components/cascader/index.js +114 -0
- package/components/cascader/src/ctx.d.ts +129 -0
- package/components/cascader/src/ctx.js +38 -0
- package/components/cascader/src/index.vue.d.ts +311 -0
- package/components/cascader/src/types.d.ts +7 -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 +8 -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 +72 -0
- package/components/color-picker/src/ctx.js +23 -0
- package/components/color-picker/src/index.vue.d.ts +193 -0
- package/components/color-picker/src/types.d.ts +7 -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 +176 -146
- package/components/date-picker/src/types.d.ts +14 -8
- package/components/form/index.d.ts +1 -0
- package/components/form/index.js +44 -19
- package/components/form/src/ctx.d.ts +147 -97
- package/components/form/src/ctx.js +5 -2
- package/components/form/src/index.vue.d.ts +424 -287
- package/components/form/src/types.d.ts +2 -0
- package/components/form/src/types.js +1 -0
- 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 +9 -9
- 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/input/index.js +29 -15
- package/components/input/src/ctx.d.ts +88 -49
- package/components/input/src/ctx.js +5 -1
- package/components/input/src/index.vue.d.ts +219 -129
- package/components/input/src/types.d.ts +7 -1
- package/components/input-link/index.css +5 -0
- package/components/input-link/index.d.ts +4 -0
- package/components/input-link/index.js +181 -0
- package/components/input-link/src/ctx.d.ts +143 -0
- package/components/input-link/src/ctx.js +46 -0
- package/components/input-link/src/index.vue.d.ts +373 -0
- package/components/input-link/src/types.d.ts +7 -0
- package/components/input-link/src/types.js +1 -0
- package/components/input-number/index.css +17 -0
- package/components/input-number/index.js +46 -14
- package/components/input-number/src/ctx.d.ts +22 -10
- package/components/input-number/src/ctx.js +13 -1
- package/components/input-number/src/index.vue.d.ts +92 -32
- package/components/input-number/src/types.d.ts +7 -0
- 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 +8 -0
- package/components/radio/src/types.js +1 -0
- package/components/select/index.css +11 -0
- package/components/select/index.js +75 -49
- package/components/select/src/ctx.d.ts +37 -25
- package/components/select/src/ctx.js +4 -0
- package/components/select/src/index.vue.d.ts +181 -104
- package/components/select/src/types.d.ts +7 -1
- 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 +146 -36
- package/components/switch/src/types.d.ts +7 -0
- package/components/templates-default/index.d.ts +4 -0
- package/components/templates-default/index.js +244 -0
- package/components/{form-item-renderer-template-default → templates-default}/src/index.vue.d.ts +7 -7
- package/components/templates-default/src/types.d.ts +31 -0
- package/components/templates-default/src/types.js +1 -0
- package/components/templates-element-plus/index.d.ts +4 -0
- package/components/templates-element-plus/index.js +80 -0
- package/components/{form-item-renderer-template-layout → templates-element-plus}/src/ctx.d.ts +3 -2
- package/components/{form-item-renderer-template-layout → templates-element-plus}/src/ctx.js +1 -1
- package/components/templates-element-plus/src/index.vue.d.ts +19 -0
- package/components/templates-element-plus/src/types.d.ts +13 -0
- package/components/templates-element-plus/src/types.js +1 -0
- package/components/templates-layout/index.css +5 -0
- package/components/templates-layout/index.d.ts +4 -0
- package/components/templates-layout/index.js +108 -0
- package/components/templates-layout/src/ctx.d.ts +9 -0
- package/components/templates-layout/src/ctx.js +9 -0
- package/components/templates-layout/src/index.vue.d.ts +19 -0
- package/{shared/types/layout-source/index.d.ts → components/templates-layout/src/types.d.ts} +5 -4
- package/components/templates-layout/src/types.js +1 -0
- package/components/upload/index.css +33 -0
- package/components/upload/index.d.ts +5 -0
- package/components/upload/index.js +606 -0
- package/components/upload/src/ctx.d.ts +168 -0
- package/components/upload/src/ctx.js +45 -0
- package/components/upload/src/file.vue.d.ts +96 -0
- package/components/upload/src/index.vue.d.ts +416 -0
- package/components/upload/src/types.d.ts +7 -0
- package/components/upload/src/types.js +1 -0
- package/composables/index.d.ts +1 -0
- package/composables/index.js +28 -6
- package/composables/useForm.d.ts +9 -0
- package/composables/useSourceManager.d.ts +2 -0
- package/index.css +156 -2
- package/index.d.ts +14 -1
- package/index.esm.js +16 -5
- package/package.json +4 -1
- package/shared/element-plus/ctx.d.ts +86 -13
- package/shared/element-plus/index.js +18156 -35
- package/shared/element-plus/instances.d.ts +97 -26
- package/shared/helper/index.d.ts +1 -0
- package/shared/infer-prop/index.d.ts +17 -0
- package/shared/infer-prop/index.js +34 -0
- package/shared/progress-it/index.d.ts +16 -0
- package/shared/progress-it/index.js +57 -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 +1 -2
- package/shared/types/source/index.d.ts +12 -0
- package/shared/types/source/index.js +1 -0
- package/components/form-item-renderer-template-default/index.d.ts +0 -4
- package/components/form-item-renderer-template-default/index.js +0 -129
- package/components/form-item-renderer-template-default/src/types.d.ts +0 -1
- package/components/form-item-renderer-template-layout/index.css +0 -7
- package/components/form-item-renderer-template-layout/index.d.ts +0 -4
- package/components/form-item-renderer-template-layout/index.js +0 -91
- package/components/form-item-renderer-template-layout/src/index.vue.d.ts +0 -7
- package/components/form-item-renderer-template-layout/src/types.d.ts +0 -1
- package/shared/types/renderer-source/compoent.d.ts +0 -5
- package/shared/types/renderer-source/date-picker.d.ts +0 -7
- package/shared/types/renderer-source/index.d.ts +0 -13
- package/shared/types/renderer-source/input-number.d.ts +0 -7
- package/shared/types/renderer-source/input.d.ts +0 -7
- package/shared/types/renderer-source/select.d.ts +0 -7
- package/shared/types/renderer-source/switch.d.ts +0 -7
- /package/components/{form-item-renderer-template-default → button}/src/types.js +0 -0
- /package/components/{form-item-renderer-template-layout → cascader}/src/types.js +0 -0
- /package/{shared/types/layout-source/index.js → components/checkbox/src/types.js} +0 -0
- /package/{shared/types/renderer-source/index.js → components/color-picker/src/types.js} +0 -0
- /package/components/{form-item-renderer-template-default → templates-default}/src/ctx.d.ts +0 -0
- /package/components/{form-item-renderer-template-default → templates-default}/src/ctx.js +0 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, withCtx, createBlock, normalizeProps, mergeProps, createCommentVNode, resolveDynamicComponent } from 'vue';
|
|
2
|
+
import { VkfFormItemRendererTemplate } from '@vunk/form/components/form-item-renderer-template';
|
|
3
|
+
import { VkfInput } from '@vunk/form/components/input';
|
|
4
|
+
import { VkfSwitch } from '@vunk/form/components/switch';
|
|
5
|
+
import { VkfSelect } from '@vunk/form/components/select';
|
|
6
|
+
import { VkfDatePicker } from '@vunk/form/components/date-picker';
|
|
7
|
+
import { getValue } from '@vunk/core/shared/helper';
|
|
8
|
+
import { pickObject } from '@vunk/core/shared/utils-object';
|
|
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';
|
|
16
|
+
import { VkfInputLink } from '@vunk/form/components/input-link';
|
|
17
|
+
|
|
18
|
+
const props = {
|
|
19
|
+
data: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: () => ({})
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const emits = {
|
|
25
|
+
setData: (e) => e
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var _export_sfc = (sfc, props) => {
|
|
29
|
+
const target = sfc.__vccOpts || sfc;
|
|
30
|
+
for (const [key, val] of props) {
|
|
31
|
+
target[key] = val;
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const _sfc_main = defineComponent({
|
|
37
|
+
name: "VkfTemplatesDefault",
|
|
38
|
+
components: {
|
|
39
|
+
VkfFormItemRendererTemplate,
|
|
40
|
+
VkfInput,
|
|
41
|
+
VkfSwitch,
|
|
42
|
+
VkfSelect,
|
|
43
|
+
VkfDatePicker,
|
|
44
|
+
VkfInputNumber,
|
|
45
|
+
VkfRadio,
|
|
46
|
+
VkfCheckbox,
|
|
47
|
+
VkfUpload,
|
|
48
|
+
VkfColorPicker,
|
|
49
|
+
VkfButton,
|
|
50
|
+
VkfCascader,
|
|
51
|
+
VkfInputLink
|
|
52
|
+
},
|
|
53
|
+
emits,
|
|
54
|
+
props,
|
|
55
|
+
setup() {
|
|
56
|
+
return {
|
|
57
|
+
pickObject,
|
|
58
|
+
getValue
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
63
|
+
const _component_VkfButton = resolveComponent("VkfButton");
|
|
64
|
+
const _component_VkfFormItemRendererTemplate = resolveComponent("VkfFormItemRendererTemplate");
|
|
65
|
+
const _component_VkfColorPicker = resolveComponent("VkfColorPicker");
|
|
66
|
+
const _component_VkfUpload = resolveComponent("VkfUpload");
|
|
67
|
+
const _component_VkfCheckbox = resolveComponent("VkfCheckbox");
|
|
68
|
+
const _component_VkfRadio = resolveComponent("VkfRadio");
|
|
69
|
+
const _component_VkfInput = resolveComponent("VkfInput");
|
|
70
|
+
const _component_VkfSwitch = resolveComponent("VkfSwitch");
|
|
71
|
+
const _component_VkfSelect = resolveComponent("VkfSelect");
|
|
72
|
+
const _component_VkfDatePicker = resolveComponent("VkfDatePicker");
|
|
73
|
+
const _component_VkfInputNumber = resolveComponent("VkfInputNumber");
|
|
74
|
+
const _component_VkfCascader = resolveComponent("VkfCascader");
|
|
75
|
+
const _component_VkfInputLink = resolveComponent("VkfInputLink");
|
|
76
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
77
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfButton" }, {
|
|
78
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
79
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfButton, normalizeProps(mergeProps({ key: 0 }, sourceData)), null, 16)) : createCommentVNode("v-if", true)
|
|
80
|
+
]),
|
|
81
|
+
_: 1
|
|
82
|
+
}),
|
|
83
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfColorPicker" }, {
|
|
84
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
85
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfColorPicker, mergeProps({
|
|
86
|
+
key: 0,
|
|
87
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
88
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
89
|
+
k: sourceData.prop,
|
|
90
|
+
v: $event
|
|
91
|
+
})
|
|
92
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
93
|
+
]),
|
|
94
|
+
_: 1
|
|
95
|
+
}),
|
|
96
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfUpload" }, {
|
|
97
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
98
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfUpload, mergeProps({
|
|
99
|
+
key: 0,
|
|
100
|
+
fileList: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
101
|
+
"onUpdate:fileList": ($event) => _ctx.$emit("setData", {
|
|
102
|
+
k: sourceData.prop,
|
|
103
|
+
v: $event
|
|
104
|
+
})
|
|
105
|
+
}, sourceData), null, 16, ["fileList", "onUpdate:fileList"])) : createCommentVNode("v-if", true)
|
|
106
|
+
]),
|
|
107
|
+
_: 1
|
|
108
|
+
}),
|
|
109
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfCheckbox" }, {
|
|
110
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
111
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfCheckbox, mergeProps({
|
|
112
|
+
key: 0,
|
|
113
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
114
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
115
|
+
k: sourceData.prop,
|
|
116
|
+
v: $event
|
|
117
|
+
})
|
|
118
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
119
|
+
]),
|
|
120
|
+
_: 1
|
|
121
|
+
}),
|
|
122
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfRadio" }, {
|
|
123
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
124
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfRadio, mergeProps({
|
|
125
|
+
key: 0,
|
|
126
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
127
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
128
|
+
k: sourceData.prop,
|
|
129
|
+
v: $event
|
|
130
|
+
})
|
|
131
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
}),
|
|
135
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfInput" }, {
|
|
136
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
137
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfInput, mergeProps({
|
|
138
|
+
key: 0,
|
|
139
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
140
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
141
|
+
k: sourceData.prop,
|
|
142
|
+
v: $event
|
|
143
|
+
})
|
|
144
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
145
|
+
]),
|
|
146
|
+
_: 1
|
|
147
|
+
}),
|
|
148
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfSwitch" }, {
|
|
149
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
150
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfSwitch, mergeProps({
|
|
151
|
+
key: 0,
|
|
152
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
153
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
154
|
+
k: sourceData.prop,
|
|
155
|
+
v: $event
|
|
156
|
+
})
|
|
157
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
158
|
+
]),
|
|
159
|
+
_: 1
|
|
160
|
+
}),
|
|
161
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfSelect" }, {
|
|
162
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
163
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfSelect, mergeProps({
|
|
164
|
+
key: 0,
|
|
165
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
166
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
167
|
+
k: sourceData.prop,
|
|
168
|
+
v: $event
|
|
169
|
+
})
|
|
170
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
171
|
+
]),
|
|
172
|
+
_: 1
|
|
173
|
+
}),
|
|
174
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfDatePicker" }, {
|
|
175
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
176
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfDatePicker, mergeProps({
|
|
177
|
+
key: 0,
|
|
178
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
179
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
180
|
+
k: sourceData.prop,
|
|
181
|
+
v: $event
|
|
182
|
+
})
|
|
183
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
184
|
+
]),
|
|
185
|
+
_: 1
|
|
186
|
+
}),
|
|
187
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfInputNumber" }, {
|
|
188
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
189
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfInputNumber, mergeProps({
|
|
190
|
+
key: 0,
|
|
191
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
192
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
193
|
+
k: sourceData.prop,
|
|
194
|
+
v: $event
|
|
195
|
+
})
|
|
196
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
197
|
+
]),
|
|
198
|
+
_: 1
|
|
199
|
+
}),
|
|
200
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfCascader" }, {
|
|
201
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
202
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfCascader, mergeProps({
|
|
203
|
+
key: 0,
|
|
204
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
205
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
206
|
+
k: sourceData.prop,
|
|
207
|
+
v: $event
|
|
208
|
+
})
|
|
209
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
210
|
+
]),
|
|
211
|
+
_: 1
|
|
212
|
+
}),
|
|
213
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfInputLink" }, {
|
|
214
|
+
default: withCtx(({ data: sourceData, templateIf }) => [
|
|
215
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfInputLink, mergeProps({
|
|
216
|
+
key: 0,
|
|
217
|
+
modelValue: _ctx.getValue(_ctx.data, sourceData.prop),
|
|
218
|
+
"onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
|
|
219
|
+
k: sourceData.prop,
|
|
220
|
+
v: $event
|
|
221
|
+
})
|
|
222
|
+
}, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
|
|
223
|
+
]),
|
|
224
|
+
_: 1
|
|
225
|
+
}),
|
|
226
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "Component" }, {
|
|
227
|
+
default: withCtx(({ data, raw, templateIf }) => [
|
|
228
|
+
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)
|
|
229
|
+
]),
|
|
230
|
+
_: 1
|
|
231
|
+
})
|
|
232
|
+
], 64);
|
|
233
|
+
}
|
|
234
|
+
var VkfTemplatesDefault = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "index.vue"]]);
|
|
235
|
+
|
|
236
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
237
|
+
__proto__: null
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
VkfTemplatesDefault.install = (app) => {
|
|
241
|
+
app.component(VkfTemplatesDefault.name, VkfTemplatesDefault);
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export { VkfTemplatesDefault, types as __VkfTemplatesDefault, VkfTemplatesDefault as default };
|
package/components/{form-item-renderer-template-default → templates-default}/src/index.vue.d.ts
RENAMED
|
@@ -4,11 +4,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4
4
|
default: () => {};
|
|
5
5
|
};
|
|
6
6
|
}, {
|
|
7
|
-
pickObject: <T extends import("@vunk/core").NormalObject, EX extends (keyof T)[], KI extends keyof T>(data: T, opts?: {
|
|
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;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BasicSource } from '@vunk/form/shared';
|
|
2
|
+
import { __VkfButton } from '@vunk/form/components/button';
|
|
3
|
+
import { __VkfInput } from '@vunk/form/components/input';
|
|
4
|
+
import { __VkfDatePicker } from '@vunk/form/components/date-picker';
|
|
5
|
+
import { __VkfSelect } from '@vunk/form/components/select';
|
|
6
|
+
import { __VkfSwitch } from '@vunk/form/components/switch';
|
|
7
|
+
import { __VkfInputNumber } from '@vunk/form/components/input-number';
|
|
8
|
+
import { __VkfRadio } from '@vunk/form/components/radio';
|
|
9
|
+
import { __VkfCheckbox } from '@vunk/form/components/checkbox';
|
|
10
|
+
import { __VkfUpload } from '@vunk/form/components/upload';
|
|
11
|
+
import { __VkfColorPicker } from '@vunk/form/components/color-picker';
|
|
12
|
+
import { __VkfCascader } from '@vunk/form/components/cascader';
|
|
13
|
+
import { __VkfInputLink } from '@vunk/form/components/input-link';
|
|
14
|
+
export declare type VkfButtonSource<P extends string = string> = __VkfButton.Source<P>;
|
|
15
|
+
export declare type VkfInputSource<P extends string = string> = __VkfInput.Source<P>;
|
|
16
|
+
export declare type VkfDatePickerSource<P extends string = string> = __VkfDatePicker.Source<P>;
|
|
17
|
+
export declare type VkfSelectSource<P extends string = string> = __VkfSelect.Source<P>;
|
|
18
|
+
export declare type VkfSwitchSource<P extends string = string> = __VkfSwitch.Source<P>;
|
|
19
|
+
export declare type VkfInputNumberSource<P extends string = string> = __VkfInputNumber.Source<P>;
|
|
20
|
+
export declare type VkfRadioSource<P extends string = string> = __VkfRadio.Source<P>;
|
|
21
|
+
export declare type VkfCheckboxSource<P extends string = string> = __VkfCheckbox.Source<P>;
|
|
22
|
+
export declare type VkfUploadSource<P extends string = string> = __VkfUpload.Source<P>;
|
|
23
|
+
export declare type VkfColorPickerSource<P extends string = string> = __VkfColorPicker.Source<P>;
|
|
24
|
+
export declare type VkfCascaderSource<P extends string = string> = __VkfCascader.Source<P>;
|
|
25
|
+
export declare type VkfInputLinkSource<P extends string = string> = __VkfInputLink.Source<P>;
|
|
26
|
+
export interface ComponentSource extends BasicSource {
|
|
27
|
+
templateType: 'Component';
|
|
28
|
+
is: any;
|
|
29
|
+
}
|
|
30
|
+
export declare type CoreSource<P extends string = string> = VkfInputSource<P> | VkfSwitchSource<P> | VkfSelectSource<P> | VkfDatePickerSource<P> | VkfInputNumberSource<P> | VkfRadioSource<P> | VkfCheckboxSource<P> | VkfUploadSource<P> | VkfColorPickerSource<P> | VkfButtonSource<P> | VkfCascaderSource<P> | VkfInputLinkSource<P>;
|
|
31
|
+
export declare type Source<P extends string = string> = CoreSource<P> | ComponentSource;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, withCtx, createBlock, normalizeProps, mergeProps, createTextVNode, toDisplayString, createCommentVNode, createElementVNode } from 'vue';
|
|
2
|
+
import { VkfFormItemRendererTemplate } from '@vunk/form/components/form-item-renderer-template';
|
|
3
|
+
import { ElLink, ElDivider } from 'element-plus';
|
|
4
|
+
import { pickObject } from '@vunk/core/shared/utils-object';
|
|
5
|
+
|
|
6
|
+
const props = {
|
|
7
|
+
data: {
|
|
8
|
+
type: Object,
|
|
9
|
+
default: () => ({})
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const emits = {};
|
|
13
|
+
|
|
14
|
+
var _export_sfc = (sfc, props) => {
|
|
15
|
+
const target = sfc.__vccOpts || sfc;
|
|
16
|
+
for (const [key, val] of props) {
|
|
17
|
+
target[key] = val;
|
|
18
|
+
}
|
|
19
|
+
return target;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const _sfc_main = defineComponent({
|
|
23
|
+
name: "VkfTemplatesElementPlus",
|
|
24
|
+
components: {
|
|
25
|
+
VkfFormItemRendererTemplate,
|
|
26
|
+
ElLink,
|
|
27
|
+
ElDivider
|
|
28
|
+
},
|
|
29
|
+
emits,
|
|
30
|
+
props,
|
|
31
|
+
setup() {
|
|
32
|
+
return {
|
|
33
|
+
pickObject
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
38
|
+
const _component_ElLink = resolveComponent("ElLink");
|
|
39
|
+
const _component_VkfFormItemRendererTemplate = resolveComponent("VkfFormItemRendererTemplate");
|
|
40
|
+
const _component_ElDivider = resolveComponent("ElDivider");
|
|
41
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
42
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "ElLink" }, {
|
|
43
|
+
default: withCtx(({ data: props2, templateIf }) => [
|
|
44
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_ElLink, normalizeProps(mergeProps({ key: 0 }, _ctx.pickObject(props2, {
|
|
45
|
+
excludes: ["label"]
|
|
46
|
+
}))), {
|
|
47
|
+
default: withCtx(() => [
|
|
48
|
+
createTextVNode(toDisplayString(props2.label), 1)
|
|
49
|
+
]),
|
|
50
|
+
_: 2
|
|
51
|
+
}, 1040)) : createCommentVNode("v-if", true)
|
|
52
|
+
]),
|
|
53
|
+
_: 1
|
|
54
|
+
}),
|
|
55
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "ElDivider" }, {
|
|
56
|
+
default: withCtx(({ data: props2, templateIf }) => [
|
|
57
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_ElDivider, normalizeProps(mergeProps({ key: 0 }, _ctx.pickObject(props2, {
|
|
58
|
+
excludes: ["label"]
|
|
59
|
+
}))), {
|
|
60
|
+
default: withCtx(() => [
|
|
61
|
+
createElementVNode("span", null, toDisplayString(props2.label), 1)
|
|
62
|
+
]),
|
|
63
|
+
_: 2
|
|
64
|
+
}, 1040)) : createCommentVNode("v-if", true)
|
|
65
|
+
]),
|
|
66
|
+
_: 1
|
|
67
|
+
})
|
|
68
|
+
], 64);
|
|
69
|
+
}
|
|
70
|
+
var VkfTemplatesElementPlus = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "index.vue"]]);
|
|
71
|
+
|
|
72
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
73
|
+
__proto__: null
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
VkfTemplatesElementPlus.install = (app) => {
|
|
77
|
+
app.component(VkfTemplatesElementPlus.name, VkfTemplatesElementPlus);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export { VkfTemplatesElementPlus, types as __VkfTemplatesElementPlus, VkfTemplatesElementPlus as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ElDivider, ElLink } from 'element-plus';
|
|
2
|
+
import { VueComponentPropsType } from '@vunk/core';
|
|
3
|
+
import { BasicSource } from '@vunk/form/shared';
|
|
4
|
+
export interface ElDividerSource extends VueComponentPropsType<typeof ElDivider>, BasicSource {
|
|
5
|
+
templateType: 'ElDivider';
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ElLinkSource extends VueComponentPropsType<typeof ElLink>, BasicSource {
|
|
9
|
+
templateType: 'ElLink';
|
|
10
|
+
label: string;
|
|
11
|
+
target?: '_blank';
|
|
12
|
+
}
|
|
13
|
+
export declare type Source = ElDividerSource | ElLinkSource;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, withCtx, createBlock, normalizeProps, mergeProps, resolveDynamicComponent, createCommentVNode } from 'vue';
|
|
2
|
+
import { VkfFormItemRendererTemplate } from '@vunk/form/components/form-item-renderer-template';
|
|
3
|
+
import { ElRow, ElCol } from 'element-plus';
|
|
4
|
+
import { pickObject } from '@vunk/core/shared/utils-object';
|
|
5
|
+
|
|
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({
|
|
22
|
+
name: "VkfTemplatesLayout",
|
|
23
|
+
props,
|
|
24
|
+
components: {
|
|
25
|
+
ElRow,
|
|
26
|
+
ElCol,
|
|
27
|
+
VkfFormItemRendererTemplate
|
|
28
|
+
},
|
|
29
|
+
setup() {
|
|
30
|
+
return {
|
|
31
|
+
pickObject
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
36
|
+
const _component_ElRow = resolveComponent("ElRow");
|
|
37
|
+
const _component_VkfFormItemRendererTemplate = resolveComponent("VkfFormItemRendererTemplate");
|
|
38
|
+
const _component_ElCol = resolveComponent("ElCol");
|
|
39
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
40
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "ElRow" }, {
|
|
41
|
+
default: withCtx(({ data: props2, Renderer, raw, k, templateIf }) => [
|
|
42
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_ElRow, normalizeProps(mergeProps({ key: 0 }, props2)), {
|
|
43
|
+
default: withCtx(() => [
|
|
44
|
+
(openBlock(), createBlock(resolveDynamicComponent(Renderer), {
|
|
45
|
+
source: raw.templateSlots,
|
|
46
|
+
k: [...k, "templateSlots"]
|
|
47
|
+
}, null, 8, ["source", "k"]))
|
|
48
|
+
]),
|
|
49
|
+
_: 2
|
|
50
|
+
}, 1040)) : createCommentVNode("v-if", true)
|
|
51
|
+
]),
|
|
52
|
+
_: 1
|
|
53
|
+
}),
|
|
54
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "ElCol" }, {
|
|
55
|
+
default: withCtx(({ data: props2, Renderer, raw, k, templateIf }) => [
|
|
56
|
+
templateIf(_ctx.data) ? (openBlock(), createBlock(_component_ElCol, normalizeProps(mergeProps({ key: 0 }, props2)), {
|
|
57
|
+
default: withCtx(() => [
|
|
58
|
+
(openBlock(), createBlock(resolveDynamicComponent(Renderer), {
|
|
59
|
+
source: raw.templateSlots,
|
|
60
|
+
k: [...k, "templateSlots"]
|
|
61
|
+
}, null, 8, ["source", "k"]))
|
|
62
|
+
]),
|
|
63
|
+
_: 2
|
|
64
|
+
}, 1040)) : createCommentVNode("v-if", true)
|
|
65
|
+
]),
|
|
66
|
+
_: 1
|
|
67
|
+
}),
|
|
68
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfFlex" }, {
|
|
69
|
+
default: withCtx(({ data: props2, Renderer, raw, k, templateIf }) => [
|
|
70
|
+
templateIf(_ctx.data) ? (openBlock(), createElementBlock("div", mergeProps({
|
|
71
|
+
key: 0,
|
|
72
|
+
class: "vkf-flex",
|
|
73
|
+
style: {
|
|
74
|
+
"justify-content": props2.justify,
|
|
75
|
+
"flex-direction": props2.direction,
|
|
76
|
+
"align-items": props2.align,
|
|
77
|
+
"overflow": props2.overflow,
|
|
78
|
+
"flex-grow": props2.grow,
|
|
79
|
+
"flex-shrink": props2.shrink,
|
|
80
|
+
"flex-basis": props2.basis
|
|
81
|
+
}
|
|
82
|
+
}, _ctx.pickObject(
|
|
83
|
+
props2,
|
|
84
|
+
{
|
|
85
|
+
excludes: ["justify", "direction", "align", "overflow", "grow", "shrink", "basis"]
|
|
86
|
+
}
|
|
87
|
+
)), [
|
|
88
|
+
(openBlock(), createBlock(resolveDynamicComponent(Renderer), {
|
|
89
|
+
source: raw.templateSlots,
|
|
90
|
+
k: [...k, "templateSlots"]
|
|
91
|
+
}, null, 8, ["source", "k"]))
|
|
92
|
+
], 16)) : createCommentVNode("v-if", true)
|
|
93
|
+
]),
|
|
94
|
+
_: 1
|
|
95
|
+
})
|
|
96
|
+
], 64);
|
|
97
|
+
}
|
|
98
|
+
var VkfTemplatesLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "index.vue"]]);
|
|
99
|
+
|
|
100
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
101
|
+
__proto__: null
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
VkfTemplatesLayout.install = (app) => {
|
|
105
|
+
app.component(VkfTemplatesLayout.name, VkfTemplatesLayout);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export { VkfTemplatesLayout, types as __VkfTemplatesLayout, VkfTemplatesLayout as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}>;
|
|
19
|
+
export default _default;
|
package/{shared/types/layout-source/index.d.ts → components/templates-layout/src/types.d.ts}
RENAMED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { VueComponentPropsType } from '@vunk/core';
|
|
2
2
|
import { ElCol, ElRow } from 'element-plus';
|
|
3
|
-
|
|
3
|
+
import { BasicSource } from '@vunk/form/shared';
|
|
4
|
+
export interface ElRowSource<S> extends VueComponentPropsType<typeof ElRow>, BasicSource {
|
|
4
5
|
templateType: 'ElRow';
|
|
5
6
|
templateSlots: S[];
|
|
6
7
|
}
|
|
7
|
-
export interface ElColSource<S> extends VueComponentPropsType<typeof ElCol
|
|
8
|
+
export interface ElColSource<S> extends VueComponentPropsType<typeof ElCol>, BasicSource {
|
|
8
9
|
templateType: 'ElCol';
|
|
9
10
|
templateSlots: S[];
|
|
10
11
|
}
|
|
@@ -22,10 +23,10 @@ interface VkfFlexItem {
|
|
|
22
23
|
basis?: string | IntrinsicSizing | GlobalValues | 'revert' | 'revert-layer' | 'content';
|
|
23
24
|
overflow?: 'hidden' | 'visible' | 'scroll' | 'auto' | string;
|
|
24
25
|
}
|
|
25
|
-
export interface VkfFlexSource<S> extends VkfFlex, VkfFlexItem {
|
|
26
|
+
export interface VkfFlexSource<S> extends VkfFlex, VkfFlexItem, BasicSource {
|
|
26
27
|
templateType: 'VkfFlex';
|
|
27
28
|
templateSlots?: S[];
|
|
28
29
|
[s: string]: any;
|
|
29
30
|
}
|
|
30
|
-
export declare type
|
|
31
|
+
export declare type Source<S> = ElRowSource<S> | ElColSource<S> | VkfFlexSource<S>;
|
|
31
32
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|