@vunk/form 1.1.77 → 1.1.80

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 (297) hide show
  1. package/components/_plugin-vue_export-helper.mjs +9 -0
  2. package/components/button/{index.js → index.mjs} +33 -29
  3. package/components/button/src/ctx.d.ts +30 -30
  4. package/components/button/src/index.vue.d.ts +69 -69
  5. package/components/cascader/index.css +0 -2
  6. package/components/cascader/{index.js → index.mjs} +22 -22
  7. package/components/cascader/src/ctx.d.ts +37 -45
  8. package/components/cascader/src/index.vue.d.ts +92 -92
  9. package/components/cascader/src/use.d.ts +1 -1
  10. package/components/checkbox/index.css +0 -9
  11. package/components/checkbox/{index.js → index.mjs} +45 -42
  12. package/components/checkbox/src/ctx.d.ts +29 -32
  13. package/components/checkbox/src/index.vue.d.ts +65 -65
  14. package/components/color-picker/{index.js → index.mjs} +23 -22
  15. package/components/color-picker/src/ctx.d.ts +29 -29
  16. package/components/color-picker/src/index.vue.d.ts +67 -67
  17. package/components/date-picker/index.d.ts +1 -0
  18. package/components/date-picker/{index.js → index.mjs} +46 -26
  19. package/components/date-picker/src/ctx.d.ts +51 -49
  20. package/components/date-picker/src/index.vue.d.ts +104 -104
  21. package/components/date-picker-range/index.css +18 -0
  22. package/components/date-picker-range/index.d.ts +4 -0
  23. package/components/date-picker-range/index.mjs +164 -0
  24. package/components/date-picker-range/src/ctx.d.ts +177 -0
  25. package/components/date-picker-range/src/index.vue.d.ts +398 -0
  26. package/components/date-picker-range/src/types.d.ts +12 -0
  27. package/components/download-plus/index.css +0 -6
  28. package/components/download-plus/{index.js → index.mjs} +119 -147
  29. package/components/download-plus/src/api.d.ts +1 -1
  30. package/components/download-plus/src/ctx.d.ts +27 -26
  31. package/components/download-plus/src/index.vue.d.ts +59 -59
  32. package/components/esri-input-geojson/index.css +0 -10
  33. package/components/esri-input-geojson/index.mjs +1109 -0
  34. package/components/esri-input-geojson/src/append.vue.d.ts +1 -1
  35. package/components/esri-input-geojson/src/ctx.d.ts +49 -72
  36. package/components/esri-input-geojson/src/index.vue.d.ts +138 -158
  37. package/components/esri-input-geojson/src/types.d.ts +0 -1
  38. package/components/esri-input-geojson/src/viewer.vue.d.ts +18 -19
  39. package/components/form/{index.js → index.mjs} +38 -36
  40. package/components/form/src/ctx.d.ts +13 -297
  41. package/components/form/src/index.vue.d.ts +97 -659
  42. package/components/form-item/index.css +0 -8
  43. package/components/form-item/{index.js → index.mjs} +22 -19
  44. package/components/form-item/src/ctx.d.ts +13 -11
  45. package/components/form-item/src/index.vue.d.ts +20 -20
  46. package/components/form-item-renderer/{index.js → index.mjs} +9 -7
  47. package/components/form-item-renderer/src/index.vue.d.ts +1 -1
  48. package/components/form-item-renderer-template/{index.js → index.mjs} +7 -7
  49. package/components/geoinput/{index.js → index.mjs} +10 -17
  50. package/components/geoinput/src/ctx.d.ts +48 -60
  51. package/components/geoinput/src/index.vue.d.ts +114 -132
  52. package/components/geoinput-read/index.css +0 -2
  53. package/components/geoinput-read/{index.js → index.mjs} +101 -109
  54. package/components/geoinput-read/src/core.vue.d.ts +123 -142
  55. package/components/geoinput-read/src/ctx.d.ts +50 -74
  56. package/components/geoinput-read/src/index.vue.d.ts +102 -120
  57. package/components/geoinput-update/index.css +0 -6
  58. package/components/geoinput-update/index.mjs +399 -0
  59. package/components/geoinput-update/src/ctx.d.ts +49 -69
  60. package/components/geoinput-update/src/index.vue.d.ts +126 -141
  61. package/components/index.mjs +11 -0
  62. package/components/index2.mjs +306 -0
  63. package/components/index3.mjs +484 -0
  64. package/components/input/{index.js → index.mjs} +31 -27
  65. package/components/input/src/ctx.d.ts +47 -66
  66. package/components/input/src/index.vue.d.ts +101 -113
  67. package/components/input-link/index.css +0 -2
  68. package/components/input-link/index.mjs +151 -0
  69. package/components/input-link/src/ctx.d.ts +40 -56
  70. package/components/input-link/src/index.vue.d.ts +89 -101
  71. package/components/input-number/index.css +0 -2
  72. package/components/input-number/{index.js → index.mjs} +25 -25
  73. package/components/input-number/src/ctx.d.ts +31 -37
  74. package/components/input-number/src/index.vue.d.ts +71 -71
  75. package/components/radio/index.css +0 -6
  76. package/components/radio/{index.js → index.mjs} +50 -47
  77. package/components/radio/src/ctx.d.ts +29 -29
  78. package/components/radio/src/index.vue.d.ts +64 -64
  79. package/components/select/index.css +0 -2
  80. package/components/select/{index.js → index.mjs} +49 -48
  81. package/components/select/src/ctx.d.ts +31 -85
  82. package/components/select/src/index.vue.d.ts +121 -230
  83. package/components/slider/{index.js → index.mjs} +28 -24
  84. package/components/slider/src/ctx.d.ts +35 -35
  85. package/components/slider/src/index.vue.d.ts +93 -93
  86. package/components/switch/index.css +0 -2
  87. package/components/switch/{index.js → index.mjs} +29 -24
  88. package/components/switch/src/ctx.d.ts +40 -40
  89. package/components/switch/src/index.vue.d.ts +91 -91
  90. package/components/templates-default/index.mjs +302 -0
  91. package/components/templates-default/src/ctx.d.ts +2 -4
  92. package/components/templates-default/src/index.vue.d.ts +2 -8
  93. package/components/templates-element-plus/index.mjs +106 -0
  94. package/components/templates-esri/index.mjs +59 -0
  95. package/components/templates-layout/index.css +0 -3
  96. package/components/templates-layout/index.mjs +131 -0
  97. package/components/templates-mapbox/index.mjs +59 -0
  98. package/components/templates-variant/index.d.ts +4 -0
  99. package/components/templates-variant/index.mjs +64 -0
  100. package/components/templates-variant/src/ctx.d.ts +11 -0
  101. package/components/templates-variant/src/index.vue.d.ts +20 -0
  102. package/components/templates-variant/src/types.d.ts +2 -0
  103. package/components/upload/index.css +0 -7
  104. package/components/upload/index.mjs +501 -0
  105. package/components/upload/src/ctx.d.ts +36 -38
  106. package/components/upload/src/file.vue.d.ts +22 -21
  107. package/components/upload/src/index.vue.d.ts +78 -78
  108. package/components/upload-plus/index.css +4 -8
  109. package/components/upload-plus/{index.js → index.mjs} +9497 -926
  110. package/components/upload-plus/src/api.d.ts +1 -1
  111. package/components/upload-plus/src/ctx.d.ts +25 -28
  112. package/components/upload-plus/src/index.vue.d.ts +58 -58
  113. package/components/van-cascader/index.css +0 -2
  114. package/components/van-cascader/{index.js → index.mjs} +41 -44
  115. package/components/van-cascader/src/ctx.d.ts +35 -35
  116. package/components/van-cascader/src/index.vue.d.ts +82 -82
  117. package/components/var-datetime-picker/index.css +0 -2
  118. package/components/var-datetime-picker/index.mjs +324 -0
  119. package/components/var-datetime-picker/src/ctx.d.ts +27 -26
  120. package/components/var-datetime-picker/src/index.vue.d.ts +57 -57
  121. package/components/vditor/{index.js → index.mjs} +9 -14
  122. package/components/vditor/src/ctx.d.ts +2 -1
  123. package/components/vditor/src/index.vue.d.ts +2 -3
  124. package/composables/index.mjs +85 -0
  125. package/composables/useSourceManager.d.ts +2 -2
  126. package/defaults.d.ts +1 -1
  127. package/index.css +22 -168
  128. package/index.d.ts +1 -1
  129. package/index.esm.js +44 -1
  130. package/package.json +257 -2
  131. package/shared/const/index.d.ts +1 -1
  132. package/shared/const/index.mjs +56 -0
  133. package/shared/element-plus/ctx.d.ts +26 -94
  134. package/shared/element-plus/index.mjs +285 -0
  135. package/shared/element-plus/instances.d.ts +29 -28
  136. package/shared/form/index.mjs +30 -0
  137. package/shared/helper/index.mjs +9 -0
  138. package/shared/index.mjs +1 -0
  139. package/shared/infer-prop/index.mjs +34 -0
  140. package/shared/progress-it/index.mjs +38 -0
  141. package/shared/rules/index.mjs +53 -0
  142. package/shared/types/source/index.d.ts +2 -1
  143. package/shared/upload/index.mjs +771 -0
  144. package/components/button/src/ctx.js +0 -1
  145. package/components/cascader/src/ctx.js +0 -1
  146. package/components/cascader/src/types.js +0 -1
  147. package/components/cascader/src/use.js +0 -1
  148. package/components/checkbox/src/ctx.js +0 -1
  149. package/components/checkbox/src/index.css +0 -1
  150. package/components/checkbox/src/types.js +0 -1
  151. package/components/color-picker/index.css +0 -1
  152. package/components/color-picker/src/ctx.js +0 -1
  153. package/components/color-picker/src/index.css +0 -1
  154. package/components/color-picker/src/types.js +0 -1
  155. package/components/date-picker/index.css +0 -1
  156. package/components/date-picker/src/ctx.js +0 -1
  157. package/components/date-picker/src/index.css +0 -1
  158. package/components/date-picker/src/types.js +0 -1
  159. package/components/download-plus/src/api.js +0 -1
  160. package/components/download-plus/src/const.js +0 -1
  161. package/components/download-plus/src/ctx.js +0 -1
  162. package/components/download-plus/src/index.css +0 -1
  163. package/components/download-plus/src/types.js +0 -1
  164. package/components/esri-input-geojson/index.js +0 -1563
  165. package/components/esri-input-geojson/src/const.js +0 -1
  166. package/components/esri-input-geojson/src/ctx.js +0 -1
  167. package/components/esri-input-geojson/src/index.css +0 -1
  168. package/components/esri-input-geojson/src/types.js +0 -1
  169. package/components/form/index.css +0 -1
  170. package/components/form/src/ctx.js +0 -1
  171. package/components/form/src/index.css +0 -1
  172. package/components/form/src/types.js +0 -1
  173. package/components/form/src/utils.js +0 -1
  174. package/components/form-item/src/ctx.js +0 -1
  175. package/components/form-item/src/index.css +0 -1
  176. package/components/form-item/src/types.js +0 -1
  177. package/components/form-item-renderer/index.css +0 -1
  178. package/components/form-item-renderer/src/ctx.js +0 -1
  179. package/components/form-item-renderer/src/index.css +0 -1
  180. package/components/form-item-renderer/src/symbols.js +0 -1
  181. package/components/form-item-renderer/src/types.js +0 -1
  182. package/components/form-item-renderer-template/index.css +0 -1
  183. package/components/form-item-renderer-template/src/ctx.js +0 -1
  184. package/components/form-item-renderer-template/src/index.css +0 -1
  185. package/components/form-item-renderer-template/src/types.js +0 -1
  186. package/components/geoinput/index.css +0 -1
  187. package/components/geoinput/src/ctx.js +0 -1
  188. package/components/geoinput/src/index.css +0 -1
  189. package/components/geoinput/src/types.js +0 -1
  190. package/components/geoinput-read/src/ctx.js +0 -1
  191. package/components/geoinput-read/src/index.css +0 -1
  192. package/components/geoinput-read/src/types.js +0 -1
  193. package/components/geoinput-update/index.js +0 -930
  194. package/components/geoinput-update/src/ctx.js +0 -1
  195. package/components/geoinput-update/src/index.css +0 -1
  196. package/components/geoinput-update/src/types.js +0 -1
  197. package/components/input/index.css +0 -1
  198. package/components/input/src/ctx.js +0 -1
  199. package/components/input/src/index.css +0 -1
  200. package/components/input/src/types.js +0 -1
  201. package/components/input-link/index.js +0 -163
  202. package/components/input-link/src/ctx.js +0 -1
  203. package/components/input-link/src/index.css +0 -1
  204. package/components/input-link/src/types.js +0 -1
  205. package/components/input-number/src/ctx.js +0 -1
  206. package/components/input-number/src/index.css +0 -1
  207. package/components/input-number/src/types.js +0 -1
  208. package/components/radio/src/ctx.js +0 -1
  209. package/components/radio/src/index.css +0 -1
  210. package/components/radio/src/types.js +0 -1
  211. package/components/select/src/ctx.js +0 -1
  212. package/components/select/src/index.css +0 -1
  213. package/components/select/src/types.js +0 -1
  214. package/components/slider/index.css +0 -1
  215. package/components/slider/src/ctx.js +0 -1
  216. package/components/slider/src/index.css +0 -1
  217. package/components/slider/src/types.js +0 -1
  218. package/components/switch/src/ctx.js +0 -1
  219. package/components/switch/src/index.css +0 -1
  220. package/components/switch/src/types.js +0 -1
  221. package/components/templates-default/index.css +0 -1
  222. package/components/templates-default/index.js +0 -347
  223. package/components/templates-default/src/ctx.js +0 -1
  224. package/components/templates-default/src/index.css +0 -1
  225. package/components/templates-default/src/types.js +0 -1
  226. package/components/templates-element-plus/index.css +0 -1
  227. package/components/templates-element-plus/index.js +0 -110
  228. package/components/templates-element-plus/src/ctx.js +0 -1
  229. package/components/templates-element-plus/src/index.css +0 -1
  230. package/components/templates-element-plus/src/types.js +0 -1
  231. package/components/templates-esri/index.css +0 -1
  232. package/components/templates-esri/index.js +0 -65
  233. package/components/templates-esri/src/ctx.js +0 -1
  234. package/components/templates-esri/src/index.css +0 -1
  235. package/components/templates-esri/src/types.js +0 -1
  236. package/components/templates-layout/index.js +0 -141
  237. package/components/templates-layout/src/ctx.js +0 -1
  238. package/components/templates-layout/src/index.css +0 -1
  239. package/components/templates-layout/src/types.js +0 -1
  240. package/components/templates-mapbox/index.css +0 -1
  241. package/components/templates-mapbox/index.js +0 -65
  242. package/components/templates-mapbox/src/ctx.js +0 -1
  243. package/components/templates-mapbox/src/index.css +0 -1
  244. package/components/templates-mapbox/src/types.js +0 -1
  245. package/components/upload/index.js +0 -565
  246. package/components/upload/src/ctx.js +0 -1
  247. package/components/upload/src/index.css +0 -1
  248. package/components/upload/src/types.js +0 -1
  249. package/components/upload-plus/src/api.js +0 -28
  250. package/components/upload-plus/src/const.js +0 -1
  251. package/components/upload-plus/src/ctx.js +0 -1
  252. package/components/upload-plus/src/index.css +0 -1
  253. package/components/upload-plus/src/types.js +0 -1
  254. package/components/van-cascader/src/ctx.js +0 -1
  255. package/components/van-cascader/src/index.css +0 -1
  256. package/components/van-cascader/src/types.js +0 -1
  257. package/components/var-datetime-picker/index.js +0 -299
  258. package/components/var-datetime-picker/src/const.js +0 -1
  259. package/components/var-datetime-picker/src/ctx.js +0 -1
  260. package/components/var-datetime-picker/src/index.css +0 -1
  261. package/components/var-datetime-picker/src/types.js +0 -1
  262. package/components/vditor/index.css +0 -1
  263. package/components/vditor/src/ctx.js +0 -1
  264. package/components/vditor/src/index.css +0 -1
  265. package/components/vditor/src/types.js +0 -1
  266. package/composables/index.css +0 -1
  267. package/composables/index.js +0 -1
  268. package/shared/const/index.css +0 -1
  269. package/shared/const/index.js +0 -1
  270. package/shared/element-plus/index.css +0 -1
  271. package/shared/element-plus/index.js +0 -1
  272. package/shared/form/index.css +0 -1
  273. package/shared/form/index.js +0 -1
  274. package/shared/helper/index.css +0 -1
  275. package/shared/helper/index.js +0 -1
  276. package/shared/index.css +0 -1
  277. package/shared/index.js +0 -1
  278. package/shared/infer-prop/index.css +0 -1
  279. package/shared/infer-prop/index.js +0 -1
  280. package/shared/progress-it/index.css +0 -1
  281. package/shared/progress-it/index.js +0 -1
  282. package/shared/rules/index.css +0 -1
  283. package/shared/rules/index.js +0 -1
  284. package/shared/types/form/index.css +0 -1
  285. package/shared/types/form/index.js +0 -1
  286. package/shared/types/index.css +0 -1
  287. package/shared/types/index.js +0 -1
  288. package/shared/types/source/index.css +0 -1
  289. package/shared/types/source/index.js +0 -1
  290. package/shared/types/source-manager/index.css +0 -1
  291. package/shared/types/source-manager/index.js +0 -1
  292. package/shared/upload/index.css +0 -1
  293. package/shared/upload/index.js +0 -1
  294. /package/{components/button/index.css → shared/types/form/index.mjs} +0 -0
  295. /package/{components/button/src/index.css → shared/types/index.mjs} +0 -0
  296. /package/{components/cascader/src/index.css → shared/types/source/index.mjs} +0 -0
  297. /package/{components/button/src/types.js → shared/types/source-manager/index.mjs} +0 -0
