@vunk/form 2.18.2 → 2.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) 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 +152 -172
  5. package/components/api-tables-select/src/index.vue.d.ts +394 -983
  6. package/components/button/index.cjs +1 -112
  7. package/components/button/index.mjs +57 -85
  8. package/components/button/src/ctx.d.ts +28 -113
  9. package/components/button/src/index.vue.d.ts +317 -625
  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 +54 -951
  13. package/components/card-input-collection/src/ctx.d.ts +19 -49
  14. package/components/card-input-collection/src/index.vue.d.ts +46 -110
  15. package/components/cascader/index.cjs +1 -150
  16. package/components/cascader/index.mjs +88 -116
  17. package/components/cascader/src/ctx.d.ts +140 -207
  18. package/components/cascader/src/index.vue.d.ts +315 -522
  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 +448 -1016
  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 +130 -107
  28. package/components/color-picker/src/index.vue.d.ts +285 -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 +123 -206
  32. package/components/date-picker/src/index.vue.d.ts +269 -1358
  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 +130 -206
  37. package/components/date-picker-range/src/index.vue.d.ts +861 -448
  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 -1072
  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 +21 -52
  46. package/components/dialog-input-collection/src/dialog-form.vue.d.ts +29 -6371
  47. package/components/dialog-input-collection/src/index.vue.d.ts +65 -7630
  48. package/components/dialog-input-collection/src/layout.vue.d.ts +13 -73
  49. package/components/download-plus/index.cjs +1 -456
  50. package/components/download-plus/index.mjs +215 -358
  51. package/components/download-plus/src/api.d.ts +1 -1
  52. package/components/download-plus/src/ctx.d.ts +21 -52
  53. package/components/download-plus/src/index.vue.d.ts +437 -1177
  54. package/components/editable-text/index.cjs +1 -295
  55. package/components/editable-text/index.mjs +113 -239
  56. package/components/editable-text/src/ctx.d.ts +24 -50
  57. package/components/editable-text/src/index.vue.d.ts +59 -3258
  58. package/components/el-slider/index.cjs +1 -0
  59. package/components/el-slider/index.d.ts +5 -0
  60. package/components/el-slider/index.mjs +475 -0
  61. package/components/el-slider/src/button.d.ts +36 -0
  62. package/components/el-slider/src/button.vue.d.ts +41 -0
  63. package/components/el-slider/src/composables/index.cjs +1 -0
  64. package/components/el-slider/src/composables/index.d.ts +6 -0
  65. package/components/el-slider/src/composables/index.mjs +9 -0
  66. package/components/el-slider/src/composables/use-lifecycle.d.ts +4 -0
  67. package/components/el-slider/src/composables/use-marks.d.ts +7 -0
  68. package/components/el-slider/src/composables/use-slide.d.ts +23 -0
  69. package/components/el-slider/src/composables/use-slider-button.d.ts +18 -0
  70. package/components/el-slider/src/composables/use-stops.d.ts +8 -0
  71. package/components/el-slider/src/composables/use-watch.d.ts +4 -0
  72. package/components/el-slider/src/constants.d.ts +14 -0
  73. package/components/el-slider/src/marker.d.ts +37 -0
  74. package/components/el-slider/src/slider-core.vue.d.ts +218 -0
  75. package/components/el-slider/src/slider.d.ts +174 -0
  76. package/components/esri-input-geojson/index.cjs +2 -1604
  77. package/components/esri-input-geojson/index.mjs +682 -1290
  78. package/components/esri-input-geojson/src/append.vue.d.ts +239 -1099
  79. package/components/esri-input-geojson/src/const.d.ts +1 -1
  80. package/components/esri-input-geojson/src/ctx.d.ts +66 -161
  81. package/components/esri-input-geojson/src/default-view.vue.d.ts +8 -132
  82. package/components/esri-input-geojson/src/index.vue.d.ts +982 -708
  83. package/components/esri-input-geojson/src/types.d.ts +1 -0
  84. package/components/esri-input-geojson/src/viewer.vue.d.ts +53 -282
  85. package/components/fieldset/index.cjs +1 -110
  86. package/components/fieldset/index.mjs +63 -76
  87. package/components/fieldset/src/ctx.d.ts +4 -4
  88. package/components/fieldset/src/index.vue.d.ts +7 -7
  89. package/components/form/index.cjs +1 -248
  90. package/components/form/index.mjs +107 -161
  91. package/components/form/src/ctx.d.ts +15 -64
  92. package/components/form/src/index.vue.d.ts +374 -2431
  93. package/components/form-item/index.cjs +1 -294
  94. package/components/form-item/index.mjs +140 -229
  95. package/components/form-item/src/core.vue.d.ts +32 -1854
  96. package/components/form-item/src/ctx.d.ts +19 -51
  97. package/components/form-item/src/index.vue.d.ts +38 -101
  98. package/components/form-item-renderer/index.cjs +1 -193
  99. package/components/form-item-renderer/index.mjs +103 -162
  100. package/components/form-item-renderer/src/core.vue.d.ts +9 -9
  101. package/components/form-item-renderer/src/ctx.d.ts +3 -3
  102. package/components/form-item-renderer/src/index.vue.d.ts +24 -74
  103. package/components/form-item-renderer-template/index.cjs +1 -47
  104. package/components/form-item-renderer-template/index.mjs +20 -33
  105. package/components/form-item-renderer-template/src/index.vue.d.ts +1 -1
  106. package/components/forms-provider/index.cjs +1 -99
  107. package/components/forms-provider/index.mjs +44 -73
  108. package/components/forms-provider/src/core.d.ts +3 -2
  109. package/components/forms-provider/src/segment.vue.d.ts +8 -8
  110. package/components/forms-provider/src/view.vue.d.ts +14 -4
  111. package/components/index.cjs +1 -399
  112. package/components/index2.cjs +1 -17
  113. package/components/information/index.cjs +1 -65
  114. package/components/information/index.mjs +28 -38
  115. package/components/information/src/ctx.d.ts +2 -2
  116. package/components/information/src/index.vue.d.ts +4 -4
  117. package/components/information-collection/index.cjs +1 -81
  118. package/components/information-collection/index.mjs +44 -48
  119. package/components/information-collection/src/ctx.d.ts +29 -65
  120. package/components/information-collection/src/index.vue.d.ts +64 -136
  121. package/components/information-renderer/index.cjs +1 -16
  122. package/components/information-renderer/index.d.ts +9 -9
  123. package/components/information-renderer/index.mjs +9 -10
  124. package/components/information-tag/index.cjs +1 -101
  125. package/components/information-tag/index.mjs +44 -54
  126. package/components/information-tag/src/ctx.d.ts +6 -21
  127. package/components/information-tag/src/index.vue.d.ts +23 -51
  128. package/components/information-templates-default/index.cjs +1 -101
  129. package/components/information-templates-default/index.mjs +63 -73
  130. package/components/information-templates-default/src/index.vue.d.ts +1 -1
  131. package/components/input/index.cjs +1 -115
  132. package/components/input/index.mjs +60 -83
  133. package/components/input/src/ctx.d.ts +51 -152
  134. package/components/input/src/index.vue.d.ts +392 -951
  135. package/components/input-array/index.cjs +1 -310
  136. package/components/input-array/index.mjs +114 -244
  137. package/components/input-array/src/ctx.d.ts +19 -49
  138. package/components/input-array/src/form-template.vue.d.ts +1 -901
  139. package/components/input-array/src/index.vue.d.ts +43 -730
  140. package/components/input-collection/index.cjs +1 -452
  141. package/components/input-collection/index.mjs +195 -355
  142. package/components/input-collection/src/core.vue.d.ts +64 -1026
  143. package/components/input-collection/src/ctx.d.ts +21 -51
  144. package/components/input-collection/src/index.vue.d.ts +50 -114
  145. package/components/input-file/index.cjs +1 -142
  146. package/components/input-file/index.mjs +68 -100
  147. package/components/input-file/src/ctx.d.ts +8 -29
  148. package/components/input-file/src/index.vue.d.ts +444 -74
  149. package/components/input-file/src/template.vue.d.ts +1 -124
  150. package/components/input-link/index.cjs +1 -167
  151. package/components/input-link/index.mjs +60 -83
  152. package/components/input-link/src/ctx.d.ts +52 -137
  153. package/components/input-link/src/index.vue.d.ts +833 -311
  154. package/components/input-number/index.cjs +1 -119
  155. package/components/input-number/index.mjs +73 -87
  156. package/components/input-number/src/ctx.d.ts +38 -131
  157. package/components/input-number/src/index.vue.d.ts +321 -683
  158. package/components/input-tag/index.cjs +1 -100
  159. package/components/input-tag/index.mjs +51 -78
  160. package/components/input-tag/src/ctx.d.ts +43 -145
  161. package/components/input-tag/src/index.vue.d.ts +324 -778
  162. package/components/isObject.cjs +1 -165
  163. package/components/monaco-editor/index.cjs +1 -83
  164. package/components/monaco-editor/index.mjs +40 -59
  165. package/components/monaco-editor/src/ctx.d.ts +19 -44
  166. package/components/monaco-editor/src/index.vue.d.ts +209 -109
  167. package/components/radio/index.cjs +1 -267
  168. package/components/radio/index.mjs +110 -209
  169. package/components/radio/src/ctx.d.ts +27 -91
  170. package/components/radio/src/index.vue.d.ts +298 -1279
  171. package/components/radio/src/option.vue.d.ts +29 -881
  172. package/components/radio/src/wraper.vue.d.ts +64 -196
  173. package/components/renderer-data/index.cjs +1 -41
  174. package/components/renderer-data/index.mjs +19 -26
  175. package/components/renderer-data/src/ctx.d.ts +1 -1
  176. package/components/renderer-data/src/index.vue.d.ts +2 -2
  177. package/components/select/index.cjs +1 -311
  178. package/components/select/index.mjs +156 -214
  179. package/components/select/src/core.vue.d.ts +638 -1080
  180. package/components/select/src/ctx.d.ts +140 -223
  181. package/components/select/src/index.vue.d.ts +334 -610
  182. package/components/select/src/options.vue.d.ts +1 -1
  183. package/components/slider/index.cjs +1 -88
  184. package/components/slider/index.mjs +41 -70
  185. package/components/slider/src/ctx.d.ts +63 -174
  186. package/components/slider/src/index.vue.d.ts +151 -420
  187. package/components/style.css +1 -0
  188. package/components/switch/index.cjs +1 -88
  189. package/components/switch/index.mjs +37 -69
  190. package/components/switch/src/ctx.d.ts +34 -113
  191. package/components/switch/src/index.vue.d.ts +88 -699
  192. package/components/switch/src/types.d.ts +2 -2
  193. package/components/tables-select/index.cjs +1 -263
  194. package/components/tables-select/index.mjs +102 -172
  195. package/components/tables-select/src/ctx.d.ts +76 -91
  196. package/components/tables-select/src/index.vue.d.ts +228 -4969
  197. package/components/template-instances-provider/index.cjs +1 -31
  198. package/components/template-instances-provider/index.mjs +18 -22
  199. package/components/template-instances-provider/src/index.vue.d.ts +2 -2
  200. package/components/templates-default/index.cjs +1 -235
  201. package/components/templates-default/index.mjs +152 -211
  202. package/components/templates-default/src/ctx.d.ts +5 -3
  203. package/components/templates-default/src/index.vue.d.ts +7298 -157
  204. package/components/templates-element-plus/index.cjs +1 -112
  205. package/components/templates-element-plus/index.mjs +49 -91
  206. package/components/templates-element-plus/src/ctx.d.ts +1 -1
  207. package/components/templates-element-plus/src/index.vue.d.ts +65 -258
  208. package/components/templates-esri/index.cjs +1 -65
  209. package/components/templates-esri/index.mjs +29 -39
  210. package/components/templates-esri/src/ctx.d.ts +1 -1
  211. package/components/templates-esri/src/index.vue.d.ts +1776 -24
  212. package/components/templates-layout/index.cjs +1 -137
  213. package/components/templates-layout/index.mjs +78 -116
  214. package/components/templates-layout/src/ctx.d.ts +1 -1
  215. package/components/templates-layout/src/index.vue.d.ts +79 -411
  216. package/components/templates-variant/index.cjs +1 -70
  217. package/components/templates-variant/index.mjs +33 -43
  218. package/components/templates-variant/src/ctx.d.ts +1 -1
  219. package/components/templates-variant/src/index.vue.d.ts +1238 -24
  220. package/components/time-picker/index.cjs +1 -104
  221. package/components/time-picker/index.mjs +57 -87
  222. package/components/time-picker/src/ctx.d.ts +121 -211
  223. package/components/time-picker/src/index.vue.d.ts +263 -1368
  224. package/components/upload/index.cjs +1 -663
  225. package/components/upload/index.mjs +343 -537
  226. package/components/upload/src/ctx.d.ts +108 -195
  227. package/components/upload/src/file.vue.d.ts +197 -776
  228. package/components/upload/src/index.vue.d.ts +689 -1931
  229. package/components/upload/src/types.d.ts +1 -1
  230. package/components/upload/src/wraper.vue.d.ts +232 -407
  231. package/components/upload-plus/index.cjs +21 -18673
  232. package/components/upload-plus/index.mjs +4598 -18372
  233. package/components/upload-plus/src/api.d.ts +2 -2
  234. package/components/upload-plus/src/ctx.d.ts +24 -51
  235. package/components/upload-plus/src/index.vue.d.ts +51 -1656
  236. package/components/use-watch.cjs +1 -0
  237. package/components/van-cascader/index.cjs +1 -125
  238. package/components/van-cascader/index.mjs +51 -96
  239. package/components/van-cascader/src/ctx.d.ts +135 -203
  240. package/components/van-cascader/src/index.vue.d.ts +312 -985
  241. package/components/var-datetime-picker/index.cjs +1 -333
  242. package/components/var-datetime-picker/index.mjs +175 -254
  243. package/components/var-datetime-picker/src/ctx.d.ts +19 -50
  244. package/components/var-datetime-picker/src/index.vue.d.ts +688 -1115
  245. package/components/vditor/index.cjs +1 -86
  246. package/components/vditor/index.mjs +40 -66
  247. package/components/vditor/src/ctx.d.ts +16 -45
  248. package/components/vditor/src/index.vue.d.ts +195 -120
  249. package/composables/element-plus/index.cjs +1 -23
  250. package/composables/element-plus/index.mjs +14 -18
  251. package/composables/index.cjs +1 -161
  252. package/composables/index.d.ts +1 -0
  253. package/composables/index.mjs +102 -135
  254. package/composables/useForm.d.ts +2 -2
  255. package/composables/useRtl.d.ts +18 -0
  256. package/composables/useSourceManager.d.ts +2 -2
  257. package/composables/useTemplateInstances.d.ts +3 -3
  258. package/index.css +1 -562
  259. package/index.d.ts +0 -3
  260. package/index.esm.js +23 -48
  261. package/locale/index.cjs +1 -102
  262. package/locale/index.mjs +34 -34
  263. package/locale/lang/index.cjs +1 -2
  264. package/locale/lang/index.d.ts +1 -0
  265. package/package.json +14 -85
  266. package/shared/const/index.cjs +1 -59
  267. package/shared/const/index.d.ts +1 -1
  268. package/shared/const/index.mjs +18 -20
  269. package/shared/element-plus/ctx.d.ts +40 -37
  270. package/shared/element-plus/index.cjs +1 -211
  271. package/shared/element-plus/index.mjs +93 -161
  272. package/shared/element-plus/instances.d.ts +207 -321
  273. package/shared/form/index.cjs +1 -33
  274. package/shared/form/index.mjs +23 -25
  275. package/shared/helper/index.cjs +1 -11
  276. package/shared/helper/index.mjs +7 -8
  277. package/shared/index.cjs +1 -8
  278. package/shared/index.mjs +5 -1
  279. package/shared/infer-prop/index.cjs +1 -36
  280. package/shared/infer-prop/index.mjs +22 -28
  281. package/shared/progress-it/index.cjs +1 -42
  282. package/shared/progress-it/index.mjs +15 -31
  283. package/shared/rules/index.cjs +1 -56
  284. package/shared/rules/index.mjs +19 -18
  285. package/shared/types/form/index.cjs +1 -2
  286. package/shared/types/index.cjs +1 -2
  287. package/shared/types/source/index.cjs +1 -2
  288. package/shared/types/source-manager/index.cjs +1 -2
  289. package/shared/upload/index.cjs +1 -774
  290. package/shared/upload/index.mjs +180 -764
  291. package/component.d.ts +0 -3
  292. package/components/_plugin-vue_export-helper.mjs +0 -9
  293. package/components/card-input-collection/index.css +0 -21
  294. package/components/cascader/index.css +0 -9
  295. package/components/checkbox/index.css +0 -30
  296. package/components/cloneDeep.mjs +0 -2104
  297. package/components/date-picker-range/index.css +0 -18
  298. package/components/dialog-input-collection/index.css +0 -21
  299. package/components/download-plus/index.css +0 -68
  300. package/components/editable-text/index.css +0 -9
  301. package/components/esri-input-geojson/index.css +0 -32
  302. package/components/fieldset/index.css +0 -5
  303. package/components/form-item/index.css +0 -35
  304. package/components/index.mjs +0 -378
  305. package/components/index2.mjs +0 -14
  306. package/components/information-tag/index.css +0 -6
  307. package/components/information-templates-default/index.css +0 -16
  308. package/components/input-array/index.css +0 -14
  309. package/components/input-collection/index.css +0 -20
  310. package/components/input-link/index.css +0 -4
  311. package/components/input-number/index.css +0 -13
  312. package/components/isObject.mjs +0 -158
  313. package/components/monaco-editor/index.css +0 -4
  314. package/components/radio/index.css +0 -40
  315. package/components/select/index.css +0 -15
  316. package/components/switch/index.css +0 -10
  317. package/components/tables-select/index.css +0 -3
  318. package/components/templates-layout/index.css +0 -3
  319. package/components/upload/index.css +0 -34
  320. package/components/upload-plus/index.css +0 -84
  321. package/components/van-cascader/index.css +0 -6
  322. package/components/var-datetime-picker/index.css +0 -17
  323. 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 D, 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 De } from "@vunk/form/components/input";
