@vunk/form 1.1.64 → 1.1.66

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 (282) hide show
  1. package/component.d.ts +1 -1
  2. package/components/button/index.css +1 -0
  3. package/components/button/index.d.ts +1 -1
  4. package/components/button/index.js +43 -57
  5. package/components/button/src/ctx.d.ts +13 -13
  6. package/components/button/src/ctx.js +1 -39
  7. package/components/button/src/index.css +1 -0
  8. package/components/button/src/index.vue.d.ts +37 -73
  9. package/components/button/src/types.d.ts +1 -1
  10. package/components/cascader/index.css +1 -0
  11. package/components/cascader/index.d.ts +1 -1
  12. package/components/cascader/index.js +34 -49
  13. package/components/cascader/src/ctx.d.ts +15 -15
  14. package/components/cascader/src/ctx.js +1 -38
  15. package/components/cascader/src/index.css +1 -0
  16. package/components/cascader/src/index.vue.d.ts +45 -70
  17. package/components/cascader/src/use.d.ts +1 -1
  18. package/components/cascader/src/use.js +1 -28
  19. package/components/checkbox/index.css +1 -0
  20. package/components/checkbox/index.d.ts +1 -1
  21. package/components/checkbox/index.js +48 -53
  22. package/components/checkbox/src/ctx.d.ts +14 -14
  23. package/components/checkbox/src/ctx.js +1 -46
  24. package/components/checkbox/src/index.css +1 -0
  25. package/components/checkbox/src/index.vue.d.ts +43 -63
  26. package/components/color-picker/index.css +1 -0
  27. package/components/color-picker/index.d.ts +1 -1
  28. package/components/color-picker/index.js +38 -42
  29. package/components/color-picker/src/ctx.d.ts +15 -13
  30. package/components/color-picker/src/ctx.js +1 -23
  31. package/components/color-picker/src/index.css +1 -0
  32. package/components/color-picker/src/index.vue.d.ts +36 -65
  33. package/components/date-picker/index.css +1 -0
  34. package/components/date-picker/index.d.ts +1 -1
  35. package/components/date-picker/index.js +42 -55
  36. package/components/date-picker/src/ctx.d.ts +41 -34
  37. package/components/date-picker/src/ctx.js +1 -31
  38. package/components/date-picker/src/index.css +1 -0
  39. package/components/date-picker/src/index.vue.d.ts +122 -133
  40. package/components/date-picker/src/types.d.ts +9 -9
  41. package/components/date-picker/src/types.js +1 -11
  42. package/components/esri-input-geojson/index.css +8 -6
  43. package/components/esri-input-geojson/index.d.ts +1 -1
  44. package/components/esri-input-geojson/index.js +417 -535
  45. package/components/esri-input-geojson/src/append.vue.d.ts +7 -7
  46. package/components/esri-input-geojson/src/const.d.ts +1 -1
  47. package/components/esri-input-geojson/src/const.js +1 -33
  48. package/components/esri-input-geojson/src/ctx.d.ts +44 -35
  49. package/components/esri-input-geojson/src/ctx.js +1 -128
  50. package/components/esri-input-geojson/src/default-view.vue.d.ts +9 -9
  51. package/components/esri-input-geojson/src/index.css +1 -0
  52. package/components/esri-input-geojson/src/index.vue.d.ts +142 -119
  53. package/components/esri-input-geojson/src/types.d.ts +1 -0
  54. package/components/esri-input-geojson/src/viewer.vue.d.ts +23 -22
  55. package/components/form/index.css +1 -0
  56. package/components/form/index.d.ts +1 -1
  57. package/components/form/index.js +57 -87
  58. package/components/form/src/ctx.d.ts +176 -204
  59. package/components/form/src/ctx.js +1 -61
  60. package/components/form/src/index.css +1 -0
  61. package/components/form/src/index.vue.d.ts +515 -601
  62. package/components/form/src/types.d.ts +3 -3
  63. package/components/form/src/utils.d.ts +1 -1
  64. package/components/form/src/utils.js +1 -55
  65. package/components/form-item/index.css +1 -0
  66. package/components/form-item/index.d.ts +1 -1
  67. package/components/form-item/index.js +22 -50
  68. package/components/form-item/src/ctx.d.ts +9 -9
  69. package/components/form-item/src/ctx.js +1 -53
  70. package/components/form-item/src/index.css +1 -0
  71. package/components/form-item/src/index.vue.d.ts +26 -26
  72. package/components/form-item/src/types.d.ts +1 -1
  73. package/components/form-item-renderer/index.css +1 -0
  74. package/components/form-item-renderer/index.d.ts +1 -1
  75. package/components/form-item-renderer/index.js +10 -18
  76. package/components/form-item-renderer/src/ctx.d.ts +3 -3
  77. package/components/form-item-renderer/src/ctx.js +1 -16
  78. package/components/form-item-renderer/src/index.css +1 -0
  79. package/components/form-item-renderer/src/index.vue.d.ts +9 -9
  80. package/components/form-item-renderer/src/symbols.js +1 -3
  81. package/components/form-item-renderer-template/index.css +1 -0
  82. package/components/form-item-renderer-template/index.d.ts +1 -1
  83. package/components/form-item-renderer-template/index.js +6 -13
  84. package/components/form-item-renderer-template/src/ctx.js +1 -9
  85. package/components/form-item-renderer-template/src/index.css +1 -0
  86. package/components/form-item-renderer-template/src/index.vue.d.ts +2 -2
  87. package/components/geoinput/index.css +1 -0
  88. package/components/geoinput/index.d.ts +1 -1
  89. package/components/geoinput/index.js +45 -43
  90. package/components/geoinput/src/ctx.d.ts +42 -28
  91. package/components/geoinput/src/ctx.js +1 -39
  92. package/components/geoinput/src/index.css +1 -0
  93. package/components/geoinput/src/index.vue.d.ts +111 -223
  94. package/components/geoinput/src/types.d.ts +3 -3
  95. package/components/geoinput-read/index.css +1 -0
  96. package/components/geoinput-read/index.d.ts +1 -1
  97. package/components/geoinput-read/index.js +120 -160
  98. package/components/geoinput-read/src/append.vue.d.ts +4 -4
  99. package/components/geoinput-read/src/core.vue.d.ts +130 -104
  100. package/components/geoinput-read/src/ctx.d.ts +42 -30
  101. package/components/geoinput-read/src/ctx.js +1 -66
  102. package/components/geoinput-read/src/index.css +1 -0
  103. package/components/geoinput-read/src/index.vue.d.ts +108 -151
  104. package/components/geoinput-read/src/types.d.ts +1 -1
  105. package/components/geoinput-update/index.css +9 -7
  106. package/components/geoinput-update/index.d.ts +1 -1
  107. package/components/geoinput-update/index.js +335 -366
  108. package/components/geoinput-update/src/append.vue.d.ts +5 -5
  109. package/components/geoinput-update/src/ctx.d.ts +38 -28
  110. package/components/geoinput-update/src/ctx.js +1 -85
  111. package/components/geoinput-update/src/index.css +1 -0
  112. package/components/geoinput-update/src/index.vue.d.ts +120 -98
  113. package/components/geoinput-update/src/types.d.ts +2 -2
  114. package/components/input/index.css +1 -0
  115. package/components/input/index.d.ts +1 -1
  116. package/components/input/index.js +43 -60
  117. package/components/input/src/ctx.d.ts +31 -25
  118. package/components/input/src/ctx.js +1 -46
  119. package/components/input/src/index.css +1 -0
  120. package/components/input/src/index.vue.d.ts +94 -110
  121. package/components/input/src/types.d.ts +2 -2
  122. package/components/input-link/index.css +1 -0
  123. package/components/input-link/index.d.ts +1 -1
  124. package/components/input-link/index.js +71 -92
  125. package/components/input-link/src/ctx.d.ts +26 -20
  126. package/components/input-link/src/ctx.js +1 -66
  127. package/components/input-link/src/index.css +1 -0
  128. package/components/input-link/src/index.vue.d.ts +72 -116
  129. package/components/input-number/index.css +1 -0
  130. package/components/input-number/index.d.ts +1 -1
  131. package/components/input-number/index.js +37 -45
  132. package/components/input-number/src/ctx.d.ts +15 -15
  133. package/components/input-number/src/ctx.js +1 -38
  134. package/components/input-number/src/index.css +1 -0
  135. package/components/input-number/src/index.vue.d.ts +42 -65
  136. package/components/input-number/src/types.d.ts +1 -1
  137. package/components/radio/index.css +1 -0
  138. package/components/radio/index.d.ts +1 -1
  139. package/components/radio/index.js +45 -50
  140. package/components/radio/src/ctx.d.ts +11 -11
  141. package/components/radio/src/ctx.js +1 -39
  142. package/components/radio/src/index.css +1 -0
  143. package/components/radio/src/index.vue.d.ts +41 -60
  144. package/components/radio/src/types.d.ts +1 -1
  145. package/components/select/index.css +1 -0
  146. package/components/select/index.d.ts +1 -1
  147. package/components/select/index.js +59 -64
  148. package/components/select/src/ctx.d.ts +39 -41
  149. package/components/select/src/ctx.js +1 -40
  150. package/components/select/src/index.css +1 -0
  151. package/components/select/src/index.vue.d.ts +130 -162
  152. package/components/select/src/types.d.ts +2 -2
  153. package/components/slider/index.css +1 -0
  154. package/components/slider/index.d.ts +1 -1
  155. package/components/slider/index.js +33 -50
  156. package/components/slider/src/ctx.d.ts +18 -18
  157. package/components/slider/src/ctx.js +1 -29
  158. package/components/slider/src/index.css +1 -0
  159. package/components/slider/src/index.vue.d.ts +62 -81
  160. package/components/switch/index.css +1 -0
  161. package/components/switch/index.d.ts +1 -1
  162. package/components/switch/index.js +33 -50
  163. package/components/switch/src/ctx.d.ts +22 -22
  164. package/components/switch/src/ctx.js +1 -31
  165. package/components/switch/src/index.css +1 -0
  166. package/components/switch/src/index.vue.d.ts +65 -83
  167. package/components/switch/src/types.d.ts +1 -1
  168. package/components/templates-default/index.css +1 -0
  169. package/components/templates-default/index.d.ts +1 -1
  170. package/components/templates-default/index.js +243 -172
  171. package/components/templates-default/src/ctx.d.ts +1 -1
  172. package/components/templates-default/src/ctx.js +1 -18
  173. package/components/templates-default/src/index.css +1 -0
  174. package/components/templates-default/src/index.vue.d.ts +9 -9
  175. package/components/templates-default/src/types.d.ts +16 -16
  176. package/components/templates-element-plus/index.css +1 -0
  177. package/components/templates-element-plus/index.d.ts +1 -1
  178. package/components/templates-element-plus/index.js +66 -36
  179. package/components/templates-element-plus/src/ctx.js +1 -9
  180. package/components/templates-element-plus/src/index.css +1 -0
  181. package/components/templates-element-plus/src/index.vue.d.ts +7 -7
  182. package/components/templates-element-plus/src/types.d.ts +1 -1
  183. package/components/templates-esri/index.css +1 -0
  184. package/components/templates-esri/index.d.ts +1 -1
  185. package/components/templates-esri/index.js +25 -24
  186. package/components/templates-esri/src/ctx.d.ts +1 -1
  187. package/components/templates-esri/src/ctx.js +1 -11
  188. package/components/templates-esri/src/index.css +1 -0
  189. package/components/templates-esri/src/index.vue.d.ts +6 -6
  190. package/components/templates-esri/src/types.d.ts +1 -1
  191. package/components/templates-layout/index.css +1 -0
  192. package/components/templates-layout/index.d.ts +1 -1
  193. package/components/templates-layout/index.js +96 -63
  194. package/components/templates-layout/src/ctx.js +1 -9
  195. package/components/templates-layout/src/index.css +1 -0
  196. package/components/templates-layout/src/index.vue.d.ts +7 -7
  197. package/components/templates-layout/src/types.d.ts +3 -3
  198. package/components/templates-mapbox/index.css +1 -0
  199. package/components/templates-mapbox/index.d.ts +1 -1
  200. package/components/templates-mapbox/index.js +25 -24
  201. package/components/templates-mapbox/src/ctx.d.ts +1 -1
  202. package/components/templates-mapbox/src/ctx.js +1 -11
  203. package/components/templates-mapbox/src/index.css +1 -0
  204. package/components/templates-mapbox/src/index.vue.d.ts +6 -6
  205. package/components/templates-mapbox/src/types.d.ts +1 -1
  206. package/components/upload/index.css +11 -9
  207. package/components/upload/index.d.ts +1 -1
  208. package/components/upload/index.js +264 -289
  209. package/components/upload/src/ctx.d.ts +21 -16
  210. package/components/upload/src/ctx.js +1 -45
  211. package/components/upload/src/file.vue.d.ts +19 -19
  212. package/components/upload/src/index.css +1 -0
  213. package/components/upload/src/index.vue.d.ts +54 -62
  214. package/components/upload-plus/index.css +1 -0
  215. package/components/upload-plus/index.d.ts +1 -1
  216. package/components/upload-plus/index.js +912 -9540
  217. package/components/upload-plus/src/api.d.ts +3 -3
  218. package/components/upload-plus/src/api.js +21 -18114
  219. package/components/upload-plus/src/const.js +1 -12
  220. package/components/upload-plus/src/ctx.d.ts +13 -13
  221. package/components/upload-plus/src/ctx.js +1 -58
  222. package/components/upload-plus/src/index.css +1 -0
  223. package/components/upload-plus/src/index.vue.d.ts +31 -48
  224. package/components/upload-plus/src/types.d.ts +1 -1
  225. package/components/van-cascader/index.css +1 -0
  226. package/components/van-cascader/index.d.ts +1 -1
  227. package/components/van-cascader/index.js +47 -55
  228. package/components/van-cascader/src/ctx.d.ts +13 -13
  229. package/components/van-cascader/src/ctx.js +1 -22
  230. package/components/van-cascader/src/index.css +1 -0
  231. package/components/van-cascader/src/index.vue.d.ts +40 -57
  232. package/components/var-datetime-picker/index.css +1 -0
  233. package/components/var-datetime-picker/index.d.ts +1 -1
  234. package/components/var-datetime-picker/index.js +137 -168
  235. package/components/var-datetime-picker/src/const.js +1 -91
  236. package/components/var-datetime-picker/src/ctx.d.ts +10 -10
  237. package/components/var-datetime-picker/src/ctx.js +1 -43
  238. package/components/var-datetime-picker/src/index.css +1 -0
  239. package/components/var-datetime-picker/src/index.vue.d.ts +26 -42
  240. package/components/var-datetime-picker/src/types.d.ts +1 -1
  241. package/components/vditor/index.css +1 -0
  242. package/components/vditor/index.d.ts +1 -1
  243. package/components/vditor/index.js +22 -17
  244. package/components/vditor/src/ctx.js +1 -15
  245. package/components/vditor/src/index.css +1 -0
  246. package/components/vditor/src/index.vue.d.ts +4 -3
  247. package/components/vditor/src/types.d.ts +1 -1
  248. package/composables/index.css +1 -0
  249. package/composables/index.js +1 -104
  250. package/composables/useForm.d.ts +2 -2
  251. package/composables/useSourceManager.d.ts +1 -1
  252. package/index.css +127 -20
  253. package/index.esm.js +1 -44
  254. package/package.json +1 -1
  255. package/shared/const/index.css +1 -0
  256. package/shared/const/index.d.ts +1 -1
  257. package/shared/const/index.js +1 -56
  258. package/shared/element-plus/ctx.d.ts +28 -26
  259. package/shared/element-plus/index.css +1 -0
  260. package/shared/element-plus/index.js +1 -220
  261. package/shared/element-plus/instances.d.ts +45 -38
  262. package/shared/form/index.css +1 -0
  263. package/shared/form/index.js +1 -30
  264. package/shared/helper/index.css +1 -0
  265. package/shared/helper/index.js +1 -9
  266. package/shared/index.css +1 -0
  267. package/shared/index.js +1 -56
  268. package/shared/infer-prop/index.css +1 -0
  269. package/shared/infer-prop/index.d.ts +1 -1
  270. package/shared/infer-prop/index.js +1 -34
  271. package/shared/progress-it/index.css +1 -0
  272. package/shared/progress-it/index.d.ts +4 -4
  273. package/shared/progress-it/index.js +1 -57
  274. package/shared/rules/index.css +1 -0
  275. package/shared/rules/index.js +1 -32
  276. package/shared/types/form/index.css +1 -0
  277. package/shared/types/index.css +1 -0
  278. package/shared/types/source/index.css +1 -0
  279. package/shared/types/source/index.d.ts +2 -2
  280. package/shared/types/source-manager/index.css +1 -0
  281. package/shared/upload/index.css +1 -0
  282. package/shared/upload/index.js +1 -767
