@evergis/react 3.1.127 → 3.1.128

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.
@@ -1,3 +1,3 @@
1
1
  import { FC } from 'react';
2
2
  import { ContainerProps } from '../../types';
3
- export declare const ElementDialog: FC<ContainerProps>;
3
+ export declare const ElementModal: FC<ContainerProps>;
@@ -0,0 +1 @@
1
+ export declare const ModalIcon: import('styled-components').StyledComponent<"span", any, import('@evergis/uilib-gl').IIconProps, never>;
@@ -15,5 +15,5 @@ export declare const elementComponents: {
15
15
  }>;
16
16
  readonly markdown: import('react').FC<import('..').ContainerProps>;
17
17
  readonly uploader: import('react').FC<import('..').ContainerProps>;
18
- readonly dialog: import('react').FC<import('..').ContainerProps>;
18
+ readonly modal: import('react').FC<import('..').ContainerProps>;
19
19
  };
@@ -149,7 +149,7 @@ export interface ConfigOptions {
149
149
  baseMapName?: string;
150
150
  baseMapSettings?: Record<string, BaseMapSettings>;
151
151
  expandedLayers?: boolean;
152
- dialogId?: string;
152
+ modalId?: string;
153
153
  }
154
154
  export interface ConfigDataSource {
155
155
  name: string;
@@ -226,20 +226,20 @@ export interface ConfigTask {
226
226
  updateDate?: string;
227
227
  id?: string;
228
228
  }
229
- export interface ConfigDialogOptions {
229
+ export interface ConfigModalOptions {
230
230
  title?: string;
231
231
  maxWidth?: string;
232
232
  minWidth?: string;
233
233
  minHeight?: string;
234
234
  }
235
- export interface ConfigDialogContentRef {
235
+ export interface ConfigModalContentRef {
236
236
  containerId: string;
237
237
  }
238
- export type ConfigDialogContentItem = ConfigContainerChild | ConfigDialogContentRef;
239
- export interface ConfigDialog {
238
+ export type ConfigModalContentItem = ConfigContainerChild | ConfigModalContentRef;
239
+ export interface ConfigModal {
240
240
  id: string;
241
- options?: ConfigDialogOptions;
242
- content: ConfigDialogContentItem[];
241
+ options?: ConfigModalOptions;
242
+ children: ConfigModalContentItem[];
243
243
  }
244
244
  export interface ConfigContainerHeader {
245
245
  id?: string;
@@ -254,7 +254,7 @@ export interface ConfigContainer {
254
254
  dataSources?: ConfigDataSource[];
255
255
  filters?: ConfigFilter[];
256
256
  tasks?: ConfigTask[];
257
- dialogs?: ConfigDialog[];
257
+ modals?: ConfigModal[];
258
258
  options?: ConfigOptions;
259
259
  header?: ConfigContainerHeader;
260
260
  }
package/dist/index.js CHANGED
@@ -6174,7 +6174,7 @@ const OneColumnContainer = React.memo(({ type, elementConfig, renderElement }) =
6174
6174
  const { id, value, hideEmpty, style, hasUnits, render } = getRenderContainerItem(elementConfig, attribute);
6175
6175
  if (!value && hideEmpty)
6176
6176
  return null;
6177
- return (jsxRuntime.jsxs(Container, { id: id, isColumn: true, style: { ...BASE_CONTAINER_STYLE, ...style }, children: [jsxRuntime.jsxs(ContainerAlias, { hasBottomMargin: true, children: [render({ id: "alias" }), render({ id: "tooltip" }), render({ id: "dialog" })] }), jsxRuntime.jsxs(ContainerValue, { children: [value, hasUnits && (jsxRuntime.jsx(ContainerUnits, { children: render({ id: "units" }) }))] })] }));
6177
+ return (jsxRuntime.jsxs(Container, { id: id, isColumn: true, style: { ...BASE_CONTAINER_STYLE, ...style }, children: [jsxRuntime.jsxs(ContainerAlias, { hasBottomMargin: true, children: [render({ id: "alias" }), render({ id: "tooltip" }), render({ id: "modal" })] }), jsxRuntime.jsxs(ContainerValue, { children: [value, hasUnits && (jsxRuntime.jsx(ContainerUnits, { children: render({ id: "units" }) }))] })] }));
6178
6178
  }, [getRenderContainerItem, elementConfig]);
6179
6179
  return renderAttributes?.length ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: renderAttributes.map(renderContainer) })) : (renderContainer());
6180
6180
  });
