@evergis/react 3.1.42 → 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/FiltersContainer/components/ChipsFilter.d.ts +3 -0
- package/dist/components/Dashboard/containers/FiltersContainer/components/ChipsFilter.styled.d.ts +3 -0
- package/dist/components/Dashboard/containers/FiltersContainer/components/CustomChip.d.ts +15 -0
- package/dist/components/Dashboard/containers/FiltersContainer/components/CustomChip.styled.d.ts +11 -0
- package/dist/components/Dashboard/containers/index.d.ts +0 -1
- package/dist/components/Dashboard/containers/registry.d.ts +0 -1
- package/dist/components/Dashboard/{containers/TwoColumnsInnerContainer → elements/ElementMarkdown}/index.d.ts +1 -1
- package/dist/components/Dashboard/elements/ElementMarkdown/styled.d.ts +5 -0
- package/dist/components/Dashboard/elements/index.d.ts +1 -0
- package/dist/components/Dashboard/elements/registry.d.ts +1 -0
- package/dist/components/Dashboard/styled.d.ts +0 -1
- package/dist/components/Dashboard/types.d.ts +12 -1
- package/dist/index.js +514 -49
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +515 -49
- package/dist/react.esm.js.map +1 -1
- package/package.json +6 -4
package/dist/react.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
|
-
import { IconButton, Flex, transition, Chip, Icon, Description, FlexSpan, IconToggle, Popup, Menu, DraggableTree, shadows, Divider, LegendToggler, Tooltip as Tooltip$1, DropdownField, MultiSelectContainer, IconButtonButton, FlatButton, DraggableTreeContainer, LinearProgress, H2, ThemeProvider, defaultTheme, Preview, Blank, Popover, darkTheme, NumberRangeSlider, useAsyncAutocomplete, AutoComplete, Dropdown, Checkbox, CircularProgress, RangeNumberInput, dateFormat } from '@evergis/uilib-gl';
|
|
2
|
+
import { IconButton, Flex, transition, Chip, Icon, Description, FlexSpan, IconToggle, Popup, Menu, DraggableTree, shadows, Divider, LegendToggler, Tooltip as Tooltip$1, DropdownField, MultiSelectContainer, IconButtonButton, FlatButton, DraggableTreeContainer, LinearProgress, H2, ThemeProvider, defaultTheme, Preview, Blank, Popover, Expander, darkTheme, NumberRangeSlider, useAsyncAutocomplete, AutoComplete, Dropdown, Checkbox, CircularProgress, RangeNumberInput, dateFormat } from '@evergis/uilib-gl';
|
|
3
3
|
import { createContext, memo, useRef, useState, useEffect, useCallback, useContext, useMemo, Fragment } from 'react';
|
|
4
4
|
import styled, { createGlobalStyle, css, useTheme } from 'styled-components';
|
|
5
5
|
import { lineChartClassNames, BarChart as BarChart$1, barChartClassNames, LineChart, PieChart } from '@evergis/charts';
|
|
@@ -20,6 +20,8 @@ import MapGL, { Source, Layer as Layer$1 } from 'react-map-gl/mapbox';
|
|
|
20
20
|
import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
|
|
21
21
|
import 'mapbox-gl/dist/mapbox-gl.css';
|
|
22
22
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
23
|
+
import ReactMarkdown from 'react-markdown';
|
|
24
|
+
import remarkGfm from 'remark-gfm';
|
|
23
25
|
|
|
24
26
|
const AddFeatureButton = ({ title, icon = "feature_add" /* , layerName, geometryType*/ }) => {
|
|
25
27
|
// const [, handleAddFeature] = useFeatureCreator(layerName, geometryType);
|
|
@@ -4446,24 +4448,48 @@ const formatDataSourceCondition = ({ condition, configFilters, filters, attribut
|
|
|
4446
4448
|
const DashboardChipsContainer = styled(Flex) `
|
|
4447
4449
|
flex-wrap: wrap;
|
|
4448
4450
|
`;
|
|
4451
|
+
const DefaultChipColorMixin = css `
|
|
4452
|
+
&& {
|
|
4453
|
+
color: ${({ theme: { palette } }) => palette.textPrimary};
|
|
4454
|
+
}
|
|
4455
|
+
|
|
4456
|
+
&& > * {
|
|
4457
|
+
color: ${({ theme: { palette } }) => palette.textPrimary};
|
|
4458
|
+
}
|
|
4459
|
+
|
|
4460
|
+
&& span[kind]:after {
|
|
4461
|
+
color: ${({ theme: { palette } }) => palette.icon};
|
|
4462
|
+
}
|
|
4463
|
+
`;
|
|
4464
|
+
const CustomChipColorMixin = css `
|
|
4465
|
+
&& {
|
|
4466
|
+
color: ${({ $fontColor }) => $fontColor};
|
|
4467
|
+
}
|
|
4468
|
+
|
|
4469
|
+
&& > * {
|
|
4470
|
+
color: ${({ $fontColor }) => $fontColor};
|
|
4471
|
+
}
|
|
4472
|
+
|
|
4473
|
+
&& span[kind]:after {
|
|
4474
|
+
color: ${({ $fontColor }) => $fontColor};
|
|
4475
|
+
}
|
|
4476
|
+
`;
|
|
4449
4477
|
const DashboardChip$1 = styled(Chip) `
|
|
4450
4478
|
margin: 0 0.25rem 0.25rem 0;
|
|
4451
4479
|
background: ${({ $isDefault, $bgColor, theme: { palette } }) => $isDefault ? palette.element : $bgColor || palette.primary};
|
|
4452
4480
|
border-radius: ${({ $radius, theme: { borderRadius } }) => $radius || borderRadius.medium};
|
|
4453
4481
|
white-space: nowrap;
|
|
4454
4482
|
font-size: ${({ $fontSize }) => $fontSize || "0.875rem"};
|
|
4455
|
-
color: ${({
|
|
4483
|
+
color: ${({ theme: { palette } }) => palette.iconContrast};
|
|
4456
4484
|
|
|
4457
4485
|
> * {
|
|
4458
4486
|
font-size: ${({ $fontSize }) => $fontSize || "0.875rem"};
|
|
4459
|
-
color: ${({ $isDefault, $fontColor, theme: { palette } }) => $isDefault ? palette.textPrimary : $fontColor || "#fff"};
|
|
4460
4487
|
}
|
|
4461
4488
|
|
|
4462
4489
|
span[kind] {
|
|
4463
4490
|
height: 0.875rem;
|
|
4464
4491
|
|
|
4465
4492
|
:after {
|
|
4466
|
-
color: ${({ $isDefault, $fontColor, theme: { palette } }) => ($isDefault ? palette.icon : $fontColor || "#fff")};
|
|
4467
4493
|
font-size: 0.875rem;
|
|
4468
4494
|
}
|
|
4469
4495
|
}
|
|
@@ -4472,6 +4498,9 @@ const DashboardChip$1 = styled(Chip) `
|
|
|
4472
4498
|
width: auto;
|
|
4473
4499
|
padding: 0 0.5rem;
|
|
4474
4500
|
}
|
|
4501
|
+
|
|
4502
|
+
${({ $isDefault }) => $isDefault && DefaultChipColorMixin}
|
|
4503
|
+
${({ $fontColor, $isDefault }) => !!$fontColor && !$isDefault && CustomChipColorMixin}
|
|
4475
4504
|
`;
|
|
4476
4505
|
|
|
4477
4506
|
const ChartLegendContainer = styled(Flex) `
|
|
@@ -5038,7 +5067,7 @@ const LayerGroup = ({ group, onlyMainTools }) => {
|
|
|
5038
5067
|
if (!group) {
|
|
5039
5068
|
return null;
|
|
5040
5069
|
}
|
|
5041
|
-
return (jsx(LayerGroupContainer, { visible: group.isVisible, children: jsxs(LayerGroupMain, { children: [jsx(Icon, { kind: group.isExpanded ? "
|
|
5070
|
+
return (jsx(LayerGroupContainer, { visible: group.isVisible, children: jsxs(LayerGroupMain, { children: [jsx(Icon, { kind: group.isExpanded ? "tree_folder_opened" : "tree_folder_closed", style: { color: group.clientData.color } }), jsxs(Description, { children: [jsx("div", { style: { wordBreak: "break-word" }, children: group?.alias || group?.name }), jsx(IconButton, { kind: group.isExpanded ? "reduce" : "expand", onClick: () => onToggleExpand(group.name, !group.isExpanded) })] }), jsx(FlexSpan, { children: jsxs(Flex, { flexWrap: "nowrap", p: "0 0.5rem", children: [jsx(FlexSpan, { children: jsx(IconToggle, { kind: group.isVisible ? "password_show" : "password_hide", className: "feature-visible", isSelected: group.isVisible, onClick: () => onToggleVisibility(group.name, !group.isVisible) }) }), !onlyMainTools && (jsx(Popup, { distance: -14, isVisible: isMenuOpen, onRequestClose: toggleMenu, anchor: ref => (jsx(FlexSpan, { children: jsx(IconButton, { innerRef: ref, kind: "menu_vertical", onClick: toggleMenu }) })), children: jsx(Menu, { options: options, selectOption: selectOption }) }))] }) })] }) }));
|
|
5042
5071
|
};
|
|
5043
5072
|
|
|
5044
5073
|
const createTreeNode = (layer, Component, onlyMainTools) => {
|
|
@@ -5101,9 +5130,6 @@ const LayerListContainer = styled(Flex) `
|
|
|
5101
5130
|
const ElementValueWrapper = styled.div `
|
|
5102
5131
|
transition: background-color ${transition.toggle};
|
|
5103
5132
|
`;
|
|
5104
|
-
const InnerContainerWrapper$1 = styled.div `
|
|
5105
|
-
width: 100%;
|
|
5106
|
-
`;
|
|
5107
5133
|
const ContainerWrapper = styled(Flex) `
|
|
5108
5134
|
position: relative;
|
|
5109
5135
|
min-height: 1rem;
|
|
@@ -5446,24 +5472,24 @@ const ContainersGroupContainer = memo(({ elementConfig, type, renderElement }) =
|
|
|
5446
5472
|
const { column, expandable, expanded } = options || {};
|
|
5447
5473
|
const isColumn = column === undefined || column;
|
|
5448
5474
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
5449
|
-
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsx(Container, { style: style, isColumn: isColumn, children: jsx(ContainerChildren, { items: children, elementConfig: elementConfig, isColumn: isColumn, isMain: id?.startsWith(CONFIG_PAGE_ID), renderElement: renderElement }) }))] }));
|
|
5475
|
+
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsx(Container, { id: id, style: style, isColumn: isColumn, children: jsx(ContainerChildren, { items: children, elementConfig: elementConfig, isColumn: isColumn, isMain: id?.startsWith(CONFIG_PAGE_ID), renderElement: renderElement }) }))] }));
|
|
5450
5476
|
});
|
|
5451
5477
|
|
|
5452
5478
|
const OneColumnContainer = memo(({ elementConfig, renderElement }) => {
|
|
5453
|
-
const { options, style } = elementConfig || {};
|
|
5479
|
+
const { id, options, style } = elementConfig || {};
|
|
5454
5480
|
const { innerTemplateStyle, hideEmpty } = options || {};
|
|
5455
5481
|
const value = renderElement({ id: "value" });
|
|
5456
5482
|
const hasUnits = elementConfig?.children?.some(({ id }) => id === "units");
|
|
5457
5483
|
if (!value && hideEmpty)
|
|
5458
5484
|
return null;
|
|
5459
|
-
return (jsxs(Container, { style: innerTemplateStyle || style, children: [jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsxs(ContainerValue, { children: [value, hasUnits && jsx(ContainerUnits, { children: renderElement({ id: "units" }) })] })] }));
|
|
5485
|
+
return (jsxs(Container, { id: id, style: innerTemplateStyle || style, children: [jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsxs(ContainerValue, { children: [value, hasUnits && jsx(ContainerUnits, { children: renderElement({ id: "units" }) })] })] }));
|
|
5460
5486
|
});
|
|
5461
5487
|
|
|
5462
5488
|
const TwoColumnContainer = memo(({ config, elementConfig, type, renderElement }) => {
|
|
5463
5489
|
const { selectedTabId, layerInfo, attributes } = useWidgetContext(type);
|
|
5464
5490
|
const { attributes: renderAttributes } = elementConfig?.options || {};
|
|
5465
5491
|
const renderContainer = useCallback((element, attribute) => {
|
|
5466
|
-
const { options, style, children } = element || {};
|
|
5492
|
+
const { id, options, style, children } = element || {};
|
|
5467
5493
|
const { hideEmpty, innerTemplateStyle } = options || {};
|
|
5468
5494
|
const hasUnits = children?.some(({ id }) => id === "units");
|
|
5469
5495
|
const iconIndex = children?.findIndex(({ id }) => id === "icon");
|
|
@@ -5501,7 +5527,7 @@ const TwoColumnContainer = memo(({ config, elementConfig, type, renderElement })
|
|
|
5501
5527
|
const value = render({ id: "value" });
|
|
5502
5528
|
if (!value && hideEmpty)
|
|
5503
5529
|
return null;
|
|
5504
|
-
return (jsxs(TwoColumnContainerWrapper, { style: innerTemplateStyle || style, children: [jsxs(ContainerAlias, { children: [hasIcon && jsx(ContainerAliasIcon, { children: render({ id: "icon" }) }), render({ id: "alias" }), render({ id: "tooltip" })] }), jsxs(ContainerValue, { big: true, children: [value, hasUnits && jsx(ContainerUnits, { children: render({ id: "units" }) })] })] }, attribute));
|
|
5530
|
+
return (jsxs(TwoColumnContainerWrapper, { id: id, style: innerTemplateStyle || style, children: [jsxs(ContainerAlias, { children: [hasIcon && jsx(ContainerAliasIcon, { children: render({ id: "icon" }) }), render({ id: "alias" }), render({ id: "tooltip" })] }), jsxs(ContainerValue, { big: true, children: [value, hasUnits && jsx(ContainerUnits, { children: render({ id: "units" }) })] })] }, attribute));
|
|
5505
5531
|
}, [attributes, config, getRenderElement, layerInfo, renderElement, selectedTabId, type]);
|
|
5506
5532
|
return renderAttributes?.length ? (jsx(Fragment$1, { children: renderAttributes.map(attribute => renderContainer(elementConfig, attribute)) })) : (renderContainer(elementConfig));
|
|
5507
5533
|
});
|
|
@@ -5692,7 +5718,7 @@ const DataSourceProgressContainer = memo(({ config, elementConfig, type, innerCo
|
|
|
5692
5718
|
dataSources
|
|
5693
5719
|
});
|
|
5694
5720
|
const { attributes } = layerInfo?.configuration?.attributesConfiguration || {};
|
|
5695
|
-
const { id, options, children } = elementConfig || {};
|
|
5721
|
+
const { id, options, children, style } = elementConfig || {};
|
|
5696
5722
|
const { maxValue, showTotal, relatedDataSource, expandable, expanded } = options || {};
|
|
5697
5723
|
const valueElement = children?.find(item => item.id === "value");
|
|
5698
5724
|
const unitsElement = children?.find(item => item.id === "units");
|
|
@@ -5720,7 +5746,7 @@ const DataSourceProgressContainer = memo(({ config, elementConfig, type, innerCo
|
|
|
5720
5746
|
return jsx(DataSourceError, { name: elementConfig.templateName });
|
|
5721
5747
|
}
|
|
5722
5748
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
5723
|
-
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), !isVisible ? null : dataSource ? (jsxs(DataSourceProgressContainerWrapper, { 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", { ns: "dashboard", defaultValue: "Показать все" }) })), 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 })] }));
|
|
5749
|
+
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", { ns: "dashboard", defaultValue: "Показать все" }) })), 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 })] }));
|
|
5724
5750
|
});
|
|
5725
5751
|
|
|
5726
5752
|
const ProgressContainer = memo(({ type, elementConfig, feature, maxValue, index, renderElement }) => {
|
|
@@ -5732,7 +5758,7 @@ const ProgressContainer = memo(({ type, elementConfig, feature, maxValue, index,
|
|
|
5732
5758
|
dataSources,
|
|
5733
5759
|
feature
|
|
5734
5760
|
});
|
|
5735
|
-
const { children, options, style } = elementConfig || {};
|
|
5761
|
+
const { id, children, options, style } = elementConfig || {};
|
|
5736
5762
|
const { bgColor, innerTemplateStyle, maxValue: optionMaxValue, hideTitle, innerValue, colors, colorAttribute } = options;
|
|
5737
5763
|
const valueElement = children?.find(({ id }) => id === "value");
|
|
5738
5764
|
const unitsElement = children?.find(({ id }) => id === "units");
|
|
@@ -5759,7 +5785,7 @@ const ProgressContainer = memo(({ type, elementConfig, feature, maxValue, index,
|
|
|
5759
5785
|
const color = useMemo(() => colorAttribute
|
|
5760
5786
|
? attributes?.find(({ name }) => name === colorAttribute)?.value
|
|
5761
5787
|
: colors?.[index] || bgColor, [attributes, bgColor, colorAttribute, colors, index]);
|
|
5762
|
-
return (jsx(Tooltip$1, { content: renderTooltip, placement: "top", arrow: true, children: ref => (jsxs(ProgressContainerWrapper, { ref: ref, style: innerTemplateStyle || style, children: [renderIcon && jsx(ProgressIcon, { children: renderIcon }), jsxs(ProgressContent, { children: [!hideTitle && (jsxs(ProgressAlias, { children: [jsx("div", { children: renderAlias }), jsxs(ProgressValue, { children: [renderValue, unitsElement && jsx(ProgressUnits, { children: renderElement({ id: "units" }) })] })] })), jsxs(ProgressBarContainer, { innerValue: innerValue, children: [jsx(ProgressBarWrapper, { children: jsx(ProgressBar, { "$width": width, "$color": color }) }), !!(hideTitle || innerValue) && jsx(ProgressInnerValue, { children: renderValue })] })] })] })) }));
|
|
5788
|
+
return (jsx(Tooltip$1, { content: renderTooltip, placement: "top", arrow: true, children: ref => (jsxs(ProgressContainerWrapper, { ref: ref, id: id, style: innerTemplateStyle || style, children: [renderIcon && jsx(ProgressIcon, { children: renderIcon }), jsxs(ProgressContent, { children: [!hideTitle && (jsxs(ProgressAlias, { children: [jsx("div", { children: renderAlias }), jsxs(ProgressValue, { children: [renderValue, unitsElement && jsx(ProgressUnits, { children: renderElement({ id: "units" }) })] })] })), jsxs(ProgressBarContainer, { innerValue: innerValue, children: [jsx(ProgressBarWrapper, { children: jsx(ProgressBar, { "$width": width, "$color": color }) }), !!(hideTitle || innerValue) && jsx(ProgressInnerValue, { children: renderValue })] })] })] })) }));
|
|
5763
5789
|
});
|
|
5764
5790
|
|
|
5765
5791
|
const RANGE_MIN_VALUE = 0;
|
|
@@ -5953,7 +5979,7 @@ const FiltersContainer = memo(({ elementConfig, config, type, renderElement }) =
|
|
|
5953
5979
|
}, [config, type]);
|
|
5954
5980
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
5955
5981
|
const selectedItems = useMemo(() => getFilterSelectedItems(filterItems, filters, configFilters), [configFilters, filters, filterItems]);
|
|
5956
|
-
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, { 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 })] }));
|
|
5982
|
+
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 })] }));
|
|
5957
5983
|
});
|
|
5958
5984
|
|
|
5959
5985
|
const DefaultAttributesContainer = memo(({ type, renderElement }) => {
|
|
@@ -5962,7 +5988,7 @@ const DefaultAttributesContainer = memo(({ type, renderElement }) => {
|
|
|
5962
5988
|
});
|
|
5963
5989
|
|
|
5964
5990
|
const ChartContainer = memo(({ elementConfig, isVisible, type, renderElement }) => {
|
|
5965
|
-
const { options, children } = elementConfig || {};
|
|
5991
|
+
const { id, style, options, children } = elementConfig || {};
|
|
5966
5992
|
const { twoColumns, hideEmpty } = options || {};
|
|
5967
5993
|
const aliasElement = children.find(({ id }) => id === "alias");
|
|
5968
5994
|
const chartElement = children.find(({ id }) => id === "chart");
|
|
@@ -5977,7 +6003,7 @@ const ChartContainer = memo(({ elementConfig, isVisible, type, renderElement })
|
|
|
5977
6003
|
const hasItems = !!data[0]?.items?.length;
|
|
5978
6004
|
if (!loading && !hasItems && hideEmpty)
|
|
5979
6005
|
return null;
|
|
5980
|
-
return (jsxs(
|
|
6006
|
+
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsxs(Container, { id: id, style: style, 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" })) })] }))] }));
|
|
5981
6007
|
});
|
|
5982
6008
|
|
|
5983
6009
|
const PagesContainer = memo(({ type = WidgetType.Dashboard, noBorders }) => {
|
|
@@ -6013,10 +6039,6 @@ const PagesContainer = memo(({ type = WidgetType.Dashboard, noBorders }) => {
|
|
|
6013
6039
|
return (jsx(Container, { id: getRootElementId(type), style: { width }, isMain: true, isColumn: isColumn, noBorders: noBorders, children: jsx(ContainerChildren, { items: filteredChildren, isMain: true, renderElement: renderElement }) }));
|
|
6014
6040
|
});
|
|
6015
6041
|
|
|
6016
|
-
const TwoColumnsInnerContainer = memo(({ renderElement }) => {
|
|
6017
|
-
return (jsxs(Fragment$1, { children: [jsxs(TwoColumnContainerWrapper, { children: [jsxs(Container, { children: [jsx(ContainerAlias, { children: renderElement({ id: "firstAlias" }) }), jsx(ContainerValue, { big: true, children: renderElement({ id: "firstValue" }) })] }), jsxs(Container, { children: [jsx(ContainerAlias, { children: renderElement({ id: "secondAlias" }) }), jsx(ContainerValue, { big: true, children: renderElement({ id: "secondValue" }) })] })] }), renderElement({ id: "thirdContainer" })] }));
|
|
6018
|
-
});
|
|
6019
|
-
|
|
6020
6042
|
const ImageContainerBg$1 = styled.div `
|
|
6021
6043
|
position: absolute;
|
|
6022
6044
|
top: 0;
|
|
@@ -6078,8 +6100,8 @@ const ImageContainerWrapper = styled(Flex) `
|
|
|
6078
6100
|
`;
|
|
6079
6101
|
|
|
6080
6102
|
const ImageContainer = memo(({ elementConfig, renderElement }) => {
|
|
6081
|
-
const { style } = elementConfig || {};
|
|
6082
|
-
return (jsxs(ImageContainerWrapper, { style: style, children: [jsx(ImageContainerTitle, { children: renderElement({ id: "alias" }) }), jsx(ImageContainerText, { children: renderElement({ id: "text" }) }), renderElement({ id: "button" }), jsx(ImageContainerBg$1, { children: renderElement({ id: "image" }) })] }));
|
|
6103
|
+
const { id, style } = elementConfig || {};
|
|
6104
|
+
return (jsxs(ImageContainerWrapper, { id: id, style: style, children: [jsx(ImageContainerTitle, { children: renderElement({ id: "alias" }) }), jsx(ImageContainerText, { children: renderElement({ id: "text" }) }), renderElement({ id: "button" }), jsx(ImageContainerBg$1, { children: renderElement({ id: "image" }) })] }));
|
|
6083
6105
|
});
|
|
6084
6106
|
|
|
6085
6107
|
const IconContainerWrapper = styled(Flex) `
|
|
@@ -6131,7 +6153,8 @@ const IconContainerText = styled.div `
|
|
|
6131
6153
|
`;
|
|
6132
6154
|
|
|
6133
6155
|
const IconContainer = memo(({ elementConfig, renderElement }) => {
|
|
6134
|
-
|
|
6156
|
+
const { id, style } = elementConfig || {};
|
|
6157
|
+
return (jsxs(IconContainerWrapper, { id: id, style: style, children: [jsxs(IconContainerHeaderWrapper, { children: [jsxs(IconContainerHeader, { children: [renderElement({ id: "icon" }), jsx(IconContainerTitle, { children: renderElement({ id: "alias" }) })] }), renderElement({ id: "link" })] }), jsx(IconContainerText, { children: renderElement({ id: "text" }) })] }));
|
|
6135
6158
|
});
|
|
6136
6159
|
|
|
6137
6160
|
const DataSourceContainer = memo(({ config, elementConfig, type, innerComponent, renderElement }) => {
|
|
@@ -6146,7 +6169,7 @@ const DataSourceContainer = memo(({ config, elementConfig, type, innerComponent,
|
|
|
6146
6169
|
return jsx(DataSourceError, { name: elementConfig.templateName });
|
|
6147
6170
|
}
|
|
6148
6171
|
const isLoading = !dataSource?.features;
|
|
6149
|
-
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), !isVisible ? null : dataSource ? (jsx(Container, { 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, {}))] }));
|
|
6172
|
+
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, {}))] }));
|
|
6150
6173
|
});
|
|
6151
6174
|
|
|
6152
6175
|
const SvgContainerColorMixin = css `
|
|
@@ -6172,12 +6195,25 @@ const SvgContainer = styled.div `
|
|
|
6172
6195
|
const ContainerIconTitle = styled(Flex) `
|
|
6173
6196
|
align-items: center;
|
|
6174
6197
|
flex-wrap: nowrap;
|
|
6198
|
+
flex-shrink: 1;
|
|
6199
|
+
flex-grow: 0;
|
|
6175
6200
|
color: ${({ fontColor, theme: { palette } }) => fontColor || palette.textSecondary};
|
|
6176
6201
|
|
|
6202
|
+
> div {
|
|
6203
|
+
flex-shrink: 1;
|
|
6204
|
+
flex-grow: 0;
|
|
6205
|
+
width: auto;
|
|
6206
|
+
}
|
|
6207
|
+
|
|
6208
|
+
${SvgContainer} {
|
|
6209
|
+
flex-shrink: 0;
|
|
6210
|
+
flex-grow: 0;
|
|
6211
|
+
margin-right: 0.5rem;
|
|
6212
|
+
}
|
|
6213
|
+
|
|
6177
6214
|
svg,
|
|
6178
6215
|
img,
|
|
6179
|
-
span[kind]
|
|
6180
|
-
${SvgContainer} {
|
|
6216
|
+
span[kind] {
|
|
6181
6217
|
margin-right: 0.5rem;
|
|
6182
6218
|
}
|
|
6183
6219
|
|
|
@@ -6243,7 +6279,7 @@ const TitleContainer = memo(({ containerId, templateName, layerNames, fontColor,
|
|
|
6243
6279
|
const { expandContainer, expandedContainers, setDashboardLayer } = useWidgetContext(type);
|
|
6244
6280
|
const [layersVisibility, toggleVisibility] = useToggle(true);
|
|
6245
6281
|
const { palette } = useTheme();
|
|
6246
|
-
const { style, options } = elementConfig || {};
|
|
6282
|
+
const { id, style, options } = elementConfig || {};
|
|
6247
6283
|
const { simple, downloadById } = options || {};
|
|
6248
6284
|
const isLayers = templateName === ContainerTemplate.Layers;
|
|
6249
6285
|
const { onExport } = useExportPdf(downloadById);
|
|
@@ -6261,7 +6297,7 @@ const TitleContainer = memo(({ containerId, templateName, layerNames, fontColor,
|
|
|
6261
6297
|
const renderVisibility = useMemo(() => isLayers && (jsx(FlexSpan, { mr: "-1rem", children: jsx(IconToggle, { kind: layersVisibility ? "password_show" : "password_hide", className: "feature-visible", isSelected: layersVisibility, onClick: onToggleVisibility }) })), [isLayers, layersVisibility, onToggleVisibility]);
|
|
6262
6298
|
const renderToggler = useMemo(() => !!containerId &&
|
|
6263
6299
|
expandable && (jsx("div", { children: jsx(LegendToggler, { color: palette.icon, toggled: expandedContainers?.[containerId] !== undefined ? expandedContainers[containerId] : expanded, onClick: onClick }) })), [containerId, expandable, expanded, expandedContainers, onClick, palette.icon]);
|
|
6264
|
-
return (jsx(Container, {
|
|
6300
|
+
return (jsx(Container, { id: id, style: style, isTitle: isVisible, children: jsxs(ContainerTitle, { simple: simple, children: [jsxs(ContainerIconTitle, { fontColor: fontColor, children: [renderElement({ id: "titleIcon", wrap: false }), renderElement({ id: "title" }), !!downloadById && (jsx(IconButton, { kind: "download", onClick: onExport })), isLayers && renderToggler] }), !isLayers && renderToggler, renderVisibility] }) }));
|
|
6265
6301
|
});
|
|
6266
6302
|
|
|
6267
6303
|
const ContainerDivider = styled(Divider) `
|
|
@@ -6270,7 +6306,8 @@ const ContainerDivider = styled(Divider) `
|
|
|
6270
6306
|
`;
|
|
6271
6307
|
|
|
6272
6308
|
const DividerContainer = memo(({ elementConfig, config }) => {
|
|
6273
|
-
|
|
6309
|
+
const { id, style } = elementConfig || {};
|
|
6310
|
+
return (jsx(Container, { id: id, style: style, children: jsx(ContainerDivider, { "$bgColor": config?.options?.bgColor }) }));
|
|
6274
6311
|
});
|
|
6275
6312
|
|
|
6276
6313
|
const SlideshowContainer = memo(({ config, elementConfig, type }) => {
|
|
@@ -6280,7 +6317,7 @@ const SlideshowContainer = memo(({ config, elementConfig, type }) => {
|
|
|
6280
6317
|
elementConfig,
|
|
6281
6318
|
dataSources,
|
|
6282
6319
|
});
|
|
6283
|
-
const { id, options } = elementConfig || {};
|
|
6320
|
+
const { id, style, options } = elementConfig || {};
|
|
6284
6321
|
const { expandable, expanded } = options || {};
|
|
6285
6322
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
6286
6323
|
const render = useMemo(() => getRenderElement({
|
|
@@ -6305,7 +6342,7 @@ const SlideshowContainer = memo(({ config, elementConfig, type }) => {
|
|
|
6305
6342
|
pageIndex,
|
|
6306
6343
|
type,
|
|
6307
6344
|
]);
|
|
6308
|
-
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: render }), isVisible && (jsxs(Container, { style:
|
|
6345
|
+
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({
|
|
6309
6346
|
id: "slideshow",
|
|
6310
6347
|
wrap: false,
|
|
6311
6348
|
}) })] }))] }));
|
|
@@ -6316,7 +6353,7 @@ const CameraContainer = memo(({ elementConfig, type, renderElement }) => {
|
|
|
6316
6353
|
const { id, options, style } = elementConfig || {};
|
|
6317
6354
|
const { expandable, expanded } = options || {};
|
|
6318
6355
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
6319
|
-
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsxs(Container, { style: style, children: [jsx(ContainerAlias, { hasBottomMargin: true, children: renderElement({ id: "alias" }) }), jsx(ContainerValue, { children: renderElement({ id: "value", wrap: false }) })] }))] }));
|
|
6356
|
+
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 }) })] }))] }));
|
|
6320
6357
|
});
|
|
6321
6358
|
|
|
6322
6359
|
const TabAnchor = styled.div `
|
|
@@ -6400,7 +6437,7 @@ const SwiperContainer = styled.div `
|
|
|
6400
6437
|
const TabsContainer = memo(({ elementConfig, type }) => {
|
|
6401
6438
|
const { palette } = useTheme();
|
|
6402
6439
|
const { selectedTabId, setSelectedTabId } = useWidgetContext(type);
|
|
6403
|
-
const { options, style, children: tabs } = elementConfig || {};
|
|
6440
|
+
const { id, options, style, children: tabs } = elementConfig || {};
|
|
6404
6441
|
const { radius, column, bgColor, noBg, onlyIcon, shownItems, maxLength = 12 } = options || {};
|
|
6405
6442
|
const renderIcon = useCallback((icon, active) => {
|
|
6406
6443
|
if (!icon)
|
|
@@ -6418,7 +6455,7 @@ const TabsContainer = memo(({ elementConfig, type }) => {
|
|
|
6418
6455
|
setSelectedTabId(tabs[0].id);
|
|
6419
6456
|
}
|
|
6420
6457
|
}, []);
|
|
6421
|
-
return (jsx(SwiperContainer, { style: style, children: jsx(Swiper, { spaceBetween: 0, slidesPerView: shownItems || 2, children: tabs.map(({ id, value, options: tabOptions }) => (jsxs(SwiperSlide, { children: [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 && (jsx(TabValue, { children: jsx(TextTrim, { maxLength: maxLength, children: value }) }))] }), jsx(TabAnchor, { id: id })] }, id))) }) }));
|
|
6458
|
+
return (jsx(SwiperContainer, { id: id, style: style, children: jsx(Swiper, { spaceBetween: 0, slidesPerView: shownItems || 2, children: tabs.map(({ id, value, options: tabOptions }) => (jsxs(SwiperSlide, { children: [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 && (jsx(TabValue, { children: jsx(TextTrim, { maxLength: maxLength, children: value }) }))] }), jsx(TabAnchor, { id: id })] }, id))) }) }));
|
|
6422
6459
|
});
|
|
6423
6460
|
|
|
6424
6461
|
const ContainerIconValue = styled(Flex) ``;
|
|
@@ -6524,7 +6561,7 @@ const RoundedBackgroundContainer = memo(({ type, elementConfig, feature, renderE
|
|
|
6524
6561
|
dataSources,
|
|
6525
6562
|
feature
|
|
6526
6563
|
});
|
|
6527
|
-
const { options, style, children } = elementConfig || {};
|
|
6564
|
+
const { id, options, style, children } = elementConfig || {};
|
|
6528
6565
|
const { maxLength, center, fontColor, innerTemplateStyle, inlineUnits, big, bigIcon, hideEmpty, colorAttribute } = options || {};
|
|
6529
6566
|
const iconElement = children?.find(({ id }) => id === "icon");
|
|
6530
6567
|
const aliasElement = children?.find(({ id }) => id === "alias");
|
|
@@ -6548,12 +6585,12 @@ const RoundedBackgroundContainer = memo(({ type, elementConfig, feature, renderE
|
|
|
6548
6585
|
const renderValue = useMemo(() => isNil(value) ? null : (jsxs(ContainerValue, { style: valueElement?.style, big: true, children: [value, !!unitsElement && (jsx(ContainerUnits, { style: unitsElement?.style, children: renderElement({ id: "units" }) }))] })), [valueElement?.style, value, unitsElement, renderElement]);
|
|
6549
6586
|
if (isNil(value) && hideEmpty)
|
|
6550
6587
|
return null;
|
|
6551
|
-
return (jsxs(RoundedBackgroundContainerWrapper, { style: innerTemplateStyle || style, "$center": center, "$color": color, "$inlineUnits": inlineUnits, "$big": big, "$bigIcon": bigIcon, children: [jsxs(ContainerIconValue, { children: [renderIcon, big ? renderAlias : renderValue] }), big ? renderValue : renderAlias] }));
|
|
6588
|
+
return (jsxs(RoundedBackgroundContainerWrapper, { id: id, style: innerTemplateStyle || style, "$center": center, "$color": color, "$inlineUnits": inlineUnits, "$big": big, "$bigIcon": bigIcon, children: [jsxs(ContainerIconValue, { children: [renderIcon, big ? renderAlias : renderValue] }), big ? renderValue : renderAlias] }));
|
|
6552
6589
|
});
|
|
6553
6590
|
|
|
6554
6591
|
const AddFeatureContainer = memo(({ elementConfig }) => {
|
|
6555
|
-
const { children, style } = elementConfig || {};
|
|
6556
|
-
return (jsx(Container, { style: style, children: children
|
|
6592
|
+
const { id, children, style } = elementConfig || {};
|
|
6593
|
+
return (jsx(Container, { id: id, style: style, children: children
|
|
6557
6594
|
.filter(({ type }) => type === "button")
|
|
6558
6595
|
.map(({ options }, index) => (jsx(AddFeatureButton, { icon: options?.icon, title: options?.title, layerName: options?.layerName, geometryType: options?.geometryType }, index))) }));
|
|
6559
6596
|
});
|
|
@@ -6587,15 +6624,15 @@ const LayersContainer = memo(({ type, elementConfig, renderElement }) => {
|
|
|
6587
6624
|
return currentPage.layers;
|
|
6588
6625
|
return currentPage.layers.filter(({ name }) => layerNames.includes(name));
|
|
6589
6626
|
}, [currentPage?.layers, layerNames]);
|
|
6590
|
-
return (jsxs(Fragment$1, { children: [jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), isVisible && (jsx(LayersContainerWrapper, { style: style, children: jsx(LayerTree, { layers: layers, onlyMainTools: true }) }))] }));
|
|
6627
|
+
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 }) }))] }));
|
|
6591
6628
|
});
|
|
6592
6629
|
|
|
6593
6630
|
const ExportPdfContainer = memo(({ type, elementConfig }) => {
|
|
6594
6631
|
const { t } = useGlobalContext();
|
|
6595
6632
|
const { loading, onExport } = useExportPdf(getRootElementId(type));
|
|
6596
|
-
const { style, options } = elementConfig || {};
|
|
6633
|
+
const { id, style, options } = elementConfig || {};
|
|
6597
6634
|
const { icon, title } = options || {};
|
|
6598
|
-
return (jsx(Container, { children: jsx(IconButton, { kind: icon || "download", primary: true, disabled: loading,
|
|
6635
|
+
return (jsx(Container, { id: id, style: style, children: jsx(IconButton, { kind: icon || "download", primary: true, disabled: loading, onClick: onExport, children: title ?? t("downloadPdf", { ns: "dashboard", defaultValue: "Скачать PDF" }) }) }));
|
|
6599
6636
|
});
|
|
6600
6637
|
|
|
6601
6638
|
const containerComponents = {
|
|
@@ -6606,7 +6643,6 @@ const containerComponents = {
|
|
|
6606
6643
|
[ContainerTemplate.RoundedBackground]: RoundedBackgroundContainer,
|
|
6607
6644
|
[ContainerTemplate.OneColumn]: OneColumnContainer,
|
|
6608
6645
|
[ContainerTemplate.TwoColumn]: TwoColumnContainer,
|
|
6609
|
-
[ContainerTemplate.TwoColumnsInner]: TwoColumnsInnerContainer,
|
|
6610
6646
|
[ContainerTemplate.DataSource]: DataSourceContainer,
|
|
6611
6647
|
[ContainerTemplate.DataSourceProgress]: DataSourceProgressContainer,
|
|
6612
6648
|
[ContainerTemplate.Progress]: ProgressContainer,
|
|
@@ -7548,6 +7584,169 @@ const ElementLink = memo(({ type, elementConfig }) => {
|
|
|
7548
7584
|
return link.startsWith("http") ? jsx(ExternalLink, { onClick: () => window.open(link) }) : jsx(LocalLink, { link: link });
|
|
7549
7585
|
});
|
|
7550
7586
|
|
|
7587
|
+
const MarkdownWrapper = styled.div `
|
|
7588
|
+
padding: 0;
|
|
7589
|
+
background: transparent;
|
|
7590
|
+
border-radius: 0.5rem;
|
|
7591
|
+
font-family: 'Nunito Sans', sans-serif;
|
|
7592
|
+
color: ${({ theme: { palette } }) => palette.textPrimary};
|
|
7593
|
+
|
|
7594
|
+
/* Paragraphs */
|
|
7595
|
+
p {
|
|
7596
|
+
font-size: 0.875rem;
|
|
7597
|
+
line-height: 1rem;
|
|
7598
|
+
letter-spacing: 0.0052rem;
|
|
7599
|
+
margin: 0 0 1rem 0;
|
|
7600
|
+
font-weight: 400;
|
|
7601
|
+
|
|
7602
|
+
&:last-child {
|
|
7603
|
+
margin-bottom: 0;
|
|
7604
|
+
}
|
|
7605
|
+
}
|
|
7606
|
+
|
|
7607
|
+
/* Headings */
|
|
7608
|
+
h1, h2, h3, h4, h5, h6 {
|
|
7609
|
+
margin: 0 0 0.75rem 0;
|
|
7610
|
+
font-weight: 300;
|
|
7611
|
+
}
|
|
7612
|
+
|
|
7613
|
+
h1 {
|
|
7614
|
+
font-size: 1.5rem;
|
|
7615
|
+
line-height: 1.75rem;
|
|
7616
|
+
}
|
|
7617
|
+
|
|
7618
|
+
h2 {
|
|
7619
|
+
font-size: 1.25rem;
|
|
7620
|
+
line-height: 1.5rem;
|
|
7621
|
+
}
|
|
7622
|
+
|
|
7623
|
+
h3 {
|
|
7624
|
+
font-size: 1rem;
|
|
7625
|
+
line-height: 1.25rem;
|
|
7626
|
+
}
|
|
7627
|
+
|
|
7628
|
+
/* Images */
|
|
7629
|
+
img {
|
|
7630
|
+
max-width: 100%;
|
|
7631
|
+
height: auto;
|
|
7632
|
+
border-radius: 0.5rem;
|
|
7633
|
+
object-fit: cover;
|
|
7634
|
+
margin: 0.75rem 0;
|
|
7635
|
+
}
|
|
7636
|
+
|
|
7637
|
+
/* Links */
|
|
7638
|
+
a {
|
|
7639
|
+
color: ${({ theme: { palette } }) => palette.primary};
|
|
7640
|
+
text-decoration: none;
|
|
7641
|
+
|
|
7642
|
+
&:hover {
|
|
7643
|
+
text-decoration: underline;
|
|
7644
|
+
}
|
|
7645
|
+
}
|
|
7646
|
+
|
|
7647
|
+
/* Lists */
|
|
7648
|
+
ul, ol {
|
|
7649
|
+
margin: 0 0 1rem 0;
|
|
7650
|
+
padding-left: 1.25rem;
|
|
7651
|
+
|
|
7652
|
+
li {
|
|
7653
|
+
font-size: 0.875rem;
|
|
7654
|
+
line-height: 1rem;
|
|
7655
|
+
margin-bottom: 0.5rem;
|
|
7656
|
+
}
|
|
7657
|
+
}
|
|
7658
|
+
|
|
7659
|
+
/* Code */
|
|
7660
|
+
code {
|
|
7661
|
+
background: ${({ theme: { palette } }) => palette.element};
|
|
7662
|
+
padding: 0.125rem 0.375rem;
|
|
7663
|
+
border-radius: 0.25rem;
|
|
7664
|
+
font-family: monospace;
|
|
7665
|
+
font-size: 0.8125rem;
|
|
7666
|
+
}
|
|
7667
|
+
|
|
7668
|
+
pre {
|
|
7669
|
+
background: ${({ theme: { palette } }) => palette.element};
|
|
7670
|
+
padding: 0.75rem;
|
|
7671
|
+
border-radius: 0.25rem;
|
|
7672
|
+
overflow-x: auto;
|
|
7673
|
+
margin: 0.75rem 0;
|
|
7674
|
+
|
|
7675
|
+
code {
|
|
7676
|
+
background: transparent;
|
|
7677
|
+
padding: 0;
|
|
7678
|
+
}
|
|
7679
|
+
}
|
|
7680
|
+
|
|
7681
|
+
/* Hide horizontal rules */
|
|
7682
|
+
hr {
|
|
7683
|
+
display: none;
|
|
7684
|
+
}
|
|
7685
|
+
`;
|
|
7686
|
+
styled(Flex) `
|
|
7687
|
+
align-items: center;
|
|
7688
|
+
gap: 1rem;
|
|
7689
|
+
margin-top: 1rem;
|
|
7690
|
+
`;
|
|
7691
|
+
styled.span `
|
|
7692
|
+
display: block;
|
|
7693
|
+
font-size: 0.75rem;
|
|
7694
|
+
line-height: 0.875rem;
|
|
7695
|
+
opacity: 0.36;
|
|
7696
|
+
margin: 0 0 0.5rem 0;
|
|
7697
|
+
`;
|
|
7698
|
+
styled.div `
|
|
7699
|
+
width: 1.25rem;
|
|
7700
|
+
height: 1.25rem;
|
|
7701
|
+
cursor: pointer;
|
|
7702
|
+
transition: opacity 0.2s;
|
|
7703
|
+
|
|
7704
|
+
&:hover {
|
|
7705
|
+
opacity: 0.7;
|
|
7706
|
+
}
|
|
7707
|
+
|
|
7708
|
+
img, svg {
|
|
7709
|
+
width: 100%;
|
|
7710
|
+
height: 100%;
|
|
7711
|
+
display: block;
|
|
7712
|
+
}
|
|
7713
|
+
`;
|
|
7714
|
+
const ExpandButton = styled(IconButton) `
|
|
7715
|
+
margin-bottom: 1rem;
|
|
7716
|
+
`;
|
|
7717
|
+
|
|
7718
|
+
const ElementMarkdown = memo(({ elementConfig, type }) => {
|
|
7719
|
+
const { attributes } = useWidgetContext(type);
|
|
7720
|
+
const { t } = useGlobalContext();
|
|
7721
|
+
const [expanded, setExpanded] = useState(false);
|
|
7722
|
+
const { attributeName, value, options } = elementConfig || {};
|
|
7723
|
+
const expandLength = options?.expandLength || 0;
|
|
7724
|
+
// Get markdown content from:
|
|
7725
|
+
// 1. value (static content)
|
|
7726
|
+
// 2. attribute by attributeName (dynamic content from data)
|
|
7727
|
+
let content = value;
|
|
7728
|
+
if (!content && attributeName && attributes) {
|
|
7729
|
+
const attribute = attributes.find(attr => attr.name === attributeName);
|
|
7730
|
+
content = attribute?.value;
|
|
7731
|
+
}
|
|
7732
|
+
if (!content)
|
|
7733
|
+
return null;
|
|
7734
|
+
const markdownString = String(content);
|
|
7735
|
+
const shouldShowExpand = expandLength > 0 && markdownString.length > expandLength;
|
|
7736
|
+
// If expand is not needed, show full content
|
|
7737
|
+
if (!shouldShowExpand) {
|
|
7738
|
+
return (jsx(MarkdownWrapper, { children: jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: markdownString }) }));
|
|
7739
|
+
}
|
|
7740
|
+
// Truncated content for collapsed state
|
|
7741
|
+
const truncatedContent = markdownString.substring(0, expandLength);
|
|
7742
|
+
// Collapsed state
|
|
7743
|
+
if (!expanded) {
|
|
7744
|
+
return (jsxs(MarkdownWrapper, { children: [jsx(ExpandButton, { primary: true, icon: jsx(Expander, { isSelected: false }), onClick: () => setExpanded(true), children: t("more", { ns: "dashboard", defaultValue: "Подробнее" }) }), jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: truncatedContent })] }));
|
|
7745
|
+
}
|
|
7746
|
+
// Expanded state
|
|
7747
|
+
return (jsxs(MarkdownWrapper, { children: [jsx(ExpandButton, { primary: true, icon: jsx(Expander, { isSelected: true }), onClick: () => setExpanded(false), children: t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) }), jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: markdownString })] }));
|
|
7748
|
+
});
|
|
7749
|
+
|
|
7551
7750
|
const SmallPreviewContainer = styled.div `
|
|
7552
7751
|
width: 100%;
|
|
7553
7752
|
height: 100%;
|
|
@@ -7827,6 +8026,7 @@ const elementComponents = {
|
|
|
7827
8026
|
camera: ElementCamera,
|
|
7828
8027
|
chart: ElementChart,
|
|
7829
8028
|
legend: ElementLegend,
|
|
8029
|
+
markdown: ElementMarkdown,
|
|
7830
8030
|
};
|
|
7831
8031
|
|
|
7832
8032
|
const getElementValue = ({ getDefaultContainer, ...props }) => {
|
|
@@ -8418,6 +8618,268 @@ const RangeDateFilter = ({ type, filter }) => {
|
|
|
8418
8618
|
return (jsx(RangeNumberInput, { label: label || t("interval", { ns: "dashboard", defaultValue: "Интервал" }), selectedOption: { range: true }, minDate: getDate(minDate), maxDate: getDate(maxDate), value: [getDate(value[0]), getDate(value[1])], zIndex: 100, prefix: jsx(Icon, { kind: "date", disabled: true }), suffix: !isEmpty && !isDefault && jsx(StyledIconButton, { kind: "error", onClick: reset }), withTime: withTime, isDate: true, onChange: onChange }));
|
|
8419
8619
|
};
|
|
8420
8620
|
|
|
8621
|
+
const getJustifyContent = (align) => {
|
|
8622
|
+
switch (align) {
|
|
8623
|
+
case "center":
|
|
8624
|
+
return "center";
|
|
8625
|
+
case "right":
|
|
8626
|
+
return "flex-end";
|
|
8627
|
+
case "left":
|
|
8628
|
+
default:
|
|
8629
|
+
return "flex-start";
|
|
8630
|
+
}
|
|
8631
|
+
};
|
|
8632
|
+
const ChipsContainer = styled(Flex) `
|
|
8633
|
+
flex-wrap: wrap;
|
|
8634
|
+
gap: 0.25rem;
|
|
8635
|
+
background: transparent;
|
|
8636
|
+
justify-content: ${({ $align }) => getJustifyContent($align)};
|
|
8637
|
+
`;
|
|
8638
|
+
|
|
8639
|
+
const FilterChip = styled.div `
|
|
8640
|
+
display: inline-flex;
|
|
8641
|
+
align-items: center;
|
|
8642
|
+
gap: 0.25rem;
|
|
8643
|
+
padding: 0.3125rem 0.5rem;
|
|
8644
|
+
height: 1.5rem;
|
|
8645
|
+
border-radius: 0.25rem;
|
|
8646
|
+
background-color: ${({ $isActive, $bgColor, theme }) => $bgColor
|
|
8647
|
+
? $bgColor
|
|
8648
|
+
: $isActive
|
|
8649
|
+
? theme.palette?.primary
|
|
8650
|
+
: theme.palette?.elementLight};
|
|
8651
|
+
color: ${({ $isActive, $textColor, theme }) => $textColor
|
|
8652
|
+
? $textColor
|
|
8653
|
+
: $isActive
|
|
8654
|
+
? theme.palette?.textContrast
|
|
8655
|
+
: theme.palette?.textSecondary};
|
|
8656
|
+
cursor: pointer;
|
|
8657
|
+
font-size: 0.75rem;
|
|
8658
|
+
line-height: 0.875rem;
|
|
8659
|
+
white-space: nowrap;
|
|
8660
|
+
flex-shrink: 0;
|
|
8661
|
+
transition: all 0.2s ease-in-out;
|
|
8662
|
+
margin: 0 0.25rem 0 0;
|
|
8663
|
+
box-sizing: border-box;
|
|
8664
|
+
|
|
8665
|
+
&:hover {
|
|
8666
|
+
background-color: ${({ $isActive, $bgColor, theme }) => $isActive
|
|
8667
|
+
? $bgColor || 'inherit'
|
|
8668
|
+
: $bgColor || theme.palette?.elementDark};
|
|
8669
|
+
}
|
|
8670
|
+
`;
|
|
8671
|
+
const ChipIconWrapper = styled.span `
|
|
8672
|
+
display: inline-flex;
|
|
8673
|
+
align-items: center;
|
|
8674
|
+
justify-content: center;
|
|
8675
|
+
width: 0.875rem;
|
|
8676
|
+
height: 0.875rem;
|
|
8677
|
+
flex-shrink: 0;
|
|
8678
|
+
|
|
8679
|
+
svg, img {
|
|
8680
|
+
width: 100%;
|
|
8681
|
+
height: 100%;
|
|
8682
|
+
display: block;
|
|
8683
|
+
}
|
|
8684
|
+
`;
|
|
8685
|
+
const ChipText = styled.span `
|
|
8686
|
+
overflow: hidden;
|
|
8687
|
+
text-overflow: ellipsis;
|
|
8688
|
+
white-space: nowrap;
|
|
8689
|
+
${({ $maxTextWidth }) => $maxTextWidth && `max-width: ${$maxTextWidth / 16}rem;`}
|
|
8690
|
+
`;
|
|
8691
|
+
|
|
8692
|
+
const CustomChip = ({ text, icon, color, primary, secondary, error, disabled, isActive, maxTextWidth, fontColor: customFontColor, backgroundColor: customBackgroundColor, ...props }) => {
|
|
8693
|
+
const theme = useTheme();
|
|
8694
|
+
const { palette } = theme;
|
|
8695
|
+
// Helper to add transparency to hex color
|
|
8696
|
+
const addTransparency = (hex, transparency = '1f') => {
|
|
8697
|
+
// Ensure hex starts with #
|
|
8698
|
+
const cleanHex = hex.startsWith('#') ? hex : `#${hex}`;
|
|
8699
|
+
return `${cleanHex}${transparency}`;
|
|
8700
|
+
};
|
|
8701
|
+
// Calculate colors based on priority:
|
|
8702
|
+
// 1. customFontColor / customBackgroundColor (highest, from options)
|
|
8703
|
+
// 2. color (from attribute)
|
|
8704
|
+
// 3. primary/secondary/error
|
|
8705
|
+
// 4. default theme colors
|
|
8706
|
+
let bgColor;
|
|
8707
|
+
let textColor;
|
|
8708
|
+
if (isActive) {
|
|
8709
|
+
// Priority 1: Custom colors from options
|
|
8710
|
+
if (customFontColor) {
|
|
8711
|
+
textColor = customFontColor;
|
|
8712
|
+
bgColor = customBackgroundColor || addTransparency(customFontColor); // 12% opacity
|
|
8713
|
+
}
|
|
8714
|
+
// Priority 2: Color from attribute
|
|
8715
|
+
else if (color) {
|
|
8716
|
+
textColor = palette.textPrimary; // White text for active chip
|
|
8717
|
+
bgColor = color; // Full color without transparency
|
|
8718
|
+
}
|
|
8719
|
+
// Priority 3: Variant colors
|
|
8720
|
+
else if (primary) {
|
|
8721
|
+
bgColor = theme.message.color.success; // Green
|
|
8722
|
+
textColor = palette.textContrast;
|
|
8723
|
+
}
|
|
8724
|
+
else if (secondary) {
|
|
8725
|
+
bgColor = palette.primary;
|
|
8726
|
+
textColor = palette.textContrast;
|
|
8727
|
+
}
|
|
8728
|
+
else if (error) {
|
|
8729
|
+
bgColor = theme.message.color.warning; // Yellow
|
|
8730
|
+
textColor = palette.textPrimary;
|
|
8731
|
+
}
|
|
8732
|
+
// Priority 4: Default - no colors specified
|
|
8733
|
+
else {
|
|
8734
|
+
textColor = palette.primary;
|
|
8735
|
+
bgColor = addTransparency(palette.primary); // palette.primary + 12%
|
|
8736
|
+
}
|
|
8737
|
+
}
|
|
8738
|
+
else {
|
|
8739
|
+
// Inactive state
|
|
8740
|
+
if (color) {
|
|
8741
|
+
textColor = color; // Use color for text
|
|
8742
|
+
bgColor = addTransparency(color); // Uses default 1f (12%) transparency
|
|
8743
|
+
}
|
|
8744
|
+
// else: No color attribute - leave bgColor and textColor undefined
|
|
8745
|
+
// Styled component will use fallback for inactive: bg = rgba(0,0,0,0.06), text = palette.textSecondary
|
|
8746
|
+
}
|
|
8747
|
+
const renderIcon = useCallback((iconValue) => {
|
|
8748
|
+
if (!iconValue) {
|
|
8749
|
+
return null;
|
|
8750
|
+
}
|
|
8751
|
+
// If icon doesn't contain a dot and doesn't start with /sp/, it's a built-in icon from uilib-gl
|
|
8752
|
+
if (!iconValue.includes(".") && !iconValue.startsWith("/sp/")) {
|
|
8753
|
+
return jsx(Icon, { kind: iconValue });
|
|
8754
|
+
}
|
|
8755
|
+
// If it's an SVG file or resourceId path, use SvgImage component
|
|
8756
|
+
const isSvg = iconValue.endsWith(".svg") || iconValue.startsWith("/sp/resources/file/");
|
|
8757
|
+
if (isSvg) {
|
|
8758
|
+
const iconColor = textColor
|
|
8759
|
+
? textColor
|
|
8760
|
+
: isActive
|
|
8761
|
+
? palette.textContrast
|
|
8762
|
+
: palette.textSecondary;
|
|
8763
|
+
return (jsx(SvgImage, { url: iconValue, width: 14, height: 14, fontColor: iconColor }));
|
|
8764
|
+
}
|
|
8765
|
+
// Otherwise, it's a regular image
|
|
8766
|
+
return jsx("img", { src: iconValue, alt: "" });
|
|
8767
|
+
}, [isActive, textColor, palette.textContrast, palette.textSecondary]);
|
|
8768
|
+
return (jsxs(FilterChip, { "$isActive": isActive, "$bgColor": bgColor, "$textColor": textColor, ...props, children: [icon && jsx(ChipIconWrapper, { children: renderIcon(icon) }), jsx(ChipText, { "$maxTextWidth": maxTextWidth, children: text })] }));
|
|
8769
|
+
};
|
|
8770
|
+
|
|
8771
|
+
const ChipsFilter = ({ type, filter, elementConfig, }) => {
|
|
8772
|
+
const { filters, dataSources, changeFilters } = useWidgetContext(type);
|
|
8773
|
+
const { currentPage } = useWidgetPage(type);
|
|
8774
|
+
const theme = useTheme();
|
|
8775
|
+
const { filters: configFilters } = currentPage;
|
|
8776
|
+
const { options } = elementConfig || {};
|
|
8777
|
+
const { align } = options || {};
|
|
8778
|
+
const { filterName, colorAttribute, iconAttribute, maxTextWidth, icon, fontColor, backgroundColor, } = filter.options;
|
|
8779
|
+
const configFilter = getConfigFilter(filterName, configFilters);
|
|
8780
|
+
const multiSelect = configFilter?.valueType === "array";
|
|
8781
|
+
// Process icon URL (resourceId or direct URL)
|
|
8782
|
+
const processedIcon = icon ? getResourceUrl(icon) : undefined;
|
|
8783
|
+
const chipOptions = useMemo(() => {
|
|
8784
|
+
if (!configFilter)
|
|
8785
|
+
return [];
|
|
8786
|
+
const dataSource = getDataSource(configFilter.relatedDataSource, dataSources);
|
|
8787
|
+
if (!dataSource?.features)
|
|
8788
|
+
return [];
|
|
8789
|
+
const features = dataSource.features;
|
|
8790
|
+
return features.map(feature => {
|
|
8791
|
+
const attrs = feature.attributes;
|
|
8792
|
+
const text = attrs[configFilter.attributeAlias || DEFAULT_ATTRIBUTE_NAME];
|
|
8793
|
+
const value = attrs[configFilter.attributeValue || DEFAULT_ATTRIBUTE_NAME];
|
|
8794
|
+
const chipIcon = iconAttribute
|
|
8795
|
+
? getIconFromAttribute(attrs, iconAttribute)
|
|
8796
|
+
: undefined;
|
|
8797
|
+
const chipColor = colorAttribute
|
|
8798
|
+
? getColorFromAttribute(attrs, colorAttribute, theme)
|
|
8799
|
+
: undefined;
|
|
8800
|
+
return {
|
|
8801
|
+
text,
|
|
8802
|
+
value,
|
|
8803
|
+
color: chipColor,
|
|
8804
|
+
icon: chipIcon,
|
|
8805
|
+
};
|
|
8806
|
+
});
|
|
8807
|
+
}, [configFilter, dataSources, colorAttribute, iconAttribute, theme]);
|
|
8808
|
+
const isChipActive = useCallback((chipValue) => {
|
|
8809
|
+
const currentValue = filters?.[filterName]?.value;
|
|
8810
|
+
if (currentValue === undefined) {
|
|
8811
|
+
return checkEqualOrIncludes(configFilter?.defaultValue, chipValue);
|
|
8812
|
+
}
|
|
8813
|
+
return checkEqualOrIncludes(currentValue, chipValue);
|
|
8814
|
+
}, [filters, filterName, configFilter]);
|
|
8815
|
+
const handleChipClick = useCallback((chipValue) => {
|
|
8816
|
+
const currentValue = filters?.[filterName]?.value;
|
|
8817
|
+
let newValue;
|
|
8818
|
+
if (multiSelect) {
|
|
8819
|
+
const currentArray = Array.isArray(currentValue)
|
|
8820
|
+
? currentValue
|
|
8821
|
+
: currentValue
|
|
8822
|
+
? [currentValue]
|
|
8823
|
+
: [];
|
|
8824
|
+
const valueIndex = currentArray.indexOf(chipValue);
|
|
8825
|
+
if (valueIndex >= 0) {
|
|
8826
|
+
const filtered = currentArray.filter(v => v !== chipValue);
|
|
8827
|
+
if (filtered.length === 0) {
|
|
8828
|
+
newValue = configFilter?.defaultValue || null;
|
|
8829
|
+
}
|
|
8830
|
+
else {
|
|
8831
|
+
newValue = filtered;
|
|
8832
|
+
}
|
|
8833
|
+
}
|
|
8834
|
+
else {
|
|
8835
|
+
newValue = [...currentArray, chipValue];
|
|
8836
|
+
}
|
|
8837
|
+
}
|
|
8838
|
+
else {
|
|
8839
|
+
if (currentValue === chipValue) {
|
|
8840
|
+
newValue = configFilter?.defaultValue || null;
|
|
8841
|
+
}
|
|
8842
|
+
else {
|
|
8843
|
+
newValue = chipValue;
|
|
8844
|
+
}
|
|
8845
|
+
}
|
|
8846
|
+
changeFilters({
|
|
8847
|
+
[filterName]: { value: newValue },
|
|
8848
|
+
});
|
|
8849
|
+
}, [filters, filterName, multiSelect, changeFilters, configFilter]);
|
|
8850
|
+
if (!configFilter)
|
|
8851
|
+
return null;
|
|
8852
|
+
return (jsx(ChipsContainer, { "$align": align, children: chipOptions.map((chip, index) => {
|
|
8853
|
+
const isActive = isChipActive(chip.value);
|
|
8854
|
+
// Use chip.icon from attribute or fallback to static icon
|
|
8855
|
+
const chipIcon = chip.icon || processedIcon;
|
|
8856
|
+
return (jsx(CustomChip, { text: chip.text, icon: chipIcon, color: chip.color, isActive: isActive, maxTextWidth: maxTextWidth, fontColor: fontColor, backgroundColor: backgroundColor, onClick: () => handleChipClick(chip.value), title: chip.text }, index));
|
|
8857
|
+
}) }));
|
|
8858
|
+
};
|
|
8859
|
+
function getColorFromAttribute(option, colorAttribute, theme) {
|
|
8860
|
+
const value = option[colorAttribute];
|
|
8861
|
+
// If value is already a hex color (starts with #), return it directly
|
|
8862
|
+
if (value && typeof value === 'string' && value.startsWith('#')) {
|
|
8863
|
+
return value;
|
|
8864
|
+
}
|
|
8865
|
+
// Otherwise, map string values to theme colors
|
|
8866
|
+
const colorMap = {
|
|
8867
|
+
active: theme?.message?.color?.success,
|
|
8868
|
+
warning: theme?.message?.color?.warning,
|
|
8869
|
+
info: theme?.message?.color?.info,
|
|
8870
|
+
inactive: theme?.palette?.textDisabled,
|
|
8871
|
+
};
|
|
8872
|
+
return value && typeof value === 'string' ? colorMap[value.toLowerCase()] : undefined;
|
|
8873
|
+
}
|
|
8874
|
+
function getIconFromAttribute(option, iconAttribute) {
|
|
8875
|
+
const iconValue = option[iconAttribute];
|
|
8876
|
+
if (!iconValue || typeof iconValue !== 'string') {
|
|
8877
|
+
return undefined;
|
|
8878
|
+
}
|
|
8879
|
+
// Process through getResourceUrl to handle both URLs and resourceIds
|
|
8880
|
+
return getResourceUrl(iconValue);
|
|
8881
|
+
}
|
|
8882
|
+
|
|
8421
8883
|
const getFilterComponent = (filterType) => {
|
|
8422
8884
|
switch (filterType) {
|
|
8423
8885
|
case "checkbox":
|
|
@@ -8430,6 +8892,8 @@ const getFilterComponent = (filterType) => {
|
|
|
8430
8892
|
return RangeDateFilter;
|
|
8431
8893
|
case "text":
|
|
8432
8894
|
return TextFilter;
|
|
8895
|
+
case "chips":
|
|
8896
|
+
return ChipsFilter;
|
|
8433
8897
|
case "dropdown":
|
|
8434
8898
|
default:
|
|
8435
8899
|
return DropdownFilter;
|
|
@@ -8615,7 +9079,9 @@ const getRenderElement = ({ t, config, elementConfig, attributes = [], layerInfo
|
|
|
8615
9079
|
return formatElementValue({ t, value, elementConfig: element, attributes, wrap });
|
|
8616
9080
|
};
|
|
8617
9081
|
|
|
8618
|
-
const getResourceUrl = (url) =>
|
|
9082
|
+
const getResourceUrl = (url) => {
|
|
9083
|
+
return url ? (url.startsWith("http") ? url : `/sp/resources/file/${url}`) : "";
|
|
9084
|
+
};
|
|
8619
9085
|
|
|
8620
9086
|
const getSlideshowImages = ({ element, attribute, }) => {
|
|
8621
9087
|
const { defaultValue, options } = element;
|
|
@@ -9616,7 +10082,7 @@ const ContainerChildren = memo(({ items, isColumn, isMain, renderElement }) => {
|
|
|
9616
10082
|
index,
|
|
9617
10083
|
wrap: isColumn || isMain,
|
|
9618
10084
|
});
|
|
9619
|
-
return isMain ? (jsx(ContainerWrapper, { id: item.id, "data-templatename": item.templateName, children: jsx(DashboardWrapper, { children: render }) }, index)) : (jsx(
|
|
10085
|
+
return isMain ? (jsx(ContainerWrapper, { id: item.id, "data-templatename": item.templateName, children: jsx(DashboardWrapper, { children: render }) }, index)) : (jsx(Fragment, { children: render }, index));
|
|
9620
10086
|
}) }));
|
|
9621
10087
|
});
|
|
9622
10088
|
|
|
@@ -10105,5 +10571,5 @@ const Map$1 = ({ zIndex, lowerSiblings, upperSiblings, onError, children, ...res
|
|
|
10105
10571
|
}, children: children }), upperSiblings] }));
|
|
10106
10572
|
};
|
|
10107
10573
|
|
|
10108
|
-
export { AddFeatureButton, AddFeatureContainer, AttributeGalleryContainer, AttributeLabel, BaseMapTheme, CONFIG_PAGES_ID, CONFIG_PAGE_ID, CameraContainer, Chart, ChartContainer, ChartLegend, ChartLoading, ContainerChildren, ContainerLoading, ContainerTemplate, ContainerWrapper, ContainersGroupContainer, DEFAULT_ATTRIBUTE_NAME, DEFAULT_BARCHART_RADIUS, DEFAULT_BASE_MAP, DEFAULT_CHART_ANGLE, DEFAULT_CHART_HEIGHT, DEFAULT_CHART_WIDTH, DEFAULT_CIRCLE_PAINT, DEFAULT_DASHBOARD_CONFIG, DEFAULT_DATA_SOURCE_LIMIT, DEFAULT_FILL_EXTRUSION_PAINT, DEFAULT_FILL_PAINT, DEFAULT_ID_ATTRIBUTE_NAME, DEFAULT_LAT, DEFAULT_LINE_PAINT, DEFAULT_LNG, DEFAULT_PAGES_CONFIG, DEFAULT_PIECHART_RADIUS, DEFAULT_ZOOM, Dashboard, DashboardCheckbox, DashboardChip, DashboardContent, DashboardContext, DashboardDefaultHeader, DashboardHeader, DashboardLoading, DashboardPlaceholder, DashboardPlaceholderWrap, DashboardProvider, DashboardWrapper, DataSourceContainer, DataSourceError, DataSourceErrorContainer, DataSourceInnerContainer, DataSourceProgressContainer, DateFormat, DefaultAttributesContainer, DefaultHeaderContainer, DefaultHeaderWrapper, DividerContainer, EditGeometryType, ElementButton, ElementCamera, ElementChart, ElementChips, ElementIcon, ElementImage, ElementLegend, ElementLink, ElementSlideshow, ElementSvg, ElementTooltip, ElementValueWrapper, ExpandableTitle, FEATURE_CARD_DEFAULT_COLORS, FEATURE_CARD_OTHER_COLOR, FILTERED_VALUE_OPACITY, FILTER_PREFIX, FeatureCardButtons, FeatureCardContext, FeatureCardDefaultHeader, FeatureCardGradientHeader, FeatureCardHeader, FeatureCardIconHeader, FeatureCardProvider, FeatureCardSlideshowHeader, FeatureCardTitle, FeatureControls, FeatureTitleContainer, FiltersContainer, GEOMETRY_ATTRIBUTE, GlobalContext, GlobalProvider, Header, HeaderContainer, HeaderFrontView, HeaderTemplate, HeaderTitleContainer, HiddenTitleItems, IconContainer, ImageContainer,
|
|
10574
|
+
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, ElementMarkdown, 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, WidgetType, addDataSource, addDataSources, applyFiltersToCondition, applyQueryFilters, applyVarsToCondition, checkEqualOrIncludes, checkIsLoading, convertSpToTurfFeature, createConfigLayer, createConfigPage, createNewPageId, createTreeNode, dateOptions, debounce, decimalOpacityToHex, eqlParametersToPayload, findAttributeInExpression, formatArea, formatAttributeValue, formatChartRelatedValue, formatConditionValue, formatDataSourceCondition, formatDate$1 as formatDate, formatElementValue, formatLength, formatNumber, formatPolygonMeasure, getActualExtrusionHeight, getAttributeByName, getAttributeValue, getAttributesConfiguration, getChartAxes, getChartFilterName, getChartMarkers, getConfigFilter, getContainerComponent, getDashboardHeader, getDataFromAttributes, getDataFromRelatedFeatures, getDataSource, getDataSourceFilterValue, getDate, getDefaultConfig, getElementValue, getFeatureAttributes, getFeatureCardHeader, getFilterComponent, getFilterSelectedItems, getFilterValue, getFormattedAttributes, getGradientColors, getLayerDefinition, getLayerInfo, getLayerInfoFromDataSources, getPagesFromConfig, getPagesFromProjectInfo, getProxyService, getRelatedAttribute, getRenderElement, getResourceUrl, getRootElementId, getSelectedFilterValue, getSlideshowImages, getSvgUrl, getTotalFromAttributes, getTotalFromRelatedFeatures, hexToRgba, isCompositeLayerConfiguration, isEmptyElementValue, isEmptyValue, isHiddenEmptyValue, isLayerService, isNotValidSelectedTab, isNumeric, isObject, isProxyService, isVisibleContainer, numberOptions, parseClientStyle, pieChartTooltipFromAttributes, pieChartTooltipFromRelatedFeatures, pointOptions, removeDataSource, rgbToHex, roundTotalSum, sliceShownOtherItems, timeOptions, tooltipNameFromAttributes, tooltipValueFromAttributes, tooltipValueFromRelatedFeatures, transparentizeColor, treeNodesToProjectItems, useAppHeight, useChartChange, useChartData, useDashboardHeader, useDataSources, useDebouncedCallback, useDiffPage, useExpandableContainers, useExportPdf, useGetConfigLayer, useGlobalContext, useHeaderRender, useLayerParams, useMapContext, useMapDraw, useProjectDashboardInit, useRedrawLayer, useRelatedDataSourceAttributes, useRenderElement, useServerNotificationsContext, useShownOtherItems, useToggle, useUpdateDataSource, useWidgetConfig, useWidgetContext, useWidgetFilters, useWidgetPage, useWindowResize, useZoomToFeatures, useZoomToPoint };
|
|
10109
10575
|
//# sourceMappingURL=react.esm.js.map
|