3
+ import { bindPropsFactory as Ne, onEmitsFactory as Je } from "@vunk/core/shared/utils-vue";
4
+ import { ElButton as qe, ElIcon as ze, ElButtonGroup as Ze, ElUpload 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, VaSketch as Qe, VaGraphicsLayer 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 = Ne(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: qe,
124
+ ElIcon: ze,
125
+ ElButtonGroup: Ze,
126
+ Upload: xe,
127
+ Edit: Ye,
128
+ ElUpload: He,
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,757 @@ 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 N(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;
388
- }
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)};
293
+ function Ct(e, t) {
294
+ if (!e.length)
295
+ return t;
296
+ if (!t.length)
297
+ return e;
298
+ var o = new Uint8Array(e.length + t.length);
299
+ return o.set(e), o.set(t, e.length), o;
300
+ }
301
+ function St() {
302
+ var e = this, t = e._array.subarray(e._index);
303
+ return e._source.read().then(function(o) {
304
+ 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
305
  });
400
306
  }
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();
307
+ function Et(e) {
308
+ if ((e |= 0) < 0)
309
+ throw new Error("invalid length");
310
+ var t = this, o = this._array.length - this._index;
311
+ if (this._index + e <= this._array.length)
312
+ return Promise.resolve(this._array.subarray(this._index, this._index += e));
313
+ var n = new Uint8Array(e);
314
+ return n.set(this._array.subarray(this._index)), function r() {
315
+ return t._source.read().then(function(a) {
316
+ 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
317
  });
438
- })();
318
+ }();
439
319
  }
