@corpsmap/corpsmap 3.0.13 → 3.0.14

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.
package/lib/dev.js CHANGED
@@ -195,6 +195,10 @@ function _createSuper(Derived) {
195
195
  };
196
196
  }
197
197
 
198
+ function _slicedToArray(arr, i) {
199
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
200
+ }
201
+
198
202
  function _toConsumableArray(arr) {
199
203
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
200
204
  }
@@ -203,10 +207,44 @@ function _arrayWithoutHoles(arr) {
203
207
  if (Array.isArray(arr)) return _arrayLikeToArray(arr);
204
208
  }
205
209
 
210
+ function _arrayWithHoles(arr) {
211
+ if (Array.isArray(arr)) return arr;
212
+ }
213
+
206
214
  function _iterableToArray(iter) {
207
215
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
208
216
  }
209
217
 
218
+ function _iterableToArrayLimit(arr, i) {
219
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
220
+
221
+ if (_i == null) return;
222
+ var _arr = [];
223
+ var _n = true;
224
+ var _d = false;
225
+
226
+ var _s, _e;
227
+
228
+ try {
229
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
230
+ _arr.push(_s.value);
231
+
232
+ if (i && _arr.length === i) break;
233
+ }
234
+ } catch (err) {
235
+ _d = true;
236
+ _e = err;
237
+ } finally {
238
+ try {
239
+ if (!_n && _i["return"] != null) _i["return"]();
240
+ } finally {
241
+ if (_d) throw _e;
242
+ }
243
+ }
244
+
245
+ return _arr;
246
+ }
247
+
210
248
  function _unsupportedIterableToArray(o, minLen) {
211
249
  if (!o) return;
212
250
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -228,6 +266,10 @@ function _nonIterableSpread() {
228
266
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
229
267
  }
230
268
 
269
+ function _nonIterableRest() {
270
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
271
+ }
272
+
231
273
  var CONTEXT_TYPES = {
232
274
  store: function () {}
233
275
  };
@@ -106419,7 +106461,7 @@ var config = {
106419
106461
  };
106420
106462
 
106421
106463
  var name = "@corpsmap/corpsmap";
106422
- var version$1 = "3.0.13";
106464
+ var version$1 = "3.0.14";
106423
106465
  var description = "CorpsMap as React Components";
106424
106466
  var main = "index.js";
106425
106467
  var scripts = {
@@ -132700,6 +132742,22 @@ var plugin = {
132700
132742
  }]
132701
132743
  };
132702
132744
 
132745
+ var formatArcgisrest = function formatArcgisrest(attributes) {
132746
+ for (var _i = 0, _Object$entries = Object.entries(attributes); _i < _Object$entries.length; _i++) {
132747
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
132748
+ key = _Object$entries$_i[0],
132749
+ value = _Object$entries$_i[1];
132750
+
132751
+ var result = value.includes("https:") || value.includes("http:") ? value : null;
132752
+
132753
+ if (result) {
132754
+ attributes[key] = "<a href=\"".concat(value, "\" target=\"_new\" > ").concat(value, " </a>");
132755
+ }
132756
+ }
132757
+
132758
+ return attributes;
132759
+ };
132760
+
132703
132761
  function formatUrl(options) {
132704
132762
  var url = "".concat(options.root, "/identify?");
132705
132763
  var params = [];
@@ -132812,7 +132870,7 @@ var bundle$1 = {
132812
132870
  type: featureType,
132813
132871
  coordinates: coords
132814
132872
  },
132815
- properties: feat.attributes
132873
+ properties: formatArcgisrest(feat.attributes)
132816
132874
  };
132817
132875
  })
132818
132876
  })
package/lib/prod.js CHANGED
@@ -195,6 +195,10 @@ function _createSuper(Derived) {
195
195
  };
196
196
  }
197
197
 
198
+ function _slicedToArray(arr, i) {
199
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
200
+ }
201
+
198
202
  function _toConsumableArray(arr) {
199
203
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
200
204
  }
@@ -203,10 +207,44 @@ function _arrayWithoutHoles(arr) {
203
207
  if (Array.isArray(arr)) return _arrayLikeToArray(arr);
204
208
  }
205
209
 
