@evergis/react 3.1.36 → 3.1.38
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/hooks/index.d.ts +1 -1
- package/dist/components/Dashboard/hooks/{useFeatureFilters.d.ts → useWidgetFilters.d.ts} +1 -1
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +9 -8
- package/dist/react.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/react.esm.js
CHANGED
|
@@ -5543,7 +5543,7 @@ const DataSourceInnerContainer = memo(({ config, elementConfig, feature, maxValu
|
|
|
5543
5543
|
t,
|
|
5544
5544
|
valueElement?.attributeName
|
|
5545
5545
|
]);
|
|
5546
|
-
const { hasAnyFilter, isFiltered, onFilter } =
|
|
5546
|
+
const { hasAnyFilter, isFiltered, onFilter } = useWidgetFilters(type, filterName, data);
|
|
5547
5547
|
const render = useMemo(() => getRenderElement({
|
|
5548
5548
|
config,
|
|
5549
5549
|
elementConfig,
|
|
@@ -5958,6 +5958,7 @@ const ChartContainer = memo(({ elementConfig, isVisible, type, renderElement })
|
|
|
5958
5958
|
const { twoColumns, hideEmpty } = options || {};
|
|
5959
5959
|
const aliasElement = children.find(({ id }) => id === "alias");
|
|
5960
5960
|
const chartElement = children.find(({ id }) => id === "chart");
|
|
5961
|
+
const legendElement = children.find(({ id }) => id === "legend");
|
|
5961
5962
|
const { data, loading } = useChartData({
|
|
5962
5963
|
element: chartElement,
|
|
5963
5964
|
type,
|
|
@@ -5968,7 +5969,7 @@ const ChartContainer = memo(({ elementConfig, isVisible, type, renderElement })
|
|
|
5968
5969
|
const hasItems = !!data[0]?.items?.length;
|
|
5969
5970
|
if (!loading && !hasItems && hideEmpty)
|
|
5970
5971
|
return null;
|
|
5971
|
-
return (jsxs(FlexSpan, { flexDirection: "column", 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" })) })] }))] }));
|
|
5972
|
+
return (jsxs(FlexSpan, { flexDirection: "column", 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, { justifyContent: legendElement?.options?.center ? "center" : "flex-start", children: renderElement({ id: "legend" }) })] })) : (jsx(Fragment$1, { children: "\u2014" })) })] }))] }));
|
|
5972
5973
|
});
|
|
5973
5974
|
|
|
5974
5975
|
const PagesContainer = memo(({ type = WidgetType.Dashboard, noBorders }) => {
|
|
@@ -8186,7 +8187,7 @@ const useBarChartFilter = ({ type, filter, elementConfig }) => {
|
|
|
8186
8187
|
const width = useMemo(() => configWidth || amount * barFullWidth, [amount, barFullWidth, configWidth]);
|
|
8187
8188
|
const data = useMemo(() => getDataFromFilterItems(filterItems), [filterItems]);
|
|
8188
8189
|
const loading = isLoading && !amount;
|
|
8189
|
-
const { formatFilterColor, onFilter } =
|
|
8190
|
+
const { formatFilterColor, onFilter } = useWidgetFilters(type, filterName, filterItems);
|
|
8190
8191
|
const colors = useMemo(() => getColorsFromFilterItems(filterItems, defaultColor, formatFilterColor), [defaultColor, filterItems, formatFilterColor]);
|
|
8191
8192
|
const selectedRange = useMemo(() => getIndexRange(selectedPixels, amount, barFullWidth), [amount, barFullWidth, selectedPixels]);
|
|
8192
8193
|
const customXAxis = useCallback(xAxis => {
|
|
@@ -9094,7 +9095,7 @@ const getMinMaxFromStringValue = (items, value, current, type) => {
|
|
|
9094
9095
|
? current.max
|
|
9095
9096
|
: value.max;
|
|
9096
9097
|
};
|
|
9097
|
-
const
|
|
9098
|
+
const useWidgetFilters = (type, filterName, items) => {
|
|
9098
9099
|
const theme = useTheme();
|
|
9099
9100
|
const { filters, changeFilters } = useWidgetContext(type);
|
|
9100
9101
|
const { currentPage } = useWidgetPage(type);
|
|
@@ -9261,7 +9262,7 @@ const useUpdateDataSource = ({ dataSource, config, filters, attributes, layerPar
|
|
|
9261
9262
|
const StackBar = ({ data, filterName, type, alias, options, renderElement, renderTooltip }) => {
|
|
9262
9263
|
const { height, showTotal, cornerRadius, groupTooltip } = options || {};
|
|
9263
9264
|
const { t } = useGlobalContext();
|
|
9264
|
-
const { hasAnyFilter, isFiltered, onFilter } =
|
|
9265
|
+
const { hasAnyFilter, isFiltered, onFilter } = useWidgetFilters(type, filterName, data?.[0]?.items);
|
|
9265
9266
|
const { items, layerInfo, attributeName } = data?.[0] || {};
|
|
9266
9267
|
const attribute = layerInfo?.layerDefinition.attributes[attributeName];
|
|
9267
9268
|
const units = attribute?.stringFormat?.unitsLabel;
|
|
@@ -9317,7 +9318,7 @@ const Chart = memo(({ config, element, elementConfig, type, renderElement }) =>
|
|
|
9317
9318
|
markers: configMarkers,
|
|
9318
9319
|
showMarkers,
|
|
9319
9320
|
});
|
|
9320
|
-
const { formatFilterColor, onFilter } =
|
|
9321
|
+
const { formatFilterColor, onFilter } = useWidgetFilters(type, filterName, data?.[0]?.items);
|
|
9321
9322
|
const formattedAttributes = useMemo(() => getFormattedAttributes(t, (data[0]?.items || []), attributes, element), [attributes, data, element, t]);
|
|
9322
9323
|
const totalSum = useMemo(() => isRelated
|
|
9323
9324
|
? getTotalFromRelatedFeatures((data[0]?.items || []))
|
|
@@ -9458,7 +9459,7 @@ const ChartLegend = ({ data, chartElement, type, twoColumns, loading }) => {
|
|
|
9458
9459
|
const { t } = useGlobalContext();
|
|
9459
9460
|
const { sliceItems, showMore, onShowMore } = useShownOtherItems(chartElement?.options);
|
|
9460
9461
|
const axes = useMemo(() => getChartAxes(chartElement), [chartElement]);
|
|
9461
|
-
const { isFiltered, hasAnyFilter, onFilter } =
|
|
9462
|
+
const { isFiltered, hasAnyFilter, onFilter } = useWidgetFilters(type, axes?.[0]?.filterName);
|
|
9462
9463
|
const { fontColor, shownItems, hideEmpty } = chartElement?.options || {};
|
|
9463
9464
|
const showMoreBtn = !!shownItems && data.length > shownItems;
|
|
9464
9465
|
if (!loading && !data?.length && !!hideEmpty)
|
|
@@ -9964,5 +9965,5 @@ const Map$1 = ({ zIndex, lowerSiblings, upperSiblings, onError, children, ...res
|
|
|
9964
9965
|
}, children: children }), upperSiblings] }));
|
|
9965
9966
|
};
|
|
9966
9967
|
|
|
9967
|
-
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, 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,
|
|
9968
|
+
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, 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, useGetConfigLayer, useGlobalContext, useHeaderRender, useLayerParams, useMapContext, useMapDraw, useProjectDashboardInit, useRedrawLayer, useRelatedDataSourceAttributes, useRenderElement, useServerNotificationsContext, useShownOtherItems, useToggle, useUpdateDataSource, useWidgetConfig, useWidgetContext, useWidgetFilters, useWidgetPage, useWindowResize, useZoomToFeatures, useZoomToPoint };
|
|
9968
9969
|
//# sourceMappingURL=react.esm.js.map
|