@@ -16,23 +16,19 @@ var EDIT_TYPE = /* @__PURE__ */ ((EDIT_TYPE2) => {
16
16
  EDIT_TYPE2["LINE_STRING"] = "line_string";
17
17
  return EDIT_TYPE2;
18
18
  })(EDIT_TYPE || {});
19
- const EDIT_TYPE_OPTIONS = [
20
- {
21
- label: "\u70B9",
22
- value: "point" /* POINT */,
23
- availableCreatureTools: ["point"]
24
- },
25
- {
26
- label: "\u7EBF",
27
- value: "line_string" /* LINE_STRING */,
28
- availableCreatureTools: ["polyline"]
29
- },
30
- {
31
- label: "\u9762",
32
- value: "polygon" /* POLYGON */,
33
- availableCreatureTools: ["polygon", "circle", "rectangle"]
34
- }
35
- ];
19
+ const EDIT_TYPE_OPTIONS = [{
20
+ label: "\u70B9",
21
+ value: "point" /* POINT */,
22
+ availableCreatureTools: ["point"]
23
+ }, {
24
+ label: "\u7EBF",
25
+ value: "line_string" /* LINE_STRING */,
26
+ availableCreatureTools: ["polyline"]
27
+ }, {
28
+ label: "\u9762",
29
+ value: "polygon" /* POLYGON */,
30
+ availableCreatureTools: ["polygon", "circle", "rectangle"]
31
+ }];
36
32
  const EDIT_TYPE_REFLECT = EDIT_TYPE_OPTIONS.reduce((acc, cur) => {
37
33
  acc[cur.value] = cur;
38
34
  return acc;
@@ -42,26 +38,8 @@ const EMPTY_FEATURE_COLLECTION = {
42
38
  features: []
43
39
  };
44
40
 
45
- var __defProp = Object.defineProperty;
46
- var __defProps = Object.defineProperties;
47
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
48
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
49
- var __hasOwnProp = Object.prototype.hasOwnProperty;
50
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
51
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
52
- var __spreadValues = (a, b) => {
53
- for (var prop in b || (b = {}))
54
- if (__hasOwnProp.call(b, prop))
55
- __defNormalProp(a, prop, b[prop]);
56
- if (__getOwnPropSymbols)
57
- for (var prop of __getOwnPropSymbols(b)) {
58
- if (__propIsEnum.call(b, prop))
59
- __defNormalProp(a, prop, b[prop]);
60
- }
61
- return a;
62
- };
63
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
64
- const props = __spreadProps(__spreadValues({}, _VkfInputCtx.props), {
41
+ const props = {
42
+ ..._VkfInputCtx.props,
65
43
  viewComponent: null,
66
44
  viewComponentAttrs: null,
67
45
  readonly: {
@@ -78,6 +56,7 @@ const props = __spreadProps(__spreadValues({}, _VkfInputCtx.props), {
78
56
  viewModelActiveFillSymbol: {
79
57
  type: Object,
80
58
  default: () => ({
59
+ // 红色虚线,无色填充
81
60
  type: "simple-fill",
82
61
  color: [0, 0, 0, 0],
83
62
  style: "solid",
@@ -130,31 +109,35 @@ const props = __spreadProps(__spreadValues({}, _VkfInputCtx.props), {
130
109
  type: Object,
131
110
  default: void 0
132
111
  }
133
- });
112
+ };
134
113
  const createBindProps = bindPropsFactory(props);
135
- const emits = __spreadProps(__spreadValues({}, _VkfInputCtx.emits), {
114
+ const emits = {
115
+ ..._VkfInputCtx.emits,
136
116
  "update:modelValue": (e) => e,
137
117
  "update:flying": null,
118
+ /**
119
+ * 点击地图定位按钮
120
+ */
138
121
  "appendFly": null,
139
122
  appendEdit: null
140
- });
123
+ };
141
124
  const createOnEmits = onEmitsFactory(emits);
142
125
 
143
126
  var ctx = /*#__PURE__*/Object.freeze({
144
127
  __proto__: null,
145
- props: props,
146
128
  createBindProps: createBindProps,
129
+ createOnEmits: createOnEmits,
147
130
  emits: emits,
148
- createOnEmits: createOnEmits
131
+ props: props
149
132
  });
150
133
 
151
134
  /*! Element Plus Icons Vue v2.1.0 */
152
135
 
136
+
153
137
  // unplugin-vue:/plugin-vue/export-helper
154
138
  var export_helper_default = (sfc, props) => {
155
139
  let target = sfc.__vccOpts || sfc;
156
- for (let [key, val] of props)
157
- target[key] = val;
140
+ for (let [key, val] of props) target[key] = val;
158
141
  return target;
159
142
  };
160
143
 
@@ -163,126 +146,88 @@ var document_checked_vue_vue_type_script_lang_default = {
163
146
  name: "DocumentChecked"
164
147
  };
165
148
  var _hoisted_186 = {
166
- xmlns: "http://www.w3.org/2000/svg",
167
- viewBox: "0 0 1024 1024"
168
- }, _hoisted_286 = /* @__PURE__ */ createElementVNode(
169
- "path",
170
- {
149
+ xmlns: "http://www.w3.org/2000/svg",
150
+ viewBox: "0 0 1024 1024"
151
+ },
152
+ _hoisted_286 = /* @__PURE__ */createElementVNode("path", {
171
153
  fill: "currentColor",
172
154
  d: "M805.504 320 640 154.496V320h165.504zM832 384H576V128H192v768h640V384zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32zm318.4 582.144 180.992-180.992L704.64 510.4 478.4 736.64 320 578.304l45.248-45.312L478.4 646.144z"
173
- },
174
- null,
175
- -1
176
- /* HOISTED */
177
- ), _hoisted_385 = [
178
- _hoisted_286
179
- ];
155
+ }, null, -1
156
+ /* HOISTED */),
157
+ _hoisted_385 = [_hoisted_286];
180
158
  function _sfc_render86(_ctx, _cache, $props, $setup, $data, $options) {
181
159
  return openBlock(), createElementBlock("svg", _hoisted_186, _hoisted_385);
182
160
  }
183
- var document_checked_default = /* @__PURE__ */ export_helper_default(document_checked_vue_vue_type_script_lang_default, [["render", _sfc_render86], ["__file", "document-checked.vue"]]);
161
+ var document_checked_default = /* @__PURE__ */export_helper_default(document_checked_vue_vue_type_script_lang_default, [["render", _sfc_render86], ["__file", "document-checked.vue"]]);
184
162
 
185
163
  // unplugin-vue:/home/runner/work/element-plus-icons/element-plus-icons/packages/vue/src/components/edit.vue?vue&type=script&lang.ts
186
164
  var edit_vue_vue_type_script_lang_default = {
187
165
  name: "Edit"
188
166
  };
189
167
  var _hoisted_194 = {
190
- xmlns: "http://www.w3.org/2000/svg",
191
- viewBox: "0 0 1024 1024"
192
- }, _hoisted_294 = /* @__PURE__ */ createElementVNode(
193
- "path",
194
- {
168
+ xmlns: "http://www.w3.org/2000/svg",
169
+ viewBox: "0 0 1024 1024"
170
+ },
171
+ _hoisted_294 = /* @__PURE__ */createElementVNode("path", {
195
172
  fill: "currentColor",
196
173
  d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640V512z"
197
- },
198
- null,
199
- -1
200
- /* HOISTED */
201
- ), _hoisted_393 = /* @__PURE__ */ createElementVNode(
202
- "path",
203
- {
174
+ }, null, -1
175
+ /* HOISTED */),
176
+ _hoisted_393 = /* @__PURE__ */createElementVNode("path", {
204
177
  fill: "currentColor",
205
178
  d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"
206
- },
207
- null,
208
- -1
209
- /* HOISTED */
210
- ), _hoisted_431 = [
211
- _hoisted_294,
212
- _hoisted_393
213
- ];
179
+ }, null, -1
180
+ /* HOISTED */),
181
+ _hoisted_431 = [_hoisted_294, _hoisted_393];
214
182
  function _sfc_render94(_ctx, _cache, $props, $setup, $data, $options) {
215
183
  return openBlock(), createElementBlock("svg", _hoisted_194, _hoisted_431);
216
184
  }
217
- var edit_default = /* @__PURE__ */ export_helper_default(edit_vue_vue_type_script_lang_default, [["render", _sfc_render94], ["__file", "edit.vue"]]);
185
+ var edit_default = /* @__PURE__ */export_helper_default(edit_vue_vue_type_script_lang_default, [["render", _sfc_render94], ["__file", "edit.vue"]]);
218
186
 
219
187
  // unplugin-vue:/home/runner/work/element-plus-icons/element-plus-icons/packages/vue/src/components/map-location.vue?vue&type=script&lang.ts
220
188
  var map_location_vue_vue_type_script_lang_default = {
221
189
  name: "MapLocation"
222
190
  };
223
191
  var _hoisted_1160 = {
224
- xmlns: "http://www.w3.org/2000/svg",
225
- viewBox: "0 0 1024 1024"
226
- }, _hoisted_2160 = /* @__PURE__ */ createElementVNode(
227
- "path",
228
- {
192
+ xmlns: "http://www.w3.org/2000/svg",
193
+ viewBox: "0 0 1024 1024"
194
+ },
195
+ _hoisted_2160 = /* @__PURE__ */createElementVNode("path", {
229
196
  fill: "currentColor",
230
197
  d: "M800 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576C705.472 688.128 800 534.144 800 416zM512 960C277.312 746.688 160 565.312 160 416a352 352 0 0 1 704 0c0 149.312-117.312 330.688-352 544z"
231
- },
232
- null,
233
- -1
234
- /* HOISTED */
235
- ), _hoisted_3159 = /* @__PURE__ */ createElementVNode(
236
- "path",
237
- {
198
+ }, null, -1
199
+ /* HOISTED */),
200
+ _hoisted_3159 = /* @__PURE__ */createElementVNode("path", {
238
201
  fill: "currentColor",
239
202
  d: "M512 448a64 64 0 1 0 0-128 64 64 0 0 0 0 128zm0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256zm345.6 192L960 960H672v-64H352v64H64l102.4-256h691.2zm-68.928 0H235.328l-76.8 192h706.944l-76.8-192z"
240
- },
241
- null,
242
- -1
243
- /* HOISTED */
244
- ), _hoisted_444 = [
245
- _hoisted_2160,
246
- _hoisted_3159
247
- ];
203
+ }, null, -1
204
+ /* HOISTED */),
205
+ _hoisted_444 = [_hoisted_2160, _hoisted_3159];
248
206
  function _sfc_render160(_ctx, _cache, $props, $setup, $data, $options) {
249
207
  return openBlock(), createElementBlock("svg", _hoisted_1160, _hoisted_444);
250
208
  }
251
- var map_location_default = /* @__PURE__ */ export_helper_default(map_location_vue_vue_type_script_lang_default, [["render", _sfc_render160], ["__file", "map-location.vue"]]);
209
+ var map_location_default = /* @__PURE__ */export_helper_default(map_location_vue_vue_type_script_lang_default, [["render", _sfc_render160], ["__file", "map-location.vue"]]);
252
210
 
253
211
  // unplugin-vue:/home/runner/work/element-plus-icons/element-plus-icons/packages/vue/src/components/upload.vue?vue&type=script&lang.ts
254
212
  var upload_vue_vue_type_script_lang_default = {
255
213
  name: "Upload"
256
214
  };
257
215
  var _hoisted_1275 = {
258
- xmlns: "http://www.w3.org/2000/svg",
259
- viewBox: "0 0 1024 1024"
260
- }, _hoisted_2275 = /* @__PURE__ */ createElementVNode(
261
- "path",
262
- {
216
+ xmlns: "http://www.w3.org/2000/svg",
217
+ viewBox: "0 0 1024 1024"
218
+ },
219
+ _hoisted_2275 = /* @__PURE__ */createElementVNode("path", {
263
220
  fill: "currentColor",
264
221
  d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"
265
- },
266
- null,
267
- -1
268
- /* HOISTED */
269
- ), _hoisted_3274 = [
270
- _hoisted_2275
271
- ];
222
+ }, null, -1
223
+ /* HOISTED */),
224
+ _hoisted_3274 = [_hoisted_2275];
272
225
  function _sfc_render275(_ctx, _cache, $props, $setup, $data, $options) {
273
226
  return openBlock(), createElementBlock("svg", _hoisted_1275, _hoisted_3274);
274
227
  }
275
- var upload_default = /* @__PURE__ */ export_helper_default(upload_vue_vue_type_script_lang_default, [["render", _sfc_render275], ["__file", "upload.vue"]]);
228
+ var upload_default = /* @__PURE__ */export_helper_default(upload_vue_vue_type_script_lang_default, [["render", _sfc_render275], ["__file", "upload.vue"]]);
276
229
 
277
- var _export_sfc = (sfc, props) => {
278
- const target = sfc.__vccOpts || sfc;
279
- for (const [key, val] of props) {
280
- target[key] = val;
281
- }
282
- return target;
283
- };
284
-
285
- const _sfc_main$3 = defineComponent({
230
+ var script$3 = defineComponent({
286
231
  components: {
287
232
  ElButton,
288
233
  ElIcon,
@@ -317,7 +262,8 @@ const _sfc_main$3 = defineComponent({
317
262
  }
318
263
  }
319
264
  });
320
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
265
+
266
+ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
321
267
  const _component_Upload = resolveComponent("Upload");
322
268
  const _component_ElIcon = resolveComponent("ElIcon");
323
269
  const _component_ElUpload = resolveComponent("ElUpload");
@@ -326,80 +272,78 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
326
272
  const _component_MapLocation = resolveComponent("MapLocation");
327
273
  const _component_ElButtonGroup = resolveComponent("ElButtonGroup");
328
274
  return openBlock(), createBlock(_component_ElButtonGroup, null, {
329
- default: withCtx(() => [
330
- _ctx.upload ? (openBlock(), createBlock(_component_ElUpload, {
331
- key: 0,
332
- class: "el-button el-button--default vkf-esri-input-geojson__upload",
333
- action: "",
334
- accept: "file",
335
- multiple: false,
336
- "show-file-list": false,
337
- "auto-upload": false,
338
- "on-change": _ctx.getFile,
339
- disabled: _ctx.disabled,
340
- onClick: _ctx.uploadClick
275
+ default: withCtx(() => [_ctx.upload ? (openBlock(), createBlock(_component_ElUpload, {
276
+ key: 0,
277
+ class: "el-button el-button--default vkf-esri-input-geojson__upload",
278
+ action: "",
279
+ accept: "file",
280
+ multiple: false,
281
+ "show-file-list": false,
282
+ "auto-upload": false,
283
+ "on-change": _ctx.getFile,
284
+ disabled: _ctx.disabled,
285
+ onClick: _ctx.uploadClick
286
+ }, {
287
+ default: withCtx(() => [createVNode(_component_ElIcon, {
288
+ color: "var(--el-color-primary)"
341
289
  }, {
342
- default: withCtx(() => [
343
- createVNode(_component_ElIcon, { color: "var(--el-color-primary)" }, {
344
- default: withCtx(() => [
345
- createVNode(_component_Upload)
346
- ]),
347
- _: 1
348
- }, 8, ["color"])
349
- ]),
290
+ default: withCtx(() => [createVNode(_component_Upload)]),
350
291
  _: 1
351
- }, 8, ["on-change", "disabled", "onClick"])) : createCommentVNode("v-if", true),
352
- _ctx.dialog ? (openBlock(), createBlock(_component_ElButton, {
353
- key: 1,
354
- disabled: _ctx.disabled,
355
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("edit"))
292
+ /* STABLE */
293
+ }, 8, ["color"])]),
294
+ _: 1
295
+ /* STABLE */
296
+ }, 8, ["on-change", "disabled", "onClick"])) : createCommentVNode("v-if", true), _ctx.dialog ? (openBlock(), createBlock(_component_ElButton, {
297
+ key: 1,
298
+ disabled: _ctx.disabled,
299
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("edit"))
300
+ }, {
301
+ default: withCtx(() => [createVNode(_component_ElIcon, {
302
+ color: "var(--el-color-primary)"
356
303
  }, {
357
- default: withCtx(() => [
358
- createVNode(_component_ElIcon, { color: "var(--el-color-primary)" }, {
359
- default: withCtx(() => [
360
- createVNode(_component_Edit)
361
- ]),
362
- _: 1
363
- }, 8, ["color"])
364
- ]),
304
+ default: withCtx(() => [createVNode(_component_Edit)]),
365
305
  _: 1
366
- }, 8, ["disabled"])) : createCommentVNode("v-if", true),
367
- createVNode(_component_ElButton, {
368
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("fly"))
306
+ /* STABLE */
307
+ }, 8, ["color"])]),
308
+ _: 1
309
+ /* STABLE */
310
+ }, 8, ["disabled"])) : createCommentVNode("v-if", true), createVNode(_component_ElButton, {
311
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("fly"))
312
+ }, {
313
+ default: withCtx(() => [createVNode(_component_ElIcon, {
314
+ color: "var(--el-color-primary)"
369
315
  }, {
370
- default: withCtx(() => [
371
- createVNode(_component_ElIcon, { color: "var(--el-color-primary)" }, {
372
- default: withCtx(() => [
373
- createVNode(_component_MapLocation)
374
- ]),
375
- _: 1
376
- }, 8, ["color"])
377
- ]),
316
+ default: withCtx(() => [createVNode(_component_MapLocation)]),
378
317
  _: 1
379
- })
380
- ]),
318
+ /* STABLE */
319
+ }, 8, ["color"])]),
320
+ _: 1
321
+ /* STABLE */
322
+ })]),
381
323
  _: 1
324
+ /* STABLE */
382
325
  });
383
326
  }
384
- var AppendVue = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__file", "append.vue"]]);
385
327
 
386
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
328
+ script$3.render = render$2;
329
+ script$3.__file = "esri-input-geojson/src/append.vue";
330
+
331
+ var script$2 = /* @__PURE__ */ defineComponent({
387
332
  __name: "default-view",
388
333
  setup(__props) {
389
334
  return (_ctx, _cache) => {
390
335
  return openBlock(), createBlock(unref(VaMapView), null, {
391
- default: withCtx(() => [
392
- createVNode(unref(VaTdtBasemap)),
393
- renderSlot(_ctx.$slots, "default")
394
- ]),
336
+ default: withCtx(() => [createVNode(unref(VaTdtBasemap)), renderSlot(_ctx.$slots, "default")]),
395
337
  _: 3
338
+ /* FORWARDED */
396
339
  });
397
340
  };
398
341
  }
399
342
  });
400
- var DefaultView = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "default-view.vue"]]);
401
343
 
