@vunk/form 1.1.76 → 1.1.79

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 (284) hide show
  1. package/components/_plugin-vue_export-helper.mjs +9 -0
  2. package/components/button/{index.js → index.mjs} +33 -29
  3. package/components/button/src/ctx.d.ts +30 -30
  4. package/components/button/src/index.vue.d.ts +69 -69
  5. package/components/cascader/index.css +0 -2
  6. package/components/cascader/{index.js → index.mjs} +22 -22
  7. package/components/cascader/src/ctx.d.ts +37 -45
  8. package/components/cascader/src/index.vue.d.ts +92 -92
  9. package/components/cascader/src/use.d.ts +1 -1
  10. package/components/checkbox/index.css +0 -9
  11. package/components/checkbox/{index.js → index.mjs} +45 -42
  12. package/components/checkbox/src/ctx.d.ts +29 -32
  13. package/components/checkbox/src/index.vue.d.ts +65 -65
  14. package/components/color-picker/{index.js → index.mjs} +24 -23
  15. package/components/color-picker/src/ctx.d.ts +29 -29
  16. package/components/color-picker/src/index.vue.d.ts +77 -64
  17. package/components/date-picker/{index.js → index.mjs} +28 -25
  18. package/components/date-picker/src/ctx.d.ts +49 -49
  19. package/components/date-picker/src/index.vue.d.ts +104 -104
  20. package/components/download-plus/index.css +0 -6
  21. package/components/download-plus/{index.js → index.mjs} +119 -147
  22. package/components/download-plus/src/api.d.ts +1 -1
  23. package/components/download-plus/src/ctx.d.ts +27 -26
  24. package/components/download-plus/src/index.vue.d.ts +59 -59
  25. package/components/esri-input-geojson/index.css +0 -10
  26. package/components/esri-input-geojson/index.mjs +1109 -0
  27. package/components/esri-input-geojson/src/append.vue.d.ts +1 -1
  28. package/components/esri-input-geojson/src/ctx.d.ts +49 -72
  29. package/components/esri-input-geojson/src/index.vue.d.ts +138 -158
  30. package/components/esri-input-geojson/src/types.d.ts +0 -1
  31. package/components/esri-input-geojson/src/viewer.vue.d.ts +18 -19
  32. package/components/form/{index.js → index.mjs} +31 -27
  33. package/components/form/src/ctx.d.ts +13 -297
  34. package/components/form/src/index.vue.d.ts +97 -659
  35. package/components/form-item/index.css +0 -8
  36. package/components/form-item/{index.js → index.mjs} +22 -19
  37. package/components/form-item/src/ctx.d.ts +13 -11
  38. package/components/form-item/src/index.vue.d.ts +20 -20
  39. package/components/form-item-renderer/{index.js → index.mjs} +9 -7
  40. package/components/form-item-renderer/src/index.vue.d.ts +1 -1
  41. package/components/form-item-renderer-template/{index.js → index.mjs} +7 -7
  42. package/components/geoinput/{index.js → index.mjs} +10 -17
  43. package/components/geoinput/src/ctx.d.ts +48 -60
  44. package/components/geoinput/src/index.vue.d.ts +114 -132
  45. package/components/geoinput-read/index.css +0 -2
  46. package/components/geoinput-read/{index.js → index.mjs} +101 -109
  47. package/components/geoinput-read/src/core.vue.d.ts +123 -142
  48. package/components/geoinput-read/src/ctx.d.ts +50 -74
  49. package/components/geoinput-read/src/index.vue.d.ts +102 -120
  50. package/components/geoinput-update/index.css +0 -6
  51. package/components/geoinput-update/index.mjs +399 -0
  52. package/components/geoinput-update/src/ctx.d.ts +49 -69
  53. package/components/geoinput-update/src/index.vue.d.ts +126 -141
  54. package/components/index.mjs +11 -0
  55. package/components/index2.mjs +306 -0
  56. package/components/index3.mjs +484 -0
  57. package/components/input/{index.js → index.mjs} +31 -27
  58. package/components/input/src/ctx.d.ts +47 -66
  59. package/components/input/src/index.vue.d.ts +101 -113
  60. package/components/input-link/index.css +0 -2
  61. package/components/input-link/index.mjs +151 -0
  62. package/components/input-link/src/ctx.d.ts +40 -56
  63. package/components/input-link/src/index.vue.d.ts +89 -101
  64. package/components/input-number/index.css +0 -2
  65. package/components/input-number/{index.js → index.mjs} +25 -25
  66. package/components/input-number/src/ctx.d.ts +31 -37
  67. package/components/input-number/src/index.vue.d.ts +71 -71
  68. package/components/radio/index.css +0 -6
  69. package/components/radio/{index.js → index.mjs} +50 -47
  70. package/components/radio/src/ctx.d.ts +29 -29
  71. package/components/radio/src/index.vue.d.ts +64 -64
  72. package/components/select/index.css +0 -2
  73. package/components/select/{index.js → index.mjs} +49 -48
  74. package/components/select/src/ctx.d.ts +31 -85
  75. package/components/select/src/index.vue.d.ts +121 -230
  76. package/components/slider/{index.js → index.mjs} +28 -24
  77. package/components/slider/src/ctx.d.ts +35 -35
  78. package/components/slider/src/index.vue.d.ts +93 -93
  79. package/components/switch/index.css +0 -2
  80. package/components/switch/{index.js → index.mjs} +29 -24
  81. package/components/switch/src/ctx.d.ts +40 -40
  82. package/components/switch/src/index.vue.d.ts +91 -91
  83. package/components/templates-default/index.mjs +302 -0
  84. package/components/templates-default/src/ctx.d.ts +2 -4
  85. package/components/templates-default/src/index.vue.d.ts +2 -8
  86. package/components/templates-element-plus/index.mjs +106 -0
  87. package/components/templates-esri/index.mjs +59 -0
  88. package/components/templates-layout/index.css +0 -3
  89. package/components/templates-layout/index.mjs +131 -0
  90. package/components/templates-mapbox/index.mjs +59 -0
  91. package/components/upload/index.css +0 -7
  92. package/components/upload/index.mjs +501 -0
  93. package/components/upload/src/ctx.d.ts +36 -38
  94. package/components/upload/src/file.vue.d.ts +22 -21
  95. package/components/upload/src/index.vue.d.ts +78 -78
  96. package/components/upload-plus/index.css +4 -8
  97. package/components/upload-plus/{index.js → index.mjs} +9497 -926
  98. package/components/upload-plus/src/api.d.ts +1 -1
  99. package/components/upload-plus/src/ctx.d.ts +25 -28
  100. package/components/upload-plus/src/index.vue.d.ts +58 -58
  101. package/components/van-cascader/index.css +0 -2
  102. package/components/van-cascader/{index.js → index.mjs} +41 -44
  103. package/components/van-cascader/src/ctx.d.ts +35 -35
  104. package/components/van-cascader/src/index.vue.d.ts +82 -82
  105. package/components/var-datetime-picker/index.css +0 -2
  106. package/components/var-datetime-picker/index.mjs +324 -0
  107. package/components/var-datetime-picker/src/ctx.d.ts +27 -26
  108. package/components/var-datetime-picker/src/index.vue.d.ts +57 -57
  109. package/components/vditor/{index.js → index.mjs} +9 -14
  110. package/components/vditor/src/ctx.d.ts +2 -1
  111. package/components/vditor/src/index.vue.d.ts +2 -3
  112. package/composables/index.mjs +85 -0
  113. package/composables/useSourceManager.d.ts +2 -2
  114. package/defaults.d.ts +1 -1
  115. package/index.css +4 -169
  116. package/index.d.ts +1 -1
  117. package/index.esm.js +44 -1
  118. package/package.json +246 -2
  119. package/shared/const/index.d.ts +1 -1
  120. package/shared/const/index.mjs +56 -0
  121. package/shared/element-plus/ctx.d.ts +26 -94
  122. package/shared/element-plus/index.mjs +285 -0
  123. package/shared/element-plus/instances.d.ts +29 -28
  124. package/shared/form/index.mjs +30 -0
  125. package/shared/helper/index.mjs +9 -0
  126. package/shared/index.mjs +1 -0
  127. package/shared/infer-prop/index.mjs +34 -0
  128. package/shared/progress-it/index.mjs +38 -0
  129. package/shared/rules/index.mjs +53 -0
  130. package/shared/upload/index.mjs +771 -0
  131. package/components/button/src/ctx.js +0 -1
  132. package/components/cascader/src/ctx.js +0 -1
  133. package/components/cascader/src/types.js +0 -1
  134. package/components/cascader/src/use.js +0 -1
  135. package/components/checkbox/src/ctx.js +0 -1
  136. package/components/checkbox/src/index.css +0 -1
  137. package/components/checkbox/src/types.js +0 -1
  138. package/components/color-picker/index.css +0 -1
  139. package/components/color-picker/src/ctx.js +0 -1
  140. package/components/color-picker/src/index.css +0 -1
  141. package/components/color-picker/src/types.js +0 -1
  142. package/components/date-picker/index.css +0 -1
  143. package/components/date-picker/src/ctx.js +0 -1
  144. package/components/date-picker/src/index.css +0 -1
  145. package/components/date-picker/src/types.js +0 -1
  146. package/components/download-plus/src/api.js +0 -1
  147. package/components/download-plus/src/const.js +0 -1
  148. package/components/download-plus/src/ctx.js +0 -1
  149. package/components/download-plus/src/index.css +0 -1
  150. package/components/download-plus/src/types.js +0 -1
  151. package/components/esri-input-geojson/index.js +0 -1563
  152. package/components/esri-input-geojson/src/const.js +0 -1
  153. package/components/esri-input-geojson/src/ctx.js +0 -1
  154. package/components/esri-input-geojson/src/index.css +0 -1
  155. package/components/esri-input-geojson/src/types.js +0 -1
  156. package/components/form/index.css +0 -1
  157. package/components/form/src/ctx.js +0 -1
  158. package/components/form/src/index.css +0 -1
  159. package/components/form/src/types.js +0 -1
  160. package/components/form/src/utils.js +0 -1
  161. package/components/form-item/src/ctx.js +0 -1
  162. package/components/form-item/src/index.css +0 -1
  163. package/components/form-item/src/types.js +0 -1
  164. package/components/form-item-renderer/index.css +0 -1
  165. package/components/form-item-renderer/src/ctx.js +0 -1
  166. package/components/form-item-renderer/src/index.css +0 -1
  167. package/components/form-item-renderer/src/symbols.js +0 -1
  168. package/components/form-item-renderer/src/types.js +0 -1
  169. package/components/form-item-renderer-template/index.css +0 -1
  170. package/components/form-item-renderer-template/src/ctx.js +0 -1
  171. package/components/form-item-renderer-template/src/index.css +0 -1
  172. package/components/form-item-renderer-template/src/types.js +0 -1
  173. package/components/geoinput/index.css +0 -1
  174. package/components/geoinput/src/ctx.js +0 -1
  175. package/components/geoinput/src/index.css +0 -1
  176. package/components/geoinput/src/types.js +0 -1
  177. package/components/geoinput-read/src/ctx.js +0 -1
  178. package/components/geoinput-read/src/index.css +0 -1
  179. package/components/geoinput-read/src/types.js +0 -1
  180. package/components/geoinput-update/index.js +0 -930
  181. package/components/geoinput-update/src/ctx.js +0 -1
  182. package/components/geoinput-update/src/index.css +0 -1
  183. package/components/geoinput-update/src/types.js +0 -1
  184. package/components/input/index.css +0 -1
  185. package/components/input/src/ctx.js +0 -1
  186. package/components/input/src/index.css +0 -1
  187. package/components/input/src/types.js +0 -1
  188. package/components/input-link/index.js +0 -163
  189. package/components/input-link/src/ctx.js +0 -1
  190. package/components/input-link/src/index.css +0 -1
  191. package/components/input-link/src/types.js +0 -1
  192. package/components/input-number/src/ctx.js +0 -1
  193. package/components/input-number/src/index.css +0 -1
  194. package/components/input-number/src/types.js +0 -1
  195. package/components/radio/src/ctx.js +0 -1
  196. package/components/radio/src/index.css +0 -1
  197. package/components/radio/src/types.js +0 -1
  198. package/components/select/src/ctx.js +0 -1
  199. package/components/select/src/index.css +0 -1
  200. package/components/select/src/types.js +0 -1
  201. package/components/slider/index.css +0 -1
  202. package/components/slider/src/ctx.js +0 -1
  203. package/components/slider/src/index.css +0 -1
  204. package/components/slider/src/types.js +0 -1
  205. package/components/switch/src/ctx.js +0 -1
  206. package/components/switch/src/index.css +0 -1
  207. package/components/switch/src/types.js +0 -1
  208. package/components/templates-default/index.css +0 -1
  209. package/components/templates-default/index.js +0 -347
  210. package/components/templates-default/src/ctx.js +0 -1
  211. package/components/templates-default/src/index.css +0 -1
  212. package/components/templates-default/src/types.js +0 -1
  213. package/components/templates-element-plus/index.css +0 -1
  214. package/components/templates-element-plus/index.js +0 -110
  215. package/components/templates-element-plus/src/ctx.js +0 -1
  216. package/components/templates-element-plus/src/index.css +0 -1
  217. package/components/templates-element-plus/src/types.js +0 -1
  218. package/components/templates-esri/index.css +0 -1
  219. package/components/templates-esri/index.js +0 -65
  220. package/components/templates-esri/src/ctx.js +0 -1
  221. package/components/templates-esri/src/index.css +0 -1
  222. package/components/templates-esri/src/types.js +0 -1
  223. package/components/templates-layout/index.js +0 -141
  224. package/components/templates-layout/src/ctx.js +0 -1
  225. package/components/templates-layout/src/index.css +0 -1
  226. package/components/templates-layout/src/types.js +0 -1
  227. package/components/templates-mapbox/index.css +0 -1
  228. package/components/templates-mapbox/index.js +0 -65
  229. package/components/templates-mapbox/src/ctx.js +0 -1
  230. package/components/templates-mapbox/src/index.css +0 -1
  231. package/components/templates-mapbox/src/types.js +0 -1
  232. package/components/upload/index.js +0 -565
  233. package/components/upload/src/ctx.js +0 -1
  234. package/components/upload/src/index.css +0 -1
  235. package/components/upload/src/types.js +0 -1
  236. package/components/upload-plus/src/api.js +0 -28
  237. package/components/upload-plus/src/const.js +0 -1
  238. package/components/upload-plus/src/ctx.js +0 -1
  239. package/components/upload-plus/src/index.css +0 -1
  240. package/components/upload-plus/src/types.js +0 -1
  241. package/components/van-cascader/src/ctx.js +0 -1
  242. package/components/van-cascader/src/index.css +0 -1
  243. package/components/van-cascader/src/types.js +0 -1
  244. package/components/var-datetime-picker/index.js +0 -299
  245. package/components/var-datetime-picker/src/const.js +0 -1
  246. package/components/var-datetime-picker/src/ctx.js +0 -1
  247. package/components/var-datetime-picker/src/index.css +0 -1
  248. package/components/var-datetime-picker/src/types.js +0 -1
  249. package/components/vditor/index.css +0 -1
  250. package/components/vditor/src/ctx.js +0 -1
  251. package/components/vditor/src/index.css +0 -1
  252. package/components/vditor/src/types.js +0 -1
  253. package/composables/index.css +0 -1
  254. package/composables/index.js +0 -1
  255. package/shared/const/index.css +0 -1
  256. package/shared/const/index.js +0 -1
  257. package/shared/element-plus/index.css +0 -1
  258. package/shared/element-plus/index.js +0 -1
  259. package/shared/form/index.css +0 -1
  260. package/shared/form/index.js +0 -1
  261. package/shared/helper/index.css +0 -1
  262. package/shared/helper/index.js +0 -1
  263. package/shared/index.css +0 -1
  264. package/shared/index.js +0 -1
  265. package/shared/infer-prop/index.css +0 -1
  266. package/shared/infer-prop/index.js +0 -1
  267. package/shared/progress-it/index.css +0 -1
  268. package/shared/progress-it/index.js +0 -1
  269. package/shared/rules/index.css +0 -1
  270. package/shared/rules/index.js +0 -1
  271. package/shared/types/form/index.css +0 -1
  272. package/shared/types/form/index.js +0 -1
  273. package/shared/types/index.css +0 -1
  274. package/shared/types/index.js +0 -1
  275. package/shared/types/source/index.css +0 -1
  276. package/shared/types/source/index.js +0 -1
  277. package/shared/types/source-manager/index.css +0 -1
  278. package/shared/types/source-manager/index.js +0 -1
  279. package/shared/upload/index.css +0 -1
  280. package/shared/upload/index.js +0 -1
  281. /package/{components/button/index.css → shared/types/form/index.mjs} +0 -0
  282. /package/{components/button/src/index.css → shared/types/index.mjs} +0 -0
  283. /package/{components/cascader/src/index.css → shared/types/source/index.mjs} +0 -0
  284. /package/{components/button/src/types.js → shared/types/source-manager/index.mjs} +0 -0
