@evergis/react 3.1.26 → 3.1.28

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.
@@ -3,4 +3,5 @@ import { ConfigContainer, WidgetType } from '../../types';
3
3
  export declare const Dashboard: FC<{
4
4
  type?: WidgetType;
5
5
  config?: ConfigContainer;
6
+ noBorders?: boolean;
6
7
  }>;
@@ -3,6 +3,7 @@ export * from './Chart';
3
3
  export * from './ChartLegend';
4
4
  export * from './ContainerChildren';
5
5
  export * from './Dashboard';
6
+ export * from './Dashboard/components/DashboardLoading';
6
7
  export * from './DashboardCheckbox';
7
8
  export * from './DashboardHeader';
8
9
  export * from './DataSourceError';
@@ -1,7 +1,3 @@
1
- export declare const LayersContainerWrapper: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & {
2
- isTitle?: boolean;
3
- isColumn?: boolean;
4
- isMain?: boolean;
5
- } & {
1
+ export declare const LayersContainerWrapper: import('styled-components').StyledComponent<any, any, {
6
2
  isPresentationMode?: boolean;
7
- }, never>;
3
+ }, string | number | symbol>;
@@ -1,8 +1,4 @@
1
- export declare const Container: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & {
2
- isTitle?: boolean;
3
- isColumn?: boolean;
4
- isMain?: boolean;
5
- }, never>;
1
+ export declare const Container: any;
6
2
  export declare const ContainerAlias: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & {
7
3
  hasBottomMargin?: boolean;
8
4
  }, never>;
@@ -1,6 +1,5 @@
1
1
  import { WidgetType } from '../types';