440
-
441
- function slice(source) {
442
- return typeof source.slice === "function" ? source :
443
- new SliceSource(typeof source.read === "function" ? source
444
- : source.getReader());
320
+ function pe(e) {
321
+ return typeof e.slice == "function" ? e : new L(typeof e.read == "function" ? e : e.getReader());
445
322
  }
446
-
447
- function SliceSource(source) {
448
- this._source = source;
449
- this._array = empty;
450
- this._index = 0;
323
+ function L(e) {
324
+ this._source = e, this._array = W, this._index = 0;
451
325
  }
452
-
453
- SliceSource.prototype.read = slice_read;
454
- SliceSource.prototype.slice = slice_slice;
455
- SliceSource.prototype.cancel = slice_cancel;
456
-
457
- function dbf_cancel() {
326
+ L.prototype.read = St;
327
+ L.prototype.slice = Et;
328
+ L.prototype.cancel = kt;
329
+ function Vt() {
458
330
  return this._source.cancel();
459
331
  }
460
-
461
- function readBoolean(value) {
462
- return /^[nf]$/i.test(value) ? false
463
- : /^[yt]$/i.test(value) ? true
464
- : null;
332
+ function Pt(e) {
333
+ return /^[nf]$/i.test(e) ? !1 : /^[yt]$/i.test(e) ? !0 : null;
465
334
  }
466
-
467
- function readDate(value) {
468
- return new Date(+value.substring(0, 4), value.substring(4, 6) - 1, +value.substring(6, 8));
335
+ function It(e) {
336
+ return new Date(+e.substring(0, 4), e.substring(4, 6) - 1, +e.substring(6, 8));
469
337
  }
470
-
471
- function readNumber(value) {
472
- return !(value = value.trim()) || isNaN(value = +value) ? null : value;
338
+ function M(e) {
339
+ return !(e = e.trim()) || isNaN(e = +e) ? null : e;
473
340
  }
474
-
475
- function readString(value) {
476
- return value.trim() || null;
341
+ function Mt(e) {
342
+ return e.trim() || null;
477
343
  }
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
344
+ var Ot = {
345
+ B: M,
346
+ C: Mt,
347
+ D: It,
348
+ F: M,
349
+ L: Pt,
350
+ M,
351
+ N: M
487
352
  };
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};
353
+ function At() {
354
+ var e = this, t = 1;
355
+ return e._source.slice(e._recordLength).then(function(o) {
356
+ return o && o[0] !== 26 ? { done: !1, value: e._fields.reduce(function(n, r) {
357
+ return n[r.name] = Ot[r.type](e._decode(o.subarray(t, t += r.length))), n;
358
+ }, {}) } : { done: !0, value: void 0 };
496
359
  });
497
360
  }
498
-
499
- function view(array) {
500
- return new DataView(array.buffer, array.byteOffset, array.byteLength);
361
+ function C(e) {
362
+ return new DataView(e.buffer, e.byteOffset, e.byteLength);
501
363
  }
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));
364
+ function Tt(e, t) {
365
+ return e = pe(e), e.slice(32).then(function(o) {
366
+ var n = C(o);
367
+ return e.slice(n.getUint16(8, !0) - 32).then(function(r) {
368
+ return new ve(e, t, n, C(r));
509
369
  });
510
370
  });
511
371
  }
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;
372
+ function ve(e, t, o, n) {
373
+ this._source = e, this._decode = t.decode.bind(t), this._recordLength = o.getUint16(10, !0), this._fields = [];
374
+ for (var r = 0; n.getUint8(r) !== 13; r += 32) {
375
+ for (var a = 0; a < 11 && n.getUint8(r + a) !== 0; ++a)
376
+ ;
520
377
  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)
378
+ name: this._decode(new Uint8Array(n.buffer, n.byteOffset + r, a)),
379
+ type: String.fromCharCode(n.getUint8(r + 11)),
380
+ length: n.getUint8(r + 16)
524
381
  });
525
382
  }
526
383
  }
527
-
528
- var prototype$2 = Dbf.prototype;
529
- prototype$2.read = dbf_read;
530
- prototype$2.cancel = dbf_cancel;
531
-
532
- function cancel() {
384
+ var ye = ve.prototype;
385
+ ye.read = At;
386
+ ye.cancel = Vt;
387
+ function Rt() {
533
388
  return this._source.cancel();
534
389
  }
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};
390
+ function J(e) {
391
+ var t = 40, o, n = e.getInt32(36, !0), r = new Array(n);
392
+ for (o = 0; o < n; ++o, t += 16)
393
+ r[o] = [e.getFloat64(t, !0), e.getFloat64(t + 8, !0)];
394
+ return { type: "MultiPoint", coordinates: r };
540
395
  }
541
-
542
- function parseNull() {
396
+ function Ft() {
543
397
  return null;
544
398
  }
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)) {
399
+ function q(e) {
400
+ return { type: "Point", coordinates: [e.getFloat64(4, !0), e.getFloat64(12, !0)] };
401
+ }
402
+ function z(e) {
403
+ var t = 44, o, n = e.getInt32(36, !0), r = e.getInt32(40, !0), a = new Array(n), l = new Array(r), i = [], s = [];
404
+ for (o = 0; o < n; ++o, t += 4)
405
+ a[o] = e.getInt32(t, !0);
406
+ for (o = 0; o < r; ++o, t += 16)
407
+ l[o] = [e.getFloat64(t, !0), e.getFloat64(t + 8, !0)];
408
+ return a.forEach(function(c, f) {
409
+ var p = l.slice(c, a[f + 1]);
410
+ Lt(p) ? i.push([p]) : s.push(p);
411
+ }), s.forEach(function(c) {
412
+ i.some(function(f) {
413
+ if ($t(f[0], c))
414
+ return f.push(c), !0;
415
+ }) || i.push([c]);
416
+ }), i.length === 1 ? { type: "Polygon", coordinates: i[0] } : { type: "MultiPolygon", coordinates: i };
417
+ }
418
+ function Lt(e) {
419
+ if ((o = e.length) < 4)
420
+ return !1;
421
+ for (var t = 0, o, n = e[o - 1][1] * e[0][0] - e[o - 1][0] * e[0][1]; ++t < o; )
422
+ n += e[t - 1][1] * e[t][0] - e[t - 1][0] * e[t][1];
423
+ return n >= 0;
424
+ }
425
+ function $t(e, t) {
426
+ for (var o = -1, n = t.length, r; ++o < n; )
427
+ if (r = Bt(e, t[o]))
428
+ return r > 0;
429
+ return !1;
430
+ }
431
+ function Bt(e, t) {
432
+ for (var o = t[0], n = t[1], r = -1, a = 0, l = e.length, i = l - 1; a < l; i = a++) {
433
+ var s = e[a], c = s[0], f = s[1], p = e[i], m = p[0], g = p[1];
434
+ if (Ut(s, p, t))
597
435
  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();
436
+ f > n != g > n && o < (m - c) * (n - f) / (g - f) + c && (r = -r);
437
+ }
438
+ return r;
439
+ }
440
+ function Ut(e, t, o) {
441
+ var n = o[0] - e[0], r = o[1] - e[1];
442
+ if (n === 0 && r === 0)
443
+ return !0;
444
+ var a = t[0] - e[0], l = t[1] - e[1];
445
+ if (a === 0 && l === 0)
446
+ return !1;
447
+ var i = (n * a + r * l) / (a * a + l * l);
448
+ return i < 0 || i > 1 ? !1 : i === 0 || i === 1 ? !0 : i * a === n && i * l === r;
449
+ }
450
+ function Z(e) {
451
+ var t = 44, o, n = e.getInt32(36, !0), r = e.getInt32(40, !0), a = new Array(n), l = new Array(r);
452
+ for (o = 0; o < n; ++o, t += 4)
453
+ a[o] = e.getInt32(t, !0);
454
+ for (o = 0; o < r; ++o, t += 16)
455
+ l[o] = [e.getFloat64(t, !0), e.getFloat64(t + 8, !0)];
456
+ return n === 1 ? { type: "LineString", coordinates: l } : { type: "MultiLineString", coordinates: a.map(function(i, s) {
457
+ return l.slice(i, a[s + 1]);
458
+ }) };
459
+ }
460
+ function ue(e, t) {
461
+ var o = new Uint8Array(e.length + t.length);
462
+ return o.set(e, 0), o.set(t, e.length), o;
463
+ }
464
+ function Gt() {
465
+ var e = this;
466
+ return ++e._index, e._source.slice(12).then(function(t) {
467
+ if (t == null)
468
+ return { done: !0, value: void 0 };
469
+ var o = C(t);
470
+ function n() {
471
+ return e._source.slice(4).then(function(a) {
472
+ 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
473
  });
647
474
  }
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};
475
+ function r() {
476
+ var a = o.getInt32(4, !1) * 2 - 4, l = o.getInt32(8, !0);
477
+ return a < 0 || l && l !== e._type ? n() : e._source.slice(a).then(function(i) {
478
+ return { done: !1, value: l ? e._parse(C(ue(t.slice(8), i))) : null };
655
479
  });
656
480
  }
657
-
658
- return read();
481
+ return r();
659
482
  });
660
483
  }
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
484
+ var se = {
485
+ 0: Ft,
486
+ 1: q,
487
+ 3: Z,
488
+ 5: z,
489
+ 8: J,
490
+ 11: q,
491
+ // PointZ
492
+ 13: Z,
493
+ // PolyLineZ
494
+ 15: z,
495
+ // PolygonZ
496
+ 18: J,
497
+ // MultiPointZ
498
+ 21: q,
499
+ // PointM
500
+ 23: Z,
501
+ // PolyLineM
502
+ 25: z,
503
+ // PolygonM
504
+ 28: J
505
+ // MultiPointM
676
506
  };
677
-
678
- function shp(source) {
679
- source = slice(source);
680
- return source.slice(100).then(function(array) {
681
- return new Shp(source, view(array));
507
+ function Dt(e) {
508
+ return e = pe(e), e.slice(100).then(function(t) {
509
+ return new he(e, C(t));
682
510
  });
683
511
  }
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)];
512
+ function he(e, t) {
513
+ var o = t.getInt32(32, !0);
514
+ if (!(o in se))
515
+ throw new Error("unsupported shape type: " + o);
516
+ 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)];
692
517
  }
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() {
518
+ var me = he.prototype;
519
+ me.read = Gt;
520
+ me.cancel = Rt;
521
+ function Nt() {
522
+ }
523
+ function Jt() {
701
524
  return Promise.all([
702
525
  this._dbf && this._dbf.cancel(),
703
526
  this._shp.cancel()
704
- ]).then(noop);
527
+ ]).then(Nt);
705
528
  }
