@vunk/form 2.18.2 → 2.19.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.
Files changed (320) hide show
  1. package/components/_plugin-vue_export-helper.cjs +1 -11
  2. package/components/api-tables-select/index.cjs +1 -467
  3. package/components/api-tables-select/index.mjs +56 -413
  4. package/components/api-tables-select/src/ctx.d.ts +147 -173
  5. package/components/api-tables-select/src/index.vue.d.ts +390 -983
  6. package/components/button/index.cjs +1 -112
  7. package/components/button/index.mjs +56 -85
  8. package/components/button/src/ctx.d.ts +28 -113
  9. package/components/button/src/index.vue.d.ts +314 -621
  10. package/components/card-input-collection/index.cjs +1 -370
  11. package/components/card-input-collection/index.mjs +175 -277
  12. package/components/card-input-collection/src/core.vue.d.ts +57 -950
  13. package/components/card-input-collection/src/ctx.d.ts +19 -49
  14. package/components/card-input-collection/src/index.vue.d.ts +49 -112
  15. package/components/cascader/index.cjs +1 -150
  16. package/components/cascader/index.mjs +88 -116
  17. package/components/cascader/src/ctx.d.ts +148 -207
  18. package/components/cascader/src/index.vue.d.ts +335 -525
  19. package/components/cascader/src/use.d.ts +1 -1
  20. package/components/checkbox/index.cjs +1 -152
  21. package/components/checkbox/index.mjs +75 -119
  22. package/components/checkbox/src/ctx.d.ts +46 -69
  23. package/components/checkbox/src/index.vue.d.ts +445 -1012
  24. package/components/cloneDeep.cjs +1 -2106
  25. package/components/color-picker/index.cjs +1 -80
  26. package/components/color-picker/index.mjs +46 -69
  27. package/components/color-picker/src/ctx.d.ts +138 -107
  28. package/components/color-picker/src/index.vue.d.ts +305 -255
  29. package/components/date-picker/index.cjs +1 -119
  30. package/components/date-picker/index.mjs +63 -97
  31. package/components/date-picker/src/ctx.d.ts +131 -206
  32. package/components/date-picker/src/index.vue.d.ts +287 -1359
  33. package/components/date-picker/src/types.d.ts +7 -7
  34. package/components/date-picker-range/index.cjs +1 -177
  35. package/components/date-picker-range/index.mjs +62 -113
  36. package/components/date-picker-range/src/ctx.d.ts +139 -207
  37. package/components/date-picker-range/src/index.vue.d.ts +896 -450
  38. package/components/debounce.cjs +1 -0
  39. package/components/dialog/index.cjs +1 -126
  40. package/components/dialog/index.mjs +65 -99
  41. package/components/dialog/src/ctx.d.ts +17 -108
  42. package/components/dialog/src/index.vue.d.ts +77 -1070
  43. package/components/dialog-input-collection/index.cjs +1 -624
  44. package/components/dialog-input-collection/index.mjs +276 -498
  45. package/components/dialog-input-collection/src/ctx.d.ts +20 -50
  46. package/components/dialog-input-collection/src/dialog-form.vue.d.ts +28 -6366
  47. package/components/dialog-input-collection/src/index.vue.d.ts +66 -7629
  48. package/components/dialog-input-collection/src/layout.vue.d.ts +16 -72
  49. package/components/download-plus/index.cjs +1 -456
  50. package/components/download-plus/index.mjs +214 -358
  51. package/components/download-plus/src/ctx.d.ts +20 -50
  52. package/components/download-plus/src/index.vue.d.ts +434 -1171
  53. package/components/editable-text/index.cjs +1 -295
  54. package/components/editable-text/index.mjs +113 -239
  55. package/components/editable-text/src/ctx.d.ts +20 -50
  56. package/components/editable-text/src/index.vue.d.ts +62 -3257
  57. package/components/el-slider/index.cjs +1 -0
  58. package/components/el-slider/index.d.ts +5 -0
  59. package/components/el-slider/index.mjs +475 -0
  60. package/components/el-slider/src/button.d.ts +36 -0
  61. package/components/el-slider/src/button.vue.d.ts +42 -0
  62. package/components/el-slider/src/composables/index.cjs +1 -0
  63. package/components/el-slider/src/composables/index.d.ts +6 -0
  64. package/components/el-slider/src/composables/index.mjs +9 -0
  65. package/components/el-slider/src/composables/use-lifecycle.d.ts +4 -0
  66. package/components/el-slider/src/composables/use-marks.d.ts +7 -0
  67. package/components/el-slider/src/composables/use-slide.d.ts +23 -0
  68. package/components/el-slider/src/composables/use-slider-button.d.ts +18 -0
  69. package/components/el-slider/src/composables/use-stops.d.ts +8 -0
  70. package/components/el-slider/src/composables/use-watch.d.ts +4 -0
  71. package/components/el-slider/src/constants.d.ts +14 -0
  72. package/components/el-slider/src/marker.d.ts +37 -0
  73. package/components/el-slider/src/slider-core.vue.d.ts +219 -0
  74. package/components/el-slider/src/slider.d.ts +175 -0
  75. package/components/esri-input-geojson/index.cjs +2 -1604
  76. package/components/esri-input-geojson/index.mjs +666 -1289
  77. package/components/esri-input-geojson/src/append.vue.d.ts +225 -1084
  78. package/components/esri-input-geojson/src/const.d.ts +1 -1
  79. package/components/esri-input-geojson/src/ctx.d.ts +62 -158
  80. package/components/esri-input-geojson/src/default-view.vue.d.ts +12 -132
  81. package/components/esri-input-geojson/src/index.vue.d.ts +1470 -789
  82. package/components/esri-input-geojson/src/viewer.vue.d.ts +424 -287
  83. package/components/fieldset/index.cjs +1 -110
  84. package/components/fieldset/index.mjs +62 -77
  85. package/components/fieldset/src/ctx.d.ts +4 -4
  86. package/components/fieldset/src/index.vue.d.ts +10 -9
  87. package/components/form/index.cjs +1 -248
  88. package/components/form/index.mjs +107 -161
  89. package/components/form/src/ctx.d.ts +15 -64
  90. package/components/form/src/index.vue.d.ts +360 -2416
  91. package/components/form-item/index.cjs +1 -294
  92. package/components/form-item/index.mjs +139 -229
  93. package/components/form-item/src/core.vue.d.ts +33 -1853
  94. package/components/form-item/src/ctx.d.ts +17 -47
  95. package/components/form-item/src/index.vue.d.ts +41 -103
  96. package/components/form-item-renderer/index.cjs +1 -193
  97. package/components/form-item-renderer/index.mjs +102 -162
  98. package/components/form-item-renderer/src/core.vue.d.ts +12 -11
  99. package/components/form-item-renderer/src/ctx.d.ts +3 -3
  100. package/components/form-item-renderer/src/index.vue.d.ts +25 -73
  101. package/components/form-item-renderer-template/index.cjs +1 -47
  102. package/components/form-item-renderer-template/index.mjs +19 -33
  103. package/components/form-item-renderer-template/src/index.vue.d.ts +4 -3
  104. package/components/forms-provider/index.cjs +1 -99
  105. package/components/forms-provider/index.mjs +44 -73
  106. package/components/forms-provider/src/core.d.ts +3 -2
  107. package/components/forms-provider/src/index.vue.d.ts +5 -2
  108. package/components/forms-provider/src/segment.vue.d.ts +12 -8
  109. package/components/forms-provider/src/view.vue.d.ts +17 -3
  110. package/components/index.cjs +1 -399
  111. package/components/index2.cjs +1 -17
  112. package/components/information/index.cjs +1 -65
  113. package/components/information/index.mjs +28 -38
  114. package/components/information/src/ctx.d.ts +2 -2
  115. package/components/information/src/index.vue.d.ts +7 -6
  116. package/components/information-collection/index.cjs +1 -81
  117. package/components/information-collection/index.mjs +44 -48
  118. package/components/information-collection/src/ctx.d.ts +20 -50
  119. package/components/information-collection/src/index.vue.d.ts +49 -112
  120. package/components/information-renderer/index.cjs +1 -16
  121. package/components/information-renderer/index.mjs +9 -10
  122. package/components/information-tag/index.cjs +1 -101
  123. package/components/information-tag/index.mjs +44 -54
  124. package/components/information-tag/src/ctx.d.ts +5 -19
  125. package/components/information-tag/src/index.vue.d.ts +24 -51
  126. package/components/information-templates-default/index.cjs +1 -101
  127. package/components/information-templates-default/index.mjs +63 -73
  128. package/components/information-templates-default/src/index.vue.d.ts +2 -1
  129. package/components/input/index.cjs +1 -115
  130. package/components/input/index.mjs +60 -83
  131. package/components/input/src/ctx.d.ts +50 -151
  132. package/components/input/src/index.vue.d.ts +389 -947
  133. package/components/input-array/index.cjs +1 -310
  134. package/components/input-array/index.mjs +114 -244
  135. package/components/input-array/src/ctx.d.ts +19 -49
  136. package/components/input-array/src/form-template.vue.d.ts +2 -901
  137. package/components/input-array/src/index.vue.d.ts +45 -731
  138. package/components/input-collection/index.cjs +1 -452
  139. package/components/input-collection/index.mjs +195 -355
  140. package/components/input-collection/src/core.vue.d.ts +59 -1019
  141. package/components/input-collection/src/ctx.d.ts +19 -49
  142. package/components/input-collection/src/index.vue.d.ts +47 -110
  143. package/components/input-file/index.cjs +1 -142
  144. package/components/input-file/index.mjs +68 -100
  145. package/components/input-file/src/ctx.d.ts +8 -29
  146. package/components/input-file/src/index.vue.d.ts +447 -76
  147. package/components/input-file/src/template.vue.d.ts +2 -124
  148. package/components/input-link/index.cjs +1 -167
  149. package/components/input-link/index.mjs +60 -83
  150. package/components/input-link/src/ctx.d.ts +48 -135
  151. package/components/input-link/src/index.vue.d.ts +835 -312
  152. package/components/input-number/index.cjs +1 -119
  153. package/components/input-number/index.mjs +73 -87
  154. package/components/input-number/src/ctx.d.ts +38 -131
  155. package/components/input-number/src/index.vue.d.ts +321 -682
  156. package/components/input-tag/index.cjs +1 -100
  157. package/components/input-tag/index.mjs +51 -78
  158. package/components/input-tag/src/ctx.d.ts +41 -143
  159. package/components/input-tag/src/index.vue.d.ts +322 -775
  160. package/components/isObject.cjs +1 -165
  161. package/components/monaco-editor/index.cjs +1 -83
  162. package/components/monaco-editor/index.mjs +40 -59
  163. package/components/monaco-editor/src/ctx.d.ts +19 -44
  164. package/components/monaco-editor/src/index.vue.d.ts +212 -111
  165. package/components/radio/index.cjs +1 -267
  166. package/components/radio/index.mjs +110 -209
  167. package/components/radio/src/ctx.d.ts +27 -91
  168. package/components/radio/src/index.vue.d.ts +299 -1279
  169. package/components/radio/src/option.vue.d.ts +28 -878
  170. package/components/radio/src/wraper.vue.d.ts +67 -198
  171. package/components/renderer-data/index.cjs +1 -41
  172. package/components/renderer-data/index.mjs +19 -26
  173. package/components/renderer-data/src/ctx.d.ts +1 -1
  174. package/components/renderer-data/src/index.vue.d.ts +5 -4
  175. package/components/select/index.cjs +1 -311
  176. package/components/select/index.mjs +156 -214
  177. package/components/select/src/core.vue.d.ts +446 -1028
  178. package/components/select/src/ctx.d.ts +60 -215
  179. package/components/select/src/index.vue.d.ts +318 -593
  180. package/components/select/src/options.vue.d.ts +4 -3
  181. package/components/slider/index.cjs +1 -88
  182. package/components/slider/index.mjs +41 -70
  183. package/components/slider/src/ctx.d.ts +63 -174
  184. package/components/slider/src/index.vue.d.ts +154 -419
  185. package/components/style.css +1 -0
  186. package/components/switch/index.cjs +1 -88
  187. package/components/switch/index.mjs +37 -69
  188. package/components/switch/src/ctx.d.ts +30 -109
  189. package/components/switch/src/index.vue.d.ts +90 -697
  190. package/components/switch/src/types.d.ts +2 -2
  191. package/components/tables-select/index.cjs +1 -263
  192. package/components/tables-select/index.mjs +101 -172
  193. package/components/tables-select/src/ctx.d.ts +68 -99
  194. package/components/tables-select/src/index.vue.d.ts +233 -4988
  195. package/components/template-instances-provider/index.cjs +1 -31
  196. package/components/template-instances-provider/index.mjs +18 -22
  197. package/components/template-instances-provider/src/index.vue.d.ts +5 -4
  198. package/components/templates-default/index.cjs +1 -235
  199. package/components/templates-default/index.mjs +152 -211
  200. package/components/templates-default/src/ctx.d.ts +2 -2
  201. package/components/templates-default/src/index.vue.d.ts +7337 -145
  202. package/components/templates-element-plus/index.cjs +1 -112
  203. package/components/templates-element-plus/index.mjs +49 -91
  204. package/components/templates-element-plus/src/ctx.d.ts +1 -1
  205. package/components/templates-element-plus/src/index.vue.d.ts +59 -251
  206. package/components/templates-esri/index.cjs +1 -65
  207. package/components/templates-esri/index.mjs +29 -39
  208. package/components/templates-esri/src/ctx.d.ts +1 -1
  209. package/components/templates-esri/src/index.vue.d.ts +2184 -25
  210. package/components/templates-layout/index.cjs +1 -137
  211. package/components/templates-layout/index.mjs +78 -116
  212. package/components/templates-layout/src/ctx.d.ts +1 -1
  213. package/components/templates-layout/src/index.vue.d.ts +73 -404
  214. package/components/templates-variant/index.cjs +1 -70
  215. package/components/templates-variant/index.mjs +33 -43
  216. package/components/templates-variant/src/ctx.d.ts +1 -1
  217. package/components/templates-variant/src/index.vue.d.ts +1272 -25
  218. package/components/time-picker/index.cjs +1 -104
  219. package/components/time-picker/index.mjs +57 -87
  220. package/components/time-picker/src/ctx.d.ts +130 -212
  221. package/components/time-picker/src/index.vue.d.ts +283 -1371
  222. package/components/upload/index.cjs +1 -663
  223. package/components/upload/index.mjs +343 -537
  224. package/components/upload/src/ctx.d.ts +106 -191
  225. package/components/upload/src/file.vue.d.ts +168 -745
  226. package/components/upload/src/index.vue.d.ts +647 -1888
  227. package/components/upload/src/types.d.ts +1 -1
  228. package/components/upload/src/wraper.vue.d.ts +233 -407
  229. package/components/upload-plus/index.cjs +21 -18673
  230. package/components/upload-plus/index.mjs +4566 -18366
  231. package/components/upload-plus/src/api.d.ts +1 -1
  232. package/components/upload-plus/src/ctx.d.ts +21 -51
  233. package/components/upload-plus/src/index.vue.d.ts +53 -1657
  234. package/components/use-watch.cjs +1 -0
  235. package/components/van-cascader/index.cjs +1 -125
  236. package/components/van-cascader/index.mjs +51 -96
  237. package/components/van-cascader/src/ctx.d.ts +143 -203
  238. package/components/van-cascader/src/index.vue.d.ts +332 -988
  239. package/components/var-datetime-picker/index.cjs +1 -333
  240. package/components/var-datetime-picker/index.mjs +173 -254
  241. package/components/var-datetime-picker/src/ctx.d.ts +18 -48
  242. package/components/var-datetime-picker/src/index.vue.d.ts +628 -1090
  243. package/components/vditor/index.cjs +1 -86
  244. package/components/vditor/index.mjs +40 -66
  245. package/components/vditor/src/ctx.d.ts +15 -45
  246. package/components/vditor/src/index.vue.d.ts +195 -120
  247. package/composables/element-plus/index.cjs +1 -23
  248. package/composables/element-plus/index.mjs +14 -18
  249. package/composables/index.cjs +1 -161
  250. package/composables/index.d.ts +1 -0
  251. package/composables/index.mjs +100 -135
  252. package/composables/useForm.d.ts +2 -2
  253. package/composables/useRtl.d.ts +18 -0
  254. package/composables/useTemplateInstances.d.ts +3 -3
  255. package/index.css +1 -562
  256. package/index.d.ts +0 -3
  257. package/index.esm.js +23 -48
  258. package/locale/index.cjs +1 -102
  259. package/locale/index.mjs +34 -34
  260. package/locale/lang/index.cjs +1 -2
  261. package/locale/lang/index.d.ts +1 -0
  262. package/package.json +14 -85
  263. package/shared/const/index.cjs +1 -59
  264. package/shared/const/index.d.ts +1 -1
  265. package/shared/const/index.mjs +18 -20
  266. package/shared/element-plus/ctx.d.ts +40 -37
  267. package/shared/element-plus/index.cjs +1 -211
  268. package/shared/element-plus/index.mjs +93 -161
  269. package/shared/element-plus/instances.d.ts +224 -321
  270. package/shared/form/index.cjs +1 -33
  271. package/shared/form/index.mjs +23 -25
  272. package/shared/helper/index.cjs +1 -11
  273. package/shared/helper/index.mjs +7 -8
  274. package/shared/index.cjs +1 -8
  275. package/shared/index.mjs +5 -1
  276. package/shared/infer-prop/index.cjs +1 -36
  277. package/shared/infer-prop/index.mjs +22 -28
  278. package/shared/progress-it/index.cjs +1 -42
  279. package/shared/progress-it/index.mjs +15 -31
  280. package/shared/rules/index.cjs +1 -56
  281. package/shared/rules/index.mjs +19 -18
  282. package/shared/types/form/index.cjs +1 -2
  283. package/shared/types/index.cjs +1 -2
  284. package/shared/types/source/index.cjs +1 -2
  285. package/shared/types/source-manager/index.cjs +1 -2
  286. package/shared/upload/index.cjs +1 -774
  287. package/shared/upload/index.mjs +180 -764
  288. package/component.d.ts +0 -3
  289. package/components/_plugin-vue_export-helper.mjs +0 -9
  290. package/components/card-input-collection/index.css +0 -21
  291. package/components/cascader/index.css +0 -9
  292. package/components/checkbox/index.css +0 -30
  293. package/components/cloneDeep.mjs +0 -2104
  294. package/components/date-picker-range/index.css +0 -18
  295. package/components/dialog-input-collection/index.css +0 -21
  296. package/components/download-plus/index.css +0 -68
  297. package/components/editable-text/index.css +0 -9
  298. package/components/esri-input-geojson/index.css +0 -32
  299. package/components/fieldset/index.css +0 -5
  300. package/components/form-item/index.css +0 -35
  301. package/components/index.mjs +0 -378
  302. package/components/index2.mjs +0 -14
  303. package/components/information-tag/index.css +0 -6
  304. package/components/information-templates-default/index.css +0 -16
  305. package/components/input-array/index.css +0 -14
  306. package/components/input-collection/index.css +0 -20
  307. package/components/input-link/index.css +0 -4
  308. package/components/input-number/index.css +0 -13
  309. package/components/isObject.mjs +0 -158
  310. package/components/monaco-editor/index.css +0 -4
  311. package/components/radio/index.css +0 -40
  312. package/components/select/index.css +0 -15
  313. package/components/switch/index.css +0 -10
  314. package/components/tables-select/index.css +0 -3
  315. package/components/templates-layout/index.css +0 -3
  316. package/components/upload/index.css +0 -34
  317. package/components/upload-plus/index.css +0 -84
  318. package/components/van-cascader/index.css +0 -6
  319. package/components/var-datetime-picker/index.css +0 -17
  320. package/defaults.d.ts +0 -5