2
2
  export declare const useWidgetContext: (type?: WidgetType) => {
3
- config: import('../types').ConfigContainer;
4
3
  projectInfo: import('@evergis/api').ExtendedProjectInfoDc;
5
4
  layerInfos: import('../../..').LayerInfo[];
6
5
  updateProject: (projectInfo: import('@evergis/api').ExtendedProjectInfoDc) => void;
@@ -19,6 +18,7 @@ export declare const useWidgetContext: (type?: WidgetType) => {
19
18
  ProjectPanelMenu?: import('react').FC;
20
19
  ProjectPagesMenu?: import('react').FC;
21
20
  };
21
+ config: import('../types').ConfigContainer;
22
22
  isLoading: boolean;
23
23
  pageIndex: number;
24
24
  filters: import('../types').SelectedFilters;
@@ -1,8 +1,5 @@
1
- import { CSSProperties } from 'react';
2
1
  export declare const ElementValueWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
3
- export declare const ContainerWrapper: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & {
4
- $zIndex?: CSSProperties["zIndex"];
5
- }, never>;
2
+ export declare const ContainerWrapper: any;
6
3
  export declare const DashboardChip: import('styled-components').StyledComponent<any, any, any, any>;
7
4
  export declare const DashboardPlaceholderWrap: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps, never>;
8
5
  export declare const DashboardPlaceholder: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & {
@@ -273,6 +273,7 @@ export interface ContainerProps {
273
273
  maxValue?: number;
274
274
  isRow?: boolean;
275
275
  isVisible?: boolean;
276
+ noBorders?: boolean;
276
277
  type?: WidgetType;
277
278
  index?: number;
278
279
  innerComponent?: FC<InnerContainerProps>;
@@ -1,6 +1,4 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import { FC } from 'react';
2
2
  import { FeatureCardContextSettings } from './types';
3
3
  export declare const FeatureCardContext: import('react').Context<FeatureCardContextSettings>;
4
- export declare const FeatureCardProvider: FC<PropsWithChildren<{
5
- settings: FeatureCardContextSettings;
6
- }>>;
4
+ export declare const FeatureCardProvider: FC<FeatureCardContextSettings>;
@@ -1,7 +1,9 @@
1
+ import { PropsWithChildren } from 'react';
1
2
  import { LayerReferenceConfigurationDc } from '@evergis/api';
2
3
  import { LayerInfo, SelectedFeature } from '../../types';
3
- import { ClientFeatureAttribute, SelectedFilters, WidgetDataSource } from '../../components';
4
- export type FeatureCardContextSettings = {
4
+ import { ClientFeatureAttribute, ConfigContainer, SelectedFilters, WidgetDataSource } from '../../components';
5
+ export type FeatureCardContextSettings = PropsWithChildren<{
6
+ config?: ConfigContainer;
5
7
  attributes?: ClientFeatureAttribute[];
6
8
  layerInfo?: LayerInfo;
7
9
  feature?: SelectedFeature;
@@ -25,4 +27,4 @@ export type FeatureCardContextSettings = {
25
27
  prevPage?: (totalPages: number) => void;
26
28
  changePage?: (pageIndex: number) => void;
27
29
  closeFeatureCard?: VoidFunction;
28
- };
30
+ }>;
package/dist/index.js CHANGED
@@ -3803,8 +3803,10 @@ const DashboardProvider = React.memo(({ children, ...props }) => {
3803
3803
  return jsxRuntime.jsx(DashboardContext.Provider, { value: props, children: children });
3804
3804
  });
3805
3805
 
3806
- const FeatureCardContext = React.createContext(null);
3807
- const FeatureCardProvider = React.memo(({ settings, children }) => jsxRuntime.jsx(FeatureCardContext.Provider, { value: settings, children: children }));
3806
+ const FeatureCardContext = React.createContext({});
3807
+ const FeatureCardProvider = React.memo(({ children, ...props }) => {
3808
+ return jsxRuntime.jsx(FeatureCardContext.Provider, { value: props, children: children });
3809
+ });
3808
3810
 
3809
3811
  const GlobalContext = React.createContext({});
3810
3812
  const GlobalProvider = React.memo(({ children, ...props }) => {
@@ -3911,10 +3913,9 @@ const ServerNotificationsProvider = ({ url, initialized, children }) => {
3911
3913
  };
3912
3914
 
3913
3915
  const useWidgetContext = (type = exports.WidgetType.Dashboard) => {
3914
- const { config, projectInfo, updateProject, layerInfos, geometryFilter, dashboardLayers, setDashboardLayer, components: dashboardComponents, pageIndex: projectPageIndex, selectedTabId: projectSelectedTabId, setSelectedTabId: setProjectSelectedTabId, dataSources: projectDataSources, loading: projectLoading, filters: projectFilters, changeFilters: projectChangeFilters, expandContainer: projectExpandContainer, expandedContainers: projectExpandedContainers, nextPage: projectNextPage, prevPage: projectPrevPage, changePage: projectChangePage, } = React.useContext(DashboardContext) || {};
3915
- const { layerInfo, attributes, feature, closeFeatureCard, pageIndex: featurePageIndex, selectedTabId: featureSelectedTabId, setSelectedTabId: setFeatureSelectedTabId, dataSources: featureDataSources, loading: featureLoading, filters: featureFilters, changeFilters: featureChangeFilters, expandContainer: featureExpandContainer, expandedContainers: featureExpandedContainers, nextPage: featureNextPage, prevPage: featurePrevPage, changePage: featureChangePage, } = React.useContext(FeatureCardContext) || {};
3916
+ const { projectInfo, updateProject, layerInfos, geometryFilter, dashboardLayers, setDashboardLayer, components: dashboardComponents, config: dashboardConfig, pageIndex: projectPageIndex, selectedTabId: projectSelectedTabId, setSelectedTabId: setProjectSelectedTabId, dataSources: projectDataSources, loading: projectLoading, filters: projectFilters, changeFilters: projectChangeFilters, expandContainer: projectExpandContainer, expandedContainers: projectExpandedContainers, nextPage: projectNextPage, prevPage: projectPrevPage, changePage: projectChangePage, } = React.useContext(DashboardContext) || {};
3917
+ const { layerInfo, attributes, feature, closeFeatureCard, config: featureConfig, pageIndex: featurePageIndex, selectedTabId: featureSelectedTabId, setSelectedTabId: setFeatureSelectedTabId, dataSources: featureDataSources, loading: featureLoading, filters: featureFilters, changeFilters: featureChangeFilters, expandContainer: featureExpandContainer, expandedContainers: featureExpandedContainers, nextPage: featureNextPage, prevPage: featurePrevPage, changePage: featureChangePage, } = React.useContext(FeatureCardContext) || {};
3916
3918
  return {
3917
- config,
3918
3919
  projectInfo,
3919
3920
  layerInfos,
3920
3921
  updateProject,
@@ -3926,6 +3927,7 @@ const useWidgetContext = (type = exports.WidgetType.Dashboard) => {
3926
3927
  feature,
3927
3928
  closeFeatureCard,
3928
3929
  components: dashboardComponents,
3930
+ config: type === exports.WidgetType.Dashboard ? dashboardConfig : featureConfig,
3929
3931
  isLoading: type === exports.WidgetType.Dashboard ? projectLoading : featureLoading,
3930
3932
  pageIndex: type === exports.WidgetType.Dashboard ? projectPageIndex || 1 : featurePageIndex || 1,
3931
3933
  filters: type === exports.WidgetType.Dashboard ? projectFilters : featureFilters,
@@ -4477,6 +4479,7 @@ const ChartLegendItem = styled(uilibGl.Flex) `
4477
4479
  width: auto;
4478
4480
  margin-right: 0.375rem;
4479
4481
  margin-bottom: 0.25rem;
4482
+ line-height: 0.75rem;
4480
4483
  opacity: ${({ isFiltered, hasAnyFilter }) => (isFiltered ? 1 : hasAnyFilter ? FILTERED_VALUE_OPACITY / 100 : 1)};
4481
4484
  `;
4482
4485
  const ChartLegendColor = styled.div `
@@ -4511,7 +4514,7 @@ const Container = styled(uilibGl.Flex) `
4511
4514
  ${({ isMain, isColumn }) => (isMain || isColumn) &&
4512
4515
  styled.css `
4513
4516
  > :not(:last-child) {
4514
- margin-bottom: 0.5rem;
4517
+ margin-bottom: 1.5rem;
4515
4518
  }
4516
4519
  `}
4517
4520
 
@@ -4521,6 +4524,13 @@ const Container = styled(uilibGl.Flex) `
4521
4524
  margin-bottom: 0.75rem;
4522
4525
  }
4523
4526
  `}
4527
+
4528
+ ${({ noBorders }) => noBorders && styled.css `
4529
+ ${ContainerWrapper} {
4530
+ box-shadow: none;
4531
+ padding: 0;
4532
+ }
4533
+ `}
4524
4534
  `;
4525
4535
  const ContainerAlias = styled(uilibGl.Flex) `
4526
4536
  align-items: center;
@@ -5950,10 +5960,10 @@ const ChartContainer = React.memo(({ elementConfig, isVisible, type, renderEleme
5950
5960
  const hasItems = !!data[0]?.items?.length;
5951
5961
  if (!loading && !hasItems && hideEmpty)
5952
5962
  return null;
5953
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsxRuntime.jsxs(Container, { isColumn: true, children: [aliasElement && jsxRuntime.jsx(ContainerAlias, { hasBottomMargin: true, children: renderElement({ id: "alias" }) }), jsxRuntime.jsx(ContainerValue, { column: !twoColumns, alignItems: "center", children: hasItems ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ContainerChart, { children: renderElement({ id: "chart" }) }), jsxRuntime.jsx(ContainerLegend, { children: renderElement({ id: "legend" }) })] })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: "\u2014" })) })] }))] }));
5963
+ return (jsxRuntime.jsxs(uilibGl.FlexSpan, { flexDirection: "column", children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsxRuntime.jsxs(Container, { isColumn: true, children: [aliasElement && jsxRuntime.jsx(ContainerAlias, { hasBottomMargin: true, children: renderElement({ id: "alias" }) }), jsxRuntime.jsx(ContainerValue, { column: !twoColumns, alignItems: "center", children: hasItems ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ContainerChart, { children: renderElement({ id: "chart" }) }), jsxRuntime.jsx(ContainerLegend, { children: renderElement({ id: "legend" }) })] })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: "\u2014" })) })] }))] }));
5954
5964
  });
