datastake-daf 0.6.395 → 0.6.397

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.
@@ -14098,9 +14098,8 @@ const determineHasChildren = ({
14098
14098
 
14099
14099
  const sortByPosition = (items, getConfig) => {
14100
14100
  return items.sort((a, b) => {
14101
- var _getConfig, _getConfig2;
14102
- const positionA = ((_getConfig = getConfig(a)) === null || _getConfig === void 0 ? void 0 : _getConfig.position) || 0;
14103
- const positionB = ((_getConfig2 = getConfig(b)) === null || _getConfig2 === void 0 ? void 0 : _getConfig2.position) || 0;
14101
+ const positionA = getConfig(a)?.position || 0;
14102
+ const positionB = getConfig(b)?.position || 0;
14104
14103
  return positionA - positionB;
14105
14104
  });
14106
14105
  };
@@ -14117,7 +14116,7 @@ const resolveDynamicLabel = (labelConfig, item, defaultLabel) => {
14117
14116
  const parts = labelKey.split(' is ');
14118
14117
  if (parts.length === 2) {
14119
14118
  const [conditionKey, conditionValue] = parts;
14120
- if ((item === null || item === void 0 ? void 0 : item[conditionKey]) === conditionValue) {
14119
+ if (item?.[conditionKey] === conditionValue) {
14121
14120
  return labelConfig[labelKey];
14122
14121
  }
14123
14122
  }
@@ -18802,6 +18801,17 @@ const useMap$1 = ({
18802
18801
  setData(null);
18803
18802
  }
18804
18803
  }
18804
+
18805
+ // Clear all polylines when allData changes
18806
+ if (mapRef && polylinesRef.current.length) {
18807
+ polylinesRef.current.forEach(polyline => {
18808
+ mapRef.removeLayer(polyline);
18809
+ });
18810
+ polylinesRef.current = [];
18811
+ }
18812
+ // if (mapRef) {
18813
+ // mapRef.removeLayer(polygonLayer);
18814
+ // }
18805
18815
  }, [allData]);
18806
18816
  React.useEffect(() => {
18807
18817
  if (allData) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.395",
3
+ "version": "0.6.397",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -268,6 +268,17 @@ export const useMap = ({
268
268
  setData(null);
269
269
  }
270
270
  }
271
+
272
+ // Clear all polylines when allData changes
273
+ if (mapRef && polylinesRef.current.length) {
274
+ polylinesRef.current.forEach((polyline) => {
275
+ mapRef.removeLayer(polyline);
276
+ });
277
+ polylinesRef.current = [];
278
+ }
279
+ // if (mapRef) {
280
+ // mapRef.removeLayer(polygonLayer);
281
+ // }
271
282
  }, [allData]);
272
283
 
273
284
  useEffect(() => {