@@ -0,0 +1,484 @@
1
+ function array_cancel() {
2
+ this._array = null;
3
+ return Promise.resolve();
4
+ }
5
+
6
+ function array_read() {
7
+ var array = this._array;
8
+ this._array = null;
9
+ return Promise.resolve(array ? {done: false, value: array} : {done: true, value: undefined});
10
+ }
11
+
12
+ function array(array) {
13
+ return new ArraySource(array instanceof Uint8Array ? array : new Uint8Array(array));
14
+ }
15
+
16
+ function ArraySource(array) {
17
+ this._array = array;
18
+ }
19
+
20
+ ArraySource.prototype.read = array_read;
21
+ ArraySource.prototype.cancel = array_cancel;
22
+
23
+ function fetchPath(url) {
24
+ return fetch(url).then(function(response) {
25
+ return response.body && response.body.getReader
26
+ ? response.body.getReader()
27
+ : response.arrayBuffer().then(array);
28
+ });
29
+ }
30
+
31
+ function requestPath(url) {
32
+ return new Promise(function(resolve, reject) {
33
+ var request = new XMLHttpRequest;
34
+ request.responseType = "arraybuffer";
35
+ request.onload = function() { resolve(array(request.response)); };
36
+ request.onerror = reject;
37
+ request.ontimeout = reject;
38
+ request.open("GET", url, true);
39
+ request.send();
40
+ });
41
+ }
42
+
43
+ function path(path) {
44
+ return (typeof fetch === "function" ? fetchPath : requestPath)(path);
45
+ }
46
+
47
+ function stream(source) {
48
+ return typeof source.read === "function" ? source : source.getReader();
49
+ }
50
+
51
+ var empty = new Uint8Array(0);
52
+
53
+ function slice_cancel() {
54
+ return this._source.cancel();
55
+ }
56
+
57
+ function concat$1(a, b) {
58
+ if (!a.length) return b;
59
+ if (!b.length) return a;
60
+ var c = new Uint8Array(a.length + b.length);
61
+ c.set(a);
62
+ c.set(b, a.length);
63
+ return c;
64
+ }
65
+
66
+ function slice_read() {
67
+ var that = this, array = that._array.subarray(that._index);
68
+ return that._source.read().then(function(result) {
69
+ that._array = empty;
70
+ that._index = 0;
71
+ return result.done ? (array.length > 0
72
+ ? {done: false, value: array}
73
+ : {done: true, value: undefined})
74
+ : {done: false, value: concat$1(array, result.value)};
75
+ });
76
+ }
77
+
78
+ function slice_slice(length) {
79
+ if ((length |= 0) < 0) throw new Error("invalid length");
80
+ var that = this, index = this._array.length - this._index;
81
+
82
+ // If the request fits within the remaining buffer, resolve it immediately.
83
+ if (this._index + length <= this._array.length) {
84
+ return Promise.resolve(this._array.subarray(this._index, this._index += length));
85
+ }
86
+
87
+ // Otherwise, read chunks repeatedly until the request is fulfilled.
88
+ var array = new Uint8Array(length);
89
+ array.set(this._array.subarray(this._index));
90
+ return (function read() {
91
+ return that._source.read().then(function(result) {
92
+
93
+ // When done, it’s possible the request wasn’t fully fullfilled!
94
+ // If so, the pre-allocated array is too big and needs slicing.
95
+ if (result.done) {
96
+ that._array = empty;
97
+ that._index = 0;
98
+ return index > 0 ? array.subarray(0, index) : null;
99
+ }
100
+
101
+ // If this chunk fulfills the request, return the resulting array.
102
+ if (index + result.value.length >= length) {
103
+ that._array = result.value;
104
+ that._index = length - index;
105
+ array.set(result.value.subarray(0, length - index), index);
106
+ return array;
107
+ }
108
+
109
+ // Otherwise copy this chunk into the array, then read the next chunk.
110
+ array.set(result.value, index);
111
+ index += result.value.length;
112
+ return read();
113
+ });
114
+ })();
115
+ }
116
+
117
+ function slice(source) {
118
+ return typeof source.slice === "function" ? source :
119
+ new SliceSource(typeof source.read === "function" ? source
120
+ : source.getReader());
121
+ }
122
+
123
+ function SliceSource(source) {
124
+ this._source = source;
125
+ this._array = empty;
126
+ this._index = 0;
127
+ }
128
+
129
+ SliceSource.prototype.read = slice_read;
130
+ SliceSource.prototype.slice = slice_slice;
131
+ SliceSource.prototype.cancel = slice_cancel;
132
+
133
+ function dbf_cancel() {
134
+ return this._source.cancel();
135
+ }
136
+
137
+ function readBoolean(value) {
138
+ return /^[nf]$/i.test(value) ? false
139
+ : /^[yt]$/i.test(value) ? true
140
+ : null;
141
+ }
142
+
143
+ function readDate(value) {
144
+ return new Date(+value.substring(0, 4), value.substring(4, 6) - 1, +value.substring(6, 8));
145
+ }
146
+
147
+ function readNumber(value) {
148
+ return !(value = value.trim()) || isNaN(value = +value) ? null : value;
149
+ }
150
+
151
+ function readString(value) {
152
+ return value.trim() || null;
153
+ }
154
+
155
+ var types = {
156
+ B: readNumber,
157
+ C: readString,
158
+ D: readDate,
159
+ F: readNumber,
160
+ L: readBoolean,
161
+ M: readNumber,
162
+ N: readNumber
163
+ };
164
+
165
+ function dbf_read() {
166
+ var that = this, i = 1;
167
+ return that._source.slice(that._recordLength).then(function(value) {
168
+ return value && (value[0] !== 0x1a) ? {done: false, value: that._fields.reduce(function(p, f) {
169
+ p[f.name] = types[f.type](that._decode(value.subarray(i, i += f.length)));
170
+ return p;
171
+ }, {})} : {done: true, value: undefined};
172
+ });
173
+ }
174
+
175
+ function view(array) {
176
+ return new DataView(array.buffer, array.byteOffset, array.byteLength);
177
+ }
178
+
179
+ function dbf(source, decoder) {
180
+ source = slice(source);
181
+ return source.slice(32).then(function(array) {
182
+ var head = view(array);
183
+ return source.slice(head.getUint16(8, true) - 32).then(function(array) {
184
+ return new Dbf(source, decoder, head, view(array));
185
+ });
186
+ });
187
+ }
188
+
189
+ function Dbf(source, decoder, head, body) {
190
+ this._source = source;
191
+ this._decode = decoder.decode.bind(decoder);
192
+ this._recordLength = head.getUint16(10, true);
193
+ this._fields = [];
194
+ for (var n = 0; body.getUint8(n) !== 0x0d; n += 32) {
195
+ for (var j = 0; j < 11; ++j) if (body.getUint8(n + j) === 0) break;
196
+ this._fields.push({
197
+ name: this._decode(new Uint8Array(body.buffer, body.byteOffset + n, j)),
198
+ type: String.fromCharCode(body.getUint8(n + 11)),
199
+ length: body.getUint8(n + 16)
200
+ });
201
+ }
202
+ }
203
+
204
+ var prototype$2 = Dbf.prototype;
205
+ prototype$2.read = dbf_read;
206
+ prototype$2.cancel = dbf_cancel;
207
+
208
+ function cancel() {
209
+ return this._source.cancel();
210
+ }
211
+
212
+ function parseMultiPoint(record) {
213
+ var i = 40, j, n = record.getInt32(36, true), coordinates = new Array(n);
214
+ for (j = 0; j < n; ++j, i += 16) coordinates[j] = [record.getFloat64(i, true), record.getFloat64(i + 8, true)];
215
+ return {type: "MultiPoint", coordinates: coordinates};
216
+ }
217
+
218
+ function parseNull() {
219
+ return null;
220
+ }
221
+
222
+ function parsePoint(record) {
223
+ return {type: "Point", coordinates: [record.getFloat64(4, true), record.getFloat64(12, true)]};
224
+ }
225
+
226
+ function parsePolygon(record) {
227
+ var i = 44, j, n = record.getInt32(36, true), m = record.getInt32(40, true), parts = new Array(n), points = new Array(m), polygons = [], holes = [];
228
+ for (j = 0; j < n; ++j, i += 4) parts[j] = record.getInt32(i, true);
229
+ for (j = 0; j < m; ++j, i += 16) points[j] = [record.getFloat64(i, true), record.getFloat64(i + 8, true)];
230
+
231
+ parts.forEach(function(i, j) {
232
+ var ring = points.slice(i, parts[j + 1]);
233
+ if (ringClockwise(ring)) polygons.push([ring]);
234
+ else holes.push(ring);
235
+ });
236
+
237
+ holes.forEach(function(hole) {
238
+ polygons.some(function(polygon) {
239
+ if (ringContainsSome(polygon[0], hole)) {
240
+ polygon.push(hole);
241
+ return true;
242
+ }
243
+ }) || polygons.push([hole]);
244
+ });
245
+
246
+ return polygons.length === 1
247
+ ? {type: "Polygon", coordinates: polygons[0]}
248
+ : {type: "MultiPolygon", coordinates: polygons};
249
+ }
250
+ function ringClockwise(ring) {
251
+ if ((n = ring.length) < 4) return false;
252
+ var i = 0, n, area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1];
253
+ while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1];
254
+ return area >= 0;
255
+ }
256
+
257
+ function ringContainsSome(ring, hole) {
258
+ var i = -1, n = hole.length, c;
259
+ while (++i < n) {
260
+ if (c = ringContains(ring, hole[i])) {
261
+ return c > 0;
262
+ }
263
+ }
264
+ return false;
265
+ }
266
+
267
+ function ringContains(ring, point) {
268
+ var x = point[0], y = point[1], contains = -1;
269
+ for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) {
270
+ var pi = ring[i], xi = pi[0], yi = pi[1],
271
+ pj = ring[j], xj = pj[0], yj = pj[1];
272
+ if (segmentContains(pi, pj, point)) {
273
+ return 0;
274
+ }
275
+ if (((yi > y) !== (yj > y)) && ((x < (xj - xi) * (y - yi) / (yj - yi) + xi))) {
276
+ contains = -contains;
277
+ }
278
+ }
279
+ return contains;
280
+ }
281
+
282
+ function segmentContains(p0, p1, p2) {
283
+ var x20 = p2[0] - p0[0], y20 = p2[1] - p0[1];
284
+ if (x20 === 0 && y20 === 0) return true;
285
+ var x10 = p1[0] - p0[0], y10 = p1[1] - p0[1];
286
+ if (x10 === 0 && y10 === 0) return false;
287
+ var t = (x20 * x10 + y20 * y10) / (x10 * x10 + y10 * y10);
288
+ return t < 0 || t > 1 ? false : t === 0 || t === 1 ? true : t * x10 === x20 && t * y10 === y20;
289
+ }
290
+
291
+ function parsePolyLine(record) {
292
+ var i = 44, j, n = record.getInt32(36, true), m = record.getInt32(40, true), parts = new Array(n), points = new Array(m);
293
+ for (j = 0; j < n; ++j, i += 4) parts[j] = record.getInt32(i, true);
294
+ for (j = 0; j < m; ++j, i += 16) points[j] = [record.getFloat64(i, true), record.getFloat64(i + 8, true)];
295
+ return n === 1
296
+ ? {type: "LineString", coordinates: points}
297
+ : {type: "MultiLineString", coordinates: parts.map(function(i, j) { return points.slice(i, parts[j + 1]); })};
298
+ }
299
+
300
+ function concat(a, b) {
301
+ var ab = new Uint8Array(a.length + b.length);
302
+ ab.set(a, 0);
303
+ ab.set(b, a.length);
304
+ return ab;
305
+ }
306
+
307
+ function shp_read() {
308
+ var that = this;
309
+ ++that._index;
310
+ return that._source.slice(12).then(function(array) {
311
+ if (array == null) return {done: true, value: undefined};
312
+ var header = view(array);
313
+
314
+ // If the record starts with an invalid shape type (see #36), scan ahead in
315
+ // four-byte increments to find the next valid record, identified by the
316
+ // expected index, a non-empty content length and a valid shape type.
317
+ function skip() {
318
+ return that._source.slice(4).then(function(chunk) {
319
+ if (chunk == null) return {done: true, value: undefined};
320
+ header = view(array = concat(array.slice(4), chunk));
321
+ return header.getInt32(0, false) !== that._index ? skip() : read();
322
+ });
323
+ }
324
+
325
+ // All records should have at least four bytes (for the record shape type),
326
+ // so an invalid content length indicates corruption.
327
+ function read() {
328
+ var length = header.getInt32(4, false) * 2 - 4, type = header.getInt32(8, true);
329
+ return length < 0 || (type && type !== that._type) ? skip() : that._source.slice(length).then(function(chunk) {
330
+ return {done: false, value: type ? that._parse(view(concat(array.slice(8), chunk))) : null};
331
+ });
332
+ }
333
+
334
+ return read();
335
+ });
336
+ }
337
+
338
+ var parsers = {
339
+ 0: parseNull,
340
+ 1: parsePoint,
341
+ 3: parsePolyLine,
342
+ 5: parsePolygon,
343
+ 8: parseMultiPoint,
344
+ 11: parsePoint, // PointZ
345
+ 13: parsePolyLine, // PolyLineZ
346
+ 15: parsePolygon, // PolygonZ
347
+ 18: parseMultiPoint, // MultiPointZ
348
+ 21: parsePoint, // PointM
349
+ 23: parsePolyLine, // PolyLineM
350
+ 25: parsePolygon, // PolygonM
351
+ 28: parseMultiPoint // MultiPointM
352
+ };
353
+
354
+ function shp(source) {
355
+ source = slice(source);
356
+ return source.slice(100).then(function(array) {
357
+ return new Shp(source, view(array));
358
+ });
359
+ }
360
+ function Shp(source, header) {
361
+ var type = header.getInt32(32, true);
362
+ if (!(type in parsers)) throw new Error("unsupported shape type: " + type);
363
+ this._source = source;
364
+ this._type = type;
365
+ this._index = 0;
366
+ this._parse = parsers[type];
367
+ this.bbox = [header.getFloat64(36, true), header.getFloat64(44, true), header.getFloat64(52, true), header.getFloat64(60, true)];
368
+ }
369
+
370
+ var prototype$1 = Shp.prototype;
371
+ prototype$1.read = shp_read;
372
+ prototype$1.cancel = cancel;
373
+
374
+ function noop() {}
375
+
376
+ function shapefile_cancel() {
377
+ return Promise.all([
378
+ this._dbf && this._dbf.cancel(),
379
+ this._shp.cancel()
380
+ ]).then(noop);
381
+ }
382
+
383
+ function shapefile_read() {
384
+ var that = this;
385
+ return Promise.all([
386
+ that._dbf ? that._dbf.read() : {value: {}},
387
+ that._shp.read()
388
+ ]).then(function(results) {
389
+ var dbf = results[0], shp = results[1];
390
+ return shp.done ? shp : {
391
+ done: false,
392
+ value: {
393
+ type: "Feature",
394
+ properties: dbf.value,
395
+ geometry: shp.value
396
+ }
397
+ };
398
+ });
399
+ }
400
+
401
+ function shapefile(shpSource, dbfSource, decoder) {
402
+ return Promise.all([
403
+ shp(shpSource),
404
+ dbfSource && dbf(dbfSource, decoder)
405
+ ]).then(function(sources) {
406
+ return new Shapefile(sources[0], sources[1]);
407
+ });
408
+ }
409
+
410
+ function Shapefile(shp, dbf) {
411
+ this._shp = shp;
412
+ this._dbf = dbf;
413
+ this.bbox = shp.bbox;
414
+ }
415
+
416
+ var prototype = Shapefile.prototype;
417
+ prototype.read = shapefile_read;
418
+ prototype.cancel = shapefile_cancel;
419
+
420
+ function open(shp, dbf, options) {
421
+ if (typeof dbf === "string") {
422
+ if (!/\.dbf$/.test(dbf)) dbf += ".dbf";
423
+ dbf = path(dbf);
424
+ } else if (dbf instanceof ArrayBuffer || dbf instanceof Uint8Array) {
425
+ dbf = array(dbf);
426
+ } else if (dbf != null) {
427
+ dbf = stream(dbf);
428
+ }
429
+ if (typeof shp === "string") {
430
+ if (!/\.shp$/.test(shp)) shp += ".shp";
431
+ if (dbf === undefined) dbf = path(shp.substring(0, shp.length - 4) + ".dbf").catch(function() {});
432
+ shp = path(shp);
433
+ } else if (shp instanceof ArrayBuffer || shp instanceof Uint8Array) {
434
+ shp = array(shp);
435
+ } else {
436
+ shp = stream(shp);
437
+ }
438
+ return Promise.all([shp, dbf]).then(function(sources) {
439
+ var shp = sources[0], dbf = sources[1], encoding = "windows-1252";
440
+ return shapefile(shp, dbf, dbf && new TextDecoder(encoding));
441
+ });
442
+ }
443
+
444
+ const shpToGeojson = (file) => {
445
+ return new Promise((resolve, reject) => {
446
+ const reader = new FileReader();
447
+ reader.readAsArrayBuffer(file);
448
+ const data = {
449
+ type: "FeatureCollection",
450
+ features: []
451
+ };
452
+ reader.onload = function() {
453
+ open(this.result).then((source) => source.read().then(
454
+ function log(result) {
455
+ if (!result.done) {
456
+ data.features.push(result.value);
457
+ source.read().then(log);
458
+ } else {
459
+ if (result.value) {
460
+ data.features.push(result.value);
461
+ }
462
+ resolve(data);
463
+ }
464
+ }
465
+ )).catch(reject);
466
+ };
467
+ });
468
+ };
469
+
470
+ const toGeojson = (file) => {
471
+ const actions = {
472
+ shp: shpToGeojson
473
+ };
474
+ return new Promise((resolve, reject) => {
475
+ const suffix = file.name.split(".").pop();
476
+ if (suffix && actions[suffix]) {
477
+ resolve(actions[suffix](file));
478
+ } else {
479
+ reject(new Error(`Can't resolve the .${suffix} file`));
480
+ }
481
+ });
482
+ };
483
+
484
+ export { toGeojson as t };
@@ -4,6 +4,7 @@ import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
4
4
  import { defineComponent, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, createVNode, mergeProps, toHandlers, createSlots, renderSlot, renderList, resolveDynamicComponent } from 'vue';
