bruce-models 1.1.0 → 1.1.1

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.
@@ -1685,6 +1685,24 @@
1685
1685
  BruceVariable.SwapValues = SwapValues;
1686
1686
  })(exports.BruceVariable || (exports.BruceVariable = {}));
1687
1687
 
1688
+ /**
1689
+ * Example: ${Test.Test1}
1690
+ * Needs to become ["Test", "Test1"].
1691
+ * We need to cull this in admin-ui.
1692
+ * @param path
1693
+ * @returns
1694
+ */
1695
+ function parseLegacyPath(path) {
1696
+ if (!path) {
1697
+ return [];
1698
+ }
1699
+ if (path.startsWith("${") && path.endsWith("}")) {
1700
+ path.replace("${", "");
1701
+ path.replace("}", "");
1702
+ return exports.PathUtils.ParseLegacy(path);
1703
+ }
1704
+ return exports.PathUtils.Parse(path);
1705
+ }
1688
1706
  (function (Calculator) {
1689
1707
  let EValueType;
1690
1708
  (function (EValueType) {
@@ -1803,7 +1821,7 @@
1803
1821
  }
1804
1822
  Calculator.GetColor = GetColor;
1805
1823
  function GetMappingValue(value, entity) {
1806
- const attrPath = exports.PathUtils.Parse(value.field);
1824
+ const attrPath = parseLegacyPath(value.field);
1807
1825
  const eValue = +exports.Entity.GetValue(entity, attrPath);
1808
1826
  for (let i = 0; i < value.values.length; i++) {
1809
1827
  const option = value.values[i];
@@ -1835,7 +1853,7 @@
1835
1853
  }
1836
1854
  Calculator.GetMappingValue = GetMappingValue;
1837
1855
  function GetGradientValue(value, entity) {
1838
- const attrPath = exports.PathUtils.Parse(value.field);
1856
+ const attrPath = parseLegacyPath(value.field);
1839
1857
  let eValue = exports.Entity.GetValue(entity, attrPath);
1840
1858
  eValue = Math.min(Math.max(eValue, value.min), value.max);
1841
1859
  if (eValue < value.points[0].position) {