@evergis/react 4.0.22-alpha.2 → 4.0.22-alpha.4

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/react.esm.js CHANGED
@@ -9384,7 +9384,7 @@ const getElementValue = ({ getDefaultContainer, ...props }) => {
9384
9384
 
9385
9385
  const getLayerAttributes = (attributesConfiguration) => {
9386
9386
  const { attributes, geometryAttribute } = attributesConfiguration;
9387
- return Object.entries(attributes ?? {}).filter(([attributeName, { isDisplayed }]) => ![geometryAttribute].includes(attributeName) && isDisplayed);
9387
+ return (attributes ?? []).filter(({ attributeName, isDisplayed }) => ![geometryAttribute].includes(attributeName) && isDisplayed);
9388
9388
  };
9389
9389
  const isSelectedFeature = (feature) => typeof feature === "object" && feature !== null && "layerDefinition" in feature;
9390
9390
  function getFeatureAttributes(feature = {}, layer, dataSource) {
@@ -9400,11 +9400,9 @@ function getFeatureAttributes(feature = {}, layer, dataSource) {
9400
9400
  const { idAttribute, attributes } = attributesConfiguration || {};
9401
9401
  const layerAttributes = idAttribute
9402
9402
  ? getLayerAttributes(attributesConfiguration)
9403
- : attributes
9404
- ? Object.entries(attributes)
9405
- : [];
9403
+ : attributes || [];
9406
9404
  // TODO: fix typings for "id" field, DO NOT REMOVE "id", it uses in src\hooks\attributes\useAttributes.ts
9407
- return layerAttributes.map(([attributeName, { type, subType, attributeConfigurationType, isEditable, stringFormat, alias = null, description },]) => {
9405
+ return layerAttributes.map(({ attributeName, type, subType, attributeConfigurationType, isEditable, stringFormat, alias = null, description, }) => {
9408
9406
  const isIdAttribute = attributeName === idAttribute;
9409
9407
  const additionalProps = isIdAttribute
9410
9408
  ? {
@@ -10836,7 +10834,10 @@ const useDataSources = ({ type: widgetType, config, attributes, filters, layerPa
10836
10834
  const descriptionResponse = await api.eql.getQueryDescription(getProps);
10837
10835
  return {
10838
10836
  items: queryResponse.features,
10839
- attributeDefinition: descriptionResponse,
10837
+ attributeDefinition: descriptionResponse.reduce((acc, curr) => ({
10838
+ ...acc,
10839
+ [curr.attributeName]: curr,
10840
+ }), {}),
10840
10841
  };
10841
10842
  }
10842
10843
  return api.layers.getFeatures(layerName, {
@@ -10938,8 +10939,9 @@ const useDataSources = ({ type: widgetType, config, attributes, filters, layerPa
10938
10939
  return;
10939
10940
  }
10940
10941
  const hasEmptyCoordinate = coordinates.some(([x, y]) => !x && !y);
10941
- if (hasEmptyCoordinate)
10942
+ if (hasEmptyCoordinate) {
10942
10943
  return;
10944
+ }
10943
10945
  /* const bbox = new Bbox(coordinates[0], coordinates[1], map.crs);
10944
10946
  const resolution = Math.max(bbox.width / painter.width, bbox.height / painter.height);
10945
10947