@vunk/form 0.0.1-alpha.9 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/component.d.ts +1 -1
- package/components/button/index.d.ts +4 -0
- package/components/button/index.js +126 -0
- package/components/button/src/ctx.d.ts +92 -0
- package/components/button/src/ctx.js +39 -0
- package/components/button/src/index.vue.d.ts +245 -0
- package/components/button/src/types.d.ts +13 -0
- package/components/cascader/index.d.ts +4 -0
- package/components/cascader/index.js +114 -0
- package/components/cascader/src/ctx.d.ts +129 -0
- package/components/cascader/src/ctx.js +38 -0
- package/components/cascader/src/index.vue.d.ts +311 -0
- package/components/cascader/src/types.d.ts +7 -0
- package/components/checkbox/index.css +38 -0
- package/components/checkbox/index.d.ts +4 -0
- package/components/checkbox/index.js +127 -0
- package/components/checkbox/src/ctx.d.ts +82 -0
- package/components/checkbox/src/ctx.js +43 -0
- package/components/checkbox/src/index.vue.d.ts +213 -0
- package/components/checkbox/src/types.d.ts +8 -0
- package/components/color-picker/index.d.ts +4 -0
- package/components/color-picker/index.js +77 -0
- package/components/color-picker/src/ctx.d.ts +72 -0
- package/components/color-picker/src/ctx.js +23 -0
- package/components/color-picker/src/index.vue.d.ts +193 -0
- package/components/color-picker/src/types.d.ts +7 -0
- package/components/date-picker/index.js +26 -15
- package/components/date-picker/src/ctx.d.ts +64 -57
- package/components/date-picker/src/ctx.js +1 -1
- package/components/date-picker/src/index.vue.d.ts +176 -146
- package/components/date-picker/src/types.d.ts +14 -8
- package/components/form/index.d.ts +1 -0
- package/components/form/index.js +44 -19
- package/components/form/src/ctx.d.ts +147 -97
- package/components/form/src/ctx.js +5 -2
- package/components/form/src/index.vue.d.ts +424 -287
- package/components/form/src/types.d.ts +2 -0
- package/components/form/src/types.js +1 -0
- package/components/form-item/index.css +4 -0
- package/components/form-item/index.js +34 -13
- package/components/form-item/src/ctx.d.ts +15 -7
- package/components/form-item/src/ctx.js +8 -0
- package/components/form-item/src/index.vue.d.ts +44 -14
- package/components/form-item-renderer/index.js +34 -30
- package/components/form-item-renderer/src/ctx.d.ts +3 -3
- package/components/form-item-renderer/src/index.vue.d.ts +9 -9
- package/components/form-item-renderer/src/types.d.ts +2 -0
- package/components/form-item-renderer-template/index.js +13 -6
- package/components/form-item-renderer-template/src/index.vue.d.ts +1 -1
- package/components/geoinput/index.d.ts +4 -0
- package/components/geoinput/index.js +94 -0
- package/components/geoinput/src/ctx.d.ts +218 -0
- package/components/geoinput/src/ctx.js +39 -0
- package/components/geoinput/src/index.vue.d.ts +608 -0
- package/components/geoinput/src/types.d.ts +12 -0
- package/components/geoinput/src/types.js +1 -0
- package/components/geoinput-read/index.css +9 -0
- package/components/geoinput-read/index.d.ts +5 -0
- package/components/geoinput-read/index.js +355 -0
- package/components/geoinput-read/src/append.vue.d.ts +6 -0
- package/components/geoinput-read/src/core.vue.d.ts +457 -0
- package/components/geoinput-read/src/ctx.d.ts +205 -0
- package/components/geoinput-read/src/ctx.js +62 -0
- package/components/geoinput-read/src/index.vue.d.ts +486 -0
- package/components/geoinput-read/src/types.d.ts +3 -0
- package/components/geoinput-read/src/types.js +1 -0
- package/components/geoinput-update/index.css +44 -0
- package/components/geoinput-update/index.d.ts +5 -0
- package/components/geoinput-update/index.js +982 -0
- package/components/geoinput-update/src/append.vue.d.ts +20 -0
- package/components/geoinput-update/src/ctx.d.ts +211 -0
- package/components/geoinput-update/src/ctx.js +85 -0
- package/components/geoinput-update/src/index.vue.d.ts +483 -0
- package/components/geoinput-update/src/types.d.ts +6 -0
- package/components/geoinput-update/src/types.js +1 -0
- package/components/input/index.js +29 -15
- package/components/input/src/ctx.d.ts +88 -49
- package/components/input/src/ctx.js +5 -1
- package/components/input/src/index.vue.d.ts +219 -129
- package/components/input/src/types.d.ts +7 -1
- package/components/input-link/index.css +5 -0
- package/components/input-link/index.d.ts +4 -0
- package/components/input-link/index.js +181 -0
- package/components/input-link/src/ctx.d.ts +143 -0
- package/components/input-link/src/ctx.js +46 -0
- package/components/input-link/src/index.vue.d.ts +373 -0
- package/components/input-link/src/types.d.ts +7 -0
- package/components/input-link/src/types.js +1 -0
- package/components/input-number/index.css +17 -0
- package/components/input-number/index.js +46 -14
- package/components/input-number/src/ctx.d.ts +22 -10
- package/components/input-number/src/ctx.js +13 -1
- package/components/input-number/src/index.vue.d.ts +92 -32
- package/components/input-number/src/types.d.ts +7 -0
- package/components/radio/index.css +29 -0
- package/components/radio/index.d.ts +4 -0
- package/components/radio/index.js +123 -0
- package/components/radio/src/ctx.d.ts +77 -0
- package/components/radio/src/ctx.js +39 -0
- package/components/radio/src/index.vue.d.ts +204 -0
- package/components/radio/src/types.d.ts +8 -0
- package/components/radio/src/types.js +1 -0
- package/components/select/index.css +11 -0
- package/components/select/index.js +75 -49
- package/components/select/src/ctx.d.ts +37 -25
- package/components/select/src/ctx.js +4 -0
- package/components/select/src/index.vue.d.ts +181 -104
- package/components/select/src/types.d.ts +7 -1
- package/components/switch/index.css +11 -0
- package/components/switch/index.js +40 -29
- package/components/switch/src/ctx.d.ts +41 -13
- package/components/switch/src/ctx.js +3 -4
- package/components/switch/src/index.vue.d.ts +123 -49
- package/components/switch/src/types.d.ts +7 -0
- package/components/templates-default/index.d.ts +4 -0
- package/components/templates-default/index.js +244 -0
- package/components/{form-item-renderer-template-default → templates-default}/src/index.vue.d.ts +7 -7
- package/components/templates-default/src/types.d.ts +31 -0
- package/components/templates-default/src/types.js +1 -0
- package/components/templates-element-plus/index.d.ts +4 -0
- package/components/templates-element-plus/index.js +80 -0
- package/components/{form-item-renderer-template-layout → templates-element-plus}/src/ctx.d.ts +3 -2
- package/components/{form-item-renderer-template-layout → templates-element-plus}/src/ctx.js +1 -1
- package/components/templates-element-plus/src/index.vue.d.ts +19 -0
- package/components/templates-element-plus/src/types.d.ts +13 -0
- package/components/templates-element-plus/src/types.js +1 -0
- package/components/templates-layout/index.css +5 -0
- package/components/templates-layout/index.d.ts +4 -0
- package/components/templates-layout/index.js +108 -0
- package/components/templates-layout/src/ctx.d.ts +9 -0
- package/components/templates-layout/src/ctx.js +9 -0
- package/components/templates-layout/src/index.vue.d.ts +19 -0
- package/{shared/types/layout-source/index.d.ts → components/templates-layout/src/types.d.ts} +5 -4
- package/components/templates-layout/src/types.js +1 -0
- package/components/templates-mapbox/index.d.ts +4 -0
- package/components/templates-mapbox/index.js +64 -0
- package/components/templates-mapbox/src/ctx.d.ts +11 -0
- package/components/templates-mapbox/src/ctx.js +11 -0
- package/components/templates-mapbox/src/index.vue.d.ts +20 -0
- package/components/templates-mapbox/src/types.d.ts +3 -0
- package/components/templates-mapbox/src/types.js +1 -0
- package/components/upload/index.css +33 -0
- package/components/upload/index.d.ts +5 -0
- package/components/upload/index.js +606 -0
- package/components/upload/src/ctx.d.ts +168 -0
- package/components/upload/src/ctx.js +45 -0
- package/components/upload/src/file.vue.d.ts +96 -0
- package/components/upload/src/index.vue.d.ts +416 -0
- package/components/upload/src/types.d.ts +7 -0
- package/components/upload/src/types.js +1 -0
- package/composables/index.d.ts +1 -0
- package/composables/index.js +28 -6
- package/composables/useForm.d.ts +9 -0
- package/composables/useSourceManager.d.ts +2 -0
- package/index.css +211 -2
- package/index.d.ts +14 -1
- package/index.esm.js +16 -5
- package/package.json +4 -1
- package/shared/element-plus/ctx.d.ts +86 -13
- package/shared/element-plus/index.js +18156 -35
- package/shared/element-plus/instances.d.ts +97 -26
- package/shared/helper/index.d.ts +1 -0
- package/shared/infer-prop/index.d.ts +17 -0
- package/shared/infer-prop/index.js +34 -0
- package/shared/progress-it/index.d.ts +16 -0
- package/shared/progress-it/index.js +57 -0
- package/shared/types/form/checkbox.d.ts +13 -0
- package/shared/types/form/index.d.ts +2 -0
- package/shared/types/form/index.js +1 -0
- package/shared/types/form/radio.d.ts +8 -0
- package/shared/types/index.d.ts +1 -2
- package/shared/types/source/index.d.ts +13 -0
- package/shared/types/source/index.js +1 -0
- package/components/form-item-renderer-template-default/index.d.ts +0 -4
- package/components/form-item-renderer-template-default/index.js +0 -129
- package/components/form-item-renderer-template-default/src/types.d.ts +0 -1
- package/components/form-item-renderer-template-layout/index.css +0 -7
- package/components/form-item-renderer-template-layout/index.d.ts +0 -4
- package/components/form-item-renderer-template-layout/index.js +0 -91
- package/components/form-item-renderer-template-layout/src/index.vue.d.ts +0 -7
- package/components/form-item-renderer-template-layout/src/types.d.ts +0 -1
- package/shared/types/renderer-source/compoent.d.ts +0 -5
- package/shared/types/renderer-source/date-picker.d.ts +0 -7
- package/shared/types/renderer-source/index.d.ts +0 -13
- package/shared/types/renderer-source/input-number.d.ts +0 -7
- package/shared/types/renderer-source/input.d.ts +0 -7
- package/shared/types/renderer-source/select.d.ts +0 -7
- package/shared/types/renderer-source/switch.d.ts +0 -7
- /package/components/{form-item-renderer-template-default → button}/src/types.js +0 -0
- /package/components/{form-item-renderer-template-layout → cascader}/src/types.js +0 -0
- /package/{shared/types/layout-source/index.js → components/checkbox/src/types.js} +0 -0
- /package/{shared/types/renderer-source/index.js → components/color-picker/src/types.js} +0 -0
- /package/components/{form-item-renderer-template-default → templates-default}/src/ctx.d.ts +0 -0
- /package/components/{form-item-renderer-template-default → templates-default}/src/ctx.js +0 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import { openBlock, createElementBlock, createElementVNode, defineComponent, resolveComponent, createBlock, withCtx, createVNode, computed, Fragment, withDirectives, mergeProps, toHandlers, vShow, renderSlot, createCommentVNode, normalizeProps, guardReactiveProps } from 'vue';
|
|
2
|
+
import { VkWrapper } from '@vunk/core/components/wrapper';
|
|
3
|
+
import { _VkfInputCtx, VkfInput } from '@vunk/form/components/input';
|
|
4
|
+
import { EMPTY_FEATURE_COLLECTION } from '@vumap/core/shared/static';
|
|
5
|
+
import { _VmGeojsonLayerCtx } from '@vumap/core/components/geojson-layer';
|
|
6
|
+
import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
|
|
7
|
+
import { ElButton, ElIcon, ElButtonGroup } from 'element-plus';
|
|
8
|
+
import { VmGeojsonLayer, _VmGeojsonLayerCtx as _VmGeojsonLayerCtx$1, useMap, VmTdtLayers, VmMap } from '@vumap/core';
|
|
9
|
+
import { fitGeojson } from '@vumap/core/shared/utils';
|
|
10
|
+
|
|
11
|
+
var __defProp$1 = Object.defineProperty;
|
|
12
|
+
var __defProps = Object.defineProperties;
|
|
13
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
14
|
+
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
15
|
+
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
17
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18
|
+
var __spreadValues$1 = (a, b) => {
|
|
19
|
+
for (var prop in b || (b = {}))
|
|
20
|
+
if (__hasOwnProp$1.call(b, prop))
|
|
21
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
22
|
+
if (__getOwnPropSymbols$1)
|
|
23
|
+
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
24
|
+
if (__propIsEnum$1.call(b, prop))
|
|
25
|
+
__defNormalProp$1(a, prop, b[prop]);
|
|
26
|
+
}
|
|
27
|
+
return a;
|
|
28
|
+
};
|
|
29
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
30
|
+
const props = __spreadProps(__spreadValues$1(__spreadValues$1({}, _VkfInputCtx.props), _VmGeojsonLayerCtx.props), {
|
|
31
|
+
modelValue: {
|
|
32
|
+
type: Object,
|
|
33
|
+
default: () => EMPTY_FEATURE_COLLECTION
|
|
34
|
+
},
|
|
35
|
+
editStyles: {
|
|
36
|
+
type: Array,
|
|
37
|
+
default: () => []
|
|
38
|
+
},
|
|
39
|
+
editTypes: {
|
|
40
|
+
type: [Array, String],
|
|
41
|
+
default: "polygon"
|
|
42
|
+
},
|
|
43
|
+
paint: {
|
|
44
|
+
type: Object,
|
|
45
|
+
default: void 0
|
|
46
|
+
},
|
|
47
|
+
type: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: void 0
|
|
50
|
+
},
|
|
51
|
+
custom: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: false
|
|
54
|
+
},
|
|
55
|
+
showMap: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
const createBindProps = bindPropsFactory(props);
|
|
61
|
+
const emits = __spreadProps(__spreadValues$1(__spreadValues$1({}, _VmGeojsonLayerCtx.emits), _VkfInputCtx.emits), {
|
|
62
|
+
"layerChange": (layer) => layer,
|
|
63
|
+
"update:modelValue": (e) => e
|
|
64
|
+
});
|
|
65
|
+
const createOnEmits = onEmitsFactory(emits);
|
|
66
|
+
|
|
67
|
+
var ctx = /*#__PURE__*/Object.freeze({
|
|
68
|
+
__proto__: null,
|
|
69
|
+
props: props,
|
|
70
|
+
createBindProps: createBindProps,
|
|
71
|
+
emits: emits,
|
|
72
|
+
createOnEmits: createOnEmits
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
/*! Element Plus Icons Vue v2.1.0 */
|
|
76
|
+
|
|
77
|
+
// unplugin-vue:/plugin-vue/export-helper
|
|
78
|
+
var export_helper_default = (sfc, props) => {
|
|
79
|
+
let target = sfc.__vccOpts || sfc;
|
|
80
|
+
for (let [key, val] of props)
|
|
81
|
+
target[key] = val;
|
|
82
|
+
return target;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
// unplugin-vue:/home/runner/work/element-plus-icons/element-plus-icons/packages/vue/src/components/map-location.vue?vue&type=script&lang.ts
|
|
86
|
+
var map_location_vue_vue_type_script_lang_default = {
|
|
87
|
+
name: "MapLocation"
|
|
88
|
+
};
|
|
89
|
+
var _hoisted_1160 = {
|
|
90
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
91
|
+
viewBox: "0 0 1024 1024"
|
|
92
|
+
}, _hoisted_2160 = /* @__PURE__ */ createElementVNode(
|
|
93
|
+
"path",
|
|
94
|
+
{
|
|
95
|
+
fill: "currentColor",
|
|
96
|
+
d: "M800 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576C705.472 688.128 800 534.144 800 416zM512 960C277.312 746.688 160 565.312 160 416a352 352 0 0 1 704 0c0 149.312-117.312 330.688-352 544z"
|
|
97
|
+
},
|
|
98
|
+
null,
|
|
99
|
+
-1
|
|
100
|
+
/* HOISTED */
|
|
101
|
+
), _hoisted_3159 = /* @__PURE__ */ createElementVNode(
|
|
102
|
+
"path",
|
|
103
|
+
{
|
|
104
|
+
fill: "currentColor",
|
|
105
|
+
d: "M512 448a64 64 0 1 0 0-128 64 64 0 0 0 0 128zm0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256zm345.6 192L960 960H672v-64H352v64H64l102.4-256h691.2zm-68.928 0H235.328l-76.8 192h706.944l-76.8-192z"
|
|
106
|
+
},
|
|
107
|
+
null,
|
|
108
|
+
-1
|
|
109
|
+
/* HOISTED */
|
|
110
|
+
), _hoisted_444 = [
|
|
111
|
+
_hoisted_2160,
|
|
112
|
+
_hoisted_3159
|
|
113
|
+
];
|
|
114
|
+
function _sfc_render160(_ctx, _cache, $props, $setup, $data, $options) {
|
|
115
|
+
return openBlock(), createElementBlock("svg", _hoisted_1160, _hoisted_444);
|
|
116
|
+
}
|
|
117
|
+
var map_location_default = /* @__PURE__ */ export_helper_default(map_location_vue_vue_type_script_lang_default, [["render", _sfc_render160], ["__file", "map-location.vue"]]);
|
|
118
|
+
|
|
119
|
+
var _export_sfc = (sfc, props) => {
|
|
120
|
+
const target = sfc.__vccOpts || sfc;
|
|
121
|
+
for (const [key, val] of props) {
|
|
122
|
+
target[key] = val;
|
|
123
|
+
}
|
|
124
|
+
return target;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const _sfc_main$2 = defineComponent({
|
|
128
|
+
components: {
|
|
129
|
+
ElButton,
|
|
130
|
+
ElIcon,
|
|
131
|
+
ElButtonGroup,
|
|
132
|
+
MapLocation: map_location_default
|
|
133
|
+
},
|
|
134
|
+
emits: {
|
|
135
|
+
mapLocationClick: null
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
139
|
+
const _component_MapLocation = resolveComponent("MapLocation");
|
|
140
|
+
const _component_ElIcon = resolveComponent("ElIcon");
|
|
141
|
+
const _component_ElButton = resolveComponent("ElButton");
|
|
142
|
+
const _component_ElButtonGroup = resolveComponent("ElButtonGroup");
|
|
143
|
+
return openBlock(), createBlock(_component_ElButtonGroup, null, {
|
|
144
|
+
default: withCtx(() => [
|
|
145
|
+
createVNode(_component_ElButton, {
|
|
146
|
+
class: "vk-geoinput-read-map-location-x",
|
|
147
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("mapLocationClick"))
|
|
148
|
+
}, {
|
|
149
|
+
default: withCtx(() => [
|
|
150
|
+
createVNode(_component_ElIcon, { color: "var(--el-color-primary)" }, {
|
|
151
|
+
default: withCtx(() => [
|
|
152
|
+
createVNode(_component_MapLocation)
|
|
153
|
+
]),
|
|
154
|
+
_: 1
|
|
155
|
+
}, 8, ["color"])
|
|
156
|
+
]),
|
|
157
|
+
_: 1
|
|
158
|
+
})
|
|
159
|
+
]),
|
|
160
|
+
_: 1
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
var AppendVue = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__file", "append.vue"]]);
|
|
164
|
+
|
|
165
|
+
var __defProp = Object.defineProperty;
|
|
166
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
167
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
168
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
169
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
170
|
+
var __spreadValues = (a, b) => {
|
|
171
|
+
for (var prop in b || (b = {}))
|
|
172
|
+
if (__hasOwnProp.call(b, prop))
|
|
173
|
+
__defNormalProp(a, prop, b[prop]);
|
|
174
|
+
if (__getOwnPropSymbols)
|
|
175
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
176
|
+
if (__propIsEnum.call(b, prop))
|
|
177
|
+
__defNormalProp(a, prop, b[prop]);
|
|
178
|
+
}
|
|
179
|
+
return a;
|
|
180
|
+
};
|
|
181
|
+
var _sfc_main$1 = defineComponent({
|
|
182
|
+
name: "VkfGeoinputReadCore",
|
|
183
|
+
components: {
|
|
184
|
+
VkfInput,
|
|
185
|
+
VmGeojsonLayer,
|
|
186
|
+
ElIcon,
|
|
187
|
+
MapLocation: map_location_default
|
|
188
|
+
},
|
|
189
|
+
emits,
|
|
190
|
+
props,
|
|
191
|
+
setup(props2, { emit }) {
|
|
192
|
+
const inputBindProps = _VkfInputCtx.createBindProps(props2, [
|
|
193
|
+
"inputSlots",
|
|
194
|
+
"readonly",
|
|
195
|
+
"modelValue",
|
|
196
|
+
"type",
|
|
197
|
+
"id"
|
|
198
|
+
]);
|
|
199
|
+
const inputOnEmits = _VkfInputCtx.createOnEmits(emit, ["update:modelValue"]);
|
|
200
|
+
const mapBindProps = _VmGeojsonLayerCtx$1.createBindProps(props2, ["data", "type", "paint"]);
|
|
201
|
+
const mapOnEmits = _VmGeojsonLayerCtx$1.createOnEmits(emit, ["change"]);
|
|
202
|
+
const map = useMap();
|
|
203
|
+
const geoType = computed(() => {
|
|
204
|
+
var _a, _b, _c;
|
|
205
|
+
if (props2.type)
|
|
206
|
+
return props2.type;
|
|
207
|
+
const typeRaw = (_c = (_b = (_a = props2.modelValue) == null ? void 0 : _a.features[0]) == null ? void 0 : _b.geometry) == null ? void 0 : _c.type;
|
|
208
|
+
const typeRawTo = {
|
|
209
|
+
LineString: "line",
|
|
210
|
+
Polygon: "fill",
|
|
211
|
+
MultiLineString: "line",
|
|
212
|
+
MultiPolygon: "fill"
|
|
213
|
+
};
|
|
214
|
+
return typeRawTo[typeRaw] || "fill";
|
|
215
|
+
});
|
|
216
|
+
const paintFromEditStyles = computed(() => {
|
|
217
|
+
return props2.editStyles.reduce((a, c) => {
|
|
218
|
+
if (geoType.value === "fill") {
|
|
219
|
+
if (c.id.includes("polygon-fill-inactive") || c.id.includes("polygon-stroke-inactive")) {
|
|
220
|
+
const cPaint = c.paint;
|
|
221
|
+
a = __spreadValues(__spreadValues({}, a), cPaint);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
if (geoType.value === "line") {
|
|
225
|
+
if (c.id.includes("line-inactive")) {
|
|
226
|
+
const cPaint = c.paint;
|
|
227
|
+
a = __spreadValues(__spreadValues({}, a), cPaint);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return a;
|
|
231
|
+
}, {});
|
|
232
|
+
});
|
|
233
|
+
const mapFit = () => {
|
|
234
|
+
fitGeojson(map, props2.modelValue, {
|
|
235
|
+
duration: 1500
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
const append = () => /* @__PURE__ */ React.createElement(AppendVue, {
|
|
239
|
+
onMapLocationClick: mapFit
|
|
240
|
+
});
|
|
241
|
+
return {
|
|
242
|
+
mapFit,
|
|
243
|
+
inputBindProps,
|
|
244
|
+
inputOnEmits,
|
|
245
|
+
mapBindProps,
|
|
246
|
+
mapOnEmits,
|
|
247
|
+
append,
|
|
248
|
+
geoType,
|
|
249
|
+
paintFromEditStyles
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
255
|
+
const _component_VkfInput = resolveComponent("VkfInput");
|
|
256
|
+
const _component_MapLocation = resolveComponent("MapLocation");
|
|
257
|
+
const _component_ElIcon = resolveComponent("ElIcon");
|
|
258
|
+
const _component_VmGeojsonLayer = resolveComponent("VmGeojsonLayer");
|
|
259
|
+
|
|
260
|
+
return (openBlock(), createElementBlock(Fragment, null, [
|
|
261
|
+
withDirectives(createVNode(_component_VkfInput, mergeProps({
|
|
262
|
+
readonly: true,
|
|
263
|
+
modelValue: JSON.stringify(_ctx.modelValue)
|
|
264
|
+
}, _ctx.inputBindProps, toHandlers(_ctx.inputOnEmits), {
|
|
265
|
+
inputSlots: {
|
|
266
|
+
append: _ctx.append
|
|
267
|
+
}
|
|
268
|
+
}), null, 16 /* FULL_PROPS */, ["modelValue", "inputSlots"]), [
|
|
269
|
+
[vShow, !_ctx.custom]
|
|
270
|
+
]),
|
|
271
|
+
(_ctx.custom)
|
|
272
|
+
? renderSlot(_ctx.$slots, "default", {
|
|
273
|
+
key: 0,
|
|
274
|
+
mapFit: _ctx.mapFit
|
|
275
|
+
}, () => [
|
|
276
|
+
createVNode(_component_ElIcon, {
|
|
277
|
+
color: 'var(--el-color-primary)',
|
|
278
|
+
onClick: _ctx.mapFit
|
|
279
|
+
}, {
|
|
280
|
+
default: withCtx(() => [
|
|
281
|
+
createVNode(_component_MapLocation)
|
|
282
|
+
]),
|
|
283
|
+
_: 1 /* STABLE */
|
|
284
|
+
}, 8 /* PROPS */, ["color", "onClick"])
|
|
285
|
+
])
|
|
286
|
+
: createCommentVNode("v-if", true),
|
|
287
|
+
createVNode(_component_VmGeojsonLayer, mergeProps(_ctx.mapBindProps, {
|
|
288
|
+
data: _ctx.modelValue,
|
|
289
|
+
type: _ctx.geoType,
|
|
290
|
+
onChange: _cache[0] || (_cache[0] = $event => (_ctx.$emit('layerChange', $event))),
|
|
291
|
+
paint: _ctx.paint || _ctx.paintFromEditStyles
|
|
292
|
+
}, toHandlers(_ctx.mapOnEmits)), null, 16 /* FULL_PROPS */, ["data", "type", "paint"])
|
|
293
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
294
|
+
}
|
|
295
|
+
var CoreVue = /*#__PURE__*/_export_sfc(_sfc_main$1, [['render',_sfc_render$1],['__file',"core.vue"]]);
|
|
296
|
+
|
|
297
|
+
const _sfc_main = defineComponent({
|
|
298
|
+
name: "VkfGeoinputRead",
|
|
299
|
+
components: {
|
|
300
|
+
CoreVue,
|
|
301
|
+
VkWrapper,
|
|
302
|
+
VmTdtLayers
|
|
303
|
+
},
|
|
304
|
+
props,
|
|
305
|
+
emits,
|
|
306
|
+
setup(props2, { emit }) {
|
|
307
|
+
const coreBindProps = createBindProps(props2);
|
|
308
|
+
const coreOnEmits = createOnEmits(emit);
|
|
309
|
+
return {
|
|
310
|
+
VmMap,
|
|
311
|
+
coreBindProps,
|
|
312
|
+
coreOnEmits
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
const _hoisted_1 = { class: "vk-geoinput-read-x" };
|
|
317
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
318
|
+
const _component_VmTdtLayers = resolveComponent("VmTdtLayers");
|
|
319
|
+
const _component_CoreVue = resolveComponent("CoreVue");
|
|
320
|
+
const _component_VkWrapper = resolveComponent("VkWrapper");
|
|
321
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
322
|
+
createVNode(_component_VkWrapper, {
|
|
323
|
+
is: _ctx.VmMap,
|
|
324
|
+
show: _ctx.showMap,
|
|
325
|
+
className: "vk-geoinput-read-map"
|
|
326
|
+
}, {
|
|
327
|
+
default: withCtx(() => [
|
|
328
|
+
renderSlot(_ctx.$slots, "map", {}, () => [
|
|
329
|
+
_ctx.showMap ? (openBlock(), createBlock(_component_VmTdtLayers, {
|
|
330
|
+
key: 0,
|
|
331
|
+
type: "vec_w"
|
|
332
|
+
})) : createCommentVNode("v-if", true)
|
|
333
|
+
]),
|
|
334
|
+
createVNode(_component_CoreVue, mergeProps(_ctx.coreBindProps, toHandlers(_ctx.coreOnEmits)), {
|
|
335
|
+
default: withCtx((e) => [
|
|
336
|
+
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(e)))
|
|
337
|
+
]),
|
|
338
|
+
_: 3
|
|
339
|
+
}, 16)
|
|
340
|
+
]),
|
|
341
|
+
_: 3
|
|
342
|
+
}, 8, ["is", "show"])
|
|
343
|
+
]);
|
|
344
|
+
}
|
|
345
|
+
var VkfGeoinputRead = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "index.vue"]]);
|
|
346
|
+
|
|
347
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
348
|
+
__proto__: null
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
VkfGeoinputRead.install = (app) => {
|
|
352
|
+
app.component(VkfGeoinputRead.name, VkfGeoinputRead);
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
export { VkfGeoinputRead, ctx as _VkfGeoinputReadCtx, types as __VkfGeoinputRead, VkfGeoinputRead as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
+
mapLocationClick: null;
|
|
3
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
4
|
+
onMapLocationClick?: ((...args: any[]) => any) | undefined;
|
|
5
|
+
}, {}>;
|
|
6
|
+
export default _default;
|