402
- const _sfc_main$1 = defineComponent({
344
+ script$2.__file = "esri-input-geojson/src/default-view.vue";
345
+
346
+ var script$1 = defineComponent({
403
347
  components: {
404
348
  VaTdtBasemap,
405
349
  VaMapView
@@ -411,7 +355,7 @@ const _sfc_main$1 = defineComponent({
411
355
  },
412
356
  viewComponent: {
413
357
  type: [Object, Function],
414
- default: () => DefaultView
358
+ default: () => script$2
415
359
  },
416
360
  viewComponentAttrs: {
417
361
  type: Object,
@@ -431,72 +375,79 @@ const _sfc_main$1 = defineComponent({
431
375
  return {};
432
376
  }
433
377
  });
434
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
435
- return !_ctx.view ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.viewComponent), normalizeProps(mergeProps({ key: 0 }, _ctx.viewComponentAttrs)), {
436
- default: withCtx(() => [
437
- renderSlot(_ctx.$slots, "default")
438
- ]),
439
- _: 3
440
- }, 16)) : renderSlot(_ctx.$slots, "default", { key: 1 });
378
+
379
+ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
380
+ return !_ctx.view ? (openBlock(), createBlock(
381
+ resolveDynamicComponent(_ctx.viewComponent),
382
+ normalizeProps(mergeProps({
383
+ key: 0
384
+ }, _ctx.viewComponentAttrs)),
385
+ {
386
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
387
+ _: 3
388
+ /* FORWARDED */
389
+ },
390
+ 16
391
+ /* FULL_PROPS */
392
+ )) : renderSlot(_ctx.$slots, "default", {
393
+ key: 1
394
+ });
441
395
  }
442
- var ViewerVue = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "viewer.vue"]]);
396
+
397
+ script$1.render = render$1;
398
+ script$1.__file = "esri-input-geojson/src/viewer.vue";
443
399
 