5955
5965
 
5956
- const PagesContainer = React.memo(({ type = exports.WidgetType.Dashboard }) => {
5966
+ const PagesContainer = React.memo(({ type = exports.WidgetType.Dashboard, noBorders }) => {
5957
5967
  const { config } = useWidgetConfig(type);
5958
5968
  const { pageIndex, currentPage } = useWidgetPage(type);
5959
5969
  const { selectedTabId, setSelectedTabId, expandedContainers, attributes } = useWidgetContext(type);
@@ -5983,7 +5993,7 @@ const PagesContainer = React.memo(({ type = exports.WidgetType.Dashboard }) => {
5983
5993
  setSelectedTabId,
5984
5994
  type,
5985
5995
  ]);
5986
- return (jsxRuntime.jsxs("div", { style: { width }, children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: config, type: type, renderElement: renderElement }), jsxRuntime.jsx(Container, { isColumn: isColumn, isMain: true, children: jsxRuntime.jsx(ContainerChildren, { items: filteredChildren, isMain: true, renderElement: renderElement }) })] }));
5996
+ return (jsxRuntime.jsxs("div", { style: { width }, children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: config, type: type, renderElement: renderElement }), jsxRuntime.jsx(Container, { isColumn: isColumn, isMain: true, noBorders: noBorders, children: jsxRuntime.jsx(ContainerChildren, { items: filteredChildren, isMain: true, renderElement: renderElement }) })] }));
5987
5997
  });
