@vunk/form 1.1.84 → 1.2.0

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