@@ -6187,7 +6187,7 @@ const TwoColumnContainer = React.memo(({ elementConfig, type, renderElement }) =
6187
6187
  const { id, value, hideEmpty, style, hasIcon, hasUnits, render } = getRenderContainerItem(elementConfig, attribute);
6188
6188
  if (!value && hideEmpty)
6189
6189
  return null;
6190
- return (jsxRuntime.jsxs(TwoColumnContainerWrapper, { id: id, style: style, children: [jsxRuntime.jsxs(ContainerAlias, { children: [hasIcon && (jsxRuntime.jsx(ContainerAliasIcon, { children: render({ id: "icon" }) })), render({ id: "alias" }), render({ id: "tooltip" }), render({ id: "dialog" })] }), jsxRuntime.jsxs(ContainerValue, { big: true, children: [value, hasUnits && (jsxRuntime.jsx(ContainerUnits, { children: render({ id: "units" }) }))] })] }, attribute));
6190
+ return (jsxRuntime.jsxs(TwoColumnContainerWrapper, { id: id, style: style, children: [jsxRuntime.jsxs(ContainerAlias, { children: [hasIcon && (jsxRuntime.jsx(ContainerAliasIcon, { children: render({ id: "icon" }) })), render({ id: "alias" }), render({ id: "tooltip" }), render({ id: "modal" })] }), jsxRuntime.jsxs(ContainerValue, { big: true, children: [value, hasUnits && (jsxRuntime.jsx(ContainerUnits, { children: render({ id: "units" }) }))] })] }, attribute));
6191
6191
  }, [getRenderContainerItem, elementConfig]);
6192
6192
  return renderAttributes?.length ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: renderAttributes.map(attribute => renderContainer(attribute)) })) : (renderContainer());
6193
6193
  });
@@ -9134,7 +9134,7 @@ const ElementUploader = React.memo(({ elementConfig, type }) => {
9134
9134
  return (jsxRuntime.jsx(UploaderContainer, { id: id, style: style, children: jsxRuntime.jsx("div", { children: jsxRuntime.jsx(uilibGl.Uploader, { currentRef: refInput, title: renderTitle, accept: fileExtensions, width: "100%", fileItems: files, isMultiple: multiSelect, onUpload: onUpload, onDelete: onDelete }) }) }));
9135
9135
  });
9136
9136
 
9137
- const DialogIcon = styled(uilibGl.Icon) `
9137
+ const ModalIcon = styled(uilibGl.Icon) `
9138
9138
  &&& {
9139
9139
  cursor: pointer;
9140
9140
 
@@ -9234,15 +9234,15 @@ const getRenderElement = ({ t, config, elementConfig, attributes = [], layerInfo
9234
9234
  });
9235
9235
  };
9236
9236
 
