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