@vunk/form 0.0.0-alpha.2 → 0.0.0-alpha.6
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/src/ctx.d.ts +1 -1
- package/components/config-renderer/src/ctx.d.ts +1 -1
- package/components/confirm-input/index.js +3 -3
- package/components/confirm-input/src/ctx.d.ts +79 -37
- package/components/confirm-input/src/index.vue.d.ts +210 -131
- package/components/date-picker/index.d.ts +4 -0
- package/components/date-picker/index.js +81 -0
- package/components/date-picker/src/ctx.d.ts +163 -0
- package/components/date-picker/src/index.vue.d.ts +407 -0
- package/components/date-picker/src/types.d.ts +14 -0
- package/components/drop-wrapper/index.js +2 -2
- package/components/drop-wrapper/src/index.vue.d.ts +2 -2
- package/components/form/index.js +54 -4
- package/components/form/src/ctx.d.ts +21 -16
- package/components/form/src/index.vue.d.ts +51 -43
- package/components/form-item/index.d.ts +5 -0
- package/components/form-item/index.js +71 -0
- package/components/form-item/src/ctx.d.ts +44 -0
- package/components/form-item/src/index.vue.d.ts +102 -0
- package/components/form-item/src/types.d.ts +6 -0
- package/components/ground/index.css +50 -12
- package/components/ground/index.js +472 -108
- package/components/ground/src/ground-config/src/index.vue.d.ts +4 -1
- package/components/ground/src/ground-main/src/editing-wrapper.vue.d.ts +35 -5
- package/components/ground/src/ground-main/src/index.vue.d.ts +24 -6
- package/components/ground/src/ground-widget/src/form-item-widget/src/index.vue.d.ts +994 -138
- package/components/ground/src/ground-widget/src/index.vue.d.ts +21 -5
- package/components/ground/src/ground-widget/src/static.d.ts +2 -2
- package/components/ground/src/index.vue.d.ts +52 -8
- package/components/input/index.js +12 -32
- package/components/input/src/ctx.d.ts +81 -43
- package/components/input/src/index.vue.d.ts +209 -136
- package/components/input/src/types.d.ts +1 -6
- package/components/input-config/index.js +102 -23
- package/components/input-config/src/ctx.d.ts +19 -15
- package/components/input-config/src/index.vue.d.ts +70 -50
- package/components/rules-config/index.d.ts +3 -0
- package/components/rules-config/index.js +63 -0
- package/components/rules-config/src/ctx.d.ts +38 -0
- package/components/rules-config/src/index.vue.d.ts +113 -0
- package/components/select/index.d.ts +4 -0
- package/components/select/index.js +89 -0
- package/components/select/src/ctx.d.ts +193 -0
- package/components/select/src/index.vue.d.ts +589 -0
- package/components/select/src/types.d.ts +5 -0
- package/components/select-config/index.d.ts +4 -0
- package/components/select-config/index.js +43 -0
- package/components/select-config/src/ctx.d.ts +11 -0
- package/components/select-config/src/index.vue.d.ts +18 -0
- package/components/select-config/src/types.d.ts +3 -0
- package/components/switch/index.d.ts +4 -0
- package/components/switch/index.js +61 -0
- package/components/switch/src/ctx.d.ts +62 -0
- package/components/switch/src/index.vue.d.ts +184 -0
- package/components/switch/src/types.d.ts +3 -0
- package/full-entry/main.d.ts +6 -0
- package/index.css +50 -12
- package/index.d.ts +36 -24
- package/index.esm.js +6 -0
- package/package.json +1 -1
- package/shared/element-plus/ctx/index.d.ts +10 -4
- package/shared/element-plus/ctx/index.js +1287 -2
- package/shared/element-plus/instances/date-picker.d.ts +126 -0
- package/shared/element-plus/instances/date-picker.js +21 -0
- package/shared/element-plus/instances/select.d.ts +91 -0
- package/shared/element-plus/instances/select.js +1264 -0
- package/shared/helper/index.d.ts +2 -2
- package/shared/helper/index.js +1 -1
- package/shared/types/drag/index.d.ts +7 -0
- package/shared/types/drag/index.js +1 -0
- package/shared/types/form-item/date-picker.d.ts +8 -0
- package/shared/types/form-item/date-picker.js +1 -0
- package/shared/types/form-item/index.d.ts +3 -0
- package/shared/types/form-item/select.d.ts +8 -0
- package/shared/types/form-item/select.js +1 -0
- package/shared/types/form-item/switch.d.ts +8 -0
- package/shared/types/form-item/switch.js +1 -0
- package/shared/types/index.d.ts +2 -2
- package/shared/types/shared/index.d.ts +5 -0
- package/types/components/config/src/ctx.d.ts +1 -1
- package/types/components/config-renderer/src/ctx.d.ts +1 -1
- package/types/components/confirm-input/src/ctx.d.ts +79 -37
- package/types/components/confirm-input/src/index.vue.d.ts +210 -131
- package/types/components/date-picker/index.d.ts +4 -0
- package/types/components/date-picker/src/ctx.d.ts +163 -0
- package/types/components/date-picker/src/index.vue.d.ts +407 -0
- package/types/components/date-picker/src/types.d.ts +14 -0
- package/types/components/drop-wrapper/src/index.vue.d.ts +2 -2
- package/types/components/form/src/ctx.d.ts +21 -16
- package/types/components/form/src/index.vue.d.ts +51 -43
- package/types/components/form-item/index.d.ts +5 -0
- package/types/components/form-item/src/ctx.d.ts +44 -0
- package/types/components/form-item/src/index.vue.d.ts +102 -0
- package/types/components/form-item/src/types.d.ts +6 -0
- package/types/components/ground/src/ground-config/src/index.vue.d.ts +4 -1
- package/types/components/ground/src/ground-main/src/editing-wrapper.vue.d.ts +35 -5
- package/types/components/ground/src/ground-main/src/index.vue.d.ts +24 -6
- package/types/components/ground/src/ground-widget/src/form-item-widget/src/index.vue.d.ts +994 -138
- package/types/components/ground/src/ground-widget/src/index.vue.d.ts +21 -5
- package/types/components/ground/src/ground-widget/src/static.d.ts +2 -2
- package/types/components/ground/src/index.vue.d.ts +52 -8
- package/types/components/input/src/ctx.d.ts +81 -43
- package/types/components/input/src/index.vue.d.ts +209 -136
- package/types/components/input/src/types.d.ts +1 -6
- package/types/components/input-config/src/ctx.d.ts +19 -15
- package/types/components/input-config/src/index.vue.d.ts +70 -50
- package/types/components/rules-config/index.d.ts +3 -0
- package/types/components/rules-config/src/ctx.d.ts +38 -0
- package/types/components/rules-config/src/index.vue.d.ts +113 -0
- package/types/components/select/index.d.ts +4 -0
- package/types/components/select/src/ctx.d.ts +193 -0
- package/types/components/select/src/index.vue.d.ts +589 -0
- package/types/components/select/src/types.d.ts +5 -0
- package/types/components/select-config/index.d.ts +4 -0
- package/types/components/select-config/src/ctx.d.ts +11 -0
- package/types/components/select-config/src/index.vue.d.ts +18 -0
- package/types/components/select-config/src/types.d.ts +3 -0
- package/types/components/switch/index.d.ts +4 -0
- package/types/components/switch/src/ctx.d.ts +62 -0
- package/types/components/switch/src/index.vue.d.ts +184 -0
- package/types/components/switch/src/types.d.ts +3 -0
- package/types/full-entry/main.d.ts +6 -0
- package/types/shared/element-plus/ctx/index.d.ts +10 -4
- package/types/shared/element-plus/instances/date-picker.d.ts +126 -0
- package/types/shared/element-plus/instances/select.d.ts +91 -0
- package/types/shared/helper/index.d.ts +2 -2
- package/types/shared/types/drag/index.d.ts +7 -0
- package/types/shared/types/form-item/date-picker.d.ts +8 -0
- package/types/shared/types/form-item/index.d.ts +3 -0
- package/types/shared/types/form-item/select.d.ts +8 -0
- package/types/shared/types/form-item/switch.d.ts +8 -0
- package/types/shared/types/index.d.ts +2 -2
- package/types/shared/types/shared/index.d.ts +5 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, Fragment, renderList, toDisplayString, ref, createVNode, withDirectives, vShow, createTextVNode,
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, Fragment, renderList, toDisplayString, ref, createVNode, withDirectives, renderSlot, vShow, createTextVNode, computed, createCommentVNode, resolveDynamicComponent, normalizeClass, mergeProps, toHandlers, unref, getCurrentScope, onScopeDispose, watch } from 'vue';
|
|
2
2
|
import { VkTabGroup, VkTabItem, VkCard, VkBoxHandler } from 'vunk';
|
|
3
3
|
import { VkFloatBlock } from 'vunk/gsap/components/float-block';
|
|
4
|
-
import { ElCollapseItem, ElScrollbar, ElCollapse, ElIcon, ElMessage } from 'element-plus';
|
|
4
|
+
import { ElCollapseItem, ElScrollbar, ElCollapse, ElIcon, ElButton, ElMessage, ElMessageBox } from 'element-plus';
|
|
5
5
|
import { VkfDragWrapper } from '@vunk/form/components/drag-wrapper';
|
|
6
6
|
import 'vunk/gsap/components/float-block/index.css';
|
|
7
|
-
import {
|
|
7
|
+
import { VkfForm, _VkfFormUtils } from '@vunk/form/components/form';
|
|
8
8
|
import { VkfDropWrapper, DragoverClasses } from '@vunk/form/components/drop-wrapper';
|
|
9
9
|
import { VkfFormItemRendererTemplate } from '@vunk/form/components/form-item-renderer-template';
|
|
10
10
|
import { setData, unsetData } from 'vunk/shared/helper';
|
|
@@ -25,6 +25,24 @@ var script$5 = defineComponent({
|
|
|
25
25
|
prop: "",
|
|
26
26
|
label: "inputLabel"
|
|
27
27
|
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: "select",
|
|
31
|
+
value: "VkfSelect",
|
|
32
|
+
defaultOptions: {
|
|
33
|
+
templateType: "VkfSelect",
|
|
34
|
+
prop: "",
|
|
35
|
+
label: "label"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: "switch",
|
|
40
|
+
value: "VkfSwitch",
|
|
41
|
+
defaultOptions: {
|
|
42
|
+
templateType: "VkfSwitch",
|
|
43
|
+
prop: "",
|
|
44
|
+
label: "label"
|
|
45
|
+
}
|
|
28
46
|
}
|
|
29
47
|
];
|
|
30
48
|
return {
|
|
@@ -33,23 +51,24 @@ var script$5 = defineComponent({
|
|
|
33
51
|
}
|
|
34
52
|
});
|
|
35
53
|
|
|
36
|
-
const _hoisted_1$
|
|
54
|
+
const _hoisted_1$6 = { class: "vkf-ground-widget-ul" };
|
|
37
55
|
function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
38
56
|
const _component_VkfDragWrapper = resolveComponent("VkfDragWrapper");
|
|
39
57
|
const _component_ElCollapseItem = resolveComponent("ElCollapseItem");
|
|
40
58
|
return openBlock(), createBlock(_component_ElCollapseItem, { title: "FormItems" }, {
|
|
41
59
|
default: withCtx(() => [
|
|
42
|
-
createElementVNode("ul", _hoisted_1$
|
|
60
|
+
createElementVNode("ul", _hoisted_1$6, [
|
|
43
61
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data, (item) => {
|
|
44
62
|
return openBlock(), createBlock(_component_VkfDragWrapper, {
|
|
45
63
|
key: item.value,
|
|
46
|
-
|
|
64
|
+
title: JSON.stringify({ source: item.defaultOptions }),
|
|
65
|
+
data: JSON.stringify({ source: item.defaultOptions })
|
|
47
66
|
}, {
|
|
48
67
|
default: withCtx(() => [
|
|
49
68
|
createElementVNode("li", null, toDisplayString(item.label), 1)
|
|
50
69
|
]),
|
|
51
70
|
_: 2
|
|
52
|
-
}, 1032, ["data"]);
|
|
71
|
+
}, 1032, ["title", "data"]);
|
|
53
72
|
}), 128))
|
|
54
73
|
])
|
|
55
74
|
]),
|
|
@@ -61,14 +80,14 @@ script$5.render = render$5;
|
|
|
61
80
|
script$5.__file = "ground/src/ground-widget/src/form-item-widget/src/index.vue";
|
|
62
81
|
|
|
63
82
|
var ComponentsType = /* @__PURE__ */ ((ComponentsType2) => {
|
|
64
|
-
ComponentsType2[
|
|
65
|
-
ComponentsType2[
|
|
83
|
+
ComponentsType2["container"] = "container";
|
|
84
|
+
ComponentsType2["formItems"] = "formItems";
|
|
66
85
|
return ComponentsType2;
|
|
67
86
|
})(ComponentsType || {});
|
|
68
87
|
|
|
69
88
|
var WidgetTab = /* @__PURE__ */ ((WidgetTab2) => {
|
|
70
|
-
WidgetTab2[
|
|
71
|
-
WidgetTab2[
|
|
89
|
+
WidgetTab2["components"] = "components";
|
|
90
|
+
WidgetTab2["templates"] = "templates";
|
|
72
91
|
return WidgetTab2;
|
|
73
92
|
})(WidgetTab || {});
|
|
74
93
|
var script$4 = defineComponent({
|
|
@@ -81,23 +100,30 @@ var script$4 = defineComponent({
|
|
|
81
100
|
ElCollapse,
|
|
82
101
|
FormItemWidget: script$5
|
|
83
102
|
},
|
|
103
|
+
props: {
|
|
104
|
+
componentLibCollapseExpanded: {
|
|
105
|
+
type: Array,
|
|
106
|
+
default: () => [
|
|
107
|
+
ComponentsType.container,
|
|
108
|
+
ComponentsType.formItems
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
emits: {
|
|
113
|
+
"update:componentLibCollapseExpanded": null
|
|
114
|
+
},
|
|
84
115
|
setup() {
|
|
85
|
-
const widgetTab = ref(
|
|
86
|
-
const componentsType = ref([
|
|
87
|
-
ComponentsType.container,
|
|
88
|
-
ComponentsType.formItems
|
|
89
|
-
]);
|
|
116
|
+
const widgetTab = ref("components" /* components */);
|
|
90
117
|
return {
|
|
91
118
|
WidgetTab,
|
|
92
119
|
ComponentsType,
|
|
93
|
-
widgetTab
|
|
94
|
-
componentsType
|
|
120
|
+
widgetTab
|
|
95
121
|
};
|
|
96
122
|
}
|
|
97
123
|
});
|
|
98
124
|
|
|
99
|
-
const _hoisted_1$
|
|
100
|
-
const _hoisted_2$
|
|
125
|
+
const _hoisted_1$5 = /* @__PURE__ */ createTextVNode(" \u7EC4\u4EF6\u5E93 ");
|
|
126
|
+
const _hoisted_2$4 = /* @__PURE__ */ createTextVNode(" \u6A21\u677F\u5E93 ");
|
|
101
127
|
function render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
102
128
|
const _component_VkTabItem = resolveComponent("VkTabItem");
|
|
103
129
|
const _component_VkFloatBlock = resolveComponent("VkFloatBlock");
|
|
@@ -115,18 +141,20 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
115
141
|
}, {
|
|
116
142
|
default: withCtx(() => [
|
|
117
143
|
createVNode(_component_VkTabItem, {
|
|
118
|
-
name: _ctx.WidgetTab.components
|
|
144
|
+
name: _ctx.WidgetTab.components,
|
|
145
|
+
clearable: false
|
|
119
146
|
}, {
|
|
120
147
|
default: withCtx(() => [
|
|
121
|
-
_hoisted_1$
|
|
148
|
+
_hoisted_1$5
|
|
122
149
|
]),
|
|
123
150
|
_: 1
|
|
124
151
|
}, 8, ["name"]),
|
|
125
152
|
createVNode(_component_VkTabItem, {
|
|
126
|
-
name: _ctx.WidgetTab.templates
|
|
153
|
+
name: _ctx.WidgetTab.templates,
|
|
154
|
+
clearable: false
|
|
127
155
|
}, {
|
|
128
156
|
default: withCtx(() => [
|
|
129
|
-
_hoisted_2$
|
|
157
|
+
_hoisted_2$4
|
|
130
158
|
]),
|
|
131
159
|
_: 1
|
|
132
160
|
}, 8, ["name"]),
|
|
@@ -139,23 +167,24 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
139
167
|
createVNode(_component_ElScrollbar, null, {
|
|
140
168
|
default: withCtx(() => [
|
|
141
169
|
withDirectives(createVNode(_component_ElCollapse, {
|
|
142
|
-
modelValue: _ctx.
|
|
143
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx
|
|
170
|
+
modelValue: _ctx.componentLibCollapseExpanded,
|
|
171
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:componentLibCollapseExpanded", $event))
|
|
144
172
|
}, {
|
|
145
173
|
default: withCtx(() => [
|
|
146
174
|
createVNode(_component_FormItemWidget, {
|
|
147
175
|
name: _ctx.ComponentsType.formItems
|
|
148
|
-
}, null, 8, ["name"])
|
|
176
|
+
}, null, 8, ["name"]),
|
|
177
|
+
renderSlot(_ctx.$slots, "componentLibCollapse")
|
|
149
178
|
]),
|
|
150
|
-
_:
|
|
179
|
+
_: 3
|
|
151
180
|
}, 8, ["modelValue"]), [
|
|
152
181
|
[vShow, _ctx.widgetTab === _ctx.WidgetTab.components]
|
|
153
182
|
])
|
|
154
183
|
]),
|
|
155
|
-
_:
|
|
184
|
+
_: 3
|
|
156
185
|
})
|
|
157
186
|
]),
|
|
158
|
-
_:
|
|
187
|
+
_: 3
|
|
159
188
|
});
|
|
160
189
|
}
|
|
161
190
|
|
|
@@ -170,6 +199,25 @@ var _export_sfc = (sfc, props) => {
|
|
|
170
199
|
return target;
|
|
171
200
|
};
|
|
172
201
|
|
|
202
|
+
const _sfc_main$1 = defineComponent({
|
|
203
|
+
name: "Delete"
|
|
204
|
+
});
|
|
205
|
+
const _hoisted_1$4 = {
|
|
206
|
+
viewBox: "0 0 1024 1024",
|
|
207
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
208
|
+
};
|
|
209
|
+
const _hoisted_2$3 = /* @__PURE__ */ createElementVNode("path", {
|
|
210
|
+
fill: "currentColor",
|
|
211
|
+
d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32zm192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32z"
|
|
212
|
+
}, null, -1);
|
|
213
|
+
const _hoisted_3$2 = [
|
|
214
|
+
_hoisted_2$3
|
|
215
|
+
];
|
|
216
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
217
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$4, _hoisted_3$2);
|
|
218
|
+
}
|
|
219
|
+
var _delete = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
220
|
+
|
|
173
221
|
const _sfc_main = defineComponent({
|
|
174
222
|
name: "Sort"
|
|
175
223
|
});
|
|
@@ -177,12 +225,12 @@ const _hoisted_1$3 = {
|
|
|
177
225
|
viewBox: "0 0 1024 1024",
|
|
178
226
|
xmlns: "http://www.w3.org/2000/svg"
|
|
179
227
|
};
|
|
180
|
-
const _hoisted_2$
|
|
228
|
+
const _hoisted_2$2 = /* @__PURE__ */ createElementVNode("path", {
|
|
181
229
|
fill: "currentColor",
|
|
182
230
|
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
231
|
}, null, -1);
|
|
184
232
|
const _hoisted_3$1 = [
|
|
185
|
-
_hoisted_2$
|
|
233
|
+
_hoisted_2$2
|
|
186
234
|
];
|
|
187
235
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
188
236
|
return openBlock(), createElementBlock("svg", _hoisted_1$3, _hoisted_3$1);
|
|
@@ -198,45 +246,49 @@ var script$3 = defineComponent({
|
|
|
198
246
|
source: {
|
|
199
247
|
type: Object,
|
|
200
248
|
default: () => ({})
|
|
249
|
+
},
|
|
250
|
+
attributes: {
|
|
251
|
+
type: Object,
|
|
252
|
+
default: () => ({ k: [] })
|
|
201
253
|
}
|
|
202
254
|
},
|
|
255
|
+
emits: {
|
|
256
|
+
drop: (e, c, data) => e || c || data,
|
|
257
|
+
del: (e) => e
|
|
258
|
+
},
|
|
203
259
|
components: {
|
|
204
260
|
VkBoxHandler,
|
|
205
261
|
ElIcon,
|
|
206
262
|
Sort: sort,
|
|
263
|
+
Delete: _delete,
|
|
207
264
|
VkfDragWrapper,
|
|
208
265
|
VkfDropWrapper
|
|
209
|
-
},
|
|
210
|
-
setup() {
|
|
211
|
-
const dragover = (e) => {
|
|
212
|
-
};
|
|
213
|
-
const drop = (e) => {
|
|
214
|
-
};
|
|
215
|
-
return {
|
|
216
|
-
dragover,
|
|
217
|
-
drop
|
|
218
|
-
};
|
|
219
266
|
}
|
|
220
267
|
});
|
|
221
268
|
|
|
222
269
|
const _hoisted_1$2 = /* @__PURE__ */ createTextVNode(" \u62D6\u52A8\u5355\u5143 ");
|
|
270
|
+
const _hoisted_2$1 = { class: "vkf-gmew-tools vkf-gmew-rb-x" };
|
|
223
271
|
function render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
224
272
|
const _component_Sort = resolveComponent("Sort");
|
|
225
273
|
const _component_el_icon = resolveComponent("el-icon");
|
|
226
274
|
const _component_VkfDragWrapper = resolveComponent("VkfDragWrapper");
|
|
227
275
|
const _component_VkBoxHandler = resolveComponent("VkBoxHandler");
|
|
276
|
+
const _component_Delete = resolveComponent("Delete");
|
|
228
277
|
const _component_VkfDropWrapper = resolveComponent("VkfDropWrapper");
|
|
229
278
|
return openBlock(), createBlock(_component_VkfDropWrapper, {
|
|
230
|
-
|
|
279
|
+
onDrop: _cache[1] || (_cache[1] = (...arg) => _ctx.$emit("drop", ...arg, {
|
|
280
|
+
attributes: _ctx.attributes,
|
|
281
|
+
source: _ctx.source
|
|
282
|
+
})),
|
|
231
283
|
class: "vkf-ground-main-editing-wrapper"
|
|
232
284
|
}, {
|
|
233
285
|
default: withCtx(() => [
|
|
234
286
|
withDirectives(createVNode(_component_VkBoxHandler, null, {
|
|
235
287
|
default: withCtx(() => [
|
|
236
288
|
createVNode(_component_VkfDragWrapper, {
|
|
237
|
-
title: JSON.stringify(_ctx.source),
|
|
238
|
-
data: JSON.stringify(_ctx.source),
|
|
239
|
-
class: "vkf-gmew-drag-wrapper"
|
|
289
|
+
title: JSON.stringify({ source: _ctx.source, attributes: _ctx.attributes }),
|
|
290
|
+
data: JSON.stringify({ source: _ctx.source, attributes: _ctx.attributes }),
|
|
291
|
+
class: "vkf-gmew-drag-wrapper vkf-gmew-tools"
|
|
240
292
|
}, {
|
|
241
293
|
default: withCtx(() => [
|
|
242
294
|
createVNode(_component_el_icon, null, {
|
|
@@ -254,10 +306,22 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
254
306
|
}, 512), [
|
|
255
307
|
[vShow, _ctx.active]
|
|
256
308
|
]),
|
|
309
|
+
withDirectives(createElementVNode("div", _hoisted_2$1, [
|
|
310
|
+
createVNode(_component_el_icon, {
|
|
311
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("del", { k: _ctx.attributes.k }))
|
|
312
|
+
}, {
|
|
313
|
+
default: withCtx(() => [
|
|
314
|
+
createVNode(_component_Delete)
|
|
315
|
+
]),
|
|
316
|
+
_: 1
|
|
317
|
+
})
|
|
318
|
+
], 512), [
|
|
319
|
+
[vShow, _ctx.active]
|
|
320
|
+
]),
|
|
257
321
|
renderSlot(_ctx.$slots, "default")
|
|
258
322
|
]),
|
|
259
323
|
_: 3
|
|
260
|
-
}
|
|
324
|
+
});
|
|
261
325
|
}
|
|
262
326
|
|
|
263
327
|
script$3.render = render$3;
|
|
@@ -549,7 +613,12 @@ function uniqueId(prefix) {
|
|
|
549
613
|
return toString(prefix) + id;
|
|
550
614
|
}
|
|
551
615
|
|
|
552
|
-
const createDefaultSlots = _VkfFormUtils._VkfFormItemRendererUtils.createDefaultSlots;
|
|
616
|
+
const createDefaultSlots = (e) => _VkfFormUtils._VkfFormItemRendererUtils.createDefaultSlots(e);
|
|
617
|
+
const addDefaultProp = (source) => {
|
|
618
|
+
if ("prop" in source) {
|
|
619
|
+
source.prop ||= uniqueId("from_widget_");
|
|
620
|
+
}
|
|
621
|
+
};
|
|
553
622
|
var script$2 = defineComponent({
|
|
554
623
|
components: {
|
|
555
624
|
VkfDropWrapper,
|
|
@@ -567,15 +636,20 @@ var script$2 = defineComponent({
|
|
|
567
636
|
prop: {
|
|
568
637
|
type: String,
|
|
569
638
|
default: ""
|
|
639
|
+
},
|
|
640
|
+
data: Object,
|
|
641
|
+
k: {
|
|
642
|
+
type: Array,
|
|
643
|
+
default: () => []
|
|
570
644
|
}
|
|
571
645
|
},
|
|
572
646
|
emits: {
|
|
573
647
|
"update:prop": (e) => e,
|
|
574
|
-
|
|
575
|
-
|
|
648
|
+
"setData": (e) => e,
|
|
649
|
+
"setData:formItems": null,
|
|
650
|
+
"unsetData:formItems": null
|
|
576
651
|
},
|
|
577
652
|
setup(props, { emit }) {
|
|
578
|
-
const formData = ref({});
|
|
579
653
|
const groundEndClassName = ref(DragoverClasses.normal);
|
|
580
654
|
const formItemsWithWrapper = computed(() => {
|
|
581
655
|
const data = [];
|
|
@@ -608,32 +682,82 @@ var script$2 = defineComponent({
|
|
|
608
682
|
return;
|
|
609
683
|
groundEndClassName.value = DragoverClasses.normal;
|
|
610
684
|
const data = JSON.parse(e.dataTransfer.getData("text"));
|
|
611
|
-
|
|
612
|
-
if (
|
|
685
|
+
const source = data?.source;
|
|
686
|
+
if (!source)
|
|
687
|
+
return;
|
|
688
|
+
addDefaultProp(source);
|
|
689
|
+
if (source.templateType === "VkfEditingSelect") {
|
|
613
690
|
const currentLength = props.formItems.length;
|
|
614
|
-
|
|
615
|
-
emit("
|
|
691
|
+
source.templateSlots.default.forEach((v, i) => {
|
|
692
|
+
emit("setData:formItems", {
|
|
616
693
|
k: currentLength + i,
|
|
617
694
|
v
|
|
618
695
|
});
|
|
619
696
|
});
|
|
620
|
-
emit("
|
|
621
|
-
k:
|
|
697
|
+
emit("unsetData:formItems", {
|
|
698
|
+
k: source.index
|
|
622
699
|
});
|
|
623
700
|
} else {
|
|
624
|
-
emit("
|
|
701
|
+
emit("setData:formItems", {
|
|
625
702
|
k: props.formItems.length,
|
|
626
|
-
v:
|
|
703
|
+
v: source
|
|
627
704
|
});
|
|
628
|
-
emit("update:prop",
|
|
705
|
+
emit("update:prop", source.prop);
|
|
629
706
|
}
|
|
630
707
|
}
|
|
631
|
-
function editDrop(e) {
|
|
708
|
+
function editDrop(e, overClass, toData) {
|
|
709
|
+
e.stopPropagation();
|
|
632
710
|
e.preventDefault();
|
|
633
711
|
if (!e.dataTransfer)
|
|
634
712
|
return;
|
|
635
|
-
const
|
|
636
|
-
|
|
713
|
+
const fromData = JSON.parse(e.dataTransfer.getData("text"));
|
|
714
|
+
const fromSource = fromData?.source;
|
|
715
|
+
if (!fromSource)
|
|
716
|
+
return;
|
|
717
|
+
const fromK = fromData.attributes?.k ?? [];
|
|
718
|
+
let toK = toData.attributes.k;
|
|
719
|
+
let tkl = toK.at(-1);
|
|
720
|
+
if (typeof tkl === "number" && overClass === DragoverClasses["is-dragover-next"]) {
|
|
721
|
+
tkl++;
|
|
722
|
+
}
|
|
723
|
+
let itemSource = fromSource;
|
|
724
|
+
if (fromSource.templateType === "VkfEditingSelect") {
|
|
725
|
+
itemSource = fromSource.templateSlots.default[0];
|
|
726
|
+
}
|
|
727
|
+
if (!fromK.length) {
|
|
728
|
+
addDefaultProp(itemSource);
|
|
729
|
+
emit("setData:formItems", {
|
|
730
|
+
k: toK.map((v, index) => index === toK.length - 1 ? tkl : v),
|
|
731
|
+
v: itemSource,
|
|
732
|
+
insert: true
|
|
733
|
+
});
|
|
734
|
+
itemSource.prop && emit("update:prop", itemSource.prop);
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
if (fromK.length === toK.length) {
|
|
738
|
+
const fkl = fromK.at(-1);
|
|
739
|
+
if (typeof fkl === "number" && typeof tkl === "number") {
|
|
740
|
+
if (overClass === DragoverClasses["is-dragover-prev"]) {
|
|
741
|
+
if (fkl + 1 === tkl)
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
744
|
+
if (overClass === DragoverClasses["is-dragover-prev"]) {
|
|
745
|
+
if (tkl === fkl)
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
emit("unsetData:formItems", {
|
|
749
|
+
k: fkl
|
|
750
|
+
});
|
|
751
|
+
if (fkl < tkl) {
|
|
752
|
+
tkl--;
|
|
753
|
+
}
|
|
754
|
+
emit("setData:formItems", {
|
|
755
|
+
k: tkl,
|
|
756
|
+
v: itemSource,
|
|
757
|
+
insert: true
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
}
|
|
637
761
|
}
|
|
638
762
|
return {
|
|
639
763
|
groundEndClassName,
|
|
@@ -643,7 +767,6 @@ var script$2 = defineComponent({
|
|
|
643
767
|
drop,
|
|
644
768
|
setData,
|
|
645
769
|
editDrop,
|
|
646
|
-
formData,
|
|
647
770
|
formItemsWithWrapper
|
|
648
771
|
};
|
|
649
772
|
}
|
|
@@ -669,17 +792,17 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
669
792
|
createCommentVNode(" \u5C06formItems\u6E32\u67D3 \u4E3A\u7F16\u8F91\u65F6\u7EC4\u4EF6 "),
|
|
670
793
|
createVNode(_component_VkTabGroup, {
|
|
671
794
|
modelValue: _ctx.prop,
|
|
672
|
-
"onUpdate:modelValue": _cache[
|
|
795
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:prop", $event))
|
|
673
796
|
}, {
|
|
674
797
|
default: withCtx(() => [
|
|
675
798
|
createVNode(_component_VkfForm, {
|
|
676
799
|
formItems: _ctx.formItemsWithWrapper,
|
|
677
|
-
data: _ctx.
|
|
678
|
-
onSetData: _cache[
|
|
800
|
+
data: _ctx.data,
|
|
801
|
+
onSetData: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("setData", $event))
|
|
679
802
|
}, {
|
|
680
803
|
rendererTemplate: withCtx(() => [
|
|
681
804
|
createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfEditingSelect" }, {
|
|
682
|
-
default: withCtx(({ data, Renderer, raw }) => [
|
|
805
|
+
default: withCtx(({ data, Renderer, raw, k }) => [
|
|
683
806
|
createCommentVNode(" name is prop "),
|
|
684
807
|
createVNode(_component_VkTabItem, {
|
|
685
808
|
name: data.name,
|
|
@@ -687,11 +810,14 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
687
810
|
class: "vkf-gm-form-item-x"
|
|
688
811
|
}, {
|
|
689
812
|
default: withCtx(({ isActive }) => [
|
|
690
|
-
createCommentVNode(" \u62D6\u52A8\u65F6 \u6839\u636E source \u548C
|
|
813
|
+
createCommentVNode(" \u62D6\u52A8\u65F6 \u6839\u636E source \u548C attributes\u786E\u5B9A\u4F4D\u7F6E "),
|
|
814
|
+
createCommentVNode(" [?] \u4E3A\u4EC0\u4E48\u5220\u9664\u4E86\u4E00\u4E2A\u6570\u636E\u540E\uFF0C\u5F53\u524D\u7684prop\u53D1\u751F\u4E86\u6539\u53D8\u3002 \u53EF\u80FD\u662F\u56E0\u4E3A\u6709\u4E2A isActive \u662F true \u88AB\u4F20\u8FDB\u53BB\u4E86 \uFF1F "),
|
|
691
815
|
createVNode(_component_EditingWrapper, {
|
|
692
|
-
onDrop:
|
|
816
|
+
onDrop: _ctx.editDrop,
|
|
817
|
+
attributes: { k },
|
|
693
818
|
active: isActive,
|
|
694
|
-
source: raw
|
|
819
|
+
source: raw,
|
|
820
|
+
onDel: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("unsetData:formItems", $event))
|
|
695
821
|
}, {
|
|
696
822
|
default: withCtx(() => [
|
|
697
823
|
(openBlock(), createBlock(resolveDynamicComponent(Renderer), {
|
|
@@ -699,25 +825,26 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
699
825
|
}, null, 8, ["source"]))
|
|
700
826
|
]),
|
|
701
827
|
_: 2
|
|
702
|
-
}, 1032, ["onDrop", "active", "source"])
|
|
828
|
+
}, 1032, ["onDrop", "attributes", "active", "source"])
|
|
703
829
|
]),
|
|
704
830
|
_: 2
|
|
705
831
|
}, 1032, ["name"])
|
|
706
832
|
]),
|
|
707
833
|
_: 1
|
|
708
|
-
})
|
|
834
|
+
}),
|
|
835
|
+
renderSlot(_ctx.$slots, "rendererTemplate")
|
|
709
836
|
]),
|
|
710
|
-
_:
|
|
837
|
+
_: 3
|
|
711
838
|
}, 8, ["formItems", "data"])
|
|
712
839
|
]),
|
|
713
|
-
_:
|
|
840
|
+
_: 3
|
|
714
841
|
}, 8, ["modelValue"]),
|
|
715
842
|
createElementVNode("div", {
|
|
716
843
|
class: normalizeClass(["vkf-ground-end", _ctx.groundEndClassName]),
|
|
717
844
|
ref: "endLineNode"
|
|
718
845
|
}, null, 2)
|
|
719
846
|
]),
|
|
720
|
-
_:
|
|
847
|
+
_: 3
|
|
721
848
|
}, 8, ["onDrop", "onDragover", "onDragleave"]);
|
|
722
849
|
}
|
|
723
850
|
|
|
@@ -746,15 +873,9 @@ var script$1 = defineComponent({
|
|
|
746
873
|
setup(props, { emit }) {
|
|
747
874
|
const configProps = _VkfConfigCtx.createBindProps(props, ["source"]);
|
|
748
875
|
const configEmits = _VkfConfigCtx.createOnEmits(emit);
|
|
749
|
-
const typeToConfigSource = {
|
|
750
|
-
"VkfInput": {
|
|
751
|
-
templateType: "VkfInput",
|
|
752
|
-
propDisabled: false
|
|
753
|
-
}
|
|
754
|
-
};
|
|
755
876
|
const source = computed(() => {
|
|
756
877
|
return {
|
|
757
|
-
|
|
878
|
+
templateType: props.templateType,
|
|
758
879
|
propDisabled: props.propDisabled
|
|
759
880
|
};
|
|
760
881
|
});
|
|
@@ -777,31 +898,197 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
777
898
|
return openBlock(), createBlock(_component_VkfConfig, mergeProps({
|
|
778
899
|
source: _ctx.source,
|
|
779
900
|
"onSetData:source": _ctx.setSource
|
|
780
|
-
}, _ctx.configProps, toHandlers(_ctx.configEmits)),
|
|
901
|
+
}, _ctx.configProps, toHandlers(_ctx.configEmits)), {
|
|
902
|
+
rendererTemplate: withCtx(() => [
|
|
903
|
+
renderSlot(_ctx.$slots, "rendererTemplate")
|
|
904
|
+
]),
|
|
905
|
+
_: 3
|
|
906
|
+
}, 16, ["source", "onSetData:source"]);
|
|
781
907
|
}
|
|
782
908
|
|
|
783
909
|
script$1.render = render$1;
|
|
784
910
|
script$1.__file = "ground/src/ground-config/src/index.vue";
|
|
785
911
|
|
|
912
|
+
function tryOnScopeDispose(fn) {
|
|
913
|
+
if (getCurrentScope()) {
|
|
914
|
+
onScopeDispose(fn);
|
|
915
|
+
return true;
|
|
916
|
+
}
|
|
917
|
+
return false;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
const isClient = typeof window !== "undefined";
|
|
921
|
+
const isString = (val) => typeof val === "string";
|
|
922
|
+
const noop = () => {
|
|
923
|
+
};
|
|
924
|
+
|
|
925
|
+
function useTimeoutFn(cb, interval, options = {}) {
|
|
926
|
+
const {
|
|
927
|
+
immediate = true
|
|
928
|
+
} = options;
|
|
929
|
+
const isPending = ref(false);
|
|
930
|
+
let timer = null;
|
|
931
|
+
function clear() {
|
|
932
|
+
if (timer) {
|
|
933
|
+
clearTimeout(timer);
|
|
934
|
+
timer = null;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
function stop() {
|
|
938
|
+
isPending.value = false;
|
|
939
|
+
clear();
|
|
940
|
+
}
|
|
941
|
+
function start(...args) {
|
|
942
|
+
clear();
|
|
943
|
+
isPending.value = true;
|
|
944
|
+
timer = setTimeout(() => {
|
|
945
|
+
isPending.value = false;
|
|
946
|
+
timer = null;
|
|
947
|
+
cb(...args);
|
|
948
|
+
}, unref(interval));
|
|
949
|
+
}
|
|
950
|
+
if (immediate) {
|
|
951
|
+
isPending.value = true;
|
|
952
|
+
if (isClient)
|
|
953
|
+
start();
|
|
954
|
+
}
|
|
955
|
+
tryOnScopeDispose(stop);
|
|
956
|
+
return {
|
|
957
|
+
isPending,
|
|
958
|
+
start,
|
|
959
|
+
stop
|
|
960
|
+
};
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
function unrefElement(elRef) {
|
|
964
|
+
var _a;
|
|
965
|
+
const plain = unref(elRef);
|
|
966
|
+
return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
const defaultWindow = isClient ? window : void 0;
|
|
970
|
+
isClient ? window.document : void 0;
|
|
971
|
+
const defaultNavigator = isClient ? window.navigator : void 0;
|
|
972
|
+
isClient ? window.location : void 0;
|
|
973
|
+
|
|
974
|
+
function useEventListener(...args) {
|
|
975
|
+
let target;
|
|
976
|
+
let event;
|
|
977
|
+
let listener;
|
|
978
|
+
let options;
|
|
979
|
+
if (isString(args[0])) {
|
|
980
|
+
[event, listener, options] = args;
|
|
981
|
+
target = defaultWindow;
|
|
982
|
+
} else {
|
|
983
|
+
[target, event, listener, options] = args;
|
|
984
|
+
}
|
|
985
|
+
if (!target)
|
|
986
|
+
return noop;
|
|
987
|
+
let cleanup = noop;
|
|
988
|
+
const stopWatch = watch(() => unrefElement(target), (el) => {
|
|
989
|
+
cleanup();
|
|
990
|
+
if (!el)
|
|
991
|
+
return;
|
|
992
|
+
el.addEventListener(event, listener, options);
|
|
993
|
+
cleanup = () => {
|
|
994
|
+
el.removeEventListener(event, listener, options);
|
|
995
|
+
cleanup = noop;
|
|
996
|
+
};
|
|
997
|
+
}, { immediate: true, flush: "post" });
|
|
998
|
+
const stop = () => {
|
|
999
|
+
stopWatch();
|
|
1000
|
+
cleanup();
|
|
1001
|
+
};
|
|
1002
|
+
tryOnScopeDispose(stop);
|
|
1003
|
+
return stop;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
function useClipboard(options = {}) {
|
|
1007
|
+
const {
|
|
1008
|
+
navigator = defaultNavigator,
|
|
1009
|
+
read = false,
|
|
1010
|
+
source,
|
|
1011
|
+
copiedDuring = 1500
|
|
1012
|
+
} = options;
|
|
1013
|
+
const events = ["copy", "cut"];
|
|
1014
|
+
const isSupported = Boolean(navigator && "clipboard" in navigator);
|
|
1015
|
+
const text = ref("");
|
|
1016
|
+
const copied = ref(false);
|
|
1017
|
+
const timeout = useTimeoutFn(() => copied.value = false, copiedDuring);
|
|
1018
|
+
function updateText() {
|
|
1019
|
+
navigator.clipboard.readText().then((value) => {
|
|
1020
|
+
text.value = value;
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
if (isSupported && read) {
|
|
1024
|
+
for (const event of events)
|
|
1025
|
+
useEventListener(event, updateText);
|
|
1026
|
+
}
|
|
1027
|
+
async function copy(value = unref(source)) {
|
|
1028
|
+
if (isSupported && value != null) {
|
|
1029
|
+
await navigator.clipboard.writeText(value);
|
|
1030
|
+
text.value = value;
|
|
1031
|
+
copied.value = true;
|
|
1032
|
+
timeout.start();
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
return {
|
|
1036
|
+
isSupported,
|
|
1037
|
+
text,
|
|
1038
|
+
copied,
|
|
1039
|
+
copy
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
1044
|
+
const globalKey = "__vueuse_ssr_handlers__";
|
|
1045
|
+
_global[globalKey] = _global[globalKey] || {};
|
|
1046
|
+
_global[globalKey];
|
|
1047
|
+
|
|
1048
|
+
var _a, _b;
|
|
1049
|
+
isClient && (window == null ? void 0 : window.navigator) && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.platform) && /iP(ad|hone|od)/.test((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.platform);
|
|
1050
|
+
|
|
786
1051
|
var script = defineComponent({
|
|
787
1052
|
name: "VkfGround",
|
|
788
1053
|
components: {
|
|
789
1054
|
VkfGroundWidget: script$4,
|
|
790
1055
|
VkfGroundMain: script$2,
|
|
791
|
-
VkfGroundConfig: script$1
|
|
1056
|
+
VkfGroundConfig: script$1,
|
|
1057
|
+
VkCard,
|
|
1058
|
+
ElButton
|
|
1059
|
+
},
|
|
1060
|
+
props: {
|
|
1061
|
+
componentLibCollapseExpanded: {
|
|
1062
|
+
type: Array,
|
|
1063
|
+
default: void 0
|
|
1064
|
+
},
|
|
1065
|
+
source: {
|
|
1066
|
+
type: Array,
|
|
1067
|
+
default: () => []
|
|
1068
|
+
},
|
|
1069
|
+
data: {
|
|
1070
|
+
type: Object,
|
|
1071
|
+
default: () => ({})
|
|
1072
|
+
}
|
|
1073
|
+
},
|
|
1074
|
+
emits: {
|
|
1075
|
+
"update:source": null,
|
|
1076
|
+
"setData:source": (e) => e,
|
|
1077
|
+
"unsetData:source": null,
|
|
1078
|
+
"setData": (e) => e,
|
|
1079
|
+
"update:componentLibCollapseExpanded": null
|
|
792
1080
|
},
|
|
793
1081
|
setup(props, { emit }) {
|
|
794
|
-
const formItems = ref([]);
|
|
795
|
-
const editProp = ref("");
|
|
796
1082
|
const propToFormItem = computed(() => {
|
|
797
|
-
return
|
|
1083
|
+
return props.source.reduce((a, c) => {
|
|
798
1084
|
if (c.prop) {
|
|
799
1085
|
a[c.prop] = c;
|
|
800
1086
|
}
|
|
801
1087
|
return a;
|
|
802
1088
|
}, {});
|
|
803
1089
|
});
|
|
804
|
-
const
|
|
1090
|
+
const editProp = ref("");
|
|
1091
|
+
const configPropDisabled = ref(true);
|
|
805
1092
|
const setFormItem = (props2, e) => {
|
|
806
1093
|
if (e.k === "prop") {
|
|
807
1094
|
if (e.v === props2.prop) {
|
|
@@ -812,6 +1099,11 @@ var script = defineComponent({
|
|
|
812
1099
|
type: "warning",
|
|
813
1100
|
message: "\u5B58\u5728\u76F8\u540C\u7684prop, \u8BF7\u91CD\u65B0\u4FEE\u6539"
|
|
814
1101
|
});
|
|
1102
|
+
} else if (!e.v) {
|
|
1103
|
+
ElMessage({
|
|
1104
|
+
type: "warning",
|
|
1105
|
+
message: "prop\u4E0D\u80FD\u4E3A\u7A7A"
|
|
1106
|
+
});
|
|
815
1107
|
} else {
|
|
816
1108
|
props2.prop = e.v;
|
|
817
1109
|
editProp.value = e.v;
|
|
@@ -822,49 +1114,121 @@ var script = defineComponent({
|
|
|
822
1114
|
setData(props2, e);
|
|
823
1115
|
}
|
|
824
1116
|
};
|
|
1117
|
+
const formItemStr = computed(() => JSON.stringify(props.source));
|
|
1118
|
+
const formItemClip = useClipboard({
|
|
1119
|
+
source: formItemStr
|
|
1120
|
+
});
|
|
1121
|
+
const inputJson = () => {
|
|
1122
|
+
ElMessageBox.prompt("\u8F93\u5165Json", "\u63D0\u793A", {
|
|
1123
|
+
confirmButtonText: "\u786E\u8BA4",
|
|
1124
|
+
cancelButtonText: "\u53D6\u6D88"
|
|
1125
|
+
}).then(({ value }) => {
|
|
1126
|
+
let obj = [];
|
|
1127
|
+
try {
|
|
1128
|
+
obj = JSON.parse(value);
|
|
1129
|
+
} catch (err) {
|
|
1130
|
+
ElMessage({
|
|
1131
|
+
type: "error",
|
|
1132
|
+
message: "Json\u89E3\u6790\u9519\u8BEF"
|
|
1133
|
+
});
|
|
1134
|
+
throw err;
|
|
1135
|
+
}
|
|
1136
|
+
return obj;
|
|
1137
|
+
}).then((obj) => {
|
|
1138
|
+
emit("update:source", obj);
|
|
1139
|
+
});
|
|
1140
|
+
};
|
|
825
1141
|
return {
|
|
826
1142
|
propToFormItem,
|
|
827
|
-
formItems,
|
|
828
1143
|
editProp,
|
|
829
1144
|
setData,
|
|
830
1145
|
unsetData,
|
|
831
1146
|
setFormItem,
|
|
832
|
-
configPropDisabled
|
|
1147
|
+
configPropDisabled,
|
|
1148
|
+
formItemClip,
|
|
1149
|
+
inputJson
|
|
833
1150
|
};
|
|
834
1151
|
}
|
|
835
1152
|
});
|
|
836
1153
|
|
|
837
1154
|
const _hoisted_1 = { class: "vkf-ground" };
|
|
838
1155
|
const _hoisted_2 = { class: "vkf-ground-main-x" };
|
|
839
|
-
const _hoisted_3 = {
|
|
1156
|
+
const _hoisted_3 = { key: 0 };
|
|
1157
|
+
const _hoisted_4 = { key: 1 };
|
|
1158
|
+
const _hoisted_5 = /* @__PURE__ */ createTextVNode(" \u5BFC\u5165Json ");
|
|
1159
|
+
const _hoisted_6 = { class: "vkf-ground-config-x" };
|
|
840
1160
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
841
1161
|
const _component_VkfGroundWidget = resolveComponent("VkfGroundWidget");
|
|
1162
|
+
const _component_ElButton = resolveComponent("ElButton");
|
|
842
1163
|
const _component_VkfGroundMain = resolveComponent("VkfGroundMain");
|
|
1164
|
+
const _component_VkCard = resolveComponent("VkCard");
|
|
843
1165
|
const _component_VkfGroundConfig = resolveComponent("VkfGroundConfig");
|
|
844
1166
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
845
|
-
createVNode(_component_VkfGroundWidget, {
|
|
1167
|
+
createVNode(_component_VkfGroundWidget, {
|
|
1168
|
+
class: "vkf-ground-widget-x",
|
|
1169
|
+
componentLibCollapseExpanded: _ctx.componentLibCollapseExpanded,
|
|
1170
|
+
"onUpdate:componentLibCollapseExpanded": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:componentLibCollapseExpanded", $event))
|
|
1171
|
+
}, {
|
|
1172
|
+
componentLibCollapse: withCtx(() => [
|
|
1173
|
+
renderSlot(_ctx.$slots, "widgetComponentLibCollapse")
|
|
1174
|
+
]),
|
|
1175
|
+
_: 3
|
|
1176
|
+
}, 8, ["componentLibCollapseExpanded"]),
|
|
846
1177
|
createElementVNode("div", _hoisted_2, [
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
1178
|
+
createVNode(_component_VkCard, {
|
|
1179
|
+
tag: "div",
|
|
1180
|
+
class: "vkf-ground-main-card"
|
|
1181
|
+
}, {
|
|
1182
|
+
title: withCtx(() => [
|
|
1183
|
+
createVNode(_component_ElButton, {
|
|
1184
|
+
onClick: _cache[1] || (_cache[1] = () => _ctx.formItemClip.copy())
|
|
1185
|
+
}, {
|
|
1186
|
+
default: withCtx(() => [
|
|
1187
|
+
!_ctx.formItemClip.copied.value ? (openBlock(), createElementBlock("span", _hoisted_3, "\u590D\u5236Json")) : (openBlock(), createElementBlock("span", _hoisted_4, "\u5DF2\u590D\u5236!"))
|
|
1188
|
+
]),
|
|
1189
|
+
_: 1
|
|
1190
|
+
}),
|
|
1191
|
+
createVNode(_component_ElButton, { onClick: _ctx.inputJson }, {
|
|
1192
|
+
default: withCtx(() => [
|
|
1193
|
+
_hoisted_5
|
|
1194
|
+
]),
|
|
1195
|
+
_: 1
|
|
1196
|
+
}, 8, ["onClick"])
|
|
1197
|
+
]),
|
|
1198
|
+
default: withCtx(() => [
|
|
1199
|
+
createVNode(_component_VkfGroundMain, {
|
|
1200
|
+
data: _ctx.data,
|
|
1201
|
+
onSetData: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("setData", $event)),
|
|
1202
|
+
prop: _ctx.editProp,
|
|
1203
|
+
"onUpdate:prop": _cache[3] || (_cache[3] = ($event) => _ctx.editProp = $event),
|
|
1204
|
+
formItems: _ctx.source,
|
|
1205
|
+
"onSetData:formItems": _cache[4] || (_cache[4] = ($event) => _ctx.$emit("setData:source", $event)),
|
|
1206
|
+
"onUnsetData:formItems": _cache[5] || (_cache[5] = ($event) => _ctx.$emit("unsetData:source", $event))
|
|
1207
|
+
}, {
|
|
1208
|
+
rendererTemplate: withCtx(() => [
|
|
1209
|
+
renderSlot(_ctx.$slots, "rendererTemplate")
|
|
1210
|
+
]),
|
|
1211
|
+
_: 3
|
|
1212
|
+
}, 8, ["data", "prop", "formItems"])
|
|
1213
|
+
]),
|
|
1214
|
+
_: 3
|
|
1215
|
+
})
|
|
858
1216
|
]),
|
|
859
|
-
createElementVNode("div",
|
|
1217
|
+
createElementVNode("div", _hoisted_6, [
|
|
1218
|
+
createCommentVNode(" \u901A\u8FC7config \u4FEE\u6539\u6570\u636E\u6E90 \u5355\u9879\u7684\u5185\u5BB9 "),
|
|
860
1219
|
_ctx.editProp && _ctx.propToFormItem[_ctx.editProp] ? (openBlock(), createBlock(_component_VkfGroundConfig, {
|
|
861
1220
|
key: 0,
|
|
862
1221
|
propDisabled: _ctx.configPropDisabled,
|
|
863
|
-
"onUpdate:propDisabled": _cache[
|
|
1222
|
+
"onUpdate:propDisabled": _cache[6] || (_cache[6] = ($event) => _ctx.configPropDisabled = $event),
|
|
864
1223
|
templateType: _ctx.propToFormItem[_ctx.editProp].templateType,
|
|
865
1224
|
data: _ctx.propToFormItem[_ctx.editProp],
|
|
866
|
-
onSetData: _cache[
|
|
867
|
-
},
|
|
1225
|
+
onSetData: _cache[7] || (_cache[7] = ($event) => _ctx.setFormItem(_ctx.propToFormItem[_ctx.editProp], $event))
|
|
1226
|
+
}, {
|
|
1227
|
+
rendererTemplate: withCtx(() => [
|
|
1228
|
+
renderSlot(_ctx.$slots, "configRendererTemplate")
|
|
1229
|
+
]),
|
|
1230
|
+
_: 3
|
|
1231
|
+
}, 8, ["propDisabled", "templateType", "data"])) : createCommentVNode("v-if", true)
|
|
868
1232
|
])
|
|
869
1233
|
]);
|
|
870
1234
|
}
|