9237
- const ElementDialog = React.memo(({ type = exports.WidgetType.Dashboard, elementConfig }) => {
9237
+ const ElementModal = React.memo(({ type = exports.WidgetType.Dashboard, elementConfig }) => {
9238
9238
  const { config } = useWidgetConfig(type);
9239
9239
  const { expandedContainers, attributes, isLoading } = useWidgetContext(type);
9240
9240
  const [isOpen, setIsOpen] = React.useState(false);
9241
9241
  const { options } = elementConfig || {};
9242
- const { dialogId, icon } = options || {};
9243
- const dialogConfig = React.useMemo(() => (config?.dialogs ?? []).find(({ id }) => id === dialogId) ?? null, [config?.dialogs, dialogId]);
9244
- const dialogContent = React.useMemo(() => (dialogConfig?.content ?? []), [dialogConfig]);
9245
- const renderElementConfig = React.useMemo(() => ({ children: dialogContent }), [dialogContent]);
9242
+ const { modalId, icon } = options || {};
9243
+ const modalConfig = React.useMemo(() => (config?.modals ?? []).find(({ id }) => id === modalId) ?? null, [config?.modals, modalId]);
9244
+ const modalContent = React.useMemo(() => (modalConfig?.children ?? []), [modalConfig]);
9245
+ const renderElementConfig = React.useMemo(() => ({ children: modalContent }), [modalContent]);
9246
9246
  const renderElement = React.useMemo(() => getRenderElement({
9247
9247
  type,
9248
9248
  config,
@@ -9252,11 +9252,11 @@ const ElementDialog = React.memo(({ type = exports.WidgetType.Dashboard, element
9252
9252
  }), [type, config, renderElementConfig, attributes, expandedContainers]);
9253
9253
  const handleOpen = React.useCallback(() => setIsOpen(true), []);
9254
9254
  const handleClose = React.useCallback(() => setIsOpen(false), []);
9255
- if (!dialogConfig)
9255
+ if (!modalConfig)
9256
9256
  return null;
9257
- const { options: dialogOptions } = dialogConfig;
9258
- const { title, maxWidth, minWidth, minHeight } = dialogOptions || {};
9259
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(DialogIcon, { 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: dialogContent, isMain: true, renderElement: renderElement }) })) })] })] }));
9257
+ const { options: modalOptions } = modalConfig;
9258
+ const { title, maxWidth, minWidth, minHeight } = modalOptions || {};
9259
+ 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 }) })) })] })] }));
9260
9260
  });
9261
9261
 
9262
9262
  const elementComponents = {
@@ -9274,7 +9274,7 @@ const elementComponents = {
9274
9274
  legend: ElementLegend,
9275
9275
  markdown: ElementMarkdown,
9276
9276
  uploader: ElementUploader,
9277
- dialog: ElementDialog,
9277
+ modal: ElementModal,
9278
9278
  };
9279
9279
 
9280
9280
  const getElementValue = ({ getDefaultContainer, ...props }) => {
package/dist/react.esm.js CHANGED
@@ -6172,7 +6172,7 @@ const OneColumnContainer = memo(({ type, elementConfig, renderElement }) => {
6172
6172
  const { id, value, hideEmpty, style, hasUnits, render } = getRenderContainerItem(elementConfig, attribute);
6173
6173
  if (!value && hideEmpty)
6174
6174
  return null;
6175
- return (jsxs(Container, { id: id, isColumn: true, style: { ...BASE_CONTAINER_STYLE, ...style }, children: [jsxs(ContainerAlias, { hasBottomMargin: true, children: [render({ id: "alias" }), render({ id: "tooltip" }), render({ id: "dialog" })] }), jsxs(ContainerValue, { children: [value, hasUnits && (jsx(ContainerUnits, { children: render({ id: "units" }) }))] })] }));
6175
+ return (jsxs(Container, { id: id, isColumn: true, style: { ...BASE_CONTAINER_STYLE, ...style }, children: [jsxs(ContainerAlias, { hasBottomMargin: true, children: [render({ id: "alias" }), render({ id: "tooltip" }), render({ id: "modal" })] }), jsxs(ContainerValue, { children: [value, hasUnits && (jsx(ContainerUnits, { children: render({ id: "units" }) }))] })] }));
6176
6176
  }, [getRenderContainerItem, elementConfig]);
6177
6177
  return renderAttributes?.length ? (jsx(Fragment$1, { children: renderAttributes.map(renderContainer) })) : (renderContainer());
6178
6178
  });
