@evergis/react 3.1.26 → 3.1.27

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 `
@@ -4521,6 +4524,14 @@ 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-left: 0;
4532
+ padding-right: 0;
4533
+ }
4534
+ `}
4524
4535
  `;
4525
4536
  const ContainerAlias = styled(uilibGl.Flex) `
4526
4537
  align-items: center;
@@ -5953,7 +5964,7 @@ const ChartContainer = React.memo(({ elementConfig, isVisible, type, renderEleme
5953
5964
  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" })) })] }))] }));
5954
5965
  });
5955
5966
 
5956
- const PagesContainer = React.memo(({ type = exports.WidgetType.Dashboard }) => {
5967
+ const PagesContainer = React.memo(({ type = exports.WidgetType.Dashboard, noBorders }) => {
5957
5968
  const { config } = useWidgetConfig(type);
5958
5969
  const { pageIndex, currentPage } = useWidgetPage(type);
5959
5970
  const { selectedTabId, setSelectedTabId, expandedContainers, attributes } = useWidgetContext(type);
@@ -5983,7 +5994,7 @@ const PagesContainer = React.memo(({ type = exports.WidgetType.Dashboard }) => {
5983
5994
  setSelectedTabId,
5984
5995
  type,
5985
5996
  ]);
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 }) })] }));
5997
+ 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
5998
  });
5988
5999
 
5989
6000
  const TwoColumnsInnerContainer = React.memo(({ renderElement }) => {
@@ -9438,10 +9449,10 @@ const ContainerChildren = React.memo(({ items, isColumn, isMain, renderElement }
9438
9449
  });
9439
9450
 
9440
9451
  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, {}) })] }) }) }) }));
9452
+ 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
9453
  });
9443
9454
 
9444
- const Dashboard = React.memo(({ type = exports.WidgetType.Dashboard, config }) => {
9455
+ const Dashboard = React.memo(({ type = exports.WidgetType.Dashboard, config, noBorders }) => {
9445
9456
  const { dataSources, isLoading } = useWidgetContext(type);
9446
9457
  const { currentPage } = useWidgetPage(type);
9447
9458
  const isDiffPage = useDiffPage(type);
@@ -9449,7 +9460,7 @@ const Dashboard = React.memo(({ type = exports.WidgetType.Dashboard, config }) =
9449
9460
  if (dataSourceLoading || isDiffPage) {
9450
9461
  return (jsxRuntime.jsx(DashboardLoading, {}));
9451
9462
  }
9452
- return (jsxRuntime.jsx(PagesContainer, { type: type }));
9463
+ return (jsxRuntime.jsx(PagesContainer, { type: type, config: config, noBorders: noBorders }));
9453
9464
  });
9454
9465
 
9455
9466
  const CardCheckbox = styled(uilibGl.Checkbox) `
@@ -9961,6 +9972,7 @@ exports.DashboardContent = DashboardContent;
9961
9972
  exports.DashboardContext = DashboardContext;
9962
9973
  exports.DashboardDefaultHeader = DashboardDefaultHeader;
9963
9974
  exports.DashboardHeader = DashboardHeader;
9975
+ exports.DashboardLoading = DashboardLoading;
9964
9976
  exports.DashboardPlaceholder = DashboardPlaceholder;
9965
9977
  exports.DashboardPlaceholderWrap = DashboardPlaceholderWrap;
9966
9978
  exports.DashboardProvider = DashboardProvider;