@evergis/react 4.0.92 → 4.0.93
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/componentTypes.d.ts +12 -12
- package/dist/components/Dashboard/utils/getWrapperSizeStyle.d.ts +8 -0
- package/dist/components/Dashboard/utils/index.d.ts +1 -0
- package/dist/index.js +38 -23
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +38 -24
- package/dist/react.esm.js.map +1 -1
- package/package.json +3 -3
package/dist/react.esm.js
CHANGED
|
@@ -6405,11 +6405,11 @@ const getChartMarkers = (items, markers, dataSources) => {
|
|
|
6405
6405
|
|
|
6406
6406
|
const ContainersGroupContainer = memo(({ elementConfig, type, renderElement }) => {
|
|
6407
6407
|
const { expandedContainers } = useWidgetContext(type);
|
|
6408
|
-
const { id, children, options } = elementConfig || {};
|
|
6409
|
-
const { column, expandable, expanded } = options || {};
|
|
6408
|
+
const { id, style, children, options } = elementConfig || {};
|
|
6409
|
+
const { column, expandable, expanded, width, height } = options || {};
|
|
6410
6410
|
const isColumn = column === undefined || column;
|
|
6411
6411
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
6412
|
-
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsx(Container, { id: id, isColumn: isColumn, children: jsx(ContainerChildren, { type: type, items: children, elementConfig: elementConfig, isColumn: isColumn, isMain: id?.startsWith(CONFIG_PAGE_ID), renderElement: renderElement }) }))] }));
|
|
6412
|
+
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsx(Container, { id: id, isColumn: isColumn, style: getWrapperSizeStyle(style, width, height), children: jsx(ContainerChildren, { type: type, items: children, elementConfig: elementConfig, isColumn: isColumn, isMain: id?.startsWith(CONFIG_PAGE_ID), renderElement: renderElement }) }))] }));
|
|
6413
6413
|
});
|
|
6414
6414
|
|
|
6415
6415
|
const ChartLegendContainer = styled(Flex) `
|
|
@@ -6590,7 +6590,8 @@ const useRenderContainer = ({ elementConfig, type, renderElement, renderBody, })
|
|
|
6590
6590
|
};
|
|
6591
6591
|
|
|
6592
6592
|
const OneColumnContainer = memo(({ type, elementConfig, renderElement }) => {
|
|
6593
|
-
const
|
|
6593
|
+
const { width, height } = elementConfig?.options || {};
|
|
6594
|
+
const renderBody = useCallback(({ id, value, style, hasUnits, render }) => (jsxs(Container, { id: id, isColumn: true, style: getWrapperSizeStyle({ ...BASE_CONTAINER_STYLE, ...style }, width, height), children: [jsxs(ContainerAlias, { hasBottomMargin: true, children: [render({ id: "alias" }), render({ id: "tooltip" }), render({ id: "modal" })] }), jsxs(ContainerValue, { children: [value, hasUnits && (jsx(ContainerUnits, { children: render({ id: "units" }) }))] })] })), [width, height]);
|
|
6594
6595
|
const { renderContainer, attributesToRender } = useRenderContainer({
|
|
6595
6596
|
type,
|
|
6596
6597
|
elementConfig,
|
|
@@ -6601,7 +6602,8 @@ const OneColumnContainer = memo(({ type, elementConfig, renderElement }) => {
|
|
|
6601
6602
|
});
|
|
6602
6603
|
|
|
6603
6604
|
const TwoColumnContainer = memo(({ elementConfig, type, renderElement }) => {
|
|
6604
|
-
const
|
|
6605
|
+
const { width, height } = elementConfig?.options || {};
|
|
6606
|
+
const renderBody = useCallback(({ id, value, style, hasIcon, hasUnits, render }) => (jsxs(TwoColumnContainerWrapper, { id: id, style: getWrapperSizeStyle(style, width, height), children: [jsxs(ContainerAlias, { children: [hasIcon && (jsx(ContainerAliasIcon, { children: render({ id: "icon" }) })), render({ id: "alias" }), render({ id: "tooltip" }), render({ id: "modal" })] }), jsxs(ContainerValue, { big: true, children: [value, hasUnits && (jsx(ContainerUnits, { children: render({ id: "units" }) }))] })] })), [width, height]);
|
|
6605
6607
|
const { renderContainer, attributesToRender } = useRenderContainer({
|
|
6606
6608
|
type,
|
|
6607
6609
|
elementConfig,
|
|
@@ -6787,7 +6789,7 @@ const DataSourceProgressContainer = memo(({ config, elementConfig, type, innerCo
|
|
|
6787
6789
|
});
|
|
6788
6790
|
const { attributes } = layerInfo?.configuration?.attributesConfiguration || {};
|
|
6789
6791
|
const { id, options, children, style } = elementConfig || {};
|
|
6790
|
-
const { maxValue, showTotal, relatedDataSource, expandable, expanded } = options || {};
|
|
6792
|
+
const { maxValue, showTotal, relatedDataSource, expandable, expanded, width, height } = options || {};
|
|
6791
6793
|
const valueElement = children?.find(item => item.id === "value");
|
|
6792
6794
|
const unitsElement = children?.find(item => item.id === "units");
|
|
6793
6795
|
const { sliceItems, checkIsSliced, showMore, onShowMore } = useShownOtherItems(options);
|
|
@@ -6820,7 +6822,7 @@ const DataSourceProgressContainer = memo(({ config, elementConfig, type, innerCo
|
|
|
6820
6822
|
return jsx(DataSourceError, { name: elementConfig.templateName });
|
|
6821
6823
|
}
|
|
6822
6824
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
6823
|
-
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), !isVisible ? null : dataSource ? (jsxs(DataSourceProgressContainerWrapper, { id: id, style: style, children: [sliceItems(dataSource?.features)?.map((feature, index) => (jsx(DataSourceInnerContainer, { type: type, index: index, feature: feature, config: config, elementConfig: elementConfig, maxValue: currentMaxValue, innerComponent: innerComponent }, index))), checkIsSliced(dataSource?.features) && (jsx(ContainerToggler, { toggled: showMore, onClick: onShowMore, children: showMore ? t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) : t("showAll", {
|
|
6825
|
+
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), !isVisible ? null : dataSource ? (jsxs(DataSourceProgressContainerWrapper, { id: id, style: getWrapperSizeStyle(style, width, height), children: [sliceItems(dataSource?.features)?.map((feature, index) => (jsx(DataSourceInnerContainer, { type: type, index: index, feature: feature, config: config, elementConfig: elementConfig, maxValue: currentMaxValue, innerComponent: innerComponent }, index))), checkIsSliced(dataSource?.features) && (jsx(ContainerToggler, { toggled: showMore, onClick: onShowMore, children: showMore ? t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) : t("showAll", {
|
|
6824
6826
|
ns: "dashboard",
|
|
6825
6827
|
defaultValue: "Показать все",
|
|
6826
6828
|
}) })), showTotal && (jsxs(Fragment$1, { children: [jsx(Divider, {}), jsxs(ProgressTotal, { children: [jsx(ProgressTotalTitle, { children: t("total", { ns: "dashboard", defaultValue: "Итого" }) }), jsxs(ProgressValue, { children: [totalValue, jsx(ProgressUnits, { children: totalUnits })] })] })] }))] })) : (jsx(ContainerLoading, {})), jsx(HiddenTitleItems, { elementConfig: elementConfig, config: config, type: type })] }));
|
|
@@ -7047,7 +7049,7 @@ const FiltersContainer = memo(({ elementConfig, config, type, renderElement }) =
|
|
|
7047
7049
|
const { currentPage } = useWidgetPage(type);
|
|
7048
7050
|
const { filters: configFilters } = currentPage;
|
|
7049
7051
|
const { id, style, options } = elementConfig || {};
|
|
7050
|
-
const { padding, bgColor, fontColor, fontSize, expandable, expanded } = options || {};
|
|
7052
|
+
const { padding, bgColor, fontColor, fontSize, expandable, expanded, width, height } = options || {};
|
|
7051
7053
|
const isLoading = useMemo(() => checkIsLoading(dataSources, config, configFilters), [configFilters, config, dataSources]);
|
|
7052
7054
|
const filterItems = useMemo(() => elementConfig?.children?.filter(child => child.options?.filterName), [elementConfig?.children]);
|
|
7053
7055
|
const renderFilter = useCallback((filter, index) => {
|
|
@@ -7056,7 +7058,7 @@ const FiltersContainer = memo(({ elementConfig, config, type, renderElement }) =
|
|
|
7056
7058
|
}, [config, type]);
|
|
7057
7059
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
7058
7060
|
const selectedItems = useMemo(() => getFilterSelectedItems(filterItems, filters, configFilters), [configFilters, filters, filterItems]);
|
|
7059
|
-
return (jsxs(Fragment$1, { children: [jsx(Flex, { mb: !isVisible && selectedItems.length ? "2rem" : 0, children: jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }) }), isLoading && jsx(ContainerLoading, {}), !isLoading && isVisible && (jsx(FiltersContainerWrapper, { id: id, style: style, "$padding": padding, "$bgColor": bgColor, "$fontSize": fontSize, "$fontColor": fontColor, children: filterItems?.map(renderFilter) })), jsx(HiddenTitleItems, { elementConfig: elementConfig, config: config, type: type, filter: filterItems[0]?.options?.filterName })] }));
|
|
7061
|
+
return (jsxs(Fragment$1, { children: [jsx(Flex, { mb: !isVisible && selectedItems.length ? "2rem" : 0, children: jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }) }), isLoading && jsx(ContainerLoading, {}), !isLoading && isVisible && (jsx(FiltersContainerWrapper, { id: id, style: getWrapperSizeStyle(style, width, height), "$padding": padding, "$bgColor": bgColor, "$fontSize": fontSize, "$fontColor": fontColor, children: filterItems?.map(renderFilter) })), jsx(HiddenTitleItems, { elementConfig: elementConfig, config: config, type: type, filter: filterItems[0]?.options?.filterName })] }));
|
|
7060
7062
|
});
|
|
7061
7063
|
|
|
7062
7064
|
const DefaultAttributesContainer = memo(({ type, renderElement }) => {
|
|
@@ -7237,7 +7239,7 @@ const IconContainer = memo(({ elementConfig, renderElement }) => {
|
|
|
7237
7239
|
const DataSourceContainer = memo(({ config, elementConfig, type, innerComponent, renderElement }) => {
|
|
7238
7240
|
const { dataSources, expandedContainers } = useWidgetContext(type);
|
|
7239
7241
|
const { id, style, options } = elementConfig || {};
|
|
7240
|
-
const { column = true, relatedDataSource, expandable, expanded } = options || {};
|
|
7242
|
+
const { column = true, relatedDataSource, expandable, expanded, width, height } = options || {};
|
|
7241
7243
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
7242
7244
|
const dataSource = useMemo(() => dataSources?.find(({ name }) => name === relatedDataSource), [dataSources, relatedDataSource]);
|
|
7243
7245
|
if (!relatedDataSource)
|
|
@@ -7246,7 +7248,7 @@ const DataSourceContainer = memo(({ config, elementConfig, type, innerComponent,
|
|
|
7246
7248
|
return jsx(DataSourceError, { name: elementConfig.templateName });
|
|
7247
7249
|
}
|
|
7248
7250
|
const isLoading = !dataSource?.features;
|
|
7249
|
-
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), !isVisible ? null : dataSource ? (jsx(Container, { id: id, isColumn: column, style: { height: isLoading ? "3rem" : "auto", ...style }, children: dataSource.features?.map((feature, index) => (jsx(DataSourceInnerContainer, { index: index, type: type, config: config, feature: feature, elementConfig: elementConfig, innerComponent: innerComponent }, index))) })) : (jsx(ContainerLoading, {}))] }));
|
|
7251
|
+
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), !isVisible ? null : dataSource ? (jsx(Container, { id: id, isColumn: column, style: getWrapperSizeStyle({ height: isLoading ? "3rem" : "auto", ...style }, width, height), children: dataSource.features?.map((feature, index) => (jsx(DataSourceInnerContainer, { index: index, type: type, config: config, feature: feature, elementConfig: elementConfig, innerComponent: innerComponent }, index))) })) : (jsx(ContainerLoading, {}))] }));
|
|
7250
7252
|
});
|
|
7251
7253
|
|
|
7252
7254
|
const SvgContainerColorMixin = css `
|
|
@@ -7385,7 +7387,7 @@ const SlideshowContainer = memo(({ config, elementConfig, type }) => {
|
|
|
7385
7387
|
dataSources,
|
|
7386
7388
|
});
|
|
7387
7389
|
const { id, style, options } = elementConfig || {};
|
|
7388
|
-
const { expandable, expanded } = options || {};
|
|
7390
|
+
const { expandable, expanded, width, height } = options || {};
|
|
7389
7391
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
7390
7392
|
const render = useMemo(() => getRenderElement({
|
|
7391
7393
|
config,
|
|
@@ -7409,7 +7411,7 @@ const SlideshowContainer = memo(({ config, elementConfig, type }) => {
|
|
|
7409
7411
|
pageIndex,
|
|
7410
7412
|
type,
|
|
7411
7413
|
]);
|
|
7412
|
-
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: render }), isVisible && (jsxs(Container, { style: style, children: [jsx(ContainerAlias, { hasBottomMargin: true, children: render({ id: "alias" }) }), jsx(ContainerValue, { children: render({
|
|
7414
|
+
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: render }), isVisible && (jsxs(Container, { style: getWrapperSizeStyle(style, width, height), children: [jsx(ContainerAlias, { hasBottomMargin: true, children: render({ id: "alias" }) }), jsx(ContainerValue, { children: render({
|
|
7413
7415
|
id: "slideshow",
|
|
7414
7416
|
wrap: false,
|
|
7415
7417
|
}) })] }))] }));
|
|
@@ -7418,9 +7420,9 @@ const SlideshowContainer = memo(({ config, elementConfig, type }) => {
|
|
|
7418
7420
|
const CameraContainer = memo(({ elementConfig, type, renderElement }) => {
|
|
7419
7421
|
const { expandedContainers } = useWidgetContext(type);
|
|
7420
7422
|
const { id, options, style } = elementConfig || {};
|
|
7421
|
-
const { expandable, expanded } = options || {};
|
|
7423
|
+
const { expandable, expanded, width, height } = options || {};
|
|
7422
7424
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
7423
|
-
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsxs(Container, { id: id, style: style, children: [jsx(ContainerAlias, { hasBottomMargin: true, children: renderElement({ id: "alias" }) }), jsx(ContainerValue, { children: renderElement({ id: "value", wrap: false }) })] }))] }));
|
|
7425
|
+
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsxs(Container, { id: id, style: getWrapperSizeStyle(style, width, height), children: [jsx(ContainerAlias, { hasBottomMargin: true, children: renderElement({ id: "alias" }) }), jsx(ContainerValue, { children: renderElement({ id: "value", wrap: false }) })] }))] }));
|
|
7424
7426
|
});
|
|
7425
7427
|
|
|
7426
7428
|
const TabAnchor = styled.div `
|
|
@@ -7684,7 +7686,7 @@ const LayersContainer = memo(({ type, elementConfig, renderElement }) => {
|
|
|
7684
7686
|
const { expandedContainers } = useWidgetContext(type);
|
|
7685
7687
|
const { currentPage } = useWidgetPage(type);
|
|
7686
7688
|
const { id, options, style } = elementConfig || {};
|
|
7687
|
-
const { layerNames, expandable, expanded } = options || {};
|
|
7689
|
+
const { layerNames, expandable, expanded, width, height } = options || {};
|
|
7688
7690
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
7689
7691
|
const layers = useMemo(() => {
|
|
7690
7692
|
if (!currentPage?.layers)
|
|
@@ -7693,7 +7695,7 @@ const LayersContainer = memo(({ type, elementConfig, renderElement }) => {
|
|
|
7693
7695
|
return currentPage.layers;
|
|
7694
7696
|
return currentPage.layers.filter(({ name }) => layerNames.includes(name));
|
|
7695
7697
|
}, [currentPage?.layers, layerNames]);
|
|
7696
|
-
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsx(LayersContainerWrapper, { id: id, style: style, children: jsx(LayerTree, { layers: layers, onlyMainTools: true }) }))] }));
|
|
7698
|
+
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsx(LayersContainerWrapper, { id: id, style: getWrapperSizeStyle(style, width, height), children: jsx(LayerTree, { layers: layers, onlyMainTools: true }) }))] }));
|
|
7697
7699
|
});
|
|
7698
7700
|
|
|
7699
7701
|
const ExportPdfContainer = memo(({ type, elementConfig }) => {
|
|
@@ -7707,9 +7709,9 @@ const ExportPdfContainer = memo(({ type, elementConfig }) => {
|
|
|
7707
7709
|
const UploadContainer = memo(({ type, elementConfig, renderElement }) => {
|
|
7708
7710
|
const { expandedContainers } = useWidgetContext(type);
|
|
7709
7711
|
const { id, options } = elementConfig || {};
|
|
7710
|
-
const { expandable, expanded } = options || {};
|
|
7712
|
+
const { expandable, expanded, width, height } = options || {};
|
|
7711
7713
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
7712
|
-
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && renderElement({ id: "uploader", wrap: false })] }));
|
|
7714
|
+
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsx(Flex, { column: true, style: getWrapperSizeStyle({ width: "100%" }, width, height), children: renderElement({ id: "uploader", wrap: false }) }))] }));
|
|
7713
7715
|
});
|
|
7714
7716
|
|
|
7715
7717
|
const StatusBadge = styled(Chip) `
|
|
@@ -7924,7 +7926,7 @@ const TaskContainer = memo(({ type, elementConfig, renderElement }) => {
|
|
|
7924
7926
|
const { currentPage } = useWidgetPage(type);
|
|
7925
7927
|
const { taskId, runTask, stopTask, status, openLog, loading, isLogDialogOpen, closeLog, log, lastMessage, result, } = usePythonTask();
|
|
7926
7928
|
const { options } = elementConfig || {};
|
|
7927
|
-
const { title, relatedResources, center, icon, statusColors, responseFilters, useNotifications, } = options || {};
|
|
7929
|
+
const { title, relatedResources, center, icon, statusColors, responseFilters, useNotifications, width, height, } = options || {};
|
|
7928
7930
|
const { setNotificationDismissed } = useTaskNotifications({
|
|
7929
7931
|
enabled: !!useNotifications,
|
|
7930
7932
|
suppressed: isLogDialogOpen,
|
|
@@ -7964,7 +7966,7 @@ const TaskContainer = memo(({ type, elementConfig, renderElement }) => {
|
|
|
7964
7966
|
return runTask({ resourceId, parameters: newParams, script, fileName, methodName });
|
|
7965
7967
|
}));
|
|
7966
7968
|
}, [attributes, currentPage.filters, dataSources, ewktGeometry, layerInfo, projectDataSources, relatedResources, runTask, selectedFilters, stopTask, taskId]);
|
|
7967
|
-
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), jsxs(Flex, { justifyContent: center ? "center" : "flex-start", children: [jsx(StatusWaitingButton, { title: title || t("run", { ns: "dashboard", defaultValue: "Запуск" }), icon: icon, status: status, statusColors: statusColors, isWaiting: loading || !!taskId, isDisabled: !relatedResources?.length, onClick: onClick }), !!(log || taskId) && (jsxs(Fragment$1, { children: [jsx(IconButton, { kind: "info", onClick: openLog }), jsx(LogDialog, { logs: log, status: status, statusColors: statusColors, isOpen: isLogDialogOpen, onClose: onCloseLog, onMinimize: useNotifications ? onMinimizeLog : undefined })] }))] })] }));
|
|
7969
|
+
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), jsxs(Flex, { justifyContent: center ? "center" : "flex-start", style: getWrapperSizeStyle(undefined, width, height), children: [jsx(StatusWaitingButton, { title: title || t("run", { ns: "dashboard", defaultValue: "Запуск" }), icon: icon, status: status, statusColors: statusColors, isWaiting: loading || !!taskId, isDisabled: !relatedResources?.length, onClick: onClick }), !!(log || taskId) && (jsxs(Fragment$1, { children: [jsx(IconButton, { kind: "info", onClick: openLog }), jsx(LogDialog, { logs: log, status: status, statusColors: statusColors, isOpen: isLogDialogOpen, onClose: onCloseLog, onMinimize: useNotifications ? onMinimizeLog : undefined })] }))] })] }));
|
|
7968
7970
|
});
|
|
7969
7971
|
|
|
7970
7972
|
const EditContainer = ({ type, elementConfig, renderElement }) => {
|
|
@@ -8705,7 +8707,7 @@ const AttachmentContainer = memo(({ type, elementConfig, renderElement }) => {
|
|
|
8705
8707
|
const { expandedContainers } = useWidgetContext(type);
|
|
8706
8708
|
const { items, visibleItems, viewMode, setViewMode, showMore, setShowMore, hasMore, hiddenCount } = useAttachmentContainer({ type, elementConfig });
|
|
8707
8709
|
const { id, style, options } = elementConfig || {};
|
|
8708
|
-
const { expandable, expanded } = options || {};
|
|
8710
|
+
const { expandable, expanded, width, height } = options || {};
|
|
8709
8711
|
const [previewIndex, setPreviewIndex] = useState(null);
|
|
8710
8712
|
const previewImages = useAttachmentPreviewImages({ items, active: previewIndex !== null });
|
|
8711
8713
|
const handlePreview = useCallback((link) => {
|
|
@@ -8716,7 +8718,7 @@ const AttachmentContainer = memo(({ type, elementConfig, renderElement }) => {
|
|
|
8716
8718
|
const handleClosePreview = useCallback(() => setPreviewIndex(null), []);
|
|
8717
8719
|
const handleShowMore = useCallback(() => setShowMore(true), [setShowMore]);
|
|
8718
8720
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
8719
|
-
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsx(Container, { id: id, style: { ...BASE_CONTAINER_STYLE, ...style }, children: jsxs(Flex, { column: true, children: [jsx(AttachmentsHeader, { alias: renderElement?.({ id: "alias" }), count: items.length, viewMode: viewMode, onChangeViewMode: setViewMode }), jsx(AttachmentsContent, { children: viewMode === "grid" ? (jsx(AttachmentsGrid, { items: visibleItems, isEdit: false, onPreview: handlePreview })) : (jsx(AttachmentsList, { items: visibleItems, isEdit: false, onPreview: handlePreview })) }), hasMore && !showMore && (jsx(ShowMoreButton, { hiddenCount: hiddenCount, onClick: handleShowMore })), previewIndex !== null && (jsx(Preview, { images: previewImages, initialIndex: previewIndex, isOpen: previewIndex !== null, onClose: handleClosePreview, errorTitleText: t("attachments.resourceUnavailable", {
|
|
8721
|
+
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsx(Container, { id: id, style: getWrapperSizeStyle({ ...BASE_CONTAINER_STYLE, ...style }, width, height), children: jsxs(Flex, { column: true, children: [jsx(AttachmentsHeader, { alias: renderElement?.({ id: "alias" }), count: items.length, viewMode: viewMode, onChangeViewMode: setViewMode }), jsx(AttachmentsContent, { children: viewMode === "grid" ? (jsx(AttachmentsGrid, { items: visibleItems, isEdit: false, onPreview: handlePreview })) : (jsx(AttachmentsList, { items: visibleItems, isEdit: false, onPreview: handlePreview })) }), hasMore && !showMore && (jsx(ShowMoreButton, { hiddenCount: hiddenCount, onClick: handleShowMore })), previewIndex !== null && (jsx(Preview, { images: previewImages, initialIndex: previewIndex, isOpen: previewIndex !== null, onClose: handleClosePreview, errorTitleText: t("attachments.resourceUnavailable", {
|
|
8720
8722
|
ns: "common",
|
|
8721
8723
|
defaultValue: "Ресурс недоступен",
|
|
8722
8724
|
}) }, previewIndex))] }) }))] }));
|
|
@@ -12045,6 +12047,18 @@ const getThemeByName = (themeName) => {
|
|
|
12045
12047
|
return themeName === ThemeName.Dark ? darkTheme : defaultTheme;
|
|
12046
12048
|
};
|
|
12047
12049
|
|
|
12050
|
+
/**
|
|
12051
|
+
* Мержит `width`/`height` из options контейнера в inline-style его корневой обёртки.
|
|
12052
|
+
*
|
|
12053
|
+
* Значения размера из options имеют приоритет над одноимёнными полями `style`.
|
|
12054
|
+
* Поле добавляется только когда задано — иначе `style` остаётся нетронутым.
|
|
12055
|
+
*/
|
|
12056
|
+
const getWrapperSizeStyle = (style, width, height) => ({
|
|
12057
|
+
...style,
|
|
12058
|
+
...(width != null && { width }),
|
|
12059
|
+
...(height != null && { height }),
|
|
12060
|
+
});
|
|
12061
|
+
|
|
12048
12062
|
const getDisplayTemplateNameFromAttribute = (attribute) => {
|
|
12049
12063
|
if (attribute?.subType === StringSubType.Attachments) {
|
|
12050
12064
|
return ContainerTemplate.Attachment;
|
|
@@ -14415,5 +14429,5 @@ const Map$1 = ({ zIndex, lowerSiblings, upperSiblings, onError, children, ...res
|
|
|
14415
14429
|
}, children: children }), upperSiblings] }));
|
|
14416
14430
|
};
|
|
14417
14431
|
|
|
14418
|
-
export { ALIGNMENTS, AddFeatureButton, AddFeatureContainer, AlertIconContainer, AttachmentContainer, AttributeGalleryContainer, AttributeLabel, BASE_CONTAINER_STYLE, BaseMapTheme, CHART_TYPES, CONFIG_PAGES_ID, CONFIG_PAGE_ID, CameraContainer, Chart, ChartContainer, ChartLegend, ChartLoading, Container, 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_DROPDOWN_WIDTH, DEFAULT_FILL_EXTRUSION_PAINT, DEFAULT_FILL_PAINT, DEFAULT_FILTER_PADDING, 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, ElementControl, ElementIcon, ElementImage, ElementLegend, ElementLink, ElementMarkdown, ElementSlideshow, ElementSvg, ElementTooltip, ElementValueWrapper, ExpandableTitle, FEATURE_CARD_DEFAULT_COLORS, FEATURE_CARD_OTHER_COLOR, FILTERED_VALUE_OPACITY, FILTER_PREFIX, FeatureCardBackgroundHeader, FeatureCardButtons, FeatureCardContext, FeatureCardDefaultHeader, FeatureCardHeader, FeatureCardProvider, FeatureCardSlideshowHeader, FeatureCardTitle, FeatureControls, FeatureTitleContainer, FiltersContainer, GEOMETRY_ATTRIBUTE, GlobalContext, GlobalProvider, Header, HeaderContainer, HeaderFontColorMixin, HeaderFrontView, HeaderTemplate, HeaderTitleContainer, HiddenTitleItems, IconContainer, ImageContainer, LEFT_PANEL_HEADER_HEIGHT, Layer, LayerDescription, LayerGroup, LayerGroupList, LayerIcon, LayerIconContainer, LayerListContainer, LayerTree, LayersContainer, LayersListWrapper, LinearProgressContainer, LogTerminal, LogoContainer, MAX_CHART_WIDTH, Map$1 as Map, MapContext, MapProvider, NO_CONTENT_VALUE, NUMERIC_ATTRIBUTE_TYPES, NoLiveSnapshotContainer, OneColumnContainer, POLL_SUBTASK_INTERVAL_MS, POLL_SUBTASK_TIMEOUT_MS, PROVIDER_PREFIX, PageNavigator, PageTitle, PageTitleContainer, PagesContainer, Pagination, PresentationHeader, PresentationHeaderButtons, PresentationHeaderTools, PresentationPanelContainer, PresentationPanelWrapper, PresentationWrapper, ProgressContainer, ProviderPrefix, RoundedBackgroundContainer, SAVE_HOOK_RESULT_DURATION, SERVER_NOTIFICATION_EVENT, STACK_BAR_TOTAL_HEIGHT, ScalingFactor, ServerNotificationsContext, ServerNotificationsProvider, SlideshowContainer, SmallPreviewContainer$1 as SmallPreviewContainer, SmallPreviewControl, SmallPreviewCounter, SmallPreviewImages, SmallPreviewLeft, SmallPreviewRight, StackBar, SvgImage, TIME_ZONE_FORMAT, TabsContainer, TextTrim, ThemeName, TitleContainer, TopContainer, TopContainerButtons, TwoColumnContainer, UploadContainer, VIEW_MODES, WidgetType, addDataSource, addDataSources, adjustColor, applyFiltersToCondition, applyQueryFilters, applyTreeFilterToCondition, applyVarsToCondition, asAttributeName, asChartId, asContainerId, asDataSourceName, asFilterName, asLayerName, asModalId, asResourceId, asTabId, checkEqualOrIncludes, checkIsLoading, createConfigLayer, createConfigPage, createNewPageId, createSaveNotificationId, createTreeNode, dateOptions, debounce, decimalOpacityToHex, eqlParametersToPayload, findAttributeInExpression, formatArea, formatAttributeValue, formatChartRelatedValue, formatConditionValue, formatDataSourceCondition, formatDate$1 as formatDate, formatElementValue, formatLength, formatNumber, formatPolygonMeasure, geometryToEwkt, getActualExtrusionHeight, getAttributeByName, getAttributeValue, getAttributesConfiguration, getChartAxes, getChartFilterName, getChartMarkers, getConfigFilter, getContainerComponent, getDashboardHeader, getDataFromAttributes, getDataFromRelatedFeatures, getDataSource, getDataSourceFilterValue, getDate, getDefaultConfig, getDisplayTemplateNameFromAttribute, getElementValue, getFeatureAttributes, getFeatureCardHeader, getFilterComponent, getFilterSelectedItems, getFilterValue, getFormattedAttributes, getGradientColors, getLayerInfo, getLayerInfoFromDataSources, getPagesFromConfig, getPagesFromProjectInfo, getProxyService, getRelatedAttribute, getRenderElement, getResourceUrl, getRootElementId, getSelectedFilterValue, getSlideshowImages, getSvgUrl, getTemplateNameFromAttribute, getThemeByName, getTotalFromAttributes, getTotalFromRelatedFeatures, hexToRgba, isEmptyElementValue, isEmptyValue, isHiddenEmptyValue, isHookActive, isLayerService, isNotValidSelectedTab, isNumeric, isObject, isProxyService, isTreeFilterValue, isVisibleContainer, metersPerPixel, numberOptions, parseClientStyle, parseIconNames, parseIconNamesFromClientStyle, pieChartTooltipFromAttributes, pieChartTooltipFromRelatedFeatures, pointOptions, removeDataSource, rgbToHex, roundTotalSum, sliceShownOtherItems, timeOptions, toRenderableValue, tooltipNameFromAttributes, tooltipValueFromAttributes, tooltipValueFromRelatedFeatures, transparentizeColor, treeNodesToProjectItems, updateDataSource, useAfterSave, useAppHeight, useAttachmentItems, useAttachmentPreviewImages, useAutoCompleteControl, useBeforeSave, useChartChange, useChartData, useContainerAttributes, useCurrentPageLayers, useCustomFeatureSelect, useDashboardHeader, useDataSources, useDebouncedCallback, useDiffPage, useEditGroupAttributes, useExpandableContainers, useExportPdf, useFeatureSaveHooks, useFetchImageWithAuth, useFetchWithAuth, useGetConfigLayer, useGlobalContext, useHeaderRender, useHideIfEmptyDataSource, useIconsFromLayers, useLayerHiddenAttributes, useLayerParams, useMapContext, useMapDraw, useMapImages, useMaxZoomTo, useProjectDashboardInit, usePythonSandbox, usePythonTask, useRedrawLayer, useRelatedDataSourceAttributes, useRemoteTask, useRenderElement, useSavePrototypeBuilder, useServerNotificationsContext, useShownOtherItems, useToggle, useUpdateDataSource, useVisibleProjectItems, useWidgetConfig, useWidgetContext, useWidgetFilters, useWidgetPage, useWindowResize, useZoomToFeatures, useZoomToPoint };
|
|
14432
|
+
export { ALIGNMENTS, AddFeatureButton, AddFeatureContainer, AlertIconContainer, AttachmentContainer, AttributeGalleryContainer, AttributeLabel, BASE_CONTAINER_STYLE, BaseMapTheme, CHART_TYPES, CONFIG_PAGES_ID, CONFIG_PAGE_ID, CameraContainer, Chart, ChartContainer, ChartLegend, ChartLoading, Container, 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_DROPDOWN_WIDTH, DEFAULT_FILL_EXTRUSION_PAINT, DEFAULT_FILL_PAINT, DEFAULT_FILTER_PADDING, 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, ElementControl, ElementIcon, ElementImage, ElementLegend, ElementLink, ElementMarkdown, ElementSlideshow, ElementSvg, ElementTooltip, ElementValueWrapper, ExpandableTitle, FEATURE_CARD_DEFAULT_COLORS, FEATURE_CARD_OTHER_COLOR, FILTERED_VALUE_OPACITY, FILTER_PREFIX, FeatureCardBackgroundHeader, FeatureCardButtons, FeatureCardContext, FeatureCardDefaultHeader, FeatureCardHeader, FeatureCardProvider, FeatureCardSlideshowHeader, FeatureCardTitle, FeatureControls, FeatureTitleContainer, FiltersContainer, GEOMETRY_ATTRIBUTE, GlobalContext, GlobalProvider, Header, HeaderContainer, HeaderFontColorMixin, HeaderFrontView, HeaderTemplate, HeaderTitleContainer, HiddenTitleItems, IconContainer, ImageContainer, LEFT_PANEL_HEADER_HEIGHT, Layer, LayerDescription, LayerGroup, LayerGroupList, LayerIcon, LayerIconContainer, LayerListContainer, LayerTree, LayersContainer, LayersListWrapper, LinearProgressContainer, LogTerminal, LogoContainer, MAX_CHART_WIDTH, Map$1 as Map, MapContext, MapProvider, NO_CONTENT_VALUE, NUMERIC_ATTRIBUTE_TYPES, NoLiveSnapshotContainer, OneColumnContainer, POLL_SUBTASK_INTERVAL_MS, POLL_SUBTASK_TIMEOUT_MS, PROVIDER_PREFIX, PageNavigator, PageTitle, PageTitleContainer, PagesContainer, Pagination, PresentationHeader, PresentationHeaderButtons, PresentationHeaderTools, PresentationPanelContainer, PresentationPanelWrapper, PresentationWrapper, ProgressContainer, ProviderPrefix, RoundedBackgroundContainer, SAVE_HOOK_RESULT_DURATION, SERVER_NOTIFICATION_EVENT, STACK_BAR_TOTAL_HEIGHT, ScalingFactor, ServerNotificationsContext, ServerNotificationsProvider, SlideshowContainer, SmallPreviewContainer$1 as SmallPreviewContainer, SmallPreviewControl, SmallPreviewCounter, SmallPreviewImages, SmallPreviewLeft, SmallPreviewRight, StackBar, SvgImage, TIME_ZONE_FORMAT, TabsContainer, TextTrim, ThemeName, TitleContainer, TopContainer, TopContainerButtons, TwoColumnContainer, UploadContainer, VIEW_MODES, WidgetType, addDataSource, addDataSources, adjustColor, applyFiltersToCondition, applyQueryFilters, applyTreeFilterToCondition, applyVarsToCondition, asAttributeName, asChartId, asContainerId, asDataSourceName, asFilterName, asLayerName, asModalId, asResourceId, asTabId, checkEqualOrIncludes, checkIsLoading, createConfigLayer, createConfigPage, createNewPageId, createSaveNotificationId, createTreeNode, dateOptions, debounce, decimalOpacityToHex, eqlParametersToPayload, findAttributeInExpression, formatArea, formatAttributeValue, formatChartRelatedValue, formatConditionValue, formatDataSourceCondition, formatDate$1 as formatDate, formatElementValue, formatLength, formatNumber, formatPolygonMeasure, geometryToEwkt, getActualExtrusionHeight, getAttributeByName, getAttributeValue, getAttributesConfiguration, getChartAxes, getChartFilterName, getChartMarkers, getConfigFilter, getContainerComponent, getDashboardHeader, getDataFromAttributes, getDataFromRelatedFeatures, getDataSource, getDataSourceFilterValue, getDate, getDefaultConfig, getDisplayTemplateNameFromAttribute, getElementValue, getFeatureAttributes, getFeatureCardHeader, getFilterComponent, getFilterSelectedItems, getFilterValue, getFormattedAttributes, getGradientColors, getLayerInfo, getLayerInfoFromDataSources, getPagesFromConfig, getPagesFromProjectInfo, getProxyService, getRelatedAttribute, getRenderElement, getResourceUrl, getRootElementId, getSelectedFilterValue, getSlideshowImages, getSvgUrl, getTemplateNameFromAttribute, getThemeByName, getTotalFromAttributes, getTotalFromRelatedFeatures, getWrapperSizeStyle, hexToRgba, isEmptyElementValue, isEmptyValue, isHiddenEmptyValue, isHookActive, isLayerService, isNotValidSelectedTab, isNumeric, isObject, isProxyService, isTreeFilterValue, isVisibleContainer, metersPerPixel, numberOptions, parseClientStyle, parseIconNames, parseIconNamesFromClientStyle, pieChartTooltipFromAttributes, pieChartTooltipFromRelatedFeatures, pointOptions, removeDataSource, rgbToHex, roundTotalSum, sliceShownOtherItems, timeOptions, toRenderableValue, tooltipNameFromAttributes, tooltipValueFromAttributes, tooltipValueFromRelatedFeatures, transparentizeColor, treeNodesToProjectItems, updateDataSource, useAfterSave, useAppHeight, useAttachmentItems, useAttachmentPreviewImages, useAutoCompleteControl, useBeforeSave, useChartChange, useChartData, useContainerAttributes, useCurrentPageLayers, useCustomFeatureSelect, useDashboardHeader, useDataSources, useDebouncedCallback, useDiffPage, useEditGroupAttributes, useExpandableContainers, useExportPdf, useFeatureSaveHooks, useFetchImageWithAuth, useFetchWithAuth, useGetConfigLayer, useGlobalContext, useHeaderRender, useHideIfEmptyDataSource, useIconsFromLayers, useLayerHiddenAttributes, useLayerParams, useMapContext, useMapDraw, useMapImages, useMaxZoomTo, useProjectDashboardInit, usePythonSandbox, usePythonTask, useRedrawLayer, useRelatedDataSourceAttributes, useRemoteTask, useRenderElement, useSavePrototypeBuilder, useServerNotificationsContext, useShownOtherItems, useToggle, useUpdateDataSource, useVisibleProjectItems, useWidgetConfig, useWidgetContext, useWidgetFilters, useWidgetPage, useWindowResize, useZoomToFeatures, useZoomToPoint };
|
|
14419
14433
|
//# sourceMappingURL=react.esm.js.map
|