@evergis/react 3.1.25 → 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.
package/dist/react.esm.js CHANGED
@@ -3801,8 +3801,10 @@ const DashboardProvider = memo(({ children, ...props }) => {
3801
3801
  return jsx(DashboardContext.Provider, { value: props, children: children });
3802
3802
  });
3803
3803
 
3804
- const FeatureCardContext = createContext(null);
3805
- const FeatureCardProvider = memo(({ settings, children }) => jsx(FeatureCardContext.Provider, { value: settings, children: children }));
3804
+ const FeatureCardContext = createContext({});
3805
+ const FeatureCardProvider = memo(({ children, ...props }) => {
3806
+ return jsx(FeatureCardContext.Provider, { value: props, children: children });
3807
+ });
3806
3808
 
3807
3809
  const GlobalContext = createContext({});
3808
3810
  const GlobalProvider = memo(({ children, ...props }) => {
@@ -3909,10 +3911,9 @@ const ServerNotificationsProvider = ({ url, initialized, children }) => {
3909
3911
  };
3910
3912
 
3911
3913
  const useWidgetContext = (type = WidgetType.Dashboard) => {
3912
- 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, } = useContext(DashboardContext) || {};
3913
- 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, } = useContext(FeatureCardContext) || {};
3914
+ 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, } = useContext(DashboardContext) || {};
3915
+ 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, } = useContext(FeatureCardContext) || {};
3914
3916
  return {
3915
- config,
3916
3917
  projectInfo,
3917
3918
  layerInfos,
3918
3919
  updateProject,
@@ -3924,6 +3925,7 @@ const useWidgetContext = (type = WidgetType.Dashboard) => {
3924
3925
  feature,
3925
3926
  closeFeatureCard,
3926
3927
  components: dashboardComponents,
3928
+ config: type === WidgetType.Dashboard ? dashboardConfig : featureConfig,
3927
3929
  isLoading: type === WidgetType.Dashboard ? projectLoading : featureLoading,
3928
3930
  pageIndex: type === WidgetType.Dashboard ? projectPageIndex || 1 : featurePageIndex || 1,
3929
3931
  filters: type === WidgetType.Dashboard ? projectFilters : featureFilters,
@@ -4475,6 +4477,7 @@ const ChartLegendItem = styled(Flex) `
4475
4477
  width: auto;
4476
4478
  margin-right: 0.375rem;
4477
4479
  margin-bottom: 0.25rem;
4480
+ line-height: 0.75rem;
4478
4481
  opacity: ${({ isFiltered, hasAnyFilter }) => (isFiltered ? 1 : hasAnyFilter ? FILTERED_VALUE_OPACITY / 100 : 1)};
4479
4482
  `;
4480
4483
  const ChartLegendColor = styled.div `
@@ -4519,6 +4522,14 @@ const Container = styled(Flex) `
4519
4522
  margin-bottom: 0.75rem;
4520
4523
  }
4521
4524
  `}
4525
+
4526
+ ${({ noBorders }) => noBorders && css `
4527
+ ${ContainerWrapper} {
4528
+ box-shadow: none;
4529
+ padding-left: 0;
4530
+ padding-right: 0;
4531
+ }
4532
+ `}
4522
4533
  `;
4523
4534
  const ContainerAlias = styled(Flex) `
4524
4535
  align-items: center;
@@ -5951,7 +5962,7 @@ const ChartContainer = memo(({ elementConfig, isVisible, type, renderElement })
5951
5962
  return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsxs(Container, { isColumn: true, children: [aliasElement && jsx(ContainerAlias, { hasBottomMargin: true, children: renderElement({ id: "alias" }) }), jsx(ContainerValue, { column: !twoColumns, alignItems: "center", children: hasItems ? (jsxs(Fragment$1, { children: [jsx(ContainerChart, { children: renderElement({ id: "chart" }) }), jsx(ContainerLegend, { children: renderElement({ id: "legend" }) })] })) : (jsx(Fragment$1, { children: "\u2014" })) })] }))] }));
5952
5963
  });
5953
5964
 
5954
- const PagesContainer = memo(({ type = WidgetType.Dashboard }) => {
5965
+ const PagesContainer = memo(({ type = WidgetType.Dashboard, noBorders }) => {
5955
5966
  const { config } = useWidgetConfig(type);
5956
5967
  const { pageIndex, currentPage } = useWidgetPage(type);
5957
5968
  const { selectedTabId, setSelectedTabId, expandedContainers, attributes } = useWidgetContext(type);
@@ -5981,7 +5992,7 @@ const PagesContainer = memo(({ type = WidgetType.Dashboard }) => {
5981
5992
  setSelectedTabId,
5982
5993
  type,
5983
5994
  ]);
5984
- return (jsxs("div", { style: { width }, children: [jsx(ExpandableTitle, { elementConfig: config, type: type, renderElement: renderElement }), jsx(Container, { isColumn: isColumn, isMain: true, children: jsx(ContainerChildren, { items: filteredChildren, isMain: true, renderElement: renderElement }) })] }));
5995
+ return (jsxs("div", { style: { width }, children: [jsx(ExpandableTitle, { elementConfig: config, type: type, renderElement: renderElement }), jsx(Container, { isColumn: isColumn, isMain: true, noBorders: noBorders, children: jsx(ContainerChildren, { items: filteredChildren, isMain: true, renderElement: renderElement }) })] }));
5985
5996
  });
5986
5997
 
5987
5998
  const TwoColumnsInnerContainer = memo(({ renderElement }) => {
@@ -8734,7 +8745,28 @@ const useWidgetPage = (type = WidgetType.Dashboard) => {
8734
8745
  page.layers[index] = { ...page.layers[index], ...newProps };
8735
8746
  updateProject(newProjectInfo);
8736
8747
  }, [projectInfo, pageIndex, updateProject]);
8737
- return { pageIndex, currentPage, changePage, updateConfigPage, addConfigPage, deleteConfigPage, updateConfigLayer };
8748
+ const updateConfigLayers = useCallback((props) => {
8749
+ const newProjectInfo = JSON.parse(JSON.stringify(projectInfo));
8750
+ const pages = getPagesFromProjectInfo(newProjectInfo);
8751
+ const page = pages?.[pageIndex - 1];
8752
+ if (!page?.layers?.length)
8753
+ return;
8754
+ page.layers = page.layers.map(layer => ({
8755
+ ...layer,
8756
+ ...(props[layer.name] || {}),
8757
+ }));
8758
+ updateProject(newProjectInfo);
8759
+ }, [projectInfo, pageIndex, updateProject]);
8760
+ return {
8761
+ pageIndex,
8762
+ currentPage,
8763
+ changePage,
8764
+ updateConfigPage,
8765
+ addConfigPage,
8766
+ deleteConfigPage,
8767
+ updateConfigLayer,
8768
+ updateConfigLayers,
8769
+ };
8738
8770
  };
8739
8771
 
8740
8772
  const useChartData = ({ element, type }) => {
@@ -9415,10 +9447,10 @@ const ContainerChildren = memo(({ items, isColumn, isMain, renderElement }) => {
9415
9447
  });
9416
9448
 
9417
9449
  const DashboardLoading = memo(() => {
9418
- return (jsx(ContainerWrapper, { children: jsx(DashboardWrapper, { children: jsx(DashboardPlaceholderWrap, { children: jsxs(DashboardPlaceholder, { isLoading: true, children: [jsx(Icon, { kind: "dashboard_loading" }), jsx(Flex, { width: "8rem", children: jsx(LinearProgress, {}) })] }) }) }) }));
9450
+ return (jsx(Container, { noBorders: true, children: jsx(ContainerWrapper, { children: jsx(DashboardWrapper, { children: jsx(DashboardPlaceholderWrap, { children: jsxs(DashboardPlaceholder, { isLoading: true, children: [jsx(Icon, { kind: "dashboard_loading" }), jsx(Flex, { width: "8rem", children: jsx(LinearProgress, {}) })] }) }) }) }) }));
9419
9451
  });
9420
9452
 
9421
- const Dashboard = memo(({ type = WidgetType.Dashboard, config }) => {
9453
+ const Dashboard = memo(({ type = WidgetType.Dashboard, config, noBorders }) => {
9422
9454
  const { dataSources, isLoading } = useWidgetContext(type);
9423
9455
  const { currentPage } = useWidgetPage(type);
9424
9456
  const isDiffPage = useDiffPage(type);
@@ -9426,7 +9458,7 @@ const Dashboard = memo(({ type = WidgetType.Dashboard, config }) => {
9426
9458
  if (dataSourceLoading || isDiffPage) {
9427
9459
  return (jsx(DashboardLoading, {}));
9428
9460
  }
9429
- return (jsx(PagesContainer, { type: type }));
9461
+ return (jsx(PagesContainer, { type: type, config: config, noBorders: noBorders }));
9430
9462
  });
9431
9463
 
9432
9464
  const CardCheckbox = styled(Checkbox) `
@@ -9898,5 +9930,5 @@ const Map$1 = ({ zIndex, lowerSiblings, upperSiblings, onError, children, ...res
9898
9930
  }, children: children }), upperSiblings] }));
