@vunk/form 0.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/config/index.d.ts +4 -0
- package/components/config/index.js +78 -0
- package/components/config/src/ctx.d.ts +22 -0
- package/components/config/src/index.vue.d.ts +45 -0
- package/components/config-renderer/index.d.ts +6 -0
- package/components/config-renderer/index.js +57 -0
- package/components/config-renderer/src/ctx.d.ts +11 -0
- package/components/config-renderer/src/index.vue.d.ts +26 -0
- package/components/config-renderer/src/symbols.d.ts +2 -0
- package/components/config-renderer/src/types.d.ts +3 -0
- package/components/config-renderer-template/index.d.ts +3 -0
- package/components/config-renderer-template/index.js +37 -0
- package/components/config-renderer-template/src/ctx.d.ts +7 -0
- package/components/config-renderer-template/src/index.vue.d.ts +16 -0
- package/components/confirm-input/index.css +9 -0
- package/components/confirm-input/index.d.ts +3 -0
- package/components/confirm-input/index.js +124 -0
- package/components/confirm-input/src/ctx.d.ts +67 -0
- package/components/confirm-input/src/index.vue.d.ts +218 -0
- package/components/drag-wrapper/index.d.ts +4 -0
- package/components/drag-wrapper/index.js +53 -0
- package/components/drag-wrapper/src/ctx.d.ts +11 -0
- package/components/drag-wrapper/src/index.vue.d.ts +25 -0
- package/components/drag-wrapper/src/types.d.ts +3 -0
- package/components/drop-wrapper/index.d.ts +4 -0
- package/components/drop-wrapper/index.js +67 -0
- package/components/drop-wrapper/src/index.vue.d.ts +14 -0
- package/components/drop-wrapper/src/static.d.ts +5 -0
- package/components/form/index.d.ts +5 -0
- package/components/form/index.js +97 -0
- package/components/form/src/ctx.d.ts +37 -0
- package/components/form/src/index.vue.d.ts +100 -0
- package/components/form/src/utils.d.ts +2 -0
- package/components/form-item-renderer/index.d.ts +6 -0
- package/components/form-item-renderer/index.js +90 -0
- package/components/form-item-renderer/src/ctx.d.ts +16 -0
- package/components/form-item-renderer/src/index.vue.d.ts +38 -0
- package/components/form-item-renderer/src/symbols.d.ts +2 -0
- package/components/form-item-renderer/src/types.d.ts +5 -0
- package/components/form-item-renderer/src/utils.d.ts +3 -0
- package/components/form-item-renderer-template/index.d.ts +3 -0
- package/components/form-item-renderer-template/index.js +37 -0
- package/components/form-item-renderer-template/src/ctx.d.ts +7 -0
- package/components/form-item-renderer-template/src/index.vue.d.ts +16 -0
- package/components/ground/index.css +84 -0
- package/components/ground/index.d.ts +4 -0
- package/components/ground/index.js +883 -0
- package/components/ground/src/ctx.d.ts +11 -0
- package/components/ground/src/ground-config/index.d.ts +3 -0
- package/components/ground/src/ground-config/src/index.vue.d.ts +69 -0
- package/components/ground/src/ground-main/index.d.ts +3 -0
- package/components/ground/src/ground-main/src/ctx.d.ts +2 -0
- package/components/ground/src/ground-main/src/editing-wrapper.vue.d.ts +28 -0
- package/components/ground/src/ground-main/src/index.vue.d.ts +47 -0
- package/components/ground/src/ground-main/src/types.d.ts +9 -0
- package/components/ground/src/ground-widget/index.d.ts +3 -0
- package/components/ground/src/ground-widget/src/ctx.d.ts +2 -0
- package/components/ground/src/ground-widget/src/form-item-widget/index.d.ts +2 -0
- package/components/ground/src/ground-widget/src/form-item-widget/src/index.vue.d.ts +214 -0
- package/components/ground/src/ground-widget/src/index.vue.d.ts +13 -0
- package/components/ground/src/ground-widget/src/static.d.ts +4 -0
- package/components/ground/src/index.vue.d.ts +20 -0
- package/components/ground/src/types.d.ts +3 -0
- package/components/input/index.d.ts +5 -0
- package/components/input/index.js +105 -0
- package/components/input/src/ctx.d.ts +66 -0
- package/components/input/src/index.vue.d.ts +205 -0
- package/components/input/src/types.d.ts +12 -0
- package/components/input-config/index.d.ts +4 -0
- package/components/input-config/index.js +97 -0
- package/components/input-config/src/ctx.d.ts +39 -0
- package/components/input-config/src/index.vue.d.ts +125 -0
- package/components/input-config/src/types.d.ts +3 -0
- package/full-entry/main.d.ts +11 -0
- package/index.css +94 -0
- package/index.d.ts +23 -0
- package/index.esm.js +11 -0
- package/package.json +12 -0
- package/shared/element-plus/ctx/index.d.ts +5 -0
- package/shared/element-plus/ctx/index.js +10 -0
- package/shared/helper/index.d.ts +2 -0
- package/shared/helper/index.js +1 -0
- package/shared/types/form-item/index.d.ts +1 -0
- package/shared/types/form-item/index.js +1 -0
- package/shared/types/form-item/input.d.ts +12 -0
- package/shared/types/form-item/input.js +1 -0
- package/shared/types/index.d.ts +3 -0
- package/shared/types/index.js +1 -0
- package/shared/types/shared/index.d.ts +6 -0
- package/shared/types/shared/index.js +1 -0
- package/types/components/config/index.d.ts +4 -0
- package/types/components/config/src/ctx.d.ts +22 -0
- package/types/components/config/src/index.vue.d.ts +45 -0
- package/types/components/config-renderer/index.d.ts +6 -0
- package/types/components/config-renderer/src/ctx.d.ts +11 -0
- package/types/components/config-renderer/src/index.vue.d.ts +26 -0
- package/types/components/config-renderer/src/symbols.d.ts +2 -0
- package/types/components/config-renderer/src/types.d.ts +3 -0
- package/types/components/config-renderer-template/index.d.ts +3 -0
- package/types/components/config-renderer-template/src/ctx.d.ts +7 -0
- package/types/components/config-renderer-template/src/index.vue.d.ts +16 -0
- package/types/components/confirm-input/index.d.ts +3 -0
- package/types/components/confirm-input/src/ctx.d.ts +67 -0
- package/types/components/confirm-input/src/index.vue.d.ts +218 -0
- package/types/components/drag-wrapper/index.d.ts +4 -0
- package/types/components/drag-wrapper/src/ctx.d.ts +11 -0
- package/types/components/drag-wrapper/src/index.vue.d.ts +25 -0
- package/types/components/drag-wrapper/src/types.d.ts +3 -0
- package/types/components/drop-wrapper/index.d.ts +4 -0
- package/types/components/drop-wrapper/src/index.vue.d.ts +14 -0
- package/types/components/drop-wrapper/src/static.d.ts +5 -0
- package/types/components/form/index.d.ts +5 -0
- package/types/components/form/src/ctx.d.ts +37 -0
- package/types/components/form/src/index.vue.d.ts +100 -0
- package/types/components/form/src/utils.d.ts +2 -0
- package/types/components/form-item-renderer/index.d.ts +6 -0
- package/types/components/form-item-renderer/src/ctx.d.ts +16 -0
- package/types/components/form-item-renderer/src/index.vue.d.ts +38 -0
- package/types/components/form-item-renderer/src/symbols.d.ts +2 -0
- package/types/components/form-item-renderer/src/types.d.ts +5 -0
- package/types/components/form-item-renderer/src/utils.d.ts +3 -0
- package/types/components/form-item-renderer-template/index.d.ts +3 -0
- package/types/components/form-item-renderer-template/src/ctx.d.ts +7 -0
- package/types/components/form-item-renderer-template/src/index.vue.d.ts +16 -0
- package/types/components/ground/index.d.ts +4 -0
- package/types/components/ground/src/ctx.d.ts +11 -0
- package/types/components/ground/src/ground-config/index.d.ts +3 -0
- package/types/components/ground/src/ground-config/src/index.vue.d.ts +69 -0
- package/types/components/ground/src/ground-main/index.d.ts +3 -0
- package/types/components/ground/src/ground-main/src/ctx.d.ts +2 -0
- package/types/components/ground/src/ground-main/src/editing-wrapper.vue.d.ts +28 -0
- package/types/components/ground/src/ground-main/src/index.vue.d.ts +47 -0
- package/types/components/ground/src/ground-main/src/types.d.ts +9 -0
- package/types/components/ground/src/ground-widget/index.d.ts +3 -0
- package/types/components/ground/src/ground-widget/src/ctx.d.ts +2 -0
- package/types/components/ground/src/ground-widget/src/form-item-widget/index.d.ts +2 -0
- package/types/components/ground/src/ground-widget/src/form-item-widget/src/index.vue.d.ts +214 -0
- package/types/components/ground/src/ground-widget/src/index.vue.d.ts +13 -0
- package/types/components/ground/src/ground-widget/src/static.d.ts +4 -0
- package/types/components/ground/src/index.vue.d.ts +20 -0
- package/types/components/ground/src/types.d.ts +3 -0
- package/types/components/input/index.d.ts +5 -0
- package/types/components/input/src/ctx.d.ts +66 -0
- package/types/components/input/src/index.vue.d.ts +205 -0
- package/types/components/input/src/types.d.ts +12 -0
- package/types/components/input-config/index.d.ts +4 -0
- package/types/components/input-config/src/ctx.d.ts +39 -0
- package/types/components/input-config/src/index.vue.d.ts +125 -0
- package/types/components/input-config/src/types.d.ts +3 -0
- package/types/full-entry/main.d.ts +11 -0
- package/types/shared/element-plus/ctx/index.d.ts +5 -0
- package/types/shared/helper/index.d.ts +2 -0
- package/types/shared/types/form-item/index.d.ts +1 -0
- package/types/shared/types/form-item/input.d.ts +12 -0
- package/types/shared/types/index.d.ts +3 -0
- package/types/shared/types/shared/index.d.ts +6 -0
|
@@ -0,0 +1,883 @@
|
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, Fragment, renderList, toDisplayString, ref, createVNode, withDirectives, vShow, createTextVNode, withModifiers, renderSlot, computed, createCommentVNode, resolveDynamicComponent, normalizeClass, mergeProps, toHandlers } from 'vue';
|
|
2
|
+
import { VkTabGroup, VkTabItem, VkCard, VkBoxHandler } from 'vunk';
|
|
3
|
+
import { VkFloatBlock } from 'vunk/gsap/components/float-block';
|
|
4
|
+
import { ElCollapseItem, ElScrollbar, ElCollapse, ElIcon, ElMessage } from 'element-plus';
|
|
5
|
+
import { VkfDragWrapper } from '@vunk/form/components/drag-wrapper';
|
|
6
|
+
import 'vunk/gsap/components/float-block/index.css';
|
|
7
|
+
import { _VkfFormUtils, VkfForm } from '@vunk/form/components/form';
|
|
8
|
+
import { VkfDropWrapper, DragoverClasses } from '@vunk/form/components/drop-wrapper';
|
|
9
|
+
import { VkfFormItemRendererTemplate } from '@vunk/form/components/form-item-renderer-template';
|
|
10
|
+
import { setData, unsetData } from 'vunk/shared/helper';
|
|
11
|
+
import { VkfConfig, _VkfConfigCtx } from '@vunk/form/components/config';
|
|
12
|
+
|
|
13
|
+
var script$5 = defineComponent({
|
|
14
|
+
components: {
|
|
15
|
+
ElCollapseItem,
|
|
16
|
+
VkfDragWrapper
|
|
17
|
+
},
|
|
18
|
+
setup() {
|
|
19
|
+
const data = [
|
|
20
|
+
{
|
|
21
|
+
label: "input",
|
|
22
|
+
value: "VkfInput",
|
|
23
|
+
defaultOptions: {
|
|
24
|
+
templateType: "VkfInput",
|
|
25
|
+
prop: "",
|
|
26
|
+
label: "inputLabel"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
];
|
|
30
|
+
return {
|
|
31
|
+
data
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const _hoisted_1$5 = { class: "vkf-ground-widget-ul" };
|
|
37
|
+
function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
38
|
+
const _component_VkfDragWrapper = resolveComponent("VkfDragWrapper");
|
|
39
|
+
const _component_ElCollapseItem = resolveComponent("ElCollapseItem");
|
|
40
|
+
return openBlock(), createBlock(_component_ElCollapseItem, { title: "FormItems" }, {
|
|
41
|
+
default: withCtx(() => [
|
|
42
|
+
createElementVNode("ul", _hoisted_1$5, [
|
|
43
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data, (item) => {
|
|
44
|
+
return openBlock(), createBlock(_component_VkfDragWrapper, {
|
|
45
|
+
key: item.value,
|
|
46
|
+
data: JSON.stringify(item.defaultOptions)
|
|
47
|
+
}, {
|
|
48
|
+
default: withCtx(() => [
|
|
49
|
+
createElementVNode("li", null, toDisplayString(item.label), 1)
|
|
50
|
+
]),
|
|
51
|
+
_: 2
|
|
52
|
+
}, 1032, ["data"]);
|
|
53
|
+
}), 128))
|
|
54
|
+
])
|
|
55
|
+
]),
|
|
56
|
+
_: 1
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
script$5.render = render$5;
|
|
61
|
+
script$5.__file = "ground/src/ground-widget/src/form-item-widget/src/index.vue";
|
|
62
|
+
|
|
63
|
+
var ComponentsType = /* @__PURE__ */ ((ComponentsType2) => {
|
|
64
|
+
ComponentsType2[ComponentsType2["container"] = 0] = "container";
|
|
65
|
+
ComponentsType2[ComponentsType2["formItems"] = 1] = "formItems";
|
|
66
|
+
return ComponentsType2;
|
|
67
|
+
})(ComponentsType || {});
|
|
68
|
+
|
|
69
|
+
var WidgetTab = /* @__PURE__ */ ((WidgetTab2) => {
|
|
70
|
+
WidgetTab2[WidgetTab2["components"] = 0] = "components";
|
|
71
|
+
WidgetTab2[WidgetTab2["templates"] = 1] = "templates";
|
|
72
|
+
return WidgetTab2;
|
|
73
|
+
})(WidgetTab || {});
|
|
74
|
+
var script$4 = defineComponent({
|
|
75
|
+
components: {
|
|
76
|
+
VkTabGroup,
|
|
77
|
+
VkTabItem,
|
|
78
|
+
VkFloatBlock,
|
|
79
|
+
VkCard,
|
|
80
|
+
ElScrollbar,
|
|
81
|
+
ElCollapse,
|
|
82
|
+
FormItemWidget: script$5
|
|
83
|
+
},
|
|
84
|
+
setup() {
|
|
85
|
+
const widgetTab = ref(0 /* components */);
|
|
86
|
+
const componentsType = ref([
|
|
87
|
+
ComponentsType.container,
|
|
88
|
+
ComponentsType.formItems
|
|
89
|
+
]);
|
|
90
|
+
return {
|
|
91
|
+
WidgetTab,
|
|
92
|
+
ComponentsType,
|
|
93
|
+
widgetTab,
|
|
94
|
+
componentsType
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const _hoisted_1$4 = /* @__PURE__ */ createTextVNode(" \u7EC4\u4EF6\u5E93 ");
|
|
100
|
+
const _hoisted_2$2 = /* @__PURE__ */ createTextVNode(" \u6A21\u677F\u5E93 ");
|
|
101
|
+
function render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
102
|
+
const _component_VkTabItem = resolveComponent("VkTabItem");
|
|
103
|
+
const _component_VkFloatBlock = resolveComponent("VkFloatBlock");
|
|
104
|
+
const _component_VkTabGroup = resolveComponent("VkTabGroup");
|
|
105
|
+
const _component_FormItemWidget = resolveComponent("FormItemWidget");
|
|
106
|
+
const _component_ElCollapse = resolveComponent("ElCollapse");
|
|
107
|
+
const _component_ElScrollbar = resolveComponent("ElScrollbar");
|
|
108
|
+
const _component_VkCard = resolveComponent("VkCard");
|
|
109
|
+
return openBlock(), createBlock(_component_VkCard, { tag: "div" }, {
|
|
110
|
+
title: withCtx(() => [
|
|
111
|
+
createVNode(_component_VkTabGroup, {
|
|
112
|
+
class: "vkf-widget-tab",
|
|
113
|
+
modelValue: _ctx.widgetTab,
|
|
114
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.widgetTab = $event)
|
|
115
|
+
}, {
|
|
116
|
+
default: withCtx(() => [
|
|
117
|
+
createVNode(_component_VkTabItem, {
|
|
118
|
+
name: _ctx.WidgetTab.components
|
|
119
|
+
}, {
|
|
120
|
+
default: withCtx(() => [
|
|
121
|
+
_hoisted_1$4
|
|
122
|
+
]),
|
|
123
|
+
_: 1
|
|
124
|
+
}, 8, ["name"]),
|
|
125
|
+
createVNode(_component_VkTabItem, {
|
|
126
|
+
name: _ctx.WidgetTab.templates
|
|
127
|
+
}, {
|
|
128
|
+
default: withCtx(() => [
|
|
129
|
+
_hoisted_2$2
|
|
130
|
+
]),
|
|
131
|
+
_: 1
|
|
132
|
+
}, 8, ["name"]),
|
|
133
|
+
createVNode(_component_VkFloatBlock, { scale: 0.8 })
|
|
134
|
+
]),
|
|
135
|
+
_: 1
|
|
136
|
+
}, 8, ["modelValue"])
|
|
137
|
+
]),
|
|
138
|
+
default: withCtx(() => [
|
|
139
|
+
createVNode(_component_ElScrollbar, null, {
|
|
140
|
+
default: withCtx(() => [
|
|
141
|
+
withDirectives(createVNode(_component_ElCollapse, {
|
|
142
|
+
modelValue: _ctx.componentsType,
|
|
143
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.componentsType = $event)
|
|
144
|
+
}, {
|
|
145
|
+
default: withCtx(() => [
|
|
146
|
+
createVNode(_component_FormItemWidget, {
|
|
147
|
+
name: _ctx.ComponentsType.formItems
|
|
148
|
+
}, null, 8, ["name"])
|
|
149
|
+
]),
|
|
150
|
+
_: 1
|
|
151
|
+
}, 8, ["modelValue"]), [
|
|
152
|
+
[vShow, _ctx.widgetTab === _ctx.WidgetTab.components]
|
|
153
|
+
])
|
|
154
|
+
]),
|
|
155
|
+
_: 1
|
|
156
|
+
})
|
|
157
|
+
]),
|
|
158
|
+
_: 1
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
script$4.render = render$4;
|
|
163
|
+
script$4.__file = "ground/src/ground-widget/src/index.vue";
|
|
164
|
+
|
|
165
|
+
var _export_sfc = (sfc, props) => {
|
|
166
|
+
const target = sfc.__vccOpts || sfc;
|
|
167
|
+
for (const [key, val] of props) {
|
|
168
|
+
target[key] = val;
|
|
169
|
+
}
|
|
170
|
+
return target;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const _sfc_main = defineComponent({
|
|
174
|
+
name: "Sort"
|
|
175
|
+
});
|
|
176
|
+
const _hoisted_1$3 = {
|
|
177
|
+
viewBox: "0 0 1024 1024",
|
|
178
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
179
|
+
};
|
|
180
|
+
const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("path", {
|
|
181
|
+
fill: "currentColor",
|
|
182
|
+
d: "M384 96a32 32 0 0 1 64 0v786.752a32 32 0 0 1-54.592 22.656L95.936 608a32 32 0 0 1 0-45.312h.128a32 32 0 0 1 45.184 0L384 805.632V96zm192 45.248a32 32 0 0 1 54.592-22.592L928.064 416a32 32 0 0 1 0 45.312h-.128a32 32 0 0 1-45.184 0L640 218.496V928a32 32 0 1 1-64 0V141.248z"
|
|
183
|
+
}, null, -1);
|
|
184
|
+
const _hoisted_3$1 = [
|
|
185
|
+
_hoisted_2$1
|
|
186
|
+
];
|
|
187
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
188
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$3, _hoisted_3$1);
|
|
189
|
+
}
|
|
190
|
+
var sort = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
191
|
+
|
|
192
|
+
var script$3 = defineComponent({
|
|
193
|
+
props: {
|
|
194
|
+
active: {
|
|
195
|
+
type: Boolean,
|
|
196
|
+
default: false
|
|
197
|
+
},
|
|
198
|
+
source: {
|
|
199
|
+
type: Object,
|
|
200
|
+
default: () => ({})
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
components: {
|
|
204
|
+
VkBoxHandler,
|
|
205
|
+
ElIcon,
|
|
206
|
+
Sort: sort,
|
|
207
|
+
VkfDragWrapper,
|
|
208
|
+
VkfDropWrapper
|
|
209
|
+
},
|
|
210
|
+
setup() {
|
|
211
|
+
const dragover = (e) => {
|
|
212
|
+
};
|
|
213
|
+
const drop = (e) => {
|
|
214
|
+
};
|
|
215
|
+
return {
|
|
216
|
+
dragover,
|
|
217
|
+
drop
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
const _hoisted_1$2 = /* @__PURE__ */ createTextVNode(" \u62D6\u52A8\u5355\u5143 ");
|
|
223
|
+
function render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
224
|
+
const _component_Sort = resolveComponent("Sort");
|
|
225
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
226
|
+
const _component_VkfDragWrapper = resolveComponent("VkfDragWrapper");
|
|
227
|
+
const _component_VkBoxHandler = resolveComponent("VkBoxHandler");
|
|
228
|
+
const _component_VkfDropWrapper = resolveComponent("VkfDropWrapper");
|
|
229
|
+
return openBlock(), createBlock(_component_VkfDropWrapper, {
|
|
230
|
+
onDragover: withModifiers(_ctx.dragover, ["stop"]),
|
|
231
|
+
class: "vkf-ground-main-editing-wrapper"
|
|
232
|
+
}, {
|
|
233
|
+
default: withCtx(() => [
|
|
234
|
+
withDirectives(createVNode(_component_VkBoxHandler, null, {
|
|
235
|
+
default: withCtx(() => [
|
|
236
|
+
createVNode(_component_VkfDragWrapper, {
|
|
237
|
+
title: JSON.stringify(_ctx.source),
|
|
238
|
+
data: JSON.stringify(_ctx.source),
|
|
239
|
+
class: "vkf-gmew-drag-wrapper"
|
|
240
|
+
}, {
|
|
241
|
+
default: withCtx(() => [
|
|
242
|
+
createVNode(_component_el_icon, null, {
|
|
243
|
+
default: withCtx(() => [
|
|
244
|
+
createVNode(_component_Sort)
|
|
245
|
+
]),
|
|
246
|
+
_: 1
|
|
247
|
+
}),
|
|
248
|
+
_hoisted_1$2
|
|
249
|
+
]),
|
|
250
|
+
_: 1
|
|
251
|
+
}, 8, ["title", "data"])
|
|
252
|
+
]),
|
|
253
|
+
_: 1
|
|
254
|
+
}, 512), [
|
|
255
|
+
[vShow, _ctx.active]
|
|
256
|
+
]),
|
|
257
|
+
renderSlot(_ctx.$slots, "default")
|
|
258
|
+
]),
|
|
259
|
+
_: 3
|
|
260
|
+
}, 8, ["onDragover"]);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
script$3.render = render$3;
|
|
264
|
+
script$3.__file = "ground/src/ground-main/src/editing-wrapper.vue";
|
|
265
|
+
|
|
266
|
+
/** Detect free variable `global` from Node.js. */
|
|
267
|
+
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
|
268
|
+
|
|
269
|
+
var freeGlobal$1 = freeGlobal;
|
|
270
|
+
|
|
271
|
+
/** Detect free variable `self`. */
|
|
272
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
273
|
+
|
|
274
|
+
/** Used as a reference to the global object. */
|
|
275
|
+
var root = freeGlobal$1 || freeSelf || Function('return this')();
|
|
276
|
+
|
|
277
|
+
var root$1 = root;
|
|
278
|
+
|
|
279
|
+
/** Built-in value references. */
|
|
280
|
+
var Symbol = root$1.Symbol;
|
|
281
|
+
|
|
282
|
+
var Symbol$1 = Symbol;
|
|
283
|
+
|
|
284
|
+
/** Used for built-in method references. */
|
|
285
|
+
var objectProto$1 = Object.prototype;
|
|
286
|
+
|
|
287
|
+
/** Used to check objects for own properties. */
|
|
288
|
+
var hasOwnProperty = objectProto$1.hasOwnProperty;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Used to resolve the
|
|
292
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
293
|
+
* of values.
|
|
294
|
+
*/
|
|
295
|
+
var nativeObjectToString$1 = objectProto$1.toString;
|
|
296
|
+
|
|
297
|
+
/** Built-in value references. */
|
|
298
|
+
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
302
|
+
*
|
|
303
|
+
* @private
|
|
304
|
+
* @param {*} value The value to query.
|
|
305
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
306
|
+
*/
|
|
307
|
+
function getRawTag(value) {
|
|
308
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag$1),
|
|
309
|
+
tag = value[symToStringTag$1];
|
|
310
|
+
|
|
311
|
+
try {
|
|
312
|
+
value[symToStringTag$1] = undefined;
|
|
313
|
+
var unmasked = true;
|
|
314
|
+
} catch (e) {}
|
|
315
|
+
|
|
316
|
+
var result = nativeObjectToString$1.call(value);
|
|
317
|
+
if (unmasked) {
|
|
318
|
+
if (isOwn) {
|
|
319
|
+
value[symToStringTag$1] = tag;
|
|
320
|
+
} else {
|
|
321
|
+
delete value[symToStringTag$1];
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return result;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/** Used for built-in method references. */
|
|
328
|
+
var objectProto = Object.prototype;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Used to resolve the
|
|
332
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
333
|
+
* of values.
|
|
334
|
+
*/
|
|
335
|
+
var nativeObjectToString = objectProto.toString;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
339
|
+
*
|
|
340
|
+
* @private
|
|
341
|
+
* @param {*} value The value to convert.
|
|
342
|
+
* @returns {string} Returns the converted string.
|
|
343
|
+
*/
|
|
344
|
+
function objectToString(value) {
|
|
345
|
+
return nativeObjectToString.call(value);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/** `Object#toString` result references. */
|
|
349
|
+
var nullTag = '[object Null]',
|
|
350
|
+
undefinedTag = '[object Undefined]';
|
|
351
|
+
|
|
352
|
+
/** Built-in value references. */
|
|
353
|
+
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
357
|
+
*
|
|
358
|
+
* @private
|
|
359
|
+
* @param {*} value The value to query.
|
|
360
|
+
* @returns {string} Returns the `toStringTag`.
|
|
361
|
+
*/
|
|
362
|
+
function baseGetTag(value) {
|
|
363
|
+
if (value == null) {
|
|
364
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
365
|
+
}
|
|
366
|
+
return (symToStringTag && symToStringTag in Object(value))
|
|
367
|
+
? getRawTag(value)
|
|
368
|
+
: objectToString(value);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
373
|
+
* and has a `typeof` result of "object".
|
|
374
|
+
*
|
|
375
|
+
* @static
|
|
376
|
+
* @memberOf _
|
|
377
|
+
* @since 4.0.0
|
|
378
|
+
* @category Lang
|
|
379
|
+
* @param {*} value The value to check.
|
|
380
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
381
|
+
* @example
|
|
382
|
+
*
|
|
383
|
+
* _.isObjectLike({});
|
|
384
|
+
* // => true
|
|
385
|
+
*
|
|
386
|
+
* _.isObjectLike([1, 2, 3]);
|
|
387
|
+
* // => true
|
|
388
|
+
*
|
|
389
|
+
* _.isObjectLike(_.noop);
|
|
390
|
+
* // => false
|
|
391
|
+
*
|
|
392
|
+
* _.isObjectLike(null);
|
|
393
|
+
* // => false
|
|
394
|
+
*/
|
|
395
|
+
function isObjectLike(value) {
|
|
396
|
+
return value != null && typeof value == 'object';
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/** `Object#toString` result references. */
|
|
400
|
+
var symbolTag = '[object Symbol]';
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
404
|
+
*
|
|
405
|
+
* @static
|
|
406
|
+
* @memberOf _
|
|
407
|
+
* @since 4.0.0
|
|
408
|
+
* @category Lang
|
|
409
|
+
* @param {*} value The value to check.
|
|
410
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
411
|
+
* @example
|
|
412
|
+
*
|
|
413
|
+
* _.isSymbol(Symbol.iterator);
|
|
414
|
+
* // => true
|
|
415
|
+
*
|
|
416
|
+
* _.isSymbol('abc');
|
|
417
|
+
* // => false
|
|
418
|
+
*/
|
|
419
|
+
function isSymbol(value) {
|
|
420
|
+
return typeof value == 'symbol' ||
|
|
421
|
+
(isObjectLike(value) && baseGetTag(value) == symbolTag);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* A specialized version of `_.map` for arrays without support for iteratee
|
|
426
|
+
* shorthands.
|
|
427
|
+
*
|
|
428
|
+
* @private
|
|
429
|
+
* @param {Array} [array] The array to iterate over.
|
|
430
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
431
|
+
* @returns {Array} Returns the new mapped array.
|
|
432
|
+
*/
|
|
433
|
+
function arrayMap(array, iteratee) {
|
|
434
|
+
var index = -1,
|
|
435
|
+
length = array == null ? 0 : array.length,
|
|
436
|
+
result = Array(length);
|
|
437
|
+
|
|
438
|
+
while (++index < length) {
|
|
439
|
+
result[index] = iteratee(array[index], index, array);
|
|
440
|
+
}
|
|
441
|
+
return result;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Checks if `value` is classified as an `Array` object.
|
|
446
|
+
*
|
|
447
|
+
* @static
|
|
448
|
+
* @memberOf _
|
|
449
|
+
* @since 0.1.0
|
|
450
|
+
* @category Lang
|
|
451
|
+
* @param {*} value The value to check.
|
|
452
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
453
|
+
* @example
|
|
454
|
+
*
|
|
455
|
+
* _.isArray([1, 2, 3]);
|
|
456
|
+
* // => true
|
|
457
|
+
*
|
|
458
|
+
* _.isArray(document.body.children);
|
|
459
|
+
* // => false
|
|
460
|
+
*
|
|
461
|
+
* _.isArray('abc');
|
|
462
|
+
* // => false
|
|
463
|
+
*
|
|
464
|
+
* _.isArray(_.noop);
|
|
465
|
+
* // => false
|
|
466
|
+
*/
|
|
467
|
+
var isArray = Array.isArray;
|
|
468
|
+
|
|
469
|
+
var isArray$1 = isArray;
|
|
470
|
+
|
|
471
|
+
/** Used as references for various `Number` constants. */
|
|
472
|
+
var INFINITY = 1 / 0;
|
|
473
|
+
|
|
474
|
+
/** Used to convert symbols to primitives and strings. */
|
|
475
|
+
var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
|
|
476
|
+
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* The base implementation of `_.toString` which doesn't convert nullish
|
|
480
|
+
* values to empty strings.
|
|
481
|
+
*
|
|
482
|
+
* @private
|
|
483
|
+
* @param {*} value The value to process.
|
|
484
|
+
* @returns {string} Returns the string.
|
|
485
|
+
*/
|
|
486
|
+
function baseToString(value) {
|
|
487
|
+
// Exit early for strings to avoid a performance hit in some environments.
|
|
488
|
+
if (typeof value == 'string') {
|
|
489
|
+
return value;
|
|
490
|
+
}
|
|
491
|
+
if (isArray$1(value)) {
|
|
492
|
+
// Recursively convert values (susceptible to call stack limits).
|
|
493
|
+
return arrayMap(value, baseToString) + '';
|
|
494
|
+
}
|
|
495
|
+
if (isSymbol(value)) {
|
|
496
|
+
return symbolToString ? symbolToString.call(value) : '';
|
|
497
|
+
}
|
|
498
|
+
var result = (value + '');
|
|
499
|
+
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Converts `value` to a string. An empty string is returned for `null`
|
|
504
|
+
* and `undefined` values. The sign of `-0` is preserved.
|
|
505
|
+
*
|
|
506
|
+
* @static
|
|
507
|
+
* @memberOf _
|
|
508
|
+
* @since 4.0.0
|
|
509
|
+
* @category Lang
|
|
510
|
+
* @param {*} value The value to convert.
|
|
511
|
+
* @returns {string} Returns the converted string.
|
|
512
|
+
* @example
|
|
513
|
+
*
|
|
514
|
+
* _.toString(null);
|
|
515
|
+
* // => ''
|
|
516
|
+
*
|
|
517
|
+
* _.toString(-0);
|
|
518
|
+
* // => '-0'
|
|
519
|
+
*
|
|
520
|
+
* _.toString([1, 2, 3]);
|
|
521
|
+
* // => '1,2,3'
|
|
522
|
+
*/
|
|
523
|
+
function toString(value) {
|
|
524
|
+
return value == null ? '' : baseToString(value);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/** Used to generate unique IDs. */
|
|
528
|
+
var idCounter = 0;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Generates a unique ID. If `prefix` is given, the ID is appended to it.
|
|
532
|
+
*
|
|
533
|
+
* @static
|
|
534
|
+
* @since 0.1.0
|
|
535
|
+
* @memberOf _
|
|
536
|
+
* @category Util
|
|
537
|
+
* @param {string} [prefix=''] The value to prefix the ID with.
|
|
538
|
+
* @returns {string} Returns the unique ID.
|
|
539
|
+
* @example
|
|
540
|
+
*
|
|
541
|
+
* _.uniqueId('contact_');
|
|
542
|
+
* // => 'contact_104'
|
|
543
|
+
*
|
|
544
|
+
* _.uniqueId();
|
|
545
|
+
* // => '105'
|
|
546
|
+
*/
|
|
547
|
+
function uniqueId(prefix) {
|
|
548
|
+
var id = ++idCounter;
|
|
549
|
+
return toString(prefix) + id;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
const createDefaultSlots = _VkfFormUtils._VkfFormItemRendererUtils.createDefaultSlots;
|
|
553
|
+
var script$2 = defineComponent({
|
|
554
|
+
components: {
|
|
555
|
+
VkfDropWrapper,
|
|
556
|
+
VkfForm,
|
|
557
|
+
VkfFormItemRendererTemplate,
|
|
558
|
+
VkTabGroup,
|
|
559
|
+
VkTabItem,
|
|
560
|
+
EditingWrapper: script$3
|
|
561
|
+
},
|
|
562
|
+
props: {
|
|
563
|
+
formItems: {
|
|
564
|
+
type: Array,
|
|
565
|
+
default: () => []
|
|
566
|
+
},
|
|
567
|
+
prop: {
|
|
568
|
+
type: String,
|
|
569
|
+
default: ""
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
emits: {
|
|
573
|
+
"update:prop": (e) => e,
|
|
574
|
+
setFormItems: null,
|
|
575
|
+
unsetFormItems: null
|
|
576
|
+
},
|
|
577
|
+
setup(props, { emit }) {
|
|
578
|
+
const formData = ref({});
|
|
579
|
+
const groundEndClassName = ref(DragoverClasses.normal);
|
|
580
|
+
const formItemsWithWrapper = computed(() => {
|
|
581
|
+
const data = [];
|
|
582
|
+
props.formItems.forEach((item, index) => {
|
|
583
|
+
const name = item.prop || "";
|
|
584
|
+
data.push({
|
|
585
|
+
templateType: "VkfEditingSelect",
|
|
586
|
+
name,
|
|
587
|
+
index,
|
|
588
|
+
templateSlots: createDefaultSlots(item)
|
|
589
|
+
});
|
|
590
|
+
});
|
|
591
|
+
return data;
|
|
592
|
+
});
|
|
593
|
+
const endLineNode = ref();
|
|
594
|
+
const isUnderEnd = (e) => !!endLineNode.value && e.pageY >= endLineNode.value.getBoundingClientRect().top;
|
|
595
|
+
function dragover(e) {
|
|
596
|
+
if (!isUnderEnd(e))
|
|
597
|
+
return;
|
|
598
|
+
groundEndClassName.value = DragoverClasses["is-dragover-prev"];
|
|
599
|
+
}
|
|
600
|
+
function dragleave() {
|
|
601
|
+
groundEndClassName.value = DragoverClasses.normal;
|
|
602
|
+
}
|
|
603
|
+
function drop(e) {
|
|
604
|
+
e.preventDefault();
|
|
605
|
+
if (!isUnderEnd(e))
|
|
606
|
+
return;
|
|
607
|
+
if (!e.dataTransfer)
|
|
608
|
+
return;
|
|
609
|
+
groundEndClassName.value = DragoverClasses.normal;
|
|
610
|
+
const data = JSON.parse(e.dataTransfer.getData("text"));
|
|
611
|
+
data.prop ||= uniqueId("from_widget_");
|
|
612
|
+
if (data.templateType === "VkfEditingSelect") {
|
|
613
|
+
const currentLength = props.formItems.length;
|
|
614
|
+
data.templateSlots.default.forEach((v, i) => {
|
|
615
|
+
emit("setFormItems", {
|
|
616
|
+
k: currentLength + i,
|
|
617
|
+
v
|
|
618
|
+
});
|
|
619
|
+
});
|
|
620
|
+
emit("unsetFormItems", {
|
|
621
|
+
k: data.index
|
|
622
|
+
});
|
|
623
|
+
} else {
|
|
624
|
+
emit("setFormItems", {
|
|
625
|
+
k: props.formItems.length,
|
|
626
|
+
v: data
|
|
627
|
+
});
|
|
628
|
+
emit("update:prop", data.prop);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
function editDrop(e) {
|
|
632
|
+
e.preventDefault();
|
|
633
|
+
if (!e.dataTransfer)
|
|
634
|
+
return;
|
|
635
|
+
const data = JSON.parse(e.dataTransfer.getData("text"));
|
|
636
|
+
console.log(data);
|
|
637
|
+
}
|
|
638
|
+
return {
|
|
639
|
+
groundEndClassName,
|
|
640
|
+
endLineNode,
|
|
641
|
+
dragover,
|
|
642
|
+
dragleave,
|
|
643
|
+
drop,
|
|
644
|
+
setData,
|
|
645
|
+
editDrop,
|
|
646
|
+
formData,
|
|
647
|
+
formItemsWithWrapper
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
const _hoisted_1$1 = /* @__PURE__ */ createElementVNode("div", { class: "vkf-ground-start" }, null, -1);
|
|
653
|
+
function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
654
|
+
const _component_EditingWrapper = resolveComponent("EditingWrapper");
|
|
655
|
+
const _component_VkTabItem = resolveComponent("VkTabItem");
|
|
656
|
+
const _component_VkfFormItemRendererTemplate = resolveComponent("VkfFormItemRendererTemplate");
|
|
657
|
+
const _component_VkfForm = resolveComponent("VkfForm");
|
|
658
|
+
const _component_VkTabGroup = resolveComponent("VkTabGroup");
|
|
659
|
+
const _component_VkfDropWrapper = resolveComponent("VkfDropWrapper");
|
|
660
|
+
return openBlock(), createBlock(_component_VkfDropWrapper, {
|
|
661
|
+
class: "vkf-ground-main",
|
|
662
|
+
onDrop: _ctx.drop,
|
|
663
|
+
onDragover: _ctx.dragover,
|
|
664
|
+
onDragleave: _ctx.dragleave
|
|
665
|
+
}, {
|
|
666
|
+
default: withCtx(() => [
|
|
667
|
+
_hoisted_1$1,
|
|
668
|
+
createCommentVNode(" {{ formItems. }} "),
|
|
669
|
+
createCommentVNode(" \u5C06formItems\u6E32\u67D3 \u4E3A\u7F16\u8F91\u65F6\u7EC4\u4EF6 "),
|
|
670
|
+
createVNode(_component_VkTabGroup, {
|
|
671
|
+
modelValue: _ctx.prop,
|
|
672
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:prop", $event))
|
|
673
|
+
}, {
|
|
674
|
+
default: withCtx(() => [
|
|
675
|
+
createVNode(_component_VkfForm, {
|
|
676
|
+
formItems: _ctx.formItemsWithWrapper,
|
|
677
|
+
data: _ctx.formData,
|
|
678
|
+
onSetData: _cache[0] || (_cache[0] = ($event) => _ctx.setData(_ctx.formData, $event))
|
|
679
|
+
}, {
|
|
680
|
+
rendererTemplate: withCtx(() => [
|
|
681
|
+
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfEditingSelect" }, {
|
|
682
|
+
default: withCtx(({ data, Renderer, raw }) => [
|
|
683
|
+
createCommentVNode(" name is prop "),
|
|
684
|
+
createVNode(_component_VkTabItem, {
|
|
685
|
+
name: data.name,
|
|
686
|
+
clearable: false,
|
|
687
|
+
class: "vkf-gm-form-item-x"
|
|
688
|
+
}, {
|
|
689
|
+
default: withCtx(({ isActive }) => [
|
|
690
|
+
createCommentVNode(" \u62D6\u52A8\u65F6 \u6839\u636E source \u548C data.index "),
|
|
691
|
+
createVNode(_component_EditingWrapper, {
|
|
692
|
+
onDrop: withModifiers(_ctx.editDrop, ["stop"]),
|
|
693
|
+
active: isActive,
|
|
694
|
+
source: raw
|
|
695
|
+
}, {
|
|
696
|
+
default: withCtx(() => [
|
|
697
|
+
(openBlock(), createBlock(resolveDynamicComponent(Renderer), {
|
|
698
|
+
source: raw.templateSlots.default
|
|
699
|
+
}, null, 8, ["source"]))
|
|
700
|
+
]),
|
|
701
|
+
_: 2
|
|
702
|
+
}, 1032, ["onDrop", "active", "source"])
|
|
703
|
+
]),
|
|
704
|
+
_: 2
|
|
705
|
+
}, 1032, ["name"])
|
|
706
|
+
]),
|
|
707
|
+
_: 1
|
|
708
|
+
})
|
|
709
|
+
]),
|
|
710
|
+
_: 1
|
|
711
|
+
}, 8, ["formItems", "data"])
|
|
712
|
+
]),
|
|
713
|
+
_: 1
|
|
714
|
+
}, 8, ["modelValue"]),
|
|
715
|
+
createElementVNode("div", {
|
|
716
|
+
class: normalizeClass(["vkf-ground-end", _ctx.groundEndClassName]),
|
|
717
|
+
ref: "endLineNode"
|
|
718
|
+
}, null, 2)
|
|
719
|
+
]),
|
|
720
|
+
_: 1
|
|
721
|
+
}, 8, ["onDrop", "onDragover", "onDragleave"]);
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
script$2.render = render$2;
|
|
725
|
+
script$2.__file = "ground/src/ground-main/src/index.vue";
|
|
726
|
+
|
|
727
|
+
var script$1 = defineComponent({
|
|
728
|
+
components: {
|
|
729
|
+
VkfConfig
|
|
730
|
+
},
|
|
731
|
+
props: {
|
|
732
|
+
..._VkfConfigCtx.props,
|
|
733
|
+
templateType: {
|
|
734
|
+
type: String,
|
|
735
|
+
default: ""
|
|
736
|
+
},
|
|
737
|
+
propDisabled: {
|
|
738
|
+
type: Boolean,
|
|
739
|
+
default: false
|
|
740
|
+
}
|
|
741
|
+
},
|
|
742
|
+
emits: {
|
|
743
|
+
..._VkfConfigCtx.emits,
|
|
744
|
+
"update:propDisabled": (e) => e
|
|
745
|
+
},
|
|
746
|
+
setup(props, { emit }) {
|
|
747
|
+
const configProps = _VkfConfigCtx.createBindProps(props, ["source"]);
|
|
748
|
+
const configEmits = _VkfConfigCtx.createOnEmits(emit);
|
|
749
|
+
const typeToConfigSource = {
|
|
750
|
+
"VkfInput": {
|
|
751
|
+
templateType: "VkfInput",
|
|
752
|
+
propDisabled: false
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
const source = computed(() => {
|
|
756
|
+
return {
|
|
757
|
+
...typeToConfigSource[props.templateType],
|
|
758
|
+
propDisabled: props.propDisabled
|
|
759
|
+
};
|
|
760
|
+
});
|
|
761
|
+
const setSource = (e) => {
|
|
762
|
+
if (e.k === "propDisabled") {
|
|
763
|
+
emit("update:propDisabled", e.v);
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
return {
|
|
767
|
+
source,
|
|
768
|
+
setSource,
|
|
769
|
+
configProps,
|
|
770
|
+
configEmits
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
});
|
|
774
|
+
|
|
775
|
+
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
776
|
+
const _component_VkfConfig = resolveComponent("VkfConfig");
|
|
777
|
+
return openBlock(), createBlock(_component_VkfConfig, mergeProps({
|
|
778
|
+
source: _ctx.source,
|
|
779
|
+
"onSetData:source": _ctx.setSource
|
|
780
|
+
}, _ctx.configProps, toHandlers(_ctx.configEmits)), null, 16, ["source", "onSetData:source"]);
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
script$1.render = render$1;
|
|
784
|
+
script$1.__file = "ground/src/ground-config/src/index.vue";
|
|
785
|
+
|
|
786
|
+
var script = defineComponent({
|
|
787
|
+
name: "VkfGround",
|
|
788
|
+
components: {
|
|
789
|
+
VkfGroundWidget: script$4,
|
|
790
|
+
VkfGroundMain: script$2,
|
|
791
|
+
VkfGroundConfig: script$1
|
|
792
|
+
},
|
|
793
|
+
setup(props, { emit }) {
|
|
794
|
+
const formItems = ref([]);
|
|
795
|
+
const editProp = ref("");
|
|
796
|
+
const propToFormItem = computed(() => {
|
|
797
|
+
return formItems.value.reduce((a, c) => {
|
|
798
|
+
if (c.prop) {
|
|
799
|
+
a[c.prop] = c;
|
|
800
|
+
}
|
|
801
|
+
return a;
|
|
802
|
+
}, {});
|
|
803
|
+
});
|
|
804
|
+
const configPropDisabled = ref(false);
|
|
805
|
+
const setFormItem = (props2, e) => {
|
|
806
|
+
if (e.k === "prop") {
|
|
807
|
+
if (e.v === props2.prop) {
|
|
808
|
+
configPropDisabled.value = true;
|
|
809
|
+
} else {
|
|
810
|
+
if (e.v in propToFormItem.value) {
|
|
811
|
+
ElMessage({
|
|
812
|
+
type: "warning",
|
|
813
|
+
message: "\u5B58\u5728\u76F8\u540C\u7684prop, \u8BF7\u91CD\u65B0\u4FEE\u6539"
|
|
814
|
+
});
|
|
815
|
+
} else {
|
|
816
|
+
props2.prop = e.v;
|
|
817
|
+
editProp.value = e.v;
|
|
818
|
+
configPropDisabled.value = true;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
} else {
|
|
822
|
+
setData(props2, e);
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
return {
|
|
826
|
+
propToFormItem,
|
|
827
|
+
formItems,
|
|
828
|
+
editProp,
|
|
829
|
+
setData,
|
|
830
|
+
unsetData,
|
|
831
|
+
setFormItem,
|
|
832
|
+
configPropDisabled
|
|
833
|
+
};
|
|
834
|
+
}
|
|
835
|
+
});
|
|
836
|
+
|
|
837
|
+
const _hoisted_1 = { class: "vkf-ground" };
|
|
838
|
+
const _hoisted_2 = { class: "vkf-ground-main-x" };
|
|
839
|
+
const _hoisted_3 = { class: "vkf-ground-config-x" };
|
|
840
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
841
|
+
const _component_VkfGroundWidget = resolveComponent("VkfGroundWidget");
|
|
842
|
+
const _component_VkfGroundMain = resolveComponent("VkfGroundMain");
|
|
843
|
+
const _component_VkfGroundConfig = resolveComponent("VkfGroundConfig");
|
|
844
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
845
|
+
createVNode(_component_VkfGroundWidget, { class: "vkf-ground-widget-x" }),
|
|
846
|
+
createElementVNode("div", _hoisted_2, [
|
|
847
|
+
createCommentVNode(" {{ formItems }} "),
|
|
848
|
+
createVNode(_component_VkfGroundMain, {
|
|
849
|
+
prop: _ctx.editProp,
|
|
850
|
+
"onUpdate:prop": [
|
|
851
|
+
_cache[0] || (_cache[0] = ($event) => _ctx.editProp = $event),
|
|
852
|
+
_cache[1] || (_cache[1] = ($event) => _ctx.configPropDisabled = false)
|
|
853
|
+
],
|
|
854
|
+
formItems: _ctx.formItems,
|
|
855
|
+
onSetFormItems: _cache[2] || (_cache[2] = ($event) => _ctx.setData(_ctx.formItems, $event)),
|
|
856
|
+
onUnsetFormItems: _cache[3] || (_cache[3] = ($event) => _ctx.unsetData(_ctx.formItems, $event))
|
|
857
|
+
}, null, 8, ["prop", "formItems"])
|
|
858
|
+
]),
|
|
859
|
+
createElementVNode("div", _hoisted_3, [
|
|
860
|
+
_ctx.editProp && _ctx.propToFormItem[_ctx.editProp] ? (openBlock(), createBlock(_component_VkfGroundConfig, {
|
|
861
|
+
key: 0,
|
|
862
|
+
propDisabled: _ctx.configPropDisabled,
|
|
863
|
+
"onUpdate:propDisabled": _cache[4] || (_cache[4] = ($event) => _ctx.configPropDisabled = $event),
|
|
864
|
+
templateType: _ctx.propToFormItem[_ctx.editProp].templateType,
|
|
865
|
+
data: _ctx.propToFormItem[_ctx.editProp],
|
|
866
|
+
onSetData: _cache[5] || (_cache[5] = ($event) => _ctx.setFormItem(_ctx.propToFormItem[_ctx.editProp], $event))
|
|
867
|
+
}, null, 8, ["propDisabled", "templateType", "data"])) : createCommentVNode("v-if", true)
|
|
868
|
+
])
|
|
869
|
+
]);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
script.render = render;
|
|
873
|
+
script.__file = "ground/src/index.vue";
|
|
874
|
+
|
|
875
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
876
|
+
__proto__: null
|
|
877
|
+
});
|
|
878
|
+
|
|
879
|
+
script.install = (app) => {
|
|
880
|
+
app.component(script.name, script);
|
|
881
|
+
};
|
|
882
|
+
|
|
883
|
+
export { script as VkfGround, types as __VkfGround, script as default };
|