@evergis/react 3.1.18 → 3.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Dashboard/components/SvgImage/styled.d.ts +1 -1
- package/dist/components/Dashboard/hooks/useGlobalContext.d.ts +2 -1
- package/dist/index.js +33 -23
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +33 -23
- package/dist/react.esm.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/Dashboard/components/Dashboard/components/DashboardSoon.d.ts +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const StyledSvg: import('styled-components').StyledComponent<"div", any, {
|
|
1
|
+
export declare const StyledSvg: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & {
|
|
2
2
|
$width?: number;
|
|
3
3
|
$height?: number;
|
|
4
4
|
$fontColor?: string;
|
package/dist/index.js
CHANGED
|
@@ -3946,13 +3946,18 @@ const useWidgetContext = (type = exports.WidgetType.Dashboard) => {
|
|
|
3946
3946
|
|
|
3947
3947
|
const useGlobalContext = () => {
|
|
3948
3948
|
const { t, language, themeName, api, ewktGeometry } = React.useContext(GlobalContext) || {};
|
|
3949
|
+
const translate = React.useCallback((value, options) => {
|
|
3950
|
+
if (t)
|
|
3951
|
+
return t(value, options);
|
|
3952
|
+
return options?.defaultValue ?? value;
|
|
3953
|
+
}, [t]);
|
|
3949
3954
|
return React.useMemo(() => ({
|
|
3950
|
-
t,
|
|
3955
|
+
t: translate,
|
|
3951
3956
|
language,
|
|
3952
3957
|
themeName,
|
|
3953
3958
|
api,
|
|
3954
3959
|
ewktGeometry,
|
|
3955
|
-
}), [language,
|
|
3960
|
+
}), [language, translate, api, ewktGeometry, themeName]);
|
|
3956
3961
|
};
|
|
3957
3962
|
|
|
3958
3963
|
const HEIGHT_OFFSET = 20;
|
|
@@ -5670,7 +5675,7 @@ const DataSourceProgressContainer = React.memo(({ config, elementConfig, type, i
|
|
|
5670
5675
|
return jsxRuntime.jsx(DataSourceError, { name: elementConfig.templateName });
|
|
5671
5676
|
}
|
|
5672
5677
|
const isVisible = isVisibleContainer(id, expandable, expanded, expandedContainers);
|
|
5673
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), !isVisible ? null : dataSource ? (jsxRuntime.jsxs(DataSourceProgressContainerWrapper, { children: [sliceItems(dataSource?.features)?.map((feature, index) => (jsxRuntime.jsx(DataSourceInnerContainer, { type: type, index: index, feature: feature, config: config, elementConfig: elementConfig, maxValue: currentMaxValue, innerComponent: innerComponent }, index))), checkIsSliced(dataSource?.features) && (jsxRuntime.jsx(ContainerToggler, { toggled: showMore, onClick: onShowMore, children: showMore ? t("hide", { ns: "dashboard" }) : t("showAll", { ns: "dashboard" }) })), showTotal && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(uilibGl.Divider, {}), jsxRuntime.jsxs(ProgressTotal, { children: [jsxRuntime.jsx(ProgressTotalTitle, { children: t("total", { ns: "dashboard" }) }), jsxRuntime.jsxs(ProgressValue, { children: [totalValue, jsxRuntime.jsx(ProgressUnits, { children: totalUnits })] })] })] }))] })) : (jsxRuntime.jsx(ContainerLoading, {})), jsxRuntime.jsx(HiddenTitleItems, { elementConfig: elementConfig, config: config, type: type })] }));
|
|
5678
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ExpandableTitle, { elementConfig: elementConfig, type: type, renderElement: renderElement }), !isVisible ? null : dataSource ? (jsxRuntime.jsxs(DataSourceProgressContainerWrapper, { children: [sliceItems(dataSource?.features)?.map((feature, index) => (jsxRuntime.jsx(DataSourceInnerContainer, { type: type, index: index, feature: feature, config: config, elementConfig: elementConfig, maxValue: currentMaxValue, innerComponent: innerComponent }, index))), checkIsSliced(dataSource?.features) && (jsxRuntime.jsx(ContainerToggler, { toggled: showMore, onClick: onShowMore, children: showMore ? t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) : t("showAll", { ns: "dashboard", defaultValue: "Показать все" }) })), showTotal && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(uilibGl.Divider, {}), jsxRuntime.jsxs(ProgressTotal, { children: [jsxRuntime.jsx(ProgressTotalTitle, { children: t("total", { ns: "dashboard", defaultValue: "Итого" }) }), jsxRuntime.jsxs(ProgressValue, { children: [totalValue, jsxRuntime.jsx(ProgressUnits, { children: totalUnits })] })] })] }))] })) : (jsxRuntime.jsx(ContainerLoading, {})), jsxRuntime.jsx(HiddenTitleItems, { elementConfig: elementConfig, config: config, type: type })] }));
|
|
5674
5679
|
});
|
|
5675
5680
|
|
|
5676
5681
|
const ProgressContainer = React.memo(({ type, elementConfig, feature, maxValue, index, renderElement }) => {
|
|
@@ -5705,7 +5710,7 @@ const ProgressContainer = React.memo(({ type, elementConfig, feature, maxValue,
|
|
|
5705
5710
|
id: "icon",
|
|
5706
5711
|
wrap: false
|
|
5707
5712
|
}), [renderElement]);
|
|
5708
|
-
const renderTooltip = React.useMemo(() => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ProgressTooltipAlias, { children: renderTooltipAlias }), jsxRuntime.jsxs(ProgressTooltipValueContainer, { children: [jsxRuntime.jsx(ProgressTooltipValue, { children: renderTooltipValue }), jsxRuntime.jsx(ProgressTooltipValueOf, { children: t("of", { ns: "dashboard" }) }), jsxRuntime.jsx("div", { children: formatAttributeValue({ t, type: valueType, value: currentMaxValue, stringFormat }) })] })] })), [currentMaxValue, renderTooltipAlias, renderTooltipValue, stringFormat, t, valueType]);
|
|
5713
|
+
const renderTooltip = React.useMemo(() => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ProgressTooltipAlias, { children: renderTooltipAlias }), jsxRuntime.jsxs(ProgressTooltipValueContainer, { children: [jsxRuntime.jsx(ProgressTooltipValue, { children: renderTooltipValue }), jsxRuntime.jsx(ProgressTooltipValueOf, { children: t("of", { ns: "dashboard", defaultValue: "из" }) }), jsxRuntime.jsx("div", { children: formatAttributeValue({ t, type: valueType, value: currentMaxValue, stringFormat }) })] })] })), [currentMaxValue, renderTooltipAlias, renderTooltipValue, stringFormat, t, valueType]);
|
|
5709
5714
|
const color = React.useMemo(() => colorAttribute
|
|
5710
5715
|
? attributes?.find(({ name }) => name === colorAttribute)?.value
|
|
5711
5716
|
: colors?.[index] || bgColor, [attributes, bgColor, colorAttribute, colors, index]);
|
|
@@ -6462,16 +6467,22 @@ const RoundedBackgroundContainer = React.memo(({ type, elementConfig, feature, r
|
|
|
6462
6467
|
});
|
|
6463
6468
|
const { options, style, children } = elementConfig || {};
|
|
6464
6469
|
const { maxLength, center, fontColor, innerTemplateStyle, inlineUnits, big, bigIcon, hideEmpty, colorAttribute } = options || {};
|
|
6470
|
+
const iconElement = children?.find(({ id }) => id === "icon");
|
|
6465
6471
|
const aliasElement = children?.find(({ id }) => id === "alias");
|
|
6466
6472
|
const unitsElement = children?.find(({ id }) => id === "units");
|
|
6467
6473
|
const valueElement = children?.find(({ id }) => id === "value");
|
|
6468
6474
|
const value = renderElement({ id: "value" });
|
|
6469
6475
|
const color = React.useMemo(() => attributes?.find(({ name }) => name === colorAttribute)?.value || fontColor, [attributes, colorAttribute, fontColor]);
|
|
6476
|
+
const renderIcon = React.useMemo(() => {
|
|
6477
|
+
if (!iconElement)
|
|
6478
|
+
return null;
|
|
6479
|
+
return (jsxRuntime.jsx(uilibGl.FlexSpan, { width: iconElement.options?.width || "1rem", alignItems: "center", mr: "0.5rem", children: renderElement({ id: "icon", wrap: false }) }));
|
|
6480
|
+
}, [iconElement, renderElement]);
|
|
6470
6481
|
const renderAlias = React.useMemo(() => (jsxRuntime.jsx(ContainerAlias, { style: aliasElement?.style, children: jsxRuntime.jsx(TextTrim, { maxLength: maxLength || ALIAS_DEFAULT_MAX_LENGTH, children: renderElement({ id: "alias", wrap: false }) }) })), [aliasElement?.style, maxLength, renderElement]);
|
|
6471
6482
|
const renderValue = React.useMemo(() => (jsxRuntime.jsxs(ContainerValue, { style: valueElement?.style, big: true, children: [value, !!unitsElement && (jsxRuntime.jsx(ContainerUnits, { style: unitsElement?.style, children: renderElement({ id: "units" }) }))] })), [valueElement?.style, value, unitsElement, renderElement]);
|
|
6472
6483
|
if (!value && hideEmpty)
|
|
6473
6484
|
return null;
|
|
6474
|
-
return (jsxRuntime.jsxs(RoundedBackgroundContainerWrapper, { style: innerTemplateStyle || style, "$center": center, "$color": color, "$inlineUnits": inlineUnits, "$big": big, "$bigIcon": bigIcon, children: [jsxRuntime.jsxs(ContainerIconValue, { children: [
|
|
6485
|
+
return (jsxRuntime.jsxs(RoundedBackgroundContainerWrapper, { style: innerTemplateStyle || style, "$center": center, "$color": color, "$inlineUnits": inlineUnits, "$big": big, "$bigIcon": bigIcon, children: [jsxRuntime.jsxs(ContainerIconValue, { children: [renderIcon, big ? renderAlias : renderValue] }), big ? renderValue : renderAlias] }));
|
|
6475
6486
|
});
|
|
6476
6487
|
|
|
6477
6488
|
const AddFeatureContainer = React.memo(({ elementConfig }) => {
|
|
@@ -6759,7 +6770,7 @@ const HeaderTitle = ({ noFeature }) => {
|
|
|
6759
6770
|
})) ||
|
|
6760
6771
|
feature?.id);
|
|
6761
6772
|
}, [attributes, feature, layerDefinition]);
|
|
6762
|
-
return (jsxRuntime.jsxs(HeaderTitleContainer, { children: [noFeature ? (jsxRuntime.jsx(FeatureTitleContainer, { children: t("noObjectFound", { ns: "dashboard" }) })) : (jsxRuntime.jsx(FeatureTitleContainer, { clickable: true, children: jsxRuntime.jsx(uilibGl.Tooltip, { arrow: true, placement: "top", content: t("zoomToFeature", { ns: "dashboard" }), delay: [600, 0], children: ref => (jsxRuntime.jsx(uilibGl.FlexSpan, { ref: ref, onClick: () => zoomToFeatures([feature]), children: resultTitle })) }) })), jsxRuntime.jsx(LayerDescription, { title: resultDescription, children: resultDescription })] }));
|
|
6773
|
+
return (jsxRuntime.jsxs(HeaderTitleContainer, { children: [noFeature ? (jsxRuntime.jsx(FeatureTitleContainer, { children: t("noObjectFound", { ns: "dashboard", defaultValue: "Объектов не найдено" }) })) : (jsxRuntime.jsx(FeatureTitleContainer, { clickable: true, children: jsxRuntime.jsx(uilibGl.Tooltip, { arrow: true, placement: "top", content: t("zoomToFeature", { ns: "dashboard", defaultValue: "Приблизить к объекту" }), delay: [600, 0], children: ref => (jsxRuntime.jsx(uilibGl.FlexSpan, { ref: ref, onClick: () => zoomToFeatures([feature]), children: resultTitle })) }) })), jsxRuntime.jsx(LayerDescription, { title: resultDescription, children: resultDescription })] }));
|
|
6763
6774
|
};
|
|
6764
6775
|
|
|
6765
6776
|
const LayerIconContainer = styled.div `
|
|
@@ -7169,7 +7180,7 @@ const SmallPreview = ({ images, totalCount, currentIndex, isLoading, setCurrentI
|
|
|
7169
7180
|
onNextPage();
|
|
7170
7181
|
}
|
|
7171
7182
|
}, [currentIndex, images, isNextDisabled, onNextPage, setCurrentIndex]);
|
|
7172
|
-
return (jsxRuntime.jsxs(SmallPreviewContainer$1, { currentIndex: currentIndex + 1, prevIndex: prevIndex + 1, children: [isLoading && jsxRuntime.jsx(uilibGl.LinearProgress, {}), images.length > 1 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SmallPreviewLeft, { "$isDisabled": isPrevDisabled, onClick: prev }), jsxRuntime.jsx(SmallPreviewRight, { "$isDisabled": isNextDisabled, onClick: next }), jsxRuntime.jsx(SmallPreviewCounter, { children: jsxRuntime.jsxs("div", { children: [currentIndex + 1, " ", t("of", { ns: "dashboard" }), " ", total] }) })] })), jsxRuntime.jsx(SmallPreviewImages, { onClick: onClick, children: images.map(image => (jsxRuntime.jsx("img", { src: image.src, alt: "" }, image.src))) })] }));
|
|
7183
|
+
return (jsxRuntime.jsxs(SmallPreviewContainer$1, { currentIndex: currentIndex + 1, prevIndex: prevIndex + 1, children: [isLoading && jsxRuntime.jsx(uilibGl.LinearProgress, {}), images.length > 1 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SmallPreviewLeft, { "$isDisabled": isPrevDisabled, onClick: prev }), jsxRuntime.jsx(SmallPreviewRight, { "$isDisabled": isNextDisabled, onClick: next }), jsxRuntime.jsx(SmallPreviewCounter, { children: jsxRuntime.jsxs("div", { children: [currentIndex + 1, " ", t("of", { ns: "dashboard", defaultValue: "из" }), " ", total] }) })] })), jsxRuntime.jsx(SmallPreviewImages, { onClick: onClick, children: images.map(image => (jsxRuntime.jsx("img", { src: image.src, alt: "" }, image.src))) })] }));
|
|
7173
7184
|
};
|
|
7174
7185
|
|
|
7175
7186
|
const DEFAULT_ARCHIVED_PERIOD = "#24h";
|
|
@@ -7438,7 +7449,7 @@ const LocalLink = React.memo(({ link }) => {
|
|
|
7438
7449
|
navigator.clipboard.writeText(link);
|
|
7439
7450
|
toggleOpen();
|
|
7440
7451
|
}, [link, toggleOpen]);
|
|
7441
|
-
return (jsxRuntime.jsx(uilibGl.Popover, { open: isOpen, zIndex: 10, onRequestClose: toggleOpen, anchorOrigin: "bottom-right", targetOrigin: "top-right", anchor: jsxRuntime.jsx(LocalLinkButton, { onClick: toggleOpen }), children: jsxRuntime.jsxs(LocalLinkBlank, { children: [jsxRuntime.jsx("a", { href: link, target: "_blank", rel: "noreferrer", children: link }), jsxRuntime.jsx(LocalLinkCopy, { children: jsxRuntime.jsx(uilibGl.IconButton, { kind: "copy", onClick: onCopy, children: t("copy", { ns: "dashboard" }) }) })] }) }));
|
|
7452
|
+
return (jsxRuntime.jsx(uilibGl.Popover, { open: isOpen, zIndex: 10, onRequestClose: toggleOpen, anchorOrigin: "bottom-right", targetOrigin: "top-right", anchor: jsxRuntime.jsx(LocalLinkButton, { onClick: toggleOpen }), children: jsxRuntime.jsxs(LocalLinkBlank, { children: [jsxRuntime.jsx("a", { href: link, target: "_blank", rel: "noreferrer", children: link }), jsxRuntime.jsx(LocalLinkCopy, { children: jsxRuntime.jsx(uilibGl.IconButton, { kind: "copy", onClick: onCopy, children: t("copy", { ns: "dashboard", defaultValue: "Копировать" }) }) })] }) }));
|
|
7442
7453
|
});
|
|
7443
7454
|
|
|
7444
7455
|
const ElementLink = React.memo(({ type, elementConfig }) => {
|
|
@@ -7633,7 +7644,7 @@ const getDataFromAttributes = (t, config, attributes) => {
|
|
|
7633
7644
|
return [
|
|
7634
7645
|
...data?.slice(0, config.options?.otherItems),
|
|
7635
7646
|
{
|
|
7636
|
-
name: t("other", { ns: "dashboard" }),
|
|
7647
|
+
name: t("other", { ns: "dashboard", defaultValue: "Другое" }),
|
|
7637
7648
|
color: FEATURE_CARD_OTHER_COLOR,
|
|
7638
7649
|
value: Number(otherValue)
|
|
7639
7650
|
}
|
|
@@ -7696,7 +7707,7 @@ const getDataFromRelatedFeatures = ({ t, config, filters, relatedConfig, dataSou
|
|
|
7696
7707
|
}, []);
|
|
7697
7708
|
if (isOtherSliced) {
|
|
7698
7709
|
result.push({
|
|
7699
|
-
name: t("other", { ns: "dashboard" }),
|
|
7710
|
+
name: t("other", { ns: "dashboard", defaultValue: "Другое" }),
|
|
7700
7711
|
color: FEATURE_CARD_OTHER_COLOR,
|
|
7701
7712
|
value: Number(otherValue)
|
|
7702
7713
|
});
|
|
@@ -7845,7 +7856,7 @@ const RangeNumberFilter = ({ type, filter }) => {
|
|
|
7845
7856
|
const configFilter = getConfigFilter(filterName, configFilters);
|
|
7846
7857
|
if (!configFilter)
|
|
7847
7858
|
return null;
|
|
7848
|
-
return (jsxRuntime.jsx(uilibGl.NumberRangeSlider, { value: value, min: minValue, max: maxValue, step: step || 1, sliderWidth: width ? `${width}px` : "17rem", label: label || t("interval", { ns: "dashboard" }), hasReset: true, onChange: setValue }));
|
|
7859
|
+
return (jsxRuntime.jsx(uilibGl.NumberRangeSlider, { value: value, min: minValue, max: maxValue, step: step || 1, sliderWidth: width ? `${width}px` : "17rem", label: label || t("interval", { ns: "dashboard", defaultValue: "Интервал" }), hasReset: true, onChange: setValue }));
|
|
7849
7860
|
};
|
|
7850
7861
|
|
|
7851
7862
|
const TextFilter = ({ type, filter, config }) => {
|
|
@@ -8025,7 +8036,7 @@ const CheckboxFilter = ({ type, filter, elementConfig }) => {
|
|
|
8025
8036
|
});
|
|
8026
8037
|
changeFilters({ [filterName]: { value } });
|
|
8027
8038
|
} }, optionIndex));
|
|
8028
|
-
}), showMoreBtn && (jsxRuntime.jsx(uilibGl.LegendToggler, { onClick: onShowMore, toggled: showMore, children: showMore ? t("hide", { ns: "dashboard" }) : t("showAll", { ns: "dashboard" }) }))] }));
|
|
8039
|
+
}), showMoreBtn && (jsxRuntime.jsx(uilibGl.LegendToggler, { onClick: onShowMore, toggled: showMore, children: showMore ? t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) : t("showAll", { ns: "dashboard", defaultValue: "Показать все" }) }))] }));
|
|
8029
8040
|
};
|
|
8030
8041
|
|
|
8031
8042
|
const ChartLoading = ({ column }) => (jsxRuntime.jsx(uilibGl.Flex, { position: "absolute", width: "100%", height: "inherit", children: jsxRuntime.jsx(uilibGl.Flex, { justifyContent: "center", alignContent: "center", alignItems: "center", width: "100%", height: "inherit", marginRight: column || column === undefined ? 0 : "-2rem", children: jsxRuntime.jsx(uilibGl.CircularProgress, { diameter: 1.5, mono: true }) }) }));
|
|
@@ -8317,7 +8328,7 @@ const RangeDateFilter = ({ type, filter }) => {
|
|
|
8317
8328
|
}, [value]); // eslint-disable-line
|
|
8318
8329
|
if (!configFilter)
|
|
8319
8330
|
return null;
|
|
8320
|
-
return (jsxRuntime.jsx(uilibGl.RangeNumberInput, { label: label || t("interval", { ns: "dashboard" }), selectedOption: { range: true }, minDate: getDate(minDate), maxDate: getDate(maxDate), value: [getDate(value[0]), getDate(value[1])], zIndex: 100, prefix: jsxRuntime.jsx(uilibGl.Icon, { kind: "date", disabled: true }), suffix: !isEmpty && !isDefault && jsxRuntime.jsx(StyledIconButton, { kind: "error", onClick: reset }), withTime: withTime, isDate: true, onChange: onChange }));
|
|
8331
|
+
return (jsxRuntime.jsx(uilibGl.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: jsxRuntime.jsx(uilibGl.Icon, { kind: "date", disabled: true }), suffix: !isEmpty && !isDefault && jsxRuntime.jsx(StyledIconButton, { kind: "error", onClick: reset }), withTime: withTime, isDate: true, onChange: onChange }));
|
|
8321
8332
|
};
|
|
8322
8333
|
|
|
8323
8334
|
const getFilterComponent = (filterType) => {
|
|
@@ -8386,8 +8397,8 @@ const getFormattedAttributes = (t, data, attributes, config) => {
|
|
|
8386
8397
|
...attributes,
|
|
8387
8398
|
{
|
|
8388
8399
|
...otherAttribute,
|
|
8389
|
-
name: t("other", { ns: "dashboard" }),
|
|
8390
|
-
alias: t("other", { ns: "dashboard" })
|
|
8400
|
+
name: t("other", { ns: "dashboard", defaultValue: "Другое" }),
|
|
8401
|
+
alias: t("other", { ns: "dashboard", defaultValue: "Другое" })
|
|
8391
8402
|
}
|
|
8392
8403
|
]
|
|
8393
8404
|
: attributes;
|
|
@@ -8632,7 +8643,7 @@ const useWidgetPage = (type = exports.WidgetType.Dashboard) => {
|
|
|
8632
8643
|
const pages = getPagesFromProjectInfo(newProjectInfo);
|
|
8633
8644
|
if (!pages)
|
|
8634
8645
|
return;
|
|
8635
|
-
pages.push(createConfigPage({ pages, defaultTitle: t("page", { ns: "dashboard" }) }));
|
|
8646
|
+
pages.push(createConfigPage({ pages, defaultTitle: t("page", { ns: "dashboard", defaultValue: "Страница" }) }));
|
|
8636
8647
|
updateProject(newProjectInfo);
|
|
8637
8648
|
changePage(pages.length);
|
|
8638
8649
|
}, [changePage, projectInfo, t, updateProject]);
|
|
@@ -9290,7 +9301,7 @@ const ChartLegend = ({ data, chartElement, type, twoColumns, loading }) => {
|
|
|
9290
9301
|
const showMoreBtn = !!shownItems && data.length > shownItems;
|
|
9291
9302
|
if (!loading && !data?.length && !!hideEmpty)
|
|
9292
9303
|
return null;
|
|
9293
|
-
return (jsxRuntime.jsxs(uilibGl.Flex, { flexDirection: "column", opacity: loading ? FILTERED_VALUE_OPACITY / 100 : 1, children: [jsxRuntime.jsx(ChartLegendContainer, { twoColumns: twoColumns, children: sliceItems(data)?.map(({ name, color }, index) => (jsxRuntime.jsxs(ChartLegendItem, { hasAnyFilter: hasAnyFilter, isFiltered: isFiltered(name), onClick: axes?.[0]?.filterName ? () => onFilter(name) : undefined, children: [jsxRuntime.jsx(ChartLegendColor, { color: color }), jsxRuntime.jsx(ChartLegendName, { "$fontColor": fontColor, children: name })] }, index))) }), showMoreBtn && (jsxRuntime.jsx(uilibGl.LegendToggler, { onClick: onShowMore, toggled: showMore, children: t("other", { ns: "dashboard" }) }))] }));
|
|
9304
|
+
return (jsxRuntime.jsxs(uilibGl.Flex, { flexDirection: "column", opacity: loading ? FILTERED_VALUE_OPACITY / 100 : 1, children: [jsxRuntime.jsx(ChartLegendContainer, { twoColumns: twoColumns, children: sliceItems(data)?.map(({ name, color }, index) => (jsxRuntime.jsxs(ChartLegendItem, { hasAnyFilter: hasAnyFilter, isFiltered: isFiltered(name), onClick: axes?.[0]?.filterName ? () => onFilter(name) : undefined, children: [jsxRuntime.jsx(ChartLegendColor, { color: color }), jsxRuntime.jsx(ChartLegendName, { "$fontColor": fontColor, children: name })] }, index))) }), showMoreBtn && (jsxRuntime.jsx(uilibGl.LegendToggler, { onClick: onShowMore, toggled: showMore, children: t("other", { ns: "dashboard", defaultValue: "Другое" }) }))] }));
|
|
9294
9305
|
};
|
|
9295
9306
|
|
|
9296
9307
|
const ContainerChildren = React.memo(({ items, isColumn, isMain, renderElement }) => {
|
|
@@ -9339,7 +9350,7 @@ const DashboardHeader = React.memo(() => {
|
|
|
9339
9350
|
|
|
9340
9351
|
const DataSourceError = ({ name }) => {
|
|
9341
9352
|
const { t } = useGlobalContext();
|
|
9342
|
-
return (jsxRuntime.jsxs(DataSourceErrorContainer, { children: [jsxRuntime.jsx(uilibGl.Icon, { kind: "alert" }), jsxRuntime.jsxs("div", { children: [t("block", { ns: "dashboard" }), " \"", name, "\" ", t("isNotLoaded", { ns: "dashboard" })] })] }));
|
|
9353
|
+
return (jsxRuntime.jsxs(DataSourceErrorContainer, { children: [jsxRuntime.jsx(uilibGl.Icon, { kind: "alert" }), jsxRuntime.jsxs("div", { children: [t("block", { ns: "dashboard", defaultValue: "Блок" }), " \"", name, "\" ", t("isNotLoaded", { ns: "dashboard", defaultValue: "не загружен" })] })] }));
|
|
9343
9354
|
};
|
|
9344
9355
|
|
|
9345
9356
|
const ExpandableTitle = React.memo(({ elementConfig, type, renderElement }) => {
|
|
@@ -9394,7 +9405,7 @@ const FeatureCardTitle = ({ title, description }) => {
|
|
|
9394
9405
|
})) ||
|
|
9395
9406
|
feature?.id);
|
|
9396
9407
|
}, [attributes, feature?.id, layerDefinition, title, titleAttribute]);
|
|
9397
|
-
return (jsxRuntime.jsxs(HeaderTitleContainer, { children: [jsxRuntime.jsx(FeatureTitleContainer, { clickable: true, children: jsxRuntime.jsx(uilibGl.Tooltip, { arrow: true, placement: "top", content: t("zoomToFeature", { ns: "dashboard" }), delay: [600, 0], children: ref => (jsxRuntime.jsx(uilibGl.FlexSpan, { ref: ref, onClick: () => zoomToFeatures([feature]), children: resultTitle })) }) }), jsxRuntime.jsx(LayerDescription, { title: resultDescription, children: resultDescription })] }));
|
|
9408
|
+
return (jsxRuntime.jsxs(HeaderTitleContainer, { children: [jsxRuntime.jsx(FeatureTitleContainer, { clickable: true, children: jsxRuntime.jsx(uilibGl.Tooltip, { arrow: true, placement: "top", content: t("zoomToFeature", { ns: "dashboard", defaultValue: "Приблизить к объекту" }), delay: [600, 0], children: ref => (jsxRuntime.jsx(uilibGl.FlexSpan, { ref: ref, onClick: () => zoomToFeatures([feature]), children: resultTitle })) }) }), jsxRuntime.jsx(LayerDescription, { title: resultDescription, children: resultDescription })] }));
|
|
9398
9409
|
};
|
|
9399
9410
|
|
|
9400
9411
|
const HiddenFilters = styled(uilibGl.Flex) `
|
|
@@ -9524,7 +9535,8 @@ const StyledSvgColorMixin = styled.css `
|
|
|
9524
9535
|
}
|
|
9525
9536
|
}
|
|
9526
9537
|
`;
|
|
9527
|
-
const StyledSvg = styled.
|
|
9538
|
+
const StyledSvg = styled(uilibGl.Flex) `
|
|
9539
|
+
align-items: center;
|
|
9528
9540
|
${({ $width }) => !!$width && StyledSvgWidthMixin};
|
|
9529
9541
|
${({ $height }) => !!$height && StyledSvgHeightMixin};
|
|
9530
9542
|
${({ $fontColor }) => !!$fontColor && StyledSvgColorMixin};
|
|
@@ -9548,8 +9560,6 @@ const SvgImage = React.memo(({ url, width, height, fontColor }) => {
|
|
|
9548
9560
|
React.useEffect(() => () => {
|
|
9549
9561
|
setSvg(null);
|
|
9550
9562
|
}, []);
|
|
9551
|
-
// Todo remove the test info
|
|
9552
|
-
console.info("svg", svg);
|
|
9553
9563
|
const regexp = /<\/svg>\s*$/im;
|
|
9554
9564
|
if (!regexp.test(svg))
|
|
9555
9565
|
return null;
|
|
@@ -9569,7 +9579,7 @@ const TextTrim = React.memo(({ maxLength, expandable, lineBreak, children }) =>
|
|
|
9569
9579
|
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: formatValue(text) });
|
|
9570
9580
|
const substring = `${text.substring(0, maxLength)}...`;
|
|
9571
9581
|
if (expandable) {
|
|
9572
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [formatValue(expanded ? text : substring), jsxRuntime.jsx(uilibGl.LegendToggler, { toggled: expanded, onClick: toggleExpanded, children: expanded ? t("hide", { ns: "dashboard" }) : t("more", { ns: "dashboard" }) })] }));
|
|
9582
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [formatValue(expanded ? text : substring), jsxRuntime.jsx(uilibGl.LegendToggler, { toggled: expanded, onClick: toggleExpanded, children: expanded ? t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) : t("more", { ns: "dashboard", defaultValue: "Подробнее" }) })] }));
|
|
9573
9583
|
}
|
|
9574
9584
|
return (jsxRuntime.jsx(uilibGl.Tooltip, { placement: "top", arrow: true, content: text, children: ref => jsxRuntime.jsx("div", { ref: ref, children: formatValue(substring) }) }));
|
|
9575
9585
|
});
|