@vunk/form 1.4.12 → 2.0.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 (86) hide show
  1. package/components/form/index.cjs +34 -6
  2. package/components/form/index.mjs +35 -7
  3. package/components/form/src/ctx.d.ts +8 -1
  4. package/components/form/src/index.vue.d.ts +31 -0
  5. package/components/form-item-renderer/index.cjs +33 -20
  6. package/components/form-item-renderer/index.d.ts +0 -1
  7. package/components/form-item-renderer/index.mjs +35 -20
  8. package/components/form-item-renderer/src/index.vue.d.ts +4 -4
  9. package/components/form-item-renderer/src/types.d.ts +0 -1
  10. package/components/form-item-renderer-template/index.cjs +2 -2
  11. package/components/form-item-renderer-template/index.mjs +3 -3
  12. package/components/form-item-renderer-template/src/types.d.ts +44 -0
  13. package/components/input-collection/index.cjs +56 -40
  14. package/components/input-collection/index.mjs +57 -41
  15. package/components/input-collection/src/ctx.d.ts +7 -0
  16. package/components/input-collection/src/index.vue.d.ts +20 -0
  17. package/components/input-number/src/ctx.d.ts +1 -1
  18. package/components/input-number/src/index.vue.d.ts +2 -2
  19. package/components/renderer-data/index.cjs +41 -0
  20. package/components/renderer-data/index.d.ts +4 -0
  21. package/components/renderer-data/index.mjs +35 -0
  22. package/components/{templates-mapbox → renderer-data}/src/ctx.d.ts +3 -2
  23. package/components/renderer-data/src/index.vue.d.ts +20 -0
  24. package/components/renderer-data/src/types.d.ts +1 -0
  25. package/components/select/index.css +5 -0
  26. package/components/slider/src/index.vue.d.ts +1 -1
  27. package/components/template-instances-provider/index.cjs +16 -6
  28. package/components/template-instances-provider/index.mjs +17 -7
  29. package/components/template-instances-provider/src/index.vue.d.ts +14 -2
  30. package/components/templates-default/index.cjs +40 -146
  31. package/components/templates-default/index.mjs +41 -147
  32. package/components/templates-default/src/index.vue.d.ts +0 -2
  33. package/components/templates-element-plus/index.cjs +8 -8
  34. package/components/templates-element-plus/index.mjs +9 -9
  35. package/components/templates-esri/index.cjs +5 -5
  36. package/components/templates-esri/index.mjs +6 -6
  37. package/components/templates-variant/index.cjs +7 -7
  38. package/components/templates-variant/index.mjs +8 -8
  39. package/composables/index.cjs +46 -0
  40. package/composables/index.d.ts +3 -0
  41. package/composables/index.mjs +44 -2
  42. package/composables/useComputedReadonly.d.ts +4 -0
  43. package/composables/useForm.d.ts +1 -4
  44. package/composables/useRendererData.d.ts +13 -0
  45. package/composables/useTemplateInstances.d.ts +3 -0
  46. package/index.css +5 -9
  47. package/package.json +6 -19
  48. package/components/form-item-renderer/src/symbols.d.ts +0 -3
  49. package/components/geoinput/index.cjs +0 -95
  50. package/components/geoinput/index.d.ts +0 -4
  51. package/components/geoinput/index.mjs +0 -89
  52. package/components/geoinput/src/ctx.d.ts +0 -240
  53. package/components/geoinput/src/index.vue.d.ts +0 -546
  54. package/components/geoinput/src/types.d.ts +0 -12
  55. package/components/geoinput-read/index.cjs +0 -304
  56. package/components/geoinput-read/index.css +0 -8
  57. package/components/geoinput-read/index.d.ts +0 -5
  58. package/components/geoinput-read/index.mjs +0 -297
  59. package/components/geoinput-read/src/append.vue.d.ts +0 -341
  60. package/components/geoinput-read/src/core.vue.d.ts +0 -667
  61. package/components/geoinput-read/src/ctx.d.ts +0 -211
  62. package/components/geoinput-read/src/index.vue.d.ts +0 -1219
  63. package/components/geoinput-read/src/types.d.ts +0 -3
  64. package/components/templates-mapbox/index.cjs +0 -65
  65. package/components/templates-mapbox/index.d.ts +0 -4
  66. package/components/templates-mapbox/index.mjs +0 -59
  67. package/components/templates-mapbox/src/index.vue.d.ts +0 -43
  68. package/components/templates-mapbox/src/types.d.ts +0 -3
  69. package/shared/const/index.d.ts +0 -4
  70. package/shared/element-plus/ctx.d.ts +0 -26
  71. package/shared/element-plus/index.d.ts +0 -3
  72. package/shared/element-plus/instances.d.ts +0 -202
  73. package/shared/element-plus/version.d.ts +0 -1
  74. package/shared/form/index.d.ts +0 -18
  75. package/shared/helper/index.d.ts +0 -4
  76. package/shared/index.d.ts +0 -2
  77. package/shared/infer-prop/index.d.ts +0 -17
  78. package/shared/progress-it/index.d.ts +0 -16
  79. package/shared/rules/index.d.ts +0 -35
  80. package/shared/types/form/checkbox.d.ts +0 -13
  81. package/shared/types/form/index.d.ts +0 -2
  82. package/shared/types/form/radio.d.ts +0 -8
  83. package/shared/types/index.d.ts +0 -2
  84. package/shared/types/source/index.d.ts +0 -21
  85. package/shared/types/source-manager/index.d.ts +0 -6
  86. package/shared/upload/index.d.ts +0 -7
