@evergis/react 3.1.46 → 3.1.47
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/containers/index.d.ts +0 -1
- package/dist/components/Dashboard/containers/registry.d.ts +0 -1
- package/dist/components/Dashboard/styled.d.ts +0 -1
- package/dist/index.js +34 -46
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +35 -45
- package/dist/react.esm.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/Dashboard/containers/TwoColumnsInnerContainer/index.d.ts +0 -3
|
@@ -14,7 +14,6 @@ export declare const containerComponents: {
|
|
|
14
14
|
readonly RoundedBackground: import('react').FC<import('./DataSourceInnerContainer/types').InnerContainerProps>;
|
|
15
15
|
readonly OneColumn: import('react').FC<import('../types').ContainerProps>;
|
|
16
16
|
readonly TwoColumn: import('react').FC<import('../types').ContainerProps>;
|
|
17
|
-
readonly TwoColumnsInner: import('react').FC<import('../types').ContainerProps>;
|
|
18
17
|
readonly DataSource: import('react').FC<import('../types').ContainerProps>;
|
|
19
18
|
readonly DataSourceProgress: import('react').FC<import('../types').ContainerProps>;
|
|
20
19
|
readonly Progress: import('react').FC<import('./DataSourceInnerContainer/types').InnerContainerProps>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export declare const ElementValueWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
2
|
-
export declare const InnerContainerWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
3
2
|
export declare const ContainerWrapper: any;
|
|
4
3
|
export declare const DashboardChip: import('styled-components').StyledComponent<any, any, any, any>;
|
|
5
4
|
export declare const DashboardPlaceholderWrap: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps, never>;
|
package/dist/index.js
CHANGED
|
@@ -5132,9 +5132,6 @@ const LayerListContainer = styled(uilibGl.Flex) `
|
|
|
5132
5132
|
const ElementValueWrapper = styled.div `
|
|
5133
5133
|
transition: background-color ${uilibGl.transition.toggle};
|
|
5134
5134
|
`;
|
|
5135
|
-
const InnerContainerWrapper$1 = styled.div `
|
|
5136
|
-
width: 100%;
|
|
5137
|
-
`;
|
|
5138
5135
|
const ContainerWrapper = styled(uilibGl.Flex) `
|
|
5139
5136
|
position: relative;
|
|
5140
5137
|
min-height: 1rem;
|
|
@@ -5477,24 +5474,24 @@ const ContainersGroupContainer = React.memo(({ elementConfig, type, renderElemen
|
|
|
5477
5474
|
const { column, expandable, expanded } = options || {};
|
|
5478
5475
|
const isColumn = column === undefined || column;
|
|
5479
5476
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
5480
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsxRuntime.jsx(Container, { style: style, isColumn: isColumn, children: jsxRuntime.jsx(ContainerChildren, { items: children, elementConfig: elementConfig, isColumn: isColumn, isMain: id?.startsWith(CONFIG_PAGE_ID), renderElement: renderElement }) }))] }));
|
|
5477
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsxRuntime.jsx(Container, { id: id, style: style, isColumn: isColumn, children: jsxRuntime.jsx(ContainerChildren, { items: children, elementConfig: elementConfig, isColumn: isColumn, isMain: id?.startsWith(CONFIG_PAGE_ID), renderElement: renderElement }) }))] }));
|
|
5481
5478
|
});
|
|
5482
5479
|
|
|
5483
5480
|
const OneColumnContainer = React.memo(({ elementConfig, renderElement }) => {
|
|
5484
|
-
const { options, style } = elementConfig || {};
|
|
5481
|
+
const { id, options, style } = elementConfig || {};
|
|
5485
5482
|
const { innerTemplateStyle, hideEmpty } = options || {};
|
|
5486
5483
|
const value = renderElement({ id: "value" });
|
|
5487
5484
|
const hasUnits = elementConfig?.children?.some(({ id }) => id === "units");
|
|
5488
5485
|
if (!value && hideEmpty)
|
|
5489
5486
|
return null;
|
|
5490
|
-
return (jsxRuntime.jsxs(Container, { style: innerTemplateStyle || style, children: [jsxRuntime.jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsxRuntime.jsxs(ContainerValue, { children: [value, hasUnits && jsxRuntime.jsx(ContainerUnits, { children: renderElement({ id: "units" }) })] })] }));
|
|
5487
|
+
return (jsxRuntime.jsxs(Container, { id: id, style: innerTemplateStyle || style, children: [jsxRuntime.jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsxRuntime.jsxs(ContainerValue, { children: [value, hasUnits && jsxRuntime.jsx(ContainerUnits, { children: renderElement({ id: "units" }) })] })] }));
|
|
5491
5488
|
});
|
|
5492
5489
|
|
|
5493
5490
|
const TwoColumnContainer = React.memo(({ config, elementConfig, type, renderElement }) => {
|
|
5494
5491
|
const { selectedTabId, layerInfo, attributes } = useWidgetContext(type);
|
|
5495
5492
|
const { attributes: renderAttributes } = elementConfig?.options || {};
|
|
5496
5493
|
const renderContainer = React.useCallback((element, attribute) => {
|
|
5497
|
-
const { options, style, children } = element || {};
|
|
5494
|
+
const { id, options, style, children } = element || {};
|
|
5498
5495
|
const { hideEmpty, innerTemplateStyle } = options || {};
|
|
5499
5496
|
const hasUnits = children?.some(({ id }) => id === "units");
|
|
5500
5497
|
const iconIndex = children?.findIndex(({ id }) => id === "icon");
|
|
@@ -5532,7 +5529,7 @@ const TwoColumnContainer = React.memo(({ config, elementConfig, type, renderElem
|
|
|
5532
5529
|
const value = render({ id: "value" });
|
|
5533
5530
|
if (!value && hideEmpty)
|
|
5534
5531
|
return null;
|
|
5535
|
-
return (jsxRuntime.jsxs(TwoColumnContainerWrapper, { style: innerTemplateStyle || style, children: [jsxRuntime.jsxs(ContainerAlias, { children: [hasIcon && jsxRuntime.jsx(ContainerAliasIcon, { children: render({ id: "icon" }) }), render({ id: "alias" }), render({ id: "tooltip" })] }), jsxRuntime.jsxs(ContainerValue, { big: true, children: [value, hasUnits && jsxRuntime.jsx(ContainerUnits, { children: render({ id: "units" }) })] })] }, attribute));
|
|
5532
|
+
return (jsxRuntime.jsxs(TwoColumnContainerWrapper, { id: id, style: innerTemplateStyle || style, children: [jsxRuntime.jsxs(ContainerAlias, { children: [hasIcon && jsxRuntime.jsx(ContainerAliasIcon, { children: render({ id: "icon" }) }), render({ id: "alias" }), render({ id: "tooltip" })] }), jsxRuntime.jsxs(ContainerValue, { big: true, children: [value, hasUnits && jsxRuntime.jsx(ContainerUnits, { children: render({ id: "units" }) })] })] }, attribute));
|
|
5536
5533
|
}, [attributes, config, getRenderElement, layerInfo, renderElement, selectedTabId, type]);
|
|
5537
5534
|
return renderAttributes?.length ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: renderAttributes.map(attribute => renderContainer(elementConfig, attribute)) })) : (renderContainer(elementConfig));
|
|
5538
5535
|
});
|
|
@@ -5723,7 +5720,7 @@ const DataSourceProgressContainer = React.memo(({ config, elementConfig, type, i
|
|
|
5723
5720
|
dataSources
|
|
5724
5721
|
});
|
|
5725
5722
|
const { attributes } = layerInfo?.configuration?.attributesConfiguration || {};
|
|
5726
|
-
const { id, options, children } = elementConfig || {};
|
|
5723
|
+
const { id, options, children, style } = elementConfig || {};
|
|
5727
5724
|
const { maxValue, showTotal, relatedDataSource, expandable, expanded } = options || {};
|
|
5728
5725
|
const valueElement = children?.find(item => item.id === "value");
|
|
5729
5726
|
const unitsElement = children?.find(item => item.id === "units");
|
|
@@ -5751,7 +5748,7 @@ const DataSourceProgressContainer = React.memo(({ config, elementConfig, type, i
|
|
|
5751
5748
|
return jsxRuntime.jsx(DataSourceError, { name: elementConfig.templateName });
|
|
5752
5749
|
}
|
|
5753
5750
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
5754
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), !isVisible ? null : dataSource ? (jsxRuntime.jsxs(DataSourceProgressContainerWrapper, { children: [sliceItems(dataSource?.features)?.map((feature, index) => (jsxRuntime.jsx(DataSourceInnerContainer, { type: type, index: index, feature: feature, config: config, elementConfig: elementConfig, maxValue: currentMaxValue, innerComponent: innerComponent }, index))), checkIsSliced(dataSource?.features) && (jsxRuntime.jsx(ContainerToggler, { toggled: showMore, onClick: onShowMore, children: showMore ? t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) : t("showAll", { ns: "dashboard", defaultValue: "Показать все" }) })), showTotal && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(uilibGl.Divider, {}), jsxRuntime.jsxs(ProgressTotal, { children: [jsxRuntime.jsx(ProgressTotalTitle, { children: t("total", { ns: "dashboard", defaultValue: "Итого" }) }), jsxRuntime.jsxs(ProgressValue, { children: [totalValue, jsxRuntime.jsx(ProgressUnits, { children: totalUnits })] })] })] }))] })) : (jsxRuntime.jsx(ContainerLoading, {})), jsxRuntime.jsx(HiddenTitleItems, { elementConfig: elementConfig, config: config, type: type })] }));
|
|
5751
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), !isVisible ? null : dataSource ? (jsxRuntime.jsxs(DataSourceProgressContainerWrapper, { id: id, style: style, children: [sliceItems(dataSource?.features)?.map((feature, index) => (jsxRuntime.jsx(DataSourceInnerContainer, { type: type, index: index, feature: feature, config: config, elementConfig: elementConfig, maxValue: currentMaxValue, innerComponent: innerComponent }, index))), checkIsSliced(dataSource?.features) && (jsxRuntime.jsx(ContainerToggler, { toggled: showMore, onClick: onShowMore, children: showMore ? t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) : t("showAll", { ns: "dashboard", defaultValue: "Показать все" }) })), showTotal && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(uilibGl.Divider, {}), jsxRuntime.jsxs(ProgressTotal, { children: [jsxRuntime.jsx(ProgressTotalTitle, { children: t("total", { ns: "dashboard", defaultValue: "Итого" }) }), jsxRuntime.jsxs(ProgressValue, { children: [totalValue, jsxRuntime.jsx(ProgressUnits, { children: totalUnits })] })] })] }))] })) : (jsxRuntime.jsx(ContainerLoading, {})), jsxRuntime.jsx(HiddenTitleItems, { elementConfig: elementConfig, config: config, type: type })] }));
|
|
5755
5752
|
});
|
|
5756
5753
|
|
|
5757
5754
|
const ProgressContainer = React.memo(({ type, elementConfig, feature, maxValue, index, renderElement }) => {
|
|
@@ -5763,7 +5760,7 @@ const ProgressContainer = React.memo(({ type, elementConfig, feature, maxValue,
|
|
|
5763
5760
|
dataSources,
|
|
5764
5761
|
feature
|
|
5765
5762
|
});
|
|
5766
|
-
const { children, options, style } = elementConfig || {};
|
|
5763
|
+
const { id, children, options, style } = elementConfig || {};
|
|
5767
5764
|
const { bgColor, innerTemplateStyle, maxValue: optionMaxValue, hideTitle, innerValue, colors, colorAttribute } = options;
|
|
5768
5765
|
const valueElement = children?.find(({ id }) => id === "value");
|
|
5769
5766
|
const unitsElement = children?.find(({ id }) => id === "units");
|
|
@@ -5790,7 +5787,7 @@ const ProgressContainer = React.memo(({ type, elementConfig, feature, maxValue,
|
|
|
5790
5787
|
const color = React.useMemo(() => colorAttribute
|
|
5791
5788
|
? attributes?.find(({ name }) => name === colorAttribute)?.value
|
|
5792
5789
|
: colors?.[index] || bgColor, [attributes, bgColor, colorAttribute, colors, index]);
|
|
5793
|
-
return (jsxRuntime.jsx(uilibGl.Tooltip, { content: renderTooltip, placement: "top", arrow: true, children: ref => (jsxRuntime.jsxs(ProgressContainerWrapper, { ref: ref, style: innerTemplateStyle || style, children: [renderIcon && jsxRuntime.jsx(ProgressIcon, { children: renderIcon }), jsxRuntime.jsxs(ProgressContent, { children: [!hideTitle && (jsxRuntime.jsxs(ProgressAlias, { children: [jsxRuntime.jsx("div", { children: renderAlias }), jsxRuntime.jsxs(ProgressValue, { children: [renderValue, unitsElement && jsxRuntime.jsx(ProgressUnits, { children: renderElement({ id: "units" }) })] })] })), jsxRuntime.jsxs(ProgressBarContainer, { innerValue: innerValue, children: [jsxRuntime.jsx(ProgressBarWrapper, { children: jsxRuntime.jsx(ProgressBar, { "$width": width, "$color": color }) }), !!(hideTitle || innerValue) && jsxRuntime.jsx(ProgressInnerValue, { children: renderValue })] })] })] })) }));
|
|
5790
|
+
return (jsxRuntime.jsx(uilibGl.Tooltip, { content: renderTooltip, placement: "top", arrow: true, children: ref => (jsxRuntime.jsxs(ProgressContainerWrapper, { ref: ref, id: id, style: innerTemplateStyle || style, children: [renderIcon && jsxRuntime.jsx(ProgressIcon, { children: renderIcon }), jsxRuntime.jsxs(ProgressContent, { children: [!hideTitle && (jsxRuntime.jsxs(ProgressAlias, { children: [jsxRuntime.jsx("div", { children: renderAlias }), jsxRuntime.jsxs(ProgressValue, { children: [renderValue, unitsElement && jsxRuntime.jsx(ProgressUnits, { children: renderElement({ id: "units" }) })] })] })), jsxRuntime.jsxs(ProgressBarContainer, { innerValue: innerValue, children: [jsxRuntime.jsx(ProgressBarWrapper, { children: jsxRuntime.jsx(ProgressBar, { "$width": width, "$color": color }) }), !!(hideTitle || innerValue) && jsxRuntime.jsx(ProgressInnerValue, { children: renderValue })] })] })] })) }));
|
|
5794
5791
|
});
|
|
5795
5792
|
|
|
5796
5793
|
const RANGE_MIN_VALUE = 0;
|
|
@@ -5984,7 +5981,7 @@ const FiltersContainer = React.memo(({ elementConfig, config, type, renderElemen
|
|
|
5984
5981
|
}, [config, type]);
|
|
5985
5982
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
5986
5983
|
const selectedItems = React.useMemo(() => getFilterSelectedItems(filterItems, filters, configFilters), [configFilters, filters, filterItems]);
|
|
5987
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(uilibGl.Flex, { mb: !isVisible && selectedItems.length ? "2rem" : 0, children: jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }) }), isLoading && jsxRuntime.jsx(ContainerLoading, {}), !isLoading && isVisible && (jsxRuntime.jsx(FiltersContainerWrapper, { style: style, "$padding": padding, "$bgColor": bgColor, "$fontSize": fontSize, "$fontColor": fontColor, children: filterItems?.map(renderFilter) })), jsxRuntime.jsx(HiddenTitleItems, { elementConfig: elementConfig, config: config, type: type, filter: filterItems[0].options?.filterName })] }));
|
|
5984
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(uilibGl.Flex, { mb: !isVisible && selectedItems.length ? "2rem" : 0, children: jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }) }), isLoading && jsxRuntime.jsx(ContainerLoading, {}), !isLoading && isVisible && (jsxRuntime.jsx(FiltersContainerWrapper, { id: id, style: style, "$padding": padding, "$bgColor": bgColor, "$fontSize": fontSize, "$fontColor": fontColor, children: filterItems?.map(renderFilter) })), jsxRuntime.jsx(HiddenTitleItems, { elementConfig: elementConfig, config: config, type: type, filter: filterItems[0].options?.filterName })] }));
|
|
5988
5985
|
});
|
|
5989
5986
|
|
|
5990
5987
|
const DefaultAttributesContainer = React.memo(({ type, renderElement }) => {
|
|
@@ -5993,7 +5990,7 @@ const DefaultAttributesContainer = React.memo(({ type, renderElement }) => {
|
|
|
5993
5990
|
});
|
|
5994
5991
|
|
|
5995
5992
|
const ChartContainer = React.memo(({ elementConfig, isVisible, type, renderElement }) => {
|
|
5996
|
-
const { options, children } = elementConfig || {};
|
|
5993
|
+
const { id, style, options, children } = elementConfig || {};
|
|
5997
5994
|
const { twoColumns, hideEmpty } = options || {};
|
|
5998
5995
|
const aliasElement = children.find(({ id }) => id === "alias");
|
|
5999
5996
|
const chartElement = children.find(({ id }) => id === "chart");
|
|
@@ -6008,7 +6005,7 @@ const ChartContainer = React.memo(({ elementConfig, isVisible, type, renderEleme
|
|
|
6008
6005
|
const hasItems = !!data[0]?.items?.length;
|
|
6009
6006
|
if (!loading && !hasItems && hideEmpty)
|
|
6010
6007
|
return null;
|
|
6011
|
-
return (jsxRuntime.jsxs(
|
|
6008
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsxRuntime.jsxs(Container, { id: id, style: style, 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, { justifyContent: legendElement?.options?.center ? "center" : "flex-start", children: renderElement({ id: "legend" }) })] })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: "\u2014" })) })] }))] }));
|
|
6012
6009
|
});
|
|
6013
6010
|
|
|
6014
6011
|
const PagesContainer = React.memo(({ type = exports.WidgetType.Dashboard, noBorders }) => {
|
|
@@ -6044,10 +6041,6 @@ const PagesContainer = React.memo(({ type = exports.WidgetType.Dashboard, noBord
|
|
|
6044
6041
|
return (jsxRuntime.jsx(Container, { id: getRootElementId(type), style: { width }, isMain: true, isColumn: isColumn, noBorders: noBorders, children: jsxRuntime.jsx(ContainerChildren, { items: filteredChildren, isMain: true, renderElement: renderElement }) }));
|
|
6045
6042
|
});
|
|
6046
6043
|
|
|
6047
|
-
const TwoColumnsInnerContainer = React.memo(({ renderElement }) => {
|
|
6048
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(TwoColumnContainerWrapper, { children: [jsxRuntime.jsxs(Container, { children: [jsxRuntime.jsx(ContainerAlias, { children: renderElement({ id: "firstAlias" }) }), jsxRuntime.jsx(ContainerValue, { big: true, children: renderElement({ id: "firstValue" }) })] }), jsxRuntime.jsxs(Container, { children: [jsxRuntime.jsx(ContainerAlias, { children: renderElement({ id: "secondAlias" }) }), jsxRuntime.jsx(ContainerValue, { big: true, children: renderElement({ id: "secondValue" }) })] })] }), renderElement({ id: "thirdContainer" })] }));
|
|
6049
|
-
});
|
|
6050
|
-
|
|
6051
6044
|
const ImageContainerBg$1 = styled.div `
|
|
6052
6045
|
position: absolute;
|
|
6053
6046
|
top: 0;
|
|
@@ -6109,8 +6102,8 @@ const ImageContainerWrapper = styled(uilibGl.Flex) `
|
|
|
6109
6102
|
`;
|
|
6110
6103
|
|
|
6111
6104
|
const ImageContainer = React.memo(({ elementConfig, renderElement }) => {
|
|
6112
|
-
const { style } = elementConfig || {};
|
|
6113
|
-
return (jsxRuntime.jsxs(ImageContainerWrapper, { style: style, children: [jsxRuntime.jsx(ImageContainerTitle, { children: renderElement({ id: "alias" }) }), jsxRuntime.jsx(ImageContainerText, { children: renderElement({ id: "text" }) }), renderElement({ id: "button" }), jsxRuntime.jsx(ImageContainerBg$1, { children: renderElement({ id: "image" }) })] }));
|
|
6105
|
+
const { id, style } = elementConfig || {};
|
|
6106
|
+
return (jsxRuntime.jsxs(ImageContainerWrapper, { id: id, style: style, children: [jsxRuntime.jsx(ImageContainerTitle, { children: renderElement({ id: "alias" }) }), jsxRuntime.jsx(ImageContainerText, { children: renderElement({ id: "text" }) }), renderElement({ id: "button" }), jsxRuntime.jsx(ImageContainerBg$1, { children: renderElement({ id: "image" }) })] }));
|
|
6114
6107
|
});
|
|
6115
6108
|
|
|
6116
6109
|
const IconContainerWrapper = styled(uilibGl.Flex) `
|
|
@@ -6162,7 +6155,8 @@ const IconContainerText = styled.div `
|
|
|
6162
6155
|
`;
|
|
6163
6156
|
|
|
6164
6157
|
const IconContainer = React.memo(({ elementConfig, renderElement }) => {
|
|
6165
|
-
|
|
6158
|
+
const { id, style } = elementConfig || {};
|
|
6159
|
+
return (jsxRuntime.jsxs(IconContainerWrapper, { id: id, style: style, children: [jsxRuntime.jsxs(IconContainerHeaderWrapper, { children: [jsxRuntime.jsxs(IconContainerHeader, { children: [renderElement({ id: "icon" }), jsxRuntime.jsx(IconContainerTitle, { children: renderElement({ id: "alias" }) })] }), renderElement({ id: "link" })] }), jsxRuntime.jsx(IconContainerText, { children: renderElement({ id: "text" }) })] }));
|
|
6166
6160
|
});
|
|
6167
6161
|
|
|
6168
6162
|
const DataSourceContainer = React.memo(({ config, elementConfig, type, innerComponent, renderElement }) => {
|
|
@@ -6177,7 +6171,7 @@ const DataSourceContainer = React.memo(({ config, elementConfig, type, innerComp
|
|
|
6177
6171
|
return jsxRuntime.jsx(DataSourceError, { name: elementConfig.templateName });
|
|
6178
6172
|
}
|
|
6179
6173
|
const isLoading = !dataSource?.features;
|
|
6180
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), !isVisible ? null : dataSource ? (jsxRuntime.jsx(Container, { isColumn: column, style: { height: isLoading ? "3rem" : "auto", ...style }, children: dataSource.features?.map((feature, index) => (jsxRuntime.jsx(DataSourceInnerContainer, { index: index, type: type, config: config, feature: feature, elementConfig: elementConfig, innerComponent: innerComponent }, index))) })) : (jsxRuntime.jsx(ContainerLoading, {}))] }));
|
|
6174
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), !isVisible ? null : dataSource ? (jsxRuntime.jsx(Container, { id: id, isColumn: column, style: { height: isLoading ? "3rem" : "auto", ...style }, children: dataSource.features?.map((feature, index) => (jsxRuntime.jsx(DataSourceInnerContainer, { index: index, type: type, config: config, feature: feature, elementConfig: elementConfig, innerComponent: innerComponent }, index))) })) : (jsxRuntime.jsx(ContainerLoading, {}))] }));
|
|
6181
6175
|
});
|
|
6182
6176
|
|
|
6183
6177
|
const SvgContainerColorMixin = styled.css `
|
|
@@ -6218,10 +6212,6 @@ const ContainerIconTitle = styled(uilibGl.Flex) `
|
|
|
6218
6212
|
flex-grow: 0;
|
|
6219
6213
|
margin-right: 0.5rem;
|
|
6220
6214
|
}
|
|
6221
|
-
|
|
6222
|
-
> * {
|
|
6223
|
-
width: auto;
|
|
6224
|
-
}
|
|
6225
6215
|
|
|
6226
6216
|
svg,
|
|
6227
6217
|
img,
|
|
@@ -6291,7 +6281,7 @@ const TitleContainer = React.memo(({ containerId, templateName, layerNames, font
|
|
|
6291
6281
|
const { expandContainer, expandedContainers, setDashboardLayer } = useWidgetContext(type);
|
|
6292
6282
|
const [layersVisibility, toggleVisibility] = useToggle(true);
|
|
6293
6283
|
const { palette } = styled.useTheme();
|
|
6294
|
-
const { style, options } = elementConfig || {};
|
|
6284
|
+
const { id, style, options } = elementConfig || {};
|
|
6295
6285
|
const { simple, downloadById } = options || {};
|
|
6296
6286
|
const isLayers = templateName === exports.ContainerTemplate.Layers;
|
|
6297
6287
|
const { onExport } = useExportPdf(downloadById);
|
|
@@ -6309,7 +6299,7 @@ const TitleContainer = React.memo(({ containerId, templateName, layerNames, font
|
|
|
6309
6299
|
const renderVisibility = React.useMemo(() => isLayers && (jsxRuntime.jsx(uilibGl.FlexSpan, { mr: "-1rem", children: jsxRuntime.jsx(uilibGl.IconToggle, { kind: layersVisibility ? "password_show" : "password_hide", className: "feature-visible", isSelected: layersVisibility, onClick: onToggleVisibility }) })), [isLayers, layersVisibility, onToggleVisibility]);
|
|
6310
6300
|
const renderToggler = React.useMemo(() => !!containerId &&
|
|
6311
6301
|
expandable && (jsxRuntime.jsx("div", { children: jsxRuntime.jsx(uilibGl.LegendToggler, { color: palette.icon, toggled: expandedContainers?.[containerId] !== undefined ? expandedContainers[containerId] : expanded, onClick: onClick }) })), [containerId, expandable, expanded, expandedContainers, onClick, palette.icon]);
|
|
6312
|
-
return (jsxRuntime.jsx(Container, {
|
|
6302
|
+
return (jsxRuntime.jsx(Container, { id: id, style: style, isTitle: isVisible, children: jsxRuntime.jsxs(ContainerTitle, { simple: simple, children: [jsxRuntime.jsxs(ContainerIconTitle, { fontColor: fontColor, children: [renderElement({ id: "titleIcon", wrap: false }), renderElement({ id: "title" }), !!downloadById && (jsxRuntime.jsx(uilibGl.IconButton, { kind: "download", onClick: onExport })), isLayers && renderToggler] }), !isLayers && renderToggler, renderVisibility] }) }));
|
|
6313
6303
|
});
|
|
6314
6304
|
|
|
6315
6305
|
const ContainerDivider = styled(uilibGl.Divider) `
|
|
@@ -6318,7 +6308,8 @@ const ContainerDivider = styled(uilibGl.Divider) `
|
|
|
6318
6308
|
`;
|
|
6319
6309
|
|
|
6320
6310
|
const DividerContainer = React.memo(({ elementConfig, config }) => {
|
|
6321
|
-
|
|
6311
|
+
const { id, style } = elementConfig || {};
|
|
6312
|
+
return (jsxRuntime.jsx(Container, { id: id, style: style, children: jsxRuntime.jsx(ContainerDivider, { "$bgColor": config?.options?.bgColor }) }));
|
|
6322
6313
|
});
|
|
6323
6314
|
|
|
6324
6315
|
const SlideshowContainer = React.memo(({ config, elementConfig, type }) => {
|
|
@@ -6328,7 +6319,7 @@ const SlideshowContainer = React.memo(({ config, elementConfig, type }) => {
|
|
|
6328
6319
|
elementConfig,
|
|
6329
6320
|
dataSources,
|
|
6330
6321
|
});
|
|
6331
|
-
const { id, options } = elementConfig || {};
|
|
6322
|
+
const { id, style, options } = elementConfig || {};
|
|
6332
6323
|
const { expandable, expanded } = options || {};
|
|
6333
6324
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
6334
6325
|
const render = React.useMemo(() => getRenderElement({
|
|
@@ -6353,7 +6344,7 @@ const SlideshowContainer = React.memo(({ config, elementConfig, type }) => {
|
|
|
6353
6344
|
pageIndex,
|
|
6354
6345
|
type,
|
|
6355
6346
|
]);
|
|
6356
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: render }), isVisible && (jsxRuntime.jsxs(Container, { style:
|
|
6347
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: render }), isVisible && (jsxRuntime.jsxs(Container, { style: style, children: [jsxRuntime.jsx(ContainerAlias, { hasBottomMargin: true, children: render({ id: "alias" }) }), jsxRuntime.jsx(ContainerValue, { children: render({
|
|
6357
6348
|
id: "slideshow",
|
|
6358
6349
|
wrap: false,
|
|
6359
6350
|
}) })] }))] }));
|
|
@@ -6364,7 +6355,7 @@ const CameraContainer = React.memo(({ elementConfig, type, renderElement }) => {
|
|
|
6364
6355
|
const { id, options, style } = elementConfig || {};
|
|
6365
6356
|
const { expandable, expanded } = options || {};
|
|
6366
6357
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
6367
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsxRuntime.jsxs(Container, { style: style, children: [jsxRuntime.jsx(ContainerAlias, { hasBottomMargin: true, children: renderElement({ id: "alias" }) }), jsxRuntime.jsx(ContainerValue, { children: renderElement({ id: "value", wrap: false }) })] }))] }));
|
|
6358
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsxRuntime.jsxs(Container, { id: id, style: style, children: [jsxRuntime.jsx(ContainerAlias, { hasBottomMargin: true, children: renderElement({ id: "alias" }) }), jsxRuntime.jsx(ContainerValue, { children: renderElement({ id: "value", wrap: false }) })] }))] }));
|
|
6368
6359
|
});
|
|
6369
6360
|
|
|
6370
6361
|
const TabAnchor = styled.div `
|
|
@@ -6448,7 +6439,7 @@ const SwiperContainer = styled.div `
|
|
|
6448
6439
|
const TabsContainer = React.memo(({ elementConfig, type }) => {
|
|
6449
6440
|
const { palette } = styled.useTheme();
|
|
6450
6441
|
const { selectedTabId, setSelectedTabId } = useWidgetContext(type);
|
|
6451
|
-
const { options, style, children: tabs } = elementConfig || {};
|
|
6442
|
+
const { id, options, style, children: tabs } = elementConfig || {};
|
|
6452
6443
|
const { radius, column, bgColor, noBg, onlyIcon, shownItems, maxLength = 12 } = options || {};
|
|
6453
6444
|
const renderIcon = React.useCallback((icon, active) => {
|
|
6454
6445
|
if (!icon)
|
|
@@ -6466,7 +6457,7 @@ const TabsContainer = React.memo(({ elementConfig, type }) => {
|
|
|
6466
6457
|
setSelectedTabId(tabs[0].id);
|
|
6467
6458
|
}
|
|
6468
6459
|
}, []);
|
|
6469
|
-
return (jsxRuntime.jsx(SwiperContainer, { style: style, children: jsxRuntime.jsx(react.Swiper, { spaceBetween: 0, slidesPerView: shownItems || 2, children: tabs.map(({ id, value, options: tabOptions }) => (jsxRuntime.jsxs(react.SwiperSlide, { children: [jsxRuntime.jsxs(TabContainer, { href: `#${id}`, active: selectedTabId === id, column: column, bgColor: bgColor, noBg: noBg, radius: radius, onlyIcon: onlyIcon, hasIcon: !!tabOptions?.icon, onClick: () => onClick(id), children: [renderIcon(tabOptions?.icon, selectedTabId === id), !onlyIcon && (jsxRuntime.jsx(TabValue, { children: jsxRuntime.jsx(TextTrim, { maxLength: maxLength, children: value }) }))] }), jsxRuntime.jsx(TabAnchor, { id: id })] }, id))) }) }));
|
|
6460
|
+
return (jsxRuntime.jsx(SwiperContainer, { id: id, style: style, children: jsxRuntime.jsx(react.Swiper, { spaceBetween: 0, slidesPerView: shownItems || 2, children: tabs.map(({ id, value, options: tabOptions }) => (jsxRuntime.jsxs(react.SwiperSlide, { children: [jsxRuntime.jsxs(TabContainer, { href: `#${id}`, active: selectedTabId === id, column: column, bgColor: bgColor, noBg: noBg, radius: radius, onlyIcon: onlyIcon, hasIcon: !!tabOptions?.icon, onClick: () => onClick(id), children: [renderIcon(tabOptions?.icon, selectedTabId === id), !onlyIcon && (jsxRuntime.jsx(TabValue, { children: jsxRuntime.jsx(TextTrim, { maxLength: maxLength, children: value }) }))] }), jsxRuntime.jsx(TabAnchor, { id: id })] }, id))) }) }));
|
|
6470
6461
|
});
|
|
6471
6462
|
|
|
6472
6463
|
const ContainerIconValue = styled(uilibGl.Flex) ``;
|
|
@@ -6572,7 +6563,7 @@ const RoundedBackgroundContainer = React.memo(({ type, elementConfig, feature, r
|
|
|
6572
6563
|
dataSources,
|
|
6573
6564
|
feature
|
|
6574
6565
|
});
|
|
6575
|
-
const { options, style, children } = elementConfig || {};
|
|
6566
|
+
const { id, options, style, children } = elementConfig || {};
|
|
6576
6567
|
const { maxLength, center, fontColor, innerTemplateStyle, inlineUnits, big, bigIcon, hideEmpty, colorAttribute } = options || {};
|
|
6577
6568
|
const iconElement = children?.find(({ id }) => id === "icon");
|
|
6578
6569
|
const aliasElement = children?.find(({ id }) => id === "alias");
|
|
@@ -6596,12 +6587,12 @@ const RoundedBackgroundContainer = React.memo(({ type, elementConfig, feature, r
|
|
|
6596
6587
|
const renderValue = React.useMemo(() => lodash.isNil(value) ? null : (jsxRuntime.jsxs(ContainerValue, { style: valueElement?.style, big: true, children: [value, !!unitsElement && (jsxRuntime.jsx(ContainerUnits, { style: unitsElement?.style, children: renderElement({ id: "units" }) }))] })), [valueElement?.style, value, unitsElement, renderElement]);
|
|
6597
6588
|
if (lodash.isNil(value) && hideEmpty)
|
|
6598
6589
|
return null;
|
|
6599
|
-
return (jsxRuntime.jsxs(RoundedBackgroundContainerWrapper, { style: innerTemplateStyle || style, "$center": center, "$color": color, "$inlineUnits": inlineUnits, "$big": big, "$bigIcon": bigIcon, children: [jsxRuntime.jsxs(ContainerIconValue, { children: [renderIcon, big ? renderAlias : renderValue] }), big ? renderValue : renderAlias] }));
|
|
6590
|
+
return (jsxRuntime.jsxs(RoundedBackgroundContainerWrapper, { id: id, style: innerTemplateStyle || style, "$center": center, "$color": color, "$inlineUnits": inlineUnits, "$big": big, "$bigIcon": bigIcon, children: [jsxRuntime.jsxs(ContainerIconValue, { children: [renderIcon, big ? renderAlias : renderValue] }), big ? renderValue : renderAlias] }));
|
|
6600
6591
|
});
|
|
6601
6592
|
|
|
6602
6593
|
const AddFeatureContainer = React.memo(({ elementConfig }) => {
|
|
6603
|
-
const { children, style } = elementConfig || {};
|
|
6604
|
-
return (jsxRuntime.jsx(Container, { style: style, children: children
|
|
6594
|
+
const { id, children, style } = elementConfig || {};
|
|
6595
|
+
return (jsxRuntime.jsx(Container, { id: id, style: style, children: children
|
|
6605
6596
|
.filter(({ type }) => type === "button")
|
|
6606
6597
|
.map(({ options }, index) => (jsxRuntime.jsx(AddFeatureButton, { icon: options?.icon, title: options?.title, layerName: options?.layerName, geometryType: options?.geometryType }, index))) }));
|
|
6607
6598
|
});
|
|
@@ -6635,15 +6626,15 @@ const LayersContainer = React.memo(({ type, elementConfig, renderElement }) => {
|
|
|
6635
6626
|
return currentPage.layers;
|
|
6636
6627
|
return currentPage.layers.filter(({ name }) => layerNames.includes(name));
|
|
6637
6628
|
}, [currentPage?.layers, layerNames]);
|
|
6638
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsxRuntime.jsx(LayersContainerWrapper, { style: style, children: jsxRuntime.jsx(LayerTree, { layers: layers, onlyMainTools: true }) }))] }));
|
|
6629
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsxRuntime.jsx(LayersContainerWrapper, { id: id, style: style, children: jsxRuntime.jsx(LayerTree, { layers: layers, onlyMainTools: true }) }))] }));
|
|
6639
6630
|
});
|
|
6640
6631
|
|
|
6641
6632
|
const ExportPdfContainer = React.memo(({ type, elementConfig }) => {
|
|
6642
6633
|
const { t } = useGlobalContext();
|
|
6643
6634
|
const { loading, onExport } = useExportPdf(getRootElementId(type));
|
|
6644
|
-
const { style, options } = elementConfig || {};
|
|
6635
|
+
const { id, style, options } = elementConfig || {};
|
|
6645
6636
|
const { icon, title } = options || {};
|
|
6646
|
-
return (jsxRuntime.jsx(Container, { children: jsxRuntime.jsx(uilibGl.IconButton, { kind: icon || "download", primary: true, disabled: loading,
|
|
6637
|
+
return (jsxRuntime.jsx(Container, { id: id, style: style, children: jsxRuntime.jsx(uilibGl.IconButton, { kind: icon || "download", primary: true, disabled: loading, onClick: onExport, children: title ?? t("downloadPdf", { ns: "dashboard", defaultValue: "Скачать PDF" }) }) }));
|
|
6647
6638
|
});
|
|
6648
6639
|
|
|
6649
6640
|
const containerComponents = {
|
|
@@ -6654,7 +6645,6 @@ const containerComponents = {
|
|
|
6654
6645
|
[exports.ContainerTemplate.RoundedBackground]: RoundedBackgroundContainer,
|
|
6655
6646
|
[exports.ContainerTemplate.OneColumn]: OneColumnContainer,
|
|
6656
6647
|
[exports.ContainerTemplate.TwoColumn]: TwoColumnContainer,
|
|
6657
|
-
[exports.ContainerTemplate.TwoColumnsInner]: TwoColumnsInnerContainer,
|
|
6658
6648
|
[exports.ContainerTemplate.DataSource]: DataSourceContainer,
|
|
6659
6649
|
[exports.ContainerTemplate.DataSourceProgress]: DataSourceProgressContainer,
|
|
6660
6650
|
[exports.ContainerTemplate.Progress]: ProgressContainer,
|
|
@@ -10094,7 +10084,7 @@ const ContainerChildren = React.memo(({ items, isColumn, isMain, renderElement }
|
|
|
10094
10084
|
index,
|
|
10095
10085
|
wrap: isColumn || isMain,
|
|
10096
10086
|
});
|
|
10097
|
-
return isMain ? (jsxRuntime.jsx(ContainerWrapper, { id: item.id, "data-templatename": item.templateName, children: jsxRuntime.jsx(DashboardWrapper, { children: render }) }, index)) : (jsxRuntime.jsx(
|
|
10087
|
+
return isMain ? (jsxRuntime.jsx(ContainerWrapper, { id: item.id, "data-templatename": item.templateName, children: jsxRuntime.jsx(DashboardWrapper, { children: render }) }, index)) : (jsxRuntime.jsx(React.Fragment, { children: render }, index));
|
|
10098
10088
|
}) }));
|
|
10099
10089
|
});
|
|
10100
10090
|
|
|
@@ -10677,7 +10667,6 @@ exports.HeaderTitleContainer = HeaderTitleContainer;
|
|
|
10677
10667
|
exports.HiddenTitleItems = HiddenTitleItems;
|
|
10678
10668
|
exports.IconContainer = IconContainer;
|
|
10679
10669
|
exports.ImageContainer = ImageContainer;
|
|
10680
|
-
exports.InnerContainerWrapper = InnerContainerWrapper$1;
|
|
10681
10670
|
exports.LEFT_PANEL_HEADER_HEIGHT = LEFT_PANEL_HEADER_HEIGHT;
|
|
10682
10671
|
exports.Layer = Layer;
|
|
10683
10672
|
exports.LayerDescription = LayerDescription;
|
|
@@ -10728,7 +10717,6 @@ exports.TitleContainer = TitleContainer;
|
|
|
10728
10717
|
exports.TopContainer = TopContainer;
|
|
10729
10718
|
exports.TopContainerButtons = TopContainerButtons;
|
|
10730
10719
|
exports.TwoColumnContainer = TwoColumnContainer;
|
|
10731
|
-
exports.TwoColumnsInnerContainer = TwoColumnsInnerContainer;
|
|
10732
10720
|
exports.addDataSource = addDataSource;
|
|
10733
10721
|
exports.addDataSources = addDataSources;
|
|
10734
10722
|
exports.applyFiltersToCondition = applyFiltersToCondition;
|