706
-
707
- function shapefile_read() {
708
- var that = this;
529
+ function qt() {
530
+ var e = this;
709
531
  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,
532
+ e._dbf ? e._dbf.read() : { value: {} },
533
+ e._shp.read()
534
+ ]).then(function(t) {
535
+ var o = t[0], n = t[1];
536
+ return n.done ? n : {
537
+ done: !1,
716
538
  value: {
717
539
  type: "Feature",
718
- properties: dbf.value,
719
- geometry: shp.value
540
+ properties: o.value,
541
+ geometry: n.value
720
542
  }
721
543
  };
722
544
  });
723
545
  }
724
-
725
- function shapefile(shpSource, dbfSource, decoder) {
546
+ function zt(e, t, o) {
726
547
  return Promise.all([
727
- shp(shpSource),
728
- dbfSource && dbf(dbfSource, decoder)
729
- ]).then(function(sources) {
730
- return new Shapefile(sources[0], sources[1]);
548
+ Dt(e),
549
+ t && Tt(t, o)
550
+ ]).then(function(n) {
551
+ return new ge(n[0], n[1]);
731
552
  });
732
553
  }
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));
554
+ function ge(e, t) {
555
+ this._shp = e, this._dbf = t, this.bbox = e.bbox;
556
+ }
557
+ var we = ge.prototype;
558
+ we.read = qt;
559
+ we.cancel = Jt;
560
+ function Zt(e, t, o) {
561
+ return typeof t == "string" ? (/\.dbf$/.test(t) || (t += ".dbf"), t = N(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 = N(e.substring(0, e.length - 4) + ".dbf").catch(function() {
562
+ })), e = N(e)) : e instanceof ArrayBuffer || e instanceof Uint8Array ? e = R(e) : e = ie(e), Promise.all([e, t]).then(function(n) {
563
+ var r = n[0], a = n[1], l = "windows-1252";
564
+ return zt(r, a, a && new TextDecoder(l));
765
565
  });
766
566
  }
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
567
+ const Ht = (e) => new Promise((t, o) => {
568
+ const n = new FileReader();
569
+ n.readAsArrayBuffer(e);
570
+ const r = {
571
+ type: "FeatureCollection",
572
+ features: []
797
573
  };
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
- }
574
+ n.onload = function() {
575
+ Zt(this.result).then((a) => a.read().then(
576
+ function l(i) {
577
+ i.done ? (i.value && r.features.push(i.value), t(r)) : (r.features.push(i.value), a.read().then(l));
578
+ }
579
+ )).catch(o);
580
+ };
581
+ }), xt = (e) => {
582
+ const t = {
583
+ shp: Ht
584
+ };
585
+ return new Promise((o, n) => {
586
+ const r = e.name.split(".").pop();
587
+ r && t[r] ? o(t[r](e)) : n(new Error(`Can't resolve the .${r} file`));
805
588
  });
806
589
  };