444
400
  function array_cancel() {
445
401
  this._array = null;
446
402
  return Promise.resolve();
447
403
  }
448
-
449
404
  function array_read() {
450
405
  var array = this._array;
451
406
  this._array = null;
452
- return Promise.resolve(array ? {done: false, value: array} : {done: true, value: undefined});
407
+ return Promise.resolve(array ? {
408
+ done: false,
409
+ value: array
410
+ } : {
411
+ done: true,
412
+ value: undefined
413
+ });
453
414
  }
454
-
455
415
  function array(array) {
456
416
  return new ArraySource(array instanceof Uint8Array ? array : new Uint8Array(array));
457
417
  }
458
-
459
418
  function ArraySource(array) {
460
419
  this._array = array;
461
420
  }
462
-
463
421
  ArraySource.prototype.read = array_read;
464
422
  ArraySource.prototype.cancel = array_cancel;
465
-
466
423
  function fetchPath(url) {
467
- return fetch(url).then(function(response) {
468
- return response.body && response.body.getReader
469
- ? response.body.getReader()
470
- : response.arrayBuffer().then(array);
424
+ return fetch(url).then(function (response) {
425
+ return response.body && response.body.getReader ? response.body.getReader() : response.arrayBuffer().then(array);
471
426
  });
472
427
  }
473
-
474
428
  function requestPath(url) {
475
- return new Promise(function(resolve, reject) {
476
- var request = new XMLHttpRequest;
429
+ return new Promise(function (resolve, reject) {
430
+ var request = new XMLHttpRequest();
477
431
  request.responseType = "arraybuffer";
478
- request.onload = function() { resolve(array(request.response)); };
432
+ request.onload = function () {
433
+ resolve(array(request.response));
434
+ };
479
435
  request.onerror = reject;
480
436
  request.ontimeout = reject;
481
437
  request.open("GET", url, true);
482
438
  request.send();
483
439
  });
484
440
  }
485
-
486
441
  function path(path) {
487
442
  return (typeof fetch === "function" ? fetchPath : requestPath)(path);
488
443
  }
489
-
490
444
  function stream(source) {
491
445
  return typeof source.read === "function" ? source : source.getReader();
492
446
  }
493
-
494
447
  var empty = new Uint8Array(0);
495
-
496
448
  function slice_cancel() {
497
449
  return this._source.cancel();
498
450
  }
499
-
500
451
  function concat$1(a, b) {
501
452
  if (!a.length) return b;
502
453
  if (!b.length) return a;
@@ -505,22 +456,28 @@ function concat$1(a, b) {
505
456
  c.set(b, a.length);
506
457
  return c;
507
458
  }
508
-
509
459
  function slice_read() {
510
- var that = this, array = that._array.subarray(that._index);
511
- return that._source.read().then(function(result) {
460
+ var that = this,
461
+ array = that._array.subarray(that._index);
462
+ return that._source.read().then(function (result) {
512
463
  that._array = empty;
513
464
  that._index = 0;
514
- return result.done ? (array.length > 0
515
- ? {done: false, value: array}
516
- : {done: true, value: undefined})
517
- : {done: false, value: concat$1(array, result.value)};
465
+ return result.done ? array.length > 0 ? {
466
+ done: false,
467
+ value: array
468
+ } : {
469
+ done: true,
470
+ value: undefined
471
+ } : {
472
+ done: false,
473
+ value: concat$1(array, result.value)
474
+ };
518
475
  });
519
476
  }
520
-
521
477
  function slice_slice(length) {
522
478
  if ((length |= 0) < 0) throw new Error("invalid length");
523
- var that = this, index = this._array.length - this._index;
479
+ var that = this,
480
+ index = this._array.length - this._index;
524
481
 
525
482
  // If the request fits within the remaining buffer, resolve it immediately.
526
483
  if (this._index + length <= this._array.length) {
@@ -530,9 +487,8 @@ function slice_slice(length) {
530
487
  // Otherwise, read chunks repeatedly until the request is fulfilled.
531
488
  var array = new Uint8Array(length);
532
489
  array.set(this._array.subarray(this._index));
533
- return (function read() {
534
- return that._source.read().then(function(result) {
535
-
490
+ return function read() {
491
+ return that._source.read().then(function (result) {
536
492
  // When done, it’s possible the request wasn’t fully fullfilled!
537
493
  // If so, the pre-allocated array is too big and needs slicing.
538
494
  if (result.done) {
@@ -554,47 +510,34 @@ function slice_slice(length) {
554
510
  index += result.value.length;
555
511
  return read();
556
512
  });
557
- })();
513
+ }();
558
514
  }
559
-
560
515
  function slice(source) {
561
- return typeof source.slice === "function" ? source :
562
- new SliceSource(typeof source.read === "function" ? source
563
- : source.getReader());
516
+ return typeof source.slice === "function" ? source : new SliceSource(typeof source.read === "function" ? source : source.getReader());
564
517
  }
565
-
566
518
  function SliceSource(source) {
567
519
  this._source = source;
568
520
  this._array = empty;
569
521
  this._index = 0;
570
522
  }
571
-
572
523
  SliceSource.prototype.read = slice_read;
573
524
  SliceSource.prototype.slice = slice_slice;
574
525
  SliceSource.prototype.cancel = slice_cancel;
575
-
576
526
  function dbf_cancel() {
577
527
  return this._source.cancel();
578
528
  }
579
-
580
529
  function readBoolean(value) {
581
- return /^[nf]$/i.test(value) ? false
582
- : /^[yt]$/i.test(value) ? true
583
- : null;
530
+ return /^[nf]$/i.test(value) ? false : /^[yt]$/i.test(value) ? true : null;
584
531
  }
585
-
586
532
  function readDate(value) {
587
533
  return new Date(+value.substring(0, 4), value.substring(4, 6) - 1, +value.substring(6, 8));
588
534
  }
589
-
590
535
  function readNumber(value) {
591
536
  return !(value = value.trim()) || isNaN(value = +value) ? null : value;
592
537
  }
593
-
594
538
  function readString(value) {
595
539
  return value.trim() || null;
596
540
  }
597
-
598
541
  var types$1 = {
599
542
  B: readNumber,
600
543
  C: readString,
@@ -604,31 +547,34 @@ var types$1 = {
604
547
  M: readNumber,
605
548
  N: readNumber
606
549
  };
607
-
608
550
  function dbf_read() {
609
- var that = this, i = 1;
610
- return that._source.slice(that._recordLength).then(function(value) {
611
- return value && (value[0] !== 0x1a) ? {done: false, value: that._fields.reduce(function(p, f) {
612
- p[f.name] = types$1[f.type](that._decode(value.subarray(i, i += f.length)));
613
- return p;
614
- }, {})} : {done: true, value: undefined};
551
+ var that = this,
552
+ i = 1;
553
+ return that._source.slice(that._recordLength).then(function (value) {
554
+ return value && value[0] !== 0x1a ? {
555
+ done: false,
556
+ value: that._fields.reduce(function (p, f) {
557
+ p[f.name] = types$1[f.type](that._decode(value.subarray(i, i += f.length)));
558
+ return p;
559
+ }, {})
560
+ } : {
561
+ done: true,
562
+ value: undefined
563
+ };
615
564
  });
616
565
  }
617
-
618
566
  function view(array) {
619
567
  return new DataView(array.buffer, array.byteOffset, array.byteLength);
620
568
  }
621
-
622
569
  function dbf(source, decoder) {
623
570
  source = slice(source);
624
- return source.slice(32).then(function(array) {
571
+ return source.slice(32).then(function (array) {
625
572
  var head = view(array);
626
- return source.slice(head.getUint16(8, true) - 32).then(function(array) {
573
+ return source.slice(head.getUint16(8, true) - 32).then(function (array) {
627
574
  return new Dbf(source, decoder, head, view(array));
628
575
  });
629
576
  });
630
577
  }
631
-
632
578
  function Dbf(source, decoder, head, body) {
633
579
  this._source = source;
634
580
  this._decode = decoder.decode.bind(decoder);
@@ -643,62 +589,75 @@ function Dbf(source, decoder, head, body) {
643
589
  });
644
590
  }
645
591
  }
646
-
647
592
  var prototype$2 = Dbf.prototype;
648
593
  prototype$2.read = dbf_read;
649
594
  prototype$2.cancel = dbf_cancel;
650
-
651
595
  function cancel() {
652
596
  return this._source.cancel();
653
597
  }
654
-
655
598
  function parseMultiPoint(record) {
656
- var i = 40, j, n = record.getInt32(36, true), coordinates = new Array(n);
599
+ var i = 40,
600
+ j,
601
+ n = record.getInt32(36, true),
602
+ coordinates = new Array(n);
657
603
  for (j = 0; j < n; ++j, i += 16) coordinates[j] = [record.getFloat64(i, true), record.getFloat64(i + 8, true)];
658
- return {type: "MultiPoint", coordinates: coordinates};
604
+ return {
605
+ type: "MultiPoint",
606
+ coordinates: coordinates
607
+ };
659
608
  }
660
-
661
609
  function parseNull() {
662
610
  return null;
663
611
  }
664
-
665
612
  function parsePoint(record) {
666
- return {type: "Point", coordinates: [record.getFloat64(4, true), record.getFloat64(12, true)]};
613
+ return {
614
+ type: "Point",
615
+ coordinates: [record.getFloat64(4, true), record.getFloat64(12, true)]
616
+ };
667
617
  }
668
-
669
618
  function parsePolygon(record) {
670
- var i = 44, j, n = record.getInt32(36, true), m = record.getInt32(40, true), parts = new Array(n), points = new Array(m), polygons = [], holes = [];
619
+ var i = 44,
620
+ j,
621
+ n = record.getInt32(36, true),
622
+ m = record.getInt32(40, true),
623
+ parts = new Array(n),
624
+ points = new Array(m),
625
+ polygons = [],
626
+ holes = [];
671
627
  for (j = 0; j < n; ++j, i += 4) parts[j] = record.getInt32(i, true);
672
628
  for (j = 0; j < m; ++j, i += 16) points[j] = [record.getFloat64(i, true), record.getFloat64(i + 8, true)];
673
-
674
- parts.forEach(function(i, j) {
629
+ parts.forEach(function (i, j) {
675
630
  var ring = points.slice(i, parts[j + 1]);
676
- if (ringClockwise(ring)) polygons.push([ring]);
677
- else holes.push(ring);
631
+ if (ringClockwise(ring)) polygons.push([ring]);else holes.push(ring);
678
632
  });
679
-
680
- holes.forEach(function(hole) {
681
- polygons.some(function(polygon) {
633
+ holes.forEach(function (hole) {
634
+ polygons.some(function (polygon) {
682
635
  if (ringContainsSome(polygon[0], hole)) {
683
636
  polygon.push(hole);
684
637
  return true;
685
638
  }
686
639
  }) || polygons.push([hole]);
687
640
  });
688
-
689
- return polygons.length === 1
690
- ? {type: "Polygon", coordinates: polygons[0]}
691
- : {type: "MultiPolygon", coordinates: polygons};
641
+ return polygons.length === 1 ? {
642
+ type: "Polygon",
643
+ coordinates: polygons[0]
644
+ } : {
645
+ type: "MultiPolygon",
646
+ coordinates: polygons
647
+ };
692
648
  }
693
649
  function ringClockwise(ring) {
694
650
  if ((n = ring.length) < 4) return false;
695
- var i = 0, n, area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1];
651
+ var i = 0,
652
+ n,
653
+ area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1];
696
654
  while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1];
697
655
  return area >= 0;
698
656
  }
699
-
700
657
  function ringContainsSome(ring, hole) {
701
- var i = -1, n = hole.length, c;
658
+ var i = -1,
659
+ n = hole.length,
660
+ c;
702
661
  while (++i < n) {
703
662
  if (c = ringContains(ring, hole[i])) {
704
663
  return c > 0;
@@ -706,60 +665,80 @@ function ringContainsSome(ring, hole) {
706
665
  }
707
666
  return false;
708
667
  }
709
-
710
668
  function ringContains(ring, point) {
711
- var x = point[0], y = point[1], contains = -1;
669
+ var x = point[0],
670
+ y = point[1],
671
+ contains = -1;
712
672
  for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) {
713
- var pi = ring[i], xi = pi[0], yi = pi[1],
714
- pj = ring[j], xj = pj[0], yj = pj[1];
673
+ var pi = ring[i],
674
+ xi = pi[0],
675
+ yi = pi[1],
676
+ pj = ring[j],
677
+ xj = pj[0],
678
+ yj = pj[1];
715
679
  if (segmentContains(pi, pj, point)) {
716
680
  return 0;
717
681
  }
718
- if (((yi > y) !== (yj > y)) && ((x < (xj - xi) * (y - yi) / (yj - yi) + xi))) {
682
+ if (yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi) {
719
683
  contains = -contains;
720
684
  }
721
685
  }
722
686
  return contains;
723
687
  }
724
-
725
688
  function segmentContains(p0, p1, p2) {
726
- var x20 = p2[0] - p0[0], y20 = p2[1] - p0[1];
689
+ var x20 = p2[0] - p0[0],
690
+ y20 = p2[1] - p0[1];
727
691
  if (x20 === 0 && y20 === 0) return true;
728
- var x10 = p1[0] - p0[0], y10 = p1[1] - p0[1];
692
+ var x10 = p1[0] - p0[0],
693
+ y10 = p1[1] - p0[1];
729
694
  if (x10 === 0 && y10 === 0) return false;
730
695
  var t = (x20 * x10 + y20 * y10) / (x10 * x10 + y10 * y10);
731
696
  return t < 0 || t > 1 ? false : t === 0 || t === 1 ? true : t * x10 === x20 && t * y10 === y20;
732
697
  }
733
-
734
698
  function parsePolyLine(record) {
735
- var i = 44, j, n = record.getInt32(36, true), m = record.getInt32(40, true), parts = new Array(n), points = new Array(m);
699
+ var i = 44,
700
+ j,
701
+ n = record.getInt32(36, true),
702
+ m = record.getInt32(40, true),
703
+ parts = new Array(n),
704
+ points = new Array(m);
736
705
  for (j = 0; j < n; ++j, i += 4) parts[j] = record.getInt32(i, true);
737
706
  for (j = 0; j < m; ++j, i += 16) points[j] = [record.getFloat64(i, true), record.getFloat64(i + 8, true)];
738
- return n === 1
739
- ? {type: "LineString", coordinates: points}
740
- : {type: "MultiLineString", coordinates: parts.map(function(i, j) { return points.slice(i, parts[j + 1]); })};
707
+ return n === 1 ? {
708
+ type: "LineString",
709
+ coordinates: points
710
+ } : {
711
+ type: "MultiLineString",
712
+ coordinates: parts.map(function (i, j) {
713
+ return points.slice(i, parts[j + 1]);
714
+ })
715
+ };
741
716
  }
742
-
743
717
  function concat(a, b) {
744
718
  var ab = new Uint8Array(a.length + b.length);
745
719
  ab.set(a, 0);
746
720
  ab.set(b, a.length);
747
721
  return ab;
748
722
  }
749
-
750
723
  function shp_read() {
751
724
  var that = this;
752
725
  ++that._index;
753
- return that._source.slice(12).then(function(array) {
754
- if (array == null) return {done: true, value: undefined};
726
+ return that._source.slice(12).then(function (array) {
727
+ if (array == null) return {
728
+ done: true,
729
+ value: undefined
730
+ };
755
731
  var header = view(array);
756
732
 
757
733
  // If the record starts with an invalid shape type (see #36), scan ahead in
758
734
  // four-byte increments to find the next valid record, identified by the
759
735
  // expected index, a non-empty content length and a valid shape type.
760
736
  function skip() {
761
- return that._source.slice(4).then(function(chunk) {
762
- if (chunk == null) return {done: true, value: undefined};
737
+ return that._source.slice(4).then(function (chunk) {
738
+ if (chunk == null) return {
739
+ done: true,
740
+ value: undefined
741
+ };
763
742
  header = view(array = concat(array.slice(4), chunk));
764
743
  return header.getInt32(0, false) !== that._index ? skip() : read();
765
744
  });
@@ -768,35 +747,43 @@ function shp_read() {
768
747
  // All records should have at least four bytes (for the record shape type),
769
748
  // so an invalid content length indicates corruption.
770
749
  function read() {
771
- var length = header.getInt32(4, false) * 2 - 4, type = header.getInt32(8, true);
772
- return length < 0 || (type && type !== that._type) ? skip() : that._source.slice(length).then(function(chunk) {
773
- return {done: false, value: type ? that._parse(view(concat(array.slice(8), chunk))) : null};
750
+ var length = header.getInt32(4, false) * 2 - 4,
751
+ type = header.getInt32(8, true);
752
+ return length < 0 || type && type !== that._type ? skip() : that._source.slice(length).then(function (chunk) {
753
+ return {
754
+ done: false,
755
+ value: type ? that._parse(view(concat(array.slice(8), chunk))) : null
756
+ };
774
757
  });
775
758
  }
776
-
777
759
  return read();
778
760
  });
779
761
  }
780
-
781
762
  var parsers = {
782
763
  0: parseNull,
783
764
  1: parsePoint,
784
765
  3: parsePolyLine,
785
766
  5: parsePolygon,
786
767
  8: parseMultiPoint,
787
- 11: parsePoint, // PointZ
788
- 13: parsePolyLine, // PolyLineZ
789
- 15: parsePolygon, // PolygonZ
790
- 18: parseMultiPoint, // MultiPointZ
791
- 21: parsePoint, // PointM
792
- 23: parsePolyLine, // PolyLineM
793
- 25: parsePolygon, // PolygonM
768
+ 11: parsePoint,
769
+ // PointZ
770
+ 13: parsePolyLine,
771
+ // PolyLineZ
772
+ 15: parsePolygon,
773
+ // PolygonZ
774
+ 18: parseMultiPoint,
775
+ // MultiPointZ
776
+ 21: parsePoint,
777
+ // PointM
778
+ 23: parsePolyLine,
779
+ // PolyLineM
780
+ 25: parsePolygon,
781
+ // PolygonM
794
782
  28: parseMultiPoint // MultiPointM
795
783
  };
796
-
797
784
  function shp(source) {
798
785
  source = slice(source);
799
- return source.slice(100).then(function(array) {
786
+ return source.slice(100).then(function (array) {
800
787
  return new Shp(source, view(array));
801
788
  });
802
789
  }
@@ -809,27 +796,20 @@ function Shp(source, header) {
809
796
  this._parse = parsers[type];
810
797
  this.bbox = [header.getFloat64(36, true), header.getFloat64(44, true), header.getFloat64(52, true), header.getFloat64(60, true)];
811
798
  }
812
-
813
799
  var prototype$1 = Shp.prototype;
814
800
  prototype$1.read = shp_read;
815
801
  prototype$1.cancel = cancel;
816
-
817
802
  function noop() {}
818
-
819
803
  function shapefile_cancel() {
820
- return Promise.all([
821
- this._dbf && this._dbf.cancel(),
822
- this._shp.cancel()
823
- ]).then(noop);
804
+ return Promise.all([this._dbf && this._dbf.cancel(), this._shp.cancel()]).then(noop);
824
805
  }
825
-
826
806
  function shapefile_read() {
827
807
  var that = this;
828
- return Promise.all([
829
- that._dbf ? that._dbf.read() : {value: {}},
830
- that._shp.read()
831
- ]).then(function(results) {
832
- var dbf = results[0], shp = results[1];
808
+ return Promise.all([that._dbf ? that._dbf.read() : {
809
+ value: {}
810
+ }, that._shp.read()]).then(function (results) {
811
+ var dbf = results[0],
812
+ shp = results[1];
833
813
  return shp.done ? shp : {
834
814
  done: false,
835
815
  value: {
@@ -840,26 +820,19 @@ function shapefile_read() {
840
820
  };
841
821
  });
842
822
  }
843
-
844
823
  function shapefile(shpSource, dbfSource, decoder) {
845
- return Promise.all([
846
- shp(shpSource),
847
- dbfSource && dbf(dbfSource, decoder)
848
- ]).then(function(sources) {
824
+ return Promise.all([shp(shpSource), dbfSource && dbf(dbfSource, decoder)]).then(function (sources) {
849
825
  return new Shapefile(sources[0], sources[1]);
850
826
  });
851
827
  }
852
-
853
828
  function Shapefile(shp, dbf) {
854
829
  this._shp = shp;
855
830
  this._dbf = dbf;
856
831
  this.bbox = shp.bbox;
857
832
  }
858
-
859
833
  var prototype = Shapefile.prototype;
860
834
  prototype.read = shapefile_read;
861
835
  prototype.cancel = shapefile_cancel;
862
-
863
836
  function open(shp, dbf, options) {
864
837
  if (typeof dbf === "string") {
865
838
  if (!/\.dbf$/.test(dbf)) dbf += ".dbf";
@@ -871,21 +844,22 @@ function open(shp, dbf, options) {
871
844
  }
872
845
  if (typeof shp === "string") {
873
846
  if (!/\.shp$/.test(shp)) shp += ".shp";
874
- if (dbf === undefined) dbf = path(shp.substring(0, shp.length - 4) + ".dbf").catch(function() {});
847
+ if (dbf === undefined) dbf = path(shp.substring(0, shp.length - 4) + ".dbf").catch(function () {});
875
848
  shp = path(shp);
876
849
  } else if (shp instanceof ArrayBuffer || shp instanceof Uint8Array) {
877
850
  shp = array(shp);
878
851
  } else {
879
852
  shp = stream(shp);
880
853
  }
881
- return Promise.all([shp, dbf]).then(function(sources) {
882
- var shp = sources[0], dbf = sources[1], encoding = "windows-1252";
854
+ return Promise.all([shp, dbf]).then(function (sources) {
855
+ var shp = sources[0],
856
+ dbf = sources[1],
857
+ encoding = "windows-1252";
883
858
  if (options && options.encoding != null) encoding = options.encoding;
884
859
  return shapefile(shp, dbf, dbf && new TextDecoder(encoding));
885
860
  });
886
861
  }
887
-
888
- const shpToGeojson = (file) => {
862
+ const shpToGeojson = file => {
889
863
  return new Promise((resolve, reject) => {
890
864
  const reader = new FileReader();
891
865
  reader.readAsArrayBuffer(file);
@@ -893,25 +867,22 @@ const shpToGeojson = (file) => {
893
867
  type: "FeatureCollection",
894
868
  features: []
895
869
  };
896
- reader.onload = function() {
897
- open(this.result).then((source) => source.read().then(
898
- function log(result) {
899
- if (!result.done) {
870
+ reader.onload = function () {
871
+ open(this.result).then(source => source.read().then(function log(result) {
872
+ if (!result.done) {
873
+ data.features.push(result.value);
874
+ source.read().then(log);
875
+ } else {
876
+ if (result.value) {
900
877
  data.features.push(result.value);
901
- source.read().then(log);
902
- } else {
903
- if (result.value) {
904
- data.features.push(result.value);
905
- }
906
- resolve(data);
907
878
  }
879
+ resolve(data);
908
880
  }
909
- )).catch(reject);
881
+ })).catch(reject);
910
882
  };
911
883
  });
912
884
  };
913
-
914
- const toGeojson = (file) => {
885
+ const toGeojson = file => {
915
886
  const actions = {
916
887
  shp: shpToGeojson
917
888
  };
@@ -937,27 +908,22 @@ var edgeIntersectsEdge = function edgeIntersectsEdge(a1, a2, b1, b2) {
937
908
  var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);
938
909
  var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);
939
910
  var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);
940
-
941
911
  if (uB !== 0) {
942
912
  var ua = uaT / uB;
943
913
  var ub = ubT / uB;
944
-
945
914
  if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) {
946
915
  return true;
947
916
  }
948
917
  }
949
-
950
918
  return false;
951
919
  };
952
920
  var coordinatesContainPoint = function coordinatesContainPoint(coordinates, point) {
953
921
  var contains = false;
954
-
955
922
  for (var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {
956
923
  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]) {
957
924
  contains = !contains;
958
925
  }
959
926
  }
960
-
961
927
  return contains;
962
928
  };
963
929
  var pointsEqual = function pointsEqual(a, b) {
@@ -966,7 +932,6 @@ var pointsEqual = function pointsEqual(a, b) {
966
932
  return false;
967
933
  }
968
934
  }
969
-
970
935
  return true;
971
936
  };
972
937
  var arrayIntersectsArray = function arrayIntersectsArray(a, b) {
@@ -977,7 +942,6 @@ var arrayIntersectsArray = function arrayIntersectsArray(a, b) {
977
942
  }
978
943
  }
979
944
  }
980
-
981
945
  return false;
982
946
  };
983
947
 
@@ -988,7 +952,6 @@ var closeRing = function closeRing(coordinates) {
988
952
  if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {
989
953
  coordinates.push(coordinates[0]);
990
954
  }
991
-
992
955
  return coordinates;
993
956
  }; // determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring
994
957
  // or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-
@@ -1000,20 +963,17 @@ var ringIsClockwise = function ringIsClockwise(ringToTest) {
1000
963
  var rLength = ringToTest.length;
1001
964
  var pt1 = ringToTest[i];
1002
965
  var pt2;
1003
-
1004
966
  for (i; i < rLength - 1; i++) {
1005
967
  pt2 = ringToTest[i + 1];
1006
968
  total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);
1007
969
  pt1 = pt2;
1008
970
  }
1009
-
1010
971
  return total >= 0;
1011
972
  }; // This function ensures that rings are oriented in the right directions
1012
973
  // from http://jsperf.com/cloning-an-object/2
1013
974
 
1014
975
  var shallowClone = function shallowClone(obj) {
1015
976
  var target = {};
1016
-
1017
977
  for (var i in obj) {
1018
978
  // both arcgis attributes and geojson props are just hardcoded keys
1019
979
  if (obj.hasOwnProperty(i)) {
@@ -1021,7 +981,6 @@ var shallowClone = function shallowClone(obj) {
1021
981
  target[i] = obj[i];
1022
982
  }
1023
983
  }
1024
-
1025
984
  return target;
1026
985
  };
1027
986
 
@@ -1031,16 +990,13 @@ var shallowClone = function shallowClone(obj) {
1031
990
  var coordinatesContainCoordinates = function coordinatesContainCoordinates(outer, inner) {
1032
991
  var intersects = arrayIntersectsArray(outer, inner);
1033
992
  var contains = coordinatesContainPoint(outer, inner[0]);
1034
-
1035
993
  if (!intersects && contains) {
1036
994
  return true;
1037
995
  }
1038
-
1039
996
  return false;
1040
997
  }; // do any polygons in this array contain any other polygons in this array?
1041
998
  // used for checking for holes in arcgis rings
1042
999
 
1043
-
1044
1000
  var convertRingsToGeoJSON = function convertRingsToGeoJSON(rings) {
1045
1001
  var outerRings = [];
1046
1002
  var holes = [];
@@ -1053,12 +1009,10 @@ var convertRingsToGeoJSON = function convertRingsToGeoJSON(rings) {
1053
1009
 
1054
1010
  for (var r = 0; r < rings.length; r++) {
1055
1011
  var ring = closeRing(rings[r].slice(0));
1056
-
1057
1012
  if (ring.length < 4) {
1058
1013
  continue;
1059
1014
  } // is this ring an outer ring? is it clockwise?
1060
1015
 
1061
-
1062
1016
  if (ringIsClockwise(ring)) {
1063
1017
  var polygon = [ring.slice().reverse()]; // wind outer rings counterclockwise for RFC 7946 compliance
1064
1018
 
@@ -1067,7 +1021,6 @@ var convertRingsToGeoJSON = function convertRingsToGeoJSON(rings) {
1067
1021
  holes.push(ring.slice().reverse()); // wind inner rings clockwise for RFC 7946 compliance
1068
1022
  }
1069
1023
  }
1070
-
1071
1024
  var uncontainedHoles = []; // while there are holes left...
1072
1025
 
1073
1026
  while (holes.length) {
@@ -1075,10 +1028,8 @@ var convertRingsToGeoJSON = function convertRingsToGeoJSON(rings) {
1075
1028
  hole = holes.pop(); // loop over all outer rings and see if they contain our hole.
1076
1029
 
1077
1030
  var contained = false;
1078
-
1079
1031
  for (x = outerRings.length - 1; x >= 0; x--) {
1080
1032
  outerRing = outerRings[x][0];
1081
-
1082
1033
  if (coordinatesContainCoordinates(outerRing, hole)) {
1083
1034
  // the hole is contained push it into our polygon
1084
1035
  outerRings[x].push(hole);
@@ -1088,22 +1039,18 @@ var convertRingsToGeoJSON = function convertRingsToGeoJSON(rings) {
1088
1039
  } // ring is not contained in any outer ring
1089
1040
  // sometimes this happens https://github.com/Esri/esri-leaflet/issues/320
1090
1041
 
1091
-
1092
1042
  if (!contained) {
1093
1043
  uncontainedHoles.push(hole);
1094
1044
  }
1095
1045
  } // if we couldn't match any holes using contains we can try intersects...
1096
1046
 
1097
-
1098
1047
  while (uncontainedHoles.length) {
1099
1048
  // pop a hole off out stack
1100
1049
  hole = uncontainedHoles.pop(); // loop over all outer rings and see if any intersect our hole.
1101
1050
 
1102
1051
  var intersects = false;
1103
-
1104
1052
  for (x = outerRings.length - 1; x >= 0; x--) {
1105
1053
  outerRing = outerRings[x][0];
1106
-
1107
1054
  if (arrayIntersectsArray(outerRing, hole)) {
1108
1055
  // the hole is contained push it into our polygon
1109
1056
  outerRings[x].push(hole);
@@ -1111,12 +1058,10 @@ var convertRingsToGeoJSON = function convertRingsToGeoJSON(rings) {
1111
1058
  break;
1112
1059
  }
1113
1060
  }
1114
-
1115
1061
  if (!intersects) {
1116
1062
  outerRings.push([hole.reverse()]);
1117
1063
  }
1118
1064
  }
1119
-
1120
1065
  if (outerRings.length === 1) {
1121
1066
  return {
1122
1067
  type: 'Polygon',
@@ -1129,47 +1074,36 @@ var convertRingsToGeoJSON = function convertRingsToGeoJSON(rings) {
1129
1074
  };
1130
1075
  }
1131
1076
  };
1132
-
1133
1077
  var getId = function getId(attributes, idAttribute) {
1134
1078
  var keys = idAttribute ? [idAttribute, 'OBJECTID', 'FID'] : ['OBJECTID', 'FID'];
1135
-
1136
1079
  for (var i = 0; i < keys.length; i++) {
1137
1080
  var key = keys[i];
1138
-
1139
1081
  if (key in attributes && (typeof attributes[key] === 'string' || typeof attributes[key] === 'number')) {
1140
1082
  return attributes[key];
1141
1083
  }
1142
1084
  }
1143
-
1144
1085
  throw Error('No valid id attribute found');
1145
1086
  };
1146
-
1147
1087
  var arcgisToGeoJSON = function arcgisToGeoJSON(arcgis, idAttribute) {
1148
1088
  var geojson = {};
1149
-
1150
1089
  if (arcgis.features) {
1151
1090
  geojson.type = 'FeatureCollection';
1152
1091
  geojson.features = [];
1153
-
1154
1092
  for (var i = 0; i < arcgis.features.length; i++) {
1155
1093
  geojson.features.push(arcgisToGeoJSON(arcgis.features[i], idAttribute));
1156
1094
  }
1157
1095
  }
1158
-
1159
1096
  if (typeof arcgis.x === 'number' && typeof arcgis.y === 'number') {
1160
1097
  geojson.type = 'Point';
1161
1098
  geojson.coordinates = [arcgis.x, arcgis.y];
1162
-
1163
1099
  if (typeof arcgis.z === 'number') {
1164
1100
  geojson.coordinates.push(arcgis.z);
1165
1101
  }
1166
1102
  }
1167
-
1168
1103
  if (arcgis.points) {
1169
1104
  geojson.type = 'MultiPoint';
1170
1105
  geojson.coordinates = arcgis.points.slice(0);
1171
1106
  }
1172
-
1173
1107
  if (arcgis.paths) {
1174
1108
  if (arcgis.paths.length === 1) {
1175
1109
  geojson.type = 'LineString';
@@ -1179,21 +1113,17 @@ var arcgisToGeoJSON = function arcgisToGeoJSON(arcgis, idAttribute) {
1179
1113
  geojson.coordinates = arcgis.paths.slice(0);
1180
1114
  }
1181
1115
  }
1182
-
1183
1116
  if (arcgis.rings) {
1184
1117
  geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));
1185
1118
  }
1186
-
1187
1119
  if (typeof arcgis.xmin === 'number' && typeof arcgis.ymin === 'number' && typeof arcgis.xmax === 'number' && typeof arcgis.ymax === 'number') {
1188
1120
  geojson.type = 'Polygon';
1189
1121
  geojson.coordinates = [[[arcgis.xmax, arcgis.ymax], [arcgis.xmin, arcgis.ymax], [arcgis.xmin, arcgis.ymin], [arcgis.xmax, arcgis.ymin], [arcgis.xmax, arcgis.ymax]]];
1190
1122
  }
1191
-
1192
1123
  if (arcgis.geometry || arcgis.attributes) {
1193
1124
  geojson.type = 'Feature';
1194
1125
  geojson.geometry = arcgis.geometry ? arcgisToGeoJSON(arcgis.geometry) : null;
1195
1126
  geojson.properties = arcgis.attributes ? shallowClone(arcgis.attributes) : null;
1196
-
1197
1127
  if (arcgis.attributes) {
1198
1128
  try {
1199
1129
  geojson.id = getId(arcgis.attributes, idAttribute);
@@ -1202,15 +1132,12 @@ var arcgisToGeoJSON = function arcgisToGeoJSON(arcgis, idAttribute) {
1202
1132
  }
1203
1133
  } // if no valid geometry was encountered
1204
1134
 
1205
-
1206
1135
  if (JSON.stringify(geojson.geometry) === JSON.stringify({})) {
1207
1136
  geojson.geometry = null;
1208
1137
  }
1209
-
1210
1138
  if (arcgis.spatialReference && arcgis.spatialReference.wkid && arcgis.spatialReference.wkid !== 4326) {
1211
1139
  console.warn('Object converted in non-standard crs - ' + JSON.stringify(arcgis.spatialReference));
1212
1140
  }
1213
-
1214
1141
  return geojson;
1215
1142
  };
1216
1143
 
@@ -1223,47 +1150,36 @@ var orientRings = function orientRings(poly) {
1223
1150
  var output = [];
1224
1151
  var polygon = poly.slice(0);
1225
1152
  var outerRing = closeRing(polygon.shift().slice(0));
1226
-
1227
1153
  if (outerRing.length >= 4) {
1228
1154
  if (!ringIsClockwise(outerRing)) {
1229
1155
  outerRing.reverse();
1230
1156
  }
1231
-
1232
1157
  output.push(outerRing);
1233
-
1234
1158
  for (var i = 0; i < polygon.length; i++) {
1235
1159
  var hole = closeRing(polygon[i].slice(0));
1236
-
1237
1160
  if (hole.length >= 4) {
1238
1161
  if (ringIsClockwise(hole)) {
1239
1162
  hole.reverse();
1240
1163
  }
1241
-
1242
1164
  output.push(hole);
1243
1165
  }
1244
1166
  }
1245
1167
  }
1246
-
1247
1168
  return output;
1248
1169
  }; // This function flattens holes in multipolygons to one array of polygons
1249
1170
  // used for converting GeoJSON Polygons to ArcGIS Polygons
1250
1171
 
1251
-
1252
1172
  var flattenMultiPolygonRings = function flattenMultiPolygonRings(rings) {
1253
1173
  var output = [];
1254
-
1255
1174
  for (var i = 0; i < rings.length; i++) {
1256
1175
  var polygon = orientRings(rings[i]);
1257
-
1258
1176
  for (var x = polygon.length - 1; x >= 0; x--) {
1259
1177
  var ring = polygon[x].slice(0);
1260
1178
  output.push(ring);
1261
1179
  }
1262
1180
  }
1263
-
1264
1181
  return output;
1265
1182
  };
1266
-
1267
1183
  var geojsonToArcGIS = function geojsonToArcGIS(geojson, idAttribute) {
1268
1184
  idAttribute = idAttribute || 'OBJECTID';
1269
1185
  var spatialReference = {
@@ -1271,110 +1187,81 @@ var geojsonToArcGIS = function geojsonToArcGIS(geojson, idAttribute) {
1271
1187
  };
1272
1188
  var result = {};
1273
1189
  var i;
1274
-
1275
1190
  switch (geojson.type) {
1276
1191
  case 'Point':
1277
1192
  result.x = geojson.coordinates[0];
1278
1193
  result.y = geojson.coordinates[1];
1279
-
1280
1194
  if (geojson.coordinates[2] != null) {
1281
1195
  result.z = geojson.coordinates[2];
1282
1196
  }
1283
-
1284
1197
  result.spatialReference = spatialReference;
1285
1198
  break;
1286
-
1287
1199
  case 'MultiPoint':
1288
1200
  result.points = geojson.coordinates.slice(0);
1289
-
1290
1201
  if (geojson.coordinates[0][2] != null) {
1291
1202
  result.hasZ = true;
1292
1203
  }
1293
-
1294
1204
  result.spatialReference = spatialReference;
1295
1205
  break;
1296
-
1297
1206
  case 'LineString':
1298
1207
  result.paths = [geojson.coordinates.slice(0)];
1299
-
1300
1208
  if (geojson.coordinates[0][2] != null) {
1301
1209
  result.hasZ = true;
1302
1210
  }
1303
-
1304
1211
  result.spatialReference = spatialReference;
1305
1212
  break;
1306
-
1307
1213
  case 'MultiLineString':
1308
1214
  result.paths = geojson.coordinates.slice(0);
1309
-
1310
1215
  if (geojson.coordinates[0][0][2] != null) {
1311
1216
  result.hasZ = true;
1312
1217
  }
1313
-
1314
1218
  result.spatialReference = spatialReference;
1315
1219
  break;
1316
-
1317
1220
  case 'Polygon':
1318
1221
  result.rings = orientRings(geojson.coordinates.slice(0));
1319
-
1320
1222
  if (geojson.coordinates[0][0][2] != null) {
1321
1223
  result.hasZ = true;
1322
1224
  }
1323
-
1324
1225
  result.spatialReference = spatialReference;
1325
1226
  break;
1326
-
1327
1227
  case 'MultiPolygon':
1328
1228
  result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));
1329
-
1330
1229
  if (geojson.coordinates[0][0][0][2] != null) {
1331
1230
  result.hasZ = true;
1332
1231
  }
1333
-
1334
1232
  result.spatialReference = spatialReference;
1335
1233
  break;
1336
-
1337
1234
  case 'Feature':
1338
1235
  if (geojson.geometry) {
1339
1236
  result.geometry = geojsonToArcGIS(geojson.geometry, idAttribute);
1340
1237
  }
1341
-
1342
1238
  result.attributes = geojson.properties ? shallowClone(geojson.properties) : {};
1343
-
1344
1239
  if (geojson.id) {
1345
1240
  result.attributes[idAttribute] = geojson.id;
1346
1241
  }
1347
-
1348
1242
  break;
1349
-
1350
1243
  case 'FeatureCollection':
1351
1244
  result = [];
1352
-
1353
1245
  for (i = 0; i < geojson.features.length; i++) {
1354
1246
  result.push(geojsonToArcGIS(geojson.features[i], idAttribute));
1355
1247
  }
1356
-
1357
1248
  break;
1358
-
1359
1249
  case 'GeometryCollection':
1360
1250
  result = [];
1361
-
1362
1251
  for (i = 0; i < geojson.geometries.length; i++) {
1363
1252
  result.push(geojsonToArcGIS(geojson.geometries[i], idAttribute));
1364
1253
  }
1365
-
1366
1254
  break;
1367
1255
  }
1368
-
1369
1256
  return result;
1370
1257
  };
1371
1258
 
1372
- var _sfc_main = defineComponent({
1259
+ var script = defineComponent({
1373
1260
  name: "VkfEsriInputGeojson",
1374
1261
  components: {
1375
1262
  VkfInput,
1376
1263
  VaSketch,
1377
- ViewerVue,
1264
+ ViewerVue: script$1,
1378
1265
  VkAsyncTeleport,
1379
1266
  DocumentChecked: document_checked_default,
1380
1267
  VaGraphicsLayer
@@ -1398,9 +1285,8 @@ var _sfc_main = defineComponent({
1398
1285
  const sketchIf = ref(!props2.view);
1399
1286
  const sketchRef = shallowRef();
1400
1287
  const shetchPanel = computed(() => {
1401
- var _a;
1402
- const container = (_a = sketchRef.value) == null ? void 0 : _a.container;
1403
- return container == null ? void 0 : container.querySelector(".esri-sketch__panel");
1288
+ const container = sketchRef.value?.container;
1289
+ return container?.querySelector(".esri-sketch__panel");
1404
1290
  });
1405
1291
  const viewDef = new Deferred();
1406
1292
  const layerRef = shallowRef();
@@ -1431,7 +1317,7 @@ var _sfc_main = defineComponent({
1431
1317
  if (sketchValueUpdating.value)
1432
1318
  return;
1433
1319
  uSketchValue();
1434
- if (!(ov == null ? void 0 : ov.features.length)) {
1320
+ if (!ov?.features.length) {
1435
1321
  fly();
1436
1322
  }
1437
1323
  }, {
@@ -1470,7 +1356,7 @@ var _sfc_main = defineComponent({
1470
1356
  sketchIf.value = false;
1471
1357
  }
1472
1358
  };
1473
- const append = () => createVNode(AppendVue, {
1359
+ const append = () => createVNode(script$3, {
1474
1360
  "dialog": !readonly.value && props2.dialogEdit,
1475
1361
  "upload": !readonly.value,
1476
1362
  "disabled": props2.disabled,
@@ -1573,7 +1459,9 @@ var _sfc_main = defineComponent({
1573
1459
  }
1574
1460
  });
1575
1461
 
1576
- const _hoisted_1 = { class: "vkf-form-item" };
1462
+ const _hoisted_1 = {
1463
+ class: "vkf-form-item"
1464
+ };
1577
1465
  const _hoisted_2 = {
1578
1466
  ref: "normalMapRef",
1579
1467
  class: "vkf-esri-input-geojson__map"
@@ -1582,8 +1470,7 @@ const _hoisted_3 = {
1582
1470
  ref: "dialogMapRef",
1583
1471
  class: "vkf-esri-input-geojson-dialog__map"
1584
1472
  };
1585
-
1586
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1473
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
1587
1474
  const _component_VkfInput = resolveComponent("VkfInput");
1588
1475
  const _component_DocumentChecked = resolveComponent("DocumentChecked");
1589
1476
  const _component_ElIcon = resolveComponent("ElIcon");
@@ -1592,114 +1479,109 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1592
1479
  const _component_VaGraphicsLayer = resolveComponent("VaGraphicsLayer");
1593
1480
  const _component_ViewerVue = resolveComponent("ViewerVue");
1594
1481
  const _component_ElDialog = resolveComponent("ElDialog");
1595
-
1596
- return (openBlock(), createElementBlock("div", _hoisted_1, [
1597
- renderSlot(_ctx.$slots, "custom", {
1598
- modelValue: _ctx.modelValue,
1599
- fly: _ctx.fly,
1600
- setDialogShow: _ctx.setDialogShow,
1601
- layer: _ctx.layerRef,
1602
- showMap: _ctx.showMap
1603
- }, () => [
1604
- createVNode(_component_VkfInput, mergeProps({
1605
- readonly: true,
1606
- "model-value": _ctx.getInputModelValue(_ctx.modelValue)
1607
- }, _ctx.inputBindProps, {
1608
- "input-slots": {
1609
- append: _ctx.append
1610
- }
1611
- }, toHandlers(_ctx.inputOnEmits)), null, 16 /* FULL_PROPS */, ["model-value", "input-slots"])
1612
- ]),
1613
- createVNode(_component_VkAsyncTeleport, { to: _ctx.mapTo }, {
1614
- default: withCtx(() => [
1615
- createVNode(_component_ViewerVue, {
1616
- view: _ctx.view,
1617
- "view-component": _ctx.viewComponent,
1618
- viewComponentAttrs: _ctx.viewComponentAttrs
1482
+ return openBlock(), createElementBlock("div", _hoisted_1, [renderSlot(_ctx.$slots, "custom", {
1483
+ modelValue: _ctx.modelValue,
1484
+ fly: _ctx.fly,
1485
+ setDialogShow: _ctx.setDialogShow,
1486
+ layer: _ctx.layerRef,
1487
+ showMap: _ctx.showMap
1488
+ }, () => [createVNode(_component_VkfInput, mergeProps({
1489
+ readonly: true,
1490
+ "model-value": _ctx.getInputModelValue(_ctx.modelValue)
1491
+ }, _ctx.inputBindProps, {
1492
+ "input-slots": {
1493
+ append: _ctx.append
1494
+ }
1495
+ }, toHandlers(_ctx.inputOnEmits)), null, 16, ["model-value", "input-slots"])]), createVNode(_component_VkAsyncTeleport, {
1496
+ to: _ctx.mapTo
1497
+ }, {
1498
+ default: withCtx(() => [createVNode(_component_ViewerVue, {
1499
+ view: _ctx.view,
1500
+ "view-component": _ctx.viewComponent,
1501
+ viewComponentAttrs: _ctx.viewComponentAttrs
1502
+ }, {
1503
+ default: withCtx(() => [createVNode(_component_VaGraphicsLayer, {
1504
+ index: _ctx.layerIndex,
1505
+ graphics: _ctx.sketchValue,
1506
+ onLoad: _ctx.layerLoad
1507
+ }, {
1508
+ default: withCtx(() => [!(_ctx.readonly || !_ctx.sketchIf) ? (openBlock(), createBlock(_component_VaSketch, {
1509
+ key: 0,
1510
+ "view-model-active-fill-symbol": _ctx.viewModelActiveFillSymbol,
1511
+ "view-model-active-line-symbol": _ctx.viewModelActiveLineSymbol,
1512
+ "view-model-active-point-symbol": _ctx.viewModelActivePointSymbol,
1513
+ multiple: _ctx.multiple,
1514
+ "available-creature-tools": _ctx.availableCreatureTools,
1515
+ "model-value": _ctx.sketchValue,
1516
+ "onUpdate:modelValue": _ctx.handleUpdateSketchValue,
1517
+ onLoad: _ctx.sketchLoad,
1518
+ visibleElements: _ctx.visibleElements
1619
1519
  }, {
1620
- default: withCtx(() => [
1621
- createVNode(_component_VaGraphicsLayer, {
1622
- index: _ctx.layerIndex,
1623
- graphics: _ctx.sketchValue,
1624
- onLoad: _ctx.layerLoad
1520
+ default: withCtx(() => [!_ctx.skipSave && _ctx.shetchPanel ? (openBlock(), createBlock(_component_VkAsyncTeleport, {
1521
+ key: 0,
1522
+ to: _ctx.shetchPanel
1523
+ }, {
1524
+ default: withCtx(() => [createVNode(_component_ElIcon, {
1525
+ class: "esri-sketch-ui-save esri-widget--button",
1526
+ onClick: _ctx.doSave
1625
1527
  }, {
1626
- default: withCtx(() => [
1627
- (!(_ctx.readonly || !_ctx.sketchIf))
1628
- ? (openBlock(), createBlock(_component_VaSketch, {
1629
- key: 0,
1630
- "view-model-active-fill-symbol": _ctx.viewModelActiveFillSymbol,
1631
- "view-model-active-line-symbol": _ctx.viewModelActiveLineSymbol,
1632
- "view-model-active-point-symbol": _ctx.viewModelActivePointSymbol,
1633
- multiple: _ctx.multiple,
1634
- "available-creature-tools": _ctx.availableCreatureTools,
1635
- "model-value": _ctx.sketchValue,
1636
- "onUpdate:modelValue": _ctx.handleUpdateSketchValue,
1637
- onLoad: _ctx.sketchLoad,
1638
- visibleElements: _ctx.visibleElements
1639
- }, {
1640
- default: withCtx(() => [
1641
- (!_ctx.skipSave && _ctx.shetchPanel)
1642
- ? (openBlock(), createBlock(_component_VkAsyncTeleport, {
1643
- key: 0,
1644
- to: _ctx.shetchPanel
1645
- }, {
1646
- default: withCtx(() => [
1647
- createVNode(_component_ElIcon, {
1648
- class: "esri-sketch-ui-save esri-widget--button",
1649
- onClick: _ctx.doSave
1650
- }, {
1651
- default: withCtx(() => [
1652
- createVNode(_component_DocumentChecked)
1653
- ]),
1654
- _: 1 /* STABLE */
1655
- }, 8 /* PROPS */, ["onClick"])
1656
- ]),
1657
- _: 1 /* STABLE */
1658
- }, 8 /* PROPS */, ["to"]))
1659
- : createCommentVNode("v-if", true)
1660
- ]),
1661
- _: 1 /* STABLE */
1662
- }, 8 /* PROPS */, ["view-model-active-fill-symbol", "view-model-active-line-symbol", "view-model-active-point-symbol", "multiple", "available-creature-tools", "model-value", "onUpdate:modelValue", "onLoad", "visibleElements"]))
1663
- : createCommentVNode("v-if", true)
1664
- ]),
1665
- _: 1 /* STABLE */
1666
- }, 8 /* PROPS */, ["index", "graphics", "onLoad"])
1667
- ]),
1668
- _: 1 /* STABLE */
1669
- }, 8 /* PROPS */, ["view", "view-component", "viewComponentAttrs"])
1670
- ]),
1671
- _: 1 /* STABLE */
1672
- }, 8 /* PROPS */, ["to"]),
1673
- withDirectives(createElementVNode("div", _hoisted_2, null, 512 /* NEED_PATCH */), [
1674
- [vShow, _ctx.showMap]
1675
- ]),
1676
- createVNode(_component_ElDialog, {
1677
- modelValue: _ctx.dialogShow,
1678
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.dialogShow) = $event)),
1679
- title: _ctx.dialogEditTitle,
1680
- fullscreen: _ctx.dialogEditFullscreen,
1681
- "modal-class": "vkf-esri-input-geojson-dialog",
1682
- "append-to-body": true,
1683
- "close-on-click-modal": false,
1684
- draggable: true,
1685
- onOpen: _ctx.dialogOnOpen,
1686
- onClose: _ctx.dialogOnClose
1687
- }, {
1688
- default: withCtx(() => [
1689
- createElementVNode("div", _hoisted_3, null, 512 /* NEED_PATCH */)
1690
- ]),
1691
- _: 1 /* STABLE */
1692
- }, 8 /* PROPS */, ["modelValue", "title", "fullscreen", "onOpen", "onClose"])
1693
- ]))
1528
+ default: withCtx(() => [createVNode(_component_DocumentChecked)]),
1529
+ _: 1
1530
+ /* STABLE */
1531
+ }, 8, ["onClick"])]),
1532
+ _: 1
1533
+ /* STABLE */
1534
+ }, 8, ["to"])) : createCommentVNode("v-if", true)]),
1535
+ _: 1
1536
+ /* STABLE */
1537
+ }, 8, ["view-model-active-fill-symbol", "view-model-active-line-symbol", "view-model-active-point-symbol", "multiple", "available-creature-tools", "model-value", "onUpdate:modelValue", "onLoad", "visibleElements"])) : createCommentVNode("v-if", true)]),
1538
+ _: 1
1539
+ /* STABLE */
1540
+ }, 8, ["index", "graphics", "onLoad"])]),
1541
+ _: 1
1542
+ /* STABLE */
1543
+ }, 8, ["view", "view-component", "viewComponentAttrs"])]),
1544
+ _: 1
1545
+ /* STABLE */
1546
+ }, 8, ["to"]), withDirectives(createElementVNode(
1547
+ "div",
1548
+ _hoisted_2,
1549
+ null,
1550
+ 512
1551
+ /* NEED_PATCH */
1552
+ ), [[vShow, _ctx.showMap]]), createVNode(_component_ElDialog, {
1553
+ modelValue: _ctx.dialogShow,
1554
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.dialogShow = $event),
1555
+ title: _ctx.dialogEditTitle,
1556
+ fullscreen: _ctx.dialogEditFullscreen,
1557
+ "modal-class": "vkf-esri-input-geojson-dialog",
1558
+ "append-to-body": true,
1559
+ "close-on-click-modal": false,
1560
+ draggable: true,
1561
+ onOpen: _ctx.dialogOnOpen,
1562
+ onClose: _ctx.dialogOnClose
1563
+ }, {
1564
+ default: withCtx(() => [createElementVNode(
1565
+ "div",
1566
+ _hoisted_3,
1567
+ null,
1568
+ 512
1569
+ /* NEED_PATCH */
1570
+ )]),
1571
+ _: 1
1572
+ /* STABLE */
1573
+ }, 8, ["modelValue", "title", "fullscreen", "onOpen", "onClose"])]);
1694
1574
  }
1695
- var VkfEsriInputGeojson = /*#__PURE__*/_export_sfc(_sfc_main, [['render',_sfc_render],['__file',"index.vue"]]);
1575
+
1576
+ script.render = render;
1577
+ script.__file = "esri-input-geojson/src/index.vue";
1696
1578
 
1697
1579
  var types = /*#__PURE__*/Object.freeze({
1698
1580
  __proto__: null
1699
1581
  });
1700
1582
 
1701
- VkfEsriInputGeojson.install = (app) => {
1702
- app.component(VkfEsriInputGeojson.name, VkfEsriInputGeojson);
1583
+ script.install = (app) => {
1584
+ app.component(script.name, script);
1703
1585
  };
1704
1586
 
1705
- export { EDIT_TYPE, EDIT_TYPE_OPTIONS, EDIT_TYPE_REFLECT, EMPTY_FEATURE_COLLECTION, VkfEsriInputGeojson, ctx as _VkfEsriInputGeojsonCtx, types as __VkfEsriInputGeojson, VkfEsriInputGeojson as default };
1587
+ export { EDIT_TYPE, EDIT_TYPE_OPTIONS, EDIT_TYPE_REFLECT, EMPTY_FEATURE_COLLECTION, script as VkfEsriInputGeojson, ctx as _VkfEsriInputGeojsonCtx, types as __VkfEsriInputGeojson, script as default };