@evergis/react 4.0.28 → 4.0.29

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.
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { ContainerProps } from '../../types';
3
+ export declare const ElementLayerName: FC<ContainerProps>;
@@ -16,4 +16,5 @@ export declare const elementComponents: {
16
16
  readonly markdown: import('react').FC<import('..').ContainerProps>;
17
17
  readonly uploader: import('react').FC<import('..').ContainerProps>;
18
18
  readonly modal: import('react').FC<import('..').ContainerProps>;
19
+ readonly layerName: import('react').FC<import('..').ContainerProps>;
19
20
  };
package/dist/index.js CHANGED
@@ -9391,6 +9391,13 @@ const ElementModal = React.memo(({ type = exports.WidgetType.Dashboard, elementC
9391
9391
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalIcon, { kind: icon || "new_window", onClick: handleOpen }), jsxRuntime.jsxs(uilibGl.Dialog, { isOpen: isOpen, onCloseRequest: handleClose, modal: true, maxWidth: maxWidth, minWidth: minWidth, minHeight: minHeight, style: { paddingBottom: "2rem" }, children: [jsxRuntime.jsx(uilibGl.DialogTitle, { children: jsxRuntime.jsxs(uilibGl.Flex, { justifyContent: "space-between", alignItems: "center", children: [!!title && jsxRuntime.jsx("span", { children: title }), jsxRuntime.jsx(uilibGl.IconButton, { kind: "close", onClick: handleClose })] }) }), jsxRuntime.jsx(uilibGl.DialogContent, { children: isLoading ? (jsxRuntime.jsx(DashboardLoading, {})) : (jsxRuntime.jsx(Container, { isColumn: true, noBorders: true, children: jsxRuntime.jsx(ContainerChildren, { type: type, items: modalContent, isMain: true, renderElement: renderElement }) })) })] })] }));
9392
9392
  });
9393
9393
 
9394
+ const ElementLayerName = React.memo(({ type }) => {
9395
+ const { layerInfo } = useWidgetContext(type);
9396
+ if (!layerInfo?.name)
9397
+ return null;
9398
+ return jsxRuntime.jsx("span", { children: layerInfo.name });
9399
+ });
9400
+
9394
9401
  const elementComponents = {
9395
9402
  control: ElementControl,
9396
9403
  image: ElementImage,
@@ -9407,6 +9414,7 @@ const elementComponents = {
9407
9414
  markdown: ElementMarkdown,
9408
9415
  uploader: ElementUploader,
9409
9416
  modal: ElementModal,
9417
+ layerName: ElementLayerName,
9410
9418
  };
9411
9419
 
9412
9420
  const getElementValue = ({ getDefaultContainer, ...props }) => {