@corpsmap/corpsmap 3.2.44 → 3.2.46
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/css/corpsmap.css +112 -113
- package/lib/dev.js +29 -9
- package/lib/prod.js +29 -9
- package/package.json +1 -1
- package/src/openlayers-utils/format-utilities.js +32 -12
package/lib/dev.js
CHANGED
|
@@ -153,6 +153,9 @@ function _possibleConstructorReturn(t, e) {
|
|
|
153
153
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
154
154
|
return _assertThisInitialized(t);
|
|
155
155
|
}
|
|
156
|
+
function _readOnlyError(r) {
|
|
157
|
+
throw new TypeError('"' + r + '" is read-only');
|
|
158
|
+
}
|
|
156
159
|
function _setPrototypeOf(t, e) {
|
|
157
160
|
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
158
161
|
return t.__proto__ = e, t;
|
|
@@ -106655,7 +106658,7 @@ var config = {
|
|
|
106655
106658
|
};
|
|
106656
106659
|
|
|
106657
106660
|
var name = "@corpsmap/corpsmap";
|
|
106658
|
-
var version$1 = "3.2.
|
|
106661
|
+
var version$1 = "3.2.46";
|
|
106659
106662
|
var description = "CorpsMap as React Components";
|
|
106660
106663
|
var main = "index.js";
|
|
106661
106664
|
var scripts = {
|
|
@@ -135858,6 +135861,9 @@ var formatArcgisrest = function formatArcgisrest(attributes) {
|
|
|
135858
135861
|
key = _Object$entries$_i[0],
|
|
135859
135862
|
value = _Object$entries$_i[1];
|
|
135860
135863
|
var result = String(value).includes("https:") || String(value).includes("http:") ? value : null;
|
|
135864
|
+
if (String(value).includes("<a href")) {
|
|
135865
|
+
_readOnlyError("result");
|
|
135866
|
+
}
|
|
135861
135867
|
if (result) {
|
|
135862
135868
|
attributes[key] = "<a href=\"".concat(value, "\" target=\"_new\" > ").concat(value, " </a>");
|
|
135863
135869
|
}
|
|
@@ -135871,17 +135877,12 @@ var formatArcgisVector = function formatArcgisVector(results) {
|
|
|
135871
135877
|
key = _Object$entries2$_i[0],
|
|
135872
135878
|
value = _Object$entries2$_i[1];
|
|
135873
135879
|
var result = String(value).includes("https:") || String(value).includes("http:") ? value : null;
|
|
135880
|
+
if (String(value).includes("<a href")) {
|
|
135881
|
+
result = null;
|
|
135882
|
+
}
|
|
135874
135883
|
if (result) {
|
|
135875
135884
|
feat.properties[key] = "<a href=\"".concat(value, "\" target=\"_new\" > ").concat(value, " </a>");
|
|
135876
135885
|
}
|
|
135877
|
-
// Format UNIX Date
|
|
135878
|
-
|
|
135879
|
-
// if ((key === "fromdate" || key === "todate" || key === "referencedate") && Number.isInteger(feat.properties[key])) {
|
|
135880
|
-
// const unixTimestamp = feat.properties[key];
|
|
135881
|
-
// const milliseconds = unixTimestamp // * 1000 in some cases.
|
|
135882
|
-
// const dateObject = new Date(milliseconds);
|
|
135883
|
-
// feat.properties[key] = dateObject.toLocaleString();
|
|
135884
|
-
// }
|
|
135885
135886
|
}
|
|
135886
135887
|
});
|
|
135887
135888
|
return results;
|
|
@@ -135987,6 +135988,25 @@ var formatColumns = function formatColumns(value, formatType) {
|
|
|
135987
135988
|
var dateObject = new Date(milliseconds);
|
|
135988
135989
|
value = dateObject.toLocaleString();
|
|
135989
135990
|
}
|
|
135991
|
+
if (formatType === "UNIXDATE_NOTIME") {
|
|
135992
|
+
if (value === null || value === "null") {
|
|
135993
|
+
return null;
|
|
135994
|
+
}
|
|
135995
|
+
var _unixTimestamp = value;
|
|
135996
|
+
var _milliseconds = _unixTimestamp; // * 1000 in some cases.
|
|
135997
|
+
var _dateObject = new Date(_milliseconds);
|
|
135998
|
+
var dateFormatted = new Intl.DateTimeFormat("en-US", {
|
|
135999
|
+
year: "numeric",
|
|
136000
|
+
month: "2-digit",
|
|
136001
|
+
day: "2-digit"
|
|
136002
|
+
}).format(_dateObject);
|
|
136003
|
+
value = dateFormatted;
|
|
136004
|
+
}
|
|
136005
|
+
if (formatType === "ICEJAM") {
|
|
136006
|
+
var url = "https://icejam.sec.usace.army.mil/ords/f?p=1001:2:::::IR_INDEX_NUMBER:".concat(value);
|
|
136007
|
+
var result = "<span><a href=\"".concat(url, "\" target=\"_blank\"> ").concat(value, " </a></span>");
|
|
136008
|
+
return result;
|
|
136009
|
+
}
|
|
135990
136010
|
return value;
|
|
135991
136011
|
};
|
|
135992
136012
|
|
package/lib/prod.js
CHANGED
|
@@ -153,6 +153,9 @@ function _possibleConstructorReturn(t, e) {
|
|
|
153
153
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
154
154
|
return _assertThisInitialized(t);
|
|
155
155
|
}
|
|
156
|
+
function _readOnlyError(r) {
|
|
157
|
+
throw new TypeError('"' + r + '" is read-only');
|
|
158
|
+
}
|
|
156
159
|
function _setPrototypeOf(t, e) {
|
|
157
160
|
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
158
161
|
return t.__proto__ = e, t;
|
|
@@ -106569,7 +106572,7 @@ var config = {
|
|
|
106569
106572
|
};
|
|
106570
106573
|
|
|
106571
106574
|
var name = "@corpsmap/corpsmap";
|
|
106572
|
-
var version$1 = "3.2.
|
|
106575
|
+
var version$1 = "3.2.46";
|
|
106573
106576
|
var description = "CorpsMap as React Components";
|
|
106574
106577
|
var main = "index.js";
|
|
106575
106578
|
var scripts = {
|
|
@@ -135772,6 +135775,9 @@ var formatArcgisrest = function formatArcgisrest(attributes) {
|
|
|
135772
135775
|
key = _Object$entries$_i[0],
|
|
135773
135776
|
value = _Object$entries$_i[1];
|
|
135774
135777
|
var result = String(value).includes("https:") || String(value).includes("http:") ? value : null;
|
|
135778
|
+
if (String(value).includes("<a href")) {
|
|
135779
|
+
_readOnlyError("result");
|
|
135780
|
+
}
|
|
135775
135781
|
if (result) {
|
|
135776
135782
|
attributes[key] = "<a href=\"".concat(value, "\" target=\"_new\" > ").concat(value, " </a>");
|
|
135777
135783
|
}
|
|
@@ -135785,17 +135791,12 @@ var formatArcgisVector = function formatArcgisVector(results) {
|
|
|
135785
135791
|
key = _Object$entries2$_i[0],
|
|
135786
135792
|
value = _Object$entries2$_i[1];
|
|
135787
135793
|
var result = String(value).includes("https:") || String(value).includes("http:") ? value : null;
|
|
135794
|
+
if (String(value).includes("<a href")) {
|
|
135795
|
+
result = null;
|
|
135796
|
+
}
|
|
135788
135797
|
if (result) {
|
|
135789
135798
|
feat.properties[key] = "<a href=\"".concat(value, "\" target=\"_new\" > ").concat(value, " </a>");
|
|
135790
135799
|
}
|
|
135791
|
-
// Format UNIX Date
|
|
135792
|
-
|
|
135793
|
-
// if ((key === "fromdate" || key === "todate" || key === "referencedate") && Number.isInteger(feat.properties[key])) {
|
|
135794
|
-
// const unixTimestamp = feat.properties[key];
|
|
135795
|
-
// const milliseconds = unixTimestamp // * 1000 in some cases.
|
|
135796
|
-
// const dateObject = new Date(milliseconds);
|
|
135797
|
-
// feat.properties[key] = dateObject.toLocaleString();
|
|
135798
|
-
// }
|
|
135799
135800
|
}
|
|
135800
135801
|
});
|
|
135801
135802
|
return results;
|
|
@@ -135901,6 +135902,25 @@ var formatColumns = function formatColumns(value, formatType) {
|
|
|
135901
135902
|
var dateObject = new Date(milliseconds);
|
|
135902
135903
|
value = dateObject.toLocaleString();
|
|
135903
135904
|
}
|
|
135905
|
+
if (formatType === "UNIXDATE_NOTIME") {
|
|
135906
|
+
if (value === null || value === "null") {
|
|
135907
|
+
return null;
|
|
135908
|
+
}
|
|
135909
|
+
var _unixTimestamp = value;
|
|
135910
|
+
var _milliseconds = _unixTimestamp; // * 1000 in some cases.
|
|
135911
|
+
var _dateObject = new Date(_milliseconds);
|
|
135912
|
+
var dateFormatted = new Intl.DateTimeFormat("en-US", {
|
|
135913
|
+
year: "numeric",
|
|
135914
|
+
month: "2-digit",
|
|
135915
|
+
day: "2-digit"
|
|
135916
|
+
}).format(_dateObject);
|
|
135917
|
+
value = dateFormatted;
|
|
135918
|
+
}
|
|
135919
|
+
if (formatType === "ICEJAM") {
|
|
135920
|
+
var url = "https://icejam.sec.usace.army.mil/ords/f?p=1001:2:::::IR_INDEX_NUMBER:".concat(value);
|
|
135921
|
+
var result = "<span><a href=\"".concat(url, "\" target=\"_blank\"> ").concat(value, " </a></span>");
|
|
135922
|
+
return result;
|
|
135923
|
+
}
|
|
135904
135924
|
return value;
|
|
135905
135925
|
};
|
|
135906
135926
|
|
package/package.json
CHANGED
|
@@ -5,9 +5,13 @@ const formatArcgisrest = function (attributes) {
|
|
|
5
5
|
? value
|
|
6
6
|
: null;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
if(String(value).includes("<a href")) {
|
|
9
|
+
result = null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (result) {
|
|
13
|
+
attributes[key] = `<a href="${value}" target="_new" > ${value} </a>`;
|
|
14
|
+
}
|
|
11
15
|
}
|
|
12
16
|
return attributes;
|
|
13
17
|
};
|
|
@@ -15,24 +19,20 @@ const formatArcgisrest = function (attributes) {
|
|
|
15
19
|
const formatArcgisVector = function (results) {
|
|
16
20
|
results.map((feat) => {
|
|
17
21
|
for (const [key, value] of Object.entries(feat.properties)) {
|
|
18
|
-
|
|
22
|
+
let result =
|
|
19
23
|
String(value).includes("https:") || String(value).includes("http:")
|
|
20
24
|
? value
|
|
21
25
|
: null;
|
|
22
26
|
|
|
27
|
+
if(String(value).includes("<a href")) {
|
|
28
|
+
result = null;
|
|
29
|
+
}
|
|
30
|
+
|
|
23
31
|
if (result) {
|
|
24
32
|
feat.properties[
|
|
25
33
|
key
|
|
26
34
|
] = `<a href="${value}" target="_new" > ${value} </a>`;
|
|
27
35
|
}
|
|
28
|
-
// Format UNIX Date
|
|
29
|
-
|
|
30
|
-
// if ((key === "fromdate" || key === "todate" || key === "referencedate") && Number.isInteger(feat.properties[key])) {
|
|
31
|
-
// const unixTimestamp = feat.properties[key];
|
|
32
|
-
// const milliseconds = unixTimestamp // * 1000 in some cases.
|
|
33
|
-
// const dateObject = new Date(milliseconds);
|
|
34
|
-
// feat.properties[key] = dateObject.toLocaleString();
|
|
35
|
-
// }
|
|
36
36
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
@@ -136,6 +136,26 @@ const formatColumns = function (value, formatType) {
|
|
|
136
136
|
const dateObject = new Date(milliseconds);
|
|
137
137
|
value = dateObject.toLocaleString();
|
|
138
138
|
}
|
|
139
|
+
if (formatType === "UNIXDATE_NOTIME") {
|
|
140
|
+
if (value === null || value === "null") {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
const unixTimestamp = value;
|
|
144
|
+
const milliseconds = unixTimestamp // * 1000 in some cases.
|
|
145
|
+
const dateObject = new Date(milliseconds);
|
|
146
|
+
const dateFormatted = new Intl.DateTimeFormat("en-US", {
|
|
147
|
+
year: "numeric",
|
|
148
|
+
month: "2-digit",
|
|
149
|
+
day: "2-digit"
|
|
150
|
+
}).format(dateObject);
|
|
151
|
+
value = dateFormatted;
|
|
152
|
+
}
|
|
153
|
+
if (formatType === "ICEJAM") {
|
|
154
|
+
let url = `https://icejam.sec.usace.army.mil/ords/f?p=1001:2:::::IR_INDEX_NUMBER:${value}`;
|
|
155
|
+
let result = `<span><a href="${url}" target="_blank"> ${value} </a></span>`;
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
|
|
139
159
|
return value;
|
|
140
160
|
};
|
|
141
161
|
|