@evergis/react 3.1.19 → 3.1.20

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
@@ -6467,16 +6467,22 @@ const RoundedBackgroundContainer = React.memo(({ type, elementConfig, feature, r
6467
6467
  });
6468
6468
  const { options, style, children } = elementConfig || {};
6469
6469
  const { maxLength, center, fontColor, innerTemplateStyle, inlineUnits, big, bigIcon, hideEmpty, colorAttribute } = options || {};
6470
+ const iconElement = children?.find(({ id }) => id === "icon");
6470
6471
  const aliasElement = children?.find(({ id }) => id === "alias");
6471
6472
  const unitsElement = children?.find(({ id }) => id === "units");
6472
6473
  const valueElement = children?.find(({ id }) => id === "value");
6473
6474
  const value = renderElement({ id: "value" });
6474
6475
  const color = React.useMemo(() => attributes?.find(({ name }) => name === colorAttribute)?.value || fontColor, [attributes, colorAttribute, fontColor]);
6476
+ const renderIcon = React.useMemo(() => {
6477
+ if (!iconElement)
6478
+ return null;
6479
+ return (jsxRuntime.jsx(uilibGl.FlexSpan, { width: iconElement.options?.width || "1rem", alignItems: "center", mr: "0.5rem", children: renderElement({ id: "icon", wrap: false }) }));
6480
+ }, [iconElement, renderElement]);
6475
6481
  const renderAlias = React.useMemo(() => (jsxRuntime.jsx(ContainerAlias, { style: aliasElement?.style, children: jsxRuntime.jsx(TextTrim, { maxLength: maxLength || ALIAS_DEFAULT_MAX_LENGTH, children: renderElement({ id: "alias", wrap: false }) }) })), [aliasElement?.style, maxLength, renderElement]);
6476
6482
  const renderValue = React.useMemo(() => (jsxRuntime.jsxs(ContainerValue, { style: valueElement?.style, big: true, children: [value, !!unitsElement && (jsxRuntime.jsx(ContainerUnits, { style: unitsElement?.style, children: renderElement({ id: "units" }) }))] })), [valueElement?.style, value, unitsElement, renderElement]);
6477
6483
  if (!value && hideEmpty)
6478
6484
  return null;
6479
- return (jsxRuntime.jsxs(RoundedBackgroundContainerWrapper, { style: innerTemplateStyle || style, "$center": center, "$color": color, "$inlineUnits": inlineUnits, "$big": big, "$bigIcon": bigIcon, children: [jsxRuntime.jsxs(ContainerIconValue, { children: [renderElement({ id: "icon", wrap: false }), big ? renderAlias : renderValue] }), big ? renderValue : renderAlias] }));
6485
+ return (jsxRuntime.jsxs(RoundedBackgroundContainerWrapper, { style: innerTemplateStyle || style, "$center": center, "$color": color, "$inlineUnits": inlineUnits, "$big": big, "$bigIcon": bigIcon, children: [jsxRuntime.jsxs(ContainerIconValue, { children: [renderIcon, big ? renderAlias : renderValue] }), big ? renderValue : renderAlias] }));
6480
6486
  });
6481
6487
 
6482
6488
  const AddFeatureContainer = React.memo(({ elementConfig }) => {