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