807
-
808
590
  /* @preserve
809
591
  * @terraformer/arcgis - v2.1.1 - MIT
810
592
  * Copyright (c) 2012-2022 Environmental Systems Research Institute, Inc.
811
593
  * Tue Aug 02 2022 14:23:48 GMT-0700 (Pacific Daylight Time)
812
594
  */
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;
595
+ var Yt = function(t, o, n, r) {
596
+ 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]);
597
+ if (i !== 0) {
598
+ var s = a / i, c = l / i;
599
+ if (s >= 0 && s <= 1 && c >= 0 && c <= 1)
600
+ return !0;
601
+ }
602
+ return !1;
603
+ }, Xt = function(t, o) {
604
+ for (var n = !1, r = -1, a = t.length, l = a - 1; ++r < a; l = r)
605
+ (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);
606
+ return n;
607
+ }, Kt = function(t, o) {
608
+ for (var n = 0; n < t.length; n++)
609
+ if (t[n] !== o[n])
610
+ return !1;
611
+ return !0;
612
+ }, _e = function(t, o) {
613
+ for (var n = 0; n < t.length - 1; n++)
614
+ for (var r = 0; r < o.length - 1; r++)
615
+ if (Yt(t[n], t[n + 1], o[r], o[r + 1]))
616
+ return !0;
617
+ return !1;
618
+ }, H = function(t) {
619
+ return Kt(t[0], t[t.length - 1]) || t.push(t[0]), t;
620
+ }, x = function(t) {
621
+ var o = 0, n = 0, r = t.length, a = t[n], l;
622
+ for (n; n < r - 1; n++)
623
+ l = t[n + 1], o += (l[0] - a[0]) * (l[1] + a[1]), a = l;
624
+ return o >= 0;
625
+ }, be = function(t) {
626
+ var o = {};
627
+ for (var n in t)
628
+ t.hasOwnProperty(n) && (o[n] = t[n]);
629
+ return o;
630
+ }, Qt = function(t, o) {
631
+ var n = _e(t, o), r = Xt(t, o[0]);
632
+ return !!(!n && r);
633
+ }, Wt = function(t) {
634
+ for (var o = [], n = [], r, a, l, i = 0; i < t.length; i++) {
635
+ var s = H(t[i].slice(0));
636
+ if (!(s.length < 4))
637
+ if (x(s)) {
638
+ var c = [s.slice().reverse()];
639
+ o.push(c);
640
+ } else
641
+ n.push(s.slice().reverse());
642
+ }
643
+ for (var f = []; n.length; ) {
644
+ l = n.pop();
645
+ var p = !1;
646
+ for (r = o.length - 1; r >= 0; r--)
647
+ if (a = o[r][0], Qt(a, l)) {
648
+ o[r].push(l), p = !0;
966
649
  break;
967
650
  }
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;
651
+ p || f.push(l);
652
+ }
653
+ for (; f.length; ) {
654
+ l = f.pop();
655
+ var m = !1;
656
+ for (r = o.length - 1; r >= 0; r--)
657
+ if (a = o[r][0], _e(a, l)) {
658
+ o[r].push(l), m = !0;
991
659
  break;
992
660
  }
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
661
+ m || o.push([l.reverse()]);
662
+ }
663
+ return o.length === 1 ? {
664
+ type: "Polygon",
665
+ coordinates: o[0]
666
+ } : {
667
+ type: "MultiPolygon",
668
+ coordinates: o
1151
669
  };
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;
670
+ }, jt = function(t, o) {
671
+ for (var n = ["OBJECTID", "FID"], r = 0; r < n.length; r++) {
672
+ var a = n[r];
673
+ if (a in t && (typeof t[a] == "string" || typeof t[a] == "number"))
674
+ return t[a];
675
+ }
676
+ throw Error("No valid id attribute found");
677
+ }, en = function e(t, o) {
678
+ var n = {};
679
+ if (t.features) {
680
+ n.type = "FeatureCollection", n.features = [];
681
+ for (var r = 0; r < t.features.length; r++)
682
+ n.features.push(e(t.features[r], o));
683
+ }
684
+ 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))
685
+ try {
686
+ n.id = jt(t.attributes, o);
687
+ } catch {
688
+ }
689
+ 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;
690
+ }, ke = function(t) {
691
+ var o = [], n = t.slice(0), r = H(n.shift().slice(0));
692
+ if (r.length >= 4) {
693
+ x(r) || r.reverse(), o.push(r);
694
+ for (var a = 0; a < n.length; a++) {
695
+ var l = H(n[a].slice(0));
696
+ l.length >= 4 && (x(l) && l.reverse(), o.push(l));
697
+ }
698
+ }
699
+ return o;
700
+ }, tn = function(t) {
701
+ for (var o = [], n = 0; n < t.length; n++)
702
+ for (var r = ke(t[n]), a = r.length - 1; a >= 0; a--) {
703
+ var l = r[a].slice(0);
704
+ o.push(l);
705
+ }
706
+ return o;
707
+ }, nn = function e(t, o) {
708
+ o = o || "OBJECTID";
709
+ var n = {
710
+ wkid: 4326
711
+ }, r = {}, a;
712
+ switch (t.type) {
713
+ case "Point":
714
+ r.x = t.coordinates[0], r.y = t.coordinates[1], t.coordinates[2] != null && (r.z = t.coordinates[2]), r.spatialReference = n;
1165
715
  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;
716
+ case "MultiPoint":
717
+ r.points = t.coordinates.slice(0), t.coordinates[0][2] != null && (r.hasZ = !0), r.spatialReference = n;
1175
718
  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;
719
+ case "LineString":
720
+ r.paths = [t.coordinates.slice(0)], t.coordinates[0][2] != null && (r.hasZ = !0), r.spatialReference = n;
1185
721
  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;
722
+ case "MultiLineString":
723
+ r.paths = t.coordinates.slice(0), t.coordinates[0][0][2] != null && (r.hasZ = !0), r.spatialReference = n;
1195
724
  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;
725
+ case "Polygon":
726
+ r.rings = ke(t.coordinates.slice(0)), t.coordinates[0][0][2] != null && (r.hasZ = !0), r.spatialReference = n;
1205
727
  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;
728
+ case "MultiPolygon":
729
+ r.rings = tn(t.coordinates.slice(0)), t.coordinates[0][0][0][2] != null && (r.hasZ = !0), r.spatialReference = n;
1215
730
  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
-
731
+ case "Feature":
732
+ t.geometry && (r.geometry = e(t.geometry, o)), r.attributes = t.properties ? be(t.properties) : {}, t.id && (r.attributes[o] = t.id);
1228
733
  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
-
734
+ case "FeatureCollection":
735
+ for (r = [], a = 0; a < t.features.length; a++)
736
+ r.push(e(t.features[a], o));
1237
737
  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
-
738
+ case "GeometryCollection":
739
+ for (r = [], a = 0; a < t.geometries.length; a++)
740
+ r.push(e(t.geometries[a], o));
1246
741
  break;
1247
742
  }
1248
-
1249
- return result;
743
+ return r;
1250
744
  };
