@vunk/form 0.0.0-alpha.8 → 0.0.1-alpha.3

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 (272) 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 +66 -62
  4. package/components/date-picker/src/ctx.js +31 -0
  5. package/components/date-picker/src/index.vue.d.ts +182 -187
  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 +36 -79
  10. package/components/form/src/ctx.d.ts +77 -77
  11. package/components/form/src/ctx.js +45 -0
  12. package/components/form/src/index.vue.d.ts +236 -236
  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/input.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 -22
  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/index.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/date-picker.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 +129 -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/confirm-input.js → components/form-item-renderer-template-layout/src/types.js} +0 -0
  48. package/components/input/index.js +25 -10
  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/input-number/index.d.ts +4 -0
  55. package/components/input-number/index.js +67 -0
  56. package/components/input-number/src/ctx.d.ts +71 -0
  57. package/components/input-number/src/ctx.js +23 -0
  58. package/components/input-number/src/index.vue.d.ts +167 -0
  59. package/components/input-number/src/types.d.ts +1 -0
  60. package/{shared/types/form-item/select.js → components/input-number/src/types.js} +0 -0
  61. package/components/select/index.js +61 -16
  62. package/components/select/src/ctx.d.ts +44 -40
  63. package/components/select/src/ctx.js +35 -0
  64. package/components/select/src/index.vue.d.ts +150 -186
  65. package/components/select/src/types.d.ts +1 -1
  66. package/{shared/types/shared/index.js → components/select/src/types.js} +0 -0
  67. package/components/switch/index.js +18 -7
  68. package/components/switch/src/ctx.d.ts +8 -8
  69. package/components/switch/src/ctx.js +22 -0
  70. package/components/switch/src/index.vue.d.ts +29 -62
  71. package/components/switch/src/types.d.ts +1 -3
  72. package/components/switch/src/types.js +1 -0
  73. package/composables/index.d.ts +1 -0
  74. package/composables/index.js +82 -0
  75. package/composables/useSourceManager.d.ts +13 -0
  76. package/defaults.d.ts +5 -0
  77. package/index.css +3 -128
  78. package/index.d.ts +9 -36
  79. package/index.esm.js +29 -15
  80. package/package.json +4 -3
  81. package/shared/element-plus/ctx.d.ts +13 -0
  82. package/shared/element-plus/index.d.ts +2 -0
  83. package/shared/element-plus/index.js +183 -0
  84. package/shared/element-plus/instances.d.ts +184 -0
  85. package/shared/helper/index.d.ts +3 -3
  86. package/shared/helper/index.js +7 -13
  87. package/shared/index.d.ts +1 -0
  88. package/shared/index.js +1 -0
  89. package/shared/types/index.d.ts +3 -3
  90. package/shared/types/layout-source/index.d.ts +30 -0
  91. package/shared/types/layout-source/index.js +1 -0
  92. package/shared/types/renderer-source/compoent.d.ts +5 -0
  93. package/{types/shared/types/form-item → shared/types/renderer-source}/date-picker.d.ts +1 -2
  94. package/shared/types/renderer-source/index.d.ts +13 -0
  95. package/shared/types/renderer-source/index.js +1 -0
  96. package/shared/types/renderer-source/input-number.d.ts +7 -0
  97. package/shared/types/{form-item → renderer-source}/input.d.ts +1 -2
  98. package/{types/shared/types/form-item → shared/types/renderer-source}/select.d.ts +1 -2
  99. package/shared/types/{form-item → renderer-source}/switch.d.ts +1 -2
  100. package/shared/types/source-manager/index.d.ts +6 -0
  101. package/shared/types/source-manager/index.js +1 -0
  102. package/components/config/index.d.ts +0 -4
  103. package/components/config/index.js +0 -63
  104. package/components/config/src/ctx.d.ts +0 -22
  105. package/components/config/src/index.vue.d.ts +0 -45
  106. package/components/config-renderer/index.d.ts +0 -6
  107. package/components/config-renderer/index.js +0 -58
  108. package/components/config-renderer/src/ctx.d.ts +0 -11
  109. package/components/config-renderer/src/index.vue.d.ts +0 -26
  110. package/components/config-renderer/src/symbols.d.ts +0 -2
  111. package/components/config-renderer/src/types.d.ts +0 -3
  112. package/components/config-renderer-template/index.d.ts +0 -3
  113. package/components/config-renderer-template/index.js +0 -37
  114. package/components/config-renderer-template/src/ctx.d.ts +0 -7
  115. package/components/config-renderer-template/src/index.vue.d.ts +0 -16
  116. package/components/confirm-input/index.css +0 -9
  117. package/components/confirm-input/index.d.ts +0 -3
  118. package/components/confirm-input/index.js +0 -149
  119. package/components/confirm-input/src/ctx.d.ts +0 -116
  120. package/components/confirm-input/src/index.vue.d.ts +0 -313
  121. package/components/drag-wrapper/index.d.ts +0 -4
  122. package/components/drag-wrapper/index.js +0 -53
  123. package/components/drag-wrapper/src/ctx.d.ts +0 -11
  124. package/components/drag-wrapper/src/index.vue.d.ts +0 -25
  125. package/components/drag-wrapper/src/types.d.ts +0 -3
  126. package/components/drop-wrapper/index.d.ts +0 -4
  127. package/components/drop-wrapper/index.js +0 -67
  128. package/components/drop-wrapper/src/index.vue.d.ts +0 -14
  129. package/components/drop-wrapper/src/static.d.ts +0 -5
  130. package/components/form/src/utils.d.ts +0 -2
  131. package/components/form-item-renderer/src/utils.d.ts +0 -3
  132. package/components/ground/index.css +0 -122
  133. package/components/ground/index.d.ts +0 -4
  134. package/components/ground/index.js +0 -1269
  135. package/components/ground/src/ctx.d.ts +0 -11
  136. package/components/ground/src/ground-config/index.d.ts +0 -3
  137. package/components/ground/src/ground-config/src/index copy.vue.d.ts +0 -72
  138. package/components/ground/src/ground-config/src/index.vue.d.ts +0 -971
  139. package/components/ground/src/ground-main/index.d.ts +0 -3
  140. package/components/ground/src/ground-main/src/ctx.d.ts +0 -2
  141. package/components/ground/src/ground-main/src/editing-wrapper.vue.d.ts +0 -58
  142. package/components/ground/src/ground-main/src/index.vue.d.ts +0 -56
  143. package/components/ground/src/ground-main/src/types.d.ts +0 -9
  144. package/components/ground/src/ground-widget/index.d.ts +0 -3
  145. package/components/ground/src/ground-widget/src/ctx.d.ts +0 -2
  146. package/components/ground/src/ground-widget/src/form-item-widget/index.d.ts +0 -2
  147. package/components/ground/src/ground-widget/src/form-item-widget/src/index.vue.d.ts +0 -1083
  148. package/components/ground/src/ground-widget/src/index.vue.d.ts +0 -29
  149. package/components/ground/src/ground-widget/src/static.d.ts +0 -4
  150. package/components/ground/src/index.vue.d.ts +0 -75
  151. package/components/ground/src/types.d.ts +0 -3
  152. package/components/input-config/index.d.ts +0 -4
  153. package/components/input-config/index.js +0 -179
  154. package/components/input-config/src/ctx.d.ts +0 -638
  155. package/components/input-config/src/index.vue.d.ts +0 -2194
  156. package/components/input-config/src/types.d.ts +0 -3
  157. package/components/rules-config/index.d.ts +0 -3
  158. package/components/rules-config/index.js +0 -63
  159. package/components/rules-config/src/ctx.d.ts +0 -314
  160. package/components/rules-config/src/index.vue.d.ts +0 -1211
  161. package/components/select-config/index.d.ts +0 -4
  162. package/components/select-config/index.js +0 -43
  163. package/components/select-config/src/ctx.d.ts +0 -11
  164. package/components/select-config/src/index.vue.d.ts +0 -18
  165. package/components/select-config/src/types.d.ts +0 -3
  166. package/full-entry/main.d.ts +0 -17
  167. package/shared/element-plus/ctx/index.d.ts +0 -11
  168. package/shared/element-plus/ctx/index.js +0 -1295
  169. package/shared/element-plus/instances/date-picker.d.ts +0 -94
  170. package/shared/element-plus/instances/date-picker.js +0 -21
  171. package/shared/element-plus/instances/select.d.ts +0 -91
  172. package/shared/element-plus/instances/select.js +0 -1264
  173. package/shared/types/drag/index.d.ts +0 -7
  174. package/shared/types/form-item/confirm-input.d.ts +0 -8
  175. package/shared/types/form-item/date-picker.d.ts +0 -8
  176. package/shared/types/form-item/index.d.ts +0 -5
  177. package/shared/types/form-item/select.d.ts +0 -8
  178. package/shared/types/shared/index.d.ts +0 -11
  179. package/types/components/config/index.d.ts +0 -4
  180. package/types/components/config/src/ctx.d.ts +0 -22
  181. package/types/components/config/src/index.vue.d.ts +0 -45
  182. package/types/components/config-renderer/index.d.ts +0 -6
  183. package/types/components/config-renderer/src/ctx.d.ts +0 -11
  184. package/types/components/config-renderer/src/index.vue.d.ts +0 -26
  185. package/types/components/config-renderer/src/symbols.d.ts +0 -2
  186. package/types/components/config-renderer/src/types.d.ts +0 -3
  187. package/types/components/config-renderer-template/index.d.ts +0 -3
  188. package/types/components/config-renderer-template/src/ctx.d.ts +0 -7
  189. package/types/components/config-renderer-template/src/index.vue.d.ts +0 -16
  190. package/types/components/confirm-input/index.d.ts +0 -3
  191. package/types/components/confirm-input/src/ctx.d.ts +0 -116
  192. package/types/components/confirm-input/src/index.vue.d.ts +0 -313
  193. package/types/components/date-picker/index.d.ts +0 -4
  194. package/types/components/date-picker/src/ctx.d.ts +0 -131
  195. package/types/components/date-picker/src/index.vue.d.ts +0 -343
  196. package/types/components/date-picker/src/types.d.ts +0 -14
  197. package/types/components/drag-wrapper/index.d.ts +0 -4
  198. package/types/components/drag-wrapper/src/ctx.d.ts +0 -11
  199. package/types/components/drag-wrapper/src/index.vue.d.ts +0 -25
  200. package/types/components/drag-wrapper/src/types.d.ts +0 -3
  201. package/types/components/drop-wrapper/index.d.ts +0 -4
  202. package/types/components/drop-wrapper/src/index.vue.d.ts +0 -14
  203. package/types/components/drop-wrapper/src/static.d.ts +0 -5
  204. package/types/components/form/index.d.ts +0 -5
  205. package/types/components/form/src/ctx.d.ts +0 -318
  206. package/types/components/form/src/index.vue.d.ts +0 -933
  207. package/types/components/form/src/utils.d.ts +0 -2
  208. package/types/components/form-item/index.d.ts +0 -5
  209. package/types/components/form-item/src/ctx.d.ts +0 -44
  210. package/types/components/form-item/src/index.vue.d.ts +0 -102
  211. package/types/components/form-item/src/types.d.ts +0 -6
  212. package/types/components/form-item-renderer/index.d.ts +0 -6
  213. package/types/components/form-item-renderer/src/ctx.d.ts +0 -16
  214. package/types/components/form-item-renderer/src/index.vue.d.ts +0 -38
  215. package/types/components/form-item-renderer/src/symbols.d.ts +0 -2
  216. package/types/components/form-item-renderer/src/types.d.ts +0 -5
  217. package/types/components/form-item-renderer/src/utils.d.ts +0 -3
  218. package/types/components/form-item-renderer-template/index.d.ts +0 -3
  219. package/types/components/form-item-renderer-template/src/ctx.d.ts +0 -7
  220. package/types/components/form-item-renderer-template/src/index.vue.d.ts +0 -16
  221. package/types/components/ground/index.d.ts +0 -4
  222. package/types/components/ground/src/ground-config/index.d.ts +0 -3
  223. package/types/components/ground/src/ground-config/src/index copy.vue.d.ts +0 -72
  224. package/types/components/ground/src/ground-config/src/index.vue.d.ts +0 -971
  225. package/types/components/ground/src/ground-main/index.d.ts +0 -3
  226. package/types/components/ground/src/ground-main/src/ctx.d.ts +0 -2
  227. package/types/components/ground/src/ground-main/src/editing-wrapper.vue.d.ts +0 -58
  228. package/types/components/ground/src/ground-main/src/index.vue.d.ts +0 -56
  229. package/types/components/ground/src/ground-main/src/types.d.ts +0 -9
  230. package/types/components/ground/src/ground-widget/index.d.ts +0 -3
  231. package/types/components/ground/src/ground-widget/src/ctx.d.ts +0 -2
  232. package/types/components/ground/src/ground-widget/src/form-item-widget/index.d.ts +0 -2
  233. package/types/components/ground/src/ground-widget/src/form-item-widget/src/index.vue.d.ts +0 -1083
  234. package/types/components/ground/src/ground-widget/src/index.vue.d.ts +0 -29
  235. package/types/components/ground/src/ground-widget/src/static.d.ts +0 -4
  236. package/types/components/ground/src/index.vue.d.ts +0 -75
  237. package/types/components/ground/src/types.d.ts +0 -3
  238. package/types/components/input/index.d.ts +0 -5
  239. package/types/components/input/src/ctx.d.ts +0 -104
  240. package/types/components/input/src/index.vue.d.ts +0 -278
  241. package/types/components/input/src/types.d.ts +0 -7
  242. package/types/components/input-config/index.d.ts +0 -4
  243. package/types/components/input-config/src/ctx.d.ts +0 -638
  244. package/types/components/input-config/src/index.vue.d.ts +0 -2194
  245. package/types/components/input-config/src/types.d.ts +0 -3
  246. package/types/components/rules-config/index.d.ts +0 -3
  247. package/types/components/rules-config/src/ctx.d.ts +0 -314
  248. package/types/components/rules-config/src/index.vue.d.ts +0 -1211
  249. package/types/components/select/index.d.ts +0 -4
  250. package/types/components/select/src/ctx.d.ts +0 -193
  251. package/types/components/select/src/index.vue.d.ts +0 -589
  252. package/types/components/select/src/types.d.ts +0 -5
  253. package/types/components/select-config/index.d.ts +0 -4
  254. package/types/components/select-config/src/ctx.d.ts +0 -11
  255. package/types/components/select-config/src/index.vue.d.ts +0 -18
  256. package/types/components/select-config/src/types.d.ts +0 -3
  257. package/types/components/switch/index.d.ts +0 -4
  258. package/types/components/switch/src/ctx.d.ts +0 -68
  259. package/types/components/switch/src/index.vue.d.ts +0 -197
  260. package/types/components/switch/src/types.d.ts +0 -3
  261. package/types/full-entry/main.d.ts +0 -17
  262. package/types/shared/element-plus/ctx/index.d.ts +0 -11
  263. package/types/shared/element-plus/instances/date-picker.d.ts +0 -94
  264. package/types/shared/element-plus/instances/select.d.ts +0 -91
  265. package/types/shared/helper/index.d.ts +0 -3
  266. package/types/shared/types/drag/index.d.ts +0 -7
  267. package/types/shared/types/form-item/confirm-input.d.ts +0 -8
  268. package/types/shared/types/form-item/index.d.ts +0 -5
  269. package/types/shared/types/form-item/input.d.ts +0 -8
  270. package/types/shared/types/form-item/switch.d.ts +0 -8
  271. package/types/shared/types/index.d.ts +0 -3
  272. package/types/shared/types/shared/index.d.ts +0 -11
