@vunk/form 2.0.2 → 2.1.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.
- package/components/esri-input-geojson/index.cjs +484 -2
- package/components/esri-input-geojson/index.mjs +483 -1
- package/components/esri-input-geojson/src/ctx.d.ts +1 -1
- package/components/esri-input-geojson/src/index.vue.d.ts +1 -1
- package/components/index2.cjs +0 -19
- package/components/index2.mjs +1 -19
- package/components/input-collection/index.mjs +1 -1
- package/components/input-number/src/ctx.d.ts +1 -1
- package/components/input-number/src/index.vue.d.ts +2 -2
- package/components/select/index.cjs +12 -0
- package/components/select/index.d.ts +1 -0
- package/components/select/index.mjs +12 -1
- package/components/select/src/ctx.d.ts +2 -0
- package/components/select/src/index.vue.d.ts +1 -1
- package/components/tables-select/index.cjs +225 -0
- package/components/tables-select/index.css +3 -0
- package/components/tables-select/index.d.ts +4 -0
- package/components/tables-select/index.mjs +219 -0
- package/components/tables-select/src/ctx.d.ts +338 -0
- package/components/tables-select/src/index.vue.d.ts +4953 -0
- package/components/tables-select/src/types.d.ts +1 -0
- package/components/upload/index.mjs +1 -1
- package/components/upload-plus/index.mjs +1 -1
- package/index.css +4 -41
- package/package.json +9 -9
- package/shared/element-plus/ctx.d.ts +1 -1
- package/components/geoinput-update/index.cjs +0 -406
- package/components/geoinput-update/index.css +0 -40
- package/components/geoinput-update/index.d.ts +0 -5
- package/components/geoinput-update/index.mjs +0 -399
- package/components/geoinput-update/src/append.vue.d.ts +0 -815
- package/components/geoinput-update/src/ctx.d.ts +0 -219
- package/components/geoinput-update/src/index.vue.d.ts +0 -1143
- package/components/geoinput-update/src/types.d.ts +0 -6
- package/components/index3.cjs +0 -486
- package/components/index3.mjs +0 -484
|
@@ -1,399 +0,0 @@
|
|
|
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 };
|