@@ -0,0 +1,399 @@
1
+ import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createVNode, normalizeClass, createCommentVNode, computed, shallowRef, ref, onMounted, nextTick, createElementBlock, mergeProps, toHandlers, withModifiers, renderSlot, resolveDynamicComponent, createElementVNode, withDirectives, vShow } from 'vue';
2
+ import { _VkfInputCtx, VkfInput } from '@vunk/form/components/input';
3
+ import { EMPTY_FEATURE_COLLECTION } from '@vumap/core/shared/static';
4
+ import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
5
+ import { ElButton, ElIcon, ElButtonGroup, ElUpload, ElDialog, ElMessage } from 'element-plus';
6
+ import { u as upload_default, e as edit_default, b as checked_default } from '../index2.mjs';
7
+ import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
8
+ import { VmMap } from '@vumap/core';
9
+ import { VmTdtLayers } from '@vumap/core/components/tdt-layers';
10
+ import { VmControlDraw } from '@vumap/core/components/control-draw';
11
+ import { Deferred } from '@vunk/core/shared/utils-promise';
12
+ import { t as toGeojson } from '../index3.mjs';
13
+ import { VkAsyncTeleport } from '@vunk/core';
14
+ import { VmControlDrawUi } from '@vumap/core/components/control-draw-ui';
15
+
16
+ const props = {
17
+ ..._VkfInputCtx.props,
18
+ showMap: {
19
+ type: Boolean,
20
+ default: false
21
+ },
22
+ dialogEdit: {
23
+ type: Boolean,
24
+ default: true
25
+ },
26
+ dialogEditFullscreen: {
27
+ type: Boolean,
28
+ default: true
29
+ },
30
+ dialogEditTitle: {
31
+ type: String,
32
+ default: "\u7ED8\u5236\u56FE\u6591"
33
+ },
34
+ modelValue: {
35
+ type: Object,
36
+ default: () => EMPTY_FEATURE_COLLECTION
37
+ },
38
+ editControls: {
39
+ type: Array,
40
+ default: () => ["trash"]
41
+ },
42
+ editTypes: {
43
+ type: [Array, String],
44
+ default: () => "polygon"
45
+ },
46
+ multiple: {
47
+ type: Boolean,
48
+ default: true
49
+ },
50
+ mapTo: {
51
+ type: [Object, String],
52
+ default: void 0
53
+ },
54
+ mapCenter: {
55
+ type: [Object, Array],
56
+ default: [120, 30]
57
+ },
58
+ editStyles: {
59
+ type: Array,
60
+ default: () => []
61
+ },
62
+ slots: {
63
+ type: Object,
64
+ default: () => ({})
65
+ },
66
+ spikSave: {
67
+ type: Boolean,
68
+ default: false
69
+ }
70
+ };
71
+ const createBindProps = bindPropsFactory(props);
72
+ const emits = {
73
+ ..._VkfInputCtx.emits,
74
+ "update:modelValue": (e) => e,
75
+ "editUpdate": (e) => e
76
+ };
77
+ const createOnEmits = onEmitsFactory(emits);
78
+
79
+ var ctx = /*#__PURE__*/Object.freeze({
80
+ __proto__: null,
81
+ createBindProps: createBindProps,
82
+ createOnEmits: createOnEmits,
83
+ emits: emits,
84
+ props: props
85
+ });
86
+
87
+ var _sfc_main$1 = defineComponent({
88
+ components: {
89
+ ElButton,
90
+ ElIcon,
91
+ ElButtonGroup,
92
+ Upload: upload_default,
93
+ Edit: edit_default,
94
+ ElUpload
95
+ },
96
+ props: {
97
+ disabled: Boolean,
98
+ dialog: Boolean
99
+ },
100
+ emits: {
101
+ upload: (e) => e,
102
+ edit: null
103
+ },
104
+ methods: {
105
+ getFile(file) {
106
+ this.$emit("upload", file);
107
+ }
108
+ }
109
+ });
110
+
111
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
112
+ const _component_Upload = resolveComponent("Upload");
113
+ const _component_ElIcon = resolveComponent("ElIcon");
114
+ const _component_ElUpload = resolveComponent("ElUpload");
115
+ const _component_ElButton = resolveComponent("ElButton");
116
+ const _component_Edit = resolveComponent("Edit");
117
+ const _component_ElButtonGroup = resolveComponent("ElButtonGroup");
118
+ return openBlock(), createBlock(_component_ElButtonGroup, null, {
119
+ default: withCtx(() => [
120
+ createVNode(_component_ElButton, { class: "vk-geoinput-upload-x" }, {
121
+ default: withCtx(() => [
122
+ createVNode(_component_ElUpload, {
123
+ class: normalizeClass("vk-geoinput-upload"),
124
+ action: "",
125
+ accept: "file",
126
+ multiple: false,
127
+ "show-file-list": false,
128
+ "auto-upload": false,
129
+ "on-change": _ctx.getFile,
130
+ disabled: _ctx.disabled
131
+ }, {
132
+ default: withCtx(() => [
133
+ createVNode(_component_ElIcon, { color: "var(--el-color-primary)" }, {
134
+ default: withCtx(() => [
135
+ createVNode(_component_Upload)
136
+ ]),
137
+ _: 1
138
+ /* STABLE */
139
+ })
140
+ ]),
141
+ _: 1
142
+ /* STABLE */
143
+ }, 8, ["on-change", "disabled"])
144
+ ]),
145
+ _: 1
146
+ /* STABLE */
147
+ }),
148
+ _ctx.dialog ? (openBlock(), createBlock(_component_ElButton, {
149
+ key: 0,
150
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("edit")),
151
+ disabled: _ctx.disabled
152
+ }, {
153
+ default: withCtx(() => [
154
+ createVNode(_component_ElIcon, { color: "var(--el-color-primary)" }, {
155
+ default: withCtx(() => [
156
+ createVNode(_component_Edit)
157
+ ]),
158
+ _: 1
159
+ /* STABLE */
160
+ })
161
+ ]),
162
+ _: 1
163
+ /* STABLE */
164
+ }, 8, ["disabled"])) : createCommentVNode("v-if", true)
165
+ ]),
166
+ _: 1
167
+ /* STABLE */
168
+ });
169
+ }
170
+ var AppendVue = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/geoinput-update/src/append.vue"]]);
171
+
172
+ var _sfc_main = /* @__PURE__ */ defineComponent({
173
+ name: "VkfGeoinputUpdate",
174
+ components: {
175
+ VkfInput,
176
+ ElDialog,
177
+ VmMap,
178
+ VmTdtLayers,
179
+ VmControlDraw,
180
+ VkAsyncTeleport,
181
+ VmControlDrawUi,
182
+ ElIcon,
183
+ Checked: checked_default
184
+ },
185
+ emits,
186
+ props,
187
+ setup(props2, {
188
+ emit
189
+ }) {
190
+ const inputBindProps = _VkfInputCtx.createBindProps(props2, ["inputSlots", "readonly", "modelValue"]);
191
+ const inputOnEmits = _VkfInputCtx.createOnEmits(emit, ["update:modelValue"]);
192
+ const mapOptions = computed(() => {
193
+ return {
194
+ center: props2.mapCenter
195
+ };
196
+ });
197
+ const geoInputMapDialogNode = shallowRef();
198
+ const geoInputMapXNode = shallowRef();
199
+ const editPlayground = ref(geoInputMapXNode.value);
200
+ onMounted(() => {
201
+ editPlayground.value = geoInputMapXNode.value;
202
+ });
203
+ const mapTo = computed(() => {
204
+ return editPlayground.value === geoInputMapDialogNode.value ? geoInputMapDialogNode.value : props2.mapTo ?? editPlayground.value;
205
+ });
206
+ const mapControls = computed(() => {
207
+ return props2.readonly ? [] : typeof props2.editTypes === "string" ? [props2.editTypes, ...props2.editControls] : [...props2.editTypes, ...props2.editControls];
208
+ });
209
+ const currentDrawCacheValue = ref(props2.modelValue);
210
+ const currentDrawValue = computed(() => {
211
+ return props2.spikSave ? props2.modelValue : currentDrawCacheValue.value;
212
+ });
213
+ const setCurrentDrawValue = value => {
214
+ if (props2.spikSave) {
215
+ emit("update:modelValue", value);
216
+ } else {
217
+ currentDrawCacheValue.value = value;
218
+ }
219
+ };
220
+ const doSave = () => {
221
+ emit("update:modelValue", currentDrawCacheValue.value);
222
+ ElMessage({
223
+ message: "\u4FDD\u5B58\u6210\u529F",
224
+ type: "success"
225
+ });
226
+ dialogShow.value = false;
227
+ };
228
+ const dialogShow = ref(false);
229
+ const mapDef = new Deferred();
230
+ const dialogOnOpen = async () => {
231
+ await nextTick();
232
+ editPlayground.value = geoInputMapDialogNode.value;
233
+ await nextTick();
234
+ const map = await mapDef.promise;
235
+ currentDrawCacheValue.value = props2.modelValue;
236
+ map.resize();
237
+ };
238
+ const dialogOnClose = async () => {
239
+ editPlayground.value = geoInputMapXNode.value;
240
+ const map = await mapDef.promise;
241
+ map.resize();
242
+ };
243
+ const append = () => createVNode(AppendVue, {
244
+ "dialog": props2.dialogEdit,
245
+ "disabled": props2.disabled,
246
+ "onUpload": onUpload,
247
+ "onEdit": onEdit
248
+ }, null);
249
+ async function onUpload(e) {
250
+ if (!e.raw) return;
251
+ toGeojson(e.raw).then(res => {
252
+ emit("update:modelValue", res);
253
+ });
254
+ }
255
+ function onEdit() {
256
+ dialogShow.value = true;
257
+ }
258
+ return {
259
+ inputBindProps,
260
+ inputOnEmits,
261
+ append,
262
+ dialogShow,
263
+ mapDef,
264
+ dialogOnOpen,
265
+ dialogOnClose,
266
+ mapOptions,
267
+ geoInputMapDialogNode,
268
+ geoInputMapXNode,
269
+ mapTo,
270
+ mapControls,
271
+ doSave,
272
+ currentDrawValue,
273
+ setCurrentDrawValue
274
+ };
275
+ }
276
+ });
277
+
278
+ const _hoisted_1 = { class: "vkf-form-item" };
279
+ const _hoisted_2 = {
280
+ class: "geoinput-map-dialog",
281
+ ref: "geoInputMapDialogNode"
282
+ };
283
+ const _hoisted_3 = {
284
+ class: "geoinput-map-x",
285
+ ref: "geoInputMapXNode"
286
+ };
287
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
288
+ const _component_VkfInput = resolveComponent("VkfInput");
289
+ const _component_VmTdtLayers = resolveComponent("VmTdtLayers");
290
+ const _component_Checked = resolveComponent("Checked");
291
+ const _component_ElIcon = resolveComponent("ElIcon");
292
+ const _component_VmControlDrawUi = resolveComponent("VmControlDrawUi");
293
+ const _component_VmControlDraw = resolveComponent("VmControlDraw");
294
+ const _component_VmMap = resolveComponent("VmMap");
295
+ const _component_VkAsyncTeleport = resolveComponent("VkAsyncTeleport");
296
+ const _component_ElDialog = resolveComponent("ElDialog");
297
+ return openBlock(), createElementBlock("div", _hoisted_1, [
298
+ createVNode(_component_VkfInput, mergeProps({
299
+ readonly: true,
300
+ modelValue: JSON.stringify(_ctx.modelValue)
301
+ }, _ctx.inputBindProps, toHandlers(_ctx.inputOnEmits), {
302
+ inputSlots: _ctx.readonly ? {} : {
303
+ append: _ctx.append
304
+ }
305
+ }), null, 16, ["modelValue", "inputSlots"]),
306
+ createVNode(_component_VkAsyncTeleport, { to: _ctx.mapTo }, {
307
+ default: withCtx(() => [
308
+ createVNode(_component_VmMap, {
309
+ defaultOptions: _ctx.mapOptions,
310
+ class: "vk-geoinput-edit-map",
311
+ onLoad: _cache[1] || (_cache[1] = ($event) => _ctx.mapDef.resolve($event.map))
312
+ }, {
313
+ default: withCtx(() => [
314
+ createVNode(_component_VmTdtLayers),
315
+ createVNode(_component_VmControlDraw, {
316
+ styles: _ctx.editStyles,
317
+ modelValue: _ctx.currentDrawValue,
318
+ "onUpdate:modelValue": _ctx.setCurrentDrawValue,
319
+ onUpdate: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("editUpdate", $event)),
320
+ controls: _ctx.mapControls,
321
+ multiple: _ctx.multiple
322
+ }, {
323
+ default: withCtx(() => [
324
+ !_ctx.spikSave ? (openBlock(), createBlock(_component_VmControlDrawUi, {
325
+ key: 0,
326
+ onClick: withModifiers(_ctx.doSave, ["prevent"])
327
+ }, {
328
+ default: withCtx(() => [
329
+ createVNode(_component_ElIcon, null, {
330
+ default: withCtx(() => [
331
+ createVNode(_component_Checked)
332
+ ]),
333
+ _: 1
334
+ /* STABLE */
335
+ })
336
+ ]),
337
+ _: 1
338
+ /* STABLE */
339
+ }, 8, ["onClick"])) : createCommentVNode("v-if", true)
340
+ ]),
341
+ _: 1
342
+ /* STABLE */
343
+ }, 8, ["styles", "modelValue", "onUpdate:modelValue", "controls", "multiple"]),
344
+ renderSlot(_ctx.$slots, "map"),
345
+ _ctx.slots.map ? (openBlock(), createBlock(resolveDynamicComponent(typeof _ctx.slots.map === "function" ? _ctx.slots.map() : _ctx.slots.map), { key: 0 })) : createCommentVNode("v-if", true)
346
+ ]),
347
+ _: 3
348
+ /* FORWARDED */
349
+ }, 8, ["defaultOptions"])
350
+ ]),
351
+ _: 3
352
+ /* FORWARDED */
353
+ }, 8, ["to"]),
354
+ createVNode(_component_ElDialog, {
355
+ modelValue: _ctx.dialogShow,
356
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.dialogShow = $event),
357
+ title: _ctx.dialogEditTitle,
358
+ fullscreen: _ctx.dialogEditFullscreen,
359
+ modalClass: "vk-geoinput-edit-dialog-x",
360
+ appendToBody: true,
361
+ onOpen: _ctx.dialogOnOpen,
362
+ onClose: _ctx.dialogOnClose,
363
+ closeOnClickModal: false,
364
+ draggable: true
365
+ }, {
366
+ default: withCtx(() => [
367
+ createElementVNode(
368
+ "div",
369
+ _hoisted_2,
370
+ null,
371
+ 512
372
+ /* NEED_PATCH */
373
+ )
374
+ ]),
375
+ _: 1
376
+ /* STABLE */
377
+ }, 8, ["modelValue", "title", "fullscreen", "onOpen", "onClose"]),
378
+ withDirectives(createElementVNode(
379
+ "div",
380
+ _hoisted_3,
381
+ null,
382
+ 512
383
+ /* NEED_PATCH */
384
+ ), [
385
+ [vShow, _ctx.showMap]
386
+ ])
387
+ ]);
388
+ }
389
+ var VkfGeoinputUpdate = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/geoinput-update/src/index.vue"]]);
390
+
391
+ var types = /*#__PURE__*/Object.freeze({
392
+ __proto__: null
393
+ });
394
+
395
+ VkfGeoinputUpdate.install = (app) => {
396
+ app.component(VkfGeoinputUpdate.name, VkfGeoinputUpdate);
397
+ };
398
+
399
+ export { VkfGeoinputUpdate, ctx as _VkfGeoinputUpdateCtx, types as __VkfGeoinputUpdate, VkfGeoinputUpdate as default };