@@ -6185,7 +6185,7 @@ const TwoColumnContainer = memo(({ elementConfig, type, renderElement }) => {
6185
6185
  const { id, value, hideEmpty, style, hasIcon, hasUnits, render } = getRenderContainerItem(elementConfig, attribute);
6186
6186
  if (!value && hideEmpty)
6187
6187
  return null;
6188
- return (jsxs(TwoColumnContainerWrapper, { id: id, style: style, children: [jsxs(ContainerAlias, { children: [hasIcon && (jsx(ContainerAliasIcon, { children: render({ id: "icon" }) })), render({ id: "alias" }), render({ id: "tooltip" }), render({ id: "dialog" })] }), jsxs(ContainerValue, { big: true, children: [value, hasUnits && (jsx(ContainerUnits, { children: render({ id: "units" }) }))] })] }, attribute));
6188
+ return (jsxs(TwoColumnContainerWrapper, { id: id, style: style, children: [jsxs(ContainerAlias, { children: [hasIcon && (jsx(ContainerAliasIcon, { children: render({ id: "icon" }) })), render({ id: "alias" }), render({ id: "tooltip" }), render({ id: "modal" })] }), jsxs(ContainerValue, { big: true, children: [value, hasUnits && (jsx(ContainerUnits, { children: render({ id: "units" }) }))] })] }, attribute));
6189
6189
  }, [getRenderContainerItem, elementConfig]);
6190
6190
  return renderAttributes?.length ? (jsx(Fragment$1, { children: renderAttributes.map(attribute => renderContainer(attribute)) })) : (renderContainer());
6191
6191
  });
@@ -9132,7 +9132,7 @@ const ElementUploader = memo(({ elementConfig, type }) => {
9132
9132
  return (jsx(UploaderContainer, { id: id, style: style, children: jsx("div", { children: jsx(Uploader, { currentRef: refInput, title: renderTitle, accept: fileExtensions, width: "100%", fileItems: files, isMultiple: multiSelect, onUpload: onUpload, onDelete: onDelete }) }) }));
9133
9133
  });
9134
9134
 
9135
- const DialogIcon = styled(Icon) `
9135
+ const ModalIcon = styled(Icon) `
9136
9136
  &&& {
9137
9137
  cursor: pointer;
9138
9138
 
@@ -9232,15 +9232,15 @@ const getRenderElement = ({ t, config, elementConfig, attributes = [], layerInfo
9232
9232
  });
9233
9233
  };
9234
9234
 