210
+ function _arrayWithHoles(arr) {
211
+ if (Array.isArray(arr)) return arr;
212
+ }
213
+
206
214
  function _iterableToArray(iter) {
207
215
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
208
216
  }
209
217
 
218
+ function _iterableToArrayLimit(arr, i) {
219
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
220
+
221
+ if (_i == null) return;
222
+ var _arr = [];
223
+ var _n = true;
224
+ var _d = false;
225
+
226
+ var _s, _e;
227
+
228
+ try {
229
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
230
+ _arr.push(_s.value);
231
+
232
+ if (i && _arr.length === i) break;
233
+ }
234
+ } catch (err) {
235
+ _d = true;
236
+ _e = err;
237
+ } finally {
238
+ try {
239
+ if (!_n && _i["return"] != null) _i["return"]();
240
+ } finally {
241
+ if (_d) throw _e;
242
+ }
243
+ }
244
+
245
+ return _arr;
246
+ }
247
+
210
248
  function _unsupportedIterableToArray(o, minLen) {
211
249
  if (!o) return;
212
250
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -228,6 +266,10 @@ function _nonIterableSpread() {
228
266
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
229
267
  }
230
268
 
269
+ function _nonIterableRest() {
270
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
271
+ }
272
+
231
273
  var CONTEXT_TYPES = {
232
274
  store: function () {}
233
275
  };
@@ -106333,7 +106375,7 @@ var config = {
106333
106375
  };
106334
106376
 
106335
106377
  var name = "@corpsmap/corpsmap";
106336
- var version$1 = "3.0.13";
106378
+ var version$1 = "3.0.14";
106337
106379
  var description = "CorpsMap as React Components";
106338
106380
  var main = "index.js";
106339
106381
  var scripts = {
@@ -132614,6 +132656,22 @@ var plugin = {
132614
132656
  }]
132615
132657
  };
132616
132658
 
132659
+ var formatArcgisrest = function formatArcgisrest(attributes) {
132660
+ for (var _i = 0, _Object$entries = Object.entries(attributes); _i < _Object$entries.length; _i++) {
132661
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
132662
+ key = _Object$entries$_i[0],
132663
+ value = _Object$entries$_i[1];
132664
+
132665
+ var result = value.includes("https:") || value.includes("http:") ? value : null;
132666
+
132667
+ if (result) {
132668
+ attributes[key] = "<a href=\"".concat(value, "\" target=\"_new\" > ").concat(value, " </a>");
132669
+ }
132670
+ }
132671
+
132672
+ return attributes;
132673
+ };
132674
+
132617
132675
  function formatUrl(options) {
132618
132676
  var url = "".concat(options.root, "/identify?");
132619
132677
  var params = [];
@@ -132726,7 +132784,7 @@ var bundle$1 = {
132726
132784
  type: featureType,
132727
132785
  coordinates: coords
132728
132786
  },
132729
- properties: feat.attributes
132787
+ properties: formatArcgisrest(feat.attributes)
132730
132788
  };
132731
132789
  })
132732
132790
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corpsmap/corpsmap",
3
- "version": "3.0.13",
3
+ "version": "3.0.14",
4
4
  "description": "CorpsMap as React Components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,4 +1,5 @@
1
1
  import async from "async";
2
+ import formatArcgisrest from "../../openlayers-utils/format-utilities";
2
3
 
3
4
  function formatUrl(options) {
4
5
  let url = `${options.root}/identify?`;
@@ -105,7 +106,7 @@ export default {
105
106
  type: featureType,
106
107
  coordinates: coords,
107
108
  },
108
- properties: feat.attributes,
109
+ properties: formatArcgisrest(feat.attributes),
109
110
  };
110
111
  }),
111
112
  },
@@ -0,0 +1,13 @@
1
+ const formatArcgisrest = function (attributes) {
2
+ for (const [key, value] of Object.entries(attributes)) {
3
+ const result =
4
+ value.includes("https:") || value.includes("http:") ? value : null;
5
+
6
+ if (result) {
7
+ attributes[key] = `<a href="${value}" target="_new" > ${value} </a>`;
8
+ }
9
+ }
10
+ return attributes;
11
+ };
12
+
13
+ export default formatArcgisrest;