9899
9931
  };
9900
9932
 
9901
- export { AddFeatureButton, AddFeatureContainer, AttributeGalleryContainer, AttributeLabel, BaseMapTheme, CONFIG_PAGES_ID, CONFIG_PAGE_ID, CameraContainer, Chart, ChartContainer, ChartLegend, ChartLoading, ContainerChildren, ContainerLoading, ContainerTemplate, ContainerWrapper, ContainersGroupContainer, DEFAULT_ATTRIBUTE_NAME, DEFAULT_BARCHART_RADIUS, DEFAULT_BASE_MAP, DEFAULT_CHART_ANGLE, DEFAULT_CHART_HEIGHT, DEFAULT_CHART_WIDTH, DEFAULT_CIRCLE_PAINT, DEFAULT_DASHBOARD_CONFIG, DEFAULT_DATA_SOURCE_LIMIT, DEFAULT_FILL_EXTRUSION_PAINT, DEFAULT_FILL_PAINT, DEFAULT_ID_ATTRIBUTE_NAME, DEFAULT_LAT, DEFAULT_LINE_PAINT, DEFAULT_LNG, DEFAULT_PAGES_CONFIG, DEFAULT_PIECHART_RADIUS, DEFAULT_ZOOM, Dashboard, DashboardCheckbox, DashboardChip, DashboardContent, DashboardContext, DashboardDefaultHeader, DashboardHeader, DashboardPlaceholder, DashboardPlaceholderWrap, DashboardProvider, DashboardWrapper, DataSourceContainer, DataSourceError, DataSourceErrorContainer, DataSourceInnerContainer, DataSourceProgressContainer, DateFormat, DefaultAttributesContainer, DefaultHeaderContainer, DividerContainer, EditGeometryType, ElementButton, ElementCamera, ElementChart, ElementChips, ElementIcon, ElementImage, ElementLegend, ElementLink, ElementSlideshow, ElementSvg, ElementTooltip, ElementValueWrapper, ExpandableTitle, FEATURE_CARD_DEFAULT_COLORS, FEATURE_CARD_OTHER_COLOR, FILTERED_VALUE_OPACITY, FILTER_PREFIX, FeatureCardButtons, FeatureCardContext, FeatureCardDefaultHeader, FeatureCardGradientHeader, FeatureCardHeader, FeatureCardIconHeader, FeatureCardProvider, FeatureCardSlideshowHeader, FeatureCardTitle, FeatureControls, FeatureTitleContainer, FiltersContainer, GEOMETRY_ATTRIBUTE, GlobalContext, GlobalProvider, Header, HeaderContainer, HeaderFrontView, HeaderTemplate, HeaderTitleContainer, HiddenTitleItems, IconContainer, ImageContainer, LEFT_PANEL_HEADER_HEIGHT, Layer, LayerDescription, LayerGroup, LayerGroupList, LayerIcon, LayerListContainer, LayerTree, LayersContainer, LayersListWrapper, LinearProgressContainer, LogoContainer, MAX_CHART_WIDTH, Map$1 as Map, MapContext, MapProvider, NO_CONTENT_VALUE, NUMERIC_ATTRIBUTE_TYPES, NoLiveSnapshotContainer, OneColumnContainer, PageNavigator, PageTitle, PagesContainer, Pagination, PresentationHeader, PresentationHeaderButtons, PresentationHeaderTools, PresentationPanelContainer, PresentationPanelWrapper, PresentationWrapper, ProgressContainer, RoundedBackgroundContainer, ScalingFactor, ServerNotificationsContext, ServerNotificationsProvider, SlideshowContainer, SmallPreviewContainer$1 as SmallPreviewContainer, SmallPreviewControl, SmallPreviewCounter, SmallPreviewImages, SmallPreviewLeft, SmallPreviewRight, StackBar, SvgImage, TIME_ZONE_FORMAT, TabsContainer, TextTrim, ThemeName, TitleContainer, TmsType, TopContainer, TopContainerButtons, TwoColumnContainer, TwoColumnsInnerContainer, WidgetType, addDataSource, addDataSources, applyFiltersToCondition, applyQueryFilters, applyVarsToCondition, checkEqualOrIncludes, checkIsLoading, convertSpToTurfFeature, createConfigLayer, createConfigPage, createNewPageId, createTreeNode, dateOptions, debounce, decimalOpacityToHex, eqlParametersToPayload, findAttributeInExpression, formatArea, formatAttributeValue, formatChartRelatedValue, formatConditionValue, formatDataSourceCondition, formatDate$1 as formatDate, formatElementValue, formatLength, formatNumber, formatPolygonMeasure, getActualExtrusionHeight, getAttributeByName, getAttributeValue, getAttributesConfiguration, getChartFilterName, getChartMarkers, getConfigFilter, getContainerComponent, getDashboardHeader, getDataFromAttributes, getDataFromRelatedFeatures, getDataSource, getDataSourceFilterValue, getDate, getDefaultConfig, getElementValue, getFeatureAttributes, getFeatureCardHeader, getFilterComponent, getFilterSelectedItems, getFilterValue, getFormattedAttributes, getGradientColors, getLayerDefinition, getLayerInfo, getLayerInfoFromDataSources, getPagesFromConfig, getPagesFromProjectInfo, getProxyService, getRelatedAttribute, getRenderElement, getResourceUrl, getSelectedFilterValue, getSlideshowImages, getSvgUrl, getTotalFromAttributes, getTotalFromRelatedFeatures, hexToRgba, isCompositeLayerConfiguration, isEmptyElementValue, isEmptyValue, isHiddenEmptyValue, isLayerService, isNotValidSelectedTab, isNumeric, isObject, isProxyService, isVisibleContainer, numberOptions, parseClientStyle, pieChartTooltipFromAttributes, pieChartTooltipFromRelatedFeatures, pointOptions, removeDataSource, rgbToHex, roundTotalSum, sliceShownOtherItems, timeOptions, tooltipNameFromAttributes, tooltipValueFromAttributes, tooltipValueFromRelatedFeatures, transparentizeColor, treeNodesToProjectItems, useAppHeight, useChartChange, useChartData, useDashboardHeader, useDataSources, useDebouncedCallback, useDiffPage, useExpandableContainers, useFeatureFilters, useGetConfigLayer, useGlobalContext, useHeaderRender, useLayerParams, useMapContext, useMapDraw, useProjectDashboardInit, useRedrawLayer, useRelatedDataSourceAttributes, useRenderElement, useServerNotificationsContext, useShownOtherItems, useToggle, useUpdateDataSource, useWidgetConfig, useWidgetContext, useWidgetPage, useWindowResize, useZoomToFeatures, useZoomToPoint };
9933
+ export { AddFeatureButton, AddFeatureContainer, AttributeGalleryContainer, AttributeLabel, BaseMapTheme, CONFIG_PAGES_ID, CONFIG_PAGE_ID, CameraContainer, Chart, ChartContainer, ChartLegend, ChartLoading, ContainerChildren, ContainerLoading, ContainerTemplate, ContainerWrapper, ContainersGroupContainer, DEFAULT_ATTRIBUTE_NAME, DEFAULT_BARCHART_RADIUS, DEFAULT_BASE_MAP, DEFAULT_CHART_ANGLE, DEFAULT_CHART_HEIGHT, DEFAULT_CHART_WIDTH, DEFAULT_CIRCLE_PAINT, DEFAULT_DASHBOARD_CONFIG, DEFAULT_DATA_SOURCE_LIMIT, DEFAULT_FILL_EXTRUSION_PAINT, DEFAULT_FILL_PAINT, DEFAULT_ID_ATTRIBUTE_NAME, DEFAULT_LAT, DEFAULT_LINE_PAINT, DEFAULT_LNG, DEFAULT_PAGES_CONFIG, DEFAULT_PIECHART_RADIUS, DEFAULT_ZOOM, Dashboard, DashboardCheckbox, DashboardChip, DashboardContent, DashboardContext, DashboardDefaultHeader, DashboardHeader, DashboardLoading, DashboardPlaceholder, DashboardPlaceholderWrap, DashboardProvider, DashboardWrapper, DataSourceContainer, DataSourceError, DataSourceErrorContainer, DataSourceInnerContainer, DataSourceProgressContainer, DateFormat, DefaultAttributesContainer, DefaultHeaderContainer, DividerContainer, EditGeometryType, ElementButton, ElementCamera, ElementChart, ElementChips, ElementIcon, ElementImage, ElementLegend, ElementLink, ElementSlideshow, ElementSvg, ElementTooltip, ElementValueWrapper, ExpandableTitle, FEATURE_CARD_DEFAULT_COLORS, FEATURE_CARD_OTHER_COLOR, FILTERED_VALUE_OPACITY, FILTER_PREFIX, FeatureCardButtons, FeatureCardContext, FeatureCardDefaultHeader, FeatureCardGradientHeader, FeatureCardHeader, FeatureCardIconHeader, FeatureCardProvider, FeatureCardSlideshowHeader, FeatureCardTitle, FeatureControls, FeatureTitleContainer, FiltersContainer, GEOMETRY_ATTRIBUTE, GlobalContext, GlobalProvider, Header, HeaderContainer, HeaderFrontView, HeaderTemplate, HeaderTitleContainer, HiddenTitleItems, IconContainer, ImageContainer, LEFT_PANEL_HEADER_HEIGHT, Layer, LayerDescription, LayerGroup, LayerGroupList, LayerIcon, LayerListContainer, LayerTree, LayersContainer, LayersListWrapper, LinearProgressContainer, LogoContainer, MAX_CHART_WIDTH, Map$1 as Map, MapContext, MapProvider, NO_CONTENT_VALUE, NUMERIC_ATTRIBUTE_TYPES, NoLiveSnapshotContainer, OneColumnContainer, PageNavigator, PageTitle, PagesContainer, Pagination, PresentationHeader, PresentationHeaderButtons, PresentationHeaderTools, PresentationPanelContainer, PresentationPanelWrapper, PresentationWrapper, ProgressContainer, RoundedBackgroundContainer, ScalingFactor, ServerNotificationsContext, ServerNotificationsProvider, SlideshowContainer, SmallPreviewContainer$1 as SmallPreviewContainer, SmallPreviewControl, SmallPreviewCounter, SmallPreviewImages, SmallPreviewLeft, SmallPreviewRight, StackBar, SvgImage, TIME_ZONE_FORMAT, TabsContainer, TextTrim, ThemeName, TitleContainer, TmsType, TopContainer, TopContainerButtons, TwoColumnContainer, TwoColumnsInnerContainer, WidgetType, addDataSource, addDataSources, applyFiltersToCondition, applyQueryFilters, applyVarsToCondition, checkEqualOrIncludes, checkIsLoading, convertSpToTurfFeature, createConfigLayer, createConfigPage, createNewPageId, createTreeNode, dateOptions, debounce, decimalOpacityToHex, eqlParametersToPayload, findAttributeInExpression, formatArea, formatAttributeValue, formatChartRelatedValue, formatConditionValue, formatDataSourceCondition, formatDate$1 as formatDate, formatElementValue, formatLength, formatNumber, formatPolygonMeasure, getActualExtrusionHeight, getAttributeByName, getAttributeValue, getAttributesConfiguration, getChartFilterName, getChartMarkers, getConfigFilter, getContainerComponent, getDashboardHeader, getDataFromAttributes, getDataFromRelatedFeatures, getDataSource, getDataSourceFilterValue, getDate, getDefaultConfig, getElementValue, getFeatureAttributes, getFeatureCardHeader, getFilterComponent, getFilterSelectedItems, getFilterValue, getFormattedAttributes, getGradientColors, getLayerDefinition, getLayerInfo, getLayerInfoFromDataSources, getPagesFromConfig, getPagesFromProjectInfo, getProxyService, getRelatedAttribute, getRenderElement, getResourceUrl, getSelectedFilterValue, getSlideshowImages, getSvgUrl, getTotalFromAttributes, getTotalFromRelatedFeatures, hexToRgba, isCompositeLayerConfiguration, isEmptyElementValue, isEmptyValue, isHiddenEmptyValue, isLayerService, isNotValidSelectedTab, isNumeric, isObject, isProxyService, isVisibleContainer, numberOptions, parseClientStyle, pieChartTooltipFromAttributes, pieChartTooltipFromRelatedFeatures, pointOptions, removeDataSource, rgbToHex, roundTotalSum, sliceShownOtherItems, timeOptions, tooltipNameFromAttributes, tooltipValueFromAttributes, tooltipValueFromRelatedFeatures, transparentizeColor, treeNodesToProjectItems, useAppHeight, useChartChange, useChartData, useDashboardHeader, useDataSources, useDebouncedCallback, useDiffPage, useExpandableContainers, useFeatureFilters, useGetConfigLayer, useGlobalContext, useHeaderRender, useLayerParams, useMapContext, useMapDraw, useProjectDashboardInit, useRedrawLayer, useRelatedDataSourceAttributes, useRenderElement, useServerNotificationsContext, useShownOtherItems, useToggle, useUpdateDataSource, useWidgetConfig, useWidgetContext, useWidgetPage, useWindowResize, useZoomToFeatures, useZoomToPoint };
9902
9934
  //# sourceMappingURL=react.esm.js.map