1251
-
1252
- var _sfc_main = /* @__PURE__ */ defineComponent({
745
+ const on = /* @__PURE__ */ F({
1253
746
  name: "VkfEsriInputGeojson",
1254
747
  components: {
1255
- VkfInput,
1256
- VaSketch,
1257
- ViewerVue,
1258
- VkAsyncTeleport,
1259
- DocumentChecked: document_checked_default,
1260
- VaGraphicsLayer
748
+ VkfInput: De,
749
+ VaSketch: Qe,
750
+ ViewerVue: mt,
751
+ VkAsyncTeleport: tt,
752
+ DocumentChecked: Ke,
753
+ VaGraphicsLayer: We
1261
754
  },
1262
- props,
1263
- emits,
1264
- setup(props2, {
1265
- emit
755
+ props: X,
756
+ emits: K,
757
+ setup(e, {
758
+ emit: t
1266
759
  }) {
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
760
+ const o = T.createBindProps(e, ["inputSlots", "readonly", "modelValue"]), n = T.createOnEmits(t, ["update:modelValue"]), {
761
+ tr: r
762
+ } = rt(), a = (u) => {
763
+ const d = r("el.table.emptyText", "暂无数据");
764
+ return !u || !u.features.length ? d : JSON.stringify(u);
765
+ }, l = ot(e), i = D(!e.view), s = k(), c = ne(() => {
766
+ var d;
767
+ const u = (d = s.value) == null ? void 0 : d.container;
768
+ return u == null ? void 0 : u.querySelector(".esri-sketch__panel");
769
+ }), f = new at(), p = k(), m = async (u) => {
770
+ await u.sketch.when(), s.value = u.sketch, f.resolve(s.value.view);
771
+ }, g = async ({
772
+ view: u,
773
+ layer: d
1295
774
  }) => {
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
- }
775
+ f.resolve(u), p.value = d;
776
+ }, $ = ne(() => Array.isArray(e.editTypes) ? e.editTypes.reduce((u, d) => u.concat(le[d].availableCreatureTools), []) : le[e.editTypes].availableCreatureTools), B = D(!1), S = k([]);
777
+ oe(() => e.modelValue, (u, d) => {
778
+ B.value || (Ae(), d != null && d.features.length || V());
1316
779
  }, {
1317
- immediate: true
780
+ immediate: !0
1318
781
  });
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;
782
+ const Ce = (u) => {
783
+ S.value = Array.isArray(u) ? u : u.toArray(), e.skipSave && ee();
784
+ }, U = k(), j = k(), I = k();
785
+ Fe(() => {
786
+ I.value = U.value;
1330
787
  });
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"),
788
+ const E = D(!1), Se = (u) => {
789
+ E.value = u;
790
+ }, Ee = async () => {
791
+ I.value = j.value;
792
+ }, Ve = async () => {
793
+ I.value = U.value;
794
+ }, Pe = () => {
795
+ ee(), ae({
796
+ message: r("vkf.esriInputGeojson.saveSuccess", "保存成功"),
1345
797
  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();
798
+ }), E.value = !1, e.view && (i.value = !1);
799
+ }, Ie = () => y(pt, {
800
+ dialog: !l.value && e.dialogEdit,
801
+ upload: !l.value,
802
+ disabled: e.disabled,
803
+ onUpload: Me,
804
+ onEdit: Oe,
805
+ onFly: () => {
806
+ !e.showMap && !e.view && (E.value = !0), t("appendFly"), V();
1364
807
  }
1365
808
  }, null);
1366
- async function onUpload(e) {
1367
- if (!e.raw) return;
1368
- toGeojson(e.raw).then(res => {
1369
- emit("update:modelValue", res);
809
+ async function Me(u) {
810
+ u.raw && xt(u.raw).then((d) => {
811
+ t("update:modelValue", d);
1370
812
  }).then(() => {
1371
- ElMessage.success(tr("vkf.esriInputGeojson.uploadSuccess", "\u4E0A\u4F20\u6210\u529F"));
1372
- }).then(fly);
813
+ ae.success(r("vkf.esriInputGeojson.uploadSuccess", "上传成功"));
814
+ }).then(V);
1373
815
  }
1374
- function onEdit() {
1375
- if (!props2.view) {
1376
- dialogShow.value = true;
1377
- } else {
1378
- sketchIf.value = true;
1379
- }
1380
- emit("appendEdit");
816
+ function Oe() {
817
+ e.view ? i.value = !0 : E.value = !0, t("appendEdit");
1381
818
  }
1382
- function u() {
1383
- sketchValueUpdating.value = true;
1384
- const features = sketchValue.value.map(item => {
1385
- return arcgisToGeoJSON(item);
1386
- });
1387
- emit("update:modelValue", {
819
+ function ee() {
820
+ B.value = !0;
821
+ const u = S.value.map((d) => en(d));
822
+ t("update:modelValue", {
1388
823
  type: "FeatureCollection",
1389
- features
1390
- });
1391
- nextTick(() => {
1392
- sketchValueUpdating.value = false;
824
+ features: u
825
+ }), Le(() => {
826
+ B.value = !1;
1393
827
  });
1394
828
  }
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);
829
+ function Ae() {
830
+ const d = nn(e.modelValue).map((P) => {
831
+ const b = P.geometry;
832
+ 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
833
  });
1411
- sketchValue.value = graphics;
834
+ S.value = d;
1412
835
  }
1413
- watch(() => props2.flying, v => {
1414
- v && fly();
836
+ oe(() => e.flying, (u) => {
837
+ u && V();
1415
838
  });
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
- });
839
+ async function V() {
840
+ const u = await f.promise;
841
+ u && (t("update:flying", !0), await u.when(), u.goTo(S.value).finally(() => {
842
+ t("update:flying", !1);
843
+ }));
1424
844
  }
1425
845
  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
846
+ inputBindProps: o,
847
+ inputOnEmits: n,
848
+ append: Ie,
849
+ availableCreatureTools: $,
850
+ sketchValue: S,
851
+ handleUpdateSketchValue: Ce,
852
+ sketchRef: s,
853
+ sketchLoad: m,
854
+ shetchPanel: c,
855
+ dialogShow: E,
856
+ setDialogShow: Se,
857
+ normalMapRef: U,
858
+ dialogMapRef: j,
859
+ dialogOnOpen: Ee,
860
+ dialogOnClose: Ve,
861
+ mapTo: I,
862
+ doSave: Pe,
863
+ readonly: l,
864
+ layerLoad: g,
865
+ sketchIf: i,
866
+ fly: V,
867
+ layerRef: p,
868
+ getInputModelValue: a,
869
+ tr: r
1450
870
  };
1451
871
  }
1452
- });
1453
-
1454
- const _hoisted_1 = { class: "vkf-form-item" };
1455
- const _hoisted_2 = {
872
+ }), rn = { class: "vkf-form-item" }, an = {
1456
873
  ref: "normalMapRef",
1457
874
  class: "vkf-esri-input-geojson__map"
1458
- };
1459
- const _hoisted_3 = {
875
+ }, ln = {
1460
876
  ref: "dialogMapRef",
1461
877
  class: "vkf-esri-input-geojson-dialog__map"
1462
878
  };
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
879
+ function un(e, t, o, n, r, a) {
880
+ 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");
881
+ return w(), $e("div", rn, [
882
+ A(e.$slots, "custom", {
883
+ modelValue: e.modelValue,
884
+ fly: e.fly,
885
+ setDialogShow: e.setDialogShow,
886
+ layer: e.layerRef,
887
+ showMap: e.showMap
1479
888
  }, () => [
1480
- createVNode(_component_VkfInput, mergeProps({
1481
- readonly: true,
1482
- "model-value": _ctx.getInputModelValue(_ctx.modelValue)
1483
- }, _ctx.inputBindProps, {
889
+ y(l, fe({
890
+ readonly: !0,
891
+ "model-value": e.getInputModelValue(e.modelValue)
892
+ }, e.inputBindProps, {
1484
893
  "input-slots": {
1485
- append: _ctx.append
894
+ append: e.append
1486
895
  }
1487
- }, toHandlers(_ctx.inputOnEmits)), null, 16, ["model-value", "input-slots"])
896
+ }, Be(e.inputOnEmits)), null, 16, ["model-value", "input-slots"])
1488
897
  ]),
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
898
+ y(c, { to: e.mapTo }, {
899
+ default: v(() => [
900
+ y(m, {
901
+ view: e.view,
902
+ "view-component": e.viewComponent,
903
+ "view-component-attrs": e.viewComponentAttrs
1495
904
  }, {
1496
- default: withCtx(() => [
1497
- createVNode(_component_VaGraphicsLayer, {
1498
- index: _ctx.layerIndex,
1499
- graphics: _ctx.sketchValue,
1500
- onLoad: _ctx.layerLoad
905
+ default: v(() => [
906
+ y(p, {
907
+ index: e.layerIndex,
908
+ graphics: e.sketchValue,
909
+ onLoad: e.layerLoad
1501
910
  }, {
1502
- default: withCtx(() => [
1503
- !(_ctx.readonly || !_ctx.sketchIf) ? (openBlock(), createBlock(_component_VaSketch, {
911
+ default: v(() => [
912
+ e.readonly || !e.sketchIf ? O("", !0) : (w(), _(f, {
1504
913
  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
914
+ "view-model-active-fill-symbol": e.viewModelActiveFillSymbol,
915
+ "view-model-active-line-symbol": e.viewModelActiveLineSymbol,
916
+ "view-model-active-point-symbol": e.viewModelActivePointSymbol,
917
+ multiple: e.multiple,
918
+ "available-creature-tools": e.availableCreatureTools,
919
+ "model-value": e.sketchValue,
920
+ "visible-elements": e.visibleElements,
921
+ "onUpdate:modelValue": e.handleUpdateSketchValue,
922
+ onLoad: e.sketchLoad
1514
923
  }, {
1515
- default: withCtx(() => [
1516
- !_ctx.skipSave && _ctx.shetchPanel ? (openBlock(), createBlock(_component_VkAsyncTeleport, {
924
+ default: v(() => [
925
+ !e.skipSave && e.shetchPanel ? (w(), _(c, {
1517
926
  key: 0,
1518
- to: _ctx.shetchPanel
927
+ to: e.shetchPanel
1519
928
  }, {
1520
- default: withCtx(() => [
1521
- createVNode(_component_ElIcon, {
929
+ default: v(() => [
930
+ y(s, {
1522
931
  class: "esri-sketch-ui-save esri-widget--button",
1523
- onClick: _ctx.doSave
932
+ onClick: e.doSave
1524
933
  }, {
1525
- default: withCtx(() => [
1526
- createVNode(_component_DocumentChecked)
934
+ default: v(() => [
935
+ y(i)
1527
936
  ]),
1528
937
  _: 1
1529
- /* STABLE */
1530
938
  }, 8, ["onClick"])
1531
939
  ]),
1532
940
  _: 1
1533
- /* STABLE */
1534
- }, 8, ["to"])) : createCommentVNode("v-if", true)
941
+ }, 8, ["to"])) : O("", !0)
1535
942
  ]),
1536
943
  _: 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)
944
+ }, 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
945
  ]),
1540
946
  _: 1
1541
- /* STABLE */
1542
947
  }, 8, ["index", "graphics", "onLoad"])
1543
948
  ]),
1544
949
  _: 1
1545
- /* STABLE */
1546
950
  }, 8, ["view", "view-component", "view-component-attrs"])
1547
951
  ]),
1548
952
  _: 1
1549
- /* STABLE */
1550
953
  }, 8, ["to"]),
1551
- withDirectives(createElementVNode(
1552
- "div",
1553
- _hoisted_2,
1554
- null,
1555
- 512
1556
- /* NEED_PATCH */
1557
- ), [
1558
- [vShow, _ctx.showMap]
954
+ Ue(re("div", an, null, 512), [
955
+ [Ge, e.showMap]
1559
956
  ]),
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,
957
+ y(g, {
958
+ modelValue: e.dialogShow,
959
+ "onUpdate:modelValue": t[0] || (t[0] = ($) => e.dialogShow = $),
960
+ title: e.dialogEditTitle || e.tr("vkf.esriInputGeojson.dialogEditTitle", "绘制图斑"),
961
+ fullscreen: e.dialogEditFullscreen,
1565
962
  "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
963
+ "append-to-body": !0,
964
+ "close-on-click-modal": !1,
965
+ draggable: !0,
966
+ onOpen: e.dialogOnOpen,
967
+ onClose: e.dialogOnClose
1571
968
  }, {
1572
- default: withCtx(() => [
1573
- createElementVNode(
1574
- "div",
1575
- _hoisted_3,
1576
- null,
1577
- 512
1578
- /* NEED_PATCH */
1579
- )
969
+ default: v(() => [
970
+ re("div", ln, null, 512)
1580
971
  ]),
1581
972
  _: 1
1582
- /* STABLE */
1583
973
  }, 8, ["modelValue", "title", "fullscreen", "onOpen", "onClose"])
1584
974
  ]);
1585
975
  }
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({
976
+ const Sn = /* @__PURE__ */ Y(on, [["render", un]]), En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1589
977
  __proto__: null
1590
- });
1591
-
1592
- VkfEsriInputGeojson.install = (app) => {
1593
- app.component(VkfEsriInputGeojson.name, VkfEsriInputGeojson);
978
+ }, Symbol.toStringTag, { value: "Module" }));
979
+ export {
980
+ lt as EDIT_TYPE,
981
+ it as EDIT_TYPE_OPTIONS,
982
+ le as EDIT_TYPE_REFLECT,
983
+ ut as EMPTY_FEATURE_COLLECTION,
984
+ Sn as VkfEsriInputGeojson,
985
+ Cn as _VkfEsriInputGeojsonCtx,
986
+ En as __VkfEsriInputGeojson,
987
+ Sn as default
1594
988
  };
1595
-
1596
- export { EDIT_TYPE, EDIT_TYPE_OPTIONS, EDIT_TYPE_REFLECT, EMPTY_FEATURE_COLLECTION, VkfEsriInputGeojson, ctx as _VkfEsriInputGeojsonCtx, types as __VkfEsriInputGeojson, VkfEsriInputGeojson as default };