bruce-models 7.0.4 → 7.0.5
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/dist/bruce-models.es5.js +78 -74
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +78 -74
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/calculator/calculator.js +77 -73
- package/dist/lib/calculator/calculator.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/calculator/calculator.d.ts +1 -1
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -5293,92 +5293,96 @@ var Calculator;
|
|
|
5293
5293
|
}
|
|
5294
5294
|
for (let i = 0; i < value.values.length; i++) {
|
|
5295
5295
|
const option = value.values[i];
|
|
5296
|
-
|
|
5297
|
-
//
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
return
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
}
|
|
5320
|
-
}
|
|
5321
|
-
catch (exception) {
|
|
5322
|
-
const e = exception;
|
|
5323
|
-
let suppress = false;
|
|
5324
|
-
if (e && typeof e == "object") {
|
|
5325
|
-
const msg = e.message;
|
|
5326
|
-
suppress = !!msg && (msg.includes("Unexpected end") || msg.includes("got end of script"));
|
|
5327
|
-
}
|
|
5328
|
-
if (!suppress) {
|
|
5329
|
-
console.error(e);
|
|
5330
|
-
}
|
|
5331
|
-
// Eval failed, therefor not a valid mapping-row.
|
|
5332
|
-
continue;
|
|
5333
|
-
}
|
|
5334
|
-
}
|
|
5335
|
-
let isMapValueNum = !isNaN(+mapValue);
|
|
5336
|
-
if (isMapValueNum == null) {
|
|
5337
|
-
isMapValueNum = false;
|
|
5338
|
-
}
|
|
5339
|
-
if (isValueNum && (isMapValueNum || (typeof mapValue === "string" && mapValue.includes("-")))) {
|
|
5340
|
-
if (+mapValue == +eValue) {
|
|
5341
|
-
return option.appliedValue;
|
|
5342
|
-
}
|
|
5343
|
-
const mapSplit = mapValue.split("-");
|
|
5344
|
-
if (mapSplit.length == 2) {
|
|
5345
|
-
const min = mapSplit[0];
|
|
5346
|
-
const max = mapSplit[1];
|
|
5347
|
-
if (min != "") {
|
|
5348
|
-
if (+eValue < +min) {
|
|
5349
|
-
continue;
|
|
5296
|
+
const fieldValues = Array.isArray(option.fieldValue) ? option.fieldValue : [option.fieldValue];
|
|
5297
|
+
// Check each field value in the array.
|
|
5298
|
+
for (let j = 0; j < fieldValues.length; j++) {
|
|
5299
|
+
let mapValue = fieldValues[j];
|
|
5300
|
+
// If mapValue is prefixed with "JS:", we evaluate it as JavaScript.
|
|
5301
|
+
// This lets us do things like JS:Boolean("${}") as a quick way to map 'existence' to a target value.
|
|
5302
|
+
if (typeof mapValue === "string" && mapValue.startsWith("JS:")) {
|
|
5303
|
+
try {
|
|
5304
|
+
let jsEval = mapValue.replace("JS:", "").trim();
|
|
5305
|
+
const attrPathStr = PathUtils.Wrap(attrPath);
|
|
5306
|
+
jsEval = jsEval.replace("${}", "${" + attrPathStr + "}");
|
|
5307
|
+
jsEval = BruceVariable.SwapValues({
|
|
5308
|
+
str: jsEval,
|
|
5309
|
+
entity: entity
|
|
5310
|
+
});
|
|
5311
|
+
// https://rollupjs.org/guide/en/#avoiding-eval
|
|
5312
|
+
// This stops eval warning.
|
|
5313
|
+
const eval2 = eval;
|
|
5314
|
+
mapValue = eval2(jsEval);
|
|
5315
|
+
// We currently expect eval to return a validity bool.
|
|
5316
|
+
// So it either matches and we return it, or it doesn't and we continue.
|
|
5317
|
+
if (mapValue) {
|
|
5318
|
+
return option.appliedValue;
|
|
5350
5319
|
}
|
|
5351
|
-
|
|
5352
|
-
if (max != "") {
|
|
5353
|
-
if (+eValue > +max) {
|
|
5320
|
+
else {
|
|
5354
5321
|
continue;
|
|
5355
5322
|
}
|
|
5356
5323
|
}
|
|
5357
|
-
|
|
5324
|
+
catch (exception) {
|
|
5325
|
+
const e = exception;
|
|
5326
|
+
let suppress = false;
|
|
5327
|
+
if (e && typeof e == "object") {
|
|
5328
|
+
const msg = e.message;
|
|
5329
|
+
suppress = !!msg && (msg.includes("Unexpected end") || msg.includes("got end of script"));
|
|
5330
|
+
}
|
|
5331
|
+
if (!suppress) {
|
|
5332
|
+
console.error(e);
|
|
5333
|
+
}
|
|
5334
|
+
// Eval failed, therefor not a valid mapping-row.
|
|
5358
5335
|
continue;
|
|
5359
5336
|
}
|
|
5360
|
-
return option.appliedValue;
|
|
5361
5337
|
}
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
return option.appliedValue;
|
|
5338
|
+
let isMapValueNum = !isNaN(+mapValue);
|
|
5339
|
+
if (isMapValueNum == null) {
|
|
5340
|
+
isMapValueNum = false;
|
|
5366
5341
|
}
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5342
|
+
if (isValueNum && (isMapValueNum || (typeof mapValue === "string" && mapValue.includes("-")))) {
|
|
5343
|
+
if (+mapValue == +eValue) {
|
|
5344
|
+
return option.appliedValue;
|
|
5345
|
+
}
|
|
5346
|
+
const mapSplit = mapValue.split("-");
|
|
5347
|
+
if (mapSplit.length == 2) {
|
|
5348
|
+
const min = mapSplit[0];
|
|
5349
|
+
const max = mapSplit[1];
|
|
5350
|
+
if (min != "") {
|
|
5351
|
+
if (+eValue < +min) {
|
|
5352
|
+
continue;
|
|
5353
|
+
}
|
|
5354
|
+
}
|
|
5355
|
+
if (max != "") {
|
|
5356
|
+
if (+eValue > +max) {
|
|
5357
|
+
continue;
|
|
5358
|
+
}
|
|
5359
|
+
}
|
|
5360
|
+
if (min == "" && max == "") {
|
|
5361
|
+
continue;
|
|
5362
|
+
}
|
|
5372
5363
|
return option.appliedValue;
|
|
5373
5364
|
}
|
|
5374
5365
|
}
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
else if (typeof mapValue === "boolean" && typeof eValue === "string") {
|
|
5378
|
-
const mapValueStr = mapValue ? "true" : "false";
|
|
5379
|
-
if (mapValueStr == eValue.toLowerCase()) {
|
|
5366
|
+
else {
|
|
5367
|
+
if (mapValue == eValue) {
|
|
5380
5368
|
return option.appliedValue;
|
|
5381
5369
|
}
|
|
5370
|
+
// Case where Entity value is a boolean but the mapping value is a string.
|
|
5371
|
+
// Common as mapping value is typically a user-entered string.
|
|
5372
|
+
else if (typeof eValue === "boolean" && typeof mapValue === "string") {
|
|
5373
|
+
const eValueStr = eValue ? "true" : "false";
|
|
5374
|
+
if (mapValue.toLowerCase() == eValueStr) {
|
|
5375
|
+
return option.appliedValue;
|
|
5376
|
+
}
|
|
5377
|
+
}
|
|
5378
|
+
// Handling possible case where the opposite is true.
|
|
5379
|
+
// Have not seen this happen yet, but preparing for any future cases.
|
|
5380
|
+
else if (typeof mapValue === "boolean" && typeof eValue === "string") {
|
|
5381
|
+
const mapValueStr = mapValue ? "true" : "false";
|
|
5382
|
+
if (mapValueStr == eValue.toLowerCase()) {
|
|
5383
|
+
return option.appliedValue;
|
|
5384
|
+
}
|
|
5385
|
+
}
|
|
5382
5386
|
}
|
|
5383
5387
|
}
|
|
5384
5388
|
}
|
|
@@ -17017,7 +17021,7 @@ class NavigatorMcpWebSocketClient {
|
|
|
17017
17021
|
}
|
|
17018
17022
|
|
|
17019
17023
|
// This is updated with the package.json version on build.
|
|
17020
|
-
const VERSION = "7.0.
|
|
17024
|
+
const VERSION = "7.0.5";
|
|
17021
17025
|
|
|
17022
17026
|
export { VERSION, Assembly, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, GeoJson, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityAttribute, EntityHistoricData, EntityTableView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewBookmarkGroup, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, UserMfaMethod, Account, AccountInvite, AccountFeatures, AccountLimits, AccountTemplate, AccountType, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, DataLabGroup, ImportAssembly, ImportCad, ImportCsv, ImportJson, ImportGeoJson, ImportKml, ImportedFile, ExportBrz, ExportUsd, Markup, Uploader, Plugin, ENVIRONMENT, DataSource, Scenario, Tracking, NavigatorChatClient, NavigatorMcpWebSocketClient };
|
|
17023
17027
|
//# sourceMappingURL=bruce-models.es5.js.map
|