bruce-models 1.0.9 → 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.
@@ -1721,6 +1721,24 @@ var BruceVariable;
1721
1721
  BruceVariable.SwapValues = SwapValues;
1722
1722
  })(BruceVariable || (BruceVariable = {}));
1723
1723
 
1724
+ /**
1725
+ * Example: ${Test.Test1}
1726
+ * Needs to become ["Test", "Test1"].
1727
+ * We need to cull this in admin-ui.
1728
+ * @param path
1729
+ * @returns
1730
+ */
1731
+ function parseLegacyPath(path) {
1732
+ if (!path) {
1733
+ return [];
1734
+ }
1735
+ if (path.startsWith("${") && path.endsWith("}")) {
1736
+ path.replace("${", "");
1737
+ path.replace("}", "");
1738
+ return PathUtils.ParseLegacy(path);
1739
+ }
1740
+ return PathUtils.Parse(path);
1741
+ }
1724
1742
  /**
1725
1743
  * Utility for calculating values from Bruce fields.
1726
1744
  * These fields are typically found in entity styles.
@@ -1844,7 +1862,7 @@ var Calculator;
1844
1862
  }
1845
1863
  Calculator.GetColor = GetColor;
1846
1864
  function GetMappingValue(value, entity) {
1847
- const attrPath = PathUtils.Parse(value.field);
1865
+ const attrPath = parseLegacyPath(value.field);
1848
1866
  const eValue = +Entity.GetValue(entity, attrPath);
1849
1867
  for (let i = 0; i < value.values.length; i++) {
1850
1868
  const option = value.values[i];
@@ -1876,7 +1894,7 @@ var Calculator;
1876
1894
  }
1877
1895
  Calculator.GetMappingValue = GetMappingValue;
1878
1896
  function GetGradientValue(value, entity) {
1879
- const attrPath = PathUtils.Parse(value.field);
1897
+ const attrPath = parseLegacyPath(value.field);
1880
1898
  let eValue = Entity.GetValue(entity, attrPath);
1881
1899
  eValue = Math.min(Math.max(eValue, value.min), value.max);
1882
1900
  if (eValue < value.points[0].position) {