bruce-models 3.0.1 → 3.0.3
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 +28 -9
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +28 -9
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/calculator/calculator.js +22 -3
- package/dist/lib/calculator/calculator.js.map +1 -1
- package/dist/lib/entity/entity.js +5 -5
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/entity/entity.d.ts +1 -1
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -2023,10 +2023,10 @@
|
|
|
2023
2023
|
return `${exports.Api.ECacheKey.Entity}${exports.Api.ECacheKey.Id}${entityId}${String(entityTypeId)}${String(Boolean(expandLocation))}`;
|
|
2024
2024
|
}
|
|
2025
2025
|
Entity.GetCacheKey = GetCacheKey;
|
|
2026
|
-
function
|
|
2026
|
+
function GetContainsKey(entityId) {
|
|
2027
2027
|
return `${exports.Api.ECacheKey.Entity}${exports.Api.ECacheKey.Id}${entityId}`;
|
|
2028
2028
|
}
|
|
2029
|
-
Entity.
|
|
2029
|
+
Entity.GetContainsKey = GetContainsKey;
|
|
2030
2030
|
function Get(params) {
|
|
2031
2031
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2032
2032
|
let { api, entityId, req: reqParams, expandLocation, entityTypeId } = params;
|
|
@@ -2140,7 +2140,7 @@
|
|
|
2140
2140
|
throw ("Entity ID is required.");
|
|
2141
2141
|
}
|
|
2142
2142
|
yield api.DELETE(`entity/${entityId}`, exports.Api.PrepReqParams(reqParams));
|
|
2143
|
-
api.Cache.
|
|
2143
|
+
api.Cache.RemoveByContains(GetContainsKey(entityId));
|
|
2144
2144
|
});
|
|
2145
2145
|
}
|
|
2146
2146
|
Entity.Delete = Delete;
|
|
@@ -2158,7 +2158,7 @@
|
|
|
2158
2158
|
}, exports.Api.PrepReqParams(reqParams));
|
|
2159
2159
|
for (let i = 0; i < entityIds.length; i++) {
|
|
2160
2160
|
const entityId = entityIds[i];
|
|
2161
|
-
api.Cache.
|
|
2161
|
+
api.Cache.RemoveByContains(GetContainsKey(entityId));
|
|
2162
2162
|
}
|
|
2163
2163
|
});
|
|
2164
2164
|
}
|
|
@@ -2178,7 +2178,7 @@
|
|
|
2178
2178
|
}
|
|
2179
2179
|
const reqUrl = `entity/${data.Bruce.ID}/?dataoverride=${override}&BruceEntityType=${data.Bruce["EntityType.ID"]}`;
|
|
2180
2180
|
const res = yield api.POST(reqUrl, data, exports.Api.PrepReqParams(reqParams));
|
|
2181
|
-
api.Cache.
|
|
2181
|
+
api.Cache.RemoveByContains(GetContainsKey(data.Bruce.ID));
|
|
2182
2182
|
return {
|
|
2183
2183
|
entity: res
|
|
2184
2184
|
};
|
|
@@ -2635,16 +2635,35 @@
|
|
|
2635
2635
|
let value;
|
|
2636
2636
|
switch (field.type) {
|
|
2637
2637
|
case EValueType.Gradient:
|
|
2638
|
-
|
|
2638
|
+
{
|
|
2639
|
+
const tmp = GetGradientValue(field.value, entity);
|
|
2640
|
+
// This avoids null turning into "null".
|
|
2641
|
+
if (tmp) {
|
|
2642
|
+
value = String(tmp);
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2639
2645
|
break;
|
|
2640
2646
|
case EValueType.Color:
|
|
2641
2647
|
case EValueType.Input:
|
|
2642
|
-
|
|
2648
|
+
{
|
|
2649
|
+
const tmp = GetInputValue(field.value, entity);
|
|
2650
|
+
// This avoids null turning into "null".
|
|
2651
|
+
if (tmp) {
|
|
2652
|
+
value = String(tmp);
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2643
2655
|
break;
|
|
2644
2656
|
case EValueType.Mapping:
|
|
2645
|
-
|
|
2657
|
+
{
|
|
2658
|
+
const tmp = GetMappingValue(field.value, entity);
|
|
2659
|
+
// This avoids null turning into "null".
|
|
2660
|
+
if (tmp) {
|
|
2661
|
+
value = String(tmp);
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2646
2664
|
break;
|
|
2647
2665
|
case EValueType.RandomColor:
|
|
2666
|
+
// Would be nice to randomize based on an attribute or entity ID instead of pure random.
|
|
2648
2667
|
var color = exports.Color.RandomColor();
|
|
2649
2668
|
value = `rgba(${color.red},${color.green},${color.blue},${color.alpha})`;
|
|
2650
2669
|
break;
|
|
@@ -8874,7 +8893,7 @@
|
|
|
8874
8893
|
DataSource.GetList = GetList;
|
|
8875
8894
|
})(exports.DataSource || (exports.DataSource = {}));
|
|
8876
8895
|
|
|
8877
|
-
const VERSION = "3.0.
|
|
8896
|
+
const VERSION = "3.0.3";
|
|
8878
8897
|
|
|
8879
8898
|
exports.VERSION = VERSION;
|
|
8880
8899
|
exports.AbstractApi = AbstractApi;
|