9235
- const ElementDialog = memo(({ type = WidgetType.Dashboard, elementConfig }) => {
9235
+ const ElementModal = memo(({ type = WidgetType.Dashboard, elementConfig }) => {
9236
9236
  const { config } = useWidgetConfig(type);
9237
9237
  const { expandedContainers, attributes, isLoading } = useWidgetContext(type);
9238
9238
  const [isOpen, setIsOpen] = useState(false);
9239
9239
  const { options } = elementConfig || {};
9240
- const { dialogId, icon } = options || {};
9241
- const dialogConfig = useMemo(() => (config?.dialogs ?? []).find(({ id }) => id === dialogId) ?? null, [config?.dialogs, dialogId]);
9242
- const dialogContent = useMemo(() => (dialogConfig?.content ?? []), [dialogConfig]);
9243
- const renderElementConfig = useMemo(() => ({ children: dialogContent }), [dialogContent]);
9240
+ const { modalId, icon } = options || {};
9241
+ const modalConfig = useMemo(() => (config?.modals ?? []).find(({ id }) => id === modalId) ?? null, [config?.modals, modalId]);
9242
+ const modalContent = useMemo(() => (modalConfig?.children ?? []), [modalConfig]);
9243
+ const renderElementConfig = useMemo(() => ({ children: modalContent }), [modalContent]);
9244
9244
  const renderElement = useMemo(() => getRenderElement({
9245
9245
  type,
9246
9246
  config,
@@ -9250,11 +9250,11 @@ const ElementDialog = memo(({ type = WidgetType.Dashboard, elementConfig }) => {
9250
9250
  }), [type, config, renderElementConfig, attributes, expandedContainers]);
9251
9251
  const handleOpen = useCallback(() => setIsOpen(true), []);
9252
9252
  const handleClose = useCallback(() => setIsOpen(false), []);
9253
- if (!dialogConfig)
9253
+ if (!modalConfig)
9254
9254
  return null;
9255
- const { options: dialogOptions } = dialogConfig;
9256
- const { title, maxWidth, minWidth, minHeight } = dialogOptions || {};
9257
- return (jsxs(Fragment$1, { children: [jsx(DialogIcon, { kind: icon || "new_window", onClick: handleOpen }), jsxs(Dialog, { isOpen: isOpen, onCloseRequest: handleClose, modal: true, maxWidth: maxWidth, minWidth: minWidth, minHeight: minHeight, style: { paddingBottom: "2rem" }, children: [jsx(DialogTitle, { children: jsxs(Flex, { justifyContent: "space-between", alignItems: "center", children: [!!title && jsx("span", { children: title }), jsx(IconButton, { kind: "close", onClick: handleClose })] }) }), jsx(DialogContent, { children: isLoading ? (jsx(DashboardLoading, {})) : (jsx(Container, { isColumn: true, noBorders: true, children: jsx(ContainerChildren, { type: type, items: dialogContent, isMain: true, renderElement: renderElement }) })) })] })] }));
9255
+ const { options: modalOptions } = modalConfig;
9256
+ const { title, maxWidth, minWidth, minHeight } = modalOptions || {};
9257
+ return (jsxs(Fragment$1, { children: [jsx(ModalIcon, { kind: icon || "new_window", onClick: handleOpen }), jsxs(Dialog, { isOpen: isOpen, onCloseRequest: handleClose, modal: true, maxWidth: maxWidth, minWidth: minWidth, minHeight: minHeight, style: { paddingBottom: "2rem" }, children: [jsx(DialogTitle, { children: jsxs(Flex, { justifyContent: "space-between", alignItems: "center", children: [!!title && jsx("span", { children: title }), jsx(IconButton, { kind: "close", onClick: handleClose })] }) }), jsx(DialogContent, { children: isLoading ? (jsx(DashboardLoading, {})) : (jsx(Container, { isColumn: true, noBorders: true, children: jsx(ContainerChildren, { type: type, items: modalContent, isMain: true, renderElement: renderElement }) })) })] })] }));
9258
9258
  });
9259
9259
 
9260
9260
  const elementComponents = {
@@ -9272,7 +9272,7 @@ const elementComponents = {
9272
9272
  legend: ElementLegend,
9273
9273
  markdown: ElementMarkdown,
9274
9274
  uploader: ElementUploader,
9275
- dialog: ElementDialog,
9275
+ modal: ElementModal,
9276
9276
  };
9277
9277
 
9278
9278
  const getElementValue = ({ getDefaultContainer, ...props }) => {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.1.127",
2
+ "version": "3.1.128",
3
3
  "name": "@evergis/react",
4
4
  "author": "Everpoint",
5
5
  "license": "MIT",
@@ -87,5 +87,5 @@
87
87
  "uuid": "^13.0.0",
88
88
  "wkt": "^0.1.1"
89
89
  },
90
- "gitHead": "286461673f908c31e8db90696fe26c8bfde7a658"
90
+ "gitHead": "5e9de94447a1de89751bdb7974b63332c7022766"
91
91
  }
@@ -1 +0,0 @@
1
- export declare const DialogIcon: import('styled-components').StyledComponent<"span", any, import('@evergis/uilib-gl').IIconProps, never>;