5
5
  import { createInputBindProps, createInputOnEmits } from '@vunk/form/shared/element-plus';
6
6
  import { useComputedReadonly } from '@vunk/form/composables';
7
+ import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
7
8
 
8
9
  const props = {
9
10
  ...inputProps,
@@ -39,7 +40,7 @@ var ctx = /*#__PURE__*/Object.freeze({
39
40
  props: props
40
41
  });
41
42
 
42
- var script = defineComponent({
43
+ var _sfc_main = defineComponent({
43
44
  name: "VkfInput",
44
45
  components: {
45
46
  ElInput,
@@ -47,9 +48,7 @@ var script = defineComponent({
47
48
  },
48
49
  emits,
49
50
  props,
50
- setup(props2, {
51
- emit
52
- }) {
51
+ setup(props2, { emit }) {
53
52
  const inputBindProps = createInputBindProps(props2, ["readonly", "label"]);
54
53
  const inputOnEmits = createInputOnEmits(emit);
55
54
  const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
@@ -63,29 +62,36 @@ var script = defineComponent({
63
62
  }
64
63
  });
65
64
 
66
- function render(_ctx, _cache, $props, $setup, $data, $options) {
65
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
67
66
  const _component_ElInput = resolveComponent("ElInput");
68
67
  const _component_VkfFormItem = resolveComponent("VkfFormItem");
69
68
  return openBlock(), createBlock(
70
69
  _component_VkfFormItem,
71
70
  normalizeProps(guardReactiveProps(_ctx.formItemBindProps)),
72
71
  {
73
- default: withCtx(() => [createVNode(_component_ElInput, mergeProps({
74
- maxlength: _ctx.maxlength,
75
- minlength: _ctx.minlength,
76
- rows: _ctx.rows
77
- }, _ctx.inputBindProps, toHandlers(_ctx.inputOnEmits), {
78
- readonly: _ctx.readonly
79
- }), createSlots({
80
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
81
- _: 2
82
- /* DYNAMIC */
83
- }, [renderList(_ctx.inputSlots, (item, key) => {
84
- return {
85
- name: key,
86
- fn: withCtx((e) => [(openBlock(), createBlock(resolveDynamicComponent(item?.(e))))])
87
- };
88
- })]), 1040, ["maxlength", "minlength", "rows", "readonly"]), renderSlot(_ctx.$slots, "formItem")]),
72
+ default: withCtx(() => [
73
+ createVNode(_component_ElInput, mergeProps({
74
+ maxlength: _ctx.maxlength,
75
+ minlength: _ctx.minlength,
76
+ rows: _ctx.rows
77
+ }, _ctx.inputBindProps, toHandlers(_ctx.inputOnEmits), { readonly: _ctx.readonly }), createSlots({
78
+ default: withCtx(() => [
79
+ renderSlot(_ctx.$slots, "default")
80
+ ]),
81
+ _: 2
82
+ /* DYNAMIC */
83
+ }, [
84
+ renderList(_ctx.inputSlots, (item, key) => {
85
+ return {
86
+ name: key,
87
+ fn: withCtx((e) => [
88
+ (openBlock(), createBlock(resolveDynamicComponent(item?.(e))))
89
+ ])
90
+ };
91
+ })
92
+ ]), 1040, ["maxlength", "minlength", "rows", "readonly"]),
93
+ renderSlot(_ctx.$slots, "formItem")
94
+ ]),
89
95
  _: 3
90
96
  /* FORWARDED */
91
97
  },
@@ -93,16 +99,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
93
99
  /* FULL_PROPS */
94
100
  );
95
101
  }
96
-
97
- script.render = render;
98
- script.__file = "input/src/index.vue";
102
+ var VkfInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\input\\src\\index.vue"]]);
99
103
 
100
104
  var types = /*#__PURE__*/Object.freeze({
101
105
  __proto__: null
102
106
  });
103
107
 
104
- script.install = (app) => {
105
- app.component(script.name, script);
108
+ VkfInput.install = (app) => {
109
+ app.component(VkfInput.name, VkfInput);
106
110
  };
107
111
 
108
- export { script as VkfInput, ctx as _VkfInputCtx, types as __VkfInput, script as default };
112
+ export { VkfInput, ctx as _VkfInputCtx, types as __VkfInput, VkfInput as default };