@@ -1,1269 +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, 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 { VkfConfigRenderer } from '@vunk/form/components/config-renderer';
12
- import { VkfConfigRendererTemplate } from '@vunk/form/components/config-renderer-template';
13
- import { VkfInputConfig } from '@vunk/form/components/input-config';
14
-
15
- var script$5 = defineComponent({
16
- components: {
17
- ElCollapseItem,
18
- VkfDragWrapper
19
- },
20
- setup() {
21
- const data = [
22
- {
23
- label: "input",
24
- value: "VkfInput",
25
- defaultOptions: {
26
- templateType: "VkfInput",
27
- prop: "",
28
- label: "inputLabel"
29
- }
30
- },
31
- {
32
- label: "select",
33
- value: "VkfSelect",
34
- defaultOptions: {
35
- templateType: "VkfSelect",
36
- prop: "",
37
- label: "label"
38
- }
39
- },
40
- {
41
- label: "switch",
42
- value: "VkfSwitch",
43
- defaultOptions: {
44
- templateType: "VkfSwitch",
45
- prop: "",
46
- label: "label"
47
- }
48
- }
49
- ];
50
- return {
51
- data
52
- };
53
- }
54
- });
55
-
56
- const _hoisted_1$6 = { class: "vkf-ground-widget-ul" };
57
- function render$5(_ctx, _cache, $props, $setup, $data, $options) {
58
- const _component_VkfDragWrapper = resolveComponent("VkfDragWrapper");
59
- const _component_ElCollapseItem = resolveComponent("ElCollapseItem");
60
- return openBlock(), createBlock(_component_ElCollapseItem, { title: "FormItems" }, {
61
- default: withCtx(() => [
62
- createElementVNode("ul", _hoisted_1$6, [
63
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data, (item) => {
64
- return openBlock(), createBlock(_component_VkfDragWrapper, {
65
- key: item.value,
66
- title: JSON.stringify({ source: item.defaultOptions }),
67
- data: JSON.stringify({ source: item.defaultOptions })
68
- }, {
69
- default: withCtx(() => [
70
- createElementVNode("li", null, toDisplayString(item.label), 1)
71
- ]),
72
- _: 2
73
- }, 1032, ["title", "data"]);
74
- }), 128))
75
- ])
76
- ]),
77
- _: 1
78
- });
79
- }
80
-
81
- script$5.render = render$5;
82
- script$5.__file = "ground/src/ground-widget/src/form-item-widget/src/index.vue";
83
-
84
- var ComponentsType = /* @__PURE__ */ ((ComponentsType2) => {
85
- ComponentsType2["container"] = "container";
86
- ComponentsType2["formItems"] = "formItems";
87
- return ComponentsType2;
88
- })(ComponentsType || {});
89
-
90
- var WidgetTab = /* @__PURE__ */ ((WidgetTab2) => {
91
- WidgetTab2["components"] = "components";
92
- WidgetTab2["templates"] = "templates";
93
- return WidgetTab2;
94
- })(WidgetTab || {});
95
- var script$4 = defineComponent({
96
- components: {
97
- VkTabGroup,
98
- VkTabItem,
99
- VkFloatBlock,
100
- VkCard,
101
- ElScrollbar,
102
- ElCollapse,
103
- FormItemWidget: script$5
104
- },
105
- props: {
106
- componentLibCollapseExpanded: {
107
- type: Array,
108
- default: () => [
109
- ComponentsType.container,
110
- ComponentsType.formItems
111
- ]
112
- }
113
- },
114
- emits: {
115
- "update:componentLibCollapseExpanded": null
116
- },
117
- setup() {
118
- const widgetTab = ref("components" /* components */);
119
- return {
120
- WidgetTab,
121
- ComponentsType,
122
- widgetTab
123
- };
124
- }
125
- });
126
-
127
- const _hoisted_1$5 = /* @__PURE__ */ createTextVNode(" \u7EC4\u4EF6\u5E93 ");
128
- const _hoisted_2$4 = /* @__PURE__ */ createTextVNode(" \u6A21\u677F\u5E93 ");
129
- function render$4(_ctx, _cache, $props, $setup, $data, $options) {
130
- const _component_VkTabItem = resolveComponent("VkTabItem");
131
- const _component_VkFloatBlock = resolveComponent("VkFloatBlock");
132
- const _component_VkTabGroup = resolveComponent("VkTabGroup");
133
- const _component_FormItemWidget = resolveComponent("FormItemWidget");
134
- const _component_ElCollapse = resolveComponent("ElCollapse");
135
- const _component_ElScrollbar = resolveComponent("ElScrollbar");
136
- const _component_VkCard = resolveComponent("VkCard");
137
- return openBlock(), createBlock(_component_VkCard, { tag: "div" }, {
138
- title: withCtx(() => [
139
- createVNode(_component_VkTabGroup, {
140
- class: "vkf-widget-tab",
141
- modelValue: _ctx.widgetTab,
142
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.widgetTab = $event)
143
- }, {
144
- default: withCtx(() => [
145
- createVNode(_component_VkTabItem, {
146
- name: _ctx.WidgetTab.components,
147
- clearable: false
148
- }, {
149
- default: withCtx(() => [
150
- _hoisted_1$5
151
- ]),
152
- _: 1
153
- }, 8, ["name"]),
154
- createVNode(_component_VkTabItem, {
155
- name: _ctx.WidgetTab.templates,
156
- clearable: false
157
- }, {
158
- default: withCtx(() => [
159
- _hoisted_2$4
160
- ]),
161
- _: 1
162
- }, 8, ["name"]),
163
- createVNode(_component_VkFloatBlock, { scale: 0.8 })
164
- ]),
165
- _: 1
166
- }, 8, ["modelValue"])
167
- ]),
168
- default: withCtx(() => [
169
- createVNode(_component_ElScrollbar, null, {
170
- default: withCtx(() => [
171
- withDirectives(createVNode(_component_ElCollapse, {
172
- modelValue: _ctx.componentLibCollapseExpanded,
173
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:componentLibCollapseExpanded", $event))
174
- }, {
175
- default: withCtx(() => [
176
- createVNode(_component_FormItemWidget, {
177
- name: _ctx.ComponentsType.formItems
178
- }, null, 8, ["name"]),
179
- renderSlot(_ctx.$slots, "componentLibCollapse")
180
- ]),
181
- _: 3
182
- }, 8, ["modelValue"]), [
183
- [vShow, _ctx.widgetTab === _ctx.WidgetTab.components]
184
- ])
185
- ]),
186
- _: 3
187
- })
188
- ]),
189
- _: 3
190
- });
191
- }
192
-
193
- script$4.render = render$4;
194
- script$4.__file = "ground/src/ground-widget/src/index.vue";
195
-
196
- var _export_sfc = (sfc, props) => {
197
- const target = sfc.__vccOpts || sfc;
198
- for (const [key, val] of props) {
199
- target[key] = val;
200
- }
201
- return target;
202
- };
203
-
204
- const _sfc_main$1 = defineComponent({
205
- name: "Delete"
206
- });
207
- const _hoisted_1$4 = {
208
- viewBox: "0 0 1024 1024",
209
- xmlns: "http://www.w3.org/2000/svg"
210
- };
211
- const _hoisted_2$3 = /* @__PURE__ */ createElementVNode("path", {
212
- fill: "currentColor",
213
- 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"
214
- }, null, -1);
215
- const _hoisted_3$2 = [
216
- _hoisted_2$3
217
- ];
218
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
219
- return openBlock(), createElementBlock("svg", _hoisted_1$4, _hoisted_3$2);
220
- }
221
- var _delete = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
222
-
223
- const _sfc_main = defineComponent({
224
- name: "Sort"
225
- });
226
- const _hoisted_1$3 = {
227
- viewBox: "0 0 1024 1024",
228
- xmlns: "http://www.w3.org/2000/svg"
229
- };
230
- const _hoisted_2$2 = /* @__PURE__ */ createElementVNode("path", {
231
- fill: "currentColor",
232
- 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"
233
- }, null, -1);
234
- const _hoisted_3$1 = [
235
- _hoisted_2$2
236
- ];
237
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
238
- return openBlock(), createElementBlock("svg", _hoisted_1$3, _hoisted_3$1);
239
- }
240
- var sort = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
241
-
242
- var script$3 = defineComponent({
243
- props: {
244
- active: {
245
- type: Boolean,
246
- default: false
247
- },
248
- source: {
249
- type: Object,
250
- default: () => ({})
251
- },
252
- attributes: {
253
- type: Object,
254
- default: () => ({ k: [] })
255
- }
256
- },
257
- emits: {
258
- drop: (e, c, data) => e || c || data,
259
- del: (e) => e
260
- },
261
- components: {
262
- VkBoxHandler,
263
- ElIcon,
264
- Sort: sort,
265
- Delete: _delete,
266
- VkfDragWrapper,
267
- VkfDropWrapper
268
- }
269
- });
270
-
271
- const _hoisted_1$2 = /* @__PURE__ */ createTextVNode(" \u62D6\u52A8\u5355\u5143 ");
272
- const _hoisted_2$1 = { class: "vkf-gmew-tools vkf-gmew-rb-x" };
273
- function render$3(_ctx, _cache, $props, $setup, $data, $options) {
274
- const _component_Sort = resolveComponent("Sort");
275
- const _component_el_icon = resolveComponent("el-icon");
276
- const _component_VkfDragWrapper = resolveComponent("VkfDragWrapper");
277
- const _component_VkBoxHandler = resolveComponent("VkBoxHandler");
278
- const _component_Delete = resolveComponent("Delete");
279
- const _component_VkfDropWrapper = resolveComponent("VkfDropWrapper");
280
- return openBlock(), createBlock(_component_VkfDropWrapper, {
281
- onDrop: _cache[1] || (_cache[1] = (...arg) => _ctx.$emit("drop", ...arg, {
282
- attributes: _ctx.attributes,
283
- source: _ctx.source
284
- })),
285
- class: "vkf-ground-main-editing-wrapper"
286
- }, {
287
- default: withCtx(() => [
288
- withDirectives(createVNode(_component_VkBoxHandler, null, {
289
- default: withCtx(() => [
290
- createVNode(_component_VkfDragWrapper, {
291
- title: JSON.stringify({ source: _ctx.source, attributes: _ctx.attributes }),
292
- data: JSON.stringify({ source: _ctx.source, attributes: _ctx.attributes }),
293
- class: "vkf-gmew-drag-wrapper vkf-gmew-tools"
294
- }, {
295
- default: withCtx(() => [
296
- createVNode(_component_el_icon, null, {
297
- default: withCtx(() => [
298
- createVNode(_component_Sort)
299
- ]),
300
- _: 1
301
- }),
302
- _hoisted_1$2
303
- ]),
304
- _: 1
305
- }, 8, ["title", "data"])
306
- ]),
307
- _: 1
308
- }, 512), [
309
- [vShow, _ctx.active]
310
- ]),
311
- withDirectives(createElementVNode("div", _hoisted_2$1, [
312
- createVNode(_component_el_icon, {
313
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("del", { k: _ctx.attributes.k }))
314
- }, {
315
- default: withCtx(() => [
316
- createVNode(_component_Delete)
317
- ]),
318
- _: 1
319
- })
320
- ], 512), [
321
- [vShow, _ctx.active]
322
- ]),
323
- renderSlot(_ctx.$slots, "default")
324
- ]),
325
- _: 3
326
- });
327
- }
328
-
329
- script$3.render = render$3;
330
- script$3.__file = "ground/src/ground-main/src/editing-wrapper.vue";
331
-
332
- /** Detect free variable `global` from Node.js. */
333
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
334
-
335
- var freeGlobal$1 = freeGlobal;
336
-
337
- /** Detect free variable `self`. */
338
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
339
-
340
- /** Used as a reference to the global object. */
341
- var root = freeGlobal$1 || freeSelf || Function('return this')();
342
-
343
- var root$1 = root;
344
-
345
- /** Built-in value references. */
346
- var Symbol = root$1.Symbol;
347
-
348
- var Symbol$1 = Symbol;
349
-
350
- /** Used for built-in method references. */
351
- var objectProto$1 = Object.prototype;
352
-
353
- /** Used to check objects for own properties. */
354
- var hasOwnProperty = objectProto$1.hasOwnProperty;
355
-
356
- /**
357
- * Used to resolve the
358
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
359
- * of values.
360
- */
361
- var nativeObjectToString$1 = objectProto$1.toString;
362
-
363
- /** Built-in value references. */
364
- var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
365
-
366
- /**
367
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
368
- *
369
- * @private
370
- * @param {*} value The value to query.
371
- * @returns {string} Returns the raw `toStringTag`.
372
- */
373
- function getRawTag(value) {
374
- var isOwn = hasOwnProperty.call(value, symToStringTag$1),
375
- tag = value[symToStringTag$1];
376
-
377
- try {
378
- value[symToStringTag$1] = undefined;
379
- var unmasked = true;
380
- } catch (e) {}
381
-
382
- var result = nativeObjectToString$1.call(value);
383
- if (unmasked) {
384
- if (isOwn) {
385
- value[symToStringTag$1] = tag;
386
- } else {
387
- delete value[symToStringTag$1];
388
- }
389
- }
390
- return result;
391
- }
392
-
393
- /** Used for built-in method references. */
394
- var objectProto = Object.prototype;
395
-
396
- /**
397
- * Used to resolve the
398
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
399
- * of values.
400
- */
401
- var nativeObjectToString = objectProto.toString;
402
-
403
- /**
404
- * Converts `value` to a string using `Object.prototype.toString`.
405
- *
406
- * @private
407
- * @param {*} value The value to convert.
408
- * @returns {string} Returns the converted string.
409
- */
410
- function objectToString(value) {
411
- return nativeObjectToString.call(value);
412
- }
413
-
414
- /** `Object#toString` result references. */
415
- var nullTag = '[object Null]',
416
- undefinedTag = '[object Undefined]';
417
-
418
- /** Built-in value references. */
419
- var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
420
-
421
- /**
422
- * The base implementation of `getTag` without fallbacks for buggy environments.
423
- *
424
- * @private
425
- * @param {*} value The value to query.
426
- * @returns {string} Returns the `toStringTag`.
427
- */
428
- function baseGetTag(value) {
429
- if (value == null) {
430
- return value === undefined ? undefinedTag : nullTag;
431
- }
432
- return (symToStringTag && symToStringTag in Object(value))
433
- ? getRawTag(value)
434
- : objectToString(value);
435
- }
436
-
437
- /**
438
- * Checks if `value` is object-like. A value is object-like if it's not `null`
439
- * and has a `typeof` result of "object".
440
- *
441
- * @static
442
- * @memberOf _
443
- * @since 4.0.0
444
- * @category Lang
445
- * @param {*} value The value to check.
446
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
447
- * @example
448
- *
449
- * _.isObjectLike({});
450
- * // => true
451
- *
452
- * _.isObjectLike([1, 2, 3]);
453
- * // => true
454
- *
455
- * _.isObjectLike(_.noop);
456
- * // => false
457
- *
458
- * _.isObjectLike(null);
459
- * // => false
460
- */
461
- function isObjectLike(value) {
462
- return value != null && typeof value == 'object';
463
- }
464
-
465
- /** `Object#toString` result references. */
466
- var symbolTag = '[object Symbol]';
467
-
468
- /**
469
- * Checks if `value` is classified as a `Symbol` primitive or object.
470
- *
471
- * @static
472
- * @memberOf _
473
- * @since 4.0.0
474
- * @category Lang
475
- * @param {*} value The value to check.
476
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
477
- * @example
478
- *
479
- * _.isSymbol(Symbol.iterator);
480
- * // => true
481
- *
482
- * _.isSymbol('abc');
483
- * // => false
484
- */
485
- function isSymbol(value) {
486
- return typeof value == 'symbol' ||
487
- (isObjectLike(value) && baseGetTag(value) == symbolTag);
488
- }
489
-
490
- /**
491
- * A specialized version of `_.map` for arrays without support for iteratee
492
- * shorthands.
493
- *
494
- * @private
495
- * @param {Array} [array] The array to iterate over.
496
- * @param {Function} iteratee The function invoked per iteration.
497
- * @returns {Array} Returns the new mapped array.
498
- */
499
- function arrayMap(array, iteratee) {
500
- var index = -1,
501
- length = array == null ? 0 : array.length,
502
- result = Array(length);
503
-
504
- while (++index < length) {
505
- result[index] = iteratee(array[index], index, array);
506
- }
507
- return result;
508
- }
509
-
510
- /**
511
- * Checks if `value` is classified as an `Array` object.
512
- *
513
- * @static
514
- * @memberOf _
515
- * @since 0.1.0
516
- * @category Lang
517
- * @param {*} value The value to check.
518
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
519
- * @example
520
- *
521
- * _.isArray([1, 2, 3]);
522
- * // => true
523
- *
524
- * _.isArray(document.body.children);
525
- * // => false
526
- *
527
- * _.isArray('abc');
528
- * // => false
529
- *
530
- * _.isArray(_.noop);
531
- * // => false
532
- */
533
- var isArray = Array.isArray;
534
-
535
- var isArray$1 = isArray;
536
-
537
- /** Used as references for various `Number` constants. */
538
- var INFINITY = 1 / 0;
539
-
540
- /** Used to convert symbols to primitives and strings. */
541
- var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
542
- symbolToString = symbolProto ? symbolProto.toString : undefined;
543
-
544
- /**
545
- * The base implementation of `_.toString` which doesn't convert nullish
546
- * values to empty strings.
547
- *
548
- * @private
549
- * @param {*} value The value to process.
550
- * @returns {string} Returns the string.
551
- */
552
- function baseToString(value) {
553
- // Exit early for strings to avoid a performance hit in some environments.
554
- if (typeof value == 'string') {
555
- return value;
556
- }
557
- if (isArray$1(value)) {
558
- // Recursively convert values (susceptible to call stack limits).
559
- return arrayMap(value, baseToString) + '';
560
- }
561
- if (isSymbol(value)) {
562
- return symbolToString ? symbolToString.call(value) : '';
563
- }
564
- var result = (value + '');
565
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
566
- }
567
-
568
- /**
569
- * Converts `value` to a string. An empty string is returned for `null`
570
- * and `undefined` values. The sign of `-0` is preserved.
571
- *
572
- * @static
573
- * @memberOf _
574
- * @since 4.0.0
575
- * @category Lang
576
- * @param {*} value The value to convert.
577
- * @returns {string} Returns the converted string.
578
- * @example
579
- *
580
- * _.toString(null);
581
- * // => ''
582
- *
583
- * _.toString(-0);
584
- * // => '-0'
585
- *
586
- * _.toString([1, 2, 3]);
587
- * // => '1,2,3'
588
- */
589
- function toString(value) {
590
- return value == null ? '' : baseToString(value);
591
- }
592
-
593
- /** Used to generate unique IDs. */
594
- var idCounter = 0;
595
-
596
- /**
597
- * Generates a unique ID. If `prefix` is given, the ID is appended to it.
598
- *
599
- * @static
600
- * @since 0.1.0
601
- * @memberOf _
602
- * @category Util
603
- * @param {string} [prefix=''] The value to prefix the ID with.
604
- * @returns {string} Returns the unique ID.
605
- * @example
606
- *
607
- * _.uniqueId('contact_');
608
- * // => 'contact_104'
609
- *
610
- * _.uniqueId();
611
- * // => '105'
612
- */
613
- function uniqueId(prefix) {
614
- var id = ++idCounter;
615
- return toString(prefix) + id;
616
- }
617
-
618
- const createDefaultSlots = (e) => _VkfFormUtils._VkfFormItemRendererUtils.createDefaultSlots(e);
619
- const addDefaultProp = (source) => {
620
- if ("prop" in source) {
621
- source.prop ||= uniqueId("from_widget_");
622
- }
623
- };
624
- var script$2 = defineComponent({
625
- components: {
626
- VkfDropWrapper,
627
- VkfForm,
628
- VkfFormItemRendererTemplate,
629
- VkTabGroup,
630
- VkTabItem,
631
- EditingWrapper: script$3
632
- },
633
- props: {
634
- formItems: {
635
- type: Array,
636
- default: () => []
637
- },
638
- data: Object,
639
- currentK: {
640
- type: String,
641
- default: ""
642
- }
643
- },
644
- emits: {
645
- "update:currentK": (e) => e,
646
- "setData": (e) => e,
647
- "setData:formItems": null,
648
- "unsetData:formItems": null
649
- },
650
- setup(props, { emit }) {
651
- const groundEndClassName = ref(DragoverClasses.normal);
652
- const formItemsWithWrapper = computed(() => {
653
- const data = [];
654
- props.formItems.forEach((item, index) => {
655
- const name = item.prop || "";
656
- data.push({
657
- templateType: "VkfEditingSelect",
658
- name,
659
- index,
660
- templateSlots: createDefaultSlots(item)
661
- });
662
- });
663
- return data;
664
- });
665
- const endLineNode = ref();
666
- const isUnderEnd = (e) => !!endLineNode.value && e.pageY >= endLineNode.value.getBoundingClientRect().top;
667
- function dragover(e) {
668
- if (!isUnderEnd(e))
669
- return;
670
- groundEndClassName.value = DragoverClasses["is-dragover-prev"];
671
- }
672
- function dragleave() {
673
- groundEndClassName.value = DragoverClasses.normal;
674
- }
675
- function drop(e) {
676
- e.preventDefault();
677
- if (!isUnderEnd(e))
678
- return;
679
- if (!e.dataTransfer)
680
- return;
681
- groundEndClassName.value = DragoverClasses.normal;
682
- const data = JSON.parse(e.dataTransfer.getData("text"));
683
- const source = data?.source;
684
- if (!source)
685
- return;
686
- addDefaultProp(source);
687
- if (source.templateType === "VkfEditingSelect") {
688
- const currentLength = props.formItems.length;
689
- const formItemSource = source.templateSlots.default[0];
690
- if (formItemSource) {
691
- emit("setData:formItems", {
692
- k: currentLength,
693
- v: formItemSource
694
- });
695
- }
696
- emit("unsetData:formItems", {
697
- k: source.index
698
- });
699
- emit("update:currentK", currentLength - 1 + "");
700
- } else {
701
- const currentK = props.formItems.length;
702
- emit("setData:formItems", {
703
- k: currentK,
704
- v: source
705
- });
706
- emit("update:currentK", currentK + "");
707
- }
708
- }
709
- function editDrop(e, overClass, toData) {
710
- e.stopPropagation();
711
- e.preventDefault();
712
- if (!e.dataTransfer)
713
- return;
714
- const fromData = JSON.parse(e.dataTransfer.getData("text"));
715
- const fromSource = fromData?.source;
716
- if (!fromSource)
717
- return;
718
- const fromK = fromData.attributes?.k ?? [];
719
- let toK = toData.attributes.k;
720
- let tkl = toK.at(-1);
721
- if (typeof tkl === "number" && overClass === DragoverClasses["is-dragover-next"]) {
722
- tkl++;
723
- }
724
- let itemSource = fromSource;
725
- if (fromSource.templateType === "VkfEditingSelect") {
726
- itemSource = fromSource.templateSlots.default[0];
727
- }
728
- if (!fromK.length) {
729
- addDefaultProp(itemSource);
730
- const k = toK.map((v, index) => index === toK.length - 1 ? tkl : v);
731
- emit("setData:formItems", {
732
- k,
733
- v: itemSource,
734
- insert: true
735
- });
736
- emit("update:currentK", k.join());
737
- return;
738
- }
739
- if (fromK.length === toK.length) {
740
- const fkl = fromK.at(-1);
741
- if (typeof fkl === "number" && typeof tkl === "number") {
742
- if (overClass === DragoverClasses["is-dragover-prev"]) {
743
- if (fkl + 1 === tkl)
744
- return;
745
- }
746
- if (overClass === DragoverClasses["is-dragover-prev"]) {
747
- if (tkl === fkl)
748
- return;
749
- }
750
- emit("unsetData:formItems", {
751
- k: fkl
752
- });
753
- if (fkl < tkl) {
754
- tkl--;
755
- }
756
- emit("setData:formItems", {
757
- k: tkl,
758
- v: itemSource,
759
- insert: true
760
- });
761
- emit("update:currentK", tkl + "");
762
- }
763
- }
764
- }
765
- return {
766
- groundEndClassName,
767
- endLineNode,
768
- dragover,
769
- dragleave,
770
- drop,
771
- setData,
772
- editDrop,
773
- formItemsWithWrapper
774
- };
775
- }
776
- });
777
-
778
- const _hoisted_1$1 = /* @__PURE__ */ createElementVNode("div", { class: "vkf-ground-start" }, null, -1);
779
- function render$2(_ctx, _cache, $props, $setup, $data, $options) {
780
- const _component_EditingWrapper = resolveComponent("EditingWrapper");
781
- const _component_VkTabItem = resolveComponent("VkTabItem");
782
- const _component_VkfFormItemRendererTemplate = resolveComponent("VkfFormItemRendererTemplate");
783
- const _component_VkfForm = resolveComponent("VkfForm");
784
- const _component_VkTabGroup = resolveComponent("VkTabGroup");
785
- const _component_VkfDropWrapper = resolveComponent("VkfDropWrapper");
786
- return openBlock(), createBlock(_component_VkfDropWrapper, {
787
- class: "vkf-ground-main",
788
- onDrop: _ctx.drop,
789
- onDragover: _ctx.dragover,
790
- onDragleave: _ctx.dragleave
791
- }, {
792
- default: withCtx(() => [
793
- _hoisted_1$1,
794
- createCommentVNode(" {{ formItems. }} "),
795
- createCommentVNode(" \u5C06formItems\u6E32\u67D3 \u4E3A\u7F16\u8F91\u65F6\u7EC4\u4EF6 "),
796
- createVNode(_component_VkTabGroup, {
797
- modelValue: _ctx.currentK,
798
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:currentK", $event))
799
- }, {
800
- default: withCtx(() => [
801
- createVNode(_component_VkfForm, {
802
- formItems: _ctx.formItemsWithWrapper,
803
- data: _ctx.data,
804
- onSetData: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("setData", $event))
805
- }, {
806
- rendererTemplate: withCtx(() => [
807
- createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfEditingSelect" }, {
808
- default: withCtx(({ Renderer, raw, k }) => [
809
- createCommentVNode(" name is prop "),
810
- createVNode(_component_VkTabItem, {
811
- name: k.join(),
812
- title: k.join(),
813
- clearable: false,
814
- class: "vkf-gm-form-item-x"
815
- }, {
816
- default: withCtx(({ isActive }) => [
817
- createCommentVNode(" \u62D6\u52A8\u65F6 \u6839\u636E source \u548C attributes\u786E\u5B9A\u4F4D\u7F6E "),
818
- 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 "),
819
- createVNode(_component_EditingWrapper, {
820
- onDrop: _ctx.editDrop,
821
- attributes: { k },
822
- active: isActive,
823
- source: raw,
824
- onDel: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("unsetData:formItems", $event))
825
- }, {
826
- default: withCtx(() => [
827
- (openBlock(), createBlock(resolveDynamicComponent(Renderer), {
828
- source: raw.templateSlots.default
829
- }, null, 8, ["source"]))
830
- ]),
831
- _: 2
832
- }, 1032, ["onDrop", "attributes", "active", "source"])
833
- ]),
834
- _: 2
835
- }, 1032, ["name", "title"])
836
- ]),
837
- _: 1
838
- }),
839
- renderSlot(_ctx.$slots, "rendererTemplate")
840
- ]),
841
- _: 3
842
- }, 8, ["formItems", "data"])
843
- ]),
844
- _: 3
845
- }, 8, ["modelValue"]),
846
- createElementVNode("div", {
847
- class: normalizeClass(["vkf-ground-end", _ctx.groundEndClassName]),
848
- ref: "endLineNode"
849
- }, null, 2)
850
- ]),
851
- _: 3
852
- }, 8, ["onDrop", "onDragover", "onDragleave"]);
853
- }
854
-
855
- script$2.render = render$2;
856
- script$2.__file = "ground/src/ground-main/src/index.vue";
857
-
858
- var script$1 = defineComponent({
859
- components: {
860
- VkfConfigRenderer,
861
- VkfConfigRendererTemplate,
862
- VkfInputConfig
863
- },
864
- props: {
865
- data: {
866
- type: Object,
867
- default: () => ({})
868
- },
869
- propFieldSource: {
870
- type: Object,
871
- default: () => ({})
872
- }
873
- },
874
- emits: {
875
- setData: (e) => e
876
- },
877
- setup() {
878
- return {};
879
- }
880
- });
881
-
882
- function render$1(_ctx, _cache, $props, $setup, $data, $options) {
883
- const _component_VkfInputConfig = resolveComponent("VkfInputConfig");
884
- const _component_VkfConfigRendererTemplate = resolveComponent("VkfConfigRendererTemplate");
885
- const _component_VkfConfigRenderer = resolveComponent("VkfConfigRenderer");
886
- return openBlock(), createBlock(_component_VkfConfigRenderer, { source: _ctx.data }, {
887
- default: withCtx(() => [
888
- createCommentVNode(' data-example: { "templateType": "VkfInput", \r\n "prop": "from_widget_2", "label": "inputLabel" } '),
889
- createVNode(_component_VkfConfigRendererTemplate, { type: "VkfInput" }, {
890
- default: withCtx(({ data: props }) => [
891
- createVNode(_component_VkfInputConfig, mergeProps(props, {
892
- data: _ctx.data,
893
- onSetData: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("setData", $event)),
894
- propFieldSource: _ctx.propFieldSource
895
- }), null, 16, ["data", "propFieldSource"])
896
- ]),
897
- _: 1
898
- }),
899
- renderSlot(_ctx.$slots, "configRendererTemplate")
900
- ]),
901
- _: 3
902
- }, 8, ["source"]);
903
- }
904
-
905
- script$1.render = render$1;
906
- script$1.__file = "ground/src/ground-config/src/index.vue";
907
-
908
- function tryOnScopeDispose(fn) {
909
- if (getCurrentScope()) {
910
- onScopeDispose(fn);
911
- return true;
912
- }
913
- return false;
914
- }
915
-
916
- const isClient = typeof window !== "undefined";
917
- const isString = (val) => typeof val === "string";
918
- const noop = () => {
919
- };
920
-
921
- function useTimeoutFn(cb, interval, options = {}) {
922
- const {
923
- immediate = true
924
- } = options;
925
- const isPending = ref(false);
926
- let timer = null;
927
- function clear() {
928
- if (timer) {
929
- clearTimeout(timer);
930
- timer = null;
931
- }
932
- }
933
- function stop() {
934
- isPending.value = false;
935
- clear();
936
- }
937
- function start(...args) {
938
- clear();
939
- isPending.value = true;
940
- timer = setTimeout(() => {
941
- isPending.value = false;
942
- timer = null;
943
- cb(...args);
944
- }, unref(interval));
945
- }
946
- if (immediate) {
947
- isPending.value = true;
948
- if (isClient)
949
- start();
950
- }
951
- tryOnScopeDispose(stop);
952
- return {
953
- isPending,
954
- start,
955
- stop
956
- };
957
- }
958
-
959
- function unrefElement(elRef) {
960
- var _a;
961
- const plain = unref(elRef);
962
- return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
963
- }
964
-
965
- const defaultWindow = isClient ? window : void 0;
966
- isClient ? window.document : void 0;
967
- const defaultNavigator = isClient ? window.navigator : void 0;
968
- isClient ? window.location : void 0;
969
-
970
- function useEventListener(...args) {
971
- let target;
972
- let event;
973
- let listener;
974
- let options;
975
- if (isString(args[0])) {
976
- [event, listener, options] = args;
977
- target = defaultWindow;
978
- } else {
979
- [target, event, listener, options] = args;
980
- }
981
- if (!target)
982
- return noop;
983
- let cleanup = noop;
984
- const stopWatch = watch(() => unrefElement(target), (el) => {
985
- cleanup();
986
- if (!el)
987
- return;
988
- el.addEventListener(event, listener, options);
989
- cleanup = () => {
990
- el.removeEventListener(event, listener, options);
991
- cleanup = noop;
992
- };
993
- }, { immediate: true, flush: "post" });
994
- const stop = () => {
995
- stopWatch();
996
- cleanup();
997
- };
998
- tryOnScopeDispose(stop);
999
- return stop;
1000
- }
1001
-
1002
- function useClipboard(options = {}) {
1003
- const {
1004
- navigator = defaultNavigator,
1005
- read = false,
1006
- source,
1007
- copiedDuring = 1500
1008
- } = options;
1009
- const events = ["copy", "cut"];
1010
- const isSupported = Boolean(navigator && "clipboard" in navigator);
1011
- const text = ref("");
1012
- const copied = ref(false);
1013
- const timeout = useTimeoutFn(() => copied.value = false, copiedDuring);
1014
- function updateText() {
1015
- navigator.clipboard.readText().then((value) => {
1016
- text.value = value;
1017
- });
1018
- }
1019
- if (isSupported && read) {
1020
- for (const event of events)
1021
- useEventListener(event, updateText);
1022
- }
1023
- async function copy(value = unref(source)) {
1024
- if (isSupported && value != null) {
1025
- await navigator.clipboard.writeText(value);
1026
- text.value = value;
1027
- copied.value = true;
1028
- timeout.start();
1029
- }
1030
- }
1031
- return {
1032
- isSupported,
1033
- text,
1034
- copied,
1035
- copy
1036
- };
1037
- }
1038
-
1039
- const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
1040
- const globalKey = "__vueuse_ssr_handlers__";
1041
- _global[globalKey] = _global[globalKey] || {};
1042
- _global[globalKey];
1043
-
1044
- var _a, _b;
1045
- 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);
1046
-
1047
- var script = defineComponent({
1048
- name: "VkfGround",
1049
- components: {
1050
- VkfGroundWidget: script$4,
1051
- VkfGroundMain: script$2,
1052
- VkfGroundConfig: script$1,
1053
- VkCard,
1054
- ElButton
1055
- },
1056
- props: {
1057
- componentLibCollapseExpanded: {
1058
- type: Array,
1059
- default: void 0
1060
- },
1061
- source: {
1062
- type: Array,
1063
- default: () => []
1064
- },
1065
- data: {
1066
- type: Object,
1067
- default: () => ({})
1068
- },
1069
- modelValue: {
1070
- type: Array,
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
- "update:modelValue": (e) => Array.isArray(e)
1081
- },
1082
- setup(props, { emit }) {
1083
- const propToFormItem = computed(() => {
1084
- return props.source.reduce((a, c) => {
1085
- if (c.prop) {
1086
- a[c.prop] = c;
1087
- }
1088
- return a;
1089
- }, {});
1090
- });
1091
- const kToSourceItem = computed(() => {
1092
- const data = {};
1093
- function intoData(list, k = []) {
1094
- list.forEach((item, index) => {
1095
- const currentK = [...k, index];
1096
- data[currentK.join()] = item;
1097
- if (item.templateSlots) {
1098
- if (Array.isArray(item.templateSlots.default)) {
1099
- intoData(item.templateSlots.default, currentK);
1100
- }
1101
- }
1102
- });
1103
- }
1104
- intoData(props.source);
1105
- return data;
1106
- });
1107
- const _modelValue = ref("");
1108
- const editK = computed({
1109
- get() {
1110
- return props.modelValue?.join() ?? _modelValue.value;
1111
- },
1112
- set(v) {
1113
- _modelValue.value = v;
1114
- emit("update:modelValue", v ? v.split(",") : []);
1115
- }
1116
- });
1117
- const editKArr = computed(() => editK.value ? editK.value.split(",") : []);
1118
- const propValidateUpdate = (ev) => {
1119
- if (ev in propToFormItem.value) {
1120
- ElMessage({
1121
- type: "warning",
1122
- message: "\u5B58\u5728\u76F8\u540C\u7684prop, \u8BF7\u91CD\u65B0\u4FEE\u6539"
1123
- });
1124
- } else if (!ev) {
1125
- ElMessage({
1126
- type: "warning",
1127
- message: "prop\u4E0D\u80FD\u4E3A\u7A7A"
1128
- });
1129
- } else {
1130
- return true;
1131
- }
1132
- };
1133
- const formItemStr = computed(() => JSON.stringify(props.source));
1134
- const formItemClip = useClipboard({
1135
- source: formItemStr
1136
- });
1137
- const inputJson = () => {
1138
- ElMessageBox.prompt("\u8F93\u5165Json", "\u63D0\u793A", {
1139
- confirmButtonText: "\u786E\u8BA4",
1140
- cancelButtonText: "\u53D6\u6D88"
1141
- }).then(({ value }) => {
1142
- let obj = [];
1143
- try {
1144
- obj = JSON.parse(value);
1145
- } catch (err) {
1146
- ElMessage({
1147
- type: "error",
1148
- message: "Json\u89E3\u6790\u9519\u8BEF"
1149
- });
1150
- throw err;
1151
- }
1152
- return obj;
1153
- }).then((obj) => {
1154
- emit("update:source", obj);
1155
- });
1156
- };
1157
- return {
1158
- propToFormItem,
1159
- setData,
1160
- unsetData,
1161
- propValidateUpdate,
1162
- kToSourceItem,
1163
- editK,
1164
- editKArr,
1165
- formItemClip,
1166
- inputJson
1167
- };
1168
- }
1169
- });
1170
-
1171
- const _hoisted_1 = { class: "vkf-ground" };
1172
- const _hoisted_2 = { class: "vkf-ground-main-x" };
1173
- const _hoisted_3 = { key: 0 };
1174
- const _hoisted_4 = { key: 1 };
1175
- const _hoisted_5 = /* @__PURE__ */ createTextVNode(" \u5BFC\u5165Json ");
1176
- const _hoisted_6 = { class: "vkf-ground-config-x" };
1177
- function render(_ctx, _cache, $props, $setup, $data, $options) {
1178
- const _component_VkfGroundWidget = resolveComponent("VkfGroundWidget");
1179
- const _component_ElButton = resolveComponent("ElButton");
1180
- const _component_VkfGroundMain = resolveComponent("VkfGroundMain");
1181
- const _component_VkCard = resolveComponent("VkCard");
1182
- const _component_VkfGroundConfig = resolveComponent("VkfGroundConfig");
1183
- return openBlock(), createElementBlock("div", _hoisted_1, [
1184
- createVNode(_component_VkfGroundWidget, {
1185
- class: "vkf-ground-widget-x",
1186
- componentLibCollapseExpanded: _ctx.componentLibCollapseExpanded,
1187
- "onUpdate:componentLibCollapseExpanded": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:componentLibCollapseExpanded", $event))
1188
- }, {
1189
- componentLibCollapse: withCtx(() => [
1190
- renderSlot(_ctx.$slots, "widgetComponentLibCollapse")
1191
- ]),
1192
- _: 3
1193
- }, 8, ["componentLibCollapseExpanded"]),
1194
- createElementVNode("div", _hoisted_2, [
1195
- createVNode(_component_VkCard, {
1196
- tag: "div",
1197
- class: "vkf-ground-main-card"
1198
- }, {
1199
- title: withCtx(() => [
1200
- createVNode(_component_ElButton, {
1201
- onClick: _cache[1] || (_cache[1] = () => _ctx.formItemClip.copy())
1202
- }, {
1203
- default: withCtx(() => [
1204
- !_ctx.formItemClip.copied.value ? (openBlock(), createElementBlock("span", _hoisted_3, "\u590D\u5236Json")) : (openBlock(), createElementBlock("span", _hoisted_4, "\u5DF2\u590D\u5236!"))
1205
- ]),
1206
- _: 1
1207
- }),
1208
- createVNode(_component_ElButton, { onClick: _ctx.inputJson }, {
1209
- default: withCtx(() => [
1210
- _hoisted_5
1211
- ]),
1212
- _: 1
1213
- }, 8, ["onClick"])
1214
- ]),
1215
- default: withCtx(() => [
1216
- createVNode(_component_VkfGroundMain, {
1217
- data: _ctx.data,
1218
- onSetData: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("setData", $event)),
1219
- currentK: _ctx.editK,
1220
- "onUpdate:currentK": _cache[3] || (_cache[3] = ($event) => _ctx.editK = $event),
1221
- formItems: _ctx.source,
1222
- "onSetData:formItems": _cache[4] || (_cache[4] = ($event) => _ctx.$emit("setData:source", $event)),
1223
- "onUnsetData:formItems": _cache[5] || (_cache[5] = ($event) => _ctx.$emit("unsetData:source", $event))
1224
- }, {
1225
- rendererTemplate: withCtx(() => [
1226
- renderSlot(_ctx.$slots, "rendererTemplate")
1227
- ]),
1228
- _: 3
1229
- }, 8, ["data", "currentK", "formItems"])
1230
- ]),
1231
- _: 3
1232
- })
1233
- ]),
1234
- createElementVNode("div", _hoisted_6, [
1235
- createCommentVNode(" \u901A\u8FC7config \u4FEE\u6539\u6570\u636E\u6E90 \u5355\u9879\u7684\u5185\u5BB9 "),
1236
- createCommentVNode(" {{ editK }} {{ kToSourceItem[editK] }} "),
1237
- createCommentVNode(" {{ kToSourceItem[editK] }} "),
1238
- createCommentVNode(' :k="editKArr" '),
1239
- createVNode(_component_VkfGroundConfig, {
1240
- data: _ctx.kToSourceItem[_ctx.editK],
1241
- onSetData: _cache[6] || (_cache[6] = ($event) => _ctx.$emit("setData:source", {
1242
- k: [..._ctx.editKArr, $event.k],
1243
- v: $event.v
1244
- })),
1245
- propFieldSource: {
1246
- validateUpdate: _ctx.propValidateUpdate
1247
- }
1248
- }, {
1249
- configRendererTemplate: withCtx(() => [
1250
- renderSlot(_ctx.$slots, "configRendererTemplate", { propValidateUpdate: _ctx.propValidateUpdate })
1251
- ]),
1252
- _: 3
1253
- }, 8, ["data", "propFieldSource"])
1254
- ])
1255
- ]);
1256
- }
1257
-
1258
- script.render = render;
1259
- script.__file = "ground/src/index.vue";
1260
-
1261
- var types = /*#__PURE__*/Object.freeze({
1262
- __proto__: null
1263
- });
1264
-
1265
- script.install = (app) => {
1266
- app.component(script.name, script);
1267
- };
1268
-
1269
- export { script as VkfGround, types as __VkfGround, script as default };