5988
5998
 
5989
5999
  const TwoColumnsInnerContainer = React.memo(({ renderElement }) => {
@@ -6461,7 +6471,7 @@ const RoundedBackgroundContainerWrapper = styled(uilibGl.Flex) `
6461
6471
 
6462
6472
  ${ContainerValue} {
6463
6473
  flex-direction: ${({ $inlineUnits }) => ($inlineUnits ? "row" : "column")};
6464
- justify-content: ${({ $big }) => ($big ? "flex-start" : "flex-end")};
6474
+ justify-content: ${({ $big }) => ($big ? "flex-start" : "center")};
6465
6475
  align-items: ${({ $inlineUnits }) => ($inlineUnits ? "center" : "flex-start")};
6466
6476
  line-height: 1;
6467
6477
  }
@@ -6758,6 +6768,7 @@ const Header = styled(uilibGl.Flex) `
6758
6768
  top: 0;
6759
6769
  flex-shrink: 0;
6760
6770
  overflow: hidden;
6771
+ width: 100%;
6761
6772
  padding: 0.5rem;
6762
6773
 
6763
6774
  ${HeaderContainer} {
@@ -6845,8 +6856,6 @@ const HeaderFontColorMixin$1 = styled.css `
6845
6856
  }
6846
6857
  `;
6847
6858
  const HeaderWrapperMixin$1 = styled.css `
6848
- padding: 0.5rem 0.5rem 0;
6849
-
6850
6859
  ${Header} {
6851
6860
  min-height: 5.25rem;
6852
6861
  }
@@ -6911,8 +6920,6 @@ const HeaderFontColorMixin = styled.css `
6911
6920
  }
6912
6921
  `;
6913
6922
  const HeaderWrapperMixin = styled.css `
6914
- padding: 0.5rem 0.5rem 0;
6915
-
6916
6923
  ${Header} {
6917
6924
  min-height: 5.25rem;
6918
6925
  }
@@ -6970,7 +6977,7 @@ const BigIconHeaderMixin = styled.css `
6970
6977
  `;
6971
6978
  const IconHeaderWrapper = styled.div `
6972
6979
  ${Header} {
6973
- width: calc(100% + 3rem);
6980
+ width: calc(100% + 1.5rem);
6974
6981
  margin: -1.5rem -1.5rem 0 -1.5rem;
6975
6982
  padding: 1.5rem;
6976
6983
  border-top-left-radius: 0.5rem;
@@ -9438,10 +9445,10 @@ const ContainerChildren = React.memo(({ items, isColumn, isMain, renderElement }
9438
9445
  });
9439
9446
 
9440
9447
  const DashboardLoading = React.memo(() => {
9441
- return (jsxRuntime.jsx(ContainerWrapper, { children: jsxRuntime.jsx(DashboardWrapper, { children: jsxRuntime.jsx(DashboardPlaceholderWrap, { children: jsxRuntime.jsxs(DashboardPlaceholder, { isLoading: true, children: [jsxRuntime.jsx(uilibGl.Icon, { kind: "dashboard_loading" }), jsxRuntime.jsx(uilibGl.Flex, { width: "8rem", children: jsxRuntime.jsx(uilibGl.LinearProgress, {}) })] }) }) }) }));
9448
+ return (jsxRuntime.jsx(Container, { noBorders: true, children: jsxRuntime.jsx(ContainerWrapper, { children: jsxRuntime.jsx(DashboardWrapper, { children: jsxRuntime.jsx(DashboardPlaceholderWrap, { children: jsxRuntime.jsxs(DashboardPlaceholder, { isLoading: true, children: [jsxRuntime.jsx(uilibGl.Icon, { kind: "dashboard_loading" }), jsxRuntime.jsx(uilibGl.Flex, { width: "8rem", children: jsxRuntime.jsx(uilibGl.LinearProgress, {}) })] }) }) }) }) }));
9442
9449
  });
9443
9450
 
9444
- const Dashboard = React.memo(({ type = exports.WidgetType.Dashboard, config }) => {
9451
+ const Dashboard = React.memo(({ type = exports.WidgetType.Dashboard, config, noBorders }) => {
9445
9452
  const { dataSources, isLoading } = useWidgetContext(type);
9446
9453
  const { currentPage } = useWidgetPage(type);
9447
9454
  const isDiffPage = useDiffPage(type);
@@ -9449,7 +9456,7 @@ const Dashboard = React.memo(({ type = exports.WidgetType.Dashboard, config }) =
9449
9456
  if (dataSourceLoading || isDiffPage) {
9450
9457
  return (jsxRuntime.jsx(DashboardLoading, {}));
9451
9458
  }
9452
- return (jsxRuntime.jsx(PagesContainer, { type: type }));
9459
+ return (jsxRuntime.jsx(PagesContainer, { type: type, config: config, noBorders: noBorders }));
9453
9460
  });
9454
9461
 
9455
9462
  const CardCheckbox = styled(uilibGl.Checkbox) `
@@ -9961,6 +9968,7 @@ exports.DashboardContent = DashboardContent;
9961
9968
  exports.DashboardContext = DashboardContext;
9962
9969
  exports.DashboardDefaultHeader = DashboardDefaultHeader;
9963
9970
  exports.DashboardHeader = DashboardHeader;
9971
+ exports.DashboardLoading = DashboardLoading;
9964
9972
  exports.DashboardPlaceholder = DashboardPlaceholder;
9965
9973
  exports.DashboardPlaceholderWrap = DashboardPlaceholderWrap;
9966
9974
  exports.DashboardProvider = DashboardProvider;