@@ -1,52 +1,39 @@
1
- import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createVNode, createCommentVNode, renderSlot, provide, resolveDynamicComponent, normalizeProps, mergeProps, ref, shallowRef, computed, watch, onMounted, nextTick, createElementBlock, toHandlers, withDirectives, createElementVNode, vShow } from 'vue';
2
- import { _VkfInputCtx, VkfInput } from '@vunk/form/components/input';
3
- import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
4
- import { ElButton, ElIcon, ElButtonGroup, ElUpload, ElMessage } from 'element-plus';
5
- import { u as upload_default, e as edit_default, m as map_location_default, f as document_checked_default } from '../index.mjs';
6
- import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
7
- import { VaTdtBasemap, VaMapView, VaSketch, VaGraphicsLayer } from '@vuesri/core';
8
- import MapView from '@arcgis/core/views/MapView';
9
- import SceneView from '@arcgis/core/views/SceneView';
10
- import { VkAsyncTeleport } from '@vunk/core';
11
- import Graphic from '@arcgis/core/Graphic';
12
- import { useComputedReadonly } from '@vunk/form/composables';
13
- import { useLocale } from '@vunk/form/composables/element-plus';
14
- import { Deferred } from '@vunk/core/shared/utils-promise';
15
-
16
- var EDIT_TYPE = /* @__PURE__ */ ((EDIT_TYPE2) => {
17
- EDIT_TYPE2["POINT"] = "point";
18
- EDIT_TYPE2["POLYGON"] = "polygon";
19
- EDIT_TYPE2["LINE_STRING"] = "line_string";
20
- return EDIT_TYPE2;
21
- })(EDIT_TYPE || {});
22
- const EDIT_TYPE_OPTIONS = [
1
+ import { defineComponent as F, resolveComponent as h, openBlock as w, createBlock as _, withCtx as v, createVNode as y, createCommentVNode as O, unref as te, renderSlot as A, provide as G, resolveDynamicComponent as Te, normalizeProps as Re, mergeProps as fe, ref as N, shallowRef as k, computed as ne, watch as oe, onMounted as Fe, nextTick as Le, createElementBlock as $e, toHandlers as Be, withDirectives as Ue, createElementVNode as re, vShow as Ge } from "vue";
2
+ import { _VkfInputCtx as T, VkfInput as Ne } from "@vunk/form/components/input";
3
+ import { bindPropsFactory as De, onEmitsFactory as Je } from "@vunk/core/shared/utils-vue";
4
+ import { ElUpload as qe, ElButtonGroup as ze, ElIcon as Ze, ElButton as He, ElMessage as ae } from "element-plus";
5
+ import { k as xe, e as Ye, l as Xe, n as Ke } from "../index.cjs";
6
+ import { _ as Y } from "../_plugin-vue_export-helper.cjs";
7
+ import { VaMapView as ce, VaTdtBasemap as de, VaGraphicsLayer as Qe, VaSketch as We } from "@vuesri/core";
8
+ import je from "@arcgis/core/views/MapView";
9
+ import et from "@arcgis/core/views/SceneView";
10
+ import { VkAsyncTeleport as tt } from "@vunk/core";
11
+ import nt from "@arcgis/core/Graphic";
12
+ import { useComputedReadonly as ot } from "@vunk/form/composables";
13
+ import { useLocale as rt } from "@vunk/form/composables/element-plus";
14
+ import { Deferred as at } from "@vunk/core/shared/utils-promise";
15
+ var lt = /* @__PURE__ */ ((e) => (e.POINT = "point", e.POLYGON = "polygon", e.LINE_STRING = "line_string", e))(lt || {});
16
+ const it = [
23
17
  {
24
- label: "\u70B9",
25
- value: "point" /* POINT */,
18
+ label: "",
19
+ value: "point",
26
20
  availableCreatureTools: ["point"]
27
21
  },
28
22
  {
29
- label: "\u7EBF",
30
- value: "line_string" /* LINE_STRING */,
23
+ label: "线",
24
+ value: "line_string",
31
25
  availableCreatureTools: ["polyline"]
32
26
  },
33
27
  {
34
- label: "\u9762",
35
- value: "polygon" /* POLYGON */,
28
+ label: "",
29
+ value: "polygon",
36
30
  availableCreatureTools: ["polygon", "circle", "rectangle"]
37
31
  }
38
- ];
39
- const EDIT_TYPE_REFLECT = EDIT_TYPE_OPTIONS.reduce((acc, cur) => {
40
- acc[cur.value] = cur;
41
- return acc;
42
- }, {});
43
- const EMPTY_FEATURE_COLLECTION = {
32
+ ], le = it.reduce((e, t) => (e[t.value] = t, e), {}), ut = {
44
33
  type: "FeatureCollection",
45
34
  features: []
46
- };
47
-
48
- const props = {
49
- ..._VkfInputCtx.props,
35
+ }, X = {
36
+ ...T.props,
50
37
  viewComponent: null,
51
38
  viewComponentAttrs: null,
52
39
  readonly: {
@@ -78,27 +65,27 @@ const props = {
78
65
  viewModelActivePointSymbol: null,
79
66
  modelValue: {
80
67
  type: Object,
81
- default: () => EMPTY_FEATURE_COLLECTION
68
+ default: () => ut
82
69
  },
83
70
  multiple: {
84
71
  type: Boolean,
85
- default: true
72
+ default: !0
86
73
  },
87
74
  skipSave: {
88
75
  type: Boolean,
89
- default: false
76
+ default: !1
90
77
  },
91
78
  showMap: {
92
79
  type: Boolean,
93
- default: false
80
+ default: !1
94
81
  },
95
82
  dialogEdit: {
96
83
  type: Boolean,
97
- default: true
84
+ default: !0
98
85
  },
99
86
  dialogEditFullscreen: {
100
87
  type: Boolean,
101
- default: true
88
+ default: !0
102
89
  },
103
90
  dialogEditTitle: {
104
91
  type: String,
@@ -106,7 +93,7 @@ const props = {
106
93
  },
107
94
  flying: {
108
95
  type: Boolean,
109
- default: false
96
+ default: !1
110
97
  },
111
98
  layerIndex: {
112
99
  type: Number,
@@ -116,44 +103,37 @@ const props = {
116
103
  type: Object,
117
104
  default: void 0
118
105
  }
119
- };
120
- const createBindProps = bindPropsFactory(props);
121
- const emits = {
122
- ..._VkfInputCtx.emits,
106
+ }, st = De(X), K = {
107
+ ...T.emits,
123
108
  "update:modelValue": (e) => e,
124
109
  "update:flying": null,
125
110
  /**
126
111
  * 点击地图定位按钮
127
112
  */
128
- "appendFly": null,
113
+ appendFly: null,
129
114
  appendEdit: null
130
- };
131
- const createOnEmits = onEmitsFactory(emits);
132
-
133
- var ctx = /*#__PURE__*/Object.freeze({
115
+ }, ft = Je(K), Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
134
116
  __proto__: null,
135
- createBindProps: createBindProps,
136
- createOnEmits: createOnEmits,
137
- emits: emits,
138
- props: props
139
- });
140
-
141
- var _sfc_main$3 = defineComponent({
117
+ createBindProps: st,
118
+ createOnEmits: ft,
119
+ emits: K,
120
+ props: X
121
+ }, Symbol.toStringTag, { value: "Module" })), ct = F({
142
122
  components: {
143
- ElButton,
144
- ElIcon,
145
- ElButtonGroup,
146
- Upload: upload_default,
147
- Edit: edit_default,
148
- ElUpload,
149
- MapLocation: map_location_default
123
+ ElButton: He,
124
+ ElIcon: Ze,
125
+ ElButtonGroup: ze,
126
+ Upload: Xe,
127
+ Edit: Ye,
128
+ ElUpload: qe,
129
+ MapLocation: xe
150
130
  },
151
131
  props: {
152
132
  disabled: Boolean,
153
133
  dialog: Boolean,
154
134
  upload: {
155
135
  type: Boolean,
156
- default: true
136
+ default: !0
157
137
  }
158
138
  },
159
139
  emits: {
@@ -162,120 +142,88 @@ var _sfc_main$3 = defineComponent({
162
142
  fly: null
163
143
  },
164
144
  methods: {
165
- getFile(file) {
166
- this.$emit("upload", file);
145
+ getFile(e) {
146
+ this.$emit("upload", e);
167
147
  },
168
148
  uploadClick(e) {
169
- const target = e.target.querySelector("input[type=file]");
170
- if (!target) return;
171
- target.click();
149
+ const t = e.target.querySelector("input[type=file]");
150
+ t && t.click();
172
151
  }
173
152
  }
174
153
  });
175
-
176
- function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
177
- const _component_Upload = resolveComponent("Upload");
178
- const _component_ElIcon = resolveComponent("ElIcon");
179
- const _component_ElUpload = resolveComponent("ElUpload");
180
- const _component_Edit = resolveComponent("Edit");
181
- const _component_ElButton = resolveComponent("ElButton");
182
- const _component_MapLocation = resolveComponent("MapLocation");
183
- const _component_ElButtonGroup = resolveComponent("ElButtonGroup");
184
- return openBlock(), createBlock(_component_ElButtonGroup, null, {
185
- default: withCtx(() => [
186
- _ctx.upload ? (openBlock(), createBlock(_component_ElUpload, {
154
+ function dt(e, t, o, n, r, a) {
155
+ const l = h("Upload"), i = h("ElIcon"), s = h("ElUpload"), c = h("Edit"), f = h("ElButton"), p = h("MapLocation"), m = h("ElButtonGroup");
156
+ return w(), _(m, null, {
157
+ default: v(() => [
158
+ e.upload ? (w(), _(s, {
187
159
  key: 0,
188
160
  class: "el-button el-button--default vkf-esri-input-geojson__upload",
189
161
  action: "",
190
162
  accept: "file",
191
- multiple: false,
192
- "show-file-list": false,
193
- "auto-upload": false,
194
- "on-change": _ctx.getFile,
195
- disabled: _ctx.disabled,
196
- onClick: _ctx.uploadClick
163
+ multiple: !1,
164
+ "show-file-list": !1,
165
+ "auto-upload": !1,
166
+ "on-change": e.getFile,
167
+ disabled: e.disabled,
168
+ onClick: e.uploadClick
197
169
  }, {
198
- default: withCtx(() => [
199
- createVNode(_component_ElIcon, { color: "var(--el-color-primary)" }, {
200
- default: withCtx(() => [
201
- createVNode(_component_Upload)
170
+ default: v(() => [
171
+ y(i, { color: "var(--el-color-primary)" }, {
172
+ default: v(() => [
173
+ y(l)
202
174
  ]),
203
175
  _: 1
204
- /* STABLE */
205
176
  })
206
177
  ]),
207
178
  _: 1
208
- /* STABLE */
209
- }, 8, ["on-change", "disabled", "onClick"])) : createCommentVNode("v-if", true),
210
- _ctx.dialog ? (openBlock(), createBlock(_component_ElButton, {
179
+ }, 8, ["on-change", "disabled", "onClick"])) : O("", !0),
180
+ e.dialog ? (w(), _(f, {
211
181
  key: 1,
212
- disabled: _ctx.disabled,
213
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("edit"))
182
+ disabled: e.disabled,
183
+ onClick: t[0] || (t[0] = (g) => e.$emit("edit"))
214
184
  }, {
215
- default: withCtx(() => [
216
- createVNode(_component_ElIcon, { color: "var(--el-color-primary)" }, {
217
- default: withCtx(() => [
218
- createVNode(_component_Edit)
185
+ default: v(() => [
186
+ y(i, { color: "var(--el-color-primary)" }, {
187
+ default: v(() => [
188
+ y(c)
219
189
  ]),
220
190
  _: 1
221
- /* STABLE */
222
191
  })
223
192
  ]),
224
193
  _: 1
225
- /* STABLE */
226
- }, 8, ["disabled"])) : createCommentVNode("v-if", true),
227
- createVNode(_component_ElButton, {
228
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("fly"))
194
+ }, 8, ["disabled"])) : O("", !0),
195
+ y(f, {
196
+ onClick: t[1] || (t[1] = (g) => e.$emit("fly"))
229
197
  }, {
230
- default: withCtx(() => [
231
- createVNode(_component_ElIcon, { color: "var(--el-color-primary)" }, {
232
- default: withCtx(() => [
233
- createVNode(_component_MapLocation)
198
+ default: v(() => [
199
+ y(i, { color: "var(--el-color-primary)" }, {
200
+ default: v(() => [
201
+ y(p)
234
202
  ]),
235
203
  _: 1
236
- /* STABLE */
237
204
  })
238
205
  ]),
239
206
  _: 1
240
- /* STABLE */
241
207
  })
242
208
  ]),
243
209
  _: 1
244
- /* STABLE */
245
210
  });
246
211
  }
247
- var AppendVue = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/esri-input-geojson/src/append.vue"]]);
248
-
249
- var _sfc_main$2 = /* @__PURE__ */ defineComponent({
212
+ const pt = /* @__PURE__ */ Y(ct, [["render", dt]]), vt = /* @__PURE__ */ F({
250
213
  __name: "default-view",
251
- setup(__props, { expose: __expose }) {
252
- __expose();
253
- const __returned__ = { get VaTdtBasemap() {
254
- return VaTdtBasemap;
255
- }, get VaMapView() {
256
- return VaMapView;
257
- } };
258
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
259
- return __returned__;
214
+ setup(e) {
215
+ return (t, o) => (w(), _(te(ce), null, {
216
+ default: v(() => [
217
+ y(te(de)),
218
+ A(t.$slots, "default")
219
+ ]),
220
+ _: 3
221
+ }));
260
222
  }
261
- });
262
-
263
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
264
- return openBlock(), createBlock($setup["VaMapView"], null, {
265
- default: withCtx(() => [
266
- createVNode($setup["VaTdtBasemap"]),
267
- renderSlot(_ctx.$slots, "default")
268
- ]),
269
- _: 3
270
- /* FORWARDED */
271
- });
272
- }
273
- var DefaultView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/esri-input-geojson/src/default-view.vue"]]);
274
-
275
- var _sfc_main$1 = defineComponent({
223
+ }), yt = F({
276
224
  components: {
277
- VaTdtBasemap,
278
- VaMapView
225
+ VaTdtBasemap: de,
226
+ VaMapView: ce
279
227
  },
280
228
  props: {
281
229
  view: {
@@ -284,1313 +232,742 @@ var _sfc_main$1 = defineComponent({
284
232
  },
285
233
  viewComponent: {
286
234
  type: [Object, Function],
287
- default: () => DefaultView
235
+ default: () => vt
288
236
  },
289
237
  viewComponentAttrs: {
290
238
  type: Object,
291
239
  default: () => ({})
292
240
  }
293
241
  },
294
- setup(props) {
295
- if (props.view) {
296
- provide("vaView", props.view);
297
- if (props.view instanceof MapView) {
298
- provide("vaMapView", props.view);
299
- }
300
- if (props.view instanceof SceneView) {
301
- provide("vaSceneView", props.view);
302
- }
303
- }
304
- return {};
242
+ setup(e) {
243
+ return e.view && (G("vaView", e.view), e.view instanceof je && G("vaMapView", e.view), e.view instanceof et && G("vaSceneView", e.view)), {};
305
244
  }
306
245
  });
307
-
308
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
309
- return !_ctx.view ? (openBlock(), createBlock(
310
- resolveDynamicComponent(_ctx.viewComponent),
311
- normalizeProps(mergeProps({ key: 0 }, _ctx.viewComponentAttrs)),
312
- {
313
- default: withCtx(() => [
314
- renderSlot(_ctx.$slots, "default")
315
- ]),
316
- _: 3
317
- /* FORWARDED */
318
- },
319
- 16
320
- /* FULL_PROPS */
321
- )) : renderSlot(_ctx.$slots, "default", { key: 1 });
246
+ function ht(e, t, o, n, r, a) {
247
+ return e.view ? A(e.$slots, "default", { key: 1 }) : (w(), _(Te(e.viewComponent), Re(fe({ key: 0 }, e.viewComponentAttrs)), {
248
+ default: v(() => [
249
+ A(e.$slots, "default")
250
+ ]),
251
+ _: 3
252
+ }, 16));
322
253
  }
323
- var ViewerVue = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/esri-input-geojson/src/viewer.vue"]]);
324
-
325
- function array_cancel() {
326
- this._array = null;
327
- return Promise.resolve();
254
+ const mt = /* @__PURE__ */ Y(yt, [["render", ht]]);
255
+ function gt() {
256
+ return this._array = null, Promise.resolve();
328
257
  }
329
-
330
- function array_read() {
331
- var array = this._array;
332
- this._array = null;
333
- return Promise.resolve(array ? {done: false, value: array} : {done: true, value: undefined});
258
+ function wt() {
259
+ var e = this._array;
260
+ return this._array = null, Promise.resolve(e ? { done: !1, value: e } : { done: !0, value: void 0 });
334
261
  }
335
-
336
- function array(array) {
337
- return new ArraySource(array instanceof Uint8Array ? array : new Uint8Array(array));
262
+ function R(e) {
263
+ return new Q(e instanceof Uint8Array ? e : new Uint8Array(e));
338
264
  }
339
-
340
- function ArraySource(array) {
341
- this._array = array;
265
+ function Q(e) {
266
+ this._array = e;
342
267
  }
343
-
344
- ArraySource.prototype.read = array_read;
345
- ArraySource.prototype.cancel = array_cancel;
346
-
347
- function fetchPath(url) {
348
- return fetch(url).then(function(response) {
349
- return response.body && response.body.getReader
350
- ? response.body.getReader()
351
- : response.arrayBuffer().then(array);
268
+ Q.prototype.read = wt;
269
+ Q.prototype.cancel = gt;
270
+ function _t(e) {
271
+ return fetch(e).then(function(t) {
272
+ return t.body && t.body.getReader ? t.body.getReader() : t.arrayBuffer().then(R);
352
273
  });
353
274
  }
354
-
355
- function requestPath(url) {
356
- return new Promise(function(resolve, reject) {
357
- var request = new XMLHttpRequest;
358
- request.responseType = "arraybuffer";
359
- request.onload = function() { resolve(array(request.response)); };
360
- request.onerror = reject;
361
- request.ontimeout = reject;
362
- request.open("GET", url, true);
363
- request.send();
275
+ function bt(e) {
276
+ return new Promise(function(t, o) {
277
+ var n = new XMLHttpRequest();
278
+ n.responseType = "arraybuffer", n.onload = function() {
279
+ t(R(n.response));
280
+ }, n.onerror = o, n.ontimeout = o, n.open("GET", e, !0), n.send();
364
281
  });
365
282
  }
366
-
367
- function path(path) {
368
- return (typeof fetch === "function" ? fetchPath : requestPath)(path);
283
+ function D(e) {
284
+ return (typeof fetch == "function" ? _t : bt)(e);
369
285
  }
370
-
371
- function stream(source) {
372
- return typeof source.read === "function" ? source : source.getReader();
286
+ function ie(e) {
287
+ return typeof e.read == "function" ? e : e.getReader();
373
288
  }
374
-
375
- var empty = new Uint8Array(0);
376
-
377
- function slice_cancel() {
289
+ var W = new Uint8Array(0);
290
+ function kt() {
378
291
  return this._source.cancel();
379
292
  }
380
-
381
- function concat$1(a, b) {
382
- if (!a.length) return b;
383
- if (!b.length) return a;
384
- var c = new Uint8Array(a.length + b.length);
385
- c.set(a);
386
- c.set(b, a.length);
387
- return c;
293
+ function Ct(e, t) {
294
+ if (!e.length) return t;
295
+ if (!t.length) return e;
296
+ var o = new Uint8Array(e.length + t.length);
297
+ return o.set(e), o.set(t, e.length), o;
388
298
  }
389
-
390
- function slice_read() {
391
- var that = this, array = that._array.subarray(that._index);
392
- return that._source.read().then(function(result) {
393
- that._array = empty;
394
- that._index = 0;
395
- return result.done ? (array.length > 0
396
- ? {done: false, value: array}
397
- : {done: true, value: undefined})
398
- : {done: false, value: concat$1(array, result.value)};
299
+ function St() {
300
+ var e = this, t = e._array.subarray(e._index);
301
+ return e._source.read().then(function(o) {
302
+ return e._array = W, e._index = 0, o.done ? t.length > 0 ? { done: !1, value: t } : { done: !0, value: void 0 } : { done: !1, value: Ct(t, o.value) };
399
303
  });
400
304
  }
401
-
402
- function slice_slice(length) {
403
- if ((length |= 0) < 0) throw new Error("invalid length");
404
- var that = this, index = this._array.length - this._index;
405
-
406
- // If the request fits within the remaining buffer, resolve it immediately.
407
- if (this._index + length <= this._array.length) {
408
- return Promise.resolve(this._array.subarray(this._index, this._index += length));
409
- }
410
-
411
- // Otherwise, read chunks repeatedly until the request is fulfilled.
412
- var array = new Uint8Array(length);
413
- array.set(this._array.subarray(this._index));
414
- return (function read() {
415
- return that._source.read().then(function(result) {
416
-
417
- // When done, it’s possible the request wasn’t fully fullfilled!
418
- // If so, the pre-allocated array is too big and needs slicing.
419
- if (result.done) {
420
- that._array = empty;
421
- that._index = 0;
422
- return index > 0 ? array.subarray(0, index) : null;
423
- }
424
-
425
- // If this chunk fulfills the request, return the resulting array.
426
- if (index + result.value.length >= length) {
427
- that._array = result.value;
428
- that._index = length - index;
429
- array.set(result.value.subarray(0, length - index), index);
430
- return array;
431
- }
432
-
433
- // Otherwise copy this chunk into the array, then read the next chunk.
434
- array.set(result.value, index);
435
- index += result.value.length;
436
- return read();
305
+ function Et(e) {
306
+ if ((e |= 0) < 0) throw new Error("invalid length");
307
+ var t = this, o = this._array.length - this._index;
308
+ if (this._index + e <= this._array.length)
309
+ return Promise.resolve(this._array.subarray(this._index, this._index += e));
310
+ var n = new Uint8Array(e);
311
+ return n.set(this._array.subarray(this._index)), function r() {
312
+ return t._source.read().then(function(a) {
313
+ return a.done ? (t._array = W, t._index = 0, o > 0 ? n.subarray(0, o) : null) : o + a.value.length >= e ? (t._array = a.value, t._index = e - o, n.set(a.value.subarray(0, e - o), o), n) : (n.set(a.value, o), o += a.value.length, r());
437
314
  });
438
- })();
315
+ }();
439
316
  }
440
-
441
- function slice(source) {
442
- return typeof source.slice === "function" ? source :
443
- new SliceSource(typeof source.read === "function" ? source
444
- : source.getReader());
317
+ function pe(e) {
318
+ return typeof e.slice == "function" ? e : new L(typeof e.read == "function" ? e : e.getReader());
445
319
  }
446
-
447
- function SliceSource(source) {
448
- this._source = source;
449
- this._array = empty;
450
- this._index = 0;
320
+ function L(e) {
321
+ this._source = e, this._array = W, this._index = 0;
451
322
  }
452
-
453
- SliceSource.prototype.read = slice_read;
454
- SliceSource.prototype.slice = slice_slice;
455
- SliceSource.prototype.cancel = slice_cancel;
456
-
457
- function dbf_cancel() {
323
+ L.prototype.read = St;
324
+ L.prototype.slice = Et;
325
+ L.prototype.cancel = kt;
326
+ function Vt() {
458
327
  return this._source.cancel();
459
328
  }
460
-
461
- function readBoolean(value) {
462
- return /^[nf]$/i.test(value) ? false
463
- : /^[yt]$/i.test(value) ? true
464
- : null;
329
+ function Pt(e) {
330
+ return /^[nf]$/i.test(e) ? !1 : /^[yt]$/i.test(e) ? !0 : null;
465
331
  }
466
-
467
- function readDate(value) {
468
- return new Date(+value.substring(0, 4), value.substring(4, 6) - 1, +value.substring(6, 8));
332
+ function It(e) {
333
+ return new Date(+e.substring(0, 4), e.substring(4, 6) - 1, +e.substring(6, 8));
469
334
  }
470
-
471
- function readNumber(value) {
472
- return !(value = value.trim()) || isNaN(value = +value) ? null : value;
335
+ function M(e) {
336
+ return !(e = e.trim()) || isNaN(e = +e) ? null : e;
473
337
  }
474
-
475
- function readString(value) {
476
- return value.trim() || null;
338
+ function Mt(e) {
339
+ return e.trim() || null;
477
340
  }
478
-
479
- var types$1 = {
480
- B: readNumber,
481
- C: readString,
482
- D: readDate,
483
- F: readNumber,
484
- L: readBoolean,
485
- M: readNumber,
486
- N: readNumber
341
+ var Ot = {
342
+ B: M,
343
+ C: Mt,
344
+ D: It,
345
+ F: M,
346
+ L: Pt,
347
+ M,
348
+ N: M
487
349
  };
488
-
489
- function dbf_read() {
490
- var that = this, i = 1;
491
- return that._source.slice(that._recordLength).then(function(value) {
492
- return value && (value[0] !== 0x1a) ? {done: false, value: that._fields.reduce(function(p, f) {
493
- p[f.name] = types$1[f.type](that._decode(value.subarray(i, i += f.length)));
494
- return p;
495
- }, {})} : {done: true, value: undefined};
350
+ function At() {
351
+ var e = this, t = 1;
352
+ return e._source.slice(e._recordLength).then(function(o) {
353
+ return o && o[0] !== 26 ? { done: !1, value: e._fields.reduce(function(n, r) {
354
+ return n[r.name] = Ot[r.type](e._decode(o.subarray(t, t += r.length))), n;
355
+ }, {}) } : { done: !0, value: void 0 };
496
356
  });
497
357
  }
498
-
499
- function view(array) {
500
- return new DataView(array.buffer, array.byteOffset, array.byteLength);
358
+ function C(e) {
359
+ return new DataView(e.buffer, e.byteOffset, e.byteLength);
501
360
  }
502
-
503
- function dbf(source, decoder) {
504
- source = slice(source);
505
- return source.slice(32).then(function(array) {
506
- var head = view(array);
507
- return source.slice(head.getUint16(8, true) - 32).then(function(array) {
508
- return new Dbf(source, decoder, head, view(array));
361
+ function Tt(e, t) {
362
+ return e = pe(e), e.slice(32).then(function(o) {
363
+ var n = C(o);
364
+ return e.slice(n.getUint16(8, !0) - 32).then(function(r) {
365
+ return new ve(e, t, n, C(r));
509
366
  });
510
367
  });
511
368
  }
512
-
513
- function Dbf(source, decoder, head, body) {
514
- this._source = source;
515
- this._decode = decoder.decode.bind(decoder);
516
- this._recordLength = head.getUint16(10, true);
517
- this._fields = [];
518
- for (var n = 0; body.getUint8(n) !== 0x0d; n += 32) {
519
- for (var j = 0; j < 11; ++j) if (body.getUint8(n + j) === 0) break;
369
+ function ve(e, t, o, n) {
370
+ this._source = e, this._decode = t.decode.bind(t), this._recordLength = o.getUint16(10, !0), this._fields = [];
371
+ for (var r = 0; n.getUint8(r) !== 13; r += 32) {
372
+ for (var a = 0; a < 11 && n.getUint8(r + a) !== 0; ++a) ;
520
373
  this._fields.push({
521
- name: this._decode(new Uint8Array(body.buffer, body.byteOffset + n, j)),
522
- type: String.fromCharCode(body.getUint8(n + 11)),
523
- length: body.getUint8(n + 16)
374
+ name: this._decode(new Uint8Array(n.buffer, n.byteOffset + r, a)),
375
+ type: String.fromCharCode(n.getUint8(r + 11)),
376
+ length: n.getUint8(r + 16)
524
377
  });
525
378
  }
526
379
  }
527
-
528
- var prototype$2 = Dbf.prototype;
529
- prototype$2.read = dbf_read;
530
- prototype$2.cancel = dbf_cancel;
531
-
532
- function cancel() {
380
+ var ye = ve.prototype;
381
+ ye.read = At;
382
+ ye.cancel = Vt;
383
+ function Rt() {
533
384
  return this._source.cancel();
534
385
  }
535
-
536
- function parseMultiPoint(record) {
537
- var i = 40, j, n = record.getInt32(36, true), coordinates = new Array(n);
538
- for (j = 0; j < n; ++j, i += 16) coordinates[j] = [record.getFloat64(i, true), record.getFloat64(i + 8, true)];
539
- return {type: "MultiPoint", coordinates: coordinates};
386
+ function J(e) {
387
+ var t = 40, o, n = e.getInt32(36, !0), r = new Array(n);
388
+ for (o = 0; o < n; ++o, t += 16) r[o] = [e.getFloat64(t, !0), e.getFloat64(t + 8, !0)];
389
+ return { type: "MultiPoint", coordinates: r };
540
390
  }
541
-
542
- function parseNull() {
391
+ function Ft() {
543
392
  return null;
544
393
  }
545
-
546
- function parsePoint(record) {
547
- return {type: "Point", coordinates: [record.getFloat64(4, true), record.getFloat64(12, true)]};
548
- }
549
-
550
- function parsePolygon(record) {
551
- var i = 44, j, n = record.getInt32(36, true), m = record.getInt32(40, true), parts = new Array(n), points = new Array(m), polygons = [], holes = [];
552
- for (j = 0; j < n; ++j, i += 4) parts[j] = record.getInt32(i, true);
553
- for (j = 0; j < m; ++j, i += 16) points[j] = [record.getFloat64(i, true), record.getFloat64(i + 8, true)];
554
-
555
- parts.forEach(function(i, j) {
556
- var ring = points.slice(i, parts[j + 1]);
557
- if (ringClockwise(ring)) polygons.push([ring]);
558
- else holes.push(ring);
559
- });
560
-
561
- holes.forEach(function(hole) {
562
- polygons.some(function(polygon) {
563
- if (ringContainsSome(polygon[0], hole)) {
564
- polygon.push(hole);
565
- return true;
566
- }
567
- }) || polygons.push([hole]);
568
- });
569
-
570
- return polygons.length === 1
571
- ? {type: "Polygon", coordinates: polygons[0]}
572
- : {type: "MultiPolygon", coordinates: polygons};
573
- }
574
- function ringClockwise(ring) {
575
- if ((n = ring.length) < 4) return false;
576
- var i = 0, n, area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1];
577
- while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1];
578
- return area >= 0;
579
- }
580
-
581
- function ringContainsSome(ring, hole) {
582
- var i = -1, n = hole.length, c;
583
- while (++i < n) {
584
- if (c = ringContains(ring, hole[i])) {
585
- return c > 0;
586
- }
587
- }
588
- return false;
589
- }
590
-
591
- function ringContains(ring, point) {
592
- var x = point[0], y = point[1], contains = -1;
593
- for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) {
594
- var pi = ring[i], xi = pi[0], yi = pi[1],
595
- pj = ring[j], xj = pj[0], yj = pj[1];
596
- if (segmentContains(pi, pj, point)) {
394
+ function q(e) {
395
+ return { type: "Point", coordinates: [e.getFloat64(4, !0), e.getFloat64(12, !0)] };
396
+ }
397
+ function z(e) {
398
+ var t = 44, o, n = e.getInt32(36, !0), r = e.getInt32(40, !0), a = new Array(n), l = new Array(r), i = [], s = [];
399
+ for (o = 0; o < n; ++o, t += 4) a[o] = e.getInt32(t, !0);
400
+ for (o = 0; o < r; ++o, t += 16) l[o] = [e.getFloat64(t, !0), e.getFloat64(t + 8, !0)];
401
+ return a.forEach(function(c, f) {
402
+ var p = l.slice(c, a[f + 1]);
403
+ Lt(p) ? i.push([p]) : s.push(p);
404
+ }), s.forEach(function(c) {
405
+ i.some(function(f) {
406
+ if ($t(f[0], c))
407
+ return f.push(c), !0;
408
+ }) || i.push([c]);
409
+ }), i.length === 1 ? { type: "Polygon", coordinates: i[0] } : { type: "MultiPolygon", coordinates: i };
410
+ }
411
+ function Lt(e) {
412
+ if ((o = e.length) < 4) return !1;
413
+ for (var t = 0, o, n = e[o - 1][1] * e[0][0] - e[o - 1][0] * e[0][1]; ++t < o; ) n += e[t - 1][1] * e[t][0] - e[t - 1][0] * e[t][1];
414
+ return n >= 0;
415
+ }
416
+ function $t(e, t) {
417
+ for (var o = -1, n = t.length, r; ++o < n; )
418
+ if (r = Bt(e, t[o]))
419
+ return r > 0;
420
+ return !1;
421
+ }
422
+ function Bt(e, t) {
423
+ for (var o = t[0], n = t[1], r = -1, a = 0, l = e.length, i = l - 1; a < l; i = a++) {
424
+ var s = e[a], c = s[0], f = s[1], p = e[i], m = p[0], g = p[1];
425
+ if (Ut(s, p, t))
597
426
  return 0;
598
- }
599
- if (((yi > y) !== (yj > y)) && ((x < (xj - xi) * (y - yi) / (yj - yi) + xi))) {
600
- contains = -contains;
601
- }
602
- }
603
- return contains;
604
- }
605
-
606
- function segmentContains(p0, p1, p2) {
607
- var x20 = p2[0] - p0[0], y20 = p2[1] - p0[1];
608
- if (x20 === 0 && y20 === 0) return true;
609
- var x10 = p1[0] - p0[0], y10 = p1[1] - p0[1];
610
- if (x10 === 0 && y10 === 0) return false;
611
- var t = (x20 * x10 + y20 * y10) / (x10 * x10 + y10 * y10);
612
- return t < 0 || t > 1 ? false : t === 0 || t === 1 ? true : t * x10 === x20 && t * y10 === y20;
613
- }
614
-
615
- function parsePolyLine(record) {
616
- var i = 44, j, n = record.getInt32(36, true), m = record.getInt32(40, true), parts = new Array(n), points = new Array(m);
617
- for (j = 0; j < n; ++j, i += 4) parts[j] = record.getInt32(i, true);
618
- for (j = 0; j < m; ++j, i += 16) points[j] = [record.getFloat64(i, true), record.getFloat64(i + 8, true)];
619
- return n === 1
620
- ? {type: "LineString", coordinates: points}
621
- : {type: "MultiLineString", coordinates: parts.map(function(i, j) { return points.slice(i, parts[j + 1]); })};
622
- }
623
-
624
- function concat(a, b) {
625
- var ab = new Uint8Array(a.length + b.length);
626
- ab.set(a, 0);
627
- ab.set(b, a.length);
628
- return ab;
629
- }
630
-
631
- function shp_read() {
632
- var that = this;
633
- ++that._index;
634
- return that._source.slice(12).then(function(array) {
635
- if (array == null) return {done: true, value: undefined};
636
- var header = view(array);
637
-
638
- // If the record starts with an invalid shape type (see #36), scan ahead in
639
- // four-byte increments to find the next valid record, identified by the
640
- // expected index, a non-empty content length and a valid shape type.
641
- function skip() {
642
- return that._source.slice(4).then(function(chunk) {
643
- if (chunk == null) return {done: true, value: undefined};
644
- header = view(array = concat(array.slice(4), chunk));
645
- return header.getInt32(0, false) !== that._index ? skip() : read();
427
+ f > n != g > n && o < (m - c) * (n - f) / (g - f) + c && (r = -r);
428
+ }
429
+ return r;
430
+ }
431
+ function Ut(e, t, o) {
432
+ var n = o[0] - e[0], r = o[1] - e[1];
433
+ if (n === 0 && r === 0) return !0;
434
+ var a = t[0] - e[0], l = t[1] - e[1];
435
+ if (a === 0 && l === 0) return !1;
436
+ var i = (n * a + r * l) / (a * a + l * l);
437
+ return i < 0 || i > 1 ? !1 : i === 0 || i === 1 ? !0 : i * a === n && i * l === r;
438
+ }
439
+ function Z(e) {
440
+ var t = 44, o, n = e.getInt32(36, !0), r = e.getInt32(40, !0), a = new Array(n), l = new Array(r);
441
+ for (o = 0; o < n; ++o, t += 4) a[o] = e.getInt32(t, !0);
442
+ for (o = 0; o < r; ++o, t += 16) l[o] = [e.getFloat64(t, !0), e.getFloat64(t + 8, !0)];
443
+ return n === 1 ? { type: "LineString", coordinates: l } : { type: "MultiLineString", coordinates: a.map(function(i, s) {
444
+ return l.slice(i, a[s + 1]);
445
+ }) };
446
+ }
447
+ function ue(e, t) {
448
+ var o = new Uint8Array(e.length + t.length);
449
+ return o.set(e, 0), o.set(t, e.length), o;
450
+ }
451
+ function Gt() {
452
+ var e = this;
453
+ return ++e._index, e._source.slice(12).then(function(t) {
454
+ if (t == null) return { done: !0, value: void 0 };
455
+ var o = C(t);
456
+ function n() {
457
+ return e._source.slice(4).then(function(a) {
458
+ return a == null ? { done: !0, value: void 0 } : (o = C(t = ue(t.slice(4), a)), o.getInt32(0, !1) !== e._index ? n() : r());
646
459
  });
647
460
  }
648
-
649
- // All records should have at least four bytes (for the record shape type),
650
- // so an invalid content length indicates corruption.
651
- function read() {
652
- var length = header.getInt32(4, false) * 2 - 4, type = header.getInt32(8, true);
653
- return length < 0 || (type && type !== that._type) ? skip() : that._source.slice(length).then(function(chunk) {
654
- return {done: false, value: type ? that._parse(view(concat(array.slice(8), chunk))) : null};
461
+ function r() {
462
+ var a = o.getInt32(4, !1) * 2 - 4, l = o.getInt32(8, !0);
463
+ return a < 0 || l && l !== e._type ? n() : e._source.slice(a).then(function(i) {
464
+ return { done: !1, value: l ? e._parse(C(ue(t.slice(8), i))) : null };
655
465
  });
656
466
  }
657
-
658
- return read();
467
+ return r();
659
468
  });
660
469
  }
661
-
662
- var parsers = {
663
- 0: parseNull,
664
- 1: parsePoint,
665
- 3: parsePolyLine,
666
- 5: parsePolygon,
667
- 8: parseMultiPoint,
668
- 11: parsePoint, // PointZ
669
- 13: parsePolyLine, // PolyLineZ
670
- 15: parsePolygon, // PolygonZ
671
- 18: parseMultiPoint, // MultiPointZ
672
- 21: parsePoint, // PointM
673
- 23: parsePolyLine, // PolyLineM
674
- 25: parsePolygon, // PolygonM
675
- 28: parseMultiPoint // MultiPointM
470
+ var se = {
471
+ 0: Ft,
472
+ 1: q,
473
+ 3: Z,
474
+ 5: z,
475
+ 8: J,
476
+ 11: q,
477
+ // PointZ
478
+ 13: Z,
479
+ // PolyLineZ
480
+ 15: z,
481
+ // PolygonZ
482
+ 18: J,
483
+ // MultiPointZ
484
+ 21: q,
485
+ // PointM
486
+ 23: Z,
487
+ // PolyLineM
488
+ 25: z,
489
+ // PolygonM
490
+ 28: J
491
+ // MultiPointM
676
492
  };
677
-
678
- function shp(source) {
679
- source = slice(source);
680
- return source.slice(100).then(function(array) {
681
- return new Shp(source, view(array));
493
+ function Nt(e) {
494
+ return e = pe(e), e.slice(100).then(function(t) {
495
+ return new he(e, C(t));
682
496
  });
683
497
  }
684
- function Shp(source, header) {
685
- var type = header.getInt32(32, true);
686
- if (!(type in parsers)) throw new Error("unsupported shape type: " + type);
687
- this._source = source;
688
- this._type = type;
689
- this._index = 0;
690
- this._parse = parsers[type];
691
- this.bbox = [header.getFloat64(36, true), header.getFloat64(44, true), header.getFloat64(52, true), header.getFloat64(60, true)];
498
+ function he(e, t) {
499
+ var o = t.getInt32(32, !0);
500
+ if (!(o in se)) throw new Error("unsupported shape type: " + o);
501
+ this._source = e, this._type = o, this._index = 0, this._parse = se[o], this.bbox = [t.getFloat64(36, !0), t.getFloat64(44, !0), t.getFloat64(52, !0), t.getFloat64(60, !0)];
502
+ }
503
+ var me = he.prototype;
504
+ me.read = Gt;
505
+ me.cancel = Rt;
506
+ function Dt() {
692
507
  }
693
-
694
- var prototype$1 = Shp.prototype;
695
- prototype$1.read = shp_read;
696
- prototype$1.cancel = cancel;
697
-
698
- function noop() {}
699
-
700
- function shapefile_cancel() {
508
+ function Jt() {
701
509
  return Promise.all([
702
510
  this._dbf && this._dbf.cancel(),
703
511
  this._shp.cancel()
704
- ]).then(noop);
512
+ ]).then(Dt);
705
513
  }
706
-
707
- function shapefile_read() {
708
- var that = this;
514
+ function qt() {
515
+ var e = this;
709
516
  return Promise.all([
710
- that._dbf ? that._dbf.read() : {value: {}},
711
- that._shp.read()
712
- ]).then(function(results) {
713
- var dbf = results[0], shp = results[1];
714
- return shp.done ? shp : {
715
- done: false,
517
+ e._dbf ? e._dbf.read() : { value: {} },
518
+ e._shp.read()
519
+ ]).then(function(t) {
520
+ var o = t[0], n = t[1];
521
+ return n.done ? n : {
522
+ done: !1,
716
523
  value: {
717
524
  type: "Feature",
718
- properties: dbf.value,
719
- geometry: shp.value
525
+ properties: o.value,
526
+ geometry: n.value
720
527
  }
721
528
  };
722
529
  });
723
530
  }
724
-
725
- function shapefile(shpSource, dbfSource, decoder) {
531
+ function zt(e, t, o) {
726
532
  return Promise.all([
727
- shp(shpSource),
728
- dbfSource && dbf(dbfSource, decoder)
729
- ]).then(function(sources) {
730
- return new Shapefile(sources[0], sources[1]);
533
+ Nt(e),
534
+ t && Tt(t, o)
535
+ ]).then(function(n) {
536
+ return new ge(n[0], n[1]);
731
537
  });
732
538
  }
733
-
734
- function Shapefile(shp, dbf) {
735
- this._shp = shp;
736
- this._dbf = dbf;
737
- this.bbox = shp.bbox;
738
- }
739
-
740
- var prototype = Shapefile.prototype;
741
- prototype.read = shapefile_read;
742
- prototype.cancel = shapefile_cancel;
743
-
744
- function open(shp, dbf, options) {
745
- if (typeof dbf === "string") {
746
- if (!/\.dbf$/.test(dbf)) dbf += ".dbf";
747
- dbf = path(dbf);
748
- } else if (dbf instanceof ArrayBuffer || dbf instanceof Uint8Array) {
749
- dbf = array(dbf);
750
- } else if (dbf != null) {
751
- dbf = stream(dbf);
752
- }
753
- if (typeof shp === "string") {
754
- if (!/\.shp$/.test(shp)) shp += ".shp";
755
- if (dbf === undefined) dbf = path(shp.substring(0, shp.length - 4) + ".dbf").catch(function() {});
756
- shp = path(shp);
757
- } else if (shp instanceof ArrayBuffer || shp instanceof Uint8Array) {
758
- shp = array(shp);
759
- } else {
760
- shp = stream(shp);
761
- }
762
- return Promise.all([shp, dbf]).then(function(sources) {
763
- var shp = sources[0], dbf = sources[1], encoding = "windows-1252";
764
- return shapefile(shp, dbf, dbf && new TextDecoder(encoding));
539
+ function ge(e, t) {
540
+ this._shp = e, this._dbf = t, this.bbox = e.bbox;
541
+ }
542
+ var we = ge.prototype;
543
+ we.read = qt;
544
+ we.cancel = Jt;
545
+ function Zt(e, t, o) {
546
+ return typeof t == "string" ? (/\.dbf$/.test(t) || (t += ".dbf"), t = D(t)) : t instanceof ArrayBuffer || t instanceof Uint8Array ? t = R(t) : t != null && (t = ie(t)), typeof e == "string" ? (/\.shp$/.test(e) || (e += ".shp"), t === void 0 && (t = D(e.substring(0, e.length - 4) + ".dbf").catch(function() {
547
+ })), e = D(e)) : e instanceof ArrayBuffer || e instanceof Uint8Array ? e = R(e) : e = ie(e), Promise.all([e, t]).then(function(n) {
548
+ var r = n[0], a = n[1], l = "windows-1252";
549
+ return zt(r, a, a && new TextDecoder(l));
765
550
  });
766
551
  }
767
-
768
- const shpToGeojson = (file) => {
769
- return new Promise((resolve, reject) => {
770
- const reader = new FileReader();
771
- reader.readAsArrayBuffer(file);
772
- const data = {
773
- type: "FeatureCollection",
774
- features: []
775
- };
776
- reader.onload = function() {
777
- open(this.result).then((source) => source.read().then(
778
- function log(result) {
779
- if (!result.done) {
780
- data.features.push(result.value);
781
- source.read().then(log);
782
- } else {
783
- if (result.value) {
784
- data.features.push(result.value);
785
- }
786
- resolve(data);
787
- }
788
- }
789
- )).catch(reject);
790
- };
791
- });
792
- };
793
-
794
- const toGeojson = (file) => {
795
- const actions = {
796
- shp: shpToGeojson
552
+ const Ht = (e) => new Promise((t, o) => {
553
+ const n = new FileReader();
554
+ n.readAsArrayBuffer(e);
555
+ const r = {
556
+ type: "FeatureCollection",
557
+ features: []
797
558
  };
798
- return new Promise((resolve, reject) => {
799
- const suffix = file.name.split(".").pop();
800
- if (suffix && actions[suffix]) {
801
- resolve(actions[suffix](file));
802
- } else {
803
- reject(new Error(`Can't resolve the .${suffix} file`));
804
- }
559
+ n.onload = function() {
560
+ Zt(this.result).then((a) => a.read().then(
561
+ function l(i) {
562
+ i.done ? (i.value && r.features.push(i.value), t(r)) : (r.features.push(i.value), a.read().then(l));
563
+ }
564
+ )).catch(o);
565
+ };
566
+ }), xt = (e) => {
567
+ const t = {
568
+ shp: Ht
569
+ };
570
+ return new Promise((o, n) => {
571
+ const r = e.name.split(".").pop();
572
+ r && t[r] ? o(t[r](e)) : n(new Error(`Can't resolve the .${r} file`));
805
573
  });
806
574
  };
807
-
808
575
  /* @preserve
809
576
  * @terraformer/arcgis - v2.1.1 - MIT
810
577
  * Copyright (c) 2012-2022 Environmental Systems Research Institute, Inc.
811
578
  * Tue Aug 02 2022 14:23:48 GMT-0700 (Pacific Daylight Time)
812
579
  */
813
- /* Copyright (c) 2012-2019 Environmental Systems Research Institute, Inc.
814
- * Apache-2.0 */
815
-
816
- var edgeIntersectsEdge = function edgeIntersectsEdge(a1, a2, b1, b2) {
817
- var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);
818
- var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);
819
- var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);
820
-
821
- if (uB !== 0) {
822
- var ua = uaT / uB;
823
- var ub = ubT / uB;
824
-
825
- if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) {
826
- return true;
827
- }
828
- }
829
-
830
- return false;
831
- };
832
- var coordinatesContainPoint = function coordinatesContainPoint(coordinates, point) {
833
- var contains = false;
834
-
835
- for (var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {
836
- if ((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1] || coordinates[j][1] <= point[1] && point[1] < coordinates[i][1]) && point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0]) {
837
- contains = !contains;
838
- }
839
- }
840
-
841
- return contains;
842
- };
843
- var pointsEqual = function pointsEqual(a, b) {
844
- for (var i = 0; i < a.length; i++) {
845
- if (a[i] !== b[i]) {
846
- return false;
847
- }
848
- }
849
-
850
- return true;
851
- };
852
- var arrayIntersectsArray = function arrayIntersectsArray(a, b) {
853
- for (var i = 0; i < a.length - 1; i++) {
854
- for (var j = 0; j < b.length - 1; j++) {
855
- if (edgeIntersectsEdge(a[i], a[i + 1], b[j], b[j + 1])) {
856
- return true;
857
- }
858
- }
859
- }
860
-
861
- return false;
862
- };
863
-
864
- /* Copyright (c) 2012-2019 Environmental Systems Research Institute, Inc.
865
- * Apache-2.0 */
866
-
867
- var closeRing = function closeRing(coordinates) {
868
- if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {
869
- coordinates.push(coordinates[0]);
870
- }
871
-
872
- return coordinates;
873
- }; // determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring
874
- // or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-
875
- // points-are-in-clockwise-order
876
-
877
- var ringIsClockwise = function ringIsClockwise(ringToTest) {
878
- var total = 0;
879
- var i = 0;
880
- var rLength = ringToTest.length;
881
- var pt1 = ringToTest[i];
882
- var pt2;
883
-
884
- for (i; i < rLength - 1; i++) {
885
- pt2 = ringToTest[i + 1];
886
- total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);
887
- pt1 = pt2;
888
- }
889
-
890
- return total >= 0;
891
- }; // This function ensures that rings are oriented in the right directions
892
- // from http://jsperf.com/cloning-an-object/2
893
-
894
- var shallowClone = function shallowClone(obj) {
895
- var target = {};
896
-
897
- for (var i in obj) {
898
- // both arcgis attributes and geojson props are just hardcoded keys
899
- if (obj.hasOwnProperty(i)) {
900
- // eslint-disable-line no-prototype-builtins
901
- target[i] = obj[i];
902
- }
903
- }
904
-
905
- return target;
906
- };
907
-
908
- /* Copyright (c) 2012-2019 Environmental Systems Research Institute, Inc.
909
- * Apache-2.0 */
910
-
911
- var coordinatesContainCoordinates = function coordinatesContainCoordinates(outer, inner) {
912
- var intersects = arrayIntersectsArray(outer, inner);
913
- var contains = coordinatesContainPoint(outer, inner[0]);
914
-
915
- if (!intersects && contains) {
916
- return true;
917
- }
918
-
919
- return false;
920
- }; // do any polygons in this array contain any other polygons in this array?
921
- // used for checking for holes in arcgis rings
922
-
923
-
924
- var convertRingsToGeoJSON = function convertRingsToGeoJSON(rings) {
925
- var outerRings = [];
926
- var holes = [];
927
- var x; // iterator
928
-
929
- var outerRing; // current outer ring being evaluated
930
-
931
- var hole; // current hole being evaluated
932
- // for each ring
933
-
934
- for (var r = 0; r < rings.length; r++) {
935
- var ring = closeRing(rings[r].slice(0));
936
-
937
- if (ring.length < 4) {
938
- continue;
939
- } // is this ring an outer ring? is it clockwise?
940
-
941
-
942
- if (ringIsClockwise(ring)) {
943
- var polygon = [ring.slice().reverse()]; // wind outer rings counterclockwise for RFC 7946 compliance
944
-
945
- outerRings.push(polygon); // push to outer rings
946
- } else {
947
- holes.push(ring.slice().reverse()); // wind inner rings clockwise for RFC 7946 compliance
948
- }
949
- }
950
-
951
- var uncontainedHoles = []; // while there are holes left...
952
-
953
- while (holes.length) {
954
- // pop a hole off out stack
955
- hole = holes.pop(); // loop over all outer rings and see if they contain our hole.
956
-
957
- var contained = false;
958
-
959
- for (x = outerRings.length - 1; x >= 0; x--) {
960
- outerRing = outerRings[x][0];
961
-
962
- if (coordinatesContainCoordinates(outerRing, hole)) {
963
- // the hole is contained push it into our polygon
964
- outerRings[x].push(hole);
965
- contained = true;
580
+ var Yt = function(t, o, n, r) {
581
+ var a = (r[0] - n[0]) * (t[1] - n[1]) - (r[1] - n[1]) * (t[0] - n[0]), l = (o[0] - t[0]) * (t[1] - n[1]) - (o[1] - t[1]) * (t[0] - n[0]), i = (r[1] - n[1]) * (o[0] - t[0]) - (r[0] - n[0]) * (o[1] - t[1]);
582
+ if (i !== 0) {
583
+ var s = a / i, c = l / i;
584
+ if (s >= 0 && s <= 1 && c >= 0 && c <= 1)
585
+ return !0;
586
+ }
587
+ return !1;
588
+ }, Xt = function(t, o) {
589
+ for (var n = !1, r = -1, a = t.length, l = a - 1; ++r < a; l = r)
590
+ (t[r][1] <= o[1] && o[1] < t[l][1] || t[l][1] <= o[1] && o[1] < t[r][1]) && o[0] < (t[l][0] - t[r][0]) * (o[1] - t[r][1]) / (t[l][1] - t[r][1]) + t[r][0] && (n = !n);
591
+ return n;
592
+ }, Kt = function(t, o) {
593
+ for (var n = 0; n < t.length; n++)
594
+ if (t[n] !== o[n])
595
+ return !1;
596
+ return !0;
597
+ }, _e = function(t, o) {
598
+ for (var n = 0; n < t.length - 1; n++)
599
+ for (var r = 0; r < o.length - 1; r++)
600
+ if (Yt(t[n], t[n + 1], o[r], o[r + 1]))
601
+ return !0;
602
+ return !1;
603
+ }, H = function(t) {
604
+ return Kt(t[0], t[t.length - 1]) || t.push(t[0]), t;
605
+ }, x = function(t) {
606
+ var o = 0, n = 0, r = t.length, a = t[n], l;
607
+ for (n; n < r - 1; n++)
608
+ l = t[n + 1], o += (l[0] - a[0]) * (l[1] + a[1]), a = l;
609
+ return o >= 0;
610
+ }, be = function(t) {
611
+ var o = {};
612
+ for (var n in t)
613
+ t.hasOwnProperty(n) && (o[n] = t[n]);
614
+ return o;
615
+ }, Qt = function(t, o) {
616
+ var n = _e(t, o), r = Xt(t, o[0]);
617
+ return !!(!n && r);
618
+ }, Wt = function(t) {
619
+ for (var o = [], n = [], r, a, l, i = 0; i < t.length; i++) {
620
+ var s = H(t[i].slice(0));
621
+ if (!(s.length < 4))
622
+ if (x(s)) {
623
+ var c = [s.slice().reverse()];
624
+ o.push(c);
625
+ } else
626
+ n.push(s.slice().reverse());
627
+ }
628
+ for (var f = []; n.length; ) {
629
+ l = n.pop();
630
+ var p = !1;
631
+ for (r = o.length - 1; r >= 0; r--)
632
+ if (a = o[r][0], Qt(a, l)) {
633
+ o[r].push(l), p = !0;
966
634
  break;
967
635
  }
968
- } // ring is not contained in any outer ring
969
- // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320
970
-
971
-
972
- if (!contained) {
973
- uncontainedHoles.push(hole);
974
- }
975
- } // if we couldn't match any holes using contains we can try intersects...
976
-
977
-
978
- while (uncontainedHoles.length) {
979
- // pop a hole off out stack
980
- hole = uncontainedHoles.pop(); // loop over all outer rings and see if any intersect our hole.
981
-
982
- var intersects = false;
983
-
984
- for (x = outerRings.length - 1; x >= 0; x--) {
985
- outerRing = outerRings[x][0];
986
-
987
- if (arrayIntersectsArray(outerRing, hole)) {
988
- // the hole is contained push it into our polygon
989
- outerRings[x].push(hole);
990
- intersects = true;
636
+ p || f.push(l);
637
+ }
638
+ for (; f.length; ) {
639
+ l = f.pop();
640
+ var m = !1;
641
+ for (r = o.length - 1; r >= 0; r--)
642
+ if (a = o[r][0], _e(a, l)) {
643
+ o[r].push(l), m = !0;
991
644
  break;
992
645
  }
993
- }
994
-
995
- if (!intersects) {
996
- outerRings.push([hole.reverse()]);
997
- }
998
- }
999
-
1000
- if (outerRings.length === 1) {
1001
- return {
1002
- type: 'Polygon',
1003
- coordinates: outerRings[0]
1004
- };
1005
- } else {
1006
- return {
1007
- type: 'MultiPolygon',
1008
- coordinates: outerRings
1009
- };
1010
- }
1011
- };
1012
-
1013
- var getId = function getId(attributes, idAttribute) {
1014
- var keys = ['OBJECTID', 'FID'];
1015
-
1016
- for (var i = 0; i < keys.length; i++) {
1017
- var key = keys[i];
1018
-
1019
- if (key in attributes && (typeof attributes[key] === 'string' || typeof attributes[key] === 'number')) {
1020
- return attributes[key];
1021
- }
1022
- }
1023
-
1024
- throw Error('No valid id attribute found');
1025
- };
1026
-
1027
- var arcgisToGeoJSON = function arcgisToGeoJSON(arcgis, idAttribute) {
1028
- var geojson = {};
1029
-
1030
- if (arcgis.features) {
1031
- geojson.type = 'FeatureCollection';
1032
- geojson.features = [];
1033
-
1034
- for (var i = 0; i < arcgis.features.length; i++) {
1035
- geojson.features.push(arcgisToGeoJSON(arcgis.features[i], idAttribute));
1036
- }
1037
- }
1038
-
1039
- if (typeof arcgis.x === 'number' && typeof arcgis.y === 'number') {
1040
- geojson.type = 'Point';
1041
- geojson.coordinates = [arcgis.x, arcgis.y];
1042
-
1043
- if (typeof arcgis.z === 'number') {
1044
- geojson.coordinates.push(arcgis.z);
1045
- }
1046
- }
1047
-
1048
- if (arcgis.points) {
1049
- geojson.type = 'MultiPoint';
1050
- geojson.coordinates = arcgis.points.slice(0);
1051
- }
1052
-
1053
- if (arcgis.paths) {
1054
- if (arcgis.paths.length === 1) {
1055
- geojson.type = 'LineString';
1056
- geojson.coordinates = arcgis.paths[0].slice(0);
1057
- } else {
1058
- geojson.type = 'MultiLineString';
1059
- geojson.coordinates = arcgis.paths.slice(0);
1060
- }
1061
- }
1062
-
1063
- if (arcgis.rings) {
1064
- geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));
1065
- }
1066
-
1067
- if (typeof arcgis.xmin === 'number' && typeof arcgis.ymin === 'number' && typeof arcgis.xmax === 'number' && typeof arcgis.ymax === 'number') {
1068
- geojson.type = 'Polygon';
1069
- geojson.coordinates = [[[arcgis.xmax, arcgis.ymax], [arcgis.xmin, arcgis.ymax], [arcgis.xmin, arcgis.ymin], [arcgis.xmax, arcgis.ymin], [arcgis.xmax, arcgis.ymax]]];
1070
- }
1071
-
1072
- if (arcgis.geometry || arcgis.attributes) {
1073
- geojson.type = 'Feature';
1074
- geojson.geometry = arcgis.geometry ? arcgisToGeoJSON(arcgis.geometry) : null;
1075
- geojson.properties = arcgis.attributes ? shallowClone(arcgis.attributes) : null;
1076
-
1077
- if (arcgis.attributes) {
1078
- try {
1079
- geojson.id = getId(arcgis.attributes, idAttribute);
1080
- } catch (err) {// don't set an id
1081
- }
1082
- }
1083
- } // if no valid geometry was encountered
1084
-
1085
-
1086
- if (JSON.stringify(geojson.geometry) === JSON.stringify({})) {
1087
- geojson.geometry = null;
1088
- }
1089
-
1090
- if (arcgis.spatialReference && arcgis.spatialReference.wkid && arcgis.spatialReference.wkid !== 4326) {
1091
- console.warn('Object converted in non-standard crs - ' + JSON.stringify(arcgis.spatialReference));
1092
- }
1093
-
1094
- return geojson;
1095
- };
1096
-
1097
- /* Copyright (c) 2012-2019 Environmental Systems Research Institute, Inc.
1098
- * Apache-2.0 */
1099
- // outer rings are clockwise, holes are counterclockwise
1100
- // used for converting GeoJSON Polygons to ArcGIS Polygons
1101
-
1102
- var orientRings = function orientRings(poly) {
1103
- var output = [];
1104
- var polygon = poly.slice(0);
1105
- var outerRing = closeRing(polygon.shift().slice(0));
1106
-
1107
- if (outerRing.length >= 4) {
1108
- if (!ringIsClockwise(outerRing)) {
1109
- outerRing.reverse();
1110
- }
1111
-
1112
- output.push(outerRing);
1113
-
1114
- for (var i = 0; i < polygon.length; i++) {
1115
- var hole = closeRing(polygon[i].slice(0));
1116
-
1117
- if (hole.length >= 4) {
1118
- if (ringIsClockwise(hole)) {
1119
- hole.reverse();
1120
- }
1121
-
1122
- output.push(hole);
1123
- }
1124
- }
1125
- }
1126
-
1127
- return output;
1128
- }; // This function flattens holes in multipolygons to one array of polygons
1129
- // used for converting GeoJSON Polygons to ArcGIS Polygons
1130
-
1131
-
1132
- var flattenMultiPolygonRings = function flattenMultiPolygonRings(rings) {
1133
- var output = [];
1134
-
1135
- for (var i = 0; i < rings.length; i++) {
1136
- var polygon = orientRings(rings[i]);
1137
-
1138
- for (var x = polygon.length - 1; x >= 0; x--) {
1139
- var ring = polygon[x].slice(0);
1140
- output.push(ring);
1141
- }
1142
- }
1143
-
1144
- return output;
1145
- };
1146
-
1147
- var geojsonToArcGIS = function geojsonToArcGIS(geojson, idAttribute) {
1148
- idAttribute = idAttribute || 'OBJECTID';
1149
- var spatialReference = {
1150
- wkid: 4326
646
+ m || o.push([l.reverse()]);
647
+ }
648
+ return o.length === 1 ? {
649
+ type: "Polygon",
650
+ coordinates: o[0]
651
+ } : {
652
+ type: "MultiPolygon",
653
+ coordinates: o
1151
654
  };
1152
- var result = {};
1153
- var i;
1154
-
1155
- switch (geojson.type) {
1156
- case 'Point':
1157
- result.x = geojson.coordinates[0];
1158
- result.y = geojson.coordinates[1];
1159
-
1160
- if (geojson.coordinates[2] != null) {
1161
- result.z = geojson.coordinates[2];
1162
- }
1163
-
1164
- result.spatialReference = spatialReference;
655
+ }, jt = function(t, o) {
656
+ for (var n = ["OBJECTID", "FID"], r = 0; r < n.length; r++) {
657
+ var a = n[r];
658
+ if (a in t && (typeof t[a] == "string" || typeof t[a] == "number"))
659
+ return t[a];
660
+ }
661
+ throw Error("No valid id attribute found");
662
+ }, en = function e(t, o) {
663
+ var n = {};
664
+ if (t.features) {
665
+ n.type = "FeatureCollection", n.features = [];
666
+ for (var r = 0; r < t.features.length; r++)
667
+ n.features.push(e(t.features[r], o));
668
+ }
669
+ if (typeof t.x == "number" && typeof t.y == "number" && (n.type = "Point", n.coordinates = [t.x, t.y], typeof t.z == "number" && n.coordinates.push(t.z)), t.points && (n.type = "MultiPoint", n.coordinates = t.points.slice(0)), t.paths && (t.paths.length === 1 ? (n.type = "LineString", n.coordinates = t.paths[0].slice(0)) : (n.type = "MultiLineString", n.coordinates = t.paths.slice(0))), t.rings && (n = Wt(t.rings.slice(0))), typeof t.xmin == "number" && typeof t.ymin == "number" && typeof t.xmax == "number" && typeof t.ymax == "number" && (n.type = "Polygon", n.coordinates = [[[t.xmax, t.ymax], [t.xmin, t.ymax], [t.xmin, t.ymin], [t.xmax, t.ymin], [t.xmax, t.ymax]]]), (t.geometry || t.attributes) && (n.type = "Feature", n.geometry = t.geometry ? e(t.geometry) : null, n.properties = t.attributes ? be(t.attributes) : null, t.attributes))
670
+ try {
671
+ n.id = jt(t.attributes, o);
672
+ } catch {
673
+ }
674
+ return JSON.stringify(n.geometry) === JSON.stringify({}) && (n.geometry = null), t.spatialReference && t.spatialReference.wkid && t.spatialReference.wkid !== 4326 && console.warn("Object converted in non-standard crs - " + JSON.stringify(t.spatialReference)), n;
675
+ }, ke = function(t) {
676
+ var o = [], n = t.slice(0), r = H(n.shift().slice(0));
677
+ if (r.length >= 4) {
678
+ x(r) || r.reverse(), o.push(r);
679
+ for (var a = 0; a < n.length; a++) {
680
+ var l = H(n[a].slice(0));
681
+ l.length >= 4 && (x(l) && l.reverse(), o.push(l));
682
+ }
683
+ }
684
+ return o;
685
+ }, tn = function(t) {
686
+ for (var o = [], n = 0; n < t.length; n++)
687
+ for (var r = ke(t[n]), a = r.length - 1; a >= 0; a--) {
688
+ var l = r[a].slice(0);
689
+ o.push(l);
690
+ }
691
+ return o;
692
+ }, nn = function e(t, o) {
693
+ o = o || "OBJECTID";
694
+ var n = {
695
+ wkid: 4326
696
+ }, r = {}, a;
697
+ switch (t.type) {
698
+ case "Point":
699
+ r.x = t.coordinates[0], r.y = t.coordinates[1], t.coordinates[2] != null && (r.z = t.coordinates[2]), r.spatialReference = n;
1165
700
  break;
1166
-
1167
- case 'MultiPoint':
1168
- result.points = geojson.coordinates.slice(0);
1169
-
1170
- if (geojson.coordinates[0][2] != null) {
1171
- result.hasZ = true;
1172
- }
1173
-
1174
- result.spatialReference = spatialReference;
701
+ case "MultiPoint":
702
+ r.points = t.coordinates.slice(0), t.coordinates[0][2] != null && (r.hasZ = !0), r.spatialReference = n;
1175
703
  break;
1176
-
1177
- case 'LineString':
1178
- result.paths = [geojson.coordinates.slice(0)];
1179
-
1180
- if (geojson.coordinates[0][2] != null) {
1181
- result.hasZ = true;
1182
- }
1183
-
1184
- result.spatialReference = spatialReference;
704
+ case "LineString":
705
+ r.paths = [t.coordinates.slice(0)], t.coordinates[0][2] != null && (r.hasZ = !0), r.spatialReference = n;
1185
706
  break;
1186
-
1187
- case 'MultiLineString':
1188
- result.paths = geojson.coordinates.slice(0);
1189
-
1190
- if (geojson.coordinates[0][0][2] != null) {
1191
- result.hasZ = true;
1192
- }
1193
-
1194
- result.spatialReference = spatialReference;
707
+ case "MultiLineString":
708
+ r.paths = t.coordinates.slice(0), t.coordinates[0][0][2] != null && (r.hasZ = !0), r.spatialReference = n;
1195
709
  break;
1196
-
1197
- case 'Polygon':
1198
- result.rings = orientRings(geojson.coordinates.slice(0));
1199
-
1200
- if (geojson.coordinates[0][0][2] != null) {
1201
- result.hasZ = true;
1202
- }
1203
-
1204
- result.spatialReference = spatialReference;
710
+ case "Polygon":
711
+ r.rings = ke(t.coordinates.slice(0)), t.coordinates[0][0][2] != null && (r.hasZ = !0), r.spatialReference = n;
1205
712
  break;
1206
-
1207
- case 'MultiPolygon':
1208
- result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));
1209
-
1210
- if (geojson.coordinates[0][0][0][2] != null) {
1211
- result.hasZ = true;
1212
- }
1213
-
1214
- result.spatialReference = spatialReference;
713
+ case "MultiPolygon":
714
+ r.rings = tn(t.coordinates.slice(0)), t.coordinates[0][0][0][2] != null && (r.hasZ = !0), r.spatialReference = n;
1215
715
  break;
1216
-
1217
- case 'Feature':
1218
- if (geojson.geometry) {
1219
- result.geometry = geojsonToArcGIS(geojson.geometry, idAttribute);
1220
- }
1221
-
1222
- result.attributes = geojson.properties ? shallowClone(geojson.properties) : {};
1223
-
1224
- if (geojson.id) {
1225
- result.attributes[idAttribute] = geojson.id;
1226
- }
1227
-
716
+ case "Feature":
717
+ t.geometry && (r.geometry = e(t.geometry, o)), r.attributes = t.properties ? be(t.properties) : {}, t.id && (r.attributes[o] = t.id);
1228
718
  break;
1229
-
1230
- case 'FeatureCollection':
1231
- result = [];
1232
-
1233
- for (i = 0; i < geojson.features.length; i++) {
1234
- result.push(geojsonToArcGIS(geojson.features[i], idAttribute));
1235
- }
1236
-
719
+ case "FeatureCollection":
720
+ for (r = [], a = 0; a < t.features.length; a++)
721
+ r.push(e(t.features[a], o));
1237
722
  break;
1238
-
1239
- case 'GeometryCollection':
1240
- result = [];
1241
-
1242
- for (i = 0; i < geojson.geometries.length; i++) {
1243
- result.push(geojsonToArcGIS(geojson.geometries[i], idAttribute));
1244
- }
1245
-
723
+ case "GeometryCollection":
724
+ for (r = [], a = 0; a < t.geometries.length; a++)
725
+ r.push(e(t.geometries[a], o));
1246
726
  break;
1247
727
  }
1248
-
1249
- return result;
728
+ return r;
1250
729
  };
1251
-
1252
- var _sfc_main = /* @__PURE__ */ defineComponent({
730
+ const on = /* @__PURE__ */ F({
1253
731
  name: "VkfEsriInputGeojson",
1254
732
  components: {
1255
- VkfInput,
1256
- VaSketch,
1257
- ViewerVue,
1258
- VkAsyncTeleport,
1259
- DocumentChecked: document_checked_default,
1260
- VaGraphicsLayer
733
+ VkfInput: Ne,
734
+ VaSketch: We,
735
+ ViewerVue: mt,
736
+ VkAsyncTeleport: tt,
737
+ DocumentChecked: Ke,
738
+ VaGraphicsLayer: Qe
1261
739
  },
1262
- props,
1263
- emits,
1264
- setup(props2, {
1265
- emit
740
+ props: X,
741
+ emits: K,
742
+ setup(e, {
743
+ emit: t
1266
744
  }) {
1267
- const inputBindProps = _VkfInputCtx.createBindProps(props2, ["inputSlots", "readonly", "modelValue"]);
1268
- const inputOnEmits = _VkfInputCtx.createOnEmits(emit, ["update:modelValue"]);
1269
- const {
1270
- tr
1271
- } = useLocale();
1272
- const getInputModelValue = v => {
1273
- const emptyStr = tr("el.table.emptyText", "\u6682\u65E0\u6570\u636E");
1274
- if (!v) return emptyStr;
1275
- if (!v.features.length) return emptyStr;
1276
- return JSON.stringify(v);
1277
- };
1278
- const readonly = useComputedReadonly(props2);
1279
- const sketchIf = ref(!props2.view);
1280
- const sketchRef = shallowRef();
1281
- const shetchPanel = computed(() => {
1282
- const container = sketchRef.value?.container;
1283
- return container?.querySelector(".esri-sketch__panel");
1284
- });
1285
- const viewDef = new Deferred();
1286
- const layerRef = shallowRef();
1287
- const sketchLoad = async e => {
1288
- await e.sketch.when();
1289
- sketchRef.value = e.sketch;
1290
- viewDef.resolve(sketchRef.value.view);
1291
- };
1292
- const layerLoad = async ({
1293
- view,
1294
- layer
745
+ const o = T.createBindProps(e, ["inputSlots", "readonly", "modelValue"]), n = T.createOnEmits(t, ["update:modelValue"]), {
746
+ tr: r
747
+ } = rt(), a = (u) => {
748
+ const d = r("el.table.emptyText", "暂无数据");
749
+ return !u || !u.features.length ? d : JSON.stringify(u);
750
+ }, l = ot(e), i = N(!e.view), s = k(), c = ne(() => {
751
+ var d;
752
+ const u = (d = s.value) == null ? void 0 : d.container;
753
+ return u == null ? void 0 : u.querySelector(".esri-sketch__panel");
754
+ }), f = new at(), p = k(), m = async (u) => {
755
+ await u.sketch.when(), s.value = u.sketch, f.resolve(s.value.view);
756
+ }, g = async ({
757
+ view: u,
758
+ layer: d
1295
759
  }) => {
1296
- viewDef.resolve(view);
1297
- layerRef.value = layer;
1298
- };
1299
- const availableCreatureTools = computed(() => {
1300
- if (Array.isArray(props2.editTypes)) {
1301
- return props2.editTypes.reduce((pre, cur) => {
1302
- return pre.concat(EDIT_TYPE_REFLECT[cur].availableCreatureTools);
1303
- }, []);
1304
- } else {
1305
- return EDIT_TYPE_REFLECT[props2.editTypes].availableCreatureTools;
1306
- }
1307
- });
1308
- const sketchValueUpdating = ref(false);
1309
- const sketchValue = shallowRef([]);
1310
- watch(() => props2.modelValue, (v, ov) => {
1311
- if (sketchValueUpdating.value) return;
1312
- uSketchValue();
1313
- if (!ov?.features.length) {
1314
- fly();
1315
- }
760
+ f.resolve(u), p.value = d;
761
+ }, $ = ne(() => Array.isArray(e.editTypes) ? e.editTypes.reduce((u, d) => u.concat(le[d].availableCreatureTools), []) : le[e.editTypes].availableCreatureTools), B = N(!1), S = k([]);
762
+ oe(() => e.modelValue, (u, d) => {
763
+ B.value || (Ae(), d != null && d.features.length || V());
1316
764
  }, {
1317
- immediate: true
765
+ immediate: !0
1318
766
  });
1319
- const handleUpdateSketchValue = e => {
1320
- sketchValue.value = Array.isArray(e) ? e : e.toArray();
1321
- if (props2.skipSave) {
1322
- u();
1323
- }
1324
- };
1325
- const normalMapRef = shallowRef();
1326
- const dialogMapRef = shallowRef();
1327
- const mapTo = shallowRef();
1328
- onMounted(() => {
1329
- mapTo.value = normalMapRef.value;
767
+ const Ce = (u) => {
768
+ S.value = Array.isArray(u) ? u : u.toArray(), e.skipSave && ee();
769
+ }, U = k(), j = k(), I = k();
770
+ Fe(() => {
771
+ I.value = U.value;
1330
772
  });
1331
- const dialogShow = ref(false);
1332
- const setDialogShow = v => {
1333
- dialogShow.value = v;
1334
- };
1335
- const dialogOnOpen = async () => {
1336
- mapTo.value = dialogMapRef.value;
1337
- };
1338
- const dialogOnClose = async () => {
1339
- mapTo.value = normalMapRef.value;
1340
- };
1341
- const doSave = () => {
1342
- u();
1343
- ElMessage({
1344
- message: tr("vkf.esriInputGeojson.saveSuccess", "\u4FDD\u5B58\u6210\u529F"),
773
+ const E = N(!1), Se = (u) => {
774
+ E.value = u;
775
+ }, Ee = async () => {
776
+ I.value = j.value;
777
+ }, Ve = async () => {
778
+ I.value = U.value;
779
+ }, Pe = () => {
780
+ ee(), ae({
781
+ message: r("vkf.esriInputGeojson.saveSuccess", "保存成功"),
1345
782
  type: "success"
1346
- });
1347
- dialogShow.value = false;
1348
- if (props2.view) {
1349
- sketchIf.value = false;
1350
- }
1351
- };
1352
- const append = () => createVNode(AppendVue, {
1353
- "dialog": !readonly.value && props2.dialogEdit,
1354
- "upload": !readonly.value,
1355
- "disabled": props2.disabled,
1356
- "onUpload": onUpload,
1357
- "onEdit": onEdit,
1358
- "onFly": () => {
1359
- if (!props2.showMap && !props2.view) {
1360
- dialogShow.value = true;
1361
- }
1362
- emit("appendFly");
1363
- fly();
783
+ }), E.value = !1, e.view && (i.value = !1);
784
+ }, Ie = () => y(pt, {
785
+ dialog: !l.value && e.dialogEdit,
786
+ upload: !l.value,
787
+ disabled: e.disabled,
788
+ onUpload: Me,
789
+ onEdit: Oe,
790
+ onFly: () => {
791
+ !e.showMap && !e.view && (E.value = !0), t("appendFly"), V();
1364
792
  }
1365
793
  }, null);
1366
- async function onUpload(e) {
1367
- if (!e.raw) return;
1368
- toGeojson(e.raw).then(res => {
1369
- emit("update:modelValue", res);
794
+ async function Me(u) {
795
+ u.raw && xt(u.raw).then((d) => {
796
+ t("update:modelValue", d);
1370
797
  }).then(() => {
1371
- ElMessage.success(tr("vkf.esriInputGeojson.uploadSuccess", "\u4E0A\u4F20\u6210\u529F"));
1372
- }).then(fly);
798
+ ae.success(r("vkf.esriInputGeojson.uploadSuccess", "上传成功"));
799
+ }).then(V);
1373
800
  }
1374
- function onEdit() {
1375
- if (!props2.view) {
1376
- dialogShow.value = true;
1377
- } else {
1378
- sketchIf.value = true;
1379
- }
1380
- emit("appendEdit");
801
+ function Oe() {
802
+ e.view ? i.value = !0 : E.value = !0, t("appendEdit");
1381
803
  }
1382
- function u() {
1383
- sketchValueUpdating.value = true;
1384
- const features = sketchValue.value.map(item => {
1385
- return arcgisToGeoJSON(item);
1386
- });
1387
- emit("update:modelValue", {
804
+ function ee() {
805
+ B.value = !0;
806
+ const u = S.value.map((d) => en(d));
807
+ t("update:modelValue", {
1388
808
  type: "FeatureCollection",
1389
- features
1390
- });
1391
- nextTick(() => {
1392
- sketchValueUpdating.value = false;
809
+ features: u
810
+ }), Le(() => {
811
+ B.value = !1;
1393
812
  });
1394
813
  }
1395
- function uSketchValue() {
1396
- const esriData = geojsonToArcGIS(props2.modelValue);
1397
- const graphics = esriData.map(item => {
1398
- const g = item.geometry;
1399
- if (g.rings) {
1400
- g.type = "polygon";
1401
- item.symbol = props2.viewModelActiveFillSymbol;
1402
- } else if (g.paths) {
1403
- g.type = "polyline";
1404
- item.symbol = props2.viewModelActiveLineSymbol;
1405
- } else if (g.x) {
1406
- g.type = "point";
1407
- item.symbol = props2.viewModelActivePointSymbol;
1408
- }
1409
- return new Graphic(item);
814
+ function Ae() {
815
+ const d = nn(e.modelValue).map((P) => {
816
+ const b = P.geometry;
817
+ return b.rings ? (b.type = "polygon", P.symbol = e.viewModelActiveFillSymbol) : b.paths ? (b.type = "polyline", P.symbol = e.viewModelActiveLineSymbol) : b.x && (b.type = "point", P.symbol = e.viewModelActivePointSymbol), new nt(P);
1410
818
  });
1411
- sketchValue.value = graphics;
819
+ S.value = d;
1412
820
  }
1413
- watch(() => props2.flying, v => {
1414
- v && fly();
821
+ oe(() => e.flying, (u) => {
822
+ u && V();
1415
823
  });
1416
- async function fly() {
1417
- const view = await viewDef.promise;
1418
- if (!view) return;
1419
- emit("update:flying", true);
1420
- await view.when();
1421
- view.goTo(sketchValue.value).finally(() => {
1422
- emit("update:flying", false);
1423
- });
824
+ async function V() {
825
+ const u = await f.promise;
826
+ u && (t("update:flying", !0), await u.when(), u.goTo(S.value).finally(() => {
827
+ t("update:flying", !1);
828
+ }));
1424
829
  }
1425
830
  return {
1426
- inputBindProps,
1427
- inputOnEmits,
1428
- append,
1429
- availableCreatureTools,
1430
- sketchValue,
1431
- handleUpdateSketchValue,
1432
- sketchRef,
1433
- sketchLoad,
1434
- shetchPanel,
1435
- dialogShow,
1436
- setDialogShow,
1437
- normalMapRef,
1438
- dialogMapRef,
1439
- dialogOnOpen,
1440
- dialogOnClose,
1441
- mapTo,
1442
- doSave,
1443
- readonly,
1444
- layerLoad,
1445
- sketchIf,
1446
- fly,
1447
- layerRef,
1448
- getInputModelValue,
1449
- tr
831
+ inputBindProps: o,
832
+ inputOnEmits: n,
833
+ append: Ie,
834
+ availableCreatureTools: $,
835
+ sketchValue: S,
836
+ handleUpdateSketchValue: Ce,
837
+ sketchRef: s,
838
+ sketchLoad: m,
839
+ shetchPanel: c,
840
+ dialogShow: E,
841
+ setDialogShow: Se,
842
+ normalMapRef: U,
843
+ dialogMapRef: j,
844
+ dialogOnOpen: Ee,
845
+ dialogOnClose: Ve,
846
+ mapTo: I,
847
+ doSave: Pe,
848
+ readonly: l,
849
+ layerLoad: g,
850
+ sketchIf: i,
851
+ fly: V,
852
+ layerRef: p,
853
+ getInputModelValue: a,
854
+ tr: r
1450
855
  };
1451
856
  }
1452
- });
1453
-
1454
- const _hoisted_1 = { class: "vkf-form-item" };
1455
- const _hoisted_2 = {
857
+ }), rn = { class: "vkf-form-item" }, an = {
1456
858
  ref: "normalMapRef",
1457
859
  class: "vkf-esri-input-geojson__map"
1458
- };
1459
- const _hoisted_3 = {
860
+ }, ln = {
1460
861
  ref: "dialogMapRef",
1461
862
  class: "vkf-esri-input-geojson-dialog__map"
1462
863
  };
1463
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1464
- const _component_VkfInput = resolveComponent("VkfInput");
1465
- const _component_DocumentChecked = resolveComponent("DocumentChecked");
1466
- const _component_ElIcon = resolveComponent("ElIcon");
1467
- const _component_VkAsyncTeleport = resolveComponent("VkAsyncTeleport");
1468
- const _component_VaSketch = resolveComponent("VaSketch");
1469
- const _component_VaGraphicsLayer = resolveComponent("VaGraphicsLayer");
1470
- const _component_ViewerVue = resolveComponent("ViewerVue");
1471
- const _component_ElDialog = resolveComponent("ElDialog");
1472
- return openBlock(), createElementBlock("div", _hoisted_1, [
1473
- renderSlot(_ctx.$slots, "custom", {
1474
- modelValue: _ctx.modelValue,
1475
- fly: _ctx.fly,
1476
- setDialogShow: _ctx.setDialogShow,
1477
- layer: _ctx.layerRef,
1478
- showMap: _ctx.showMap
864
+ function un(e, t, o, n, r, a) {
865
+ const l = h("VkfInput"), i = h("DocumentChecked"), s = h("ElIcon"), c = h("VkAsyncTeleport"), f = h("VaSketch"), p = h("VaGraphicsLayer"), m = h("ViewerVue"), g = h("ElDialog");
866
+ return w(), $e("div", rn, [
867
+ A(e.$slots, "custom", {
868
+ modelValue: e.modelValue,
869
+ fly: e.fly,
870
+ setDialogShow: e.setDialogShow,
871
+ layer: e.layerRef,
872
+ showMap: e.showMap
1479
873
  }, () => [
1480
- createVNode(_component_VkfInput, mergeProps({
1481
- readonly: true,
1482
- "model-value": _ctx.getInputModelValue(_ctx.modelValue)
1483
- }, _ctx.inputBindProps, {
874
+ y(l, fe({
875
+ readonly: !0,
876
+ "model-value": e.getInputModelValue(e.modelValue)
877
+ }, e.inputBindProps, {
1484
878
  "input-slots": {
1485
- append: _ctx.append
879
+ append: e.append
1486
880
  }
1487
- }, toHandlers(_ctx.inputOnEmits)), null, 16, ["model-value", "input-slots"])
881
+ }, Be(e.inputOnEmits)), null, 16, ["model-value", "input-slots"])
1488
882
  ]),
1489
- createVNode(_component_VkAsyncTeleport, { to: _ctx.mapTo }, {
1490
- default: withCtx(() => [
1491
- createVNode(_component_ViewerVue, {
1492
- view: _ctx.view,
1493
- "view-component": _ctx.viewComponent,
1494
- "view-component-attrs": _ctx.viewComponentAttrs
883
+ y(c, { to: e.mapTo }, {
884
+ default: v(() => [
885
+ y(m, {
886
+ view: e.view,
887
+ "view-component": e.viewComponent,
888
+ "view-component-attrs": e.viewComponentAttrs
1495
889
  }, {
1496
- default: withCtx(() => [
1497
- createVNode(_component_VaGraphicsLayer, {
1498
- index: _ctx.layerIndex,
1499
- graphics: _ctx.sketchValue,
1500
- onLoad: _ctx.layerLoad
890
+ default: v(() => [
891
+ y(p, {
892
+ index: e.layerIndex,
893
+ graphics: e.sketchValue,
894
+ onLoad: e.layerLoad
1501
895
  }, {
1502
- default: withCtx(() => [
1503
- !(_ctx.readonly || !_ctx.sketchIf) ? (openBlock(), createBlock(_component_VaSketch, {
896
+ default: v(() => [
897
+ e.readonly || !e.sketchIf ? O("", !0) : (w(), _(f, {
1504
898
  key: 0,
1505
- "view-model-active-fill-symbol": _ctx.viewModelActiveFillSymbol,
1506
- "view-model-active-line-symbol": _ctx.viewModelActiveLineSymbol,
1507
- "view-model-active-point-symbol": _ctx.viewModelActivePointSymbol,
1508
- multiple: _ctx.multiple,
1509
- "available-creature-tools": _ctx.availableCreatureTools,
1510
- "model-value": _ctx.sketchValue,
1511
- "visible-elements": _ctx.visibleElements,
1512
- "onUpdate:modelValue": _ctx.handleUpdateSketchValue,
1513
- onLoad: _ctx.sketchLoad
899
+ "view-model-active-fill-symbol": e.viewModelActiveFillSymbol,
900
+ "view-model-active-line-symbol": e.viewModelActiveLineSymbol,
901
+ "view-model-active-point-symbol": e.viewModelActivePointSymbol,
902
+ multiple: e.multiple,
903
+ "available-creature-tools": e.availableCreatureTools,
904
+ "model-value": e.sketchValue,
905
+ "visible-elements": e.visibleElements,
906
+ "onUpdate:modelValue": e.handleUpdateSketchValue,
907
+ onLoad: e.sketchLoad
1514
908
  }, {
1515
- default: withCtx(() => [
1516
- !_ctx.skipSave && _ctx.shetchPanel ? (openBlock(), createBlock(_component_VkAsyncTeleport, {
909
+ default: v(() => [
910
+ !e.skipSave && e.shetchPanel ? (w(), _(c, {
1517
911
  key: 0,
1518
- to: _ctx.shetchPanel
912
+ to: e.shetchPanel
1519
913
  }, {
1520
- default: withCtx(() => [
1521
- createVNode(_component_ElIcon, {
914
+ default: v(() => [
915
+ y(s, {
1522
916
  class: "esri-sketch-ui-save esri-widget--button",
1523
- onClick: _ctx.doSave
917
+ onClick: e.doSave
1524
918
  }, {
1525
- default: withCtx(() => [
1526
- createVNode(_component_DocumentChecked)
919
+ default: v(() => [
920
+ y(i)
1527
921
  ]),
1528
922
  _: 1
1529
- /* STABLE */
1530
923
  }, 8, ["onClick"])
1531
924
  ]),
1532
925
  _: 1
1533
- /* STABLE */
1534
- }, 8, ["to"])) : createCommentVNode("v-if", true)
926
+ }, 8, ["to"])) : O("", !0)
1535
927
  ]),
1536
928
  _: 1
1537
- /* STABLE */
1538
- }, 8, ["view-model-active-fill-symbol", "view-model-active-line-symbol", "view-model-active-point-symbol", "multiple", "available-creature-tools", "model-value", "visible-elements", "onUpdate:modelValue", "onLoad"])) : createCommentVNode("v-if", true)
929
+ }, 8, ["view-model-active-fill-symbol", "view-model-active-line-symbol", "view-model-active-point-symbol", "multiple", "available-creature-tools", "model-value", "visible-elements", "onUpdate:modelValue", "onLoad"]))
1539
930
  ]),
1540
931
  _: 1
1541
- /* STABLE */
1542
932
  }, 8, ["index", "graphics", "onLoad"])
1543
933
  ]),
1544
934
  _: 1
1545
- /* STABLE */
1546
935
  }, 8, ["view", "view-component", "view-component-attrs"])
1547
936
  ]),
1548
937
  _: 1
1549
- /* STABLE */
1550
938
  }, 8, ["to"]),
1551
- withDirectives(createElementVNode(
1552
- "div",
1553
- _hoisted_2,
1554
- null,
1555
- 512
1556
- /* NEED_PATCH */
1557
- ), [
1558
- [vShow, _ctx.showMap]
939
+ Ue(re("div", an, null, 512), [
940
+ [Ge, e.showMap]
1559
941
  ]),
1560
- createVNode(_component_ElDialog, {
1561
- modelValue: _ctx.dialogShow,
1562
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.dialogShow = $event),
1563
- title: _ctx.dialogEditTitle || _ctx.tr("vkf.esriInputGeojson.dialogEditTitle", "\u7ED8\u5236\u56FE\u6591"),
1564
- fullscreen: _ctx.dialogEditFullscreen,
942
+ y(g, {
943
+ modelValue: e.dialogShow,
944
+ "onUpdate:modelValue": t[0] || (t[0] = ($) => e.dialogShow = $),
945
+ title: e.dialogEditTitle || e.tr("vkf.esriInputGeojson.dialogEditTitle", "绘制图斑"),
946
+ fullscreen: e.dialogEditFullscreen,
1565
947
  "modal-class": "vkf-esri-input-geojson-dialog",
1566
- "append-to-body": true,
1567
- "close-on-click-modal": false,
1568
- draggable: true,
1569
- onOpen: _ctx.dialogOnOpen,
1570
- onClose: _ctx.dialogOnClose
948
+ "append-to-body": !0,
949
+ "close-on-click-modal": !1,
950
+ draggable: !0,
951
+ onOpen: e.dialogOnOpen,
952
+ onClose: e.dialogOnClose
1571
953
  }, {
1572
- default: withCtx(() => [
1573
- createElementVNode(
1574
- "div",
1575
- _hoisted_3,
1576
- null,
1577
- 512
1578
- /* NEED_PATCH */
1579
- )
954
+ default: v(() => [
955
+ re("div", ln, null, 512)
1580
956
  ]),
1581
957
  _: 1
1582
- /* STABLE */
1583
958
  }, 8, ["modelValue", "title", "fullscreen", "onOpen", "onClose"])
1584
959
  ]);
1585
960
  }
1586
- var VkfEsriInputGeojson = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/esri-input-geojson/src/index.vue"]]);
1587
-
1588
- var types = /*#__PURE__*/Object.freeze({
961
+ const Sn = /* @__PURE__ */ Y(on, [["render", un]]), En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1589
962
  __proto__: null
1590
- });
1591
-
1592
- VkfEsriInputGeojson.install = (app) => {
1593
- app.component(VkfEsriInputGeojson.name, VkfEsriInputGeojson);
963
+ }, Symbol.toStringTag, { value: "Module" }));
964
+ export {
965
+ lt as EDIT_TYPE,
966
+ it as EDIT_TYPE_OPTIONS,
967
+ le as EDIT_TYPE_REFLECT,
968
+ ut as EMPTY_FEATURE_COLLECTION,
969
+ Sn as VkfEsriInputGeojson,
970
+ Cn as _VkfEsriInputGeojsonCtx,
971
+ En as __VkfEsriInputGeojson,
972
+ Sn as default
1594
973
  };
1595
-
1596
- export { EDIT_TYPE, EDIT_TYPE_OPTIONS, EDIT_TYPE_REFLECT, EMPTY_FEATURE_COLLECTION, VkfEsriInputGeojson, ctx as _VkfEsriInputGeojsonCtx, types as __VkfEsriInputGeojson, VkfEsriInputGeojson as default };