@@ -1,304 +0,0 @@
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;
@@ -1,8 +0,0 @@
1
- .vk-geoinput-read-x{
2
- display: flex;
3
- flex-direction: column-reverse;
4
- margin-bottom: 18px;
5
- }
6
- .vk-geoinput-read-map{
7
- height: 300px;
8
- }
@@ -1,5 +0,0 @@
1
- import VkfGeoinputRead from './src/index.vue';
2
- export * as __VkfGeoinputRead from './src/types';
3
- export * as _VkfGeoinputReadCtx from './src/ctx';
4
- export { VkfGeoinputRead, };
5
- export default VkfGeoinputRead;
@@ -1,297 +0,0 @@
1
- import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createVNode, computed, createElementBlock, 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 { pickObject } from '@vunk/core/shared/utils-object';
8
- import { ElButton, ElIcon, ElButtonGroup } from 'element-plus';
9
- import { m as map_location_default } from '../index2.mjs';
10
- import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
11
- import { VmGeojsonLayer, _VmGeojsonLayerCtx as _VmGeojsonLayerCtx$1, useMap, VmTdtLayers, VmMap } from '@vumap/core';
12
- import { fitGeojson } from '@vumap/core/shared/utils';
13
-
14
- const props = {
15
- ..._VkfInputCtx.props,
16
- ..._VmGeojsonLayerCtx.props,
17
- modelValue: {
18
- type: Object,
19
- default: () => EMPTY_FEATURE_COLLECTION
20
- },
21
- editStyles: {
22
- type: Array,
23
- default: () => []
24
- },
25
- editTypes: {
26
- type: [Array, String],
27
- default: "polygon"
28
- },
29
- paint: {
30
- type: Object,
31
- default: void 0
32
- },
33
- type: {
34
- type: String,
35
- default: void 0
36
- },
37
- custom: {
38
- type: Boolean,
39
- default: false
40
- },
41
- showMap: {
42
- type: Boolean,
43
- default: false
44
- }
45
- };
46
- const createBindProps = bindPropsFactory(props);
47
- const emits = {
48
- ...pickObject(_VmGeojsonLayerCtx.emits, {
49
- excludes: ["click"]
50
- }),
51
- ..._VkfInputCtx.emits,
52
- "layerChange": (layer) => layer,
53
- "update:modelValue": (e) => e,
54
- "layerClick": (e) => e
55
- };
56
- const createOnEmits = onEmitsFactory(emits);
57
-
58
- var ctx = /*#__PURE__*/Object.freeze({
59
- __proto__: null,
60
- createBindProps: createBindProps,
61
- createOnEmits: createOnEmits,
62
- emits: emits,
63
- props: props
64
- });
65
-
66
- var _sfc_main$2 = defineComponent({
67
- components: {
68
- ElButton,
69
- ElIcon,
70
- ElButtonGroup,
71
- MapLocation: map_location_default
72
- },
73
- emits: {
74
- mapLocationClick: null
75
- }
76
- });
77
-
78
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
79
- const _component_MapLocation = resolveComponent("MapLocation");
80
- const _component_ElIcon = resolveComponent("ElIcon");
81
- const _component_ElButton = resolveComponent("ElButton");
82
- const _component_ElButtonGroup = resolveComponent("ElButtonGroup");
83
- return openBlock(), createBlock(_component_ElButtonGroup, null, {
84
- default: withCtx(() => [
85
- createVNode(_component_ElButton, {
86
- class: "vk-geoinput-read-map-location-x",
87
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("mapLocationClick"))
88
- }, {
89
- default: withCtx(() => [
90
- createVNode(_component_ElIcon, { color: "var(--el-color-primary)" }, {
91
- default: withCtx(() => [
92
- createVNode(_component_MapLocation)
93
- ]),
94
- _: 1
95
- /* STABLE */
96
- })
97
- ]),
98
- _: 1
99
- /* STABLE */
100
- })
101
- ]),
102
- _: 1
103
- /* STABLE */
104
- });
105
- }
106
- var AppendVue = /* @__PURE__ */ _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"]]);
107
-
108
- var _sfc_main$1 = /* @__PURE__ */ defineComponent({
109
- name: "VkfGeoinputReadCore",
110
- components: {
111
- VkfInput,
112
- VmGeojsonLayer,
113
- ElIcon,
114
- MapLocation: map_location_default
115
- },
116
- emits,
117
- props,
118
- setup(props2, {
119
- emit
120
- }) {
121
- const inputBindProps = _VkfInputCtx.createBindProps(props2, ["inputSlots", "readonly", "modelValue", "type", "id"]);
122
- const inputOnEmits = _VkfInputCtx.createOnEmits(emit, ["update:modelValue"]);
123
- const mapBindProps = _VmGeojsonLayerCtx$1.createBindProps(props2, ["data", "type", "paint"]);
124
- const mapOnEmits = _VmGeojsonLayerCtx$1.createOnEmits(emit, ["change"]);
125
- const map = useMap();
126
- const geoType = computed(() => {
127
- if (props2.type) return props2.type;
128
- const typeRaw = props2.modelValue?.features[0]?.geometry?.type;
129
- const typeRawTo = {
130
- LineString: "line",
131
- Polygon: "fill",
132
- MultiLineString: "line",
133
- MultiPolygon: "fill"
134
- };
135
- return typeRawTo[typeRaw] || "fill";
136
- });
137
- const paintFromEditStyles = computed(() => {
138
- return props2.editStyles.reduce((a, c) => {
139
- if (geoType.value === "fill") {
140
- if (c.id.includes("polygon-fill-inactive") || c.id.includes("polygon-stroke-inactive")) {
141
- const cPaint = c.paint;
142
- a = {
143
- ...a,
144
- ...cPaint
145
- };
146
- }
147
- }
148
- if (geoType.value === "line") {
149
- if (c.id.includes("line-inactive")) {
150
- const cPaint = c.paint;
151
- a = {
152
- ...a,
153
- ...cPaint
154
- };
155
- }
156
- }
157
- return a;
158
- }, {});
159
- });
160
- const mapFit = () => {
161
- fitGeojson(map, props2.modelValue, {
162
- duration: 1500
163
- });
164
- };
165
- const append = () => createVNode(AppendVue, {
166
- "onMapLocationClick": mapFit
167
- }, null);
168
- return {
169
- mapFit,
170
- inputBindProps,
171
- inputOnEmits,
172
- mapBindProps,
173
- mapOnEmits,
174
- append,
175
- geoType,
176
- paintFromEditStyles
177
- };
178
- }
179
- });
180
-
181
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
182
- const _component_VkfInput = resolveComponent("VkfInput");
183
- const _component_MapLocation = resolveComponent("MapLocation");
184
- const _component_ElIcon = resolveComponent("ElIcon");
185
- const _component_VmGeojsonLayer = resolveComponent("VmGeojsonLayer");
186
- return openBlock(), createElementBlock(
187
- Fragment,
188
- null,
189
- [
190
- withDirectives(createVNode(_component_VkfInput, mergeProps({
191
- readonly: true,
192
- modelValue: JSON.stringify(_ctx.modelValue)
193
- }, _ctx.inputBindProps, toHandlers(_ctx.inputOnEmits), {
194
- inputSlots: {
195
- append: _ctx.append
196
- }
197
- }), null, 16, ["modelValue", "inputSlots"]), [
198
- [vShow, !_ctx.custom]
199
- ]),
200
- _ctx.custom ? renderSlot(_ctx.$slots, "default", {
201
- key: 0,
202
- mapFit: _ctx.mapFit
203
- }, () => [
204
- createVNode(_component_ElIcon, {
205
- color: "var(--el-color-primary)",
206
- onClick: _ctx.mapFit
207
- }, {
208
- default: withCtx(() => [
209
- createVNode(_component_MapLocation)
210
- ]),
211
- _: 1
212
- /* STABLE */
213
- }, 8, ["onClick"])
214
- ]) : createCommentVNode("v-if", true),
215
- createVNode(_component_VmGeojsonLayer, mergeProps(_ctx.mapBindProps, {
216
- data: _ctx.modelValue,
217
- type: _ctx.geoType,
218
- paint: _ctx.paint || _ctx.paintFromEditStyles
219
- }, toHandlers(_ctx.mapOnEmits), {
220
- onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("layerChange", $event)),
221
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("layerClick", $event))
222
- }), null, 16, ["data", "type", "paint"])
223
- ],
224
- 64
225
- /* STABLE_FRAGMENT */
226
- );
227
- }
228
- var CoreVue = /* @__PURE__ */ _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"]]);
229
-
230
- var _sfc_main = defineComponent({
231
- name: "VkfGeoinputRead",
232
- components: {
233
- CoreVue,
234
- VkWrapper,
235
- VmTdtLayers
236
- },
237
- props,
238
- emits,
239
- setup(props2, { emit }) {
240
- const coreBindProps = createBindProps(props2);
241
- const coreOnEmits = createOnEmits(emit);
242
- return {
243
- VmMap,
244
- coreBindProps,
245
- coreOnEmits
246
- };
247
- }
248
- });
249
-
250
- const _hoisted_1 = { class: "vk-geoinput-read-x" };
251
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
252
- const _component_VmTdtLayers = resolveComponent("VmTdtLayers");
253
- const _component_CoreVue = resolveComponent("CoreVue");
254
- const _component_VkWrapper = resolveComponent("VkWrapper");
255
- return openBlock(), createElementBlock("div", _hoisted_1, [
256
- createVNode(_component_VkWrapper, {
257
- is: _ctx.VmMap,
258
- show: _ctx.showMap,
259
- className: "vk-geoinput-read-map"
260
- }, {
261
- default: withCtx(() => [
262
- renderSlot(_ctx.$slots, "map", {}, () => [
263
- _ctx.showMap ? (openBlock(), createBlock(_component_VmTdtLayers, {
264
- key: 0,
265
- type: "vec_w"
266
- })) : createCommentVNode("v-if", true)
267
- ]),
268
- createVNode(
269
- _component_CoreVue,
270
- mergeProps(_ctx.coreBindProps, toHandlers(_ctx.coreOnEmits)),
271
- {
272
- default: withCtx((e) => [
273
- renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(e)))
274
- ]),
275
- _: 3
276
- /* FORWARDED */
277
- },
278
- 16
279
- /* FULL_PROPS */
280
- )
281
- ]),
282
- _: 3
283
- /* FORWARDED */
284
- }, 8, ["is", "show"])
285
- ]);
286
- }
287
- var VkfGeoinputRead = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/geoinput-read/src/index.vue"]]);
288
-
289
- var types = /*#__PURE__*/Object.freeze({
290
- __proto__: null
291
- });
292
-
293
- VkfGeoinputRead.install = (app) => {
294
- app.component(VkfGeoinputRead.name, VkfGeoinputRead);
295
- };
296
-
297
- export { VkfGeoinputRead, ctx as _VkfGeoinputReadCtx, types as __VkfGeoinputRead, VkfGeoinputRead as default };