@evergis/react 3.1.41 → 3.1.42
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/components/Dashboard/components/ChartLegend/index.d.ts +1 -0
- package/dist/components/Dashboard/components/ChartLegend/styled.d.ts +1 -0
- package/dist/components/Dashboard/styled.d.ts +1 -0
- package/dist/components/Dashboard/types.d.ts +1 -0
- package/dist/index.js +24 -8
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +24 -9
- package/dist/react.esm.js.map +1 -1
- package/package.json +3 -3
package/dist/react.esm.js
CHANGED
|
@@ -4498,7 +4498,7 @@ const ChartLegendColor = styled.div `
|
|
|
4498
4498
|
`;
|
|
4499
4499
|
const ChartLegendName = styled.div `
|
|
4500
4500
|
flex: 1;
|
|
4501
|
-
font-size: 0.625rem;
|
|
4501
|
+
font-size: ${({ $fontSize }) => $fontSize || "0.625rem"};
|
|
4502
4502
|
color: ${({ theme: { palette }, $fontColor }) => $fontColor || palette.textPrimary};
|
|
4503
4503
|
`;
|
|
4504
4504
|
|
|
@@ -5101,6 +5101,9 @@ const LayerListContainer = styled(Flex) `
|
|
|
5101
5101
|
const ElementValueWrapper = styled.div `
|
|
5102
5102
|
transition: background-color ${transition.toggle};
|
|
5103
5103
|
`;
|
|
5104
|
+
const InnerContainerWrapper$1 = styled.div `
|
|
5105
|
+
width: 100%;
|
|
5106
|
+
`;
|
|
5104
5107
|
const ContainerWrapper = styled(Flex) `
|
|
5105
5108
|
position: relative;
|
|
5106
5109
|
min-height: 1rem;
|
|
@@ -6195,6 +6198,17 @@ const ContainerIconTitle = styled(Flex) `
|
|
|
6195
6198
|
${LegendToggler} {
|
|
6196
6199
|
margin-left: 0.25rem;
|
|
6197
6200
|
}
|
|
6201
|
+
|
|
6202
|
+
span[kind="download"] {
|
|
6203
|
+
opacity: 0;
|
|
6204
|
+
transition: opacity ${transition.hover};
|
|
6205
|
+
}
|
|
6206
|
+
|
|
6207
|
+
:hover {
|
|
6208
|
+
span[kind="download"] {
|
|
6209
|
+
opacity: 1;
|
|
6210
|
+
}
|
|
6211
|
+
}
|
|
6198
6212
|
`;
|
|
6199
6213
|
const ContainerTitle = styled(Flex) `
|
|
6200
6214
|
align-items: center;
|
|
@@ -6230,8 +6244,9 @@ const TitleContainer = memo(({ containerId, templateName, layerNames, fontColor,
|
|
|
6230
6244
|
const [layersVisibility, toggleVisibility] = useToggle(true);
|
|
6231
6245
|
const { palette } = useTheme();
|
|
6232
6246
|
const { style, options } = elementConfig || {};
|
|
6233
|
-
const { simple } = options || {};
|
|
6247
|
+
const { simple, downloadById } = options || {};
|
|
6234
6248
|
const isLayers = templateName === ContainerTemplate.Layers;
|
|
6249
|
+
const { onExport } = useExportPdf(downloadById);
|
|
6235
6250
|
const onClick = useCallback(() => {
|
|
6236
6251
|
if (!expandable)
|
|
6237
6252
|
return;
|
|
@@ -6246,7 +6261,7 @@ const TitleContainer = memo(({ containerId, templateName, layerNames, fontColor,
|
|
|
6246
6261
|
const renderVisibility = useMemo(() => isLayers && (jsx(FlexSpan, { mr: "-1rem", children: jsx(IconToggle, { kind: layersVisibility ? "password_show" : "password_hide", className: "feature-visible", isSelected: layersVisibility, onClick: onToggleVisibility }) })), [isLayers, layersVisibility, onToggleVisibility]);
|
|
6247
6262
|
const renderToggler = useMemo(() => !!containerId &&
|
|
6248
6263
|
expandable && (jsx("div", { children: jsx(LegendToggler, { color: palette.icon, toggled: expandedContainers?.[containerId] !== undefined ? expandedContainers[containerId] : expanded, onClick: onClick }) })), [containerId, expandable, expanded, expandedContainers, onClick, palette.icon]);
|
|
6249
|
-
return (jsx(Container, { isTitle: isVisible, style: style, children: jsxs(ContainerTitle, { simple: simple, children: [jsxs(ContainerIconTitle, { fontColor: fontColor, children: [renderElement({ id: "titleIcon", wrap: false }), renderElement({ id: "title" }), isLayers && renderToggler] }), !isLayers && renderToggler, renderVisibility] }) }));
|
|
6264
|
+
return (jsx(Container, { isTitle: isVisible, style: style, children: jsxs(ContainerTitle, { simple: simple, children: [jsxs(ContainerIconTitle, { fontColor: fontColor, children: [renderElement({ id: "titleIcon", wrap: false }), renderElement({ id: "title" }), !!downloadById && (jsx(IconButton, { kind: "download", onClick: onExport })), isLayers && renderToggler] }), !isLayers && renderToggler, renderVisibility] }) }));
|
|
6250
6265
|
});
|
|
6251
6266
|
|
|
6252
6267
|
const ContainerDivider = styled(Divider) `
|
|
@@ -7435,7 +7450,7 @@ const ElementImage = memo(({ type, elementConfig }) => {
|
|
|
7435
7450
|
const ElementLegend = memo(({ type, element, elementConfig, expandedContainers }) => {
|
|
7436
7451
|
const { attributes, dataSources } = useWidgetContext(type);
|
|
7437
7452
|
const { options } = elementConfig || {};
|
|
7438
|
-
const { twoColumns, chartId, relatedDataSources } = options || {};
|
|
7453
|
+
const { twoColumns, chartId, relatedDataSources, fontSize } = options || {};
|
|
7439
7454
|
const chartElement = useMemo(() => returnFound(element?.children, { id: chartId }), [chartId, element?.children]);
|
|
7440
7455
|
const { data, loading } = useChartData({
|
|
7441
7456
|
element: chartElement,
|
|
@@ -7462,7 +7477,7 @@ const ElementLegend = memo(({ type, element, elementConfig, expandedContainers }
|
|
|
7462
7477
|
return { ...item, name: attribute?.alias || item.name };
|
|
7463
7478
|
});
|
|
7464
7479
|
}, [attributes, axes, data, options.chartType, relatedDataSources, dataSources]);
|
|
7465
|
-
return !chartElement?.options?.expanded || expandedContainers?.[chartElement.id] ? (jsx(ChartLegend, { data: legendData, loading: loading, chartElement: chartElement, twoColumns: twoColumns, type: type })) : null;
|
|
7480
|
+
return !chartElement?.options?.expanded || expandedContainers?.[chartElement.id] ? (jsx(ChartLegend, { data: legendData, loading: loading, chartElement: chartElement, twoColumns: twoColumns, fontSize: fontSize, type: type })) : null;
|
|
7466
7481
|
});
|
|
7467
7482
|
|
|
7468
7483
|
const ExternalLink = styled(IconButton).attrs(() => ({
|
|
@@ -9580,7 +9595,7 @@ const Chart = memo(({ config, element, elementConfig, type, renderElement }) =>
|
|
|
9580
9595
|
return (jsx(ChartWrapper, { width: width, height: isStackBar ? "auto" : isPieChart ? width : height, column: column, loading: loading, children: renderChart }));
|
|
9581
9596
|
});
|
|
9582
9597
|
|
|
9583
|
-
const ChartLegend = ({ data, chartElement, type, twoColumns, loading }) => {
|
|
9598
|
+
const ChartLegend = ({ data, chartElement, fontSize, type, twoColumns, loading }) => {
|
|
9584
9599
|
const { t } = useGlobalContext();
|
|
9585
9600
|
const { sliceItems, showMore, onShowMore } = useShownOtherItems(chartElement?.options);
|
|
9586
9601
|
const axes = useMemo(() => getChartAxes(chartElement), [chartElement]);
|
|
@@ -9589,7 +9604,7 @@ const ChartLegend = ({ data, chartElement, type, twoColumns, loading }) => {
|
|
|
9589
9604
|
const showMoreBtn = !!shownItems && data.length > shownItems;
|
|
9590
9605
|
if (!loading && !data?.length && !!hideEmpty)
|
|
9591
9606
|
return null;
|
|
9592
|
-
return (jsxs(Flex, { flexDirection: "column", opacity: loading ? FILTERED_VALUE_OPACITY / 100 : 1, children: [jsx(ChartLegendContainer, { twoColumns: twoColumns, children: sliceItems(data)?.map(({ name, color }, index) => (jsxs(ChartLegendItem, { hasAnyFilter: hasAnyFilter, isFiltered: isFiltered(name), onClick: axes?.[0]?.filterName ? () => onFilter(name) : undefined, children: [jsx(ChartLegendColor, { color: color }), jsx(ChartLegendName, { "$fontColor": fontColor, children: name })] }, index))) }), showMoreBtn && (jsx(LegendToggler, { onClick: onShowMore, toggled: showMore, children: t("other", { ns: "dashboard", defaultValue: "Другое" }) }))] }));
|
|
9607
|
+
return (jsxs(Flex, { flexDirection: "column", opacity: loading ? FILTERED_VALUE_OPACITY / 100 : 1, children: [jsx(ChartLegendContainer, { twoColumns: twoColumns, children: sliceItems(data)?.map(({ name, color }, index) => (jsxs(ChartLegendItem, { hasAnyFilter: hasAnyFilter, isFiltered: isFiltered(name), onClick: axes?.[0]?.filterName ? () => onFilter(name) : undefined, children: [jsx(ChartLegendColor, { color: color }), jsx(ChartLegendName, { "$fontSize": fontSize, "$fontColor": fontColor, children: name })] }, index))) }), showMoreBtn && (jsx(LegendToggler, { onClick: onShowMore, toggled: showMore, children: t("other", { ns: "dashboard", defaultValue: "Другое" }) }))] }));
|
|
9593
9608
|
};
|
|
9594
9609
|
|
|
9595
9610
|
const ContainerChildren = memo(({ items, isColumn, isMain, renderElement }) => {
|
|
@@ -9601,7 +9616,7 @@ const ContainerChildren = memo(({ items, isColumn, isMain, renderElement }) => {
|
|
|
9601
9616
|
index,
|
|
9602
9617
|
wrap: isColumn || isMain,
|
|
9603
9618
|
});
|
|
9604
|
-
return isMain ? (jsx(ContainerWrapper, {
|
|
9619
|
+
return isMain ? (jsx(ContainerWrapper, { id: item.id, "data-templatename": item.templateName, children: jsx(DashboardWrapper, { children: render }) }, index)) : (jsx(InnerContainerWrapper$1, { id: item.id, children: render }, index));
|
|
9605
9620
|
}) }));
|
|
9606
9621
|
});
|
|
9607
9622
|
|
|
@@ -10090,5 +10105,5 @@ const Map$1 = ({ zIndex, lowerSiblings, upperSiblings, onError, children, ...res
|
|
|
10090
10105
|
}, children: children }), upperSiblings] }));
|
|
10091
10106
|
};
|
|
10092
10107
|
|
|
10093
|
-
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, DefaultHeaderWrapper, 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, getChartAxes, 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, getRootElementId, 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, useExportPdf, useGetConfigLayer, useGlobalContext, useHeaderRender, useLayerParams, useMapContext, useMapDraw, useProjectDashboardInit, useRedrawLayer, useRelatedDataSourceAttributes, useRenderElement, useServerNotificationsContext, useShownOtherItems, useToggle, useUpdateDataSource, useWidgetConfig, useWidgetContext, useWidgetFilters, useWidgetPage, useWindowResize, useZoomToFeatures, useZoomToPoint };
|
|
10108
|
+
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, DefaultHeaderWrapper, 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, InnerContainerWrapper$1 as InnerContainerWrapper, 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, getChartAxes, 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, getRootElementId, 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, useExportPdf, useGetConfigLayer, useGlobalContext, useHeaderRender, useLayerParams, useMapContext, useMapDraw, useProjectDashboardInit, useRedrawLayer, useRelatedDataSourceAttributes, useRenderElement, useServerNotificationsContext, useShownOtherItems, useToggle, useUpdateDataSource, useWidgetConfig, useWidgetContext, useWidgetFilters, useWidgetPage, useWindowResize, useZoomToFeatures, useZoomToPoint };
|
|
10094
10109
|
//# sourceMappingURL=react.esm.js.map
|